diff options
author | Roland Pesch <pesch@cygnus> | 1991-03-18 22:52:40 +0000 |
---|---|---|
committer | Roland Pesch <pesch@cygnus> | 1991-03-18 22:52:40 +0000 |
commit | 06f2bdbf17bef6866ff19555f19c1d1329aafc62 (patch) | |
tree | 485f712e1d1dc77de2c01ec2ef21bd6bffb6eb2c /gas/doc | |
parent | 402c81bfc0594270bfbb5fcc9af590993b66d645 (diff) | |
download | gdb-06f2bdbf17bef6866ff19555f19c1d1329aafc62.zip gdb-06f2bdbf17bef6866ff19555f19c1d1329aafc62.tar.gz gdb-06f2bdbf17bef6866ff19555f19c1d1329aafc62.tar.bz2 |
Introduced macro _CS__ for calculated chapter/section/sub... level headings.
Diffstat (limited to 'gas/doc')
-rw-r--r-- | gas/doc/pretex.m4 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gas/doc/pretex.m4 b/gas/doc/pretex.m4 index 826c128..da62d49 100644 --- a/gas/doc/pretex.m4 +++ b/gas/doc/pretex.m4 @@ -219,4 +219,34 @@ _define__( <<>_dnl__<>>, <_popf__<>_ifelse__(0,_IF_FS__, <_divert__<>_dnl__<>>,<>)>)>) + +D. CHAPTER/SECTION MACRO +In a parametrized manual, the heading level may need to be calculated; +for example, a manual that has a chapter on machine dependencies +should be conditionally structured as follows: + - IF the manual is configured for a SINGLE machine type, use +the chapter heading for that machine type, and run headings down +from there (top level for a particular machine is chapter, then within +that we have section, subsection etc); + - ELSE, if MANY machine types are described in the chapter, +use a generic chapter heading such as "@chapter Machine Dependencies", +use "section" for the top level description of EACH machine, and run +headings down from there (top level for a particular machine is +section, then within that we have subsection, subsubsection etc). + +The macro <_CS__> is for this purpose: its argument is evaluated (so +you can construct expressions to express choices such as above), then +expands as follows: + 0: @chapter + 1: @section + 2: @subsection + 3: @subsubsection + ...and so on. + +_define__(<_CS__>,<@_cs__(_eval__($1))>) +_define__(<_cs__>,<_ifelse__( + 0, $1, <chapter>, + 1, $1, <section>, + <sub<>_cs__(_eval__($1 - 1))>)>) + _divert__<>_dnl__<> |