list-type-stack\n[reg-dsgv]]
.nr list-have-indent-stack\n[reg-dsgv]-saved \n[list-have-indent-stack\n[reg-dsgv]]
.nr list-indent-stack\n[reg-dsgv]-saved \n[list-indent-stack\n[reg-dsgv]]
.nr compact-list-stack\n[reg-dsgv]-saved \n[compact-list-stack\n[reg-dsgv]]
.ds tag-prefix-stack\n[reg-dsgv]-saved "\*[tag-prefix-stack\n[reg-dsgv]]
.ds tag-width-stack\n[reg-dsgv]-saved "\*[tag-width-stack\n[reg-dsgv]]
.nr list-offset-stack\n[reg-dsgv]-saved \n[list-offset-stack\n[reg-dsgv]]
.nr enum-list-count-stack\n[reg-dsgv]-saved \n[enum-list-count-stack\n[reg-dsgv]]
.nr reg-dsgv +1
.\}
.ds saved-Pa-font-saved "\*[saved-Pa-font]
.nr curr-type-saved \n[curr-type]
.ds curr-arg-saved "\*[curr-arg]
.nr diag-list-input-line-count-saved \n[diag-list-input-line-count]
.nr num-columns-saved \n[num-columns]
.nr column-indent-width-saved \n[column-indent-width]
.nr is-func-saved \n[is-func]
.nr have-old-func-saved \n[have-old-func]
.nr func-arg-count-saved \n[func-arg-count]
.ds func-arg-saved "\*[func-arg]
.nr num-func-args-saved \n[num-func-args]
.nr func-args-processed-saved \n[func-args-processed]
.nr have-func-saved \n[have-func]
.nr is-reference-saved \n[is-reference]
.nr reference-count-saved \n[reference-count]
.nr author-count-saved \n[author-count]
.nr reg-dsgv 0
.while (\n[reg-dsgv] <= \n[author-count]) \{\
.ds author-name\n[reg-dsgv]-saved "\*[author-name\n[reg-dsgv]]
.nr reg-dsgv +1
.\}
.nr book-count-saved \n[book-count]
.ds book-name-saved "\*[book-name]
.nr city-count-saved \n[city-count]
.ds city-name-saved "\*[city-name]
.nr date-count-saved \n[date-count]
.ds date-saved "\*[date]
.nr publisher-count-saved \n[publisher-count]
.ds publisher-name-saved "\*[publisher-name]
.nr journal-count-saved \n[journal-count]
.ds journal-name-saved "\*[journal-name]
.nr issue-count-saved \n[issue-count]
.ds issue-name-saved "\*[issue-name]
.nr optional-count-saved \n[optional-count]
.ds optional-string-saved "\*[optional-string]
.nr page-number-count-saved \n[page-number-count]
.ds page-number-string-saved "\*[page-number-string]
.nr corporate-count-saved \n[corporate-count]
.ds corporate-name-saved "\*[corporate-name]
.nr report-count-saved \n[report-count]
.ds report-name-saved "\*[report-name]
.nr reference-title-count-saved \n[reference-title-count]
.ds reference-title-name-saved "\*[reference-title-name]
.ds reference-title-name-for-book-saved "\*[reference-title-name-for-book]
.nr url-count-saved \n[url-count]
.ds url-name-saved "\*[url-name]
.nr volume-count-saved \n[volume-count]
.ds volume-name-saved "\*[volume-name]
.nr have-author-saved \n[have-author]
.ds document-title-saved "\*[document-title]
.ds volume-saved "\*[volume]
.ds section-saved "\*[section]
.ds operating-system-saved "\*[operating-system]
.ds date-string-saved "\*[date-string]
.nr header-space-saved \n[header-space]
.nr footer-space-saved \n[footer-space]
.nr display-vertical-saved \n[display-vertical]
.ds header-string-saved "\*[header-string]
.nr in-see-also-section-saved \n[in-see-also-section]
.nr in-files-section-saved \n[in-files-section]
.nr in-authors-section-saved \n[in-authors-section]
..
.de restore-global-vars
.ds macro-name "\*[macro-name-saved]
.nr arg-limit \n[arg-limit-saved]
.nr num-args \n[num-args-saved]
.nr arg-ptr \n[arg-ptr-saved]
.nr reg-drgv 1
.while (\n[reg-drgv] <= \n[arg-limit]) \{\
.ds arg\n[reg-drgv] "\*[arg\n[reg-drgv]-saved]
.nr type\n[reg-drgv] \n[type\n[reg-drgv]-saved]
.ds space\n[reg-drgv] "\*[space\n[reg-drgv]-saved]
.nr reg-drgv +1
.\}
.nr curr-font \n[curr-font-saved]
.nr curr-size \n[curr-size-saved]
.nr in-synopsis-section \n[in-synopsis-section-saved]
.nr in-library-section \n[in-library-section-saved]
.nr indent-synopsis \n[indent-synopsis-saved]
.nr indent-synopsis-active \n[indent-synopsis-active-saved]
.nr have-decl \n[have-decl-saved]
.nr have-var \n[have-var-saved]
.ds command-name "\*[command-name-saved]
.ds quote-left "\*[quote-left-saved]
.ds quote-right "\*[quote-right-saved]
.nr nesting-level \n[nesting-level-saved]
.nr in-list \n[in-list-saved]
.ds space "\*[space-saved]
.ds saved-space "\*[saved-space-saved]
.nr space-mode \n[space-mode-saved]
.nr have-space \n[have-space-saved]
.nr have-slot \n[have-slot-saved]
.nr keep-type \n[keep-type-saved]
.nr display-depth \n[display-depth-saved]
.nr is-compact \n[is-compact-saved]
.nr reg-drgv 0
.while (\n[reg-drgv] <= \n[display-depth]) \{\
.ds display-type-stack\n[reg-drgv] "\*[display-type-stack\n[reg-drgv]-saved]
.nr display-indent-stack\n[reg-drgv] \n[display-indent-stack\n[reg-drgv]-saved]
.nr display-ad-stack\n[reg-drgv] \n[display-ad-stack\n[reg-drgv]-saved]
.nr display-fi-stack\n[reg-drgv] \n[display-fi-stack\n[reg-drgv]-saved]
.nr display-ft-stack\n[reg-drgv] \n[display-ft-stack\n[reg-drgv]-saved]
.nr display-ps-stack\n[reg-drgv] \n[display-ps-stack\n[reg-drgv]-saved]
.nr reg-drgv +1
.\}
.nr fontmode-depth \n[fontmode-depth-saved]
.nr reg-drgv 1
.while (\n[reg-drgv] <= \n[fontmode-depth]) \{\
.nr fontmode-font-stack\n[reg-drgv] \n[fontmode-font-stack\n[reg-drgv]]-saved
.nr fontmode-size-stack\n[reg-drgv] \n[fontmode-size-stack\n[reg-drgv]]-saved
.nr reg-drgv +1
.\}
.nr list-depth \n[list-depth-saved]
.nr reg-drgv 1
.while (\n[reg-drgv] <= \n[list-depth]) \{\
.ds list-type-stack\n[reg-drgv] "\*[list-type-stack\n[reg-drgv]-saved]
.nr list-have-indent-stack\n[reg-drgv] \n[list-have-indent-stack\n[reg-drgv]-saved]
.nr list-indent-stack\n[reg-drgv] \n[list-indent-stack\n[reg-drgv]-saved]
.nr compact-list-stack\n[reg-drgv] \n[compact-list-stack\n[reg-drgv]-saved]
.ds tag-prefix-stack\n[reg-drgv] "\*[tag-prefix-stack\n[reg-drgv]-saved]
.ds tag-width-stack\n[reg-drgv] "\*[tag-width-stack\n[reg-drgv]-saved]
.nr list-offset-stack\n[reg-drgv] \n[list-offset-stack\n[reg-drgv]-saved]
.nr enum-list-count-stack\n[reg-drgv] \n[enum-list-count-stack\n[reg-drgv]-saved]
.nr reg-drgv +1
.\}
.ds saved-Pa-font "\*[saved-Pa-font-saved]
.nr curr-type \n[curr-type-saved]
.ds curr-arg "\*[curr-arg-saved]
.nr diag-list-input-line-count \n[diag-list-input-line-count-saved]
.nr num-columns \n[num-columns-saved]
.nr column-indent-width \n[column-indent-width-saved]
.nr is-func \n[is-func-saved]
.nr have-old-func \n[have-old-func-saved]
.nr func-arg-count \n[func-arg-count-saved]
.ds func-arg "\*[func-arg-saved]
.nr num-func-args \n[num-func-args-saved]
.nr func-args-processed \n[func-args-processed-saved]
.nr have-func \n[have-func-saved]
.nr is-reference \n[is-reference-saved]
.nr reference-count \n[reference-count-saved]
.nr author-count \n[author-count-saved]
.nr reg-drgv 0
.while (\n[reg-drgv] <= \n[author-count]) \{\
.ds author-name\n[reg-drgv] "\*[author-name\n[reg-drgv]-saved]
.nr reg-drgv +1
.\}
.nr book-count \n[book-count-saved]
.ds book-name "\*[book-name-saved]
.nr city-count \n[city-count-saved]
.ds city-name "\*[city-name-saved]
.nr date-count \n[date-count-saved]
.ds date "\*[date-saved]
.nr publisher-count \n[publisher-count-saved]
.ds publisher-name "\*[publisher-name-saved]
.nr journal-count \n[journal-count-saved]
.ds journal-name "\*[journal-name-saved]
.nr issue-count \n[issue-count-saved]
.ds issue-name "\*[issue-name-saved]
.nr optional-count \n[optional-count-saved]
.ds optional-string "\*[optional-string-saved]
.nr page-number-count \n[page-number-count-saved]
.ds page-number-string "\*[page-number-string-saved]
.nr corporate-count \n[corporate-count-saved]
.ds corporate-name "\*[corporate-name-saved]
.nr report-count \n[report-count-saved]
.ds report-name "\*[report-name-saved]
.nr reference-title-count \n[reference-title-count-saved]
.ds reference-title-name "\*[reference-title-name-saved]
.ds reference-title-name-for-book "\*[reference-title-name-for-book-saved]
.nr url-count \n[url-count-saved]
.ds url-name "\*[url-name-saved]
.nr volume-count \n[volume-count-saved]
.ds volume-name "\*[volume-name-saved]
.nr have-author \n[have-author-saved]
.ds document-title "\*[document-title-saved]
.ds volume "\*[volume-saved]
.ds section "\*[section-saved]
.ds operating-system "\*[operating-system-saved]
.ds date-string "\*[date-string-saved]
.nr header-space \n[header-space-saved]
.nr footer-space \n[footer-space-saved]
.nr display-vertical \n[display-vertical-saved]
.ds header-string "\*[header-string-saved]
.nr in-see-also-section \n[in-see-also-section-saved]
.nr in-files-section \n[in-files-section-saved]
.nr in-authors-section \n[in-authors-section-saved]
..
.de El
.if \n[.$] \{\
.tm Usage: .El (does not take arguments) (#\n[.c])
.return
.\}
.ds macro-name El
.ds str-El \*[list-type-stack\n[list-depth]]
.ie        "\*[str-El]"diag-list" \
.end-list 0
.el \{ .ie "\*[str-El]"column-list" \
.end-column-list
.el \{ .ie "\*[str-El]"item-list" \
.end-list 0
.el \{ .ie "\*[str-El]"ohang-list" \
.end-list 0
.el \{ .ie "\*[str-El]"inset-list" \
.end-list 0
.el \
.end-list 1
.\}\}\}\}
.br
..
.ds saved-Pa-font
.nr curr-type 0
.ds curr-arg
.nr bullet-list-type 1
.nr column-list-type 0
.nr dash-list-type 1
.nr diag-list-type 0
.nr enum-list-type 1
.nr hang-list-type 2
.nr inset-list-type 2
.nr item-list-type 1
.nr ohang-list-type 2
.nr tag-list-type 2
.de It
.ds str-It \*[list-type-stack\n[list-depth]]
.if "\*[str-It]"" \
.tm mdoc error: .It without preceding .Bl (#\n[.c])
.if \n[nesting-level] \{\
.tmc "mdoc error: .It found in enclosing (e.g. .Ac ... .It ... .Ao)
.tm1 " (#\n[.c])
.\}
.br
.if !\n[cR] \
.ne 3v
.if \n[.$] \{\
.ds macro-name It
.nr reg-It 1
.while (\n[reg-It] <= \n[.$]) \{\
.ds arg\n[reg-It] "\$[\n[reg-It]]
.nr reg-It +1
.\}
.nr num-args \n[.$]
.nr arg-ptr 0
.\}
.nr reg-It \n[\*[str-It]-type]
.if \n[reg-It] \{\
.box item-box\n[list-depth]
.ev item-env\n[list-depth]
.evc 0
.in 0
.nf
.\}
.ie (\n[reg-It] == 1) \{\
.if \n[.$] \{\
.tm1 "mdoc warning: .It macros in lists of type `\*[str-It]'
.tm1 "              don't take arguments (#\n[.c])
.\}\}
.el \{\
.ie \n[.$] \{\
.if (\n[reg-It] == 2) \{\
.parse-arg-vector
.nr in-list 1
.nr arg-ptr 1
.nr curr-type \n[type1]
.ds curr-arg "\*[arg1]
.if \n[in-files-section] \{\
.ds saved-Pa-font "\*[Pa-font]
.if n \
.ds Pa-font "\*[No-font]
.\}
.ie (\n[type1] == 1) \
.\*[arg1]
.el \{\
.nr arg-ptr 1
.print-recursive
.\}\}\}
.el \{\
.tm1 "mdoc warning: .It macros in lists of type `\*[str-It]'
.tm1 "              require arguments (#\n[.c])
.\}
.\}
.if !\n[nesting-level] \
.\*[str-It]
..
.de inset-list
.br
.ev
.box
.unformat item-box\n[list-depth]
.set-vertical-and-indent 0
.br
.nh
.item-box\n[list-depth]
.if \n[in-files-section] \
.if n \
.ds Pa-font "\*[saved-Pa-font]
.nr in-list 0
.reset-args
..
.de hang-list
.br
.ev
.box
.unformat item-box\n[list-depth]
.set-vertical-and-indent 1
.nr reg-dhl (\n[list-indent-stack\n[list-depth]]u + \n[digit-width]u)
.ti -\n[reg-dhl]u
.nh
.ie (\n[dl]u > \n[list-indent-stack\n[list-depth]]u) \
.item-box\n[list-depth]
.el \{\
.chop item-box\n[list-depth]
.nr reg-dhl1 \n[.k]u
.nop \*[item-box\n[list-depth]]\c
.nop \h'|(\n[reg-dhl1]u - \n[.k]u + \n[reg-dhl]u)'\c
.nr have-space 1
.\}
.if \n[in-files-section] \
.if n \
.ds Pa-font "\*[saved-Pa-font]
.nr in-list 0
.reset-args
..
.de ohang-list
.br
.ev
.box
.unformat item-box\n[list-depth]
.set-vertical-and-indent 0
.nh
.item-box\n[list-depth]
.br
.if \n[in-files-section] \
.if n \
.ds Pa-font "\*[saved-Pa-font]
.nr in-list 0
.reset-args
..
.de item-list
.br
.ev
.box
.set-vertical-and-indent 0
.br
.reset-args
..
.nr enum-list-count-stack1 0
.de enum-list
.nr in-list 1
.nr enum-list-count-stack\n[list-depth] +1
.nop \*[tag-prefix-stack\n[list-depth]]\c
.nop \n[enum-list-count-stack\n[list-depth]].\&
.do-list
..
.de bullet-list
.nr in-list 1
.nop \)\*[Sy-font]\[bu]\f[]
.do-list
..
.de dash-list
.nr in-list 1
.nop \)\*[Sy-font]\-\f[]
.do-list
..
.als do-list hang-list
.nr diag-list-input-line-count 0
.de diag-list
.nr curr-font \n[.f]
.nr curr-size \n[.ps]
.ie ((\n[.c] - \n[diag-list-input-line-count]) > 1) \{\
.ie !\n[compact-list-stack\n[list-depth]] \
.paragraph
.el \
.br
.\}
.el \
.br
.nr diag-list-input-line-count \n[.c]
.nh
.nop \*[Sy-font]\c
.if \n[num-args] \
.remaining-args
.nop \f[\n[curr-font]]\s[\n[curr-size]u]\*[hard-space]\c
.print-and-reset
..
.de tag-list
.br
.ev
.box
.unformat item-box\n[list-depth]
.box box-dtl
.ev env-dtl
.evc 0
.fi
.ad 0
.in 0
.item-box\n[list-depth]
.br
.ev
.box
.if !"TagwidtH"\*[tag-width-stack\n[list-depth]]" \{\
.if !\n[list-have-indent-stack\n[list-depth]] \{\
.in -(\n[list-indent-stack\n[list-depth]]u + \n[digit-width]u)
.nr list-have-indent-stack\n[list-depth] 1
.\}
.get-tag-width
.\}
.set-vertical-and-indent 1
.nr reg-dtl (\n[list-indent-stack\n[list-depth]]u + \n[digit-width]u)
.ti -\n[reg-dtl]u
.nh
.item-box\n[list-depth]
.ie (\n[dl]u > \n[list-indent-stack\n[list-depth]]u) \
.br
.el \{\
.vpt 0
.br
.sp -1
.vpt 1
.nop \&\c
.nr have-space 1
.\}
.if \n[in-files-section] \
.if n \
.ds Pa-font "\*[saved-Pa-font]
.nr in-list 0
.reset-args
..
.de get-tag-width
.ie (\n[curr-type] == 1) \{\
.ds tag-width-stack\n[list-depth] \*[curr-arg]
.nr list-indent-stack\n[list-depth] \n[\*[curr-arg]]
.\}
.el \{\
.ds tag-width-stack\n[list-depth] No
.nr list-indent-stack\n[list-depth] \n[No]
.\}
..
.de set-vertical-and-indent
.if !\n[compact-list-stack\n[list-depth]] \
.sp \n[display-vertical]u
.if \n[list-have-indent-stack\n[list-depth]] \{\
.nr list-have-indent-stack\n[list-depth] 0
.if \$1 \
.in +(\n[list-indent-stack\n[list-depth]]u + \n[digit-width]u)
.\}
.if !\n[cR] \
.ne 2v
..
.nr list-depth 0
.nr num-columns 0
.nr compact-list-stack1 0
.ds tag-prefix-stack1
.ds tag-width-stack0
.ds tag-width-stack1
.nr list-offset-stack1 0
.de end-list
.if \$1 \
'    in -(\n[list-indent-stack\n[list-depth]]u + \n[digit-width]u)
'  in -\n[list-offset-stack\n[list-depth]]u
.if (\n[list-depth] <= 0) \
.tm mdoc warning: extraneous .El call (#\n[.c])
.decrement-list-stack
.nr list-depth -1
..
.de increment-list-stack
.nr reg-dils (\n[list-depth] + 1)
.nr list-have-indent-stack\n[reg-dils] 0
.nr list-indent-stack\n[reg-dils] 0
.nr list-offset-stack\n[reg-dils] 0
.ds tag-prefix-stack\n[reg-dils]
.ds tag-width-stack\n[reg-dils] \*[tag-width-stack\n[list-depth]]
.ds list-type-stack\n[reg-dils]
.nr compact-list-stack\n[reg-dils] 0
.nr enum-list-count-stack\n[reg-dils] 0
..
.de decrement-list-stack
.ds list-type-stack\n[list-depth]
.nr list-have-indent-stack\n[list-depth] 0
.nr list-indent-stack\n[list-depth] 0
.nr list-offset-stack\n[list-depth] 0
.ds tag-prefix-stack\n[list-depth]
.ds tag-width-stack\n[list-depth]
.nr compact-list-stack\n[list-depth] 0
.nr enum-list-count-stack\n[list-depth] 0
..
.de Xr
.if !\n[arg-limit] \{\
.ie \n[.$] \{\
.ds macro-name Xr
.parse-args \$@
.\}
.el \
.Xr-usage
.\}
.if !\n[arg-limit] \
.return
.nr arg-ptr +1
.print-prefixes
.ie (\n[arg-limit] >= \n[arg-ptr]) \{\
.ie (\n[type\n[arg-ptr]] == 2) \{\
.nr curr-font \n[.f]
.nr curr-size \n[.ps]
.ds arg\n[arg-ptr] \*[Xr-font]\*[arg\n[arg-ptr]]\f[]\s[0]
.if (\n[arg-limit] > \n[arg-ptr]) \{\
.nr reg-Xr (\n[arg-ptr] + 1)
.if (\n[type\n[reg-Xr]] == 2) \{\
.ds arg\n[reg-Xr] \*[lp]\*[arg\n[reg-Xr]]\*[rp]
.ds space\n[arg-ptr]
.\}
.\}
.print-recursive
.\}
.el \
.Xr-usage
.\}
.el \
.Xr-usage
..
.de Xr-usage
.tm Usage: .Xr manpage_name [section#] ... (#\n[.c])
.reset-args
..
.als Sx generic-macro
.ds Sx-usage section_header
.de end-column-list
.linetabs 0
'  in -(\n[list-offset-stack\n[list-depth]]u + \n[list-indent-stack\n[list-depth]]u)
.ta T .5i
.fi
.decrement-list-stack
.nr list-depth -1
..
.nr column-indent-width 0
.de set-column-tab
.ds str-dsct
.nr reg-dsct 1
.nr column-indent-width 0
.ie (\$1 < 5) \
.ds str-dsct1 "    
.el \{\
.ie (\$1 == 5) \
.ds str-dsct1 "   
.el \{\
.ds str-dsct1 " 
.\}\}
.while (\n[reg-dsct] <= \$1) \{\
.as str-dsct " +\w