1
.\" Copyright (c) 1991, 1993
2
.\" The Regents of the University of California. All rights reserved.
4
.\" Redistribution and use in source and binary forms, with or without
5
.\" modification, are permitted provided that the following conditions
7
.\" 1. Redistributions of source code must retain the above copyright
8
.\" notice, this list of conditions and the following disclaimer.
9
.\" 2. Redistributions in binary form must reproduce the above copyright
10
.\" notice, this list of conditions and the following disclaimer in the
11
.\" documentation and/or other materials provided with the distribution.
12
.\" 3. All advertising materials mentioning features or use of this software
13
.\" must display the following acknowledgement:
14
.\" This product includes software developed by the University of
15
.\" California, Berkeley and its contributors.
16
.\" 4. Neither the name of the University nor the names of its contributors
17
.\" may be used to endorse or promote products derived from this software
18
.\" without specific prior written permission.
20
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32
.\" @(#)doc 8.1 (Berkeley) 06/08/93
34
.\" Modified by jjc@jclark.com as follows: the doc-* files are assumed to be
35
.\" installed as mdoc/doc-* rather than tmac.doc-* (the filename
36
.\" `tmac.doc-common' would be too long); when using groff, the doc-* files
37
.\" are loaded using the `mso' request.
41
.\" Werner LEMBERG <wl@gnu.org> and
42
.\" Ruslan Ermilov <ru@freebsd.org>
44
.\" to make it more readable: using long names and many groff features,
45
.\" updating and extending documentation, etc.
51
. ab This version of mdoc can be run with GNU troff only!
57
.if (\n[.x]\n[.y] < 117) \
58
. ab You need GNU troff version 1.17 or higher to run this version of mdoc!
61
.\" Load start-up files
63
. mso mdoc/doc-ditroff
74
.\" NS doc-macro-name global string
75
.\" NS name of calling request (set in each user-requestable macro)
78
.als doc-arg0 doc-macro-name
81
.\" NS doc-arg-limit global register
82
.\" NS total number of arguments
87
.\" NS doc-num-args global register
88
.\" NS number of arguments to handle (must be set to \n[.$] prior to
89
.\" NS `doc-parse-arg-vector' request)
94
.\" NS doc-arg-ptr global register
95
.\" NS argument pointer
100
.\" NS doc-argXXX global string
101
.\" NS argument vector
109
.\" NS doc-typeXXX global register
110
.\" NS argument type vector (macro=1, string=2, punctuation suffix=3,
111
.\" NS punctuation prefix=4)
119
.\" NS doc-spaceXXX global string
128
.\" NS doc-parse-args macro
129
.\" NS parse arguments (recursively) (`.doc-parse-args arg ...')
138
.\" NS doc-have-space
140
.\" NS local variables:
146
. if !\n[doc-arg-limit] \
149
. nr doc-have-space 0
154
. nr doc-arg-limit +1
156
. \" handle `|' and `...' specially
158
. ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
159
. el \{ .ie "\$1"..." \
160
. ds doc-arg\n[doc-arg-limit] \|.\|.\|.
162
. ds doc-arg\n[doc-arg-limit] "\$1
165
. \" get argument type and set spacing
166
. doc-get-arg-type* \n[doc-arg-limit]
167
. nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
168
. doc-set-spacing-\n[doc-arg-type]
170
. \" check whether we have processed the last parameter
182
.\" NS doc-parse-arg-vector macro
183
.\" NS parse argument vector (recursive)
185
.\" NS cf. comments in doc-parse-args
195
.\" NS local variables:
200
.de doc-parse-arg-vector
201
. if !\n[doc-arg-limit] \
204
. nr doc-arg-limit +1
206
. ie "\*[doc-arg\n[doc-arg-limit]]"|" \
207
. ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
208
. el \{ .if "\*[doc-arg\n[doc-arg-limit]]"..." \
209
. ds doc-arg\n[doc-arg-limit] \|.\|.\|.
212
. doc-get-arg-type* \n[doc-arg-limit]
213
. nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
214
. doc-set-spacing-\n[doc-arg-type]
216
. ie (\n[doc-num-args] == 1) \{\
222
. doc-parse-arg-vector
229
.\" NS doc-parse-space-vector macro
230
.\" NS parse space vector (recursive)
237
.de doc-parse-space-vector
238
. nr doc-arg-limit +1
240
. doc-set-spacing-\n[doc-type\n[doc-arg-limit]]
242
. ie (\n[doc-num-args] == 1) \
246
. doc-parse-space-vector
251
.\" NS doc-remaining-args macro
252
.\" NS output remaining arguments as-is, separated by spaces (until
253
.\" NS `doc-num-args' is exhausted)
259
.de doc-remaining-args
261
. nop \)\*[doc-arg\n[doc-arg-ptr]]\c
263
. ie (\n[doc-num-args] == 1) \{\
268
. nop \)\*[doc-space]\c
275
.\" NS doc-append-arg macro
276
.\" NS append one argument to argument vector:
277
.\" NS `.doc-append-arg [arg] [type]'
285
. nr doc-arg-limit +1
286
. ds doc-arg\n[doc-arg-limit] "\$1
287
. nr doc-type\n[doc-arg-limit] \$2
288
. doc-set-spacing-\$2
292
.\" NS doc-print-and-reset macro
293
.\" NS finish input line and clean up argument vectors
295
.de doc-print-and-reset
296
. if \n[doc-space-mode] \
302
.\" NS doc-reset-args macro
303
.\" NS reset argument counters
315
. hy \n[doc-hyphen-flags]
321
.\" NS doc-curr-font global register
322
.\" NS saved current font
324
.nr doc-curr-font \n[.f]
327
.\" NS doc-curr-size global register
328
.\" NS saved current font size
330
.nr doc-curr-size \n[.ps]
336
.\" NS handle flags (appends `-' and prints flags): `.Fl [arg ...]'
342
.\" NS doc-macro-name
344
.\" NS local variables:
345
.\" NS doc-reg-Fl (for communication with doc-flag-recursion)
347
.\" NS width register `Fl' set in doc-common
350
. nr doc-curr-font \n[.f]
351
. nr doc-curr-size \n[.ps]
352
. nop \*[doc-Fl-font]\c
354
. if !\n[doc-arg-limit] \{\
355
. ds doc-macro-name Fl
360
. nop \|\-\|\f[P]\s[0]
363
. if !\n[doc-arg-limit] \
367
. ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
369
. nop \|\-\f[P]\s[0]\c
370
. doc-print-and-reset
373
. ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
374
. nop \|\-\f[P]\s[0]\c
375
. \*[doc-arg\n[doc-arg-ptr]]
378
. if (\n[doc-type\n[doc-arg-ptr]] == 3) \
387
.\" NS doc-flag-recursion macro
388
.\" NS `Fl' flag recursion routine (special handling)
393
.\" NS local variables:
398
.de doc-flag-recursion
399
. nr doc-reg-dfr1 \n[doc-type\n[doc-arg-ptr]]
400
. ds doc-str-dfr "\*[doc-arg\n[doc-arg-ptr]]
402
. ie (\n[doc-reg-dfr1] == 1) \{\
407
. nr doc-reg-dfr \n[doc-arg-ptr]
409
. ie (\n[doc-reg-dfr1] == 2) \{\
410
. \" handle vertical bar -- doc-reg-Fl is set for the first call of
411
. \" doc-flag-recursion only; we need this to make `.Fl | ...' work
413
. ie "\*[doc-str-dfr]"\*[Ba]" \{\
414
. if \n[doc-reg-Fl] \
415
. nop \|\-\*[doc-space]\c
419
. ie "\*[doc-str-dfr]"\f[R]|\f[P]" \{\
420
. if \n[doc-reg-Fl] \
421
. nop \|\-\*[doc-space]\c
425
. \" two consecutive hyphen characters?
426
. ie "\*[doc-str-dfr]"-" \
429
. nop \|\%\-\*[doc-str-dfr]\c
432
. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
433
. nop \)\*[doc-str-dfr]\f[P]\s[0]\c
436
. ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
438
. if (\n[doc-reg-dfr1] == 4) \
441
. doc-print-and-reset
445
. ie (\n[doc-type\n[doc-arg-ptr]] == 3) \{\
446
. ie (\n[doc-type\n[doc-reg-dfr]] == 4) \
449
. nop \)\*[doc-space\n[doc-reg-dfr]]\c
452
. nop \)\*[doc-space\n[doc-reg-dfr]]\c
456
. doc-flag-recursion \$@
461
.\" NS doc-print-recursive macro
462
.\" NS general name recursion routine (print remaining arguments)
467
.\" NS local variables:
472
.de doc-print-recursive
473
. nr doc-reg-dpr1 \n[doc-type\n[doc-arg-ptr]]
474
. ds doc-str-dpr "\*[doc-arg\n[doc-arg-ptr]]
476
. ie (\n[doc-reg-dpr1] == 1) \{\
477
. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
481
. nr doc-reg-dpr \n[doc-arg-ptr]
483
. ie (\n[doc-reg-dpr1] == 2) \
484
. \" the `\%' prevents hyphenation on a dash (`-')
485
. nop \%\*[doc-str-dpr]\&\c
487
. \" punctuation character
488
. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
489
. nop \)\*[doc-str-dpr]\f[P]\s[0]\c
493
. ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
495
. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
496
. doc-print-and-reset
499
. nop \)\*[doc-space\n[doc-reg-dpr]]\c
500
. doc-print-recursive
505
.\" NS doc-print-prefixes macro
506
.\" NS print leading prefixes
511
.de doc-print-prefixes
512
. while (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
513
. if !(\n[doc-type\n[doc-arg-ptr]] == 4) \
515
. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
516
. nop \)\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]\c
522
.\" NS doc-generic-macro macro
523
.\" NS this is the skeleton for most simple macros
529
.\" NS doc-macro-name
531
.de doc-generic-macro
532
. if !\n[doc-arg-limit] \{\
534
. ds doc-macro-name \$0
538
. tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
541
. if !\n[doc-arg-limit] \
545
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
546
. if (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
547
. tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
549
. \" the right action here would be to reset the argument counters
550
. \" and bail out -- unfortunately, a small number of manual pages
551
. \" (less than 2% for FreeBSD which has been used for testing)
552
. \" relied on the old behaviour (silently ignore this error),
553
. \" so it is commented out
558
. nr doc-curr-font \n[.f]
559
. nr doc-curr-size \n[.ps]
560
. nop \*[doc-\$0-font]\c
561
. doc-print-recursive
565
. tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
572
.\" NS command line `argument' macro: `.Ar [args ...]'
578
.\" NS doc-macro-name
580
.\" NS local variable:
581
.\" NS doc-str-Ar-default
583
.\" NS width register `Ar' set in doc-common
585
.ds doc-str-Ar-default "file\ .\|.\|.
588
. nr doc-curr-font \n[.f]
589
. nr doc-curr-size \n[.ps]
590
. nop \*[doc-Ar-font]\c
592
. if !\n[doc-arg-limit] \{\
593
. ds doc-macro-name Ar
598
. nop \)\*[doc-str-Ar-default]\&\f[P]\s[0]
601
. if !\n[doc-arg-limit] \
606
. ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
607
. nop \)\*[doc-str-Ar-default]\&\f[P]\s[0]\c
608
. doc-print-and-reset
611
. if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
612
. \" replace previous argument (Ar) with default value
614
. ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Ar-default]
615
. nr doc-type\n[doc-arg-ptr] 2
616
. ds doc-space\n[doc-arg-ptr] "\*[doc-space]
618
. \" recompute space vector for remaining arguments
619
. nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
620
. nr doc-arg-limit \n[doc-arg-ptr]
621
. doc-parse-space-vector
623
. doc-print-recursive
631
.\" NS width register `Ad' set in doc-common
633
.als Ad doc-generic-macro
634
.ds doc-Ad-usage address
637
.\" NS doc-indent-synopsis global register
638
.\" NS indentation in synopsis
640
.nr doc-indent-synopsis 0
643
.\" NS doc-indent-synopsis-active global register (bool)
644
.\" NS indentation in synopsis active
646
.nr doc-indent-synopsis-active 0
650
.\" NS config declaration (for section 4 SYNOPSIS)
652
.\" NS this function causes a break; it uses the `Nm' font
658
.\" NS doc-indent-synopsis
659
.\" NS doc-macro-name
661
.\" NS width register `Cd' set in doc-common
664
. if !\n[doc-arg-limit] \{\
666
. ds doc-macro-name Cd
670
. tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
673
. if !\n[doc-arg-limit] \
677
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
678
. nr doc-curr-font \n[.f]
679
. nr doc-curr-size \n[.ps]
681
. ie \n[doc-in-synopsis-section] \{\
682
. if "\*[doc-macro-name]"Cd" \{\
684
. if !\n[doc-indent-synopsis] \
685
. nr doc-indent-synopsis \n[doc-display-indent]u
686
. if !\n[doc-indent-synopsis-active] \
687
. in +\n[doc-indent-synopsis]u
688
. ti -\n[doc-indent-synopsis]u
689
. nop \*[doc-Nm-font]\c
690
. doc-print-recursive
691
. if !\n[doc-indent-synopsis-active] \
692
. in -\n[doc-indent-synopsis]u
695
. nop \*[doc-Nm-font]\c
696
. doc-print-recursive
699
. tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
706
.\" NS interactive command modifier (flag)
708
.\" NS width register `Cm' set in doc-common
710
.als Cm doc-generic-macro
711
.ds doc-Cm-usage interactive_command_modifier
715
.\" NS defined variable
717
.\" NS this function uses the `Er' font
719
.\" NS width register `Dv' set in doc-common
721
.als Dv doc-generic-macro
722
.ds doc-Dv-usage defined_variable
723
.als doc-Dv-font doc-Er-font
729
.\" NS width register `Em' set in doc-common
731
.als Em doc-generic-macro
732
.ds doc-Em-usage text
738
.\" NS width register `Er' set in doc-common
740
.als Er doc-generic-macro
741
.ds doc-Er-usage text
745
.\" NS environment variable
747
.\" NS width register `Ev' set in doc-common
749
.als Ev doc-generic-macro
750
.ds doc-Ev-usage text
753
.\" NS doc-have-decl global register (bool)
754
.\" NS subroutine test (in synopsis only)
759
.\" NS doc-have-var global register (bool)
760
.\" NS whether last type is a variable type
765
.\" NS doc-do-func-decl macro
766
.\" NS do someting special while in SYNOPSIS
775
. if \n[doc-in-synopsis-section] \{\
776
. \" if a variable type was the last thing given, want vertical space
777
. if \n[doc-have-var] \{\
781
. \" if a subroutine was the last thing given, want vertical space
782
. if \n[doc-have-func] \{\
783
. ie \n[doc-have-decl] \
791
. nr doc-curr-font \n[.f]
792
. nr doc-curr-size \n[.ps]
797
.\" NS function declaration -- not callable
799
.\" NS this function causes a break
801
.\" NS width register `Fd' set in doc-common
804
. ie ((\n[.$] >= 1) & (\n[doc-arg-limit] == 0)) \{\
806
. nop \*[doc-Fd-font]\$*
808
. ft \n[doc-curr-font]
809
. ps \n[doc-curr-size]u
812
. tm Usage: .Fd function_declaration -- Fd is not callable (#\n[.c])
819
.\" NS #include statement - not callable
821
.\" NS this function causes a break; it uses the `Fd' font
823
.\" NS width register `In' set in doc-common
826
. ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
828
. nop \*[doc-Fd-font]#include <\$1>
830
. ft \n[doc-curr-font]
831
. ps \n[doc-curr-size]u
834
. tm Usage: .In include_file -- In is not callable (#\n[.c])
841
.\" NS function return value
843
.\" NS this function uses the `Ar' font
845
.\" NS width register `Fr' set in doc-common
847
.als Fr doc-generic-macro
848
.ds doc-Fr-usage function_return_value
849
.als doc-Fr-font doc-Ar-font
853
.\" NS interactive command
855
.\" NS width register `Ic' set in doc-common
857
.als Ic doc-generic-macro
858
.ds doc-Ic-usage interactive_command
864
.\" NS width register `Li' set in doc-common
866
.als Li doc-generic-macro
867
.ds doc-Li-usage argument
873
.\" NS this function uses the `Sy' font
875
.\" NS width register `Ms' set in doc-common
877
.als Ms doc-generic-macro
878
.ds doc-Ms-usage math_symbol
879
.als doc-Ms-font doc-Sy-font
882
.\" NS doc-command-name global string
883
.\" NS save first invocation of .Nm
889
.\" NS name of command or page topic
893
.\" NS doc-command-name
896
.\" NS doc-indent-synopsis
897
.\" NS doc-indent-synopsis-active
898
.\" NS doc-macro-name
900
.\" NS width register `Nm' set in doc-common
903
. if !\n[doc-arg-limit] \{\
904
. ds doc-macro-name Nm
908
. ie "\*[doc-command-name]"" \
909
. tm Usage: .Nm name ... (#\n[.c])
911
. doc-parse-args \*[doc-command-name]
914
. if !\n[doc-arg-limit] \
919
. ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
921
. ie "\*[doc-command-name]"" \{\
922
. tm Usage: .Nm name ... (#\n[.c])
926
. nop \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]\c
927
. doc-print-and-reset
930
. nr doc-curr-font \n[.f]
931
. nr doc-curr-size \n[.ps]
933
. ie !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
934
. ie "\*[doc-command-name]"" \
935
. tm Usage: .Nm name ... (#\n[.c])
937
. \" replace previous argument (Nm) with default value
939
. ds doc-arg\n[doc-arg-ptr] "\*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
940
. nr doc-type\n[doc-arg-ptr] 2
941
. ds doc-space\n[doc-arg-ptr] "\*[doc-space]
943
. \" recompute space vector for remaining arguments
944
. nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
945
. nr doc-arg-limit \n[doc-arg-ptr]
946
. doc-parse-space-vector
949
. \" handle `.Nm ...' in SYNOPSIS
950
. if \n[doc-in-synopsis-section] \{\
951
. if "\*[doc-macro-name]"Nm" \{\
953
. if !\n[doc-indent-synopsis] \{\
954
. doc-get-width "\*[doc-arg\n[doc-arg-ptr]]"
955
. nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
957
. if !\n[doc-indent-synopsis-active] \{\
958
. in +\n[doc-indent-synopsis]u
959
. nr doc-indent-synopsis-active 1
961
. ti -\n[doc-indent-synopsis]u
963
. if "\*[doc-command-name]"" \
964
. ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
966
. nop \*[doc-Nm-font]\c
968
. doc-print-recursive
974
.\" NS pathname: `.Pa [arg ...]'
980
.\" NS doc-macro-name
982
.\" NS width register `Pa' set in doc-common
985
. if !\n[doc-arg-limit] \{\
986
. ds doc-macro-name Pa
991
. nop \*[doc-Pa-font]~\f[P]\s[0]
994
. if !\n[doc-arg-limit] \
999
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1000
. nr doc-curr-font \n[.f]
1001
. nr doc-curr-size \n[.ps]
1002
. nop \*[doc-Pa-font]\c
1003
. if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
1004
. \" replace previous argument (Pa) with default value
1006
. ds doc-arg\n[doc-arg-ptr] ~
1007
. nr doc-type\n[doc-arg-ptr] 2
1008
. ds doc-space\n[doc-arg-ptr] "\*[doc-space]
1010
. \" recompute space vector for remaining arguments
1011
. nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
1012
. nr doc-arg-limit \n[doc-arg-ptr]
1013
. doc-parse-space-vector
1015
. doc-print-recursive
1018
. nop \*[doc-Pa-font]~\f[P]\s[0]\c
1019
. doc-print-and-reset
1024
.\" NS Sy user macro
1027
.\" NS width register `Sy' set in doc-common
1029
.als Sy doc-generic-macro
1030
.ds doc-Sy-usage symbolic_text
1033
.\" NS Me user macro
1036
.\" NS width register `Me' set in doc-common
1038
.als Me doc-generic-macro
1039
.ds doc-Me-usage menu_entry
1042
.\" NS Tn user macro
1047
.\" NS doc-curr-font
1048
.\" NS doc-curr-size
1049
.\" NS doc-macro-name
1051
.\" NS width register `Tn' set in doc-common
1054
. if !\n[doc-arg-limit] \{\
1056
. ds doc-macro-name Tn
1057
. doc-parse-args \$@
1060
. tm Usage: .Tn trade_name ... (#\n[.c])
1063
. if !\n[doc-arg-limit] \
1067
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1068
. nr doc-curr-font \n[.f]
1069
. nr doc-curr-size \n[.ps]
1070
. nop \)\*[doc-Tn-font-size]\c
1071
. ie !\n[doc-is-reference] \{\
1072
. nop \)\*[doc-Tn-font-shape]\c
1073
. doc-print-recursive
1079
. tm Usage: .Tn trade_name ... (#\n[.c])
1085
.\" NS Va user macro
1086
.\" NS variable name
1088
.\" NS width register `Va' set in doc-common
1090
.als Va doc-generic-macro
1091
.ds doc-Va-usage variable_name
1094
.\" NS No user macro
1095
.\" NS normal text macro (default text style if mess up)
1097
.\" NS width register `No' set in doc-common
1099
.als No doc-generic-macro
1100
.ds doc-No-usage normal_text
1103
.\" NS doc-quote-left global string
1104
.\" NS left quotation character for `doc-enclose-string' and
1105
.\" NS `doc-enclose-open'
1110
.\" NS doc-quote-right global string
1111
.\" NS right quotation character for `doc-enclose-string' and
1112
.\" NS `doc-enclose-close'
1117
.\" NS Op user macro
1118
.\" NS option expression (i.e., enclose string in square brackets)
1121
.\" NS doc-macro-name
1122
.\" NS doc-quote-left
1123
.\" NS doc-quote-right
1125
.\" NS width register `Op' set in doc-common
1128
. if !\n[doc-arg-limit] \
1129
. ds doc-macro-name Op
1131
. ds doc-quote-left "\*[doc-left-bracket]
1132
. ds doc-quote-right "\*[doc-right-bracket]
1134
. doc-enclose-string \$@
1138
.\" NS Aq user macro
1139
.\" NS enclose string in angle brackets
1142
.\" NS doc-macro-name
1143
.\" NS doc-quote-left
1144
.\" NS doc-quote-right
1146
.\" NS width register `Aq' set in doc-common
1149
. if !\n[doc-arg-limit] \
1150
. ds doc-macro-name Aq
1152
. ds doc-quote-left \[la]
1153
. ds doc-quote-right \[ra]
1155
. doc-enclose-string \$@
1159
.\" NS Bq user macro
1160
.\" NS enclose string in square brackets
1163
.\" NS doc-macro-name
1164
.\" NS doc-quote-left
1165
.\" NS doc-quote-right
1167
.\" NS width register `Bq' set in doc-common
1170
. if !\n[doc-arg-limit] \
1171
. ds doc-macro-name Bq
1173
. ds doc-quote-left "\*[doc-left-bracket]
1174
. ds doc-quote-right "\*[doc-right-bracket]
1176
. doc-enclose-string \$@
1180
.\" NS Brq user macro
1181
.\" NS enclose string in braces
1184
.\" NS doc-macro-name
1185
.\" NS doc-quote-left
1186
.\" NS doc-quote-right
1188
.\" NS width register `Brq' set in doc-common
1191
. if !\n[doc-arg-limit] \
1192
. ds doc-macro-name Brq
1194
. ds doc-quote-left {
1195
. ds doc-quote-right }
1197
. doc-enclose-string \$@
1201
.\" NS Dq user macro
1202
.\" NS enclose string in double quotes
1205
.\" NS doc-macro-name
1206
.\" NS doc-quote-left
1207
.\" NS doc-quote-right
1209
.\" NS width register `Dq' set in doc-common
1212
. if !\n[doc-arg-limit] \
1213
. ds doc-macro-name Dq
1215
. ds doc-quote-left "\*[Lq]
1216
. ds doc-quote-right "\*[Rq]
1218
. doc-enclose-string \$@
1222
.\" NS Eq user macro
1223
.\" NS enclose string in user-defined quotes (args 1 and 2)
1226
.\" NS doc-macro-name
1227
.\" NS doc-quote-left
1228
.\" NS doc-quote-right
1230
.\" NS width register `Eq' set in doc-common
1233
. if !\n[doc-arg-limit] \
1234
. ds doc-macro-name Eq
1236
. ds doc-quote-left "\$1
1237
. ds doc-quote-right "\$2
1240
. doc-enclose-string \$@
1244
.\" NS Pq user macro
1245
.\" NS enclose string in parentheses
1248
.\" NS doc-macro-name
1249
.\" NS doc-quote-left
1250
.\" NS doc-quote-right
1252
.\" NS width register `Pq' set in doc-common
1255
. if !\n[doc-arg-limit] \
1256
. ds doc-macro-name Pq
1258
. ds doc-quote-left "\*[doc-left-parenthesis]
1259
. ds doc-quote-right "\*[doc-right-parenthesis]
1261
. doc-enclose-string \$@
1265
.\" NS Ql user macro
1266
.\" NS quoted literal
1268
.\" is in file doc-[dit|n]roff
1271
.\" NS Qq user macro
1272
.\" NS enclose string in straight double quotes
1275
.\" NS doc-macro-name
1276
.\" NS doc-quote-left
1277
.\" NS doc-quote-right
1279
.\" NS width register `Qq' set in doc-common
1282
. if !\n[doc-arg-limit] \
1283
. ds doc-macro-name Qq
1285
. ds doc-quote-left "\*[q]
1286
. ds doc-quote-right "\*[q]
1288
. doc-enclose-string \$@
1292
.\" NS Sq user macro
1293
.\" NS enclose string in single quotes
1296
.\" NS doc-macro-name
1297
.\" NS doc-quote-left
1298
.\" NS doc-quote-right
1300
.\" NS width register `Sq' set in doc-common
1303
. if !\n[doc-arg-limit] \
1304
. ds doc-macro-name Sq
1306
. ds doc-quote-left "\*[doc-left-singlequote]
1307
. ds doc-quote-right "\*[doc-right-singlequote]
1309
. doc-enclose-string \$@
1313
.\" NS Es user macro
1314
.\" NS set up arguments (i.e., the left and right quotation character as
1315
.\" NS first and second argument) for .En call
1319
.\" NS doc-macro-name
1320
.\" NS doc-quote-left
1321
.\" NS doc-quote-right
1324
. if !\n[doc-arg-limit] \{\
1325
. ie (\n[.$] > 2) \{\
1326
. ds doc-macro-name Es
1327
. doc-parse-args \$@
1330
. ds doc-quote-left "\$1
1331
. ds doc-quote-right "\$2
1334
. if !\n[doc-arg-limit] \
1338
. ds doc-quote-left "\*[doc-arg\n[doc-arg-ptr]]
1340
. ds doc-quote-right "\*[doc-arg\n[doc-arg-ptr]]
1342
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1343
. doc-do-\n[doc-type\n[doc-arg-ptr]]
1345
. doc-print-and-reset
1349
.\" NS doc-have-slot global register (bool)
1350
.\" NS set if `doc-enclose-string' has created a slot for closing
1356
.\" NS doc-enclose-string macro
1357
.\" NS enclose string with given args (e.g. [ and ])
1362
.\" NS doc-have-slot
1364
.\" NS local variables:
1370
.\" NS doc-quote-left
1371
.\" NS doc-quote-right
1373
.de doc-enclose-string
1374
. if \n[doc-in-synopsis-section] \
1375
. doc-set-hard-space
1377
. if !\n[doc-arg-limit] \{\
1379
. doc-parse-args \$@
1381
. nop \)\*[doc-quote-left]\*[doc-quote-right]
1384
. if !\n[doc-arg-limit] \
1387
. nr doc-curr-font \n[.f]
1388
. nr doc-curr-size \n[.ps]
1391
. doc-print-prefixes
1392
. \" the final `\)' prevents hyphenation in case the next character is `\%'
1393
. nop \)\*[doc-quote-left]\)\c
1394
. ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1396
. nop \)\*[doc-quote-right]\)\c
1397
. doc-print-and-reset
1400
. \" test whether last arguments are of type closing punctuation
1402
. ie (\n[doc-type\n[doc-arg-limit]] == 3) \{\
1403
. nr doc-reg-des (\n[doc-arg-limit] - 1)
1404
. while (\n[doc-type\n[doc-reg-des]] == 3) \
1407
. \" prepend closing delimiter
1409
. ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
1412
. \" test whether last arguments are macros which continue the line
1414
. nr doc-reg-des \n[doc-arg-limit]
1415
. while (\n[doc-reg-des] >= \n[doc-arg-ptr]) \{\
1416
. if !\A\*[doc-arg\n[doc-reg-des]] \
1418
. if !d doc-after-\*[doc-arg\n[doc-reg-des]] \
1423
. \" if there are no trailing macros to be skipped, append argument
1424
. ie (\n[doc-reg-des] == \n[doc-arg-limit]) \
1425
. doc-append-arg "\)\*[doc-quote-right]\)" 3
1427
. \" if a previous call to `doc-enclose-string' has already created
1428
. \" a slot, prepend argument
1429
. ie \n[doc-have-slot] \
1430
. ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
1432
. \" we have to shift all arguments to the right
1434
. nr doc-reg-des1 \n[doc-arg-limit]
1435
. nr doc-reg-des2 (\n[doc-arg-limit] + 1)
1436
. while (\n[doc-reg-des1] >= \n[doc-reg-des]) \{\
1437
. rn doc-arg\n[doc-reg-des1] doc-arg\n[doc-reg-des2]
1438
. rnn doc-type\n[doc-reg-des1] doc-type\n[doc-reg-des2]
1439
. rn doc-space\n[doc-reg-des1] doc-space\n[doc-reg-des2]
1440
. nr doc-reg-des1 -1
1441
. nr doc-reg-des2 -1
1443
. nr doc-arg-limit +1
1445
. \" finally, insert closing delimiter into the freed slot and
1446
. \" recompute spacing vector
1447
. ds doc-arg\n[doc-reg-des] "\)\*[doc-quote-right]\)
1448
. nr doc-type\n[doc-reg-des] 3
1449
. nr doc-num-args (\n[doc-arg-limit] - \n[doc-reg-des] + 1)
1450
. nr doc-arg-limit (\n[doc-reg-des] - 1)
1451
. doc-parse-space-vector
1452
. nr doc-have-slot 1
1455
. doc-do-\n[doc-type\n[doc-arg-ptr]]
1458
. if \n[doc-in-synopsis-section] \
1459
. doc-set-soft-space
1463
.\" NS En user macro
1464
.\" NS enclose arguments with quotation characters set up with `.Es'
1466
.als En doc-enclose-string
1469
.\" NS Ao user macro
1473
.\" NS doc-macro-name
1474
.\" NS doc-quote-left
1476
.\" NS width register `Ao' set in doc-common
1479
. if !\n[doc-arg-limit] \
1480
. ds doc-macro-name Ao
1482
. ds doc-quote-left \[la]
1484
. doc-enclose-open \$@
1488
.\" NS Ac user macro
1492
.\" NS doc-macro-name
1493
.\" NS doc-quote-right
1495
.\" NS width register `Ac' set in doc-common
1498
. if !\n[doc-arg-limit] \
1499
. ds doc-macro-name Ac
1501
. ds doc-quote-right \[ra]
1503
. doc-enclose-close \$@
1507
.\" NS Bo user macro
1511
.\" NS doc-macro-name
1512
.\" NS doc-quote-left
1514
.\" NS width register `Bo' set in doc-common
1517
. if !\n[doc-arg-limit] \
1518
. ds doc-macro-name Bo
1520
. ds doc-quote-left "\*[doc-left-bracket]
1522
. doc-enclose-open \$@
1526
.\" NS Bc user macro
1527
.\" NS bracket close
1530
.\" NS doc-macro-name
1531
.\" NS doc-quote-right
1533
.\" NS width register `Bc' set in doc-common
1536
. if !\n[doc-arg-limit] \
1537
. ds doc-macro-name Bc
1539
. ds doc-quote-right "\*[doc-right-bracket]
1541
. doc-enclose-close \$@
1545
.\" NS Bro user macro
1549
.\" NS doc-macro-name
1550
.\" NS doc-quote-left
1552
.\" NS width register `Bro' set in doc-common
1555
. if !\n[doc-arg-limit] \
1556
. ds doc-macro-name Bo
1558
. ds doc-quote-left {
1560
. doc-enclose-open \$@
1564
.\" NS Brc user macro
1568
.\" NS doc-macro-name
1569
.\" NS doc-quote-right
1571
.\" NS width register `Brc' set in doc-common
1574
. if !\n[doc-arg-limit] \
1575
. ds doc-macro-name Bc
1577
. ds doc-quote-right }
1579
. doc-enclose-close \$@
1583
.\" NS Do user macro
1584
.\" NS double quote open
1587
.\" NS doc-macro-name
1588
.\" NS doc-quote-left
1590
.\" NS width register `Do' set in doc-common
1593
. if !\n[doc-arg-limit] \
1594
. ds doc-macro-name Do
1596
. ds doc-quote-left "\*[Lq]
1598
. doc-enclose-open \$@
1602
.\" NS Dc user macro
1603
.\" NS double quote close
1606
.\" NS doc-macro-name
1607
.\" NS doc-quote-right
1609
.\" NS width register `Dc' set in doc-common
1612
. if !\n[doc-arg-limit] \
1613
. ds doc-macro-name Dc
1615
. ds doc-quote-right "\*[Rq]
1617
. doc-enclose-close \$@
1621
.\" NS Eo user macro
1622
.\" NS enclose open (using first argument as beginning of enclosure)
1625
.\" NS doc-macro-name
1626
.\" NS doc-quote-left
1628
.\" NS width register `Eo' set in doc-common
1631
. if !\n[doc-arg-limit] \
1632
. ds doc-macro-name Eo
1634
. ds doc-quote-left "\$1
1637
. doc-enclose-open \$@
1641
.\" NS Ec user macro
1642
.\" NS enclose close (using first argument as end of enclosure)
1645
.\" NS doc-macro-name
1646
.\" NS doc-quote-right
1648
.\" NS width register `Ec' set in doc-common
1651
. if !\n[doc-arg-limit] \
1652
. ds doc-macro-name Ec
1654
. ds doc-quote-right "\$1
1657
. doc-enclose-close \$@
1661
.\" NS Oo user macro
1665
.\" NS doc-macro-name
1666
.\" NS doc-quote-left
1668
.\" NS width register `Oo' set in doc-common
1671
. if !\n[doc-arg-limit] \
1672
. ds doc-macro-name Oo
1674
. ds doc-quote-left [
1676
. doc-enclose-open \$@
1680
.\" NS Oc user macro
1684
.\" NS doc-macro-name
1685
.\" NS doc-quote-right
1687
.\" NS width register `Oc' set in doc-common
1690
. if !\n[doc-arg-limit] \
1691
. ds doc-macro-name Oc
1693
. ds doc-quote-right ]
1695
. doc-enclose-close \$@
1699
.\" NS Po user macro
1700
.\" NS parenthesis open
1703
.\" NS doc-macro-name
1704
.\" NS doc-quote-left
1706
.\" NS width register `Po' set in doc-common
1709
. if !\n[doc-arg-limit] \
1710
. ds doc-macro-name Po
1712
. ds doc-quote-left "\*[doc-left-parenthesis]
1714
. doc-enclose-open \$@
1718
.\" NS Pc user macro
1719
.\" NS parenthesis close
1722
.\" NS doc-macro-name
1723
.\" NS doc-quote-right
1725
.\" NS width register `Pc' set in doc-common
1728
. if !\n[doc-arg-limit] \
1729
. ds doc-macro-name Pc
1731
. ds doc-quote-right "\*[doc-right-parenthesis]
1733
. doc-enclose-close \$@
1737
.\" NS Qo user macro
1738
.\" NS straight double quote open
1741
.\" NS doc-macro-name
1742
.\" NS doc-quote-left
1744
.\" NS width register `Qo' set in doc-common
1747
. if !\n[doc-arg-limit] \
1748
. ds doc-macro-name Qo
1750
. ds doc-quote-left "\*[q]
1752
. doc-enclose-open \$@
1756
.\" NS Qc user macro
1757
.\" NS straight double quote close
1760
.\" NS doc-macro-name
1761
.\" NS doc-quote-right
1763
.\" NS width register `Qc' set in doc-common
1766
. if !\n[doc-arg-limit] \
1767
. ds doc-macro-name Qc
1769
. ds doc-quote-right "\*[q]
1771
. doc-enclose-close \$@
1775
.\" NS So user macro
1776
.\" NS single quote open
1779
.\" NS doc-macro-name
1780
.\" NS doc-quote-left
1782
.\" NS width register `So' set in doc-common
1785
. if !\n[doc-arg-limit] \
1786
. ds doc-macro-name So
1788
. ds doc-quote-left "\*[doc-left-singlequote]
1790
. doc-enclose-open \$@
1794
.\" NS Sc user macro
1795
.\" NS single quote close
1798
.\" NS doc-macro-name
1799
.\" NS doc-quote-right
1801
.\" NS width register `Sc' set in doc-common
1804
. if !\n[doc-arg-limit] \
1805
. ds doc-macro-name Sc
1807
. ds doc-quote-right "\*[doc-right-singlequote]
1809
. doc-enclose-close \$@
1813
.\" NS Xo user macro
1817
.\" NS doc-macro-name
1818
.\" NS doc-quote-left
1820
.\" NS width register `Xo' set in doc-common
1823
. if !\n[doc-arg-limit] \
1824
. ds doc-macro-name Xo
1828
. doc-enclose-open \$@
1832
.\" NS Xc user macro
1836
.\" NS doc-macro-name
1837
.\" NS doc-quote-right
1839
.\" NS width register `Xc' set in doc-common
1842
. if !\n[doc-arg-limit] \
1843
. ds doc-macro-name Xc
1845
. ds doc-quote-right
1847
. doc-enclose-close \$@
1851
.\" NS doc-nesting-level global register
1852
.\" NS used by `doc-enclose-open' and `doc-enclose-close'
1854
.nr doc-nesting-level 0
1857
.\" NS doc-in-list global register (bool)
1858
.\" NS whether we are in (logical) .It
1863
.\" NS doc-enclose-open macro
1864
.\" NS enclose string open
1868
.\" NS doc-nesting-level
1870
.de doc-enclose-open
1871
. if !\n[doc-arg-limit] \
1872
. doc-parse-args \$@
1875
. doc-print-prefixes
1878
. nop \)\*[doc-quote-left]\)\c
1880
. \" start enclosure box
1881
. box doc-enclosure-box\n[doc-nesting-level]
1882
. ev doc-enclosure-env\n[doc-nesting-level]
1886
. \" we insert something to make .chop always work
1889
. \" increase nesting level *after* parsing of arguments
1890
. nr doc-nesting-level +1
1892
. if \n[doc-arg-limit] \{\
1894
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1895
. doc-print-recursive
1902
.\" NS doc-enclose-close macro
1903
.\" NS enclose string close
1906
.\" NS doc-nesting-level
1908
.de doc-enclose-close
1909
. nr doc-nesting-level -1
1911
. \" finish enclosure box
1915
. chop doc-enclosure-box\n[doc-nesting-level]
1916
. unformat doc-enclosure-box\n[doc-nesting-level]
1919
. nop \*[doc-enclosure-box\n[doc-nesting-level]]\c
1920
. nop \)\*[doc-quote-right]\)\c
1922
. if !\n[doc-arg-limit] \{\
1923
. doc-parse-args \$@
1926
. doc-print-and-reset
1929
. if \n[doc-arg-limit] \{\
1930
. ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
1931
. nop \)\*[doc-space\n[doc-arg-ptr]]\c
1933
. doc-print-recursive
1936
. doc-print-and-reset
1939
. \" shall we finish .It request?
1940
. if !"\*[doc-macro-name]"It" \
1941
. if \n[doc-in-list] \
1942
. if !\n[doc-nesting-level] \
1943
. doc-\*[doc-list-type-stack\n[doc-list-depth]]
1947
.\" NS Pf user macro
1948
.\" NS prefix: `.Pf prefix arg ...'
1952
.\" NS doc-macro-name
1953
.\" NS doc-quote-left
1955
.\" NS width register `Pf' set in doc-common
1958
. if !\n[doc-arg-limit] \
1959
. ds doc-macro-name Pf
1961
. ie \n[doc-arg-limit] \{\
1962
. ie ((\n[doc-arg-limit] - \n[doc-arg-ptr]) > 1) \{\
1964
. nop \)\*[doc-arg\n[doc-arg-ptr]]\c
1967
. tm mdoc warning: .Pf: trailing prefix (#\n[.c])
1973
. doc-parse-args \$@
1975
. tm mdoc warning: .Pf: missing arguments (#\n[.c])
1979
. if \n[doc-arg-limit] \{\
1981
. ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
1982
. doc-print-and-reset
1984
. doc-do-\n[doc-type\n[doc-arg-ptr]]
1989
.\" NS Ns user macro
1990
.\" NS remove space (space removal done by `doc-parse-args')
1994
.\" NS doc-macro-name
1996
.\" NS width register `Ns' set in doc-common
1999
. if !\n[doc-arg-limit] \{\
2001
. ds doc-macro-name Ns
2002
. doc-parse-args \$@
2005
. tm Usage: .Ns must be called with arguments (#\n[.c])
2008
. if \n[doc-arg-limit] \{\
2010
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
2011
. doc-print-recursive
2018
.\" NS Ap user macro
2019
.\" NS append an apostrophe
2021
.\" NS width register `Ap' set in doc-common
2024
. ie !\n[doc-arg-limit] \
2025
. tm Usage: `Ap' cannot be first request on a line (no `.Ap') (#\n[.c])
2029
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
2030
. doc-print-recursive
2037
.\" NS doc-space global string
2038
.\" NS current inter-argument space
2040
.ds doc-space "\*[doc-soft-space]
2043
.\" NS doc-soft-space constant string
2044
.\" NS soft (stretchable) space (defined in doc-common)
2047
.\" NS doc-hard-space constant string
2048
.\" NS hard (unpaddable) space (defined in doc-common)
2051
.\" NS doc-set-hard-space macro
2052
.\" NS set current space string to hard (unpaddable) space.
2055
.\" NS doc-saved-space
2058
.de doc-set-hard-space
2059
. ie "\*[doc-space]"" \
2060
. ds doc-saved-space "\*[doc-hard-space]
2062
. ds doc-space "\*[doc-hard-space]
2066
.\" NS doc-set-soft-space macro
2067
.\" NS set current space string to soft space
2070
.\" NS doc-saved-space
2073
.de doc-set-soft-space
2074
. ie "\*[doc-space]"" \
2075
. ds doc-saved-space "\*[doc-soft-space]
2077
. ds doc-space "\*[doc-soft-space]
2081
.\" NS doc-space-mode global register (bool)
2082
.\" NS default is one (space mode on)
2084
.nr doc-space-mode 1
2087
.\" NS doc-saved-space global string
2088
.\" NS saved value of `doc-space'
2090
.ds doc-saved-space "\*[doc-space]
2093
.\" NS doc-have-space global register (bool)
2094
.\" NS set if last command was horizontal space
2096
.nr doc-have-space 0
2099
.\" NS Sm user macro
2100
.\" NS space mode (`.Sm'/`.Sm on'/`.Sm off')
2102
.\" NS without argument, toggle space mode
2105
.\" NS doc-arg-limit
2108
.\" NS doc-macro-name
2110
.\" NS doc-saved-space
2112
.\" NS doc-space-mode
2115
.\" NS local variables:
2118
.\" NS width register `Sm' set in doc-common
2121
. ie \n[doc-have-space] \
2126
. if !\n[doc-arg-limit] \{\
2128
. ds doc-macro-name Sm
2129
. doc-parse-args \$@
2132
. ie \n[doc-space-mode] \
2133
. nr doc-space-mode 0
2135
. nr doc-space-mode 1
2138
. if !\n[doc-arg-limit] \
2143
. \" avoid a warning message in case `Sm' is the last parameter
2144
. if !d doc-arg\n[doc-arg-ptr] \
2145
. ds doc-arg\n[doc-arg-ptr]
2147
. ie "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2148
. ds doc-space "\*[doc-saved-space]
2149
. nr doc-space-mode 1
2152
. ie "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2153
. ds doc-saved-space "\*[doc-space]
2155
. nr doc-space-mode 0
2158
. \" no argument for Sm
2160
. ie \n[doc-space-mode] \
2161
. nr doc-space-mode 0
2163
. nr doc-space-mode 1
2166
. ie \n[doc-space-mode] \{\
2167
. \" recompute space vector for remaining arguments
2168
. nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
2169
. nr doc-arg-limit \n[doc-arg-ptr]
2170
. if \n[doc-num-args] \
2171
. doc-parse-space-vector
2173
. \" finish line only if it is interrupted and `doc-have-space'
2175
. if \n[doc-reg-Sm] \
2180
. \" reset remaining space vector elements
2181
. nr doc-reg-Sm (\n[doc-arg-ptr] + 1)
2182
. while (\n[doc-reg-Sm] <= \n[doc-arg-limit]) \{\
2183
. ds doc-space\n[doc-reg-Sm]
2185
. \" the body of a `while' request must end with the fitting `\}'!
2189
. \" do we have parameters to print?
2190
. ie (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
2191
. \" ignore `.Sm on' and `.Sm off' without additional parameters
2192
. ie (\n[doc-arg-ptr] > 1) \
2193
. doc-print-and-reset
2198
. \" skip `Sm' argument
2200
. doc-print-recursive
2205
.\" NS doc-arg-type immediate register
2206
.\" NS argument type (macro=1, string=2, punctuation suffix=3,
2207
.\" NS punctuation prefix=4)
2212
.\" NS doc-get-arg-type macro
2213
.\" NS get argument type
2215
.\" NS this macro expects the width of the argument in `doc-width'
2220
.de doc-get-arg-type
2223
. if ((\n[doc-width] < 4) & \A\$1) \{\
2224
. ie (\n[doc-width] == 1) \{\
2225
. if r doc-punct\$1 \
2226
. nr doc-arg-type \n[doc-punct\$1]
2236
.\" NS doc-get-arg-type* macro
2237
.\" NS similar to as `doc-get-arg-type' but uses doc-argXXX strings
2239
.\" NS this macro sets the `doc-width' register using the `length' request
2240
.\" NS to get the number of characters in a string literally
2246
.de doc-get-arg-type*
2248
. length doc-width "\*[doc-arg\$1]
2250
. if ((\n[doc-width] < 4) & \A\*[doc-arg\$1]) \{\
2251
. ie (\n[doc-width] == 1) \{\
2252
. if r doc-punct\*[doc-arg\$1] \
2253
. nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
2256
. if r \*[doc-arg\$1] \
2257
. if d \*[doc-arg\$1] \
2263
.\" NS doc-set-spacing-1 macro
2264
.\" NS set spacing for macros
2269
.\" NS local variables:
2270
.\" NS doc-reg-dssfm
2271
.\" NS doc-reg-dssfm1
2273
.de doc-set-spacing-1
2274
. nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-arg-limit]]]
2276
. \" closing macros like .Ac, Bc., etc. have value 3 (remove space before
2278
. ie (\n[doc-reg-dssfm1] == 3) \{\
2279
. if \n[doc-arg-limit] \{\
2280
. nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2281
. ds doc-space\n[doc-reg-dssfm]
2283
. ds doc-space\n[doc-arg-limit] "\*[doc-space]
2286
. \" macros like .Ap and .Ns have value 2 (remove space before and after
2288
. ie (\n[doc-reg-dssfm1] == 2) \{\
2289
. if \n[doc-arg-limit] \{\
2290
. nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2291
. ds doc-space\n[doc-reg-dssfm]
2293
. ds doc-space\n[doc-arg-limit]
2296
. ds doc-space\n[doc-arg-limit]
2301
.\" NS doc-set-spacing-2 macro
2302
.\" NS set spacing for strings
2307
.de doc-set-spacing-2
2308
. ds doc-space\n[doc-arg-limit] "\*[doc-space]
2312
.\" NS doc-set-spacing-3 macro
2313
.\" NS set spacing for punctuation suffixes
2318
.\" NS local variables:
2319
.\" NS doc-reg-dssfps
2321
.de doc-set-spacing-3
2322
. if \n[doc-arg-limit] \{\
2323
. nr doc-reg-dssfps (\n[doc-arg-limit] - 1)
2324
. ds doc-space\n[doc-reg-dssfps]
2327
. ds doc-space\n[doc-arg-limit] "\*[doc-space]
2331
.\" NS doc-set-spacing-4 macro
2332
.\" NS set spacing for punctuation prefixes
2337
.de doc-set-spacing-4
2338
. ds doc-space\n[doc-arg-limit]
2342
.\" type switches (on current argument doc-arg-ptr)
2345
.\" NS doc-do-1 macro
2346
.\" NS call request if macro
2349
. \*[doc-arg\n[doc-arg-ptr]]
2353
.\" NS doc-do-2 macro
2354
.\" NS call .doc-print-recursive if string
2356
.als doc-do-2 doc-print-recursive
2359
.\" NS doc-do-3 macro
2360
.\" NS call .doc-print-recursive if punctuation suffix
2362
.als doc-do-3 doc-print-recursive
2365
.\" NS doc-do-4 macro
2366
.\" NS call .doc-print-recursive if punctuation prefix
2368
.als doc-do-4 doc-print-recursive
2371
.\" NS doc-fontmode-depth global register
2372
.\" NS font mode level
2374
.nr doc-fontmode-depth 0
2377
.\" NS doc-fontmode-font-stackXXX global register
2378
.\" NS stack of saved current font values from `Bf' request
2381
.\" NS doc-fontmode-depth
2383
.nr doc-fontmode-font-stack0 0
2386
.\" NS doc-fontmode-size-stackXXX global register
2387
.\" NS stack of saved current size values from `Bf' request
2390
.\" NS doc-fontmode-depth
2392
.nr doc-fontmode-size-stack0 0
2395
.\" NS Bf user macro
2396
.\" NS begin font mode (will be begin-mode/end-mode in groff & TeX)
2399
.\" NS doc-fontmode-depth
2400
.\" NS doc-fontmode-font-stackXXX
2401
.\" NS doc-fontmode-size-stackXXX
2402
.\" NS doc-macro-name
2404
.\" NS width register `Bf' set in doc-common
2407
. ds doc-macro-name Bf
2410
. nr doc-fontmode-depth +1
2412
. \" save current font and size
2413
. nr doc-fontmode-font-stack\n[doc-fontmode-depth] \n[.f]
2414
. nr doc-fontmode-size-stack\n[doc-fontmode-depth] \n[.ps]
2417
. nop \*[doc-Em-font]\c
2418
. el \{ .ie "\$1"Li" \
2419
. nop \*[doc-Li-font]\c
2420
. el \{ .ie "\$1"Sy" \
2421
. nop \*[doc-Sy-font]\c
2422
. el \{ .ie "\$1"-emphasis" \
2423
. nop \*[doc-Em-font]\c
2424
. el \{ .ie "\$1"-literal" \
2425
. nop \*[doc-Li-font]\c
2426
. el \{ .ie "\$1"-symbolic" \
2427
. nop \*[doc-Sy-font]\c
2429
. tmc mdoc warning: Unknown keyword `\$1' in .Bf request
2433
. tm Usage: .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2437
.\" NS Ef user macro
2438
.\" NS end font mode
2441
.\" NS doc-macro-name
2443
.\" NS width register `Ef' set in doc-common
2446
. ds doc-macro-name Ef
2448
. ie \n[doc-fontmode-depth] \{\
2449
. \" restore saved font and size
2450
. nop \)\f[\n[doc-fontmode-font-stack\n[doc-fontmode-depth]]]\c
2451
. nop \)\s[\n[doc-fontmode-size-stack\n[doc-fontmode-depth]]u]\c
2453
. nr doc-fontmode-font-stack\n[doc-fontmode-depth] 0
2454
. nr doc-fontmode-size-stack\n[doc-fontmode-depth] 0
2455
. nr doc-fontmode-depth -1
2458
. tm mdoc warning: Extraneous .Ef (#\n[.c])
2462
.\" NS doc-keep-type global register
2463
.\" NS current keep type; 1 is `-words', 2 is `-lines', 3 is unknown
2468
.\" NS Bk user macro
2472
.\" NS doc-keep-type
2473
.\" NS doc-macro-name
2475
.\" NS width register `Bk' set in doc-common
2478
. ds doc-macro-name Bk
2480
. if \n[doc-keep-type] \
2481
. tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2483
. ie "\$1"-lines" \{\
2484
. nr doc-keep-type 2
2485
. tm .Bk -lines: Not implemented yet. (#\n[.c])
2487
. el \{ .ie "\$1"-words" \{\
2488
. nr doc-keep-type 1
2489
. doc-set-hard-space
2491
. el \{ .ie "\$1"" \{\
2493
. nr doc-keep-type 1
2494
. doc-set-hard-space
2497
. tm mdoc warning: Unknown keyword `\$1' in .Bk request (#\n[.c])
2498
. nr doc-keep-type 3
2501
\#. nr doc-nesting-level +1
2505
.\" NS Ek user macro
2509
.\" NS doc-keep-type
2510
.\" NS doc-macro-name
2512
.\" NS width register `Ek' set in doc-common
2515
. ds doc-macro-name Ek
2517
\#. nr doc-nesting-level -1
2520
. tm Usage: .Ek (does not take arguments) (#\n[.c])
2522
. if !\n[doc-keep-type] \
2523
. tm mdoc warning: .Ek found without .Bk before (#\n[.c])
2525
. ie (\n[doc-keep-type] == 1) \
2526
. doc-set-soft-space
2527
. el \{ .if (\n[doc-keep-type] == 2) \
2528
. tm .Bk -lines: Not implemented yet. (#\n[.c])
2531
. nr doc-keep-type 0
2533
\#. if !"\*[doc-out-string]"" \
2534
\#. doc-print-out-string
2538
.\" NS doc-display-depth global register
2539
.\" NS display level
2541
.nr doc-display-depth 0
2544
.\" NS doc-is-compact global register (bool)
2545
.\" NS set if the `compact' keyword is given
2547
.nr doc-is-compact 0
2550
.\" NS doc-display-type-stackXXX global string
2551
.\" NS the display type stack
2554
.\" NS doc-display-depth
2556
.ds doc-display-type-stack0
2559
.\" NS doc-display-indent-stackXXX global register
2560
.\" NS stack of display indentation values
2563
.\" NS doc-display-depth
2565
.nr doc-display-indent-stack0 0
2568
.\" NS doc-display-ad-stackXXX global register
2569
.\" NS stack of saved adjustment modes
2572
.\" NS doc-display-depth
2574
.nr doc-display-ad-stack0 0
2577
.\" NS doc-display-fi-stackXXX global register
2578
.\" NS stack of saved fill modes
2581
.\" NS doc-display-depth
2583
.nr doc-display-fi-stack0 0
2586
.\" NS doc-display-ft-stackXXX global register
2587
.\" NS stack of saved fonts
2590
.\" NS doc-display-depth
2592
.nr doc-display-ft-stack0 0
2595
.\" NS doc-display-ps-stackXXX global register
2596
.\" NS stack of saved font sizes
2599
.\" NS doc-display-depth
2601
.nr doc-display-ps-stack0 0
2604
.\" NS Bd user macro
2605
.\" NS begin display
2607
.\" NS width register `Bd' set in doc-common
2610
.\" NS doc-curr-font
2611
.\" NS doc-curr-size
2612
.\" NS doc-display-depth
2613
.\" NS doc-display-ad-stackXXX
2614
.\" NS doc-display-fi-stackXXX
2615
.\" NS doc-display-ft-stackXXX
2616
.\" NS doc-display-ps-stackXXX
2617
.\" NS doc-display-file
2618
.\" NS doc-display-indent-stackXXX
2619
.\" NS doc-display-type-stackXXX
2620
.\" NS doc-is-compact
2621
.\" NS doc-macro-name
2623
.\" NS local variables:
2627
. ds doc-macro-name Bd
2630
. tm1 "Usage: .Bd {-literal | -filled | -ragged | -centered | -unfilled}
2631
. tm1 " [-offset [string]] [-compact] [-file name] (#\n[.c])
2635
. nr doc-is-compact 0
2636
. ds doc-display-file
2638
. nr doc-display-depth +1
2640
. \" save current adjustment and fill modes
2641
. nr doc-display-ad-stack\n[doc-display-depth] \n[.j]
2642
. nr doc-display-fi-stack\n[doc-display-depth] \n[.u]
2644
. ie "\$1"-literal" \{\
2645
. ds doc-display-type-stack\n[doc-display-depth] literal
2646
. nr doc-display-ft-stack\n[doc-display-depth] \n[.f]
2647
. nr doc-display-ps-stack\n[doc-display-depth] \n[.ps]
2650
. nop \*[doc-Li-font]\c
2657
. el \{ .ie "\$1"-filled" \{\
2658
. ds doc-display-type-stack\n[doc-display-depth] filled
2662
. el \{ .ie "\$1"-ragged" \{\
2663
. ds doc-display-type-stack\n[doc-display-depth] ragged
2667
. el \{ .ie "\$1"-centered" \{\
2668
. ds doc-display-type-stack\n[doc-display-depth] centered
2672
. el \{ .ie "\$1"-unfilled" \{\
2673
. ds doc-display-type-stack\n[doc-display-depth] unfilled
2677
. tm1 "mdoc warning: Unknown keyword `\$1' (or missing display type)
2678
. tm1 " in .Bd request (#\n[.c])
2682
. \" have we seen an argument?
2683
. if \n[doc-reg-Bd] \{\
2685
. \" check other arguments
2687
. doc-do-Bd-args \$@
2690
. \" avoid warning about non-existent register
2691
. if !r doc-display-indent-stack\n[doc-display-depth] \
2692
. nr doc-display-indent-stack\n[doc-display-depth] 0
2694
. if \n[doc-display-indent-stack\n[doc-display-depth]] \
2695
' in +\n[doc-display-indent-stack\n[doc-display-depth]]u
2697
. if !\n[doc-is-compact] \{\
2698
. if !\n[doc-in-synopsis-section] \{\
2699
. ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2700
. sp \n[doc-display-vertical]u
2702
' sp \n[doc-display-vertical]u
2708
. if !"\*[doc-display-file]"" \
2709
. so \*[doc-display-file]
2711
. nr doc-is-compact 0
2712
. ds doc-display-file
2716
.\" NS doc-do-Bd-args macro
2717
.\" NS resolve remaining .Bd arguments
2720
.\" NS doc-display-file
2721
.\" NS doc-display-indent-stackXXX
2722
.\" NS doc-is-compact
2724
.\" NS local variables:
2726
.\" NS doc-reg-ddBa1
2727
.\" NS doc-reg-ddBa2
2728
.\" NS doc-reg-ddBa3
2729
.\" NS doc-reg-ddBa4
2735
. ie "\$1"-offset" \{\
2739
. nr doc-display-indent-stack\n[doc-display-depth] 0
2740
. el \{ .ie "\$2"right" \
2741
. nr doc-display-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
2742
. el \{ .ie "\$2"center" \
2743
. nr doc-display-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
2744
. el \{ .ie "\$2"indent" \
2745
. nr doc-display-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
2746
. el \{ .ie "\$2"indent-two" \
2747
. nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
2752
. \" not a known keyword
2753
. if (\n[doc-reg-ddBa] == 1) \{\
2756
. nr doc-reg-ddBa1 0
2758
. \" disable warnings related to scaling indicators (32)
2759
. nr doc-reg-ddBa2 \n[.warn]
2760
. warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
2762
. \" values without a scaling indicator are taken as strings;
2763
. \" we test whether the parameter string with and without the last
2764
. \" character yields identical numerical results (ignoring the
2765
. \" scaling indicator)
2766
. ds doc-str-ddBa "\$2
2767
. substring doc-str-ddBa 1 -1
2768
. if \B(\*[doc-str-ddBa]) \{\
2769
. nr doc-reg-ddBa3 (;(\$2))
2770
. nr doc-reg-ddBa4 (\*[doc-str-ddBa])
2771
. if (\n[doc-reg-ddBa3] == \n[doc-reg-ddBa4]) \
2772
. nr doc-reg-ddBa1 1
2775
. \" enable all warnings again
2776
. warn \n[doc-reg-ddBa2]
2779
. ie \n[doc-reg-ddBa1] \
2780
. nr doc-display-indent-stack\n[doc-display-depth] \$2
2782
. doc-get-width "\$2"
2783
. ie (\n[doc-width] <= 3) \{\
2784
. \" if the offset parameter is a macro, use the macro's
2785
. \" width as specified in doc-common
2786
. doc-get-arg-type "\$2"
2787
. ie (\n[doc-arg-type] == 1) \
2788
. nr doc-display-indent-stack\n[doc-display-depth] \n[\$2]
2790
. nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2793
. nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2796
. el \{ .ie "\$1"-compact" \
2797
. nr doc-is-compact 1
2798
. el \{ .ie "\$1"-file" \{\
2800
. ds doc-display-file "\$2
2804
. tm mdoc warning: .Bd `-file' keyword requires argument (#\n[.c])
2807
. tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
2810
. if (\n[doc-reg-ddBa] < \n[.$]) \{\
2811
. shift \n[doc-reg-ddBa]
2812
. doc-do-Bd-args \$@
2817
.\" NS Ed user macro
2821
.\" NS doc-display-depth
2822
.\" NS doc-display-indent-stackXXX
2823
.\" NS doc-display-type-stackXXX
2824
.\" NS doc-macro-name
2826
.\" NS width register `Ed' set in doc-common
2829
. ds doc-macro-name Ed
2833
. if !\n[doc-display-depth] \{\
2834
. tm mdoc warning: Extraneous .Ed (#\n[.c])
2835
. nr doc-display-depth 1
2838
. if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
2839
. ft \n[doc-display-ft-stack\n[doc-display-depth]]
2840
. ps \n[doc-display-ps-stack\n[doc-display-depth]]u
2843
. in -\n[doc-display-indent-stack\n[doc-display-depth]]u
2845
. \" restore saved adjustment and fill modes
2846
. ie \n[doc-display-fi-stack\n[doc-display-depth]] \
2850
. ad \n[doc-display-ad-stack\n[doc-display-depth]]
2852
. nr doc-display-indent-stack\n[doc-display-depth] 0
2853
. ds doc-display-type-stack\n[doc-display-depth]
2854
. nr doc-display-depth -1
2858
.\" NS doc-list-type-stackXXX global string
2859
.\" NS stack of list types
2862
.\" NS doc-list-depth
2864
.ds doc-list-type-stack1
2867
.\" NS doc-list-indent-stackXXX global register
2868
.\" NS stack of list indentation values
2871
.\" NS doc-list-depth
2873
.nr doc-list-indent-stack1 0
2876
.\" NS doc-list-have-indent-stackXXX global register (bool)
2877
.\" NS an indentation value is active
2880
.\" NS doc-list-depth
2882
.nr doc-list-have-indent-stack1 0
2885
.\" NS Bl user macro
2888
.\" NS width register `Bl' set in doc-common
2893
.\" NS doc-list-depth
2894
.\" NS doc-list-have-indent-stackXXX
2895
.\" NS doc-list-indent-stackXXX
2896
.\" NS doc-list-type-stackXXX
2897
.\" NS doc-macro-name
2899
.\" NS doc-num-columns
2901
.\" NS local variables:
2910
. ds doc-macro-name Bl
2911
. nr doc-list-depth +1
2914
. ie "\$1"-hang" \{\
2915
. ds doc-list-type-stack\n[doc-list-depth] hang-list
2916
. nr doc-list-indent-stack\n[doc-list-depth] 6n
2917
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2919
. el \{ .ie "\$1"-tag" \{\
2920
. ds doc-list-type-stack\n[doc-list-depth] tag-list
2921
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2923
. el \{ .ie "\$1"-item" \{\
2924
. ds doc-list-type-stack\n[doc-list-depth] item-list
2925
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2927
. el \{ .ie "\$1"-enum" \{\
2928
. ds doc-list-type-stack\n[doc-list-depth] enum-list
2929
. nr doc-list-indent-stack\n[doc-list-depth] 3n
2930
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2932
. el \{ .ie "\$1"-bullet" \{\
2933
. ds doc-list-type-stack\n[doc-list-depth] bullet-list
2934
. nr doc-list-indent-stack\n[doc-list-depth] 2n
2935
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2937
. el \{ .ie "\$1"-dash" \{\
2938
. ds doc-list-type-stack\n[doc-list-depth] dash-list
2939
. nr doc-list-indent-stack\n[doc-list-depth] 2n
2940
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2942
. el \{ .ie "\$1"-hyphen" \{\
2943
. ds doc-list-type-stack\n[doc-list-depth] dash-list
2944
. nr doc-list-indent-stack\n[doc-list-depth] 2n
2945
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2947
. el \{ .ie "\$1"-inset" \{\
2948
. ds doc-list-type-stack\n[doc-list-depth] inset-list
2949
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2951
. el \{ .ie "\$1"-diag" \{\
2952
. ds doc-list-type-stack\n[doc-list-depth] diag-list
2954
. el \{ .ie "\$1"-ohang" \{\
2955
. ds doc-list-type-stack\n[doc-list-depth] ohang-list
2956
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
2958
. el \{ .ie "\$1"-column" \{\
2959
. ds doc-list-type-stack\n[doc-list-depth] column-list
2963
. tm1 "mdoc warning: Unknown list type `\$1' (or missing list type)
2964
. tm1 " in .Bl request
2967
. \}\}\}\}\}\}\}\}\}\}\}
2969
. \" we have seen a list type
2970
. if !\n[doc-arg-ptr] \{\
2973
. nr doc-list-depth -1
2979
. \" fill argument vector
2981
. while (\n[doc-reg-Bl] <= \n[.$]) \{\
2982
. ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
2986
. doc-increment-list-stack
2989
. nr doc-arg-limit \n[.$]
2993
. in +\n[doc-list-offset-stack\n[doc-list-depth]]u
2995
. \" initialize column list
2996
. if "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
2997
. doc-set-column-tab \n[doc-num-columns]
2998
' in -\n[doc-column-indent-width]u
2999
. if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3000
. sp \n[doc-display-vertical]u
3003
. nr doc-num-columns 0
3010
.\" NS doc-Bl-usage macro
3013
. tm1 "Usage: .Bl {-hang | -ohang | -tag | -diag | -inset}
3014
. tm1 " [-width <string>] [-xwidth <command>]
3015
. tm1 " [-offset <string>] [-compact]
3016
. tm1 " .Bl -column [-offset <string>] <string1> <string2> ...
3017
. tm1 " .Bl {-item | -enum [-nested] | -bullet | -hyphen | -dash}
3018
. tm1 " [-offset <string>] [-compact] (#\n[.c])
3022
.\" NS doc-do-Bl-args macro
3023
.\" NS resolve remaining .Bl arguments
3028
.\" NS doc-compact-list-stackXXX
3029
.\" NS doc-list-indent-stackXXX
3030
.\" NS doc-list-offset-stackXXX
3031
.\" NS doc-num-columns
3032
.\" NS doc-tag-prefix-stackXXX
3033
.\" NS doc-tag-width-stackXXX
3035
.\" NS local variables:
3039
.\" NS doc-reg-dBla1
3040
.\" NS doc-reg-dBla2
3041
.\" NS doc-reg-dBla3
3042
.\" NS doc-reg-dBla4
3044
.\" NS doc-str-dBla1
3049
. if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
3052
. \" avoid a warning message in case e.g. `-offset' has no parameter
3053
. nr doc-reg-dBla (\n[doc-arg-ptr] + 1)
3054
. if !d doc-arg\n[doc-reg-dBla] \
3055
. ds doc-arg\n[doc-reg-dBla]
3059
. ie "\*[doc-arg\n[doc-arg-ptr]]"-compact" \
3060
. nr doc-compact-list-stack\n[doc-list-depth] 1
3062
. el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-nested" \{\
3063
. ie (\n[doc-list-depth] > 1) \{\
3064
. nr doc-reg-dBla1 (\n[doc-list-depth] - 1)
3065
. ds doc-tag-prefix-stack\n[doc-list-depth] "\*[doc-tag-prefix-stack\n[doc-reg-dBla1]]
3066
. as doc-tag-prefix-stack\n[doc-list-depth] \n[doc-enum-list-count-stack\n[doc-reg-dBla1]].
3067
. length doc-reg-dBla1 "\*[doc-tag-prefix-stack\n[doc-list-depth]]
3068
. nr doc-list-indent-stack\n[doc-list-depth] +\n[doc-reg-dBla1]n
3071
. tm mdoc warning: `-nested' allowed with nested .Bl requests only (#\n[.c])
3074
. el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
3076
. ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3077
. ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3079
. \" test whether argument is a valid numeric expression
3080
. nr doc-reg-dBla1 0
3081
. if \B(\*[doc-str-dBla]) \{\
3082
. \" disable warnings related to scaling indicators (32)
3083
. nr doc-reg-dBla2 \n[.warn]
3084
. warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
3086
. \" values without a scaling indicator are taken as strings;
3087
. \" we test whether the parameter string with and without the last
3088
. \" character yields identical numerical results (ignoring the
3089
. \" scaling indicator)
3090
. ds doc-str-dBla1 "\*[doc-str-dBla]
3091
. substring doc-str-dBla1 1 -1
3092
. if \B(\*[doc-str-dBla1]) \{\
3093
. nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
3094
. nr doc-reg-dBla4 (\*[doc-str-dBla1])
3095
. if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
3096
. nr doc-reg-dBla1 1
3099
. \" enable all warnings again
3100
. warn \n[doc-reg-dBla2]
3103
. ie \n[doc-reg-dBla1] \
3104
. nr doc-list-indent-stack\n[doc-list-depth] (\*[doc-str-dBla])
3106
. doc-get-arg-width \n[doc-arg-ptr]
3107
. ie (\n[doc-width] == 2) \{\
3108
. \" if the width parameter is a macro, use the macro's
3109
. \" width as specified in doc-common
3110
. doc-get-arg-type \*[doc-str-dBla]
3111
. ie (\n[doc-arg-type] == 1) \
3112
. nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3114
. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3117
. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3120
. el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-xwidth" \{\
3122
. ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3124
. ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3125
. substring doc-str-dBla 1 2
3126
. if .\*[doc-str-dBla] \{\
3127
. \" execute string in a box to get the width of the diversion
3128
. ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3129
. doc-save-global-vars
3136
. nop \*[doc-str-dBla]
3140
. doc-restore-global-vars
3141
. doc-get-width \h'\n[dl]u'
3143
. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3146
. el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
3149
. ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
3150
. nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
3152
. ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3153
. nr doc-reg-dBla1 0
3154
. if \B(\*[doc-str-dBla]) \{\
3155
. nr doc-reg-dBla2 \n[.warn]
3156
. warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
3158
. ds doc-str-dBla1 "\*[doc-str-dBla]
3159
. substring doc-str-dBla1 1 -1
3160
. if \B(\*[doc-str-dBla1]) \{\
3161
. nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
3162
. nr doc-reg-dBla4 (\*[doc-str-dBla1])
3163
. if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
3164
. nr doc-reg-dBla1 1
3167
. warn \n[doc-reg-dBla2]
3170
. ie \n[doc-reg-dBla1] \
3171
. nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
3173
. doc-get-arg-width \n[doc-arg-ptr]
3174
. ie (\n[doc-width] <= 3) \{\
3175
. \" if the offset parameter is a macro, use the macro's
3176
. \" width as specified in doc-common
3177
. doc-get-arg-type \*[doc-str-dBla]
3178
. ie (\n[doc-arg-type] == 1) \
3179
. nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3181
. nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3184
. nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3190
. \" not a known keyword, so it specifies the width of the next column
3191
. \" (if it is a column list)
3192
. if !\n[doc-reg-dBla] \{\
3193
. ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3194
. nr doc-num-columns +1
3195
. ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
3198
. tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'
3199
. tm1 " in .Bl request (#\n[.c])
3202
. if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
3207
.\" NS doc-save-global-vars macro
3208
.\" NS save all global variables
3210
.\" NS local variables:
3213
.de doc-save-global-vars
3214
. ds doc-macro-name-saved "\*[doc-macro-name]
3215
. nr doc-arg-limit-saved \n[doc-arg-limit]
3216
. nr doc-num-args-saved \n[doc-num-args]
3217
. nr doc-arg-ptr-saved \n[doc-arg-ptr]
3220
. while (\n[doc-reg-dsgv] <= \n[doc-arg-limit]) \{\
3221
. ds doc-arg\n[doc-reg-dsgv]-saved "\*[doc-arg\n[doc-reg-dsgv]]
3222
. nr doc-type\n[doc-reg-dsgv]-saved \n[doc-type\n[doc-reg-dsgv]]
3223
. ds doc-space\n[doc-reg-dsgv]-saved "\*[doc-space\n[doc-reg-dsgv]]
3224
. nr doc-reg-dsgv +1
3227
. nr doc-curr-font-saved \n[doc-curr-font]
3228
. nr doc-curr-size-saved \n[doc-curr-size]
3229
. nr doc-in-synopsis-section-saved \n[doc-in-synopsis-section]
3230
. nr doc-indent-synopsis-saved \n[doc-indent-synopsis]
3231
. nr doc-indent-synopsis-active-saved \n[doc-indent-synopsis-active]
3232
. nr doc-have-decl-saved \n[doc-have-decl]
3233
. nr doc-have-var-saved \n[doc-have-var]
3234
. ds doc-command-name-saved "\*[doc-command-name]
3235
. ds doc-quote-left-saved "\*[doc-quote-left]
3236
. ds doc-quote-right-saved "\*[doc-quote-right]
3237
. nr doc-nesting-level-saved \n[doc-nesting-level]
3238
. nr doc-in-list-saved \n[doc-in-list]
3239
. ds doc-space-saved "\*[doc-space]
3240
. ds doc-saved-space-saved "\*[doc-saved-space]
3241
. nr doc-space-mode-saved \n[doc-space-mode]
3242
. nr doc-have-space-saved \n[doc-have-space]
3243
. nr doc-have-slot-saved \n[doc-have-slot]
3244
. nr doc-keep-type-saved \n[doc-keep-type]
3245
. nr doc-display-depth-saved \n[doc-display-depth]
3246
. nr doc-is-compact-saved \n[doc-is-compact]
3249
. while (\n[doc-reg-dsgv] <= \n[doc-display-depth]) \{\
3250
. ds doc-display-type-stack\n[doc-reg-dsgv]-saved "\*[doc-display-type-stack\n[doc-reg-dsgv]]
3251
. nr doc-display-indent-stack\n[doc-reg-dsgv]-saved \n[doc-display-indent-stack\n[doc-reg-dsgv]]
3252
. nr doc-display-ad-stack\n[doc-reg-dsgv]-saved \n[doc-display-ad-stack\n[doc-reg-dsgv]]
3253
. nr doc-display-fi-stack\n[doc-reg-dsgv]-saved \n[doc-display-fi-stack\n[doc-reg-dsgv]]
3254
. nr doc-display-ft-stack\n[doc-reg-dsgv]-saved \n[doc-display-ft-stack\n[doc-reg-dsgv]]
3255
. nr doc-display-ps-stack\n[doc-reg-dsgv]-saved \n[doc-display-ps-stack\n[doc-reg-dsgv]]
3256
. nr doc-reg-dsgv +1
3259
. nr doc-fontmode-depth-saved \n[doc-fontmode-depth]
3262
. while (\n[doc-reg-dsgv] <= \n[doc-fontmode-depth]) \{\
3263
. nr doc-fontmode-font-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-font-stack\n[doc-reg-dsgv]]
3264
. nr doc-fontmode-size-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-size-stack\n[doc-reg-dsgv]]
3265
. nr doc-reg-dsgv +1
3268
. nr doc-list-depth-saved \n[doc-list-depth]
3271
. while (\n[doc-reg-dsgv] <= \n[doc-list-depth]) \{\
3272
. ds doc-list-type-stack\n[doc-reg-dsgv]-saved "\*[doc-list-type-stack\n[doc-reg-dsgv]]
3273
. nr doc-list-have-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-have-indent-stack\n[doc-reg-dsgv]]
3274
. nr doc-list-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-indent-stack\n[doc-reg-dsgv]]
3275
. nr doc-compact-list-stack\n[doc-reg-dsgv]-saved \n[doc-compact-list-stack\n[doc-reg-dsgv]]
3276
. ds doc-tag-prefix-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-prefix-stack\n[doc-reg-dsgv]]
3277
. ds doc-tag-width-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-width-stack\n[doc-reg-dsgv]]
3278
. nr doc-list-offset-stack\n[doc-reg-dsgv]-saved \n[doc-list-offset-stack\n[doc-reg-dsgv]]
3279
. nr doc-enum-list-count-stack\n[doc-reg-dsgv]-saved \n[doc-enum-list-count-stack\n[doc-reg-dsgv]]
3280
. nr doc-reg-dsgv +1
3283
. ds doc-saved-Pa-font-saved "\*[doc-saved-Pa-font]
3284
. nr doc-curr-type-saved \n[doc-curr-type]
3285
. ds doc-curr-arg-saved "\*[doc-curr-arg]
3286
. nr doc-diag-list-input-line-count-saved \n[doc-diag-list-input-line-count]
3287
. nr doc-num-columns-saved \n[doc-num-columns]
3288
. nr doc-column-indent-width-saved \n[doc-column-indent-width]
3289
. nr doc-is-func-saved \n[doc-is-func]
3290
. nr doc-have-old-func-saved \n[doc-have-old-func]
3291
. nr doc-func-arg-count-saved \n[doc-func-arg-count]
3292
. ds doc-func-arg-saved "\*[doc-func-arg]
3293
. nr doc-num-func-args-saved \n[doc-num-func-args]
3294
. nr doc-func-args-processed-saved \n[doc-func-args-processed]
3295
. nr doc-have-func-saved \n[doc-have-func]
3296
. nr doc-is-reference-saved \n[doc-is-reference]
3297
. nr doc-reference-count-saved \n[doc-reference-count]
3298
. nr doc-author-count-saved \n[doc-author-count]
3301
. while (\n[doc-reg-dsgv] <= \n[doc-author-count]) \{\
3302
. ds doc-author-name\n[doc-reg-dsgv]-saved "\*[doc-author-name\n[doc-reg-dsgv]]
3303
. nr doc-reg-dsgv +1
3306
. nr doc-book-count-saved \n[doc-book-count]
3307
. ds doc-book-name-saved "\*[doc-book-name]
3308
. nr doc-date-count-saved \n[doc-date-count]
3309
. ds doc-date-saved "\*[doc-date]
3310
. nr doc-publisher-count-saved \n[doc-publisher-count]
3311
. ds doc-publisher-name-saved "\*[doc-publisher-name]
3312
. nr doc-journal-count-saved \n[doc-journal-count]
3313
. ds doc-journal-name-saved "\*[doc-journal-name]
3314
. nr doc-issue-count-saved \n[doc-issue-count]
3315
. ds doc-issue-name-saved "\*[doc-issue-name]
3316
. nr doc-optional-count-saved \n[doc-optional-count]
3317
. ds doc-optional-string-saved "\*[doc-optional-string]
3318
. nr doc-page-number-count-saved \n[doc-page-number-count]
3319
. ds doc-page-number-string-saved "\*[doc-page-number-string]
3320
. nr doc-corporate-count-saved \n[doc-corporate-count]
3321
. ds doc-corporate-name-saved "\*[doc-corporate-name]
3322
. nr doc-report-count-saved \n[doc-report-count]
3323
. ds doc-report-name-saved "\*[doc-report-name]
3324
. nr doc-reference-title-count-saved \n[doc-reference-title-count]
3325
. ds doc-reference-title-name-saved "\*[doc-reference-title-name]
3326
. ds doc-reference-title-name-for-book-saved "\*[doc-reference-title-name-for-book]
3327
. nr doc-volume-count-saved \n[doc-volume-count]
3328
. ds doc-volume-name-saved "\*[doc-volume-name]
3329
. nr doc-have-author-saved \n[doc-have-author]
3331
. ds doc-document-title-saved "\*[doc-document-title]
3332
. ds doc-volume-saved "\*[doc-volume]
3333
. ds doc-section-saved "\*[doc-section]
3334
. ds doc-operating-system-saved "\*[doc-operating-system]
3335
. ds doc-date-string-saved "\*[doc-date-string]
3336
. nr doc-header-space-saved \n[doc-header-space]
3337
. nr doc-footer-space-saved \n[doc-footer-space]
3338
. nr doc-display-vertical-saved \n[doc-display-vertical]
3339
. ds doc-header-string-saved "\*[doc-header-string]
3340
. nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
3341
. nr doc-in-files-section-saved \n[doc-in-files-section]
3342
. nr doc-in-authors-section-saved \n[doc-in-authors-section]
3346
.\" NS doc-restore-global-vars macro
3347
.\" NS restore all global variables
3349
.\" NS local variables:
3352
.de doc-restore-global-vars
3353
. ds doc-macro-name "\*[doc-macro-name-saved]
3354
. nr doc-arg-limit \n[doc-arg-limit-saved]
3355
. nr doc-num-args \n[doc-num-args-saved]
3356
. nr doc-arg-ptr \n[doc-arg-ptr-saved]
3359
. while (\n[doc-reg-drgv] <= \n[doc-arg-limit]) \{\
3360
. ds doc-arg\n[doc-reg-drgv] "\*[doc-arg\n[doc-reg-drgv]-saved]
3361
. nr doc-type\n[doc-reg-drgv] \n[doc-type\n[doc-reg-drgv]-saved]
3362
. ds doc-space\n[doc-reg-drgv] "\*[doc-space\n[doc-reg-drgv]-saved]
3363
. nr doc-reg-drgv +1
3366
. nr doc-curr-font \n[doc-curr-font-saved]
3367
. nr doc-curr-size \n[doc-curr-size-saved]
3368
. nr doc-in-synopsis-section \n[doc-in-synopsis-section-saved]
3369
. nr doc-indent-synopsis \n[doc-indent-synopsis-saved]
3370
. nr doc-indent-synopsis-active \n[doc-indent-synopsis-active-saved]
3371
. nr doc-have-decl \n[doc-have-decl-saved]
3372
. nr doc-have-var \n[doc-have-var-saved]
3373
. ds doc-command-name "\*[doc-command-name-saved]
3374
. ds doc-quote-left "\*[doc-quote-left-saved]
3375
. ds doc-quote-right "\*[doc-quote-right-saved]
3376
. nr doc-nesting-level \n[doc-nesting-level-saved]
3377
. nr doc-in-list \n[doc-in-list-saved]
3378
. ds doc-space "\*[doc-space-saved]
3379
. ds doc-saved-space "\*[doc-saved-space-saved]
3380
. nr doc-space-mode \n[doc-space-mode-saved]
3381
. nr doc-have-space \n[doc-have-space-saved]
3382
. nr doc-have-slot \n[doc-have-slot-saved]
3383
. nr doc-keep-type \n[doc-keep-type-saved]
3384
. nr doc-display-depth \n[doc-display-depth-saved]
3385
. nr doc-is-compact \n[doc-is-compact-saved]
3388
. while (\n[doc-reg-drgv] <= \n[doc-display-depth]) \{\
3389
. ds doc-display-type-stack\n[doc-reg-drgv] "\*[doc-display-type-stack\n[doc-reg-drgv]-saved]
3390
. nr doc-display-indent-stack\n[doc-reg-drgv] \n[doc-display-indent-stack\n[doc-reg-drgv]-saved]
3391
. nr doc-display-ad-stack\n[doc-reg-drgv] \n[doc-display-ad-stack\n[doc-reg-drgv]-saved]
3392
. nr doc-display-fi-stack\n[doc-reg-drgv] \n[doc-display-fi-stack\n[doc-reg-drgv]-saved]
3393
. nr doc-display-ft-stack\n[doc-reg-drgv] \n[doc-display-ft-stack\n[doc-reg-drgv]-saved]
3394
. nr doc-display-ps-stack\n[doc-reg-drgv] \n[doc-display-ps-stack\n[doc-reg-drgv]-saved]
3395
. nr doc-reg-drgv +1
3398
. nr doc-fontmode-depth \n[doc-fontmode-depth-saved]
3401
. while (\n[doc-reg-drgv] <= \n[doc-fontmode-depth]) \{\
3402
. nr doc-fontmode-font-stack\n[doc-reg-drgv] \n[doc-fontmode-font-stack\n[doc-reg-drgv]]-saved
3403
. nr doc-fontmode-size-stack\n[doc-reg-drgv] \n[doc-fontmode-size-stack\n[doc-reg-drgv]]-saved
3404
. nr doc-reg-drgv +1
3407
. nr doc-list-depth \n[doc-list-depth-saved]
3410
. while (\n[doc-reg-drgv] <= \n[doc-list-depth]) \{\
3411
. ds doc-list-type-stack\n[doc-reg-drgv] "\*[doc-list-type-stack\n[doc-reg-drgv]-saved]
3412
. nr doc-list-have-indent-stack\n[doc-reg-drgv] \n[doc-list-have-indent-stack\n[doc-reg-drgv]-saved]
3413
. nr doc-list-indent-stack\n[doc-reg-drgv] \n[doc-list-indent-stack\n[doc-reg-drgv]-saved]
3414
. nr doc-compact-list-stack\n[doc-reg-drgv] \n[doc-compact-list-stack\n[doc-reg-drgv]-saved]
3415
. ds doc-tag-prefix-stack\n[doc-reg-drgv] "\*[doc-tag-prefix-stack\n[doc-reg-drgv]-saved]
3416
. ds doc-tag-width-stack\n[doc-reg-drgv] "\*[doc-tag-width-stack\n[doc-reg-drgv]-saved]
3417
. nr doc-list-offset-stack\n[doc-reg-drgv] \n[doc-list-offset-stack\n[doc-reg-drgv]-saved]
3418
. nr doc-enum-list-count-stack\n[doc-reg-drgv] \n[doc-enum-list-count-stack\n[doc-reg-drgv]-saved]
3419
. nr doc-reg-drgv +1
3422
. ds doc-saved-Pa-font "\*[doc-saved-Pa-font-saved]
3423
. nr doc-curr-type \n[doc-curr-type-saved]
3424
. ds doc-curr-arg "\*[doc-curr-arg-saved]
3425
. nr doc-diag-list-input-line-count \n[doc-diag-list-input-line-count-saved]
3426
. nr doc-num-columns \n[doc-num-columns-saved]
3427
. nr doc-column-indent-width \n[doc-column-indent-width-saved]
3428
. nr doc-is-func \n[doc-is-func-saved]
3429
. nr doc-have-old-func \n[doc-have-old-func-saved]
3430
. nr doc-func-arg-count \n[doc-func-arg-count-saved]
3431
. ds doc-func-arg "\*[doc-func-arg-saved]
3432
. nr doc-num-func-args \n[doc-num-func-args-saved]
3433
. nr doc-func-args-processed \n[doc-func-args-processed-saved]
3434
. nr doc-have-func \n[doc-have-func-saved]
3435
. nr doc-is-reference \n[doc-is-reference-saved]
3436
. nr doc-reference-count \n[doc-reference-count-saved]
3437
. nr doc-author-count \n[doc-author-count-saved]
3440
. while (\n[doc-reg-drgv] <= \n[doc-author-count]) \{\
3441
. ds doc-author-name\n[doc-reg-drgv] "\*[doc-author-name\n[doc-reg-drgv]-saved]
3442
. nr doc-reg-drgv +1
3445
. nr doc-book-count \n[doc-book-count-saved]
3446
. ds doc-book-name "\*[doc-book-name-saved]
3447
. nr doc-date-count \n[doc-date-count-saved]
3448
. ds doc-date "\*[doc-date-saved]
3449
. nr doc-publisher-count \n[doc-publisher-count-saved]
3450
. ds doc-publisher-name "\*[doc-publisher-name-saved]
3451
. nr doc-journal-count \n[doc-journal-count-saved]
3452
. ds doc-journal-name "\*[doc-journal-name-saved]
3453
. nr doc-issue-count \n[doc-issue-count-saved]
3454
. ds doc-issue-name "\*[doc-issue-name-saved]
3455
. nr doc-optional-count \n[doc-optional-count-saved]
3456
. ds doc-optional-string "\*[doc-optional-string-saved]
3457
. nr doc-page-number-count \n[doc-page-number-count-saved]
3458
. ds doc-page-number-string "\*[doc-page-number-string-saved]
3459
. nr doc-corporate-count \n[doc-corporate-count-saved]
3460
. ds doc-corporate-name "\*[doc-corporate-name-saved]
3461
. nr doc-report-count \n[doc-report-count-saved]
3462
. ds doc-report-name "\*[doc-report-name-saved]
3463
. nr doc-reference-title-count \n[doc-reference-title-count-saved]
3464
. ds doc-reference-title-name "\*[doc-reference-title-name-saved]
3465
. ds doc-reference-title-name-for-book "\*[doc-reference-title-name-for-book-saved]
3466
. nr doc-volume-count \n[doc-volume-count-saved]
3467
. ds doc-volume-name "\*[doc-volume-name-saved]
3468
. nr doc-have-author \n[doc-have-author-saved]
3470
. ds doc-document-title "\*[doc-document-title-saved]
3471
. ds doc-volume "\*[doc-volume-saved]
3472
. ds doc-section "\*[doc-section-saved]
3473
. ds doc-operating-system "\*[doc-operating-system-saved]
3474
. ds doc-date-string "\*[doc-date-string-saved]
3475
. nr doc-header-space \n[doc-header-space-saved]
3476
. nr doc-footer-space \n[doc-footer-space-saved]
3477
. nr doc-display-vertical \n[doc-display-vertical-saved]
3478
. ds doc-header-string "\*[doc-header-string-saved]
3479
. nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
3480
. nr doc-in-files-section \n[doc-in-files-section-saved]
3481
. nr doc-in-authors-section \n[doc-in-authors-section-saved]
3485
.\" NS El user macro
3489
.\" NS doc-list-depth
3490
.\" NS doc-macro-name
3492
.\" NS local variables:
3495
.\" NS width register `El' set in doc-common
3499
. tm Usage: .El (does not take arguments) (#\n[.c])
3503
. ds doc-macro-name El
3504
. ds doc-str-El \*[doc-list-type-stack\n[doc-list-depth]]
3506
. ie "\*[doc-str-El]"diag-list" \
3508
. el \{ .ie "\*[doc-str-El]"column-list" \
3509
. doc-end-column-list
3510
. el \{ .ie "\*[doc-str-El]"item-list" \
3512
. el \{ .ie "\*[doc-str-El]"ohang-list" \
3514
. el \{ .ie "\*[doc-str-El]"inset-list" \
3524
.\" NS doc-saved-Pa-font global string
3525
.\" NS saved doc-Pa-font string for section FILES (no underline if
3528
.ds doc-saved-Pa-font
3531
.\" NS doc-curr-type global register
3532
.\" NS current argument type
3537
.\" NS doc-curr-arg global string
3538
.\" NS current argument
3543
.\" NS doc-item-boxXXX global box
3544
.\" NS item boxes associated list depth
3547
.\" NS doc-list-depth
3550
.\" NS It user macro
3557
.\" NS doc-curr-type
3559
.\" NS doc-macro-name
3561
.\" NS doc-saved-Pa-font
3563
.\" NS local variables:
3566
.\" NS doc-XXX-list-type
3568
.\" NS width register `It' set in doc-common
3570
.nr doc-bullet-list-type 1
3571
.nr doc-column-list-type 0
3572
.nr doc-dash-list-type 1
3573
.nr doc-diag-list-type 0
3574
.nr doc-enum-list-type 1
3575
.nr doc-hang-list-type 2
3576
.nr doc-inset-list-type 2
3577
.nr doc-item-list-type 1
3578
.nr doc-ohang-list-type 2
3579
.nr doc-tag-list-type 2
3582
. ds doc-str-It \*[doc-list-type-stack\n[doc-list-depth]]
3584
. if "\*[doc-str-It]"" \
3585
. tm mdoc error: .It without preceding .Bl (#\n[.c])
3587
. if \n[doc-nesting-level] \{\
3588
. tmc "mdoc error: .It found in enclosing (e.g. .Ac ... .It ... .Ao)
3597
. ds doc-macro-name It
3599
. \" fill argument vector
3601
. while (\n[doc-reg-It] <= \n[.$]) \{\
3602
. ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3606
. nr doc-num-args \n[.$]
3610
. nr doc-reg-It \n[doc-\*[doc-str-It]-type]
3612
. if \n[doc-reg-It] \{\
3614
. box doc-item-box\n[doc-list-depth]
3615
. ev doc-item-env\n[doc-list-depth]
3621
. ie (\n[doc-reg-It] == 1) \{\
3623
. tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3624
. tm1 " don't take arguments (#\n[.c])
3628
. if (\n[doc-reg-It] == 2) \{\
3629
. \" handle list types with arguments
3630
. doc-parse-arg-vector
3634
. nr doc-curr-type \n[doc-type1]
3635
. ds doc-curr-arg "\*[doc-arg1]
3637
. if \n[doc-in-files-section] \{\
3638
. ds doc-saved-Pa-font "\*[doc-Pa-font]
3640
. ds doc-Pa-font "\*[doc-No-font]
3643
. ie (\n[doc-type1] == 1) \
3647
. doc-print-recursive
3650
. tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3651
. tm1 " require arguments (#\n[.c])
3655
. \" the previous call of `.doc-print-recursive' can contain calls to
3656
. \" opening requests like `.Ao'; we then defer the call of `doc-xxx-list'
3657
. if !\n[doc-nesting-level] \
3658
. doc-\*[doc-str-It]
3662
.\" NS doc-inset-list macro
3663
.\" NS .It item of list-type inset
3669
. \" finish item box
3673
. unformat doc-item-box\n[doc-list-depth]
3675
. doc-set-vertical-and-indent 0
3679
. doc-item-box\n[doc-list-depth]
3681
. if \n[doc-in-files-section] \
3683
. ds doc-Pa-font "\*[doc-saved-Pa-font]
3690
.\" NS doc-hang-list macro
3691
.\" NS .It item of list-type hanging tag (as opposed to tagged)
3694
.\" NS doc-have-space
3697
.\" NS local variables:
3702
. \" finish item box
3706
. unformat doc-item-box\n[doc-list-depth]
3708
. doc-set-vertical-and-indent 1
3709
. nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3710
. ti -\n[doc-reg-dhl]u
3713
. ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3714
. doc-item-box\n[doc-list-depth]
3716
. chop doc-item-box\n[doc-list-depth]
3717
. nr doc-reg-dhl1 \n[.k]u
3718
. nop \*[doc-item-box\n[doc-list-depth]]\c
3719
. nop \h'|(\n[doc-reg-dhl1]u - \n[.k]u + \n[doc-reg-dhl]u)'\c
3720
. nr doc-have-space 1
3723
. if \n[doc-in-files-section] \
3725
. ds doc-Pa-font "\*[doc-saved-Pa-font]
3732
.\" NS doc-ohang-list macro
3733
.\" NS .It item of list-type overhanging tag
3739
. \" finish item box
3743
. unformat doc-item-box\n[doc-list-depth]
3745
. doc-set-vertical-and-indent 0
3747
. doc-item-box\n[doc-list-depth]
3750
. if \n[doc-in-files-section] \
3752
. ds doc-Pa-font "\*[doc-saved-Pa-font]
3759
.\" NS doc-item-list macro
3760
.\" NS .It item of list-type [empty tag]
3763
. \" finish (dummy) item box
3768
. doc-set-vertical-and-indent 0
3775
.\" NS doc-enum-list-count-stackXXX global register
3776
.\" NS stack of current enum count values
3779
.\" NS doc-list-depth
3781
.nr doc-enum-list-count-stack1 0
3784
.\" NS doc-enum-list macro
3785
.\" NS enumerated list
3788
.\" NS doc-enum-list-count-stackXXX
3793
. nr doc-enum-list-count-stack\n[doc-list-depth] +1
3795
\#.ll \n[doc-list-indent-stack\n[doc-list-depth]]u
3797
. nop \*[doc-tag-prefix-stack\n[doc-list-depth]]\c
3798
. nop \n[doc-enum-list-count-stack\n[doc-list-depth]].\&
3803
.\" NS doc-bullet-list macro
3804
.\" NS bullet paragraph list
3811
. nop \)\*[doc-Sy-font]\[bu]\f[P]
3816
.\" NS doc-dash-list macro
3817
.\" NS hyphen paragraph list (sub bullet list)
3824
. nop \)\*[doc-Sy-font]\-\f[P]
3829
.\" NS doc-do-list macro
3830
.\" NS .It item of list-type enum/bullet/hyphen
3832
.als doc-do-list doc-hang-list
3835
.\" NS doc-diag-list-input-line-count global register
3836
.\" NS saved line number to be checked in next diag-list item
3838
.nr doc-diag-list-input-line-count 0
3841
.\" NS doc-diag-list macro
3842
.\" NS .It item of list-type diagnostic-message
3845
.\" NS doc-curr-font
3846
.\" NS doc-curr-size
3847
.\" NS doc-diag-list-input-line-count
3850
. nr doc-curr-font \n[.f]
3851
. nr doc-curr-size \n[.ps]
3853
. ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \{\
3854
. ie !\n[doc-compact-list-stack\n[doc-list-depth]] \
3861
. nr doc-diag-list-input-line-count \n[.c]
3864
. nop \*[doc-Sy-font]\c
3865
. if \n[doc-num-args] \
3866
. doc-remaining-args
3867
. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\*[doc-hard-space]\c
3869
. doc-print-and-reset
3873
.\" NS doc-tag-list macro
3874
.\" NS .It item of list-type `tag'
3877
.\" NS doc-have-space
3880
.\" NS local variables:
3886
. \" finish item box
3890
. unformat doc-item-box\n[doc-list-depth]
3892
. \" we use a box without `.nf' to compute the tag width (via `dl' register)
3899
. doc-item-box\n[doc-list-depth]
3904
. if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
3905
. if !\n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
3906
. in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3907
. nr doc-list-have-indent-stack\n[doc-list-depth] 1
3911
. doc-set-vertical-and-indent 1
3912
. nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3913
. ti -\n[doc-reg-dtl]u
3916
. ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3917
. doc-item-box\n[doc-list-depth]
3921
. chop doc-item-box\n[doc-list-depth]
3922
. nr doc-reg-dtl1 \n[.k]u
3923
. nop \*[doc-item-box\n[doc-list-depth]]\c
3924
. nop \h'|(\n[doc-reg-dtl1]u - \n[.k]u + \n[doc-reg-dtl]u)'\c
3925
. nr doc-have-space 1
3928
. if \n[doc-in-files-section] \
3930
. ds doc-Pa-font "\*[doc-saved-Pa-font]
3937
.\" NS doc-get-tag-width macro
3938
.\" NS resolve unknown tag width (`tag' list-type only)
3941
.\" NS doc-list-indent-stackXXX
3942
.\" NS doc-tag-width-stackXXX
3946
.\" NS doc-curr-type
3948
.de doc-get-tag-width
3949
. ie (\n[doc-curr-type] == 1) \{\
3950
. ds doc-tag-width-stack\n[doc-list-depth] \*[doc-curr-arg]
3951
. nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-curr-arg]]
3954
. ds doc-tag-width-stack\n[doc-list-depth] No
3955
. nr doc-list-indent-stack\n[doc-list-depth] \n[No]
3960
.\" NS doc-set-vertical-and-indent macro
3961
.\" NS set up vertical spacing (if not compact) and indentation (with
3962
.\" NS offset if argument is non-zero)
3965
.\" NS doc-list-have-indent-stackXXX
3967
.de doc-set-vertical-and-indent
3968
. if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3969
. sp \n[doc-display-vertical]u
3971
. if \n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
3972
. nr doc-list-have-indent-stack\n[doc-list-depth] 0
3974
. in +(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3982
.\" NS doc-list-depth global register
3983
.\" NS list type stack counter
3985
.nr doc-list-depth 0
3988
.\" NS doc-num-columns global register
3989
.\" NS number of columns
3991
.nr doc-num-columns 0
3994
.\" NS doc-compact-list-stackXXX global register (bool)
3995
.\" NS stack of flags to indicate whether a particular list is compact
3998
.\" NS doc-list-depth
4000
.nr doc-compact-list-stack1 0
4003
.\" NS doc-tag-prefix-stackXXX global string
4004
.\" NS stack of tag prefixes (currently used for -nested -enum lists)
4007
.\" NS doc-list-depth
4009
.ds doc-tag-prefix-stack1
4012
.\" NS doc-tag-width-stackXXX global string
4013
.\" NS stack of strings indicating how to set up current element of
4014
.\" NS doc-list-indent-stackXXX -- if set to TagwidtH, user has set it
4015
.\" NS directly; if it is a macro name, use the macro's width value;
4016
.\" NS otherwise, `doc-get-tag-width' uses width value of `No'.
4019
.\" NS doc-list-depth
4021
.ds doc-tag-width-stack0
4022
.ds doc-tag-width-stack1
4025
.\" NS doc-list-offset-stackXXX global register
4026
.\" NS stack of list offsets
4029
.\" NS doc-list-depth
4031
.nr doc-list-offset-stack1 0
4034
.\" NS doc-end-list macro
4035
.\" NS list end function; resets indentation (and offset if argument is
4039
.\" NS doc-list-depth
4040
.\" NS doc-list-offset-stackXXX
4044
' in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
4046
' in -\n[doc-list-offset-stack\n[doc-list-depth]]u
4048
. if (\n[doc-list-depth] <= 0) \
4049
. tm mdoc warning: extraneous .El call (#\n[.c])
4051
. doc-decrement-list-stack
4052
. nr doc-list-depth -1
4056
.\" NS doc-increment-list-stack macro
4057
.\" NS set up next block for list
4060
.\" NS doc-compact-list-stackXXX
4061
.\" NS doc-list-have-indent-stackXXX
4062
.\" NS doc-list-indent-stackXXX
4063
.\" NS doc-list-offset-stackXXX
4064
.\" NS doc-list-type-stackXXX
4065
.\" NS doc-tag-prefix-stackXXX
4066
.\" NS doc-tag-width-stackXXX
4067
.\" NS doc-enum-list-count-stackXXX
4069
.\" NS local variables:
4072
.de doc-increment-list-stack
4073
. nr doc-reg-dils (\n[doc-list-depth] + 1)
4074
. nr doc-list-have-indent-stack\n[doc-reg-dils] 0
4075
. nr doc-list-indent-stack\n[doc-reg-dils] 0
4076
. nr doc-list-offset-stack\n[doc-reg-dils] 0
4077
. ds doc-tag-prefix-stack\n[doc-reg-dils]
4078
. ds doc-tag-width-stack\n[doc-reg-dils] \*[doc-tag-width-stack\n[doc-list-depth]]
4079
. ds doc-list-type-stack\n[doc-reg-dils]
4080
. nr doc-compact-list-stack\n[doc-reg-dils] 0
4081
. nr doc-enum-list-count-stack\n[doc-reg-dils] 0
4085
.\" NS doc-decrement-list-stack macro
4086
.\" NS decrement stack
4089
.\" NS doc-compact-list-stackXXX
4090
.\" NS doc-list-have-indent-stackXXX
4091
.\" NS doc-list-indent-stackXXX
4092
.\" NS doc-list-offset-stackXXX
4093
.\" NS doc-list-type-stackXXX
4094
.\" NS doc-tag-prefix-stackXXX
4095
.\" NS doc-tag-width-stackXXX
4096
.\" NS doc-enum-list-count-stackXXX
4098
.de doc-decrement-list-stack
4099
. ds doc-list-type-stack\n[doc-list-depth]
4100
. nr doc-list-have-indent-stack\n[doc-list-depth] 0
4101
. nr doc-list-indent-stack\n[doc-list-depth] 0
4102
. nr doc-list-offset-stack\n[doc-list-depth] 0
4103
. ds doc-tag-prefix-stack\n[doc-list-depth]
4104
. ds doc-tag-width-stack\n[doc-list-depth]
4105
. nr doc-compact-list-stack\n[doc-list-depth] 0
4106
. nr doc-enum-list-count-stack\n[doc-list-depth] 0
4110
.\" NS Xr user macro
4111
.\" NS cross reference (for man pages only)
4115
.\" NS doc-macro-name
4117
.\" NS local variables:
4120
.\" NS width register `Xr' set in doc-common
4123
. if !\n[doc-arg-limit] \{\
4125
. ds doc-macro-name Xr
4126
. doc-parse-args \$@
4132
. if !\n[doc-arg-limit] \
4136
. doc-print-prefixes
4137
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4138
. \" first argument must be a string
4139
. ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4140
. nr doc-curr-font \n[.f]
4141
. nr doc-curr-size \n[.ps]
4142
. ds doc-arg\n[doc-arg-ptr] \*[doc-Xr-font]\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4144
. if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4145
. nr doc-reg-Xr (\n[doc-arg-ptr] + 1)
4146
. \" modify second argument if it is a string and
4147
. \" remove space inbetween
4148
. if (\n[doc-type\n[doc-reg-Xr]] == 2) \{\
4149
. ds doc-arg\n[doc-reg-Xr] \*[lp]\*[doc-arg\n[doc-reg-Xr]]\*[rp]
4150
. ds doc-space\n[doc-arg-ptr]
4153
. doc-print-recursive
4163
.\" NS doc-Xr-usage macro
4166
. tm Usage: .Xr manpage_name [section#] ... (#\n[.c])
4171
.\" NS Sx user macro
4172
.\" NS cross section reference
4174
.\" NS width register `Sx' set in doc-common
4176
.als Sx doc-generic-macro
4177
.ds doc-Sx-usage section_header
4180
.\" NS doc-end-column-list macro
4181
.\" NS column-list end-list
4184
.\" NS doc-list-depth
4186
.de doc-end-column-list
4188
' in -(\n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-list-indent-stack\n[doc-list-depth]]u)
4191
. doc-decrement-list-stack
4192
. nr doc-list-depth -1
4196
.\" NS doc-column-indent-width global register
4197
.\" NS holds the indent width for a column list
4199
.nr doc-column-indent-width 0
4202
.\" NS doc-set-column-tab macro
4203
.\" NS establish tabs for list-type column: `.doc-set-column-tab num_cols'
4206
.\" NS doc-column-indent-width
4208
.\" NS local variables:
4211
.\" NS doc-str-dsct1
4213
.de doc-set-column-tab
4216
. nr doc-column-indent-width 0
4219
. ds doc-str-dsct1 " \"
4222
. ds doc-str-dsct1 " \"
4224
. \" XXX: this is packed abnormally close -- intercolumn width
4225
. \" should be configurable
4226
. ds doc-str-dsct1 " \"
4229
. while (\n[doc-reg-dsct] <= \$1) \{\
4230
. as doc-str-dsct " +\w\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]u
4231
. nr doc-column-indent-width +\w\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]u
4232
. nr doc-reg-dsct +1
4235
. ta \*[doc-str-dsct]
4236
' in +\n[doc-column-indent-width]u
4240
.\" NS doc-column-list macro
4245
.\" NS doc-list-indent-stackXXX
4248
.\" NS local variables:
4252
. if \n[doc-num-args] \
4253
. doc-parse-arg-vector
4256
. if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4257
. tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
4261
. if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
4262
. nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
4263
. ds doc-space\n[doc-reg-dcl]
4266
. if !\n[doc-list-indent-stack\n[doc-list-depth]] \
4267
. nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
4270
' in +\n[doc-column-indent-width]u
4272
. ti -\n[doc-column-indent-width]u
4274
. doc-do-\n[doc-type\n[doc-arg-ptr]]
4278
.\" NS Ta user macro
4279
.\" NS append tab (\t)
4284
.\" NS width register `Ta' set in doc-common
4287
. ie \n[doc-arg-limit] \{\
4290
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
4291
. doc-do-\n[doc-type\n[doc-arg-ptr]]
4296
. tm1 "Usage: Ta must follow column entry: e.g.
4297
. tm1 " .It column_string [Ta [column_string ...]] (#\n[.c])
4302
.\" NS Dl user macro
4303
.\" NS display (one line) literal
4305
.\" NS this function uses the `Li' font
4309
.\" NS doc-curr-font
4310
.\" NS doc-curr-size
4311
.\" NS doc-macro-name
4313
.\" NS width register `Dl' set in doc-common
4317
. in +\n[doc-display-indent]u
4319
. ie \n[doc-arg-limit] \{\
4320
. tm Usage: .Dl not callable by other macros (#\n[.c])
4325
. ds doc-macro-name Dl
4326
. doc-parse-args \$@
4328
. nr doc-curr-font \n[.f]
4329
. nr doc-curr-size \n[.ps]
4330
. nop \*[doc-Li-font]\c
4331
. doc-print-recursive
4334
. tm Usage: .Dl argument ... (#\n[.c])
4337
. in -\n[doc-display-indent]u
4341
.\" NS D1 user macro
4342
.\" NS display (one line)
4346
.\" NS doc-macro-name
4348
.\" NS width register `D1' set in doc-common
4352
. in +\n[doc-display-indent]u
4354
. ie \n[doc-arg-limit] \{\
4355
. tm Usage: .D1 not callable by other macros (#\n[.c])
4360
. ds doc-macro-name D1
4361
. doc-parse-args \$@
4363
. doc-print-recursive
4366
. tm Usage: .D1 argument ... (#\n[.c])
4369
. in -\n[doc-display-indent]u
4373
.\" NS Vt user macro
4374
.\" NS variable type (for forcing old style variable declarations);
4375
.\" NS this is not done in the same manner as .Ot for fortrash --
4376
.\" NS clean up later
4379
.\" NS doc-curr-font
4380
.\" NS doc-curr-size
4381
.\" NS doc-have-decl
4383
.\" NS doc-macro-name
4385
.\" NS width register `Vt' set in doc-common
4388
. if !\n[doc-arg-limit] \{\
4390
. ds doc-macro-name Vt
4391
. doc-parse-args \$@
4394
. tm Usage: .Vt variable_type ... (#\n[.c])
4397
. if !\n[doc-arg-limit] \
4401
. if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4402
. tm Usage: .Vt variable_type ... (#\n[.c])
4407
. if \n[doc-in-synopsis-section] \{\
4408
. \" if a function declaration was the last thing given,
4409
. \" want vertical space
4410
. if \n[doc-have-decl] \{\
4412
. nr doc-have-decl 0
4415
. \" if a subroutine was the last thing given, want vertical space
4416
. if \n[doc-have-func] \{\
4417
. ie \n[doc-have-var] \
4426
. nr doc-curr-font \n[.f]
4427
. nr doc-curr-size \n[.ps]
4428
. nop \*[doc-Ft-font]\c
4429
. doc-print-recursive
4431
. if \n[doc-in-synopsis-section] \{\
4432
. ie \n[doc-have-old-func] \
4433
. nop \*[doc-soft-space]\c
4440
.\" NS doc-is-func global register (bool)
4441
.\" NS set if subroutine (in synopsis only) (fortran only)
4446
.\" NS Ft user macro
4447
.\" NS function type
4450
.\" NS doc-curr-font
4451
.\" NS doc-curr-size
4452
.\" NS doc-have-decl
4455
.\" NS doc-macro-name
4457
.\" NS width register `Ft' set in doc-common
4460
. if !\n[doc-arg-limit] \{\
4462
. ds doc-macro-name Ft
4463
. doc-parse-args \$@
4466
. tm Usage: .Ft function_type ... (#\n[.c])
4469
. if !\n[doc-arg-limit] \
4473
. if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4474
. tm Usage: .Ft function_type ... (#\n[.c])
4479
. if \n[doc-in-synopsis-section] \{\
4480
. if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4482
. nr doc-have-decl 0
4486
. if \n[doc-have-var] \{\
4494
. nr doc-curr-font \n[.f]
4495
. nr doc-curr-size \n[.ps]
4496
. nop \*[doc-Ft-font]\c
4497
. doc-print-recursive
4501
.\" NS doc-have-old-func global register (bool)
4502
.\" NS set if `Ot' has been called
4504
.nr doc-have-old-func 0
4507
.\" NS Ot user macro
4508
.\" NS old function type (fortran -- no newline)
4511
.\" NS doc-have-decl
4512
.\" NS doc-have-old-func
4516
.\" NS width register `Ot' set in doc-common
4519
. nr doc-have-old-func 1
4521
. if \n[doc-in-synopsis-section] \{\
4522
. if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4524
. nr doc-have-decl 0
4528
. if \n[doc-have-var] \{\
4537
. nop \*[doc-Ft-font]\$*\c
4542
.\" NS Fa user macro
4543
.\" NS function arguments
4547
.\" NS doc-curr-font
4548
.\" NS doc-curr-size
4549
.\" NS doc-macro-name
4551
.\" NS width register `Fa' set in doc-common
4554
. if !\n[doc-arg-limit] \{\
4556
. ds doc-macro-name Fa
4557
. doc-parse-args \$@
4560
. tm Usage: .Fa function_arguments ... (#\n[.c])
4563
. ie \n[doc-func-arg-count] \
4567
. if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4568
. nr doc-curr-font \n[.f]
4569
. nr doc-curr-size \n[.ps]
4570
. nop \*[doc-Fa-font]\c
4571
. doc-print-recursive
4573
. if \n[doc-in-synopsis-section] \
4574
. if \n[doc-have-func] \
4580
.\" NS doc-func-arg-count global register
4581
.\" NS how many function arguments have been processed so far
4583
.nr doc-func-arg-count 0
4586
.\" NS doc-func-arg global string
4587
.\" NS work buffer for function name strings
4592
.\" NS doc-num-func-args global register
4593
.\" NS number of function arguments
4595
.nr doc-num-func-args 0
4598
.\" NS doc-func-args-processed global register
4599
.\" NS function arguments processed so far
4601
.nr doc-func-args-processed 0
4604
.\" NS doc-do-func macro
4605
.\" NS internal .Fa for .Fc
4611
.\" NS doc-func-arg-count
4612
.\" NS doc-func-args-processed
4613
.\" NS doc-num-func-args
4616
. if (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
4624
. nr doc-num-func-args 0
4625
. nr doc-func-args-processed 0
4627
. doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4628
. if (\n[doc-num-func-args] > 1) \
4629
. ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4631
. if (\n[doc-func-arg-count] > 1) \{\
4632
. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\|,\)\c
4633
. nop \)\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]\c
4634
. nop \)\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]\c
4637
. if (\n[doc-func-arg-count] == 1) \{\
4638
. nop \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]\c
4641
. nr doc-func-arg-count +1
4646
.\" NS doc-have-func global register (bool)
4647
.\" NS whether we have more than one function in synopsis
4652
.\" NS Fn user macro
4657
.\" NS doc-curr-font
4658
.\" NS doc-curr-size
4659
.\" NS doc-have-decl
4660
.\" NS doc-have-func
4662
.\" NS doc-indent-synopsis
4664
.\" NS doc-macro-name
4666
.\" NS width register `Fn' set in doc-common
4669
. if !\n[doc-arg-limit] \{\
4671
. ds doc-macro-name Fn
4672
. doc-parse-args \$@
4675
. tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
4678
. if !\n[doc-arg-limit] \
4681
. if \n[doc-in-synopsis-section] \{\
4682
. \" if there is/has been more than one subroutine declaration
4683
. ie \n[doc-is-func] \{\
4686
. nr doc-have-decl 0
4690
. if \n[doc-have-func] \{\
4693
. nr doc-have-decl 0
4696
. if \n[doc-have-decl] \{\
4701
. if \n[doc-have-var] \{\
4703
. nr doc-have-decl 0
4706
. nr doc-have-func 1
4710
. if !\n[doc-indent-synopsis] \
4711
. nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4712
. if !\n[doc-indent-synopsis-active] \
4713
. in +\n[doc-indent-synopsis]u
4714
. ti -\n[doc-indent-synopsis]u
4718
. doc-print-prefixes
4719
. if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4720
. tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
4725
. nr doc-curr-font \n[.f]
4726
. nr doc-curr-size \n[.ps]
4727
. nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
4728
. nop \f[P]\s[0]\*[lp]\)\c
4731
. if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4732
. if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4733
. nop \*[doc-Fa-font]\c
4735
. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
4739
. if \n[doc-in-synopsis-section] \
4742
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4743
. \" output the space (if needed)
4745
. nop \)\*[doc-space\n[doc-arg-ptr]]\c
4748
. doc-print-recursive
4751
. doc-print-and-reset
4753
. if \n[doc-in-synopsis-section] \
4754
. if !\n[doc-indent-synopsis-active] \
4755
. in -\n[doc-indent-synopsis]u
4759
.\" NS doc-do-func-args macro
4760
.\" NS handle function arguments
4766
.\" NS doc-func-args-processed
4767
.\" NS doc-num-func-args
4769
.\" NS local variables:
4772
.de doc-do-func-args
4773
. if \n[doc-in-synopsis-section] \{\
4775
. nr doc-num-func-args 0
4776
. nr doc-func-args-processed 0
4778
. doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4779
. if (\n[doc-num-func-args] > 1) \
4780
. ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4783
. nop \)\*[doc-arg\n[doc-arg-ptr]]\c
4786
. if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4787
. if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4788
. nr doc-reg-ddfa (\n[doc-arg-ptr] - 1)
4789
. nop \|\f[\n[doc-curr-font]]\s[\n[doc-curr-size]u],\)\c
4790
. nop \)\*[doc-space\n[doc-reg-ddfa]]\f[P]\s[0]\|\c
4796
.\" NS doc-saved-nesting-level global register
4798
.nr doc-saved-nesting-level 0
4801
.\" NS doc-in-func-enclosure global register (bool)
4803
.nr doc-in-func-enclosure 0
4806
.\" NS Fo user macro
4807
.\" NS function open
4811
.\" NS doc-curr-font
4812
.\" NS doc-curr-size
4813
.\" NS doc-func-arg-count
4814
.\" NS doc-have-decl
4815
.\" NS doc-have-func
4817
.\" NS doc-in-func-enclosure
4818
.\" NS doc-indent-synopsis
4820
.\" NS doc-macro-name
4821
.\" NS doc-saved-nesting-level
4823
.\" NS width register `Fo' set in doc-common
4826
. if (\n[doc-in-func-enclosure]) \{\
4827
. tm mdoc error: .Fo/.Fc can't be nested (#\n[.c])
4831
. nr doc-saved-nesting-level \n[doc-nesting-level]
4832
. nr doc-in-func-enclosure 1
4834
. if !\n[doc-arg-limit] \{\
4836
. ds doc-macro-name Fo
4837
. doc-parse-args \$@
4840
. tm Usage: .Fo function_name (#\n[.c])
4843
. if \n[doc-in-synopsis-section] \{\
4844
. \" if there is/has been more than one subroutine declaration
4845
. ie \n[doc-is-func] \{\
4848
. nr doc-have-decl 0
4852
. if \n[doc-have-func] \{\
4855
. nr doc-have-decl 0
4858
. if \n[doc-have-decl] \{\
4863
. if \n[doc-have-var] \{\
4865
. nr doc-have-decl 0
4868
. nr doc-have-func 1
4872
. if !\n[doc-indent-synopsis] \
4873
. nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4876
. \" start function box
4884
. doc-print-prefixes
4885
. if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4886
. nr doc-func-arg-count 1
4887
. nr doc-curr-font \n[.f]
4888
. nr doc-curr-size \n[.ps]
4890
. nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
4891
. nop \f[P]\s[0]\*[lp]\)\c
4897
.\" NS Fc user macro
4898
.\" NS function close
4902
.\" NS doc-func-arg-count
4903
.\" NS doc-in-func-enclosure
4904
.\" NS doc-saved-nesting-level
4905
.\" NS doc-macro-name
4907
.\" NS width register `Fc' set in doc-common
4910
. if !\n[doc-in-func-enclosure] \{\
4911
. tm mdoc warning: Extraneous .Fc (#\n[.c])
4916
. ds doc-macro-name Fc
4917
. \" the first (dummy) argument is used to get the correct spacing
4918
. doc-parse-args \) \$@
4921
. if !(\n[doc-saved-nesting-level] == \n[doc-nesting-level]) \
4922
. tm mdoc warning: Unbalanced enclosure commands within .Fo/.Fc
4924
. nr doc-func-arg-count 0
4925
. nr doc-in-func-enclosure 0
4927
. ie \n[doc-in-synopsis-section] \
4932
. \" finish function box
4937
. unformat doc-func-box
4939
. if \n[doc-in-synopsis-section] \{\
4940
. if !\n[doc-indent-synopsis-active] \
4941
. in +\n[doc-indent-synopsis]u
4942
. ti -\n[doc-indent-synopsis]u
4946
. nop \*[doc-func-box]\c
4949
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4950
. nr doc-curr-font \n[.f]
4951
. nr doc-curr-size \n[.ps]
4952
. doc-print-recursive
4955
. doc-print-and-reset
4957
. if \n[doc-in-synopsis-section] \
4958
. if !\n[doc-indent-synopsis-active] \
4959
. in -\n[doc-indent-synopsis]u
4963
.\" NS doc-build-func-string macro
4964
.\" NS collect function arguments and set hard spaces inbetween
4968
.\" NS doc-func-args-processed
4969
.\" NS doc-num-func-args
4971
.de doc-build-func-string
4972
. if !\n[doc-num-func-args] \{\
4973
. nr doc-num-func-args \n[.$]
4974
. nr doc-func-args-processed 0
4978
. nr doc-func-args-processed +1
4979
. as doc-func-arg "\$1
4981
. if (\n[doc-func-args-processed] < \n[doc-num-func-args]) \{\
4982
. as doc-func-arg "\*[doc-hard-space]
4985
. doc-build-func-string \$@
4990
.\" Very crude references: Stash all reference info into boxes, print out
4991
.\" reference on .Re request and clean up. Ordering very limited, no fancy
4992
.\" citations, but can do articles, journals, and books -- need to add
4993
.\" several missing options (like city etc). Should be able to grab a refer
4994
.\" entry, massage it a wee bit (prefix a `.' to the %[A-Z]) and not worry
4998
.\" NS doc-is-reference global register (bool)
4999
.\" NS set if in reference
5001
.nr doc-is-reference 0
5004
.\" NS doc-reference-count global register
5005
.\" NS reference element counter
5007
.nr doc-reference-count 0
5010
.\" NS Rs user macro
5011
.\" NS reference start
5014
.\" NS doc-is-reference
5015
.\" NS doc-reference-count
5017
.\" NS width register `Rs' set in doc-common
5021
. tm Usage: .Rs (does not take arguments) (#\n[.c])
5023
. nr doc-is-reference 1
5024
. doc-reset-reference
5025
. if \n[doc-in-see-also-section] \
5027
. nr doc-reference-count 0
5032
.\" NS Re user macro
5033
.\" NS reference end
5036
.\" NS doc-is-reference
5038
.\" NS width register `Re' set in doc-common
5042
. tm Usage: .Re (does not take arguments) (#\n[.c])
5044
. doc-print-reference
5045
. doc-reset-reference
5046
. nr doc-is-reference 0
5051
.\" NS doc-reset-reference macro
5052
.\" NS reference cleanup
5055
.\" NS doc-author-count
5056
.\" NS doc-author-nameXXX
5057
.\" NS doc-book-count
5058
.\" NS doc-book-name
5059
.\" NS doc-corporate-count
5060
.\" NS doc-corporate-name
5062
.\" NS doc-date-count
5063
.\" NS doc-issue-count
5064
.\" NS doc-issue-name
5065
.\" NS doc-journal-count
5066
.\" NS doc-journam-name
5067
.\" NS doc-optional-count
5068
.\" NS doc-optional-string
5069
.\" NS doc-page-number-count
5070
.\" NS doc-page-number-string
5071
.\" NS doc-reference-title-count
5072
.\" NS doc-reference-title-name
5073
.\" NS doc-reference-title-name-for-book
5074
.\" NS doc-report-count
5075
.\" NS doc-report-name
5076
.\" NS doc-volume-count
5077
.\" NS doc-volume-name
5079
.de doc-reset-reference
5080
. while (\n[doc-author-count]) \{\
5081
. ds doc-author-name\n[doc-author-count]
5082
. nr doc-author-count -1
5084
. nr doc-journal-count 0
5085
. nr doc-issue-count 0
5086
. nr doc-optional-count 0
5087
. nr doc-corporate-count 0
5088
. nr doc-report-count 0
5089
. nr doc-reference-title-count 0
5090
. nr doc-volume-count 0
5091
. nr doc-date-count 0
5092
. nr doc-page-number-count 0
5093
. nr doc-book-count 0
5095
. ds doc-journal-name
5097
. ds doc-optional-string
5098
. ds doc-corporate-name
5099
. ds doc-report-name
5100
. ds doc-reference-title-name
5101
. ds doc-reference-title-name-for-book
5102
. ds doc-volume-name
5104
. ds doc-page-number-string
5109
.\" NS doc-finish-reference macro
5110
.\" NS auxiliary macro for doc-print-reference
5113
.\" NS doc-reference-count
5115
.de doc-finish-reference
5116
. nr doc-reference-count -1
5117
. ie \n[doc-reference-count] \
5124
.\" NS doc-print-reference macro
5125
.\" NS reference print
5128
.\" NS doc-reference-count
5130
.de doc-print-reference
5134
. if \n[doc-author-count] \{\
5135
. doc-print-reference-authors
5136
. nr doc-reference-count -\n[doc-author-count]
5139
. if \n[doc-reference-title-count] \{\
5140
. unformat doc-reference-title-name
5141
. chop doc-reference-title-name
5142
. unformat doc-reference-title-name-for-book
5143
. chop doc-reference-title-name-for-book
5144
. ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \{\
5145
. nop \)\*[q]\)\*[doc-reference-title-name-for-book]\)\*[q]\c
5146
. doc-finish-reference
5149
. nop \*[doc-reference-title-name]\c
5150
. doc-finish-reference
5153
. if \n[doc-book-count] \{\
5154
. unformat doc-book-name
5155
. chop doc-book-name
5156
. nop \*[doc-book-name]\c
5157
. doc-finish-reference
5160
. if \n[doc-publisher-count] \{\
5161
. unformat doc-publisher-name
5162
. chop doc-publisher-name
5163
. nop \*[doc-publisher-name]\c
5164
. doc-finish-reference
5167
. if \n[doc-journal-count] \{\
5168
. unformat doc-journal-name
5169
. chop doc-journal-name
5170
. nop \*[doc-journal-name]\c
5171
. doc-finish-reference
5174
. if \n[doc-report-count] \{\
5175
. unformat doc-report-name
5176
. chop doc-report-name
5177
. nop \*[doc-report-name]\c
5178
. doc-finish-reference
5181
. if \n[doc-issue-count] \{\
5182
. unformat doc-issue-name
5183
. chop doc-issue-name
5184
. nop \*[doc-issue-name]\c
5185
. doc-finish-reference
5188
. if \n[doc-volume-count] \{\
5189
. unformat doc-volume-name
5190
. chop doc-volume-name
5191
. nop \*[doc-volume-name]\c
5192
. doc-finish-reference
5195
. if \n[doc-page-number-count] \{\
5196
. unformat doc-page-number-string
5197
. chop doc-page-number-string
5198
. nop \*[doc-page-number-string]\c
5199
. doc-finish-reference
5202
. if \n[doc-corporate-count] \{\
5203
. unformat doc-corporate-name
5204
. chop doc-corporate-name
5205
. nop \*[doc-corporate-name]\c
5206
. doc-finish-reference
5209
. if \n[doc-date-count] \{\
5212
. nop \*[doc-date]\c
5213
. doc-finish-reference
5216
. if \n[doc-optional-count] \{\
5217
. unformat doc-optional-string
5218
. chop doc-optional-string
5219
. nop \*[doc-optional-string]\c
5220
. doc-finish-reference
5223
. if \n[doc-reference-count] \
5224
. tm mdoc warning: unresolved reference problem
5226
. hy \n[doc-hyphen-flags]
5230
.\" NS doc-print-reference-authors macro
5231
.\" NS print out reference authors
5233
.\" NS local variables:
5237
.ds doc-str-dpra "and
5239
.de doc-print-reference-authors
5242
. while (\n[doc-reg-dpra] < \n[doc-author-count]) \{\
5243
. unformat doc-author-name\n[doc-reg-dpra]
5244
. chop doc-author-name\n[doc-reg-dpra]
5245
. ie (\n[doc-author-count] > 2) \
5246
. nop \)\*[doc-author-name\n[doc-reg-dpra]],
5248
. nop \)\*[doc-author-name\n[doc-reg-dpra]]
5249
. nr doc-reg-dpra +1
5252
. unformat doc-author-name\n[doc-reg-dpra]
5253
. chop doc-author-name\n[doc-reg-dpra]
5254
. if (\n[doc-author-count] > 1) \
5255
. nop \)\*[doc-str-dpra]
5256
. nop \)\*[doc-author-name\n[doc-reg-dpra]],
5260
.\" NS doc-author-count global register
5261
.\" NS counter of author references
5263
.nr doc-author-count 0
5266
.\" NS doc-author-nameXXX global box
5267
.\" NS array of author names
5270
.\" NS doc-author-count
5272
.ds doc-author-name0
5275
.\" NS %A user macro
5276
.\" NS reference author(s)
5280
.\" NS doc-author-count
5281
.\" NS doc-curr-font
5282
.\" NS doc-curr-size
5283
.\" NS doc-macro-name
5284
.\" NS doc-reference-count
5286
.\" NS local variables:
5289
.\" NS width register `%A' set in doc-common
5292
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5293
. tm Usage: .%A author_name ... (#\n[.c])
5297
. nr doc-author-count +1
5298
. nr doc-reference-count +1
5300
. ds doc-macro-name %A
5301
. doc-parse-args \$@
5304
. nr doc-curr-font \n[.f]
5305
. nr doc-curr-size \n[.ps]
5307
. \" save to reference box
5308
. box doc-author-name\n[doc-author-count]
5317
.\" NS doc-book-count global register
5318
.\" NS counter of book references
5320
.nr doc-book-count 0
5323
.\" NS doc-book-name global box
5324
.\" NS string of collected book references
5329
.\" NS %B user macro
5330
.\" NS [reference] book name
5334
.\" NS doc-book-count
5335
.\" NS doc-curr-font
5336
.\" NS doc-curr-size
5337
.\" NS doc-macro-name
5338
.\" NS doc-reference-count
5340
.\" NS local variables:
5343
.\" NS width register `%B' set in doc-common
5346
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5347
. tm Usage: .%B book_name ... (#\n[.c])
5351
. if \n[doc-is-reference] \{\
5352
. nr doc-book-count +1
5353
. nr doc-reference-count +1
5356
. ds doc-macro-name %B
5357
. doc-parse-args \$@
5360
. nr doc-curr-font \n[.f]
5361
. nr doc-curr-size \n[.ps]
5363
. ie \n[doc-is-reference] \{\
5364
. \" append to reference box
5365
. boxa doc-book-name
5370
. nop \*[doc-Em-font]\c
5374
. nop \*[doc-Em-font]\c
5375
. doc-print-recursive
5380
.\" NS doc-date-count global register
5381
.\" NS counter of date references
5383
.nr doc-date-count 0
5386
.\" NS doc-date global box
5387
.\" NS string of collected date references
5392
.\" NS %D user macro
5393
.\" NS [reference] date
5397
.\" NS doc-curr-font
5398
.\" NS doc-curr-size
5399
.\" NS doc-date-count
5400
.\" NS doc-macro-name
5401
.\" NS doc-reference-count
5403
.\" NS local variables:
5406
.\" NS width register `%D' set in doc-common
5409
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5410
. tm Usage: .%D date ... (#\n[.c])
5414
. nr doc-date-count +1
5415
. nr doc-reference-count +1
5417
. ds doc-macro-name %D
5418
. doc-parse-args \$@
5421
. nr doc-curr-font \n[.f]
5422
. nr doc-curr-size \n[.ps]
5424
. \" append to reference box
5434
.\" NS doc-publisher-count global register
5435
.\" NS counter of publisher references
5437
.nr doc-publisher-count 0
5440
.\" NS doc-publisher-name global box
5441
.\" NS string of collected publisher references
5443
.ds doc-publisher-name
5446
.\" NS %I user macro
5447
.\" NS [reference] issuer/publisher name
5451
.\" NS doc-curr-font
5452
.\" NS doc-curr-size
5453
.\" NS doc-macro-name
5454
.\" NS doc-publisher-count
5455
.\" NS doc-reference-count
5457
.\" NS local variables:
5460
.\" NS width register `%I' set in doc-common
5463
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5464
. tm Usage: .%I issuer/publisher_name ... (#\n[.c])
5468
. nr doc-publisher-count +1
5469
. nr doc-reference-count +1
5471
. ds doc-macro-name %I
5472
. doc-parse-args \$@
5475
. nr doc-curr-font \n[.f]
5476
. nr doc-curr-size \n[.ps]
5478
. \" append to reference box
5479
. boxa doc-publisher-name
5484
. nop \*[doc-Em-font]\c
5489
.\" NS doc-journal-count global register
5490
.\" NS counter of journal references
5492
.nr doc-journal-count 0
5495
.\" NS doc-journal-name global box
5496
.\" NS string of collected journal references
5498
.ds doc-journal-name
5501
.\" NS %J user macro
5502
.\" NS [reference] Journal Name
5506
.\" NS doc-curr-font
5507
.\" NS doc-curr-size
5508
.\" NS doc-journal-count
5509
.\" NS doc-macro-name
5510
.\" NS doc-reference-count
5512
.\" NS local variables:
5515
.\" NS width register `%J' set in doc-common
5518
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5519
. tm Usage: .%J journal_name ... (#\n[.c])
5523
. nr doc-journal-count +1
5524
. nr doc-reference-count +1
5526
. ds doc-macro-name %J
5527
. doc-parse-args \$@
5530
. nr doc-curr-font \n[.f]
5531
. nr doc-curr-size \n[.ps]
5533
. \" append to reference box
5534
. boxa doc-journal-name
5539
. nop \*[doc-Em-font]\c
5544
.\" NS doc-issue-count global register
5545
.\" NS counter of issue number references
5547
.nr doc-issue-count 0
5550
.\" NS doc-issue-name global box
5551
.\" NS string of collected issue number references
5556
.\" NS %N user macro
5557
.\" NS [reference] issue number
5561
.\" NS doc-curr-font
5562
.\" NS doc-curr-size
5563
.\" NS doc-issue-count
5564
.\" NS doc-macro-name
5565
.\" NS doc-reference-count
5567
.\" NS local variables:
5570
.\" NS width register `%N' set in doc-common
5573
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5574
. tm Usage: .%N issue_number ... (#\n[.c])
5578
. nr doc-issue-count +1
5579
. nr doc-reference-count +1
5581
. ds doc-macro-name %N
5582
. doc-parse-args \$@
5585
. nr doc-curr-font \n[.f]
5586
. nr doc-curr-size \n[.ps]
5588
. \" append to reference box
5589
. boxa doc-issue-name
5598
.\" NS doc-optional-count global register
5599
.\" NS counter of optional information references
5601
.nr doc-optional-count 0
5604
.\" NS doc-optional-string global box
5605
.\" NS string of collected optional information references
5607
.ds doc-optional-string
5610
.\" NS %O user macro
5611
.\" NS [reference] optional information
5615
.\" NS doc-curr-font
5616
.\" NS doc-curr-size
5617
.\" NS doc-macro-name
5618
.\" NS doc-optional-count
5619
.\" NS doc-reference-count
5621
.\" NS local variables:
5624
.\" NS width register `%O' set in doc-common
5627
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5628
. tm Usage: .%O optional_information ... (#\n[.c])
5632
. nr doc-optional-count +1
5633
. nr doc-reference-count +1
5635
. ds doc-macro-name %O
5636
. doc-parse-args \$@
5639
. nr doc-curr-font \n[.f]
5640
. nr doc-curr-size \n[.ps]
5642
. \" append to reference box
5643
. boxa doc-optional-string
5652
.\" NS doc-page-number-count global register
5653
.\" NS counter of page number references
5655
.nr doc-page-number-count 0
5658
.\" NS doc-page-number-string global box
5659
.\" NS string of collected page number references
5661
.ds doc-page-number-string
5664
.\" NS %P user macro
5665
.\" NS [reference] page numbers
5669
.\" NS doc-curr-font
5670
.\" NS doc-curr-size
5671
.\" NS doc-macro-name
5672
.\" NS doc-page-number-count
5673
.\" NS doc-reference-count
5675
.\" NS local variables:
5678
.\" NS width register `%P' set in doc-common
5681
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5682
. tm Usage: .%P page_number ... (#\n[.c])
5686
. nr doc-page-number-count +1
5687
. nr doc-reference-count +1
5689
. ds doc-macro-name %P
5690
. doc-parse-args \$@
5693
. nr doc-curr-font \n[.f]
5694
. nr doc-curr-size \n[.ps]
5696
. \" append to reference box
5697
. boxa doc-page-number-string
5706
.\" NS doc-corporate-count global register
5707
.\" NS counter of corporate references
5709
.nr doc-corporate-count 0
5712
.\" NS doc-corporate-name global box
5713
.\" NS string of collected corporate references
5715
.ds doc-corporate-name
5718
.\" NS %Q user macro
5719
.\" NS corporate or foreign author
5723
.\" NS doc-corporate-count
5724
.\" NS doc-curr-font
5725
.\" NS doc-curr-size
5726
.\" NS doc-macro-name
5727
.\" NS doc-reference-count
5729
.\" NS local variables:
5732
.\" NS width register `%Q' set in doc-common
5735
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5736
. tm Usage: .%Q corporate_or_foreign_author ... (#\n[.c])
5740
. nr doc-corporate-count +1
5741
. nr doc-reference-count +1
5743
. ds doc-macro-name %Q
5744
. doc-parse-args \$@
5747
. nr doc-curr-font \n[.f]
5748
. nr doc-curr-size \n[.ps]
5750
. \" append to reference box
5751
. boxa doc-corporate-name
5760
.\" NS doc-report-count global register
5761
.\" NS counter of report references
5763
.nr doc-report-count 0
5766
.\" NS doc-report-name global box
5767
.\" NS string of collected report references
5772
.\" NS %R user macro
5773
.\" NS [reference] report name
5777
.\" NS doc-curr-font
5778
.\" NS doc-curr-size
5779
.\" NS doc-macro-name
5780
.\" NS doc-reference-count
5781
.\" NS doc-report-count
5783
.\" NS local variables:
5786
.\" NS width register `%R' set in doc-common
5789
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5790
. tm Usage: .%R reference_report ... (#\n[.c])
5794
. nr doc-report-count +1
5795
. nr doc-reference-count +1
5797
. ds doc-macro-name %R
5798
. doc-parse-args \$@
5801
. nr doc-curr-font \n[.f]
5802
. nr doc-curr-size \n[.ps]
5804
. \" append to reference box
5805
. boxa doc-report-name
5814
.\" NS doc-reference-title-count global register
5815
.\" NS counter of reference title references
5817
.nr doc-reference-title-count 0
5820
.\" NS doc-reference-title-name global box
5821
.\" NS string of collected reference title references
5823
.ds doc-reference-title-name
5826
.\" NS doc-reference-title-name-for-book global box
5827
.\" NS string of collected reference title references
5828
.\" NS (saved with another font; this is a shortcoming of groff)
5830
.ds doc-reference-title-name-for-book
5833
.\" NS %T user macro
5834
.\" NS reference title
5838
.\" NS doc-curr-font
5839
.\" NS doc-curr-size
5840
.\" NS doc-macro-name
5841
.\" NS doc-reference-title-count
5842
.\" NS doc-report-count
5844
.\" NS local variables:
5847
.\" NS width register `%T' set in doc-common
5850
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5851
. tm Usage: .%T reference_title ... (#\n[.c])
5855
. if \n[doc-is-reference] \{\
5856
. nr doc-reference-title-count +1
5857
. nr doc-reference-count +1
5860
. ds doc-macro-name %T
5861
. doc-parse-args \$@
5864
. nr doc-curr-font \n[.f]
5865
. nr doc-curr-size \n[.ps]
5866
. ie \n[doc-is-reference] \{\
5867
. \" append to reference box
5868
. boxa doc-reference-title-name-for-book
5873
. nop \*[doc-No-font]\c
5876
. \" do it a second time with another font
5877
. ds doc-macro-name %T
5878
. doc-parse-args \$@
5881
. nr doc-curr-font \n[.f]
5882
. nr doc-curr-size \n[.ps]
5883
. boxa doc-reference-title-name
5888
. nop \*[doc-Em-font]\c
5892
. nop \*[doc-Em-font]\c
5893
. doc-print-recursive
5898
.\" NS doc-volume-count global register
5899
.\" NS counter of reference title references
5901
.nr doc-volume-count 0
5904
.\" NS doc-volume-name global box
5905
.\" NS string of collected volume references
5910
.\" NS %V user macro
5911
.\" NS reference volume
5915
.\" NS doc-curr-font
5916
.\" NS doc-curr-size
5917
.\" NS doc-macro-name
5918
.\" NS doc-reference-title-count
5919
.\" NS doc-volume-count
5921
.\" NS local variables:
5924
.\" NS width register `%V' set in doc-common
5927
. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5928
. tm Usage: .%V volume ... (#\n[.c])
5932
. nr doc-volume-count +1
5933
. nr doc-reference-count +1
5935
. ds doc-macro-name %V
5936
. doc-parse-args \$@
5939
. nr doc-curr-font \n[.f]
5940
. nr doc-curr-size \n[.ps]
5942
. \" append to reference box
5943
. boxa doc-volume-name
5952
.\" NS doc-do-references macro
5953
.\" NS reference recursion routine
5958
.\" NS local variables:
5962
.de doc-do-references
5963
. if !\n[doc-is-reference] \
5964
. tm mdoc error: .\*[doc-macro-name] found outside of .Rs ... .Re (#\n[.c])
5966
. nr doc-reg-ddr1 \n[doc-type\n[doc-arg-ptr]]
5968
. ie (\n[doc-reg-ddr1] == 1) \{\
5969
. \" .nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
5970
. doc-append-arg \c 3
5971
. \*[doc-arg\n[doc-arg-ptr]]
5974
. nop \)\*[doc-arg\n[doc-arg-ptr]]\c
5976
. ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
5977
. \" finish reference box
5985
. nr doc-reg-ddr \n[doc-arg-ptr]
5987
. nop \)\*[doc-space\n[doc-reg-ddr]]\c
5993
.\" NS Hf user macro
5994
.\" NS source include header files.
5997
.\" NS doc-curr-font
5998
.\" NS doc-curr-size
6000
.\" NS width register `Hf' set in doc-common
6003
. ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
6015
. Usage: .Hf file (#\n[.c])
6019
.\" NS doc-have-author global register (bool)
6022
.nr doc-have-author 0
6025
.\" NS An user macro
6030
.\" NS doc-curr-font
6031
.\" NS doc-curr-size
6032
.\" NS doc-have-author
6033
.\" NS doc-macro-name
6035
.\" NS width register `An' set in doc-common
6038
. if !\n[doc-arg-limit] \{\
6040
. ie "\$1"-nosplit" \
6041
. nr doc-in-authors-section 0
6042
. el \{ .ie "\$1"-split" \
6043
. nr doc-in-authors-section 1
6045
. ds doc-macro-name An
6046
. doc-parse-args \$@
6049
. tm1 "Usage: .An {-nosplit | -split}
6050
. tm1 .An author_name ... (#\n[.c])
6053
. if \n[doc-in-authors-section] \{\
6054
. ie \n[doc-have-author] \
6057
. nr doc-have-author 1
6060
. if \n[doc-arg-limit] \{\
6062
. ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
6063
. nr doc-curr-font \n[.f]
6064
. nr doc-curr-size \n[.ps]
6065
. doc-print-recursive
6068
. tm Usage: .An author_name ... (#\n[.c])
6074
.\" NS Rv user macro
6075
.\" NS return values
6077
.\" NS width register `Rv' set in doc-common
6079
.\" NS local variables:
6080
.\" NS doc-str-Rv-prefix
6081
.\" NS doc-str-Rv-suffix
6083
.ds doc-str-Rv-prefix "The
6084
.ds doc-str-Rv-suffix "function returns the value\~0 if successful;
6085
.as doc-str-Rv-suffix " otherwise the value\~-1 is returned and
6086
.as doc-str-Rv-suffix " the global variable \*[doc-Va-font]errno\f[P]
6087
.as doc-str-Rv-suffix " is set to indicate the error.
6091
.\" XXX: what does this function without `-std'?
6093
. if \n[doc-arg-limit] \{\
6094
. tm Usage: .Rv not callable by other macros (#\n[.c])
6100
. tm Usage: .Rv [-std] <function> (#\n[.c])
6105
. nr doc-reg-Rv \*[doc-section]
6106
. if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
6107
. tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
6109
. nop \)\*[doc-str-Rv-prefix]
6111
. nop \)\*[doc-str-Rv-suffix]
6116
.\" NS Mt user macro
6117
.\" NS mailto (for conversion to HTML)
6120
. \" XXX: error handling missing
6125
.\" NS Lk user macro
6126
.\" NS link (for conversion to HTML)
6128
.\" NS local variables:
6133
. ds doc-str-Lk Sy \$@
6135
. ie (\n[.$] > 1) \{\
6136
. doc-get-arg-type \$2
6137
. ie (\n[doc-arg-type] < 3) \{\
6139
. ds doc-str-Lk Sy "\$1"
6140
. doc-get-width "\$1"
6143
. as doc-str-Lk " \$@
6146
. doc-get-width "\$1"
6149
. doc-get-width "\$1"
6155
. ie (\n[doc-width] >= \n[doc-reg-Lk]) \
6162
.\" NS doc-defunct-macro macro
6163
.\" NS this is the skeleton for defunct macros
6166
.de doc-defunct-macro
6167
. tmc mdoc error: .\$0 defunct
6168
. if d doc-\$0-usage \
6169
. tmc , \*[doc-\$0-usage]
6176
.als Db doc-defunct-macro
6178
.als Ds doc-defunct-macro
6180
.als Ex doc-defunct-macro
6181
.ds doc-Ex-usage use .D1
6183
.als Or doc-defunct-macro
6184
.ds doc-Or-usage use `|'
6186
.als Sf doc-defunct-macro
6187
.ds doc-Sf-usage use .Pf or .Ns
6193
. tm1 "mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
6194
. tm1 " Should this have been `.Em ...'?
6199
.\" NS doc-empty-line macro
6200
.\" NS emit warning and print empty line
6203
. if !\n[doc-display-depth] \
6204
. tm mdoc warning: Empty input line #\n[.c]
6214
.\" load local modifications