mandoc-1.14.6004075500017530001753000000000001412314055300132735ustar00schwarzeschwarzemandoc-1.14.6/regress004075500017530001753000000000001412314056600147515ustar00schwarzeschwarzemandoc-1.14.6/regress/regress.pl010075500017530001753000000326661412165273200170550ustar00schwarzeschwarze#!/usr/bin/env perl # # $Id: regress.pl,v 1.16 2021/09/19 12:15:34 schwarze Exp $ # # Copyright (c) 2017,2018,2019,2020,2021 Ingo Schwarze # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. use warnings; use strict; # Used because open(3p) and open2(3p) provide no way for handling # STDERR of the child process, neither for appending it to STDOUT, # nor for piping it into the Perl program. use IPC::Open3 qw(open3); # Define this at one place such that it can easily be changed # if diff(1) does not support the -a option. my @diff = qw(diff -au); system @diff, '/dev/null', '/dev/null' and @diff = qw(diff -u); # --- utility functions ------------------------------------------------ sub usage ($) { warn shift; print STDERR "usage: $0 [directory[:test] [modifier ...]]\n"; exit 1; } # Modifier arguments provided on the command line, # inspected by the main program and by the utility functions. my %targets; # Run a command and send STDOUT and STDERR to a file. # 1st argument: path to the output file # 2nd argument: command name # The remaining arguments are passed to the command. sub sysout ($@) { my $outfile = shift; print "@_\n" if $targets{verbose}; local *OUT_FH; open OUT_FH, '>', $outfile or die "$outfile: $!"; my $pid = open3 undef, ">&OUT_FH", undef, @_; close OUT_FH; waitpid $pid, 0; return $? >> 8; } # Simlar, but filter the output as needed for the lint test. sub syslint ($@) { my $outfile = shift; print "@_\n" if $targets{verbose}; open my $outfd, '>', $outfile or die "$outfile: $!"; my $infd; my $pid = open3 undef, $infd, undef, @_; while (<$infd>) { s/^mandoc: [^:]+\//mandoc: /; print $outfd $_; } close $outfd; close $infd; waitpid $pid, 0; return 0; } # Simlar, but filter the output as needed for the html test. sub syshtml ($@) { my $outfile = shift; print "@_\n" if $targets{verbose}; open my $outfd, '>', $outfile or die "$outfile: $!"; my $infd; my $pid = open3 undef, $infd, undef, @_; my $state = 0; while (<$infd>) { chomp; if (!$state && s/.*//) { $state = 'math'; next unless length; } elsif (/BEGINTEST/) { $state = 'other'; next; } elsif (/ENDTEST/) { $state = 0; next; } if ($state eq 'math') { s/^ *//; if (s/<\/math>.*//) { print $outfd "$_\n" if length; $state = 0; next; } } print $outfd "$_\n" if $state; } close $outfd; close $infd; waitpid $pid, 0; return 0; } my @failures; sub fail ($$) { warn "FAILED: @_\n"; push @failures, [@_]; } # --- process command line arguments ----------------------------------- my $onlytest = shift // ''; for (@ARGV) { /^(all|ascii|tag|man|utf8|html|markdown|lint|clean|verbose)$/ or usage "$_: invalid modifier"; $targets{$_} = 1; } $targets{all} = 1 unless $targets{ascii} || $targets{tag} || $targets{man} || $targets{utf8} || $targets{html} || $targets{markdown} || $targets{lint} || $targets{clean}; $targets{ascii} = $targets{tag} = $targets{man} = $targets{utf8} = $targets{html} = $targets{markdown} = $targets{lint} = 1 if $targets{all}; # --- parse Makefiles -------------------------------------------------- sub parse_makefile ($%) { my ($filename, $vars) = @_; open my $fh, '<', $filename or die "$filename: $!"; while (<$fh>) { chomp; next unless /\S/; last if /^# OpenBSD only/; next if /^#/; next if /^\.include/; /^(\w+)\s*([?+]?)=\s*(.*)/ or die "$filename: parse error: $_"; my $var = $1; my $opt = $2; my $val = $3; $val =~ s/\$\{(\w+)\}/$vars->{$1}/; $val = "$vars->{$var} $val" if $opt eq '+'; $vars->{$var} = $val unless $opt eq '?' && defined $vars->{$var}; } close $fh; } my (@regress_tests, @utf8_tests, @lint_tests, @html_tests); my (%tag_tests, %skip_ascii, %skip_man, %skip_markdown); foreach my $module (qw(roff char mdoc man tbl eqn)) { my %modvars; parse_makefile "$module/Makefile", \%modvars; foreach my $subdir (split ' ', $modvars{SUBDIR}) { my %subvars = (MOPTS => ''); parse_makefile "$module/$subdir/Makefile", \%subvars; parse_makefile "$module/Makefile.inc", \%subvars; delete $subvars{GOPTS}; delete $subvars{SKIP_GROFF}; delete $subvars{SKIP_GROFF_ASCII}; my @mopts = split ' ', $subvars{MOPTS}; delete $subvars{MOPTS}; my @regress_testnames; if (defined $subvars{TAG_TARGETS}) { $tag_tests{"$module/$subdir/$_"} = 1 for split ' ', $subvars{TAG_TARGETS}; delete $subvars{TAG_TARGETS}; } if (defined $subvars{REGRESS_TARGETS}) { push @regress_testnames, split ' ', $subvars{REGRESS_TARGETS}; push @regress_tests, { NAME => "$module/$subdir/$_", MOPTS => \@mopts, } foreach @regress_testnames; delete $subvars{REGRESS_TARGETS}; } if (defined $subvars{UTF8_TARGETS}) { push @utf8_tests, { NAME => "$module/$subdir/$_", MOPTS => \@mopts, } foreach split ' ', $subvars{UTF8_TARGETS}; delete $subvars{UTF8_TARGETS}; } if (defined $subvars{HTML_TARGETS}) { push @html_tests, { NAME => "$module/$subdir/$_", MOPTS => \@mopts, } foreach split ' ', $subvars{HTML_TARGETS}; delete $subvars{HTML_TARGETS}; } if (defined $subvars{LINT_TARGETS}) { push @lint_tests, { NAME => "$module/$subdir/$_", MOPTS => \@mopts, } foreach split ' ', $subvars{LINT_TARGETS}; delete $subvars{LINT_TARGETS}; } if (defined $subvars{SKIP_ASCII}) { for (split ' ', $subvars{SKIP_ASCII}) { $skip_ascii{"$module/$subdir/$_"} = 1; $skip_man{"$module/$subdir/$_"} = 1; } delete $subvars{SKIP_ASCII}; } if (defined $subvars{SKIP_TMAN}) { $skip_man{"$module/$subdir/$_"} = 1 for split ' ', $subvars{SKIP_TMAN}; delete $subvars{SKIP_TMAN}; } if (defined $subvars{SKIP_MARKDOWN}) { $skip_markdown{"$module/$subdir/$_"} = 1 for split ' ', $subvars{SKIP_MARKDOWN}; delete $subvars{SKIP_MARKDOWN}; } if (keys %subvars) { my @vars = keys %subvars; die "unknown var(s) @vars in dir $module/$subdir"; } map { $skip_ascii{"$module/$subdir/$_"} = 1; } @regress_testnames if $skip_ascii{"$module/$subdir/ALL"}; map { $skip_man{"$module/$subdir/$_"} = 1; } @regress_testnames if $skip_man{"$module/$subdir/ALL"}; map { $skip_markdown{"$module/$subdir/$_"} = 1; } @regress_testnames if $skip_markdown{"$module/$subdir/ALL"}; } delete $modvars{SUBDIR}; if (keys %modvars) { my @vars = keys %modvars; die "unknown var(s) @vars in module $module"; } } # --- run targets ------------------------------------------------------ my $count_total = 0; my $count_ascii = 0; my $count_tag = 0; my $count_man = 0; my $count_rm = 0; if ($targets{ascii} || $targets{tag} || $targets{man}) { print "Running ascii, tag, and man tests "; print "...\n" if $targets{verbose}; } for my $test (@regress_tests) { my $i = "$test->{NAME}.in"; my $o = "$test->{NAME}.mandoc_ascii"; my $w = "$test->{NAME}.out_ascii"; my $to = "$test->{NAME}.mandoc_tag"; my $tos = "$test->{NAME}.mandoc_tag_s"; my $tw = "$test->{NAME}.out_tag"; my $diff_ascii; if ($targets{tag} && $tag_tests{$test->{NAME}} && $test->{NAME} =~ /^$onlytest/) { $count_tag++; $count_total++; my @cmd = (qw(../man -l), @{$test->{MOPTS}}, qw(-I os=OpenBSD -T ascii -O), "outfilename=$o,tagfilename=$to", "$i"); print "@cmd\n" if $targets{verbose}; system @cmd and fail $test->{NAME}, 'tag:man'; system "sed 's: .*/: :' $to > $tos"; system @diff, $tw, $tos and fail $test->{NAME}, 'tag:diff'; print "." unless $targets{verbose}; $diff_ascii = $targets{ascii}; } elsif ($targets{ascii} && !$skip_ascii{$test->{NAME}} && $test->{NAME} =~ /^$onlytest/) { sysout $o, '../mandoc', @{$test->{MOPTS}}, qw(-I os=OpenBSD -T ascii), $i and fail $test->{NAME}, 'ascii:mandoc'; $diff_ascii = 1; } if ($diff_ascii) { $count_ascii++; $count_total++; system @diff, $w, $o and fail $test->{NAME}, 'ascii:diff'; print "." unless $targets{verbose}; } my $m = "$test->{NAME}.in_man"; my $mo = "$test->{NAME}.mandoc_man"; if ($targets{man} && !$skip_man{$test->{NAME}} && $test->{NAME} =~ /^$onlytest/) { $count_man++; $count_total++; sysout $m, '../mandoc', @{$test->{MOPTS}}, qw(-I os=OpenBSD -T man), $i and fail $test->{NAME}, 'man:man'; sysout $mo, '../mandoc', @{$test->{MOPTS}}, qw(-man -I os=OpenBSD -T ascii -O mdoc), $m and fail $test->{NAME}, 'man:mandoc'; system @diff, $w, $mo and fail $test->{NAME}, 'man:diff'; print "." unless $targets{verbose}; } if ($targets{clean}) { print "rm $o $to $tos $m $mo\n" if $targets{verbose}; $count_rm += unlink $o, $to, $tos, $m, $mo; } } if ($targets{ascii} || $targets{tag} || $targets{man}) { print "Number of ascii, tag, and man tests:" if $targets{verbose}; print " $count_ascii + $count_tag + $count_man tests run.\n"; } my $count_utf8 = 0; if ($targets{utf8}) { print "Running utf8 tests "; print "...\n" if $targets{verbose}; } for my $test (@utf8_tests) { my $i = "$test->{NAME}.in"; my $o = "$test->{NAME}.mandoc_utf8"; my $w = "$test->{NAME}.out_utf8"; if ($targets{utf8} && $test->{NAME} =~ /^$onlytest/o) { $count_utf8++; $count_total++; sysout $o, '../mandoc', @{$test->{MOPTS}}, qw(-I os=OpenBSD -T utf8), $i and fail $test->{NAME}, 'utf8:mandoc'; system @diff, $w, $o and fail $test->{NAME}, 'utf8:diff'; print "." unless $targets{verbose}; } if ($targets{clean}) { print "rm $o\n" if $targets{verbose}; $count_rm += unlink $o; } } if ($targets{utf8}) { print "Number of utf8 tests:" if $targets{verbose}; print " $count_utf8 tests run.\n"; } my $count_html = 0; if ($targets{html}) { print "Running html tests "; print "...\n" if $targets{verbose}; } for my $test (@html_tests) { my $i = "$test->{NAME}.in"; my $o = "$test->{NAME}.mandoc_html"; my $w = "$test->{NAME}.out_html"; if ($targets{html} && $test->{NAME} =~ /^$onlytest/) { $count_html++; $count_total++; syshtml $o, '../mandoc', @{$test->{MOPTS}}, qw(-T html), $i and fail $test->{NAME}, 'html:mandoc'; system @diff, $w, $o and fail $test->{NAME}, 'html:diff'; print "." unless $targets{verbose}; } if ($targets{clean}) { print "rm $o\n" if $targets{verbose}; $count_rm += unlink $o; } } if ($targets{html}) { print "Number of html tests:" if $targets{verbose}; print " $count_html tests run.\n"; } my $count_markdown = 0; if ($targets{markdown}) { print "Running markdown tests "; print "...\n" if $targets{verbose}; } for my $test (@regress_tests) { my $i = "$test->{NAME}.in"; my $o = "$test->{NAME}.mandoc_markdown"; my $w = "$test->{NAME}.out_markdown"; if ($targets{markdown} && !$skip_markdown{$test->{NAME}} && $test->{NAME} =~ /^$onlytest/) { $count_markdown++; $count_total++; sysout $o, '../mandoc', @{$test->{MOPTS}}, qw(-I os=OpenBSD -T markdown), $i and fail $test->{NAME}, 'markdown:mandoc'; system @diff, $w, $o and fail $test->{NAME}, 'markdown:diff'; print "." unless $targets{verbose}; } if ($targets{clean}) { print "rm $o\n" if $targets{verbose}; $count_rm += unlink $o; } } if ($targets{markdown}) { print "Number of markdown tests:" if $targets{verbose}; print " $count_markdown tests run.\n"; } my $count_lint = 0; if ($targets{lint}) { print "Running lint tests "; print "...\n" if $targets{verbose}; } for my $test (@lint_tests) { my $i = "$test->{NAME}.in"; my $o = "$test->{NAME}.mandoc_lint"; my $w = "$test->{NAME}.out_lint"; if ($targets{lint} && $test->{NAME} =~ /^$onlytest/) { $count_lint++; $count_total++; syslint $o, '../mandoc', @{$test->{MOPTS}}, qw(-I os=OpenBSD -T lint -W all), $i and fail $test->{NAME}, 'lint:mandoc'; system @diff, $w, $o and fail $test->{NAME}, 'lint:diff'; print "." unless $targets{verbose}; } if ($targets{clean}) { print "rm $o\n" if $targets{verbose}; $count_rm += unlink $o; } } if ($targets{lint}) { print "Number of lint tests:" if $targets{verbose}; print " $count_lint tests run.\n"; } # --- final report ----------------------------------------------------- if (@failures) { print "\nNUMBER OF FAILED TESTS: ", scalar @failures, " (of $count_total tests run.)\n"; print "@$_\n" for @failures; print "\n"; exit 1; } print "\n" if $targets{verbose}; if ($count_total == 1) { print "Test succeeded.\n"; } elsif ($count_total) { print "All $count_total tests OK:"; print " $count_ascii ascii" if $count_ascii; print " $count_tag tag" if $count_tag; print " $count_man man" if $count_man; print " $count_utf8 utf8" if $count_utf8; print " $count_html html" if $count_html; print " $count_markdown markdown" if $count_markdown; print " $count_lint lint" if $count_lint; print "\n"; } else { print "No tests were run.\n"; } if ($targets{clean}) { if ($count_rm) { print "Deleted $count_rm test output files.\n"; print "The tree is now clean.\n"; } else { print "No test output files were found.\n"; print "The tree was already clean.\n"; } } exit 0; ��������������������������������������������������������������������������mandoc-1.14.6/regress/regress.pl.1������������������������������������������������������������������0100644�0001753�0001753�00000010761�13634440765�0017212�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: regress.pl.1,v 1.5 2020/03/13 15:32:31 schwarze Exp $ .\" .\" Copyright (c) 2017, 2019, 2020 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: March 13 2020 $ .Dt REGRESS.PL 1 .Os .Sh NAME .Nm regress.pl .Nd portable steering script for mandoc regression tests .Sh SYNOPSIS .Nm ./regress.pl .Oo .Ar directory Ns Op Pf / Ar test .Op Ar modifier ... .Oc .Sh DESCRIPTION The .Nm steering script allows running the .Xr mandoc 1 regression suite on arbitrary operating systems, even though the suite was originally designed for OpenBSD only. .Pp When run without an argument, .Nm runs the complete regression suite. .Pp The first argument is a Perl regular expression to match test names, automatically anchored at the beginning of the names. Test names are names of test input files without the file name extension .Pa .in , for example .Pa char/unicode/named . .Pp Any additional arguments modify the way the tests are run. The default is .Cm all . The following modifiers are available: .Bl -tag -width markdown .It Cm all Run all kinds of subtests. This implies all other modifiers except .Cm verbose and .Cm clean . .It Cm ascii Run subtests for .Fl T Cm ascii output mode. .It Cm clean Remove all output files created by running the tests. .It Cm html Run subtests for .Fl T Cm html output mode. .It Cm lint Run subtests for .Fl T Cm lint warning and error output. .It Cm man Run subtests for .Fl T Cm man output mode. .It Cm markdown Run subtests for .Fl T Cm markdown output mode. .It Cm tag Run subtests for automatic and manual tagging. .It Cm utf8 Run subtests for .Fl T Cm utf8 output mode. .It Cm verbose Display approximate indications of what is being done. .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES The recommended invocation for casual users: .Pp .Dl ./regress.pl .Pp Maximum output: .Pp .Dl ./regress.pl \&. verbose .Pp Complete check, but keep the tree clean: .Pp .Dl ./regress.pl \&. all clean .Pp Investigate a specific failure: .Pp .Dl ./regress.pl mdoc/Bd/broken man verbose .Sh HISTORY The .Nm script appeared in release 1.14.1 of the portable .Sy mandoc distribution. .Sh AUTHORS .An Ingo Schwarze Aq Mt schwarze@openbsd.org .Sh CAVEATS This script is not optimized for elegance. Regression suites for other software should not copy the design. .Pp The problem it solves is that the .Sy mandoc regression suite is tightly integrated into the regression testing system of the OpenBSD base system, which requires both OpenBSD .Xr make 1 , working neither with POSIX make nor with GNU make, and which also requires the OpenBSD-specific Makefile fragments in .Pa /usr/share/mk . The workaround of parsing the Makefiles by hand and constructing the required command lines by hand is unavoidably messy; it's the classic no-no of parsing a language with an ad-hoc incomplete parser. But the problem of providing this regression suite for other operating systems stood unsolved for many years, and no cleaner solution was found that could be implemented with reasonable effort. So maybe this is better than nothing. .Pp The top-level Makefiles for running this regression suite on OpenBSD are not included in the portable distribution. They are too OpenBSD-specific to be useful elsewhere, and on OpenBSD itself, the suite ought be run natively from .Pa /usr/src/regress/usr.bin/mandoc and not from the portable distribution. .Pp The .Pa db subdirectory of the regression suite is not included. It uses a Makefile structure that differs vastly from the rest of the suite. .Sh BUGS The C library function .Xr wcwidth 3 is known to be buggy on Solaris, which may cause failures in the regression suite, usually because output lines containing affected Unicode characters wrap too early. .Pp The regression suite does not work at all on Solaris 10 or earlier because the Perl interpreter provided with those systems is too old. ���������������mandoc-1.14.6/regress/char��������������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0015666�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/Makefile�����������������������������������������������������������������0100644�0001753�0001753�00000000237�13046505065�0017406�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.9 2014/06/20 18:27:51 schwarze Exp $ SUBDIR = accent bar hyphen space unicode N .include "../Makefile.sub" .include �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/Makefile.inc�������������������������������������������������������������0100644�0001753�0001753�00000000205�13060105637�0020146�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile.inc,v 1.3 2015/02/03 19:37:25 schwarze Exp $ SKIP_TMAN ?= ALL SKIP_MARKDOWN ?= ALL .include "../Makefile.inc" �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/N������������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016063�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/N/Makefile���������������������������������������������������������������0100644�0001753�0001753�00000000160�13046505066�0017577�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.2 2011/11/17 16:28:45 schwarze Exp $ REGRESS_TARGETS=basic .include ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/N/basic.in���������������������������������������������������������������0100644�0001753�0001753�00000001060�13136670124�0017546�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .TH N-BASIC 1 "January 29, 2011" .SH NAME N-basic \- basic handling of character number escapes .SH DESCRIPTION basic usage: x\N'65'x .br too large: x\N'259'x .br much too large: x\N'2259'x .br .\" XXX mandoc ignores non-printable characters, while groff does not .\" too small: x\N'1'x .\" .br .\" null: x\N'0'x .\" .br non-numerical content: x\N'XX'x .br mixed content: x\N'65XX'x .br empty: x\N''x .br no quoting: x\N665x .br non-matching quoting characters: x\NX65Yx .br end of test document ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/N/basic.out_ascii��������������������������������������������������������0100644�0001753�0001753�00000001003�14121400034�0021076�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������N-BASIC(1) General Commands Manual N-BASIC(1) NNAAMMEE N-basic - basic handling of character number escapes DDEESSCCRRIIPPTTIIOONN basic usage: xAx too large: xx much too large: xx non-numerical content: xX'x mixed content: xAX'x empty: xx no quoting: x65x non-matching quoting characters: xAx end of test document OpenBSD January 29, 2011 N-BASIC(1) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent�������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0017123�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent/Makefile����������������������������������������������������������0100644�0001753�0001753�00000000350�13410267673�0020644�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1 2014/03/08 18:00:59 schwarze Exp $ REGRESS_TARGETS = nocombine utf8only combine SKIP_ASCII = utf8only combine UTF8_TARGETS = nocombine utf8only combine LINT_TARGETS = nocombine .include ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent/combine.in��������������������������������������������������������0100644�0001753�0001753�00000001120�13136670124�0021136�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: combine.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH CHAR-ACCENT-COMBINE 1 "February 28, 2014" .SH NAME \fBchar-accent-combine\fR - combining accents .SH DESCRIPTION char + combine char U: e\U'0301' .br char + combine char C: e\C'u0301' .br char + combine char named: e\[u0301] .\" XXX not implemented in mandoc .\" .br .\" combined chars named numeric: \[u0065_0301] .\" .br .\" combined chars named: \[e aa] .br combined char pre N: \['e] .br combined char pre 2: \('e .\" XXX Plan 9 roff only .\" .br .\" combined char post N: \[e'] .\" .br .\" combined char post 2: \(e' ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent/combine.out_utf8��������������������������������������������������0100644�0001753�0001753�00000000722�14121400034�0022276�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-ACCENT-COMBINE(1) General Commands Manual CHAR-ACCENT-COMBINE(1) NNAAMMEE cchhaarr--aacccceenntt--ccoommbbiinnee - combining accents DDEESSCCRRIIPPTTIIOONN char + combine char U: eU'0301' char + combine char C: é char + combine char named: é combined char pre N: é combined char pre 2: é OpenBSD February 28, 2014 CHAR-ACCENT-COMBINE(1) ����������������������������������������������mandoc-1.14.6/regress/char/accent/nocombine.in������������������������������������������������������0100644�0001753�0001753�00000001601�13410267673�0021505�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: nocombine.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH CHAR-ACCENT-NOCOMBINE 1 "December 15, 2018" .SH NAME \fBchar-accent-nocombine\fR - non-combining accents .SH DESCRIPTION bare acute accent: e'e .br escaped acute accent: e\'e\[']e .br acute accent sequence: e\(aae .br bare grave accent: e`e .br escaped grave accent: e\`e\[`]e .br acute grave sequence: e\(gae .br hungarian umlaut: e\(a"e .br .\" XXX This is ridiculous. .\" XXX groff prints the macron as an underscore in the previous line. .\" macron: e\(a-e .\" .br .\" XXX groff doesn't have a dot in ASCII mode, only in UTF-8 mode. .\" dotted: e\(a.e .\" .br circumflex: e\(a^e .br .\" XXX groff uses a backspace for this one in ASCII mode. .\" breve: e\(abe .\" .br cedilla: e\(ace .br dieresis: e\(ade .br caron: e\(ahe .br ring: e\(aoe .br tilde: e\(a~e .br ogonek: e\(hoe .br text hat: e\(hae .br text tilde: e\(tie �������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent/nocombine.out_ascii�����������������������������������������������0100644�0001753�0001753�00000001303�14121400034�0023031�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-ACCENT-NOCOMBINE(1) General Commands Manual CHAR-ACCENT-NOCOMBINE(1) NNAAMMEE cchhaarr--aacccceenntt--nnooccoommbbiinnee - non-combining accents DDEESSCCRRIIPPTTIIOONN bare acute accent: e'e escaped acute accent: e'ee acute accent sequence: e'e bare grave accent: e`e escaped grave accent: e`ee acute grave sequence: e`e hungarian umlaut: e"e circumflex: e^e cedilla: e,e dieresis: e"e caron: eve ring: eoe tilde: e~e ogonek: e,e text hat: e^e text tilde: e~e OpenBSD December 15, 2018 CHAR-ACCENT-NOCOMBINE(1) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent/nocombine.out_utf8������������������������������������������������0100644�0001753�0001753�00000001313�14121400034�0022630�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-ACCENT-NOCOMBINE(1) General Commands Manual CHAR-ACCENT-NOCOMBINE(1) NNAAMMEE cchhaarr--aacccceenntt--nnooccoommbbiinnee - non-combining accents DDEESSCCRRIIPPTTIIOONN bare acute accent: e'e escaped acute accent: e´ee acute accent sequence: e´e bare grave accent: e`e escaped grave accent: e`ee acute grave sequence: e`e hungarian umlaut: e˝e circumflex: e^e cedilla: e¸e dieresis: e¨e caron: eˇe ring: e˚e tilde: e~e ogonek: e˛e text hat: e^e text tilde: e~e OpenBSD December 15, 2018 CHAR-ACCENT-NOCOMBINE(1) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent/utf8only.in�������������������������������������������������������0100644�0001753�0001753�00000000370�13136670124�0021320�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: utf8only.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH CHAR-ACCENT-UTF8ONLY 1 "March 8, 2014" .SH NAME \fBchar-accent-utf8only\fR - accents available in UTF-8 only .SH DESCRIPTION macron: e\(a-e .br dotted: e\(a.e .br breve: e\(abe ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent/utf8only.out_utf8�������������������������������������������������0100644�0001753�0001753�00000000561�14121400034�0022453�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-ACCENT-UTF8ONLY(1) General Commands Manual CHAR-ACCENT-UTF8ONLY(1) NNAAMMEE cchhaarr--aacccceenntt--uuttff88oonnllyy - accents available in UTF-8 only DDEESSCCRRIIPPTTIIOONN macron: e¯e dotted: e˙e breve: e˘e OpenBSD March 8, 2014 CHAR-ACCENT-UTF8ONLY(1) �����������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/accent/nocombine.out_lint������������������������������������������������0100644�0001753�0001753�00000000205�13405253124�0022721�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: nocombine.in:8:27: WARNING: invalid escape sequence: \['] mandoc: nocombine.in:14:27: WARNING: invalid escape sequence: \[`] �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/bar����������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016432�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/bar/Makefile�������������������������������������������������������������0100644�0001753�0001753�00000000165�13046505067�0020154�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1 2012/07/18 10:36:20 schwarze Exp $ REGRESS_TARGETS = man mdoc .include �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/bar/man.in���������������������������������������������������������������0100644�0001753�0001753�00000000567�13136670124�0017622�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: man.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH bar-man 1 "July 17, 2012" .SH NAME \fBbar-man\fR - formatting the vertical bar symbol .SH DESCRIPTION .SS normal bar Manually switching fonts: \fIitalic\fRroman|roman\fPitalic .PP .B prefix | suffix .SS special character Manually switching fonts: \fIitalic\fRroman\(baroman\fPitalic .PP .B prefix \(ba suffix �����������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/bar/man.out_ascii��������������������������������������������������������0100644�0001753�0001753�00000001156�14121400034�0021150�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������bar-man(1) General Commands Manual bar-man(1) NNAAMMEE bbaarr--mmaann - formatting the vertical bar symbol DDEESSCCRRIIPPTTIIOONN nnoorrmmaall bbaarr Manually switching fonts: _i_t_a_l_i_croman|roman_i_t_a_l_i_c pprreeffiixx || ssuuffffiixx ssppeecciiaall cchhaarraacctteerr Manually switching fonts: _i_t_a_l_i_croman|roman_i_t_a_l_i_c pprreeffiixx || ssuuffffiixx OpenBSD July 17, 2012 bar-man(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/bar/mdoc.in��������������������������������������������������������������0100644�0001753�0001753�00000002050�13136670124�0017756�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: mdoc.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BAR-MDOC 1 .Os .Sh NAME .Nm bar-mdoc .Nd formatting the vertical bar symbol .Sh DESCRIPTION .Ss normal bar Manually switching fonts: \fIitalic\fRroman|roman\fPitalic\fR .Pp .Fl isolated | em|bedded \fR|\fP formatted .br .Sy isolated | em|bedded \fR|\fP formatted .br .Ar isolated | em|bedded \fR|\fP formatted .br .Em isolated | em|bedded \fR|\fP formatted .Ss special character Manually switching fonts: \fIitalic\fRroman\(baroman\fPitalic\fR .Pp .Fl isolated \(ba em\(babedded \fR\(ba\fP formatted \fB\(ba\fP bold .br .Sy isolated \(ba em\(babedded \fR\(ba\fP formatted \fB\(ba\fP bold .br .Ar isolated \(ba em\(babedded \fR\(ba\fP formatted \fB\(ba\fP bold .br .Em isolated \(ba em\(babedded \fR\(ba\fP formatted \fB\(ba\fP bold .Ss predefined string Manually switching fonts: \fIitalic\fRroman\*(Baroman\fPbroken\fR .Pp .Fl isolated \*(Ba em\*(Babedded .br .Sy isolated \*(Ba em\*(Babedded .br .Ar isolated \*(Ba em\*(Babedded .br .Em isolated \*(Ba em\*(Babedded ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/bar/mdoc.out_ascii�������������������������������������������������������0100644�0001753�0001753�00000003253�13136670124�0021335�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������BAR-MDOC(1) General Commands Manual BAR-MDOC(1) NNAAMMEE bbaarr--mmddoocc - formatting the vertical bar symbol DDEESSCCRRIIPPTTIIOONN nnoorrmmaall bbaarr Manually switching fonts: _i_t_a_l_i_croman|roman_i_t_a_l_i_c --iissoollaatteedd | --eemm||bbeeddddeedd | --ffoorrmmaatttteedd iissoollaatteedd | eemm||bbeeddddeedd | ffoorrmmaatttteedd _i_s_o_l_a_t_e_d | _e_m_|_b_e_d_d_e_d | _f_o_r_m_a_t_t_e_d _i_s_o_l_a_t_e_d | _e_m_|_b_e_d_d_e_d | _f_o_r_m_a_t_t_e_d ssppeecciiaall cchhaarraacctteerr Manually switching fonts: _i_t_a_l_i_croman|roman_i_t_a_l_i_c --iissoollaatteedd --|| --eemm||bbeeddddeedd --| --ffoorrmmaatttteedd --|| --bboolldd iissoollaatteedd || eemm||bbeeddddeedd | ffoorrmmaatttteedd || bboolldd _i_s_o_l_a_t_e_d _| _e_m_|_b_e_d_d_e_d | _f_o_r_m_a_t_t_e_d || _b_o_l_d _i_s_o_l_a_t_e_d _| _e_m_|_b_e_d_d_e_d | _f_o_r_m_a_t_t_e_d || _b_o_l_d pprreeddeeffiinneedd ssttrriinngg Manually switching fonts: _i_t_a_l_i_croman|romanbroken --iissoollaatteedd | --eemm|bbeeddddeedd iissoollaatteedd | eemm|bbeeddddeedd _i_s_o_l_a_t_e_d | _e_m|_b_e_d_d_e_d _i_s_o_l_a_t_e_d | _e_m|_b_e_d_d_e_d OpenBSD July 4, 2017 OpenBSD �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/hyphen�������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0017161�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/hyphen/Makefile����������������������������������������������������������0100644�0001753�0001753�00000000163�13046505067�0020701�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.2 2011/11/17 16:28:45 schwarze Exp $ REGRESS_TARGETS=man mdoc .include �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/hyphen/man.in������������������������������������������������������������0100644�0001753�0001753�00000000653�13136670124�0020345�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: man.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .TH hyphen-man 1 "September 18, 2011" .SH NAME \fBhyphen-man\fR - formatting hyphens and breaking lines .SH DESCRIPTION This is a long line of text, such that the last word won't fit: break-here .PP Try the same thing once same again, but now in italic font mode: \fIbreak-here\fP .PP Finally, try it a third time, but this time in bold font mode: \fBbreak-here\fP �������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/hyphen/man.out_ascii�����������������������������������������������������0100644�0001753�0001753�00000001126�14121400034�0021674�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������hyphen-man(1) General Commands Manual hyphen-man(1) NNAAMMEE hhyypphheenn--mmaann - formatting hyphens and breaking lines DDEESSCCRRIIPPTTIIOONN This is a long line of text, such that the last word won't fit: break- here Try the same thing once same again, but now in italic font mode: _b_r_e_a_k_- _h_e_r_e Finally, try it a third time, but this time in bold font mode: bbrreeaakk-- hheerree OpenBSD September 18, 2011 hyphen-man(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/hyphen/mdoc.in�����������������������������������������������������������0100644�0001753�0001753�00000001021�13136670124�0020502�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: mdoc.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt HYPHEN-MDOC 1 .Os .Sh NAME .Nm hyphen-mdoc .Nd formatting hyphens and breaking lines .Sh DESCRIPTION This is a long line of text, such that the last word won't fit: break-here .Pp But do not break the line at hyphens inside macro arguments: no .No break-here .Pp Try the same thing once same again, but now in italic font mode: \fIbreak-here\fP .Pp And finally, try it a third time, but this time in bold font mode: \fBbreak-here\fP ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/hyphen/mdoc.out_ascii����������������������������������������������������0100644�0001753�0001753�00000001245�13136670124�0022063�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HYPHEN-MDOC(1) General Commands Manual HYPHEN-MDOC(1) NNAAMMEE hhyypphheenn--mmddoocc - formatting hyphens and breaking lines DDEESSCCRRIIPPTTIIOONN This is a long line of text, such that the last word won't fit: break- here But do not break the line at hyphens inside macro arguments: no break-here Try the same thing once same again, but now in italic font mode: _b_r_e_a_k_- _h_e_r_e And finally, try it a third time, but this time in bold font mode: bbrreeaakk-- hheerree OpenBSD July 4, 2017 OpenBSD �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space��������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016761�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/Makefile�����������������������������������������������������������0100644�0001753�0001753�00000000636�13410267673�0020511�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.12 2016/12/07 23:27:42 schwarze Exp $ REGRESS_TARGETS = leading-mdoc leading-man multiple trailing-mdoc zerowidth REGRESS_TARGETS += eos eos-man break nobreak REGRESS_TARGETS += tab tab-man esct-mdoc esct-man REGRESS_TARGETS += invalid UTF8_TARGETS = zerowidth HTML_TARGETS = zerowidth LINT_TARGETS = trailing-mdoc tab tab-man esct-mdoc esct-man invalid .include ��������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/break.in�����������������������������������������������������������0100644�0001753�0001753�00000000434�13136670124�0020453�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: break.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CHAR-BREAK 1 .Os .Sh NAME .Nm char-break .Nd optional line-break .Sh DESCRIPTION .Dl cons25,linux,rxvt,rxvt-unicode,\:sun,\:vt100,\:vt220,\:\ wsvt25,\:xterm,\:xterm-color .Pp end of text ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/break.out_ascii����������������������������������������������������0100644�0001753�0001753�00000000573�13136670124�0022030�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-BREAK(1) General Commands Manual CHAR-BREAK(1) NNAAMMEE cchhaarr--bbrreeaakk - optional line-break DDEESSCCRRIIPPTTIIOONN cons25,linux,rxvt,rxvt-unicode,sun,vt100,vt220,wsvt25,xterm, xterm-color end of text OpenBSD July 4, 2017 OpenBSD �������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/eos-man.in���������������������������������������������������������0100644�0001753�0001753�00000001222�13136670124�0020722�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: eos-man.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH SPACE-EOS-MAN 1 "December 22, 2013" .SH NAME SPACE-EOS-MAN \- end-of-sentence spacing in man(7) documents .SH DESCRIPTION This is a sentence. There is a double space before the next one. .PP Here is a full stop .B at the end of a macro. It causes a double space, too. .PP She said: "Here is another sentence." And it was detected even with quotation marks. (Really.) And within parantheses. .PP A dot in parantheses (.) is not a full stop. .PP A dot in the middle of an input line . is not a full stop. .PP At the end of an input line, even an escaped dot \&. is regarded as a full stop. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/eos-man.out_ascii��������������������������������������������������0100644�0001753�0001753�00000001470�14121400034�0022262�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-EOS-MAN(1) General Commands Manual SPACE-EOS-MAN(1) NNAAMMEE SPACE-EOS-MAN - end-of-sentence spacing in man(7) documents DDEESSCCRRIIPPTTIIOONN This is a sentence. There is a double space before the next one. Here is a full stop aatt tthhee eenndd ooff aa mmaaccrroo.. It causes a double space, too. She said: "Here is another sentence." And it was detected even with quotation marks. (Really.) And within parantheses. A dot in parantheses (.) is not a full stop. A dot in the middle of an input line . is not a full stop. At the end of an input line, even an escaped dot . is regarded as a full stop. OpenBSD December 22, 2013 SPACE-EOS-MAN(1) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/eos.in�������������������������������������������������������������0100644�0001753�0001753�00000001172�13136670124�0020155�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: eos.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SPACE-EOS 1 .Os .Sh NAME .Nm space-eos .Nd end-of-sentence spacing .Sh DESCRIPTION This is a sentence. There is a double space before the next one. .Pp Here is a full stop .Pq quite lonely . It causes a double space, too. .Pp A dot in parantheses (.) is not a full stop. Not even .Pq Like in this case. when preceded by a letter. .Pp A lonely dot in an enclosure .Pq \&. is not a full stop. .Pp A dot in the middle of an input line . is not a full stop. .Pp At the end of an input line, even an escaped dot \&. is regarded as a full stop. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/eos.out_ascii������������������������������������������������������0100644�0001753�0001753�00000001345�13136670124�0021530�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-EOS(1) General Commands Manual SPACE-EOS(1) NNAAMMEE ssppaaccee--eeooss - end-of-sentence spacing DDEESSCCRRIIPPTTIIOONN This is a sentence. There is a double space before the next one. Here is a full stop (quite lonely). It causes a double space, too. A dot in parantheses (.) is not a full stop. Not even (Like in this case.) when preceded by a letter. A lonely dot in an enclosure (.) is not a full stop. A dot in the middle of an input line . is not a full stop. At the end of an input line, even an escaped dot . is regarded as a full stop. OpenBSD July 4, 2017 OpenBSD �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/esct-man.in��������������������������������������������������������0100644�0001753�0001753�00000001500�13410267673�0021077�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: esct-man.in,v 1.4 2018/12/20 03:38:10 schwarze Exp $ .TH SPACE-ESCT-MAN 1 "December 20, 2018" .SH NAME SPACE-T-MAN \- the t escape sequence in pages with man macros .SH DESCRIPTION In plain text: .br single tab .br single\tescape-t .br single\aescape-a .br double tab .br double\t\tescape-t .br double\a\aescape-a .br \tThis line starts with escape-t and comes close to the right margin. \tThe next line starts with escape-t as well. .sp In a literal display: .nf single tab single\tescape-t single\aescape-a double tab double\t\tescape-t double\a\aescape-a .fi .sp After the IP macro: .IP single tab 3n text .IP single\tescape-t 3n text .\" XXX not implemented .\" .IP single\aescape-a 3n .\" text .PP After font macros: .br .B single\ttab .\" XXX not implemented .\" .br .\" .B single\aleader .br .B double\t\ttab ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/esct-man.out_ascii�������������������������������������������������0100644�0001753�0001753�00000001655�14121400034�0022437�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-ESCT-MAN(1) General Commands Manual SPACE-ESCT-MAN(1) NNAAMMEE SPACE-T-MAN - the t escape sequence in pages with man macros DDEESSCCRRIIPPTTIIOONN In plain text: single tab singleescape-t singleescape-a double tab doubleescape-t doubleescape-a This line starts with escape-t and comes close to the right margin. The next line starts with escape-t as well. In a literal display: single tab singleescape-t singleescape-a double tab doubleescape-t doubleescape-a After the IP macro: single tab text single escape-t text After font macros: ssiinnggllee ttaabb ddoouubbllee ttaabb OpenBSD December 20, 2018 SPACE-ESCT-MAN(1) �����������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/esct-man.out_lint��������������������������������������������������0100644�0001753�0001753�00000000664�13410267673�0022340�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: esct-man.in:8:7: WARNING: tab in filled text mandoc: esct-man.in:14:7: WARNING: tab in filled text mandoc: esct-man.in:14:8: WARNING: tab in filled text mandoc: esct-man.in:34:11: WARNING: tab in filled text mandoc: esct-man.in:36:11: WARNING: tab in filled text mandoc: esct-man.in:44:10: WARNING: tab in filled text mandoc: esct-man.in:49:10: WARNING: tab in filled text mandoc: esct-man.in:49:11: WARNING: tab in filled text ����������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/esct-mdoc.in�������������������������������������������������������0100644�0001753�0001753�00000001223�13136670124�0021242�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: esct-mdoc.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SPACE-ESCT-MDOC 1 .Os .Sh NAME .Nm space-esct-mdoc .Nd the t escape sequence in pages with mdoc macros .Sh DESCRIPTION In plain text: .Pp single tab .Pp single\tescape-t .Pp double tab .Pp double\t\tescape-t .Pp \tThis line starts with escape-t and comes close to the right margin. \tThe next line starts with escape-t as well. .Pp In an unfilled display: .Bd -unfilled -offset 3n single tab single\tescape-t double tab double\t\tescape-t .Ed .Pp In a literal display: .Bd -literal -offset 3n single tab single\tescape-t double tab double\t\tescape-t .Ed �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/esct-mdoc.out_ascii������������������������������������������������0100644�0001753�0001753�00000001425�13136670124�0022617�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-ESCT-MDOC(1) General Commands Manual SPACE-ESCT-MDOC(1) NNAAMMEE ssppaaccee--eesscctt--mmddoocc - the t escape sequence in pages with mdoc macros DDEESSCCRRIIPPTTIIOONN In plain text: single tab singleescape-t double tab doubleescape-t This line starts with escape-t and comes close to the right margin. The next line starts with escape-t as well. In an unfilled display: single tab singleescape-t double tab doubleescape-t In a literal display: single tab singleescape-t double tab doubleescape-t OpenBSD July 4, 2017 OpenBSD �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/esct-mdoc.out_lint�������������������������������������������������0100644�0001753�0001753�00000000245�13136670124�0022474�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: esct-mdoc.in:11:7: WARNING: tab in filled text mandoc: esct-mdoc.in:15:7: WARNING: tab in filled text mandoc: esct-mdoc.in:15:8: WARNING: tab in filled text �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/leading-man.in�����������������������������������������������������0100644�0001753�0001753�00000000530�13136670124�0021540�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: leading-man.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .TH SPACE-LEADING-MAN 1 "January 15, 2011" .SH NAME space-leading-man \- leading spaces on text lines in man documents .SH DESCRIPTION normal line of text second normal line leading space .BI bold italic normal after macro .BI bold italic leading space after a macro line ������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/leading-man.out_ascii����������������������������������������������0100644�0001753�0001753�00000000727�14121400034�0023103�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-LEADING-MAN(1) General Commands Manual SPACE-LEADING-MAN(1) NNAAMMEE space-leading-man - leading spaces on text lines in man documents DDEESSCCRRIIPPTTIIOONN normal line of text second normal line leading space bboolldd_i_t_a_l_i_c normal after macro bboolldd_i_t_a_l_i_c leading space after a macro line OpenBSD January 15, 2011 SPACE-LEADING-MAN(1) �����������������������������������������mandoc-1.14.6/regress/char/space/leading-mdoc.in����������������������������������������������������0100644�0001753�0001753�00000001100�13136670124�0021701�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: leading-mdoc.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SPACE-LEADING_MDOC 1 .Os .Sh NAME .Nm space-leading-mdoc .Nd leading spaces on text lines in mdoc documents .Sh DESCRIPTION normal line of text second normal line line with a leading space .Ux normal line after a macro line .Ux leading space after a macro line .Bd -literal normal line in a literal display leading space in a literal display another normal line .Ed .Bd -filled normal line in a filled display leading space in a filled display another normal line .Ed ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/leading-mdoc.out_ascii���������������������������������������������0100644�0001753�0001753�00000001244�13136670124�0023263�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-LEADING_MDOC(1) General Commands Manual SPACE-LEADING_MDOC(1) NNAAMMEE ssppaaccee--lleeaaddiinngg--mmddoocc - leading spaces on text lines in mdoc documents DDEESSCCRRIIPPTTIIOONN normal line of text second normal line line with a leading space UNIX normal line after a macro line UNIX leading space after a macro line normal line in a literal display leading space in a literal display another normal line normal line in a filled display leading space in a filled display another normal line OpenBSD July 4, 2017 OpenBSD ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/multiple.in��������������������������������������������������������0100644�0001753�0001753�00000000606�13136670124�0021223�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: multiple.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SPACE-MULTIPLE 1 .Os .Sh NAME .Nm space-multiple .Nd handling of multiple adjacent space characters .Sh DESCRIPTION one space here .Pp two spaces here .Pp three spaces here .Pp one non-collapsing space here .Pp two non-collapsing spaces\ \ here .Pp three non-collapsing spaces\ \ \ here ��������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/multiple.out_ascii�������������������������������������������������0100644�0001753�0001753�00000000751�13136670124�0022575�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-MULTIPLE(1) General Commands Manual SPACE-MULTIPLE(1) NNAAMMEE ssppaaccee--mmuullttiippllee - handling of multiple adjacent space characters DDEESSCCRRIIPPTTIIOONN one space here two spaces here three spaces here one non-collapsing space here two non-collapsing spaces here three non-collapsing spaces here OpenBSD July 4, 2017 OpenBSD �����������������������mandoc-1.14.6/regress/char/space/nobreak.in���������������������������������������������������������0100644�0001753�0001753�00000001644�13136670124�0021014�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: nobreak.in,v 1.5 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SPACE-NOBREAK 1 .Os .Sh NAME .Nm space-nobreak .Nd non-breaking, non-collapsing space .Sh DESCRIPTION The following line has 78 characters and fits: .Pp 78 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x x .Pp The following line has 79 characters and breaks: .Pp 79 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x x .Pp With a non-breaking space, it breaks earlier: .Pp 79 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x\~x .Pp The same with backslash-space: .Pp 79 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x\ x .Pp Only non-breaking spaces: .Pp 79\~xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\~x\~x .Pp The same with backslash-space: .Pp 79\ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\ x\ x ��������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/nobreak.out_ascii��������������������������������������������������0100644�0001753�0001753�00000002037�13136670124�0022362�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-NOBREAK(1) General Commands Manual SPACE-NOBREAK(1) NNAAMMEE ssppaaccee--nnoobbrreeaakk - non-breaking, non-collapsing space DDEESSCCRRIIPPTTIIOONN The following line has 78 characters and fits: 78 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x x The following line has 79 characters and breaks: 79 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x x With a non-breaking space, it breaks earlier: 79 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x x The same with backslash-space: 79 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x x Only non-breaking spaces: 79 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x x The same with backslash-space: 79 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x x OpenBSD July 4, 2017 OpenBSD �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/tab-man.in���������������������������������������������������������0100644�0001753�0001753�00000001363�13136670124�0020710�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: tab-man.in,v 1.5 2017/07/04 14:53:23 schwarze Exp $ .TH SPACE-TAB-MAN 1 "May 24, 2010" .SH NAME SPACE-TAB-MAN \- handling of literal tab characters .SH DESCRIPTION In plain text: .br 1 x .br 22 x .br 333 x .br 4444 x .br 55555 x .br 666666 x .br 7777777 x .br 88888888 x .br 999999999 x .br aaaaaaaaaa x .br bbbbbbbbbbb x .br cccccccccccc x .br ddddddddddddd x .br tab space .br tab tab .br space tab .br tab .br tab .br This line starts with a tab and comes close to the right margin. The next line starts with a tab as well. .br In a literal display: .nf 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab .fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/tab-man.out_ascii��������������������������������������������������0100644�0001753�0001753�00000002161�14121400034�0022240�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-TAB-MAN(1) General Commands Manual SPACE-TAB-MAN(1) NNAAMMEE SPACE-TAB-MAN - handling of literal tab characters DDEESSCCRRIIPPTTIIOONN In plain text: 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab This line starts with a tab and comes close to the right margin. The next line starts with a tab as well. In a literal display: 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab OpenBSD May 24, 2010 SPACE-TAB-MAN(1) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/tab-man.out_lint���������������������������������������������������0100644�0001753�0001753�00000002222�13136670124�0022132�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: tab-man.in:8:2: WARNING: tab in filled text mandoc: tab-man.in:10:3: WARNING: tab in filled text mandoc: tab-man.in:12:4: WARNING: tab in filled text mandoc: tab-man.in:14:5: WARNING: tab in filled text mandoc: tab-man.in:16:6: WARNING: tab in filled text mandoc: tab-man.in:18:7: WARNING: tab in filled text mandoc: tab-man.in:20:8: WARNING: tab in filled text mandoc: tab-man.in:22:9: WARNING: tab in filled text mandoc: tab-man.in:24:10: WARNING: tab in filled text mandoc: tab-man.in:26:11: WARNING: tab in filled text mandoc: tab-man.in:28:12: WARNING: tab in filled text mandoc: tab-man.in:30:13: WARNING: tab in filled text mandoc: tab-man.in:32:14: WARNING: tab in filled text mandoc: tab-man.in:34:4: WARNING: tab in filled text mandoc: tab-man.in:36:4: WARNING: tab in filled text mandoc: tab-man.in:36:5: WARNING: tab in filled text mandoc: tab-man.in:38:7: WARNING: tab in filled text mandoc: tab-man.in:40:1: WARNING: tab in filled text mandoc: tab-man.in:42:1: WARNING: tab in filled text mandoc: tab-man.in:42:2: WARNING: tab in filled text mandoc: tab-man.in:44:1: WARNING: tab in filled text mandoc: tab-man.in:45:1: WARNING: tab in filled text ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/tab.in�������������������������������������������������������������0100644�0001753�0001753�00000002376�13136670124�0020144�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: tab.in,v 1.6 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SPACE-TAB 1 .Os .Sh NAME .Nm space-tab .Nd handling of literal space characters .Sh DESCRIPTION plain text .br 1 x .br 22 x .br 333 x .br 4444 x .br 55555 x .br 666666 x .br 7777777 x .br 88888888 x .br 999999999 x .br aaaaaaaaaa x .br bbbbbbbbbbb x .br cccccccccccc x .br ddddddddddddd x .br tab space .br tab tab .br space tab .br tab .br tab .br This line starts with a tab and comes close to the right margin. The next line starts with a tab as well. .br ragged display .Bd -ragged -offset 2n 1 x .br 22 x .br 333 x .br 4444 x .br 55555 x .br 666666 x .br 7777777 x .br 88888888 x .br 999999999 x .br aaaaaaaaaa x .br bbbbbbbbbbb x .br cccccccccccc x .br ddddddddddddd x .br tab space .br tab tab .br space tab .br tab .br tab .Ed unfilled display .Bd -unfilled -offset 2n 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab .Ed literal display .Bd -literal -offset 2n 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab .Ed ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/tab.out_ascii������������������������������������������������������0100644�0001753�0001753�00000003516�13136670124�0021512�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-TAB(1) General Commands Manual SPACE-TAB(1) NNAAMMEE ssppaaccee--ttaabb - handling of literal space characters DDEESSCCRRIIPPTTIIOONN plain text 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab This line starts with a tab and comes close to the right margin. The next line starts with a tab as well. ragged display 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab unfilled display 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab literal display 1 x 22 x 333 x 4444 x 55555 x 666666 x 7777777 x 88888888 x 999999999 x aaaaaaaaaa x bbbbbbbbbbb x cccccccccccc x ddddddddddddd x tab space tab tab space tab tab tab OpenBSD July 4, 2017 OpenBSD ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/tab.out_lint�������������������������������������������������������0100644�0001753�0001753�00000004024�13136670124�0021363�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: tab.in:11:2: WARNING: tab in filled text mandoc: tab.in:13:3: WARNING: tab in filled text mandoc: tab.in:15:4: WARNING: tab in filled text mandoc: tab.in:17:5: WARNING: tab in filled text mandoc: tab.in:19:6: WARNING: tab in filled text mandoc: tab.in:21:7: WARNING: tab in filled text mandoc: tab.in:23:8: WARNING: tab in filled text mandoc: tab.in:25:9: WARNING: tab in filled text mandoc: tab.in:27:10: WARNING: tab in filled text mandoc: tab.in:29:11: WARNING: tab in filled text mandoc: tab.in:31:12: WARNING: tab in filled text mandoc: tab.in:33:13: WARNING: tab in filled text mandoc: tab.in:35:14: WARNING: tab in filled text mandoc: tab.in:37:4: WARNING: tab in filled text mandoc: tab.in:39:4: WARNING: tab in filled text mandoc: tab.in:39:5: WARNING: tab in filled text mandoc: tab.in:41:7: WARNING: tab in filled text mandoc: tab.in:43:1: WARNING: tab in filled text mandoc: tab.in:45:1: WARNING: tab in filled text mandoc: tab.in:45:2: WARNING: tab in filled text mandoc: tab.in:47:1: WARNING: tab in filled text mandoc: tab.in:48:1: WARNING: tab in filled text mandoc: tab.in:52:2: WARNING: tab in filled text mandoc: tab.in:54:3: WARNING: tab in filled text mandoc: tab.in:56:4: WARNING: tab in filled text mandoc: tab.in:58:5: WARNING: tab in filled text mandoc: tab.in:60:6: WARNING: tab in filled text mandoc: tab.in:62:7: WARNING: tab in filled text mandoc: tab.in:64:8: WARNING: tab in filled text mandoc: tab.in:66:9: WARNING: tab in filled text mandoc: tab.in:68:10: WARNING: tab in filled text mandoc: tab.in:70:11: WARNING: tab in filled text mandoc: tab.in:72:12: WARNING: tab in filled text mandoc: tab.in:74:13: WARNING: tab in filled text mandoc: tab.in:76:14: WARNING: tab in filled text mandoc: tab.in:78:4: WARNING: tab in filled text mandoc: tab.in:80:4: WARNING: tab in filled text mandoc: tab.in:80:5: WARNING: tab in filled text mandoc: tab.in:82:7: WARNING: tab in filled text mandoc: tab.in:84:1: WARNING: tab in filled text mandoc: tab.in:86:1: WARNING: tab in filled text mandoc: tab.in:86:2: WARNING: tab in filled text ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/trailing-mdoc.in���������������������������������������������������0100644�0001753�0001753�00000000426�13136670124�0022121�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: trailing-mdoc.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SPACE-TRAILING-MDOC 1 .Os .Sh NAME .Nm space-trailing-mdoc .Nd trailing spaces on input lines .Sh DESCRIPTION on a text line, on a .Em macro line, after a comment \" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/trailing-mdoc.out_ascii��������������������������������������������0100644�0001753�0001753�00000000560�13136670124�0023471�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-TRAILING-MDOC(1) General Commands Manual SPACE-TRAILING-MDOC(1) NNAAMMEE ssppaaccee--ttrraaiilliinngg--mmddoocc - trailing spaces on input lines DDEESSCCRRIIPPTTIIOONN on a text line, on a _m_a_c_r_o line, after a comment OpenBSD July 4, 2017 OpenBSD ������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/trailing-mdoc.out_lint���������������������������������������������0100644�0001753�0001753�00000000324�13136670124�0023345�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: trailing-mdoc.in:9:16: STYLE: whitespace at end of input line mandoc: trailing-mdoc.in:11:12: STYLE: whitespace at end of input line mandoc: trailing-mdoc.in:12:27: STYLE: whitespace at end of input line ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/zerowidth.in�������������������������������������������������������0100644�0001753�0001753�00000000623�13136670124�0021406�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: zerowidth.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .TH SPACE-ZEROWIDTH 1 "October 27, 2014" .SH NAME space-zerowidth \- zero width and narrow space characters .SH DESCRIPTION .nf BEGINTEST zero width space \e& between A and B: A\&B hyphenation allowed \e% between A and B: A\%B half-narrow (1/12) space \e^ between A and B: A\^B narrow space (1/6) \e| between A and B: A\|B ENDTEST .fi �������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/zerowidth.out_ascii������������������������������������������������0100644�0001753�0001753�00000000771�14121400034�0022745�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-ZEROWIDTH(1) General Commands Manual SPACE-ZEROWIDTH(1) NNAAMMEE space-zerowidth - zero width and narrow space characters DDEESSCCRRIIPPTTIIOONN BEGINTEST zero width space \& between A and B: AB hyphenation allowed \% between A and B: AB half-narrow (1/12) space \^ between A and B: AB narrow space (1/6) \| between A and B: AB ENDTEST OpenBSD October 27, 2014 SPACE-ZEROWIDTH(1) �������mandoc-1.14.6/regress/char/space/zerowidth.out_html�������������������������������������������������0100644�0001753�0001753�00000000261�13634440765�0022642�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������zero width space \& between A and B: AB hyphenation allowed \% between A and B: AB half-narrow (1/12) space \^ between A and B: AB narrow space (1/6) \| between A and B: AB �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/zerowidth.out_utf8�������������������������������������������������0100644�0001753�0001753�00000000771�14121400034�0022543�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-ZEROWIDTH(1) General Commands Manual SPACE-ZEROWIDTH(1) NNAAMMEE space-zerowidth - zero width and narrow space characters DDEESSCCRRIIPPTTIIOONN BEGINTEST zero width space \& between A and B: AB hyphenation allowed \% between A and B: AB half-narrow (1/12) space \^ between A and B: AB narrow space (1/6) \| between A and B: AB ENDTEST OpenBSD October 27, 2014 SPACE-ZEROWIDTH(1) �������mandoc-1.14.6/regress/char/space/invalid.in���������������������������������������������������������0100644�0001753�0001753�00000000465�13405253125�0021016�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD$ .TH SPACE-INVALID 1 "December 15, 2018" .SH NAME SPACE-INVALID \- invalid whitespace escape sequences .SH DESCRIPTION .nf blank: a\[hy]b\[ hy]c percent: a\%b\[%]c ampersand: a\&b\[&]c colon: a\:b\[:]c caret: a\^b\[^]c underline: a\_b\[_]c pipe: a\|b\[|]c tilde: a\~b\[~]c digit-width: a\0b\[0]c �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/space/invalid.out_ascii��������������������������������������������������0100644�0001753�0001753�00000000703�14121400034�0022347�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SPACE-INVALID(1) General Commands Manual SPACE-INVALID(1) NNAAMMEE SPACE-INVALID - invalid whitespace escape sequences DDEESSCCRRIIPPTTIIOONN blank: a-bhy]c percent: abc ampersand: abc colon: abc caret: abc underline: a_bc pipe: abc tilde: a bc digit-width: a bc OpenBSD December 15, 2018 SPACE-INVALID(1) �������������������������������������������������������������mandoc-1.14.6/regress/char/space/invalid.out_lint���������������������������������������������������0100644�0001753�0001753�00000001105�13405253125�0022235�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: invalid.in:7:15: WARNING: invalid escape sequence: \[ mandoc: invalid.in:8:14: WARNING: invalid escape sequence: \[%] mandoc: invalid.in:9:16: WARNING: invalid escape sequence: \[&] mandoc: invalid.in:10:12: WARNING: invalid escape sequence: \[:] mandoc: invalid.in:11:12: WARNING: invalid escape sequence: \[^] mandoc: invalid.in:12:16: WARNING: invalid escape sequence: \[_] mandoc: invalid.in:13:11: WARNING: invalid escape sequence: \[|] mandoc: invalid.in:14:12: WARNING: invalid escape sequence: \[~] mandoc: invalid.in:15:18: WARNING: invalid escape sequence: \[0] �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0017314�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/Makefile���������������������������������������������������������0100644�0001753�0001753�00000001104�13047647635�0021041�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.4 2014/12/19 04:57:11 schwarze Exp $ REGRESS_TARGETS = ascii input invalid latin1 latin1diff REGRESS_TARGETS += man mdoc named namediff nogroff SKIP_ASCII = man mdoc # input and nogroff exhibit implementation dependent differences # among wcwidth(3) on different systems #UTF8_TARGETS = ${REGRESS_TARGETS} UTF8_TARGETS = ascii invalid man mdoc namediff HTML_TARGETS = ascii invalid latin1 latin1diff named namediff nogroff LINT_TARGETS = input invalid SKIP_GROFF = input nogroff SKIP_GROFF_ASCII = latin1diff namediff .include ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/ascii.in���������������������������������������������������������0100644�0001753�0001753�00000001554�13136670124�0021016�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: ascii.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .TH CHAR-UNICODE-ASCII 1 "October 27, 2014" .SH NAME char-unicode-ascii \- Unicode characters in the ASCII range .SH DESCRIPTION .nf BEGINTEST \[u0022]\N'34'\(dq QUOTATION MARK \[u0023]\N'35'\(sh NUMBER SIGN \[u0024]\N'36'\(Do DOLLAR SIGN \[u0027]\N'39'\(aq APOSTROPHE \[u002B]\N'43'\(pl PLUS SIGN \N'45'\- HYPHEN-MINUS \N'46'\. FULL STOP \[u002F]\N'47'\(sl SOLIDUS \[u003D]\N'61'\(eq EQUALS SIGN \[u0040]\N'64'\(at COMMERCIAL AT \[u005B]\N'91'\(lB LEFT SQUARE BRACKET \[u005C]\N'92'\e\(rs REVERSE SOLIDUS \[u005D]\N'93'\(rB RIGHT SQUARE BRACKET \[u005E]\N'94'\(a^\(ha CIRCUMFLEX ACCENT \[u005F]\N'95'\(ul\(ru LOW LINE \[u0060]\N'96'\`\(ga GRAVE ACCENT \[u007B]\N'123'\(lC LEFT CURLY BRACKET \[u007C]\N'124'\(ba\(or VERTICAL LINE \[u007D]\N'125'\(rC RIGHT CURLY BRACKET \[u007E]\N'126'\(a~\(ti TILDE ENDTEST .fi ����������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/ascii.out_ascii��������������������������������������������������0100644�0001753�0001753�00000001463�14121400034�0022350�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-ASCII(1) General Commands Manual CHAR-UNICODE-ASCII(1) NNAAMMEE char-unicode-ascii - Unicode characters in the ASCII range DDEESSCCRRIIPPTTIIOONN BEGINTEST """ QUOTATION MARK ### NUMBER SIGN $$$ DOLLAR SIGN ''' APOSTROPHE +++ PLUS SIGN -- HYPHEN-MINUS .. FULL STOP /// SOLIDUS === EQUALS SIGN @@@ COMMERCIAL AT [[[ LEFT SQUARE BRACKET \\\\ REVERSE SOLIDUS ]]] RIGHT SQUARE BRACKET ^^^^ CIRCUMFLEX ACCENT ____ LOW LINE ```` GRAVE ACCENT {{{ LEFT CURLY BRACKET |||| VERTICAL LINE }}} RIGHT CURLY BRACKET ~~~~ TILDE ENDTEST OpenBSD October 27, 2014 CHAR-UNICODE-ASCII(1) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/ascii.out_html���������������������������������������������������0100644�0001753�0001753�00000000564�13634440765�0022254�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������""" QUOTATION MARK ### NUMBER SIGN $$$ DOLLAR SIGN ''' APOSTROPHE +++ PLUS SIGN -- HYPHEN-MINUS .. FULL STOP /// SOLIDUS === EQUALS SIGN @@@ COMMERCIAL AT [[[ LEFT SQUARE BRACKET \\\\ REVERSE SOLIDUS ]]] RIGHT SQUARE BRACKET ^^^^ CIRCUMFLEX ACCENT ____ LOW LINE ```` GRAVE ACCENT {{{ LEFT CURLY BRACKET |||| VERTICAL LINE }}} RIGHT CURLY BRACKET ~~~~ TILDE ��������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/ascii.out_utf8���������������������������������������������������0100644�0001753�0001753�00000001463�14121400034�0022146�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-ASCII(1) General Commands Manual CHAR-UNICODE-ASCII(1) NNAAMMEE char-unicode-ascii - Unicode characters in the ASCII range DDEESSCCRRIIPPTTIIOONN BEGINTEST """ QUOTATION MARK ### NUMBER SIGN $$$ DOLLAR SIGN ''' APOSTROPHE +++ PLUS SIGN -- HYPHEN-MINUS .. FULL STOP /// SOLIDUS === EQUALS SIGN @@@ COMMERCIAL AT [[[ LEFT SQUARE BRACKET \\\\ REVERSE SOLIDUS ]]] RIGHT SQUARE BRACKET ^^^^ CIRCUMFLEX ACCENT ____ LOW LINE ```` GRAVE ACCENT {{{ LEFT CURLY BRACKET |||| VERTICAL LINE }}} RIGHT CURLY BRACKET ~~~~ TILDE ENDTEST OpenBSD October 27, 2014 CHAR-UNICODE-ASCII(1) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/input.in���������������������������������������������������������0100644�0001753�0001753�00000005174�14121400034�0021051�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: input.in,v 1.4 2021/06/02 17:36:59 schwarze Exp $ .TH CHAR-UNICODE-INPUT 1 "June 2, 2021" .SH NAME char-unicode-input \- Unicode characters in the input file .SH DESCRIPTION lowest valid: € .SS One-byte range .TS tab(:); l l l l. U+0000:0x00:\[u0000]�:lowest ASCII U+001f:0x1f:\[u001F]:highest ASCII control character U+007f:0x7f:\[u007F]:highest ASCII :0x80::leading lowest continuation :0xbf::leading highest continuation .TE .SS Two-byte range .TS tab(:); l l l l. U+0000:0xc080::lowest obfuscated ASCII U+007f:0xc1bf::highest obfuscated ASCII U+0080:0xc280:\[u0080]€:lowest two-byte U+07FF:0xdfbf:\[u07FF]߿:highest two-byte :0xc278:x:ASCII instead of continuation :0xc2c380:À:start byte instead of continuation .TE .SS Three-byte range .TS tab(:); l l l l. U+0000:0xe08080::lowest obfuscated ASCII U+007f:0xe081bf::highest obfuscated ASCII U+0080:0xe08280::lowest obfuscated two-byte U+07FF:0xe09fbf::highest obfuscated two-byte U+0800:0xe0a080:\[u0800]ࠀ:lowest three-byte U+0FFF:0xe0bfbf:\[u0FFF]࿿:end of first start byte U+1000:0xe18080:\[u1000]က:begin of second start byte U+CFFF:0xecbfbf:\[uCFFF]쿿:end of last normal start byte U+D000:0xed8080:\[uD000]퀀:begin of last start byte U+D7FF:0xed9fbf:\[uD7FF]퟿:highest public three-byte U+D800:0xeda080:\[uD800]:lowest surrogate U+DFFF:0xedbfbf:\[uDFFF]:highest surrogate U+E000:0xee8080:\[uE000]:lowest private use U+F8FF:0xefa3bf:\[uF8FF]:highest private use U+F900:0xefa480:\[uF900]豈:lowest post-private U+FFFF:0xefbfbf:\[uFFFF]￿:highest three-byte .TE .SS Four-byte range .TS tab(:); l l l l. U+0000:0xf0808080::lowest obfuscated ASCII U+007f:0xf08081bf::highest obfuscated ASCII U+0080:0xf0808280::lowest obfuscated two-byte U+07FF:0xf0809fbf::highest obfuscated two-byte U+0800:0xf080a080::lowest obfuscated three-byte U+FFFF:0xf08fbfbf::highest obfuscated three-byte U+10000:0xf0908080:\[u10000]𐀀:lowest four-byte U+3FFFF:0xf0bfbfbf:\[u3FFFF]𿿿:end of first start byte U+40000:0xf1808080:\[u40000]񀀀:begin of second start byte U+EFFFF:0xf2bfbfbf:\[uEFFFF]򿿿:highest public character U+F0000:0xf3808080:\[uF0000]󀀀:lowest plane 15 private use U+FFFFF:0xf3bfbfbf:\[uFFFFF]󿿿:highest plane 15 private use U+100000:0xf4808080:\[u100000]􀀀:lowest plane 16 private use U+10FFFF:0xf48fbfbf:\[u10FFFF]􏿿:highest valid four-byte U+110000:0xf4908080:\[u110000]:lowest beyond Unicode U+13FFFF:0xf4bfbfbf:\[u13FFFF]:end of last start byte U+140000:0xf5808080:\[u140000]:lowest invalid start byte U+1FFFFF:0xf7bfbfbf:\[u1FFFFF]:highest invalid four-byte U+200000:0xf888808080:\[u200000]:lowest five-byte .TE ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/input.out_ascii��������������������������������������������������0100644�0001753�0001753�00000006445�14121400034�0022424�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-INPUT(1) General Commands Manual CHAR-UNICODE-INPUT(1) NNAAMMEE char-unicode-input - Unicode characters in the input file DDEESSCCRRIIPPTTIIOONN lowest valid: <80> OOnnee--bbyyttee rraannggee U+0000 0x00 ? lowest ASCII U+001f 0x1f ? highest ASCII control character U+007f 0x7f ? highest ASCII 0x80 ? leading lowest continuation 0xbf ? leading highest continuation TTwwoo--bbyyttee rraannggee U+0000 0xc080 ?? lowest obfuscated ASCII U+007f 0xc1bf ?? highest obfuscated ASCII U+0080 0xc280 <80><80> lowest two-byte U+07FF 0xdfbf highest two-byte 0xc278 ?x ASCII instead of continuation 0xc2c380 ?`A start byte instead of continuation TThhrreeee--bbyyttee rraannggee U+0000 0xe08080 ??? lowest obfuscated ASCII U+007f 0xe081bf ??? highest obfuscated ASCII U+0080 0xe08280 ??? lowest obfuscated two-byte U+07FF 0xe09fbf ??? highest obfuscated two-byte U+0800 0xe0a080 lowest three-byte U+0FFF 0xe0bfbf end of first start byte U+1000 0xe18080 begin of second start byte U+CFFF 0xecbfbf end of last normal start byte U+D000 0xed8080 begin of last start byte U+D7FF 0xed9fbf highest public three-byte U+D800 0xeda080 ??? lowest surrogate U+DFFF 0xedbfbf ??? highest surrogate U+E000 0xee8080 lowest private use U+F8FF 0xefa3bf highest private use U+F900 0xefa480 lowest post-private U+FFFF 0xefbfbf highest three-byte FFoouurr--bbyyttee rraannggee U+0000 0xf0808080 ???? lowest obfuscated ASCII U+007f 0xf08081bf ???? highest obfuscated ASCII U+0080 0xf0808280 ???? lowest obfuscated two-byte U+07FF 0xf0809fbf ???? highest obfuscated two-byte U+0800 0xf080a080 ???? lowest obfuscated three-byte U+FFFF 0xf08fbfbf ???? highest obfuscated three-byte U+10000 0xf0908080 lowest four-byte U+3FFFF 0xf0bfbfbf end of first start byte U+40000 0xf1808080 begin of second start byte U+EFFFF 0xf2bfbfbf highest public character U+F0000 0xf3808080 lowest plane 15 private use U+FFFFF 0xf3bfbfbf highest plane 15 private use U+100000 0xf4808080 lowest plane 16 private use U+10FFFF 0xf48fbfbf highest valid four-byte U+110000 0xf4908080 ???? lowest beyond Unicode U+13FFFF 0xf4bfbfbf ???? end of last start byte U+140000 0xf5808080 ???? lowest invalid start byte U+1FFFFF 0xf7bfbfbf ???? highest invalid four-byte U+200000 0xf888808080 ????? lowest five-byte OpenBSD June 2, 2021 CHAR-UNICODE-INPUT(1) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/input.out_lint���������������������������������������������������0100644�0001753�0001753�00000011463�14121400034�0022276�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: input.in:11:21: ERROR: skipping bad character: 0x0 mandoc: input.in:12:21: ERROR: skipping bad character: 0x1f mandoc: input.in:13:21: ERROR: skipping bad character: 0x7f mandoc: input.in:14:7: ERROR: skipping bad character: 0x80 mandoc: input.in:15:7: ERROR: skipping bad character: 0xbf mandoc: input.in:21:15: ERROR: skipping bad character: 0xc0 mandoc: input.in:21:16: ERROR: skipping bad character: 0x80 mandoc: input.in:22:15: ERROR: skipping bad character: 0xc1 mandoc: input.in:22:16: ERROR: skipping bad character: 0xbf mandoc: input.in:25:9: ERROR: skipping bad character: 0xc2 mandoc: input.in:26:11: ERROR: skipping bad character: 0xc2 mandoc: input.in:32:17: ERROR: skipping bad character: 0xc0 mandoc: input.in:32:18: ERROR: skipping bad character: 0x80 mandoc: input.in:32:19: ERROR: skipping bad character: 0x80 mandoc: input.in:33:17: ERROR: skipping bad character: 0xe0 mandoc: input.in:33:18: ERROR: skipping bad character: 0x81 mandoc: input.in:33:19: ERROR: skipping bad character: 0xbf mandoc: input.in:34:17: ERROR: skipping bad character: 0xe0 mandoc: input.in:34:18: ERROR: skipping bad character: 0x82 mandoc: input.in:34:19: ERROR: skipping bad character: 0x80 mandoc: input.in:35:17: ERROR: skipping bad character: 0xe0 mandoc: input.in:35:18: ERROR: skipping bad character: 0x9f mandoc: input.in:35:19: ERROR: skipping bad character: 0xbf mandoc: input.in:42:25: ERROR: skipping bad character: 0xed mandoc: input.in:42:26: ERROR: skipping bad character: 0xa0 mandoc: input.in:42:27: ERROR: skipping bad character: 0x80 mandoc: input.in:42:17: WARNING: invalid escape sequence: \[uD800] mandoc: input.in:43:25: ERROR: skipping bad character: 0xed mandoc: input.in:43:26: ERROR: skipping bad character: 0xbf mandoc: input.in:43:27: ERROR: skipping bad character: 0xbf mandoc: input.in:43:17: WARNING: invalid escape sequence: \[uDFFF] mandoc: input.in:53:19: ERROR: skipping bad character: 0xf0 mandoc: input.in:53:20: ERROR: skipping bad character: 0x80 mandoc: input.in:53:21: ERROR: skipping bad character: 0x80 mandoc: input.in:53:22: ERROR: skipping bad character: 0x80 mandoc: input.in:54:19: ERROR: skipping bad character: 0xf0 mandoc: input.in:54:20: ERROR: skipping bad character: 0x80 mandoc: input.in:54:21: ERROR: skipping bad character: 0x81 mandoc: input.in:54:22: ERROR: skipping bad character: 0xbf mandoc: input.in:55:19: ERROR: skipping bad character: 0xf0 mandoc: input.in:55:20: ERROR: skipping bad character: 0x80 mandoc: input.in:55:21: ERROR: skipping bad character: 0x82 mandoc: input.in:55:22: ERROR: skipping bad character: 0x80 mandoc: input.in:56:19: ERROR: skipping bad character: 0xf0 mandoc: input.in:56:20: ERROR: skipping bad character: 0x80 mandoc: input.in:56:21: ERROR: skipping bad character: 0x9f mandoc: input.in:56:22: ERROR: skipping bad character: 0xbf mandoc: input.in:57:19: ERROR: skipping bad character: 0xf0 mandoc: input.in:57:20: ERROR: skipping bad character: 0x80 mandoc: input.in:57:21: ERROR: skipping bad character: 0xa0 mandoc: input.in:57:22: ERROR: skipping bad character: 0x80 mandoc: input.in:58:19: ERROR: skipping bad character: 0xf0 mandoc: input.in:58:20: ERROR: skipping bad character: 0x8f mandoc: input.in:58:21: ERROR: skipping bad character: 0xbf mandoc: input.in:58:22: ERROR: skipping bad character: 0xbf mandoc: input.in:67:31: ERROR: skipping bad character: 0xf4 mandoc: input.in:67:32: ERROR: skipping bad character: 0x90 mandoc: input.in:67:33: ERROR: skipping bad character: 0x80 mandoc: input.in:67:34: ERROR: skipping bad character: 0x80 mandoc: input.in:67:21: WARNING: invalid escape sequence: \[u110000] mandoc: input.in:68:31: ERROR: skipping bad character: 0xf4 mandoc: input.in:68:32: ERROR: skipping bad character: 0xbf mandoc: input.in:68:33: ERROR: skipping bad character: 0xbf mandoc: input.in:68:34: ERROR: skipping bad character: 0xbf mandoc: input.in:68:21: WARNING: invalid escape sequence: \[u13FFFF] mandoc: input.in:69:31: ERROR: skipping bad character: 0xf5 mandoc: input.in:69:32: ERROR: skipping bad character: 0x80 mandoc: input.in:69:33: ERROR: skipping bad character: 0x80 mandoc: input.in:69:34: ERROR: skipping bad character: 0x80 mandoc: input.in:69:21: WARNING: invalid escape sequence: \[u140000] mandoc: input.in:70:31: ERROR: skipping bad character: 0xf7 mandoc: input.in:70:32: ERROR: skipping bad character: 0xbf mandoc: input.in:70:33: ERROR: skipping bad character: 0xbf mandoc: input.in:70:34: ERROR: skipping bad character: 0xbf mandoc: input.in:70:21: WARNING: invalid escape sequence: \[u1FFFFF] mandoc: input.in:71:33: ERROR: skipping bad character: 0xf8 mandoc: input.in:71:34: ERROR: skipping bad character: 0x88 mandoc: input.in:71:35: ERROR: skipping bad character: 0x80 mandoc: input.in:71:36: ERROR: skipping bad character: 0x80 mandoc: input.in:71:37: ERROR: skipping bad character: 0x80 mandoc: input.in:71:23: WARNING: invalid escape sequence: \[u200000] �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/input.out_utf8���������������������������������������������������0100644�0001753�0001753�00000006447�14121400034�0022224�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-INPUT(1) General Commands Manual CHAR-UNICODE-INPUT(1) NNAAMMEE char-unicode-input - Unicode characters in the input file DDEESSCCRRIIPPTTIIOONN lowest valid: � OOnnee--bbyyttee rraannggee U+0000 0x00 �? lowest ASCII U+001f 0x1f �? highest ASCII control character U+007f 0x7f �? highest ASCII 0x80 ? leading lowest continuation 0xbf ? leading highest continuation TTwwoo--bbyyttee rraannggee U+0000 0xc080 ?? lowest obfuscated ASCII U+007f 0xc1bf ?? highest obfuscated ASCII U+0080 0xc280 �� lowest two-byte U+07FF 0xdfbf ߿߿ highest two-byte 0xc278 ?x ASCII instead of continuation 0xc2c380 ?À start byte instead of continuation TThhrreeee--bbyyttee rraannggee U+0000 0xe08080 ??? lowest obfuscated ASCII U+007f 0xe081bf ??? highest obfuscated ASCII U+0080 0xe08280 ??? lowest obfuscated two-byte U+07FF 0xe09fbf ??? highest obfuscated two-byte U+0800 0xe0a080 ࠀࠀ lowest three-byte U+0FFF 0xe0bfbf ࿿࿿ end of first start byte U+1000 0xe18080 ကက begin of second start byte U+CFFF 0xecbfbf 쿿쿿 end of last normal start byte U+D000 0xed8080 퀀퀀 begin of last start byte U+D7FF 0xed9fbf ퟿퟿ highest public three-byte U+D800 0xeda080 ??? lowest surrogate U+DFFF 0xedbfbf ??? highest surrogate U+E000 0xee8080  lowest private use U+F8FF 0xefa3bf  highest private use U+F900 0xefa480 豈豈 lowest post-private U+FFFF 0xefbfbf ￿￿ highest three-byte FFoouurr--bbyyttee rraannggee U+0000 0xf0808080 ???? lowest obfuscated ASCII U+007f 0xf08081bf ???? highest obfuscated ASCII U+0080 0xf0808280 ???? lowest obfuscated two-byte U+07FF 0xf0809fbf ???? highest obfuscated two-byte U+0800 0xf080a080 ???? lowest obfuscated three-byte U+FFFF 0xf08fbfbf ???? highest obfuscated three-byte U+10000 0xf0908080 𐀀𐀀 lowest four-byte U+3FFFF 0xf0bfbfbf 𿿿𿿿 end of first start byte U+40000 0xf1808080 񀀀񀀀 begin of second start byte U+EFFFF 0xf2bfbfbf 󯿿򿿿 highest public character U+F0000 0xf3808080 󰀀󀀀 lowest plane 15 private use U+FFFFF 0xf3bfbfbf 󿿿󿿿 highest plane 15 private use U+100000 0xf4808080 􀀀􀀀 lowest plane 16 private use U+10FFFF 0xf48fbfbf 􏿿􏿿 highest valid four-byte U+110000 0xf4908080 ???? lowest beyond Unicode U+13FFFF 0xf4bfbfbf ???? end of last start byte U+140000 0xf5808080 ???? lowest invalid start byte U+1FFFFF 0xf7bfbfbf ???? highest invalid four-byte U+200000 0xf888808080 ????? lowest five-byte OpenBSD June 2, 2021 CHAR-UNICODE-INPUT(1) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/invalid.in�������������������������������������������������������0100644�0001753�0001753�00000000701�13136670124�0021345�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: invalid.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CHAR-UNICODE-INVALID 1 .Os .Sh NAME .Nm char-unicode-invalid .Nd invalid unicode characters .Sh DESCRIPTION .Bd -unfilled BEGINTEST too short: >\[u2B].\[u02B]< just right: >\[u002B]< too long: >\[u0002B].\[u00002B].\[u000002B]< too large: >\[u110000].\[u200000].\[u1000000]< trailing garbage: >\[u1234g]< not unicode: >\[ul].\[ua].\[uA]< ENDTEST .Ed ���������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/invalid.out_ascii������������������������������������������������0100644�0001753�0001753�00000000725�13136670124�0022724�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-INVALID(1) General Commands Manual CHAR-UNICODE-INVALID(1) NNAAMMEE cchhaarr--uunniiccooddee--iinnvvaalliidd - invalid unicode characters DDEESSCCRRIIPPTTIIOONN BEGINTEST too short: >.< just right: >+< too long: >..< too large: >..< trailing garbage: >< not unicode: >_.|^.=^< ENDTEST OpenBSD July 4, 2017 OpenBSD �������������������������������������������mandoc-1.14.6/regress/char/unicode/invalid.out_html�������������������������������������������������0100644�0001753�0001753�00000000232�13634440765�0022602�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������too short: >.< just right: >+< too long: >..< too large: >..< trailing garbage: >< not unicode: >_.↑.⇑< ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/invalid.out_lint�������������������������������������������������0100644�0001753�0001753�00000001170�13136670124�0022575�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: invalid.in:11:20: WARNING: invalid escape sequence: \[u02B] mandoc: invalid.in:11:13: WARNING: invalid escape sequence: \[u2B] mandoc: invalid.in:13:33: WARNING: invalid escape sequence: \[u000002B] mandoc: invalid.in:13:22: WARNING: invalid escape sequence: \[u00002B] mandoc: invalid.in:13:12: WARNING: invalid escape sequence: \[u0002B] mandoc: invalid.in:14:35: WARNING: invalid escape sequence: \[u1000000] mandoc: invalid.in:14:24: WARNING: invalid escape sequence: \[u200000] mandoc: invalid.in:14:13: WARNING: invalid escape sequence: \[u110000] mandoc: invalid.in:15:20: WARNING: invalid escape sequence: \[u1234g] ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/invalid.out_utf8�������������������������������������������������0100644�0001753�0001753�00000000727�13136670124�0022524�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-INVALID(1) General Commands Manual CHAR-UNICODE-INVALID(1) NNAAMMEE cchhaarr--uunniiccooddee--iinnvvaalliidd – invalid unicode characters DDEESSCCRRIIPPTTIIOONN BEGINTEST too short: >.< just right: >+< too long: >..< too large: >..< trailing garbage: >< not unicode: >_.↑.⇑< ENDTEST OpenBSD July 4, 2017 OpenBSD �����������������������������������������mandoc-1.14.6/regress/char/unicode/latin1.in��������������������������������������������������������0100644�0001753�0001753�00000010055�13410267673�0021120�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: latin1.in,v 1.6 2018/08/21 16:01:38 schwarze Exp $ .TH CHAR-UNICODE-LATIN1 1 "August 21, 2018" .SH NAME char-unicode-latin1 \- Unicode characters in the ISO-8859-1 range .SH DESCRIPTION .nf BEGINTEST \[u00A1]\(r! INVERTED EXCLAMATION MARK \[u00A2]\(ct CENT SIGN \[u00A3]\(Po POUND SIGN \[u00A4]\(Cs CURRENCY SIGN \[u00A5]\(Ye YEN SIGN \[u00A6]\(bb BROKEN BAR \[u00A7]\(sc SECTION SIGN \[u00A8]\(ad DIAERESIS \[u00A9]\(co COPYRIGHT SIGN \[u00AA]\(Of FEMININE ORDINAL INDICATOR \[u00AB]\(Fo LEFT-POINTING DOUBLE ANGLE QUOTATION MARK \[u00AC]\(no\[tno] NOT SIGN \[u00AD] SOFT HYPHEN \[u00AE]\(rg REGISTERED SIGN \[u00B0]\(de DEGREE SIGN \[u00B1]\(+-\[t+-] PLUS-MINUS SIGN \[u00B2]\(S2 SUPERSCRIPT TWO \[u00B3]\(S3 SUPERSCRIPT THREE \[u00B4]\'\(aa ACUTE ACCENT \[u00B5]\(mc MICRO SIGN \[u00B6]\(ps PILCROW SIGN \[u00B7]\(pc MIDDLE DOT \[u00B8]\(ac CEDILLA \[u00B9]\(S1 SUPERSCRIPT ONE \[u00BA]\(Om MASCULINE ORDINAL INDICATOR \[u00BB]\(Fc RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK \[u00BC]\(14 VULGAR FRACTION ONE QUARTER \[u00BD]\(12 VULGAR FRACTION ONE HALF \[u00BE]\(34 VULGAR FRACTION THREE QUARTERS \[u00BF]\(r? INVERTED QUESTION MARK \[u00C0]\(`A LATIN CAPITAL LETTER A WITH GRAVE \[u00C1]\('A LATIN CAPITAL LETTER A WITH ACUTE \[u00C2]\(^A LATIN CAPITAL LETTER A WITH CIRCUMFLEX \[u00C3]\(~A LATIN CAPITAL LETTER A WITH TILDE \[u00C4]\(:A LATIN CAPITAL LETTER A WITH DIAERESIS \[u00C5]\(oA LATIN CAPITAL LETTER A WITH RING ABOVE \[u00C6]\(AE LATIN CAPITAL LETTER AE \[u00C7]\(,C LATIN CAPITAL LETTER C WITH CEDILLA \[u00C8]\(`E LATIN CAPITAL LETTER E WITH GRAVE \[u00C9]\('E LATIN CAPITAL LETTER E WITH ACUTE \[u00CA]\(^E LATIN CAPITAL LETTER E WITH CIRCUMFLEX \[u00CB]\(:E LATIN CAPITAL LETTER E WITH DIAERESIS \[u00CC]\(`I LATIN CAPITAL LETTER I WITH GRAVE \[u00CD]\('I LATIN CAPITAL LETTER I WITH ACUTE \[u00CE]\(^I LATIN CAPITAL LETTER I WITH CIRCUMFLEX \[u00CF]\(:I LATIN CAPITAL LETTER I WITH DIAERESIS \[u00D0]\(-D LATIN CAPITAL LETTER ETH \[u00D1]\(~N LATIN CAPITAL LETTER N WITH TILDE \[u00D2]\(`O LATIN CAPITAL LETTER O WITH GRAVE \[u00D3]\('O LATIN CAPITAL LETTER O WITH ACUTE \[u00D4]\(^O LATIN CAPITAL LETTER O WITH CIRCUMFLEX \[u00D5]\(~O LATIN CAPITAL LETTER O WITH TILDE \[u00D6]\(:O LATIN CAPITAL LETTER O WITH DIAERESIS \[u00D7]\(mu\[tmu] MULTIPLICATION SIGN \[u00D8]\(/O LATIN CAPITAL LETTER O WITH STROKE \[u00D9]\(`U LATIN CAPITAL LETTER U WITH GRAVE \[u00DA]\('U LATIN CAPITAL LETTER U WITH ACUTE \[u00DB]\(^U LATIN CAPITAL LETTER U WITH CIRCUMFLEX \[u00DC]\(:U LATIN CAPITAL LETTER U WITH DIAERESIS \[u00DD]\('Y LATIN CAPITAL LETTER Y WITH ACUTE \[u00DE]\(TP LATIN CAPITAL LETTER THORN \[u00DF]\(ss LATIN SMALL LETTER SHARP S \[u00E0]\(`a LATIN SMALL LETTER A WITH GRAVE \[u00E1]\('a LATIN SMALL LETTER A WITH ACUTE \[u00E2]\(^a LATIN SMALL LETTER A WITH CIRCUMFLEX \[u00E3]\(~a LATIN SMALL LETTER A WITH TILDE \[u00E4]\(:a LATIN SMALL LETTER A WITH DIAERESIS \[u00E5]\(oa LATIN SMALL LETTER A WITH RING ABOVE \[u00E6]\(ae LATIN SMALL LETTER AE \[u00E7]\(,c LATIN SMALL LETTER C WITH CEDILLA \[u00E8]\(`e LATIN SMALL LETTER E WITH GRAVE \[u00E9]\('e LATIN SMALL LETTER E WITH ACUTE \[u00EA]\(^e LATIN SMALL LETTER E WITH CIRCUMFLEX \[u00EB]\(:e LATIN SMALL LETTER E WITH DIAERESIS \[u00EC]\(`i LATIN SMALL LETTER I WITH GRAVE \[u00ED]\('i LATIN SMALL LETTER I WITH ACUTE \[u00EE]\(^i LATIN SMALL LETTER I WITH CIRCUMFLEX \[u00EF]\(:i LATIN SMALL LETTER I WITH DIAERESIS \[u00F0]\(Sd LATIN SMALL LETTER ETH \[u00F1]\(~n LATIN SMALL LETTER N WITH TILDE \[u00F2]\(`o LATIN SMALL LETTER O WITH GRAVE \[u00F3]\('o LATIN SMALL LETTER O WITH ACUTE \[u00F4]\(^o LATIN SMALL LETTER O WITH CIRCUMFLEX \[u00F5]\(~o LATIN SMALL LETTER O WITH TILDE \[u00F6]\(:o LATIN SMALL LETTER O WITH DIAERESIS \[u00F7]\(di\[tdi] DIVISION SIGN \[u00F8]\(/o LATIN SMALL LETTER O WITH STROKE \[u00F9]\(`u LATIN SMALL LETTER U WITH GRAVE \[u00FA]\('u LATIN SMALL LETTER U WITH ACUTE \[u00FB]\(^u LATIN SMALL LETTER U WITH CIRCUMFLEX \[u00FC]\(:u LATIN SMALL LETTER U WITH DIAERESIS \[u00FD]\('y LATIN SMALL LETTER Y WITH ACUTE \[u00FE]\(Tp LATIN SMALL LETTER THORN \[u00FF]\(:y LATIN SMALL LETTER Y WITH DIAERESIS ENDTEST .fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/latin1.out_ascii�������������������������������������������������0100644�0001753�0001753�00000010531�14121400034�0022444�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-LATIN1(1) General Commands Manual CHAR-UNICODE-LATIN1(1) NNAAMMEE char-unicode-latin1 - Unicode characters in the ISO-8859-1 range DDEESSCCRRIIPPTTIIOONN BEGINTEST !! INVERTED EXCLAMATION MARK /c/c CENT SIGN -L-L POUND SIGN oxox CURRENCY SIGN =Y=Y YEN SIGN || BROKEN BAR
SECTION SIGN "" DIAERESIS (C)(C) COPYRIGHT SIGN _a_a FEMININE ORDINAL INDICATOR <<<< LEFT-POINTING DOUBLE ANGLE QUOTATION MARK ~~~ NOT SIGN SOFT HYPHEN (R)(R) REGISTERED SIGN DEGREE SIGN +-+-+- PLUS-MINUS SIGN ^2^2 SUPERSCRIPT TWO ^3^3 SUPERSCRIPT THREE ''' ACUTE ACCENT MICRO SIGN PILCROW SIGN .. MIDDLE DOT ,, CEDILLA ^1^1 SUPERSCRIPT ONE _o_o MASCULINE ORDINAL INDICATOR >>>> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK 1/41/4 VULGAR FRACTION ONE QUARTER 1/21/2 VULGAR FRACTION ONE HALF 3/43/4 VULGAR FRACTION THREE QUARTERS ?? INVERTED QUESTION MARK `A`A LATIN CAPITAL LETTER A WITH GRAVE 'A'A LATIN CAPITAL LETTER A WITH ACUTE ^A^A LATIN CAPITAL LETTER A WITH CIRCUMFLEX ~A~A LATIN CAPITAL LETTER A WITH TILDE "A"A LATIN CAPITAL LETTER A WITH DIAERESIS oAoA LATIN CAPITAL LETTER A WITH RING ABOVE AEAE LATIN CAPITAL LETTER AE ,C,C LATIN CAPITAL LETTER C WITH CEDILLA `E`E LATIN CAPITAL LETTER E WITH GRAVE 'E'E LATIN CAPITAL LETTER E WITH ACUTE ^E^E LATIN CAPITAL LETTER E WITH CIRCUMFLEX "E"E LATIN CAPITAL LETTER E WITH DIAERESIS `I`I LATIN CAPITAL LETTER I WITH GRAVE 'I'I LATIN CAPITAL LETTER I WITH ACUTE ^I^I LATIN CAPITAL LETTER I WITH CIRCUMFLEX "I"I LATIN CAPITAL LETTER I WITH DIAERESIS DhDh LATIN CAPITAL LETTER ETH ~N~N LATIN CAPITAL LETTER N WITH TILDE `O`O LATIN CAPITAL LETTER O WITH GRAVE 'O'O LATIN CAPITAL LETTER O WITH ACUTE ^O^O LATIN CAPITAL LETTER O WITH CIRCUMFLEX ~O~O LATIN CAPITAL LETTER O WITH TILDE "O"O LATIN CAPITAL LETTER O WITH DIAERESIS xxx MULTIPLICATION SIGN /O/O LATIN CAPITAL LETTER O WITH STROKE `U`U LATIN CAPITAL LETTER U WITH GRAVE 'U'U LATIN CAPITAL LETTER U WITH ACUTE ^U^U LATIN CAPITAL LETTER U WITH CIRCUMFLEX "U"U LATIN CAPITAL LETTER U WITH DIAERESIS 'Y'Y LATIN CAPITAL LETTER Y WITH ACUTE ThTh LATIN CAPITAL LETTER THORN ssss LATIN SMALL LETTER SHARP S `a`a LATIN SMALL LETTER A WITH GRAVE 'a'a LATIN SMALL LETTER A WITH ACUTE ^a^a LATIN SMALL LETTER A WITH CIRCUMFLEX ~a~a LATIN SMALL LETTER A WITH TILDE "a"a LATIN SMALL LETTER A WITH DIAERESIS oaoa LATIN SMALL LETTER A WITH RING ABOVE aeae LATIN SMALL LETTER AE ,c,c LATIN SMALL LETTER C WITH CEDILLA `e`e LATIN SMALL LETTER E WITH GRAVE 'e'e LATIN SMALL LETTER E WITH ACUTE ^e^e LATIN SMALL LETTER E WITH CIRCUMFLEX "e"e LATIN SMALL LETTER E WITH DIAERESIS `i`i LATIN SMALL LETTER I WITH GRAVE 'i'i LATIN SMALL LETTER I WITH ACUTE ^i^i LATIN SMALL LETTER I WITH CIRCUMFLEX "i"i LATIN SMALL LETTER I WITH DIAERESIS dhdh LATIN SMALL LETTER ETH ~n~n LATIN SMALL LETTER N WITH TILDE `o`o LATIN SMALL LETTER O WITH GRAVE 'o'o LATIN SMALL LETTER O WITH ACUTE ^o^o LATIN SMALL LETTER O WITH CIRCUMFLEX ~o~o LATIN SMALL LETTER O WITH TILDE "o"o LATIN SMALL LETTER O WITH DIAERESIS /// DIVISION SIGN /o/o LATIN SMALL LETTER O WITH STROKE `u`u LATIN SMALL LETTER U WITH GRAVE 'u'u LATIN SMALL LETTER U WITH ACUTE ^u^u LATIN SMALL LETTER U WITH CIRCUMFLEX "u"u LATIN SMALL LETTER U WITH DIAERESIS 'y'y LATIN SMALL LETTER Y WITH ACUTE thth LATIN SMALL LETTER THORN "y"y LATIN SMALL LETTER Y WITH DIAERESIS ENDTEST OpenBSD August 21, 2018 CHAR-UNICODE-LATIN1(1) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/latin1.out_html��������������������������������������������������0100644�0001753�0001753�00000010315�13634440765�0022347�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������¡¡ INVERTED EXCLAMATION MARK ¢¢ CENT SIGN ££ POUND SIGN ¤¤ CURRENCY SIGN ¥¥ YEN SIGN ¦¦ BROKEN BAR §§ SECTION SIGN ¨¨ DIAERESIS ©© COPYRIGHT SIGN ªª FEMININE ORDINAL INDICATOR «« LEFT-POINTING DOUBLE ANGLE QUOTATION MARK ¬¬¬ NOT SIGN ­ SOFT HYPHEN ®® REGISTERED SIGN °° DEGREE SIGN ±±± PLUS-MINUS SIGN ²² SUPERSCRIPT TWO ³³ SUPERSCRIPT THREE ´´´ ACUTE ACCENT µµ MICRO SIGN ¶¶ PILCROW SIGN ·· MIDDLE DOT ¸¸ CEDILLA ¹¹ SUPERSCRIPT ONE ºº MASCULINE ORDINAL INDICATOR »» RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK ¼¼ VULGAR FRACTION ONE QUARTER ½½ VULGAR FRACTION ONE HALF ¾¾ VULGAR FRACTION THREE QUARTERS ¿¿ INVERTED QUESTION MARK ÀÀ LATIN CAPITAL LETTER A WITH GRAVE ÁÁ LATIN CAPITAL LETTER A WITH ACUTE  LATIN CAPITAL LETTER A WITH CIRCUMFLEX Ãà LATIN CAPITAL LETTER A WITH TILDE ÄÄ LATIN CAPITAL LETTER A WITH DIAERESIS ÅÅ LATIN CAPITAL LETTER A WITH RING ABOVE ÆÆ LATIN CAPITAL LETTER AE ÇÇ LATIN CAPITAL LETTER C WITH CEDILLA ÈÈ LATIN CAPITAL LETTER E WITH GRAVE ÉÉ LATIN CAPITAL LETTER E WITH ACUTE ÊÊ LATIN CAPITAL LETTER E WITH CIRCUMFLEX ËË LATIN CAPITAL LETTER E WITH DIAERESIS ÌÌ LATIN CAPITAL LETTER I WITH GRAVE ÍÍ LATIN CAPITAL LETTER I WITH ACUTE ÎÎ LATIN CAPITAL LETTER I WITH CIRCUMFLEX ÏÏ LATIN CAPITAL LETTER I WITH DIAERESIS ÐÐ LATIN CAPITAL LETTER ETH ÑÑ LATIN CAPITAL LETTER N WITH TILDE ÒÒ LATIN CAPITAL LETTER O WITH GRAVE ÓÓ LATIN CAPITAL LETTER O WITH ACUTE ÔÔ LATIN CAPITAL LETTER O WITH CIRCUMFLEX ÕÕ LATIN CAPITAL LETTER O WITH TILDE ÖÖ LATIN CAPITAL LETTER O WITH DIAERESIS ××× MULTIPLICATION SIGN ØØ LATIN CAPITAL LETTER O WITH STROKE ÙÙ LATIN CAPITAL LETTER U WITH GRAVE ÚÚ LATIN CAPITAL LETTER U WITH ACUTE ÛÛ LATIN CAPITAL LETTER U WITH CIRCUMFLEX ÜÜ LATIN CAPITAL LETTER U WITH DIAERESIS ÝÝ LATIN CAPITAL LETTER Y WITH ACUTE ÞÞ LATIN CAPITAL LETTER THORN ßß LATIN SMALL LETTER SHARP S àà LATIN SMALL LETTER A WITH GRAVE áá LATIN SMALL LETTER A WITH ACUTE ââ LATIN SMALL LETTER A WITH CIRCUMFLEX ãã LATIN SMALL LETTER A WITH TILDE ää LATIN SMALL LETTER A WITH DIAERESIS åå LATIN SMALL LETTER A WITH RING ABOVE ææ LATIN SMALL LETTER AE çç LATIN SMALL LETTER C WITH CEDILLA èè LATIN SMALL LETTER E WITH GRAVE éé LATIN SMALL LETTER E WITH ACUTE êê LATIN SMALL LETTER E WITH CIRCUMFLEX ëë LATIN SMALL LETTER E WITH DIAERESIS ìì LATIN SMALL LETTER I WITH GRAVE íí LATIN SMALL LETTER I WITH ACUTE îî LATIN SMALL LETTER I WITH CIRCUMFLEX ïï LATIN SMALL LETTER I WITH DIAERESIS ðð LATIN SMALL LETTER ETH ññ LATIN SMALL LETTER N WITH TILDE òò LATIN SMALL LETTER O WITH GRAVE óó LATIN SMALL LETTER O WITH ACUTE ôô LATIN SMALL LETTER O WITH CIRCUMFLEX õõ LATIN SMALL LETTER O WITH TILDE öö LATIN SMALL LETTER O WITH DIAERESIS ÷÷÷ DIVISION SIGN øø LATIN SMALL LETTER O WITH STROKE ùù LATIN SMALL LETTER U WITH GRAVE úú LATIN SMALL LETTER U WITH ACUTE ûû LATIN SMALL LETTER U WITH CIRCUMFLEX üü LATIN SMALL LETTER U WITH DIAERESIS ýý LATIN SMALL LETTER Y WITH ACUTE þþ LATIN SMALL LETTER THORN ÿÿ LATIN SMALL LETTER Y WITH DIAERESIS �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/latin1.out_utf8��������������������������������������������������0100644�0001753�0001753�00000010314�14121400034�0022241�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-LATIN1(1) General Commands Manual CHAR-UNICODE-LATIN1(1) NNAAMMEE char-unicode-latin1 - Unicode characters in the ISO-8859-1 range DDEESSCCRRIIPPTTIIOONN BEGINTEST ¡¡ INVERTED EXCLAMATION MARK ¢¢ CENT SIGN ££ POUND SIGN ¤¤ CURRENCY SIGN ¥¥ YEN SIGN ¦¦ BROKEN BAR §§ SECTION SIGN ¨¨ DIAERESIS ©© COPYRIGHT SIGN ªª FEMININE ORDINAL INDICATOR «« LEFT-POINTING DOUBLE ANGLE QUOTATION MARK ¬¬¬ NOT SIGN ­ SOFT HYPHEN ®® REGISTERED SIGN °° DEGREE SIGN ±±± PLUS-MINUS SIGN ²² SUPERSCRIPT TWO ³³ SUPERSCRIPT THREE ´´´ ACUTE ACCENT µµ MICRO SIGN ¶¶ PILCROW SIGN ·· MIDDLE DOT ¸¸ CEDILLA ¹¹ SUPERSCRIPT ONE ºº MASCULINE ORDINAL INDICATOR »» RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK ¼¼ VULGAR FRACTION ONE QUARTER ½½ VULGAR FRACTION ONE HALF ¾¾ VULGAR FRACTION THREE QUARTERS ¿¿ INVERTED QUESTION MARK ÀÀ LATIN CAPITAL LETTER A WITH GRAVE ÁÁ LATIN CAPITAL LETTER A WITH ACUTE  LATIN CAPITAL LETTER A WITH CIRCUMFLEX Ãà LATIN CAPITAL LETTER A WITH TILDE ÄÄ LATIN CAPITAL LETTER A WITH DIAERESIS ÅÅ LATIN CAPITAL LETTER A WITH RING ABOVE ÆÆ LATIN CAPITAL LETTER AE ÇÇ LATIN CAPITAL LETTER C WITH CEDILLA ÈÈ LATIN CAPITAL LETTER E WITH GRAVE ÉÉ LATIN CAPITAL LETTER E WITH ACUTE ÊÊ LATIN CAPITAL LETTER E WITH CIRCUMFLEX ËË LATIN CAPITAL LETTER E WITH DIAERESIS ÌÌ LATIN CAPITAL LETTER I WITH GRAVE ÍÍ LATIN CAPITAL LETTER I WITH ACUTE ÎÎ LATIN CAPITAL LETTER I WITH CIRCUMFLEX ÏÏ LATIN CAPITAL LETTER I WITH DIAERESIS ÐÐ LATIN CAPITAL LETTER ETH ÑÑ LATIN CAPITAL LETTER N WITH TILDE ÒÒ LATIN CAPITAL LETTER O WITH GRAVE ÓÓ LATIN CAPITAL LETTER O WITH ACUTE ÔÔ LATIN CAPITAL LETTER O WITH CIRCUMFLEX ÕÕ LATIN CAPITAL LETTER O WITH TILDE ÖÖ LATIN CAPITAL LETTER O WITH DIAERESIS ××× MULTIPLICATION SIGN ØØ LATIN CAPITAL LETTER O WITH STROKE ÙÙ LATIN CAPITAL LETTER U WITH GRAVE ÚÚ LATIN CAPITAL LETTER U WITH ACUTE ÛÛ LATIN CAPITAL LETTER U WITH CIRCUMFLEX ÜÜ LATIN CAPITAL LETTER U WITH DIAERESIS ÝÝ LATIN CAPITAL LETTER Y WITH ACUTE ÞÞ LATIN CAPITAL LETTER THORN ßß LATIN SMALL LETTER SHARP S àà LATIN SMALL LETTER A WITH GRAVE áá LATIN SMALL LETTER A WITH ACUTE ââ LATIN SMALL LETTER A WITH CIRCUMFLEX ãã LATIN SMALL LETTER A WITH TILDE ää LATIN SMALL LETTER A WITH DIAERESIS åå LATIN SMALL LETTER A WITH RING ABOVE ææ LATIN SMALL LETTER AE çç LATIN SMALL LETTER C WITH CEDILLA èè LATIN SMALL LETTER E WITH GRAVE éé LATIN SMALL LETTER E WITH ACUTE êê LATIN SMALL LETTER E WITH CIRCUMFLEX ëë LATIN SMALL LETTER E WITH DIAERESIS ìì LATIN SMALL LETTER I WITH GRAVE íí LATIN SMALL LETTER I WITH ACUTE îî LATIN SMALL LETTER I WITH CIRCUMFLEX ïï LATIN SMALL LETTER I WITH DIAERESIS ðð LATIN SMALL LETTER ETH ññ LATIN SMALL LETTER N WITH TILDE òò LATIN SMALL LETTER O WITH GRAVE óó LATIN SMALL LETTER O WITH ACUTE ôô LATIN SMALL LETTER O WITH CIRCUMFLEX õõ LATIN SMALL LETTER O WITH TILDE öö LATIN SMALL LETTER O WITH DIAERESIS ÷÷÷ DIVISION SIGN øø LATIN SMALL LETTER O WITH STROKE ùù LATIN SMALL LETTER U WITH GRAVE úú LATIN SMALL LETTER U WITH ACUTE ûû LATIN SMALL LETTER U WITH CIRCUMFLEX üü LATIN SMALL LETTER U WITH DIAERESIS ýý LATIN SMALL LETTER Y WITH ACUTE þþ LATIN SMALL LETTER THORN ÿÿ LATIN SMALL LETTER Y WITH DIAERESIS ENDTEST OpenBSD August 21, 2018 CHAR-UNICODE-LATIN1(1) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/latin1diff.in����������������������������������������������������0100644�0001753�0001753�00000000402�13410267673�0021744�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: latin1diff.in,v 1.4 2018/08/21 16:01:38 schwarze Exp $ .TH CHAR-UNICODE-LATIN1DIFF 1 "August 21, 2018" .SH NAME char-unicode-latin1diff \- Unicode characters in the ISO-8859-1 range .SH DESCRIPTION .nf BEGINTEST \[u00AF]\(a- MACRON ENDTEST .fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/man.in�����������������������������������������������������������0100644�0001753�0001753�00000000547�13136670124�0020502�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: man.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .TH CHAR-UNICODE-MAN 1 "October 13, 2014" .SH NAME char-unicode-mdoc \- unicode characters in man code .SH DESCRIPTION Copyright symbol: \[u00A9] = \C'u00A9' .PP m-dash: \[u2014] = \C'u2014' .PP nabla: \[u1D6C1] = \C'u1D6C1' .PP not really Unicode: up arrows: \(ua\(uA = \[ua]\[uA] = \C'ua'\C'uA' ���������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/latin1diff.out_ascii���������������������������������������������0100644�0001753�0001753�00000000517�14121400034�0023300�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-LATIN1DIFF(1) General Commands Manual CHAR-UNICODE-LATIN1DIFF(1) NNAAMMEE char-unicode-latin1diff - Unicode characters in the ISO-8859-1 range DDEESSCCRRIIPPTTIIOONN BEGINTEST -- MACRON ENDTEST OpenBSD August 21, 2018 CHAR-UNICODE-LATIN1DIFF(1) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/latin1diff.out_html����������������������������������������������0100644�0001753�0001753�00000000030�13634440765�0023171�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������¯¯ MACRON ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/latin1diff.out_utf8����������������������������������������������0100644�0001753�0001753�00000000521�14121400034�0023071�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-LATIN1DIFF(1) General Commands Manual CHAR-UNICODE-LATIN1DIFF(1) NNAAMMEE char-unicode-latin1diff - Unicode characters in the ISO-8859-1 range DDEESSCCRRIIPPTTIIOONN BEGINTEST ¯¯ MACRON ENDTEST OpenBSD August 21, 2018 CHAR-UNICODE-LATIN1DIFF(1) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/man.out_utf8�����������������������������������������������������0100644�0001753�0001753�00000000640�14121400034�0021625�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-MAN(1) General Commands Manual CHAR-UNICODE-MAN(1) NNAAMMEE char-unicode-mdoc - unicode characters in man code DDEESSCCRRIIPPTTIIOONN Copyright symbol: © = © m-dash: — = — nabla: 𝛁 = 𝛁 not really Unicode: up arrows: ↑⇑ = ↑⇑ = ↑⇑ OpenBSD October 13, 2014 CHAR-UNICODE-MAN(1) ������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/mdoc.in����������������������������������������������������������0100644�0001753�0001753�00000000575�13136670124�0020652�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: mdoc.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CHAR-UNICODE-MDOC 1 .Os .Sh NAME .Nm char-unicode-mdoc .Nd unicode characters in mdoc code .Sh DESCRIPTION Copyright symbol: \[u00A9] = \C'u00A9' .Pp m-dash: \[u2014] = \C'u2014' .Pp nabla: \[u1D6C1] = \C'u1D6C1' .Pp not really Unicode: up arrows: \(ua\(uA = \[ua]\[uA] = \C'ua'\C'uA' �����������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/mdoc.out_utf8����������������������������������������������������0100644�0001753�0001753�00000000673�13136670124�0022020�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-MDOC(1) General Commands Manual CHAR-UNICODE-MDOC(1) NNAAMMEE cchhaarr--uunniiccooddee--mmddoocc – unicode characters in mdoc code DDEESSCCRRIIPPTTIIOONN Copyright symbol: © = © m-dash: — = — nabla: 𝛁 = 𝛁 not really Unicode: up arrows: ↑⇑ = ↑⇑ = ↑⇑ OpenBSD July 4, 2017 OpenBSD ���������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/named.in���������������������������������������������������������0100644�0001753�0001753�00000013317�13410267673�0021020�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: named.in,v 1.10 2018/08/21 16:01:38 schwarze Exp $ .TH CHAR-UNICODE-NAMED 1 "August 21, 2018" .SH NAME char-unicode-named \- Unicode characters having named escapes .SH DESCRIPTION .nf BEGINTEST \[u0131]\(.i LATIN SMALL LETTER DOTLESS I \[u0132]\(IJ LATIN CAPITAL LIGATURE IJ \[u0133]\(ij LATIN SMALL LIGATURE IJ \[u0141]\(/L LATIN CAPITAL LETTER L WITH STROKE \[u0142]\(/l LATIN SMALL LETTER L WITH STROKE \[u0152]\(OE LATIN CAPITAL LIGATURE OE \[u0153]\(oe LATIN SMALL LIGATURE OE \[u0192]\(Fn LATIN SMALL LETTER F WITH HOOK \[u0237]\(.j LATIN SMALL LETTER DOTLESS J \[u02C7]\(ah CARON \[u02D8]\(ab BREVE \[u02D9]\(a. DOT ABOVE \[u02DA]\(ao RING ABOVE \[u02DB]\(ho OGONEK \[u02DD]\(a" DOUBLE ACUTE ACCENT \[u0391]\(*A GREEK CAPITAL LETTER ALPHA \[u0392]\(*B GREEK CAPITAL LETTER BETA \[u0393]\(*G GREEK CAPITAL LETTER GAMMA \[u0394]\(*D GREEK CAPITAL LETTER DELTA \[u0395]\(*E GREEK CAPITAL LETTER EPSILON \[u0396]\(*Z GREEK CAPITAL LETTER ZETA \[u0397]\(*Y GREEK CAPITAL LETTER ETA \[u0398]\(*H GREEK CAPITAL LETTER THETA \[u0399]\(*I GREEK CAPITAL LETTER IOTA \[u039A]\(*K GREEK CAPITAL LETTER KAPPA \[u039B]\(*L GREEK CAPITAL LETTER LAMDA \[u039C]\(*M GREEK CAPITAL LETTER MU \[u039D]\(*N GREEK CAPITAL LETTER NU \[u039E]\(*C GREEK CAPITAL LETTER XI \[u039F]\(*O GREEK CAPITAL LETTER OMICRON \[u03A0]\(*P GREEK CAPITAL LETTER PI \[u03A1]\(*R GREEK CAPITAL LETTER RHO \[u03A3]\(*S GREEK CAPITAL LETTER SIGMA \[u03A4]\(*T GREEK CAPITAL LETTER TAU \[u03A5]\(*U GREEK CAPITAL LETTER UPSILON \[u03A6]\(*F GREEK CAPITAL LETTER PHI \[u03A7]\(*X GREEK CAPITAL LETTER CHI \[u03A8]\(*Q GREEK CAPITAL LETTER PSI \[u03A9]\(*W GREEK CAPITAL LETTER OMEGA \[u03B1]\(*a GREEK SMALL LETTER ALPHA \[u03B2]\(*b GREEK SMALL LETTER BETA \[u03B3]\(*g GREEK SMALL LETTER GAMMA \[u03B4]\(*d GREEK SMALL LETTER DELTA \[u03B5]\(*e GREEK SMALL LETTER EPSILON \[u03B6]\(*z GREEK SMALL LETTER ZETA \[u03B7]\(*y GREEK SMALL LETTER ETA \[u03B8]\(*h GREEK SMALL LETTER THETA \[u03B9]\(*i GREEK SMALL LETTER IOTA \[u03BA]\(*k GREEK SMALL LETTER KAPPA \[u03BB]\(*l GREEK SMALL LETTER LAMDA \[u03BC]\(*m GREEK SMALL LETTER MU \[u03BD]\(*n GREEK SMALL LETTER NU \[u03BE]\(*c GREEK SMALL LETTER XI \[u03BF]\(*o GREEK SMALL LETTER OMICRON \[u03C0]\(*p GREEK SMALL LETTER PI \[u03C1]\(*r GREEK SMALL LETTER RHO \[u03C2]\(ts GREEK SMALL LETTER FINAL SIGMA \[u03C3]\(*s GREEK SMALL LETTER SIGMA \[u03C4]\(*t GREEK SMALL LETTER TAU \[u03C5]\(*u GREEK SMALL LETTER UPSILON \[u03C6]\(+f GREEK SMALL LETTER PHI \[u03C7]\(*x GREEK SMALL LETTER CHI \[u03C8]\(*q GREEK SMALL LETTER PSI \[u03C9]\(*w GREEK SMALL LETTER OMEGA \[u03D1]\(+h GREEK THETA SYMBOL \[u03D5]\(*f GREEK PHI SYMBOL \[u03D6]\(+p GREEK PI SYMBOL \[u03F5]\(+e GREEK LUNATE EPSILON SYMBOL \[u2010]\(hy HYPHEN \[u2013]\(en EN DASH \[u2014]\(em EM DASH \[u2018]\(oq LEFT SINGLE QUOTATION MARK \[u2019]\(cq RIGHT SINGLE QUOTATION MARK \[u201A]\(bq SINGLE LOW-9 QUOTATION MARK \[u201C]\(lq LEFT DOUBLE QUOTATION MARK \[u201D]\(rq RIGHT DOUBLE QUOTATION MARK \[u201E]\(Bq DOUBLE LOW-9 QUOTATION MARK \[u2020]\(dg DAGGER \[u2021]\(dd DOUBLE DAGGER \[u2022]\(bu BULLET \[u2030]\(%0 PER MILLE SIGN \[u2032]\(fm PRIME \[u2033]\(sd DOUBLE PRIME \[u2039]\(fo SINGLE LEFT-POINTING ANGLE QUOTATION MARK \[u203A]\(fc SINGLE RIGHT-POINTING ANGLE QUOTATION MARK \[u2044]\(f/ FRACTION SLASH \[u20AC]\(Eu\(eu EURO SIGN \[u2111]\(Im BLACK-LETTER CAPITAL I \[u2118]\(wp SCRIPT CAPITAL P \[u211C]\(Re BLACK-LETTER CAPITAL R \[u2122]\(tm TRADE MARK SIGN \[u2135]\(Ah ALEF SYMBOL \[u215B]\(18 VULGAR FRACTION ONE EIGHTH \[u215C]\(38 VULGAR FRACTION THREE EIGHTHS \[u215D]\(58 VULGAR FRACTION FIVE EIGHTHS \[u215E]\(78 VULGAR FRACTION SEVEN EIGHTHS \[u2190]\(<- LEFTWARDS ARROW \[u2191]\(ua UPWARDS ARROW \[u2192]\(-> RIGHTWARDS ARROW \[u2193]\(da DOWNWARDS ARROW \[u2194]\(<> LEFT RIGHT ARROW \[u21B5]\(CR DOWNWARDS ARROW WITH CORNER LEFTWARDS \[u21D0]\(lA LEFTWARDS DOUBLE ARROW \[u21D1]\(uA UPWARDS DOUBLE ARROW \[u21D2]\(rA RIGHTWARDS DOUBLE ARROW \[u21D3]\(dA DOWNWARDS DOUBLE ARROW \[u21D4]\(hA LEFT RIGHT DOUBLE ARROW \[u2200]\(fa FOR ALL \[u2202]\(pd PARTIAL DIFFERENTIAL \[u2203]\(te THERE EXISTS \[u2205]\(es EMPTY SET \[u2207]\(gr NABLA \[u2208]\(mo ELEMENT OF \[u2209]\(nm NOT AN ELEMENT OF \[u220B]\(st CONTAINS AS MEMBER \[u220F]\[product] N-ARY PRODUCT \[u2210]\[coproduct] N-ARY COPRODUCT \[u2211]\[sum] N-ARY SUMMATION \[u2212]\(mi MINUS SIGN \[u2213]\(-+ MINUS-OR-PLUS SIGN \[u2217]\(** ASTERISK OPERATOR \[u221A]\(sr SQUARE ROOT \[u221D]\(pt PROPORTIONAL TO \[u221E]\(if INFINITY \[u2220]\(/_ ANGLE \[u2227]\(AN LOGICAL AND \[u2228]\(OR LOGICAL OR \[u2229]\(ca INTERSECTION \[u222A]\(cu UNION \[u222B]\(is INTEGRAL \[u2234]\(tf\(3d THEREFORE \[u223C]\(ap TILDE OPERATOR \[u2243]\(|= ASYMPTOTICALLY EQUAL TO \[u2245]\(=~ APPROXIMATELY EQUAL TO \[u2248]\(~~\(~= ALMOST EQUAL TO \[u2260]\(!= NOT EQUAL TO \[u2261]\(== IDENTICAL TO \[u2262]\(ne NOT IDENTICAL TO \[u2264]\(<= LESS-THAN OR EQUAL TO \[u2265]\(>= GREATER-THAN OR EQUAL TO \[u2282]\(sb SUBSET OF \[u2283]\(sp SUPERSET OF \[u2284]\(nb NOT A SUBSET OF \[u2285]\(nc NOT A SUPERSET OF \[u2286]\(ib SUBSET OF OR EQUAL TO \[u2287]\(ip SUPERSET OF OR EQUAL TO \[u2295]\(c+ CIRCLED PLUS \[u2297]\(c* CIRCLED TIMES \[u22A5]\(pp UP TACK \[u22C5]\(md DOT OPERATOR \[u2308]\(lc LEFT CEILING \[u2309]\(rc RIGHT CEILING \[u230A]\(lf LEFT FLOOR \[u230B]\(rf RIGHT FLOOR \[u23AA]\(bv CURLY BRACKET EXTENSION \[u23AF]\(an HORIZONTAL LINE EXTENSION \[u2502]\(br BOX DRAWINGS LIGHT VERTICAL \[u25A1]\(sq WHITE SQUARE \[u25CA]\(lz LOZENGE \[u25CB]\(ci WHITE CIRCLE \[u261C]\(lh WHITE LEFT POINTING INDEX \[u261E]\(rh WHITE RIGHT POINTING INDEX \[u2660]\(SP BLACK SPADE SUIT \[u2663]\(CL BLACK CLUB SUIT \[u2665]\(HE BLACK HEART SUIT \[u2666]\(DI BLACK DIAMOND SUIT \[u27E8]\(la MATHEMATICAL LEFT ANGLE BRACKET \[u27E9]\(ra MATHEMATICAL RIGHT ANGLE BRACKET ENDTEST .fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/named.out_ascii��������������������������������������������������0100644�0001753�0001753�00000015166�14121400034�0022351�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-NAMED(1) General Commands Manual CHAR-UNICODE-NAMED(1) NNAAMMEE char-unicode-named - Unicode characters having named escapes DDEESSCCRRIIPPTTIIOONN BEGINTEST ii LATIN SMALL LETTER DOTLESS I IJIJ LATIN CAPITAL LIGATURE IJ ijij LATIN SMALL LIGATURE IJ /L/L LATIN CAPITAL LETTER L WITH STROKE /l/l LATIN SMALL LETTER L WITH STROKE OEOE LATIN CAPITAL LIGATURE OE oeoe LATIN SMALL LIGATURE OE ,f,f LATIN SMALL LETTER F WITH HOOK jj LATIN SMALL LETTER DOTLESS J vv CARON '`'` BREVE .. DOT ABOVE oo RING ABOVE ,, OGONEK "" DOUBLE ACUTE ACCENT AA GREEK CAPITAL LETTER ALPHA BB GREEK CAPITAL LETTER BETA GREEK CAPITAL LETTER GAMMA GREEK CAPITAL LETTER DELTA EE GREEK CAPITAL LETTER EPSILON ZZ GREEK CAPITAL LETTER ZETA HH GREEK CAPITAL LETTER ETA GREEK CAPITAL LETTER THETA II GREEK CAPITAL LETTER IOTA KK GREEK CAPITAL LETTER KAPPA GREEK CAPITAL LETTER LAMDA MM GREEK CAPITAL LETTER MU NN GREEK CAPITAL LETTER NU GREEK CAPITAL LETTER XI OO GREEK CAPITAL LETTER OMICRON GREEK CAPITAL LETTER PI PP GREEK CAPITAL LETTER RHO GREEK CAPITAL LETTER SIGMA TT GREEK CAPITAL LETTER TAU YY GREEK CAPITAL LETTER UPSILON GREEK CAPITAL LETTER PHI XX GREEK CAPITAL LETTER CHI GREEK CAPITAL LETTER PSI GREEK CAPITAL LETTER OMEGA GREEK SMALL LETTER ALPHA GREEK SMALL LETTER BETA GREEK SMALL LETTER GAMMA GREEK SMALL LETTER DELTA GREEK SMALL LETTER EPSILON GREEK SMALL LETTER ZETA GREEK SMALL LETTER ETA GREEK SMALL LETTER THETA GREEK SMALL LETTER IOTA GREEK SMALL LETTER KAPPA GREEK SMALL LETTER LAMDA GREEK SMALL LETTER MU GREEK SMALL LETTER NU GREEK SMALL LETTER XI oo GREEK SMALL LETTER OMICRON GREEK SMALL LETTER PI GREEK SMALL LETTER RHO GREEK SMALL LETTER FINAL SIGMA GREEK SMALL LETTER SIGMA GREEK SMALL LETTER TAU GREEK SMALL LETTER UPSILON GREEK SMALL LETTER PHI GREEK SMALL LETTER CHI GREEK SMALL LETTER PSI GREEK SMALL LETTER OMEGA GREEK THETA SYMBOL GREEK PHI SYMBOL GREEK PI SYMBOL GREEK LUNATE EPSILON SYMBOL -- HYPHEN -- EN DASH ---- EM DASH `` LEFT SINGLE QUOTATION MARK '' RIGHT SINGLE QUOTATION MARK ,, SINGLE LOW-9 QUOTATION MARK "" LEFT DOUBLE QUOTATION MARK "" RIGHT DOUBLE QUOTATION MARK ,,,, DOUBLE LOW-9 QUOTATION MARK <*><*> DAGGER <**><**> DOUBLE DAGGER +o+o BULLET PER MILLE SIGN '' PRIME '''' DOUBLE PRIME << SINGLE LEFT-POINTING ANGLE QUOTATION MARK >> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK // FRACTION SLASH EUREUREUR EURO SIGN BLACK-LETTER CAPITAL I pp SCRIPT CAPITAL P BLACK-LETTER CAPITAL R tmtm TRADE MARK SIGN ALEF SYMBOL 1/81/8 VULGAR FRACTION ONE EIGHTH 3/83/8 VULGAR FRACTION THREE EIGHTHS 5/85/8 VULGAR FRACTION FIVE EIGHTHS 7/87/8 VULGAR FRACTION SEVEN EIGHTHS <-<- LEFTWARDS ARROW |^|^ UPWARDS ARROW ->-> RIGHTWARDS ARROW |v|v DOWNWARDS ARROW <-><-> LEFT RIGHT ARROW DOWNWARDS ARROW WITH CORNER LEFTWARDS <=<= LEFTWARDS DOUBLE ARROW =^=^ UPWARDS DOUBLE ARROW =>=> RIGHTWARDS DOUBLE ARROW =v=v DOWNWARDS DOUBLE ARROW <=><=> LEFT RIGHT DOUBLE ARROW FOR ALL PARTIAL DIFFERENTIAL THERE EXISTS {}{} EMPTY SET NABLA ELEMENT OF NOT AN ELEMENT OF CONTAINS AS MEMBER N-ARY PRODUCT N-ARY COPRODUCT N-ARY SUMMATION -- MINUS SIGN -+-+ MINUS-OR-PLUS SIGN ** ASTERISK OPERATOR SQUARE ROOT PROPORTIONAL TO INFINITY ANGLE ^^ LOGICAL AND vv LOGICAL OR INTERSECTION UNION INTEGRAL THEREFORE ~~ TILDE OPERATOR -~-~ ASYMPTOTICALLY EQUAL TO =~=~ APPROXIMATELY EQUAL TO ~~~~~= ALMOST EQUAL TO !=!= NOT EQUAL TO ==== IDENTICAL TO !==!== NOT IDENTICAL TO <=<= LESS-THAN OR EQUAL TO >=>= GREATER-THAN OR EQUAL TO SUBSET OF SUPERSET OF NOT A SUBSET OF NOT A SUPERSET OF SUBSET OF OR EQUAL TO SUPERSET OF OR EQUAL TO O+O+ CIRCLED PLUS OxOx CIRCLED TIMES UP TACK .. DOT OPERATOR |~|~ LEFT CEILING ~|~| RIGHT CEILING |_|_ LEFT FLOOR _|_| RIGHT FLOOR || CURLY BRACKET EXTENSION -- HORIZONTAL LINE EXTENSION || BOX DRAWINGS LIGHT VERTICAL [][] WHITE SQUARE <><> LOZENGE OO WHITE CIRCLE <=<= WHITE LEFT POINTING INDEX =>=> WHITE RIGHT POINTING INDEX SS BLACK SPADE SUIT CC BLACK CLUB SUIT HH BLACK HEART SUIT DD BLACK DIAMOND SUIT << MATHEMATICAL LEFT ANGLE BRACKET >> MATHEMATICAL RIGHT ANGLE BRACKET ENDTEST OpenBSD August 21, 2018 CHAR-UNICODE-NAMED(1) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/named.out_html���������������������������������������������������0100644�0001753�0001753�00000014216�13634440765�0022247�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ıı LATIN SMALL LETTER DOTLESS I IJIJ LATIN CAPITAL LIGATURE IJ ijij LATIN SMALL LIGATURE IJ ŁŁ LATIN CAPITAL LETTER L WITH STROKE łł LATIN SMALL LETTER L WITH STROKE ŒŒ LATIN CAPITAL LIGATURE OE œœ LATIN SMALL LIGATURE OE ƒƒ LATIN SMALL LETTER F WITH HOOK ȷȷ LATIN SMALL LETTER DOTLESS J ˇˇ CARON ˘˘ BREVE ˙˙ DOT ABOVE ˚˚ RING ABOVE ˛˛ OGONEK ˝˝ DOUBLE ACUTE ACCENT ΑΑ GREEK CAPITAL LETTER ALPHA ΒΒ GREEK CAPITAL LETTER BETA ΓΓ GREEK CAPITAL LETTER GAMMA ΔΔ GREEK CAPITAL LETTER DELTA ΕΕ GREEK CAPITAL LETTER EPSILON ΖΖ GREEK CAPITAL LETTER ZETA ΗΗ GREEK CAPITAL LETTER ETA ΘΘ GREEK CAPITAL LETTER THETA ΙΙ GREEK CAPITAL LETTER IOTA ΚΚ GREEK CAPITAL LETTER KAPPA ΛΛ GREEK CAPITAL LETTER LAMDA ΜΜ GREEK CAPITAL LETTER MU ΝΝ GREEK CAPITAL LETTER NU ΞΞ GREEK CAPITAL LETTER XI ΟΟ GREEK CAPITAL LETTER OMICRON ΠΠ GREEK CAPITAL LETTER PI ΡΡ GREEK CAPITAL LETTER RHO ΣΣ GREEK CAPITAL LETTER SIGMA ΤΤ GREEK CAPITAL LETTER TAU ΥΥ GREEK CAPITAL LETTER UPSILON ΦΦ GREEK CAPITAL LETTER PHI ΧΧ GREEK CAPITAL LETTER CHI ΨΨ GREEK CAPITAL LETTER PSI ΩΩ GREEK CAPITAL LETTER OMEGA αα GREEK SMALL LETTER ALPHA ββ GREEK SMALL LETTER BETA γγ GREEK SMALL LETTER GAMMA δδ GREEK SMALL LETTER DELTA εε GREEK SMALL LETTER EPSILON ζζ GREEK SMALL LETTER ZETA ηη GREEK SMALL LETTER ETA θθ GREEK SMALL LETTER THETA ιι GREEK SMALL LETTER IOTA κκ GREEK SMALL LETTER KAPPA λλ GREEK SMALL LETTER LAMDA μμ GREEK SMALL LETTER MU νν GREEK SMALL LETTER NU ξξ GREEK SMALL LETTER XI οο GREEK SMALL LETTER OMICRON ππ GREEK SMALL LETTER PI ρρ GREEK SMALL LETTER RHO ςς GREEK SMALL LETTER FINAL SIGMA σσ GREEK SMALL LETTER SIGMA ττ GREEK SMALL LETTER TAU υυ GREEK SMALL LETTER UPSILON φφ GREEK SMALL LETTER PHI χχ GREEK SMALL LETTER CHI ψψ GREEK SMALL LETTER PSI ωω GREEK SMALL LETTER OMEGA ϑϑ GREEK THETA SYMBOL ϕϕ GREEK PHI SYMBOL ϖϖ GREEK PI SYMBOL ϵϵ GREEK LUNATE EPSILON SYMBOL ‐‐ HYPHEN –– EN DASH —— EM DASH ‘‘ LEFT SINGLE QUOTATION MARK ’’ RIGHT SINGLE QUOTATION MARK ‚‚ SINGLE LOW-9 QUOTATION MARK ““ LEFT DOUBLE QUOTATION MARK ”” RIGHT DOUBLE QUOTATION MARK „„ DOUBLE LOW-9 QUOTATION MARK †† DAGGER ‡‡ DOUBLE DAGGER •• BULLET ‰‰ PER MILLE SIGN ′′ PRIME ″″ DOUBLE PRIME ‹‹ SINGLE LEFT-POINTING ANGLE QUOTATION MARK ›› SINGLE RIGHT-POINTING ANGLE QUOTATION MARK ⁄⁄ FRACTION SLASH €€€ EURO SIGN ℑℑ BLACK-LETTER CAPITAL I ℘℘ SCRIPT CAPITAL P ℜℜ BLACK-LETTER CAPITAL R ™™ TRADE MARK SIGN ℵℵ ALEF SYMBOL ⅛⅛ VULGAR FRACTION ONE EIGHTH ⅜⅜ VULGAR FRACTION THREE EIGHTHS ⅝⅝ VULGAR FRACTION FIVE EIGHTHS ⅞⅞ VULGAR FRACTION SEVEN EIGHTHS ←← LEFTWARDS ARROW ↑↑ UPWARDS ARROW →→ RIGHTWARDS ARROW ↓↓ DOWNWARDS ARROW ↔↔ LEFT RIGHT ARROW ↵↵ DOWNWARDS ARROW WITH CORNER LEFTWARDS ⇐⇐ LEFTWARDS DOUBLE ARROW ⇑⇑ UPWARDS DOUBLE ARROW ⇒⇒ RIGHTWARDS DOUBLE ARROW ⇓⇓ DOWNWARDS DOUBLE ARROW ⇔⇔ LEFT RIGHT DOUBLE ARROW ∀∀ FOR ALL ∂∂ PARTIAL DIFFERENTIAL ∃∃ THERE EXISTS ∅∅ EMPTY SET ∇∇ NABLA ∈∈ ELEMENT OF ∉∉ NOT AN ELEMENT OF ∋∋ CONTAINS AS MEMBER ∏∏ N-ARY PRODUCT ∐∐ N-ARY COPRODUCT ∑∑ N-ARY SUMMATION −− MINUS SIGN ∓∓ MINUS-OR-PLUS SIGN ∗∗ ASTERISK OPERATOR √√ SQUARE ROOT ∝∝ PROPORTIONAL TO ∞∞ INFINITY ∠∠ ANGLE ∧∧ LOGICAL AND ∨∨ LOGICAL OR ∩∩ INTERSECTION ∪∪ UNION ∫∫ INTEGRAL ∴∴∴ THEREFORE ∼∼ TILDE OPERATOR ≃≃ ASYMPTOTICALLY EQUAL TO ≅≅ APPROXIMATELY EQUAL TO ≈≈≈ ALMOST EQUAL TO ≠≠ NOT EQUAL TO ≡≡ IDENTICAL TO ≢≢ NOT IDENTICAL TO ≤≤ LESS-THAN OR EQUAL TO ≥≥ GREATER-THAN OR EQUAL TO ⊂⊂ SUBSET OF ⊃⊃ SUPERSET OF ⊄⊄ NOT A SUBSET OF ⊅⊅ NOT A SUPERSET OF ⊆⊆ SUBSET OF OR EQUAL TO ⊇⊇ SUPERSET OF OR EQUAL TO ⊕⊕ CIRCLED PLUS ⊗⊗ CIRCLED TIMES ⊥⊥ UP TACK ⋅⋅ DOT OPERATOR ⌈⌈ LEFT CEILING ⌉⌉ RIGHT CEILING ⌊⌊ LEFT FLOOR ⌋⌋ RIGHT FLOOR ⎪⎪ CURLY BRACKET EXTENSION ⎯⎯ HORIZONTAL LINE EXTENSION ││ BOX DRAWINGS LIGHT VERTICAL □□ WHITE SQUARE ◊◊ LOZENGE ○○ WHITE CIRCLE ☜☜ WHITE LEFT POINTING INDEX ☞☞ WHITE RIGHT POINTING INDEX ♠♠ BLACK SPADE SUIT ♣♣ BLACK CLUB SUIT ♥♥ BLACK HEART SUIT ♦♦ BLACK DIAMOND SUIT ⟨⟨ MATHEMATICAL LEFT ANGLE BRACKET ⟩⟩ MATHEMATICAL RIGHT ANGLE BRACKET ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/named.out_utf8���������������������������������������������������0100644�0001753�0001753�00000014200�14121400034�0022133�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-NAMED(1) General Commands Manual CHAR-UNICODE-NAMED(1) NNAAMMEE char-unicode-named - Unicode characters having named escapes DDEESSCCRRIIPPTTIIOONN BEGINTEST ıı LATIN SMALL LETTER DOTLESS I IJIJ LATIN CAPITAL LIGATURE IJ ijij LATIN SMALL LIGATURE IJ ŁŁ LATIN CAPITAL LETTER L WITH STROKE łł LATIN SMALL LETTER L WITH STROKE ŒŒ LATIN CAPITAL LIGATURE OE œœ LATIN SMALL LIGATURE OE ƒƒ LATIN SMALL LETTER F WITH HOOK ȷȷ LATIN SMALL LETTER DOTLESS J ˇˇ CARON ˘˘ BREVE ˙˙ DOT ABOVE ˚˚ RING ABOVE ˛˛ OGONEK ˝˝ DOUBLE ACUTE ACCENT ΑΑ GREEK CAPITAL LETTER ALPHA ΒΒ GREEK CAPITAL LETTER BETA ΓΓ GREEK CAPITAL LETTER GAMMA ΔΔ GREEK CAPITAL LETTER DELTA ΕΕ GREEK CAPITAL LETTER EPSILON ΖΖ GREEK CAPITAL LETTER ZETA ΗΗ GREEK CAPITAL LETTER ETA ΘΘ GREEK CAPITAL LETTER THETA ΙΙ GREEK CAPITAL LETTER IOTA ΚΚ GREEK CAPITAL LETTER KAPPA ΛΛ GREEK CAPITAL LETTER LAMDA ΜΜ GREEK CAPITAL LETTER MU ΝΝ GREEK CAPITAL LETTER NU ΞΞ GREEK CAPITAL LETTER XI ΟΟ GREEK CAPITAL LETTER OMICRON ΠΠ GREEK CAPITAL LETTER PI ΡΡ GREEK CAPITAL LETTER RHO ΣΣ GREEK CAPITAL LETTER SIGMA ΤΤ GREEK CAPITAL LETTER TAU ΥΥ GREEK CAPITAL LETTER UPSILON ΦΦ GREEK CAPITAL LETTER PHI ΧΧ GREEK CAPITAL LETTER CHI ΨΨ GREEK CAPITAL LETTER PSI ΩΩ GREEK CAPITAL LETTER OMEGA αα GREEK SMALL LETTER ALPHA ββ GREEK SMALL LETTER BETA γγ GREEK SMALL LETTER GAMMA δδ GREEK SMALL LETTER DELTA εε GREEK SMALL LETTER EPSILON ζζ GREEK SMALL LETTER ZETA ηη GREEK SMALL LETTER ETA θθ GREEK SMALL LETTER THETA ιι GREEK SMALL LETTER IOTA κκ GREEK SMALL LETTER KAPPA λλ GREEK SMALL LETTER LAMDA μμ GREEK SMALL LETTER MU νν GREEK SMALL LETTER NU ξξ GREEK SMALL LETTER XI οο GREEK SMALL LETTER OMICRON ππ GREEK SMALL LETTER PI ρρ GREEK SMALL LETTER RHO ςς GREEK SMALL LETTER FINAL SIGMA σσ GREEK SMALL LETTER SIGMA ττ GREEK SMALL LETTER TAU υυ GREEK SMALL LETTER UPSILON φφ GREEK SMALL LETTER PHI χχ GREEK SMALL LETTER CHI ψψ GREEK SMALL LETTER PSI ωω GREEK SMALL LETTER OMEGA ϑϑ GREEK THETA SYMBOL ϕϕ GREEK PHI SYMBOL ϖϖ GREEK PI SYMBOL ϵϵ GREEK LUNATE EPSILON SYMBOL ‐‐ HYPHEN –– EN DASH —— EM DASH ‘‘ LEFT SINGLE QUOTATION MARK ’’ RIGHT SINGLE QUOTATION MARK ‚‚ SINGLE LOW-9 QUOTATION MARK ““ LEFT DOUBLE QUOTATION MARK ”” RIGHT DOUBLE QUOTATION MARK „„ DOUBLE LOW-9 QUOTATION MARK †† DAGGER ‡‡ DOUBLE DAGGER •• BULLET ‰‰ PER MILLE SIGN ′′ PRIME ″″ DOUBLE PRIME ‹‹ SINGLE LEFT-POINTING ANGLE QUOTATION MARK ›› SINGLE RIGHT-POINTING ANGLE QUOTATION MARK ⁄⁄ FRACTION SLASH €€€ EURO SIGN ℑℑ BLACK-LETTER CAPITAL I ℘℘ SCRIPT CAPITAL P ℜℜ BLACK-LETTER CAPITAL R ™™ TRADE MARK SIGN ℵℵ ALEF SYMBOL ⅛⅛ VULGAR FRACTION ONE EIGHTH ⅜⅜ VULGAR FRACTION THREE EIGHTHS ⅝⅝ VULGAR FRACTION FIVE EIGHTHS ⅞⅞ VULGAR FRACTION SEVEN EIGHTHS ←← LEFTWARDS ARROW ↑↑ UPWARDS ARROW →→ RIGHTWARDS ARROW ↓↓ DOWNWARDS ARROW ↔↔ LEFT RIGHT ARROW ↵↵ DOWNWARDS ARROW WITH CORNER LEFTWARDS ⇐⇐ LEFTWARDS DOUBLE ARROW ⇑⇑ UPWARDS DOUBLE ARROW ⇒⇒ RIGHTWARDS DOUBLE ARROW ⇓⇓ DOWNWARDS DOUBLE ARROW ⇔⇔ LEFT RIGHT DOUBLE ARROW ∀∀ FOR ALL ∂∂ PARTIAL DIFFERENTIAL ∃∃ THERE EXISTS ∅∅ EMPTY SET ∇∇ NABLA ∈∈ ELEMENT OF ∉∉ NOT AN ELEMENT OF ∋∋ CONTAINS AS MEMBER ∏∏ N-ARY PRODUCT ∐∐ N-ARY COPRODUCT ∑∑ N-ARY SUMMATION −− MINUS SIGN ∓∓ MINUS-OR-PLUS SIGN ∗∗ ASTERISK OPERATOR √√ SQUARE ROOT ∝∝ PROPORTIONAL TO ∞∞ INFINITY ∠∠ ANGLE ∧∧ LOGICAL AND ∨∨ LOGICAL OR ∩∩ INTERSECTION ∪∪ UNION ∫∫ INTEGRAL ∴∴∴ THEREFORE ∼∼ TILDE OPERATOR ≃≃ ASYMPTOTICALLY EQUAL TO ≅≅ APPROXIMATELY EQUAL TO ≈≈≈ ALMOST EQUAL TO ≠≠ NOT EQUAL TO ≡≡ IDENTICAL TO ≢≢ NOT IDENTICAL TO ≤≤ LESS-THAN OR EQUAL TO ≥≥ GREATER-THAN OR EQUAL TO ⊂⊂ SUBSET OF ⊃⊃ SUPERSET OF ⊄⊄ NOT A SUBSET OF ⊅⊅ NOT A SUPERSET OF ⊆⊆ SUBSET OF OR EQUAL TO ⊇⊇ SUPERSET OF OR EQUAL TO ⊕⊕ CIRCLED PLUS ⊗⊗ CIRCLED TIMES ⊥⊥ UP TACK ⋅⋅ DOT OPERATOR ⌈⌈ LEFT CEILING ⌉⌉ RIGHT CEILING ⌊⌊ LEFT FLOOR ⌋⌋ RIGHT FLOOR ⎪⎪ CURLY BRACKET EXTENSION ⎯⎯ HORIZONTAL LINE EXTENSION ││ BOX DRAWINGS LIGHT VERTICAL □□ WHITE SQUARE ◊◊ LOZENGE ○○ WHITE CIRCLE ☜☜ WHITE LEFT POINTING INDEX ☞☞ WHITE RIGHT POINTING INDEX ♠♠ BLACK SPADE SUIT ♣♣ BLACK CLUB SUIT ♥♥ BLACK HEART SUIT ♦♦ BLACK DIAMOND SUIT ⟨⟨ MATHEMATICAL LEFT ANGLE BRACKET ⟩⟩ MATHEMATICAL RIGHT ANGLE BRACKET ENDTEST OpenBSD August 21, 2018 CHAR-UNICODE-NAMED(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/namediff.in������������������������������������������������������0100644�0001753�0001753�00000002614�13410267673�0021503�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: namediff.in,v 1.9 2018/08/21 16:01:38 schwarze Exp $ .TH CHAR-UNICODE-NAMEDIFF 1 "August 21, 2018" .SH NAME char-unicode-namediff \- Unicode characters having named escapes .SH DESCRIPTION .nf BEGINTEST \[u203E]\(rn OVERLINE \[u210F]\[hbar]\(-h PLANCK CONSTANT OVER TWO PI \[u2195]\(va UP DOWN ARROW \[u21D5]\(vA UP DOWN DOUBLE ARROW \[u239B]\[parenlefttp] LEFT PARENTHESIS UPPER HOOK \[u239C]\[parenleftex] LEFT PARENTHESIS EXTENSION \[u239D]\[parenleftbt] LEFT PARENTHESIS LOWER HOOK \[u239E]\[parenrighttp] RIGHT PARENTHESIS UPPER HOOK \[u239F]\[parenrightex] RIGHT PARENTHESIS EXTENSION \[u23A0]\[parenrightbt] RIGHT PARENTHESIS LOWER HOOK \[u23A1]\[bracketlefttp] LEFT SQUARE BRACKET UPPER CORNER \[u23A2]\[bracketleftex] LEFT SQUARE BRACKET EXTENSION \[u23A3]\[bracketleftbt] LEFT SQUARE BRACKET LOWER CORNER \[u23A4]\[bracketrighttp] RIGHT SQUARE BRACKET UPPER CORNER \[u23A5]\[bracketrightex] RIGHT SQUARE BRACKET EXTENSION \[u23A6]\[bracketrightbt] RIGHT SQUARE BRACKET LOWER CORNER \[u23A7]\[bracelefttp] LEFT CURLY BRACKET UPPER HOOK \[u23A8]\[braceleftmid] LEFT CURLY BRACKET MIDDLE PIECE \[u23A9]\[braceleftbt] LEFT CURLY BRACKET LOWER HOOK \[u23AA]\[braceex]\[braceleftex]\[bracerightex] CURLY BRACKET EXTENSION \[u23AB]\[bracerighttp] RIGHT CURLY BRACKET UPPER HOOK \[u23AC]\[bracerightmid] RIGHT CURLY BRACKET MIDDLE PIECE \[u23AD]\[bracerightbt] RIGHT CURLY BRACKET LOWER HOOK ENDTEST .fi ��������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/namediff.out_ascii�����������������������������������������������0100644�0001753�0001753�00000002270�14121400034�0023026�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-NAMEDIFF(1) General Commands Manual CHAR-UNICODE-NAMEDIFF(1) NNAAMMEE char-unicode-namediff - Unicode characters having named escapes DDEESSCCRRIIPPTTIIOONN BEGINTEST -- OVERLINE /h/h/h PLANCK CONSTANT OVER TWO PI ^v^v UP DOWN ARROW ^=v^=v UP DOWN DOUBLE ARROW // LEFT PARENTHESIS UPPER HOOK || LEFT PARENTHESIS EXTENSION \\ LEFT PARENTHESIS LOWER HOOK \\ RIGHT PARENTHESIS UPPER HOOK || RIGHT PARENTHESIS EXTENSION // RIGHT PARENTHESIS LOWER HOOK || LEFT SQUARE BRACKET UPPER CORNER || LEFT SQUARE BRACKET EXTENSION || LEFT SQUARE BRACKET LOWER CORNER || RIGHT SQUARE BRACKET UPPER CORNER || RIGHT SQUARE BRACKET EXTENSION || RIGHT SQUARE BRACKET LOWER CORNER ,-,- LEFT CURLY BRACKET UPPER HOOK {{ LEFT CURLY BRACKET MIDDLE PIECE `-`- LEFT CURLY BRACKET LOWER HOOK |||| CURLY BRACKET EXTENSION -.-. RIGHT CURLY BRACKET UPPER HOOK }} RIGHT CURLY BRACKET MIDDLE PIECE -'-' RIGHT CURLY BRACKET LOWER HOOK ENDTEST OpenBSD August 21, 2018 CHAR-UNICODE-NAMEDIFF(1) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/namediff.out_html������������������������������������������������0100644�0001753�0001753�00000002046�13634440765�0022732�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‾‾ OVERLINE ℏℏℏ PLANCK CONSTANT OVER TWO PI ↕↕ UP DOWN ARROW ⇕⇕ UP DOWN DOUBLE ARROW ⎛⎛ LEFT PARENTHESIS UPPER HOOK ⎜⎜ LEFT PARENTHESIS EXTENSION ⎝⎝ LEFT PARENTHESIS LOWER HOOK ⎞⎞ RIGHT PARENTHESIS UPPER HOOK ⎟⎟ RIGHT PARENTHESIS EXTENSION ⎠⎠ RIGHT PARENTHESIS LOWER HOOK ⎡⎡ LEFT SQUARE BRACKET UPPER CORNER ⎢⎢ LEFT SQUARE BRACKET EXTENSION ⎣⎣ LEFT SQUARE BRACKET LOWER CORNER ⎤⎤ RIGHT SQUARE BRACKET UPPER CORNER ⎥⎥ RIGHT SQUARE BRACKET EXTENSION ⎦⎦ RIGHT SQUARE BRACKET LOWER CORNER ⎧⎧ LEFT CURLY BRACKET UPPER HOOK ⎨⎨ LEFT CURLY BRACKET MIDDLE PIECE ⎩⎩ LEFT CURLY BRACKET LOWER HOOK ⎪⎪⎪⎪ CURLY BRACKET EXTENSION ⎫⎫ RIGHT CURLY BRACKET UPPER HOOK ⎬⎬ RIGHT CURLY BRACKET MIDDLE PIECE ⎭⎭ RIGHT CURLY BRACKET LOWER HOOK ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/namediff.out_utf8������������������������������������������������0100644�0001753�0001753�00000002411�14121400034�0022621�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-NAMEDIFF(1) General Commands Manual CHAR-UNICODE-NAMEDIFF(1) NNAAMMEE char-unicode-namediff - Unicode characters having named escapes DDEESSCCRRIIPPTTIIOONN BEGINTEST ‾‾ OVERLINE ℏℏℏ PLANCK CONSTANT OVER TWO PI ↕↕ UP DOWN ARROW ⇕⇕ UP DOWN DOUBLE ARROW ⎛⎛ LEFT PARENTHESIS UPPER HOOK ⎜⎜ LEFT PARENTHESIS EXTENSION ⎝⎝ LEFT PARENTHESIS LOWER HOOK ⎞⎞ RIGHT PARENTHESIS UPPER HOOK ⎟⎟ RIGHT PARENTHESIS EXTENSION ⎠⎠ RIGHT PARENTHESIS LOWER HOOK ⎡⎡ LEFT SQUARE BRACKET UPPER CORNER ⎢⎢ LEFT SQUARE BRACKET EXTENSION ⎣⎣ LEFT SQUARE BRACKET LOWER CORNER ⎤⎤ RIGHT SQUARE BRACKET UPPER CORNER ⎥⎥ RIGHT SQUARE BRACKET EXTENSION ⎦⎦ RIGHT SQUARE BRACKET LOWER CORNER ⎧⎧ LEFT CURLY BRACKET UPPER HOOK ⎨⎨ LEFT CURLY BRACKET MIDDLE PIECE ⎩⎩ LEFT CURLY BRACKET LOWER HOOK ⎪⎪⎪⎪ CURLY BRACKET EXTENSION ⎫⎫ RIGHT CURLY BRACKET UPPER HOOK ⎬⎬ RIGHT CURLY BRACKET MIDDLE PIECE ⎭⎭ RIGHT CURLY BRACKET LOWER HOOK ENDTEST OpenBSD August 21, 2018 CHAR-UNICODE-NAMEDIFF(1) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/nogroff.in�������������������������������������������������������0100644�0001753�0001753�00000003227�14121400034�0021347�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: nogroff.in,v 1.6 2021/06/02 17:36:59 schwarze Exp $ .TH CHAR-UNICODE-NOGROFF 1 "June 2, 2021" .SH NAME char-unicode-nogroff \- characters handled differently by groff .SH DESCRIPTION .nf BEGINTEST \[u0000]\N'0' NULL \[u0001]\N'1' START OF HEADING \[u0007]\N'7' BELL \[u0008]\N'8' BACKSPACE \[u0009]\N'9' CHARACTER TABULATION \[u000A]\N'10' LINE FEED \[u000B]\N'11' LINE TABULATION \[u000C]\N'12' FORM FEED \[u000D]\N'13' CARRIAGE RETURN \[u001B]\N'27' ESCAPE \[u007F]\N'127' DELETE \[u0080]\N'128' 0x80 \[u0081]\N'129' 0x81 \[u0082]\N'130' BREAK PERMITTED HERE \[u0083]\N'131' NO BREAK HERE \[u009E]\N'158' PRIVACY MESSAGE \[u009F]\N'159' APPLICATION PROGRAM COMMAND \[u226A]\(<< MUCH LESS-THAN \[u226B]\(>> MUCH GREATER-THAN \[uD7FB] HANGUL JONGSEONG PHIEUPH-THIEUTH \[uE000] \[uF8FF] \[uF900] CJK COMPATIBILITY IDEOGRAPH-F900 \[uFB00]\(ff LATIN SMALL LIGATURE FF \[uFB01]\(fi LATIN SMALL LIGATURE FI \[uFB02]\(fl LATIN SMALL LIGATURE FL \[uFB03]\(Fi LATIN SMALL LIGATURE FFI \[uFB04]\(Fl LATIN SMALL LIGATURE FFL \[uFFFD] REPLACEMENT CHARACTER \[uFFFE] \[uFFFF] \[u10000] LINEAR B SYLLABLE B008 A \[uE01EF] VARIATION SELECTOR-256 \[uEFFFE] \[uEFFFF] \[uF0000] \[uFFFFD] \[uFFFFE] \[uFFFFF] \[u100000] \[u10FFFD] \[u10FFFE] \[u10FFFF] ENDTEST .fi �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/nogroff.out_ascii������������������������������������������������0100644�0001753�0001753�00000003530�14121400034�0022715�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-NOGROFF(1) General Commands Manual CHAR-UNICODE-NOGROFF(1) NNAAMMEE char-unicode-nogroff - characters handled differently by groff DDEESSCCRRIIPPTTIIOONN BEGINTEST NULL START OF HEADING BELL BACKSPACE CHARACTER TABULATION LINE FEED LINE TABULATION FORM FEED CARRIAGE RETURN ESCAPE DELETE <80><80> 0x80 <81><81> 0x81 <82><82> BREAK PERMITTED HERE <83><83> NO BREAK HERE <9E><9E> PRIVACY MESSAGE <9F><9F> APPLICATION PROGRAM COMMAND <<<< MUCH LESS-THAN >>>> MUCH GREATER-THAN HANGUL JONGSEONG PHIEUPH-THIEUTH CJK COMPATIBILITY IDEOGRAPH-F900 ffff LATIN SMALL LIGATURE FF fifi LATIN SMALL LIGATURE FI flfl LATIN SMALL LIGATURE FL ffiffi LATIN SMALL LIGATURE FFI fflffl LATIN SMALL LIGATURE FFL REPLACEMENT CHARACTER LINEAR B SYLLABLE B008 A VARIATION SELECTOR-256 ENDTEST OpenBSD June 2, 2021 CHAR-UNICODE-NOGROFF(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/nogroff.out_html�������������������������������������������������0100644�0001753�0001753�00000003240�14121400034�0022567�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� <control> NULL �� <control> START OF HEADING �� <control> BELL �� <control> BACKSPACE <control> CHARACTER TABULATION �� <control> LINE FEED �� <control> LINE TABULATION �� <control> FORM FEED �� <control> CARRIAGE RETURN �� <control> ESCAPE �� <control> DELETE �� <control> 0x80 �� <control> 0x81 �� <control> BREAK PERMITTED HERE �� <control> NO BREAK HERE �� <control> PRIVACY MESSAGE �� <control> APPLICATION PROGRAM COMMAND ≪≪ MUCH LESS-THAN ≫≫ MUCH GREATER-THAN ퟻ HANGUL JONGSEONG PHIEUPH-THIEUTH  <Private Use, First>  <Private Use, Last> 豈 CJK COMPATIBILITY IDEOGRAPH-F900 ffff LATIN SMALL LIGATURE FF fifi LATIN SMALL LIGATURE FI flfl LATIN SMALL LIGATURE FL ffiffi LATIN SMALL LIGATURE FFI fflffl LATIN SMALL LIGATURE FFL � REPLACEMENT CHARACTER ￾ <undefined> ￿ <undefined> 𐀀 LINEAR B SYLLABLE B008 A 󠇯 VARIATION SELECTOR-256 󯿾 <undefined> 󯿿 <undefined> 󰀀 <Plane 15 Private Use, First> 󿿽 <Plane 15 Private Use, Last> 󿿾 <undefined> 󿿿 <undefined> 􀀀 <Plane 16 Private Use, First> 􏿽 <Plane 16 Private Use, Last> 􏿾 <undefined> 􏿿 <undefined> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/char/unicode/nogroff.out_utf8�������������������������������������������������0100644�0001753�0001753�00000003572�14121400034�0022521�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CHAR-UNICODE-NOGROFF(1) General Commands Manual CHAR-UNICODE-NOGROFF(1) NNAAMMEE char-unicode-nogroff - characters handled differently by groff DDEESSCCRRIIPPTTIIOONN BEGINTEST �� NULL �� START OF HEADING �� BELL �� BACKSPACE CHARACTER TABULATION �� LINE FEED �� LINE TABULATION �� FORM FEED �� CARRIAGE RETURN �� ESCAPE �� DELETE �� 0x80 �� 0x81 �� BREAK PERMITTED HERE �� NO BREAK HERE �� PRIVACY MESSAGE �� APPLICATION PROGRAM COMMAND ≪≪ MUCH LESS-THAN ≫≫ MUCH GREATER-THAN ퟻ HANGUL JONGSEONG PHIEUPH-THIEUTH  豈 CJK COMPATIBILITY IDEOGRAPH-F900 ffff LATIN SMALL LIGATURE FF fifi LATIN SMALL LIGATURE FI flfl LATIN SMALL LIGATURE FL ffiffi LATIN SMALL LIGATURE FFI fflffl LATIN SMALL LIGATURE FFL � REPLACEMENT CHARACTER ￾ ￿ 𐀀 LINEAR B SYLLABLE B008 A 󠇯 VARIATION SELECTOR-256 󯿾 󯿿 󰀀 󿿽 󿿾 󿿿 􀀀 􏿽 􏿾 􏿿 ENDTEST OpenBSD June 2, 2021 CHAR-UNICODE-NOGROFF(1) ��������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn���������������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0015534�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/Makefile������������������������������������������������������������������0100644�0001753�0001753�00000000270�13136670124�0017250�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.2 2015/01/28 21:10:28 schwarze Exp $ SUBDIR = fromto define delim matrix nullary over size subsup unary .include "../Makefile.sub" .include ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/Makefile.inc��������������������������������������������������������������0100644�0001753�0001753�00000001223�13723465554�0020032�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile.inc,v 1.5 2020/07/30 21:32:19 schwarze Exp $ SKIP_GROFF ?= ${REGRESS_TARGETS} SKIP_TMAN ?= ALL SKIP_MARKDOWN ?= ALL # OpenBSD only: maintainer targets and custom extraction _FULLHTMLFILES = ${HTML_TARGETS:S/$/.html/} html-clean: .if !empty(_FULLHTMLFILES) rm -f ${_HTMLFILES} ${_FULLHTMLFILES} .endif .for t in ${HTML_TARGETS} ${t}.out_html: ${t}.in ${MANDOC} ${MOPTS} -Thtml ${.ALLSRC} | \ ${.CURDIR}/../extract.pl > ${.TARGET} .endfor .include "../Makefile.inc" .in.mandoc_html: ${MANDOC} ${MOPTS} -Thtml ${.IMPSRC} > ${.TARGET:S/mandoc_html$/html/} ${.CURDIR}/../extract.pl < ${.TARGET:S/mandoc_html$/html/} > ${.TARGET} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define��������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016766�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/Makefile�����������������������������������������������������������0100644�0001753�0001753�00000000253�13136670124�0020503�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1 2015/01/28 21:10:28 schwarze Exp $ REGRESS_TARGETS = font infinite invalid quoted LINT_TARGETS = infinite invalid .include �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/infinite.in��������������������������������������������������������0100644�0001753�0001753�00000000674�13136670124�0021207�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: infinite.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DEFINE-INFINITE 1 .Os .Sh NAME .Nm define-infinite .Nd infinite recursion in define statements .Sh DESCRIPTION alone: .EQ define key 'key' key .EN eol .Pp leading position: .EQ define key 'key suffix' key .EN eol .Pp middle position: .EQ define key 'prefix key suffix' key .EN eol .Pp trailing position: .EQ define key 'prefix key' key .EN eol ��������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/infinite.out_ascii�������������������������������������������������0100644�0001753�0001753�00000000621�13136670124�0022550�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DEFINE-INFINITE(1) General Commands Manual DEFINE-INFINITE(1) NNAAMMEE ddeeffiinnee--iinnffiinniittee - infinite recursion in define statements DDEESSCCRRIIPPTTIIOONN alone: eol leading position: eol middle position: eol trailing position: eol OpenBSD July 4, 2017 OpenBSD ���������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/infinite.out_lint��������������������������������������������������0100644�0001753�0001753�00000000460�13136670124�0022427�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: infinite.in:10:2: ERROR: input stack limit exceeded, infinite loop? mandoc: infinite.in:16:2: ERROR: input stack limit exceeded, infinite loop? mandoc: infinite.in:22:2: ERROR: input stack limit exceeded, infinite loop? mandoc: infinite.in:28:2: ERROR: input stack limit exceeded, infinite loop? ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/invalid.in���������������������������������������������������������0100644�0001753�0001753�00000001130�13136670124�0021014�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: invalid.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DEFINE-INVALID 1 .Os .Sh NAME .Nm define-invalid .Nd invalid define and undef statements .Sh DESCRIPTION define without variable name: .EQ define bruch 'over' 1 bruch 2 undef bruch bruch define .EN eol .Pp define without value: .EQ define bruch 'over' 1 bruch 2 undef bruch bruch define bruch .EN eol .Pp define without value: .EQ define bruch 'over' 1 bruch 2 undef bruch bruch undef .EN eol .Pp tdefine without variable name: .EQ tdefine .EN eol .Pp tdefine without value: .EQ tdefine bruch .EN eol ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/invalid.out_ascii��������������������������������������������������0100644�0001753�0001753�00000001023�13136670124�0022366�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DEFINE-INVALID(1) General Commands Manual DEFINE-INVALID(1) NNAAMMEE ddeeffiinnee--iinnvvaalliidd - invalid define and undef statements DDEESSCCRRIIPPTTIIOONN define without variable name: 1/2 _b_r_u_c_h eol define without value: 1/2 _b_r_u_c_h eol define without value: 1/2 _b_r_u_c_h eol tdefine without variable name: eol tdefine without value: eol OpenBSD July 4, 2017 OpenBSD �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/invalid.out_lint���������������������������������������������������0100644�0001753�0001753�00000000514�13136670124�0022250�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: invalid.in:10:2: WARNING: skipping empty request: define mandoc: invalid.in:16:2: WARNING: skipping empty request: define bruch mandoc: invalid.in:22:2: WARNING: skipping empty request: undef mandoc: invalid.in:28:2: WARNING: skipping empty request: tdefine mandoc: invalid.in:34:2: WARNING: skipping empty request: tdefine ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/font.in������������������������������������������������������������0100644�0001753�0001753�00000000444�13126731475�0020351�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DEFINE-FONT 1 .Os .Sh NAME .Nm define-font .Nd font selection takes place after define resolution .Sh DESCRIPTION initial text .EQ define alias 'sin x' alias define sin 'value' sin .EN final text ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/font.out_ascii�����������������������������������������������������0100644�0001753�0001753�00000000541�13126731475�0021720�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DEFINE-FONT(1) General Commands Manual DEFINE-FONT(1) NNAAMMEE ddeeffiinnee--ffoonntt - font selection takes place after define resolution DDEESSCCRRIIPPTTIIOONN initial text sin _x _v_a_l_u_e final text OpenBSD July 4, 2017 OpenBSD ���������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/quoted.in����������������������������������������������������������0100644�0001753�0001753�00000000516�13126731475�0020704�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: quoted.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DEFINE-QUOTED 1 .Os .Sh NAME .Nm define-quoted .Nd interaction of the define control statement with quoting .Sh DESCRIPTION initial text .EQ define unquoted 'sin' "unquoted" unquoted define quoted '"sin"' "quoted" quoted .EN final text ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/define/quoted.out_ascii���������������������������������������������������0100644�0001753�0001753�00000000617�13126731475�0022257�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DEFINE-QUOTED(1) General Commands Manual DEFINE-QUOTED(1) NNAAMMEE ddeeffiinnee--qquuootteedd - interaction of the define control statement with quoting DDEESSCCRRIIPPTTIIOONN initial text _u_n_q_u_o_t_e_d sin _q_u_o_t_e_d _s_i_n final text OpenBSD July 4, 2017 OpenBSD �����������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto��������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0017042�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/Makefile�����������������������������������������������������������0100644�0001753�0001753�00000000253�13136670124�0020557�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.3 2017/07/06 00:08:52 schwarze Exp $ REGRESS_TARGETS = basic noarg precedence HTML_TARGETS = basic noarg precedence .include �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/basic.in�����������������������������������������������������������0100644�0001753�0001753�00000000375�13136670124�0020535�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: basic.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FROMTO-BASIC 1 .Os .Sh NAME .Nm fromto-basic .Nd vertical stacking .Sh DESCRIPTION initial text .EQ sum from { i = 1 } to inf 1 over i sup 2 .EN final text �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/basic.out_ascii����������������������������������������������������0100644�0001753�0001753�00000000520�13330103717�0022071�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������FROMTO-BASIC(1) General Commands Manual FROMTO-BASIC(1) NNAAMMEE ffrroommttoo--bbaassiicc - vertical stacking DDEESSCCRRIIPPTTIIOONN initial text _(_i = 1)^ 1/(_i^2) final text OpenBSD July 4, 2017 OpenBSD ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/basic.out_html�����������������������������������������������������0100644�0001753�0001753�00000000256�13136670124�0021760�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������i=11i2 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/noarg.in�����������������������������������������������������������0100644�0001753�0001753�00000000370�13136670124�0020555�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: noarg.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FROMTO-NOARG 1 .Os .Sh NAME .Nm fromto-noarg .Nd vertical stacking lacks final argument .Sh DESCRIPTION initial text .EQ x from a to to .EN final text ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/noarg.out_ascii����������������������������������������������������0100644�0001753�0001753�00000000514�13136670124�0022126�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������FROMTO-NOARG(1) General Commands Manual FROMTO-NOARG(1) NNAAMMEE ffrroommttoo--nnooaarrgg - vertical stacking lacks final argument DDEESSCCRRIIPPTTIIOONN initial text _x_(_a^)^ final text OpenBSD July 4, 2017 OpenBSD ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/noarg.out_html�����������������������������������������������������0100644�0001753�0001753�00000000112�13046505072�0021773�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xa ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/precedence.in������������������������������������������������������0100644�0001753�0001753�00000000560�13127301053�0021535�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: precedence.in,v 1.1 2017/07/06 00:08:52 schwarze Exp $ .Dd $Mdocdate: July 6 2017 $ .Dt SUBSUP-PRECEDENCE 1 .Os .Sh NAME .Nm subsup-precedence .Nd precedence of subscripts and superscripts .Sh DESCRIPTION .ps 36 initial text .EQ X from a under to c hat ; roman X from bold a to italic c ; X sub 1 sup 2 from a sub c sup e to o sub r sup s .EN final text ������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/precedence.out_ascii�����������������������������������������������0100644�0001753�0001753�00000000624�13330103717�0023112�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBSUP-PRECEDENCE(1) General Commands Manual SUBSUP-PRECEDENCE(1) NNAAMMEE ssuubbssuupp--pprreecceeddeennccee - precedence of subscripts and superscripts DDEESSCCRRIIPPTTIIOONN initial text _X_(_a_)^_c^; X_aa^_c; (_X_1^2)_(_a__c^_e)^(_o__r^_s) final text OpenBSD July 6, 2017 OpenBSD ������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/fromto/precedence.out_html������������������������������������������������0100644�0001753�0001753�00000000674�13127301053�0022770�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Xa_c^;Xac;X12aceors ��������������������������������������������������������������������mandoc-1.14.6/regress/eqn/matrix��������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0017040�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/matrix/Makefile�����������������������������������������������������������0100644�0001753�0001753�00000000231�13050067326�0020550�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1.1.1 2015/01/01 12:53:46 schwarze Exp $ REGRESS_TARGETS = basic empty HTML_TARGETS = basic empty .include �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/matrix/basic.in�����������������������������������������������������������0100644�0001753�0001753�00000000617�13136670124�0020532�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt MATRIX-BASIC 1 .Os .Sh NAME .Nm matrix-basic .Nd matrixes in equations .Sh DESCRIPTION initial text .EQ left ( matrix { ccol { a sub 11 above a sub 21 } ccol { a sub 12 above a sub 22 } } right ) left ( pile { b sub 1 above b sub 2 } right ) left [ bold pile { sin above "sin" } right ] .EN final text �����������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/matrix/basic.out_ascii����������������������������������������������������0100644�0001753�0001753�00000000556�13330103717�0022100�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MATRIX-BASIC(1) General Commands Manual MATRIX-BASIC(1) NNAAMMEE mmaattrriixx--bbaassiicc - matrixes in equations DDEESSCCRRIIPPTTIIOONN initial text ((_a_11 _a_21) (_a_12 _a_22)) (_b_1 _b_2)[sin ssiinn] final text OpenBSD July 4, 2017 OpenBSD ��������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/matrix/basic.out_html�����������������������������������������������������0100644�0001753�0001753�00000001165�13136670124�0021756�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������a11a12a21a22b1b2sinsin �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/matrix/empty.in�����������������������������������������������������������0100644�0001753�0001753�00000000401�13136670124�0020576�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: empty.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt MATRIX-EMPTY 1 .Os .Sh NAME .Nm matrix-empty .Nd empty matrixes .Sh DESCRIPTION initial text .EQ left ( matrix { } right ) left ( matrix right ) .EN final text ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/matrix/empty.out_ascii����������������������������������������������������0100644�0001753�0001753�00000000456�13136670124�0022161�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MATRIX-EMPTY(1) General Commands Manual MATRIX-EMPTY(1) NNAAMMEE mmaattrriixx--eemmppttyy - empty matrixes DDEESSCCRRIIPPTTIIOONN initial text () () final text OpenBSD July 4, 2017 OpenBSD ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/matrix/empty.out_html�����������������������������������������������������0100644�0001753�0001753�00000000164�13050067326�0022030�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/nullary�������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0017222�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/nullary/Makefile����������������������������������������������������������0100644�0001753�0001753�00000000262�13136670124�0020737�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1.1.1 2015/01/01 12:53:46 schwarze Exp $ REGRESS_TARGETS = roman symbol UTF8_TARGETS = symbol HTML_TARGETS = roman symbol .include ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/nullary/roman.in����������������������������������������������������������0100644�0001753�0001753�00000001271�13136670124�0020744�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: roman.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NULLARY-ROMAN 1 .Os .Sh NAME .Nm nullary-roman .Nd equation tokens set in roman font .Sh DESCRIPTION initial text \(em .EQ roman "unquoted words:" sin cos tan sec csc asin acos atan asec acsc sinh cosh tanh coth arc max min lim log ln exp Re Im and if for det \(em roman "quoted words:" "sin" "cos" "tan" "sec" "csc" "asin" "acos" "atan" "asec" "acsc" "sinh" "cosh" "tanh" "coth" "arc" "max" "min" "lim" "log" "ln" "exp" "Re" "Im" "and" "if" "for" "det" \(em roman "font operations:" bold sin bold "sin" \(em roman "superstring:" sinus \(em roman "composite word:" tan = sin/cos .EN \(em final text ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/nullary/roman.out_ascii���������������������������������������������������0100644�0001753�0001753�00000001575�13136670124�0022324�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������NULLARY-ROMAN(1) General Commands Manual NULLARY-ROMAN(1) NNAAMMEE nnuullllaarryy--rroommaann - equation tokens set in roman font DDEESSCCRRIIPPTTIIOONN initial text -- unquoted words: sin cos tan sec csc asin acos atan asec acsc sinh cosh tanh coth arc max min lim log ln exp Re Im and if for det -- quoted words: _s_i_n _c_o_s _t_a_n _s_e_c _c_s_c _a_s_i_n _a_c_o_s _a_t_a_n _a_s_e_c _a_c_s_c _s_i_n_h _c_o_s_h _t_a_n_h _c_o_t_h _a_r_c _m_a_x _m_i_n _l_i_m _l_o_g _l_n _e_x_p _R_e _I_m _a_n_d _i_f _f_o_r _d_e_t -- font operations: sin ssiinn -- superstring: _s_i_n_u_s -- composite word: tan = _s_i_n / _c_o_s -- final text OpenBSD July 4, 2017 OpenBSD �����������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/nullary/roman.out_html����������������������������������������������������0100644�0001753�0001753�00000003135�13634440765�0022203�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������unquoted words:sincostanseccscasinacosatanasecacscsinhcoshtanhcotharcmaxminlimloglnexpReImandiffordetquoted words:sincostanseccscasinacosatanasecacscsinhcoshtanhcotharcmaxminlimloglnexpReImandiffordetfont operations:sinsinsuperstring:sinuscomposite word:tan=sin/cos �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/nullary/symbol.in���������������������������������������������������������0100644�0001753�0001753�00000000553�13126731501�0021133�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: symbol.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NULLARY-SYMBOL 1 .Os .Sh NAME .Nm nullary-symbol .Nd equation tokens for symbols .Sh DESCRIPTION initial text \(em .EQ roman "unquoted words:" epsilon prime \(em roman "quoted words:" "epsilon" "prime" \(em roman "composite word:" epsilon-prime .EN \(em final text �����������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/nullary/symbol.out_ascii��������������������������������������������������0100644�0001753�0001753�00000000724�13330103717�0022503�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������NULLARY-SYMBOL(1) General Commands Manual NULLARY-SYMBOL(1) NNAAMMEE nnuullllaarryy--ssyymmbbooll - equation tokens for symbols DDEESSCCRRIIPPTTIIOONN initial text -- unquoted words: ' -- quoted words: _e_p_s_i_l_o_n _p_r_i_m_e -- composite word: _e_p_s_i_l_o_n - _p_r_i_m_e -- final text OpenBSD July 4, 2017 OpenBSD ��������������������������������������������mandoc-1.14.6/regress/eqn/nullary/symbol.out_html���������������������������������������������������0100644�0001753�0001753�00000000521�13634440765�0022370�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������unquoted words:εquoted words:epsilonprimecomposite word:epsilon-prime �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/nullary/symbol.out_utf8���������������������������������������������������0100644�0001753�0001753�00000000725�13126731501�0022303�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������NULLARY-SYMBOL(1) General Commands Manual NULLARY-SYMBOL(1) NNAAMMEE nnuullllaarryy--ssyymmbbooll – equation tokens for symbols DDEESSCCRRIIPPTTIIOONN initial text — unquoted words: ε ′ — quoted words: _e_p_s_i_l_o_n _p_r_i_m_e — composite word: _e_p_s_i_l_o_n - _p_r_i_m_e — final text OpenBSD July 4, 2017 OpenBSD �������������������������������������������mandoc-1.14.6/regress/eqn/over����������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016507�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/over/Makefile�������������������������������������������������������������0100644�0001753�0001753�00000000265�13046505074�0020230�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.2 2015/01/01 15:34:43 schwarze Exp $ REGRESS_TARGETS = noarg precedence HTML_TARGETS = noarg precedence LINT_TARGETS = noarg .include �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/over/noarg.in�������������������������������������������������������������0100644�0001753�0001753�00000000354�13136670124�0020224�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: noarg.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt OVER-NOARG 1 .Os .Sh NAME .Nm over-noarg .Nd fraction operator without arguments .Sh DESCRIPTION initial text .EQ over over .EN final text ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/over/noarg.out_ascii������������������������������������������������������0100644�0001753�0001753�00000000474�13136670124�0021600�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������OVER-NOARG(1) General Commands Manual OVER-NOARG(1) NNAAMMEE oovveerr--nnooaarrgg - fraction operator without arguments DDEESSCCRRIIPPTTIIOONN initial text (/)/ final text OpenBSD July 4, 2017 OpenBSD ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/over/noarg.out_html�������������������������������������������������������0100644�0001753�0001753�00000000065�13046505074�0021451�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/over/noarg.out_lint�������������������������������������������������������0100644�0001753�0001753�00000000100�13136670124�0021440�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: noarg.in:10:2: WARNING: missing eqn box, using "": over ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/over/precedence.in��������������������������������������������������������0100644�0001753�0001753�00000000540�13136670124�0021210�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: precedence.in,v 1.3 2017/07/06 00:08:52 schwarze Exp $ .Dd $Mdocdate: July 6 2017 $ .Dt OVER-PRECEDENCE 1 .Os .Sh NAME .Nm over-precedence .Nd precedence of the fraction operator .Sh DESCRIPTION initial text .EQ 1 + x + x sup 2 over 2 + x sup 3 over { 2 * 3 } ; a hat over c tilde ; bold a over bold c ; sqrt a over sqrt c .EN final text ����������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/over/precedence.out_ascii�������������������������������������������������0100644�0001753�0001753�00000000636�13410267673�0022575�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������OVER-PRECEDENCE(1) General Commands Manual OVER-PRECEDENCE(1) NNAAMMEE oovveerr--pprreecceeddeennccee - precedence of the fraction operator DDEESSCCRRIIPPTTIIOONN initial text 1 + _x + (_x^2)/2 + (_x^3)/(2 * 3); _a^/_c~; aa/cc; (_a)/(_c) final text OpenBSD July 6, 2017 OpenBSD ��������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/over/precedence.out_html��������������������������������������������������0100644�0001753�0001753�00000000752�13136670124�0022442�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������1+x+x22+x32*3;a^c~;ac;ac ����������������������mandoc-1.14.6/regress/eqn/size����������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016506�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/size/Makefile�������������������������������������������������������������0100644�0001753�0001753�00000000167�13046505075�0020231�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1.1.1 2015/01/01 12:53:46 schwarze Exp $ REGRESS_TARGETS = basic .include ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/size/basic.in�������������������������������������������������������������0100644�0001753�0001753�00000000351�13136670124�0020173�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: basic.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SIZE-BASIC 1 .Os .Sh NAME .Nm size-basic .Nd font sizes .Sh DESCRIPTION initial text .EQ x size 12 x size 14 x size 16 x .EN final text ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/size/basic.out_ascii������������������������������������������������������0100644�0001753�0001753�00000000456�13136670124�0021552�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SIZE-BASIC(1) General Commands Manual SIZE-BASIC(1) NNAAMMEE ssiizzee--bbaassiicc - font sizes DDEESSCCRRIIPPTTIIOONN initial text _x _x _x _x final text OpenBSD July 4, 2017 OpenBSD ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup��������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0017055�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/Makefile�����������������������������������������������������������0100644�0001753�0001753�00000000303�13136670124�0020566�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.3 2017/07/06 00:08:52 schwarze Exp $ REGRESS_TARGETS = combine noarg precedence sub_group HTML_TARGETS = combine noarg precedence sub_group .include �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/combine.in���������������������������������������������������������0100644�0001753�0001753�00000000421�13136670124�0021073�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: combine.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SUBSUP-COMBINE 1 .Os .Sh NAME .Nm subsup-combine .Nd combination of subscripts and superscripts .Sh DESCRIPTION initial text .EQ x sub 1 sup 2 + e sup x sub 2 .EN final text �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/combine.out_ascii��������������������������������������������������0100644�0001753�0001753�00000000540�13136670124�0022446�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBSUP-COMBINE(1) General Commands Manual SUBSUP-COMBINE(1) NNAAMMEE ssuubbssuupp--ccoommbbiinnee - combination of subscripts and superscripts DDEESSCCRRIIPPTTIIOONN initial text _x_1^2 + _e^(_x_2) final text OpenBSD July 4, 2017 OpenBSD ����������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/combine.out_html���������������������������������������������������0100644�0001753�0001753�00000000201�13136670124�0022314�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������x12+ex2 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/noarg.in�����������������������������������������������������������0100644�0001753�0001753�00000000364�13136670124�0020573�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: noarg.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SUBSUP-NOARG 1 .Os .Sh NAME .Nm subsup-noarg .Nd empty subscripts and superscripts .Sh DESCRIPTION initial text .EQ x sub 1 sup sup .EN final text ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/noarg.out_ascii����������������������������������������������������0100644�0001753�0001753�00000000505�13136670124�0022141�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBSUP-NOARG(1) General Commands Manual SUBSUP-NOARG(1) NNAAMMEE ssuubbssuupp--nnooaarrgg - empty subscripts and superscripts DDEESSCCRRIIPPTTIIOONN initial text _x_(1^)^ final text OpenBSD July 4, 2017 OpenBSD �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/noarg.out_html�����������������������������������������������������0100644�0001753�0001753�00000000102�13136670124�0022006�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������x1 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/sub_group.in�������������������������������������������������������0100644�0001753�0001753�00000000421�13136670124�0021464�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: sub_group.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SUBSUP-SUB_GROUP 1 .Os .Sh NAME .Nm subsup-sub_group .Nd grouping of subscripts .Sh DESCRIPTION initial text .EQ x sub i + x sub j sub 1 + { M sub i } sub j .EN final text �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/sub_group.out_ascii������������������������������������������������0100644�0001753�0001753�00000000542�13136670124�0023041�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBSUP-SUB_GROUP(1) General Commands Manual SUBSUP-SUB_GROUP(1) NNAAMMEE ssuubbssuupp--ssuubb__ggrroouupp - grouping of subscripts DDEESSCCRRIIPPTTIIOONN initial text _x__i + _x_(_j_1) + (_M__i)__j final text OpenBSD July 4, 2017 OpenBSD ��������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/sub_group.out_html�������������������������������������������������0100644�0001753�0001753�00000000300�13136670124�0022705�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������xi+xj1+Mij ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/precedence.in������������������������������������������������������0100644�0001753�0001753�00000000572�13127301055�0021555�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: precedence.in,v 1.1 2017/07/06 00:08:52 schwarze Exp $ .Dd $Mdocdate: July 6 2017 $ .Dt SUBSUP-PRECEDENCE 1 .Os .Sh NAME .Nm subsup-precedence .Nd precedence of subscripts and superscripts .Sh DESCRIPTION initial text .EQ x hat sub 1 under sup 2 bar + e tilde sup x hat sub s dyad ; roman I sub bold I sup italic I + roman I sup bold I sub italic I .EN final text ��������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/precedence.out_ascii�����������������������������������������������0100644�0001753�0001753�00000000623�13330103717�0023124�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBSUP-PRECEDENCE(1) General Commands Manual SUBSUP-PRECEDENCE(1) NNAAMMEE ssuubbssuupp--pprreecceeddeennccee - precedence of subscripts and superscripts DDEESSCCRRIIPPTTIIOONN initial text (_x^)_(1_)^2- + (_e~)^((_x^)__s<->); I_II^_I + I^(II__I) final text OpenBSD July 6, 2017 OpenBSD �������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/subsup/precedence.out_html������������������������������������������������0100644�0001753�0001753�00000001074�13132441052�0022776�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������x^1_2+e~x^s;III+III ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary���������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016672�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/Makefile������������������������������������������������������������0100644�0001753�0001753�00000000245�13136670124�0020410�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1.1.1 2015/01/01 12:53:46 schwarze Exp $ REGRESS_TARGETS = bold diacrit sqrt HTML_TARGETS = bold diacrit sqrt .include �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/diacrit.in����������������������������������������������������������0100644�0001753�0001753�00000000471�13136670124�0020720�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: diacrit.in,v 1.3 2017/07/06 00:08:52 schwarze Exp $ .Dd $Mdocdate: July 6 2017 $ .Dt UNARY-DIACRIT 1 .Os .Sh NAME .Nm unary-diacrit .Nd diacritical marks in equations .Sh DESCRIPTION initial text .EQ x dot x dotdot x hat x tilde x vec x dyad { x + y } bar { x + y } under x tilde hat .EN final text �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/diacrit.out_ascii���������������������������������������������������0100644�0001753�0001753�00000000574�13136670124�0022275�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UNARY-DIACRIT(1) General Commands Manual UNARY-DIACRIT(1) NNAAMMEE uunnaarryy--ddiiaaccrriitt - diacritical marks in equations DDEESSCCRRIIPPTTIIOONN initial text _x. _x" _x^ _x~ _x-> _x<-> (_x + _y)- (_x + _y)_ _x~^ final text OpenBSD July 6, 2017 OpenBSD ������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/diacrit.out_html����������������������������������������������������0100644�0001753�0001753�00000000711�13136670125�0022143�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������x˙x¨x^x~xxx+yx+y_x~^ �������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/sqrt.in�������������������������������������������������������������0100644�0001753�0001753�00000000422�13136670125�0020267�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: sqrt.in,v 1.5 2017/07/06 00:08:52 schwarze Exp $ .Dd $Mdocdate: July 6 2017 $ .Dt UNARY-SQRT 1 .Os .Sh NAME .Nm unary-sqrt .Nd square root .Sh DESCRIPTION initial text .EQ r = sqrt { x sup 2 + y sup 2 } + sqrt a+b + sqrt x hat + sqrt { } + sqrt .EN final text ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/sqrt.out_ascii������������������������������������������������������0100644�0001753�0001753�00000000567�13410267673�0021657�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UNARY-SQRT(1) General Commands Manual UNARY-SQRT(1) NNAAMMEE uunnaarryy--ssqqrrtt - square root DDEESSCCRRIIPPTTIIOONN initial text _r = (_x^2 + _y^2) + (_a + _b) + (_x^) + () + final text OpenBSD July 6, 2017 OpenBSD �����������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/sqrt.out_html�������������������������������������������������������0100644�0001753�0001753�00000000511�13136670125�0021513�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������r=x2+y2+a+b+x^++ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/bold.in�������������������������������������������������������������0100644�0001753�0001753�00000000376�13127301056�0020220�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: bold.in,v 1.3 2017/07/06 00:08:52 schwarze Exp $ .Dd $Mdocdate: July 6 2017 $ .Dt UNARY-BOLD 1 .Os .Sh NAME .Nm unary-bold .Nd font handling in bold boxes .Sh DESCRIPTION initial text .EQ bold { sin "sin" } "text" bold x hat .EN final text ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/bold.out_ascii������������������������������������������������������0100644�0001753�0001753�00000000527�13127301056�0021567�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UNARY-BOLD(1) General Commands Manual UNARY-BOLD(1) NNAAMMEE uunnaarryy--bboolldd - font handling in bold boxes DDEESSCCRRIIPPTTIIOONN initial text ((sin ssiinn)) _t_e_x_t xx^^ final text OpenBSD July 6, 2017 OpenBSD �������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/unary/bold.out_html�������������������������������������������������������0100644�0001753�0001753�00000000264�13127301056�0021441�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sinsintextx^ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/delim���������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016626�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/delim/Makefile������������������������������������������������������������0100644�0001753�0001753�00000000244�13634440765�0020354�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.3 2020/01/08 12:09:14 schwarze Exp $ REGRESS_TARGETS = basic UTF8_TARGETS = basic GOPTS = -e SKIP_GROFF = .include ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/delim/basic.in������������������������������������������������������������0100644�0001753�0001753�00000000611�13634440765�0020323�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: basic.in,v 1.4 2020/01/08 12:09:14 schwarze Exp $ .Dd $Mdocdate: January 8 2020 $ .Dt DELIM-BASIC 1 .Os .Sh NAME .Nm delim-basic .Nd inline eqn delimiters .Sh DESCRIPTION initial text .EQ delim []alpha .EN inline [beta] .EQ delim offgamma .EN inline [delta] .EQ delim onepsilon .EN inline [zeta] .EQ delim $$ delim off .EN inline $eta$ .EQ delim on .EN inline $theta$ final text �����������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/delim/basic.out_ascii�����������������������������������������������������0100644�0001753�0001753�00000000622�13634440765�0021676�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DELIM-BASIC(1) General Commands Manual DELIM-BASIC(1) NNAAMMEE ddeelliimm--bbaassiicc - inline eqn delimiters DDEESSCCRRIIPPTTIIOONN initial text inline inline [delta] inline inline $eta$ inline final text OpenBSD January 8, 2020 OpenBSD ��������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/eqn/delim/basic.out_utf8������������������������������������������������������0100644�0001753�0001753�00000000566�13605344030�0021465�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DELIM-BASIC(1) General Commands Manual DELIM-BASIC(1) NNAAMMEE ddeelliimm--bbaassiicc – inline eqn delimiters DDEESSCCRRIIPPTTIIOONN initial text α inline β γ inline [delta] ε inline ζ inline $eta$ inline θ final text OpenBSD January 8, 2020 OpenBSD ������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man���������������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0015524�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/Makefile������������������������������������������������������������������0100644�0001753�0001753�00000000271�13437723452�0017250�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.19 2019/01/05 21:13:55 schwarze Exp $ SUBDIR = B BI EX HP IP MT OP PD PP RS SH SS SY TH TP TS UR nf blank .include "../Makefile.sub" .include ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/Makefile.inc��������������������������������������������������������������0100644�0001753�0001753�00000000205�13060105641�0017777�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile.inc,v 1.3 2015/02/03 19:37:25 schwarze Exp $ SKIP_TMAN ?= ALL SKIP_MARKDOWN ?= ALL .include "../Makefile.inc" �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/B�������������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0015705�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/B/Makefile����������������������������������������������������������������0100644�0001753�0001753�00000000365�13136670125�0017427�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1 2014/08/14 02:00:52 schwarze Exp $ REGRESS_TARGETS = args blank LINT_TARGETS = args blank # groff-1.22.3 defect: # - A blank line in next line scope causes a blank line. SKIP_GROFF = blank .include ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/B/args.in�����������������������������������������������������������������0100644�0001753�0001753�00000000535�13136670125�0017252�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: args.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .TH B-ARGS 1 "July 30, 2014" .SH NAME B-args \- arguments to font macros .SH DESCRIPTION This is .B bold text. It also works with .B several words on a line and with .B next line scope. .nf In no-fill mode: .B two words and another line. .fi It has no effect at the end of the file: .B �������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/B/args.out_ascii����������������������������������������������������������0100644�0001753�0001753�00000001040�14121400034�0020574�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������B-ARGS(1) General Commands Manual B-ARGS(1) NNAAMMEE B-args - arguments to font macros DDEESSCCRRIIPPTTIIOONN This is bboolldd text. It also works with sseevveerraall wwoorrddss oonn aa lliinnee and with nneexxtt lliinnee scope. In no-fill mode: ttwwoo wwoorrddss and another line. It has no effect at the end of the file: OpenBSD July 30, 2014 B-ARGS(1) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/B/args.out_lint�����������������������������������������������������������0100644�0001753�0001753�00000000077�13136670125�0020502�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: args.in:21:2: WARNING: line scope broken: EOF breaks B �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/B/blank.in����������������������������������������������������������������0100644�0001753�0001753�00000000324�13126731506�0017401�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: blank.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH B-BLANK 1 "June 3, 2017" .SH NAME B-blank \- blank line in font macro next line scope .SH DESCRIPTION A blank line in .B bold next line scope. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/B/blank.out_ascii���������������������������������������������������������0100644�0001753�0001753�00000000477�14121400034�0020744�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������B-BLANK(1) General Commands Manual B-BLANK(1) NNAAMMEE B-blank - blank line in font macro next line scope DDEESSCCRRIIPPTTIIOONN A blank line in bboolldd next line scope. OpenBSD June 3, 2017 B-BLANK(1) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/B/blank.out_lint����������������������������������������������������������0100644�0001753�0001753�00000000101�13126731506�0020621�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc: blank.in:8:1: WARNING: skipping blank line in line scope ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/BI������������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016016�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/BI/Makefile���������������������������������������������������������������0100644�0001753�0001753�00000000177�13046505077�0017544�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.3 2015/04/06 22:06:06 schwarze Exp $ REGRESS_TARGETS = emptyargs literal .include �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/BI/emptyargs.in�����������������������������������������������������������0100644�0001753�0001753�00000000416�13136670125�0020440�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: emptyargs.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH BI-EMPTYARGS 1 "April 6, 2015" .SH NAME BI-emptyargs \- empty arguments to font alternation macros .SH DESCRIPTION leading text .TP 6n .BI bold italic "" "" .BI bold "" "" italic .PP trailing text ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/BI/emptyargs.out_ascii����������������������������������������������������0100644�0001753�0001753�00000000616�14121400034�0021774�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������BI-EMPTYARGS(1) General Commands Manual BI-EMPTYARGS(1) NNAAMMEE BI-emptyargs - empty arguments to font alternation macros DDEESSCCRRIIPPTTIIOONN leading text bboolldd_i_t_a_l_i_c bboolldd_i_t_a_l_i_c trailing text OpenBSD April 6, 2015 BI-EMPTYARGS(1) ������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/BI/literal.in�������������������������������������������������������������0100644�0001753�0001753�00000000706�13136670125�0020063�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: literal.in,v 1.3 2017/07/04 14:53:23 schwarze Exp $ .TH GETTEXT 3 "May 2001" "GNU gettext 0.18" .SH NAME gettext, dgettext, dcgettext \- translate message .SH SYNOPSIS .nf .B #include .sp .BI "char * gettext (const char * " msgid ); .BI "char * dgettext (const char * " domainname ", const char * " msgid ); .BI "char * dcgettext (const char * " domainname ", const char * " msgid , .BI " int " category ); .fi ����������������������������������������������������������mandoc-1.14.6/regress/man/BI/literal.out_ascii������������������������������������������������������0100644�0001753�0001753�00000001510�14121400034�0021407�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GETTEXT(3) Library Functions Manual GETTEXT(3) NNAAMMEE gettext, dgettext, dcgettext - translate message SSYYNNOOPPSSIISS ##iinncclluuddee <> cchhaarr ** ggeetttteexxtt ((ccoonnsstt cchhaarr ** _m_s_g_i_d));; cchhaarr ** ddggeetttteexxtt ((ccoonnsstt cchhaarr ** _d_o_m_a_i_n_n_a_m_e,, ccoonnsstt cchhaarr ** _m_s_g_i_d));; cchhaarr ** ddccggeetttteexxtt ((ccoonnsstt cchhaarr ** _d_o_m_a_i_n_n_a_m_e,, ccoonnsstt cchhaarr ** _m_s_g_i_d,, iinntt _c_a_t_e_g_o_r_y));; GNU gettext 0.18 May 2001 GETTEXT(3) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/EX������������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016040�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/EX/Makefile���������������������������������������������������������������0100644�0001753�0001753�00000000176�13046505100�0017550�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.1 2012/06/02 20:07:09 schwarze Exp $ REGRESS_TARGETS=spacing nested args .include ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/EX/args.in����������������������������������������������������������������0100644�0001753�0001753�00000000352�13136670125�0017402�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH EX-ARGS 1 "June 3, 2012" .SH NAME EX-args \- example macro with arguments .SH DESCRIPTION regular text .EX arg1 arg2 arg3 literal text .EE arg1 arg2 arg3 regular text ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/EX/args.out_ascii���������������������������������������������������������0100644�0001753�0001753�00000000501�14121400034�0020730�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EX-ARGS(1) General Commands Manual EX-ARGS(1) NNAAMMEE EX-args - example macro with arguments DDEESSCCRRIIPPTTIIOONN regular text literal text regular text OpenBSD June 3, 2012 EX-ARGS(1) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/EX/nested.in��������������������������������������������������������������0100644�0001753�0001753�00000000360�13136670125�0017727�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: nested.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH EX-NESTED 1 "June 3, 2012" .SH NAME EX-nested \- nested example macros .SH DESCRIPTION regular text .EX outer example .EX inner example .EE outer example .EE regular text ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/EX/nested.out_ascii�������������������������������������������������������0100644�0001753�0001753�00000000556�14121400034�0021270�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EX-NESTED(1) General Commands Manual EX-NESTED(1) NNAAMMEE EX-nested - nested example macros DDEESSCCRRIIPPTTIIOONN regular text outer example inner example outer example regular text OpenBSD June 3, 2012 EX-NESTED(1) ��������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/EX/spacing.in�������������������������������������������������������������0100644�0001753�0001753�00000000571�13136670125�0020075�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: spacing.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH EX-SPACING 1 "June 3, 2012" .SH NAME EX-spacing \- spacing around the example macro .SH DESCRIPTION regular text .EX example text .EE regular text .nf literal text .EX example text .EE regular text .PP .EX after PP, before nf .EE .nf .EX after nf, before fi .EE .fi after fi, before PP .EE .PP regular text ���������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/EX/spacing.out_ascii������������������������������������������������������0100644�0001753�0001753�00000000771�14121400034�0021431�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EX-SPACING(1) General Commands Manual EX-SPACING(1) NNAAMMEE EX-spacing - spacing around the example macro DDEESSCCRRIIPPTTIIOONN regular text example text regular text literal text example text regular text after PP, before nf after nf, before fi after fi, before PP regular text OpenBSD June 3, 2012 EX-SPACING(1) �������mandoc-1.14.6/regress/man/HP������������������������������������������������������������������������0040755�0001753�0001753�00000000000�14123140566�0016033�5����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/Makefile���������������������������������������������������������������0100644�0001753�0001753�00000000260�13634440766�0017560�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $OpenBSD: Makefile,v 1.4 2020/02/27 01:25:58 schwarze Exp $ REGRESS_TARGETS = break literal macrotag manyargs spacing vert HTML_TARGETS = literal .include ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/break.in���������������������������������������������������������������0100644�0001753�0001753�00000000604�13136670125�0017525�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: break.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH HP-BREAK 1 "September 21, 2011" .SH NAME HP-break \- breaking the head line of hanged paragraphs .SH DESCRIPTION .HP 12n This is an extremely long head line of a hanged paragraph; it is so long that it won't even fit on the line. .fi The body of the hanged paragraph is quite long as well and will again break the line. ����������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/break.out_ascii��������������������������������������������������������0100644�0001753�0001753�00000001021�14121400034�0021051�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HP-BREAK(1) General Commands Manual HP-BREAK(1) NNAAMMEE HP-break - breaking the head line of hanged paragraphs DDEESSCCRRIIPPTTIIOONN This is an extremely long head line of a hanged paragraph; it is so long that it won't even fit on the line. The body of the hanged paragraph is quite long as well and will again break the line. OpenBSD September 21, 2011 HP-BREAK(1) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/literal.in�������������������������������������������������������������0100644�0001753�0001753�00000000574�13437723452�0020111�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: literal.in,v 1.3 2019/01/06 04:41:15 schwarze Exp $ .TH HP-LITERAL 1 "January 6, 2019" .SH NAME HP-literal \- hanged paragraphs in literal context .SH DESCRIPTION BEGINTEST before hanged paragraph .HP 10n tag indented text .PP regular paragraph .nf literal text .HP 10n tag literal hanged paragraph .PP literal paragraph .fi regular text .br ENDTEST .br end of file ������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/literal.out_ascii������������������������������������������������������0100644�0001753�0001753�00000001060�14121400034�0021424�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HP-LITERAL(1) General Commands Manual HP-LITERAL(1) NNAAMMEE HP-literal - hanged paragraphs in literal context DDEESSCCRRIIPPTTIIOONN BEGINTEST before hanged paragraph tag indented text regular paragraph literal text tag literal hanged paragraph literal paragraph regular text ENDTEST end of file OpenBSD January 6, 2019 HP-LITERAL(1) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/macrotag.in������������������������������������������������������������0100644�0001753�0001753�00000000370�13136670125�0020236�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: macrotag.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH HP-MACROTAG 1 "September 20, 2011" .SH NAME HP-macrotag \- macro in the head of a tagged paragraph .SH DESCRIPTION regular text .HP .B longindent indented text .PP regular text ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/macrotag.out_ascii�����������������������������������������������������0100644�0001753�0001753�00000000553�14121400034�0021573�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HP-MACROTAG(1) General Commands Manual HP-MACROTAG(1) NNAAMMEE HP-macrotag - macro in the head of a tagged paragraph DDEESSCCRRIIPPTTIIOONN regular text lloonnggiinnddeenntt indented text regular text OpenBSD September 20, 2011 HP-MACROTAG(1) �����������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/manyargs.in������������������������������������������������������������0100644�0001753�0001753�00000000730�13136670125�0020262�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: manyargs.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH HP-MANYARGS 1 "January 4, 2011" .SH NAME HP-manyargs \- too many header args for hanged blocks .SH DESCRIPTION regular text .HP 10n tag1 indented text .PP regular text .HP 10n tag1 tag2 indented text .PP regular text .HP 10n tag2 tag1 tag3 indented text .nf literal text .HP 10n tag1 indented text .PP literal text .HP 10n tag1 tag2 indented text .PP literal text .HP 10n tag2 tag1 tag3 indented text ����������������������������������������mandoc-1.14.6/regress/man/HP/manyargs.out_ascii�����������������������������������������������������0100644�0001753�0001753�00000001271�14121400034�0021615�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HP-MANYARGS(1) General Commands Manual HP-MANYARGS(1) NNAAMMEE HP-manyargs - too many header args for hanged blocks DDEESSCCRRIIPPTTIIOONN regular text tag1 indented text regular text tag2 indented text regular text tag3 indented text literal text tag1 indented text literal text tag2 indented text literal text tag3 indented text OpenBSD January 4, 2011 HP-MANYARGS(1) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/spacing.in�������������������������������������������������������������0100644�0001753�0001753�00000002506�13136670125�0020070�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: spacing.in,v 1.6 2017/07/04 14:53:23 schwarze Exp $ .TH HP-SPACING 1 "December 23, 2014" .SH NAME HP-spacing \- spacing in hanged lists .SH DESCRIPTION Normal text. .HP Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .sp 1v Vertical spacing an a third line. .br A fourth line. .HP -10n Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .HP -0.36i Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .HP 0n Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .HP 1n Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .HP 2n Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .HP 4n Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .HP .76i Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .HP 16n Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .br And a second line. .HP 78n Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .LP Normal text. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/spacing.out_ascii������������������������������������������������������0100644�0001753�0001753�00000003366�14121400034�0021427�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HP-SPACING(1) General Commands Manual HP-SPACING(1) NNAAMMEE HP-spacing - spacing in hanged lists DDEESSCCRRIIPPTTIIOONN Normal text. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Vertical spacing an a third line. A fourth line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. And a second line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. Normal text. OpenBSD December 23, 2014 HP-SPACING(1) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/regress/man/HP/literal.out_html�������������������������������������������������������0100644�0001753�0001753�00000000273�13746323566�0021337�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

tag indented text

regular paragraph

literal
text
tag
literal
hanged
paragraph
literal
paragraph
regular text
mandoc-1.14.6/regress/man/HP/vert.in010064400017530001753000000005541362561733300174320ustar00schwarzeschwarze.\" $OpenBSD: vert.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .TH HP-VERT 1 "February 19, 2020" .SH NAME HP-vert \- vertical spacing before hanged lists .SH DESCRIPTION .PD 2v .HP Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .HP Each hanged paragraph gets a sufficient amount of text to wrap to the next line. .LP Normal text. mandoc-1.14.6/regress/man/HP/vert.out_ascii010064400017530001753000000007521412140003400207570ustar00schwarzeschwarzeHP-VERT(1) General Commands Manual HP-VERT(1) NNAAMMEE HP-vert - vertical spacing before hanged lists DDEESSCCRRIIPPTTIIOONN Each hanged paragraph gets a sufficient amount of text to wrap to the next line. Each hanged paragraph gets a sufficient amount of text to wrap to the next line. Normal text. OpenBSD February 19, 2020 HP-VERT(1) mandoc-1.14.6/regress/man/IP004075500017530001753000000000001412314056600160345ustar00schwarzeschwarzemandoc-1.14.6/regress/man/IP/Makefile010064400017530001753000000004261363444076600175650ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.11 2020/03/13 00:31:05 schwarze Exp $ REGRESS_TARGETS = bullet empty literal longhead manyargs spacing tag vert width TAG_TARGETS = empty tag UTF8_TARGETS = bullet LINT_TARGETS = empty HTML_TARGETS = bullet empty literal tag .include mandoc-1.14.6/regress/man/IP/empty.in010064400017530001753000000005761363444076600176210ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.3 2020/03/13 00:31:05 schwarze Exp $ .TH IP-EMPTY 1 "July 17, 2012" .SH NAME IP-empty \- empty indented paragraphs .SH DESCRIPTION BEGINTEST regular text .IP indented text .PP Empty IP is deleted: .IP .IP tag1 10n .IP tag2 indented text .PP Empty IP is deleted, RS does not cause additional spacing: .IP .RS .IP tag indented text .RE regular text ENDTEST mandoc-1.14.6/regress/man/IP/empty.out_ascii010064400017530001753000000010041412140003400211250ustar00schwarzeschwarzeIP-EMPTY(1) General Commands Manual IP-EMPTY(1) NNAAMMEE IP-empty - empty indented paragraphs DDEESSCCRRIIPPTTIIOONN BEGINTEST regular text indented text Empty IP is deleted: tag1 tag2 indented text Empty IP is deleted, RS does not cause additional spacing: tag indented text regular text ENDTEST OpenBSD July 17, 2012 IP-EMPTY(1) mandoc-1.14.6/regress/man/IP/empty.out_lint010064400017530001753000000002061363444076600210360ustar00schwarzeschwarzemandoc: empty.in:14:2: WARNING: skipping paragraph macro: IP empty mandoc: empty.in:21:2: WARNING: skipping paragraph macro: IP empty mandoc-1.14.6/regress/man/IP/literal.in010064400017530001753000000012701343772345200201040ustar00schwarzeschwarze.\" $OpenBSD: literal.in,v 1.7 2019/01/06 04:41:15 schwarze Exp $ .TH IP-LITERAL 1 "January 6, 2019" .SH NAME IP-literal \- indented paragraphs in literal context .SH DESCRIPTION BEGINTEST before indentation .IP tag 10n indented regular text .PP new regular paragraph .nf literal text .IP tag 10n indented literal text .PP new literal paragraph .fi regular text .SS literal into indented paragraph regular text .nf literal text .IP tag 10n indented literal text .fi indented regular text .PP new regular paragraph .SS literal out of indented paragraph regular text .IP tag 10n indented regular text .nf indented literal text .PP new literal paragraph .fi regular text .br ENDTEST .br end of file mandoc-1.14.6/regress/man/IP/literal.out_ascii010064400017530001753000000021731412140003400214330ustar00schwarzeschwarzeIP-LITERAL(1) General Commands Manual IP-LITERAL(1) NNAAMMEE IP-literal - indented paragraphs in literal context DDEESSCCRRIIPPTTIIOONN BEGINTEST before indentation tag indented regular text new regular paragraph literal text tag indented literal text new literal paragraph regular text lliitteerraall iinnttoo iinnddeenntteedd ppaarraaggrraapphh regular text literal text tag indented literal text indented regular text new regular paragraph lliitteerraall oouutt ooff iinnddeenntteedd ppaarraaggrraapphh regular text tag indented regular text indented literal text new literal paragraph regular text ENDTEST end of file OpenBSD January 6, 2019 IP-LITERAL(1) mandoc-1.14.6/regress/man/IP/longhead.in010064400017530001753000000005211313667012500202210ustar00schwarzeschwarze.\" $OpenBSD: longhead.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH IP-LONGHEAD 1 "April 8, 2014" .SH NAME IP-longhead \- indented paragraph with a long head .SH DESCRIPTION normal text .IP "This indented paragraph has ridiculously long text \ in its head, such that it doesn't even fit on the line" 6n paragraph body .PP normal text mandoc-1.14.6/regress/man/IP/longhead.out_ascii010064400017530001753000000007051412140003400215570ustar00schwarzeschwarzeIP-LONGHEAD(1) General Commands Manual IP-LONGHEAD(1) NNAAMMEE IP-longhead - indented paragraph with a long head DDEESSCCRRIIPPTTIIOONN normal text This indented paragraph has ridiculously long text in its head, such that it doesn't even fit on the line paragraph body normal text OpenBSD April 8, 2014 IP-LONGHEAD(1) mandoc-1.14.6/regress/man/IP/manyargs.in010064400017530001753000000007321313667012500202650ustar00schwarzeschwarze.\" $OpenBSD: manyargs.in,v 1.5 2017/07/04 14:53:23 schwarze Exp $ .TH IP-MANYARGS 1 "January 4, 2011" .SH NAME IP-manyargs \- too many header args for indented blocks .SH DESCRIPTION regular text .IP tag1 10n indented text .PP regular text .IP tag2 10n tag1 indented text .PP regular text .IP tag3 10n tag2 tag1 indented text .nf literal text .IP tag1 10n indented text .PP literal text .IP tag2 10n tag1 indented text .PP literal text .IP tag3 10n tag2 tag1 indented text mandoc-1.14.6/regress/man/IP/manyargs.out_ascii010064400017530001753000000012461412140003400216200ustar00schwarzeschwarzeIP-MANYARGS(1) General Commands Manual IP-MANYARGS(1) NNAAMMEE IP-manyargs - too many header args for indented blocks DDEESSCCRRIIPPTTIIOONN regular text tag1 indented text regular text tag2 indented text regular text tag3 indented text literal text tag1 indented text literal text tag2 indented text literal text tag3 indented text OpenBSD January 4, 2011 IP-MANYARGS(1) mandoc-1.14.6/regress/man/IP/spacing.in010064400017530001753000000011341313667012500200650ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .TH IP-SPACING 1 "September 21, 2015" .SH NAME IP-spacing \- spacing in indentend paragraphs .SH DESCRIPTION Normal text. .IP tag Indented text. .IP four Indented text. .IP ffive Indented text. .IP sixsix Indented text. .IP seseven Indented text. .IP "a much longer tag" Indented text. .LP Tags with trailing space: .IP "tag " Three plus one makes four. .IP "tag " Three plus two makes five. .IP "tag " Three plus three makes six. .IP "tag " Three plus four makes seven. .IP "tag " Three plus five makes eight. .LP Normal text. mandoc-1.14.6/regress/man/IP/spacing.out_ascii010064400017530001753000000014021412140003400214150ustar00schwarzeschwarzeIP-SPACING(1) General Commands Manual IP-SPACING(1) NNAAMMEE IP-spacing - spacing in indentend paragraphs DDEESSCCRRIIPPTTIIOONN Normal text. tag Indented text. four Indented text. ffive Indented text. sixsix Indented text. seseven Indented text. a much longer tag Indented text. Tags with trailing space: tag Three plus one makes four. tag Three plus two makes five. tag Three plus three makes six. tag Three plus four makes seven. tag Three plus five makes eight. Normal text. OpenBSD September 21, 2015 IP-SPACING(1) mandoc-1.14.6/regress/man/IP/width.in010064400017530001753000000014031313667012500175570ustar00schwarzeschwarze.\" $OpenBSD: width.in,v 1.9 2017/07/04 14:53:23 schwarze Exp $ .TH IP-WIDTH 1 "December 23, 2014" .SH NAME IP-width \- indentation width of indented paragraphs .SH DESCRIPTION Regular mode: .IP tag -10n indented .br text .IP tag -0.36i indented .br text .IP tag 0n indented .br text .IP tag 1n indented .br text .IP tag 2n indented .br text .IP tag 3n indented .br text .IP tag 4n indented .br text .IP tag 5n indented .br text .IP tag xxx indented .br text .IP tag 100n indented .br text .PP Literal mode: .nf .IP tag -10n indented text .IP tag -4n indented text .IP tag 0n indented text .IP tag 1n indented text .IP tag 2n indented text .IP tag 0.26i indented text .IP tag 4n indented text .IP tag 5n indented text .IP tag xxx indented text .IP tag 100n indented text mandoc-1.14.6/regress/man/IP/width.out_ascii010064400017530001753000000026621412140003400211210ustar00schwarzeschwarzeIP-WIDTH(1) General Commands Manual IP-WIDTH(1) NNAAMMEE IP-width - indentation width of indented paragraphs DDEESSCCRRIIPPTTIIOONN Regular mode: tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text Literal mode: tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text OpenBSD December 23, 2014 IP-WIDTH(1) mandoc-1.14.6/regress/man/IP/literal.out_html010064400017530001753000000023441374632356600213410ustar00schwarzeschwarze
indented regular text

new regular paragraph

literal
text
indented
literal
text
new
literal
paragraph
regular text

regular text

literal
text
indented
literal
text
indented regular text

new regular paragraph

regular text

indented regular text
indented
literal
text
new
literal
paragraph
regular text
mandoc-1.14.6/regress/man/IP/bullet.in010064400017530001753000000004111362561733400177330ustar00schwarzeschwarze.\" $OpenBSD: bullet.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .TH IP-BULLET 1 "February 20, 2020" .SH NAME IP-bullet \- bullet lists .SH DESCRIPTION BEGINTEST .IP * 3n one .IP * two .IP \(bu three .IP \(bu four .IP \- five .IP \- six .PP ENDTEST .br end of file mandoc-1.14.6/regress/man/IP/bullet.out_ascii010064400017530001753000000006061412140003400212650ustar00schwarzeschwarzeIP-BULLET(1) General Commands Manual IP-BULLET(1) NNAAMMEE IP-bullet - bullet lists DDEESSCCRRIIPPTTIIOONN BEGINTEST * one * two +o three +o four - five - six ENDTEST end of file OpenBSD February 20, 2020 IP-BULLET(1) mandoc-1.14.6/regress/man/IP/bullet.out_html010064400017530001753000000002631362561733400211650ustar00schwarzeschwarze
  • one
  • two
  • three
  • four
  • five
  • six
mandoc-1.14.6/regress/man/IP/bullet.out_utf8010064400017530001753000000006061412140003400210630ustar00schwarzeschwarzeIP-BULLET(1) General Commands Manual IP-BULLET(1) NNAAMMEE IP-bullet - bullet lists DDEESSCCRRIIPPTTIIOONN BEGINTEST * one * two • three • four - five - six ENDTEST end of file OpenBSD February 20, 2020 IP-BULLET(1) mandoc-1.14.6/regress/man/IP/empty.out_html010064400017530001753000000010011363272362000210150ustar00schwarzeschwarze
indented text

Empty IP is deleted:

indented text

Empty IP is deleted, RS does not cause additional spacing:

indented text
mandoc-1.14.6/regress/man/IP/empty.out_tag010064400017530001753000000002131412140003400206110ustar00schwarzeschwarzeNAME empty.mandoc_ascii 3 DESCRIPTION empty.mandoc_ascii 6 tag1 empty.mandoc_ascii 13 tag2 empty.mandoc_ascii 15 tag empty.mandoc_ascii 19 mandoc-1.14.6/regress/man/IP/tag.in010064400017530001753000000004371363272362000172210ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $ .TH IP-TAG 1 "March 10, 2020" .SH NAME IP-tag \- automatic tagging of indented blocks .SH DESCRIPTION BEGINTEST initial text .IP " strong" 10n text .IP "-strong" text .IP "\&\fI \-weak\fP" text .IP " strong" text .PP ENDTEST mandoc-1.14.6/regress/man/IP/tag.out_ascii010064400017530001753000000006311412140003400205470ustar00schwarzeschwarzeIP-TAG(1) General Commands Manual IP-TAG(1) NNAAMMEE IP-tag - automatic tagging of indented blocks DDEESSCCRRIIPPTTIIOONN BEGINTEST initial text strong text -strong text _-_w_e_a_k text strong text ENDTEST OpenBSD March 10, 2020 IP-TAG(1) mandoc-1.14.6/regress/man/IP/tag.out_html010064400017530001753000000004201363272362000204360ustar00schwarzeschwarze
strong
text
text
text
strong
text
mandoc-1.14.6/regress/man/IP/tag.out_tag010064400017530001753000000001531412140003400202310ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 strong tag.mandoc_ascii 11 weak tag.mandoc_ascii 13 mandoc-1.14.6/regress/man/IP/vert.in010064400017530001753000000003221362561733400174250ustar00schwarzeschwarze.\" $OpenBSD: vert.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .TH IP-VERT 1 "February 19, 2020" .SH NAME IP-vert \- vertical spacing before indented paragraphs .SH DESCRIPTION .PD 2v .IP tag text .IP tag text mandoc-1.14.6/regress/man/IP/vert.out_ascii010064400017530001753000000004651412140003400207610ustar00schwarzeschwarzeIP-VERT(1) General Commands Manual IP-VERT(1) NNAAMMEE IP-vert - vertical spacing before indented paragraphs DDEESSCCRRIIPPTTIIOONN tag text tag text OpenBSD February 19, 2020 IP-VERT(1) mandoc-1.14.6/regress/man/OP004075500017530001753000000000001412314056600160425ustar00schwarzeschwarzemandoc-1.14.6/regress/man/OP/Makefile010064400017530001753000000002071304650510200175470ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2015/02/06 11:54:03 schwarze Exp $ REGRESS_TARGETS = args LINT_TARGETS = args .include mandoc-1.14.6/regress/man/OP/args.in010064400017530001753000000004361313667012500174070ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH OP-ARGS 1 "February 6, 2015" .SH NAME OP-args \- argument handling of the man-ext OP macro .SH DESCRIPTION no argument: .OP one argument: .OP \-f two arguments: .OP \-f arg three arguments: .OP \-f arg bogus final text mandoc-1.14.6/regress/man/OP/args.out_ascii010064400017530001753000000006211412140003400207350ustar00schwarzeschwarzeOP-ARGS(1) General Commands Manual OP-ARGS(1) NNAAMMEE OP-args - argument handling of the man-ext OP macro DDEESSCCRRIIPPTTIIOONN no argument: [] one argument: [--ff] two arguments: [--ff _a_r_g] three arguments: [--ff _a_r_g] final text OpenBSD February 6, 2015 OP-ARGS(1) mandoc-1.14.6/regress/man/OP/args.out_lint010064400017530001753000000002101313667012500206240ustar00schwarzeschwarzemandoc: args.in:7:2: WARNING: missing option string, using "": OP mandoc: args.in:13:13: ERROR: skipping excess arguments: OP ... bogus mandoc-1.14.6/regress/man/PD004075500017530001753000000000001412314056600160275ustar00schwarzeschwarzemandoc-1.14.6/regress/man/PD/Makefile010064400017530001753000000002301304650510200175300ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2015/03/20 14:47:20 schwarze Exp $ REGRESS_TARGETS = args nextline spacing LINT_TARGETS = args .include mandoc-1.14.6/regress/man/PD/args.in010064400017530001753000000005761313667012500174010ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .TH PD-ARGS 1 "December 23, 2014" .SH NAME PD-args \- unusual arguments to the PD macro .SH DESCRIPTION initial text .PP default spacing .PD 2 .PP argument(2) .PD .PP no argument at all .PD 2v .PP argument(2v) .PD 2p .PP argument(2p) .PD 1cx .PP argument(1cx) .PD xxx .PP argument(xxx) .PD 0 zzz .PP excessive argument mandoc-1.14.6/regress/man/PD/args.out_ascii010064400017530001753000000007211412140003400207230ustar00schwarzeschwarzePD-ARGS(1) General Commands Manual PD-ARGS(1) NNAAMMEE PD-args - unusual arguments to the PD macro DDEESSCCRRIIPPTTIIOONN initial text default spacing argument(2) no argument at all argument(2v) argument(2p) argument(1cx) argument(xxx) excessive argument OpenBSD December 23, 2014 PD-ARGS(1) mandoc-1.14.6/regress/man/PD/args.out_lint010064400017530001753000000001031313667012500206120ustar00schwarzeschwarzemandoc: args.in:27:7: ERROR: skipping excess arguments: PD ... zzz mandoc-1.14.6/regress/man/PD/nextline.in010064400017530001753000000007751313667012500202740ustar00schwarzeschwarze.\" $OpenBSD: nextline.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH PD-NEXTLINE 1 "March 20, 2015" .SH NAME PD-nextline \- paragraph distance macro in next-line scope .SH DESCRIPTION some text .SH .PD 0v NEXT SECTION first paragraph .PP second paragraph .PD 1v .PP third paragraph .SS .PD 0v Subsection first paragraph .PP second paragraph .PD 1v .PP third paragraph .TP 6n .PD 0v tag list text .TP tag list text .PD 1v .TP tag list text .PP normal text .B .PD 0v bold text normal text .PP final paragraph mandoc-1.14.6/regress/man/PD/nextline.out_ascii010064400017530001753000000012171412140003500216170ustar00schwarzeschwarzePD-NEXTLINE(1) General Commands Manual PD-NEXTLINE(1) NNAAMMEE PD-nextline - paragraph distance macro in next-line scope DDEESSCCRRIIPPTTIIOONN some text NNEEXXTT SSEECCTTIIOONN first paragraph second paragraph third paragraph SSuubbsseeccttiioonn first paragraph second paragraph third paragraph tag list text tag list text tag list text normal text bboolldd tteexxtt normal text final paragraph OpenBSD March 20, 2015 PD-NEXTLINE(1) mandoc-1.14.6/regress/man/PD/spacing.in010064400017530001753000000013501313667012500200600ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH PD-SPACING 1 "July 28, 2012" .SH NAME PD-spacing \- effect of the PD macro on vertical spacing .SH DESCRIPTION initial text .PP paragraph .HP hanged paragraph .IP indented paragraph .TP tagged paragraph .SS subsection subsection text .PD 2 .SH DOUBLE SPACING initial text .PP paragraph .HP hanged paragraph .IP indented paragraph .TP tagged paragraph .SS subsection subsection text .PD 0 .SH NO SPACING initial text .PP paragraph .HP hanged paragraph .IP indented paragraph .TP tagged paragraph .SS subsection subsection text .PD 1 .SH NORMAL SPACING initial text .PP paragraph .HP hanged paragraph .IP indented paragraph .TP tagged paragraph .SS subsection subsection text mandoc-1.14.6/regress/man/PD/spacing.out_ascii010064400017530001753000000021551412140003500214170ustar00schwarzeschwarzePD-SPACING(1) General Commands Manual PD-SPACING(1) NNAAMMEE PD-spacing - effect of the PD macro on vertical spacing DDEESSCCRRIIPPTTIIOONN initial text paragraph hanged paragraph indented paragraph tagged paragraph ssuubbsseeccttiioonn subsection text DDOOUUBBLLEE SSPPAACCIINNGG initial text paragraph hanged paragraph indented paragraph tagged paragraph ssuubbsseeccttiioonn subsection text NNOO SSPPAACCIINNGG initial text paragraph hanged paragraph indented paragraph tagged paragraph ssuubbsseeccttiioonn subsection text NNOORRMMAALL SSPPAACCIINNGG initial text paragraph hanged paragraph indented paragraph tagged paragraph ssuubbsseeccttiioonn subsection text OpenBSD July 28, 2012 PD-SPACING(1) mandoc-1.14.6/regress/man/PP004075500017530001753000000000001412314056600160435ustar00schwarzeschwarzemandoc-1.14.6/regress/man/PP/Makefile010064400017530001753000000002261363444076600175720ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.5 2020/02/27 01:25:58 schwarze Exp $ REGRESS_TARGETS = args empty vert LINT_TARGETS = args empty .include mandoc-1.14.6/regress/man/PP/args.in010064400017530001753000000003751313667012500174120ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH PP-ARG 1 "July 4, 2014" .SH NAME PP-arg \- paragraphs macros with arguments .SH DESCRIPTION PP with argument: .PP arg LP with arguments: .LP arg1 arg2 P with argument: .P arg final text mandoc-1.14.6/regress/man/PP/args.out_ascii010064400017530001753000000005411412140003500207400ustar00schwarzeschwarzePP-ARG(1) General Commands Manual PP-ARG(1) NNAAMMEE PP-arg - paragraphs macros with arguments DDEESSCCRRIIPPTTIIOONN PP with argument: LP with arguments: P with argument: final text OpenBSD July 4, 2014 PP-ARG(1) mandoc-1.14.6/regress/man/PP/args.out_lint010064400017530001753000000002671341026767400206470ustar00schwarzeschwarzemandoc: args.in:7:2: ERROR: skipping all arguments: PP arg mandoc: args.in:9:2: ERROR: skipping all arguments: PP arg1 ... mandoc: args.in:11:2: ERROR: skipping all arguments: PP arg mandoc-1.14.6/regress/man/PP/empty.in010064400017530001753000000004331313667012500176070ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .TH PP-EMPTY 1 "May 24, 2010" .SH NAME PP-empty \- handling of empty paragraphs .SH DESCRIPTION .PP empty PP between two PPs: .PP .PP empty PP between PP and IP: .PP .IP head empty PP between IP and PP: .PP .PP the end mandoc-1.14.6/regress/man/PP/empty.out_ascii010064400017530001753000000005771412140003500211530ustar00schwarzeschwarzePP-EMPTY(1) General Commands Manual PP-EMPTY(1) NNAAMMEE PP-empty - handling of empty paragraphs DDEESSCCRRIIPPTTIIOONN empty PP between two PPs: empty PP between PP and IP: head empty PP between IP and PP: the end OpenBSD May 24, 2010 PP-EMPTY(1) mandoc-1.14.6/regress/man/PP/empty.out_lint010064400017530001753000000004151341026767400210440ustar00schwarzeschwarzemandoc: empty.in:8:2: WARNING: skipping paragraph macro: PP empty mandoc: empty.in:11:2: WARNING: skipping paragraph macro: PP empty mandoc: empty.in:14:2: WARNING: skipping paragraph macro: PP empty mandoc: empty.in:6:2: WARNING: skipping paragraph macro: PP after SH mandoc-1.14.6/regress/man/PP/vert.in010064400017530001753000000003431362561733500174400ustar00schwarzeschwarze.\" $OpenBSD: vert.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .TH PP-VERT 1 "February 19, 2020" .SH NAME PP-vert \- vertical spacing before an ordinary paragraph .SH DESCRIPTION .PD 2v .PP first paragraph .PP second paragraph mandoc-1.14.6/regress/man/PP/vert.out_ascii010064400017530001753000000005001412140003500207570ustar00schwarzeschwarzePP-VERT(1) General Commands Manual PP-VERT(1) NNAAMMEE PP-vert - vertical spacing before an ordinary paragraph DDEESSCCRRIIPPTTIIOONN first paragraph second paragraph OpenBSD February 19, 2020 PP-VERT(1) mandoc-1.14.6/regress/man/RS004075500017530001753000000000001412314056600160505ustar00schwarzeschwarzemandoc-1.14.6/regress/man/RS/Makefile010064400017530001753000000004501343772345200175730ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.14 2019/01/06 04:41:15 schwarze Exp $ REGRESS_TARGETS = an-margin breaking broken empty literal lonelyRE REGRESS_TARGETS += nested noRE nowidth paragraph REarg width LINT_TARGETS = empty lonelyRE noRE REarg HTML_TARGETS = literal paragraph .include mandoc-1.14.6/regress/man/RS/REarg.in010064400017530001753000000005621341026767400174670ustar00schwarzeschwarze.\" $OpenBSD: REarg.in,v 1.4 2018/12/21 16:58:49 schwarze Exp $ .TH RS-REARG 1 "December 21, 2018" .SH NAME RS-REarg \- arguments to the RE macro .SH DESCRIPTION .nr one 1 level 1 .RS 4n 2i level 2 .RS 2n level 3 .RE 2a back to 2 .RE \n[one]b back to 1 .RS 4n level 2 .RS 2n level 3 .RE "\\n[one]c" back to 1 .RS 4n level 2 .RS 2n level 3 .RE 0d back to 1 .RE \\n[one]e mandoc-1.14.6/regress/man/RS/REarg.out_ascii010064400017530001753000000007131412140003500210120ustar00schwarzeschwarzeRS-REARG(1) General Commands Manual RS-REARG(1) NNAAMMEE RS-REarg - arguments to the RE macro DDEESSCCRRIIPPTTIIOONN level 1 level 2 level 3 back to 2 back to 1 level 2 level 3 back to 1 level 2 level 3 back to 1 OpenBSD December 21, 2018 RS-REARG(1) mandoc-1.14.6/regress/man/RS/REarg.out_lint010064400017530001753000000007171341026767400207200ustar00schwarzeschwarzemandoc: REarg.in:8:8: ERROR: skipping excess arguments: RS ... 2i mandoc: REarg.in:12:6: ERROR: skipping excess arguments: RE ... a mandoc: REarg.in:14:6: ERROR: skipping excess arguments: RE ... b mandoc: REarg.in:20:7: ERROR: skipping excess arguments: RE ... c mandoc: REarg.in:26:6: ERROR: skipping excess arguments: RE ... d mandoc: REarg.in:28:6: ERROR: skipping excess arguments: RE ... e mandoc: REarg.in:28:2: ERROR: fewer RS blocks open, skipping: RE 1 mandoc-1.14.6/regress/man/RS/breaking.in010064400017530001753000000005431313667012500202420ustar00schwarzeschwarze.\" $OpenBSD: breaking.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH RS-BREAKING 1 "7 July 2012" .SH NAME RS-breaking \- some block gets broken by an RS block .SH DESCRIPTION preceding text .TP 4n * item .RS 8n indented text .RE middle text .TP 4n * .RS 8n indented text .RE .\" middle text .\" .TP 4n .\" .RS 8n .\" indented text .\" .RE trailing text mandoc-1.14.6/regress/man/RS/breaking.out_ascii010064400017530001753000000006361412140003500216000ustar00schwarzeschwarzeRS-BREAKING(1) General Commands Manual RS-BREAKING(1) NNAAMMEE RS-breaking - some block gets broken by an RS block DDEESSCCRRIIPPTTIIOONN preceding text * item indented text middle text * indented text trailing text OpenBSD 7 July 2012 RS-BREAKING(1) mandoc-1.14.6/regress/man/RS/broken.in010064400017530001753000000010771313667012500177430ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .TH RS-BROKEN 1 "January 24, 2015" .SH NAME RS-broken \- indented blocks broken by other blocks .SH DESCRIPTION broken by PP: .RS 2n indented .PP still indented .RE broken by IP: .RS indented .IP tag 6n first line .br second line .PP still indented .RE broken by TP: .RS indented .TP 6n tag first line .br second line .PP still indented .RE broken by HP: .RS indented .HP 2n Let's have a longer text here such that we can see the line break. .PP still indented .RE trailing PP: .RS indented .PP .RE final text mandoc-1.14.6/regress/man/RS/broken.out_ascii010064400017530001753000000015101412140003500212660ustar00schwarzeschwarzeRS-BROKEN(1) General Commands Manual RS-BROKEN(1) NNAAMMEE RS-broken - indented blocks broken by other blocks DDEESSCCRRIIPPTTIIOONN broken by PP: indented still indented broken by IP: indented tag first line second line still indented broken by TP: indented tag first line second line still indented broken by HP: indented Let's have a longer text here such that we can see the line break. still indented trailing PP: indented final text OpenBSD January 24, 2015 RS-BROKEN(1) mandoc-1.14.6/regress/man/RS/empty.in010064400017530001753000000003511313667012500176130ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH RS-EMPTY 1 "July 17, 2012" .SH NAME RS-empty \- empty margin reset blocks .SH DESCRIPTION regular text .RS 8n .RE regular text .RS 8n indented text .RE regular text mandoc-1.14.6/regress/man/RS/empty.out_ascii010064400017530001753000000005251412140003500211510ustar00schwarzeschwarzeRS-EMPTY(1) General Commands Manual RS-EMPTY(1) NNAAMMEE RS-empty - empty margin reset blocks DDEESSCCRRIIPPTTIIOONN regular text regular text indented text regular text OpenBSD July 17, 2012 RS-EMPTY(1) mandoc-1.14.6/regress/man/RS/empty.out_lint010064400017530001753000000000571313667012500210450ustar00schwarzeschwarzemandoc: empty.in:8:2: WARNING: empty block: RS mandoc-1.14.6/regress/man/RS/literal.in010064400017530001753000000006341343772345200201230ustar00schwarzeschwarze.\" $OpenBSD: literal.in,v 1.3 2019/01/05 20:00:33 schwarze Exp $ .TH RS-LITERAL 1 "January 5, 2019" .SH NAME RS-literal \- indented literal text .SH DESCRIPTION BEGINTEST .br initial regular text .nf literal text before display .RS This is a short line. This is a very long line that would wrap if it weren't in literal context. .RE literal text after display .fi final regular text .br ENDTEST .br end of file mandoc-1.14.6/regress/man/RS/literal.out_ascii010064400017530001753000000010631412140003500214450ustar00schwarzeschwarzeRS-LITERAL(1) General Commands Manual RS-LITERAL(1) NNAAMMEE RS-literal - indented literal text DDEESSCCRRIIPPTTIIOONN BEGINTEST initial regular text literal text before display This is a short line. This is a very long line that would wrap if it weren't in literal context. literal text after display final regular text ENDTEST end of file OpenBSD January 5, 2019 RS-LITERAL(1) mandoc-1.14.6/regress/man/RS/lonelyRE.in010064400017530001753000000006261313667012500202130ustar00schwarzeschwarze.\" $OpenBSD: lonelyRE.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH RS-LONELYRE 1 "November 10, 2013" .SH NAME RS-lonelyRE \- closing RS that is not open .SH DESCRIPTION .RS indented text .RE .TP 6n tag body .RE out of body .IP tag 6n body .RE out of body .HP 6n Here we need some text that is long enough to span more than one output line, such that we can see the hanging indentation. .RE out of body mandoc-1.14.6/regress/man/RS/lonelyRE.out_ascii010064400017530001753000000010151412140003500215370ustar00schwarzeschwarzeRS-LONELYRE(1) General Commands Manual RS-LONELYRE(1) NNAAMMEE RS-lonelyRE - closing RS that is not open DDEESSCCRRIIPPTTIIOONN indented text tag body out of body tag body out of body Here we need some text that is long enough to span more than one output line, such that we can see the hanging indentation. out of body OpenBSD November 10, 2013 RS-LONELYRE(1) mandoc-1.14.6/regress/man/RS/lonelyRE.out_lint010064400017530001753000000003441313667012500214370ustar00schwarzeschwarzemandoc: lonelyRE.in:12:2: ERROR: skipping end of block that is not open: RE mandoc: lonelyRE.in:16:2: ERROR: skipping end of block that is not open: RE mandoc: lonelyRE.in:21:2: ERROR: skipping end of block that is not open: RE mandoc-1.14.6/regress/man/RS/nested.in010064400017530001753000000013471313667012500177450ustar00schwarzeschwarze.\" $OpenBSD: nested.in,v 1.4 2017/07/04 14:53:23 schwarze Exp $ .TH RS-NESTED 1 "April 4, 2015" .SH NAME RS-nested \- various blocks nested inside reset blocks .SH DESCRIPTION regular text .RS outer text (default indent) .RS inner text (default indent) .RE outer text .RE regular text .IP tag 6n tagged text (6n) .RS outer text (saved 6n) .RS inner text (default indent) .RE outer text .RE regular text .RS 4n outer text (4n) .RS 2n inner text (2n) .RE outer text .IP indent 8n text (8n) .TP 6n tag text (6n) .HP 12n hanged This is very long text. Let's see where it will break the line, and which indent the next line will have - hopefully 12n. .PP outer text .RE nesting HP and RS inside RS: .RS outer text .HP 2n .RS 4n inner text .RE .RE mandoc-1.14.6/regress/man/RS/nested.out_ascii010064400017530001753000000017741412140003500213040ustar00schwarzeschwarzeRS-NESTED(1) General Commands Manual RS-NESTED(1) NNAAMMEE RS-nested - various blocks nested inside reset blocks DDEESSCCRRIIPPTTIIOONN regular text outer text (default indent) inner text (default indent) outer text regular text tag tagged text (6n) outer text (saved 6n) inner text (default indent) outer text regular text outer text (4n) inner text (2n) outer text indent text (8n) tag text (6n) hanged This is very long text. Let's see where it will break the line, and which indent the next line will have - hopefully 12n. outer text nesting HP and RS inside RS: outer text inner text OpenBSD April 4, 2015 RS-NESTED(1) mandoc-1.14.6/regress/man/RS/noRE.in010064400017530001753000000002731313667012500173230ustar00schwarzeschwarze.\" $OpenBSD: noRE.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH RS-NORE 1 "June 20, 2014" .SH NAME RS-noRE \- unclosed indented block .SH DESCRIPTION regular text .RS 8n indented text mandoc-1.14.6/regress/man/RS/noRE.out_ascii010064400017530001753000000004521412140003500206550ustar00schwarzeschwarzeRS-NORE(1) General Commands Manual RS-NORE(1) NNAAMMEE RS-noRE - unclosed indented block DDEESSCCRRIIPPTTIIOONN regular text indented text OpenBSD June 20, 2014 RS-NORE(1) mandoc-1.14.6/regress/man/RS/noRE.out_lint010064400017530001753000000000771313667012500205540ustar00schwarzeschwarzemandoc: noRE.in:8:2: ERROR: appending missing end of block: RS mandoc-1.14.6/regress/man/RS/nowidth.in010064400017530001753000000005251313667012500201340ustar00schwarzeschwarze.\" $OpenBSD: nowidth.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH RS-NESTED 1 "April 6, 2015" .SH NAME RS-nowidth \- indentation blocks not specifying a width .SH DESCRIPTION regular text .RS top-level indented list .RE regular text .TP 2n \(bu bullet list .RS indented text .RE regular text .RS top-level indented list .RE regular text mandoc-1.14.6/regress/man/RS/nowidth.out_ascii010064400017530001753000000007241412140003500214700ustar00schwarzeschwarzeRS-NESTED(1) General Commands Manual RS-NESTED(1) NNAAMMEE RS-nowidth - indentation blocks not specifying a width DDEESSCCRRIIPPTTIIOONN regular text top-level indented list regular text +o bullet list indented text regular text top-level indented list regular text OpenBSD April 6, 2015 RS-NESTED(1) mandoc-1.14.6/regress/man/RS/width.in010064400017530001753000000005331313667012500175760ustar00schwarzeschwarze.\" $OpenBSD: width.in,v 1.5 2017/07/04 14:53:23 schwarze Exp $ .TH RS-WIDTH 1 "December 23, 2014" .SH NAME RS-width \- negative and excessive indentation .SH DESCRIPTION regular text .RS -14n indented text .RE regular text .RS -0.36i indented text .RE regular text .RS 0.36i indented text .RE regular text .RS 100n indented text .RE regular text mandoc-1.14.6/regress/man/RS/width.out_ascii010064400017530001753000000012051412140003500211260ustar00schwarzeschwarzeRS-WIDTH(1) General Commands Manual RS-WIDTH(1) NNAAMMEE RS-width - negative and excessive indentation DDEESSCCRRIIPPTTIIOONN regular text indented text regular text indented text regular text indented text regular text indented text regular text OpenBSD December 23, 2014 RS-WIDTH(1) mandoc-1.14.6/regress/man/RS/an-margin.in010064400017530001753000000005411312673151700203310ustar00schwarzeschwarze.\" $OpenBSD: an-margin.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH RS-AN-MARGIN 1 "June 13, 2017" .SH NAME RS-an-margin \- reStructuredText peeks at an internal register .SH DESCRIPTION regular text .RS 0.0 zero indent \n[an-margin] .RS 3.5 non-zero indent \n[an-margin] .RE back to zero indent \n[an-margin] .RE back to regular text \n[an-margin] mandoc-1.14.6/regress/man/RS/an-margin.out_ascii010064400017530001753000000006351412140003500216660ustar00schwarzeschwarzeRS-AN-MARGIN(1) General Commands Manual RS-AN-MARGIN(1) NNAAMMEE RS-an-margin - reStructuredText peeks at an internal register DDEESSCCRRIIPPTTIIOONN regular text zero indent 168 non-zero indent 252 back to zero indent 168 back to regular text 168 OpenBSD June 13, 2017 RS-AN-MARGIN(1) mandoc-1.14.6/regress/man/RS/literal.out_html010064400017530001753000000004441374632356600213540ustar00schwarzeschwarze
initial regular text

literal text
before display
This is a short line.
This is a very long line that would wrap if it weren't in literal context.
literal text
after display

final regular text
mandoc-1.14.6/regress/man/RS/paragraph.in010064400017530001753000000005361341430506000204170ustar00schwarzeschwarze.\" $OpenBSD: paragraph.in,v 1.1 2019/01/06 04:41:15 schwarze Exp $ .TH RS-PARAGRAPH 1 "January 6, 2019" .SH NAME RS-paragraph \- interaction between regular and indented paragraphs .SH DESCRIPTION BEGINTEST before paragraph .PP regular paragraph .RS indented paragraph .PP nested paragraph .RE regular text after display .br ENDTEST .br end of file mandoc-1.14.6/regress/man/RS/paragraph.out_ascii010064400017530001753000000007331412140003500217610ustar00schwarzeschwarzeRS-PARAGRAPH(1) General Commands Manual RS-PARAGRAPH(1) NNAAMMEE RS-paragraph - interaction between regular and indented paragraphs DDEESSCCRRIIPPTTIIOONN BEGINTEST before paragraph regular paragraph indented paragraph nested paragraph regular text after display ENDTEST end of file OpenBSD January 6, 2019 RS-PARAGRAPH(1) mandoc-1.14.6/regress/man/RS/paragraph.out_html010064400017530001753000000002311363444076600216550ustar00schwarzeschwarze

regular paragraph

indented paragraph

nested paragraph

regular text after display
mandoc-1.14.6/regress/man/SH004075500017530001753000000000001412314056600160365ustar00schwarzeschwarzemandoc-1.14.6/regress/man/SH/Makefile010064400017530001753000000013601367274433600175670ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2020/04/04 20:23:07 schwarze Exp $ REGRESS_TARGETS = broken broken_eline empty_before longarg noarg paragraph vert LINT_TARGETS = broken broken_eline empty_before noarg HTML_TARGETS = paragraph TAG_TARGETS = paragraph # groff-1.22.3 defects: # - .SH without args just before EOF causes two additional blank lines. # - Empty .SH heads cause additional vertical spacing. # - If .TP or .IP breaks .SH, the tag becomes bold. # - If .HP breaks .SH, a line is broken after the next input line. # - If .RS/RE/nf/fi breaks .SH, the next input line becomes bold. # - .UR does not break .SH. # - blank line in .SH next line scope causes blank lines and bogus indent SKIP_GROFF = broken broken_eline noarg .include mandoc-1.14.6/regress/man/SH/broken.in010064400017530001753000000003051313667012500177220ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH SH-BROKEN 1 "July 30, 2014" .SH NAME SH-broken \- section header line scope broken by end of file .SH DESCRIPTION some text .SH mandoc-1.14.6/regress/man/SH/broken.out_ascii010064400017530001753000000004441412140003500212610ustar00schwarzeschwarzeSH-BROKEN(1) General Commands Manual SH-BROKEN(1) NNAAMMEE SH-broken - section header line scope broken by end of file DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 30, 2014 SH-BROKEN(1) mandoc-1.14.6/regress/man/SH/broken.out_lint010064400017530001753000000001011313667012500211430ustar00schwarzeschwarzemandoc: broken.in:7:2: WARNING: line scope broken: EOF breaks SH mandoc-1.14.6/regress/man/SH/broken_eline.in010064400017530001753000000003271313667012500211020ustar00schwarzeschwarze.\" $OpenBSD: broken_eline.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH SH-BROKEN_ELINE 1 "July 30, 2014" .SH NAME SH-broken_eline \- section and element line scope broken by eof .SH DESCRIPTION some text .SH .B mandoc-1.14.6/regress/man/SH/broken_eline.out_ascii010064400017530001753000000004471412140003500224400ustar00schwarzeschwarzeSH-BROKEN_ELINE(1) General Commands Manual SH-BROKEN_ELINE(1) NNAAMMEE SH-broken_eline - section and element line scope broken by eof DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 30, 2014 SH-BROKEN_ELINE(1) mandoc-1.14.6/regress/man/SH/broken_eline.out_lint010064400017530001753000000002151313667012500223250ustar00schwarzeschwarzemandoc: broken_eline.in:8:2: WARNING: line scope broken: EOF breaks B mandoc: broken_eline.in:7:2: WARNING: line scope broken: EOF breaks SH mandoc-1.14.6/regress/man/SH/empty_before.in010064400017530001753000000003251313667012500211240ustar00schwarzeschwarze.\" $OpenBSD: empty_before.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH SH-EMPTY_BEFORE 1 "August 18, 2014" .PP .SH NAME SH-empty_before \- empty paragraph before first section header .SH DESCRIPTION some text mandoc-1.14.6/regress/man/SH/empty_before.out_ascii010064400017530001753000000004461412140003500224630ustar00schwarzeschwarzeSH-EMPTY_BEFORE(1) General Commands Manual SH-EMPTY_BEFORE(1) NNAAMMEE SH-empty_before - empty paragraph before first section header DDEESSCCRRIIPPTTIIOONN some text OpenBSD August 18, 2014 SH-EMPTY_BEFORE(1) mandoc-1.14.6/regress/man/SH/empty_before.out_lint010064400017530001753000000001111313667012500223440ustar00schwarzeschwarzemandoc: empty_before.in:3:2: WARNING: skipping paragraph macro: PP empty mandoc-1.14.6/regress/man/SH/longarg.in010064400017530001753000000004411313667012500200740ustar00schwarzeschwarze.\" $OpenBSD: longarg.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH SH-LONGARG 1 "April 4, 2015" .SH NAME SH-longarg \- long section header lines .SH DESCRIPTION initial text .SH "This section has a really ridiculously long title\ which won't even fit on the line." custom section text mandoc-1.14.6/regress/man/SH/longarg.out_ascii010064400017530001753000000010231412140003500214240ustar00schwarzeschwarzeSH-LONGARG(1) General Commands Manual SH-LONGARG(1) NNAAMMEE SH-longarg - long section header lines DDEESSCCRRIIPPTTIIOONN initial text TThhiiss sseeccttiioonn hhaass aa rreeaallllyy rriiddiiccuulloouussllyy lloonngg ttiittllee wwhhiicchh wwoonn''tt eevveenn ffiitt oonn tthhee lliinnee.. custom section text OpenBSD April 4, 2015 SH-LONGARG(1) mandoc-1.14.6/regress/man/SH/noarg.in010064400017530001753000000011171313667012500175520ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.5 2017/07/04 14:53:23 schwarze Exp $ .TH SH-NOARG 1 "March 20, 2015" .SH NAME SH-noarg \- empty header lines .SH .SH DESCRIPTION initial text .SH .SS Subsection subsection text .SH .TP 6n tag tagged list .SH .IP tag 6n indented list .SH .HP 6n This is a hanged paragraph. A bit more text is needed to see the effect. .SH .PP normal paragraph .SH .RS 6n indented paragraph .SH .RE after the end of the indented paragraph .SH .UR www.openbsd.org hyperlink .SH .UE after the end of the hyperlink .SH .nf no-fill mode .SH .fi back in fill mode .SH SEE ALSO broken(1) mandoc-1.14.6/regress/man/SH/noarg.out_ascii010064400017530001753000000013321412140003500211040ustar00schwarzeschwarzeSH-NOARG(1) General Commands Manual SH-NOARG(1) NNAAMMEE SH-noarg - empty header lines DDEESSCCRRIIPPTTIIOONN initial text SSuubbsseeccttiioonn subsection text tag tagged list tag indented list This is a hanged paragraph. A bit more text is needed to see the effect. normal paragraph indented paragraph after the end of the indented paragraph hyperlink after the end of the hyperlink no-fill mode back in fill mode SSEEEE AALLSSOO broken(1) OpenBSD March 20, 2015 SH-NOARG(1) mandoc-1.14.6/regress/man/SH/noarg.out_lint010064400017530001753000000016301343772345200210070ustar00schwarzeschwarzemandoc: noarg.in:5:2: WARNING: line scope broken: SH breaks SH mandoc: noarg.in:9:2: WARNING: line scope broken: SS breaks SH mandoc: noarg.in:12:2: WARNING: line scope broken: TP breaks SH mandoc: noarg.in:16:2: WARNING: line scope broken: IP breaks SH mandoc: noarg.in:19:2: WARNING: line scope broken: HP breaks SH mandoc: noarg.in:23:2: WARNING: line scope broken: PP breaks SH mandoc: noarg.in:26:2: WARNING: line scope broken: RS breaks SH mandoc: noarg.in:29:2: WARNING: line scope broken: RE breaks SH mandoc: noarg.in:30:2: ERROR: skipping end of block that is not open: RE mandoc: noarg.in:32:2: WARNING: line scope broken: UR breaks SH mandoc: noarg.in:35:2: WARNING: line scope broken: UE breaks SH mandoc: noarg.in:36:2: ERROR: skipping end of block that is not open: UE mandoc: noarg.in:45:1: WARNING: skipping blank line in line scope mandoc: noarg.in:42:2: STYLE: fill mode already enabled, skipping: fi mandoc-1.14.6/regress/man/SH/paragraph.in010064400017530001753000000005061341430506100204030ustar00schwarzeschwarze.\" $OpenBSD: paragraph.in,v 1.1 2019/01/06 04:41:15 schwarze Exp $ .TH SH-PARAGRAPH 1 "January 6, 2019" .SH NAME SH-paragraph \- interaction of section headers with paragraphs .SH SYNOPSIS BEGINTEST .SH DESCRIPTION This text immediately follows a section header. .PP This is a paragraph. .SH EXAMPLES ENDTEST .PP end of file mandoc-1.14.6/regress/man/SH/paragraph.out_ascii010064400017530001753000000007211412140003500217440ustar00schwarzeschwarzeSH-PARAGRAPH(1) General Commands Manual SH-PARAGRAPH(1) NNAAMMEE SH-paragraph - interaction of section headers with paragraphs SSYYNNOOPPSSIISS BEGINTEST DDEESSCCRRIIPPTTIIOONN This text immediately follows a section header. This is a paragraph. EEXXAAMMPPLLEESS ENDTEST end of file OpenBSD January 6, 2019 SH-PARAGRAPH(1) mandoc-1.14.6/regress/man/SH/paragraph.out_html010064400017530001753000000005341363444076600216510ustar00schwarzeschwarze

This text immediately follows a section header.

This is a paragraph.

mandoc-1.14.6/regress/man/SH/vert.in010064400017530001753000000003061362561733500174320ustar00schwarzeschwarze.\" $OpenBSD: vert.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .TH SH-VERT 1 "February 20, 2020" .SH NAME SH-vert \- vertical spacing of sections .SH DESCRIPTION .PD 2v .SH EXAMPLES .PD 1v .PP text mandoc-1.14.6/regress/man/SH/vert.out_ascii010064400017530001753000000004431412140003500207600ustar00schwarzeschwarzeSH-VERT(1) General Commands Manual SH-VERT(1) NNAAMMEE SH-vert - vertical spacing of sections DDEESSCCRRIIPPTTIIOONN EEXXAAMMPPLLEESS text OpenBSD February 20, 2020 SH-VERT(1) mandoc-1.14.6/regress/man/SH/paragraph.out_tag010064400017530001753000000002101412140003500214200ustar00schwarzeschwarzeNAME paragraph.mandoc_ascii 3 SYNOPSIS paragraph.mandoc_ascii 6 DESCRIPTION paragraph.mandoc_ascii 9 EXAMPLES paragraph.mandoc_ascii 14 mandoc-1.14.6/regress/man/SS004075500017530001753000000000001412314056600160515ustar00schwarzeschwarzemandoc-1.14.6/regress/man/SS/Makefile010064400017530001753000000013061367274433600176020ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2020/04/04 20:23:07 schwarze Exp $ REGRESS_TARGETS = broken broken_eline longarg noarg paragraph vert LINT_TARGETS = broken broken_eline noarg HTML_TARGETS = paragraph TAG_TARGETS = paragraph # groff-1.22.3 defects: # - .SS without args just before EOF causes two additional blank lines. # - Empty .SS heads cause additional vertical spacing. # - If .TP or .IP breaks .SS, the tag becomes bold. # - If .HP breaks .SS, a line is broken after the next input line. # - If .RS/RE/nf/fi breaks .SS, the next input line becomes bold. # - .UR does not break .SS. # - blank line in .SS next-line scope causes a blank line SKIP_GROFF = broken broken_eline noarg .include mandoc-1.14.6/regress/man/SS/broken.in010064400017530001753000000003051313667012500177350ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH SS-BROKEN 1 "July 30, 2014" .SH NAME SS-broken \- section header line scope broken by end of file .SH DESCRIPTION some text .SS mandoc-1.14.6/regress/man/SS/broken.out_ascii010064400017530001753000000004441412140003500212740ustar00schwarzeschwarzeSS-BROKEN(1) General Commands Manual SS-BROKEN(1) NNAAMMEE SS-broken - section header line scope broken by end of file DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 30, 2014 SS-BROKEN(1) mandoc-1.14.6/regress/man/SS/broken.out_lint010064400017530001753000000001011313667012500211560ustar00schwarzeschwarzemandoc: broken.in:7:2: WARNING: line scope broken: EOF breaks SS mandoc-1.14.6/regress/man/SS/broken_eline.in010064400017530001753000000003321313667012500211110ustar00schwarzeschwarze.\" $OpenBSD: broken_eline.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH SS-BROKEN_ELINE 1 "July 30, 2014" .SH NAME SS-broken_eline \- subsection and element line scope broken by eof .SH DESCRIPTION some text .SS .B mandoc-1.14.6/regress/man/SS/broken_eline.out_ascii010064400017530001753000000004521412140003500224470ustar00schwarzeschwarzeSS-BROKEN_ELINE(1) General Commands Manual SS-BROKEN_ELINE(1) NNAAMMEE SS-broken_eline - subsection and element line scope broken by eof DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 30, 2014 SS-BROKEN_ELINE(1) mandoc-1.14.6/regress/man/SS/broken_eline.out_lint010064400017530001753000000002151313667012500223400ustar00schwarzeschwarzemandoc: broken_eline.in:8:2: WARNING: line scope broken: EOF breaks B mandoc: broken_eline.in:7:2: WARNING: line scope broken: EOF breaks SS mandoc-1.14.6/regress/man/SS/longarg.in010064400017530001753000000004301313667012500201050ustar00schwarzeschwarze.\" $OpenBSD: longarg.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH SS-LONGARG 1 "April 4, 2015" .SH NAME SS-longarg \- long subsection header lines .SH DESCRIPTION initial text .SS This subsection has a ridiculously long title which won't even fit on the line. subsection text mandoc-1.14.6/regress/man/SS/longarg.out_ascii010064400017530001753000000010131412140003500214360ustar00schwarzeschwarzeSS-LONGARG(1) General Commands Manual SS-LONGARG(1) NNAAMMEE SS-longarg - long subsection header lines DDEESSCCRRIIPPTTIIOONN initial text TThhiiss ssuubbsseeccttiioonn hhaass aa rriiddiiccuulloouussllyy lloonngg ttiittllee wwhhiicchh wwoonn''tt eevveenn ffiitt oonn tthhee lliinnee.. subsection text OpenBSD April 4, 2015 SS-LONGARG(1) mandoc-1.14.6/regress/man/SS/noarg.in010064400017530001753000000011441313667012500175650ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .TH SS-NOARG 1 "March 20, 2015" .SH NAME SS-noarg \- empty subsection header lines .SS .SH DESCRIPTION initial text .SS .SS Subsection subsection text .SS .TP 6n tag tagged list .SS .IP tag 6n indented list .SS .HP 6n This is a hanged paragraph. A bit more text is needed to see the effect. .SS .PP normal paragraph .SS .RS 6n indented paragraph .SS .RE after the end of the indented paragraph .SS .UR www.openbsd.org hyperlink .SS .UE after the end of the hyperlink .SS .nf no-fill mode .SS .fi back in fill mode .SS Subsection with a blank line mandoc-1.14.6/regress/man/SS/noarg.out_ascii010064400017530001753000000013701412140003500211210ustar00schwarzeschwarzeSS-NOARG(1) General Commands Manual SS-NOARG(1) NNAAMMEE SS-noarg - empty subsection header lines DDEESSCCRRIIPPTTIIOONN initial text SSuubbsseeccttiioonn subsection text tag tagged list tag indented list This is a hanged paragraph. A bit more text is needed to see the effect. normal paragraph indented paragraph after the end of the indented paragraph hyperlink after the end of the hyperlink no-fill mode back in fill mode SSuubbsseeccttiioonn with a blank line OpenBSD March 20, 2015 SS-NOARG(1) mandoc-1.14.6/regress/man/SS/noarg.out_lint010064400017530001753000000016301343772345200210220ustar00schwarzeschwarzemandoc: noarg.in:5:2: WARNING: line scope broken: SH breaks SS mandoc: noarg.in:9:2: WARNING: line scope broken: SS breaks SS mandoc: noarg.in:12:2: WARNING: line scope broken: TP breaks SS mandoc: noarg.in:16:2: WARNING: line scope broken: IP breaks SS mandoc: noarg.in:19:2: WARNING: line scope broken: HP breaks SS mandoc: noarg.in:23:2: WARNING: line scope broken: PP breaks SS mandoc: noarg.in:26:2: WARNING: line scope broken: RS breaks SS mandoc: noarg.in:29:2: WARNING: line scope broken: RE breaks SS mandoc: noarg.in:30:2: ERROR: skipping end of block that is not open: RE mandoc: noarg.in:32:2: WARNING: line scope broken: UR breaks SS mandoc: noarg.in:35:2: WARNING: line scope broken: UE breaks SS mandoc: noarg.in:36:2: ERROR: skipping end of block that is not open: UE mandoc: noarg.in:45:1: WARNING: skipping blank line in line scope mandoc: noarg.in:42:2: STYLE: fill mode already enabled, skipping: fi mandoc-1.14.6/regress/man/SS/paragraph.in010064400017530001753000000005351341430506300204220ustar00schwarzeschwarze.\" $OpenBSD: paragraph.in,v 1.1 2019/01/06 04:41:15 schwarze Exp $ .TH SS-PARAGRAPH 1 "January 6, 2019" .SH NAME SS-paragraph \- interaction of subsection headers with paragraphs .SH DESCRIPTION BEGINTEST .SS First subsection This text immediately follows a subsection header. .PP This is a paragraph. .SS Second subsection ENDTEST .PP end of file mandoc-1.14.6/regress/man/SS/paragraph.out_ascii010064400017530001753000000010141412140003500217530ustar00schwarzeschwarzeSS-PARAGRAPH(1) General Commands Manual SS-PARAGRAPH(1) NNAAMMEE SS-paragraph - interaction of subsection headers with paragraphs DDEESSCCRRIIPPTTIIOONN BEGINTEST FFiirrsstt ssuubbsseeccttiioonn This text immediately follows a subsection header. This is a paragraph. SSeeccoonndd ssuubbsseeccttiioonn ENDTEST end of file OpenBSD January 6, 2019 SS-PARAGRAPH(1) mandoc-1.14.6/regress/man/SS/paragraph.out_html010064400017530001753000000006021363444076600216600ustar00schwarzeschwarze

This text immediately follows a subsection header.

This is a paragraph.

mandoc-1.14.6/regress/man/SS/vert.in010064400017530001753000000004031362561733600174440ustar00schwarzeschwarze.\" $OpenBSD: vert.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .TH SS-VERT 1 "February 19, 2020" .SH NAME SS-vert \- vertical spacing of subsections .SH DESCRIPTION .PD 2v .SS First subsection .PD 1v .SS Second subsection first paragraph .PP second paragraph mandoc-1.14.6/regress/man/SS/vert.out_ascii010064400017530001753000000006301412140003500207710ustar00schwarzeschwarzeSS-VERT(1) General Commands Manual SS-VERT(1) NNAAMMEE SS-vert - vertical spacing of subsections DDEESSCCRRIIPPTTIIOONN FFiirrsstt ssuubbsseeccttiioonn SSeeccoonndd ssuubbsseeccttiioonn first paragraph second paragraph OpenBSD February 19, 2020 SS-VERT(1) mandoc-1.14.6/regress/man/SS/paragraph.out_tag010064400017530001753000000002311412140003500214360ustar00schwarzeschwarzeNAME paragraph.mandoc_ascii 3 DESCRIPTION paragraph.mandoc_ascii 6 First_subsection paragraph.mandoc_ascii 9 Second_subsection paragraph.mandoc_ascii 14 mandoc-1.14.6/regress/man/TH004075500017530001753000000000001412314056600160375ustar00schwarzeschwarzemandoc-1.14.6/regress/man/TH/Makefile010064400017530001753000000006601304650510600175530ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.9 2015/02/06 11:54:03 schwarze Exp $ REGRESS_TARGETS = noTH noarg onearg twoargs sixargs case longtit longvol REGRESS_TARGETS += emptydate onlyyear isodate mdocdate baddate longdate REGRESS_TARGETS += nobody LINT_TARGETS = noTH noarg onearg twoargs sixargs case LINT_TARGETS += emptydate baddate longdate nobody SKIP_GROFF = noTH longtit longvol longdate SKIP_ASCII = noTH .include mandoc-1.14.6/regress/man/TH/baddate.in010064400017530001753000000003051313667012500200270ustar00schwarzeschwarze.\" $OpenBSD: baddate.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-BADDATE 1 "three bad words" source .SH NAME TH-baddate \- the date has three words, but bad ones .SH DESCRIPTION Some text. mandoc-1.14.6/regress/man/TH/baddate.out_ascii010064400017530001753000000004351412140003500213660ustar00schwarzeschwarzeTH-BADDATE(1) General Commands Manual TH-BADDATE(1) NNAAMMEE TH-baddate - the date has three words, but bad ones DDEESSCCRRIIPPTTIIOONN Some text. source three bad words TH-BADDATE(1) mandoc-1.14.6/regress/man/TH/baddate.out_lint010064400017530001753000000001331363444076600212660ustar00schwarzeschwarzemandoc: baddate.in:2:18: WARNING: cannot parse date, using it verbatim: TH three bad words mandoc-1.14.6/regress/man/TH/case.in010064400017530001753000000002521313667012500173570ustar00schwarzeschwarze.\" $OpenBSD: case.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-case 1 "June 13, 2014" .SH NAME TH-case \- document title is not all caps .SH DESCRIPTION some text mandoc-1.14.6/regress/man/TH/case.out_ascii010064400017530001753000000004211412140003500207100ustar00schwarzeschwarzeTH-case(1) General Commands Manual TH-case(1) NNAAMMEE TH-case - document title is not all caps DDEESSCCRRIIPPTTIIOONN some text OpenBSD June 13, 2014 TH-case(1) mandoc-1.14.6/regress/man/TH/case.out_lint010064400017530001753000000001171313667012500206060ustar00schwarzeschwarzemandoc: case.in:2:8: STYLE: lower case character in document title: TH TH-case mandoc-1.14.6/regress/man/TH/emptydate.in010064400017530001753000000002521313667012500204400ustar00schwarzeschwarze.\" $OpenBSD: emptydate.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-EMPTYDATE 1 "" source .SH NAME TH-emptydate \- an empty date string .SH DESCRIPTION Some text. mandoc-1.14.6/regress/man/TH/emptydate.out_ascii010064400017530001753000000004151412140003500217740ustar00schwarzeschwarzeTH-EMPTYDATE(1) General Commands Manual TH-EMPTYDATE(1) NNAAMMEE TH-emptydate - an empty date string DDEESSCCRRIIPPTTIIOONN Some text. source TH-EMPTYDATE(1) mandoc-1.14.6/regress/man/TH/emptydate.out_lint010064400017530001753000000000771363444076600217050ustar00schwarzeschwarzemandoc: emptydate.in:2:20: WARNING: missing date, using "": TH mandoc-1.14.6/regress/man/TH/isodate.in010064400017530001753000000002511313667012500200730ustar00schwarzeschwarze.\" $OpenBSD: isodate.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-ISODATE 1 "2011-07-02" source .SH NAME TH-isodate \- ISO date format .SH DESCRIPTION Some text. mandoc-1.14.6/regress/man/TH/isodate.out_ascii010064400017530001753000000004061412140003500214300ustar00schwarzeschwarzeTH-ISODATE(1) General Commands Manual TH-ISODATE(1) NNAAMMEE TH-isodate - ISO date format DDEESSCCRRIIPPTTIIOONN Some text. source 2011-07-02 TH-ISODATE(1) mandoc-1.14.6/regress/man/TH/longdate.in010064400017530001753000000004141313667012500202410ustar00schwarzeschwarze.\" $OpenBSD: longdate.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-LONGDATE 1 "1234567890123456789012345678901234567890123456789012345678901234567890123456789012" source .SH NAME TH-longdate \- the date is longer than the line length .SH DESCRIPTION Some text. mandoc-1.14.6/regress/man/TH/longdate.out_ascii010064400017530001753000000005711412140003500216000ustar00schwarzeschwarzeTH-LONGDATE(1) General Commands Manual TH-LONGDATE(1) NNAAMMEE TH-longdate - the date is longer than the line length DDEESSCCRRIIPPTTIIOONN Some text. source 1234567890123456789012345678901234567890123456789012345678901234567890123456789012 TH-LONGDATE(1) mandoc-1.14.6/regress/man/TH/longdate.out_lint010064400017530001753000000002371363444076600215040ustar00schwarzeschwarzemandoc: longdate.in:2:19: WARNING: cannot parse date, using it verbatim: TH 1234567890123456789012345678901234567890123456789012345678901234567890123456789012 mandoc-1.14.6/regress/man/TH/longtit.in010064400017530001753000000004161313667012500201260ustar00schwarzeschwarze.\" $OpenBSD: longtit.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-LONGTIT-23456789012345678901234567890123456789012345678901234567890123456789 1 "November 20, 2014" source .SH NAME TH-longtit \- the title is longer than the line length .SH DESCRIPTION Some text. mandoc-1.14.6/regress/man/TH/longtit.out_ascii010064400017530001753000000006471412140003500214670ustar00schwarzeschwarzeTH-LONGTIT-23456789012345678901234567890123456789012345678901234567890123456789(1) General Commands Manual NNAAMMEE TH-longtit - the title is longer than the line length DDEESSCCRRIIPPTTIIOONN Some text. source November 20, 2014 TH-LONGTIT-23456789012345678901234567890123456789012345678901234567890123456789(1) mandoc-1.14.6/regress/man/TH/longvol.in010064400017530001753000000004411313667012500201240ustar00schwarzeschwarze.\" $OpenBSD: longvol.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-LONGVOL 1 "November 20, 2014" source 1234567890123456789012345678901234567890123456789012345678901234567890123456789 .SH NAME TH-longvol \- the volume string is longer than the line length .SH DESCRIPTION Some text. mandoc-1.14.6/regress/man/TH/longvol.out_ascii010064400017530001753000000004661412140003500214660ustar00schwarzeschwarzeTH-LONGVOL(1) 1234567890123456789012345678901234567890123456789012345678901234567890123456789 NNAAMMEE TH-longvol - the volume string is longer than the line length DDEESSCCRRIIPPTTIIOONN Some text. source November 20, 2014 TH-LONGVOL(1) mandoc-1.14.6/regress/man/TH/noTH.in010064400017530001753000000001761313667012500173210ustar00schwarzeschwarze.\" $OpenBSD: noTH.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .SH NAME TH-noTH \- TH macro missing .SH DESCRIPTION some text mandoc-1.14.6/regress/man/TH/mdocdate.in010064400017530001753000000002731313667012500202270ustar00schwarzeschwarze.\" $OpenBSD: mdocdate.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-MDOCDATE 1 "July 2, 2011" source .SH NAME TH-mdocdate \- standard mdoc(7) date format .SH DESCRIPTION Some text. mandoc-1.14.6/regress/man/TH/mdocdate.out_ascii010064400017530001753000000004241412140003500215600ustar00schwarzeschwarzeTH-MDOCDATE(1) General Commands Manual TH-MDOCDATE(1) NNAAMMEE TH-mdocdate - standard mdoc(7) date format DDEESSCCRRIIPPTTIIOONN Some text. source July 2, 2011 TH-MDOCDATE(1) mandoc-1.14.6/regress/man/TH/noTH.out_lint010064400017530001753000000001521363444076600205530ustar00schwarzeschwarzemandoc: noTH.in: WARNING: missing manual title, using "" mandoc: noTH.in: WARNING: missing date, using "" mandoc-1.14.6/regress/man/TH/noarg.in010064400017530001753000000002201313667012500175450ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH .SH NAME TH-noarg \- no arguments to the TH macro .SH DESCRIPTION some text mandoc-1.14.6/regress/man/TH/noarg.out_ascii010064400017530001753000000004201412140003500211020ustar00schwarzeschwarze() () NNAAMMEE TH-noarg - no arguments to the TH macro DDEESSCCRRIIPPTTIIOONN some text OpenBSD () mandoc-1.14.6/regress/man/TH/noarg.out_lint010064400017530001753000000003011363444076600210050ustar00schwarzeschwarzemandoc: noarg.in:2:2: WARNING: missing manual title, using "": TH mandoc: noarg.in:2:2: WARNING: missing manual section, using "": TH mandoc: noarg.in:2:2: WARNING: missing date, using "": TH mandoc-1.14.6/regress/man/TH/nobody.in010064400017530001753000000001411313667012500177330ustar00schwarzeschwarze.\" $OpenBSD: nobody.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-NOBODY 1 "June 20, 2014" mandoc-1.14.6/regress/man/TH/nobody.out_ascii010064400017530001753000000002371412140003500212740ustar00schwarzeschwarzeTH-NOBODY(1) General Commands Manual TH-NOBODY(1) OpenBSD June 20, 2014 TH-NOBODY(1) mandoc-1.14.6/regress/man/TH/nobody.out_lint010064400017530001753000000000551313667012500211660ustar00schwarzeschwarzemandoc: nobody.in: WARNING: no document body mandoc-1.14.6/regress/man/TH/onearg.in010064400017530001753000000002411313667012500177150ustar00schwarzeschwarze.\" $OpenBSD: onearg.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-ONEARG .SH NAME TH-onearg \- only one argument to the TH macro .SH DESCRIPTION some text mandoc-1.14.6/regress/man/TH/onearg.out_ascii010064400017530001753000000004261412140003500212550ustar00schwarzeschwarzeTH-ONEARG() TH-ONEARG() NNAAMMEE TH-onearg - only one argument to the TH macro DDEESSCCRRIIPPTTIIOONN some text OpenBSD TH-ONEARG() mandoc-1.14.6/regress/man/TH/onearg.out_lint010064400017530001753000000002121363444076600211530ustar00schwarzeschwarzemandoc: onearg.in:2:2: WARNING: missing manual section, using "": TH TH-ONEARG mandoc: onearg.in:2:2: WARNING: missing date, using "": TH mandoc-1.14.6/regress/man/TH/onlyyear.in010064400017530001753000000002551313667012500203110ustar00schwarzeschwarze.\" $OpenBSD: onlyyear.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-ONLYYEAR 1 2011 source .SH NAME TH-onlyyear \- the date has only a year .SH DESCRIPTION Some text. mandoc-1.14.6/regress/man/TH/onlyyear.out_ascii010064400017530001753000000004201412140003500216360ustar00schwarzeschwarzeTH-ONLYYEAR(1) General Commands Manual TH-ONLYYEAR(1) NNAAMMEE TH-onlyyear - the date has only a year DDEESSCCRRIIPPTTIIOONN Some text. source 2011 TH-ONLYYEAR(1) mandoc-1.14.6/regress/man/TH/sixargs.in010064400017530001753000000003111313667012500201200ustar00schwarzeschwarze.\" $OpenBSD: sixargs.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .TH TH-SIXARGS 1 "January 16, 2011" OpenBSD regress SIX .SH NAME TH-sixargs \- six arguments to the TH macro .SH DESCRIPTION some text mandoc-1.14.6/regress/man/TH/sixargs.out_ascii010064400017530001753000000004231412140003500214570ustar00schwarzeschwarzeTH-SIXARGS(1) regress TH-SIXARGS(1) NNAAMMEE TH-sixargs - six arguments to the TH macro DDEESSCCRRIIPPTTIIOONN some text OpenBSD January 16, 2011 TH-SIXARGS(1) mandoc-1.14.6/regress/man/TH/sixargs.out_lint010064400017530001753000000001061313667012500213510ustar00schwarzeschwarzemandoc: sixargs.in:2:53: ERROR: skipping excess arguments: TH ... SIX mandoc-1.14.6/regress/man/TH/twoargs.in010064400017530001753000000002451313667012500201340ustar00schwarzeschwarze.\" $OpenBSD: twoargs.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TH-TWOARGS .SH NAME TH-twoargs \- only two arguments to the TH macro .SH DESCRIPTION some text mandoc-1.14.6/regress/man/TH/twoargs.out_ascii010064400017530001753000000004301412140003500214630ustar00schwarzeschwarzeTH-TWOARGS() TH-TWOARGS() NNAAMMEE TH-twoargs - only two arguments to the TH macro DDEESSCCRRIIPPTTIIOONN some text OpenBSD TH-TWOARGS() mandoc-1.14.6/regress/man/TH/twoargs.out_lint010064400017530001753000000002151363444076600213710ustar00schwarzeschwarzemandoc: twoargs.in:2:2: WARNING: missing manual section, using "": TH TH-TWOARGS mandoc: twoargs.in:2:2: WARNING: missing date, using "": TH mandoc-1.14.6/regress/man/TP004075500017530001753000000000001412314056600160475ustar00schwarzeschwarzemandoc-1.14.6/regress/man/TP/Makefile010064400017530001753000000011051363444076600175730ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.17 2020/03/13 00:31:05 schwarze Exp $ REGRESS_TARGETS = badarg broken double eof fill indent literal longhead REGRESS_TARGETS += macrotag manyargs sameline spacing tag vert width TAG_TARGETS = tag LINT_TARGETS = broken double eof HTML_TARGETS = literal tag vert # groff-1.22.3 defects: # - If .TP precedes .RE, the latter does not properly reset indentation. # - If the last line of the file is .TP, groff does not print a page footer. # - A blank line in .TP next line scope causes a blank line. SKIP_GROFF = broken eof .include mandoc-1.14.6/regress/man/TP/badarg.in010064400017530001753000000005131313667012500176740ustar00schwarzeschwarze.\" $OpenBSD: badarg.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TP-BADARG 1 "November 18, 2012" .SH NAME TP-badarg \- invalid width specification for tagged paragraph .SH DESCRIPTION Non-numeric width specifications are ignored: .TP x tag indented .br text .TP xxxxx tag indented .br text .TP xxxxxxxxxx tag indented .br text mandoc-1.14.6/regress/man/TP/badarg.out_ascii010064400017530001753000000007121412140003500212300ustar00schwarzeschwarzeTP-BADARG(1) General Commands Manual TP-BADARG(1) NNAAMMEE TP-badarg - invalid width specification for tagged paragraph DDEESSCCRRIIPPTTIIOONN Non-numeric width specifications are ignored: tag indented text tag indented text tag indented text OpenBSD November 18, 2012 TP-BADARG(1) mandoc-1.14.6/regress/man/TP/broken.in010064400017530001753000000003641374160570200177410ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.4 2020/09/09 16:57:05 schwarze Exp $ .TH TP-BROKEN 1 "September 9, 2020" .SH NAME TP-broken \- broken tagged paragraphs .SH DESCRIPTION regular text .RS 4n indented text .TP .RE regular text .TP head body .TP .B .I mandoc-1.14.6/regress/man/TP/broken.out_ascii010064400017530001753000000005211412140003500212660ustar00schwarzeschwarzeTP-BROKEN(1) General Commands Manual TP-BROKEN(1) NNAAMMEE TP-broken - broken tagged paragraphs DDEESSCCRRIIPPTTIIOONN regular text indented text regular text head body OpenBSD September 9, 2020 TP-BROKEN(1) mandoc-1.14.6/regress/man/TP/broken.out_lint010064400017530001753000000005101374160570200211610ustar00schwarzeschwarzemandoc: broken.in:11:2: WARNING: line scope broken: RE breaks TP mandoc: broken.in:16:1: WARNING: skipping blank line in line scope mandoc: broken.in:21:2: WARNING: line scope broken: EOF breaks I mandoc: broken.in:20:2: WARNING: line scope broken: EOF breaks B mandoc: broken.in:19:2: WARNING: line scope broken: EOF breaks TP mandoc-1.14.6/regress/man/TP/double.in010064400017530001753000000024261313667012500177330ustar00schwarzeschwarze.\" $OpenBSD: double.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .TH TP-DOUBLE 1 2013-06-23 .SH NAME TP-double \- effect of double tagged paragraph .SH DESCRIPTION leading text: This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? .TP 16n first TP This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? .TP 16n second TP This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? .PP normal paragraph: This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? .PP .TP 16n .TP 16n double TP This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? .PP normal paragraph: This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? .B .PP .TP 16n .TP 16n double TP This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? .PP normal paragraph: This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? mandoc-1.14.6/regress/man/TP/double.out_ascii010064400017530001753000000031341412140003500212630ustar00schwarzeschwarzeTP-DOUBLE(1) General Commands Manual TP-DOUBLE(1) NNAAMMEE TP-double - effect of double tagged paragraph DDEESSCCRRIIPPTTIIOONN leading text: This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? first TP This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? second TP This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? normal paragraph: This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? double TP This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? normal paragraph: This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? double TP This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? normal paragraph: This is a rather long text because we want to test the text width; at which point will this text wrap to the next line? OpenBSD 2013-06-23 TP-DOUBLE(1) mandoc-1.14.6/regress/man/TP/double.out_lint010064400017530001753000000005121313667012500211540ustar00schwarzeschwarzemandoc: double.in:22:2: WARNING: line scope broken: TP breaks TP mandoc: double.in:31:2: WARNING: line scope broken: PP breaks B mandoc: double.in:33:2: WARNING: line scope broken: TP breaks TP mandoc: double.in:21:2: WARNING: skipping paragraph macro: PP empty mandoc: double.in:32:2: WARNING: skipping paragraph macro: PP empty mandoc-1.14.6/regress/man/TP/eof.in010064400017530001753000000003221313667012500172230ustar00schwarzeschwarze.\" $OpenBSD: eof.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TP-EOF 1 "July 7, 2014" .SH NAME TP-eof \- indented paragraph macro at the end of the file .SH DESCRIPTION The last line of the file is TP: .TP mandoc-1.14.6/regress/man/TP/eof.out_ascii010064400017530001753000000004701412140003500205620ustar00schwarzeschwarzeTP-EOF(1) General Commands Manual TP-EOF(1) NNAAMMEE TP-eof - indented paragraph macro at the end of the file DDEESSCCRRIIPPTTIIOONN The last line of the file is TP: OpenBSD July 7, 2014 TP-EOF(1) mandoc-1.14.6/regress/man/TP/eof.out_lint010064400017530001753000000000761313667012500204600ustar00schwarzeschwarzemandoc: eof.in:7:2: WARNING: line scope broken: EOF breaks TP mandoc-1.14.6/regress/man/TP/fill.in010064400017530001753000000005631313667012500174070ustar00schwarzeschwarze.\" $OpenBSD: fill.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TP-FILL 1 "September 4, 2015" .SH NAME TP-fill \- interaction of tagged paragraphs and fill mode .SH DESCRIPTION Switching off fill mode: .TP .nf tag indented text Switching it back on: .fi .TP This is an extremely long tag that will certainly wrap the line and continue onto the next one. indented text mandoc-1.14.6/regress/man/TP/fill.out_ascii010064400017530001753000000010121412140003500207300ustar00schwarzeschwarzeTP-FILL(1) General Commands Manual TP-FILL(1) NNAAMMEE TP-fill - interaction of tagged paragraphs and fill mode DDEESSCCRRIIPPTTIIOONN Switching off fill mode: tag indented text Switching it back on: This is an extremely long tag that will certainly wrap the line and continue onto the next one. indented text OpenBSD September 4, 2015 TP-FILL(1) mandoc-1.14.6/regress/man/TP/literal.in010064400017530001753000000005761343772345200201270ustar00schwarzeschwarze.\" $OpenBSD: literal.in,v 1.4 2019/01/06 04:41:15 schwarze Exp $ .TH TP-LITERAL 1 "January 6, 2019" .SH NAME TP-literal \- indented paragraphs in literal context .SH DESCRIPTION BEGINTEST before indentation .TP 10n tag regular indented text .PP regular paragraph .nf literal text .TP 10n tag indented literal text .PP literal paragraph .fi regular text .br ENDTEST .br end of file mandoc-1.14.6/regress/man/TP/literal.out_ascii010064400017530001753000000010551412140003500214450ustar00schwarzeschwarzeTP-LITERAL(1) General Commands Manual TP-LITERAL(1) NNAAMMEE TP-literal - indented paragraphs in literal context DDEESSCCRRIIPPTTIIOONN BEGINTEST before indentation tag regular indented text regular paragraph literal text tag indented literal text literal paragraph regular text ENDTEST end of file OpenBSD January 6, 2019 TP-LITERAL(1) mandoc-1.14.6/regress/man/TP/longhead.in010064400017530001753000000005201313667012500202330ustar00schwarzeschwarze.\" $OpenBSD: longhead.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TP-LONGHEAD 1 "April 8, 2014" .SH NAME TP-longhead \- tagged paragraph with a long head .SH DESCRIPTION normal text .TP 6n .B "This tagged paragraph has ridiculously long text \ in its head, such that it doesn't even fit on the line" paragraph body .PP normal text mandoc-1.14.6/regress/man/TP/longhead.out_ascii010064400017530001753000000011531412140003500215710ustar00schwarzeschwarzeTP-LONGHEAD(1) General Commands Manual TP-LONGHEAD(1) NNAAMMEE TP-longhead - tagged paragraph with a long head DDEESSCCRRIIPPTTIIOONN normal text TThhiiss ttaaggggeedd ppaarraaggrraapphh hhaass rriiddiiccuulloouussllyy lloonngg tteexxtt iinn iittss hheeaadd,, ssuucchh tthhaatt iitt ddooeessnn''tt eevveenn ffiitt oonn tthhee lliinnee paragraph body normal text OpenBSD April 8, 2014 TP-LONGHEAD(1) mandoc-1.14.6/regress/man/TP/macrotag.in010064400017530001753000000004751374160570200202610ustar00schwarzeschwarze.\" $OpenBSD: macrotag.in,v 1.4 2020/09/09 16:57:05 schwarze Exp $ .TH TP-MACROTAG 1 "September 9, 2020" .SH NAME TP-macrotag \- macros in the head of tagged paragraphs .SH DESCRIPTION regular text .TP .B longindent indented text .TP .B .I next-line indented text .TP .B .SM bold small indented text .PP regular text mandoc-1.14.6/regress/man/TP/macrotag.out_ascii010064400017530001753000000007721412140003500216130ustar00schwarzeschwarzeTP-MACROTAG(1) General Commands Manual TP-MACROTAG(1) NNAAMMEE TP-macrotag - macros in the head of tagged paragraphs DDEESSCCRRIIPPTTIIOONN regular text lloonnggiinnddeenntt indented text _n_e_x_t_-_l_i_n_e indented text bboolldd ssmmaallll indented text regular text OpenBSD September 9, 2020 TP-MACROTAG(1) mandoc-1.14.6/regress/man/TP/tag.in010064400017530001753000000005321363272362200172320ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $ .TH IP-TAG 1 "March 10, 2020" .SH NAME IP-tag \- automatic tagging of indented blocks .SH DESCRIPTION BEGINTEST initial text .TP 10n .I " plain" text .TP plain text .TP .I "plain " text .TP \& strong text .TP .B -strong text .TP \&\fI \-weak\fP text .TP .B "strong " text .PP ENDTEST mandoc-1.14.6/regress/man/TP/manyargs.in010064400017530001753000000007321313667012500203000ustar00schwarzeschwarze.\" $OpenBSD: manyargs.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .TH TP-MANYARGS 1 "January 4, 2011" .SH NAME TP-manyargs \- too many header args for indented blocks .SH DESCRIPTION regular text .TP 10n tag1 indented text .PP regular text .TP 10n tag1 tag2 indented text .PP regular text .TP 10n tag2 tag1 tag3 indented text .nf literal text .TP 10n tag1 indented text .PP literal text .TP 10n tag1 tag2 indented text .PP literal text .TP 10n tag2 tag1 tag3 indented text mandoc-1.14.6/regress/man/TP/manyargs.out_ascii010064400017530001753000000012461412140003500216340ustar00schwarzeschwarzeTP-MANYARGS(1) General Commands Manual TP-MANYARGS(1) NNAAMMEE TP-manyargs - too many header args for indented blocks DDEESSCCRRIIPPTTIIOONN regular text tag1 indented text regular text tag2 indented text regular text tag3 indented text literal text tag1 indented text literal text tag2 indented text literal text tag3 indented text OpenBSD January 4, 2011 TP-MANYARGS(1) mandoc-1.14.6/regress/man/TP/sameline.in010064400017530001753000000006311313667012500202520ustar00schwarzeschwarze.\" $OpenBSD: sameline.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TP-SAMELINE 1 "March 8, 2014" .SH NAME TP-sameline \- test sameline logic of indented paragraphs .SH DESCRIPTION .SS without user-defined macros with width: .TP 6n tag text .PP without width: .TP 20n text .SS with user-defined macros .de mylist with width: .TP 6n tag text .. .mylist .PP .de mylist without width: .TP 20n text .. .mylist mandoc-1.14.6/regress/man/TP/sameline.out_ascii010064400017530001753000000011141412140003500216020ustar00schwarzeschwarzeTP-SAMELINE(1) General Commands Manual TP-SAMELINE(1) NNAAMMEE TP-sameline - test sameline logic of indented paragraphs DDEESSCCRRIIPPTTIIOONN wwiitthhoouutt uusseerr--ddeeffiinneedd mmaaccrrooss with width: tag text without width: 20n text wwiitthh uusseerr--ddeeffiinneedd mmaaccrrooss with width: tag text without width: 20n text OpenBSD March 8, 2014 TP-SAMELINE(1) mandoc-1.14.6/regress/man/TP/spacing.in010064400017530001753000000011521313667012500201000ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TP-SPACING 1 "September 21, 2015" .SH NAME TP-spacing \- spacing in tagged paragraphs .SH DESCRIPTION Normal text. .TP tag Indented text. .TP four Indented text. .TP ffive Indented text. .TP sixsix Indented text. .TP seseven Indented text. .TP a much longer tag Indented text. .LP Tags with trailing space: .TP tag\ \& Three plus one makes four. .TP tag\ \ \& Three plus two makes five. .TP tag\ \ \ \& Three plus three makes six. .TP tag\ \ \ \ \ \& Three plus four makes seven. .TP tag\ \ \ \ \ \ \& Three plus five makes eight. .LP Normal text. mandoc-1.14.6/regress/man/TP/spacing.out_ascii010064400017530001753000000014251412140003500214360ustar00schwarzeschwarzeTP-SPACING(1) General Commands Manual TP-SPACING(1) NNAAMMEE TP-spacing - spacing in tagged paragraphs DDEESSCCRRIIPPTTIIOONN Normal text. tag Indented text. four Indented text. ffive Indented text. sixsix Indented text. seseven Indented text. a much longer tag Indented text. Tags with trailing space: tag Three plus one makes four. tag Three plus two makes five. tag Three plus three makes six. tag Three plus four makes seven. tag Three plus five makes eight. Normal text. OpenBSD September 21, 2015 TP-SPACING(1) mandoc-1.14.6/regress/man/TP/width.in010064400017530001753000000013201313667012500175700ustar00schwarzeschwarze.\" $OpenBSD: width.in,v 1.6 2017/07/04 14:53:24 schwarze Exp $ .TH TP-WIDTH 1 "December 23, 2014" .SH NAME TP-width \- indentation width of indented paragraphs .SH DESCRIPTION Regular mode: .TP -10n tag indented .br text .TP -0.36i tag indented .br text .TP 0n tag indented .br text .TP 1n tag indented .br text .TP 0.16i tag indented .br text .TP 3n tag indented .br text .TP 4n tag indented .br text .TP 5n tag indented .br text .TP 100n tag indented .br text .PP Literal mode: .nf .TP -0.96i tag indented text .TP -4n tag indented text .TP 0n tag indented text .TP 1n tag indented text .TP 2n tag indented text .TP 0.26i tag indented text .TP 4n tag indented text .TP 5n tag indented text .TP 100n tag indented text mandoc-1.14.6/regress/man/TP/width.out_ascii010064400017530001753000000025441412140003500211340ustar00schwarzeschwarzeTP-WIDTH(1) General Commands Manual TP-WIDTH(1) NNAAMMEE TP-width - indentation width of indented paragraphs DDEESSCCRRIIPPTTIIOONN Regular mode: tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text Literal mode: tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text tag indented text OpenBSD December 23, 2014 TP-WIDTH(1) mandoc-1.14.6/regress/man/TP/indent.in010064400017530001753000000003601312673152400177350ustar00schwarzeschwarze.\" $OpenBSD: indent.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TP-INDENT 1 "June 17, 2017" .SH NAME TP-indent \- indent request inside TP head .SH DESCRIPTION initial text .TP 2n tag indented .TP 8n .in 3n tag indented .PP final text mandoc-1.14.6/regress/man/TP/indent.out_ascii010064400017530001753000000005371412140003500212760ustar00schwarzeschwarzeTP-INDENT(1) General Commands Manual TP-INDENT(1) NNAAMMEE TP-indent - indent request inside TP head DDEESSCCRRIIPPTTIIOONN initial text tag indented tag indented final text OpenBSD June 17, 2017 TP-INDENT(1) mandoc-1.14.6/regress/man/TP/literal.out_html010064400017530001753000000005631374632356700213560ustar00schwarzeschwarze
regular indented text

regular paragraph

literal
text
indented
literal
text
literal
paragraph
regular text
mandoc-1.14.6/regress/man/TP/tag.out_ascii010064400017530001753000000010141412140003500205570ustar00schwarzeschwarzeIP-TAG(1) General Commands Manual IP-TAG(1) NNAAMMEE IP-tag - automatic tagging of indented blocks DDEESSCCRRIIPPTTIIOONN BEGINTEST initial text _p_l_a_i_n text plain text _p_l_a_i_n text strong text --ssttrroonngg text _-_w_e_a_k text ssttrroonngg text ENDTEST OpenBSD March 10, 2020 IP-TAG(1) mandoc-1.14.6/regress/man/TP/tag.out_html010064400017530001753000000007031363272362200204570ustar00schwarzeschwarze
plain
text
text
plain
text
strong
text
text
text
strong
text
mandoc-1.14.6/regress/man/TP/tag.out_tag010064400017530001753000000002051412140003500202430ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 plain tag.mandoc_ascii 11 strong tag.mandoc_ascii 17 weak tag.mandoc_ascii 19 mandoc-1.14.6/regress/man/TP/vert.in010064400017530001753000000003661362561733700174530ustar00schwarzeschwarze.\" $OpenBSD: vert.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .TH TP-VERT 1 "February 19, 2020" .SH NAME TP-vert \- vertical spacing before tagged paragraphs BEGINTEST .SH DESCRIPTION .PD 2v .TP tag text .TP tag text .PP ENDTEST .br end of file mandoc-1.14.6/regress/man/TP/vert.out_ascii010064400017530001753000000005411412140003500207700ustar00schwarzeschwarzeTP-VERT(1) General Commands Manual TP-VERT(1) NNAAMMEE TP-vert - vertical spacing before tagged paragraphs BEGINTEST DDEESSCCRRIIPPTTIIOONN tag text tag text ENDTEST end of file OpenBSD February 19, 2020 TP-VERT(1) mandoc-1.14.6/regress/man/TP/vert.out_html010064400017530001753000000004661367274433600207030ustar00schwarzeschwarze

text
text
mandoc-1.14.6/regress/man/TS004075500017530001753000000000001412314056600160525ustar00schwarzeschwarzemandoc-1.14.6/regress/man/TS/Makefile010064400017530001753000000004661363444076600176070ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2020/01/08 10:17:15 schwarze Exp $ REGRESS_TARGETS = break vspace LINT_TARGETS = break GOPTS = -t # groff-1.22.3 defect: # - Starting a table in next-line scope confuses font handling, # and in the case of .TP indentation as well. SKIP_GROFF = break .include mandoc-1.14.6/regress/man/TS/break.in010064400017530001753000000005621313667012500175470ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH TBL-BREAK 1 "January 30, 2015" .SH NAME tbl-break \- tables breaking blocks .SH DESCRIPTION tagged paragraph: .TP 6n .TS l. first line second line .TE section: .SH .TS l. first line second line .TE subsection: .SS .TS l. first line second line .TE bold: .B .TS l. first line second line .TE final text mandoc-1.14.6/regress/man/TS/break.out_ascii010064400017530001753000000007551412140003500211060ustar00schwarzeschwarzeTBL-BREAK(1) General Commands Manual TBL-BREAK(1) NNAAMMEE tbl-break - tables breaking blocks DDEESSCCRRIIPPTTIIOONN tagged paragraph: first line second line section: first line second line subsection: first line second line bold: first line second line final text OpenBSD January 30, 2015 TBL-BREAK(1) mandoc-1.14.6/regress/man/TS/break.out_lint010064400017530001753000000003761313667012500210010ustar00schwarzeschwarzemandoc: break.in:7:2: WARNING: line scope broken: TS breaks TP mandoc: break.in:14:2: WARNING: line scope broken: TS breaks SH mandoc: break.in:21:2: WARNING: line scope broken: TS breaks SS mandoc: break.in:28:2: WARNING: line scope broken: TS breaks B mandoc-1.14.6/regress/man/TS/vspace.in010064400017530001753000000013451313667012500177440ustar00schwarzeschwarze.\" $OpenBSD: vspace.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .TH TBL-VSPACE 1 "May 27, 2012" .SH NAME tbl-vspace \- vertical spacing around tables .SH DESCRIPTION normal text before table .TS L . table without box .TE normal text after table without box .TS box; L . table with box .TE .\" at least one vertical space is required here .\" or groff will clobber the box .sp 1v normal text after table with box .TS doublebox; L . table with double box .TE .\" at least two vertical spaces are required here .\" or groff will clobber the box .sp 2v normal text after table with double box .TS L . table without box .TE .TS box; L . table with box .TE .sp 1v .TS doublebox; L . table with double box .TE .sp 2v .TS L . table without box .TE mandoc-1.14.6/regress/man/TS/vspace.out_ascii010064400017530001753000000017151412140003500213000ustar00schwarzeschwarzeTBL-VSPACE(1) General Commands Manual TBL-VSPACE(1) NNAAMMEE tbl-vspace - vertical spacing around tables DDEESSCCRRIIPPTTIIOONN normal text before table table without box normal text after table without box +---------------+ |table with box | +---------------+ normal text after table with box +----------------------+ +----------------------+ |table with double box | +----------------------+ +----------------------+ normal text after table with double box table without box +---------------+ |table with box | +---------------+ +----------------------+ +----------------------+ |table with double box | +----------------------+ +----------------------+ table without box OpenBSD May 27, 2012 TBL-VSPACE(1) mandoc-1.14.6/regress/man/UR004075500017530001753000000000001412314056600160525ustar00schwarzeschwarzemandoc-1.14.6/regress/man/UR/Makefile010064400017530001753000000004231304650511000175560ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2015/02/06 11:54:03 schwarze Exp $ REGRESS_TARGETS = args noUE LINT_TARGETS = args noUE # groff-1.22.3 defects: # - Without .UE, .UR does not print the URI. # - But .UE prints <> even without .UR. SKIP_GROFF = noUE .include mandoc-1.14.6/regress/man/UR/args.in010064400017530001753000000010651341026767400174240ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH UR-ARGS 1 "August 14, 2018" .SH NAME UR-basic \- argument handling of the man-ext URI macro .SH DESCRIPTION argument, text, and tail: .UR http://www.openbsd.org/ text .UE tail argument .PP argument plus text: .UR http://www.openbsd.org/ OpenBSD homepage .UE next line .PP argument but no text: .UR http://www.netbsd.org/ .UE .PP no argument, but text: .UR some text .UE .PP two arguments plus text: .UR first second some text .UE .PP two arguments, but no text: .UR first second .UE .PP final text mandoc-1.14.6/regress/man/UR/args.out_ascii010064400017530001753000000012071412140003500207470ustar00schwarzeschwarzeUR-ARGS(1) General Commands Manual UR-ARGS(1) NNAAMMEE UR-basic - argument handling of the man-ext URI macro DDEESSCCRRIIPPTTIIOONN argument, text, and tail: text tail argument argument plus text: OpenBSD homepage next line argument but no text: no argument, but text: some text <> two arguments plus text: some text two arguments, but no text: final text OpenBSD August 14, 2018 UR-ARGS(1) mandoc-1.14.6/regress/man/UR/args.out_lint010064400017530001753000000004651341026767400206560ustar00schwarzeschwarzemandoc: args.in:28:11: ERROR: skipping excess arguments: UR ... second mandoc: args.in:33:11: ERROR: skipping excess arguments: UR ... second mandoc: args.in:19:2: WARNING: empty block: UR mandoc: args.in:23:2: WARNING: missing resource identifier, using "": UR mandoc: args.in:33:2: WARNING: empty block: UR mandoc-1.14.6/regress/man/UR/noUE.in010064400017530001753000000003471313667012500173320ustar00schwarzeschwarze.\" $OpenBSD: noUE.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH UR-NOUE 1 "July 7, 2014" .SH NAME UR-noUE \- unclosed URI macro .SH DESCRIPTION lonely UE: .UE .PP argument plus text: .UR http://www.openbsd.org/ OpenBSD homepage mandoc-1.14.6/regress/man/UR/noUE.out_ascii010064400017530001753000000005151412140003500206620ustar00schwarzeschwarzeUR-NOUE(1) General Commands Manual UR-NOUE(1) NNAAMMEE UR-noUE - unclosed URI macro DDEESSCCRRIIPPTTIIOONN lonely UE: argument plus text: OpenBSD homepage OpenBSD July 7, 2014 UR-NOUE(1) mandoc-1.14.6/regress/man/UR/noUE.out_lint010064400017530001753000000002071313667012500205540ustar00schwarzeschwarzemandoc: noUE.in:7:2: ERROR: skipping end of block that is not open: UE mandoc: noUE.in:10:2: ERROR: appending missing end of block: UR mandoc-1.14.6/regress/man/blank004075500017530001753000000000001412314056600166135ustar00schwarzeschwarzemandoc-1.14.6/regress/man/blank/Makefile010064400017530001753000000002451304650511100203220ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2014/07/02 05:51:49 schwarze Exp $ REGRESS_TARGETS = line afterSH afterSS LINT_TARGETS = line afterSH afterSS .include mandoc-1.14.6/regress/man/blank/afterSH.in010064400017530001753000000021001313667012500205460ustar00schwarzeschwarze.\" $OpenBSD: afterSH.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH BLANK-AFTERSH 1 "November 10, 2013" .SH NAME blank-afterSH \- handling of blank lines right after a section heading .SH DESCRIPTION blank line before text .SH DESCRIPTION 2 .PP blank line before PP .SH DESCRIPTION 3 .RS 6n blank line before RS .RE .SH DESCRIPTION 4 .IP TAG blank line before an indented paragraph .SH DESCRIPTION 5 .TP TAG blank line before a tagged paragraph .SH DESCRIPTION 6 .HP blank line before a hanged paragraph .SH DESCRIPTION 7 .br blank line before br .SH DESCRIPTION 8 .sp blank line before sp .SH DESCRIPTION 10 double blank line before text .SH DESCRIPTION 12 .PP double blank line before PP .SH DESCRIPTION 13 .RS 6n double blank line before RS .RE .SH DESCRIPTION 14 .IP TAG double blank line before an indented paragraph .SH DESCRIPTION 15 .TP TAG double blank line before a tagged paragraph .SH DESCRIPTION 16 .HP double blank line before a hanged paragraph .SH DESCRIPTION 17 .br double blank line before br .SH DESCRIPTION 18 .sp double blank line before sp mandoc-1.14.6/regress/man/blank/afterSH.out_ascii010064400017530001753000000030101412140003500221020ustar00schwarzeschwarzeBLANK-AFTERSH(1) General Commands Manual BLANK-AFTERSH(1) NNAAMMEE blank-afterSH - handling of blank lines right after a section heading DDEESSCCRRIIPPTTIIOONN blank line before text DDEESSCCRRIIPPTTIIOONN 22 blank line before PP DDEESSCCRRIIPPTTIIOONN 33 blank line before RS DDEESSCCRRIIPPTTIIOONN 44 TAG blank line before an indented paragraph DDEESSCCRRIIPPTTIIOONN 55 TAG blank line before a tagged paragraph DDEESSCCRRIIPPTTIIOONN 66 blank line before a hanged paragraph DDEESSCCRRIIPPTTIIOONN 77 blank line before br DDEESSCCRRIIPPTTIIOONN 88 blank line before sp DDEESSCCRRIIPPTTIIOONN 1100 double blank line before text DDEESSCCRRIIPPTTIIOONN 1122 double blank line before PP DDEESSCCRRIIPPTTIIOONN 1133 double blank line before RS DDEESSCCRRIIPPTTIIOONN 1144 TAG double blank line before an indented paragraph DDEESSCCRRIIPPTTIIOONN 1155 TAG double blank line before a tagged paragraph DDEESSCCRRIIPPTTIIOONN 1166 double blank line before a hanged paragraph DDEESSCCRRIIPPTTIIOONN 1177 double blank line before br DDEESSCCRRIIPPTTIIOONN 1188 double blank line before sp OpenBSD November 10, 2013 BLANK-AFTERSH(1) mandoc-1.14.6/regress/man/blank/afterSH.out_lint010064400017530001753000000006601341026767400220140ustar00schwarzeschwarzemandoc: afterSH.in:10:2: WARNING: skipping paragraph macro: PP after SH mandoc: afterSH.in:32:2: WARNING: skipping paragraph macro: br after SH mandoc: afterSH.in:36:2: WARNING: skipping paragraph macro: sp after SH mandoc: afterSH.in:45:2: WARNING: skipping paragraph macro: PP after SH mandoc: afterSH.in:72:2: WARNING: skipping paragraph macro: br after SH mandoc: afterSH.in:77:2: WARNING: skipping paragraph macro: sp after SH mandoc-1.14.6/regress/man/blank/afterSS.in010064400017530001753000000016251313667012500205740ustar00schwarzeschwarze.\" $OpenBSD: afterSS.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH BLANK-AFTERSS 1 "November 10, 2013" .SH NAME blank-afterSS \- handling of blank lines right after a subsection heading .SH DESCRIPTION .SS 1 blank line before text .SS 2 .PP blank line before PP .SS 3 .RS 6n blank line before RS .RE .SS 4 .IP TAG blank line before an indented paragraph .SS 5 .TP TAG blank line before a tagged paragraph .SS 6 .HP blank line before a hanged paragraph .SS 7 .br blank line before br .SS 8 .sp blank line before sp .SS 10 double blank line before text .SS 12 .PP double blank line before PP .SS 13 .RS 6n double blank line before RS .RE .SS 14 .IP TAG double blank line before an indented paragraph .SS 15 .TP TAG double blank line before a tagged paragraph .SS 16 .HP double blank line before a hanged paragraph .SS 17 .br double blank line before br .SS 18 .sp double blank line before sp mandoc-1.14.6/regress/man/blank/afterSS.out_ascii010064400017530001753000000021101412140003500221150ustar00schwarzeschwarzeBLANK-AFTERSS(1) General Commands Manual BLANK-AFTERSS(1) NNAAMMEE blank-afterSS - handling of blank lines right after a subsection heading DDEESSCCRRIIPPTTIIOONN 11 blank line before text 22 blank line before PP 33 blank line before RS 44 TAG blank line before an indented paragraph 55 TAG blank line before a tagged paragraph 66 blank line before a hanged paragraph 77 blank line before br 88 blank line before sp 1100 double blank line before text 1122 double blank line before PP 1133 double blank line before RS 1144 TAG double blank line before an indented paragraph 1155 TAG double blank line before a tagged paragraph 1166 double blank line before a hanged paragraph 1177 double blank line before br 1188 double blank line before sp OpenBSD November 10, 2013 BLANK-AFTERSS(1) mandoc-1.14.6/regress/man/blank/afterSS.out_lint010064400017530001753000000006601341026767400220270ustar00schwarzeschwarzemandoc: afterSS.in:11:2: WARNING: skipping paragraph macro: PP after SS mandoc: afterSS.in:33:2: WARNING: skipping paragraph macro: br after SS mandoc: afterSS.in:37:2: WARNING: skipping paragraph macro: sp after SS mandoc: afterSS.in:46:2: WARNING: skipping paragraph macro: PP after SS mandoc: afterSS.in:73:2: WARNING: skipping paragraph macro: br after SS mandoc: afterSS.in:78:2: WARNING: skipping paragraph macro: sp after SS mandoc-1.14.6/regress/man/blank/line.in010064400017530001753000000012341313667012500201500ustar00schwarzeschwarze.\" $OpenBSD: line.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .TH BLANK-LINE 1 "July 14, 2012" .SH NAME blank-line \- handling of blank lines .SH DESCRIPTION .sp .PP Single br: .br Single PP: .PP Single sp: .sp Single blank: Double br: .br .br br PP: .br .PP PP br: .PP .br Double PP: .PP .PP br sp: .br .sp sp br: .sp .br PP sp: .PP .sp PP sp 2v: .PP .sp 2v sp PP: .sp .PP Double sp: .sp .sp br blank: .br blank br: .br PP blank: .PP blank PP: .PP sp blank: .sp blank sp: .sp Double blank: RS sp 2v: .RS 6n .sp 2v RE sp 2v: .RE .sp 2v IP sp 2v: .IP tag 6n .sp 2v TP sp 2v: .TP 6n tag .sp 2v SH sp 2v: .SH CUSTOM .sp 2v SS sp PP: .SS subsection .sp .PP End. mandoc-1.14.6/regress/man/blank/line.out_ascii010064400017530001753000000015211412140003500215020ustar00schwarzeschwarzeBLANK-LINE(1) General Commands Manual BLANK-LINE(1) NNAAMMEE blank-line - handling of blank lines DDEESSCCRRIIPPTTIIOONN Single br: Single PP: Single sp: Single blank: Double br: br PP: PP br: Double PP: br sp: sp br: PP sp: PP sp 2v: sp PP: Double sp: br blank: blank br: PP blank: blank PP: sp blank: blank sp: Double blank: RS sp 2v: RE sp 2v: IP sp 2v: tag TP sp 2v: tag SH sp 2v: CCUUSSTTOOMM SS sp PP: ssuubbsseeccttiioonn End. OpenBSD July 14, 2012 BLANK-LINE(1) mandoc-1.14.6/regress/man/blank/line.out_lint010064400017530001753000000015771341026767400214170ustar00schwarzeschwarzemandoc: line.in:18:2: WARNING: skipping paragraph macro: br after br mandoc: line.in:24:2: WARNING: skipping paragraph macro: br after PP mandoc: line.in:26:2: WARNING: skipping paragraph macro: PP empty mandoc: line.in:29:2: WARNING: skipping paragraph macro: br before sp mandoc: line.in:33:2: WARNING: skipping paragraph macro: br after sp mandoc: line.in:36:2: WARNING: skipping paragraph macro: sp after PP mandoc: line.in:39:2: WARNING: skipping paragraph macro: sp after PP mandoc: line.in:47:2: WARNING: skipping paragraph macro: br before sp mandoc: line.in:51:2: WARNING: skipping paragraph macro: br after sp mandoc: line.in:54:1: WARNING: skipping paragraph macro: sp after PP mandoc: line.in:6:2: WARNING: skipping paragraph macro: sp after SH mandoc: line.in:85:2: WARNING: skipping paragraph macro: sp after SS mandoc: line.in:82:2: WARNING: skipping paragraph macro: sp after SH mandoc-1.14.6/regress/man/nf004075500017530001753000000000001412314056600161275ustar00schwarzeschwarzemandoc-1.14.6/regress/man/nf/Makefile010064400017530001753000000002431304650511200176350ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2015/02/06 08:28:04 schwarze Exp $ REGRESS_TARGETS = indent args vert dupe userdef LINT_TARGETS = args dupe .include mandoc-1.14.6/regress/man/nf/args.in010064400017530001753000000003571313667012500174760ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .TH NF-ARGS 1 "January 16, 2011" .SH NAME nf-args \- filling macros with arguments .SH DESCRIPTION regular text .nf arg1 arg2 arg3 literal text .fi arg1 arg2 arg3 regular text mandoc-1.14.6/regress/man/nf/args.out_ascii010064400017530001753000000005021412140003500210210ustar00schwarzeschwarzeNF-ARGS(1) General Commands Manual NF-ARGS(1) NNAAMMEE nf-args - filling macros with arguments DDEESSCCRRIIPPTTIIOONN regular text literal text regular text OpenBSD January 16, 2011 NF-ARGS(1) mandoc-1.14.6/regress/man/nf/args.out_lint010064400017530001753000000002151313667012500207160ustar00schwarzeschwarzemandoc: args.in:8:5: ERROR: skipping all arguments: nf arg1 arg2 arg3 mandoc: args.in:11:5: ERROR: skipping all arguments: fi arg1 arg2 arg3 mandoc-1.14.6/regress/man/nf/dupe.in010064400017530001753000000003451313667012500174740ustar00schwarzeschwarze.\" $OpenBSD: dupe.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH NF-DUPE 1 "July 2, 2014" .SH NAME nf-dupe \- duplicate filling macros .SH DESCRIPTION regular text .fi still regular text .nf literal text .nf still literal text mandoc-1.14.6/regress/man/nf/dupe.out_ascii010064400017530001753000000005531412140003500210300ustar00schwarzeschwarzeNF-DUPE(1) General Commands Manual NF-DUPE(1) NNAAMMEE nf-dupe - duplicate filling macros DDEESSCCRRIIPPTTIIOONN regular text still regular text literal text still literal text OpenBSD July 2, 2014 NF-DUPE(1) mandoc-1.14.6/regress/man/nf/dupe.out_lint010064400017530001753000000002121313667012500207140ustar00schwarzeschwarzemandoc: dupe.in:8:2: STYLE: fill mode already enabled, skipping: fi mandoc: dupe.in:15:2: STYLE: fill mode already disabled, skipping: nf mandoc-1.14.6/regress/man/nf/indent.in010064400017530001753000000007111313667012500200150ustar00schwarzeschwarze.\" $OpenBSD: indent.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .TH NF-INDENT 1 "January 4, 2011" .SH NAME nf-indent \- indentation of literal blocks .SH DESCRIPTION Here comes an indented block: .nf oneword two words and three words This is a very long line; because it is indented, it is a bit too long to fit. blank line: line with only a zero-width space: \& line with only a normal space character: end of literal .fi He is some more regular text. mandoc-1.14.6/regress/man/nf/indent.out_ascii010064400017530001753000000011361412140003500213520ustar00schwarzeschwarzeNF-INDENT(1) General Commands Manual NF-INDENT(1) NNAAMMEE nf-indent - indentation of literal blocks DDEESSCCRRIIPPTTIIOONN Here comes an indented block: oneword two words and three words This is a very long line; because it is indented, it is a bit too long to fit. blank line: line with only a zero-width space: line with only a normal space character: end of literal He is some more regular text. OpenBSD January 4, 2011 NF-INDENT(1) mandoc-1.14.6/regress/man/nf/userdef.in010064400017530001753000000004401313667012500201700ustar00schwarzeschwarze.\" $OpenBSD: userdef.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH NF-USERDEF 1 "March 8, 2014" .SH NAME nf-userdef \- setting unfilled mode via user-defined macros .SH DESCRIPTION filled text .nf unfilled text .fi filled text .de MYBLOCK .nf unfilled text .fi filled text .. .MYBLOCK mandoc-1.14.6/regress/man/nf/userdef.out_ascii010064400017530001753000000006031412140003500215240ustar00schwarzeschwarzeNF-USERDEF(1) General Commands Manual NF-USERDEF(1) NNAAMMEE nf-userdef - setting unfilled mode via user-defined macros DDEESSCCRRIIPPTTIIOONN filled text unfilled text filled text unfilled text filled text OpenBSD March 8, 2014 NF-USERDEF(1) mandoc-1.14.6/regress/man/nf/vert.in010064400017530001753000000004411313667012500175140ustar00schwarzeschwarze.\" $OpenBSD: vert.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .TH NF-VERT 1 "June 2, 2012" .SH NAME nf-vert \- spacing around filling macros .SH DESCRIPTION regular text .nf literal text .fi regular text .br .nf literal text .br .fi regular text .sp .nf literal text .sp .fi regular text mandoc-1.14.6/regress/man/nf/vert.out_ascii010064400017530001753000000006421412140003500210520ustar00schwarzeschwarzeNF-VERT(1) General Commands Manual NF-VERT(1) NNAAMMEE nf-vert - spacing around filling macros DDEESSCCRRIIPPTTIIOONN regular text literal text regular text literal text regular text literal text regular text OpenBSD June 2, 2012 NF-VERT(1) mandoc-1.14.6/regress/man/MT004075500017530001753000000000001412314056600160445ustar00schwarzeschwarzemandoc-1.14.6/regress/man/MT/Makefile010064400017530001753000000004271312374205100175570ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2015/02/06 11:54:03 schwarze Exp $ REGRESS_TARGETS = args noME LINT_TARGETS = args noME # groff-1.22.3 defects: # - Without .ME, .MT does not print the address. # - But .ME prints <> even without .MT. SKIP_GROFF = noME .include mandoc-1.14.6/regress/man/MT/args.in010064400017530001753000000010361341026767300174130ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH MT-ARGS 1 "August 13, 2018" .SH NAME MT-args \- argument handling of the man-ext mailto macro .SH DESCRIPTION argument, text, and tail: .MT test@example.com text .ME tail args .PP argument plus text: .MT test@example.com invalid address .ME next line .PP argument but no text: .MT test@example.com .ME .PP no argument, but text: .MT some text .ME .PP two arguments plus text: .MT first second some text .ME .PP two arguments, but no text: .MT first second .ME .PP final text mandoc-1.14.6/regress/man/MT/args.out_ascii010064400017530001753000000011511412140003400207360ustar00schwarzeschwarzeMT-ARGS(1) General Commands Manual MT-ARGS(1) NNAAMMEE MT-args - argument handling of the man-ext mailto macro DDEESSCCRRIIPPTTIIOONN argument, text, and tail: text tail args argument plus text: invalid address next line argument but no text: no argument, but text: some text <> two arguments plus text: some text two arguments, but no text: final text OpenBSD August 13, 2018 MT-ARGS(1) mandoc-1.14.6/regress/man/MT/args.out_lint010064400017530001753000000004651341026767400206500ustar00schwarzeschwarzemandoc: args.in:28:11: ERROR: skipping excess arguments: MT ... second mandoc: args.in:33:11: ERROR: skipping excess arguments: MT ... second mandoc: args.in:19:2: WARNING: empty block: MT mandoc: args.in:23:2: WARNING: missing resource identifier, using "": MT mandoc: args.in:33:2: WARNING: empty block: MT mandoc-1.14.6/regress/man/MT/noME.in010064400017530001753000000003431312673151300173060ustar00schwarzeschwarze.\" $OpenBSD: noME.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $ .TH MT-NOME 1 "June 25, 2017" .SH NAME MT-noME \- unclosed mailto macro .SH DESCRIPTION lonely ME: .ME .PP argument plus text: .MT test@example.com invalid address mandoc-1.14.6/regress/man/MT/noME.out_ascii010064400017530001753000000005101412140003400206360ustar00schwarzeschwarzeMT-NOME(1) General Commands Manual MT-NOME(1) NNAAMMEE MT-noME - unclosed mailto macro DDEESSCCRRIIPPTTIIOONN lonely ME: argument plus text: invalid address OpenBSD June 25, 2017 MT-NOME(1) mandoc-1.14.6/regress/man/MT/noME.out_lint010064400017530001753000000002071312673151300205340ustar00schwarzeschwarzemandoc: noME.in:7:2: ERROR: skipping end of block that is not open: ME mandoc: noME.in:10:2: ERROR: appending missing end of block: MT mandoc-1.14.6/regress/man/SY004075500017530001753000000000001412314056600160575ustar00schwarzeschwarzemandoc-1.14.6/regress/man/SY/Makefile010064400017530001753000000002151341422370000175630ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2019/01/05 21:52:57 schwarze Exp $ REGRESS_TARGETS = literal HTML_TARGETS = literal .include mandoc-1.14.6/regress/man/SY/literal.in010064400017530001753000000006151341421744300201220ustar00schwarzeschwarze.\" $OpenBSD: literal.in,v 1.1 2019/01/05 21:13:55 schwarze Exp $ .TH SY-LITERAL 1 "January 5, 2019" .SH NAME SY-literal \- synopsis block in literal context .SH DESCRIPTION BEGINTEST .br initial regular text .SY command .I arguments .YS middle regular text .nf literal text before display .SY command .I arguments .YS literal text after display .fi final regular text .br ENDTEST .br end of file mandoc-1.14.6/regress/man/SY/literal.out_ascii010064400017530001753000000011401412140003500214500ustar00schwarzeschwarzeSY-LITERAL(1) General Commands Manual SY-LITERAL(1) NNAAMMEE SY-literal - synopsis block in literal context DDEESSCCRRIIPPTTIIOONN BEGINTEST initial regular text ccoommmmaanndd _a_r_g_u_m_e_n_t_s middle regular text literal text before display ccoommmmaanndd _a_r_g_u_m_e_n_t_s literal text after display final regular text ENDTEST end of file OpenBSD January 5, 2019 SY-LITERAL(1) mandoc-1.14.6/regress/man/SY/literal.out_html010064400017530001753000000006561374632356600213700ustar00schwarzeschwarze
initial regular text

command arguments
middle regular text
literal text
before display
command
arguments
literal text
after display

final regular text
mandoc-1.14.6/regress/mdoc004075500017530001753000000000001412314056600156735ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Makefile010064400017530001753000000005521363444076700174250ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.33 2020/03/13 00:31:05 schwarze Exp $ SUBDIR = Ad An Ap Aq Ar At Bd Bf Bk Bl Brq Bx Cd Cm SUBDIR += D1 Db Dd Dl Dq Dt Dv Em Eo Er Ev Ex Fd Fl Fo Ft Ic In Lb Li Lk SUBDIR += Ms Mt Nd Nm No Ns Oo Op Os Ox Pa Pf Pp Qq Rs Rv SUBDIR += Sh Sm Sq St Sx Sy Tg Tn Ud Ux Va Vt Xr blank break .include "../Makefile.sub" .include mandoc-1.14.6/regress/mdoc/Makefile.inc010064400017530001753000000001361304650511300201530ustar00schwarzeschwarze# $OpenBSD: Makefile.inc,v 1.1 2009/10/28 03:20:42 schwarze Exp $ .include "../Makefile.inc" mandoc-1.14.6/regress/mdoc/Ad004075500017530001753000000000001412314056600162175ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ad/Makefile010064400017530001753000000002141306010564200177230ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2014/07/02 20:18:42 schwarze Exp $ REGRESS_TARGETS = noarg font LINT_TARGETS = noarg .include mandoc-1.14.6/regress/mdoc/Ad/font.in010064400017530001753000000004301313667012500175700ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AD-FONT 1 .Os .Sh NAME .Nm Ad-font .Nd changing fonts inside the address macro .Sh DESCRIPTION normal text .Ad emphasis\\fBbold\\fPback | after ":" punctuation "Sy" bold trailing text mandoc-1.14.6/regress/mdoc/Ad/font.out_ascii010064400017530001753000000006471313667012500211530ustar00schwarzeschwarzeAD-FONT(1) General Commands Manual AD-FONT(1) NNAAMMEE AAdd--ffoonntt - changing fonts inside the address macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k | _a_f_t_e_r: _p_u_n_c_t_u_a_t_i_o_n bboolldd trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ad/font.out_markdown010064400017530001753000000003371313667012500217010ustar00schwarzeschwarzeAD-FONT(1) - General Commands Manual # NAME **Ad-font** - changing fonts inside the address macro # DESCRIPTION normal text *emphasis**bold**back* | *after*: *punctuation* **bold** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ad/noarg.in010064400017530001753000000003721313667012500177350ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AD-NOARG 1 .Os .Sh NAME .Nm Ad-noarg .Nd address macro without an argument .Sh DESCRIPTION with address: .Ad 0x3bc. no address: .Ad end of test document mandoc-1.14.6/regress/mdoc/Ad/noarg.out_ascii010064400017530001753000000005311313667012500213030ustar00schwarzeschwarzeAD-NOARG(1) General Commands Manual AD-NOARG(1) NNAAMMEE AAdd--nnooaarrgg - address macro without an argument DDEESSCCRRIIPPTTIIOONN with address: _0_x_3_b_c_. no address: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ad/noarg.out_lint010064400017530001753000000002061313667012500211600ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Ad mandoc: noarg.in:10:10: STYLE: no blank before trailing delimiter: Ad 0x3bc. mandoc-1.14.6/regress/mdoc/Ad/noarg.out_markdown010064400017530001753000000003001313667012500220270ustar00schwarzeschwarzeAD-NOARG(1) - General Commands Manual # NAME **Ad-noarg** - address macro without an argument # DESCRIPTION with address: *0x3bc.* no address: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/An004075500017530001753000000000001412314056600162315ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/An/Makefile010064400017530001753000000002071306010564200177370ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2014/08/14 02:00:52 schwarze Exp $ REGRESS_TARGETS = break LINT_TARGETS = break .include mandoc-1.14.6/regress/mdoc/An/break.in010064400017530001753000000011321313667012500177200ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.7 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AN-BREAK 1 .Os .Sh NAME .Nm An-break .Nd line breaking of the author macro .Sh DESCRIPTION inline is the default: .An Kristaps , .An Ingo "," and .An Joerg . empty .An trailing .An . .Pp .An -split -nosplit bogus split mode: .An Kristaps .An Ingo .An Joerg .Pp empty .An trailing .An . .An -nosplit .Sh AUTHORS split mode is the default: .An Kristaps .An Ingo .An Joerg .Pp empty .An trailing .An . .An -nosplit -split bogus .Pp inline: .An Kristaps "," .An Ingo, and .An Joerg . empty .An trailing .An . mandoc-1.14.6/regress/mdoc/An/break.out_ascii010064400017530001753000000011421313667012500212720ustar00schwarzeschwarzeAN-BREAK(1) General Commands Manual AN-BREAK(1) NNAAMMEE AAnn--bbrreeaakk - line breaking of the author macro DDEESSCCRRIIPPTTIIOONN inline is the default: Kristaps, Ingo, and Joerg. empty trailing . split mode: Kristaps Ingo Joerg empty trailing . AAUUTTHHOORRSS split mode is the default: Kristaps Ingo Joerg empty trailing . inline: Kristaps, Ingo, and Joerg. empty trailing . OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/An/break.out_lint010064400017530001753000000014631313667012500211560ustar00schwarzeschwarzemandoc: break.in:15:2: WARNING: skipping empty macro: An mandoc: break.in:17:2: WARNING: skipping empty macro: An mandoc: break.in:19:12: WARNING: skipping duplicate argument: An -nosplit mandoc: break.in:19:21: ERROR: skipping excess arguments: An ... bogus mandoc: break.in:26:2: WARNING: skipping empty macro: An mandoc: break.in:28:2: WARNING: skipping empty macro: An mandoc: break.in:37:2: WARNING: skipping empty macro: An mandoc: break.in:39:2: WARNING: skipping empty macro: An mandoc: break.in:40:14: WARNING: skipping duplicate argument: An -split mandoc: break.in:40:21: ERROR: skipping excess arguments: An ... bogus mandoc: break.in:44:9: STYLE: no blank before trailing delimiter: An Ingo, mandoc: break.in:48:2: WARNING: skipping empty macro: An mandoc: break.in:50:2: WARNING: skipping empty macro: An mandoc-1.14.6/regress/mdoc/An/break.out_markdown010064400017530001753000000006221313667012500220260ustar00schwarzeschwarzeAN-BREAK(1) - General Commands Manual # NAME **An-break** - line breaking of the author macro # DESCRIPTION inline is the default: Kristaps, Ingo, and Joerg. empty trailing . split mode: Kristaps Ingo Joerg empty trailing . # AUTHORS split mode is the default: Kristaps Ingo Joerg empty trailing . inline: Kristaps, Ingo, and Joerg. empty trailing . OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ap004075500017530001753000000000001412314056600162335ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ap/Makefile010064400017530001753000000001671306010564300177470ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2012/11/16 18:40:39 schwarze Exp $ REGRESS_TARGETS = middle eos .include mandoc-1.14.6/regress/mdoc/Ap/eos.in010064400017530001753000000004471313667012500174340ustar00schwarzeschwarze.\" $OpenBSD: eos.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AP-EOS 1 .Os .Sh NAME .Nm Ap-eos .Nd end of sentence handling after the apostrophe macro .Sh DESCRIPTION The first sentence is .An Ingo Ap s . The second is .An Kristaps Ap . No idea about the third. mandoc-1.14.6/regress/mdoc/Ap/eos.out_ascii010064400017530001753000000005721313667012500210040ustar00schwarzeschwarzeAP-EOS(1) General Commands Manual AP-EOS(1) NNAAMMEE AApp--eeooss - end of sentence handling after the apostrophe macro DDEESSCCRRIIPPTTIIOONN The first sentence is Ingo's. The second is Kristaps'. No idea about the third. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ap/eos.out_markdown010064400017530001753000000003461313667012500215350ustar00schwarzeschwarzeAP-EOS(1) - General Commands Manual # NAME **Ap-eos** - end of sentence handling after the apostrophe macro # DESCRIPTION The first sentence is Ingo's. The second is Kristaps'. No idea about the third. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ap/middle.in010064400017530001753000000004231313667012500200760ustar00schwarzeschwarze.\" $OpenBSD: middle.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AP-MIDDLE 1 .Os .Sh NAME .Nm Ap-middle .Nd apostrophe in the middle of a macro line .Sh DESCRIPTION .Xr mandoc 1 Ap s .Pp punctuation and called macros: .Sy bold Ap ( "Sy" bold mandoc-1.14.6/regress/mdoc/Ap/middle.out_ascii010064400017530001753000000005551313667012500214550ustar00schwarzeschwarzeAP-MIDDLE(1) General Commands Manual AP-MIDDLE(1) NNAAMMEE AApp--mmiiddddllee - apostrophe in the middle of a macro line DDEESSCCRRIIPPTTIIOONN mandoc(1)'s punctuation and called macros: bboolldd'(bboolldd OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ap/middle.out_markdown010064400017530001753000000003201313667012500221750ustar00schwarzeschwarzeAP-MIDDLE(1) - General Commands Manual # NAME **Ap-middle** - apostrophe in the middle of a macro line # DESCRIPTION mandoc(1)'s punctuation and called macros: **bold**'(**bold** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Aq004075500017530001753000000000001412314056600162345ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Aq/Makefile010064400017530001753000000002521313667012500177510ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2014/11/19 21:59:20 schwarze Exp $ REGRESS_TARGETS = author empty UTF8_TARGETS = author empty LINT_TARGETS = empty .include mandoc-1.14.6/regress/mdoc/Aq/author.in010064400017530001753000000004471313667012500201510ustar00schwarzeschwarze.\" $OpenBSD: author.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AQ-AUTHOR 1 .Os .Sh NAME .Nm Aq-author .Nd angle brackets after an author name macro .Sh DESCRIPTION .An Name Ao Mt addr Ac An Name Aq Mt addr .Sh AUTHORS .An Name Ao Mt addr Ac An Name Aq Mt addr mandoc-1.14.6/regress/mdoc/Aq/author.out_ascii010064400017530001753000000006231313667012500215160ustar00schwarzeschwarzeAQ-AUTHOR(1) General Commands Manual AQ-AUTHOR(1) NNAAMMEE AAqq--aauutthhoorr - angle brackets after an author name macro DDEESSCCRRIIPPTTIIOONN Name <_a_d_d_r> Name <_a_d_d_r> AAUUTTHHOORRSS Name <_a_d_d_r> Name <_a_d_d_r> OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Aq/author.out_markdown010064400017530001753000000004441313667012500222510ustar00schwarzeschwarzeAQ-AUTHOR(1) - General Commands Manual # NAME **Aq-author** - angle brackets after an author name macro # DESCRIPTION Name <[addr](mailto:addr)> Name <[addr](mailto:addr)> # AUTHORS Name <[addr](mailto:addr)> Name <[addr](mailto:addr)> OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Aq/author.out_utf8010064400017530001753000000006251313667012500213160ustar00schwarzeschwarzeAQ-AUTHOR(1) General Commands Manual AQ-AUTHOR(1) NNAAMMEE AAqq--aauutthhoorr – angle brackets after an author name macro DDEESSCCRRIIPPTTIIOONN Name <_a_d_d_r> Name <_a_d_d_r> AAUUTTHHOORRSS Name <_a_d_d_r> Name <_a_d_d_r> OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Aq/empty.in010064400017530001753000000004271313667012500200030ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.5 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AQ-EMPTY 1 .Os .Sh NAME .Nm Aq-empty .Nd empty implicit enclosure macros .Sh DESCRIPTION An empty .Aq and a full .Aq user@host: return path. And another .Ao full: Ac one "Sy" bold . mandoc-1.14.6/regress/mdoc/Aq/empty.out_ascii010064400017530001753000000005621313667012500213540ustar00schwarzeschwarzeAQ-EMPTY(1) General Commands Manual AQ-EMPTY(1) NNAAMMEE AAqq--eemmppttyy - empty implicit enclosure macros DDEESSCCRRIIPPTTIIOONN An empty <> and a full return path. And another one bboolldd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Aq/empty.out_markdown010064400017530001753000000003531313667012500221040ustar00schwarzeschwarzeAQ-EMPTY(1) - General Commands Manual # NAME **Aq-empty** - empty implicit enclosure macros # DESCRIPTION An empty <> and a full <user@host:> return path. And another <full:> one **bold**. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Aq/empty.out_utf8010064400017530001753000000006001313667012500211430ustar00schwarzeschwarzeAQ-EMPTY(1) General Commands Manual AQ-EMPTY(1) NNAAMMEE AAqq--eemmppttyy – empty implicit enclosure macros DDEESSCCRRIIPPTTIIOONN An empty ⟨⟩ and a full ⟨user@host:⟩ return path. And another ⟨full:⟩ one bboolldd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Aq/empty.out_lint010064400017530001753000000001211333010372000212050ustar00schwarzeschwarzemandoc: empty.in:12:14: STYLE: no blank before trailing delimiter: Aq user@host: mandoc-1.14.6/regress/mdoc/Ar004075500017530001753000000000001412314056600162355ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ar/Makefile010064400017530001753000000002141313667012500177500ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2012/07/09 17:52:09 schwarze Exp $ REGRESS_TARGETS = punct font LINT_TARGETS = punct .include mandoc-1.14.6/regress/mdoc/Ar/font.in010064400017530001753000000003671313667012500176170ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AR-FONT 1 .Os .Sh NAME .Nm Ar-font .Nd changing fonts inside the argument macro .Sh DESCRIPTION normal text .Ar emphasis\\fBbold\\fPback trailing text mandoc-1.14.6/regress/mdoc/Ar/font.out_ascii010064400017530001753000000005461313667012500211670ustar00schwarzeschwarzeAR-FONT(1) General Commands Manual AR-FONT(1) NNAAMMEE AArr--ffoonntt - changing fonts inside the argument macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ar/font.out_markdown010064400017530001753000000002761313667012500217210ustar00schwarzeschwarzeAR-FONT(1) - General Commands Manual # NAME **Ar-font** - changing fonts inside the argument macro # DESCRIPTION normal text *emphasis**bold**back* trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ar/punct.in010064400017530001753000000010431313667012500177720ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.6 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AR-PUNCT 1 .Os .Sh NAME .Nm Ar-punct .Nd punctuation handling by the Ar macro .Sh DESCRIPTION closing punctuation .Ar a ) only one .Ar ) only more than one .Ar ) ) middle .Ar a ) z start .Ar ) z dot .Ar . z comma .Ar , z semicolon .Ar ; z colon .Ar : z quest .Ar ? z excl .Ar ! z paren .Ar ) z bracket .Ar ] z bar .Ar | m op paren .Ar ( a op bracket .Ar [ a .Pp quoted punctuation: .Ar a "(" b "|" c ")" d "," "Sy" bold . .Pp missing blank: .Ar arg. mandoc-1.14.6/regress/mdoc/Ar/punct.out_ascii010064400017530001753000000015331313667012600213500ustar00schwarzeschwarzeAR-PUNCT(1) General Commands Manual AR-PUNCT(1) NNAAMMEE AArr--ppuunncctt - punctuation handling by the Ar macro DDEESSCCRRIIPPTTIIOONN closing punctuation _a) only one _f_i_l_e _._._.) only more than one _f_i_l_e _._._.)) middle _a) _z start _f_i_l_e _._._.) _z dot _f_i_l_e _._._.. _z comma _f_i_l_e _._._., _z semicolon _f_i_l_e _._._.; _z colon _f_i_l_e _._._.: _z quest _f_i_l_e _._._.? _z excl _f_i_l_e _._._.! _z paren _f_i_l_e _._._.) _z bracket _f_i_l_e _._._.] _z bar | _m op paren (_a op bracket [_a quoted punctuation: _a (_b | _c) _d, bboolldd. missing blank: _a_r_g_. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ar/punct.out_markdown010064400017530001753000000010461313667012600221010ustar00schwarzeschwarzeAR-PUNCT(1) - General Commands Manual # NAME **Ar-punct** - punctuation handling by the Ar macro # DESCRIPTION closing punctuation *a*) only one *file ...*) only more than one *file ...*)) middle *a*) *z* start *file ...*) *z* dot *file ...*. *z* comma *file ...*, *z* semicolon *file ...*; *z* colon *file ...*: *z* quest *file ...*? *z* excl *file ...*! *z* paren *file ...*) *z* bracket *file ...*] *z* bar | *m* op paren (*a* op bracket \[*a* quoted punctuation: *a* (*b* | *c*) *d*, **bold**. missing blank: *arg.* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ar/punct.out_lint010064400017530001753000000001121312673153600212200ustar00schwarzeschwarzemandoc: punct.in:46:8: STYLE: no blank before trailing delimiter: Ar arg. mandoc-1.14.6/regress/mdoc/At004075500017530001753000000000001412314056600162375ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/At/Makefile010064400017530001753000000002131306010564600177460ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2014/07/05 12:33:54 schwarze Exp $ REGRESS_TARGETS = invalid LINT_TARGETS = invalid .include mandoc-1.14.6/regress/mdoc/At/invalid.in010064400017530001753000000004601313667012600202740ustar00schwarzeschwarze.\" $OpenBSD: invalid.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AT-INVALID 1 .Os .Sh NAME .Nm At-invalid .Nd handling of an invalid AT&T UNIX argument .Sh DESCRIPTION no argument: .At .Pp valid argument: .At v7 .Pp invalid argument: .At murks "Sy" bold .Pp end of file mandoc-1.14.6/regress/mdoc/At/invalid.out_ascii010064400017530001753000000006551313667012600216530ustar00schwarzeschwarzeAT-INVALID(1) General Commands Manual AT-INVALID(1) NNAAMMEE AAtt--iinnvvaalliidd - handling of an invalid AT&T UNIX argument DDEESSCCRRIIPPTTIIOONN no argument: AT&T UNIX valid argument: Version 7 AT&T UNIX invalid argument: AT&T UNIX murks bboolldd end of file OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/At/invalid.out_lint010064400017530001753000000001061313667012600215200ustar00schwarzeschwarzemandoc: invalid.in:16:5: WARNING: unknown AT&T UNIX version: At murks mandoc-1.14.6/regress/mdoc/At/invalid.out_markdown010064400017530001753000000004161313667012600224000ustar00schwarzeschwarzeAT-INVALID(1) - General Commands Manual # NAME **At-invalid** - handling of an invalid AT&T UNIX argument # DESCRIPTION no argument: AT&T UNIX valid argument: Version 7 AT&T UNIX invalid argument: AT&T UNIX murks **bold** end of file OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd004075500017530001753000000000001412314056600162205ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Bd/Makefile010064400017530001753000000014051367274433700177520ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.24 2020/04/19 16:26:11 schwarze Exp $ REGRESS_TARGETS = beforeNAME blank centered nested nf paragraph spacing REGRESS_TARGETS += badargs empty offset-empty offset-neg REGRESS_TARGETS += break broken unclosed TAG_TARGETS = nested paragraph spacing LINT_TARGETS = beforeNAME blank nested badargs break broken unclosed HTML_TARGETS = nested nf paragraph SKIP_TMAN = beforeNAME centered # groff-1.22.3 defects: # - a display breaking another block continues indefinitely # - negative offsets take no effect, but advance the indention on exit SKIP_GROFF = break offset-neg # adjustment is disabled in groff for now SKIP_GROFF += centered # groff handles content before NAME differently SKIP_GROFF += beforeNAME .include mandoc-1.14.6/regress/mdoc/Bd/badargs.in010064400017530001753000000014631313667012600202360ustar00schwarzeschwarze.\" $OpenBSD: badargs.in,v 1.6 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-BADARGS 1 .Os .Sh NAME .Nm Bd-badargs .Nd display block with bad arguments .Sh DESCRIPTION trailing -offset: .Bd -ragged -offset is ignored .Ed tail argument double -compact and -offset: .Bd -ragged -compact -offset 42n -compact -offset 6n last wins .Ed no type: .Bd -offset 0n -bogus args displayed text .Ed double type: .Bd -ragged -compact -unfilled ragged unfilled .Ed .Bd -unfilled -compact -ragged unfilled ragged .Ed file /dev/null: .Bd -ragged -file /dev/null -offset indent ragged offset indent .Ed trailing -file: .Bd -ragged -offset indent -file ragged offset indent .Ed missing -file argument: .Bd -ragged -offset indent -file -compact ragged offset indent .Ed no argument whatsoever: .Bd no argument .Ed mandoc-1.14.6/regress/mdoc/Bd/badargs.out_ascii010064400017530001753000000012551313667012600216060ustar00schwarzeschwarzeBD-BADARGS(1) General Commands Manual BD-BADARGS(1) NNAAMMEE BBdd--bbaaddaarrggss - display block with bad arguments DDEESSCCRRIIPPTTIIOONN trailing -offset: is ignored double -compact and -offset: last wins no type: displayed text double type: ragged unfilled unfilled ragged file /dev/null: ragged offset indent trailing -file: ragged offset indent missing -file argument: ragged offset indent no argument whatsoever: no argument OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/badargs.out_lint010064400017530001753000000015001313667012600214550ustar00schwarzeschwarzemandoc: badargs.in:13:2: ERROR: skipping all arguments: Ed tail argument mandoc: badargs.in:20:16: ERROR: skipping excess arguments: Bd ... -bogus mandoc: badargs.in:10:13: WARNING: empty argument, using 0n: Bd -offset mandoc: badargs.in:15:34: WARNING: duplicate argument: Bd -compact mandoc: badargs.in:15:43: WARNING: duplicate argument: Bd -offset 6n mandoc: badargs.in:20:2: WARNING: missing display type, using -ragged: Bd mandoc: badargs.in:25:2: WARNING: skipping duplicate display type: Bd -unfilled mandoc: badargs.in:29:2: WARNING: skipping duplicate display type: Bd -ragged mandoc: badargs.in:34:2: ERROR: NOT IMPLEMENTED: Bd -file mandoc: badargs.in:39:2: ERROR: NOT IMPLEMENTED: Bd -file mandoc: badargs.in:44:2: ERROR: NOT IMPLEMENTED: Bd -file mandoc: badargs.in:49:2: ERROR: skipping display without arguments: Bd mandoc-1.14.6/regress/mdoc/Bd/badargs.out_markdown010064400017530001753000000007341313667012600223410ustar00schwarzeschwarzeBD-BADARGS(1) - General Commands Manual # NAME **Bd-badargs** - display block with bad arguments # DESCRIPTION trailing -offset: > is > ignored double -compact and -offset: > last > wins no type: > displayed > text double type: > ragged > unfilled unfilled ragged file /dev/null: > ragged > offset indent trailing -file: > ragged > offset indent missing -file argument: > ragged > offset indent no argument whatsoever: no argument OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/beforeNAME.in010064400017530001753000000005031313667012600205300ustar00schwarzeschwarze.\" $OpenBSD: beforeNAME.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-BEFORENAME 1 .Os .Bd -centered Building and Debugging NetBSD Kernels .br David A. Holland .br August 17, 2009 .Ed .Sh NAME .Nm Bd-beforename .Nd title and author block before the NAME section .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Bd/beforeNAME.out_ascii010064400017530001753000000007271313667012600221110ustar00schwarzeschwarzeBD-BEFORENAME(1) General Commands Manual BD-BEFORENAME(1) Building and Debugging NetBSD Kernels David A. Holland August 17, 2009 NNAAMMEE BBdd--bbeeffoorreennaammee - title and author block before the NAME section DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/beforeNAME.out_lint010064400017530001753000000001141313667012600217550ustar00schwarzeschwarzemandoc: beforeNAME.in:5:2: WARNING: content before first section header: Bd mandoc-1.14.6/regress/mdoc/Bd/beforeNAME.out_markdown010064400017530001753000000003731313667012600226400ustar00schwarzeschwarzeBD-BEFORENAME(1) - General Commands Manual > Building and Debugging NetBSD Kernels > David A. Holland > August 17, 2009 # NAME **Bd-beforename** - title and author block before the NAME section # DESCRIPTION some text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/blank.in010064400017530001753000000012511313667012600177150ustar00schwarzeschwarze.\" $OpenBSD: blank.in,v 1.6 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-BLANK 1 .Os .Sh NAME .Nm Bd-blank .Nd handling of blank lines in literal displays .Sh DESCRIPTION .Bd -literal completely blank line: line containing a blank character: line containing two blank characters: line containing space tab space: line starting with a blank character: x line starting with two blank characters: x line ending in one blank character: line ending in two blank characters: line ending in space tab space: line containing a Pp macro: .Pp finally, a trailing blank line: .Ed An empty one-line literal display: .Dl end of test document mandoc-1.14.6/regress/mdoc/Bd/blank.out_ascii010064400017530001753000000014411313667012600212670ustar00schwarzeschwarzeBD-BLANK(1) General Commands Manual BD-BLANK(1) NNAAMMEE BBdd--bbllaannkk - handling of blank lines in literal displays DDEESSCCRRIIPPTTIIOONN completely blank line: line containing a blank character: line containing two blank characters: line containing space tab space: line starting with a blank character: x line starting with two blank characters: x line ending in one blank character: line ending in two blank characters: line ending in space tab space: line containing a Pp macro: finally, a trailing blank line: An empty one-line literal display: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/blank.out_lint010064400017530001753000000007451313667012600211530ustar00schwarzeschwarzemandoc: blank.in:13:1: STYLE: whitespace at end of input line mandoc: blank.in:15:1: STYLE: whitespace at end of input line mandoc: blank.in:17:1: STYLE: whitespace at end of input line mandoc: blank.in:22:36: STYLE: whitespace at end of input line mandoc: blank.in:23:37: STYLE: whitespace at end of input line mandoc: blank.in:24:32: STYLE: whitespace at end of input line mandoc: blank.in:31:8: STYLE: whitespace at end of input line mandoc: blank.in:31:2: WARNING: empty block: Dl mandoc-1.14.6/regress/mdoc/Bd/blank.out_markdown010064400017530001753000000011401313667012600220150ustar00schwarzeschwarzeBD-BLANK(1) - General Commands Manual # NAME **Bd-blank** - handling of blank lines in literal displays # DESCRIPTION completely blank line: line containing a blank character: line containing two blank characters: line containing space tab space: line starting with a blank character: x line starting with two blank characters: x line ending in one blank character: line ending in two blank characters: line ending in space tab space: line containing a Pp macro: finally, a trailing blank line: An empty one-line literal display: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/break.in010064400017530001753000000004401313667012600177110ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-BREAK 1 .Os .Sh NAME .Nm Bd-break .Nd display breaking another block .Sh DESCRIPTION before both .Bd -ragged -offset indent before bracket .Bo inside both .Ed after display .Bc after both mandoc-1.14.6/regress/mdoc/Bd/break.out_ascii010064400017530001753000000005471313667012600212720ustar00schwarzeschwarzeBD-BREAK(1) General Commands Manual BD-BREAK(1) NNAAMMEE BBdd--bbrreeaakk - display breaking another block DDEESSCCRRIIPPTTIIOONN before both before bracket [inside both after display] after both OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/break.out_lint010064400017530001753000000001021313667012600211330ustar00schwarzeschwarzemandoc: break.in:13:2: WARNING: blocks badly nested: Bd breaks Bo mandoc-1.14.6/regress/mdoc/Bd/break.out_markdown010064400017530001753000000003161313667012600220160ustar00schwarzeschwarzeBD-BREAK(1) - General Commands Manual # NAME **Bd-break** - display breaking another block # DESCRIPTION before both > before bracket > \[inside both after display] after both OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/broken.in010064400017530001753000000004311313667012600201050ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-BROKEN 1 .Os .Sh NAME .Nm Bd-broken .Nd display broken by another block .Sh DESCRIPTION before both .Bo before display .Bd -ragged -offset indent inside both .Bc after bracket .Ed mandoc-1.14.6/regress/mdoc/Bd/centered.in010064400017530001753000000005101343772345300204220ustar00schwarzeschwarze.\" $OpenBSD: centered.in,v 1.3 2019/01/04 03:54:50 schwarze Exp $ .Dd $Mdocdate: January 4 2019 $ .Dt BD-CENTERED 1 .Os .Sh NAME .Nm Bd-centered .Nd centered display blocks .Sh DESCRIPTION preceding text .br .Bd -centered -offset indent The text in this centered block is wide enough to not fit on one line. .Ed following text mandoc-1.14.6/regress/mdoc/Bd/broken.out_ascii010064400017530001753000000005331313667012600214610ustar00schwarzeschwarzeBD-BROKEN(1) General Commands Manual BD-BROKEN(1) NNAAMMEE BBdd--bbrrookkeenn - display broken by another block DDEESSCCRRIIPPTTIIOONN before both [before display inside both] after bracket OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/broken.out_lint010064400017530001753000000001031313667012600213300ustar00schwarzeschwarzemandoc: broken.in:13:2: WARNING: blocks badly nested: Bo breaks Bd mandoc-1.14.6/regress/mdoc/Bd/broken.out_markdown010064400017530001753000000003051313667012600222100ustar00schwarzeschwarzeBD-BROKEN(1) - General Commands Manual # NAME **Bd-broken** - display broken by another block # DESCRIPTION before both \[before display > inside both] > after bracket OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/centered.out_ascii010064400017530001753000000006671343772345300220100ustar00schwarzeschwarzeBD-CENTERED(1) General Commands Manual BD-CENTERED(1) NNAAMMEE BBdd--cceenntteerreedd - centered display blocks DDEESSCCRRIIPPTTIIOONN preceding text The text in this centered block is wide enough to not fit on one line. following text OpenBSD January 4, 2019 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/centered.out_markdown010064400017530001753000000003601343772345300225300ustar00schwarzeschwarzeBD-CENTERED(1) - General Commands Manual # NAME **Bd-centered** - centered display blocks # DESCRIPTION preceding text > The text in this centered block is wide enough to not fit on one line. following text OpenBSD - January 4, 2019 mandoc-1.14.6/regress/mdoc/Bd/empty.in010064400017530001753000000005501313667012600177650ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-EMPTY 1 .Os .Sh NAME .Nm Bd-empty .Nd empty displays .Sh DESCRIPTION An empty filled display: .Bd -filled .Ed An empty literal display: .Bd -literal .Ed An empty ragged display: .Bd -ragged .Ed An empty unfilled display: .Bd -unfilled .Ed end of test document mandoc-1.14.6/regress/mdoc/Bd/empty.out_ascii010064400017530001753000000006301313667012600213350ustar00schwarzeschwarzeBD-EMPTY(1) General Commands Manual BD-EMPTY(1) NNAAMMEE BBdd--eemmppttyy - empty displays DDEESSCCRRIIPPTTIIOONN An empty filled display: An empty literal display: An empty ragged display: An empty unfilled display: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/empty.out_markdown010064400017530001753000000003651313667012600220740ustar00schwarzeschwarzeBD-EMPTY(1) - General Commands Manual # NAME **Bd-empty** - empty displays # DESCRIPTION An empty filled display: An empty literal display: An empty ragged display: An empty unfilled display: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/nested.in010064400017530001753000000012231367274433700201220ustar00schwarzeschwarze.\" $OpenBSD: nested.in,v 1.4 2020/04/19 16:26:11 schwarze Exp $ .Dd $Mdocdate: April 19 2020 $ .Dt BD-NESTED 1 .Os .Sh NAME .Nm Bd-nested .Nd nested displays and lists .Sh DESCRIPTION BEGINTEST .Pp regular text .Tg outer .Bd -ragged -offset indent outer text .Pq default indent .Tg inner .Bd -ragged -offset indent inner text .Pq default indent .Ed outer text .Ed regular text .Tg outer .Bd -ragged -offset 4n outer text (4n) .Tg inner .Bd -ragged -offset 2n inner text (2n) .Ed outer text .Bl -tag -width 6n .It tag text .El outer text .Ed regular text .Bl -tag -width 6n .It tag outer text .Bd -ragged -offset 2n inner text (2n) .Ed outer text .El ENDTEST mandoc-1.14.6/regress/mdoc/Bd/nested.out_ascii010064400017530001753000000012221367274433700214720ustar00schwarzeschwarzeBD-NESTED(1) General Commands Manual BD-NESTED(1) NNAAMMEE BBdd--nneesstteedd - nested displays and lists DDEESSCCRRIIPPTTIIOONN BEGINTEST regular text outer text (default indent) inner text (default indent) outer text regular text outer text (4n) inner text (2n) outer text tag text outer text regular text tag outer text inner text (2n) outer text ENDTEST OpenBSD April 19, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/nested.out_lint010064400017530001753000000002301367274433700213460ustar00schwarzeschwarzemandoc: nested.in:18:2: WARNING: nested displays are not portable: Bd in Bd mandoc: nested.in:31:2: WARNING: nested displays are not portable: Bd in Bd mandoc-1.14.6/regress/mdoc/Bd/nested.out_markdown010064400017530001753000000006421367274433700222310ustar00schwarzeschwarzeBD-NESTED(1) - General Commands Manual # NAME **Bd-nested** - nested displays and lists # DESCRIPTION BEGINTEST regular text > outer text > (default indent) > > inner text > > (default indent) > outer > text regular text > outer text (4n) > > inner text (2n) > outer text > tag > > text > outer text regular text tag > outer text > > inner text (2n) > outer text ENDTEST OpenBSD - April 19, 2020 mandoc-1.14.6/regress/mdoc/Bd/offset-empty.in010064400017530001753000000012041313667012600212460ustar00schwarzeschwarze.\" $OpenBSD: offset-empty.in,v 1.6 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-OFFSET-EMPTY 1 .Os .Sh NAME .Nm Bd-offset-empty .Nd no argument specified to Bd offset .Sh DESCRIPTION .Bd -literal -offset Bd literal offset empty .Ed .Bd -literal -offset left Bd literal offset left .Ed .Bd -literal -offset indent Bd literal offset indent .Ed .Bd -literal -offset indent-two Bd literal offset indent-two .Ed .Bd -literal -offset 4n Bd literal offset 4n .Ed .Bd -literal -offset mystring Bd literal offset mystring .Ed .Bd -literal -offset Ds Bd literal offset Ds .Ed .Bd -literal -offset 78n Bd literal offset 78n .Ed mandoc-1.14.6/regress/mdoc/Bd/offset-empty.out_ascii010064400017530001753000000012111313667012600226150ustar00schwarzeschwarzeBD-OFFSET-EMPTY(1) General Commands Manual BD-OFFSET-EMPTY(1) NNAAMMEE BBdd--ooffffsseett--eemmppttyy - no argument specified to Bd offset DDEESSCCRRIIPPTTIIOONN Bd literal offset empty Bd literal offset left Bd literal offset indent Bd literal offset indent-two Bd literal offset 4n Bd literal offset mystring Bd literal offset Ds Bd literal offset 78n OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/offset-empty.out_markdown010064400017530001753000000005461313667012600233610ustar00schwarzeschwarzeBD-OFFSET-EMPTY(1) - General Commands Manual # NAME **Bd-offset-empty** - no argument specified to Bd offset # DESCRIPTION Bd literal offset empty Bd literal offset left Bd literal offset indent Bd literal offset indent-two Bd literal offset 4n Bd literal offset mystring Bd literal offset Ds Bd literal offset 78n OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/offset-neg.in010064400017530001753000000006511313667012600206660ustar00schwarzeschwarze.\" $OpenBSD: offset-neg.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-INDENT 1 .Os .Sh NAME .Nm Bd-indent .Nd indenting display blocks .Sh DESCRIPTION regular text .Bd -ragged -offset 0.76i outer display .Bd -ragged -offset -0.46i inner display .Ed outer display .Ed regular text .Bd -ragged -offset -3n outer display .Bd -ragged -offset 8n inner display .Ed outer display .Ed regular text mandoc-1.14.6/regress/mdoc/Bd/offset-neg.out_ascii010064400017530001753000000007121313667012600222350ustar00schwarzeschwarzeBD-INDENT(1) General Commands Manual BD-INDENT(1) NNAAMMEE BBdd--iinnddeenntt - indenting display blocks DDEESSCCRRIIPPTTIIOONN regular text outer display inner display outer display regular text outer display inner display outer display regular text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/offset-neg.out_markdown010064400017530001753000000004241313667012600227670ustar00schwarzeschwarzeBD-INDENT(1) - General Commands Manual # NAME **Bd-indent** - indenting display blocks # DESCRIPTION regular text > outer display > > inner display > outer display regular text > outer display > > inner display > outer display regular text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/spacing.in010064400017530001753000000006621363444076700202700ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.4 2020/02/27 01:25:58 schwarze Exp $ .Dd $Mdocdate: February 27 2020 $ .Dt BD-SPACING 1 .Os .Sh NAME .Nm Bd-spacing .Nd vertical spacing around display blocks .Sh DESCRIPTION preceding text .Bd -ragged -offset indent display block .Ed text between displays .Bd -ragged -offset indent -compact compact display block .Ed following text .Sh EXAMPLES .Tg word .Bd -literal -offset indent text .Ed end of file mandoc-1.14.6/regress/mdoc/Bd/spacing.out_ascii010064400017530001753000000007261363444076700216420ustar00schwarzeschwarzeBD-SPACING(1) General Commands Manual BD-SPACING(1) NNAAMMEE BBdd--ssppaacciinngg - vertical spacing around display blocks DDEESSCCRRIIPPTTIIOONN preceding text display block text between displays compact display block following text EEXXAAMMPPLLEESS text end of file OpenBSD February 27, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/spacing.out_markdown010064400017530001753000000004261363444076700223710ustar00schwarzeschwarzeBD-SPACING(1) - General Commands Manual # NAME **Bd-spacing** - vertical spacing around display blocks # DESCRIPTION preceding text > display block text between displays > compact display block following text # EXAMPLES text end of file OpenBSD - February 27, 2020 mandoc-1.14.6/regress/mdoc/Bd/unclosed.in010064400017530001753000000004061313667012600204430ustar00schwarzeschwarze.\" $OpenBSD: unclosed.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BD-UNCLOSED 1 .Os .Sh NAME .Nm Bd-unclosed .Nd display still open at the end of the file .Sh DESCRIPTION before display .Bd -ragged -offset indent inside display mandoc-1.14.6/regress/mdoc/Bd/unclosed.out_ascii010064400017530001753000000005221313667012600220130ustar00schwarzeschwarzeBD-UNCLOSED(1) General Commands Manual BD-UNCLOSED(1) NNAAMMEE BBdd--uunncclloosseedd - display still open at the end of the file DDEESSCCRRIIPPTTIIOONN before display inside display OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/unclosed.out_lint010064400017530001753000000001041313667012600216650ustar00schwarzeschwarzemandoc: unclosed.in:10:2: ERROR: appending missing end of block: Bd mandoc-1.14.6/regress/mdoc/Bd/unclosed.out_markdown010064400017530001753000000002671313667012600225530ustar00schwarzeschwarzeBD-UNCLOSED(1) - General Commands Manual # NAME **Bd-unclosed** - display still open at the end of the file # DESCRIPTION before display > inside display OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bd/nf.in010064400017530001753000000007461341457745000172460ustar00schwarzeschwarze.\" $OpenBSD: nf.in,v 1.2 2019/01/07 06:51:37 schwarze Exp $ .Dd $Mdocdate: January 7 2019 $ .Dt BD-NF 1 .Os .Sh NAME .Nm Bd-nf .Nd interaction of no-fill blocks and requests .Sh DESCRIPTION BEGINTEST initial text .nf after .nf request .fi after .fi request .Bd -unfilled in unfilled block .fi after .fi request in unfilled block .Ed after end of unfilled block .Bd -filled in filled block .nf after .nf request in filled block .Ed after end of filled block .br ENDTEST .br end of file mandoc-1.14.6/regress/mdoc/Bd/nf.out_ascii010064400017530001753000000011071341457745000206070ustar00schwarzeschwarzeBD-NF(1) General Commands Manual BD-NF(1) NNAAMMEE BBdd--nnff - interaction of no-fill blocks and requests DDEESSCCRRIIPPTTIIOONN BEGINTEST initial text after .nf request after .fi request in unfilled block after .fi request in unfilled block after end of unfilled block in filled block after .nf request in filled block after end of filled block ENDTEST end of file OpenBSD January 7, 2019 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/nf.out_html010064400017530001753000000004571374632357000204720ustar00schwarzeschwarze

after .nf
request

after .fi request

in unfilled
block
after .fi request in unfilled block
after end of unfilled block
in filled block
after .nf request
in filled block
after end of filled block
mandoc-1.14.6/regress/mdoc/Bd/nf.out_markdown010064400017530001753000000006171341457745000213460ustar00schwarzeschwarzeBD-NF(1) - General Commands Manual # NAME **Bd-nf** - interaction of no-fill blocks and requests # DESCRIPTION BEGINTEST initial text after .nf request after .fi request in unfilled block after .fi request in unfilled block after end of unfilled block > in filled > block > after .nf request > in filled block after end of filled block ENDTEST end of file OpenBSD - January 7, 2019 mandoc-1.14.6/regress/mdoc/Bd/paragraph.in010064400017530001753000000010101367274433700205770ustar00schwarzeschwarze.\" $OpenBSD: paragraph.in,v 1.3 2020/04/19 16:26:11 schwarze Exp $ .Dd $Mdocdate: April 19 2020 $ .Dt BD-PARAGRAPH 1 .Os .Sh NAME .Nm Bd-paragraph .Nd interaction of paragraphs and displays .Sh DESCRIPTION BEGINTEST initial text .Tg npara .Pp normal paragraph .Tg filled .Bd -filled filled display .Tg fpara .Pp paragraph in display .Ed back to normal .Pp another paragraph .Tg unfilled .Bd -literal unfilled literal display .Tg upara .Pp unfilled literal paragraph .Ed again back to normal .br ENDTEST .br end of file mandoc-1.14.6/regress/mdoc/Bd/paragraph.out_ascii010064400017530001753000000010641367274433700221610ustar00schwarzeschwarzeBD-PARAGRAPH(1) General Commands Manual BD-PARAGRAPH(1) NNAAMMEE BBdd--ppaarraaggrraapphh - interaction of paragraphs and displays DDEESSCCRRIIPPTTIIOONN BEGINTEST initial text normal paragraph filled display paragraph in display back to normal another paragraph unfilled literal display unfilled literal paragraph again back to normal ENDTEST end of file OpenBSD April 19, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Bd/paragraph.out_html010064400017530001753000000010661412140003500220050ustar00schwarzeschwarze

paragraph

display

in display

back to normal

another paragraph

 literal
display

 literal
paragraph
again back to normal
mandoc-1.14.6/regress/mdoc/Bd/paragraph.out_markdown010064400017530001753000000005711367274433700227150ustar00schwarzeschwarzeBD-PARAGRAPH(1) - General Commands Manual # NAME **Bd-paragraph** - interaction of paragraphs and displays # DESCRIPTION BEGINTEST initial text normal paragraph > filled > display > paragraph > in display back to normal another paragraph unfilled literal display unfilled literal paragraph again back to normal ENDTEST end of file OpenBSD - April 19, 2020 mandoc-1.14.6/regress/mdoc/Bd/nested.out_html010064400017530001753000000013341364731721700213450ustar00schwarzeschwarze

regular text

text (default indent)
text (default indent)
outer text
regular text
text (4n)
text (2n)
outer text
tag
text
outer text
regular text
tag
outer text
inner text (2n)
outer text
mandoc-1.14.6/regress/mdoc/Bd/nested.out_tag010064400017530001753000000002611372346555700211600ustar00schwarzeschwarzeNAME nested.mandoc_ascii 3 DESCRIPTION nested.mandoc_ascii 6 outer nested.mandoc_ascii 11 inner nested.mandoc_ascii 13 outer nested.mandoc_ascii 17 inner nested.mandoc_ascii 19 mandoc-1.14.6/regress/mdoc/Bd/paragraph.out_tag010064400017530001753000000003461372346555700216470ustar00schwarzeschwarzeNAME paragraph.mandoc_ascii 3 DESCRIPTION paragraph.mandoc_ascii 6 npara paragraph.mandoc_ascii 9 filled paragraph.mandoc_ascii 11 fpara paragraph.mandoc_ascii 13 unfilled paragraph.mandoc_ascii 18 upara paragraph.mandoc_ascii 21 mandoc-1.14.6/regress/mdoc/Bd/spacing.out_tag010064400017530001753000000001751372346555700213260ustar00schwarzeschwarzeNAME spacing.mandoc_ascii 3 DESCRIPTION spacing.mandoc_ascii 6 EXAMPLES spacing.mandoc_ascii 14 word spacing.mandoc_ascii 15 mandoc-1.14.6/regress/mdoc/Bf004075500017530001753000000000001412314056600162225ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Bf/Makefile010064400017530001753000000011241343772345300177450ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2019/01/07 06:51:37 schwarze Exp $ REGRESS_TARGETS = badargs break broken multiargs nest paragraph LINT_TARGETS = badargs break broken multiargs HTML_TARGETS = paragraph # mandoc -T markdown ignores .Bf, at least for now SKIP_MARKDOWN ?= ALL # groff-1.22.2 defects: # - If the first argument to .Bf is a bad one, # no block is opened at all and the .Ef causes another error. # - If a font block breaks another block, # fonts get mixed up when the other block finally ends. SKIP_GROFF = badargs break SKIP_TMAN = break broken .include mandoc-1.14.6/regress/mdoc/Bf/badargs.in010064400017530001753000000005251313667012600202360ustar00schwarzeschwarze.\" $OpenBSD: badargs.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BF-BADARGS 1 .Os .Sh NAME .Nm Bf-badargs .Nd font blocks with bad arguments .Sh DESCRIPTION normal text .Bf -emphasis emphasis .Bf no argument .Ef back to emphasis .Bf badarg bad argument .Ef tail argument back to emphasis .Ef back to normal mandoc-1.14.6/regress/mdoc/Bf/badargs.out_ascii010064400017530001753000000007061313667012600216100ustar00schwarzeschwarzeBF-BADARGS(1) General Commands Manual BF-BADARGS(1) NNAAMMEE BBff--bbaaddaarrggss - font blocks with bad arguments DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_s no argument _b_a_c_k _t_o _e_m_p_h_a_s_i_s bad argument _b_a_c_k _t_o _e_m_p_h_a_s_i_s back to normal OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bf/badargs.out_lint010064400017530001753000000003261313667012600214640ustar00schwarzeschwarzemandoc: badargs.in:18:2: ERROR: skipping all arguments: Ef tail argument mandoc: badargs.in:12:2: WARNING: missing font type, using \fR: Bf mandoc: badargs.in:16:5: WARNING: unknown font type, using \fR: Bf badarg mandoc-1.14.6/regress/mdoc/Bf/break.in010064400017530001753000000004221313667012600177130ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BF-BREAK 1 .Os .Sh NAME .Nm Bf-break .Nd font block breaking another block .Sh DESCRIPTION before both .Bf Em before bracket .Bo inside both .Ef after font block .Bc after both mandoc-1.14.6/regress/mdoc/Bf/break.out_ascii010064400017530001753000000006141313667012600212670ustar00schwarzeschwarzeBF-BREAK(1) General Commands Manual BF-BREAK(1) NNAAMMEE BBff--bbrreeaakk - font block breaking another block DDEESSCCRRIIPPTTIIOONN before both _b_e_f_o_r_e _b_r_a_c_k_e_t _[_i_n_s_i_d_e _b_o_t_h after font block] after both OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bf/break.out_lint010064400017530001753000000001021313667012600211350ustar00schwarzeschwarzemandoc: break.in:14:2: WARNING: blocks badly nested: Bf breaks Bo mandoc-1.14.6/regress/mdoc/Bf/broken.in010064400017530001753000000004261313667012600201130ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BF-BROKEN 1 .Os .Sh NAME .Nm Bf-broken .Nd font block broken by another block .Sh DESCRIPTION before both .Bo before font block .Bf Em inside both .Bc after bracket .Ef after both mandoc-1.14.6/regress/mdoc/Bf/broken.out_ascii010064400017530001753000000005641313667012600214670ustar00schwarzeschwarzeBF-BROKEN(1) General Commands Manual BF-BROKEN(1) NNAAMMEE BBff--bbrrookkeenn - font block broken by another block DDEESSCCRRIIPPTTIIOONN before both [before font block _i_n_s_i_d_e _b_o_t_h] after bracket after both OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bf/broken.out_lint010064400017530001753000000001031313667012600213320ustar00schwarzeschwarzemandoc: broken.in:13:2: WARNING: blocks badly nested: Bo breaks Bf mandoc-1.14.6/regress/mdoc/Bf/multiargs.in010064400017530001753000000007661313667012600206510ustar00schwarzeschwarze.\" $OpenBSD: multiargs.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BF-MULTIARGS 1 .Os .Sh NAME .Nm Bf-multiargs .Nd font blocks with multiple arguments .Sh DESCRIPTION normal text .Bf -symbolic -emphasis symbolic emphasis .Ef back to normal .Bf -symbolic Em symbolic Em .Ef back to normal .Bf -symbolic badarg symbolic badarg .Ef back to normal .Bf Sy -emphasis Sy -emphasis .Ef back to normal .Bf Sy Em Sy Em .Ef back to normal .Bf Sy badarg Sy Em .Ef back to normal mandoc-1.14.6/regress/mdoc/Bf/multiargs.out_ascii010064400017530001753000000011221313667012600222050ustar00schwarzeschwarzeBF-MULTIARGS(1) General Commands Manual BF-MULTIARGS(1) NNAAMMEE BBff--mmuullttiiaarrggss - font blocks with multiple arguments DDEESSCCRRIIPPTTIIOONN normal text ssyymmbboolliicc eemmpphhaassiiss back to normal ssyymmbboolliicc EEmm back to normal ssyymmbboolliicc bbaaddaarrgg back to normal SSyy --eemmpphhaassiiss back to normal SSyy EEmm back to normal SSyy EEmm back to normal OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bf/multiargs.out_lint010064400017530001753000000005641313667012600220740ustar00schwarzeschwarzemandoc: multiargs.in:14:15: ERROR: skipping excess arguments: Bf ... Em mandoc: multiargs.in:18:15: ERROR: skipping excess arguments: Bf ... badarg mandoc: multiargs.in:22:8: ERROR: skipping excess arguments: Bf ... -emphasis mandoc: multiargs.in:26:8: ERROR: skipping excess arguments: Bf ... Em mandoc: multiargs.in:30:8: ERROR: skipping excess arguments: Bf ... badarg mandoc-1.14.6/regress/mdoc/Bf/nest.in010064400017530001753000000006611313667012600176050ustar00schwarzeschwarze.\" $OpenBSD: nest.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BF-NEST 1 .Os .Sh NAME .Nm Bf-nest .Nd nesting font blocks .Sh DESCRIPTION normal text .Bf -emphasis emphasis .Bf -literal literal .Bf -symbolic symbolic .Bf Em Em .Bf Li Li .Bf Sy Sy .Em in-line \&Em \\fRroman\\fP again \&Em .Ef back to Li .Ef back to Em .Ef back to symbolic .Ef back to literal .Ef back to emphasis .Ef back to normal mandoc-1.14.6/regress/mdoc/Bf/nest.out_ascii010064400017530001753000000011001313667012600211430ustar00schwarzeschwarzeBF-NEST(1) General Commands Manual BF-NEST(1) NNAAMMEE BBff--nneesstt - nesting font blocks DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_s literal ssyymmbboolliicc _E_m Li SSyy _i_n_-_l_i_n_e _E_m roman _a_g_a_i_n _E_m back to Li _b_a_c_k _t_o _E_m bbaacckk ttoo ssyymmbboolliicc back to literal _b_a_c_k _t_o _e_m_p_h_a_s_i_s back to normal OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bf/paragraph.in010064400017530001753000000004711341457745100206060ustar00schwarzeschwarze.\" $OpenBSD: paragraph.in,v 1.1 2019/01/07 06:51:37 schwarze Exp $ .Dd $Mdocdate: January 7 2019 $ .Dt BF-PARAGRAPH 1 .Os .Sh NAME .Nm Bf-paragraph .Nd interaction of paragraphs and font blocks .Sh DESCRIPTION BEGINTEST .Pp normal text .Bf -literal literal text .Pp literal paragraph .Ef ENDTEST .br end of file mandoc-1.14.6/regress/mdoc/Bf/paragraph.out_ascii010064400017530001753000000006051341457745100221560ustar00schwarzeschwarzeBF-PARAGRAPH(1) General Commands Manual BF-PARAGRAPH(1) NNAAMMEE BBff--ppaarraaggrraapphh - interaction of paragraphs and font blocks DDEESSCCRRIIPPTTIIOONN BEGINTEST normal text literal text literal paragraph ENDTEST end of file OpenBSD January 7, 2019 OpenBSD mandoc-1.14.6/regress/mdoc/Bf/paragraph.out_html010064400017530001753000000001511363444076700220310ustar00schwarzeschwarze

normal text

literal text

literal paragraph

mandoc-1.14.6/regress/mdoc/Bk004075500017530001753000000000001412314056600162275ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Bk/Makefile010064400017530001753000000004741306010565100177430ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2015/02/07 16:39:44 schwarze Exp $ REGRESS_TARGETS = badarg break broken inputlines lines synopsis LINT_TARGETS = badarg broken SKIP_TMAN ?= badarg # mandoc -T markdown output of .Bk is quite ugly, # so refrain from testing it for now SKIP_MARKDOWN ?= ALL .include mandoc-1.14.6/regress/mdoc/Bk/badarg.in010064400017530001753000000014631313667012600200620ustar00schwarzeschwarze.\" $OpenBSD: badarg.in,v 1.6 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BK-BADARG 1 .Os .Sh NAME .Nm Bk-badarg .Nd bad arguments after Bk .Sh SYNOPSIS .Nm .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x .Bk -badarg .Op o Ar a .Ek .Pp .Nm .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x .Bk -lines .Op o Ar a .Ek tail argument .Pp .Nm .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x .Bk -line .Op o Ar a .Ek .Pp .Nm .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x .Bk .Op o Ar a .Ek .Pp .Nm .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x .Bk -words -murks bogus .Op o Ar a .Ek .Sh DESCRIPTION Here is an empty keep: .Bk -words .Ek End of test document. mandoc-1.14.6/regress/mdoc/Bk/badarg.out_ascii010064400017530001753000000023121313667012600214250ustar00schwarzeschwarzeBK-BADARG(1) General Commands Manual BK-BADARG(1) NNAAMMEE BBkk--bbaaddaarrgg - bad arguments after Bk SSYYNNOOPPSSIISS BBkk--bbaaddaarrgg _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [o _a] BBkk--bbaaddaarrgg _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [o _a] BBkk--bbaaddaarrgg _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [o _a] BBkk--bbaaddaarrgg _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [o _a] BBkk--bbaaddaarrgg _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [o _a] DDEESSCCRRIIPPTTIIOONN Here is an empty keep: End of test document. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bk/badarg.out_lint010064400017530001753000000006321313667012600213060ustar00schwarzeschwarzemandoc: badarg.in:14:5: ERROR: skipping excess arguments: Bk ... -badarg mandoc: badarg.in:23:5: ERROR: skipping excess arguments: Bk ... -lines mandoc: badarg.in:25:2: ERROR: skipping all arguments: Ek tail argument mandoc: badarg.in:32:5: ERROR: skipping excess arguments: Bk ... -line mandoc: badarg.in:50:12: ERROR: skipping excess arguments: Bk ... -murks mandoc: badarg.in:55:2: WARNING: empty block: Bk mandoc-1.14.6/regress/mdoc/Bk/break.in010064400017530001753000000022271313667012600177250ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.7 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BK-BREAK 1 .Os .Sh NAME .Nm Bk-break .Nd handling of word keeps .Sh DESCRIPTION Even though it is called a word keep, .Bk -words it will not keep words together in free-form text. .Ek However, even the noop macro .Bk -words .No is sufficient to let the keep take effect . .Ek Even text generated in pre-handlers must be kept together with the text following it: .Bk -words .Xr one 1 No and Xr two 2 .Ek should be on the same line. .Pp Including the whole output line into the keep is not required, including just the macros to be kept together is sufficient: .Pp .Nm .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x .Bk -words .Op o Ar a .Ek .Pp .Bk -words .Nm .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x x x .Ar x x x x x x .Op o Ar a .Ek .Pp Even text printed without spacing must be kept together with the text following it: .Pp .Bk -words .Fn xxxxxxxxxxxxxxxxxxxx "xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx" xxxxxxxxxxxxxxxxxxxx .Pp .Fo xxxxxxxxxxxxxxxxxxxx .Fa "xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx" xxxxxxxxxxxxxxxxxxxx .Fc .Ek mandoc-1.14.6/regress/mdoc/Bk/break.out_ascii010064400017530001753000000031631313667012600212760ustar00schwarzeschwarzeBK-BREAK(1) General Commands Manual BK-BREAK(1) NNAAMMEE BBkk--bbrreeaakk - handling of word keeps DDEESSCCRRIIPPTTIIOONN Even though it is called a word keep, it will not keep words together in free-form text. However, even the noop macro is sufficient to let the keep take effect. Even text generated in pre- handlers must be kept together with the text following it: one(1) and two(2) should be on the same line. Including the whole output line into the keep is not required, including just the macros to be kept together is sufficient: BBkk--bbrreeaakk _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [o _a] BBkk--bbrreeaakk _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [o _a] Even text printed without spacing must be kept together with the text following it: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x, _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x, _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bk/broken.in010064400017530001753000000003571313667012600201230ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BK-BROKEN 1 .Os .Sh NAME .Nm Bk-broken .Nd word keep broken by another block .Sh DESCRIPTION before keep .Bk -words .Sh CAVEATS next section mandoc-1.14.6/regress/mdoc/Bk/broken.out_ascii010064400017530001753000000005171313667012600214720ustar00schwarzeschwarzeBK-BROKEN(1) General Commands Manual BK-BROKEN(1) NNAAMMEE BBkk--bbrrookkeenn - word keep broken by another block DDEESSCCRRIIPPTTIIOONN before keep CCAAVVEEAATTSS next section OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bk/broken.out_lint010064400017530001753000000001751313667012600213500ustar00schwarzeschwarzemandoc: broken.in:11:2: ERROR: inserting missing end of block: Sh breaks Bk mandoc: broken.in:10:2: WARNING: empty block: Bk mandoc-1.14.6/regress/mdoc/Bk/inputlines.in010064400017530001753000000025711313667012600210350ustar00schwarzeschwarze.\" $OpenBSD: inputlines.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BK-INPUTLINES 1 .Os .Sh NAME .Nm Bk-inputlines .Nd effect of input lines breaks on word keeps .Sh SYNOPSIS .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo Oo No a Oc Oo No b Oc Oc Pq one line .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo .Oo No a Oc Oo No b Oc Oc Pq "break after first Oo" .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo Oo .No a Oc Oo b Oc Oc Pq "break after second Oo" .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo Oo No a .Oc Oo No b Oc Oc Pq "break before first Oc" .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo Oo No a Oc .Oo No b Oc Oc Pq "break after first Oc" .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo Oo No a Oc Oo .No b Oc Oc Pq "break after third Oo" .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo a No b Oc .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo a .No b Oc .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo a Oc No b .Ek .Pp .Nm .Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x x .Bk -words .Oo a Oc .No b .Ek mandoc-1.14.6/regress/mdoc/Bk/inputlines.out_ascii010064400017530001753000000043061313667012600224040ustar00schwarzeschwarzeBK-INPUTLINES(1) General Commands Manual BK-INPUTLINES(1) NNAAMMEE BBkk--iinnppuuttlliinneess - effect of input lines breaks on word keeps SSYYNNOOPPSSIISS BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [[a] [b]] (one line) BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [[a] [b]] (break after first Oo) BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [[a] [b]] (break after second Oo) BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [[a] [b]] (break before first Oc) BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [[a] [b]] (break after first Oc) BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [[a] [b]] (break after third Oo) BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [a b] BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [a b] BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [a] b BBkk--iinnppuuttlliinneess _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [a] b OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bk/lines.in010064400017530001753000000006741313667012600177570ustar00schwarzeschwarze.\" $OpenBSD: lines.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BK-LINES 1 .Os .Sh NAME .Nm Bk-lines .Nd handling of line keeps .Sh DESCRIPTION .Bd -literal 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 40 .Ed .Ss with keep .Bk -lines .Bd -literal 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 40 .Ed .Ek mandoc-1.14.6/regress/mdoc/Bk/lines.out_ascii010064400017530001753000000015431313667012600213240ustar00schwarzeschwarzeBK-LINES(1) General Commands Manual BK-LINES(1) NNAAMMEE BBkk--lliinneess - handling of line keeps DDEESSCCRRIIPPTTIIOONN 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 40 wwiitthh kkeeeepp 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 40 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bk/synopsis.in010064400017530001753000000016261313667012600205320ustar00schwarzeschwarze.\" $OpenBSD: synopsis.in,v 1.7 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BK-SYNOPSIS 1 .Os .Sh NAME .Nm Bk-synopsis .Nd automatic keeps in the synopsis .Sh SYNOPSIS In the synopsis, almost all macros do not show .No the word keep effect they would get in a \&Bk block. .Pp .Fn xxxxxxxxxxxxxxxxxxxx "xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx" xxxxxxxxxxxxxxxxxxxx .Fo xxxxxxxxxxxxxxxxxxxx .Fa "xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx" xxxxxxxxxxxxxxxxxxxx .Fc .Pp Only \&Nm, used as a block macro, does: .Pp .Nm ksh .Op Fl +abCefhiklmnpruvXx .Op Fl +o Ar option .Op Fl c Ar string \*(Ba Fl s \*(Ba Ar file Op Ar argument ... .Bk -words .Ek .Nm ksh .Op Fl +abCefhiklmnpruvXx .Op Fl +o Ar option .Op Fl c Ar string \*(Ba Fl s \*(Ba Ar file Op Ar argument ... .Sh DESCRIPTION .Nm ksh .Op Fl +abCefhiklmnpruvXx .Op Fl +o Ar option .Op Fl c Ar string \*(Ba Fl s \*(Ba Ar file Op Ar argument ... mandoc-1.14.6/regress/mdoc/Bk/synopsis.out_ascii010064400017530001753000000030701313667012600220760ustar00schwarzeschwarzeBK-SYNOPSIS(1) General Commands Manual BK-SYNOPSIS(1) NNAAMMEE BBkk--ssyynnooppssiiss - automatic keeps in the synopsis SSYYNNOOPPSSIISS In the synopsis, almost all macros do not show the word keep effect they would get in a Bk block. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x, _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x); xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x, _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x); Only Nm, used as a block macro, does: kksshh [--++aabbCCeeffhhiikkllmmnnpprruuvvXXxx] [--++oo _o_p_t_i_o_n] [--cc _s_t_r_i_n_g | --ss | _f_i_l_e [_a_r_g_u_m_e_n_t _._._.]] kksshh [--++aabbCCeeffhhiikkllmmnnpprruuvvXXxx] [--++oo _o_p_t_i_o_n] [--cc _s_t_r_i_n_g | --ss | _f_i_l_e [_a_r_g_u_m_e_n_t _._._.]] DDEESSCCRRIIPPTTIIOONN kksshh [--++aabbCCeeffhhiikkllmmnnpprruuvvXXxx] [--++oo _o_p_t_i_o_n] [--cc _s_t_r_i_n_g | --ss | _f_i_l_e [_a_r_g_u_m_e_n_t _._._.]] OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl004075500017530001753000000000001412314056600162305ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Bl/Makefile010064400017530001753000000033711363444076700177640ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.41 2020/02/27 01:25:58 schwarze Exp $ REGRESS_TARGETS = item inset diag ohang bullet dash enum hang tag REGRESS_TARGETS += column column_nogroff colNoIt REGRESS_TARGETS += esc extend nested offset secstart vert REGRESS_TARGETS += notype multitype badargs REGRESS_TARGETS += empty noIt emptyhead emptytag emptyitem multitag REGRESS_TARGETS += bareIt bareTa unclosed break breakingIt breakingTa broken UTF8_TARGETS = dash LINT_TARGETS = inset diag column column_nogroff notype badargs tag LINT_TARGETS += empty noIt emptyhead emptytag emptyitem LINT_TARGETS += bareIt bareTa break breakingIt broken # groff-mandoc differences: # - groff allows enclosures to span Ta, mandoc does not SKIP_GROFF ?= breakingTa # groff-1.22.3 defects: # - column list items with no args but multiple lines cause bogus breaks # - in column lists, the tab macro cannot be a line macro # - lists with missing or late type ruin indentation # - empty lists ruin indentation and sometimes cause empty lines # - breaking lists continue indefinitely # - breaking items sometimes ruin indentation, sometimes abort processing # - breaking a list aborts processing # - empty -tag item heads lose the blank line and the indentation SKIP_GROFF += column_nogroff notype empty emptytag break breakingIt broken SKIP_TMAN ?= column colNoIt multitype multitag bareTa break breakingTa broken # Fixing the indentation in long .IP and .TP tags in -man -Tascii # caused a minor regression in -Tman that is not trivial to fix, # so disable the related test for now. SKIP_TMAN += tag # Empty heads are still mishandled by -Tman. SKIP_TMAN += column_nogroff emptyhead emptytag # mandoc -T markdown still has issues with badly nested lists SKIP_MARKDOWN ?= break .include mandoc-1.14.6/regress/mdoc/Bl/badargs.in010064400017530001753000000021061313667012600202410ustar00schwarzeschwarze.\" $OpenBSD: badargs.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-BADARGS 1 .Os .Sh NAME .Nm Bl-badargs .Nd list with bad arguments .Sh DESCRIPTION trailing -offset: .Bl -bullet -offset .It is ignored .El trailing -width: .Bl -bullet -width .It bullet .El .Bl -dash -width .It dash .El .\" XXX Doesn't work with -Tman yet. .\" .Bl -enum -width .\" .It .\" enum .\" .El .Bl -hyphen -width .It hyphen .El .Bl -hang -width .It hang item .El .Bl -tag -width .It tag Here we need a very long line. It must be sufficiently long such that it wraps the line. .El double type: .Bl -bullet -compact -enum .It bullet enum .El .Bl -enum -compact -bullet .It enum bullet .El unknown arguments: .Bl -bullet -bogus args .It bullet text .El .Bl -enum -bogus args .It enum text .El .Bl -inset -bogus args .It inset text .El .Bl -item -bogus args .It item text .El .Bl -ohang -bogus args .It ohang text .El .Bl -tag -width Ds -bogus args .It tag text .El double arguments: .Bl -tag -compact -offset 20n -width 20n -compact -offset 2n -width 6n .It last wins .El tail argument mandoc-1.14.6/regress/mdoc/Bl/badargs.out_ascii010064400017530001753000000014161313667012600216150ustar00schwarzeschwarzeBL-BADARGS(1) General Commands Manual BL-BADARGS(1) NNAAMMEE BBll--bbaaddaarrggss - list with bad arguments DDEESSCCRRIIPPTTIIOONN trailing -offset: ++oo is ignored trailing -width: ++oo bullet -- dash -- hyphen hang item tag Here we need a very long line. It must be sufficiently long such that it wraps the line. double type: ++oo bullet enum 1. enum bullet unknown arguments: ++oo bullet text 1. enum text inset text item text ohang text tag text double arguments: last wins OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/badargs.out_lint010064400017530001753000000024201313667012600214670ustar00schwarzeschwarzemandoc: badargs.in:79:2: ERROR: skipping all arguments: El tail argument mandoc: badargs.in:10:13: WARNING: empty argument, using 0n: Bl -offset mandoc: badargs.in:15:13: WARNING: empty argument, using 0n: Bl -width mandoc: badargs.in:19:11: WARNING: empty argument, using 0n: Bl -width mandoc: badargs.in:28:13: WARNING: empty argument, using 0n: Bl -width mandoc: badargs.in:32:11: WARNING: empty argument, using 0n: Bl -width mandoc: badargs.in:36:10: WARNING: empty argument, using 0n: Bl -width mandoc: badargs.in:42:2: WARNING: skipping duplicate list type: Bl -enum mandoc: badargs.in:46:2: WARNING: skipping duplicate list type: Bl -bullet mandoc: badargs.in:51:13: ERROR: skipping excess arguments: Bl ... -bogus mandoc: badargs.in:55:11: ERROR: skipping excess arguments: Bl ... -bogus mandoc: badargs.in:59:12: ERROR: skipping excess arguments: Bl ... -bogus mandoc: badargs.in:63:11: ERROR: skipping excess arguments: Bl ... -bogus mandoc: badargs.in:67:12: ERROR: skipping excess arguments: Bl ... -bogus mandoc: badargs.in:71:20: ERROR: skipping excess arguments: Bl ... -bogus mandoc: badargs.in:76:42: WARNING: duplicate argument: Bl -compact mandoc: badargs.in:76:51: WARNING: duplicate argument: Bl -offset 2n mandoc: badargs.in:76:62: WARNING: duplicate argument: Bl -width 6n mandoc-1.14.6/regress/mdoc/Bl/badargs.out_markdown010064400017530001753000000007621313667012600223520ustar00schwarzeschwarzeBL-BADARGS(1) - General Commands Manual # NAME **Bl-badargs** - list with bad arguments # DESCRIPTION trailing -offset: * is ignored trailing -width: * bullet - dash - hyphen hang > item tag > Here we need a very long line. > It must be sufficiently long such that it wraps the line. double type: * bullet enum 1. enum bullet unknown arguments: * bullet text 1. enum text inset text item text ohang text tag > text double arguments: last > wins OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/bareIt.in010064400017530001753000000003761313667012600200530ustar00schwarzeschwarze.\" $OpenBSD: bareIt.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-BAREIT 1 .Os .Sh NAME .Nm Bl-bareIt .Nd item macro outside list .Sh DESCRIPTION initial text .It argument .Bl -dash .It item .El .It argument final text mandoc-1.14.6/regress/mdoc/Bl/bareIt.out_ascii010064400017530001753000000004761313667012600214250ustar00schwarzeschwarzeBL-BAREIT(1) General Commands Manual BL-BAREIT(1) NNAAMMEE BBll--bbaarreeIItt - item macro outside list DDEESSCCRRIIPPTTIIOONN initial text -- item final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/bareIt.out_lint010064400017530001753000000003261313667012600212750ustar00schwarzeschwarzemandoc: bareIt.in:10:2: ERROR: skipping item outside list: It argument mandoc: bareIt.in:15:2: ERROR: skipping item outside list: It argument mandoc: bareIt.in:10:2: WARNING: skipping paragraph macro: br before Bl mandoc-1.14.6/regress/mdoc/Bl/bareIt.out_markdown010064400017530001753000000002411313667012600221450ustar00schwarzeschwarzeBL-BAREIT(1) - General Commands Manual # NAME **Bl-bareIt** - item macro outside list # DESCRIPTION initial text - item final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/bareTa.in010064400017530001753000000007071313667012600200410ustar00schwarzeschwarze.\" $OpenBSD: bareTa.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TA-BARE 1 .Os .Sh NAME .Nm Ta-bare .Nd bare tabular column macro .Sh DESCRIPTION initial text .Ta ignored arguments middle text .Bl -item -offset indent .It .Ta ignored arguments indented text .El middle text .Bl -dash .It Ta ignored arguments indented text .El middle text .Bl -column "a" "b" -offset indent .It a Ta b .El .It ignored arguments final text mandoc-1.14.6/regress/mdoc/Bl/bareTa.out_ascii010064400017530001753000000006361313667012600214130ustar00schwarzeschwarzeTA-BARE(1) General Commands Manual TA-BARE(1) NNAAMMEE TTaa--bbaarree - bare tabular column macro DDEESSCCRRIIPPTTIIOONN initial text middle text indented text middle text -- indented text middle text a b final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/bareTa.out_lint010064400017530001753000000005611313667012600212660ustar00schwarzeschwarzemandoc: bareTa.in:10:2: ERROR: skipping column outside column list: Ta mandoc: bareTa.in:14:2: ERROR: skipping column outside column list: Ta mandoc: bareTa.in:19:5: ERROR: skipping column outside column list: Ta mandoc: bareTa.in:26:2: ERROR: skipping item outside list: It ignored arguments mandoc: bareTa.in:19:2: ERROR: skipping all arguments: It ignored arguments mandoc-1.14.6/regress/mdoc/Bl/bareTa.out_markdown010064400017530001753000000003461313667012600221430ustar00schwarzeschwarzeTA-BARE(1) - General Commands Manual # NAME **Ta-bare** - bare tabular column macro # DESCRIPTION initial text middle text indented text middle text - indented text middle text a b final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/break.in010064400017530001753000000021051313667012600177210ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.7 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-BREAK 1 .Os .Sh NAME .Nm Bl-break .Nd list breaking another block .Sh DESCRIPTION before both .Bl -enum -offset indent .It before bracket .Bo inside both .El after list .Bc in between .Bl -enum -offset indent .It before bracket .Bo inside both .El .It stray item .Bc after both .Sh EXAMPLES .Bl -enum -offset indent .It before display .Bd -ragged -offset indent inside both .El after display .Ed in between .Bl -enum -offset indent .It before display .Bd -ragged -offset indent inside both .El .It stray item .Ed after both .Bl -enum -offset indent .It before table .Bl -column column .It column .Bd -ragged -offset indent inside display .El first line after table second line after table .El after list .Sh DIAGNOSTICS .Bl -column column .It column .Bd -ragged -offset indent inside display .El .Ta stray tab after stray tab .Ed after display .Sh CAVEATS .Bl -hang .It before broken block Bo inside both .El after list .Sh BUGS .Bl -enum .It before broken block Bo inside both .El after list mandoc-1.14.6/regress/mdoc/Bl/break.out_ascii010064400017530001753000000020471313667012600212770ustar00schwarzeschwarzeBL-BREAK(1) General Commands Manual BL-BREAK(1) NNAAMMEE BBll--bbrreeaakk - list breaking another block DDEESSCCRRIIPPTTIIOONN before both 1. before bracket [inside both after list] in between 1. before bracket [inside both stray item] after both EEXXAAMMPPLLEESS 1. before display inside both after display in between 1. before display inside both stray item after both 1. before table column inside display first line after table second line after table after list DDIIAAGGNNOOSSTTIICCSS column inside display after stray tab after display CCAAVVEEAATTSS before broken block [inside both after list] BBUUGGSS 1. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/break.out_lint010064400017530001753000000022671313667012600211610ustar00schwarzeschwarzemandoc: break.in:14:2: WARNING: blocks badly nested: Bl breaks Bo mandoc: break.in:22:2: WARNING: blocks badly nested: Bl breaks Bo mandoc: break.in:23:2: ERROR: skipping item outside list: It mandoc: break.in:33:2: WARNING: blocks badly nested: Bl breaks Bd mandoc: break.in:42:2: WARNING: blocks badly nested: Bl breaks Bd mandoc: break.in:43:2: ERROR: skipping item outside list: It mandoc: break.in:54:2: WARNING: blocks badly nested: Bl breaks Bd mandoc: break.in:57:2: WARNING: blocks badly nested: Bl breaks Bd mandoc: break.in:59:2: ERROR: inserting missing end of block: Sh breaks Bd mandoc: break.in:64:2: WARNING: blocks badly nested: Bl breaks Bd mandoc: break.in:65:2: ERROR: skipping column outside column list: Ta mandoc: break.in:72:2: WARNING: blocks badly nested: Bl breaks Bo mandoc: break.in:74:2: ERROR: inserting missing end of block: Sh breaks Bo mandoc: break.in:77:2: WARNING: blocks badly nested: Bl breaks Bo mandoc: break.in:76:25: ERROR: appending missing end of block: Bo mandoc: break.in:75:2: ERROR: appending missing end of block: Bl mandoc: break.in:76:2: WARNING: empty list item: Bl -enum It mandoc: break.in:76:2: ERROR: skipping all arguments: It before broken block mandoc-1.14.6/regress/mdoc/Bl/breakingIt.in010064400017530001753000000017061313667012600207220ustar00schwarzeschwarze.\" $OpenBSD: breakingIt.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-BREAKINGIT 1 .Os .Sh NAME .Nm Bl-breakingIt .Nd items breaking other blocks .Sh DESCRIPTION .Ss Breaking partial explicit macros .Bl -tag -width Ds Stray text. .Ao More stray text .It tag Tagged text. .El .Bl -bullet Stray text. .Ao More stray text .It Bullet point. .El .Bl -tag -width Ds .It tag Tagged text. .Ao More tagged text .It tag2 Yet more tagged text. .El .Bl -bullet .It Item text. .Ao More item text .It Bullet point. .El .Ss Breaking full explicit macros .Bl -tag -width Ds Stray text. .Bd -ragged -offset indent More stray text. .It tag Tagged text. .El .Bl -bullet Stray text. .Bd -ragged -offset indent More stray text. .It Bullet point. .El .Bl -tag -width Ds .It tag Tagged text. .Bd -ragged -offset indent Display text. .It tag2 More tagged text. .El .Bl -bullet .It Item text. .Bd -ragged -offset indent Display text. .It Bullet point. .El mandoc-1.14.6/regress/mdoc/Bl/breakingIt.out_ascii010064400017530001753000000020671313667012600222740ustar00schwarzeschwarzeBL-BREAKINGIT(1) General Commands Manual BL-BREAKINGIT(1) NNAAMMEE BBll--bbrreeaakkiinnggIItt - items breaking other blocks DDEESSCCRRIIPPTTIIOONN BBrreeaakkiinngg ppaarrttiiaall eexxpplliicciitt mmaaccrrooss Stray text. tag Tagged text. Stray text. ++oo Bullet point. tag Tagged text. tag2 Yet more tagged text. ++oo Item text. ++oo Bullet point. BBrreeaakkiinngg ffuullll eexxpplliicciitt mmaaccrrooss Stray text. More stray text. tag Tagged text. Stray text. More stray text. ++oo Bullet point. tag Tagged text. Display text. tag2 More tagged text. ++oo Item text. Display text. ++oo Bullet point. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/breakingTa.in010064400017530001753000000005231313667012600207060ustar00schwarzeschwarze.\" $OpenBSD: breakingTa.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-BREAKINGTA 1 .Os .Sh NAME .Nm Bl-breakingTa .Nd tab macro breaking a block .Sh DESCRIPTION .\" Crashed before mdoc_macro.c OpenBSD rev. 1.172 initial text .Bl -column 123456 123456 .It it Aq aq Ta ta Bo bo bc .Bc Pq pq .El final text mandoc-1.14.6/regress/mdoc/Bl/breakingIt.out_lint010064400017530001753000000022501313667012600221440ustar00schwarzeschwarzemandoc: breakingIt.in:14:2: ERROR: inserting missing end of block: It breaks Ao mandoc: breakingIt.in:21:2: ERROR: inserting missing end of block: It breaks Ao mandoc: breakingIt.in:29:2: ERROR: inserting missing end of block: It breaks Ao mandoc: breakingIt.in:37:2: ERROR: inserting missing end of block: It breaks Ao mandoc: breakingIt.in:45:2: ERROR: inserting missing end of block: It breaks Bd mandoc: breakingIt.in:52:2: ERROR: inserting missing end of block: It breaks Bd mandoc: breakingIt.in:60:2: ERROR: inserting missing end of block: It breaks Bd mandoc: breakingIt.in:68:2: ERROR: inserting missing end of block: It breaks Bd mandoc: breakingIt.in:11:1: WARNING: moving content out of list: text mandoc: breakingIt.in:12:2: WARNING: moving content out of list: Ao mandoc: breakingIt.in:18:1: WARNING: moving content out of list: text mandoc: breakingIt.in:19:2: WARNING: moving content out of list: Ao mandoc: breakingIt.in:42:1: WARNING: moving content out of list: text mandoc: breakingIt.in:43:2: WARNING: moving content out of list: Bd mandoc: breakingIt.in:49:1: WARNING: moving content out of list: text mandoc: breakingIt.in:50:2: WARNING: moving content out of list: Bd mandoc-1.14.6/regress/mdoc/Bl/breakingIt.out_markdown010064400017530001753000000012441313667012600230220ustar00schwarzeschwarzeBL-BREAKINGIT(1) - General Commands Manual # NAME **Bl-breakingIt** - items breaking other blocks # DESCRIPTION ## Breaking partial explicit macros Stray text. <More stray text> tag > Tagged text. Stray text. <More stray text> * Bullet point. tag > Tagged text. > <More tagged text> tag2 > Yet more tagged text. * Item text. <More item text> * Bullet point. ## Breaking full explicit macros Stray text. > More stray text. tag > Tagged text. Stray text. > More stray text. * Bullet point. tag > Tagged text. > > Display text. tag2 > More tagged text. * Item text. > Display text. * Bullet point. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/breakingTa.out_ascii010064400017530001753000000005341313667012600222610ustar00schwarzeschwarzeBL-BREAKINGTA(1) General Commands Manual BL-BREAKINGTA(1) NNAAMMEE BBll--bbrreeaakkiinnggTTaa - tab macro breaking a block DDEESSCCRRIIPPTTIIOONN initial text it ta [bo bc] (pq) final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/breakingTa.out_markdown010064400017530001753000000003001313667012600230020ustar00schwarzeschwarzeBL-BREAKINGTA(1) - General Commands Manual # NAME **Bl-breakingTa** - tab macro breaking a block # DESCRIPTION initial text it ta [bo bc] (pq) final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/broken.in010064400017530001753000000006621313667012600201230ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-BROKEN 1 .Os .Sh NAME .Nm Bl-broken .Nd list broken by another block .Sh DESCRIPTION before both .Bo before list .Bl -enum -offset indent .It inside both .Bc after bracket .El after list .Bo before list .Bl -enum -offset indent .It inside list .Bd -ragged -offset indent inside display .Bc after bracket .It next item .El after list mandoc-1.14.6/regress/mdoc/Bl/broken.out_ascii010064400017530001753000000007641313667012600214770ustar00schwarzeschwarzeBL-BROKEN(1) General Commands Manual BL-BROKEN(1) NNAAMMEE BBll--bbrrookkeenn - list broken by another block DDEESSCCRRIIPPTTIIOONN before both [before list 1. inside both] after bracket after list [before list 1. inside list inside display] after bracket 2. next item after list OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/broken.out_lint010064400017530001753000000003221313667012600213430ustar00schwarzeschwarzemandoc: broken.in:14:2: WARNING: blocks badly nested: Bo breaks Bl mandoc: broken.in:24:2: WARNING: blocks badly nested: Bo breaks Bd mandoc: broken.in:26:2: ERROR: inserting missing end of block: It breaks Bd mandoc-1.14.6/regress/mdoc/Bl/broken.out_markdown010064400017530001753000000004501313667012600222210ustar00schwarzeschwarzeBL-BROKEN(1) - General Commands Manual # NAME **Bl-broken** - list broken by another block # DESCRIPTION before both \[before list 1. inside both] after bracket after list \[before list 1. inside list > inside display] > after bracket 2. next item after list OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/bullet.in010064400017530001753000000047371313667012600201410ustar00schwarzeschwarze.\" $OpenBSD: bullet.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-BULLET 1 .Os .Sh NAME .Nm Bl-bullet .Nd bullet lists .Sh DESCRIPTION .Bl -bullet -width -4n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width -3n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width -2n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width -1n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width 0n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width 1n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width 2n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width 3n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width 4n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width 5n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width 6n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -width 7n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -bullet -compact .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El mandoc-1.14.6/regress/mdoc/Bl/bullet.out_ascii010064400017530001753000000053111313667012600214770ustar00schwarzeschwarzeBL-BULLET(1) General Commands Manual BL-BULLET(1) NNAAMMEE BBll--bbuulllleett - bullet lists DDEESSCCRRIIPPTTIIOONN ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ++oo x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/bullet.out_markdown010064400017530001753000000040611313667012600222320ustar00schwarzeschwarzeBL-BULLET(1) - General Commands Manual # NAME **Bl-bullet** - bullet lists # DESCRIPTION * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x * x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/colNoIt.in010064400017530001753000000004171313667012600202100ustar00schwarzeschwarze.\" $OpenBSD: colNoIt.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-COLNOIT 1 .Os .Sh NAME .Nm Bl-colNoIt .Nd column lists without item macros .Sh DESCRIPTION .Bl -column "a" "b" .Sy a Ta b .Em c Ta d .El .Bl -column "a" "b" a b c d .El mandoc-1.14.6/regress/mdoc/Bl/colNoIt.out_ascii010064400017530001753000000005141313667012600215570ustar00schwarzeschwarzeBL-COLNOIT(1) General Commands Manual BL-COLNOIT(1) NNAAMMEE BBll--ccoollNNooIItt - column lists without item macros DDEESSCCRRIIPPTTIIOONN aa b _c d a b c d OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/colNoIt.out_markdown010064400017530001753000000002611313667012600223100ustar00schwarzeschwarzeBL-COLNOIT(1) - General Commands Manual # NAME **Bl-colNoIt** - column lists without item macros # DESCRIPTION **a** b *c* d a b c d OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/column.in010064400017530001753000000050211363444076700201430ustar00schwarzeschwarze.\" $OpenBSD: column.in,v 1.11 2019/07/11 16:56:52 schwarze Exp $ .Dd $Mdocdate: July 11 2019 $ .Dt BL-COLUMN 1 .Os .Sh NAME .Nm Bl-column .Nd lists with multiple columns .Sh DESCRIPTION .Bl -column "a" .It a .El .Bl -column "a" "b" .It a Ta b .El .\" avoid "c" which means "cm" .Bl -column "a" "b" "cc" .It a Ta b Ta cc .It a b cc .It "a" b cc .It "a b" cc .It "a b cc" .El .Bl -column "a" "b" "cc" "d" .It a Ta b Ta cc Ta d .El .Bl -column "a" "b" "cc" "d" "e" .It a Ta b Ta cc Ta d Ta e .El .\" Probing up to the utter limits of groff. .\" With more than 5 columns or more than 78 characters per line, .\" groff .Bl -column turns completely mad. .\" mandoc can do more, but it's no use testing that. .Bd -literal 5 + 35 + 4 + 34 = 78: .Ed .Bl -column "x35xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "x34xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" .It x35xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Ta x34xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx .It a Ta b .El .Bd -literal 5 + (22+4)*2 + 21 = 78: .Ed .Bl -column "x22xxxxxxxxxxxxxxxxxxx" "x22xxxxxxxxxxxxxxxxxxx" "x21xxxxxxxxxxxxxxxxxx" .It x22xxxxxxxxxxxxxxxxxxx Ta x22xxxxxxxxxxxxxxxxxxx Ta x21xxxxxxxxxxxxxxxxxx .It a Ta b Ta c .El .Bd -literal 5 + 16 + (4+15)*3 = 78: .Ed .Bl -column "x16xxxxxxxxxxxxx" "x15xxxxxxxxxxxx" "x15xxxxxxxxxxxx" "x15xxxxxxxxxxxx" .It x16xxxxxxxxxxxxx Ta x15xxxxxxxxxxxx Ta x15xxxxxxxxxxxx Ta x15xxxxxxxxxxxx .It a Ta b Ta c Ta d .El .Bd -literal 5 + 13 + (3+12)*4 = 78: .Ed .Bl -column "x13xxxxxxxxxx" "x12xxxxxxxxx" "x12xxxxxxxxx" "x12xxxxxxxxx" "x12xxxxxxxxx" .It x13xxxxxxxxxx Ta x12xxxxxxxxx Ta x12xxxxxxxxx Ta x12xxxxxxxxx Ta x12xxxxxxxxx .It a Ta b Ta c Ta d Ta e .El .\" Trailing white space in phrases. .Bl -column "aaaa" "bbbb" .It "a" Ta "b" .It "a " Ta "b" .It "a " Ta "b" .It a b .It a b .It a b .El .\" Wrong number of columns. .Bl -column "a" "b" .It .It "a" .It "a" Ta "b" .It .It "a" Ta "b" Ta "c" .It "a" Ta "b" Ta "c" Ta "d" .It "a" Ta "b" Ta "c" Ta "d" Ta "e" .It .El .\" Mixed tab and Ta .Bl -column a b c d .It a b c d .It "a b c" Ta d .It a b Ta c d .It a b Ta c Ta d .It a Ta b c d .It a Ta b c Ta d .It a Ta b Ta c d .It a Ta b Ta c Ta d .El .\" Macros before and after tabs .Bl -column "aa" "OpenBSD OpenBSD OpenBSD" .It aa Ta Ox Ox Ox Ta tab-tab .It aa Ta Ox Ox Ox tab-ta .It aa Ox Ox Ox Ta ta-tab .It aa Ox Ox Ox ta-ta .It aa Ox Ox Ox ta-bl/ta .It aa Ox Ox Ox ta/bl-ta .It aa Ox Ox Ox ta/bl-bl/ta .It aa Ta bb Ta ta at eol .It aa bb tab at eol .El .\" Interrupted column list .Bl -column "aa" -width 6n -compact "bb" "cc" .It aa Ta bb Ta cc Ta dd .El mandoc-1.14.6/regress/mdoc/Bl/column.out_ascii010064400017530001753000000035521363444076700215230ustar00schwarzeschwarzeBL-COLUMN(1) General Commands Manual BL-COLUMN(1) NNAAMMEE BBll--ccoolluummnn - lists with multiple columns DDEESSCCRRIIPPTTIIOONN a a b a b cc a b cc a b cc a b cc a b cc a b cc d a b cc d e 5 + 35 + 4 + 34 = 78: x35xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x34xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx a b 5 + (22+4)*2 + 21 = 78: x22xxxxxxxxxxxxxxxxxxx x22xxxxxxxxxxxxxxxxxxx x21xxxxxxxxxxxxxxxxxx a b c 5 + 16 + (4+15)*3 = 78: x16xxxxxxxxxxxxx x15xxxxxxxxxxxx x15xxxxxxxxxxxx x15xxxxxxxxxxxx a b c d 5 + 13 + (3+12)*4 = 78: x13xxxxxxxxxx x12xxxxxxxxx x12xxxxxxxxx x12xxxxxxxxx x12xxxxxxxxx a b c d e a b a b a b a b a b a b a a b a b c a b cd a b cde a b c d a b c d a b c d a b c d a b c d a b c d a b c d a b c d aa OpenBSD OpenBSD OpenBSD tab-tab aa OpenBSD OpenBSD Ox tab-ta aa Ox OpenBSD OpenBSD ta-tab aa Ox OpenBSD Ox ta-ta aa Ox OpenBSD OpenBSD ta-bl/ta aa OpenBSD OpenBSD Ox ta/bl-ta aa OpenBSD OpenBSD OpenBSD ta/bl-bl/ta aa bb ta at eol aa bb tab at eol aa bb cc dd OpenBSD July 11, 2019 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/column.out_lint010064400017530001753000000007271363444076700214020ustar00schwarzeschwarzemandoc: column.in:72:2: WARNING: skipping empty macro: It mandoc: column.in:73:2: WARNING: wrong number of cells: 2 columns, 1 cells mandoc: column.in:75:2: WARNING: skipping empty macro: It mandoc: column.in:77:2: WARNING: wrong number of cells: 2 columns, 4 cells mandoc: column.in:78:2: WARNING: wrong number of cells: 2 columns, 5 cells mandoc: column.in:79:2: WARNING: skipping empty macro: It mandoc: column.in:108:18: WARNING: skipping -width argument: Bl -column mandoc-1.14.6/regress/mdoc/Bl/column.out_markdown010064400017530001753000000031351363444076700222520ustar00schwarzeschwarzeBL-COLUMN(1) - General Commands Manual # NAME **Bl-column** - lists with multiple columns # DESCRIPTION a a b a b cc a b cc a b cc a b cc a b cc a b cc d a b cc d e 5 + 35 + 4 + 34 = 78: x35xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x34xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx a b 5 + (22+4)*2 + 21 = 78: x22xxxxxxxxxxxxxxxxxxx x22xxxxxxxxxxxxxxxxxxx x21xxxxxxxxxxxxxxxxxx a b c 5 + 16 + (4+15)*3 = 78: x16xxxxxxxxxxxxx x15xxxxxxxxxxxx x15xxxxxxxxxxxx x15xxxxxxxxxxxx a b c d 5 + 13 + (3+12)*4 = 78: x13xxxxxxxxxx x12xxxxxxxxx x12xxxxxxxxx x12xxxxxxxxx x12xxxxxxxxx a b c d e a b a b a b a b a b a b a a b a b c a b c d a b c d e a b c d a b c d a b c d a b c d a b c d a b c d a b c d a b c d aa OpenBSD OpenBSD OpenBSD tab-tab aa OpenBSD OpenBSD Ox tab-ta aa Ox OpenBSD OpenBSD ta-tab aa Ox OpenBSD Ox ta-ta aa Ox OpenBSD OpenBSD ta-bl/ta aa OpenBSD OpenBSD Ox ta/bl-ta aa OpenBSD OpenBSD OpenBSD ta/bl-bl/ta aa bb ta at eol aa bb tab at eol aa bb cc dd OpenBSD - July 11, 2019 mandoc-1.14.6/regress/mdoc/Bl/dash.in010064400017530001753000000047161313667012600175660ustar00schwarzeschwarze.\" $OpenBSD: dash.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-DASH 1 .Os .Sh NAME .Nm Bl-dash .Nd dash and hyphen lists .Sh DESCRIPTION .Bl -dash -width -4n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -width -3n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -width -2n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -width -1n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -width 0n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hyphen -width 1n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -width 2n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -width 3n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hyphen -width 4n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hyphen -width 5n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -width 6n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -width 7n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -dash -compact .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El mandoc-1.14.6/regress/mdoc/Bl/diag.in010064400017530001753000000024731313667012600175510ustar00schwarzeschwarze.\" $OpenBSD: diag.in,v 1.7 2017/07/16 17:53:29 schwarze Exp $ .Dd $Mdocdate: July 16 2017 $ .Dt BL-DIAG 1 .Os .Sh NAME .Nm Bl-diag .Nd section 4 diagnostic lists .Sh DESCRIPTION .Bl -diag .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -diag .It four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -diag .It quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -diag .It indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -diag .It septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -diag .It achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -diag .It neun_neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -diag .It zehn__zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -diag -width 10n .It This is a very long text contained in the diag item head, it is \ so long that it overruns the line - and here comes the item body, which is also long enough to break the line again. .El .Pp Check that It is not parsed in Bl: .Bl -diag -compact .It Nx .No Nx .It Ox .No Ox .It Fx .No Fx .El mandoc-1.14.6/regress/mdoc/Bl/dash.out_ascii010064400017530001753000000051541313667012600211340ustar00schwarzeschwarzeBL-DASH(1) General Commands Manual BL-DASH(1) NNAAMMEE BBll--ddaasshh - dash and hyphen lists DDEESSCCRRIIPPTTIIOONN -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/dash.out_markdown010064400017530001753000000040661313667012600216670ustar00schwarzeschwarzeBL-DASH(1) - General Commands Manual # NAME **Bl-dash** - dash and hyphen lists # DESCRIPTION - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x - x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/dash.out_utf8010064400017530001753000000051561313667012600207340ustar00schwarzeschwarzeBL-DASH(1) General Commands Manual BL-DASH(1) NNAAMMEE BBll--ddaasshh – dash and hyphen lists DDEESSCCRRIIPPTTIIOONN -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -- x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/diag.out_ascii010064400017530001753000000031241313667012600211140ustar00schwarzeschwarzeBL-DIAG(1) General Commands Manual BL-DIAG(1) NNAAMMEE BBll--ddiiaagg - section 4 diagnostic lists DDEESSCCRRIIPPTTIIOONN ttaagg x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ffoouurr x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x qquuiinntt x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x iinnddeenntt x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x sseeppttiimmee x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x aacchhttaacchhtt x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x nneeuunn__nneeuunn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x zzeehhnn____zzeehhnn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x TThhiiss iiss aa vveerryy lloonngg tteexxtt ccoonnttaaiinneedd iinn tthhee ddiiaagg iitteemm hheeaadd,, iitt iiss ssoo lloonngg tthhaatt iitt oovveerrrruunnss tthhee lliinnee -- and here comes the item body, which is also long enough to break the line again. Check that It is not parsed in Bl: NNxx NetBSD OOxx OpenBSD FFxx FreeBSD OpenBSD July 16, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/diag.out_markdown010064400017530001753000000021051313667012600216440ustar00schwarzeschwarzeBL-DIAG(1) - General Commands Manual # NAME **Bl-diag** - section 4 diagnostic lists # DESCRIPTION tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x neun\_neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x zehn\_\_zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x This is a very long text contained in the diag item head, it is so long that it overruns the line - and here comes the item body, which is also long enough to break the line again. Check that It is not parsed in Bl: Nx NetBSD Ox OpenBSD Fx FreeBSD OpenBSD - July 16, 2017 mandoc-1.14.6/regress/mdoc/Bl/empty.in010064400017530001753000000007561313667012600200050ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-EMPTY 1 .Os .Sh NAME .Nm Bl-empty .Nd empty lists .Sh DESCRIPTION bullet list: .Bl -bullet .El column list: .Bl -column one two .El dash list: .Bl -dash .El diag list: .Bl -diag .El enum list: .Bl -enum .El hang list: .Bl -hang .El hyphen list: .Bl -hyphen .El inset list: .Bl -inset .El item list: .Bl -item .El ohang list: .Bl -ohang .El tag list: .Bl -tag -width Ds .El end of test document mandoc-1.14.6/regress/mdoc/Bl/empty.out_ascii010064400017530001753000000007151313667012600213510ustar00schwarzeschwarzeBL-EMPTY(1) General Commands Manual BL-EMPTY(1) NNAAMMEE BBll--eemmppttyy - empty lists DDEESSCCRRIIPPTTIIOONN bullet list: column list: dash list: diag list: enum list: hang list: hyphen list: inset list: item list: ohang list: tag list: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/empty.out_lint010064400017530001753000000010201313667012600212150ustar00schwarzeschwarzemandoc: empty.in:10:2: WARNING: empty block: Bl mandoc: empty.in:13:2: WARNING: empty block: Bl mandoc: empty.in:16:2: WARNING: empty block: Bl mandoc: empty.in:19:2: WARNING: empty block: Bl mandoc: empty.in:22:2: WARNING: empty block: Bl mandoc: empty.in:25:2: WARNING: empty block: Bl mandoc: empty.in:28:2: WARNING: empty block: Bl mandoc: empty.in:31:2: WARNING: empty block: Bl mandoc: empty.in:34:2: WARNING: empty block: Bl mandoc: empty.in:37:2: WARNING: empty block: Bl mandoc: empty.in:40:2: WARNING: empty block: Bl mandoc-1.14.6/regress/mdoc/Bl/empty.out_markdown010064400017530001753000000004221313667012600220760ustar00schwarzeschwarzeBL-EMPTY(1) - General Commands Manual # NAME **Bl-empty** - empty lists # DESCRIPTION bullet list: column list: dash list: diag list: enum list: hang list: hyphen list: inset list: item list: ohang list: tag list: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/emptyhead.in010064400017530001753000000010141313667012600206130ustar00schwarzeschwarze.\" $OpenBSD: emptyhead.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-EMPTYHEAD 1 .Os .Sh NAME .Nm Bl-emptyhead .Nd lists with empty item heads .Sh DESCRIPTION hang list: .Bl -hang -width 6n .It tag text .It no tag before this text .It tag text .El ohang list: .Bl -ohang .It tag text .It no tag before this text .It tag text .El inset list: .Bl -inset .It tag text .It no tag before this text .It tag text .El diag list: .Bl -diag .It tag text .It no tag before this text .It tag text .El mandoc-1.14.6/regress/mdoc/Bl/emptyhead.out_ascii010064400017530001753000000011641313667012600221720ustar00schwarzeschwarzeBL-EMPTYHEAD(1) General Commands Manual BL-EMPTYHEAD(1) NNAAMMEE BBll--eemmppttyyhheeaadd - lists with empty item heads DDEESSCCRRIIPPTTIIOONN hang list: tag text no tag before this text tag text ohang list: tag text no tag before this text tag text inset list: tag text no tag before this text tag text diag list: ttaagg text no tag before this text ttaagg text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/emptyhead.out_lint010064400017530001753000000004461313667012600220520ustar00schwarzeschwarzemandoc: emptyhead.in:13:2: WARNING: empty head in list item: Bl -hang It mandoc: emptyhead.in:22:2: WARNING: empty head in list item: Bl -ohang It mandoc: emptyhead.in:31:2: WARNING: empty head in list item: Bl -inset It mandoc: emptyhead.in:40:2: WARNING: empty head in list item: Bl -diag It mandoc-1.14.6/regress/mdoc/Bl/emptyhead.out_markdown010064400017530001753000000005731313667012600227270ustar00schwarzeschwarzeBL-EMPTYHEAD(1) - General Commands Manual # NAME **Bl-emptyhead** - lists with empty item heads # DESCRIPTION hang list: tag > text > no tag before this text tag > text ohang list: tag text no tag before this text tag text inset list: tag text no tag before this text tag text diag list: tag text no tag before this text tag text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/emptyitem.in010064400017530001753000000007141313667012600206560ustar00schwarzeschwarze.\" $OpenBSD: emptyitem.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-EMPTYITEM 1 .Os .Sh NAME .Nm Bl-emptyitem .Nd lists with fixed heads and empty items .Sh DESCRIPTION bullet list: .Bl -bullet .It head argument one .It .It three .El dash list: .Bl -dash .It one .It head argument .It three .El enum list: .Bl -enum .It one .It .It head argument three .El hyphen list: .Bl -hyphen .It Sy head argument one .It .It three .El mandoc-1.14.6/regress/mdoc/Bl/emptyitem.out_ascii010064400017530001753000000010401313667012600222200ustar00schwarzeschwarzeBL-EMPTYITEM(1) General Commands Manual BL-EMPTYITEM(1) NNAAMMEE BBll--eemmppttyyiitteemm - lists with fixed heads and empty items DDEESSCCRRIIPPTTIIOONN bullet list: ++oo one ++oo ++oo three dash list: -- one -- -- three enum list: 1. one 2. 3. three hyphen list: -- one -- -- three OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/emptyitem.out_lint010064400017530001753000000010511313667012600221000ustar00schwarzeschwarzemandoc: emptyitem.in:11:2: ERROR: skipping all arguments: It head argument mandoc: emptyitem.in:13:2: WARNING: empty list item: Bl -bullet It mandoc: emptyitem.in:21:2: WARNING: empty list item: Bl -dash It mandoc: emptyitem.in:21:2: ERROR: skipping all arguments: It head argument mandoc: emptyitem.in:29:2: WARNING: empty list item: Bl -enum It mandoc: emptyitem.in:30:2: ERROR: skipping all arguments: It head argument mandoc: emptyitem.in:35:2: ERROR: skipping all arguments: It Sy mandoc: emptyitem.in:37:2: WARNING: empty list item: Bl -hyphen It mandoc-1.14.6/regress/mdoc/Bl/emptyitem.out_markdown010064400017530001753000000004331313667012600227570ustar00schwarzeschwarzeBL-EMPTYITEM(1) - General Commands Manual # NAME **Bl-emptyitem** - lists with fixed heads and empty items # DESCRIPTION bullet list: * one * * three dash list: - one - - three enum list: 1. one 2. 3. three hyphen list: - one - - three OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/emptytag.in010064400017530001753000000004501313667012600204700ustar00schwarzeschwarze.\" $OpenBSD: emptytag.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-EMPTYTAG 1 .Os .Sh NAME .Nm Bl-emptytag .Nd tag lists with empty item heads .Sh DESCRIPTION initial text .Bl -tag -width 6n .It tag text .It no tag before this text .It tag text .El final text mandoc-1.14.6/regress/mdoc/Bl/emptytag.out_ascii010064400017530001753000000006071313667012600220450ustar00schwarzeschwarzeBL-EMPTYTAG(1) General Commands Manual BL-EMPTYTAG(1) NNAAMMEE BBll--eemmppttyyttaagg - tag lists with empty item heads DDEESSCCRRIIPPTTIIOONN initial text tag text no tag before this text tag text final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/enum.in010064400017530001753000000047031313667012600176070ustar00schwarzeschwarze.\" $OpenBSD: enum.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-ENUM 1 .Os .Sh NAME .Nm Bl-enum .Nd enumerated lists .Sh DESCRIPTION .Bl -enum -width -4n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width -3n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width -2n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width -1n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width 0n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width 1n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width 2n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width 3n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width 4n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width 5n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width 6n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -width 7n .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -enum -compact .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .It x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El mandoc-1.14.6/regress/mdoc/Bl/emptytag.out_lint010064400017530001753000000001071313667012600217160ustar00schwarzeschwarzemandoc: emptytag.in:13:2: WARNING: empty head in list item: Bl -tag It mandoc-1.14.6/regress/mdoc/Bl/emptytag.out_markdown010064400017530001753000000003321313667012600225720ustar00schwarzeschwarzeBL-EMPTYTAG(1) - General Commands Manual # NAME **Bl-emptytag** - tag lists with empty item heads # DESCRIPTION initial text tag > text > no tag before this text tag > text final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/enum.out_ascii010064400017530001753000000051241313667012600211560ustar00schwarzeschwarzeBL-ENUM(1) General Commands Manual BL-ENUM(1) NNAAMMEE BBll--eennuumm - enumerated lists DDEESSCCRRIIPPTTIIOONN 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 2. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 3. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 4. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 5. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 6. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 7. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 8. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 9. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 10. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 11. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 12. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/enum.out_markdown010064400017530001753000000041141313667012600217060ustar00schwarzeschwarzeBL-ENUM(1) - General Commands Manual # NAME **Bl-enum** - enumerated lists # DESCRIPTION 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 1. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 2. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 3. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 4. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 5. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 6. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 7. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 8. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 9. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 10. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 11. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 12. x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/extend.in010064400017530001753000000012541313667012600201300ustar00schwarzeschwarze.\" $OpenBSD: extend.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-EXTEND 1 .Os .Sh NAME .Nm Bl-extend .Nd extending block headers .Sh DESCRIPTION .\" explicit quoting does not require macro lines per se .Ao plain quoted text .Ac .Bl -tag -width Ds .It normal tag normal text .\" when extending It headers, plain text lines fall back .\" into the previous It body; so macro lines are required .It Ao .No extended tag .Ac extended text .It prefix Ao .No prefixed tag .Ac prefixed text .\" postfix after closing macro does not work in old groff .\" the whole It header gets lost .\" .It prefix Ao .\" .No braced tag .\" .Ac postfix .\" braced text .El mandoc-1.14.6/regress/mdoc/Bl/extend.out_ascii010064400017530001753000000006651313667012600215060ustar00schwarzeschwarzeBL-EXTEND(1) General Commands Manual BL-EXTEND(1) NNAAMMEE BBll--eexxtteenndd - extending block headers DDEESSCCRRIIPPTTIIOONN normal tag normal text extended text prefix prefixed text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/extend.out_markdown010064400017530001753000000004121313667012600222260ustar00schwarzeschwarzeBL-EXTEND(1) - General Commands Manual # NAME **Bl-extend** - extending block headers # DESCRIPTION <plain quoted text> normal tag > normal text <extended tag> > extended text prefix <prefixed tag> > prefixed text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/hang.in010064400017530001753000000073261313667012600175640ustar00schwarzeschwarze.\" $OpenBSD: hang.in,v 1.8 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-HANG 1 .Os .Sh NAME .Nm Bl-hang .Nd hanged lists .Sh DESCRIPTION .Bl -hang -width -4n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width -3n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width -2n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width -1n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 0n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 1n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 2n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 3n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 4n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It neun_neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It zehn__zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -hang -width 5n .It This is a very long text contained in the hanged item head, it is \ so long that it overruns the line - and here comes the item body. .El Compact hanged list: .Bl -hang -width 6n -compact .It one first line .It second second line .It third_tag last line .El Hanged list without a width: .Bl -hang .It tag text .El mandoc-1.14.6/regress/mdoc/Bl/hang.out_ascii010064400017530001753000000073251313667012600211340ustar00schwarzeschwarzeBL-HANG(1) General Commands Manual BL-HANG(1) NNAAMMEE BBll--hhaanngg - hanged lists DDEESSCCRRIIPPTTIIOONN tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x neun_neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x zehn__zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x This is a very long text contained in the hanged item head, it is so long that it overruns the line - and here comes the item body. Compact hanged list: one first line second second line third_tag last line Hanged list without a width: tag text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/hang.out_markdown010064400017530001753000000063451313667012600216670ustar00schwarzeschwarzeBL-HANG(1) - General Commands Manual # NAME **Bl-hang** - hanged lists # DESCRIPTION tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x four > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x quint > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x indent > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x septime > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x achtacht > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x neun\_neun > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x zehn\_\_zehn > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x This is a very long text contained in the hanged item head, it is so long that it overruns the line - > and here comes the item body. Compact hanged list: one > first line second > second line third\_tag > last line Hanged list without a width: tag > text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/inset.in010064400017530001753000000021421313667012600177600ustar00schwarzeschwarze.\" $OpenBSD: inset.in,v 1.6 2017/07/16 17:53:29 schwarze Exp $ .Dd $Mdocdate: July 16 2017 $ .Dt BL-INSET 1 .Os .Sh NAME .Nm Bl-inset .Nd inset list labels .Sh DESCRIPTION .Bl -inset .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -inset .It four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -inset .It quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -inset .It indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -inset .It septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -inset .It achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -inset .It neun_neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -inset .It zehn__zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .\" Trailing white space in the head. .Bl -inset -width 10n .It "a" b .It "a " b .It "a " b .El mandoc-1.14.6/regress/mdoc/Bl/inset.out_ascii010064400017530001753000000020661313667012600213360ustar00schwarzeschwarzeBL-INSET(1) General Commands Manual BL-INSET(1) NNAAMMEE BBll--iinnsseett - inset list labels DDEESSCCRRIIPPTTIIOONN tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x neun_neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x zehn__zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x a b a b a b OpenBSD July 16, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/inset.out_markdown010064400017530001753000000015351313667012600220700ustar00schwarzeschwarzeBL-INSET(1) - General Commands Manual # NAME **Bl-inset** - inset list labels # DESCRIPTION tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x neun\_neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x zehn\_\_zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x a b a ‌ b a ‌ b OpenBSD - July 16, 2017 mandoc-1.14.6/regress/mdoc/Bl/item.in010064400017530001753000000004651313667012600176020ustar00schwarzeschwarze.\" $OpenBSD: item.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-ITEM 1 .Os .Sh NAME .Nm Bl-item .Nd itemized lists .Sh DESCRIPTION .Bl -item .It first line .It ignore second line .It third line .El .Bl -item -compact .It first line .It ignore second line .It third line .El mandoc-1.14.6/regress/mdoc/Bl/item.out_ascii010064400017530001753000000005401313667012600211450ustar00schwarzeschwarzeBL-ITEM(1) General Commands Manual BL-ITEM(1) NNAAMMEE BBll--iitteemm - itemized lists DDEESSCCRRIIPPTTIIOONN first line second line third line first line second line third line OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/item.out_markdown010064400017530001753000000002761313667012600217050ustar00schwarzeschwarzeBL-ITEM(1) - General Commands Manual # NAME **Bl-item** - itemized lists # DESCRIPTION first line second line third line first line second line third line OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/multitag.in010064400017530001753000000011551313667012600204670ustar00schwarzeschwarze.\" $OpenBSD: multitag.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-MULTITAG 1 .Os .Sh NAME .Nm Bl-multitag .Nd lists with multiple successive tags .Sh DESCRIPTION inset: .Bl -inset .It first .It second .It third some text .It fourth .It fifth more text .El tag: .Bl -tag -width Ds .It first .It second .It third some text .It fourth .It fifth more text .El inset compact: .Bl -inset -compact .It first .It second .It third some text .It fourth .It fifth more text .El tag compact: .Bl -tag -width Ds -compact .It first .It second .It third some text .It fourth .It fifth more text .El mandoc-1.14.6/regress/mdoc/Bl/multitag.out_ascii010064400017530001753000000012371313667012600220410ustar00schwarzeschwarzeBL-MULTITAG(1) General Commands Manual BL-MULTITAG(1) NNAAMMEE BBll--mmuullttiittaagg - lists with multiple successive tags DDEESSCCRRIIPPTTIIOONN inset: first second third some text fourth fifth more text tag: first second third some text fourth fifth more text inset compact: first second third some text fourth fifth more text tag compact: first second third some text fourth fifth more text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/multitag.out_markdown010064400017530001753000000006571313667012600226000ustar00schwarzeschwarzeBL-MULTITAG(1) - General Commands Manual # NAME **Bl-multitag** - lists with multiple successive tags # DESCRIPTION inset: first second third some text fourth fifth more text tag: first second third > some text fourth fifth > more text inset compact: first second third some text fourth fifth more text tag compact: first second third > some text fourth fifth > more text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/multitype.in010064400017530001753000000003631313667012600206750ustar00schwarzeschwarze.\" $OpenBSD: multitype.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-MULTITYPE 1 .Os .Sh NAME .Nm Bl-multitype .Nd list with multiple types .Sh DESCRIPTION .Bl -dash -bullet -offset indent .It Some text. .El mandoc-1.14.6/regress/mdoc/Bl/multitype.out_ascii010064400017530001753000000004611313667012600222450ustar00schwarzeschwarzeBL-MULTITYPE(1) General Commands Manual BL-MULTITYPE(1) NNAAMMEE BBll--mmuullttiittyyppee - list with multiple types DDEESSCCRRIIPPTTIIOONN -- Some text. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/multitype.out_markdown010064400017530001753000000002241313667012600227740ustar00schwarzeschwarzeBL-MULTITYPE(1) - General Commands Manual # NAME **Bl-multitype** - list with multiple types # DESCRIPTION - Some text. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/nested.in010064400017530001753000000020141313667012600201160ustar00schwarzeschwarze.\" $OpenBSD: nested.in,v 1.6 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-NESTED 1 .Os .Sh NAME .Nm Bl-nested .Nd nested lists .Sh DESCRIPTION inset: .Bl -inset .It outer list .Bl -inset .It inner list .El .El inset compact: .Bl -inset -compact .It outer list .Bl -inset -compact .It inner list .El .El dash: .Bl -dash .It outer list .Bl -dash .It inner list .El .El dash compact: .Bl -dash -compact .It outer list .Bl -dash -compact .It inner list .El .El tag: .Bl -tag -width 4n .It outer tag outer text .Bl -tag -width 4n .It inner tag inner text .El outer text .El .Bl -tag -width 4n .It outer tag .Bd -ragged -compact outer text (display) .Ed .Bl -tag -width 4n .It inner tag inner text .El outer text .El .Bl -tag -width 4n .It outer tag .Dl outer text (one-line display) .Bl -tag -width 4n .It inner tag inner text .El outer text .El .Bl -tag -width 4n -offset 3n .It outer tag (indented 3n) outer text .Bl -tag -width 4n -offset 6n .It inner tag (indented 6n) inner text .El outer text .El final text mandoc-1.14.6/regress/mdoc/Bl/nested.out_ascii010064400017530001753000000020161313667012600214710ustar00schwarzeschwarzeBL-NESTED(1) General Commands Manual BL-NESTED(1) NNAAMMEE BBll--nneesstteedd - nested lists DDEESSCCRRIIPPTTIIOONN inset: outer list inner list inset compact: outer list inner list dash: -- outer list -- inner list dash compact: -- outer list -- inner list tag: outer tag outer text inner tag inner text outer text outer tag outer text (display) inner tag inner text outer text outer tag outer text (one-line display) inner tag inner text outer text outer tag (indented 3n) outer text inner tag (indented 6n) inner text outer text final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/nested.out_markdown010064400017530001753000000011531313667012600222240ustar00schwarzeschwarzeBL-NESTED(1) - General Commands Manual # NAME **Bl-nested** - nested lists # DESCRIPTION inset: outer list inner list inset compact: outer list inner list dash: - outer list - inner list dash compact: - outer list - inner list tag: outer tag > outer text > inner tag > > inner text > outer text outer tag > > outer text (display) > inner tag > > inner text > outer text outer tag > > outer text (one-line display) > inner tag > > inner text > outer text outer tag (indented 3n) > outer text > inner tag (indented 6n) > > inner text > outer text final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/noIt.in010064400017530001753000000005621313667012600175530ustar00schwarzeschwarze.\" $OpenBSD: noIt.in,v 1.4 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-NOIT 1 .Os .Sh NAME .Nm Bl-noIt .Nd list missing item macros .Sh DESCRIPTION .Bl -tag -width Ds Stray text. .Em More stray text .It tag Tagged text. .El .Bl -bullet Stray text. .Sm off .Em More Sy stray Em text .Sm on .It Bullet point. .El .Bl -dash Stray text only. .El mandoc-1.14.6/regress/mdoc/Bl/noIt.out_ascii010064400017530001753000000007131313667012600211220ustar00schwarzeschwarzeBL-NOIT(1) General Commands Manual BL-NOIT(1) NNAAMMEE BBll--nnooIItt - list missing item macros DDEESSCCRRIIPPTTIIOONN Stray text. _M_o_r_e _s_t_r_a_y _t_e_x_t tag Tagged text. Stray text. _M_o_r_essttrraayy_t_e_x_t ++oo Bullet point. Stray text only. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/noIt.out_lint010064400017530001753000000010471363444076700210120ustar00schwarzeschwarzemandoc: noIt.in:10:1: WARNING: moving content out of list: text mandoc: noIt.in:11:2: WARNING: moving content out of list: Em mandoc: noIt.in:16:1: WARNING: moving content out of list: text mandoc: noIt.in:17:2: WARNING: moving content out of list: Sm mandoc: noIt.in:18:2: WARNING: moving content out of list: Em mandoc: noIt.in:18:10: WARNING: moving content out of list: Sy mandoc: noIt.in:18:19: WARNING: moving content out of list: Em mandoc: noIt.in:24:1: WARNING: moving content out of list: text mandoc: noIt.in:23:2: WARNING: empty block: Bl mandoc-1.14.6/regress/mdoc/Bl/noIt.out_markdown010064400017530001753000000004021313667012600216470ustar00schwarzeschwarzeBL-NOIT(1) - General Commands Manual # NAME **Bl-noIt** - list missing item macros # DESCRIPTION Stray text. *More stray text* tag > Tagged text. Stray text. *More*‌**stray**‌*text* * Bullet point. Stray text only. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/notype.in010064400017530001753000000006001313667012600201510ustar00schwarzeschwarze.\" $OpenBSD: notype.in,v 1.5 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-NOTYPE 1 .Os .Sh NAME .Nm Bl-notype .Nd lists with late or missing types .Sh DESCRIPTION late type: .Bl -offset indent -bullet .It Some text. .El tail argument .Pp no type: .Bl -offset indent -width Ds .It Some text. .El .Pp no argument at all: .Bl .It Some text. .El .Pp final text mandoc-1.14.6/regress/mdoc/Bl/notype.out_ascii010064400017530001753000000006471313667012600215350ustar00schwarzeschwarzeBL-NOTYPE(1) General Commands Manual BL-NOTYPE(1) NNAAMMEE BBll--nnoottyyppee - lists with late or missing types DDEESSCCRRIIPPTTIIOONN late type: ++oo Some text. no type: Some text. no argument at all: Some text. final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/notype.out_lint010064400017530001753000000005421313667012600214050ustar00schwarzeschwarzemandoc: notype.in:13:2: ERROR: skipping all arguments: El tail argument mandoc: notype.in:10:2: WARNING: list type is not the first argument: Bl -offset mandoc: notype.in:16:2: ERROR: missing list type, using -item: Bl mandoc: notype.in:16:20: WARNING: skipping -width argument: Bl -item mandoc: notype.in:22:2: ERROR: missing list type, using -item: Bl mandoc-1.14.6/regress/mdoc/Bl/notype.out_markdown010064400017530001753000000003451313667012600222620ustar00schwarzeschwarzeBL-NOTYPE(1) - General Commands Manual # NAME **Bl-notype** - lists with late or missing types # DESCRIPTION late type: * Some text. no type: Some text. no argument at all: Some text. final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/offset.in010064400017530001753000000024541313667012600201320ustar00schwarzeschwarze.\" $OpenBSD: offset.in,v 1.5 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-OFFSET 1 .Os .Sh NAME .Nm Bl-offset .Nd various arguments for Bl offset .Sh DESCRIPTION .Bl -item -offset .It Bl item offset empty .El .Bl -item -offset left .It Bl item offset left .El .Bl -item -offset indent .It Bl item offset indent .El .Bl -item -offset indent-two .It Bl item offset indent-two .El .Bl -item -offset 4n .It Bl item offset 4n .El .Bl -item -offset mystring .It Bl item offset mystring .El .Bl -item -offset Ds .It Bl item offset Ds .El .Bl -item -offset 78n .It Bl item offset 78n .El .Bl -item -offset -3n .It Bl item offset -3n .El .Bl -tag -width Ds -offset .It tag Bl tag width Ds offset empty .El .Bl -tag -width Ds -offset left .It tag Bl tag width Ds offset left .El .Bl -tag -width Ds -offset indent .It tag Bl tag width Ds offset indent .El .Bl -tag -width Ds -offset indent-two .It tag Bl tag width Ds offset indent-two .El .Bl -tag -width Ds -offset 0.36i .It tag Bl tag width Ds offset 0.36i .El .Bl -tag -width Ds -offset mystring .It tag Bl tag width Ds offset mystring .El .Bl -tag -width Ds -offset Ds .It tag Bl tag width Ds offset Ds .El .Bl -tag -width Ds -offset 78n .It tag Bl tag width Ds offset 78n .El .Bl -tag -width Ds -offset -0.26i .It tag Bl tag width Ds offset -0.26i .El mandoc-1.14.6/regress/mdoc/Bl/offset.out_ascii010064400017530001753000000034541313667012600215040ustar00schwarzeschwarzeBL-OFFSET(1) General Commands Manual BL-OFFSET(1) NNAAMMEE BBll--ooffffsseett - various arguments for Bl offset DDEESSCCRRIIPPTTIIOONN Bl item offset empty Bl item offset left Bl item offset indent Bl item offset indent-two Bl item offset 4n Bl item offset mystring Bl item offset Ds Bl item offset 78n Bl item offset -3n tag Bl tag width Ds offset empty tag Bl tag width Ds offset left tag Bl tag width Ds offset indent tag Bl tag width Ds offset indent-two tag Bl tag width Ds offset 0.36i tag Bl tag width Ds offset mystring tag Bl tag width Ds offset Ds tag Bl tag width Ds offset 78n tag Bl tag width Ds offset -0.26i OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/offset.out_markdown010064400017530001753000000012341313667012600222300ustar00schwarzeschwarzeBL-OFFSET(1) - General Commands Manual # NAME **Bl-offset** - various arguments for Bl offset # DESCRIPTION Bl item offset empty Bl item offset left Bl item offset indent Bl item offset indent-two Bl item offset 4n Bl item offset mystring Bl item offset Ds Bl item offset 78n Bl item offset -3n tag > Bl tag width Ds offset empty tag > Bl tag width Ds offset left tag > Bl tag width Ds offset indent tag > Bl tag width Ds offset indent-two tag > Bl tag width Ds offset 0.36i tag > Bl tag width Ds offset mystring tag > Bl tag width Ds offset Ds tag > Bl tag width Ds offset 78n tag > Bl tag width Ds offset -0.26i OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/ohang.in010064400017530001753000000005561313667012600177410ustar00schwarzeschwarze.\" $OpenBSD: ohang.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-OHANG 1 .Os .Sh NAME .Nm Bl-ohang .Nd over-hanging lists .Sh DESCRIPTION .Bl -ohang .It first tag first line .It second tag second line .It third tag third line .El .Bl -ohang -compact .It first tag first line .It second tag second line .It third tag third line .El mandoc-1.14.6/regress/mdoc/Bl/ohang.out_ascii010064400017530001753000000007031313667012600213040ustar00schwarzeschwarzeBL-OHANG(1) General Commands Manual BL-OHANG(1) NNAAMMEE BBll--oohhaanngg - over-hanging lists DDEESSCCRRIIPPTTIIOONN first tag first line second tag second line third tag third line first tag first line second tag second line third tag third line OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/ohang.out_markdown010064400017530001753000000004161313667012600220370ustar00schwarzeschwarzeBL-OHANG(1) - General Commands Manual # NAME **Bl-ohang** - over-hanging lists # DESCRIPTION first tag first line second tag second line third tag third line first tag first line second tag second line third tag third line OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/secstart.in010064400017530001753000000007111313667012600204660ustar00schwarzeschwarze.\" $OpenBSD: secstart.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-SECSTART 1 .Os .Sh NAME .Nm Bl-secstart .Nd nested lists at the beginning of sections .Sh DESCRIPTION .Ss item .Bl -item .It .Bl -item .It text .El .El .Ss dash .Bl -dash .It .Bl -dash .It text .El .El .Ss inset .Bl -inset .It outer .Bl -inset .It inner text .El .El .Ss tag .Bl -tag -width 4n .It outer tag .Bl -tag -width 4n .It inner tag text .El .El mandoc-1.14.6/regress/mdoc/Bl/tag.in010064400017530001753000000057161313667012600174230ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.18 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-TAG 1 .Os .Sh NAME .Nm Bl-tag .Nd tagged lists .Sh DESCRIPTION .Bl -tag -width -4n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width -0.26i .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width -2n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width -1n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 0n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 1n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 2n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 3n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 4n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 5n .It tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 5n .It four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 5n .It quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 0.46i .It indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 5n .It septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 5n .It achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 5n .It neun neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 5n .It zehn_ zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x .El .Bl -tag -width 5n .It This is a very long text contained in the tag, it is so long \ that it overruns the line - and here comes the item body. .El .Bl -tag -width 100n .It hundred text text .El .Pp Trailing white space in the head: .Bl -tag -width 5n .It "a" none .It "a " one .It "a " two .It "a " three .It "a " four .It "a " five .It "a " six .It " " white space only .El .Pp Non-numeric width specification: .Bl -tag -width xxx .It tag text .El .Bl -tag -width xxxxxxxxxx .It tag text .El .Pp Scaling units other than n: .Bl -tag -width 4m .It tag text .El .Bl -tag -width 800M .It tag text .El .Bl -tag -width 14 .It tag text .El .Pp Default width: .Bl -tag .It tag text .It long tag long text .It Sy tag Em with markup text .El .Pp Indented list: .Bl -tag -offset 6n -width xxx .It one first text .It two second text .El .Pp Embedded paragraph: .Bl -tag -width Ds .It tag first paragraph .Pp second paragraph .El mandoc-1.14.6/regress/mdoc/Bl/secstart.out_ascii010064400017530001753000000007451313667012600220460ustar00schwarzeschwarzeBL-SECSTART(1) General Commands Manual BL-SECSTART(1) NNAAMMEE BBll--sseeccssttaarrtt - nested lists at the beginning of sections DDEESSCCRRIIPPTTIIOONN iitteemm text ddaasshh -- -- text iinnsseett outer inner text ttaagg outer tag inner tag text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/secstart.out_markdown010064400017530001753000000004011313667012600225650ustar00schwarzeschwarzeBL-SECSTART(1) - General Commands Manual # NAME **Bl-secstart** - nested lists at the beginning of sections # DESCRIPTION ## item text ## dash - - text ## inset outer inner text ## tag outer tag > inner tag > > text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/tag.out_ascii010064400017530001753000000061031313667012600207630ustar00schwarzeschwarzeBL-TAG(1) General Commands Manual BL-TAG(1) NNAAMMEE BBll--ttaagg - tagged lists DDEESSCCRRIIPPTTIIOONN tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x four x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x quint x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x indent x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x septime x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x achtacht x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x neun neun x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x zehn_ zehn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x This is a very long text contained in the tag, it is so long that it overruns the line - and here comes the item body. hundred text text Trailing white space in the head: a none a one a two a three a four a five a six white space only Non-numeric width specification: tag text tag text Scaling units other than n: tag text tag text tag text Default width: tag text long tag long text ttaagg _w_i_t_h _m_a_r_k_u_p text Indented list: one first text two second text Embedded paragraph: tag first paragraph second paragraph OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/tag.out_lint010064400017530001753000000001161313667012600206370ustar00schwarzeschwarzemandoc: tag.in:132:2: WARNING: missing -width in -tag list, using 6n: Bl -tag mandoc-1.14.6/regress/mdoc/Bl/tag.out_markdown010064400017530001753000000043311313667012600215160ustar00schwarzeschwarzeBL-TAG(1) - General Commands Manual # NAME **Bl-tag** - tagged lists # DESCRIPTION tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x tag > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x four > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x quint > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x indent > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x septime > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x achtacht > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x neun neun > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x zehn\_ zehn > x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x This is a very long text contained in the tag, it is so long that it overruns the line - > and here comes the item body. hundred > text text Trailing white space in the head: a > none a > one a > two a > three a > four a > five a > six > white space only Non-numeric width specification: tag > text tag > text Scaling units other than n: tag > text tag > text tag > text Default width: tag > text long tag > long text **tag** *with markup* > text Indented list: one > first text two > second text Embedded paragraph: tag > first paragraph > second paragraph OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/unclosed.in010064400017530001753000000003501313667012600204510ustar00schwarzeschwarze.\" $OpenBSD: unclosed.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-UNCLOSED 1 .Os .Sh NAME .Nm Bl-unclosed .Nd list lacking an end macro .Sh DESCRIPTION .Bl -item .It item .Sh SEE ALSO .Xr mdoc 7 mandoc-1.14.6/regress/mdoc/Bl/unclosed.out_ascii010064400017530001753000000005021313667012600220210ustar00schwarzeschwarzeBL-UNCLOSED(1) General Commands Manual BL-UNCLOSED(1) NNAAMMEE BBll--uunncclloosseedd - list lacking an end macro DDEESSCCRRIIPPTTIIOONN item SSEEEE AALLSSOO mdoc(7) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/unclosed.out_markdown010064400017530001753000000002401313667012600225520ustar00schwarzeschwarzeBL-UNCLOSED(1) - General Commands Manual # NAME **Bl-unclosed** - list lacking an end macro # DESCRIPTION item # SEE ALSO mdoc(7) OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/column_nogroff.in010064400017530001753000000006251312673154400216600ustar00schwarzeschwarze.\" $OpenBSD: column_nogroff.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BL-COLUMN_NOGROFF 1 .Os .Sh NAME .Nm Bl-column_nogroff .Nd column lists mishandled by groff .Sh DESCRIPTION Item macro without arguments: .Bl -column "first column" "second column" .It text .No macro Ta after tab .El .Pp Tab macro at the beginning of a line: .Bl -column "aa" "bb" .It aa .Ta bb .El mandoc-1.14.6/regress/mdoc/Bl/column_nogroff.out_ascii010064400017530001753000000006521312673154400232310ustar00schwarzeschwarzeBL-COLUMN_NOGROFF(1) General Commands Manual BL-COLUMN_NOGROFF(1) NNAAMMEE BBll--ccoolluummnn__nnooggrrooffff - column lists mishandled by groff DDEESSCCRRIIPPTTIIOONN Item macro without arguments: text macro after tab Tab macro at the beginning of a line: aa bb OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/column_nogroff.out_lint010064400017530001753000000002331312673154400231020ustar00schwarzeschwarzemandoc: column_nogroff.in:11:2: WARNING: missing argument, using next line: Bl -column It mandoc: column_nogroff.in:19:2: WARNING: first macro on line: Ta mandoc-1.14.6/regress/mdoc/Bl/column_nogroff.out_markdown010064400017530001753000000004151312673154400237600ustar00schwarzeschwarzeBL-COLUMN\_NOGROFF(1) - General Commands Manual # NAME **Bl-column\_nogroff** - column lists mishandled by groff # DESCRIPTION Item macro without arguments: text macro after tab Tab macro at the beginning of a line: aa bb OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bl/diag.out_lint010064400017530001753000000003531313272461700207740ustar00schwarzeschwarzemandoc: diag.in:51:2: WARNING: skipping empty macro: No mandoc: diag.in:53:2: WARNING: skipping empty macro: No mandoc: diag.in:55:2: WARNING: skipping empty macro: No mandoc: diag.in:41:11: WARNING: skipping -width argument: Bl -diag mandoc-1.14.6/regress/mdoc/Bl/inset.out_lint010064400017530001753000000001051313272461700212050ustar00schwarzeschwarzemandoc: inset.in:42:12: WARNING: skipping -width argument: Bl -inset mandoc-1.14.6/regress/mdoc/Bl/esc.in010064400017530001753000000005201340721765100174070ustar00schwarzeschwarze.\" $OpenBSD: esc.in,v 1.1 2018/12/21 16:58:49 schwarze Exp $ .Dd $Mdocdate: December 21 2018 $ .Dt BL-ESC 1 .Os .Sh NAME .Nm Bl-esc .Nd escape sequences in full block macro heads .Sh DESCRIPTION .ds a \(at .Bl -tag -width 2n .It \*a unquoted unescaped .It "\*a" quoted unescaped .It \\*a unquoted escaped .It "\\*a" quoted escaped .El mandoc-1.14.6/regress/mdoc/Bl/esc.out_ascii010064400017530001753000000006001340721765100207570ustar00schwarzeschwarzeBL-ESC(1) General Commands Manual BL-ESC(1) NNAAMMEE BBll--eesscc - escape sequences in full block macro heads DDEESSCCRRIIPPTTIIOONN @ unquoted unescaped @ quoted unescaped @ unquoted escaped @ quoted escaped OpenBSD December 21, 2018 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/esc.out_markdown010064400017530001753000000003751340721765100215220ustar00schwarzeschwarzeBL-ESC(1) - General Commands Manual # NAME **Bl-esc** - escape sequences in full block macro heads # DESCRIPTION @ > unquoted unescaped @ > quoted unescaped @ > unquoted escaped @ > quoted escaped OpenBSD - December 21, 2018 mandoc-1.14.6/regress/mdoc/Bl/vert.in010064400017530001753000000004021362561734100176160ustar00schwarzeschwarze.\" $OpenBSD: vert.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .Dd $Mdocdate: February 27 2020 $ .Dt BL-VERT 1 .Os .Sh NAME .Nm Bl-vert .Nd vertical spacing before lists .Sh DESCRIPTION .Bl -tag -width 7n .Sm off .It Fl o Ar file .Sm on text .El end of file mandoc-1.14.6/regress/mdoc/Bl/vert.out_ascii010064400017530001753000000004731362561734100211770ustar00schwarzeschwarzeBL-VERT(1) General Commands Manual BL-VERT(1) NNAAMMEE BBll--vveerrtt - vertical spacing before lists DDEESSCCRRIIPPTTIIOONN --oo_f_i_l_e text end of file OpenBSD February 27, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Bl/vert.out_markdown010064400017530001753000000002571362561734100217310ustar00schwarzeschwarzeBL-VERT(1) - General Commands Manual # NAME **Bl-vert** - vertical spacing before lists # DESCRIPTION **-o**‌*file* > text end of file OpenBSD - February 27, 2020 mandoc-1.14.6/regress/mdoc/Brq004075500017530001753000000000001412314056600164175ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Brq/Makefile010064400017530001753000000002151313667012600201340ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1.1.1 2011/12/04 03:09:25 schwarze Exp $ REGRESS_TARGETS = empty LINT_TARGETS = empty .include mandoc-1.14.6/regress/mdoc/Brq/empty.in010064400017530001753000000004431313667012600201650ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.5 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BRQ-EMPTY 1 .Os .Sh NAME .Nm Brq-empty .Nd empty implicit enclosure macros .Sh DESCRIPTION An empty .Brq and a full .Brq "(" user@host) quotation. And another .Bro "(" full) Brc one "Sy" bold . mandoc-1.14.6/regress/mdoc/Brq/empty.out_ascii010064400017530001753000000005651313667012600215430ustar00schwarzeschwarzeBRQ-EMPTY(1) General Commands Manual BRQ-EMPTY(1) NNAAMMEE BBrrqq--eemmppttyy - empty implicit enclosure macros DDEESSCCRRIIPPTTIIOONN An empty {} and a full ({user@host)} quotation. And another ({full)} one bboolldd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Brq/empty.out_markdown010064400017530001753000000003331313667012600222660ustar00schwarzeschwarzeBRQ-EMPTY(1) - General Commands Manual # NAME **Brq-empty** - empty implicit enclosure macros # DESCRIPTION An empty {} and a full ({user@host)} quotation. And another ({full)} one **bold**. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Brq/empty.out_lint010064400017530001753000000001221333010372000213710ustar00schwarzeschwarzemandoc: empty.in:12:19: STYLE: no blank before trailing delimiter: Brq user@host) mandoc-1.14.6/regress/mdoc/Bx004075500017530001753000000000001412314056600162445ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Bx/Makefile010064400017530001753000000002071313667012600177620ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2011/11/17 16:28:45 schwarze Exp $ REGRESS_TARGETS = args LINT_TARGETS = args .include mandoc-1.14.6/regress/mdoc/Bx/args.in010064400017530001753000000007001313667012600176040ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.5 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BX-ARGS 1 .Os .Sh NAME .Nm Bx-args .Nd arguments to the BSD macro .Sh DESCRIPTION no arguments: .Bx .Pp one standard argument: .Bx 4.4 "." .Pp one non-standard argument: .Bx nett. .Pp one semi-standard argument: .Bx 4.1c .Pp two standard arguments: .Bx 4.3 reno .Pp more arguments: .Bx 4.3 tahoe and "Em" some additional words .Pp end of test document mandoc-1.14.6/regress/mdoc/Bx/args.out_ascii010064400017530001753000000011001313667012600211500ustar00schwarzeschwarzeBX-ARGS(1) General Commands Manual BX-ARGS(1) NNAAMMEE BBxx--aarrggss - arguments to the BSD macro DDEESSCCRRIIPPTTIIOONN no arguments: BSD one standard argument: 4.4BSD. one non-standard argument: nett.BSD one semi-standard argument: 4.1cBSD two standard arguments: 4.3BSD-Reno more arguments: 4.3BSD-Tahoe and _s_o_m_e _a_d_d_i_t_i_o_n_a_l _w_o_r_d_s end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Bx/args.out_markdown010064400017530001753000000005641313667012600217170ustar00schwarzeschwarzeBX-ARGS(1) - General Commands Manual # NAME **Bx-args** - arguments to the BSD macro # DESCRIPTION no arguments: BSD one standard argument: 4\.4BSD. one non-standard argument: nett.BSD one semi-standard argument: 4\.1cBSD two standard arguments: 4\.3BSD-Reno more arguments: 4\.3BSD-Tahoe and *some additional words* end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Bx/args.out_lint010064400017530001753000000001121312673154700210340ustar00schwarzeschwarzemandoc: args.in:16:9: STYLE: no blank before trailing delimiter: Bx nett. mandoc-1.14.6/regress/mdoc/Cd004075500017530001753000000000001412314056600162215ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Cd/Makefile010064400017530001753000000002261313667012600177400ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.5 2014/07/02 20:18:42 schwarze Exp $ REGRESS_TARGETS = eos font noarg punct LINT_TARGETS = noarg .include mandoc-1.14.6/regress/mdoc/Cd/eos.in010064400017530001753000000004071313667012600174170ustar00schwarzeschwarze.\" $OpenBSD: eos.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CD-EOS 1 .Os .Sh NAME .Nm Cd-eos .Nd end of sentence handling after the configuration directive macro .Sh DESCRIPTION Do not use .Cd options INSECURE . It is insecure. mandoc-1.14.6/regress/mdoc/Cd/eos.out_ascii010064400017530001753000000005741313667012600207750ustar00schwarzeschwarzeCD-EOS(1) General Commands Manual CD-EOS(1) NNAAMMEE CCdd--eeooss - end of sentence handling after the configuration directive macro DDEESSCCRRIIPPTTIIOONN Do not use ooppttiioonnss IINNSSEECCUURREE. It is insecure. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Cd/eos.out_markdown010064400017530001753000000003241313667012600215200ustar00schwarzeschwarzeCD-EOS(1) - General Commands Manual # NAME **Cd-eos** - end of sentence handling after the configuration directive macro # DESCRIPTION Do not use **options INSECURE**. It is insecure. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Cd/font.in010064400017530001753000000004101313667012600175710ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CD-FONT 1 .Os .Sh NAME .Nm Cd-font .Nd changing fonts inside the configuration declaration macro .Sh DESCRIPTION normal text .Cd bold\\fIemphasis\\fPback trailing text mandoc-1.14.6/regress/mdoc/Cd/font.out_ascii010064400017530001753000000005671313667012600211570ustar00schwarzeschwarzeCD-FONT(1) General Commands Manual CD-FONT(1) NNAAMMEE CCdd--ffoonntt - changing fonts inside the configuration declaration macro DDEESSCCRRIIPPTTIIOONN normal text bboolldd_e_m_p_h_a_s_i_sbbaacckk trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Cd/font.out_markdown010064400017530001753000000003171313667012600217020ustar00schwarzeschwarzeCD-FONT(1) - General Commands Manual # NAME **Cd-font** - changing fonts inside the configuration declaration macro # DESCRIPTION normal text **bold*emphasis*back** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Cd/noarg.in010064400017530001753000000004321313667012600177350ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CD-NOARG 1 .Os .Sh NAME .Nm Cd-noarg .Nd kernel configuration directive without arguments .Sh DESCRIPTION with arguments: .Cd wd* at pciide? without arguments: .Cd end of test document mandoc-1.14.6/regress/mdoc/Cd/noarg.out_ascii010064400017530001753000000006051313667012600213100ustar00schwarzeschwarzeCD-NOARG(1) General Commands Manual CD-NOARG(1) NNAAMMEE CCdd--nnooaarrgg - kernel configuration directive without arguments DDEESSCCRRIIPPTTIIOONN with arguments: wwdd** aatt ppcciiiiddee?? without arguments: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Cd/noarg.out_lint010064400017530001753000000000711313667012600211630ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Cd mandoc-1.14.6/regress/mdoc/Cd/noarg.out_markdown010064400017530001753000000003431313667012600220410ustar00schwarzeschwarzeCD-NOARG(1) - General Commands Manual # NAME **Cd-noarg** - kernel configuration directive without arguments # DESCRIPTION with arguments: **wd\* at pciide?** without arguments: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Cd/punct.in010064400017530001753000000010111312673155000177500ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CD-PUNCT 1 .Os .Sh NAME .Nm Cd-punct .Nd punctuation handling by the Cd macro .Sh DESCRIPTION closing punctuation .Cd a ) only one .Cd ) only more than one .Cd ) ) middle .Cd a ) z start .Cd ) z dot .Cd . z comma .Cd , z semicolon .Cd ; z colon .Cd : z quest .Cd ? z excl .Cd ! z paren .Cd ) z bracket .Cd ] z bar .Cd | m op paren .Cd ( a op bracket .Cd [ a .Pp quoted punctuation: .Cd a "(" b "|" c ")" d "." "Em" italic . mandoc-1.14.6/regress/mdoc/Cd/punct.out_ascii010064400017530001753000000011101312673155000213210ustar00schwarzeschwarzeCD-PUNCT(1) General Commands Manual CD-PUNCT(1) NNAAMMEE CCdd--ppuunncctt - punctuation handling by the Cd macro DDEESSCCRRIIPPTTIIOONN closing punctuation aa) only one ) only more than one )) middle aa) zz start ) zz dot . zz comma , zz semicolon ; zz colon : zz quest ? zz excl ! zz paren ) zz bracket ] zz bar | mm op paren (aa op bracket [aa quoted punctuation: aa (bb | cc) dd. _i_t_a_l_i_c. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Cd/punct.out_markdown010064400017530001753000000007071312673155000220660ustar00schwarzeschwarzeCD-PUNCT(1) - General Commands Manual # NAME **Cd-punct** - punctuation handling by the Cd macro # DESCRIPTION closing punctuation **a**) only one ) only more than one )) middle **a**) **z** start ) **z** dot . **z** comma , **z** semicolon ; **z** colon : **z** quest ? **z** excl ! **z** paren ) **z** bracket ] **z** bar | **m** op paren (**a** op bracket \[**a** quoted punctuation: **a** (**b** | **c**) **d**. *italic*. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Cm004075500017530001753000000000001412314056600162325ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Cm/Makefile010064400017530001753000000003011363444076700177540ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2020/03/13 00:31:05 schwarze Exp $ REGRESS_TARGETS = basic font noarg punct tag TAG_TARGETS = tag LINT_TARGETS = noarg HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Cm/basic.in010064400017530001753000000004321313667012600177210ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CM-BASIC 1 .Os .Sh NAME .Nm Cm-basic .Nd basic usage of the Cm macro .Sh DESCRIPTION end of line: .Nm mt Fl f Ar device Cm rewind .Pp middle of line: .Nm ps Fl o Cm pid , Ns Cm command mandoc-1.14.6/regress/mdoc/Cm/basic.out_ascii010064400017530001753000000006261313667012600212770ustar00schwarzeschwarzeCM-BASIC(1) General Commands Manual CM-BASIC(1) NNAAMMEE CCmm--bbaassiicc - basic usage of the Cm macro DDEESSCCRRIIPPTTIIOONN end of line: mmtt --ff _d_e_v_i_c_e rreewwiinndd middle of line: ppss --oo ppiidd,ccoommmmaanndd OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Cm/basic.out_markdown010064400017530001753000000003441313667012600220260ustar00schwarzeschwarzeCM-BASIC(1) - General Commands Manual # NAME **Cm-basic** - basic usage of the Cm macro # DESCRIPTION end of line: **mt** **-f** *device* **rewind** middle of line: **ps** **-o** **pid**,**command** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Cm/font.in010064400017530001753000000003771313667012600176160ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CM-FONT 1 .Os .Sh NAME .Nm Cm-font .Nd changing fonts inside the command modifier macro .Sh DESCRIPTION normal text .Cm bold\\fIemphasis\\fPback trailing text mandoc-1.14.6/regress/mdoc/Cm/font.out_ascii010064400017530001753000000005561313667012600211660ustar00schwarzeschwarzeCM-FONT(1) General Commands Manual CM-FONT(1) NNAAMMEE CCmm--ffoonntt - changing fonts inside the command modifier macro DDEESSCCRRIIPPTTIIOONN normal text bboolldd_e_m_p_h_a_s_i_sbbaacckk trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Cm/font.out_markdown010064400017530001753000000003061313667012600217110ustar00schwarzeschwarzeCM-FONT(1) - General Commands Manual # NAME **Cm-font** - changing fonts inside the command modifier macro # DESCRIPTION normal text **bold*emphasis*back** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Cm/noarg.in010064400017530001753000000004351313667012600177510ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt CM-NOARG 1 .Os .Sh NAME .Nm Cm-noarg .Nd command modifier macro without arguments .Sh DESCRIPTION end of line: .Nm mt Fl f Ar device Cm .Pp middle of line: .Nm ps Fl x Cm Fl o Cm command. mandoc-1.14.6/regress/mdoc/Cm/noarg.out_ascii010064400017530001753000000006201313667012600213160ustar00schwarzeschwarzeCM-NOARG(1) General Commands Manual CM-NOARG(1) NNAAMMEE CCmm--nnooaarrgg - command modifier macro without arguments DDEESSCCRRIIPPTTIIOONN end of line: mmtt --ff _d_e_v_i_c_e middle of line: ppss --xx --oo ccoommmmaanndd.. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Cm/noarg.out_lint010064400017530001753000000003031313667012600211720ustar00schwarzeschwarzemandoc: noarg.in:10:23: WARNING: skipping empty macro: Cm mandoc: noarg.in:13:13: WARNING: skipping empty macro: Cm mandoc: noarg.in:13:31: STYLE: no blank before trailing delimiter: Cm command. mandoc-1.14.6/regress/mdoc/Cm/noarg.out_markdown010064400017530001753000000003461313667012600220550ustar00schwarzeschwarzeCM-NOARG(1) - General Commands Manual # NAME **Cm-noarg** - command modifier macro without arguments # DESCRIPTION end of line: **mt** **-f** *device* middle of line: **ps** **-x** **-o** **command.** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Cm/punct.in010064400017530001753000000010111312673155100177620ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt Cm-PUNCT 1 .Os .Sh NAME .Nm Cm-punct .Nd punctuation handling by the Cm macro .Sh DESCRIPTION closing punctuation .Cm a ) only one .Cm ) only more than one .Cm ) ) middle .Cm a ) z start .Cm ) z dot .Cm . z comma .Cm , z semicolon .Cm ; z colon .Cm : z quest .Cm ? z excl .Cm ! z paren .Cm ) z bracket .Cm ] z bar .Cm | m op paren .Cm ( a op bracket .Cm [ a .Pp quoted punctuation: .Cm a "(" b "|" c ")" d "." "Em" italic . mandoc-1.14.6/regress/mdoc/Cm/punct.out_ascii010064400017530001753000000011101312673155100213330ustar00schwarzeschwarzeCm-PUNCT(1) General Commands Manual Cm-PUNCT(1) NNAAMMEE CCmm--ppuunncctt - punctuation handling by the Cm macro DDEESSCCRRIIPPTTIIOONN closing punctuation aa) only one ) only more than one )) middle aa) zz start ) zz dot . zz comma , zz semicolon ; zz colon : zz quest ? zz excl ! zz paren ) zz bracket ] zz bar | mm op paren (aa op bracket [aa quoted punctuation: aa (bb | cc) dd. _i_t_a_l_i_c. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Cm/punct.out_markdown010064400017530001753000000007071312673155100221000ustar00schwarzeschwarzeCm-PUNCT(1) - General Commands Manual # NAME **Cm-punct** - punctuation handling by the Cm macro # DESCRIPTION closing punctuation **a**) only one ) only more than one )) middle **a**) **z** start ) **z** dot . **z** comma , **z** semicolon ; **z** colon : **z** quest ? **z** excl ! **z** paren ) **z** bracket ] **z** bar | **m** op paren (**a** op bracket \[**a** quoted punctuation: **a** (**b** | **c**) **d**. *italic*. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Cm/tag.in010064400017530001753000000005531367274434100174250ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.2 2020/03/21 00:20:38 schwarze Exp $ .Dd $Mdocdate: March 21 2020 $ .Dt CM-TAG 1 .Os .Sh NAME .Nm Cm-tag .Nd tagging of command modifier macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Cm one | \&two text .It Xo .Cm three .Xc text .It Cm -hyphen text .It Cm \-minus\-sign text .It Cm \ebackslash text .El .Tg .Cm four .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Cm/tag.out_ascii010064400017530001753000000010461367274434100207740ustar00schwarzeschwarzeCM-TAG(1) General Commands Manual CM-TAG(1) NNAAMMEE CCmm--ttaagg - tagging of command modifier macros DDEESSCCRRIIPPTTIIOONN BEGINTEST oonnee | ttwwoo text tthhrreeee text --hhyypphheenn text --mmiinnuuss--ssiiggnn text \\bbaacckkssllaasshh text ffoouurr ENDTEST OpenBSD March 21, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Cm/tag.out_html010064400017530001753000000013431367274434100206500ustar00schwarzeschwarze
|
text
text
text
text
text
mandoc-1.14.6/regress/mdoc/Cm/tag.out_markdown010064400017530001753000000004441367274434100215270ustar00schwarzeschwarzeCM-TAG(1) - General Commands Manual # NAME **Cm-tag** - tagging of command modifier macros # DESCRIPTION BEGINTEST **one** | **two** > text **three** > text **-hyphen** > text **-minus-sign** > text **\backslash** > text **four** ENDTEST OpenBSD - March 21, 2020 mandoc-1.14.6/regress/mdoc/Cm/tag.out_tag010064400017530001753000000003531372346556000204570ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three tag.mandoc_ascii 12 hyphen tag.mandoc_ascii 14 minus tag.mandoc_ascii 17 backslash tag.mandoc_ascii 20 four tag.mandoc_ascii 22 mandoc-1.14.6/regress/mdoc/D1004075500017530001753000000000001412314056600161375ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/D1/Makefile010064400017530001753000000002741367274434100176670ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2020/04/06 09:55:49 schwarze Exp $ REGRESS_TARGETS = spacing TAG_TARGETS = spacing LINT_TARGETS = spacing HTML_TARGETS = spacing .include mandoc-1.14.6/regress/mdoc/D1/spacing.in010064400017530001753000000005431367274434100202020ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.5 2020/04/06 09:55:49 schwarze Exp $ .Dd $Mdocdate: April 6 2020 $ .Dt D1-SPACING 1 .Os .Sh NAME .Nm D1-spacing .Nd spacing in and around one-line displays .Sh DESCRIPTION BEGINTEST .Pp preceding paragraph .Tg display .D1 spacing in and around one-line displays empty display: .D1 following text .br ENDTEST .br end of file mandoc-1.14.6/regress/mdoc/D1/spacing.out_ascii010064400017530001753000000007001367274434100215460ustar00schwarzeschwarzeD1-SPACING(1) General Commands Manual D1-SPACING(1) NNAAMMEE DD11--ssppaacciinngg - spacing in and around one-line displays DDEESSCCRRIIPPTTIIOONN BEGINTEST preceding paragraph spacing in and around one-line displays empty display: following text ENDTEST end of file OpenBSD April 6, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/D1/spacing.out_lint010064400017530001753000000000621367274434100214250ustar00schwarzeschwarzemandoc: spacing.in:16:2: WARNING: empty block: D1 mandoc-1.14.6/regress/mdoc/D1/spacing.out_markdown010064400017530001753000000004251367274434100223040ustar00schwarzeschwarzeD1-SPACING(1) - General Commands Manual # NAME **D1-spacing** - spacing in and around one-line displays # DESCRIPTION BEGINTEST preceding paragraph > spacing in and around one-line displays empty display: following text ENDTEST end of file OpenBSD - April 6, 2020 mandoc-1.14.6/regress/mdoc/D1/spacing.out_html010064400017530001753000000003551367274434100214300ustar00schwarzeschwarze

preceding paragraph

in and around one-line displays
empty display:
following text
mandoc-1.14.6/regress/mdoc/D1/spacing.out_tag010064400017530001753000000001371372346556000212350ustar00schwarzeschwarzeNAME spacing.mandoc_ascii 3 DESCRIPTION spacing.mandoc_ascii 6 display spacing.mandoc_ascii 10 mandoc-1.14.6/regress/mdoc/Db004075500017530001753000000000001412314056600162205ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Db/Makefile010064400017530001753000000002751306010565700177410ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2014/11/27 16:20:27 schwarze Exp $ REGRESS_TARGETS = args LINT_TARGETS = args # mandoc -T markdown ignores .Db SKIP_MARKDOWN ?= ALL .include mandoc-1.14.6/regress/mdoc/Db/args.in010064400017530001753000000003501313667012600175610ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:24 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DB-ARGS 1 .Os .Sh NAME .Nm Db-args .Nd obsolete debug macro .Sh DESCRIPTION no args .Db one arg .Db on two args .Db foo bar end of text mandoc-1.14.6/regress/mdoc/Db/args.out_ascii010064400017530001753000000004541313667012600211370ustar00schwarzeschwarzeDB-ARGS(1) General Commands Manual DB-ARGS(1) NNAAMMEE DDbb--aarrggss - obsolete debug macro DDEESSCCRRIIPPTTIIOONN no args one arg two args end of text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Db/args.out_lint010064400017530001753000000002261313667012600210120ustar00schwarzeschwarzemandoc: args.in:10:2: WARNING: obsolete macro: Db mandoc: args.in:12:2: WARNING: obsolete macro: Db mandoc: args.in:14:2: WARNING: obsolete macro: Db mandoc-1.14.6/regress/mdoc/Dd004075500017530001753000000000001412314056600162225ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Dd/Makefile010064400017530001753000000006541363444076700177570ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2020/01/19 16:16:33 schwarze Exp $ REGRESS_TARGETS = badarg dupe late long manarg noarg order LINT_TARGETS = badarg dupe late long manarg noarg order # groff-1.22.4 prints footer fields of excessive length on top of # each other rather than breaking the output line. SKIP_GROFF = long # Autodetection fails for late .Dd, so specify -mdoc explicitly. MOPTS = -mdoc .include mandoc-1.14.6/regress/mdoc/Dd/badarg.in010064400017530001753000000002571313667012600200550ustar00schwarzeschwarze.\" $OpenBSD: badarg.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd "bad date" .Dt DD-BADARG 1 .Os .Sh NAME .Nm Dd-badarg .Nd date cannot be parsed .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dd/badarg.out_ascii010064400017530001753000000004301304650512700214150ustar00schwarzeschwarzeDD-BADARG(1) General Commands Manual DD-BADARG(1) NNAAMMEE DDdd--bbaaddaarrgg - date cannot be parsed DDEESSCCRRIIPPTTIIOONN some text OpenBSD bad date OpenBSD mandoc-1.14.6/regress/mdoc/Dd/badarg.out_lint010064400017530001753000000002301363444076700213040ustar00schwarzeschwarzemandoc: badarg.in:2:5: WARNING: cannot parse date, using it verbatim: Dd bad date mandoc: badarg.in:2:5: STYLE: Mdocdate missing: Dd bad date (OpenBSD) mandoc-1.14.6/regress/mdoc/Dd/badarg.out_markdown010064400017530001753000000002041305706705700221550ustar00schwarzeschwarzeDD-BADARG(1) - General Commands Manual # NAME **Dd-badarg** - date cannot be parsed # DESCRIPTION some text OpenBSD - bad date mandoc-1.14.6/regress/mdoc/Dd/dupe.in010064400017530001753000000003401313667012600175630ustar00schwarzeschwarze.\" $OpenBSD: dupe.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd August 1, 2014 .Dt DD-DUPE 1 .Os .Dd August 3, 2014 .Sh NAME .Nm Dd-dupe .Nd duplicate date macro .Sh DESCRIPTION initial text .Dd August 5, 2014 final text mandoc-1.14.6/regress/mdoc/Dd/dupe.out_ascii010064400017530001753000000004371304650512700211410ustar00schwarzeschwarzeDD-DUPE(1) General Commands Manual DD-DUPE(1) NNAAMMEE DDdd--dduuppee - duplicate date macro DDEESSCCRRIIPPTTIIOONN initial text final text OpenBSD August 5, 2014 OpenBSD mandoc-1.14.6/regress/mdoc/Dd/dupe.out_lint010064400017530001753000000002751363444076700210320ustar00schwarzeschwarzemandoc: dupe.in:2:5: STYLE: Mdocdate missing: Dd August 1, 2014 (OpenBSD) mandoc: dupe.in:5:2: ERROR: duplicate prologue macro: Dd mandoc: dupe.in:11:2: ERROR: duplicate prologue macro: Dd mandoc-1.14.6/regress/mdoc/Dd/dupe.out_markdown010064400017530001753000000002231305706705700216730ustar00schwarzeschwarzeDD-DUPE(1) - General Commands Manual # NAME **Dd-dupe** - duplicate date macro # DESCRIPTION initial text final text OpenBSD - August 5, 2014 mandoc-1.14.6/regress/mdoc/Dd/late.in010064400017530001753000000002651313667012700175620ustar00schwarzeschwarze.\" $OpenBSD: late.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dt DD-LATE 1 .Os .Sh NAME .Nm Dd-late .Nd late date macro .Sh DESCRIPTION initial text .Dd August 5, 2014 final text mandoc-1.14.6/regress/mdoc/Dd/late.out_ascii010064400017530001753000000004321304650512700211240ustar00schwarzeschwarzeDD-LATE(1) General Commands Manual DD-LATE(1) NNAAMMEE DDdd--llaattee - late date macro DDEESSCCRRIIPPTTIIOONN initial text final text OpenBSD August 5, 2014 OpenBSD mandoc-1.14.6/regress/mdoc/Dd/late.out_lint010064400017530001753000000000661313667012700210100ustar00schwarzeschwarzemandoc: late.in:9:2: WARNING: late prologue macro: Dd mandoc-1.14.6/regress/mdoc/Dd/late.out_markdown010064400017530001753000000002161305706705700216650ustar00schwarzeschwarzeDD-LATE(1) - General Commands Manual # NAME **Dd-late** - late date macro # DESCRIPTION initial text final text OpenBSD - August 5, 2014 mandoc-1.14.6/regress/mdoc/Dd/long.in010064400017530001753000000003511313667012700175700ustar00schwarzeschwarze.\" $OpenBSD: long.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd 1234567890123456789012345678901234567890123456789012345678901234567890123456789 .Dt DD-LONG 1 .Os .Sh NAME .Nm Dd-long .Nd long date string .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dd/long.out_ascii010064400017530001753000000005451304650512700211430ustar00schwarzeschwarzeDD-LONG(1) General Commands Manual DD-LONG(1) NNAAMMEE DDdd--lloonngg - long date string DDEESSCCRRIIPPTTIIOONN some text OpenBSD 1234567890123456789012345678901234567890123456789012345678901234567890123456789 OpenBSD mandoc-1.14.6/regress/mdoc/Dd/long.out_lint010064400017530001753000000004421363444076700210300ustar00schwarzeschwarzemandoc: long.in:2:5: WARNING: cannot parse date, using it verbatim: Dd 1234567890123456789012345678901234567890123456789012345678901234567890123456789 mandoc: long.in:2:5: STYLE: Mdocdate missing: Dd 1234567890123456789012345678901234567890123456789012345678901234567890123456789 (OpenBSD) mandoc-1.14.6/regress/mdoc/Dd/long.out_markdown010064400017530001753000000003021305706705700216730ustar00schwarzeschwarzeDD-LONG(1) - General Commands Manual # NAME **Dd-long** - long date string # DESCRIPTION some text OpenBSD - 1234567890123456789012345678901234567890123456789012345678901234567890123456789 mandoc-1.14.6/regress/mdoc/Dd/manarg.in010064400017530001753000000002701313667012700200760ustar00schwarzeschwarze.\" $OpenBSD: manarg.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd 2014-08-07 .Dt DD-MANARG 1 .Os .Sh NAME .Nm Dd-manarg .Nd date in traditional man format .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dd/manarg.out_ascii010064400017530001753000000004411304650512700214440ustar00schwarzeschwarzeDD-MANARG(1) General Commands Manual DD-MANARG(1) NNAAMMEE DDdd--mmaannaarrgg - date in traditional man format DDEESSCCRRIIPPTTIIOONN some text OpenBSD 2014-08-07 OpenBSD mandoc-1.14.6/regress/mdoc/Dd/manarg.out_lint010064400017530001753000000002171363444076700213360ustar00schwarzeschwarzemandoc: manarg.in:2:5: STYLE: legacy man(7) date format: Dd 2014-08-07 mandoc: manarg.in:2:5: STYLE: Mdocdate missing: Dd 2014-08-07 (OpenBSD) mandoc-1.14.6/regress/mdoc/Dd/manarg.out_markdown010064400017530001753000000002171305706705700222060ustar00schwarzeschwarzeDD-MANARG(1) - General Commands Manual # NAME **Dd-manarg** - date in traditional man format # DESCRIPTION some text OpenBSD - 2014-08-07 mandoc-1.14.6/regress/mdoc/Dd/noarg.in010064400017530001753000000002521313667012700177370ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd .Dt DD-NOARG 1 .Os .Sh NAME .Nm Dd-noarg .Nd date macro without an argument .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dd/noarg.out_lint010064400017530001753000000000721363444076700211760ustar00schwarzeschwarzemandoc: noarg.in:2:2: WARNING: missing date, using "": Dd mandoc-1.14.6/regress/mdoc/Dd/order.in010064400017530001753000000002671313667012700177520ustar00schwarzeschwarze.\" $OpenBSD: order.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dt DD-ORDER 1 .Dd August 5, 2014 .Os .Sh NAME .Nm Dd-order .Nd date macro after title macro .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dd/order.out_ascii010064400017530001753000000004341304650512700213140ustar00schwarzeschwarzeDD-ORDER(1) General Commands Manual DD-ORDER(1) NNAAMMEE DDdd--oorrddeerr - date macro after title macro DDEESSCCRRIIPPTTIIOONN some text OpenBSD August 5, 2014 OpenBSD mandoc-1.14.6/regress/mdoc/Dd/order.out_lint010064400017530001753000000002241363444076700212020ustar00schwarzeschwarzemandoc: order.in:3:2: WARNING: prologue macros out of order: Dd after Dt mandoc: order.in:3:5: STYLE: Mdocdate missing: Dd August 5, 2014 (OpenBSD) mandoc-1.14.6/regress/mdoc/Dd/order.out_markdown010064400017530001753000000002171305706705700220540ustar00schwarzeschwarzeDD-ORDER(1) - General Commands Manual # NAME **Dd-order** - date macro after title macro # DESCRIPTION some text OpenBSD - August 5, 2014 mandoc-1.14.6/regress/mdoc/Dd/noarg.out_ascii010064400017530001753000000004361361110360400213010ustar00schwarzeschwarzeDD-NOARG(1) General Commands Manual DD-NOARG(1) NNAAMMEE DDdd--nnooaarrgg - date macro without an argument DDEESSCCRRIIPPTTIIOONN some text OpenBSD OpenBSD mandoc-1.14.6/regress/mdoc/Dd/noarg.out_markdown010064400017530001753000000002031361110360400220230ustar00schwarzeschwarzeDD-NOARG(1) - General Commands Manual # NAME **Dd-noarg** - date macro without an argument # DESCRIPTION some text OpenBSD - mandoc-1.14.6/regress/mdoc/Dl004075500017530001753000000000001412314056600162325ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Dl/Makefile010064400017530001753000000002741367274434100177620ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2020/04/19 16:26:11 schwarze Exp $ REGRESS_TARGETS = spacing TAG_TARGETS = spacing LINT_TARGETS = spacing HTML_TARGETS = spacing .include mandoc-1.14.6/regress/mdoc/Dl/spacing.in010064400017530001753000000005571367274434100203020ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.6 2020/04/19 16:26:11 schwarze Exp $ .Dd $Mdocdate: April 19 2020 $ .Dt DL-SPACING 1 .Os .Sh NAME .Nm Dl-spacing .Nd spacing in and around one-line literal displays .Sh DESCRIPTION BEGINTEST .Pp preceding text .Tg display .Dl spacing in and around one-line literal displays empty display: .Dl following text .br ENDTEST .br end of file mandoc-1.14.6/regress/mdoc/Dl/spacing.out_ascii010064400017530001753000000007131367274434100216450ustar00schwarzeschwarzeDL-SPACING(1) General Commands Manual DL-SPACING(1) NNAAMMEE DDll--ssppaacciinngg - spacing in and around one-line literal displays DDEESSCCRRIIPPTTIIOONN BEGINTEST preceding text spacing in and around one-line literal displays empty display: following text ENDTEST end of file OpenBSD April 19, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Dl/spacing.out_lint010064400017530001753000000000621367274434100215200ustar00schwarzeschwarzemandoc: spacing.in:15:2: WARNING: empty block: Dl mandoc-1.14.6/regress/mdoc/Dl/spacing.out_markdown010064400017530001753000000004401367274434100223740ustar00schwarzeschwarzeDL-SPACING(1) - General Commands Manual # NAME **Dl-spacing** - spacing in and around one-line literal displays # DESCRIPTION BEGINTEST preceding text spacing in and around one-line literal displays empty display: following text ENDTEST end of file OpenBSD - April 19, 2020 mandoc-1.14.6/regress/mdoc/Dl/spacing.out_html010064400017530001753000000004401364707700300215120ustar00schwarzeschwarze

preceding text

in and around one-line literal displays
empty display:
following text
mandoc-1.14.6/regress/mdoc/Dl/spacing.out_tag010064400017530001753000000001371372346556000213300ustar00schwarzeschwarzeNAME spacing.mandoc_ascii 3 DESCRIPTION spacing.mandoc_ascii 6 display spacing.mandoc_ascii 10 mandoc-1.14.6/regress/mdoc/Dq004075500017530001753000000000001412314056600162375ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Dq/Makefile010064400017530001753000000002151313667012700177550ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1.1.1 2011/12/04 03:09:25 schwarze Exp $ REGRESS_TARGETS = empty LINT_TARGETS = empty .include mandoc-1.14.6/regress/mdoc/Dq/empty.in010064400017530001753000000004351313667012700200070ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.5 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DQ-EMPTY 1 .Os .Sh NAME .Nm Dq-empty .Nd empty implicit enclosure macros .Sh DESCRIPTION An empty .Dq and a full .Dq "(" user@host) quotation. And another .Do "(" full) Dc one "Sy" bold . mandoc-1.14.6/regress/mdoc/Dq/empty.out_ascii010064400017530001753000000005621313667012700213610ustar00schwarzeschwarzeDQ-EMPTY(1) General Commands Manual DQ-EMPTY(1) NNAAMMEE DDqq--eemmppttyy - empty implicit enclosure macros DDEESSCCRRIIPPTTIIOONN An empty "" and a full ("user@host)" quotation. And another ("full)" one bboolldd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dq/empty.out_markdown010064400017530001753000000003311313667012700221050ustar00schwarzeschwarzeDQ-EMPTY(1) - General Commands Manual # NAME **Dq-empty** - empty implicit enclosure macros # DESCRIPTION An empty "" and a full ("user@host)" quotation. And another ("full)" one **bold**. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dq/empty.out_lint010064400017530001753000000000001312673155700212260ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Dt004075500017530001753000000000001412314056600162425ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Dt/Makefile010064400017530001753000000013661306010566300177620ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2015/02/16 19:02:32 schwarze Exp $ REGRESS_TARGETS = badsec case dupe fourargs late REGRESS_TARGETS += missing noarg nobody nosec order LINT_TARGETS = badsec case dupe fourargs late LINT_TARGETS += missing noarg nobody nosec order SKIP_GROFF = badsec nobody SKIP_ASCII = badsec SKIP_MARKDOWN ?= badsec # When the section is missing from the man(7) .TH title line, # empty parentheses are shown in the page header. # When the section is missing from the mdoc(7) .Dt title line, # no empty parentheses are shown in the page header. # Hence, there is no bug-compatible translation from mdoc(7) # to man(7) for this case. That's not mandoc(1)'s fault. SKIP_TMAN = fourargs late missing noarg nosec .include mandoc-1.14.6/regress/mdoc/Dt/badsec.in010064400017530001753000000003001313667012700200640ustar00schwarzeschwarze.\" $OpenBSD: badsec.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DT-BADSEC foo .Os .Sh NAME .Nm Dt-badsec .Nd unknown manual section .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dt/badsec.out_lint010064400017530001753000000001041313667012700213150ustar00schwarzeschwarzemandoc: badsec.in:3:15: WARNING: unknown manual section: Dt ... foo mandoc-1.14.6/regress/mdoc/Dt/case.in010064400017530001753000000003001313667012700175560ustar00schwarzeschwarze.\" $OpenBSD: case.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt Dt-case 1 .Os .Sh NAME .Nm Dt-case .Nd document title is not all caps .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dt/case.out_ascii010064400017530001753000000004331313667012700211360ustar00schwarzeschwarzeDt-case(1) General Commands Manual Dt-case(1) NNAAMMEE DDtt--ccaassee - document title is not all caps DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/case.out_lint010064400017530001753000000001171313667012700210130ustar00schwarzeschwarzemandoc: case.in:3:6: STYLE: lower case character in document title: Dt Dt-case mandoc-1.14.6/regress/mdoc/Dt/case.out_markdown010064400017530001753000000002151313667012700216660ustar00schwarzeschwarzeDt-case(1) - General Commands Manual # NAME **Dt-case** - document title is not all caps # DESCRIPTION some text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dt/dupe.in010064400017530001753000000003721313667012700176110ustar00schwarzeschwarze.\" $OpenBSD: dupe.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DT-FIRST 2 first_arch .Os .Dt DT-DUPE 1 .Sh NAME .Nm Dt-order .Nd duplicate prologue macro .Sh DESCRIPTION inital text .Dt DT-LAST 3 last_arch final text mandoc-1.14.6/regress/mdoc/Dt/dupe.out_ascii010064400017530001753000000004451313667012700211630ustar00schwarzeschwarzeDT-DUPE(1) General Commands Manual DT-DUPE(1) NNAAMMEE DDtt--oorrddeerr - duplicate prologue macro DDEESSCCRRIIPPTTIIOONN inital text final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/dupe.out_lint010064400017530001753000000001641313667012700210370ustar00schwarzeschwarzemandoc: dupe.in:5:2: ERROR: duplicate prologue macro: Dt mandoc: dupe.in:11:2: ERROR: skipping late title macro: Dt mandoc-1.14.6/regress/mdoc/Dt/dupe.out_markdown010064400017530001753000000002251313667012700217110ustar00schwarzeschwarzeDT-DUPE(1) - General Commands Manual # NAME **Dt-order** - duplicate prologue macro # DESCRIPTION inital text final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dt/fourargs.in010064400017530001753000000003411313667012700205000ustar00schwarzeschwarze.\" $OpenBSD: fourargs.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DT-FOURARGS 1 amd64 bogus .Os .Sh NAME .Nm Dt-fourargs .Nd too many arguments after the \&Dt macro .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dt/fourargs.out_ascii010064400017530001753000000004561313667012700220600ustar00schwarzeschwarzeDT-FOURARGS(1) General Commands Manual (amd64) DT-FOURARGS(1) NNAAMMEE DDtt--ffoouurraarrggss - too many arguments after the Dt macro DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/fourargs.out_lint010064400017530001753000000001111313667012700217220ustar00schwarzeschwarzemandoc: fourargs.in:3:25: ERROR: skipping excess arguments: Dt ... bogus mandoc-1.14.6/regress/mdoc/Dt/fourargs.out_markdown010064400017530001753000000002441313667012700226050ustar00schwarzeschwarzeDT-FOURARGS(1) - General Commands Manual (amd64) # NAME **Dt-fourargs** - too many arguments after the Dt macro # DESCRIPTION some text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dt/late.in010064400017530001753000000002771313667012700176050ustar00schwarzeschwarze.\" $OpenBSD: late.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Os .Sh NAME .Nm Dt-late .Nd late title macro .Sh DESCRIPTION inital text .Dt DT-LATE 1 final text mandoc-1.14.6/regress/mdoc/Dt/late.out_ascii010064400017530001753000000004321313667012700211470ustar00schwarzeschwarzeUNTITLED LOCAL UNTITLED NNAAMMEE DDtt--llaattee - late title macro DDEESSCCRRIIPPTTIIOONN inital text final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/late.out_lint010064400017530001753000000001761313667012700210320ustar00schwarzeschwarzemandoc: late.in:9:2: ERROR: skipping late title macro: Dt mandoc: late.in: WARNING: missing manual title, using UNTITLED: EOF mandoc-1.14.6/regress/mdoc/Dt/late.out_markdown010064400017530001753000000001701313667012700217000ustar00schwarzeschwarzeUNTITLED - LOCAL # NAME **Dt-late** - late title macro # DESCRIPTION inital text final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dt/missing.in010064400017530001753000000002571313667012700203270ustar00schwarzeschwarze.\" $OpenBSD: missing.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Os .Sh NAME .Nm Dt-missing .Nd no title macro at all .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dt/missing.out_ascii010064400017530001753000000004331313667012700216740ustar00schwarzeschwarzeUNTITLED LOCAL UNTITLED NNAAMMEE DDtt--mmiissssiinngg - no title macro at all DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/missing.out_lint010064400017530001753000000001071313667012700215500ustar00schwarzeschwarzemandoc: missing.in: WARNING: missing manual title, using UNTITLED: EOF mandoc-1.14.6/regress/mdoc/Dt/missing.out_markdown010064400017530001753000000001631313667012700224260ustar00schwarzeschwarzeUNTITLED - LOCAL # NAME **Dt-missing** - no title macro at all # DESCRIPTION some text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dt/noarg.in010064400017530001753000000002671313667012700177650ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt .Os .Sh NAME .Nm Dt-noarg .Nd title macro without arguments .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dt/noarg.out_ascii010064400017530001753000000004351313667012700213330ustar00schwarzeschwarzeUNTITLED LOCAL UNTITLED NNAAMMEE DDtt--nnooaarrgg - title macro without arguments DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/noarg.out_lint010064400017530001753000000002251313667012700212060ustar00schwarzeschwarzemandoc: noarg.in:3:2: WARNING: missing manual title, using UNTITLED: Dt mandoc: noarg.in:3:2: WARNING: missing manual section, using "": Dt UNTITLED mandoc-1.14.6/regress/mdoc/Dt/noarg.out_markdown010064400017530001753000000001711313667012700220620ustar00schwarzeschwarzeUNTITLED - LOCAL # NAME **Dt-noarg** - title macro without arguments # DESCRIPTION some text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dt/nobody.in010064400017530001753000000001621313667012700201430ustar00schwarzeschwarze.\" $OpenBSD: nobody.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DT-NOBODY 1 .Os mandoc-1.14.6/regress/mdoc/Dt/nobody.out_ascii010064400017530001753000000002371313667012700215170ustar00schwarzeschwarzeDT-NOBODY(1) General Commands Manual DT-NOBODY(1) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/nobody.out_lint010064400017530001753000000000551313667012700213730ustar00schwarzeschwarzemandoc: nobody.in: WARNING: no document body mandoc-1.14.6/regress/mdoc/Dt/nobody.out_markdown010064400017530001753000000000771313667012700222530ustar00schwarzeschwarzeDT-NOBODY(1) - General Commands Manual OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dt/nosec.in010064400017530001753000000003051313667012700177570ustar00schwarzeschwarze.\" $OpenBSD: nosec.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DT-NOSEC .Os .Sh NAME .Nm Dt-nosec .Nd title macro without manual section .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dt/nosec.out_ascii010064400017530001753000000004421313667012700213320ustar00schwarzeschwarzeDT-NOSEC LOCAL DT-NOSEC NNAAMMEE DDtt--nnoosseecc - title macro without manual section DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/nosec.out_lint010064400017530001753000000001151313667012700212050ustar00schwarzeschwarzemandoc: nosec.in:3:2: WARNING: missing manual section, using "": Dt DT-NOSEC mandoc-1.14.6/regress/mdoc/Dt/nosec.out_markdown010064400017530001753000000001761313667012700220700ustar00schwarzeschwarzeDT-NOSEC - LOCAL # NAME **Dt-nosec** - title macro without manual section # DESCRIPTION some text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dt/order.in010064400017530001753000000003011313667012700177570ustar00schwarzeschwarze.\" $OpenBSD: order.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Os .Dt DT-ORDER 1 .Sh NAME .Nm Dt-order .Nd prologue macros out of order .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Dt/order.out_ascii010064400017530001753000000004341313667012700213370ustar00schwarzeschwarzeDT-ORDER(1) General Commands Manual DT-ORDER(1) NNAAMMEE DDtt--oorrddeerr - prologue macros out of order DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dt/order.out_lint010064400017530001753000000001111313667012700212050ustar00schwarzeschwarzemandoc: order.in:4:2: WARNING: prologue macros out of order: Dt after Os mandoc-1.14.6/regress/mdoc/Dt/order.out_markdown010064400017530001753000000002151313667012700220660ustar00schwarzeschwarzeDT-ORDER(1) - General Commands Manual # NAME **Dt-order** - prologue macros out of order # DESCRIPTION some text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dv004075500017530001753000000000001412314056600162445ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Dv/Makefile010064400017530001753000000002651363444077000177710ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.5 2020/03/13 00:31:05 schwarze Exp $ REGRESS_TARGETS = font noarg tag TAG_TARGETS = tag LINT_TARGETS = noarg HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Dv/font.in010064400017530001753000000004131313667012700176200ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.5 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DV-FONT 1 .Os .Sh NAME .Nm Dv-font .Nd formatting of defined variables .Sh DESCRIPTION The .Dv BUFSIZ macro. .Pp And with .Dv some \\fIembedded\\fP string ";" "Sy" bold . mandoc-1.14.6/regress/mdoc/Dv/font.out_ascii010064400017530001753000000005471313667012700212010ustar00schwarzeschwarzeDV-FONT(1) General Commands Manual DV-FONT(1) NNAAMMEE DDvv--ffoonntt - formatting of defined variables DDEESSCCRRIIPPTTIIOONN The BUFSIZ macro. And with some _e_m_b_e_d_d_e_d string; bboolldd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dv/font.out_markdown010064400017530001753000000003041313667012700217220ustar00schwarzeschwarzeDV-FONT(1) - General Commands Manual # NAME **Dv-font** - formatting of defined variables # DESCRIPTION The `BUFSIZ` macro. And with `some embedded string`; **bold**. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dv/noarg.in010064400017530001753000000004041313667012700177600ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DV-NOARG 1 .Os .Sh NAME .Nm Dv-noarg .Nd defined variable macro without an argument .Sh DESCRIPTION with variable: .Dv NULL. no variable: .Dv end of test document mandoc-1.14.6/regress/mdoc/Dv/noarg.out_ascii010064400017530001753000000005271313667012700213370ustar00schwarzeschwarzeDV-NOARG(1) General Commands Manual DV-NOARG(1) NNAAMMEE DDvv--nnooaarrgg - defined variable macro without an argument DDEESSCCRRIIPPTTIIOONN with variable: NULL. no variable: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Dv/noarg.out_lint010064400017530001753000000002041313667012700212050ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Dv mandoc: noarg.in:10:9: STYLE: no blank before trailing delimiter: Dv NULL. mandoc-1.14.6/regress/mdoc/Dv/noarg.out_markdown010064400017530001753000000003121313667012700220610ustar00schwarzeschwarzeDV-NOARG(1) - General Commands Manual # NAME **Dv-noarg** - defined variable macro without an argument # DESCRIPTION with variable: `NULL.` no variable: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Dv/tag.in010064400017530001753000000004431363272362500174330ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt DV-TAG 1 .Os .Sh NAME .Nm Dv-tag .Nd tagging of defined variable macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Dv one | two text .It Xo .Dv three .Xc text .El .Tg .Dv four .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Dv/tag.out_ascii010064400017530001753000000005511363272362500210040ustar00schwarzeschwarzeDV-TAG(1) General Commands Manual DV-TAG(1) NNAAMMEE DDvv--ttaagg - tagging of defined variable macros DDEESSCCRRIIPPTTIIOONN BEGINTEST one | two text three text four ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Dv/tag.out_html010064400017530001753000000006131367274434100206610ustar00schwarzeschwarze
|
text
text
mandoc-1.14.6/regress/mdoc/Dv/tag.out_markdown010064400017530001753000000003121363272362500215310ustar00schwarzeschwarzeDV-TAG(1) - General Commands Manual # NAME **Dv-tag** - tagging of defined variable macros # DESCRIPTION BEGINTEST `one` | `two` > text `three` > text `four` ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Dv/tag.out_tag010064400017530001753000000002301372346556000204630ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three tag.mandoc_ascii 12 four tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Em004075500017530001753000000000001412314056600162345ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Em/Makefile010064400017530001753000000003011363444077000177500ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2020/03/13 00:31:05 schwarze Exp $ REGRESS_TARGETS = font noarg punct tag TAG_TARGETS = tag LINT_TARGETS = noarg punct HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Em/font.in010064400017530001753000000003671313667012700176200ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EM-FONT 1 .Os .Sh NAME .Nm Em-font .Nd changing fonts inside the emphasis macro .Sh DESCRIPTION normal text .Em emphasis\\fBbold\\fPback trailing text mandoc-1.14.6/regress/mdoc/Em/font.out_ascii010064400017530001753000000005461313667012700211700ustar00schwarzeschwarzeEM-FONT(1) General Commands Manual EM-FONT(1) NNAAMMEE EEmm--ffoonntt - changing fonts inside the emphasis macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Em/font.out_markdown010064400017530001753000000002761313667012700217220ustar00schwarzeschwarzeEM-FONT(1) - General Commands Manual # NAME **Em-font** - changing fonts inside the emphasis macro # DESCRIPTION normal text *emphasis**bold**back* trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Em/noarg.in010064400017530001753000000003661313667012700177570ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EM-NOARG 1 .Os .Sh NAME .Nm Em-noarg .Nd emphasis macro without arguments .Sh DESCRIPTION with argument .Em arg no argument .Em end of test document mandoc-1.14.6/regress/mdoc/Em/noarg.out_ascii010064400017530001753000000005171313667012700213260ustar00schwarzeschwarzeEM-NOARG(1) General Commands Manual EM-NOARG(1) NNAAMMEE EEmm--nnooaarrgg - emphasis macro without arguments DDEESSCCRRIIPPTTIIOONN with argument _a_r_g no argument end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Em/noarg.out_lint010064400017530001753000000000711313667012700211770ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Em mandoc-1.14.6/regress/mdoc/Em/noarg.out_markdown010064400017530001753000000002741313667012700220600ustar00schwarzeschwarzeEM-NOARG(1) - General Commands Manual # NAME **Em-noarg** - emphasis macro without arguments # DESCRIPTION with argument *arg* no argument end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Em/punct.in010064400017530001753000000021361313667012700177770ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EM-PUNCT 1 .Os .Sh NAME .Nm Em-punct .Nd punctuation following an emphasis macro .Sh DESCRIPTION Leading punctuation: .Em ( b .Em "[" b .Em | b .Em . b .Em , b .Em ; b .Em : b .Em ? b .Em ! b .Em ) b .Em "]" b .Pp Trailing punctuation: .Em a ( .Em a [ .Em a | .Em a . .Em a , .Em a ; .Em a : .Em a ? .Em a ! .Em a ")" .Em a ] .Pp Middle punctuation: .Em a ( b .Em a [ b .Em a "|" b .Em a . b .Em a , b .Em a ; b .Em a ":" b .Em a ? b .Em a ! b .Em a ) b .Em a ] b .Pp Isolated punctuation: .Em a Em ( Em b .Em a Em [ Em b .Em a Em | Em b .Em a Em . Em b .Em a Em , Em b .Em a Em ; Em b .Em a Em : Em b .Em a Em ? Em b .Em a Em ! Em b .Em a Em ) Em b .Em a Em ] Em b .Pp Isolated trailing punctuation: .Em a Em ( .Em a Em [ .Em a Em | .Em a Em . .Em a Em , .Em a Em ; .Em a Em : .Em a Em ? .Em a Em ! .Em a Em ) .Em a Em ] .Pp Multiple isolated punctuation: .Em a Em ( [ Em b .Em a Em ) ] Em b .Pp Multiple punctuation: .Em [ ( arg ) ] . .Pp Quoted: .Em "a . b Nm" "Sy" bold .Em ". b Nm" .Em "." .Pp Missing blank: .Em a. mandoc-1.14.6/regress/mdoc/Em/punct.out_ascii010064400017530001753000000020121313667012700213410ustar00schwarzeschwarzeEM-PUNCT(1) General Commands Manual EM-PUNCT(1) NNAAMMEE EEmm--ppuunncctt - punctuation following an emphasis macro DDEESSCCRRIIPPTTIIOONN Leading punctuation: (_b [_b | _b . _b , _b ; _b : _b ? _b ! _b ) _b ] _b Trailing punctuation: _a ( _a [ _a | _a. _a, _a; _a: _a? _a! _a) _a] Middle punctuation: _a (_b _a [_b _a | _b _a. _b _a, _b _a; _b _a: _b _a? _b _a! _b _a) _b _a] _b Isolated punctuation: _a (_b _a [_b _a | _b _a . _b _a , _b _a ; _b _a : _b _a ? _b _a ! _b _a ) _b _a ] _b Isolated trailing punctuation: _a ( _a [ _a | _a . _a , _a ; _a : _a ? _a ! _a ) _a ] Multiple isolated punctuation: _a ([_b _a )] _b Multiple punctuation: [(_a_r_g)]. Quoted: _a _. _b _N_m bboolldd _. _b _N_m . Missing blank: _a_. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Em/punct.out_lint010064400017530001753000000027311313667012700212270ustar00schwarzeschwarzemandoc: punct.in:49:7: WARNING: skipping empty macro: Em mandoc: punct.in:50:7: WARNING: skipping empty macro: Em mandoc: punct.in:51:7: WARNING: skipping empty macro: Em mandoc: punct.in:52:7: WARNING: skipping empty macro: Em mandoc: punct.in:53:7: WARNING: skipping empty macro: Em mandoc: punct.in:54:7: WARNING: skipping empty macro: Em mandoc: punct.in:55:7: WARNING: skipping empty macro: Em mandoc: punct.in:56:7: WARNING: skipping empty macro: Em mandoc: punct.in:57:7: WARNING: skipping empty macro: Em mandoc: punct.in:58:7: WARNING: skipping empty macro: Em mandoc: punct.in:59:7: WARNING: skipping empty macro: Em mandoc: punct.in:62:7: WARNING: skipping empty macro: Em mandoc: punct.in:63:7: WARNING: skipping empty macro: Em mandoc: punct.in:64:7: WARNING: skipping empty macro: Em mandoc: punct.in:65:7: WARNING: skipping empty macro: Em mandoc: punct.in:66:7: WARNING: skipping empty macro: Em mandoc: punct.in:67:7: WARNING: skipping empty macro: Em mandoc: punct.in:68:7: WARNING: skipping empty macro: Em mandoc: punct.in:69:7: WARNING: skipping empty macro: Em mandoc: punct.in:70:7: WARNING: skipping empty macro: Em mandoc: punct.in:71:7: WARNING: skipping empty macro: Em mandoc: punct.in:72:7: WARNING: skipping empty macro: Em mandoc: punct.in:75:7: WARNING: skipping empty macro: Em mandoc: punct.in:76:7: WARNING: skipping empty macro: Em mandoc: punct.in:84:2: WARNING: skipping empty macro: Em mandoc: punct.in:87:6: STYLE: no blank before trailing delimiter: Em a. mandoc-1.14.6/regress/mdoc/Em/punct.out_markdown010064400017530001753000000014551313667012700221050ustar00schwarzeschwarzeEM-PUNCT(1) - General Commands Manual # NAME **Em-punct** - punctuation following an emphasis macro # DESCRIPTION Leading punctuation: (*b* \[*b* | *b* . *b* , *b* ; *b* : *b* ? *b* ! *b* ) *b* ] *b* Trailing punctuation: *a* ( *a* \[ *a* | *a*. *a*, *a*; *a*: *a*? *a*! *a*) *a*] Middle punctuation: *a* (*b* *a* \[*b* *a* | *b* *a*. *b* *a*, *b* *a*; *b* *a*: *b* *a*? *b* *a*! *b* *a*) *b* *a*] *b* Isolated punctuation: *a* (*b* *a* \[*b* *a* | *b* *a* . *b* *a* , *b* *a* ; *b* *a* : *b* *a* ? *b* *a* ! *b* *a* ) *b* *a* ] *b* Isolated trailing punctuation: *a* ( *a* \[ *a* | *a* . *a* , *a* ; *a* : *a* ? *a* ! *a* ) *a* ] Multiple isolated punctuation: *a* (\[*b* *a* )] *b* Multiple punctuation: \[(*arg*)]. Quoted: *a . b Nm* **bold** *. b Nm* . Missing blank: *a.* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Em/tag.in010064400017530001753000000005011367274434100174200ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.2 2020/04/02 14:55:29 schwarze Exp $ .Dd $Mdocdate: April 2 2020 $ .Dt EM-TAG 1 .Os .Sh NAME .Nm Em-tag .Nd tagging of emphasis macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Em one | two text .It Xo .Em three-with-hyphens .Xc text .El .Em four .Em one .Tg explicit .Em five .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Em/tag.out_ascii010064400017530001753000000007101367274434100207730ustar00schwarzeschwarzeEM-TAG(1) General Commands Manual EM-TAG(1) NNAAMMEE EEmm--ttaagg - tagging of emphasis macros DDEESSCCRRIIPPTTIIOONN BEGINTEST _o_n_e | _t_w_o text _t_h_r_e_e_-_w_i_t_h_-_h_y_p_h_e_n_s text _f_o_u_r _o_n_e _f_i_v_e ENDTEST OpenBSD April 2, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Em/tag.out_html010064400017530001753000000007771367274434100206640ustar00schwarzeschwarze
|
text
text
one mandoc-1.14.6/regress/mdoc/Em/tag.out_markdown010064400017530001753000000003331367274434100215260ustar00schwarzeschwarzeEM-TAG(1) - General Commands Manual # NAME **Em-tag** - tagging of emphasis macros # DESCRIPTION BEGINTEST *one* | *two* > text *three-with-hyphens* > text *four* *one* *five* ENDTEST OpenBSD - April 2, 2020 mandoc-1.14.6/regress/mdoc/Em/tag.out_tag010064400017530001753000000003021372346556000204530ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three-with-hyphens tag.mandoc_ascii 12 four tag.mandoc_ascii 14 explicit tag.mandoc_ascii 14 mandoc-1.14.6/regress/mdoc/Eo004075500017530001753000000000001412314056600162365ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Eo/Makefile010064400017530001753000000004611341026767400177630ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2018/12/21 16:58:49 schwarze Exp $ REGRESS_TARGETS = arg break empty obsolete unclosed UTF8_TARGETS = arg LINT_TARGETS = break obsolete unclosed # groff-1.22.3 defect: # - When .Ec is missing, groff prints no page footer. SKIP_GROFF = unclosed .include mandoc-1.14.6/regress/mdoc/Eo/break.in010064400017530001753000000007721313667012700177400ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EO-BREAK 1 .Os .Sh NAME .Nm Eo-break .Nd breaking a custom enclosure block .Sh DESCRIPTION break .Eo << eo .Bo bo ec .Ec >> bc .Bc no closing .Eo << eo .Bo bo ec .Ec bc .Bc no content .Eo << .Bo .Ec >> bc .Bc opening only .Eo << .Bo .Ec bc .Bc broken .Bo bo .Eo << eo bc .Bc ec .Ec >> no content .Bo bo .Eo << .Bc .Ec >> no opening .Bo bo .Eo eo bc .Bc ec .Ec >> closing only .Bo bo .Eo .Bc .Ec >> final text mandoc-1.14.6/regress/mdoc/Eo/break.out_ascii010064400017530001753000000007471313667012700213130ustar00schwarzeschwarzeEO-BREAK(1) General Commands Manual EO-BREAK(1) NNAAMMEE EEoo--bbrreeaakk - breaking a custom enclosure block DDEESSCCRRIIPPTTIIOONN break <> bc] no closing <> bc] opening only <<[ bc] broken [bo <> no content [bo <<]>> no opening [bo eo bc] ec>> closing only [bo ]>> final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Eo/break.out_lint010064400017530001753000000010201313667012700211520ustar00schwarzeschwarzemandoc: break.in:15:2: WARNING: blocks badly nested: Eo breaks Bo mandoc: break.in:24:2: WARNING: blocks badly nested: Eo breaks Bo mandoc: break.in:30:2: WARNING: blocks badly nested: Eo breaks Bo mandoc: break.in:36:2: WARNING: blocks badly nested: Eo breaks Bo mandoc: break.in:45:2: WARNING: blocks badly nested: Bo breaks Eo mandoc: break.in:52:2: WARNING: blocks badly nested: Bo breaks Eo mandoc: break.in:60:2: WARNING: blocks badly nested: Bo breaks Eo mandoc: break.in:67:2: WARNING: blocks badly nested: Bo breaks Eo mandoc-1.14.6/regress/mdoc/Eo/break.out_markdown010064400017530001753000000006361313667012700220420ustar00schwarzeschwarzeEO-BREAK(1) - General Commands Manual # NAME **Eo-break** - breaking a custom enclosure block # DESCRIPTION break <<eo \[bo ec>> bc] no closing <<eo \[bo ec bc] no content <<\[>> bc] opening only <<\[ bc] broken \[bo <<eo bc] ec>> no content \[bo <<]>> no opening \[bo eo bc] ec>> closing only \[bo ]>> final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Eo/empty.in010064400017530001753000000011041313667012700200000ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.5 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EO-EMPTY 1 .Os .Sh NAME .Nm Eo-empty .Nd empty implicit enclosure macros .Sh DESCRIPTION completely empty .Eo .Ec closing only .Eo .Ec >> content only .Eo text .Ec opening only .Eo << .Ec no opening .Eo text .Ec >> no content .Eo << .Ec >> no closing .Eo << text .Ec all .Eo << text .Ec >> "Sy" bold completely empty .No prefix Ns Eo .Ec closing only .No prefix Ns Eo .Ec >> no opening .No prefix Ns Eo text .Ec >> no closing .Eo << .No prefix Ns Ec stray closing .Ec >> end of file mandoc-1.14.6/regress/mdoc/Eo/empty.out_ascii010064400017530001753000000010621313667012700213540ustar00schwarzeschwarzeEO-EMPTY(1) General Commands Manual EO-EMPTY(1) NNAAMMEE EEoo--eemmppttyy - empty implicit enclosure macros DDEESSCCRRIIPPTTIIOONN completely empty closing only >> content only text opening only << no opening text>> no content <<>> no closing <> bboolldd completely empty prefix closing only prefix>> no opening prefixtext>> no closing <> end of file OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Eo/empty.out_markdown010064400017530001753000000007231313667012700221110ustar00schwarzeschwarzeEO-EMPTY(1) - General Commands Manual # NAME **Eo-empty** - empty implicit enclosure macros # DESCRIPTION completely empty closing only >> content only text opening only << no opening text>> no content <<>> no closing <<text all <<text>> **bold** completely empty prefixclosing only prefix>> no opening prefixtext>> no closing <<prefix stray closing >> end of file OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Eo/obsolete.in010064400017530001753000000005731313667012700204670ustar00schwarzeschwarze.\" $OpenBSD: obsolete.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EO-OBSOLETE 1 .Os .Sh NAME .Nm Eo-obsolete .Nd obsolete enclosure macros .Sh DESCRIPTION .En no prior \&Es .Pp .Es << >> surplus initial text .En enclosed words with Fl flags middle text .En "(" more enclosed words final text .Pp .Es initial text .En after empty \&Es final text mandoc-1.14.6/regress/mdoc/Eo/obsolete.out_ascii010064400017530001753000000007141313667012700220350ustar00schwarzeschwarzeEO-OBSOLETE(1) General Commands Manual EO-OBSOLETE(1) NNAAMMEE EEoo--oobbssoolleettee - obsolete enclosure macros DDEESSCCRRIIPPTTIIOONN no prior Es surplus initial text <> middle text (<> final text initial text after empty Es final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Eo/obsolete.out_lint010064400017530001753000000005031313667012700217070ustar00schwarzeschwarzemandoc: obsolete.in:9:2: WARNING: obsolete macro: En mandoc: obsolete.in:11:2: WARNING: obsolete macro: Es mandoc: obsolete.in:13:2: WARNING: obsolete macro: En mandoc: obsolete.in:15:2: WARNING: obsolete macro: En mandoc: obsolete.in:18:2: WARNING: obsolete macro: Es mandoc: obsolete.in:20:2: WARNING: obsolete macro: En mandoc-1.14.6/regress/mdoc/Eo/obsolete.out_markdown010064400017530001753000000004731313667012700225710ustar00schwarzeschwarzeEO-OBSOLETE(1) - General Commands Manual # NAME **Eo-obsolete** - obsolete enclosure macros # DESCRIPTION no prior Es surplus initial text <<enclosed words with **-flags**>> middle text (<<more enclosed words>> final text initial text after empty Es final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Eo/unclosed.in010064400017530001753000000003271313667012700204640ustar00schwarzeschwarze.\" $OpenBSD: unclosed.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EO-UNCLOSED 1 .Os .Sh NAME .Nm Eo-unclosed .Nd unclosed custom enclosure block .Sh DESCRIPTION before block .Eo << mandoc-1.14.6/regress/mdoc/Eo/unclosed.out_ascii010064400017530001753000000004561313667012700220400ustar00schwarzeschwarzeEO-UNCLOSED(1) General Commands Manual EO-UNCLOSED(1) NNAAMMEE EEoo--uunncclloosseedd - unclosed custom enclosure block DDEESSCCRRIIPPTTIIOONN before block << OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Eo/unclosed.out_lint010064400017530001753000000001041313667012700217040ustar00schwarzeschwarzemandoc: unclosed.in:10:2: ERROR: appending missing end of block: Eo mandoc-1.14.6/regress/mdoc/Eo/unclosed.out_markdown010064400017530001753000000002421313667012700225630ustar00schwarzeschwarzeEO-UNCLOSED(1) - General Commands Manual # NAME **Eo-unclosed** - unclosed custom enclosure block # DESCRIPTION before block << OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Eo/arg.in010064400017530001753000000005641340721765200174250ustar00schwarzeschwarze.\" $OpenBSD: arg.in,v 1.1 2018/12/21 16:58:49 schwarze Exp $ .Dd $Mdocdate: December 21 2018 $ .Dt EO-ARG 1 .Os .Sh NAME .Nm Eo-arg .Nd escapes in arguments of enclosure macros .Sh DESCRIPTION .ds o \(Fo .ds c \(Fc .Eo \*o unquoted unescaped .Ec \*c .Pp .Eo "\*o" quoted unescaped .Ec "\*c" .Pp .Eo \\*o unquoted escaped .Ec \\*c .Pp .Eo "\\*o" quoted escaped .Ec "\\*c" mandoc-1.14.6/regress/mdoc/Eo/arg.out_ascii010064400017530001753000000005761340721765200210010ustar00schwarzeschwarzeEO-ARG(1) General Commands Manual EO-ARG(1) NNAAMMEE EEoo--aarrgg - escapes in arguments of enclosure macros DDEESSCCRRIIPPTTIIOONN <> <> <> <> OpenBSD December 21, 2018 OpenBSD mandoc-1.14.6/regress/mdoc/Eo/arg.out_markdown010064400017530001753000000004071340721765200215240ustar00schwarzeschwarzeEO-ARG(1) - General Commands Manual # NAME **Eo-arg** - escapes in arguments of enclosure macros # DESCRIPTION «unquoted unescaped» «quoted unescaped» «unquoted escaped» «quoted escaped» OpenBSD - December 21, 2018 mandoc-1.14.6/regress/mdoc/Eo/arg.out_utf8010064400017530001753000000006001340721765200205630ustar00schwarzeschwarzeEO-ARG(1) General Commands Manual EO-ARG(1) NNAAMMEE EEoo--aarrgg – escapes in arguments of enclosure macros DDEESSCCRRIIPPTTIIOONN «unquoted unescaped» «quoted unescaped» «unquoted escaped» «quoted escaped» OpenBSD December 21, 2018 OpenBSD mandoc-1.14.6/regress/mdoc/Er004075500017530001753000000000001412314056600162415ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Er/Makefile010064400017530001753000000002651363444077000177660ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2020/03/13 00:31:05 schwarze Exp $ REGRESS_TARGETS = noarg font tag TAG_TARGETS = tag LINT_TARGETS = noarg HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Er/font.in010064400017530001753000000003731313667012700176220ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ER-FONT 1 .Os .Sh NAME .Nm Er-font .Nd changing fonts inside the error code macro .Sh DESCRIPTION normal text .Er EFONT\\fIemphasis\\fPEBACK trailing text mandoc-1.14.6/regress/mdoc/Er/font.out_ascii010064400017530001753000000005321313667012700211700ustar00schwarzeschwarzeER-FONT(1) General Commands Manual ER-FONT(1) NNAAMMEE EErr--ffoonntt - changing fonts inside the error code macro DDEESSCCRRIIPPTTIIOONN normal text EFONT_e_m_p_h_a_s_i_sEBACK trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Er/font.out_markdown010064400017530001753000000002761313667012700217270ustar00schwarzeschwarzeER-FONT(1) - General Commands Manual # NAME **Er-font** - changing fonts inside the error code macro # DESCRIPTION normal text `EFONTemphasisEBACK` trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Er/noarg.in010064400017530001753000000004261313667012700177610ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.5 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ER-NOARG 1 .Os .Sh NAME .Nm Er-noarg .Nd error constant macro without an argument .Sh DESCRIPTION with error: .Er ENOENT ";" "Sy" bold ; .Er EIO. no error: .Er end of test document mandoc-1.14.6/regress/mdoc/Er/noarg.out_ascii010064400017530001753000000005441313667012700213330ustar00schwarzeschwarzeER-NOARG(1) General Commands Manual ER-NOARG(1) NNAAMMEE EErr--nnooaarrgg - error constant macro without an argument DDEESSCCRRIIPPTTIIOONN with error: ENOENT; bboolldd; EIO. no error: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Er/noarg.out_lint010064400017530001753000000002031313667012700212010ustar00schwarzeschwarzemandoc: noarg.in:13:2: WARNING: skipping empty macro: Er mandoc: noarg.in:11:8: STYLE: no blank before trailing delimiter: Er EIO. mandoc-1.14.6/regress/mdoc/Er/noarg.out_markdown010064400017530001753000000003251313667012700220620ustar00schwarzeschwarzeER-NOARG(1) - General Commands Manual # NAME **Er-noarg** - error constant macro without an argument # DESCRIPTION with error: `ENOENT`; **bold**; `EIO.` no error: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Er/tag.in010064400017530001753000000004621363272362700174330ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt ER-TAG 1 .Os .Sh NAME .Nm Er-tag .Nd tagging of error number macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Er one text .El .Tg .Er two .Sh ERRORS .Bl -tag -width Er .It Bq Er ENOENT text .El ENDTEST mandoc-1.14.6/regress/mdoc/Er/tag.out_ascii010064400017530001753000000005621363272362700210050ustar00schwarzeschwarzeER-TAG(1) General Commands Manual ER-TAG(1) NNAAMMEE EErr--ttaagg - tagging of error number macros DDEESSCCRRIIPPTTIIOONN BEGINTEST one text two EERRRROORRSS [ENOENT] text ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Er/tag.out_html010064400017530001753000000006241367274434200206610ustar00schwarzeschwarze
one
text

[]
text
mandoc-1.14.6/regress/mdoc/Er/tag.out_markdown010064400017530001753000000003131363272362700215310ustar00schwarzeschwarzeER-TAG(1) - General Commands Manual # NAME **Er-tag** - tagging of error number macros # DESCRIPTION BEGINTEST `one` > text `two` # ERRORS \[`ENOENT`] > text ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Er/tag.out_tag010064400017530001753000000002051372346556000204620ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 two tag.mandoc_ascii 10 ERRORS tag.mandoc_ascii 12 ENOENT tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Ev004075500017530001753000000000001412314056600162455ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ev/Makefile010064400017530001753000000002651363444077000177720ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.5 2020/03/13 00:31:05 schwarze Exp $ REGRESS_TARGETS = font noarg tag TAG_TARGETS = tag LINT_TARGETS = noarg HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Ev/font.in010064400017530001753000000004171313667012700176250ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.5 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EV-FONT 1 .Os .Sh NAME .Nm Ev-font .Nd formatting of environment variables .Sh DESCRIPTION The .Ev PATH variable. .Pp And with .Ev some \\fIembedded\\fP string ";" "Sy" bold. mandoc-1.14.6/regress/mdoc/Ev/font.out_ascii010064400017530001753000000005561313667012700212020ustar00schwarzeschwarzeEV-FONT(1) General Commands Manual EV-FONT(1) NNAAMMEE EEvv--ffoonntt - formatting of environment variables DDEESSCCRRIIPPTTIIOONN The PATH variable. And with some _e_m_b_e_d_d_e_d string; bboolldd.. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ev/font.out_markdown010064400017530001753000000003111313667012700217210ustar00schwarzeschwarzeEV-FONT(1) - General Commands Manual # NAME **Ev-font** - formatting of environment variables # DESCRIPTION The `PATH` variable. And with `some embedded string`; **bold.** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ev/noarg.in010064400017530001753000000004101313667012700177560ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EV-NOARG 1 .Os .Sh NAME .Nm Ev-noarg .Nd environment variable macro without an argument .Sh DESCRIPTION with variable: .Ev HOME. no variable: .Ev end of test document mandoc-1.14.6/regress/mdoc/Ev/noarg.out_ascii010064400017530001753000000005331313667012700213350ustar00schwarzeschwarzeEV-NOARG(1) General Commands Manual EV-NOARG(1) NNAAMMEE EEvv--nnooaarrgg - environment variable macro without an argument DDEESSCCRRIIPPTTIIOONN with variable: HOME. no variable: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ev/noarg.out_lint010064400017530001753000000002041313667012700212060ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Ev mandoc: noarg.in:10:9: STYLE: no blank before trailing delimiter: Ev HOME. mandoc-1.14.6/regress/mdoc/Ev/noarg.out_markdown010064400017530001753000000003161313667012700220660ustar00schwarzeschwarzeEV-NOARG(1) - General Commands Manual # NAME **Ev-noarg** - environment variable macro without an argument # DESCRIPTION with variable: `HOME.` no variable: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ev/tag.in010064400017530001753000000004471363272363000174340ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt EV-TAG 1 .Os .Sh NAME .Nm Ev-tag .Nd tagging of environment variable macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Ev one | two text .It Xo .Ev three .Xc text .El .Tg .Ev four .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Ev/tag.out_ascii010064400017530001753000000005551363272363000210050ustar00schwarzeschwarzeEV-TAG(1) General Commands Manual EV-TAG(1) NNAAMMEE EEvv--ttaagg - tagging of environment variable macros DDEESSCCRRIIPPTTIIOONN BEGINTEST one | two text three text four ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Ev/tag.out_html010064400017530001753000000006131367274434200206630ustar00schwarzeschwarze
|
text
text
mandoc-1.14.6/regress/mdoc/Ev/tag.out_markdown010064400017530001753000000003161363272363000215320ustar00schwarzeschwarzeEV-TAG(1) - General Commands Manual # NAME **Ev-tag** - tagging of environment variable macros # DESCRIPTION BEGINTEST `one` | `two` > text `three` > text `four` ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Ev/tag.out_tag010064400017530001753000000002301372346556000204640ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three tag.mandoc_ascii 12 four tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Ex004075500017530001753000000000001412314056600162475ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ex/Makefile010064400017530001753000000003611306010567000177570ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2014/08/14 02:00:53 schwarze Exp $ REGRESS_TARGETS = args noname nostd LINT_TARGETS = noname nostd # groff-1.22.2 defect: # - .Ex without -std produces no output SKIP_GROFF = nostd .include mandoc-1.14.6/regress/mdoc/Ex/args.in010064400017530001753000000004231313667012700176120ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EX-ARGS 1 .Os .Sh NAME .Nm Ex-args .Nd arguments to the exit value macro .Sh EXIT STATUS no arguments: .Ex -std .Pp one argument: .Ex -std one .Pp two arguments: .Ex -std one two mandoc-1.14.6/regress/mdoc/Ex/args.out_ascii010064400017530001753000000011021313667012700211560ustar00schwarzeschwarzeEX-ARGS(1) General Commands Manual EX-ARGS(1) NNAAMMEE EExx--aarrggss - arguments to the exit value macro EEXXIITT SSTTAATTUUSS no arguments: The EExx--aarrggss utility exits 0 on success, and >0 if an error occurs. one argument: The oonnee utility exits 0 on success, and >0 if an error occurs. two arguments: The oonnee and ttwwoo utilities exit 0 on success, and >0 if an error occurs. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ex/args.out_markdown010064400017530001753000000006641313667012700217240ustar00schwarzeschwarzeEX-ARGS(1) - General Commands Manual # NAME **Ex-args** - arguments to the exit value macro # EXIT STATUS no arguments: The **Ex-args** utility exits 0 on success, and >0 if an error occurs. one argument: The **one** utility exits 0 on success, and >0 if an error occurs. two arguments: The **one** and **two** utilities exit 0 on success, and >0 if an error occurs. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ex/noname.in010064400017530001753000000004301313667012700201310ustar00schwarzeschwarze.\" $OpenBSD: noname.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EX-NONAME 1 .Os .Sh NAME .Nm .Nd exit value macro without an available name .Sh EXIT STATUS no arguments: .Ex -std .Pp one argument: .Ex -std one .Pp two arguments: .Ex -std one two mandoc-1.14.6/regress/mdoc/Ex/noname.out_ascii010064400017530001753000000010371313667012700215060ustar00schwarzeschwarzeEX-NONAME(1) General Commands Manual EX-NONAME(1) NNAAMMEE - exit value macro without an available name EEXXIITT SSTTAATTUUSS no arguments: The utility exits 0 on success, and >0 if an error occurs. one argument: The oonnee utility exits 0 on success, and >0 if an error occurs. two arguments: The oonnee and ttwwoo utilities exit 0 on success, and >0 if an error occurs. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ex/noname.out_lint010064400017530001753000000002041313667012700213570ustar00schwarzeschwarzemandoc: noname.in:6:2: ERROR: missing manual name, using "": Nm mandoc: noname.in:10:2: WARNING: missing utility name, using "": Ex mandoc-1.14.6/regress/mdoc/Ex/noname.out_markdown010064400017530001753000000006621313667012700222430ustar00schwarzeschwarzeEX-NONAME(1) - General Commands Manual # NAME **‌** - exit value macro without an available name # EXIT STATUS no arguments: The utility exits 0 on success, and >0 if an error occurs. one argument: The **one** utility exits 0 on success, and >0 if an error occurs. two arguments: The **one** and **two** utilities exit 0 on success, and >0 if an error occurs. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ex/nostd.in010064400017530001753000000004161313667012700200070ustar00schwarzeschwarze.\" $OpenBSD: nostd.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt EX-NOSTD 1 .Os .Sh NAME .Nm Ex-nostd .Nd exit value macros without -std arguments .Sh EXIT STATUS no arguments: .Ex .Pp one argument: .Ex one .Pp two arguments: .Ex one two mandoc-1.14.6/regress/mdoc/Ex/nostd.out_ascii010064400017530001753000000011171313667012700213570ustar00schwarzeschwarzeEX-NOSTD(1) General Commands Manual EX-NOSTD(1) NNAAMMEE EExx--nnoossttdd - exit value macros without -std arguments EEXXIITT SSTTAATTUUSS no arguments: The EExx--nnoossttdd utility exits 0 on success, and >0 if an error occurs. one argument: The oonnee utility exits 0 on success, and >0 if an error occurs. two arguments: The oonnee and ttwwoo utilities exit 0 on success, and >0 if an error occurs. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ex/nostd.out_lint010064400017530001753000000003171313667012700212360ustar00schwarzeschwarzemandoc: nostd.in:10:2: WARNING: missing -std argument, adding it: Ex mandoc: nostd.in:13:2: WARNING: missing -std argument, adding it: Ex mandoc: nostd.in:16:2: WARNING: missing -std argument, adding it: Ex mandoc-1.14.6/regress/mdoc/Ex/nostd.out_markdown010064400017530001753000000006761313667012700221220ustar00schwarzeschwarzeEX-NOSTD(1) - General Commands Manual # NAME **Ex-nostd** - exit value macros without -std arguments # EXIT STATUS no arguments: The **Ex-nostd** utility exits 0 on success, and >0 if an error occurs. one argument: The **one** utility exits 0 on success, and >0 if an error occurs. two arguments: The **one** and **two** utilities exit 0 on success, and >0 if an error occurs. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fd004075500017530001753000000000001412314056600162245ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Fd/Makefile010064400017530001753000000002551341026767400177520ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2018/12/21 16:58:49 schwarze Exp $ REGRESS_TARGETS = arg break empty eos font LINT_TARGETS = empty SKIP_TMAN = eos .include mandoc-1.14.6/regress/mdoc/Fd/break.in010064400017530001753000000012351313667012700177210ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FD-BREAK 2 .Os .Sh NAME .Nm Fd-break .Nd line break before old-style header include file .Sh SYNOPSIS .Fd #include .Ft int .Fn open "const char *path" "int flags" "mode_t mode" .Fd #include .Fd #include .Ft int .Fn dup "int oldd" .Ft ssize_t .Fn write "int d" "const void *buf" "size_t nbytes" .Sh DESCRIPTION .Fd #include .Ft int .Fn open "const char *path" "int flags" "mode_t mode" .Fd #include .Fd #include .Ft int .Fn dup "int oldd" .Ft ssize_t .Fn write "int d" "const void *buf" "size_t nbytes" mandoc-1.14.6/regress/mdoc/Fd/break.out_ascii010064400017530001753000000025061313667012700212740ustar00schwarzeschwarzeFD-BREAK(2) System Calls Manual FD-BREAK(2) NNAAMMEE FFdd--bbrreeaakk - line break before old-style header include file SSYYNNOOPPSSIISS ##iinncclluuddee <> _i_n_t ooppeenn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _f_l_a_g_s, _m_o_d_e___t _m_o_d_e); ##iinncclluuddee <> ##iinncclluuddee <> _i_n_t dduupp(_i_n_t _o_l_d_d); _s_s_i_z_e___t wwrriittee(_i_n_t _d, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); DDEESSCCRRIIPPTTIIOONN ##iinncclluuddee <> _i_n_t ooppeenn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _f_l_a_g_s, _m_o_d_e___t _m_o_d_e) ##iinncclluuddee <> ##iinncclluuddee <> _i_n_t dduupp(_i_n_t _o_l_d_d) _s_s_i_z_e___t wwrriittee(_i_n_t _d, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fd/break.out_markdown010064400017530001753000000012521313667012700220230ustar00schwarzeschwarzeFD-BREAK(2) - System Calls Manual # NAME **Fd-break** - line break before old-style header include file # SYNOPSIS **#include <fcntl.h>** *int* **open**(*const char \*path*, *int flags*, *mode\_t mode*); **#include <sys/types.h>** **#include <unistd.h>** *int* **dup**(*int oldd*); *ssize\_t* **write**(*int d*, *const void \*buf*, *size\_t nbytes*); # DESCRIPTION **#include <fcntl.h>** *int* **open**(*const char \*path*, *int flags*, *mode\_t mode*) **#include <sys/types.h>** **#include <unistd.h>** *int* **dup**(*int oldd*) *ssize\_t* **write**(*int d*, *const void \*buf*, *size\_t nbytes*) OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fd/empty.in010064400017530001753000000004131313667012700177700ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FD-EMPTY 1 .Os .Sh NAME .Nm Fd-empty .Nd empty preprocessor directive macros .Sh SYNOPSIS .In sys/types.h .Fd .In stdlib.h .Sh DESCRIPTION leading text .Fd trailing text mandoc-1.14.6/regress/mdoc/Fd/empty.out_ascii010064400017530001753000000007211313667012700213430ustar00schwarzeschwarzeFD-EMPTY(1) General Commands Manual FD-EMPTY(1) NNAAMMEE FFdd--eemmppttyy - empty preprocessor directive macros SSYYNNOOPPSSIISS ##iinncclluuddee <> ##iinncclluuddee <> DDEESSCCRRIIPPTTIIOONN leading text trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fd/empty.out_lint010064400017530001753000000001621313667012700212200ustar00schwarzeschwarzemandoc: empty.in:10:2: WARNING: skipping empty macro: Fd mandoc: empty.in:14:2: WARNING: skipping empty macro: Fd mandoc-1.14.6/regress/mdoc/Fd/empty.out_markdown010064400017530001753000000003551313667012700221000ustar00schwarzeschwarzeFD-EMPTY(1) - General Commands Manual # NAME **Fd-empty** - empty preprocessor directive macros # SYNOPSIS **#include <sys/types.h>** **#include <stdlib.h>** # DESCRIPTION leading text trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fd/eos.in010064400017530001753000000003761313667012700174300ustar00schwarzeschwarze.\" $OpenBSD: eos.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FD-EOS 1 .Os .Sh NAME .Nm Fd-eos .Nd end of sentence handling after the legacy include macro .Sh DESCRIPTION Let's use .Fd string.h . And then something else. mandoc-1.14.6/regress/mdoc/Fd/eos.out_ascii010064400017530001753000000005541313667012700207770ustar00schwarzeschwarzeFD-EOS(1) General Commands Manual FD-EOS(1) NNAAMMEE FFdd--eeooss - end of sentence handling after the legacy include macro DDEESSCCRRIIPPTTIIOONN Let's use ssttrriinngg..hh .. And then something else. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fd/eos.out_markdown010064400017530001753000000003161313667012700215250ustar00schwarzeschwarzeFD-EOS(1) - General Commands Manual # NAME **Fd-eos** - end of sentence handling after the legacy include macro # DESCRIPTION Let's use **string.h .** And then something else. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fd/font.in010064400017530001753000000004051313667012700176010ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FD-FONT 2 .Os .Sh NAME .Nm Fd-font .Nd changing the font inside the old-style include macro .Sh DESCRIPTION normal text .Fd prefix\\fIheader\\fPsuffix trailing text mandoc-1.14.6/regress/mdoc/Fd/font.out_ascii010064400017530001753000000005751313667012700211620ustar00schwarzeschwarzeFD-FONT(2) System Calls Manual FD-FONT(2) NNAAMMEE FFdd--ffoonntt - changing the font inside the old-style include macro DDEESSCCRRIIPPTTIIOONN normal text pprreeffiixx_h_e_a_d_e_rssuuffffiixx trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fd/font.out_markdown010064400017530001753000000003121313667012700217010ustar00schwarzeschwarzeFD-FONT(2) - System Calls Manual # NAME **Fd-font** - changing the font inside the old-style include macro # DESCRIPTION normal text **prefix*header*suffix** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fd/arg.in010064400017530001753000000005161340721765200174100ustar00schwarzeschwarze.\" $OpenBSD: arg.in,v 1.1 2018/12/21 16:58:49 schwarze Exp $ .Dd $Mdocdate: December 21 2018 $ .Dt FD-ARG 2 .Os .Sh NAME .Nm Fd-arg .Nd escape sequences in the arguments of in-line EOL macros .Sh DESCRIPTION .ds s \(sh .Fd \*sunquoted unescaped .Pp .Fd "\*squoted" unescaped .Pp .Fd \\*sunquoted escaped .Pp .Fd "\\*squoted" escaped mandoc-1.14.6/regress/mdoc/Fd/arg.out_ascii010064400017530001753000000010011340721765200207470ustar00schwarzeschwarzeFD-ARG(2) System Calls Manual FD-ARG(2) NNAAMMEE FFdd--aarrgg - escape sequences in the arguments of in-line EOL macros DDEESSCCRRIIPPTTIIOONN ##uunnqquuootteedd uunneessccaappeedd ##qquuootteedd uunneessccaappeedd ##uunnqquuootteedd eessccaappeedd ##qquuootteedd eessccaappeedd OpenBSD December 21, 2018 OpenBSD mandoc-1.14.6/regress/mdoc/Fd/arg.out_markdown010064400017530001753000000004061340721765200215110ustar00schwarzeschwarzeFD-ARG(2) - System Calls Manual # NAME **Fd-arg** - escape sequences in the arguments of in-line EOL macros # DESCRIPTION **#unquoted unescaped** **#quoted unescaped** **#unquoted escaped** **#quoted escaped** OpenBSD - December 21, 2018 mandoc-1.14.6/regress/mdoc/Fl004075500017530001753000000000001412314056600162345ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Fl/Makefile010064400017530001753000000003631367274434200177640ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.15 2020/04/26 21:29:46 schwarze Exp $ REGRESS_TARGETS = font long multiarg noarg parsed punct spacing tag TAG_TARGETS = long tag LINT_TARGETS = punct HTML_TARGETS = long tag SKIP_TMAN = tag .include mandoc-1.14.6/regress/mdoc/Fl/font.in010064400017530001753000000003631313667012700176140ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FL-FONT 1 .Os .Sh NAME .Nm Fl-font .Nd changing fonts inside the flag macro .Sh DESCRIPTION normal text .Fl bold\\fIemphasis\\fPback trailing text mandoc-1.14.6/regress/mdoc/Fl/font.out_ascii010064400017530001753000000005451313667012700211670ustar00schwarzeschwarzeFL-FONT(1) General Commands Manual FL-FONT(1) NNAAMMEE FFll--ffoonntt - changing fonts inside the flag macro DDEESSCCRRIIPPTTIIOONN normal text --bboolldd_e_m_p_h_a_s_i_sbbaacckk trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fl/font.out_markdown010064400017530001753000000002731313667012700217170ustar00schwarzeschwarzeFL-FONT(1) - General Commands Manual # NAME **Fl-font** - changing fonts inside the flag macro # DESCRIPTION normal text **-bold*emphasis*back** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fl/multiarg.in010064400017530001753000000004711313667012700204720ustar00schwarzeschwarze.\" $OpenBSD: multiarg.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FL-MULTIARG 1 .Os .Sh NAME .Nm Fl-multiarg .Nd multiple arguments to a Fl macro .Sh DESCRIPTION Each group of flags in .Fl a b c def gets its own dash. .Pp Punctuation characters like in .Op Fl a | b get no dash. mandoc-1.14.6/regress/mdoc/Fl/multiarg.out_ascii010064400017530001753000000006571313667012700220510ustar00schwarzeschwarzeFL-MULTIARG(1) General Commands Manual FL-MULTIARG(1) NNAAMMEE FFll--mmuullttiiaarrgg - multiple arguments to a Fl macro DDEESSCCRRIIPPTTIIOONN Each group of flags in --aa --bb --cc --ddeeff gets its own dash. Punctuation characters like in [--aa | --bb] get no dash. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fl/multiarg.out_markdown010064400017530001753000000004251313667012700225740ustar00schwarzeschwarzeFL-MULTIARG(1) - General Commands Manual # NAME **Fl-multiarg** - multiple arguments to a Fl macro # DESCRIPTION Each group of flags in **-a** **-b** **-c** **-def** gets its own dash. Punctuation characters like in \[**-a** | **-b**] get no dash. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fl/noarg.in010064400017530001753000000005461313667012700177570ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.6 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FL-NOARG 1 .Os .Sh NAME .Nm Fl-noarg .Nd Fl macro without arguments .Sh DESCRIPTION Without an argument, it yields .Fl a dash. .Pp This is true even before middle .Fl | and trailing punctuation .Fl . .Pp Following macros .Fl Op flag follow without white space. mandoc-1.14.6/regress/mdoc/Fl/noarg.out_ascii010064400017530001753000000007131313667012700213240ustar00schwarzeschwarzeFL-NOARG(1) General Commands Manual FL-NOARG(1) NNAAMMEE FFll--nnooaarrgg - Fl macro without arguments DDEESSCCRRIIPPTTIIOONN Without an argument, it yields -- a dash. This is true even before middle -- | --aanndd trailing punctuation --. Following macros --[flag] follow without white space. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fl/noarg.out_markdown010064400017530001753000000004671313667012700220640ustar00schwarzeschwarzeFL-NOARG(1) - General Commands Manual # NAME **Fl-noarg** - Fl macro without arguments # DESCRIPTION Without an argument, it yields **-** a dash. This is true even before middle **-** | **-and** trailing punctuation **-**. Following macros **-**\[flag] follow without white space. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fl/parsed.in010064400017530001753000000004171313667012700201240ustar00schwarzeschwarze.\" $OpenBSD: parsed.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FL-PARSED 1 .Os .Sh NAME .Nm Fl-parsed .Nd is the Fl macro parsed? .Sh DESCRIPTION .Op Fl Ux .Pp .Op Ux .Pp .Op Fl Cm x .Pp .Fl W all versus .Fl W Ns Cm all .Pp .Fl Cm help mandoc-1.14.6/regress/mdoc/Fl/parsed.out_ascii010064400017530001753000000005751313667012700215020ustar00schwarzeschwarzeFL-PARSED(1) General Commands Manual FL-PARSED(1) NNAAMMEE FFll--ppaarrsseedd - is the Fl macro parsed? DDEESSCCRRIIPPTTIIOONN [--UNIX] [UNIX] [--xx] --WW --aallll versus --WWaallll --hheellpp OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fl/parsed.out_markdown010064400017530001753000000003541313667012700222270ustar00schwarzeschwarzeFL-PARSED(1) - General Commands Manual # NAME **Fl-parsed** - is the Fl macro parsed? # DESCRIPTION \[**-**UNIX] \[UNIX] \[**-**‌**x**] **-W** **-all** versus **-W**‌**all** **-**‌**help** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fl/punct.in010064400017530001753000000010501313667012700177710ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.6 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FL-PUNCT 1 .Os .Sh NAME .Nm Fl-punct .Nd punctuation handling by the Fl macro .Sh DESCRIPTION closing punctuation .Fl a ) only one .Fl ) only more than one .Fl ) ) middle .Fl a ) z start .Fl ) z dot .Fl . z comma .Fl , z semicolon .Fl ; z colon .Fl : z quest .Fl ? z excl .Fl ! z paren .Fl ) z bracket .Fl ] z bar .Fl | m op paren .Fl ( a op bracket .Fl [ a .Pp quoted punctuation: .Fl a "(" b "|" c ")" d "," "Em" italic . .Pp trailing delimiter: .Fl a. mandoc-1.14.6/regress/mdoc/Fl/punct.out_ascii010064400017530001753000000013171313667012700213500ustar00schwarzeschwarzeFL-PUNCT(1) General Commands Manual FL-PUNCT(1) NNAAMMEE FFll--ppuunncctt - punctuation handling by the Fl macro DDEESSCCRRIIPPTTIIOONN closing punctuation --aa) only one --) only more than one --)) middle --aa) --zz start --) --zz dot --. --zz comma --, --zz semicolon --; --zz colon --: --zz quest --? --zz excl --! --zz paren --) --zz bracket --] --zz bar -- | --mm op paren (--aa op bracket [--aa quoted punctuation: --aa (--bb | --cc) --dd, _i_t_a_l_i_c. trailing delimiter: --aa.. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fl/punct.out_markdown010064400017530001753000000010641313667012700221010ustar00schwarzeschwarzeFL-PUNCT(1) - General Commands Manual # NAME **Fl-punct** - punctuation handling by the Fl macro # DESCRIPTION closing punctuation **-a**) only one **-**) only more than one **-**)) middle **-a**) **-z** start **-**) **-z** dot **-**. **-z** comma **-**, **-z** semicolon **-**; **-z** colon **-**: **-z** quest **-**? **-z** excl **-**! **-z** paren **-**) **-z** bracket **-**] **-z** bar **-** | **-m** op paren (**-a** op bracket \[**-a** quoted punctuation: **-a** (**-b** | **-c**) **-d**, *italic*. trailing delimiter: **-a.** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fl/punct.out_lint010064400017530001753000000001101312673157100212140ustar00schwarzeschwarzemandoc: punct.in:46:6: STYLE: no blank before trailing delimiter: Fl a. mandoc-1.14.6/regress/mdoc/Fl/spacing.in010064400017530001753000000013061362561734200202730ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .Dd $Mdocdate: February 27 2020 $ .Dt FL-SPACING 1 .Os .Sh NAME .Nm Fl-spacing .Nd horizontal spacing after flag macros .Sh DESCRIPTION with argument: .Fl a .Pp no next node: .Xo Fl Xc suffix .Pp transparent next node only: .Xo Fl .Tg transparent1 .Xc suffix .Pp following text: .Fl text .Pp text after transparent node on the same line: .Fl Es < > text .Pp following macro on the same line: .Fl Em word .Pp following macro on the next line: .Fl .Em word .Pp following macro on the next line after transparent node on the same line: .Fl Es < > .Em word .Pp following macro after transparent node on the next line: .Fl .Tg transparent3 .Em word mandoc-1.14.6/regress/mdoc/Fl/spacing.out_ascii010064400017530001753000000014051362561734200216440ustar00schwarzeschwarzeFL-SPACING(1) General Commands Manual FL-SPACING(1) NNAAMMEE FFll--ssppaacciinngg - horizontal spacing after flag macros DDEESSCCRRIIPPTTIIOONN with argument: --aa no next node: -- suffix transparent next node only: -- suffix following text: -- text text after transparent node on the same line: -- text following macro on the same line: --_w_o_r_d following macro on the next line: -- _w_o_r_d following macro on the next line after transparent node on the same line: -- _w_o_r_d following macro after transparent node on the next line: -- _w_o_r_d OpenBSD February 27, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Fl/tag.in010064400017530001753000000004331363272363200174200ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt FL-TAG 1 .Os .Sh NAME .Nm Fl-tag .Nd tagging of command line option macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Fl a | b text .It Xo .Fl c .Xc text .El .Tg .Fl d .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Fl/spacing.out_markdown010064400017530001753000000011121362561734200223710ustar00schwarzeschwarzeFL-SPACING(1) - General Commands Manual # NAME **Fl-spacing** - horizontal spacing after flag macros # DESCRIPTION with argument: **-a** no next node: **-** suffix transparent next node only: **-** suffix following text: **-** text text after transparent node on the same line: **-** text following macro on the same line: **-**‌*word* following macro on the next line: **-** *word* following macro on the next line after transparent node on the same line: **-** *word* following macro after transparent node on the next line: **-** *word* OpenBSD - February 27, 2020 mandoc-1.14.6/regress/mdoc/Fl/tag.out_ascii010064400017530001753000000005701363272363200207730ustar00schwarzeschwarzeFL-TAG(1) General Commands Manual FL-TAG(1) NNAAMMEE FFll--ttaagg - tagging of command line option macros DDEESSCCRRIIPPTTIIOONN BEGINTEST --aa | --bb text --cc text --dd ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Fl/tag.out_html010064400017530001753000000005521367274434200206540ustar00schwarzeschwarze
|
text
text
mandoc-1.14.6/regress/mdoc/Fl/tag.out_markdown010064400017530001753000000003161363272363200215230ustar00schwarzeschwarzeFL-TAG(1) - General Commands Manual # NAME **Fl-tag** - tagging of command line option macros # DESCRIPTION BEGINTEST **-a** | **-b** > text **-c** > text **-d** ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Fl/tag.out_tag010064400017530001753000000002151372346556100204570ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 a tag.mandoc_ascii 9 b tag.mandoc_ascii 9 c tag.mandoc_ascii 12 d tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Fl/long.in010064400017530001753000000004061365137776400176200ustar00schwarzeschwarze.\" $OpenBSD: long.in,v 1.1 2020/04/26 21:29:46 schwarze Exp $ .Dd $Mdocdate: April 26 2020 $ .Dt FL-LONG 1 .Os .Sh NAME .Nm Fl-long .Nd GNU-style long options .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Fl \-long options .It Fl Fl long options .El ENDTEST mandoc-1.14.6/regress/mdoc/Fl/long.out_ascii010064400017530001753000000005441365137776400211740ustar00schwarzeschwarzeFL-LONG(1) General Commands Manual FL-LONG(1) NNAAMMEE FFll--lloonngg - GNU-style long options DDEESSCCRRIIPPTTIIOONN BEGINTEST ----lloonngg options ----lloonngg options ENDTEST OpenBSD April 26, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Fl/long.out_html010064400017530001753000000003701365137776400210450ustar00schwarzeschwarze
options
options
mandoc-1.14.6/regress/mdoc/Fl/long.out_markdown010064400017530001753000000003061365137776400217220ustar00schwarzeschwarzeFL-LONG(1) - General Commands Manual # NAME **Fl-long** - GNU-style long options # DESCRIPTION BEGINTEST **--long** > options **--long** > options ENDTEST OpenBSD - April 26, 2020 mandoc-1.14.6/regress/mdoc/Fl/long.out_tag010064400017530001753000000001541372346556100206450ustar00schwarzeschwarzeNAME long.mandoc_ascii 3 DESCRIPTION long.mandoc_ascii 6 long long.mandoc_ascii 9 long long.mandoc_ascii 11 mandoc-1.14.6/regress/mdoc/Fo004075500017530001753000000000001412314056600162375ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Fo/Makefile010064400017530001753000000006721363444077000177660ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.18 2020/03/13 00:31:06 schwarze Exp $ REGRESS_TARGETS = basic break eos font noarg nohead REGRESS_TARGETS += obsolete punct section tag transp warn TAG_TARGETS = tag LINT_TARGETS = noarg nohead obsolete punct warn HTML_TARGETS = tag # groff-1.22.3 defects: # - .Fo without an argument prints unbalanced parentheses # - .nr nS is ignored SKIP_GROFF = nohead section SKIP_TMAN = eos .include mandoc-1.14.6/regress/mdoc/Fo/basic.in010064400017530001753000000005511313667012700177310ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FO-BASIC 1 .Os .Sh NAME .Nm Fo-basic .Nd function blocks .Sh SYNOPSIS .Ft double .Fo sin .Fa "double x" .Fc .Ft double .Fo atan2 .Fa "double y" "double x" .Fc .Sh DESCRIPTION .Ft double .Fo sin .Fa "double x" .Fc .Ft double .Fo atan2 .Fa "double y" "double x" .Fc mandoc-1.14.6/regress/mdoc/Fo/basic.out_ascii010064400017530001753000000011061313667012700212770ustar00schwarzeschwarzeFO-BASIC(1) General Commands Manual FO-BASIC(1) NNAAMMEE FFoo--bbaassiicc - function blocks SSYYNNOOPPSSIISS _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x); _d_o_u_b_l_e aattaann22(_d_o_u_b_l_e _y, _d_o_u_b_l_e _x); DDEESSCCRRIIPPTTIIOONN _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) _d_o_u_b_l_e aattaann22(_d_o_u_b_l_e _y, _d_o_u_b_l_e _x) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/basic.out_markdown010064400017530001753000000004321313667012700220320ustar00schwarzeschwarzeFO-BASIC(1) - General Commands Manual # NAME **Fo-basic** - function blocks # SYNOPSIS *double* **sin**(*double x*); *double* **atan2**(*double y*, *double x*); # DESCRIPTION *double* **sin**(*double x*) *double* **atan2**(*double y*, *double x*) OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/break.in010064400017530001753000000025521313667012700177370ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FO-BREAK 1 .Os .Sh NAME .Nm Fo-break .Nd line breaks in function blocks .Sh SYNOPSIS .Fd using \&Fn: .Ft my_long_return_type * .Fn my_long_function "my_long_type first_argument" "my_long_type second_argument" .Ft void .Fn "this function name is so ridiculously long \ that it will not fit on the line" "my_long_type first_argument" \ "my_long_type second_argument" "my_long_type third_argument" .Fd using \&Fo and single-argument \&Fa: .Ft my_long_return_type * .Fo my_long_function .Fa "my_long_type first_argument" .Fa "my_long_type second_argument" .Fc .Ft void .Fo "this function name is so ridiculously long \ that it will not fit on the line" .Fa "my_long_type first_argument" .Fa "my_long_type second_argument" .Fa "my_long_type third_argument" .Fc .Fd using \&Fo and multi-argument \&Fa: .Ft my_long_return_type * .Fo my_long_function .Fa "my_long_type first_argument" "my_long_type second_argument" .Fc .Sh DESCRIPTION using Fn: .br .Fn my_long_function "my_long_type first_argument" "my_long_type second_argument" .Pp using Fo and single-argument Fa: .br .Fo my_long_function .Fa "my_long_type first_argument" .Fa "my_long_type second_argument" .Fc .Pp using Fo and multi-argument Fa: .br .Fo my_long_function .Fa "my_long_type first_argument" "my_long_type second_argument" .Fc mandoc-1.14.6/regress/mdoc/Fo/break.out_ascii010064400017530001753000000061101313667012700213020ustar00schwarzeschwarzeFO-BREAK(1) General Commands Manual FO-BREAK(1) NNAAMMEE FFoo--bbrreeaakk - line breaks in function blocks SSYYNNOOPPSSIISS uussiinngg FFnn:: _m_y___l_o_n_g___r_e_t_u_r_n___t_y_p_e _* mmyy__lloonngg__ffuunnccttiioonn(_m_y___l_o_n_g___t_y_p_e _f_i_r_s_t___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _s_e_c_o_n_d___a_r_g_u_m_e_n_t); _v_o_i_d tthhiiss ffuunnccttiioonn nnaammee iiss ssoo rriiddiiccuulloouussllyy lloonngg tthhaatt iitt wwiillll nnoott ffiitt oonn tthhee lliinnee(_m_y___l_o_n_g___t_y_p_e _f_i_r_s_t___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _s_e_c_o_n_d___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _t_h_i_r_d___a_r_g_u_m_e_n_t); uussiinngg FFoo aanndd ssiinnggllee--aarrgguummeenntt FFaa:: _m_y___l_o_n_g___r_e_t_u_r_n___t_y_p_e _* mmyy__lloonngg__ffuunnccttiioonn(_m_y___l_o_n_g___t_y_p_e _f_i_r_s_t___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _s_e_c_o_n_d___a_r_g_u_m_e_n_t); _v_o_i_d tthhiiss ffuunnccttiioonn nnaammee iiss ssoo rriiddiiccuulloouussllyy lloonngg tthhaatt iitt wwiillll nnoott ffiitt oonn tthhee lliinnee(_m_y___l_o_n_g___t_y_p_e _f_i_r_s_t___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _s_e_c_o_n_d___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _t_h_i_r_d___a_r_g_u_m_e_n_t); uussiinngg FFoo aanndd mmuullttii--aarrgguummeenntt FFaa:: _m_y___l_o_n_g___r_e_t_u_r_n___t_y_p_e _* mmyy__lloonngg__ffuunnccttiioonn(_m_y___l_o_n_g___t_y_p_e _f_i_r_s_t___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _s_e_c_o_n_d___a_r_g_u_m_e_n_t); DDEESSCCRRIIPPTTIIOONN using Fn: mmyy__lloonngg__ffuunnccttiioonn(_m_y___l_o_n_g___t_y_p_e _f_i_r_s_t___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _s_e_c_o_n_d___a_r_g_u_m_e_n_t) using Fo and single-argument Fa: mmyy__lloonngg__ffuunnccttiioonn(_m_y___l_o_n_g___t_y_p_e _f_i_r_s_t___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _s_e_c_o_n_d___a_r_g_u_m_e_n_t) using Fo and multi-argument Fa: mmyy__lloonngg__ffuunnccttiioonn(_m_y___l_o_n_g___t_y_p_e _f_i_r_s_t___a_r_g_u_m_e_n_t, _m_y___l_o_n_g___t_y_p_e _s_e_c_o_n_d___a_r_g_u_m_e_n_t) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/break.out_markdown010064400017530001753000000025341313667012700220420ustar00schwarzeschwarzeFO-BREAK(1) - General Commands Manual # NAME **Fo-break** - line breaks in function blocks # SYNOPSIS **using Fn:** *my\_long\_return\_type \*‌* **my\_long\_function**(*my\_long\_type first\_argument*, *my\_long\_type second\_argument*); *void* **this function name is so ridiculously long that it will not fit on the line**(*my\_long\_type first\_argument*, *my\_long\_type second\_argument*, *my\_long\_type third\_argument*); **using Fo and single-argument Fa:** *my\_long\_return\_type \*‌* **my\_long\_function**(*my\_long\_type first\_argument*, *my\_long\_type second\_argument*); *void* **this function name is so ridiculously long that it will not fit on the line**(*my\_long\_type first\_argument*, *my\_long\_type second\_argument*, *my\_long\_type third\_argument*); **using Fo and multi-argument Fa:** *my\_long\_return\_type \*‌* **my\_long\_function**(*my\_long\_type first\_argument*, *my\_long\_type second\_argument*); # DESCRIPTION using Fn: **my\_long\_function**(*my\_long\_type first\_argument*, *my\_long\_type second\_argument*) using Fo and single-argument Fa: **my\_long\_function**(*my\_long\_type first\_argument*, *my\_long\_type second\_argument*) using Fo and multi-argument Fa: **my\_long\_function**(*my\_long\_type first\_argument*, *my\_long\_type second\_argument*) OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/eos.in010064400017530001753000000005441313667012700174400ustar00schwarzeschwarze.\" $OpenBSD: eos.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FO-EOS 1 .Os .Sh NAME .Nm Fo-eos .Nd end of sentence handling after a function block .Sh DESCRIPTION As an example of a trigonometric function, let us consider .Fn "double sin" "double x" . Or do you prefer .Ft double .Fo cos .Fa double x .Fc . Either will do. mandoc-1.14.6/regress/mdoc/Fo/eos.out_ascii010064400017530001753000000007571313667012700210170ustar00schwarzeschwarzeFO-EOS(1) General Commands Manual FO-EOS(1) NNAAMMEE FFoo--eeooss - end of sentence handling after a function block DDEESSCCRRIIPPTTIIOONN As an example of a trigonometric function, let us consider ddoouubbllee ssiinn(_d_o_u_b_l_e _x). Or do you prefer _d_o_u_b_l_e ccooss(_d_o_u_b_l_e, _x). Either will do. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/eos.out_markdown010064400017530001753000000004541313667012700215430ustar00schwarzeschwarzeFO-EOS(1) - General Commands Manual # NAME **Fo-eos** - end of sentence handling after a function block # DESCRIPTION As an example of a trigonometric function, let us consider **double sin**(*double x*). Or do you prefer *double* **cos**(*double*, *x*) . Either will do. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/font.in010064400017530001753000000005711313667012700176200ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FO-FONT 1 .Os .Sh NAME .Nm Fo-font .Nd font nesting in function blocks .Sh DESCRIPTION .Fn prefix\\fIname\\fPsuffix "type arg" trailing text .Pp .Fo prefix\\fIname\\fPsuffix .Fa "type arg" .Fc trailing text .Pp .Fo function .Fa prefix\\fBbold\\fPsuffix .Fc "Sy" bold trailing text mandoc-1.14.6/regress/mdoc/Fo/font.out_ascii010064400017530001753000000010621313667012700211650ustar00schwarzeschwarzeFO-FONT(1) General Commands Manual FO-FONT(1) NNAAMMEE FFoo--ffoonntt - font nesting in function blocks DDEESSCCRRIIPPTTIIOONN pprreeffiixx_n_a_m_essuuffffiixx(_t_y_p_e _a_r_g) trailing text pprreeffiixx_n_a_m_essuuffffiixx(_t_y_p_e _a_r_g) trailing text ffuunnccttiioonn(_p_r_e_f_i_xbboolldd_s_u_f_f_i_x) bboolldd trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/font.out_markdown010064400017530001753000000004441313667012700217220ustar00schwarzeschwarzeFO-FONT(1) - General Commands Manual # NAME **Fo-font** - font nesting in function blocks # DESCRIPTION **prefix*name*suffix**(*type arg*) trailing text **prefix*name*suffix**(*type arg*) trailing text **function**(*prefix**bold**suffix*) **bold** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/noarg.in010064400017530001753000000011201313667012700177470ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.6 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FN-NOARG 1 .Os .Sh NAME .Nm Fn-noarg .Nd function name macro without arguments .Sh DESCRIPTION with arguments: .Ft int .Fn abs "int i" .Ft long .Fo labs bogus .Fa "long i" .Fc void function arguments: .Ft int .Fn rand .Ft long .Fo random .Fc .Ft u_int32_t .Fo arc4random .Fa .Fc no name arguments: .Ft int .Fn no type arguments: .Ft .Fn abs "int i" no type and void function arguments: .Ft .Fn rand .Ft .Fo random .Fc .Ft .Fo arc4random .Fa .Fc no arguments at all: .Ft .Fn end of test document mandoc-1.14.6/regress/mdoc/Fo/noarg.out_ascii010064400017530001753000000013671313667012700213350ustar00schwarzeschwarzeFN-NOARG(1) General Commands Manual FN-NOARG(1) NNAAMMEE FFnn--nnooaarrgg - function name macro without arguments DDEESSCCRRIIPPTTIIOONN with arguments: _i_n_t aabbss(_i_n_t _i) _l_o_n_g llaabbss(_l_o_n_g _i) void function arguments: _i_n_t rraanndd() _l_o_n_g rraannddoomm() _u___i_n_t_3_2___t aarrcc44rraannddoomm() no name arguments: _i_n_t no type arguments: aabbss(_i_n_t _i) no type and void function arguments: rraanndd() rraannddoomm() aarrcc44rraannddoomm() no arguments at all: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/noarg.out_lint010064400017530001753000000011101313667012700211750ustar00schwarzeschwarzemandoc: noarg.in:24:2: WARNING: skipping empty macro: Fa mandoc: noarg.in:28:2: WARNING: skipping empty macro: Fn mandoc: noarg.in:30:2: WARNING: skipping empty macro: Ft mandoc: noarg.in:33:2: WARNING: skipping empty macro: Ft mandoc: noarg.in:35:2: WARNING: skipping empty macro: Ft mandoc: noarg.in:38:2: WARNING: skipping empty macro: Ft mandoc: noarg.in:40:2: WARNING: skipping empty macro: Fa mandoc: noarg.in:43:2: WARNING: skipping empty macro: Ft mandoc: noarg.in:44:2: WARNING: skipping empty macro: Fn mandoc: noarg.in:13:10: ERROR: skipping excess arguments: Fo ... bogus mandoc-1.14.6/regress/mdoc/Fo/noarg.out_markdown010064400017530001753000000007371313667012700220670ustar00schwarzeschwarzeFN-NOARG(1) - General Commands Manual # NAME **Fn-noarg** - function name macro without arguments # DESCRIPTION with arguments: *int* **abs**(*int i*) *long* **labs**(*long i*) void function arguments: *int* **rand**() *long* **random**() *u\_int32\_t* **arc4random**() no name arguments: *int* no type arguments: **abs**(*int i*) no type and void function arguments: **rand**() **random**() **arc4random**() no arguments at all: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/nohead.in010064400017530001753000000003701313667012700201050ustar00schwarzeschwarze.\" $OpenBSD: nohead.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FO-NOHEAD 1 .Os .Sh NAME .Nm Fo-nohead .Nd function block macro without head argument .Sh DESCRIPTION initial text .Ft int .Fo .Fa int .Fc final text mandoc-1.14.6/regress/mdoc/Fo/nohead.out_ascii010064400017530001753000000005201313667012700214530ustar00schwarzeschwarzeFO-NOHEAD(1) General Commands Manual FO-NOHEAD(1) NNAAMMEE FFoo--nnoohheeaadd - function block macro without head argument DDEESSCCRRIIPPTTIIOONN initial text _i_n_t(_i_n_t) final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/nohead.out_lint010064400017530001753000000001051313667012700213300ustar00schwarzeschwarzemandoc: nohead.in:11:2: WARNING: missing function name, using "": Fo mandoc-1.14.6/regress/mdoc/Fo/nohead.out_markdown010064400017530001753000000002701313667012700222070ustar00schwarzeschwarzeFO-NOHEAD(1) - General Commands Manual # NAME **Fo-nohead** - function block macro without head argument # DESCRIPTION initial text *int*(*int*) final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/obsolete.in010064400017530001753000000003761313667012700204710ustar00schwarzeschwarze.\" $OpenBSD: obsolete.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FO-OBSOLETE 1 .Os .Sh NAME .Nm Fo-obsolete .Nd obsolete function macros .Sh DESCRIPTION old function type .Ot fortran .Pp function return value .Fr value mandoc-1.14.6/regress/mdoc/Fo/obsolete.out_ascii010064400017530001753000000005531313667012700220370ustar00schwarzeschwarzeFO-OBSOLETE(1) General Commands Manual FO-OBSOLETE(1) NNAAMMEE FFoo--oobbssoolleettee - obsolete function macros DDEESSCCRRIIPPTTIIOONN old function type _f_o_r_t_r_a_n function return value _v_a_l_u_e OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/obsolete.out_lint010064400017530001753000000001541313667012700217120ustar00schwarzeschwarzemandoc: obsolete.in:10:2: WARNING: obsolete macro: Ot mandoc: obsolete.in:13:2: WARNING: obsolete macro: Fr mandoc-1.14.6/regress/mdoc/Fo/obsolete.out_markdown010064400017530001753000000003001313667012700225570ustar00schwarzeschwarzeFO-OBSOLETE(1) - General Commands Manual # NAME **Fo-obsolete** - obsolete function macros # DESCRIPTION old function type *fortran* function return value *value* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/punct.in010064400017530001753000000004421313667012700200000ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FO-PUNCT 1 .Os .Sh NAME .Nm Fo-punct .Nd punctuation on function input lines .Sh DESCRIPTION .Ft double .Fn sin. "," cos "Em" italic .Pp .Fa x "," y: "Sy" bold .Pp .Ft int "," float: "Sy" bold mandoc-1.14.6/regress/mdoc/Fo/punct.out_ascii010064400017530001753000000006431313667012700213540ustar00schwarzeschwarzeFO-PUNCT(1) General Commands Manual FO-PUNCT(1) NNAAMMEE FFoo--ppuunncctt - punctuation on function input lines DDEESSCCRRIIPPTTIIOONN _d_o_u_b_l_e ssiinn..(), cos _i_t_a_l_i_c _x, _y_: bboolldd _i_n_t, _f_l_o_a_t_: bboolldd OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/punct.out_markdown010064400017530001753000000003321313667012700221010ustar00schwarzeschwarzeFO-PUNCT(1) - General Commands Manual # NAME **Fo-punct** - punctuation on function input lines # DESCRIPTION *double* **sin.**(), cos *italic* *x*, *y:* **bold** *int*, *float:* **bold** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/section.in010064400017530001753000000022731313667012700203170ustar00schwarzeschwarze.\" $OpenBSD: section.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FN-SECTION 3 .Os .Sh NAME .Nm Fn-section .Nd special handling of Fn in various sections .Sh SYNOPSIS .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh DESCRIPTION .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh RETURN VALUES .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh ENVIRONMENT .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh FILES .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh EXAMPLES .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh DIAGNOSTICS .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh ERRORS .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh SEE ALSO .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh STANDARDS .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh HISTORY .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh AUTHORS .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh CAVEATS .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh BUGS .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .Sh CUSTOM .nr nS 1 .Ft int .Fn abs "int j" .Ft double .Fn sin "double x" .nr nS 0 mandoc-1.14.6/regress/mdoc/Fo/section.out_ascii010064400017530001753000000040321313667012700216630ustar00schwarzeschwarzeFN-SECTION(3) Library Functions Manual FN-SECTION(3) NNAAMMEE FFnn--sseeccttiioonn - special handling of Fn in various sections SSYYNNOOPPSSIISS _i_n_t aabbss(_i_n_t _j); _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x); DDEESSCCRRIIPPTTIIOONN _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) RREETTUURRNN VVAALLUUEESS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) EENNVVIIRROONNMMEENNTT _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) FFIILLEESS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) EEXXAAMMPPLLEESS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) DDIIAAGGNNOOSSTTIICCSS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) EERRRROORRSS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) SSEEEE AALLSSOO _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) SSTTAANNDDAARRDDSS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) HHIISSTTOORRYY _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) AAUUTTHHOORRSS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) CCAAVVEEAATTSS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) BBUUGGSS _i_n_t aabbss(_i_n_t _j) _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) CCUUSSTTOOMM _i_n_t aabbss(_i_n_t _j); _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x); OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/section.out_markdown010064400017530001753000000021441313667012700224170ustar00schwarzeschwarzeFN-SECTION(3) - Library Functions Manual # NAME **Fn-section** - special handling of Fn in various sections # SYNOPSIS *int* **abs**(*int j*); *double* **sin**(*double x*); # DESCRIPTION *int* **abs**(*int j*) *double* **sin**(*double x*) # RETURN VALUES *int* **abs**(*int j*) *double* **sin**(*double x*) # ENVIRONMENT *int* **abs**(*int j*) *double* **sin**(*double x*) # FILES *int* **abs**(*int j*) *double* **sin**(*double x*) # EXAMPLES *int* **abs**(*int j*) *double* **sin**(*double x*) # DIAGNOSTICS *int* **abs**(*int j*) *double* **sin**(*double x*) # ERRORS *int* **abs**(*int j*) *double* **sin**(*double x*) # SEE ALSO *int* **abs**(*int j*) *double* **sin**(*double x*) # STANDARDS *int* **abs**(*int j*) *double* **sin**(*double x*) # HISTORY *int* **abs**(*int j*) *double* **sin**(*double x*) # AUTHORS *int* **abs**(*int j*) *double* **sin**(*double x*) # CAVEATS *int* **abs**(*int j*) *double* **sin**(*double x*) # BUGS *int* **abs**(*int j*) *double* **sin**(*double x*) # CUSTOM *int* **abs**(*int j*); *double* **sin**(*double x*); OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Fo/warn.in010064400017530001753000000007571363444077000176310ustar00schwarzeschwarze.\" $OpenBSD: warn.in,v 1.3 2019/09/13 19:18:48 schwarze Exp $ .Dd $Mdocdate: September 13 2019 $ .Dt FO-WARN 1 .Os .Sh NAME .Nm Fo-warn .Nd warnings related to function blocks .Sh SYNOPSIS .Ft double .Fo sin() .Fa "double x" .Fc .Ft double .Fn atan2 "double y, double x" .Ft int .Fn close) "int fd" .Ft typedef void .Fn (handler) int .Ft typedef void .Fn (*fp) int .Ft int .Fn (open "const char *path" .Ft FILE * .Fn (*popen "const char *cmd" .Ft void .Fn (trail)x void .Ft void .Fn *star void mandoc-1.14.6/regress/mdoc/Fo/warn.out_ascii010064400017530001753000000016631363444077000211770ustar00schwarzeschwarzeFO-WARN(1) General Commands Manual FO-WARN(1) NNAAMMEE FFoo--wwaarrnn - warnings related to function blocks SSYYNNOOPPSSIISS _d_o_u_b_l_e ssiinn(())(_d_o_u_b_l_e _x); _d_o_u_b_l_e aattaann22(_d_o_u_b_l_e _y_, _d_o_u_b_l_e _x); _i_n_t cclloossee))(_i_n_t _f_d); _t_y_p_e_d_e_f _v_o_i_d ((hhaannddlleerr))(_i_n_t); _t_y_p_e_d_e_f _v_o_i_d ((**ffpp))(_i_n_t); _i_n_t ((ooppeenn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h); _F_I_L_E _* ((**ppooppeenn(_c_o_n_s_t _c_h_a_r _*_c_m_d); _v_o_i_d ((ttrraaiill))xx(_v_o_i_d); _v_o_i_d **ssttaarr(_v_o_i_d); OpenBSD September 13, 2019 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/warn.out_lint010064400017530001753000000006451363444077000210540ustar00schwarzeschwarzemandoc: warn.in:10:8: WARNING: parenthesis in function name: sin() mandoc: warn.in:14:19: WARNING: comma in function argument: double y, double x mandoc: warn.in:16:10: WARNING: parenthesis in function name: close) mandoc: warn.in:22:5: WARNING: parenthesis in function name: (open mandoc: warn.in:24:5: WARNING: parenthesis in function name: (*popen mandoc: warn.in:26:5: WARNING: parenthesis in function name: (trail)x mandoc-1.14.6/regress/mdoc/Fo/warn.out_markdown010064400017530001753000000007421363444077000217260ustar00schwarzeschwarzeFO-WARN(1) - General Commands Manual # NAME **Fo-warn** - warnings related to function blocks # SYNOPSIS *double* **sin()**(*double x*); *double* **atan2**(*double y, double x*); *int* **close)**(*int fd*); *typedef void* **(handler)**(*int*); *typedef void* **(\*fp)**(*int*); *int* **(open**(*const char \*path*); *FILE \*‌* **(\*popen**(*const char \*cmd*); *void* **(trail)x**(*void*); *void* **\*star**(*void*); OpenBSD - September 13, 2019 mandoc-1.14.6/regress/mdoc/Fo/punct.out_lint010064400017530001753000000003401312673157200212250ustar00schwarzeschwarzemandoc: punct.in:10:8: STYLE: no blank before trailing delimiter: Fn sin. mandoc: punct.in:12:12: STYLE: no blank before trailing delimiter: Fa y: mandoc: punct.in:14:18: STYLE: no blank before trailing delimiter: Ft float: mandoc-1.14.6/regress/mdoc/Fo/tag.in010064400017530001753000000005231363272363400174250ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt FO-TAG 1 .Os .Sh NAME .Nm Fo-tag .Nd tagging of function name macros .Sh DESCRIPTION BEGINTEST .Pp automatic: .Fn first and .Fn second .Pp .Fn second and .Fn first .Pp explicit: .Tg e3 .Fn third and .Tg e4 .Fo fourth .Fa void .Fc .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Fo/tag.out_ascii010064400017530001753000000007331363272363400210010ustar00schwarzeschwarzeFO-TAG(1) General Commands Manual FO-TAG(1) NNAAMMEE FFoo--ttaagg - tagging of function name macros DDEESSCCRRIIPPTTIIOONN BEGINTEST automatic: ffiirrsstt() and sseeccoonndd() sseeccoonndd() and ffiirrsstt() explicit: tthhiirrdd() and ffoouurrtthh(_v_o_i_d) ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/tag.out_html010064400017530001753000000010071367274434200206530ustar00schwarzeschwarze

automatic: () and second()

() and first()

explicit: () and (void);

mandoc-1.14.6/regress/mdoc/Fo/tag.out_markdown010064400017530001753000000004141363272363400215270ustar00schwarzeschwarzeFO-TAG(1) - General Commands Manual # NAME **Fo-tag** - tagging of function name macros # DESCRIPTION BEGINTEST automatic: **first**() and **second**() **second**() and **first**() explicit: **third**() and **fourth**(*void*) ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Fo/tag.out_tag010064400017530001753000000002311372346556100204600ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 first tag.mandoc_ascii 9 second tag.mandoc_ascii 11 e3 tag.mandoc_ascii 13 e4 tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Fo/transp.in010064400017530001753000000005141362561734300201620ustar00schwarzeschwarze.\" $OpenBSD: transp.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .Dd $Mdocdate: February 27 2020 $ .Dt FO-TRANSP 1 .Os .Sh NAME .Nm Fo-transp .Nd transparent nodes among function argument macros .Sh SYNOPSIS .Ft type .Fo func .Fa one .Tg one .Fa two .Tg two .Fc .Sh DESCRIPTION .Ft type .Fo func .Fa one .Tg one .Fa two .Tg two .Fc mandoc-1.14.6/regress/mdoc/Fo/transp.out_ascii010064400017530001753000000006561362561734300215420ustar00schwarzeschwarzeFO-TRANSP(1) General Commands Manual FO-TRANSP(1) NNAAMMEE FFoo--ttrraannsspp - transparent nodes among function argument macros SSYYNNOOPPSSIISS _t_y_p_e ffuunncc(_o_n_e, _t_w_o); DDEESSCCRRIIPPTTIIOONN _t_y_p_e ffuunncc(_o_n_e, _t_w_o) OpenBSD February 27, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Fo/transp.out_markdown010064400017530001753000000003521362561734300222650ustar00schwarzeschwarzeFO-TRANSP(1) - General Commands Manual # NAME **Fo-transp** - transparent nodes among function argument macros # SYNOPSIS *type* **func**(*one*, *two*); # DESCRIPTION *type* **func**(*one*, *two*) OpenBSD - February 27, 2020 mandoc-1.14.6/regress/mdoc/Ft004075500017530001753000000000001412314056600162445ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ft/Makefile010064400017530001753000000001611306010567400177560ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2012/07/09 17:52:09 schwarze Exp $ REGRESS_TARGETS = font .include mandoc-1.14.6/regress/mdoc/Ft/font.in010064400017530001753000000004031313667012700176170ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FT-FONT 1 .Os .Sh NAME .Nm Ft-font .Nd changing fonts inside the function return type macro .Sh DESCRIPTION normal text .Ft emphasis\\fBbold\\fPback trailing text mandoc-1.14.6/regress/mdoc/Ft/font.out_ascii010064400017530001753000000005621313667012700211760ustar00schwarzeschwarzeFT-FONT(1) General Commands Manual FT-FONT(1) NNAAMMEE FFtt--ffoonntt - changing fonts inside the function return type macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ft/font.out_markdown010064400017530001753000000003121313667012700217210ustar00schwarzeschwarzeFT-FONT(1) - General Commands Manual # NAME **Ft-font** - changing fonts inside the function return type macro # DESCRIPTION normal text *emphasis**bold**back* trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ic004075500017530001753000000000001412314056600162265ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ic/Makefile010064400017530001753000000002731363444077000177520ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2020/03/13 00:31:06 schwarze Exp $ REGRESS_TARGETS = font noarg punct tag TAG_TARGETS = tag LINT_TARGETS = noarg HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Ic/font.in010064400017530001753000000003771313667012700176130ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IC-FONT 1 .Os .Sh NAME .Nm Ic-font .Nd changing fonts inside the internal command macro .Sh DESCRIPTION normal text .Ic bold\\fIemphasis\\fPback trailing text mandoc-1.14.6/regress/mdoc/Ic/font.out_ascii010064400017530001753000000005561313667012700211630ustar00schwarzeschwarzeIC-FONT(1) General Commands Manual IC-FONT(1) NNAAMMEE IIcc--ffoonntt - changing fonts inside the internal command macro DDEESSCCRRIIPPTTIIOONN normal text bboolldd_e_m_p_h_a_s_i_sbbaacckk trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ic/font.out_markdown010064400017530001753000000003061313667012700217060ustar00schwarzeschwarzeIC-FONT(1) - General Commands Manual # NAME **Ic-font** - changing fonts inside the internal command macro # DESCRIPTION normal text **bold*emphasis*back** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ic/noarg.in010064400017530001753000000003751313667012700177510ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IC-NOARG 1 .Os .Sh NAME .Nm Ic-noarg .Nd interactive command without an argument .Sh DESCRIPTION with command: .Ic ls. no command: .Ic end of test document mandoc-1.14.6/regress/mdoc/Ic/noarg.out_ascii010064400017530001753000000005261313667012700213200ustar00schwarzeschwarzeIC-NOARG(1) General Commands Manual IC-NOARG(1) NNAAMMEE IIcc--nnooaarrgg - interactive command without an argument DDEESSCCRRIIPPTTIIOONN with command: llss.. no command: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ic/noarg.out_lint010064400017530001753000000002021313667012700211650ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Ic mandoc: noarg.in:10:7: STYLE: no blank before trailing delimiter: Ic ls. mandoc-1.14.6/regress/mdoc/Ic/noarg.out_markdown010064400017530001753000000003051313667012700220450ustar00schwarzeschwarzeIC-NOARG(1) - General Commands Manual # NAME **Ic-noarg** - interactive command without an argument # DESCRIPTION with command: **ls.** no command: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ic/punct.in010064400017530001753000000010111312673157400177630ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt Ic-PUNCT 1 .Os .Sh NAME .Nm Ic-punct .Nd punctuation handling by the Ic macro .Sh DESCRIPTION closing punctuation .Ic a ) only one .Ic ) only more than one .Ic ) ) middle .Ic a ) z start .Ic ) z dot .Ic . z comma .Ic , z semicolon .Ic ; z colon .Ic : z quest .Ic ? z excl .Ic ! z paren .Ic ) z bracket .Ic ] z bar .Ic | m op paren .Ic ( a op bracket .Ic [ a .Pp quoted punctuation: .Ic a "(" b "|" c ")" d "," "Em" italic . mandoc-1.14.6/regress/mdoc/Ic/punct.out_ascii010064400017530001753000000011101312673157400213340ustar00schwarzeschwarzeIc-PUNCT(1) General Commands Manual Ic-PUNCT(1) NNAAMMEE IIcc--ppuunncctt - punctuation handling by the Ic macro DDEESSCCRRIIPPTTIIOONN closing punctuation aa) only one ) only more than one )) middle aa) zz start ) zz dot . zz comma , zz semicolon ; zz colon : zz quest ? zz excl ! zz paren ) zz bracket ] zz bar | mm op paren (aa op bracket [aa quoted punctuation: aa (bb | cc) dd, _i_t_a_l_i_c. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ic/punct.out_markdown010064400017530001753000000007071312673157400221010ustar00schwarzeschwarzeIc-PUNCT(1) - General Commands Manual # NAME **Ic-punct** - punctuation handling by the Ic macro # DESCRIPTION closing punctuation **a**) only one ) only more than one )) middle **a**) **z** start ) **z** dot . **z** comma , **z** semicolon ; **z** colon : **z** quest ? **z** excl ! **z** paren ) **z** bracket ] **z** bar | **m** op paren (**a** op bracket \[**a** quoted punctuation: **a** (**b** | **c**) **d**, *italic*. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ic/tag.in010064400017530001753000000004431363272363500174160ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt IC-TAG 1 .Os .Sh NAME .Nm Ic-tag .Nd tagging of internal command macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Ic one | two text .It Xo .Ic three .Xc text .El .Tg .Ic four .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Ic/tag.out_ascii010064400017530001753000000006071363272363500207710ustar00schwarzeschwarzeIC-TAG(1) General Commands Manual IC-TAG(1) NNAAMMEE IIcc--ttaagg - tagging of internal command macros DDEESSCCRRIIPPTTIIOONN BEGINTEST oonnee | ttwwoo text tthhrreeee text ffoouurr ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Ic/tag.out_html010064400017530001753000000006131367274434300206450ustar00schwarzeschwarze
|
text
text
mandoc-1.14.6/regress/mdoc/Ic/tag.out_markdown010064400017530001753000000003221363272363500215150ustar00schwarzeschwarzeIC-TAG(1) - General Commands Manual # NAME **Ic-tag** - tagging of internal command macros # DESCRIPTION BEGINTEST **one** | **two** > text **three** > text **four** ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Ic/tag.out_tag010064400017530001753000000002301372346556100204460ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three tag.mandoc_ascii 12 four tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/In004075500017530001753000000000001412314056600162415ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/In/Makefile010064400017530001753000000002301306010567600177520ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2015/02/06 01:07:07 schwarze Exp $ REGRESS_TARGETS = break eos font noarg LINT_TARGETS = noarg .include mandoc-1.14.6/regress/mdoc/In/break.in010064400017530001753000000011211313667012700177300ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.6 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IN-BREAK 2 .Os .Sh NAME .Nm In-break .Nd line break before header include file .Sh SYNOPSIS .In fcntl.h .Ft int .Fn open "const char *path" "int flags" "mode_t mode" .In sys/types.h .In unistd.h .Ft int .Fn dup "int oldd" .Ft ssize_t .Fn write "int d" "const void *buf" "size_t nbytes" .Sh DESCRIPTION .In fcntl.h .Ft int .Fn open "const char *path" "int flags" "mode_t mode" .In sys/types.h .In unistd.h .Ft int .Fn dup "int oldd" .Ft ssize_t .Fn write "int d" "const void *buf" "size_t nbytes" mandoc-1.14.6/regress/mdoc/In/break.out_ascii010064400017530001753000000023401313667012700213050ustar00schwarzeschwarzeIN-BREAK(2) System Calls Manual IN-BREAK(2) NNAAMMEE IInn--bbrreeaakk - line break before header include file SSYYNNOOPPSSIISS ##iinncclluuddee <> _i_n_t ooppeenn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _f_l_a_g_s, _m_o_d_e___t _m_o_d_e); ##iinncclluuddee <> ##iinncclluuddee <> _i_n_t dduupp(_i_n_t _o_l_d_d); _s_s_i_z_e___t wwrriittee(_i_n_t _d, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); DDEESSCCRRIIPPTTIIOONN <_f_c_n_t_l_._h> _i_n_t ooppeenn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _f_l_a_g_s, _m_o_d_e___t _m_o_d_e) <_s_y_s_/_t_y_p_e_s_._h> <_u_n_i_s_t_d_._h> _i_n_t dduupp(_i_n_t _o_l_d_d) _s_s_i_z_e___t wwrriittee(_i_n_t _d, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/In/break.out_markdown010064400017530001753000000011471313667012700220430ustar00schwarzeschwarzeIN-BREAK(2) - System Calls Manual # NAME **In-break** - line break before header include file # SYNOPSIS **#include <fcntl.h>** *int* **open**(*const char \*path*, *int flags*, *mode\_t mode*); **#include <sys/types.h>** **#include <unistd.h>** *int* **dup**(*int oldd*); *ssize\_t* **write**(*int d*, *const void \*buf*, *size\_t nbytes*); # DESCRIPTION <*fcntl.h*> *int* **open**(*const char \*path*, *int flags*, *mode\_t mode*) <*sys/types.h*> <*unistd.h*> *int* **dup**(*int oldd*) *ssize\_t* **write**(*int d*, *const void \*buf*, *size\_t nbytes*) OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/In/eos.in010064400017530001753000000003671313667012700174450ustar00schwarzeschwarze.\" $OpenBSD: eos.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IN-EOS 1 .Os .Sh NAME .Nm In-eos .Nd end of sentence handling after the include macro .Sh DESCRIPTION Let's use .In string.h . And then something else. mandoc-1.14.6/regress/mdoc/In/eos.out_ascii010064400017530001753000000005401313667012700210070ustar00schwarzeschwarzeIN-EOS(1) General Commands Manual IN-EOS(1) NNAAMMEE IInn--eeooss - end of sentence handling after the include macro DDEESSCCRRIIPPTTIIOONN Let's use <_s_t_r_i_n_g_._h>. And then something else. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/In/eos.out_markdown010064400017530001753000000003071313667012700215420ustar00schwarzeschwarzeIN-EOS(1) - General Commands Manual # NAME **In-eos** - end of sentence handling after the include macro # DESCRIPTION Let's use <*string.h*>. And then something else. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/In/font.in010064400017530001753000000004351313667012700176210ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IN-FONT 2 .Os .Sh NAME .Nm In-font .Nd changing the font inside the include macro .Sh DESCRIPTION normal text .In prefix\\fBheader\\fPsuffix | after ":" punctuation "Sy" bold trailing text mandoc-1.14.6/regress/mdoc/In/font.out_ascii010064400017530001753000000006221313667012700211700ustar00schwarzeschwarzeIN-FONT(2) System Calls Manual IN-FONT(2) NNAAMMEE IInn--ffoonntt - changing the font inside the include macro DDEESSCCRRIIPPTTIIOONN normal text <_p_r_e_f_i_xhheeaaddeerr_s_u_f_f_i_x> | after: punctuation bboolldd trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/In/font.out_markdown010064400017530001753000000003411313667012700217200ustar00schwarzeschwarzeIN-FONT(2) - System Calls Manual # NAME **In-font** - changing the font inside the include macro # DESCRIPTION normal text <*prefix**header**suffix*> | after: punctuation **bold** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/In/noarg.in010064400017530001753000000005431313667012700177610ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IN-NOARG 2 .Os .Sh NAME .Nm In-noarg .Nd include file macros without argument .Sh SYNOPSIS .In math.h .Ft double .Fn sin "double x" .In .Ft double .Fn cos "double x" .Sh DESCRIPTION .In math.h: .Ft double .Fn sin "double x" .In .Ft double .Fn cos "double x" mandoc-1.14.6/regress/mdoc/In/noarg.out_ascii010064400017530001753000000011571313667012700213340ustar00schwarzeschwarzeIN-NOARG(2) System Calls Manual IN-NOARG(2) NNAAMMEE IInn--nnooaarrgg - include file macros without argument SSYYNNOOPPSSIISS ##iinncclluuddee <> _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x); _d_o_u_b_l_e ccooss(_d_o_u_b_l_e _x); DDEESSCCRRIIPPTTIIOONN <_m_a_t_h_._h_:> _d_o_u_b_l_e ssiinn(_d_o_u_b_l_e _x) _d_o_u_b_l_e ccooss(_d_o_u_b_l_e _x) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/In/noarg.out_lint010064400017530001753000000003001313667012700211770ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: In mandoc: noarg.in:19:2: WARNING: skipping empty macro: In mandoc: noarg.in:16:11: STYLE: no blank before trailing delimiter: In math.h: mandoc-1.14.6/regress/mdoc/In/noarg.out_markdown010064400017530001753000000004701313667012700220630ustar00schwarzeschwarzeIN-NOARG(2) - System Calls Manual # NAME **In-noarg** - include file macros without argument # SYNOPSIS **#include <math.h>** *double* **sin**(*double x*); *double* **cos**(*double x*); # DESCRIPTION <*math.h:*> *double* **sin**(*double x*) *double* **cos**(*double x*) OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Lb004075500017530001753000000000001412314056600162305ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Lb/Makefile010064400017530001753000000002251306010567600177450ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2014/07/02 20:18:42 schwarze Exp $ REGRESS_TARGETS = break badargs eos LINT_TARGETS = badargs .include mandoc-1.14.6/regress/mdoc/Lb/badargs.in010064400017530001753000000003411313667012700202410ustar00schwarzeschwarze.\" $OpenBSD: badargs.in,v 1.5 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LB-BADARGS 3 .Os .Sh NAME .Nm Lb-badargs .Nd bad arguments to the library macro .Sh LIBRARY .Lb murks. .Lb .Lb mylib another. mandoc-1.14.6/regress/mdoc/Lb/badargs.out_ascii010064400017530001753000000005011313667012700216100ustar00schwarzeschwarzeLB-BADARGS(3) Library Functions Manual LB-BADARGS(3) NNAAMMEE LLbb--bbaaddaarrggss - bad arguments to the library macro LLIIBBRRAARRYY library "murks." library "mylib" another. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Lb/badargs.out_lint010064400017530001753000000005401313667012700214710ustar00schwarzeschwarzemandoc: badargs.in:10:2: WARNING: skipping empty macro: Lb mandoc: badargs.in:9:10: STYLE: no blank before trailing delimiter: Lb murks. mandoc: badargs.in:9:5: WARNING: unknown library name: Lb murks. mandoc: badargs.in:11:18: STYLE: no blank before trailing delimiter: Lb ... another. mandoc: badargs.in:11:5: WARNING: unknown library name: Lb mylib mandoc-1.14.6/regress/mdoc/Lb/badargs.out_markdown010064400017530001753000000003161313667012700223460ustar00schwarzeschwarzeLB-BADARGS(3) - Library Functions Manual # NAME **Lb-badargs** - bad arguments to the library macro # LIBRARY library “murks.” library “mylib” another. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Lb/break.in010064400017530001753000000003571313667012700177310ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LB-BREAK 3 .Os .Sh NAME .Nm Lb-break .Nd output line breaks after the library macro .Sh LIBRARY .Lb mylib text .Sh DESCRIPTION .Lb mylib text mandoc-1.14.6/regress/mdoc/Lb/break.out_ascii010064400017530001753000000005531313667012700213000ustar00schwarzeschwarzeLB-BREAK(3) Library Functions Manual LB-BREAK(3) NNAAMMEE LLbb--bbrreeaakk - output line breaks after the library macro LLIIBBRRAARRYY library "mylib" text DDEESSCCRRIIPPTTIIOONN library "mylib" text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Lb/break.out_markdown010064400017530001753000000003421313667012700220260ustar00schwarzeschwarzeLB-BREAK(3) - Library Functions Manual # NAME **Lb-break** - output line breaks after the library macro # LIBRARY library “mylib” text # DESCRIPTION library “mylib” text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Lb/eos.in010064400017530001753000000003711313667012700174270ustar00schwarzeschwarze.\" $OpenBSD: eos.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LB-EOS 1 .Os .Sh NAME .Nm Lb-eos .Nd end of sentence handling after the library macro .Sh DESCRIPTION Let's use the .Lb mylib . And some other libraries. mandoc-1.14.6/regress/mdoc/Lb/eos.out_ascii010064400017530001753000000005321313667012700207770ustar00schwarzeschwarzeLB-EOS(1) General Commands Manual LB-EOS(1) NNAAMMEE LLbb--eeooss - end of sentence handling after the library macro DDEESSCCRRIIPPTTIIOONN Let's use the library "mylib". And some other libraries. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Lb/eos.out_markdown010064400017530001753000000003301313667012700215250ustar00schwarzeschwarzeLB-EOS(1) - General Commands Manual # NAME **Lb-eos** - end of sentence handling after the library macro # DESCRIPTION Let's use the library “mylib”. And some other libraries. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Li004075500017530001753000000000001412314056600162375ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Li/Makefile010064400017530001753000000002711363444077100177620ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2020/03/13 00:31:06 schwarze Exp $ REGRESS_TARGETS = arg punct font tag TAG_TARGETS = tag LINT_TARGETS = punct HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Li/font.in010064400017530001753000000004011313667013000176020ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LI-FONT 1 .Os .Sh NAME .Nm Li-font .Nd changing fonts inside the literal in-line macro .Sh DESCRIPTION normal text .Li literal\\fIemphasis\\fPback trailing text mandoc-1.14.6/regress/mdoc/Li/font.out_ascii010064400017530001753000000005401313667013000211570ustar00schwarzeschwarzeLI-FONT(1) General Commands Manual LI-FONT(1) NNAAMMEE LLii--ffoonntt - changing fonts inside the literal in-line macro DDEESSCCRRIIPPTTIIOONN normal text literal_e_m_p_h_a_s_i_sback trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Li/font.out_markdown010064400017530001753000000003041313667013000217070ustar00schwarzeschwarzeLI-FONT(1) - General Commands Manual # NAME **Li-font** - changing fonts inside the literal in-line macro # DESCRIPTION normal text `literalemphasisback` trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Li/punct.in010064400017530001753000000021321313667013000177700ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.7 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LI-PUNCT 1 .Os .Sh NAME .Nm Li-punct .Nd punctuation following a literal macro .Sh DESCRIPTION Leading punctuation: .Li ( b .Li "[" b .Li | b .Li . b .Li , b .Li ; b .Li : b .Li ? b .Li ! b .Li ) b .Li ] b .Pp Trailing punctuation: .Li a ( .Li a [ .Li a | .Li a . .Li a "," .Li a ; .Li a : .Li a ? .Li a ! .Li a ) .Li a ] .Pp Middle punctuation: .Li a ( b .Li a [ b .Li a | b .Li a . b .Li a , b .Li a ";" b .Li a : b .Li a ? b .Li a ! b .Li a ")" b .Li a ] b .Pp Isolated punctuation: .Li a Li ( Li b .Li a Li [ Li b .Li a Li | Li b .Li a Li . Li b .Li a Li , Li b .Li a Li ; Li b .Li a Li : Li b .Li a Li ? Li b .Li a Li ! Li b .Li a Li ) Li b .Li a Li ] Li b .Pp Isolated trailing punctuation: .Li a Li ( .Li a Li [ .Li a Li | .Li a Li . .Li a Li , .Li a Li ; .Li a Li : .Li a Li ? .Li a Li ! .Li a Li ) .Li a Li ] .Pp Multiple isolated punctuation: .Li a Li ( [ Li b .Li a Li ) ] Li b .Pp Multiple punctuation: .Li [ ( arg ) ] . .Pp Quoted: .Li "a . b Nm" "Sy" bold .Li ". b Nm" .Li "." .Pp Missing blank: .Li a. mandoc-1.14.6/regress/mdoc/Li/punct.out_ascii010064400017530001753000000015121313667013000213420ustar00schwarzeschwarzeLI-PUNCT(1) General Commands Manual LI-PUNCT(1) NNAAMMEE LLii--ppuunncctt - punctuation following a literal macro DDEESSCCRRIIPPTTIIOONN Leading punctuation: (b [b | b . b , b ; b : b ? b ! b ) b ] b Trailing punctuation: a ( a [ a | a. a, a; a: a? a! a) a] Middle punctuation: a (b a [b a | b a. b a, b a; b a: b a? b a! b a) b a] b Isolated punctuation: a (b a [b a | b a . b a , b a ; b a : b a ? b a ! b a ) b a ] b Isolated trailing punctuation: a ( a [ a | a . a , a ; a : a ? a ! a ) a ] Multiple isolated punctuation: a ([b a )] b Multiple punctuation: [(arg)]. Quoted: a . b Nm bboolldd . b Nm . Missing blank: a. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Li/punct.out_lint010064400017530001753000000027311313667013000212240ustar00schwarzeschwarzemandoc: punct.in:49:7: WARNING: skipping empty macro: Li mandoc: punct.in:50:7: WARNING: skipping empty macro: Li mandoc: punct.in:51:7: WARNING: skipping empty macro: Li mandoc: punct.in:52:7: WARNING: skipping empty macro: Li mandoc: punct.in:53:7: WARNING: skipping empty macro: Li mandoc: punct.in:54:7: WARNING: skipping empty macro: Li mandoc: punct.in:55:7: WARNING: skipping empty macro: Li mandoc: punct.in:56:7: WARNING: skipping empty macro: Li mandoc: punct.in:57:7: WARNING: skipping empty macro: Li mandoc: punct.in:58:7: WARNING: skipping empty macro: Li mandoc: punct.in:59:7: WARNING: skipping empty macro: Li mandoc: punct.in:62:7: WARNING: skipping empty macro: Li mandoc: punct.in:63:7: WARNING: skipping empty macro: Li mandoc: punct.in:64:7: WARNING: skipping empty macro: Li mandoc: punct.in:65:7: WARNING: skipping empty macro: Li mandoc: punct.in:66:7: WARNING: skipping empty macro: Li mandoc: punct.in:67:7: WARNING: skipping empty macro: Li mandoc: punct.in:68:7: WARNING: skipping empty macro: Li mandoc: punct.in:69:7: WARNING: skipping empty macro: Li mandoc: punct.in:70:7: WARNING: skipping empty macro: Li mandoc: punct.in:71:7: WARNING: skipping empty macro: Li mandoc: punct.in:72:7: WARNING: skipping empty macro: Li mandoc: punct.in:75:7: WARNING: skipping empty macro: Li mandoc: punct.in:76:7: WARNING: skipping empty macro: Li mandoc: punct.in:84:2: WARNING: skipping empty macro: Li mandoc: punct.in:87:6: STYLE: no blank before trailing delimiter: Li a. mandoc-1.14.6/regress/mdoc/Li/punct.out_markdown010064400017530001753000000014531313667013000221000ustar00schwarzeschwarzeLI-PUNCT(1) - General Commands Manual # NAME **Li-punct** - punctuation following a literal macro # DESCRIPTION Leading punctuation: (`b` \[`b` | `b` . `b` , `b` ; `b` : `b` ? `b` ! `b` ) `b` ] `b` Trailing punctuation: `a` ( `a` \[ `a` | `a`. `a`, `a`; `a`: `a`? `a`! `a`) `a`] Middle punctuation: `a` (`b` `a` \[`b` `a` | `b` `a`. `b` `a`, `b` `a`; `b` `a`: `b` `a`? `b` `a`! `b` `a`) `b` `a`] `b` Isolated punctuation: `a` (`b` `a` \[`b` `a` | `b` `a` . `b` `a` , `b` `a` ; `b` `a` : `b` `a` ? `b` `a` ! `b` `a` ) `b` `a` ] `b` Isolated trailing punctuation: `a` ( `a` \[ `a` | `a` . `a` , `a` ; `a` : `a` ? `a` ! `a` ) `a` ] Multiple isolated punctuation: `a` (\[`b` `a` )] `b` Multiple punctuation: \[(`arg`)]. Quoted: `a . b Nm` **bold** `. b Nm` . Missing blank: `a.` OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Li/arg.in010064400017530001753000000005161340721765300174240ustar00schwarzeschwarze.\" $OpenBSD: arg.in,v 1.1 2018/12/21 16:58:49 schwarze Exp $ .Dd $Mdocdate: December 21 2018 $ .Dt LI-ARG 1 .Os .Sh NAME .Nm Li-arg .Nd escape sequences in arguments of in-line macros .Sh DESCRIPTION .ds a \(at unquoted unescaped: .Li \*a .Pp quoted unescaped: .Li "\*a" .Pp unquoted escaped: .Li \\*a .Pp quoted escaped: .Li "\\*a" mandoc-1.14.6/regress/mdoc/Li/arg.out_ascii010064400017530001753000000006011340721765300207700ustar00schwarzeschwarzeLI-ARG(1) General Commands Manual LI-ARG(1) NNAAMMEE LLii--aarrgg - escape sequences in arguments of in-line macros DDEESSCCRRIIPPTTIIOONN unquoted unescaped: @ quoted unescaped: @ unquoted escaped: @ quoted escaped: @ OpenBSD December 21, 2018 OpenBSD mandoc-1.14.6/regress/mdoc/Li/arg.out_markdown010064400017530001753000000003621340721765300215260ustar00schwarzeschwarzeLI-ARG(1) - General Commands Manual # NAME **Li-arg** - escape sequences in arguments of in-line macros # DESCRIPTION unquoted unescaped: `@` quoted unescaped: `@` unquoted escaped: `@` quoted escaped: `@` OpenBSD - December 21, 2018 mandoc-1.14.6/regress/mdoc/Li/tag.in010064400017530001753000000004371363272363600174330ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt LI-TAG 1 .Os .Sh NAME .Nm Li-tag .Nd tagging of literal font macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Li one | two text .It Xo .Li three .Xc text .El .Tg .Li four .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Li/tag.out_ascii010064400017530001753000000005451363272363600210040ustar00schwarzeschwarzeLI-TAG(1) General Commands Manual LI-TAG(1) NNAAMMEE LLii--ttaagg - tagging of literal font macros DDEESSCCRRIIPPTTIIOONN BEGINTEST one | two text three text four ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Li/tag.out_html010064400017530001753000000006131367274434300206560ustar00schwarzeschwarze
|
text
text
mandoc-1.14.6/regress/mdoc/Li/tag.out_markdown010064400017530001753000000003061363272363600215310ustar00schwarzeschwarzeLI-TAG(1) - General Commands Manual # NAME **Li-tag** - tagging of literal font macros # DESCRIPTION BEGINTEST `one` | `two` > text `three` > text `four` ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Li/tag.out_tag010064400017530001753000000002301372346556200204600ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three tag.mandoc_ascii 12 four tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Lk004075500017530001753000000000001412314056600162415ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Lk/Makefile010064400017530001753000000003521306010570000177430ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2014/07/02 20:18:42 schwarze Exp $ REGRESS_TARGETS = link noarg font LINT_TARGETS = noarg # it's unclear what font changes in link destinations should do SKIP_MARKDOWN ?= font .include mandoc-1.14.6/regress/mdoc/Lk/font.in010064400017530001753000000004251313667013000176120ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LK-FONT 1 .Os .Sh NAME .Nm Lk-font .Nd changing the font inside the hyperlink macro .Sh DESCRIPTION normal text .Lk http://www.\\fIopenbsd\\fP.org/ Open\\fBBSD\\fPweb trailing text mandoc-1.14.6/regress/mdoc/Lk/font.out_ascii010064400017530001753000000006371313667013000211700ustar00schwarzeschwarzeLK-FONT(1) General Commands Manual LK-FONT(1) NNAAMMEE LLkk--ffoonntt - changing the font inside the hyperlink macro DDEESSCCRRIIPPTTIIOONN normal text _O_p_e_nBBSSDD_w_e_b: hhttttpp::////wwwwww.._o_p_e_n_b_s_d..oorrgg// trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Lk/link.in010064400017530001753000000007651313667013000176100ustar00schwarzeschwarze.\" $OpenBSD: link.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LK-LINK 1 .Os .Sh NAME .Nm Lk-link .Nd formatting of hyperlinks .Sh DESCRIPTION Here are some web sites of BSD operating systems: .Lk http://www.freebsd.org/ FreeBSD .Lk http://www.netbsd.org/ NetBSD .Lk http://www.openbsd.org/ OpenBSD .Sh SEE ALSO Here are some web sites of BSD operating systems: .Lk http://www.freebsd.org/ FreeBSD .Lk http://www.netbsd.org/ NetBSD .Lk http://www.openbsd.org/ OpenBSD mandoc-1.14.6/regress/mdoc/Lk/link.out_ascii010064400017530001753000000017021313667013000211510ustar00schwarzeschwarzeLK-LINK(1) General Commands Manual LK-LINK(1) NNAAMMEE LLkk--lliinnkk - formatting of hyperlinks DDEESSCCRRIIPPTTIIOONN Here are some web sites of BSD operating systems: _F_r_e_e_B_S_D: hhttttpp::////wwwwww..ffrreeeebbssdd..oorrgg// _N_e_t_B_S_D: hhttttpp::////wwwwww..nneettbbssdd..oorrgg// _O_p_e_n_B_S_D: hhttttpp::////wwwwww..ooppeennbbssdd..oorrgg// SSEEEE AALLSSOO Here are some web sites of BSD operating systems: _F_r_e_e_B_S_D: hhttttpp::////wwwwww..ffrreeeebbssdd..oorrgg// _N_e_t_B_S_D: hhttttpp::////wwwwww..nneettbbssdd..oorrgg// _O_p_e_n_B_S_D: hhttttpp::////wwwwww..ooppeennbbssdd..oorrgg// OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Lk/link.out_markdown010064400017530001753000000006741313667013000217120ustar00schwarzeschwarzeLK-LINK(1) - General Commands Manual # NAME **Lk-link** - formatting of hyperlinks # DESCRIPTION Here are some web sites of BSD operating systems: [FreeBSD](http://www.freebsd.org/) [NetBSD](http://www.netbsd.org/) [OpenBSD](http://www.openbsd.org/) # SEE ALSO Here are some web sites of BSD operating systems: [FreeBSD](http://www.freebsd.org/) [NetBSD](http://www.netbsd.org/) [OpenBSD](http://www.openbsd.org/) OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Lk/noarg.in010064400017530001753000000006631313667013000177560ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.6 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LK-NOARG 1 .Os .Sh NAME .Nm Lk-noarg .Nd hyperlink macro without arguments .Sh DESCRIPTION multiple arguments .Lk http://www.bsd.lv/ the bsd.lv project , .Lk http://www.gnu.org/software/groff/ GNU troff "," two arguments .Lk http://mdocml.bsd.lv/ mandoc, one argument .Lk http://www.openbsd.org/, no argument .Lk .Pp end of test document mandoc-1.14.6/regress/mdoc/Lk/noarg.out_ascii010064400017530001753000000014051333010372000213120ustar00schwarzeschwarzeLK-NOARG(1) General Commands Manual LK-NOARG(1) NNAAMMEE LLkk--nnooaarrgg - hyperlink macro without arguments DDEESSCCRRIIPPTTIIOONN multiple arguments _t_h_e _b_s_d_._l_v _p_r_o_j_e_c_t: hhttttpp::////wwwwww..bbssdd..llvv//, _G_N_U _t_r_o_f_f: hhttttpp::////wwwwww..ggnnuu..oorrgg//ssooffttwwaarree//ggrrooffff//, two arguments _m_a_n_d_o_c_,: hhttttpp::////mmddooccmmll..bbssdd..llvv// one argument hhttttpp::////wwwwww..ooppeennbbssdd..oorrgg//,, no argument end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Lk/noarg.out_lint010064400017530001753000000003521313667013000212000ustar00schwarzeschwarzemandoc: noarg.in:17:2: WARNING: skipping empty macro: Lk mandoc: noarg.in:13:33: STYLE: no blank before trailing delimiter: Lk ... mandoc, mandoc: noarg.in:15:28: STYLE: no blank before trailing delimiter: Lk http://www.openbsd.org/, mandoc-1.14.6/regress/mdoc/Lk/noarg.out_markdown010064400017530001753000000006111313667013000220520ustar00schwarzeschwarzeLK-NOARG(1) - General Commands Manual # NAME **Lk-noarg** - hyperlink macro without arguments # DESCRIPTION multiple arguments [the bsd.lv project](http://www.bsd.lv/), [GNU troff](http://www.gnu.org/software/groff/), two arguments [mandoc,](http://mdocml.bsd.lv/) one argument [http://www.openbsd.org/,](http://www.openbsd.org/,) no argument end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ms004075500017530001753000000000001412314056600162525ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ms/Makefile010064400017530001753000000002651363444077100200000ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2020/03/13 00:58:48 schwarze Exp $ REGRESS_TARGETS = noarg font tag TAG_TARGETS = tag LINT_TARGETS = noarg HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Ms/font.in010064400017530001753000000004461313667013000176260ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt MS-FONT 1 .Os .Sh NAME .Nm Ms-font .Nd changing fonts inside the mathematical symbol macro .Sh DESCRIPTION normal text .Ms bold\\fIemphasis\\fPback | after ":" punctuation "Em" italic trailing text mandoc-1.14.6/regress/mdoc/Ms/font.out_ascii010064400017530001753000000006711313667013000211770ustar00schwarzeschwarzeMS-FONT(1) General Commands Manual MS-FONT(1) NNAAMMEE MMss--ffoonntt - changing fonts inside the mathematical symbol macro DDEESSCCRRIIPPTTIIOONN normal text bboolldd_e_m_p_h_a_s_i_sbbaacckk | aafftteerr: ppuunnccttuuaattiioonn _i_t_a_l_i_c trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ms/font.out_markdown010064400017530001753000000003571313667013000217320ustar00schwarzeschwarzeMS-FONT(1) - General Commands Manual # NAME **Ms-font** - changing fonts inside the mathematical symbol macro # DESCRIPTION normal text **bold*emphasis*back** | **after**: **punctuation** *italic* trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ms/noarg.in010064400017530001753000000003761313667013000177700ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt MS-NOARG 1 .Os .Sh NAME .Nm Ms-noarg .Nd mathematical symbol without an argument .Sh DESCRIPTION with symbol: .Ms alpha. no symbol: .Ms end of test document mandoc-1.14.6/regress/mdoc/Ms/noarg.out_ascii010064400017530001753000000005351313667013000213360ustar00schwarzeschwarzeMS-NOARG(1) General Commands Manual MS-NOARG(1) NNAAMMEE MMss--nnooaarrgg - mathematical symbol without an argument DDEESSCCRRIIPPTTIIOONN with symbol: aallpphhaa.. no symbol: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ms/noarg.out_lint010064400017530001753000000002061313667013000212070ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Ms mandoc: noarg.in:10:10: STYLE: no blank before trailing delimiter: Ms alpha. mandoc-1.14.6/regress/mdoc/Ms/noarg.out_markdown010064400017530001753000000003061313667013000220640ustar00schwarzeschwarzeMS-NOARG(1) - General Commands Manual # NAME **Ms-noarg** - mathematical symbol without an argument # DESCRIPTION with symbol: **alpha.** no symbol: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ms/tag.in010064400017530001753000000004461363272363700174470ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt MS-TAG 1 .Os .Sh NAME .Nm Ms-tag .Nd tagging of mathematical symbol macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Ms one | two text .It Xo .Ms three .Xc text .El .Tg .Ms four .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Ms/tag.out_ascii010064400017530001753000000006121363272363700210130ustar00schwarzeschwarzeMS-TAG(1) General Commands Manual MS-TAG(1) NNAAMMEE MMss--ttaagg - tagging of mathematical symbol macros DDEESSCCRRIIPPTTIIOONN BEGINTEST oonnee | ttwwoo text tthhrreeee text ffoouurr ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Ms/tag.out_html010064400017530001753000000006131367274434300206710ustar00schwarzeschwarze
|
text
text
mandoc-1.14.6/regress/mdoc/Ms/tag.out_markdown010064400017530001753000000003251363272363700215460ustar00schwarzeschwarzeMS-TAG(1) - General Commands Manual # NAME **Ms-tag** - tagging of mathematical symbol macros # DESCRIPTION BEGINTEST **one** | **two** > text **three** > text **four** ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Ms/tag.out_tag010064400017530001753000000002301372346556200204730ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three tag.mandoc_ascii 12 four tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Mt004075500017530001753000000000001412314056600162535ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Mt/Makefile010064400017530001753000000003501313667013000177630ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.5 2012/07/09 17:52:09 schwarze Exp $ REGRESS_TARGETS = simple font LINT_TARGETS = simple # it's unclear what font changes in link destinations should do SKIP_MARKDOWN ?= font .include mandoc-1.14.6/regress/mdoc/Mt/font.in010064400017530001753000000003651313667013000176270ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt MT-FONT 1 .Os .Sh NAME .Nm Mt-font .Nd changing fonts inside the mailto macro .Sh DESCRIPTION normal text .Mt emphasis\\fBbold\\fPback trailing text mandoc-1.14.6/regress/mdoc/Mt/font.out_ascii010064400017530001753000000005441313667013000211770ustar00schwarzeschwarzeMT-FONT(1) General Commands Manual MT-FONT(1) NNAAMMEE MMtt--ffoonntt - changing fonts inside the mailto macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Mt/simple.in010064400017530001753000000004571313667013000201540ustar00schwarzeschwarze.\" $OpenBSD: simple.in,v 1.6 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt MT-SIMPLE 1 .Os .Sh NAME .Nm Mt-simple .Nd mailto .Sh DESCRIPTION Please send mail to .Mt schwarze@openbsd.org ";" "Sy" bold . .Pp Pay attention to .Mt punctuation@localhost. .Pp Do not send mail to .Mt . mandoc-1.14.6/regress/mdoc/Mt/simple.out_ascii010064400017530001753000000007301313667013000215170ustar00schwarzeschwarzeMT-SIMPLE(1) General Commands Manual MT-SIMPLE(1) NNAAMMEE MMtt--ssiimmppllee - mailto DDEESSCCRRIIPPTTIIOONN Please send mail to _s_c_h_w_a_r_z_e_@_o_p_e_n_b_s_d_._o_r_g; bboolldd. Pay attention to _p_u_n_c_t_u_a_t_i_o_n_@_l_o_c_a_l_h_o_s_t_. Do not send mail to _~. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Mt/simple.out_markdown010064400017530001753000000004601313667013000222510ustar00schwarzeschwarzeMT-SIMPLE(1) - General Commands Manual # NAME **Mt-simple** - mailto # DESCRIPTION Please send mail to [schwarze@openbsd.org](mailto:schwarze@openbsd.org); **bold**. Pay attention to [punctuation@localhost.](mailto:punctuation@localhost.) Do not send mail to [~](mailto:~). OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Mt/simple.out_lint010064400017530001753000000001361312673160300213770ustar00schwarzeschwarzemandoc: simple.in:13:26: STYLE: no blank before trailing delimiter: Mt punctuation@localhost. mandoc-1.14.6/regress/mdoc/Nd004075500017530001753000000000001412314056600162345ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Nd/Makefile010064400017530001753000000002711306010570300177410ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.5 2015/02/11 13:37:31 schwarze Exp $ REGRESS_TARGETS = broken hyph noarg par LINT_TARGETS = broken noarg SKIP_MARKDOWN ?= broken .include mandoc-1.14.6/regress/mdoc/Nd/broken.in010064400017530001753000000010031313667013000201100ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ND-BROKEN 1 .Os .Sh NAME .Oo .Nm Nd-broken .Nd description lines ended .Oc by explicit blocks .Sh DESCRIPTION Start nested lists: .Bl -tag -width Ds .Bl -tag -width Ds .It inner tag inner text .Nd inner description .El back to outer list .It outer tag outer text .El .Pp Broken together with a child block: .\" Crashed before mdoc_macro.c OpenBSD rev. 1.171 .Ao ao .Bo bo .Nd nd .Pq pq bc Bc ac .Ac Op op end of file mandoc-1.14.6/regress/mdoc/Nd/broken.out_ascii010064400017530001753000000010171313667013000214660ustar00schwarzeschwarzeND-BROKEN(1) General Commands Manual ND-BROKEN(1) NNAAMMEE [NNdd--bbrrookkeenn - description lines ended] by explicit blocks DDEESSCCRRIIPPTTIIOONN Start nested lists: inner tag inner text - inner description back to outer list outer tag outer text Broken together with a child block: [op] end of file OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nd/broken.out_lint010064400017530001753000000011341313667013000213440ustar00schwarzeschwarzemandoc: broken.in:29:11: WARNING: blocks badly nested: Bo breaks Pq mandoc: broken.in:6:2: WARNING: bad NAME section content: Oo mandoc: broken.in:10:1: WARNING: bad NAME section content: text mandoc: broken.in:5:2: WARNING: NAME section without Nm before Nd mandoc: broken.in:5:2: WARNING: NAME section without description mandoc: broken.in:17:2: WARNING: description line outside NAME section: Nd mandoc: broken.in:14:2: WARNING: moving content out of list: Bl mandoc: broken.in:19:1: WARNING: moving content out of list: text mandoc: broken.in:28:2: WARNING: description line outside NAME section: Nd mandoc-1.14.6/regress/mdoc/Nd/hyph.in010064400017530001753000000004651313667013000176130ustar00schwarzeschwarze.\" $OpenBSD: hyph.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ND-HYPH 1 .Os .Sh NAME .Nm Nd-hyph .Nd when there is already a hyphen within the the word, \ line-breaking is permitted at that place .Sh DESCRIPTION Even in the document description line in the .Sx NAME section. mandoc-1.14.6/regress/mdoc/Nd/hyph.out_ascii010064400017530001753000000006301313667013000211560ustar00schwarzeschwarzeND-HYPH(1) General Commands Manual ND-HYPH(1) NNAAMMEE NNdd--hhyypphh - when there is already a hyphen within the the word, line- breaking is permitted at that place DDEESSCCRRIIPPTTIIOONN Even in the document description line in the _N_A_M_E section. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nd/hyph.out_markdown010064400017530001753000000003761313667013000217170ustar00schwarzeschwarzeND-HYPH(1) - General Commands Manual # NAME **Nd-hyph** - when there is already a hyphen within the the word, line-breaking is permitted at that place # DESCRIPTION Even in the document description line in the *NAME* section. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nd/noarg.in010064400017530001753000000002571313667013000177500ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ND-ARG0 1 .Os .Sh NAME .Nm Nd-arg0 .Nd .Sh DESCRIPTION empty description line mandoc-1.14.6/regress/mdoc/Nd/noarg.out_ascii010064400017530001753000000004111313667013000213110ustar00schwarzeschwarzeND-ARG0(1) General Commands Manual ND-ARG0(1) NNAAMMEE NNdd--aarrgg00 - DDEESSCCRRIIPPTTIIOONN empty description line OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nd/noarg.out_lint010064400017530001753000000001061313667013000211700ustar00schwarzeschwarzemandoc: noarg.in:7:2: WARNING: missing description line, using "": Nd mandoc-1.14.6/regress/mdoc/Nd/noarg.out_markdown010064400017530001753000000001731313667013000220500ustar00schwarzeschwarzeND-ARG0(1) - General Commands Manual # NAME **Nd-arg0** - # DESCRIPTION empty description line OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nd/par.in010064400017530001753000000005211313667013000174160ustar00schwarzeschwarze.\" $OpenBSD: par.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ND-PAR 1 .Os .Sh NAME .Nm Nd-par .Nd paragraph macro after one-line description .Pp Usually, there shouldn't be additional text in the NAME section. .Sh DESCRIPTION The text belongs here. .Nd stray description macro .Pp Back to normal state. mandoc-1.14.6/regress/mdoc/Nd/par.out_ascii010064400017530001753000000006571313667013000210010ustar00schwarzeschwarzeND-PAR(1) General Commands Manual ND-PAR(1) NNAAMMEE NNdd--ppaarr - paragraph macro after one-line description Usually, there shouldn't be additional text in the NAME section. DDEESSCCRRIIPPTTIIOONN The text belongs here. - stray description macro Back to normal state. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nd/par.out_markdown010064400017530001753000000004271313667013000215260ustar00schwarzeschwarzeND-PAR(1) - General Commands Manual # NAME **Nd-par** - paragraph macro after one-line description Usually, there shouldn't be additional text in the NAME section. # DESCRIPTION The text belongs here. - stray description macro Back to normal state. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm004075500017530001753000000000001412314056600162455ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Nm/Makefile010064400017530001753000000014521313667013000177610ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.13 2017/02/06 03:44:37 schwarze Exp $ REGRESS_TARGETS = badNAME badNAMEuse break broken REGRESS_TARGETS += empty emptyNAME emptyNAMEuse REGRESS_TARGETS += font long par parns punct LINT_TARGETS = badNAME badNAMEuse break broken punct # groff-1.22.3/mandoc differences: # - When the head of an Nm block in the SYNOPSIS is broken by an # explicit block end macro on the same line, formatting differs, # but doesn't make sense either way. # - Groff doesn't support the nS register. SKIP_GROFF = broken parns SKIP_TMAN = broken par parns # groff-1.22.3 defect: # When a SYNOPSIS Nm block head breaks a sub block, all the # remaining content in the document gets lost. SKIP_GROFF += break SKIP_MARKDOWN ?= badNAME badNAMEuse emptyNAME emptyNAMEuse .include mandoc-1.14.6/regress/mdoc/Nm/badNAME.in010064400017530001753000000003111313667013000200310ustar00schwarzeschwarze.\" $OpenBSD: badNAME.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-BADNAME 1 .Os .Sh NAME .Nm Bx .Nd text production macro on the NAME \&Nm line .Sh SYNOPSIS badNAME mandoc-1.14.6/regress/mdoc/Nm/badNAME.out_ascii010064400017530001753000000004111313667013000214030ustar00schwarzeschwarzeNM-BADNAME(1) General Commands Manual NM-BADNAME(1) NNAAMMEE BSD - text production macro on the NAME Nm line SSYYNNOOPPSSIISS badNAME OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/badNAME.out_lint010064400017530001753000000001771313667013000212720ustar00schwarzeschwarzemandoc: badNAME.in:6:2: ERROR: missing manual name, using "": Nm mandoc: badNAME.in:6:5: WARNING: bad NAME section content: Bx mandoc-1.14.6/regress/mdoc/Nm/badNAMEuse.in010064400017530001753000000003451313667013000205550ustar00schwarzeschwarze.\" $OpenBSD: badNAMEuse.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-BADNAMEUSE 1 .Os .Sh NAME .Nm Bx .Nd text production macro on the NAME \&Nm line, used later .Sh SYNOPSIS .Nm some_name .Nm mandoc-1.14.6/regress/mdoc/Nm/badNAMEuse.out_ascii010064400017530001753000000005121313667013000221220ustar00schwarzeschwarzeNM-BADNAMEUSE(1) General Commands Manual NM-BADNAMEUSE(1) NNAAMMEE BSD - text production macro on the NAME Nm line, used later SSYYNNOOPPSSIISS ssoommee__nnaammee ssoommee__nnaammee OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/badNAMEuse.out_lint010064400017530001753000000002051313667013000217770ustar00schwarzeschwarzemandoc: badNAMEuse.in:6:2: ERROR: missing manual name, using "": Nm mandoc: badNAMEuse.in:6:5: WARNING: bad NAME section content: Bx mandoc-1.14.6/regress/mdoc/Nm/break.in010064400017530001753000000003771313667013000177420ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-BREAK 1 .Os .Sh NAME .Nm Nm-break .Nd name block head breaking another block .Sh SYNOPSIS .Nm before Bo within .Sh DESCRIPTION initial text .Nm final text mandoc-1.14.6/regress/mdoc/Nm/break.out_ascii010064400017530001753000000006301313667013000213030ustar00schwarzeschwarzeNM-BREAK(1) General Commands Manual NM-BREAK(1) NNAAMMEE NNmm--bbrreeaakk - name block head breaking another block SSYYNNOOPPSSIISS bbeeffoorree [[wwiitthhiinn]] DDEESSCCRRIIPPTTIIOONN initial text NNmm--bbrreeaakk final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/break.out_lint010064400017530001753000000001131313667013000211550ustar00schwarzeschwarzemandoc: break.in:10:2: ERROR: inserting missing end of block: Sh breaks Bo mandoc-1.14.6/regress/mdoc/Nm/break.out_markdown010064400017530001753000000003311313667013000220330ustar00schwarzeschwarzeNM-BREAK(1) - General Commands Manual # NAME **Nm-break** - name block head breaking another block # SYNOPSIS **before \[within]** # DESCRIPTION initial text **Nm-break** final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm/broken.in010064400017530001753000000005271313667013000201330ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-BROKEN 1 .Os .Sh NAME .Nm Nm-broken .Nd broken synapsis name block .Sh SYNOPSIS .Ft int .Fo function .Nm name Fc tail .\" Crashed in validation before mdoc_macro.c OpenBSD rev. 1.167 .Bl -dash .Oo oo .Nm nm .Bk -words oc .Oc .Ek .It item .El mandoc-1.14.6/regress/mdoc/Nm/broken.out_ascii010064400017530001753000000005611313667013000215020ustar00schwarzeschwarzeNM-BROKEN(1) General Commands Manual NM-BROKEN(1) NNAAMMEE NNmm--bbrrookkeenn - broken synapsis name block SSYYNNOOPPSSIISS _i_n_t ffuunnccttiioonn(nnaammee); tail [oo nnmm oc] -- item OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/broken.out_lint010064400017530001753000000002031313667013000213510ustar00schwarzeschwarzemandoc: broken.in:18:2: WARNING: blocks badly nested: Oo breaks Bk mandoc: broken.in:14:2: WARNING: moving content out of list: Oo mandoc-1.14.6/regress/mdoc/Nm/broken.out_markdown010064400017530001753000000003001313667013000222230ustar00schwarzeschwarzeNM-BROKEN(1) - General Commands Manual # NAME **Nm-broken** - broken synapsis name block # SYNOPSIS *int* **function**(**name**); tail \[oo **nm** oc] - item OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm/empty.in010064400017530001753000000003411313667013000200030ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-EMPTY 2 .Os .Sh NAME .Nm Nm-empty .Nd handling of empty name macros .Sh SYNOPSIS .Nm .Nm .Sh DESCRIPTION The .Nm utility ... mandoc-1.14.6/regress/mdoc/Nm/empty.out_ascii010064400017530001753000000006221313667013000213560ustar00schwarzeschwarzeNM-EMPTY(2) System Calls Manual NM-EMPTY(2) NNAAMMEE NNmm--eemmppttyy - handling of empty name macros SSYYNNOOPPSSIISS NNmm--eemmppttyy NNmm--eemmppttyy DDEESSCCRRIIPPTTIIOONN The NNmm--eemmppttyy utility ... OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/empty.out_markdown010064400017530001753000000003061313667013000221070ustar00schwarzeschwarzeNM-EMPTY(2) - System Calls Manual # NAME **Nm-empty** - handling of empty name macros # SYNOPSIS **Nm-empty** **Nm-empty** # DESCRIPTION The **Nm-empty** utility ... OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm/emptyNAME.in010064400017530001753000000002651313667013000204510ustar00schwarzeschwarze.\" $OpenBSD: emptyNAME.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-EMPTYNAME 1 .Os .Sh NAME .Nm .Nd empty NAME \&Nm line .Sh SYNOPSIS emptyNAME mandoc-1.14.6/regress/mdoc/Nm/emptyNAME.out_ascii010064400017530001753000000003601313667013000220160ustar00schwarzeschwarzeNM-EMPTYNAME(1) General Commands Manual NM-EMPTYNAME(1) NNAAMMEE - empty NAME Nm line SSYYNNOOPPSSIISS emptyNAME OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/emptyNAMEuse.in010064400017530001753000000003171313667013000211640ustar00schwarzeschwarze.\" $OpenBSD: emptyNAMEuse.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-EMPTYNAMEUSE 1 .Os .Sh NAME .Nm .Nd empty NAME \&Nm line, used later .Sh SYNOPSIS .Nm some_name .Nm mandoc-1.14.6/regress/mdoc/Nm/emptyNAMEuse.out_ascii010064400017530001753000000004571313667013000225420ustar00schwarzeschwarzeNM-EMPTYNAMEUSE(1) General Commands Manual NM-EMPTYNAMEUSE(1) NNAAMMEE - empty NAME Nm line, used later SSYYNNOOPPSSIISS ssoommee__nnaammee ssoommee__nnaammee OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/font.in010064400017530001753000000003631313667013000176170ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-FONT 1 .Os .Sh NAME .Nm Nm-font .Nd changing fonts inside the name macro .Sh DESCRIPTION normal text .Nm bold\\fIemphasis\\fPback trailing text mandoc-1.14.6/regress/mdoc/Nm/font.out_ascii010064400017530001753000000005421313667013000211670ustar00schwarzeschwarzeNM-FONT(1) General Commands Manual NM-FONT(1) NNAAMMEE NNmm--ffoonntt - changing fonts inside the name macro DDEESSCCRRIIPPTTIIOONN normal text bboolldd_e_m_p_h_a_s_i_sbbaacckk trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/font.out_markdown010064400017530001753000000002721313667013000217210ustar00schwarzeschwarzeNM-FONT(1) - General Commands Manual # NAME **Nm-font** - changing fonts inside the name macro # DESCRIPTION normal text **bold*emphasis*back** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm/long.in010064400017530001753000000004311313667013000176040ustar00schwarzeschwarze.\" $OpenBSD: long.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-LONG 1 .Os .Sh NAME .Nm \&Nm-long .Nd long \&Nm in the SYNOPSIS .Sh SYNOPSIS .Nm "This is a terribly long name, it is so long that it does not fit \ one one single line -" .Fl o .Ar mandoc-1.14.6/regress/mdoc/Nm/long.out_ascii010064400017530001753000000017101313667013000211560ustar00schwarzeschwarzeNM-LONG(1) General Commands Manual NM-LONG(1) NNAAMMEE NNmm--lloonngg - long Nm in the SYNOPSIS SSYYNNOOPPSSIISS TThhiiss iiss aa tteerrrriibbllyy lloonngg nnaammee,, iitt iiss ssoo lloonngg tthhaatt iitt ddooeess nnoott ffiitt oonnee oonnee ssiinnggllee lliinnee -- --oo _f_i_l_e _._._. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/long.out_markdown010064400017530001753000000003531313667013000217120ustar00schwarzeschwarzeNM-LONG(1) - General Commands Manual # NAME **Nm-long** - long Nm in the SYNOPSIS # SYNOPSIS **This is a terribly long name, it is so long that it does not fit one one single line -** **-o** *file ...* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm/par.in010064400017530001753000000003161313667013000174310ustar00schwarzeschwarze.\" $OpenBSD: par.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-PAR 1 .Os .Sh NAME .Nm Nm-par .Nd paragraph macro in a synopsis name block .Sh SYNOPSIS .Nm .Fl a .Pp .Fl b mandoc-1.14.6/regress/mdoc/Nm/par.out_ascii010064400017530001753000000004751313667013000210100ustar00schwarzeschwarzeNM-PAR(1) General Commands Manual NM-PAR(1) NNAAMMEE NNmm--ppaarr - paragraph macro in a synopsis name block SSYYNNOOPPSSIISS NNmm--ppaarr --aa --bb OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/par.out_markdown010064400017530001753000000002421313667013000215320ustar00schwarzeschwarzeNM-PAR(1) - General Commands Manual # NAME **Nm-par** - paragraph macro in a synopsis name block # SYNOPSIS **Nm-par** **-a** **-b** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm/parns.in010064400017530001753000000004341313667013000177730ustar00schwarzeschwarze.\" $OpenBSD: parns.in,v 1.2 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-PAR 1 .Os .Sh NAME .Nm Nm-par .Nd paragraph macro in a name block .Sh DESCRIPTION .nr nS 1 .Nm .Fl a .Pp .Fl b .Nm .Fl a .nr nS 0 .Pp .Fl b .nr nS 1 .Nm .Oo Fl a .nr nS 0 .Pp .Fl b Oc mandoc-1.14.6/regress/mdoc/Nm/parns.out_ascii010064400017530001753000000006361313667013000213500ustar00schwarzeschwarzeNM-PAR(1) General Commands Manual NM-PAR(1) NNAAMMEE NNmm--ppaarr - paragraph macro in a name block DDEESSCCRRIIPPTTIIOONN NNmm--ppaarr --aa --bb NNmm--ppaarr --aa --bb NNmm--ppaarr [--aa --bb] OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/parns.out_markdown010064400017530001753000000003271313667013000220770ustar00schwarzeschwarzeNM-PAR(1) - General Commands Manual # NAME **Nm-par** - paragraph macro in a name block # DESCRIPTION **Nm-par** **-a** **-b** **Nm-par** **-a** **-b** **Nm-par** \[**-a** **-b**] OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm/punct.in010064400017530001753000000007501313667013000200020ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NM-PUNCT 1 .Os .Sh NAME .Nm Nm-punct .Nd punctuation handling by the Nm macro .Sh DESCRIPTION closing punctuation .Nm a ) only one .Nm ) only more than one .Nm ) ) middle .Nm a ) z start .Nm ) z dot .Nm . z comma .Nm , z semicolon .Nm ; z colon .Nm : z quest .Nm ? z excl .Nm ! z paren .Nm ) z bracket .Nm ] z bar .Nm | m op paren .Nm ( a op bracket .Nm [ a .Pp Missing blank: .Nm Nm-punct. mandoc-1.14.6/regress/mdoc/Nm/punct.out_ascii010064400017530001753000000014611313667013000213530ustar00schwarzeschwarzeNM-PUNCT(1) General Commands Manual NM-PUNCT(1) NNAAMMEE NNmm--ppuunncctt - punctuation handling by the Nm macro DDEESSCCRRIIPPTTIIOONN closing punctuation aa) only one NNmm--ppuunncctt) only more than one NNmm--ppuunncctt)) middle aa) zz start NNmm--ppuunncctt) z dot NNmm--ppuunncctt. z comma NNmm--ppuunncctt, z semicolon NNmm--ppuunncctt; z colon NNmm--ppuunncctt: z quest NNmm--ppuunncctt? z excl NNmm--ppuunncctt! z paren NNmm--ppuunncctt) z bracket NNmm--ppuunncctt] z bar | mm op paren (aa op bracket [aa Missing blank: NNmm--ppuunncctt.. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Nm/punct.out_markdown010064400017530001753000000010111313667013000220740ustar00schwarzeschwarzeNM-PUNCT(1) - General Commands Manual # NAME **Nm-punct** - punctuation handling by the Nm macro # DESCRIPTION closing punctuation **a**) only one **Nm-punct**) only more than one **Nm-punct**)) middle **a**) **z** start **Nm-punct**) z dot **Nm-punct**. z comma **Nm-punct**, z semicolon **Nm-punct**; z colon **Nm-punct**: z quest **Nm-punct**? z excl **Nm-punct**! z paren **Nm-punct**) z bracket **Nm-punct**] z bar | **m** op paren (**a** op bracket \[**a** Missing blank: **Nm-punct.** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Nm/punct.out_lint010064400017530001753000000001201312673160500212240ustar00schwarzeschwarzemandoc: punct.in:43:13: STYLE: no blank before trailing delimiter: Nm Nm-punct. mandoc-1.14.6/regress/mdoc/No004075500017530001753000000000001412314056600162475ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/No/Makefile010064400017530001753000000002701363444077100177710ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2020/03/13 00:31:06 schwarze Exp $ REGRESS_TARGETS = punct spacing tag TAG_TARGETS = tag LINT_TARGETS = punct HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/No/punct.in010064400017530001753000000021271313667013000200040ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.6 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NO-PUNCT 1 .Os .Sh NAME .Nm No-punct .Nd punctuation after the normal macro .Sh DESCRIPTION Leading punctuation: .No "(" b .No [ b .No | b .No . b .No , b .No ; b .No : b .No ? b .No ! b .No ) b .No ] b .Pp Trailing punctuation: .No a ( .No a [ .No a | .No a . .No a , .No a ; .No a : .No a ? .No a ! .No a ) .No a "]" .Pp Middle punctuation: .No a ( b .No a "[" b .No a | b .No a . b .No a , b .No a ; b .No a : b .No a "?" b .No a ! b .No a ) b .No a ] b .Pp Isolated punctuation: .No a No ( No b .No a No [ No b .No a No | No b .No a No . No b .No a No , No b .No a No ; No b .No a No : No b .No a No ? No b .No a No ! No b .No a No ) No b .No a No ] No b .Pp Isolated trailing punctuation: .No a No ( .No a No [ .No a No | .No a No . .No a No , .No a No ; .No a No : .No a No ? .No a No ! .No a No ) .No a No ] .Pp Multiple isolated punctuation: .No a No ( [ No b .No a No ) ] No b .Pp Multiple punctuation: .No [ ( arg ) ] . .Pp Quoted: .No "a . b Nm" "Sy" bold .No ". b Nm" .No "." .Pp Missing blank: .No a. mandoc-1.14.6/regress/mdoc/No/punct.out_ascii010064400017530001753000000015071313667013000213560ustar00schwarzeschwarzeNO-PUNCT(1) General Commands Manual NO-PUNCT(1) NNAAMMEE NNoo--ppuunncctt - punctuation after the normal macro DDEESSCCRRIIPPTTIIOONN Leading punctuation: (b [b | b . b , b ; b : b ? b ! b ) b ] b Trailing punctuation: a ( a [ a | a. a, a; a: a? a! a) a] Middle punctuation: a (b a [b a | b a. b a, b a; b a: b a? b a! b a) b a] b Isolated punctuation: a (b a [b a | b a . b a , b a ; b a : b a ? b a ! b a ) b a ] b Isolated trailing punctuation: a ( a [ a | a . a , a ; a : a ? a ! a ) a ] Multiple isolated punctuation: a ([b a )] b Multiple punctuation: [(arg)]. Quoted: a . b Nm bboolldd . b Nm . Missing blank: a. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/No/punct.out_lint010064400017530001753000000027311363444077100212450ustar00schwarzeschwarzemandoc: punct.in:49:7: WARNING: skipping empty macro: No mandoc: punct.in:50:7: WARNING: skipping empty macro: No mandoc: punct.in:51:7: WARNING: skipping empty macro: No mandoc: punct.in:52:7: WARNING: skipping empty macro: No mandoc: punct.in:53:7: WARNING: skipping empty macro: No mandoc: punct.in:54:7: WARNING: skipping empty macro: No mandoc: punct.in:55:7: WARNING: skipping empty macro: No mandoc: punct.in:56:7: WARNING: skipping empty macro: No mandoc: punct.in:57:7: WARNING: skipping empty macro: No mandoc: punct.in:58:7: WARNING: skipping empty macro: No mandoc: punct.in:59:7: WARNING: skipping empty macro: No mandoc: punct.in:62:7: WARNING: skipping empty macro: No mandoc: punct.in:63:7: WARNING: skipping empty macro: No mandoc: punct.in:64:7: WARNING: skipping empty macro: No mandoc: punct.in:65:7: WARNING: skipping empty macro: No mandoc: punct.in:66:7: WARNING: skipping empty macro: No mandoc: punct.in:67:7: WARNING: skipping empty macro: No mandoc: punct.in:68:7: WARNING: skipping empty macro: No mandoc: punct.in:69:7: WARNING: skipping empty macro: No mandoc: punct.in:70:7: WARNING: skipping empty macro: No mandoc: punct.in:71:7: WARNING: skipping empty macro: No mandoc: punct.in:72:7: WARNING: skipping empty macro: No mandoc: punct.in:75:7: WARNING: skipping empty macro: No mandoc: punct.in:76:7: WARNING: skipping empty macro: No mandoc: punct.in:84:2: WARNING: skipping empty macro: No mandoc: punct.in:87:6: STYLE: no blank before trailing delimiter: No a. mandoc-1.14.6/regress/mdoc/No/punct.out_markdown010064400017530001753000000011761313667013000221120ustar00schwarzeschwarzeNO-PUNCT(1) - General Commands Manual # NAME **No-punct** - punctuation after the normal macro # DESCRIPTION Leading punctuation: (b \[b | b . b , b ; b : b ? b ! b ) b ] b Trailing punctuation: a ( a \[ a | a. a, a; a: a? a! a) a] Middle punctuation: a (b a \[b a | b a. b a, b a; b a: b a? b a! b a) b a] b Isolated punctuation: a (b a \[b a | b a . b a , b a ; b a : b a ? b a ! b a ) b a ] b Isolated trailing punctuation: a ( a \[ a | a . a , a ; a : a ? a ! a ) a ] Multiple isolated punctuation: a (\[b a )] b Multiple punctuation: \[(arg)]. Quoted: a . b Nm **bold** . b Nm . Missing blank: a. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/No/spacing.in010064400017530001753000000006601313667013000202770ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.3 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NO-SPACING 1 .Os .Sh NAME .Nm No-spacing .Nd spacing around the normal macro .Sh DESCRIPTION Text before .No and after the macro. Macros on the line .Op before .No and .Op after the macro. Macros .Em before No and Em after the macro on the same line. Punctuation before ( .No and ) after the macro. The macro .Op No in an enclosure. mandoc-1.14.6/regress/mdoc/No/spacing.out_ascii010064400017530001753000000010171313667013000216450ustar00schwarzeschwarzeNO-SPACING(1) General Commands Manual NO-SPACING(1) NNAAMMEE NNoo--ssppaacciinngg - spacing around the normal macro DDEESSCCRRIIPPTTIIOONN Text before and after the macro. Macros on the line [before] and [after] the macro. Macros _b_e_f_o_r_e and _a_f_t_e_r the macro on the same line. Punctuation before ( and ) after the macro. The macro [in] an enclosure. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/No/spacing.out_markdown010064400017530001753000000005421313667013000224010ustar00schwarzeschwarzeNO-SPACING(1) - General Commands Manual # NAME **No-spacing** - spacing around the normal macro # DESCRIPTION Text before and after the macro. Macros on the line \[before] and \[after] the macro. Macros *before* and *after* the macro on the same line. Punctuation before ( and ) after the macro. The macro \[in] an enclosure. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/No/tag.in010064400017530001753000000004361363272364000174350ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt NO-TAG 1 .Os .Sh NAME .Nm No-tag .Nd tagging of normal font macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It No one | two text .It Xo .No three .Xc text .El .Tg .No four .Pp ENDTEST mandoc-1.14.6/regress/mdoc/No/tag.out_ascii010064400017530001753000000005441363272364000210060ustar00schwarzeschwarzeNO-TAG(1) General Commands Manual NO-TAG(1) NNAAMMEE NNoo--ttaagg - tagging of normal font macros DDEESSCCRRIIPPTTIIOONN BEGINTEST one | two text three text four ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/No/tag.out_html010064400017530001753000000006131367274434300206660ustar00schwarzeschwarze
|
text
text
mandoc-1.14.6/regress/mdoc/No/tag.out_markdown010064400017530001753000000002751363272364000215410ustar00schwarzeschwarzeNO-TAG(1) - General Commands Manual # NAME **No-tag** - tagging of normal font macros # DESCRIPTION BEGINTEST one | two > text three > text four ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/No/tag.out_tag010064400017530001753000000002301372346556200204700ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three tag.mandoc_ascii 12 four tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Ns004075500017530001753000000000001412314056600162535ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ns/Makefile010064400017530001753000000002271341026767500200010ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2018/12/21 16:58:49 schwarze Exp $ REGRESS_TARGETS = arg position punct LINT_TARGETS = position .include mandoc-1.14.6/regress/mdoc/Ns/position.in010064400017530001753000000013271313667013000205240ustar00schwarzeschwarze.\" $OpenBSD: position.in,v 1.6 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NS-POSITION 1 .Os .Sh NAME .Nm Ns-position .Nd effect of the position of the no space macro on the line .Sh DESCRIPTION At the beginning of a macro line: .Op before .Ns Op after .Pp After just a block closing macro: .Oo before .Oc Ns Op after .Pp After some macro and a block closing: .Oo before .No still before Oc Ns Op after .Pp In the middle of a macro line: .Oo before Oc Ns Op after .Pp After closing punctuation: .Oo before Oc : Ns Op after .Pp Before closing punctuation: .Oo before Oc Ns : Op after .Pp At the end of a macro line: .Oo before Oc Ns .Op after .Pp At the end of partial implicit: .Op before Ns .Op after mandoc-1.14.6/regress/mdoc/Ns/position.out_ascii010064400017530001753000000013561313667013000220770ustar00schwarzeschwarzeNS-POSITION(1) General Commands Manual NS-POSITION(1) NNAAMMEE NNss--ppoossiittiioonn - effect of the position of the no space macro on the line DDEESSCCRRIIPPTTIIOONN At the beginning of a macro line: [before] [after] After just a block closing macro: [before][after] After some macro and a block closing: [before still before][after] In the middle of a macro line: [before][after] After closing punctuation: [before]:[after] Before closing punctuation: [before]: [after] At the end of a macro line: [before][after] At the end of partial implicit: [before][after] OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ns/position.out_lint010064400017530001753000000001671313667013000217540ustar00schwarzeschwarzemandoc: position.in:11:2: WARNING: skipping no-space macro mandoc: position.in:28:15: WARNING: skipping no-space macro mandoc-1.14.6/regress/mdoc/Ns/position.out_markdown010064400017530001753000000011111313667013000226160ustar00schwarzeschwarzeNS-POSITION(1) - General Commands Manual # NAME **Ns-position** - effect of the position of the no space macro on the line # DESCRIPTION At the beginning of a macro line: \[before] \[after] After just a block closing macro: \[before]\[after] After some macro and a block closing: \[before still before]\[after] In the middle of a macro line: \[before]\[after] After closing punctuation: \[before]:\[after] Before closing punctuation: \[before]: \[after] At the end of a macro line: \[before]\[after] At the end of partial implicit: \[before]\[after] OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ns/punct.in010064400017530001753000000004721313667013000200110ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.4 2017/07/04 14:53:25 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NS-PUNCT 1 .Os .Sh NAME .Nm Ns-punct .Nd punctuation after the no space macro .Sh DESCRIPTION Normal words: .No no Ns ns No no Opening punctuation: .No no Ns "(" ns No no Closing punctuation: .No no "Ns" ns ")" No no mandoc-1.14.6/regress/mdoc/Ns/punct.out_ascii010064400017530001753000000005611313667013000213610ustar00schwarzeschwarzeNS-PUNCT(1) General Commands Manual NS-PUNCT(1) NNAAMMEE NNss--ppuunncctt - punctuation after the no space macro DDEESSCCRRIIPPTTIIOONN Normal words: nons no Opening punctuation: no(ns no Closing punctuation: nons) no OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ns/punct.out_markdown010064400017530001753000000003351313667013000221120ustar00schwarzeschwarzeNS-PUNCT(1) - General Commands Manual # NAME **Ns-punct** - punctuation after the no space macro # DESCRIPTION Normal words: nons no Opening punctuation: no(ns no Closing punctuation: nons) no OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ns/arg.in010064400017530001753000000005451340721765400174430ustar00schwarzeschwarze.\" $OpenBSD: arg.in,v 1.1 2018/12/21 16:58:49 schwarze Exp $ .Dd $Mdocdate: December 21 2018 $ .Dt NS-ARG 1 .Os .Sh NAME .Nm Ns-arg .Nd escape sequences in the arguments of in-line macros with an argument limit .Sh DESCRIPTION .ds a \(at .No unquoted unescaped Ns \*a .No quoted unescaped Ns "\*a" .No unquoted escaped Ns \\*a .No quoted escaped Ns "\\*a" mandoc-1.14.6/regress/mdoc/Ns/arg.out_ascii010064400017530001753000000006071340721765400210130ustar00schwarzeschwarzeNS-ARG(1) General Commands Manual NS-ARG(1) NNAAMMEE NNss--aarrgg - escape sequences in the arguments of in-line macros with an argument limit DDEESSCCRRIIPPTTIIOONN unquoted unescaped@ quoted unescaped@ unquoted escaped@ quoted escaped@ OpenBSD December 21, 2018 OpenBSD mandoc-1.14.6/regress/mdoc/Ns/arg.out_markdown010064400017530001753000000004121340721765400215370ustar00schwarzeschwarzeNS-ARG(1) - General Commands Manual # NAME **Ns-arg** - escape sequences in the arguments of in-line macros with an argument limit # DESCRIPTION unquoted unescaped@ quoted unescaped@ unquoted escaped@ quoted escaped@ OpenBSD - December 21, 2018 mandoc-1.14.6/regress/mdoc/Oo004075500017530001753000000000001412314056600162505ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Oo/Makefile010064400017530001753000000001631333010372000177520ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2012/07/07 14:10:55 schwarze Exp $ REGRESS_TARGETS = punct .include mandoc-1.14.6/regress/mdoc/Oo/punct.in010064400017530001753000000005451333010372000177770ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: February 6 2018 $ .Dt OO-PUNCT 1 .Os .Sh NAME .Nm Oo-punct .Nd punctuation handling by the Oo macro .Sh DESCRIPTION at the beginning: .Oo "(" z .Oo | z .Oo . z .Oc Oc "Sy" bold Oc .Pp in the middle: .Oo a "(" z .Oo a | z .Oo a . z .Oc Oc Oc .Pp at the end: .Oo Oo a ( .Oc | .Oc mandoc-1.14.6/regress/mdoc/Oo/punct.out_ascii010064400017530001753000000006211333010372000213430ustar00schwarzeschwarzeOO-PUNCT(1) General Commands Manual OO-PUNCT(1) NNAAMMEE OOoo--ppuunncctt - punctuation handling by the Oo macro DDEESSCCRRIIPPTTIIOONN at the beginning: ([z [| z [. z]] bboolldd] in the middle: [a (z [a | z [a. z]]] at the end: [[a (] |] OpenBSD February 6, 2018 OpenBSD mandoc-1.14.6/regress/mdoc/Oo/punct.out_markdown010064400017530001753000000004001333010372000220700ustar00schwarzeschwarzeOO-PUNCT(1) - General Commands Manual # NAME **Oo-punct** - punctuation handling by the Oo macro # DESCRIPTION at the beginning: (\[z \[| z \[. z]] **bold**] in the middle: \[a (z \[a | z \[a. z]]] at the end: \[\[a (] |] OpenBSD - February 6, 2018 mandoc-1.14.6/regress/mdoc/Op004075500017530001753000000000001412314056600162515ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Op/Makefile010064400017530001753000000003141341026767500177740ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2018/12/21 16:58:49 schwarze Exp $ REGRESS_TARGETS = arg break broken punct LINT_TARGETS = break broken punct SKIP_GROFF = break SKIP_ASCII = break .include mandoc-1.14.6/regress/mdoc/Op/break.in010064400017530001753000000006301313667013000177360ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt OP-BREAK 1 .Os .Sh NAME .Nm Op-break .Nd partial explicit block broken by partial implicit block .Sh DESCRIPTION before both .Op inside first Do inside both inside second .Dc after both .Pp 0 .Op 1 Op 12 Do 123 3 .Dc 0 .\" The following does not work yet: .ig .Pp 0 .Op 1 Op 12 Do 123 Do 1234 34 .Dc 4 .Dc 0 .. mandoc-1.14.6/regress/mdoc/Op/break.out_lint010064400017530001753000000003061313667013000211650ustar00schwarzeschwarzemandoc: break.in:10:2: WARNING: blocks badly nested: Op breaks Do mandoc: break.in:16:7: WARNING: blocks badly nested: Op breaks Do mandoc: break.in:16:2: WARNING: blocks badly nested: Op breaks Do mandoc-1.14.6/regress/mdoc/Op/break.out_markdown010064400017530001753000000003711313667013000220430ustar00schwarzeschwarzeOP-BREAK(1) - General Commands Manual # NAME **Op-break** - partial explicit block broken by partial implicit block # DESCRIPTION before both \[inside first "inside both] inside second" after both 0 \[1 \[12 "123]] 3" 0 OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Op/broken.in010064400017530001753000000006711313667013000201370ustar00schwarzeschwarze.\" $OpenBSD: broken.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt OP-BROKEN 1 .Os .Sh NAME .Nm Op-broken .Nd partial implicit block broken by partial explicit block .Sh DESCRIPTION before both .Do inside first .Op inside both Dc inside second after both .Pp 0 .Do 1 .Op 12 Op 123 Dc 23 0 .\" The following does not work yet, see mdoc_macro.c rev. 1.47. .ig .Pp 0 .Do 1 Do 12 .Op 123 Op 1234 Dc 134 Dc 34 0 .. mandoc-1.14.6/regress/mdoc/Op/broken.out_ascii010064400017530001753000000006161313667013000215070ustar00schwarzeschwarzeOP-BROKEN(1) General Commands Manual OP-BROKEN(1) NNAAMMEE OOpp--bbrrookkeenn - partial implicit block broken by partial explicit block DDEESSCCRRIIPPTTIIOONN before both "inside first [inside both" inside second] after both 0 "1 [12 [123" 23]] 0 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Op/broken.out_lint010064400017530001753000000002101313667013000213530ustar00schwarzeschwarzemandoc: broken.in:11:17: WARNING: blocks badly nested: Do breaks Op mandoc: broken.in:16:15: WARNING: blocks badly nested: Do breaks Op mandoc-1.14.6/regress/mdoc/Op/broken.out_markdown010064400017530001753000000003741313667013000222420ustar00schwarzeschwarzeOP-BROKEN(1) - General Commands Manual # NAME **Op-broken** - partial implicit block broken by partial explicit block # DESCRIPTION before both "inside first \[inside both" inside second] after both 0 "1 \[12 \[123" 23]] 0 OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Op/punct.in010064400017530001753000000006631313667013000200110ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.6 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt OP-PUNCT 1 .Os .Sh NAME .Nm Op-punct .Nd punctuation handling by the Op macro .Sh DESCRIPTION at the beginning: .Op "(" z .Op | z .Op . z .Pp in the middle: .Op a "(" z .Op a | z .Op a . z .Pp at the end: .Op a ( .Op a | .Op a . .Pp punctuation only: .Op ( .Op | .Op . .Pp more than one: .Op ( ( .Op | | .Op . . .Pp Missing blank: .Op a. mandoc-1.14.6/regress/mdoc/Op/punct.out_ascii010064400017530001753000000007561313667013000213650ustar00schwarzeschwarzeOP-PUNCT(1) General Commands Manual OP-PUNCT(1) NNAAMMEE OOpp--ppuunncctt - punctuation handling by the Op macro DDEESSCCRRIIPPTTIIOONN at the beginning: ([z] [| z] [. z] in the middle: [a (z] [a | z] [a. z] at the end: [a (] [a |] [a]. punctuation only: ([] [|] []. more than one: (([] [| |] [].. Missing blank: [a.] OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Op/punct.out_markdown010064400017530001753000000005261313667013000221120ustar00schwarzeschwarzeOP-PUNCT(1) - General Commands Manual # NAME **Op-punct** - punctuation handling by the Op macro # DESCRIPTION at the beginning: (\[z] \[| z] \[. z] in the middle: \[a (z] \[a | z] \[a. z] at the end: \[a (] \[a |] \[a]. punctuation only: (\[] \[|] \[]. more than one: ((\[] \[| |] \[].. Missing blank: \[a.] OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Op/punct.out_lint010064400017530001753000000001101312673161100212240ustar00schwarzeschwarzemandoc: punct.in:35:6: STYLE: no blank before trailing delimiter: Op a. mandoc-1.14.6/regress/mdoc/Op/arg.in010064400017530001753000000005331340721765500174370ustar00schwarzeschwarze.\" $OpenBSD: arg.in,v 1.1 2018/12/21 16:58:49 schwarze Exp $ .Dd $Mdocdate: December 21 2018 $ .Dt OP-ARG 1 .Os .Sh NAME .Nm Op-arg .Nd escape sequences in the arguments of partial implicit macros .Sh DESCRIPTION .ds a \(at unquoted unescaped: .Op \*a .Pp quoted unescaped: .Op "\*a" .Pp unquoted escaped: .Op \\*a .Pp quoted escaped: .Op "\\*a" mandoc-1.14.6/regress/mdoc/Op/arg.out_ascii010064400017530001753000000006261340721765500210130ustar00schwarzeschwarzeOP-ARG(1) General Commands Manual OP-ARG(1) NNAAMMEE OOpp--aarrgg - escape sequences in the arguments of partial implicit macros DDEESSCCRRIIPPTTIIOONN unquoted unescaped: [@] quoted unescaped: [@] unquoted escaped: [@] quoted escaped: [@] OpenBSD December 21, 2018 OpenBSD mandoc-1.14.6/regress/mdoc/Op/arg.out_markdown010064400017530001753000000004231340721765500215400ustar00schwarzeschwarzeOP-ARG(1) - General Commands Manual # NAME **Op-arg** - escape sequences in the arguments of partial implicit macros # DESCRIPTION unquoted unescaped: \[@] quoted unescaped: \[@] unquoted escaped: \[@] quoted escaped: \[@] OpenBSD - December 21, 2018 mandoc-1.14.6/regress/mdoc/Os004075500017530001753000000000001412314056600162545ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Os/Makefile010064400017530001753000000002721306027272500177730ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2014/11/21 01:52:45 schwarze Exp $ REGRESS_TARGETS = dupe late long missing LINT_TARGETS = dupe late missing SKIP_GROFF = long .include mandoc-1.14.6/regress/mdoc/Os/dupe.in010064400017530001753000000003631363444077100176260ustar00schwarzeschwarze.\" $OpenBSD: dupe.in,v 1.3 2020/01/19 16:36:47 schwarze Exp $ .Dd $Mdocdate: January 19 2020 $ .Os NetBSD .Dt OS-DUPE 1 .Os FreeBSD .Sh NAME .Nm Os-dupe .Nd repeated operating system macros .Sh DESCRIPTION initial text .Os OpenBSD final text mandoc-1.14.6/regress/mdoc/Os/dupe.out_ascii010064400017530001753000000004531363444077100211770ustar00schwarzeschwarzeOS-DUPE(1) General Commands Manual OS-DUPE(1) NNAAMMEE OOss--dduuppee - repeated operating system macros DDEESSCCRRIIPPTTIIOONN initial text final text OpenBSD January 19, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Os/dupe.out_lint010064400017530001753000000012331363444077100210520ustar00schwarzeschwarzemandoc: dupe.in:3:5: STYLE: operating system explicitly specified: Os NetBSD (NetBSD) mandoc: dupe.in:2:5: STYLE: Mdocdate found: Dd $Mdocdate: January 19 2020 $ (NetBSD) mandoc: dupe.in:4:2: WARNING: prologue macros out of order: Dt after Os mandoc: dupe.in:5:2: ERROR: duplicate prologue macro: Os mandoc: dupe.in:5:5: STYLE: operating system explicitly specified: Os FreeBSD (NetBSD) mandoc: dupe.in:2:5: STYLE: Mdocdate found: Dd $Mdocdate: January 19 2020 $ (NetBSD) mandoc: dupe.in:11:2: ERROR: duplicate prologue macro: Os mandoc: dupe.in:11:5: STYLE: operating system explicitly specified: Os OpenBSD (NetBSD) mandoc: dupe.in: STYLE: RCS id missing: (NetBSD) mandoc-1.14.6/regress/mdoc/Os/dupe.out_markdown010064400017530001753000000002411363444077100217240ustar00schwarzeschwarzeOS-DUPE(1) - General Commands Manual # NAME **Os-dupe** - repeated operating system macros # DESCRIPTION initial text final text OpenBSD - January 19, 2020 mandoc-1.14.6/regress/mdoc/Os/late.in010064400017530001753000000003131313667013000176000ustar00schwarzeschwarze.\" $OpenBSD: late.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt OS-LATE 1 .Sh NAME .Nm Os-late .Nd late operating system macro .Sh DESCRIPTION initial text .Os final text mandoc-1.14.6/regress/mdoc/Os/late.out_ascii010064400017530001753000000004461313667013000211600ustar00schwarzeschwarzeOS-LATE(1) General Commands Manual OS-LATE(1) NNAAMMEE OOss--llaattee - late operating system macro DDEESSCCRRIIPPTTIIOONN initial text final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Os/late.out_lint010064400017530001753000000000661313667013000210340ustar00schwarzeschwarzemandoc: late.in:9:2: WARNING: late prologue macro: Os mandoc-1.14.6/regress/mdoc/Os/late.out_markdown010064400017530001753000000002301313667013000217010ustar00schwarzeschwarzeOS-LATE(1) - General Commands Manual # NAME **Os-late** - late operating system macro # DESCRIPTION initial text final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Os/long.in010064400017530001753000000004161313667013000176160ustar00schwarzeschwarze.\" $OpenBSD: long.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt OS-LONG 1 .Os 1234567890123456789012345678901234567890123456789012345678901234567890123456789 .Sh NAME .Nm Os-long .Nd long operating system string .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Os/long.out_ascii010064400017530001753000000006301313667013000211650ustar00schwarzeschwarzeOS-LONG(1) General Commands Manual OS-LONG(1) NNAAMMEE OOss--lloonngg - long operating system string DDEESSCCRRIIPPTTIIOONN some text 1234567890123456789012345678901234567890123456789012345678901234567890123456789 July 4, 2017 1234567890123456789012345678901234567890123456789012345678901234567890123456789 mandoc-1.14.6/regress/mdoc/Os/long.out_markdown010064400017530001753000000003231313667013000217160ustar00schwarzeschwarzeOS-LONG(1) - General Commands Manual # NAME **Os-long** - long operating system string # DESCRIPTION some text 1234567890123456789012345678901234567890123456789012345678901234567890123456789 - July 4, 2017 mandoc-1.14.6/regress/mdoc/Os/missing.in010064400017530001753000000003211313667013000203230ustar00schwarzeschwarze.\" $OpenBSD: missing.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt OS-MISSING 1 .Sh NAME .Nm Os-missing .Nd operating system macro missing in prologue .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Os/missing.out_ascii010064400017530001753000000004171313667013000217020ustar00schwarzeschwarzeOS-MISSING(1) General Commands Manual OS-MISSING(1) NNAAMMEE OOss--mmiissssiinngg - operating system macro missing in prologue DDEESSCCRRIIPPTTIIOONN some text July 4, 2017 mandoc-1.14.6/regress/mdoc/Os/missing.out_lint010064400017530001753000000000701304650514700215600ustar00schwarzeschwarzemandoc: missing.in: WARNING: missing Os macro, using "" mandoc-1.14.6/regress/mdoc/Os/missing.out_markdown010064400017530001753000000002311313667013000224260ustar00schwarzeschwarzeOS-MISSING(1) - General Commands Manual # NAME **Os-missing** - operating system macro missing in prologue # DESCRIPTION some text \- July 4, 2017 mandoc-1.14.6/regress/mdoc/Ox004075500017530001753000000000001412314056600162615ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ox/Makefile010064400017530001753000000001621306027272600177770ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2012/07/18 16:55:54 schwarze Exp $ REGRESS_TARGETS = keep .include mandoc-1.14.6/regress/mdoc/Ox/keep.in010064400017530001753000000004371313667013000176130ustar00schwarzeschwarze.\" $OpenBSD: keep.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt OX-KEEP 1 .Os .Sh NAME .Nm Ox-keep .Nd interaction of unix variant macros and word keeps .Sh DESCRIPTION Because we use a keep, .Bk -words .Ox 4.9 must be at the beginning of a new line. .Ek mandoc-1.14.6/regress/mdoc/Ox/keep.out_ascii010064400017530001753000000005641313667013000211650ustar00schwarzeschwarzeOX-KEEP(1) General Commands Manual OX-KEEP(1) NNAAMMEE OOxx--kkeeeepp - interaction of unix variant macros and word keeps DDEESSCCRRIIPPTTIIOONN Because we use a keep, OpenBSD 4.9 must be at the beginning of a new line. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ox/keep.out_markdown010064400017530001753000000004231313667013000217110ustar00schwarzeschwarzeOX-KEEP(1) - General Commands Manual # NAME **Ox-keep** - interaction of unix variant macros and word keeps # DESCRIPTION Because we use a keep, OpenBSD 4.9 must be at the beginning of a new line. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Pa004075500017530001753000000000001412314056600162335ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Pa/Makefile010064400017530001753000000002741313667013000177500ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2014/08/21 12:56:24 schwarze Exp $ REGRESS_TARGETS = font punct LINT_TARGETS = punct # XXX The FILES target doesn't currently work. .include mandoc-1.14.6/regress/mdoc/Pa/font.in010064400017530001753000000003631313667013000176050ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt PA-FONT 1 .Os .Sh NAME .Nm Pa-font .Nd changing fonts inside the path macro .Sh DESCRIPTION normal text .Pa emphasis\\fBbold\\fPback trailing text mandoc-1.14.6/regress/mdoc/Pa/font.out_ascii010064400017530001753000000005421313667013000211550ustar00schwarzeschwarzePA-FONT(1) General Commands Manual PA-FONT(1) NNAAMMEE PPaa--ffoonntt - changing fonts inside the path macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Pa/font.out_markdown010064400017530001753000000002721313667013000217070ustar00schwarzeschwarzePA-FONT(1) - General Commands Manual # NAME **Pa-font** - changing fonts inside the path macro # DESCRIPTION normal text *emphasis**bold**back* trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Pa/punct.in010064400017530001753000000010411313667013000177620ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt PA-PUNCT 1 .Os .Sh NAME .Nm Pa-punct .Nd punctuation handling by the Pa macro .Sh DESCRIPTION closing punctuation .Pa a ) only one .Pa ) only more than one .Pa ) ) middle .Pa a ) z start .Pa ) z dot .Pa . z comma .Pa , z semicolon .Pa ; z colon .Pa : z quest .Pa ? z excl .Pa ! z paren .Pa ) z bracket .Pa ] z bar .Pa | m op paren .Pa ( a op bracket .Pa [ a .Pp quoted punctuation: .Pa a "(" b "|" c ")" d "," "Sy" bold . .Pp missing blank: .Pa a. mandoc-1.14.6/regress/mdoc/Pa/punct.out_ascii010064400017530001753000000011771313667013000213450ustar00schwarzeschwarzePA-PUNCT(1) General Commands Manual PA-PUNCT(1) NNAAMMEE PPaa--ppuunncctt - punctuation handling by the Pa macro DDEESSCCRRIIPPTTIIOONN closing punctuation _a) only one _~) only more than one _~)) middle _a) _z start _~) _z dot _~. _z comma _~, _z semicolon _~; _z colon _~: _z quest _~? _z excl _~! _z paren _~) _z bracket _~] _z bar | _m op paren (_a op bracket [_a quoted punctuation: _a (_b | _c) _d, bboolldd. missing blank: _a_. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Pa/punct.out_markdown010064400017530001753000000007271313667013000220770ustar00schwarzeschwarzePA-PUNCT(1) - General Commands Manual # NAME **Pa-punct** - punctuation handling by the Pa macro # DESCRIPTION closing punctuation *a*) only one *~*) only more than one *~*)) middle *a*) *z* start *~*) *z* dot *~*. *z* comma *~*, *z* semicolon *~*; *z* colon *~*: *z* quest *~*? *z* excl *~*! *z* paren *~*) *z* bracket *~*] *z* bar | *m* op paren (*a* op bracket \[*a* quoted punctuation: *a* (*b* | *c*) *d*, **bold**. missing blank: *a.* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Pa/punct.out_lint010064400017530001753000000001101312673161500212120ustar00schwarzeschwarzemandoc: punct.in:46:6: STYLE: no blank before trailing delimiter: Pa a. mandoc-1.14.6/regress/mdoc/Pf004075500017530001753000000000001412314056600162405ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Pf/Makefile010064400017530001753000000002131306027273000177460ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2014/11/30 05:28:00 schwarze Exp $ REGRESS_TARGETS = spacing LINT_TARGETS = spacing .include mandoc-1.14.6/regress/mdoc/Pf/spacing.in010064400017530001753000000011561313667013000202710ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt PF-SPACING 1 .Os .Sh NAME .Nm Pf-spacing .Nd spacing around the prefix macro .Sh DESCRIPTION Closing punctuation goes .Pf . right . But .Pf . . double prefixes don't work. Opening punctuation goes .Pf ( left . But again, prefix .Pf ( ) pairs don't work. Even normal text gets .Pf pre fixed . The first .Pf Ar gument is not parsed. Nothing can be .Pf prefixed to the next line. Trailing punctuation still counts as .Em eos Pf . .Po But it does not fall out of enclosures Pf . Pc .Pp It makes no sense at the very .Em end Pf mandoc-1.14.6/regress/mdoc/Pf/spacing.out_ascii010064400017530001753000000012651313667013000216430ustar00schwarzeschwarzePF-SPACING(1) General Commands Manual PF-SPACING(1) NNAAMMEE PPff--ssppaacciinngg - spacing around the prefix macro DDEESSCCRRIIPPTTIIOONN Closing punctuation goes .right. But .. double prefixes don't work. Opening punctuation goes (left. But again, prefix () pairs don't work. Even normal text gets prefixed. The first Argument is not parsed. Nothing can be prefixed to the next line. Trailing punctuation still counts as _e_o_s . (But it does not fall out of enclosures .) It makes no sense at the very _e_n_d OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Pf/spacing.out_lint010064400017530001753000000003111313667013000215100ustar00schwarzeschwarzemandoc: spacing.in:25:2: WARNING: nothing follows prefix: Pf prefixed mandoc: spacing.in:28:9: WARNING: nothing follows prefix: Pf . mandoc: spacing.in:32:9: WARNING: nothing follows prefix: Pf at eol mandoc-1.14.6/regress/mdoc/Pf/spacing.out_markdown010064400017530001753000000007761313667013000224030ustar00schwarzeschwarzePF-SPACING(1) - General Commands Manual # NAME **Pf-spacing** - spacing around the prefix macro # DESCRIPTION Closing punctuation goes .right. But .. double prefixes don't work. Opening punctuation goes (left. But again, prefix () pairs don't work. Even normal text gets prefixed. The first Argument is not parsed. Nothing can be prefixed to the next line. Trailing punctuation still counts as *eos* . (But it does not fall out of enclosures .) It makes no sense at the very *end* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Pp004075500017530001753000000000001412314056600162525ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Pp/Makefile010064400017530001753000000002541367274434400200030ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2020/04/18 20:28:46 schwarze Exp $ REGRESS_TARGETS = arg TAG_TARGETS = arg LINT_TARGETS = arg HTML_TARGETS = arg .include mandoc-1.14.6/regress/mdoc/Pp/arg.in010064400017530001753000000004721367274434400174460ustar00schwarzeschwarze.\" $OpenBSD: arg.in,v 1.6 2020/04/18 20:28:46 schwarze Exp $ .Dd $Mdocdate: April 18 2020 $ .Dt PP-ARG 1 .Os .Sh NAME .Nm Pp-arg .Nd paragraph macro with arguments .Sh DESCRIPTION BEGINTEST .Pp line 1 .Tg first .Pp drop this line 2 .br drop this line 3 .sp 1v drop this line 4 .Tg last .Pp final text .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Pp/arg.out_ascii010064400017530001753000000005521367274434400210160ustar00schwarzeschwarzePP-ARG(1) General Commands Manual PP-ARG(1) NNAAMMEE PPpp--aarrgg - paragraph macro with arguments DDEESSCCRRIIPPTTIIOONN BEGINTEST line 1 line 2 line 3 line 4 final text ENDTEST OpenBSD April 18, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Pp/arg.out_lint010064400017530001753000000003051367274434400206700ustar00schwarzeschwarzemandoc: arg.in:15:5: ERROR: skipping all arguments: br drop this mandoc: arg.in:17:8: ERROR: skipping excess arguments: sp ... drop this mandoc: arg.in:13:2: ERROR: skipping all arguments: Pp drop mandoc-1.14.6/regress/mdoc/Pp/arg.out_markdown010064400017530001753000000003031367274434400215420ustar00schwarzeschwarzePP-ARG(1) - General Commands Manual # NAME **Pp-arg** - paragraph macro with arguments # DESCRIPTION BEGINTEST line 1 line 2 line 3 line 4 final text ENDTEST OpenBSD - April 18, 2020 mandoc-1.14.6/regress/mdoc/Pp/arg.out_html010064400017530001753000000003331364666265500206740ustar00schwarzeschwarze

line 1


line 3

line 4

text

mandoc-1.14.6/regress/mdoc/Pp/arg.out_tag010064400017530001753000000001521372346556300204750ustar00schwarzeschwarzeNAME arg.mandoc_ascii 3 DESCRIPTION arg.mandoc_ascii 6 first arg.mandoc_ascii 11 last arg.mandoc_ascii 16 mandoc-1.14.6/regress/mdoc/Qq004075500017530001753000000000001412314056600162545ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Qq/Makefile010064400017530001753000000002151313667013000177640ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1.1.1 2011/12/04 03:09:25 schwarze Exp $ REGRESS_TARGETS = empty LINT_TARGETS = empty .include mandoc-1.14.6/regress/mdoc/Qq/empty.in010064400017530001753000000004351313667013000200160ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.5 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt QQ-EMPTY 1 .Os .Sh NAME .Nm Qq-empty .Nd empty implicit enclosure macros .Sh DESCRIPTION An empty .Qq and a full .Qq "(" user@host) quotation. And another .Qo "(" full) Qc one "Sy" bold . mandoc-1.14.6/regress/mdoc/Qq/empty.out_ascii010064400017530001753000000005621313667013000213700ustar00schwarzeschwarzeQQ-EMPTY(1) General Commands Manual QQ-EMPTY(1) NNAAMMEE QQqq--eemmppttyy - empty implicit enclosure macros DDEESSCCRRIIPPTTIIOONN An empty "" and a full ("user@host)" quotation. And another ("full)" one bboolldd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Qq/empty.out_markdown010064400017530001753000000003311313667013000221140ustar00schwarzeschwarzeQQ-EMPTY(1) - General Commands Manual # NAME **Qq-empty** - empty implicit enclosure macros # DESCRIPTION An empty "" and a full ("user@host)" quotation. And another ("full)" one **bold**. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Qq/empty.out_lint010064400017530001753000000001211333010372000212250ustar00schwarzeschwarzemandoc: empty.in:12:18: STYLE: no blank before trailing delimiter: Qq user@host) mandoc-1.14.6/regress/mdoc/Rs004075500017530001753000000000001412314056600162575ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Rs/Makefile010064400017530001753000000005611363444077100200040ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.12 2020/02/27 01:25:58 schwarze Exp $ REGRESS_TARGETS = allch args break empty paragraph three_authors transp UTF8_TARGETS = allch break empty three_authors LINT_TARGETS = allch args empty HTML_TARGETS = paragraph # groff-1.22.3 defect: # - arguments after .Rs cause the macro to be ignored SKIP_GROFF = args .include mandoc-1.14.6/regress/mdoc/Rs/allch.in010064400017530001753000000015621313667013000177500ustar00schwarzeschwarze.\" $OpenBSD: allch.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RS-ALLCH 1 .Os .Sh NAME .Nm Rs-allch .Nd reference block using all supported child macros .Sh DESCRIPTION reference on the same line: .Rs .%A author name .%T title of article .%B book title .%I issuer name some .%J journal name .%R report name .%N number of journal .%V volume number .Em bogus text .%U "uniform resource locator" .%P page number .%Q institutional author .%C city name .%D date of publication .%O optional information .Re .Sh SEE ALSO reference after a blank line: .Rs .%A author name .%T title of article .%B book title .%I issuer name some .Em bogus .%J journal name .%R report name .%N number of journal .%V volume number text .%U "uniform resource locator" .%P page number .%Q institutional author .%C city name .%D date of publication .%O optional information .Re mandoc-1.14.6/regress/mdoc/Rs/allch.out_ascii010064400017530001753000000020461313667013000213170ustar00schwarzeschwarzeRS-ALLCH(1) General Commands Manual RS-ALLCH(1) NNAAMMEE RRss--aallllcchh - reference block using all supported child macros DDEESSCCRRIIPPTTIIOONN reference on the same line: some _b_o_g_u_s text author name, "title of article", _b_o_o_k _t_i_t_l_e, _i_s_s_u_e_r _n_a_m_e, _j_o_u_r_n_a_l _n_a_m_e, report name, number of journal, volume number, uniform resource locator, page number, institutional author, city name, date of publication, optional information. SSEEEE AALLSSOO reference after a blank line: some _b_o_g_u_s text author name, "title of article", _b_o_o_k _t_i_t_l_e, _i_s_s_u_e_r _n_a_m_e, _j_o_u_r_n_a_l _n_a_m_e, report name, number of journal, volume number, uniform resource locator, page number, institutional author, city name, date of publication, optional information. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/allch.out_lint010064400017530001753000000006101313667013000211700ustar00schwarzeschwarzemandoc: allch.in:15:1: WARNING: invalid content in Rs block: text mandoc: allch.in:20:2: WARNING: invalid content in Rs block: Em mandoc: allch.in:21:1: WARNING: invalid content in Rs block: text mandoc: allch.in:36:1: WARNING: invalid content in Rs block: text mandoc: allch.in:37:2: WARNING: invalid content in Rs block: Em mandoc: allch.in:42:1: WARNING: invalid content in Rs block: text mandoc-1.14.6/regress/mdoc/Rs/allch.out_markdown010064400017530001753000000014331313667013000220500ustar00schwarzeschwarzeRS-ALLCH(1) - General Commands Manual # NAME **Rs-allch** - reference block using all supported child macros # DESCRIPTION reference on the same line: some *bogus* text author name, "title of article", *book title*, *issuer name*, *journal name*, report name, number of journal, volume number, [uniform resource locator](uniform resource locator), page number, institutional author, city name, date of publication, optional information. # SEE ALSO reference after a blank line: some *bogus* text author name, "title of article", *book title*, *issuer name*, *journal name*, report name, number of journal, volume number, [uniform resource locator](uniform resource locator), page number, institutional author, city name, date of publication, optional information. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Rs/allch.out_utf8010064400017530001753000000020601313667013000211110ustar00schwarzeschwarzeRS-ALLCH(1) General Commands Manual RS-ALLCH(1) NNAAMMEE RRss--aallllcchh – reference block using all supported child macros DDEESSCCRRIIPPTTIIOONN reference on the same line: some _b_o_g_u_s text author name, “title of article”, _b_o_o_k _t_i_t_l_e, _i_s_s_u_e_r _n_a_m_e, _j_o_u_r_n_a_l _n_a_m_e, report name, number of journal, volume number, uniform resource locator, page number, institutional author, city name, date of publication, optional information. SSEEEE AALLSSOO reference after a blank line: some _b_o_g_u_s text author name, “title of article”, _b_o_o_k _t_i_t_l_e, _i_s_s_u_e_r _n_a_m_e, _j_o_u_r_n_a_l _n_a_m_e, report name, number of journal, volume number, uniform resource locator, page number, institutional author, city name, date of publication, optional information. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/args.in010064400017530001753000000005001313667013000176100ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RS-ARGS 1 .Os .Sh NAME .Nm Rs-args .Nd arguments on a reference block header line .Sh SEE ALSO initial text .Rs bogus .%A author name .%B book title .Re middle text .Rs Sy bogus .%A author name .%B book title .Re final text mandoc-1.14.6/regress/mdoc/Rs/args.out_ascii010064400017530001753000000006321313667013000211670ustar00schwarzeschwarzeRS-ARGS(1) General Commands Manual RS-ARGS(1) NNAAMMEE RRss--aarrggss - arguments on a reference block header line SSEEEE AALLSSOO initial text author name, _b_o_o_k _t_i_t_l_e. middle text author name, _b_o_o_k _t_i_t_l_e. final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/args.out_lint010064400017530001753000000001711313667013000210430ustar00schwarzeschwarzemandoc: args.in:10:5: ERROR: skipping all arguments: Rs bogus mandoc: args.in:15:5: ERROR: skipping all arguments: Rs Sy mandoc-1.14.6/regress/mdoc/Rs/args.out_markdown010064400017530001753000000003501313667013000217160ustar00schwarzeschwarzeRS-ARGS(1) - General Commands Manual # NAME **Rs-args** - arguments on a reference block header line # SEE ALSO initial text author name, *book title*. middle text author name, *book title*. final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Rs/break.in010064400017530001753000000006431313667013000177500ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.5 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RS-BREAK 1 .Os .Sh NAME .Nm Rs-break .Nd line break before reference start .Sh DESCRIPTION reference on the same line: .Rs .%A author .%J journal .%N 42 .Re .Sh SEE ALSO reference after a blank line: .Rs .%A author .%J journal .%N 42 .Re .Sh SEE Em ALSO reference after a blank line: .Rs .%A author .%J journal .%N 42 .Re mandoc-1.14.6/regress/mdoc/Rs/break.out_ascii010064400017530001753000000010361313667013000213160ustar00schwarzeschwarzeRS-BREAK(1) General Commands Manual RS-BREAK(1) NNAAMMEE RRss--bbrreeaakk - line break before reference start DDEESSCCRRIIPPTTIIOONN reference on the same line: author, _j_o_u_r_n_a_l, 42. SSEEEE AALLSSOO reference after a blank line: author, _j_o_u_r_n_a_l, 42. SSEEEE _A_L_S_O reference after a blank line: author, _j_o_u_r_n_a_l, 42. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/break.out_markdown010064400017530001753000000005061313667013000220510ustar00schwarzeschwarzeRS-BREAK(1) - General Commands Manual # NAME **Rs-break** - line break before reference start # DESCRIPTION reference on the same line: author, *journal*, 42\. # SEE ALSO reference after a blank line: author, *journal*, 42\. # SEE *ALSO* reference after a blank line: author, *journal*, 42\. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Rs/break.out_utf8010064400017530001753000000010401313667013000211070ustar00schwarzeschwarzeRS-BREAK(1) General Commands Manual RS-BREAK(1) NNAAMMEE RRss--bbrreeaakk – line break before reference start DDEESSCCRRIIPPTTIIOONN reference on the same line: author, _j_o_u_r_n_a_l, 42. SSEEEE AALLSSOO reference after a blank line: author, _j_o_u_r_n_a_l, 42. SSEEEE _A_L_S_O reference after a blank line: author, _j_o_u_r_n_a_l, 42. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/empty.in010064400017530001753000000003761313667013000200250ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RS-EMPTY 1 .Os .Sh NAME .Nm Rs-empty .Nd empty reference blocks .Sh DESCRIPTION initial text .Rs .Re final text .Sh SEE ALSO initial text .Rs .Re final text mandoc-1.14.6/regress/mdoc/Rs/empty.out_ascii010064400017530001753000000005371313667013000213750ustar00schwarzeschwarzeRS-EMPTY(1) General Commands Manual RS-EMPTY(1) NNAAMMEE RRss--eemmppttyy - empty reference blocks DDEESSCCRRIIPPTTIIOONN initial text final text SSEEEE AALLSSOO initial text final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/empty.out_lint010064400017530001753000000001641313667013000212470ustar00schwarzeschwarzemandoc: empty.in:10:2: WARNING: empty reference block: Rs mandoc: empty.in:15:2: WARNING: empty reference block: Rs mandoc-1.14.6/regress/mdoc/Rs/empty.out_markdown010064400017530001753000000002731313667013000221240ustar00schwarzeschwarzeRS-EMPTY(1) - General Commands Manual # NAME **Rs-empty** - empty reference blocks # DESCRIPTION initial text final text # SEE ALSO initial text final text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Rs/empty.out_utf8010064400017530001753000000005411313667013000211660ustar00schwarzeschwarzeRS-EMPTY(1) General Commands Manual RS-EMPTY(1) NNAAMMEE RRss--eemmppttyy – empty reference blocks DDEESSCCRRIIPPTTIIOONN initial text final text SSEEEE AALLSSOO initial text final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/three_authors.in010064400017530001753000000004141313667013000215340ustar00schwarzeschwarze.\" $OpenBSD: three_authors.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RS-THREE_AUTHORS 1 .Os .Sh NAME .Nm Rs-three_authors .Nd listing three authors in a reference block .Sh AUTHORS .Rs .%A kristaps .%A joerg .%A ingo .%T mandoc .Re mandoc-1.14.6/regress/mdoc/Rs/three_authors.out_ascii010064400017530001753000000005331313667013000231070ustar00schwarzeschwarzeRS-THREE_AUTHORS(1) General Commands Manual RS-THREE_AUTHORS(1) NNAAMMEE RRss--tthhrreeee__aauutthhoorrss - listing three authors in a reference block AAUUTTHHOORRSS kristaps, joerg, and ingo, _m_a_n_d_o_c. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/three_authors.out_markdown010064400017530001753000000003041313667013000236350ustar00schwarzeschwarzeRS-THREE\_AUTHORS(1) - General Commands Manual # NAME **Rs-three\_authors** - listing three authors in a reference block # AUTHORS kristaps, joerg, and ingo, *mandoc*. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Rs/three_authors.out_utf8010064400017530001753000000005351313667013000227070ustar00schwarzeschwarzeRS-THREE_AUTHORS(1) General Commands Manual RS-THREE_AUTHORS(1) NNAAMMEE RRss--tthhrreeee__aauutthhoorrss – listing three authors in a reference block AAUUTTHHOORRSS kristaps, joerg, and ingo, _m_a_n_d_o_c. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/paragraph.in010064400017530001753000000010031341457745300206350ustar00schwarzeschwarze.\" $OpenBSD: paragraph.in,v 1.1 2019/01/07 06:51:37 schwarze Exp $ .Dd $Mdocdate: January 7 2019 $ .Dt RS-PARAGRAPH 1 .Os .Sh NAME .Nm Rs-paragraph .Nd interaction of paragraphs and reference blocks .Sh DESCRIPTION BEGINTEST .br initial reference: .Rs .%A author name .%B book title .Re .Pp in a paragraph: .Rs .%A another author .%B another book .Re .Sh SEE ALSO initial reference: .Rs .%A author name .%B book title .Re .Pp in a paragraph: .Rs .%A another author .%B another book .Re .nf ENDTEST .br end of file mandoc-1.14.6/regress/mdoc/Rs/paragraph.out_ascii010064400017530001753000000012261341457745300222150ustar00schwarzeschwarzeRS-PARAGRAPH(1) General Commands Manual RS-PARAGRAPH(1) NNAAMMEE RRss--ppaarraaggrraapphh - interaction of paragraphs and reference blocks DDEESSCCRRIIPPTTIIOONN BEGINTEST initial reference: author name, _b_o_o_k _t_i_t_l_e. in a paragraph: another author, _a_n_o_t_h_e_r _b_o_o_k. SSEEEE AALLSSOO initial reference: author name, _b_o_o_k _t_i_t_l_e. in a paragraph: another author, _a_n_o_t_h_e_r _b_o_o_k. ENDTEST end of file OpenBSD January 7, 2019 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/paragraph.out_html010064400017530001753000000012631374632357400220730ustar00schwarzeschwarze
initial reference: author name, book title.

in a paragraph: another author, another book.

initial reference:

author name, book title.

in a paragraph:

another author, another book.

mandoc-1.14.6/regress/mdoc/Rs/paragraph.out_markdown010064400017530001753000000006171341457745300227520ustar00schwarzeschwarzeRS-PARAGRAPH(1) - General Commands Manual # NAME **Rs-paragraph** - interaction of paragraphs and reference blocks # DESCRIPTION BEGINTEST initial reference: author name, *book title*. in a paragraph: another author, *another book*. # SEE ALSO initial reference: author name, *book title*. in a paragraph: another author, *another book*. ENDTEST end of file OpenBSD - January 7, 2019 mandoc-1.14.6/regress/mdoc/Rs/transp.in010064400017530001753000000011431362561734400202020ustar00schwarzeschwarze.\" $OpenBSD: transp.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .Dd $Mdocdate: February 27 2020 $ .Dt RS-TRANSPARENT 1 .Os .Sh NAME .Nm Rs-transparent .Nd transparent nodes in reference blocks .Sh SEE ALSO .Tg transparent .Rs .%T title .%A first after title .%A last .Re .Rs .%A first .%A middle .%A last before title .%T title .Re .Rs .%T title .Tg transparent .%A first after title and transparent .%A middle before transparent .Tg transparent .%A last before transparent .Tg transparent .Re .Rs .Tg transparent .%A first after transparent .%A last before transparent and title .Tg transparent .%T title .Re mandoc-1.14.6/regress/mdoc/Rs/transp.out_ascii010064400017530001753000000011311362561734400215500ustar00schwarzeschwarzeRS-TRANSPARENT(1) General Commands Manual RS-TRANSPARENT(1) NNAAMMEE RRss--ttrraannssppaarreenntt - transparent nodes in reference blocks SSEEEE AALLSSOO first after title and last, _t_i_t_l_e. first, middle, and last before title, _t_i_t_l_e. first after title and transparent, middle before transparent, and last before transparent, _t_i_t_l_e. first after transparent and last before transparent and title, _t_i_t_l_e. OpenBSD February 27, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Rs/transp.out_markdown010064400017530001753000000006271362561734400223130ustar00schwarzeschwarzeRS-TRANSPARENT(1) - General Commands Manual # NAME **Rs-transparent** - transparent nodes in reference blocks # SEE ALSO first after title, last, *title*. first, middle, and last before title, *title*. first after title and transparent, middle before transparent, and last before transparent, *title*. first after transparent, last before transparent and title, *title*. OpenBSD - February 27, 2020 mandoc-1.14.6/regress/mdoc/Rv004075500017530001753000000000001412314056600162625ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Rv/Makefile010064400017530001753000000005001306027273300177720ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2014/08/14 02:00:53 schwarze Exp $ REGRESS_TARGETS = args noname nostd LINT_TARGETS = noname nostd # groff-1.22.2 defect: # - .Rv without -std produces no output SKIP_GROFF = nostd # ugly name section output, do not test this for now SKIP_MARKDOWN ?= noname .include mandoc-1.14.6/regress/mdoc/Rv/args.in010064400017530001753000000004271313667013000176230ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RV-ARGS 3 .Os .Sh NAME .Nm Rv-args .Nd arguments to the return value macro .Sh RETURN VALUES no arguments: .Rv -std .Pp one argument: .Rv -std one .Pp two arguments: .Rv -std one two mandoc-1.14.6/regress/mdoc/Rv/args.out_ascii010064400017530001753000000015661313667013000212010ustar00schwarzeschwarzeRV-ARGS(3) Library Functions Manual RV-ARGS(3) NNAAMMEE RRvv--aarrggss - arguments to the return value macro RREETTUURRNN VVAALLUUEESS no arguments: Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. one argument: The oonnee() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. two arguments: The oonnee() and ttwwoo() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rv/args.out_markdown010064400017530001753000000012741313667013000217270ustar00schwarzeschwarzeRV-ARGS(3) - Library Functions Manual # NAME **Rv-args** - arguments to the return value macro # RETURN VALUES no arguments: Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable *errno* is set to indicate the error. one argument: The **one**() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable *errno* is set to indicate the error. two arguments: The **one**() and **two**() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable *errno* is set to indicate the error. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Rv/noname.in010064400017530001753000000004341313667013000201420ustar00schwarzeschwarze.\" $OpenBSD: noname.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RV-NONAME 3 .Os .Sh NAME .Nm .Nd return value macro without an available name .Sh RETURN VALUES no arguments: .Rv -std .Pp one argument: .Rv -std one .Pp two arguments: .Rv -std one two mandoc-1.14.6/regress/mdoc/Rv/noname.out_ascii010064400017530001753000000015511313667013000215140ustar00schwarzeschwarzeRV-NONAME(3) Library Functions Manual RV-NONAME(3) NNAAMMEE - return value macro without an available name RREETTUURRNN VVAALLUUEESS no arguments: Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. one argument: The oonnee() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. two arguments: The oonnee() and ttwwoo() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rv/noname.out_lint010064400017530001753000000001001313667013000213570ustar00schwarzeschwarzemandoc: noname.in:6:2: ERROR: missing manual name, using "": Nm mandoc-1.14.6/regress/mdoc/Rv/nostd.in010064400017530001753000000004221313667013000200110ustar00schwarzeschwarze.\" $OpenBSD: nostd.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RV-NOSTD 3 .Os .Sh NAME .Nm Rv-nostd .Nd return value macros without -std arguments .Sh RETURN VALUES no arguments: .Rv .Pp one argument: .Rv one .Pp two arguments: .Rv one two mandoc-1.14.6/regress/mdoc/Rv/nostd.out_ascii010064400017530001753000000016001313667013000213610ustar00schwarzeschwarzeRV-NOSTD(3) Library Functions Manual RV-NOSTD(3) NNAAMMEE RRvv--nnoossttdd - return value macros without -std arguments RREETTUURRNN VVAALLUUEESS no arguments: Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. one argument: The oonnee() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. two arguments: The oonnee() and ttwwoo() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable _e_r_r_n_o is set to indicate the error. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Rv/nostd.out_lint010064400017530001753000000003171313667013000212430ustar00schwarzeschwarzemandoc: nostd.in:10:2: WARNING: missing -std argument, adding it: Rv mandoc: nostd.in:13:2: WARNING: missing -std argument, adding it: Rv mandoc: nostd.in:16:2: WARNING: missing -std argument, adding it: Rv mandoc-1.14.6/regress/mdoc/Rv/nostd.out_markdown010064400017530001753000000013051313667013000221150ustar00schwarzeschwarzeRV-NOSTD(3) - Library Functions Manual # NAME **Rv-nostd** - return value macros without -std arguments # RETURN VALUES no arguments: Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable *errno* is set to indicate the error. one argument: The **one**() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable *errno* is set to indicate the error. two arguments: The **one**() and **two**() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable *errno* is set to indicate the error. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh004075500017530001753000000000001412314056600162455ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Sh/Makefile010064400017530001753000000014031367274434400177730ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.14 2020/04/01 20:10:18 schwarze Exp $ REGRESS_TARGETS = badNAME before empty emptyNAME first nohead order REGRESS_TARGETS += orderNAME paragraph parbefore parborder punctNAME REGRESS_TARGETS += subbefore tag transp LINT_TARGETS = badNAME before empty emptyNAME first nohead order LINT_TARGETS += orderNAME parbefore parborder punctNAME subbefore tag HTML_TARGETS = paragraph tag TAG_TARGETS = tag # groff-1.22.3 defects: # - .Pp before .Sh NAME causes a blank line before the header line # - .Ss before .Sh NAME puts the subsection header before the header line # - missing .Sh NAME causes loss of the header and footer lines # - .Sh DESCRIPTION Xo aborts the parser SKIP_GROFF = parbefore subbefore first empty .include mandoc-1.14.6/regress/mdoc/Sh/badNAME.in010064400017530001753000000003671313667013000200440ustar00schwarzeschwarze.\" $OpenBSD: badNAME.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-BADNAME 1 .Os .Sh NAME .Em bad NAME section .Nm Sh-badNAME .Sh DESCRIPTION The description appears before the name and is not marked up with Nd. mandoc-1.14.6/regress/mdoc/Sh/badNAME.out_ascii010064400017530001753000000005541313667013000214130ustar00schwarzeschwarzeSH-BADNAME(1) General Commands Manual SH-BADNAME(1) NNAAMMEE _b_a_d _N_A_M_E _s_e_c_t_i_o_n SShh--bbaaddNNAAMMEE DDEESSCCRRIIPPTTIIOONN The description appears before the name and is not marked up with Nd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/badNAME.out_lint010064400017530001753000000002001313667013000212550ustar00schwarzeschwarzemandoc: badNAME.in:6:2: WARNING: bad NAME section content: Em mandoc: badNAME.in:5:2: WARNING: NAME section without description mandoc-1.14.6/regress/mdoc/Sh/badNAME.out_markdown010064400017530001753000000003011313667013000221330ustar00schwarzeschwarzeSH-BADNAME(1) - General Commands Manual # NAME *bad NAME section* **Sh-badNAME** # DESCRIPTION The description appears before the name and is not marked up with Nd. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/before.in010064400017530001753000000004141313667013000201100ustar00schwarzeschwarze.\" $OpenBSD: before.in,v 1.5 2017/07/28 12:37:51 schwarze Exp $ .Dd $Mdocdate: July 28 2017 $ .Dt SH-BEFORE 1 .Os Plain text and .Em a macro before the first section header. .Sh NAME .Nm Sh-before .Nd content before the first section header .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Sh/before.out_ascii010064400017530001753000000005571313667013000214710ustar00schwarzeschwarzeSH-BEFORE(1) General Commands Manual SH-BEFORE(1) Plain text and _a _m_a_c_r_o before the first section header. NNAAMMEE SShh--bbeeffoorree - content before the first section header DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 28, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/before.out_lint010064400017530001753000000001121313667013000213320ustar00schwarzeschwarzemandoc: before.in:5:1: WARNING: content before first section header: text mandoc-1.14.6/regress/mdoc/Sh/before.out_markdown010064400017530001753000000003261313667013000222150ustar00schwarzeschwarzeSH-BEFORE(1) - General Commands Manual Plain text and *a macro* before the first section header. # NAME **Sh-before** - content before the first section header # DESCRIPTION some text OpenBSD - July 28, 2017 mandoc-1.14.6/regress/mdoc/Sh/empty.in010064400017530001753000000003161313667013000200050ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-EMPTY 1 .Os .Sh NAME .Nm Sh-empty .Nd empty sections .Sh SYNOPSIS .Sh DESCRIPTION Xo .Sh BUGS Quite some. mandoc-1.14.6/regress/mdoc/Sh/empty.out_ascii010064400017530001753000000004661313667013000213640ustar00schwarzeschwarzeSH-EMPTY(1) General Commands Manual SH-EMPTY(1) NNAAMMEE SShh--eemmppttyy - empty sections SSYYNNOOPPSSIISS DDEESSCCRRIIPPTTIIOONN BBUUGGSS Quite some. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/empty.out_lint010064400017530001753000000001131313667013000212270ustar00schwarzeschwarzemandoc: empty.in:10:2: ERROR: inserting missing end of block: Sh breaks Xo mandoc-1.14.6/regress/mdoc/Sh/empty.out_markdown010064400017530001753000000002251313667013000221070ustar00schwarzeschwarzeSH-EMPTY(1) - General Commands Manual # NAME **Sh-empty** - empty sections # SYNOPSIS # DESCRIPTION # BUGS Quite some. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/emptyNAME.in010064400017530001753000000002541313667013000204470ustar00schwarzeschwarze.\" $OpenBSD: emptyNAME.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-EMPTYNAME 1 .Os .Sh NAME .Sh DESCRIPTION The NAME section is empty. mandoc-1.14.6/regress/mdoc/Sh/emptyNAME.out_ascii010064400017530001753000000003571313667013000220240ustar00schwarzeschwarzeSH-EMPTYNAME(1) General Commands Manual SH-EMPTYNAME(1) NNAAMMEE DDEESSCCRRIIPPTTIIOONN The NAME section is empty. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/emptyNAME.out_lint010064400017530001753000000002111313667013000216670ustar00schwarzeschwarzemandoc: emptyNAME.in:5:2: WARNING: NAME section without Nm before Nd mandoc: emptyNAME.in:5:2: WARNING: NAME section without description mandoc-1.14.6/regress/mdoc/Sh/emptyNAME.out_markdown010064400017530001753000000001651313667013000225530ustar00schwarzeschwarzeSH-EMPTYNAME(1) - General Commands Manual # NAME # DESCRIPTION The NAME section is empty. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/first.in010064400017530001753000000002511313667013000177740ustar00schwarzeschwarze.\" $OpenBSD: first.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-FIRST 1 .Os .Sh DESCRIPTION The first section is not a NAME section. mandoc-1.14.6/regress/mdoc/Sh/nohead.in010064400017530001753000000003671313667013000201130ustar00schwarzeschwarze.\" $OpenBSD: nohead.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-NOHEAD 1 .Os .Sh NAME .Nm Sh-nohead .Nd sections without header lines .Sh DESCRIPTION empty section header: .Sh empty subsection header: .Ss text mandoc-1.14.6/regress/mdoc/Sh/first.out_lint010064400017530001753000000001131313667013000212200ustar00schwarzeschwarzemandoc: first.in:5:2: WARNING: first section is not "NAME": Sh DESCRIPTION mandoc-1.14.6/regress/mdoc/Sh/first.out_markdown010064400017530001753000000001671313667013000221050ustar00schwarzeschwarzeSH-FIRST(1) - General Commands Manual # DESCRIPTION The first section is not a NAME section. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/nohead.out_ascii010064400017530001753000000005121313667013000214540ustar00schwarzeschwarzeSH-NOHEAD(1) General Commands Manual SH-NOHEAD(1) NNAAMMEE SShh--nnoohheeaadd - sections without header lines DDEESSCCRRIIPPTTIIOONN empty section header: empty subsection header: text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/nohead.out_lint010064400017530001753000000001641313667013000213350ustar00schwarzeschwarzemandoc: nohead.in:10:2: WARNING: skipping empty macro: Sh mandoc: nohead.in:12:2: WARNING: skipping empty macro: Ss mandoc-1.14.6/regress/mdoc/Sh/nohead.out_markdown010064400017530001753000000002721313667013000222110ustar00schwarzeschwarzeSH-NOHEAD(1) - General Commands Manual # NAME **Sh-nohead** - sections without header lines # DESCRIPTION empty section header: empty subsection header: text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/order.in010064400017530001753000000003721313667013000177640ustar00schwarzeschwarze.\" $OpenBSD: order.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-ORDER 1 .Os .Sh NAME .Nm Sh-order .Nd sections out of conventional order .Sh DESCRIPTION some text .Sh SYNOPSIS .Sh SYNOPSIS .Sh ERRORS .Vt int errno mandoc-1.14.6/regress/mdoc/Sh/order.out_ascii010064400017530001753000000006071313667013000213360ustar00schwarzeschwarzeSH-ORDER(1) General Commands Manual SH-ORDER(1) NNAAMMEE SShh--oorrddeerr - sections out of conventional order DDEESSCCRRIIPPTTIIOONN some text SSYYNNOOPPSSIISS SSYYNNOOPPSSIISS EERRRROORRSS _i_n_t _e_r_r_n_o OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/order.out_lint010064400017530001753000000003471313667013000212150ustar00schwarzeschwarzemandoc: order.in:10:2: WARNING: sections out of conventional order: Sh SYNOPSIS mandoc: order.in:11:2: WARNING: duplicate section title: Sh SYNOPSIS mandoc: order.in:12:2: WARNING: unexpected section: Sh ERRORS for 2, 3, 4, 9 only mandoc-1.14.6/regress/mdoc/Sh/order.out_markdown010064400017530001753000000003021313667013000220600ustar00schwarzeschwarzeSH-ORDER(1) - General Commands Manual # NAME **Sh-order** - sections out of conventional order # DESCRIPTION some text # SYNOPSIS # SYNOPSIS # ERRORS *int errno* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/orderNAME.in010064400017530001753000000004211313667013000204200ustar00schwarzeschwarze.\" $OpenBSD: orderNAME.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-ORDERNAME 1 .Os .Sh NAME .Nd name after description in NAME section .Ss subsection .Nm Sh-orderNAME .Sh DESCRIPTION The order of Nm and Nd is wrong in the NAME section. mandoc-1.14.6/regress/mdoc/Sh/orderNAME.out_ascii010064400017530001753000000006051313667013000217750ustar00schwarzeschwarzeSH-ORDERNAME(1) General Commands Manual SH-ORDERNAME(1) NNAAMMEE - name after description in NAME section ssuubbsseeccttiioonn SShh--oorrddeerrNNAAMMEE DDEESSCCRRIIPPTTIIOONN The order of Nm and Nd is wrong in the NAME section. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/orderNAME.out_lint010064400017530001753000000002131313667013000216460ustar00schwarzeschwarzemandoc: orderNAME.in:6:2: WARNING: description not at the end of NAME mandoc: orderNAME.in:5:2: WARNING: NAME section without Nm before Nd mandoc-1.14.6/regress/mdoc/Sh/orderNAME.out_markdown010064400017530001753000000003331313667013000225250ustar00schwarzeschwarzeSH-ORDERNAME(1) - General Commands Manual # NAME \- name after description in NAME section ## subsection **Sh-orderNAME** # DESCRIPTION The order of Nm and Nd is wrong in the NAME section. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/punctNAME.in010064400017530001753000000004331313667013000204410ustar00schwarzeschwarze.\" $OpenBSD: punctNAME.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-PUNCTNAME 1 .Os .Sh NAME .Nm Sh-punctNAME .Nm second_name ; .Nm third_name , .Nd wrong punctuation in the NAME section .Sh DESCRIPTION One comma is missing, and one is misplaced. mandoc-1.14.6/regress/mdoc/Sh/punctNAME.out_ascii010064400017530001753000000006331313667013000220140ustar00schwarzeschwarzeSH-PUNCTNAME(1) General Commands Manual SH-PUNCTNAME(1) NNAAMMEE SShh--ppuunnccttNNAAMMEE sseeccoonndd__nnaammee; tthhiirrdd__nnaammee, - wrong punctuation in the NAME section DDEESSCCRRIIPPTTIIOONN One comma is missing, and one is misplaced. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/punctNAME.out_lint010064400017530001753000000004371313667013000216740ustar00schwarzeschwarzemandoc: punctNAME.in:7:2: WARNING: missing comma before name: Nm second_name mandoc: punctNAME.in:7:17: WARNING: bad NAME section content: text mandoc: punctNAME.in:8:2: WARNING: missing comma before name: Nm third_name mandoc: punctNAME.in:8:16: WARNING: bad NAME section content: text mandoc-1.14.6/regress/mdoc/Sh/punctNAME.out_markdown010064400017530001753000000003431313667013000225440ustar00schwarzeschwarzeSH-PUNCTNAME(1) - General Commands Manual # NAME **Sh-punctNAME** **second\_name**; **third\_name**, - wrong punctuation in the NAME section # DESCRIPTION One comma is missing, and one is misplaced. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/subbefore.in010064400017530001753000000004471313667013000206300ustar00schwarzeschwarze.\" $OpenBSD: subbefore.in,v 1.4 2017/07/28 12:37:51 schwarze Exp $ .Dd $Mdocdate: July 28 2017 $ .Dt SH-SUBBEFORE 1 .Os .Ss Subsection Plain text and .Em a macro before the first section header. .Sh NAME .Nm Sh-subbefore .Nd subsection before the first section header .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Sh/subbefore.out_ascii010064400017530001753000000006421313667013000221760ustar00schwarzeschwarzeSH-SUBBEFORE(1) General Commands Manual SH-SUBBEFORE(1) SSuubbsseeccttiioonn Plain text and _a _m_a_c_r_o before the first section header. NNAAMMEE SShh--ssuubbbbeeffoorree - subsection before the first section header DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 28, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/subbefore.out_lint010064400017530001753000000001131313667013000220450ustar00schwarzeschwarzemandoc: subbefore.in:5:2: WARNING: content before first section header: Ss mandoc-1.14.6/regress/mdoc/Sh/subbefore.out_markdown010064400017530001753000000003561313667013000227320ustar00schwarzeschwarzeSH-SUBBEFORE(1) - General Commands Manual ## Subsection Plain text and *a macro* before the first section header. # NAME **Sh-subbefore** - subsection before the first section header # DESCRIPTION some text OpenBSD - July 28, 2017 mandoc-1.14.6/regress/mdoc/Sh/first.out_ascii010064400017530001753000000003601312673162300213520ustar00schwarzeschwarzeSH-FIRST(1) General Commands Manual SH-FIRST(1) DDEESSCCRRIIPPTTIIOONN The first section is not a NAME section. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/parbefore.in010064400017530001753000000003441312673162300206210ustar00schwarzeschwarze.\" $OpenBSD: parbefore.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-PARBEFORE 1 .Os .Pp .Sh NAME .Nm Sh-parbefore .Nd paragraph macro before the first section header .Sh DESCRIPTION some text mandoc-1.14.6/regress/mdoc/Sh/parbefore.out_ascii010064400017530001753000000004731312673162300221750ustar00schwarzeschwarzeSH-PARBEFORE(1) General Commands Manual SH-PARBEFORE(1) NNAAMMEE SShh--ppaarrbbeeffoorree - paragraph macro before the first section header DDEESSCCRRIIPPTTIIOONN some text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/parbefore.out_lint010064400017530001753000000001121312673162300220410ustar00schwarzeschwarzemandoc: parbefore.in:5:2: WARNING: skipping paragraph macro: Pp before Sh mandoc-1.14.6/regress/mdoc/Sh/parbefore.out_markdown010064400017530001753000000002501312673162400227210ustar00schwarzeschwarzeSH-PARBEFORE(1) - General Commands Manual # NAME **Sh-parbefore** - paragraph macro before the first section header # DESCRIPTION some text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/parborder.in010064400017530001753000000005561312673162400206420ustar00schwarzeschwarze.\" $OpenBSD: parborder.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SH-PARBORDER 1 .Os .Sh NAME .Nm Sh-parborder .Nd paragraph macros at the beginning and end of sections .Sh DESCRIPTION .Pp descriptive text .Pp .Sh EXAMPLES .Pp example text .Pp .Ss Subsection .Pp subsection text .Pp .Ss Another subsection more subsection text .Pp mandoc-1.14.6/regress/mdoc/Sh/parborder.out_ascii010064400017530001753000000007771312673162400222200ustar00schwarzeschwarzeSH-PARBORDER(1) General Commands Manual SH-PARBORDER(1) NNAAMMEE SShh--ppaarrbboorrddeerr - paragraph macros at the beginning and end of sections DDEESSCCRRIIPPTTIIOONN descriptive text EEXXAAMMPPLLEESS example text SSuubbsseeccttiioonn subsection text AAnnootthheerr ssuubbsseeccttiioonn more subsection text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/parborder.out_lint010064400017530001753000000010361341026767500220710ustar00schwarzeschwarzemandoc: parborder.in:9:2: WARNING: skipping paragraph macro: Pp after Sh mandoc: parborder.in:11:2: WARNING: skipping paragraph macro: Pp at the end of Sh mandoc: parborder.in:17:2: WARNING: skipping paragraph macro: Pp after Ss mandoc: parborder.in:19:2: WARNING: skipping paragraph macro: Pp at the end of Ss mandoc: parborder.in:15:2: WARNING: skipping paragraph macro: Pp before Ss mandoc: parborder.in:22:2: WARNING: skipping paragraph macro: Pp at the end of Ss mandoc: parborder.in:13:2: WARNING: skipping paragraph macro: Pp after Sh mandoc-1.14.6/regress/mdoc/Sh/parborder.out_markdown010064400017530001753000000004341312673162400227400ustar00schwarzeschwarzeSH-PARBORDER(1) - General Commands Manual # NAME **Sh-parborder** - paragraph macros at the beginning and end of sections # DESCRIPTION descriptive text # EXAMPLES example text ## Subsection subsection text ## Another subsection more subsection text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sh/paragraph.in010064400017530001753000000005311341457745400206310ustar00schwarzeschwarze.\" $OpenBSD: paragraph.in,v 1.1 2019/01/07 06:51:37 schwarze Exp $ .Dd $Mdocdate: January 7 2019 $ .Dt SH-PARAGRAPH 1 .Os .Sh NAME .Nm Sh-paragraph .Nd interaction of paragraph and section macros .Sh DESCRIPTION BEGINTEST .Pp descriptive text .Ss Subsection initial subsection text .Pp subsection paragraph .Sh EXAMPLES ENDTEST .br end of file mandoc-1.14.6/regress/mdoc/Sh/paragraph.out_ascii010064400017530001753000000007411341457745400222050ustar00schwarzeschwarzeSH-PARAGRAPH(1) General Commands Manual SH-PARAGRAPH(1) NNAAMMEE SShh--ppaarraaggrraapphh - interaction of paragraph and section macros DDEESSCCRRIIPPTTIIOONN BEGINTEST descriptive text SSuubbsseeccttiioonn initial subsection text subsection paragraph EEXXAAMMPPLLEESS ENDTEST end of file OpenBSD January 7, 2019 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/paragraph.out_html010064400017530001753000000005441363444077100220550ustar00schwarzeschwarze

descriptive text

initial subsection text

subsection paragraph

mandoc-1.14.6/regress/mdoc/Sh/paragraph.out_markdown010064400017530001753000000004321341457745400227340ustar00schwarzeschwarzeSH-PARAGRAPH(1) - General Commands Manual # NAME **Sh-paragraph** - interaction of paragraph and section macros # DESCRIPTION BEGINTEST descriptive text ## Subsection initial subsection text subsection paragraph # EXAMPLES ENDTEST end of file OpenBSD - January 7, 2019 mandoc-1.14.6/regress/mdoc/Sh/tag.in010064400017530001753000000010341367274434400174360ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.3 2020/04/02 14:55:29 schwarze Exp $ .Dd $Mdocdate: April 2 2020 $ .Dt SH-TAG 1 .Os .Sh NAME .Nm Sh-tag .Nd tagging section headers .Sh DESCRIPTION Text in the description. .Ss Subsection BEGINTEST .Pp Text in the subsection. .Sh DESCRIPTION Text in duplicate description section. .Tg examples .Sh EXAMPLES Text introducing examples. .Tg example .Ss Subsection Example text. .Ss Sub-section More example text. .Sh "\& WEIRD SECTION " Text in weird section. .Sh \ \& Text in section with empty header. .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Sh/tag.out_ascii010064400017530001753000000013561367274434400210160ustar00schwarzeschwarzeSH-TAG(1) General Commands Manual SH-TAG(1) NNAAMMEE SShh--ttaagg - tagging section headers DDEESSCCRRIIPPTTIIOONN Text in the description. SSuubbsseeccttiioonn BEGINTEST Text in the subsection. DDEESSCCRRIIPPTTIIOONN Text in duplicate description section. EEXXAAMMPPLLEESS Text introducing examples. SSuubbsseeccttiioonn Example text. SSuubb--sseeccttiioonn More example text. WWEEIIRRDD SSEECCTTIIOONN Text in weird section. Text in section with empty header. ENDTEST OpenBSD April 2, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/tag.out_html010064400017530001753000000017571367274434400206770ustar00schwarzeschwarze

Text in the subsection.

Text in duplicate description section.

Text introducing examples.

Example text.

More example text.

Text in weird section.

 

Text in section with empty header.

mandoc-1.14.6/regress/mdoc/Sh/tag.out_markdown010064400017530001753000000007141367274434400215450ustar00schwarzeschwarzeSH-TAG(1) - General Commands Manual # NAME **Sh-tag** - tagging section headers # DESCRIPTION Text in the description. ## Subsection BEGINTEST Text in the subsection. # DESCRIPTION Text in duplicate description section. # EXAMPLES Text introducing examples. ## Subsection Example text. ## Sub-section More example text. # WEIRD SECTION Text in weird section. #   Text in section with empty header. ENDTEST OpenBSD - April 2, 2020 mandoc-1.14.6/regress/mdoc/Sh/transp.in010064400017530001753000000003651362561734500201760ustar00schwarzeschwarze.\" $OpenBSD: transp.in,v 1.1 2020/02/27 01:25:58 schwarze Exp $ .Dd $Mdocdate: February 27 2020 $ .Dt SH-TRANSP 1 .Os .Sh NAME .Nm Sh-transp .Nd interaction of sections with transparent nodes .Sh DESCRIPTION .Tg transparent .Ss Subsection text mandoc-1.14.6/regress/mdoc/Sh/transp.out_ascii010064400017530001753000000005161362561734500215450ustar00schwarzeschwarzeSH-TRANSP(1) General Commands Manual SH-TRANSP(1) NNAAMMEE SShh--ttrraannsspp - interaction of sections with transparent nodes DDEESSCCRRIIPPTTIIOONN SSuubbsseeccttiioonn text OpenBSD February 27, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Sh/transp.out_markdown010064400017530001753000000002601362561734500222730ustar00schwarzeschwarzeSH-TRANSP(1) - General Commands Manual # NAME **Sh-transp** - interaction of sections with transparent nodes # DESCRIPTION ## Subsection text OpenBSD - February 27, 2020 mandoc-1.14.6/regress/mdoc/Sh/tag.out_lint010064400017530001753000000002511364137740700206630ustar00schwarzeschwarzemandoc: tag.in:14:2: WARNING: duplicate section title: Sh DESCRIPTION mandoc: tag.in:24:7: WARNING: tab in filled text mandoc: tag.in:24:22: WARNING: tab in filled text mandoc-1.14.6/regress/mdoc/Sh/tag.out_tag010064400017530001753000000003601372346556300204730ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 Subsection tag.mandoc_ascii 9 DESCRIPTION tag.mandoc_ascii 14 examples tag.mandoc_ascii 17 example tag.mandoc_ascii 20 Sub-section tag.mandoc_ascii 23 WEIRD_SECTION tag.mandoc_ascii 26 mandoc-1.14.6/regress/mdoc/Sm004075500017530001753000000000001412314056600162525ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Sm/Makefile010064400017530001753000000003151306027273500177700ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2014/11/26 19:22:44 schwarze Exp $ REGRESS_TARGETS = noarg badarg scope spacing-No spacing-Op twoarg LINT_TARGETS = badarg twoarg SKIP_TMAN ?= scope .include mandoc-1.14.6/regress/mdoc/Sm/badarg.in010064400017530001753000000004321313667013000200730ustar00schwarzeschwarze.\" $OpenBSD: badarg.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SM-BADARG 1 .Os .Sh NAME .Nm Sm-badarg .Nd spacing macro with invalid arguments .Sh DESCRIPTION .Fl f Ar on .Sm off .Fl f Ar off .Sm bad .Fl f Ar bad Pq on .Sm bad .Fl f Ar bad Pq off mandoc-1.14.6/regress/mdoc/Sm/badarg.out_ascii010064400017530001753000000005551313667013000214520ustar00schwarzeschwarzeSM-BADARG(1) General Commands Manual SM-BADARG(1) NNAAMMEE SSmm--bbaaddaarrgg - spacing macro with invalid arguments DDEESSCCRRIIPPTTIIOONN --ff _o_n --ff_o_f_f bad --ff _b_a_d (on) bad--ff_b_a_d(off) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sm/badarg.out_lint010064400017530001753000000002041313667013000213170ustar00schwarzeschwarzemandoc: badarg.in:12:5: WARNING: invalid Boolean argument: Sm bad mandoc: badarg.in:14:5: WARNING: invalid Boolean argument: Sm bad mandoc-1.14.6/regress/mdoc/Sm/badarg.out_markdown010064400017530001753000000003311363444077100222050ustar00schwarzeschwarzeSM-BADARG(1) - General Commands Manual # NAME **Sm-badarg** - spacing macro with invalid arguments # DESCRIPTION **-f** *on* **-f**‌*off* bad **-f** *bad* (on) bad**-f**‌*bad*(off) OpenBSD-July 4, 2017 mandoc-1.14.6/regress/mdoc/Sm/noarg.in010064400017530001753000000005201313667013000177570ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SM-NOARG 1 .Os .Sh NAME .Nm Sm-noarg .Nd spacing macro without arguments .Sh DESCRIPTION .Fl f Ar on .Sm off .Fl f Ar off .Sm .Fl f Ar toggle Pq now on .Sm on .Fl f Ar on .Sm .Fl f Ar toggle Pq now off .Pp .Sm on .Fl f Ar on on a new line mandoc-1.14.6/regress/mdoc/Sm/noarg.out_ascii010064400017530001753000000006471313667013000213420ustar00schwarzeschwarzeSM-NOARG(1) General Commands Manual SM-NOARG(1) NNAAMMEE SSmm--nnooaarrgg - spacing macro without arguments DDEESSCCRRIIPPTTIIOONN --ff _o_n --ff_o_f_f --ff _t_o_g_g_l_e (now on) --ff _o_n --ff_t_o_g_g_l_e(nowoff) --ff _o_n on a new line OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sm/noarg.out_markdown010064400017530001753000000004011313667013000220600ustar00schwarzeschwarzeSM-NOARG(1) - General Commands Manual # NAME **Sm-noarg** - spacing macro without arguments # DESCRIPTION **-f** *on* **-f**‌*off* **-f** *toggle* (now on) **-f** *on* **-f**‌*toggle*(nowoff) **-f** *on* on a new line OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sm/scope.in010064400017530001753000000010511313667013000177620ustar00schwarzeschwarze.\" $OpenBSD: scope.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SM-SCOPE 1 .Os .Sh NAME .Nm Sm-scope .Nd scope of the spacing macro .Sh DESCRIPTION Using an abbreviated example from the .Xr ksh 1 manual. .Pp Modifiers can be applied to the .Pf ${ Ns Ar name Ns } form of parameter substitution: .Bl -tag -width Ds .Sm off .It ${ Ar name No :- Ar word No } .Sm on If .Ar name is set and not .Dv NULL , it is substituted; otherwise, .Ar word is substituted. .El .Pp In the above modifiers, the .Ql \&: can be omitted, ... mandoc-1.14.6/regress/mdoc/Sm/scope.out_ascii010064400017530001753000000011631313667013000213370ustar00schwarzeschwarzeSM-SCOPE(1) General Commands Manual SM-SCOPE(1) NNAAMMEE SSmm--ssccooppee - scope of the spacing macro DDEESSCCRRIIPPTTIIOONN Using an abbreviated example from the ksh(1) manual. Modifiers can be applied to the ${_n_a_m_e} form of parameter substitution: ${_n_a_m_e:-_w_o_r_d} If _n_a_m_e is set and not NULL, it is substituted; otherwise, _w_o_r_d is substituted. In the above modifiers, the `:' can be omitted, ... OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sm/scope.out_markdown010064400017530001753000000006601313667013000220720ustar00schwarzeschwarzeSM-SCOPE(1) - General Commands Manual # NAME **Sm-scope** - scope of the spacing macro # DESCRIPTION Using an abbreviated example from the ksh(1) manual. Modifiers can be applied to the ${*name*} form of parameter substitution: ${*name*:-*word*} > If > *name* > is set and not > `NULL`, > it is substituted; otherwise, > *word* > is substituted. In the above modifiers, the '`:`' can be omitted, ... OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sm/spacing-No.in010064400017530001753000000012251313667013000206520ustar00schwarzeschwarze.\" $OpenBSD: spacing-No.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SM-SPACING 1 .Os .Sh NAME .Nm Sm-spacing .Nd basic tests of spacing mode .Sh SYNOPSIS .Nm mandoc .Sm off .Fl T Ar mode .Sm on .Ar .Sh DESCRIPTION text1 .Sm off text2 text3 .Sm on text4 .Pp text1 .Sm off text2 text3 .Sm on .No macro4 .Pp text1 .Sm off .No macro2 macro3 .Sm on text4 .Pp text1 .Sm off .No macro2 No macro3 .Sm on .No macro4 .Pp .No macro1 .Sm off text2 text3 .Sm on text4 .Pp .No macro1 .Sm off text2 text3 .Sm on .No macro4 .Pp .No macro1 .Sm off .No macro2 No macro3 .Sm on text4 .Pp .No macro1 .Sm off .No macro2 No macro3 .Sm on .No macro4 mandoc-1.14.6/regress/mdoc/Sm/spacing-No.out_ascii010064400017530001753000000011511313667013000222210ustar00schwarzeschwarzeSM-SPACING(1) General Commands Manual SM-SPACING(1) NNAAMMEE SSmm--ssppaacciinngg - basic tests of spacing mode SSYYNNOOPPSSIISS mmaannddoocc --TT_m_o_d_e _f_i_l_e _._._. DDEESSCCRRIIPPTTIIOONN text1 text2 text3 text4 text1 text2 text3 macro4 text1 macro2macro3 text4 text1 macro2macro3 macro4 macro1 text2 text3 text4 macro1 text2 text3 macro4 macro1 macro2macro3 text4 macro1 macro2macro3 macro4 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sm/spacing-No.out_markdown010064400017530001753000000006241313667013000227570ustar00schwarzeschwarzeSM-SPACING(1) - General Commands Manual # NAME **Sm-spacing** - basic tests of spacing mode # SYNOPSIS **mandoc** **-T**‌*mode* *file ...* # DESCRIPTION text1 text2 text3 text4 text1 text2 text3 macro4 text1 macro2macro3 text4 text1 macro2macro3 macro4 macro1 text2 text3 text4 macro1 text2 text3 macro4 macro1 macro2macro3 text4 macro1 macro2macro3 macro4 OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sm/spacing-Op.in010064400017530001753000000013041313667013000206520ustar00schwarzeschwarze.\" $OpenBSD: spacing-Op.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SM-SPACING-OP 1 .Os .Sh NAME .Nm Sm-spacing-Op .Nd spacing mode, demonstrated using the .Op macro .Sh SYNOPSIS .Nm mandoc .Sm off .Fl T Ar mode .Sm on .Ar .Sh DESCRIPTION text1 .Sm off text2 text3 .Sm on text4 .Pp text1 .Sm off text2 text3 .Sm on .Op macro4 .Pp text1 .Sm off .Op macro2 macro3 .Sm on text4 .Pp text1 .Sm off .Op macro2 Op macro3 .Sm on .Op macro4 .Pp .Op macro1 .Sm off text2 text3 .Sm on text4 .Pp .Op macro1 .Sm off text2 text3 .Sm on .Op macro4 .Pp .Op macro1 .Sm off .Op macro2 Op macro3 .Sm on text4 .Pp .Op macro1 .Sm off .Op macro2 Op macro3 .Sm on .Op macro4 .Pp .Sm on .Op macro1 mandoc-1.14.6/regress/mdoc/Sm/spacing-Op.out_ascii010064400017530001753000000012621313667013000222260ustar00schwarzeschwarzeSM-SPACING-OP(1) General Commands Manual SM-SPACING-OP(1) NNAAMMEE SSmm--ssppaacciinngg--OOpp - spacing mode, demonstrated using the .Op macro SSYYNNOOPPSSIISS mmaannddoocc --TT_m_o_d_e _f_i_l_e _._._. DDEESSCCRRIIPPTTIIOONN text1 text2 text3 text4 text1 text2 text3 [macro4] text1 [macro2macro3] text4 text1 [macro2[macro3]] [macro4] [macro1] text2 text3 text4 [macro1] text2 text3 [macro4] [macro1] [macro2[macro3]] text4 [macro1] [macro2[macro3]] [macro4] [macro1] OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sm/spacing-Op.out_markdown010064400017530001753000000007451313667013000227650ustar00schwarzeschwarzeSM-SPACING-OP(1) - General Commands Manual # NAME **Sm-spacing-Op** - spacing mode, demonstrated using the .Op macro # SYNOPSIS **mandoc** **-T**‌*mode* *file ...* # DESCRIPTION text1 text2 text3 text4 text1 text2 text3 \[macro4] text1 \[macro2macro3] text4 text1 \[macro2\[macro3]] \[macro4] \[macro1] text2 text3 text4 \[macro1] text2 text3 \[macro4] \[macro1] \[macro2\[macro3]] text4 \[macro1] \[macro2\[macro3]] \[macro4] \[macro1] OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sm/twoarg.in010064400017530001753000000005331313667013000201600ustar00schwarzeschwarze.\" $OpenBSD: twoarg.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SM-TWOARG 1 .Os .Sh NAME .Nm Sm-twoarg .Nd spacing macro with multiple arguments .Sh DESCRIPTION .Sy default : .Fl f Ar on .br .Sy off two : .Sm off two .Fl f Ar off .br .Sy bad two : .Sm bad two .Fl f Ar off .br .Sy on two : .Sm on two .Fl f Ar on mandoc-1.14.6/regress/mdoc/Sm/twoarg.out_ascii010064400017530001753000000007131313667013000215310ustar00schwarzeschwarzeSM-TWOARG(1) General Commands Manual SM-TWOARG(1) NNAAMMEE SSmm--ttwwooaarrgg - spacing macro with multiple arguments DDEESSCCRRIIPPTTIIOONN ddeeffaauulltt: --ff _o_n ooffff ttwwoo: two--ff_o_f_f bbaaddttwwoo: bad two --ff _o_f_f oonn ttwwoo: two --ff _o_n OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sm/twoarg.out_lint010064400017530001753000000001021313667013000213770ustar00schwarzeschwarzemandoc: twoarg.in:17:5: WARNING: invalid Boolean argument: Sm bad mandoc-1.14.6/regress/mdoc/Sm/twoarg.out_markdown010064400017530001753000000004141363444077100222720ustar00schwarzeschwarzeSM-TWOARG(1) - General Commands Manual # NAME **Sm-twoarg** - spacing macro with multiple arguments # DESCRIPTION **default**: **-f** *on* **off two**: two**-f**‌*off* **badtwo**: bad two **-f** *off* **on two**: two **-f** *on* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sq004075500017530001753000000000001412314056700162575ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Sq/Makefile010064400017530001753000000002151313667013100177670ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1.1.1 2011/12/04 03:09:25 schwarze Exp $ REGRESS_TARGETS = empty LINT_TARGETS = empty .include mandoc-1.14.6/regress/mdoc/Sq/empty.in010064400017530001753000000004351313667013100200210ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.5 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SQ-EMPTY 1 .Os .Sh NAME .Nm Sq-empty .Nd empty implicit enclosure macros .Sh DESCRIPTION An empty .Sq and a full .Sq "(" user@host) quotation. And another .So "(" full) Sc one "Sy" bold . mandoc-1.14.6/regress/mdoc/Sq/empty.out_ascii010064400017530001753000000005621313667013100213730ustar00schwarzeschwarzeSQ-EMPTY(1) General Commands Manual SQ-EMPTY(1) NNAAMMEE SSqq--eemmppttyy - empty implicit enclosure macros DDEESSCCRRIIPPTTIIOONN An empty `' and a full (`user@host)' quotation. And another (`full)' one bboolldd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sq/empty.out_markdown010064400017530001753000000003311313667013100221170ustar00schwarzeschwarzeSQ-EMPTY(1) - General Commands Manual # NAME **Sq-empty** - empty implicit enclosure macros # DESCRIPTION An empty '' and a full ('user@host)' quotation. And another ('full)' one **bold**. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sq/empty.out_lint010064400017530001753000000001211333010372000212270ustar00schwarzeschwarzemandoc: empty.in:12:18: STYLE: no blank before trailing delimiter: Sq user@host) mandoc-1.14.6/regress/mdoc/St004075500017530001753000000000001412314056700162625ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/St/Makefile010064400017530001753000000004631306027273700200050ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2015/02/10 17:47:19 schwarze Exp $ REGRESS_TARGETS = badargs call LINT_TARGETS = badargs call # groff-1.22.3 defect: # - If the first argument of .St is the name of another macro, # internal groff_mdoc(7) state gets corrupted. SKIP_GROFF = call .include mandoc-1.14.6/regress/mdoc/St/badargs.in010064400017530001753000000005301313667013100202650ustar00schwarzeschwarze.\" $OpenBSD: badargs.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ST-INVALID 1 .Os .Sh NAME .Nm St-invalid .Nd handling of invalid standard argument .Sh STANDARDS valid argument: .St -p1003.1-2004 .Pp invalid argument: .St -murks .Pp no arguments: .St .Pp two arguments: .St -p1003.1-2004 murks .Pp end of file mandoc-1.14.6/regress/mdoc/St/badargs.out_ascii010064400017530001753000000007061313667013100216430ustar00schwarzeschwarzeST-INVALID(1) General Commands Manual ST-INVALID(1) NNAAMMEE SStt--iinnvvaalliidd - handling of invalid standard argument SSTTAANNDDAARRDDSS valid argument: IEEE Std 1003.1-2004 ("POSIX.1") invalid argument: no arguments: two arguments: IEEE Std 1003.1-2004 ("POSIX.1") murks end of file OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/St/badargs.out_lint010064400017530001753000000002011313667013100215070ustar00schwarzeschwarzemandoc: badargs.in:16:2: WARNING: skipping empty macro: St mandoc: badargs.in:13:5: ERROR: unknown standard specifier: St -murks mandoc-1.14.6/regress/mdoc/St/badargs.out_markdown010064400017530001753000000004751313667013100224000ustar00schwarzeschwarzeST-INVALID(1) - General Commands Manual # NAME **St-invalid** - handling of invalid standard argument # STANDARDS valid argument: IEEE Std 1003.1-2004 (“POSIX.1”) invalid argument: no arguments: two arguments: IEEE Std 1003.1-2004 (“POSIX.1”) murks end of file OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/St/call.in010064400017530001753000000004321313667013100175760ustar00schwarzeschwarze.\" $OpenBSD: call.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ST-CALL 1 .Os .Sh NAME .Nm St-call .Nd the standard macro calling other macros .Sh STANDARDS calling another macro: .St "Fl" called .Pp valid argument: .St -p1003.1-2004 .Pp end of file mandoc-1.14.6/regress/mdoc/St/call.out_ascii010064400017530001753000000006121313667013100211470ustar00schwarzeschwarzeST-CALL(1) General Commands Manual ST-CALL(1) NNAAMMEE SStt--ccaallll - the standard macro calling other macros SSTTAANNDDAARRDDSS calling another macro: --ccaalllleedd valid argument: IEEE Std 1003.1-2004 ("POSIX.1") end of file OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/St/call.out_lint010064400017530001753000000000701313667013100210230ustar00schwarzeschwarzemandoc: call.in:10:2: WARNING: skipping empty macro: St mandoc-1.14.6/regress/mdoc/St/call.out_markdown010064400017530001753000000003701313667013100217020ustar00schwarzeschwarzeST-CALL(1) - General Commands Manual # NAME **St-call** - the standard macro calling other macros # STANDARDS calling another macro: **-called** valid argument: IEEE Std 1003.1-2004 (“POSIX.1”) end of file OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sx004075500017530001753000000000001412314056700162665ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Sx/Makefile010064400017530001753000000002141306027274000177750ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2014/07/02 20:18:42 schwarze Exp $ REGRESS_TARGETS = noarg font LINT_TARGETS = noarg .include mandoc-1.14.6/regress/mdoc/Sx/font.in010064400017530001753000000003761313667013100176440ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SX-FONT 1 .Os .Sh NAME .Nm Sx-font .Nd changing fonts inside the cross reference macro .Sh DESCRIPTION normal text .Sx emphasis\\fBbold\\fPback trailing text mandoc-1.14.6/regress/mdoc/Sx/font.out_ascii010064400017530001753000000005551313667013100212140ustar00schwarzeschwarzeSX-FONT(1) General Commands Manual SX-FONT(1) NNAAMMEE SSxx--ffoonntt - changing fonts inside the cross reference macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sx/font.out_markdown010064400017530001753000000003051313667013100217370ustar00schwarzeschwarzeSX-FONT(1) - General Commands Manual # NAME **Sx-font** - changing fonts inside the cross reference macro # DESCRIPTION normal text *emphasis**bold**back* trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sx/noarg.in010064400017530001753000000004251313667013100177770ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SX-NOARG 1 .Os .Sh NAME .Nm Sx-noarg .Nd internal cross reference without a target .Sh DESCRIPTION with target: .Sx DESCRIPTION ";" "Em" italic no target: .Sx end of test document mandoc-1.14.6/regress/mdoc/Sx/noarg.out_ascii010064400017530001753000000006021313667013100213450ustar00schwarzeschwarzeSX-NOARG(1) General Commands Manual SX-NOARG(1) NNAAMMEE SSxx--nnooaarrgg - internal cross reference without a target DDEESSCCRRIIPPTTIIOONN with target: _D_E_S_C_R_I_P_T_I_O_N; _i_t_a_l_i_c no target: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sx/noarg.out_lint010064400017530001753000000000711313667013100212230ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Sx mandoc-1.14.6/regress/mdoc/Sx/noarg.out_markdown010064400017530001753000000003251313667013100221010ustar00schwarzeschwarzeSX-NOARG(1) - General Commands Manual # NAME **Sx-noarg** - internal cross reference without a target # DESCRIPTION with target: *DESCRIPTION*; *italic* no target: end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sy004075500017530001753000000000001412314056700162675ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Sy/Makefile010064400017530001753000000003011363444077200200040ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2020/03/13 00:31:06 schwarze Exp $ REGRESS_TARGETS = noarg font punct tag TAG_TARGETS = tag LINT_TARGETS = noarg punct HTML_TARGETS = tag .include mandoc-1.14.6/regress/mdoc/Sy/font.in010064400017530001753000000003741313667013100176430ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SY-FONT 1 .Os .Sh NAME .Nm Sy-font .Nd changing fonts inside the symbolic font macro .Sh DESCRIPTION normal text .Sy bold\\fIemphasis\\fPback trailing text mandoc-1.14.6/regress/mdoc/Sy/font.out_ascii010064400017530001753000000005531313667013100212130ustar00schwarzeschwarzeSY-FONT(1) General Commands Manual SY-FONT(1) NNAAMMEE SSyy--ffoonntt - changing fonts inside the symbolic font macro DDEESSCCRRIIPPTTIIOONN normal text bboolldd_e_m_p_h_a_s_i_sbbaacckk trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sy/font.out_markdown010064400017530001753000000003031313667013100217360ustar00schwarzeschwarzeSY-FONT(1) - General Commands Manual # NAME **Sy-font** - changing fonts inside the symbolic font macro # DESCRIPTION normal text **bold*emphasis*back** trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sy/noarg.in010064400017530001753000000003661313667013100200040ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SY-NOARG 1 .Os .Sh NAME .Nm Sy-noarg .Nd symbolic macro without arguments .Sh DESCRIPTION with argument .Sy arg no argument .Sy end of test document mandoc-1.14.6/regress/mdoc/Sy/noarg.out_ascii010064400017530001753000000005171313667013100213530ustar00schwarzeschwarzeSY-NOARG(1) General Commands Manual SY-NOARG(1) NNAAMMEE SSyy--nnooaarrgg - symbolic macro without arguments DDEESSCCRRIIPPTTIIOONN with argument aarrgg no argument end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sy/noarg.out_lint010064400017530001753000000000711313667013100212240ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Sy mandoc-1.14.6/regress/mdoc/Sy/noarg.out_markdown010064400017530001753000000002761313667013100221070ustar00schwarzeschwarzeSY-NOARG(1) - General Commands Manual # NAME **Sy-noarg** - symbolic macro without arguments # DESCRIPTION with argument **arg** no argument end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sy/punct.in010064400017530001753000000021331313667013100200210ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SY-PUNCT 1 .Os .Sh NAME .Nm Sy-punct .Nd punctuation following a symbolic macro .Sh DESCRIPTION Leading punctuation: .Sy ( b .Sy "[" b .Sy | b .Sy . b .Sy , b .Sy ; b .Sy : b .Sy ? b .Sy ! b .Sy ) b .Sy ] b .Pp Trailing punctuation: .Sy a ( .Sy a [ .Sy a | .Sy a . .Sy a , .Sy a ; .Sy a : .Sy a ? .Sy a ! .Sy a ")" .Sy a ] .Pp Middle punctuation: .Sy a ( b .Sy a [ b .Sy a "|" b .Sy a . b .Sy a , b .Sy a ; b .Sy a : b .Sy a ? b .Sy a ! b .Sy a ) b .Sy a ] b .Pp Isolated punctuation: .Sy a Sy ( Sy b .Sy a Sy [ Sy b .Sy a Sy | Sy b .Sy a Sy . Sy b .Sy a Sy , Sy b .Sy a Sy ; Sy b .Sy a Sy : Sy b .Sy a Sy ? Sy b .Sy a Sy ! Sy b .Sy a Sy ) Sy b .Sy a Sy ] Sy b .Pp Isolated trailing punctuation: .Sy a Sy ( .Sy a Sy [ .Sy a Sy | .Sy a Sy . .Sy a Sy , .Sy a Sy ; .Sy a Sy : .Sy a Sy ? .Sy a Sy ! .Sy a Sy ) .Sy a Sy ] .Pp Multiple isolated punctuation: .Sy a Sy ( [ Sy b .Sy a Sy ) ] Sy b .Pp Multiple punctuation: .Sy [ ( arg ) ] . .Pp Quoted: .Sy "a . b Nm" "Em" italic .Sy ". b Nm" .Sy "." .Pp Missing blank: .Sy a. mandoc-1.14.6/regress/mdoc/Sy/punct.out_ascii010064400017530001753000000020171313667013100213730ustar00schwarzeschwarzeSY-PUNCT(1) General Commands Manual SY-PUNCT(1) NNAAMMEE SSyy--ppuunncctt - punctuation following a symbolic macro DDEESSCCRRIIPPTTIIOONN Leading punctuation: (bb [bb | bb . bb , bb ; bb : bb ? bb ! bb ) bb ] bb Trailing punctuation: aa ( aa [ aa | aa. aa, aa; aa: aa? aa! aa) aa] Middle punctuation: aa (bb aa [bb aa | bb aa. bb aa, bb aa; bb aa: bb aa? bb aa! bb aa) bb aa] bb Isolated punctuation: aa (bb aa [bb aa | bb aa . bb aa , bb aa ; bb aa : bb aa ? bb aa ! bb aa ) bb aa ] bb Isolated trailing punctuation: aa ( aa [ aa | aa . aa , aa ; aa : aa ? aa ! aa ) aa ] Multiple isolated punctuation: aa ([bb aa )] bb Multiple punctuation: [(aarrgg)]. Quoted: aa .. bb NNmm _i_t_a_l_i_c .. bb NNmm . Missing blank: aa.. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Sy/punct.out_lint010064400017530001753000000027311313667013100212540ustar00schwarzeschwarzemandoc: punct.in:49:7: WARNING: skipping empty macro: Sy mandoc: punct.in:50:7: WARNING: skipping empty macro: Sy mandoc: punct.in:51:7: WARNING: skipping empty macro: Sy mandoc: punct.in:52:7: WARNING: skipping empty macro: Sy mandoc: punct.in:53:7: WARNING: skipping empty macro: Sy mandoc: punct.in:54:7: WARNING: skipping empty macro: Sy mandoc: punct.in:55:7: WARNING: skipping empty macro: Sy mandoc: punct.in:56:7: WARNING: skipping empty macro: Sy mandoc: punct.in:57:7: WARNING: skipping empty macro: Sy mandoc: punct.in:58:7: WARNING: skipping empty macro: Sy mandoc: punct.in:59:7: WARNING: skipping empty macro: Sy mandoc: punct.in:62:7: WARNING: skipping empty macro: Sy mandoc: punct.in:63:7: WARNING: skipping empty macro: Sy mandoc: punct.in:64:7: WARNING: skipping empty macro: Sy mandoc: punct.in:65:7: WARNING: skipping empty macro: Sy mandoc: punct.in:66:7: WARNING: skipping empty macro: Sy mandoc: punct.in:67:7: WARNING: skipping empty macro: Sy mandoc: punct.in:68:7: WARNING: skipping empty macro: Sy mandoc: punct.in:69:7: WARNING: skipping empty macro: Sy mandoc: punct.in:70:7: WARNING: skipping empty macro: Sy mandoc: punct.in:71:7: WARNING: skipping empty macro: Sy mandoc: punct.in:72:7: WARNING: skipping empty macro: Sy mandoc: punct.in:75:7: WARNING: skipping empty macro: Sy mandoc: punct.in:76:7: WARNING: skipping empty macro: Sy mandoc: punct.in:84:2: WARNING: skipping empty macro: Sy mandoc: punct.in:87:6: STYLE: no blank before trailing delimiter: Sy a. mandoc-1.14.6/regress/mdoc/Sy/punct.out_markdown010064400017530001753000000017261313667013100221330ustar00schwarzeschwarzeSY-PUNCT(1) - General Commands Manual # NAME **Sy-punct** - punctuation following a symbolic macro # DESCRIPTION Leading punctuation: (**b** \[**b** | **b** . **b** , **b** ; **b** : **b** ? **b** ! **b** ) **b** ] **b** Trailing punctuation: **a** ( **a** \[ **a** | **a**. **a**, **a**; **a**: **a**? **a**! **a**) **a**] Middle punctuation: **a** (**b** **a** \[**b** **a** | **b** **a**. **b** **a**, **b** **a**; **b** **a**: **b** **a**? **b** **a**! **b** **a**) **b** **a**] **b** Isolated punctuation: **a** (**b** **a** \[**b** **a** | **b** **a** . **b** **a** , **b** **a** ; **b** **a** : **b** **a** ? **b** **a** ! **b** **a** ) **b** **a** ] **b** Isolated trailing punctuation: **a** ( **a** \[ **a** | **a** . **a** , **a** ; **a** : **a** ? **a** ! **a** ) **a** ] Multiple isolated punctuation: **a** (\[**b** **a** )] **b** Multiple punctuation: \[(**arg**)]. Quoted: **a . b Nm** *italic* **. b Nm** . Missing blank: **a.** OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Sy/tag.in010064400017530001753000000004721363272364100174550ustar00schwarzeschwarze.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $ .Dd $Mdocdate: March 13 2020 $ .Dt SY-TAG 1 .Os .Sh NAME .Nm Sy-tag .Nd tagging of symbolic font macros .Sh DESCRIPTION BEGINTEST .Bl -tag -width Ds .It Sy one | two text .It Xo .Sy three .Xc text .El .Sy four .Sy one .Tg explicit .Sy five .Pp ENDTEST mandoc-1.14.6/regress/mdoc/Sy/tag.out_ascii010064400017530001753000000006331363272364100210250ustar00schwarzeschwarzeSY-TAG(1) General Commands Manual SY-TAG(1) NNAAMMEE SSyy--ttaagg - tagging of symbolic font macros DDEESSCCRRIIPPTTIIOONN BEGINTEST oonnee | ttwwoo text tthhrreeee text ffoouurr oonnee ffiivvee ENDTEST OpenBSD March 13, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Sy/tag.out_html010064400017530001753000000007301367274434500207070ustar00schwarzeschwarze
|
text
text
one mandoc-1.14.6/regress/mdoc/Sy/tag.out_markdown010064400017530001753000000003401363272364100215520ustar00schwarzeschwarzeSY-TAG(1) - General Commands Manual # NAME **Sy-tag** - tagging of symbolic font macros # DESCRIPTION BEGINTEST **one** | **two** > text **three** > text **four** **one** **five** ENDTEST OpenBSD - March 13, 2020 mandoc-1.14.6/regress/mdoc/Sy/tag.out_tag010064400017530001753000000002651372346556400205210ustar00schwarzeschwarzeNAME tag.mandoc_ascii 3 DESCRIPTION tag.mandoc_ascii 6 one tag.mandoc_ascii 9 two tag.mandoc_ascii 9 three tag.mandoc_ascii 12 four tag.mandoc_ascii 13 explicit tag.mandoc_ascii 13 mandoc-1.14.6/regress/mdoc/Tn004075500017530001753000000000001412314056700162555ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Tn/Makefile010064400017530001753000000002141306027274200177660ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2014/07/02 20:18:42 schwarze Exp $ REGRESS_TARGETS = noarg font LINT_TARGETS = noarg .include mandoc-1.14.6/regress/mdoc/Tn/font.in010064400017530001753000000003741313667013100176310ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TN-FONT 1 .Os .Sh NAME .Nm Tn-font .Nd changing fonts inside the trade name macro .Sh DESCRIPTION normal text .Tn literal\\fIemphasis\\fPback trailing text mandoc-1.14.6/regress/mdoc/Tn/font.out_ascii010064400017530001753000000005331313667013100211770ustar00schwarzeschwarzeTN-FONT(1) General Commands Manual TN-FONT(1) NNAAMMEE TTnn--ffoonntt - changing fonts inside the trade name macro DDEESSCCRRIIPPTTIIOONN normal text literal_e_m_p_h_a_s_i_sback trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Tn/font.out_markdown010064400017530001753000000002771313667013100217360ustar00schwarzeschwarzeTN-FONT(1) - General Commands Manual # NAME **Tn-font** - changing fonts inside the trade name macro # DESCRIPTION normal text `literalemphasisback` trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Tn/noarg.in010064400017530001753000000004071313667013100177660ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TN-NOARG 1 .Os .Sh NAME .Nm Tn-noarg .Nd trade name macro without argument .Sh DESCRIPTION with argument .Tn IBM "," "Em" italic no argument .Tn end of test document mandoc-1.14.6/regress/mdoc/Tn/noarg.out_ascii010064400017530001753000000005361313667013100213420ustar00schwarzeschwarzeTN-NOARG(1) General Commands Manual TN-NOARG(1) NNAAMMEE TTnn--nnooaarrgg - trade name macro without argument DDEESSCCRRIIPPTTIIOONN with argument IBM, _i_t_a_l_i_c no argument end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Tn/noarg.out_lint010064400017530001753000000001511313667013100212110ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Tn mandoc: noarg.in:10:2: STYLE: useless macro: Tn mandoc-1.14.6/regress/mdoc/Tn/noarg.out_markdown010064400017530001753000000003071313667013100220700ustar00schwarzeschwarzeTN-NOARG(1) - General Commands Manual # NAME **Tn-noarg** - trade name macro without argument # DESCRIPTION with argument `IBM`, *italic* no argument end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ud004075500017530001753000000000001412314056700162445ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ud/Makefile010064400017530001753000000002051306027274300177560ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2017/01/11 17:39:45 schwarze Exp $ REGRESS_TARGETS = arg LINT_TARGETS = arg .include mandoc-1.14.6/regress/mdoc/Ud/arg.in010064400017530001753000000004721313667013100174220ustar00schwarzeschwarze.\" $OpenBSD: arg.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt UD-ARG 1 .Os .Sh NAME .Nm Ud-arg .Nd obsolete text production macros .Sh DESCRIPTION The newest branch is .Ud The stable branch .Bt It will be released shortly. .Pp With arg: .Ud bar .Bt foo .Ud one two .Bt one two end mandoc-1.14.6/regress/mdoc/Ud/arg.out_ascii010064400017530001753000000010361313667013100207700ustar00schwarzeschwarzeUD-ARG(1) General Commands Manual UD-ARG(1) NNAAMMEE UUdd--aarrgg - obsolete text production macros DDEESSCCRRIIPPTTIIOONN The newest branch is currently under development. The stable branch is currently in beta test. It will be released shortly. With arg: currently under development. is currently in beta test. currently under development. is currently in beta test. end OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ud/arg.out_lint010064400017530001753000000010001313667013100206350ustar00schwarzeschwarzemandoc: arg.in:10:2: STYLE: useless macro: Ud mandoc: arg.in:12:2: STYLE: useless macro: Bt mandoc: arg.in:16:2: STYLE: useless macro: Ud mandoc: arg.in:16:2: ERROR: skipping all arguments: Ud bar mandoc: arg.in:17:2: STYLE: useless macro: Bt mandoc: arg.in:17:2: ERROR: skipping all arguments: Bt foo mandoc: arg.in:18:2: STYLE: useless macro: Ud mandoc: arg.in:18:2: ERROR: skipping all arguments: Ud one mandoc: arg.in:19:2: STYLE: useless macro: Bt mandoc: arg.in:19:2: ERROR: skipping all arguments: Bt one mandoc-1.14.6/regress/mdoc/Ud/arg.out_markdown010064400017530001753000000005751313667013100215310ustar00schwarzeschwarzeUD-ARG(1) - General Commands Manual # NAME **Ud-arg** - obsolete text production macros # DESCRIPTION The newest branch is currently under development. The stable branch is currently in beta test. It will be released shortly. With arg: currently under development. is currently in beta test. currently under development. is currently in beta test. end OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ux004075500017530001753000000000001412314056700162705ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Ux/Makefile010064400017530001753000000002251313667013100200010ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2013/12/22 14:06:29 schwarze Exp $ REGRESS_TARGETS = eos punct spacing LINT_TARGETS = punct .include mandoc-1.14.6/regress/mdoc/Ux/eos.in010064400017530001753000000005771313667013100174710ustar00schwarzeschwarze.\" $OpenBSD: eos.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt UX-EOS 1 .Os .Sh NAME .Nm Ux-eos .Nd end of sentence spacing after Unix macros .Sh DESCRIPTION In the beginning Ken and Dennis wrote .Ux . The CSRG rewrote it to become .Bx . When it dissolved, people started .Bsx . And .Nx . And .Fx . And .Ox . And .Dx . By now, it's free for everyone. mandoc-1.14.6/regress/mdoc/Ux/eos.out_ascii010064400017530001753000000007701313667013100210350ustar00schwarzeschwarzeUX-EOS(1) General Commands Manual UX-EOS(1) NNAAMMEE UUxx--eeooss - end of sentence spacing after Unix macros DDEESSCCRRIIPPTTIIOONN In the beginning Ken and Dennis wrote UNIX. The CSRG rewrote it to become BSD. When it dissolved, people started BSD/OS. And NetBSD. And FreeBSD. And OpenBSD. And DragonFly. By now, it's free for everyone. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ux/eos.out_markdown010064400017530001753000000005321313667013100215630ustar00schwarzeschwarzeUX-EOS(1) - General Commands Manual # NAME **Ux-eos** - end of sentence spacing after Unix macros # DESCRIPTION In the beginning Ken and Dennis wrote UNIX. The CSRG rewrote it to become BSD. When it dissolved, people started BSD/OS. And NetBSD. And FreeBSD. And OpenBSD. And DragonFly. By now, it's free for everyone. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ux/spacing.in010064400017530001753000000004571313667013100203240ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt UX-SPACING 1 .Os .Sh NAME .Nm Ux-spacing .Nd spacing around the Unix macro .Sh DESCRIPTION The .Ux family of operating systems, including .Nx , .Ox , .Fx , .Dx and .Bsx . The system is .Ud The system .Bt mandoc-1.14.6/regress/mdoc/Ux/spacing.out_ascii010064400017530001753000000007261313667013100216740ustar00schwarzeschwarzeUX-SPACING(1) General Commands Manual UX-SPACING(1) NNAAMMEE UUxx--ssppaacciinngg - spacing around the Unix macro DDEESSCCRRIIPPTTIIOONN The UNIX family of operating systems, including NetBSD, OpenBSD, FreeBSD, DragonFly and BSD/OS. The system is currently under development. The system is currently in beta test. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ux/spacing.out_markdown010064400017530001753000000004711313667013100224230ustar00schwarzeschwarzeUX-SPACING(1) - General Commands Manual # NAME **Ux-spacing** - spacing around the Unix macro # DESCRIPTION The UNIX family of operating systems, including NetBSD, OpenBSD, FreeBSD, DragonFly and BSD/OS. The system is currently under development. The system is currently in beta test. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Ux/punct.in010064400017530001753000000005101312673163500200250ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt UX-PUNCT 1 .Os .Sh NAME .Nm Ux-punct .Nd trailing delimiters in Unix macro arguments .Sh DESCRIPTION In June 2017, the latest release of various Unix-like operating systems were .Bsx 5.1, .Dx 4.8.0, .Fx 11.0, .Nx 7.1, and .Ox 6.1. mandoc-1.14.6/regress/mdoc/Ux/punct.out_ascii010064400017530001753000000007001312673163500213770ustar00schwarzeschwarzeUX-PUNCT(1) General Commands Manual UX-PUNCT(1) NNAAMMEE UUxx--ppuunncctt - trailing delimiters in Unix macro arguments DDEESSCCRRIIPPTTIIOONN In June 2017, the latest release of various Unix-like operating systems were BSD/OS 5.1, DragonFly 4.8.0, FreeBSD 11.0, NetBSD 7.1, and OpenBSD 6.1. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Ux/punct.out_lint010064400017530001753000000005671312673163500212700ustar00schwarzeschwarzemandoc: punct.in:11:9: STYLE: no blank before trailing delimiter: Bsx 5.1, mandoc: punct.in:12:10: STYLE: no blank before trailing delimiter: Dx 4.8.0, mandoc: punct.in:13:9: STYLE: no blank before trailing delimiter: Fx 11.0, mandoc: punct.in:14:8: STYLE: no blank before trailing delimiter: Nx 7.1, mandoc: punct.in:16:8: STYLE: no blank before trailing delimiter: Ox 6.1. mandoc-1.14.6/regress/mdoc/Ux/punct.out_markdown010064400017530001753000000004471312673163500221410ustar00schwarzeschwarzeUX-PUNCT(1) - General Commands Manual # NAME **Ux-punct** - trailing delimiters in Unix macro arguments # DESCRIPTION In June 2017, the latest release of various Unix-like operating systems were BSD/OS 5.1, DragonFly 4.8.0, FreeBSD 11.0, NetBSD 7.1, and OpenBSD 6.1. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Va004075500017530001753000000000001412314056700162425ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Va/Makefile010064400017530001753000000002301313667013100177470ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2014/07/02 20:18:42 schwarze Exp $ REGRESS_TARGETS = basic font noarg punct LINT_TARGETS = noarg .include mandoc-1.14.6/regress/mdoc/Va/basic.in010064400017530001753000000004441313667013100177270ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt VA-BASIC 1 .Os .Sh NAME .Nm Va-basic .Nd basic usage of the variable name macro .Sh DESCRIPTION Both .Vt char * .Va malloc_options and .Vt int .Va errno are typical examples of global variables. mandoc-1.14.6/regress/mdoc/Va/basic.out_ascii010064400017530001753000000006521313667013100213010ustar00schwarzeschwarzeVA-BASIC(1) General Commands Manual VA-BASIC(1) NNAAMMEE VVaa--bbaassiicc - basic usage of the variable name macro DDEESSCCRRIIPPTTIIOONN Both _c_h_a_r _* _m_a_l_l_o_c___o_p_t_i_o_n_s and _i_n_t _e_r_r_n_o are typical examples of global variables. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Va/basic.out_markdown010064400017530001753000000003601313667013100220270ustar00schwarzeschwarzeVA-BASIC(1) - General Commands Manual # NAME **Va-basic** - basic usage of the variable name macro # DESCRIPTION Both *char \*‌* *malloc\_options* and *int* *errno* are typical examples of global variables. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Va/font.in010064400017530001753000000003741313667013100176160ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt VA-FONT 1 .Os .Sh NAME .Nm Va-font .Nd changing fonts inside the variable name macro .Sh DESCRIPTION normal text .Va emphasis\\fBbold\\fPback trailing text mandoc-1.14.6/regress/mdoc/Va/font.out_ascii010064400017530001753000000005531313667013100211660ustar00schwarzeschwarzeVA-FONT(1) General Commands Manual VA-FONT(1) NNAAMMEE VVaa--ffoonntt - changing fonts inside the variable name macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Va/font.out_markdown010064400017530001753000000003031313667013100217110ustar00schwarzeschwarzeVA-FONT(1) - General Commands Manual # NAME **Va-font** - changing fonts inside the variable name macro # DESCRIPTION normal text *emphasis**bold**back* trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Va/noarg.in010064400017530001753000000004101313667013100177450ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt VA-NOARG 1 .Os .Sh NAME .Nm Va-noarg .Nd variable name macro without arguments .Sh DESCRIPTION with arguments .Vt int .Va errno. no arguments .Va end of test document mandoc-1.14.6/regress/mdoc/Va/noarg.out_ascii010064400017530001753000000005511313667013100213240ustar00schwarzeschwarzeVA-NOARG(1) General Commands Manual VA-NOARG(1) NNAAMMEE VVaa--nnooaarrgg - variable name macro without arguments DDEESSCCRRIIPPTTIIOONN with arguments _i_n_t _e_r_r_n_o_. no arguments end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Va/noarg.out_lint010064400017530001753000000002061313667013100211770ustar00schwarzeschwarzemandoc: noarg.in:13:2: WARNING: skipping empty macro: Va mandoc: noarg.in:11:10: STYLE: no blank before trailing delimiter: Va errno. mandoc-1.14.6/regress/mdoc/Va/noarg.out_markdown010064400017530001753000000003141313667013100220530ustar00schwarzeschwarzeVA-NOARG(1) - General Commands Manual # NAME **Va-noarg** - variable name macro without arguments # DESCRIPTION with arguments *int* *errno.* no arguments end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Va/punct.in010064400017530001753000000010071312673163600200020ustar00schwarzeschwarze.\" $OpenBSD: punct.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt AR-PUNCT 1 .Os .Sh NAME .Nm Va-punct .Nd punctuation handling by the Va macro .Sh DESCRIPTION closing punctuation .Va a ) only one .Va ) only more than one .Va ) ) middle .Va a ) z start .Va ) z dot .Va . z comma .Va , z semicolon .Va ; z colon .Va : z quest .Va ? z excl .Va ! z paren .Va ) z bracket .Va ] z bar .Va | m op paren .Va ( a op bracket .Va [ a .Pp quoted punctuation: .Va a "(" b "|" c ")" d "," "Sy" bold . mandoc-1.14.6/regress/mdoc/Va/punct.out_ascii010064400017530001753000000011021312673163600213470ustar00schwarzeschwarzeAR-PUNCT(1) General Commands Manual AR-PUNCT(1) NNAAMMEE VVaa--ppuunncctt - punctuation handling by the Va macro DDEESSCCRRIIPPTTIIOONN closing punctuation _a) only one ) only more than one )) middle _a) _z start ) _z dot . _z comma , _z semicolon ; _z colon : _z quest ? _z excl ! _z paren ) _z bracket ] _z bar | _m op paren (_a op bracket [_a quoted punctuation: _a (_b | _c) _d, bboolldd. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Va/punct.out_markdown010064400017530001753000000006411312673163600221100ustar00schwarzeschwarzeAR-PUNCT(1) - General Commands Manual # NAME **Va-punct** - punctuation handling by the Va macro # DESCRIPTION closing punctuation *a*) only one ) only more than one )) middle *a*) *z* start ) *z* dot . *z* comma , *z* semicolon ; *z* colon : *z* quest ? *z* excl ! *z* paren ) *z* bracket ] *z* bar | *m* op paren (*a* op bracket \[*a* quoted punctuation: *a* (*b* | *c*) *d*, **bold**. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Vt004075500017530001753000000000001412314056700162655ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Vt/Makefile010064400017530001753000000002321306027274500200010ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.7 2015/09/14 15:35:47 schwarze Exp $ REGRESS_TARGETS = noarg spacing font child LINT_TARGETS = noarg .include mandoc-1.14.6/regress/mdoc/Vt/child.in010064400017530001753000000005151313667013100177530ustar00schwarzeschwarze.\" $OpenBSD: child.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt VT-CHILD 1 .Os .Sh NAME .Nm Vt-child .Nd the variable type macro does not want children .Sh SYNOPSIS .Vt extern Sy int Li errno .Sh DESCRIPTION various types, for example .Vt unsigned Sy int , .Vt long Li int and .Vt float , .Vt double mandoc-1.14.6/regress/mdoc/Vt/child.out_ascii010064400017530001753000000007361313667013100213310ustar00schwarzeschwarzeVT-CHILD(1) General Commands Manual VT-CHILD(1) NNAAMMEE VVtt--cchhiilldd - the variable type macro does not want children SSYYNNOOPPSSIISS _e_x_t_e_r_n iinntt errno DDEESSCCRRIIPPTTIIOONN various types, for example _u_n_s_i_g_n_e_d iinntt, _l_o_n_g int and _f_l_o_a_t, _d_o_u_b_l_e OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Vt/child.out_markdown010064400017530001753000000004151313667013100220550ustar00schwarzeschwarzeVT-CHILD(1) - General Commands Manual # NAME **Vt-child** - the variable type macro does not want children # SYNOPSIS *extern **int** `errno`* # DESCRIPTION various types, for example *unsigned* **int**, *long* `int` and *float*, *double* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Vt/font.in010064400017530001753000000003741313667013100176410ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt VT-FONT 1 .Os .Sh NAME .Nm Vt-font .Nd changing fonts inside the variable type macro .Sh DESCRIPTION normal text .Vt emphasis\\fBbold\\fPback trailing text mandoc-1.14.6/regress/mdoc/Vt/font.out_ascii010064400017530001753000000005531313667013100212110ustar00schwarzeschwarzeVT-FONT(1) General Commands Manual VT-FONT(1) NNAAMMEE VVtt--ffoonntt - changing fonts inside the variable type macro DDEESSCCRRIIPPTTIIOONN normal text _e_m_p_h_a_s_i_sbboolldd_b_a_c_k trailing text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Vt/font.out_markdown010064400017530001753000000003031313667013100217340ustar00schwarzeschwarzeVT-FONT(1) - General Commands Manual # NAME **Vt-font** - changing fonts inside the variable type macro # DESCRIPTION normal text *emphasis**bold**back* trailing text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Vt/noarg.in010064400017530001753000000004051313667013100177740ustar00schwarzeschwarze.\" $OpenBSD: noarg.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt VT-NOARG 1 .Os .Sh NAME .Nm Vt-noarg .Nd variable type macro without arguments .Sh DESCRIPTION with arguments .Vt signed int. no arguments .Vt end of test document mandoc-1.14.6/regress/mdoc/Vt/noarg.out_ascii010064400017530001753000000005541313667013100213520ustar00schwarzeschwarzeVT-NOARG(1) General Commands Manual VT-NOARG(1) NNAAMMEE VVtt--nnooaarrgg - variable type macro without arguments DDEESSCCRRIIPPTTIIOONN with arguments _s_i_g_n_e_d _i_n_t_. no arguments end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Vt/noarg.out_lint010064400017530001753000000002101313667013100212150ustar00schwarzeschwarzemandoc: noarg.in:12:2: WARNING: skipping empty macro: Vt mandoc: noarg.in:10:15: STYLE: no blank before trailing delimiter: Vt ... int. mandoc-1.14.6/regress/mdoc/Vt/noarg.out_markdown010064400017530001753000000003131313667013100220750ustar00schwarzeschwarzeVT-NOARG(1) - General Commands Manual # NAME **Vt-noarg** - variable type macro without arguments # DESCRIPTION with arguments *signed int.* no arguments end of test document OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Vt/spacing.in010064400017530001753000000005311313667013100203120ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt VT-SPACING 1 .Os .Sh NAME .Nm Vt-spacing .Nd spacing around the variable type macro .Sh SYNOPSIS .Vt extern char **environ .Vt extern int errno .Sh DESCRIPTION various types, for example .Vt unsigned int , .Vt long int and .Vt float , .Vt double mandoc-1.14.6/regress/mdoc/Vt/spacing.out_ascii010064400017530001753000000010551313667013100216650ustar00schwarzeschwarzeVT-SPACING(1) General Commands Manual VT-SPACING(1) NNAAMMEE VVtt--ssppaacciinngg - spacing around the variable type macro SSYYNNOOPPSSIISS _e_x_t_e_r_n _c_h_a_r _*_*_e_n_v_i_r_o_n _e_x_t_e_r_n _i_n_t _e_r_r_n_o DDEESSCCRRIIPPTTIIOONN various types, for example _u_n_s_i_g_n_e_d _i_n_t, _l_o_n_g _i_n_t and _f_l_o_a_t, _d_o_u_b_l_e OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Vt/spacing.out_markdown010064400017530001753000000004311313667013100224140ustar00schwarzeschwarzeVT-SPACING(1) - General Commands Manual # NAME **Vt-spacing** - spacing around the variable type macro # SYNOPSIS *extern char \*\*environ* *extern int errno* # DESCRIPTION various types, for example *unsigned int*, *long int* and *float*, *double* OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Xr004075500017530001753000000000001412314056700162655ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Xr/Makefile010064400017530001753000000003131313667013100177740ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2015/02/06 01:07:07 schwarze Exp $ REGRESS_TARGETS = args # OpenBSD only: .Xr target tests cause too much trouble elsewhere LINT_TARGETS = args .include mandoc-1.14.6/regress/mdoc/Xr/args.in010064400017530001753000000010161313667013100176210ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.10 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt XR-ARGS 1 .Os .Sh NAME .Nm Xr-args .Nd additional arguments to cross references .Sh DESCRIPTION One single .Xr echo 1 is fine, and so is an .Xr echo 1 followed by something "Em" else . .Pp But listen for multiple .Xr echo 1 Ns s . .Pp A call, an .Xr "(" echo 1 ")" , and another .Xr echo 1 . .Pp Finally, an .Xr ( echo 1) without a blank, half an .Xr echo , no blank after half an .Xr echo, no echo .Xr , and no .Xr echo at all. mandoc-1.14.6/regress/mdoc/Xr/args.out_ascii010064400017530001753000000011071313667013100211730ustar00schwarzeschwarzeXR-ARGS(1) General Commands Manual XR-ARGS(1) NNAAMMEE XXrr--aarrggss - additional arguments to cross references DDEESSCCRRIIPPTTIIOONN One single echo(1) is fine, and so is an echo(1) followed by something _e_l_s_e. But listen for multiple echo(1)s. A call, an (echo(1)), and another echo(1). Finally, an (echo(1)) without a blank, half an echo, no blank after half an echo, no echo and no echo at all. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/Xr/args.out_lint010064400017530001753000000007161313667013100210560ustar00schwarzeschwarzemandoc: args.in:29:2: WARNING: skipping empty macro: Xr mandoc: args.in:31:2: WARNING: skipping empty macro: Xr mandoc: args.in:23:13: STYLE: no blank before trailing delimiter: Xr ... 1) mandoc: args.in:25:2: WARNING: missing section argument: Xr echo mandoc: args.in:27:2: WARNING: missing section argument: Xr echo, mandoc: args.in:27:9: STYLE: no blank before trailing delimiter: Xr echo, mandoc: args.in:23:8: STYLE: referenced manual not found: Xr echo 1) mandoc-1.14.6/regress/mdoc/Xr/args.out_markdown010064400017530001753000000006321313667013100217270ustar00schwarzeschwarzeXR-ARGS(1) - General Commands Manual # NAME **Xr-args** - additional arguments to cross references # DESCRIPTION One single echo(1) is fine, and so is an echo(1) followed by something *else*. But listen for multiple echo(1)s. A call, an (echo(1)), and another echo(1). Finally, an (echo(1)) without a blank, half an echo, no blank after half an echo, no echo and no echo at all. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/blank004075500017530001753000000000001412314056700167635ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/blank/Makefile010064400017530001753000000003251363444077200205060ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2020/02/27 01:25:59 schwarze Exp $ REGRESS_TARGETS = line comment list transp LINT_TARGETS = line comment list transp SKIP_TMAN = list SKIP_MARKDOWN ?= line .include mandoc-1.14.6/regress/mdoc/blank/comment.in010064400017530001753000000004261313667013100210310ustar00schwarzeschwarze.\" $OpenBSD: comment.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BLANK-COMMENT 1 .Os .Sh NAME .Nm blank-comment .Nd normal and bogus comments .Sh DESCRIPTION normal comment .\" normal bogus comment \." end of text .Pp text \" comment text mandoc-1.14.6/regress/mdoc/blank/comment.out_ascii010064400017530001753000000005271313667013100224040ustar00schwarzeschwarzeBLANK-COMMENT(1) General Commands Manual BLANK-COMMENT(1) NNAAMMEE bbllaannkk--ccoommmmeenntt - normal and bogus comments DDEESSCCRRIIPPTTIIOONN normal comment bogus comment end of text text text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/blank/comment.out_lint010064400017530001753000000000621313667013100222540ustar00schwarzeschwarzemandoc: comment.in:12:3: STYLE: bad comment style mandoc-1.14.6/regress/mdoc/blank/comment.out_markdown010064400017530001753000000002761313667013100231370ustar00schwarzeschwarzeBLANK-COMMENT(1) - General Commands Manual # NAME **blank-comment** - normal and bogus comments # DESCRIPTION normal comment bogus comment end of text text text OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/blank/line.in010064400017530001753000000013431313667013100203150ustar00schwarzeschwarze.\" $OpenBSD: line.in,v 1.6 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BLANK-LINE 1 .Os .Sh NAME .Nm blank-line .Nd handling of blank line .Sh DESCRIPTION Single br: .br Single Pp: .Pp Single sp: .sp Single blank: Double br: .br .br br Pp: .br .Pp Pp br: .Pp .br Double Pp: .Pp .Pp br sp: .br .sp sp br: .sp .br Pp sp: .Pp .sp Pp sp 2v: .Pp .sp 2v sp Pp: .sp .Pp Double sp: .sp .sp br blank: .br blank br: .br Pp blank: .Pp blank Pp: .Pp sp blank: .sp blank sp: .sp Double blank: Bd ragged sp 2v: .Bd -ragged -offset 6n .sp 2v Ed sp 2v: .Ed .sp 2v Bl tag sp 2v: .Bl -tag -width 6n .It tag .sp 2v El sp 2v .El Sh sp 2v: .Sh CUSTOM .sp 2v Pp Sh Pp: .Pp .Sh CUSTOM TWO .Pp Ss Pp: .Ss Subsection .Pp End. .Pp mandoc-1.14.6/regress/mdoc/blank/line.out_ascii010064400017530001753000000015131313667013100216650ustar00schwarzeschwarzeBLANK-LINE(1) General Commands Manual BLANK-LINE(1) NNAAMMEE bbllaannkk--lliinnee - handling of blank line DDEESSCCRRIIPPTTIIOONN Single br: Single Pp: Single sp: Single blank: Double br: br Pp: Pp br: Double Pp: br sp: sp br: Pp sp: Pp sp 2v: sp Pp: Double sp: br blank: blank br: Pp blank: blank Pp: sp blank: blank sp: Double blank: Bd ragged sp 2v: Ed sp 2v: Bl tag sp 2v: tag El sp 2v Sh sp 2v: CCUUSSTTOOMM Pp Sh Pp: CCUUSSTTOOMM TTWWOO Ss Pp: SSuubbsseeccttiioonn End. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/blank/line.out_lint010064400017530001753000000032661341026767500215640ustar00schwarzeschwarzemandoc: line.in:16:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:49:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:51:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:55:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:57:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:61:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:63:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:66:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:67:1: WARNING: blank line in fill mode, using .sp mandoc: line.in:19:2: WARNING: skipping paragraph macro: br after br mandoc: line.in:21:2: WARNING: skipping paragraph macro: br before Pp mandoc: line.in:25:2: WARNING: skipping paragraph macro: br after Pp mandoc: line.in:27:2: WARNING: skipping paragraph macro: Pp before Pp mandoc: line.in:30:2: WARNING: skipping paragraph macro: br before sp mandoc: line.in:34:2: WARNING: skipping paragraph macro: br after sp mandoc: line.in:37:2: WARNING: skipping paragraph macro: sp after Pp mandoc: line.in:40:2: WARNING: skipping paragraph macro: sp after Pp mandoc: line.in:48:2: WARNING: skipping paragraph macro: br before sp mandoc: line.in:52:2: WARNING: skipping paragraph macro: br after sp mandoc: line.in:55:1: WARNING: skipping paragraph macro: sp after Pp mandoc: line.in:82:2: WARNING: skipping paragraph macro: sp after Sh mandoc: line.in:84:2: WARNING: skipping paragraph macro: Pp at the end of Sh mandoc: line.in:89:2: WARNING: skipping paragraph macro: Pp after Ss mandoc: line.in:91:2: WARNING: skipping paragraph macro: Pp at the end of Ss mandoc: line.in:86:2: WARNING: skipping paragraph macro: Pp after Sh mandoc-1.14.6/regress/mdoc/blank/list.in010064400017530001753000000015531313667013100203440ustar00schwarzeschwarze.\" $OpenBSD: list.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BLANK-LIST 1 .Os .Sh NAME .Nm blank-list .Nd handling of blank lines in lists .Sh DESCRIPTION normal list: .Bl -item -offset indent .It first item .It second item .El list with paragraphs: .Bl -item -offset indent .It first item .Pp .It second item .Pp .El list with final paragraph: .Bl -item -offset indent .It item .El .Pp list with double paragraph: .Bl -item -offset indent .It item .Pp .El .Pp normal compact list: .Bl -item -compact -offset indent .It first item .It second item .El compact list with paragraphs: .Bl -item -compact -offset indent .It first item .Pp .It second item .Pp .El compact list with final paragraph: .Bl -item -compact -offset indent .It item .El .Pp compact list with double paragraph: .Bl -item -compact -offset indent .It item .Pp .El .Pp End. mandoc-1.14.6/regress/mdoc/blank/list.out_ascii010064400017530001753000000014361313667013100217150ustar00schwarzeschwarzeBLANK-LIST(1) General Commands Manual BLANK-LIST(1) NNAAMMEE bbllaannkk--lliisstt - handling of blank lines in lists DDEESSCCRRIIPPTTIIOONN normal list: first item second item list with paragraphs: first item second item list with final paragraph: item list with double paragraph: item normal compact list: first item second item compact list with paragraphs: first item second item compact list with final paragraph: item compact list with double paragraph: item End. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/blank/list.out_lint010064400017530001753000000007521313667013100215730ustar00schwarzeschwarzemandoc: list.in:20:2: WARNING: skipping paragraph macro: Pp before It mandoc: list.in:23:2: WARNING: moving paragraph macro out of list: Pp mandoc: list.in:35:2: WARNING: moving paragraph macro out of list: Pp mandoc: list.in:35:2: WARNING: skipping paragraph macro: Pp before Pp mandoc: list.in:52:2: WARNING: moving paragraph macro out of list: Pp mandoc: list.in:64:2: WARNING: moving paragraph macro out of list: Pp mandoc: list.in:64:2: WARNING: skipping paragraph macro: Pp before Pp mandoc-1.14.6/regress/mdoc/blank/list.out_markdown010064400017530001753000000007511313667013100224460ustar00schwarzeschwarzeBLANK-LIST(1) - General Commands Manual # NAME **blank-list** - handling of blank lines in lists # DESCRIPTION normal list: first item second item list with paragraphs: first item second item list with final paragraph: item list with double paragraph: item normal compact list: first item second item compact list with paragraphs: first item second item compact list with final paragraph: item compact list with double paragraph: item End. OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/blank/transp.in010064400017530001753000000012071362561734700207110ustar00schwarzeschwarze.\" $OpenBSD: transp.in,v 1.1 2020/02/27 01:25:59 schwarze Exp $ .Dd $Mdocdate: February 27 2020 $ .Dt BLANK-TRANSP 1 .Os .Sh NAME .Nm blank-transp .Nd transparent nodes between line breaks .Sh DESCRIPTION Double br: .br .Tg brbr .br br Pp: .br .Tg brPp .Pp Pp br: .Pp .Tg Ppbr .br Double Pp: .Pp .Tg PpPp .Pp br sp: .br .Tg brsp .sp sp br: .sp .Tg spbr .br Pp sp: .Pp .Tg Ppsp .sp Pp sp 2v: .Pp .Tg Ppsp2v .sp 2v sp Pp: .sp .Tg spPp .Pp Double sp: .sp .Tg spsp .sp br blank: .br .Tg brbl blank br: .Tg blbr .br Pp blank: .Pp .Tg Ppbl blank Pp: .Tg blPp .Pp sp blank: .sp .Tg spbl blank sp: .Tg blsp .sp Double blank: .Tg blbl end of file mandoc-1.14.6/regress/mdoc/blank/transp.out_ascii010064400017530001753000000010751362561734700222650ustar00schwarzeschwarzeBLANK-TRANSP(1) General Commands Manual BLANK-TRANSP(1) NNAAMMEE bbllaannkk--ttrraannsspp - transparent nodes between line breaks DDEESSCCRRIIPPTTIIOONN Double br: br Pp: Pp br: Double Pp: br sp: sp br: Pp sp: Pp sp 2v: sp Pp: Double sp: br blank: blank br: Pp blank: blank Pp: sp blank: blank sp: Double blank: end of file OpenBSD February 27, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/blank/transp.out_lint010064400017530001753000000024611362561734700221430ustar00schwarzeschwarzemandoc: transp.in:52:1: WARNING: blank line in fill mode, using .sp mandoc: transp.in:54:1: WARNING: blank line in fill mode, using .sp mandoc: transp.in:60:1: WARNING: blank line in fill mode, using .sp mandoc: transp.in:62:1: WARNING: blank line in fill mode, using .sp mandoc: transp.in:68:1: WARNING: blank line in fill mode, using .sp mandoc: transp.in:70:1: WARNING: blank line in fill mode, using .sp mandoc: transp.in:74:1: WARNING: blank line in fill mode, using .sp mandoc: transp.in:76:1: WARNING: blank line in fill mode, using .sp mandoc: transp.in:12:2: WARNING: skipping paragraph macro: br after br mandoc: transp.in:14:2: WARNING: skipping paragraph macro: br before Pp mandoc: transp.in:20:2: WARNING: skipping paragraph macro: br after Pp mandoc: transp.in:22:2: WARNING: skipping paragraph macro: Pp before Pp mandoc: transp.in:26:2: WARNING: skipping paragraph macro: br before sp mandoc: transp.in:32:2: WARNING: skipping paragraph macro: br after sp mandoc: transp.in:36:2: WARNING: skipping paragraph macro: sp after Pp mandoc: transp.in:40:2: WARNING: skipping paragraph macro: sp after Pp mandoc: transp.in:50:2: WARNING: skipping paragraph macro: br before sp mandoc: transp.in:56:2: WARNING: skipping paragraph macro: br after sp mandoc: transp.in:60:1: WARNING: skipping paragraph macro: sp after Pp mandoc-1.14.6/regress/mdoc/blank/transp.out_markdown010064400017530001753000000005261367274434500230200ustar00schwarzeschwarzeBLANK-TRANSP(1) - General Commands Manual # NAME **blank-transp** - transparent nodes between line breaks # DESCRIPTION Double br: br Pp: Pp br: Double Pp: br sp: sp br: Pp sp: Pp sp 2v: sp Pp: Double sp: br blank: blank br: Pp blank: blank Pp: sp blank: blank sp: Double blank: end of file OpenBSD - February 27, 2020 mandoc-1.14.6/regress/mdoc/break004075500017530001753000000000001412314056700167605ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/break/Makefile010064400017530001753000000006131306027275000204730ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2016/08/20 17:58:09 schwarze Exp $ REGRESS_TARGETS = brokenbreaker twice tail two notopen LINT_TARGETS = brokenbreaker twice tail two notopen # It's hard to keep stuff together in next-line scope. SKIP_TMAN = tail # groff-1.22.3 defect: # - non-matching enclosure end macro prints a closing delimiter SKIP_GROFF = brokenbreaker notopen .include mandoc-1.14.6/regress/mdoc/break/brokenbreaker.in010064400017530001753000000004171313667013100222000ustar00schwarzeschwarze.\" $OpenBSD: brokenbreaker.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BREAK-BROKENBREAKER 1 .Os .Sh NAME .Nm break-brokenbreaker .Nd a broken block breaking another block .Sh DESCRIPTION .Po po .Ao ao pc .Pc .Bo bo pc .Pc ac .Ac bc .Bc mandoc-1.14.6/regress/mdoc/break/brokenbreaker.out_ascii010064400017530001753000000005271313667013100235530ustar00schwarzeschwarzeBREAK-BROKENBREAKER(1) General Commands Manual BREAK-BROKENBREAKER(1) NNAAMMEE bbrreeaakk--bbrrookkeennbbrreeaakkeerr - a broken block breaking another block DDEESSCCRRIIPPTTIIOONN (po bc] OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/break/brokenbreaker.out_lint010064400017530001753000000003451313667013100234270ustar00schwarzeschwarzemandoc: brokenbreaker.in:11:2: WARNING: blocks badly nested: Po breaks Ao mandoc: brokenbreaker.in:13:2: ERROR: skipping end of block that is not open: Pc mandoc: brokenbreaker.in:14:2: WARNING: blocks badly nested: Ao breaks Bo mandoc-1.14.6/regress/mdoc/break/brokenbreaker.out_markdown010064400017530001753000000003041313667013100242760ustar00schwarzeschwarzeBREAK-BROKENBREAKER(1) - General Commands Manual # NAME **break-brokenbreaker** - a broken block breaking another block # DESCRIPTION (po <ao pc) \[bo pc ac> bc] OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/break/notopen.in010064400017530001753000000003731313667013100210470ustar00schwarzeschwarze.\" $OpenBSD: notopen.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BREAK-NOTOPEN 1 .Os .Sh NAME .Nm break-notopen .Nd mismatching end macro inside two open blocks .Sh DESCRIPTION .Ao ao .Bo bo pc .Pc bc .Bc ac .Ac tail mandoc-1.14.6/regress/mdoc/break/notopen.out_ascii010064400017530001753000000005111313667013100224120ustar00schwarzeschwarzeBREAK-NOTOPEN(1) General Commands Manual BREAK-NOTOPEN(1) NNAAMMEE bbrreeaakk--nnoottooppeenn - mismatching end macro inside two open blocks DDEESSCCRRIIPPTTIIOONN tail OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/break/notopen.out_lint010064400017530001753000000001131313667013100222660ustar00schwarzeschwarzemandoc: notopen.in:11:2: ERROR: skipping end of block that is not open: Pc mandoc-1.14.6/regress/mdoc/break/notopen.out_markdown010064400017530001753000000002741313667013100231520ustar00schwarzeschwarzeBREAK-NOTOPEN(1) - General Commands Manual # NAME **break-notopen** - mismatching end macro inside two open blocks # DESCRIPTION <ao \[bo pc bc] ac> tail OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/break/tail.in010064400017530001753000000014711313667013100203160ustar00schwarzeschwarze.\" $OpenBSD: tail.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BREAK-TAIL 1 .Os .Sh NAME .Nm break-tail .Nd tail arguments on or after broken blocks .Sh DESCRIPTION Broken by a partial explicit block: .Ao ao .Bo bo ac .Ac bc .Bc tail .Ao ao .Bo bo ac .Ac bc .Bc Po po pc .Pc tail .Pp Broken by a partial implicit block: .Aq aq Bo bo eol .Bc tail .Aq aq Bo bo eol .Bc Po po pc .Pc tail .Pp Broken by a full implicit block: .Bl -tag -width Ds -offset indent .It it Ao ao ac .Ac tail list body .El .Bl -tag -width Ds -offset indent .It it Ao ao ac .Ac Po po pc .Pc tail list body .El .Pp After a broken block: closing child on closing macro, then opening child on closing macro: .\" Crashed before mdoc_macro.c OpenBSD rev. 1.169 .Ao ao .Bo bo .Bro bro .Po po brc .Brc pc .Pc bc Bc ac .Ac Op op mandoc-1.14.6/regress/mdoc/break/tail.out_ascii010064400017530001753000000014121313667013100216620ustar00schwarzeschwarzeBREAK-TAIL(1) General Commands Manual BREAK-TAIL(1) NNAAMMEE bbrreeaakk--ttaaiill - tail arguments on or after broken blocks DDEESSCCRRIIPPTTIIOONN Broken by a partial explicit block: bc] tail bc] (po pc) tail Broken by a partial implicit block: ] tail ] (po pc) tail Broken by a full implicit block: it tail list body it (po pc) tail list body After a broken block: closing child on closing macro, then opening child on closing macro: [op] OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/break/tail.out_lint010064400017530001753000000005061313667013100215430ustar00schwarzeschwarzemandoc: tail.in:12:2: WARNING: blocks badly nested: Ao breaks Bo mandoc: tail.in:16:2: WARNING: blocks badly nested: Ao breaks Bo mandoc: tail.in:21:2: WARNING: blocks badly nested: Aq breaks Bo mandoc: tail.in:23:2: WARNING: blocks badly nested: Aq breaks Bo mandoc: tail.in:47:2: WARNING: blocks badly nested: Bro breaks Po mandoc-1.14.6/regress/mdoc/break/tail.out_markdown010064400017530001753000000011271313667013100224170ustar00schwarzeschwarzeBREAK-TAIL(1) - General Commands Manual # NAME **break-tail** - tail arguments on or after broken blocks # DESCRIPTION Broken by a partial explicit block: <ao \[bo ac> bc] tail <ao \[bo ac> bc] \(po pc) tail Broken by a partial implicit block: <aq \[bo eol>] tail <aq \[bo eol>] \(po pc) tail Broken by a full implicit block: it <ao ac> tail > list body it <ao ac> (po pc) tail > list body After a broken block: closing child on closing macro, then opening child on closing macro: <ao \[bo {bro (po brc} pc) bc] ac> \[op] OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/break/twice.in010064400017530001753000000011221313667013100204710ustar00schwarzeschwarze.\" $OpenBSD: twice.in,v 1.4 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BREAK-TWICE 1 .Os .Sh NAME .Nm break-twice .Nd breaking the same block twice .Sh DESCRIPTION Standard case, fully explicit: .Bo bo .Bro bro .Ao ao brc .Brc bc .Bc ac .Ac .Pp Standard case, implicit broken block: .Bo bo .Bro bro .Aq aq brc Brc bc Bc eol .Pp Two of the same kind, fully explicit: .Bo bo .Bo bo .Ao ao bc .Bc bc .Bc ac .Ac .Pp Two of the same kind, implicit broken block: .Bo bo .Bo bo .Aq aq bc Bc bc Bc eol .Pp Two implicit breakers: .Bl -dash .Aq aq Bq bq Po po pc .Pc .It it .El mandoc-1.14.6/regress/mdoc/break/twice.out_ascii010064400017530001753000000011521313667013100220450ustar00schwarzeschwarzeBREAK-TWICE(1) General Commands Manual BREAK-TWICE(1) NNAAMMEE bbrreeaakk--ttwwiiccee - breaking the same block twice DDEESSCCRRIIPPTTIIOONN Standard case, fully explicit: [bo {bro Standard case, implicit broken block: [bo {bro Two of the same kind, fully explicit: [bo [bo Two of the same kind, implicit broken block: [bo [bo Two implicit breakers: pc) -- it OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/break/twice.out_lint010064400017530001753000000013311313667013100217220ustar00schwarzeschwarzemandoc: twice.in:13:2: WARNING: blocks badly nested: Bro breaks Ao mandoc: twice.in:14:2: WARNING: blocks badly nested: Bo breaks Ao mandoc: twice.in:20:12: WARNING: blocks badly nested: Bro breaks Aq mandoc: twice.in:20:19: WARNING: blocks badly nested: Bo breaks Aq mandoc: twice.in:26:2: WARNING: blocks badly nested: Bo breaks Ao mandoc: twice.in:27:2: WARNING: blocks badly nested: Bo breaks Ao mandoc: twice.in:33:11: WARNING: blocks badly nested: Bo breaks Aq mandoc: twice.in:33:17: WARNING: blocks badly nested: Bo breaks Aq mandoc: twice.in:37:8: WARNING: blocks badly nested: Bq breaks Po mandoc: twice.in:37:2: WARNING: blocks badly nested: Aq breaks Po mandoc: twice.in:37:2: WARNING: moving content out of list: Aq mandoc-1.14.6/regress/mdoc/break/twice.out_markdown010064400017530001753000000007401313667013100226010ustar00schwarzeschwarzeBREAK-TWICE(1) - General Commands Manual # NAME **break-twice** - breaking the same block twice # DESCRIPTION Standard case, fully explicit: \[bo {bro <ao brc} bc] ac> Standard case, implicit broken block: \[bo {bro <aq brc} bc] eol> Two of the same kind, fully explicit: \[bo \[bo <ao bc] bc] ac> Two of the same kind, implicit broken block: \[bo \[bo <aq bc] bc] eol> Two implicit breakers: <aq \[bq (po]> pc) - it OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/break/two.in010064400017530001753000000011571313667013100201770ustar00schwarzeschwarze.\" $OpenBSD: two.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt BREAK-TWO 1 .Os .Sh NAME .Nm break-two .Nd the same block breaking two other blocks .Sh DESCRIPTION Standard case, explicit: .Ao ao .Bo bo .Bro bro ac .Ac brc .Brc bc .Bc .Pp Standard case, implicit: .Aq aq Bo bo Bro bro eol .Brc bc Bc .Pp Reverse closing, explicit: .Ao ao .Bo bo .Bro bro ac .Ac bc .Bc brc .Brc .Pp Reverse closing, implicit: .Aq aq Bo bo Bro bro eol .Bc brc Brc .Pp Two of the same kind, explicit: .Ao ao .Bo bo .Bo bo ac .Ac bc .Bc bc .Bc .Pp Two of the same kind, implicit: .Aq aq Bo bo Bo bo eol .Bc bc Bc mandoc-1.14.6/regress/mdoc/break/two.out_ascii010064400017530001753000000011701313667013100215430ustar00schwarzeschwarzeBREAK-TWO(1) General Commands Manual BREAK-TWO(1) NNAAMMEE bbrreeaakk--ttwwoo - the same block breaking two other blocks DDEESSCCRRIIPPTTIIOONN Standard case, explicit: brc} bc] Standard case, implicit: } bc] Reverse closing, explicit: bc] brc} Reverse closing, implicit: ] brc} Two of the same kind, explicit: bc] bc] Two of the same kind, implicit: ] bc] OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/mdoc/break/two.out_lint010064400017530001753000000010061313667013100214170ustar00schwarzeschwarzemandoc: two.in:13:2: WARNING: blocks badly nested: Ao breaks Bro mandoc: two.in:18:2: WARNING: blocks badly nested: Aq breaks Bro mandoc: two.in:25:2: WARNING: blocks badly nested: Ao breaks Bro mandoc: two.in:26:2: WARNING: blocks badly nested: Bo breaks Bro mandoc: two.in:30:2: WARNING: blocks badly nested: Aq breaks Bro mandoc: two.in:31:2: WARNING: blocks badly nested: Bo breaks Bro mandoc: two.in:37:2: WARNING: blocks badly nested: Ao breaks Bo mandoc: two.in:42:2: WARNING: blocks badly nested: Aq breaks Bo mandoc-1.14.6/regress/mdoc/break/two.out_markdown010064400017530001753000000007731313667013100223050ustar00schwarzeschwarzeBREAK-TWO(1) - General Commands Manual # NAME **break-two** - the same block breaking two other blocks # DESCRIPTION Standard case, explicit: <ao \[bo {bro ac> brc} bc] Standard case, implicit: <aq \[bo {bro eol>} bc] Reverse closing, explicit: <ao \[bo {bro ac> bc] brc} Reverse closing, implicit: <aq \[bo {bro eol>] brc} Two of the same kind, explicit: <ao \[bo \[bo ac> bc] bc] Two of the same kind, implicit: <aq \[bo \[bo eol>] bc] OpenBSD - July 4, 2017 mandoc-1.14.6/regress/mdoc/Tg004075500017530001753000000000001412314056700162465ustar00schwarzeschwarzemandoc-1.14.6/regress/mdoc/Tg/Makefile010064400017530001753000000003441367274434500177770ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2020/04/06 09:55:50 schwarze Exp $ REGRESS_TARGETS = column list warn TAG_TARGETS = column list warn LINT_TARGETS = warn HTML_TARGETS = column list warn SKIP_TMAN = column .include mandoc-1.14.6/regress/mdoc/Tg/warn.in010064400017530001753000000006711367274434500176410ustar00schwarzeschwarze.\" $OpenBSD: warn.in,v 1.2 2020/04/02 14:55:29 schwarze Exp $ .Dd $Mdocdate: April 2 2020 $ .Dt TG-WARN 1 .Os .Sh NAME .Nm Tg-warn .Nd warnings about tagging macros .Sh DESCRIPTION BEGINTEST .Pp .Tg start-tag initial text .Tg .Ic macro .Tg "" ignored arguments too many .Tg \&badstart badstart .Tg badend\& badend .Tg "white space" whitespace .Tg sub .Tg double .Ss Subsection subtext .Tg examples .Sh EXAMPLES example text .Pp ENDTEST .Tg mandoc-1.14.6/regress/mdoc/Tg/warn.out_ascii010064400017530001753000000007131367274434500212070ustar00schwarzeschwarzeTG-WARN(1) General Commands Manual TG-WARN(1) NNAAMMEE TTgg--wwaarrnn - warnings about tagging macros DDEESSCCRRIIPPTTIIOONN BEGINTEST initial text mmaaccrroo too many badstart badend whitespace SSuubbsseeccttiioonn subtext EEXXAAMMPPLLEESS example text ENDTEST OpenBSD April 2, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Tg/warn.out_html010064400017530001753000000007421367274434500210650ustar00schwarzeschwarze

initial text too many badstart badend whitespace

subtext

example text

mandoc-1.14.6/regress/mdoc/Tg/warn.out_lint010064400017530001753000000006451363272364200210620ustar00schwarzeschwarzemandoc: warn.in:16:2: WARNING: skipping empty macro: Tg mandoc: warn.in:16:8: ERROR: skipping excess arguments: Tg ... ignored mandoc: warn.in:18:5: ERROR: skipping tag containing whitespace: Tg \&badstart mandoc: warn.in:20:11: ERROR: skipping tag containing whitespace: Tg badend\& mandoc: warn.in:22:10: ERROR: skipping tag containing whitespace: Tg white space mandoc: warn.in:34:2: WARNING: skipping empty macro: Tg mandoc-1.14.6/regress/mdoc/Tg/warn.out_markdown010064400017530001753000000004041367274434500217360ustar00schwarzeschwarzeTG-WARN(1) - General Commands Manual # NAME **Tg-warn** - warnings about tagging macros # DESCRIPTION BEGINTEST initial text **macro** too many badstart badend whitespace ## Subsection subtext # EXAMPLES example text ENDTEST OpenBSD - April 2, 2020 mandoc-1.14.6/regress/mdoc/Tg/warn.out_tag010064400017530001753000000003031372346556400206650ustar00schwarzeschwarzeNAME warn.mandoc_ascii 3 DESCRIPTION warn.mandoc_ascii 6 start-tag warn.mandoc_ascii 9 macro warn.mandoc_ascii 9 sub warn.mandoc_ascii 9 double warn.mandoc_ascii 11 examples warn.mandoc_ascii 14 mandoc-1.14.6/regress/mdoc/Tg/column.in010064400017530001753000000004441364320241700201500ustar00schwarzeschwarze.\" $OpenBSD: column.in,v 1.2 2020/04/07 22:45:38 schwarze Exp $ .Dd $Mdocdate: April 7 2020 $ .Dt TG-COLUMN 1 .Os .Sh NAME .Nm Tg-column .Nd explicit tagging of column lists and rows .Sh DESCRIPTION BEGINTEST .Tg list .Bl -column one two .It one Ta .Tg row1 two .Tg row2 .It 1 2 .El ENDTEST mandoc-1.14.6/regress/mdoc/Tg/column.out_ascii010064400017530001753000000005301364320241700215150ustar00schwarzeschwarzeTG-COLUMN(1) General Commands Manual TG-COLUMN(1) NNAAMMEE TTgg--ccoolluummnn - explicit tagging of column lists and rows DDEESSCCRRIIPPTTIIOONN BEGINTEST one two 1 2 ENDTEST OpenBSD April 7, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Tg/column.out_html010064400017530001753000000002371364260056700214040ustar00schwarzeschwarze
one two
1 2
mandoc-1.14.6/regress/mdoc/Tg/column.out_markdown010064400017530001753000000002771364320241700222570ustar00schwarzeschwarzeTG-COLUMN(1) - General Commands Manual # NAME **Tg-column** - explicit tagging of column lists and rows # DESCRIPTION BEGINTEST one two 1 2 ENDTEST OpenBSD - April 7, 2020 mandoc-1.14.6/regress/mdoc/Tg/column.out_tag010064400017530001753000000002171372346556400212170ustar00schwarzeschwarzeNAME column.mandoc_ascii 3 DESCRIPTION column.mandoc_ascii 6 list column.mandoc_ascii 8 row1 column.mandoc_ascii 9 row2 column.mandoc_ascii 10 mandoc-1.14.6/regress/mdoc/Tg/list.in010064400017530001753000000005031364260056700176310ustar00schwarzeschwarze.\" $OpenBSD: list.in,v 1.1 2020/04/06 09:55:50 schwarze Exp $ .Dd $Mdocdate: April 6 2020 $ .Dt TG-LIST 1 .Os .Sh NAME .Nm Tg-list .Nd explicit tagging of lists and list elements .Sh DESCRIPTION BEGINTEST .Tg dashlist .Bl -dash .Tg dashitem .It item .El .Tg taglist .Bl -tag -width Ds .Tg tagitem .It tag text .El ENDTEST mandoc-1.14.6/regress/mdoc/Tg/list.out_ascii010064400017530001753000000005311364260056700212030ustar00schwarzeschwarzeTG-LIST(1) General Commands Manual TG-LIST(1) NNAAMMEE TTgg--lliisstt - explicit tagging of lists and list elements DDEESSCCRRIIPPTTIIOONN BEGINTEST -- item tag text ENDTEST OpenBSD April 6, 2020 OpenBSD mandoc-1.14.6/regress/mdoc/Tg/list.out_html010064400017530001753000000003551364260056700210630ustar00schwarzeschwarze
text
mandoc-1.14.6/regress/mdoc/Tg/list.out_markdown010064400017530001753000000002711364260056700217360ustar00schwarzeschwarzeTG-LIST(1) - General Commands Manual # NAME **Tg-list** - explicit tagging of lists and list elements # DESCRIPTION BEGINTEST - item tag > text ENDTEST OpenBSD - April 6, 2020 mandoc-1.14.6/regress/mdoc/Tg/list.out_tag010064400017530001753000000002551372346556400206770ustar00schwarzeschwarzeNAME list.mandoc_ascii 3 DESCRIPTION list.mandoc_ascii 6 dashlist list.mandoc_ascii 8 dashitem list.mandoc_ascii 9 taglist list.mandoc_ascii 10 tagitem list.mandoc_ascii 11 mandoc-1.14.6/regress/roff004075500017530001753000000000001412314056700157065ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/Makefile010064400017530001753000000003771343772345400174420ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.28 2019/01/04 01:06:44 schwarze Exp $ SUBDIR = args cond esc scale string SUBDIR += br cc ce char de ds ft ig it ll na nr po ps SUBDIR += return rm rn shift sp ta ti tr while .include "../Makefile.sub" .include mandoc-1.14.6/regress/roff/Makefile.inc010064400017530001753000000002051306027275100201670ustar00schwarzeschwarze# $OpenBSD: Makefile.inc,v 1.3 2015/02/03 19:37:25 schwarze Exp $ SKIP_TMAN ?= ALL SKIP_MARKDOWN ?= ALL .include "../Makefile.inc" mandoc-1.14.6/regress/roff/args004075500017530001753000000000001412314056700166425ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/args/Makefile010064400017530001753000000002271304650516500203610ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.4 2014/07/06 19:08:57 schwarze Exp $ REGRESS_TARGETS = roff man mdoc LINT_TARGETS = roff man mdoc .include mandoc-1.14.6/regress/roff/args/man.in010064400017530001753000000035541313667013100200260ustar00schwarzeschwarze.\" $OpenBSD: man.in,v 1.5 2017/07/04 14:53:26 schwarze Exp $ .TH ARGS-MAN 1 "November 19, 2014" .SH NAME args-man - arguments to man macros .SH DESCRIPTION standard unquoted: .IB one two text .br escaped blanks: .IB one\ one two\ two text .br escaped 'e' character: .IB one\eone two text .br .\"escaped backslash before blank: .\"IB one\\ two .\"text .\"br escaped backslash before 'e' character: .IB one\\e two text .br double inter-argument space: .IB one two text .br triple inter-argument space: .IB one two text .br single eol blank: .IB one two text .br double eol blank: .IB one two text .br triple eol blank: .IB one two text .br standard quoted: .IB "one" "two" text .br quoted quotes: .IB "one""one" """two""" text .br quoted whitespace: .IB "one one" "two two" text .br escaped 'e' characters: .IB "one \e one" "\e" text .br escaped backslash before blank: .IB "one\\ one" "\\ " text .br escaped backslash before 'e' character: .IB "one\\eone" "\\e" text .br double inter-argument space: .IB "one one" "two two" text .br triple inter-argument space: .IB "one one" "two two" text .br missing inter-argument space: .IB "one one"two\ two text .br single eol blank: .IB "one one" "two two" text .br double eol blank: .IB "one one" "two two" text .br triple eol blank: .IB "one one" "two two" text .br .\" Disabled for now because mandoc man(7) seems to .\" mishandle trailing blanks in arguments, .\" but that really isn't urgent to fix. .ig trailing blanks in arguments: .IB "one " "two " text .br .. unterminated quotes: .IB "one text .br .IB one "two text .br .ig single trailing blank in unterminated quotes: .IB "one text .br .IB one "two text .br double trailing blank in unterminated quotes: .IB "one text .br .IB one "two text .br .. tab after macro: .IB one two text .br escape sequence after macro: .IB\(lqone two text .br backslash at eol: .IB one two\ mandoc-1.14.6/regress/roff/args/man.out_ascii010064400017530001753000000034531412140003600213630ustar00schwarzeschwarzeARGS-MAN(1) General Commands Manual ARGS-MAN(1) NNAAMMEE args-man - arguments to man macros DDEESSCCRRIIPPTTIIOONN standard unquoted: _o_n_ettwwoo text escaped blanks: _o_n_e _o_n_ettwwoo ttwwoo text escaped 'e' character: _o_n_e_\_o_n_ettwwoo text escaped backslash before 'e' character: _o_n_e_\ttwwoo text double inter-argument space: _o_n_ettwwoo text triple inter-argument space: _o_n_ettwwoo text single eol blank: _o_n_ettwwoo text double eol blank: _o_n_ettwwoo text triple eol blank: _o_n_ettwwoo text standard quoted: _o_n_ettwwoo text quoted quotes: _o_n_e_"_o_n_e""ttwwoo"" text quoted whitespace: _o_n_e _o_n_ettwwoo ttwwoo text escaped 'e' characters: _o_n_e _\ _o_n_e\\ text escaped backslash before blank: _o_n_e _o_n_e text escaped backslash before 'e' character: _o_n_e_\_o_n_e\\ text double inter-argument space: _o_n_e _o_n_ettwwoo ttwwoo text triple inter-argument space: _o_n_e _o_n_ettwwoo ttwwoo text missing inter-argument space: _o_n_e _o_n_ettwwoo ttwwoo text single eol blank: _o_n_e _o_n_ettwwoo ttwwoo text double eol blank: _o_n_e _o_n_ettwwoo ttwwoo text triple eol blank: _o_n_e _o_n_ettwwoo ttwwoo text unterminated quotes: _o_n_e text _o_n_ettwwoo text tab after macro: _o_n_ettwwoo text escape sequence after macro: _o_n_ettwwoo text backslash at eol: _o_n_ettwwoo OpenBSD November 19, 2014 ARGS-MAN(1) mandoc-1.14.6/regress/roff/args/man.out_lint010064400017530001753000000010551313667013100212470ustar00schwarzeschwarzemandoc: man.in:35:13: STYLE: whitespace at end of input line mandoc: man.in:39:14: STYLE: whitespace at end of input line mandoc: man.in:43:15: STYLE: whitespace at end of input line mandoc: man.in:83:25: STYLE: whitespace at end of input line mandoc: man.in:87:26: STYLE: whitespace at end of input line mandoc: man.in:91:27: STYLE: whitespace at end of input line mandoc: man.in:104:5: STYLE: unterminated quoted argument mandoc: man.in:107:9: STYLE: unterminated quoted argument mandoc: man.in:131:1: ERROR: escaped character not allowed in a name: IB\( mandoc-1.14.6/regress/roff/args/mdoc.in010064400017530001753000000033411313667013100201670ustar00schwarzeschwarze.\" $OpenBSD: mdoc.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ARGS-MDOC 1 .Os .Sh NAME .Nm args-mdoc .Nd arguments to mdoc macros .Sh DESCRIPTION standard unquoted: .Fl one two text .br escaped blanks: .Fl one\ one two\ two text .br escaped 'e' character: .Fl one\eone two text .br .\"escaped backslash before blank: .\"Fl one\\ two .\"text .\"br escaped backslash before 'e' character: .Fl one\\e two text .br double inter-argument space: .Fl one two text .br triple inter-argument space: .Fl one two text .br single eol blank: .Fl one two text .br double eol blank: .Fl one two text .br triple eol blank: .Fl one two text .br standard quoted: .Fl "one" "two" text .br quoted quotes: .Fl "one""one" """two""" text .br quoted whitespace: .Fl "one one" "two two" text .br escaped 'e' characters: .Fl "one \e one" "\e" text .br .\"escaped backslash before blank: .\"Fl "one\\ one" "\\ " .\"text .\"br .\"escaped backslash before 'e' character: .\"Fl "one\\eone" "\\e" .\"text .\"br double inter-argument space: .Fl "one one" "two two" text .br triple inter-argument space: .Fl "one one" "two two" text .br missing inter-argument space: .Fl "one one"two\ two text .br single eol blank: .Fl "one one" "two two" text .br double eol blank: .Fl "one one" "two two" text .br triple eol blank: .Fl "one one" "two two" text .br trailing blanks in arguments: .Fl "one " "two " text .br unterminated quotes: .Fl "one .Fl one "two text .br single trailing blank in unterminated quotes: .Fl "one .Fl one "two text .br double trailing blank in unterminated quotes: .Fl "one .Fl one "two text .br tab after macro: .Fl one two text .br escape sequence after macro: .Fl\(lqone two text .br backslash at eol: .Fl one two\ mandoc-1.14.6/regress/roff/args/mdoc.out_ascii010064400017530001753000000040411313667013100215360ustar00schwarzeschwarzeARGS-MDOC(1) General Commands Manual ARGS-MDOC(1) NNAAMMEE aarrggss--mmddoocc - arguments to mdoc macros DDEESSCCRRIIPPTTIIOONN standard unquoted: --oonnee --ttwwoo text escaped blanks: --oonnee oonnee --ttwwoo ttwwoo text escaped 'e' character: --oonnee\\oonnee --ttwwoo text escaped backslash before 'e' character: --oonnee\\ --ttwwoo text double inter-argument space: --oonnee --ttwwoo text triple inter-argument space: --oonnee --ttwwoo text single eol blank: --oonnee --ttwwoo text double eol blank: --oonnee --ttwwoo text triple eol blank: --oonnee --ttwwoo text standard quoted: --oonnee --ttwwoo text quoted quotes: --oonnee""oonnee --""ttwwoo"" text quoted whitespace: --oonnee oonnee --ttwwoo ttwwoo text escaped 'e' characters: --oonnee \\ oonnee --\\ text double inter-argument space: --oonnee oonnee --ttwwoo ttwwoo text triple inter-argument space: --oonnee oonnee --ttwwoo ttwwoo text missing inter-argument space: --oonnee oonnee --ttwwoo ttwwoo text single eol blank: --oonnee oonnee --ttwwoo ttwwoo text double eol blank: --oonnee oonnee --ttwwoo ttwwoo text triple eol blank: --oonnee oonnee --ttwwoo ttwwoo text trailing blanks in arguments: --oonnee --ttwwoo text unterminated quotes: --oonnee --oonnee --ttwwoo text single trailing blank in unterminated quotes: --oonnee --oonnee --ttwwoo text double trailing blank in unterminated quotes: --oonnee --oonnee --ttwwoo text tab after macro: --oonnee --ttwwoo text escape sequence after macro: --oonnee --ttwwoo text backslash at eol: --oonnee --ttwwoo OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/args/mdoc.out_lint010064400017530001753000000020361341026767500214300ustar00schwarzeschwarzemandoc: mdoc.in:38:13: STYLE: whitespace at end of input line mandoc: mdoc.in:42:14: STYLE: whitespace at end of input line mandoc: mdoc.in:46:15: STYLE: whitespace at end of input line mandoc: mdoc.in:86:25: STYLE: whitespace at end of input line mandoc: mdoc.in:90:26: STYLE: whitespace at end of input line mandoc: mdoc.in:94:27: STYLE: whitespace at end of input line mandoc: mdoc.in:102:5: STYLE: unterminated quoted argument mandoc: mdoc.in:103:9: STYLE: unterminated quoted argument mandoc: mdoc.in:107:5: STYLE: unterminated quoted argument mandoc: mdoc.in:107:10: STYLE: whitespace at end of input line mandoc: mdoc.in:108:9: STYLE: unterminated quoted argument mandoc: mdoc.in:108:14: STYLE: whitespace at end of input line mandoc: mdoc.in:112:5: STYLE: unterminated quoted argument mandoc: mdoc.in:112:11: STYLE: whitespace at end of input line mandoc: mdoc.in:113:9: STYLE: unterminated quoted argument mandoc: mdoc.in:113:15: STYLE: whitespace at end of input line mandoc: mdoc.in:121:1: ERROR: escaped character not allowed in a name: Fl\( mandoc-1.14.6/regress/roff/args/roff.in010064400017530001753000000030741341026767500202160ustar00schwarzeschwarze.\" $OpenBSD: roff.in,v 1.6 2018/08/19 23:55:40 schwarze Exp $ .TH ARGS-ROFF 1 "February 21, 2015" .SH NAME args-roff - arguments to roff macros .SH DESCRIPTION .de test .BI (\\$1) "(\\$2)" .br .. arguments containing quotes: .test a"b a"b .de test (\\$1) (\\$2) .br .. standard unquoted: .test one two escaped blanks: .test one\ one two\ two escaped 'e' character: .test one\eone two .\" escaped backslash before blank: -- broken for unknown reasons .\" .test one\\ two escaped backslash before 'e' character: .test one\\e two double inter-argument space: .test one two triple inter-argument space: .test one two single eol blank: .test one two double eol blank: .test one two triple eol blank: .test one two standard quoted: .test "one" "two" quoted quotes: .test "one""one" """two""" quoted whitespace: .test "one one" "two two" escaped 'e' characters: .test "one \e one" "\e" escaped backslash before blank: .test "one\\ one" "\\ " escaped backslash before 'e' character: .test "one\\eone" "\\e" double inter-argument space: .test "one one" "two two" triple inter-argument space: .test "one one" "two two" missing inter-argument space: .test "one one"two\ two single eol blank: .test "one one" "two two" double eol blank: .test "one one" "two two" triple eol blank: .test "one one" "two two" trailing blanks in arguments: .test "one " "two " unterminated quotes: .test "one .test one "two single trailing blank in unterminated quotes: .test "one .test one "two double trailing blank in unterminated quotes: .test "one .test one "two backslash at eol: .test one two\ mandoc-1.14.6/regress/roff/args/roff.out_ascii010064400017530001753000000031141412140003600215360ustar00schwarzeschwarzeARGS-ROFF(1) General Commands Manual ARGS-ROFF(1) NNAAMMEE args-roff - arguments to roff macros DDEESSCCRRIIPPTTIIOONN arguments containing quotes: ((aa""bb))_(_a_"_b_) standard unquoted: (one) (two) escaped blanks: (one one) (two two) escaped 'e' character: (one\one) (two) escaped backslash before 'e' character: (one\) (two) double inter-argument space: (one) (two) triple inter-argument space: (one) (two) single eol blank: (one) (two) double eol blank: (one) (two) triple eol blank: (one) (two) standard quoted: (one) (two) quoted quotes: (one"one) ("two") quoted whitespace: (one one) (two two) escaped 'e' characters: (one \ one) (\) escaped backslash before blank: (one one) ( ) escaped backslash before 'e' character: (one\one) (\) double inter-argument space: (one one) (two two) triple inter-argument space: (one one) (two two) missing inter-argument space: (one one) (two two) single eol blank: (one one) (two two) double eol blank: (one one) (two two) triple eol blank: (one one) (two two) trailing blanks in arguments: (one ) (two ) unterminated quotes: (one) () (one) (two) single trailing blank in unterminated quotes: (one ) () (one) (two ) double trailing blank in unterminated quotes: (one ) () (one) (two ) backslash at eol: (one) (two) OpenBSD February 21, 2015 ARGS-ROFF(1) mandoc-1.14.6/regress/roff/args/roff.out_lint010064400017530001753000000020301341026767500214340ustar00schwarzeschwarzemandoc: roff.in:31:15: STYLE: whitespace at end of input line mandoc: roff.in:33:16: STYLE: whitespace at end of input line mandoc: roff.in:35:17: STYLE: whitespace at end of input line mandoc: roff.in:55:27: STYLE: whitespace at end of input line mandoc: roff.in:57:28: STYLE: whitespace at end of input line mandoc: roff.in:59:29: STYLE: whitespace at end of input line mandoc: roff.in:63:7: STYLE: unterminated quoted argument mandoc: roff.in:64:11: STYLE: unterminated quoted argument mandoc: roff.in:66:7: STYLE: unterminated quoted argument mandoc: roff.in:66:12: STYLE: whitespace at end of input line mandoc: roff.in:67:11: STYLE: unterminated quoted argument mandoc: roff.in:67:16: STYLE: whitespace at end of input line mandoc: roff.in:69:7: STYLE: unterminated quoted argument mandoc: roff.in:69:13: STYLE: whitespace at end of input line mandoc: roff.in:70:11: STYLE: unterminated quoted argument mandoc: roff.in:70:17: STYLE: whitespace at end of input line mandoc: roff.in:72:2: WARNING: skipping paragraph macro: br at the end of SH mandoc-1.14.6/regress/roff/br004075500017530001753000000000001412314056700163115ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/br/Makefile010064400017530001753000000002071304650516500200260ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2015/02/06 08:28:04 schwarze Exp $ REGRESS_TARGETS = args LINT_TARGETS = args .include mandoc-1.14.6/regress/roff/br/args.in010064400017530001753000000003031313667013100176430ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .TH BR-ARGS 1 "January 17, 2011" .SH NAME br-args \- arguments to .br macros .SH DESCRIPTION some text .br arg1 arg2 arg3 more text mandoc-1.14.6/regress/roff/br/args.out_ascii010064400017530001753000000004331412140003600212060ustar00schwarzeschwarzeBR-ARGS(1) General Commands Manual BR-ARGS(1) NNAAMMEE br-args - arguments to .br macros DDEESSCCRRIIPPTTIIOONN some text more text OpenBSD January 17, 2011 BR-ARGS(1) mandoc-1.14.6/regress/roff/br/args.out_lint010064400017530001753000000001061313667013100210730ustar00schwarzeschwarzemandoc: args.in:8:5: ERROR: skipping all arguments: br arg1 arg2 arg3 mandoc-1.14.6/regress/roff/cc004075500017530001753000000000001412314056700162735ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/cc/Makefile010064400017530001753000000002111304650516600200040ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2015/02/06 16:05:51 schwarze Exp $ REGRESS_TARGETS = basic LINT_TARGETS = basic .include mandoc-1.14.6/regress/roff/cc/basic.in010064400017530001753000000003761313667013100177640ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:26 schwarze Exp $ .TH CC-BASIC 1 "July 7, 2012" .SH NAME cc-basic \- basic usage of the cc request .SH DESCRIPTION first line .br second .cc : line :br third :cc ;bogus line ;br fourth ;cc line .br last line mandoc-1.14.6/regress/roff/cc/basic.out_ascii010064400017530001753000000005331412140003600213160ustar00schwarzeschwarzeCC-BASIC(1) General Commands Manual CC-BASIC(1) NNAAMMEE cc-basic - basic usage of the cc request DDEESSCCRRIIPPTTIIOONN first line second line third line fourth line last line OpenBSD July 7, 2012 CC-BASIC(1) mandoc-1.14.6/regress/roff/cc/basic.out_lint010064400017530001753000000001061313667013100212020ustar00schwarzeschwarzemandoc: basic.in:13:6: ERROR: skipping excess arguments: cc ... bogus mandoc-1.14.6/regress/roff/cond004075500017530001753000000000001412314056700166315ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/cond/Makefile010064400017530001753000000003001372346556500203530ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.10 2020/08/03 10:52:39 schwarze Exp $ REGRESS_TARGETS = if ie close de numeric register strcmp string before-Dd LINT_TARGETS = if close de .include mandoc-1.14.6/regress/roff/cond/before-Dd.in010064400017530001753000000012661313667013100210270ustar00schwarzeschwarze.\" $OpenBSD: before-Dd.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .if n \{.ds mystring mytext .\} .Dd $Mdocdate: July 4 2017 $ .Dt IF-BEFORE-DD 1 .Os .Sh NAME .Nm if-before-Dd .Nd end of if block on its own line before Dd .Sh DESCRIPTION In an old version of .Xr mandoc 1 , .Xr mdoc 7 file format autodetection failed when the end of an .Ic if block stood on its own line before the initial .Xr mdoc 7 .Ic Dd macro. The file was mishandled as .Xr man 7 and parsing failed with unknown macro errors. .Pp If the present document looks like a proper .Xr mdoc 7 document and the following display reads .Dq mytext , then the problem did not come back: .Bd -ragged -offset indent \*[mystring] .Ed mandoc-1.14.6/regress/roff/cond/before-Dd.out_ascii010064400017530001753000000013341313667013200223750ustar00schwarzeschwarzeIF-BEFORE-DD(1) General Commands Manual IF-BEFORE-DD(1) NNAAMMEE iiff--bbeeffoorree--DDdd - end of if block on its own line before Dd DDEESSCCRRIIPPTTIIOONN In an old version of mandoc(1), mdoc(7) file format autodetection failed when the end of an iiff block stood on its own line before the initial mdoc(7) DDdd macro. The file was mishandled as man(7) and parsing failed with unknown macro errors. If the present document looks like a proper mdoc(7) document and the following display reads "mytext", then the problem did not come back: mytext OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/cond/close.in010064400017530001753000000023611372346556500203610ustar00schwarzeschwarze.\" $OpenBSD: close.in,v 1.5 2020/08/03 10:52:39 schwarze Exp $ .TH COND-CLOSE 1 "November 26, 2018" .SH NAME cond-close \- closing conditional macros .SH DESCRIPTION .if t \{.unknown \} closing after an unknown macro .PP .if t \{.ig \} closing after an ignored macro .PP .if t \{text \} closing after plain text .PP .if t \{text \} text line contains closing brace only .PP .if t \{text \} plus something text line contains closing brace and additional words .PP .if t \{text .\} request line contains closing brace only .PP .if t \{text .\}with following args request line contains closing brace and additional args .PP .if n \{conditional content \} following words with whitespace .PP .if n \{conditional content\}following words without whitespace .PP preceding words .if n \{\ standard multi-line style .\} following words .PP preceding words .if n \{ non-standard multi-line style \} following words .PP preceding words .if n \{text line block end \} with additional words following words .PP .if n \{two .if n \{closes on\} the\} same text line .PP preceding words .if n \{close on request line .\}with following args following words .PP preceding words .if n \{two .if n \{closes .BR\}on\}the same macro line .PP .if n \{ still open at the end of the file mandoc-1.14.6/regress/roff/cond/close.out_ascii010064400017530001753000000022021412140003600216730ustar00schwarzeschwarzeCOND-CLOSE(1) General Commands Manual COND-CLOSE(1) NNAAMMEE cond-close - closing conditional macros DDEESSCCRRIIPPTTIIOONN closing after an unknown macro closing after an ignored macro closing after plain text text line contains closing brace only text line contains closing brace and additional words request line contains closing brace only request line contains closing brace and additional args conditional content following words with whitespace conditional contentfollowing words without whitespace preceding words standard multi-line style following words preceding words non-standard multi-line style following words preceding words text line block end with additional words following words two closes on the same text line preceding words close on request line following words preceding words two closes oonntthheesame macro line still open at the end of the file OpenBSD November 26, 2018 COND-CLOSE(1) mandoc-1.14.6/regress/roff/cond/close.out_lint010064400017530001753000000003231372346556500216040ustar00schwarzeschwarzemandoc: close.in:65:1: ERROR: escaped character not allowed in a name: BR\& mandoc: close.in:68:2: ERROR: appending missing end of block: if mandoc: close.in:68:9: WARNING: skipping paragraph macro: sp after PP mandoc-1.14.6/regress/roff/cond/ie.in010064400017530001753000000014251313667013200176330ustar00schwarzeschwarze.\" $OpenBSD: ie.in,v 1.6 2017/07/04 22:49:59 schwarze Exp $ .TH IE 1 "July 4, 2017" .SH NAME if \- the roff conditional instruction with else-clause .SH DESCRIPTION .el Initially, else is ignored. .ie n One-line true condition. .br Text following the true condition. .el One-line else after true. .el Another else after true. .br .ie n \{\ Two-line true condition. .br\} .el \{\ Two-line else after true. .br\} .ie t One-line false condition. Text following the false condition. .br .el \{Two-line else after false.\} .br .el Another else after false. .br .ie Text following an empty condition. .el Else after empty condition. .br .ie ! Text following negated empty condition. .el Else after negated empty condition. .br .ie n If \&.el\e{ works, nothing follows here: .el\{dummy BOOHOO\} mandoc-1.14.6/regress/roff/cond/ie.out_ascii010064400017530001753000000011001412140003600211570ustar00schwarzeschwarzeIE(1) General Commands Manual IE(1) NNAAMMEE if - the roff conditional instruction with else-clause DDEESSCCRRIIPPTTIIOONN One-line true condition. Text following the true condition. Two-line true condition. Text following the false condition. Two-line else after false. Else after empty condition. Else after negated empty condition. If .el\{ works, nothing follows here: OpenBSD July 4, 2017 IE(1) mandoc-1.14.6/regress/roff/cond/if.in010064400017530001753000000045241313667013200176370ustar00schwarzeschwarze.\" $OpenBSD: if.in,v 1.8 2017/07/04 14:53:26 schwarze Exp $ .TH IF 1 "June 27, 2015" .SH NAME if \- the roff conditional instruction .SH DESCRIPTION .if n One-line true condition. .if t One-line false condition. .if n Next-line empty true condition. .if t Next-line empty false condition. .br False condition with whitespace: .br .if t True condition with whitespace: .if n .if n \{One-line true cond\}ition with block. .if t \{One-line false cond\}ition with block. .br .if n \{ One-line true cond\}ition with block with leading blanks. .if t \{ One-line false cond\}ition with block with leading blanks. .br .if n \{Two-line true condition without cont\}inuation and macros. .if t \{Two-line false condition without cont\}inuation and macros. .br .if n \{Two-line true condition .B without cont\}inuation but with macros. .if t \{Two-line false condition .B without cont\}inuation but with macros. .br .if n \{\ Two-line true condition with continuation and macros. .\}This will not be printed. .if t \{\ Two-line false condition with continuation and macros. .\}This will not be printed. .br .if n \{ Two-line true condition with blank line.\} .if t \{ Two-line false condition with blank line.\} .br .if n \{Outer true condition. .br .if n Inner one-line true condition. .if t Inner one-line false condition. .br .if n \{Inner two-line true condition without continuation and macros.\} .if t \{Inner two-line false condition without continuation and macros.\} .br Back to the outer true condition.\} .br .if t \{Outer false condition. .br .if n Inner one-line true condition. .if t Inner one-line false condition. .br .if n \{Inner two-line true condition without continuation and macros.\} .if t \{Inner two-line false condition without continuation and macros.\} .br Back to the outer false condition.\} .br .if n \{Outer true condition. .if t \{Inner false condition. inner\}middle\}end After conditional. .br .if n \{Outer true condition. .if t \{Inner false condition. .\}middle\}end After conditional. .br .if n \{Outer true condition. .if n \{Inner true condition. .\}middle\}end After conditional. .br .if n \{Outer true condition. .if t \{Inner false condition. .B\}middle\}end After conditional. .br Backslash-backslash-brace in text: .if t \{This text is not printed.\\} This neither.\} On a macro line: .if t \{.B This text\\} is not printed. .B This\} neither. End. mandoc-1.14.6/regress/roff/cond/if.out_ascii010064400017530001753000000024011412140003600211650ustar00schwarzeschwarzeIF(1) General Commands Manual IF(1) NNAAMMEE if - the roff conditional instruction DDEESSCCRRIIPPTTIIOONN One-line true condition. Next-line empty true condition. False condition with whitespace: True condition with whitespace: One-line true condition with block. One-line true condition with block with leading blanks. Two-line true condition without continuation and macros. Two-line true condition wwiitthhoouutt ccoonnttiinnuuaattiioonn bbuutt wwiitthh mmaaccrrooss.. Two-line true condition with continuation and macros. Two-line true condition with blank line. Outer true condition. Inner one-line true condition. Inner two-line true condition without continuation and macros. Back to the outer true condition. Outer true condition. After conditional. Outer true condition. After conditional. Outer true condition. Inner true condition. After conditional. Outer true condition. After conditional. Backslash-backslash-brace in text: On a macro line: End. OpenBSD June 27, 2015 IF(1) mandoc-1.14.6/regress/roff/cond/if.out_lint010064400017530001753000000004331341026767500210720ustar00schwarzeschwarzemandoc: if.in:15:2: WARNING: conditional request controls empty scope: if mandoc: if.in:17:2: WARNING: conditional request controls empty scope: if mandoc: if.in:42:2: WARNING: skipping paragraph macro: br before sp mandoc: if.in:71:2: WARNING: skipping paragraph macro: br after br mandoc-1.14.6/regress/roff/cond/numeric.in010064400017530001753000000030001313667013200206670ustar00schwarzeschwarze.\" $OpenBSD: numeric.in,v 1.5 2017/07/04 14:53:26 schwarze Exp $ .TH COND-NUMERIC 1 "December 16, 2014" .SH NAME cond-numeric \- roff conditions involving numbers .SH DESCRIPTION positive number: plain .ie 42 (t) .el (f) negated .ie !42 (t) .el (f) .PP negative number: plain .ie -42 (t) .el (f) negated .ie !-42 (t) .el (f) .PP second number missing: .ie 42=bad worse .el ok .PP operator "<": smaller .ie 1<2 (t) .el (f) equal .ie 1<1 (t) .el (f) greater .ie 2<1 (t) .el (f) .PP operator "<=": smaller .ie 1<=2 (t) .el (f) equal .ie 1<=1 (t) .el (f) greater .ie 2<=1 (t) .el (f) .PP operator "=": smaller .ie 1=2 (t) .el (f) equal .ie 1=1 (t) .el (f) greater .ie 2=1 (t) .el (f) .PP operator "==": smaller .ie 1==2 (t) .el (f) equal .ie 1==1 (t) .el (f) greater .ie 2==1 (t) .el (f) .PP operator ">=": smaller .ie 1>=2 (t) .el (f) equal .ie 1>=1 (t) .el (f) greater .ie 2>=1 (t) .el (f) .PP operator ">": smaller .ie 1>2 (t) .el (f) equal .ie 1>1 (t) .el (f) greater .ie 2>1 (t) .el (f) .PP with negative numbers: mm .ie -2<-1 (t) .el (f) mp .ie -2<1 (t) .el (f) pm .ie 1>-2 (t) .el (f) .PP operator "&": 00 .ie 0&0 (t) .el (f) 01 .ie 0&1 (t) .el (f) 10 .ie 1&0 (t) .el (f) 11 .ie 1&1 (t) .el (f) .PP operator ":": 00 .ie 0:0 (t) .el (f) 01 .ie 0:1 (t) .el (f) 10 .ie 1:0 (t) .el (f) 11 .ie 1:1 (t) .el (f) .PP with scaling units: 1i>2c .ie 1i>2c (t) .el (f) 1i-6P .ie 1i-6P (t) .el (f) .PP unmatched parenthesis: .ie ( (t) .el (f) one .ie (1 (t) .el (f) .PP negated unmatched parenthesis: .ie !( (t) .el (f) zero .ie !(0 (t) .el (f) mandoc-1.14.6/regress/roff/cond/numeric.out_ascii010064400017530001753000000020011412140003600222250ustar00schwarzeschwarzeCOND-NUMERIC(1) General Commands Manual COND-NUMERIC(1) NNAAMMEE cond-numeric - roff conditions involving numbers DDEESSCCRRIIPPTTIIOONN positive number: plain (t) negated (f) negative number: plain (f) negated (t) second number missing: ok operator "<": smaller (t) equal (f) greater (f) operator "<=": smaller (t) equal (t) greater (f) operator "=": smaller (f) equal (t) greater (f) operator "==": smaller (f) equal (t) greater (f) operator ">=": smaller (f) equal (t) greater (t) operator ">": smaller (f) equal (f) greater (t) with negative numbers: mm (t) mp (t) pm (t) operator "&": 00 (f) 01 (f) 10 (f) 11 (t) operator ":": 00 (f) 01 (t) 10 (t) 11 (t) with scaling units: 1i>2c (t) 1i-6P (f) unmatched parenthesis: (f) one (t) negated unmatched parenthesis: (f) zero (t) OpenBSD December 16, 2014 COND-NUMERIC(1) mandoc-1.14.6/regress/roff/cond/register.in010064400017530001753000000006611343772345400210750ustar00schwarzeschwarze.\" $OpenBSD: register.in,v 1.3 2019/02/06 20:54:28 schwarze Exp $ .TH REGISTER 1 "February 6, 2019" .SH NAME register \- conditional testing whether a register is defined .SH DESCRIPTION .ie rmyreg OOPS .el not yet defined .br .nr myreg 0 .ie rmyreg now defined .el OOPS .if !rmyreg OOPS .PP identifier + identifier: .ie rmyreg myreg is defined .el OOPS .PP escape sequence after identifier: .ie rmyreg\(enmyreg is defined .el OOPS mandoc-1.14.6/regress/roff/cond/register.out_ascii010064400017530001753000000006611412140003600224210ustar00schwarzeschwarzeREGISTER(1) General Commands Manual REGISTER(1) NNAAMMEE register - conditional testing whether a register is defined DDEESSCCRRIIPPTTIIOONN not yet defined now defined identifier + identifier: myreg is defined escape sequence after identifier: -myreg is defined OpenBSD February 6, 2019 REGISTER(1) mandoc-1.14.6/regress/roff/cond/strcmp.in010064400017530001753000000010311313667013200205370ustar00schwarzeschwarze.\" $OpenBSD: strcmp.in,v 1.2 2017/07/04 14:53:26 schwarze Exp $ .TH COND-STRCMP 1 "March 8, 2014" .SH NAME cond-strcmp \- roff conditions involving string comparison .SH DESCRIPTION empty: .ie """ (t) .el (f) one char: .ie xaxax (t) .el (f) three chars: .ie xabcxabcx (t) .el (f) .br mismatch: .ie xabcxabdx (t) .el (f) longer: .ie xabcxabcdx (t) .el (f) shorter: .ie xabcdxabcx (t) .el (f) .br no middle: .ie xabc (t) .el (f) no end: .ie xabcxabc .el (f) .SS Negation match: .ie !xabcxabcx (t) .el (f) mismatch: .ie !xaxbx (t) .el (f) mandoc-1.14.6/regress/roff/cond/strcmp.out_ascii010064400017530001753000000007171412140003600221070ustar00schwarzeschwarzeCOND-STRCMP(1) General Commands Manual COND-STRCMP(1) NNAAMMEE cond-strcmp - roff conditions involving string comparison DDEESSCCRRIIPPTTIIOONN empty: (t) one char: (t) three chars: (t) mismatch: (f) longer: (f) shorter: (f) no middle: (f) no end: (f) NNeeggaattiioonn match: (f) mismatch: (t) OpenBSD March 8, 2014 COND-STRCMP(1) mandoc-1.14.6/regress/roff/cond/string.in010064400017530001753000000013461343772345400205600ustar00schwarzeschwarze.\" $OpenBSD: string.in,v 1.4 2019/02/06 20:54:28 schwarze Exp $ .TH STRING 1 "February 6, 2019" .SH NAME string \- conditional testing whether a string is defined .SH DESCRIPTION .ie d mystr OOPS .el mystr not yet defined .br .ds mystr mystrval .ie d mystr now defined .el OOPS .if !d mystr OOPS .PP .ie d mymac OOPS .el mymac not yet defined .br .de mymac mymacval .. .ie dmymac now defined .el OOPS .if !d mymac OOPS .PP .ie d myren OOPS .el myren not yet defined .br .rn SM myren .ie d myren now defined .el OOPS .if !d myren OOPS .PP standard macro is .ie d PP defined .el not defined \(em OOPS .PP identifier and tab: .ie d mystr mystr is defined .el OOPS .PP escape sequence after identifier: .ie d mystr\(enmystr is defined .el OOPS mandoc-1.14.6/regress/roff/cond/string.out_ascii010064400017530001753000000010621412140003600220770ustar00schwarzeschwarzeSTRING(1) General Commands Manual STRING(1) NNAAMMEE string - conditional testing whether a string is defined DDEESSCCRRIIPPTTIIOONN mystr not yet defined now defined mymac not yet defined now defined myren not yet defined now defined standard macro is defined identifier and tab: mystr is defined escape sequence after identifier: -mystr is defined OpenBSD February 6, 2019 STRING(1) mandoc-1.14.6/regress/roff/cond/de.in010064400017530001753000000005351371176734200176400ustar00schwarzeschwarze.\" $OpenBSD: de.in,v 1.1 2020/08/03 10:52:39 schwarze Exp $ .TH COND-DE 1 "August 3, 2020" .SH NAME cond-de \- close macro definition and conditional block on the same line .SH DESCRIPTION .if n \{.de m1 first content .. \} .if n \{.de m2 second content .. \}ignored .if t \{.de m3 does not show up .. \}ignored initial text .m1 .m2 .m3 final text mandoc-1.14.6/regress/roff/cond/de.out_ascii010064400017530001753000000005331412140003600211630ustar00schwarzeschwarzeCOND-DE(1) General Commands Manual COND-DE(1) NNAAMMEE cond-de - close macro definition and conditional block on the same line DDEESSCCRRIIPPTTIIOONN initial text first content second content final text OpenBSD August 3, 2020 COND-DE(1) mandoc-1.14.6/regress/roff/cond/de.out_lint010064400017530001753000000001671371176734200210700ustar00schwarzeschwarzemandoc: de.in:11:4: ERROR: skipping all arguments: .. \&ignored mandoc: de.in:18:2: ERROR: skipping unknown macro: .m3 mandoc-1.14.6/regress/roff/de004075500017530001753000000000001412314056700162765ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/de/Dd.in010064400017530001753000000002411313667013200172250ustar00schwarzeschwarze.\" $OpenBSD$ .de At BSD .. .Dd $Mdocdate: July 4 2017 $ .Dt DE-DD 1 .Os .Sh NAME .Nm de-Dd .Nd interaction of the Dd macro with de requests .Sh DESCRIPTION .At mandoc-1.14.6/regress/roff/de/Dd.out_ascii010064400017530001753000000004431313667013200206020ustar00schwarzeschwarzeDE-DD(1) General Commands Manual DE-DD(1) NNAAMMEE ddee--DDdd - interaction of the Dd macro with de requests DDEESSCCRRIIPPTTIIOONN AT&T UNIX OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/de/Makefile010064400017530001753000000022731372346556500200330ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.14 2020/07/30 21:32:19 schwarze Exp $ REGRESS_TARGETS = append cond empty escname factorial REGRESS_TARGETS += indir infinite startde tab TH Dd LINT_TARGETS = escname indir infinite # groff-1.22.4 defect: # infinite recursion aborts output completely SKIP_GROFF = infinite .include # OpenBSD only: non-standard targets # --- additions to public targets --- all ascii: ascii-diff-opt ascii-clean: ascii-clean-opt groff: TH.out_ascii_opt Dd.out_ascii_opt groff-clean: groff-clean-opt # --- local rules --- ascii-diff-opt: TH.mandoc_ascii_opt Dd.mandoc_ascii_opt ${DIFF} ${.CURDIR}/TH.out_ascii_opt TH.mandoc_ascii_opt ${DIFF} ${.CURDIR}/Dd.out_ascii_opt Dd.mandoc_ascii_opt TH.mandoc_ascii_opt: TH.in ${MANDOC} -Ios=OpenBSD -Tascii -man ${.ALLSRC} > ${.TARGET} Dd.mandoc_ascii_opt: Dd.in ${MANDOC} -Ios=OpenBSD -Tascii -mdoc ${.ALLSRC} > ${.TARGET} ascii-clean-opt: rm -f TH.mandoc_ascii_opt Dd.mandoc_ascii_opt TH.out_ascii_opt: TH.in /usr/local/bin/nroff -c -man -Tascii ${.ALLSRC} > ${.TARGET} Dd.out_ascii_opt: Dd.in /usr/local/bin/nroff -c -mdoc -Tascii ${.ALLSRC} > ${.TARGET} groff-clean-opt: rm -f TH.out_ascii_opt Dd.out_ascii_opt mandoc-1.14.6/regress/roff/de/TH.in010064400017530001753000000003301313667013200172100ustar00schwarzeschwarze.\" $OpenBSD: TH.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .de BI .IB \\$1 \\$2 \\$3 .. .TH DE-TH 1 "June 3, 2012" .SH NAME de-TH - interaction of the TH macro with de requests .SH DESCRIPTION .BI bold italic bold mandoc-1.14.6/regress/roff/de/TH.out_ascii010064400017530001753000000004761412140003600205610ustar00schwarzeschwarzeDE-TH(1) General Commands Manual DE-TH(1) NNAAMMEE de-TH - interaction of the TH macro with de requests DDEESSCCRRIIPPTTIIOONN bboolldd_i_t_a_l_i_cbboolldd OpenBSD June 3, 2012 DE-TH(1) mandoc-1.14.6/regress/roff/de/append.in010064400017530001753000000006501313667013200201510ustar00schwarzeschwarze.\" $OpenBSD: append.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DE-APPEND 1 .Os .Sh NAME .Nm de-append .Nd append to macro definitions .Sh DESCRIPTION de: .de mym .Ox .. .mym am: .am mym .Nx .. .mym ami: .ds myim mym .ds myie mye .ami myim myie .Fx .mye .mym end .Pp standard macro: .Bo in brackets .Bc end .Pp append to standard macro: .am Bc .Pq appended words .. .Bo in brackets .Bc end mandoc-1.14.6/regress/roff/de/append.out_ascii010064400017530001753000000006761313667013200215320ustar00schwarzeschwarzeDE-APPEND(1) General Commands Manual DE-APPEND(1) NNAAMMEE ddee--aappppeenndd - append to macro definitions DDEESSCCRRIIPPTTIIOONN de: OpenBSD am: OpenBSD NetBSD ami: OpenBSD NetBSD FreeBSD end standard macro: [in brackets] end append to standard macro: [in brackets] end (appended words) OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/de/cond.in010064400017530001753000000004401313667013200176220ustar00schwarzeschwarze.\" $OpenBSD: cond.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DE-COND 1 .Os .Sh NAME .Nm de-cond .Nd conditional execution of a user-defined macro .Sh DESCRIPTION .de mym This is the text printed by the macro. .. preceding text .if n .mym following text mandoc-1.14.6/regress/roff/de/cond.out_ascii010064400017530001753000000005461313667013200212020ustar00schwarzeschwarzeDE-COND(1) General Commands Manual DE-COND(1) NNAAMMEE ddee--ccoonndd - conditional execution of a user-defined macro DDEESSCCRRIIPPTTIIOONN preceding text This is the text printed by the macro. following text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/de/escname.in010064400017530001753000000012701313667013200203140ustar00schwarzeschwarze.\" $OpenBSD: escname.in,v 1.4 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DE-ESCNAME 1 .Os .Sh NAME .Nm de-escname .Nd escape sequences in macro names .Sh DESCRIPTION initial text .Pp define second = val2 .de second val2 .. .Pp define first\esecond = val3 .de first\\second end3 val3 .end3 .Pp define first = val1 .de first\esecond val1 .. .Pp Values (first, second, first\esecond): .first .second .first\\second .Pp Remove all but second: .rm first\\second first\esecond second .first .second .first\\second .Pp macro seperated from argument by an escape sequence: .de witharg end4 excess arguments .Dq \\$1 .end4 tail argument .witharg\(enargument .Pp .de\e final text mandoc-1.14.6/regress/roff/de/escname.out_ascii010064400017530001753000000010621313667013200216640ustar00schwarzeschwarzeDE-ESCNAME(1) General Commands Manual DE-ESCNAME(1) NNAAMMEE ddee--eessccnnaammee - escape sequences in macro names DDEESSCCRRIIPPTTIIOONN initial text define second = val2 define first\second = val3 define first = val1 Values (first, second, first\second): val1 val2 val3 Remove all but second: val2 macro seperated from argument by an escape sequence: "argument" final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/de/escname.out_lint010064400017530001753000000011331313667013200215410ustar00schwarzeschwarzemandoc: escname.in:22:2: ERROR: escaped character not allowed in a name: first\e mandoc: escname.in:32:19: ERROR: escaped character not allowed in a name: first\e mandoc: escname.in:33:2: ERROR: skipping unknown macro: .first mandoc: escname.in:35:2: ERROR: skipping unknown macro: .first\\second mandoc: escname.in:38:5: ERROR: skipping excess arguments: .de ... excess arguments mandoc: escname.in:41:1: ERROR: escaped character not allowed in a name: witharg\( mandoc: escname.in:43:1: ERROR: escaped character not allowed in a name: de\e mandoc: escname.in:43:2: WARNING: skipping empty request: de mandoc-1.14.6/regress/roff/de/factorial.in010064400017530001753000000010451313667013200206450ustar00schwarzeschwarze.\" $OpenBSD: factorial.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FACTORIAL 1 .Os .Sh NAME .Nm factorial .Nd factorial sequence .Sh DESCRIPTION .\" recursively calculate a single factorial .de rfac . ie \\$1>1 \{\ . No \\$1 * . nr i \\$1-1 . rfac \\ni . nr acc \\n[acc]*\\$1 . \} . el .nr acc 1 .. .\" recursively print a sequence of factorials .de fac . No \\$1! = . rfac \\$1 . if \\$1>1 1 = . No \\n[acc] . if \\$1 \{\ . br . nr i \\$1-1 . fac \\ni . \} .. .\" main program .fac 9 mandoc-1.14.6/regress/roff/de/factorial.out_ascii010064400017530001753000000010771313667013200222230ustar00schwarzeschwarzeFACTORIAL(1) General Commands Manual FACTORIAL(1) NNAAMMEE ffaaccttoorriiaall - factorial sequence DDEESSCCRRIIPPTTIIOONN 9! = 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 362880 8! = 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 40320 7! = 7 * 6 * 5 * 4 * 3 * 2 * 1 = 5040 6! = 6 * 5 * 4 * 3 * 2 * 1 = 720 5! = 5 * 4 * 3 * 2 * 1 = 120 4! = 4 * 3 * 2 * 1 = 24 3! = 3 * 2 * 1 = 6 2! = 2 * 1 = 2 1! = 1 0! = 1 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/de/indir.in010064400017530001753000000006641313667013200200140ustar00schwarzeschwarze.\" $OpenBSD: indir.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DE-INDIR 1 .Os .Sh NAME .Nm de-indir .Nd indirect macro definitions .Sh DESCRIPTION full dei: .ds myim mym .ds myie mye .dei myim myie text1 .mye .mym .br dei with undefined second argument: .rm myie mym .dei myim myie text2 .. .mym .br dei with undefined first argument: .rm myim mym .dei myim text3 .br dei without arguments: .dei text4 mandoc-1.14.6/regress/roff/de/indir.out_ascii010064400017530001753000000006371313667013200213650ustar00schwarzeschwarzeDE-INDIR(1) General Commands Manual DE-INDIR(1) NNAAMMEE ddee--iinnddiirr - indirect macro definitions DDEESSCCRRIIPPTTIIOONN full dei: text1 dei with undefined second argument: text2 dei with undefined first argument: text3 dei without arguments: text4 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/de/indir.out_lint010064400017530001753000000003731313667013200212400ustar00schwarzeschwarzemandoc: indir.in:19:11: WARNING: undefined string, using "": myie mandoc: indir.in:26:6: WARNING: undefined string, using "": myim mandoc: indir.in:26:2: WARNING: skipping empty request: dei mandoc: indir.in:30:2: WARNING: skipping empty request: dei mandoc-1.14.6/regress/roff/de/infinite.in010064400017530001753000000005231341026767500205170ustar00schwarzeschwarze.\" $OpenBSD: infinite.in,v 1.4 2018/08/23 14:16:12 schwarze Exp $ .Dd $Mdocdate: August 23 2018 $ .Dt DE-INFINITE 1 .Os .Sh NAME .Nm de-infinite .Nd inifinte recursion in a user-defined macro .Sh DESCRIPTION initial text .de mym .Op \\$1 \\$2 .. .mym $1 \$1 end .mym \$1 middle end middle text .de mym .mym not printed .. .mym final text mandoc-1.14.6/regress/roff/de/infinite.out_ascii010064400017530001753000000005431341026767500220720ustar00schwarzeschwarzeDE-INFINITE(1) General Commands Manual DE-INFINITE(1) NNAAMMEE ddee--iinnffiinniittee - inifinte recursion in a user-defined macro DDEESSCCRRIIPPTTIIOONN initial text [$1 end] [middle end] middle text final text OpenBSD August 23, 2018 OpenBSD mandoc-1.14.6/regress/roff/de/infinite.out_lint010064400017530001753000000003361341026767500217500ustar00schwarzeschwarzemandoc: infinite.in:13:9: ERROR: using macro argument outside macro: \$1 mandoc: infinite.in:14:6: ERROR: using macro argument outside macro: \$1 mandoc: infinite.in:20:5: ERROR: input stack limit exceeded, infinite loop? mandoc-1.14.6/regress/roff/de/tab.in010064400017530001753000000012561342664662200174640ustar00schwarzeschwarze.\" $OpenBSD: tab.in,v 1.1 2019/02/06 20:54:28 schwarze Exp $ .Dd $Mdocdate: February 6 2019 $ .Dt DE-TAB 1 .Os .Sh NAME .Nm de-tab .Nd tab characters in macro definition lines .Sh DESCRIPTION .de test1 ignored testval \\$1;\\$2 .. no argument: .test1 .br argument after_tab: .test1 after_tab .br argument after_tab_and_space: .test1 after_tab_and_space .br argument after_two_tabs: .test1 after_two_tabs .br argument after_tab_tab_space: .test1 after_tab_tab_space .Ss End marker .de test2 endm ignored testval \\$1;\\$2 .endm no argument: .test2 .br argument after_tab: .test2 after_tab .Ss Removal .rm test1 test2 macro test1 is gone: .test1 .br macro test2 still exists: .test2 mandoc-1.14.6/regress/roff/de/startde.in010064400017530001753000000010711313667013200203460ustar00schwarzeschwarze.\" $OpenBSD: startde.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DE-STARTDE 1 .Os .Sh NAME .Nm de-startde .Nd macro starting a macro definition, but not ending it .Sh DESCRIPTION define outer macro: .de outer outer macro called; define inner macro: .de inner inner macro called; end outer scope. .. outer scope ended; outer macro now defined. .Pp call outer macro: .outer returned from call of outer macro; end inner scope. .. inner scope ended; inner macro now defined. .Pp call inner macro: .inner returned from call of inner macro. mandoc-1.14.6/regress/roff/de/startde.out_ascii010064400017530001753000000011741313667013200217230ustar00schwarzeschwarzeDE-STARTDE(1) General Commands Manual DE-STARTDE(1) NNAAMMEE ddee--ssttaarrttddee - macro starting a macro definition, but not ending it DDEESSCCRRIIPPTTIIOONN define outer macro: outer scope ended; outer macro now defined. call outer macro: outer macro called; define inner macro: inner scope ended; inner macro now defined. call inner macro: inner macro called; end outer scope. returned from call of outer macro; end inner scope. returned from call of inner macro. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/de/tab.out_ascii010064400017530001753000000013331342664662200210310ustar00schwarzeschwarzeDE-TAB(1) General Commands Manual DE-TAB(1) NNAAMMEE ddee--ttaabb - tab characters in macro definition lines DDEESSCCRRIIPPTTIIOONN no argument: testval ; argument after_tab: testval after_tab; argument after_tab_and_space: testval after_tab_and_space; argument after_two_tabs: testval after_two_tabs; argument after_tab_tab_space: testval ;after_tab_tab_space EEnndd mmaarrkkeerr no argument: testval ; argument after_tab: testval after_tab; RReemmoovvaall macro test1 is gone: macro test2 still exists: testval ; OpenBSD February 6, 2019 OpenBSD mandoc-1.14.6/regress/roff/de/empty.in010064400017530001753000000004401345720077200200420ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.1 2019/04/21 23:45:50 schwarze Exp $ .Dd $Mdocdate: April 21 2019 $ .Dt DE-EMPTY 1 .Os .Sh NAME .Nm de-empty .Nd empty user-defined macro with arguments .Sh DESCRIPTION initial text .de empty .. .de real arg=\\$1 .empty wrong arg=\\$1 .. .real right final text mandoc-1.14.6/regress/roff/de/empty.out_ascii010064400017530001753000000005111345720077200214120ustar00schwarzeschwarzeDE-EMPTY(1) General Commands Manual DE-EMPTY(1) NNAAMMEE ddee--eemmppttyy - empty user-defined macro with arguments DDEESSCCRRIIPPTTIIOONN initial text arg=right arg=right final text OpenBSD April 21, 2019 OpenBSD mandoc-1.14.6/regress/roff/ds004075500017530001753000000000001412314056700163145ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/ds/Makefile010064400017530001753000000002161343772345400200400ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2019/02/06 20:54:28 schwarze Exp $ REGRESS_TARGETS = append escname nested quoting tab .include mandoc-1.14.6/regress/roff/ds/append.in010064400017530001753000000005451313667013200201720ustar00schwarzeschwarze.\" $OpenBSD: append.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DS-APPEND 1 .Os .Sh NAME .Nm ds-append .Nd appending to user-defined strings .Sh DESCRIPTION .ds foo first part first part: \*[foo] .br .as foo " second part with second part: \*[foo] .br .as foo " third part with third part: \*[foo] .br end of test document mandoc-1.14.6/regress/roff/ds/append.out_ascii010064400017530001753000000006611313667013200215420ustar00schwarzeschwarzeDS-APPEND(1) General Commands Manual DS-APPEND(1) NNAAMMEE ddss--aappppeenndd - appending to user-defined strings DDEESSCCRRIIPPTTIIOONN first part: first part with second part: first part second part with third part: first part second part third part end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ds/escname.in010064400017530001753000000004631313667013200203350ustar00schwarzeschwarze.\" $OpenBSD: escname.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DS-ESCNAME 1 .Os .Sh NAME .Nm ds-escname .Nd escape sequences in string names .Sh DESCRIPTION .ds std\\esc stdval Now \e*[std\\esc] is .Sq \*[std\\esc] . .Pp .ds esc\eesc escval Now \e*[esc] is .Sq \*[esc] . mandoc-1.14.6/regress/roff/ds/escname.out_ascii010064400017530001753000000005221313667013200217020ustar00schwarzeschwarzeDS-ESCNAME(1) General Commands Manual DS-ESCNAME(1) NNAAMMEE ddss--eessccnnaammee - escape sequences in string names DDEESSCCRRIIPPTTIIOONN Now \*[std\esc] is `stdval'. Now \*[esc] is `'. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ds/nested.in010064400017530001753000000004451313667013200202040ustar00schwarzeschwarze.\" $OpenBSD: nested.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DS-NESTED 1 .Os .Sh NAME .Nm ds-nested .Nd nested string expansion .Sh DESCRIPTION .ds foo bar .ds bar output This is the \*[\*[foo]]. .Pp .ds pi surprising This is \*[\*[Pi]]. This is \*(\*(Pi. mandoc-1.14.6/regress/roff/ds/nested.out_ascii010064400017530001753000000005231313667013200215520ustar00schwarzeschwarzeDS-NESTED(1) General Commands Manual DS-NESTED(1) NNAAMMEE ddss--nneesstteedd - nested string expansion DDEESSCCRRIIPPTTIIOONN This is the output. This is surprising. This is surprising. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ds/quoting.in010064400017530001753000000012461313667013200204100ustar00schwarzeschwarze.\" $OpenBSD: quoting.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt DS-QUOTING 1 .Os .Sh NAME .Nm ds-quoting .Nd quote handling by the define string request .Sh DESCRIPTION .ds foo initial definition no quoting: \*[foo] .br .ds foo redefinition still no quoting: \*[foo] .br .ds foo "string value leading quotes: \*[foo] .br .ds foo "string value" leading and trailing quotes: \*[foo] .br .ds foo "string" value leading and middle quotes: \*[foo] .br .ds foo 'string value" leading apostrophe, trailing quotes: \*[foo] .br .ds foo string value" leading blank, trailing quotes: \*[foo] .br .ds foo empty string: x\*[foo]x .br end of test document mandoc-1.14.6/regress/roff/ds/quoting.out_ascii010064400017530001753000000012061313667013200217550ustar00schwarzeschwarzeDS-QUOTING(1) General Commands Manual DS-QUOTING(1) NNAAMMEE ddss--qquuoottiinngg - quote handling by the define string request DDEESSCCRRIIPPTTIIOONN no quoting: initial definition still no quoting: redefinition leading quotes: string value leading and trailing quotes: string value" leading and middle quotes: string" value leading apostrophe, trailing quotes: 'string value" leading blank, trailing quotes: string value" empty string: xx end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ds/tab.in010064400017530001753000000003441342664662300175000ustar00schwarzeschwarze.\" $OpenBSD: tab.in,v 1.1 2019/02/06 20:54:28 schwarze Exp $ .Dd $Mdocdate: February 6 2019 $ .Dt DS-TAB 1 .Os .Sh NAME .Nm ds-tab .Nd tab characters in string definition lines .Sh DESCRIPTION .ds teststr myval >>\*[teststr]<< mandoc-1.14.6/regress/roff/ds/tab.out_ascii010064400017530001753000000004461342664662300210540ustar00schwarzeschwarzeDS-TAB(1) General Commands Manual DS-TAB(1) NNAAMMEE ddss--ttaabb - tab characters in string definition lines DDEESSCCRRIIPPTTIIOONN >> myval<< OpenBSD February 6, 2019 OpenBSD mandoc-1.14.6/regress/roff/esc004075500017530001753000000000001412314056700164605ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/esc/B.in010064400017530001753000000012441313667013200172450ustar00schwarzeschwarze.\" $OpenBSD: B.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-B 1 .Os .Sh NAME .Nm esc-B .Nd the roff escape B sequence: validate numerical expression .Sh DESCRIPTION empty: \B'' .br digit: \B'0' .br no number: \B'no number' .br trailing garbage: \B'1X' .br trailing operator: \B'1+' .br infix operator: \B'1+1' .br infix and trailing operator: \B'1+1+' .br chain of operations: \B'1+2+3+4' .br trailing para: \B'1+(' .br unclosed para: \B'(1' .br empty pair of parentheses: \B'()' .br parentheses containing number: \B'(42)' .br complex expression: \B'3+(3*(5==5*2)*4)+(3*5)/2' .br other delimiter: \Bx1+1x .br no closing delimiter: \B'1+1 mandoc-1.14.6/regress/roff/esc/B.out_ascii010064400017530001753000000012351313667013200206160ustar00schwarzeschwarzeESC-B(1) General Commands Manual ESC-B(1) NNAAMMEE eesscc--BB - the roff escape B sequence: validate numerical expression DDEESSCCRRIIPPTTIIOONN empty: 0 digit: 1 no number: 0 trailing garbage: 0 trailing operator: 0 infix operator: 1 infix and trailing operator: 0 chain of operations: 1 trailing para: 0 unclosed para: 0 empty pair of parentheses: 0 parentheses containing number: 1 complex expression: 1 other delimiter: 1 no closing delimiter: 0 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/B.out_lint010064400017530001753000000000751313667013200204750ustar00schwarzeschwarzemandoc: B.in:37:23: WARNING: invalid escape sequence: \B'1+1 mandoc-1.14.6/regress/roff/esc/Makefile010064400017530001753000000004241412140003600201600ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.17 2020/12/21 14:55:58 schwarze Exp $ REGRESS_TARGETS = one two multi B bs_man bs_mdoc c c_man e f h l O1 o p w z REGRESS_TARGETS += ignore invalid unsupp HTML_TARGETS = f LINT_TARGETS = B h l O1 w ignore invalid unsupp .include mandoc-1.14.6/regress/roff/esc/c.in010064400017530001753000000005201313667013200173020ustar00schwarzeschwarze.\" $OpenBSD: c.in,v 1.4 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-C 1 .Os .Sh NAME .Nm esc-c .Nd the roff escape c sequence: remove trailing space .Sh DESCRIPTION No space between .Dq one and .Dq word : one\c word .Bd -literal one\c word .Ed Blank line after \ec: one\c word .Bd -literal one\c word .Ed mandoc-1.14.6/regress/roff/esc/c.out_ascii010064400017530001753000000006161313667013200206610ustar00schwarzeschwarzeESC-C(1) General Commands Manual ESC-C(1) NNAAMMEE eesscc--cc - the roff escape c sequence: remove trailing space DDEESSCCRRIIPPTTIIOONN No space between "one" and "word": oneword oneword Blank line after \c: one word one word OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/c_man.in010064400017530001753000000007071341026767500201550ustar00schwarzeschwarze.\" $OpenBSD: c_man.in,v 1.4 2018/08/25 12:28:52 schwarze Exp $ .TH ESC-C_MAN 1 "August 25, 2018" .SH NAME esc-c_man \- the roff escape c sequence: remove trailing space .SH DESCRIPTION No space between "one" and "word": one\c word .PP The same in no-fill mode: .nf one\c word .fi .PP Blank line after \ec: one\c word .nf one\c word .fi .PP In next-line element scope: .B one\c word .PP In next-line block scope: .TP one\c word list body .PP final text mandoc-1.14.6/regress/roff/esc/c_man.out_ascii010064400017530001753000000011141412140003600214730ustar00schwarzeschwarzeESC-C_MAN(1) General Commands Manual ESC-C_MAN(1) NNAAMMEE esc-c_man - the roff escape c sequence: remove trailing space DDEESSCCRRIIPPTTIIOONN No space between "one" and "word": oneword The same in no-fill mode: oneword Blank line after \c: one word one word In next-line element scope: oonneewwoorrdd In next-line block scope: oneword list body final text OpenBSD August 25, 2018 ESC-C_MAN(1) mandoc-1.14.6/regress/roff/esc/e.in010064400017530001753000000004711313667013200173110ustar00schwarzeschwarze.\" $OpenBSD: e.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-E 1 .Os .Sh NAME .Nm esc-e .Nd escaping backslashes .Sh DESCRIPTION In plain text: "\e" and "\\" .Pp On macro lines: .Qq \e(at and .Qq \\(at .Pp In a macro definition: .de mytest "\e$1" and "\\$2" .. .mytest one two mandoc-1.14.6/regress/roff/esc/e.out_ascii010064400017530001753000000005561313667013200206660ustar00schwarzeschwarzeESC-E(1) General Commands Manual ESC-E(1) NNAAMMEE eesscc--ee - escaping backslashes DDEESSCCRRIIPPTTIIOONN In plain text: "\" and "\" On macro lines: "\(at" and "@" In a macro definition: "\$1" and "two" OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/f.in010064400017530001753000000006571341026767500173310ustar00schwarzeschwarze.\" $OpenBSD: f.in,v 1.4 2018/12/15 23:33:20 schwarze Exp $ .TH ESC-F 1 "December 15, 2018" .SH NAME esc-f \- the roff escape f sequence: font changes .SH DESCRIPTION .nf BEGINTEST numbers: \f4bolditalic\f3bold\f2italic\f1roman letters: \fBbold\fIitalic\fPback\f(BIbolditalic\fRroman multiletter: \f[B]bold\f[]empty\f[I]italic\f[P]back\f[BI]bolditalic\f[R]roman typewriter: \f(CWroman\f(CBbold\f(CRroman\f(CIitalic\fRroman ENDTEST mandoc-1.14.6/regress/roff/esc/f.out_ascii010064400017530001753000000012641412140003600206510ustar00schwarzeschwarzeESC-F(1) General Commands Manual ESC-F(1) NNAAMMEE esc-f - the roff escape f sequence: font changes DDEESSCCRRIIPPTTIIOONN BEGINTEST numbers: _bb_oo_ll_dd_ii_tt_aa_ll_ii_ccbboolldd_i_t_a_l_i_croman letters: bboolldd_i_t_a_l_i_cbbaacckk_bb_oo_ll_dd_ii_tt_aa_ll_ii_ccroman multiletter: bboollddempty_i_t_a_l_i_cback_bb_oo_ll_dd_ii_tt_aa_ll_ii_ccroman typewriter: romanbboollddroman_i_t_a_l_i_croman ENDTEST OpenBSD December 15, 2018 ESC-F(1) mandoc-1.14.6/regress/roff/esc/h.in010064400017530001753000000006751313667013200173220ustar00schwarzeschwarze.\" $OpenBSD: h.in,v 1.6 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-H 1 .Os .Sh NAME .Nm esc-h .Nd the roff escape h sequence: horizontal movement .Sh DESCRIPTION simple: >\h'0'< .br rounding: >\h'0.16i'< .br absolute: >\h'|12n'< .br escape only: >\h'\w'\&'M'< .br escape at the end: >\h'0+\w'\&''< .br escape at the beginning: >\h'\w'\&'M+0'< .br escape in the middle: >\h'0+\w'\&'+0'< .br invalid delimiter: >\h-< mandoc-1.14.6/regress/roff/esc/h.out_ascii010064400017530001753000000007301313667013200206630ustar00schwarzeschwarzeESC-H(1) General Commands Manual ESC-H(1) NNAAMMEE eesscc--hh - the roff escape h sequence: horizontal movement DDEESSCCRRIIPPTTIIOONN simple: >< rounding: > < absolute: > < escape only: >< escape at the end: >< escape at the beginning: >< escape in the middle: >< invalid delimiter: >< OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/h.out_lint010064400017530001753000000000721313667013200205400ustar00schwarzeschwarzemandoc: h.in:23:21: WARNING: invalid escape sequence: \h- mandoc-1.14.6/regress/roff/esc/ignore.in010064400017530001753000000006451341026767500203640ustar00schwarzeschwarze.\" $OpenBSD: ignore.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH ESC-IGNORE 1 "December 15, 2018" .SH NAME esc-ignore \- ignored roff escape sequences .SH DESCRIPTION .nf closing parenthesis: a\)b\[)]c comma: a\,b\[,]c slash: a\/b\[/]c multiform: a\kxb\k(xyc\k[xyz]d quoted: a\R'myreg 0'b\R'myreg \A'y'0'c sizes: a\s0b\s(12c\s[123]d\s'123'e\s'1\w'xy'2'f signed sizes: a\s-0b\s-(12c\s-[123]d\s-'123'e\s-'1\w'xy'2'f\s- mandoc-1.14.6/regress/roff/esc/ignore.out_ascii010064400017530001753000000006411412140003600217050ustar00schwarzeschwarzeESC-IGNORE(1) General Commands Manual ESC-IGNORE(1) NNAAMMEE esc-ignore - ignored roff escape sequences DDEESSCCRRIIPPTTIIOONN closing parenthesis: abc comma: abc slash: abc multiform: abcd quoted: abc sizes: abcdef signed sizes: abcdef OpenBSD December 15, 2018 ESC-IGNORE(1) mandoc-1.14.6/regress/roff/esc/ignore.out_lint010064400017530001753000000003741341026767500216120ustar00schwarzeschwarzemandoc: ignore.in:7:26: WARNING: invalid escape sequence: \[)] mandoc: ignore.in:8:12: WARNING: invalid escape sequence: \[,] mandoc: ignore.in:9:12: WARNING: invalid escape sequence: \[/] mandoc: ignore.in:13:60: WARNING: invalid escape sequence: \s- mandoc-1.14.6/regress/roff/esc/multi.in010064400017530001753000000004511313667013200202150ustar00schwarzeschwarze.\" $OpenBSD: multi.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-MULTI 1 .Os .Sh NAME .Nm esc-multi .Nd roff multi-character escape sequences .Sh DESCRIPTION \[tno] \[t+-] \[tmu] \[tdi] \[12] \[14] \[34] .br \C'tno' \C't+-' \C'tmu' \C'tdi' \C'12' \C'14' \C'34' mandoc-1.14.6/regress/roff/esc/multi.out_ascii010064400017530001753000000005151333010372100215560ustar00schwarzeschwarzeESC-MULTI(1) General Commands Manual ESC-MULTI(1) NNAAMMEE eesscc--mmuullttii - roff multi-character escape sequences DDEESSCCRRIIPPTTIIOONN ~ +- x / 1/2 1/4 3/4 ~ +- x / 1/2 1/4 3/4 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/o.in010064400017530001753000000005301313667013200173170ustar00schwarzeschwarze.\" $OpenBSD: o.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-O 1 .Os .Sh NAME .Nm esc-o .Nd the roff escape o sequence: overstrike .Sh DESCRIPTION empty: x\o''x .br one character: x\o'|'x .br wide/narrow: x\o'O|'x .br narrow/wide: x\o'|O'x .br wide/narrow/narrow: x\o'O-|'x .br narrow/narrow/wide: x\o'|-O'x mandoc-1.14.6/regress/roff/esc/o.out_ascii010064400017530001753000000006471313667013200207010ustar00schwarzeschwarzeESC-O(1) General Commands Manual ESC-O(1) NNAAMMEE eesscc--oo - the roff escape o sequence: overstrike DDEESSCCRRIIPPTTIIOONN empty: xx one character: x|x wide/narrow: xO|x narrow/wide: x|Ox wide/narrow/narrow: xO-|x narrow/narrow/wide: x|-Ox OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/one.in010064400017530001753000000003741341026767500176610ustar00schwarzeschwarze.\" $OpenBSD: one.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH ESC-ONE 1 "December 15, 2018" .SH NAME esc-one \- roff one-character escape sequences .SH DESCRIPTION .nf backslash: >\e< minus: >\-|\[-]< acute: >\'< grave: >\`< normal character: >\q< mandoc-1.14.6/regress/roff/esc/one.out_ascii010064400017530001753000000005601412140003600212030ustar00schwarzeschwarzeESC-ONE(1) General Commands Manual ESC-ONE(1) NNAAMMEE esc-one - roff one-character escape sequences DDEESSCCRRIIPPTTIIOONN backslash: >\< minus: >-|-< acute: >'< grave: >`< normal character: >q< OpenBSD December 15, 2018 ESC-ONE(1) mandoc-1.14.6/regress/roff/esc/two.in010064400017530001753000000047501313667013200177020ustar00schwarzeschwarze.\" $OpenBSD: two.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-TWO 1 .Os .Sh NAME .Nm esc-two .Nd roff two-character escape sequences .Sh DESCRIPTION lines: \(ba \(br \(ul \(bb \(sl \(rs .\" groff doesn't know \(rl .br markers: \(bu \(lz \(sq \(lh \(rh \(at \(sh \(CR .\" the circle \(ci differs .\" the daggers \(dd and \(dg use backspace .\" \(ps and \(sc intentionally differ .\" groff doesn't know \(OK .br legal: \(co \(rg \(tm .br punctuation: \(em \(en \(hy .\" the inverted punctuation is intentionally different .br quotes: \(Bq \(bq \(oq \(cq \(aq \(dq \(Fo \(Fc \(fo \(fc .\" the double quotes \(lq and \(rq differ .br brackets: \(lB \(rB \(lC \(rC \(la \(ra \(bv \(lt \(lk \(rt \(rk \(rb .\" the left bottom \(lb differs .br arrows: \(<- \(-> \(lA \(rA \(hA .\" the left-right arrow \(<> differs .\" groff doesn't know \(va and \(vA .\" the vertical arrows \(da, \(ua, \(uA, \(dA use backspace .br logical: \(AN \(OR \(no \(te \(st \(tf \(3d \(or .\" the universal quantifier \(fa uses backspace .br mathematical: \(pl \(mi \(-+ \(+- \(pc \(mu \(di \(f/ \(** \(<= \(>= \(<< \(>> \(eq \(!= \(== \(ne \(=~ \(ap \(~~ \(~= \(pt \(es \(mo \(sb \(sp \(ca \(cu \(sr \(lc \(rc \(lf \(rf \(if \(Ah \(Im \(Re \(pd .\" groff doesn't know \(-~, \(nb, \(nc, \(-h .\" these differ: \(nm \(ib \(ip \(/_ \(pp \(gr .\" these use backspace: \(c* \(c+ \(is .br ligatures: \(ff \(fi \(fl \(Fi \(Fl \(AE \(ae \(OE \(oe \(IJ \(ij .\" the German eszett \(ss differs .br accents: \(a" \(a^ \(aa \(ga \(ab \(ac \(ad \(ah \(ao \(a~ \(ho \(ha \(ti .\" the macron \(a- differs .\" groff doesn't know \(a. .br accented and special letters: \('A \('E \('I \('O \('U \('a \('e \('i \('o \('u \(`A \(`E \(`I \(`O \(`U \(`a \(`e \(`i \(`o \(`u \(~A \(~N \(~O \(~a \(~n \(~o \(:A \(:E \(:I \(:O \(:U \(:a \(:e \(:i \(:o \(:u \(:y \(^A \(^E \(^I \(^O \(^U \(^a \(^e \(^i \(^o \(^u \(,C \(,c \(/L \(/l \(/O \(/o \(oA \(oa \(-D \(.i .\" these intentionally differ: \(Sd \(TP \(Tp .\" groff doesn't know \(.j .br currency: \(Do \(ct \(Eu \(eu \(Ye \(Fo .\" uses backspace: \(Cs .\" the GB pound \(Po is intentionally different .br units: \(fm \(mc .\" groff doesn't know \(%O .\" \(sd differs .\" \(de is intentionally different .br greek letters: \(*A \(*B \*D \(*E \(*Z \(*Y \*H \(*I \(*K \(*L \(*M \(*N \*C \(*O \(*P \(*R \(*T \(*U \*F \(*X \(*Q \(*W \(*a \(*b \(*g \(*d \(*e \(*z \(*y \(*h \(*i \(*k \(*l \(*m \(*n \(*c \(*o \(*p \(*r \(*s \(*t \(*u \(*f \(*x \(*q \(*w \(+h \(+f \+p \(+e \(ts .\" these differ: \(*G \(*S mandoc-1.14.6/regress/roff/esc/two.out_ascii010064400017530001753000000027441333010372100212430ustar00schwarzeschwarzeESC-TWO(1) General Commands Manual ESC-TWO(1) NNAAMMEE eesscc--ttwwoo - roff two-character escape sequences DDEESSCCRRIIPPTTIIOONN lines: | | _ | / \ markers: +o <> [] <= => @ # legal: (C) (R) tm punctuation: -- - - quotes: ,, , ` ' ' " << >> < > brackets: [ ] { } < > | ,- { -. } -' arrows: <- -> <= => <=> logical: ^ v ~ | mathematical: + - -+ +- . x / / * <= >= << >> = != == !== =~ ~ ~~ ~= {} |~ ~| |_ _| ligatures: ff fi fl ffi ffl AE ae OE oe IJ ij accents: " ^ ' ` '` , " v o ~ , ^ ~ accented and special letters: 'A 'E 'I 'O 'U 'a 'e 'i 'o 'u `A `E `I `O `U `a `e `i `o `u ~A ~N ~O ~a ~n ~o "A "E "I "O "U "a "e "i "o "u "y ^A ^E ^I ^O ^U ^a ^e ^i ^o ^u ,C ,c /L /l /O /o oA oa Dh i currency: $ /c EUR EUR =Y << units: ' greek letters: A B E Z H I K M N O P T Y X o +p OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/w.in010064400017530001753000000004251313667013200173320ustar00schwarzeschwarze.\" $OpenBSD: w.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-W 1 .Os .Sh NAME .Nm esc-w .Nd the roff escape w sequence: text width .Sh DESCRIPTION empty: \w'' .br character: \w'n' .br blank: \w' ' .br text: \w'text' .br unterminated: \w'foo mandoc-1.14.6/regress/roff/esc/w.out_ascii010064400017530001753000000005421313667013200207030ustar00schwarzeschwarzeESC-W(1) General Commands Manual ESC-W(1) NNAAMMEE eesscc--ww - the roff escape w sequence: text width DDEESSCCRRIIPPTTIIOONN empty: 0 character: 24 blank: 24 text: 96 unterminated: 72 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/w.out_lint010064400017530001753000000000751313667013200205620ustar00schwarzeschwarzemandoc: w.in:17:15: WARNING: invalid escape sequence: \w'foo mandoc-1.14.6/regress/roff/esc/z.in010064400017530001753000000010151313667013200173310ustar00schwarzeschwarze.\" $OpenBSD: z.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-Z 1 .Os .Sh NAME .Nm esc-z .Nd the roff escape z sequence .Sh DESCRIPTION single z with ASCII char: >\zx< .br single z with escape char: >\z\(ci< .br .ds mystr mytext single z with defined string (\*[mystr]): >\z\*[mystr]< .br single z with font escape: >\z\fBxbold\fP< .br single z with nospace escape: >\z\c new line< .br single z with overstrike: >\z\o'ab'c< .br single z near the end of the line: >\z< .br double z: >\z\zx< mandoc-1.14.6/regress/roff/esc/z.out_ascii010064400017530001753000000011111313667013200206770ustar00schwarzeschwarzeESC-Z(1) General Commands Manual ESC-Z(1) NNAAMMEE eesscc--zz - the roff escape z sequence DDEESSCCRRIIPPTTIIOONN single z with ASCII char: >x< single z with escape char: >O< single z with defined string (mytext): >mytext< single z with font escape: >xxbboolldd< single z with nospace escape: > new line< single z with overstrike: >abc< single z near the end of the line: >< double z: >x< OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/l.in010064400017530001753000000010301312673165200173140ustar00schwarzeschwarze.\" $OpenBSD: l.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-L 1 .Os .Sh NAME .Nm esc-l .Nd the roff escape l sequence: horizontal line .Sh DESCRIPTION explicit scaling unit and fill char: >\l'2nf'< .br explicit scaling unit and default char: >\l'3n'< .br default unit and explicit fill char: >\l'4x'< .br default unit and char: >\l'5'< .br explicit scaling unit and escape sequence: >\l'6n\(+-'< .br default unit and escape char: >\l'7n\(at'< .br rounding: >\l'0.26ix'< .br invalid delimiter: >\h-< mandoc-1.14.6/regress/roff/esc/l.out_ascii010064400017530001753000000011401312673165200206670ustar00schwarzeschwarzeESC-L(1) General Commands Manual ESC-L(1) NNAAMMEE eesscc--ll - the roff escape l sequence: horizontal line DDEESSCCRRIIPPTTIIOONN explicit scaling unit and fill char: >ff< explicit scaling unit and default char: >___< default unit and explicit fill char: >xxxx< default unit and char: >_____< explicit scaling unit and escape sequence: >+-+-+-< default unit and escape char: >@@@@@@@< rounding: >xxx< invalid delimiter: >< OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/l.out_lint010064400017530001753000000000721312673165200205500ustar00schwarzeschwarzemandoc: l.in:23:21: WARNING: invalid escape sequence: \h- mandoc-1.14.6/regress/roff/esc/p.in010064400017530001753000000004731312673165200173320ustar00schwarzeschwarze.\" $OpenBSD: p.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt ESC-P 1 .Os .Sh NAME .Nm esc-p .Nd line break escape sequence .Sh DESCRIPTION no blank: line one\pline two .Pp blank after esc: line one\p line two .Pp blank before esc: line one \pline two .Pp at eol: line one\p line two mandoc-1.14.6/regress/roff/esc/p.out_ascii010064400017530001753000000006511312673165200207010ustar00schwarzeschwarzeESC-P(1) General Commands Manual ESC-P(1) NNAAMMEE eesscc--pp - line break escape sequence DDEESSCCRRIIPPTTIIOONN no blank: line oneline two blank after esc: line one line two blank before esc: line one line two at eol: line one line two OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/esc/O1.in010064400017530001753000000004221377013560500173450ustar00schwarzeschwarze.\" $OpenBSD: O1.in,v 1.1 2020/12/21 14:55:58 schwarze Exp $ .TH ESC-O1 1 "December 15, 2018" .SH NAME esc-O1 \- escape sequence to suppress output .SH DESCRIPTION .nf O1: a\O1b O2: a\O2b O3: a\O3b O4: a\O4b O5: a\O5b O52: a\O(52b O5n: a\O[5dummy]b O6: a\O6b O0: a\O0\&\O1b mandoc-1.14.6/regress/roff/esc/O1.out_ascii010064400017530001753000000006031406642650000207130ustar00schwarzeschwarzeESC-O1(1) General Commands Manual ESC-O1(1) NNAAMMEE esc-O1 - escape sequence to suppress output DDEESSCCRRIIPPTTIIOONN O1: ab O2: ab O3: ab O4: ab O5: ab O52: ab O5n: ab O6: ab O0: ab OpenBSD December 15, 2018 ESC-O1(1) mandoc-1.14.6/regress/roff/esc/f.out_html010064400017530001753000000005511412140003600205230ustar00schwarzeschwarzenumbers: bolditalicbolditalicroman letters: bolditalicbackbolditalicroman multiletter: boldemptyitalicbackbolditalicroman typewriter: romanboldromanitalicroman mandoc-1.14.6/regress/roff/esc/invalid.in010064400017530001753000000007331340525312500205120ustar00schwarzeschwarze.\" $OpenBSD$ .TH ESC-INVALID 1 "December 15, 2018" .SH NAME esc-invalid \- invalid roff escape sequences .SH DESCRIPTION .nf plus: a\+b\[+]c semicolon: a\;b\[;]c less than: a\b\[>]c at: a\@b\[@]c square bracket: a\]b curly braces: a\[{]b\[}]c digit: a\1b\[1]c G: a\Gb\[G]c I: a\Ib\[I]c i: a\ib\[i]c J: a\Jb\[J]c j: a\jb\[j]c K: a\Kb\[K]c P: a\Pb\[P]c Q: a\Qb\[Q]c q: a\qb\[q]c T: a\Tb\[T]c U: a\Ub\[U]c W: a\Wb\[W]c y: a\yb\[y]c mandoc-1.14.6/regress/roff/esc/invalid.out_ascii010064400017530001753000000012151412140003600220460ustar00schwarzeschwarzeESC-INVALID(1) General Commands Manual ESC-INVALID(1) NNAAMMEE esc-invalid - invalid roff escape sequences DDEESSCCRRIIPPTTIIOONN plus: a+bc semicolon: a;bc less than: abc at: a@bc square bracket: a]b curly braces: abc digit: a1bc G: aGbc I: aIbc i: aibc J: aJbc j: ajbc K: aKbc P: aPbc Q: aQbc q: aqbc T: aTbc U: aUbc W: aWbc y: aybc OpenBSD December 15, 2018 ESC-INVALID(1) mandoc-1.14.6/regress/roff/esc/invalid.out_lint010064400017530001753000000056561340525312500217520ustar00schwarzeschwarzemandoc: invalid.in:7:11: WARNING: invalid escape sequence: \[+] mandoc: invalid.in:7:8: WARNING: undefined escape, printing literally: \+ mandoc: invalid.in:8:16: WARNING: invalid escape sequence: \[;] mandoc: invalid.in:8:13: WARNING: undefined escape, printing literally: \; mandoc: invalid.in:9:16: WARNING: invalid escape sequence: \[<] mandoc: invalid.in:9:13: WARNING: undefined escape, printing literally: \< mandoc: invalid.in:10:15: WARNING: invalid escape sequence: \[=] mandoc: invalid.in:10:12: WARNING: undefined escape, printing literally: \= mandoc: invalid.in:11:19: WARNING: invalid escape sequence: \[>] mandoc: invalid.in:11:16: WARNING: undefined escape, printing literally: \> mandoc: invalid.in:12:9: WARNING: invalid escape sequence: \[@] mandoc: invalid.in:12:6: WARNING: undefined escape, printing literally: \@ mandoc: invalid.in:13:18: WARNING: undefined escape, printing literally: \] mandoc: invalid.in:14:21: WARNING: invalid escape sequence: \[}] mandoc: invalid.in:14:16: WARNING: invalid escape sequence: \[{] mandoc: invalid.in:15:12: WARNING: invalid escape sequence: \[1] mandoc: invalid.in:15:9: WARNING: undefined escape, printing literally: \1 mandoc: invalid.in:16:8: WARNING: invalid escape sequence: \[G] mandoc: invalid.in:16:5: WARNING: undefined escape, printing literally: \G mandoc: invalid.in:17:8: WARNING: invalid escape sequence: \[I] mandoc: invalid.in:17:5: WARNING: undefined escape, printing literally: \I mandoc: invalid.in:18:8: WARNING: invalid escape sequence: \[i] mandoc: invalid.in:18:5: WARNING: undefined escape, printing literally: \i mandoc: invalid.in:19:8: WARNING: invalid escape sequence: \[J] mandoc: invalid.in:19:5: WARNING: undefined escape, printing literally: \J mandoc: invalid.in:20:8: WARNING: invalid escape sequence: \[j] mandoc: invalid.in:20:5: WARNING: undefined escape, printing literally: \j mandoc: invalid.in:21:8: WARNING: invalid escape sequence: \[K] mandoc: invalid.in:21:5: WARNING: undefined escape, printing literally: \K mandoc: invalid.in:22:8: WARNING: invalid escape sequence: \[P] mandoc: invalid.in:22:5: WARNING: undefined escape, printing literally: \P mandoc: invalid.in:23:8: WARNING: invalid escape sequence: \[Q] mandoc: invalid.in:23:5: WARNING: undefined escape, printing literally: \Q mandoc: invalid.in:24:8: WARNING: invalid escape sequence: \[q] mandoc: invalid.in:24:5: WARNING: undefined escape, printing literally: \q mandoc: invalid.in:25:8: WARNING: invalid escape sequence: \[T] mandoc: invalid.in:25:5: WARNING: undefined escape, printing literally: \T mandoc: invalid.in:26:8: WARNING: invalid escape sequence: \[U] mandoc: invalid.in:26:5: WARNING: undefined escape, printing literally: \U mandoc: invalid.in:27:8: WARNING: invalid escape sequence: \[W] mandoc: invalid.in:27:5: WARNING: undefined escape, printing literally: \W mandoc: invalid.in:28:8: WARNING: invalid escape sequence: \[y] mandoc: invalid.in:28:5: WARNING: undefined escape, printing literally: \y mandoc-1.14.6/regress/roff/esc/unsupp.in010064400017530001753000000002641340525312600204160ustar00schwarzeschwarze.\" $OpenBSD$ .TH ESC-UNSUPP 1 "December 15, 2018" .SH NAME esc-unsupp \- unsupported escape sequences .SH DESCRIPTION .nf exclamation mark: a\!b\[!]c question mark: a\?\&\?b\[?]c mandoc-1.14.6/regress/roff/esc/unsupp.out_ascii010064400017530001753000000004701412140003600217540ustar00schwarzeschwarzeESC-UNSUPP(1) General Commands Manual ESC-UNSUPP(1) NNAAMMEE esc-unsupp - unsupported escape sequences DDEESSCCRRIIPPTTIIOONN exclamation mark: abc question mark: abc OpenBSD December 15, 2018 ESC-UNSUPP(1) mandoc-1.14.6/regress/roff/esc/unsupp.out_lint010064400017530001753000000004761340525312600216520ustar00schwarzeschwarzemandoc: unsupp.in:7:23: WARNING: invalid escape sequence: \[!] mandoc: unsupp.in:7:20: UNSUPP: unsupported escape sequence: \! mandoc: unsupp.in:8:24: WARNING: invalid escape sequence: \[?] mandoc: unsupp.in:8:21: UNSUPP: unsupported escape sequence: \? mandoc: unsupp.in:8:17: UNSUPP: unsupported escape sequence: \? mandoc-1.14.6/regress/roff/esc/bs_man.in010064400017530001753000000011251342002067700203200ustar00schwarzeschwarze.\" $OpenBSD: bs_man.in,v 1.1 2019/01/17 06:29:14 schwarze Exp $ .TH ESC-BS_MAN 1 "January 17, 2019" .SH NAME esc-bs_man \- escaped backslashes in man(7) code .SH DESCRIPTION .ds usestr (initial) .de testmac prefix\*[usestr]suffix prefix\\*[usestr]suffix .. .ds teststr prefix\*[usestr]middle\\*[usestr]suffix .ds usestr (later) on a text line: prefix\\suffix .PP in a macro definition: .testmac .PP in a string definition: \*[teststr] .PP in a high-level macro argument: .IB prefix ##\\*[usestr]## suffix .PP .de argmac {\\$1} .. in a user-defined macro argument: .argmac prefix\\*[usestr]suffix mandoc-1.14.6/regress/roff/esc/bs_man.out_ascii010064400017530001753000000011461412140003600216620ustar00schwarzeschwarzeESC-BS_MAN(1) General Commands Manual ESC-BS_MAN(1) NNAAMMEE esc-bs_man - escaped backslashes in man(7) code DDEESSCCRRIIPPTTIIOONN on a text line: prefix\suffix in a macro definition: prefix(initial)suffix prefix(later)suffix in a string definition: prefix(initial)middle(later)suffix in a high-level macro argument: _p_r_e_f_i_x####((llaatteerr))####_s_u_f_f_i_x in a user-defined macro argument: {prefix(later)suffix} OpenBSD January 17, 2019 ESC-BS_MAN(1) mandoc-1.14.6/regress/roff/esc/bs_mdoc.in010064400017530001753000000011521342002067700204670ustar00schwarzeschwarze.\" $OpenBSD: bs_mdoc.in,v 1.1 2019/01/17 06:29:14 schwarze Exp $ .Dd $Mdocdate: January 17 2019 $ .Dt ESC-BS_MDOC 1 .Os .Sh NAME .Nm esc-bs_mdoc .Nd escaped backslashes in mdoc(7) code .Sh DESCRIPTION .ds usestr (initial) .de testmac prefix\*[usestr]suffix prefix\\*[usestr]suffix .. .ds teststr prefix\*[usestr]middle\\*[usestr]suffix .ds usestr (later) on a text line: prefix\\suffix .Pp in a macro definition: .testmac .Pp in a string definition: \*[teststr] .Pp in a high-level macro argument: .Sy prefix\\*[usestr]suffix .Pp .de argmac {\\$1} .. in a user-defined macro argument: .argmac prefix\\*[usestr]suffix mandoc-1.14.6/regress/roff/esc/bs_mdoc.out_ascii010064400017530001753000000011461342002067700220430ustar00schwarzeschwarzeESC-BS_MDOC(1) General Commands Manual ESC-BS_MDOC(1) NNAAMMEE eesscc--bbss__mmddoocc - escaped backslashes in mdoc(7) code DDEESSCCRRIIPPTTIIOONN on a text line: prefix\suffix in a macro definition: prefix(initial)suffix prefix(later)suffix in a string definition: prefix(initial)middle(later)suffix in a high-level macro argument: pprreeffiixx((llaatteerr))ssuuffffiixx in a user-defined macro argument: {prefix(later)suffix} OpenBSD January 17, 2019 OpenBSD mandoc-1.14.6/regress/roff/esc/O1.out_lint010064400017530001753000000004611377013560500205770ustar00schwarzeschwarzemandoc: O1.in:11:6: WARNING: invalid escape sequence: \O5 mandoc: O1.in:12:7: WARNING: invalid escape sequence: \O(52 mandoc: O1.in:13:7: UNSUPP: unsupported escape sequence: \O[5dummy] mandoc: O1.in:14:6: WARNING: invalid escape sequence: \O6 mandoc: O1.in:15:6: UNSUPP: unsupported escape sequence: \O0 mandoc-1.14.6/regress/roff/ft004075500017530001753000000000001412314056700163175ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/ft/Makefile010064400017530001753000000003211341026767500200370ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.3 2018/12/15 23:33:20 schwarze Exp $ REGRESS_TARGETS = badargs badargs-mdoc HTML_TARGETS = badargs LINT_TARGETS = badargs badargs-mdoc SKIP_TMAN = badargs .include mandoc-1.14.6/regress/roff/ft/badargs.in010064400017530001753000000006171341026767500203420ustar00schwarzeschwarze.\" $OpenBSD: badargs.in,v 1.5 2018/12/16 00:10:03 schwarze Exp $ .TH "FT-BADARGS" 1 "December 15, 2018" .SH NAME ft-badargs \(en font request with bad arguments .SH DESCRIPTION BEGINTEST .br default font .ft I italic .ft BI bold italic .ft CR typeqriter .ft CW roman .ft CB bold .ft CI italic .ft B bold .ft foo still bold .ft I bogus italic .ft P back to bold .ft back to italic .ft R .br ENDTEST mandoc-1.14.6/regress/roff/ft/badargs.out_ascii010064400017530001753000000010741412140003600216650ustar00schwarzeschwarzeFT-BADARGS(1) General Commands Manual FT-BADARGS(1) NNAAMMEE ft-badargs - font request with bad arguments DDEESSCCRRIIPPTTIIOONN BEGINTEST default font _i_t_a_l_i_c _bb_oo_ll_dd _ii_tt_aa_ll_ii_cc typeqriter roman bboolldd _i_t_a_l_i_c bboolldd ssttiillll bboolldd _i_t_a_l_i_c bbaacckk ttoo bboolldd _b_a_c_k _t_o _i_t_a_l_i_c ENDTEST OpenBSD December 15, 2018 FT-BADARGS(1) mandoc-1.14.6/regress/roff/ft/badargs.out_lint010064400017530001753000000002211341026767500215600ustar00schwarzeschwarzemandoc: badargs.in:25:7: ERROR: skipping excess arguments: ft ... bogus mandoc: badargs.in:23:2: WARNING: unknown font, skipping request: ft foo mandoc-1.14.6/regress/roff/ft/badargs-mdoc.in010064400017530001753000000004631312673165400212560ustar00schwarzeschwarze.\" $OpenBSD: badargs-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt FT-BADARGS-MDOC 1 .Os .Sh NAME .Nm ft-badargs-mdoc .Nd font request with bad arguments .Sh DESCRIPTION default font .ft B bold .ft foo still bold .ft I bogus italic .ft P back to bold .ft back to italic mandoc-1.14.6/regress/roff/ft/badargs-mdoc.out_ascii010064400017530001753000000006741312673165400226330ustar00schwarzeschwarzeFT-BADARGS-MDOC(1) General Commands Manual FT-BADARGS-MDOC(1) NNAAMMEE fftt--bbaaddaarrggss--mmddoocc - font request with bad arguments DDEESSCCRRIIPPTTIIOONN default font bboolldd ssttiillll bboolldd _i_t_a_l_i_c bbaacckk ttoo bboolldd _b_a_c_k _t_o _i_t_a_l_i_c OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ft/badargs-mdoc.out_lint010064400017530001753000000002331312673165400225000ustar00schwarzeschwarzemandoc: badargs-mdoc.in:14:7: ERROR: skipping excess arguments: ft ... bogus mandoc: badargs-mdoc.in:12:2: WARNING: unknown font, skipping request: ft foo mandoc-1.14.6/regress/roff/ft/badargs.out_html010064400017530001753000000004701412140003600215400ustar00schwarzeschwarze
default font italic bold italic typeqriter roman bold italic bold still bold italic back to bold back to italic
mandoc-1.14.6/regress/roff/ig004075500017530001753000000000001412314056700163055ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/ig/Makefile010064400017530001753000000002071304650517200200200ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2014/07/07 11:34:41 schwarze Exp $ REGRESS_TARGETS = basic LINT_TARGETS = basic .include mandoc-1.14.6/regress/roff/ig/basic.in010064400017530001753000000006451313667013200177760ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IG-BASIC 1 .Os .Sh NAME .Nm ig-basic .Nd ignored blocks .Sh DESCRIPTION no arguments .ig ignored text .. .br with end marker .ig end1 ignored text .end1 .br with two arguments .ig end2 excess ignored text .end2 .br Here is a stray .. block ending, .. and then an .ig staying open until the end of the file: .ig ignored text mandoc-1.14.6/regress/roff/ig/basic.out_ascii010064400017530001753000000006411313667013200213430ustar00schwarzeschwarzeIG-BASIC(1) General Commands Manual IG-BASIC(1) NNAAMMEE iigg--bbaassiicc - ignored blocks DDEESSCCRRIIPPTTIIOONN no arguments with end marker with two arguments Here is a stray .. block ending, and then an .ig staying open until the end of the file: OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ig/basic.out_lint010064400017530001753000000003221313667013200212150ustar00schwarzeschwarzemandoc: basic.in:20:5: ERROR: skipping excess arguments: .ig ... excess mandoc: basic.in:25:2: ERROR: skipping end of block that is not open: .. mandoc: basic.in:27:2: ERROR: appending missing end of block: ig mandoc-1.14.6/regress/roff/it004075500017530001753000000000001412314056700163225ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/it/Makefile010064400017530001753000000002251304650517200200350ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2014/08/14 02:00:53 schwarze Exp $ REGRESS_TARGETS = badarg double text LINT_TARGETS = badarg .include mandoc-1.14.6/regress/roff/it/badarg.in010064400017530001753000000004211313667013200201420ustar00schwarzeschwarze.\" $OpenBSD: badarg.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IT-BADARG 1 .Os .Sh NAME .Nm it-badarg .Nd input line traps without numeric arguments .Sh DESCRIPTION .de mytrap traptext .. line 1 .it mytrap line 2 line 3 .it line 4 line 5 mandoc-1.14.6/regress/roff/it/badarg.out_ascii010064400017530001753000000005061313667013200215170ustar00schwarzeschwarzeIT-BADARG(1) General Commands Manual IT-BADARG(1) NNAAMMEE iitt--bbaaddaarrgg - input line traps without numeric arguments DDEESSCCRRIIPPTTIIOONN line 1 line 2 line 3 line 4 line 5 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/it/badarg.out_lint010064400017530001753000000002411313667013200213710ustar00schwarzeschwarzemandoc: badarg.in:13:2: ERROR: skipping request without numeric argument: it mytrap mandoc: badarg.in:16:2: ERROR: skipping request without numeric argument: it mandoc-1.14.6/regress/roff/it/double.in010064400017530001753000000004471313667013200202040ustar00schwarzeschwarze.\" $OpenBSD: double.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH IT-DOUBLE 1 2013-07-13 .SH NAME it-double \- double input line trap .SH DESCRIPTION .de firstmacro firstmacro .. .de secondmacro secondmacro .. initial text .it 1 firstmacro .it 2 secondmacro first line second line third line mandoc-1.14.6/regress/roff/it/double.out_ascii010064400017530001753000000004741412140003600215420ustar00schwarzeschwarzeIT-DOUBLE(1) General Commands Manual IT-DOUBLE(1) NNAAMMEE it-double - double input line trap DDEESSCCRRIIPPTTIIOONN initial text first line second line secondmacro third line OpenBSD 2013-07-13 IT-DOUBLE(1) mandoc-1.14.6/regress/roff/it/text.in010064400017530001753000000010231313667013200177050ustar00schwarzeschwarze.\" $OpenBSD: text.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt IT-TEXT 1 .Os .Sh NAME .Nm it-text .Nd what an input line trap counts as text .Sh DESCRIPTION .de trap traptext .. initial text .it 1trap first line after 1trap second line after 1trap .Pp .it 1vtrap first line after 1vtrap second line after 1vtrap .Pp .it ( + 1c + 1i)trap first line after ( + 1c + 1i)trap second line after ( + 1c + 1i)trap third line after ( + 1c + 1i)trap .it 1 trap .Pp first line after .Pp second line after .Pp mandoc-1.14.6/regress/roff/it/text.out_ascii010064400017530001753000000011231313667013200212570ustar00schwarzeschwarzeIT-TEXT(1) General Commands Manual IT-TEXT(1) NNAAMMEE iitt--tteexxtt - what an input line trap counts as text DDEESSCCRRIIPPTTIIOONN initial text first line after 1trap traptext second line after 1trap first line after 1vtrap traptext second line after 1vtrap first line after ( + 1c + 1i)trap second line after ( + 1c + 1i)trap traptext third line after ( + 1c + 1i)trap first line after .Pp traptext second line after .Pp OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ll004075500017530001753000000000001412314056700163155ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/ll/Makefile010064400017530001753000000001771304650517300200370ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2014/03/30 19:47:32 schwarze Exp $ REGRESS_TARGETS = basic SKIP_TMAN = .include mandoc-1.14.6/regress/roff/ll/basic.in010064400017530001753000000014351313667013200200040ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt LL-BASIC 1 .Os .Sh NAME .Nm ll-basic .Nd changing the line length .Sh DESCRIPTION This is a longer text to demonstrate the default line length. In ASCII mode, it is expected to break at column 78. .Pp .ll 38n This is another long text to demonstrate shorter lines. In ASCII mode, it is expected to break at column 38. .Pp .ll This is a longer text after switching back to the default line length. In ASCII mode, it is expected to break at column 78. .Pp .ll +100n This is another long text to demonstrate longer lines. In ASCII mode, it is not expected to break at all. .Pp .ll FOO This is a longer text after switching to an invalid line length. In ASCII mode, it is expected to break at column 78. mandoc-1.14.6/regress/roff/ll/basic.out_ascii010064400017530001753000000016041313667013200213530ustar00schwarzeschwarzeLL-BASIC(1) General Commands Manual LL-BASIC(1) NNAAMMEE llll--bbaassiicc - changing the line length DDEESSCCRRIIPPTTIIOONN This is a longer text to demonstrate the default line length. In ASCII mode, it is expected to break at column 78. This is another long text to demonstrate shorter lines. In ASCII mode, it is expected to break at column 38. This is a longer text after switching back to the default line length. In ASCII mode, it is expected to break at column 78. This is another long text to demonstrate longer lines. In ASCII mode, it is not expected to break at all. This is a longer text after switching to an invalid line length. In ASCII mode, it is expected to break at column 78. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/na004075500017530001753000000000001412314056700163045ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/na/Makefile010064400017530001753000000001571304650517400200250ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2011/11/17 16:28:46 schwarze Exp $ REGRESS_TARGETS=args .include mandoc-1.14.6/regress/roff/na/args.in010064400017530001753000000003031313667013200176370ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH NA-ARGS 1 "January 17, 2011" .SH NAME na-args \- arguments to .na macros .SH DESCRIPTION some text .na arg1 arg2 arg3 more text mandoc-1.14.6/regress/roff/na/args.out_ascii010064400017530001753000000004241412140003600212010ustar00schwarzeschwarzeNA-ARGS(1) General Commands Manual NA-ARGS(1) NNAAMMEE na-args - arguments to .na macros DDEESSCCRRIIPPTTIIOONN some text more text OpenBSD January 17, 2011 NA-ARGS(1) mandoc-1.14.6/regress/roff/nr004075500017530001753000000000001412314056700163255ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/nr/Makefile010064400017530001753000000003111343772345500200460ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.12 2019/02/06 20:54:28 schwarze Exp $ REGRESS_TARGETS = argc divzero escname eval incr int predef rr scale tab undef LINT_TARGETS = divzero escname .include mandoc-1.14.6/regress/roff/nr/argc.in010064400017530001753000000006601313667013200176460ustar00schwarzeschwarze.\" $OpenBSD: argc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt NR-ARGC 1 .Os .Sh NAME .Nm nr-argc .Nd varying number of arguments to the .nr macro .Sh DESCRIPTION .nr onearg one argument: \n[onearg] .Pp .nr twoargs 2 two arguments: \n[twoargs] .Pp .nr withsuffix 2x with suffix: \n[withsuffix] .Pp .nr threeargs 2 3 three arguments: \n[threeargs] .Pp .nr fourargs 2 3 4 four arguments: \n[fourargs] mandoc-1.14.6/regress/roff/nr/argc.out_ascii010064400017530001753000000006141313667013200212160ustar00schwarzeschwarzeNR-ARGC(1) General Commands Manual NR-ARGC(1) NNAAMMEE nnrr--aarrggcc - varying number of arguments to the .nr macro DDEESSCCRRIIPPTTIIOONN one argument: 0 two arguments: 2 with suffix: 2 three arguments: 2 four arguments: 2 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/nr/divzero.in010064400017530001753000000004171313667013200204140ustar00schwarzeschwarze.\" $OpenBSD: divzero.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH NR-DIVZERO 1 "December 18, 2014" .SH NAME nr-divzero \- division by zero in numerical expression .SH DESCRIPTION initial text .nr divresult 1/0 .nr modresult 1%0 final \n[divresult] \n[modresult] text mandoc-1.14.6/regress/roff/nr/divzero.out_ascii010064400017530001753000000004601412140003700217510ustar00schwarzeschwarzeNR-DIVZERO(1) General Commands Manual NR-DIVZERO(1) NNAAMMEE nr-divzero - division by zero in numerical expression DDEESSCCRRIIPPTTIIOONN initial text final 0 0 text OpenBSD December 18, 2014 NR-DIVZERO(1) mandoc-1.14.6/regress/roff/nr/divzero.out_lint010064400017530001753000000001461313667013200216420ustar00schwarzeschwarzemandoc: divzero.in:7:4: ERROR: divide by zero: 1/0 mandoc: divzero.in:8:4: ERROR: divide by zero: 1%0 mandoc-1.14.6/regress/roff/nr/escname.in010064400017530001753000000006511313667013200203450ustar00schwarzeschwarze.\" $OpenBSD: escname.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH NR-ESCNAME 1 "June 29, 2014" .SH NAME nr-escname \- escape sequences in register names .SH DESCRIPTION .nr first 1 .nr second 2 .nr first\\second 3 .nr first\esecond 4 \n[first] \n[second] \n[first\\second] .PP .rr first\esecond \n[first] \n[second] \n[first\\second] .PP .rr first\\second \n[first] \n[second] \n[first\\second] .PP incomplete: \n[second mandoc-1.14.6/regress/roff/nr/escname.out_ascii010064400017530001753000000005041412140003700217010ustar00schwarzeschwarzeNR-ESCNAME(1) General Commands Manual NR-ESCNAME(1) NNAAMMEE nr-escname - escape sequences in register names DDEESSCCRRIIPPTTIIOONN 1 2 3 0 2 3 0 2 0 incomplete: OpenBSD June 29, 2014 NR-ESCNAME(1) mandoc-1.14.6/regress/roff/nr/escname.out_lint010064400017530001753000000004501313667013200215710ustar00schwarzeschwarzemandoc: escname.in:9:5: ERROR: escaped character not allowed in a name: first\e mandoc: escname.in:12:5: ERROR: escaped character not allowed in a name: first\e mandoc: escname.in:18:13: WARNING: invalid escape sequence: \n[second mandoc: escname.in:18:12: STYLE: whitespace at end of input line mandoc-1.14.6/regress/roff/nr/eval.in010064400017530001753000000015311313667013200176570ustar00schwarzeschwarze.\" $OpenBSD: eval.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH NR-EVAL 1 "April 7, 2014" .SH NAME nr-eval \- numeric expressions in assignments to number registers .SH DESCRIPTION .nr mr 1 1: \n(mr .br .nr mr nonumber nonumber: \n(mr .br .nr mr 3X 3X: \n(mr .br .nr mr 4+ 4+: \n(mr .br .nr mr 2+3 2+3: \n(mr .br .nr mr 1+1: 1+1:: \n(mr .br .nr mr 10-3 10-3: \n(mr .br .nr mr 4*2 4*2: \n(mr .br .nr mr 27/3 27/3: \n(mr .br .nr mr 58%16 58%16: \n(mr .br .nr mr 11?13 7>?13: \n(mr .br .nr mr 14>?6 14>?6: \n(mr .br .nr mr 2+3*3 2+3*3: \n(mr .br .nr mr 16+( para at eol: \n(mr .br .nr mr (17 unclosed para: \n(mr .br .nr mr (18) (18): \n(mr .br .nr mr ( 25 - 6 ) ( 25 - 6 ): \n(mr .br .nr mr 11+( 3*3 ) 11+( 3*3 ): \n(mr .br .nr mr 3+(3*(5==5*2)*4)+(3*5)/2 3+(3*(5==5*2)*4)+(3*5)/2: \n(mr .br mandoc-1.14.6/regress/roff/nr/eval.out_ascii010064400017530001753000000012221412140003700212130ustar00schwarzeschwarzeNR-EVAL(1) General Commands Manual NR-EVAL(1) NNAAMMEE nr-eval - numeric expressions in assignments to number registers DDEESSCCRRIIPPTTIIOONN 1: 1 nonumber: 1 3X: 3 4+: 3 2+3: 5 1+1:: 5 10-3: 7 4*2: 8 27/3: 9 58%16: 10 11?13: 13 14>?6: 14 2+3*3: 15 para at eol: 15 unclosed para: 17 (18): 18 ( 25 - 6 ): 19 11+( 3*3 ): 20 3+(3*(5==5*2)*4)+(3*5)/2: 21 OpenBSD April 7, 2014 NR-EVAL(1) mandoc-1.14.6/regress/roff/nr/int.in010064400017530001753000000005251313667013200175240ustar00schwarzeschwarze.\" $OpenBSD: int.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH NR-INT 1 "October 3, 2013" .SH NAME nr-int \- integer number registers .SH DESCRIPTION initial contents: \nY \n(YY \n[YYY] .br .nr Y 42 .nr YY -1 .nr YYY 2147483647 intermediate contents: \nY \n(YY \n[YYY] .br .nr Y -19 .nr YY +2 .nr YYY +1 final contents: \nY \n(YY \n[YYY] mandoc-1.14.6/regress/roff/nr/int.out_ascii010064400017530001753000000005571412140003700210700ustar00schwarzeschwarzeNR-INT(1) General Commands Manual NR-INT(1) NNAAMMEE nr-int - integer number registers DDEESSCCRRIIPPTTIIOONN initial contents: 0 0 0 intermediate contents: 42 -1 2147483647 final contents: 23 1 -2147483648 OpenBSD October 3, 2013 NR-INT(1) mandoc-1.14.6/regress/roff/nr/predef.in010064400017530001753000000007651374632357600202230ustar00schwarzeschwarze.\" $OpenBSD: predef.in,v 1.4 2020/10/24 22:52:34 schwarze Exp $ .TH NR-PREDEF 1 "August 29, 2015" .SH NAME nr-predef \- pre-defined read-only integer number registers .SH DESCRIPTION .de mym user defined macro with \\n(.$ arguments: \\$* .. .nf .nr .A 111 .nr .g 111 .nr .H 111 .nr .j 111 .nr .T 111 .nr .V 111 .nr .$ 111 ascii mode: \n(.A groff mode: \n(.g horizontal resolution: \n(.H adjustment mode: \n(.j output device defined: \n(.T \n[.T] vertical resolution: \n(.V .mym .mym one .mym one two mandoc-1.14.6/regress/roff/nr/predef.out_ascii010064400017530001753000000011101412140003700215250ustar00schwarzeschwarzeNR-PREDEF(1) General Commands Manual NR-PREDEF(1) NNAAMMEE nr-predef - pre-defined read-only integer number registers DDEESSCCRRIIPPTTIIOONN ascii mode: 0 groff mode: 1 horizontal resolution: 24 adjustment mode: 0 output device defined: 1 1 vertical resolution: 40 user defined macro with 0 arguments: user defined macro with 1 arguments: one user defined macro with 2 arguments: one two OpenBSD August 29, 2015 NR-PREDEF(1) mandoc-1.14.6/regress/roff/nr/rr.in010064400017530001753000000005061313667013200173540ustar00schwarzeschwarze.\" $OpenBSD: rr.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH NR-RR 1 "April 5, 2014" .SH NAME nr-rr \- defining and undefining number registers .SH DESCRIPTION .nr key1 1 .nr key2 2 .nr key3 3 .nr key4 4 .nr key5 5 .rr key1 .rr key3 .rr key5 non-null values: \n[key2] \n[key4] .br unset values: \n[key1] \n[key3] \n[key5] mandoc-1.14.6/regress/roff/nr/rr.out_ascii010064400017530001753000000004771412140003700207220ustar00schwarzeschwarzeNR-RR(1) General Commands Manual NR-RR(1) NNAAMMEE nr-rr - defining and undefining number registers DDEESSCCRRIIPPTTIIOONN non-null values: 2 4 unset values: 0 0 0 OpenBSD April 5, 2014 NR-RR(1) mandoc-1.14.6/regress/roff/nr/scale.in010064400017530001753000000005231313667013200200170ustar00schwarzeschwarze.\" $OpenBSD: scale.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH NR-INT 1 "January 23, 2015" .SH NAME nr-scale \- scaling units in numeric expressions .SH DESCRIPTION .nr Y 1f+1 \nY .nr Y 1i+1 \nY .nr Y 10c+1 \nY .nr Y 1v+1 \nY .nr Y 1P+1 \nY .nr Y 1m+1 \nY .nr Y 1n+1 \nY .nr Y 10p+1 \nY .nr Y 1u+1 \nY .nr Y 100M+1 \nY .nr Y 1X+2 \nY mandoc-1.14.6/regress/roff/nr/scale.out_ascii010064400017530001753000000004621412140003700213600ustar00schwarzeschwarzeNR-INT(1) General Commands Manual NR-INT(1) NNAAMMEE nr-scale - scaling units in numeric expressions DDEESSCCRRIIPPTTIIOONN 65537 241 945 41 41 25 25 34 2 25 1 OpenBSD January 23, 2015 NR-INT(1) mandoc-1.14.6/regress/roff/nr/incr.in010064400017530001753000000012011341026767500176660ustar00schwarzeschwarze.\" $OpenBSD: incr.in,v 1.1 2018/04/10 00:52:21 schwarze Exp $ .TH NR-INCR 1 "April 10, 2018" .SH NAME nr-incr \- increment a number register by accessing it .SH DESCRIPTION .nr myr 0 1 Roff can count by merely accessing a number register: \n+[myr] \n+[myr] \n+[myr] .PP .nr myr +0 1+1 It can also change the step size: \n+[myr] \n+[myr] \n+[myr] .PP .nr myr +0 3 It can also count down: \n-[myr] \n-[myr] \n-[myr] \n-[myr] .PP .nr myr -0 -2 Down in negative steps is up: \n-[myr] \n-[myr] \n-[myr] \n-[myr] .PP .nr myr 42 Go to some other value, then continue incrementing with an unchanged (negative) step size: \n+[myr] \n+[myr] \n+[myr] mandoc-1.14.6/regress/roff/nr/incr.out_ascii010064400017530001753000000011131412140003700212160ustar00schwarzeschwarzeNR-INCR(1) General Commands Manual NR-INCR(1) NNAAMMEE nr-incr - increment a number register by accessing it DDEESSCCRRIIPPTTIIOONN Roff can count by merely accessing a number register: 1 2 3 It can also change the step size: 5 7 9 It can also count down: 6 3 0 -3 Down in negative steps is up: -1 1 3 5 Go to some other value, then continue incrementing with an unchanged (negative) step size: 40 38 36 OpenBSD April 10, 2018 NR-INCR(1) mandoc-1.14.6/regress/roff/nr/undef.in010064400017530001753000000010001326276427100200300ustar00schwarzeschwarze.\" $OpenBSD: divzero.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH NR-UNDEF 1 "April 9, 2018" .SH NAME nr-undef \- using an undefined number register .SH DESCRIPTION The myr register is initially .ie rmyr defined. .el undefined. .PP Its initial value is \n[myr]. .PP After interpolating it, is is now .ie rmyr defined. .el undefined. .PP .nr myr 1 After defining it to \n[myr], it is of course still .ie rmyr defined. .el undefined. .PP .rr myr After removing it, it is again .ie rmyr defined. .el undefined. mandoc-1.14.6/regress/roff/nr/undef.out_ascii010064400017530001753000000007711412140003700213750ustar00schwarzeschwarzeNR-UNDEF(1) General Commands Manual NR-UNDEF(1) NNAAMMEE nr-undef - using an undefined number register DDEESSCCRRIIPPTTIIOONN The myr register is initially undefined. Its initial value is 0. After interpolating it, is is now defined. After defining it to 1, it is of course still defined. After removing it, it is again undefined. OpenBSD April 9, 2018 NR-UNDEF(1) mandoc-1.14.6/regress/roff/nr/tab.in010064400017530001753000000005111342664662400175060ustar00schwarzeschwarze.\" $OpenBSD: tab.in,v 1.1 2019/02/06 20:54:28 schwarze Exp $ .TH NR-TAB 1 "February 6, 2019" .SH NAME nr-tab \- tab characters in register definition lines .SH DESCRIPTION with tab: .nr testreg 1 >>\n[testreg]<< .br with space: .nr testreg 2 .nr test2 42 >>\n[testreg]<< .br rr with tab: .rr testreg test2 >>\n[myr]:\n[test2]<< mandoc-1.14.6/regress/roff/nr/tab.out_ascii010064400017530001753000000005311412140003700210340ustar00schwarzeschwarzeNR-TAB(1) General Commands Manual NR-TAB(1) NNAAMMEE nr-tab - tab characters in register definition lines DDEESSCCRRIIPPTTIIOONN with tab: >>0<< with space: >>2<< rr with tab: >>0:42<< OpenBSD February 6, 2019 NR-TAB(1) mandoc-1.14.6/regress/roff/ps004075500017530001753000000000001412314056700163305ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/ps/Makefile010064400017530001753000000001611304650517500200450ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2011/11/17 16:28:46 schwarze Exp $ REGRESS_TARGETS=ignore .include mandoc-1.14.6/regress/roff/ps/ignore.in010064400017530001753000000003231313667013200202140ustar00schwarzeschwarze.\" $OpenBSD: ignore.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH PS-IGNORE 1 "Febuary 5, 2011" .SH NAME ps-ignore \- ignoreing point size macros .SH DESCRIPTION normal text .ps -1 small text .ps +1 big text mandoc-1.14.6/regress/roff/ps/ignore.out_ascii010064400017530001753000000004461412140003700215610ustar00schwarzeschwarzePS-IGNORE(1) General Commands Manual PS-IGNORE(1) NNAAMMEE ps-ignore - ignoreing point size macros DDEESSCCRRIIPPTTIIOONN normal text small text big text OpenBSD Febuary 5, 2011 PS-IGNORE(1) mandoc-1.14.6/regress/roff/rm004075500017530001753000000000001412314056700163245ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/rm/Makefile010064400017530001753000000001601304650517600200410ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2011/11/17 16:28:46 schwarze Exp $ REGRESS_TARGETS=basic .include mandoc-1.14.6/regress/roff/rm/basic.in010064400017530001753000000004671313667013200200170ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RM-BASIC 1 .Os .Sh NAME .Nm rm-basic .Nd the remove macro request .Sh DESCRIPTION .de mymacro Hello .. .ds mystring world before rm: .mymacro \*[mystring]! .br .rm mymacro mystring after rm: .mymacro \*[mystring]! mandoc-1.14.6/regress/roff/rm/basic.out_ascii010064400017530001753000000004671313667013200213700ustar00schwarzeschwarzeRM-BASIC(1) General Commands Manual RM-BASIC(1) NNAAMMEE rrmm--bbaassiicc - the remove macro request DDEESSCCRRIIPPTTIIOONN before rm: Hello world! after rm: ! OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/scale004075500017530001753000000000001412314056700167755ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/scale/Makefile010064400017530001753000000001621304650517600205140ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2014/08/14 02:00:53 schwarze Exp $ REGRESS_TARGETS = horiz .include mandoc-1.14.6/regress/roff/scale/horiz.in010064400017530001753000000005151313667013200205340ustar00schwarzeschwarze.\" $OpenBSD: horiz.in,v 1.5 2017/07/04 14:53:27 schwarze Exp $ .TH HORIZ 1 "December 23, 2014" .SH NAME horiz \- horizontal distances .SH DESCRIPTION initial text .in 240u 240u .in 3.6c 3.6c .in 0.003f 0.003f .in 2i 2i .in 500M 500M .in 6P 6P .in 36p 36p .in 10n 10n .in 5m 5m .in 79n 79n .in 1.5ix 1.5ix .in -6n -6n .PP final text mandoc-1.14.6/regress/roff/scale/horiz.out_ascii010064400017530001753000000010161412140003700220700ustar00schwarzeschwarzeHORIZ(1) General Commands Manual HORIZ(1) NNAAMMEE horiz - horizontal distances DDEESSCCRRIIPPTTIIOONN initial text 240u 3.6c 0.003f 2i 500M 6P 36p 10n 5m 79n 1.5ix -6n final text OpenBSD December 23, 2014 HORIZ(1) mandoc-1.14.6/regress/roff/sp004075500017530001753000000000001412314056700163305ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/sp/Makefile010064400017530001753000000003711343772345500200570ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2019/01/06 04:41:15 schwarze Exp $ REGRESS_TARGETS = badargs-man badargs-mdoc fill-man REGRESS_TARGETS += negative scaling-man scaling-mdoc LINT_TARGETS = badargs-man HTML_TARGETS = fill-man .include mandoc-1.14.6/regress/roff/sp/badargs-man.in010064400017530001753000000005461313667013200211140ustar00schwarzeschwarze.\" $OpenBSD: badargs-man.in,v 1.5 2017/07/04 14:53:27 schwarze Exp $ .TH SP-BADARGS-MAN 1 "December 23, 2014" .SH NAME sp-badargs-man \- bad arguments to .sp macros in man(7) .SH DESCRIPTION no arguments: .sp one argument: .sp 2v two arguments: .sp 3v 2i no scaling unit specified: .sp 1 trailing garbage: .sp 2vx garbage only: .sp xxx end of test document mandoc-1.14.6/regress/roff/sp/badargs-man.out_ascii010064400017530001753000000007041412140003700224470ustar00schwarzeschwarzeSP-BADARGS-MAN(1) General Commands Manual SP-BADARGS-MAN(1) NNAAMMEE sp-badargs-man - bad arguments to .sp macros in man(7) DDEESSCCRRIIPPTTIIOONN no arguments: one argument: two arguments: no scaling unit specified: trailing garbage: garbage only: end of test document OpenBSD December 23, 2014 SP-BADARGS-MAN(1) mandoc-1.14.6/regress/roff/sp/badargs-man.out_lint010064400017530001753000000001111313667013200223270ustar00schwarzeschwarzemandoc: badargs-man.in:11:8: ERROR: skipping excess arguments: sp ... 2i mandoc-1.14.6/regress/roff/sp/badargs-mdoc.in010064400017530001753000000005741313667013200212640ustar00schwarzeschwarze.\" $OpenBSD: badargs-mdoc.in,v 1.5 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SP-BADARGS-MDOC 1 .Os .Sh NAME .Nm sp-badargs-mdoc .Nd bad arguments to .sp macros in mdoc(7) .Sh DESCRIPTION no arguments: .sp one argument: .sp 2v two arguments: .sp 3v 2i no scaling unit specified: .sp 1 trailing garbage: .sp 2vx garbage only: .sp xxx end of test document mandoc-1.14.6/regress/roff/sp/badargs-mdoc.out_ascii010064400017530001753000000007241313667013200226320ustar00schwarzeschwarzeSP-BADARGS-MDOC(1) General Commands Manual SP-BADARGS-MDOC(1) NNAAMMEE sspp--bbaaddaarrggss--mmddoocc - bad arguments to .sp macros in mdoc(7) DDEESSCCRRIIPPTTIIOONN no arguments: one argument: two arguments: no scaling unit specified: trailing garbage: garbage only: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/sp/negative.in010064400017530001753000000003121313667013200205310ustar00schwarzeschwarze.\" $OpenBSD: negative.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH SP-NEGATIVE 1 "July 12, 2012" .SH NAME sp-negative \- negative vertical spacing .SH DESCRIPTION first line .sp -1v .PP second line mandoc-1.14.6/regress/roff/sp/negative.out_ascii010064400017530001753000000004441412140003700220760ustar00schwarzeschwarzeSP-NEGATIVE(1) General Commands Manual SP-NEGATIVE(1) NNAAMMEE sp-negative - negative vertical spacing DDEESSCCRRIIPPTTIIOONN first line second line OpenBSD July 12, 2012 SP-NEGATIVE(1) mandoc-1.14.6/regress/roff/sp/scaling-man.in010064400017530001753000000006671313667013200211350ustar00schwarzeschwarze.\" $OpenBSD: scaling-man.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH SP-SCALING-MAN 1 "December 23, 2014" .SH NAME sp-scaling-man \- scaled arguments to .sp requests in man(7) .SH DESCRIPTION 20 basic units: .sp 20u 21 basic units: .sp 21u one centimeter: .sp 1c quarter of an inch: .sp 0.25i half a pica: .sp 0.5P one pica: .sp 1P 6 points: .sp 6p 7 points: .sp 7p one en: .sp 1n three en: .sp 3n two em: .sp 2m end of test document mandoc-1.14.6/regress/roff/sp/scaling-man.out_ascii010064400017530001753000000010171412140003700224620ustar00schwarzeschwarzeSP-SCALING-MAN(1) General Commands Manual SP-SCALING-MAN(1) NNAAMMEE sp-scaling-man - scaled arguments to .sp requests in man(7) DDEESSCCRRIIPPTTIIOONN 20 basic units: 21 basic units: one centimeter: quarter of an inch: half a pica: one pica: 6 points: 7 points: one en: three en: two em: end of test document OpenBSD December 23, 2014 SP-SCALING-MAN(1) mandoc-1.14.6/regress/roff/sp/scaling-mdoc.in010064400017530001753000000007151313667013200212760ustar00schwarzeschwarze.\" $OpenBSD: scaling-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt SP-SCALING-MDOC 1 .Os .Sh NAME .Nm sp-scaling-mdoc .Nd scaled arguments to .sp requests in mdoc(7) .Sh DESCRIPTION 20 basic units: .sp 20u 21 basic units: .sp 21u one centimeter: .sp 1c quarter of an inch: .sp 0.25i half a pica: .sp 0.5P one pica: .sp 1P 6 points: .sp 6p 7 points: .sp 7p one en: .sp 1n three en: .sp 3n two em: .sp 2m end of test document mandoc-1.14.6/regress/roff/sp/scaling-mdoc.out_ascii010064400017530001753000000010251313667013200226420ustar00schwarzeschwarzeSP-SCALING-MDOC(1) General Commands Manual SP-SCALING-MDOC(1) NNAAMMEE sspp--ssccaalliinngg--mmddoocc - scaled arguments to .sp requests in mdoc(7) DDEESSCCRRIIPPTTIIOONN 20 basic units: 21 basic units: one centimeter: quarter of an inch: half a pica: one pica: 6 points: 7 points: one en: three en: two em: end of test document OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/sp/fill-man.in010064400017530001753000000005041341430506400204270ustar00schwarzeschwarze.\" $OpenBSD: fill-man.in,v 1.1 2019/01/06 04:41:15 schwarze Exp $ .TH SP-FILL-MAN 1 "January 6, 2019" .SH NAME sp-fill-man \- interaction of vertical spacing requests with fill modes .SH DESCRIPTION BEGINTEST in fill mode: .sp switch to no-fill mode: .nf in no-fill mode: .sp back to fill mode: .fi ENDTEST .br end of file mandoc-1.14.6/regress/roff/sp/fill-man.out_ascii010064400017530001753000000006711412140003700217750ustar00schwarzeschwarzeSP-FILL-MAN(1) General Commands Manual SP-FILL-MAN(1) NNAAMMEE sp-fill-man - interaction of vertical spacing requests with fill modes DDEESSCCRRIIPPTTIIOONN BEGINTEST in fill mode: switch to no-fill mode: in no-fill mode: back to fill mode: ENDTEST end of file OpenBSD January 6, 2019 SP-FILL-MAN(1) mandoc-1.14.6/regress/roff/sp/fill-man.out_html010064400017530001753000000001321374632357600216710ustar00schwarzeschwarze

switch to no-fill mode:

in no-fill mode:

back to
fill mode:
mandoc-1.14.6/regress/roff/string004075500017530001753000000000001412314056700172145ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/string/Makefile010064400017530001753000000007521341026767600207450ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2014/07/06 19:08:57 schwarze Exp $ REGRESS_TARGETS = dotT escape infinite name std undef zerolength LINT_TARGETS = name std undef UTF8_TARGETS = dotT HTML_TARGETS = dotT SKIP_MARKDOWN = escape infinite name std undef zerolength # The infinite test fails badly with groff-1.20.1: # It fails to print the following text. SKIP_GROFF ?= infinite # Groff can expand standard macros as strings, but mandoc cannot. SKIP_GROFF += std .include mandoc-1.14.6/regress/roff/string/escape.in010064400017530001753000000012411313667013200210550ustar00schwarzeschwarze.\" $OpenBSD: escape.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH STRING-ESCAPE 1 "December 3, 2010" .SH NAME string-escape - preventing string interpolation .SH DESCRIPTION .ds right wrong .ds inner *[right] .ds outer \\*[inner] .SS Normal interpolation result: \*[inner] .PP The above line must be "result: *[right]". .SS Intervening character result: \e*[right] .PP The above line must be "result: backslash*[right]", not "result: rong". .SS Escaped backslash result: \\*[right] .PP The above line must be "result: backslash*[right]", not "result: rong". .SS Delayed interpolation result: \*[outer] .PP The above line must be "result: *[right]", not "result: wrong". mandoc-1.14.6/regress/roff/string/escape.out_ascii010064400017530001753000000015741412140003700224250ustar00schwarzeschwarzeSTRING-ESCAPE(1) General Commands Manual STRING-ESCAPE(1) NNAAMMEE string-escape - preventing string interpolation DDEESSCCRRIIPPTTIIOONN NNoorrmmaall iinntteerrppoollaattiioonn result: *[right] The above line must be "result: *[right]". IInntteerrvveenniinngg cchhaarraacctteerr result: \*[right] The above line must be "result: backslash*[right]", not "result: rong". EEssccaappeedd bbaacckkssllaasshh result: \*[right] The above line must be "result: backslash*[right]", not "result: rong". DDeellaayyeedd iinntteerrppoollaattiioonn result: *[right] The above line must be "result: *[right]", not "result: wrong". OpenBSD December 3, 2010 STRING-ESCAPE(1) mandoc-1.14.6/regress/roff/string/infinite.in010064400017530001753000000004501313667013200214230ustar00schwarzeschwarze.\" $OpenBSD: infinite.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH STRING-INFINITE 1 "December 3, 2010" .SH NAME string-infinite - endless recursion in string expansion .SH DESCRIPTION .ds recur \\*[recur] Blow up, (and do not \*[recur] print this) but still render following text correctly. mandoc-1.14.6/regress/roff/string/infinite.out_ascii010064400017530001753000000005121412140003700227610ustar00schwarzeschwarzeSTRING-INFINITE(1) General Commands Manual STRING-INFINITE(1) NNAAMMEE string-infinite - endless recursion in string expansion DDEESSCCRRIIPPTTIIOONN Blow up, but still render following text correctly. OpenBSD December 3, 2010 STRING-INFINITE(1) mandoc-1.14.6/regress/roff/string/name.in010064400017530001753000000011051313667013200205340ustar00schwarzeschwarze.\" $OpenBSD: name.in,v 1.4 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt STRING-NAME 1 .Os .Sh NAME .Nm string-name .Nd torturing .ds with weird string names .Sh DESCRIPTION .ds norm value of norm .ds "quot" value of "quot" .ds bs\e value of bs\ee .ds bs\\e value of bs\e\ee .ds bl\ e value of bl\e e norm: \*[norm] .br norm without closing brace: \*[norm .br quot: \*[quot] .br "quot": \*["quot"] .br bs\e\ee: \*[bs\\e] .\".br .\"bs\ee: \*[bs\e] .br bse: \*[bse] .br bs: \*[bs] .\".br .\"bl\e e: \*[bl\ e] .br bl e: \*[bl e] .br ble: \*[ble] .br bl: \*[bl] mandoc-1.14.6/regress/roff/string/name.out_ascii010064400017530001753000000007151313667013200221130ustar00schwarzeschwarzeSTRING-NAME(1) General Commands Manual STRING-NAME(1) NNAAMMEE ssttrriinngg--nnaammee - torturing .ds with weird string names DDEESSCCRRIIPPTTIIOONN norm: value of norm norm without closing brace: quot: "quot": value of "quot" bs\\e: value of bs\\e bse: bs: bl e: ble: bl: OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/string/name.out_lint010064400017530001753000000020761313667013200217730ustar00schwarzeschwarzemandoc: name.in:11:5: ERROR: escaped character not allowed in a name: bs\e mandoc: name.in:13:5: ERROR: escaped character not allowed in a name: bl\ mandoc: name.in:16:29: WARNING: invalid escape sequence: \*[norm mandoc: name.in:16:29: WARNING: undefined string, using "": norm mandoc: name.in:16:28: STYLE: whitespace at end of input line mandoc: name.in:18:7: WARNING: undefined string, using "": quot mandoc: name.in:18:6: STYLE: whitespace at end of input line mandoc: name.in:26:6: WARNING: undefined string, using "": bse mandoc: name.in:26:5: STYLE: whitespace at end of input line mandoc: name.in:28:5: WARNING: undefined string, using "": bs mandoc: name.in:28:4: STYLE: whitespace at end of input line mandoc: name.in:32:7: WARNING: undefined string, using "": bl e mandoc: name.in:32:6: STYLE: whitespace at end of input line mandoc: name.in:34:6: WARNING: undefined string, using "": ble mandoc: name.in:34:5: STYLE: whitespace at end of input line mandoc: name.in:36:5: WARNING: undefined string, using "": bl mandoc: name.in:36:4: STYLE: whitespace at end of input line mandoc-1.14.6/regress/roff/string/zerolength.in010064400017530001753000000005071313667013200220020ustar00schwarzeschwarze.\" $OpenBSD: zerolength.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH STRING-ZEROLENGTH 1 "December 19, 2010" .SH NAME string-zerolength - handling of zero-length user-defined strings .SH DESCRIPTION .ds dszero " .de dezero .. use zero-length string: x\*[dszero]x .dszero x .PP use zero-length macro: x\*[dezero]x .dezero x mandoc-1.14.6/regress/roff/string/zerolength.out_ascii010064400017530001753000000005401412140003700233360ustar00schwarzeschwarzeSTRING-ZEROLENGTH(1) General Commands Manual STRING-ZEROLENGTH(1) NNAAMMEE string-zerolength - handling of zero-length user-defined strings DDEESSCCRRIIPPTTIIOONN use zero-length string: xx x use zero-length macro: xx x OpenBSD December 19, 2010 STRING-ZEROLENGTH(1) mandoc-1.14.6/regress/roff/string/std.in010064400017530001753000000004321312673167000204140ustar00schwarzeschwarze.\" $OpenBSD: std.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH STRING-STD 1 "June 18, 2017" .SH NAME string-std - expanding standard macros as strings .SH DESCRIPTION expanding the DT macro as a string: >>>\*[DT]<<< .PP .rn DT myname the same after renaming it: >>>\*[myname]<<< mandoc-1.14.6/regress/roff/string/std.out_ascii010064400017530001753000000005461412140003700217550ustar00schwarzeschwarzeSTRING-STD(1) General Commands Manual STRING-STD(1) NNAAMMEE string-std - expanding standard macros as strings DDEESSCCRRIIPPTTIIOONN expanding the DT macro as a string: >>><<< the same after renaming it: >>><<< OpenBSD June 18, 2017 STRING-STD(1) mandoc-1.14.6/regress/roff/string/std.out_lint010064400017530001753000000001751312673167000216470ustar00schwarzeschwarzemandoc: std.in:7:4: WARNING: undefined string, using "": DT mandoc: std.in:11:4: WARNING: undefined string, using "": myname mandoc-1.14.6/regress/roff/string/undef.in010064400017530001753000000023151326255021700207220ustar00schwarzeschwarze.\" $OpenBSD: std.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH STRING-UNDEF 1 "April 9, 2018" .SH NAME string-undef - expanding undefined strings .SH DESCRIPTION .SS User defined string The sting "mys" is .ie dmys defined .el undefined and remains .ie dmys defined. .el undefined. .PP Its value is "\*[mys]", and now it is .ie dmys defined, .el undefined, and its value is still "\*[mys]". .PP .ds mys newval After redefining it to "\*[mys]", it is of course still .ie dmys defined. .el undefined. .PP .rm mys After removing the definition, it is now .ie dmys defined. .el undefined. .SS User defined macro The macro "mym" is .ie dmym defined. .el undefined. .PP It has no effect: .mym But now it is .ie dmym defined. .el undefined. .PP .de mym neweffect .. After defining it as: .mym it is of course still .ie dmym defined. .el undefined. .PP .rm mym After removing the definition, it is now .ie dmym defined. .el undefined. .SS Renamed macro The standard .BR macro is .ie dBR defined, .el undefined, and it .BR works . .PP .rn BR newBR After renaming it, the new name is .ie dnewBR defined, .el undefined, and .newBR works . .SS Predefined string A predefined string is .ie dR defined .el undefined and has the value "\*R". mandoc-1.14.6/regress/roff/string/undef.out_ascii010064400017530001753000000021771412140003700222660ustar00schwarzeschwarzeSTRING-UNDEF(1) General Commands Manual STRING-UNDEF(1) NNAAMMEE string-undef - expanding undefined strings DDEESSCCRRIIPPTTIIOONN UUsseerr ddeeffiinneedd ssttrriinngg The sting "mys" is undefined and remains undefined. Its value is "", and now it is defined, and its value is still "". After redefining it to "newval", it is of course still defined. After removing the definition, it is now undefined. UUsseerr ddeeffiinneedd mmaaccrroo The macro "mym" is undefined. It has no effect: But now it is defined. After defining it as: neweffect it is of course still defined. After removing the definition, it is now undefined. RReennaammeedd mmaaccrroo The standard .BR macro is defined, and it wwoorrkkss. After renaming it, the new name is defined, and wwoorrkkss. PPrreeddeeffiinneedd ssttrriinngg A predefined string is defined and has the value "(R)". OpenBSD April 9, 2018 STRING-UNDEF(1) mandoc-1.14.6/regress/roff/string/undef.out_lint010064400017530001753000000001741326255021700221520ustar00schwarzeschwarzemandoc: undef.in:14:15: WARNING: undefined string, using "": mys mandoc: undef.in:34:2: ERROR: skipping unknown macro: .mym mandoc-1.14.6/regress/roff/string/dotT.in010064400017530001753000000006221374632357600205470ustar00schwarzeschwarze.\" $OpenBSD: dotT.in,v 1.3 2020/10/24 22:52:34 schwarze Exp $ .Dd $Mdocdate: October 24 2020 $ .Dt STRING-DOTT 1 .Os .Sh NAME .Nm string-dotT .Nd interpolating the device name .Sh DESCRIPTION BEGINTEST .Pp We are using the \*(.T device. It can also be written as the \*[.T] device. .Pp .ds .T name The device \*(.T can be overridden. Both escape forms work for the \*[.T]. .nf ENDTEST .br end of file mandoc-1.14.6/regress/roff/string/dotT.out_ascii010064400017530001753000000007521374632357600221240ustar00schwarzeschwarzeSTRING-DOTT(1) General Commands Manual STRING-DOTT(1) NNAAMMEE ssttrriinngg--ddoottTT - interpolating the device name DDEESSCCRRIIPPTTIIOONN BEGINTEST We are using the ascii device. It can also be written as the ascii device. The device name can be overridden. Both escape forms work for the name. ENDTEST end of file OpenBSD October 24, 2020 OpenBSD mandoc-1.14.6/regress/roff/string/dotT.out_html010064400017530001753000000002751374632357600220000ustar00schwarzeschwarze

We are using the html device. It can also be written as the html device.

The device name can be overridden. Both escape forms work for the name.

mandoc-1.14.6/regress/roff/string/dotT.out_markdown010064400017530001753000000005131374632357600226510ustar00schwarzeschwarzeSTRING-DOTT(1) - General Commands Manual # NAME **string-dotT** - interpolating the device name # DESCRIPTION BEGINTEST We are using the markdown device. It can also be written as the markdown device. The device name can be overridden. Both escape forms work for the name. ENDTEST end of file OpenBSD - October 24, 2020 mandoc-1.14.6/regress/roff/string/dotT.out_utf8010064400017530001753000000007451374632357600217240ustar00schwarzeschwarzeSTRING-DOTT(1) General Commands Manual STRING-DOTT(1) NNAAMMEE ssttrriinngg--ddoottTT – interpolating the device name DDEESSCCRRIIPPTTIIOONN BEGINTEST We are using the utf8 device. It can also be written as the utf8 device. The device name can be overridden. Both escape forms work for the name. ENDTEST end of file OpenBSD October 24, 2020 OpenBSD mandoc-1.14.6/regress/roff/tr004075500017530001753000000000001412314056700163335ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/tr/Makefile010064400017530001753000000002071304650520000200360ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2015/02/06 16:05:51 schwarze Exp $ REGRESS_TARGETS = args LINT_TARGETS = args .include mandoc-1.14.6/regress/roff/tr/args.in010064400017530001753000000004251313667013200176730ustar00schwarzeschwarze.\" $OpenBSD: args.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TR-BASIC 1 "February 6, 2015" .SH NAME tr-args \- arguments of the tr request .SH DESCRIPTION no argument: .tr one character: .tr x >>x<< two characters: .tr xy >>x<< three characters: .tr xyz >>xz<< last line mandoc-1.14.6/regress/roff/tr/args.out_ascii010064400017530001753000000005461412140003700212360ustar00schwarzeschwarzeTR-BASIC(1) General Commands Manual TR-BASIC(1) NNAAMMEE tr-args - arguments of the tr request DDEESSCCRRIIPPTTIIOONN no argument: one character: >> << two characters: >>y<< three characters: >>y << last line OpenBSD February 6, 2015 TR-BASIC(1) mandoc-1.14.6/regress/roff/tr/args.out_lint010064400017530001753000000003121313667013200211150ustar00schwarzeschwarzemandoc: args.in:7:2: WARNING: skipping empty request: tr mandoc: args.in:9:5: WARNING: odd number of characters in request: tr x mandoc: args.in:15:7: WARNING: odd number of characters in request: tr z mandoc-1.14.6/regress/roff/po004075500017530001753000000000001412314056700163245ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/po/Makefile010064400017530001753000000005711374160571200200460ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2020/09/03 20:33:20 schwarze Exp $ REGRESS_TARGETS = basic-mdoc range # groff-1.22.4 defect: # - Negative page objects sometimes result in output lines starting # with backspace characters. # - Excessive page offsets cause excessive line lengths # instead of being truncated to resonable widths. SKIP_GROFF = range .include mandoc-1.14.6/regress/roff/po/basic-mdoc.in010064400017530001753000000004641312673166200207410ustar00schwarzeschwarze.\" $OpenBSD: basic-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt PO-BASIC-MDOC 1 .Os .Sh NAME .Nm po-basic-mdoc .Nd the roff page offset request .Sh DESCRIPTION initial text .Pp .po -2n shifted left .Pp .po +5n shifted right .Pp .po XXX shifted left .Pp .po 0 final text mandoc-1.14.6/regress/roff/po/basic-mdoc.out_ascii010064400017530001753000000005701312673166200223100ustar00schwarzeschwarzePO-BASIC-MDOC(1) General Commands Manual PO-BASIC-MDOC(1) NNAAMMEE ppoo--bbaassiicc--mmddoocc - the roff page offset request DDEESSCCRRIIPPTTIIOONN initial text shifted left shifted right shifted left final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/po/range.in010064400017530001753000000004761372425254400200400ustar00schwarzeschwarze.\" $OpenBSD: range.in,v 1.1 2020/09/03 20:33:20 schwarze Exp $ .Dd $Mdocdate: September 3 2020 $ .Dt PO-RANGE 1 .Os .Sh NAME .Nm po-range .Nd page offsets out of range .Sh DESCRIPTION initial text .Pp .po -10n too small .Pp .po +10n back in range .Pp .po 80n too large .Pp .po -70n back in range .Pp .po 0 final text mandoc-1.14.6/regress/roff/po/range.out_ascii010064400017530001753000000006661372425254400214120ustar00schwarzeschwarzePO-RANGE(1) General Commands Manual PO-RANGE(1) NNAAMMEE ppoo--rraannggee - page offsets out of range DDEESSCCRRIIPPTTIIOONN initial text too small back in range too large back in range final text OpenBSD September 3, 2020 OpenBSD mandoc-1.14.6/regress/roff/rn004075500017530001753000000000001412314056700163255ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/rn/Makefile010064400017530001753000000002141343772345500200500ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2019/02/06 20:54:28 schwarze Exp $ REGRESS_TARGETS = append tab LINT_TARGETS = tab .include mandoc-1.14.6/regress/roff/rn/append.in010064400017530001753000000005641312673166500202140ustar00schwarzeschwarze.\" $OpenBSD: append.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt RN-APPEND 1 .Os .Sh NAME .Nm rn-append .Nd append to renamed standard macro .Sh DESCRIPTION original macro: .Bo in brackets .Bc .Pp renamed macro: .rn Bc myBc .Bo in brackets .myBc .Pp appending to macro: .am myBc .Pq appended words .. .Bo more in brackets .myBc final text mandoc-1.14.6/regress/roff/rn/append.out_ascii010064400017530001753000000006431312673166500215630ustar00schwarzeschwarzeRN-APPEND(1) General Commands Manual RN-APPEND(1) NNAAMMEE rrnn--aappppeenndd - append to renamed standard macro DDEESSCCRRIIPPTTIIOONN original macro: [in brackets] renamed macro: [in brackets] appending to macro: [more in brackets] (appended words) final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/rn/tab.in010064400017530001753000000010371342664662400175120ustar00schwarzeschwarze.\" $OpenBSD: tab.in,v 1.1 2019/02/06 20:54:28 schwarze Exp $ .Dd $Mdocdate: February 6 2019 $ .Dt RN-TAB 1 .Os .Sh NAME .Nm rn-tab .Nd tab characters in macro renaming requests .Sh DESCRIPTION .de test1 testval .. trying to rename with a tab between the names: .rn test1 test2 .br calling the macro with the old name: .test1 .br calling the macro with the new name: .test2 .Pp trying to rename with a tab after the names: .rn test1 test2 ignored .br calling the macro with the old name: .test1 .br calling the macro with the new name: .test2 mandoc-1.14.6/regress/roff/rn/tab.out_ascii010064400017530001753000000010631342664662400210620ustar00schwarzeschwarzeRN-TAB(1) General Commands Manual RN-TAB(1) NNAAMMEE rrnn--ttaabb - tab characters in macro renaming requests DDEESSCCRRIIPPTTIIOONN trying to rename with a tab between the names: calling the macro with the old name: testval calling the macro with the new name: trying to rename with a tab after the names: calling the macro with the old name: calling the macro with the new name: testval OpenBSD February 6, 2019 OpenBSD mandoc-1.14.6/regress/roff/rn/tab.out_lint010064400017530001753000000001661342664662400207430ustar00schwarzeschwarzemandoc: tab.in:19:2: ERROR: skipping unknown macro: .test2 mandoc: tab.in:25:2: ERROR: skipping unknown macro: .test1 mandoc-1.14.6/regress/roff/ta004075500017530001753000000000001412314056700163125ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/ta/Makefile010064400017530001753000000001171310365500300200160ustar00schwarzeschwarze# $OpenBSD$ REGRESS_TARGETS = basic-mdoc basic-man .include mandoc-1.14.6/regress/roff/ta/basic-man.in010064400017530001753000000005541312673167100205600ustar00schwarzeschwarze.\" $OpenBSD: basic-man.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH TA-BASIC-MAN 1 "May 7, 2014" .SH NAME ta-basic-man \- setting tabstop positions in man(7) .SH DESCRIPTION .nf default: 1 2 3 10n: .ta 10n 1 2 3 none: .ta 1 2 3 3n +6n T 4n +2n: .ta 3n +6n T 4n +2n 1 2 3 4 5 6 7 8 9 default unit: .ta 3 +4 12 1 2 3 4 rounding: .ta 0.26i T 1c 1 2 3 4 5 6 7 8 9 mandoc-1.14.6/regress/roff/ta/basic-man.out_ascii010064400017530001753000000010041412140003700221010ustar00schwarzeschwarzeTA-BASIC-MAN(1) General Commands Manual TA-BASIC-MAN(1) NNAAMMEE ta-basic-man - setting tabstop positions in man(7) DDEESSCCRRIIPPTTIIOONN default: 1 2 3 10n: 1 23 none: 123 3n +6n T 4n +2n: 1 2 3 4 5 6 7 8 9 default unit: 1 2 3 4 rounding: 1 2 3 4 5 6 7 8 9 OpenBSD May 7, 2014 TA-BASIC-MAN(1) mandoc-1.14.6/regress/roff/ta/basic-mdoc.in010064400017530001753000000006751312673167100207330ustar00schwarzeschwarze.\" $OpenBSD: basic-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TA-BASIC-MDOC 1 .Os .Sh NAME .Nm ta-basic-mdoc .Nd setting tabstop positions in mdoc(7) .Sh DESCRIPTION .Bd -unfilled default: 1 2 3 10n: .ta 10n 1 2 3 none: .ta 1 2 3 3n +6n T 4n +2n: .ta 3n +6n T 4n +2n 1 2 3 4 5 6 7 8 9 .Ed .Pp literal: .Bd -literal -compact 1 2 3 .Ed .Pp after literal: .br 1 2 3 .Pp default unit: .br .ta 3 +4 12 1 2 3 4 mandoc-1.14.6/regress/roff/ta/basic-mdoc.out_ascii010064400017530001753000000010441312673167100222730ustar00schwarzeschwarzeTA-BASIC-MDOC(1) General Commands Manual TA-BASIC-MDOC(1) NNAAMMEE ttaa--bbaassiicc--mmddoocc - setting tabstop positions in mdoc(7) DDEESSCCRRIIPPTTIIOONN default: 1 2 3 10n: 1 23 none: 123 3n +6n T 4n +2n: 1 2 3 4 5 6 7 8 9 literal: 1 2 3 after literal: 1 2 3 default unit: 1 2 3 4 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ti004075500017530001753000000000001412314056700163225ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/ti/Makefile010064400017530001753000000004571374160571200200470ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2020/09/03 17:37:06 schwarze Exp $ REGRESS_TARGETS = basic-mdoc basic-man wide # groff-1.22.4 defect: # - Excessive temporare indentations cause excessive line lengths # instead of being truncated to resonable indentations. SKIP_GROFF = wide .include mandoc-1.14.6/regress/roff/ti/basic-man.in010064400017530001753000000011501312673167200205620ustar00schwarzeschwarze.\" $OpenBSD: basic-man.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH TI-BASIC-MAN 1 "May 8, 2014" .SH NAME ti-basic-man \- temporary indentation in man(7) .SH DESCRIPTION initial text .ti 0.96i This text is indented. However, the indent is temporary, so as soon as the line wraps, it is gone. .ti +10n The temporary indent can be relative. All the same, it will expire in the usual way. .ti -0.26i It is also possible to temporarily reduce the indentation, but that will also last until the next line break only. .ti -10n Reducing by more than the current offset starts the next line at the physical left margin. mandoc-1.14.6/regress/roff/ti/basic-man.out_ascii010064400017530001753000000013351412140003700221200ustar00schwarzeschwarzeTI-BASIC-MAN(1) General Commands Manual TI-BASIC-MAN(1) NNAAMMEE ti-basic-man - temporary indentation in man(7) DDEESSCCRRIIPPTTIIOONN initial text This text is indented. However, the indent is temporary, so as soon as the line wraps, it is gone. The temporary indent can be relative. All the same, it will expire in the usual way. It is also possible to temporarily reduce the indentation, but that will also last until the next line break only. Reducing by more than the current offset starts the next line at the physical left margin. OpenBSD May 8, 2014 TI-BASIC-MAN(1) mandoc-1.14.6/regress/roff/ti/basic-mdoc.in010064400017530001753000000011721312673167200207350ustar00schwarzeschwarze.\" $OpenBSD: basic-mdoc.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TI-BASIC-MDOC 1 .Os .Sh NAME .Nm ti-basic-mdoc .Nd temporary indent in mdoc(7) .Sh DESCRIPTION initial text .ti 10n This text is indented. However, the indent is temporary, so as soon as the line wraps, it is gone. .ti +10n The temporary indent can be relative. All the same, it will expire in the usual way. .ti -3n It is also possible to temporarily reduce the indentation, but that will also last until the next line break only. .ti -10n Reducing by more than the current offset starts the next line at the physical left margin. mandoc-1.14.6/regress/roff/ti/basic-mdoc.out_ascii010064400017530001753000000013441312673167200223070ustar00schwarzeschwarzeTI-BASIC-MDOC(1) General Commands Manual TI-BASIC-MDOC(1) NNAAMMEE ttii--bbaassiicc--mmddoocc - temporary indent in mdoc(7) DDEESSCCRRIIPPTTIIOONN initial text This text is indented. However, the indent is temporary, so as soon as the line wraps, it is gone. The temporary indent can be relative. All the same, it will expire in the usual way. It is also possible to temporarily reduce the indentation, but that will also last until the next line break only. Reducing by more than the current offset starts the next line at the physical left margin. OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/roff/ti/wide.in010064400017530001753000000005301372422537000176560ustar00schwarzeschwarze.\" $OpenBSD: wide.in,v 1.1 2020/09/03 17:37:06 schwarze Exp $ .TH TI-WIDE 1 "September 3, 2020" .SH NAME ti-wide \- excessive temporary indentation .SH DESCRIPTION Absolute .ti of more than 72n: .ti 80n max .RS 40n Indented block plus excessive relative indentation: .ti +40n max .RE .RS 66n Block beyond 72n: .ti +4n same .RE Back to normal. mandoc-1.14.6/regress/roff/ti/wide.out_ascii010064400017530001753000000016431412140003700212200ustar00schwarzeschwarzeTI-WIDE(1) General Commands Manual TI-WIDE(1) NNAAMMEE ti-wide - excessive temporary indentation DDEESSCCRRIIPPTTIIOONN Absolute .ti of more than 72n: max Indented block plus excessive relative indentation: max Block beyond 72n: same Back to normal. OpenBSD September 3, 2020 TI-WIDE(1) mandoc-1.14.6/regress/roff/char004075500017530001753000000000001412314056700166235ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/char/Makefile010064400017530001753000000002171334030462400203330ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2018/08/25 16:43:52 schwarze Exp $ REGRESS_TARGETS = basic badarg LINT_TARGETS = badarg .include mandoc-1.14.6/regress/roff/char/badarg.in010064400017530001753000000003751334030462400204500ustar00schwarzeschwarze.\" $OpenBSD: badarg.in,v 1.1 2018/08/25 16:43:52 schwarze Exp $ .TH CHAR-BADARG 1 "August 25, 2018" .SH NAME char-badarg \(en char requests with invalid arguments .SH DESCRIPTION .char .char \fR myval .char \[myc]x myval .char xy myval myc: <\[myc]> x mandoc-1.14.6/regress/roff/char/badarg.out_ascii010064400017530001753000000004331412140003600220040ustar00schwarzeschwarzeCHAR-BADARG(1) General Commands Manual CHAR-BADARG(1) NNAAMMEE char-badarg - char requests with invalid arguments DDEESSCCRRIIPPTTIIOONN myc: <> x OpenBSD August 25, 2018 CHAR-BADARG(1) mandoc-1.14.6/regress/roff/char/badarg.out_lint010064400017530001753000000006431334030462400216750ustar00schwarzeschwarzemandoc: badarg.in:6:6: ERROR: argument is not a character: char mandoc: badarg.in:7:7: ERROR: argument is not a character: char \fR myval mandoc: badarg.in:8:7: WARNING: invalid escape sequence: \[myc] mandoc: badarg.in:8:7: ERROR: argument is not a character: char \[myc]x myval mandoc: badarg.in:9:7: ERROR: argument is not a character: char xy myval mandoc: badarg.in:10:7: WARNING: invalid escape sequence: \[myc] mandoc-1.14.6/regress/roff/char/basic.in010064400017530001753000000003661334030462400203110ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.1 2018/08/25 16:43:52 schwarze Exp $ .TH CHAR-BASIC 1 "August 25, 2018" .SH NAME char-basic \(en the char request .SH DESCRIPTION initial text .char \[myc] myval .char x y .char \[boldX] \fBX \[boldX] \[myc] final text mandoc-1.14.6/regress/roff/char/basic.out_ascii010064400017530001753000000004361412140003600216500ustar00schwarzeschwarzeCHAR-BASIC(1) General Commands Manual CHAR-BASIC(1) NNAAMMEE char-basic - the char request DDEESSCCRRIIPPTTIIOONN initial text XX myval final teyt OpenBSD August 25, 2018 CHAR-BASIC(1) mandoc-1.14.6/regress/roff/return004075500017530001753000000000001412314056700172255ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/return/Makefile010064400017530001753000000002071333754232600207450ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2018/08/23 14:16:12 schwarze Exp $ REGRESS_TARGETS = basic LINT_TARGETS = basic .include mandoc-1.14.6/regress/roff/return/basic.in010064400017530001753000000006111333754232600207150ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.1 2018/08/23 14:16:12 schwarze Exp $ .Dd $Mdocdate: August 23 2018 $ .Dt RETURN-BASIC 1 .Os .Sh NAME .Nm return-basic .Nd the return request .Sh DESCRIPTION return before macro .return .Pp .de mymacro text from macro (\\n(.$ argument: "\\$1"), .return not printed, .. .mymacro myarg \n(.$ arguments after return: "\$1", .Pp return after macro .return .Pp final text mandoc-1.14.6/regress/roff/return/basic.out_ascii010064400017530001753000000006351333754232600222740ustar00schwarzeschwarzeRETURN-BASIC(1) General Commands Manual RETURN-BASIC(1) NNAAMMEE rreettuurrnn--bbaassiicc - the return request DDEESSCCRRIIPPTTIIOONN return before macro text from macro (1 argument: "myarg"), 0 arguments after return: "", return after macro final text OpenBSD August 23, 2018 OpenBSD mandoc-1.14.6/regress/roff/return/basic.out_lint010064400017530001753000000003211333754232600221420ustar00schwarzeschwarzemandoc: basic.in:10:2: ERROR: ignoring request outside macro: return mandoc: basic.in:18:32: ERROR: using macro argument outside macro: \$1 mandoc: basic.in:21:2: ERROR: ignoring request outside macro: return mandoc-1.14.6/regress/roff/shift004075500017530001753000000000001412314056700170235ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/shift/Makefile010064400017530001753000000002111333754232600205360ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2018/08/23 14:16:12 schwarze Exp $ REGRESS_TARGETS = basic bad LINT_TARGETS = bad .include mandoc-1.14.6/regress/roff/shift/bad.in010064400017530001753000000007521333754232600201660ustar00schwarzeschwarze.\" $OpenBSD: bad.in,v 1.1 2018/08/23 14:16:12 schwarze Exp $ .TH SHIFT_BAD 1 "August 23, 2018" .SH NAME .B shift-bad \(en wrong usage of macro arguments .SH DESCRIPTION initial text .de mym in macro: "\\$1" .PP invalid argument number 'x': "\\$x" .. .PP argument used before call: "\$1" .shift .PP .mym argument .PP argument used after call: "\$1" .shift 2 .PP .de mym .shift badarg after shift badarg: "\\$1" .shift 2 after excessive shift: \\n(.$ "\\$1" .. .mym arg1 arg2 .PP final text mandoc-1.14.6/regress/roff/shift/bad.out_ascii010064400017530001753000000010121412140003700215050ustar00schwarzeschwarzeSHIFT_BAD(1) General Commands Manual SHIFT_BAD(1) NNAAMMEE sshhiifftt--bbaadd - wrong usage of macro arguments DDEESSCCRRIIPPTTIIOONN initial text argument used before call: "" in macro: "argument" invalid argument number 'x': "" argument used after call: "" after shift badarg: "arg2" after excessive shift: 0 "" final text OpenBSD August 23, 2018 SHIFT_BAD(1) mandoc-1.14.6/regress/roff/shift/bad.out_lint010064400017530001753000000007271333754232600214170ustar00schwarzeschwarzemandoc: bad.in:14:29: ERROR: using macro argument outside macro: \$1 mandoc: bad.in:15:2: ERROR: ignoring request outside macro: shift mandoc: bad.in:17:31: ERROR: argument number is not numeric: \$x mandoc: bad.in:19:28: ERROR: using macro argument outside macro: \$1 mandoc: bad.in:20:2: ERROR: ignoring request outside macro: shift mandoc: bad.in:28:8: ERROR: argument is not numeric, using 1: shift badarg mandoc: bad.in:28:9: ERROR: excessive shift: 2, but max is 1 mandoc-1.14.6/regress/roff/shift/basic.in010064400017530001753000000010671333754232600205210ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.1 2018/08/23 14:16:12 schwarze Exp $ .TH SHIFT_BASIC 1 "August 23, 2018" .SH NAME .B shift-basic \(en the shift request .SH DESCRIPTION .de showargs original arguments: .BI \\$@ .PP .shift 2 after shift 2: .BI \\$@ .PP .shift after shift without argument: .BI \\$@ .PP .shift 0 after shift 0: .BI \\$@ .. .de useargs <\\$*> .. .showargs one two three four five .PP expand to less than three bytes: .useargs 1 .PP expand to exactly three bytes: .useargs x y .PP expand to more than three bytes: .useargs "a longer argument..." "and another" mandoc-1.14.6/regress/roff/shift/basic.out_ascii010064400017530001753000000012661412140003700220530ustar00schwarzeschwarzeSHIFT_BASIC(1) General Commands Manual SHIFT_BASIC(1) NNAAMMEE sshhiifftt--bbaassiicc - the shift request DDEESSCCRRIIPPTTIIOONN original arguments: oonnee_t_w_otthhrreeee_f_o_u_rffiivvee after shift 2: tthhrreeee_f_o_u_rffiivvee after shift without argument: ffoouurr_f_i_v_e after shift 0: ffoouurr_f_i_v_e expand to less than three bytes: <1> expand to exactly three bytes: expand to more than three bytes: OpenBSD August 23, 2018 SHIFT_BASIC(1) mandoc-1.14.6/regress/roff/while004075500017530001753000000000001412314056700170165ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/while/Makefile010064400017530001753000000006641363444077300205500ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2019/04/21 22:43:00 schwarze Exp $ REGRESS_TARGETS = basic badargs break into nesting outof LINT_TARGETS = badargs into nesting outof # mandoc defects: # - if a while loop extends into a scope, mandoc may close it there # - mandoc does not support nested .while loops # - mandoc does not support .while loops extending out of the current scope SKIP_GROFF = into nesting outof .include mandoc-1.14.6/regress/roff/while/badargs.in010064400017530001753000000004541334011034300210150ustar00schwarzeschwarze.\" $OpenBSD: badargs.in,v 1.1 2018/08/24 22:56:37 schwarze Exp $ .Dd $Mdocdate: August 24 2018 $ .Dt WHILE-BADARGS 1 .Os .Sh NAME .Nm while-badargs .Nd dubious arguments for the while request .Sh DESCRIPTION while does not support next line scope: .nr cnt 2 1 .while \n-[cnt] \n[cnt] .Pp final text mandoc-1.14.6/regress/roff/while/badargs.out_ascii010064400017530001753000000005551334011034300223700ustar00schwarzeschwarzeWHILE-BADARGS(1) General Commands Manual WHILE-BADARGS(1) NNAAMMEE wwhhiillee--bbaaddaarrggss - dubious arguments for the while request DDEESSCCRRIIPPTTIIOONN while does not support next line scope: 0 final text OpenBSD August 24, 2018 OpenBSD mandoc-1.14.6/regress/roff/while/badargs.out_lint010064400017530001753000000003511334011034300222400ustar00schwarzeschwarzemandoc: badargs.in:11:2: WARNING: conditional request controls empty scope: while mandoc: badargs.in:11:9: WARNING: blank line in fill mode, using .sp mandoc: badargs.in:11:2: WARNING: conditional request controls empty scope: while mandoc-1.14.6/regress/roff/while/basic.in010064400017530001753000000007551334011034300204770ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.1 2018/08/24 22:56:37 schwarze Exp $ .Dd $Mdocdate: August 24 2018 $ .Dt WHILE-BASIC 1 .Os .Sh NAME .Nm while-basic .Nd the while request .Sh DESCRIPTION Loop with single-line scope: .nr cnt 11 1 .de mym \\n-[cnt] .. .while \n[cnt] .mym .Pp Loop with multi-line scope, text line closure: .nr cnt 11 .while \n[cnt] \{\ .nr cnt -1 \n[cnt]\}, boom. .Pp Loop with multi-line scope, macro line closure: .nr cnt 11 .while \n[cnt] \{\ .nr cnt -1 \n[cnt] .\} .Pp final text mandoc-1.14.6/regress/roff/while/basic.out_ascii010064400017530001753000000010041334011034300220340ustar00schwarzeschwarzeWHILE-BASIC(1) General Commands Manual WHILE-BASIC(1) NNAAMMEE wwhhiillee--bbaassiicc - the while request DDEESSCCRRIIPPTTIIOONN Loop with single-line scope: 10 9 8 7 6 5 4 3 2 1 0 Loop with multi-line scope, text line closure: 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, boom. Loop with multi-line scope, macro line closure: 10 9 8 7 6 5 4 3 2 1 0 final text OpenBSD August 24, 2018 OpenBSD mandoc-1.14.6/regress/roff/while/into.in010064400017530001753000000004761334011034300203670ustar00schwarzeschwarze.\" $OpenBSD: into.in,v 1.1 2018/08/24 22:56:37 schwarze Exp $ .Dd $Mdocdate: August 24 2018 $ .Dt WHILE-INTO 1 .Os .Sh NAME .Nm while-into .Nd while request extending into a macro .Sh DESCRIPTION .nr cnt 10 .de closeloop .nr cnt -1 .\} .. initial text .while \n[cnt] \{\ \n[cnt] .closeloop after macro .\} final text mandoc-1.14.6/regress/roff/while/into.out_ascii010064400017530001753000000005071334011034300217330ustar00schwarzeschwarzeWHILE-INTO(1) General Commands Manual WHILE-INTO(1) NNAAMMEE wwhhiillee--iinnttoo - while request extending into a macro DDEESSCCRRIIPPTTIIOONN initial text 10 after macro final text OpenBSD August 24, 2018 OpenBSD mandoc-1.14.6/regress/roff/while/into.out_lint010064400017530001753000000002011334011034300216000ustar00schwarzeschwarzemandoc: into.in:17:5: UNSUPP: end of .while loop in inner scope mandoc: into.in:20:1: UNSUPP: end of scope with open .while loop mandoc-1.14.6/regress/roff/while/nesting.in010064400017530001753000000005071334011034300210600ustar00schwarzeschwarze.\" $OpenBSD: nesting.in,v 1.1 2018/08/24 22:56:37 schwarze Exp $ .Dd $Mdocdate: August 24 2018 $ .Dt WHILE-NESTING 1 .Os .Sh NAME .Nm while-nesting .Nd nested while requests .Sh DESCRIPTION initial text .nr c1 3 .while \n(c1 \{\ . nr c2 3 . while \n(c2 \{\ . nop \n(c1\n(c2 . nr c2 -1 . \} . nr c1 -1 .\} final text mandoc-1.14.6/regress/roff/while/nesting.out_ascii010064400017530001753000000004731334011034300224330ustar00schwarzeschwarzeWHILE-NESTING(1) General Commands Manual WHILE-NESTING(1) NNAAMMEE wwhhiillee--nneessttiinngg - nested while requests DDEESSCCRRIIPPTTIIOONN initial text 33 32 31 final text OpenBSD August 24, 2018 OpenBSD mandoc-1.14.6/regress/roff/while/nesting.out_lint010064400017530001753000000001701334011034300223030ustar00schwarzeschwarzemandoc: nesting.in:14:37: UNSUPP: nested .while loops mandoc: nesting.in:18:4: UNSUPP: cannot continue this .while loop mandoc-1.14.6/regress/roff/while/outof.in010064400017530001753000000004611334011034300205440ustar00schwarzeschwarze.\" $OpenBSD: outof.in,v 1.1 2018/08/24 22:56:37 schwarze Exp $ .Dd $Mdocdate: August 24 2018 $ .Dt WHILE-OUTOF 1 .Os .Sh NAME .Nm while-outof .Nd while request starting in a macro .Sh DESCRIPTION .nr cnt 10 .de mym . while \\n[cnt] \{\ . nop \\n[cnt] .. initial text .mym . nr cnt -1 .\} final text mandoc-1.14.6/regress/roff/while/outof.out_ascii010064400017530001753000000004731334011034300221200ustar00schwarzeschwarzeWHILE-OUTOF(1) General Commands Manual WHILE-OUTOF(1) NNAAMMEE wwhhiillee--oouuttooff - while request starting in a macro DDEESSCCRRIIPPTTIIOONN initial text 10 final text OpenBSD August 24, 2018 OpenBSD mandoc-1.14.6/regress/roff/while/outof.out_lint010064400017530001753000000002021334011034300217640ustar00schwarzeschwarzemandoc: outof.in:15:1: UNSUPP: end of scope with open .while loop mandoc: outof.in:17:4: UNSUPP: cannot continue this .while loop mandoc-1.14.6/regress/roff/while/break.in010064400017530001753000000004341345717153300205150ustar00schwarzeschwarze.\" $OpenBSD: break.in,v 1.1 2019/04/21 22:43:00 schwarze Exp $ .Dd $Mdocdate: April 21 2019 $ .Dt WHILE-BREAK 1 .Os .Sh NAME .Nm while-break .Nd break request inside a while loop .Sh DESCRIPTION initial text .nr cnt 11 1 .while n \{\ \n-[cnt] .if !\n[cnt] .break \(en .\} final text mandoc-1.14.6/regress/roff/while/break.out_ascii010064400017530001753000000005431345717153300220670ustar00schwarzeschwarzeWHILE-BREAK(1) General Commands Manual WHILE-BREAK(1) NNAAMMEE wwhhiillee--bbrreeaakk - break request inside a while loop DDEESSCCRRIIPPTTIIOONN initial text 10 - 9 - 8 - 7 - 6 - 5 - 4 - 3 - 2 - 1 - 0 final text OpenBSD April 21, 2019 OpenBSD mandoc-1.14.6/regress/roff/ce004075500017530001753000000000001412314056700162755ustar00schwarzeschwarzemandoc-1.14.6/regress/roff/ce/Makefile010064400017530001753000000001631341353130000177770ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.1 2019/01/04 01:06:44 schwarze Exp $ REGRESS_TARGETS = basic .include mandoc-1.14.6/regress/roff/ce/basic.in010064400017530001753000000007061374160571100177670ustar00schwarzeschwarze.\" $OpenBSD: basic.in,v 1.2 2020/09/02 16:36:48 schwarze Exp $ .TH CE-BASIC 1 "September 2, 2020" .SH NAME ce-basic \- basic usage of the centering request .SH DESCRIPTION initial text .ce 2 Text centered with the .ce request is not filled. normal text .rj 2 Text adjusted to the right margin works in just the same way and isn't filled either. .PP .nf Now entering explicit no-fill mode. .ce 2 Text is still not filled. .PP .fi final text in fill mode mandoc-1.14.6/regress/roff/ce/basic.out_ascii010064400017530001753000000013601412140003600213170ustar00schwarzeschwarzeCE-BASIC(1) General Commands Manual CE-BASIC(1) NNAAMMEE ce-basic - basic usage of the centering request DDEESSCCRRIIPPTTIIOONN initial text Text centered with the .ce request is not filled. normal text Text adjusted to the right margin works in just the same way and isn't filled either. Now entering explicit no-fill mode. Text is still not filled. final text in fill mode OpenBSD September 2, 2020 CE-BASIC(1) mandoc-1.14.6/regress/tbl004075500017530001753000000000001412314056700155335ustar00schwarzeschwarzemandoc-1.14.6/regress/tbl/Makefile010064400017530001753000000002301304650520100172330ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.13 2015/01/29 23:34:45 schwarze Exp $ SUBDIR = opt layout mod data macro .include "../Makefile.sub" .include mandoc-1.14.6/regress/tbl/Makefile.inc010064400017530001753000000002201363444077300200210ustar00schwarzeschwarze# $OpenBSD: Makefile.inc,v 1.4 2020/01/08 10:17:15 schwarze Exp $ SKIP_TMAN ?= ALL SKIP_MARKDOWN ?= ALL GOPTS = -t .include "../Makefile.inc" mandoc-1.14.6/regress/tbl/data004075500017530001753000000000001412314056700164445ustar00schwarzeschwarzemandoc-1.14.6/regress/tbl/data/Makefile010064400017530001753000000006321363444077300201710ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.5 2019/07/18 14:38:47 schwarze Exp $ REGRESS_TARGETS = blankline block_empty block_unclosed block_width REGRESS_TARGETS += block_wrap empty insert LINT_TARGETS = block_unclosed empty insert # groff-1.22.3 defect: # - When a table ends in the middle of a block, # GNU eqn produces no output whatsoever for the whole table. SKIP_GROFF = block_unclosed .include mandoc-1.14.6/regress/tbl/data/blankline.in010064400017530001753000000003531313667013200210070ustar00schwarzeschwarze.\" $OpenBSD: blankline.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-DATA-BLANKLINE 1 "January 21, 2015" .SH NAME tbl-data-blankline \- blank line in a table .SH DESCRIPTION normal text .TS lb li lb. first last .TE normal text mandoc-1.14.6/regress/tbl/data/blankline.out_ascii010064400017530001753000000005251412140003700223470ustar00schwarzeschwarzeTBL-DATA-BLANKLINE(1) General Commands Manual TBL-DATA-BLANKLINE(1) NNAAMMEE tbl-data-blankline - blank line in a table DDEESSCCRRIIPPTTIIOONN normal text ffiirrsstt llaasstt normal text OpenBSD January 21, 2015 TBL-DATA-BLANKLINE(1) mandoc-1.14.6/regress/tbl/data/block_unclosed.in010064400017530001753000000006461313667013200220430ustar00schwarzeschwarze.\" $OpenBSD: block_unclosed.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-DATA-BLOCK_UNCLOSED 1 "January 28, 2015" .SH NAME tbl-data-block_unclosed \- unclosed text block .SH DESCRIPTION normal text .TS box tab(:); lll. begin:T{ middle T}:end T{ begin T}:middle:T{ end T} incomplete:T{ block .TE normal text .TS box tab(:); lll. begin:T{ middle T}:end incomplete:T{ block .T& rrr. reset:still:works .TE normal text mandoc-1.14.6/regress/tbl/data/block_unclosed.out_ascii010064400017530001753000000012621412140003700233750ustar00schwarzeschwarzeTBL-DATA-BLOCK_UNCLOSED(1) General Commands Manual TBL-DATA-BLOCK_UNCLOSED(1) NNAAMMEE tbl-data-block_unclosed - unclosed text block DDEESSCCRRIIPPTTIIOONN normal text +--------------------------+ |begin middle end | |begin middle end | |incomplete block | +--------------------------+ normal text +----------------------------+ |begin middle end | |incomplete block | | reset still works | +----------------------------+ normal text OpenBSD January 28, 2015 TBL-DATA-BLOCK_UNCLOSED(1) mandoc-1.14.6/regress/tbl/data/block_unclosed.out_lint010064400017530001753000000002211313667013200232570ustar00schwarzeschwarzemandoc: block_unclosed.in:7:2: ERROR: data block open at end of tbl: TE mandoc: block_unclosed.in:30:2: ERROR: data block open at end of tbl: T& mandoc-1.14.6/regress/tbl/data/empty.in010064400017530001753000000003071313667013200202050ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-DATA-EMPTY 1 "January 28, 2015" .SH NAME tbl-data-empty \- empty table .SH DESCRIPTION normal text .TS box; l. .TE normal text mandoc-1.14.6/regress/tbl/data/empty.out_ascii010064400017530001753000000004331412140003700215440ustar00schwarzeschwarzeTBL-DATA-EMPTY(1) General Commands Manual TBL-DATA-EMPTY(1) NNAAMMEE tbl-data-empty - empty table DDEESSCCRRIIPPTTIIOONN normal text normal text OpenBSD January 28, 2015 TBL-DATA-EMPTY(1) mandoc-1.14.6/regress/tbl/data/empty.out_lint010064400017530001753000000000701313667013200214310ustar00schwarzeschwarzemandoc: empty.in:7:2: ERROR: tbl without any data cells mandoc-1.14.6/regress/tbl/data/block_width.in010064400017530001753000000022341312673167400213510ustar00schwarzeschwarze.\" $OpenBSD: block_width.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TBL-DATA-BLOCK_WIDTH 1 .Os .Sh NAME .Nm tbl-data-block_width .Nd default width of text blocks .Sh DESCRIPTION one column: .TS allbox tab(:); l. T{ 1234567890123456789012345678901234567 9 T} T{ 1234567890123456789012345678901234567 90 T} .TE .sp two columns: .TS allbox tab(:); l l. a:T{ 123456789012345678901234 6 T} a:T{ 123456789012345678901234 67 T} .TE .sp three columns: .TS allbox tab(:); l l l. a:b:T{ 12345678901234567 9 T} a:b:T{ 12345678901234567 90 T} .TE .sp four columns: .TS allbox tab(:); l l l l. a:b:c:T{ 12345678901234 6 T} a:b:c:T{ 12345678901234 67 T} .TE .sp five columns: .TS allbox tab(:); l l l l l. a:b:c:d:T{ 12345678901 3 T} a:b:c:d:T{ 12345678901 34 T} .TE .sp six columns: .TS allbox tab(:); l l l l l l. a:b:c:d:e:T{ 123456789 1 T} a:b:c:d:e:T{ 123456789 12 T} .TE .sp seven columns: .TS allbox tab(:); l l l l l l l. a:b:c:d:e:f:T{ 12345678 0 T} a:b:c:d:e:f:T{ 12345678 01 T} .TE .sp eight columns: .TS allbox tab(:); l l l l l l l l. a:b:c:d:e:f:g:T{ 1234567 9 T} a:b:c:d:e:f:g:T{ 1234567 90 T} .TE .sp leaked tab settings: .br \& b c d e f g h mandoc-1.14.6/regress/tbl/data/block_width.out_ascii010064400017530001753000000046661374632357700227440ustar00schwarzeschwarzeTBL-DATA-BLOCK_WIDTH(1) General Commands Manual TBL-DATA-BLOCK_WIDTH(1) NNAAMMEE ttbbll--ddaattaa--bblloocckk__wwiiddtthh - default width of text blocks DDEESSCCRRIIPPTTIIOONN one column: +----------------------------------------+ |1234567890123456789012345678901234567 9 | +----------------------------------------+ |1234567890123456789012345678901234567 | |90 | +----------------------------------------+ two columns: +--+----------------------------+ |a | 123456789012345678901234 6 | +--+----------------------------+ |a | 123456789012345678901234 | | | 67 | +--+----------------------------+ three columns: +--+---+---------------------+ |a | b | 12345678901234567 9 | +--+---+---------------------+ |a | b | 12345678901234567 | | | | 90 | +--+---+---------------------+ four columns: +--+---+---+------------------+ |a | b | c | 12345678901234 6 | +--+---+---+------------------+ |a | b | c | 12345678901234 | | | | | 67 | +--+---+---+------------------+ five columns: +--+---+---+---+---------------+ |a | b | c | d | 12345678901 3 | +--+---+---+---+---------------+ |a | b | c | d | 12345678901 | | | | | | 34 | +--+---+---+---+---------------+ six columns: +--+---+---+---+---+-------------+ |a | b | c | d | e | 123456789 1 | +--+---+---+---+---+-------------+ |a | b | c | d | e | 123456789 | | | | | | | 12 | +--+---+---+---+---+-------------+ seven columns: +--+---+---+---+---+---+------------+ |a | b | c | d | e | f | 12345678 0 | +--+---+---+---+---+---+------------+ |a | b | c | d | e | f | 12345678 | | | | | | | | 01 | +--+---+---+---+---+---+------------+ eight columns: +--+---+---+---+---+---+---+-----------+ |a | b | c | d | e | f | g | 1234567 9 | +--+---+---+---+---+---+---+-----------+ |a | b | c | d | e | f | g | 1234567 | | | | | | | | | 90 | +--+---+---+---+---+---+---+-----------+ leaked tab settings: b c d e f g h OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/tbl/data/block_wrap.in010064400017530001753000000007361312673167400212100ustar00schwarzeschwarze.\" $OpenBSD: block_wrap.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TBL-DATA-BLOCK_WRAP 1 .Os .Sh NAME .Nm tbl-data-block_wrap .Nd line wrapping in text blocks .Sh DESCRIPTION initial text .TS allbox tab(:); l l. T{ This is a very long sentence. T}:short short:T{ This is an even longer sentence. T} .TE .Pp .TS allbox tab(:); lw10 lw10. T{ This is a very long sentence. T}:short short:T{ This is an even longer sentence. T} .TE .Pp final text mandoc-1.14.6/regress/tbl/data/block_wrap.out_ascii010064400017530001753000000020031312673167400225460ustar00schwarzeschwarzeTBL-DATA-BLOCK_WRAP(1) General Commands Manual TBL-DATA-BLOCK_WRAP(1) NNAAMMEE ttbbll--ddaattaa--bblloocckk__wwrraapp - line wrapping in text blocks DDEESSCCRRIIPPTTIIOONN initial text +--------------------+------------------------+ |This is a very long | short | |sentence. | | +--------------------+------------------------+ |short | This is an even longer | | | sentence. | +--------------------+------------------------+ +-----------+------------+ |This is a | short | |very long | | |sentence. | | +-----------+------------+ |short | This is an | | | even | | | longer | | | sentence. | +-----------+------------+ final text OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/tbl/data/insert.in010064400017530001753000000004771312700171600203570ustar00schwarzeschwarze.\" $OpenBSD: insert.in,v 1.1 2017/07/04 20:59:17 schwarze Exp $ .TH TBL-DATA-INSERT 1 "July 4, 2017" .SH NAME tbl-data-insert \- insertion of empty spans for line-only layout rows .SH DESCRIPTION initial text .TS tab(:); _ _ l l - - l r _ ^ r. colum one:column two left:right not:printed right:left .TE .sp final text mandoc-1.14.6/regress/tbl/data/insert.out_ascii010064400017530001753000000007511412140003700217150ustar00schwarzeschwarzeTBL-DATA-INSERT(1) General Commands Manual TBL-DATA-INSERT(1) NNAAMMEE tbl-data-insert - insertion of empty spans for line-only layout rows DDEESSCCRRIIPPTTIIOONN initial text ----------------------- colum one column two ----------------------- left right ----------- right left final text OpenBSD July 4, 2017 TBL-DATA-INSERT(1) mandoc-1.14.6/regress/tbl/data/insert.out_lint010064400017530001753000000002201312700171600215700ustar00schwarzeschwarzemandoc: insert.in:17:1: ERROR: ignoring data in spanned tbl cell: not mandoc: insert.in:17:5: ERROR: ignoring data in spanned tbl cell: printed mandoc-1.14.6/regress/tbl/data/block_empty.in010064400017530001753000000004341351410260200213500ustar00schwarzeschwarze.\" $OpenBSD: block_empty.in,v 1.1 2019/07/18 14:38:47 schwarze Exp $ .TH TBL-DATA-BLOCK_EMPTY 1 "July 17, 2019" .SH NAME tbl-data-block_empty \- empty text block .SH DESCRIPTION normal text .TS |l|l|. _ A test _ table T{ T} _ .TE .SH AUTHORS .MT rea@FreeBSD.org Eygene Ryabinkin .ME mandoc-1.14.6/regress/tbl/data/block_empty.out_ascii010064400017530001753000000007071412140003700227220ustar00schwarzeschwarzeTBL-DATA-BLOCK_EMPTY(1) General Commands Manual TBL-DATA-BLOCK_EMPTY(1) NNAAMMEE tbl-data-block_empty - empty text block DDEESSCCRRIIPPTTIIOONN normal text +------+------+ |A | test | +------+------+ |table | | +------+------+ AAUUTTHHOORRSS Eygene Ryabinkin OpenBSD July 17, 2019 TBL-DATA-BLOCK_EMPTY(1) mandoc-1.14.6/regress/tbl/layout004075500017530001753000000000001412314056700170505ustar00schwarzeschwarzemandoc-1.14.6/regress/tbl/layout/Makefile010064400017530001753000000012571412140003700205560ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.8 2021/05/16 22:23:57 schwarze Exp $ REGRESS_TARGETS = badspan center complex empty emptycol emptyline font REGRESS_TARGETS += lines lines-nogroff numbers REGRESS_TARGETS += shortlines spacing spacing-nogroff span LINT_TARGETS = badspan complex empty spacing-nogroff HTML_TARGETS = font # groff-1.22.4 defects: # - When the layout is completely empty, # GNU eqn produces no output whatsoever for the whole table. # - When there is no horizontal line at the top, # vertical lines extend beyond the top of the table. # - Excessive spacing modifiers in the layout are honoured. SKIP_GROFF = empty lines-nogroff spacing-nogroff .include mandoc-1.14.6/regress/tbl/layout/center.in010064400017530001753000000005601313667013200207340ustar00schwarzeschwarze.\" $OpenBSD: center.in,v 1.4 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-LAYOUT-CENTER 1 "June 17, 2017" .SH NAME tbl-layout-center \- centering of table cells .SH DESCRIPTION normal text .TS tab(:); r c l r c l r c l c s l r c s r c l . *:*:* **:**:** ***:***:*** ***:*** ***:*** ***:***:*** ****:****:**** *****:*****:***** .TE .sp leaked tab settings: .br a b c de mandoc-1.14.6/regress/tbl/layout/center.out_ascii010064400017530001753000000010431412140003700222700ustar00schwarzeschwarzeTBL-LAYOUT-CENTER(1) General Commands Manual TBL-LAYOUT-CENTER(1) NNAAMMEE tbl-layout-center - centering of table cells DDEESSCCRRIIPPTTIIOONN normal text * * * ** ** ** *** *** *** *** *** *** *** *** *** *** **** **** **** ***** ***** ***** leaked tab settings: a b c de OpenBSD June 17, 2017 TBL-LAYOUT-CENTER(1) mandoc-1.14.6/regress/tbl/layout/complex.in010064400017530001753000000006171313667013200211260ustar00schwarzeschwarze.\" $OpenBSD: complex.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-LAYOUT-COMPLEX 1 "January 26, 2015" .SH NAME tbl-layout-complex \- complex table layout .SH DESCRIPTION normal text .TS box tab(:); l|p-1l bsil|||l,l|l ilb^|i||l. a:b:c:d e:f:g:h:i .TE .PP normal text .TS box tab(:); l ^ l l. a:b c:d .TE .PP normal text .TS tab(:); ||l||l|| |l|l| ll. _ a:b _ c:d _ e:f _ .TE .PP normal text mandoc-1.14.6/regress/tbl/layout/complex.out_ascii010064400017530001753000000011651412140003700224640ustar00schwarzeschwarzeTBL-LAYOUT-COMPLEX(1) General Commands Manual TBL-LAYOUT-COMPLEX(1) NNAAMMEE tbl-layout-complex - complex table layout DDEESSCCRRIIPPTTIIOONN normal text +--+-----------++--+ |a | bb c ||d | |e | _f gg ||i | +--+-----------++--+ normal text +------+ |a | |c d | +------+ normal text +--++--+ |a ||b | +--++--+ |c | d | +--+---+ e f -------- normal text OpenBSD January 26, 2015 TBL-LAYOUT-COMPLEX(1) mandoc-1.14.6/regress/tbl/layout/complex.out_lint010064400017530001753000000005241313667013200223520ustar00schwarzeschwarzemandoc: complex.in:9:14: WARNING: skipping vertical bar in tbl layout mandoc: complex.in:9:28: WARNING: skipping vertical bar in tbl layout mandoc: complex.in:11:7: ERROR: ignoring data in spanned tbl cell: h mandoc: complex.in:17:3: WARNING: tbl column starts with span mandoc: complex.in:19:3: ERROR: ignoring data in spanned tbl cell: b mandoc-1.14.6/regress/tbl/layout/empty.in010064400017530001753000000004261313667013200206130ustar00schwarzeschwarze.\" $OpenBSD: empty.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-LAYOUT-EMPTY 1 "January 29, 2015" .SH NAME tbl-layout-empty \- empty table layout .SH DESCRIPTION completely empty layout: .TS . table text .TE layout only contains a bar: .TS |. table text .TE normal text mandoc-1.14.6/regress/tbl/layout/empty.out_ascii010064400017530001753000000005721412140003700221540ustar00schwarzeschwarzeTBL-LAYOUT-EMPTY(1) General Commands Manual TBL-LAYOUT-EMPTY(1) NNAAMMEE tbl-layout-empty - empty table layout DDEESSCCRRIIPPTTIIOONN completely empty layout: table text layout only contains a bar: |table text normal text OpenBSD January 29, 2015 TBL-LAYOUT-EMPTY(1) mandoc-1.14.6/regress/tbl/layout/empty.out_lint010064400017530001753000000001351313667013200220370ustar00schwarzeschwarzemandoc: empty.in:8:2: ERROR: empty tbl layout mandoc: empty.in:13:3: ERROR: empty tbl layout mandoc-1.14.6/regress/tbl/layout/emptyline.in010064400017530001753000000006041313667013200214610ustar00schwarzeschwarze.\" $OpenBSD: emptyline.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-LAYOUT-EMPTYLINE 1 "January 29, 2015" .SH NAME tbl-layout-emptyline \- empty lines in table layouts .SH DESCRIPTION An empty line in the middle of a table joins with the next: .TS l | r. table text _ bar right .TE .PP An empty line at the end of a table is discarded: .TS l r |. table text right .TE normal text mandoc-1.14.6/regress/tbl/layout/emptyline.out_ascii010064400017530001753000000010161412140003700230160ustar00schwarzeschwarzeTBL-LAYOUT-EMPTYLINE(1) General Commands Manual TBL-LAYOUT-EMPTYLINE(1) NNAAMMEE tbl-layout-emptyline - empty lines in table layouts DDEESSCCRRIIPPTTIIOONN An empty line in the middle of a table joins with the next: table text +----------- | bar | right An empty line at the end of a table is discarded: table text right normal text OpenBSD January 29, 2015 TBL-LAYOUT-EMPTYLINE(1) mandoc-1.14.6/regress/tbl/layout/numbers.in010064400017530001753000000004061313667013200211260ustar00schwarzeschwarze.\" $OpenBSD: numbers.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-LAYOUT-NUMBERS 1 "January 29, 2017" .SH NAME tbl-layout-numbers \- alignment of numbers in tables .SH DESCRIPTION normal text .TS box tab(:); r || n | n . 1:1.00:+42.0 _ 10:-10.0:3.14 .TE mandoc-1.14.6/regress/tbl/layout/numbers.out_ascii010064400017530001753000000006711412140003700224710ustar00schwarzeschwarzeTBL-LAYOUT-NUMBERS(1) General Commands Manual TBL-LAYOUT-NUMBERS(1) NNAAMMEE tbl-layout-numbers - alignment of numbers in tables DDEESSCCRRIIPPTTIIOONN normal text +---++-------+--------+ | 1 || 1.00 | +42.0 | +---++-------+--------+ |10 ||-10.0 | 3.14 | +---++-------+--------+ OpenBSD January 29, 2017 TBL-LAYOUT-NUMBERS(1) mandoc-1.14.6/regress/tbl/layout/span.in010064400017530001753000000011521412140003700204010ustar00schwarzeschwarze.\" $OpenBSD: span.in,v 1.6 2021/09/07 14:50:56 schwarze Exp $ .TH TBL-LAYOUT-SPAN 1 "September 7, 2021" .SH NAME tbl-layout-span \- alignment of spanned cells .SH DESCRIPTION normal text .TS box tab(:); L L L L L S L L L L S L L L L S. a:b:c:d s:c:d a:s:d a:b:s .TE .sp .TS box tab(:); C C C C C S C C C C S C C C C S. a:b:c:d s:c:d a:s:d a:b:s .TE .sp .TS box tab(:); R R R R R S R R R R S R R R R S. a:b:c:d s:c:d a:s:d a:b:s .TE .sp .TS allbox tab(:); L L L L L C S S C S R R R R R. a:b:c:d:e s1:s2 a:b:c:d:e .TE .sp .TS allbox tab(:); L S L N. x***nnnnn a:0.01 b:10.0 .TE .sp leaked tab settings: .br a b c d e f mandoc-1.14.6/regress/tbl/layout/span.out_ascii010064400017530001753000000021321412140003700217510ustar00schwarzeschwarzeTBL-LAYOUT-SPAN(1) General Commands Manual TBL-LAYOUT-SPAN(1) NNAAMMEE tbl-layout-span - alignment of spanned cells DDEESSCCRRIIPPTTIIOONN normal text +--------------+ |a b c d | |s c d | |a s d | |a b s | +--------------+ +--------------+ |a b c d | | s c d | |a s d | |a b s | +--------------+ +--------------+ |a b c d | | s c d | |a s d | |a b s | +--------------+ +--+---+---+---+---+ |a | b | c | d | e | +--+---+---+---+---+ | s1 | s2 | +--+---+---+---+---+ |a | b | c | d | e | +--+---+---+---+---+ +----------+ |x***nnnnn | +--+-------+ |a | 0.01 | +--+-------+ |b | 10.0 | +--+-------+ leaked tab settings: a b c d e f OpenBSD September 7, 2021 TBL-LAYOUT-SPAN(1) mandoc-1.14.6/regress/tbl/layout/lines-nogroff.in010064400017530001753000000033331312673167600222370ustar00schwarzeschwarze.\" $OpenBSD: lines-nogroff.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TBL-LAYOUT-LINES-NOGROFF 1 .Os .Sh NAME .Nm tbl-layout-lines .Nd table cells containing lines, misformatting with groff .Sh DESCRIPTION vline top left: .sp .TS tab(:); | l l l l. 11:12 21:22 .TE .sp hline and vline top left: .sp .TS tab(:); _| l l l. :12 21:22 .TE .sp vline and hline top left: .sp .TS tab(:); | _ l l l. :12 21:22 .TE .sp vline top: .sp .TS tab(:); l| l l l. 11:12 21:22 .TE .sp vline and hline top: .sp .TS tab(:); l| _ l l l l. 11::13 21:22:23 .TE .sp hline and vline top: .sp .TS tab(:); l _| l l l l. 11::13 21:22:23 .TE .sp hline, vline, hline top: .sp .TS tab(:); l _| _ l l l l l. 11:::13 21:22:23:24 .TE .sp vline top right: .sp .TS tab(:); l l| l l. 11:12 21:22 .TE .sp vline and hline top right: .sp .TS tab(:); l| _ l l. 11: 21:22 .TE .sp hline and vline top right: .sp .TS tab(:); l _| l l. 11: 21:22 .TE .sp double vline top left: .sp .TS tab(:); || l l l l. 11:12 21:22 .TE .sp hline and double vline top left: .sp .TS tab(:); _|| l l l. :12 21:22 .TE .sp double vline and hline top left: .sp .TS tab(:); || _ l l l. :12 21:22 .TE .sp double vline top: .sp .TS tab(:); l|| l l l. 11:12 21:22 .TE .sp double vline and hline top: .sp .TS tab(:); l|| _ l l l l. 11::13 21:22:23 .TE .sp hline and double vline top: .sp .TS tab(:); l _|| l l l l. 11::13 21:22:23 .TE .sp hline, double vline, hline top: .sp .TS tab(:); l _|| _ l l l l l. 11:::13 21:22:23:24 .TE .sp double vline top right: .sp .TS tab(:); l l|| l l. 11:12 21:22 .TE .sp double vline and hline top right: .sp .TS tab(:); l|| _ l l. 11: 21:22 .TE .sp hline and double vline top right: .sp .TS tab(:); l _|| l l. 11: 21:22 .TE .sp mandoc-1.14.6/regress/tbl/layout/lines-nogroff.out_ascii010064400017530001753000000030551312673167600236110ustar00schwarzeschwarzeTBL-LAYOUT-LINES-NOGROFF(1) General Commands Manual NNAAMMEE ttbbll--llaayyoouutt--lliinneess - table cells containing lines, misformatting with groff DDEESSCCRRIIPPTTIIOONN vline top left: |11 12 21 22 hline and vline top left: ---+ 12 21 22 vline and hline top left: +---- 12 21 22 vline top: 11 | 12 21 22 vline and hline top: 11 +----- 13 21 22 23 hline and vline top: 11 -----+ 13 21 22 23 hline, vline, hline top: 11 -----+----- 13 21 22 23 24 vline top right: 11 12 | 21 22 vline and hline top right: 11 +---- 21 22 hline and vline top right: 11 -----+ 21 22 double vline top left: |11 12 21 22 hline and double vline top left: ---+|12 21 22 double vline and hline top left: +---- 12 21 22 double vline top: 11 ||12 21 22 double vline and hline top: 11 ++---- 13 21 22 23 hline and double vline top: 11 -----+|13 21 22 23 hline, double vline, hline top: 11 -----++---- 13 21 22 23 24 double vline top right: 11 12 | 21 22 double vline and hline top right: 11 ++--- 21 22 hline and double vline top right: 11 -----+ 21 22 OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/tbl/layout/lines.in010064400017530001753000001747301312673167600206130ustar00schwarzeschwarze.\" $OpenBSD: lines.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TBL-LAYOUT-LINES 1 .Os .Sh NAME .Nm tbl-layout-lines .Nd table cells containing lines .Sh DESCRIPTION .pl 8000 hline top left: .TS tab(:); _ l l l. :12 21:22 .TE .sp hline top: .TS tab(:); l _ l l l l. 11::13 21:22:23 .TE .sp double hline top: .TS tab(:); l _ _ l l l l l. 11:::13 21:22:23:24 .TE .sp hline top right: .TS tab(:); l _ l l. 11: 21:22 .TE .sp hline in front: .TS tab(:); l l _ l l l. 11:12 :22 31:32 .TE .sp vline in front: .TS tab(:); l l l l | l l l l. 11:12 21:22 31:32 41:42 .TE .sp hline and vline in front: .TS tab(:); l l l l _| l l l. 11:12 21:22 :32 41:42 .TE .sp vline and hline in front: .TS tab(:); l l l l | _ l l l. 11:12 21:22 :32 41:42 .TE .sp hline in the middle: .TS tab(:); l l l l _ l l l l. 11:12:13 21::23 31:32:33 .TE .sp vline in the middle: .TS tab(:); l l l l l l l| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp vline and hline in the middle: .TS tab(:); l l l l l l l| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline and vline in the middle: .TS tab(:); l l l l l l l _| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp double hline in the middle: .TS tab(:); l l l l l _ _ l l l l l. 11:12:13:14 21:::24 31:32:33:34 .TE .sp hline, vline, hline in the middle: .TS tab(:); l l l l l l l l l _| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp hline at the end: .TS tab(:); l l l _ l l. 11:12 21: 31:32 .TE .sp vline at the end: .TS tab(:); l l l l l l| l l. 11:12 21:22 31:32 41:42 .TE .sp vline and hline at the end: .TS tab(:); l l l l l| _ l l. 11:12 21:22 31: 41:42 .TE .sp hline and vline at the end: .TS tab(:); l l l l l _| l l. 11:12 21:22 31: 41:42 .TE .sp hline bottom left: .TS tab(:); l l _ l. 11:12 :22 .TE .sp vline bottom left: .TS tab(:); l l l l | l l. 11:12 21:22 31:32 .TE .sp hline and vline bottom left: .TS tab(:); l l l l _| l. 11:12 21:22 :32 .TE .sp vline and hline bottom left: .TS tab(:); l l l l | _ l. 11:12 21:22 :32 .TE .sp double hline bottom: .TS tab(:); l l l l l _ _ l. 11:12:13:14 21:::24 .TE .sp hline, vline, hline bottom: .TS tab(:); l l l l l l l l l _| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp hline bottom right: .TS tab(:); l l l _. 11:12 21: .TE .sp vline bottom right: .TS tab(:); l l l l l l|. 11:12 21:22 31:32 .TE .sp vline and hline bottom right: .TS tab(:); l l l l l| _. 11:12 21:22 31: .TE .sp hline and vline bottom right: .TS tab(:); l l l l l _|. 11:12 21:22 31: .TE .sp double vline in front: .TS tab(:); l l l l || l l l l. 11:12 21:22 31:32 41:42 .TE .sp hline and double vline in front: .TS tab(:); l l l l _|| l l l. 11:12 21:22 :32 41:42 .TE .sp double vline and hline in front: .TS tab(:); l l l l || _ l l l. 11:12 21:22 :32 41:42 .TE .sp double vline in the middle: .TS tab(:); l l l l l l l|| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp double vline and hline in the middle: .TS tab(:); l l l l l l l|| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline and doble vline in the middle: .TS tab(:); l l l l l l l _|| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline, double vline, hline in the middle: .TS tab(:); l l l l l l l l l _|| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp double vline at the end: .TS tab(:); l l l l l l|| l l. 11:12 21:22 31:32 41:42 .TE .sp double vline and hline at the end: .TS tab(:); l l l l l|| _ l l. 11:12 21:22 31: 41:42 .TE .sp hline and double vline at the end: .TS tab(:); l l l l l _|| l l. 11:12 21:22 31: 41:42 .TE .sp double vline bottom left: .TS tab(:); l l l l || l l. 11:12 21:22 31:32 .TE .sp hline and double vline bottom left: .TS tab(:); l l l l _|| l. 11:12 21:22 :32 .TE .sp double vline and hline bottom left: .TS tab(:); l l l l || _ l. 11:12 21:22 :32 .TE .sp hline, double vline, hline bottom: .TS tab(:); l l l l l l l l l _|| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp double vline bottom right: .TS tab(:); l l l l l l||. 11:12 21:22 31:32 .TE .sp double vline and hline bottom right: .TS tab(:); l l l l l|| _. 11:12 21:22 31: .TE .sp hline and double vline bottom right: .TS tab(:); l l l l l _||. 11:12 21:22 31: .TE .sp vline left below hline top left: .TS tab(:); _ l | l l l l. :12 21:22 31:32 .TE .sp vline right below hline top left: .TS tab(:); _ l l| l l l. :12 21:22 31:32 .TE .sp vline left below hline at the top: .TS tab(:); l _ l l| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp vline right below hline at the top: .TS tab(:); l _ l l l| l l l l. 11::13 21:22:23 31:32:33 .TE .sp vline below hline at the top: .TS tab(:); l _ _ l l l| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp vline left below hline top right: .TS tab(:); l _ l| l l l. 11: 21:22 31:32 .TE .sp vline right below hline top right: .TS tab(:); l _ l l| l l. 11: 21:22 31:32 .TE .sp vline left below hline in front: .TS tab(:); l l _ l | l l l l. 11:12 :22 31:32 41:42 .TE .sp vline left above hline in front: .TS tab(:); l l l l | l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp vline right below hline in front: .TS tab(:); l l _ l l| l l l. 11:12 :22 31:32 41:42 .TE .sp vline right above hline in front: .TS tab(:); l l l l l| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp vline left below hline in the middle: .TS tab(:); l l l l _ l l| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp vline left above hline in the middle: .TS tab(:); l l l l l l l| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp vline right below hline in the middle: .TS tab(:); l l l l _ l l l| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp vline right above hline in the middle: .TS tab(:); l l l l l l l l| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp vline below hline in the middle: .TS tab(:); l l l l l _ _ l l l| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp vline above hline in the middle: .TS tab(:); l l l l l l l l l l| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp vline left below hline at the end: .TS tab(:); l l l _ l| l l l. 11:12 21: 31:32 41:42 .TE .sp vline left above hline at the end: .TS tab(:); l l l l l| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp vline right below hline at the end: .TS tab(:); l l l _ l l| l l. 11:12 21: 31:32 41:42 .TE .sp vline right above hline at the end: .TS tab(:); l l l l l l| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp vline left above hline bottom left: .TS tab(:); l l l l | l l _ l. 11:12 21:22 31:32 :42 .TE .sp vline right above hline bottom left: .TS tab(:); l l l l l| l _ l. 11:12 21:22 31:32 :42 .TE .sp vline left above hline at the bottom: .TS tab(:); l l l l l l l| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp vline right above hline at the bottom: .TS tab(:); l l l l l l l l| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp vline above hline at the bottom: .TS tab(:); l l l l l l l l l l| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp vline left above hline bottom right: .TS tab(:); l l l l l| l l _. 11:12 21:22 31:32 41: .TE .sp vline right above hline bottom right: .TS tab(:); l l l l l l| l _. 11:12 21:22 31:32 41: .TE .sp double vline left below hline top left: .TS tab(:); _ l || l l l l. :12 21:22 31:32 .TE .sp double vline right below hline top left: .TS tab(:); _ l l|| l l l. :12 21:22 31:32 .TE .sp double vline left below hline at the top: .TS tab(:); l _ l l|| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp double vline right below hline at the top: .TS tab(:); l _ l l l|| l l l l. 11::13 21:22:23 31:32:33 .TE .sp double vline below hline at the top: .TS tab(:); l _ _ l l l|| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp double vline left below hline top right: .TS tab(:); l _ l|| l l l. 11: 21:22 31:32 .TE .sp double vline right below hline top right: .TS tab(:); l _ l l|| l l. 11: 21:22 31:32 .TE .sp double vline left below hline in front: .TS tab(:); l l _ l || l l l l. 11:12 :22 31:32 41:42 .TE .sp double vline left above hline in front: .TS tab(:); l l l l || l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp double vline right below hline in front: .TS tab(:); l l _ l l|| l l l. 11:12 :22 31:32 41:42 .TE .sp double vline right above hline in front: .TS tab(:); l l l l l|| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp double vline left below hline in the middle: .TS tab(:); l l l l _ l l|| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp double vline left above hline in the middle: .TS tab(:); l l l l l l l|| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp double vline right below hline in the middle: .TS tab(:); l l l l _ l l l|| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp double vline right above hline in the middle: .TS tab(:); l l l l l l l l|| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp double vline below hline in the middle: .TS tab(:); l l l l l _ _ l l l|| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp double vline above hline in the middle: .TS tab(:); l l l l l l l l l l|| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp double vline left below hline at the end: .TS tab(:); l l l _ l|| l l l. 11:12 21: 31:32 41:42 .TE .sp double vline left above hline at the end: .TS tab(:); l l l l l|| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp double vline right below hline at the end: .TS tab(:); l l l _ l l|| l l. 11:12 21: 31:32 41:42 .TE .sp double vline right above hline at the end: .TS tab(:); l l l l l l|| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp double vline left above hline bottom left: .TS tab(:); l l l l || l l _ l. 11:12 21:22 31:32 :42 .TE .sp double vline right above hline bottom left: .TS tab(:); l l l l l|| l _ l. 11:12 21:22 31:32 :42 .TE .sp double vline left above hline at the bottom: .TS tab(:); l l l l l l l|| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp double vline right above hline at the bottom: .TS tab(:); l l l l l l l l|| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp double vline above hline at the bottom: .TS tab(:); l l l l l l l l l l|| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp double vline left above hline bottom right: .TS tab(:); l l l l l|| l l _. 11:12 21:22 31:32 41: .TE .sp double vline right above hline bottom right: .TS tab(:); l l l l l l|| l _. 11:12 21:22 31:32 41: .TE .Sh BOXED vline top left: .TS box tab(:); | l l l l. 11:12 21:22 .TE .sp hline and vline top left: .TS box tab(:); _| l l l. :12 21:22 .TE .sp vline and hline top left: .TS box tab(:); | _ l l l. :12 21:22 .TE .sp vline top: .TS box tab(:); l| l l l. 11:12 21:22 .TE .sp vline and hline top: .TS box tab(:); l| _ l l l l. 11::13 21:22:23 .TE .sp hline and vline top: .TS box tab(:); l _| l l l l. 11::13 21:22:23 .TE .sp hline, vline, hline top: .TS box tab(:); l _| _ l l l l l. 11:::13 21:22:23:24 .TE .sp vline top right: .TS box tab(:); l l| l l. 11:12 21:22 .TE .sp vline and hline top right: .TS box tab(:); l| _ l l. 11: 21:22 .TE .sp hline and vline top right: .TS box tab(:); l _| l l. 11: 21:22 .TE .sp double vline top left: .TS box tab(:); || l l l l. 11:12 21:22 .TE .sp hline and double vline top left: .TS box tab(:); _|| l l l. :12 21:22 .TE .sp double vline and hline top left: .TS box tab(:); || _ l l l. :12 21:22 .TE .sp double vline top: .TS box tab(:); l|| l l l. 11:12 21:22 .TE .sp double vline and hline top: .TS box tab(:); l|| _ l l l l. 11::13 21:22:23 .TE .sp hline and double vline top: .TS box tab(:); l _|| l l l l. 11::13 21:22:23 .TE .sp hline, double vline, hline top: .TS box tab(:); l _|| _ l l l l l. 11:::13 21:22:23:24 .TE .sp double vline top right: .TS box tab(:); l l|| l l. 11:12 21:22 .TE .sp double vline and hline top right: .TS box tab(:); l|| _ l l. 11: 21:22 .TE .sp hline and double vline top right: .TS box tab(:); l _|| l l. 11: 21:22 .TE .sp hline top left: .TS box tab(:); _ l l l. :12 21:22 .TE .sp hline top: .TS box tab(:); l _ l l l l. 11::13 21:22:23 .TE .sp double hline top: .TS box tab(:); l _ _ l l l l l. 11:::13 21:22:23:24 .TE .sp hline top right: .TS box tab(:); l _ l l. 11: 21:22 .TE .sp hline in front: .TS box tab(:); l l _ l l l. 11:12 :22 31:32 .TE .sp vline in front: .TS box tab(:); l l l l | l l l l. 11:12 21:22 31:32 41:42 .TE .sp hline and vline in front: .TS box tab(:); l l l l _| l l l. 11:12 21:22 :32 41:42 .TE .sp vline and hline in front: .TS box tab(:); l l l l | _ l l l. 11:12 21:22 :32 41:42 .TE .sp hline in the middle: .TS box tab(:); l l l l _ l l l l. 11:12:13 21::23 31:32:33 .TE .sp vline in the middle: .TS box tab(:); l l l l l l l| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp vline and hline in the middle: .TS box tab(:); l l l l l l l| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline and vline in the middle: .TS box tab(:); l l l l l l l _| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp double hline in the middle: .TS box tab(:); l l l l l _ _ l l l l l. 11:12:13:14 21:::24 31:32:33:34 .TE .sp hline, vline, hline in the middle: .TS box tab(:); l l l l l l l l l _| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp hline at the end: .TS box tab(:); l l l _ l l. 11:12 21: 31:32 .TE .sp vline at the end: .TS box tab(:); l l l l l l| l l. 11:12 21:22 31:32 41:42 .TE .sp vline and hline at the end: .TS box tab(:); l l l l l| _ l l. 11:12 21:22 31: 41:42 .TE .sp hline and vline at the end: .TS box tab(:); l l l l l _| l l. 11:12 21:22 31: 41:42 .TE .sp hline bottom left: .TS box tab(:); l l _ l. 11:12 :22 .TE .sp vline bottom left: .TS box tab(:); l l l l | l l. 11:12 21:22 31:32 .TE .sp hline and vline bottom left: .TS box tab(:); l l l l _| l. 11:12 21:22 :32 .TE .sp vline and hline bottom left: .TS box tab(:); l l l l | _ l. 11:12 21:22 :32 .TE .sp double hline bottom: .TS box tab(:); l l l l l _ _ l. 11:12:13:14 21:::24 .TE .sp hline, vline, hline bottom: .TS box tab(:); l l l l l l l l l _| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp hline bottom right: .TS box tab(:); l l l _. 11:12 21: .TE .sp vline bottom right: .TS box tab(:); l l l l l l|. 11:12 21:22 31:32 .TE .sp vline and hline bottom right: .TS box tab(:); l l l l l| _. 11:12 21:22 31: .TE .sp hline and vline bottom right: .TS box tab(:); l l l l l _|. 11:12 21:22 31: .TE .sp double vline in front: .TS box tab(:); l l l l || l l l l. 11:12 21:22 31:32 41:42 .TE .sp hline and double vline in front: .TS box tab(:); l l l l _|| l l l. 11:12 21:22 :32 41:42 .TE .sp double vline and hline in front: .TS box tab(:); l l l l || _ l l l. 11:12 21:22 :32 41:42 .TE .sp double vline in the middle: .TS box tab(:); l l l l l l l|| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp double vline and hline in the middle: .TS box tab(:); l l l l l l l|| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline and doble vline in the middle: .TS box tab(:); l l l l l l l _|| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline, double vline, hline in the middle: .TS box tab(:); l l l l l l l l l _|| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp double vline at the end: .TS box tab(:); l l l l l l|| l l. 11:12 21:22 31:32 41:42 .TE .sp double vline and hline at the end: .TS box tab(:); l l l l l|| _ l l. 11:12 21:22 31: 41:42 .TE .sp hline and double vline at the end: .TS box tab(:); l l l l l _|| l l. 11:12 21:22 31: 41:42 .TE .sp double vline bottom left: .TS box tab(:); l l l l || l l. 11:12 21:22 31:32 .TE .sp hline and double vline bottom left: .TS box tab(:); l l l l _|| l. 11:12 21:22 :32 .TE .sp double vline and hline bottom left: .TS box tab(:); l l l l || _ l. 11:12 21:22 :32 .TE .sp hline, double vline, hline bottom: .TS box tab(:); l l l l l l l l l _|| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp double vline bottom right: .TS box tab(:); l l l l l l||. 11:12 21:22 31:32 .TE .sp double vline and hline bottom right: .TS box tab(:); l l l l l|| _. 11:12 21:22 31: .TE .sp hline and double vline bottom right: .TS box tab(:); l l l l l _||. 11:12 21:22 31: .TE .sp vline left below hline top left: .TS box tab(:); _ l | l l l l. :12 21:22 31:32 .TE .sp vline right below hline top left: .TS box tab(:); _ l l| l l l. :12 21:22 31:32 .TE .sp vline left below hline at the top: .TS box tab(:); l _ l l| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp vline right below hline at the top: .TS box tab(:); l _ l l l| l l l l. 11::13 21:22:23 31:32:33 .TE .sp vline below hline at the top: .TS box tab(:); l _ _ l l l| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp vline left below hline top right: .TS box tab(:); l _ l| l l l. 11: 21:22 31:32 .TE .sp vline right below hline top right: .TS box tab(:); l _ l l| l l. 11: 21:22 31:32 .TE .sp vline left below hline in front: .TS box tab(:); l l _ l | l l l l. 11:12 :22 31:32 41:42 .TE .sp vline left above hline in front: .TS box tab(:); l l l l | l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp vline right below hline in front: .TS box tab(:); l l _ l l| l l l. 11:12 :22 31:32 41:42 .TE .sp vline right above hline in front: .TS box tab(:); l l l l l| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp vline left below hline in the middle: .TS box tab(:); l l l l _ l l| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp vline left above hline in the middle: .TS box tab(:); l l l l l l l| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp vline right below hline in the middle: .TS box tab(:); l l l l _ l l l| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp vline right above hline in the middle: .TS box tab(:); l l l l l l l l| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp vline below hline in the middle: .TS box tab(:); l l l l l _ _ l l l| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp vline above hline in the middle: .TS box tab(:); l l l l l l l l l l| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp vline left below hline at the end: .TS box tab(:); l l l _ l| l l l. 11:12 21: 31:32 41:42 .TE .sp vline left above hline at the end: .TS box tab(:); l l l l l| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp vline right below hline at the end: .TS box tab(:); l l l _ l l| l l. 11:12 21: 31:32 41:42 .TE .sp vline right above hline at the end: .TS box tab(:); l l l l l l| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp vline left above hline bottom left: .TS box tab(:); l l l l | l l _ l. 11:12 21:22 31:32 :42 .TE .sp vline right above hline bottom left: .TS box tab(:); l l l l l| l _ l. 11:12 21:22 31:32 :42 .TE .sp vline left above hline at the bottom: .TS box tab(:); l l l l l l l| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp vline right above hline at the bottom: .TS box tab(:); l l l l l l l l| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp vline above hline at the bottom: .TS box tab(:); l l l l l l l l l l| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp vline left above hline bottom right: .TS box tab(:); l l l l l| l l _. 11:12 21:22 31:32 41: .TE .sp vline right above hline bottom right: .TS box tab(:); l l l l l l| l _. 11:12 21:22 31:32 41: .TE .sp double vline left below hline top left: .TS box tab(:); _ l || l l l l. :12 21:22 31:32 .TE .sp double vline right below hline top left: .TS box tab(:); _ l l|| l l l. :12 21:22 31:32 .TE .sp double vline left below hline at the top: .TS box tab(:); l _ l l|| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp double vline right below hline at the top: .TS box tab(:); l _ l l l|| l l l l. 11::13 21:22:23 31:32:33 .TE .sp double vline below hline at the top: .TS box tab(:); l _ _ l l l|| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp double vline left below hline top right: .TS box tab(:); l _ l|| l l l. 11: 21:22 31:32 .TE .sp double vline right below hline top right: .TS box tab(:); l _ l l|| l l. 11: 21:22 31:32 .TE .sp double vline left below hline in front: .TS box tab(:); l l _ l || l l l l. 11:12 :22 31:32 41:42 .TE .sp double vline left above hline in front: .TS box tab(:); l l l l || l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp double vline right below hline in front: .TS box tab(:); l l _ l l|| l l l. 11:12 :22 31:32 41:42 .TE .sp double vline right above hline in front: .TS box tab(:); l l l l l|| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp double vline left below hline in the middle: .TS box tab(:); l l l l _ l l|| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp double vline left above hline in the middle: .TS box tab(:); l l l l l l l|| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp double vline right below hline in the middle: .TS box tab(:); l l l l _ l l l|| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp double vline right above hline in the middle: .TS box tab(:); l l l l l l l l|| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp double vline below hline in the middle: .TS box tab(:); l l l l l _ _ l l l|| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp double vline above hline in the middle: .TS box tab(:); l l l l l l l l l l|| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp double vline left below hline at the end: .TS box tab(:); l l l _ l|| l l l. 11:12 21: 31:32 41:42 .TE .sp double vline left above hline at the end: .TS box tab(:); l l l l l|| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp double vline right below hline at the end: .TS box tab(:); l l l _ l l|| l l. 11:12 21: 31:32 41:42 .TE .sp double vline right above hline at the end: .TS box tab(:); l l l l l l|| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp double vline left above hline bottom left: .TS box tab(:); l l l l || l l _ l. 11:12 21:22 31:32 :42 .TE .sp double vline right above hline bottom left: .TS box tab(:); l l l l l|| l _ l. 11:12 21:22 31:32 :42 .TE .sp double vline left above hline at the bottom: .TS box tab(:); l l l l l l l|| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp double vline right above hline at the bottom: .TS box tab(:); l l l l l l l l|| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp double vline above hline at the bottom: .TS box tab(:); l l l l l l l l l l|| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp double vline left above hline bottom right: .TS box tab(:); l l l l l|| l l _. 11:12 21:22 31:32 41: .TE .sp double vline right above hline bottom right: .TS box tab(:); l l l l l l|| l _. 11:12 21:22 31:32 41: .TE .sp .Sh ALLBOX vline top left: .TS allbox tab(:); | l l l l. 11:12 21:22 .TE .sp hline and vline top left: .TS allbox tab(:); _| l l l. :12 21:22 .TE .sp vline and hline top left: .TS allbox tab(:); | _ l l l. :12 21:22 .TE .sp vline top: .TS allbox tab(:); l| l l l. 11:12 21:22 .TE .sp vline and hline top: .TS allbox tab(:); l| _ l l l l. 11::13 21:22:23 .TE .sp hline and vline top: .TS allbox tab(:); l _| l l l l. 11::13 21:22:23 .TE .sp hline, vline, hline top: .TS allbox tab(:); l _| _ l l l l l. 11:::13 21:22:23:24 .TE .sp vline top right: .TS allbox tab(:); l l| l l. 11:12 21:22 .TE .sp vline and hline top right: .TS allbox tab(:); l| _ l l. 11: 21:22 .TE .sp hline and vline top right: .TS allbox tab(:); l _| l l. 11: 21:22 .TE .sp double vline top left: .TS allbox tab(:); || l l l l. 11:12 21:22 .TE .sp hline and double vline top left: .TS allbox tab(:); _|| l l l. :12 21:22 .TE .sp double vline and hline top left: .TS allbox tab(:); || _ l l l. :12 21:22 .TE .sp double vline top: .TS allbox tab(:); l|| l l l. 11:12 21:22 .TE .sp double vline and hline top: .TS allbox tab(:); l|| _ l l l l. 11::13 21:22:23 .TE .sp hline and double vline top: .TS allbox tab(:); l _|| l l l l. 11::13 21:22:23 .TE .sp hline, double vline, hline top: .TS allbox tab(:); l _|| _ l l l l l. 11:::13 21:22:23:24 .TE .sp double vline top right: .TS allbox tab(:); l l|| l l. 11:12 21:22 .TE .sp double vline and hline top right: .TS allbox tab(:); l|| _ l l. 11: 21:22 .TE .sp hline and double vline top right: .TS allbox tab(:); l _|| l l. 11: 21:22 .TE .sp hline top left: .TS allbox tab(:); _ l l l. :12 21:22 .TE .sp hline top: .TS allbox tab(:); l _ l l l l. 11::13 21:22:23 .TE .sp double hline top: .TS allbox tab(:); l _ _ l l l l l. 11:::13 21:22:23:24 .TE .sp hline top right: .TS allbox tab(:); l _ l l. 11: 21:22 .TE .sp hline in front: .TS allbox tab(:); l l _ l l l. 11:12 :22 31:32 .TE .sp vline in front: .TS allbox tab(:); l l l l | l l l l. 11:12 21:22 31:32 41:42 .TE .sp hline and vline in front: .TS allbox tab(:); l l l l _| l l l. 11:12 21:22 :32 41:42 .TE .sp vline and hline in front: .TS allbox tab(:); l l l l | _ l l l. 11:12 21:22 :32 41:42 .TE .sp hline in the middle: .TS allbox tab(:); l l l l _ l l l l. 11:12:13 21::23 31:32:33 .TE .sp vline in the middle: .TS allbox tab(:); l l l l l l l| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp vline and hline in the middle: .TS allbox tab(:); l l l l l l l| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline and vline in the middle: .TS allbox tab(:); l l l l l l l _| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp double hline in the middle: .TS allbox tab(:); l l l l l _ _ l l l l l. 11:12:13:14 21:::24 31:32:33:34 .TE .sp hline, vline, hline in the middle: .TS allbox tab(:); l l l l l l l l l _| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp hline at the end: .TS allbox tab(:); l l l _ l l. 11:12 21: 31:32 .TE .sp vline at the end: .TS allbox tab(:); l l l l l l| l l. 11:12 21:22 31:32 41:42 .TE .sp vline and hline at the end: .TS allbox tab(:); l l l l l| _ l l. 11:12 21:22 31: 41:42 .TE .sp hline and vline at the end: .TS allbox tab(:); l l l l l _| l l. 11:12 21:22 31: 41:42 .TE .sp hline bottom left: .TS allbox tab(:); l l _ l. 11:12 :22 .TE .sp vline bottom left: .TS allbox tab(:); l l l l | l l. 11:12 21:22 31:32 .TE .sp hline and vline bottom left: .TS allbox tab(:); l l l l _| l. 11:12 21:22 :32 .TE .sp vline and hline bottom left: .TS allbox tab(:); l l l l | _ l. 11:12 21:22 :32 .TE .sp double hline bottom: .TS allbox tab(:); l l l l l _ _ l. 11:12:13:14 21:::24 .TE .sp hline, vline, hline bottom: .TS allbox tab(:); l l l l l l l l l _| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp hline bottom right: .TS allbox tab(:); l l l _. 11:12 21: .TE .sp vline bottom right: .TS allbox tab(:); l l l l l l|. 11:12 21:22 31:32 .TE .sp vline and hline bottom right: .TS allbox tab(:); l l l l l| _. 11:12 21:22 31: .TE .sp hline and vline bottom right: .TS allbox tab(:); l l l l l _|. 11:12 21:22 31: .TE .sp double vline in front: .TS allbox tab(:); l l l l || l l l l. 11:12 21:22 31:32 41:42 .TE .sp hline and double vline in front: .TS allbox tab(:); l l l l _|| l l l. 11:12 21:22 :32 41:42 .TE .sp double vline and hline in front: .TS allbox tab(:); l l l l || _ l l l. 11:12 21:22 :32 41:42 .TE .sp double vline in the middle: .TS allbox tab(:); l l l l l l l|| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp double vline and hline in the middle: .TS allbox tab(:); l l l l l l l|| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline and doble vline in the middle: .TS allbox tab(:); l l l l l l l _|| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp hline, double vline, hline in the middle: .TS allbox tab(:); l l l l l l l l l _|| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp double vline at the end: .TS allbox tab(:); l l l l l l|| l l. 11:12 21:22 31:32 41:42 .TE .sp double vline and hline at the end: .TS allbox tab(:); l l l l l|| _ l l. 11:12 21:22 31: 41:42 .TE .sp hline and double vline at the end: .TS allbox tab(:); l l l l l _|| l l. 11:12 21:22 31: 41:42 .TE .sp double vline bottom left: .TS allbox tab(:); l l l l || l l. 11:12 21:22 31:32 .TE .sp hline and double vline bottom left: .TS allbox tab(:); l l l l _|| l. 11:12 21:22 :32 .TE .sp double vline and hline bottom left: .TS allbox tab(:); l l l l || _ l. 11:12 21:22 :32 .TE .sp hline, double vline, hline bottom: .TS allbox tab(:); l l l l l l l l l _|| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp double vline bottom right: .TS allbox tab(:); l l l l l l||. 11:12 21:22 31:32 .TE .sp double vline and hline bottom right: .TS allbox tab(:); l l l l l|| _. 11:12 21:22 31: .TE .sp hline and double vline bottom right: .TS allbox tab(:); l l l l l _||. 11:12 21:22 31: .TE .sp vline left below hline top left: .TS allbox tab(:); _ l | l l l l. :12 21:22 31:32 .TE .sp vline right below hline top left: .TS allbox tab(:); _ l l| l l l. :12 21:22 31:32 .TE .sp vline left below hline at the top: .TS allbox tab(:); l _ l l| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp vline right below hline at the top: .TS allbox tab(:); l _ l l l| l l l l. 11::13 21:22:23 31:32:33 .TE .sp vline below hline at the top: .TS allbox tab(:); l _ _ l l l| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp vline left below hline top right: .TS allbox tab(:); l _ l| l l l. 11: 21:22 31:32 .TE .sp vline right below hline top right: .TS allbox tab(:); l _ l l| l l. 11: 21:22 31:32 .TE .sp vline left below hline in front: .TS allbox tab(:); l l _ l | l l l l. 11:12 :22 31:32 41:42 .TE .sp vline left above hline in front: .TS allbox tab(:); l l l l | l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp vline right below hline in front: .TS allbox tab(:); l l _ l l| l l l. 11:12 :22 31:32 41:42 .TE .sp vline right above hline in front: .TS allbox tab(:); l l l l l| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp vline left below hline in the middle: .TS allbox tab(:); l l l l _ l l| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp vline left above hline in the middle: .TS allbox tab(:); l l l l l l l| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp vline right below hline in the middle: .TS allbox tab(:); l l l l _ l l l| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp vline right above hline in the middle: .TS allbox tab(:); l l l l l l l l| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp vline below hline in the middle: .TS allbox tab(:); l l l l l _ _ l l l| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp vline above hline in the middle: .TS allbox tab(:); l l l l l l l l l l| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp vline left below hline at the end: .TS allbox tab(:); l l l _ l| l l l. 11:12 21: 31:32 41:42 .TE .sp vline left above hline at the end: .TS allbox tab(:); l l l l l| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp vline right below hline at the end: .TS allbox tab(:); l l l _ l l| l l. 11:12 21: 31:32 41:42 .TE .sp vline right above hline at the end: .TS allbox tab(:); l l l l l l| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp vline left above hline bottom left: .TS allbox tab(:); l l l l | l l _ l. 11:12 21:22 31:32 :42 .TE .sp vline right above hline bottom left: .TS allbox tab(:); l l l l l| l _ l. 11:12 21:22 31:32 :42 .TE .sp vline left above hline at the bottom: .TS allbox tab(:); l l l l l l l| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp vline right above hline at the bottom: .TS allbox tab(:); l l l l l l l l| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp vline above hline at the bottom: .TS allbox tab(:); l l l l l l l l l l| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp vline left above hline bottom right: .TS allbox tab(:); l l l l l| l l _. 11:12 21:22 31:32 41: .TE .sp vline right above hline bottom right: .TS allbox tab(:); l l l l l l| l _. 11:12 21:22 31:32 41: .TE .sp double vline left below hline top left: .TS allbox tab(:); _ l || l l l l. :12 21:22 31:32 .TE .sp double vline right below hline top left: .TS allbox tab(:); _ l l|| l l l. :12 21:22 31:32 .TE .sp double vline left below hline at the top: .TS allbox tab(:); l _ l l|| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp double vline right below hline at the top: .TS allbox tab(:); l _ l l l|| l l l l. 11::13 21:22:23 31:32:33 .TE .sp double vline below hline at the top: .TS allbox tab(:); l _ _ l l l|| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp double vline left below hline top right: .TS allbox tab(:); l _ l|| l l l. 11: 21:22 31:32 .TE .sp double vline right below hline top right: .TS allbox tab(:); l _ l l|| l l. 11: 21:22 31:32 .TE .sp double vline left below hline in front: .TS allbox tab(:); l l _ l || l l l l. 11:12 :22 31:32 41:42 .TE .sp double vline left above hline in front: .TS allbox tab(:); l l l l || l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp double vline right below hline in front: .TS allbox tab(:); l l _ l l|| l l l. 11:12 :22 31:32 41:42 .TE .sp double vline right above hline in front: .TS allbox tab(:); l l l l l|| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp double vline left below hline in the middle: .TS allbox tab(:); l l l l _ l l|| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp double vline left above hline in the middle: .TS allbox tab(:); l l l l l l l|| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp double vline right below hline in the middle: .TS allbox tab(:); l l l l _ l l l|| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp double vline right above hline in the middle: .TS allbox tab(:); l l l l l l l l|| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp double vline below hline in the middle: .TS allbox tab(:); l l l l l _ _ l l l|| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp double vline above hline in the middle: .TS allbox tab(:); l l l l l l l l l l|| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp double vline left below hline at the end: .TS allbox tab(:); l l l _ l|| l l l. 11:12 21: 31:32 41:42 .TE .sp double vline left above hline at the end: .TS allbox tab(:); l l l l l|| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp double vline right below hline at the end: .TS allbox tab(:); l l l _ l l|| l l. 11:12 21: 31:32 41:42 .TE .sp double vline right above hline at the end: .TS allbox tab(:); l l l l l l|| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp double vline left above hline bottom left: .TS allbox tab(:); l l l l || l l _ l. 11:12 21:22 31:32 :42 .TE .sp double vline right above hline bottom left: .TS allbox tab(:); l l l l l|| l _ l. 11:12 21:22 31:32 :42 .TE .sp double vline left above hline at the bottom: .TS allbox tab(:); l l l l l l l|| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp double vline right above hline at the bottom: .TS allbox tab(:); l l l l l l l l|| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp double vline above hline at the bottom: .TS allbox tab(:); l l l l l l l l l l|| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp double vline left above hline bottom right: .TS allbox tab(:); l l l l l|| l l _. 11:12 21:22 31:32 41: .TE .sp double vline right above hline bottom right: .TS allbox tab(:); l l l l l l|| l _. 11:12 21:22 31:32 41: .TE .sp .Sh DOUBLEBOX vline top left: .TS doublebox tab(:); | l l l l. 11:12 21:22 .TE .sp 2v hline and vline top left: .TS doublebox tab(:); _| l l l. :12 21:22 .TE .sp 2v vline and hline top left: .TS doublebox tab(:); | _ l l l. :12 21:22 .TE .sp 2v vline top: .TS doublebox tab(:); l| l l l. 11:12 21:22 .TE .sp 2v vline and hline top: .TS doublebox tab(:); l| _ l l l l. 11::13 21:22:23 .TE .sp 2v hline and vline top: .TS doublebox tab(:); l _| l l l l. 11::13 21:22:23 .TE .sp 2v hline, vline, hline top: .TS doublebox tab(:); l _| _ l l l l l. 11:::13 21:22:23:24 .TE .sp 2v vline top right: .TS doublebox tab(:); l l| l l. 11:12 21:22 .TE .sp 2v vline and hline top right: .TS doublebox tab(:); l| _ l l. 11: 21:22 .TE .sp 2v hline and vline top right: .TS doublebox tab(:); l _| l l. 11: 21:22 .TE .sp 2v double vline top left: .TS doublebox tab(:); || l l l l. 11:12 21:22 .TE .sp 2v hline and double vline top left: .TS doublebox tab(:); _|| l l l. :12 21:22 .TE .sp 2v double vline and hline top left: .TS doublebox tab(:); || _ l l l. :12 21:22 .TE .sp 2v double vline top: .TS doublebox tab(:); l|| l l l. 11:12 21:22 .TE .sp 2v double vline and hline top: .TS doublebox tab(:); l|| _ l l l l. 11::13 21:22:23 .TE .sp 2v hline and double vline top: .TS doublebox tab(:); l _|| l l l l. 11::13 21:22:23 .TE .sp 2v hline, double vline, hline top: .TS doublebox tab(:); l _|| _ l l l l l. 11:::13 21:22:23:24 .TE .sp 2v double vline top right: .TS doublebox tab(:); l l|| l l. 11:12 21:22 .TE .sp 2v double vline and hline top right: .TS doublebox tab(:); l|| _ l l. 11: 21:22 .TE .sp 2v hline and double vline top right: .TS doublebox tab(:); l _|| l l. 11: 21:22 .TE .sp 2v hline top left: .TS doublebox tab(:); _ l l l. :12 21:22 .TE .sp 2v hline top: .TS doublebox tab(:); l _ l l l l. 11::13 21:22:23 .TE .sp 2v double hline top: .TS doublebox tab(:); l _ _ l l l l l. 11:::13 21:22:23:24 .TE .sp 2v hline top right: .TS doublebox tab(:); l _ l l. 11: 21:22 .TE .sp 2v hline in front: .TS doublebox tab(:); l l _ l l l. 11:12 :22 31:32 .TE .sp 2v vline in front: .TS doublebox tab(:); l l l l | l l l l. 11:12 21:22 31:32 41:42 .TE .sp 2v hline and vline in front: .TS doublebox tab(:); l l l l _| l l l. 11:12 21:22 :32 41:42 .TE .sp 2v vline and hline in front: .TS doublebox tab(:); l l l l | _ l l l. 11:12 21:22 :32 41:42 .TE .sp 2v hline in the middle: .TS doublebox tab(:); l l l l _ l l l l. 11:12:13 21::23 31:32:33 .TE .sp 2v vline in the middle: .TS doublebox tab(:); l l l l l l l| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp 2v vline and hline in the middle: .TS doublebox tab(:); l l l l l l l| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp 2v hline and vline in the middle: .TS doublebox tab(:); l l l l l l l _| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp 2v double hline in the middle: .TS doublebox tab(:); l l l l l _ _ l l l l l. 11:12:13:14 21:::24 31:32:33:34 .TE .sp 2v hline, vline, hline in the middle: .TS doublebox tab(:); l l l l l l l l l _| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp 2v hline at the end: .TS doublebox tab(:); l l l _ l l. 11:12 21: 31:32 .TE .sp 2v vline at the end: .TS doublebox tab(:); l l l l l l| l l. 11:12 21:22 31:32 41:42 .TE .sp 2v vline and hline at the end: .TS doublebox tab(:); l l l l l| _ l l. 11:12 21:22 31: 41:42 .TE .sp 2v hline and vline at the end: .TS doublebox tab(:); l l l l l _| l l. 11:12 21:22 31: 41:42 .TE .sp 2v hline bottom left: .TS doublebox tab(:); l l _ l. 11:12 :22 .TE .sp 2v vline bottom left: .TS doublebox tab(:); l l l l | l l. 11:12 21:22 31:32 .TE .sp 2v hline and vline bottom left: .TS doublebox tab(:); l l l l _| l. 11:12 21:22 :32 .TE .sp 2v vline and hline bottom left: .TS doublebox tab(:); l l l l | _ l. 11:12 21:22 :32 .TE .sp 2v double hline bottom: .TS doublebox tab(:); l l l l l _ _ l. 11:12:13:14 21:::24 .TE .sp 2v hline, vline, hline bottom: .TS doublebox tab(:); l l l l l l l l l _| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp 2v hline bottom right: .TS doublebox tab(:); l l l _. 11:12 21: .TE .sp 2v vline bottom right: .TS doublebox tab(:); l l l l l l|. 11:12 21:22 31:32 .TE .sp 2v vline and hline bottom right: .TS doublebox tab(:); l l l l l| _. 11:12 21:22 31: .TE .sp 2v hline and vline bottom right: .TS doublebox tab(:); l l l l l _|. 11:12 21:22 31: .TE .sp 2v double vline in front: .TS doublebox tab(:); l l l l || l l l l. 11:12 21:22 31:32 41:42 .TE .sp 2v hline and double vline in front: .TS doublebox tab(:); l l l l _|| l l l. 11:12 21:22 :32 41:42 .TE .sp 2v double vline and hline in front: .TS doublebox tab(:); l l l l || _ l l l. 11:12 21:22 :32 41:42 .TE .sp 2v double vline in the middle: .TS doublebox tab(:); l l l l l l l|| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp 2v double vline and hline in the middle: .TS doublebox tab(:); l l l l l l l|| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp 2v hline and doble vline in the middle: .TS doublebox tab(:); l l l l l l l _|| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp 2v hline, double vline, hline in the middle: .TS doublebox tab(:); l l l l l l l l l _|| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp 2v double vline at the end: .TS doublebox tab(:); l l l l l l|| l l. 11:12 21:22 31:32 41:42 .TE .sp 2v double vline and hline at the end: .TS doublebox tab(:); l l l l l|| _ l l. 11:12 21:22 31: 41:42 .TE .sp 2v hline and double vline at the end: .TS doublebox tab(:); l l l l l _|| l l. 11:12 21:22 31: 41:42 .TE .sp 2v double vline bottom left: .TS doublebox tab(:); l l l l || l l. 11:12 21:22 31:32 .TE .sp 2v hline and double vline bottom left: .TS doublebox tab(:); l l l l _|| l. 11:12 21:22 :32 .TE .sp 2v double vline and hline bottom left: .TS doublebox tab(:); l l l l || _ l. 11:12 21:22 :32 .TE .sp 2v hline, double vline, hline bottom: .TS doublebox tab(:); l l l l l l l l l _|| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp 2v double vline bottom right: .TS doublebox tab(:); l l l l l l||. 11:12 21:22 31:32 .TE .sp 2v double vline and hline bottom right: .TS doublebox tab(:); l l l l l|| _. 11:12 21:22 31: .TE .sp 2v hline and double vline bottom right: .TS doublebox tab(:); l l l l l _||. 11:12 21:22 31: .TE .sp 2v vline left below hline top left: .TS doublebox tab(:); _ l | l l l l. :12 21:22 31:32 .TE .sp 2v vline right below hline top left: .TS doublebox tab(:); _ l l| l l l. :12 21:22 31:32 .TE .sp 2v vline left below hline at the top: .TS doublebox tab(:); l _ l l| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp 2v vline right below hline at the top: .TS doublebox tab(:); l _ l l l| l l l l. 11::13 21:22:23 31:32:33 .TE .sp 2v vline below hline at the top: .TS doublebox tab(:); l _ _ l l l| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp 2v vline left below hline top right: .TS doublebox tab(:); l _ l| l l l. 11: 21:22 31:32 .TE .sp 2v vline right below hline top right: .TS doublebox tab(:); l _ l l| l l. 11: 21:22 31:32 .TE .sp 2v vline left below hline in front: .TS doublebox tab(:); l l _ l | l l l l. 11:12 :22 31:32 41:42 .TE .sp 2v vline left above hline in front: .TS doublebox tab(:); l l l l | l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp 2v vline right below hline in front: .TS doublebox tab(:); l l _ l l| l l l. 11:12 :22 31:32 41:42 .TE .sp 2v vline right above hline in front: .TS doublebox tab(:); l l l l l| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp 2v vline left below hline in the middle: .TS doublebox tab(:); l l l l _ l l| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp 2v vline left above hline in the middle: .TS doublebox tab(:); l l l l l l l| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp 2v vline right below hline in the middle: .TS doublebox tab(:); l l l l _ l l l| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp 2v vline right above hline in the middle: .TS doublebox tab(:); l l l l l l l l| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp 2v vline below hline in the middle: .TS doublebox tab(:); l l l l l _ _ l l l| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp 2v vline above hline in the middle: .TS doublebox tab(:); l l l l l l l l l l| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp 2v vline left below hline at the end: .TS doublebox tab(:); l l l _ l| l l l. 11:12 21: 31:32 41:42 .TE .sp 2v vline left above hline at the end: .TS doublebox tab(:); l l l l l| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp 2v vline right below hline at the end: .TS doublebox tab(:); l l l _ l l| l l. 11:12 21: 31:32 41:42 .TE .sp 2v vline right above hline at the end: .TS doublebox tab(:); l l l l l l| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp 2v vline left above hline bottom left: .TS doublebox tab(:); l l l l | l l _ l. 11:12 21:22 31:32 :42 .TE .sp 2v vline right above hline bottom left: .TS doublebox tab(:); l l l l l| l _ l. 11:12 21:22 31:32 :42 .TE .sp 2v vline left above hline at the bottom: .TS doublebox tab(:); l l l l l l l| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp 2v vline right above hline at the bottom: .TS doublebox tab(:); l l l l l l l l| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp 2v vline above hline at the bottom: .TS doublebox tab(:); l l l l l l l l l l| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp 2v vline left above hline bottom right: .TS doublebox tab(:); l l l l l| l l _. 11:12 21:22 31:32 41: .TE .sp 2v vline right above hline bottom right: .TS doublebox tab(:); l l l l l l| l _. 11:12 21:22 31:32 41: .TE .sp 2v double vline left below hline top left: .TS doublebox tab(:); _ l || l l l l. :12 21:22 31:32 .TE .sp 2v double vline right below hline top left: .TS doublebox tab(:); _ l l|| l l l. :12 21:22 31:32 .TE .sp 2v double vline left below hline at the top: .TS doublebox tab(:); l _ l l|| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp 2v double vline right below hline at the top: .TS doublebox tab(:); l _ l l l|| l l l l. 11::13 21:22:23 31:32:33 .TE .sp 2v double vline below hline at the top: .TS doublebox tab(:); l _ _ l l l|| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp 2v double vline left below hline top right: .TS doublebox tab(:); l _ l|| l l l. 11: 21:22 31:32 .TE .sp 2v double vline right below hline top right: .TS doublebox tab(:); l _ l l|| l l. 11: 21:22 31:32 .TE .sp 2v double vline left below hline in front: .TS doublebox tab(:); l l _ l || l l l l. 11:12 :22 31:32 41:42 .TE .sp 2v double vline left above hline in front: .TS doublebox tab(:); l l l l || l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp 2v double vline right below hline in front: .TS doublebox tab(:); l l _ l l|| l l l. 11:12 :22 31:32 41:42 .TE .sp 2v double vline right above hline in front: .TS doublebox tab(:); l l l l l|| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp 2v double vline left below hline in the middle: .TS doublebox tab(:); l l l l _ l l|| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp 2v double vline left above hline in the middle: .TS doublebox tab(:); l l l l l l l|| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp 2v double vline right below hline in the middle: .TS doublebox tab(:); l l l l _ l l l|| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp 2v double vline right above hline in the middle: .TS doublebox tab(:); l l l l l l l l|| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp 2v double vline below hline in the middle: .TS doublebox tab(:); l l l l l _ _ l l l|| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp 2v double vline above hline in the middle: .TS doublebox tab(:); l l l l l l l l l l|| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp 2v double vline left below hline at the end: .TS doublebox tab(:); l l l _ l|| l l l. 11:12 21: 31:32 41:42 .TE .sp 2v double vline left above hline at the end: .TS doublebox tab(:); l l l l l|| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp 2v double vline right below hline at the end: .TS doublebox tab(:); l l l _ l l|| l l. 11:12 21: 31:32 41:42 .TE .sp 2v double vline right above hline at the end: .TS doublebox tab(:); l l l l l l|| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp 2v double vline left above hline bottom left: .TS doublebox tab(:); l l l l || l l _ l. 11:12 21:22 31:32 :42 .TE .sp 2v double vline right above hline bottom left: .TS doublebox tab(:); l l l l l|| l _ l. 11:12 21:22 31:32 :42 .TE .sp 2v double vline left above hline at the bottom: .TS doublebox tab(:); l l l l l l l|| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp 2v double vline right above hline at the bottom: .TS doublebox tab(:); l l l l l l l l|| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp 2v double vline above hline at the bottom: .TS doublebox tab(:); l l l l l l l l l l|| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp 2v double vline left above hline bottom right: .TS doublebox tab(:); l l l l l|| l l _. 11:12 21:22 31:32 41: .TE .sp 2v double vline right above hline bottom right: .TS doublebox tab(:); l l l l l l|| l _. 11:12 21:22 31:32 41: .TE .sp 2v .Sh DOUBLEBOX ALLBOX vline top left: .TS doublebox allbox tab(:); | l l l l. 11:12 21:22 .TE .sp 2v hline and vline top left: .TS doublebox allbox tab(:); _| l l l. :12 21:22 .TE .sp 2v vline and hline top left: .TS doublebox allbox tab(:); | _ l l l. :12 21:22 .TE .sp 2v vline top: .TS doublebox allbox tab(:); l| l l l. 11:12 21:22 .TE .sp 2v vline and hline top: .TS doublebox allbox tab(:); l| _ l l l l. 11::13 21:22:23 .TE .sp 2v hline and vline top: .TS doublebox allbox tab(:); l _| l l l l. 11::13 21:22:23 .TE .sp 2v hline, vline, hline top: .TS doublebox allbox tab(:); l _| _ l l l l l. 11:::13 21:22:23:24 .TE .sp 2v vline top right: .TS doublebox allbox tab(:); l l| l l. 11:12 21:22 .TE .sp 2v vline and hline top right: .TS doublebox allbox tab(:); l| _ l l. 11: 21:22 .TE .sp 2v hline and vline top right: .TS doublebox allbox tab(:); l _| l l. 11: 21:22 .TE .sp 2v double vline top left: .TS doublebox allbox tab(:); || l l l l. 11:12 21:22 .TE .sp 2v hline and double vline top left: .TS doublebox allbox tab(:); _|| l l l. :12 21:22 .TE .sp 2v double vline and hline top left: .TS doublebox allbox tab(:); || _ l l l. :12 21:22 .TE .sp 2v double vline top: .TS doublebox allbox tab(:); l|| l l l. 11:12 21:22 .TE .sp 2v double vline and hline top: .TS doublebox allbox tab(:); l|| _ l l l l. 11::13 21:22:23 .TE .sp 2v hline and double vline top: .TS doublebox allbox tab(:); l _|| l l l l. 11::13 21:22:23 .TE .sp 2v hline, double vline, hline top: .TS doublebox allbox tab(:); l _|| _ l l l l l. 11:::13 21:22:23:24 .TE .sp 2v double vline top right: .TS doublebox allbox tab(:); l l|| l l. 11:12 21:22 .TE .sp 2v double vline and hline top right: .TS doublebox allbox tab(:); l|| _ l l. 11: 21:22 .TE .sp 2v hline and double vline top right: .TS doublebox allbox tab(:); l _|| l l. 11: 21:22 .TE .sp 2v hline top left: .TS doublebox allbox tab(:); _ l l l. :12 21:22 .TE .sp 2v hline top: .TS doublebox allbox tab(:); l _ l l l l. 11::13 21:22:23 .TE .sp 2v double hline top: .TS doublebox allbox tab(:); l _ _ l l l l l. 11:::13 21:22:23:24 .TE .sp 2v hline top right: .TS doublebox allbox tab(:); l _ l l. 11: 21:22 .TE .sp 2v hline in front: .TS doublebox allbox tab(:); l l _ l l l. 11:12 :22 31:32 .TE .sp 2v vline in front: .TS doublebox allbox tab(:); l l l l | l l l l. 11:12 21:22 31:32 41:42 .TE .sp 2v hline and vline in front: .TS doublebox allbox tab(:); l l l l _| l l l. 11:12 21:22 :32 41:42 .TE .sp 2v vline and hline in front: .TS doublebox allbox tab(:); l l l l | _ l l l. 11:12 21:22 :32 41:42 .TE .sp 2v hline in the middle: .TS doublebox allbox tab(:); l l l l _ l l l l. 11:12:13 21::23 31:32:33 .TE .sp 2v vline in the middle: .TS doublebox allbox tab(:); l l l l l l l| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp 2v vline and hline in the middle: .TS doublebox allbox tab(:); l l l l l l l| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp 2v hline and vline in the middle: .TS doublebox allbox tab(:); l l l l l l l _| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp 2v double hline in the middle: .TS doublebox allbox tab(:); l l l l l _ _ l l l l l. 11:12:13:14 21:::24 31:32:33:34 .TE .sp 2v hline, vline, hline in the middle: .TS doublebox allbox tab(:); l l l l l l l l l _| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp 2v hline at the end: .TS doublebox allbox tab(:); l l l _ l l. 11:12 21: 31:32 .TE .sp 2v vline at the end: .TS doublebox allbox tab(:); l l l l l l| l l. 11:12 21:22 31:32 41:42 .TE .sp 2v vline and hline at the end: .TS doublebox allbox tab(:); l l l l l| _ l l. 11:12 21:22 31: 41:42 .TE .sp 2v hline and vline at the end: .TS doublebox allbox tab(:); l l l l l _| l l. 11:12 21:22 31: 41:42 .TE .sp 2v hline bottom left: .TS doublebox allbox tab(:); l l _ l. 11:12 :22 .TE .sp 2v vline bottom left: .TS doublebox allbox tab(:); l l l l | l l. 11:12 21:22 31:32 .TE .sp 2v hline and vline bottom left: .TS doublebox allbox tab(:); l l l l _| l. 11:12 21:22 :32 .TE .sp 2v vline and hline bottom left: .TS doublebox allbox tab(:); l l l l | _ l. 11:12 21:22 :32 .TE .sp 2v double hline bottom: .TS doublebox allbox tab(:); l l l l l _ _ l. 11:12:13:14 21:::24 .TE .sp 2v hline, vline, hline bottom: .TS doublebox allbox tab(:); l l l l l l l l l _| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp 2v hline bottom right: .TS doublebox allbox tab(:); l l l _. 11:12 21: .TE .sp 2v vline bottom right: .TS doublebox allbox tab(:); l l l l l l|. 11:12 21:22 31:32 .TE .sp 2v vline and hline bottom right: .TS doublebox allbox tab(:); l l l l l| _. 11:12 21:22 31: .TE .sp 2v hline and vline bottom right: .TS doublebox allbox tab(:); l l l l l _|. 11:12 21:22 31: .TE .sp 2v double vline in front: .TS doublebox allbox tab(:); l l l l || l l l l. 11:12 21:22 31:32 41:42 .TE .sp 2v hline and double vline in front: .TS doublebox allbox tab(:); l l l l _|| l l l. 11:12 21:22 :32 41:42 .TE .sp 2v double vline and hline in front: .TS doublebox allbox tab(:); l l l l || _ l l l. 11:12 21:22 :32 41:42 .TE .sp 2v double vline in the middle: .TS doublebox allbox tab(:); l l l l l l l|| l l l l l. 11:12:13 21:22:23 31:32:33 41:42:43 .TE .sp 2v double vline and hline in the middle: .TS doublebox allbox tab(:); l l l l l l l|| _ l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp 2v hline and doble vline in the middle: .TS doublebox allbox tab(:); l l l l l l l _|| l l l l. 11:12:13 21:22:23 31::33 41:42:43 .TE .sp 2v hline, double vline, hline in the middle: .TS doublebox allbox tab(:); l l l l l l l l l _|| _ l l l l l. 11:12:13:14 21:22:23:24 31:::34 41:42:43:44 .TE .sp 2v double vline at the end: .TS doublebox allbox tab(:); l l l l l l|| l l. 11:12 21:22 31:32 41:42 .TE .sp 2v double vline and hline at the end: .TS doublebox allbox tab(:); l l l l l|| _ l l. 11:12 21:22 31: 41:42 .TE .sp 2v hline and double vline at the end: .TS doublebox allbox tab(:); l l l l l _|| l l. 11:12 21:22 31: 41:42 .TE .sp 2v double vline bottom left: .TS doublebox allbox tab(:); l l l l || l l. 11:12 21:22 31:32 .TE .sp 2v hline and double vline bottom left: .TS doublebox allbox tab(:); l l l l _|| l. 11:12 21:22 :32 .TE .sp 2v double vline and hline bottom left: .TS doublebox allbox tab(:); l l l l || _ l. 11:12 21:22 :32 .TE .sp 2v hline, double vline, hline bottom: .TS doublebox allbox tab(:); l l l l l l l l l _|| _ l. 11:12:13:14 21:22:23:24 31:::34 .TE .sp 2v double vline bottom right: .TS doublebox allbox tab(:); l l l l l l||. 11:12 21:22 31:32 .TE .sp 2v double vline and hline bottom right: .TS doublebox allbox tab(:); l l l l l|| _. 11:12 21:22 31: .TE .sp 2v hline and double vline bottom right: .TS doublebox allbox tab(:); l l l l l _||. 11:12 21:22 31: .TE .sp 2v vline left below hline top left: .TS doublebox allbox tab(:); _ l | l l l l. :12 21:22 31:32 .TE .sp 2v vline right below hline top left: .TS doublebox allbox tab(:); _ l l| l l l. :12 21:22 31:32 .TE .sp 2v vline left below hline at the top: .TS doublebox allbox tab(:); l _ l l| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp 2v vline right below hline at the top: .TS doublebox allbox tab(:); l _ l l l| l l l l. 11::13 21:22:23 31:32:33 .TE .sp 2v vline below hline at the top: .TS doublebox allbox tab(:); l _ _ l l l| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp 2v vline left below hline top right: .TS doublebox allbox tab(:); l _ l| l l l. 11: 21:22 31:32 .TE .sp 2v vline right below hline top right: .TS doublebox allbox tab(:); l _ l l| l l. 11: 21:22 31:32 .TE .sp 2v vline left below hline in front: .TS doublebox allbox tab(:); l l _ l | l l l l. 11:12 :22 31:32 41:42 .TE .sp 2v vline left above hline in front: .TS doublebox allbox tab(:); l l l l | l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp 2v vline right below hline in front: .TS doublebox allbox tab(:); l l _ l l| l l l. 11:12 :22 31:32 41:42 .TE .sp 2v vline right above hline in front: .TS doublebox allbox tab(:); l l l l l| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp 2v vline left below hline in the middle: .TS doublebox allbox tab(:); l l l l _ l l| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp 2v vline left above hline in the middle: .TS doublebox allbox tab(:); l l l l l l l| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp 2v vline right below hline in the middle: .TS doublebox allbox tab(:); l l l l _ l l l| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp 2v vline right above hline in the middle: .TS doublebox allbox tab(:); l l l l l l l l| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp 2v vline below hline in the middle: .TS doublebox allbox tab(:); l l l l l _ _ l l l| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp 2v vline above hline in the middle: .TS doublebox allbox tab(:); l l l l l l l l l l| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp 2v vline left below hline at the end: .TS doublebox allbox tab(:); l l l _ l| l l l. 11:12 21: 31:32 41:42 .TE .sp 2v vline left above hline at the end: .TS doublebox allbox tab(:); l l l l l| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp 2v vline right below hline at the end: .TS doublebox allbox tab(:); l l l _ l l| l l. 11:12 21: 31:32 41:42 .TE .sp 2v vline right above hline at the end: .TS doublebox allbox tab(:); l l l l l l| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp 2v vline left above hline bottom left: .TS doublebox allbox tab(:); l l l l | l l _ l. 11:12 21:22 31:32 :42 .TE .sp 2v vline right above hline bottom left: .TS doublebox allbox tab(:); l l l l l| l _ l. 11:12 21:22 31:32 :42 .TE .sp 2v vline left above hline at the bottom: .TS doublebox allbox tab(:); l l l l l l l| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp 2v vline right above hline at the bottom: .TS doublebox allbox tab(:); l l l l l l l l| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp 2v vline above hline at the bottom: .TS doublebox allbox tab(:); l l l l l l l l l l| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp 2v vline left above hline bottom right: .TS doublebox allbox tab(:); l l l l l| l l _. 11:12 21:22 31:32 41: .TE .sp 2v vline right above hline bottom right: .TS doublebox allbox tab(:); l l l l l l| l _. 11:12 21:22 31:32 41: .TE .sp 2v double vline left below hline top left: .TS doublebox allbox tab(:); _ l || l l l l. :12 21:22 31:32 .TE .sp 2v double vline right below hline top left: .TS doublebox allbox tab(:); _ l l|| l l l. :12 21:22 31:32 .TE .sp 2v double vline left below hline at the top: .TS doublebox allbox tab(:); l _ l l|| l l l l l. 11::13 21:22:23 31:32:33 .TE .sp 2v double vline right below hline at the top: .TS doublebox allbox tab(:); l _ l l l|| l l l l. 11::13 21:22:23 31:32:33 .TE .sp 2v double vline below hline at the top: .TS doublebox allbox tab(:); l _ _ l l l|| l l l l l l. 11:::14 21:22:23:24 31:32:33:34 .TE .sp 2v double vline left below hline top right: .TS doublebox allbox tab(:); l _ l|| l l l. 11: 21:22 31:32 .TE .sp 2v double vline right below hline top right: .TS doublebox allbox tab(:); l _ l l|| l l. 11: 21:22 31:32 .TE .sp 2v double vline left below hline in front: .TS doublebox allbox tab(:); l l _ l || l l l l. 11:12 :22 31:32 41:42 .TE .sp 2v double vline left above hline in front: .TS doublebox allbox tab(:); l l l l || l l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp 2v double vline right below hline in front: .TS doublebox allbox tab(:); l l _ l l|| l l l. 11:12 :22 31:32 41:42 .TE .sp 2v double vline right above hline in front: .TS doublebox allbox tab(:); l l l l l|| l _ l l l. 11:12 21:22 31:32 :42 51:52 .TE .sp 2v double vline left below hline in the middle: .TS doublebox allbox tab(:); l l l l _ l l|| l l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp 2v double vline left above hline in the middle: .TS doublebox allbox tab(:); l l l l l l l|| l l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp 2v double vline right below hline in the middle: .TS doublebox allbox tab(:); l l l l _ l l l|| l l l l. 11:12:13 21::23 31:32:33 41:42:43 .TE .sp 2v double vline right above hline in the middle: .TS doublebox allbox tab(:); l l l l l l l l|| l l _ l l l l. 11:12:13 21:22:23 31:32:33 41::43 51:52:53 .TE .sp 2v double vline below hline in the middle: .TS doublebox allbox tab(:); l l l l l _ _ l l l|| l l l l l l. 11:12:13:14 21:::24 31:32:33:34 41:42:43:44 .TE .sp 2v double vline above hline in the middle: .TS doublebox allbox tab(:); l l l l l l l l l l|| l l l _ _ l l l l l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 51:52:53:54 .TE .sp 2v double vline left below hline at the end: .TS doublebox allbox tab(:); l l l _ l|| l l l. 11:12 21: 31:32 41:42 .TE .sp 2v double vline left above hline at the end: .TS doublebox allbox tab(:); l l l l l|| l l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp 2v double vline right below hline at the end: .TS doublebox allbox tab(:); l l l _ l l|| l l. 11:12 21: 31:32 41:42 .TE .sp 2v double vline right above hline at the end: .TS doublebox allbox tab(:); l l l l l l|| l _ l l. 11:12 21:22 31:32 41: 51:52 .TE .sp 2v double vline left above hline bottom left: .TS doublebox allbox tab(:); l l l l || l l _ l. 11:12 21:22 31:32 :42 .TE .sp 2v double vline right above hline bottom left: .TS doublebox allbox tab(:); l l l l l|| l _ l. 11:12 21:22 31:32 :42 .TE .sp 2v double vline left above hline at the bottom: .TS doublebox allbox tab(:); l l l l l l l|| l l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp 2v double vline right above hline at the bottom: .TS doublebox allbox tab(:); l l l l l l l l|| l l _ l. 11:12:13 21:22:23 31:32:33 41::43 .TE .sp 2v double vline above hline at the bottom: .TS doublebox allbox tab(:); l l l l l l l l l l|| l l l _ _ l. 11:12:13:14 21:22:23:24 31:32:33:34 41:::44 .TE .sp 2v double vline left above hline bottom right: .TS doublebox allbox tab(:); l l l l l|| l l _. 11:12 21:22 31:32 41: .TE .sp 2v double vline right above hline bottom right: .TS doublebox allbox tab(:); l l l l l l|| l _. 11:12 21:22 31:32 41: .TE .sp 2v mandoc-1.14.6/regress/tbl/layout/lines.out_ascii010064400017530001753000002751131312673167600221610ustar00schwarzeschwarzeTBL-LAYOUT-LINES(1) General Commands Manual TBL-LAYOUT-LINES(1) NNAAMMEE ttbbll--llaayyoouutt--lliinneess - table cells containing lines DDEESSCCRRIIPPTTIIOONN hline top left: ---- 12 21 22 hline top: 11 ------ 13 21 22 23 double hline top: 11 ----------- 13 21 22 23 24 hline top right: 11 ----- 21 22 hline in front: 11 12 ---- 22 31 32 vline in front: 11 12 |21 22 |31 32 41 42 hline and vline in front: 11 12 21 | 22 ---+ 32 41 42 vline and hline in front: 11 12 |21 22 +---- 32 41 42 hline in the middle: 11 12 13 21 ------ 23 31 32 33 vline in the middle: 11 12 13 21 | 22 23 31 | 32 33 41 42 43 vline and hline in the middle: 11 12 13 21 | 22 23 31 +----- 33 41 42 43 hline and vline in the middle: 11 12 13 21 22 | 23 31 -----+ 33 41 42 43 double hline in the middle: 11 12 13 14 21 ----------- 24 31 32 33 34 hline, vline, hline in the middle: 11 12 13 14 21 22 | 23 24 31 -----+----- 34 41 42 43 44 hline at the end: 11 12 21 ----- 31 32 vline at the end: 11 12 21 22 | 31 32 | 41 42 vline and hline at the end: 11 12 21 | 22 31 +---- 41 42 hline and vline at the end: 11 12 21 22 | 31 -----+ 41 42 hline bottom left: 11 12 ---- 22 vline bottom left: 11 12 |21 22 |31 32 hline and vline bottom left: 11 12 21 | 22 ---+ 32 vline and hline bottom left: 11 12 |21 22 +---- 32 double hline bottom: 11 12 13 14 21 ----------- 24 hline, vline, hline bottom: 11 12 13 14 21 22 | 23 24 31 -----+----- 34 hline bottom right: 11 12 21 ----- vline bottom right: 11 12 21 22 | 31 32 | vline and hline bottom right: 11 12 21 | 22 31 +---- hline and vline bottom right: 11 12 21 22 | 31 -----+ double vline in front: 11 12 |21 22 |31 32 41 42 hline and double vline in front: 11 12 21 ||22 ---+|32 41 42 double vline and hline in front: 11 12 |21 22 +---- 32 41 42 double vline in the middle: 11 12 13 21 ||22 23 31 ||32 33 41 42 43 double vline and hline in the middle: 11 12 13 21 ||22 23 31 ++---- 33 41 42 43 hline and doble vline in the middle: 11 12 13 21 22 ||23 31 -----+|33 41 42 43 hline, double vline, hline in the middle: 11 12 13 14 21 22 ||23 24 31 -----++---- 34 41 42 43 44 double vline at the end: 11 12 21 22 | 31 32 | 41 42 double vline and hline at the end: 11 12 21 ||22 31 ++--- 41 42 hline and double vline at the end: 11 12 21 22 | 31 -----+ 41 42 double vline bottom left: 11 12 |21 22 |31 32 hline and double vline bottom left: 11 12 21 ||22 ---+|32 double vline and hline bottom left: 11 12 |21 22 +---- 32 hline, double vline, hline bottom: 11 12 13 14 21 22 ||23 24 31 -----++---- 34 double vline bottom right: 11 12 21 22 | 31 32 | double vline and hline bottom right: 11 12 21 ||22 31 ++--- hline and double vline bottom right: 11 12 21 22 | 31 -----+ vline left below hline top left: +---- 12 |21 22 31 32 vline right below hline top left: ---+ 12 21 | 22 31 32 vline left below hline at the top: 11 +----- 13 21 | 22 23 31 32 33 vline right below hline at the top: 11 -----+ 13 21 22 | 23 31 32 33 vline below hline at the top: 11 -----+----- 14 21 22 | 23 24 31 32 33 34 vline left below hline top right: 11 +---- 21 | 22 31 32 vline right below hline top right: 11 -----+ 21 22 | 31 32 vline left below hline in front: 11 12 +---- 22 |31 32 41 42 vline left above hline in front: 11 12 |21 22 |31 32 +---- 42 51 52 vline right below hline in front: 11 12 ---+ 22 31 | 32 41 42 vline right above hline in front: 11 12 21 | 22 31 | 32 ---+ 42 51 52 vline left below hline in the middle: 11 12 13 21 +----- 23 31 | 32 33 41 42 43 vline left above hline in the middle: 11 12 13 21 | 22 23 31 | 32 33 41 +----- 43 51 52 53 vline right below hline in the middle: 11 12 13 21 -----+ 23 31 32 | 33 41 42 43 vline right above hline in the middle: 11 12 13 21 22 | 23 31 32 | 33 41 -----+ 43 51 52 53 vline below hline in the middle: 11 12 13 14 21 -----+----- 24 31 32 | 33 34 41 42 43 44 vline above hline in the middle: 11 12 13 14 21 22 | 23 24 31 32 | 33 34 41 -----+----- 44 51 52 53 54 vline left below hline at the end: 11 12 21 +---- 31 | 32 41 42 vline left above hline at the end: 11 12 21 | 22 31 | 32 41 +---- 51 52 vline right below hline at the end: 11 12 21 -----+ 31 32 | 41 42 vline right above hline at the end: 11 12 21 22 | 31 32 | 41 -----+ 51 52 vline left above hline bottom left: 11 12 |21 22 |31 32 +---- 42 vline right above hline bottom left: 11 12 21 | 22 31 | 32 ---+ 42 vline left above hline at the bottom: 11 12 13 21 | 22 23 31 | 32 33 41 +----- 43 vline right above hline at the bottom: 11 12 13 21 22 | 23 31 32 | 33 41 -----+ 43 vline above hline at the bottom: 11 12 13 14 21 22 | 23 24 31 32 | 33 34 41 -----+----- 44 vline left above hline bottom right: 11 12 21 | 22 31 | 32 41 +---- vline right above hline bottom right: 11 12 21 22 | 31 32 | 41 -----+ double vline left below hline top left: +---- 12 |21 22 31 32 double vline right below hline top left: ---+|12 21 ||22 31 32 double vline left below hline at the top: 11 ++---- 13 21 ||22 23 31 32 33 double vline right below hline at the top: 11 -----+|13 21 22 ||23 31 32 33 double vline below hline at the top: 11 -----++---- 14 21 22 ||23 24 31 32 33 34 double vline left below hline top right: 11 ++--- 21 ||22 31 32 double vline right below hline top right: 11 -----+ 21 22 | 31 32 double vline left below hline in front: 11 12 +---- 22 |31 32 41 42 double vline left above hline in front: 11 12 |21 22 |31 32 +---- 42 51 52 double vline right below hline in front: 11 12 ---+|22 31 ||32 41 42 double vline right above hline in front: 11 12 21 ||22 31 ||32 ---+|42 51 52 double vline left below hline in the middle: 11 12 13 21 ++---- 23 31 ||32 33 41 42 43 double vline left above hline in the middle: 11 12 13 21 ||22 23 31 ||32 33 41 ++---- 43 51 52 53 double vline right below hline in the middle: 11 12 13 21 -----+|23 31 32 ||33 41 42 43 double vline right above hline in the middle: 11 12 13 21 22 ||23 31 32 ||33 41 -----+|43 51 52 53 double vline below hline in the middle: 11 12 13 14 21 -----++---- 24 31 32 ||33 34 41 42 43 44 double vline above hline in the middle: 11 12 13 14 21 22 ||23 24 31 32 ||33 34 41 -----++---- 44 51 52 53 54 double vline left below hline at the end: 11 12 21 ++--- 31 ||32 41 42 double vline left above hline at the end: 11 12 21 ||22 31 ||32 41 ++--- 51 52 double vline right below hline at the end: 11 12 21 -----+ 31 32 | 41 42 double vline right above hline at the end: 11 12 21 22 | 31 32 | 41 -----+ 51 52 double vline left above hline bottom left: 11 12 |21 22 |31 32 +---- 42 double vline right above hline bottom left: 11 12 21 ||22 31 ||32 ---+|42 double vline left above hline at the bottom: 11 12 13 21 ||22 23 31 ||32 33 41 ++---- 43 double vline right above hline at the bottom: 11 12 13 21 22 ||23 31 32 ||33 41 -----+|43 double vline above hline at the bottom: 11 12 13 14 21 22 ||23 24 31 32 ||33 34 41 -----++---- 44 double vline left above hline bottom right: 11 12 21 ||22 31 ||32 41 ++--- double vline right above hline bottom right: 11 12 21 22 | 31 32 | 41 -----+ BBOOXXEEDD vline top left: +--------+ |11 12 | |21 22 | +--------+ hline and vline top left: +---+----+ +---+ 12 | |21 22 | +--------+ vline and hline top left: +--------+ +---- 12 | |21 22 | +--------+ vline top: +---+----+ |11 | 12 | |21 22 | +--------+ vline and hline top: +---+---------+ |11 +----- 13 | |21 22 23 | +-------------+ hline and vline top: +--------+----+ |11 -----+ 13 | |21 22 23 | +-------------+ hline, vline, hline top: +--------+---------+ |11 -----+----- 13 | |21 22 23 24 | +------------------+ vline top right: +--------+ |11 12 | |21 22 | +--------+ vline and hline top right: +---+----+ |11 +----+ |21 22 | +--------+ hline and vline top right: +--------+ |11 -----+ |21 22 | +--------+ double vline top left: +--------+ |11 12 | |21 22 | +--------+ hline and double vline top left: +---++---+ +---+|12 | |21 22 | +--------+ double vline and hline top left: +--------+ +---- 12 | |21 22 | +--------+ double vline top: +---++---+ |11 ||12 | |21 22 | +--------+ double vline and hline top: +---++--------+ |11 ++---- 13 | |21 22 23 | +-------------+ hline and double vline top: +--------++---+ |11 -----+|13 | |21 22 23 | +-------------+ hline, double vline, hline top: +--------++--------+ |11 -----++---- 13 | |21 22 23 24 | +------------------+ double vline top right: +--------+ |11 12 | |21 22 | +--------+ double vline and hline top right: +---++---+ |11 ++---+ |21 22 | +--------+ hline and double vline top right: +--------+ |11 -----+ |21 22 | +--------+ hline top left: +--------+ +---- 12 | |21 22 | +--------+ hline top: +-------------+ |11 ------ 13 | |21 22 23 | +-------------+ double hline top: +------------------+ |11 ----------- 13 | |21 22 23 24 | +------------------+ hline top right: +--------+ |11 -----+ |21 22 | +--------+ hline in front: +--------+ |11 12 | +---- 22 | |31 32 | +--------+ vline in front: +--------+ |11 12 | |21 22 | |31 32 | |41 42 | +--------+ hline and vline in front: +--------+ |11 12 | |21 | 22 | +---+ 32 | |41 42 | +--------+ vline and hline in front: +--------+ |11 12 | |21 22 | +---- 32 | |41 42 | +--------+ hline in the middle: +-------------+ |11 12 13 | |21 ------ 23 | |31 32 33 | +-------------+ vline in the middle: +-------------+ |11 12 13 | |21 | 22 23 | |31 | 32 33 | |41 42 43 | +-------------+ vline and hline in the middle: +-------------+ |11 12 13 | |21 | 22 23 | |31 +----- 33 | |41 42 43 | +-------------+ hline and vline in the middle: +-------------+ |11 12 13 | |21 22 | 23 | |31 -----+ 33 | |41 42 43 | +-------------+ double hline in the middle: +------------------+ |11 12 13 14 | |21 ----------- 24 | |31 32 33 34 | +------------------+ hline, vline, hline in the middle: +------------------+ |11 12 13 14 | |21 22 | 23 24 | |31 -----+----- 34 | |41 42 43 44 | +------------------+ hline at the end: +--------+ |11 12 | |21 -----+ |31 32 | +--------+ vline at the end: +--------+ |11 12 | |21 22 | |31 32 | |41 42 | +--------+ vline and hline at the end: +--------+ |11 12 | |21 | 22 | |31 +----+ |41 42 | +--------+ hline and vline at the end: +--------+ |11 12 | |21 22 | |31 -----+ |41 42 | +--------+ hline bottom left: +--------+ |11 12 | +---- 22 | +--------+ vline bottom left: +--------+ |11 12 | |21 22 | |31 32 | +--------+ hline and vline bottom left: +--------+ |11 12 | |21 | 22 | +---+ 32 | +---+----+ vline and hline bottom left: +--------+ |11 12 | |21 22 | +---- 32 | +--------+ double hline bottom: +------------------+ |11 12 13 14 | |21 ----------- 24 | +------------------+ hline, vline, hline bottom: +------------------+ |11 12 13 14 | |21 22 | 23 24 | |31 -----+----- 34 | +--------+---------+ hline bottom right: +--------+ |11 12 | |21 -----+ +--------+ vline bottom right: +--------+ |11 12 | |21 22 | |31 32 | +--------+ vline and hline bottom right: +--------+ |11 12 | |21 | 22 | |31 +----+ +---+----+ hline and vline bottom right: +--------+ |11 12 | |21 22 | |31 -----+ +--------+ double vline in front: +--------+ |11 12 | |21 22 | |31 32 | |41 42 | +--------+ hline and double vline in front: +--------+ |11 12 | |21 ||22 | +---+|32 | |41 42 | +--------+ double vline and hline in front: +--------+ |11 12 | |21 22 | +---- 32 | |41 42 | +--------+ double vline in the middle: +-------------+ |11 12 13 | |21 ||22 23 | |31 ||32 33 | |41 42 43 | +-------------+ double vline and hline in the middle: +-------------+ |11 12 13 | |21 ||22 23 | |31 ++---- 33 | |41 42 43 | +-------------+ hline and doble vline in the middle: +-------------+ |11 12 13 | |21 22 ||23 | |31 -----+|33 | |41 42 43 | +-------------+ hline, double vline, hline in the middle: +------------------+ |11 12 13 14 | |21 22 ||23 24 | |31 -----++---- 34 | |41 42 43 44 | +------------------+ double vline at the end: +--------+ |11 12 | |21 22 | |31 32 | |41 42 | +--------+ double vline and hline at the end: +--------+ |11 12 | |21 ||22 | |31 ++---+ |41 42 | +--------+ hline and double vline at the end: +--------+ |11 12 | |21 22 | |31 -----+ |41 42 | +--------+ double vline bottom left: +--------+ |11 12 | |21 22 | |31 32 | +--------+ hline and double vline bottom left: +--------+ |11 12 | |21 ||22 | +---+|32 | +---++---+ double vline and hline bottom left: +--------+ |11 12 | |21 22 | +---- 32 | +--------+ hline, double vline, hline bottom: +------------------+ |11 12 13 14 | |21 22 ||23 24 | |31 -----++---- 34 | +--------++--------+ double vline bottom right: +--------+ |11 12 | |21 22 | |31 32 | +--------+ double vline and hline bottom right: +--------+ |11 12 | |21 ||22 | |31 ++---+ +---++---+ hline and double vline bottom right: +--------+ |11 12 | |21 22 | |31 -----+ +--------+ vline left below hline top left: +--------+ +---- 12 | |21 22 | |31 32 | +--------+ vline right below hline top left: +--------+ +---+ 12 | |21 | 22 | |31 32 | +--------+ vline left below hline at the top: +-------------+ |11 +----- 13 | |21 | 22 23 | |31 32 33 | +-------------+ vline right below hline at the top: +-------------+ |11 -----+ 13 | |21 22 | 23 | |31 32 33 | +-------------+ vline below hline at the top: +------------------+ |11 -----+----- 14 | |21 22 | 23 24 | |31 32 33 34 | +------------------+ vline left below hline top right: +--------+ |11 +----+ |21 | 22 | |31 32 | +--------+ vline right below hline top right: +--------+ |11 -----+ |21 22 | |31 32 | +--------+ vline left below hline in front: +--------+ |11 12 | +---- 22 | |31 32 | |41 42 | +--------+ vline left above hline in front: +--------+ |11 12 | |21 22 | |31 32 | +---- 42 | |51 52 | +--------+ vline right below hline in front: +--------+ |11 12 | +---+ 22 | |31 | 32 | |41 42 | +--------+ vline right above hline in front: +--------+ |11 12 | |21 | 22 | |31 | 32 | +---+ 42 | |51 52 | +--------+ vline left below hline in the middle: +-------------+ |11 12 13 | |21 +----- 23 | |31 | 32 33 | |41 42 43 | +-------------+ vline left above hline in the middle: +-------------+ |11 12 13 | |21 | 22 23 | |31 | 32 33 | |41 +----- 43 | |51 52 53 | +-------------+ vline right below hline in the middle: +-------------+ |11 12 13 | |21 -----+ 23 | |31 32 | 33 | |41 42 43 | +-------------+ vline right above hline in the middle: +-------------+ |11 12 13 | |21 22 | 23 | |31 32 | 33 | |41 -----+ 43 | |51 52 53 | +-------------+ vline below hline in the middle: +------------------+ |11 12 13 14 | |21 -----+----- 24 | |31 32 | 33 34 | |41 42 43 44 | +------------------+ vline above hline in the middle: +------------------+ |11 12 13 14 | |21 22 | 23 24 | |31 32 | 33 34 | |41 -----+----- 44 | |51 52 53 54 | +------------------+ vline left below hline at the end: +--------+ |11 12 | |21 +----+ |31 | 32 | |41 42 | +--------+ vline left above hline at the end: +--------+ |11 12 | |21 | 22 | |31 | 32 | |41 +----+ |51 52 | +--------+ vline right below hline at the end: +--------+ |11 12 | |21 -----+ |31 32 | |41 42 | +--------+ vline right above hline at the end: +--------+ |11 12 | |21 22 | |31 32 | |41 -----+ |51 52 | +--------+ vline left above hline bottom left: +--------+ |11 12 | |21 22 | |31 32 | +---- 42 | +--------+ vline right above hline bottom left: +--------+ |11 12 | |21 | 22 | |31 | 32 | +---+ 42 | +--------+ vline left above hline at the bottom: +-------------+ |11 12 13 | |21 | 22 23 | |31 | 32 33 | |41 +----- 43 | +-------------+ vline right above hline at the bottom: +-------------+ |11 12 13 | |21 22 | 23 | |31 32 | 33 | |41 -----+ 43 | +-------------+ vline above hline at the bottom: +------------------+ |11 12 13 14 | |21 22 | 23 24 | |31 32 | 33 34 | |41 -----+----- 44 | +------------------+ vline left above hline bottom right: +--------+ |11 12 | |21 | 22 | |31 | 32 | |41 +----+ +--------+ vline right above hline bottom right: +--------+ |11 12 | |21 22 | |31 32 | |41 -----+ +--------+ double vline left below hline top left: +--------+ +---- 12 | |21 22 | |31 32 | +--------+ double vline right below hline top left: +--------+ +---+|12 | |21 ||22 | |31 32 | +--------+ double vline left below hline at the top: +-------------+ |11 ++---- 13 | |21 ||22 23 | |31 32 33 | +-------------+ double vline right below hline at the top: +-------------+ |11 -----+|13 | |21 22 ||23 | |31 32 33 | +-------------+ double vline below hline at the top: +------------------+ |11 -----++---- 14 | |21 22 ||23 24 | |31 32 33 34 | +------------------+ double vline left below hline top right: +--------+ |11 ++---+ |21 ||22 | |31 32 | +--------+ double vline right below hline top right: +--------+ |11 -----+ |21 22 | |31 32 | +--------+ double vline left below hline in front: +--------+ |11 12 | +---- 22 | |31 32 | |41 42 | +--------+ double vline left above hline in front: +--------+ |11 12 | |21 22 | |31 32 | +---- 42 | |51 52 | +--------+ double vline right below hline in front: +--------+ |11 12 | +---+|22 | |31 ||32 | |41 42 | +--------+ double vline right above hline in front: +--------+ |11 12 | |21 ||22 | |31 ||32 | +---+|42 | |51 52 | +--------+ double vline left below hline in the middle: +-------------+ |11 12 13 | |21 ++---- 23 | |31 ||32 33 | |41 42 43 | +-------------+ double vline left above hline in the middle: +-------------+ |11 12 13 | |21 ||22 23 | |31 ||32 33 | |41 ++---- 43 | |51 52 53 | +-------------+ double vline right below hline in the middle: +-------------+ |11 12 13 | |21 -----+|23 | |31 32 ||33 | |41 42 43 | +-------------+ double vline right above hline in the middle: +-------------+ |11 12 13 | |21 22 ||23 | |31 32 ||33 | |41 -----+|43 | |51 52 53 | +-------------+ double vline below hline in the middle: +------------------+ |11 12 13 14 | |21 -----++---- 24 | |31 32 ||33 34 | |41 42 43 44 | +------------------+ double vline above hline in the middle: +------------------+ |11 12 13 14 | |21 22 ||23 24 | |31 32 ||33 34 | |41 -----++---- 44 | |51 52 53 54 | +------------------+ double vline left below hline at the end: +--------+ |11 12 | |21 ++---+ |31 ||32 | |41 42 | +--------+ double vline left above hline at the end: +--------+ |11 12 | |21 ||22 | |31 ||32 | |41 ++---+ |51 52 | +--------+ double vline right below hline at the end: +--------+ |11 12 | |21 -----+ |31 32 | |41 42 | +--------+ double vline right above hline at the end: +--------+ |11 12 | |21 22 | |31 32 | |41 -----+ |51 52 | +--------+ double vline left above hline bottom left: +--------+ |11 12 | |21 22 | |31 32 | +---- 42 | +--------+ double vline right above hline bottom left: +--------+ |11 12 | |21 ||22 | |31 ||32 | +---+|42 | +--------+ double vline left above hline at the bottom: +-------------+ |11 12 13 | |21 ||22 23 | |31 ||32 33 | |41 ++---- 43 | +-------------+ double vline right above hline at the bottom: +-------------+ |11 12 13 | |21 22 ||23 | |31 32 ||33 | |41 -----+|43 | +-------------+ double vline above hline at the bottom: +------------------+ |11 12 13 14 | |21 22 ||23 24 | |31 32 ||33 34 | |41 -----++---- 44 | +------------------+ double vline left above hline bottom right: +--------+ |11 12 | |21 ||22 | |31 ||32 | |41 ++---+ +--------+ double vline right above hline bottom right: +--------+ |11 12 | |21 22 | |31 32 | |41 -----+ +--------+ AALLLLBBOOXX vline top left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ hline and vline top left: +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ vline and hline top left: +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ vline top: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ vline and hline top: +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ hline and vline top: +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ hline, vline, hline top: +---+----+----+----+ |11 +----+----+ 13 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ vline top right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ vline and hline top right: +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ hline and vline top right: +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ double vline top left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ hline and double vline top left: +---++---+ +---+|12 | +---++---+ |21 | 22 | +---+----+ double vline and hline top left: +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ double vline top: +---++---+ |11 ||12 | +---++---+ |21 | 22 | +---+----+ double vline and hline top: +---++---+----+ |11 ++---+ 13 | +---++---+----+ |21 | 22 | 23 | +---+----+----+ hline and double vline top: +---+----++---+ |11 +----+|13 | +---+----++---+ |21 | 22 | 23 | +---+----+----+ hline, double vline, hline top: +---+----++---+----+ |11 +----++---+ 13 | +---+----++---+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ double vline top right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ double vline and hline top right: +---++---+ |11 ++---+ +---++---+ |21 | 22 | +---+----+ hline and double vline top right: +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ hline top left: +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ hline top: +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ double hline top: +---+----+----+----+ |11 +----+----+ 13 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ hline top right: +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ hline in front: +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ |31 | 32 | +---+----+ vline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ hline and vline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ |41 | 42 | +---+----+ vline and hline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ |41 | 42 | +---+----+ hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ vline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ vline and hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 +----+ 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ hline and vline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 +----+ 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ double hline in the middle: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 +----+----+ 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ hline, vline, hline in the middle: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 +----+----+ 34 | +---+----+----+----+ |41 | 42 | 43 | 44 | +---+----+----+----+ hline at the end: +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ |31 | 32 | +---+----+ vline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ vline and hline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ |41 | 42 | +---+----+ hline and vline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ |41 | 42 | +---+----+ hline bottom left: +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ vline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ hline and vline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ vline and hline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ double hline bottom: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 +----+----+ 24 | +---+----+----+----+ hline, vline, hline bottom: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 +----+----+ 34 | +---+----+----+----+ hline bottom right: +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ vline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ vline and hline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ hline and vline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ double vline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ hline and double vline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ +---+|32 | +---++---+ |41 | 42 | +---+----+ double vline and hline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ |41 | 42 | +---+----+ double vline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---++---+----+ |31 ||32 | 33 | +---++---+----+ |41 | 42 | 43 | +---+----+----+ double vline and hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---++---+----+ |31 ++---+ 33 | +---++---+----+ |41 | 42 | 43 | +---+----+----+ hline and doble vline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----++---+ |31 +----+|33 | +---+----++---+ |41 | 42 | 43 | +---+----+----+ hline, double vline, hline in the middle: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----++---+----+ |31 +----++---+ 34 | +---+----++---+----+ |41 | 42 | 43 | 44 | +---+----+----+----+ double vline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ double vline and hline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ++---+ +---++---+ |41 | 42 | +---+----+ hline and double vline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ |41 | 42 | +---+----+ double vline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ hline and double vline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ +---+|32 | +---++---+ double vline and hline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ hline, double vline, hline bottom: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----++---+----+ |31 +----++---+ 34 | +---+----++---+----+ double vline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ double vline and hline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ++---+ +---++---+ hline and double vline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ vline left below hline top left: +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ vline right below hline top left: +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ vline left below hline at the top: +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ vline right below hline at the top: +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ vline below hline at the top: +---+----+----+----+ |11 +----+----+ 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ vline left below hline top right: +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ vline right below hline top right: +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ vline left below hline in front: +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ vline left above hline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ |51 | 52 | +---+----+ vline right below hline in front: +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ vline right above hline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ |51 | 52 | +---+----+ vline left below hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ vline left above hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 +----+ 43 | +---+----+----+ |51 | 52 | 53 | +---+----+----+ vline right below hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ vline right above hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 +----+ 43 | +---+----+----+ |51 | 52 | 53 | +---+----+----+ vline below hline in the middle: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 +----+----+ 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ |41 | 42 | 43 | 44 | +---+----+----+----+ vline above hline in the middle: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ |41 +----+----+ 44 | +---+----+----+----+ |51 | 52 | 53 | 54 | +---+----+----+----+ vline left below hline at the end: +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ vline left above hline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ |51 | 52 | +---+----+ vline right below hline at the end: +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ vline right above hline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ |51 | 52 | +---+----+ vline left above hline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ vline right above hline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ vline left above hline at the bottom: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 +----+ 43 | +---+----+----+ vline right above hline at the bottom: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 +----+ 43 | +---+----+----+ vline above hline at the bottom: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ |41 +----+----+ 44 | +---+----+----+----+ vline left above hline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ vline right above hline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ double vline left below hline top left: +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ double vline right below hline top left: +---+----+ +---+ 12 | +---++---+ |21 ||22 | +---++---+ |31 | 32 | +---+----+ double vline left below hline at the top: +---+----+----+ |11 +----+ 13 | +---++---+----+ |21 ||22 | 23 | +---++---+----+ |31 | 32 | 33 | +---+----+----+ double vline right below hline at the top: +---+----+----+ |11 +----+ 13 | +---+----++---+ |21 | 22 ||23 | +---+----++---+ |31 | 32 | 33 | +---+----+----+ double vline below hline at the top: +---+----+----+----+ |11 +----+----+ 14 | +---+----++---+----+ |21 | 22 ||23 | 24 | +---+----++---+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ double vline left below hline top right: +---+----+ |11 +----+ +---++---+ |21 ||22 | +---++---+ |31 | 32 | +---+----+ double vline right below hline top right: +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ double vline left below hline in front: +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ double vline left above hline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ |51 | 52 | +---+----+ double vline right below hline in front: +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---++---+ |31 ||32 | +---++---+ |41 | 42 | +---+----+ double vline right above hline in front: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ||32 | +---++---+ +---+|42 | +---+----+ |51 | 52 | +---+----+ double vline left below hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---++---+----+ |31 ||32 | 33 | +---++---+----+ |41 | 42 | 43 | +---+----+----+ double vline left above hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---++---+----+ |31 ||32 | 33 | +---++---+----+ |41 ++---+ 43 | +---+----+----+ |51 | 52 | 53 | +---+----+----+ double vline right below hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---+----++---+ |31 | 32 ||33 | +---+----++---+ |41 | 42 | 43 | +---+----+----+ double vline right above hline in the middle: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----++---+ |31 | 32 ||33 | +---+----++---+ |41 +----+|43 | +---+----+----+ |51 | 52 | 53 | +---+----+----+ double vline below hline in the middle: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 +----+----+ 24 | +---+----++---+----+ |31 | 32 ||33 | 34 | +---+----++---+----+ |41 | 42 | 43 | 44 | +---+----+----+----+ double vline above hline in the middle: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----++---+----+ |31 | 32 ||33 | 34 | +---+----++---+----+ |41 +----++---+ 44 | +---+----+----+----+ |51 | 52 | 53 | 54 | +---+----+----+----+ double vline left below hline at the end: +---+----+ |11 | 12 | +---+----+ |21 +----+ +---++---+ |31 ||32 | +---++---+ |41 | 42 | +---+----+ double vline left above hline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ||32 | +---++---+ |41 ++---+ +---+----+ |51 | 52 | +---+----+ double vline right below hline at the end: +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ double vline right above hline at the end: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ |51 | 52 | +---+----+ double vline left above hline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ double vline right above hline bottom left: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ||32 | +---++---+ +---+|42 | +---+----+ double vline left above hline at the bottom: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---++---+----+ |31 ||32 | 33 | +---++---+----+ |41 ++---+ 43 | +---+----+----+ double vline right above hline at the bottom: +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----++---+ |31 | 32 ||33 | +---+----++---+ |41 +----+|43 | +---+----+----+ double vline above hline at the bottom: +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----++---+----+ |31 | 32 ||33 | 34 | +---+----++---+----+ |41 +----++---+ 44 | +---+----+----+----+ double vline left above hline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ||32 | +---++---+ |41 ++---+ +---+----+ double vline right above hline bottom right: +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ DDOOUUBBLLEEBBOOXX vline top left: +--------+ +--------+ |11 12 | |21 22 | +--------+ +--------+ hline and vline top left: +--------+ +---+----+ +---+ 12 | |21 22 | +--------+ +--------+ vline and hline top left: +--------+ +--------+ +---- 12 | |21 22 | +--------+ +--------+ vline top: +--------+ +---+----+ |11 | 12 | |21 22 | +--------+ +--------+ vline and hline top: +-------------+ +---+---------+ |11 +----- 13 | |21 22 23 | +-------------+ +-------------+ hline and vline top: +-------------+ +--------+----+ |11 -----+ 13 | |21 22 23 | +-------------+ +-------------+ hline, vline, hline top: +------------------+ +--------+---------+ |11 -----+----- 13 | |21 22 23 24 | +------------------+ +------------------+ vline top right: +--------+ +--------+ |11 12 | |21 22 | +--------+ +--------+ vline and hline top right: +--------+ +---+----+ |11 +----+ |21 22 | +--------+ +--------+ hline and vline top right: +--------+ +--------+ |11 -----+ |21 22 | +--------+ +--------+ double vline top left: +--------+ +--------+ |11 12 | |21 22 | +--------+ +--------+ hline and double vline top left: +--------+ +---++---+ +---+|12 | |21 22 | +--------+ +--------+ double vline and hline top left: +--------+ +--------+ +---- 12 | |21 22 | +--------+ +--------+ double vline top: +--------+ +---++---+ |11 ||12 | |21 22 | +--------+ +--------+ double vline and hline top: +-------------+ +---++--------+ |11 ++---- 13 | |21 22 23 | +-------------+ +-------------+ hline and double vline top: +-------------+ +--------++---+ |11 -----+|13 | |21 22 23 | +-------------+ +-------------+ hline, double vline, hline top: +------------------+ +--------++--------+ |11 -----++---- 13 | |21 22 23 24 | +------------------+ +------------------+ double vline top right: +--------+ +--------+ |11 12 | |21 22 | +--------+ +--------+ double vline and hline top right: +--------+ +---++---+ |11 ++---+ |21 22 | +--------+ +--------+ hline and double vline top right: +--------+ +--------+ |11 -----+ |21 22 | +--------+ +--------+ hline top left: +--------+ +--------+ +---- 12 | |21 22 | +--------+ +--------+ hline top: +-------------+ +-------------+ |11 ------ 13 | |21 22 23 | +-------------+ +-------------+ double hline top: +------------------+ +------------------+ |11 ----------- 13 | |21 22 23 24 | +------------------+ +------------------+ hline top right: +--------+ +--------+ |11 -----+ |21 22 | +--------+ +--------+ hline in front: +--------+ +--------+ |11 12 | +---- 22 | |31 32 | +--------+ +--------+ vline in front: +--------+ +--------+ |11 12 | |21 22 | |31 32 | |41 42 | +--------+ +--------+ hline and vline in front: +--------+ +--------+ |11 12 | |21 | 22 | +---+ 32 | |41 42 | +--------+ +--------+ vline and hline in front: +--------+ +--------+ |11 12 | |21 22 | +---- 32 | |41 42 | +--------+ +--------+ hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 ------ 23 | |31 32 33 | +-------------+ +-------------+ vline in the middle: +-------------+ +-------------+ |11 12 13 | |21 | 22 23 | |31 | 32 33 | |41 42 43 | +-------------+ +-------------+ vline and hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 | 22 23 | |31 +----- 33 | |41 42 43 | +-------------+ +-------------+ hline and vline in the middle: +-------------+ +-------------+ |11 12 13 | |21 22 | 23 | |31 -----+ 33 | |41 42 43 | +-------------+ +-------------+ double hline in the middle: +------------------+ +------------------+ |11 12 13 14 | |21 ----------- 24 | |31 32 33 34 | +------------------+ +------------------+ hline, vline, hline in the middle: +------------------+ +------------------+ |11 12 13 14 | |21 22 | 23 24 | |31 -----+----- 34 | |41 42 43 44 | +------------------+ +------------------+ hline at the end: +--------+ +--------+ |11 12 | |21 -----+ |31 32 | +--------+ +--------+ vline at the end: +--------+ +--------+ |11 12 | |21 22 | |31 32 | |41 42 | +--------+ +--------+ vline and hline at the end: +--------+ +--------+ |11 12 | |21 | 22 | |31 +----+ |41 42 | +--------+ +--------+ hline and vline at the end: +--------+ +--------+ |11 12 | |21 22 | |31 -----+ |41 42 | +--------+ +--------+ hline bottom left: +--------+ +--------+ |11 12 | +---- 22 | +--------+ +--------+ vline bottom left: +--------+ +--------+ |11 12 | |21 22 | |31 32 | +--------+ +--------+ hline and vline bottom left: +--------+ +--------+ |11 12 | |21 | 22 | +---+ 32 | +---+----+ +--------+ vline and hline bottom left: +--------+ +--------+ |11 12 | |21 22 | +---- 32 | +--------+ +--------+ double hline bottom: +------------------+ +------------------+ |11 12 13 14 | |21 ----------- 24 | +------------------+ +------------------+ hline, vline, hline bottom: +------------------+ +------------------+ |11 12 13 14 | |21 22 | 23 24 | |31 -----+----- 34 | +--------+---------+ +------------------+ hline bottom right: +--------+ +--------+ |11 12 | |21 -----+ +--------+ +--------+ vline bottom right: +--------+ +--------+ |11 12 | |21 22 | |31 32 | +--------+ +--------+ vline and hline bottom right: +--------+ +--------+ |11 12 | |21 | 22 | |31 +----+ +---+----+ +--------+ hline and vline bottom right: +--------+ +--------+ |11 12 | |21 22 | |31 -----+ +--------+ +--------+ double vline in front: +--------+ +--------+ |11 12 | |21 22 | |31 32 | |41 42 | +--------+ +--------+ hline and double vline in front: +--------+ +--------+ |11 12 | |21 ||22 | +---+|32 | |41 42 | +--------+ +--------+ double vline and hline in front: +--------+ +--------+ |11 12 | |21 22 | +---- 32 | |41 42 | +--------+ +--------+ double vline in the middle: +-------------+ +-------------+ |11 12 13 | |21 ||22 23 | |31 ||32 33 | |41 42 43 | +-------------+ +-------------+ double vline and hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 ||22 23 | |31 ++---- 33 | |41 42 43 | +-------------+ +-------------+ hline and doble vline in the middle: +-------------+ +-------------+ |11 12 13 | |21 22 ||23 | |31 -----+|33 | |41 42 43 | +-------------+ +-------------+ hline, double vline, hline in the middle: +------------------+ +------------------+ |11 12 13 14 | |21 22 ||23 24 | |31 -----++---- 34 | |41 42 43 44 | +------------------+ +------------------+ double vline at the end: +--------+ +--------+ |11 12 | |21 22 | |31 32 | |41 42 | +--------+ +--------+ double vline and hline at the end: +--------+ +--------+ |11 12 | |21 ||22 | |31 ++---+ |41 42 | +--------+ +--------+ hline and double vline at the end: +--------+ +--------+ |11 12 | |21 22 | |31 -----+ |41 42 | +--------+ +--------+ double vline bottom left: +--------+ +--------+ |11 12 | |21 22 | |31 32 | +--------+ +--------+ hline and double vline bottom left: +--------+ +--------+ |11 12 | |21 ||22 | +---+|32 | +---++---+ +--------+ double vline and hline bottom left: +--------+ +--------+ |11 12 | |21 22 | +---- 32 | +--------+ +--------+ hline, double vline, hline bottom: +------------------+ +------------------+ |11 12 13 14 | |21 22 ||23 24 | |31 -----++---- 34 | +--------++--------+ +------------------+ double vline bottom right: +--------+ +--------+ |11 12 | |21 22 | |31 32 | +--------+ +--------+ double vline and hline bottom right: +--------+ +--------+ |11 12 | |21 ||22 | |31 ++---+ +---++---+ +--------+ hline and double vline bottom right: +--------+ +--------+ |11 12 | |21 22 | |31 -----+ +--------+ +--------+ vline left below hline top left: +--------+ +--------+ +---- 12 | |21 22 | |31 32 | +--------+ +--------+ vline right below hline top left: +--------+ +--------+ +---+ 12 | |21 | 22 | |31 32 | +--------+ +--------+ vline left below hline at the top: +-------------+ +-------------+ |11 +----- 13 | |21 | 22 23 | |31 32 33 | +-------------+ +-------------+ vline right below hline at the top: +-------------+ +-------------+ |11 -----+ 13 | |21 22 | 23 | |31 32 33 | +-------------+ +-------------+ vline below hline at the top: +------------------+ +------------------+ |11 -----+----- 14 | |21 22 | 23 24 | |31 32 33 34 | +------------------+ +------------------+ vline left below hline top right: +--------+ +--------+ |11 +----+ |21 | 22 | |31 32 | +--------+ +--------+ vline right below hline top right: +--------+ +--------+ |11 -----+ |21 22 | |31 32 | +--------+ +--------+ vline left below hline in front: +--------+ +--------+ |11 12 | +---- 22 | |31 32 | |41 42 | +--------+ +--------+ vline left above hline in front: +--------+ +--------+ |11 12 | |21 22 | |31 32 | +---- 42 | |51 52 | +--------+ +--------+ vline right below hline in front: +--------+ +--------+ |11 12 | +---+ 22 | |31 | 32 | |41 42 | +--------+ +--------+ vline right above hline in front: +--------+ +--------+ |11 12 | |21 | 22 | |31 | 32 | +---+ 42 | |51 52 | +--------+ +--------+ vline left below hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 +----- 23 | |31 | 32 33 | |41 42 43 | +-------------+ +-------------+ vline left above hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 | 22 23 | |31 | 32 33 | |41 +----- 43 | |51 52 53 | +-------------+ +-------------+ vline right below hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 -----+ 23 | |31 32 | 33 | |41 42 43 | +-------------+ +-------------+ vline right above hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 22 | 23 | |31 32 | 33 | |41 -----+ 43 | |51 52 53 | +-------------+ +-------------+ vline below hline in the middle: +------------------+ +------------------+ |11 12 13 14 | |21 -----+----- 24 | |31 32 | 33 34 | |41 42 43 44 | +------------------+ +------------------+ vline above hline in the middle: +------------------+ +------------------+ |11 12 13 14 | |21 22 | 23 24 | |31 32 | 33 34 | |41 -----+----- 44 | |51 52 53 54 | +------------------+ +------------------+ vline left below hline at the end: +--------+ +--------+ |11 12 | |21 +----+ |31 | 32 | |41 42 | +--------+ +--------+ vline left above hline at the end: +--------+ +--------+ |11 12 | |21 | 22 | |31 | 32 | |41 +----+ |51 52 | +--------+ +--------+ vline right below hline at the end: +--------+ +--------+ |11 12 | |21 -----+ |31 32 | |41 42 | +--------+ +--------+ vline right above hline at the end: +--------+ +--------+ |11 12 | |21 22 | |31 32 | |41 -----+ |51 52 | +--------+ +--------+ vline left above hline bottom left: +--------+ +--------+ |11 12 | |21 22 | |31 32 | +---- 42 | +--------+ +--------+ vline right above hline bottom left: +--------+ +--------+ |11 12 | |21 | 22 | |31 | 32 | +---+ 42 | +--------+ +--------+ vline left above hline at the bottom: +-------------+ +-------------+ |11 12 13 | |21 | 22 23 | |31 | 32 33 | |41 +----- 43 | +-------------+ +-------------+ vline right above hline at the bottom: +-------------+ +-------------+ |11 12 13 | |21 22 | 23 | |31 32 | 33 | |41 -----+ 43 | +-------------+ +-------------+ vline above hline at the bottom: +------------------+ +------------------+ |11 12 13 14 | |21 22 | 23 24 | |31 32 | 33 34 | |41 -----+----- 44 | +------------------+ +------------------+ vline left above hline bottom right: +--------+ +--------+ |11 12 | |21 | 22 | |31 | 32 | |41 +----+ +--------+ +--------+ vline right above hline bottom right: +--------+ +--------+ |11 12 | |21 22 | |31 32 | |41 -----+ +--------+ +--------+ double vline left below hline top left: +--------+ +--------+ +---- 12 | |21 22 | |31 32 | +--------+ +--------+ double vline right below hline top left: +--------+ +--------+ +---+|12 | |21 ||22 | |31 32 | +--------+ +--------+ double vline left below hline at the top: +-------------+ +-------------+ |11 ++---- 13 | |21 ||22 23 | |31 32 33 | +-------------+ +-------------+ double vline right below hline at the top: +-------------+ +-------------+ |11 -----+|13 | |21 22 ||23 | |31 32 33 | +-------------+ +-------------+ double vline below hline at the top: +------------------+ +------------------+ |11 -----++---- 14 | |21 22 ||23 24 | |31 32 33 34 | +------------------+ +------------------+ double vline left below hline top right: +--------+ +--------+ |11 ++---+ |21 ||22 | |31 32 | +--------+ +--------+ double vline right below hline top right: +--------+ +--------+ |11 -----+ |21 22 | |31 32 | +--------+ +--------+ double vline left below hline in front: +--------+ +--------+ |11 12 | +---- 22 | |31 32 | |41 42 | +--------+ +--------+ double vline left above hline in front: +--------+ +--------+ |11 12 | |21 22 | |31 32 | +---- 42 | |51 52 | +--------+ +--------+ double vline right below hline in front: +--------+ +--------+ |11 12 | +---+|22 | |31 ||32 | |41 42 | +--------+ +--------+ double vline right above hline in front: +--------+ +--------+ |11 12 | |21 ||22 | |31 ||32 | +---+|42 | |51 52 | +--------+ +--------+ double vline left below hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 ++---- 23 | |31 ||32 33 | |41 42 43 | +-------------+ +-------------+ double vline left above hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 ||22 23 | |31 ||32 33 | |41 ++---- 43 | |51 52 53 | +-------------+ +-------------+ double vline right below hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 -----+|23 | |31 32 ||33 | |41 42 43 | +-------------+ +-------------+ double vline right above hline in the middle: +-------------+ +-------------+ |11 12 13 | |21 22 ||23 | |31 32 ||33 | |41 -----+|43 | |51 52 53 | +-------------+ +-------------+ double vline below hline in the middle: +------------------+ +------------------+ |11 12 13 14 | |21 -----++---- 24 | |31 32 ||33 34 | |41 42 43 44 | +------------------+ +------------------+ double vline above hline in the middle: +------------------+ +------------------+ |11 12 13 14 | |21 22 ||23 24 | |31 32 ||33 34 | |41 -----++---- 44 | |51 52 53 54 | +------------------+ +------------------+ double vline left below hline at the end: +--------+ +--------+ |11 12 | |21 ++---+ |31 ||32 | |41 42 | +--------+ +--------+ double vline left above hline at the end: +--------+ +--------+ |11 12 | |21 ||22 | |31 ||32 | |41 ++---+ |51 52 | +--------+ +--------+ double vline right below hline at the end: +--------+ +--------+ |11 12 | |21 -----+ |31 32 | |41 42 | +--------+ +--------+ double vline right above hline at the end: +--------+ +--------+ |11 12 | |21 22 | |31 32 | |41 -----+ |51 52 | +--------+ +--------+ double vline left above hline bottom left: +--------+ +--------+ |11 12 | |21 22 | |31 32 | +---- 42 | +--------+ +--------+ double vline right above hline bottom left: +--------+ +--------+ |11 12 | |21 ||22 | |31 ||32 | +---+|42 | +--------+ +--------+ double vline left above hline at the bottom: +-------------+ +-------------+ |11 12 13 | |21 ||22 23 | |31 ||32 33 | |41 ++---- 43 | +-------------+ +-------------+ double vline right above hline at the bottom: +-------------+ +-------------+ |11 12 13 | |21 22 ||23 | |31 32 ||33 | |41 -----+|43 | +-------------+ +-------------+ double vline above hline at the bottom: +------------------+ +------------------+ |11 12 13 14 | |21 22 ||23 24 | |31 32 ||33 34 | |41 -----++---- 44 | +------------------+ +------------------+ double vline left above hline bottom right: +--------+ +--------+ |11 12 | |21 ||22 | |31 ||32 | |41 ++---+ +--------+ +--------+ double vline right above hline bottom right: +--------+ +--------+ |11 12 | |21 22 | |31 32 | |41 -----+ +--------+ +--------+ DDOOUUBBLLEEBBOOXX AALLLLBBOOXX vline top left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +--------+ hline and vline top left: +--------+ +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ +--------+ vline and hline top left: +--------+ +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ +--------+ vline top: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +--------+ vline and hline top: +-------------+ +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ +-------------+ hline and vline top: +-------------+ +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ +-------------+ hline, vline, hline top: +------------------+ +---+----+----+----+ |11 +----+----+ 13 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ +------------------+ vline top right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +--------+ vline and hline top right: +--------+ +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ +--------+ hline and vline top right: +--------+ +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ +--------+ double vline top left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +--------+ hline and double vline top left: +--------+ +---++---+ +---+|12 | +---++---+ |21 | 22 | +---+----+ +--------+ double vline and hline top left: +--------+ +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ +--------+ double vline top: +--------+ +---++---+ |11 ||12 | +---++---+ |21 | 22 | +---+----+ +--------+ double vline and hline top: +-------------+ +---++---+----+ |11 ++---+ 13 | +---++---+----+ |21 | 22 | 23 | +---+----+----+ +-------------+ hline and double vline top: +-------------+ +---+----++---+ |11 +----+|13 | +---+----++---+ |21 | 22 | 23 | +---+----+----+ +-------------+ hline, double vline, hline top: +------------------+ +---+----++---+----+ |11 +----++---+ 13 | +---+----++---+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ +------------------+ double vline top right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +--------+ double vline and hline top right: +--------+ +---++---+ |11 ++---+ +---++---+ |21 | 22 | +---+----+ +--------+ hline and double vline top right: +--------+ +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ +--------+ hline top left: +--------+ +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ +--------+ hline top: +-------------+ +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ +-------------+ double hline top: +------------------+ +---+----+----+----+ |11 +----+----+ 13 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ +------------------+ hline top right: +--------+ +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ +--------+ hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ |31 | 32 | +---+----+ +--------+ vline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ hline and vline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ |41 | 42 | +---+----+ +--------+ vline and hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ |41 | 42 | +---+----+ +--------+ hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ +-------------+ vline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ +-------------+ vline and hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 +----+ 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ +-------------+ hline and vline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 +----+ 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ +-------------+ double hline in the middle: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 +----+----+ 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ +------------------+ hline, vline, hline in the middle: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 +----+----+ 34 | +---+----+----+----+ |41 | 42 | 43 | 44 | +---+----+----+----+ +------------------+ hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ |31 | 32 | +---+----+ +--------+ vline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ vline and hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ |41 | 42 | +---+----+ +--------+ hline and vline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ |41 | 42 | +---+----+ +--------+ hline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ +--------+ vline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ hline and vline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ +--------+ vline and hline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ +--------+ double hline bottom: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 +----+----+ 24 | +---+----+----+----+ +------------------+ hline, vline, hline bottom: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 +----+----+ 34 | +---+----+----+----+ +------------------+ hline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ +--------+ vline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ vline and hline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ +--------+ hline and vline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ +--------+ double vline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ hline and double vline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ +---+|32 | +---++---+ |41 | 42 | +---+----+ +--------+ double vline and hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ |41 | 42 | +---+----+ +--------+ double vline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---++---+----+ |31 ||32 | 33 | +---++---+----+ |41 | 42 | 43 | +---+----+----+ +-------------+ double vline and hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---++---+----+ |31 ++---+ 33 | +---++---+----+ |41 | 42 | 43 | +---+----+----+ +-------------+ hline and doble vline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----++---+ |31 +----+|33 | +---+----++---+ |41 | 42 | 43 | +---+----+----+ +-------------+ hline, double vline, hline in the middle: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----++---+----+ |31 +----++---+ 34 | +---+----++---+----+ |41 | 42 | 43 | 44 | +---+----+----+----+ +------------------+ double vline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ double vline and hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ++---+ +---++---+ |41 | 42 | +---+----+ +--------+ hline and double vline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ |41 | 42 | +---+----+ +--------+ double vline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ hline and double vline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ +---+|32 | +---++---+ +--------+ double vline and hline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ +---+ 32 | +---+----+ +--------+ hline, double vline, hline bottom: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----++---+----+ |31 +----++---+ 34 | +---+----++---+----+ +------------------+ double vline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ double vline and hline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ++---+ +---++---+ +--------+ hline and double vline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 +----+ +---+----+ +--------+ vline left below hline top left: +--------+ +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ vline right below hline top left: +--------+ +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ vline left below hline at the top: +-------------+ +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ +-------------+ vline right below hline at the top: +-------------+ +---+----+----+ |11 +----+ 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ +-------------+ vline below hline at the top: +------------------+ +---+----+----+----+ |11 +----+----+ 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ +------------------+ vline left below hline top right: +--------+ +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ vline right below hline top right: +--------+ +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ vline left below hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ vline left above hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ |51 | 52 | +---+----+ +--------+ vline right below hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ vline right above hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ |51 | 52 | +---+----+ +--------+ vline left below hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ +-------------+ vline left above hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 +----+ 43 | +---+----+----+ |51 | 52 | 53 | +---+----+----+ +-------------+ vline right below hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 | 42 | 43 | +---+----+----+ +-------------+ vline right above hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 +----+ 43 | +---+----+----+ |51 | 52 | 53 | +---+----+----+ +-------------+ vline below hline in the middle: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 +----+----+ 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ |41 | 42 | 43 | 44 | +---+----+----+----+ +------------------+ vline above hline in the middle: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ |41 +----+----+ 44 | +---+----+----+----+ |51 | 52 | 53 | 54 | +---+----+----+----+ +------------------+ vline left below hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ vline left above hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ |51 | 52 | +---+----+ +--------+ vline right below hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ vline right above hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ |51 | 52 | +---+----+ +--------+ vline left above hline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ +--------+ vline right above hline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ +--------+ vline left above hline at the bottom: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 +----+ 43 | +---+----+----+ +-------------+ vline right above hline at the bottom: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----+----+ |31 | 32 | 33 | +---+----+----+ |41 +----+ 43 | +---+----+----+ +-------------+ vline above hline at the bottom: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----+----+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ |41 +----+----+ 44 | +---+----+----+----+ +------------------+ vline left above hline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ +--------+ vline right above hline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ +--------+ double vline left below hline top left: +--------+ +---+----+ +---+ 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ double vline right below hline top left: +--------+ +---+----+ +---+ 12 | +---++---+ |21 ||22 | +---++---+ |31 | 32 | +---+----+ +--------+ double vline left below hline at the top: +-------------+ +---+----+----+ |11 +----+ 13 | +---++---+----+ |21 ||22 | 23 | +---++---+----+ |31 | 32 | 33 | +---+----+----+ +-------------+ double vline right below hline at the top: +-------------+ +---+----+----+ |11 +----+ 13 | +---+----++---+ |21 | 22 ||23 | +---+----++---+ |31 | 32 | 33 | +---+----+----+ +-------------+ double vline below hline at the top: +------------------+ +---+----+----+----+ |11 +----+----+ 14 | +---+----++---+----+ |21 | 22 ||23 | 24 | +---+----++---+----+ |31 | 32 | 33 | 34 | +---+----+----+----+ +------------------+ double vline left below hline top right: +--------+ +---+----+ |11 +----+ +---++---+ |21 ||22 | +---++---+ |31 | 32 | +---+----+ +--------+ double vline right below hline top right: +--------+ +---+----+ |11 +----+ +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +--------+ double vline left below hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ double vline left above hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ |51 | 52 | +---+----+ +--------+ double vline right below hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ +---+ 22 | +---++---+ |31 ||32 | +---++---+ |41 | 42 | +---+----+ +--------+ double vline right above hline in front: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ||32 | +---++---+ +---+|42 | +---+----+ |51 | 52 | +---+----+ +--------+ double vline left below hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---++---+----+ |31 ||32 | 33 | +---++---+----+ |41 | 42 | 43 | +---+----+----+ +-------------+ double vline left above hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---++---+----+ |31 ||32 | 33 | +---++---+----+ |41 ++---+ 43 | +---+----+----+ |51 | 52 | 53 | +---+----+----+ +-------------+ double vline right below hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 +----+ 23 | +---+----++---+ |31 | 32 ||33 | +---+----++---+ |41 | 42 | 43 | +---+----+----+ +-------------+ double vline right above hline in the middle: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----++---+ |31 | 32 ||33 | +---+----++---+ |41 +----+|43 | +---+----+----+ |51 | 52 | 53 | +---+----+----+ +-------------+ double vline below hline in the middle: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 +----+----+ 24 | +---+----++---+----+ |31 | 32 ||33 | 34 | +---+----++---+----+ |41 | 42 | 43 | 44 | +---+----+----+----+ +------------------+ double vline above hline in the middle: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----++---+----+ |31 | 32 ||33 | 34 | +---+----++---+----+ |41 +----++---+ 44 | +---+----+----+----+ |51 | 52 | 53 | 54 | +---+----+----+----+ +------------------+ double vline left below hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 +----+ +---++---+ |31 ||32 | +---++---+ |41 | 42 | +---+----+ +--------+ double vline left above hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ||32 | +---++---+ |41 ++---+ +---+----+ |51 | 52 | +---+----+ +--------+ double vline right below hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 +----+ +---+----+ |31 | 32 | +---+----+ |41 | 42 | +---+----+ +--------+ double vline right above hline at the end: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ |51 | 52 | +---+----+ +--------+ double vline left above hline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ +---+ 42 | +---+----+ +--------+ double vline right above hline bottom left: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ||32 | +---++---+ +---+|42 | +---+----+ +--------+ double vline left above hline at the bottom: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---++---+----+ |31 ||32 | 33 | +---++---+----+ |41 ++---+ 43 | +---+----+----+ +-------------+ double vline right above hline at the bottom: +-------------+ +---+----+----+ |11 | 12 | 13 | +---+----+----+ |21 | 22 | 23 | +---+----++---+ |31 | 32 ||33 | +---+----++---+ |41 +----+|43 | +---+----+----+ +-------------+ double vline above hline at the bottom: +------------------+ +---+----+----+----+ |11 | 12 | 13 | 14 | +---+----+----+----+ |21 | 22 | 23 | 24 | +---+----++---+----+ |31 | 32 ||33 | 34 | +---+----++---+----+ |41 +----++---+ 44 | +---+----+----+----+ +------------------+ double vline left above hline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---++---+ |31 ||32 | +---++---+ |41 ++---+ +---+----+ +--------+ double vline right above hline bottom right: +--------+ +---+----+ |11 | 12 | +---+----+ |21 | 22 | +---+----+ |31 | 32 | +---+----+ |41 +----+ +---+----+ +--------+ OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/tbl/layout/badspan.in010064400017530001753000000004001360643374200210630ustar00schwarzeschwarze.\" $OpenBSD: badspan.in,v 1.1 2020/01/11 20:56:26 schwarze Exp $ .TH TBL-LAYOUT-BADSPAN 1 "January 11, 2020" .SH NAME tbl-layout-badspan \- invalid spanned cells .SH DESCRIPTION normal text .TS allbox tab(:); S L S S L L L L L L. span:end 1:2:3:4:5:6 .TE mandoc-1.14.6/regress/tbl/layout/badspan.out_ascii010064400017530001753000000006771412140003700224340ustar00schwarzeschwarzeTBL-LAYOUT-BADSPAN(1) General Commands Manual TBL-LAYOUT-BADSPAN(1) NNAAMMEE tbl-layout-badspan - invalid spanned cells DDEESSCCRRIIPPTTIIOONN normal text +--+-----------+-----+---+ | | span | end | | +--+---+---+---+-----+---+ |1 | 2 | 3 | 4 | 5 | 6 | +--+---+---+---+-----+---+ OpenBSD January 11, 2020 TBL-LAYOUT-BADSPAN(1) mandoc-1.14.6/regress/tbl/layout/badspan.out_lint010064400017530001753000000000731360643374200223200ustar00schwarzeschwarzemandoc: badspan.in:9:1: WARNING: tbl line starts with span mandoc-1.14.6/regress/tbl/layout/emptycol.in010064400017530001753000000010501360275124300213040ustar00schwarzeschwarze.\" $OpenBSD: emptycol.in,v 1.1 2019/12/31 22:49:17 schwarze Exp $ .TH TBL-LAYOUT-EMPTYCOL 1 "December 31, 2019" .SH NAME tbl-layout-emptycol \- empty columns in tables .SH DESCRIPTION missing final column: .TS allbox tab(:); L L L L L. 1:2 a:b .TE .sp empty final column: .TS allbox tab(:); L L L L L. 1:2: a:b .TE .sp final column with zero-width content: .TS allbox tab(:); L L L L L. 1:2:\& a:b .TE .sp empty middle column: .TS allbox tab(:); L L L L. 1::3 a .TE .sp span crossing empty middle column: .TS allbox tab(:); L L L L S S. 1::3 span .TE mandoc-1.14.6/regress/tbl/layout/emptycol.out_ascii010064400017530001753000000016501412140003700226500ustar00schwarzeschwarzeTBL-LAYOUT-EMPTYCOL(1) General Commands Manual TBL-LAYOUT-EMPTYCOL(1) NNAAMMEE tbl-layout-emptycol - empty columns in tables DDEESSCCRRIIPPTTIIOONN missing final column: +--+---+---+ |1 | 2 | | +--+---+---+ |a | b | | +--+---+---+ empty final column: +--+---+---+ |1 | 2 | | +--+---+---+ |a | b | | +--+---+---+ final column with zero-width content: +--+---+---+ |1 | 2 | | +--+---+---+ |a | b | | +--+---+---+ empty middle column: +--+---+---+ |1 | | 3 | +--+---+---+ |a | | | +--+---+---+ span crossing empty middle column: +--+---+---+ |1 | | 3 | +--+---+---+ |span | +----------+ OpenBSD December 31, 2019 TBL-LAYOUT-EMPTYCOL(1) mandoc-1.14.6/regress/tbl/layout/shortlines.in010064400017530001753000000010051360643374200216470ustar00schwarzeschwarze.\" $OpenBSD: shortlines.in,v 1.2 2020/01/11 20:56:26 schwarze Exp $ .TH TBL-LAYOUT-SHORTLINES 1 "January 11, 2020" .SH NAME tbl-layout-shortlines \- table lines of different length .SH DESCRIPTION normal text .TS allbox tab(:); L L L L L. left:right short left:right .TE .sp .TS allbox tab(:); L L L L L L. left:right first short second short left:right .TE .sp .TS allbox tab(:); L L L L L L. left:middle:right short:line very short .TE .sp .TS allbox tab(:); L L L L L. very short short:line left:middle:right .TE mandoc-1.14.6/regress/tbl/layout/shortlines.out_ascii010064400017530001753000000023701412140003700232060ustar00schwarzeschwarzeTBL-LAYOUT-SHORTLINES(1) General Commands Manual TBL-LAYOUT-SHORTLINES(1) NNAAMMEE tbl-layout-shortlines - table lines of different length DDEESSCCRRIIPPTTIIOONN normal text +------+-------+ |left | right | +------+-------+ |short | | +------+-------+ |left | right | +------+-------+ +-------------+-------+ |left | right | +-------------+-------+ |first short | | +-------------+-------+ |second short | | +-------------+-------+ |left | right | +-------------+-------+ +-----------+--------+-------+ |left | middle | right | +-----------+--------+-------+ |short | line | | +-----------+--------+-------+ |very short | | | +-----------+--------+-------+ +-----------+--------+-------+ |very short | | | +-----------+--------+-------+ |short | line | | +-----------+--------+-------+ |left | middle | right | +-----------+--------+-------+ OpenBSD January 11, 2020 TBL-LAYOUT-SHORTLINES(1) mandoc-1.14.6/regress/tbl/layout/spacing-nogroff.in010064400017530001753000000003111372351103100225220ustar00schwarzeschwarze.\" $OpenBSD$ .TH TBL-LAYOUT-SPACING 1 "September 1, 2020" .SH NAME tbl-layout-spacing-nogroff \- excessive spacing modifier .SH DESCRIPTION initial text .TS box tab(:); R 10 L. a:b .TE .sp final text mandoc-1.14.6/regress/tbl/layout/spacing-nogroff.out_ascii010064400017530001753000000005461412140003700241010ustar00schwarzeschwarzeTBL-LAYOUT-SPACING(1) General Commands Manual TBL-LAYOUT-SPACING(1) NNAAMMEE tbl-layout-spacing-nogroff - excessive spacing modifier DDEESSCCRRIIPPTTIIOONN initial text +------+ |a b | +------+ final text OpenBSD September 1, 2020 TBL-LAYOUT-SPACING(1) mandoc-1.14.6/regress/tbl/layout/spacing-nogroff.out_lint010064400017530001753000000001241372351103100237530ustar00schwarzeschwarzemandoc: spacing-nogroff.in:9:3: ERROR: ignoring excessive spacing in tbl layout: 10 mandoc-1.14.6/regress/tbl/layout/spacing.in010064400017530001753000000006231372351103100210720ustar00schwarzeschwarze.\" $OpenBSD$ .TH TBL-LAYOUT-SPACING 1 "September 1, 2020" .SH NAME tbl-layout-spacing \- spacing modifiers .SH DESCRIPTION default spacing: .TS box tab(:); R L. a:b .TE .sp spacing 0: .TS box tab(:); R 0 L. a:b .TE .sp spacing 1: .TS box tab(:); R 1 L. a:b .TE .sp spacing 2: .TS allbox tab(:); R 2 L. a:b .TE .sp spacing 5: .TS allbox tab(:); R 5|| L. a:b .TE .sp leaked tab settings: .br a b c d e f mandoc-1.14.6/regress/tbl/layout/spacing.out_ascii010064400017530001753000000012051412140003700224340ustar00schwarzeschwarzeTBL-LAYOUT-SPACING(1) General Commands Manual TBL-LAYOUT-SPACING(1) NNAAMMEE tbl-layout-spacing - spacing modifiers DDEESSCCRRIIPPTTIIOONN default spacing: +------+ |a b | +------+ spacing 0: +---+ |ab | +---+ spacing 1: +----+ |a b | +----+ spacing 2: +--+--+ |a |b | +--+--+ spacing 5: +---++---+ |a || b | +---++---+ leaked tab settings: a b c d e f OpenBSD September 1, 2020 TBL-LAYOUT-SPACING(1) mandoc-1.14.6/regress/tbl/layout/font.in010064400017530001753000000004021405031621300204060ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.1 2021/05/16 22:23:57 schwarze Exp $ .TH TBL-LAYOUT-FONT 1 "May 16, 2021" .SH NAME tbl-layout-font \- font modifiers in the table layout .SH DESCRIPTION BEGINTEST .TS box tab(:); lb r l ri. bold:roman _ roman:italic .TE .PP ENDTEST mandoc-1.14.6/regress/tbl/layout/font.out_ascii010064400017530001753000000006761406642652100220070ustar00schwarzeschwarzeTBL-LAYOUT-FONT(1) General Commands Manual TBL-LAYOUT-FONT(1) NNAAMMEE tbl-layout-font - font modifiers in the table layout DDEESSCCRRIIPPTTIIOONN BEGINTEST +---------------+ |bboolldd roman | +---------------+ |roman _i_t_a_l_i_c | +---------------+ ENDTEST OpenBSD May 16, 2021 TBL-LAYOUT-FONT(1) mandoc-1.14.6/regress/tbl/layout/font.out_html010064400017530001753000000004141405031621300216360ustar00schwarzeschwarze
bold roman
roman italic
mandoc-1.14.6/regress/tbl/macro004075500017530001753000000000001412314056700166345ustar00schwarzeschwarzemandoc-1.14.6/regress/tbl/macro/Makefile010064400017530001753000000005711304650520300203460ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2016/08/20 14:43:40 schwarze Exp $ REGRESS_TARGETS = man nested column LINT_TARGETS = man nested # trivial differences to groff-1.22.3: # .TS in a table causes a blank table line in GNU tbl(1), but not in mandoc. # .TS in a column list causes a blank line in mandoc, but not in GNU tbl(1). SKIP_GROFF = nested column .include mandoc-1.14.6/regress/tbl/macro/column.in010064400017530001753000000004011313667013200205270ustar00schwarzeschwarze.\" $OpenBSD: column.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .Dd $Mdocdate: July 4 2017 $ .Dt TBL-COLUMN 1 .Os .Sh NAME .Nm TBL-column .Nd tables inside column lists .Sh DESCRIPTION .Bl -column "a" "b" .Sy a Ta b .TS lll. 1 2 3 4 5 6 .TE .Em c Ta d .El mandoc-1.14.6/regress/tbl/macro/column.out_ascii010064400017530001753000000005141313667013200221050ustar00schwarzeschwarzeTBL-COLUMN(1) General Commands Manual TBL-COLUMN(1) NNAAMMEE TTBBLL--ccoolluummnn - tables inside column lists DDEESSCCRRIIPPTTIIOONN aa b 1 2 3 4 5 6 _c d OpenBSD July 4, 2017 OpenBSD mandoc-1.14.6/regress/tbl/macro/man.in010064400017530001753000000003671313667013200200200ustar00schwarzeschwarze.\" $OpenBSD: man.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-MACRO-MAN 1 "December 16, 2014" .SH NAME tbl-macro-man \- man macro in a table .SH DESCRIPTION normal text .TS box tab(:); l | l . a:b:stray _ c:T{ .SM d T} .TE .PP normal text mandoc-1.14.6/regress/tbl/macro/man.out_ascii010064400017530001753000000005631412140003700213550ustar00schwarzeschwarzeTBL-MACRO-MAN(1) General Commands Manual TBL-MACRO-MAN(1) NNAAMMEE tbl-macro-man - man macro in a table DDEESSCCRRIIPPTTIIOONN normal text +--+---+ |a | b | +--+---+ |c | d | +--+---+ normal text OpenBSD December 16, 2014 TBL-MACRO-MAN(1) mandoc-1.14.6/regress/tbl/macro/man.out_lint010064400017530001753000000001741313667013200212430ustar00schwarzeschwarzemandoc: man.in:10:5: ERROR: ignoring extra tbl data cells: stray mandoc: man.in:13:2: UNSUPP: ignoring macro in table: SM d mandoc-1.14.6/regress/tbl/macro/nested.in010064400017530001753000000003601313667013200205200ustar00schwarzeschwarze.\" $OpenBSD: nested.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-MACRO-NESTED 1 "December 16, 2014" .SH NAME tbl-macro-nested \- nested table .SH DESCRIPTION normal text .TS box tab(:); l | l . a:b _ c:d .TS e:f .TE .PP normal text mandoc-1.14.6/regress/tbl/macro/nested.out_ascii010064400017530001753000000005761412140003700220700ustar00schwarzeschwarzeTBL-MACRO-NESTED(1) General Commands Manual TBL-MACRO-NESTED(1) NNAAMMEE tbl-macro-nested - nested table DDEESSCCRRIIPPTTIIOONN normal text +--+---+ |a | b | +--+---+ |c | d | |e | f | +--+---+ normal text OpenBSD December 16, 2014 TBL-MACRO-NESTED(1) mandoc-1.14.6/regress/tbl/macro/nested.out_lint010064400017530001753000000000741313667013200217510ustar00schwarzeschwarzemandoc: nested.in:13:4: UNSUPP: ignoring macro in table: TS mandoc-1.14.6/regress/tbl/mod004075500017530001753000000000001412314056700163125ustar00schwarzeschwarzemandoc-1.14.6/regress/tbl/mod/Makefile010064400017530001753000000011041412140003700200070ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.6 2021/08/10 12:36:42 schwarze Exp $ REGRESS_TARGETS = badfont expand expand-toowide font font-eol REGRESS_TARGETS += misalign spacing width LINT_TARGETS = badfont font font-eol # groff-1.22.4 defects: # - The "f" font modifier swallows a following newline character. # - When space is insufficient (on either side) for properly aligning # a number, GNU tbl(1) moves the number too much to the right, # overflowing the column, even if space would be sufficient without # left padding. SKIP_GROFF = font-eol misalign .include mandoc-1.14.6/regress/tbl/mod/badfont.in010064400017530001753000000004651412140003700203250ustar00schwarzeschwarze.\" $OpenBSD: badfont.in,v 1.3 2021/08/10 12:36:42 schwarze Exp $ .TH TBL-MOD-BADFONT 1 "August 9, 2021" .SH NAME tbl-mod-badfont \- invalid font modifiers in table layouts .SH DESCRIPTION normal text .TS box tab(:); lfI lfX lfB lfIB lfI lf. lfB lfI. italic:one char bold:two chars italic:dot bold:italic .TE mandoc-1.14.6/regress/tbl/mod/badfont.out_ascii010064400017530001753000000010061412140003700216660ustar00schwarzeschwarzeTBL-MOD-BADFONT(1) General Commands Manual TBL-MOD-BADFONT(1) NNAAMMEE tbl-mod-badfont - invalid font modifiers in table layouts DDEESSCCRRIIPPTTIIOONN normal text +-------------------+ |_i_t_a_l_i_c one char | |bboolldd two chars | |_i_t_a_l_i_c dot | |bboolldd _i_t_a_l_i_c | +-------------------+ OpenBSD August 9, 2021 TBL-MOD-BADFONT(1) mandoc-1.14.6/regress/tbl/mod/badfont.out_lint010064400017530001753000000003301412140003700215430ustar00schwarzeschwarzemandoc: badfont.in:9:7: WARNING: unknown font, skipping request: TS fX mandoc: badfont.in:10:7: WARNING: unknown font, skipping request: TS fIB mandoc: badfont.in:11:7: WARNING: unknown font, skipping request: TS f. mandoc-1.14.6/regress/tbl/mod/expand.in010064400017530001753000000103711313667013200201760ustar00schwarzeschwarze.\" $OpenBSD: expand.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-MOD-EXPAND 1 "January 27, 2015" .SH NAME tbl-mod-expand \- expand modifier in table layout .SH DESCRIPTION normal text .TS tab(:); lx lx l. x:x:123456789012345678901234567890123456789012345678901234567890123 .TE .TS tab(:); lx lx l. x:x:12345678901234567890123456789012345678901234567890123456789012 .TE .TS tab(:); lx lx l. x:x:1234567890123456789012345678901234567890123456789012345678901 .TE .TS tab(:); lx lx l. x:x:123456789012345678901234567890123456789012345678901234567890 .TE .TS tab(:); lx lx lx l. x:x:x:12345678901234567890123456789012345678901234567890123456789 .TE .TS tab(:); lx lx lx l. x:x:x:1234567890123456789012345678901234567890123456789012345678 .TE .TS tab(:); lx lx lx l. x:x:x:123456789012345678901234567890123456789012345678901234567 .TE .TS tab(:); lx lx lx l. x:x:x:12345678901234567890123456789012345678901234567890123456 .TE .TS tab(:); lx lx lx lx l. x:x:x:x:1234567890123456789012345678901234567890123456789012345 .TE .TS tab(:); lx lx lx lx l. x:x:x:x:123456789012345678901234567890123456789012345678901234 .TE .TS tab(:); lx lx lx lx l. x:x:x:x:12345678901234567890123456789012345678901234567890123 .TE .TS tab(:); lx lx lx lx l. x:x:x:x:1234567890123456789012345678901234567890123456789012 .TE .TS tab(:); lx lx lx lx lx l. x:x:x:x:x:123456789012345678901234567890123456789012345678901 .TE .TS tab(:); lx lx lx lx lx l. x:x:x:x:x:12345678901234567890123456789012345678901234567890 .TE .TS tab(:); lx lx lx lx lx l. x:x:x:x:x:1234567890123456789012345678901234567890123456789 .TE .TS tab(:); lx lx lx lx lx l. x:x:x:x:x:123456789012345678901234567890123456789012345678 .TE .TS tab(:); lx lx lx lx lx l. x:x:x:x:x:12345678901234567890123456789012345678901234567 .TE .TS tab(:); lx lx lx lx lx lx l. x:x:x:x:x:x:1234567890123456789012345678901234567890123456 .TE .TS tab(:); lx lx lx lx lx lx l. x:x:x:x:x:x:123456789012345678901234567890123456789012345 .TE .TS tab(:); lx lx lx lx lx lx l. x:x:x:x:x:x:12345678901234567890123456789012345678901234 .TE .TS tab(:); lx lx lx lx lx lx l. x:x:x:x:x:x:1234567890123456789012345678901234567890123 .TE .TS tab(:); lx lx lx lx lx lx l. x:x:x:x:x:x:123456789012345678901234567890123456789012 .TE .TS tab(:); lx l rx. x:123456789012345678901234567890123456789012345678901234567890123:x .TE .TS tab(:); lx l rx. x:12345678901234567890123456789012345678901234567890123456789012:x .TE .TS tab(:); lx l rx. x:1234567890123456789012345678901234567890123456789012345678901:x .TE .TS tab(:); lx l rx. x:123456789012345678901234567890123456789012345678901234567890:x .TE .TS tab(:); lx lx l rx. x:x:12345678901234567890123456789012345678901234567890123456789:x .TE .TS tab(:); lx lx l rx. x:x:1234567890123456789012345678901234567890123456789012345678:x .TE .TS tab(:); lx lx l rx. x:x:123456789012345678901234567890123456789012345678901234567:x .TE .TS tab(:); lx lx l rx. x:x:12345678901234567890123456789012345678901234567890123456:x .TE .TS tab(:); lx lx lx l rx. x:x:x:1234567890123456789012345678901234567890123456789012345:x .TE .TS tab(:); lx lx lx l rx. x:x:x:123456789012345678901234567890123456789012345678901234:x .TE .TS tab(:); lx lx lx l rx. x:x:x:12345678901234567890123456789012345678901234567890123:x .TE .TS tab(:); lx lx lx l rx. x:x:x:1234567890123456789012345678901234567890123456789012:x .TE .TS tab(:); lx lx lx lx l rx. x:x:x:x:123456789012345678901234567890123456789012345678901:x .TE .TS tab(:); lx lx lx lx l rx. x:x:x:x:12345678901234567890123456789012345678901234567890:x .TE .TS tab(:); lx lx lx lx l rx. x:x:x:x:1234567890123456789012345678901234567890123456789:x .TE .TS tab(:); lx lx lx lx l rx. x:x:x:x:123456789012345678901234567890123456789012345678:x .TE .TS tab(:); lx lx lx lx l rx. x:x:x:x:12345678901234567890123456789012345678901234567:x .TE .TS tab(:); lx lx lx lx lx l rx. x:x:x:x:x:1234567890123456789012345678901234567890123456:x .TE .TS tab(:); lx lx lx lx lx l rx. x:x:x:x:x:123456789012345678901234567890123456789012345:x .TE .TS tab(:); lx lx lx lx lx l rx. x:x:x:x:x:12345678901234567890123456789012345678901234:x .TE .TS tab(:); lx lx lx lx lx l rx. x:x:x:x:x:1234567890123456789012345678901234567890123:x .TE .TS tab(:); lx lx lx lx lx l rx. x:x:x:x:x:123456789012345678901234567890123456789012:x .TE .sp .nf leaked tab settings: .br a b c d e f g h .fi mandoc-1.14.6/regress/tbl/mod/expand.out_ascii010064400017530001753000000074441412140003700215440ustar00schwarzeschwarzeTBL-MOD-EXPAND(1) General Commands Manual TBL-MOD-EXPAND(1) NNAAMMEE tbl-mod-expand - expand modifier in table layout DDEESSCCRRIIPPTTIIOONN normal text x x 123456789012345678901234567890123456789012345678901234567890123 x x 12345678901234567890123456789012345678901234567890123456789012 x x 1234567890123456789012345678901234567890123456789012345678901 x x 123456789012345678901234567890123456789012345678901234567890 x x x 12345678901234567890123456789012345678901234567890123456789 x x x 1234567890123456789012345678901234567890123456789012345678 x x x 123456789012345678901234567890123456789012345678901234567 x x x 12345678901234567890123456789012345678901234567890123456 x x x x 1234567890123456789012345678901234567890123456789012345 x x x x 123456789012345678901234567890123456789012345678901234 x x x x 12345678901234567890123456789012345678901234567890123 x x x x 1234567890123456789012345678901234567890123456789012 x x x x x 123456789012345678901234567890123456789012345678901 x x x x x 12345678901234567890123456789012345678901234567890 x x x x x 1234567890123456789012345678901234567890123456789 x x x x x 123456789012345678901234567890123456789012345678 x x x x x 12345678901234567890123456789012345678901234567 x x x x x x 1234567890123456789012345678901234567890123456 x x x x x x 123456789012345678901234567890123456789012345 x x x x x x 12345678901234567890123456789012345678901234 x x x x x x 1234567890123456789012345678901234567890123 x x x x x x 123456789012345678901234567890123456789012 x 123456789012345678901234567890123456789012345678901234567890123 x x 12345678901234567890123456789012345678901234567890123456789012 x x 1234567890123456789012345678901234567890123456789012345678901 x x 123456789012345678901234567890123456789012345678901234567890 x x x 12345678901234567890123456789012345678901234567890123456789 x x x 1234567890123456789012345678901234567890123456789012345678 x x x 123456789012345678901234567890123456789012345678901234567 x x x 12345678901234567890123456789012345678901234567890123456 x x x x 1234567890123456789012345678901234567890123456789012345 x x x x 123456789012345678901234567890123456789012345678901234 x x x x 12345678901234567890123456789012345678901234567890123 x x x x 1234567890123456789012345678901234567890123456789012 x x x x x 123456789012345678901234567890123456789012345678901 x x x x x 12345678901234567890123456789012345678901234567890 x x x x x 1234567890123456789012345678901234567890123456789 x x x x x 123456789012345678901234567890123456789012345678 x x x x x 12345678901234567890123456789012345678901234567 x x x x x x 1234567890123456789012345678901234567890123456 x x x x x x 123456789012345678901234567890123456789012345 x x x x x x 12345678901234567890123456789012345678901234 x x x x x x 1234567890123456789012345678901234567890123 x x x x x x 123456789012345678901234567890123456789012 x leaked tab settings: a b c d e f g h OpenBSD January 27, 2015 TBL-MOD-EXPAND(1) mandoc-1.14.6/regress/tbl/mod/font.in010064400017530001753000000005111313667013300176610ustar00schwarzeschwarze.\" $OpenBSD: font.in,v 1.4 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-MOD-FONT 1 "February 10, 2015" .SH NAME tbl-mod-font \- font modifiers in table layouts .SH DESCRIPTION normal text .TS box tab(:); cb|cfCW|ci cFI | cf(foobar) | cFB. bold:roman:italic _ italic:roman:bold and:so:on .TE .sp leaked tab settings: .br a b c d e mandoc-1.14.6/regress/tbl/mod/font.out_ascii010064400017530001753000000011211412140003700212150ustar00schwarzeschwarzeTBL-MOD-FONT(1) General Commands Manual TBL-MOD-FONT(1) NNAAMMEE tbl-mod-font - font modifiers in table layouts DDEESSCCRRIIPPTTIIOONN normal text +-------+-------+--------+ | bboolldd | roman | _i_t_a_l_i_c | +-------+-------+--------+ |_i_t_a_l_i_c | roman | bboolldd | | _a_n_d | so | oonn | +-------+-------+--------+ leaked tab settings: a b c d e OpenBSD February 10, 2015 TBL-MOD-FONT(1) mandoc-1.14.6/regress/tbl/mod/font.out_lint010064400017530001753000000003101412140003700210720ustar00schwarzeschwarzemandoc: font.in:19:2: WARNING: tab in filled text mandoc: font.in:19:4: WARNING: tab in filled text mandoc: font.in:19:6: WARNING: tab in filled text mandoc: font.in:19:8: WARNING: tab in filled text mandoc-1.14.6/regress/tbl/mod/misalign.in010064400017530001753000000004021313667013300205150ustar00schwarzeschwarze.\" $OpenBSD: misalign.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-MOD-MISALIGN 1 "December 24, 2014" .SH NAME tbl-mod-misalign \- failing alignment in tables .SH DESCRIPTION normal text .TS box tab(:); n, nz. 12.34 _ 100.0 0.001 _ 1000.0 0.0001 .TE mandoc-1.14.6/regress/tbl/mod/misalign.out_ascii010064400017530001753000000006531412140003700220630ustar00schwarzeschwarzeTBL-MOD-MISALIGN(1) General Commands Manual TBL-MOD-MISALIGN(1) NNAAMMEE tbl-mod-misalign - failing alignment in tables DDEESSCCRRIIPPTTIIOONN normal text +------+ |12.34 | +------+ |100.0 | |0.001 | +------+ |1000.0 | |0.0001 | +------+ OpenBSD December 24, 2014 TBL-MOD-MISALIGN(1) mandoc-1.14.6/regress/tbl/mod/expand-toowide.in010064400017530001753000000006121312673170000216410ustar00schwarzeschwarze.\" $OpenBSD: expand-toowide.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-MOD-EXPAND-TOOWIDE 1 "May 1, 2017" .SH NAME tbl-mod-expand-toowide \- try to expand columns in a table that is already too wide .SH DESCRIPTION .ll 20n In this section, the line length is limited to 20 characters. .TS tab(:); lx l lx. x:1234567890:x .TE .ll 78n .PP Now we are back to the default terminal width. mandoc-1.14.6/regress/tbl/mod/expand-toowide.out_ascii010064400017530001753000000007531412140003700232100ustar00schwarzeschwarzeTBL-MOD-EXPAND-TOOWIDE(1) General Commands Manual TBL-MOD-EXPAND-TOOWIDE(1) NNAAMMEE tbl-mod-expand-toowide - try to expand columns in a table that is already too wide DDEESSCCRRIIPPTTIIOONN In this section, the line length is limited to 20 characters. x 1234567890 x Now we are back to the default terminal width. OpenBSD May 1, 2017 TBL-MOD-EXPAND-TOOWIDE(1) mandoc-1.14.6/regress/tbl/mod/spacing.in010064400017530001753000000006341312673170000203420ustar00schwarzeschwarze.\" $OpenBSD: spacing.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-MOD-SPACING 1 "June 27, 2017" .SH NAME tbl-mod-spacing \- spacing modifier in table layout .SH DESCRIPTION normal text .TS box tab(:); l0 l1 | l2 | l3 | l4 | l5 | l6 | l7 | l8 l0 l1 l2 l3 l4 l5 l6 l7 l8 l0 l1 | l2 || l3 || l4 l5 || l6 | l7 || l8. a:b:c:d:e:f:g:h:i a:b:c:d:e:f:g:h:i a:b:c:d:e:f:g:h:i .TE mandoc-1.14.6/regress/tbl/mod/spacing.out_ascii010064400017530001753000000010151412140003700216750ustar00schwarzeschwarzeTBL-MOD-SPACING(1) General Commands Manual TBL-MOD-SPACING(1) NNAAMMEE tbl-mod-spacing - spacing modifier in table layout DDEESSCCRRIIPPTTIIOONN normal text +--+--+--+----+----+------+------+-----+ |ab|c |d | e | f | g | h | i | |ab|c |d ||e f || g | h || i | |ab|c |d ||e f || g | h || i | +--+--+--++--------++-----+------++----+ OpenBSD June 27, 2017 TBL-MOD-SPACING(1) mandoc-1.14.6/regress/tbl/mod/width.in010064400017530001753000000004131312673170000200300ustar00schwarzeschwarze.\" $OpenBSD: width.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-MOD-WIDTH 1 "June 8, 2017" .SH NAME tbl-mod-width \- width modifier in table layout .SH DESCRIPTION normal text .TS box tab(:); lw2 | lw(2n) | lw(0.16i) | lw2 . a:abcd:T{ a T}:T{ .SM abcd T} .TE mandoc-1.14.6/regress/tbl/mod/width.out_ascii010064400017530001753000000005711412140003700213760ustar00schwarzeschwarzeTBL-MOD-WIDTH(1) General Commands Manual TBL-MOD-WIDTH(1) NNAAMMEE tbl-mod-width - width modifier in table layout DDEESSCCRRIIPPTTIIOONN normal text +---+------+----+------+ |a | abcd | a | abcd | +---+------+----+------+ OpenBSD June 8, 2017 TBL-MOD-WIDTH(1) mandoc-1.14.6/regress/tbl/mod/font-eol.in010064400017530001753000000004031410447345400204410ustar00schwarzeschwarze.\" $OpenBSD: font-eol.in,v 1.1 2021/08/10 12:36:42 schwarze Exp $ .TH TBL-MOD-FONT-EOL 1 "August 9, 2021" .SH NAME tbl-mod-font-eol \- font modifier at eol in table layout .SH DESCRIPTION normal text .TS box tab(:); lfB lf lfB lfI. bold:none bold:italic .TE mandoc-1.14.6/regress/tbl/mod/font-eol.out_ascii010064400017530001753000000006361410447345400220220ustar00schwarzeschwarzeTBL-MOD-FONT-EOL(1) General Commands Manual TBL-MOD-FONT-EOL(1) NNAAMMEE tbl-mod-font-eol - font modifier at eol in table layout DDEESSCCRRIIPPTTIIOONN normal text +--------------+ |bboolldd none | |bboolldd _i_t_a_l_i_c | +--------------+ OpenBSD August 9, 2021 TBL-MOD-FONT-EOL(1) mandoc-1.14.6/regress/tbl/mod/font-eol.out_lint010064400017530001753000000001071410447345400216710ustar00schwarzeschwarzemandoc: font-eol.in:9:7: WARNING: unknown font, skipping request: TS f mandoc-1.14.6/regress/tbl/opt004075500017530001753000000000001412314056700163355ustar00schwarzeschwarzemandoc-1.14.6/regress/tbl/opt/Makefile010064400017530001753000000002441343772345500200630ustar00schwarzeschwarze# $OpenBSD: Makefile,v 1.2 2019/01/31 16:28:38 schwarze Exp $ REGRESS_TARGETS = box center center-mdoc invalid LINT_TARGETS = invalid .include mandoc-1.14.6/regress/tbl/opt/box.in010064400017530001753000000007721313667013300175370ustar00schwarzeschwarze.\" $OpenBSD: box.in,v 1.4 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-OPT-BOX 1 "June 12, 2017" .SH NAME tbl-opt-box \- box table options .SH DESCRIPTION no boxing: .TS tab(:); l l. a:b c:d .TE .sp automatic boxing: .TS tab(:) box; l l. a:b c:d .TE .sp allbox: .TS tab(:) allbox; l l. a:b c:d .TE .sp manual boxing: .TS tab(:); ||l||l||. _ a:b _ c:d _ .TE .sp automatic and manual boxing: .TS tab(:) box; ||l||l||. a:b _ c:d _ .TE .sp allbox and manual boxing: .TS tab(:) allbox; ||l||l||. a:b _ c:d _ .TE mandoc-1.14.6/regress/tbl/opt/box.out_ascii010064400017530001753000000015351412140003700210730ustar00schwarzeschwarzeTBL-OPT-BOX(1) General Commands Manual TBL-OPT-BOX(1) NNAAMMEE tbl-opt-box - box table options DDEESSCCRRIIPPTTIIOONN no boxing: a b c d automatic boxing: +------+ |a b | |c d | +------+ allbox: +--+---+ |a | b | +--+---+ |c | d | +--+---+ manual boxing: +--++--+ |a ||b | +--++--+ |c ||d | +--++--+ automatic and manual boxing: +--++--+ |a ||b | +--++--+ |c ||d | +--++--+ +--++--+ allbox and manual boxing: +--++--+ |a ||b | +--++--+ +--++--+ |c ||d | +--++--+ +--++--+ OpenBSD June 12, 2017 TBL-OPT-BOX(1) mandoc-1.14.6/regress/tbl/opt/center.in010064400017530001753000000026731313667013300202310ustar00schwarzeschwarze.\" $OpenBSD: center.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-LAYOUT_CENTER 1 "January 28, 2015" .SH NAME tbl-layout_center \- center a table as a whole .SH DESCRIPTION normal text .TS center; l. 12345678901234567890123456789012345678901234567890123456789012345678901\ 234567890123456 .TE .TS center; l. 12345678901234567890123456789012345678901234567890123456789012345678901\ 23456789012345 .TE .TS center; l. 12345678901234567890123456789012345678901234567890123456789012345678901\ 2345678901234 .TE .TS center; l. 12345678901234567890123456789012345678901234567890123456789012345678901234 .TE .TS center; l. 1234567890123456789012345678901234567890123456789012345678901234567890123 .TE .TS center; l. 123456789012345678901234567890123456789012345678901234567890123456789012 .TE .TS center; l. 12345678901234567890123456789012345678901234567890123456789012345678901 .TE .TS center; l. 1234567890123456789012345678901234567890123456789012345678901234567890 .TE .TS center; l. 123456789012345678901234567890123456789012345678901234567890123456789 .TE .TS center; l. 12345678901234567890123456789012345678901234567890123456789012345678 .TE .TS center; l|. _ txt .TE .TS center; l|. _ text .TE .TS center; |l. _ txt .TE .TS center; |l. _ text .TE .TS center; |l|. _ txt .TE .TS center; |l|. _ text .TE .TS center tab(:); |l||l|. _ txt:text .TE .TS center tab(:); |l||l|. _ text:text .TE .TS center box; l. txt .TE .PP normal text .TS center box; l. text .TE mandoc-1.14.6/regress/tbl/opt/center.out_ascii010064400017530001753000000041741412140003700215650ustar00schwarzeschwarzeTBL-LAYOUT_CENTER(1) General Commands Manual TBL-LAYOUT_CENTER(1) NNAAMMEE tbl-layout_center - center a table as a whole DDEESSCCRRIIPPTTIIOONN normal text 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345 123456789012345678901234567890123456789012345678901234567890123456789012345678901234 12345678901234567890123456789012345678901234567890123456789012345678901234 1234567890123456789012345678901234567890123456789012345678901234567890123 123456789012345678901234567890123456789012345678901234567890123456789012 12345678901234567890123456789012345678901234567890123456789012345678901 1234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789 12345678901234567890123456789012345678901234567890123456789012345678 ----+ txt | -----+ text | +---- |txt +----- |text +----+ |txt | +-----+ |text | +----++-----+ |txt ||text | +-----++-----+ |text ||text | +----+ |txt | +----+ normal text +-----+ |text | +-----+ OpenBSD January 28, 2015 TBL-LAYOUT_CENTER(1) mandoc-1.14.6/regress/tbl/opt/invalid.in010064400017530001753000000004561313667013300203740ustar00schwarzeschwarze.\" $OpenBSD: invalid.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ .TH TBL-OPT 1 "January 25, 2015" .SH NAME tbl-opt \- table options .SH DESCRIPTION normal text .TS tab decimalpoint (,x) %foo box; n n . 10.0 0.01 0.01 10.0 .TE .PP normal text .TS , box,tab(:) delim($$); l l . a:b .TE .PP normal text mandoc-1.14.6/regress/tbl/opt/invalid.out_ascii010064400017530001753000000006721412140003700217320ustar00schwarzeschwarzeTBL-OPT(1) General Commands Manual TBL-OPT(1) NNAAMMEE tbl-opt - table options DDEESSCCRRIIPPTTIIOONN normal text +--------------+ |10.0 0.01 | | 0.01 10.0 | +--------------+ normal text +------+ |a b | +------+ normal text OpenBSD January 25, 2015 TBL-OPT(1) mandoc-1.14.6/regress/tbl/opt/invalid.out_lint010064400017530001753000000005451313667013300216220ustar00schwarzeschwarzemandoc: invalid.in:8:5: ERROR: missing tbl option argument: tab mandoc: invalid.in:8:19: ERROR: wrong tbl option argument size: decimalpoint want 1 have 2 mandoc: invalid.in:8:23: ERROR: non-alphabetic character in tbl options: % mandoc: invalid.in:8:24: ERROR: skipping unknown tbl option: foo mandoc: invalid.in:16:21: UNSUPP: eqn delim option in tbl: $$ mandoc-1.14.6/regress/tbl/opt/center-mdoc.in010064400017530001753000000004401342462137300211410ustar00schwarzeschwarze.\" $OpenBSD: center-mdoc.in,v 1.1 2019/01/31 16:28:38 schwarze Exp $ .Dd $Mdocdate: January 31 2019 $ .Dt TBL-CENTER-MDOC 1 .Os .Sh NAME .Nm tbl-center-mdoc .Nd center a table as a whole .Sh DESCRIPTION normal text .TS center box tab(:); l r. northwest:northeast southwest:southeast .TE mandoc-1.14.6/regress/tbl/opt/center-mdoc.out_ascii010064400017530001753000000010131342462137300225070ustar00schwarzeschwarzeTBL-CENTER-MDOC(1) General Commands Manual TBL-CENTER-MDOC(1) NNAAMMEE ttbbll--cceenntteerr--mmddoocc - center a table as a whole DDEESSCCRRIIPPTTIIOONN normal text +----------------------+ |northwest northeast | |southwest southeast | +----------------------+ OpenBSD January 31, 2019 OpenBSD mandoc-1.14.6/INSTALL010064400017530001753000000162351412314055300144070ustar00schwarzeschwarze$Id: INSTALL,v 1.24 2021/09/20 13:25:42 schwarze Exp $ About the portable mandoc distribution -------------------------------------- The mandoc manpage compiler toolset (formerly called "mdocml") is a suite of tools compiling mdoc(7), the roff(7) macro language of choice for BSD manual pages, and man(7), the predominant historical language for UNIX manuals. It includes a man(1) manual viewer and additional tools. For general information, see . In case you have questions or want to provide feedback, read . Consider subscribing to the discuss@ mailing list mentioned on that page. If you intend to help with the development of mandoc, consider subscribing to the tech@ mailing list, too. Enjoy using the mandoc toolset! Ingo Schwarze, Karlsruhe, September 2021 Installation ------------ Before manually installing mandoc on your system, please check whether the newest version of mandoc is already installed by default or available via a binary package or a ports system. A list of the latest bundled and ported versions of mandoc for various operating systems is maintained at . Regarding how packages and ports are maintained for your operating system, please consult your operating system documentation. To install mandoc manually, the following steps are needed: 1. If you want to build the CGI program, man.cgi(8), too, run the command "echo BUILD_CGI=1 >> configure.local". Then run "cp cgi.h.example cgi.h" and edit cgi.h as desired. 2. If you also want to build the catman(8) utility, run the command "echo BUILD_CATMAN=1 >> configure.local". Note that it is unlikely to be a drop-in replacement providing the same functionality as your system's "catman", if your operating system contains one. 3. Define MANPATH_DEFAULT in configure.local if /usr/share/man:/usr/X11R6/man:/usr/local/man is not appropriate for your operating system. 4. Run "./configure". This script attempts autoconfiguration of mandoc for your system. Read both its standard output and the file "Makefile.local" it generates. If anything looks wrong or different from what you wish, read the file "configure.local.example", create and edit a file "configure.local", and re-run "./configure" until the result seems right to you. 5. Run "make". Any POSIX-compatible make, in particular both BSD make and GNU make, should work. If the build fails, look at "configure.local.example" and go back to step 2. 6. Run "make -n install" and check whether everything will be installed to the intended places. Otherwise, put some *DIR or *NM* variables into "configure.local" and go back to step 4. 7. Optionally run the regression suite. Basically, that amounts to "make regress" to do a standard regression run, running all tests. For more fine-grained control, read "./mandoc -l regress/regress.pl.1", then run "cd regress && ./regress.pl" with optional arguments. The regression suite requires a reasonably modern Perl interpreter. Examples of systems that are too old to run the regression suite include Solaris 9, Solaris 10, and Mac OS X 10.4 Tiger. On Solaris 11, the suite does run, but some tests fail; look at the BUGS section of that manual page. 8. Run "sudo make install". If you intend to build a binary package using some kind of fake root mechanism, you may need a command like "make DESTDIR=... install". Read the *-install targets in the "Makefile" to understand how DESTDIR is used. 9. Run the command "sudo makewhatis" to build mandoc.db(5) databases in all the directory trees configured in step 3. Whenever installing new manual pages, re-run makewhatis(8) to update the databases, or apropos(1) will not find the new pages. 10. To set up a man.cgi(8) server, read its manual page. Note that a very small number of man(7) pages contain low-level roff(7) markup that mandoc does not yet understand. On some BSD systems using mandoc, third-party software is vetted on whether it may be formatted with mandoc. If not, groff(1) is pulled in as a dependency and used to install pre-formatted "catpages" instead of manual page sources. This mechanism is used much less frequently than in the past. On OpenBSD, only 25 out of about 10000 ports still require formatting with groff(1). Understanding mandoc dependencies --------------------------------- The following libraries are required: 1. zlib for decompressing gzipped manual pages. 2. The fts(3) directory traversion functions. If your system does not have them, the bundled compatibility version will be used, so you need not worry in that case. But be careful: old glibc versions of fts(3) were known to be broken on 32bit platforms, see . That was presumably fixed in glibc-2.23. If you run into that problem, set "HAVE_FTS=0" in configure.local. 3. Marc Espie's ohash(3) library. If your system does not have it, the bundled compatibility version will be used, so you probably need not worry about it. One of the chief design goals of the mandoc toolbox is to make sure that nothing related to documentation requires C++. Consequently, linking mandoc against any kind of C++ program would defeat the purpose and is not supported. Checking autoconfiguration quality ---------------------------------- If you want to check whether automatic configuration works well on your platform, consider the following: The mandoc package intentionally does not use GNU autoconf because we consider that toolset a blatant example of overengineering that is obsolete nowadays, since all modern operating systems are now reasonably close to POSIX and do not need arcane shell magic any longer. If your system does need such magic, consider upgrading to reasonably modern POSIX-compliant tools rather than asking for autoconf-style workarounds. As far as mandoc is using any features not mandated by ANSI X3.159-1989 ("ANSI C") or IEEE Std 1003.1-2008 ("POSIX") that some modern systems do not have, we intend to provide autoconfiguration tests and compat_*.c implementations. Please report any that turn out to be missing. Note that while we do strive to produce portable code, we do not slavishly restrict ourselves to POSIX-only interfaces. For improved security and readability, we do use well-designed, modern interfaces like reallocarray(3) even if they are still rather uncommon, of course bundling compat_*.c implementations as needed. Where mandoc is using ANSI C or POSIX features that some systems still lack and that compat_*.c implementations can be provided for without too much hassle, we will consider adding them, too, so please report whatever is missing on your platform. The following steps can be used to manually check the automatic configuration on your platform: 1. Run "make distclean". 2. Run "./configure" 3. Read the file "config.log". It shows the compiler commands used to test the libraries installed on your system and the standard output and standard error output these commands produce. Watch out for unexpected failures. Those are most likely to happen if headers or libraries are installed in unusual places or interfaces defined in unusual headers. You can also look at the file "config.h" and check that no "#define HAVE_*" differ from your expectations. mandoc-1.14.6/LICENSE010064400017530001753000000047341412314055300143640ustar00schwarzeschwarze$Id: LICENSE,v 1.22 2021/09/19 11:02:09 schwarze Exp $ With the exceptions noted below, all non-trivial files contained in the mandoc toolkit are protected by the Copyright of the following developers: Copyright (c) 2008-2012, 2014 Kristaps Dzonsons Copyright (c) 2010-2021 Ingo Schwarze Copyright (c) 1999, 2004, 2017 Marc Espie Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger Copyright (c) 2013 Franco Fichtner Copyright (c) 2014 Baptiste Daroussin Copyright (c) 2016 Ed Maste Copyright (c) 2017 Michael Stapelberg Copyright (c) 2017 Anthony Bentley Copyright (c) 1998, 2004, 2010, 2015 Todd C. Miller Copyright (c) 2008, 2017 Otto Moerbeek Copyright (c) 2004 Ted Unangst Copyright (c) 1994 Christos Zoulas Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre See the individual files for information about who contributed to which file during which years. The mandoc distribution as a whole is distributed by its developers under the following license: Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. The following files included from outside sources are protected by other people's Copyright and are distributed under various 2-clause and 3-clause BSD licenses; see these individual files for details. soelim.c, soelim.1: Copyright (c) 2014 Baptiste Daroussin compat_err.c, compat_fts.c, compat_fts.h, compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, man.1: Copyright (c) 1989,1990,1993,1994 The Regents of the University of California compat_stringlist.c, compat_stringlist.h: Copyright (c) 1994 Christos Zoulas mandoc-1.14.6/Makefile010064400017530001753000000366571412314055300150300ustar00schwarzeschwarze# $Id: Makefile,v 1.540 2021/09/21 11:04:40 schwarze Exp $ # # Copyright (c) 2011, 2013-2021 Ingo Schwarze # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. VERSION = 1.14.6 # === LIST OF FILES ==================================================== TESTSRCS = test-attribute.c \ test-be32toh.c \ test-cmsg.c \ test-dirent-namlen.c \ test-EFTYPE.c \ test-err.c \ test-fts.c \ test-getline.c \ test-getsubopt.c \ test-isblank.c \ test-mkdtemp.c \ test-mkstemps.c \ test-nanosleep.c \ test-noop.c \ test-ntohl.c \ test-O_DIRECTORY.c \ test-ohash.c \ test-PATH_MAX.c \ test-pledge.c \ test-progname.c \ test-reallocarray.c \ test-recallocarray.c \ test-recvmsg.c \ test-rewb-bsd.c \ test-rewb-sysv.c \ test-sandbox_init.c \ test-strcasestr.c \ test-stringlist.c \ test-strlcat.c \ test-strlcpy.c \ test-strndup.c \ test-strptime.c \ test-strsep.c \ test-strtonum.c \ test-vasprintf.c \ test-wchar.c SRCS = arch.c \ att.c \ catman.c \ cgi.c \ chars.c \ compat_err.c \ compat_fts.c \ compat_getline.c \ compat_getsubopt.c \ compat_isblank.c \ compat_mkdtemp.c \ compat_mkstemps.c \ compat_ohash.c \ compat_progname.c \ compat_reallocarray.c \ compat_recallocarray.c \ compat_strcasestr.c \ compat_stringlist.c \ compat_strlcat.c \ compat_strlcpy.c \ compat_strndup.c \ compat_strsep.c \ compat_strtonum.c \ compat_vasprintf.c \ dba.c \ dba_array.c \ dba_read.c \ dba_write.c \ dbm.c \ dbm_map.c \ demandoc.c \ eqn.c \ eqn_html.c \ eqn_term.c \ html.c \ lib.c \ main.c \ man.c \ man_html.c \ man_macro.c \ man_term.c \ man_validate.c \ mandoc.c \ mandoc_aux.c \ mandoc_msg.c \ mandoc_ohash.c \ mandoc_xr.c \ mandocd.c \ mandocdb.c \ manpath.c \ mansearch.c \ mdoc.c \ mdoc_argv.c \ mdoc_html.c \ mdoc_macro.c \ mdoc_man.c \ mdoc_markdown.c \ mdoc_state.c \ mdoc_term.c \ mdoc_validate.c \ msec.c \ out.c \ preconv.c \ read.c \ roff.c \ roff_html.c \ roff_term.c \ roff_validate.c \ soelim.c \ st.c \ tag.c \ tbl.c \ tbl_data.c \ tbl_html.c \ tbl_layout.c \ tbl_opts.c \ tbl_term.c \ term.c \ term_ascii.c \ term_ps.c \ term_tab.c \ term_tag.c \ tree.c DISTFILES = INSTALL \ LICENSE \ Makefile \ Makefile.depend \ NEWS \ TODO \ apropos.1 \ catman.8 \ cgi.h.example \ compat_fts.h \ compat_ohash.h \ compat_stringlist.h \ configure \ configure.local.example \ dba.h \ dba_array.h \ dba_write.h \ dbm.h \ dbm_map.h \ demandoc.1 \ eqn.7 \ eqn.h \ eqn_parse.h \ gmdiff \ html.h \ lib.in \ libman.h \ libmandoc.h \ libmdoc.h \ main.h \ makewhatis.8 \ man.1 \ man.7 \ man.cgi.3 \ man.cgi.8 \ man.conf.5 \ man.h \ man.options.1 \ manconf.h \ mandoc.1 \ mandoc.3 \ mandoc.css \ mandoc.db.5 \ mandoc.h \ mandoc_aux.h \ mandoc_char.7 \ mandoc_escape.3 \ mandoc_headers.3 \ mandoc_html.3 \ mandoc_malloc.3 \ mandoc_ohash.h \ mandoc_parse.h \ mandoc_xr.h \ mandocd.8 \ mansearch.3 \ mansearch.h \ mchars_alloc.3 \ mdoc.7 \ mdoc.h \ msec.in \ out.h \ predefs.in \ roff.7 \ roff.h \ roff_int.h \ soelim.1 \ tag.h \ tbl.3 \ tbl.7 \ tbl.h \ tbl_int.h \ tbl_parse.h \ term.h \ term_tag.h \ $(SRCS) \ $(TESTSRCS) LIBMAN_OBJS = man.o \ man_macro.o \ man_validate.o LIBMDOC_OBJS = att.o \ lib.o \ mdoc.o \ mdoc_argv.o \ mdoc_macro.o \ mdoc_state.o \ mdoc_validate.o \ st.o LIBROFF_OBJS = eqn.o \ roff.o \ roff_validate.o \ tbl.o \ tbl_data.o \ tbl_layout.o \ tbl_opts.o LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ $(LIBMDOC_OBJS) \ $(LIBROFF_OBJS) \ arch.o \ chars.o \ mandoc.o \ mandoc_aux.o \ mandoc_msg.o \ mandoc_ohash.o \ mandoc_xr.o \ msec.o \ preconv.o \ read.o \ tag.o ALL_COBJS = compat_err.o \ compat_fts.o \ compat_getline.o \ compat_getsubopt.o \ compat_isblank.o \ compat_mkdtemp.o \ compat_mkstemps.o \ compat_ohash.o \ compat_progname.o \ compat_reallocarray.o \ compat_recallocarray.o \ compat_strcasestr.o \ compat_stringlist.o \ compat_strlcat.o \ compat_strlcpy.o \ compat_strndup.o \ compat_strsep.o \ compat_strtonum.o \ compat_vasprintf.o MANDOC_HTML_OBJS = eqn_html.o \ html.o \ man_html.o \ mdoc_html.o \ roff_html.o \ tbl_html.o MANDOC_TERM_OBJS = eqn_term.o \ man_term.o \ mdoc_term.o \ roff_term.o \ term.o \ term_ascii.o \ term_ps.o \ term_tab.o \ term_tag.o \ tbl_term.o DBM_OBJS = dbm.o \ dbm_map.o \ mansearch.o DBA_OBJS = dba.o \ dba_array.o \ dba_read.o \ dba_write.o \ mandocdb.o MAIN_OBJS = $(MANDOC_HTML_OBJS) \ $(MANDOC_MAN_OBJS) \ $(MANDOC_TERM_OBJS) \ $(DBM_OBJS) \ $(DBA_OBJS) \ main.o \ manpath.o \ mdoc_man.o \ mdoc_markdown.o \ out.o \ tree.o CGI_OBJS = $(MANDOC_HTML_OBJS) \ $(DBM_OBJS) \ cgi.o \ out.o MANDOCD_OBJS = $(MANDOC_HTML_OBJS) \ $(MANDOC_TERM_OBJS) \ mandocd.o \ out.o DEMANDOC_OBJS = demandoc.o WWW_MANS = apropos.1.html \ demandoc.1.html \ man.1.html \ man.options.1.html \ mandoc.1.html \ soelim.1.html \ man.cgi.3.html \ mandoc.3.html \ mandoc_escape.3.html \ mandoc_headers.3.html \ mandoc_html.3.html \ mandoc_malloc.3.html \ mansearch.3.html \ mchars_alloc.3.html \ tbl.3.html \ man.conf.5.html \ mandoc.db.5.html \ eqn.7.html \ man.7.html \ mandoc_char.7.html \ mdoc.7.html \ roff.7.html \ tbl.7.html \ catman.8.html \ makewhatis.8.html \ man.cgi.8.html \ mandocd.8.html WWW_INCS = eqn.h.html \ html.h.html \ man.h.html \ manconf.h.html \ mandoc.h.html \ mandoc_aux.h.html \ mandoc_parse.h.html \ mansearch.h.html \ mdoc.h.html \ roff.h.html \ tbl.h.html \ tbl_int.h.html \ tbl_parse.h.html # === USER CONFIGURATION =============================================== include Makefile.local # === DEPENDENCY HANDLING ============================================== all: mandoc man demandoc soelim $(BUILD_TARGETS) Makefile.local install: base-install $(INSTALL_TARGETS) www: $(WWW_MANS) $(WWW_INCS) $(WWW_MANS) $(WWW_INCS): mandoc .PHONY: base-install cgi-install install www-install .PHONY: clean distclean depend include Makefile.depend # === TARGETS CONTAINING SHELL COMMANDS ================================ distclean: clean rm -f Makefile.local config.h config.h.old config.log config.log.old clean: rm -f libmandoc.a $(LIBMANDOC_OBJS) $(ALL_COBJS) rm -f mandoc man $(MAIN_OBJS) rm -f man.cgi $(CGI_OBJS) rm -f mandocd catman catman.o $(MANDOCD_OBJS) rm -f demandoc $(DEMANDOC_OBJS) rm -f soelim soelim.o rm -f $(WWW_MANS) $(WWW_INCS) mandoc*.tar.gz mandoc*.sha256 rm -f Makefile.tmp1 Makefile.tmp2 rm -rf *.dSYM base-install: mandoc demandoc soelim mkdir -p $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(SBINDIR) mkdir -p $(DESTDIR)$(MANDIR)/man1 mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man7 mkdir -p $(DESTDIR)$(MANDIR)/man8 $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM) cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_MAN) cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_APROPOS) cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_WHATIS) cd $(DESTDIR)$(SBINDIR) && \ $(LN) ${BIN_FROM_SBIN}/mandoc $(BINM_MAKEWHATIS) $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 $(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1 $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 cd $(DESTDIR)$(MANDIR)/man1 && $(LN) $(BINM_APROPOS).1 $(BINM_WHATIS).1 $(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/$(MANM_MANCONF).5 $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_MAN).7 $(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_MDOC).7 $(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_ROFF).7 $(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_EQN).7 $(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_TBL).7 $(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 $(INSTALL_MAN) makewhatis.8 \ $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8 lib-install: libmandoc.a mkdir -p $(DESTDIR)$(LIBDIR) mkdir -p $(DESTDIR)$(INCLUDEDIR) mkdir -p $(DESTDIR)$(MANDIR)/man3 $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) $(INSTALL_LIB) eqn.h man.h mandoc.h mandoc_aux.h mandoc_parse.h \ mdoc.h roff.h tbl.h $(DESTDIR)$(INCLUDEDIR) $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ mansearch.3 mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 cgi-install: man.cgi mkdir -p $(DESTDIR)$(CGIBINDIR) mkdir -p $(DESTDIR)$(HTDOCDIR) $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) $(INSTALL_DATA) mandoc.css $(DESTDIR)$(HTDOCDIR) catman-install: mandocd catman mkdir -p $(DESTDIR)$(SBINDIR) mkdir -p $(DESTDIR)$(MANDIR)/man8 $(INSTALL_PROGRAM) mandocd $(DESTDIR)$(SBINDIR) $(INSTALL_PROGRAM) catman $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN) $(INSTALL_MAN) mandocd.8 $(DESTDIR)$(MANDIR)/man8 $(INSTALL_MAN) catman.8 $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8 uninstall: rm -f $(DESTDIR)$(BINDIR)/mandoc rm -f $(DESTDIR)$(BINDIR)/demandoc rm -f $(DESTDIR)$(BINDIR)/$(BINM_SOELIM) rm -f $(DESTDIR)$(BINDIR)/$(BINM_MAN) rm -f $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) rm -f $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) rm -f $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) rm -f $(DESTDIR)$(MANDIR)/man1/mandoc.1 rm -f $(DESTDIR)$(MANDIR)/man1/demandoc.1 rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1 rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 rm -f $(DESTDIR)$(MANDIR)/man5/$(MANM_MANCONF).5 rm -f $(DESTDIR)$(MANDIR)/man5/mandoc.db.5 rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_MAN).7 rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_MDOC).7 rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_ROFF).7 rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_EQN).7 rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_TBL).7 rm -f $(DESTDIR)$(MANDIR)/man7/mandoc_char.7 rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8 rm -f $(DESTDIR)$(CGIBINDIR)/man.cgi rm -f $(DESTDIR)$(HTDOCDIR)/mandoc.css rm -f $(DESTDIR)$(SBINDIR)/mandocd rm -f $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN) rm -f $(DESTDIR)$(MANDIR)/man8/mandocd.8 rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8 rm -f $(DESTDIR)$(LIBDIR)/libmandoc.a rm -f $(DESTDIR)$(MANDIR)/man3/mandoc.3 rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_escape.3 rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_malloc.3 rm -f $(DESTDIR)$(MANDIR)/man3/mansearch.3 rm -f $(DESTDIR)$(MANDIR)/man3/mchars_alloc.3 rm -f $(DESTDIR)$(MANDIR)/man3/tbl.3 rm -f $(DESTDIR)$(INCLUDEDIR)/eqn.h rm -f $(DESTDIR)$(INCLUDEDIR)/man.h rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc.h rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc_aux.h rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc_parse.h rm -f $(DESTDIR)$(INCLUDEDIR)/mdoc.h rm -f $(DESTDIR)$(INCLUDEDIR)/roff.h rm -f $(DESTDIR)$(INCLUDEDIR)/tbl.h [ ! -e $(DESTDIR)$(INCLUDEDIR) ] || rmdir $(DESTDIR)$(INCLUDEDIR) regress: all cd regress && ./regress.pl regress-clean: cd regress && ./regress.pl . clean Makefile.local config.h: configure $(TESTSRCS) @echo "$@ is out of date; please run ./configure" @exit 1 libmandoc.a: $(MANDOC_COBJS) $(LIBMANDOC_OBJS) $(AR) rs $@ $(MANDOC_COBJS) $(LIBMANDOC_OBJS) mandoc: $(MAIN_OBJS) libmandoc.a $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD) man: mandoc $(LN) mandoc man man.cgi: $(CGI_OBJS) libmandoc.a $(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD) mandocd: $(MANDOCD_OBJS) libmandoc.a $(CC) -o $@ $(LDFLAGS) $(MANDOCD_OBJS) libmandoc.a $(LDADD) catman: catman.o libmandoc.a $(CC) -o $@ $(LDFLAGS) catman.o libmandoc.a $(LDADD) demandoc: $(DEMANDOC_OBJS) libmandoc.a $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD) soelim: $(SOELIM_COBJS) soelim.o $(CC) -o $@ $(LDFLAGS) $(SOELIM_COBJS) soelim.o # --- maintainer targets --- www-install: www $(INSTALL_DATA) mandoc.css $(HTDOCDIR) $(INSTALL_DATA) $(WWW_MANS) $(HTDOCDIR)/man $(INSTALL_DATA) $(WWW_INCS) $(HTDOCDIR)/includes depend: config.h ./configure -depend mkdep -f Makefile.tmp1 $(CFLAGS) $(SRCS) perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ s|\\\n||g; s| +| |g; s| $$||mg; print;' \ Makefile.tmp1 > Makefile.tmp2 rm Makefile.tmp1 mv Makefile.tmp2 Makefile.depend regress-distclean: @find regress \ -name '.#*' -o \ -name '*.orig' -o \ -name '*.rej' -o \ -name '*.core' \ -exec rm -i {} \; regress-distcheck: @find regress ! -type d ! -type f @find regress -type f \ ! -path '*/CVS/*' \ ! -name Makefile \ ! -name Makefile.inc \ ! -name '*.in' \ ! -name '*.out_ascii' \ ! -name '*.out_utf8' \ ! -name '*.out_html' \ ! -name '*.out_markdown' \ ! -name '*.out_lint' \ ! -path regress/regress.pl \ ! -path regress/regress.pl.1 dist: mandoc-$(VERSION).sha256 mandoc-$(VERSION).sha256: mandoc-$(VERSION).tar.gz sha256 mandoc-$(VERSION).tar.gz > $@ mandoc-$(VERSION).tar.gz: $(DISTFILES) ls regress/*/*/*.mandoc_* && exit 1 || true mkdir -p .dist/mandoc-$(VERSION)/ $(INSTALL) -m 0644 $(DISTFILES) .dist/mandoc-$(VERSION) cp -pR regress .dist/mandoc-$(VERSION) find .dist/mandoc-$(VERSION)/regress \ -type d -name CVS -print0 | xargs -0 rm -rf chmod 755 .dist/mandoc-$(VERSION)/configure ( cd .dist/ && tar zcf ../$@ mandoc-$(VERSION) ) rm -rf .dist/ dist-install: dist $(INSTALL_DATA) mandoc-$(VERSION).tar.gz mandoc-$(VERSION).sha256 \ $(HTDOCDIR)/snapshots # === SUFFIX RULES ===================================================== .SUFFIXES: .1 .3 .5 .7 .8 .h .SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html .h.h.html: highlight -I $< > $@ .1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: ./mandoc -Thtml -Wwarning,stop \ -O 'style=/mandoc.css,man=/man/%N.%S.html;https://man.openbsd.org/%N.%S,includes=/includes/%I.html' \ $< > $@ mandoc-1.14.6/Makefile.depend010064400017530001753000000136541412314055300162560ustar00schwarzeschwarzearch.o: arch.c config.h roff.h att.o: att.c config.h roff.h libmdoc.h catman.o: catman.c config.h compat_fts.h cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h main.h manconf.h mansearch.h cgi.h chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h compat_err.o: compat_err.c config.h compat_fts.o: compat_fts.c config.h compat_fts.h compat_getline.o: compat_getline.c config.h compat_getsubopt.o: compat_getsubopt.c config.h compat_isblank.o: compat_isblank.c config.h compat_mkdtemp.o: compat_mkdtemp.c config.h compat_mkstemps.o: compat_mkstemps.c config.h compat_ohash.o: compat_ohash.c config.h compat_ohash.h compat_progname.o: compat_progname.c config.h compat_reallocarray.o: compat_reallocarray.c config.h compat_recallocarray.o: compat_recallocarray.c config.h compat_strcasestr.o: compat_strcasestr.c config.h compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h compat_strlcat.o: compat_strlcat.c config.h compat_strlcpy.o: compat_strlcpy.c config.h compat_strndup.o: compat_strndup.c config.h compat_strsep.o: compat_strsep.c config.h compat_strtonum.o: compat_strtonum.c config.h compat_vasprintf.o: compat_vasprintf.c config.h dba.o: dba.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mansearch.h dba_write.h dba_array.h dba.h dba_array.o: dba_array.c config.h mandoc_aux.h dba_write.h dba_array.h dba_read.o: dba_read.c config.h mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h dba_write.o: dba_write.c config.h dba_write.h dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h mandoc_parse.h eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h eqn.h libmandoc.h eqn_parse.h eqn_html.o: eqn_html.c config.h mandoc.h roff.h eqn.h out.h html.h eqn_term.o: eqn_term.c config.h eqn.h out.h term.h html.o: html.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h out.h html.h manconf.h main.h lib.o: lib.c config.h roff.h libmdoc.h lib.in main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h mandoc_parse.h tag.h term_tag.h main.h manconf.h mansearch.h man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h term_tag.h main.h man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h tag.h mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h roff_int.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h mandoc_msg.o: mandoc_msg.c config.h mandoc.h mandoc_ohash.o: mandoc_ohash.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.o: mandoc_xr.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h main.h manconf.h mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h manconf.h mansearch.h dba_array.h dba.h manpath.o: manpath.c config.h mandoc_aux.h mandoc.h manconf.h mansearch.o: mansearch.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h html.h main.h mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h mdoc_markdown.o: mdoc_markdown.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h main.h mdoc_state.o: mdoc_state.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_term.o: mdoc_term.c config.h mandoc_aux.h roff.h mdoc.h out.h term.h term_tag.h main.h mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h tag.h msec.o: msec.c config.h mandoc.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h tbl.h out.h preconv.o: preconv.c config.h mandoc.h roff.h mandoc_parse.h libmandoc.h read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h libmandoc.h roff_int.h tag.h roff.o: roff.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mandoc_parse.h libmandoc.h roff_int.h tbl_parse.h eqn_parse.h predefs.in roff_html.o: roff_html.c config.h mandoc.h roff.h out.h html.h roff_term.o: roff_term.c config.h mandoc.h roff.h out.h term.h roff_validate.o: roff_validate.c config.h mandoc.h roff.h libmandoc.h roff_int.h soelim.o: soelim.c config.h compat_stringlist.h st.o: st.c config.h mandoc.h roff.h libmdoc.h tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h roff.h mdoc.h roff_int.h tag.h tbl.o: tbl.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_parse.h tbl_int.h tbl_data.o: tbl_data.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_html.o: tbl_html.c config.h mandoc.h roff.h tbl.h out.h html.h tbl_layout.o: tbl_layout.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_opts.o: tbl_opts.c config.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_term.o: tbl_term.c config.h mandoc.h tbl.h out.h term.h term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h manconf.h main.h term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h manconf.h main.h term_tab.o: term_tab.c config.h mandoc_aux.h out.h term.h term_tag.o: term_tag.c config.h mandoc.h roff.h roff_int.h tag.h term_tag.h tree.o: tree.c config.h mandoc.h roff.h mdoc.h man.h tbl.h eqn.h main.h mandoc-1.14.6/NEWS010064400017530001753000002177771412314055300140730ustar00schwarzeschwarze$Id: NEWS,v 1.40 2021/09/23 18:03:00 schwarze Exp $ This file lists the most important changes in the mandoc.bsd.lv distribution. Changes in version 1.14.6, released on September 23, 2021 --- MAJOR NEW FEATURES --- * mdoc(7): automatic tagging improved in many respects * mdoc(7): new .Tg (tag) macro to explicitly mark a place as defining a term * man(7): implement some automatic tagging support * man(1): let -w without argument show the manpath, like in man-db and man-1.6 * -T html: wrap text and phrasing elements in paragraphs unless already contained in flow containers; never put them directly into sections. This helps to format paragraphs with the CSS class selector .Pp. * man.conf(5): remove support for the "_whatdb" configuration directive that was deprecated in 2015; please use "manpath" instead --- MINOR NEW FEATURES --- * man(1): switch the default pager from "more -s" to "less" * man(1): in the fallback code to look for manual pages without using mandoc.db(5), accept files "man/." in addition to the already supported "man/name.[01-9]*" * if messages are shown and output is printed without a pager, display a heads-up on stderr at the end because otherwise, users may easily miss the messages * man.cgi(8): add a Content-Security-Policy HTTP header * man.cgi(8): switch off autocomplete and autocapitalize * mandoc.css: support prefers-color-scheme: dark * -T html: add meta viewport element to help mobile devices * -T html -O tag: let this pass a file:// URI to the pager * tbl(7): implement the "nospaces" option * tbl(7) -T html: implement the "a" (em indent) layout specification * tbl(7) -T html: implement the "b" (bold) and "i" (italic) layout modifiers * tbl(7): support two-character font names in the layout font modifier * tbl(7) -T html: support horinzontal rulers in individual cells * tbl(7) -T tree: print more details about columns, options, rows, and cells * roff(7): implement the .break request (break out of a .while loop) * roff(7): support the CB and CI fonts in \f and .ft * -T lint: new STYLE message if a file name extension contradicts .Dt/.TH * -T lint: new STYLE message about overlong text lines * -W style: check .Xr links along the full manpath --- RELIABILITY BUGFIXES --- * man(1): do not segfault if /tmp/ is not writeable * man(1): do not access a NULL pointer when both -l and -w are given * makewhatis(8): do not crash when a manpath directory contains a symbolic link that points to a directory * man(7): fix an assertion failure caused by doubly nested next-line scopes * tbl(7): fix a crash when the last column is only reached by spans * tbl(7): fix a NULL pointer access in some cases of two spans on one row * tbl(7) -T ascii: fix a NULL pointer access on empty data cells * tbl(7) -T ascii: fix a NULL pointer access on a line next to a short row * tbl(7): fix an assertion failure caused by excessive spacing modifiers * tbl(7): fix an infinite loop for some overlapping horizontal spans * roff(7): fix a rare case of writing one byte past the end of the input buffer * roff(7): do not call abort(3) when \*[.T] is encountered * roff(7): fix an assertion failure caused by a macro inside .ce .if * roff(7): fix assertion failures for .ti and .po with excessive arguments * roff(7): avoid near-infinte output for .ce inside explicit no-fill mode * -T ascii/utf8: fix assertion failures caused by excessive spacing * -T html: fix an assertion failure caused by .ft in rare situations * -T man: fix an assertion failure caused by tbl(7) and eqn(7) input --- PORTABILITY IMPROVEMENTS --- * rename HOMEBREWDIR to READ_ALLOWED_PATH, allow it to contain more than one directory, and explain how to use that for NixOS and GNU Guix Linux * configure: stop trying to ask make(1) what the default compiler is because that test was too fragile; just use "cc" by default * configure: various simplifications and improved robustness * configure: only compile compat_*.c implementations that are needed * configure: provide feature tests for __attribute__(()) and mkstemps(3) * compat_*: sync with upstreams for security, functionality, and style * in regress.pl, avoid the non-portable options sed(1) -i and echo(1) -n * in the regression suite, avoid file names that differ only by case --- MINOR FUNCTIONAL IMPROVEMENTS --- * man(1) -h: for pages lacking a SYNOPSIS, show the NAME section * man(1): when the first argument starts with a digit, optionally followed by a letter, and at least one more argument follows, interpret the first argument as a section name even when additional characters follow after the digit and letter * man(1): with a specific section requested, try harder to find the best match; use this order of preference: 1. The section in both the directory name and the file name matches exactly. 2. The section in the file name matches exactly. 3. The section in the directory name matches exactly. 4. Neither of them matches exactly. * man(1): if no tags were generated at all, unlink(2) the empty tags file as soon as the condition can be detected and do not pass it to less(1) * makewhatis(8): handle both dangling symlinks and .so links in manual page directories more gracefully * man.cgi(8): for invalid queries and for valid queries returning no result, return the appropriate 40x status code rather than 200 * mdoc(7): let .Dd concatenate all arguments and default to the empty string * mdoc(7): convert ".Fl Fl" to ".Fl \-" during validation, improving -T html * mdoc(7): improve output of .At 32v * man(7): no longer print multiple blank lines before NAME and page footer * tbl(7) -T utf8: improved rendering of horizontal lines * tbl(7) -T html: in "n" cells, align by padding numbers on the right * tbl(7): no longer leak tabulator settings to subsequent roff(7) code * mdoc(7) -T html: for .Bl -tag, use "column-count: 1" rather than "overflow: auto" to avoid the ugly side effects * mdoc(7) -T html: render .Bd -unfilled in proportionally-spaced font * mdoc(7) -T html: format .Nd with rather than
* mdoc(7) -T lint: do not warn about Mdocdate without an actual date * mdoc(7) -T lint: do not complain about function types of the form "ret_type (fname)(args)", but otherwise check names more strictly * -T html: append .html suffix to temporary files to please browsers * -T markdown: print a BAGARG message if called on man(7) input --- MINOR BUGFIXES --- * man(1): do the search for each name independently, and show the results in the order of the command line argument * man(1): escape shell wildcard characters in name arguments before glob(3) * man(1): when asking for a single manual page by name, prefer file name matches over .Dt/.TH matches over first NAME matches over later NAME matches, but do not change the ordering for apropos(1) nor for man -a * man(1): correctly extract the section name from the file name extension of gzipped manual page files * makewhatis(8): fix file type tests putting wrong data into mandoc.db(5) * man.cgi(8): fix section number in the element for preformatted pages * tbl(7): correct handling of T& after horizontal rulers in the layout * tbl(7): correct column widths if rows have different numbers of cells * tbl(7): empty columns are 1n wide rather than 0n * tbl(7): correctly calculate required column widths for tables containing cells that horizontally span columns which contains "n" (number) formatted cells on other rows * tbl(7): skip escape sequences when looking for column separators * eqn(7): skip whitespace before tokens * roff(7): when calling an empty macro, do not clobber existing arguments * roff(7): recognize \} on lines closing a macro definition request * roff(7): do not throw a bogus warning for "'br\}" and similar lines * roff(7): stop generating comment nodes when encountering the first content * mandoc_char(7): make \0 (digit-width space) non-breaking * mdoc(7) .Bl -column: parse Macro in .It "word<tab>word" Ta word Macro<eol> * mdoc(7) -T html: display straight quotes, not curly quotes, for .Qq/.Qo * -T html: remove some spurious line breaks, in particular inside <pre> * -T html: use <br/> for a space character at the beginning of an input line * -T html: use ~%d for ordinal fragment suffixes, reserve '~' for that purpose --- STRUCTURAL IMPROVEMENTS --- * introduce the concept of semantically transparent syntax tree nodes, allowing improved decisions in various validators and formatters * move some code out of the giant main() into separate functions doing one well-defined task each * clearly separate parser state (struct curparse) and formatter state (struct outstate), don't mix them in the same struct * in the HTML formatter, assert(3) that no HTML nesting violation occurs * let html_close_paragraph() close any phrasing context --- THANKS TO --- * Anthony Bentley and Klemens Nanni (OpenBSD) for many patches and bug reports, for useful discussions, and for checking patches * Anton Lindqvist (OpenBSD) for two patches and a bug report * Marc Espie (OpenBSD) for a patch, many bug reports, and useful discussions * Lukas Epple (NixOS) for a patch, bug reports, suggesting a minor portability feature, checking patches, and extensive release testing * Abel Romero Perez for a patch, a bug report, and suggesting a new feature * nabijaczleweli for a patch and for suggesting feature improvements * Jonathan Gray (OpenBSD) for a patch and for bug reports * Otto Moerbeek (OpenBSD) and Alexander Gromnitsky for a patch * Armin Besirovic for a contribution to mandoc.css * Jason McIntyre (OpenBSD) for manual page patches, suggesting a new feature, checking many patches, and useful discussions * Martin Vahlensieck for a manual page patch and reporting a code style issue * Frederic Cambus and Ian Sutton (OpenBSD) for a manual page patch * Jan Schreiber for many bug reports found with afl(1) * G. Branden Robinson (GNU troff) for several bug reports, feature suggestions, and for checking many groff patches * Michael Stapelberg (Debian) for several bug reports and feature suggestions, and for extensive release testing * Ian Ropers, Lorenzo Beretta, and Oliver Corff for several bug reports and feature suggestions * Stephen Gregoratto for several bug reports * Theo de Raadt (OpenBSD) for two bug reports, checking a patch, and a useful discussion * Thomas Klausner (NetBSD) for two bug reports and for release testing * Andreas Kahari and Jason A. Donenfeld for two bug reports * Soeren Tempel (Alpine Linux) for a bug report, suggesting a feature improvement, and checking two patches * Aman Verma, Jan Stary, and John Gardner for a bug report and for suggesting a feature impovement * Todd Miller (OpenBSD) for a bug report, checking a patch, and a useful discussion * Andrew Fresh, Brian Callahan, Christian Weisgerber, Paul de Weerd (OpenBSD), Havard Eidnes, Jason Thorpe (NetBSD), Yuri Pankov (FreeBSD), Bjarni Ingi Gislason, Chris Bennett, Edgar Pettijohn, Eldred Habert, Jamie Landeg-Jones, Kazuo KUROI, and Wynn Wolf Arbor for a bug report * Theo Buehler (OpenBSD) for suggesting two feature impovements and for checking a patch * Leah Neukirchen (Void Linux) for suggesting a feature impovement and for release testing * Colin Watson (Debian) for suggesting a feature impovement and for checking groff patches * Matej Cepl (SUSE Linux), Matthew Martin, Steffen Nurpmeso, and Tim Baumgard for suggesting a feature impovement * Christos Zoulas (NetBSD) for a report regarding portability * Daniel Dickman (OpenBSD) for suggesting a portability improvement * Werner Lemberg (GNU troff) and Douglas McIlroy for reporting bugs in manual pages * Baptiste Daroussin and Eygene Ryabinkin (FreeBSD) for an additional regression test * Michal Nowak for reporting several code style issues * TJ Townsend (OpenBSD) for help with CSS * Sevan Janiyan (NetBSD) and Robert Mustacchi (Illumos) for extensive release testing * Job Snijders, Kinichiro INOGUCHI, and Martijn van Duren (OpenBSD) for checking patches * Bertrand Garrigues and Ralph Corderoy (GNU troff) for checking groff patches Changes in version 1.14.5, released on March 10, 2019 --- MAJOR NEW FEATURES --- * apropos(1): improve POSIX compliance by accepting case-insensitive extended regular expressions by default * new -O tag[=term] output option (open a page at the definition of a term) * tbl(7) -T html: spanning and horizontal and vertical alignment of cells * tbl(7) -T html: draw lines on the edges of table cells * tbl(7) -T utf8: render lines with the Unicode box drawing characters * mandoc is now able to handle the manual pages of the groff package. --- MINOR NEW FEATURES --- * -T html: new option -O toc (table of contents) * -T html: second argument to -O man to support local and remote links * mdoc(7) .Bd -centered now fills the text contained in it * man-ext .SY and .YS macros (synopsis block) * man-ext .TQ macro (tagged paragraph without vertical space before it) * tbl(7) \& explicit alignment indicator * roff(7) .shift, .while, and .return requests * roff(7) .char request (output glyph definition) * roff(7) .nop request (no operation) * roff(7) .ft request: handle the CB, CI, and CR fonts * roff(7) .if c conditional (character available) * roff(7) \\$@ escape sequence (insert all macro arguments, quoted) * roff(7) \*(.T predefined string (interpolate output device name) * roff(7) \[charNNN] escape sequence (for printable ASCII characters) * roff(7) \# escape sequence (line continuation with comment) --- HTML OUTPUT SYNTAX CORRECTIONS --- * Render .br and \p as <br/>, not as an empty <div>. * Render .Pp and .PP as <p> and automatically close it when needed. * Stop writing empty list elements for non-compact .Bl -tag lists. * Do not put <p> inside <a> if .UR or .MT contain .PP. * Implement tooltips purely in CSS rather than abusing title= attributes. --- MINOR FUNCTIONAL IMPROVEMENTS --- * many improvements to the handling of fill and no-fill mode * tbl(7): better column widths in the presence of horizontal spans * several minor improvements to escape sequence handling * several minor improvements to manual font handling * portability: autodetect need for _GNU_SOURCE or _OPENBSD_SOURCE * portability: autodetect whether less(1) supports the -T option * large numbers of bugfixes of diverse kinds --- STRUCTURAL IMPROVEMENTS --- * Disentangle eqn(7) and tbl(7) from other parser header files, and clean up some parser data structures. * Substantially simplify error and warning message infrastructure. --- THANKS TO --- * John Gardner for crucial help implementing tooltips in CSS. * Alexander Bluhm, Raphael Graf, Ted Unangst (OpenBSD) and Daniel Sabogal (Alpine Linux) for patches. * Anthony Bentley and Jason McIntyre (OpenBSD) for documentation patches, suggesting new features, bug reports, and useful discussions. * Kyle Evans and Baptiste Daroussin (FreeBSD) for minor patches. * Pali Rohar for suggesting multiple new features and for reporting several bugs and missing features. * Klemens Nanni (OpenBSD) for suggesting multiple new features. * Kristaps Dzonsons (bsd.lv), Marc Espie (OpenBSD), Adam Kalisz, and Laura Morales for suggesting new features. * Wolfram Schneider and Yuri Pankov (FreeBSD) for reporting missing features. * Edward Tomasz Napierala (FreeBSD) for suggesting a feature improvement. * Thomas Klausner (NetBSD) and Sevan Janiyan (SmartOS) for bug reports and release testing. * Bryan Steele, Janne Johansson, Kurt Mosiejczuk, Mike Belopuhov, Theo Buehler, Todd Miller (OpenBSD), Andreas Gustafsson, Christos Zoulas, Robert Elz (NetBSD), Kurt Jaeger (FreeBSD), Fabio Scotoni, Kelvin Sherlock, Mark Harris, Orestis Ioannou, Raf Czlonka, and Sean Farrell for bug reports. * Ulrich Spoerlein (FreeBSD), Leah Neukirchen (Void Linux), Matej Cepl (openSUSE), and Jan Stary (MacOS X) for release testing. * Brian Callahan and Stuart Henderson (OpenBSD) for help with the OpenBSD groff port. * Bertrand Garrigues, Branden Robinson, Ralph Corderoy, and Werner Lemberg (GNU troff) for checking groff patches. * Scott Cheloha, Theo de Raadt (OpenBSD) and Natanael Copa (Alpine Linux) for useful discussions. Changes in version 1.14.4, released on August 8, 2018 --- MAJOR NEW FEATURES --- * In ASCII output, render mathematical symbols and greek letters as transliterations conveying the characters' meanings rather than trying to imitate their shape. Consequently, such characters can now be used in portable manual pages. All the same, please limit their use to contexts where they really matter, for example when showing complicated mathematical formulae. * First steps towards better support for small screens in HTML output (responsive design): avoid most style= attributes, in particular all hard-coded indentations and column widths, and provide a better mandoc.css style sheet with a @media query, using em units throughout, and avoiding redundancy in selectors. * Better HTML output with some more fitting HTML elements, eliminating needless class= attributes, and avoiding various HTML syntax errors (element nesting, URL-fragment syntax, duplicate id= attributes). --- MINOR NEW FEATURES --- * When a man(1) argument contains a slash, imply -l like in man-db. * Use TIOCGWINSZ to reduce the default -Owidth and -Oindent during interactive use on terminals narrower than 79 columns. * Generated PostScript files are now more than 50% smaller. * Terminal rendering of eqn(7) is improved in several respects. * Simplified and nicer output from the mdoc(7) .Lk macro, formatting all links in-line, even long ones. * roff(7) \n+ and \n- numerical register auto-increment and -decrement * roff(7) .nr optional third argument (auto-increment step size) * Autodetect in ./configure whether the compiler can use -W and -static, allowing to build on Solaris 10 and 11 without any configure.local. --- RELIABILITY BUGFIXES --- * Only activate UTF-8 output when the user really selected UTF-8, not some other multibyte character encoding. * Prevent excessive .ll arguments from generating infinite output. * Fix out of bounds accesses to parse buffers that could happen when using renamed or user defined macros after roff(7) conditionals. * Avoid an assertion failure in certain .Bl -column lists. * Avoid a NULL pointer access on deroff() failure after '.SS ""'. * Fix a segfault that could be triggered by two invalid .Dt macros. * Fix two syntax errors in generated PDF files. * Properly state the page size in generated PostScript files. * Close a memory leak caused by missing gzclose(3). * Fix misformatting of man(7) documents lacking .SH macros in PostScript and PDF output. * And many minor bugfixes. --- THANKS TO --- * Marc Espie (OpenBSD) for implementing the size reduction of PostScript files, one additional patch for code simplification, and two bug reports. * Theo Buehler (OpenBSD) for a bugfix patch, and Theo de Raadt (OpenBSD) for checking it. * John Gardner for more than a dozen suggestions regarding HTML output. * Mike Williams for teaching me how to use %%DocumentMedia and setpagedevice in PostScript files. * Werner Lemberg (groff) for feedback on mdoc(7) language changes. * Colin Watson (man-db) for feedback on man-db semantics. * Jason McIntyre (OpenBSD) for lots of feedback and suggestions on diagnostic messages and on the documentation. * Thomas Klausner (NetBSD) for suggesting two new style messages and one new feature, for two bug reports, and for release testing. * Leah Neukirchen (Void Linux) for suggesting a new style message, five bug reports, and release testing. * Anthony Bentley (OpenBSD) for reporting multiple bugs and missing features. * Paul Irofti (OpenBSD) and Nate Bargmann for suggesting new features. * Michael Stapelberg (Debian) for bug reports and release testing. * Christian Weisgerber, Jonathan Gray, Stuart Henderson, Ted Unangst (OpenBSD), Takeshi Nakayama (NetBSD), Anton Lazarov, Jakub Klinkovsky, Jan Stary, Jesper Wallin, Will Backmam, and Wolfgang Mueller for bug reports. * Sevan Janiyan (NetBSD) for additions to lib.in. * George Brown for suggesting code simplifications. * David Coppa, Igor Sobrado (OpenBSD), and Alexander Kuleshov for documentation improvements. * Laura Morales and Raf Czlonka for questions resulting in better documentation. * Yuri Pankov (illumos) for release testing. Changes in version 1.14.3, released on August 5, 2017 --- BUG FIXES --- * man(7): Do not crash with out-of-bounds read access to a constant array if .sp or a blank line immediately precedes .SS or .SH. * mdoc(7): Do not crash with out-of-bounds read access to a constant array if .sp or a blank line precede the first .Sh macro. * tbl(7): Ignore explicitly specified negative column widths rather than wrapping around to huge numbers and risking memory exhaustion. * man(1): No longer use names that only occur in the SYNOPSIS section. Gets rid of some surprising behaviour and bogus warnings. --- THANKS TO --- Leah Neukirchen (Void Linux), Markus Waldeck (Debian), Peter Bui (nd.edu), and Yuri Pankov (illumos) for bug reports. Changes in version 1.14.2, released on July 28, 2017 --- MAJOR NEW FEATURES --- * New mdoc(7) -Tmarkdown output mode. * For -Thtml, implement internal hyperlinks pointing to authoritative definitions of various syntax elements, similar to the ctags(1)-like less(1) :t internal searching in terminal mode. * Provide a superset of the functionality of the former mdoclint(1) utility and a new -Wstyle message level with several new messages, including validity checking of .Xr cross references. * tbl(7): Implement automatic line breaking inside individual table cells, and several other formatting improvements. * eqn(7): Complete rewrite of the lexer, resulting in several bugfixes. * Continue parser unification, in particular allowing generation of syntax tree nodes on the roff(7) level, allowing implementation of many additional roff requests. --- REMOVED FUNCTIONALITY --- * Delete the manpage(1) utility. It was never enabled in any release. * Delete the -Txhtml command line option. It has been an obsolete alias for the -Thtml output mode for more than two years. --- MINOR NEW FEATURES --- * -Tlint now puts parser messages on stdout instead of stderr, making commands like "man -l -Tlint *.1" useful. * mdoc(7): Various .Lk formatting improvements. * mdoc(7) -Thtml: Better CSS for .Bl lists. * man(7): Implement the .MT/.ME block macro (mailto hyperlink). * man(7): Implement the .DT macro (restore default tab positions). * man(7): Improved support for manuals generated with reStructuredText by partial support for the \n[an-margin] number register. * man(7) -Thtml: Support deep linking to .SH and .SS headers. * tbl(7): Implement the "allbox" table option. * tbl(7): Implement the column spacing and the 'w' (minimum column width) layout modifiers. * tbl(7): Significant improvements of the manual page. * eqn(7): Much improved font selection, including recognition of well-known function names, and a few other formatting improvements. * eqn(7) -Thtml: Use <mn> and <mo> in addition to <mi>. * roff(7): Implement the .ce (centering), .mc (margin character), .rj (right justify), .ta (define tab stops), .ti (temporary indent), .als (macro alias), .ec and .eo (escape character control), .po (page offset), and .rn (macro rename) requests. * roff(7) .am: Implement appending to mdoc(7) and man(7) macros. * roff(7): implement the \h (horizontol motion), \l (horizontal line drawing), and \p (break output line) escape sequences, and also several additional character escape sequences. * roff(7): Implement the 'd' conditional (macro or string defined). * man.cgi(8) now uses pledge(2), too. * regress.pl(1): simpler user interface, better summary output, simpler code, and no more recursion. --- THANKS TO --- * Anthony Bentley (OpenBSD) for the implementation of .MT/.ME, reports of many bugs and missing features, and suggestions for a number of feature and documentation improvements. * Sebastien Marie (OpenBSD) for two source code patches and for some useful discussions. * Florian Obser (OpenBSD) for a bugfix patch and a bug report. * Jonathan Gray (OpenBSD) for several bug reports from afl(1) and several more from static analysis tools. * Theo Buehler (OpenBSD) for several bug reports, most from afl(1). * Jason McIntyre (OpenBSD) for many useful discussions about a wide variety of topics, lots of continuous testing, a number of bug reports, and some suggestions for messages and documentation. * Thomas Klausner (NetBSD) for lots of help while migrating mdoclint(1) functionality to mandoc -Tlint, for suggesting several useful new messages, and for release testing. * Reyk Floeter (OpenBSD) and Vsevolod Stakhov (FreeBSD) for suggesting a markdown output mode. * Thomas Guettler for suggesting -Thtml internal hyperlinks. * Yuri Pankov (Illumos) for inspiring new warning messages and for extensive release testing. * Anton Lindqvist and TJ Townsend (both OpenBSD) and Jan Stary for multiple bug reports. * Leah Neukirchen (Void Linux) for bug reports and release testing. * Michael Stapelberg (Debian) for suggesting feature improvements and for release testing. * Martin Natano and Theo de Raadt (both OpenBSD), Andreas Voegele, Gabriel Guzman, Gonzalo Tornaria, Markus Waldeck, and Raf Czlonka for bug reports. * Antoine Jacoutot (OpenBSD) and Steffen Nurpmeso for suggesting feature improvements. * Dag-Erling Smoergrav (FreeBSD) for inspiring new warning messages. * Ted Unangst and Marc Espie (OpenBSD) for providing useful ideas. * Svyatoslav Mishyn (Crux Linux) for release testing. * Carsten Kunze (Heirloom roff) for help keeping mandoc and groff compatible and for committing some of my patches to groff. Changes in version 1.14.1, released on February 21, 2017 --- MAJOR NEW FEATURES --- * apropos(1): Reimplement complete semantic search functionality without the dependency on SQLite3, using only POSIX APIs. This comes with a completely new mandoc.db(5) file format. * man(1): Support more than one tag entry for the same search term, plus some minor improvements to the less(1) :t support. * -Thtml: Use real macro names for CSS classes. Systematic cleanup of and many improvements to mandoc.css. * -Thtml: Produce human readable HTML code by using indentation and better line breaks. Improve various HTML elements, and trim several useless ones. * New catman(8) utility, still somewhat experimental. * Now includes a portable version of the OpenBSD mandoc regression suite, see regress/regress.pl.1 for details. --- REMOVED FUNCTIONALITY --- * Operating systems that don't provide mmap(3) are no longer supported. * Drop support for manpath(1). Even if your system has manpath(1), it is simpler to use MANPATH_DEFAULT in configure.local for operating system defaults, man.conf(5) for machine-specific modifications, and ${MANPATH}, -m, and -M for user preferences than to bother with the complexity of manpath(1). * makewhatis(8) -p: No longer warn about missing MLINKS since these are no longer needed for anything. --- MINOR NEW FEATURES --- * mdoc(7): Warn about invalid punctuation and content below NAME. * mdoc(7): Warn about .Xr lacking the second argument (section). * mdoc(7): Warn about violations of the rule "new sentence, new line". * roff(7): Warn about trailing whitespace at the end of comments. * mdoc(7): Improve rendering of double quotes. * mdoc(7): Always do text production in the validator, never in the formatters. Cleaner, simpler, shorter, helps NetBSD apropos(1) and also makes -Ttree output more useful. * -Ttree: Show metadata and some additional node flags. New -Onoval output option to show the unvalidated tree. --- RELIABILITY BUGFIXES --- * man(1): Make "man -l" work with standard input from a pipe or file, as long as standard output is a terminal. * man(7): Fix out of bounds read access if a text node immediately preceded the first .SH header. * mdoc(7): Fix out of bounds read access for .Bl without a type but with a width. * mdoc(7): Fix out of bounds read access for .Bl -column starting with a tab character instead of a child .It macro. * mdoc(7): Fix syntax tree corruption leading to segfaults caused by stray block end macros in nested blocks of mismatching type. * man(1): Fix NULL dereference when the first of multiple pages shown was preformatted. * mdoc(7): Fix syntax tree corruption leading to NULL dereference caused by partial implicit macros inside .Bl -column table cells. * mdoc(7): Fix syntax tree corruption leading to NULL dereference for macro sequences like .Bl .Bl .It Bo .El .It. * mdoc(7): Fix syntax tree corruption leading to NULL dereference caused by .Ta following a nested .Bl -column breaking another block. * mdoc(7): Fix syntax tree corruption sometimes leading to NULL dereference caused by indirectly broken .Nd or .Nm blocks. * mdoc(7) -Thtml: Fix a NULL dereference for .Bl -column with 0 columns. * mdoc(7): Fix NULL dereference in some specific cases of a block-end macro calling another block-end macro. * mdoc(7): Fix NULL dereference if the only child of the head of the first .Sh was an empty in-line macro. * eqn(7): Fix NULL dereference in the terminal formatter for empty matrices and empty square roots. * mdoc(7): Fix an assertion failure for a .Bd without a type that breaks another block. * mdoc(7): Fix an assertion failure that happened for some .Bl -column lists containing a column width of "-4n", "-3n", or "-2n". * mdoc(7): Fix an assertion failure caused by .Bl -column without .It but containing eqn(7) or tbl(7) code. * roff(7): Fix an assertion failure caused by \z\[u00FF] with -Tps/-Tpdf. * roff(7): Fix an assertion failures caused by whitespace inside \o'' (overstrike) sequences. * -Thtml: Fix an assertion failure caused by -Oman or -Oincludes of excessive length. --- PORTABILITY IMPROVEMENTS --- * man(1): Do not mix stdio narrow and wide stream orientation on stdout, which could cause output corruption on glibc. * mandoc(1): Autodetect a suitable locale for -Tutf8 mode. * ./configure: Autodetect whether PATH_MAX and O_DIRECTORY are defined. * ./configure: Autodetect if nanosleep(3) needs -lrt. * ./configure: Provide an ${LN} configuration variable. * ./configure: Put compiler arguments that may contain -l at the end. --- MINOR BUGFIXES --- * mdoc(7): Fix SYNOPSIS output if the first child of .Nm is a macro. * mdoc(7) -Thtml: Improve formatting of .Bl -tag with short tags. * man(7) -Thtml: Preserve whitespace in .nf (nofill) mode. * mandoc(1): Error out on invalid output options on the command line. --- STRUCTURAL CHANGES, no functional change --- * Redesign part of the mandoc_html(3) interfaces, making them much easier to use and reducing the amount of code by a few hundred lines. --- THANKS TO --- * Michael Stapelberg (Debian) for designing the new mandocd(8) and parts of the new catman(8), for release testing, and for a number of patches and bug reports. * Baptiste Daroussin (FreeBSD) for profiling the new makewhatis(8) implementation and suggesting an algorithmic improvement which more than doubled performance, and for a few bug reports. * Ed Maste (FreeBSD) for an important patch improving reproducibility of builds in makewhatis(8), and for a few bug reports. * Theo Buehler (OpenBSD) for almost twenty important bug reports, most of them found by systematic afl(1) fuzzing. * Benny Lofgren, David Dahlberg, and in particular Vadim Zhukov for crucial help in getting .Bl -tag CSS formatting fixed. * Svyatoslav Mishyn (Crux Linux) for an initial version of the patch to autodetect a suitable locale for -Tutf8 mode and for release testing. * Jason McIntyre (OpenBSD) for multiple useful discussions and a number of bug reports. * Sevan Janiyan (NetBSD) for extensive release testing and multiple bug reports. * Thomas Klausner and Christos Zoulas (NetBSD), Yuri Pankov (illumos), and Leah Neukirchen (Void Linux) for release testing and bug reports. * Ulrich Spoerlein (FreeBSD) for release testing. * Alexander Bluhm, Andrew Fresh, Antoine Jacoutot, Antony Bentley, Christian Weisgerber, Jonathan Gray, Marc Espie, Martijn van Duren, Stuart Henderson, Ted Unangst, Theo de Raadt (OpenBSD), Abhinav Upadhyay, Kamil Rytarowski (NetBSD), Aaron M. Ucko, Bdale Garbee, Reiner Herrmann, Shane Kerr (Debian), Daniel Sabogal (Alpine Linux), Carsten Kunze (Heirloom roff), Kristaps Dzonsons (bsd.lv), Anton Lindqvist, Jan Stary, Jeremy A. Mates, Mark Patruck, Pavan Maddamsetti, Sean Levy <attila@stalphonsos.com>, and Tiago Silva for bug reports. * Brent Cook, Marc Espie, Philip Guenther, Todd Miller (OpenBSD) and Markus Waldeck for useful discussions. * And as usual, OpenCSW for providing me with a Solaris 9/10/11 testing environment. Changes in version 1.13.4, released on July 14, 2016 --- MAJOR NEW FEATURES --- * man.conf(5): Design and implement a simpler configuration file format. * man(1): Leverage less(1) -T and :t in a way resembling ctags(1) to jump to the definitions of various terms inside manual pages. * soelim(1): New implementation by Baptiste Daroussin. * privilege limitation: Use OpenBSD pledge(2) or OS X sandbox_init(3) when available. * man.cgi(8): Support short URIs like http://man.openbsd.org/mdoc . * mandoc.css: Use one unified stylesheet rather than three different ones. --- MAJOR FUNCTIONALLY RELEVANT BUGFIXES --- * mdoc(7): Fix multiple aspects of SYNOPSIS .Nm formatting. * man(1): Fix process group handling, avoiding unclean shutdowns. --- PORTABILITY IMPROVEMENTS --- * Correctly use the ohash(3) compatibility implementation even when building without SQLite support. * Add compat glue for building on Solaris 9 and 10. * Let ./configure select a supported RE syntax for word boundaries. * Support LDFLAGS, to be used for example for hardening options. * Avoid mixing putchar(3) and putwchar(3) on the same file descriptor, it resulted in output corruption on some platforms. * Avoid reusing va_lists, use va_copy(3) for better portability. * Do not hardcode the path to the more(1) program. --- MINOR NEW FEATURES --- * roff(7): Implement \n(.$ (number of macro arguments). * roff(7): Fully implement \z (do not advance cursor). * roff(7): Implement the `r' conditional (register exists). * roff(7): Implement \\$* (interpolate all arguments). * roff(7): Parse and ignore \, and \/ (italic corrections). * When there is no -m, no -M, no MANPATH and no /etc/man.conf, fall back to /usr/share/man:/usr/X11R6/man:/usr/local/man. * man(1): Give manuals in purely numerical sections priority over manuals of the same name in sections with an alphabetical suffix. * man.cgi(8): Support "header.html" and "footer.html". * man.cgi(8): Set the "autofocus" attribute on the query text box. * man.cgi(8): Simplify the search form, drop two useless buttons. * man.cgi(8): Delete the pseudo-manpath "mandoc", assume that apropos(1) and man.cgi(8) are installed in the default manpath. --- RELIABILITY BUGFIXES --- * mdoc(7): Avoid a use after free and an assertion failure when nodes are deleted during validation. * mdoc(7): Avoid a NULL pointer access when .Bd has no arguments. * mdoc(7): Avoid a NULL pointer access triggered by mismatching end macros. * mdoc(7): Avoid an assertion when .Fo has no argument. * mdoc(7): Avoid an assertion when .Ta<tab> occurs in .Bl -column. * mdoc(7): Avoid an assertion when a body gets broken and has a tail. * roff(7): Avoid an assertion caused by blanks inside \o. * roff(7): Make .so links to gziped manuals work without mandoc.db(5). * tbl(7): Avoid a use after free when the last line of a layout is empty. * eqn(7): Avoid an infinite loop caused by recursive "define". * makewhatis(8): Avoid a segfault caused by unusual directory structures. * Fix handling of leading, trailing, and double colons in MANPATH and -m. --- MINOR BUGFIXES --- * mdoc(7): Put arguments to end macros of broken partial explicit blocks inside the breaking block. * mdoc(7): Let .Dv force normal font. * mdoc(7): Make trailing whitespace significant in .Bl -tag widths. * mdoc(7): Fix macro interpretation around tabs in .Bl -column. * man(7): Use the default width for .RS without arguments. * man(7): On a new RS nesting level, the saved width starts from the default width, not from the saved width of the previous level. * man(7): Allow .PD in next-line scope. * man(7): Improve handling of empty .HP. * man(7): Improve formatting of .br and .sp inside .HP. * man(7): Do not mistreat empty arguments to font alternating macros as vertical spacing requests. * man(7): Allow fill mode changes in tagged paragraph next-line scope. * man(7): Fix minor bugs in block rewinding and simplify the related code. * man(7): Add missing line breaks before subsection headers. * man(7): Give section and subsection headers hanging indentation. * man(7): Make trailing whitespace significant in .TP widths. * roff(7): Don't allow breaking the output line after hyphens that immediately follow escape sequences. * roff(7): Ignore blank characters at the beginning of conditional blocks. * roff(7): Escape breakable hyphens only after handling input line traps. * roff(7): Reject \[uD800] to \[uDFFF] (surrogates) in the parser. * tbl(7): Allow more than one data field after T} on the same input line. * terminal output: Apply bold and italic to non-ASCII Unicode codepoints. * terminal output: Improve rounding rules for horizontal scaling widths. * HTML output: Render ASCII_NBRSP as " ", not "-". * man(1): Do not match the first part of a name if it continues with a dot. * man(1): Keep working even if the current directory is unusable. * man(1): Better error message when $PAGER is invalid. * makewhatis(8): Improve handling of .Va and .Vt macros. * apropos(1): Print "nothing appropriate" to stderr when appropriate. * apropos(1): Abort with a useful error message when elementary database operations like preparing queries or binding variables fail. --- STRUCTURAL CHANGES, no functional change --- * mdoc(7) and man(7): Unified data structures struct roff_node etc. * mdoc(7) and man(7): Unified node handling library in roff.c. * mdoc(7) and man(7): Seperate validation phase from parsing. * roff(7): Major character table cleanup. * Link with libz rather than forking gunzip(1). --- THANKS TO --- * Baptiste Daroussin (FreeBSD) for the new soelim(1) and for release testing. * Anthony Bentley (OpenBSD) for unifying mandoc.css, two nice patches for man.cgi(8), some documentation patches, some bug reports, and various useful discussions. * Todd Miller (OpenBSD) for lots of help with process group and signal handling, a few patches, some bug reports and some useful discussions. * Jonathan Gray (OpenBSD) for yet more testing with afl(1) again resulting in more than half a dozen important bug reports. * Svyatoslav Mishyn (Crux Linux) for some patches, several bug reports, and extensive release testing. * Leah Neukirchen (Void Linux) for a number of compatibility patches and suggestions and several bug reports. * Christos Zoulas (NetBSD) for a bug fix patch and some useful suggestions for cleanup. * Florian Obser (OpenBSD) for a bugfix patch and some bug reports. * Sevan Janiyan for help with Solaris compatibility and release testing on many platforms. * Jan Holzhueter and OpenCSW in general for help with Solaris compatibility, and for providing me with a Solaris 9/10/11 testing environment. * Michael McConville (OpenBSD) for some simple cleanup patches. * Thomas Klausner (NetBSD) for some bug reports and release testing. * Christian Weisgerber, Dmitrij Czarkoff, Igor Sobrado, Ken Westerback, Marc Espie, Mike Belopuhov, Rafael Neves, Ted Unangst, Tim van der Molen, Theo Buehler, Theo de Raadt (OpenBSD), Kurt Jaeger, Dag Erling Smoergrav (FreeBSD), Joerg Sonnenberger (NetBSD), Carsten Kunze (Heirloom troff), Daniel Levai, Fabian Raetz, Jan Stary, Jean-Yves Migeon, Lorenzo Beretta, Markus Waldeck, Maxim Belooussov, Michael Reed, Peter Bray, and Serguey Parkhomovsky for bug reports and feature suggestions. * Alexander Hall, Andrew Fresh, Antoine Jacoutot, Doug Hogan, Jason McIntyre, Jasper Lievisse Adriaanse, Kent Spillner, Nicholas Marriott, Peter Hessler, Sebastien Marie, Stefan Sperling, and Theo de Raadt (OpenBSD) for helpful discussions and feedback. Changes in version 1.13.3, released on March 13, 2015 --- MAJOR NEW FEATURES --- * When a manual is missing from an outdated database, let man(1) show it anyway, using a KISS file system lookup as a fallback. * Use this to always provide man(1), even without database support. * Fatal errors no longer exist. If a file can be opened, mandoc will produce some output; at worst, the output may be almost empty. * New -Wunsupp message level. --- POTENTIONALLY SECURITY RELEVANT BUGFIXES --- * Fix a potential write buffer overrun on incomplete string conditionals. http://mandoc.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.241 * Fix a potential write buffer overrun on backslash at EOF in a conditional. http://mandoc.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.247 * Fix a use after free sometimes hit when validation deletes a block. http://mandoc.bsd.lv/cgi-bin/cvsweb/mdoc_macro.c#rev1.180 --- MAJOR FUNCTIONALLY RELEVANT BUGFIXES --- * Let man(1) show manuals for the current architecture by default, and support the MACHINE environment variable. * Fix the man(1) and apropos(1) -m option, it didn't work at all. * Do not spawn a pager when there is no output. * In makewhatis(8), fix detection of hardlinked manuals on platforms having padding in struct inodev (typically 64bit platforms). --- PORTABILITY IMPROVEMENTS --- * Ignore O_CLOEXEC when the operating system doesn't provide it. * Avoid forward reference to enum type which violates ISO C99. * Support homebrew-style linking on Mac OS X. --- MINOR NEW FEATURES --- * lookup: Accept digit+letter and "n" as section names in man(1), and consistently handle digit+letter in file name extensions. * lookup: Speed up -s/-S by using the "mlinks" rather than the "keys" table. * output: Insert horizontal lines between formatted manual pages. * input: New stricter and more resilient UTF-8 parser. * mdoc(7): Refactor block rewinding for simpler and more robust parsing. * man(7): Use the -Ios option when .TH has less than four arguments. * tbl(7): Implement the "center" option. * tbl(7): New option and format parsers, improved in many respects. * roff(7): Basic implementation of the \o escape sequence (overstrike), and improved rendering of overstrikes in PostScript and PDF output. * Message improvements, in particular for, but not restricted to, eqn(7), tbl(7), and wrong numbers of arguments in mdoc(7) and man(7), in various cases also improving output generated by invalid input. * Delete the -V option. It serves no purpose but keeps confusing people. * gmdiff: Minimal support for Heirloom roff. --- RELIABILITY BUGFIXES --- * tbl(7): Fix a read buffer overrun on 'f' at EOL in a layout. * roff(7): Fix a read buffer overrun on incomplete numerical conditions. * mdoc(7): Fix a NULL pointer access on .Nd followed by an explicit block. * mdoc(7): Fix a NULL pointer access on .It Xo without .Xc. * mdoc(7): Fix a NULL pointer access on .Eo without a tail. * mdoc(7): Fix a NULL pointer access in the validation of empty .St macros. * man(7)/tbl(7): Fix a NULL pointer access on .TS right after .TP. * tbl(7): Fix a NULL pointer access on layout lines without any cells. * eqn(7): Fix NULL pointer accesses in the terminal formatter. * roff(7): Fix a NULL pointer access on trailing \s-/\s+ without an argument. * gz: Fix a potential NULL pointer access after waitpid() failure. * roff(7): Don't let the modulo operator divide by zero. * input: Fix an assertion failure on certain invalid UTF-8 input. * terminal output: Allow arbitrary depth of the font stack (assertion fix). * mdoc(7): Fix assertion failures and endless loops on invalid block closing. * mdoc(7): Fix an assertion failure on .Bl .Sm not followed by .It. * mdoc(7): Fix an assertion failure on .Bl -column ... .El .Ta. * tbl(7): Fix assertion failures by macros inside table data, but do not throw away the macro arguments. * Prevent certain kinds of unreasonable input from producing excessive output, in one case caused by unsigned integer underflow. * Fix a potential memory leak in makewhatis(8) on very long filenames. --- MINOR BUGFIXES --- * mdoc(7): Fix parsing of badly nested blocks with multiple identical blocks. * mdoc(7): Support negative indentations for displays and lists. * mdoc(7): Don't mistreat negative .sp arguments as large positive ones. * mdoc(7): Some spacing fixes for .Eo/.Ec. * man(7): Support negative horizontal widths. * man(7): Do not print out invalid .IP arguments. * man(7): Correctly handle scaling units after .PD. * man(7): Support .RE with an argument. * man(7): Fix restoring indentation after .RS with large negative arguments. * tbl(7): Prevent tables from breaking the filling of preceding text. * tbl(7): Fix vertical spacing at the beginning of tables. * tbl(7): Parser and formatter fixes for line drawing and font modifiers. * tbl(7): Correct handling of blank data lines. * eqn(7): Add sometimes missing whitespace before equation output. * roff(7): Fix vertical scaling, most of it was wrong. * roff(7): Slightly improve \w width measurements. * roff(7): Accept the historic aliases \s10 to \s39 for \s(10 to \s(39. * roff(7): Correctly escape quotes when expanding macro arguments. * roff(7): Correctly handle scaling units in numerical expressions, and some other improvements to the parsing of numerical expressions. * roff(7): Three minor fixes with respect to evaluation of conditionals. * roff(7): Let .it accept numerical expressions, not just constants. * mandoc_char(7): Correct some character names and renderings. * If earlier files set a non-zero exit status, never reset it to zero. --- THANKS TO --- * Jonathan Gray (OpenBSD) for yet more testing with afl (the American Fuzzy Lop security fuzzer), again resulting in many bug reports. * Theo de Raadt (OpenBSD) for suggesting the main new feature (man(1) file system lookup) and for reporting an important bug (pager without output). * Theo Buehler for an important bug report (-s/-S slowness) and for proposing a nice new feature (lines between pages). * Jason McIntyre for an important bug report (hardlink detection) and multiple documentation patches. * Pascal Stumpf (OpenBSD) and Alessandro de Laurenzis for important bug reports (architecture and man -m, respectively). * Thomas Klausner (NetBSD) for proposing a new feature (man(7) -Ios), a bug report, and release testing. * Anthony Bentley, Daniel Dickman, Ted Unangst (OpenBSD) and Kristaps Dzonsons (bsd.lv) for source code patches and bug reports. * Christian Weisgerber (OpenBSD) for more than half a dozen bug reports. * Carsten Kunze (Heirloom troff) for bug reports and release testing. * Antoine Jacoutot (OpenBSD) for release testing. * Alexis Hildebrandt (Homebrew), Baptiste Daroussin (FreeBSD), Jonathan Perkin (SmartOS), Pedro Giffuni (FreeBSD), Svyatoslav Mishyn (Crux Linux), Ulrich Spoerlein (FreeBSD), Jan Stary, Patrick Keshishian, Sebastien Marie, and Steffen Nurpmeso for bug reports. Changes in version 1.13.2, released on December 13, 2014 --- MAJOR NEW FEATURES --- * Include an implementation of man(1), the manual page viewer. * Unified set of command line option, each one supported by all command names, including new options -a (format all), -c (no pager), -h (synopsis only), and -w (list filenames). * Support the MANPAGER and PAGER environment variables. * Support gzip'ed manuals by the whole toolset, even as .so targets. * Support UTF-8 and Latin-1 input by the whole toolset, delete preconv(1). * Switch the default output mode from -Tascii to -Tlocale. * Improve -Tascii output for Unicode escape sequences. * Let the -Thtml output mode produce polyglot HTML5. * Many improvements for eqn(7), in particular in-line equations, MathML output in -Thtml mode, and much improved terminal formatting. --- PORTABILITY IMPROVEMENTS --- * Change the build sequence to the usual ./configure; make; make install. * Support ./configure.local for build customizations. * Autodetect wchar, sqlite3, and manpath support. * Provide a fallback version of fts(3) for systems lacking it. * Support choosing alternative binary and manual names. --- MINOR NEW FEATURES --- * Rudimentary implementation of the e, x, and z tbl(7) layout modifiers to equalize, maximize, and ignore the width of columns. * Implement font modifiers in tbl(7) layouts. * Allow comma-separated options in the tbl(7) options line. * Parse and ignore the .pl (page length) roff(7) request. * Implement .An -[no]split for the mdoc(7) -Thtml output mode. * Support bold italic font in PostScript and PDF output. * Warn about commas in function arguments and parentheses in function names. * Warn about botched .Xr ordering and punctuation below SEE ALSO. * Warn about AUTHORS sections without .An macros. * Warn about attempts to call non-callable macros. * New developer documentation manual page mandoc_headers(3). --- BUGFIXES --- * Fix read buffer overrun sometimes triggered by trailing whitespace. * Fix read buffer overrun triggered by certain invalid \H sequences. * Fix NULL pointer access triggered by .Bl without any arguments. * Fix NULL pointer access triggered by .It Nm Fo without .Fc. * Fix NULL pointer access triggered by .Sh Xo .Sh without .Xc. * Fix NULL pointer access triggered by missing .Nm. * Fix an assertion triggered by .It right after .El. * Fix an assertion triggered by .Ec without preceding .Eo. * Fix an assertion triggered by .Sm or .Db with multiple arguments. * Fix assertion failures triggered by very large width arguments. * Fix a division by zero in the roff(7) parser. * Prevent negative arguments to .ll from causing integer underflow. * Correctly autodetect source format even when .Dd is preceded by .ll. * Multiple fixes with respect to .Bd and .Bl -offset and -width. * Many bugfixes with respect to scaling units. * Multiple fixes with respect to delimiter handling by in-line macros. * Multiple fixes with respect to .Pf. * Make \c work properly in no-fill mode. * Stricter syntax checking of Unicode character names. --- THANKS TO --- * Kristaps Dzonsons for rewriting the eqn(7) parser, implementing HTML5 and MathML output, and various other code contributions. * Jonathan Gray (OpenBSD) for extensive testing with afl (the American Fuzzy Lop security fuzzer) resulting in many bug reports. * Anthony Bentley (OpenBSD), Baptiste Daroussin (FreeBSD), Daniel Dickman, Doug Hogan, Jason McIntyre, Theo de Raadt (OpenBSD), and Martin Natano for source code patches. * Carsten Kunze (Heirloom troff), Daniel Levai (Slackware), Garrett D'Amore (illumos), Giovanni Becchis, Matthew Dempsky, Stuart Henderson, Ted Unangst, Todd Miller (OpenBSD), Thomas Klausner (NetBSD), Ulrich Spoerlein (FreeBSD), Justin Haynes, Marcus Merighi, Sebastien Marie, Steffen Nurpmeso and Theo Buehler for bug reports. Changes in version 1.13.1, released on August 10, 2014 --- MAJOR NEW FEATURES --- * A complete apropos(1)/makewhatis(8)/man.cgi(8) suite based on SQLite3 is now included. * The roff(7) parser now provides an almost complete implementation of numerical expressions. * Warning and error messages have been improved in many ways. Almost all fatal errors were downgraded to normal errors and some even to warnings. Almost all messages now mention the macro where the issue is detected and many indicate the workaround employed. The mandoc(1) manual now includes a list explaining all messages. --- MINOR NEW FEATURES --- * The roff(7) parser now supports the .ami (append to macro with indirectly specified name), .as (append to user-defined string), .dei (define macro with indirectly specified name), .ll (line length), and .rr (remove register) requests. * The roff(7) parser now supports string comparison and numerical conditionals in the .if and .ie requests. * The roff parser now fully supports the \B (validate numerical expression) and partially supports the \w (measure text width) escape sequences. * The terminal formatter now supports the \: (optional line break) escape sequence. * The roff parser now supports expansion of user-defined strings involving indirect references. * The roff(7) parser now handles some pre-defined read-only number registers that occur in the pod2man(1) preamble. * For backward compatibility, the mdoc(7) parser and formatters now support the obsolete macros .En, .Es, .Fr, and .Ot. * The mdoc(7) formatter non partially supports .Bd -centered. * tbl(7) now handles leading and trailing vertical lines. * The build system now provides fallback versions of strcasestr(3) and strsep(3) for systems lacking them. * The mdoc(7) manual now explains how various standards supported by the .St macro are related to each other. --- BUGFIXES --- * In the roff(7) parser, several bugs were fixed with respect to closing conditional blocks on macro lines. * Parsing of roff(7) identifiers and escape sequences was improved in multiple respects. * In the mdoc(7) parser, the handling of defective document prologues was improved in multiple ways. * The mdoc(7) parser no longer skips content before the first section header, and it no longer deletes non-.% content from .Rs blocks. * In the mdoc(7) parser, a crash was fixed related to weird .Sh headers. * In the mdoc(7) parser, handling of .Sm with missing or invalid arguments was corrected. * In the mdoc(7) parser, trailing punctuation at the end of partial implicit macros no longer triggers end-of-sentence spacing. * In the terminal formatter, two crashes were fixed: one triggered by excessive indentation and another by excessively long .Nm arguments. * In the terminal formatter, a floating point rounding bug was fixed that sometimes caused an off-by-one error in indentation. * In the UTF-8 formatter, rendering of accents, breakable hyphens, and non-breakable spaces was corrected. * In the HTML formatter, encoding of special characters was corrected in multiple respects. * In the mdoc(7) formatter, rendering of .Ex and .Rv was improved for various edge cases. * In the mdoc(7) formatter, handling of empty .Bl -inset item heads was improved. * In the man(7) formatter, some bugs were fixed with respect to same-line detection in the context of .TP and .nf macros, and the indentation of .IP and .TP blocks was improved. * The mandoc(3) library no longer prints to stderr. --- THANKS TO --- Abhinav Upadhyay (NetBSD), Andreas Voegele, Anthony Bentley (OpenBSD), Christian Weisgerber (OpenBSD), Havard Eidnes (NetBSD), Jan Stary, Jason McIntyre (OpenBSD), Jeremie Courreges-Anglas (OpenBSD), Joerg Sonnenberger (NetBSD), Juan Francisco Cantero Hurtado (OpenBSD), Marc Espie (OpenBSD), Matthias Scheler (NetBSD), Pascal Stumpf (OpenBSD), Paul Onyschuk (Alpine Linux), Sebastien Marie, Steffen Nurpmeso, Stuart Henderson (OpenBSD), Ted Unangst (OpenBSD), Theo de Raadt (OpenBSD), Thomas Klausner (NetBSD), and Ulrich Spoerlein (FreeBSD) for reporting bugs and missing features. Changes in version 1.12.3, released on December 31, 2013 * In the mdoc(7) SYNOPSIS, line breaks and hanging indentation now work correctly for .Fo/.Fa/.Fc and .Fn blocks. Thanks to Franco Fichtner for doing part of the work. * The mdoc(7) .Bk macro got some addititonal bugfixes. * In mdoc(7) macro arguments, double quotes can now be quoted by doubling them, just like in man(7). Thanks to Tsugutomo ENAMI for the patch. * At the end of man(7) macro lines, end-of-sentence spacing now works. Thanks to Franco Fichtner for the patch. * For backward compatibility, the man(7) parser now supports the man-ext .UR/.UE (uniform resource identifier) block macros. * The man(7) parser now handles closing blocks that are not open more gracefully. * The man(7) parser now ignores blank lines right after .SH and .SS. * In the man(7) formatter, reset indentation when leaving a block, not just when entering the next one. * The roff(7) .nr request now supports incrementing and decrementing number registers and stops parsing the number right before the first non-digit character. * The roff(7) parser now supports the alternative escape sequence syntax \C'uXXXX' for Unicode characters. * The roff(7) parser now parses and ignores the .fam (font family) and .hw (hyphenation points) requests and the \d and \u escape sequences. * The roff(7) manual got a new ESCAPE SEQUENCE REFERENCE. Changes in version 1.12.2, released on Oktober 5, 2013 * The mdoc(7) to man(7) converter, to be called as mandoc -Tman, is now fully functional. * The mandoc(1) utility now supports the -Ios (default operating system) input option, and the -Tutf8 output mode now actually works. * The mandocdb(8) utility no longer truncates existing databases when starting to build new ones, but only replaces them when the build actually succeeds. * The man(7) parser now supports the PD macro (paragraph distance), and (for GNU man-ext compatibility only) EX (example block) and EE (example end). Plus several bugfixes regarding indentation, line breaks, and vertical spacing, and regarding RS following TP. * The roff(7) parser now supports the \f(BI (bold+italic) font escape, the \z (zero cursor advance) escape and the cc (change control character) and it (input line trap) requests. Plus bugfixes regarding the \t (tab) escape, nested escape sequences, and conditional requests. * In mdoc(7), several bugs were fixed related to UTF-8 output of quoting enclosures, delimiter handling, list indentation and horizontal and vertical spacing, formatting of the Lk, %U, and %C macros, plus some bugfixes related to the handling of syntax errors like badly nested font blocks, stray Ta macros outside column lists, unterminated It Xo blocks, and non-text children of Nm blocks. * In tbl(7), the width of horizontal spans and the vertical spacing around tables was corrected, and in man(7) files, a crash was fixed that was triggered by some particular unclosed T{ macros. * For mandoc developers, we now provide a tbl(3) library manual and gmdiff, a very small, very simplistic groff-versus-mandoc output comparison tool. * Provide this NEWS file. Changes in version 1.12.1, released on March 23, 2012 * Significant work on apropos(1) and mandocdb(8). These tools are now much more robust. A whatis(1) implementation is now handled as an apropos(1) mode. These tools are also able to minimally handle pre-formatted pages, that is, those already formatted by another utility such as GNU troff. * The man.cgi(7) script is also now available for wider testing. It interfaces with mandocdb(8) manuals cached by catman(8). HTML output is generated on-the-fly by libmandoc or internal methods to convert pre-formatted pages. * The mailing list archive for the discuss and tech lists are being hosted by Gmane at gmane.comp.tools.mdocml.user and gmane.comp.tools.mdocml.devel, respectively. Changes in version 1.12.0, released on October 8, 2011 * This version features a new, work-in-progress mandoc(1) output mode: -Tman. This mode allows a system maintainer to distribute man(7) media for older systems that may not natively support mdoc(7), such as old Solaris systems. * The -Ofragment option was added to mandoc(1)'s -Thtml and -Txhtml modes. * While adding features, an apropos(1) utility has been merged from the mandoc-tools sandbox. This interfaces with mandocdb(8) for semantic search of manual content. apropos(1) is different from the traditional apropos primarily in allowing keyword search (such as for functions, utilities, etc.) and regular expressions. Note that the calling syntax for apropos is likely to change as it settles down. * In documentation news, the mdoc(7) and man(7) manuals have been made considerably more readable by adding MACRO OVERVIEW sections, by moving the gory details of the LANGUAGE SYNTAX to the roff(7) manual, and by moving the very technical MACRO SYNTAX sections down to the bottom of the page. * Furthermore, for tbl(7), the -Tascii mode horizontal spacing of tables was rewritten completely. It is now compatible with groff(1), both with and without frames and rulers. * Nesting of indented blocks is now supported in man(7), and several bugs were fixed regarding indentation and alignment. * The page headers in mdoc(7) are now nicer for very long titles. Changes in version 1.11.7, released on September 2, 2011 * Added demandoc(1) utility for stripping away macros and escapes. This replaces the historical deroff(1) utility. * Also improved the mdoc(7) and man(7) manuals. Changes in version 1.11.6, released on August 16, 2011 * Handling of tr macro in roff(7) implemented. This makes Perl documentation much more readable. Hyphenation is also now enabled in man(7) format documents. Many other general improvements have been implemented. Changes in version 1.11.5, released on July 24, 2011 * Significant eqn(7) improvements. mdocml can now parse arbitrary eqn input (although few GNU extensions are accepted, nor is mixing low-level roff with eqn). See the eqn(7) manual for details. For the time being, equations are rendered as simple in-line text. The equation parser satisfies the language specified in the Second Edition User's Guide: http://www.kohala.com/start/troff/v7man/eqn/eqn2e.ps Changes in version 1.11.4, released on July 12, 2011 * Bug-fixes and clean-ups across all systems, especially in mandocdb(8) and the man(7) parser. This release was significantly assisted by participants in OpenBSD's c2k11. Thanks! Changes in version 1.11.3, released on May 26, 2011 * Introduce locale-encoding of output with the -Tlocale output option and Unicode escaped-character input. See mandoc(1) and mandoc_char(7), respectively, for details. This allows for non-ASCII characters (e.g., \[u5000]) to be rendered in the locale's encoding, if said environment supports wide-character encoding (if it does not, -Tascii is used instead). Locale support can be turned off at compile time by removing -DUSE_WCHAR in the Makefile, in which case -Tlocale is always a synonym for -Tascii. * Furthermore, multibyte-encoded documents, such as those in UTF-8, may be on-the-fly recoded into mandoc(1) input by using the newly-added preconv(1) utility. Note: in the future, this feature may be integrated into mandoc(1). Changes in version 1.11.2, released on May 12, 2011 * Corrected some installation issues in version 1.11.1. * Further migration to libmandoc. * Initial public release (this utility is very much under development) of mandocdb(8). This utility produces keyword databases of manual content, which features semantic querying of manual content. Changes in version 1.11.1, released on April 4, 2011 * The earlier libroff, libmdoc, and libman soup have been merged into a single library, libmandoc, which manages all aspects of parsing real manuals, from line-handling to tbl(7) parsing. * As usual, many general fixes and improvements have also occurred. In particular, a great deal of redundancy and superfluous code has been removed with the merging of the backend libraries. * see also the changes in 1.10.10 Changes in version 1.10.10, March 20, 2011, NOT released * Initial eqn(7) functionality is in place. For the time being, this is limited to the recognition of equation blocks; future version of mdocml will expand upon this framework. Changes in version 1.10.9, released on January 7, 2011 * Many back-end fixes have been implemented: argument handling (quoting), man(7) improvements, error/warning classes, and many more. * Initial tbl(7) functionality (see the "TS", "TE", and "T&" macros in the roff(7) manual) has been merged from tbl.bsd.lv. Output is still minimal, especially for -Thtml and -Txhtml, but manages to at least display data. This means that mandoc(1) now has built-in support for two troff preprocessors via libroff: soelim(1) and tbl(1). Changes in version 1.10.8, released on December 24, 2010 * Overhauled the -Thtml and -Txhtml output modes. They now display readable output in arbitrary browsers, including text-based ones like lynx(1). See HTML and XHTML manuals in the DOCUMENTATION section for examples. Attention: available style-sheet classes have been considerably changed! See the example.style.css file for details. Lastly, libmdoc and libman have been cleaned up and reduced in size and complexity. * see also the changes in 1.10.7 Changes in version 1.10.7, December 6, 2010, NOT released Significant improvements merged from OpenBSD downstream, including: * many new roff(7) components, * in-line implementation of troff's soelim(1), * broken-block handling, * overhauled error classifications, and * cleaned up handling of error conditions. Changes in version 1.10.6, released on September 27, 2010 * Calling conventions for mandoc(1) have changed: -W improved and -f deprecated. * Non-ASCII characters are also now uniformly discarded. * Lots of documentation improvements. * Many incremental fixes accomodating for groff's more interesting productions. * Lastly, pod2man(1) preambles are now fully accepted after some considerable roff(7) and special character support. Changes in version 1.10.5, released on July 27, 2010 * Primarily a bug-fix and polish release, but including -Tpdf support in mandoc(1) by way of "Summer of Code". Highlights: * fix "Sm" and "Bd" handling * fix end-of-sentence handling for embedded sentences * polish man(7) documentation * document all mdoc(7) macros * polish mandoc(1) -Tps output * lots of internal clean-ups in character escapes * un-break literal contexts in man(7) documents * improve -Thtml output for -man * add mandoc(1) -Tpdf support Changes in version 1.10.4, released on July 12, 2010 * Lots of features developed during both "Summer of Code" and the OpenBSD c2k10 hackathon: * minimal "ds" roff(7) symbols are supported * beautified SYNOPSIS section output * acceptance of scope-block breakage in mdoc(7) * clarify error message status * many minor bug-fixes and formatting issues resolved * see also changes in 1.10.3 Changes in version 1.10.3, June 29, 2010, NOT released * variable font-width and paper-size support in mandoc(1) -Tps output * "Bk" mdoc(7) support Changes in version 1.10.2, released on June 19, 2010 * Small release featuring text-decoration in -Tps output, a few minor relaxations of errors, and some optimisations. Changes in version 1.10.1, released on June 7, 2010 * This primarily focusses on the "Bl" and "It" macros described in mdoc(7). Multi-line column support is now fully compatible with groff, as are implicit list entries for columns. * Removed manuals(7) in favour of http://manpages.bsd.lv. * The way we handle the SYNOPSIS section (see the SYNOPSIS documentation in MANUAL STRUCTURE) has also been considerably simplified compared to groff's method. * Furthermore, the -Owidth=width output option has been added to -Tascii, see mandoc(1). * Lastly, initial PostScript output has been added with the -Tps option to mandoc(1). It's brutally simple at the moment: fixed-font, with no font decorations. Changes in version 1.10.0, released on May 29, 2010 * Release consisting of the results from the m2k10 hackathon and up-merge from OpenBSD. This requires a significant note of thanks to Ingo Schwarze (OpenBSD) and Joerg Sonnenberger (NetBSD) for their hard work, and again to Joerg for hosting m2k10. Highlights (mostly cribbed from Ingo's m2k10 report) follow in no particular order: * a libroff preprocessor in front of libmdoc and libman stripping out roff(7) instructions; * end-of-sentence (EOS) detection in free-form and macro lines; * correct handling of tab-separated columnar lists in mdoc(7); * improved main calling routines to optionally use mmap(3) for better performance; * cleaned up exiting when invoked as -Tlint or over multiple files with -fign-errors; * error and warning message handling re-written to be unified for libroff, libmdoc, and libman; * handling of badly-nested explicit-scoped macros; * improved free-form text parsing in libman and libmdoc; * significant GNU troff compatibility improvements in -Tascii, largely in terms of spacing; * a regression framework for making sure the many fragilities of GNU troff aren't trampled in subsequent work; * support for -Tascii breaking at hyphens encountered in free-form text; * and many more minor fixes and improvements Changes in version 1.9.25, released on May 13, 2010 * Fixed handling of "\*(Ba" escape. * Backed out -fno-ign-chars (pointless complexity). * Fixed erroneous breaking of literal lines. * Fixed SYNOPSIS breaking lines before non-initial macros. * Changed default section ordering. * Most importantly, the framework for end-of-sentence double-spacing is in place, now implemented for the "end-of-sentence, end-of-line" rule. * This is a stable roll-back point before the mandoc hackathon in Rostock! Changes in version 1.9.24, released on May 9, 2010 * Rolled back break-at-hyphen. * -DUGLY is now the default (no feature splits!). * Free-form text is not de-chunked any more: lines are passed whole-sale into the front-end, including whitespace. * Added mailing lists. Changes in version 1.9.23, released on April 7, 2010 * mdocml has been linked to the OpenBSD build. * This version incorporates many small changes, mostly from patches by OpenBSD, allowing crufty manuals to slip by with warnings instead of erroring-out. * Some subtle semantic issues, such as punctuation scope, have also been fixed. * Lastly, some issues with -Thtml have been fixed, which prompted an update to the online manual pages style layout. Changes in version 1.9.22, released on March 31, 2010 * Adjusted merge of the significant work by Ingo Schwarze in getting "Xo" blocks (block full implicit, e.g., "It" for non-columnar lists) to work properly. This isn't enabled by default: you must specify -DUGLY as a compiler flag (see the Makefile for details). Changes in version 1.9.20, released on March 30, 2010 * More efforts to get roff instructions in man(7) documents under control. Note that roff instructions embedded in line-scoped, next-line macros (e.g. "B") are not supported. * Leading punctuation for mdoc(7) macros, such as "Fl ( ( a", are now correctly handled. Changes in version 1.9.18, released on March 27, 2010 * Many fixes (largely pertaining to scope) and improvements (e.g., handling of apostrophe-control macros, which fixes the strange "BR" seen in some macro output) to handling roff instructions in man(7) documents. Changes in version 1.9.17, released on March 25, 2010 * Accept perlpod(1) standard preamble. * Also accept (and discard) "de", "dei", "am", "ami", and "ig" roff macro blocks. Changes in version 1.9.16, released on March 22, 2010 * Inspired by patches and bug reports by Ingo Schwarze, allowed man(7) to accept non-printing elements to be nested within next-line scopes, such as "br" within "B" or "TH", which is valid roff. * Longsoon architecture also noted and Makefile cleaned up. Changes in version 1.9.15, released on February 18, 2010 * Moved to our new BSD.lv home. * XHTML is now an acceptable output mode for mandoc(1); * "Xr" made more compatible with groff; * "Vt" fixed when invoked in SYNOPSIS; * "\\" escape removed; * end-of-line white-space detected for all lines; * subtle bug fixed in list display for some modes; * compatibility layer checked in for compilation in diverse UNIX systems; * and column lengths handled correctly. For older releases, see the ChangeLog files in http://mandoc.bsd.lv/snapshots/ . �mandoc-1.14.6/TODO����������������������������������������������������������������������������������0100644�0001753�0001753�00000074006�14123140553�0014046�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������************************************************************************ * Official mandoc TODO. * $Id: TODO,v 1.319 2021/09/21 17:58:13 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: - loc = locality of the issue * single file issue, affects file only, or very few ** single module issue, affects several files of one module *** cross-module issue, significantly impacts multiple modules and may require substantial changes to internal interfaces - exist = difficulty of the existing code in this area * affected code is straightforward and easy to read and change ** affected code is somewhat complex, but once you understand the design, not particularly difficult to understand *** affected code uses a special, exceptionally tricky design - algo = difficulty of the new algorithm to be written * the required logic and code is straightforward ** the required logic is somewhat complex and needs a careful design *** the required logic is exceptionally tricky, maybe an approach to solve that is not even known yet - size = the amount of code to be written or changed * a small number of lines (at most 100, usually much less) ** a considerable amount of code (several dozen to a few hundred) *** a large amount of code (many hundreds, maybe thousands) - imp = importance of the issue * mostly for completeness ** would be nice to have *** issue causes considerable inconvenience Obviously, as the issues have not been solved yet, these annotations are mere guesses, and some may be wrong. ************************************************************************ * assertion failures ************************************************************************ - .if n .ce in the middle of .TS data afl case f1/id:000103,sig:06,src:009024+009105,op:splice,rep:2 (jes@) While roff_parseln() prevents .ce and similar requests in the middle of a tbl, the guard is no longer effective when the .ce is wrapped in a roff block, for example a conditional. The resulting assertion has never been seen in any real-world manual page. This is too dangerous to fix before release because it requires reorganizing the very delicate internals of roff_parseln(), which risks causing more severe bugs. loc * exist *** algo *** size * imp * ************************************************************************ * bugs: invalid output ************************************************************************ - wrong number of layout columns in tbl(7) code generated by -T man https://savannah.gnu.org/bugs/?57720 The reason likely is that tbl(7) does not support the -Bl -column feature of not explicitly specifying the last table column. loc ** exist * algo ** size * imp *** - eqn(7) delimiters cause conditional lines to misbehave nabijaczleweli 8 Sep 2021 15:24:48 +0200 loc * exist *** algo *** size * imp * - roff.c, roff_expand() should not remove blanks before comments to Oliver Corff, Sep 7, 2021 loc * exist * algo * size * imp * but watch out for regressions in the high-level parsers maybe it should not even remove comments? - consider T{\" ************************************************************************ * missing features ************************************************************************ --- missing roff features ---------------------------------------------- - .ad (adjust margins) .ad l -- adjust left margin only (flush left) .ad r -- adjust right margin only (flush right) .ad c -- center text on line .ad b -- adjust both margins (alias: .ad n) .na -- temporarily disable adjustment without changing the mode .ad -- re-enable adjustment without changing the mode Adjustment mode is ignored while in no-fill mode (.nf). loc *** exist *** algo ** size ** imp ** (parser reorg would help) - .fc (field control) found by naddy@ in xloadimage(1) loc ** exist *** algo * size * imp * - .ns (no-space mode) occurs in xine-config(1) when implementing this, also let .TH set it reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 loc *** exist *** algo *** size ** imp * - \w'' improve width measurements would not be very useful without an expression parser, see below needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 loc ** exist *** algo *** size * imp *** - .als only works for macros in mandoc, not for user-defined strings. Also, the "val" field in struct roffkv would have to be replaced with a pointer to a reference-counted wrapper, and an alias would have to point to the same wrapper as the original. .als to undefined does nothing; the alias is not created. .rm'ing the original leaves the alias to point to the old value. .de .als .de changes both, but .de .als .rm .de only changes the new value, not the alias. Found in groffer(1) version 1.19 Jan Stary 20 Apr 2019 20:16:54 +0200 loc * exist ** algo ** size ** imp * - roff string condition comparisons fail when vars contain quotes: .ds s ' .if '\*s'' \&... hard to fix because of the basic architecture (string replacement happens before roff(7) syntax parsing) Found in groffer(1) version 1.19 Jan Stary 20 Apr 2019 20:16:54 +0200 loc * exist *** algo *** size ** imp * - mandoc replaces all ASCII control characters except tab and line feed with '?' during input. It would be better to replace them with Unicode escapes in preconv_encode() or somewhere in the vicinity, such that the already existing better replacement strings show up in the output. Emulating groff is not desirable: groff replaces 0x00, 0x0b, and 0x0d to 0x1f with the empty string (bad because that's easy to overlook for the document author), 0x01 with '.' (very confusing), and passes through 0x02 to 0x08, 0x0c, and 0x7f raw (bad because that is insecure output). Remember that 0x07 may need special handling because it is sometimes used for certain delimiters, so it may need handling *after* roff.c rather than before. reminded by John Gardner 16 Jun 2020 14:26:28 +1000 Actually, more ASCII control characters than just 0x07 may need later handling because they can for example be used in macro names. So they may need handling after roff(7) processing. pointed out by John Gardner 23 Jun 2020 18:28:08 +1000 more info from John Gardner 29 Jun 2020 19:54:04 +1000 loc ** exist ** algo ** size ** imp * - many missing features used in old groff_char(7), some can possibly be supported kamil at netbsd 12 Nov 2020 17:27:09 +0100 + reply - \s with arbitrary arg delimiters as already supported for other escapes found following jmc@'s mail 28 Apr 2021 18:31:41 +0100 loc * exist * algo * size * imp * --- missing mdoc features ---------------------------------------------- - .Sh and .Ss should be parsed and partially callable, see groff_mdoc(7) reed at reedmedia dot net Sat, 21 Dec 2019 17:13:07 -0600 loc ** exist ** algo ** size ** imp * - .Bl -column .Xo support is missing ultimate goal: restore .Xr and .Dv to lib/libc/compat-43/sigvec.3 lib/libc/gen/signal.3 lib/libc/sys/sigaction.2 loc * exist *** algo *** size * imp ** - edge case: decide how to deal with blk_full bad nesting, e.g. .Sh .Nm .Bk .Nm .Ek .Sh found by jmc@ in ssh-keygen(1) from jmc@ Wed, 14 Jul 2010 18:10:32 +0100 loc * exist *** algo *** size ** imp ** - .Bd -filled should not be the same as .Bd -ragged, but align both the left and right margin. In groff, it is implemented in terms of .ad b, which we don't have either. Found in cksum(1). loc *** exist *** algo ** size ** imp ** (parser reorg would help) - implement blank `Bl -column', such as .Bl -column .It foo Ta bar .El loc * exist *** algo *** size * imp * - explicitly disallow nested `Bl -column', which would clobber internal flags defined for struct mdoc_macro loc * exist * algo * size * imp ** - In .Bl -column .It, the end of the line probably has to be regarded as an implicit .Ta, if there could be one, see the following mildly ugly code from login.conf(5): .Bl -column minpasswordlen program xetcxmotd .It path Ta path Ta value of Dv _PATH_DEFPATH .br Default search path. reported by Michal Mazurek <akfaew at jasminek dot net> via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 loc * exist *** algo ** size * imp ** - inside `.Bl -column' phrases, punctuation is handled like normal text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." - inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." but should give "ab ." - prohibit `Nm' from having non-text HEAD children (e.g., NetBSD mDNSShared/dns-sd.1) (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) - support translated section names e.g. x11/scrotwm scrotwm_es.1:21:2: error: NAME section must be first that one uses NOMBRE because it is spanish... deraadt tends to think that section-dependent macro behaviour is a bad idea in the first place, so this may be irrelevant loc ** exist ** algo ** size * imp ** - When there is free text in the SYNOPSIS and that free text contains the .Nm macro, groff somehow understands to treat the .Nm as an in-line macro, while mandoc treats it as a block macro and breaks the line. No idea how the logic for distinguishing in-line and block instances should be, needs investigation. uqs@ Thu, 2 Jun 2011 11:03:51 +0200 uqs@ Thu, 2 Jun 2011 11:33:35 +0200 loc * exist ** algo *** size * imp ** --- missing man features ----------------------------------------------- - MANWIDTH Markus Waldeck <waldeck at gmx dot de> 9 Jun 2015 05:49:56 +0200 Laura Morales <lauretas at mail dot com> 26 Apr 2018 08:15:55 +0200 Kamil Rytarowski <kamil at netbsd> 13 Nov 2020 00:19:36 +0100 patch from Kamil 13 Nov 2020 22:37:07 +0100 loc * exist * algo * size * imp * - groff_www(7) .MTO and .URL These macros were used by the GNU grep(1) man page. The groff_www(7) manual page itself uses them, too. We should probably *not* add them to mandoc. Just mentioning this here to keep track of the abuse. Laura Morales <lauretas at mail dot com> 20 Apr 2018 07:33:02 +0200 loc ** exist * algo * size ** imp * --- missing tbl features ----------------------------------------------- - vertical centering in cells vertically spanned with ^ pali dot rohar at gmail dot com 16 Jul 2018 13:03:35 +0200 loc * exist *** algo *** size ** imp * - support mdoc(7) and man(7) macros inside tbl(7) code; probably requires the parser reorg and letting tbl(7) use roff_node such that macro sets can mix; informed by bapt@ that FreeBSD needs this: 3 Jan 2015 23:32:23 +0100 loc *** exist ** algo *** size ** imp *** - look at the POSIX manuals in the books/man-pages-posix port, they use some unsupported tbl(7) features, mostly macros in tbl(7). loc * exist ** algo ** size ** imp *** - look what Joerg Schilling manual pages use Thu, 19 Mar 2015 18:31:48 +0100 --- missing eqn features ----------------------------------------------- - In a matrix, break the output line after each matrix line. Found in the discussion at CDBUG 2015. Suggested by Avi Weinstock. This may not be the ideal solution after all: eqn(7) matrices are lists of columns, so Avi's proposal would show each *column* on its own *line*, which is likely to cause confusion. A better solution, but much harder to implement, would be to actually show the coordinates of column vectors on different terminal output lines, using the clumnated output facilities developed for .Bl -tag, .Bl -column, and also used for tbl(7). loc * exist * algo ** size ** imp ** - The "size" keyword is parsed, but ignored by the formatter. loc * exist * algo * size * imp * - The spacing characters `~', `^', and tab are currently ignored, see User's Guide (Second Edition) page 2 section 4. loc * exist * algo ** size * imp ** - Mark and lineup are parsed and ignored, see User's Guide (Second Edition) page 5 section 15. loc ** exist ** algo ** size ** imp ** - GNU eqn converts some operators to special characters, for example, input HYPHEN-MINUS becomes output \(mi, unless it is part of a quoted word. mandoc(1) only does this when the operator is surrounded by blanks, not when it is part of an unquoted word. Also, check whether there are more such cases (e.g., +?). reported by bentley@ 20 Jun 2017 02:04:29 -0600 loc * exist ** algo ** size * imp * - Primes, opprime, and ' bentley@ Thu, 13 Jul 2017 23:14:20 -0600 --- missing misc features ---------------------------------------------- - conisder whether man(1) fallback code in main.c/fs_*() can find files like man3c/fopen.3c (illumos, Solaris) and man3p/fopen.3p (POSIX) discussed with Robert Mustacchi 21 Sep 2021 10:39:40 -0700 loc * exist * algo ** size * imp ** - let makewhatis(8) follow symbolic links to dirs below READ_ALLOWED_PATH this may be feasible using fts_set(FTS_FOLLOW) mail to sternenseemann 19 Aug 2021 19:11:50 +0200 loc * exist ** algo ** size * imp ** - -T man does not handle eqn(7) and tbl(7) Stephen Gregoratto 16 Feb 2020 01:28:07 +1100 also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901636 loc ** exist ** algo ** size *** imp ** - man -ks 1,8 route; kn@ Jul 13, 2018 orally - italic correction (\/) in PostScript mode Werner LEMBERG on groff at gnu dot org Sun, 10 Nov 2013 12:47:46 loc ** exist ** algo * size * imp * - change the default PAGER to more -Es and use the pager even for apropos title line output; req by bapt@ loc * exist * algo * size * imp *** - clean up escape sequence handling, creating three classes: (1) fully implemented, or parsed and ignored without loss of content (2) unimplemented, potentially causing loss of content or serious mangling of formatting (e.g. \n) -> ERROR see textproc/mgdiff(1) for nice examples (3) undefined, just output the character -> perhaps WARNING loc *** exist ** algo ** size ** imp *** (parser reorg helps) - kettenis wants base roff, ms, and me Fri, 1 Jan 2010 22:13:15 +0100 (CET) loc ** exist ** algo ** size *** imp * --- compatibility checks ----------------------------------------------- - is .Bk implemented correctly in modern groff? sobrado@ Tue, 19 Apr 2011 22:12:55 +0200 - compare output to Heirloom roff, Solaris roff, and http://repo.or.cz/w/neatroff.git http://litcave.rudi.ir/ - look at AT&T DWB http://www2.research.att.com/sw/download Carsten Kunze <carsten dot kunze at arcor dot de> has patches Mon, 4 Aug 2014 17:01:28 +0200 ported version: https://github.com/n-t-roff/DWB3.3 Carsten Kunze Wed, 22 Apr 2015 11:21:43 +0200 - look at pages generated from reStructeredText, e.g. devel/mercurial hg(1) These are a weird mixture of man(7) and custom autogenerated low-level roff stuff. Figure out to what extent we can cope. For details, see http://docutils.sourceforge.net/rst.html noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200 reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100 - look at pages generated from ronn(1) github.com/rtomayko/ronn (based on markdown) - look at pages generated from Texinfo source by yat2m, e.g. security/gnupg First impression is not that bad. - look at pages generated by pandoc; see https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Writers/Man.hs porting planned by kili@ Thu, 19 Jun 2014 19:46:28 +0200 - check compatibility with Plan9: http://swtch.com/usr/local/plan9/tmac/tmac.an http://swtch.com/plan9port/man/man7/man.html "Anthony J. Bentley" <anthonyjbentley@gmail.com> 28 Dec 2010 21:58:40 -0700 - check compatibility with COHERENT troff: http://www.nesssoftware.com/home/mwc/source.php - check compatibility with the man(7) formatter https://raw.githubusercontent.com/rofl0r/hardcore-utils/master/man.c - check compatibility with http://ikiwiki.info/plugins/contrib/mandoc/ https://github.com/schmonz/ikiwiki/compare/mandoc Amitai Schlair Mon, 19 May 2014 14:05:53 -0400 - check compatibility with https://git.sr.ht/~sircmpwn/scdoc - check features of the Slackware man.conf(5) format Carsten Kunze Wed, 11 Mar 2015 17:57:24 +0100 - look at http://www.snake.net/software/troffcvt/ (troff to HTML) mentioned by Oliver Corff 22 Jan 2021 01:36:49 +0100 ************************************************************************ * formatting issues: ugly output ************************************************************************ - revisit empty in-line macros look at the difference between "Em x Em ." and "Sq x Em ." Carsten Kunze Fri, 12 Dec 2014 00:15:41 +0100 loc *** exist *** algo *** size * imp ** - a column list with blank `Ta' cells triggers a spurious start-with-whitespace printing of a newline - In .Bl -column, .It a<tab>"b<tab>c" shows the quotes in groff, but not in mandoc loc * exist *** algo ** size * imp ** - In .Bl -column, .It Em Authentication<tab>Key Length ought to render "Key Length" with emphasis, too, see OpenBSD iked.conf(5). reported again Nicolas Joly via wiz@ Wed, 12 Oct 2011 00:20:00 +0200 loc * exist *** algo *** size ** imp *** - empty phrases in .Bl column produce too few blanks try e.g. .Bl -column It Ta Ta reported by millert Fri, 02 Apr 2010 16:13:46 -0400 loc * exist *** algo *** size * imp ** - .%T can have trailing punctuation. Currently, it puts the trailing punctuation into a trailing MDOC_TEXT element inside its own scope. That element should rather be outside its scope, such that the punctuation does not get underlines. This is not trivial to implement because .%T then needs some features of in_line_eoln() - slurp all arguments into one single text element - and one feature of in_line() - put trailing punctuation out of scope. Found in mount_nfs(8) and exports(5), search for "Appendix". loc ** exist ** algo *** size * imp ** - Trailing punctuation after .%T triggers EOS spacing, at least outside .Rs (eek!). Simply setting ARGSFL_DELIM for .%T is not the right solution, it sends mandoc into an endless loop. reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 loc * exist ** algo ** size * imp ** - global variables in the SYNOPSIS of section 3 pages .Vt vs .Vt/.Va vs .Ft/.Va vs .Ft/.Fa ... from kristaps@ Tue, 08 Jun 2010 11:13:32 +0200 - implicit whitespace around inline equations example code: where '$times$' denotes matrix multiplication must not have an HTML line break, nor a blank, before <math> partial solution: html.c {"math", HTML_NLINSIDE | HTML_INDENT}, bentley@ Thu, 13 Jul 2017 19:00:59 -0600 - in enclosures, mandoc sometimes fancies a bogus end of sentence reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 loc * exist ** algo *** size * imp *** - a line starting with "\fB something" counts as starting with whitespace and triggers a line break; found in audio/normalize-mp3(1) This will become easier once escape sequences are represented by syntax tree nodes. loc ** exist * algo ** size * imp ** - formatting /usr/local/man/man1/latex2man.1 with groff and mandoc reveals lots of bugs both in groff and mandoc... reported by bentley@ Wed, 22 May 2013 23:49:30 -0600 --- PostScript and PDF issues ------------------------------------------ - PDF output doesn't use a monospaced font for .Bd -literal Example: "mandoc -Tpdf afterboot.8 > output.pdf && pdfviewer output.pdf". Search the text "Routing tables". Also check what PostScript mode does when fixing this. reported by juanfra@ Wed, 04 Jun 2014 21:44:58 +0200 instructions from juanfra@ Wed, 11 Jun 2014 02:21:01 +0200 add a new <</Type /Font>> block to the PDF files with /BaseFont /Courier and change the /Name from /F0 to the new font (/F5 (?)). re-reported by tb@ Mon, 16 Mar 2015 16:47:21 +0100 loc ** exist ** algo ** size * imp ** --- HTML issues -------------------------------------------------------- - make the HTML scaffolding customozable with -O skip=... mail to Oliver Corff 3 Jun 2021 17:28:02 +0200 more feedback from Oliver 3 Jun 2021 18:27:56 +0200 more feedback from Oliver 3 Jun 2021 23:37:18 +0200 - .Bd -unfilled should not use monospaced font anton@ 4 Mar 2021 08:19:35 +0100 loc ** exist * algo * size * imp ** - HTML formatting of .nf should avoid <br/> and not close and re-open <pre> on .P my mail to ports@ 27 Jun 2021 16:09:20 +0200 loc ** exist ** algo * size * imp ** - get rid of the last handful of style= attributes such that Content-Security-Policy: can be enabled without unsafe-inline suggested by bentley@ Nov 10, 2019 at 06:02:49AM -0700 loc * exist * algo * size * imp ** - .Bf at the beginning of a paragraph inserts a bogus 1ex horizontal space, see for example random(3). Introduced in http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_html.c.diff?r1=1.91&r2=1.92 reported by deraadt@ Mon, 28 Sep 2015 20:14:13 -0600 (MDT) loc ** exist ** algo ** size * imp * - jsg on icb, Nov 3, 2014: try to guess Xr in man(7) for hyperlinking and render them with <a class="Xr" href=...> https://github.com/Debian/debiman/issues/15 loc * exist * algo ** size ** imp ** - space characters can end up in href= attributes, for example coming from the first .Xr argument (where they make no sense, but still); does this affect other characters, other source macros...? Jackson Pauls 29 Aug 2017 16:56:27 +0100 - The tables used to render the three-part page headers actually force the width of the <body> to the max-width given for <html>. Not yet sure how to fix that... Observed by an Anonymous Coward on undeadly.org: http://undeadly.org/cgi?action=article&sid=20140925064244&pid=1 loc * exist * algo ** size * imp *** - generate <img> tags in HTML idea from florian@ Tue, 7 Apr 2015 00:26:28 +0000 may be possible to implement with .Lk img://something.png alt_text - check https://github.com/trentm/mdocml ************************************************************************ * formatting issues: gratuitous differences ************************************************************************ - .Fn reopens a new scope after punctuation in mandoc, but closes its scope for good in groff. Do we want to change mandoc or groff? Steffen Nurpmeso Sat, 08 Nov 2014 13:34:59 +0100 loc * exist ** algo ** size * imp ** - In .Bl -enum -width 0n, groff continues one the same line after the number, mandoc breaks the line. mail to kristaps@ Mon, 20 Jul 2009 02:21:39 +0200 loc * exist ** algo ** size * imp ** - .Pp between two .It in .Bl -column should produce one, not two blank lines, see e.g. login.conf(5). reported by jmc@ Sun, 17 Apr 2011 14:04:58 +0059 reported again by sthen@ Wed, 18 Jan 2012 02:09:39 +0000 (UTC) loc * exist *** algo ** size * imp ** - If the *first* line after .It is .Pp, break the line right after the tag, do not pad with space characters before breaking. See the description of the a, c, and i commands in sed(1). loc * exist ** algo ** size * imp ** - If the first line after .It is .D1, do not assert a blank line in between, see for example tmux(1). reported by nicm@ 13 Jan 2011 00:18:57 +0000 loc * exist ** algo ** size * imp ** - Trailing punctuation after .It should trigger EOS spacing. reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 Probably, this should be fixed somewhere in termp_it_pre(), not sure. loc * exist ** algo ** size * imp ** - When the -width string contains macros, the macros must be rendered before measuring the width, for example .Bl -tag -width ".Dv message" in magic(5), located in src/usr.bin/file, is the same as -width 7n, not -width 11n. The same applies to .Bl -column column widths; reported again by Nicolas Joly Thu, 1 Mar 2012 13:41:26 +0100 via wiz@ 5 Mar reported again by Franco Fichtner Fri, 27 Sep 2013 21:02:28 +0200 reported again by Bruce Evans Fri, 17 Feb 2017 21:22:44 +0100 via bapt@ loc *** exist *** algo *** size ** imp *** An easy partial fix would be to just skip the first word if it starts with a dot, including any following white space, when measuring. loc * exist * algo * size * imp *** - The \& zero-width character counts as output. That is, when it is alone on a line between two .Pp, we want three blank lines, not two as in mandoc. loc ** exist ** algo ** size * imp ** - Sequences of multiple man(7) paragraphs (.PP, .IP) interspersed with .ps and .nf/.fi produce execessive blank lines, see libJudy and graphics/dcmtk. The parser reorg may help with this. - trailing whitespace must be ignored even when followed by a font escape, see for example makes \fBdig \fR operate in batch mode in dig(1). loc ** exist ** algo ** size * imp ** ************************************************************************ * warning issues ************************************************************************ - shorten/simplify error messages for usage errors To: deraadt@ 25 Oct 2020 23:37:01 +0100 loc ** exist * algo * size ** imp *** - warn about duplicate .Sh/.Ss heads gre(4): Rename duplicate sections 20 Apr 2018 15:27:33 +0200 loc * exist * algo * size * imp ** - style message about macros inside .Bd -literal and .Dl, in particular font changing macros like .Cm, .Ar, .Fa (from the mdoclint TODO) - style message about mismatches between the section number in the file name (if it is known) and the section number in .Dt (from the mdoclint TODO) - style message about NULL without .Dv (from the mdoclint TODO) - style message about error constants without .Er (from the mdoclint TODO) - warn when .Sh or .Ss contain other macros Steffen Nurpmeso, savannah.gnu.org/bugs/index.php?45034 loc * exist * algo * size * imp ** - style message about violations of the convention .An name Aq Mt localpart@domain in AUTHORS (from the mdoclint TODO) - warn about attempts to call non-callable macros Steffen Nurpmeso Tue, 11 Nov 2014 22:55:16 +0100 Note that formatting is inconsistent in groff. .Fn Po prints "Po()", .Ar Sh prints "file ..." and no "Sh". Relatively hard because the relevant code is scattered all over mdoc_macro.c and all subtly different. loc ** exist ** algo ** size ** imp ** - warn about punctuation - e.g. ',' and ';' - at the beginning of a text line, if it is likely intended to follow the preceding output without intervening whitespace, in particular after a macro line (from the mdoclint TODO) - report double .TH in man(7) as an ERROR and let the first win kristaps@ 28 Mar 2021 13:30:41 +0200 loc * exist * algo * size * imp * - makewhatis -p complains about language subdirectories: /usr/local/man//ru: Unknown directory part ************************************************************************ * documentation issues ************************************************************************ - mark macros as: page structure domain, manual domain, general text domain is this useful? - mention /usr/share/misc/mdoc.template in mdoc(7)? - Is all the content from http://www.std.com/obi/BSD/doc/usd/28.tbl/tbl covered in tbl(7)? ************************************************************************ * performance issues ************************************************************************ - the PDF file is HUGE: this can be reduced by using relative offsets ************************************************************************ * structural issues ************************************************************************ - POSIX says in the documentation of sysconf(3) that PATH_MAX is allowed to be so large that it is a bad idea to use it for sizing static buffers. So use dynamic buffers throughout. See the file test-PATH_MAX.c for details. Found by Aaron M. Ucko in the GNU Hurd via Bdale Garbee, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829624 - Is it possible to further simplify ENDBODY_SPACE? - Find better ways to prevent endless loops in roff(7) macro and string expansion. - make buffers for parsing functions const christos@ via wiz@ Fri, 18 Dec 2015 17:10:01 +0100 - struct mparse refactoring Steffen Nurpmeso Thu, 04 Sep 2014 12:50:00 +0200 ************************************************************************ * CGI issues ************************************************************************ - Inspect httpd(8) logs on man.openbsd.org and consider whether logging can be improved, where bad syntax comes from, and what needs to be done to get rid of COMPAT_OLDURI. - Enable HTTP compression by detecting gzip encoding and filtering output through libz. - Privilege separation (see OpenSSH). - Enable caching support via HTTP 304 and If-Modified-Since. ************************************************************************ * to improve in the groff_mdoc(7) macros ************************************************************************ - delete OS release verification from .Dx, .Fx, .Nx, .Ox etc. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629161 also Branden Robinson 18 Dec 2019 00:59:52 +1100 - Can the distinction between .Vt and .Va be made stricter, recommending .Vt extern char * Ns Va optarg ; ? What about the block macro properties of .Vt in the SYNOPSIS? zeurkous 25 Dec 2019 08:48:36 +0100 - .Cd # arch1, arch2 in section 4 pages: find better way to indicate multiple architectures, maybe: allow .Dt vgafb 4 "macppc sparc64" already shown as "Device Drivers Manual (macppc sparc64)" for apropos, make that "vgafb(4) - macppc # sparc64" instead of "- all" groff can be made to show multiple arches, too, but it is tedious to do the string parsing in roff code... jmc@ 23 Apr 2018 07:24:52 +0100 [man for vgafb(4)...] loc ** exist ** algo * size * imp *** - use uname(1) to set doc-default-operating-system at install time tobimensch Mon, 1 Dec 2014 00:25:07 +0100 - apostrophe (39), circumflex (94), grave (96), tilde (126) in manuals: \(aq, \(ha, \`, \(ti Re: [Groff] ASCII Minus Sign in man Pages. bentley@ 26 Apr 2017 10:02:06 -0600 Do we need to fix existing manuals? Do we need to fix the definition of the mdoc(7) language? ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/apropos.1�����������������������������������������������������������������������������0100644�0001753�0001753�00000025347�14123140553�0015127�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: apropos.1,v 1.51 2020/10/01 22:50:00 schwarze Exp $ .\" .\" Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2011,2012,2014,2017,2018 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: October 1 2020 $ .Dt APROPOS 1 .Os .Sh NAME .Nm apropos , .Nm whatis .Nd search manual page databases .Sh SYNOPSIS .Nm .Op Fl afk .Op Fl C Ar file .Op Fl M Ar path .Op Fl m Ar path .Op Fl O Ar outkey .Op Fl S Ar arch .Op Fl s Ar section .Ar expression ... .Sh DESCRIPTION The .Nm apropos and .Nm whatis utilities query manual page databases generated by .Xr makewhatis 8 , evaluating .Ar expression for each file in each database. By default, they display the names, section numbers, and description lines of all matching manuals. .Pp By default, .Nm searches for .Xr makewhatis 8 databases in the default paths stipulated by .Xr man 1 and uses case-insensitive extended regular expression matching over manual names and descriptions .Pq the Li \&Nm No and Li \&Nd No macro keys . Multiple terms imply pairwise .Fl o . .Pp .Nm whatis is a synonym for .Nm .Fl f . .Pp The options are as follows: .Bl -tag -width Ds .It Fl a Instead of showing only the title lines, show the complete manual pages, just like .Xr man 1 .Fl a would. If the standard output is a terminal device and .Fl c is not specified, use .Xr less 1 to paginate them. In .Fl a mode, the options .Fl IKOTW described in the .Xr mandoc 1 manual are also available. .It Fl C Ar file Specify an alternative configuration .Ar file in .Xr man.conf 5 format. .It Fl f Search for all words in .Ar expression in manual page names only. The search is case-insensitive and matches whole words only. In this mode, macro keys, comparison operators, and logical operators are not available. .It Fl k Support the full .Ar expression syntax. It is the default for .Nm . .It Fl M Ar path Use the colon-separated path instead of the default list of paths searched for .Xr makewhatis 8 databases. Invalid paths, or paths without manual databases, are ignored. .It Fl m Ar path Prepend the colon-separated paths to the list of paths searched for .Xr makewhatis 8 databases. Invalid paths, or paths without manual databases, are ignored. .It Fl O Ar outkey Show the values associated with the key .Ar outkey instead of the manual descriptions. .It Fl S Ar arch Restrict the search to pages for the specified .Xr machine 1 architecture. .Ar arch is case-insensitive. By default, pages for all architectures are shown. .It Fl s Ar section Restrict the search to the specified section of the manual. By default, pages from all sections are shown. See .Xr man 1 for a listing of sections. .El .Pp The options .Fl chlw are also supported and are documented in .Xr man 1 . The options .Fl fkl are mutually exclusive and override each other. .Pp An .Ar expression consists of search terms joined by logical operators .Fl a .Pq and and .Fl o .Pq or . The .Fl a operator has precedence over .Fl o and both are evaluated left-to-right. .Bl -tag -width Ds .It \&( Ar expr No \&) True if the subexpression .Ar expr is true. .It Ar expr1 Fl a Ar expr2 True if both .Ar expr1 and .Ar expr2 are true (logical .Sq and ) . .It Ar expr1 Oo Fl o Oc Ar expr2 True if .Ar expr1 and/or .Ar expr2 evaluate to true (logical .Sq or ) . .It Ar term True if .Ar term is satisfied. This has syntax .Sm off .Oo .Op Ar key Op , Ar key ... .Pq Cm = | \(ti .Oc .Ar val , .Sm on where .Ar key is an .Xr mdoc 7 macro to query and .Ar val is its value. See .Sx Macro Keys for a list of available keys. Operator .Cm = evaluates a substring, while .Cm \(ti evaluates a case-sensitive extended regular expression. .It Fl i Ar term If .Ar term is a regular expression, it is evaluated case-insensitively. Has no effect on substring terms. .El .Pp Results are sorted first according to the section number in ascending numerical order, then by the page name in ascending .Xr ascii 7 alphabetical order, case-insensitive. .Pp Each output line is formatted as .Pp .D1 name[, name...](sec) \- description .Pp Where .Dq name is the manual's name, .Dq sec is the manual section, and .Dq description is the manual's short description. If an architecture is specified for the manual, it is displayed as .Pp .D1 name(sec/arch) \- description .Pp Resulting manuals may be accessed as .Pp .Dl $ man \-s sec name .Pp If an architecture is specified in the output, use .Pp .Dl $ man \-s sec \-S arch name .Ss Macro Keys Queries evaluate over a subset of .Xr mdoc 7 macros indexed by .Xr makewhatis 8 . In addition to the macro keys listed below, the special key .Cm any may be used to match any available macro key. .Pp Names and description: .Bl -column "xLix" description -offset indent -compact .It Li \&Nm Ta manual name .It Li \&Nd Ta one-line manual description .It Li arch Ta machine architecture (case-insensitive) .It Li sec Ta manual section number .El .Pp Sections and cross references: .Bl -column "xLix" description -offset indent -compact .It Li \&Sh Ta section header (excluding standard sections) .It Li \&Ss Ta subsection header .It Li \&Xr Ta cross reference to another manual page .It Li \&Rs Ta bibliographic reference .El .Pp Semantic markup for command line utilities: .Bl -column "xLix" description -offset indent -compact .It Li \&Fl Ta command line options (flags) .It Li \&Cm Ta command modifier .It Li \&Ar Ta command argument .It Li \&Ic Ta internal or interactive command .It Li \&Ev Ta environmental variable .It Li \&Pa Ta file system path .El .Pp Semantic markup for function libraries: .Bl -column "xLix" description -offset indent -compact .It Li \&Lb Ta function library name .It Li \&In Ta include file .It Li \&Ft Ta function return type .It Li \&Fn Ta function name .It Li \&Fa Ta function argument type and name .It Li \&Vt Ta variable type .It Li \&Va Ta variable name .It Li \&Dv Ta defined variable or preprocessor constant .It Li \&Er Ta error constant .It Li \&Ev Ta environmental variable .El .Pp Various semantic markup: .Bl -column "xLix" description -offset indent -compact .It Li \&An Ta author name .It Li \&Lk Ta hyperlink .It Li \&Mt Ta Do mailto Dc hyperlink .It Li \&Cd Ta kernel configuration declaration .It Li \&Ms Ta mathematical symbol .It Li \&Tn Ta tradename .El .Pp Physical markup: .Bl -column "xLix" description -offset indent -compact .It Li \&Em Ta italic font or underline .It Li \&Sy Ta boldface font .It Li \&Li Ta typewriter font .El .Pp Text production: .Bl -column "xLix" description -offset indent -compact .It Li \&St Ta reference to a standards document .It Li \&At Ta At No version reference .It Li \&Bx Ta Bx No version reference .It Li \&Bsx Ta Bsx No version reference .It Li \&Nx Ta Nx No version reference .It Li \&Fx Ta Fx No version reference .It Li \&Ox Ta Ox No version reference .It Li \&Dx Ta Dx No version reference .El .Pp In general, macro keys are supposed to yield complete results without expecting the user to consider actual macro usage. For example, results include: .Pp .Bl -tag -width 3n -offset 3n -compact .It Li \&Fa function arguments appearing on .Ic \&Fn lines .It Li \&Fn function names marked up with .Ic \&Fo macros .It Li \&In include file names marked up with .Ic \&Fd macros .It Li \&Vt types appearing as function return types and .It \& types appearing in function arguments in the SYNOPSIS .El .Sh ENVIRONMENT .Bl -tag -width MANPAGER .It Ev MANPAGER Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, .Xr less 1 ; see .Xr man 1 for details. Only used if .Fl a or .Fl l is specified. .It Ev MANPATH A colon-separated list of directories to search for manual pages; see .Xr man 1 for details. Overridden by .Fl M , ignored if .Fl l is specified. .It Ev PAGER Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, .Xr less 1 is used. Only used if .Fl a or .Fl l is specified. .El .Sh FILES .Bl -tag -width "/etc/man.conf" -compact .It Pa mandoc.db name of the .Xr makewhatis 8 keyword database .It Pa /etc/man.conf default .Xr man 1 configuration file .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Search for .Qq .cf as a substring of manual names and descriptions: .Pp .Dl $ apropos =.cf .Pp Include matches for .Qq .cnf and .Qq .conf as well: .Pp .Dl $ apropos =.cf =.cnf =.conf .Pp Search in names and descriptions using a case-sensitive regular expression: .Pp .Dl $ apropos \(aq\(tiset.?[ug]id\(aq .Pp Search for all manual pages in a given section: .Pp .Dl $ apropos \-s 9 \&. .Pp Search for manuals in the library section mentioning both the .Qq optind and the .Qq optarg variables: .Pp .Dl $ apropos \-s 3 Va=optind \-a Va=optarg .Pp Do exactly the same as calling .Nm whatis with the argument .Qq ssh : .Pp .Dl $ apropos \-\- \-i \(aqNm\(ti[[:<:]]ssh[[:>:]]\(aq .Pp The following two invocations are equivalent: .Pp .D1 Li $ apropos -S Ar arch Li -s Ar section expression .Bd -ragged -offset indent .Li $ apropos \e( Ar expression Li \e) .Li -a arch\(ti^( Ns Ar arch Ns Li |any)$ .Li -a sec\(ti^ Ns Ar section Ns Li $ .Ed .Sh SEE ALSO .Xr man 1 , .Xr re_format 7 , .Xr makewhatis 8 .Sh STANDARDS The .Nm utility is compliant with the .St -p1003.1-2008 specification of .Xr man 1 .Fl k . .Pp All options, the .Nm whatis command, support for logical operators, macro keys, substring matching, sorting of results, the environment variables .Ev MANPAGER and .Ev MANPATH , the database format, and the configuration file are extensions to that specification. .Sh HISTORY Part of the functionality of .Nm whatis was already provided by the former .Nm manwhere utility in .Bx 1 . The .Nm and .Nm whatis utilities first appeared in .Bx 2 . They were rewritten from scratch for .Ox 5.6 . .Pp The .Fl M option and the .Ev MANPATH variable first appeared in .Bx 4.3 ; .Fl m in .Bx 4.3 Reno ; .Fl C in .Bx 4.4 Lite1 ; and .Fl S and .Fl s in .Ox 4.5 for .Nm and in .Ox 5.6 for .Nm whatis . The options .Fl acfhIKklOTWw appeared in .Ox 5.7 . .Sh AUTHORS .An -nosplit .An Bill Joy wrote .Nm manwhere in 1977 and the original .Bx .Nm and .Nm whatis in February 1979. The current version was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv and .An Ingo Schwarze Aq Mt schwarze@openbsd.org . �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/catman.8������������������������������������������������������������������������������0100644�0001753�0001753�00000010761�14123140553�0014710�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: catman.8,v 1.8 2017/03/18 19:56:01 schwarze Exp $ .\" .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: March 18 2017 $ .Dt CATMAN 8 .Os .Sh NAME .Nm catman .Nd format all manual pages below a directory .Sh SYNOPSIS .Nm catman .Op Fl I Cm os Ns = Ns Ar name .Op Fl T Ar output .Ar srcdir dstdir .Sh DESCRIPTION The .Nm utility assumes that all files below .Ar srcdir are manual pages in .Xr mdoc 7 and .Xr man 7 format and formats all of them, storing the formatted versions in the same relative paths below .Ar dstdir . Subdirectories of .Ar dstdir are created as needed. Existing files are not explicitly deleted, but possibly overwritten. .Pp The options are as follows: .Bl -tag -width Ds .It Fl I Cm os Ns = Ns Ar name Override the default operating system .Ar name for the .Xr mdoc 7 .Ic \&Os and for the .Xr man 7 .Ic TH macro. .It Fl T Ar output Output format. The .Ar output argument can be .Cm ascii , .Cm utf8 , or .Cm html ; see .Xr mandoc 1 . In .Cm html output mode, the .Cm fragment output option is implied. Other output options are not supported. .El .Sh IMPLEMENTATION NOTES Since this version avoids .Xr fork 2 and .Xr exec 3 overhead and uses the much faster .Sy mandoc parsers and formatters rather than .Sy groff , it may be about one order of magnitude faster than other .Nm implementations. .Sh EXIT STATUS .Ex -std .Pp Possible errors include: .Bl -bullet .It missing, invalid, or excessive command line arguments .It failure to change the current working directory to .Ar srcdir .It failure to open .Ar dstdir .It communication failure with .Xr mandocd 8 .It resource exhaustion, for example file descriptor, process table, or memory exhaustion .El .Pp Except for memory exhaustion and similar system-level failures, failures while trying to open, read, parse, or format individual manual pages, to save individual formatted files to the file system, or even to create directories do not cause .Nm to return an error exit status. In such cases, .Nm will simply continue with the next file or subdirectory. .Sh SEE ALSO .Xr mandoc 1 , .Xr mandocd 8 .Sh HISTORY A .Nm utility first appeared in .Fx 1.0 . Other, incompatible implementations appeared in .Nx 1.0 and in .Sy man-db No 2.2 . .Pp This version appeared in version 1.14.1 of the .Sy mandoc toolkit. .Sh AUTHORS .An -nosplit The first .Nm implementation was a short shell script by .An Christoph Robitschko in July 1993. .Pp The .Nx implementations were written by .An J. T. Conklin Aq Mt jtc@netbsd.org in 1993, .An Christian E. Hopps Aq Mt chopps@netbsd.org in 1994, and .An Dante Profeta Aq Mt dante@netbsd.org in 1999; the .Sy man-db implementation by .An Graeme W. Wilford in 1994; and the .Fx implementations by .An Wolfram Schneider Aq Mt wosch@freebsd.org in 1995 and .An John Rochester Aq Mt john@jrochester.org in 2002. .Pp The concept of the present version was designed and implemented by .An Michael Stapelberg Aq Mt stapelberg@debian.org in 2017. Option and argument handling and directory iteration was added by .An Ingo Schwarze Aq Mt schwarze@openbsd.org . .Sh CAVEATS All versions of .Nm are incompatible with each other because each caters to the needs of a specific operating system, for example regarding directory structures and file naming conventions. .Pp This version is more flexible than the others in so far as it does not assume any particular directory structure or naming convention. That flexibility comes at the price of not being able to change the names and relative paths of the source files when reusing them to store the formatted files, of not supporting any configuration file formats or environment variables, and of being unable to scan for and remove junk files in .Ar dstdir . .Pp Currently, .Nm always reformats each page, even if the formatted version is newer than the source version. ���������������mandoc-1.14.6/cgi.h.example�������������������������������������������������������������������������0100644�0001753�0001753�00000000334�14123140553�0015714�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Example compile-time configuration file for man.cgi(8). */ #define SCRIPT_NAME "cgi-bin/man.cgi" #define MAN_DIR "/man" #define CSS_DIR "" #define CUSTOMIZE_TITLE "Manual pages with mandoc" #define COMPAT_OLDURI Yes ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/compat_fts.h��������������������������������������������������������������������������0100644�0001753�0001753�00000010217�14123140553�0015660�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $OpenBSD: fts.h,v 1.14 2012/12/05 23:19:57 deraadt Exp $ */ /* $NetBSD: fts.h,v 1.7 2012/03/01 16:18:51 hans Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)fts.h 8.3 (Berkeley) 8/14/94 */ #ifndef _FTS_H_ #define _FTS_H_ typedef struct { struct _ftsent *fts_cur; /* current node */ struct _ftsent *fts_child; /* linked list of children */ struct _ftsent **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ size_t fts_pathlen; /* sizeof(path) */ int fts_nitems; /* elements in the sort array */ int (*fts_compar)(const struct _ftsent **, const struct _ftsent **); /* compare function */ #define FTS_NOCHDIR 0x0004 /* don't change directories */ #define FTS_PHYSICAL 0x0010 /* physical walk */ #define FTS_XDEV 0x0040 /* don't cross devices */ #define FTS_OPTIONMASK 0x0054 /* valid user option mask */ #define FTS_STOP 0x2000 /* (private) unrecoverable error */ int fts_options; /* fts_open options, global flags */ } FTS; typedef struct _ftsent { struct _ftsent *fts_cycle; /* cycle node */ struct _ftsent *fts_parent; /* parent directory */ struct _ftsent *fts_link; /* next file in directory */ char *fts_accpath; /* access path */ char *fts_path; /* root path */ int fts_errno; /* errno for this node */ size_t fts_pathlen; /* strlen(fts_path) */ size_t fts_namelen; /* strlen(fts_name) */ ino_t fts_ino; /* inode */ dev_t fts_dev; /* device */ nlink_t fts_nlink; /* link count */ #define FTS_ROOTPARENTLEVEL -1 #define FTS_ROOTLEVEL 0 #define FTS_MAXLEVEL 0x7fffffff int fts_level; /* depth (-1 to N) */ #define FTS_D 1 /* preorder directory */ #define FTS_DC 2 /* directory that causes cycles */ #define FTS_DEFAULT 3 /* none of the above */ #define FTS_DNR 4 /* unreadable directory */ #define FTS_DOT 5 /* dot or dot-dot */ #define FTS_DP 6 /* postorder directory */ #define FTS_ERR 7 /* error; errno is set */ #define FTS_F 8 /* regular file */ #define FTS_INIT 9 /* initialized only */ #define FTS_NS 10 /* stat(2) failed */ #define FTS_NSOK 11 /* no stat(2) requested */ #define FTS_SL 12 /* symbolic link */ unsigned short fts_info; /* user flags for FTSENT structure */ #define FTS_NOINSTR 3 /* no instructions */ #define FTS_SKIP 4 /* discard node */ unsigned short fts_instr; /* fts_set() instructions */ struct stat *fts_statp; /* stat(2) information */ char fts_name[1]; /* file name */ } FTSENT; int fts_close(FTS *); FTS *fts_open(char * const *, int, int (*)(const FTSENT **, const FTSENT **)); FTSENT *fts_read(FTS *); int fts_set(FTS *, FTSENT *, int); #endif /* !_FTS_H_ */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/compat_ohash.h������������������������������������������������������������������������0100644�0001753�0001753�00000005212�14123140553�0016165�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $OpenBSD: ohash.h,v 1.2 2014/06/02 18:52:03 deraadt Exp $ */ /* Copyright (c) 1999, 2004 Marc Espie <espie@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef OHASH_H #define OHASH_H /* Open hashing support. * Open hashing was chosen because it is much lighter than other hash * techniques, and more efficient in most cases. */ /* user-visible data structure */ struct ohash_info { ptrdiff_t key_offset; void *data; /* user data */ void *(*calloc)(size_t, size_t, void *); void (*free)(void *, void *); void *(*alloc)(size_t, void *); }; struct _ohash_record; /* private structure. It's there just so you can do a sizeof */ struct ohash { struct _ohash_record *t; struct ohash_info info; unsigned int size; unsigned int total; unsigned int deleted; }; /* For this to be tweakable, we use small primitives, and leave part of the * logic to the client application. e.g., hashing is left to the client * application. We also provide a simple table entry lookup that yields * a hashing table index (opaque) to be used in find/insert/remove. * The keys are stored at a known position in the client data. */ void ohash_init(struct ohash *, unsigned, struct ohash_info *); void ohash_delete(struct ohash *); unsigned int ohash_lookup_interval(struct ohash *, const char *, const char *, uint32_t); unsigned int ohash_lookup_memory(struct ohash *, const char *, size_t, uint32_t); void *ohash_find(struct ohash *, unsigned int); void *ohash_remove(struct ohash *, unsigned int); void *ohash_insert(struct ohash *, unsigned int, void *); void *ohash_first(struct ohash *, unsigned int *); void *ohash_next(struct ohash *, unsigned int *); unsigned int ohash_entries(struct ohash *); void *ohash_create_entry(struct ohash_info *, const char *, const char **); uint32_t ohash_interval(const char *, const char **); unsigned int ohash_qlookupi(struct ohash *, const char *, const char **); unsigned int ohash_qlookup(struct ohash *, const char *); #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/compat_stringlist.h�������������������������������������������������������������������0100644�0001753�0001753�00000003665�14123140553�0017277�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: compat_stringlist.h,v 1.5 2020/06/15 21:48:09 schwarze Exp $ */ /* $NetBSD: stringlist.h,v 1.7 2008/04/28 20:22:54 martin Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Christos Zoulas. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> /* * Simple string list */ typedef struct _stringlist { char **sl_str; size_t sl_max; size_t sl_cur; } StringList; StringList *sl_init(void); int sl_add(StringList *, char *); void sl_free(StringList *, int); char *sl_find(StringList *, const char *); int sl_delete(StringList *, const char *, int); ���������������������������������������������������������������������������mandoc-1.14.6/configure�����������������������������������������������������������������������������0100755�0001753�0001753�00000047063�14123140553�0015270�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # # $Id: configure,v 1.81 2021/09/20 10:19:51 schwarze Exp $ # # Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. set -e [ -w config.log ] && mv config.log config.log.old [ -w config.h ] && mv config.h config.h.old # Output file descriptor usage: # 1 (stdout): config.h, Makefile.local # 2 (stderr): original stderr, usually to the console # 3: config.log exec 3> config.log echo "file config.log: writing..." # --- default settings ------------------------------------------------- # Initialize all variables here, # such that nothing can leak in from the environment. SOURCEDIR=`dirname "${0}"` MANPATH_BASE="/usr/share/man:/usr/X11R6/man" MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" OSENUM= OSNAME= UTF8_LOCALE= AR=ar CC=cc CFLAGS= FATAL=0 LDADD= LDFLAGS= LD_NANOSLEEP= LD_OHASH= LD_RECVMSG= STATIC= BUILD_CGI=0 BUILD_CATMAN=0 INSTALL_LIBMANDOC=0 HAVE_ATTRIBUTE= HAVE_CMSG= HAVE_DIRENT_NAMLEN= HAVE_EFTYPE= HAVE_ENDIAN= HAVE_ERR= HAVE_FTS= HAVE_FTS_COMPARE_CONST= HAVE_GETLINE= HAVE_GETSUBOPT= HAVE_ISBLANK= HAVE_LESS_T= HAVE_MKDTEMP= HAVE_MKSTEMPS= HAVE_NANOSLEEP= HAVE_NTOHL= HAVE_O_DIRECTORY= HAVE_OHASH= HAVE_PATH_MAX= HAVE_PLEDGE= HAVE_PROGNAME= HAVE_REALLOCARRAY= HAVE_RECALLOCARRAY= HAVE_RECVMSG= HAVE_REWB_BSD= HAVE_REWB_SYSV= HAVE_SANDBOX_INIT= HAVE_STRCASESTR= HAVE_STRINGLIST= HAVE_STRLCAT= HAVE_STRLCPY= HAVE_STRNDUP= HAVE_STRPTIME= HAVE_STRSEP= HAVE_STRTONUM= HAVE_SYS_ENDIAN= HAVE_VASPRINTF= HAVE_WCHAR= NEED_GNU_SOURCE=0 NEED_OPENBSD_SOURCE=0 NEED_XPG4_2=0 MANDOC_COBJS= SOELIM_COBJS= PREFIX="/usr/local" BINDIR= SBINDIR= BIN_FROM_SBIN= INCLUDEDIR= LIBDIR= MANDIR= READ_ALLOWED_PATH= WWWPREFIX="/var/www" HTDOCDIR= CGIBINDIR= BINM_APROPOS="apropos" BINM_CATMAN="catman" BINM_MAKEWHATIS="makewhatis" BINM_MAN="man" BINM_SOELIM="soelim" BINM_WHATIS="whatis" BINM_PAGER= MANM_MAN="man" MANM_MANCONF="man.conf" MANM_MDOC="mdoc" MANM_ROFF="roff" MANM_EQN="eqn" MANM_TBL="tbl" INSTALL="install" INSTALL_PROGRAM= INSTALL_LIB= INSTALL_MAN= INSTALL_DATA= LN="ln -f" # --- manual settings from configure.local ----------------------------- if [ -r ./configure.local ]; then echo "file configure.local: reading..." 1>&2 echo "file configure.local: reading..." 1>&3 cat ./configure.local 1>&3 . ./configure.local else echo "file configure.local: no (fully automatic configuration)" 1>&2 echo "file configure.local: no (fully automatic configuration)" 1>&3 fi echo 1>&3 # --- tests functions -------------------------------------------------- # Check whether this HAVE_ setting is manually overridden. # If yes, use the override, if no, do not decide anything yet. # Arguments: test file name, test var name, manual value ismanual() { [ -z "${3}" ] && return 1 echo "tested ${1}: HAVE_${2}=${3} (manual)" 1>&2 echo "tested ${1}: HAVE_${2}=${3} (manual)" 1>&3 echo 1>&3 return 0 } # Run a single autoconfiguration test. # In case of success, enable the feature. # In case of failure, do not decide anything yet. # Arguments: test file name, test var name, additional CFLAGS singletest() { n=${1}${3} cat 1>&3 << __HEREDOC__ testing ${n} ... ${COMP} -o test-${1} test-${1}.c ${3} __HEREDOC__ if ${COMP} -o "test-${1}" "${SOURCEDIR}/test-${1}.c" ${3} 1>&3 2>&3 then echo "partial result of ${n}: ${CC} succeeded" 1>&3 else echo "tested ${n}: no (compilation failed)" 1>&2 echo "result of ${n}: ${CC} failed with exit status $?" 1>&3 echo "result of compiling ${n}: no" 1>&3 echo 1>&3 return 1 fi if ./test-${1} 1>&3 2>&3; then echo "tested ${n}: yes" 1>&2 echo "result of running ${n}: yes" 1>&3 echo 1>&3 eval HAVE_${2}=1 [ "${3}" = "-D_GNU_SOURCE" ] && NEED_GNU_SOURCE=1 [ "${3}" = "-D_OPENBSD_SOURCE" ] && NEED_OPENBSD_SOURCE=1 [ "${3}" = "-D_XPG4_2" ] && NEED_XPG4_2=1 [ "${3}" = "-lrt" ] && LD_NANOSLEEP="-lrt" [ "${3}" = "-lsocket" ] && LD_RECVMSG="-lsocket" [ "${3}" = "-lutil" ] && LD_OHASH="-lutil" rm "test-${1}" return 0 else echo "tested ${n}: no (execution failed)" 1>&2 echo "result of ${n}: execution failed with exit status $?" 1>&3 echo "result of running ${n}: no" 1>&3 echo 1>&3 rm "test-${1}" return 1 fi } # Run a complete autoconfiguration test, including the check for # a manual override and disabling the feature on failure. # Arguments: test file name, test var name, additional CFLAGS # The final argument can optionally be repeated a second time. runtest() { eval _manual=\${HAVE_${2}} ismanual "${1}" "${2}" "${_manual}" && return 0 singletest "${1}" "${2}" "${3}" && return 0 [ -n "${4}" ] && singletest "${1}" "${2}" "${4}" && return 0 eval HAVE_${2}=0 return 1 } # Select a UTF-8 locale. get_locale() { [ -n "${HAVE_WCHAR}" ] && [ "${HAVE_WCHAR}" -eq 0 ] && return 0 ismanual UTF8_LOCALE UTF8_LOCALE "${UTF8_LOCALE}" && return 0 echo "testing UTF8_LOCALE ..." 1>&3 UTF8_LOCALE=`locale -a | grep -i '^en_US\.UTF-*8$' | head -n 1` if [ -z "${UTF8_LOCALE}" ]; then UTF8_LOCALE=`locale -a | grep -i '\.UTF-*8' | head -n 1` [ -n "${UTF8_LOCALE}" ] || return 1 fi echo "selected UTF8_LOCALE=${UTF8_LOCALE}" 1>&2 echo "selected UTF8_LOCALE=${UTF8_LOCALE}" 1>&3 echo 1>&3 return 0; } # --- operating system ------------------------------------------------- if [ -n "${OSENUM}" ]; then echo "OSENUM specified manually: ${OSENUM}" 1>&2 echo "OSENUM specified manually: ${OSENUM}" 1>&3 else OSDETECT=`uname` if [ "${OSDETECT}" = "NetBSD" ]; then OSENUM=MANDOC_OS_NETBSD elif [ "${OSDETECT}" = "OpenBSD" ]; then OSENUM=MANDOC_OS_OPENBSD else OSENUM=MANDOC_OS_OTHER fi echo "tested operating system: ${OSDETECT} -> OSENUM=${OSENUM}" 1>&2 echo "tested operating system: ${OSDETECT} -> OSENUM=${OSENUM}" 1>&3 unset OSDETECT fi echo 1>&3 # --- compiler options ------------------------------------------------- DEFCFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter" if [ -n "${CFLAGS}" ]; then COMP="${CC} ${CFLAGS} -Wno-unused -Werror" else COMP="${CC} ${DEFCFLAGS} -Wno-unused -Werror" fi printf "%s" "tested ${CC} -W: " 1>&2 printf "%s" "testing ${CC} -W: " 1>&3 runtest noop WFLAG || true if [ -n "${CFLAGS}" ]; then echo "CFLAGS specified manually:" 1>&3 elif [ ${HAVE_WFLAG} -eq 0 ]; then CFLAGS="-g" else CFLAGS="${DEFCFLAGS}" fi echo "selected CFLAGS=\"${CFLAGS}\"" 1>&2 echo "selected CFLAGS=\"${CFLAGS}\"" 1>&3 echo 1>&3 COMP="${CC} ${CFLAGS}" [ ${HAVE_WFLAG} -eq 0 ] || COMP="${COMP} -Wno-unused -Werror" if [ -n "${STATIC}" ]; then echo "selected STATIC=\"${STATIC}\" (manual)" 1>&2 echo "selected STATIC=\"${STATIC}\" (manual)" 1>&3 echo 1>&3 else runtest noop STATIC -static || true [ ${HAVE_STATIC} -eq 0 ] || STATIC="-static" echo "selected STATIC=\"${STATIC}\"" 1>&2 echo "selected STATIC=\"${STATIC}\"" 1>&3 echo 1>&3 fi # --- tests for config.h ---------------------------------------------- # --- library functions --- runtest attribute ATTRIBUTE || true runtest cmsg CMSG "" "-D_XPG4_2" || true runtest dirent-namlen DIRENT_NAMLEN || true runtest be32toh ENDIAN || true runtest be32toh SYS_ENDIAN -DSYS_ENDIAN || true runtest EFTYPE EFTYPE || true runtest err ERR || true runtest getline GETLINE || true runtest getsubopt GETSUBOPT "" -D_GNU_SOURCE || true runtest isblank ISBLANK || true runtest mkdtemp MKDTEMP || true runtest mkstemps MKSTEMPS || true runtest nanosleep NANOSLEEP "${LD_NANOSLEEP}" "-lrt" || true runtest ntohl NTOHL || true runtest O_DIRECTORY O_DIRECTORY || true runtest PATH_MAX PATH_MAX || true runtest pledge PLEDGE || true runtest sandbox_init SANDBOX_INIT || true runtest progname PROGNAME || true runtest reallocarray REALLOCARRAY "" -D_OPENBSD_SOURCE || true runtest recallocarray RECALLOCARRAY "" -D_OPENBSD_SOURCE || true runtest recvmsg RECVMSG "${LD_RECVMSG}" "-lsocket" || true runtest rewb-bsd REWB_BSD || true runtest rewb-sysv REWB_SYSV || true runtest strcasestr STRCASESTR "" -D_GNU_SOURCE || true runtest stringlist STRINGLIST || true runtest strlcat STRLCAT || true runtest strlcpy STRLCPY || true runtest strndup STRNDUP || true runtest strptime STRPTIME "" -D_GNU_SOURCE || true runtest strsep STRSEP || true runtest strtonum STRTONUM "" -D_OPENBSD_SOURCE || true runtest vasprintf VASPRINTF "" -D_GNU_SOURCE || true # --- fts --- if [ "${1}" = "-depend" ]; then HAVE_FTS=0 HAVE_FTS_COMPARE_CONST=0 echo "tested fts: HAVE_FTS=0 (for make depend)" 1>&2 echo "tested fts: HAVE_FTS=0 (for make depend)" 1>&3 echo 1>&3 elif ismanual fts FTS ${HAVE_FTS}; then HAVE_FTS_COMPARE_CONST=0 elif runtest fts FTS_COMPARE_CONST -DFTS_COMPARE_CONST; then HAVE_FTS=1 else runtest fts FTS || true fi # --- pager --- manual= if [ -n "${BINM_PAGER}" ]; then manual=" (manual)" elif less test-noop.c 1>/dev/null 2>&3; then BINM_PAGER=less echo "tested less: yes" 1>&2 echo "tested less: yes" 1>&3 else BINM_PAGER=more echo "tested less: no" 1>&2 echo "tested less: no" 1>&3 fi echo "selected BINM_PAGER=${BINM_PAGER}${manual}" 1>&2 echo "selected BINM_PAGER=${BINM_PAGER}${manual}" 1>&3 # --- tagging support in the pager --- if ismanual "${BINM_PAGER} -T" LESS_T ${HAVE_LESS_T}; then : elif ${BINM_PAGER} -T /dev/null test-noop.c 1>/dev/null 2>&3; then HAVE_LESS_T=1 echo "tested ${BINM_PAGER} -T: yes" 1>&2 echo "tested ${BINM_PAGER} -T: yes" 1>&3 echo 1>&3 else HAVE_LESS_T=0 echo "tested ${BINM_PAGER} -T: no" 1>&2 echo "tested ${BINM_PAGER} -T: no" 1>&3 echo 1>&3 fi # --- wide character and locale support --- if get_locale; then runtest wchar WCHAR "-DUTF8_LOCALE=\"${UTF8_LOCALE}\"" \ "-D_GNU_SOURCE -DUTF8_LOCALE=\"${UTF8_LOCALE}\"" || true else HAVE_WCHAR=0 echo "tested wchar: no (no UTF8_LOCALE)" 1>&2 echo "tested wchar: no (no UTF8_LOCALE)" 1>&3 echo 1>&3 fi # --- ohash --- if [ "${1}" = "-depend" ]; then HAVE_OHASH=0 echo "tested ohash: HAVE_OHASH=0 (for make depend)" 1>&2 echo "tested ohash: HAVE_OHASH=0 (for make depend)" 1>&3 echo 1>&3 else runtest ohash OHASH "${LD_OHASH}" "-lutil" || true fi if [ "${HAVE_OHASH}" -eq 0 ]; then LD_OHASH= fi # --- required functions --- if [ ${HAVE_ENDIAN} -eq 0 -a \ ${HAVE_SYS_ENDIAN} -eq 0 -a \ ${HAVE_NTOHL} -eq 0 ]; then echo "FATAL: no endian conversion functions found" 1>&2 echo "FATAL: no endian conversion functions found" 1>&3 FATAL=1 fi if [ "${HAVE_NANOSLEEP}" -eq 0 ]; then echo "FATAL: nanosleep: no" 1>&2 echo "FATAL: nanosleep: no" 1>&3 FATAL=1 fi if [ ${BUILD_CATMAN} -gt 0 -a "${HAVE_RECVMSG}" -eq 0 ]; then echo "FATAL: recvmsg: no" 1>&2 echo "FATAL: recvmsg: no" 1>&3 echo "Without recvmsg(2), you cannot BUILD_CATMAN." 1>&2 FATAL=1 fi if [ ${BUILD_CATMAN} -gt 0 -a "${HAVE_CMSG}" -eq 0 ]; then echo "FATAL: cmsg: no" 1>&2 echo "FATAL: cmsg: no" 1>&3 echo "Without CMSG_FIRSTHDR(3), you cannot BUILD_CATMAN." 1>&2 FATAL=1 fi [ "${FATAL}" -eq 0 ] || exit 1 # --- LDADD --- LDADD="${LDADD} ${LD_NANOSLEEP} ${LD_RECVMSG} ${LD_OHASH} -lz" echo "selected LDADD=\"${LDADD}\"" 1>&2 echo "selected LDADD=\"${LDADD}\"" 1>&3 echo 1>&3 # --- write config.h --- exec > config.h cat << __HEREDOC__ #ifdef __cplusplus #error "Do not use C++. See the INSTALL file." #endif __HEREDOC__ [ ${NEED_GNU_SOURCE} -eq 0 ] || echo "#define _GNU_SOURCE" [ ${NEED_OPENBSD_SOURCE} -eq 0 ] || echo "#define _OPENBSD_SOURCE" [ ${HAVE_GETLINE} -eq 0 -o \ ${HAVE_REALLOCARRAY} -eq 0 -o ${HAVE_RECALLOCARRAY} -eq 0 -o \ ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 -o \ ${HAVE_STRNDUP} -eq 0 ] \ && echo "#include <sys/types.h>" [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include <stdarg.h>" [ ${HAVE_GETLINE} -eq 0 ] && echo "#include <stdio.h>" echo echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\"" echo "#define MANPATH_BASE \"${MANPATH_BASE}\"" echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\"" echo "#define OSENUM ${OSENUM}" [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\"" [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\"" [ -n "${READ_ALLOWED_PATH}" ] \ && echo "#define READ_ALLOWED_PATH \"${READ_ALLOWED_PATH}\"" [ ${HAVE_ATTRIBUTE} -eq 0 ] && echo "#define __attribute__(x)" [ ${HAVE_EFTYPE} -eq 0 ] && echo "#define EFTYPE EINVAL" [ ${HAVE_O_DIRECTORY} -eq 0 ] && echo "#define O_DIRECTORY 0" [ ${HAVE_PATH_MAX} -eq 0 ] && echo "#define PATH_MAX 4096" if [ ${HAVE_ENDIAN} -eq 0 -a ${HAVE_SYS_ENDIAN} -eq 0 ]; then echo "#define be32toh ntohl" echo "#define htobe32 htonl" fi cat << __HEREDOC__ #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN} #define HAVE_ENDIAN ${HAVE_ENDIAN} #define HAVE_ERR ${HAVE_ERR} #define HAVE_FTS ${HAVE_FTS} #define HAVE_FTS_COMPARE_CONST ${HAVE_FTS_COMPARE_CONST} #define HAVE_GETLINE ${HAVE_GETLINE} #define HAVE_GETSUBOPT ${HAVE_GETSUBOPT} #define HAVE_ISBLANK ${HAVE_ISBLANK} #define HAVE_LESS_T ${HAVE_LESS_T} #define HAVE_MKDTEMP ${HAVE_MKDTEMP} #define HAVE_MKSTEMPS ${HAVE_MKSTEMPS} #define HAVE_NTOHL ${HAVE_NTOHL} #define HAVE_PLEDGE ${HAVE_PLEDGE} #define HAVE_PROGNAME ${HAVE_PROGNAME} #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY} #define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY} #define HAVE_REWB_BSD ${HAVE_REWB_BSD} #define HAVE_REWB_SYSV ${HAVE_REWB_SYSV} #define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT} #define HAVE_STRCASESTR ${HAVE_STRCASESTR} #define HAVE_STRINGLIST ${HAVE_STRINGLIST} #define HAVE_STRLCAT ${HAVE_STRLCAT} #define HAVE_STRLCPY ${HAVE_STRLCPY} #define HAVE_STRNDUP ${HAVE_STRNDUP} #define HAVE_STRPTIME ${HAVE_STRPTIME} #define HAVE_STRSEP ${HAVE_STRSEP} #define HAVE_STRTONUM ${HAVE_STRTONUM} #define HAVE_SYS_ENDIAN ${HAVE_SYS_ENDIAN} #define HAVE_VASPRINTF ${HAVE_VASPRINTF} #define HAVE_WCHAR ${HAVE_WCHAR} #define HAVE_OHASH ${HAVE_OHASH} #define NEED_XPG4_2 ${NEED_XPG4_2} #define BINM_APROPOS "${BINM_APROPOS}" #define BINM_CATMAN "${BINM_CATMAN}" #define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}" #define BINM_MAN "${BINM_MAN}" #define BINM_SOELIM "${BINM_SOELIM}" #define BINM_WHATIS "${BINM_WHATIS}" #define BINM_PAGER "${BINM_PAGER}" __HEREDOC__ if [ ${HAVE_ERR} -eq 0 ]; then echo "extern void err(int, const char *, ...);" echo "extern void errx(int, const char *, ...);" echo "extern void warn(const char *, ...);" echo "extern void warnx(const char *, ...);" MANDOC_COBJS="${MANDOC_COBJS} compat_err.o" SOELIM_COBJS="${SOELIM_COBJS} compat_err.o" fi if [ ${HAVE_FTS} -eq 0 ]; then MANDOC_COBJS="${MANDOC_COBJS} compat_fts.o" fi if [ ${HAVE_GETLINE} -eq 0 ]; then echo "extern ssize_t getline(char **, size_t *, FILE *);" MANDOC_COBJS="${MANDOC_COBJS} compat_getline.o" SOELIM_COBJS="${SOELIM_COBJS} compat_getline.o" fi if [ ${HAVE_GETSUBOPT} -eq 0 ]; then echo "extern int getsubopt(char **, char * const *, char **);" MANDOC_COBJS="${MANDOC_COBJS} compat_getsubopt.o" fi if [ ${HAVE_ISBLANK} -eq 0 ]; then echo "extern int isblank(int);" MANDOC_COBJS="${MANDOC_COBJS} compat_isblank.o" fi if [ ${HAVE_MKDTEMP} -eq 0 ]; then echo "extern char *mkdtemp(char *);" MANDOC_COBJS="${MANDOC_COBJS} compat_mkdtemp.o" fi if [ ${HAVE_MKSTEMPS} -eq 0 ]; then echo "extern int mkstemps(char *, int);" MANDOC_COBJS="${MANDOC_COBJS} compat_mkstemps.o" fi if [ ${HAVE_OHASH} -eq 0 ]; then MANDOC_COBJS="${MANDOC_COBJS} compat_ohash.o" fi if [ ${HAVE_PROGNAME} -eq 0 ]; then echo "extern const char *getprogname(void);" echo "extern void setprogname(const char *);" MANDOC_COBJS="${MANDOC_COBJS} compat_progname.o" SOELIM_COBJS="${SOELIM_COBJS} compat_progname.o" fi if [ ${HAVE_REALLOCARRAY} -eq 0 ]; then echo "extern void *reallocarray(void *, size_t, size_t);" MANDOC_COBJS="${MANDOC_COBJS} compat_reallocarray.o" SOELIM_COBJS="${SOELIM_COBJS} compat_reallocarray.o" fi if [ ${HAVE_RECALLOCARRAY} -eq 0 ]; then echo "extern void *recallocarray(void *, size_t, size_t, size_t);" MANDOC_COBJS="${MANDOC_COBJS} compat_recallocarray.o" fi if [ ${HAVE_STRCASESTR} -eq 0 ]; then echo "extern char *strcasestr(const char *, const char *);" MANDOC_COBJS="${MANDOC_COBJS} compat_strcasestr.o" fi if [ ${HAVE_STRINGLIST} -eq 0 ]; then SOELIM_COBJS="${SOELIM_COBJS} compat_stringlist.o" fi if [ ${HAVE_STRLCAT} -eq 0 ]; then echo "extern size_t strlcat(char *, const char *, size_t);" MANDOC_COBJS="${MANDOC_COBJS} compat_strlcat.o" fi if [ ${HAVE_STRLCPY} -eq 0 ]; then echo "extern size_t strlcpy(char *, const char *, size_t);" MANDOC_COBJS="${MANDOC_COBJS} compat_strlcpy.o" fi if [ ${HAVE_STRNDUP} -eq 0 ]; then echo "extern char *strndup(const char *, size_t);" MANDOC_COBJS="${MANDOC_COBJS} compat_strndup.o" fi if [ ${HAVE_STRSEP} -eq 0 ]; then echo "extern char *strsep(char **, const char *);" MANDOC_COBJS="${MANDOC_COBJS} compat_strsep.o" fi if [ ${HAVE_STRTONUM} -eq 0 ]; then echo "extern long long strtonum(const char *, long long, long long, const char **);" MANDOC_COBJS="${MANDOC_COBJS} compat_strtonum.o" fi if [ ${HAVE_VASPRINTF} -eq 0 ]; then echo "extern int vasprintf(char **, const char *, va_list);" MANDOC_COBJS="${MANDOC_COBJS} compat_vasprintf.o" fi echo "file config.h: written" 1>&2 echo "file config.h: written" 1>&3 # --- tests for Makefile.local ----------------------------------------- exec > Makefile.local [ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin" [ -z "${SBINDIR}" ] && SBINDIR="${PREFIX}/sbin" [ -z "${BIN_FROM_SBIN}" ] && BIN_FROM_SBIN="../bin" [ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include/mandoc" [ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib/mandoc" [ -z "${MANDIR}" ] && MANDIR="${PREFIX}/man" [ -z "${HTDOCDIR}" ] && HTDOCDIR="${WWWPREFIX}/htdocs" [ -z "${CGIBINDIR}" ] && CGIBINDIR="${WWWPREFIX}/cgi-bin" [ -z "${INSTALL_PROGRAM}" ] && INSTALL_PROGRAM="${INSTALL} -m 0555" [ -z "${INSTALL_LIB}" ] && INSTALL_LIB="${INSTALL} -m 0444" [ -z "${INSTALL_MAN}" ] && INSTALL_MAN="${INSTALL} -m 0444" [ -z "${INSTALL_DATA}" ] && INSTALL_DATA="${INSTALL} -m 0444" BUILD_TARGETS= [ ${BUILD_CGI} -gt 0 ] && BUILD_TARGETS="man.cgi" [ ${BUILD_CATMAN} -gt 0 ] && \ BUILD_TARGETS="${BUILD_TARGETS} mandocd catman" INSTALL_TARGETS= [ ${INSTALL_LIBMANDOC} -gt 0 ] && INSTALL_TARGETS="lib-install" [ ${BUILD_CGI} -gt 0 ] && INSTALL_TARGETS="${INSTALL_TARGETS} cgi-install" [ ${BUILD_CATMAN} -gt 0 ] && \ INSTALL_TARGETS="${INSTALL_TARGETS} catman-install" cat << __HEREDOC__ BUILD_TARGETS = ${BUILD_TARGETS} INSTALL_TARGETS = ${INSTALL_TARGETS} AR = ${AR} CC = ${CC} CFLAGS = ${CFLAGS} LDADD = ${LDADD} LDFLAGS = ${LDFLAGS} MANDOC_COBJS = ${MANDOC_COBJS} SOELIM_COBJS = ${SOELIM_COBJS} STATIC = ${STATIC} PREFIX = ${PREFIX} BINDIR = ${BINDIR} SBINDIR = ${SBINDIR} BIN_FROM_SBIN = ${BIN_FROM_SBIN} INCLUDEDIR = ${INCLUDEDIR} LIBDIR = ${LIBDIR} MANDIR = ${MANDIR} WWWPREFIX = ${WWWPREFIX} HTDOCDIR = ${HTDOCDIR} CGIBINDIR = ${CGIBINDIR} BINM_APROPOS = ${BINM_APROPOS} BINM_CATMAN = ${BINM_CATMAN} BINM_MAKEWHATIS = ${BINM_MAKEWHATIS} BINM_MAN = ${BINM_MAN} BINM_SOELIM = ${BINM_SOELIM} BINM_WHATIS = ${BINM_WHATIS} MANM_MAN = ${MANM_MAN} MANM_MANCONF = ${MANM_MANCONF} MANM_MDOC = ${MANM_MDOC} MANM_ROFF = ${MANM_ROFF} MANM_EQN = ${MANM_EQN} MANM_TBL = ${MANM_TBL} INSTALL = ${INSTALL} INSTALL_PROGRAM = ${INSTALL_PROGRAM} INSTALL_LIB = ${INSTALL_LIB} INSTALL_MAN = ${INSTALL_MAN} INSTALL_DATA = ${INSTALL_DATA} LN = ${LN} __HEREDOC__ echo "file Makefile.local: written" 1>&2 echo "file Makefile.local: written" 1>&3 exit 0 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/configure.local.example���������������������������������������������������������������0100644�0001753�0001753�00000030673�14123140553�0020007�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id: configure.local.example,v 1.43 2021/09/20 13:25:42 schwarze Exp $ # # Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # For all settings documented in this file, there are reasonable # defaults and/or the ./configure script attempts autodetection. # Consequently, you only need to create a file ./configure.local # and put any of these settings into it if ./configure autodetection # fails or if you want to make different choices for other reasons. # If autodetection fails, please tell <tech@mandoc.bsd.lv>. # We recommend that you write ./configure.local from scratch and # only put the lines there you need. This file contains examples. # It is not intended as a template to be copied as a whole. # --- user settings relevant for all builds ---------------------------- # By default, "cc" is used as the C compiler, but it can be overridden. # For example, the system compiler in SunOS 5.9 may not provide <stdint.h>, # which may require this line: CC=gcc # IBM AIX may need: CC=xlc # By default, "ar" is used as the library archive builder, but it # can be overridden. For example, NixOS may not have ar(1) in the # PATH, but may want to specify an absolute path instead. AR=ar # For -Tutf8 and -Tlocale operation, mandoc(1) requires <locale.h> # providing setlocale(3) and <wchar.h> providing wcwidth(3) and # putwchar(3) with a wchar_t storing UCS-4 values. Theoretically, # the latter should be tested with the __STDC_ISO_10646__ feature # macro. In practice, many <wchar.h> headers do not provide that # macro even though they treat wchar_t as UCS-4. So the automatic # test only checks that wchar_t is wide enough, that is, at least # four bytes. # The following line forces multi-byte support. # If your C library does not treat wchar_t as UCS-4, the UTF-8 output # mode will print garbage. HAVE_WCHAR=1 # The following line disables multi-byte support. # The output modes -Tutf8 and -Tlocale will be the same as -Tascii. HAVE_WCHAR=0 # For -Tutf8 mode, mandoc needs to set an arbitrary locale having # a UTF-8 character set. If autodetection of a suitable locale # fails or selects an undesirable locale, you can manually choose # the locale for -Tutf8 mode: UTF8_LOCALE=en_US.UTF-8 # When man(1) or apropos(1) is called without -m and -M options, # MANPATH is not set in the environment, and man.conf(5) is not # available, manuals are searched for in the following directory # trees by default. MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" # Validation of cross references with mandoc -Tlint only looks # for manual pages in the following directories: MANPATH_BASE="/usr/share/man:/usr/X11R6/man" # When man(1) is called with the -S option and no manual page is # found matching the requested name and the requested architecture, # it tries to figure out whether the requested architecture is valid # for the present operating system. Normally, ./configure detects # the operating system using uname(1). If that fails or is not # desired, either of the following lines can be used: OSENUM=MANDOC_OS_NETBSD OSENUM=MANDOC_OS_OPENBSD OSENUM=MANDOC_OS_OTHER # In manual pages written in the mdoc(7) language, the operating system # version is displayed in the page footer line. If an operating system # is specified as an argument to the .Os macro, that is always used. # If the .Os macro has no argument and an operation system is specified # with the mandoc(1) -Ios= command line option, that is used. # Otherwise, the uname(3) library function is called at runtime to find # the name of the operating system. # If you do not want uname(3) to be called but instead want a fixed # string to be used, use the following line: OSNAME="OpenBSD 7.0" # The following installation directories are used. # It is possible to set only one or a few of these variables, # there is no need to copy the whole block. # Even if you set PREFIX to something else, the other variables # pick it up without copying them all over. PREFIX="/usr/local" BINDIR="${PREFIX}/bin" SBINDIR="${PREFIX}/sbin" MANDIR="${PREFIX}/man" # If BINDIR and SBINDIR are not subdirectories of the same parent # directory or if the basename(1) of BINDIR differs from "bin", # the relative path from SBINDIR to BINDIR is also needed. # The default is: BIN_FROM_SBIN="../bin" # Some distributions may want to avoid naming conflicts # with the configuration files of other man(1) implementations. # This changes the name of the installed section 5 manual page as well. MANM_MANCONF="mandoc.conf" # default is "man.conf" # Some distributions may want to avoid naming conflicts among manuals. # If you want to change the names of installed section 7 manual pages, # the following alternative names are suggested. # The suffix ".7" will automatically be appended. # It is possible to set only one or a few of these variables, # there is no need to copy the whole block. MANM_MAN="mandoc_man" # default is "man" MANM_MDOC="mandoc_mdoc" # default is "mdoc" MANM_ROFF="mandoc_roff" # default is "roff" MANM_EQN="mandoc_eqn" # default is "eqn" MANM_TBL="mandoc_tbl" # default is "tbl" # Some distributions may want to avoid naming conflicts with # other man(1), apropos(1), makewhatis(8), or soelim(1) utilities. # If you want to change the names of binary programs, # the following alternative names are suggested. # Using different names is possible as well. # This changes the names of the installed section 1 and section 8 # manual pages as well. # It is possible to set only one or two of these variables, # there is no need to copy the whole block. BINM_MAN=mman # default is "man" BINM_APROPOS=mapropos # default is "apropos" BINM_WHATIS=mwhatis # default is "whatis" BINM_MAKEWHATIS=mandocdb # default is "makewhatis" BINM_SOELIM=msoelim # default is "soelim" # If less(1) is available, it is used as the default manual pager. # Otherwise, more(1) is used: its existence is required by POSIX. # It is possible to force using a different default pager, either # by giving the name of a program found in the PATH, or by giving # an absolute path. BINM_PAGER=pg # default is "less" or "more" # Some distributions do not want hardlinks # between installed binary programs. # Set the following variable to use symbolic links instead. # It is also used for links between manual pages. # It is only used by the install* targets. # When using this, DESTDIR must be empty or an absolute path. LN="ln -sf" # default is "ln -f" # Before falling back to the bundled version of the ohash(3) hashing # library, autoconfiguration tries the following linker flag to # link against your system version. If you do have ohash(3) on # your system but it needs different linker flags, set the following # variable to specify the required linker flags. LD_OHASH="-lutil" # Some platforms may need an additional linker flag for nanosleep(2). # If none is needed or it is -lrt, it is autodetected. # Otherwise, set the following variable. LD_NANOSLEEP="-lrt" # Some platforms may need an additional linker flag for recvmsg(2). # If none is needed or it is -lsocket, it is autodetected. # Otherwise, set the following variable. LD_RECVMSG="-lsocket" # Some platforms might need additional linker flags to link against # libmandoc that are not autodetected, though no such cases are # currently known. LDADD="-lm" # Some systems may want to set additional linker flags for all the # binaries, not only for those using libmandoc, for example for # hardening options. LDFLAGS="-Wl,-z,relro" # It is possible to change the utility program used for installation # and the modes files are installed with. The defaults are: INSTALL="install" INSTALL_PROGRAM="${INSTALL} -m 0555" INSTALL_LIB="${INSTALL} -m 0444" INSTALL_MAN="${INSTALL} -m 0444" INSTALL_DATA="${INSTALL} -m 0444" # By default, makewhatis(8) can only read from the paths passed on the # command line or configured in man.conf(5). # But some package managers on some operating systems store manual pages # in separate "cellar" or "store" directories and only symlink them # into the manual trees. # To support one or more such package managers, give makewhatis(8) # read access to the cellars and stores on your system, in the form # of a colon-separated path: # Homebrow package manager on Mac OS X: PREFIX="/usr/local" READ_ALLOWED_PATH="${PREFIX}/Cellar" # Nix package manager and/or NixOS Linux distribution: READ_ALLOWED_PATH="/nix/store" # GNU Guix package manager and/or GNU Guix Linux distribution: READ_ALLOWED_PATH="/gnu/store" # If multiple package managers are used concurrently: PREFIX="/usr/local" READ_ALLOWED_PATH="/nix/store:${PREFIX}/Cellar" # --- user settings for the mandoc(3) library -------------------------- # By default, libmandoc.a is not installed. It is almost never needed # because there is almost no non-mandoc software out there using this # library. The one notable exception is NetBSD apropos(1). # So, when building for the NetBSD base system - but not for NetBSD # ports nor for pkgsrc! - you may want the following: INSTALL_LIBMANDOC=1 # The following settings are only used when INSTALL_LIBMANDOC is set. INCLUDEDIR="${PREFIX}/include/mandoc" LIBDIR="${PREFIX}/lib/mandoc" # --- user settings related to man.cgi --------------------------------- # By default, building man.cgi(8) is disabled. To enable it, copy # cgi.h.example to cgi.h, edit it, and use the following line. BUILD_CGI=1 # The remaining settings in this section are only relevant if BUILD_CGI # is enabled. Otherwise, they have no effect either way. # By default, man.cgi(8) is linked statically if the compiler supports # the -static option. If automatic detection fails, you can force # static linking of man.cgi(8). STATIC="-static" # Some systems may require -pthread for static linking: STATIC="-static -pthread" # If static linking works in general but not with additional libraries # like -lrt or -lz, you can force dynamic linking. This may for # example be required on SunOS 5.9. STATIC=" " # Some directories. # This works just like PREFIX, see above. WWWPREFIX="/var/www" HTDOCDIR="${WWWPREFIX}/htdocs" CGIBINDIR="${WWWPREFIX}/cgi-bin" # --- user settings related to catman ---------------------------------- # By default, building mandocd(8) and catman(8) is disabled. # To enable it, use the following line. # It does not work on SunOS 5.10 because there is no mkdirat(2) # nor on SunOS 5.9 which also lacks CMSG_LEN(3) and CMSG_SPACE(3). # It may not work on old releases of Mac OS X either. For example, # Mac OS X 10.4 Tiger provides neither mkdirat(2) nor openat(2). BUILD_CATMAN=1 # Install catman(8) with a different name. # See BINM_MAN above for details of how this works. BINM_CATMAN=mcatman # default is "catman" # --- settings that rarely need to be touched -------------------------- # Do not set these variables unless you really need to. # Normally, leave CFLAGS unset. In that case, -g will automatically # be used, and various -W options will be added if the compiler # supports them. If you define CFLAGS manually, it will be used # unchanged, and nothing will be added. CFLAGS="-g" # In rare cases, it may be required to skip individual automatic tests. # Each of the following variables can be set to 0 (test will not be run # and will be regarded as failed) or 1 (test will not be run and will # be regarded as successful). HAVE_ATTRIBUTE=0 HAVE_DIRENT_NAMLEN=0 HAVE_ENDIAN=0 HAVE_EFTYPE=0 HAVE_ERR=0 HAVE_FTS=0 # Setting this implies HAVE_FTS_COMPARE_CONST=0. HAVE_FTS_COMPARE_CONST=0 # Setting this implies HAVE_FTS=1. HAVE_GETLINE=0 HAVE_GETSUBOPT=0 HAVE_ISBLANK=0 HAVE_LESS_T=0 HAVE_MKDTEMP=0 HAVE_NTOHL=0 HAVE_O_DIRECTORY=0 HAVE_OHASH=0 HAVE_PATH_MAX=0 HAVE_PLEDGE=0 HAVE_PROGNAME=0 HAVE_REALLOCARRAY=0 HAVE_RECALLOCARRAY=0 HAVE_REWB_BSD=0 HAVE_REWB_SYSV=0 HAVE_STRCASESTR=0 HAVE_STRINGLIST=0 HAVE_STRLCAT=0 HAVE_STRLCPY=0 HAVE_STRPTIME=0 HAVE_STRSEP=0 HAVE_STRTONUM=0 HAVE_SYS_ENDIAN=0 HAVE_VASPRINTF=0 HAVE_WCHAR=0 ���������������������������������������������������������������������mandoc-1.14.6/dba.h���������������������������������������������������������������������������������0100644�0001753�0001753�00000003351�14123140553�0014250�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: dba.h,v 1.2 2016/08/17 20:46:56 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Public interface of the allocation-based version * of the mandoc database, for read-write access. * To be used by dba.c, dba_read.c, and makewhatis(8). */ #define DBP_NAME 0 #define DBP_SECT 1 #define DBP_ARCH 2 #define DBP_DESC 3 #define DBP_FILE 4 #define DBP_MAX 5 struct dba_array; struct dba { struct dba_array *pages; struct dba_array *macros; }; struct dba *dba_new(int32_t); void dba_free(struct dba *); struct dba *dba_read(const char *); int dba_write(const char *, struct dba *); struct dba_array *dba_page_new(struct dba_array *, const char *, const char *, const char *, enum form); void dba_page_add(struct dba_array *, int32_t, const char *); void dba_page_alias(struct dba_array *, const char *, uint64_t); void dba_macro_new(struct dba *, int32_t, const char *, const int32_t *); void dba_macro_add(struct dba_array *, int32_t, const char *, struct dba_array *); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/dba_array.h���������������������������������������������������������������������������0100644�0001753�0001753�00000004005�14123140553�0015443�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: dba_array.h,v 1.1 2016/07/19 21:31:55 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Public interface for allocation-based arrays * for the mandoc database, for read-write access. * To be used by dba*.c and by makewhatis(8). */ struct dba_array; #define DBA_STR 0x01 /* Map contains strings, not pointers. */ #define DBA_GROW 0x02 /* Allow the array to grow. */ #define dba_array_FOREACH(a, e) \ dba_array_start(a); \ while (((e) = dba_array_next(a)) != NULL) typedef int dba_compare_func(const void *, const void *); struct dba_array *dba_array_new(int32_t, int); void dba_array_free(struct dba_array *); void dba_array_set(struct dba_array *, int32_t, void *); void dba_array_add(struct dba_array *, void *); void *dba_array_get(struct dba_array *, int32_t); void dba_array_start(struct dba_array *); void *dba_array_next(struct dba_array *); void dba_array_del(struct dba_array *); void dba_array_undel(struct dba_array *); void dba_array_setpos(struct dba_array *, int32_t, int32_t); int32_t dba_array_getpos(struct dba_array *); void dba_array_sort(struct dba_array *, dba_compare_func); int32_t dba_array_writelen(struct dba_array *, int32_t); void dba_array_writepos(struct dba_array *); void dba_array_writelst(struct dba_array *); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/dba_write.h���������������������������������������������������������������������������0100644�0001753�0001753�00000002350�14123140553�0015460�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: dba_write.h,v 1.1 2016/07/19 21:31:55 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Internal interface to low-level functions * for serializing allocation-based data to disk. * For use by dba_array.c and dba.c only. */ int dba_open(const char *); int dba_close(void); int32_t dba_tell(void); void dba_seek(int32_t); int32_t dba_align(void); int32_t dba_skip(int32_t, int32_t); void dba_char_write(int); void dba_str_write(const char *); void dba_int_write(int32_t); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/dbm.h���������������������������������������������������������������������������������0100644�0001753�0001753�00000003705�14123140553�0014267�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: dbm.h,v 1.1 2016/07/19 21:31:55 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Public interface for the map-based version * of the mandoc database, for read-only access. * To be used by dbm*.c, dba_read.c, and man(1) and apropos(1). */ enum dbm_mtype { DBM_EXACT = 0, DBM_SUB, DBM_REGEX }; struct dbm_match { regex_t *re; const char *str; enum dbm_mtype type; }; struct dbm_res { int32_t page; int32_t bits; }; struct dbm_page { const char *name; const char *sect; const char *arch; const char *desc; const char *file; int32_t addr; }; struct dbm_macro { const char *value; const int32_t *pp; }; int dbm_open(const char *); void dbm_close(void); int32_t dbm_page_count(void); struct dbm_page *dbm_page_get(int32_t); void dbm_page_byname(const struct dbm_match *); void dbm_page_bysect(const struct dbm_match *); void dbm_page_byarch(const struct dbm_match *); void dbm_page_bydesc(const struct dbm_match *); void dbm_page_bymacro(int32_t, const struct dbm_match *); struct dbm_res dbm_page_next(void); int32_t dbm_macro_count(int32_t); struct dbm_macro *dbm_macro_get(int32_t, int32_t); void dbm_macro_bypage(int32_t, int32_t); char *dbm_macro_next(void); �����������������������������������������������������������mandoc-1.14.6/dbm_map.h�����������������������������������������������������������������������������0100644�0001753�0001753�00000002315�14123140553�0015120�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: dbm_map.h,v 1.2 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Private interface for low-level routines for the map-based version * of the mandoc database, for read-only access. * To be used by dbm*.c only. */ struct dbm_match; int dbm_map(const char *); void dbm_unmap(void); void *dbm_get(int32_t); int32_t *dbm_getint(int32_t); int32_t dbm_addr(const void *); int dbm_match(const struct dbm_match *, const char *); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/demandoc.1����������������������������������������������������������������������������0100644�0001753�0001753�00000005223�14123140553�0015205�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: demandoc.1,v 1.8 2014/09/12 00:10:26 schwarze Exp $ .\" .\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: September 12 2014 $ .Dt DEMANDOC 1 .Os .Sh NAME .Nm demandoc .Nd emit only text of UNIX manuals .Sh SYNOPSIS .Nm demandoc .Op Fl w .Op Ar .Sh DESCRIPTION The .Nm utility emits only the text portions of well-formed .Xr mdoc 7 and .Xr man 7 .Ux manual files. .Pp By default, .Nm parses standard input and outputs only text nodes, preserving line and column position. Escape sequences are omitted from the output. .Pp Its arguments are as follows: .Bl -tag -width Ds .It Fl w Output a word list. This outputs each word of text on its own line. A .Qq word , in this case, refers to whitespace-delimited terms beginning with at least two letters and not consisting of any escape sequences. Words have their leading and trailing punctuation .Pq double-quotes, sentence punctuation, etc. stripped. .It Ar The input files. .El .Pp If a document is not well-formed, it is skipped. .Pp The .Fl i , .Fl k , .Fl m , and .Fl p flags are silently discarded for calling compatibility with the historical deroff. .Sh EXIT STATUS The .Nm utility exits with one of the following values: .Pp .Bl -tag -width Ds -compact .It 0 No errors occurred. .It 6 An operating system error occurred, for example memory exhaustion or an error accessing input files. Such errors cause .Nm to exit at once, possibly in the middle of parsing or formatting a file. The output databases are corrupt and should be removed . .El .Sh EXAMPLES The traditional usage of .Nm is for spell-checking manuals on .Bx . This is accomplished as follows (assuming British spelling): .Pp .Dl $ demandoc -w file.1 | spell -b .Sh SEE ALSO .Xr mandoc 1 , .Xr man 7 , .Xr mdoc 7 .Sh HISTORY .Nm replaces the historical deroff utility for handling modern .Xr man 7 and .Xr mdoc 7 documents. .Sh AUTHORS The .Nm utility was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/eqn.7���������������������������������������������������������������������������������0100644�0001753�0001753�00000031076�14123140553�0014231�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: eqn.7,v 1.39 2020/01/10 11:55:04 schwarze Exp $ .\" .\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: January 10 2020 $ .Dt EQN 7 .Os .Sh NAME .Nm eqn .Nd eqn language reference for mandoc .Sh DESCRIPTION The .Nm eqn language is an equation-formatting language. It is used within .Xr mdoc 7 and .Xr man 7 .Ux manual pages. It describes the .Em structure of an equation, not its mathematical meaning. This manual describes the .Nm language accepted by the .Xr mandoc 1 utility, which corresponds to the Second Edition .Nm specification (see .Sx SEE ALSO for references). .Pp An equation starts with an input line containing exactly the characters .Sq \&.EQ , may contain multiple input lines, and ends with an input line containing exactly the characters .Sq \&.EN . Equivalently, an equation can be given in the middle of a single text input line by surrounding it with the equation delimiters defined with the .Cm delim statement. .Pp The equation grammar is as follows, where quoted strings are case-sensitive literals in the input: .Bd -literal -offset indent eqn : box | eqn box box : text | \(dq{\(dq eqn \(dq}\(dq | \(dqdefine\(dq text text | \(dqndefine\(dq text text | \(dqtdefine\(dq text text | \(dqgfont\(dq text | \(dqgsize\(dq text | \(dqset\(dq text text | \(dqundef\(dq text | \(dqsqrt\(dq box | box pos box | box mark | \(dqmatrix\(dq \(dq{\(dq [col \(dq{\(dq list \(dq}\(dq]* \(dq}\(dq | pile \(dq{\(dq list \(dq}\(dq | font box | \(dqsize\(dq text box | \(dqleft\(dq text eqn [\(dqright\(dq text] col : \(dqlcol\(dq | \(dqrcol\(dq | \(dqccol\(dq | \(dqcol\(dq text : [^space\e\(dq]+ | \e\(dq.*\e\(dq pile : \(dqlpile\(dq | \(dqcpile\(dq | \(dqrpile\(dq | \(dqpile\(dq pos : \(dqover\(dq | \(dqsup\(dq | \(dqsub\(dq | \(dqto\(dq | \(dqfrom\(dq mark : \(dqdot\(dq | \(dqdotdot\(dq | \(dqhat\(dq | \(dqtilde\(dq | \(dqvec\(dq | \(dqdyad\(dq | \(dqbar\(dq | \(dqunder\(dq font : \(dqroman\(dq | \(dqitalic\(dq | \(dqbold\(dq | \(dqfat\(dq list : eqn | list \(dqabove\(dq eqn space : [\e^~ \et] .Ed .Pp White-space consists of the space, tab, circumflex, and tilde characters. It is required to delimit tokens consisting of alphabetic characters and it is ignored at other places. Braces and quotes also delimit tokens. If within a quoted string, these space characters are retained. Quoted strings are also not scanned for keywords, glyph names, and expansion of definitions. To print a literal quote character, it can be prepended with a backslash or expressed with the \e(dq escape sequence. .Pp Subequations can be enclosed in braces to pass them as arguments to operation keywords, overriding standard operation precedence. Braces can be nested. To set a brace verbatim, it needs to be enclosed in quotes. .Pp The following text terms are translated into a rendered glyph, if available: alpha, beta, chi, delta, epsilon, eta, gamma, iota, kappa, lambda, mu, nu, omega, omicron, phi, pi, psi, rho, sigma, tau, theta, upsilon, xi, zeta, DELTA, GAMMA, LAMBDA, OMEGA, PHI, PI, PSI, SIGMA, THETA, UPSILON, XI, inter (intersection), union (union), prod (product), int (integral), sum (summation), grad (gradient), del (vector differential), times (multiply), cdot (center-dot), nothing (zero-width space), approx (approximately equals), prime (prime), half (one-half), partial (partial differential), inf (infinity), >> (much greater), << (much less), <\- (left arrow), \-> (right arrow), +\- (plus-minus), != (not equal), == (equivalence), <= (less-than-equal), and >= (more-than-equal). The character escape sequences documented in .Xr mandoc_char 7 can be used, too. .Pp The following control statements are available: .Bl -tag -width Ds .It Cm define Replace all occurrences of a key with a value. Its syntax is as follows: .Pp .D1 Cm define Ar key cvalc .Pp The first character of the value string, .Ar c , is used as the delimiter for the value .Ar val . This allows for arbitrary enclosure of terms (not just quotes), such as .Pp .D1 Cm define Ar foo \(aqbar baz\(aq .D1 Cm define Ar foo cbar bazc .Pp It is an error to have an empty .Ar key or .Ar val . Note that a quoted .Ar key causes errors in some .Nm implementations and should not be considered portable. It is not expanded for replacements. Definitions may refer to other definitions; these are evaluated recursively when text replacement occurs and not when the definition is created. .Pp Definitions can create arbitrary strings, for example, the following is a legal construction. .Bd -literal -offset indent define foo \(aqdefine\(aq foo bar \(aqbaz\(aq .Ed .Pp Self-referencing definitions will raise an error. The .Cm ndefine statement is a synonym for .Cm define , while .Cm tdefine is discarded. .It Cm delim This statement takes a string argument consisting of two bytes, to be used as the opening and closing delimiters for equations in the middle of text input lines. Conventionally, the dollar sign is used for both delimiters, as follows: .Bd -literal -offset indent \&.EQ delim $$ \&.EN An equation like $sin pi = 0$ can now be entered in the middle of a text input line. .Ed .Pp The special statement .Cm delim off temporarily disables previously declared delimiters and .Cm delim on reenables them. .It Cm gfont Set the default font of subsequent output. Its syntax is as follows: .Pp .D1 Cm gfont Ar font .Pp In mandoc, this value is discarded. .It Cm gsize Set the default size of subsequent output. Its syntax is as follows: .Pp .D1 Cm gsize Oo +|\- Oc Ns Ar size .Pp The .Ar size value should be an integer. If prepended by a sign, the font size is changed relative to the current size. .It Cm set Set an equation mode. In mandoc, both arguments are thrown away. Its syntax is as follows: .Pp .D1 Cm set Ar key val .Pp The .Ar key and .Ar val are not expanded for replacements. This statement is a GNU extension. .It Cm undef Unset a previously-defined key. Its syntax is as follows: .Pp .D1 Cm define Ar key .Pp Once invoked, the definition for .Ar key is discarded. The .Ar key is not expanded for replacements. This statement is a GNU extension. .El .Pp Operation keywords have the following semantics: .Bl -tag -width Ds .It Cm above See .Cm pile . .It Cm bar Draw a line over the preceding box. .It Cm bold Set the following box using bold font. .It Cm ccol Like .Cm cpile , but for use in .Cm matrix . .It Cm cpile Like .Cm pile , but with slightly increased vertical spacing. .It Cm dot Set a single dot over the preceding box. .It Cm dotdot Set two dots (dieresis) over the preceding box. .It Cm dyad Set a dyad symbol (left-right arrow) over the preceding box. .It Cm fat A synonym for .Cm bold . .It Cm font Set the second argument using the font specified by the first argument; currently not recognized by the .Xr mandoc 1 .Nm parser. .It Cm from Set the following box below the preceding box, using a slightly smaller font. Used for sums, integrals, limits, and the like. .It Cm hat Set a hat (circumflex) over the preceding box. .It Cm italic Set the following box using italic font. .It Cm lcol Like .Cm lpile , but for use in .Cm matrix . .It Cm left Set the first argument as a big left delimiter before the second argument. As an optional third argument, .Cm right can follow. In that case, the fourth argument is set as a big right delimiter after the second argument. .It Cm lpile Like .Cm cpile , but subequations are left-justified. .It Cm matrix Followed by a list of columns enclosed in braces. All columns need to have the same number of subequations. The columns are set as a matrix. The difference compared to multiple subsequent .Cm pile operators is that in a .Cm matrix , corresponding subequations in all columns line up horizontally, while each .Cm pile does vertical spacing independently. .It Cm over Set a fraction. The preceding box is the numerator, the following box is the denominator. .It Cm pile Followed by a list of subequations enclosed in braces, the subequations being separated by .Cm above keywords. Sets the subequations one above the other, each of them centered. Typically used to represent vectors in coordinate representation. .It Cm rcol Like .Cm rpile , but for use in .Cm matrix . .It Cm right See .Cm left ; .Cm right cannot be used without .Cm left . To set a big right delimiter without a big left delimiter, the following construction can be used: .Pp .D1 Cm left No \(dq\(dq Ar box Cm right Ar delimiter .It Cm roman Set the following box using the default font. .It Cm rpile Like .Cm cpile , but subequations are right-justified. .It Cm size Set the second argument with the font size specified by the first argument; currently ignored by .Xr mandoc 1 . By prepending a plus or minus sign to the first argument, the font size can be selected relative to the current size. .It Cm sqrt Set the square root of the following box. .It Cm sub Set the following box as a subscript to the preceding box. .It Cm sup Set the following box as a superscript to the preceding box. As a special case, if a .Cm sup clause immediately follows a .Cm sub clause as in .Pp .D1 Ar mainbox Cm sub Ar subbox Cm sup Ar supbox .Pp both are set with respect to the same .Ar mainbox , that is, .Ar supbox is set above .Ar subbox . .It Cm tilde Set a tilde over the preceding box. .It Cm to Set the following box above the preceding box, using a slightly smaller font. Used for sums and integrals and the like. As a special case, if a .Cm to clause immediately follows a .Cm from clause as in .Pp .D1 Ar mainbox Cm from Ar frombox Cm to Ar tobox .Pp both are set below and above the same .Ar mainbox . .It Cm under Underline the preceding box. .It Cm vec Set a vector symbol (right arrow) over the preceding box. .El .Pp The binary operations .Cm from , .Cm to , .Cm sub , and .Cm sup group to the right, that is, .Pp .D1 Ar mainbox Cm sup Ar supbox Cm sub Ar subbox .Pp is the same as .Pp .D1 Ar mainbox Cm sup Brq Ar supbox Cm sub Ar subbox .Pp and different from .Pp .D1 Bro Ar mainbox Cm sup Ar supbox Brc Cm sub Ar subbox . .Pp By contrast, .Cm over groups to the left. .Pp In the following list, earlier operations bind more tightly than later operations: .Pp .Bl -enum -compact .It .Cm dyad , .Cm vec , .Cm under , .Cm bar , .Cm tilde , .Cm hat , .Cm dot , .Cm dotdot .It .Cm fat , .Cm roman , .Cm italic , .Cm bold , .Cm size .It .Cm sub , .Cm sup .It .Cm sqrt .It .Cm over .It .Cm from , .Cm to .El .Sh COMPATIBILITY This section documents the compatibility of mandoc .Nm and the troff .Nm implementation (including GNU troff). .Pp .Bl -dash -compact .It The text string .Sq \e\(dq is interpreted as a literal quote in troff. In mandoc, this is interpreted as a comment. .It In troff, The circumflex and tilde white-space symbols map to fixed-width spaces. In mandoc, these characters are synonyms for the space character. .It The troff implementation of .Nm allows for equation alignment with the .Cm mark and .Cm lineup tokens. mandoc discards these tokens. The .Cm back Ar n , .Cm fwd Ar n , .Cm up Ar n , and .Cm down Ar n commands are also ignored. .El .Sh SEE ALSO .Xr mandoc 1 , .Xr man 7 , .Xr mandoc_char 7 , .Xr mdoc 7 , .Xr roff 7 .Rs .%A Brian W. Kernighan .%A Lorinda L. Cherry .%T System for Typesetting Mathematics .%J Communications of the ACM .%V 18 .%P pp. 151\(en157 .%D March, 1975 .Re .Rs .%A Brian W. Kernighan .%A Lorinda L. Cherry .%T Typesetting Mathematics, User's Guide .%D 1976 .Re .Rs .%A Brian W. Kernighan .%A Lorinda L. Cherry .%T Typesetting Mathematics, User's Guide (Second Edition) .%D 1978 .Re .Sh HISTORY The eqn utility, a preprocessor for troff, was originally written by Brian W. Kernighan and Lorinda L. Cherry in 1975. The GNU reimplementation of eqn, part of the GNU troff package, was released in 1989 by James Clark. The eqn component of .Xr mandoc 1 was added in 2011. .Sh AUTHORS This .Nm reference was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/eqn.h���������������������������������������������������������������������������������0100644�0001753�0001753�00000004306�14123140553�0014306�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: eqn.h,v 1.1 2018/12/13 05:23:38 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Public data types for eqn(7) syntax trees. */ enum eqn_boxt { EQN_TEXT, /* Text, e.g. number, variable, operator, ... */ EQN_SUBEXPR, /* Nested eqn(7) subexpression. */ EQN_LIST, /* List, for example in braces. */ EQN_PILE, /* Vertical pile. */ EQN_MATRIX /* List of columns. */ }; enum eqn_fontt { EQNFONT_NONE = 0, EQNFONT_ROMAN, EQNFONT_BOLD, EQNFONT_FAT, EQNFONT_ITALIC, EQNFONT__MAX }; enum eqn_post { EQNPOS_NONE = 0, EQNPOS_SUP, EQNPOS_SUBSUP, EQNPOS_SUB, EQNPOS_TO, EQNPOS_FROM, EQNPOS_FROMTO, EQNPOS_OVER, EQNPOS_SQRT, EQNPOS__MAX }; /* * A "box" is a parsed mathematical expression as defined by the eqn.7 * grammar. */ struct eqn_box { struct eqn_box *parent; struct eqn_box *prev; struct eqn_box *next; struct eqn_box *first; /* First child node. */ struct eqn_box *last; /* Last child node. */ char *text; /* Text (or NULL). */ char *left; /* Left-hand fence. */ char *right; /* Right-hand fence. */ char *top; /* Symbol above. */ char *bottom; /* Symbol below. */ size_t expectargs; /* Maximal number of arguments. */ size_t args; /* Actual number of arguments. */ int size; /* Font size. */ #define EQN_DEFSIZE INT_MIN enum eqn_boxt type; /* Type of node. */ enum eqn_fontt font; /* Font in this box. */ enum eqn_post pos; /* Position of the next box. */ }; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/eqn_parse.h���������������������������������������������������������������������������0100644�0001753�0001753�00000003727�14123140553�0015506�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: eqn_parse.h,v 1.3 2018/12/14 06:33:14 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * External interface of the eqn(7) parser. * For use in the roff(7) and eqn(7) parsers only. */ struct roff_node; struct eqn_box; struct eqn_def; struct eqn_node { struct roff_node *node; /* Syntax tree of this equation. */ struct eqn_def *defs; /* Array of definitions. */ char *data; /* Source code of this equation. */ char *start; /* First byte of the current token. */ char *end; /* First byte of the next token. */ size_t defsz; /* Number of definitions. */ size_t sz; /* Length of the source code. */ size_t toksz; /* Length of the current token. */ int gsize; /* Default point size. */ int delim; /* In-line delimiters enabled. */ char odelim; /* In-line opening delimiter. */ char cdelim; /* In-line closing delimiter. */ }; struct eqn_node *eqn_alloc(void); struct eqn_box *eqn_box_new(void); void eqn_box_free(struct eqn_box *); void eqn_free(struct eqn_node *); void eqn_parse(struct eqn_node *); void eqn_read(struct eqn_node *, const char *); void eqn_reset(struct eqn_node *); �����������������������������������������mandoc-1.14.6/gmdiff��������������������������������������������������������������������������������0100644�0001753�0001753�00000003362�14123140553�0014532�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. if [ `id -u` -eq 0 ]; then echo "$0: do not run me as root" exit 1 fi if [ $# -eq 0 ]; then echo "usage: $0 [-h|-u] manual_source_file ..." exit 1 fi if [ "X$1" = "X-h" ]; then shift export PATH="/usr/local/heirloom-doctools/bin:$PATH" EQN="neqn" ROFF="nroff" MOPT="-Ios=BSD -Tascii $MOPT" COLPIPE="col -b" elif [ "X$1" = "X-u" ]; then shift ROFF="groff -ket -ww -Tutf8 -P -c" MOPT="-Ios=OpenBSD -Wall -Tutf8 $MOPT" COLPIPE="cat" else ROFF="groff -ket -ww -mtty-char -Tascii -P -c" MOPT="-Ios=OpenBSD -Wall -Tascii $MOPT" COLPIPE="cat" fi while [ -n "$1" ]; do file=$1 shift echo " ========== $file ========== " $ROFF -mandoc $file | $COLPIPE 2> /tmp/roff.err > /tmp/roff.out ${MANDOC:=mandoc} $MOPT $file | $COLPIPE \ 2> /tmp/mandoc.err > /tmp/mandoc.out for i in roff mandoc; do [ -s /tmp/$i.err ] && echo "$i errors:" && cat /tmp/$i.err done diff -au $DIFFOPT /tmp/roff.out /tmp/mandoc.out 2>&1 done exit 0 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/html.h��������������������������������������������������������������������������������0100644�0001753�0001753�00000010226�14123140553�0014465�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: html.h,v 1.109 2021/09/09 14:47:24 schwarze Exp $ */ /* * Copyright (c) 2017, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Internal interfaces for mandoc(1) HTML formatters. * For use by the individual HTML formatters only. */ enum htmltag { TAG_HTML, TAG_HEAD, TAG_META, TAG_LINK, TAG_STYLE, TAG_TITLE, TAG_BODY, TAG_DIV, TAG_SECTION, TAG_TABLE, TAG_TR, TAG_TD, TAG_LI, TAG_UL, TAG_OL, TAG_DL, TAG_DT, TAG_DD, TAG_H1, TAG_H2, TAG_P, TAG_PRE, TAG_A, TAG_B, TAG_CITE, TAG_CODE, TAG_I, TAG_SMALL, TAG_SPAN, TAG_VAR, TAG_BR, TAG_HR, TAG_MARK, TAG_MATH, TAG_MROW, TAG_MI, TAG_MN, TAG_MO, TAG_MSUP, TAG_MSUB, TAG_MSUBSUP, TAG_MFRAC, TAG_MSQRT, TAG_MFENCED, TAG_MTABLE, TAG_MTR, TAG_MTD, TAG_MUNDEROVER, TAG_MUNDER, TAG_MOVER, TAG_MAX }; struct tag { struct tag *next; int refcnt; int closed; enum htmltag tag; }; struct html { int flags; #define HTML_NOSPACE (1 << 0) /* suppress next space */ #define HTML_IGNDELIM (1 << 1) #define HTML_KEEP (1 << 2) #define HTML_PREKEEP (1 << 3) #define HTML_NONOSPACE (1 << 4) /* never add spaces */ #define HTML_SKIPCHAR (1 << 6) /* skip the next character */ #define HTML_NOSPLIT (1 << 7) /* do not break line before .An */ #define HTML_SPLIT (1 << 8) /* break line before .An */ #define HTML_NONEWLINE (1 << 9) /* No line break in nofill mode. */ #define HTML_BUFFER (1 << 10) /* Collect a word to see if it fits. */ #define HTML_TOCDONE (1 << 11) /* The TOC was already written. */ size_t indent; /* current output indentation level */ int noindent; /* indent disabled by <pre> */ size_t col; /* current output byte position */ size_t bufcol; /* current buf byte position */ char buf[80]; /* output buffer */ struct tag *tag; /* last open tag */ struct rofftbl tbl; /* current table */ struct tag *tblt; /* current open table scope */ char *base_man1; /* bases for manpage href */ char *base_man2; char *base_includes; /* base for include href */ char *style; /* style-sheet URI */ struct tag *metaf; /* current open font scope */ enum mandoc_esc metal; /* last used font */ enum mandoc_esc metac; /* current font mode */ int oflags; /* output options */ #define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */ #define HTML_TOC (1 << 1) /* emit a table of contents */ }; struct roff_node; struct tbl_span; struct eqn_box; void roff_html_pre(struct html *, const struct roff_node *); void print_gen_comment(struct html *, struct roff_node *); void print_gen_decls(struct html *); void print_gen_head(struct html *); struct tag *print_otag(struct html *, enum htmltag, const char *, ...); struct tag *print_otag_id(struct html *, enum htmltag, const char *, struct roff_node *); void print_tagq(struct html *, const struct tag *); void print_stagq(struct html *, const struct tag *); void print_tagged_text(struct html *, const char *, struct roff_node *); void print_text(struct html *, const char *); void print_tblclose(struct html *); void print_tbl(struct html *, const struct tbl_span *); void print_eqn(struct html *, const struct eqn_box *); void print_endline(struct html *); void html_close_paragraph(struct html *); enum roff_tok html_fillmode(struct html *, enum roff_tok); char *html_make_id(const struct roff_node *, int); int html_setfont(struct html *, enum mandoc_esc); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/lib.in��������������������������������������������������������������������������������0100644�0001753�0001753�00000021536�14123140553�0014454�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: lib.in,v 1.22 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2009, 2012 Joerg Sonnenberger <joerg@netbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * These are all possible .Lb strings. When a new library is added, add * its short-string to the left-hand side and formatted string to the * right-hand side. * * Be sure to escape strings. */ LINE("lib80211", "802.11 Wireless Network Management Library (lib80211, \\-l80211)") LINE("libalias", "Packet Aliasing Library (libalias, \\-lalias)") LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") LINE("libbe", "Boot Environment Library (libbe, \\-lbe)") LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") LINE("libbsdxml", "eXpat XML parser library (libbsdxml, \\-lbsdxml)") LINE("libbsm", "Basic Security Module Library (libbsm, \\-lbsm)") LINE("libc", "Standard C\\~Library (libc, \\-lc)") LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") LINE("libcalendar", "Calendar Arithmetic Library (libcalendar, \\-lcalendar)") LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)") LINE("libcasper", "Casper Library (libcasper, \\-lcasper)") LINE("libcdk", "Curses Development Kit Library (libcdk, \\-lcdk)") LINE("libcipher", "FreeSec Crypt Library (libcipher, \\-lcipher)") LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") LINE("libcrypt", "Crypt Library (libcrypt, \\-lcrypt)") LINE("libcurses", "Curses Library (libcurses, \\-lcurses)") LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") LINE("libdevattr", "Device attribute and event library (libdevattr, \\-ldevattr)") LINE("libdevctl", "Device Control Library (libdevctl, \\-ldevctl)") LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)") LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") LINE("libdl", "Dynamic Linker Services Filter (libdl, \\-ldl)") LINE("libdm", "Device Mapper Library (libdm, \\-ldm)") LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") LINE("libelf", "ELF Access Library (libelf, \\-lelf)") LINE("libevent", "Event Notification Library (libevent, \\-levent)") LINE("libexecinfo", "Backtrace Information Library (libexecinfo, \\-lexecinfo)") LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)") LINE("libfsid", "Filesystem Identification Library (libfsid, \\-lfsid)") LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)") LINE("libform", "Curses Form Library (libform, \\-lform)") LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)") LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)") LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)") LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") LINE("libipsec", "IPsec Policy Control Library (libipsec, \\-lipsec)") LINE("libiscsi", "iSCSI protocol library (libiscsi, \\-liscsi)") LINE("libisns", "Internet Storage Name Service Library (libisns, \\-lisns)") LINE("libjail", "Jail Library (libjail, \\-ljail)") LINE("libkcore", "Kernel Memory Core Access Library (libkcore, \\-lkcore)") LINE("libkiconv", "Kernel-side iconv Library (libkiconv, \\-lkiconv)") LINE("libkse", "N:M Threading Library (libkse, \\-lkse)") LINE("libkvm", "Kernel Data Access Library (libkvm, \\-lkvm)") LINE("libm", "Math Library (libm, \\-lm)") LINE("libm68k", "m68k Architecture Library (libm68k, \\-lm68k)") LINE("libmagic", "Magic Number Recognition Library (libmagic, \\-lmagic)") LINE("libmandoc", "Mandoc Macro Compiler Library (libmandoc, \\-lmandoc)") LINE("libmd", "Message Digest (MD4, MD5, etc.) Support Library (libmd, \\-lmd)") LINE("libmemstat", "Kernel Memory Allocator Statistics Library (libmemstat, \\-lmemstat)") LINE("libmenu", "Curses Menu Library (libmenu, \\-lmenu)") LINE("libmj", "Minimalist JSON library (libmj, \\-lmj)") LINE("libnetgraph", "Netgraph User Library (libnetgraph, \\-lnetgraph)") LINE("libnetpgp", "Netpgp Signing, Verification, Encryption and Decryption (libnetpgp, \\-lnetpgp)") LINE("libnetpgpverify", "Netpgp Verification (libnetpgpverify, \\-lnetpgpverify)") LINE("libnpf", "NPF Packet Filter Library (libnpf, \\-lnpf)") LINE("libnv", "Name/value pairs library (libnv, \\-lnv)") LINE("libossaudio", "OSS Audio Emulation Library (libossaudio, \\-lossaudio)") LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") LINE("libpanel", "Z-order for curses windows (libpanel, \\-lpanel)") LINE("libpcap", "Packet capture Library (libpcap, \\-lpcap)") LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") LINE("libposix1e", "POSIX.1e Security API Library (libposix1e, \\-lposix1e)") LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") LINE("libproc", "Processor Monitoring and Analysis Library (libproc, \\-lproc)") LINE("libprocstat", "Process and Files Information Retrieval (libprocstat, \\-lprocstat)") LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") LINE("libpthread", "POSIX Threads Library (libpthread, \\-lpthread)") LINE("libpthread_dbg", "POSIX Debug Threads Library (libpthread_dbg, \\-lpthread_dbg)") LINE("libpuffs", "puffs Convenience Library (libpuffs, \\-lpuffs)") LINE("libquota", "Disk Quota Access and Control Library (libquota, \\-lquota)") LINE("libradius", "RADIUS Client Library (libradius, \\-lradius)") LINE("librefuse", "File System in Userspace Convenience Library (librefuse, \\-lrefuse)") LINE("libresolv", "DNS Resolver Library (libresolv, \\-lresolv)") LINE("librpcsec_gss", "RPC GSS-API Authentication Library (librpcsec_gss, \\-lrpcsec_gss)") LINE("librpcsvc", "RPC Service Library (librpcsvc, \\-lrpcsvc)") LINE("librt", "POSIX Real\\-time Library (librt, \\-lrt)") LINE("librtld_db", "Debugging interface to the runtime linker Library (librtld_db, \\-lrtld_db)") LINE("librumpclient", "Clientside Stubs for rump Kernel Remote Protocols (librumpclient, \\-lrumpclient)") LINE("libsaslc", "Simple Authentication and Security Layer client library (libsaslc, \\-lsaslc)") LINE("libsbuf", "Safe String Composition Library (libsbuf, \\-lsbuf)") LINE("libsdp", "Bluetooth Service Discovery Protocol User Library (libsdp, \\-lsdp)") LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)") LINE("libstand", "Standalone Applications Library (libstand, \\-lstand)") LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)") LINE("libSystem", "System Library (libSystem, \\-lSystem)") LINE("libsysdecode", "System Argument Decoding Library (libsysdecode, \\-lsysdecode)") LINE("libtacplus", "TACACS+ Client Library (libtacplus, \\-ltacplus)") LINE("libtcplay", "TrueCrypt-compatible API library (libtcplay, \\-ltcplay)") LINE("libtermcap", "Termcap Access Library (libtermcap, \\-ltermcap)") LINE("libterminfo", "Terminal Information Library (libterminfo, \\-lterminfo)") LINE("libthr", "1:1 Threading Library (libthr, \\-lthr)") LINE("libufs", "UFS File System Access Library (libufs, \\-lufs)") LINE("libugidfw", "File System Firewall Interface Library (libugidfw, \\-lugidfw)") LINE("libulog", "User Login Record Library (libulog, \\-lulog)") LINE("libusbhid", "USB Human Interface Devices Library (libusbhid, \\-lusbhid)") LINE("libutil", "System Utilities Library (libutil, \\-lutil)") LINE("libvgl", "Video Graphics Library (libvgl, \\-lvgl)") LINE("libx86_64", "x86_64 Architecture Library (libx86_64, \\-lx86_64)") LINE("libxo", "Text, XML, JSON, and HTML Output Emission Library (libxo, \\-lxo)") LINE("libz", "Compression Library (libz, \\-lz)") ������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/libman.h������������������������������������������������������������������������������0100644�0001753�0001753�00000003244�14123140553�0014765�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: libman.h,v 1.86 2018/12/31 10:04:39 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2018 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct roff_node; struct roff_man; #define MACRO_PROT_ARGS struct roff_man *man, \ enum roff_tok tok, \ int line, \ int ppos, \ int *pos, \ char *buf struct man_macro { void (*fp)(MACRO_PROT_ARGS); int flags; #define MAN_BSCOPED (1 << 0) /* Optional next-line block scope. */ #define MAN_ESCOPED (1 << 1) /* Optional next-line element scope. */ #define MAN_NSCOPED (1 << 2) /* Allowed in next-line element scope. */ #define MAN_XSCOPE (1 << 3) /* Exit next-line block scope. */ #define MAN_JOIN (1 << 4) /* Join arguments together. */ }; const struct man_macro *man_macro(enum roff_tok); void man_descope(struct roff_man *, int, int, char *); void man_unscope(struct roff_man *, const struct roff_node *); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/libmandoc.h���������������������������������������������������������������������������0100644�0001753�0001753�00000006602�14123140553�0015454�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: libmandoc.h,v 1.80 2021/06/27 17:57:54 schwarze Exp $ */ /* * Copyright (c) 2013-2015,2017,2018,2020 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Internal interfaces for parser utilities needed by multiple parsers * and the top-level functions to call the mdoc, man, and roff parsers. */ /* * Return codes passed from the roff parser to the main parser. */ /* Main instruction: what to do with the returned line. */ #define ROFF_IGN 0x000 /* Don't do anything with it. */ #define ROFF_CONT 0x001 /* Give it to the high-level parser. */ #define ROFF_RERUN 0x002 /* Re-run the roff parser with an offset. */ #define ROFF_REPARSE 0x004 /* Recursively run the main parser on it. */ #define ROFF_SO 0x008 /* Include the named file. */ #define ROFF_MASK 0x00f /* Only one of these bits should be set. */ /* Options for further parsing, to be OR'ed with the above. */ #define ROFF_APPEND 0x010 /* Append the next line to this one. */ #define ROFF_USERCALL 0x020 /* Start execution of a new macro. */ #define ROFF_USERRET 0x040 /* Abort execution of the current macro. */ #define ROFF_WHILE 0x100 /* Start a new .while loop. */ #define ROFF_LOOPCONT 0x200 /* Iterate the current .while loop. */ #define ROFF_LOOPEXIT 0x400 /* Exit the current .while loop. */ #define ROFF_LOOPMASK 0xf00 struct buf { char *buf; size_t sz; struct buf *next; }; struct roff; struct roff_man; struct roff_node; char *mandoc_normdate(struct roff_node *, struct roff_node *); int mandoc_eos(const char *, size_t); int mandoc_strntoi(const char *, size_t, int); const char *mandoc_a2msec(const char*); int mdoc_parseln(struct roff_man *, int, char *, int); void mdoc_endparse(struct roff_man *); int man_parseln(struct roff_man *, int, char *, int); void man_endparse(struct roff_man *); int preconv_cue(const struct buf *, size_t); int preconv_encode(const struct buf *, size_t *, struct buf *, size_t *, int *); void roff_free(struct roff *); struct roff *roff_alloc(int); void roff_reset(struct roff *); void roff_man_free(struct roff_man *); struct roff_man *roff_man_alloc(struct roff *, const char *, int); void roff_man_reset(struct roff_man *); int roff_parseln(struct roff *, int, struct buf *, int *, size_t); void roff_userret(struct roff *); void roff_endparse(struct roff *); void roff_setreg(struct roff *, const char *, int, char); int roff_getreg(struct roff *, const char *); char *roff_strdup(const struct roff *, const char *); char *roff_getarg(struct roff *, char **, int, int *); int roff_getcontrol(const struct roff *, const char *, int *); int roff_getformat(const struct roff *); ������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/libmdoc.h�����������������������������������������������������������������������������0100644�0001753�0001753�00000005737�14123140553�0015145�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: libmdoc.h,v 1.117 2018/12/31 04:55:46 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct roff_node; struct roff_man; struct mdoc_arg; #define MACRO_PROT_ARGS struct roff_man *mdoc, \ enum roff_tok tok, \ int line, \ int ppos, \ int *pos, \ char *buf struct mdoc_macro { void (*fp)(MACRO_PROT_ARGS); int flags; #define MDOC_CALLABLE (1 << 0) #define MDOC_PARSED (1 << 1) #define MDOC_EXPLICIT (1 << 2) #define MDOC_PROLOGUE (1 << 3) #define MDOC_IGNDELIM (1 << 4) #define MDOC_JOIN (1 << 5) }; enum margserr { ARGS_ERROR, ARGS_EOLN, /* end-of-line */ ARGS_WORD, /* normal word */ ARGS_ALLOC, /* normal word from roff_getarg() */ ARGS_PUNCT, /* series of punctuation */ ARGS_PHRASE /* Bl -column phrase */ }; /* * A punctuation delimiter is opening, closing, or "middle mark" * punctuation. These govern spacing. * Opening punctuation (e.g., the opening parenthesis) suppresses the * following space; closing punctuation (e.g., the closing parenthesis) * suppresses the leading space; middle punctuation (e.g., the vertical * bar) can do either. The middle punctuation delimiter bends the rules * depending on usage. */ enum mdelim { DELIM_NONE = 0, DELIM_OPEN, DELIM_MIDDLE, DELIM_CLOSE, DELIM_MAX }; const struct mdoc_macro *mdoc_macro(enum roff_tok); void mdoc_elem_alloc(struct roff_man *, int, int, enum roff_tok, struct mdoc_arg *); struct roff_node *mdoc_block_alloc(struct roff_man *, int, int, enum roff_tok, struct mdoc_arg *); void mdoc_tail_alloc(struct roff_man *, int, int, enum roff_tok); struct roff_node *mdoc_endbody_alloc(struct roff_man *, int, int, enum roff_tok, struct roff_node *); void mdoc_state(struct roff_man *, struct roff_node *); const char *mdoc_a2arch(const char *); const char *mdoc_a2att(const char *); const char *mdoc_a2lib(const char *); enum roff_sec mdoc_a2sec(const char *); const char *mdoc_a2st(const char *); void mdoc_argv(struct roff_man *, int, enum roff_tok, struct mdoc_arg **, int *, char *); enum margserr mdoc_args(struct roff_man *, int, int *, char *, enum roff_tok, char **); enum mdelim mdoc_isdelim(const char *); ���������������������������������mandoc-1.14.6/main.h��������������������������������������������������������������������������������0100644�0001753�0001753�00000004076�14123140553�0014453�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: main.h,v 1.30 2019/03/03 13:02:11 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2019 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct roff_meta; struct manoutput; /* * Definitions for main.c-visible output device functions, e.g., -Thtml * and -Tascii. Note that ascii_alloc() is named as such in * anticipation of latin1_alloc() and so on, all of which map into the * terminal output routines with different character settings. */ void *html_alloc(const struct manoutput *); void html_mdoc(void *, const struct roff_meta *); void html_man(void *, const struct roff_meta *); void html_reset(void *); void html_free(void *); void tree_mdoc(void *, const struct roff_meta *); void tree_man(void *, const struct roff_meta *); void man_mdoc(void *, const struct roff_meta *); void *locale_alloc(const struct manoutput *); void *utf8_alloc(const struct manoutput *); void *ascii_alloc(const struct manoutput *); void ascii_free(void *); void *pdf_alloc(const struct manoutput *); void *ps_alloc(const struct manoutput *); void pspdf_free(void *); void terminal_mdoc(void *, const struct roff_meta *); void terminal_man(void *, const struct roff_meta *); void terminal_sepline(void *); void markdown_mdoc(void *, const struct roff_meta *); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/makewhatis.8��������������������������������������������������������������������������0100644�0001753�0001753�00000011441�14123140553�0015576�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: makewhatis.8,v 1.6 2017/05/17 22:27:12 schwarze Exp $ .\" .\" Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2011, 2012, 2014, 2017 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: May 17 2017 $ .Dt MAKEWHATIS 8 .Os .Sh NAME .Nm makewhatis .Nd index UNIX manuals .Sh SYNOPSIS .Nm .Op Fl aDnpQ .Op Fl T Cm utf8 .Op Fl C Ar file .Nm .Op Fl aDnpQ .Op Fl T Cm utf8 .Ar dir ... .Nm .Op Fl DnpQ .Op Fl T Cm utf8 .Fl d Ar dir .Op Ar .Nm .Op Fl Dnp .Op Fl T Cm utf8 .Fl u Ar dir .Op Ar .Nm .Op Fl DQ .Fl t Ar .Sh DESCRIPTION The .Nm utility extracts keywords from .Ux manuals and indexes them in a database for fast retrieval by .Xr apropos 1 , .Xr whatis 1 , and .Xr man 1 Ns 's .Fl k option. .Pp By default, .Nm creates a database in each .Ar dir using the files .Sm off .Sy man Ar section Li / .Op Ar arch Li / .Ar title . section .Sm on and .Sm off .Sy cat Ar section Li / .Op Ar arch Li / .Ar title . Sy 0 .Sm on in that directory. Existing databases are replaced. If a directory contains no manual pages, no database is created in that directory. If .Ar dir is not provided, .Nm uses the default paths stipulated by .Xr man.conf 5 . .Pp The arguments are as follows: .Bl -tag -width "-C file" .It Fl a Use all directories and files found below .Ar dir ... . .It Fl C Ar file Specify an alternative configuration .Ar file in .Xr man.conf 5 format. .It Fl D Display all files added or removed to the index. With a second .Fl D , also show all keywords added for each file. .It Fl d Ar dir Merge (remove and re-add) .Ar to the database in .Ar dir . .It Fl n Do not create or modify any database; scan and parse only, and print manual page names and descriptions to standard output. .It Fl p Print warnings about potential problems with manual pages to the standard error output. .It Fl Q Quickly build reduced-size databases by reading only the NAME sections of manuals. The resulting databases will usually contain names and descriptions only. .It Fl T Cm utf8 Use UTF-8 encoding instead of ASCII for strings stored in the databases. .It Fl t Ar Check the given .Ar files for potential problems. Implies .Fl a , .Fl n , and .Fl p . All diagnostic messages are printed to the standard output; the standard error output is not used. .It Fl u Ar dir Remove .Ar from the database in .Ar dir . If that causes the database to become empty, also delete the database file. .El .Pp If fatal parse errors are encountered while parsing, the offending file is printed to stderr, omitted from the index, and the parse continues with the next input file. .Sh ENVIRONMENT .Bl -tag -width MANPATH .It Ev MANPATH A colon-separated list of directories to create databases in. Ignored if a .Ar dir argument or the .Fl t option is specified. .El .Sh FILES .Bl -tag -width Ds .It Pa mandoc.db A database of manpages relative to the directory of the file. This file is portable across architectures and systems, so long as the manpage hierarchy it indexes does not change. .It Pa /etc/man.conf The default .Xr man 1 configuration file. .El .Sh EXIT STATUS The .Nm utility exits with one of the following values: .Pp .Bl -tag -width Ds -compact .It 0 No errors occurred. .It 5 Invalid command line arguments were specified. No input files have been read. .It 6 An operating system error occurred, for example memory exhaustion or an error accessing input files. Such errors cause .Nm to exit at once, possibly in the middle of parsing or formatting a file. The output databases are corrupt and should be removed. .El .Sh SEE ALSO .Xr apropos 1 , .Xr man 1 , .Xr whatis 1 , .Xr man.conf 5 .Sh HISTORY A .Nm utility first appeared in .Bx 2 . It was rewritten in .Xr perl 1 for .Ox 2.7 and in C for .Ox 5.6 . .Pp The .Ar dir argument first appeared in .Nx 1.0 ; the options .Fl dpt in .Ox 2.7 ; the option .Fl u in .Ox 3.4 ; and the options .Fl aCDnQT in .Ox 5.6 . .Sh AUTHORS .An -nosplit .An Bill Joy wrote the original .Bx .Nm in February 1979, .An Marc Espie started the Perl version in 2000, and the current version of .Nm was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv and .An Ingo Schwarze Aq Mt schwarze@openbsd.org . �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/man.1���������������������������������������������������������������������������������0100644�0001753�0001753�00000023151�14123140553�0014206�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: man.1,v 1.40 2020/07/20 16:57:30 schwarze Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre <jmc@openbsd.org> .\" Copyright (c) 2010, 2011, 2014-2020 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)man.1 8.2 (Berkeley) 1/2/94 .\" .Dd $Mdocdate: July 20 2020 $ .Dt MAN 1 .Os .Sh NAME .Nm man .Nd display manual pages .Sh SYNOPSIS .Nm man .Op Fl acfhklw .Op Fl C Ar file .Op Fl M Ar path .Op Fl m Ar path .Op Fl S Ar subsection .Op Oo Fl s Oc Ar section .Ar name ... .Sh DESCRIPTION The .Nm utility displays the manual page entitled .Ar name . Pages may be selected according to a specific category .Pq Ar section or machine architecture .Pq Ar subsection . .Pp The options are as follows: .Bl -tag -width Ds .It Fl a Display all matching manual pages. .It Fl C Ar file Use the specified .Ar file instead of the default configuration file. This permits users to configure their own manual environment. See .Xr man.conf 5 for a description of the contents of this file. .It Fl c Copy the manual page to the standard output instead of using .Xr less 1 to paginate it. This is done by default if the standard output is not a terminal device. .Pp When using .Fl c , most terminal devices are unable to show the markup. To print the output of .Nm to the terminal with markup but without using a pager, pipe it to .Xr ul 1 . To remove the markup, pipe the output to .Xr col 1 .Fl b instead. .It Fl f A synonym for .Xr whatis 1 . It searches for .Ar name in manual page names and displays the header lines from all matching pages. The search is case insensitive and matches whole words only. .It Fl h Display only the SYNOPSIS lines of the requested manual pages. Implies .Fl a and .Fl c . .It Fl k A synonym for .Xr apropos 1 . Instead of .Ar name , an expression can be provided using the syntax described in the .Xr apropos 1 manual. By default, it displays the header lines of all matching pages. .It Fl l A synonym for .Xr mandoc 1 . The .Ar name arguments are interpreted as filenames. No search is done and .Ar file , .Ar path , .Ar section , .Ar subsection , and .Fl w are ignored. This option implies .Fl a . .It Fl M Ar path Override the list of directories to search for manual pages. The supplied .Ar path must be a colon .Pq Ql \&: separated list of directories. This option also overrides the environment variable .Ev MANPATH and any directories specified in the .Xr man.conf 5 file. .It Fl m Ar path Augment the list of directories to search for manual pages. The supplied .Ar path must be a colon .Pq Ql \&: separated list of directories. These directories will be searched before those specified using the .Fl M option, the .Ev MANPATH environment variable, the .Xr man.conf 5 file, or the default directories. .It Fl S Ar subsection Only show pages for the specified .Xr machine 1 architecture. .Ar subsection is case insensitive. .Pp By default manual pages for all architectures are installed. Therefore this option can be used to view pages for one architecture whilst using another. .Pp This option overrides the .Ev MACHINE environment variable. .Tg s .It Oo Fl s Oc Ar section Only select manuals from the specified .Ar section . The currently available sections are: .Pp .Bl -tag -width "localXXX" -offset indent -compact .It 1 General commands .Pq tools and utilities . .It 2 System calls and error numbers. .It 3 Library functions. .It 3p .Xr perl 1 programmer's reference guide. .It 4 Device drivers. .It 5 File formats. .It 6 Games. .It 7 Miscellaneous information. .It 8 System maintenance and operation commands. .It 9 Kernel internals. .El .It Fl w List the pathnames of all matching manual pages instead of displaying any of them. If no .Ar name is given, list the directories that would be searched. .El .Pp The options .Fl IKOTW are also supported and are documented in .Xr mandoc 1 . The options .Fl fkl are mutually exclusive and override each other. .Pp The search starts with the .Fl m argument if provided, then continues with the .Fl M argument, the .Ev MANPATH variable, the .Ic manpath entries in the .Xr man.conf 5 file, or with .Pa /usr/share/man : Ns Pa /usr/X11R6/man : Ns Pa /usr/local/man by default. Within each of these, directories are searched in the order provided. Within each directory, the search proceeds according to the following list of sections: 1, 8, 6, 2, 3, 5, 7, 4, 9, 3p. The first match found is shown. .Pp The .Xr mandoc.db 5 database is used for looking up manual page entries. In cases where the database is absent, outdated, or corrupt, .Nm falls back to looking for files called .Ar name . Ns Ar section . If both a formatted and an unformatted version of the same manual page, for example .Pa cat1/foo.0 and .Pa man1/foo.1 , exist in the same directory, only the unformatted version is used. The database is kept up to date with .Xr makewhatis 8 , which is run by the .Xr weekly 8 maintenance script. .Pp Guidelines for writing man pages can be found in .Xr mdoc 7 . .Sh ENVIRONMENT .Bl -tag -width MANPATHX .It Ev MACHINE As some manual pages are intended only for specific architectures, .Nm searches any subdirectories, with the same name as the current architecture, in every directory which it searches. Machine specific areas are checked before general areas. The current machine type may be overridden by setting the environment variable .Ev MACHINE to the name of a specific architecture, or with the .Fl S option. .Ev MACHINE is case insensitive. .It Ev MANPAGER Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, .Xr less 1 . If .Xr less 1 is used, the interactive .Ic :t command can be used to go to the definitions of various terms, for example command line options, command modifiers, internal commands, environment variables, function names, preprocessor macros, .Xr errno 2 values, and some other emphasized words. Some terms may have defining text at more than one place. In that case, the .Xr less 1 interactive commands .Ic t and .Ic T can be used to move to the next and to the previous place providing information about the term last searched for with .Ic :t . The .Fl O Cm tag Ns Op = Ns Ar term option documented in the .Xr mandoc 1 manual opens a manual page at the definition of a specific .Ar term rather than at the beginning. .It Ev MANPATH Override the standard search path which is either specified in .Xr man.conf 5 or the default path. The format of .Ev MANPATH is a colon .Pq Ql \&: separated list of directories. Invalid directories are ignored. Overridden by .Fl M , ignored if .Fl l is specified. .Pp If .Ev MANPATH begins with a colon, it is appended to the standard path; if it ends with a colon, it is prepended to the standard path; or if it contains two adjacent colons, the standard path is inserted between the colons. .It Ev PAGER Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, .Xr less 1 is used. .El .Sh FILES .Bl -tag -width /etc/man.conf -compact .It Pa /etc/man.conf default .Nm configuration file .El .Sh EXIT STATUS .Ex -std man See .Xr mandoc 1 for details. .Sh EXAMPLES Format a page for pasting extracts into an email message \(em avoid printing any UTF-8 characters, reduce the width to ease quoting in replies, and remove markup: .Pp .Dl $ man -T ascii -O width=65 pledge | col -b .Pp Read a typeset page in a PDF viewer: .Pp .Dl $ MANPAGER=mupdf man -T pdf lpd .Sh SEE ALSO .Xr apropos 1 , .Xr col 1 , .Xr mandoc 1 , .Xr ul 1 , .Xr whereis 1 , .Xr man.conf 5 , .Xr mdoc 7 .Sh STANDARDS The .Nm utility is compliant with the .St -p1003.1-2008 specification. .Pp The flags .Op Fl aCcfhIKlMmOSsTWw , as well as the environment variables .Ev MACHINE , .Ev MANPAGER , and .Ev MANPATH , are extensions to that specification. .Sh HISTORY A .Nm command first appeared in .At v2 . .Pp The .Fl w option first appeared in .At v7 ; .Fl f and .Fl k in .Bx 4 ; .Fl M in .Bx 4.3 ; .Fl a in .Bx 4.3 Tahoe ; .Fl c and .Fl m in .Bx 4.3 Reno ; .Fl h in .Bx 4.3 Net/2 ; .Fl C in .Nx 1.0 ; .Fl s and .Fl S in .Ox 2.3 ; and .Fl I , .Fl K , .Fl l , .Fl O , and .Fl W in .Ox 5.7 . The .Fl T option first appeared in .At III and was also added in .Ox 5.7 . �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/man.7���������������������������������������������������������������������������������0100644�0001753�0001753�00000042627�14123140553�0014225�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: man.7,v 1.148 2021/08/05 14:31:14 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org> .\" Copyright (c) 2017 Anthony Bentley <bentley@openbsd.org> .\" Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: August 5 2021 $ .Dt MAN 7 .Os .Sh NAME .Nm man .Nd legacy formatting language for manual pages .Sh DESCRIPTION The .Nm man language was the standard formatting language for .At manual pages from 1979 to 1989. Do not use it to write new manual pages: it is a purely presentational language and lacks support for semantic markup. Use the .Xr mdoc 7 language, instead. .Pp In a .Nm document, lines beginning with the control character .Sq \&. are called .Dq macro lines . The first word is the macro name. It usually consists of two capital letters. For a list of portable macros, see .Sx MACRO OVERVIEW . The words following the macro name are arguments to the macro. .Pp Lines not beginning with the control character are called .Dq text lines . They provide free-form text to be printed; the formatting of the text depends on the respective processing context: .Bd -literal -offset indent \&.SH Macro lines change control state. Text lines are interpreted within the current state. .Ed .Pp Many aspects of the basic syntax of the .Nm language are based on the .Xr roff 7 language; see the .Em LANGUAGE SYNTAX and .Em MACRO SYNTAX sections in the .Xr roff 7 manual for details, in particular regarding comments, escape sequences, whitespace, and quoting. .Pp Each .Nm document starts with the .Ic TH macro specifying the document's name and section, followed by the .Sx NAME section formatted as follows: .Bd -literal -offset indent \&.TH PROGNAME 1 1979-01-10 \&.SH NAME \efBprogname\efR \e(en one line about what it does .Ed .Sh MACRO OVERVIEW This overview is sorted such that macros of similar purpose are listed together. Deprecated and non-portable macros are not included in the overview, but can be found in the alphabetical reference below. .Ss Page header and footer meta-data .Bl -column "RS, RE" description .It Ic TH Ta set the title: Ar name section date Op Ar source Op Ar volume .It Ic AT Ta display AT&T UNIX version in the page footer (<= 1 argument) .It Ic UC Ta display BSD version in the page footer (<= 1 argument) .El .Ss Sections and paragraphs .Bl -column "RS, RE" description .It Ic SH Ta section header (one line) .It Ic SS Ta subsection header (one line) .It Ic PP Ta start an undecorated paragraph (no arguments) .It Ic RS , RE Ta reset the left margin: Op Ar width .It Ic IP Ta indented paragraph: Op Ar head Op Ar width .It Ic TP Ta tagged paragraph: Op Ar width .It Ic PD Ta set vertical paragraph distance: Op Ar height .It Ic in Ta additional indent: Op Ar width .El .Ss Physical markup .Bl -column "RS, RE" description .It Ic B Ta boldface font .It Ic I Ta italic font .It Ic SB Ta small boldface font .It Ic SM Ta small roman font .It Ic BI Ta alternate between boldface and italic fonts .It Ic BR Ta alternate between boldface and roman fonts .It Ic IB Ta alternate between italic and boldface fonts .It Ic IR Ta alternate between italic and roman fonts .It Ic RB Ta alternate between roman and boldface fonts .It Ic RI Ta alternate between roman and italic fonts .El .Sh MACRO REFERENCE This section is a canonical reference to all macros, arranged alphabetically. For the scoping of individual macros, see .Sx MACRO SYNTAX . .Bl -tag -width 3n .It Ic AT Sets the volume for the footer for compatibility with man pages from .At releases. The optional arguments specify which release it is from. This macro is an extension that first appeared in .Bx 4.3 . .It Ic B Text is rendered in bold face. .It Ic BI Text is rendered alternately in bold face and italic. Thus, .Sq .BI this word and that causes .Sq this and .Sq and to render in bold face, while .Sq word and .Sq that render in italics. Whitespace between arguments is omitted in output. .Pp Example: .Pp .Dl \&.BI bold italic bold italic .It Ic BR Text is rendered alternately in bold face and roman (the default font). Whitespace between arguments is omitted in output. See also .Ic BI . .It Ic DT Restore the default tabulator positions. They are at intervals of 0.5 inches. This has no effect unless the tabulator positions were changed with the .Xr roff 7 .Ic ta request. .It Ic EE This is a non-standard Version 9 .At extension later adopted by GNU. In .Xr mandoc 1 , it does the same as the .Xr roff 7 .Ic fi request (switch to fill mode). .It Ic EX This is a non-standard Version 9 .At extension later adopted by GNU. In .Xr mandoc 1 , it does the same as the .Xr roff 7 .Ic nf request (switch to no-fill mode). .It Ic HP Begin a paragraph whose initial output line is left-justified, but subsequent output lines are indented, with the following syntax: .Pp .D1 Pf . Ic HP Op Ar width .Pp The .Ar width argument is a .Xr roff 7 scaling width. If specified, it's saved for later paragraph left margins; if unspecified, the saved or default width is used. .Pp This macro is portable, but deprecated because it has no good representation in HTML output, usually ending up indistinguishable from .Ic PP . .It Ic I Text is rendered in italics. .It Ic IB Text is rendered alternately in italics and bold face. Whitespace between arguments is omitted in output. See also .Ic BI . .It Ic IP Begin an indented paragraph with the following syntax: .Pp .D1 Pf . Ic IP Op Ar head Op Ar width .Pp The .Ar width argument is a .Xr roff 7 scaling width defining the left margin. It's saved for later paragraph left-margins; if unspecified, the saved or default width is used. .Pp The .Ar head argument is used as a leading term, flushed to the left margin. This is useful for bulleted paragraphs and so on. .It Ic IR Text is rendered alternately in italics and roman (the default font). Whitespace between arguments is omitted in output. See also .Ic BI . .It Ic LP A synonym for .Ic PP . .It Ic ME End a mailto block started with .Ic MT . This is a non-standard GNU extension. .It Ic MT Begin a mailto block. This is a non-standard GNU extension. It has the following syntax: .Bd -unfilled -offset indent .Pf . Ic MT Ar address link description to be shown .Pf . Ic ME .Ed .It Ic OP Optional command-line argument. This is a non-standard DWB extension. It has the following syntax: .Pp .D1 Pf . Ic OP Ar key Op Ar value .Pp The .Ar key is usually a command-line flag and .Ar value its argument. .It Ic P This synonym for .Ic PP is an .At III extension later adopted by .Bx 4.3 . .It Ic PD Specify the vertical space to be inserted before each new paragraph. .br The syntax is as follows: .Pp .D1 Pf . Ic PD Op Ar height .Pp The .Ar height argument is a .Xr roff 7 scaling width. It defaults to .Cm 1v . If the unit is omitted, .Cm v is assumed. .Pp This macro affects the spacing before any subsequent instances of .Ic HP , .Ic IP , .Ic LP , .Ic P , .Ic PP , .Ic SH , .Ic SS , .Ic SY , and .Ic TP . .It Ic PP Begin an undecorated paragraph. The scope of a paragraph is closed by a subsequent paragraph, sub-section, section, or end of file. The saved paragraph left-margin width is reset to the default. .It Ic RB Text is rendered alternately in roman (the default font) and bold face. Whitespace between arguments is omitted in output. See also .Ic BI . .It Ic RE Explicitly close out the scope of a prior .Ic RS . The default left margin is restored to the state before that .Ic RS invocation. .Pp The syntax is as follows: .Pp .D1 Pf . Ic RE Op Ar level .Pp Without an argument, the most recent .Ic RS block is closed out. If .Ar level is 1, all open .Ic RS blocks are closed out. Otherwise, .Ar level No \(mi 1 nested .Ic RS blocks remain open. .It Ic RI Text is rendered alternately in roman (the default font) and italics. Whitespace between arguments is omitted in output. See also .Ic BI . .It Ic RS Temporarily reset the default left margin. This has the following syntax: .Pp .D1 Pf . Ic RS Op Ar width .Pp The .Ar width argument is a .Xr roff 7 scaling width. If not specified, the saved or default width is used. .Pp See also .Ic RE . .It Ic SB Text is rendered in small size (one point smaller than the default font) bold face. This macro is an extension that probably first appeared in SunOS 4.0 and was later adopted by GNU and by .Bx 4.4 . .It Ic SH Begin a section. The scope of a section is only closed by another section or the end of file. The paragraph left-margin width is reset to the default. .It Ic SM Text is rendered in small size (one point smaller than the default font). .It Ic SS Begin a sub-section. The scope of a sub-section is closed by a subsequent sub-section, section, or end of file. The paragraph left-margin width is reset to the default. .It Ic SY Begin a synopsis block with the following syntax: .Bd -unfilled -offset indent .Pf . Ic SY Ar command .Ar arguments .Pf . Ic YS .Ed .Pp This is a non-standard GNU extension and very rarely used even in GNU manual pages. Formatting is similar to .Ic IP . .It Ic TH Set the name of the manual page for use in the page header and footer with the following syntax: .Pp .D1 Pf . Ic TH Ar name section date Op Ar source Op Ar volume .Pp Conventionally, the document .Ar name is given in all caps. The .Ar section is usually a single digit, in a few cases followed by a letter. The recommended .Ar date format is .Sy YYYY-MM-DD as specified in the ISO-8601 standard; if the argument does not conform, it is printed verbatim. If the .Ar date is empty or not specified, the current date is used. The optional .Ar source string specifies the organisation providing the utility. When unspecified, .Xr mandoc 1 uses its .Fl Ios argument. The .Ar volume string replaces the default volume title of the .Ar section . .Pp Examples: .Pp .Dl \&.TH CVS 5 "1992-02-12" GNU .It Ic TP Begin a paragraph where the head, if exceeding the indentation width, is followed by a newline; if not, the body follows on the same line after advancing to the indentation width. Subsequent output lines are indented. The syntax is as follows: .Bd -unfilled -offset indent .Pf . Ic TP Op Ar width .Ar head No \e" one line .Ar body .Ed .Pp The .Ar width argument is a .Xr roff 7 scaling width. If specified, it's saved for later paragraph left-margins; if unspecified, the saved or default width is used. .It Ic TQ Like .Ic TP , except that no vertical spacing is inserted before the paragraph. This is a non-standard GNU extension and very rarely used even in GNU manual pages. .It Ic UC Sets the volume for the footer for compatibility with man pages from .Bx releases. The optional first argument specifies which release it is from. This macro is an extension that first appeared in .Bx 3 . .It Ic UE End a uniform resource identifier block started with .Ic UR . This is a non-standard GNU extension. .It Ic UR Begin a uniform resource identifier block. This is a non-standard GNU extension. It has the following syntax: .Bd -unfilled -offset indent .Pf . Ic UR Ar uri link description to be shown .Pf . Ic UE .Ed .It Ic YS End a synopsis block started with .Ic SY . This is a non-standard GNU extension. .It Ic in Indent relative to the current indentation: .Pp .D1 Pf . Ic in Op Ar width .Pp If .Ar width is signed, the new offset is relative. Otherwise, it is absolute. This value is reset upon the next paragraph, section, or sub-section. .El .Sh MACRO SYNTAX The .Nm macros are classified by scope: line scope or block scope. Line macros are only scoped to the current line (and, in some situations, the subsequent line). Block macros are scoped to the current line and subsequent lines until closed by another block macro. .Ss Line Macros Line macros are generally scoped to the current line, with the body consisting of zero or more arguments. If a macro is scoped to the next line and the line arguments are empty, the next line, which must be text, is used instead. Thus: .Bd -literal -offset indent \&.I foo .Ed .Pp is equivalent to .Sq .I foo . If next-line macros are invoked consecutively, only the last is used. If a next-line macro is followed by a non-next-line macro, an error is raised. .Pp The syntax is as follows: .Bd -literal -offset indent \&.YO \(lBbody...\(rB \(lBbody...\(rB .Ed .Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent .It Em Macro Ta Em Arguments Ta Em Scope Ta Em Notes .It Ic AT Ta <=1 Ta current Ta \& .It Ic B Ta n Ta next-line Ta \& .It Ic BI Ta n Ta current Ta \& .It Ic BR Ta n Ta current Ta \& .It Ic DT Ta 0 Ta current Ta \& .It Ic EE Ta 0 Ta current Ta Version 9 At .It Ic EX Ta 0 Ta current Ta Version 9 At .It Ic I Ta n Ta next-line Ta \& .It Ic IB Ta n Ta current Ta \& .It Ic IR Ta n Ta current Ta \& .It Ic OP Ta >=1 Ta current Ta DWB .It Ic PD Ta 1 Ta current Ta \& .It Ic RB Ta n Ta current Ta \& .It Ic RI Ta n Ta current Ta \& .It Ic SB Ta n Ta next-line Ta \& .It Ic SM Ta n Ta next-line Ta \& .It Ic TH Ta >1, <6 Ta current Ta \& .It Ic UC Ta <=1 Ta current Ta \& .It Ic in Ta 1 Ta current Ta Xr roff 7 .El .Ss Block Macros Block macros comprise a head and body. As with in-line macros, the head is scoped to the current line and, in one circumstance, the next line (the next-line stipulations as in .Sx Line Macros apply here as well). .Pp The syntax is as follows: .Bd -literal -offset indent \&.YO \(lBhead...\(rB \(lBhead...\(rB \(lBbody...\(rB .Ed .Pp The closure of body scope may be to the section, where a macro is closed by .Ic SH ; sub-section, closed by a section or .Ic SS ; or paragraph, closed by a section, sub-section, .Ic HP , .Ic IP , .Ic LP , .Ic P , .Ic PP , .Ic RE , .Ic SY , or .Ic TP . No closure refers to an explicit block closing macro. .Pp As a rule, block macros may not be nested; thus, calling a block macro while another block macro scope is open, and the open scope is not implicitly closed, is syntactically incorrect. .Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX" -offset indent .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope Ta Em Notes .It Ic HP Ta <2 Ta current Ta paragraph Ta \& .It Ic IP Ta <3 Ta current Ta paragraph Ta \& .It Ic LP Ta 0 Ta current Ta paragraph Ta \& .It Ic ME Ta 0 Ta none Ta none Ta GNU .It Ic MT Ta 1 Ta current Ta to \&ME Ta GNU .It Ic P Ta 0 Ta current Ta paragraph Ta \& .It Ic PP Ta 0 Ta current Ta paragraph Ta \& .It Ic RE Ta <=1 Ta current Ta none Ta \& .It Ic RS Ta 1 Ta current Ta to \&RE Ta \& .It Ic SH Ta >0 Ta next-line Ta section Ta \& .It Ic SS Ta >0 Ta next-line Ta sub-section Ta \& .It Ic SY Ta 1 Ta current Ta to \&YS Ta GNU .It Ic TP Ta n Ta next-line Ta paragraph Ta \& .It Ic TQ Ta n Ta next-line Ta paragraph Ta GNU .It Ic UE Ta 0 Ta current Ta none Ta GNU .It Ic UR Ta 1 Ta current Ta part Ta GNU .It Ic YS Ta 0 Ta none Ta none Ta GNU .El .Pp If a block macro is next-line scoped, it may only be followed by in-line macros for decorating text. .Ss Font handling In .Nm documents, both .Sx Physical markup macros and .Xr roff 7 .Ql \ef font escape sequences can be used to choose fonts. In text lines, the effect of manual font selection by escape sequences only lasts until the next macro invocation; in macro lines, it only lasts until the end of the macro scope. Note that macros like .Ic BR open and close a font scope for each argument. .Sh SEE ALSO .Xr man 1 , .Xr mandoc 1 , .Xr eqn 7 , .Xr mandoc_char 7 , .Xr mdoc 7 , .Xr roff 7 , .Xr tbl 7 .Sh HISTORY The .Nm language first appeared as a macro package for the roff typesetting system in .At v7 . .Pp The stand-alone implementation that is part of the .Xr mandoc 1 utility first appeared in .Ox 4.6 . .Sh AUTHORS .An -nosplit .An Douglas McIlroy Aq Mt m.douglas.mcilroy@dartmouth.edu designed and implemented the original version of these macros, wrote the original version of this manual page, and was the first to use them when he edited volume 1 of the .At v7 manual pages. .Pp .An James Clark later rewrote the macros for groff. .An Eric S. Raymond Aq Mt esr@thyrsus.com and .An Werner Lemberg Aq Mt wl@gnu.org added the extended .Nm macros to groff in 2007. .Pp The .Xr mandoc 1 program and this .Nm reference were written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . ���������������������������������������������������������������������������������������������������������mandoc-1.14.6/man.cgi.3�����������������������������������������������������������������������������0100644�0001753�0001753�00000017525�14123140553�0014761�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: man.cgi.3,v 1.4 2017/03/15 13:18:53 schwarze Exp $ .\" .\" Copyright (c) 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: March 15 2017 $ .Dt MAN.CGI 3 .Os .Sh NAME .Nm man.cgi .Nd internals of the CGI program to search and display manual pages .Sh DESCRIPTION The source code of .Xr man.cgi 8 is organized in four levels: .Pp .Bl -enum -compact .It .Sx Top level .It .Sx Page generators .It .Sx Result generators .It .Sx Utility routines .El .Ss Top level The top level of .Xr man.cgi 8 consists of the .Fn main program and a few parser routines. .Bl -tag -width 1n .It Ft int Fn main void The main program .Bl -dash -compact .It limits execution time; .It changes to .Dv MAN_DIR , the data directory containing all the manual trees; .It calls .Fn parse_manpath_conf ; .It if .Ev PATH_INFO is empty, calls .Fn parse_query_string ; otherwise, calls .Fn parse_path_info ; .It validates the manpath and the architecture; .It calls the appropriate one among the .Sx Page generators . .El .It Ft void Fn parse_manpath_conf "struct req *req" Parses and validates .Pa manpath.conf and fills .Va req->p and .Va req->psz . .It Ft void Fn parse_path_info "struct req *req" "const char *path" Parses and validates .Ev PATH_INFO , clears .Va req->isquery , and fills .Va req->q . .It Ft void Fn parse_query_string "struct req *req" "const char *qs" Parses and validates .Ev QUERY_STRING , sets .Va req->isquery , and fills .Va req->q . This function is the only user of the utility functions .Fn http_decode and .Fn set_query_attr . .El .Ss Page generators The purpose of each page generator is to print a complete HTML page, starting with the HTTP headers and continuing to the page footer. Before starting HTML output with .Fn resp_begin_html , some page generators do some preparatory work, for example to decide which page to show. Each page generator ends with a call to .Fn resp_end_html . .Bl -tag -width 1n .It Ft void Fn pg_show "struct req *req" "const char *fullpath" This page generator is used when .Ev PATH_INFO contains the complete path to a manual page including manpath, section directory, optional architecture subdirectory, manual name and section number suffix. It validates the manpath, changes into it, validate the filename, and then calls .Fn resp_begin_html , .Fn resp_searchform , .Fn resp_show , and .Fn resp_end_html in that order. .It Ft void Fn pg_search "const struct req *req" This page generator is used when .Ev PATH_INFO contains a search query in short format or when .Ev PATH_INFO is empty and a .Ev QUERY_STRING is provided. If possible, requests using .Ev QUERY_STRING are redirected to URIs using .Ev PATH_INFO by calling .Fn pg_redirect . Otherwise, it changes into the manpath and calls .Xr mansearch 3 . Depending on the result, it calls either .Fn pg_noresult or .Fn pg_searchres . .It Ft void Fn pg_redirect "const struct req *req" "const char *name" This function is special in so far as it does not print an HTML page, but only an HTTP 303 response with a Location: of the form: .Sm off .No http:// .Ar host Ns / .Op Ar scriptname Ns / .Op Ar manpath Ns / .Op Ar arch Ns / .Fa name .Op Pf . Ar sec .Sm on .It Ft void Fn pg_noresult "const struct req *req" "const char *msg" This function calls .Fn resp_begin_html , .Fn resp_searchform , prints the .Fa msg passed to it, and calls .Fn resp_end_html . .It Ft void Fn pg_searchres "const struct req *req" "struct manpage *r"\ "size_t sz" This function first validates the filenames found. If .Ev QUERY_STRING was used and there is exactly one result, it writes an HTTP redirect to that result. Otherwise, it writes an HTML result page beginning with .Fn resp_begin_html and .Fn resp_searchform . If there is more than one result, it writes a list of links to all the results. If it was a .Xr man 1 rather than an .Xr apropos 1 query or if there is only one single result, it calls .Fn resp_show . Finally, it calls .Fn resp_end_html . .It Ft void Fn pg_index "const struct req *req" This page generator is used when .Ev PATH_INFO and .Ev QUERY_STRING are both empty. It calls .Fn resp_begin_html and .Fn resp_searchform , writes links to help pages, and calls .Fn resp_end_html . .It Ft void Fn pg_error_badrequest "const char *msg" This page generator is used when .Fn main or .Fn pg_show detect an invalid URI. It calls .Fn resp_begin_html , prints the .Fa msg provided, and calls .Fn resp_end_html . .It Ft void Fn pg_error_internal void This page generator is used by various functions when errors are detected in the .Pa manpath.conf configuration file, in .Xr mandoc.db 5 databases, in the .Xr mandoc 3 parser, in file system permissions, or when setting up timeouts. It calls .Fn resp_begin_html , prints .Qq "Internal Server Error" , and calls .Fn resp_end_html . Before calling .Fn pg_error_internal , call .Xr warn 3 or .Xr warnx 3 to log the reason of the error to the .Xr httpd 8 server log file. .El .Ss Result generators The purpose of result generators is to print a chunk of HTML code. When they print untrusted strings or characters, .Fn html_print and .Fn html_putchar are used. The highest level result generators are: .Bl -tag -width 1n .It Ft void Fn resp_begin_html "int code" "const char *msg" "const char *file" This generator calls .Fn resp_begin_http to print the HTTP headers, then prints the HTML header up to the opening tag of the <body> element, then copies the file .Pa header.html to the output, if it exists and is readable. If .Fa file is not .Dv NULL , it is used for the <title> element. .It Ft void Fn resp_searchform "const struct req *req" "enum focus focus" This generator prints a search form, filling it with data from the provided request object. If the .Fa focus argument is .Dv FOCUS_QUERY , it sets the document's autofocus to the query input box. .It Ft void Fn resp_show "const struct req *req" "const char *file" This wrapper dispatches to either .Fn resp_catman or .Fn resp_format , depending on whether .Ar file starts with .Pa cat or .Pa man , respectively. .It Ft void Fn resp_catman "const struct req *req" "const char *file" This generator translates a preformatted, backspace-encoded manual page to HTML and prints it to the output. .It Ft void Fn resp_format "const struct req *req" "const char *file" This generator formats a manual page on the standard output, using the functions documented in .Xr mchars_alloc 3 and .Xr mandoc 3 . .It Ft void Fn resp_end_html void This generator copies the file .Pa footer.html to the output, if it exists and is readable, and closes the <body> and <html> elements. .El .Ss Utility routines These functions take a string and return 1 if it is valid, or 0 otherwise. .Bl -tag -width 1n .It Ft int Fn validate_urifrag "const char *frag" Checks that the string only contains alphanumeric ASCII characters, dashes, dots, slashes, and underscores. .It Ft int Fn validate_manpath "const struct req *req" "const char* manpath" Checks that the string is either .Qq mandoc or one of the manpaths configured in .Pa manpath.conf . .It Ft int Fn validate_filename "const char *file" Checks that the string starts with .Qq man or .Qq cat and does not ascend to parent directories. .El .Sh SEE ALSO .Xr mandoc 3 , .Xr mansearch 3 , .Xr mchars_alloc 3 , .Xr mandoc.db 5 , .Xr man.cgi 8 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/man.cgi.8�����������������������������������������������������������������������������0100644�0001753�0001753�00000026030�14123140553�0014755�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: man.cgi.8,v 1.23 2018/05/20 21:48:44 schwarze Exp $ .\" .\" Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: May 20 2018 $ .Dt MAN.CGI 8 .Os .Sh NAME .Nm man.cgi .Nd CGI program to search and display manual pages .Sh DESCRIPTION The .Nm CGI program searches for manual pages on a WWW server and displays them to HTTP clients, providing functionality equivalent to the .Xr man 1 and .Xr apropos 1 utilities. It can use multiple manual trees in parallel. .Ss HTML search interface At the top of each generated HTML page, .Nm displays a search form containing these elements: .Bl -enum .It An input box for search queries, expecting either a name of a manual page or an .Ar expression using the syntax described in the .Xr apropos 1 manual; filling this in is required for each search. .Pp The expression is broken into words at whitespace. Whitespace characters and backslashes can be escaped by prepending a backslash. The effect of prepending a backslash to another character is undefined; in the current implementation, it has no effect. .It A .Xr man 1 submit button. The string in the input box is interpreted as the name of a manual page. .It An .Xr apropos 1 submit button. The string in the input box is interpreted as a search .Ar expression . .It A dropdown menu to optionally select a manual section. If one is provided, it has the same effect as the .Xr man 1 and .Xr apropos 1 .Fl s option. Otherwise, pages from all sections are shown. .It A dropdown menu to optionally select an architecture. If one is provided, it has the same effect as the .Xr man 1 and .Xr apropos 1 .Fl S option. By default, pages for all architectures are shown. .It A dropdown menu to select a manual tree. If the configuration file .Pa /var/www/man/manpath.conf contains only one manpath, the dropdown menu is not shown. By default, the first manpath given in the file is used. .El .Ss Program output The .Nm program generates five kinds of output pages: .Bl -tag -width Ds .It The index page. This is returned when calling .Nm without .Ev PATH_INFO and without a .Ev QUERY_STRING . It serves as a starting point for using the program and shows the search form only. .It A list page. Lists are returned when searches match more than one manual page. The first column shows the names and section numbers of manuals as clickable links. The second column shows the one-line descriptions of the manuals. For .Xr man 1 style searches, the content of the first manual page follows the list. .It A manual page. This output format is used when a search matches exactly one manual page, or when a link on a list page or an .Ic \&Xr link on another manual page is followed. .It A no-result page. This is shown when a search request returns no results - either because it violates the query syntax, or because the search does not match any manual pages. .It \&An error page. This cannot happen by merely clicking the .Dq Search button, but only by manually entering an invalid URI. It does not show the search form, but only an error message and a link back to the index page. .El .Ss Setup For each manual tree, create one first-level subdirectory below .Pa /var/www/man . The name of one of these directories is called a .Dq manpath in the context of .Nm . Create a single ASCII text file .Pa /var/www/man/manpath.conf containing the names of these directories, one per line. The directory given first is used as the default manpath. .Pp Inside each of these directories, use the same directory and file structure as found below .Pa /usr/share/man , that is, second-level subdirectories .Pa /var/www/man/*/man1 , /var/www/man/*/man2 etc. containing source .Xr mdoc 7 and .Xr man 7 manuals with file name extensions matching the section numbers, second-level subdirectories .Pa /var/www/man/*/cat1 , /var/www/man/*/cat2 etc. containing preformatted manuals with the file name extension .Sq 0 , and optional third-level subdirectories for architectures. Use .Xr makewhatis 8 to create a .Xr mandoc.db 5 database inside each manpath. .Pp Configure your web server to execute CGI programs located in .Pa /cgi-bin . When using .Ox .Xr httpd 8 , the .Xr slowcgi 8 proxy daemon is needed to translate FastCGI requests to plain old CGI. .Pp To compile .Nm , first copy .Pa cgi.h.example to .Pa cgi.h and edit it according to your needs. It contains the following compile-time definitions: .Bl -tag -width Ds .It Ev COMPAT_OLDURI Only useful for running on www.openbsd.org to deal with old URIs containing .Qq "manpath=OpenBSD " where the blank character has to be translated to a hyphen. When compiling for other sites, this definition can be deleted. .It Dv CSS_DIR An optional file system path to the directory containing the file .Pa mandoc.css , to be specified relative to the server's document root, and to be specified without a trailing slash. When empty, the CSS file is assumed to be in the document root. Otherwise, a leading slash is needed. This is used in generated HTML code. .It Dv CUSTOMIZE_TITLE An ASCII string to be used for the HTML <TITLE> element. .It Dv MAN_DIR A file system path to the .Nm data directory relative to the web server .Xr chroot 2 directory, to be specified with a leading slash and without a trailing slash. It needs to have at least one component; the root directory cannot be used for this purpose. The files .Pa manpath.conf , .Pa header.html , and .Pa footer.html are looked up in this directory. It is also prepended to the manpath when opening .Xr mandoc.db 5 and manual page files. .It Dv SCRIPT_NAME The initial component of URIs, to be specified without leading and trailing slashes. It can be empty. .El .Pp After editing .Pa cgi.h , run .Pp .Dl make man.cgi .Pp and copy the resulting binary to the proper location, for example using the command: .Pp .Dl make installcgi .Pp In addition to that, make sure the default manpath contains the files .Pa man1/apropos.1 and .Pa man8/man.cgi.8 , or the documentation links at the bottom of the index page will not work. .Ss URI interface .Nm uniform resource identifiers are not needed for interactive use, but can be useful for deep linking. They consist of: .Bl -enum .It The .Cm http:// or .Cm https:// protocol specifier. .It The host name. .It The .Dv SCRIPT_NAME , preceded by a slash unless empty. .It To show a single page, a slash, the manpath, another slash, and the name of the requested file, for example .Pa /OpenBSD-current/man1/mandoc.1 . This can be abbreviated according to the following syntax: .Sm off .Op / Ar manpath .Op / Cm man Ar sec .Op / Ar arch .Pf / Ar name Op \&. Ar sec .Sm on .It For searches, a query string starting with a question mark and consisting of .Ar key Ns = Ns Ar value pairs, separated by ampersands, for example .Pa ?manpath=OpenBSD-current&query=mandoc . Supported keys are .Cm manpath , .Cm query , .Cm sec , .Cm arch , corresponding to .Xr apropos 1 .Fl M , .Ar expression , .Fl s , .Fl S , respectively, and .Cm apropos , which is a boolean parameter to select or deselect the .Xr apropos 1 query mode. For backward compatibility with the traditional .Nm , .Cm sektion is supported as an alias for .Cm sec . .El .Ss Restricted character set For security reasons, in particular to prevent cross site scripting attacks, some strings used by .Nm can only contain the following characters: .Pp .Bl -dash -compact -offset indent .It lower case and upper case ASCII letters .It the ten decimal digits .It the dash .Pq Sq - .It the dot .Pq Sq \&. .It the slash .Pq Sq / .It the underscore .Pq Sq _ .El .Pp In particular, this applies to all manpaths and architecture names. .Sh ENVIRONMENT The web server may pass the following CGI variables to .Nm : .Bl -tag -width Ds .It Ev SCRIPT_NAME The initial part of the URI passed from the client to the server, starting after the server's host name and ending before .Ev PATH_INFO . This is ignored by .Nm . When constructing URIs for links and redirections, the .Dv SCRIPT_NAME preprocessor constant is used instead. .It Ev PATH_INFO The final part of the URI path passed from the client to the server, starting after the .Ev SCRIPT_NAME and ending before the .Ev QUERY_STRING . It is used by the .Cm show page to acquire the manpath and filename it needs. .It Ev QUERY_STRING The HTTP query string passed from the client to the server. It is the final part of the URI, after the question mark. It is used by the .Cm search page to acquire the named parameters it needs. .El .Sh FILES .Bl -tag -width Ds .It Pa /var/www Default web server .Xr chroot 2 directory. All the following paths are specified relative to this directory. .It Pa /cgi-bin/man.cgi The usual file system path to the .Nm program inside the web server .Xr chroot 2 directory. A different name can be chosen, but in any case, it needs to be configured in .Xr httpd.conf 5 . .It Pa /htdocs The file system path to the server document root directory relative to the server .Xr chroot 2 directory. This is part of the web server configuration and not specific to .Nm . .It Pa /htdocs/mandoc.css A style sheet for .Xr mandoc 1 HTML styling, referenced from each generated HTML page. .It Pa /man Default .Nm data directory containing all the manual trees. Can be overridden by .Dv MAN_DIR . .It Pa /man/manpath.conf The list of available manpaths, one per line. If any of the lines in this file contains a slash .Pq Sq / or any character not contained in the .Sx Restricted character set , .Nm reports an internal server error and exits without doing anything. .It Pa /man/header.html An optional file containing static HTML code to be inserted right after opening the <BODY> element. .It Pa /man/footer.html An optional file containing static HTML code to be inserted right before closing the <BODY> element. .It Pa /man/OpenBSD-current/man1/mandoc.1 An example .Xr mdoc 7 source file located below the .Dq OpenBSD-current manpath. .El .Sh COMPATIBILITY The .Nm CGI program is call-compatible with queries from the traditional .Pa man.cgi script by Wolfram Schneider. However, the output looks quite different. .Sh SEE ALSO .Xr apropos 1 , .Xr mandoc.db 5 , .Xr makewhatis 8 , .Xr slowcgi 8 .Sh HISTORY A version of .Nm based on .Xr mandoc 1 first appeared in mdocml-1.12.1 (March 2012). The current .Xr mandoc.db 5 database format first appeared in .Ox 6.1 . .Sh AUTHORS .An -nosplit The .Nm program was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv and is maintained by .An Ingo Schwarze Aq Mt schwarze@openbsd.org , who also designed and implemented the database format. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/man.conf.5����������������������������������������������������������������������������0100644�0001753�0001753�00000007406�14123140553�0015143�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: man.conf.5,v 1.8 2020/02/10 14:42:10 schwarze Exp $ .\" .\" Copyright (c) 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: February 10 2020 $ .Dt MAN.CONF 5 .Os .Sh NAME .Nm man.conf .Nd configuration file for man .Sh DESCRIPTION This is the configuration file for the .Xr man 1 , .Xr apropos 1 , and .Xr makewhatis 8 utilities. Its presence, and all directives, are optional. .Pp This file is an ASCII text file. Leading whitespace on lines, lines starting with .Sq # , and blank lines are ignored. Words are separated by whitespace. The first word on each line is the name of a configuration directive. .Pp The following directives are supported: .Bl -tag -width Ds .It Ic manpath Ar path Override the default search .Ar path for .Xr man 1 , .Xr apropos 1 , and .Xr makewhatis 8 . It can be used multiple times to specify multiple paths, with the order determining the manual page search order. .Pp Each path is a tree containing subdirectories whose names consist of the strings .Sq man and/or .Sq cat followed by the names of sections, usually single digits. The former are supposed to contain unformatted manual pages in .Xr mdoc 7 and/or .Xr man 7 format; file names should end with the name of the section preceded by a dot. The latter should contain preformatted manual pages; file names should end with .Ql .0 . .Pp Creating a .Xr mandoc.db 5 database with .Xr makewhatis 8 in each directory configured with .Ic manpath is recommended and necessary for .Xr apropos 1 to work, and also for .Xr man 1 on operating systems like .Ox that install each manual page with only one file name in the file system, even if it documents multiple utilities or functions. .It Ic output Ar option Op Ar value Configure the default value of an output option. These directives are overridden by the .Fl O command line options of the same names. For details, see the .Xr mandoc 1 manual. .Pp .Bl -column fragment integer "ascii, utf8" -compact .It Ar option Ta Ar value Ta used by Fl T Ta purpose .It Ta Ta Ta .It Ic fragment Ta none Ta Cm html Ta print only body .It Ic includes Ta string Ta Cm html Ta path to header files .It Ic indent Ta integer Ta Cm ascii , utf8 Ta left margin .It Ic man Ta string Ta Cm html Ta path for \&Xr links .It Ic paper Ta string Ta Cm ps , pdf Ta paper size .It Ic style Ta string Ta Cm html Ta CSS file .It Ic toc Ta none Ta Cm html Ta print table of contents .It Ic width Ta integer Ta Cm ascii , utf8 Ta right margin .El .El .Sh FILES .Bl -tag -width /etc/examples/man.conf -compact .It Pa /etc/man.conf .El .Sh EXAMPLES The following configuration file reproduces the defaults: installing it is equivalent to not having a .Nm file at all. .Bd -literal -offset indent manpath /usr/share/man manpath /usr/X11R6/man manpath /usr/local/man .Ed .Sh SEE ALSO .Xr apropos 1 , .Xr man 1 , .Xr makewhatis 8 .Sh HISTORY A relatively complicated .Nm file format first appeared in .Bx 4.3 Reno . For .Ox 5.8 , it was redesigned from scratch, aiming for simplicity. .Sh AUTHORS .An Ingo Schwarze Aq Mt schwarze@openbsd.org ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/man.h���������������������������������������������������������������������������������0100644�0001753�0001753�00000001737�14123140553�0014303�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: man.h,v 1.79 2018/08/23 19:33:27 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct roff_man; void man_validate(struct roff_man *); ���������������������������������mandoc-1.14.6/man.options.1�������������������������������������������������������������������������0100644�0001753�0001753�00000052062�14123140553�0015703�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: man.options.1,v 1.7 2017/07/04 23:40:01 schwarze Exp $ .\" .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: July 4 2017 $ .Dt MAN.OPTIONS 1 .Os .Sh NAME .Nm man.options .Nd assignment of option letters in manual page utilities .\" .\" Sources that occur repeatedly. .\" Only use if the precise implementation time is unknown. .\" .de PWB .No PWB/UNIX 1.0 Pq July 1, 1977 \\$1 .. .de At7 .At v7 Pq January 1979 \\$1 .. .de At3 .At III Pq June 1980 \\$1 .. .de Bx4 .Bx 4 Pq November 16, 1980 \\$1 .. .de At5 .At V Pq January 1983 \\$1 .. .de Bx43 .Bx 4.3 Pq June 1986 \\$1 .. .\" option was present in groff-1.01 as contained in 4.3BSD-Net/2 .\" and no mention of it could be found in the ChangeLog, .\" so it's probably older than groff-0.4, where the log started .de g04 .No probably before groff-0.4 Pq before July 14, 1990 \\$1 .. .de Eaton .No Eaton Pq before July 7, 1993; 1990/91? \\$1 .. .\" man-1.5e was released on July 11, 1998. .de man15e .No man-1.5e Pq not before 1993, not after 1998 \\$1 .. .\" man-1.5g was released on April 7, 1999. .de man15g .No man-1.5g Pq not before 1993, not after 1999 \\$1 .. .\" code first seen in the initial import of man-db into CVS , .\" which was more or less debian man-db-2.3.17 .\" Colin Watson's first release was 2.3.18 on May 14, 2001 .\" no clue about it found in ChangeLog-2013, .\" so it was probably already present before man-db-2.2a4 .de dbI .No man-db probably before 2.2a4 Pq before Nov 8, 1994 \\$1 .. .\" .\" -------------------------------------------------------------------- .\" .Sh DESCRIPTION This manual page lists option letters used in many different versions of the .Nm man , .Nm apropos , .Nm whatis , .Nm mandoc , .Nm makewhatis , .Nm mandb , .Nm makemandb , .Nm catman , and .Nm manpath utilities. Option letters used by .Nm groff , .Nm nroff , .Nm troff , and .Nm roff are also included because beginning with .At v7 , many versions of .Xr man 1 pass on unrecognized options to these programs. .Pp For each option letter, information is first grouped into paragraphs, each paragraph describing similar functionality and starting with one line briefly summarizing that functionality. .Pp For each program using the letter for that functionality, one line is provided, giving the name of the program, a colon, the system where this letter first appeared for this functionality in this program, optionally a comma and a list of other system versions introducing the same, a semicolon, and a list of current systems supporting it. If a system appears before the semicolon, it is not repeated afterwards. .Pp Entries are sorted by historical precedence, except that obsolete options are moved to the end. Dates are commit dates where known, and release dates otherwise. .Bl -tag -width 3n .It Fl a display all matching manual pages .br .Nm man : .Bx 4.3 Tahoe Pq June 1988 , .Eaton ; .Ox , Fx , Nx , No man-db , man-1.6 , illumos , Solaris 9-11 .br .Nm apropos , whatis , mandoc : .Ox 5.7 Pq August 27, 2014 .Pp only display items that match all keywords .br .Nm apropos : .No man-db Pq Aug 29, 2007 .Pp use all directories and files for .Xr mandoc.db 5 .br .Nm makewhatis : .Ox 5.6 Pq April 18, 2014 .Pp .Bq superseded by Fl T Cm ascii ASCII output mode .br .Nm troff : .At7 .br .Nm groff : .g04 .It Fl B use specified browser .br .Nm man : .No man-1.6 Pq June 24, 2005 .It Fl b print a backtrace with each warning or error message .br .Nm groff : .g04 .Pp .Bq obsolete hardware report whether the phototypesetter is busy .br .Nm troff : .At7 .It Fl C alternate configuration file .br .Nm apropos , whatis : .Bx 4.4 Lite1 Pq April 22, 1994 , .No man-db Pq Feb 22, 2003 ; .Ox , Nx .br .Nm man : .Nx 1.0 Pq Oct 26, 1994 , .man15e ; .Ox .br .Nm mandb , catman , manpath : .No man-db Pq Feb 22, 2003 .br .Nm makemandb : .Nx Pq Feb 7, 2012 .br .Nm makewhatis : .Ox 5.6 Pq April 18, 2014 .br .Nm mandoc : .Ox 5.7 Pq August 27, 2014 .Pp .Bq obsolete enable compatibility mode .br .Nm groff : .No before groff-0.5 Pq before August 3, 1990 .It Fl c do not use a pager .br .Nm man : .Bx 4.3 Reno Pq June 1990 ; .Ox , Nx .br .Nm apropos , whatis , mandoc : .Ox 5.7 Pq August 27, 2014 .Pp process given catpath .br .Nm makewhatis : .Pq not before 1992, not after 1995 .Pp recreate databases from scratch .br .Nm mandb : .dbI .Pp produce a catpath as opposed to a manpath .br .Nm manpath : .dbI .Pp internal option for use by .Xr catman 1 .br .Nm man : .dbI .Pp reformat source page even if cat page exists .br .Nm man : .man15e .Pp disable terminal color output in .Xr grotty 1 .br .Nm groff : .No groff-1.18.0 Pq Oct 4, 2001 .Pp recreate nroff versions from SGML sources .br .Nm catman : .No Solaris 9-11 .Pp .Bq obsolete postprocess with .Xr col 1 .br .Nm man : .At3 , .At5 .It Fl D reset whatever was set with .Ev MANOPT .br .Nm man : .dbI .Pp print debugging info in addition to manual page .br .Nm man : .man15e .Pp set default input encoding for .Xr preconv 1 .br .Nm groff : .No groff-1.20 Pq August 20, 2008 .Pp display all files added to .Xr mandoc.db 5 .br .Nm makewhatis : .Ox 5.6 Pq April 18, 2014 .It Fl d define a user-defined string .br .Nm groff : .g04 .Pp print debugging information .br .Nm man : .Eaton ; .Fx , No man-db , man-1.6 , illumos , Solaris 9-11 .br .Nm manpath : .Eaton ; .Fx , No man-db .br .Nm apropos , whatis : .dbI ; .Fx .br .Nm mandb , catman : .dbI .Pp remove and re-add a file to .Xr mandoc.db 5 .br .Nm makewhatis : .Ox 2.7 Pq Feb 3, 2000 .Pp .Bq superseded by Fl l interpret arguments as file names .br .Nm man : .At3 , .At5 .It Fl E inhibit all error messages .br .Nm groff : .g04 .Pp select output encoding .br .Nm man : .No man-db Pq Dec 23, 2001 .It Fl e preprocess with .Xr eqn 7 .br .Nm man : .At7 .br .Nm groff : .g04 .Pp adjust text to left and right margins .br .Nm nroff : .At7 .Pp use exact matching .br .Nm apropos , whatis : .dbI .Pp restrict search by section extension .br .Nm man : .No man-db-2.3.5 Pq April 21, 1995 .It Fl F use alternate font directory .br .Nm troff : .Bx 4.2 Pq September 1983 .br .Nm groff : .g04 .Pp preformat only, do not display .br .Nm man : .No man-1.5g Pq April 7, 1999 .Pp force searching dirs, do not use index (default) .br .Nm man : .No illumos , Solaris 9-11 .It Fl f .Xr whatis 1 mode .br .Nm man : .Bx4 , .Eaton ; .Ox , Fx , No man-db , man-1.6 .br .Nm apropos , whatis : .No man-db Pq Dec 2, 2010 , .Ox 5.7 Pq August 27, 2014 .br .Nm mandoc : .Ox 5.7 Pq August 27, 2014 .Pp set the default font family .br .Nm groff : .g04 .Pp force formatting even if cat page is newer .br .Nm catman : .Fx Pq March 15, 1995 .Pp update only the entries for the given file .br .Nm mandb : .No man-db Pq Feb 21, 2003 .Pp force rebuilding the database from scratch .br .Nm makemandb : .Nx Pq Feb 7, 2012 .Pp locate manual page related to given file name .br .Nm man : .No illumos , Solaris 9-11 .Pp .Bq obsolete hardware do not feed out paper nor stop phototypesetter .br .Nm troff : .At7 .It Fl G preprocess with .Xr grap 1 .br .Nm groff : .No groff-1.16 Pq May 1, 2000 .It Fl g produce a global manpath .br .Nm manpath : .No man-db-2.2a7 Pq Nov 16, 1994 .Pp preprocess with .Xr grn 1 .br .Nm groff : .No groff-1.16 Pq Feb 20, 2000 .Pp .Bq obsolete hardware output to a GCOS phototypesetter .br .Nm troff : .At7 .Pp .Bq obsolete hardware output to a DASI 300 terminal in 12-pitch mode .br .Nm man : .PWB .It Fl H read hyphenation patterns from the given file .br .Nm groff : .g04 .Pp produce HTML output .br .Nm man : .No man-db-1.3.12 to 1.3.17 Pq not before 1996, not after 2001 .Pp use program to render HTML files as text .br .Nm man : .No man-1.6 Pq June 24, 2005 .It Fl h print a help message and exit .br .Nm groff : .g04 .br .Nm man : .Eaton ; .Fx , No man-db , man-1.6 .br .Nm manpath : .Eaton ; .Fx , No man-db .br .Nm apropos , whatis , mandb , catman : .dbI .Pp display the SYNOPSIS lines only .br .Nm man : .Bx 4.3 Net/2 Pq August 20, 1991 ; .Ox , Nx .br .Nm apropos , whatis , mandoc : .Ox 5.7 Pq Sep 3, 2014 .Pp turn on HTML formatting .br .Nm apropos : .Nx Pq Apr 2, 2013 .Pp .Bq obsolete replace spaces by tabs in the output .br .Nm roff , nroff : .At7 .It Fl I input file search path for .Xr soelim 1 .br .Nm groff : .No groff-1.12 Pq Sep 11, 1999 .Pp respect case when matching manual page names .br .Nm man , catman : .No man-db Pq Apr 21, 2002 .Pp input options, in particular default operating system name .br .Nm mandoc : .Ox 5.2 Pq May 24, 2012 .br .Nm man , apropos , whatis : .Ox 5.7 Pq August 27, 2014 .It Fl i read standard input after the input files are exhausted .br .Nm nroff , troff : .At7 .br .Nm groff : .g04 .Pp ignore case when matching manual page names .br .Nm man , catman : .No man-db Pq Apr 21, 2002 .Pp turn on terminal escape code formatting .br .Nm apropos : .Nx Pq March 29, 2013 .It Fl J preprocess with .Xr gideal 1 .br .Nm groff : .No groff-1.22.3 Pq June 17, 2014 .It Fl j preprocess with .Xr chem 1 .br .Nm groff : .No groff-1.22 Pq Jan 22, 2011 .It Fl K source code full text search .br .Nm man : .man15e , .No man-db Pq June 28, 2009 ; .No Solaris 11 .Pp input encoding .br .Nm groff : .No groff-1.20 Pq Dec 31, 2005 .br .Nm man , apropos , whatis , mandoc : .Ox 5.7 Pq Oct 30, 2014 .It Fl k .Xr apropos 1 mode .br .Nm man : .Bx4 , .Eaton ; .No POSIX , Ox , Fx , Nx , No man-db , man-1.6 , illumos , Solaris 9-11 .br .Nm apropos , whatis , mandoc : .Ox 5.7 Pq August 27, 2014 .Pp ignore formatting errors .br .Nm catman : .Nx Pq April 26, 1994 .Pp preprocess with .Xr preconv 1 .br .Nm groff : .No groff-1.20 Pq Dec 31, 2005 .Pp .Bq obsolete hardware display on a Tektronix 4014 terminal .br .Nm man : .At7 .It Fl L pass argument to the spooler .br .Nm groff : .No groff-0.6 Pq Sep 14, 1990 .Pp use alternate .Xr locale 1 .br .Nm man , apropos , whatis : .No before man-db-2.2a13 Pq before Dec 15, 1994 .Pp print list of locales .br .Nm manpath : .Fx Pq Nov 23, 1999 .Pp use .Xr locale 1 specified in the environment .br .Nm catman : .Fx Pq May 18, 2002 .It Fl l spool the output .br .Nm groff : .g04 .Pp interpret arguments as file names .br .Nm man : .No before man-2.2a7 Pq before Nov 16, 1994 , .Ox 5.7 Pq Aug 30, 2014 .br .Nm apropos , whatis , mandoc : .Ox 5.7 Pq Aug 30, 2014 .Pp do not trim output to the terminal width .br .Nm apropos , whatis : .No man-db Pq Aug 19, 2007 .Pp only parse NAME sections .br .Nm makemandb : .Nx Pq Feb 7, 2012 .Pp legacy mode: search Nm,Nd, no context or formatting .br .Nm apropos : .Nx Pq March 29, 2013 .Pp list all manual pages matching name within the search path .br .Nm man : .No illumos , Solaris 9-11 .It Fl M override manual page search path .br .Nm man : .Bx43 , .Eaton ; .Ox , Fx , Nx , No man-db , man-1.6 , illumos , Solaris 9-11 .br .Nm apropos , whatis : .Bx43 , .No before man-db-2.2a14 Pq before Dec 16, 1994 ; .Ox , No illumos .br .Nm catman : .dbI ; .Nx Pq July 27, 1993 , .No Solaris 9-11 .br .Nm mandoc : .Ox 5.7 Pq August 27, 2014 .Pp prepend to macro file search path .br .Nm groff : .g04 .Pp do not show the context of the match .br .Nm apropos : .Nx Pq May 22, 2016 .It Fl m specify input macro language .br .Nm nroff , troff : .At7 .br .Nm groff : .g04 .br .Nm mandoc : .Ox 4.8 Pq April 6, 2009 .Pp augment manual page search path .br .Nm man , apropos , whatis : .Bx 4.3 Reno Pq June 1990 ; .Ox , Nx .br .Nm catman : .Nx Pq Apr 4, 1999 .br .Nm mandoc : .Ox 5.7 Pq August 27, 2014 .Pp override operating system .br .Nm man : .Eaton ; .No man-db , man-1.6 .br .Nm apropos , whatis , manpath : .dbI .Pp override architecture .br .Nm man : .Fx Pq Jan 11, 2002 .Pp show the context of the match .br .Nm apropos : .Nx Pq May 22, 2016 .It Fl N do not allow newlines between .Xr eqn 7 delimiters .br .Nm groff : .No groff-1.01 Pq Feb 21, 1991 .It Fl n specify a page number for the first page .br .Nm troff : .At7 .br .Nm groff : .g04 .Pp .Xr nroff 1 output mode .br .Nm man : .At7 .Pp do not create the .Xr whatis 1 database .br .Nm catman : .Nx Pq July 27, 1993 .Pp print commands instead of executing them .br .Nm catman : .Fx Pq May 18, 2002 , .No Solaris 9-11 .Pp limit the number of results .br .Nm apropos : .Nx Pq Feb 7, 2012 .Pp dry run simulating .Xr mandoc.db 5 creation .br .Nm makewhatis : .Ox 5.6 Pq April 18, 2014 .It Fl O output options .br .Nm mandoc : .Ox 4.8 Pq Oct 27, 2009 .br .Nm man , apropos , whatis : .Ox 5.7 Pq August 27, 2014 .It Fl o select pages by numbers .br .Nm nroff , troff : .At7 .br .Nm groff : .g04 .Pp force use of non-localized manual pages .br .Nm man : .Fx Pq June 7, 1999 .Pp optimize index for speed and disk space .br .Nm makemandb : .Nx Pq Feb 7, 2012 .It Fl P pass argument to postprocessor .br .Nm groff : .No groff-0.6 Pq Sep 14, 1990 .Pp use specified pager .br .Nm man : .Eaton ; .Fx , No man-db , man-1.6 .Pp turn on pager formatting .br .Nm apropos : .Nx Pq Apr 2, 2013 .It Fl p preprocess with .Xr pic 1 .br .Nm groff : .g04 .Pp use the given list of preprocessors .br .Nm man : .Eaton ; .Fx , No man-db , man-1.6 .Pp dry run, display commands instead of executing them .br .Nm catman : .Nx Pq July 27, 1993 , .Fx Pq March 15, 1995 to May 18, 2002 , .No Solaris 9-11 .Pp print warnings when building .Xr mandoc.db 5 .br .Nm makewhatis : .Ox 2.7 Pq April 23, 2000 .Pp do not look for deleted manual pages .br .Nm mandb : .No man-db Pq June 28, 2001 .Pp print the search path for manual pages .br .Nm man : .Nx Pq June 14 , 2011 .Pp turn on pager formatting and pipe through pager .br .Nm apropos : .Nx Pq Feb 7, 2012 .Pp .Bq obsolete hardware set phototypesetter point size .br .Nm troff : .At7 .It Fl Q print only fatal error messages .br .Nm makemandb : .Nx Pq Aug 29, 2012 .Pp quick mode of .Xr mandoc.db 5 creation .br .Nm makewhatis : .Ox 5.6 Pq April 18, 2014 .It Fl q invoke the simultaneous input-output mode of the .rd request .br .Nm nroff , troff : .At7 .Pp issue no warnings .br .Nm manpath : .Eaton ; .Fx , No man-db .br .Nm mandb : .dbI .Pp print only warnings and errors, no status updates .br .Nm makemandb : .Nx Pq Aug 29, 2012 .It Fl R postprocess with .Xr refer 1 .br .Nm groff : .No groff-1.02 Pq June 2, 1991 .Pp recode to the specified encoding .br .Nm man : .No man-db Pq Dec 31, 2007 .It Fl r set number register .br .Nm nroff , troff : .At7 .br .Nm groff : .g04 .Pp scan for and remove junk files .br .Nm catman : .Fx Pq March 31, 1995 .Pp set .Xr less 1 prompt .br .Nm man : .No man-db-2.3.5 Pq April 21, 1995 .Pp use regular expression matching .br .Nm apropos , whatis : .No man-db-2.3.5 Pq April 21, 1995 .Pp turn off formatting .br .Nm apropos : .Nx Pq Feb 10, 2013 .Pp check for formatting errors, do not display .br .Nm man : .No illumos , Solaris 9-11 .It Fl S manual section search list .br .Nm man : .Eaton ; .Fx , No man-db , man-1.6 .Pp safer mode .br .Nm groff : .No groff-1.10 Pq May 17, 1994 .Pp restrict architecture .br .Nm man : .Ox 2.3 Pq March 9, 1998 , .Nx Pq May 27, 2000 .br .Nm apropos : .Ox 4.5 Pq Dec 24, 2008 , .Nx Pq May 8, 2009 .br .Nm whatis : .Ox 5.6 Pq April 18, 2014 .br .Nm mandoc : .Ox 5.7 Pq August 27, 2014 .It Fl s preprocess with .Xr soelim 1 .br .Nm groff : .g04 .Pp silent mode, do not echo commands .br .Nm catman : .Nx Pq April 26, 1994 .Pp restrict section .br .Nm makewhatis : .man15g .br .Nm man : .Ox 2.3 Pq March 9, 1998 , .Nx Pq June 12, 2000 ; .No illumos , Solaris 9-11 .br .Nm apropos : .No man-db Pq Nov 16, 2003 , .Ox 4.5 Pq Dec 24, 2008 , .Nx Pq May 8, 2009 ; .No illumos .br .Nm whatis : .No man-db Pq Nov 16, 2003 , .Ox 5.6 Pq April 18, 2014 ; .No illumos .br .Nm mandoc : .Ox 5.7 Pq August 27, 2014 .Pp do not look for stray cats .br .Nm mandb : .dbI .Pp .Bq SysV compat, recommends Fl S manual section search list .br .Nm man : .No man-db Pq Jan 1, 2008 .Pp .Bq superseded by Fl h display the SYNOPSIS lines only .br .Nm man : .PWB .Pp .Bq obsolete hardware pause before each page for paper manipulation .br .Nm roff : .At7 .Pp .Bq obsolete hardware .Xr troff 1 output mode, small format .br .Nm man : .At3 , .At5 .It Fl T select terminal output format .br .Nm nroff : .At7 .br .Nm man : .At3 , .At5 , .dbI , .Ox 5.7 Pq August 27, 2014 .br .Nm groff : .g04 .br .Nm mandoc : .Ox 4.8 Pq April 6, 2009 .br .Nm apropos , whatis : .Ox 5.7 Pq August 27, 2014 .Pp use UTF-8 for .Xr mandoc.db 5 .br .Nm makewhatis : .Ox 5.6 Pq April 18, 2014 .Pp .Bq superseded by Fl m use other macro package .br .Nm man , catman : .No Solaris 9-11 .It Fl t .Xr troff 1 output mode .br .Nm man : .PWB , .At7 , .Bx 2 Pq May 10, 1979 , .At3 , .At5 , .Eaton ; .Fx , No man-db , man-1.6 , illumos , Solaris 9-11 .br .Nm catman : .No Solaris 9-11 .Pp preprocess with .Xr tbl 7 .br .Nm groff : .g04 .Pp check manual pages in the hierarchy .br .Nm mandb : .No man-db-1.3.12 to 1.3.17 Pq not before 1996, not after 2001 .Pp check files for problems related to .Xr mandoc.db 5 .br .Nm makewhatis : .Ox 2.7 Pq April 23, 2000 .It Fl U unsafe mode .br .Nm groff : .No groff-1.12 Pq Dec 13, 1999 .It Fl u update database .br .Nm makewhatis : .Pq not before 1992, not after 1995 .Pp create user databases only .br .Nm mandb : .dbI .Pp update database cache (requires suid) .br .Nm man : .No before man-db-2.2a10 Pq before Dec 6, 1994 .Pp remove files from .Xr mandoc.db 5 .br .Nm makewhatis : .Ox 3.4 Pq July 9, 2003 .It Fl V print the pipeline on stdout instead of executing it .br .Nm groff : .No groff-0.6 Pq Sep 2, 1990 .Pp print version information .br .Nm man , apropos , whatis , mandb , catman , manpath : .dbI .It Fl v print version number .br .Nm groff : .g04 .Pp verbose mode .br .Nm catman : .Fx Pq March 15, 1995 .br .Nm makewhatis : .man15g .br .Nm apropos , whatis : .No man-db Pq Dec 29, 2002 .Pp print the name of every parsed file .br .Nm makemandb : .Nx Pq Feb 7, 2012 .Pp .Bq obsolete hardware produce output on the Versatec printer .br .Nm man : .PWB .It Fl W disable the named warning .br .Nm groff : .No groff-0.5 Pq August 14, 1990 .Pp list pathnames without additional information .br .Nm man : .man15e .Pp list pathnames of cat files .br .Nm man : .No man-db Pq Aug 13, 2002 .Pp minimum message level to display .br .Nm mandoc : .Ox 4.8 Pq April 6, 2009 .br .Nm man , apropos , whatis : .Ox 5.7 Pq August 27, 2014 .It Fl w list pathnames .br .Nm man : .At7 , .At3 , .At5 , .Eaton ; .Ox , Fx , Nx , No man-db , man-1.6 .br .Nm apropos , whatis , mandoc : .Ox 5.7 Pq August 27, 2014 .Pp enable the named warning .br .Nm groff : .No groff-0.5 Pq August 14, 1990 .Pp only create the .Xr whatis 1 database .br .Nm catman : .Nx Pq July 27, 1993 , .No Solaris 9-11 .Pp use wildcard matching .br .Nm apropos , whatis : .No man-db-2.3.5 Pq April 21, 1995 .Pp use manpath obtained from man --path .br .Nm makewhatis : .man15g .Pp update the .Xr whatis 1 database .br .Nm man : .No illumos .Pp .Bq obsolete hardware wait until the phototypesetter is available .br .Nm troff : .At7 .It Fl X display with .Xr gxditview 1 .br .Nm groff : .No groff-1.06 Pq Sep 1, 1992 .br .Nm man : .dbI .It Fl y use the non-compacted version of the macros .br .Nm man : .At3 , .At5 .It Fl Z do not run preprocessors .br .Nm groff : .g04 .br .Nm man : .No man-db-2.2a5 Pq Nov 10, 1994 .It Fl z suppress formatted output from .Xr troff 1 , print only error messages .br .Nm groff : .g04 .It Fl 7 ASCII output mode .br .Nm man : .No man-db-2.3.5 Pq April 21, 1995 .It Fl \&? print a help message and exit .br .Nm groff : .g04 .br .Nm man , manpath : .Eaton ; .Fx , No man-db .br .Nm apropos , whatis , mandb , catman : .dbI .El .Pp Multi-letter options: .Bl -tag -width Ds .It Fl hp .Bq obsolete hardware output to a Hewlett Packard terminal .br .Nm man : .PWB .It Fl 12 .Bq obsolete hardware use 12-pitch for certain terminals .br .Nm man : .At3 , .At5 .It Fl 450 .Bq obsolete hardware output to a DASI 450 terminal .br .Nm man : .PWB .El .Pp In .At v3 , .Xr man 1 had no options. .br The syntax was: .Sy man Ar name Op Ar section .Pp In .At v4 , .br the syntax changed to: .Sy man Oo Ar section Oc Op Ar name ... .Sh AUTHORS This information was assembled by .An Ingo Schwarze Aq Mt schwarze@openbsd.org using .Bl -bullet -compact .It the Unix Archive of the Unix Heritage Society .It the CSRG Archive CD-ROMs .It the .Fx SVN repository .It the .Ox CVS repository .It the .Nx CVS repository .It the GNU roff (groff) git repository .It the 4.3BSD-Net/2 groff CHANGES file (Oct 1990 to March 1991) .It the 4.3BSD-Net/2 groff ChangeLog file (July 1990 to March 1991) .It the man-db CVS and git repositories (since April 2001) .It the man-db NEWS file (April 1995 to Dec 2016) .It the man-db ChangeLog-2013 file (Nov 1994 to Dec 2013) .It release tarballs man-1.5g (July 1998) to man-1.5p (Jan 2005), man-1.6 (June 2005), and man-1.6a to man-1.6g (Dec 2010) .It a makewhatis release tarball without version number from 1995 .It the illumos manual pages on the WWW .It and Solaris 11, SunOS 5.10, and SunOS 5.9 machines at opencsw.org. .El ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/manconf.h�����������������������������������������������������������������������������0100644�0001753�0001753�00000003362�14123140553�0015145�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $OpenBSD: manconf.h,v 1.7 2018/11/22 11:30:15 schwarze Exp $ */ /* * Copyright (c) 2011,2015,2017,2018,2020 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Public interface to man(1) configuration management. * For use by the main program and by the formatters. */ /* List of unique, absolute paths to manual trees. */ struct manpaths { char **paths; size_t sz; }; /* Data from -O options and man.conf(5) output directives. */ struct manoutput { char *includes; char *man; char *outfilename; char *paper; char *style; char *tag; char *tagfilename; size_t indent; size_t width; int fragment; int mdoc; int noval; int synopsisonly; int tag_found; int toc; }; struct manconf { struct manoutput output; struct manpaths manpath; }; void manconf_parse(struct manconf *, const char *, char *, char *); int manconf_output(struct manoutput *, const char *, int); void manconf_free(struct manconf *); void manpath_base(struct manpaths *); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc.1������������������������������������������������������������������������������0100644�0001753�0001753�00000162435�14123140553�0014705�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $OpenBSD: mandoc.1,v 1.166 2020/02/15 15:28:01 schwarze Exp $ .\" .\" Copyright (c) 2012, 2014-2021 Ingo Schwarze <schwarze@openbsd.org> .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: August 14 2021 $ .Dt MANDOC 1 .Os .Sh NAME .Nm mandoc .Nd format manual pages .Sh SYNOPSIS .Nm mandoc .Op Fl ac .Op Fl I Cm os Ns = Ns Ar name .Op Fl K Ar encoding .Op Fl mdoc | man .Op Fl O Ar options .Op Fl T Ar output .Op Fl W Ar level .Op Ar .Sh DESCRIPTION The .Nm utility formats manual pages for display. .Pp By default, .Nm reads .Xr mdoc 7 or .Xr man 7 text from stdin and produces .Fl T Cm locale output. .Pp The options are as follows: .Bl -tag -width Ds .It Fl a If the standard output is a terminal device and .Fl c is not specified, use .Xr less 1 to paginate the output, just like .Xr man 1 would. .It Fl c Copy the formatted manual pages to the standard output without using .Xr less 1 to paginate them. This is the default. It can be specified to override .Fl a . .It Fl I Cm os Ns = Ns Ar name Override the default operating system .Ar name for the .Xr mdoc 7 .Ic \&Os and for the .Xr man 7 .Ic \&TH macro. .It Fl K Ar encoding Specify the input encoding. The supported .Ar encoding arguments are .Cm us-ascii , .Cm iso-8859-1 , and .Cm utf-8 . If not specified, autodetection uses the first match in the following list: .Bl -enum .It If the first three bytes of the input file are the UTF-8 byte order mark (BOM, 0xefbbbf), input is interpreted as .Cm utf-8 . .It If the first or second line of the input file matches the .Sy emacs mode line format .Pp .D1 .\e" -*- Oo ...; Oc coding: Ar encoding ; No -*- .Pp then input is interpreted according to .Ar encoding . .It If the first non-ASCII byte in the file introduces a valid UTF-8 sequence, input is interpreted as .Cm utf-8 . .It Otherwise, input is interpreted as .Cm iso-8859-1 . .El .It Fl mdoc | man With .Fl mdoc , all input files are interpreted as .Xr mdoc 7 . With .Fl man , all input files are interpreted as .Xr man 7 . By default, the input language is automatically detected for each file: if the first macro is .Ic \&Dd or .Ic \&Dt , the .Xr mdoc 7 parser is used; otherwise, the .Xr man 7 parser is used. With other arguments, .Fl m is silently ignored. .It Fl O Ar options Comma-separated output options. See the descriptions of the individual output formats for supported .Ar options . .It Fl T Ar output Select the output format. Supported values for the .Ar output argument are .Cm ascii , .Cm html , the default of .Cm locale , .Cm man , .Cm markdown , .Cm pdf , .Cm ps , .Cm tree , and .Cm utf8 . .Pp The special .Fl T Cm lint mode only parses the input and produces no output. It implies .Fl W Cm all and redirects parser messages, which usually appear on standard error output, to standard output. .It Fl W Ar level Specify the minimum message .Ar level to be reported on the standard error output and to affect the exit status. The .Ar level can be .Cm base , .Cm style , .Cm warning , .Cm error , or .Cm unsupp . The .Cm base level automatically derives the operating system from the contents of the .Ic \&Os macro, from the .Fl Ios command line option, or from the .Xr uname 3 return value. The levels .Cm openbsd and .Cm netbsd are variants of .Cm base that bypass autodetection and request validation of base system conventions for a particular operating system. The level .Cm all is an alias for .Cm base . By default, .Nm is silent. See .Sx EXIT STATUS and .Sx DIAGNOSTICS for details. .Pp The special option .Fl W Cm stop tells .Nm to exit after parsing a file that causes warnings or errors of at least the requested level. No formatted output will be produced from that file. If both a .Ar level and .Cm stop are requested, they can be joined with a comma, for example .Fl W Cm error , Ns Cm stop . .It Ar file Read from the given input file. If multiple files are specified, they are processed in the given order. If unspecified, .Nm reads from standard input. .El .Pp The options .Fl fhklw are also supported and are documented in .Xr man 1 . In .Fl f and .Fl k mode, .Nm also supports the options .Fl CMmOSs described in the .Xr apropos 1 manual. The options .Fl fkl are mutually exclusive and override each other. .Ss ASCII Output Use .Fl T Cm ascii to force text output in 7-bit ASCII character encoding documented in the .Xr ascii 7 manual page, ignoring the .Xr locale 1 set in the environment. .Pp Font styles are applied by using back-spaced encoding such that an underlined character .Sq c is rendered as .Sq _ Ns \e[bs] Ns c , where .Sq \e[bs] is the back-space character number 8. Emboldened characters are rendered as .Sq c Ns \e[bs] Ns c . This markup is typically converted to appropriate terminal sequences by the pager or .Xr ul 1 . To remove the markup, pipe the output to .Xr col 1 .Fl b instead. .Pp The special characters documented in .Xr mandoc_char 7 are rendered best-effort in an ASCII equivalent. In particular, opening and closing .Sq single quotes are represented as characters number 0x60 and 0x27, respectively, which agrees with all ASCII standards from 1965 to the latest revision (2012) and which matches the traditional way in which .Xr roff 7 formatters represent single quotes in ASCII output. This correct ASCII rendering may look strange with modern Unicode-compatible fonts because contrary to ASCII, Unicode uses the code point U+0060 for the grave accent only, never for an opening quote. .Pp The following .Fl O arguments are accepted: .Bl -tag -width Ds .It Cm indent Ns = Ns Ar indent The left margin for normal text is set to .Ar indent blank characters instead of the default of five for .Xr mdoc 7 and seven for .Xr man 7 . Increasing this is not recommended; it may result in degraded formatting, for example overfull lines or ugly line breaks. When output is to a pager on a terminal that is less than 66 columns wide, the default is reduced to three columns. .It Cm mdoc Format .Xr man 7 input files in .Xr mdoc 7 output style. This prints the operating system name rather than the page title on the right side of the footer line, and it implies .Fl O Cm indent Ns =5 . One useful application is for checking that .Fl T Cm man output formats in the same way as the .Xr mdoc 7 source it was generated from. .It Cm tag Ns Op = Ns Ar term If the formatted manual page is opened in a pager, go to the definition of the .Ar term rather than showing the manual page from the beginning. If no .Ar term is specified, reuse the first command line argument that is not a .Ar section number. If that argument is in .Xr apropos 1 .Ar key Ns = Ns Ar val format, only the .Ar val is used rather than the argument as a whole. This is useful for commands like .Ql man -akO tag Ic=ulimit to search for a keyword and jump right to its definition in the matching manual pages. .It Cm width Ns = Ns Ar width The output width is set to .Ar width instead of the default of 78. When output is to a pager on a terminal that is less than 79 columns wide, the default is reduced to one less than the terminal width. In any case, lines that are output in literal mode are never wrapped and may exceed the output width. .El .Ss HTML Output Output produced by .Fl T Cm html conforms to HTML5 using optional self-closing tags. Default styles use only CSS1. Equations rendered from .Xr eqn 7 blocks use MathML. .Pp The file .Pa /usr/share/misc/mandoc.css documents style-sheet classes available for customising output. If a style-sheet is not specified with .Fl O Cm style , .Fl T Cm html defaults to simple output (via an embedded style-sheet) readable in any graphical or text-based web browser. .Pp Non-ASCII characters are rendered as hexadecimal Unicode character references. .Pp The following .Fl O arguments are accepted: .Bl -tag -width Ds .It Cm fragment Omit the <!DOCTYPE> declaration and the <html>, <head>, and <body> elements and only emit the subtree below the <body> element. The .Cm style argument will be ignored. This is useful when embedding manual content within existing documents. .It Cm includes Ns = Ns Ar fmt The string .Ar fmt , for example, .Ar ../src/%I.html , is used as a template for linked header files (usually via the .Ic \&In macro). Instances of .Sq \&%I are replaced with the include filename. The default is not to present a hyperlink. .It Cm man Ns = Ns Ar fmt Ns Op ; Ns Ar fmt The string .Ar fmt , for example, .Ar ../html%S/%N.%S.html , is used as a template for linked manuals (usually via the .Ic \&Xr macro). Instances of .Sq \&%N and .Sq %S are replaced with the linked manual's name and section, respectively. If no section is included, section 1 is assumed. The default is not to present a hyperlink. If two formats are given and a file .Ar %N.%S exists in the current directory, the first format is used; otherwise, the second format is used. .It Cm style Ns = Ns Ar style.css The file .Ar style.css is used for an external style-sheet. This must be a valid absolute or relative URI. .It Cm tag Ns Op = Ns Ar term Same syntax and semantics as for .Sx ASCII Output . This is implemented by passing a .Ic file:// URI ending in a fragment identifier to the pager rather than passing merely a file name. When using this argument, use a pager supporting such URIs, for example .Bd -literal -offset 3n MANPAGER='lynx -force_html' man -T html -O tag=MANPAGER man MANPAGER='w3m -T text/html' man -T html -O tag=toc mandoc .Ed .Pp Consequently, for HTML output, this argument does not work with .Xr more 1 or .Xr less 1 . For example, .Ql MANPAGER=less man -T html -O tag=toc mandoc does not work because .Xr less 1 does not support .Ic file:// URIs. .It Cm toc If an input file contains at least two non-standard sections, print a table of contents near the beginning of the output. .El .Ss Locale Output By default, .Nm automatically selects UTF-8 or ASCII output according to the current .Xr locale 1 . If any of the environment variables .Ev LC_ALL , .Ev LC_CTYPE , or .Ev LANG are set and the first one that is set selects the UTF-8 character encoding, it produces .Sx UTF-8 Output ; otherwise, it falls back to .Sx ASCII Output . This output mode can also be selected explicitly with .Fl T Cm locale . .Ss Man Output Use .Fl T Cm man to translate .Xr mdoc 7 input into .Xr man 7 output format. This is useful for distributing manual sources to legacy systems lacking .Xr mdoc 7 formatters. Embedded .Xr eqn 7 and .Xr tbl 7 code is not supported. .Pp If the input format of a file is .Xr man 7 , the input is copied to the output. The parser is also run, and as usual, the .Fl W level controls which .Sx DIAGNOSTICS are displayed before copying the input to the output. .Ss Markdown Output Use .Fl T Cm markdown to translate .Xr mdoc 7 input to the markdown format conforming to .Lk http://daringfireball.net/projects/markdown/syntax.text\ "John Gruber's 2004 specification" . The output also almost conforms to the .Lk http://commonmark.org/ CommonMark specification. .Pp The character set used for the markdown output is ASCII. Non-ASCII characters are encoded as HTML entities. Since that is not possible in literal font contexts, because these are rendered as code spans and code blocks in the markdown output, non-ASCII characters are transliterated to ASCII approximations in these contexts. .Pp Markdown is a very weak markup language, so all semantic markup is lost, and even part of the presentational markup may be lost. Do not use this as an intermediate step in converting to HTML; instead, use .Fl T Cm html directly. .Pp The .Xr man 7 , .Xr tbl 7 , and .Xr eqn 7 input languages are not supported by .Fl T Cm markdown output mode. .Ss PDF Output PDF-1.1 output may be generated by .Fl T Cm pdf . See .Sx PostScript Output for .Fl O arguments and defaults. .Ss PostScript Output PostScript .Qq Adobe-3.0 Level-2 pages may be generated by .Fl T Cm ps . Output pages default to letter sized and are rendered in the Times font family, 11-point. Margins are calculated as 1/9 the page length and width. Line-height is 1.4m. .Pp Special characters are rendered as in .Sx ASCII Output . .Pp The following .Fl O arguments are accepted: .Bl -tag -width Ds .It Cm paper Ns = Ns Ar name The paper size .Ar name may be one of .Ar a3 , .Ar a4 , .Ar a5 , .Ar legal , or .Ar letter . You may also manually specify dimensions as .Ar NNxNN , width by height in millimetres. If an unknown value is encountered, .Ar letter is used. .El .Ss UTF-8 Output Use .Fl T Cm utf8 to force text output in UTF-8 multi-byte character encoding, ignoring the .Xr locale 1 settings in the environment. See .Sx ASCII Output regarding font styles and .Fl O arguments. .Pp On operating systems lacking locale or wide character support, and on those where the internal character representation is not UCS-4, .Nm always falls back to .Sx ASCII Output . .Ss Syntax tree output Use .Fl T Cm tree to show a human readable representation of the syntax tree. It is useful for debugging the source code of manual pages. The exact format is subject to change, so don't write parsers for it. .Pp The first paragraph shows meta data found in the .Xr mdoc 7 prologue, on the .Xr man 7 .Ic \&TH line, or the fallbacks used. .Pp In the tree dump, each output line shows one syntax tree node. Child nodes are indented with respect to their parent node. The columns are: .Pp .Bl -enum -compact .It For macro nodes, the macro name; for text and .Xr tbl 7 nodes, the content. There is a special format for .Xr eqn 7 nodes. .It Node type (text, elem, block, head, body, body-end, tail, tbl, eqn). .It Flags: .Bl -dash -compact .It An opening parenthesis if the node is an opening delimiter. .It An asterisk if the node starts a new input line. .It The input line number (starting at one). .It A colon. .It The input column number (starting at one). .It A closing parenthesis if the node is a closing delimiter. .It A full stop if the node ends a sentence. .It BROKEN if the node is a block broken by another block. .It NOSRC if the node is not in the input file, but automatically generated from macros. .It NOPRT if the node is not supposed to generate output for any output format. .El .El .Pp The following .Fl O argument is accepted: .Bl -tag -width Ds .It Cm noval Skip validation and show the unvalidated syntax tree. This can help to find out whether a given behaviour is caused by the parser or by the validator. Meta data is not available in this case. .El .Sh ENVIRONMENT .Bl -tag -width MANPAGER .It Ev LC_CTYPE The character encoding .Xr locale 1 . When .Sx Locale Output is selected, it decides whether to use ASCII or UTF-8 output format. It never affects the interpretation of input files. .It Ev MANPAGER Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, .Xr less 1 ; see .Xr man 1 for details. Only used if .Fl a or .Fl l is specified. .It Ev PAGER Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, .Xr less 1 is used. Only used if .Fl a or .Fl l is specified. .El .Sh EXIT STATUS The .Nm utility exits with one of the following values, controlled by the message .Ar level associated with the .Fl W option: .Pp .Bl -tag -width Ds -compact .It 0 No base system convention violations, style suggestions, warnings, or errors occurred, or those that did were ignored because they were lower than the requested .Ar level . .It 1 At least one base system convention violation or style suggestion occurred, but no warning or error, and .Fl W Cm base or .Fl W Cm style was specified. .It 2 At least one warning occurred, but no error, and .Fl W Cm warning or a lower .Ar level was requested. .It 3 At least one parsing error occurred, but no unsupported feature was encountered, and .Fl W Cm error or a lower .Ar level was requested. .It 4 At least one unsupported feature was encountered, and .Fl W Cm unsupp or a lower .Ar level was requested. .It 5 Invalid command line arguments were specified. No input files have been read. .It 6 An operating system error occurred, for example exhaustion of memory, file descriptors, or process table entries. Such errors may cause .Nm to exit at once, possibly in the middle of parsing or formatting a file. .El .Pp Note that selecting .Fl T Cm lint output mode implies .Fl W Cm all . .Sh EXAMPLES To page manuals to the terminal: .Pp .Dl $ mandoc -l mandoc.1 man.1 apropos.1 makewhatis.8 .Pp To produce HTML manuals with .Pa /usr/share/misc/mandoc.css as the style-sheet: .Pp .Dl $ mandoc \-T html -O style=/usr/share/misc/mandoc.css mdoc.7 > mdoc.7.html .Pp To check over a large set of manuals: .Pp .Dl $ mandoc \-T lint \(gafind /usr/src -name \e*\e.[1-9]\(ga .Pp To produce a series of PostScript manuals for A4 paper: .Pp .Dl $ mandoc \-T ps \-O paper=a4 mdoc.7 man.7 > manuals.ps .Pp Convert a modern .Xr mdoc 7 manual to the older .Xr man 7 format, for use on systems lacking an .Xr mdoc 7 parser: .Pp .Dl $ mandoc \-T man foo.mdoc > foo.man .Sh DIAGNOSTICS Messages displayed by .Nm follow this format: .Bd -ragged -offset indent .Nm : .Ar file : Ns Ar line : Ns Ar column : level : message : macro arguments .Pq Ar os .Ed .Pp The first three fields identify the .Ar file name, .Ar line number, and .Ar column number of the input file where the message was triggered. The line and column numbers start at 1. Both are omitted for messages referring to an input file as a whole. All .Ar level and .Ar message strings are explained below. The name of the .Ar macro triggering the message and its .Ar arguments are omitted where meaningless. The .Ar os operating system specifier is omitted for messages that are relevant for all operating systems. Fatal messages about invalid command line arguments or operating system errors, for example when memory is exhausted, may also omit the .Ar file and .Ar level fields. .Pp Message levels have the following meanings: .Bl -tag -width "warning" .It Cm syserr An operating system error occurred. There isn't necessarily anything wrong with the input files. Output may all the same be missing or incomplete. .It Cm badarg Invalid command line arguments were specified. No input files have been read and no output is produced. .It Cm unsupp An input file uses unsupported low-level .Xr roff 7 features. The output may be incomplete and/or misformatted, so using GNU troff instead of .Nm to process the file may be preferable. .It Cm error Indicates a risk of information loss or severe misformatting, in most cases caused by serious syntax errors. .It Cm warning Indicates a risk that the information shown or its formatting may mismatch the author's intent in minor ways. Additionally, syntax errors are classified at least as warnings, even if they do not usually cause misformatting. .It Cm style An input file uses dubious or discouraged style. This is not a complaint about the syntax, and probably neither formatting nor portability are in danger. While great care is taken to avoid false positives on the higher message levels, the .Cm style level tries to reduce the probability that issues go unnoticed, so it may occasionally issue bogus suggestions. Please use your good judgement to decide whether any particular .Cm style suggestion really justifies a change to the input file. .It Cm base A convention used in the base system of a specific operating system is not adhered to. These are not markup mistakes, and neither the quality of formatting nor portability are in danger. Messages of the .Cm base level are printed with the more intuitive .Cm style .Ar level tag. .El .Pp Messages of the .Cm base , .Cm style , .Cm warning , .Cm error , and .Cm unsupp levels are hidden unless their level, or a lower level, is requested using a .Fl W option or .Fl T Cm lint output mode. .Pp As indicated below, all .Cm base and some .Cm style checks are only performed if a specific operating system name occurs in the arguments of the .Fl W command line option, of the .Ic \&Os macro, of the .Fl Ios command line option, or, if neither are present, in the return value of the .Xr uname 3 function. .Ss Conventions for base system manuals .Bl -ohang .It Sy "Mdocdate found" .Pq mdoc , Nx The .Ic \&Dd macro uses CVS .Ic Mdocdate keyword substitution, which is not supported by the .Nx base system. Consider using the conventional .Dq "Month dd, yyyy" format instead. .It Sy "Mdocdate missing" .Pq mdoc , Ox The .Ic \&Dd macro does not use CVS .Ic Mdocdate keyword substitution, but using it is conventionally expected in the .Ox base system. .It Sy "unknown architecture" .Pq mdoc , Ox , Nx The third argument of the .Ic \&Dt macro does not match any of the architectures this operating system is running on. .It Sy "operating system explicitly specified" .Pq mdoc , Ox , Nx The .Ic \&Os macro has an argument. In the base system, it is conventionally left blank. .It Sy "RCS id missing" .Pq Ox , Nx The manual page lacks the comment line with the RCS identifier generated by CVS .Ic OpenBSD or .Ic NetBSD keyword substitution as conventionally used in these operating systems. .El .Ss Style suggestions .Bl -ohang .It Sy "legacy man(7) date format" .Pq mdoc The .Ic \&Dd macro uses the legacy .Xr man 7 date format .Dq yyyy-dd-mm . Consider using the conventional .Xr mdoc 7 date format .Dq "Month dd, yyyy" instead. .It Sy "normalizing date format to" : No ... .Pq mdoc , man The .Ic \&Dd or .Ic \&TH macro provides an abbreviated month name or a day number with a leading zero. In the formatted output, the month name is written out in full and the leading zero is omitted. .It Sy "lower case character in document title" .Pq mdoc , man The title is still used as given in the .Ic \&Dt or .Ic \&TH macro. .It Sy "duplicate RCS id" A single manual page contains two copies of the RCS identifier for the same operating system. Consider deleting the later instance and moving the first one up to the top of the page. .It Sy "possible typo in section name" .Pq mdoc Fuzzy string matching revealed that the argument of an .Ic \&Sh macro is similar, but not identical to a standard section name. .It Sy "unterminated quoted argument" .Pq roff Macro arguments can be enclosed in double quote characters such that space characters and macro names contained in the quoted argument need not be escaped. The closing quote of the last argument of a macro can be omitted. However, omitting it is not recommended because it makes the code harder to read. .It Sy "useless macro" .Pq mdoc A .Ic \&Bt , .Ic \&Tn , or .Ic \&Ud macro was found. Simply delete it: it serves no useful purpose. .It Sy "consider using OS macro" .Pq mdoc A string was found in plain text or in a .Ic \&Bx macro that could be represented using .Ic \&Ox , .Ic \&Nx , .Ic \&Fx , or .Ic \&Dx . .It Sy "errnos out of order" .Pq mdoc, Nx The .Ic \&Er items in a .Ic \&Bl list are not in alphabetical order. .It Sy "duplicate errno" .Pq mdoc, Nx A .Ic \&Bl list contains two consecutive .Ic \&It entries describing the same .Ic \&Er number. .It Sy "referenced manual not found" .Pq mdoc An .Ic \&Xr macro references a manual page that was not found. When running with .Fl W Cm base , the search is restricted to the base system, by default to .Pa /usr/share/man : Ns Pa /usr/X11R6/man . This path can be configured at compile time using the .Dv MANPATH_BASE preprocessor macro. When running with .Fl W Cm style , the search is done along the full search path as described in the .Xr man 1 manual page, respecting the .Fl m and .Fl M command line options, the .Ev MANPATH environment variable, the .Xr man.conf 5 file and falling back to the default of .Pa /usr/share/man : Ns Pa /usr/X11R6/man : Ns Pa /usr/local/man , also configurable at compile time using the .Dv MANPATH_DEFAULT preprocessor macro. .It Sy "trailing delimiter" .Pq mdoc The last argument of an .Ic \&Ex , \&Fo , \&Nd , \&Nm , \&Os , \&Sh , \&Ss , \&St , or .Ic \&Sx macro ends with a trailing delimiter. This is usually bad style and often indicates typos. Most likely, the delimiter can be removed. .It Sy "no blank before trailing delimiter" .Pq mdoc The last argument of a macro that supports trailing delimiter arguments is longer than one byte and ends with a trailing delimiter. Consider inserting a blank such that the delimiter becomes a separate argument, thus moving it out of the scope of the macro. .It Sy "fill mode already enabled, skipping" .Pq man A .Ic \&fi request occurs even though the document is still in fill mode, or already switched back to fill mode. It has no effect. .It Sy "fill mode already disabled, skipping" .Pq man An .Ic \&nf request occurs even though the document already switched to no-fill mode and did not switch back to fill mode yet. It has no effect. .It Sy "input text line longer than 80 bytes" Consider breaking the input text line at one of the blank characters before column 80. .It Sy "verbatim \(dq--\(dq, maybe consider using \e(em" .Pq mdoc Even though the ASCII output device renders an em-dash as .Qq \-\- , that is not a good way to write it in an input file because it renders poorly on all other output devices. .It Sy "function name without markup" .Pq mdoc A word followed by an empty pair of parentheses occurs on a text line. Consider using an .Ic \&Fn or .Ic \&Xr macro. .It Sy "whitespace at end of input line" .Pq mdoc , man , roff Whitespace at the end of input lines is almost never semantically significant \(em but in the odd case where it might be, it is extremely confusing when reviewing and maintaining documents. .It Sy "bad comment style" .Pq roff Comment lines start with a dot, a backslash, and a double-quote character. The .Nm utility treats the line as a comment line even without the backslash, but leaving out the backslash might not be portable. .El .Ss Warnings related to the document prologue .Bl -ohang .It Sy "missing manual title, using UNTITLED" .Pq mdoc A .Ic \&Dt macro has no arguments, or there is no .Ic \&Dt macro before the first non-prologue macro. .It Sy "missing manual title, using \(dq\(dq" .Pq man There is no .Ic \&TH macro, or it has no arguments. .It Sy "missing manual section, using \(dq\(dq" .Pq mdoc , man A .Ic \&Dt or .Ic \&TH macro lacks the mandatory section argument. .It Sy "unknown manual section" .Pq mdoc The section number in a .Ic \&Dt line is invalid, but still used. .It Sy "filename/section mismatch" .Pq mdoc , man The name of the input file being processed is known and its file name extension starts with a non-zero digit, but the .Ic \&Dt or .Ic \&TH macro contains a .Ar section argument that starts with a different non-zero digit. The .Ar section argument is used as provided anyway. Consider checking whether the file name or the argument need a correction. .It Sy "missing date, using \(dq\(dq" .Pq mdoc, man The document was parsed as .Xr mdoc 7 and it has no .Ic \&Dd macro, or the .Ic \&Dd macro has no arguments or only empty arguments; or the document was parsed as .Xr man 7 and it has no .Ic \&TH macro, or the .Ic \&TH macro has less than three arguments or its third argument is empty. .It Sy "cannot parse date, using it verbatim" .Pq mdoc , man The date given in a .Ic \&Dd or .Ic \&TH macro does not follow the conventional format. .It Sy "date in the future, using it anyway" .Pq mdoc , man The date given in a .Ic \&Dd or .Ic \&TH macro is more than a day ahead of the current system .Xr time 3 . .It Sy "missing Os macro, using \(dq\(dq" .Pq mdoc The default or current system is not shown in this case. .It Sy "late prologue macro" .Pq mdoc A .Ic \&Dd or .Ic \&Os macro occurs after some non-prologue macro, but still takes effect. .It Sy "prologue macros out of order" .Pq mdoc The prologue macros are not given in the conventional order .Ic \&Dd , .Ic \&Dt , .Ic \&Os . All three macros are used even when given in another order. .El .Ss Warnings regarding document structure .Bl -ohang .It Sy ".so is fragile, better use ln(1)" .Pq roff Including files only works when the parser program runs with the correct current working directory. .It Sy "no document body" .Pq mdoc , man The document body contains neither text nor macros. An empty document is shown, consisting only of a header and a footer line. .It Sy "content before first section header" .Pq mdoc , man Some macros or text precede the first .Ic \&Sh or .Ic \&SH section header. The offending macros and text are parsed and added to the top level of the syntax tree, outside any section block. .It Sy "first section is not NAME" .Pq mdoc The argument of the first .Ic \&Sh macro is not .Sq NAME . This may confuse .Xr makewhatis 8 and .Xr apropos 1 . .It Sy "NAME section without Nm before Nd" .Pq mdoc The NAME section does not contain any .Ic \&Nm child macro before the first .Ic \&Nd macro. .It Sy "NAME section without description" .Pq mdoc The NAME section lacks the mandatory .Ic \&Nd child macro. .It Sy "description not at the end of NAME" .Pq mdoc The NAME section does contain an .Ic \&Nd child macro, but other content follows it. .It Sy "bad NAME section content" .Pq mdoc The NAME section contains plain text or macros other than .Ic \&Nm and .Ic \&Nd . .It Sy "missing comma before name" .Pq mdoc The NAME section contains an .Ic \&Nm macro that is neither the first one nor preceded by a comma. .It Sy "missing description line, using \(dq\(dq" .Pq mdoc The .Ic \&Nd macro lacks the required argument. The title line of the manual will end after the dash. .It Sy "description line outside NAME section" .Pq mdoc An .Ic \&Nd macro appears outside the NAME section. The arguments are printed anyway and the following text is used for .Xr apropos 1 , but none of that behaviour is portable. .It Sy "sections out of conventional order" .Pq mdoc A standard section occurs after another section it usually precedes. All section titles are used as given, and the order of sections is not changed. .It Sy "duplicate section title" .Pq mdoc The same standard section title occurs more than once. .It Sy "unexpected section" .Pq mdoc A standard section header occurs in a section of the manual where it normally isn't useful. .It Sy "cross reference to self" .Pq mdoc An .Ic \&Xr macro refers to a name and section matching the section of the present manual page and a name mentioned in an .Ic \&Nm macro in the NAME or SYNOPSIS section, or in an .Ic \&Fn or .Ic \&Fo macro in the SYNOPSIS. Consider using .Ic \&Nm or .Ic \&Fn instead of .Ic \&Xr . .It Sy "unusual Xr order" .Pq mdoc In the SEE ALSO section, an .Ic \&Xr macro with a lower section number follows one with a higher number, or two .Ic \&Xr macros referring to the same section are out of alphabetical order. .It Sy "unusual Xr punctuation" .Pq mdoc In the SEE ALSO section, punctuation between two .Ic \&Xr macros differs from a single comma, or there is trailing punctuation after the last .Ic \&Xr macro. .It Sy "AUTHORS section without An macro" .Pq mdoc An AUTHORS sections contains no .Ic \&An macros, or only empty ones. Probably, there are author names lacking markup. .El .Ss "Warnings related to macros and nesting" .Bl -ohang .It Sy "obsolete macro" .Pq mdoc See the .Xr mdoc 7 manual for replacements. .It Sy "macro neither callable nor escaped" .Pq mdoc The name of a macro that is not callable appears on a macro line. It is printed verbatim. If the intention is to call it, move it to its own input line; otherwise, escape it by prepending .Sq \e& . .It Sy "skipping paragraph macro" In .Xr mdoc 7 documents, this happens .Bl -dash -compact .It at the beginning and end of sections and subsections .It right before non-compact lists and displays .It at the end of items in non-column, non-compact lists .It and for multiple consecutive paragraph macros. .El In .Xr man 7 documents, it happens .Bl -dash -compact .It for empty .Ic \&P , .Ic \&PP , and .Ic \&LP macros .It for .Ic \&IP macros having neither head nor body arguments .It for .Ic \&br or .Ic \&sp right after .Ic \&SH or .Ic \&SS .El .It Sy "moving paragraph macro out of list" .Pq mdoc A list item in a .Ic \&Bl list contains a trailing paragraph macro. The paragraph macro is moved after the end of the list. .It Sy "skipping no-space macro" .Pq mdoc An input line begins with an .Ic \&Ns macro, or the next argument after an .Ic \&Ns macro is an isolated closing delimiter. The macro is ignored. .It Sy "blocks badly nested" .Pq mdoc If two blocks intersect, one should completely contain the other. Otherwise, rendered output is likely to look strange in any output format, and rendering in SGML-based output formats is likely to be outright wrong because such languages do not support badly nested blocks at all. Typical examples of badly nested blocks are .Qq Ic \&Ao \&Bo \&Ac \&Bc and .Qq Ic \&Ao \&Bq \&Ac . In these examples, .Ic \&Ac breaks .Ic \&Bo and .Ic \&Bq , respectively. .It Sy "nested displays are not portable" .Pq mdoc A .Ic \&Bd , .Ic \&D1 , or .Ic \&Dl display occurs nested inside another .Ic \&Bd display. This works with .Nm , but fails with most other implementations. .It Sy "moving content out of list" .Pq mdoc A .Ic \&Bl list block contains text or macros before the first .Ic \&It macro. The offending children are moved before the beginning of the list. .It Sy "first macro on line" Inside a .Ic \&Bl Fl column list, a .Ic \&Ta macro occurs as the first macro on a line, which is not portable. .It Sy "line scope broken" .Pq man While parsing the next-line scope of the previous macro, another macro is found that prematurely terminates the previous one. The previous, interrupted macro is deleted from the parse tree. .El .Ss "Warnings related to missing arguments" .Bl -ohang .It Sy "skipping empty request" .Pq roff , eqn The macro name is missing from a macro definition request, or an .Xr eqn 7 control statement or operation keyword lacks its required argument. .It Sy "conditional request controls empty scope" .Pq roff A conditional request is only useful if any of the following follows it on the same logical input line: .Bl -dash -compact .It The .Sq \e{ keyword to open a multi-line scope. .It A request or macro or some text, resulting in a single-line scope. .It The immediate end of the logical line without any intervening whitespace, resulting in next-line scope. .El Here, a conditional request is followed by trailing whitespace only, and there is no other content on its logical input line. Note that it doesn't matter whether the logical input line is split across multiple physical input lines using .Sq \e line continuation characters. This is one of the rare cases where trailing whitespace is syntactically significant. The conditional request controls a scope containing whitespace only, so it is unlikely to have a significant effect, except that it may control a following .Ic \&el clause. .It Sy "skipping empty macro" .Pq mdoc The indicated macro has no arguments and hence no effect. .It Sy "empty block" .Pq mdoc , man A .Ic \&Bd , .Ic \&Bk , .Ic \&Bl , .Ic \&D1 , .Ic \&Dl , .Ic \&MT , .Ic \&RS , or .Ic \&UR block contains nothing in its body and will produce no output. .It Sy "empty argument, using 0n" .Pq mdoc The required width is missing after .Ic \&Bd or .Ic \&Bl .Fl offset or .Fl width . .It Sy "missing display type, using -ragged" .Pq mdoc The .Ic \&Bd macro is invoked without the required display type. .It Sy "list type is not the first argument" .Pq mdoc In a .Ic \&Bl macro, at least one other argument precedes the type argument. The .Nm utility copes with any argument order, but some other .Xr mdoc 7 implementations do not. .It Sy "missing -width in -tag list, using 8n" .Pq mdoc Every .Ic \&Bl macro having the .Fl tag argument requires .Fl width , too. .It Sy "missing utility name, using \(dq\(dq" .Pq mdoc The .Ic \&Ex Fl std macro is called without an argument before .Ic \&Nm has first been called with an argument. .It Sy "missing function name, using \(dq\(dq" .Pq mdoc The .Ic \&Fo macro is called without an argument. No function name is printed. .It Sy "empty head in list item" .Pq mdoc In a .Ic \&Bl .Fl diag , .Fl hang , .Fl inset , .Fl ohang , or .Fl tag list, an .Ic \&It macro lacks the required argument. The item head is left empty. .It Sy "empty list item" .Pq mdoc In a .Ic \&Bl .Fl bullet , .Fl dash , .Fl enum , or .Fl hyphen list, an .Ic \&It block is empty. An empty list item is shown. .It Sy "missing argument, using next line" .Pq mdoc An .Ic \&It macro in a .Ic \&Bd Fl column list has no arguments. While .Nm uses the text or macros of the following line, if any, for the cell, other formatters may misformat the list. .It Sy "missing font type, using \efR" .Pq mdoc A .Ic \&Bf macro has no argument. It switches to the default font. .It Sy "unknown font type, using \efR" .Pq mdoc The .Ic \&Bf argument is invalid. The default font is used instead. .It Sy "nothing follows prefix" .Pq mdoc A .Ic \&Pf macro has no argument, or only one argument and no macro follows on the same input line. This defeats its purpose; in particular, spacing is not suppressed before the text or macros following on the next input line. .It Sy "empty reference block" .Pq mdoc An .Ic \&Rs macro is immediately followed by an .Ic \&Re macro on the next input line. Such an empty block does not produce any output. .It Sy "missing section argument" .Pq mdoc An .Ic \&Xr macro lacks its second, section number argument. The first argument, i.e. the name, is printed, but without subsequent parentheses. .It Sy "missing -std argument, adding it" .Pq mdoc An .Ic \&Ex or .Ic \&Rv macro lacks the required .Fl std argument. The .Nm utility assumes .Fl std even when it is not specified, but other implementations may not. .It Sy "missing option string, using \(dq\(dq" .Pq man The .Ic \&OP macro is invoked without any argument. An empty pair of square brackets is shown. .It Sy "missing resource identifier, using \(dq\(dq" .Pq man The .Ic \&MT or .Ic \&UR macro is invoked without any argument. An empty pair of angle brackets is shown. .It Sy "missing eqn box, using \(dq\(dq" .Pq eqn A diacritic mark or a binary operator is found, but there is nothing to the left of it. An empty box is inserted. .El .Ss "Warnings related to bad macro arguments" .Bl -ohang .It Sy "duplicate argument" .Pq mdoc A .Ic \&Bd or .Ic \&Bl macro has more than one .Fl compact , more than one .Fl offset , or more than one .Fl width argument. All but the last instances of these arguments are ignored. .It Sy "skipping duplicate argument" .Pq mdoc An .Ic \&An macro has more than one .Fl split or .Fl nosplit argument. All but the first of these arguments are ignored. .It Sy "skipping duplicate display type" .Pq mdoc A .Ic \&Bd macro has more than one type argument; the first one is used. .It Sy "skipping duplicate list type" .Pq mdoc A .Ic \&Bl macro has more than one type argument; the first one is used. .It Sy "skipping -width argument" .Pq mdoc A .Ic \&Bl .Fl column , .Fl diag , .Fl ohang , .Fl inset , or .Fl item list has a .Fl width argument. That has no effect. .It Sy "wrong number of cells" In a line of a .Ic \&Bl Fl column list, the number of tabs or .Ic \&Ta macros is less than the number expected from the list header line or exceeds the expected number by more than one. Missing cells remain empty, and all cells exceeding the number of columns are joined into one single cell. .It Sy "unknown AT&T UNIX version" .Pq mdoc An .Ic \&At macro has an invalid argument. It is used verbatim, with .Qq "AT&T UNIX " prefixed to it. .It Sy "comma in function argument" .Pq mdoc An argument of an .Ic \&Fa or .Ic \&Fn macro contains a comma; it should probably be split into two arguments. .It Sy "parenthesis in function name" .Pq mdoc The first argument of an .Ic \&Fc or .Ic \&Fn macro contains an opening or closing parenthesis; that's probably wrong, parentheses are added automatically. .It Sy "unknown library name" .Pq mdoc, not on Ox An .Ic \&Lb macro has an unknown name argument and will be rendered as .Qq library Dq Ar name . .It Sy "invalid content in Rs block" .Pq mdoc An .Ic \&Rs block contains plain text or non-% macros. The bogus content is left in the syntax tree. Formatting may be poor. .It Sy "invalid Boolean argument" .Pq mdoc An .Ic \&Sm macro has an argument other than .Cm on or .Cm off . The invalid argument is moved out of the macro, which leaves the macro empty, causing it to toggle the spacing mode. .It Sy "argument contains two font escapes" .Pq roff The second argument of a .Ic char request contains more than one font escape sequence. A wrong font may remain active after using the character. .It Sy "unknown font, skipping request" .Pq man , tbl A .Xr roff 7 .Ic \&ft request or a .Xr tbl 7 .Ic \&f layout modifier has an unknown .Ar font argument. .It Sy "odd number of characters in request" .Pq roff A .Ic \&tr request contains an odd number of characters. The last character is mapped to the blank character. .El .Ss "Warnings related to plain text" .Bl -ohang .It Sy "blank line in fill mode, using .sp" .Pq mdoc The meaning of blank input lines is only well-defined in non-fill mode: In fill mode, line breaks of text input lines are not supposed to be significant. However, for compatibility with groff, blank lines in fill mode are formatted like .Ic \&sp requests. To request a paragraph break, use .Ic \&Pp instead of a blank line. .It Sy "tab in filled text" .Pq mdoc , man The meaning of tab characters is only well-defined in non-fill mode: In fill mode, whitespace is not supposed to be significant on text input lines. As an implementation dependent choice, tab characters on text lines are passed through to the formatters in any case. Given that the text before the tab character will be filled, it is hard to predict which tab stop position the tab will advance to. .It Sy "new sentence, new line" .Pq mdoc A new sentence starts in the middle of a text line. Start it on a new input line to help formatters produce correct spacing. .It Sy "invalid escape sequence" .Pq roff An escape sequence has an invalid opening argument delimiter, lacks the closing argument delimiter, the argument is of an invalid form, or it is a character escape sequence with an invalid name. If the argument is incomplete, .Ic \e* and .Ic \en expand to an empty string, .Ic \eB to the digit .Sq 0 , and .Ic \ew to the length of the incomplete argument. All other invalid escape sequences are ignored. .It Sy "undefined escape, printing literally" .Pq roff In an escape sequence, the first character right after the leading backslash is invalid. That character is printed literally, which is equivalent to ignoring the backslash. .It Sy "undefined string, using \(dq\(dq" .Pq roff If a string is used without being defined before, its value is implicitly set to the empty string. However, defining strings explicitly before use keeps the code more readable. .El .Ss "Warnings related to tables" .Bl -ohang .It Sy "tbl line starts with span" .Pq tbl The first cell in a table layout line is a horizontal span .Pq Sq Cm s . Data provided for this cell is ignored, and nothing is printed in the cell. .It Sy "tbl column starts with span" .Pq tbl The first line of a table layout specification requests a vertical span .Pq Sq Cm ^ . Data provided for this cell is ignored, and nothing is printed in the cell. .It Sy "skipping vertical bar in tbl layout" .Pq tbl A table layout specification contains more than two consecutive vertical bars. A double bar is printed, all additional bars are discarded. .El .Ss "Errors related to tables" .Bl -ohang .It Sy "non-alphabetic character in tbl options" .Pq tbl The table options line contains a character other than a letter, blank, or comma where the beginning of an option name is expected. The character is ignored. .It Sy "skipping unknown tbl option" .Pq tbl The table options line contains a string of letters that does not match any known option name. The word is ignored. .It Sy "missing tbl option argument" .Pq tbl A table option that requires an argument is not followed by an opening parenthesis, or the opening parenthesis is immediately followed by a closing parenthesis. The option is ignored. .It Sy "wrong tbl option argument size" .Pq tbl A table option argument contains an invalid number of characters. Both the option and the argument are ignored. .It Sy "empty tbl layout" .Pq tbl A table layout specification is completely empty, specifying zero lines and zero columns. As a fallback, a single left-justified column is used. .It Sy "invalid character in tbl layout" .Pq tbl A table layout specification contains a character that can neither be interpreted as a layout key character nor as a layout modifier, or a modifier precedes the first key. The invalid character is discarded. .It Sy "unmatched parenthesis in tbl layout" .Pq tbl A table layout specification contains an opening parenthesis, but no matching closing parenthesis. The rest of the input line, starting from the parenthesis, has no effect. .It Sy "ignoring excessive spacing in tbl layout" .Pq tbl A spacing modifier in a table layout is unreasonably large. The default spacing of 3n is used instead. .It Sy "tbl without any data cells" .Pq tbl A table does not contain any data cells. It will probably produce no output. .It Sy "ignoring data in spanned tbl cell" .Pq tbl A table cell is marked as a horizontal span .Pq Sq Cm s or vertical span .Pq Sq Cm ^ in the table layout, but it contains data. The data is ignored. .It Sy "ignoring extra tbl data cells" .Pq tbl A data line contains more cells than the corresponding layout line. The data in the extra cells is ignored. .It Sy "data block open at end of tbl" .Pq tbl A data block is opened with .Cm T{ , but never closed with a matching .Cm T} . The remaining data lines of the table are all put into one cell, and any remaining cells stay empty. .El .Ss "Errors related to roff, mdoc, and man code" .Bl -ohang .It Sy "duplicate prologue macro" .Pq mdoc One of the prologue macros occurs more than once. The last instance overrides all previous ones. .It Sy "skipping late title macro" .Pq mdoc The .Ic \&Dt macro appears after the first non-prologue macro. Traditional formatters cannot handle this because they write the page header before parsing the document body. Even though this technical restriction does not apply to .Nm , traditional semantics is preserved. The late macro is discarded including its arguments. .It Sy "input stack limit exceeded, infinite loop?" .Pq roff Explicit recursion limits are implemented for the following features, in order to prevent infinite loops: .Bl -dash -compact .It expansion of nested escape sequences including expansion of strings and number registers, .It expansion of nested user-defined macros, .It and .Ic \&so file inclusion. .El When a limit is hit, the output is incorrect, typically losing some content, but the parser can continue. .It Sy "skipping bad character" .Pq mdoc , man , roff The input file contains a byte that is not a printable .Xr ascii 7 character. The message mentions the character number. The offending byte is replaced with a question mark .Pq Sq \&? . Consider editing the input file to replace the byte with an ASCII transliteration of the intended character. .It Sy "skipping unknown macro" .Pq mdoc , man , roff The first identifier on a request or macro line is neither recognized as a .Xr roff 7 request, nor as a user-defined macro, nor, respectively, as an .Xr mdoc 7 or .Xr man 7 macro. It may be mistyped or unsupported. The request or macro is discarded including its arguments. .It Sy "skipping request outside macro" .Pq roff A .Ic shift or .Ic return request occurs outside any macro definition and has no effect. .It Sy "skipping insecure request" .Pq roff An input file attempted to run a shell command or to read or write an external file. Such attempts are denied for security reasons. .It Sy "skipping item outside list" .Pq mdoc , eqn An .Ic \&It macro occurs outside any .Ic \&Bl list, or an .Xr eqn 7 .Ic above delimiter occurs outside any pile. It is discarded including its arguments. .It Sy "skipping column outside column list" .Pq mdoc A .Ic \&Ta macro occurs outside any .Ic \&Bl Fl column block. It is discarded including its arguments. .It Sy "skipping end of block that is not open" .Pq mdoc , man , eqn , tbl , roff Various syntax elements can only be used to explicitly close blocks that have previously been opened. An .Xr mdoc 7 block closing macro, a .Xr man 7 .Ic \&ME , \&RE or .Ic \&UE macro, an .Xr eqn 7 right delimiter or closing brace, or the end of an equation, table, or .Xr roff 7 conditional request is encountered but no matching block is open. The offending request or macro is discarded. .It Sy "fewer RS blocks open, skipping" .Pq man The .Ic \&RE macro is invoked with an argument, but less than the specified number of .Ic \&RS blocks is open. The .Ic \&RE macro is discarded. .It Sy "inserting missing end of block" .Pq mdoc , tbl Various .Xr mdoc 7 macros as well as tables require explicit closing by dedicated macros. A block that doesn't support bad nesting ends before all of its children are properly closed. The open child nodes are closed implicitly. .It Sy "appending missing end of block" .Pq mdoc , man , eqn , tbl , roff At the end of the document, an explicit .Xr mdoc 7 block, a .Xr man 7 next-line scope or .Ic \&MT , \&RS or .Ic \&UR block, an equation, table, or .Xr roff 7 conditional or ignore block is still open. The open block is closed implicitly. .It Sy "escaped character not allowed in a name" .Pq roff Macro, string and register identifiers consist of printable, non-whitespace ASCII characters. Escape sequences and characters and strings expressed in terms of them cannot form part of a name. The first argument of an .Ic \&am , .Ic \&as , .Ic \&de , .Ic \&ds , .Ic \&nr , or .Ic \&rr request, or any argument of an .Ic \&rm request, or the name of a request or user defined macro being called, is terminated by an escape sequence. In the cases of .Ic \&as , .Ic \&ds , and .Ic \&nr , the request has no effect at all. In the cases of .Ic \&am , .Ic \&de , .Ic \&rr , and .Ic \&rm , what was parsed up to this point is used as the arguments to the request, and the rest of the input line is discarded including the escape sequence. When parsing for a request or a user-defined macro name to be called, only the escape sequence is discarded. The characters preceding it are used as the request or macro name, the characters following it are used as the arguments to the request or macro. .It Sy "using macro argument outside macro" .Pq roff The escape sequence \e$ occurs outside any macro definition and expands to the empty string. .It Sy "argument number is not numeric" .Pq roff The argument of the escape sequence \e$ is not a digit; the escape sequence expands to the empty string. .It Sy "NOT IMPLEMENTED: Bd -file" .Pq mdoc For security reasons, the .Ic \&Bd macro does not support the .Fl file argument. By requesting the inclusion of a sensitive file, a malicious document might otherwise trick a privileged user into inadvertently displaying the file on the screen, revealing the file content to bystanders. The argument is ignored including the file name following it. .It Sy "skipping display without arguments" .Pq mdoc A .Ic \&Bd block macro does not have any arguments. The block is discarded, and the block content is displayed in whatever mode was active before the block. .It Sy "missing list type, using -item" .Pq mdoc A .Ic \&Bl macro fails to specify the list type. .It Sy "argument is not numeric, using 1" .Pq roff The argument of a .Ic \&ce request is not a number. .It Sy "argument is not a character" .Pq roff The first argument of a .Ic char request is neither a single ASCII character nor a single character escape sequence. The request is ignored including all its arguments. .It Sy "missing manual name, using \(dq\(dq" .Pq mdoc The first call to .Ic \&Nm , or any call in the NAME section, lacks the required argument. .It Sy "uname(3) system call failed, using UNKNOWN" .Pq mdoc The .Ic \&Os macro is called without arguments, and the .Xr uname 3 system call failed. As a workaround, .Nm can be compiled with .Sm off .Fl D Cm OSNAME=\(dq\e\(dq Ar string Cm \e\(dq\(dq . .Sm on .It Sy "unknown standard specifier" .Pq mdoc An .Ic \&St macro has an unknown argument and is discarded. .It Sy "skipping request without numeric argument" .Pq roff , eqn An .Ic \&it request or an .Xr eqn 7 .Ic \&size or .Ic \&gsize statement has a non-numeric or negative argument or no argument at all. The invalid request or statement is ignored. .It Sy "excessive shift" .Pq roff The argument of a .Ic shift request is larger than the number of arguments of the macro that is currently being executed. All macro arguments are deleted and \en(.$ is set to zero. .It Sy "NOT IMPLEMENTED: .so with absolute path or \(dq..\(dq" .Pq roff For security reasons, .Nm allows .Ic \&so file inclusion requests only with relative paths and only without ascending to any parent directory. By requesting the inclusion of a sensitive file, a malicious document might otherwise trick a privileged user into inadvertently displaying the file on the screen, revealing the file content to bystanders. .Nm only shows the path as it appears behind .Ic \&so . .It Sy ".so request failed" .Pq roff Servicing a .Ic \&so request requires reading an external file, but the file could not be opened. .Nm only shows the path as it appears behind .Ic \&so . .It Sy "skipping all arguments" .Pq mdoc , man , eqn , roff An .Xr mdoc 7 .Ic \&Bt , .Ic \&Ed , .Ic \&Ef , .Ic \&Ek , .Ic \&El , .Ic \&Lp , .Ic \&Pp , .Ic \&Re , .Ic \&Rs , or .Ic \&Ud macro, an .Ic \&It macro in a list that don't support item heads, a .Xr man 7 .Ic \&LP , .Ic \&P , or .Ic \&PP macro, an .Xr eqn 7 .Ic \&EQ or .Ic \&EN macro, or a .Xr roff 7 .Ic \&br , .Ic \&fi , or .Ic \&nf request or .Sq \&.. block closing request is invoked with at least one argument. All arguments are ignored. .It Sy "skipping excess arguments" .Pq mdoc , man , roff A macro or request is invoked with too many arguments: .Bl -dash -offset 2n -width 2n -compact .It .Ic \&Fo , .Ic \&MT , .Ic \&PD , .Ic \&RS , .Ic \&UR , .Ic \&ft , or .Ic \&sp with more than one argument .It .Ic \&An with another argument after .Fl split or .Fl nosplit .It .Ic \&RE with more than one argument or with a non-integer argument .It .Ic \&OP or a request of the .Ic \&de family with more than two arguments .It .Ic \&Dt with more than three arguments .It .Ic \&TH with more than five arguments .It .Ic \&Bd , .Ic \&Bk , or .Ic \&Bl with invalid arguments .El The excess arguments are ignored. .El .Ss Unsupported features .Bl -ohang .It Sy "input too large" .Pq mdoc , man Currently, .Nm cannot handle input files larger than its arbitrary size limit of 2^31 bytes (2 Gigabytes). Since useful manuals are always small, this is not a problem in practice. Parsing is aborted as soon as the condition is detected. .It Sy "unsupported control character" .Pq roff An ASCII control character supported by other .Xr roff 7 implementations but not by .Nm was found in an input file. It is replaced by a question mark. .It Sy "unsupported escape sequence" .Pq roff An input file contains an escape sequence supported by GNU troff or Heirloom troff but not by .Nm , and it is likely that this will cause information loss or considerable misformatting. .It Sy "unsupported roff request" .Pq roff An input file contains a .Xr roff 7 request supported by GNU troff or Heirloom troff but not by .Nm , and it is likely that this will cause information loss or considerable misformatting. .It Sy "eqn delim option in tbl" .Pq eqn , tbl The options line of a table defines equation delimiters. Any equation source code contained in the table will be printed unformatted. .It Sy "unsupported table layout modifier" .Pq tbl A table layout specification contains an .Sq Cm m modifier. The modifier is discarded. .It Sy "ignoring macro in table" .Pq tbl , mdoc , man A table contains an invocation of an .Xr mdoc 7 or .Xr man 7 macro or of an undefined macro. The macro is ignored, and its arguments are handled as if they were a text line. .It Sy "skipping tbl in -Tman mode" .Pq mdoc , tbl An input file contains the .Ic \&TS macro. This message is only generated in .Fl T Cm man output mode, where .Xr tbl 7 input is not supported. .It Sy "skipping eqn in -Tman mode" .Pq mdoc , eqn An input file contains the .Ic \&EQ macro. This message is only generated in .Fl T Cm man output mode, where .Xr eqn 7 input is not supported. .El .Ss Bad command line arguments .Bl -ohang .It Sy "bad command line argument" The argument following one of the .Fl IKMmOTW command line options is invalid, or a .Ar file given as a command line argument cannot be opened. .It Sy "duplicate command line argument" The .Fl I command line option was specified twice. .It Sy "option has a superfluous value" An argument to the .Fl O option has a value but does not accept one. .It Sy "missing option value" An argument to the .Fl O option has no argument but requires one. .It Sy "bad option value" An argument to the .Fl O .Cm indent or .Cm width option has an invalid value. .It Sy "duplicate option value" The same .Fl O option is specified more than once. .It Sy "no such tag" The .Fl O Cm tag option was specified but the tag was not found in any of the displayed manual pages. .It Sy "\-Tmarkdown unsupported for man(7) input" .Pq man The .Fl T Cm markdown option was specified but an input file uses the .Xr man 7 language. No output is produced for that input file. .El .Sh SEE ALSO .Xr apropos 1 , .Xr man 1 , .Xr eqn 7 , .Xr man 7 , .Xr mandoc_char 7 , .Xr mdoc 7 , .Xr roff 7 , .Xr tbl 7 .Sh HISTORY The .Nm utility first appeared in .Ox 4.8 . The option .Fl I appeared in .Ox 5.2 , and .Fl aCcfhKklMSsw in .Ox 5.7 . .Sh AUTHORS .An -nosplit The .Nm utility was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv and is maintained by .An Ingo Schwarze Aq Mt schwarze@openbsd.org . �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc.3������������������������������������������������������������������������������0100644�0001753�0001753�00000031001�14123140553�0014667�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mandoc.3,v 1.44 2018/12/30 00:49:55 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: December 30 2018 $ .Dt MANDOC 3 .Os .Sh NAME .Nm mandoc , .Nm deroff , .Nm mparse_alloc , .Nm mparse_copy , .Nm mparse_free , .Nm mparse_open , .Nm mparse_readfd , .Nm mparse_reset , .Nm mparse_result .Nd mandoc macro compiler library .Sh SYNOPSIS .In sys/types.h .In stdio.h .In mandoc.h .Pp .Fd "#define ASCII_NBRSP" .Fd "#define ASCII_HYPH" .Fd "#define ASCII_BREAK" .Ft struct mparse * .Fo mparse_alloc .Fa "int options" .Fa "enum mandoc_os oe_e" .Fa "char *os_s" .Fc .Ft void .Fo mparse_free .Fa "struct mparse *parse" .Fc .Ft void .Fo mparse_copy .Fa "const struct mparse *parse" .Fc .Ft int .Fo mparse_open .Fa "struct mparse *parse" .Fa "const char *fname" .Fc .Ft void .Fo mparse_readfd .Fa "struct mparse *parse" .Fa "int fd" .Fa "const char *fname" .Fc .Ft void .Fo mparse_reset .Fa "struct mparse *parse" .Fc .Ft struct roff_meta * .Fo mparse_result .Fa "struct mparse *parse" .Fc .In roff.h .Ft void .Fo deroff .Fa "char **dest" .Fa "const struct roff_node *node" .Fc .In sys/types.h .In mandoc.h .In mdoc.h .Vt extern const char * const * mdoc_argnames; .Vt extern const char * const * mdoc_macronames; .In sys/types.h .In mandoc.h .In man.h .Vt extern const char * const * man_macronames; .Sh DESCRIPTION The .Nm mandoc library parses a .Ux manual into an abstract syntax tree (AST). .Ux manuals are composed of .Xr mdoc 7 or .Xr man 7 , and may be mixed with .Xr roff 7 , .Xr tbl 7 , and .Xr eqn 7 invocations. .Pp The following describes a general parse sequence: .Bl -enum .It initiate a parsing sequence with .Xr mchars_alloc 3 and .Fn mparse_alloc ; .It open a file with .Xr open 2 or .Fn mparse_open ; .It parse it with .Fn mparse_readfd ; .It close it with .Xr close 2 ; .It retrieve the syntax tree with .Fn mparse_result ; .It if information about the validity of the input is needed, fetch it with .Fn mparse_updaterc ; .It iterate over parse nodes with starting from the .Fa first member of the returned .Vt struct roff_meta ; .It free all allocated memory with .Fn mparse_free and .Xr mchars_free 3 , or invoke .Fn mparse_reset and go back to step 2 to parse new files. .El .Sh REFERENCE This section documents the functions, types, and variables available via .In mandoc.h , with the exception of those documented in .Xr mandoc_escape 3 and .Xr mchars_alloc 3 . .Ss Types .Bl -ohang .It Vt "enum mandocerr" An error or warning message during parsing. .It Vt "enum mandoclevel" A classification of an .Vt "enum mandocerr" as regards system operation. See the DIAGNOSTICS section in .Xr mandoc 1 regarding the meanings of the levels. .It Vt "struct mparse" An opaque pointer to a running parse sequence. Created with .Fn mparse_alloc and freed with .Fn mparse_free . This may be used across parsed input if .Fn mparse_reset is called between parses. .El .Ss Functions .Bl -ohang .It Fn deroff Obtain a text-only representation of a .Vt struct roff_node , including text contained in its child nodes. To be used on children of the .Fa first member of .Vt struct roff_meta . When it is no longer needed, the pointer returned from .Fn deroff can be passed to .Xr free 3 . .It Fn mparse_alloc Allocate a parser. The arguments have the following effect: .Bl -tag -offset 5n -width inttype .It Ar options When the .Dv MPARSE_MDOC or .Dv MPARSE_MAN bit is set, only that parser is used. Otherwise, the document type is automatically detected. .Pp When the .Dv MPARSE_SO bit is set, .Xr roff 7 .Ic \&so file inclusion requests are always honoured. Otherwise, if the request is the only content in an input file, only the file name is remembered, to be returned in the .Fa sodest field of .Vt struct roff_meta . .Pp When the .Dv MPARSE_QUICK bit is set, parsing is aborted after the NAME section. This is for example useful in .Xr makewhatis 8 .Fl Q to quickly build minimal databases. .Pp When the .Dv MARSE_VALIDATE bit is set, .Fn mparse_result runs the validation functions before returning the syntax tree. This is almost always required, except in certain debugging scenarios, for example to dump unvalidated syntax trees. .It Ar os_e Operating system to check base system conventions for. If .Dv MANDOC_OS_OTHER , the system is automatically detected from .Ic \&Os , .Fl Ios , or .Xr uname 3 . .It Ar os_s A default string for the .Xr mdoc 7 .Ic \&Os macro, overriding the .Dv OSNAME preprocessor definition and the results of .Xr uname 3 . Passing .Dv NULL sets no default. .El .Pp The same parser may be used for multiple files so long as .Fn mparse_reset is called between parses. .Fn mparse_free must be called to free the memory allocated by this function. Declared in .In mandoc.h , implemented in .Pa read.c . .It Fn mparse_free Free all memory allocated by .Fn mparse_alloc . Declared in .In mandoc.h , implemented in .Pa read.c . .It Fn mparse_copy Dump a copy of the input to the standard output; used for .Fl man T Ns Cm man . Declared in .In mandoc.h , implemented in .Pa read.c . .It Fn mparse_open Open the file for reading. If that fails and .Fa fname does not already end in .Ql .gz , try again after appending .Ql .gz . Save the information whether the file is zipped or not. Return a file descriptor open for reading or -1 on failure. It can be passed to .Fn mparse_readfd or used directly. Declared in .In mandoc.h , implemented in .Pa read.c . .It Fn mparse_readfd Parse a file descriptor opened with .Xr open 2 or .Fn mparse_open . Pass the associated filename in .Va fname . This function may be called multiple times with different parameters; however, .Xr close 2 and .Fn mparse_reset should be invoked between parses. Declared in .In mandoc.h , implemented in .Pa read.c . .It Fn mparse_reset Reset a parser so that .Fn mparse_readfd may be used again. Declared in .In mandoc.h , implemented in .Pa read.c . .It Fn mparse_result Obtain the result of a parse. Declared in .In mandoc.h , implemented in .Pa read.c . .El .Ss Variables .Bl -ohang .It Va man_macronames The string representation of a .Xr man 7 macro as indexed by .Vt "enum mant" . .It Va mdoc_argnames The string representation of an .Xr mdoc 7 macro argument as indexed by .Vt "enum mdocargt" . .It Va mdoc_macronames The string representation of an .Xr mdoc 7 macro as indexed by .Vt "enum mdoct" . .El .Sh IMPLEMENTATION NOTES This section consists of structural documentation for .Xr mdoc 7 and .Xr man 7 syntax trees and strings. .Ss Man and Mdoc Strings Strings may be extracted from mdoc and man meta-data, or from text nodes (MDOC_TEXT and MAN_TEXT, respectively). These strings have special non-printing formatting cues embedded in the text itself, as well as .Xr roff 7 escapes preserved from input. Implementing systems will need to handle both situations to produce human-readable text. In general, strings may be assumed to consist of 7-bit ASCII characters. .Pp The following non-printing characters may be embedded in text strings: .Bl -tag -width Ds .It Dv ASCII_NBRSP A non-breaking space character. .It Dv ASCII_HYPH A soft hyphen. .It Dv ASCII_BREAK A breakable zero-width space. .El .Pp Escape characters are also passed verbatim into text strings. An escape character is a sequence of characters beginning with the backslash .Pq Sq \e . To construct human-readable text, these should be intercepted with .Xr mandoc_escape 3 and converted with one the functions described in .Xr mchars_alloc 3 . .Ss Man Abstract Syntax Tree This AST is governed by the ontological rules dictated in .Xr man 7 and derives its terminology accordingly. .Pp The AST is composed of .Vt struct roff_node nodes with element, root and text types as declared by the .Va type field. Each node also provides its parse point (the .Va line , .Va pos , and .Va sec fields), its position in the tree (the .Va parent , .Va child , .Va next and .Va prev fields) and some type-specific data. .Pp The tree itself is arranged according to the following normal form, where capitalised non-terminals represent nodes. .Pp .Bl -tag -width "ELEMENTXX" -compact .It ROOT \(<- mnode+ .It mnode \(<- ELEMENT | TEXT | BLOCK .It BLOCK \(<- HEAD BODY .It HEAD \(<- mnode* .It BODY \(<- mnode* .It ELEMENT \(<- ELEMENT | TEXT* .It TEXT \(<- [[:ascii:]]* .El .Pp The only elements capable of nesting other elements are those with next-line scope as documented in .Xr man 7 . .Ss Mdoc Abstract Syntax Tree This AST is governed by the ontological rules dictated in .Xr mdoc 7 and derives its terminology accordingly. .Qq In-line elements described in .Xr mdoc 7 are described simply as .Qq elements . .Pp The AST is composed of .Vt struct roff_node nodes with block, head, body, element, root and text types as declared by the .Va type field. Each node also provides its parse point (the .Va line , .Va pos , and .Va sec fields), its position in the tree (the .Va parent , .Va child , .Va last , .Va next and .Va prev fields) and some type-specific data, in particular, for nodes generated from macros, the generating macro in the .Va tok field. .Pp The tree itself is arranged according to the following normal form, where capitalised non-terminals represent nodes. .Pp .Bl -tag -width "ELEMENTXX" -compact .It ROOT \(<- mnode+ .It mnode \(<- BLOCK | ELEMENT | TEXT .It BLOCK \(<- HEAD [TEXT] (BODY [TEXT])+ [TAIL [TEXT]] .It ELEMENT \(<- TEXT* .It HEAD \(<- mnode* .It BODY \(<- mnode* [ENDBODY mnode*] .It TAIL \(<- mnode* .It TEXT \(<- [[:ascii:]]* .El .Pp Of note are the TEXT nodes following the HEAD, BODY and TAIL nodes of the BLOCK production: these refer to punctuation marks. Furthermore, although a TEXT node will generally have a non-zero-length string, in the specific case of .Sq \&.Bd \-literal , an empty line will produce a zero-length string. Multiple body parts are only found in invocations of .Sq \&Bl \-column , where a new body introduces a new phrase. .Pp The .Xr mdoc 7 syntax tree accommodates for broken block structures as well. The ENDBODY node is available to end the formatting associated with a given block before the physical end of that block. It has a non-null .Va end field, is of the BODY .Va type , has the same .Va tok as the BLOCK it is ending, and has a .Va pending field pointing to that BLOCK's BODY node. It is an indirect child of that BODY node and has no children of its own. .Pp An ENDBODY node is generated when a block ends while one of its child blocks is still open, like in the following example: .Bd -literal -offset indent \&.Ao ao \&.Bo bo ac \&.Ac bc \&.Bc end .Ed .Pp This example results in the following block structure: .Bd -literal -offset indent BLOCK Ao HEAD Ao BODY Ao TEXT ao BLOCK Bo, pending -> Ao HEAD Bo BODY Bo TEXT bo TEXT ac ENDBODY Ao, pending -> Ao TEXT bc TEXT end .Ed .Pp Here, the formatting of the .Ic \&Ao block extends from TEXT ao to TEXT ac, while the formatting of the .Ic \&Bo block extends from TEXT bo to TEXT bc. It renders as follows in .Fl T Ns Cm ascii mode: .Pp .Dl <ao [bo ac> bc] end .Pp Support for badly-nested blocks is only provided for backward compatibility with some older .Xr mdoc 7 implementations. Using badly-nested blocks is .Em strongly discouraged ; for example, the .Fl T Ns Cm html front-end to .Xr mandoc 1 is unable to render them in any meaningful way. Furthermore, behaviour when encountering badly-nested blocks is not consistent across troff implementations, especially when using multiple levels of badly-nested blocks. .Sh SEE ALSO .Xr mandoc 1 , .Xr man.cgi 3 , .Xr mandoc_escape 3 , .Xr mandoc_headers 3 , .Xr mandoc_malloc 3 , .Xr mansearch 3 , .Xr mchars_alloc 3 , .Xr tbl 3 , .Xr eqn 7 , .Xr man 7 , .Xr mandoc_char 7 , .Xr mdoc 7 , .Xr roff 7 , .Xr tbl 7 .Sh AUTHORS .An -nosplit The .Nm library was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv and is maintained by .An Ingo Schwarze Aq Mt schwarze@openbsd.org . �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc.css����������������������������������������������������������������������������0100644�0001753�0001753�00000021312�14123140553�0015321�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: mandoc.css,v 1.48 2021/03/30 19:26:20 schwarze Exp $ */ /* * Standard style sheet for mandoc(1) -Thtml and man.cgi(8). * * Written by Ingo Schwarze <schwarze@openbsd.org>. * I place this file into the public domain. * Permission to use, copy, modify, and distribute it for any purpose * with or without fee is hereby granted, without any conditions. */ /* Global defaults. */ html { max-width: 65em; --bg: #FFFFFF; --fg: #000000; } body { background: var(--bg); color: var(--fg); font-family: Helvetica,Arial,sans-serif; } h1 { font-size: 110%; } table { margin-top: 0em; margin-bottom: 0em; border-collapse: collapse; } /* Some browsers set border-color in a browser style for tbody, * but not for table, resulting in inconsistent border styling. */ tbody { border-color: inherit; } tr { border-color: inherit; } td { vertical-align: top; padding-left: 0.2em; padding-right: 0.2em; border-color: inherit; } ul, ol, dl { margin-top: 0em; margin-bottom: 0em; } li, dt { margin-top: 1em; } pre { font-family: inherit; } .permalink { border-bottom: thin dotted; color: inherit; font: inherit; text-decoration: inherit; } * { clear: both } /* Search form and search results. */ fieldset { border: thin solid silver; border-radius: 1em; text-align: center; } input[name=expr] { width: 25%; } table.results { margin-top: 1em; margin-left: 2em; font-size: smaller; } /* Header and footer lines. */ table.head { width: 100%; border-bottom: 1px dotted #808080; margin-bottom: 1em; font-size: smaller; } td.head-vol { text-align: center; } td.head-rtitle { text-align: right; } table.foot { width: 100%; border-top: 1px dotted #808080; margin-top: 1em; font-size: smaller; } td.foot-os { text-align: right; } /* Sections and paragraphs. */ .manual-text { margin-left: 3.8em; } .Nd { } section.Sh { } h1.Sh { margin-top: 1.2em; margin-bottom: 0.6em; margin-left: -3.2em; } section.Ss { } h2.Ss { margin-top: 1.2em; margin-bottom: 0.6em; margin-left: -1.2em; font-size: 105%; } .Pp { margin: 0.6em 0em; } .Sx { } .Xr { } /* Displays and lists. */ .Bd { } .Bd-indent { margin-left: 3.8em; } .Bl-bullet { list-style-type: disc; padding-left: 1em; } .Bl-bullet > li { } .Bl-dash { list-style-type: none; padding-left: 0em; } .Bl-dash > li:before { content: "\2014 "; } .Bl-item { list-style-type: none; padding-left: 0em; } .Bl-item > li { } .Bl-compact > li { margin-top: 0em; } .Bl-enum { padding-left: 2em; } .Bl-enum > li { } .Bl-compact > li { margin-top: 0em; } .Bl-diag { } .Bl-diag > dt { font-style: normal; font-weight: bold; } .Bl-diag > dd { margin-left: 0em; } .Bl-hang { } .Bl-hang > dt { } .Bl-hang > dd { margin-left: 5.5em; } .Bl-inset { } .Bl-inset > dt { } .Bl-inset > dd { margin-left: 0em; } .Bl-ohang { } .Bl-ohang > dt { } .Bl-ohang > dd { margin-left: 0em; } .Bl-tag { margin-top: 0.6em; margin-left: 5.5em; } .Bl-tag > dt { float: left; margin-top: 0em; margin-left: -5.5em; padding-right: 0.5em; vertical-align: top; } .Bl-tag > dd { clear: right; column-count: 1; /* Force block formatting context. */ width: 100%; margin-top: 0em; margin-left: 0em; margin-bottom: 0.6em; vertical-align: top; } .Bl-compact { margin-top: 0em; } .Bl-compact > dd { margin-bottom: 0em; } .Bl-compact > dt { margin-top: 0em; } .Bl-column { } .Bl-column > tbody > tr { } .Bl-column > tbody > tr > td { margin-top: 1em; } .Bl-compact > tbody > tr > td { margin-top: 0em; } .Rs { font-style: normal; font-weight: normal; } .RsA { } .RsB { font-style: italic; font-weight: normal; } .RsC { } .RsD { } .RsI { font-style: italic; font-weight: normal; } .RsJ { font-style: italic; font-weight: normal; } .RsN { } .RsO { } .RsP { } .RsQ { } .RsR { } .RsT { text-decoration: underline; } .RsU { } .RsV { } .eqn { } .tbl td { vertical-align: middle; } .HP { margin-left: 3.8em; text-indent: -3.8em; } /* Semantic markup for command line utilities. */ table.Nm { } code.Nm { font-style: normal; font-weight: bold; font-family: inherit; } .Fl { font-style: normal; font-weight: bold; font-family: inherit; } .Cm { font-style: normal; font-weight: bold; font-family: inherit; } .Ar { font-style: italic; font-weight: normal; } .Op { display: inline; } .Ic { font-style: normal; font-weight: bold; font-family: inherit; } .Ev { font-style: normal; font-weight: normal; font-family: monospace; } .Pa { font-style: italic; font-weight: normal; } /* Semantic markup for function libraries. */ .Lb { } code.In { font-style: normal; font-weight: bold; font-family: inherit; } a.In { } .Fd { font-style: normal; font-weight: bold; font-family: inherit; } .Ft { font-style: italic; font-weight: normal; } .Fn { font-style: normal; font-weight: bold; font-family: inherit; } .Fa { font-style: italic; font-weight: normal; } .Vt { font-style: italic; font-weight: normal; } .Va { font-style: italic; font-weight: normal; } .Dv { font-style: normal; font-weight: normal; font-family: monospace; } .Er { font-style: normal; font-weight: normal; font-family: monospace; } /* Various semantic markup. */ .An { } .Lk { } .Mt { } .Cd { font-style: normal; font-weight: bold; font-family: inherit; } .Ad { font-style: italic; font-weight: normal; } .Ms { font-style: normal; font-weight: bold; } .St { } .Ux { } /* Physical markup. */ .Bf { display: inline; } .No { font-style: normal; font-weight: normal; } .Em { font-style: italic; font-weight: normal; } .Sy { font-style: normal; font-weight: bold; } .Li { font-style: normal; font-weight: normal; font-family: monospace; } /* Tooltip support. */ h1.Sh, h2.Ss { position: relative; } .An, .Ar, .Cd, .Cm, .Dv, .Em, .Er, .Ev, .Fa, .Fd, .Fl, .Fn, .Ft, .Ic, code.In, .Lb, .Lk, .Ms, .Mt, .Nd, code.Nm, .Pa, .Rs, .St, .Sx, .Sy, .Va, .Vt, .Xr { display: inline-block; position: relative; } .An::before { content: "An"; } .Ar::before { content: "Ar"; } .Cd::before { content: "Cd"; } .Cm::before { content: "Cm"; } .Dv::before { content: "Dv"; } .Em::before { content: "Em"; } .Er::before { content: "Er"; } .Ev::before { content: "Ev"; } .Fa::before { content: "Fa"; } .Fd::before { content: "Fd"; } .Fl::before { content: "Fl"; } .Fn::before { content: "Fn"; } .Ft::before { content: "Ft"; } .Ic::before { content: "Ic"; } code.In::before { content: "In"; } .Lb::before { content: "Lb"; } .Lk::before { content: "Lk"; } .Ms::before { content: "Ms"; } .Mt::before { content: "Mt"; } .Nd::before { content: "Nd"; } code.Nm::before { content: "Nm"; } .Pa::before { content: "Pa"; } .Rs::before { content: "Rs"; } h1.Sh::before { content: "Sh"; } h2.Ss::before { content: "Ss"; } .St::before { content: "St"; } .Sx::before { content: "Sx"; } .Sy::before { content: "Sy"; } .Va::before { content: "Va"; } .Vt::before { content: "Vt"; } .Xr::before { content: "Xr"; } .An::before, .Ar::before, .Cd::before, .Cm::before, .Dv::before, .Em::before, .Er::before, .Ev::before, .Fa::before, .Fd::before, .Fl::before, .Fn::before, .Ft::before, .Ic::before, code.In::before, .Lb::before, .Lk::before, .Ms::before, .Mt::before, .Nd::before, code.Nm::before, .Pa::before, .Rs::before, h1.Sh::before, h2.Ss::before, .St::before, .Sx::before, .Sy::before, .Va::before, .Vt::before, .Xr::before { opacity: 0; transition: .15s ease opacity; pointer-events: none; position: absolute; bottom: 100%; box-shadow: 0 0 .35em var(--fg); padding: .15em .25em; white-space: nowrap; font-family: Helvetica,Arial,sans-serif; font-style: normal; font-weight: bold; background: var(--bg); color: var(--fg); } .An:hover::before, .Ar:hover::before, .Cd:hover::before, .Cm:hover::before, .Dv:hover::before, .Em:hover::before, .Er:hover::before, .Ev:hover::before, .Fa:hover::before, .Fd:hover::before, .Fl:hover::before, .Fn:hover::before, .Ft:hover::before, .Ic:hover::before, code.In:hover::before, .Lb:hover::before, .Lk:hover::before, .Ms:hover::before, .Mt:hover::before, .Nd:hover::before, code.Nm:hover::before, .Pa:hover::before, .Rs:hover::before, h1.Sh:hover::before, h2.Ss:hover::before, .St:hover::before, .Sx:hover::before, .Sy:hover::before, .Va:hover::before, .Vt:hover::before, .Xr:hover::before { opacity: 1; pointer-events: inherit; } /* Overrides to avoid excessive margins on small devices. */ @media (max-width: 37.5em) { .manual-text { margin-left: 0.5em; } h1.Sh, h2.Ss { margin-left: 0em; } .Bd-indent { margin-left: 2em; } .Bl-hang > dd { margin-left: 2em; } .Bl-tag { margin-left: 2em; } .Bl-tag > dt { margin-left: -2em; } .HP { margin-left: 2em; text-indent: -2em; } } /* Overrides for a dark color scheme for accessibility. */ @media (prefers-color-scheme: dark) { html { --bg: #1E1F21; --fg: #EEEFF1; } :link { color: #BAD7FF; } :visited { color: #F6BAFF; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc.db.5���������������������������������������������������������������������������0100644�0001753�0001753�00000013362�14123140553�0015267�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mandoc.db.5,v 1.5 2016/08/01 12:27:15 schwarze Exp $ .\" .\" Copyright (c) 2014, 2016 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: August 1 2016 $ .Dt MANDOC.DB 5 .Os .Sh NAME .Nm mandoc.db .Nd manual page database .Sh DESCRIPTION The .Nm file format is used to store information about installed manual pages to facilitate semantic searching for manuals. Each manual page tree contains its own .Nm file; see .Sx FILES for examples. .Pp Such database files are generated by .Xr makewhatis 8 and used by .Xr man 1 , .Xr apropos 1 and .Xr whatis 1 . .Pp The file format uses three datatypes: .Pp .Bl -dash -compact -offset 2n -width 1n .It 32-bit signed integer numbers in big endian (network) byte ordering .It NUL-terminated strings .It lists of NUL-terminated strings, terminated by a second NUL character .El .Pp Numbers are aligned to four-byte boundaries; where they follow strings or lists of strings, padding with additional NUL characters occurs. Some, but not all, numbers point to positions in the file. These pointers are measured in bytes, and the first byte of the file is considered to be byte 0. .Pp Each file consists of: .Pp .Bl -dash -compact -offset 2n -width 1n .It One magic number, 0x3a7d0cdb. .It One version number, currently 1. .It One pointer to the macros table. .It One pointer to the final magic number. .It The pages table (variable length). .It The macros table (variable length). .It The magic number once again, 0x3a7d0cdb. .El .Pp The pages table contains one entry for each physical manual page file, no matter how many hard and soft links it may have in the file system. The pages table consists of: .Pp .Bl -dash -compact -offset 2n -width 1n .It The number of pages in the database. .It For each page: .Bl -dash -compact -offset 2n -width 1n .It One pointer to the list of names. .It One pointer to the list of sections. .It One pointer to the list of architectures or 0 if the page is machine-independent. .It One pointer to the one-line description string. .It One pointer to the list of filenames. .El .It For each page, the list of names. Each name is preceded by a single byte indicating the sources of the name. The meaning of the bits is: .Bl -dash -compact -offset 2n -width 1n .It 0x10: The name appears in a filename. .It 0x08: The name appears in a header line, i.e. in a .Dt or .TH macro. .It 0x04: The name is the first one in the title line, i.e. it appears in the first .Nm macro in the NAME section. .It 0x02: The name appears in any .Nm macro in the NAME section. .It 0x01: The name appears in an .Nm block in the SYNOPSIS section. .El .It For each page, the list of sections. Each section is given as a string, not as a number. .It For each architecture-dependent page, the list of architectures. .It For each page, the one-line description string taken from the .Nd macro. .It For each page, the list of filenames relative to the root of the respective manpath. This list includes hard links, soft links, and links simulated with .so .Xr roff 7 requests. The first filename is preceded by a single byte having the following significance: .Bl -dash -compact -offset 2n -width 1n .It .Dv FORM_SRC No = 0x01 : The file format is .Xr mdoc 7 or .Xr man 7 . .It .Dv FORM_CAT No = 0x02 : The manual page is preformatted. .El .It Zero to three NUL bytes for padding. .El .Pp The macros table consists of: .Pp .Bl -dash -compact -offset 2n -width 1n .It The number of different macro keys, currently 36. The ordering of macros is defined in .In mansearch.h and the significance of the macro keys is documented in .Xr apropos 1 . .It For each macro key, one pointer to the respective macro table. .It For each macro key, the macro table (variable length). .El .Pp Each macro table consists of: .Pp .Bl -dash -compact -offset 2n -width 1n .It The number of entries in the table. .It For each entry: .Bl -dash -compact -offset 2n -width 1n .It One pointer to the value of the macro key. Each value is a string of text taken from some macro invocation. .It One pointer to the list of pages. .El .It For each entry, the value of the macro key. .It Zero to three NUL bytes for padding. .It For each entry, one or more pointers to pages in the pages table, pointing to the pointer to the list of names, followed by the number 0. .El .Sh FILES .Bl -tag -width /usr/share/man/mandoc.db -compact .It Pa /usr/share/man/mandoc.db The manual page database for the base system. .It Pa /usr/X11R6/man/mandoc.db The same for the .Xr X 7 Window System. .It Pa /usr/local/man/mandoc.db The same for .Xr packages 7 . .El .Pp A program to dump .Nm files in a human-readable format suitable for .Xr diff 1 is provided in the directory .Pa /usr/src/regress/usr.bin/mandoc/db/dbm_dump/ . .Sh SEE ALSO .Xr apropos 1 , .Xr man 1 , .Xr whatis 1 , .Xr makewhatis 8 .Sh HISTORY A manual page database .Pa /usr/lib/whatis first appeared in .Bx 2 . The present format first appeared in .Ox 6.1 . .Sh AUTHORS .An -nosplit The original version of .Xr makewhatis 8 was written by .An Bill Joy in 1979. The present database format was designed by .An Ingo Schwarze Aq Mt schwarze@openbsd.org in 2016. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc.h������������������������������������������������������������������������������0100644�0001753�0001753�00000036776�14123140553�0015004�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: mandoc.h,v 1.274 2021/08/14 13:53:08 schwarze Exp $ */ /* * Copyright (c) 2012-2021 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Error handling, escape sequence, and character utilities. * Can be used by all code in the mandoc package. */ #define ASCII_NBRSP 31 /* non-breaking space */ #define ASCII_HYPH 30 /* breakable hyphen */ #define ASCII_BREAK 29 /* breakable zero-width space */ /* * Status level. This refers to both internal status (i.e., whilst * running, when warnings/errors are reported) and an indicator of a * threshold of when to halt (when said internal state exceeds the * threshold). */ enum mandoclevel { MANDOCLEVEL_OK = 0, MANDOCLEVEL_STYLE, /* style suggestions */ MANDOCLEVEL_WARNING, /* warnings: syntax, whitespace, etc. */ MANDOCLEVEL_ERROR, /* input has been thrown away */ MANDOCLEVEL_UNSUPP, /* input needs unimplemented features */ MANDOCLEVEL_BADARG, /* bad argument in invocation */ MANDOCLEVEL_SYSERR, /* system error */ MANDOCLEVEL_MAX }; /* * All possible things that can go wrong within a parse, be it libroff, * libmdoc, or libman. */ enum mandocerr { MANDOCERR_OK, MANDOCERR_BASE, /* ===== start of base system conventions ===== */ MANDOCERR_MDOCDATE, /* Mdocdate found: Dd ... */ MANDOCERR_MDOCDATE_MISSING, /* Mdocdate missing: Dd ... */ MANDOCERR_ARCH_BAD, /* unknown architecture: Dt ... arch */ MANDOCERR_OS_ARG, /* operating system explicitly specified: Os ... */ MANDOCERR_RCS_MISSING, /* RCS id missing */ MANDOCERR_STYLE, /* ===== start of style suggestions ===== */ MANDOCERR_DATE_LEGACY, /* legacy man(7) date format: Dd ... */ MANDOCERR_DATE_NORM, /* normalizing date format to: ... */ MANDOCERR_TITLE_CASE, /* lower case character in document title */ MANDOCERR_RCS_REP, /* duplicate RCS id: ... */ MANDOCERR_SEC_TYPO, /* possible typo in section name: Sh ... */ MANDOCERR_ARG_QUOTE, /* unterminated quoted argument */ MANDOCERR_MACRO_USELESS, /* useless macro: macro */ MANDOCERR_BX, /* consider using OS macro: macro */ MANDOCERR_ER_ORDER, /* errnos out of order: Er ... */ MANDOCERR_ER_REP, /* duplicate errno: Er ... */ MANDOCERR_XR_BAD, /* referenced manual not found: Xr name sec */ MANDOCERR_DELIM, /* trailing delimiter: macro ... */ MANDOCERR_DELIM_NB, /* no blank before trailing delimiter: macro ... */ MANDOCERR_FI_SKIP, /* fill mode already enabled, skipping: fi */ MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping: nf */ MANDOCERR_TEXT_LONG, /* input text line longer than 80 bytes */ MANDOCERR_DASHDASH, /* verbatim "--", maybe consider using \(em */ MANDOCERR_FUNC, /* function name without markup: name() */ MANDOCERR_SPACE_EOL, /* whitespace at end of input line */ MANDOCERR_COMMENT_BAD, /* bad comment style */ MANDOCERR_WARNING, /* ===== start of warnings ===== */ /* related to the prologue */ MANDOCERR_DT_NOTITLE, /* missing manual title, using UNTITLED: line */ MANDOCERR_TH_NOTITLE, /* missing manual title, using "": [macro] */ MANDOCERR_MSEC_MISSING, /* missing manual section, using "": macro */ MANDOCERR_MSEC_BAD, /* unknown manual section: Dt ... section */ MANDOCERR_MSEC_FILE, /* filename/section mismatch: ... */ MANDOCERR_DATE_MISSING, /* missing date, using "": [macro] */ MANDOCERR_DATE_BAD, /* cannot parse date, using it verbatim: date */ MANDOCERR_DATE_FUTURE, /* date in the future, using it anyway: date */ MANDOCERR_OS_MISSING, /* missing Os macro, using "" */ MANDOCERR_PROLOG_LATE, /* late prologue macro: macro */ MANDOCERR_PROLOG_ORDER, /* prologue macros out of order: macros */ /* related to document structure */ MANDOCERR_SO, /* .so is fragile, better use ln(1): so path */ MANDOCERR_DOC_EMPTY, /* no document body */ MANDOCERR_SEC_BEFORE, /* content before first section header: macro */ MANDOCERR_NAMESEC_FIRST, /* first section is not NAME: Sh title */ MANDOCERR_NAMESEC_NONM, /* NAME section without Nm before Nd */ MANDOCERR_NAMESEC_NOND, /* NAME section without description */ MANDOCERR_NAMESEC_ND, /* description not at the end of NAME */ MANDOCERR_NAMESEC_BAD, /* bad NAME section content: macro */ MANDOCERR_NAMESEC_PUNCT, /* missing comma before name: Nm name */ MANDOCERR_ND_EMPTY, /* missing description line, using "" */ MANDOCERR_ND_LATE, /* description line outside NAME section */ MANDOCERR_SEC_ORDER, /* sections out of conventional order: Sh title */ MANDOCERR_SEC_REP, /* duplicate section title: Sh title */ MANDOCERR_SEC_MSEC, /* unexpected section: Sh title for ... only */ MANDOCERR_XR_SELF, /* cross reference to self: Xr name sec */ MANDOCERR_XR_ORDER, /* unusual Xr order: ... after ... */ MANDOCERR_XR_PUNCT, /* unusual Xr punctuation: ... after ... */ MANDOCERR_AN_MISSING, /* AUTHORS section without An macro */ /* related to macros and nesting */ MANDOCERR_MACRO_OBS, /* obsolete macro: macro */ MANDOCERR_MACRO_CALL, /* macro neither callable nor escaped: macro */ MANDOCERR_PAR_SKIP, /* skipping paragraph macro: macro ... */ MANDOCERR_PAR_MOVE, /* moving paragraph macro out of list: macro */ MANDOCERR_NS_SKIP, /* skipping no-space macro */ MANDOCERR_BLK_NEST, /* blocks badly nested: macro ... */ MANDOCERR_BD_NEST, /* nested displays are not portable: macro ... */ MANDOCERR_BL_MOVE, /* moving content out of list: macro */ MANDOCERR_TA_LINE, /* first macro on line: Ta */ MANDOCERR_BLK_LINE, /* line scope broken: macro breaks macro */ MANDOCERR_BLK_BLANK, /* skipping blank line in line scope */ /* related to missing arguments */ MANDOCERR_REQ_EMPTY, /* skipping empty request: request */ MANDOCERR_COND_EMPTY, /* conditional request controls empty scope */ MANDOCERR_MACRO_EMPTY, /* skipping empty macro: macro */ MANDOCERR_BLK_EMPTY, /* empty block: macro */ MANDOCERR_ARG_EMPTY, /* empty argument, using 0n: macro arg */ MANDOCERR_BD_NOTYPE, /* missing display type, using -ragged: Bd */ MANDOCERR_BL_LATETYPE, /* list type is not the first argument: Bl arg */ MANDOCERR_BL_NOWIDTH, /* missing -width in -tag list, using 6n */ MANDOCERR_EX_NONAME, /* missing utility name, using "": Ex */ MANDOCERR_FO_NOHEAD, /* missing function name, using "": Fo */ MANDOCERR_IT_NOHEAD, /* empty head in list item: Bl -type It */ MANDOCERR_IT_NOBODY, /* empty list item: Bl -type It */ MANDOCERR_IT_NOARG, /* missing argument, using next line: Bl -c It */ MANDOCERR_BF_NOFONT, /* missing font type, using \fR: Bf */ MANDOCERR_BF_BADFONT, /* unknown font type, using \fR: Bf font */ MANDOCERR_PF_SKIP, /* nothing follows prefix: Pf arg */ MANDOCERR_RS_EMPTY, /* empty reference block: Rs */ MANDOCERR_XR_NOSEC, /* missing section argument: Xr arg */ MANDOCERR_ARG_STD, /* missing -std argument, adding it: macro */ MANDOCERR_OP_EMPTY, /* missing option string, using "": OP */ MANDOCERR_UR_NOHEAD, /* missing resource identifier, using "": UR */ MANDOCERR_EQN_NOBOX, /* missing eqn box, using "": op */ /* related to bad arguments */ MANDOCERR_ARG_REP, /* duplicate argument: macro arg */ MANDOCERR_AN_REP, /* skipping duplicate argument: An -arg */ MANDOCERR_BD_REP, /* skipping duplicate display type: Bd -type */ MANDOCERR_BL_REP, /* skipping duplicate list type: Bl -type */ MANDOCERR_BL_SKIPW, /* skipping -width argument: Bl -type */ MANDOCERR_BL_COL, /* wrong number of cells */ MANDOCERR_AT_BAD, /* unknown AT&T UNIX version: At version */ MANDOCERR_FA_COMMA, /* comma in function argument: arg */ MANDOCERR_FN_PAREN, /* parenthesis in function name: arg */ MANDOCERR_LB_BAD, /* unknown library name: Lb ... */ MANDOCERR_RS_BAD, /* invalid content in Rs block: macro */ MANDOCERR_SM_BAD, /* invalid Boolean argument: macro arg */ MANDOCERR_CHAR_FONT, /* argument contains two font escapes */ MANDOCERR_FT_BAD, /* unknown font, skipping request: ft font */ MANDOCERR_TR_ODD, /* odd number of characters in request: tr char */ /* related to plain text */ MANDOCERR_FI_BLANK, /* blank line in fill mode, using .sp */ MANDOCERR_FI_TAB, /* tab in filled text */ MANDOCERR_EOS, /* new sentence, new line */ MANDOCERR_ESC_BAD, /* invalid escape sequence: esc */ MANDOCERR_ESC_UNDEF, /* undefined escape, printing literally: char */ MANDOCERR_STR_UNDEF, /* undefined string, using "": name */ /* related to tables */ MANDOCERR_TBLLAYOUT_SPAN, /* tbl line starts with span */ MANDOCERR_TBLLAYOUT_DOWN, /* tbl column starts with span */ MANDOCERR_TBLLAYOUT_VERT, /* skipping vertical bar in tbl layout */ MANDOCERR_ERROR, /* ===== start of errors ===== */ /* related to tables */ MANDOCERR_TBLOPT_ALPHA, /* non-alphabetic character in tbl options */ MANDOCERR_TBLOPT_BAD, /* skipping unknown tbl option: option */ MANDOCERR_TBLOPT_NOARG, /* missing tbl option argument: option */ MANDOCERR_TBLOPT_ARGSZ, /* wrong tbl option argument size: option */ MANDOCERR_TBLLAYOUT_NONE, /* empty tbl layout */ MANDOCERR_TBLLAYOUT_CHAR, /* invalid character in tbl layout: char */ MANDOCERR_TBLLAYOUT_PAR, /* unmatched parenthesis in tbl layout */ MANDOCERR_TBLLAYOUT_SPC, /* ignoring excessive spacing in tbl layout */ MANDOCERR_TBLDATA_NONE, /* tbl without any data cells */ MANDOCERR_TBLDATA_SPAN, /* ignoring data in spanned tbl cell: data */ MANDOCERR_TBLDATA_EXTRA, /* ignoring extra tbl data cells: data */ MANDOCERR_TBLDATA_BLK, /* data block open at end of tbl: macro */ /* related to document structure and macros */ MANDOCERR_PROLOG_REP, /* duplicate prologue macro: macro */ MANDOCERR_DT_LATE, /* skipping late title macro: Dt args */ MANDOCERR_ROFFLOOP, /* input stack limit exceeded, infinite loop? */ MANDOCERR_CHAR_BAD, /* skipping bad character: number */ MANDOCERR_MACRO, /* skipping unknown macro: macro */ MANDOCERR_REQ_NOMAC, /* skipping request outside macro: ... */ MANDOCERR_REQ_INSEC, /* skipping insecure request: request */ MANDOCERR_IT_STRAY, /* skipping item outside list: It ... */ MANDOCERR_TA_STRAY, /* skipping column outside column list: Ta */ MANDOCERR_BLK_NOTOPEN, /* skipping end of block that is not open */ MANDOCERR_RE_NOTOPEN, /* fewer RS blocks open, skipping: RE arg */ MANDOCERR_BLK_BROKEN, /* inserting missing end of block: macro ... */ MANDOCERR_BLK_NOEND, /* appending missing end of block: macro */ /* related to request and macro arguments */ MANDOCERR_NAMESC, /* escaped character not allowed in a name: name */ MANDOCERR_ARG_UNDEF, /* using macro argument outside macro */ MANDOCERR_ARG_NONUM, /* argument number is not numeric */ MANDOCERR_BD_FILE, /* NOT IMPLEMENTED: Bd -file */ MANDOCERR_BD_NOARG, /* skipping display without arguments: Bd */ MANDOCERR_BL_NOTYPE, /* missing list type, using -item: Bl */ MANDOCERR_CE_NONUM, /* argument is not numeric, using 1: ce ... */ MANDOCERR_CHAR_ARG, /* argument is not a character: char ... */ MANDOCERR_NM_NONAME, /* missing manual name, using "": Nm */ MANDOCERR_OS_UNAME, /* uname(3) system call failed, using UNKNOWN */ MANDOCERR_ST_BAD, /* unknown standard specifier: St standard */ MANDOCERR_IT_NONUM, /* skipping request without numeric argument */ MANDOCERR_SHIFT, /* excessive shift: ..., but max is ... */ MANDOCERR_SO_PATH, /* NOT IMPLEMENTED: .so with absolute path or ".." */ MANDOCERR_SO_FAIL, /* .so request failed */ MANDOCERR_TG_SPC, /* skipping tag containing whitespace: tag */ MANDOCERR_ARG_SKIP, /* skipping all arguments: macro args */ MANDOCERR_ARG_EXCESS, /* skipping excess arguments: macro ... args */ MANDOCERR_DIVZERO, /* divide by zero */ MANDOCERR_UNSUPP, /* ===== start of unsupported features ===== */ MANDOCERR_TOOLARGE, /* input too large */ MANDOCERR_CHAR_UNSUPP, /* unsupported control character: number */ MANDOCERR_ESC_UNSUPP, /* unsupported escape sequence: escape */ MANDOCERR_REQ_UNSUPP, /* unsupported roff request: request */ MANDOCERR_WHILE_NEST, /* nested .while loops */ MANDOCERR_WHILE_OUTOF, /* end of scope with open .while loop */ MANDOCERR_WHILE_INTO, /* end of .while loop in inner scope */ MANDOCERR_WHILE_FAIL, /* cannot continue this .while loop */ MANDOCERR_TBLOPT_EQN, /* eqn delim option in tbl: arg */ MANDOCERR_TBLLAYOUT_MOD, /* unsupported tbl layout modifier: m */ MANDOCERR_TBLMACRO, /* ignoring macro in table: macro */ MANDOCERR_TBL_TMAN, /* skipping tbl in -Tman mode */ MANDOCERR_EQN_TMAN, /* skipping eqn in -Tman mode */ MANDOCERR_BADARG, /* ===== start of bad invocations ===== */ MANDOCERR_BADARG_BAD, /* bad argument */ MANDOCERR_BADARG_DUPE, /* duplicate argument */ MANDOCERR_BADVAL, /* does not take a value */ MANDOCERR_BADVAL_MISS, /* missing argument value */ MANDOCERR_BADVAL_BAD, /* bad argument value */ MANDOCERR_BADVAL_DUPE, /* duplicate argument value */ MANDOCERR_TAG, /* no such tag */ MANDOCERR_MAN_TMARKDOWN, /* -Tmarkdown unsupported for man(7) input */ MANDOCERR_SYSERR, /* ===== start of system errors ===== */ MANDOCERR_DUP, MANDOCERR_EXEC, MANDOCERR_FDOPEN, MANDOCERR_FFLUSH, MANDOCERR_FORK, MANDOCERR_FSTAT, MANDOCERR_GETLINE, MANDOCERR_GLOB, MANDOCERR_GZCLOSE, MANDOCERR_GZDOPEN, MANDOCERR_MKSTEMP, MANDOCERR_OPEN, MANDOCERR_PLEDGE, MANDOCERR_READ, MANDOCERR_WAIT, MANDOCERR_WRITE, MANDOCERR_MAX }; enum mandoc_esc { ESCAPE_ERROR = 0, /* bail! unparsable escape */ ESCAPE_UNSUPP, /* unsupported escape; ignore it */ ESCAPE_IGNORE, /* escape to be ignored */ ESCAPE_UNDEF, /* undefined escape; print literal character */ ESCAPE_SPECIAL, /* a regular special character */ ESCAPE_FONT, /* a generic font mode */ ESCAPE_FONTBOLD, /* bold font mode */ ESCAPE_FONTITALIC, /* italic font mode */ ESCAPE_FONTBI, /* bold italic font mode */ ESCAPE_FONTROMAN, /* roman font mode */ ESCAPE_FONTCR, /* constant width font mode */ ESCAPE_FONTCB, /* constant width bold font mode */ ESCAPE_FONTCI, /* constant width italic font mode */ ESCAPE_FONTPREV, /* previous font mode */ ESCAPE_NUMBERED, /* a numbered glyph */ ESCAPE_UNICODE, /* a unicode codepoint */ ESCAPE_DEVICE, /* print the output device name */ ESCAPE_BREAK, /* break the output line */ ESCAPE_NOSPACE, /* suppress space if the last on a line */ ESCAPE_HORIZ, /* horizontal movement */ ESCAPE_HLINE, /* horizontal line drawing */ ESCAPE_SKIPCHAR, /* skip the next character */ ESCAPE_OVERSTRIKE /* overstrike all chars in the argument */ }; enum mandoc_esc mandoc_font(const char *, int); enum mandoc_esc mandoc_escape(const char **, const char **, int *); void mandoc_msg_setoutfile(FILE *); const char *mandoc_msg_getinfilename(void); void mandoc_msg_setinfilename(const char *); enum mandocerr mandoc_msg_getmin(void); void mandoc_msg_setmin(enum mandocerr); enum mandoclevel mandoc_msg_getrc(void); void mandoc_msg_setrc(enum mandoclevel); void mandoc_msg(enum mandocerr, int, int, const char *, ...) __attribute__((__format__ (__printf__, 4, 5))); void mandoc_msg_summary(void); void mchars_alloc(void); void mchars_free(void); int mchars_num2char(const char *, size_t); const char *mchars_uc2str(int); int mchars_num2uc(const char *, size_t); int mchars_spec2cp(const char *, size_t); const char *mchars_spec2str(const char *, size_t, size_t *); ��mandoc-1.14.6/mandoc_aux.h��������������������������������������������������������������������������0100644�0001753�0001753�00000002475�14123140553�0015646�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: mandoc_aux.h,v 1.7 2017/06/12 19:05:47 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2017 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ int mandoc_asprintf(char **, const char *, ...) __attribute__((__format__ (__printf__, 2, 3))); void *mandoc_calloc(size_t, size_t); void *mandoc_malloc(size_t); void *mandoc_realloc(void *, size_t); void *mandoc_reallocarray(void *, size_t, size_t); void *mandoc_recallocarray(void *, size_t, size_t, size_t); char *mandoc_strdup(const char *); char *mandoc_strndup(const char *, size_t); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc_char.7�������������������������������������������������������������������������0100644�0001753�0001753�00000072211�14123140553�0015700�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mandoc_char.7,v 1.78 2020/10/31 11:45:16 schwarze Exp $ .\" .\" Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org> .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2011,2013,2015,2017-2020 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: October 31 2020 $ .Dt MANDOC_CHAR 7 .Os .Sh NAME .Nm mandoc_char .Nd mandoc special characters .Sh DESCRIPTION This page documents the .Xr roff 7 escape sequences accepted by .Xr mandoc 1 to represent special characters in .Xr mdoc 7 and .Xr man 7 documents. .Pp The rendering depends on the .Xr mandoc 1 output mode; it can be inspected by calling .Xr man 1 on the .Nm manual page with different .Fl T arguments. In ASCII output, the rendering of some characters may be hard to interpret for the reader. Many are rendered as descriptive strings like .Qq <integral> , .Qq <degree> , or .Qq <Gamma> , which may look ugly, and many are replaced by similar ASCII characters. In particular, accented characters are usually shown without the accent. For that reason, try to avoid using any of the special characters documented here except those discussed in the .Sx DESCRIPTION , unless they are essential for explaining the subject matter at hand, for example when documenting complicated mathematical functions. .Pp In particular, in English manual pages, do not use special-character escape sequences to represent national language characters in author names; instead, provide ASCII transcriptions of the names. .Ss Dashes and Hyphens In typography there are different types of dashes of various width: the hyphen (\(hy), the en-dash (\(en), the em-dash (\(em), and the mathematical minus sign (\(mi). .Pp Hyphens are used for adjectives; to separate the two parts of a compound word; or to separate a word across two successive lines of text. The hyphen does not need to be escaped: .Bd -unfilled -offset indent blue-eyed lorry-driver .Ed .Pp The en-dash is used to separate the two elements of a range, or can be used the same way as an em-dash. It should be written as .Sq \e(en : .Bd -unfilled -offset indent pp. 95\e(en97. Go away \e(en or else! .Ed .Pp The em-dash can be used to show an interruption or can be used the same way as colons, semi-colons, or parentheses. It should be written as .Sq \e(em : .Bd -unfilled -offset indent Three things \e(em apples, oranges, and bananas. This is not that \e(em rather, this is that. .Ed .Pp In .Xr roff 7 documents, the minus sign is normally written as .Sq \e- . In manual pages, some style guides recommend to also use .Sq \e- if an ASCII 0x2d .Dq hyphen-minus output glyph that can be copied and pasted is desired in output modes supporting it, for example in .Fl T Cm utf8 and .Fl T Cm html . But currently, no practically relevant manual page formatter requires that subtlety, so in manual pages, it is sufficient to write plain .Sq - to represent hyphen, minus, and hyphen-minus. .Pp If a word on a text input line contains a hyphen, a formatter may decide to insert an output line break after the hyphen if that helps filling the current output line, but the whole word would overflow the line. If it is important that the word is not broken across lines in this way, a zero-width space .Pq Sq \e& can be inserted before or after the hyphen. While .Xr mandoc 1 never breaks the output line after hyphens adjacent to a zero-width space, after any of the other dash- or hyphen-like characters represented by escape sequences, or after hyphens inside words in macro arguments, other software may not respect these rules and may break the line even in such cases. .Pp Some .Xr roff 7 implementations contains dictionaries allowing to break the line at syllable boundaries even inside words that contain no hyphens. Such automatic hyphenation is not supported by .Xr mandoc 1 , which only breaks the line at whitespace, and inside words only after existing hyphens. .Ss Spaces To separate words in normal text, for indenting and alignment in literal context, and when none of the following special cases apply, just use the normal space character .Pq Sq \ . .Pp When filling text, output lines may be broken between words, i.e. at space characters. To prevent a line break between two particular words, use the unpaddable non-breaking space escape sequence .Pq Sq \e\ \& instead of the normal space character. For example, the input string .Dq number\e\ 1 will be kept together as .Dq number\ 1 on the same output line. .Pp On request and macro lines, the normal space character serves as an argument delimiter. To include whitespace into arguments, quoting is usually the best choice; see the MACRO SYNTAX section in .Xr roff 7 . In some cases, using the non-breaking space escape sequence .Pq Sq \e\ \& may be preferable. .Pp To escape macro names and to protect whitespace at the end of input lines, the zero-width space .Pq Sq \e& is often useful. For example, in .Xr mdoc 7 , a normal space character can be displayed in single quotes in either of the following ways: .Pp .Dl .Sq \(dq \(dq .Dl .Sq \e \e& .Ss Quotes On request and macro lines, the double-quote character .Pq Sq \(dq is handled specially to allow quoting. One way to prevent this special handling is by using the .Sq \e(dq escape sequence. .Pp Note that on text lines, literal double-quote characters can be used verbatim. All other quote-like characters can be used verbatim as well, even on request and macro lines. .Ss Accents In output modes supporting such special output characters, for example .Fl T Cm pdf , and sometimes less consistently in .Fl T Cm utf8 , some .Xr roff 7 formatters convert the following ASCII input characters to the following Unicode special output characters: .Bl -column x(ga U+2018 -offset indent .It \(ga Ta U+2018 Ta left single quotation mark .It \(aq Ta U+2019 Ta right single quotation mark .It \(ti Ta U+02DC Ta small tilde .It \(ha Ta U+02C6 Ta modifier letter circumflex .El .Pp In prose, this automatic substitution is often desirable; but when these characters have to be displayed as plain ASCII characters, for example in source code samples, they require escaping to render as follows: .Bl -column x(ga U+2018 -offset indent .It \e(ga Ta U+0060 Ta grave accent .It \e(aq Ta U+0027 Ta apostrophe .It \e(ti Ta U+007E Ta tilde .It \e(ha Ta U+005E Ta circumflex accent .El .Ss Periods The period .Pq Sq \&. is handled specially at the beginning of an input line, where it introduces a .Xr roff 7 request or a macro, and when appearing alone as a macro argument in .Xr mdoc 7 . In such situations, prepend a zero-width space .Pq Sq \e&. to make it behave like normal text. .Pp Do not use the .Sq \e. escape sequence. It does not prevent special handling of the period. .Ss Backslashes To include a literal backslash .Pq Sq \e into the output, use the .Pq Sq \ee escape sequence. .Pp Note that doubling it .Pq Sq \e\e is not the right way to output a backslash. Because .Xr mandoc 1 does not implement full .Xr roff 7 functionality, it may work with .Xr mandoc 1 , but it may have weird effects on complete .Xr roff 7 implementations. .Sh SPECIAL CHARACTERS Special characters are encoded as .Sq \eX .Pq for a one-character escape , .Sq \e(XX .Pq two-character , and .Sq \e[N] .Pq N-character . For details, see the .Em Special Characters subsection of the .Xr roff 7 manual. .Pp Spaces, non-breaking unless stated otherwise: .Bl -column "Input" "Description" -offset indent -compact .It Em Input Ta Em Description .It Sq \e\ \& Ta unpaddable space .It \e\(ti Ta paddable space .It \e0 Ta digit-width space .It \e| Ta one-sixth \e(em narrow space, zero width in nroff mode .It \e^ Ta one-twelfth \e(em half-narrow space, zero width in nroff .It \e& Ta zero-width space .It \e) Ta zero-width space transparent to end-of-sentence detection .It \e% Ta zero-width space allowing hyphenation .It \e: Ta zero-width space allowing line break .El .Pp Lines: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(ba Ta \(ba Ta bar .It \e(br Ta \(br Ta box rule .It \e(ul Ta \(ul Ta underscore .It \e(ru Ta \(ru Ta underscore (width 0.5m) .It \e(rn Ta \(rn Ta overline .It \e(bb Ta \(bb Ta broken bar .It \e(sl Ta \(sl Ta forward slash .It \e(rs Ta \(rs Ta backward slash .El .Pp Text markers: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(ci Ta \(ci Ta circle .It \e(bu Ta \(bu Ta bullet .It \e(dd Ta \(dd Ta double dagger .It \e(dg Ta \(dg Ta dagger .It \e(lz Ta \(lz Ta lozenge .It \e(sq Ta \(sq Ta white square .It \e(ps Ta \(ps Ta paragraph .It \e(sc Ta \(sc Ta section .It \e(lh Ta \(lh Ta left hand .It \e(rh Ta \(rh Ta right hand .It \e(at Ta \(at Ta at .It \e(sh Ta \(sh Ta hash (pound) .It \e(CR Ta \(CR Ta carriage return .It \e(OK Ta \(OK Ta check mark .It \e(CL Ta \(CL Ta club suit .It \e(SP Ta \(SP Ta spade suit .It \e(HE Ta \(HE Ta heart suit .It \e(DI Ta \(DI Ta diamond suit .El .Pp Legal symbols: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(co Ta \(co Ta copyright .It \e(rg Ta \(rg Ta registered .It \e(tm Ta \(tm Ta trademarked .El .Pp Punctuation: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(em Ta \(em Ta em-dash .It \e(en Ta \(en Ta en-dash .It \e(hy Ta \(hy Ta hyphen .It \ee Ta \e Ta back-slash .It \e. Ta \. Ta period .It \e(r! Ta \(r! Ta upside-down exclamation .It \e(r? Ta \(r? Ta upside-down question .El .Pp Quotes: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(Bq Ta \(Bq Ta right low double-quote .It \e(bq Ta \(bq Ta right low single-quote .It \e(lq Ta \(lq Ta left double-quote .It \e(rq Ta \(rq Ta right double-quote .It \e(oq Ta \(oq Ta left single-quote .It \e(cq Ta \(cq Ta right single-quote .It \e(aq Ta \(aq Ta apostrophe quote (ASCII character) .It \e(dq Ta \(dq Ta double quote (ASCII character) .It \e(Fo Ta \(Fo Ta left guillemet .It \e(Fc Ta \(Fc Ta right guillemet .It \e(fo Ta \(fo Ta left single guillemet .It \e(fc Ta \(fc Ta right single guillemet .El .Pp Brackets: .Bl -column "xxbracketrightbtx" Rendered Description -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(lB Ta \(lB Ta left bracket .It \e(rB Ta \(rB Ta right bracket .It \e(lC Ta \(lC Ta left brace .It \e(rC Ta \(rC Ta right brace .It \e(la Ta \(la Ta left angle .It \e(ra Ta \(ra Ta right angle .It \e(bv Ta \(bv Ta brace extension (special font) .It \e[braceex] Ta \[braceex] Ta brace extension .It \e[bracketlefttp] Ta \[bracketlefttp] Ta top-left hooked bracket .It \e[bracketleftbt] Ta \[bracketleftbt] Ta bottom-left hooked bracket .It \e[bracketleftex] Ta \[bracketleftex] Ta left hooked bracket extension .It \e[bracketrighttp] Ta \[bracketrighttp] Ta top-right hooked bracket .It \e[bracketrightbt] Ta \[bracketrightbt] Ta bottom-right hooked bracket .It \e[bracketrightex] Ta \[bracketrightex] Ta right hooked bracket extension .It \e(lt Ta \(lt Ta top-left hooked brace .It \e[bracelefttp] Ta \[bracelefttp] Ta top-left hooked brace .It \e(lk Ta \(lk Ta mid-left hooked brace .It \e[braceleftmid] Ta \[braceleftmid] Ta mid-left hooked brace .It \e(lb Ta \(lb Ta bottom-left hooked brace .It \e[braceleftbt] Ta \[braceleftbt] Ta bottom-left hooked brace .It \e[braceleftex] Ta \[braceleftex] Ta left hooked brace extension .It \e(rt Ta \(rt Ta top-left hooked brace .It \e[bracerighttp] Ta \[bracerighttp] Ta top-right hooked brace .It \e(rk Ta \(rk Ta mid-right hooked brace .It \e[bracerightmid] Ta \[bracerightmid] Ta mid-right hooked brace .It \e(rb Ta \(rb Ta bottom-right hooked brace .It \e[bracerightbt] Ta \[bracerightbt] Ta bottom-right hooked brace .It \e[bracerightex] Ta \[bracerightex] Ta right hooked brace extension .It \e[parenlefttp] Ta \[parenlefttp] Ta top-left hooked parenthesis .It \e[parenleftbt] Ta \[parenleftbt] Ta bottom-left hooked parenthesis .It \e[parenleftex] Ta \[parenleftex] Ta left hooked parenthesis extension .It \e[parenrighttp] Ta \[parenrighttp] Ta top-right hooked parenthesis .It \e[parenrightbt] Ta \[parenrightbt] Ta bottom-right hooked parenthesis .It \e[parenrightex] Ta \[parenrightex] Ta right hooked parenthesis extension .El .Pp Arrows: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(<- Ta \(<- Ta left arrow .It \e(-> Ta \(-> Ta right arrow .It \e(<> Ta \(<> Ta left-right arrow .It \e(da Ta \(da Ta down arrow .It \e(ua Ta \(ua Ta up arrow .It \e(va Ta \(va Ta up-down arrow .It \e(lA Ta \(lA Ta left double-arrow .It \e(rA Ta \(rA Ta right double-arrow .It \e(hA Ta \(hA Ta left-right double-arrow .It \e(uA Ta \(uA Ta up double-arrow .It \e(dA Ta \(dA Ta down double-arrow .It \e(vA Ta \(vA Ta up-down double-arrow .It \e(an Ta \(an Ta horizontal arrow extension .El .Pp Logical: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(AN Ta \(AN Ta logical and .It \e(OR Ta \(OR Ta logical or .It \e[tno] Ta \[tno] Ta logical not (text font) .It \e(no Ta \(no Ta logical not (special font) .It \e(te Ta \(te Ta existential quantifier .It \e(fa Ta \(fa Ta universal quantifier .It \e(st Ta \(st Ta such that .It \e(tf Ta \(tf Ta therefore .It \e(3d Ta \(3d Ta therefore .It \e(or Ta \(or Ta bitwise or .El .Pp Mathematical: .Bl -column "xxcoproductxx" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e- Ta \- Ta minus (text font) .It \e(mi Ta \(mi Ta minus (special font) .It + Ta + Ta plus (text font) .It \e(pl Ta \(pl Ta plus (special font) .It \e(-+ Ta \(-+ Ta minus-plus .It \e[t+-] Ta \[t+-] Ta plus-minus (text font) .It \e(+- Ta \(+- Ta plus-minus (special font) .It \e(pc Ta \(pc Ta center-dot .It \e[tmu] Ta \[tmu] Ta multiply (text font) .It \e(mu Ta \(mu Ta multiply (special font) .It \e(c* Ta \(c* Ta circle-multiply .It \e(c+ Ta \(c+ Ta circle-plus .It \e[tdi] Ta \[tdi] Ta divide (text font) .It \e(di Ta \(di Ta divide (special font) .It \e(f/ Ta \(f/ Ta fraction .It \e(** Ta \(** Ta asterisk .It \e(<= Ta \(<= Ta less-than-equal .It \e(>= Ta \(>= Ta greater-than-equal .It \e(<< Ta \(<< Ta much less .It \e(>> Ta \(>> Ta much greater .It \e(eq Ta \(eq Ta equal .It \e(!= Ta \(!= Ta not equal .It \e(== Ta \(== Ta equivalent .It \e(ne Ta \(ne Ta not equivalent .It \e(ap Ta \(ap Ta tilde operator .It \e(|= Ta \(|= Ta asymptotically equal .It \e(=\(ti Ta \(=~ Ta approximately equal .It \e(\(ti\(ti Ta \(~~ Ta almost equal .It \e(\(ti= Ta \(~= Ta almost equal .It \e(pt Ta \(pt Ta proportionate .It \e(es Ta \(es Ta empty set .It \e(mo Ta \(mo Ta element .It \e(nm Ta \(nm Ta not element .It \e(sb Ta \(sb Ta proper subset .It \e(nb Ta \(nb Ta not subset .It \e(sp Ta \(sp Ta proper superset .It \e(nc Ta \(nc Ta not superset .It \e(ib Ta \(ib Ta reflexive subset .It \e(ip Ta \(ip Ta reflexive superset .It \e(ca Ta \(ca Ta intersection .It \e(cu Ta \(cu Ta union .It \e(/_ Ta \(/_ Ta angle .It \e(pp Ta \(pp Ta perpendicular .It \e(is Ta \(is Ta integral .It \e[integral] Ta \[integral] Ta integral .It \e[sum] Ta \[sum] Ta summation .It \e[product] Ta \[product] Ta product .It \e[coproduct] Ta \[coproduct] Ta coproduct .It \e(gr Ta \(gr Ta gradient .It \e(sr Ta \(sr Ta square root .It \e[sqrt] Ta \[sqrt] Ta square root .It \e(lc Ta \(lc Ta left-ceiling .It \e(rc Ta \(rc Ta right-ceiling .It \e(lf Ta \(lf Ta left-floor .It \e(rf Ta \(rf Ta right-floor .It \e(if Ta \(if Ta infinity .It \e(Ah Ta \(Ah Ta aleph .It \e(Im Ta \(Im Ta imaginary .It \e(Re Ta \(Re Ta real .It \e(wp Ta \(wp Ta Weierstrass p .It \e(pd Ta \(pd Ta partial differential .It \e(-h Ta \(-h Ta Planck constant over 2\(*p .It \e[hbar] Ta \[hbar] Ta Planck constant over 2\(*p .It \e(12 Ta \(12 Ta one-half .It \e(14 Ta \(14 Ta one-fourth .It \e(34 Ta \(34 Ta three-fourths .It \e(18 Ta \(18 Ta one-eighth .It \e(38 Ta \(38 Ta three-eighths .It \e(58 Ta \(58 Ta five-eighths .It \e(78 Ta \(78 Ta seven-eighths .It \e(S1 Ta \(S1 Ta superscript 1 .It \e(S2 Ta \(S2 Ta superscript 2 .It \e(S3 Ta \(S3 Ta superscript 3 .El .Pp Ligatures: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(ff Ta \(ff Ta ff ligature .It \e(fi Ta \(fi Ta fi ligature .It \e(fl Ta \(fl Ta fl ligature .It \e(Fi Ta \(Fi Ta ffi ligature .It \e(Fl Ta \(Fl Ta ffl ligature .It \e(AE Ta \(AE Ta AE .It \e(ae Ta \(ae Ta ae .It \e(OE Ta \(OE Ta OE .It \e(oe Ta \(oe Ta oe .It \e(ss Ta \(ss Ta German eszett .It \e(IJ Ta \(IJ Ta IJ ligature .It \e(ij Ta \(ij Ta ij ligature .El .Pp Accents: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(a" Ta \(a" Ta Hungarian umlaut .It \e(a- Ta \(a- Ta macron .It \e(a. Ta \(a. Ta dotted .It \e(a^ Ta \(a^ Ta circumflex .It \e(aa Ta \(aa Ta acute .It \e\(aq Ta \' Ta acute .It \e(ga Ta \(ga Ta grave .It \e\(ga Ta \` Ta grave .It \e(ab Ta \(ab Ta breve .It \e(ac Ta \(ac Ta cedilla .It \e(ad Ta \(ad Ta dieresis .It \e(ah Ta \(ah Ta caron .It \e(ao Ta \(ao Ta ring .It \e(a\(ti Ta \(a~ Ta tilde .It \e(ho Ta \(ho Ta ogonek .It \e(ha Ta \(ha Ta hat (ASCII character) .It \e(ti Ta \(ti Ta tilde (ASCII character) .El .Pp Accented letters: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(\(aqA Ta \('A Ta acute A .It \e(\(aqE Ta \('E Ta acute E .It \e(\(aqI Ta \('I Ta acute I .It \e(\(aqO Ta \('O Ta acute O .It \e(\(aqU Ta \('U Ta acute U .It \e(\(aqY Ta \('Y Ta acute Y .It \e(\(aqa Ta \('a Ta acute a .It \e(\(aqe Ta \('e Ta acute e .It \e(\(aqi Ta \('i Ta acute i .It \e(\(aqo Ta \('o Ta acute o .It \e(\(aqu Ta \('u Ta acute u .It \e(\(aqy Ta \('y Ta acute y .It \e(\(gaA Ta \(`A Ta grave A .It \e(\(gaE Ta \(`E Ta grave E .It \e(\(gaI Ta \(`I Ta grave I .It \e(\(gaO Ta \(`O Ta grave O .It \e(\(gaU Ta \(`U Ta grave U .It \e(\(gaa Ta \(`a Ta grave a .It \e(\(gae Ta \(`e Ta grave e .It \e(\(gai Ta \(`i Ta grave i .It \e(\(gao Ta \(`i Ta grave o .It \e(\(gau Ta \(`u Ta grave u .It \e(\(tiA Ta \(~A Ta tilde A .It \e(\(tiN Ta \(~N Ta tilde N .It \e(\(tiO Ta \(~O Ta tilde O .It \e(\(tia Ta \(~a Ta tilde a .It \e(\(tin Ta \(~n Ta tilde n .It \e(\(tio Ta \(~o Ta tilde o .It \e(:A Ta \(:A Ta dieresis A .It \e(:E Ta \(:E Ta dieresis E .It \e(:I Ta \(:I Ta dieresis I .It \e(:O Ta \(:O Ta dieresis O .It \e(:U Ta \(:U Ta dieresis U .It \e(:a Ta \(:a Ta dieresis a .It \e(:e Ta \(:e Ta dieresis e .It \e(:i Ta \(:i Ta dieresis i .It \e(:o Ta \(:o Ta dieresis o .It \e(:u Ta \(:u Ta dieresis u .It \e(:y Ta \(:y Ta dieresis y .It \e(^A Ta \(^A Ta circumflex A .It \e(^E Ta \(^E Ta circumflex E .It \e(^I Ta \(^I Ta circumflex I .It \e(^O Ta \(^O Ta circumflex O .It \e(^U Ta \(^U Ta circumflex U .It \e(^a Ta \(^a Ta circumflex a .It \e(^e Ta \(^e Ta circumflex e .It \e(^i Ta \(^i Ta circumflex i .It \e(^o Ta \(^o Ta circumflex o .It \e(^u Ta \(^u Ta circumflex u .It \e(,C Ta \(,C Ta cedilla C .It \e(,c Ta \(,c Ta cedilla c .It \e(/L Ta \(/L Ta stroke L .It \e(/l Ta \(/l Ta stroke l .It \e(/O Ta \(/O Ta stroke O .It \e(/o Ta \(/o Ta stroke o .It \e(oA Ta \(oA Ta ring A .It \e(oa Ta \(oa Ta ring a .El .Pp Special letters: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(-D Ta \(-D Ta Eth .It \e(Sd Ta \(Sd Ta eth .It \e(TP Ta \(TP Ta Thorn .It \e(Tp Ta \(Tp Ta thorn .It \e(.i Ta \(.i Ta dotless i .It \e(.j Ta \(.j Ta dotless j .El .Pp Currency: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(Do Ta \(Do Ta dollar .It \e(ct Ta \(ct Ta cent .It \e(Eu Ta \(Eu Ta Euro symbol .It \e(eu Ta \(eu Ta Euro symbol .It \e(Ye Ta \(Ye Ta yen .It \e(Po Ta \(Po Ta pound .It \e(Cs Ta \(Cs Ta Scandinavian .It \e(Fn Ta \(Fn Ta florin .El .Pp Units: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(de Ta \(de Ta degree .It \e(%0 Ta \(%0 Ta per-thousand .It \e(fm Ta \(fm Ta minute .It \e(sd Ta \(sd Ta second .It \e(mc Ta \(mc Ta micro .It \e(Of Ta \(Of Ta Spanish female ordinal .It \e(Om Ta \(Om Ta Spanish masculine ordinal .El .Pp Greek letters: .Bl -column "Input" "Rendered" "Description" -offset indent -compact .It Em Input Ta Em Rendered Ta Em Description .It \e(*A Ta \(*A Ta Alpha .It \e(*B Ta \(*B Ta Beta .It \e(*G Ta \(*G Ta Gamma .It \e(*D Ta \(*D Ta Delta .It \e(*E Ta \(*E Ta Epsilon .It \e(*Z Ta \(*Z Ta Zeta .It \e(*Y Ta \(*Y Ta Eta .It \e(*H Ta \(*H Ta Theta .It \e(*I Ta \(*I Ta Iota .It \e(*K Ta \(*K Ta Kappa .It \e(*L Ta \(*L Ta Lambda .It \e(*M Ta \(*M Ta Mu .It \e(*N Ta \(*N Ta Nu .It \e(*C Ta \(*C Ta Xi .It \e(*O Ta \(*O Ta Omicron .It \e(*P Ta \(*P Ta Pi .It \e(*R Ta \(*R Ta Rho .It \e(*S Ta \(*S Ta Sigma .It \e(*T Ta \(*T Ta Tau .It \e(*U Ta \(*U Ta Upsilon .It \e(*F Ta \(*F Ta Phi .It \e(*X Ta \(*X Ta Chi .It \e(*Q Ta \(*Q Ta Psi .It \e(*W Ta \(*W Ta Omega .It \e(*a Ta \(*a Ta alpha .It \e(*b Ta \(*b Ta beta .It \e(*g Ta \(*g Ta gamma .It \e(*d Ta \(*d Ta delta .It \e(*e Ta \(*e Ta epsilon .It \e(*z Ta \(*z Ta zeta .It \e(*y Ta \(*y Ta eta .It \e(*h Ta \(*h Ta theta .It \e(*i Ta \(*i Ta iota .It \e(*k Ta \(*k Ta kappa .It \e(*l Ta \(*l Ta lambda .It \e(*m Ta \(*m Ta mu .It \e(*n Ta \(*n Ta nu .It \e(*c Ta \(*c Ta xi .It \e(*o Ta \(*o Ta omicron .It \e(*p Ta \(*p Ta pi .It \e(*r Ta \(*r Ta rho .It \e(*s Ta \(*s Ta sigma .It \e(*t Ta \(*t Ta tau .It \e(*u Ta \(*u Ta upsilon .It \e(*f Ta \(*f Ta phi .It \e(*x Ta \(*x Ta chi .It \e(*q Ta \(*q Ta psi .It \e(*w Ta \(*w Ta omega .It \e(+h Ta \(+h Ta theta variant .It \e(+f Ta \(+f Ta phi variant .It \e(+p Ta \(+p Ta pi variant .It \e(+e Ta \(+e Ta epsilon variant .It \e(ts Ta \(ts Ta sigma terminal .El .Sh PREDEFINED STRINGS Predefined strings are inherited from the macro packages of historical troff implementations. They are .Em not recommended for use, as they differ across implementations. Manuals using these predefined strings are almost certainly not portable. .Pp Their syntax is similar to special characters, using .Sq \e*X .Pq for a one-character escape , .Sq \e*(XX .Pq two-character , and .Sq \e*[N] .Pq N-character . .Bl -column "Input" "Rendered" "Description" -offset indent .It Em Input Ta Em Rendered Ta Em Description .It \e*(Ba Ta \*(Ba Ta vertical bar .It \e*(Ne Ta \*(Ne Ta not equal .It \e*(Ge Ta \*(Ge Ta greater-than-equal .It \e*(Le Ta \*(Le Ta less-than-equal .It \e*(Gt Ta \*(Gt Ta greater-than .It \e*(Lt Ta \*(Lt Ta less-than .It \e*(Pm Ta \*(Pm Ta plus-minus .It \e*(If Ta \*(If Ta infinity .It \e*(Pi Ta \*(Pi Ta pi .It \e*(Na Ta \*(Na Ta NaN .It \e*(Am Ta \*(Am Ta ampersand .It \e*R Ta \*R Ta restricted mark .It \e*(Tm Ta \*(Tm Ta trade mark .It \e*q Ta \*q Ta double-quote .It \e*(Rq Ta \*(Rq Ta right-double-quote .It \e*(Lq Ta \*(Lq Ta left-double-quote .It \e*(lp Ta \*(lp Ta right-parenthesis .It \e*(rp Ta \*(rp Ta left-parenthesis .It \e*(lq Ta \*(lq Ta left double-quote .It \e*(rq Ta \*(rq Ta right double-quote .It \e*(ua Ta \*(ua Ta up arrow .It \e*(va Ta \*(va Ta up-down arrow .It \e*(<= Ta \*(<= Ta less-than-equal .It \e*(>= Ta \*(>= Ta greater-than-equal .It \e*(aa Ta \*(aa Ta acute .It \e*(ga Ta \*(ga Ta grave .It \e*(Px Ta \*(Px Ta POSIX standard name .It \e*(Ai Ta \*(Ai Ta ANSI standard name .El .Sh UNICODE CHARACTERS The escape sequences .Pp .Dl \e[uXXXX] and \eC\(aquXXXX\(aq .Pp are interpreted as Unicode codepoints. The codepoint must be in the range above U+0080 and less than U+10FFFF. For compatibility, the hexadecimal digits .Sq A to .Sq F must be given as uppercase characters, and points must be zero-padded to four characters; if greater than four characters, no zero padding is allowed. Unicode surrogates are not allowed. .Sh NUMBERED CHARACTERS For backward compatibility with existing manuals, .Xr mandoc 1 also supports the .Pp .Dl \eN\(aq Ns Ar number Ns \(aq and \e[ Ns Cm char Ns Ar number ] .Pp escape sequences, inserting the character .Ar number from the current character set into the output. Of course, this is inherently non-portable and is already marked as deprecated in the Heirloom roff manual; on top of that, the second form is a GNU extension. For example, do not use \eN\(aq34\(aq or \e[char34], use \e(dq, or even the plain .Sq \(dq character where possible. .Sh COMPATIBILITY This section documents compatibility between mandoc and other troff implementations, at this time limited to GNU troff .Pq Qq groff . .Pp .Bl -dash -compact .It The \eN\(aq\(aq escape sequence is limited to printable characters; in groff, it accepts arbitrary character numbers. .It In .Fl T Ns Cm ascii , the \e(ss, \e(nm, \e(nb, \e(nc, \e(ib, \e(ip, \e(pp, \e[sum], \e[product], \e[coproduct], \e(gr, \e(-h, and \e(a. special characters render differently between mandoc and groff. .It In .Fl T Ns Cm html , the \e(\(ti=, \e(nb, and \e(nc special characters render differently between mandoc and groff. .It The .Fl T Ns Cm ps and .Fl T Ns Cm pdf modes format like .Fl T Ns Cm ascii instead of rendering glyphs as in groff. .It The \e[radicalex], \e[sqrtex], and \e(ru special characters have been omitted from mandoc either because they are poorly documented or they have no known representation. .El .Sh SEE ALSO .Xr mandoc 1 , .Xr man 7 , .Xr mdoc 7 , .Xr roff 7 .Sh AUTHORS The .Nm manual page was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . .Sh CAVEATS The predefined string .Sq \e*(Ba mimics the behaviour of the .Sq \&| character in .Xr mdoc 7 ; thus, if you wish to render a vertical bar with no side effects, use the .Sq \e(ba escape. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc_escape.3�����������������������������������������������������������������������0100644�0001753�0001753�00000022516�14123140553�0016222�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mandoc_escape.3,v 1.4 2017/07/04 23:40:01 schwarze Exp $ .\" .\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: July 4 2017 $ .Dt MANDOC_ESCAPE 3 .Os .Sh NAME .Nm mandoc_escape .Nd parse roff escape sequences .Sh SYNOPSIS .In sys/types.h .In mandoc.h .Ft "enum mandoc_esc" .Fo mandoc_escape .Fa "const char **end" .Fa "const char **start" .Fa "int *sz" .Fc .Sh DESCRIPTION This function scans a .Xr roff 7 escape sequence. .Pp An escape sequence consists of .Bl -dash -compact -width 2n .It an initial backslash character .Pq Sq \e , .It a single ASCII character called the escape sequence identifier, .It and, with only a few exceptions, an argument. .El .Pp Arguments can be given in the following forms; some escape sequence identifiers only accept some of these forms as specified below. The first three forms are called the standard forms. .Bl -tag -width 2n .It \&In brackets: Ic \&[ Ns Ar argument Ns Ic \&] The argument starts after the initial .Sq \&[ , ends before the final .Sq \&] , and the escape sequence ends with the final .Sq \&] . .It Two-character argument short form: Ic \&( Ns Ar ar This form can only be used for arguments consisting of exactly two characters. It has the same effect as .Ic \&[ Ns Ar ar Ns Ic \&] . .It One-character argument short form: Ar a This form can only be used for arguments consisting of exactly one character. It has the same effect as .Ic \&[ Ns Ar a Ns Ic \&] . .It Delimited form: Ar C Ns Ar argument Ns Ar C The argument starts after the initial delimiter character .Ar C , ends before the next occurrence of the delimiter character .Ar C , and the escape sequence ends with that second .Ar C . Some escape sequences allow arbitrary characters .Ar C as quoting characters, some restrict the range of characters that can be used as quoting characters. .El .Pp Upon function entry, .Fa end is expected to point to the escape sequence identifier. The values passed in as .Fa start and .Fa sz are ignored and overwritten. .Pp By design, this function cannot handle those .Xr roff 7 escape sequences that require in-place expansion, in particular user-defined strings .Ic \e* , number registers .Ic \en , width measurements .Ic \ew , and numerical expression control .Ic \eB . These are handled by .Fn roff_res , a private preprocessor function called from .Fn roff_parseln , see the file .Pa roff.c . .Pp The function .Fn mandoc_escape is used .Bl -dash -compact -width 2n .It recursively by itself, because some escape sequence arguments can in turn contain other escape sequences, .It for error detection internally by the .Xr roff 7 parser part of the .Xr mandoc 3 library, see the file .Pa roff.c , .It above all externally by the .Xr mandoc 1 formatting modules, in particular .Fl Tascii and .Fl Thtml , for formatting purposes, see the files .Pa term.c and .Pa html.c , .It and rarely externally by high-level utilities using the mandoc library, for example .Xr makewhatis 8 , to purge escape sequences from text. .El .Sh RETURN VALUES Upon function return, the pointer .Fa end is set to the character after the end of the escape sequence, such that the calling higher-level parser can easily continue. .Pp For escape sequences taking an argument, the pointer .Fa start is set to the beginning of the argument and .Fa sz is set to the length of the argument. For escape sequences not taking an argument, .Fa start is set to the character after the end of the sequence and .Fa sz is set to 0. Both .Fa start and .Fa sz may be .Dv NULL ; in that case, the argument and the length are not returned. .Pp For sequences taking an argument, the function .Fn mandoc_escape returns one of the following values: .Bl -tag -width 2n .It Dv ESCAPE_FONT The escape sequence .Ic \ef taking an argument in standard form: .Ic \ef[ , \ef( , \ef Ns Ar a . Two-character arguments starting with the character .Sq C are reduced to one-character arguments by skipping the .Sq C . More specific values are returned for the most commonly used arguments: .Bl -column "argument" "ESCAPE_FONTITALIC" .It argument Ta return value .It Cm R No or Cm 1 Ta Dv ESCAPE_FONTROMAN .It Cm I No or Cm 2 Ta Dv ESCAPE_FONTITALIC .It Cm B No or Cm 3 Ta Dv ESCAPE_FONTBOLD .It Cm P Ta Dv ESCAPE_FONTPREV .It Cm BI Ta Dv ESCAPE_FONTBI .El .It Dv ESCAPE_SPECIAL The escape sequence .Ic \eC taking an argument delimited with the single quote character and, as a special exception, the escape sequences .Em not having an identifier, that is, those where the argument, in standard form, directly follows the initial backslash: .Ic \eC' , \e[ , \e( , \e Ns Ar a . Note that the one-character argument short form can only be used for argument characters that do not clash with escape sequence identifiers. .Pp If the argument matches one of the forms described below under .Dv ESCAPE_UNICODE , that value is returned instead. .Pp The .Dv ESCAPE_SPECIAL special character escape sequences can be rendered using the functions .Fn mchars_spec2cp and .Fn mchars_spec2str described in the .Xr mchars_alloc 3 manual. .It Dv ESCAPE_UNICODE Escape sequences of the same format as described above under .Dv ESCAPE_SPECIAL , but with an argument of the forms .Ic u Ns Ar XXXX , .Ic u Ns Ar YXXXX , or .Ic u10 Ns Ar XXXX where .Ar X and .Ar Y are hexadecimal digits and .Ar Y is not zero: .Ic \eC'u , \e[u . As a special exception, .Fa start is set to the character after the .Ic u , and the .Fa sz return value does not include the .Ic u either. .Pp Such Unicode character escape sequences can be rendered using the function .Fn mchars_num2uc described in the .Xr mchars_alloc 3 manual. .It Dv ESCAPE_NUMBERED The escape sequence .Ic \eN followed by a delimited argument. The delimiter character is arbitrary except that digits cannot be used. If a digit is encountered instead of the opening delimiter, that digit is considered to be the argument and the end of the sequence, and .Dv ESCAPE_IGNORE is returned. .Pp Such ASCII character escape sequences can be rendered using the function .Fn mchars_num2char described in the .Xr mchars_alloc 3 manual. .It Dv ESCAPE_OVERSTRIKE The escape sequence .Ic \eo followed by an argument delimited by an arbitrary character. .It Dv ESCAPE_IGNORE .Bl -bullet -width 2n .It The escape sequence .Ic \es followed by an argument in standard form or by an argument delimited by the single quote character: .Ic \es' , \es[ , \es( , \es Ns Ar a . As a special exception, an optional .Sq + or .Sq \- character is allowed after the .Sq s for all forms. .It The escape sequences .Ic \eF , .Ic \eg , .Ic \ek , .Ic \eM , .Ic \em , .Ic \en , .Ic \eV , and .Ic \eY followed by an argument in standard form. .It The escape sequences .Ic \eA , .Ic \eb , .Ic \eD , .Ic \eR , .Ic \eX , and .Ic \eZ followed by an argument delimited by an arbitrary character. .It The escape sequences .Ic \eH , .Ic \eh , .Ic \eL , .Ic \el , .Ic \eS , .Ic \ev , and .Ic \ex followed by an argument delimited by a character that cannot occur in numerical expressions. However, if any character that can occur in numerical expressions is found instead of a delimiter, the sequence is considered to end with that character, and .Dv ESCAPE_ERROR is returned. .El .It Dv ESCAPE_ERROR Escape sequences taking an argument but not matching any of the above patterns. In particular, that happens if the end of the logical input line is reached before the end of the argument. .El .Pp For sequences that do not take an argument, the function .Fn mandoc_escape returns one of the following values: .Bl -tag -width 2n .It Dv ESCAPE_SKIPCHAR The escape sequence .Qq \ez . .It Dv ESCAPE_NOSPACE The escape sequence .Qq \ec . .It Dv ESCAPE_IGNORE The escape sequences .Qq \ed and .Qq \eu . .El .Sh FILES This function is implemented in .Pa mandoc.c . .Sh SEE ALSO .Xr mchars_alloc 3 , .Xr mandoc_char 7 , .Xr roff 7 .Sh HISTORY This function has been available since mandoc 1.11.2. .Sh AUTHORS .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .An Ingo Schwarze Aq Mt schwarze@openbsd.org .Sh BUGS The function doesn't cleanly distinguish between sequences that are valid and supported, valid and ignored, valid and unsupported, syntactically invalid, or undefined. For sequences that are ignored or unsupported, it doesn't tell whether that deficiency is likely to cause major formatting problems and/or loss of document content. The function is already rather complicated and still parses some sequences incorrectly. . .ig For these sequences, the list given below specifies a starting string and either the length of the argument or an ending character. The argument starts after the starting string. In the former case, the sequence ends with the end of the argument. In the latter case, the argument ends before the ending character, and the sequence ends with the ending character. .. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc_headers.3����������������������������������������������������������������������0100644�0001753�0001753�00000032132�14123140553�0016370�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mandoc_headers.3,v 1.34 2021/08/10 12:55:03 schwarze Exp $ .\" .\" Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: August 10 2021 $ .Dt MANDOC_HEADERS 3 .Os .Sh NAME .Nm mandoc_headers .Nd ordering of mandoc include files .Sh DESCRIPTION To support a cleaner coding style, the mandoc header files do not contain any include directives and do not guard against multiple inclusion. The application developer has to make sure that the headers are included in a proper order, and that no header is included more than once. .Pp The headers and functions form three major groups: .Sx Parser interface , .Sx Parser internals , and .Sx Formatter interface . .Pp Various rules are given below prohibiting the inclusion of certain combinations of headers into the same file. The intention is to keep the following functional components separate from each other: .Pp .Bl -dash -offset indent -compact .It .Xr roff 7 parser .It .Xr mdoc 7 parser .It .Xr man 7 parser .It .Xr tbl 7 parser .It .Xr eqn 7 parser .It terminal formatters .It HTML formatters .It search tools .It main programs .El .Pp Note that mere usage of an opaque struct type does .Em not require inclusion of the header where that type is defined. .Ss Parser interface Each of the following headers can be included without including any other mandoc header. These headers should be included before any other mandoc headers. .Bl -tag -width Ds .It Qq Pa mandoc_aux.h Memory allocation utility functions; can be used everywhere. .Pp Requires .In sys/types.h for .Vt size_t . .Pp Provides the functions documented in .Xr mandoc_malloc 3 . .It Qq Pa mandoc_ohash.h Hashing utility functions; can be used everywhere. .Pp Requires .In stddef.h for .Vt ptrdiff_t and .In stdint.h for .Vt uint32_t . .Pp Includes .In ohash.h and provides .Fn mandoc_ohash_init . .It Qq Pa mandoc.h Error handling, escape sequence, and character utilities; can be used everywhere. .Pp Requires .In sys/types.h for .Vt size_t and .In stdio.h for .Vt FILE . .Pp Provides .Vt enum mandoc_esc , .Vt enum mandocerr , .Vt enum mandoclevel , the function .Xr mandoc_escape 3 , the functions described in .Xr mchars_alloc 3 , and the .Fn mandoc_msg* functions. .It Qq Pa roff.h Common data types for all syntax trees and related functions; can be used everywhere. .Pp Provides .Vt enum mandoc_os , .Vt enum mdoc_endbody , .Vt enum roff_macroset , .Vt enum roff_sec , .Vt enum roff_tok , .Vt enum roff_type , .Vt struct roff_man , .Vt struct roff_meta , .Vt struct roff_node , the constant array .Va roff_name and the function .Fn deroff . .Pp Uses pointers to the types .Vt struct ohash from .Qq Pa mandoc_ohash.h , .Vt struct mdoc_arg and .Vt union mdoc_data from .Qq Pa mdoc.h , .Vt struct tbl_span from .Qq Pa tbl.h , and .Vt struct eqn_box from .Qq Pa eqn.h as opaque struct members. .It Qq Pa tbl.h Data structures for the .Xr tbl 7 parse tree; can be used everywhere. .Pp Requires .In sys/types.h for .Vt size_t and .Qq Pa mandoc.h for .Vt enum mandoc_esc . .Pp Provides .Vt enum tbl_cellt , .Vt enum tbl_datt , .Vt enum tbl_spant , .Vt struct tbl_opts , .Vt struct tbl_cell , .Vt struct tbl_row , .Vt struct tbl_dat , and .Vt struct tbl_span . .It Qq Pa eqn.h Data structures for the .Xr eqn 7 parse tree; can be used everywhere. .Pp Requires .In sys/types.h for .Vt size_t . .Pp Provides .Vt enum eqn_boxt , .Vt enum eqn_fontt , .Vt enum eqn_post , and .Vt struct eqn_box . .It Qq Pa mandoc_parse.h Top level parser interface, for use in the main program and in the main parser, but not in formatters. .Pp Requires .Qq Pa mandoc.h for .Vt enum mandocerr and .Vt enum mandoclevel and .Qq Pa roff.h for .Vt enum mandoc_os . .Pp Uses the opaque type .Vt struct mparse from .Pa read.c for function prototypes. Uses .Vt struct roff_meta from .Qq Pa roff.h as an opaque type for function prototypes. .It Qq Pa mandoc_xr.h Cross reference validation; intended for use in the main program and in parsers, but not in formatters. .Pp Provides .Vt struct mandoc_xr and the functions .Fn mandoc_xr_reset , .Fn mandoc_xr_add , .Fn mandoc_xr_get , and .Fn mandoc_xr_free . .It Qq Pa tag.h Internal interfaces to tag syntax tree nodes, for use by validation modules only. .Pp Requires .In limits.h for .Dv INT_MAX . .Pp Provides the functions .Fn tag_alloc , .Fn tag_put , .Fn tag_check , and .Fn tag_free and some .Dv TAG_* constants. .Pp Uses the type .Vt struct roff_node from .Qq Pa roff.h as an opaque type for function prototypes. .El .Pp The following two require .Qq Pa roff.h but no other mandoc headers. Afterwards, any other mandoc headers can be included as needed. .Bl -tag -width Ds .It Qq Pa mdoc.h Requires .In sys/types.h for .Vt size_t . .Pp Provides .Vt enum mdocargt , .Vt enum mdoc_auth , .Vt enum mdoc_disp , .Vt enum mdoc_font , .Vt enum mdoc_list , .Vt struct mdoc_argv , .Vt struct mdoc_arg , .Vt struct mdoc_an , .Vt struct mdoc_bd , .Vt struct mdoc_bf , .Vt struct mdoc_bl , .Vt struct mdoc_rs , .Vt union mdoc_data , and the functions .Fn mdoc_* described in .Xr mandoc 3 . .Pp Uses the types .Vt struct roff_node from .Qq Pa roff.h and .Vt struct roff_man from .Qq Pa roff_int.h as opaque types for function prototypes. .Pp When this header is included, the same file should not include internals of different parsers. .It Qq Pa man.h Provides the functions .Fn man_* described in .Xr mandoc 3 . .Pp Uses the type .Vt struct roff_man from .Qq Pa roff.h as an opaque type for function prototypes. .Pp When this header is included, the same file should not include internals of different parsers. .El .Ss Parser internals Most of the following headers require inclusion of a parser interface header before they can be included. All parser interface headers should precede all parser internal headers. When any parser internal headers are included, the same file should not include any formatter headers. .Bl -tag -width Ds .It Qq Pa libmandoc.h Requires .In sys/types.h for .Vt size_t and .Qq Pa mandoc.h for .Vt enum mandocerr . .Pp Provides .Vt struct buf , utility functions needed by multiple parsers, and the top-level functions to call the parsers. .Pp Uses the opaque type .Vt struct roff from .Pa roff.c for function prototypes. Uses the type .Vt struct roff_man from .Qq Pa roff.h as an opaque type for function prototypes. .It Qq Pa roff_int.h Parser internals shared by multiple parsers. Can be used in all parsers, but not in main programs or formatters. .Pp Requires .Qq Pa roff.h for .Vt enum roff_type and .Vt enum roff_tok . .Pp Provides .Vt enum roff_next , .Vt struct roff_man , functions named .Fn roff_* to handle roff nodes, .Fn roffhash_alloc , .Fn roffhash_find , .Fn roffhash_free , and .Fn roff_validate , and the two special functions .Fn man_breakscope and .Fn mdoc_argv_free because the latter two are needed by .Pa roff.c . .Pp Uses the types .Vt struct ohash from .Qq Pa mandoc_ohash.h , .Vt struct roff_node and .Vt struct roff_meta from .Qq Pa roff.h , .Vt struct roff from .Pa roff.c , and .Vt struct mdoc_arg from .Qq Pa mdoc.h as opaque types for function prototypes. .It Qq Pa libmdoc.h Requires .Qq Pa roff.h for .Vt enum roff_tok and .Vt enum roff_sec . .Pp Provides .Vt enum margserr , .Vt enum mdelim , .Vt struct mdoc_macro , and many functions internal to the .Xr mdoc 7 parser. .Pp Uses the types .Vt struct roff_node from .Qq Pa roff.h , .Vt struct roff_man from .Qq Pa roff_int.h , and .Vt struct mdoc_arg from .Qq Pa mdoc.h as opaque types for function prototypes. .Pp When this header is included, the same file should not include interfaces of different parsers. .It Qq Pa libman.h Requires .Qq Pa roff.h for .Vt enum roff_tok . .Pp Provides .Vt struct man_macro and some functions internal to the .Xr man 7 parser. .Pp Uses the types .Vt struct roff_node from .Qq Pa roff.h and .Vt struct roff_man from .Qq Pa roff_int.h as opaque types for function prototypes. .Pp When this header is included, the same file should not include interfaces of different parsers. .It Qq Pa eqn_parse.h External interface of the .Xr eqn 7 parser, for use in the .Xr roff 7 and .Xr eqn 7 parsers only. .Pp Requires .In sys/types.h for .Vt size_t . .Pp Provides .Vt struct eqn_node and the functions .Fn eqn_alloc , .Fn eqn_box_new , .Fn eqn_box_free , .Fn eqn_free , .Fn eqn_parse , .Fn eqn_read , and .Fn eqn_reset . .Pp Uses the type .Vt struct eqn_box from .Qq Pa mandoc.h as an opaque type for function prototypes. Uses the types .Vt struct roff_node from .Qq Pa roff.h and .Vt struct eqn_def from .Pa eqn.c as opaque struct members. .Pp When this header is included, the same file should not include internals of different parsers. .It Qq Pa tbl_parse.h External interface of the .Xr tbl 7 parser, for use in the .Xr roff 7 and .Xr tbl 7 parsers only. .Pp Provides the functions documented in .Xr tbl 3 . .Pp Uses the types .Vt struct tbl_span from .Qq Pa tbl.h and .Vt struct tbl_node from .Qq Pa tbl_int.h as opaque types for function prototypes. .Pp When this header is included, the same file should not include internals of different parsers. .It Qq Pa tbl_int.h Internal interfaces of the .Xr tbl 7 parser, for use inside the .Xr tbl 7 parser only. .Pp Requires .Qq Pa tbl.h for .Vt struct tbl_opts . .Pp Provides .Vt enum tbl_part , .Vt struct tbl_node , and the functions .Fn tbl_option , .Fn tbl_layout , .Fn tbl_data , .Fn tbl_cdata , and .Fn tbl_reset . .Pp When this header is included, the same file should not include interfaces of different parsers. .El .Ss Formatter interface These headers should be included after any parser interface headers. No parser internal headers should be included by the same file. .Bl -tag -width Ds .It Qq Pa out.h Requires .In sys/types.h for .Vt size_t . .Pp Provides .Vt enum roffscale , .Vt struct roffcol , .Vt struct roffsu , .Vt struct rofftbl , .Fn a2roffsu , and .Fn tblcalc . .Pp Uses .Vt struct tbl_span from .Qq Pa mandoc.h as an opaque type for function prototypes. .Pp When this header is included, the same file should not include .Qq Pa mansearch.h . .It Qq Pa term.h Requires .In sys/types.h for .Vt size_t and .Qq Pa out.h for .Vt struct roffsu and .Vt struct rofftbl . .Pp Provides .Vt enum termenc , .Vt enum termfont , .Vt enum termtype , .Vt struct termp_tbl , .Vt struct termp , .Fn roff_term_pre , and many terminal formatting functions. .Pp Uses the opaque type .Vt struct termp_ps from .Pa term_ps.c . Uses .Vt struct tbl_span and .Vt struct eqn_box from .Qq Pa mandoc.h and .Vt struct roff_meta and .Vt struct roff_node from .Qq Pa roff.h as opaque types for function prototypes. .Pp When this header is included, the same file should not include .Qq Pa html.h or .Qq Pa mansearch.h . .It Qq Pa tag_term.h Requires .In sys/types.h for .Vt size_t and .In stdio.h for .Vt FILE . .Pp Provides an interface to generate .Xr ctags 1 files for the .Ic :t functionality mentioned in .Xr man 1 . .Pp Uses the type .Vt struct roff_node from .Qq Pa roff.h as an opaque type for function prototypes. .Pp When this header is included, the same file should not include .Qq Pa html.h or .Qq Pa mansearch.h . .It Qq Pa html.h Requires .In sys/types.h for .Vt size_t , .Qq Pa mandoc.h for .Vt enum mandoc_esc , .Qq Pa roff.h for .Vt enum roff_tok , and .Qq Pa out.h for .Vt struct roffsu and .Vt struct rofftbl . .Pp Provides .Vt enum htmltag , .Vt enum htmlattr , .Vt enum htmlfont , .Vt struct tag , .Vt struct tagq , .Vt struct htmlpair , .Vt struct html , .Fn roff_html_pre , and many HTML formatting functions. .Pp Uses .Vt struct tbl_span and .Vt struct eqn_box from .Qq Pa mandoc.h and .Vt struct roff_node from .Qq Pa roff.h as opaque types for function prototypes. .Pp When this header is included, the same file should not include .Qq Pa term.h , .Qq Pa tab_term.h , or .Qq Pa mansearch.h . .It Qq Pa main.h Provides the top level steering functions for all formatters. .Pp Uses the type .Vt struct roff_meta from .Qq Pa roff.h as an opaque type for function prototypes. .It Qq Pa manconf.h Requires .In sys/types.h for .Vt size_t . .Pp Provides .Vt struct manconf , .Vt struct manpaths , .Vt struct manoutput , and the functions .Fn manconf_parse , .Fn manconf_output , .Fn manconf_free , and .Fn manpath_base . .It Qq Pa mansearch.h Requires .In sys/types.h for .Vt size_t and .In stdint.h for .Vt uint64_t . .Pp Provides .Vt enum argmode , .Vt struct manpage , .Vt struct mansearch , and the functions .Fn mansearch and .Fn mansearch_free . .Pp Uses .Vt struct manpaths from .Qq Pa manconf.h as an opaque type for function prototypes. .Pp When this header is included, the same file should not include .Qq Pa out.h , .Qq Pa term.h , .Qq Pa tab_term.h , or .Qq Pa html.h . .El ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc_html.3�������������������������������������������������������������������������0100644�0001753�0001753�00000027324�14123140553�0015730�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mandoc_html.3,v 1.23 2020/04/24 13:13:06 schwarze Exp $ .\" .\" Copyright (c) 2014, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: April 24 2020 $ .Dt MANDOC_HTML 3 .Os .Sh NAME .Nm mandoc_html .Nd internals of the mandoc HTML formatter .Sh SYNOPSIS .In sys/types.h .Fd #include """mandoc.h""" .Fd #include """roff.h""" .Fd #include """out.h""" .Fd #include """html.h""" .Ft void .Fn print_gen_decls "struct html *h" .Ft void .Fn print_gen_comment "struct html *h" "struct roff_node *n" .Ft void .Fn print_gen_head "struct html *h" .Ft struct tag * .Fo print_otag .Fa "struct html *h" .Fa "enum htmltag tag" .Fa "const char *fmt" .Fa ... .Fc .Ft void .Fo print_tagq .Fa "struct html *h" .Fa "const struct tag *until" .Fc .Ft void .Fo print_stagq .Fa "struct html *h" .Fa "const struct tag *suntil" .Fc .Ft void .Fn html_close_paragraph "struct html *h" .Ft enum roff_tok .Fo html_fillmode .Fa "struct html *h" .Fa "enum roff_tok tok" .Fc .Ft int .Fo html_setfont .Fa "struct html *h" .Fa "enum mandoc_esc font" .Fc .Ft void .Fo print_text .Fa "struct html *h" .Fa "const char *word" .Fc .Ft void .Fo print_tagged_text .Fa "struct html *h" .Fa "const char *word" .Fa "struct roff_node *n" .Fc .Ft char * .Fo html_make_id .Fa "const struct roff_node *n" .Fa "int unique" .Fc .Ft struct tag * .Fo print_otag_id .Fa "struct html *h" .Fa "enum htmltag tag" .Fa "const char *cattr" .Fa "struct roff_node *n" .Fc .Ft void .Fn print_endline "struct html *h" .Sh DESCRIPTION The mandoc HTML formatter is not a formal library. However, as it is compiled into more than one program, in particular .Xr mandoc 1 and .Xr man.cgi 8 , and because it may be security-critical in some contexts, some documentation is useful to help to use it correctly and to prevent XSS vulnerabilities. .Pp The formatter produces HTML output on the standard output. Since proper escaping is usually required and best taken care of at one central place, the language-specific formatters .Po .Pa *_html.c , see .Sx FILES .Pc are not supposed to print directly to .Dv stdout using functions like .Xr printf 3 , .Xr putc 3 , .Xr puts 3 , or .Xr write 2 . Instead, they are expected to use the output functions declared in .Pa html.h and implemented as part of the main HTML formatting engine in .Pa html.c . .Ss Data structures These structures are declared in .Pa html.h . .Bl -tag -width Ds .It Vt struct html Internal state of the HTML formatter. .It Vt struct tag One entry for the LIFO stack of HTML elements. Members include .Fa "enum htmltag tag" and .Fa "struct tag *next" . .El .Ss Private interface functions The function .Fn print_gen_decls prints the opening .Aq Pf \&! Ic DOCTYPE declaration. .Pp The function .Fn print_gen_comment prints the leading comments, usually containing a Copyright notice and license, as an HTML comment. It is intended to be called right after opening the .Aq Ic HTML element. Pass the first .Dv ROFFT_COMMENT node in .Fa n . .Pp The function .Fn print_gen_head prints the opening .Aq Ic META and .Aq Ic LINK elements for the document .Aq Ic HEAD , using the .Fa style member of .Fa h unless that is .Dv NULL . It uses .Fn print_otag which takes care of properly encoding attributes, which is relevant for the .Fa style link in particular. .Pp The function .Fn print_otag prints the start tag of an HTML element with the name .Fa tag , optionally including the attributes specified by .Fa fmt . If .Fa fmt is the empty string, no attributes are written. Each letter of .Fa fmt specifies one attribute to write. Most attributes require one .Va char * argument which becomes the value of the attribute. The arguments have to be given in the same order as the attribute letters. If an argument is .Dv NULL , the respective attribute is not written. .Bl -tag -width 1n -offset indent .It Cm c Print a .Cm class attribute. .It Cm h Print a .Cm href attribute. This attribute letter can optionally be followed by a modifier letter. If followed by .Cm R , it formats the link as a local one by prefixing a .Sq # character. If followed by .Cm I , it interpretes the argument as a header file name and generates a link using the .Xr mandoc 1 .Fl O Cm includes option. If followed by .Cm M , it takes two arguments instead of one, a manual page name and section, and formats them as a link to a manual page using the .Xr mandoc 1 .Fl O Cm man option. .It Cm i Print an .Cm id attribute. .It Cm \&? Print an arbitrary attribute. This format letter requires two .Vt char * arguments, the attribute name and the value. The name must not be .Dv NULL . .It Cm s Print a .Cm style attribute. If present, it must be the last format letter. It requires two .Va char * arguments. The first is the name of the style property, the second its value. The name must not be .Dv NULL . The .Cm s .Ar fmt letter can be repeated, each repetition requiring an additional pair of .Va char * arguments. .El .Pp .Fn print_otag uses the private function .Fn print_encode to take care of HTML encoding. If required by the element type, it remembers in .Fa h that the element is open. The function .Fn print_tagq is used to close out all open elements up to and including .Fa until ; .Fn print_stagq is a variant to close out all open elements up to but excluding .Fa suntil . The function .Fn html_close_paragraph closes all open elements that establish phrasing context, thus returning to the innermost flow context. .Pp The function .Fn html_fillmode switches to fill mode if .Fa want is .Dv ROFF_fi or to no-fill mode if .Fa want is .Dv ROFF_nf . Switching from fill mode to no-fill mode closes the current paragraph and opens a .Aq Ic PRE element. Switching in the opposite direction closes the .Aq Ic PRE element, but does not open a new paragraph. If .Fa want matches the mode that is already active, no elements are closed nor opened. If .Fa want is .Dv TOKEN_NONE , the mode remains as it is. .Pp The function .Fn html_setfont selects the .Fa font , which can be .Dv ESCAPE_FONTROMAN , .Dv ESCAPE_FONTBOLD , .Dv ESCAPE_FONTITALIC , .Dv ESCAPE_FONTBI , or .Dv ESCAPE_FONTCW , for future text output and internally remembers the font that was active before the change. If the .Fa font argument is .Dv ESCAPE_FONTPREV , the current and the previous font are exchanged. This function only changes the internal state of the .Fa h object; no HTML elements are written yet. Subsequent text output will write font elements when needed. .Pp The function .Fn print_text prints HTML element content. It uses the private function .Fn print_encode to take care of HTML encoding. If the document has requested a non-standard font, for example using a .Xr roff 7 .Ic \ef font escape sequence, .Fn print_text wraps .Fa word in an HTML font selection element using the .Fn print_otag and .Fn print_tagq functions. .Pp The function .Fn print_tagged_text is a variant of .Fn print_text that wraps .Fa word in an .Aq Ic A element of class .Qq permalink if .Fa n is not .Dv NULL and yields a segment identifier when passed to .Fn html_make_id . .Pp The function .Fn html_make_id allocates a string to be used for the .Cm id attribute of an HTML element and/or as a segment identifier for a URI in an .Aq Ic A element. If .Fa n contains a .Fa tag attribute, it is used; otherwise, child nodes are used. If .Fa n is an .Ic \&Sh , .Ic \&Ss , .Ic \&Sx , .Ic SH , or .Ic SS node, the resulting string is the concatenation of the child strings; for other node types, only the first child is used. Bytes not permitted in URI-fragment strings are replaced by underscores. If any of the children to be used is not a text node, no string is generated and .Dv NULL is returned instead. If the .Fa unique argument is non-zero, deduplication is performed by appending an underscore and a decimal integer, if necessary. If the .Fa unique argument is 1, this is assumed to be the first call for this tag at this location, typically for use by .Dv NODE_ID , so the integer is incremented before use. If the .Fa unique argument is 2, this is ssumed to be the second call for this tag at this location, typically for use by .Dv NODE_HREF , so the existing integer, if any, is used without incrementing it. .Pp The function .Fn print_otag_id opens a .Fa tag element of class .Fa cattr for the node .Fa n . If the flag .Dv NODE_ID is set in .Fa n , it attempts to generate an .Cm id attribute with .Fn html_make_id . If the flag .Dv NODE_HREF is set in .Fa n , an .Aq Ic A element of class .Qq permalink is added: outside if .Fa n generates an element that can only occur in phrasing context, or inside otherwise. This function is a wrapper around .Fn html_make_id and .Fn print_otag , automatically chosing the .Fa unique argument appropriately and setting the .Fa fmt arguments to .Qq chR and .Qq ci , respectively. .Pp The function .Fn print_endline makes sure subsequent output starts on a new HTML output line. If nothing was printed on the current output line yet, it has no effect. Otherwise, it appends any buffered text to the current output line, ends the line, and updates the internal state of the .Fa h object. .Pp The functions .Fn print_eqn , .Fn print_tbl , and .Fn print_tblclose are not yet documented. .Sh RETURN VALUES The functions .Fn print_otag and .Fn print_otag_id return a pointer to a new element on the stack of HTML elements. When .Fn print_otag_id opens two elements, a pointer to the outer one is returned. The memory pointed to is owned by the library and is automatically .Xr free 3 Ns d when .Fn print_tagq is called on it or when .Fn print_stagq is called on a parent element. .Pp The function .Fn html_fillmode returns .Dv ROFF_fi if fill mode was active before the call or .Dv ROFF_nf otherwise. .Pp The function .Fn html_make_id returns a newly allocated string or .Dv NULL if .Fa n lacks text data to create the attribute from. The caller is responsible for .Xr free 3 Ns ing the returned string after using it. .Pp In case of .Xr malloc 3 failure, these functions do not return but call .Xr err 3 . .Sh FILES .Bl -tag -width mandoc_aux.c -compact .It Pa main.h declarations of public functions for use by the main program, not yet documented .It Pa html.h declarations of data types and private functions for use by language-specific HTML formatters .It Pa html.c main HTML formatting engine and utility functions .It Pa mdoc_html.c .Xr mdoc 7 HTML formatter .It Pa man_html.c .Xr man 7 HTML formatter .It Pa tbl_html.c .Xr tbl 7 HTML formatter .It Pa eqn_html.c .Xr eqn 7 HTML formatter .It Pa roff_html.c .Xr roff 7 HTML formatter, handling requests like .Ic br , .Ic ce , .Ic fi , .Ic ft , .Ic nf , .Ic rj , and .Ic sp . .It Pa out.h declarations of data types and private functions for shared use by all mandoc formatters, not yet documented .It Pa out.c private functions for shared use by all mandoc formatters .It Pa mandoc_aux.h declarations of common mandoc utility functions, see .Xr mandoc 3 .It Pa mandoc_aux.c implementation of common mandoc utility functions .El .Sh SEE ALSO .Xr mandoc 1 , .Xr mandoc 3 , .Xr man.cgi 8 .Sh AUTHORS .An -nosplit The mandoc HTML formatter was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . It is maintained by .An Ingo Schwarze Aq Mt schwarze@openbsd.org , who also wrote this manual. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc_malloc.3�����������������������������������������������������������������������0100644�0001753�0001753�00000011512�14123140553�0016223�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mandoc_malloc.3,v 1.3 2021/09/17 18:50:21 schwarze Exp $ .\" .\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: September 17 2021 $ .Dt MANDOC_MALLOC 3 .Os .Sh NAME .Nm mandoc_malloc , .Nm mandoc_realloc , .Nm mandoc_reallocarray , .Nm mandoc_calloc , .Nm mandoc_recallocarray , .Nm mandoc_strdup , .Nm mandoc_strndup , .Nm mandoc_asprintf .Nd memory allocation function wrappers used in the mandoc library .Sh SYNOPSIS .In sys/types.h .In mandoc_aux.h .Ft "void *" .Fo mandoc_malloc .Fa "size_t size" .Fc .Ft "void *" .Fo mandoc_realloc .Fa "void *ptr" .Fa "size_t size" .Fc .Ft "void *" .Fo mandoc_reallocarray .Fa "void *ptr" .Fa "size_t nmemb" .Fa "size_t size" .Fc .Ft "void *" .Fo mandoc_calloc .Fa "size_t nmemb" .Fa "size_t size" .Fc .Ft "void *" .Fo mandoc_recallocarray .Fa "void *ptr" .Fa "size_t oldnmemb" .Fa "size_t nmemb" .Fa "size_t size" .Fc .Ft "char *" .Fo mandoc_strdup .Fa "const char *s" .Fc .Ft "char *" .Fo mandoc_strndup .Fa "const char *s" .Fa "size_t maxlen" .Fc .Ft int .Fo mandoc_asprintf .Fa "char **ret" .Fa "const char *format" .Fa "..." .Fc .Sh DESCRIPTION These functions call the libc functions of the same names, passing through their return values when successful. In case of failure, they do not return, but instead call .Xr err 3 . They can be used both internally by any code in the mandoc libraries and externally by programs using that library, for example .Xr mandoc 1 , .Xr man 1 , .Xr apropos 1 , .Xr makewhatis 8 , and .Xr man.cgi 8 . .Pp The function .Fn mandoc_malloc allocates one new object, leaving the memory uninitialized. The functions .Fn mandoc_realloc , .Fn mandoc_reallocarray , and .Fn mandoc_recallocarray change the size of an existing object or array, possibly moving it. When shrinking the size, existing data is truncated; when growing, only .Fn mandoc_recallocarray initializes the new elements to zero. The function .Fn mandoc_calloc allocates a new array, initializing it to zero. .Pp The argument .Fa size is the size of each object. The argument .Fa nmemb is the new number of objects in the array. The argument .Fa oldnmemb is the number of objects in the array before the call. The argument .Fa ptr is a pointer to the existing object or array to be resized; if it is .Dv NULL , a new object or array is allocated. .Pp The functions .Fn mandoc_strdup and .Fn mandoc_strndup copy a string into newly allocated memory. For .Fn mandoc_strdup , the string pointed to by .Fa s needs to be NUL-terminated. For .Fn mandoc_strndup , at most .Fa maxlen bytes are copied. The function .Fn mandoc_asprintf writes output formatted according to .Fa format into newly allocated memory and returns a pointer to the result in .Fa ret . For all three string functions, the result is always NUL-terminated. .Pp When the objects and strings are no longer needed, the pointers returned by these functions can be passed to .Xr free 3 . .Sh RETURN VALUES The function .Fn mandoc_asprintf always returns the number of characters written, excluding the final NUL byte. It never returns -1. .Pp The other functions always return a valid pointer; they never return .Dv NULL . .Sh FILES These functions are implemented in .Pa mandoc_aux.c . .Sh SEE ALSO .Xr asprintf 3 , .Xr err 3 , .Xr malloc 3 , .Xr strdup 3 .Sh STANDARDS The functions .Fn malloc , .Fn realloc , and .Fn calloc are required by .St -ansiC . The functions .Fn strdup and .Fn strndup are required by .St -p1003.1-2008 . The function .Fn asprintf is a widespread extension that first appeared in the GNU C library. .Pp The function .Fn reallocarray is an extension that first appeared in .Ox 5.6 , and .Fn recallocarray in .Ox 6.1 . If these two are not provided by the operating system, the mandoc build system uses bundled portable implementations. .Sh HISTORY The functions .Fn mandoc_malloc , .Fn mandoc_realloc , .Fn mandoc_calloc , and .Fn mandoc_strdup have been available since mandoc 1.9.12, .Fn mandoc_strndup since 1.11.5, .Fn mandoc_asprintf since 1.12.4, .Fn mandoc_reallocarray since 1.13.0, and .Fn mandoc_recallocarray since 1.14.2. .Sh AUTHORS .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .An Ingo Schwarze Aq Mt schwarze@openbsd.org ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc_ohash.h������������������������������������������������������������������������0100644�0001753�0001753�00000001754�14123140553�0016152�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: mandoc_ohash.h,v 1.2 2015/11/07 14:01:16 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #if HAVE_OHASH #include <ohash.h> #else #include "compat_ohash.h" #endif void mandoc_ohash_init(struct ohash *, unsigned int, ptrdiff_t); ��������������������mandoc-1.14.6/mandoc_parse.h������������������������������������������������������������������������0100644�0001753�0001753�00000003606�14123140553�0016160�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: mandoc_parse.h,v 1.5 2019/11/09 14:39:49 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Top level parser interface. For use in the main program * and in the main parser, but not in formatters. */ /* * Parse options. */ #define MPARSE_MDOC (1 << 0) /* assume -mdoc */ #define MPARSE_MAN (1 << 1) /* assume -man */ #define MPARSE_SO (1 << 2) /* honour .so requests */ #define MPARSE_QUICK (1 << 3) /* abort the parse early */ #define MPARSE_UTF8 (1 << 4) /* accept UTF-8 input */ #define MPARSE_LATIN1 (1 << 5) /* accept ISO-LATIN-1 input */ #define MPARSE_VALIDATE (1 << 6) /* call validation functions */ #define MPARSE_COMMENT (1 << 7) /* save comments in the tree */ struct roff_meta; struct mparse; struct mparse *mparse_alloc(int, enum mandoc_os, const char *); void mparse_copy(const struct mparse *); void mparse_free(struct mparse *); int mparse_open(struct mparse *, const char *); void mparse_readfd(struct mparse *, int, const char *); void mparse_reset(struct mparse *); struct roff_meta *mparse_result(struct mparse *); ��������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandoc_xr.h���������������������������������������������������������������������������0100644�0001753�0001753�00000002257�14123140553�0015500�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: mandoc_xr.h,v 1.3 2017/07/02 21:18:29 schwarze Exp $ */ /* * Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct mandoc_xr { struct mandoc_xr *next; char *sec; char *name; int line; /* Or -1 for this page's own names. */ int pos; int count; char hashkey[]; }; void mandoc_xr_reset(void); int mandoc_xr_add(const char *, const char *, int, int); struct mandoc_xr *mandoc_xr_get(void); void mandoc_xr_free(void); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mandocd.8�����������������������������������������������������������������������������0100644�0001753�0001753�00000011133�14123140553�0015044�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mandocd.8,v 1.2 2017/03/18 19:56:01 schwarze Exp $ .\" .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: March 18 2017 $ .Dt MANDOCD 8 .Os .Sh NAME .Nm mandocd .Nd server process to format manual pages in batch mode .Sh SYNOPSIS .Nm mandocd .Op Fl I Cm os Ns = Ns Ar name .Op Fl T Ar output .Ar socket_fd .Sh DESCRIPTION The .Nm utility formats many manual pages without requiring .Xr fork 2 and .Xr exec 3 overhead in between. It does not require listing all the manuals to be formatted on the command line, and it supports writing each formatted manual to its own file descriptor. .Pp This server requires that a connected UNIX domain .Xr socket 2 is already present at .Xr exec 3 time. Consequently, it cannot be started from the .Xr sh 1 command line because the shell cannot supply such a socket. Typically, the socket is created by the parent process using .Xr socketpair 2 before calling .Xr fork 2 and .Xr exec 3 on .Nm . The parent process will pass the file descriptor number as an argument to .Xr exec 3 , formatted as a decimal ASCII-encoded integer. See .Xr catman 8 for a typical implementation of a parent process. .Pp .Nm loops reading one-byte messages with .Xr recvmsg 2 from the file descriptor number .Ar socket_fd . It ignores the byte read and only uses the out-of-band auxiliary .Vt struct cmsghdr control data, typically supplied by the calling process using .Xr CMSG_FIRSTHDR 3 . The parent process is expected to pass three file descriptors with each dummy byte. The first one is used for .Xr mdoc 7 or .Xr man 7 input, the second one for formatted output, and the third one for error output. .Pp The options are as follows: .Bl -tag -width Ds .It Fl I Cm os Ns = Ns Ar name Override the default operating system .Ar name for the .Xr mdoc 7 .Ic \&Os and for the .Xr man 7 .Ic TH macro. .It Fl T Ar output Output format. The .Ar output argument can be .Cm ascii , .Cm utf8 , or .Cm html ; see .Xr mandoc 1 . In .Cm html output mode, the .Cm fragment output option is implied. Other output options are not supported. .El .Pp After exhausting one input file descriptor, all three file descriptors are closed before reading the next dummy byte and control message. .Pp When a zero-byte message is read, when the .Ar socket_fd is closed by the parent process, or when an error occurs, .Nm exits. .Sh EXIT STATUS .Ex -std .Pp A zero-byte message or a closed .Ar socket_fd is considered success. Possible errors include: .Bl -bullet .It missing, invalid, or excessive .Xr exec 3 arguments .It .Xr recvmsg 2 failure, for example due to .Er EMSGSIZE .It missing or unexpected control data, in particular a .Fa cmsg_level in the .Vt struct cmsghdr that differs from .Dv SOL_SOCKET , a .Fa cmsg_type that differs from .Dv SCM_RIGHTS , or a .Fa cmsg_len that is not three times the size of an .Vt int .It invalid file descriptors passed in the .Xr CMSG_DATA 3 .It resource exhaustion, in particular .Xr dup 2 or .Xr malloc 3 failure .El .Pp Except for memory exhaustion and similar system-level failures, parsing and formatting errors do not cause .Nm to return an error exit status. Even after severe parsing errors, .Nm will simply accept and process the next input file descriptor. .Sh SEE ALSO .Xr mandoc 1 , .Xr mandoc 3 , .Xr catman 8 .Sh HISTORY The .Nm utility appeared in version 1.14.1 or the .Sy mandoc toolkit. .Sh AUTHORS .An -nosplit The concept was designed and implemented by .An Michael Stapelberg Aq Mt stapelberg@debian.org . The .Xr mandoc 3 glue needed to make it a stand-alone process was added by .An Ingo Schwarze Aq Mt schwarze@openbsd.org . .Sh CAVEATS If the parsed manual pages contain .Xr roff 7 .Pf . Ic so requests, .Nm needs to be started with the current working directory set to the root of the manual page tree. Avoid starting it in directories that contain secret files in any subdirectories, in particular in the user starting it has read access to these secret files. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mansearch.3���������������������������������������������������������������������������0100644�0001753�0001753�00000006416�14123140553�0015403�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mansearch.3,v 1.5 2017/03/30 22:22:05 schwarze Exp $ .\" .\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: March 30 2017 $ .Dt MANSEARCH 3 .Os .Sh NAME .Nm mansearch .Nd search manual page databases .Sh SYNOPSIS .In stdint.h .In manconf.h .In mansearch.h .Ft int .Fo mansearch .Fa "const struct mansearch *search" .Fa "const struct manpaths *paths" .Fa "int argc" .Fa "char *argv[]" .Fa "struct manpage **res" .Fa "size_t *sz" .Fc .Sh DESCRIPTION The .Fn mansearch function returns information about manuals matching a search query from a .Xr mandoc.db 5 database. .Pp The query arguments are as follows: .Bl -tag -width Ds .It Fa "const struct mansearch *search" Search options, defined in .In mansearch.h . .It Fa "const struct manpaths *paths" Directories to be searched, defined in .In manconf.h . .It Fa "int argc" , "char *argv[]" Search criteria, usually taken from the command line. .El .Pp The output arguments are as follows: .Bl -tag -width Ds .It Fa "struct manpage **res" Returns a pointer to an array of result structures defined in .In mansearch.h . The user is expected to call .Xr free 3 on the .Va file , .Va names , and .Va output fields of all structures, as well as the .Fa res array itself. .It Fa "size_t *sz" Returns the number of result structures contained in .Fa res . .El .Sh IMPLEMENTATION NOTES For each manual page tree, the search is done in two steps. In the first step, a list of pages matching the search criteria is built. In the second step, the requested information about these pages is retrieved from the database and assembled into the .Fa res array. .Pp All function mentioned here are defined in the file .Pa mansearch.c . .Ss Finding matches Command line parsing is done by the function .Fn exprcomp building a singly linked list of .Vt expr structures, using the helper functions .Fn expr_and and .Fn exprterm . .Ss Assembling the results The names, sections, and architectures of the manuals found are assembled into the .Va names field of the result structure by the function .Fn buildnames . .Sh FILES .Bl -tag -width mandoc.db -compact .It Pa mandoc.db The manual page database. .El .Sh SEE ALSO .Xr apropos 1 , .Xr mandoc.db 5 , .Xr makewhatis 8 .Sh HISTORY The .Fn mansearch subsystem first appeared in .Ox 5.6 . .Sh AUTHORS .An -nosplit A module to search manual page databases was first written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv in 2011, at first using the Berkeley DB; he rewrote it for SQLite3 in 2012, and .An Ingo Schwarze Aq Mt schwarze@openbsd.org removed the dependency on SQLite3 in 2016. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mansearch.h���������������������������������������������������������������������������0100644�0001753�0001753�00000010042�14123140553�0015456�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: mansearch.h,v 1.30 2019/04/30 18:51:57 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #define MANDOC_DB "mandoc.db" #define MANDOCDB_MAGIC 0x3a7d0cdb #define MANDOCDB_VERSION 1 #define MACRO_MAX 36 #define KEY_arch 0 #define KEY_sec 1 #define KEY_Nm 38 #define KEY_Nd 39 #define KEY_MAX 40 #define TYPE_arch 0x0000000000000001ULL #define TYPE_sec 0x0000000000000002ULL #define TYPE_Xr 0x0000000000000004ULL #define TYPE_Ar 0x0000000000000008ULL #define TYPE_Fa 0x0000000000000010ULL #define TYPE_Fl 0x0000000000000020ULL #define TYPE_Dv 0x0000000000000040ULL #define TYPE_Fn 0x0000000000000080ULL #define TYPE_Ic 0x0000000000000100ULL #define TYPE_Pa 0x0000000000000200ULL #define TYPE_Cm 0x0000000000000400ULL #define TYPE_Li 0x0000000000000800ULL #define TYPE_Em 0x0000000000001000ULL #define TYPE_Cd 0x0000000000002000ULL #define TYPE_Va 0x0000000000004000ULL #define TYPE_Ft 0x0000000000008000ULL #define TYPE_Tn 0x0000000000010000ULL #define TYPE_Er 0x0000000000020000ULL #define TYPE_Ev 0x0000000000040000ULL #define TYPE_Sy 0x0000000000080000ULL #define TYPE_Sh 0x0000000000100000ULL #define TYPE_In 0x0000000000200000ULL #define TYPE_Ss 0x0000000000400000ULL #define TYPE_Ox 0x0000000000800000ULL #define TYPE_An 0x0000000001000000ULL #define TYPE_Mt 0x0000000002000000ULL #define TYPE_St 0x0000000004000000ULL #define TYPE_Bx 0x0000000008000000ULL #define TYPE_At 0x0000000010000000ULL #define TYPE_Nx 0x0000000020000000ULL #define TYPE_Fx 0x0000000040000000ULL #define TYPE_Lk 0x0000000080000000ULL #define TYPE_Ms 0x0000000100000000ULL #define TYPE_Bsx 0x0000000200000000ULL #define TYPE_Dx 0x0000000400000000ULL #define TYPE_Rs 0x0000000800000000ULL #define TYPE_Vt 0x0000001000000000ULL #define TYPE_Lb 0x0000002000000000ULL #define TYPE_Nm 0x0000004000000000ULL #define TYPE_Nd 0x0000008000000000ULL #define NAME_SYN 0x0000004000000001ULL #define NAME_FIRST 0x0000004000000004ULL #define NAME_TITLE 0x0000004000000006ULL #define NAME_HEAD 0x0000004000000008ULL #define NAME_FILE 0x0000004000000010ULL #define NAME_MASK 0x000000000000001fULL enum form { FORM_SRC = 1, /* Format is mdoc(7) or man(7). */ FORM_CAT, /* Manual page is preformatted. */ FORM_NONE /* Format is unknown. */ }; enum argmode { ARG_FILE = 0, ARG_NAME, ARG_WORD, ARG_EXPR }; struct manpage { char *file; /* to be prefixed by manpath */ char *names; /* a list of names with sections */ char *output; /* user-defined additional output */ uint64_t bits; /* name type mask */ size_t ipath; /* number of the manpath */ int sec; /* section number, 10 means invalid */ enum form form; }; struct mansearch { const char *arch; /* architecture/NULL */ const char *sec; /* mansection/NULL */ const char *outkey; /* show content of this macro */ enum argmode argmode; /* interpretation of arguments */ int firstmatch; /* first matching database only */ }; struct manpaths; int mansearch(const struct mansearch *cfg, /* options */ const struct manpaths *paths, /* manpaths */ int argc, /* size of argv */ char *argv[], /* search terms */ struct manpage **res, /* results */ size_t *ressz); /* results returned */ void mansearch_free(struct manpage *, size_t); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mchars_alloc.3������������������������������������������������������������������������0100644�0001753�0001753�00000012362�14123140553�0016066�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mchars_alloc.3,v 1.4 2016/07/07 19:19:01 schwarze Exp $ .\" .\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: July 7 2016 $ .Dt MCHARS_ALLOC 3 .Os .Sh NAME .Nm mchars_alloc , .Nm mchars_free , .Nm mchars_num2char , .Nm mchars_num2uc , .Nm mchars_spec2cp , .Nm mchars_spec2str , .Nm mchars_uc2str .Nd character table for mandoc .Sh SYNOPSIS .In sys/types.h .In mandoc.h .Ft void .Fn mchars_alloc void .Ft void .Fn mchars_free void .Ft char .Fo mchars_num2char .Fa "const char *decimal" .Fa "size_t sz" .Fc .Ft int .Fo mchars_num2uc .Fa "const char *hexadecimal" .Fa "size_t sz" .Fc .Ft int .Fo mchars_spec2cp .Fa "const char *name" .Fa "size_t sz" .Fc .Ft "const char *" .Fo mchars_spec2str .Fa "const char *name" .Fa "size_t sz" .Fa "size_t *rsz" .Fc .Ft "const char *" .Fn mchars_uc2str "int codepoint" .Sh DESCRIPTION These functions translate Unicode character numbers and .Xr roff 7 character names into glyphs. See .Xr mandoc_char 7 for a list of .Xr roff 7 special characters. These functions are intended for external use by programs formatting .Xr mdoc 7 and .Xr man 7 pages for output, for example the .Xr mandoc 1 output formatter modules and .Xr makewhatis 8 . The .Fa decimal , .Fa hexadecimal , .Fa name , and .Fa size input arguments are usually obtained from the .Xr mandoc_escape 3 parser function. .Pp The function .Fn mchars_num2char converts a .Fa decimal string representation of a character number consisting of .Fa sz digits into a printable ASCII character. If the input string is non-numeric or does not represent a printable ASCII character, the NUL character .Pq Sq \e0 is returned. For example, the .Xr mandoc 1 .Fl Tascii , .Fl Tutf8 , and .Fl Thtml output modules use this function to render .Xr roff 7 .Ic \eN escape sequences. .Pp The function .Fn mchars_num2uc converts a .Fa hexadecimal string representation of a Unicode codepoint consisting of .Fa sz digits into an integer representation. If the input string is non-numeric or represents an ASCII character, the NUL character .Pq Sq \e0 is returned. For example, the .Xr mandoc 1 .Fl Tutf8 and .Fl Thtml output modules use this function to render .Xr roff 7 .Ic \e[u Ns Ar XXXX Ns Ic \&] and .Ic \eC\(aqu Ns Ar XXXX Ns Ic \(aq escape sequences. .Pp The function .Fn mchars_alloc initializes a static .Vt "struct ohash" object for subsequent use by the following two lookup functions. When no longer needed, this object can be destroyed with .Fn mchars_free . .Pp The function .Fn mchars_spec2cp looks up a .Xr roff 7 special character .Fa name consisting of .Fa sz characters and returns the corresponding Unicode codepoint. If the .Ar name is not recognized, \-1 is returned. For example, the .Xr mandoc 1 .Fl Tutf8 and .Fl Thtml output modules use this function to render .Xr roff 7 .Ic \e[ Ns Ar name Ns Ic \&] and .Ic \eC\(aq Ns Ar name Ns Ic \(aq escape sequences. .Pp The function .Fn mchars_spec2str looks up a .Xr roff 7 special character .Fa name consisting of .Fa sz characters and returns an ASCII string representation. The length of the representation is returned in .Fa rsz . In many cases, the meaning of such ASCII representations is not quite obvious, so using .Xr roff 7 special characters in documents intended for ASCII rendering is usually a bad idea. If the .Ar name is not recognized, .Dv NULL is returned. For example, .Xr makewhatis 8 and the .Xr mandoc 1 .Fl Tascii output module use this function to render .Xr roff 7 .Ic \e[ Ns Ar name Ns Ic \&] and .Ic \eC\(aq Ns Ar name Ns Ic \(aq escape sequences. .Pp The function .Fn mchars_uc2str performs a reverse lookup of the Unicode .Fa codepoint and returns an ASCII string representation, or the string .Qq <?> if none is available. .Sh FILES These funtions are implemented in the file .Pa chars.c . .Sh SEE ALSO .Xr mandoc 1 , .Xr mandoc_escape 3 , .Xr ohash_init 3 , .Xr mandoc_char 7 , .Xr roff 7 .Sh HISTORY These functions and their predecessors have been available since the following mandoc versions: .Bl -column "mchars_num2char()" "1.11.3" "chars_num2char()" "1.10.10" .It Sy function Ta since Ta Sy predecessor Ta since .It Fn mchars_alloc Ta 1.11.3 Ta Fn ascii2htab Ta 1.5.3 .It Fn mchars_free Ta 1.11.2 Ta Fn asciifree Ta 1.6.0 .It Fn mchars_num2char Ta 1.11.2 Ta Fn chars_num2char Ta 1.10.10 .It Fn mchars_num2uc Ta 1.11.3 Ta \(em Ta \(em .It Fn mchars_spec2cp Ta 1.11.2 Ta Fn chars_spec2cp Ta 1.10.5 .It Fn mchars_spec2str Ta 1.11.2 Ta Fn a2ascii Ta 1.5.3 .It Fn mchars_uc2str Ta 1.13.2 Ta \(em Ta \(em .El .Sh AUTHORS .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .An Ingo Schwarze Aq Mt schwarze@openbsd.org ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mdoc.7��������������������������������������������������������������������������������0100644�0001753�0001753�00000226455�14123140553�0014377�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: mdoc.7,v 1.287 2021/07/29 17:32:01 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010, 2011, 2013-2020 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: July 29 2021 $ .Dt MDOC 7 .Os .Sh NAME .Nm mdoc .Nd semantic markup language for formatting manual pages .Sh DESCRIPTION The .Nm mdoc language supports authoring of manual pages for the .Xr man 1 utility by allowing semantic annotations of words, phrases, page sections and complete manual pages. Such annotations are used by formatting tools to achieve a uniform presentation across all manuals written in .Nm , and to support hyperlinking if supported by the output medium. .Pp This reference document describes the structure of manual pages and the syntax and usage of the .Nm language. The reference implementation of a parsing and formatting tool is .Xr mandoc 1 ; the .Sx COMPATIBILITY section describes compatibility with other implementations. .Pp In an .Nm document, lines beginning with the control character .Sq \&. are called .Dq macro lines . The first word is the macro name. It consists of two or three letters. Most macro names begin with a capital letter. For a list of available macros, see .Sx MACRO OVERVIEW . The words following the macro name are arguments to the macro, optionally including the names of other, callable macros; see .Sx MACRO SYNTAX for details. .Pp Lines not beginning with the control character are called .Dq text lines . They provide free-form text to be printed; the formatting of the text depends on the respective processing context: .Bd -literal -offset indent \&.Sh Macro lines change control state. Text lines are interpreted within the current state. .Ed .Pp Many aspects of the basic syntax of the .Nm language are based on the .Xr roff 7 language; see the .Em LANGUAGE SYNTAX and .Em MACRO SYNTAX sections in the .Xr roff 7 manual for details, in particular regarding comments, escape sequences, whitespace, and quoting. However, using .Xr roff 7 requests in .Nm documents is discouraged; .Xr mandoc 1 supports some of them merely for backward compatibility. .Sh MANUAL STRUCTURE A well-formed .Nm document consists of a document prologue followed by one or more sections. .Pp The prologue, which consists of the .Ic \&Dd , .Ic \&Dt , and .Ic \&Os macros in that order, is required for every document. .Pp The first section (sections are denoted by .Ic \&Sh ) must be the NAME section, consisting of at least one .Ic \&Nm followed by .Ic \&Nd . .Pp Following that, convention dictates specifying at least the .Em SYNOPSIS and .Em DESCRIPTION sections, although this varies between manual sections. .Pp The following is a well-formed skeleton .Nm file for a utility .Qq progname : .Bd -literal -offset indent \&.Dd $\&Mdocdate$ \&.Dt PROGNAME section \&.Os \&.Sh NAME \&.Nm progname \&.Nd one line about what it does \&.\e\(dq .Sh LIBRARY \&.\e\(dq For sections 2, 3, and 9 only. \&.\e\(dq Not used in OpenBSD. \&.Sh SYNOPSIS \&.Nm progname \&.Op Fl options \&.Ar \&.Sh DESCRIPTION The \&.Nm utility processes files ... \&.\e\(dq .Sh CONTEXT \&.\e\(dq For section 9 functions only. \&.\e\(dq .Sh IMPLEMENTATION NOTES \&.\e\(dq Not used in OpenBSD. \&.\e\(dq .Sh RETURN VALUES \&.\e\(dq For sections 2, 3, and 9 function return values only. \&.\e\(dq .Sh ENVIRONMENT \&.\e\(dq For sections 1, 6, 7, and 8 only. \&.\e\(dq .Sh FILES \&.\e\(dq .Sh EXIT STATUS \&.\e\(dq For sections 1, 6, and 8 only. \&.\e\(dq .Sh EXAMPLES \&.\e\(dq .Sh DIAGNOSTICS \&.\e\(dq For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only. \&.\e\(dq .Sh ERRORS \&.\e\(dq For sections 2, 3, 4, and 9 errno settings only. \&.\e\(dq .Sh SEE ALSO \&.\e\(dq .Xr foobar 1 \&.\e\(dq .Sh STANDARDS \&.\e\(dq .Sh HISTORY \&.\e\(dq .Sh AUTHORS \&.\e\(dq .Sh CAVEATS \&.\e\(dq .Sh BUGS \&.\e\(dq .Sh SECURITY CONSIDERATIONS \&.\e\(dq Not used in OpenBSD. .Ed .Pp The sections in an .Nm document are conventionally ordered as they appear above. Sections should be composed as follows: .Bl -ohang -offset Ds .It Em NAME The name(s) and a one line description of the documented material. The syntax for this as follows: .Bd -literal -offset indent \&.Nm name0 , \&.Nm name1 , \&.Nm name2 \&.Nd a one line description .Ed .Pp Multiple .Sq \&Nm names should be separated by commas. .Pp The .Ic \&Nm macro(s) must precede the .Ic \&Nd macro. .Pp See .Ic \&Nm and .Ic \&Nd . .It Em LIBRARY The name of the library containing the documented material, which is assumed to be a function in a section 2, 3, or 9 manual. The syntax for this is as follows: .Bd -literal -offset indent \&.Lb libarm .Ed .Pp See .Ic \&Lb . .It Em SYNOPSIS Documents the utility invocation syntax, function call syntax, or device configuration. .Pp For the first, utilities (sections 1, 6, and 8), this is generally structured as follows: .Bd -literal -offset indent \&.Nm bar \&.Op Fl v \&.Op Fl o Ar file \&.Op Ar \&.Nm foo \&.Op Fl v \&.Op Fl o Ar file \&.Op Ar .Ed .Pp Commands should be ordered alphabetically. .Pp For the second, function calls (sections 2, 3, 9): .Bd -literal -offset indent \&.In header.h \&.Vt extern const char *global; \&.Ft "char *" \&.Fn foo "const char *src" \&.Ft "char *" \&.Fn bar "const char *src" .Ed .Pp Ordering of .Ic \&In , .Ic \&Vt , .Ic \&Fn , and .Ic \&Fo macros should follow C header-file conventions. .Pp And for the third, configurations (section 4): .Bd -literal -offset indent \&.Cd \(dqit* at isa? port 0x2e\(dq \&.Cd \(dqit* at isa? port 0x4e\(dq .Ed .Pp Manuals not in these sections generally don't need a .Em SYNOPSIS . .Pp Some macros are displayed differently in the .Em SYNOPSIS section, particularly .Ic \&Nm , .Ic \&Cd , .Ic \&Fd , .Ic \&Fn , .Ic \&Fo , .Ic \&In , .Ic \&Vt , and .Ic \&Ft . All of these macros are output on their own line. If two such dissimilar macros are pairwise invoked (except for .Ic \&Ft before .Ic \&Fo or .Ic \&Fn ) , they are separated by a vertical space, unless in the case of .Ic \&Fo , .Ic \&Fn , and .Ic \&Ft , which are always separated by vertical space. .Pp When text and macros following an .Ic \&Nm macro starting an input line span multiple output lines, all output lines but the first will be indented to align with the text immediately following the .Ic \&Nm macro, up to the next .Ic \&Nm , .Ic \&Sh , or .Ic \&Ss macro or the end of an enclosing block, whichever comes first. .It Em DESCRIPTION This begins with an expansion of the brief, one line description in .Em NAME : .Bd -literal -offset indent The \&.Nm utility does this, that, and the other. .Ed .Pp It usually follows with a breakdown of the options (if documenting a command), such as: .Bd -literal -offset indent The options are as follows: \&.Bl \-tag \-width Ds \&.It Fl v Print verbose information. \&.El .Ed .Pp List the options in alphabetical order, uppercase before lowercase for each letter and with no regard to whether an option takes an argument. Put digits in ascending order before all letter options. .Pp Manuals not documenting a command won't include the above fragment. .Pp Since the .Em DESCRIPTION section usually contains most of the text of a manual, longer manuals often use the .Ic \&Ss macro to form subsections. In very long manuals, the .Em DESCRIPTION may be split into multiple sections, each started by an .Ic \&Sh macro followed by a non-standard section name, and each having several subsections, like in the present .Nm manual. .It Em CONTEXT This section lists the contexts in which functions can be called in section 9. The contexts are autoconf, process, or interrupt. .It Em IMPLEMENTATION NOTES Implementation-specific notes should be kept here. This is useful when implementing standard functions that may have side effects or notable algorithmic implications. .It Em RETURN VALUES This section documents the return values of functions in sections 2, 3, and 9. .Pp See .Ic \&Rv . .It Em ENVIRONMENT Lists the environment variables used by the utility, and explains the syntax and semantics of their values. The .Xr environ 7 manual provides examples of typical content and formatting. .Pp See .Ic \&Ev . .It Em FILES Documents files used. It's helpful to document both the file name and a short description of how the file is used (created, modified, etc.). .Pp See .Ic \&Pa . .It Em EXIT STATUS This section documents the command exit status for section 1, 6, and 8 utilities. Historically, this information was described in .Em DIAGNOSTICS , a practise that is now discouraged. .Pp See .Ic \&Ex . .It Em EXAMPLES Example usages. This often contains snippets of well-formed, well-tested invocations. Make sure that examples work properly! .It Em DIAGNOSTICS Documents error messages. In section 4 and 9 manuals, these are usually messages printed by the kernel to the console and to the kernel log. In section 1, 6, 7, and 8, these are usually messages printed by userland programs to the standard error output. .Pp Historically, this section was used in place of .Em EXIT STATUS for manuals in sections 1, 6, and 8; however, this practise is discouraged. .Pp See .Ic \&Bl .Fl diag . .It Em ERRORS Documents .Xr errno 2 settings in sections 2, 3, 4, and 9. .Pp See .Ic \&Er . .It Em SEE ALSO References other manuals with related topics. This section should exist for most manuals. Cross-references should conventionally be ordered first by section, then alphabetically (ignoring case). .Pp References to other documentation concerning the topic of the manual page, for example authoritative books or journal articles, may also be provided in this section. .Pp See .Ic \&Rs and .Ic \&Xr . .It Em STANDARDS References any standards implemented or used. If not adhering to any standards, the .Em HISTORY section should be used instead. .Pp See .Ic \&St . .It Em HISTORY A brief history of the subject, including where it was first implemented, and when it was ported to or reimplemented for the operating system at hand. .It Em AUTHORS Credits to the person or persons who wrote the code and/or documentation. Authors should generally be noted by both name and email address. .Pp See .Ic \&An . .It Em CAVEATS Common misuses and misunderstandings should be explained in this section. .It Em BUGS Known bugs, limitations, and work-arounds should be described in this section. .It Em SECURITY CONSIDERATIONS Documents any security precautions that operators should consider. .El .Sh MACRO OVERVIEW This overview is sorted such that macros of similar purpose are listed together, to help find the best macro for any given purpose. Deprecated macros are not included in the overview, but can be found below in the alphabetical .Sx MACRO REFERENCE . .Ss Document preamble and NAME section macros .Bl -column "Brq, Bro, Brc" description .It Ic \&Dd Ta document date: Cm $\&Mdocdate$ | Ar month day , year .It Ic \&Dt Ta document title: Ar TITLE section Op Ar arch .It Ic \&Os Ta operating system version: Op Ar system Op Ar version .It Ic \&Nm Ta document name (one argument) .It Ic \&Nd Ta document description (one line) .El .Ss Sections and cross references .Bl -column "Brq, Bro, Brc" description .It Ic \&Sh Ta section header (one line) .It Ic \&Ss Ta subsection header (one line) .It Ic \&Sx Ta internal cross reference to a section or subsection .It Ic \&Xr Ta cross reference to another manual page: Ar name section .It Ic \&Tg Ta tag the definition of a Ar term Pq <= 1 arguments .It Ic \&Pp Ta start a text paragraph (no arguments) .El .Ss Displays and lists .Bl -column "Brq, Bro, Brc" description .It Ic \&Bd , \&Ed Ta display block: .Fl Ar type .Op Fl offset Ar width .Op Fl compact .It Ic \&D1 Ta indented display (one line) .It Ic \&Dl Ta indented literal display (one line) .It Ic \&Ql Ta in-line literal display: Ql text .It Ic \&Bl , \&El Ta list block: .Fl Ar type .Op Fl width Ar val .Op Fl offset Ar val .Op Fl compact .It Ic \&It Ta list item (syntax depends on Fl Ar type ) .It Ic \&Ta Ta table cell separator in Ic \&Bl Fl column No lists .It Ic \&Rs , \&%* , \&Re Ta bibliographic block (references) .El .Ss Spacing control .Bl -column "Brq, Bro, Brc" description .It Ic \&Pf Ta prefix, no following horizontal space (one argument) .It Ic \&Ns Ta roman font, no preceding horizontal space (no arguments) .It Ic \&Ap Ta apostrophe without surrounding whitespace (no arguments) .It Ic \&Sm Ta switch horizontal spacing mode: Op Cm on | off .It Ic \&Bk , \&Ek Ta keep block: Fl words .El .Ss Semantic markup for command line utilities .Bl -column "Brq, Bro, Brc" description .It Ic \&Nm Ta start a SYNOPSIS block with the name of a utility .It Ic \&Fl Ta command line options (flags) (>=0 arguments) .It Ic \&Cm Ta command modifier (>0 arguments) .It Ic \&Ar Ta command arguments (>=0 arguments) .It Ic \&Op , \&Oo , \&Oc Ta optional syntax elements (enclosure) .It Ic \&Ic Ta internal or interactive command (>0 arguments) .It Ic \&Ev Ta environmental variable (>0 arguments) .It Ic \&Pa Ta file system path (>=0 arguments) .El .Ss Semantic markup for function libraries .Bl -column "Brq, Bro, Brc" description .It Ic \&Lb Ta function library (one argument) .It Ic \&In Ta include file (one argument) .It Ic \&Fd Ta other preprocessor directive (>0 arguments) .It Ic \&Ft Ta function type (>0 arguments) .It Ic \&Fo , \&Fc Ta function block: Ar funcname .It Ic \&Fn Ta function name: Ar funcname Op Ar argument ... .It Ic \&Fa Ta function argument (>0 arguments) .It Ic \&Vt Ta variable type (>0 arguments) .It Ic \&Va Ta variable name (>0 arguments) .It Ic \&Dv Ta defined variable or preprocessor constant (>0 arguments) .It Ic \&Er Ta error constant (>0 arguments) .It Ic \&Ev Ta environmental variable (>0 arguments) .El .Ss Various semantic markup .Bl -column "Brq, Bro, Brc" description .It Ic \&An Ta author name (>0 arguments) .It Ic \&Lk Ta hyperlink: Ar uri Op Ar display_name .It Ic \&Mt Ta Do mailto Dc hyperlink: Ar localpart Ns @ Ns Ar domain .It Ic \&Cd Ta kernel configuration declaration (>0 arguments) .It Ic \&Ad Ta memory address (>0 arguments) .It Ic \&Ms Ta mathematical symbol (>0 arguments) .El .Ss Physical markup .Bl -column "Brq, Bro, Brc" description .It Ic \&Em Ta italic font or underline (emphasis) (>0 arguments) .It Ic \&Sy Ta boldface font (symbolic) (>0 arguments) .It Ic \&No Ta return to roman font (normal) (>0 arguments) .It Ic \&Bf , \&Ef Ta font block: Fl Ar type | Cm \&Em | \&Li | \&Sy .El .Ss Physical enclosures .Bl -column "Brq, Bro, Brc" description .It Ic \&Dq , \&Do , \&Dc Ta enclose in typographic double quotes: Dq text .It Ic \&Qq , \&Qo , \&Qc Ta enclose in typewriter double quotes: Qq text .It Ic \&Sq , \&So , \&Sc Ta enclose in single quotes: Sq text .It Ic \&Pq , \&Po , \&Pc Ta enclose in parentheses: Pq text .It Ic \&Bq , \&Bo , \&Bc Ta enclose in square brackets: Bq text .It Ic \&Brq , \&Bro , \&Brc Ta enclose in curly braces: Brq text .It Ic \&Aq , \&Ao , \&Ac Ta enclose in angle brackets: Aq text .It Ic \&Eo , \&Ec Ta generic enclosure .El .Ss Text production .Bl -column "Brq, Bro, Brc" description .It Ic \&Ex Fl std Ta standard command exit values: Op Ar utility ... .It Ic \&Rv Fl std Ta standard function return values: Op Ar function ... .It Ic \&St Ta reference to a standards document (one argument) .It Ic \&At Ta At .It Ic \&Bx Ta Bx .It Ic \&Bsx Ta Bsx .It Ic \&Nx Ta Nx .It Ic \&Fx Ta Fx .It Ic \&Ox Ta Ox .It Ic \&Dx Ta Dx .El .Sh MACRO REFERENCE This section is a canonical reference of all macros, arranged alphabetically. For the scoping of individual macros, see .Sx MACRO SYNTAX . .Bl -tag -width 3n .It Ic \&%A Ar first_name ... last_name Author name of an .Ic \&Rs block. Multiple authors should each be accorded their own .Ic \%%A line. Author names should be ordered with full or abbreviated forename(s) first, then full surname. .It Ic \&%B Ar title Book title of an .Ic \&Rs block. This macro may also be used in a non-bibliographic context when referring to book titles. .It Ic \&%C Ar location Publication city or location of an .Ic \&Rs block. .It Ic \&%D Oo Ar month day , Oc Ar year Publication date of an .Ic \&Rs block. Provide the full English name of the .Ar month and all four digits of the .Ar year . .It Ic \&%I Ar name Publisher or issuer name of an .Ic \&Rs block. .It Ic \&%J Ar name Journal name of an .Ic \&Rs block. .It Ic \&%N Ar number Issue number (usually for journals) of an .Ic \&Rs block. .It Ic \&%O Ar line Optional information of an .Ic \&Rs block. .It Ic \&%P Ar number Book or journal page number of an .Ic \&Rs block. Conventionally, the argument starts with .Ql p.\& for a single page or .Ql pp.\& for a range of pages, for example: .Pp .Dl .%P pp. 42\e(en47 .It Ic \&%Q Ar name Institutional author (school, government, etc.) of an .Ic \&Rs block. Multiple institutional authors should each be accorded their own .Ic \&%Q line. .It Ic \&%R Ar name Technical report name of an .Ic \&Rs block. .It Ic \&%T Ar title Article title of an .Ic \&Rs block. This macro may also be used in a non-bibliographical context when referring to article titles. .It Ic \&%U Ar protocol Ns :// Ns Ar path URI of reference document. .It Ic \&%V Ar number Volume number of an .Ic \&Rs block. .It Ic \&Ac Close an .Ic \&Ao block. Does not have any tail arguments. .Tg Ad .It Ic \&Ad Ar address Memory address. Do not use this for postal addresses. .Pp Examples: .Dl \&.Ad [0,$] .Dl \&.Ad 0x00000000 .Tg An .It Ic \&An Fl split | nosplit | Ar first_name ... last_name Author name. Can be used both for the authors of the program, function, or driver documented in the manual, or for the authors of the manual itself. Requires either the name of an author or one of the following arguments: .Pp .Bl -tag -width "-nosplitX" -offset indent -compact .It Fl split Start a new output line before each subsequent invocation of .Ic \&An . .It Fl nosplit The opposite of .Fl split . .El .Pp The default is .Fl nosplit . The effect of selecting either of the .Fl split modes ends at the beginning of the .Em AUTHORS section. In the .Em AUTHORS section, the default is .Fl nosplit for the first author listing and .Fl split for all other author listings. .Pp Examples: .Dl \&.An -nosplit .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv .It Ic \&Ao Ar block Begin a block enclosed by angle brackets. Does not have any head arguments. This macro is almost never useful. See .Ic \&Aq for more details. .Tg Ap .It Ic \&Ap Inserts an apostrophe without any surrounding whitespace. This is generally used as a grammatical device when referring to the verb form of a function. .Pp Examples: .Dl \&.Fn execve \&Ap d .Tg Aq .It Ic \&Aq Ar line Enclose the rest of the input line in angle brackets. The only important use case is for email addresses. See .Ic \&Mt for an example. .Pp Occasionally, it is used for names of characters and keys, for example: .Bd -literal -offset indent Press the \&.Aq escape key to ... .Ed .Pp For URIs, use .Ic \&Lk instead, and .Ic \&In for .Dq #include directives. Never wrap .Ic \&Ar in .Ic \&Aq . .Pp Since .Ic \&Aq usually renders with non-ASCII characters in non-ASCII output modes, do not use it where the ASCII characters .Sq < and .Sq > are required as syntax elements. Instead, use these characters directly in such cases, combining them with the macros .Ic \&Pf , .Ic \&Ns , or .Ic \&Eo as needed. .Pp See also .Ic \&Ao . .Tg Ar .It Ic \&Ar Op Ar placeholder ... Command arguments. If an argument is not provided, the string .Dq file ...\& is used as a default. .Pp Examples: .Dl ".Fl o Ar file" .Dl ".Ar" .Dl ".Ar arg1 , arg2 ." .Pp The arguments to the .Ic \&Ar macro are names and placeholders for command arguments; for fixed strings to be passed verbatim as arguments, use .Ic \&Fl or .Ic \&Cm . .Tg At .It Ic \&At Op Ar version Formats an .At version. Accepts one optional argument: .Pp .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact .It Cm v[1-7] | 32v A version of .At . .It Cm III .At III . .It Cm V | V.[1-4] A version of .At V . .El .Pp Note that these arguments do not begin with a hyphen. .Pp Examples: .Dl \&.At .Dl \&.At III .Dl \&.At V.1 .Pp See also .Ic \&Bsx , .Ic \&Bx , .Ic \&Dx , .Ic \&Fx , .Ic \&Nx , and .Ic \&Ox . .It Ic \&Bc Close a .Ic \&Bo block. Does not have any tail arguments. .Tg Bd .It Ic \&Bd Fl Ns Ar type Oo Fl offset Ar width Oc Op Fl compact Begin a display block. Display blocks are used to select a different indentation and justification than the one used by the surrounding text. They may contain both macro lines and text lines. By default, a display block is preceded by a vertical space. .Pp The .Ar type must be one of the following: .Bl -tag -width 13n -offset indent .It Fl centered Produce one output line from each input line, and center-justify each line. Using this display type is not recommended; many .Nm implementations render it poorly. .It Fl filled Change the positions of line breaks to fill each line, and left- and right-justify the resulting block. .It Fl literal Produce one output line from each input line, and do not justify the block at all. Preserve white space as it appears in the input. Always use a constant-width font. Use this for displaying source code. .It Fl ragged Change the positions of line breaks to fill each line, and left-justify the resulting block. .It Fl unfilled The same as .Fl literal , but using the same font as for normal text, which is a variable width font if supported by the output device. .El .Pp The .Ar type must be provided first. Additional arguments may follow: .Bl -tag -width 13n -offset indent .It Fl offset Ar width Indent the display by the .Ar width , which may be one of the following: .Bl -item .It One of the pre-defined strings .Cm indent , the width of a standard indentation (six constant width characters); .Cm indent-two , twice .Cm indent ; .Cm left , which has no effect; .Cm right , which justifies to the right margin; or .Cm center , which aligns around an imagined center axis. .It A macro invocation, which selects a predefined width associated with that macro. The most popular is the imaginary macro .Ar \&Ds , which resolves to .Sy 6n . .It A scaling width as described in .Xr roff 7 . .It An arbitrary string, which indents by the length of this string. .El .Pp When the argument is missing, .Fl offset is ignored. .It Fl compact Do not assert vertical space before the display. .El .Pp Examples: .Bd -literal -offset indent \&.Bd \-literal \-offset indent \-compact Hello world. \&.Ed .Ed .Pp See also .Ic \&D1 and .Ic \&Dl . .Tg Bf .It Ic \&Bf Fl emphasis | literal | symbolic | Cm \&Em | \&Li | \&Sy Change the font mode for a scoped block of text. The .Fl emphasis and .Cm \&Em argument are equivalent, as are .Fl symbolic and .Cm \&Sy , and .Fl literal and .Cm \&Li . Without an argument, this macro does nothing. The font mode continues until broken by a new font mode in a nested scope or .Ic \&Ef is encountered. .Pp See also .Ic \&Li , .Ic \&Ef , .Ic \&Em , and .Ic \&Sy . .Tg Bk .It Ic \&Bk Fl words For each macro, keep its output together on the same output line, until the end of the macro or the end of the input line is reached, whichever comes first. Line breaks in text lines are unaffected. .Pp The .Fl words argument is required; additional arguments are ignored. .Pp The following example will not break within each .Ic \&Op macro line: .Bd -literal -offset indent \&.Bk \-words \&.Op Fl f Ar flags \&.Op Fl o Ar output \&.Ek .Ed .Pp Be careful in using over-long lines within a keep block! Doing so will clobber the right margin. .Tg Bl .It Xo .Ic \&Bl .Fl Ns Ar type .Op Fl width Ar val .Op Fl offset Ar val .Op Fl compact .Op Ar col ... .Xc Begin a list. Lists consist of items specified using the .Ic \&It macro, containing a head or a body or both. .Pp The list .Ar type is mandatory and must be specified first. The .Fl width and .Fl offset arguments accept macro names as described for .Ic \&Bd .Fl offset , scaling widths as described in .Xr roff 7 , or use the length of the given string. The .Fl offset is a global indentation for the whole list, affecting both item heads and bodies. For those list types supporting it, the .Fl width argument requests an additional indentation of item bodies, to be added to the .Fl offset . Unless the .Fl compact argument is specified, list entries are separated by vertical space. .Pp A list must specify one of the following list types: .Bl -tag -width 12n -offset indent .It Fl bullet No item heads can be specified, but a bullet will be printed at the head of each item. Item bodies start on the same output line as the bullet and are indented according to the .Fl width argument. .It Fl column A columnated list. The .Fl width argument has no effect; instead, the string length of each argument specifies the width of one column. If the first line of the body of a .Fl column list is not an .Ic \&It macro line, .Ic \&It contexts spanning one input line each are implied until an .Ic \&It macro line is encountered, at which point items start being interpreted as described in the .Ic \&It documentation. .It Fl dash Like .Fl bullet , except that dashes are used in place of bullets. .It Fl diag Like .Fl inset , except that item heads are not parsed for macro invocations. Most often used in the .Em DIAGNOSTICS section with error constants in the item heads. .It Fl enum A numbered list. No item heads can be specified. Formatted like .Fl bullet , except that cardinal numbers are used in place of bullets, starting at 1. .It Fl hang Like .Fl tag , except that the first lines of item bodies are not indented, but follow the item heads like in .Fl inset lists. .It Fl hyphen Synonym for .Fl dash . .It Fl inset Item bodies follow items heads on the same line, using normal inter-word spacing. Bodies are not indented, and the .Fl width argument is ignored. .It Fl item No item heads can be specified, and none are printed. Bodies are not indented, and the .Fl width argument is ignored. .It Fl ohang Item bodies start on the line following item heads and are not indented. The .Fl width argument is ignored. .It Fl tag Item bodies are indented according to the .Fl width argument. When an item head fits inside the indentation, the item body follows this head on the same output line. Otherwise, the body starts on the output line following the head. .El .Pp Lists may be nested within lists and displays. Nesting of .Fl column and .Fl enum lists may not be portable. .Pp See also .Ic \&El and .Ic \&It . .It Ic \&Bo Ar block Begin a block enclosed by square brackets. Does not have any head arguments. .Pp Examples: .Bd -literal -offset indent -compact \&.Bo 1 , \&.Dv BUFSIZ \&Bc .Ed .Pp See also .Ic \&Bq . .Tg Bq .It Ic \&Bq Ar line Encloses its arguments in square brackets. .Pp Examples: .Dl \&.Bq 1 , \&Dv BUFSIZ .Pp .Em Remarks : this macro is sometimes abused to emulate optional arguments for commands; the correct macros to use for this purpose are .Ic \&Op , .Ic \&Oo , and .Ic \&Oc . .Pp See also .Ic \&Bo . .It Ic \&Brc Close a .Ic \&Bro block. Does not have any tail arguments. .It Ic \&Bro Ar block Begin a block enclosed by curly braces. Does not have any head arguments. .Pp Examples: .Bd -literal -offset indent -compact \&.Bro 1 , ... , \&.Va n \&Brc .Ed .Pp See also .Ic \&Brq . .Tg Brq .It Ic \&Brq Ar line Encloses its arguments in curly braces. .Pp Examples: .Dl \&.Brq 1 , ... , \&Va n .Pp See also .Ic \&Bro . .Tg Bsx .It Ic \&Bsx Op Ar version Format the .Bsx version provided as an argument, or a default value if no argument is provided. .Pp Examples: .Dl \&.Bsx 1.0 .Dl \&.Bsx .Pp See also .Ic \&At , .Ic \&Bx , .Ic \&Dx , .Ic \&Fx , .Ic \&Nx , and .Ic \&Ox . .It Ic \&Bt Supported only for compatibility, do not use this in new manuals. Prints .Dq is currently in beta test. .Tg Bx .It Ic \&Bx Op Ar version Op Ar variant Format the .Bx version provided as an argument, or a default value if no argument is provided. .Pp Examples: .Dl \&.Bx 4.3 Tahoe .Dl \&.Bx 4.4 .Dl \&.Bx .Pp See also .Ic \&At , .Ic \&Bsx , .Ic \&Dx , .Ic \&Fx , .Ic \&Nx , and .Ic \&Ox . .Tg Cd .It Ic \&Cd Ar line Kernel configuration declaration. This denotes strings accepted by .Xr config 8 . It is most often used in section 4 manual pages. .Pp Examples: .Dl \&.Cd device le0 at scode? .Pp .Em Remarks : this macro is commonly abused by using quoted literals to retain whitespace and align consecutive .Ic \&Cd declarations. This practise is discouraged. .Tg Cm .It Ic \&Cm Ar keyword ... Command modifiers. Typically used for fixed strings passed as arguments to interactive commands, to commands in interpreted scripts, or to configuration file directives, unless .Ic \&Fl is more appropriate. .Pp Examples: .Dl ".Nm mt Fl f Ar device Cm rewind" .Dl ".Nm ps Fl o Cm pid , Ns Cm command" .Dl ".Nm dd Cm if= Ns Ar file1 Cm of= Ns Ar file2" .Dl ".Ic set Fl o Cm vi" .Dl ".Ic lookup Cm file bind" .Dl ".Ic permit Ar identity Op Cm as Ar target" .Tg D1 .It Ic \&D1 Ar line One-line indented display. This is formatted by the default rules and is useful for simple indented statements. It is followed by a newline. .Pp Examples: .Dl \&.D1 \&Fl abcdefgh .Pp See also .Ic \&Bd and .Ic \&Dl . .It Ic \&Db This macro is obsolete. No replacement is needed. It is ignored by .Xr mandoc 1 and groff including its arguments. It was formerly used to toggle a debugging mode. .It Ic \&Dc Close a .Ic \&Do block. Does not have any tail arguments. .Tg Dd .It Ic \&Dd Cm $\&Mdocdate$ | Ar month day , year Document date for display in the page footer, by convention the date of the last change. This is the mandatory first macro of any .Nm manual. .Pp The .Ar month is the full English month name, the .Ar day is an integer number, and the .Ar year is the full four-digit year. .Pp Other arguments are not portable; the .Xr mandoc 1 utility handles them as follows: .Bl -dash -offset 3n -compact .It To have the date automatically filled in by the .Ox version of .Xr cvs 1 , the special string .Dq $\&Mdocdate$ can be given as an argument. .It The traditional, purely numeric .Xr man 7 format .Ar year Ns \(en Ns Ar month Ns \(en Ns Ar day is accepted, too. .It If a date string cannot be parsed, it is used verbatim. .It If no date string is given, the current date is used. .El .Pp Examples: .Dl \&.Dd $\&Mdocdate$ .Dl \&.Dd $\&Mdocdate: July 2 2018$ .Dl \&.Dd July 2, 2018 .Pp See also .Ic \&Dt and .Ic \&Os . .Tg Dl .It Ic \&Dl Ar line One-line indented display. This is formatted as literal text and is useful for commands and invocations. It is followed by a newline. .Pp Examples: .Dl \&.Dl % mandoc mdoc.7 \e(ba less .Pp See also .Ic \&Ql , .Ic \&Bd Fl literal , and .Ic \&D1 . .It Ic \&Do Ar block Begin a block enclosed by double quotes. Does not have any head arguments. .Pp Examples: .Bd -literal -offset indent -compact \&.Do April is the cruellest month \&.Dc \e(em T.S. Eliot .Ed .Pp See also .Ic \&Dq . .Tg Dq .It Ic \&Dq Ar line Encloses its arguments in .Dq typographic double-quotes. .Pp Examples: .Bd -literal -offset indent -compact \&.Dq April is the cruellest month \e(em T.S. Eliot .Ed .Pp See also .Ic \&Qq , .Ic \&Sq , and .Ic \&Do . .Tg Dt .It Ic \&Dt Ar TITLE section Op Ar arch Document title for display in the page header. This is the mandatory second macro of any .Nm file. .Pp Its arguments are as follows: .Bl -tag -width section -offset 2n .It Ar TITLE The document's title (name), defaulting to .Dq UNTITLED if unspecified. To achieve a uniform appearance of page header lines, it should by convention be all caps. .It Ar section The manual section. This may be one of .Cm 1 .Pq General Commands , .Cm 2 .Pq System Calls , .Cm 3 .Pq Library Functions , .Cm 3p .Pq Perl Library , .Cm 4 .Pq Device Drivers , .Cm 5 .Pq File Formats , .Cm 6 .Pq Games , .Cm 7 .Pq Miscellaneous Information , .Cm 8 .Pq System Manager's Manual , or .Cm 9 .Pq Kernel Developer's Manual . It should correspond to the manual's filename suffix and defaults to the empty string if unspecified. .It Ar arch This specifies the machine architecture a manual page applies to, where relevant, for example .Cm alpha , .Cm amd64 , .Cm i386 , or .Cm sparc64 . The list of valid architectures varies by operating system. .El .Pp Examples: .Dl \&.Dt FOO 1 .Dl \&.Dt FOO 9 i386 .Pp See also .Ic \&Dd and .Ic \&Os . .Tg Dv .It Ic \&Dv Ar identifier ... Defined variables such as preprocessor constants, constant symbols, enumeration values, and so on. .Pp Examples: .Dl \&.Dv NULL .Dl \&.Dv BUFSIZ .Dl \&.Dv STDOUT_FILENO .Pp See also .Ic \&Er and .Ic \&Ev for special-purpose constants, .Ic \&Va for variable symbols, and .Ic \&Fd for listing preprocessor variable definitions in the .Em SYNOPSIS . .Tg Dx .It Ic \&Dx Op Ar version Format the .Dx version provided as an argument, or a default value if no argument is provided. .Pp Examples: .Dl \&.Dx 2.4.1 .Dl \&.Dx .Pp See also .Ic \&At , .Ic \&Bsx , .Ic \&Bx , .Ic \&Fx , .Ic \&Nx , and .Ic \&Ox . .It Ic \&Ec Op Ar closing_delimiter Close a scope started by .Ic \&Eo . .Pp The .Ar closing_delimiter argument is used as the enclosure tail, for example, specifying \e(rq will emulate .Ic \&Dc . .It Ic \&Ed End a display context started by .Ic \&Bd . .It Ic \&Ef End a font mode context started by .Ic \&Bf . .It Ic \&Ek End a keep context started by .Ic \&Bk . .It Ic \&El End a list context started by .Ic \&Bl . See also .Ic \&It . .Tg Em .It Ic \&Em Ar word ... Request an italic font. If the output device does not provide that, underline. .Pp This is most often used for stress emphasis (not to be confused with importance, see .Ic \&Sy ) . In the rare cases where none of the semantic markup macros fit, it can also be used for technical terms and placeholders, except that for syntax elements, .Ic \&Sy and .Ic \&Ar are preferred, respectively. .Pp Examples: .Bd -literal -compact -offset indent Selected lines are those \&.Em not matching any of the specified patterns. Some of the functions use a \&.Em hold space to save the pattern space for subsequent retrieval. .Ed .Pp See also .Ic \&No , .Ic \&Ql , and .Ic \&Sy . .It Ic \&En Ar word ... This macro is obsolete. Use .Ic \&Eo or any of the other enclosure macros. .Pp It encloses its argument in the delimiters specified by the last .Ic \&Es macro. .Tg Eo .It Ic \&Eo Op Ar opening_delimiter An arbitrary enclosure. The .Ar opening_delimiter argument is used as the enclosure head, for example, specifying \e(lq will emulate .Ic \&Do . .Tg Er .It Ic \&Er Ar identifier ... Error constants for definitions of the .Va errno libc global variable. This is most often used in section 2 and 3 manual pages. .Pp Examples: .Dl \&.Er EPERM .Dl \&.Er ENOENT .Pp See also .Ic \&Dv for general constants. .It Ic \&Es Ar opening_delimiter closing_delimiter This macro is obsolete. Use .Ic \&Eo or any of the other enclosure macros. .Pp It takes two arguments, defining the delimiters to be used by subsequent .Ic \&En macros. .Tg Ev .It Ic \&Ev Ar identifier ... Environmental variables such as those specified in .Xr environ 7 . .Pp Examples: .Dl \&.Ev DISPLAY .Dl \&.Ev PATH .Pp See also .Ic \&Dv for general constants. .Tg Ex .It Ic \&Ex Fl std Op Ar utility ... Insert a standard sentence regarding command exit values of 0 on success and >0 on failure. This is most often used in section 1, 6, and 8 manual pages. .Pp If .Ar utility is not specified, the document's name set by .Ic \&Nm is used. Multiple .Ar utility arguments are treated as separate utilities. .Pp See also .Ic \&Rv . .Tg Fa .It Ic \&Fa Ar argument ... Function argument or parameter. Each argument may be a name and a type (recommended for the .Em SYNOPSIS section), a name alone (for function invocations), or a type alone (for function prototypes). If both a type and a name are given or if the type consists of multiple words, all words belonging to the same function argument have to be given in a single argument to the .Ic \&Fa macro. .Pp This macro is also used to specify the field name of a structure. .Pp Most often, the .Ic \&Fa macro is used in the .Em SYNOPSIS within .Ic \&Fo blocks when documenting multi-line function prototypes. If invoked with multiple arguments, the arguments are separated by a comma. Furthermore, if the following macro is another .Ic \&Fa , the last argument will also have a trailing comma. .Pp Examples: .Dl \&.Fa \(dqconst char *p\(dq .Dl \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq .Dl \&.Fa \(dqchar *\(dq size_t .Pp See also .Ic \&Fo . .It Ic \&Fc End a function context started by .Ic \&Fo . .Tg Fd .It Ic \&Fd Pf # Ar directive Op Ar argument ... Preprocessor directive, in particular for listing it in the .Em SYNOPSIS . Historically, it was also used to document include files. The latter usage has been deprecated in favour of .Ic \&In . .Pp Examples: .Dl \&.Fd #define sa_handler __sigaction_u.__sa_handler .Dl \&.Fd #define SIO_MAXNFDS .Dl \&.Fd #ifdef FS_DEBUG .Dl \&.Ft void .Dl \&.Fn dbg_open \(dqconst char *\(dq .Dl \&.Fd #endif .Pp See also .Sx MANUAL STRUCTURE , .Ic \&In , and .Ic \&Dv . .Tg Fl .It Ic \&Fl Op Ar word ... Command-line flag or option. Used when listing arguments to command-line utilities. For each argument, prints an ASCII hyphen-minus character .Sq \- , immediately followed by the argument. If no arguments are provided, a hyphen-minus is printed followed by a space. If the argument is a macro, a hyphen-minus is prefixed to the subsequent macro output. .Pp Examples: .Dl ".Nm du Op Fl H | L | P" .Dl ".Nm ls Op Fl 1AaCcdFfgHhikLlmnopqRrSsTtux" .Dl ".Nm route Cm add Fl inet Ar destination gateway" .Dl ".Nm locate.updatedb Op Fl \e-fcodes Ns = Ns Ar dbfile" .Dl ".Nm aucat Fl o Fl" .Dl ".Nm kill Fl Ar signal_number" .Pp For GNU-sytle long options, escaping the additional hyphen-minus is not strictly required, but may be safer with future versions of GNU troff; see .Xr mandoc_char 7 for details. .Pp See also .Ic \&Cm . .Tg Fn .It Ic \&Fn Ar funcname Op Ar argument ... A function name. .Pp Function arguments are surrounded in parenthesis and are delimited by commas. If no arguments are specified, blank parenthesis are output. In the .Em SYNOPSIS section, this macro starts a new output line, and a blank line is automatically inserted between function definitions. .Pp Examples: .Dl \&.Fn \(dqint funcname\(dq \(dqint arg0\(dq \(dqint arg1\(dq .Dl \&.Fn funcname \(dqint arg0\(dq .Dl \&.Fn funcname arg0 .Bd -literal -offset indent \&.Ft functype \&.Fn funcname .Ed .Pp When referring to a function documented in another manual page, use .Ic \&Xr instead. See also .Sx MANUAL STRUCTURE , .Ic \&Fo , and .Ic \&Ft . .Tg Fo .It Ic \&Fo Ar funcname Begin a function block. This is a multi-line version of .Ic \&Fn . .Pp Invocations usually occur in the following context: .Bd -ragged -offset indent .Pf \. Ic \&Ft Ar functype .br .Pf \. Ic \&Fo Ar funcname .br .Pf \. Ic \&Fa Qq Ar argtype Ar argname .br \&.\.\. .br .Pf \. Ic \&Fc .Ed .Pp A .Ic \&Fo scope is closed by .Ic \&Fc . .Pp See also .Sx MANUAL STRUCTURE , .Ic \&Fa , .Ic \&Fc , and .Ic \&Ft . .It Ic \&Fr Ar number This macro is obsolete. No replacement markup is needed. .Pp It was used to show numerical function return values in an italic font. .Tg Ft .It Ic \&Ft Ar functype A function type. .Pp In the .Em SYNOPSIS section, a new output line is started after this macro. .Pp Examples: .Dl \&.Ft int .Bd -literal -offset indent -compact \&.Ft functype \&.Fn funcname .Ed .Pp See also .Sx MANUAL STRUCTURE , .Ic \&Fn , and .Ic \&Fo . .Tg Fx .It Ic \&Fx Op Ar version Format the .Fx version provided as an argument, or a default value if no argument is provided. .Pp Examples: .Dl \&.Fx 7.1 .Dl \&.Fx .Pp See also .Ic \&At , .Ic \&Bsx , .Ic \&Bx , .Ic \&Dx , .Ic \&Nx , and .Ic \&Ox . .It Ic \&Hf Ar filename This macro is not implemented in .Xr mandoc 1 . It was used to include the contents of a (header) file literally. .Tg Ic .It Ic \&Ic Ar keyword ... Internal or interactive command, or configuration instruction in a configuration file. See also .Ic \&Cm . .Pp Examples: .Dl \&.Ic :wq .Dl \&.Ic hash .Dl \&.Ic alias .Pp Note that using .Ic \&Ql , .Ic \&Dl , or .Ic \&Bd Fl literal is preferred for displaying code samples; the .Ic \&Ic macro is used when referring to an individual command name. .Tg In .It Ic \&In Ar filename The name of an include file. This macro is most often used in section 2, 3, and 9 manual pages. .Pp When invoked as the first macro on an input line in the .Em SYNOPSIS section, the argument is displayed in angle brackets and preceded by .Qq #include , and a blank line is inserted in front if there is a preceding function declaration. In other sections, it only encloses its argument in angle brackets and causes no line break. .Pp Examples: .Dl \&.In sys/types.h .Pp See also .Sx MANUAL STRUCTURE . .Tg It .It Ic \&It Op Ar head A list item. The syntax of this macro depends on the list type. .Pp Lists of type .Fl hang , .Fl ohang , .Fl inset , and .Fl diag have the following syntax: .Pp .D1 Pf \. Ic \&It Ar args .Pp Lists of type .Fl bullet , .Fl dash , .Fl enum , .Fl hyphen and .Fl item have the following syntax: .Pp .D1 Pf \. Ic \&It .Pp with subsequent lines interpreted within the scope of the .Ic \&It until either a closing .Ic \&El or another .Ic \&It . .Pp The .Fl tag list has the following syntax: .Pp .D1 Pf \. Ic \&It Op Cm args .Pp Subsequent lines are interpreted as with .Fl bullet and family. The line arguments correspond to the list's left-hand side; body arguments correspond to the list's contents. .Pp The .Fl column list is the most complicated. Its syntax is as follows: .Pp .D1 Pf \. Ic \&It Ar cell Op Ic \&Ta Ar cell ... .D1 Pf \. Ic \&It Ar cell Op <TAB> Ar cell ... .Pp The arguments consist of one or more lines of text and macros representing a complete table line. Cells within the line are delimited by the special .Ic \&Ta block macro or by literal tab characters. .Pp Using literal tabs is strongly discouraged because they are very hard to use correctly and .Nm code using them is very hard to read. In particular, a blank character is syntactically significant before and after the literal tab character. If a word precedes or follows the tab without an intervening blank, that word is never interpreted as a macro call, but always output literally. .Pp The tab cell delimiter may only be used within the .Ic \&It line itself; on following lines, only the .Ic \&Ta macro can be used to delimit cells, and portability requires that .Ic \&Ta is called by other macros: some parsers do not recognize it when it appears as the first macro on a line. .Pp Note that quoted strings may span tab-delimited cells on an .Ic \&It line. For example, .Pp .Dl .It \(dqcol1 ,\& <TAB> col2 ,\(dq \&; .Pp will preserve the whitespace before both commas, but not the whitespace before the semicolon. .Pp See also .Ic \&Bl . .Tg Lb .It Ic \&Lb Cm lib Ns Ar name Specify a library. .Pp The .Ar name parameter may be a system library, such as .Cm z or .Cm pam , in which case a small library description is printed next to the linker invocation; or a custom library, in which case the library name is printed in quotes. This is most commonly used in the .Em SYNOPSIS section as described in .Sx MANUAL STRUCTURE . .Pp Examples: .Dl \&.Lb libz .Dl \&.Lb libmandoc .Tg Li .It Ic \&Li Ar word ... Request a typewriter (literal) font. Deprecated because on terminal output devices, this is usually indistinguishable from normal text. For literal displays, use .Ic \&Ql Pq in-line , .Ic \&Dl Pq single line , or .Ic \&Bd Fl literal Pq multi-line instead. .Tg Lk .It Ic \&Lk Ar uri Op Ar display_name Format a hyperlink. .Pp Examples: .Dl \&.Lk https://bsd.lv \(dqThe BSD.lv Project\(dq .Dl \&.Lk https://bsd.lv .Pp See also .Ic \&Mt . .It Ic \&Lp Deprecated synonym for .Ic \&Pp . .Tg Ms .It Ic \&Ms Ar name Display a mathematical symbol. .Pp Examples: .Dl \&.Ms sigma .Dl \&.Ms aleph .Tg Mt .It Ic \&Mt Ar localpart Ns @ Ns Ar domain Format a .Dq mailto: hyperlink. .Pp Examples: .Dl \&.Mt discuss@manpages.bsd.lv .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv .Tg Nd .It Ic \&Nd Ar line A one line description of the manual's content. This is the mandatory last macro of the .Em NAME section and not appropriate for other sections. .Pp Examples: .Dl Pf . Ic \&Nd mdoc language reference .Dl Pf . Ic \&Nd format and display UNIX manuals .Pp The .Ic \&Nd macro technically accepts child macros and terminates with a subsequent .Ic \&Sh invocation. Do not assume this behaviour: some .Xr whatis 1 database generators are not smart enough to parse more than the line arguments and will display macros verbatim. .Pp See also .Ic \&Nm . .Tg Nm .It Ic \&Nm Op Ar name The name of the manual page, or \(em in particular in section 1, 6, and 8 pages \(em of an additional command or feature documented in the manual page. When first invoked, the .Ic \&Nm macro expects a single argument, the name of the manual page. Usually, the first invocation happens in the .Em NAME section of the page. The specified name will be remembered and used whenever the macro is called again without arguments later in the page. The .Ic \&Nm macro uses .Sx Block full-implicit semantics when invoked as the first macro on an input line in the .Em SYNOPSIS section; otherwise, it uses ordinary .Sx In-line semantics. .Pp Examples: .Bd -literal -offset indent \&.Sh SYNOPSIS \&.Nm cat \&.Op Fl benstuv \&.Op Ar .Ed .Pp In the .Em SYNOPSIS of section 2, 3 and 9 manual pages, use the .Ic \&Fn macro rather than .Ic \&Nm to mark up the name of the manual page. .Tg No .It Ic \&No Ar word ... Normal text. Closes the scope of any preceding in-line macro. When used after physical formatting macros like .Ic \&Em or .Ic \&Sy , switches back to the standard font face and weight. Can also be used to embed plain text strings in macro lines using semantic annotation macros. .Pp Examples: .Dl ".Em italic , Sy bold , No and roman" .Bd -literal -offset indent \&.Sm off \&.Cm :C No / Ar pattern No / Ar replacement No / \&.Sm on .Ed .Pp See also .Ic \&Em , .Ic \&Ql , and .Ic \&Sy . .Tg Ns .It Ic \&Ns Suppress a space between the output of the preceding macro and the following text or macro. Following invocation, input is interpreted as normal text just like after an .Ic \&No macro. .Pp This has no effect when invoked at the start of a macro line. .Pp Examples: .Dl ".Ar name Ns = Ns Ar value" .Dl ".Cm :M Ns Ar pattern" .Dl ".Fl o Ns Ar output" .Pp See also .Ic \&No and .Ic \&Sm . .Tg Nx .It Ic \&Nx Op Ar version Format the .Nx version provided as an argument, or a default value if no argument is provided. .Pp Examples: .Dl \&.Nx 5.01 .Dl \&.Nx .Pp See also .Ic \&At , .Ic \&Bsx , .Ic \&Bx , .Ic \&Dx , .Ic \&Fx , and .Ic \&Ox . .It Ic \&Oc Close multi-line .Ic \&Oo context. .It Ic \&Oo Ar block Multi-line version of .Ic \&Op . .Pp Examples: .Bd -literal -offset indent -compact \&.Oo \&.Op Fl flag Ns Ar value \&.Oc .Ed .Tg Op .It Ic \&Op Ar line Optional part of a command line. Prints the argument(s) in brackets. This is most often used in the .Em SYNOPSIS section of section 1 and 8 manual pages. .Pp Examples: .Dl \&.Op \&Fl a \&Ar b .Dl \&.Op \&Ar a | b .Pp See also .Ic \&Oo . .Tg Os .It Ic \&Os Op Ar system Op Ar version Operating system version for display in the page footer. This is the mandatory third macro of any .Nm file. .Pp The optional .Ar system parameter specifies the relevant operating system or environment. It is suggested to leave it unspecified, in which case .Xr mandoc 1 uses its .Fl Ios argument or, if that isn't specified either, .Fa sysname and .Fa release as returned by .Xr uname 3 . .Pp Examples: .Dl \&.Os .Dl \&.Os KTH/CSC/TCS .Dl \&.Os BSD 4.3 .Pp See also .Ic \&Dd and .Ic \&Dt . .It Ic \&Ot Ar functype This macro is obsolete. Use .Ic \&Ft instead; with .Xr mandoc 1 , both have the same effect. .Pp Historical .Nm packages described it as .Dq "old function type (FORTRAN)" . .Tg Ox .It Ic \&Ox Op Ar version Format the .Ox version provided as an argument, or a default value if no argument is provided. .Pp Examples: .Dl \&.Ox 4.5 .Dl \&.Ox .Pp See also .Ic \&At , .Ic \&Bsx , .Ic \&Bx , .Ic \&Dx , .Ic \&Fx , and .Ic \&Nx . .Tg Pa .It Ic \&Pa Ar name ... An absolute or relative file system path, or a file or directory name. If an argument is not provided, the character .Sq \(ti is used as a default. .Pp Examples: .Dl \&.Pa /usr/bin/mandoc .Dl \&.Pa /usr/share/man/man7/mdoc.7 .Pp See also .Ic \&Lk . .It Ic \&Pc Close parenthesised context opened by .Ic \&Po . .Tg Pf .It Ic \&Pf Ar prefix macro Op Ar argument ... Removes the space between its argument and the following macro. It is equivalent to: .Pp .D1 Ic \&No Pf \e& Ar prefix Ic \&Ns Ar macro Op Ar argument ... .Pp The .Ar prefix argument is not parsed for macro names or delimiters, but used verbatim as if it were escaped. .Pp Examples: .Dl ".Pf $ Ar variable_name" .Dl ".Pf . Ar macro_name" .Dl ".Pf 0x Ar hex_digits" .Pp See also .Ic \&Ns and .Ic \&Sm . .It Ic \&Po Ar block Multi-line version of .Ic \&Pq . .Tg Pp .It Ic \&Pp Break a paragraph. This will assert vertical space between prior and subsequent macros and/or text. .Pp Paragraph breaks are not needed before or after .Ic \&Sh or .Ic \&Ss macros or before displays .Pq Ic \&Bd Ar line or lists .Pq Ic \&Bl unless the .Fl compact flag is given. .Tg Pq .It Ic \&Pq Ar line Parenthesised enclosure. .Pp See also .Ic \&Po . .It Ic \&Qc Close quoted context opened by .Ic \&Qo . .Tg Ql .It Ic \&Ql Ar line In-line literal display. This can be used for complete command invocations and for multi-word code examples when an indented display is not desired. .Pp See also .Ic \&Dl and .Ic \&Bd .Fl literal . .It Ic \&Qo Ar block Multi-line version of .Ic \&Qq . .Tg Qq .It Ic \&Qq Ar line Encloses its arguments in .Qq typewriter double-quotes. Consider using .Ic \&Dq . .Pp See also .Ic \&Dq , .Ic \&Sq , and .Ic \&Qo . .It Ic \&Re Close an .Ic \&Rs block. Does not have any tail arguments. .Tg Rs .It Ic \&Rs Begin a bibliographic .Pq Dq reference block. Does not have any head arguments. The block macro may only contain .Ic \&%A , .Ic \&%B , .Ic \&%C , .Ic \&%D , .Ic \&%I , .Ic \&%J , .Ic \&%N , .Ic \&%O , .Ic \&%P , .Ic \&%Q , .Ic \&%R , .Ic \&%T , .Ic \&%U , and .Ic \&%V child macros (at least one must be specified). .Pp Examples: .Bd -literal -offset indent -compact \&.Rs \&.%A J. E. Hopcroft \&.%A J. D. Ullman \&.%B Introduction to Automata Theory, Languages, and Computation \&.%I Addison-Wesley \&.%C Reading, Massachusetts \&.%D 1979 \&.Re .Ed .Pp If an .Ic \&Rs block is used within a SEE ALSO section, a vertical space is asserted before the rendered output, else the block continues on the current line. .Tg Rv .It Ic \&Rv Fl std Op Ar function ... Insert a standard sentence regarding a function call's return value of 0 on success and \-1 on error, with the .Va errno libc global variable set on error. .Pp If .Ar function is not specified, the document's name set by .Ic \&Nm is used. Multiple .Ar function arguments are treated as separate functions. .Pp See also .Ic \&Ex . .It Ic \&Sc Close single-quoted context opened by .Ic \&So . .Tg Sh .It Ic \&Sh Ar TITLE LINE Begin a new section. For a list of conventional manual sections, see .Sx MANUAL STRUCTURE . These sections should be used unless it's absolutely necessary that custom sections be used. .Pp Section names should be unique so that they may be keyed by .Ic \&Sx . Although this macro is parsed, it should not consist of child node or it may not be linked with .Ic \&Sx . .Pp See also .Ic \&Pp , .Ic \&Ss , and .Ic \&Sx . .Tg Sm .It Ic \&Sm Op Cm on | off Switches the spacing mode for output generated from macros. .Pp By default, spacing is .Cm on . When switched .Cm off , no white space is inserted between macro arguments and between the output generated from adjacent macros, but text lines still get normal spacing between words and sentences. .Pp When called without an argument, the .Ic \&Sm macro toggles the spacing mode. Using this is not recommended because it makes the code harder to read. .It Ic \&So Ar block Multi-line version of .Ic \&Sq . .Tg Sq .It Ic \&Sq Ar line Encloses its arguments in .Sq typewriter single-quotes. .Pp See also .Ic \&Dq , .Ic \&Qq , and .Ic \&So . .Tg Ss .It Ic \&Ss Ar Title line Begin a new subsection. Unlike with .Ic \&Sh , there is no convention for the naming of subsections. Except .Em DESCRIPTION , the conventional sections described in .Sx MANUAL STRUCTURE rarely have subsections. .Pp Sub-section names should be unique so that they may be keyed by .Ic \&Sx . Although this macro is parsed, it should not consist of child node or it may not be linked with .Ic \&Sx . .Pp See also .Ic \&Pp , .Ic \&Sh , and .Ic \&Sx . .Tg St .It Ic \&St Fl Ns Ar abbreviation Replace an abbreviation for a standard with the full form. The following standards are recognised. Where multiple lines are given without a blank line in between, they all refer to the same standard, and using the first form is recommended. .Bl -tag -width 1n .It C language standards .Pp .Bl -tag -width "-p1003.1g-2000" -compact .It \-ansiC .St -ansiC .It \-ansiC-89 .St -ansiC-89 .It \-isoC .St -isoC .It \-isoC-90 .St -isoC-90 .br The original C standard. .Pp .It \-isoC-amd1 .St -isoC-amd1 .Pp .It \-isoC-tcor1 .St -isoC-tcor1 .Pp .It \-isoC-tcor2 .St -isoC-tcor2 .Pp .It \-isoC-99 .St -isoC-99 .br The second major version of the C language standard. .Pp .It \-isoC-2011 .St -isoC-2011 .br The third major version of the C language standard. .El .It POSIX.1 before the Single UNIX Specification .Pp .Bl -tag -width "-p1003.1g-2000" -compact .It \-p1003.1-88 .St -p1003.1-88 .It \-p1003.1 .St -p1003.1 .br The original POSIX standard, based on ANSI C. .Pp .It \-p1003.1-90 .St -p1003.1-90 .It \-iso9945-1-90 .St -iso9945-1-90 .br The first update of POSIX.1. .Pp .It \-p1003.1b-93 .St -p1003.1b-93 .It \-p1003.1b .St -p1003.1b .br Real-time extensions. .Pp .It \-p1003.1c-95 .St -p1003.1c-95 .br POSIX thread interfaces. .Pp .It \-p1003.1i-95 .St -p1003.1i-95 .br Technical Corrigendum. .Pp .It \-p1003.1-96 .St -p1003.1-96 .It \-iso9945-1-96 .St -iso9945-1-96 .br Includes POSIX.1-1990, 1b, 1c, and 1i. .El .It X/Open Portability Guide version 4 and related standards .Pp .Bl -tag -width "-p1003.1g-2000" -compact .It \-xpg3 .St -xpg3 .br An XPG4 precursor, published in 1989. .Pp .It \-p1003.2 .St -p1003.2 .It \-p1003.2-92 .St -p1003.2-92 .It \-iso9945-2-93 .St -iso9945-2-93 .br An XCU4 precursor. .Pp .It \-p1003.2a-92 .St -p1003.2a-92 .br Updates to POSIX.2. .Pp .It \-xpg4 .St -xpg4 .br Based on POSIX.1 and POSIX.2, published in 1992. .El .It Single UNIX Specification version 1 and related standards .Pp .Bl -tag -width "-p1003.1g-2000" -compact .It \-susv1 .St -susv1 .It \-xpg4.2 .St -xpg4.2 .br This standard was published in 1994. It was used as the basis for UNIX 95 certification. The following three refer to parts of it. .Pp .It \-xsh4.2 .St -xsh4.2 .Pp .It \-xcurses4.2 .St -xcurses4.2 .Pp .It \-p1003.1g-2000 .St -p1003.1g-2000 .br Networking APIs, including sockets. .Pp .It \-svid4 .St -svid4 , .br Published in 1995. .El .It Single UNIX Specification version 2 and related standards .Pp .Bl -tag -width "-p1003.1g-2000" -compact .It \-susv2 .St -susv2 This Standard was published in 1997 and is also called X/Open Portability Guide version 5. It was used as the basis for UNIX 98 certification. The following refer to parts of it. .Pp .It \-xbd5 .St -xbd5 .Pp .It \-xsh5 .St -xsh5 .Pp .It \-xcu5 .St -xcu5 .Pp .It \-xns5 .St -xns5 .It \-xns5.2 .St -xns5.2 .El .It Single UNIX Specification version 3 .Pp .Bl -tag -width "-p1003.1-2001" -compact .It \-p1003.1-2001 .St -p1003.1-2001 .It \-susv3 .St -susv3 .br This standard is based on C99, SUSv2, POSIX.1-1996, 1d, and 1j. It is also called X/Open Portability Guide version 6. It is used as the basis for UNIX 03 certification. .Pp .It \-p1003.1-2004 .St -p1003.1-2004 .br The second and last Technical Corrigendum. .El .It Single UNIX Specification version 4 .Pp .Bl -tag -width "-p1003.1g-2000" -compact .It \-p1003.1-2008 .St -p1003.1-2008 .It \-susv4 .St -susv4 .br This standard is also called X/Open Portability Guide version 7. .El .It Other standards .Pp .Bl -tag -width "-p1003.1g-2000" -compact .It \-ieee754 .St -ieee754 .br Floating-point arithmetic. .Pp .It \-iso8601 .St -iso8601 .br Representation of dates and times, published in 1988. .Pp .It \-iso8802-3 .St -iso8802-3 .br Ethernet local area networks. .Pp .It \-ieee1275-94 .St -ieee1275-94 .El .El .Tg Sx .It Ic \&Sx Ar Title line Reference a section or subsection in the same manual page. The referenced section or subsection name must be identical to the enclosed argument, including whitespace. .Pp Examples: .Dl \&.Sx MANUAL STRUCTURE .Pp See also .Ic \&Sh and .Ic \&Ss . .Tg Sy .It Ic \&Sy Ar word ... Request a boldface font. .Pp This is most often used to indicate importance or seriousness (not to be confused with stress emphasis, see .Ic \&Em ) . When none of the semantic macros fit, it is also adequate for syntax elements that have to be given or that appear verbatim. .Pp Examples: .Bd -literal -compact -offset indent \&.Sy Warning : If \&.Sy s appears in the owner permissions, set-user-ID mode is set. This utility replaces the former \&.Sy dumpdir program. .Ed .Pp See also .Ic \&Em , .Ic \&No , and .Ic \&Ql . .Tg Ta .It Ic \&Ta Table cell separator in .Ic \&Bl Fl column lists; can only be used below .Ic \&It . .Tg Tg .It Ic \&Tg Op Ar term Announce that the next input line starts a definition of the .Ar term . This macro must appear alone on its own input line. The argument defaults to the first argument of the first macro on the next line. The argument may not contain whitespace characters, not even when it is quoted. This macro is a .Xr mandoc 1 extension and is typically ignored by other formatters. .Pp When viewing terminal output with .Xr less 1 , the interactive .Ic :t command can be used to go to the definition of the .Ar term as described for the .Ev MANPAGER variable in .Xr man 1 ; when producing HTML output, a fragment identifier .Pq Ic id No attribute is generated, to be used for deep linking to this place of the document. .Pp In most cases, adding a .Ic \&Tg macro would be redundant because .Xr mandoc 1 is able to automatically tag most definitions. This macro is intended for cases where automatic tagging of a .Ar term is unsatisfactory, for example if a definition is not tagged automatically (false negative) or if places are tagged that do not define the .Ar term (false positives). When there is at least one .Ic \&Tg macro for a .Ar term , no other places are automatically marked as definitions of that .Ar term . .It Ic \&Tn Ar word ... Supported only for compatibility, do not use this in new manuals. Even though the macro name .Pq Dq tradename suggests a semantic function, historic usage is inconsistent, mostly using it as a presentation-level macro to request a small caps font. .It Ic \&Ud Supported only for compatibility, do not use this in new manuals. Prints out .Dq currently under development. .It Ic \&Ux Supported only for compatibility, do not use this in new manuals. Prints out .Dq Ux . .Tg Va .It Ic \&Va Oo Ar type Oc Ar identifier ... A variable name. .Pp Examples: .Dl \&.Va foo .Dl \&.Va const char *bar ; .Pp For function arguments and parameters, use .Ic \&Fa instead. For declarations of global variables in the .Em SYNOPSIS section, use .Ic \&Vt . .Tg Vt .It Ic \&Vt Ar type Op Ar identifier A variable type. .Pp This is also used for indicating global variables in the .Em SYNOPSIS section, in which case a variable name is also specified. Note that it accepts .Sx Block partial-implicit syntax when invoked as the first macro on an input line in the .Em SYNOPSIS section, else it accepts ordinary .Sx In-line syntax. In the former case, this macro starts a new output line, and a blank line is inserted in front if there is a preceding function definition or include directive. .Pp Examples: .Dl \&.Vt unsigned char .Dl \&.Vt extern const char * const sys_signame[] \&; .Pp For parameters in function prototypes, use .Ic \&Fa instead, for function return types .Ic \&Ft , and for variable names outside the .Em SYNOPSIS section .Ic \&Va , even when including a type with the name. See also .Sx MANUAL STRUCTURE . .It Ic \&Xc Close a scope opened by .Ic \&Xo . .It Ic \&Xo Ar block Extend the header of an .Ic \&It macro or the body of a partial-implicit block macro beyond the end of the input line. This macro originally existed to work around the 9-argument limit of historic .Xr roff 7 . .Tg Xr .It Ic \&Xr Ar name section Link to another manual .Pq Qq cross-reference . .Pp Cross reference the .Ar name and .Ar section number of another man page. .Pp Examples: .Dl \&.Xr mandoc 1 .Dl \&.Xr mandoc 1 \&; .Dl \&.Xr mandoc 1 \&Ns s behaviour .El .Sh MACRO SYNTAX The syntax of a macro depends on its classification. In this section, .Sq \-arg refers to macro arguments, which may be followed by zero or more .Sq parm parameters; .Sq \&Yo opens the scope of a macro; and if specified, .Sq \&Yc closes it out. .Pp The .Em Callable column indicates that the macro may also be called by passing its name as an argument to another macro. For example, .Sq \&.Op \&Fl O \&Ar file produces .Sq Op Fl O Ar file . To prevent a macro call and render the macro name literally, escape it by prepending a zero-width space, .Sq \e& . For example, .Sq \&Op \e&Fl O produces .Sq Op \&Fl O . If a macro is not callable but its name appears as an argument to another macro, it is interpreted as opaque text. For example, .Sq \&.Fl \&Sh produces .Sq Fl \&Sh . .Pp The .Em Parsed column indicates whether the macro may call other macros by receiving their names as arguments. If a macro is not parsed but the name of another macro appears as an argument, it is interpreted as opaque text. .Pp The .Em Scope column, if applicable, describes closure rules. .Ss Block full-explicit Multi-line scope closed by an explicit closing macro. All macros contains bodies; only .Ic \&Bf and .Pq optionally .Ic \&Bl contain a head. .Bd -literal -offset indent \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \(lBbody...\(rB \&.Yc .Ed .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXX" -offset indent .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope .It Ic \&Bd Ta \&No Ta \&No Ta closed by Ic \&Ed .It Ic \&Bf Ta \&No Ta \&No Ta closed by Ic \&Ef .It Ic \&Bk Ta \&No Ta \&No Ta closed by Ic \&Ek .It Ic \&Bl Ta \&No Ta \&No Ta closed by Ic \&El .It Ic \&Ed Ta \&No Ta \&No Ta opened by Ic \&Bd .It Ic \&Ef Ta \&No Ta \&No Ta opened by Ic \&Bf .It Ic \&Ek Ta \&No Ta \&No Ta opened by Ic \&Bk .It Ic \&El Ta \&No Ta \&No Ta opened by Ic \&Bl .El .Ss Block full-implicit Multi-line scope closed by end-of-file or implicitly by another macro. All macros have bodies; some .Po .Ic \&It Fl bullet , .Fl hyphen , .Fl dash , .Fl enum , .Fl item .Pc don't have heads; only one .Po .Ic \&It in .Ic \&Bl Fl column .Pc has multiple heads. .Bd -literal -offset indent \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB \(lBbody...\(rB .Ed .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX" -offset indent .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope .It Ic \&It Ta \&No Ta Yes Ta closed by Ic \&It , Ic \&El .It Ic \&Nd Ta \&No Ta \&No Ta closed by Ic \&Sh .It Ic \&Nm Ta \&No Ta Yes Ta closed by Ic \&Nm , Ic \&Sh , Ic \&Ss .It Ic \&Sh Ta \&No Ta Yes Ta closed by Ic \&Sh .It Ic \&Ss Ta \&No Ta Yes Ta closed by Ic \&Sh , Ic \&Ss .El .Pp Note that the .Ic \&Nm macro is a .Sx Block full-implicit macro only when invoked as the first macro in a .Em SYNOPSIS section line, else it is .Sx In-line . .Ss Block partial-explicit Like block full-explicit, but also with single-line scope. Each has at least a body and, in limited circumstances, a head .Po .Ic \&Fo , .Ic \&Eo .Pc and/or tail .Pq Ic \&Ec . .Bd -literal -offset indent \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \(lBbody...\(rB \&.Yc \(lBtail...\(rB \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \ \(lBbody...\(rB \&Yc \(lBtail...\(rB .Ed .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope .It Ic \&Ac Ta Yes Ta Yes Ta opened by Ic \&Ao .It Ic \&Ao Ta Yes Ta Yes Ta closed by Ic \&Ac .It Ic \&Bc Ta Yes Ta Yes Ta closed by Ic \&Bo .It Ic \&Bo Ta Yes Ta Yes Ta opened by Ic \&Bc .It Ic \&Brc Ta Yes Ta Yes Ta opened by Ic \&Bro .It Ic \&Bro Ta Yes Ta Yes Ta closed by Ic \&Brc .It Ic \&Dc Ta Yes Ta Yes Ta opened by Ic \&Do .It Ic \&Do Ta Yes Ta Yes Ta closed by Ic \&Dc .It Ic \&Ec Ta Yes Ta Yes Ta opened by Ic \&Eo .It Ic \&Eo Ta Yes Ta Yes Ta closed by Ic \&Ec .It Ic \&Fc Ta Yes Ta Yes Ta opened by Ic \&Fo .It Ic \&Fo Ta \&No Ta \&No Ta closed by Ic \&Fc .It Ic \&Oc Ta Yes Ta Yes Ta closed by Ic \&Oo .It Ic \&Oo Ta Yes Ta Yes Ta opened by Ic \&Oc .It Ic \&Pc Ta Yes Ta Yes Ta closed by Ic \&Po .It Ic \&Po Ta Yes Ta Yes Ta opened by Ic \&Pc .It Ic \&Qc Ta Yes Ta Yes Ta opened by Ic \&Oo .It Ic \&Qo Ta Yes Ta Yes Ta closed by Ic \&Oc .It Ic \&Re Ta \&No Ta \&No Ta opened by Ic \&Rs .It Ic \&Rs Ta \&No Ta \&No Ta closed by Ic \&Re .It Ic \&Sc Ta Yes Ta Yes Ta opened by Ic \&So .It Ic \&So Ta Yes Ta Yes Ta closed by Ic \&Sc .It Ic \&Xc Ta Yes Ta Yes Ta opened by Ic \&Xo .It Ic \&Xo Ta Yes Ta Yes Ta closed by Ic \&Xc .El .Ss Block partial-implicit Like block full-implicit, but with single-line scope closed by the end of the line. .Bd -literal -offset indent \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB .Ed .Bl -column "MacroX" "CallableX" "ParsedX" -offset indent .It Em Macro Ta Em Callable Ta Em Parsed .It Ic \&Aq Ta Yes Ta Yes .It Ic \&Bq Ta Yes Ta Yes .It Ic \&Brq Ta Yes Ta Yes .It Ic \&D1 Ta \&No Ta \&Yes .It Ic \&Dl Ta \&No Ta Yes .It Ic \&Dq Ta Yes Ta Yes .It Ic \&En Ta Yes Ta Yes .It Ic \&Op Ta Yes Ta Yes .It Ic \&Pq Ta Yes Ta Yes .It Ic \&Ql Ta Yes Ta Yes .It Ic \&Qq Ta Yes Ta Yes .It Ic \&Sq Ta Yes Ta Yes .It Ic \&Vt Ta Yes Ta Yes .El .Pp Note that the .Ic \&Vt macro is a .Sx Block partial-implicit only when invoked as the first macro in a .Em SYNOPSIS section line, else it is .Sx In-line . .Ss Special block macro The .Ic \&Ta macro can only be used below .Ic \&It in .Ic \&Bl Fl column lists. It delimits blocks representing table cells; these blocks have bodies, but no heads. .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope .It Ic \&Ta Ta Yes Ta Yes Ta closed by Ic \&Ta , Ic \&It .El .Ss In-line Closed by the end of the line, fixed argument lengths, and/or subsequent macros. In-line macros have only text children. If a number (or inequality) of arguments is .Pq n , then the macro accepts an arbitrary number of arguments. .Bd -literal -offset indent \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc... \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN .Ed .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -offset indent .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments .It Ic \&%A Ta \&No Ta \&No Ta >0 .It Ic \&%B Ta \&No Ta \&No Ta >0 .It Ic \&%C Ta \&No Ta \&No Ta >0 .It Ic \&%D Ta \&No Ta \&No Ta >0 .It Ic \&%I Ta \&No Ta \&No Ta >0 .It Ic \&%J Ta \&No Ta \&No Ta >0 .It Ic \&%N Ta \&No Ta \&No Ta >0 .It Ic \&%O Ta \&No Ta \&No Ta >0 .It Ic \&%P Ta \&No Ta \&No Ta >0 .It Ic \&%Q Ta \&No Ta \&No Ta >0 .It Ic \&%R Ta \&No Ta \&No Ta >0 .It Ic \&%T Ta \&No Ta \&No Ta >0 .It Ic \&%U Ta \&No Ta \&No Ta >0 .It Ic \&%V Ta \&No Ta \&No Ta >0 .It Ic \&Ad Ta Yes Ta Yes Ta >0 .It Ic \&An Ta Yes Ta Yes Ta >0 .It Ic \&Ap Ta Yes Ta Yes Ta 0 .It Ic \&Ar Ta Yes Ta Yes Ta n .It Ic \&At Ta Yes Ta Yes Ta 1 .It Ic \&Bsx Ta Yes Ta Yes Ta n .It Ic \&Bt Ta \&No Ta \&No Ta 0 .It Ic \&Bx Ta Yes Ta Yes Ta n .It Ic \&Cd Ta Yes Ta Yes Ta >0 .It Ic \&Cm Ta Yes Ta Yes Ta >0 .It Ic \&Db Ta \&No Ta \&No Ta 1 .It Ic \&Dd Ta \&No Ta \&No Ta n .It Ic \&Dt Ta \&No Ta \&No Ta n .It Ic \&Dv Ta Yes Ta Yes Ta >0 .It Ic \&Dx Ta Yes Ta Yes Ta n .It Ic \&Em Ta Yes Ta Yes Ta >0 .It Ic \&Er Ta Yes Ta Yes Ta >0 .It Ic \&Es Ta Yes Ta Yes Ta 2 .It Ic \&Ev Ta Yes Ta Yes Ta >0 .It Ic \&Ex Ta \&No Ta \&No Ta n .It Ic \&Fa Ta Yes Ta Yes Ta >0 .It Ic \&Fd Ta \&No Ta \&No Ta >0 .It Ic \&Fl Ta Yes Ta Yes Ta n .It Ic \&Fn Ta Yes Ta Yes Ta >0 .It Ic \&Fr Ta Yes Ta Yes Ta >0 .It Ic \&Ft Ta Yes Ta Yes Ta >0 .It Ic \&Fx Ta Yes Ta Yes Ta n .It Ic \&Hf Ta \&No Ta \&No Ta n .It Ic \&Ic Ta Yes Ta Yes Ta >0 .It Ic \&In Ta \&No Ta \&No Ta 1 .It Ic \&Lb Ta \&No Ta \&No Ta 1 .It Ic \&Li Ta Yes Ta Yes Ta >0 .It Ic \&Lk Ta Yes Ta Yes Ta >0 .It Ic \&Lp Ta \&No Ta \&No Ta 0 .It Ic \&Ms Ta Yes Ta Yes Ta >0 .It Ic \&Mt Ta Yes Ta Yes Ta >0 .It Ic \&Nm Ta Yes Ta Yes Ta n .It Ic \&No Ta Yes Ta Yes Ta >0 .It Ic \&Ns Ta Yes Ta Yes Ta 0 .It Ic \&Nx Ta Yes Ta Yes Ta n .It Ic \&Os Ta \&No Ta \&No Ta n .It Ic \&Ot Ta Yes Ta Yes Ta >0 .It Ic \&Ox Ta Yes Ta Yes Ta n .It Ic \&Pa Ta Yes Ta Yes Ta n .It Ic \&Pf Ta Yes Ta Yes Ta 1 .It Ic \&Pp Ta \&No Ta \&No Ta 0 .It Ic \&Rv Ta \&No Ta \&No Ta n .It Ic \&Sm Ta \&No Ta \&No Ta <2 .It Ic \&St Ta \&No Ta Yes Ta 1 .It Ic \&Sx Ta Yes Ta Yes Ta >0 .It Ic \&Sy Ta Yes Ta Yes Ta >0 .It Ic \&Tg Ta \&No Ta \&No Ta <2 .It Ic \&Tn Ta Yes Ta Yes Ta >0 .It Ic \&Ud Ta \&No Ta \&No Ta 0 .It Ic \&Ux Ta Yes Ta Yes Ta n .It Ic \&Va Ta Yes Ta Yes Ta n .It Ic \&Vt Ta Yes Ta Yes Ta >0 .It Ic \&Xr Ta Yes Ta Yes Ta 2 .El .Ss Delimiters When a macro argument consists of one single input character considered as a delimiter, the argument gets special handling. This does not apply when delimiters appear in arguments containing more than one character. Consequently, to prevent special handling and just handle it like any other argument, a delimiter can be escaped by prepending a zero-width space .Pq Sq \e& . In text lines, delimiters never need escaping, but may be used as normal punctuation. .Pp For many macros, when the leading arguments are opening delimiters, these delimiters are put before the macro scope, and when the trailing arguments are closing delimiters, these delimiters are put after the macro scope. Spacing is suppressed after opening delimiters and before closing delimiters. For example, .Pp .D1 Pf \. \&Aq "( [ word ] ) ." .Pp renders as: .Pp .D1 Aq ( [ word ] ) . .Pp Opening delimiters are: .Pp .Bl -tag -width Ds -offset indent -compact .It \&( left parenthesis .It \&[ left bracket .El .Pp Closing delimiters are: .Pp .Bl -tag -width Ds -offset indent -compact .It \&. period .It \&, comma .It \&: colon .It \&; semicolon .It \&) right parenthesis .It \&] right bracket .It \&? question mark .It \&! exclamation mark .El .Pp Note that even a period preceded by a backslash .Pq Sq \e.\& gets this special handling; use .Sq \e&.\& to prevent that. .Pp Many in-line macros interrupt their scope when they encounter delimiters, and resume their scope when more arguments follow that are not delimiters. For example, .Pp .D1 Pf \. \&Fl "a ( b | c \e*(Ba d ) e" .Pp renders as: .Pp .D1 Fl a ( b | c \*(Ba d ) e .Pp This applies to both opening and closing delimiters, and also to the middle delimiter, which does not suppress spacing: .Pp .Bl -tag -width Ds -offset indent -compact .It \&| vertical bar .El .Pp As a special case, the predefined string \e*(Ba is handled and rendered in the same way as a plain .Sq \&| character. Using this predefined string is not recommended in new manuals. .Pp Appending a zero-width space .Pq Sq \e& to the end of an input line is also useful to prevent the interpretation of a trailing period, exclamation or question mark as the end of a sentence, for example when an abbreviation happens to occur at the end of a text or macro input line. .Ss Font handling In .Nm documents, usage of semantic markup is recommended in order to have proper fonts automatically selected; only when no fitting semantic markup is available, consider falling back to .Sx Physical markup macros. Whenever any .Nm macro switches the .Xr roff 7 font mode, it will automatically restore the previous font when exiting its scope. Manually switching the font using the .Xr roff 7 .Ql \ef font escape sequences is never required. .Sh COMPATIBILITY This section provides an incomplete list of compatibility issues between mandoc and GNU troff .Pq Qq groff . .Pp The following problematic behaviour is found in groff: .Pp .Bl -dash -compact .It .Ic \&Pa does not format its arguments when used in the FILES section under certain list types. .It .Ic \&Ta can only be called by other macros, but not at the beginning of a line. .It .Sq \ef .Pq font face and .Sq \eF .Pq font family face .Sx Text Decoration escapes behave irregularly when specified within line-macro scopes. .It Negative scaling units return to prior lines. Instead, mandoc truncates them to zero. .El .Pp The following features are unimplemented in mandoc: .Pp .Bl -dash -compact .It .Ic \&Bd Fl file Ar file is unsupported for security reasons. .It .Ic \&Bd .Fl filled does not adjust the right margin, but is an alias for .Ic \&Bd .Fl ragged . .It .Ic \&Bd .Fl literal does not use a literal font, but is an alias for .Ic \&Bd .Fl unfilled . .It .Ic \&Bd .Fl offset Cm center and .Fl offset Cm right don't work. Groff does not implement centered and flush-right rendering either, but produces large indentations. .El .Sh SEE ALSO .Xr man 1 , .Xr mandoc 1 , .Xr eqn 7 , .Xr man 7 , .Xr mandoc_char 7 , .Xr roff 7 , .Xr tbl 7 .Pp The web page .Lk https://mandoc.bsd.lv/mdoc/ "extended documentation for the mdoc language" provides a few tutorial-style pages for beginners, an extensive style guide for advanced authors, and an alphabetic index helping to choose the best macros for various kinds of content. .Pp The manual page .Lk https://man.voidlinux.org/groff_mdoc "groff_mdoc(7)" contained in the .Dq groff package documents exactly the same language in a somewhat different style. .Sh HISTORY The .Nm language first appeared as a troff macro package in .Bx 4.4 . It was later significantly updated by Werner Lemberg and Ruslan Ermilov in groff-1.17. The standalone implementation that is part of the .Xr mandoc 1 utility written by Kristaps Dzonsons appeared in .Ox 4.6 . .Sh AUTHORS The .Nm reference was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/mdoc.h��������������������������������������������������������������������������������0100644�0001753�0001753�00000007725�14123140553�0014455�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: mdoc.h,v 1.146 2018/12/30 00:49:55 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct roff_node; struct roff_man; enum mdocargt { MDOC_Split, /* -split */ MDOC_Nosplit, /* -nospli */ MDOC_Ragged, /* -ragged */ MDOC_Unfilled, /* -unfilled */ MDOC_Literal, /* -literal */ MDOC_File, /* -file */ MDOC_Offset, /* -offset */ MDOC_Bullet, /* -bullet */ MDOC_Dash, /* -dash */ MDOC_Hyphen, /* -hyphen */ MDOC_Item, /* -item */ MDOC_Enum, /* -enum */ MDOC_Tag, /* -tag */ MDOC_Diag, /* -diag */ MDOC_Hang, /* -hang */ MDOC_Ohang, /* -ohang */ MDOC_Inset, /* -inset */ MDOC_Column, /* -column */ MDOC_Width, /* -width */ MDOC_Compact, /* -compact */ MDOC_Std, /* -std */ MDOC_Filled, /* -filled */ MDOC_Words, /* -words */ MDOC_Emphasis, /* -emphasis */ MDOC_Symbolic, /* -symbolic */ MDOC_Nested, /* -nested */ MDOC_Centred, /* -centered */ MDOC_ARG_MAX }; /* * An argument to a macro (multiple values = `-column xxx yyy'). */ struct mdoc_argv { enum mdocargt arg; /* type of argument */ int line; int pos; size_t sz; /* elements in "value" */ char **value; /* argument strings */ }; /* * Reference-counted macro arguments. These are refcounted because * blocks have multiple instances of the same arguments spread across * the HEAD, BODY, TAIL, and BLOCK node types. */ struct mdoc_arg { size_t argc; struct mdoc_argv *argv; unsigned int refcnt; }; enum mdoc_list { LIST__NONE = 0, LIST_bullet, /* -bullet */ LIST_column, /* -column */ LIST_dash, /* -dash */ LIST_diag, /* -diag */ LIST_enum, /* -enum */ LIST_hang, /* -hang */ LIST_hyphen, /* -hyphen */ LIST_inset, /* -inset */ LIST_item, /* -item */ LIST_ohang, /* -ohang */ LIST_tag, /* -tag */ LIST_MAX }; enum mdoc_disp { DISP__NONE = 0, DISP_centered, /* -centered */ DISP_ragged, /* -ragged */ DISP_unfilled, /* -unfilled */ DISP_filled, /* -filled */ DISP_literal /* -literal */ }; enum mdoc_auth { AUTH__NONE = 0, AUTH_split, /* -split */ AUTH_nosplit /* -nosplit */ }; enum mdoc_font { FONT__NONE = 0, FONT_Em, /* Em, -emphasis */ FONT_Li, /* Li, -literal */ FONT_Sy /* Sy, -symbolic */ }; struct mdoc_bd { const char *offs; /* -offset */ enum mdoc_disp type; /* -ragged, etc. */ int comp; /* -compact */ }; struct mdoc_bl { const char *width; /* -width */ const char *offs; /* -offset */ enum mdoc_list type; /* -tag, -enum, etc. */ int comp; /* -compact */ size_t ncols; /* -column arg count */ const char **cols; /* -column val ptr */ int count; /* -enum counter */ }; struct mdoc_bf { enum mdoc_font font; /* font */ }; struct mdoc_an { enum mdoc_auth auth; /* -split, etc. */ }; struct mdoc_rs { int quote_T; /* whether to quote %T */ }; /* * Consists of normalised node arguments. These should be used instead * of iterating through the mdoc_arg pointers of a node: defaults are * provided, etc. */ union mdoc_data { struct mdoc_an An; struct mdoc_bd Bd; struct mdoc_bf Bf; struct mdoc_bl Bl; struct roff_node *Es; struct mdoc_rs Rs; }; /* Names of macro args. Index is enum mdocargt. */ extern const char *const *mdoc_argnames; void mdoc_validate(struct roff_man *); �������������������������������������������mandoc-1.14.6/msec.in�������������������������������������������������������������������������������0100644�0001753�0001753�00000002544�14123140553�0014633�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: msec.in,v 1.8 2017/06/24 17:37:06 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * These are all possible manual-section macros and what they correspond * to when rendered as the volume title. * * Be sure to escape strings. */ LINE("1", "General Commands Manual") LINE("2", "System Calls Manual") LINE("3", "Library Functions Manual") LINE("3p", "Perl Library Manual") LINE("4", "Device Drivers Manual") LINE("5", "File Formats Manual") LINE("6", "Games Manual") LINE("7", "Miscellaneous Information Manual") LINE("8", "System Manager\'s Manual") LINE("9", "Kernel Developer\'s Manual") ������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/out.h���������������������������������������������������������������������������������0100644�0001753�0001753�00000004504�14123140553�0014332�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: out.h,v 1.34 2020/04/03 11:35:01 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Utilities for use by multiple mandoc(1) formatters. */ enum roffscale { SCALE_CM, /* centimeters (c) */ SCALE_IN, /* inches (i) */ SCALE_PC, /* pica (P) */ SCALE_PT, /* points (p) */ SCALE_EM, /* ems (m) */ SCALE_MM, /* mini-ems (M) */ SCALE_EN, /* ens (n) */ SCALE_BU, /* default horizontal (u) */ SCALE_VS, /* default vertical (v) */ SCALE_FS, /* syn. for u (f) */ SCALE_MAX }; struct roffcol { size_t width; /* width of cell */ size_t nwidth; /* max. width of number in cell */ size_t decimal; /* decimal position in cell */ size_t spacing; /* spacing after the column */ int flags; /* layout flags, see tbl_cell */ }; struct roffsu { enum roffscale unit; double scale; }; typedef size_t (*tbl_sulen)(const struct roffsu *, void *); typedef size_t (*tbl_strlen)(const char *, void *); typedef size_t (*tbl_len)(size_t, void *); struct rofftbl { tbl_sulen sulen; /* calculate scaling unit length */ tbl_strlen slen; /* calculate string length */ tbl_len len; /* produce width of empty space */ struct roffcol *cols; /* master column specifiers */ void *arg; /* passed to sulen, slen, and len */ }; #define SCALE_HS_INIT(p, v) \ do { (p)->unit = SCALE_EN; \ (p)->scale = (v); } \ while (/* CONSTCOND */ 0) struct tbl_span; const char *a2roffsu(const char *, struct roffsu *, enum roffscale); void tblcalc(struct rofftbl *, const struct tbl_span *, size_t, size_t); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/predefs.in����������������������������������������������������������������������������0100644�0001753�0001753�00000004063�14123140553�0015332�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: predefs.in,v 1.4 2012/07/18 10:39:19 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * The predefined-string translation tables. Each corresponds to a * predefined strings from (e.g.) tmac/mdoc/doc-nroff. The left-hand * side corresponds to the input sequence (\*x, \*(xx and so on). The * right-hand side is what's produced by libroff. * * XXX - C-escape strings! * XXX - update PREDEF_MAX in roff.c if adding more! */ PREDEF("Am", "&") PREDEF("Ba", "\\fR|\\fP") PREDEF("Ge", "\\(>=") PREDEF("Gt", ">") PREDEF("If", "infinity") PREDEF("Le", "\\(<=") PREDEF("Lq", "\\(lq") PREDEF("Lt", "<") PREDEF("Na", "NaN") PREDEF("Ne", "\\(!=") PREDEF("Pi", "pi") PREDEF("Pm", "\\(+-") PREDEF("Rq", "\\(rq") PREDEF("left-bracket", "[") PREDEF("left-parenthesis", "(") PREDEF("lp", "(") PREDEF("left-singlequote", "\\(oq") PREDEF("q", "\\(dq") PREDEF("quote-left", "\\(oq") PREDEF("quote-right", "\\(cq") PREDEF("R", "\\(rg") PREDEF("right-bracket", "]") PREDEF("right-parenthesis", ")") PREDEF("rp", ")") PREDEF("right-singlequote", "\\(cq") PREDEF("Tm", "(Tm)") PREDEF("Px", "POSIX") PREDEF("Ai", "ANSI") PREDEF("\'", "\\\'") PREDEF("aa", "\\(aa") PREDEF("ga", "\\(ga") PREDEF("`", "\\`") PREDEF("lq", "\\(lq") PREDEF("rq", "\\(rq") PREDEF("ua", "\\(ua") PREDEF("va", "\\(va") PREDEF("<=", "\\(<=") PREDEF(">=", "\\(>=") �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/roff.7��������������������������������������������������������������������������������0100644�0001753�0001753�00000173730�14123140553�0014406�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: roff.7,v 1.116 2021/09/18 12:23:06 schwarze Exp $ .\" .\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010-2019 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: September 18 2021 $ .Dt ROFF 7 .Os .Sh NAME .Nm roff .Nd roff language reference for mandoc .Sh DESCRIPTION The .Nm roff language is a general purpose text formatting language. Since traditional implementations of the .Xr mdoc 7 and .Xr man 7 manual formatting languages are based on it, many real-world manuals use small numbers of .Nm requests and escape sequences intermixed with their .Xr mdoc 7 or .Xr man 7 code. To properly format such manuals, the .Xr mandoc 1 utility supports a subset of .Nm requests and escapes. Even though this manual page lists all .Nm requests and escape sequences, it only contains partial information about requests not supported by .Xr mandoc 1 and about language features that do not matter for manual pages. For complete .Nm manuals, consult the .Sx SEE ALSO section. .Pp Input lines beginning with the control character .Sq \&. are parsed for requests and macros. Such lines are called .Dq request lines or .Dq macro lines , respectively. Requests change the processing state and manipulate the formatting; some macros also define the document structure and produce formatted output. The single quote .Pq Qq \(aq is accepted as an alternative control character, treated by .Xr mandoc 1 just like .Ql \&. .Pp Lines not beginning with control characters are called .Dq text lines . They provide free-form text to be printed; the formatting of the text depends on the respective processing context. .Sh LANGUAGE SYNTAX .Nm documents may contain only graphable 7-bit ASCII characters, the space character, and, in certain circumstances, the tab character. The backslash character .Sq \e indicates the start of an escape sequence, used for example for .Sx Comments and .Sx Special Characters . For a complete listing of escape sequences, consult the .Sx ESCAPE SEQUENCE REFERENCE below. .Ss Comments Text following an escaped double-quote .Sq \e\(dq , whether in a request, macro, or text line, is ignored to the end of the line. A request line beginning with a control character and comment escape .Sq \&.\e\(dq is also ignored. Furthermore, request lines with only a control character and optional trailing whitespace are stripped from input. .Pp Examples: .Bd -literal -offset indent -compact \&.\e\(dq This is a comment line. \&.\e\(dq The next line is ignored: \&. \&.Sh EXAMPLES \e\(dq This is a comment, too. \&example text \e\(dq And so is this. .Ed .Ss Special Characters Special characters are used to encode special glyphs and are rendered differently across output media. They may occur in request, macro, and text lines. Sequences begin with the escape character .Sq \e followed by either an open-parenthesis .Sq \&( for two-character sequences; an open-bracket .Sq \&[ for n-character sequences (terminated at a close-bracket .Sq \&] ) ; or a single one character sequence. .Pp Examples: .Bl -tag -width Ds -offset indent -compact .It Li \e(em Two-letter em dash escape. .It Li \ee One-letter backslash escape. .El .Pp See .Xr mandoc_char 7 for a complete list. .Ss Font Selection In .Xr mdoc 7 and .Xr man 7 documents, fonts are usually selected with macros. The .Ic \ef escape sequence and the .Ic \&ft request can be used to manually change the font, but this is not recommended in .Xr mdoc 7 documents. Such manual font changes are overridden by many subsequent macros. .Pp The following fonts are supported: .Pp .Bl -tag -width CW -offset indent -compact .It Cm B Bold font. .It Cm BI A font that is both bold and italic. .It Cm CB Bold constant width font. Same as .Cm B in terminal output. .It Cm CI Italic constant width font. Same as .Cm I in terminal output. .It Cm CR Regular constant width font. Same as .Cm R in terminal output. .It Cm CW An alias for .Cm CR . .It Cm I Italic font. .It Cm P Return to the previous font. If a macro caused a font change since the last .Ic \ef eascape sequence or .Ic \&ft request, this returns to the font before the last font change in the macro rather than to the font before the last manual font change. .It Cm R Roman font. This is the default font. .It Cm 1 An alias for .Cm R . .It Cm 2 An alias for .Cm I . .It Cm 3 An alias for .Cm B . .It Cm 4 An alias for .Cm BI . .El .Pp Examples: .Bl -tag -width Ds -offset indent -compact .It Li \efBbold\efR Write in \fBbold\fP, then switch to regular font mode. .It Li \efIitalic\efP Write in \fIitalic\fP, then return to previous font mode. .It Li \ef(BIbold italic\efP Write in \f(BIbold italic\fP, then return to previous font mode. .El .Ss Whitespace Whitespace consists of the space character. In text lines, whitespace is preserved within a line. In request and macro lines, whitespace delimits arguments and is discarded. .Pp Unescaped trailing spaces are stripped from text line input unless in a literal context. In general, trailing whitespace on any input line is discouraged for reasons of portability. In the rare case that a space character is needed at the end of an input line, it may be forced by .Sq \e\ \e& . .Pp Literal space characters can be produced in the output using escape sequences. In macro lines, they can also be included in arguments using quotation; see .Sx MACRO SYNTAX for details. .Pp Blank text lines, which may include whitespace, are only permitted within literal contexts. If the first character of a text line is a space, that line is printed with a leading newline. .Ss Scaling Widths Many requests and macros support scaled widths for their arguments. The syntax for a scaled width is .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] , where a decimal must be preceded or followed by at least one digit. .Pp The following scaling units are accepted: .Pp .Bl -tag -width Ds -offset indent -compact .It c centimetre .It i inch .It P pica (1/6 inch) .It p point (1/72 inch) .It f scale .Sq u by 65536 .It v default vertical span .It m width of rendered .Sq m .Pq em character .It n width of rendered .Sq n .Pq en character .It u default horizontal span for the terminal .It M mini-em (1/100 em) .El .Pp Using anything other than .Sq m , .Sq n , or .Sq v is necessarily non-portable across output media. See .Sx COMPATIBILITY . .Pp If a scaling unit is not provided, the numerical value is interpreted under the default rules of .Sq v for vertical spaces and .Sq u for horizontal ones. .Pp Examples: .Bl -tag -width ".Bl -tag -width 2i" -offset indent -compact .It Li \&.Bl -tag -width 2i two-inch tagged list indentation in .Xr mdoc 7 .It Li \&.HP 2i two-inch tagged list indentation in .Xr man 7 .It Li \&.sp 2v two vertical spaces .El .Ss Sentence Spacing Each sentence should terminate at the end of an input line. By doing this, a formatter will be able to apply the proper amount of spacing after the end of sentence (unescaped) period, exclamation mark, or question mark followed by zero or more non-sentence closing delimiters .Po .Sq \&) , .Sq \&] , .Sq \&' , .Sq \&" .Pc . .Pp The proper spacing is also intelligently preserved if a sentence ends at the boundary of a macro line. .Pp If an input line happens to end with a period, exclamation or question mark that isn't the end of a sentence, append a zero-width space .Pq Sq \e& . .Pp Examples: .Bd -literal -offset indent -compact Do not end sentences mid-line like this. Instead, end a sentence like this. A macro would end like this: \&.Xr mandoc 1 \&. An abbreviation at the end of an input line needs escaping, e.g.\e& like this. .Ed .Sh REQUEST SYNTAX A request or macro line consists of: .Pp .Bl -enum -compact .It the control character .Sq \&. or .Sq \(aq at the beginning of the line, .It optionally an arbitrary amount of whitespace, .It the name of the request or the macro, which is one word of arbitrary length, terminated by whitespace, .It and zero or more arguments delimited by whitespace. .El .Pp Thus, the following request lines are all equivalent: .Bd -literal -offset indent \&.ig end \&.ig end \&. ig end .Ed .Sh MACRO SYNTAX Macros are provided by the .Xr mdoc 7 and .Xr man 7 languages and can be defined by the .Ic \&de request. When called, they follow the same syntax as requests, except that macro arguments may optionally be quoted by enclosing them in double quote characters .Pq Sq \(dq . Quoted text, even if it contains whitespace or would cause a macro invocation when unquoted, is always considered literal text. Inside quoted text, pairs of double quote characters .Pq Sq Qq resolve to single double quote characters. .Pp To be recognised as the beginning of a quoted argument, the opening quote character must be preceded by a space character. A quoted argument extends to the next double quote character that is not part of a pair, or to the end of the input line, whichever comes earlier. Leaving out the terminating double quote character at the end of the line is discouraged. For clarity, if more arguments follow on the same input line, it is recommended to follow the terminating double quote character by a space character; in case the next character after the terminating double quote character is anything else, it is regarded as the beginning of the next, unquoted argument. .Pp Both in quoted and unquoted arguments, pairs of backslashes .Pq Sq \e\e resolve to single backslashes. In unquoted arguments, space characters can alternatively be included by preceding them with a backslash .Pq Sq \e\~ , but quoting is usually better for clarity. .Pp Examples: .Bl -tag -width Ds -offset indent -compact .It Li .Fn strlen \(dqconst char *s\(dq Group arguments .Qq const char *s into one function argument. If unspecified, .Qq const , .Qq char , and .Qq *s would be considered separate arguments. .It Li .Op \(dqFl a\(dq Consider .Qq \&Fl a as literal text instead of a flag macro. .El .Sh REQUEST REFERENCE The .Xr mandoc 1 .Nm parser recognises the following requests. For requests marked as "ignored" or "unsupported", any arguments are ignored, and the number of arguments is not checked. .Bl -tag -width Ds .It Ic \&ab Op Ar message Abort processing. Currently unsupported. .It Ic \&ad Op Cm b | c | l | n | r Set line adjustment mode for subsequent text. Currently ignored. .It Ic \&af Ar registername format Assign an output format to a number register. Currently ignored. .It Ic \&aln Ar newname oldname Create an alias for a number register. Currently unsupported. .It Ic \&als Ar newname oldname Create an alias for a request, string, macro, or diversion. .It Ic \&am Ar macroname Op Ar endmacro Append to a macro definition. The syntax of this request is the same as that of .Ic \&de . .It Ic \&am1 Ar macroname Op Ar endmacro Append to a macro definition, switching roff compatibility mode off during macro execution (groff extension). The syntax of this request is the same as that of .Ic \&de1 . Since .Xr mandoc 1 does not implement .Nm compatibility mode at all, it handles this request as an alias for .Ic \&am . .It Ic \&ami Ar macrostring Op Ar endstring Append to a macro definition, specifying the macro name indirectly (groff extension). The syntax of this request is the same as that of .Ic \&dei . .It Ic \&ami1 Ar macrostring Op Ar endstring Append to a macro definition, specifying the macro name indirectly and switching roff compatibility mode off during macro execution (groff extension). The syntax of this request is the same as that of .Ic \&dei1 . Since .Xr mandoc 1 does not implement .Nm compatibility mode at all, it handles this request as an alias for .Ic \&ami . .It Ic \&as Ar stringname Op Ar string Append to a user-defined string. The syntax of this request is the same as that of .Ic \&ds . If a user-defined string with the specified name does not yet exist, it is set to the empty string before appending. .It Ic \&as1 Ar stringname Op Ar string Append to a user-defined string, switching roff compatibility mode off during macro execution (groff extension). The syntax of this request is the same as that of .Ic \&ds1 . Since .Xr mandoc 1 does not implement .Nm compatibility mode at all, it handles this request as an alias for .Ic \&as . .It Ic \&asciify Ar divname Fully unformat a diversion. Currently unsupported. .It Ic \&backtrace Print a backtrace of the input stack. This is a groff extension and currently ignored. .It Ic \&bd Ar font Oo Ar curfont Oc Op Ar offset Artificially embolden by repeated printing with small shifts. Currently ignored. .It Ic \&bleedat Ar left top width height Set the BleedBox page parameter for PDF generation. This is a Heirloom extension and currently ignored. .It Ic \&blm Ar macroname Set a blank line trap. Currently unsupported. .It Ic \&box Ar divname Begin a diversion without including a partially filled line. Currently unsupported. .It Ic \&boxa Ar divname Add to a diversion without including a partially filled line. Currently unsupported. .It Ic \&bp Oo Cm + Ns | Ns Cm - Oc Ns Ar pagenumber Begin a new page. Currently ignored. .It Ic \&BP Ar source height width position offset flags label Define a frame and place a picture in it. This is a Heirloom extension and currently unsupported. .It Ic \&br Break the output line. .It Ic \&break Break out of the innermost .Ic \&while loop. .It Ic \&breakchar Ar char ... Optional line break characters. This is a Heirloom extension and currently ignored. .It Ic \&brnl Ar N Break output line after the next .Ar N input lines. This is a Heirloom extension and currently ignored. .It Ic \&brp Break and spread output line. Currently, this is implemented as an alias for .Ic \&br . .It Ic \&brpnl Ar N Break and spread output line after the next .Ar N input lines. This is a Heirloom extension and currently ignored. .It Ic \&c2 Op Ar char Change the no-break control character. Currently unsupported. .It Ic \&cc Op Ar char Change the control character. If .Ar char is not specified, the control character is reset to .Sq \&. . Trailing characters are ignored. .It Ic \&ce Op Ar N Center the next .Ar N input lines without filling. .Ar N defaults to 1. An argument of 0 or less ends centering. Currently, high level macros abort centering. .It Ic \&cf Ar filename Output the contents of a file. Ignored because insecure. .It Ic \&cflags Ar flags char ... Set character flags. This is a groff extension and currently ignored. .It Ic \&ch Ar macroname Op Ar dist Change a trap location. Currently ignored. .It Ic \&char Ar glyph Op Ar string Define or redefine the ASCII character or character escape sequence .Ar glyph to be rendered as .Ar string , which can be empty. Only partially supported in .Xr mandoc 1 ; may interact incorrectly with .Ic \&tr . .It Ic \&chop Ar stringname Remove the last character from a macro, string, or diversion. Currently unsupported. .It Ic \&class Ar classname char ... Define a character class. This is a groff extension and currently ignored. .It Ic \&close Ar streamname Close an open file. Ignored because insecure. .It Ic \&CL Ar color text Print text in color. This is a Heirloom extension and currently unsupported. .It Ic \&color Op Cm 1 | 0 Activate or deactivate colors. This is a groff extension and currently ignored. .It Ic \&composite Ar from to Define a name component for composite glyph names. This is a groff extension and currently unsupported. .It Ic \&continue Immediately start the next iteration of a .Ic \&while loop. Currently unsupported. .It Ic \&cp Op Cm 1 | 0 Switch .Nm compatibility mode on or off. Currently ignored. .It Ic \&cropat Ar left top width height Set the CropBox page parameter for PDF generation. This is a Heirloom extension and currently ignored. .It Ic \&cs Ar font Op Ar width Op Ar emsize Constant character spacing mode. Currently ignored. .It Ic \&cu Op Ar N Underline next .Ar N input lines including whitespace. Currently ignored. .It Ic \&da Ar divname Append to a diversion. Currently unsupported. .It Ic \&dch Ar macroname Op Ar dist Change a trap location in the current diversion. This is a Heirloom extension and currently unsupported. .It Ic \&de Ar macroname Op Ar endmacro Define a .Nm macro. Its syntax can be either .Bd -literal -offset indent .Pf . Ic \&de Ar macroname .Ar definition \&.. .Ed .Pp or .Bd -literal -offset indent .Pf . Ic \&de Ar macroname endmacro .Ar definition .Pf . Ar endmacro .Ed .Pp Both forms define or redefine the macro .Ar macroname to represent the .Ar definition , which may consist of one or more input lines, including the newline characters terminating each line, optionally containing calls to .Nm requests, .Nm macros or high-level macros like .Xr man 7 or .Xr mdoc 7 macros, whichever applies to the document in question. .Pp Specifying a custom .Ar endmacro works in the same way as for .Ic \&ig ; namely, the call to .Sq Pf . Ar endmacro first ends the .Ar definition , and after that, it is also evaluated as a .Nm request or .Nm macro, but not as a high-level macro. .Pp The macro can be invoked later using the syntax .Pp .D1 Pf . Ar macroname Op Ar argument Op Ar argument ... .Pp Regarding argument parsing, see .Sx MACRO SYNTAX above. .Pp The line invoking the macro will be replaced in the input stream by the .Ar definition , replacing all occurrences of .No \e\e$ Ns Ar N , where .Ar N is a digit, by the .Ar N Ns th Ar argument . For example, .Bd -literal -offset indent \&.de ZN \efI\e^\e\e$1\e^\efP\e\e$2 \&.. \&.ZN XtFree . .Ed .Pp produces .Pp .D1 \efI\e^XtFree\e^\efP. .Pp in the input stream, and thus in the output: \fI\^XtFree\^\fP. Each occurrence of \e\e$* is replaced with all the arguments, joined together with single space characters. The variant \e\e$@ is similar, except that each argument is individually quoted. .Pp Since macros and user-defined strings share a common string table, defining a macro .Ar macroname clobbers the user-defined string .Ar macroname , and the .Ar definition can also be printed using the .Sq \e* string interpolation syntax described below .Ic ds , but this is rarely useful because every macro definition contains at least one explicit newline character. .Pp In order to prevent endless recursion, both groff and .Xr mandoc 1 limit the stack depth for expanding macros and strings to a large, but finite number, and .Xr mandoc 1 also limits the length of the expanded input line. Do not rely on the exact values of these limits. .It Ic \&de1 Ar macroname Op Ar endmacro Define a .Nm macro that will be executed with .Nm compatibility mode switched off during macro execution. This is a groff extension. Since .Xr mandoc 1 does not implement .Nm compatibility mode at all, it handles this request as an alias for .Ic \&de . .It Ic \&defcolor Ar newname scheme component ... Define a color name. This is a groff extension and currently ignored. .It Ic \&dei Ar macrostring Op Ar endstring Define a .Nm macro, specifying the macro name indirectly (groff extension). The syntax of this request is the same as that of .Ic \&de . The effect is the same as: .Pp .D1 Pf . Cm \&de No \e* Ns Bo Ar macrostring Bc Op \e* Ns Bq Ar endstring .It Ic \&dei1 Ar macrostring Op Ar endstring Define a .Nm macro that will be executed with .Nm compatibility mode switched off during macro execution, specifying the macro name indirectly (groff extension). Since .Xr mandoc 1 does not implement .Nm compatibility mode at all, it handles this request as an alias for .Ic \&dei . .It Ic \&device Ar string ... .It Ic \&devicem Ar stringname These two requests only make sense with the groff-specific intermediate output format and are unsupported. .It Ic \&di Ar divname Begin a diversion. Currently unsupported. .It Ic \&do Ar command Op Ar argument ... Execute .Nm request or macro line with compatibility mode disabled. Currently unsupported. .It Ic \&ds Ar stringname Op Oo \(dq Oc Ns Ar string Define a user-defined string. The .Ar stringname and .Ar string arguments are space-separated. If the .Ar string begins with a double-quote character, that character will not be part of the string. All remaining characters on the input line form the .Ar string , including whitespace and double-quote characters, even trailing ones. .Pp The .Ar string can be interpolated into subsequent text by using .No \e* Ns Bq Ar stringname for a .Ar stringname of arbitrary length, or \e*(NN or \e*N if the length of .Ar stringname is two or one characters, respectively. Interpolation can be prevented by escaping the leading backslash; that is, an asterisk preceded by an even number of backslashes does not trigger string interpolation. .Pp Since user-defined strings and macros share a common string table, defining a string .Ar stringname clobbers the macro .Ar stringname , and the .Ar stringname used for defining a string can also be invoked as a macro, in which case the following input line will be appended to the .Ar string , forming a new input line passed to the .Nm parser. For example, .Bd -literal -offset indent \&.ds badidea .S \&.badidea H SYNOPSIS .Ed .Pp invokes the .Ic SH macro when used in a .Xr man 7 document. Such abuse is of course strongly discouraged. .It Ic \&ds1 Ar stringname Op Oo \(dq Oc Ns Ar string Define a user-defined string that will be expanded with .Nm compatibility mode switched off during string expansion. This is a groff extension. Since .Xr mandoc 1 does not implement .Nm compatibility mode at all, it handles this request as an alias for .Ic \&ds . .It Ic \&dwh Ar dist macroname Set a location trap in the current diversion. This is a Heirloom extension and currently unsupported. .It Ic \&dt Op Ar dist macroname Set a trap within a diversion. Currently unsupported. .It Ic \&ec Op Ar char Enable the escape mechanism and change the escape character. The .Ar char argument defaults to the backslash .Pq Sq \e . .It Ic \&ecr Restore the escape character. Currently unsupported. .It Ic \&ecs Save the escape character. Currently unsupported. .It Ic \&el Ar body The .Dq else half of an if/else conditional. Pops a result off the stack of conditional evaluations pushed by .Ic \&ie and uses it as its conditional. If no stack entries are present (e.g., due to no prior .Ic \&ie calls) then false is assumed. The syntax of this request is similar to .Ic \&if except that the conditional is missing. .It Ic \&em Ar macroname Set a trap at the end of input. Currently unsupported. .It Ic \&EN End an equation block. See .Ic \&EQ . .It Ic \&eo Disable the escape mechanism completely. .It Ic \&EP End a picture started by .Ic \&BP . This is a Heirloom extension and currently unsupported. .It Ic \&EQ Begin an equation block. See .Xr eqn 7 for a description of the equation language. .It Ic \&errprint Ar message Print a string like an error message. This is a Heirloom extension and currently ignored. .It Ic \&ev Op Ar envname Switch to another environment. Currently unsupported. .It Ic \&evc Op Ar envname Copy an environment into the current environment. Currently unsupported. .It Ic \&ex Abort processing and exit. Currently unsupported. .It Ic \&fallback Ar curfont font ... Select the fallback sequence for a font. This is a Heirloom extension and currently ignored. .It Ic \&fam Op Ar familyname Change the font family. This is a groff extension and currently ignored. .It Ic \&fc Op Ar delimchar Op Ar padchar Define a delimiting and a padding character for fields. Currently unsupported. .It Ic \&fchar Ar glyphname Op Ar string Define a fallback glyph. Currently unsupported. .It Ic \&fcolor Ar colorname Set the fill color for \eD objects. This is a groff extension and currently ignored. .It Ic \&fdeferlig Ar font string ... Defer ligature building. This is a Heirloom extension and currently ignored. .It Ic \&feature Cm + Ns | Ns Cm - Ns Ar name Enable or disable an OpenType feature. This is a Heirloom extension and currently ignored. .It Ic \&fi Break the output line and switch to fill mode, which is active by default but can be ended with the .Ic \&nf request. In fill mode, input from subsequent input lines is added to the same output line until the next word no longer fits, at which point the output line is broken. This request is implied by the .Xr mdoc 7 .Ic \&Sh macro and by the .Xr man 7 .Ic \&SH , .Ic \&SS , and .Ic \&EE macros. .It Ic \&fkern Ar font minkern Control the use of kerning tables for a font. This is a Heirloom extension and currently ignored. .It Ic \&fl Flush output. Currently ignored. .It Ic \&flig Ar font string char ... Define ligatures. This is a Heirloom extension and currently ignored. .It Ic \&fp Ar position font Op Ar filename Assign font position. Currently ignored. .It Ic \&fps Ar mapname ... Mount a font with a special character map. This is a Heirloom extension and currently ignored. .It Ic \&fschar Ar font glyphname Op Ar string Define a font-specific fallback glyph. This is a groff extension and currently unsupported. .It Ic \&fspacewidth Ar font Op Ar afmunits Set a font-specific width for the space character. This is a Heirloom extension and currently ignored. .It Ic \&fspecial Ar curfont Op Ar font ... Conditionally define a special font. This is a groff extension and currently ignored. .It Ic \&ft Op Ar font Change the font; see .Sx Font Selection . The .Ar font argument defaults to .Cm P . .It Ic \&ftr Ar newname Op Ar oldname Translate font name. This is a groff extension and currently ignored. .It Ic \&fzoom Ar font Op Ar permille Zoom font size. Currently ignored. .It Ic \&gcolor Op Ar colorname Set glyph color. This is a groff extension and currently ignored. .It Ic \&hc Op Ar char Set the hyphenation character. Currently ignored. .It Ic \&hcode Ar char code ... Set hyphenation codes of characters. Currently ignored. .It Ic \&hidechar Ar font char ... Hide characters in a font. This is a Heirloom extension and currently ignored. .It Ic \&hla Ar language Set hyphenation language. This is a groff extension and currently ignored. .It Ic \&hlm Op Ar number Set maximum number of consecutive hyphenated lines. Currently ignored. .It Ic \&hpf Ar filename Load hyphenation pattern file. This is a groff extension and currently ignored. .It Ic \&hpfa Ar filename Load hyphenation pattern file, appending to the current patterns. This is a groff extension and currently ignored. .It Ic \&hpfcode Ar code code ... Define mapping values for character codes in hyphenation patterns. This is a groff extension and currently ignored. .It Ic \&hw Ar word ... Specify hyphenation points in words. Currently ignored. .It Ic \&hy Op Ar mode Set automatic hyphenation mode. Currently ignored. .It Ic \&hylang Ar language Set hyphenation language. This is a Heirloom extension and currently ignored. .It Ic \&hylen Ar nchar Minimum word length for hyphenation. This is a Heirloom extension and currently ignored. .It Ic \&hym Op Ar length Set hyphenation margin. This is a groff extension and currently ignored. .It Ic \&hypp Ar penalty ... Define hyphenation penalties. This is a Heirloom extension and currently ignored. .It Ic \&hys Op Ar length Set hyphenation space. This is a groff extension and currently ignored. .It Ic \&ie Ar condition body The .Dq if half of an if/else conditional. The result of the conditional is pushed into a stack used by subsequent invocations of .Ic \&el , which may be separated by any intervening input (or not exist at all). Its syntax is equivalent to .Ic \&if . .It Ic \&if Ar condition body Begin a conditional. This request can also be written as follows: .Bd -unfilled -offset indent .Pf . Ic \&if Ar condition No \e{ Ns Ar body .Ar body ... Ns \e} .Ed .Bd -unfilled -offset indent .Pf . Ic \&if Ar condition No \e{\e .Ar body ... .Pf . No \e} .Ed .Pp The .Ar condition is a boolean expression. Currently, .Xr mandoc 1 supports the following subset of roff conditionals: .Bl -bullet .It If .Sq \&! is prefixed to .Ar condition , it is logically inverted. .It If the first character of .Ar condition is .Sq n .Pq nroff mode or .Sq o .Pq odd page , it evaluates to true, and the .Ar body starts with the next character. .It If the first character of .Ar condition is .Sq e .Pq even page , .Sq t .Pq troff mode , or .Sq v .Pq vroff mode , it evaluates to false, and the .Ar body starts with the next character. .It If the first character of .Ar condition is .Sq c .Pq character available , it evaluates to true if the following character is an ASCII character or a valid character escape sequence, or to false otherwise. The .Ar body starts with the character following that next character. .It If the first character of .Ar condition is .Sq d , it evaluates to true if the rest of .Ar condition is the name of an existing user defined macro or string; otherwise, it evaluates to false. .It If the first character of .Ar condition is .Sq r , it evaluates to true if the rest of .Ar condition is the name of an existing number register; otherwise, it evaluates to false. .It If the .Ar condition starts with a parenthesis or with an optionally signed integer number, it is evaluated according to the rules of .Sx Numerical expressions explained below. It evaluates to true if the result is positive, or to false if the result is zero or negative. .It Otherwise, the first character of .Ar condition is regarded as a delimiter and it evaluates to true if the string extending from its first to its second occurrence is equal to the string extending from its second to its third occurrence. .It If .Ar condition cannot be parsed, it evaluates to false. .El .Pp If a conditional is false, its children are not processed, but are syntactically interpreted to preserve the integrity of the input document. Thus, .Pp .D1 \&.if t .ig .Pp will discard the .Sq \&.ig , which may lead to interesting results, but .Pp .D1 \&.if t .if t \e{\e .Pp will continue to syntactically interpret to the block close of the final conditional. Sub-conditionals, in this case, obviously inherit the truth value of the parent. .Pp If the .Ar body section is begun by an escaped brace .Sq \e{ , scope continues until the end of the input line containing the matching closing-brace escape sequence .Sq \e} . If the .Ar body is not enclosed in braces, scope continues until the end of the line. If the .Ar condition is followed by a .Ar body on the same line, whether after a brace or not, then requests and macros .Em must begin with a control character. It is generally more intuitive, in this case, to write .Bd -unfilled -offset indent .Pf . Ic \&if Ar condition No \e{\e .Pf . Ar request .Pf . No \e} .Ed .Pp than having the request or macro follow as .Pp .D1 Pf . Ic \&if Ar condition Pf \e{. Ar request .Pp The scope of a conditional is always parsed, but only executed if the conditional evaluates to true. .Pp Note that the .Sq \e} is converted into a zero-width escape sequence if not passed as a standalone macro .Sq \&.\e} . For example, .Pp .D1 \&.Fl a \e} b .Pp will result in .Sq \e} being considered an argument of the .Sq \&Fl macro. .It Ic \&ig Op Ar endmacro Ignore input. Its syntax can be either .Bd -literal -offset indent .Pf . Cm \&ig .Ar ignored text \&.. .Ed .Pp or .Bd -literal -offset indent .Pf . Cm \&ig Ar endmacro .Ar ignored text .Pf . Ar endmacro .Ed .Pp In the first case, input is ignored until a .Sq \&.. request is encountered on its own line. In the second case, input is ignored until the specified .Sq Pf . Ar endmacro is encountered. Do not use the escape character .Sq \e anywhere in the definition of .Ar endmacro ; it would cause very strange behaviour. .Pp When the .Ar endmacro is a roff request or a roff macro, like in .Pp .D1 \&.ig if .Pp the subsequent invocation of .Ic \&if will first terminate the .Ar ignored text , then be invoked as usual. Otherwise, it only terminates the .Ar ignored text , and arguments following it or the .Sq \&.. request are discarded. .It Ic \&in Op Oo Cm + Ns | Ns Cm - Oc Ns Ar width Change indentation. See .Xr man 7 . Ignored in .Xr mdoc 7 . .It Ic \&index Ar register stringname substring Find a substring in a string. This is a Heirloom extension and currently unsupported. .It Ic \&it Ar expression macro Set an input line trap. The named .Ar macro will be invoked after processing the number of input text lines specified by the numerical .Ar expression . While evaluating the .Ar expression , the unit suffixes described below .Sx Scaling Widths are ignored. .It Ic \&itc Ar expression macro Set an input line trap, not counting lines ending with \ec. Currently unsupported. .It Ic \&IX Ar class keystring To support the generation of a table of contents, .Xr pod2man 1 emits this user-defined macro, usually without defining it. To avoid reporting large numbers of spurious errors, .Xr mandoc 1 ignores it. .It Ic \&kern Op Cm 1 | 0 Switch kerning on or off. Currently ignored. .It Ic \&kernafter Ar font char ... afmunits ... Increase kerning after some characters. This is a Heirloom extension and currently ignored. .It Ic \&kernbefore Ar font char ... afmunits ... Increase kerning before some characters. This is a Heirloom extension and currently ignored. .It Ic \&kernpair Ar font char ... font char ... afmunits Add a kerning pair to the kerning table. This is a Heirloom extension and currently ignored. .It Ic \&lc Op Ar glyph Define a leader repetition character. Currently unsupported. .It Ic \&lc_ctype Ar localename Set the .Dv LC_CTYPE locale. This is a Heirloom extension and currently unsupported. .It Ic \&lds Ar macroname string Define a local string. This is a Heirloom extension and currently unsupported. .It Ic \&length Ar register string Count the number of input characters in a string. Currently unsupported. .It Ic \&letadj Ar lspmin lshmin letss lspmax lshmax Dynamic letter spacing and reshaping. This is a Heirloom extension and currently ignored. .It Ic \&lf Ar lineno Op Ar filename Change the line number for error messages. Ignored because insecure. .It Ic \&lg Op Cm 1 | 0 Switch the ligature mechanism on or off. Currently ignored. .It Ic \&lhang Ar font char ... afmunits Hang characters at left margin. This is a Heirloom extension and currently ignored. .It Ic \&linetabs Op Cm 1 | 0 Enable or disable line-tabs mode. This is a groff extension and currently unsupported. .It Ic \&ll Op Oo Cm + Ns | Ns Cm - Oc Ns Ar width Change the output line length. If the .Ar width argument is omitted, the line length is reset to its previous value. The default setting for terminal output is 78n. If a sign is given, the line length is added to or subtracted from; otherwise, it is set to the provided value. Using this request in new manuals is discouraged for several reasons, among others because it overrides the .Xr mandoc 1 .Fl O Cm width command line option. .It Ic \&lnr Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar value Op Ar increment Set local number register. This is a Heirloom extension and currently unsupported. .It Ic \&lnrf Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar value Op Ar increment Set local floating-point register. This is a Heirloom extension and currently unsupported. .It Ic \&lpfx Ar string Set a line prefix. This is a Heirloom extension and currently unsupported. .It Ic \&ls Op Ar factor Set line spacing. It takes one integer argument specifying the vertical distance of subsequent output text lines measured in v units. Currently ignored. .It Ic \&lsm Ar macroname Set a leading spaces trap. This is a groff extension and currently unsupported. .It Ic \< Op Oo Cm + Ns | Ns Cm - Oc Ns Ar width Set title line length. Currently ignored. .It Ic \&mc Ar glyph Op Ar dist Print margin character in the right margin. The .Ar dist is currently ignored; instead, 1n is used. .It Ic \&mediasize Ar media Set the device media size. This is a Heirloom extension and currently ignored. .It Ic \&minss Ar width Set minimum word space. This is a Heirloom extension and currently ignored. .It Ic \&mk Op Ar register Mark vertical position. Currently ignored. .It Ic \&mso Ar filename Load a macro file using the search path. Ignored because insecure. .It Ic \&na Disable adjusting without changing the adjustment mode. Currently ignored. .It Ic \&ne Op Ar height Declare the need for the specified minimum vertical space before the next trap or the bottom of the page. Currently ignored. .It Ic \&nf Break the output line and switch to no-fill mode. Subsequent input lines are kept together on the same output line even when exceeding the right margin, and line breaks in subsequent input cause output line breaks. This request is implied by the .Xr mdoc 7 .Ic \&Bd Fl unfilled and .Ic \&Bd Fl literal macros and by the .Xr man 7 .Ic \&EX macro. The .Ic \&fi request switches back to the default fill mode. .It Ic \&nh Turn off automatic hyphenation mode. Currently ignored. .It Ic \&nhychar Ar char ... Define hyphenation-inhibiting characters. This is a Heirloom extension and currently ignored. .It Ic \&nm Op Ar start Op Ar inc Op Ar space Op Ar indent Print line numbers. Currently unsupported. .It Ic \&nn Op Ar number Temporarily turn off line numbering. Currently unsupported. .It Ic \&nop Ar body Execute the rest of the input line as a request, macro, or text line, skipping the .Ic \&nop request and any space characters immediately following it. This is mostly used to indent text lines inside macro definitions. .It Ic \&nr Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar expression Op Ar stepsize Define or change a register. A register is an arbitrary string value that defines some sort of state, which influences parsing and/or formatting. For the syntax of .Ar expression , see .Sx Numerical expressions below. If it is prefixed by a sign, the register will be incremented or decremented instead of assigned to. .Pp The .Ar stepsize is used by the .Ic \en+ auto-increment feature. It remains unchanged when omitted while changing an existing register, and it defaults to 0 when defining a new register. .Pp The following .Ar register is handled specially: .Bl -tag -width Ds .It Cm nS If set to a positive integer value, certain .Xr mdoc 7 macros will behave in the same way as in the .Em SYNOPSIS section. If set to 0, these macros will behave in the same way as outside the .Em SYNOPSIS section, even when called within the .Em SYNOPSIS section itself. Note that starting a new .Xr mdoc 7 section with the .Ic \&Sh macro will reset this register. .El .It Xo .Ic \&nrf Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar expression .Op Ar increment .Xc Define or change a floating-point register. This is a Heirloom extension and currently unsupported. .It Ic \&nroff Force nroff mode. This is a groff extension and currently ignored. .It Ic \&ns Turn on no-space mode. Currently ignored. .It Ic \&nx Op Ar filename Abort processing of the current input file and process another one. Ignored because insecure. .It Ic \&open Ar stream file Open a file for writing. Ignored because insecure. .It Ic \&opena Ar stream file Open a file for appending. Ignored because insecure. .It Ic \&os Output saved vertical space. Currently ignored. .It Ic \&output Ar string Output directly to intermediate output. Not supported. .It Ic \&padj Op Cm 1 | 0 Globally control paragraph-at-once adjustment. This is a Heirloom extension and currently ignored. .It Ic \&papersize Ar media Set the paper size. This is a Heirloom extension and currently ignored. .It Ic \&pc Op Ar char Change the page number character. Currently ignored. .It Ic \&pev Print environments. This is a groff extension and currently ignored. .It Ic \&pi Ar command Pipe output to a shell command. Ignored because insecure. .It Ic \&PI Low-level request used by .Ic \&BP . This is a Heirloom extension and currently unsupported. .It Ic \&pl Op Oo Cm + Ns | Ns Cm - Oc Ns Ar height Change page length. Currently ignored. .It Ic \&pm Print names and sizes of macros, strings, and diversions to standard error output. Currently ignored. .It Ic \&pn Oo Cm + Ns | Ns Cm - Oc Ns Ar number Change the page number of the next page. Currently ignored. .It Ic \&pnr Print all number registers on standard error output. Currently ignored. .It Ic \&po Op Oo Cm + Ns | Ns Cm - Oc Ns Ar offset Set a horizontal page offset. If no argument is specified, the page offset is reverted to its previous value. If a sign is specified, the new page offset is calculated relative to the current one; otherwise, it is absolute. The argument follows the syntax of .Sx Scaling Widths and the default scaling unit is .Cm m . .It Ic \&ps Op Oo Cm + Ns | Ns Cm - Oc Ns size Change point size. Currently ignored. .It Ic \&psbb Ar filename Retrieve the bounding box of a PostScript file. Currently unsupported. .It Ic \&pshape Ar indent length ... Set a special shape for the current paragraph. This is a Heirloom extension and currently unsupported. .It Ic \&pso Ar command Include output of a shell command. Ignored because insecure. .It Ic \&ptr Print the names and positions of all traps on standard error output. This is a groff extension and currently ignored. .It Ic \&pvs Op Oo Cm + Ns | Ns Cm - Oc Ns Ar height Change post-vertical spacing. This is a groff extension and currently ignored. .It Ic \&rchar Ar glyph ... Remove glyph definitions. Currently unsupported. .It Ic \&rd Op Ar prompt Op Ar argument ... Read from standard input. Currently ignored. .It Ic \&recursionlimit Ar maxrec maxtail Set the maximum stack depth for recursive macros. This is a Heirloom extension and currently ignored. .It Ic \&return Op Ar twice Exit the presently executed macro and return to the caller. The argument is currently ignored. .It Ic \&rfschar Ar font glyph ... Remove font-specific fallback glyph definitions. Currently unsupported. .It Ic \&rhang Ar font char ... afmunits Hang characters at right margin. This is a Heirloom extension and currently ignored. .It Ic \&rj Op Ar N Justify the next .Ar N input lines to the right margin without filling. .Ar N defaults to 1. An argument of 0 or less ends right adjustment. .It Ic \&rm Ar macroname Remove a request, macro or string. .It Ic \&rn Ar oldname newname Rename a request, macro, diversion, or string. In .Xr mandoc 1 , user-defined macros, .Xr mdoc 7 and .Xr man 7 macros, and user-defined strings can be renamed, but renaming of predefined strings and of .Nm requests is not supported, and diversions are not implemented at all. .It Ic \&rnn Ar oldname newname Rename a number register. Currently unsupported. .It Ic \&rr Ar register Remove a register. .It Ic \&rs End no-space mode. Currently ignored. .It Ic \&rt Op Ar dist Return to marked vertical position. Currently ignored. .It Ic \&schar Ar glyph Op Ar string Define global fallback glyph. This is a groff extension and currently unsupported. .It Ic \&sentchar Ar char ... Define sentence-ending characters. This is a Heirloom extension and currently ignored. .It Ic \&shc Op Ar glyph Change the soft hyphen character. Currently ignored. .It Ic \&shift Op Ar number Shift macro arguments .Ar number times, by default once: \e\e$i becomes what \e\e$i+number was. Also decrement \en(.$ by .Ar number . .It Ic \&sizes Ar size ... Define permissible point sizes. This is a groff extension and currently ignored. .It Ic \&so Ar filename Include a source file. The file is read and its contents processed as input in place of the .Ic \&so request line. To avoid inadvertent inclusion of unrelated files, .Xr mandoc 1 only accepts relative paths not containing the strings .Qq ../ and .Qq /.. . .Pp This request requires .Xr man 1 to change to the right directory before calling .Xr mandoc 1 , per convention to the root of the manual tree. Typical usage looks like: .Pp .Dl \&.so man3/Xcursor.3 .Pp As the whole concept is rather fragile, the use of .Ic \&so is discouraged. Use .Xr ln 1 instead. .It Ic \&sp Op Ar height Break the output line and emit vertical space. The argument follows the syntax of .Sx Scaling Widths and defaults to one blank line .Pq Li 1v . .It Ic \&spacewidth Op Cm 1 | 0 Set the space width from the font metrics file. This is a Heirloom extension and currently ignored. .It Ic \&special Op Ar font ... Define a special font. This is a groff extension and currently ignored. .It Ic \&spreadwarn Op Ar width Warn about wide spacing between words. Currently ignored. .It Ic \&ss Ar wordspace Op Ar sentencespace Set space character size. Currently ignored. .It Ic \&sty Ar position style Associate style with a font position. This is a groff extension and currently ignored. .It Ic \&substring Ar stringname startpos Op Ar endpos Replace a user-defined string with a substring. Currently unsupported. .It Ic \&sv Op Ar height Save vertical space. Currently ignored. .It Ic \&sy Ar command Execute shell command. Ignored because insecure. .It Ic \&T& Re-start a table layout, retaining the options of the prior table invocation. See .Ic \&TS . .It Ic \&ta Op Ar width ... Op Cm T Ar width ... Set tab stops. Each .Ar width argument follows the syntax of .Sx Scaling Widths . If prefixed by a plus sign, it is relative to the previous tab stop. The arguments after the .Cm T marker are used repeatedly as often as needed; for each reuse, they are taken relative to the last previously established tab stop. When .Ic \&ta is called without arguments, all tab stops are cleared. .It Ic \&tc Op Ar glyph Change tab repetition character. Currently unsupported. .It Ic \&TE End a table context. See .Ic \&TS . .It Ic \&ti Oo Cm + Ns | Ns Cm - Oc Ns Ar width Break the output line and indent the next output line by .Ar width . If a sign is specified, the temporary indentation is calculated relative to the current indentation; otherwise, it is absolute. The argument follows the syntax of .Sx Scaling Widths and the default scaling unit is .Cm m . .It Ic \&tkf Ar font minps width1 maxps width2 Enable track kerning for a font. Currently ignored. .It Ic \&tl No \& Ap Ar left Ap Ar center Ap Ar right Ap Print a title line. Currently unsupported. .It Ic \&tm Ar string Print to standard error output. Currently ignored. .It Ic \&tm1 Ar string Print to standard error output, allowing leading blanks. This is a groff extension and currently ignored. .It Ic \&tmc Ar string Print to standard error output without a trailing newline. This is a groff extension and currently ignored. .It Ic \&tr Ar glyph glyph ... Output character translation. The first glyph in each pair is replaced by the second one. Character escapes can be used; for example, .Pp .Dl tr \e(xx\e(yy .Pp replaces all invocations of \e(xx with \e(yy. .It Ic \&track Ar font minps width1 maxps width2 Static letter space tracking. This is a Heirloom extension and currently ignored. .It Ic \&transchar Ar char ... Define transparent characters for sentence-ending. This is a Heirloom extension and currently ignored. .It Ic \&trf Ar filename Output the contents of a file, disallowing invalid characters. This is a groff extension and ignored because insecure. .It Ic \&trimat Ar left top width height Set the TrimBox page parameter for PDF generation. This is a Heirloom extension and currently ignored. .It Ic \&trin Ar glyph glyph ... Output character translation, ignored by .Ic \&asciify . Currently unsupported. .It Ic \&trnt Ar glyph glyph ... Output character translation, ignored by \e!. Currently unsupported. .It Ic \&troff Force troff mode. This is a groff extension and currently ignored. .It Ic \&TS Begin a table, which formats input in aligned rows and columns. See .Xr tbl 7 for a description of the tbl language. .It Ic \&uf Ar font Globally set the underline font. Currently ignored. .It Ic \&ul Op Ar N Underline next .Ar N input lines. Currently ignored. .It Ic \&unformat Ar divname Unformat spaces and tabs in a diversion. Currently unsupported. .It Ic \&unwatch Ar macroname Disable notification for string or macro. This is a Heirloom extension and currently ignored. .It Ic \&unwatchn Ar register Disable notification for register. This is a Heirloom extension and currently ignored. .It Ic \&vpt Op Cm 1 | 0 Enable or disable vertical position traps. This is a groff extension and currently ignored. .It Ic \&vs Op Oo Cm + Ns | Ns Cm - Oc Ns Ar height Change vertical spacing. Currently ignored. .It Ic \&warn Ar flags Set warning level. Currently ignored. .It Ic \&warnscale Ar si Set the scaling indicator used in warnings. This is a groff extension and currently ignored. .It Ic \&watch Ar macroname Notify on change of string or macro. This is a Heirloom extension and currently ignored. .It Ic \&watchlength Ar maxlength On change, report the contents of macros and strings up to the specified length. This is a Heirloom extension and currently ignored. .It Ic \&watchn Ar register Notify on change of register. This is a Heirloom extension and currently ignored. .It Ic \&wh Ar dist Op Ar macroname Set a page location trap. Currently unsupported. .It Ic \&while Ar condition body Repeated execution while a .Ar condition is true, with syntax similar to .Ic \&if . Currently implemented with two restrictions: cannot nest, and each loop must start and end in the same scope. .It Ic \&write Oo \(dq Oc Ns Ar string Write to an open file. Ignored because insecure. .It Ic \&writec Oo \(dq Oc Ns Ar string Write to an open file without appending a newline. Ignored because insecure. .It Ic \&writem Ar macroname Write macro or string to an open file. Ignored because insecure. .It Ic \&xflag Ar level Set the extension level. This is a Heirloom extension and currently ignored. .El .Ss Numerical expressions The .Ic \&nr , .Ic \&if , and .Ic \&ie requests accept integer numerical expressions as arguments. These are always evaluated using the C .Vt int type; integer overflow works the same way as in the C language. Numbers consist of an arbitrary number of digits .Sq 0 to .Sq 9 prefixed by an optional sign .Sq + or .Sq - . Each number may be followed by one optional scaling unit described below .Sx Scaling Widths . The following equations hold: .Bd -literal -offset indent 1i = 6v = 6P = 10m = 10n = 72p = 1000M = 240u = 240 254c = 100i = 24000u = 24000 1f = 65536u = 65536 .Ed .Pp The following binary operators are implemented. Unless otherwise stated, they behave as in the C language: .Pp .Bl -tag -width 2n -compact .It Ic + addition .It Ic - subtraction .It Ic * multiplication .It Ic / division .It Ic % remainder of division .It Ic < less than .It Ic > greater than .It Ic == equal to .It Ic = equal to, same effect as .Ic == (this differs from C) .It Ic <= less than or equal to .It Ic >= greater than or equal to .It Ic <> not equal to (corresponds to C .Ic != ; this one is of limited portability, it is supported by Heirloom roff, but not by groff) .It Ic & logical and (corresponds to C .Ic && ) .It Ic \&: logical or (corresponds to C .Ic || ) .It Ic <? minimum (not available in C) .It Ic >? maximum (not available in C) .El .Pp There is no concept of precedence; evaluation proceeds from left to right, except when subexpressions are enclosed in parentheses. Inside parentheses, whitespace is ignored. .Sh ESCAPE SEQUENCE REFERENCE The .Xr mandoc 1 .Nm parser recognises the following escape sequences. In .Xr mdoc 7 and .Xr man 7 documents, using escape sequences is discouraged except for those described in the .Sx LANGUAGE SYNTAX section above. .Pp A backslash followed by any character not listed here simply prints that character itself. .Bl -tag -width Ds .It Ic \e<newline> A backslash at the end of an input line can be used to continue the logical input line on the next physical input line, joining the text on both lines together as if it were on a single input line. .It Ic \e<space> The escape sequence backslash-space .Pq Sq \e\ \& is an unpaddable space-sized non-breaking space character; see .Sx Whitespace and .Xr mandoc_char 7 . .It Ic \e! Embed text up to and including the end of the input line into the current diversion or into intermediate output without interpreting requests, macros, and escapes. Currently unsupported. .It Ic \e\(dq The rest of the input line is treated as .Sx Comments . .It Ic \e# Line continuation with comment. Discard the rest of the physical input line and continue the logical input line on the next physical input line, joining the text on both lines together as if it were on a single input line. This is a groff extension. .It Ic \e$ Ns Ar arg Macro argument expansion, see .Ic \&de . .It Ic \e% Hyphenation allowed at this point of the word; ignored by .Xr mandoc 1 . .It Ic \e& Non-printing zero-width character, often used for various kinds of escaping; see .Sx Whitespace , .Xr mandoc_char 7 , and the .Dq MACRO SYNTAX and .Dq Delimiters sections in .Xr mdoc 7 . .It Ic \e\(aq Acute accent special character; use .Ic \e(aa instead. .It Ic \e( Ns Ar cc .Sx Special Characters with two-letter names, see .Xr mandoc_char 7 . .It Ic \e) Zero-width space transparent to end-of-sentence detection; ignored by .Xr mandoc 1 . .It Ic \e*[ Ns Ar name Ns Ic \&] Interpolate the string with the .Ar name . For short names, there are variants .Ic \e* Ns Ar c and .Ic \e*( Ns Ar cc . .Pp One string is predefined on the .Nm language level: .Ic \e*(.T expands to the name of the output device, for example ascii, utf8, ps, pdf, html, or markdown. .Pp Macro sets traditionally predefine additional strings which are not portable and differ across implementations. Those supported by .Xr mandoc 1 are listed in .Xr mandoc_char 7 . .Pp Strings can be defined, changed, and deleted with the .Ic \&ds , .Ic \&as , and .Ic \&rm requests. .It Ic \e, Left italic correction (groff extension); ignored by .Xr mandoc 1 . .It Ic \e- Special character .Dq mathematical minus sign ; see .Xr mandoc_char 7 for details. .It Ic \e/ Right italic correction (groff extension); ignored by .Xr mandoc 1 . .It Ic \e: Breaking the line is allowed at this point of the word without inserting a hyphen. .It Ic \e? Embed the text up to the next .Ic \e? into the current diversion without interpreting requests, macros, and escapes. This is a groff extension and currently unsupported. .It Ic \e[ Ns Ar name Ns Ic \&] .Sx Special Characters with names of arbitrary length, see .Xr mandoc_char 7 . .It Ic \e^ One-twelfth em half-narrow space character, effectively zero-width in .Xr mandoc 1 . .It Ic \e_ Underline special character; use .Ic \e(ul instead. .It Ic \e` Grave accent special character; use .Ic \e(ga instead. .It Ic \e{ Begin conditional input; see .Ic \&if . .It Ic \e\(ba One-sixth em narrow space character, effectively zero-width in .Xr mandoc 1 . .It Ic \e} End conditional input; see .Ic \&if . .It Ic \e~ Paddable non-breaking space character. .It Ic \e0 Digit width space character. .It Ic \eA\(aq Ns Ar string Ns Ic \(aq Anchor definition; ignored by .Xr mandoc 1 . .It Ic \ea Leader character; ignored by .Xr mandoc 1 . .It Ic \eB\(aq Ns Ar string Ns Ic \(aq Interpolate .Sq 1 if .Ar string conforms to the syntax of .Sx Numerical expressions explained above or .Sq 0 otherwise. .It Ic \eb\(aq Ns Ar string Ns Ic \(aq Bracket building function; ignored by .Xr mandoc 1 . .It Ic \eC\(aq Ns Ar name Ns Ic \(aq .Sx Special Characters with names of arbitrary length. .It Ic \ec When encountered at the end of an input text line, the next input text line is considered to continue that line, even if there are request or macro lines in between. No whitespace is inserted. .It Ic \eD\(aq Ns Ar string Ns Ic \(aq Draw graphics function; ignored by .Xr mandoc 1 . .It Ic \ed Move down by half a line; ignored by .Xr mandoc 1 . .It Ic \eE Escape character intended to not be interpreted in copy mode. In .Xr mandoc 1 , it currently does the same as .Ic \e itself. .It Ic \ee Backslash special character. .It Ic \eF[ Ns Ar name Ns Ic \&] Switch font family (groff extension); ignored by .Xr mandoc 1 . For short names, there are variants .Ic \eF Ns Ar c and .Ic \eF( Ns Ar cc . .It Ic \ef[ Ns Ar name Ns Ic \&] Switch to the font .Ar name , see .Sx Font Selection . For short names, there are variants .Ic \ef Ns Ar c and .Ic \ef( Ns Ar cc . An empty name .Ic \ef[] defaults to .Ic \efP . .It Ic \eg[ Ns Ar name Ns Ic \&] Interpolate the format of a number register; ignored by .Xr mandoc 1 . For short names, there are variants .Ic \eg Ns Ar c and .Ic \eg( Ns Ar cc . .It Ic \eH\(aq Ns Oo +|- Oc Ns Ar number Ns Ic \(aq Set the height of the current font; ignored by .Xr mandoc 1 . .It Ic \eh\(aq Ns Oo Cm \&| Oc Ns Ar width Ns Ic \(aq Horizontal motion. If the vertical bar is given, the motion is relative to the current indentation. Otherwise, it is relative to the current position. The default scaling unit is .Cm m . .It Ic \ek[ Ns Ar name Ns Ic \&] Mark horizontal input place in register; ignored by .Xr mandoc 1 . For short names, there are variants .Ic \ek Ns Ar c and .Ic \ek( Ns Ar cc . .It Ic \eL\(aq Ns Ar number Ns Oo Ar c Oc Ns Ic \(aq Vertical line drawing function; ignored by .Xr mandoc 1 . .It Ic \el\(aq Ns Ar width Ns Oo Ar c Oc Ns Ic \(aq Draw a horizontal line of .Ar width using the glyph .Ar c . .It Ic \eM[ Ns Ar name Ns Ic \&] Set fill (background) color (groff extension); ignored by .Xr mandoc 1 . For short names, there are variants .Ic \eM Ns Ar c and .Ic \eM( Ns Ar cc . .It Ic \em[ Ns Ar name Ns Ic \&] Set glyph drawing color (groff extension); ignored by .Xr mandoc 1 . For short names, there are variants .Ic \em Ns Ar c and .Ic \em( Ns Ar cc . .It Ic \eN\(aq Ns Ar number Ns Ic \(aq Character .Ar number on the current font. .It Ic \en Ns Oo +|- Oc Ns Ic \&[ Ns Ar name Ns Ic \&] Interpolate the number register .Ar name . For short names, there are variants .Ic \en Ns Ar c and .Ic \en( Ns Ar cc . If the optional sign is specified, the register is first incremented or decremented by the .Ar stepsize that was specified in the relevant .Ic \&nr request, and the changed value is interpolated. .It Ic \eO Ns Ar digit , Ic \eO[5 Ns arguments Ns Ic \&] Suppress output. This is a groff extension and currently unsupported. With an argument of .Ic 1 , 2 , 3 , or .Ic 4 , it is ignored. .It Ic \eo\(aq Ns Ar string Ns Ic \(aq Overstrike, writing all the characters contained in the .Ar string to the same output position. In terminal and HTML output modes, only the last one of the characters is visible. .It Ic \ep Break the output line at the end of the current word. .It Ic \eR\(aq Ns Ar name Oo +|- Oc Ns Ar number Ns Ic \(aq Set number register; ignored by .Xr mandoc 1 . .It Ic \er Move up by one line; ignored by .Xr mandoc 1 . .It Ic \eS\(aq Ns Ar number Ns Ic \(aq Slant output; ignored by .Xr mandoc 1 . .It Ic \es\(aq Ns Oo +|- Oc Ns Ar number Ns Ic \(aq Change point size; ignored by .Xr mandoc 1 . Alternative forms .Ic \es Ns Oo +|- Oc Ns Ar n , .Ic \es Ns Oo +|- Oc Ns Ic \(aq Ns Ar number Ns Ic \(aq , .Ic \es[ Ns Oo +|- Oc Ns Ar number Ns Ic \&] , and .Ic \es Ns Oo +|- Oc Ns Ic \&[ Ns Ar number Ns Ic \&] are also parsed and ignored. .It Ic \et Horizontal tab; ignored by .Xr mandoc 1 . .It Ic \eu Move up by half a line; ignored by .Xr mandoc 1 . .It Ic \eV[ Ns Ar name Ns Ic \&] Interpolate an environment variable; ignored by .Xr mandoc 1 . For short names, there are variants .Ic \eV Ns Ar c and .Ic \eV( Ns Ar cc . .It Ic \ev\(aq Ns Ar number Ns Ic \(aq Vertical motion; ignored by .Xr mandoc 1 . .It Ic \ew\(aq Ns Ar string Ns Ic \(aq Interpolate the width of the .Ar string . The .Xr mandoc 1 implementation assumes that after expansion of user-defined strings, the .Ar string only contains normal characters, no escape sequences, and that each character has a width of 24 basic units. .It Ic \eX\(aq Ns Ar string Ns Ic \(aq Output .Ar string as device control function; ignored in nroff mode and by .Xr mandoc 1 . .It Ic \ex\(aq Ns Ar number Ns Ic \(aq Extra line space function; ignored by .Xr mandoc 1 . .It Ic \eY[ Ns Ar name Ns Ic \&] Output a string as a device control function; ignored in nroff mode and by .Xr mandoc 1 . For short names, there are variants .Ic \eY Ns Ar c and .Ic \eY( Ns Ar cc . .It Ic \eZ\(aq Ns Ar string Ns Ic \(aq Print .Ar string with zero width and height; ignored by .Xr mandoc 1 . .It Ic \ez Output the next character without advancing the cursor position. .El .Sh COMPATIBILITY The .Xr mandoc 1 implementation of the .Nm language is incomplete. Major unimplemented features include: .Pp .Bl -dash -compact .It For security reasons, .Xr mandoc 1 never reads or writes external files except via .Ic \&so requests with safe relative paths. .It There is no automatic hyphenation, no adjustment to the right margin, and very limited support for centering; the output is always set flush-left. .It Support for setting tabulator and leader characters is missing, and support for manually changing indentation is limited. .It The .Sq u scaling unit is the default terminal unit. In traditional troff systems, this unit changes depending on the output media. .It Width measurements are implemented in a crude way and often yield wrong results. Support for explicit movement requests and escapes is limited. .It There is no concept of output pages, no support for floats, graphics drawing, and picture inclusion; terminal output is always continuous. .It Requests regarding color, font families, font sizes, and glyph manipulation are ignored. Font support is very limited. Kerning is not implemented, and no ligatures are produced. .It The .Qq \(aq macro control character does not suppress output line breaks. .It Diversions and environments are not implemented, and support for traps is very incomplete. .It Use of macros is not supported inside .Xr tbl 7 code. .El .Pp The special semantics of the .Cm nS number register is an idiosyncrasy of .Ox manuals and not supported by other .Xr mdoc 7 implementations. .Sh SEE ALSO .Xr mandoc 1 , .Xr eqn 7 , .Xr man 7 , .Xr mandoc_char 7 , .Xr mdoc 7 , .Xr tbl 7 .Rs .%A Joseph F. Ossanna .%A Brian W. Kernighan .%I AT&T Bell Laboratories .%T Troff User's Manual .%R Computing Science Technical Report .%N 54 .%C Murray Hill, New Jersey .%D 1976 and 1992 .%U http://www.kohala.com/start/troff/cstr54.ps .Re .Rs .%A Joseph F. Ossanna .%A Brian W. Kernighan .%A Gunnar Ritter .%T Heirloom Documentation Tools Nroff/Troff User's Manual .%D September 17, 2007 .%U http://heirloom.sourceforge.net/doctools/troff.pdf .Re .Sh HISTORY The RUNOFF typesetting system, whose input forms the basis for .Nm , was written in MAD and FAP for the CTSS operating system by Jerome E. Saltzer in 1964. Doug McIlroy rewrote it in BCPL in 1969, renaming it .Nm . Dennis M. Ritchie rewrote McIlroy's .Nm in PDP-11 assembly for .At v1 , Joseph F. Ossanna improved roff and renamed it nroff for .At v2 , then ported nroff to C as troff, which Brian W. Kernighan released with .At v7 . In 1989, James Clark re-implemented troff in C++, naming it groff. .Sh AUTHORS .An -nosplit This .Nm reference was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv and .An Ingo Schwarze Aq Mt schwarze@openbsd.org . ����������������������������������������mandoc-1.14.6/roff.h��������������������������������������������������������������������������������0100644�0001753�0001753�00000022446�14123140553�0014464�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: roff.h,v 1.74 2020/04/08 11:56:03 schwarze Exp $ */ /* * Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Common data types for all syntax trees and related functions. */ struct ohash; struct mdoc_arg; union mdoc_data; struct tbl_span; struct eqn_box; enum roff_macroset { MACROSET_NONE = 0, MACROSET_MDOC, MACROSET_MAN }; enum roff_sec { SEC_NONE = 0, SEC_NAME, SEC_LIBRARY, SEC_SYNOPSIS, SEC_DESCRIPTION, SEC_CONTEXT, SEC_IMPLEMENTATION, /* IMPLEMENTATION NOTES */ SEC_RETURN_VALUES, SEC_ENVIRONMENT, SEC_FILES, SEC_EXIT_STATUS, SEC_EXAMPLES, SEC_DIAGNOSTICS, SEC_COMPATIBILITY, SEC_ERRORS, SEC_SEE_ALSO, SEC_STANDARDS, SEC_HISTORY, SEC_AUTHORS, SEC_CAVEATS, SEC_BUGS, SEC_SECURITY, SEC_CUSTOM, SEC__MAX }; enum roff_type { ROFFT_ROOT, ROFFT_BLOCK, ROFFT_HEAD, ROFFT_BODY, ROFFT_TAIL, ROFFT_ELEM, ROFFT_TEXT, ROFFT_COMMENT, ROFFT_TBL, ROFFT_EQN }; enum roff_tok { ROFF_br = 0, ROFF_ce, ROFF_fi, ROFF_ft, ROFF_ll, ROFF_mc, ROFF_nf, ROFF_po, ROFF_rj, ROFF_sp, ROFF_ta, ROFF_ti, ROFF_MAX, ROFF_ab, ROFF_ad, ROFF_af, ROFF_aln, ROFF_als, ROFF_am, ROFF_am1, ROFF_ami, ROFF_ami1, ROFF_as, ROFF_as1, ROFF_asciify, ROFF_backtrace, ROFF_bd, ROFF_bleedat, ROFF_blm, ROFF_box, ROFF_boxa, ROFF_bp, ROFF_BP, ROFF_break, ROFF_breakchar, ROFF_brnl, ROFF_brp, ROFF_brpnl, ROFF_c2, ROFF_cc, ROFF_cf, ROFF_cflags, ROFF_ch, ROFF_char, ROFF_chop, ROFF_class, ROFF_close, ROFF_CL, ROFF_color, ROFF_composite, ROFF_continue, ROFF_cp, ROFF_cropat, ROFF_cs, ROFF_cu, ROFF_da, ROFF_dch, ROFF_Dd, ROFF_de, ROFF_de1, ROFF_defcolor, ROFF_dei, ROFF_dei1, ROFF_device, ROFF_devicem, ROFF_di, ROFF_do, ROFF_ds, ROFF_ds1, ROFF_dwh, ROFF_dt, ROFF_ec, ROFF_ecr, ROFF_ecs, ROFF_el, ROFF_em, ROFF_EN, ROFF_eo, ROFF_EP, ROFF_EQ, ROFF_errprint, ROFF_ev, ROFF_evc, ROFF_ex, ROFF_fallback, ROFF_fam, ROFF_fc, ROFF_fchar, ROFF_fcolor, ROFF_fdeferlig, ROFF_feature, ROFF_fkern, ROFF_fl, ROFF_flig, ROFF_fp, ROFF_fps, ROFF_fschar, ROFF_fspacewidth, ROFF_fspecial, ROFF_ftr, ROFF_fzoom, ROFF_gcolor, ROFF_hc, ROFF_hcode, ROFF_hidechar, ROFF_hla, ROFF_hlm, ROFF_hpf, ROFF_hpfa, ROFF_hpfcode, ROFF_hw, ROFF_hy, ROFF_hylang, ROFF_hylen, ROFF_hym, ROFF_hypp, ROFF_hys, ROFF_ie, ROFF_if, ROFF_ig, /* MAN_in; ignored in mdoc(7) */ ROFF_index, ROFF_it, ROFF_itc, ROFF_IX, ROFF_kern, ROFF_kernafter, ROFF_kernbefore, ROFF_kernpair, ROFF_lc, ROFF_lc_ctype, ROFF_lds, ROFF_length, ROFF_letadj, ROFF_lf, ROFF_lg, ROFF_lhang, ROFF_linetabs, ROFF_lnr, ROFF_lnrf, ROFF_lpfx, ROFF_ls, ROFF_lsm, ROFF_lt, ROFF_mediasize, ROFF_minss, ROFF_mk, ROFF_mso, ROFF_na, ROFF_ne, ROFF_nh, ROFF_nhychar, ROFF_nm, ROFF_nn, ROFF_nop, ROFF_nr, ROFF_nrf, ROFF_nroff, ROFF_ns, ROFF_nx, ROFF_open, ROFF_opena, ROFF_os, ROFF_output, ROFF_padj, ROFF_papersize, ROFF_pc, ROFF_pev, ROFF_pi, ROFF_PI, ROFF_pl, ROFF_pm, ROFF_pn, ROFF_pnr, ROFF_ps, ROFF_psbb, ROFF_pshape, ROFF_pso, ROFF_ptr, ROFF_pvs, ROFF_rchar, ROFF_rd, ROFF_recursionlimit, ROFF_return, ROFF_rfschar, ROFF_rhang, ROFF_rm, ROFF_rn, ROFF_rnn, ROFF_rr, ROFF_rs, ROFF_rt, ROFF_schar, ROFF_sentchar, ROFF_shc, ROFF_shift, ROFF_sizes, ROFF_so, ROFF_spacewidth, ROFF_special, ROFF_spreadwarn, ROFF_ss, ROFF_sty, ROFF_substring, ROFF_sv, ROFF_sy, ROFF_T_, ROFF_tc, ROFF_TE, ROFF_TH, ROFF_tkf, ROFF_tl, ROFF_tm, ROFF_tm1, ROFF_tmc, ROFF_tr, ROFF_track, ROFF_transchar, ROFF_trf, ROFF_trimat, ROFF_trin, ROFF_trnt, ROFF_troff, ROFF_TS, ROFF_uf, ROFF_ul, ROFF_unformat, ROFF_unwatch, ROFF_unwatchn, ROFF_vpt, ROFF_vs, ROFF_warn, ROFF_warnscale, ROFF_watch, ROFF_watchlength, ROFF_watchn, ROFF_wh, ROFF_while, ROFF_write, ROFF_writec, ROFF_writem, ROFF_xflag, ROFF_cblock, ROFF_RENAMED, ROFF_USERDEF, TOKEN_NONE, MDOC_Dd, MDOC_Dt, MDOC_Os, MDOC_Sh, MDOC_Ss, MDOC_Pp, MDOC_D1, MDOC_Dl, MDOC_Bd, MDOC_Ed, MDOC_Bl, MDOC_El, MDOC_It, MDOC_Ad, MDOC_An, MDOC_Ap, MDOC_Ar, MDOC_Cd, MDOC_Cm, MDOC_Dv, MDOC_Er, MDOC_Ev, MDOC_Ex, MDOC_Fa, MDOC_Fd, MDOC_Fl, MDOC_Fn, MDOC_Ft, MDOC_Ic, MDOC_In, MDOC_Li, MDOC_Nd, MDOC_Nm, MDOC_Op, MDOC_Ot, MDOC_Pa, MDOC_Rv, MDOC_St, MDOC_Va, MDOC_Vt, MDOC_Xr, MDOC__A, MDOC__B, MDOC__D, MDOC__I, MDOC__J, MDOC__N, MDOC__O, MDOC__P, MDOC__R, MDOC__T, MDOC__V, MDOC_Ac, MDOC_Ao, MDOC_Aq, MDOC_At, MDOC_Bc, MDOC_Bf, MDOC_Bo, MDOC_Bq, MDOC_Bsx, MDOC_Bx, MDOC_Db, MDOC_Dc, MDOC_Do, MDOC_Dq, MDOC_Ec, MDOC_Ef, MDOC_Em, MDOC_Eo, MDOC_Fx, MDOC_Ms, MDOC_No, MDOC_Ns, MDOC_Nx, MDOC_Ox, MDOC_Pc, MDOC_Pf, MDOC_Po, MDOC_Pq, MDOC_Qc, MDOC_Ql, MDOC_Qo, MDOC_Qq, MDOC_Re, MDOC_Rs, MDOC_Sc, MDOC_So, MDOC_Sq, MDOC_Sm, MDOC_Sx, MDOC_Sy, MDOC_Tn, MDOC_Ux, MDOC_Xc, MDOC_Xo, MDOC_Fo, MDOC_Fc, MDOC_Oo, MDOC_Oc, MDOC_Bk, MDOC_Ek, MDOC_Bt, MDOC_Hf, MDOC_Fr, MDOC_Ud, MDOC_Lb, MDOC_Lp, MDOC_Lk, MDOC_Mt, MDOC_Brq, MDOC_Bro, MDOC_Brc, MDOC__C, MDOC_Es, MDOC_En, MDOC_Dx, MDOC__Q, MDOC__U, MDOC_Ta, MDOC_Tg, MDOC_MAX, MAN_TH, MAN_SH, MAN_SS, MAN_TP, MAN_TQ, MAN_LP, MAN_PP, MAN_P, MAN_IP, MAN_HP, MAN_SM, MAN_SB, MAN_BI, MAN_IB, MAN_BR, MAN_RB, MAN_R, MAN_B, MAN_I, MAN_IR, MAN_RI, MAN_RE, MAN_RS, MAN_DT, MAN_UC, MAN_PD, MAN_AT, MAN_in, MAN_SY, MAN_YS, MAN_OP, MAN_EX, MAN_EE, MAN_UR, MAN_UE, MAN_MT, MAN_ME, MAN_MAX }; /* * Indicates that a BODY's formatting has ended, but * the scope is still open. Used for badly nested blocks. */ enum mdoc_endbody { ENDBODY_NOT = 0, ENDBODY_SPACE /* Is broken: append a space. */ }; enum mandoc_os { MANDOC_OS_OTHER = 0, MANDOC_OS_NETBSD, MANDOC_OS_OPENBSD }; struct roff_node { struct roff_node *parent; /* Parent AST node. */ struct roff_node *child; /* First child AST node. */ struct roff_node *last; /* Last child AST node. */ struct roff_node *next; /* Sibling AST node. */ struct roff_node *prev; /* Prior sibling AST node. */ struct roff_node *head; /* BLOCK */ struct roff_node *body; /* BLOCK/ENDBODY */ struct roff_node *tail; /* BLOCK */ struct mdoc_arg *args; /* BLOCK/ELEM */ union mdoc_data *norm; /* Normalized arguments. */ char *string; /* TEXT */ char *tag; /* For less(1) :t and HTML id=. */ struct tbl_span *span; /* TBL */ struct eqn_box *eqn; /* EQN */ int line; /* Input file line number. */ int pos; /* Input file column number. */ int flags; #define NODE_VALID (1 << 0) /* Has been validated. */ #define NODE_ENDED (1 << 1) /* Gone past body end mark. */ #define NODE_BROKEN (1 << 2) /* Must validate parent when ending. */ #define NODE_LINE (1 << 3) /* First macro/text on line. */ #define NODE_DELIMO (1 << 4) #define NODE_DELIMC (1 << 5) #define NODE_EOS (1 << 6) /* At sentence boundary. */ #define NODE_SYNPRETTY (1 << 7) /* SYNOPSIS-style formatting. */ #define NODE_NOFILL (1 << 8) /* Fill mode switched off. */ #define NODE_NOSRC (1 << 9) /* Generated node, not in input file. */ #define NODE_NOPRT (1 << 10) /* Shall not print anything. */ #define NODE_ID (1 << 11) /* Target for deep linking. */ #define NODE_HREF (1 << 12) /* Link to another place in this page. */ int prev_font; /* Before entering this node. */ int aux; /* Decoded node data, type-dependent. */ enum roff_tok tok; /* Request or macro ID. */ enum roff_type type; /* AST node type. */ enum roff_sec sec; /* Current named section. */ enum mdoc_endbody end; /* BODY */ }; struct roff_meta { struct roff_node *first; /* The first node parsed. */ char *msec; /* Manual section, usually a digit. */ char *vol; /* Manual volume title. */ char *os; /* Operating system. */ char *arch; /* Machine architecture. */ char *title; /* Manual title, usually CAPS. */ char *name; /* Leading manual name. */ char *date; /* Normalized date. */ char *sodest; /* .so target file name or NULL. */ int hasbody; /* Document is not empty. */ int rcsids; /* Bits indexed by enum mandoc_os. */ enum mandoc_os os_e; /* Operating system. */ enum roff_macroset macroset; /* Kind of high-level macros used. */ }; extern const char *const *roff_name; int arch_valid(const char *, enum mandoc_os); void deroff(char **, const struct roff_node *); struct roff_node *roff_node_child(struct roff_node *); struct roff_node *roff_node_next(struct roff_node *); struct roff_node *roff_node_prev(struct roff_node *); int roff_node_transparent(struct roff_node *); int roff_tok_transparent(enum roff_tok); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/roff_int.h����������������������������������������������������������������������������0100644�0001753�0001753�00000010221�14123140553�0015322�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $OpenBSD: roff_int.h,v 1.16 2019/01/05 00:36:46 schwarze Exp $ */ /* * Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Parser internals shared by multiple parsers. */ struct ohash; struct roff_node; struct roff_meta; struct roff; struct mdoc_arg; enum roff_next { ROFF_NEXT_SIBLING = 0, ROFF_NEXT_CHILD }; struct roff_man { struct roff_meta meta; /* Public parse results. */ struct roff *roff; /* Roff parser state data. */ struct ohash *mdocmac; /* Mdoc macro lookup table. */ struct ohash *manmac; /* Man macro lookup table. */ const char *os_s; /* Default operating system. */ struct roff_node *last; /* The last node parsed. */ struct roff_node *last_es; /* The most recent Es node. */ int quick; /* Abort parse early. */ int flags; /* Parse flags. */ #define ROFF_NOFILL (1 << 1) /* Fill mode switched off. */ #define MDOC_PBODY (1 << 2) /* In the document body. */ #define MDOC_NEWLINE (1 << 3) /* First macro/text in a line. */ #define MDOC_PHRASE (1 << 4) /* In a Bl -column phrase. */ #define MDOC_PHRASELIT (1 << 5) /* Literal within a phrase. */ #define MDOC_FREECOL (1 << 6) /* `It' invocation should close. */ #define MDOC_SYNOPSIS (1 << 7) /* SYNOPSIS-style formatting. */ #define MDOC_KEEP (1 << 8) /* In a word keep. */ #define MDOC_SMOFF (1 << 9) /* Spacing is off. */ #define MDOC_NODELIMC (1 << 10) /* Disable closing delimiter handling. */ #define MAN_ELINE (1 << 11) /* Next-line element scope. */ #define MAN_BLINE (1 << 12) /* Next-line block scope. */ #define MDOC_PHRASEQF (1 << 13) /* Quote first word encountered. */ #define MDOC_PHRASEQL (1 << 14) /* Quote last word of this phrase. */ #define MDOC_PHRASEQN (1 << 15) /* Quote first word of the next phrase. */ #define ROFF_NONOFILL (1 << 16) /* Temporarily suspend no-fill mode. */ #define MAN_NEWLINE MDOC_NEWLINE enum roff_sec lastsec; /* Last section seen. */ enum roff_sec lastnamed; /* Last standard section seen. */ enum roff_next next; /* Where to put the next node. */ char filesec; /* Section digit in the file name. */ }; struct roff_node *roff_node_alloc(struct roff_man *, int, int, enum roff_type, int); void roff_node_append(struct roff_man *, struct roff_node *); void roff_word_alloc(struct roff_man *, int, int, const char *); void roff_word_append(struct roff_man *, const char *); void roff_elem_alloc(struct roff_man *, int, int, int); struct roff_node *roff_block_alloc(struct roff_man *, int, int, int); struct roff_node *roff_head_alloc(struct roff_man *, int, int, int); struct roff_node *roff_body_alloc(struct roff_man *, int, int, int); void roff_node_unlink(struct roff_man *, struct roff_node *); void roff_node_relink(struct roff_man *, struct roff_node *); void roff_node_free(struct roff_node *); void roff_node_delete(struct roff_man *, struct roff_node *); struct ohash *roffhash_alloc(enum roff_tok, enum roff_tok); enum roff_tok roffhash_find(struct ohash *, const char *, size_t); void roffhash_free(struct ohash *); void roff_state_reset(struct roff_man *); void roff_validate(struct roff_man *); /* * Functions called from roff.c need to be declared here, * not in libmdoc.h or libman.h, even if they are specific * to either the mdoc(7) or the man(7) parser. */ void man_breakscope(struct roff_man *, int); void mdoc_argv_free(struct mdoc_arg *); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/soelim.1������������������������������������������������������������������������������0100644�0001753�0001753�00000005145�14123140553�0014726�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: soelim.1,v 1.5 2017/07/04 23:40:01 schwarze Exp $ .\" .\" Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org> .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd $Mdocdate: July 4 2017 $ .Dt SOELIM 1 .Os .Sh NAME .Nm soelim .Nd interpret .so requests in manpages .Sh SYNOPSIS .Nm .Op Fl Crtv .Op Fl I Ar dir .Op Ar files ... .Sh DESCRIPTION .Nm reads .Ar files lines by lines. .Pp If a line starts by: .Dq .so anotherfile it replace the line by processing .Dq anotherfile . Otherwise the line is printed to stdout. .Bl -tag -width "-I dir" .It Fl C Recognise .Em .so when not followed by a space character. .It Fl r Compatibility with GNU groff's .Nm soelim (does nothing). .It Fl t Compatibility with GNU groff's .Nm soelim (does nothing). .It Fl v Compatibility with GNU groff's .Nm soelim (does nothing). .It Fl I Ar dir This option specify directories where .Nm searches for files (both those on the command line and those named in .Dq .so directive.) This options may be specified multiple times. The directories will be searched in the order specified. .El .Pp The files are always searched first in the current directory. .Pp A file specified with an absolute path will be opened directly without performing a search. .Sh SEE ALSO .Xr mandoc 1 .Sh AUTHORS This version of the .Nm utility was written by .An Baptiste Daroussin Aq Mt bapt@freebsd.org . ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/tag.h���������������������������������������������������������������������������������0100644�0001753�0001753�00000002777�14123140553�0014310�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: tag.h,v 1.14 2020/04/18 20:40:10 schwarze Exp $ */ /* * Copyright (c) 2015, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Internal interfaces to tag syntax tree nodes. * For use by mandoc(1) validation modules only. */ /* * Tagging priorities. * Lower numbers indicate higher importance. */ #define TAG_MANUAL 1 /* Set with a .Tg macro. */ #define TAG_STRONG 2 /* Good automatic tagging. */ #define TAG_WEAK (INT_MAX - 2) /* Dubious automatic tagging. */ #define TAG_FALLBACK (INT_MAX - 1) /* Tag only used if unique. */ #define TAG_DELETE (INT_MAX) /* Tag not used at all. */ void tag_alloc(void); int tag_exists(const char *); void tag_put(const char *, int, struct roff_node *); void tag_postprocess(struct roff_man *, struct roff_node *); void tag_free(void); �mandoc-1.14.6/tbl.3���������������������������������������������������������������������������������0100644�0001753�0001753�00000015625�14123140553�0014225�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: tbl.3,v 1.6 2018/12/14 06:33:14 schwarze Exp $ .\" .\" Copyright (c) 2013, 2015, 2018 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: December 14 2018 $ .Dt TBL 3 .Os .Sh NAME .Nm tbl_alloc , .Nm tbl_read , .Nm tbl_restart , .Nm tbl_span , .Nm tbl_end , .Nm tbl_free .Nd roff table parser library for mandoc .Sh SYNOPSIS .In sys/types.h .In tbl.h .In tbl_parse.h .Ft struct tbl_node * .Fo tbl_alloc .Fa "int pos" .Fa "int line" .Fc .Ft void .Fo tbl_read .Fa "struct tbl_node *tbl" .Fa "int ln" .Fa "const char *p" .Fa "int offs" .Fc .Ft void .Fo tbl_restart .Fa "int line" .Fa "int pos" .Fa "struct tbl_node *tbl" .Fc .Ft const struct tbl_span * .Fo tbl_span .Fa "struct tbl_node *tbl" .Fc .Ft void .Fo tbl_end .Fa "struct tbl_node **tblp" .Fc .Ft void .Fo tbl_free .Fa "struct tbl_node *tbl" .Fc .Sh DESCRIPTION This library is tightly integrated into the .Xr mandoc 1 utility and not designed for stand-alone use. The present manual is intended as a reference for developers working on .Xr mandoc 1 . .Ss Data structures Unless otherwise noted, all of the following data structures are declared in .In tbl.h and are deleted in .Fn tbl_free . .Bl -tag -width Ds .It Vt struct tbl_node This structure describes a complete table. It is declared in .In tbl_int.h , created in .Fn tbl_alloc , and stored in the members .Fa first_tbl , .Fa last_tbl , and .Fa tbl of .Vt struct roff Bq Pa roff.c . .Pp The .Fa first_span , .Fa current_span , .Fa last_span , and .Fa next members may be .Dv NULL . The .Fa first_row and .Fa last_row members may be .Dv NULL , but if there is a span, the function .Fn tbl_layout guarantees that these pointers are not .Dv NULL . .It Vt struct tbl_opts This structure describes the options of one table. It is used as a substructure of .Vt struct tbl_node and thus created and deleted together with it. It is filled in .Fn tbl_options . .It Vt struct tbl_row This structure describes one layout line in a table by maintaining a list of all the cells in that line. It is allocated and filled in .Fn row Bq Pa tbl_layout.c and referenced from the .Fa layout member of .Vt struct tbl_node . .Pp The .Fa next member may be .Dv NULL . The function .Fn tbl_layout guarantees that the .Fa first and .Fa last members are not NULL. .It Vt struct tbl_cell This structure describes one layout cell in a table, in particular its alignment, membership in spans, and usage for lines. It is allocated and filled in .Fn cell_alloc Bq Pa tbl_layout.c and referenced from the .Fa first and .Fa last members of .Vt struct tbl_row . .Pp The .Fa next member may be .Dv NULL . .It Vt struct tbl_span This structure describes one data line in a table by maintaining a list of all data cells in that line or by specifying that it is a horizontal line. It is allocated and filled in .Fn newspan Bq Pa tbl_data.c which is called from .Fn tbl_data and referenced from the .Fa first_span , .Fa current_span , and .Fa last_span members of .Vt struct tbl_node , and from the .Fa span members of .Vt struct man_node and .Vt struct mdoc_node from .In man.h and .In mdoc.h . .Pp The .Fa first , .Fa last , .Fa prev , and .Fa next members may be .Dv NULL . The function .Fn newspan Bq Pa tbl_data.c guarantees that the .Fa opts and .Fa layout members are not .Dv NULL . .It Vt struct tbl_dat This structure describes one data cell in a table by specifying whether it contains a line or data, whether it spans additional layout cells, and by storing the data. It is allocated and filled in .Fn tbl_data and referenced from the .Fa first and .Fa last members of .Vt struct tbl_span . .Pp The .Fa string and .Fa next members may be .Dv NULL . The function .Fn getdata guarantees that the .Fa layout member is not .Dv NULL . .El .Ss Interface functions The following functions are implemented in .Pa tbl.c , and all callers are in .Pa roff.c . .Bl -tag -width Ds .It Fn tbl_alloc Allocates, initializes, and returns a new .Vt struct tbl_node . Called from .Fn roff_TS . .It Fn tbl_read Dispatches to .Fn tbl_option , .Fn tbl_layout , .Fn tbl_cdata , and .Fn tbl_data , see below. Called from .Fn roff_parseln . .It Fn tbl_restart Resets the .Fa part member of .Vt struct tbl_node to .Dv TBL_PART_LAYOUT . Called from .Fn roff_T_ . .It Fn tbl_span On the first call, return the first .Vt struct tbl_span ; for later calls, return the next one or .Dv NULL . Called from .Fn roff_span . .It Fn tbl_end Flags the last span as .Dv TBL_SPAN_LAST and clears the pointer passed as an argment. Called from .Fn roff_TE and .Fn roff_endparse . .It Fn tbl_free Frees the specified .Vt struct tbl_node and all the tbl_row, tbl_cell, tbl_span, and tbl_dat structures referenced from it. Called from .Fn roff_free and .Fn roff_reset . .El .Ss Private functions The following functions are declared in .In tbl_int.h . .Bl -tag -width Ds .It Ft int Fn tbl_options "struct tbl_node *tbl" "int ln" "const char *p" Parses the options line into .Vt struct tbl_opts . Implemented in .Pa tbl_opts.c , called from .Fn tbl_read . .It Ft int Fn tbl_layout "struct tbl_node *tbl" "int ln" "const char *p" Allocates and fills one .Vt struct tbl_row for each layout line and one .Vt struct tbl_cell for each layout cell. Implemented in .Pa tbl_layout.c , called from .Fn tbl_read . .It Ft int Fn tbl_data "struct tbl_node *tbl" "int ln" "const char *p" Allocates one .Vt struct tbl_span for each data line and calls .Fn getdata for each data cell. Implemented in .Pa tbl_data.c , called from .Fn tbl_read . .It Ft int Fn tbl_cdata "struct tbl_node *tbl" "int ln" "const char *p" Continues parsing a data line: When finding .Sq T} , switches back to .Dv TBL_PART_DATA mode and calls .Fn getdata if there are more data cells on the line. Otherwise, appends the data to the current data cell. Implemented in .Pa tbl_data.c , called from .Fn tbl_read . .It Xo .Ft int .Fo getdata .Fa "struct tbl_node *tbl" .Fa "struct tbl_span *dp" .Fa "int ln" .Fa "const char *p" .Fa "int *pos" .Fc .Xc Parses one data cell into one .Vt struct tbl_dat . Implemented in .Pa tbl_data.c , called from .Fn tbl_data and .Fn tbl_cdata . .El .Sh SEE ALSO .Xr mandoc 1 , .Xr mandoc 3 , .Xr tbl 7 .Sh AUTHORS .An -nosplit The .Nm tbl library was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv with contributions from .An Ingo Schwarze Aq Mt schwarze@openbsd.org . �����������������������������������������������������������������������������������������������������������mandoc-1.14.6/tbl.7���������������������������������������������������������������������������������0100644�0001753�0001753�00000025716�14123140553�0014233�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $Id: tbl.7,v 1.37 2021/09/18 12:34:27 schwarze Exp $ .\" .\" Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2014,2015,2017,2018,2019 Ingo Schwarze <schwarze@openbsd.org> .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: September 18 2021 $ .Dt TBL 7 .Os .Sh NAME .Nm tbl .Nd tbl language reference for mandoc .Sh DESCRIPTION The .Nm tbl language formats tables. It is used within .Xr mdoc 7 and .Xr man 7 pages. This manual describes the subset of the .Nm language accepted by the .Xr mandoc 1 utility. .Pp Each table is started with a .Xr roff 7 .Ic \&TS macro, consist of at most one line of .Sx Options , one or more .Sx Layout lines, one or more .Sx Data lines, and ends with a .Ic \&TE macro. All input must be 7-bit ASCII. .Ss Options If the first input line of a table ends with a semicolon, it contains case-insensitive options separated by spaces, tabs, or commas. Otherwise, it is interpreted as the first .Sx Layout line. .Pp The following options are available. Some of them require arguments enclosed in parentheses: .Bl -tag -width Ds .It Cm allbox Draw a single-line box around each table cell. .It Cm box Draw a single-line box around the table. For GNU compatibility, this may also be invoked with .Cm frame . .It Cm center Center the table instead of left-adjusting it. For GNU compatibility, this may also be invoked with .Cm centre . .It Cm decimalpoint Use the single-character argument as the decimal point with the .Cm n layout key. This is a GNU extension. .It Cm delim Use the two characters of the argument as .Xr eqn 7 delimiters. Currently unsupported. .It Cm doublebox Draw a double-line box around the table. For GNU compatibility, this may also be invoked with .Cm doubleframe . .It Cm expand Increase the width of the table to the current line length. Currently ignored. .It Cm linesize Draw lines with the point size given by the unsigned integer argument. Currently ignored. .It Cm nokeep Allow page breaks within the table. This is a GNU extension and currently ignored. .It Cm nospaces Ignore leading and trailing spaces in data cells. This is a GNU extension. .It Cm nowarn Suppress warnings about tables exceeding the current line length. This is a GNU extension and currently ignored. .It Cm tab Use the single-character argument as a delimiter between data cells. By default, the horizontal tabulator character is used. .El .Ss Layout The table layout follows an .Sx Options line or a .Xr roff 7 .Ic \&TS or .Ic \&T& macro. Each layout line specifies how one line of .Sx Data is formatted. The last layout line ends with a full stop. It also applies to all remaining data lines. Multiple layout lines can be joined by commas on a single physical input line. .Pp Each layout line consists of one or more layout cell specifications, optionally separated by whitespace. The following case-insensitive key characters start a new cell specification: .Bl -tag -width 2n .It Cm c Center the string in this cell. .It Cm r Right-justify the string in this cell. .It Cm l Left-justify the string in this cell. .It Cm n Justify a number around its last decimal point. If no decimal point is found in the number, it is assumed to trail the number. .It Cm s Horizontally span columns from the last .Pf non- Cm s layout cell. It is an error if a column span follows a .Cm _ or .Cm = cell, or comes first on a layout line. The combined cell as a whole consumes only one cell of the corresponding data line. .It Cm a Left-justify a string and pad with one space. .It Cm \(ha Vertically span rows from the last .Pf non- Cm \(ha layout cell. It is an error to invoke a vertical span on the first layout line. Unlike a horizontal span, a vertical span consumes a data cell and discards the content. .It Cm _ Draw a single horizontal line in this cell. This consumes a data cell and discards the content. It may also be invoked with .Cm \- . .It Cm = Draw a double horizontal line in this cell. This consumes a data cell and discards the content. .El .Pp Each cell key may be followed by zero or more of the following case-insensitive modifiers: .Bl -tag -width 2n .It Cm b Use a bold font for the contents of this cell. .It Cm d Move content down to the last row of this vertical span. Currently ignored. .It Cm e Make this column wider to match the maximum width of any other column also having the .Cm e modifier. .It Cm f The next one or two characters select the font to use for this cell. One-character font names must be followed by a blank or period. See the .Xr roff 7 manual for supported font names. .It Cm i Use an italic font for the contents of this cell. .It Cm m Specify a cell start macro. This is a GNU extension and currently unsupported. .It Cm p Set the point size to the following unsigned argument, or change it by the following signed argument. Currently ignored. .It Cm v Set the vertical line spacing to the following unsigned argument, or change it by the following signed argument. Currently ignored. .It Cm t Do not vertically center content in this vertical span, leave it in the top row. Currently ignored. .It Cm u Move cell content up by half a table row. Currently ignored. .It Cm w Specify a minimum column width. .It Cm x After determining the width of all other columns, distribute the rest of the line length among all columns having the .Cm x modifier. .It Cm z Do not use this cell for determining the width of this column. .It Cm \&| Draw a single vertical line to the right of this cell. .It Cm || Draw a double vertical line to the right of this cell. .El .Pp If a modifier consists of decimal digits, it specifies a minimum spacing in units of .Cm n between this column and the next column to the right. The default is 3. If there is a vertical line, it is drawn inside the spacing. .Ss Data The data section follows the last .Sx Layout line. Each data line consists of one or more data cells, delimited by .Cm tab characters. .Pp If a data cell contains only the two bytes .Ql \e\(ha , the cell above spans to this row, as if the layout specification of this cell were .Cm \(ha . .Pp If a data cell contains only the single character .Ql _ or .Ql = , a single or double horizontal line is drawn across the cell, joining its neighbours. If a data cell contains only the two character sequence .Ql \e_ or .Ql \e= , a single or double horizontal line is drawn inside the cell, not joining its neighbours. If a data line contains nothing but the single character .Ql _ or .Ql = , a horizontal line across the whole table is inserted without consuming a layout row. .Pp In place of any data cell, a text block can be used. It starts with .Ic \&T{ at the end of a physical input line. Input line breaks inside the text block neither end the text block nor its data cell. It only ends if .Ic \&T} occurs at the beginning of a physical input line and is followed by an end-of-cell indicator. If the .Ic \&T} is followed by the end of the physical input line, the text block, the data cell, and the data line ends at this point. If the .Ic \&T} is followed by the .Cm tab character, only the text block and the data cell end, but the data line continues with the data cell following the .Cm tab character. If .Ic \&T} is followed by any other character, it does not end the text block, which instead continues to the following physical input line. .Sh EXAMPLES String justification and font selection: .Bd -literal -offset indent \&.TS rb c lb r ci l. r center l ri ce le right c left \&.TE .Ed .Bd -filled -offset indent .TS rb c lb r ci l. r center l ri ce le right c left .TE .Ed .Pp Some ports in .Ox 6.1 to show number alignment and line drawing: .Bd -literal -offset indent \&.TS box tab(:); r| l r n. software:version _ AFL:2.39b Mutt:1.8.0 Ruby:1.8.7.374 TeX Live:2015 \&.TE .Ed .Bd -filled -offset indent .TS box tab(:); r| l r n. software:version _ AFL:2.39b Mutt:1.8.0 Ruby:1.8.7.374 TeX Live:2015 .TE .Ed .sp 2v Spans and skipping width calculations: .Bd -literal -offset indent \&.TS box tab(:); lz s | rt lt| cb| \(ha \(ha | rz s. left:r l:center: :right \&.TE .Ed .Bd -filled -offset indent .TS box tab(:); lz s | rt lt| cb| ^ ^ | rz s. left:r l:center: :right .TE .Ed .sp 2v Text blocks, specifying spacings and specifying and equalizing column widths, putting lines into individual cells, and overriding .Cm allbox : .Bd -literal -offset indent \&.TS allbox tab(:); le le||7 lw10. The fourth line:_:line 1 of this column:=:line 2 determines:\_:line 3 the column width.:T{ This text is too wide to fit into a column of width 17. T}:line 4 T{ No break here. T}::line 5 \&.TE .Ed .Bd -filled -offset indent .TS allbox tab(:); le le||7 lw10. The fourth line:_:line 1 of this column:=:line 2 determines:\_:line 3 the column width.:T{ This text is too wide to fit into a column of width 17. T}:line 4 T{ No break here. T}::line 5 .TE .Ed .sp 2v These examples were constructed to demonstrate many .Nm features in a compact way. In real manual pages, keep tables as simple as possible. They usually look better, are less fragile, and are more portable. .Sh COMPATIBILITY The .Xr mandoc 1 implementation of .Nm doesn't support .Xr mdoc 7 and .Xr man 7 macros and .Xr eqn 7 equations inside tables. .Sh SEE ALSO .Xr mandoc 1 , .Xr man 7 , .Xr mandoc_char 7 , .Xr mdoc 7 , .Xr roff 7 .Rs .%A M. E. Lesk .%T Tbl \(em A Program to Format Tables .%D June 11, 1976 .Re .Sh HISTORY The tbl utility, a preprocessor for troff, was originally written by M. E. Lesk at Bell Labs in 1975. The GNU reimplementation of tbl, part of the groff package, was released in 1990 by James Clark. A standalone tbl implementation was written by Kristaps Dzonsons in 2010. This formed the basis of the implementation that first appeared in .Ox 4.9 as a part of the .Xr mandoc 1 utility. .Sh AUTHORS This .Nm reference was written by .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv and .An Ingo Schwarze Aq Mt schwarze@openbsd.org . .Sh BUGS In .Fl T .Cm utf8 output mode, heavy lines are drawn instead of double lines. This cannot be improved because the Unicode standard only provides an incomplete set of box drawing characters with double lines, whereas it provides a full set of box drawing characters with heavy lines. It is unlikely this can be improved in the future because the box drawing characters are already marked in Unicode as characters intended only for backward compatibility with legacy systems, and their use is not encouraged. So it seems unlikely that the missing ones might get added in the future. ��������������������������������������������������mandoc-1.14.6/tbl.h���������������������������������������������������������������������������������0100644�0001753�0001753�00000010564�14123140553�0014307�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: tbl.h,v 1.2 2021/08/10 12:55:04 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014,2015,2017,2018,2021 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct tbl_opts { int opts; #define TBL_OPT_ALLBOX (1 << 0) /* Option "allbox". */ #define TBL_OPT_BOX (1 << 1) /* Option "box". */ #define TBL_OPT_CENTRE (1 << 2) /* Option "center". */ #define TBL_OPT_DBOX (1 << 3) /* Option "doublebox". */ #define TBL_OPT_EXPAND (1 << 4) /* Option "expand". */ #define TBL_OPT_NOKEEP (1 << 5) /* Option "nokeep". */ #define TBL_OPT_NOSPACE (1 << 6) /* Option "nospaces". */ #define TBL_OPT_NOWARN (1 << 7) /* Option "nowarn". */ int cols; /* Number of columns. */ int lvert; /* Width of left vertical line. */ int rvert; /* Width of right vertical line. */ char tab; /* Option "tab": cell separator. */ char decimal; /* Option "decimalpoint". */ }; enum tbl_cellt { TBL_CELL_CENTRE, /* c, C */ TBL_CELL_RIGHT, /* r, R */ TBL_CELL_LEFT, /* l, L */ TBL_CELL_NUMBER, /* n, N */ TBL_CELL_SPAN, /* s, S */ TBL_CELL_LONG, /* a, A */ TBL_CELL_DOWN, /* ^ */ TBL_CELL_HORIZ, /* _, - */ TBL_CELL_DHORIZ, /* = */ TBL_CELL_MAX }; /* * A cell in a layout row. */ struct tbl_cell { struct tbl_cell *next; /* Layout cell to the right. */ char *wstr; /* Min width represented as a string. */ size_t width; /* Minimum column width. */ size_t spacing; /* To the right of the column. */ int vert; /* Width of subsequent vertical line. */ int col; /* Column number, starting from 0. */ int flags; #define TBL_CELL_TALIGN (1 << 2) /* t, T */ #define TBL_CELL_UP (1 << 3) /* u, U */ #define TBL_CELL_BALIGN (1 << 4) /* d, D */ #define TBL_CELL_WIGN (1 << 5) /* z, Z */ #define TBL_CELL_EQUAL (1 << 6) /* e, E */ #define TBL_CELL_WMAX (1 << 7) /* x, X */ enum mandoc_esc font; enum tbl_cellt pos; }; /* * A layout row. */ struct tbl_row { struct tbl_row *next; /* Layout row below. */ struct tbl_cell *first; /* Leftmost layout cell. */ struct tbl_cell *last; /* Rightmost layout cell. */ int vert; /* Width of left vertical line. */ }; enum tbl_datt { TBL_DATA_NONE, /* Uninitialized row. */ TBL_DATA_DATA, /* Contains data rather than a line. */ TBL_DATA_HORIZ, /* _: connecting horizontal line. */ TBL_DATA_DHORIZ, /* =: connecting double horizontal line. */ TBL_DATA_NHORIZ, /* \_: isolated horizontal line. */ TBL_DATA_NDHORIZ /* \=: isolated double horizontal line. */ }; /* * A cell within a row of data. The "string" field contains the * actual string value that's in the cell. The rest is layout. */ struct tbl_dat { struct tbl_dat *next; /* Data cell to the right. */ struct tbl_cell *layout; /* Associated layout cell. */ char *string; /* Data, or NULL if not TBL_DATA_DATA. */ int hspans; /* How many horizontal spans follow. */ int vspans; /* How many vertical spans follow. */ int block; /* T{ text block T} */ enum tbl_datt pos; }; enum tbl_spant { TBL_SPAN_DATA, /* Contains data rather than a line. */ TBL_SPAN_HORIZ, /* _: horizontal line. */ TBL_SPAN_DHORIZ /* =: double horizontal line. */ }; /* * A row of data in a table. */ struct tbl_span { struct tbl_opts *opts; /* Options for the table as a whole. */ struct tbl_span *prev; /* Data row above. */ struct tbl_span *next; /* Data row below. */ struct tbl_row *layout; /* Associated layout row. */ struct tbl_dat *first; /* Leftmost data cell. */ struct tbl_dat *last; /* Rightmost data cell. */ int line; /* Input file line number. */ enum tbl_spant pos; }; ��������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/tbl_int.h�����������������������������������������������������������������������������0100644�0001753�0001753�00000004131�14123140553�0015152�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: tbl_int.h,v 1.2 2018/12/14 06:33:14 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011,2013,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Internal interfaces of the tbl(7) parser. * For use inside the tbl(7) parser only. */ enum tbl_part { TBL_PART_OPTS, /* In the first line, ends with semicolon. */ TBL_PART_LAYOUT, /* In the layout section, ends with full stop. */ TBL_PART_DATA, /* In the data section, ends with TE. */ TBL_PART_CDATA /* In a T{ block, ends with T} */ }; struct tbl_node { struct tbl_opts opts; /* Options for the whole table. */ struct tbl_node *next; /* Next table. */ struct tbl_row *first_row; /* First layout row. */ struct tbl_row *last_row; /* Last layout row. */ struct tbl_span *first_span; /* First data row. */ struct tbl_span *current_span; /* Data row being parsed. */ struct tbl_span *last_span; /* Last data row. */ int line; /* Line number in input file. */ int pos; /* Column number in input file. */ enum tbl_part part; /* Table section being parsed. */ }; void tbl_option(struct tbl_node *, int, const char *, int *); void tbl_layout(struct tbl_node *, int, const char *, int); void tbl_data(struct tbl_node *, int, const char *, int); void tbl_cdata(struct tbl_node *, int, const char *, int); void tbl_reset(struct tbl_node *); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/tbl_parse.h���������������������������������������������������������������������������0100644�0001753�0001753�00000002501�14123140553�0015471�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: tbl_parse.h,v 1.2 2018/12/14 06:33:14 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2017 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * External interface of the tbl(7) parser. * For use in the roff(7) and tbl(7) parsers only. */ struct tbl_node; struct tbl_span; struct tbl_node *tbl_alloc(int, int, struct tbl_node *); int tbl_end(struct tbl_node *, int); void tbl_free(struct tbl_node *); void tbl_read(struct tbl_node *, int, const char *, int); void tbl_restart(int, int, struct tbl_node *); struct tbl_span *tbl_span(struct tbl_node *); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/term.h��������������������������������������������������������������������������������0100644�0001753�0001753�00000014213�14123140553�0014470�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: term.h,v 1.131 2019/01/04 03:21:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2015, 2017, 2019 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ enum termenc { TERMENC_ASCII, TERMENC_LOCALE, TERMENC_UTF8 }; enum termtype { TERMTYPE_CHAR, TERMTYPE_PS, TERMTYPE_PDF }; enum termfont { TERMFONT_NONE = 0, TERMFONT_BOLD, TERMFONT_UNDER, TERMFONT_BI, TERMFONT__MAX }; struct eqn_box; struct roff_meta; struct roff_node; struct tbl_span; struct termp; typedef void (*term_margin)(struct termp *, const struct roff_meta *); struct termp_tbl { int width; /* width in fixed chars */ int decimal; /* decimal point position */ }; struct termp_col { int *buf; /* Output buffer. */ size_t maxcols; /* Allocated bytes in buf. */ size_t lastcol; /* Last byte in buf. */ size_t col; /* Byte in buf to be written. */ size_t rmargin; /* Current right margin. */ size_t offset; /* Current left margin. */ }; struct termp { struct rofftbl tbl; /* Table configuration. */ struct termp_col *tcols; /* Array of table columns. */ struct termp_col *tcol; /* Current table column. */ size_t maxtcol; /* Allocated table columns. */ size_t lasttcol; /* Last column currently used. */ size_t line; /* Current output line number. */ size_t defindent; /* Default indent for text. */ size_t defrmargin; /* Right margin of the device. */ size_t lastrmargin; /* Right margin before the last ll. */ size_t maxrmargin; /* Max right margin. */ size_t col; /* Byte position in buf. */ size_t viscol; /* Chars on current line. */ size_t trailspace; /* See term_flushln(). */ size_t minbl; /* Minimum blanks before next field. */ int synopsisonly; /* Print the synopsis only. */ int mdocstyle; /* Imitate mdoc(7) output. */ int ti; /* Temporary indent for one line. */ int skipvsp; /* Vertical space to skip. */ int flags; #define TERMP_SENTENCE (1 << 0) /* Space before a sentence. */ #define TERMP_NOSPACE (1 << 1) /* No space before words. */ #define TERMP_NONOSPACE (1 << 2) /* No space (no autounset). */ #define TERMP_NBRWORD (1 << 3) /* Make next word nonbreaking. */ #define TERMP_KEEP (1 << 4) /* Keep words together. */ #define TERMP_PREKEEP (1 << 5) /* ...starting with the next one. */ #define TERMP_BACKAFTER (1 << 6) /* Back up after next character. */ #define TERMP_BACKBEFORE (1 << 7) /* Back up before next character. */ #define TERMP_NOBREAK (1 << 8) /* See term_flushln(). */ #define TERMP_BRTRSP (1 << 9) /* See term_flushln(). */ #define TERMP_BRIND (1 << 10) /* See term_flushln(). */ #define TERMP_HANG (1 << 11) /* See term_flushln(). */ #define TERMP_NOPAD (1 << 12) /* See term_flushln(). */ #define TERMP_NOSPLIT (1 << 13) /* Do not break line before .An. */ #define TERMP_SPLIT (1 << 14) /* Break line before .An. */ #define TERMP_NONEWLINE (1 << 15) /* No line break in nofill mode. */ #define TERMP_BRNEVER (1 << 16) /* Don't even break at maxrmargin. */ #define TERMP_NOBUF (1 << 17) /* Bypass output buffer. */ #define TERMP_NEWMC (1 << 18) /* No .mc printed yet. */ #define TERMP_ENDMC (1 << 19) /* Next break ends .mc mode. */ #define TERMP_MULTICOL (1 << 20) /* Multiple column mode. */ #define TERMP_CENTER (1 << 21) /* Center output lines. */ #define TERMP_RIGHT (1 << 22) /* Adjust to the right margin. */ enum termtype type; /* Terminal, PS, or PDF. */ enum termenc enc; /* Type of encoding. */ enum termfont fontl; /* Last font set. */ enum termfont *fontq; /* Symmetric fonts. */ int fontsz; /* Allocated size of font stack */ int fonti; /* Index of font stack. */ term_margin headf; /* invoked to print head */ term_margin footf; /* invoked to print foot */ void (*letter)(struct termp *, int); void (*begin)(struct termp *); void (*end)(struct termp *); void (*endline)(struct termp *); void (*advance)(struct termp *, size_t); void (*setwidth)(struct termp *, int, int); size_t (*width)(const struct termp *, int); int (*hspan)(const struct termp *, const struct roffsu *); const void *argf; /* arg for headf/footf */ const char *mc; /* Margin character. */ struct termp_ps *ps; }; const char *ascii_uc2str(int); void roff_term_pre(struct termp *, const struct roff_node *); void term_eqn(struct termp *, const struct eqn_box *); void term_tbl(struct termp *, const struct tbl_span *); void term_free(struct termp *); void term_setcol(struct termp *, size_t); void term_newln(struct termp *); void term_vspace(struct termp *); void term_word(struct termp *, const char *); void term_flushln(struct termp *); void term_begin(struct termp *, term_margin, term_margin, const struct roff_meta *); void term_end(struct termp *); void term_setwidth(struct termp *, const char *); int term_hspan(const struct termp *, const struct roffsu *); int term_hen(const struct termp *, const struct roffsu *); int term_vspan(const struct termp *, const struct roffsu *); size_t term_strlen(const struct termp *, const char *); size_t term_len(const struct termp *, size_t); void term_tab_set(const struct termp *, const char *); void term_tab_iset(size_t); size_t term_tab_next(size_t); void term_fontpush(struct termp *, enum termfont); void term_fontpop(struct termp *); void term_fontpopq(struct termp *, int); void term_fontrepl(struct termp *, enum termfont); void term_fontlast(struct termp *); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/term_tag.h����������������������������������������������������������������������������0100644�0001753�0001753�00000002705�14123140553�0015326�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: term_tag.h,v 1.4 2021/03/30 17:16:55 schwarze Exp $ */ /* * Copyright (c) 2015, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Internal interfaces to write a ctags(1) file. * For use by the mandoc(1) ASCII and UTF-8 formatters only. */ struct tag_files { char ofn[80]; /* Output file name. */ char tfn[80]; /* Tag file name. */ FILE *tfs; /* Tag file object. */ int ofd; /* Original output file descriptor. */ pid_t tcpgid; /* Process group controlling the terminal. */ pid_t pager_pid; /* Process ID of the pager. */ }; struct tag_files *term_tag_init(const char *, const char *, const char *); void term_tag_write(struct roff_node *, size_t); int term_tag_close(void); void term_tag_unlink(void); �����������������������������������������������������������mandoc-1.14.6/arch.c��������������������������������������������������������������������������������0100644�0001753�0001753�00000003723�14123140553�0014435�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: arch.c,v 1.17 2021/05/13 13:33:11 schwarze Exp $ */ /* * Copyright (c) 2017, 2019 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include <string.h> #include "roff.h" int arch_valid(const char *arch, enum mandoc_os os) { const char *openbsd_arch[] = { "alpha", "amd64", "arm64", "armv7", "hppa", "i386", "landisk", "loongson", "luna88k", "macppc", "mips64", "octeon", "powerpc64", "riscv64", "sparc64", NULL }; const char *netbsd_arch[] = { "acorn26", "acorn32", "algor", "alpha", "amiga", "arc", "atari", "bebox", "cats", "cesfic", "cobalt", "dreamcast", "emips", "evbarm", "evbmips", "evbppc", "evbsh3", "evbsh5", "hp300", "hpcarm", "hpcmips", "hpcsh", "hppa", "i386", "ibmnws", "luna68k", "mac68k", "macppc", "mipsco", "mmeye", "mvme68k", "mvmeppc", "netwinder", "news68k", "newsmips", "next68k", "pc532", "playstation2", "pmax", "pmppc", "prep", "sandpoint", "sbmips", "sgimips", "shark", "sparc", "sparc64", "sun2", "sun3", "vax", "walnut", "x68k", "x86", "x86_64", "xen", NULL }; const char **arches[] = { NULL, netbsd_arch, openbsd_arch }; const char **arch_p; if ((arch_p = arches[os]) == NULL) return 1; for (; *arch_p != NULL; arch_p++) if (strcmp(*arch_p, arch) == 0) return 1; return 0; } ���������������������������������������������mandoc-1.14.6/att.c���������������������������������������������������������������������������������0100644�0001753�0001753�00000003173�14123140553�0014307�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: att.c,v 1.19 2021/09/04 20:26:43 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include <sys/types.h> #include <string.h> #include "roff.h" #include "libmdoc.h" #define LINE(x, y) \ if (0 == strcmp(p, x)) return(y) const char * mdoc_a2att(const char *p) { LINE("v1", "Version\\~1 AT&T UNIX"); LINE("v2", "Version\\~2 AT&T UNIX"); LINE("v3", "Version\\~3 AT&T UNIX"); LINE("v4", "Version\\~4 AT&T UNIX"); LINE("v5", "Version\\~5 AT&T UNIX"); LINE("v6", "Version\\~6 AT&T UNIX"); LINE("v7", "Version\\~7 AT&T UNIX"); LINE("32v", "Version\\~7 AT&T UNIX/32V"); LINE("III", "AT&T System\\~III UNIX"); LINE("V", "AT&T System\\~V UNIX"); LINE("V.1", "AT&T System\\~V Release\\~1 UNIX"); LINE("V.2", "AT&T System\\~V Release\\~2 UNIX"); LINE("V.3", "AT&T System\\~V Release\\~3 UNIX"); LINE("V.4", "AT&T System\\~V Release\\~4 UNIX"); return NULL; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/catman.c������������������������������������������������������������������������������0100644�0001753�0001753�00000013022�14123140553�0014754�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: catman.c,v 1.22 2020/06/14 23:40:31 schwarze Exp $ */ /* * Copyright (c) 2017 Michael Stapelberg <stapelberg@debian.org> * Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #if NEED_XPG4_2 #define _XPG4_2 #endif #include <sys/types.h> #include <sys/socket.h> #include <sys/stat.h> #if HAVE_ERR #include <err.h> #endif #include <errno.h> #include <fcntl.h> #if HAVE_FTS #include <fts.h> #else #include "compat_fts.h" #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> int process_manpage(int, int, const char *); int process_tree(int, int); void run_mandocd(int, const char *, const char *) __attribute__((__noreturn__)); ssize_t sock_fd_write(int, int, int, int); void usage(void) __attribute__((__noreturn__)); void run_mandocd(int sockfd, const char *outtype, const char* defos) { char sockfdstr[10]; if (snprintf(sockfdstr, sizeof(sockfdstr), "%d", sockfd) == -1) err(1, "snprintf"); if (defos == NULL) execlp("mandocd", "mandocd", "-T", outtype, sockfdstr, (char *)NULL); else execlp("mandocd", "mandocd", "-T", outtype, "-I", defos, sockfdstr, (char *)NULL); err(1, "exec"); } ssize_t sock_fd_write(int fd, int fd0, int fd1, int fd2) { const struct timespec timeout = { 0, 10000000 }; /* 0.01 s */ struct msghdr msg; struct iovec iov; union { struct cmsghdr cmsghdr; char control[CMSG_SPACE(3 * sizeof(int))]; } cmsgu; struct cmsghdr *cmsg; int *walk; ssize_t sz; unsigned char dummy[1] = {'\0'}; iov.iov_base = dummy; iov.iov_len = sizeof(dummy); msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = cmsgu.control; msg.msg_controllen = sizeof(cmsgu.control); cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_len = CMSG_LEN(3 * sizeof(int)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; walk = (int *)CMSG_DATA(cmsg); *(walk++) = fd0; *(walk++) = fd1; *(walk++) = fd2; /* * It appears that on some systems, sendmsg(3) * may return EAGAIN even in blocking mode. * Seen for example on Oracle Solaris 11.2. * The sleeping time was chosen by experimentation, * to neither cause more than a handful of retries * in normal operation nor unnecessary delays. */ for (;;) { if ((sz = sendmsg(fd, &msg, 0)) != -1 || errno != EAGAIN) break; nanosleep(&timeout, NULL); } return sz; } int process_manpage(int srv_fd, int dstdir_fd, const char *path) { int in_fd, out_fd; int irc; if ((in_fd = open(path, O_RDONLY)) == -1) { warn("open(%s)", path); return 0; } if ((out_fd = openat(dstdir_fd, path, O_WRONLY | O_NOFOLLOW | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1) { warn("openat(%s)", path); close(in_fd); return 0; } irc = sock_fd_write(srv_fd, in_fd, out_fd, STDERR_FILENO); close(in_fd); close(out_fd); if (irc < 0) { warn("sendmsg"); return -1; } return 0; } int process_tree(int srv_fd, int dstdir_fd) { FTS *ftsp; FTSENT *entry; const char *argv[2]; const char *path; argv[0] = "."; argv[1] = (char *)NULL; if ((ftsp = fts_open((char * const *)argv, FTS_PHYSICAL | FTS_NOCHDIR, NULL)) == NULL) { warn("fts_open"); return -1; } while ((entry = fts_read(ftsp)) != NULL) { path = entry->fts_path + 2; switch (entry->fts_info) { case FTS_F: if (process_manpage(srv_fd, dstdir_fd, path) == -1) { fts_close(ftsp); return -1; } break; case FTS_D: if (*path != '\0' && mkdirat(dstdir_fd, path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == -1 && errno != EEXIST) { warn("mkdirat(%s)", path); (void)fts_set(ftsp, entry, FTS_SKIP); } break; case FTS_DP: break; default: warnx("%s: not a regular file", path); break; } } fts_close(ftsp); return 0; } int main(int argc, char **argv) { const char *defos, *outtype; int srv_fds[2]; int dstdir_fd; int opt; pid_t pid; defos = NULL; outtype = "ascii"; while ((opt = getopt(argc, argv, "I:T:")) != -1) { switch (opt) { case 'I': defos = optarg; break; case 'T': outtype = optarg; break; default: usage(); } } if (argc > 0) { argc -= optind; argv += optind; } if (argc != 2) usage(); if (socketpair(AF_LOCAL, SOCK_STREAM, AF_UNSPEC, srv_fds) == -1) err(1, "socketpair"); pid = fork(); switch (pid) { case -1: err(1, "fork"); case 0: close(srv_fds[0]); run_mandocd(srv_fds[1], outtype, defos); default: break; } close(srv_fds[1]); if ((dstdir_fd = open(argv[1], O_RDONLY | O_DIRECTORY)) == -1) err(1, "open(%s)", argv[1]); if (chdir(argv[0]) == -1) err(1, "chdir(%s)", argv[0]); return process_tree(srv_fds[0], dstdir_fd) == -1 ? 1 : 0; } void usage(void) { fprintf(stderr, "usage: %s [-I os=name] [-T output] " "srcdir dstdir\n", BINM_CATMAN); exit(1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mandoc-1.14.6/cgi.c���������������������������������������������������������������������������������0100644�0001753�0001753�00000067403�14123140553�0014267�0����������������������������������������������������������������������������������������������������ustar�00schwarze������������������������schwarze���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $Id: cgi.c,v 1.175 2021/08/19 15:23:36 schwarze Exp $ */ /* * Copyright (c) 2014-2019, 2021 Ingo Schwarze <schwarze@usta.de> * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Implementation of the man.cgi(8) program. */ #include "config.h" #include <sys/types.h> #include <sys/time.h> #include <ctype.h> #if HAVE_ERR #include <err.h> #endif #include <errno.h> #include <fcntl.h> #include <limits.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "man.h" #include "mandoc_parse.h" #include "main.h" #include "manconf.h" #include "mansearch.h" #include "cgi.h" /* * A query as passed to the search function. */ struct query { char *manpath; /* desired manual directory */ char *arch; /* architecture */ char *sec; /* manual section */ char *query; /* unparsed query expression */ int equal; /* match whole names, not substrings */ }; struct req { struct query q; char **p; /* array of available manpaths */ size_t psz; /* number of available manpaths */ int isquery; /* QUERY_STRING used, not PATH_INFO */ }; enum focus { FOCUS_NONE = 0, FOCUS_QUERY }; static void html_print(const char *); static void html_putchar(char); static int http_decode(char *); static void http_encode(const char *); static void parse_manpath_conf(struct req *); static void parse_path_info(struct req *, const char *); static void parse_query_string(struct req *, const char *); static void pg_error_badrequest(const char *); static void pg_error_internal(void); static void pg_index(const struct req *); static void pg_noresult(const struct req *, int, const char *, const char *); static void pg_redirect(const struct req *, const char *); static void pg_search(const struct req *); static void pg_searchres(const struct req *, struct manpage *, size_t); static void pg_show(struct req *, const char *); static void resp_begin_html(int, const char *, const char *); static void resp_begin_http(int, const char *); static void resp_catman(const struct req *, const char *); static void resp_copy(const char *); static void resp_end_html(void); static void resp_format(const struct req *, const char *); static void resp_searchform(const struct req *, enum focus); static void resp_show(const struct req *, const char *); static void set_query_attr(char **, char **); static int validate_arch(const char *); static int validate_filename(const char *); static int validate_manpath(const struct req *, const char *); static int validate_urifrag(const char *); static const char *scriptname = SCRIPT_NAME; static const int sec_prios[] = {1, 4, 5, 8, 6, 3, 7, 2, 9}; static const char *const sec_numbers[] = { "0", "1", "2", "3", "3p", "4", "5", "6", "7", "8", "9" }; static const char *const sec_names[] = { "All Sections", "1 - General Commands", "2 - System Calls", "3 - Library Functions", "3p - Perl Library", "4 - Device Drivers", "5 - File Formats", "6 - Games", "7 - Miscellaneous Information", "8 - System Manager\'s Manual", "9 - Kernel Developer\'s Manual" }; static const int sec_MAX = sizeof(sec_names) / sizeof(char *); static const char *const arch_names[] = { "amd64", "alpha", "armv7", "arm64", "hppa", "i386", "landisk", "loongson", "luna88k", "macppc", "mips64", "octeon", "powerpc64", "riscv64", "sparc64", "amiga", "arc", "armish", "arm32", "atari", "aviion", "beagle", "cats", "hppa64", "hp300", "ia64", "mac68k", "mvme68k", "mvme88k", "mvmeppc", "palm", "pc532", "pegasos", "pmax", "powerpc", "sgi", "socppc", "solbourne", "sparc", "sun3", "vax", "wgrisc", "x68k", "zaurus" }; static const int arch_MAX = sizeof(arch_names) / sizeof(char *); /* * Print a character, escaping HTML along the way. * This will pass non-ASCII straight to output: be warned! */ static void html_putchar(char c) { switch (c) { case '"': printf("""); break; case '&': printf("&"); break; case '>': printf(">"); break; case '<': printf("<"); break; default: putchar((unsigned char)c); break; } } /* * Call through to html_putchar(). * Accepts NULL strings. */ static void html_print(const char *p) { if (NULL == p) return; while ('\0' != *p) html_putchar(*p++); } /* * Transfer the responsibility for the allocated string *val * to the query structure. */ static void set_query_attr(char **attr, char **val) { free(*attr); if (**val == '\0') { *attr = NULL; free(*val); } else *attr = *val; *val = NULL; } /* * Parse the QUERY_STRING for key-value pairs * and store the values into the query structure. */ static void parse_query_string(struct req *req, const char *qs) { char *key, *val; size_t keysz, valsz; req->isquery = 1; req->q.manpath = NULL; req->q.arch = NULL; req->q.sec = NULL; req->q.query = NULL; req->q.equal = 1; key = val = NULL; while (*qs != '\0') { /* Parse one key. */ keysz = strcspn(qs, "=;&"); key = mandoc_strndup(qs, keysz); qs += keysz; if (*qs != '=') goto next; /* Parse one value. */ valsz = strcspn(++qs, ";&"); val = mandoc_strndup(qs, valsz); qs += valsz; /* Decode and catch encoding errors. */ if ( ! (http_decode(key) && http_decode(val))) goto next; /* Handle key-value pairs. */ if ( ! strcmp(key, "query")) set_query_attr(&req->q.query, &val); else if ( ! strcmp(key, "apropos")) req->q.equal = !strcmp(val, "0"); else if ( ! strcmp(key, "manpath")) { #ifdef COMPAT_OLDURI if ( ! strncmp(val, "OpenBSD ", 8)) { val[7] = '-'; if ('C' == val[8]) val[8] = 'c'; } #endif set_query_attr(&req->q.manpath, &val); } else if ( ! (strcmp(key, "sec") #ifdef COMPAT_OLDURI && strcmp(key, "sektion") #endif )) { if ( ! strcmp(val, "0")) *val = '\0'; set_query_attr(&req->q.sec, &val); } else if ( ! strcmp(key, "arch")) { if ( ! strcmp(val, "default")) *val = '\0'; set_query_attr(&req->q.arch, &val); } /* * The key must be freed in any case. * The val may have been handed over to the query * structure, in which case it is now NULL. */ next: free(key); key = NULL; free(val); val = NULL; if (*qs != '\0') qs++; } } /* * HTTP-decode a string. The standard explanation is that this turns * "%4e+foo" into "n foo" in the regular way. This is done in-place * over the allocated string. */ static int http_decode(char *p) { char hex[3]; char *q; int c; hex[2] = '\0'; q = p; for ( ; '\0' != *p; p++, q++) { if ('%' == *p) { if ('\0' == (hex[0] = *(p + 1))) return 0; if ('\0' == (hex[1] = *(p + 2))) return 0; if (1 != sscanf(hex, "%x", &c)) return 0; if ('\0' == c) return 0; *q = (char)c; p += 2; } else *q = '+' == *p ? ' ' : *p; } *q = '\0'; return 1; } static void http_encode(const char *p) { for (; *p != '\0'; p++) { if (isalnum((unsigned char)*p) == 0 && strchr("-._~", *p) == NULL) printf("%%%2.2X", (unsigned char)*p); else putchar(*p); } } static void resp_begin_http(int code, const char *msg) { if (200 != code) printf("Status: %d %s\r\n", code, msg); printf("Content-Type: text/html; charset=utf-8\r\n" "Cache-Control: no-cache\r\n" "Content-Security-Policy: default-src 'none'; " "style-src 'self' 'unsafe-inline'\r\n" "Pragma: no-cache\r\n" "\r\n"); fflush(stdout); } static void resp_copy(const char *filename) { char buf[4096]; ssize_t sz; int fd; if ((fd = open(filename, O_RDONLY)) != -1) { fflush(stdout); while ((sz = read(fd, buf, sizeof(buf))) > 0) write(STDOUT_FILENO, buf, sz); close(fd); } } static void resp_begin_html(int code, const char *msg, const char *file) { const char *name, *sec, *cp; int namesz, secsz; resp_begin_http(code, msg); printf("<!DOCTYPE html>\n" "<html>\n" "<head>\n" " <meta charset=\"UTF-8\"/>\n" " <meta name=\"viewport\"" " content=\"width=device-width, initial-scale=1.0\">\n" " <link rel=\"stylesheet\" href=\"%s/mandoc.css\"" " type=\"text/css\" media=\"all\">\n" " <title>", CSS_DIR); if (file != NULL) { cp = strrchr(file, '/'); name = cp == NULL ? file : cp + 1; cp = strrchr(name, '.'); namesz = cp == NULL ? strlen(name) : cp - name; sec = NULL; if (cp != NULL && cp[1] != '0') { sec = cp + 1; secsz = strlen(sec); } else if (name - file > 1) { for (cp = name - 2; cp >= file; cp--) { if (*cp < '1' || *cp > '9') continue; sec = cp; secsz = name - cp - 1; break; } } printf("%.*s", namesz, name); if (sec != NULL) printf("(%.*s)", secsz, sec); fputs(" - ", stdout); } printf("%s\n" "\n" "\n", CUSTOMIZE_TITLE); resp_copy(MAN_DIR "/header.html"); } static void resp_end_html(void) { resp_copy(MAN_DIR "/footer.html"); puts("\n" ""); } static void resp_searchform(const struct req *req, enum focus focus) { int i; printf("
\n" "
\n" " Manual Page Search Parameters\n", scriptname); /* Write query input box. */ printf(" q.query != NULL) html_print(req->q.query); printf( "\" size=\"40\""); if (focus == FOCUS_QUERY) printf(" autofocus"); puts(">"); /* Write submission buttons. */ printf( " \n" " \n" "
\n"); /* Write section selector. */ puts(" "); /* Write architecture selector. */ printf( " "); /* Write manpath selector. */ if (req->psz > 1) { puts(" "); } puts("
\n" "
"); } static int validate_urifrag(const char *frag) { while ('\0' != *frag) { if ( ! (isalnum((unsigned char)*frag) || '-' == *frag || '.' == *frag || '/' == *frag || '_' == *frag)) return 0; frag++; } return 1; } static int validate_manpath(const struct req *req, const char* manpath) { size_t i; for (i = 0; i < req->psz; i++) if ( ! strcmp(manpath, req->p[i])) return 1; return 0; } static int validate_arch(const char *arch) { int i; for (i = 0; i < arch_MAX; i++) if (strcmp(arch, arch_names[i]) == 0) return 1; return 0; } static int validate_filename(const char *file) { if ('.' == file[0] && '/' == file[1]) file += 2; return ! (strstr(file, "../") || strstr(file, "/..") || (strncmp(file, "man", 3) && strncmp(file, "cat", 3))); } static void pg_index(const struct req *req) { resp_begin_html(200, NULL, NULL); resp_searchform(req, FOCUS_QUERY); printf("

\n" "This web interface is documented in the\n" "man.cgi(8)\n" "manual, and the\n" "apropos(1)\n" "manual explains the query syntax.\n" "

\n", scriptname, *scriptname == '\0' ? "" : "/", scriptname, *scriptname == '\0' ? "" : "/"); resp_end_html(); } static void pg_noresult(const struct req *req, int code, const char *http_msg, const char *user_msg) { resp_begin_html(code, http_msg, NULL); resp_searchform(req, FOCUS_QUERY); puts("

"); puts(user_msg); puts("

"); resp_end_html(); } static void pg_error_badrequest(const char *msg) { resp_begin_html(400, "Bad Request", NULL); puts("

Bad Request

\n" "

\n"); puts(msg); printf("Try again from the\n" "main page.\n" "

", scriptname); resp_end_html(); } static void pg_error_internal(void) { resp_begin_html(500, "Internal Server Error", NULL); puts("

Internal Server Error

"); resp_end_html(); } static void pg_redirect(const struct req *req, const char *name) { printf("Status: 303 See Other\r\n" "Location: /"); if (*scriptname != '\0') printf("%s/", scriptname); if (strcmp(req->q.manpath, req->p[0])) printf("%s/", req->q.manpath); if (req->q.arch != NULL) printf("%s/", req->q.arch); http_encode(name); if (req->q.sec != NULL) { putchar('.'); http_encode(req->q.sec); } printf("\r\nContent-Type: text/html; charset=utf-8\r\n\r\n"); } static void pg_searchres(const struct req *req, struct manpage *r, size_t sz) { char *arch, *archend; const char *sec; size_t i, iuse; int archprio, archpriouse; int prio, priouse; for (i = 0; i < sz; i++) { if (validate_filename(r[i].file)) continue; warnx("invalid filename %s in %s database", r[i].file, req->q.manpath); pg_error_internal(); return; } if (req->isquery && sz == 1) { /* * If we have just one result, then jump there now * without any delay. */ printf("Status: 303 See Other\r\n" "Location: /"); if (*scriptname != '\0') printf("%s/", scriptname); if (strcmp(req->q.manpath, req->p[0])) printf("%s/", req->q.manpath); printf("%s\r\n" "Content-Type: text/html; charset=utf-8\r\n\r\n", r[0].file); return; } /* * In man(1) mode, show one of the pages * even if more than one is found. */ iuse = 0; if (req->q.equal || sz == 1) { priouse = 20; archpriouse = 3; for (i = 0; i < sz; i++) { sec = r[i].file; sec += strcspn(sec, "123456789"); if (sec[0] == '\0') continue; prio = sec_prios[sec[0] - '1']; if (sec[1] != '/') prio += 10; if (req->q.arch == NULL) { archprio = ((arch = strchr(sec + 1, '/')) == NULL) ? 3 : ((archend = strchr(arch + 1, '/')) == NULL) ? 0 : strncmp(arch, "amd64/", archend - arch) ? 2 : 1; if (archprio < archpriouse) { archpriouse = archprio; priouse = prio; iuse = i; continue; } if (archprio > archpriouse) continue; } if (prio >= priouse) continue; priouse = prio; iuse = i; } resp_begin_html(200, NULL, r[iuse].file); } else resp_begin_html(200, NULL, NULL); resp_searchform(req, req->q.equal || sz == 1 ? FOCUS_NONE : FOCUS_QUERY); if (sz > 1) { puts(""); for (i = 0; i < sz; i++) { printf(" \n" " \n" " \n" " "); } puts("
" "q.manpath, req->p[0])) printf("%s/", req->q.manpath); printf("%s\">", r[i].file); html_print(r[i].names); printf(""); html_print(r[i].output); puts("
"); } if (req->q.equal || sz == 1) { puts("
"); resp_show(req, r[iuse].file); } resp_end_html(); } static void resp_catman(const struct req *req, const char *file) { FILE *f; char *p; size_t sz; ssize_t len; int i; int italic, bold; if ((f = fopen(file, "r")) == NULL) { puts("

You specified an invalid manual file.

"); return; } puts("
\n" "
");

	p = NULL;
	sz = 0;

	while ((len = getline(&p, &sz, f)) != -1) {
		bold = italic = 0;
		for (i = 0; i < len - 1; i++) {
			/*
			 * This means that the catpage is out of state.
			 * Ignore it and keep going (although the
			 * catpage is bogus).
			 */

			if ('\b' == p[i] || '\n' == p[i])
				continue;

			/*
			 * Print a regular character.
			 * Close out any bold/italic scopes.
			 * If we're in back-space mode, make sure we'll
			 * have something to enter when we backspace.
			 */

			if ('\b' != p[i + 1]) {
				if (italic)
					printf("");
				if (bold)
					printf("");
				italic = bold = 0;
				html_putchar(p[i]);
				continue;
			} else if (i + 2 >= len)
				continue;

			/* Italic mode. */

			if ('_' == p[i]) {
				if (bold)
					printf("");
				if ( ! italic)
					printf("");
				bold = 0;
				italic = 1;
				i += 2;
				html_putchar(p[i]);
				continue;
			}

			/*
			 * Handle funny behaviour troff-isms.
			 * These grok'd from the original man2html.c.
			 */

			if (('+' == p[i] && 'o' == p[i + 2]) ||
					('o' == p[i] && '+' == p[i + 2]) ||
					('|' == p[i] && '=' == p[i + 2]) ||
					('=' == p[i] && '|' == p[i + 2]) ||
					('*' == p[i] && '=' == p[i + 2]) ||
					('=' == p[i] && '*' == p[i + 2]) ||
					('*' == p[i] && '|' == p[i + 2]) ||
					('|' == p[i] && '*' == p[i + 2]))  {
				if (italic)
					printf("");
				if (bold)
					printf("");
				italic = bold = 0;
				putchar('*');
				i += 2;
				continue;
			} else if (('|' == p[i] && '-' == p[i + 2]) ||
					('-' == p[i] && '|' == p[i + 1]) ||
					('+' == p[i] && '-' == p[i + 1]) ||
					('-' == p[i] && '+' == p[i + 1]) ||
					('+' == p[i] && '|' == p[i + 1]) ||
					('|' == p[i] && '+' == p[i + 1]))  {
				if (italic)
					printf("");
				if (bold)
					printf("");
				italic = bold = 0;
				putchar('+');
				i += 2;
				continue;
			}

			/* Bold mode. */

			if (italic)
				printf("");
			if ( ! bold)
				printf("");
			bold = 1;
			italic = 0;
			i += 2;
			html_putchar(p[i]);
		}

		/*
		 * Clean up the last character.
		 * We can get to a newline; don't print that.
		 */

		if (italic)
			printf("");
		if (bold)
			printf("");

		if (i == len - 1 && p[i] != '\n')
			html_putchar(p[i]);

		putchar('\n');
	}
	free(p);

	puts("
\n" "
"); fclose(f); } static void resp_format(const struct req *req, const char *file) { struct manoutput conf; struct mparse *mp; struct roff_meta *meta; void *vp; int fd; int usepath; if (-1 == (fd = open(file, O_RDONLY, 0))) { puts("

You specified an invalid manual file.

"); return; } mchars_alloc(); mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1 | MPARSE_VALIDATE, MANDOC_OS_OTHER, req->q.manpath); mparse_readfd(mp, fd, file); close(fd); meta = mparse_result(mp); memset(&conf, 0, sizeof(conf)); conf.fragment = 1; conf.style = mandoc_strdup(CSS_DIR "/mandoc.css"); usepath = strcmp(req->q.manpath, req->p[0]); mandoc_asprintf(&conf.man, "/%s%s%s%s%%N.%%S", scriptname, *scriptname == '\0' ? "" : "/", usepath ? req->q.manpath : "", usepath ? "/" : ""); vp = html_alloc(&conf); if (meta->macroset == MACROSET_MDOC) html_mdoc(vp, meta); else html_man(vp, meta); html_free(vp); mparse_free(mp); mchars_free(); free(conf.man); free(conf.style); } static void resp_show(const struct req *req, const char *file) { if ('.' == file[0] && '/' == file[1]) file += 2; if ('c' == *file) resp_catman(req, file); else resp_format(req, file); } static void pg_show(struct req *req, const char *fullpath) { char *manpath; const char *file; if ((file = strchr(fullpath, '/')) == NULL) { pg_error_badrequest( "You did not specify a page to show."); return; } manpath = mandoc_strndup(fullpath, file - fullpath); file++; if ( ! validate_manpath(req, manpath)) { pg_error_badrequest( "You specified an invalid manpath."); free(manpath); return; } /* * Begin by chdir()ing into the manpath. * This way we can pick up the database files, which are * relative to the manpath root. */ if (chdir(manpath) == -1) { warn("chdir %s", manpath); pg_error_internal(); free(manpath); return; } free(manpath); if ( ! validate_filename(file)) { pg_error_badrequest( "You specified an invalid manual file."); return; } resp_begin_html(200, NULL, file); resp_searchform(req, FOCUS_NONE); resp_show(req, file); resp_end_html(); } static void pg_search(const struct req *req) { struct mansearch search; struct manpaths paths; struct manpage *res; char **argv; char *query, *rp, *wp; size_t ressz; int argc; /* * Begin by chdir()ing into the root of the manpath. * This way we can pick up the database files, which are * relative to the manpath root. */ if (chdir(req->q.manpath) == -1) { warn("chdir %s", req->q.manpath); pg_error_internal(); return; } search.arch = req->q.arch; search.sec = req->q.sec; search.outkey = "Nd"; search.argmode = req->q.equal ? ARG_NAME : ARG_EXPR; search.firstmatch = 1; paths.sz = 1; paths.paths = mandoc_malloc(sizeof(char *)); paths.paths[0] = mandoc_strdup("."); /* * Break apart at spaces with backslash-escaping. */ argc = 0; argv = NULL; rp = query = mandoc_strdup(req->q.query); for (;;) { while (isspace((unsigned char)*rp)) rp++; if (*rp == '\0') break; argv = mandoc_reallocarray(argv, argc + 1, sizeof(char *)); argv[argc++] = wp = rp; for (;;) { if (isspace((unsigned char)*rp)) { *wp = '\0'; rp++; break; } if (rp[0] == '\\' && rp[1] != '\0') rp++; if (wp != rp) *wp = *rp; if (*rp == '\0') break; wp++; rp++; } } res = NULL; ressz = 0; if (req->isquery && req->q.equal && argc == 1) pg_redirect(req, argv[0]); else if (mansearch(&search, &paths, argc, argv, &res, &ressz) == 0) pg_noresult(req, 400, "Bad Request", "You entered an invalid query."); else if (ressz == 0) pg_noresult(req, 404, "Not Found", "No results found."); else pg_searchres(req, res, ressz); free(query); mansearch_free(res, ressz); free(paths.paths[0]); free(paths.paths); } int main(void) { struct req req; struct itimerval itimer; const char *path; const char *querystring; int i; #if HAVE_PLEDGE /* * The "rpath" pledge could be revoked after mparse_readfd() * if the file desciptor to "/footer.html" would be opened * up front, but it's probably not worth the complication * of the code it would cause: it would require scattering * pledge() calls in multiple low-level resp_*() functions. */ if (pledge("stdio rpath", NULL) == -1) { warn("pledge"); pg_error_internal(); return EXIT_FAILURE; } #endif /* Poor man's ReDoS mitigation. */ itimer.it_value.tv_sec = 2; itimer.it_value.tv_usec = 0; itimer.it_interval.tv_sec = 2; itimer.it_interval.tv_usec = 0; if (setitimer(ITIMER_VIRTUAL, &itimer, NULL) == -1) { warn("setitimer"); pg_error_internal(); return EXIT_FAILURE; } /* * First we change directory into the MAN_DIR so that * subsequent scanning for manpath directories is rooted * relative to the same position. */ if (chdir(MAN_DIR) == -1) { warn("MAN_DIR: %s", MAN_DIR); pg_error_internal(); return EXIT_FAILURE; } memset(&req, 0, sizeof(struct req)); req.q.equal = 1; parse_manpath_conf(&req); /* Parse the path info and the query string. */ if ((path = getenv("PATH_INFO")) == NULL) path = ""; else if (*path == '/') path++; if (*path != '\0') { parse_path_info(&req, path); if (req.q.manpath == NULL || req.q.sec == NULL || *req.q.query == '\0' || access(path, F_OK) == -1) path = ""; } else if ((querystring = getenv("QUERY_STRING")) != NULL) parse_query_string(&req, querystring); /* Validate parsed data and add defaults. */ if (req.q.manpath == NULL) req.q.manpath = mandoc_strdup(req.p[0]); else if ( ! validate_manpath(&req, req.q.manpath)) { pg_error_badrequest( "You specified an invalid manpath."); return EXIT_FAILURE; } if (req.q.arch != NULL && validate_arch(req.q.arch) == 0) { pg_error_badrequest( "You specified an invalid architecture."); return EXIT_FAILURE; } /* Dispatch to the three different pages. */ if ('\0' != *path) pg_show(&req, path); else if (NULL != req.q.query) pg_search(&req); else pg_index(&req); free(req.q.manpath); free(req.q.arch); free(req.q.sec); free(req.q.query); for (i = 0; i < (int)req.psz; i++) free(req.p[i]); free(req.p); return EXIT_SUCCESS; } /* * Translate PATH_INFO to a query. */ static void parse_path_info(struct req *req, const char *path) { const char *name, *sec, *end; req->isquery = 0; req->q.equal = 1; req->q.manpath = NULL; req->q.arch = NULL; /* Mandatory manual page name. */ if ((name = strrchr(path, '/')) == NULL) name = path; else name++; /* Optional trailing section. */ sec = strrchr(name, '.'); if (sec != NULL && isdigit((unsigned char)*++sec)) { req->q.query = mandoc_strndup(name, sec - name - 1); req->q.sec = mandoc_strdup(sec); } else { req->q.query = mandoc_strdup(name); req->q.sec = NULL; } /* Handle the case of name[.section] only. */ if (name == path) return; /* Optional manpath. */ end = strchr(path, '/'); req->q.manpath = mandoc_strndup(path, end - path); if (validate_manpath(req, req->q.manpath)) { path = end + 1; if (name == path) return; } else { free(req->q.manpath); req->q.manpath = NULL; } /* Optional section. */ if (strncmp(path, "man", 3) == 0 || strncmp(path, "cat", 3) == 0) { path += 3; end = strchr(path, '/'); free(req->q.sec); req->q.sec = mandoc_strndup(path, end - path); path = end + 1; if (name == path) return; } /* Optional architecture. */ end = strchr(path, '/'); if (end + 1 != name) { pg_error_badrequest( "You specified too many directory components."); exit(EXIT_FAILURE); } req->q.arch = mandoc_strndup(path, end - path); if (validate_arch(req->q.arch) == 0) { pg_error_badrequest( "You specified an invalid directory component."); exit(EXIT_FAILURE); } } /* * Scan for indexable paths. */ static void parse_manpath_conf(struct req *req) { FILE *fp; char *dp; size_t dpsz; ssize_t len; if ((fp = fopen("manpath.conf", "r")) == NULL) { warn("%s/manpath.conf", MAN_DIR); pg_error_internal(); exit(EXIT_FAILURE); } dp = NULL; dpsz = 0; while ((len = getline(&dp, &dpsz, fp)) != -1) { if (dp[len - 1] == '\n') dp[--len] = '\0'; req->p = mandoc_realloc(req->p, (req->psz + 1) * sizeof(char *)); if ( ! validate_urifrag(dp)) { warnx("%s/manpath.conf contains " "unsafe path \"%s\"", MAN_DIR, dp); pg_error_internal(); exit(EXIT_FAILURE); } if (strchr(dp, '/') != NULL) { warnx("%s/manpath.conf contains " "path with slash \"%s\"", MAN_DIR, dp); pg_error_internal(); exit(EXIT_FAILURE); } req->p[req->psz++] = dp; dp = NULL; dpsz = 0; } free(dp); if (req->p == NULL) { warnx("%s/manpath.conf is empty", MAN_DIR); pg_error_internal(); exit(EXIT_FAILURE); } } mandoc-1.14.6/chars.c010064400017530001753000000324301412314055300146150ustar00schwarzeschwarze/* $Id: chars.c,v 1.79 2020/02/13 16:18:29 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014, 2015, 2017, 2018, 2020 * Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "mandoc.h" #include "mandoc_aux.h" #include "mandoc_ohash.h" #include "libmandoc.h" struct ln { const char roffcode[16]; const char *ascii; int unicode; }; /* Special break control characters. */ static const char ascii_nbrsp[2] = { ASCII_NBRSP, '\0' }; static const char ascii_break[2] = { ASCII_BREAK, '\0' }; static struct ln lines[] = { /* Spacing. */ { " ", ascii_nbrsp, 0x00a0 }, { "~", ascii_nbrsp, 0x00a0 }, { "0", ascii_nbrsp, 0x00a0 }, { ":", ascii_break, 0 }, /* Lines. */ { "ba", "|", 0x007c }, { "br", "|", 0x2502 }, { "ul", "_", 0x005f }, { "_", "_", 0x005f }, { "ru", "_", 0x005f }, { "rn", "-", 0x203e }, { "bb", "|", 0x00a6 }, { "sl", "/", 0x002f }, { "rs", "\\", 0x005c }, /* Text markers. */ { "ci", "O", 0x25cb }, { "bu", "+\bo", 0x2022 }, { "dd", "<**>", 0x2021 }, { "dg", "<*>", 0x2020 }, { "lz", "<>", 0x25ca }, { "sq", "[]", 0x25a1 }, { "ps", "", 0x00b6 }, { "sc", "
", 0x00a7 }, { "lh", "<=", 0x261c }, { "rh", "=>", 0x261e }, { "at", "@", 0x0040 }, { "sh", "#", 0x0023 }, { "CR", "", 0x21b5 }, { "OK", "\\/", 0x2713 }, { "CL", "C", 0x2663 }, { "SP", "S", 0x2660 }, { "HE", "H", 0x2665 }, { "DI", "D", 0x2666 }, /* Legal symbols. */ { "co", "(C)", 0x00a9 }, { "rg", "(R)", 0x00ae }, { "tm", "tm", 0x2122 }, /* Punctuation. */ { "em", "--", 0x2014 }, { "en", "-", 0x2013 }, { "hy", "-", 0x2010 }, { "e", "\\", 0x005c }, { ".", ".", 0x002e }, { "r!", "!", 0x00a1 }, { "r?", "?", 0x00bf }, /* Quotes. */ { "Bq", ",,", 0x201e }, { "bq", ",", 0x201a }, { "lq", "\"", 0x201c }, { "rq", "\"", 0x201d }, { "Lq", "\"", 0x201c }, { "Rq", "\"", 0x201d }, { "oq", "`", 0x2018 }, { "cq", "\'", 0x2019 }, { "aq", "\'", 0x0027 }, { "dq", "\"", 0x0022 }, { "Fo", "<<", 0x00ab }, { "Fc", ">>", 0x00bb }, { "fo", "<", 0x2039 }, { "fc", ">", 0x203a }, /* Brackets. */ { "lB", "[", 0x005b }, { "rB", "]", 0x005d }, { "lC", "{", 0x007b }, { "rC", "}", 0x007d }, { "la", "<", 0x27e8 }, { "ra", ">", 0x27e9 }, { "bv", "|", 0x23aa }, { "braceex", "|", 0x23aa }, { "bracketlefttp", "|", 0x23a1 }, { "bracketleftbt", "|", 0x23a3 }, { "bracketleftex", "|", 0x23a2 }, { "bracketrighttp", "|", 0x23a4 }, { "bracketrightbt", "|", 0x23a6 }, { "bracketrightex", "|", 0x23a5 }, { "lt", ",-", 0x23a7 }, { "bracelefttp", ",-", 0x23a7 }, { "lk", "{", 0x23a8 }, { "braceleftmid", "{", 0x23a8 }, { "lb", "`-", 0x23a9 }, { "braceleftbt", "`-", 0x23a9 }, { "braceleftex", "|", 0x23aa }, { "rt", "-.", 0x23ab }, { "bracerighttp", "-.", 0x23ab }, { "rk", "}", 0x23ac }, { "bracerightmid", "}", 0x23ac }, { "rb", "-\'", 0x23ad }, { "bracerightbt", "-\'", 0x23ad }, { "bracerightex", "|", 0x23aa }, { "parenlefttp", "/", 0x239b }, { "parenleftbt", "\\", 0x239d }, { "parenleftex", "|", 0x239c }, { "parenrighttp", "\\", 0x239e }, { "parenrightbt", "/", 0x23a0 }, { "parenrightex", "|", 0x239f }, /* Arrows and lines. */ { "<-", "<-", 0x2190 }, { "->", "->", 0x2192 }, { "<>", "<->", 0x2194 }, { "da", "|\bv", 0x2193 }, { "ua", "|\b^", 0x2191 }, { "va", "^v", 0x2195 }, { "lA", "<=", 0x21d0 }, { "rA", "=>", 0x21d2 }, { "hA", "<=>", 0x21d4 }, { "uA", "=\b^", 0x21d1 }, { "dA", "=\bv", 0x21d3 }, { "vA", "^=v", 0x21d5 }, { "an", "-", 0x23af }, /* Logic. */ { "AN", "^", 0x2227 }, { "OR", "v", 0x2228 }, { "no", "~", 0x00ac }, { "tno", "~", 0x00ac }, { "te", "", 0x2203 }, { "fa", "", 0x2200 }, { "st", "", 0x220b }, { "tf", "", 0x2234 }, { "3d", "", 0x2234 }, { "or", "|", 0x007c }, /* Mathematicals. */ { "pl", "+", 0x002b }, { "mi", "-", 0x2212 }, { "-", "-", 0x002d }, { "-+", "-+", 0x2213 }, { "+-", "+-", 0x00b1 }, { "t+-", "+-", 0x00b1 }, { "pc", ".", 0x00b7 }, { "md", ".", 0x22c5 }, { "mu", "x", 0x00d7 }, { "tmu", "x", 0x00d7 }, { "c*", "O\bx", 0x2297 }, { "c+", "O\b+", 0x2295 }, { "di", "/", 0x00f7 }, { "tdi", "/", 0x00f7 }, { "f/", "/", 0x2044 }, { "**", "*", 0x2217 }, { "<=", "<=", 0x2264 }, { ">=", ">=", 0x2265 }, { "<<", "<<", 0x226a }, { ">>", ">>", 0x226b }, { "eq", "=", 0x003d }, { "!=", "!=", 0x2260 }, { "==", "==", 0x2261 }, { "ne", "!==", 0x2262 }, { "ap", "~", 0x223c }, { "|=", "-~", 0x2243 }, { "=~", "=~", 0x2245 }, { "~~", "~~", 0x2248 }, { "~=", "~=", 0x2248 }, { "pt", "", 0x221d }, { "es", "{}", 0x2205 }, { "mo", "", 0x2208 }, { "nm", "", 0x2209 }, { "sb", "", 0x2282 }, { "nb", "", 0x2284 }, { "sp", "", 0x2283 }, { "nc", "", 0x2285 }, { "ib", "", 0x2286 }, { "ip", "", 0x2287 }, { "ca", "", 0x2229 }, { "cu", "", 0x222a }, { "/_", "", 0x2220 }, { "pp", "", 0x22a5 }, { "is", "", 0x222b }, { "integral", "", 0x222b }, { "sum", "", 0x2211 }, { "product", "", 0x220f }, { "coproduct", "", 0x2210 }, { "gr", "", 0x2207 }, { "sr", "", 0x221a }, { "sqrt", "", 0x221a }, { "lc", "|~", 0x2308 }, { "rc", "~|", 0x2309 }, { "lf", "|_", 0x230a }, { "rf", "_|", 0x230b }, { "if", "", 0x221e }, { "Ah", "", 0x2135 }, { "Im", "", 0x2111 }, { "Re", "", 0x211c }, { "wp", "p", 0x2118 }, { "pd", "", 0x2202 }, { "-h", "/h", 0x210f }, { "hbar", "/h", 0x210f }, { "12", "1/2", 0x00bd }, { "14", "1/4", 0x00bc }, { "34", "3/4", 0x00be }, { "18", "1/8", 0x215B }, { "38", "3/8", 0x215C }, { "58", "5/8", 0x215D }, { "78", "7/8", 0x215E }, { "S1", "^1", 0x00B9 }, { "S2", "^2", 0x00B2 }, { "S3", "^3", 0x00B3 }, /* Ligatures. */ { "ff", "ff", 0xfb00 }, { "fi", "fi", 0xfb01 }, { "fl", "fl", 0xfb02 }, { "Fi", "ffi", 0xfb03 }, { "Fl", "ffl", 0xfb04 }, { "AE", "AE", 0x00c6 }, { "ae", "ae", 0x00e6 }, { "OE", "OE", 0x0152 }, { "oe", "oe", 0x0153 }, { "ss", "ss", 0x00df }, { "IJ", "IJ", 0x0132 }, { "ij", "ij", 0x0133 }, /* Accents. */ { "a\"", "\"", 0x02dd }, { "a-", "-", 0x00af }, { "a.", ".", 0x02d9 }, { "a^", "^", 0x005e }, { "aa", "\'", 0x00b4 }, { "\'", "\'", 0x00b4 }, { "ga", "`", 0x0060 }, { "`", "`", 0x0060 }, { "ab", "'\b`", 0x02d8 }, { "ac", ",", 0x00b8 }, { "ad", "\"", 0x00a8 }, { "ah", "v", 0x02c7 }, { "ao", "o", 0x02da }, { "a~", "~", 0x007e }, { "ho", ",", 0x02db }, { "ha", "^", 0x005e }, { "ti", "~", 0x007e }, { "u02DC", "~", 0x02dc }, /* Accented letters. */ { "'A", "'\bA", 0x00c1 }, { "'E", "'\bE", 0x00c9 }, { "'I", "'\bI", 0x00cd }, { "'O", "'\bO", 0x00d3 }, { "'U", "'\bU", 0x00da }, { "'Y", "'\bY", 0x00dd }, { "'a", "'\ba", 0x00e1 }, { "'e", "'\be", 0x00e9 }, { "'i", "'\bi", 0x00ed }, { "'o", "'\bo", 0x00f3 }, { "'u", "'\bu", 0x00fa }, { "'y", "'\by", 0x00fd }, { "`A", "`\bA", 0x00c0 }, { "`E", "`\bE", 0x00c8 }, { "`I", "`\bI", 0x00cc }, { "`O", "`\bO", 0x00d2 }, { "`U", "`\bU", 0x00d9 }, { "`a", "`\ba", 0x00e0 }, { "`e", "`\be", 0x00e8 }, { "`i", "`\bi", 0x00ec }, { "`o", "`\bo", 0x00f2 }, { "`u", "`\bu", 0x00f9 }, { "~A", "~\bA", 0x00c3 }, { "~N", "~\bN", 0x00d1 }, { "~O", "~\bO", 0x00d5 }, { "~a", "~\ba", 0x00e3 }, { "~n", "~\bn", 0x00f1 }, { "~o", "~\bo", 0x00f5 }, { ":A", "\"\bA", 0x00c4 }, { ":E", "\"\bE", 0x00cb }, { ":I", "\"\bI", 0x00cf }, { ":O", "\"\bO", 0x00d6 }, { ":U", "\"\bU", 0x00dc }, { ":a", "\"\ba", 0x00e4 }, { ":e", "\"\be", 0x00eb }, { ":i", "\"\bi", 0x00ef }, { ":o", "\"\bo", 0x00f6 }, { ":u", "\"\bu", 0x00fc }, { ":y", "\"\by", 0x00ff }, { "^A", "^\bA", 0x00c2 }, { "^E", "^\bE", 0x00ca }, { "^I", "^\bI", 0x00ce }, { "^O", "^\bO", 0x00d4 }, { "^U", "^\bU", 0x00db }, { "^a", "^\ba", 0x00e2 }, { "^e", "^\be", 0x00ea }, { "^i", "^\bi", 0x00ee }, { "^o", "^\bo", 0x00f4 }, { "^u", "^\bu", 0x00fb }, { ",C", ",\bC", 0x00c7 }, { ",c", ",\bc", 0x00e7 }, { "/L", "/\bL", 0x0141 }, { "/l", "/\bl", 0x0142 }, { "/O", "/\bO", 0x00d8 }, { "/o", "/\bo", 0x00f8 }, { "oA", "o\bA", 0x00c5 }, { "oa", "o\ba", 0x00e5 }, /* Special letters. */ { "-D", "Dh", 0x00d0 }, { "Sd", "dh", 0x00f0 }, { "TP", "Th", 0x00de }, { "Tp", "th", 0x00fe }, { ".i", "i", 0x0131 }, { ".j", "j", 0x0237 }, /* Currency. */ { "Do", "$", 0x0024 }, { "ct", "/\bc", 0x00a2 }, { "Eu", "EUR", 0x20ac }, { "eu", "EUR", 0x20ac }, { "Ye", "=\bY", 0x00a5 }, { "Po", "-\bL", 0x00a3 }, { "Cs", "o\bx", 0x00a4 }, { "Fn", ",\bf", 0x0192 }, /* Units. */ { "de", "", 0x00b0 }, { "%0", "", 0x2030 }, { "fm", "\'", 0x2032 }, { "sd", "''", 0x2033 }, { "mc", "", 0x00b5 }, { "Of", "_\ba", 0x00aa }, { "Om", "_\bo", 0x00ba }, /* Greek characters. */ { "*A", "A", 0x0391 }, { "*B", "B", 0x0392 }, { "*G", "", 0x0393 }, { "*D", "", 0x0394 }, { "*E", "E", 0x0395 }, { "*Z", "Z", 0x0396 }, { "*Y", "H", 0x0397 }, { "*H", "", 0x0398 }, { "*I", "I", 0x0399 }, { "*K", "K", 0x039a }, { "*L", "", 0x039b }, { "*M", "M", 0x039c }, { "*N", "N", 0x039d }, { "*C", "", 0x039e }, { "*O", "O", 0x039f }, { "*P", "", 0x03a0 }, { "*R", "P", 0x03a1 }, { "*S", "", 0x03a3 }, { "*T", "T", 0x03a4 }, { "*U", "Y", 0x03a5 }, { "*F", "", 0x03a6 }, { "*X", "X", 0x03a7 }, { "*Q", "", 0x03a8 }, { "*W", "", 0x03a9 }, { "*a", "", 0x03b1 }, { "*b", "", 0x03b2 }, { "*g", "", 0x03b3 }, { "*d", "", 0x03b4 }, { "*e", "", 0x03b5 }, { "*z", "", 0x03b6 }, { "*y", "", 0x03b7 }, { "*h", "", 0x03b8 }, { "*i", "", 0x03b9 }, { "*k", "", 0x03ba }, { "*l", "", 0x03bb }, { "*m", "", 0x03bc }, { "*n", "", 0x03bd }, { "*c", "", 0x03be }, { "*o", "o", 0x03bf }, { "*p", "", 0x03c0 }, { "*r", "", 0x03c1 }, { "*s", "", 0x03c3 }, { "*t", "", 0x03c4 }, { "*u", "", 0x03c5 }, { "*f", "", 0x03d5 }, { "*x", "", 0x03c7 }, { "*q", "", 0x03c8 }, { "*w", "", 0x03c9 }, { "+h", "", 0x03d1 }, { "+f", "", 0x03c6 }, { "+p", "", 0x03d6 }, { "+e", "", 0x03f5 }, { "ts", "", 0x03c2 }, }; static struct ohash mchars; void mchars_free(void) { ohash_delete(&mchars); } void mchars_alloc(void) { size_t i; unsigned int slot; mandoc_ohash_init(&mchars, 9, offsetof(struct ln, roffcode)); for (i = 0; i < sizeof(lines)/sizeof(lines[0]); i++) { slot = ohash_qlookup(&mchars, lines[i].roffcode); assert(ohash_find(&mchars, slot) == NULL); ohash_insert(&mchars, slot, lines + i); } } int mchars_spec2cp(const char *p, size_t sz) { const struct ln *ln; const char *end; end = p + sz; ln = ohash_find(&mchars, ohash_qlookupi(&mchars, p, &end)); return ln != NULL ? ln->unicode : -1; } int mchars_num2char(const char *p, size_t sz) { int i; i = mandoc_strntoi(p, sz, 10); return i >= 0 && i < 256 ? i : -1; } int mchars_num2uc(const char *p, size_t sz) { int i; i = mandoc_strntoi(p, sz, 16); assert(i >= 0 && i <= 0x10FFFF); return i; } const char * mchars_spec2str(const char *p, size_t sz, size_t *rsz) { const struct ln *ln; const char *end; end = p + sz; ln = ohash_find(&mchars, ohash_qlookupi(&mchars, p, &end)); if (ln == NULL) return NULL; *rsz = strlen(ln->ascii); return ln->ascii; } const char * mchars_uc2str(int uc) { size_t i; for (i = 0; i < sizeof(lines)/sizeof(lines[0]); i++) if (uc == lines[i].unicode) return lines[i].ascii; return ""; } mandoc-1.14.6/compat_err.c010064400017530001753000000052121412314055300156460ustar00schwarzeschwarze/* $Id: compat_err.c,v 1.5 2020/06/15 01:37:14 schwarze Exp $ */ /* * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "config.h" #include #include #include #include #include static void vwarni(const char *, va_list); static void vwarnxi(const char *, va_list); static void vwarnxi(const char *fmt, va_list ap) { fprintf(stderr, "%s: ", getprogname()); if (fmt != NULL) vfprintf(stderr, fmt, ap); } static void vwarni(const char *fmt, va_list ap) { int sverrno; sverrno = errno; vwarnxi(fmt, ap); if (fmt != NULL) fputs(": ", stderr); fprintf(stderr, "%s\n", strerror(sverrno)); } void err(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); vwarni(fmt, ap); va_end(ap); exit(eval); } void errx(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); vwarnxi(fmt, ap); va_end(ap); fputc('\n', stderr); exit(eval); } void warn(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vwarni(fmt, ap); va_end(ap); } void warnx(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vwarnxi(fmt, ap); va_end(ap); fputc('\n', stderr); } mandoc-1.14.6/compat_fts.c010064400017530001753000000427751412314055300156710ustar00schwarzeschwarze/* $Id: compat_fts.c,v 1.17 2020/06/15 01:37:14 schwarze Exp $ */ /* $OpenBSD: fts.c,v 1.59 2019/06/28 13:32:41 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "compat_fts.h" #define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) static FTSENT *fts_alloc(FTS *, const char *, size_t); static FTSENT *fts_build(FTS *); static void fts_lfree(FTSENT *); static void fts_load(FTS *, FTSENT *); static size_t fts_maxarglen(char * const *); static void fts_padjust(FTS *, FTSENT *); static int fts_palloc(FTS *, size_t); static FTSENT *fts_sort(FTS *, FTSENT *, int); static unsigned short fts_stat(FTS *, FTSENT *); typedef int (*qsort_compar_proto)(const void *, const void *); #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif #define CLR(opt) (sp->fts_options &= ~(opt)) #define ISSET(opt) (sp->fts_options & (opt)) #define SET(opt) (sp->fts_options |= (opt)) FTS * fts_open(char * const *argv, int options, int (*compar)(const FTSENT **, const FTSENT **)) { FTS *sp; FTSENT *p, *root; int nitems; FTSENT *parent, *prev; /* Options check. */ if (options & ~FTS_OPTIONMASK) { errno = EINVAL; return (NULL); } /* At least one path must be specified. */ if (*argv == NULL) { errno = EINVAL; return (NULL); } /* Allocate/initialize the stream */ if ((sp = calloc(1, sizeof(FTS))) == NULL) return (NULL); sp->fts_compar = compar; sp->fts_options = options; /* * Start out with 1K of path space, and enough, in any case, * to hold the user's paths. */ if (fts_palloc(sp, MAXIMUM(fts_maxarglen(argv), PATH_MAX))) goto mem1; /* Allocate/initialize root's parent. */ if ((parent = fts_alloc(sp, "", 0)) == NULL) goto mem2; parent->fts_level = FTS_ROOTPARENTLEVEL; /* Allocate/initialize root(s). */ for (root = prev = NULL, nitems = 0; *argv; ++argv, ++nitems) { if ((p = fts_alloc(sp, *argv, strlen(*argv))) == NULL) goto mem3; p->fts_level = FTS_ROOTLEVEL; p->fts_parent = parent; p->fts_accpath = p->fts_name; p->fts_info = fts_stat(sp, p); /* Command-line "." and ".." are real directories. */ if (p->fts_info == FTS_DOT) p->fts_info = FTS_D; /* * If comparison routine supplied, traverse in sorted * order; otherwise traverse in the order specified. */ if (compar) { p->fts_link = root; root = p; } else { p->fts_link = NULL; if (root == NULL) root = p; else prev->fts_link = p; prev = p; } } if (compar && nitems > 1) root = fts_sort(sp, root, nitems); /* * Allocate a dummy pointer and make fts_read think that we've just * finished the node before the root(s); set p->fts_info to FTS_INIT * so that everything about the "current" node is ignored. */ if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL) goto mem3; sp->fts_cur->fts_link = root; sp->fts_cur->fts_info = FTS_INIT; if (nitems == 0) free(parent); return (sp); mem3: fts_lfree(root); free(parent); mem2: free(sp->fts_path); mem1: free(sp); return (NULL); } static void fts_load(FTS *sp, FTSENT *p) { size_t len; char *cp; /* * Load the stream structure for the next traversal. Since we don't * actually enter the directory until after the preorder visit, set * the fts_accpath field specially so the chdir gets done to the right * place and the user can access the first node. From fts_open it's * known that the path will fit. */ len = p->fts_pathlen = p->fts_namelen; memmove(sp->fts_path, p->fts_name, len + 1); if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) { len = strlen(++cp); memmove(p->fts_name, cp, len + 1); p->fts_namelen = len; } p->fts_accpath = p->fts_path = sp->fts_path; sp->fts_dev = p->fts_dev; } int fts_close(FTS *sp) { FTSENT *freep, *p; /* * This still works if we haven't read anything -- the dummy structure * points to the root list, so we step through to the end of the root * list which has a valid parent pointer. */ if (sp->fts_cur) { for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) { freep = p; p = p->fts_link ? p->fts_link : p->fts_parent; free(freep); } free(p); } /* Free up child linked list, sort array, path buffer, stream ptr.*/ if (sp->fts_child) fts_lfree(sp->fts_child); free(sp->fts_array); free(sp->fts_path); free(sp); return (0); } /* * Special case of "/" at the end of the path so that slashes aren't * appended which would cause paths to be written as "....//foo". */ #define NAPPEND(p) \ (p->fts_path[p->fts_pathlen - 1] == '/' \ ? p->fts_pathlen - 1 : p->fts_pathlen) FTSENT * fts_read(FTS *sp) { FTSENT *p, *tmp; int instr; char *t; /* If finished or unrecoverable error, return NULL. */ if (sp->fts_cur == NULL || ISSET(FTS_STOP)) return (NULL); /* Set current node pointer. */ p = sp->fts_cur; /* Save and zero out user instructions. */ instr = p->fts_instr; p->fts_instr = FTS_NOINSTR; /* Directory in pre-order. */ if (p->fts_info == FTS_D) { /* If skipped or crossed mount point, do post-order visit. */ if (instr == FTS_SKIP || (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) { if (sp->fts_child) { fts_lfree(sp->fts_child); sp->fts_child = NULL; } p->fts_info = FTS_DP; return (p); } /* * If haven't read do so. If the read fails, fts_build sets * FTS_STOP or the fts_info field of the node. */ if (sp->fts_child) { /* nothing */ } else if ((sp->fts_child = fts_build(sp)) == NULL) { if (ISSET(FTS_STOP)) return (NULL); return (p); } p = sp->fts_child; sp->fts_child = NULL; goto name; } /* Move to the next node on this level. */ next: tmp = p; if ((p = p->fts_link)) { free(tmp); /* * If reached the top, return to the original directory (or * the root of the tree), and load the paths for the next root. */ if (p->fts_level == FTS_ROOTLEVEL) { fts_load(sp, p); return (sp->fts_cur = p); } /* * User may have called fts_set on the node. If skipped, * ignore. If followed, get a file descriptor so we can * get back if necessary. */ if (p->fts_instr == FTS_SKIP) goto next; name: t = sp->fts_path + NAPPEND(p->fts_parent); *t++ = '/'; memmove(t, p->fts_name, p->fts_namelen + 1); return (sp->fts_cur = p); } /* Move up to the parent node. */ p = tmp->fts_parent; free(tmp); if (p->fts_level == FTS_ROOTPARENTLEVEL) { /* * Done; free everything up and set errno to 0 so the user * can distinguish between error and EOF. */ free(p); errno = 0; return (sp->fts_cur = NULL); } /* NUL terminate the pathname. */ sp->fts_path[p->fts_pathlen] = '\0'; p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP; return (sp->fts_cur = p); } /* * Fts_set takes the stream as an argument although it's not used in this * implementation; it would be necessary if anyone wanted to add global * semantics to fts using fts_set. An error return is allowed for similar * reasons. */ int fts_set(FTS *sp, FTSENT *p, int instr) { if (instr && instr != FTS_NOINSTR && instr != FTS_SKIP) { errno = EINVAL; return (1); } p->fts_instr = instr; return (0); } /* * This is the tricky part -- do not casually change *anything* in here. The * idea is to build the linked list of entries that are used by fts_children * and fts_read. There are lots of special cases. * * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is * set and it's a physical walk (so that symbolic links can't be directories), * we can do things quickly. First, if it's a 4.4BSD file system, the type * of the file is in the directory entry. Otherwise, we assume that the number * of subdirectories in a node is equal to the number of links to the parent. * The former skips all stat calls. The latter skips stat calls in any leaf * directories and for any files after the subdirectories in the directory have * been found, cutting the stat calls by about 2/3. */ static FTSENT * fts_build(FTS *sp) { struct dirent *dp; FTSENT *p, *head; FTSENT *cur, *tail; DIR *dirp; void *oldaddr; size_t dlen, len, maxlen; int nitems, level, doadjust; int saved_errno; char *cp; /* Set current node pointer. */ cur = sp->fts_cur; /* * Open the directory for reading. If this fails, we're done. * If being called from fts_read, set the fts_info field. */ if ((dirp = opendir(cur->fts_accpath)) == NULL) { cur->fts_info = FTS_DNR; cur->fts_errno = errno; return (NULL); } /* * Figure out the max file name length that can be stored in the * current path -- the inner loop allocates more path as necessary. * We really wouldn't have to do the maxlen calculations here, we * could do them in fts_read before returning the path, but it's a * lot easier here since the length is part of the dirent structure. * * If not changing directories set a pointer so that can just append * each new name into the path. */ len = NAPPEND(cur); cp = sp->fts_path + len; *cp++ = '/'; len++; maxlen = sp->fts_pathlen - len; /* * fts_level is signed so we must prevent it from wrapping * around to FTS_ROOTLEVEL and FTS_ROOTPARENTLEVEL. */ level = cur->fts_level; if (level < FTS_MAXLEVEL) level++; /* Read the directory, attaching each entry to the `link' pointer. */ doadjust = 0; for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) { if (ISDOT(dp->d_name)) continue; #if HAVE_DIRENT_NAMLEN dlen = dp->d_namlen; #else dlen = strlen(dp->d_name); #endif if (!(p = fts_alloc(sp, dp->d_name, dlen))) goto mem1; if (dlen >= maxlen) { /* include space for NUL */ oldaddr = sp->fts_path; if (fts_palloc(sp, dlen + len + 1)) { /* * No more memory for path or structures. Save * errno, free up the current structure and the * structures already allocated. */ mem1: saved_errno = errno; free(p); fts_lfree(head); (void)closedir(dirp); cur->fts_info = FTS_ERR; SET(FTS_STOP); errno = saved_errno; return (NULL); } /* Did realloc() change the pointer? */ if (oldaddr != sp->fts_path) { doadjust = 1; cp = sp->fts_path + len; } maxlen = sp->fts_pathlen - len; } p->fts_level = level; p->fts_parent = sp->fts_cur; p->fts_pathlen = len + dlen; if (p->fts_pathlen < len) { /* * If we wrap, free up the current structure and * the structures already allocated, then error * out with ENAMETOOLONG. */ free(p); fts_lfree(head); (void)closedir(dirp); cur->fts_info = FTS_ERR; SET(FTS_STOP); errno = ENAMETOOLONG; return (NULL); } /* Build a file name for fts_stat to stat. */ p->fts_accpath = p->fts_path; memmove(cp, p->fts_name, p->fts_namelen + 1); /* Stat it. */ p->fts_info = fts_stat(sp, p); /* We walk in directory order so "ls -f" doesn't get upset. */ p->fts_link = NULL; if (head == NULL) head = tail = p; else { tail->fts_link = p; tail = p; } ++nitems; } if (dirp) (void)closedir(dirp); /* * If realloc() changed the address of the path, adjust the * addresses for the rest of the tree and the dir list. */ if (doadjust) fts_padjust(sp, head); /* * If not changing directories, reset the path back to original * state. */ if (len == sp->fts_pathlen || nitems == 0) --cp; *cp = '\0'; /* If didn't find anything, return NULL. */ if (!nitems) { cur->fts_info = FTS_DP; return (NULL); } /* Sort the entries. */ if (sp->fts_compar && nitems > 1) head = fts_sort(sp, head, nitems); return (head); } static unsigned short fts_stat(FTS *sp, FTSENT *p) { FTSENT *t; dev_t dev; ino_t ino; struct stat *sbp; /* If user needs stat info, stat buffer already allocated. */ sbp = p->fts_statp; if (lstat(p->fts_accpath, sbp)) { p->fts_errno = errno; memset(sbp, 0, sizeof(struct stat)); return (FTS_NS); } if (S_ISDIR(sbp->st_mode)) { /* * Set the device/inode. Used to find cycles and check for * crossing mount points. Also remember the link count, used * in fts_build to limit the number of stat calls. It is * understood that these fields are only referenced if fts_info * is set to FTS_D. */ dev = p->fts_dev = sbp->st_dev; ino = p->fts_ino = sbp->st_ino; p->fts_nlink = sbp->st_nlink; if (ISDOT(p->fts_name)) return (FTS_DOT); /* * Cycle detection is done by brute force when the directory * is first encountered. If the tree gets deep enough or the * number of symbolic links to directories is high enough, * something faster might be worthwhile. */ for (t = p->fts_parent; t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent) if (ino == t->fts_ino && dev == t->fts_dev) { p->fts_cycle = t; return (FTS_DC); } return (FTS_D); } if (S_ISLNK(sbp->st_mode)) return (FTS_SL); if (S_ISREG(sbp->st_mode)) return (FTS_F); return (FTS_DEFAULT); } static FTSENT * fts_sort(FTS *sp, FTSENT *head, int nitems) { FTSENT **ap, *p; /* * Construct an array of pointers to the structures and call qsort(3). * Reassemble the array in the order returned by qsort. If unable to * sort for memory reasons, return the directory entries in their * current order. Allocate enough space for the current needs plus * 40 so don't realloc one entry at a time. */ if (nitems > sp->fts_nitems) { struct _ftsent **a; if ((a = reallocarray(sp->fts_array, nitems + 40, sizeof(FTSENT *))) == NULL) { free(sp->fts_array); sp->fts_array = NULL; sp->fts_nitems = 0; return (head); } sp->fts_nitems = nitems + 40; sp->fts_array = a; } for (ap = sp->fts_array, p = head; p; p = p->fts_link) *ap++ = p; qsort(sp->fts_array, nitems, sizeof(FTSENT *), (qsort_compar_proto)sp->fts_compar); for (head = *(ap = sp->fts_array); --nitems; ++ap) ap[0]->fts_link = ap[1]; ap[0]->fts_link = NULL; return (head); } static FTSENT * fts_alloc(FTS *sp, const char *name, size_t namelen) { FTSENT *p; size_t len; len = sizeof(FTSENT) + namelen; if ((p = calloc(1, len)) == NULL) return (NULL); p->fts_path = sp->fts_path; p->fts_namelen = namelen; p->fts_instr = FTS_NOINSTR; p->fts_statp = malloc(sizeof(struct stat)); if (p->fts_statp == NULL) { free(p); return (NULL); } memcpy(p->fts_name, name, namelen); return (p); } static void fts_lfree(FTSENT *head) { FTSENT *p; /* Free a linked list of structures. */ while ((p = head)) { head = head->fts_link; free(p); } } /* * Allow essentially unlimited paths; find, rm, ls should all work on any tree. * Most systems will allow creation of paths much longer than PATH_MAX, even * though the kernel won't resolve them. Add the size (not just what's needed) * plus 256 bytes so don't realloc the path 2 bytes at a time. */ static int fts_palloc(FTS *sp, size_t more) { char *p; /* * Check for possible wraparound. */ more += 256; if (sp->fts_pathlen + more < sp->fts_pathlen) { free(sp->fts_path); sp->fts_path = NULL; errno = ENAMETOOLONG; return (1); } p = recallocarray(sp->fts_path, sp->fts_pathlen, sp->fts_pathlen + more, 1); if (p == NULL) { free(sp->fts_path); sp->fts_path = NULL; return (1); } sp->fts_pathlen += more; sp->fts_path = p; return (0); } /* * When the path is realloc'd, have to fix all of the pointers in structures * already returned. */ static void fts_padjust(FTS *sp, FTSENT *head) { FTSENT *p; char *addr = sp->fts_path; #define ADJUST(p) { \ if ((p)->fts_accpath != (p)->fts_name) { \ (p)->fts_accpath = \ (char *)addr + ((p)->fts_accpath - (p)->fts_path); \ } \ (p)->fts_path = addr; \ } /* Adjust the current set of children. */ for (p = sp->fts_child; p; p = p->fts_link) ADJUST(p); /* Adjust the rest of the tree, including the current level. */ for (p = head; p->fts_level >= FTS_ROOTLEVEL;) { ADJUST(p); p = p->fts_link ? p->fts_link : p->fts_parent; } } static size_t fts_maxarglen(char * const *argv) { size_t len, max; for (max = 0; *argv; ++argv) if ((len = strlen(*argv)) > max) max = len; return (max + 1); } mandoc-1.14.6/compat_getline.c010064400017530001753000000030521412314055300165050ustar00schwarzeschwarze/* $Id: compat_getline.c,v 1.2 2020/06/15 01:37:14 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include ssize_t getline(char **buf, size_t *bufsz, FILE *fp) { char *nbuf; size_t nbufsz, pos; int c; if (buf == NULL || bufsz == NULL) { errno = EINVAL; return -1; } if (*buf == NULL) *bufsz = 0; else **buf = '\0'; pos = 0; for (;;) { if (pos + 1 >= *bufsz) { nbufsz = *bufsz ? *bufsz * 2 : BUFSIZ; if ((nbuf = realloc(*buf, nbufsz)) == NULL) return -1; *buf = nbuf; *bufsz = nbufsz; } if ((c = fgetc(fp)) == EOF) { (*buf)[pos] = '\0'; return pos > 0 && feof(fp) ? (ssize_t)pos : -1; } (*buf)[pos++] = c; (*buf)[pos] = '\0'; if (c == '\n') return pos; } } mandoc-1.14.6/compat_getsubopt.c010064400017530001753000000055351412314055300171020ustar00schwarzeschwarze/* $Id: compat_getsubopt.c,v 1.6 2020/06/15 01:37:15 schwarze Exp $ */ /* $OpenBSD: getsubopt.c,v 1.4 2005/08/08 08:05:36 espie Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "config.h" #include #include #include int getsubopt(char **optionp, char * const *tokens, char **valuep) { int cnt; char *suboptarg; char *p; suboptarg = *valuep = NULL; if (!optionp || !*optionp) return(-1); /* skip leading white-space, commas */ for (p = *optionp; *p && (*p == ',' || *p == ' ' || *p == '\t'); ++p); if (!*p) { *optionp = p; return(-1); } /* save the start of the token, and skip the rest of the token. */ for (suboptarg = p; *++p && *p != ',' && *p != '=' && *p != ' ' && *p != '\t';); if (*p) { /* * If there's an equals sign, set the value pointer, and * skip over the value part of the token. Terminate the * token. */ if (*p == '=') { *p = '\0'; for (*valuep = ++p; *p && *p != ',' && *p != ' ' && *p != '\t'; ++p); if (*p) *p++ = '\0'; } else *p++ = '\0'; /* Skip any whitespace or commas after this token. */ for (; *p && (*p == ',' || *p == ' ' || *p == '\t'); ++p); } /* set optionp for next round. */ *optionp = p; for (cnt = 0; *tokens; ++tokens, ++cnt) if (!strcmp(suboptarg, *tokens)) return(cnt); return(-1); } mandoc-1.14.6/compat_isblank.c010064400017530001753000000016531412314055300165060ustar00schwarzeschwarze/* $Id: compat_isblank.c,v 1.3 2020/06/15 01:37:15 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" int isblank(int c) { return c == ' ' || c == '\t'; } mandoc-1.14.6/compat_mkdtemp.c010064400017530001753000000030271412314055300165210ustar00schwarzeschwarze/* $Id: compat_mkdtemp.c,v 1.4 2021/09/19 15:02:55 schwarze Exp $ */ /* * Copyright (c) 2015, 2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * The algorithm of this function is inspired by OpenBSD mkdtemp(3) * by Theo de Raadt and Todd Miller, but the code differs. */ #include "config.h" #include #include #include #include #include char * mkdtemp(char *path) { char *start, *cp; unsigned int tries; start = strchr(path, '\0'); while (start > path && start[-1] == 'X') start--; for (tries = INT_MAX; tries; tries--) { if (mktemp(path) == NULL) return NULL; if (mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR) == 0) return path; for (cp = start; *cp != '\0'; cp++) *cp = 'X'; if (errno != EEXIST) return NULL; } errno = EEXIST; return NULL; } mandoc-1.14.6/compat_mkstemps.c010064400017530001753000000034331412314055300167240ustar00schwarzeschwarze/* $Id: compat_mkstemps.c,v 1.1 2021/09/19 15:05:39 schwarze Exp $ */ /* * Copyright (c) 2015, 2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Parts of the algorithm of this function are inspired by OpenBSD * mkdtemp(3) by Theo de Raadt and Todd Miller, but the code differs. */ #include "config.h" #include #include #include #include #include #include int mkstemps(char *path, int suffixlen) { char *start, *end, *cp; int fd, tries; char backup; end = strchr(path, '\0'); if (suffixlen < 0 || suffixlen > end - path - 6) { errno = EINVAL; return -1; } end -= suffixlen; for (start = end; start > path; start--) if (start[-1] != 'X') break; backup = *end; for (tries = INT_MAX; tries; tries--) { *end = '\0'; cp = mktemp(path); *end = backup; if (cp == NULL) return -1; fd = open(path, O_CREAT | O_EXCL | O_RDWR, S_IRUSR | S_IWUSR); if (fd != -1) return fd; for (cp = start; cp < end; cp++) *cp = 'X'; if (errno != EEXIST) return -1; } errno = EEXIST; return -1; } mandoc-1.14.6/compat_ohash.c010064400017530001753000000155151412314055300161670ustar00schwarzeschwarze/* $Id: compat_ohash.c,v 1.7 2020/06/15 01:37:15 schwarze Exp $ */ /* $OpenBSD: ohash.c,v 1.1 2014/06/02 18:52:03 deraadt Exp $ */ /* Copyright (c) 1999, 2004 Marc Espie * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "compat_ohash.h" struct _ohash_record { uint32_t hv; const char *p; }; #define DELETED ((const char *)h) #define NONE (h->size) /* Don't bother changing the hash table if the change is small enough. */ #define MINSIZE (1UL << 4) #define MINDELETED 4 static void ohash_resize(struct ohash *); /* This handles the common case of variable length keys, where the * key is stored at the end of the record. */ void * ohash_create_entry(struct ohash_info *i, const char *start, const char **end) { char *p; if (!*end) *end = start + strlen(start); p = (i->alloc)(i->key_offset + (*end - start) + 1, i->data); if (p) { memcpy(p+i->key_offset, start, *end-start); p[i->key_offset + (*end - start)] = '\0'; } return (void *)p; } /* hash_delete only frees the hash structure. Use hash_first/hash_next * to free entries as well. */ void ohash_delete(struct ohash *h) { (h->info.free)(h->t, h->info.data); #ifndef NDEBUG h->t = NULL; #endif } static void ohash_resize(struct ohash *h) { struct _ohash_record *n; size_t ns; unsigned int j; unsigned int i, incr; if (4 * h->deleted < h->total) { if (h->size >= (UINT_MAX >> 1U)) ns = UINT_MAX; else ns = h->size << 1U; } else if (3 * h->deleted > 2 * h->total) ns = h->size >> 1U; else ns = h->size; if (ns < MINSIZE) ns = MINSIZE; #ifdef STATS_HASH STAT_HASH_EXPAND++; STAT_HASH_SIZE += ns - h->size; #endif n = (h->info.calloc)(ns, sizeof(struct _ohash_record), h->info.data); if (!n) return; for (j = 0; j < h->size; j++) { if (h->t[j].p != NULL && h->t[j].p != DELETED) { i = h->t[j].hv % ns; incr = ((h->t[j].hv % (ns - 2)) & ~1) + 1; while (n[i].p != NULL) { i += incr; if (i >= ns) i -= ns; } n[i].hv = h->t[j].hv; n[i].p = h->t[j].p; } } (h->info.free)(h->t, h->info.data); h->t = n; h->size = ns; h->total -= h->deleted; h->deleted = 0; } void * ohash_remove(struct ohash *h, unsigned int i) { void *result = (void *)h->t[i].p; if (result == NULL || result == DELETED) return NULL; #ifdef STATS_HASH STAT_HASH_ENTRIES--; #endif h->t[i].p = DELETED; h->deleted++; if (h->deleted >= MINDELETED && 4 * h->deleted > h->total) ohash_resize(h); return result; } void * ohash_find(struct ohash *h, unsigned int i) { if (h->t[i].p == DELETED) return NULL; else return (void *)h->t[i].p; } void * ohash_insert(struct ohash *h, unsigned int i, void *p) { #ifdef STATS_HASH STAT_HASH_ENTRIES++; #endif if (h->t[i].p == DELETED) { h->deleted--; h->t[i].p = p; } else { h->t[i].p = p; /* Arbitrary resize boundary. Tweak if not efficient enough. */ if (++h->total * 4 > h->size * 3) ohash_resize(h); } return p; } unsigned int ohash_entries(struct ohash *h) { return h->total - h->deleted; } void * ohash_first(struct ohash *h, unsigned int *pos) { *pos = 0; return ohash_next(h, pos); } void * ohash_next(struct ohash *h, unsigned int *pos) { for (; *pos < h->size; (*pos)++) if (h->t[*pos].p != DELETED && h->t[*pos].p != NULL) return (void *)h->t[(*pos)++].p; return NULL; } void ohash_init(struct ohash *h, unsigned int size, struct ohash_info *info) { h->size = 1UL << size; if (h->size < MINSIZE) h->size = MINSIZE; #ifdef STATS_HASH STAT_HASH_CREATION++; STAT_HASH_SIZE += h->size; #endif /* Copy info so that caller may free it. */ h->info.key_offset = info->key_offset; h->info.calloc = info->calloc; h->info.free = info->free; h->info.alloc = info->alloc; h->info.data = info->data; h->t = (h->info.calloc)(h->size, sizeof(struct _ohash_record), h->info.data); h->total = h->deleted = 0; } uint32_t ohash_interval(const char *s, const char **e) { uint32_t k; if (!*e) *e = s + strlen(s); if (s == *e) k = 0; else k = *s++; while (s != *e) k = ((k << 2) | (k >> 30)) ^ *s++; return k; } unsigned int ohash_lookup_interval(struct ohash *h, const char *start, const char *end, uint32_t hv) { unsigned int i, incr; unsigned int empty; #ifdef STATS_HASH STAT_HASH_LOOKUP++; #endif empty = NONE; i = hv % h->size; incr = ((hv % (h->size-2)) & ~1) + 1; while (h->t[i].p != NULL) { #ifdef STATS_HASH STAT_HASH_LENGTH++; #endif if (h->t[i].p == DELETED) { if (empty == NONE) empty = i; } else if (h->t[i].hv == hv && strncmp(h->t[i].p+h->info.key_offset, start, end - start) == 0 && (h->t[i].p+h->info.key_offset)[end-start] == '\0') { if (empty != NONE) { h->t[empty].hv = hv; h->t[empty].p = h->t[i].p; h->t[i].p = DELETED; return empty; } else { #ifdef STATS_HASH STAT_HASH_POSITIVE++; #endif return i; } } i += incr; if (i >= h->size) i -= h->size; } /* Found an empty position. */ if (empty != NONE) i = empty; h->t[i].hv = hv; return i; } unsigned int ohash_lookup_memory(struct ohash *h, const char *k, size_t size, uint32_t hv) { unsigned int i, incr; unsigned int empty; #ifdef STATS_HASH STAT_HASH_LOOKUP++; #endif empty = NONE; i = hv % h->size; incr = ((hv % (h->size-2)) & ~1) + 1; while (h->t[i].p != NULL) { #ifdef STATS_HASH STAT_HASH_LENGTH++; #endif if (h->t[i].p == DELETED) { if (empty == NONE) empty = i; } else if (h->t[i].hv == hv && memcmp(h->t[i].p+h->info.key_offset, k, size) == 0) { if (empty != NONE) { h->t[empty].hv = hv; h->t[empty].p = h->t[i].p; h->t[i].p = DELETED; return empty; } else { #ifdef STATS_HASH STAT_HASH_POSITIVE++; #endif } return i; } i += incr; if (i >= h->size) i -= h->size; } /* Found an empty position. */ if (empty != NONE) i = empty; h->t[i].hv = hv; return i; } unsigned int ohash_qlookup(struct ohash *h, const char *s) { const char *e = NULL; return ohash_qlookupi(h, s, &e); } unsigned int ohash_qlookupi(struct ohash *h, const char *s, const char **e) { uint32_t hv; hv = ohash_interval(s, e); return ohash_lookup_interval(h, s, *e, hv); } mandoc-1.14.6/compat_progname.c010064400017530001753000000020031412314055300166610ustar00schwarzeschwarze/* $Id: compat_progname.c,v 1.2 2020/06/15 01:37:15 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" static const char *progname; void setprogname(const char *name) { progname = name; } const char * getprogname(void) { return progname; } mandoc-1.14.6/compat_reallocarray.c010064400017530001753000000026611412314055300175430ustar00schwarzeschwarze/* $Id: compat_reallocarray.c,v 1.5 2020/06/15 01:37:15 schwarze Exp $ */ /* $OpenBSD: reallocarray.c,v 1.3 2015/09/13 08:31:47 guenther Exp $ */ /* * Copyright (c) 2008 Otto Moerbeek * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include /* * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW */ #define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) void * reallocarray(void *optr, size_t nmemb, size_t size) { if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && nmemb > 0 && SIZE_MAX / nmemb < size) { errno = ENOMEM; return NULL; } return realloc(optr, size * nmemb); } mandoc-1.14.6/compat_recallocarray.c010064400017530001753000000054721412314055300177110ustar00schwarzeschwarze/* $Id: compat_recallocarray.c,v 1.2 2020/06/15 01:37:15 schwarze Exp $ */ /* $OpenBSD: recallocarray.c,v 1.1 2017/03/06 18:44:21 otto Exp $ */ /* * Copyright (c) 2008, 2017 Otto Moerbeek * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include /* * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW */ #define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) /* * Even though specified in POSIX, the PAGESIZE and PAGE_SIZE * macros have very poor portability. Since we only use this * to avoid free() overhead for small shrinking, simply pick * an arbitrary number. */ #define getpagesize() (1UL << 12) void * recallocarray(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size) { size_t oldsize, newsize; void *newptr; if (ptr == NULL) return calloc(newnmemb, size); if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && newnmemb > 0 && SIZE_MAX / newnmemb < size) { errno = ENOMEM; return NULL; } newsize = newnmemb * size; if ((oldnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && oldnmemb > 0 && SIZE_MAX / oldnmemb < size) { errno = EINVAL; return NULL; } oldsize = oldnmemb * size; /* * Don't bother too much if we're shrinking just a bit, * we do not shrink for series of small steps, oh well. */ if (newsize <= oldsize) { size_t d = oldsize - newsize; if (d < oldsize / 2 && d < getpagesize()) { memset((char *)ptr + newsize, 0, d); return ptr; } } newptr = malloc(newsize); if (newptr == NULL) return NULL; if (newsize > oldsize) { memcpy(newptr, ptr, oldsize); memset((char *)newptr + oldsize, 0, newsize - oldsize); } else memcpy(newptr, ptr, newsize); /* * At this point, the OpenBSD implementation calls * explicit_bzero() on the old memory before it is * freed. Since explicit_bzero() is hard to implement * portably and we don't handle confidential data in * mandoc in the first place, simply free the memory * without clearing it. */ free(ptr); return newptr; } mandoc-1.14.6/compat_strcasestr.c010064400017530001753000000045221412314055300172560ustar00schwarzeschwarze/* $Id: compat_strcasestr.c,v 1.5 2020/06/15 01:37:15 schwarze Exp $ */ /* $NetBSD: strcasestr.c,v 1.3 2005/11/29 03:12:00 christos Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "config.h" #include #include #include #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) /* * Find the first occurrence of find in s, ignore case. */ char * strcasestr(const char *s, const char *find) { char c, sc; size_t len; if ((c = *find++) != 0) { c = tolower((unsigned char)c); len = strlen(find); do { do { if ((sc = *s++) == 0) return (NULL); } while ((char)tolower((unsigned char)sc) != c); } while (strncasecmp(s, find, len) != 0); s--; } return __UNCONST(s); } mandoc-1.14.6/compat_stringlist.c010064400017530001753000000063151412314055300172650ustar00schwarzeschwarze/* $Id: compat_stringlist.c,v 1.8 2020/06/15 21:48:09 schwarze Exp $ */ /* $NetBSD: stringlist.c,v 1.14 2015/05/21 01:29:13 christos Exp $ */ /*- * Copyright (c) 1994, 1999 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Christos Zoulas. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include #include #include "compat_stringlist.h" #define _SL_CHUNKSIZE 20 /* * sl_init(): Initialize a string list */ StringList * sl_init(void) { StringList *sl; sl = malloc(sizeof(StringList)); if (sl == NULL) return NULL; sl->sl_cur = 0; sl->sl_max = _SL_CHUNKSIZE; sl->sl_str = reallocarray(NULL, sl->sl_max, sizeof(char *)); if (sl->sl_str == NULL) { free(sl); sl = NULL; } return sl; } /* * sl_add(): Add an item to the string list */ int sl_add(StringList *sl, char *name) { if (sl->sl_cur == sl->sl_max - 1) { char **new; new = reallocarray(sl->sl_str, (sl->sl_max + _SL_CHUNKSIZE), sizeof(char *)); if (new == NULL) return -1; sl->sl_max += _SL_CHUNKSIZE; sl->sl_str = new; } sl->sl_str[sl->sl_cur++] = name; return 0; } /* * sl_free(): Free a stringlist */ void sl_free(StringList *sl, int all) { size_t i; if (sl == NULL) return; if (sl->sl_str) { if (all) for (i = 0; i < sl->sl_cur; i++) free(sl->sl_str[i]); free(sl->sl_str); } free(sl); } /* * sl_find(): Find a name in the string list */ char * sl_find(StringList *sl, const char *name) { size_t i; for (i = 0; i < sl->sl_cur; i++) if (strcmp(sl->sl_str[i], name) == 0) return sl->sl_str[i]; return NULL; } int sl_delete(StringList *sl, const char *name, int all) { size_t i, j; for (i = 0; i < sl->sl_cur; i++) if (strcmp(sl->sl_str[i], name) == 0) { if (all) free(sl->sl_str[i]); for (j = i + 1; j < sl->sl_cur; j++) sl->sl_str[j - 1] = sl->sl_str[j]; sl->sl_str[--sl->sl_cur] = NULL; return 0; } return -1; } mandoc-1.14.6/compat_strlcat.c010064400017530001753000000034451412314055300165400ustar00schwarzeschwarze/* $Id: compat_strlcat.c,v 1.6 2020/06/15 20:49:57 schwarze Exp $ */ /* $OpenBSD: strlcat.c,v 1.19 2019/01/25 00:19:25 millert Exp $ */ /* * Copyright (c) 1998, 2015 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include /* * Appends src to string dst of size dsize (unlike strncat, dsize is the * full size of dst, not space left). At most dsize-1 characters * will be copied. Always NUL terminates (unless dsize <= strlen(dst)). * Returns strlen(src) + MIN(dsize, strlen(initial dst)). * If retval >= dsize, truncation occurred. */ size_t strlcat(char *dst, const char *src, size_t dsize) { const char *odst = dst; const char *osrc = src; size_t n = dsize; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end. */ while (n-- != 0 && *dst != '\0') dst++; dlen = dst - odst; n = dsize - dlen; if (n-- == 0) return(dlen + strlen(src)); while (*src != '\0') { if (n != 0) { *dst++ = *src; n--; } src++; } *dst = '\0'; return(dlen + (src - osrc)); /* count does not include NUL */ } mandoc-1.14.6/compat_strlcpy.c010064400017530001753000000032221412314055300165550ustar00schwarzeschwarze/* $Id: compat_strlcpy.c,v 1.6 2020/06/15 20:49:57 schwarze Exp $ */ /* $OpenBSD: strlcpy.c,v 1.16 2019/01/25 00:19:25 millert Exp $ */ /* * Copyright (c) 1998, 2015 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include /* * Copy string src to buffer dst of size dsize. At most dsize-1 * chars will be copied. Always NUL terminates (unless dsize == 0). * Returns strlen(src); if retval >= dsize, truncation occurred. */ size_t strlcpy(char *dst, const char *src, size_t dsize) { const char *osrc = src; size_t nleft = dsize; /* Copy as many bytes as will fit. */ if (nleft != 0) { while (--nleft != 0) { if ((*dst++ = *src++) == '\0') break; } } /* Not enough room in dst, add NUL and traverse rest of src. */ if (nleft == 0) { if (dsize != 0) *dst = '\0'; /* NUL-terminate dst */ while (*src++) ; } return(src - osrc - 1); /* count does not include NUL */ } mandoc-1.14.6/compat_strndup.c010064400017530001753000000024001412314055300165510ustar00schwarzeschwarze/* $Id: compat_strndup.c,v 1.3 2020/06/15 20:19:39 schwarze Exp $ */ /* $OpenBSD: strndup.c,v 1.3 2019/01/25 00:19:25 millert Exp $ */ /* * Copyright (c) 2010 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include char * strndup(const char *str, size_t maxlen) { char *copy; size_t len; for (len = 0; len < maxlen && str[len] != '\0'; len++) continue; copy = malloc(len + 1); if (copy != NULL) { (void)memcpy(copy, str, len); copy[len] = '\0'; } return copy; } mandoc-1.14.6/compat_strsep.c010064400017530001753000000050101412314055300163720ustar00schwarzeschwarze/* $Id: compat_strsep.c,v 1.5 2020/06/15 01:37:15 schwarze Exp $ */ /* $OpenBSD: strsep.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "config.h" /* * Get next token from string *stringp, where tokens are possibly-empty * strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. * On return, *stringp points past the last NUL written (if there might * be further tokens), or is NULL (if there are definitely no more tokens). * * If *stringp is NULL, strsep returns NULL. */ char * strsep(char **stringp, const char *delim) { char *s; const char *spanp; int c, sc; char *tok; if ((s = *stringp) == NULL) return (NULL); for (tok = s;;) { c = *s++; spanp = delim; do { if ((sc = *spanp++) == c) { if (c == 0) s = NULL; else s[-1] = 0; *stringp = s; return (tok); } } while (sc != 0); } /* NOTREACHED */ } mandoc-1.14.6/compat_strtonum.c010064400017530001753000000035061412314055300167550ustar00schwarzeschwarze/* $Id: compat_strtonum.c,v 1.2 2020/06/15 01:37:15 schwarze Exp $ */ /* $OpenBSD: strtonum.c,v 1.8 2015/09/13 08:31:48 guenther Exp $ */ /* * Copyright (c) 2004 Ted Unangst and Todd Miller * All rights reserved. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #define INVALID 1 #define TOOSMALL 2 #define TOOLARGE 3 long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp) { long long ll = 0; int error = 0; char *ep; struct errval { const char *errstr; int err; } ev[4] = { { NULL, 0 }, { "invalid", EINVAL }, { "too small", ERANGE }, { "too large", ERANGE }, }; ev[0].err = errno; errno = 0; if (minval > maxval) { error = INVALID; } else { ll = strtoll(numstr, &ep, 10); if (numstr == ep || *ep != '\0') error = INVALID; else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) error = TOOSMALL; else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) error = TOOLARGE; } if (errstrp != NULL) *errstrp = ev[error].errstr; errno = ev[error].err; if (error) ll = 0; return (ll); } mandoc-1.14.6/compat_vasprintf.c010064400017530001753000000030041412314055300170670ustar00schwarzeschwarze/* $Id: compat_vasprintf.c,v 1.4 2020/06/15 01:37:15 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * This fallback implementation is not efficient: * It does the formatting twice. * Short of fiddling with the unknown internals of the system's * printf(3) or completely reimplementing printf(3), i can't think * of another portable solution. */ #include "config.h" #include #include #include int vasprintf(char **ret, const char *format, va_list ap) { char buf[2]; va_list ap2; int sz; va_copy(ap2, ap); sz = vsnprintf(buf, sizeof(buf), format, ap2); va_end(ap2); if (sz != -1 && (*ret = malloc(sz + 1)) != NULL) { if (vsnprintf(*ret, sz + 1, format, ap) == sz) return sz; free(*ret); } *ret = NULL; return -1; } mandoc-1.14.6/dba.c010064400017530001753000000320251412314055300142430ustar00schwarzeschwarze/* $Id: dba.c,v 1.10 2017/02/17 14:43:54 schwarze Exp $ */ /* * Copyright (c) 2016, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Allocation-based version of the mandoc database, for read-write access. * The interface is defined in "dba.h". */ #include "config.h" #include #if HAVE_ENDIAN #include #elif HAVE_SYS_ENDIAN #include #elif HAVE_NTOHL #include #endif #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc_ohash.h" #include "mansearch.h" #include "dba_write.h" #include "dba_array.h" #include "dba.h" struct macro_entry { struct dba_array *pages; char value[]; }; static void *prepend(const char *, char); static void dba_pages_write(struct dba_array *); static int compare_names(const void *, const void *); static int compare_strings(const void *, const void *); static struct macro_entry *get_macro_entry(struct ohash *, const char *, int32_t); static void dba_macros_write(struct dba_array *); static void dba_macro_write(struct ohash *); static int compare_entries(const void *, const void *); /*** top-level functions **********************************************/ struct dba * dba_new(int32_t npages) { struct dba *dba; struct ohash *macro; int32_t im; dba = mandoc_malloc(sizeof(*dba)); dba->pages = dba_array_new(npages, DBA_GROW); dba->macros = dba_array_new(MACRO_MAX, 0); for (im = 0; im < MACRO_MAX; im++) { macro = mandoc_malloc(sizeof(*macro)); mandoc_ohash_init(macro, 4, offsetof(struct macro_entry, value)); dba_array_set(dba->macros, im, macro); } return dba; } void dba_free(struct dba *dba) { struct dba_array *page; struct ohash *macro; struct macro_entry *entry; unsigned int slot; dba_array_FOREACH(dba->macros, macro) { for (entry = ohash_first(macro, &slot); entry != NULL; entry = ohash_next(macro, &slot)) { dba_array_free(entry->pages); free(entry); } ohash_delete(macro); free(macro); } dba_array_free(dba->macros); dba_array_undel(dba->pages); dba_array_FOREACH(dba->pages, page) { dba_array_free(dba_array_get(page, DBP_NAME)); dba_array_free(dba_array_get(page, DBP_SECT)); dba_array_free(dba_array_get(page, DBP_ARCH)); free(dba_array_get(page, DBP_DESC)); dba_array_free(dba_array_get(page, DBP_FILE)); dba_array_free(page); } dba_array_free(dba->pages); free(dba); } /* * Write the complete mandoc database to disk; the format is: * - One integer each for magic and version. * - One pointer each to the macros table and to the final magic. * - The pages table. * - The macros table. * - And at the very end, the magic integer again. */ int dba_write(const char *fname, struct dba *dba) { int save_errno; int32_t pos_end, pos_macros, pos_macros_ptr; if (dba_open(fname) == -1) return -1; dba_int_write(MANDOCDB_MAGIC); dba_int_write(MANDOCDB_VERSION); pos_macros_ptr = dba_skip(1, 2); dba_pages_write(dba->pages); pos_macros = dba_tell(); dba_macros_write(dba->macros); pos_end = dba_tell(); dba_int_write(MANDOCDB_MAGIC); dba_seek(pos_macros_ptr); dba_int_write(pos_macros); dba_int_write(pos_end); if (dba_close() == -1) { save_errno = errno; unlink(fname); errno = save_errno; return -1; } return 0; } /*** functions for handling pages *************************************/ /* * Create a new page and append it to the pages table. */ struct dba_array * dba_page_new(struct dba_array *pages, const char *arch, const char *desc, const char *file, enum form form) { struct dba_array *page, *entry; page = dba_array_new(DBP_MAX, 0); entry = dba_array_new(1, DBA_STR | DBA_GROW); dba_array_add(page, entry); entry = dba_array_new(1, DBA_STR | DBA_GROW); dba_array_add(page, entry); if (arch != NULL && *arch != '\0') { entry = dba_array_new(1, DBA_STR | DBA_GROW); dba_array_add(entry, (void *)arch); } else entry = NULL; dba_array_add(page, entry); dba_array_add(page, mandoc_strdup(desc)); entry = dba_array_new(1, DBA_STR | DBA_GROW); dba_array_add(entry, prepend(file, form)); dba_array_add(page, entry); dba_array_add(pages, page); return page; } /* * Add a section, architecture, or file name to an existing page. * Passing the NULL pointer for the architecture makes the page MI. * In that case, any earlier or later architectures are ignored. */ void dba_page_add(struct dba_array *page, int32_t ie, const char *str) { struct dba_array *entries; char *entry; entries = dba_array_get(page, ie); if (ie == DBP_ARCH) { if (entries == NULL) return; if (str == NULL || *str == '\0') { dba_array_free(entries); dba_array_set(page, DBP_ARCH, NULL); return; } } if (*str == '\0') return; dba_array_FOREACH(entries, entry) { if (ie == DBP_FILE && *entry < ' ') entry++; if (strcmp(entry, str) == 0) return; } dba_array_add(entries, (void *)str); } /* * Add an additional name to an existing page. */ void dba_page_alias(struct dba_array *page, const char *name, uint64_t mask) { struct dba_array *entries; char *entry; char maskbyte; if (*name == '\0') return; maskbyte = mask & NAME_MASK; entries = dba_array_get(page, DBP_NAME); dba_array_FOREACH(entries, entry) { if (strcmp(entry + 1, name) == 0) { *entry |= maskbyte; return; } } dba_array_add(entries, prepend(name, maskbyte)); } /* * Return a pointer to a temporary copy of instr with inbyte prepended. */ static void * prepend(const char *instr, char inbyte) { static char *outstr = NULL; static size_t outlen = 0; size_t newlen; newlen = strlen(instr) + 1; if (newlen > outlen) { outstr = mandoc_realloc(outstr, newlen + 1); outlen = newlen; } *outstr = inbyte; memcpy(outstr + 1, instr, newlen); return outstr; } /* * Write the pages table to disk; the format is: * - One integer containing the number of pages. * - For each page, five pointers to the names, sections, * architectures, description, and file names of the page. * MI pages write 0 instead of the architecture pointer. * - One list each for names, sections, architectures, descriptions and * file names. The description for each page ends with a NUL byte. * For all the other lists, each string ends with a NUL byte, * and the last string for a page ends with two NUL bytes. * - To assure alignment of following integers, * the end is padded with NUL bytes up to a multiple of four bytes. */ static void dba_pages_write(struct dba_array *pages) { struct dba_array *page, *entry; int32_t pos_pages, pos_end; pos_pages = dba_array_writelen(pages, 5); dba_array_FOREACH(pages, page) { dba_array_setpos(page, DBP_NAME, dba_tell()); entry = dba_array_get(page, DBP_NAME); dba_array_sort(entry, compare_names); dba_array_writelst(entry); } dba_array_FOREACH(pages, page) { dba_array_setpos(page, DBP_SECT, dba_tell()); entry = dba_array_get(page, DBP_SECT); dba_array_sort(entry, compare_strings); dba_array_writelst(entry); } dba_array_FOREACH(pages, page) { if ((entry = dba_array_get(page, DBP_ARCH)) != NULL) { dba_array_setpos(page, DBP_ARCH, dba_tell()); dba_array_sort(entry, compare_strings); dba_array_writelst(entry); } else dba_array_setpos(page, DBP_ARCH, 0); } dba_array_FOREACH(pages, page) { dba_array_setpos(page, DBP_DESC, dba_tell()); dba_str_write(dba_array_get(page, DBP_DESC)); } dba_array_FOREACH(pages, page) { dba_array_setpos(page, DBP_FILE, dba_tell()); dba_array_writelst(dba_array_get(page, DBP_FILE)); } pos_end = dba_align(); dba_seek(pos_pages); dba_array_FOREACH(pages, page) dba_array_writepos(page); dba_seek(pos_end); } static int compare_names(const void *vp1, const void *vp2) { const char *cp1, *cp2; int diff; cp1 = *(const char * const *)vp1; cp2 = *(const char * const *)vp2; return (diff = *cp2 - *cp1) ? diff : strcasecmp(cp1 + 1, cp2 + 1); } static int compare_strings(const void *vp1, const void *vp2) { const char *cp1, *cp2; cp1 = *(const char * const *)vp1; cp2 = *(const char * const *)vp2; return strcmp(cp1, cp2); } /*** functions for handling macros ************************************/ /* * In the hash table for a single macro, look up an entry by * the macro value or add an empty one if it doesn't exist yet. */ static struct macro_entry * get_macro_entry(struct ohash *macro, const char *value, int32_t np) { struct macro_entry *entry; size_t len; unsigned int slot; slot = ohash_qlookup(macro, value); if ((entry = ohash_find(macro, slot)) == NULL) { len = strlen(value) + 1; entry = mandoc_malloc(sizeof(*entry) + len); memcpy(&entry->value, value, len); entry->pages = dba_array_new(np, DBA_GROW); ohash_insert(macro, slot, entry); } return entry; } /* * In addition to get_macro_entry(), add multiple page references, * converting them from the on-disk format (byte offsets in the file) * to page pointers in memory. */ void dba_macro_new(struct dba *dba, int32_t im, const char *value, const int32_t *pp) { struct macro_entry *entry; const int32_t *ip; int32_t np; np = 0; for (ip = pp; *ip; ip++) np++; entry = get_macro_entry(dba_array_get(dba->macros, im), value, np); for (ip = pp; *ip; ip++) dba_array_add(entry->pages, dba_array_get(dba->pages, be32toh(*ip) / 5 / sizeof(*ip) - 1)); } /* * In addition to get_macro_entry(), add one page reference, * directly taking the in-memory page pointer as an argument. */ void dba_macro_add(struct dba_array *macros, int32_t im, const char *value, struct dba_array *page) { struct macro_entry *entry; if (*value == '\0') return; entry = get_macro_entry(dba_array_get(macros, im), value, 1); dba_array_add(entry->pages, page); } /* * Write the macros table to disk; the format is: * - The number of macro tables (actually, MACRO_MAX). * - That number of pointers to the individual macro tables. * - The individual macro tables. */ static void dba_macros_write(struct dba_array *macros) { struct ohash *macro; int32_t im, pos_macros, pos_end; pos_macros = dba_array_writelen(macros, 1); im = 0; dba_array_FOREACH(macros, macro) { dba_array_setpos(macros, im++, dba_tell()); dba_macro_write(macro); } pos_end = dba_tell(); dba_seek(pos_macros); dba_array_writepos(macros); dba_seek(pos_end); } /* * Write one individual macro table to disk; the format is: * - The number of entries in the table. * - For each entry, two pointers, the first one to the value * and the second one to the list of pages. * - A list of values, each ending in a NUL byte. * - To assure alignment of following integers, * padding with NUL bytes up to a multiple of four bytes. * - A list of pointers to pages, each list ending in a 0 integer. */ static void dba_macro_write(struct ohash *macro) { struct macro_entry **entries, *entry; struct dba_array *page; int32_t *kpos, *dpos; unsigned int ie, ne, slot; int use; int32_t addr, pos_macro, pos_end; /* Temporary storage for filtering and sorting. */ ne = ohash_entries(macro); entries = mandoc_reallocarray(NULL, ne, sizeof(*entries)); kpos = mandoc_reallocarray(NULL, ne, sizeof(*kpos)); dpos = mandoc_reallocarray(NULL, ne, sizeof(*dpos)); /* Build a list of non-empty entries and sort it. */ ne = 0; for (entry = ohash_first(macro, &slot); entry != NULL; entry = ohash_next(macro, &slot)) { use = 0; dba_array_FOREACH(entry->pages, page) if (dba_array_getpos(page)) use = 1; if (use) entries[ne++] = entry; } qsort(entries, ne, sizeof(*entries), compare_entries); /* Number of entries, and space for the pointer pairs. */ dba_int_write(ne); pos_macro = dba_skip(2, ne); /* String table. */ for (ie = 0; ie < ne; ie++) { kpos[ie] = dba_tell(); dba_str_write(entries[ie]->value); } dba_align(); /* Pages table. */ for (ie = 0; ie < ne; ie++) { dpos[ie] = dba_tell(); dba_array_FOREACH(entries[ie]->pages, page) if ((addr = dba_array_getpos(page))) dba_int_write(addr); dba_int_write(0); } pos_end = dba_tell(); /* Fill in the pointer pairs. */ dba_seek(pos_macro); for (ie = 0; ie < ne; ie++) { dba_int_write(kpos[ie]); dba_int_write(dpos[ie]); } dba_seek(pos_end); free(entries); free(kpos); free(dpos); } static int compare_entries(const void *vp1, const void *vp2) { const struct macro_entry *ep1, *ep2; ep1 = *(const struct macro_entry * const *)vp1; ep2 = *(const struct macro_entry * const *)vp2; return strcmp(ep1->value, ep2->value); } mandoc-1.14.6/dba_array.c010064400017530001753000000104031412314055300154350ustar00schwarzeschwarze/* $Id: dba_array.c,v 1.2 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Allocation-based arrays for the mandoc database, for read-write access. * The interface is defined in "dba_array.h". */ #include "config.h" #include #include #include #include #include "mandoc_aux.h" #include "dba_write.h" #include "dba_array.h" struct dba_array { void **ep; /* Array of entries. */ int32_t *em; /* Array of map positions. */ int flags; int32_t ea; /* Entries allocated. */ int32_t eu; /* Entries used (including deleted). */ int32_t ed; /* Entries deleted. */ int32_t ec; /* Currently active entry. */ int32_t pos; /* Map position of this array. */ }; struct dba_array * dba_array_new(int32_t ea, int flags) { struct dba_array *array; assert(ea > 0); array = mandoc_malloc(sizeof(*array)); array->ep = mandoc_reallocarray(NULL, ea, sizeof(*array->ep)); array->em = mandoc_reallocarray(NULL, ea, sizeof(*array->em)); array->ea = ea; array->eu = 0; array->ed = 0; array->ec = 0; array->flags = flags; array->pos = 0; return array; } void dba_array_free(struct dba_array *array) { int32_t ie; if (array == NULL) return; if (array->flags & DBA_STR) for (ie = 0; ie < array->eu; ie++) free(array->ep[ie]); free(array->ep); free(array->em); free(array); } void dba_array_set(struct dba_array *array, int32_t ie, void *entry) { assert(ie >= 0); assert(ie < array->ea); assert(ie <= array->eu); if (ie == array->eu) array->eu++; if (array->flags & DBA_STR) entry = mandoc_strdup(entry); array->ep[ie] = entry; array->em[ie] = 0; } void dba_array_add(struct dba_array *array, void *entry) { if (array->eu == array->ea) { assert(array->flags & DBA_GROW); array->ep = mandoc_reallocarray(array->ep, 2, sizeof(*array->ep) * array->ea); array->em = mandoc_reallocarray(array->em, 2, sizeof(*array->em) * array->ea); array->ea *= 2; } dba_array_set(array, array->eu, entry); } void * dba_array_get(struct dba_array *array, int32_t ie) { if (ie < 0 || ie >= array->eu || array->em[ie] == -1) return NULL; return array->ep[ie]; } void dba_array_start(struct dba_array *array) { array->ec = array->eu; } void * dba_array_next(struct dba_array *array) { if (array->ec < array->eu) array->ec++; else array->ec = 0; while (array->ec < array->eu && array->em[array->ec] == -1) array->ec++; return array->ec < array->eu ? array->ep[array->ec] : NULL; } void dba_array_del(struct dba_array *array) { if (array->ec < array->eu && array->em[array->ec] != -1) { array->em[array->ec] = -1; array->ed++; } } void dba_array_undel(struct dba_array *array) { memset(array->em, 0, sizeof(*array->em) * array->eu); } void dba_array_setpos(struct dba_array *array, int32_t ie, int32_t pos) { array->em[ie] = pos; } int32_t dba_array_getpos(struct dba_array *array) { return array->pos; } void dba_array_sort(struct dba_array *array, dba_compare_func func) { assert(array->ed == 0); qsort(array->ep, array->eu, sizeof(*array->ep), func); } int32_t dba_array_writelen(struct dba_array *array, int32_t nmemb) { dba_int_write(array->eu - array->ed); return dba_skip(nmemb, array->eu - array->ed); } void dba_array_writepos(struct dba_array *array) { int32_t ie; array->pos = dba_tell(); for (ie = 0; ie < array->eu; ie++) if (array->em[ie] != -1) dba_int_write(array->em[ie]); } void dba_array_writelst(struct dba_array *array) { const char *str; dba_array_FOREACH(array, str) dba_str_write(str); dba_char_write('\0'); } mandoc-1.14.6/dba_read.c010064400017530001753000000045451412314055300152440ustar00schwarzeschwarze/* $Id: dba_read.c,v 1.5 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Function to read the mandoc database from disk into RAM, * such that data can be added or removed. * The interface is defined in "dba.h". * This file is seperate from dba.c because this also uses "dbm.h". */ #include "config.h" #include #include #include #include #include #include "mandoc_aux.h" #include "mansearch.h" #include "dba_array.h" #include "dba.h" #include "dbm.h" struct dba * dba_read(const char *fname) { struct dba *dba; struct dba_array *page; struct dbm_page *pdata; struct dbm_macro *mdata; const char *cp; int32_t im, ip, iv, npages; if (dbm_open(fname) == -1) return NULL; npages = dbm_page_count(); dba = dba_new(npages < 128 ? 128 : npages); for (ip = 0; ip < npages; ip++) { pdata = dbm_page_get(ip); page = dba_page_new(dba->pages, pdata->arch, pdata->desc, pdata->file + 1, *pdata->file); for (cp = pdata->name; *cp != '\0'; cp = strchr(cp, '\0') + 1) dba_page_add(page, DBP_NAME, cp); for (cp = pdata->sect; *cp != '\0'; cp = strchr(cp, '\0') + 1) dba_page_add(page, DBP_SECT, cp); if ((cp = pdata->arch) != NULL) while (*(cp = strchr(cp, '\0') + 1) != '\0') dba_page_add(page, DBP_ARCH, cp); cp = pdata->file; while (*(cp = strchr(cp, '\0') + 1) != '\0') dba_page_add(page, DBP_FILE, cp); } for (im = 0; im < MACRO_MAX; im++) { for (iv = 0; iv < dbm_macro_count(im); iv++) { mdata = dbm_macro_get(im, iv); dba_macro_new(dba, im, mdata->value, mdata->pp); } } dbm_close(); return dba; } mandoc-1.14.6/dba_write.c010064400017530001753000000046631412314055300154640ustar00schwarzeschwarze/* $Id: dba_write.c,v 1.3 2016/08/05 23:15:08 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Low-level functions for serializing allocation-based data to disk. * The interface is defined in "dba_write.h". */ #include "config.h" #include #if HAVE_ENDIAN #include #elif HAVE_SYS_ENDIAN #include #elif HAVE_NTOHL #include #endif #if HAVE_ERR #include #endif #include #include #include #include #include "dba_write.h" static FILE *ofp; int dba_open(const char *fname) { ofp = fopen(fname, "w"); return ofp == NULL ? -1 : 0; } int dba_close(void) { return fclose(ofp) == EOF ? -1 : 0; } int32_t dba_tell(void) { long pos; if ((pos = ftell(ofp)) == -1) err(1, "ftell"); if (pos >= INT32_MAX) { errno = EOVERFLOW; err(1, "ftell = %ld", pos); } return pos; } void dba_seek(int32_t pos) { if (fseek(ofp, pos, SEEK_SET) == -1) err(1, "fseek(%d)", pos); } int32_t dba_align(void) { int32_t pos; pos = dba_tell(); while (pos & 3) { dba_char_write('\0'); pos++; } return pos; } int32_t dba_skip(int32_t nmemb, int32_t sz) { const int32_t out[5] = {0, 0, 0, 0, 0}; int32_t i, pos; assert(sz >= 0); assert(nmemb > 0); assert(nmemb <= 5); pos = dba_tell(); for (i = 0; i < sz; i++) if (nmemb - fwrite(&out, sizeof(out[0]), nmemb, ofp)) err(1, "fwrite"); return pos; } void dba_char_write(int c) { if (putc(c, ofp) == EOF) err(1, "fputc"); } void dba_str_write(const char *str) { if (fputs(str, ofp) == EOF) err(1, "fputs"); dba_char_write('\0'); } void dba_int_write(int32_t i) { i = htobe32(i); if (fwrite(&i, sizeof(i), 1, ofp) != 1) err(1, "fwrite"); } mandoc-1.14.6/dbm.c010064400017530001753000000224431412314055300142620ustar00schwarzeschwarze/* $Id: dbm.c,v 1.7 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Map-based version of the mandoc database, for read-only access. * The interface is defined in "dbm.h". */ #include "config.h" #include #if HAVE_ENDIAN #include #elif HAVE_SYS_ENDIAN #include #elif HAVE_NTOHL #include #endif #if HAVE_ERR #include #endif #include #include #include #include #include #include #include "mansearch.h" #include "dbm_map.h" #include "dbm.h" struct macro { int32_t value; int32_t pages; }; struct page { int32_t name; int32_t sect; int32_t arch; int32_t desc; int32_t file; }; enum iter { ITER_NONE = 0, ITER_NAME, ITER_SECT, ITER_ARCH, ITER_DESC, ITER_MACRO }; static struct macro *macros[MACRO_MAX]; static int32_t nvals[MACRO_MAX]; static struct page *pages; static int32_t npages; static enum iter iteration; static struct dbm_res page_bytitle(enum iter, const struct dbm_match *); static struct dbm_res page_byarch(const struct dbm_match *); static struct dbm_res page_bymacro(int32_t, const struct dbm_match *); static char *macro_bypage(int32_t, int32_t); /*** top level functions **********************************************/ /* * Open a disk-based mandoc database for read-only access. * Map the pages and macros[] arrays. * Return 0 on success. Return -1 and set errno on failure. */ int dbm_open(const char *fname) { const int32_t *mp, *ep; int32_t im; if (dbm_map(fname) == -1) return -1; if ((npages = be32toh(*dbm_getint(4))) < 0) { warnx("dbm_open(%s): Invalid number of pages: %d", fname, npages); goto fail; } pages = (struct page *)dbm_getint(5); if ((mp = dbm_get(*dbm_getint(2))) == NULL) { warnx("dbm_open(%s): Invalid offset of macros array", fname); goto fail; } if (be32toh(*mp) != MACRO_MAX) { warnx("dbm_open(%s): Invalid number of macros: %d", fname, be32toh(*mp)); goto fail; } for (im = 0; im < MACRO_MAX; im++) { if ((ep = dbm_get(*++mp)) == NULL) { warnx("dbm_open(%s): Invalid offset of macro %d", fname, im); goto fail; } nvals[im] = be32toh(*ep); macros[im] = (struct macro *)++ep; } return 0; fail: dbm_unmap(); errno = EFTYPE; return -1; } void dbm_close(void) { dbm_unmap(); } /*** functions for handling pages *************************************/ int32_t dbm_page_count(void) { return npages; } /* * Give the caller pointers to the data for one manual page. */ struct dbm_page * dbm_page_get(int32_t ip) { static struct dbm_page res; assert(ip >= 0); assert(ip < npages); res.name = dbm_get(pages[ip].name); if (res.name == NULL) res.name = "(NULL)\0"; res.sect = dbm_get(pages[ip].sect); if (res.sect == NULL) res.sect = "(NULL)\0"; res.arch = pages[ip].arch ? dbm_get(pages[ip].arch) : NULL; res.desc = dbm_get(pages[ip].desc); if (res.desc == NULL) res.desc = "(NULL)"; res.file = dbm_get(pages[ip].file); if (res.file == NULL) res.file = " (NULL)\0"; res.addr = dbm_addr(pages + ip); return &res; } /* * Functions to start filtered iterations over manual pages. */ void dbm_page_byname(const struct dbm_match *match) { assert(match != NULL); page_bytitle(ITER_NAME, match); } void dbm_page_bysect(const struct dbm_match *match) { assert(match != NULL); page_bytitle(ITER_SECT, match); } void dbm_page_byarch(const struct dbm_match *match) { assert(match != NULL); page_byarch(match); } void dbm_page_bydesc(const struct dbm_match *match) { assert(match != NULL); page_bytitle(ITER_DESC, match); } void dbm_page_bymacro(int32_t im, const struct dbm_match *match) { assert(im >= 0); assert(im < MACRO_MAX); assert(match != NULL); page_bymacro(im, match); } /* * Return the number of the next manual page in the current iteration. */ struct dbm_res dbm_page_next(void) { struct dbm_res res = {-1, 0}; switch(iteration) { case ITER_NONE: return res; case ITER_ARCH: return page_byarch(NULL); case ITER_MACRO: return page_bymacro(0, NULL); default: return page_bytitle(iteration, NULL); } } /* * Functions implementing the iteration over manual pages. */ static struct dbm_res page_bytitle(enum iter arg_iter, const struct dbm_match *arg_match) { static const struct dbm_match *match; static const char *cp; static int32_t ip; struct dbm_res res = {-1, 0}; assert(arg_iter == ITER_NAME || arg_iter == ITER_DESC || arg_iter == ITER_SECT); /* Initialize for a new iteration. */ if (arg_match != NULL) { iteration = arg_iter; match = arg_match; switch (iteration) { case ITER_NAME: cp = dbm_get(pages[0].name); break; case ITER_SECT: cp = dbm_get(pages[0].sect); break; case ITER_DESC: cp = dbm_get(pages[0].desc); break; default: abort(); } if (cp == NULL) { iteration = ITER_NONE; match = NULL; cp = NULL; ip = npages; } else ip = 0; return res; } /* Search for a name. */ while (ip < npages) { if (iteration == ITER_NAME) cp++; if (dbm_match(match, cp)) break; cp = strchr(cp, '\0') + 1; if (iteration == ITER_DESC) ip++; else if (*cp == '\0') { cp++; ip++; } } /* Reached the end without a match. */ if (ip == npages) { iteration = ITER_NONE; match = NULL; cp = NULL; return res; } /* Found a match; save the quality for later retrieval. */ res.page = ip; res.bits = iteration == ITER_NAME ? cp[-1] : 0; /* Skip the remaining names of this page. */ if (++ip < npages) { do { cp++; } while (cp[-1] != '\0' || (iteration != ITER_DESC && cp[-2] != '\0')); } return res; } static struct dbm_res page_byarch(const struct dbm_match *arg_match) { static const struct dbm_match *match; struct dbm_res res = {-1, 0}; static int32_t ip; const char *cp; /* Initialize for a new iteration. */ if (arg_match != NULL) { iteration = ITER_ARCH; match = arg_match; ip = 0; return res; } /* Search for an architecture. */ for ( ; ip < npages; ip++) if (pages[ip].arch) for (cp = dbm_get(pages[ip].arch); *cp != '\0'; cp = strchr(cp, '\0') + 1) if (dbm_match(match, cp)) { res.page = ip++; return res; } /* Reached the end without a match. */ iteration = ITER_NONE; match = NULL; return res; } static struct dbm_res page_bymacro(int32_t arg_im, const struct dbm_match *arg_match) { static const struct dbm_match *match; static const int32_t *pp; static const char *cp; static int32_t im, iv; struct dbm_res res = {-1, 0}; assert(im >= 0); assert(im < MACRO_MAX); /* Initialize for a new iteration. */ if (arg_match != NULL) { iteration = ITER_MACRO; match = arg_match; im = arg_im; cp = nvals[im] ? dbm_get(macros[im]->value) : NULL; pp = NULL; iv = -1; return res; } if (iteration != ITER_MACRO) return res; /* Find the next matching macro value. */ while (pp == NULL || *pp == 0) { if (++iv == nvals[im]) { iteration = ITER_NONE; return res; } if (iv) cp = strchr(cp, '\0') + 1; if (dbm_match(match, cp)) pp = dbm_get(macros[im][iv].pages); } /* Found a matching page. */ res.page = (struct page *)dbm_get(*pp++) - pages; return res; } /*** functions for handling macros ************************************/ int32_t dbm_macro_count(int32_t im) { assert(im >= 0); assert(im < MACRO_MAX); return nvals[im]; } struct dbm_macro * dbm_macro_get(int32_t im, int32_t iv) { static struct dbm_macro macro; assert(im >= 0); assert(im < MACRO_MAX); assert(iv >= 0); assert(iv < nvals[im]); macro.value = dbm_get(macros[im][iv].value); macro.pp = dbm_get(macros[im][iv].pages); return ¯o; } /* * Filtered iteration over macro entries. */ void dbm_macro_bypage(int32_t im, int32_t ip) { assert(im >= 0); assert(im < MACRO_MAX); assert(ip != 0); macro_bypage(im, ip); } char * dbm_macro_next(void) { return macro_bypage(MACRO_MAX, 0); } static char * macro_bypage(int32_t arg_im, int32_t arg_ip) { static const int32_t *pp; static int32_t im, ip, iv; /* Initialize for a new iteration. */ if (arg_im < MACRO_MAX && arg_ip != 0) { im = arg_im; ip = arg_ip; pp = dbm_get(macros[im]->pages); iv = 0; return NULL; } if (im >= MACRO_MAX) return NULL; /* Search for the next value. */ while (iv < nvals[im]) { if (*pp == ip) break; if (*pp == 0) iv++; pp++; } /* Reached the end without a match. */ if (iv == nvals[im]) { im = MACRO_MAX; ip = 0; pp = NULL; return NULL; } /* Found a match; skip the remaining pages of this entry. */ if (++iv < nvals[im]) while (*pp++ != 0) continue; return dbm_get(macros[im][iv - 1].value); } mandoc-1.14.6/dbm_map.c010064400017530001753000000112601412314055300151120ustar00schwarzeschwarze/* $Id: dbm_map.c,v 1.8 2017/02/17 14:43:54 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Low-level routines for the map-based version * of the mandoc database, for read-only access. * The interface is defined in "dbm_map.h". */ #include "config.h" #include #include #include #if HAVE_ENDIAN #include #elif HAVE_SYS_ENDIAN #include #elif HAVE_NTOHL #include #endif #if HAVE_ERR #include #endif #include #include #include #include #include #include #include #include "mansearch.h" #include "dbm_map.h" #include "dbm.h" static struct stat st; static char *dbm_base; static int ifd; static int32_t max_offset; /* * Open a disk-based database for read-only access. * Validate the file format as far as it is not mandoc-specific. * Return 0 on success. Return -1 and set errno on failure. */ int dbm_map(const char *fname) { int save_errno; const int32_t *magic; if ((ifd = open(fname, O_RDONLY)) == -1) return -1; if (fstat(ifd, &st) == -1) goto fail; if (st.st_size < 5) { warnx("dbm_map(%s): File too short", fname); errno = EFTYPE; goto fail; } if (st.st_size > INT32_MAX) { errno = EFBIG; goto fail; } if ((dbm_base = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, ifd, 0)) == MAP_FAILED) goto fail; magic = dbm_getint(0); if (be32toh(*magic) != MANDOCDB_MAGIC) { if (strncmp(dbm_base, "SQLite format 3", 15)) warnx("dbm_map(%s): " "Bad initial magic %x (expected %x)", fname, be32toh(*magic), MANDOCDB_MAGIC); else warnx("dbm_map(%s): " "Obsolete format based on SQLite 3", fname); errno = EFTYPE; goto fail; } magic = dbm_getint(1); if (be32toh(*magic) != MANDOCDB_VERSION) { warnx("dbm_map(%s): Bad version number %d (expected %d)", fname, be32toh(*magic), MANDOCDB_VERSION); errno = EFTYPE; goto fail; } max_offset = be32toh(*dbm_getint(3)) + sizeof(int32_t); if (st.st_size != max_offset) { warnx("dbm_map(%s): Inconsistent file size %lld (expected %d)", fname, (long long)st.st_size, max_offset); errno = EFTYPE; goto fail; } if ((magic = dbm_get(*dbm_getint(3))) == NULL) { errno = EFTYPE; goto fail; } if (be32toh(*magic) != MANDOCDB_MAGIC) { warnx("dbm_map(%s): Bad final magic %x (expected %x)", fname, be32toh(*magic), MANDOCDB_MAGIC); errno = EFTYPE; goto fail; } return 0; fail: save_errno = errno; close(ifd); errno = save_errno; return -1; } void dbm_unmap(void) { if (munmap(dbm_base, st.st_size) == -1) warn("dbm_unmap: munmap"); if (close(ifd) == -1) warn("dbm_unmap: close"); dbm_base = (char *)-1; } /* * Take a raw integer as it was read from the database. * Interpret it as an offset into the database file * and return a pointer to that place in the file. */ void * dbm_get(int32_t offset) { offset = be32toh(offset); if (offset < 0) { warnx("dbm_get: Database corrupt: offset %d", offset); return NULL; } if (offset >= max_offset) { warnx("dbm_get: Database corrupt: offset %d > %d", offset, max_offset); return NULL; } return dbm_base + offset; } /* * Assume the database starts with some integers. * Assume they are numbered starting from 0, increasing. * Get a pointer to one with the number "offset". */ int32_t * dbm_getint(int32_t offset) { return (int32_t *)dbm_base + offset; } /* * The reverse of dbm_get(). * Take pointer into the database file * and convert it to the raw integer * that would be used to refer to that place in the file. */ int32_t dbm_addr(const void *p) { return htobe32((const char *)p - dbm_base); } int dbm_match(const struct dbm_match *match, const char *str) { switch (match->type) { case DBM_EXACT: return strcmp(str, match->str) == 0; case DBM_SUB: return strcasestr(str, match->str) != NULL; case DBM_REGEX: return regexec(match->re, str, 0, NULL, 0) == 0; default: abort(); } } mandoc-1.14.6/demandoc.c010064400017530001753000000123261412314055300152710ustar00schwarzeschwarze/* $Id: demandoc.c,v 1.33 2019/03/03 11:01:15 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "man.h" #include "mdoc.h" #include "mandoc_parse.h" static void pline(int, int *, int *, int); static void pman(const struct roff_node *, int *, int *, int); static void pmandoc(struct mparse *, int, const char *, int); static void pmdoc(const struct roff_node *, int *, int *, int); static void pstring(const char *, int, int *, int); static void usage(void); static const char *progname; int main(int argc, char *argv[]) { struct mparse *mp; int ch, fd, i, list; extern int optind; if (argc < 1) progname = "demandoc"; else if ((progname = strrchr(argv[0], '/')) == NULL) progname = argv[0]; else ++progname; mp = NULL; list = 0; while (-1 != (ch = getopt(argc, argv, "ikm:pw"))) switch (ch) { case ('i'): /* FALLTHROUGH */ case ('k'): /* FALLTHROUGH */ case ('m'): /* FALLTHROUGH */ case ('p'): break; case ('w'): list = 1; break; default: usage(); return (int)MANDOCLEVEL_BADARG; } argc -= optind; argv += optind; mchars_alloc(); mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1 | MPARSE_VALIDATE, MANDOC_OS_OTHER, NULL); assert(mp); if (argc < 1) pmandoc(mp, STDIN_FILENO, "", list); for (i = 0; i < argc; i++) { mparse_reset(mp); if ((fd = mparse_open(mp, argv[i])) == -1) { perror(argv[i]); continue; } pmandoc(mp, fd, argv[i], list); } mparse_free(mp); mchars_free(); return (int)MANDOCLEVEL_OK; } static void usage(void) { fprintf(stderr, "usage: %s [-w] [files...]\n", progname); } static void pmandoc(struct mparse *mp, int fd, const char *fn, int list) { struct roff_meta *meta; int line, col; mparse_readfd(mp, fd, fn); close(fd); meta = mparse_result(mp); line = 1; col = 0; if (meta->macroset == MACROSET_MDOC) pmdoc(meta->first->child, &line, &col, list); else pman(meta->first->child, &line, &col, list); if ( ! list) putchar('\n'); } /* * Strip the escapes out of a string, emitting the results. */ static void pstring(const char *p, int col, int *colp, int list) { enum mandoc_esc esc; const char *start, *end; int emit; /* * Print as many column spaces til we achieve parity with the * input document. */ again: if (list && '\0' != *p) { while (isspace((unsigned char)*p)) p++; while ('\'' == *p || '(' == *p || '"' == *p) p++; emit = isalpha((unsigned char)p[0]) && isalpha((unsigned char)p[1]); for (start = p; '\0' != *p; p++) if ('\\' == *p) { p++; esc = mandoc_escape(&p, NULL, NULL); if (ESCAPE_ERROR == esc) return; emit = 0; } else if (isspace((unsigned char)*p)) break; end = p - 1; while (end > start) if ('.' == *end || ',' == *end || '\'' == *end || '"' == *end || ')' == *end || '!' == *end || '?' == *end || ':' == *end || ';' == *end) end--; else break; if (emit && end - start >= 1) { for ( ; start <= end; start++) if (ASCII_HYPH == *start) putchar('-'); else putchar((unsigned char)*start); putchar('\n'); } if (isspace((unsigned char)*p)) goto again; return; } while (*colp < col) { putchar(' '); (*colp)++; } /* * Print the input word, skipping any special characters. */ while ('\0' != *p) if ('\\' == *p) { p++; esc = mandoc_escape(&p, NULL, NULL); if (ESCAPE_ERROR == esc) break; } else { putchar((unsigned char )*p++); (*colp)++; } } static void pline(int line, int *linep, int *col, int list) { if (list) return; /* * Print out as many lines as needed to reach parity with the * original input. */ while (*linep < line) { putchar('\n'); (*linep)++; } *col = 0; } static void pmdoc(const struct roff_node *p, int *line, int *col, int list) { for ( ; p; p = p->next) { if (NODE_LINE & p->flags) pline(p->line, line, col, list); if (ROFFT_TEXT == p->type) pstring(p->string, p->pos, col, list); if (p->child) pmdoc(p->child, line, col, list); } } static void pman(const struct roff_node *p, int *line, int *col, int list) { for ( ; p; p = p->next) { if (NODE_LINE & p->flags) pline(p->line, line, col, list); if (ROFFT_TEXT == p->type) pstring(p->string, p->pos, col, list); if (p->child) pman(p->child, line, col, list); } } mandoc-1.14.6/eqn.c010064400017530001753000000664541412314055300143150ustar00schwarzeschwarze/* $Id: eqn.c,v 1.84 2020/01/08 12:16:24 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons * Copyright (c) 2014,2015,2017,2018,2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "eqn.h" #include "libmandoc.h" #include "eqn_parse.h" #define EQN_NEST_MAX 128 /* maximum nesting of defines */ #define STRNEQ(p1, sz1, p2, sz2) \ ((sz1) == (sz2) && 0 == strncmp((p1), (p2), (sz1))) enum eqn_tok { EQN_TOK_DYAD = 0, EQN_TOK_VEC, EQN_TOK_UNDER, EQN_TOK_BAR, EQN_TOK_TILDE, EQN_TOK_HAT, EQN_TOK_DOT, EQN_TOK_DOTDOT, EQN_TOK_FWD, EQN_TOK_BACK, EQN_TOK_DOWN, EQN_TOK_UP, EQN_TOK_FAT, EQN_TOK_ROMAN, EQN_TOK_ITALIC, EQN_TOK_BOLD, EQN_TOK_SIZE, EQN_TOK_SUB, EQN_TOK_SUP, EQN_TOK_SQRT, EQN_TOK_OVER, EQN_TOK_FROM, EQN_TOK_TO, EQN_TOK_BRACE_OPEN, EQN_TOK_BRACE_CLOSE, EQN_TOK_GSIZE, EQN_TOK_GFONT, EQN_TOK_MARK, EQN_TOK_LINEUP, EQN_TOK_LEFT, EQN_TOK_RIGHT, EQN_TOK_PILE, EQN_TOK_LPILE, EQN_TOK_RPILE, EQN_TOK_CPILE, EQN_TOK_MATRIX, EQN_TOK_CCOL, EQN_TOK_LCOL, EQN_TOK_RCOL, EQN_TOK_DELIM, EQN_TOK_DEFINE, EQN_TOK_TDEFINE, EQN_TOK_NDEFINE, EQN_TOK_UNDEF, EQN_TOK_ABOVE, EQN_TOK__MAX, EQN_TOK_FUNC, EQN_TOK_QUOTED, EQN_TOK_SYM, EQN_TOK_EOF }; static const char *eqn_toks[EQN_TOK__MAX] = { "dyad", /* EQN_TOK_DYAD */ "vec", /* EQN_TOK_VEC */ "under", /* EQN_TOK_UNDER */ "bar", /* EQN_TOK_BAR */ "tilde", /* EQN_TOK_TILDE */ "hat", /* EQN_TOK_HAT */ "dot", /* EQN_TOK_DOT */ "dotdot", /* EQN_TOK_DOTDOT */ "fwd", /* EQN_TOK_FWD * */ "back", /* EQN_TOK_BACK */ "down", /* EQN_TOK_DOWN */ "up", /* EQN_TOK_UP */ "fat", /* EQN_TOK_FAT */ "roman", /* EQN_TOK_ROMAN */ "italic", /* EQN_TOK_ITALIC */ "bold", /* EQN_TOK_BOLD */ "size", /* EQN_TOK_SIZE */ "sub", /* EQN_TOK_SUB */ "sup", /* EQN_TOK_SUP */ "sqrt", /* EQN_TOK_SQRT */ "over", /* EQN_TOK_OVER */ "from", /* EQN_TOK_FROM */ "to", /* EQN_TOK_TO */ "{", /* EQN_TOK_BRACE_OPEN */ "}", /* EQN_TOK_BRACE_CLOSE */ "gsize", /* EQN_TOK_GSIZE */ "gfont", /* EQN_TOK_GFONT */ "mark", /* EQN_TOK_MARK */ "lineup", /* EQN_TOK_LINEUP */ "left", /* EQN_TOK_LEFT */ "right", /* EQN_TOK_RIGHT */ "pile", /* EQN_TOK_PILE */ "lpile", /* EQN_TOK_LPILE */ "rpile", /* EQN_TOK_RPILE */ "cpile", /* EQN_TOK_CPILE */ "matrix", /* EQN_TOK_MATRIX */ "ccol", /* EQN_TOK_CCOL */ "lcol", /* EQN_TOK_LCOL */ "rcol", /* EQN_TOK_RCOL */ "delim", /* EQN_TOK_DELIM */ "define", /* EQN_TOK_DEFINE */ "tdefine", /* EQN_TOK_TDEFINE */ "ndefine", /* EQN_TOK_NDEFINE */ "undef", /* EQN_TOK_UNDEF */ "above", /* EQN_TOK_ABOVE */ }; static const char *const eqn_func[] = { "acos", "acsc", "and", "arc", "asec", "asin", "atan", "cos", "cosh", "coth", "csc", "det", "exp", "for", "if", "lim", "ln", "log", "max", "min", "sec", "sin", "sinh", "tan", "tanh", "Im", "Re", }; enum eqn_symt { EQNSYM_alpha = 0, EQNSYM_beta, EQNSYM_chi, EQNSYM_delta, EQNSYM_epsilon, EQNSYM_eta, EQNSYM_gamma, EQNSYM_iota, EQNSYM_kappa, EQNSYM_lambda, EQNSYM_mu, EQNSYM_nu, EQNSYM_omega, EQNSYM_omicron, EQNSYM_phi, EQNSYM_pi, EQNSYM_ps, EQNSYM_rho, EQNSYM_sigma, EQNSYM_tau, EQNSYM_theta, EQNSYM_upsilon, EQNSYM_xi, EQNSYM_zeta, EQNSYM_DELTA, EQNSYM_GAMMA, EQNSYM_LAMBDA, EQNSYM_OMEGA, EQNSYM_PHI, EQNSYM_PI, EQNSYM_PSI, EQNSYM_SIGMA, EQNSYM_THETA, EQNSYM_UPSILON, EQNSYM_XI, EQNSYM_inter, EQNSYM_union, EQNSYM_prod, EQNSYM_int, EQNSYM_sum, EQNSYM_grad, EQNSYM_del, EQNSYM_times, EQNSYM_cdot, EQNSYM_nothing, EQNSYM_approx, EQNSYM_prime, EQNSYM_half, EQNSYM_partial, EQNSYM_inf, EQNSYM_muchgreat, EQNSYM_muchless, EQNSYM_larrow, EQNSYM_rarrow, EQNSYM_pm, EQNSYM_nequal, EQNSYM_equiv, EQNSYM_lessequal, EQNSYM_moreequal, EQNSYM_minus, EQNSYM__MAX }; struct eqnsym { const char *str; const char *sym; }; static const struct eqnsym eqnsyms[EQNSYM__MAX] = { { "alpha", "*a" }, /* EQNSYM_alpha */ { "beta", "*b" }, /* EQNSYM_beta */ { "chi", "*x" }, /* EQNSYM_chi */ { "delta", "*d" }, /* EQNSYM_delta */ { "epsilon", "*e" }, /* EQNSYM_epsilon */ { "eta", "*y" }, /* EQNSYM_eta */ { "gamma", "*g" }, /* EQNSYM_gamma */ { "iota", "*i" }, /* EQNSYM_iota */ { "kappa", "*k" }, /* EQNSYM_kappa */ { "lambda", "*l" }, /* EQNSYM_lambda */ { "mu", "*m" }, /* EQNSYM_mu */ { "nu", "*n" }, /* EQNSYM_nu */ { "omega", "*w" }, /* EQNSYM_omega */ { "omicron", "*o" }, /* EQNSYM_omicron */ { "phi", "*f" }, /* EQNSYM_phi */ { "pi", "*p" }, /* EQNSYM_pi */ { "psi", "*q" }, /* EQNSYM_psi */ { "rho", "*r" }, /* EQNSYM_rho */ { "sigma", "*s" }, /* EQNSYM_sigma */ { "tau", "*t" }, /* EQNSYM_tau */ { "theta", "*h" }, /* EQNSYM_theta */ { "upsilon", "*u" }, /* EQNSYM_upsilon */ { "xi", "*c" }, /* EQNSYM_xi */ { "zeta", "*z" }, /* EQNSYM_zeta */ { "DELTA", "*D" }, /* EQNSYM_DELTA */ { "GAMMA", "*G" }, /* EQNSYM_GAMMA */ { "LAMBDA", "*L" }, /* EQNSYM_LAMBDA */ { "OMEGA", "*W" }, /* EQNSYM_OMEGA */ { "PHI", "*F" }, /* EQNSYM_PHI */ { "PI", "*P" }, /* EQNSYM_PI */ { "PSI", "*Q" }, /* EQNSYM_PSI */ { "SIGMA", "*S" }, /* EQNSYM_SIGMA */ { "THETA", "*H" }, /* EQNSYM_THETA */ { "UPSILON", "*U" }, /* EQNSYM_UPSILON */ { "XI", "*C" }, /* EQNSYM_XI */ { "inter", "ca" }, /* EQNSYM_inter */ { "union", "cu" }, /* EQNSYM_union */ { "prod", "product" }, /* EQNSYM_prod */ { "int", "integral" }, /* EQNSYM_int */ { "sum", "sum" }, /* EQNSYM_sum */ { "grad", "gr" }, /* EQNSYM_grad */ { "del", "gr" }, /* EQNSYM_del */ { "times", "mu" }, /* EQNSYM_times */ { "cdot", "pc" }, /* EQNSYM_cdot */ { "nothing", "&" }, /* EQNSYM_nothing */ { "approx", "~~" }, /* EQNSYM_approx */ { "prime", "fm" }, /* EQNSYM_prime */ { "half", "12" }, /* EQNSYM_half */ { "partial", "pd" }, /* EQNSYM_partial */ { "inf", "if" }, /* EQNSYM_inf */ { ">>", ">>" }, /* EQNSYM_muchgreat */ { "<<", "<<" }, /* EQNSYM_muchless */ { "<-", "<-" }, /* EQNSYM_larrow */ { "->", "->" }, /* EQNSYM_rarrow */ { "+-", "+-" }, /* EQNSYM_pm */ { "!=", "!=" }, /* EQNSYM_nequal */ { "==", "==" }, /* EQNSYM_equiv */ { "<=", "<=" }, /* EQNSYM_lessequal */ { ">=", ">=" }, /* EQNSYM_moreequal */ { "-", "mi" }, /* EQNSYM_minus */ }; enum parse_mode { MODE_QUOTED, MODE_NOSUB, MODE_SUB, MODE_TOK }; struct eqn_def { char *key; size_t keysz; char *val; size_t valsz; }; static struct eqn_box *eqn_box_alloc(struct eqn_node *, struct eqn_box *); static struct eqn_box *eqn_box_makebinary(struct eqn_node *, struct eqn_box *); static void eqn_def(struct eqn_node *); static struct eqn_def *eqn_def_find(struct eqn_node *); static void eqn_delim(struct eqn_node *); static enum eqn_tok eqn_next(struct eqn_node *, enum parse_mode); static void eqn_undef(struct eqn_node *); struct eqn_node * eqn_alloc(void) { struct eqn_node *ep; ep = mandoc_calloc(1, sizeof(*ep)); ep->gsize = EQN_DEFSIZE; return ep; } void eqn_reset(struct eqn_node *ep) { free(ep->data); ep->data = ep->start = ep->end = NULL; ep->sz = ep->toksz = 0; } void eqn_read(struct eqn_node *ep, const char *p) { char *cp; if (ep->data == NULL) { ep->sz = strlen(p); ep->data = mandoc_strdup(p); } else { ep->sz = mandoc_asprintf(&cp, "%s %s", ep->data, p); free(ep->data); ep->data = cp; } ep->sz += 1; } /* * Find the key "key" of the give size within our eqn-defined values. */ static struct eqn_def * eqn_def_find(struct eqn_node *ep) { int i; for (i = 0; i < (int)ep->defsz; i++) if (ep->defs[i].keysz && STRNEQ(ep->defs[i].key, ep->defs[i].keysz, ep->start, ep->toksz)) return &ep->defs[i]; return NULL; } /* * Parse a token from the input text. The modes are: * MODE_QUOTED: Use *ep->start as the delimiter; the token ends * before its next occurence. Do not interpret the token in any * way and return EQN_TOK_QUOTED. All other modes behave like * MODE_QUOTED when *ep->start is '"'. * MODE_NOSUB: If *ep->start is a curly brace, the token ends after it; * otherwise, it ends before the next whitespace or brace. * Do not interpret the token and return EQN_TOK__MAX. * MODE_SUB: Like MODE_NOSUB, but try to interpret the token as an * alias created with define. If it is an alias, replace it with * its string value and reparse. * MODE_TOK: Like MODE_SUB, but also check the token against the list * of tokens, and if there is a match, return that token. Otherwise, * if the token matches a symbol, return EQN_TOK_SYM; if it matches * a function name, EQN_TOK_FUNC, or else EQN_TOK__MAX. Except for * a token match, *ep->start is set to an allocated string that the * caller is expected to free. * All modes skip whitespace following the end of the token. */ static enum eqn_tok eqn_next(struct eqn_node *ep, enum parse_mode mode) { static int last_len, lim; struct eqn_def *def; size_t start; int diff, i, quoted; enum eqn_tok tok; /* * Reset the recursion counter after advancing * beyond the end of the previous substitution. */ if (ep->end - ep->data >= last_len) lim = 0; ep->start = ep->end; quoted = mode == MODE_QUOTED; for (;;) { switch (*ep->start) { case '\0': ep->toksz = 0; return EQN_TOK_EOF; case '"': quoted = 1; break; case ' ': case '\t': case '~': case '^': if (quoted) break; ep->start++; continue; default: break; } if (quoted) { ep->end = strchr(ep->start + 1, *ep->start); ep->start++; /* Skip opening quote. */ if (ep->end == NULL) { mandoc_msg(MANDOCERR_ARG_QUOTE, ep->node->line, ep->node->pos, NULL); ep->end = strchr(ep->start, '\0'); } } else { ep->end = ep->start + 1; if (*ep->start != '{' && *ep->start != '}') ep->end += strcspn(ep->end, " ^~\"{}\t"); } ep->toksz = ep->end - ep->start; if (quoted && *ep->end != '\0') ep->end++; /* Skip closing quote. */ while (*ep->end != '\0' && strchr(" \t^~", *ep->end) != NULL) ep->end++; if (quoted) /* Cannot return, may have to strndup. */ break; if (mode == MODE_NOSUB) return EQN_TOK__MAX; if ((def = eqn_def_find(ep)) == NULL) break; if (++lim > EQN_NEST_MAX) { mandoc_msg(MANDOCERR_ROFFLOOP, ep->node->line, ep->node->pos, NULL); return EQN_TOK_EOF; } /* Replace a defined name with its string value. */ if ((diff = def->valsz - ep->toksz) > 0) { start = ep->start - ep->data; ep->sz += diff; ep->data = mandoc_realloc(ep->data, ep->sz + 1); ep->start = ep->data + start; } if (diff) memmove(ep->start + def->valsz, ep->start + ep->toksz, strlen(ep->start + ep->toksz) + 1); memcpy(ep->start, def->val, def->valsz); last_len = ep->start - ep->data + def->valsz; } if (mode != MODE_TOK) return quoted ? EQN_TOK_QUOTED : EQN_TOK__MAX; if (quoted) { ep->start = mandoc_strndup(ep->start, ep->toksz); return EQN_TOK_QUOTED; } for (tok = 0; tok < EQN_TOK__MAX; tok++) if (STRNEQ(ep->start, ep->toksz, eqn_toks[tok], strlen(eqn_toks[tok]))) return tok; for (i = 0; i < EQNSYM__MAX; i++) { if (STRNEQ(ep->start, ep->toksz, eqnsyms[i].str, strlen(eqnsyms[i].str))) { mandoc_asprintf(&ep->start, "\\[%s]", eqnsyms[i].sym); return EQN_TOK_SYM; } } ep->start = mandoc_strndup(ep->start, ep->toksz); for (i = 0; i < (int)(sizeof(eqn_func)/sizeof(*eqn_func)); i++) if (STRNEQ(ep->start, ep->toksz, eqn_func[i], strlen(eqn_func[i]))) return EQN_TOK_FUNC; return EQN_TOK__MAX; } void eqn_box_free(struct eqn_box *bp) { if (bp == NULL) return; if (bp->first) eqn_box_free(bp->first); if (bp->next) eqn_box_free(bp->next); free(bp->text); free(bp->left); free(bp->right); free(bp->top); free(bp->bottom); free(bp); } struct eqn_box * eqn_box_new(void) { struct eqn_box *bp; bp = mandoc_calloc(1, sizeof(*bp)); bp->expectargs = UINT_MAX; return bp; } /* * Allocate a box as the last child of the parent node. */ static struct eqn_box * eqn_box_alloc(struct eqn_node *ep, struct eqn_box *parent) { struct eqn_box *bp; bp = eqn_box_new(); bp->parent = parent; bp->parent->args++; bp->font = bp->parent->font; bp->size = ep->gsize; if (NULL != parent->first) { parent->last->next = bp; bp->prev = parent->last; } else parent->first = bp; parent->last = bp; return bp; } /* * Reparent the current last node (of the current parent) under a new * EQN_SUBEXPR as the first element. * Then return the new parent. * The new EQN_SUBEXPR will have a two-child limit. */ static struct eqn_box * eqn_box_makebinary(struct eqn_node *ep, struct eqn_box *parent) { struct eqn_box *b, *newb; assert(NULL != parent->last); b = parent->last; if (parent->last == parent->first) parent->first = NULL; parent->args--; parent->last = b->prev; b->prev = NULL; newb = eqn_box_alloc(ep, parent); newb->type = EQN_SUBEXPR; newb->expectargs = 2; newb->args = 1; newb->first = newb->last = b; newb->first->next = NULL; b->parent = newb; return newb; } /* * Parse the "delim" control statement. */ static void eqn_delim(struct eqn_node *ep) { if (ep->end[0] == '\0' || ep->end[1] == '\0') { mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "delim"); if (ep->end[0] != '\0') ep->end++; } else if (strncmp(ep->end, "off", 3) == 0) { ep->delim = 0; ep->end += 3; } else if (strncmp(ep->end, "on", 2) == 0) { if (ep->odelim && ep->cdelim) ep->delim = 1; ep->end += 2; } else { ep->odelim = *ep->end++; ep->cdelim = *ep->end++; ep->delim = 1; } } /* * Undefine a previously-defined string. */ static void eqn_undef(struct eqn_node *ep) { struct eqn_def *def; if (eqn_next(ep, MODE_NOSUB) == EQN_TOK_EOF) { mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "undef"); return; } if ((def = eqn_def_find(ep)) == NULL) return; free(def->key); free(def->val); def->key = def->val = NULL; def->keysz = def->valsz = 0; } static void eqn_def(struct eqn_node *ep) { struct eqn_def *def; int i; if (eqn_next(ep, MODE_NOSUB) == EQN_TOK_EOF) { mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "define"); return; } /* * Search for a key that already exists. * Create a new key if none is found. */ if ((def = eqn_def_find(ep)) == NULL) { /* Find holes in string array. */ for (i = 0; i < (int)ep->defsz; i++) if (0 == ep->defs[i].keysz) break; if (i == (int)ep->defsz) { ep->defsz++; ep->defs = mandoc_reallocarray(ep->defs, ep->defsz, sizeof(struct eqn_def)); ep->defs[i].key = ep->defs[i].val = NULL; } def = ep->defs + i; free(def->key); def->key = mandoc_strndup(ep->start, ep->toksz); def->keysz = ep->toksz; } if (eqn_next(ep, MODE_QUOTED) == EQN_TOK_EOF) { mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "define %s", def->key); free(def->key); free(def->val); def->key = def->val = NULL; def->keysz = def->valsz = 0; return; } free(def->val); def->val = mandoc_strndup(ep->start, ep->toksz); def->valsz = ep->toksz; } void eqn_parse(struct eqn_node *ep) { struct eqn_box *cur, *nbox, *parent, *split; const char *cp, *cpn; char *p; enum eqn_tok tok; enum { CCL_LET, CCL_DIG, CCL_PUN } ccl, ccln; int size; parent = ep->node->eqn; assert(parent != NULL); /* * Empty equation. * Do not add it to the high-level syntax tree. */ if (ep->data == NULL) return; ep->start = ep->end = ep->data; next_tok: tok = eqn_next(ep, MODE_TOK); switch (tok) { case EQN_TOK_UNDEF: eqn_undef(ep); break; case EQN_TOK_NDEFINE: case EQN_TOK_DEFINE: eqn_def(ep); break; case EQN_TOK_TDEFINE: if (eqn_next(ep, MODE_NOSUB) == EQN_TOK_EOF || eqn_next(ep, MODE_QUOTED) == EQN_TOK_EOF) mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "tdefine"); break; case EQN_TOK_DELIM: eqn_delim(ep); break; case EQN_TOK_GFONT: if (eqn_next(ep, MODE_SUB) == EQN_TOK_EOF) mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); break; case EQN_TOK_MARK: case EQN_TOK_LINEUP: /* Ignore these. */ break; case EQN_TOK_DYAD: case EQN_TOK_VEC: case EQN_TOK_UNDER: case EQN_TOK_BAR: case EQN_TOK_TILDE: case EQN_TOK_HAT: case EQN_TOK_DOT: case EQN_TOK_DOTDOT: if (parent->last == NULL) { mandoc_msg(MANDOCERR_EQN_NOBOX, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); cur = eqn_box_alloc(ep, parent); cur->type = EQN_TEXT; cur->text = mandoc_strdup(""); } parent = eqn_box_makebinary(ep, parent); parent->type = EQN_LIST; parent->expectargs = 1; parent->font = EQNFONT_ROMAN; switch (tok) { case EQN_TOK_DOTDOT: parent->top = mandoc_strdup("\\[ad]"); break; case EQN_TOK_VEC: parent->top = mandoc_strdup("\\[->]"); break; case EQN_TOK_DYAD: parent->top = mandoc_strdup("\\[<>]"); break; case EQN_TOK_TILDE: parent->top = mandoc_strdup("\\[a~]"); break; case EQN_TOK_UNDER: parent->bottom = mandoc_strdup("\\[ul]"); break; case EQN_TOK_BAR: parent->top = mandoc_strdup("\\[rn]"); break; case EQN_TOK_DOT: parent->top = mandoc_strdup("\\[a.]"); break; case EQN_TOK_HAT: parent->top = mandoc_strdup("\\[ha]"); break; default: abort(); } parent = parent->parent; break; case EQN_TOK_FWD: case EQN_TOK_BACK: case EQN_TOK_DOWN: case EQN_TOK_UP: if (eqn_next(ep, MODE_SUB) == EQN_TOK_EOF) mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); break; case EQN_TOK_FAT: case EQN_TOK_ROMAN: case EQN_TOK_ITALIC: case EQN_TOK_BOLD: while (parent->args == parent->expectargs) parent = parent->parent; /* * These values apply to the next word or sequence of * words; thus, we mark that we'll have a child with * exactly one of those. */ parent = eqn_box_alloc(ep, parent); parent->type = EQN_LIST; parent->expectargs = 1; switch (tok) { case EQN_TOK_FAT: parent->font = EQNFONT_FAT; break; case EQN_TOK_ROMAN: parent->font = EQNFONT_ROMAN; break; case EQN_TOK_ITALIC: parent->font = EQNFONT_ITALIC; break; case EQN_TOK_BOLD: parent->font = EQNFONT_BOLD; break; default: abort(); } break; case EQN_TOK_SIZE: case EQN_TOK_GSIZE: /* Accept two values: integral size and a single. */ if (eqn_next(ep, MODE_SUB) == EQN_TOK_EOF) { mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); break; } size = mandoc_strntoi(ep->start, ep->toksz, 10); if (-1 == size) { mandoc_msg(MANDOCERR_IT_NONUM, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); break; } if (EQN_TOK_GSIZE == tok) { ep->gsize = size; break; } while (parent->args == parent->expectargs) parent = parent->parent; parent = eqn_box_alloc(ep, parent); parent->type = EQN_LIST; parent->expectargs = 1; parent->size = size; break; case EQN_TOK_FROM: case EQN_TOK_TO: case EQN_TOK_SUB: case EQN_TOK_SUP: /* * We have a left-right-associative expression. * Repivot under a positional node, open a child scope * and keep on reading. */ if (parent->last == NULL) { mandoc_msg(MANDOCERR_EQN_NOBOX, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); cur = eqn_box_alloc(ep, parent); cur->type = EQN_TEXT; cur->text = mandoc_strdup(""); } while (parent->expectargs == 1 && parent->args == 1) parent = parent->parent; if (tok == EQN_TOK_FROM || tok == EQN_TOK_TO) { for (cur = parent; cur != NULL; cur = cur->parent) if (cur->pos == EQNPOS_SUB || cur->pos == EQNPOS_SUP || cur->pos == EQNPOS_SUBSUP || cur->pos == EQNPOS_SQRT || cur->pos == EQNPOS_OVER) break; if (cur != NULL) parent = cur->parent; } if (tok == EQN_TOK_SUP && parent->pos == EQNPOS_SUB) { parent->expectargs = 3; parent->pos = EQNPOS_SUBSUP; break; } if (tok == EQN_TOK_TO && parent->pos == EQNPOS_FROM) { parent->expectargs = 3; parent->pos = EQNPOS_FROMTO; break; } parent = eqn_box_makebinary(ep, parent); switch (tok) { case EQN_TOK_FROM: parent->pos = EQNPOS_FROM; break; case EQN_TOK_TO: parent->pos = EQNPOS_TO; break; case EQN_TOK_SUP: parent->pos = EQNPOS_SUP; break; case EQN_TOK_SUB: parent->pos = EQNPOS_SUB; break; default: abort(); } break; case EQN_TOK_SQRT: while (parent->args == parent->expectargs) parent = parent->parent; /* * Accept a left-right-associative set of arguments just * like sub and sup and friends but without rebalancing * under a pivot. */ parent = eqn_box_alloc(ep, parent); parent->type = EQN_SUBEXPR; parent->pos = EQNPOS_SQRT; parent->expectargs = 1; break; case EQN_TOK_OVER: /* * We have a right-left-associative fraction. * Close out anything that's currently open, then * rebalance and continue reading. */ if (parent->last == NULL) { mandoc_msg(MANDOCERR_EQN_NOBOX, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); cur = eqn_box_alloc(ep, parent); cur->type = EQN_TEXT; cur->text = mandoc_strdup(""); } while (parent->args == parent->expectargs) parent = parent->parent; while (EQN_SUBEXPR == parent->type) parent = parent->parent; parent = eqn_box_makebinary(ep, parent); parent->pos = EQNPOS_OVER; break; case EQN_TOK_RIGHT: case EQN_TOK_BRACE_CLOSE: /* * Close out the existing brace. * FIXME: this is a shitty sentinel: we should really * have a native EQN_BRACE type or whatnot. */ for (cur = parent; cur != NULL; cur = cur->parent) if (cur->type == EQN_LIST && cur->expectargs > 1 && (tok == EQN_TOK_BRACE_CLOSE || cur->left != NULL)) break; if (cur == NULL) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); break; } parent = cur; if (EQN_TOK_RIGHT == tok) { if (eqn_next(ep, MODE_SUB) == EQN_TOK_EOF) { mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); break; } /* Handling depends on right/left. */ if (STRNEQ(ep->start, ep->toksz, "ceiling", 7)) parent->right = mandoc_strdup("\\[rc]"); else if (STRNEQ(ep->start, ep->toksz, "floor", 5)) parent->right = mandoc_strdup("\\[rf]"); else parent->right = mandoc_strndup(ep->start, ep->toksz); } parent = parent->parent; if (tok == EQN_TOK_BRACE_CLOSE && (parent->type == EQN_PILE || parent->type == EQN_MATRIX)) parent = parent->parent; /* Close out any "singleton" lists. */ while (parent->type == EQN_LIST && parent->expectargs == 1 && parent->args == 1) parent = parent->parent; break; case EQN_TOK_BRACE_OPEN: case EQN_TOK_LEFT: /* * If we already have something in the stack and we're * in an expression, then rewind til we're not any more * (just like with the text node). */ while (parent->args == parent->expectargs) parent = parent->parent; if (EQN_TOK_LEFT == tok && eqn_next(ep, MODE_SUB) == EQN_TOK_EOF) { mandoc_msg(MANDOCERR_REQ_EMPTY, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); break; } parent = eqn_box_alloc(ep, parent); parent->type = EQN_LIST; if (EQN_TOK_LEFT == tok) { if (STRNEQ(ep->start, ep->toksz, "ceiling", 7)) parent->left = mandoc_strdup("\\[lc]"); else if (STRNEQ(ep->start, ep->toksz, "floor", 5)) parent->left = mandoc_strdup("\\[lf]"); else parent->left = mandoc_strndup(ep->start, ep->toksz); } break; case EQN_TOK_PILE: case EQN_TOK_LPILE: case EQN_TOK_RPILE: case EQN_TOK_CPILE: case EQN_TOK_CCOL: case EQN_TOK_LCOL: case EQN_TOK_RCOL: while (parent->args == parent->expectargs) parent = parent->parent; parent = eqn_box_alloc(ep, parent); parent->type = EQN_PILE; parent->expectargs = 1; break; case EQN_TOK_ABOVE: for (cur = parent; cur != NULL; cur = cur->parent) if (cur->type == EQN_PILE) break; if (cur == NULL) { mandoc_msg(MANDOCERR_IT_STRAY, ep->node->line, ep->node->pos, "%s", eqn_toks[tok]); break; } parent = eqn_box_alloc(ep, cur); parent->type = EQN_LIST; break; case EQN_TOK_MATRIX: while (parent->args == parent->expectargs) parent = parent->parent; parent = eqn_box_alloc(ep, parent); parent->type = EQN_MATRIX; parent->expectargs = 1; break; case EQN_TOK_EOF: return; case EQN_TOK__MAX: case EQN_TOK_FUNC: case EQN_TOK_QUOTED: case EQN_TOK_SYM: p = ep->start; assert(p != NULL); /* * If we already have something in the stack and we're * in an expression, then rewind til we're not any more. */ while (parent->args == parent->expectargs) parent = parent->parent; cur = eqn_box_alloc(ep, parent); cur->type = EQN_TEXT; cur->text = p; switch (tok) { case EQN_TOK_FUNC: cur->font = EQNFONT_ROMAN; break; case EQN_TOK_QUOTED: if (cur->font == EQNFONT_NONE) cur->font = EQNFONT_ITALIC; break; case EQN_TOK_SYM: break; default: if (cur->font != EQNFONT_NONE || *p == '\0') break; cpn = p - 1; ccln = CCL_LET; split = NULL; for (;;) { /* Advance to next character. */ cp = cpn++; ccl = ccln; ccln = isalpha((unsigned char)*cpn) ? CCL_LET : isdigit((unsigned char)*cpn) || (*cpn == '.' && (ccl == CCL_DIG || isdigit((unsigned char)cpn[1]))) ? CCL_DIG : CCL_PUN; /* No boundary before first character. */ if (cp < p) continue; cur->font = ccl == CCL_LET ? EQNFONT_ITALIC : EQNFONT_ROMAN; if (*cp == '\\') mandoc_escape(&cpn, NULL, NULL); /* No boundary after last character. */ if (*cpn == '\0') break; if (ccln == ccl && *cp != ',' && *cpn != ',') continue; /* Boundary found, split the text. */ if (parent->args == parent->expectargs) { /* Remove the text from the tree. */ if (cur->prev == NULL) parent->first = cur->next; else cur->prev->next = NULL; parent->last = cur->prev; parent->args--; /* Set up a list instead. */ split = eqn_box_alloc(ep, parent); split->type = EQN_LIST; /* Insert the word into the list. */ split->first = split->last = cur; cur->parent = split; cur->prev = NULL; parent = split; } /* Append a new text box. */ nbox = eqn_box_alloc(ep, parent); nbox->type = EQN_TEXT; nbox->text = mandoc_strdup(cpn); /* Truncate the old box. */ p = mandoc_strndup(cur->text, cpn - cur->text); free(cur->text); cur->text = p; /* Setup to process the new box. */ cur = nbox; p = nbox->text; cpn = p - 1; ccln = CCL_LET; } if (split != NULL) parent = split->parent; break; } break; default: abort(); } goto next_tok; } void eqn_free(struct eqn_node *p) { int i; if (p == NULL) return; for (i = 0; i < (int)p->defsz; i++) { free(p->defs[i].key); free(p->defs[i].val); } free(p->data); free(p->defs); free(p); } mandoc-1.14.6/eqn_html.c010064400017530001753000000136401412314055300153260ustar00schwarzeschwarze/* $Id: eqn_html.c,v 1.19 2019/03/17 18:21:45 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons * Copyright (c) 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "eqn.h" #include "out.h" #include "html.h" static void eqn_box(struct html *p, const struct eqn_box *bp) { struct tag *post, *row, *cell, *t; const struct eqn_box *child, *parent; const char *cp; size_t i, j, rows; enum htmltag tag; enum eqn_fontt font; if (NULL == bp) return; post = NULL; /* * Special handling for a matrix, which is presented to us in * column order, but must be printed in row-order. */ if (EQN_MATRIX == bp->type) { if (NULL == bp->first) goto out; if (bp->first->type != EQN_LIST || bp->first->expectargs == 1) { eqn_box(p, bp->first); goto out; } if (NULL == (parent = bp->first->first)) goto out; /* Estimate the number of rows, first. */ if (NULL == (child = parent->first)) goto out; for (rows = 0; NULL != child; rows++) child = child->next; /* Print row-by-row. */ post = print_otag(p, TAG_MTABLE, ""); for (i = 0; i < rows; i++) { parent = bp->first->first; row = print_otag(p, TAG_MTR, ""); while (NULL != parent) { child = parent->first; for (j = 0; j < i; j++) { if (NULL == child) break; child = child->next; } cell = print_otag(p, TAG_MTD, ""); /* * If we have no data for this * particular cell, then print a * placeholder and continue--don't puke. */ if (NULL != child) eqn_box(p, child->first); print_tagq(p, cell); parent = parent->next; } print_tagq(p, row); } goto out; } switch (bp->pos) { case EQNPOS_TO: post = print_otag(p, TAG_MOVER, ""); break; case EQNPOS_SUP: post = print_otag(p, TAG_MSUP, ""); break; case EQNPOS_FROM: post = print_otag(p, TAG_MUNDER, ""); break; case EQNPOS_SUB: post = print_otag(p, TAG_MSUB, ""); break; case EQNPOS_OVER: post = print_otag(p, TAG_MFRAC, ""); break; case EQNPOS_FROMTO: post = print_otag(p, TAG_MUNDEROVER, ""); break; case EQNPOS_SUBSUP: post = print_otag(p, TAG_MSUBSUP, ""); break; case EQNPOS_SQRT: post = print_otag(p, TAG_MSQRT, ""); break; default: break; } if (bp->top || bp->bottom) { assert(NULL == post); if (bp->top && NULL == bp->bottom) post = print_otag(p, TAG_MOVER, ""); else if (bp->top && bp->bottom) post = print_otag(p, TAG_MUNDEROVER, ""); else if (bp->bottom) post = print_otag(p, TAG_MUNDER, ""); } if (EQN_PILE == bp->type) { assert(NULL == post); if (bp->first != NULL && bp->first->type == EQN_LIST && bp->first->expectargs > 1) post = print_otag(p, TAG_MTABLE, ""); } else if (bp->type == EQN_LIST && bp->expectargs > 1 && bp->parent && bp->parent->type == EQN_PILE) { assert(NULL == post); post = print_otag(p, TAG_MTR, ""); print_otag(p, TAG_MTD, ""); } if (bp->text != NULL) { assert(post == NULL); tag = TAG_MI; cp = bp->text; if (isdigit((unsigned char)cp[0]) || (cp[0] == '.' && isdigit((unsigned char)cp[1]))) { tag = TAG_MN; while (*++cp != '\0') { if (*cp != '.' && isdigit((unsigned char)*cp) == 0) { tag = TAG_MI; break; } } } else if (*cp != '\0' && isalpha((unsigned char)*cp) == 0) { tag = TAG_MO; while (*cp != '\0') { if (cp[0] == '\\' && cp[1] != '\0') { cp++; mandoc_escape(&cp, NULL, NULL); } else if (isalnum((unsigned char)*cp)) { tag = TAG_MI; break; } else cp++; } } font = bp->font; if (bp->text[0] != '\0' && (((tag == TAG_MN || tag == TAG_MO) && font == EQNFONT_ROMAN) || (tag == TAG_MI && font == (bp->text[1] == '\0' ? EQNFONT_ITALIC : EQNFONT_ROMAN)))) font = EQNFONT_NONE; switch (font) { case EQNFONT_NONE: post = print_otag(p, tag, ""); break; case EQNFONT_ROMAN: post = print_otag(p, tag, "?", "fontstyle", "normal"); break; case EQNFONT_BOLD: case EQNFONT_FAT: post = print_otag(p, tag, "?", "fontweight", "bold"); break; case EQNFONT_ITALIC: post = print_otag(p, tag, "?", "fontstyle", "italic"); break; default: abort(); } print_text(p, bp->text); } else if (NULL == post) { if (NULL != bp->left || NULL != bp->right) post = print_otag(p, TAG_MFENCED, "??", "open", bp->left == NULL ? "" : bp->left, "close", bp->right == NULL ? "" : bp->right); if (NULL == post) post = print_otag(p, TAG_MROW, ""); else print_otag(p, TAG_MROW, ""); } eqn_box(p, bp->first); out: if (NULL != bp->bottom) { t = print_otag(p, TAG_MO, ""); print_text(p, bp->bottom); print_tagq(p, t); } if (NULL != bp->top) { t = print_otag(p, TAG_MO, ""); print_text(p, bp->top); print_tagq(p, t); } if (NULL != post) print_tagq(p, post); eqn_box(p, bp->next); } void print_eqn(struct html *p, const struct eqn_box *bp) { struct tag *t; if (bp->first == NULL) return; t = print_otag(p, TAG_MATH, "c", "eqn"); p->flags |= HTML_NONOSPACE; eqn_box(p, bp); p->flags &= ~HTML_NONOSPACE; print_tagq(p, t); } mandoc-1.14.6/eqn_term.c010064400017530001753000000115211412314055300153250ustar00schwarzeschwarze/* $Id: eqn_term.c,v 1.19 2018/12/13 05:23:38 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "eqn.h" #include "out.h" #include "term.h" static const enum termfont fontmap[EQNFONT__MAX] = { TERMFONT_NONE, /* EQNFONT_NONE */ TERMFONT_NONE, /* EQNFONT_ROMAN */ TERMFONT_BOLD, /* EQNFONT_BOLD */ TERMFONT_BOLD, /* EQNFONT_FAT */ TERMFONT_UNDER /* EQNFONT_ITALIC */ }; static void eqn_box(struct termp *, const struct eqn_box *); void term_eqn(struct termp *p, const struct eqn_box *bp) { eqn_box(p, bp); p->flags &= ~TERMP_NOSPACE; } static void eqn_box(struct termp *p, const struct eqn_box *bp) { const struct eqn_box *child; const char *cp; int delim; /* Delimiters around this box? */ if ((bp->type == EQN_LIST && bp->expectargs > 1) || (bp->type == EQN_PILE && (bp->prev || bp->next)) || (bp->parent != NULL && (bp->parent->pos == EQNPOS_SQRT || /* Diacritic followed by ^ or _. */ ((bp->top != NULL || bp->bottom != NULL) && bp->parent->type == EQN_SUBEXPR && bp->parent->pos != EQNPOS_OVER && bp->next != NULL) || /* Nested over, sub, sup, from, to. */ (bp->type == EQN_SUBEXPR && bp->pos != EQNPOS_SQRT && ((bp->parent->type == EQN_LIST && bp->expectargs == 1) || (bp->parent->type == EQN_SUBEXPR && bp->pos != EQNPOS_SQRT)))))) { if ((bp->parent->type == EQN_SUBEXPR && bp->prev != NULL) || (bp->type == EQN_LIST && bp->first != NULL && bp->first->type != EQN_PILE && bp->first->type != EQN_MATRIX && bp->prev != NULL && (bp->prev->type == EQN_LIST || (bp->prev->type == EQN_TEXT && (*bp->prev->text == '\\' || isalpha((unsigned char)*bp->prev->text)))))) p->flags |= TERMP_NOSPACE; term_word(p, bp->left != NULL ? bp->left : "("); p->flags |= TERMP_NOSPACE; delim = 1; } else delim = 0; /* Handle Fonts and text. */ if (bp->font != EQNFONT_NONE) term_fontpush(p, fontmap[(int)bp->font]); if (bp->text != NULL) { if (strchr("!\"'),.:;?]}", *bp->text) != NULL) p->flags |= TERMP_NOSPACE; term_word(p, bp->text); if ((cp = strchr(bp->text, '\0')) > bp->text && (strchr("\"'([{", cp[-1]) != NULL || (bp->prev == NULL && (cp[-1] == '-' || (cp >= bp->text + 5 && strcmp(cp - 5, "\\[mi]") == 0))))) p->flags |= TERMP_NOSPACE; } /* Special box types. */ if (bp->pos == EQNPOS_SQRT) { term_word(p, "\\(sr"); if (bp->first != NULL) { p->flags |= TERMP_NOSPACE; eqn_box(p, bp->first); } } else if (bp->type == EQN_SUBEXPR) { child = bp->first; eqn_box(p, child); p->flags |= TERMP_NOSPACE; term_word(p, bp->pos == EQNPOS_OVER ? "/" : (bp->pos == EQNPOS_SUP || bp->pos == EQNPOS_TO) ? "^" : "_"); child = child->next; if (child != NULL) { p->flags |= TERMP_NOSPACE; eqn_box(p, child); if (bp->pos == EQNPOS_FROMTO || bp->pos == EQNPOS_SUBSUP) { p->flags |= TERMP_NOSPACE; term_word(p, "^"); p->flags |= TERMP_NOSPACE; child = child->next; if (child != NULL) eqn_box(p, child); } } } else { child = bp->first; if (bp->type == EQN_MATRIX && child != NULL && child->type == EQN_LIST && child->expectargs > 1) child = child->first; while (child != NULL) { eqn_box(p, bp->type == EQN_PILE && child->type == EQN_LIST && child->expectargs > 1 && child->args == 1 ? child->first : child); child = child->next; } } /* Handle Fonts and diacritics. */ if (bp->font != EQNFONT_NONE) term_fontpop(p); if (bp->top != NULL) { p->flags |= TERMP_NOSPACE; term_word(p, bp->top); } if (bp->bottom != NULL) { p->flags |= TERMP_NOSPACE; term_word(p, "_"); } /* Right delimiter after this box? */ if (delim) { p->flags |= TERMP_NOSPACE; term_word(p, bp->right != NULL ? bp->right : ")"); if (bp->parent->type == EQN_SUBEXPR && bp->next != NULL) p->flags |= TERMP_NOSPACE; } } mandoc-1.14.6/html.c010064400017530001753000000601031412314055300144570ustar00schwarzeschwarze/* $Id: html.c,v 1.275 2021/09/09 14:47:24 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Common functions for mandoc(1) HTML formatters. * For use by individual formatters and by the main program. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc_ohash.h" #include "mandoc.h" #include "roff.h" #include "out.h" #include "html.h" #include "manconf.h" #include "main.h" struct htmldata { const char *name; int flags; #define HTML_INPHRASE (1 << 0) /* Can appear in phrasing context. */ #define HTML_TOPHRASE (1 << 1) /* Establishes phrasing context. */ #define HTML_NOSTACK (1 << 2) /* Does not have an end tag. */ #define HTML_NLBEFORE (1 << 3) /* Output line break before opening. */ #define HTML_NLBEGIN (1 << 4) /* Output line break after opening. */ #define HTML_NLEND (1 << 5) /* Output line break before closing. */ #define HTML_NLAFTER (1 << 6) /* Output line break after closing. */ #define HTML_NLAROUND (HTML_NLBEFORE | HTML_NLAFTER) #define HTML_NLINSIDE (HTML_NLBEGIN | HTML_NLEND) #define HTML_NLALL (HTML_NLAROUND | HTML_NLINSIDE) #define HTML_INDENT (1 << 7) /* Indent content by two spaces. */ #define HTML_NOINDENT (1 << 8) /* Exception: never indent content. */ }; static const struct htmldata htmltags[TAG_MAX] = { {"html", HTML_NLALL}, {"head", HTML_NLALL | HTML_INDENT}, {"meta", HTML_NOSTACK | HTML_NLALL}, {"link", HTML_NOSTACK | HTML_NLALL}, {"style", HTML_NLALL | HTML_INDENT}, {"title", HTML_NLAROUND}, {"body", HTML_NLALL}, {"div", HTML_NLAROUND}, {"section", HTML_NLALL}, {"table", HTML_NLALL | HTML_INDENT}, {"tr", HTML_NLALL | HTML_INDENT}, {"td", HTML_NLAROUND}, {"li", HTML_NLAROUND | HTML_INDENT}, {"ul", HTML_NLALL | HTML_INDENT}, {"ol", HTML_NLALL | HTML_INDENT}, {"dl", HTML_NLALL | HTML_INDENT}, {"dt", HTML_NLAROUND}, {"dd", HTML_NLAROUND | HTML_INDENT}, {"h1", HTML_TOPHRASE | HTML_NLAROUND}, {"h2", HTML_TOPHRASE | HTML_NLAROUND}, {"p", HTML_TOPHRASE | HTML_NLAROUND | HTML_INDENT}, {"pre", HTML_TOPHRASE | HTML_NLAROUND | HTML_NOINDENT}, {"a", HTML_INPHRASE | HTML_TOPHRASE}, {"b", HTML_INPHRASE | HTML_TOPHRASE}, {"cite", HTML_INPHRASE | HTML_TOPHRASE}, {"code", HTML_INPHRASE | HTML_TOPHRASE}, {"i", HTML_INPHRASE | HTML_TOPHRASE}, {"small", HTML_INPHRASE | HTML_TOPHRASE}, {"span", HTML_INPHRASE | HTML_TOPHRASE}, {"var", HTML_INPHRASE | HTML_TOPHRASE}, {"br", HTML_INPHRASE | HTML_NOSTACK | HTML_NLALL}, {"hr", HTML_INPHRASE | HTML_NOSTACK}, {"mark", HTML_INPHRASE }, {"math", HTML_INPHRASE | HTML_NLALL | HTML_INDENT}, {"mrow", 0}, {"mi", 0}, {"mn", 0}, {"mo", 0}, {"msup", 0}, {"msub", 0}, {"msubsup", 0}, {"mfrac", 0}, {"msqrt", 0}, {"mfenced", 0}, {"mtable", 0}, {"mtr", 0}, {"mtd", 0}, {"munderover", 0}, {"munder", 0}, {"mover", 0}, }; /* Avoid duplicate HTML id= attributes. */ struct id_entry { int ord; /* Ordinal number of the latest occurrence. */ char id[]; /* The id= attribute without any ordinal suffix. */ }; static struct ohash id_unique; static void html_reset_internal(struct html *); static void print_byte(struct html *, char); static void print_endword(struct html *); static void print_indent(struct html *); static void print_word(struct html *, const char *); static void print_ctag(struct html *, struct tag *); static int print_escape(struct html *, char); static int print_encode(struct html *, const char *, const char *, int); static void print_href(struct html *, const char *, const char *, int); static void print_metaf(struct html *); void * html_alloc(const struct manoutput *outopts) { struct html *h; h = mandoc_calloc(1, sizeof(struct html)); h->tag = NULL; h->metac = h->metal = ESCAPE_FONTROMAN; h->style = outopts->style; if ((h->base_man1 = outopts->man) == NULL) h->base_man2 = NULL; else if ((h->base_man2 = strchr(h->base_man1, ';')) != NULL) *h->base_man2++ = '\0'; h->base_includes = outopts->includes; if (outopts->fragment) h->oflags |= HTML_FRAGMENT; if (outopts->toc) h->oflags |= HTML_TOC; mandoc_ohash_init(&id_unique, 4, offsetof(struct id_entry, id)); return h; } static void html_reset_internal(struct html *h) { struct tag *tag; struct id_entry *entry; unsigned int slot; while ((tag = h->tag) != NULL) { h->tag = tag->next; free(tag); } entry = ohash_first(&id_unique, &slot); while (entry != NULL) { free(entry); entry = ohash_next(&id_unique, &slot); } ohash_delete(&id_unique); } void html_reset(void *p) { html_reset_internal(p); mandoc_ohash_init(&id_unique, 4, offsetof(struct id_entry, id)); } void html_free(void *p) { html_reset_internal(p); free(p); } void print_gen_head(struct html *h) { struct tag *t; print_otag(h, TAG_META, "?", "charset", "utf-8"); print_otag(h, TAG_META, "??", "name", "viewport", "content", "width=device-width, initial-scale=1.0"); if (h->style != NULL) { print_otag(h, TAG_LINK, "?h??", "rel", "stylesheet", h->style, "type", "text/css", "media", "all"); return; } /* * Print a minimal embedded style sheet. */ t = print_otag(h, TAG_STYLE, ""); print_text(h, "table.head, table.foot { width: 100%; }"); print_endline(h); print_text(h, "td.head-rtitle, td.foot-os { text-align: right; }"); print_endline(h); print_text(h, "td.head-vol { text-align: center; }"); print_endline(h); print_text(h, ".Nd, .Bf, .Op { display: inline; }"); print_endline(h); print_text(h, ".Pa, .Ad { font-style: italic; }"); print_endline(h); print_text(h, ".Ms { font-weight: bold; }"); print_endline(h); print_text(h, ".Bl-diag "); print_byte(h, '>'); print_text(h, " dt { font-weight: bold; }"); print_endline(h); print_text(h, "code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd " "{ font-weight: bold; font-family: inherit; }"); print_tagq(h, t); } int html_setfont(struct html *h, enum mandoc_esc font) { switch (font) { case ESCAPE_FONTPREV: font = h->metal; break; case ESCAPE_FONTITALIC: case ESCAPE_FONTBOLD: case ESCAPE_FONTBI: case ESCAPE_FONTROMAN: case ESCAPE_FONTCR: case ESCAPE_FONTCB: case ESCAPE_FONTCI: break; case ESCAPE_FONT: font = ESCAPE_FONTROMAN; break; default: return 0; } h->metal = h->metac; h->metac = font; return 1; } static void print_metaf(struct html *h) { if (h->metaf) { print_tagq(h, h->metaf); h->metaf = NULL; } switch (h->metac) { case ESCAPE_FONTITALIC: h->metaf = print_otag(h, TAG_I, ""); break; case ESCAPE_FONTBOLD: h->metaf = print_otag(h, TAG_B, ""); break; case ESCAPE_FONTBI: h->metaf = print_otag(h, TAG_B, ""); print_otag(h, TAG_I, ""); break; case ESCAPE_FONTCR: h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); break; case ESCAPE_FONTCB: h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); print_otag(h, TAG_B, ""); break; case ESCAPE_FONTCI: h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); print_otag(h, TAG_I, ""); break; default: break; } } void html_close_paragraph(struct html *h) { struct tag *this, *next; int flags; this = h->tag; for (;;) { next = this->next; flags = htmltags[this->tag].flags; if (flags & (HTML_INPHRASE | HTML_TOPHRASE)) print_ctag(h, this); if ((flags & HTML_INPHRASE) == 0) break; this = next; } } /* * ROFF_nf switches to no-fill mode, ROFF_fi to fill mode. * TOKEN_NONE does not switch. The old mode is returned. */ enum roff_tok html_fillmode(struct html *h, enum roff_tok want) { struct tag *t; enum roff_tok had; for (t = h->tag; t != NULL; t = t->next) if (t->tag == TAG_PRE) break; had = t == NULL ? ROFF_fi : ROFF_nf; if (want != had) { switch (want) { case ROFF_fi: print_tagq(h, t); break; case ROFF_nf: html_close_paragraph(h); print_otag(h, TAG_PRE, ""); break; case TOKEN_NONE: break; default: abort(); } } return had; } /* * Allocate a string to be used for the "id=" attribute of an HTML * element and/or as a segment identifier for a URI in an element. * The function may fail and return NULL if the node lacks text data * to create the attribute from. * The caller is responsible for free(3)ing the returned string. * * If the "unique" argument is non-zero, the "id_unique" ohash table * is used for de-duplication. If the "unique" argument is 1, * it is the first time the function is called for this tag and * location, so if an ordinal suffix is needed, it is incremented. * If the "unique" argument is 2, it is the second time the function * is called for this tag and location, so the ordinal suffix * remains unchanged. */ char * html_make_id(const struct roff_node *n, int unique) { const struct roff_node *nch; struct id_entry *entry; char *buf, *cp; size_t len; unsigned int slot; if (n->tag != NULL) buf = mandoc_strdup(n->tag); else { switch (n->tok) { case MDOC_Sh: case MDOC_Ss: case MDOC_Sx: case MAN_SH: case MAN_SS: for (nch = n->child; nch != NULL; nch = nch->next) if (nch->type != ROFFT_TEXT) return NULL; buf = NULL; deroff(&buf, n); if (buf == NULL) return NULL; break; default: if (n->child == NULL || n->child->type != ROFFT_TEXT) return NULL; buf = mandoc_strdup(n->child->string); break; } } /* * In ID attributes, only use ASCII characters that are * permitted in URL-fragment strings according to the * explicit list at: * https://url.spec.whatwg.org/#url-fragment-string * In addition, reserve '~' for ordinal suffixes. */ for (cp = buf; *cp != '\0'; cp++) if (isalnum((unsigned char)*cp) == 0 && strchr("!$&'()*+,-./:;=?@_", *cp) == NULL) *cp = '_'; if (unique == 0) return buf; /* Avoid duplicate HTML id= attributes. */ slot = ohash_qlookup(&id_unique, buf); if ((entry = ohash_find(&id_unique, slot)) == NULL) { len = strlen(buf) + 1; entry = mandoc_malloc(sizeof(*entry) + len); entry->ord = 1; memcpy(entry->id, buf, len); ohash_insert(&id_unique, slot, entry); } else if (unique == 1) entry->ord++; if (entry->ord > 1) { cp = buf; mandoc_asprintf(&buf, "%s~%d", cp, entry->ord); free(cp); } return buf; } static int print_escape(struct html *h, char c) { switch (c) { case '<': print_word(h, "<"); break; case '>': print_word(h, ">"); break; case '&': print_word(h, "&"); break; case '"': print_word(h, """); break; case ASCII_NBRSP: print_word(h, " "); break; case ASCII_HYPH: print_byte(h, '-'); break; case ASCII_BREAK: break; default: return 0; } return 1; } static int print_encode(struct html *h, const char *p, const char *pend, int norecurse) { char numbuf[16]; const char *seq; size_t sz; int c, len, breakline, nospace; enum mandoc_esc esc; static const char rejs[10] = { ' ', '\\', '<', '>', '&', '"', ASCII_NBRSP, ASCII_HYPH, ASCII_BREAK, '\0' }; if (pend == NULL) pend = strchr(p, '\0'); breakline = 0; nospace = 0; while (p < pend) { if (HTML_SKIPCHAR & h->flags && '\\' != *p) { h->flags &= ~HTML_SKIPCHAR; p++; continue; } for (sz = strcspn(p, rejs); sz-- && p < pend; p++) print_byte(h, *p); if (breakline && (p >= pend || *p == ' ' || *p == ASCII_NBRSP)) { print_otag(h, TAG_BR, ""); breakline = 0; while (p < pend && (*p == ' ' || *p == ASCII_NBRSP)) p++; continue; } if (p >= pend) break; if (*p == ' ') { print_endword(h); p++; continue; } if (print_escape(h, *p++)) continue; esc = mandoc_escape(&p, &seq, &len); switch (esc) { case ESCAPE_FONT: case ESCAPE_FONTPREV: case ESCAPE_FONTBOLD: case ESCAPE_FONTITALIC: case ESCAPE_FONTBI: case ESCAPE_FONTROMAN: case ESCAPE_FONTCR: case ESCAPE_FONTCB: case ESCAPE_FONTCI: if (0 == norecurse) { h->flags |= HTML_NOSPACE; if (html_setfont(h, esc)) print_metaf(h); h->flags &= ~HTML_NOSPACE; } continue; case ESCAPE_SKIPCHAR: h->flags |= HTML_SKIPCHAR; continue; case ESCAPE_ERROR: continue; default: break; } if (h->flags & HTML_SKIPCHAR) { h->flags &= ~HTML_SKIPCHAR; continue; } switch (esc) { case ESCAPE_UNICODE: /* Skip past "u" header. */ c = mchars_num2uc(seq + 1, len - 1); break; case ESCAPE_NUMBERED: c = mchars_num2char(seq, len); if (c < 0) continue; break; case ESCAPE_SPECIAL: c = mchars_spec2cp(seq, len); if (c <= 0) continue; break; case ESCAPE_UNDEF: c = *seq; break; case ESCAPE_DEVICE: print_word(h, "html"); continue; case ESCAPE_BREAK: breakline = 1; continue; case ESCAPE_NOSPACE: if ('\0' == *p) nospace = 1; continue; case ESCAPE_OVERSTRIKE: if (len == 0) continue; c = seq[len - 1]; break; default: continue; } if ((c < 0x20 && c != 0x09) || (c > 0x7E && c < 0xA0)) c = 0xFFFD; if (c > 0x7E) { (void)snprintf(numbuf, sizeof(numbuf), "&#x%.4X;", c); print_word(h, numbuf); } else if (print_escape(h, c) == 0) print_byte(h, c); } return nospace; } static void print_href(struct html *h, const char *name, const char *sec, int man) { struct stat sb; const char *p, *pp; char *filename; if (man) { pp = h->base_man1; if (h->base_man2 != NULL) { mandoc_asprintf(&filename, "%s.%s", name, sec); if (stat(filename, &sb) == -1) pp = h->base_man2; free(filename); } } else pp = h->base_includes; while ((p = strchr(pp, '%')) != NULL) { print_encode(h, pp, p, 1); if (man && p[1] == 'S') { if (sec == NULL) print_byte(h, '1'); else print_encode(h, sec, NULL, 1); } else if ((man && p[1] == 'N') || (man == 0 && p[1] == 'I')) print_encode(h, name, NULL, 1); else print_encode(h, p, p + 2, 1); pp = p + 2; } if (*pp != '\0') print_encode(h, pp, NULL, 1); } struct tag * print_otag(struct html *h, enum htmltag tag, const char *fmt, ...) { va_list ap; struct tag *t; const char *attr; char *arg1, *arg2; int style_written, tflags; tflags = htmltags[tag].flags; /* Flow content is not allowed in phrasing context. */ if ((tflags & HTML_INPHRASE) == 0) { for (t = h->tag; t != NULL; t = t->next) { if (t->closed) continue; assert((htmltags[t->tag].flags & HTML_TOPHRASE) == 0); break; } /* * Always wrap phrasing elements in a paragraph * unless already contained in some flow container; * never put them directly into a section. */ } else if (tflags & HTML_TOPHRASE && h->tag->tag == TAG_SECTION) print_otag(h, TAG_P, "c", "Pp"); /* Push this tag onto the stack of open scopes. */ if ((tflags & HTML_NOSTACK) == 0) { t = mandoc_malloc(sizeof(struct tag)); t->tag = tag; t->next = h->tag; t->refcnt = 0; t->closed = 0; h->tag = t; } else t = NULL; if (tflags & HTML_NLBEFORE) print_endline(h); if (h->col == 0) print_indent(h); else if ((h->flags & HTML_NOSPACE) == 0) { if (h->flags & HTML_KEEP) print_word(h, " "); else { if (h->flags & HTML_PREKEEP) h->flags |= HTML_KEEP; print_endword(h); } } if ( ! (h->flags & HTML_NONOSPACE)) h->flags &= ~HTML_NOSPACE; else h->flags |= HTML_NOSPACE; /* Print out the tag name and attributes. */ print_byte(h, '<'); print_word(h, htmltags[tag].name); va_start(ap, fmt); while (*fmt != '\0' && *fmt != 's') { /* Parse attributes and arguments. */ arg1 = va_arg(ap, char *); arg2 = NULL; switch (*fmt++) { case 'c': attr = "class"; break; case 'h': attr = "href"; break; case 'i': attr = "id"; break; case '?': attr = arg1; arg1 = va_arg(ap, char *); break; default: abort(); } if (*fmt == 'M') arg2 = va_arg(ap, char *); if (arg1 == NULL) continue; /* Print the attributes. */ print_byte(h, ' '); print_word(h, attr); print_byte(h, '='); print_byte(h, '"'); switch (*fmt) { case 'I': print_href(h, arg1, NULL, 0); fmt++; break; case 'M': print_href(h, arg1, arg2, 1); fmt++; break; case 'R': print_byte(h, '#'); print_encode(h, arg1, NULL, 1); fmt++; break; default: print_encode(h, arg1, NULL, 1); break; } print_byte(h, '"'); } style_written = 0; while (*fmt++ == 's') { arg1 = va_arg(ap, char *); arg2 = va_arg(ap, char *); if (arg2 == NULL) continue; print_byte(h, ' '); if (style_written == 0) { print_word(h, "style=\""); style_written = 1; } print_word(h, arg1); print_byte(h, ':'); print_byte(h, ' '); print_word(h, arg2); print_byte(h, ';'); } if (style_written) print_byte(h, '"'); va_end(ap); /* Accommodate for "well-formed" singleton escaping. */ if (htmltags[tag].flags & HTML_NOSTACK) print_byte(h, '/'); print_byte(h, '>'); if (tflags & HTML_NLBEGIN) print_endline(h); else h->flags |= HTML_NOSPACE; if (tflags & HTML_INDENT) h->indent++; if (tflags & HTML_NOINDENT) h->noindent++; return t; } /* * Print an element with an optional "id=" attribute. * If the element has phrasing content and an "id=" attribute, * also add a permalink: outside if it can be in phrasing context, * inside otherwise. */ struct tag * print_otag_id(struct html *h, enum htmltag elemtype, const char *cattr, struct roff_node *n) { struct roff_node *nch; struct tag *ret, *t; char *id, *href; ret = NULL; id = href = NULL; if (n->flags & NODE_ID) id = html_make_id(n, 1); if (n->flags & NODE_HREF) href = id == NULL ? html_make_id(n, 2) : id; if (href != NULL && htmltags[elemtype].flags & HTML_INPHRASE) ret = print_otag(h, TAG_A, "chR", "permalink", href); t = print_otag(h, elemtype, "ci", cattr, id); if (ret == NULL) { ret = t; if (href != NULL && (nch = n->child) != NULL) { /* man(7) is safe, it tags phrasing content only. */ if (n->tok > MDOC_MAX || htmltags[elemtype].flags & HTML_TOPHRASE) nch = NULL; else /* For mdoc(7), beware of nested blocks. */ while (nch != NULL && nch->type == ROFFT_TEXT) nch = nch->next; if (nch == NULL) print_otag(h, TAG_A, "chR", "permalink", href); } } free(id); if (id == NULL) free(href); return ret; } static void print_ctag(struct html *h, struct tag *tag) { int tflags; if (tag->closed == 0) { tag->closed = 1; if (tag == h->metaf) h->metaf = NULL; if (tag == h->tblt) h->tblt = NULL; tflags = htmltags[tag->tag].flags; if (tflags & HTML_INDENT) h->indent--; if (tflags & HTML_NOINDENT) h->noindent--; if (tflags & HTML_NLEND) print_endline(h); print_indent(h); print_byte(h, '<'); print_byte(h, '/'); print_word(h, htmltags[tag->tag].name); print_byte(h, '>'); if (tflags & HTML_NLAFTER) print_endline(h); } if (tag->refcnt == 0) { h->tag = tag->next; free(tag); } } void print_gen_decls(struct html *h) { print_word(h, ""); print_endline(h); } void print_gen_comment(struct html *h, struct roff_node *n) { int wantblank; print_word(h, "") == NULL && (wantblank || *n->string != '\0')) { print_endline(h); print_indent(h); print_word(h, n->string); wantblank = *n->string != '\0'; } n = n->next; } if (wantblank) print_endline(h); print_word(h, " -->"); print_endline(h); h->indent = 0; } void print_text(struct html *h, const char *word) { print_tagged_text(h, word, NULL); } void print_tagged_text(struct html *h, const char *word, struct roff_node *n) { struct tag *t; char *href; /* * Always wrap text in a paragraph unless already contained in * some flow container; never put it directly into a section. */ if (h->tag->tag == TAG_SECTION) print_otag(h, TAG_P, "c", "Pp"); /* Output whitespace before this text? */ if (h->col && (h->flags & HTML_NOSPACE) == 0) { if ( ! (HTML_KEEP & h->flags)) { if (HTML_PREKEEP & h->flags) h->flags |= HTML_KEEP; print_endword(h); } else print_word(h, " "); } /* * Optionally switch fonts, optionally write a permalink, then * print the text, optionally surrounded by HTML whitespace. */ assert(h->metaf == NULL); print_metaf(h); print_indent(h); if (n != NULL && (href = html_make_id(n, 2)) != NULL) { t = print_otag(h, TAG_A, "chR", "permalink", href); free(href); } else t = NULL; if ( ! print_encode(h, word, NULL, 0)) { if ( ! (h->flags & HTML_NONOSPACE)) h->flags &= ~HTML_NOSPACE; h->flags &= ~HTML_NONEWLINE; } else h->flags |= HTML_NOSPACE | HTML_NONEWLINE; if (h->metaf != NULL) { print_tagq(h, h->metaf); h->metaf = NULL; } else if (t != NULL) print_tagq(h, t); h->flags &= ~HTML_IGNDELIM; } void print_tagq(struct html *h, const struct tag *until) { struct tag *this, *next; for (this = h->tag; this != NULL; this = next) { next = this == until ? NULL : this->next; print_ctag(h, this); } } /* * Close out all open elements up to but excluding suntil. * Note that a paragraph just inside stays open together with it * because paragraphs include subsequent phrasing content. */ void print_stagq(struct html *h, const struct tag *suntil) { struct tag *this, *next; for (this = h->tag; this != NULL; this = next) { next = this->next; if (this == suntil || (next == suntil && (this->tag == TAG_P || this->tag == TAG_PRE))) break; print_ctag(h, this); } } /*********************************************************************** * Low level output functions. * They implement line breaking using a short static buffer. ***********************************************************************/ /* * Buffer one HTML output byte. * If the buffer is full, flush and deactivate it and start a new line. * If the buffer is inactive, print directly. */ static void print_byte(struct html *h, char c) { if ((h->flags & HTML_BUFFER) == 0) { putchar(c); h->col++; return; } if (h->col + h->bufcol < sizeof(h->buf)) { h->buf[h->bufcol++] = c; return; } putchar('\n'); h->col = 0; print_indent(h); putchar(' '); putchar(' '); fwrite(h->buf, h->bufcol, 1, stdout); putchar(c); h->col = (h->indent + 1) * 2 + h->bufcol + 1; h->bufcol = 0; h->flags &= ~HTML_BUFFER; } /* * If something was printed on the current output line, end it. * Not to be called right after print_indent(). */ void print_endline(struct html *h) { if (h->col == 0) return; if (h->bufcol) { putchar(' '); fwrite(h->buf, h->bufcol, 1, stdout); h->bufcol = 0; } putchar('\n'); h->col = 0; h->flags |= HTML_NOSPACE; h->flags &= ~HTML_BUFFER; } /* * Flush the HTML output buffer. * If it is inactive, activate it. */ static void print_endword(struct html *h) { if (h->noindent) { print_byte(h, ' '); return; } if ((h->flags & HTML_BUFFER) == 0) { h->col++; h->flags |= HTML_BUFFER; } else if (h->bufcol) { putchar(' '); fwrite(h->buf, h->bufcol, 1, stdout); h->col += h->bufcol + 1; } h->bufcol = 0; } /* * If at the beginning of a new output line, * perform indentation and mark the line as containing output. * Make sure to really produce some output right afterwards, * but do not use print_otag() for producing it. */ static void print_indent(struct html *h) { size_t i; if (h->col || h->noindent) return; h->col = h->indent * 2; for (i = 0; i < h->col; i++) putchar(' '); } /* * Print or buffer some characters * depending on the current HTML output buffer state. */ static void print_word(struct html *h, const char *cp) { while (*cp != '\0') print_byte(h, *cp++); } mandoc-1.14.6/lib.c010064400017530001753000000021041412314055300142560ustar00schwarzeschwarze/* $Id: lib.c,v 1.15 2018/12/13 11:55:46 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include "roff.h" #include "libmdoc.h" #define LINE(x, y) \ if (0 == strcmp(p, x)) return(y); const char * mdoc_a2lib(const char *p) { #include "lib.in" return NULL; } mandoc-1.14.6/main.c010064400017530001753000001017571412314055300144520ustar00schwarzeschwarze/* $Id: main.c,v 1.358 2021/09/04 22:38:46 schwarze Exp $ */ /* * Copyright (c) 2010-2012, 2014-2021 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Main program for mandoc(1), man(1), apropos(1), whatis(1), and help(1). */ #include "config.h" #include #include #include /* MACHINE */ #include #include #include #include #if HAVE_ERR #include #endif #include #include #include #include #if HAVE_SANDBOX_INIT #include #endif #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "mandoc_xr.h" #include "roff.h" #include "mdoc.h" #include "man.h" #include "mandoc_parse.h" #include "tag.h" #include "term_tag.h" #include "main.h" #include "manconf.h" #include "mansearch.h" enum outmode { OUTMODE_DEF = 0, OUTMODE_FLN, OUTMODE_LST, OUTMODE_ALL, OUTMODE_ONE }; enum outt { OUTT_ASCII = 0, /* -Tascii */ OUTT_LOCALE, /* -Tlocale */ OUTT_UTF8, /* -Tutf8 */ OUTT_TREE, /* -Ttree */ OUTT_MAN, /* -Tman */ OUTT_HTML, /* -Thtml */ OUTT_MARKDOWN, /* -Tmarkdown */ OUTT_LINT, /* -Tlint */ OUTT_PS, /* -Tps */ OUTT_PDF /* -Tpdf */ }; struct outstate { struct tag_files *tag_files; /* Tagging state variables. */ void *outdata; /* data for output */ int use_pager; int wstop; /* stop after a file with a warning */ int had_output; /* Some output was generated. */ enum outt outtype; /* which output to use */ }; int mandocdb(int, char *[]); static void check_xr(struct manpaths *); static void fs_append(char **, size_t, int, size_t, const char *, enum form, struct manpage **, size_t *); static int fs_lookup(const struct manpaths *, size_t, const char *, const char *, const char *, struct manpage **, size_t *); static int fs_search(const struct mansearch *, const struct manpaths *, const char *, struct manpage **, size_t *); static void glob_esc(char **, const char *, const char *); static void outdata_alloc(struct outstate *, struct manoutput *); static void parse(struct mparse *, int, const char *, struct outstate *, struct manconf *); static void passthrough(int, int); static void process_onefile(struct mparse *, struct manpage *, int, struct outstate *, struct manconf *); static void run_pager(struct outstate *, char *); static pid_t spawn_pager(struct outstate *, char *); static void usage(enum argmode) __attribute__((__noreturn__)); static int woptions(char *, enum mandoc_os *, int *); static const int sec_prios[] = {1, 4, 5, 8, 6, 3, 7, 2, 9}; static char help_arg[] = "help"; static char *help_argv[] = {help_arg, NULL}; int main(int argc, char *argv[]) { struct manconf conf; /* Manpaths and output options. */ struct outstate outst; /* Output state. */ struct winsize ws; /* Result of ioctl(TIOCGWINSZ). */ struct mansearch search; /* Search options. */ struct manpage *res; /* Complete list of search results. */ struct manpage *resn; /* Search results for one name. */ struct mparse *mp; /* Opaque parser object. */ const char *conf_file; /* -C: alternate config file. */ const char *os_s; /* -I: Operating system for display. */ const char *progname, *sec, *ep; char *defpaths; /* -M: override manpaths. */ char *auxpaths; /* -m: additional manpaths. */ char *oarg; /* -O: output option string. */ char *tagarg; /* -O tag: default value. */ unsigned char *uc; size_t ressz; /* Number of elements in res[]. */ size_t resnsz; /* Number of elements in resn[]. */ size_t i, ib, ssz; int options; /* Parser options. */ int show_usage; /* Invalid argument: give up. */ int prio, best_prio; int startdir; int c; enum mandoc_os os_e; /* Check base system conventions. */ enum outmode outmode; /* According to command line. */ #if HAVE_PROGNAME progname = getprogname(); #else if (argc < 1) progname = mandoc_strdup("mandoc"); else if ((progname = strrchr(argv[0], '/')) == NULL) progname = argv[0]; else ++progname; setprogname(progname); #endif mandoc_msg_setoutfile(stderr); if (strncmp(progname, "mandocdb", 8) == 0 || strcmp(progname, BINM_MAKEWHATIS) == 0) return mandocdb(argc, argv); #if HAVE_PLEDGE if (pledge("stdio rpath wpath cpath tmppath tty proc exec", NULL) == -1) { mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno)); return mandoc_msg_getrc(); } #endif #if HAVE_SANDBOX_INIT if (sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, NULL) == -1) errx((int)MANDOCLEVEL_SYSERR, "sandbox_init"); #endif /* Search options. */ memset(&conf, 0, sizeof(conf)); conf_file = NULL; defpaths = auxpaths = NULL; memset(&search, 0, sizeof(struct mansearch)); search.outkey = "Nd"; oarg = NULL; if (strcmp(progname, BINM_MAN) == 0) search.argmode = ARG_NAME; else if (strcmp(progname, BINM_APROPOS) == 0) search.argmode = ARG_EXPR; else if (strcmp(progname, BINM_WHATIS) == 0) search.argmode = ARG_WORD; else if (strncmp(progname, "help", 4) == 0) search.argmode = ARG_NAME; else search.argmode = ARG_FILE; /* Parser options. */ options = MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1; os_e = MANDOC_OS_OTHER; os_s = NULL; /* Formatter options. */ memset(&outst, 0, sizeof(outst)); outst.tag_files = NULL; outst.outtype = OUTT_LOCALE; outst.use_pager = 1; show_usage = 0; outmode = OUTMODE_DEF; while ((c = getopt(argc, argv, "aC:cfhI:iK:klM:m:O:S:s:T:VW:w")) != -1) { if (c == 'i' && search.argmode == ARG_EXPR) { optind--; break; } switch (c) { case 'a': outmode = OUTMODE_ALL; break; case 'C': conf_file = optarg; break; case 'c': outst.use_pager = 0; break; case 'f': search.argmode = ARG_WORD; break; case 'h': conf.output.synopsisonly = 1; outst.use_pager = 0; outmode = OUTMODE_ALL; break; case 'I': if (strncmp(optarg, "os=", 3) != 0) { mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "-I %s", optarg); return mandoc_msg_getrc(); } if (os_s != NULL) { mandoc_msg(MANDOCERR_BADARG_DUPE, 0, 0, "-I %s", optarg); return mandoc_msg_getrc(); } os_s = optarg + 3; break; case 'K': options &= ~(MPARSE_UTF8 | MPARSE_LATIN1); if (strcmp(optarg, "utf-8") == 0) options |= MPARSE_UTF8; else if (strcmp(optarg, "iso-8859-1") == 0) options |= MPARSE_LATIN1; else if (strcmp(optarg, "us-ascii") != 0) { mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "-K %s", optarg); return mandoc_msg_getrc(); } break; case 'k': search.argmode = ARG_EXPR; break; case 'l': search.argmode = ARG_FILE; outmode = OUTMODE_ALL; break; case 'M': defpaths = optarg; break; case 'm': auxpaths = optarg; break; case 'O': oarg = optarg; break; case 'S': search.arch = optarg; break; case 's': search.sec = optarg; break; case 'T': if (strcmp(optarg, "ascii") == 0) outst.outtype = OUTT_ASCII; else if (strcmp(optarg, "lint") == 0) { outst.outtype = OUTT_LINT; mandoc_msg_setoutfile(stdout); mandoc_msg_setmin(MANDOCERR_BASE); } else if (strcmp(optarg, "tree") == 0) outst.outtype = OUTT_TREE; else if (strcmp(optarg, "man") == 0) outst.outtype = OUTT_MAN; else if (strcmp(optarg, "html") == 0) outst.outtype = OUTT_HTML; else if (strcmp(optarg, "markdown") == 0) outst.outtype = OUTT_MARKDOWN; else if (strcmp(optarg, "utf8") == 0) outst.outtype = OUTT_UTF8; else if (strcmp(optarg, "locale") == 0) outst.outtype = OUTT_LOCALE; else if (strcmp(optarg, "ps") == 0) outst.outtype = OUTT_PS; else if (strcmp(optarg, "pdf") == 0) outst.outtype = OUTT_PDF; else { mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "-T %s", optarg); return mandoc_msg_getrc(); } break; case 'W': if (woptions(optarg, &os_e, &outst.wstop) == -1) return mandoc_msg_getrc(); break; case 'w': outmode = OUTMODE_FLN; break; default: show_usage = 1; break; } } if (show_usage) usage(search.argmode); /* Postprocess options. */ switch (outmode) { case OUTMODE_DEF: switch (search.argmode) { case ARG_FILE: outmode = OUTMODE_ALL; outst.use_pager = 0; break; case ARG_NAME: outmode = OUTMODE_ONE; break; default: outmode = OUTMODE_LST; break; } break; case OUTMODE_FLN: if (search.argmode == ARG_FILE) outmode = OUTMODE_ALL; break; case OUTMODE_ALL: break; case OUTMODE_LST: case OUTMODE_ONE: abort(); } if (oarg != NULL) { if (outmode == OUTMODE_LST) search.outkey = oarg; else { while (oarg != NULL) { if (manconf_output(&conf.output, strsep(&oarg, ","), 0) == -1) return mandoc_msg_getrc(); } } } if (outst.outtype != OUTT_TREE || conf.output.noval == 0) options |= MPARSE_VALIDATE; if (outmode == OUTMODE_FLN || outmode == OUTMODE_LST || (conf.output.outfilename == NULL && conf.output.tagfilename == NULL && isatty(STDOUT_FILENO) == 0)) outst.use_pager = 0; if (outst.use_pager && (conf.output.width == 0 || conf.output.indent == 0) && ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) != -1 && ws.ws_col > 1) { if (conf.output.width == 0 && ws.ws_col < 79) conf.output.width = ws.ws_col - 1; if (conf.output.indent == 0 && ws.ws_col < 66) conf.output.indent = 3; } #if HAVE_PLEDGE if (outst.use_pager == 0) c = pledge("stdio rpath", NULL); else if (conf.output.outfilename != NULL || conf.output.tagfilename != NULL) c = pledge("stdio rpath wpath cpath", NULL); else c = pledge("stdio rpath tmppath tty proc exec", NULL); if (c == -1) { mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno)); return mandoc_msg_getrc(); } #endif /* Parse arguments. */ if (argc > 0) { argc -= optind; argv += optind; } /* * Quirks for help(1) and man(1), * in particular for a section argument without -s. */ if (search.argmode == ARG_NAME) { if (*progname == 'h') { if (argc == 0) { argv = help_argv; argc = 1; } } else if (argc > 1 && ((uc = (unsigned char *)argv[0]) != NULL) && ((isdigit(uc[0]) && (uc[1] == '\0' || isalpha(uc[1]))) || (uc[0] == 'n' && uc[1] == '\0'))) { search.sec = (char *)uc; argv++; argc--; } if (search.arch == NULL) search.arch = getenv("MACHINE"); #ifdef MACHINE if (search.arch == NULL) search.arch = MACHINE; #endif if (outmode == OUTMODE_ONE) search.firstmatch = 1; } /* * Use the first argument for -O tag in addition to * using it as a search term for man(1) or apropos(1). */ if (conf.output.tag != NULL && *conf.output.tag == '\0') { tagarg = argc > 0 && search.argmode == ARG_EXPR ? strchr(*argv, '=') : NULL; conf.output.tag = tagarg == NULL ? *argv : tagarg + 1; } /* Read the configuration file. */ if (search.argmode != ARG_FILE || mandoc_msg_getmin() == MANDOCERR_STYLE) manconf_parse(&conf, conf_file, defpaths, auxpaths); /* man(1): Resolve each name individually. */ if (search.argmode == ARG_NAME) { if (argc < 1) { if (outmode != OUTMODE_FLN) usage(ARG_NAME); if (conf.manpath.sz == 0) { warnx("The manpath is empty."); mandoc_msg_setrc(MANDOCLEVEL_BADARG); } else { for (i = 0; i + 1 < conf.manpath.sz; i++) printf("%s:", conf.manpath.paths[i]); printf("%s\n", conf.manpath.paths[i]); } manconf_free(&conf); return (int)mandoc_msg_getrc(); } for (res = NULL, ressz = 0; argc > 0; argc--, argv++) { (void)mansearch(&search, &conf.manpath, 1, argv, &resn, &resnsz); if (resnsz == 0) (void)fs_search(&search, &conf.manpath, *argv, &resn, &resnsz); if (resnsz == 0 && strchr(*argv, '/') == NULL) { if (search.arch != NULL && arch_valid(search.arch, OSENUM) == 0) warnx("Unknown architecture \"%s\".", search.arch); else if (search.sec != NULL) warnx("No entry for %s in " "section %s of the manual.", *argv, search.sec); else warnx("No entry for %s in " "the manual.", *argv); mandoc_msg_setrc(MANDOCLEVEL_BADARG); continue; } if (resnsz == 0) { if (access(*argv, R_OK) == -1) { mandoc_msg_setinfilename(*argv); mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "%s", strerror(errno)); mandoc_msg_setinfilename(NULL); continue; } resnsz = 1; resn = mandoc_calloc(resnsz, sizeof(*res)); resn->file = mandoc_strdup(*argv); resn->ipath = SIZE_MAX; resn->form = FORM_SRC; } if (outmode != OUTMODE_ONE || resnsz == 1) { res = mandoc_reallocarray(res, ressz + resnsz, sizeof(*res)); memcpy(res + ressz, resn, sizeof(*resn) * resnsz); ressz += resnsz; continue; } /* Search for the best section. */ best_prio = 40; for (ib = i = 0; i < resnsz; i++) { sec = resn[i].file; sec += strcspn(sec, "123456789"); if (sec[0] == '\0') continue; /* No section at all. */ prio = sec_prios[sec[0] - '1']; if (search.sec != NULL) { ssz = strlen(search.sec); if (strncmp(sec, search.sec, ssz) == 0) sec += ssz; } else sec++; /* Prefer without suffix. */ if (*sec != '/') prio += 10; /* Wrong dir name. */ if (search.sec != NULL) { ep = strchr(sec, '\0'); if (ep - sec > 3 && strncmp(ep - 3, ".gz", 3) == 0) ep -= 3; if ((size_t)(ep - sec) < ssz + 3 || strncmp(ep - ssz, search.sec, ssz) != 0) /* Wrong file */ prio += 20; /* extension. */ } if (prio >= best_prio) continue; best_prio = prio; ib = i; } res = mandoc_reallocarray(res, ressz + 1, sizeof(*res)); memcpy(res + ressz++, resn + ib, sizeof(*resn)); } /* apropos(1), whatis(1): Process the full search expression. */ } else if (search.argmode != ARG_FILE) { if (mansearch(&search, &conf.manpath, argc, argv, &res, &ressz) == 0) usage(search.argmode); if (ressz == 0) { warnx("nothing appropriate"); mandoc_msg_setrc(MANDOCLEVEL_BADARG); goto out; } /* mandoc(1): Take command line arguments as file names. */ } else { ressz = argc > 0 ? argc : 1; res = mandoc_calloc(ressz, sizeof(*res)); for (i = 0; i < ressz; i++) { if (argc > 0) res[i].file = mandoc_strdup(argv[i]); res[i].ipath = SIZE_MAX; res[i].form = FORM_SRC; } } switch (outmode) { case OUTMODE_FLN: for (i = 0; i < ressz; i++) puts(res[i].file); goto out; case OUTMODE_LST: for (i = 0; i < ressz; i++) printf("%s - %s\n", res[i].names, res[i].output == NULL ? "" : res[i].output); goto out; default: break; } if (search.argmode == ARG_FILE && auxpaths != NULL) { if (strcmp(auxpaths, "doc") == 0) options |= MPARSE_MDOC; else if (strcmp(auxpaths, "an") == 0) options |= MPARSE_MAN; } mchars_alloc(); mp = mparse_alloc(options, os_e, os_s); /* * Remember the original working directory, if possible. * This will be needed if some names on the command line * are page names and some are relative file names. * Do not error out if the current directory is not * readable: Maybe it won't be needed after all. */ startdir = open(".", O_RDONLY | O_DIRECTORY); for (i = 0; i < ressz; i++) { process_onefile(mp, res + i, startdir, &outst, &conf); if (outst.wstop && mandoc_msg_getrc() != MANDOCLEVEL_OK) break; } if (startdir != -1) { (void)fchdir(startdir); close(startdir); } if (conf.output.tag != NULL && conf.output.tag_found == 0) { mandoc_msg(MANDOCERR_TAG, 0, 0, "%s", conf.output.tag); conf.output.tag = NULL; } if (outst.outdata != NULL) { switch (outst.outtype) { case OUTT_HTML: html_free(outst.outdata); break; case OUTT_UTF8: case OUTT_LOCALE: case OUTT_ASCII: ascii_free(outst.outdata); break; case OUTT_PDF: case OUTT_PS: pspdf_free(outst.outdata); break; default: break; } } mandoc_xr_free(); mparse_free(mp); mchars_free(); out: mansearch_free(res, ressz); if (search.argmode != ARG_FILE) manconf_free(&conf); if (outst.tag_files != NULL) { if (term_tag_close() != -1 && conf.output.outfilename == NULL && conf.output.tagfilename == NULL) run_pager(&outst, conf.output.tag); term_tag_unlink(); } else if (outst.had_output && outst.outtype != OUTT_LINT) mandoc_msg_summary(); return (int)mandoc_msg_getrc(); } static void usage(enum argmode argmode) { switch (argmode) { case ARG_FILE: fputs("usage: mandoc [-ac] [-I os=name] " "[-K encoding] [-mdoc | -man] [-O options]\n" "\t [-T output] [-W level] [file ...]\n", stderr); break; case ARG_NAME: fputs("usage: man [-acfhklw] [-C file] [-M path] " "[-m path] [-S subsection]\n" "\t [[-s] section] name ...\n", stderr); break; case ARG_WORD: fputs("usage: whatis [-afk] [-C file] " "[-M path] [-m path] [-O outkey] [-S arch]\n" "\t [-s section] name ...\n", stderr); break; case ARG_EXPR: fputs("usage: apropos [-afk] [-C file] " "[-M path] [-m path] [-O outkey] [-S arch]\n" "\t [-s section] expression ...\n", stderr); break; } exit((int)MANDOCLEVEL_BADARG); } static void glob_esc(char **dst, const char *src, const char *suffix) { while (*src != '\0') { if (strchr("*?[", *src) != NULL) *(*dst)++ = '\\'; *(*dst)++ = *src++; } while (*suffix != '\0') *(*dst)++ = *suffix++; } static void fs_append(char **file, size_t filesz, int copy, size_t ipath, const char *sec, enum form form, struct manpage **res, size_t *ressz) { struct manpage *page; *res = mandoc_reallocarray(*res, *ressz + filesz, sizeof(**res)); page = *res + *ressz; *ressz += filesz; for (;;) { page->file = copy ? mandoc_strdup(*file) : *file; page->names = NULL; page->output = NULL; page->bits = NAME_FILE & NAME_MASK; page->ipath = ipath; page->sec = (*sec >= '1' && *sec <= '9') ? *sec - '1' + 1 : 10; page->form = form; if (--filesz == 0) break; file++; page++; } } static int fs_lookup(const struct manpaths *paths, size_t ipath, const char *sec, const char *arch, const char *name, struct manpage **res, size_t *ressz) { struct stat sb; glob_t globinfo; char *file, *cp, secnum[2]; int globres; enum form form; const char *const slman = "/man"; const char *const slash = "/"; const char *const sglob = ".[01-9]*"; const char *const dot = "."; const char *const aster = "*"; memset(&globinfo, 0, sizeof(globinfo)); form = FORM_SRC; mandoc_asprintf(&file, "%s/man%s/%s.%s", paths->paths[ipath], sec, name, sec); if (stat(file, &sb) != -1) goto found; free(file); mandoc_asprintf(&file, "%s/cat%s/%s.0", paths->paths[ipath], sec, name); if (stat(file, &sb) != -1) { form = FORM_CAT; goto found; } free(file); if (arch != NULL) { mandoc_asprintf(&file, "%s/man%s/%s/%s.%s", paths->paths[ipath], sec, arch, name, sec); if (stat(file, &sb) != -1) goto found; free(file); } cp = file = mandoc_malloc(strlen(paths->paths[ipath]) * 2 + strlen(slman) + strlen(sec) * 2 + strlen(slash) + strlen(name) * 2 + strlen(sglob) + 1); glob_esc(&cp, paths->paths[ipath], slman); glob_esc(&cp, sec, slash); glob_esc(&cp, name, sglob); *cp = '\0'; globres = glob(file, 0, NULL, &globinfo); if (globres != 0 && globres != GLOB_NOMATCH) mandoc_msg(MANDOCERR_GLOB, 0, 0, "%s: %s", file, strerror(errno)); free(file); file = NULL; if (globres == 0) goto found; globfree(&globinfo); if (sec[1] != '\0' && *ressz == 0) { secnum[0] = sec[0]; secnum[1] = '\0'; cp = file = mandoc_malloc(strlen(paths->paths[ipath]) * 2 + strlen(slman) + strlen(secnum) * 2 + strlen(slash) + strlen(name) * 2 + strlen(dot) + strlen(sec) * 2 + strlen(aster) + 1); glob_esc(&cp, paths->paths[ipath], slman); glob_esc(&cp, secnum, slash); glob_esc(&cp, name, dot); glob_esc(&cp, sec, aster); *cp = '\0'; globres = glob(file, 0, NULL, &globinfo); if (globres != 0 && globres != GLOB_NOMATCH) mandoc_msg(MANDOCERR_GLOB, 0, 0, "%s: %s", file, strerror(errno)); free(file); file = NULL; if (globres == 0) goto found; globfree(&globinfo); } if (res != NULL || ipath + 1 != paths->sz) return -1; mandoc_asprintf(&file, "%s.%s", name, sec); globres = stat(file, &sb); free(file); return globres; found: warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s", name, sec, BINM_MAKEWHATIS, paths->paths[ipath]); if (res == NULL) free(file); else if (file == NULL) fs_append(globinfo.gl_pathv, globinfo.gl_pathc, 1, ipath, sec, form, res, ressz); else fs_append(&file, 1, 0, ipath, sec, form, res, ressz); globfree(&globinfo); return 0; } static int fs_search(const struct mansearch *cfg, const struct manpaths *paths, const char *name, struct manpage **res, size_t *ressz) { const char *const sections[] = {"1", "8", "6", "2", "3", "5", "7", "4", "9", "3p"}; const size_t nsec = sizeof(sections)/sizeof(sections[0]); size_t ipath, isec; assert(cfg->argmode == ARG_NAME); if (res != NULL) *res = NULL; *ressz = 0; for (ipath = 0; ipath < paths->sz; ipath++) { if (cfg->sec != NULL) { if (fs_lookup(paths, ipath, cfg->sec, cfg->arch, name, res, ressz) != -1 && cfg->firstmatch) return 0; } else { for (isec = 0; isec < nsec; isec++) if (fs_lookup(paths, ipath, sections[isec], cfg->arch, name, res, ressz) != -1 && cfg->firstmatch) return 0; } } return -1; } static void process_onefile(struct mparse *mp, struct manpage *resp, int startdir, struct outstate *outst, struct manconf *conf) { int fd; /* * Changing directories is not needed in ARG_FILE mode. * Do it on a best-effort basis. Even in case of * failure, some functionality may still work. */ if (resp->ipath != SIZE_MAX) (void)chdir(conf->manpath.paths[resp->ipath]); else if (startdir != -1) (void)fchdir(startdir); mandoc_msg_setinfilename(resp->file); if (resp->file != NULL) { if ((fd = mparse_open(mp, resp->file)) == -1) { mandoc_msg(resp->ipath == SIZE_MAX ? MANDOCERR_BADARG_BAD : MANDOCERR_OPEN, 0, 0, "%s", strerror(errno)); mandoc_msg_setinfilename(NULL); return; } } else fd = STDIN_FILENO; if (outst->use_pager) { outst->use_pager = 0; outst->tag_files = term_tag_init(conf->output.outfilename, outst->outtype == OUTT_HTML ? ".html" : "", conf->output.tagfilename); #if HAVE_PLEDGE if ((conf->output.outfilename != NULL || conf->output.tagfilename != NULL) && pledge("stdio rpath cpath", NULL) == -1) { mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno)); exit(mandoc_msg_getrc()); } #endif } if (outst->had_output && outst->outtype <= OUTT_UTF8) { if (outst->outdata == NULL) outdata_alloc(outst, &conf->output); terminal_sepline(outst->outdata); } if (resp->form == FORM_SRC) parse(mp, fd, resp->file, outst, conf); else { passthrough(fd, conf->output.synopsisonly); outst->had_output = 1; } if (ferror(stdout)) { if (outst->tag_files != NULL) { mandoc_msg(MANDOCERR_WRITE, 0, 0, "%s: %s", outst->tag_files->ofn, strerror(errno)); term_tag_unlink(); outst->tag_files = NULL; } else mandoc_msg(MANDOCERR_WRITE, 0, 0, "%s", strerror(errno)); } mandoc_msg_setinfilename(NULL); } static void parse(struct mparse *mp, int fd, const char *file, struct outstate *outst, struct manconf *conf) { static struct manpaths basepaths; static int previous; struct roff_meta *meta; assert(fd >= 0); if (file == NULL) file = ""; if (previous) mparse_reset(mp); else previous = 1; mparse_readfd(mp, fd, file); if (fd != STDIN_FILENO) close(fd); /* * With -Wstop and warnings or errors of at least the requested * level, do not produce output. */ if (outst->wstop && mandoc_msg_getrc() != MANDOCLEVEL_OK) return; if (outst->outdata == NULL) outdata_alloc(outst, &conf->output); else if (outst->outtype == OUTT_HTML) html_reset(outst->outdata); mandoc_xr_reset(); meta = mparse_result(mp); /* Execute the out device, if it exists. */ outst->had_output = 1; if (meta->macroset == MACROSET_MDOC) { switch (outst->outtype) { case OUTT_HTML: html_mdoc(outst->outdata, meta); break; case OUTT_TREE: tree_mdoc(outst->outdata, meta); break; case OUTT_MAN: man_mdoc(outst->outdata, meta); break; case OUTT_PDF: case OUTT_ASCII: case OUTT_UTF8: case OUTT_LOCALE: case OUTT_PS: terminal_mdoc(outst->outdata, meta); break; case OUTT_MARKDOWN: markdown_mdoc(outst->outdata, meta); break; default: break; } } if (meta->macroset == MACROSET_MAN) { switch (outst->outtype) { case OUTT_HTML: html_man(outst->outdata, meta); break; case OUTT_TREE: tree_man(outst->outdata, meta); break; case OUTT_MAN: mparse_copy(mp); break; case OUTT_PDF: case OUTT_ASCII: case OUTT_UTF8: case OUTT_LOCALE: case OUTT_PS: terminal_man(outst->outdata, meta); break; case OUTT_MARKDOWN: mandoc_msg(MANDOCERR_MAN_TMARKDOWN, 0, 0, NULL); break; default: break; } } if (conf->output.tag != NULL && conf->output.tag_found == 0 && tag_exists(conf->output.tag)) conf->output.tag_found = 1; if (mandoc_msg_getmin() < MANDOCERR_STYLE) { if (basepaths.sz == 0) manpath_base(&basepaths); check_xr(&basepaths); } else if (mandoc_msg_getmin() < MANDOCERR_WARNING) check_xr(&conf->manpath); } static void check_xr(struct manpaths *paths) { struct mansearch search; struct mandoc_xr *xr; size_t sz; for (xr = mandoc_xr_get(); xr != NULL; xr = xr->next) { if (xr->line == -1) continue; search.arch = NULL; search.sec = xr->sec; search.outkey = NULL; search.argmode = ARG_NAME; search.firstmatch = 1; if (mansearch(&search, paths, 1, &xr->name, NULL, &sz)) continue; if (fs_search(&search, paths, xr->name, NULL, &sz) != -1) continue; if (xr->count == 1) mandoc_msg(MANDOCERR_XR_BAD, xr->line, xr->pos + 1, "Xr %s %s", xr->name, xr->sec); else mandoc_msg(MANDOCERR_XR_BAD, xr->line, xr->pos + 1, "Xr %s %s (%d times)", xr->name, xr->sec, xr->count); } } static void outdata_alloc(struct outstate *outst, struct manoutput *outconf) { switch (outst->outtype) { case OUTT_HTML: outst->outdata = html_alloc(outconf); break; case OUTT_UTF8: outst->outdata = utf8_alloc(outconf); break; case OUTT_LOCALE: outst->outdata = locale_alloc(outconf); break; case OUTT_ASCII: outst->outdata = ascii_alloc(outconf); break; case OUTT_PDF: outst->outdata = pdf_alloc(outconf); break; case OUTT_PS: outst->outdata = ps_alloc(outconf); break; default: break; } } static void passthrough(int fd, int synopsis_only) { const char synb[] = "S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS"; const char synr[] = "SYNOPSIS"; FILE *stream; char *line, *cp; size_t linesz; ssize_t len, written; int lno, print; stream = NULL; line = NULL; linesz = 0; if (fflush(stdout) == EOF) { mandoc_msg(MANDOCERR_FFLUSH, 0, 0, "%s", strerror(errno)); goto done; } if ((stream = fdopen(fd, "r")) == NULL) { close(fd); mandoc_msg(MANDOCERR_FDOPEN, 0, 0, "%s", strerror(errno)); goto done; } lno = print = 0; while ((len = getline(&line, &linesz, stream)) != -1) { lno++; cp = line; if (synopsis_only) { if (print) { if ( ! isspace((unsigned char)*cp)) goto done; while (isspace((unsigned char)*cp)) { cp++; len--; } } else { if (strcmp(cp, synb) == 0 || strcmp(cp, synr) == 0) print = 1; continue; } } for (; len > 0; len -= written) { if ((written = write(STDOUT_FILENO, cp, len)) == -1) { mandoc_msg(MANDOCERR_WRITE, 0, 0, "%s", strerror(errno)); goto done; } } } if (ferror(stream)) mandoc_msg(MANDOCERR_GETLINE, lno, 0, "%s", strerror(errno)); done: free(line); if (stream != NULL) fclose(stream); } static int woptions(char *arg, enum mandoc_os *os_e, int *wstop) { char *v, *o; const char *toks[11]; toks[0] = "stop"; toks[1] = "all"; toks[2] = "base"; toks[3] = "style"; toks[4] = "warning"; toks[5] = "error"; toks[6] = "unsupp"; toks[7] = "fatal"; toks[8] = "openbsd"; toks[9] = "netbsd"; toks[10] = NULL; while (*arg) { o = arg; switch (getsubopt(&arg, (char * const *)toks, &v)) { case 0: *wstop = 1; break; case 1: case 2: mandoc_msg_setmin(MANDOCERR_BASE); break; case 3: mandoc_msg_setmin(MANDOCERR_STYLE); break; case 4: mandoc_msg_setmin(MANDOCERR_WARNING); break; case 5: mandoc_msg_setmin(MANDOCERR_ERROR); break; case 6: mandoc_msg_setmin(MANDOCERR_UNSUPP); break; case 7: mandoc_msg_setmin(MANDOCERR_BADARG); break; case 8: mandoc_msg_setmin(MANDOCERR_BASE); *os_e = MANDOC_OS_OPENBSD; break; case 9: mandoc_msg_setmin(MANDOCERR_BASE); *os_e = MANDOC_OS_NETBSD; break; default: mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "-W %s", o); return -1; } } return 0; } /* * Wait until moved to the foreground, * then fork the pager and wait for the user to close it. */ static void run_pager(struct outstate *outst, char *tag_target) { int signum, status; pid_t man_pgid, tc_pgid; pid_t pager_pid, wait_pid; man_pgid = getpgid(0); outst->tag_files->tcpgid = man_pgid == getpid() ? getpgid(getppid()) : man_pgid; pager_pid = 0; signum = SIGSTOP; for (;;) { /* Stop here until moved to the foreground. */ tc_pgid = tcgetpgrp(STDOUT_FILENO); if (tc_pgid != man_pgid) { if (tc_pgid == pager_pid) { (void)tcsetpgrp(STDOUT_FILENO, man_pgid); if (signum == SIGTTIN) continue; } else outst->tag_files->tcpgid = tc_pgid; kill(0, signum); continue; } /* Once in the foreground, activate the pager. */ if (pager_pid) { (void)tcsetpgrp(STDOUT_FILENO, pager_pid); kill(pager_pid, SIGCONT); } else pager_pid = spawn_pager(outst, tag_target); /* Wait for the pager to stop or exit. */ while ((wait_pid = waitpid(pager_pid, &status, WUNTRACED)) == -1 && errno == EINTR) continue; if (wait_pid == -1) { mandoc_msg(MANDOCERR_WAIT, 0, 0, "%s", strerror(errno)); break; } if (!WIFSTOPPED(status)) break; signum = WSTOPSIG(status); } } static pid_t spawn_pager(struct outstate *outst, char *tag_target) { const struct timespec timeout = { 0, 100000000 }; /* 0.1s */ #define MAX_PAGER_ARGS 16 char *argv[MAX_PAGER_ARGS]; const char *pager; char *cp; #if HAVE_LESS_T size_t cmdlen; #endif int argc, use_ofn; pid_t pager_pid; assert(outst->tag_files->ofd == -1); assert(outst->tag_files->tfs == NULL); pager = getenv("MANPAGER"); if (pager == NULL || *pager == '\0') pager = getenv("PAGER"); if (pager == NULL || *pager == '\0') pager = BINM_PAGER; cp = mandoc_strdup(pager); /* * Parse the pager command into words. * Intentionally do not do anything fancy here. */ argc = 0; while (argc + 5 < MAX_PAGER_ARGS) { argv[argc++] = cp; cp = strchr(cp, ' '); if (cp == NULL) break; *cp++ = '\0'; while (*cp == ' ') cp++; if (*cp == '\0') break; } /* For less(1), use the tag file. */ use_ofn = 1; #if HAVE_LESS_T if (*outst->tag_files->tfn != '\0' && (cmdlen = strlen(argv[0])) >= 4) { cp = argv[0] + cmdlen - 4; if (strcmp(cp, "less") == 0) { argv[argc++] = mandoc_strdup("-T"); argv[argc++] = outst->tag_files->tfn; if (tag_target != NULL) { argv[argc++] = mandoc_strdup("-t"); argv[argc++] = tag_target; use_ofn = 0; } } } #endif if (use_ofn) { if (outst->outtype == OUTT_HTML && tag_target != NULL) mandoc_asprintf(&argv[argc], "file://%s#%s", outst->tag_files->ofn, tag_target); else argv[argc] = outst->tag_files->ofn; argc++; } argv[argc] = NULL; switch (pager_pid = fork()) { case -1: mandoc_msg(MANDOCERR_FORK, 0, 0, "%s", strerror(errno)); exit(mandoc_msg_getrc()); case 0: break; default: (void)setpgid(pager_pid, 0); (void)tcsetpgrp(STDOUT_FILENO, pager_pid); #if HAVE_PLEDGE if (pledge("stdio rpath tmppath tty proc", NULL) == -1) { mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno)); exit(mandoc_msg_getrc()); } #endif outst->tag_files->pager_pid = pager_pid; return pager_pid; } /* * The child process becomes the pager. * Do not start it before controlling the terminal. */ while (tcgetpgrp(STDOUT_FILENO) != getpid()) nanosleep(&timeout, NULL); execvp(argv[0], argv); mandoc_msg(MANDOCERR_EXEC, 0, 0, "%s: %s", argv[0], strerror(errno)); _exit(mandoc_msg_getrc()); } mandoc-1.14.6/man.c010064400017530001753000000211711412314055300142700ustar00schwarzeschwarze/* $Id: man.c,v 1.187 2019/01/05 00:36:50 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze * Copyright (c) 2011 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "man.h" #include "libmandoc.h" #include "roff_int.h" #include "libman.h" static char *man_hasc(char *); static int man_ptext(struct roff_man *, int, char *, int); static int man_pmacro(struct roff_man *, int, char *, int); int man_parseln(struct roff_man *man, int ln, char *buf, int offs) { if (man->last->type != ROFFT_EQN || ln > man->last->line) man->flags |= MAN_NEWLINE; return roff_getcontrol(man->roff, buf, &offs) ? man_pmacro(man, ln, buf, offs) : man_ptext(man, ln, buf, offs); } /* * If the string ends with \c, return a pointer to the backslash. * Otherwise, return NULL. */ static char * man_hasc(char *start) { char *cp, *ep; ep = strchr(start, '\0') - 2; if (ep < start || ep[0] != '\\' || ep[1] != 'c') return NULL; for (cp = ep; cp > start; cp--) if (cp[-1] != '\\') break; return (ep - cp) % 2 ? NULL : ep; } void man_descope(struct roff_man *man, int line, int offs, char *start) { /* Trailing \c keeps next-line scope open. */ if (start != NULL && man_hasc(start) != NULL) return; /* * Co-ordinate what happens with having a next-line scope open: * first close out the element scopes (if applicable), * then close out the block scope (also if applicable). */ if (man->flags & MAN_ELINE) { while (man->last->parent->type != ROFFT_ROOT && man_macro(man->last->parent->tok)->flags & MAN_ESCOPED) man_unscope(man, man->last->parent); man->flags &= ~MAN_ELINE; } if ( ! (man->flags & MAN_BLINE)) return; man_unscope(man, man->last->parent); roff_body_alloc(man, line, offs, man->last->tok); man->flags &= ~(MAN_BLINE | ROFF_NONOFILL); } static int man_ptext(struct roff_man *man, int line, char *buf, int offs) { int i; char *ep; /* In no-fill mode, whitespace is preserved on text lines. */ if (man->flags & ROFF_NOFILL) { roff_word_alloc(man, line, offs, buf + offs); man_descope(man, line, offs, buf + offs); return 1; } for (i = offs; buf[i] == ' '; i++) /* Skip leading whitespace. */ ; /* * Blank lines are ignored in next line scope * and right after headings and cancel preceding \c, * but add a single vertical space elsewhere. */ if (buf[i] == '\0') { if (man->flags & (MAN_ELINE | MAN_BLINE)) { mandoc_msg(MANDOCERR_BLK_BLANK, line, 0, NULL); return 1; } if (man->last->tok == MAN_SH || man->last->tok == MAN_SS) return 1; if (man->last->type == ROFFT_TEXT && ((ep = man_hasc(man->last->string)) != NULL)) { *ep = '\0'; return 1; } roff_elem_alloc(man, line, offs, ROFF_sp); man->next = ROFF_NEXT_SIBLING; return 1; } /* * Warn if the last un-escaped character is whitespace. Then * strip away the remaining spaces (tabs stay!). */ i = (int)strlen(buf); assert(i); if (' ' == buf[i - 1] || '\t' == buf[i - 1]) { if (i > 1 && '\\' != buf[i - 2]) mandoc_msg(MANDOCERR_SPACE_EOL, line, i - 1, NULL); for (--i; i && ' ' == buf[i]; i--) /* Spin back to non-space. */ ; /* Jump ahead of escaped whitespace. */ i += '\\' == buf[i] ? 2 : 1; buf[i] = '\0'; } roff_word_alloc(man, line, offs, buf + offs); /* * End-of-sentence check. If the last character is an unescaped * EOS character, then flag the node as being the end of a * sentence. The front-end will know how to interpret this. */ assert(i); if (mandoc_eos(buf, (size_t)i)) man->last->flags |= NODE_EOS; man_descope(man, line, offs, buf + offs); return 1; } static int man_pmacro(struct roff_man *man, int ln, char *buf, int offs) { struct roff_node *n; const char *cp; size_t sz; enum roff_tok tok; int ppos; int bline; /* Determine the line macro. */ ppos = offs; tok = TOKEN_NONE; for (sz = 0; sz < 4 && strchr(" \t\\", buf[offs]) == NULL; sz++) offs++; if (sz > 0 && sz < 4) tok = roffhash_find(man->manmac, buf + ppos, sz); if (tok == TOKEN_NONE) { mandoc_msg(MANDOCERR_MACRO, ln, ppos, "%s", buf + ppos - 1); return 1; } /* Skip a leading escape sequence or tab. */ switch (buf[offs]) { case '\\': cp = buf + offs + 1; mandoc_escape(&cp, NULL, NULL); offs = cp - buf; break; case '\t': offs++; break; default: break; } /* Jump to the next non-whitespace word. */ while (buf[offs] == ' ') offs++; /* * Trailing whitespace. Note that tabs are allowed to be passed * into the parser as "text", so we only warn about spaces here. */ if (buf[offs] == '\0' && buf[offs - 1] == ' ') mandoc_msg(MANDOCERR_SPACE_EOL, ln, offs - 1, NULL); /* * Some macros break next-line scopes; otherwise, remember * whether we are in next-line scope for a block head. */ man_breakscope(man, tok); bline = man->flags & MAN_BLINE; /* * If the line in next-line scope ends with \c, keep the * next-line scope open for the subsequent input line. * That is not at all portable, only groff >= 1.22.4 * does it, but *if* this weird idiom occurs in a manual * page, that's very likely what the author intended. */ if (bline && man_hasc(buf + offs)) bline = 0; /* Call to handler... */ (*man_macro(tok)->fp)(man, tok, ln, ppos, &offs, buf); /* In quick mode (for mandocdb), abort after the NAME section. */ if (man->quick && tok == MAN_SH) { n = man->last; if (n->type == ROFFT_BODY && strcmp(n->prev->child->string, "NAME")) return 2; } /* * If we are in a next-line scope for a block head, * close it out now and switch to the body, * unless the next-line scope is allowed to continue. */ if (bline == 0 || (man->flags & MAN_BLINE) == 0 || man->flags & MAN_ELINE || man_macro(tok)->flags & MAN_NSCOPED) return 1; man_unscope(man, man->last->parent); roff_body_alloc(man, ln, ppos, man->last->tok); man->flags &= ~(MAN_BLINE | ROFF_NONOFILL); return 1; } void man_breakscope(struct roff_man *man, int tok) { struct roff_node *n; /* * An element next line scope is open, * and the new macro is not allowed inside elements. * Delete the element that is being broken. */ if (man->flags & MAN_ELINE && (tok < MAN_TH || (man_macro(tok)->flags & MAN_NSCOPED) == 0)) { n = man->last; if (n->type == ROFFT_TEXT) n = n->parent; if (n->tok < MAN_TH || (man_macro(n->tok)->flags & (MAN_NSCOPED | MAN_ESCOPED)) == MAN_NSCOPED) n = n->parent; mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, "%s breaks %s", roff_name[tok], roff_name[n->tok]); roff_node_delete(man, n); man->flags &= ~MAN_ELINE; } /* * Weird special case: * Switching fill mode closes section headers. */ if (man->flags & MAN_BLINE && (tok == ROFF_nf || tok == ROFF_fi) && (man->last->tok == MAN_SH || man->last->tok == MAN_SS)) { n = man->last; man_unscope(man, n); roff_body_alloc(man, n->line, n->pos, n->tok); man->flags &= ~(MAN_BLINE | ROFF_NONOFILL); } /* * A block header next line scope is open, * and the new macro is not allowed inside block headers. * Delete the block that is being broken. */ if (man->flags & MAN_BLINE && tok != ROFF_nf && tok != ROFF_fi && (tok < MAN_TH || man_macro(tok)->flags & MAN_XSCOPE)) { n = man->last; if (n->type == ROFFT_TEXT) n = n->parent; if (n->tok < MAN_TH || (man_macro(n->tok)->flags & MAN_XSCOPE) == 0) n = n->parent; assert(n->type == ROFFT_HEAD); n = n->parent; assert(n->type == ROFFT_BLOCK); assert(man_macro(n->tok)->flags & MAN_BSCOPED); mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, "%s breaks %s", roff_name[tok], roff_name[n->tok]); roff_node_delete(man, n); man->flags &= ~(MAN_BLINE | ROFF_NONOFILL); } } mandoc-1.14.6/man_html.c010064400017530001753000000325651412314055300153250ustar00schwarzeschwarze/* $Id: man_html.c,v 1.179 2020/10/16 17:22:43 schwarze Exp $ */ /* * Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * HTML formatter for man(7) used by mandoc(1). */ #include "config.h" #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "man.h" #include "out.h" #include "html.h" #include "main.h" #define MAN_ARGS const struct roff_meta *man, \ struct roff_node *n, \ struct html *h struct man_html_act { int (*pre)(MAN_ARGS); int (*post)(MAN_ARGS); }; static void print_man_head(const struct roff_meta *, struct html *); static void print_man_nodelist(MAN_ARGS); static void print_man_node(MAN_ARGS); static char list_continues(const struct roff_node *, const struct roff_node *); static int man_B_pre(MAN_ARGS); static int man_IP_pre(MAN_ARGS); static int man_I_pre(MAN_ARGS); static int man_OP_pre(MAN_ARGS); static int man_PP_pre(MAN_ARGS); static int man_RS_pre(MAN_ARGS); static int man_SH_pre(MAN_ARGS); static int man_SM_pre(MAN_ARGS); static int man_SY_pre(MAN_ARGS); static int man_UR_pre(MAN_ARGS); static int man_abort_pre(MAN_ARGS); static int man_alt_pre(MAN_ARGS); static int man_ign_pre(MAN_ARGS); static int man_in_pre(MAN_ARGS); static void man_root_post(const struct roff_meta *, struct html *); static void man_root_pre(const struct roff_meta *, struct html *); static const struct man_html_act man_html_acts[MAN_MAX - MAN_TH] = { { NULL, NULL }, /* TH */ { man_SH_pre, NULL }, /* SH */ { man_SH_pre, NULL }, /* SS */ { man_IP_pre, NULL }, /* TP */ { man_IP_pre, NULL }, /* TQ */ { man_abort_pre, NULL }, /* LP */ { man_PP_pre, NULL }, /* PP */ { man_abort_pre, NULL }, /* P */ { man_IP_pre, NULL }, /* IP */ { man_PP_pre, NULL }, /* HP */ { man_SM_pre, NULL }, /* SM */ { man_SM_pre, NULL }, /* SB */ { man_alt_pre, NULL }, /* BI */ { man_alt_pre, NULL }, /* IB */ { man_alt_pre, NULL }, /* BR */ { man_alt_pre, NULL }, /* RB */ { NULL, NULL }, /* R */ { man_B_pre, NULL }, /* B */ { man_I_pre, NULL }, /* I */ { man_alt_pre, NULL }, /* IR */ { man_alt_pre, NULL }, /* RI */ { NULL, NULL }, /* RE */ { man_RS_pre, NULL }, /* RS */ { man_ign_pre, NULL }, /* DT */ { man_ign_pre, NULL }, /* UC */ { man_ign_pre, NULL }, /* PD */ { man_ign_pre, NULL }, /* AT */ { man_in_pre, NULL }, /* in */ { man_SY_pre, NULL }, /* SY */ { NULL, NULL }, /* YS */ { man_OP_pre, NULL }, /* OP */ { NULL, NULL }, /* EX */ { NULL, NULL }, /* EE */ { man_UR_pre, NULL }, /* UR */ { NULL, NULL }, /* UE */ { man_UR_pre, NULL }, /* MT */ { NULL, NULL }, /* ME */ }; void html_man(void *arg, const struct roff_meta *man) { struct html *h; struct roff_node *n; struct tag *t; h = (struct html *)arg; n = man->first->child; if ((h->oflags & HTML_FRAGMENT) == 0) { print_gen_decls(h); print_otag(h, TAG_HTML, ""); if (n != NULL && n->type == ROFFT_COMMENT) print_gen_comment(h, n); t = print_otag(h, TAG_HEAD, ""); print_man_head(man, h); print_tagq(h, t); print_otag(h, TAG_BODY, ""); } man_root_pre(man, h); t = print_otag(h, TAG_DIV, "c", "manual-text"); print_man_nodelist(man, n, h); print_tagq(h, t); man_root_post(man, h); print_tagq(h, NULL); } static void print_man_head(const struct roff_meta *man, struct html *h) { char *cp; print_gen_head(h); mandoc_asprintf(&cp, "%s(%s)", man->title, man->msec); print_otag(h, TAG_TITLE, ""); print_text(h, cp); free(cp); } static void print_man_nodelist(MAN_ARGS) { while (n != NULL) { print_man_node(man, n, h); n = n->next; } } static void print_man_node(MAN_ARGS) { struct tag *t; int child; if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; if ((n->flags & NODE_NOFILL) == 0) html_fillmode(h, ROFF_fi); else if (html_fillmode(h, ROFF_nf) == ROFF_nf && n->tok != ROFF_fi && n->flags & NODE_LINE && (n->prev == NULL || n->prev->tok != MAN_YS)) print_endline(h); child = 1; switch (n->type) { case ROFFT_TEXT: if (*n->string == '\0') { print_endline(h); return; } if (*n->string == ' ' && n->flags & NODE_LINE && (h->flags & HTML_NONEWLINE) == 0) print_otag(h, TAG_BR, ""); else if (n->flags & NODE_DELIMC) h->flags |= HTML_NOSPACE; t = h->tag; t->refcnt++; print_text(h, n->string); break; case ROFFT_EQN: t = h->tag; t->refcnt++; print_eqn(h, n->eqn); break; case ROFFT_TBL: /* * This will take care of initialising all of the table * state data for the first table, then tearing it down * for the last one. */ print_tbl(h, n->span); return; default: /* * Close out scope of font prior to opening a macro * scope. */ if (h->metac != ESCAPE_FONTROMAN) { h->metal = h->metac; h->metac = ESCAPE_FONTROMAN; } /* * Close out the current table, if it's open, and unset * the "meta" table state. This will be reopened on the * next table element. */ if (h->tblt != NULL) print_tblclose(h); t = h->tag; t->refcnt++; if (n->tok < ROFF_MAX) { roff_html_pre(h, n); t->refcnt--; print_stagq(h, t); return; } assert(n->tok >= MAN_TH && n->tok < MAN_MAX); if (man_html_acts[n->tok - MAN_TH].pre != NULL) child = (*man_html_acts[n->tok - MAN_TH].pre)(man, n, h); break; } if (child && n->child != NULL) print_man_nodelist(man, n->child, h); /* This will automatically close out any font scope. */ t->refcnt--; if (n->type == ROFFT_BLOCK && (n->tok == MAN_IP || n->tok == MAN_TP || n->tok == MAN_TQ)) { t = h->tag; while (t->tag != TAG_DL && t->tag != TAG_UL) t = t->next; /* * Close the list if no further item of the same type * follows; otherwise, close the item only. */ if (list_continues(n, roff_node_next(n)) == '\0') { print_tagq(h, t); t = NULL; } } if (t != NULL) print_stagq(h, t); } static void man_root_pre(const struct roff_meta *man, struct html *h) { struct tag *t, *tt; char *title; assert(man->title); assert(man->msec); mandoc_asprintf(&title, "%s(%s)", man->title, man->msec); t = print_otag(h, TAG_TABLE, "c", "head"); tt = print_otag(h, TAG_TR, ""); print_otag(h, TAG_TD, "c", "head-ltitle"); print_text(h, title); print_stagq(h, tt); print_otag(h, TAG_TD, "c", "head-vol"); if (man->vol != NULL) print_text(h, man->vol); print_stagq(h, tt); print_otag(h, TAG_TD, "c", "head-rtitle"); print_text(h, title); print_tagq(h, t); free(title); } static void man_root_post(const struct roff_meta *man, struct html *h) { struct tag *t, *tt; t = print_otag(h, TAG_TABLE, "c", "foot"); tt = print_otag(h, TAG_TR, ""); print_otag(h, TAG_TD, "c", "foot-date"); print_text(h, man->date); print_stagq(h, tt); print_otag(h, TAG_TD, "c", "foot-os"); if (man->os != NULL) print_text(h, man->os); print_tagq(h, t); } static int man_SH_pre(MAN_ARGS) { const char *class; enum htmltag tag; if (n->tok == MAN_SH) { tag = TAG_H1; class = "Sh"; } else { tag = TAG_H2; class = "Ss"; } switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); print_otag(h, TAG_SECTION, "c", class); break; case ROFFT_HEAD: print_otag_id(h, tag, class, n); break; case ROFFT_BODY: break; default: abort(); } return 1; } static int man_alt_pre(MAN_ARGS) { const struct roff_node *nn; struct tag *t; int i; enum htmltag fp; for (i = 0, nn = n->child; nn != NULL; nn = nn->next, i++) { switch (n->tok) { case MAN_BI: fp = i % 2 ? TAG_I : TAG_B; break; case MAN_IB: fp = i % 2 ? TAG_B : TAG_I; break; case MAN_RI: fp = i % 2 ? TAG_I : TAG_MAX; break; case MAN_IR: fp = i % 2 ? TAG_MAX : TAG_I; break; case MAN_BR: fp = i % 2 ? TAG_MAX : TAG_B; break; case MAN_RB: fp = i % 2 ? TAG_B : TAG_MAX; break; default: abort(); } if (i) h->flags |= HTML_NOSPACE; if (fp != TAG_MAX) t = print_otag(h, fp, ""); print_text(h, nn->string); if (fp != TAG_MAX) print_tagq(h, t); } return 0; } static int man_SM_pre(MAN_ARGS) { print_otag(h, TAG_SMALL, ""); if (n->tok == MAN_SB) print_otag(h, TAG_B, ""); return 1; } static int man_PP_pre(MAN_ARGS) { switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); break; case ROFFT_HEAD: return 0; case ROFFT_BODY: if (n->child != NULL && (n->child->flags & NODE_NOFILL) == 0) print_otag(h, TAG_P, "c", n->tok == MAN_PP ? "Pp" : "Pp HP"); break; default: abort(); } return 1; } static char list_continues(const struct roff_node *n1, const struct roff_node *n2) { const char *s1, *s2; char c1, c2; if (n1 == NULL || n1->type != ROFFT_BLOCK || n2 == NULL || n2->type != ROFFT_BLOCK) return '\0'; if ((n1->tok == MAN_TP || n1->tok == MAN_TQ) && (n2->tok == MAN_TP || n2->tok == MAN_TQ)) return ' '; if (n1->tok != MAN_IP || n2->tok != MAN_IP) return '\0'; n1 = n1->head->child; n2 = n2->head->child; s1 = n1 == NULL ? "" : n1->string; s2 = n2 == NULL ? "" : n2->string; c1 = strcmp(s1, "*") == 0 ? '*' : strcmp(s1, "\\-") == 0 ? '-' : strcmp(s1, "\\(bu") == 0 ? 'b' : ' '; c2 = strcmp(s2, "*") == 0 ? '*' : strcmp(s2, "\\-") == 0 ? '-' : strcmp(s2, "\\(bu") == 0 ? 'b' : ' '; return c1 != c2 ? '\0' : c1 == 'b' ? '*' : c1; } static int man_IP_pre(MAN_ARGS) { struct roff_node *nn; const char *list_class; enum htmltag list_elem, body_elem; char list_type; nn = n->type == ROFFT_BLOCK ? n : n->parent; list_type = list_continues(roff_node_prev(nn), nn); if (list_type == '\0') { /* Start a new list. */ list_type = list_continues(nn, roff_node_next(nn)); if (list_type == '\0') list_type = ' '; switch (list_type) { case ' ': list_class = "Bl-tag"; list_elem = TAG_DL; break; case '*': list_class = "Bl-bullet"; list_elem = TAG_UL; break; case '-': list_class = "Bl-dash"; list_elem = TAG_UL; break; default: abort(); } } else { /* Continue a list that was started earlier. */ list_class = NULL; list_elem = TAG_MAX; } body_elem = list_type == ' ' ? TAG_DD : TAG_LI; switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); if (list_elem != TAG_MAX) print_otag(h, list_elem, "c", list_class); return 1; case ROFFT_HEAD: if (body_elem == TAG_LI) return 0; print_otag_id(h, TAG_DT, NULL, n); break; case ROFFT_BODY: print_otag(h, body_elem, ""); return 1; default: abort(); } switch(n->tok) { case MAN_IP: /* Only print the first header element. */ if (n->child != NULL) print_man_node(man, n->child, h); break; case MAN_TP: /* Only print next-line header elements. */ case MAN_TQ: nn = n->child; while (nn != NULL && (NODE_LINE & nn->flags) == 0) nn = nn->next; while (nn != NULL) { print_man_node(man, nn, h); nn = nn->next; } break; default: abort(); } return 0; } static int man_OP_pre(MAN_ARGS) { struct tag *tt; print_text(h, "["); h->flags |= HTML_NOSPACE; tt = print_otag(h, TAG_SPAN, "c", "Op"); if ((n = n->child) != NULL) { print_otag(h, TAG_B, ""); print_text(h, n->string); } print_stagq(h, tt); if (n != NULL && n->next != NULL) { print_otag(h, TAG_I, ""); print_text(h, n->next->string); } print_stagq(h, tt); h->flags |= HTML_NOSPACE; print_text(h, "]"); return 0; } static int man_B_pre(MAN_ARGS) { print_otag(h, TAG_B, ""); return 1; } static int man_I_pre(MAN_ARGS) { print_otag(h, TAG_I, ""); return 1; } static int man_in_pre(MAN_ARGS) { print_otag(h, TAG_BR, ""); return 0; } static int man_ign_pre(MAN_ARGS) { return 0; } static int man_RS_pre(MAN_ARGS) { switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); break; case ROFFT_HEAD: return 0; case ROFFT_BODY: print_otag(h, TAG_DIV, "c", "Bd-indent"); break; default: abort(); } return 1; } static int man_SY_pre(MAN_ARGS) { switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); print_otag(h, TAG_TABLE, "c", "Nm"); print_otag(h, TAG_TR, ""); break; case ROFFT_HEAD: print_otag(h, TAG_TD, ""); print_otag(h, TAG_CODE, "c", "Nm"); break; case ROFFT_BODY: print_otag(h, TAG_TD, ""); break; default: abort(); } return 1; } static int man_UR_pre(MAN_ARGS) { char *cp; n = n->child; assert(n->type == ROFFT_HEAD); if (n->child != NULL) { assert(n->child->type == ROFFT_TEXT); if (n->tok == MAN_MT) { mandoc_asprintf(&cp, "mailto:%s", n->child->string); print_otag(h, TAG_A, "ch", "Mt", cp); free(cp); } else print_otag(h, TAG_A, "ch", "Lk", n->child->string); } assert(n->next->type == ROFFT_BODY); if (n->next->child != NULL) n = n->next; print_man_nodelist(man, n->child, h); return 0; } static int man_abort_pre(MAN_ARGS) { abort(); } mandoc-1.14.6/man_macro.c010064400017530001753000000267471412314055300154670ustar00schwarzeschwarze/* $Id: man_macro.c,v 1.145 2020/09/09 17:01:10 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2012-2015, 2017-2020 Ingo Schwarze * Copyright (c) 2013 Franco Fichtner * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "man.h" #include "libmandoc.h" #include "roff_int.h" #include "libman.h" static void blk_close(MACRO_PROT_ARGS); static void blk_exp(MACRO_PROT_ARGS); static void blk_imp(MACRO_PROT_ARGS); static void in_line_eoln(MACRO_PROT_ARGS); static int man_args(struct roff_man *, int, int *, char *, char **); static void rew_scope(struct roff_man *, enum roff_tok); static const struct man_macro man_macros[MAN_MAX - MAN_TH] = { { in_line_eoln, MAN_XSCOPE }, /* TH */ { blk_imp, MAN_XSCOPE | MAN_BSCOPED }, /* SH */ { blk_imp, MAN_XSCOPE | MAN_BSCOPED }, /* SS */ { blk_imp, MAN_XSCOPE | MAN_BSCOPED }, /* TP */ { blk_imp, MAN_XSCOPE | MAN_BSCOPED }, /* TQ */ { blk_imp, MAN_XSCOPE }, /* LP */ { blk_imp, MAN_XSCOPE }, /* PP */ { blk_imp, MAN_XSCOPE }, /* P */ { blk_imp, MAN_XSCOPE }, /* IP */ { blk_imp, MAN_XSCOPE }, /* HP */ { in_line_eoln, MAN_NSCOPED | MAN_ESCOPED | MAN_JOIN }, /* SM */ { in_line_eoln, MAN_NSCOPED | MAN_ESCOPED | MAN_JOIN }, /* SB */ { in_line_eoln, 0 }, /* BI */ { in_line_eoln, 0 }, /* IB */ { in_line_eoln, 0 }, /* BR */ { in_line_eoln, 0 }, /* RB */ { in_line_eoln, MAN_NSCOPED | MAN_ESCOPED | MAN_JOIN }, /* R */ { in_line_eoln, MAN_NSCOPED | MAN_ESCOPED | MAN_JOIN }, /* B */ { in_line_eoln, MAN_NSCOPED | MAN_ESCOPED | MAN_JOIN }, /* I */ { in_line_eoln, 0 }, /* IR */ { in_line_eoln, 0 }, /* RI */ { blk_close, MAN_XSCOPE }, /* RE */ { blk_exp, MAN_XSCOPE }, /* RS */ { in_line_eoln, 0 }, /* DT */ { in_line_eoln, 0 }, /* UC */ { in_line_eoln, MAN_NSCOPED }, /* PD */ { in_line_eoln, 0 }, /* AT */ { in_line_eoln, MAN_NSCOPED }, /* in */ { blk_imp, MAN_XSCOPE }, /* SY */ { blk_close, MAN_XSCOPE }, /* YS */ { in_line_eoln, 0 }, /* OP */ { in_line_eoln, MAN_XSCOPE }, /* EX */ { in_line_eoln, MAN_XSCOPE }, /* EE */ { blk_exp, MAN_XSCOPE }, /* UR */ { blk_close, MAN_XSCOPE }, /* UE */ { blk_exp, MAN_XSCOPE }, /* MT */ { blk_close, MAN_XSCOPE }, /* ME */ }; const struct man_macro * man_macro(enum roff_tok tok) { assert(tok >= MAN_TH && tok <= MAN_MAX); return man_macros + (tok - MAN_TH); } void man_unscope(struct roff_man *man, const struct roff_node *to) { struct roff_node *n; to = to->parent; n = man->last; while (n != to) { /* Reached the end of the document? */ if (to == NULL && ! (n->flags & NODE_VALID)) { if (man->flags & (MAN_BLINE | MAN_ELINE) && man_macro(n->tok)->flags & (MAN_BSCOPED | MAN_NSCOPED)) { mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, "EOF breaks %s", roff_name[n->tok]); if (man->flags & MAN_ELINE) { if ((man_macro(n->parent->tok)->flags & MAN_ESCOPED) == 0) man->flags &= ~MAN_ELINE; } else { assert(n->type == ROFFT_HEAD); n = n->parent; man->flags &= ~MAN_BLINE; } man->last = n; n = n->parent; roff_node_delete(man, man->last); continue; } if (n->type == ROFFT_BLOCK && man_macro(n->tok)->fp == blk_exp) mandoc_msg(MANDOCERR_BLK_NOEND, n->line, n->pos, "%s", roff_name[n->tok]); } /* * We might delete the man->last node * in the post-validation phase. * Save a pointer to the parent such that * we know where to continue the iteration. */ man->last = n; n = n->parent; man->last->flags |= NODE_VALID; } /* * If we ended up at the parent of the node we were * supposed to rewind to, that means the target node * got deleted, so add the next node we parse as a child * of the parent instead of as a sibling of the target. */ man->next = (man->last == to) ? ROFF_NEXT_CHILD : ROFF_NEXT_SIBLING; } /* * Rewinding entails ascending the parse tree until a coherent point, * for example, the `SH' macro will close out any intervening `SS' * scopes. When a scope is closed, it must be validated and actioned. */ static void rew_scope(struct roff_man *man, enum roff_tok tok) { struct roff_node *n; /* Preserve empty paragraphs before RS. */ n = man->last; if (tok == MAN_RS && n->child == NULL && (n->tok == MAN_P || n->tok == MAN_PP || n->tok == MAN_LP)) return; for (;;) { if (n->type == ROFFT_ROOT) return; if (n->flags & NODE_VALID) { n = n->parent; continue; } if (n->type != ROFFT_BLOCK) { if (n->parent->type == ROFFT_ROOT) { man_unscope(man, n); return; } else { n = n->parent; continue; } } if (tok != MAN_SH && (n->tok == MAN_SH || (tok != MAN_SS && (n->tok == MAN_SS || man_macro(n->tok)->fp == blk_exp)))) return; man_unscope(man, n); n = man->last; } } /* * Close out a generic explicit macro. */ void blk_close(MACRO_PROT_ARGS) { enum roff_tok ctok, ntok; const struct roff_node *nn; char *p, *ep; int cline, cpos, la, nrew, target; nrew = 1; switch (tok) { case MAN_RE: ntok = MAN_RS; la = *pos; if ( ! man_args(man, line, pos, buf, &p)) break; for (nn = man->last->parent; nn; nn = nn->parent) if (nn->tok == ntok && nn->type == ROFFT_BLOCK) nrew++; target = strtol(p, &ep, 10); if (*ep != '\0') mandoc_msg(MANDOCERR_ARG_EXCESS, line, la + (buf[la] == '"') + (int)(ep - p), "RE ... %s", ep); free(p); if (target == 0) target = 1; nrew -= target; if (nrew < 1) { mandoc_msg(MANDOCERR_RE_NOTOPEN, line, ppos, "RE %d", target); return; } break; case MAN_YS: ntok = MAN_SY; break; case MAN_UE: ntok = MAN_UR; break; case MAN_ME: ntok = MAN_MT; break; default: abort(); } for (nn = man->last->parent; nn; nn = nn->parent) if (nn->tok == ntok && nn->type == ROFFT_BLOCK && ! --nrew) break; if (nn == NULL) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, line, ppos, "%s", roff_name[tok]); rew_scope(man, MAN_PP); if (tok == MAN_RE) { roff_elem_alloc(man, line, ppos, ROFF_br); man->last->flags |= NODE_LINE | NODE_VALID | NODE_ENDED; man->next = ROFF_NEXT_SIBLING; } return; } cline = man->last->line; cpos = man->last->pos; ctok = man->last->tok; man_unscope(man, nn); if (tok == MAN_RE && nn->head->aux > 0) roff_setreg(man->roff, "an-margin", nn->head->aux, '-'); /* Trailing text. */ if (buf[*pos] != '\0') { roff_word_alloc(man, line, ppos, buf + *pos); man->last->flags |= NODE_DELIMC; if (mandoc_eos(man->last->string, strlen(man->last->string))) man->last->flags |= NODE_EOS; } /* Move a trailing paragraph behind the block. */ if (ctok == MAN_LP || ctok == MAN_PP || ctok == MAN_P) { *pos = strlen(buf); blk_imp(man, ctok, cline, cpos, pos, buf); } /* Synopsis blocks need an explicit end marker for spacing. */ if (tok == MAN_YS && man->last == nn) { roff_elem_alloc(man, line, ppos, tok); man_unscope(man, man->last); } } void blk_exp(MACRO_PROT_ARGS) { struct roff_node *head; char *p; int la; if (tok == MAN_RS) { rew_scope(man, tok); man->flags |= ROFF_NONOFILL; } roff_block_alloc(man, line, ppos, tok); head = roff_head_alloc(man, line, ppos, tok); la = *pos; if (man_args(man, line, pos, buf, &p)) { roff_word_alloc(man, line, la, p); if (tok == MAN_RS) { if (roff_getreg(man->roff, "an-margin") == 0) roff_setreg(man->roff, "an-margin", 7 * 24, '='); if ((head->aux = strtod(p, NULL) * 24.0) > 0) roff_setreg(man->roff, "an-margin", head->aux, '+'); } free(p); } if (buf[*pos] != '\0') mandoc_msg(MANDOCERR_ARG_EXCESS, line, *pos, "%s ... %s", roff_name[tok], buf + *pos); man_unscope(man, head); roff_body_alloc(man, line, ppos, tok); man->flags &= ~ROFF_NONOFILL; } /* * Parse an implicit-block macro. These contain a ROFFT_HEAD and a * ROFFT_BODY contained within a ROFFT_BLOCK. Rules for closing out other * scopes, such as `SH' closing out an `SS', are defined in the rew * routines. */ void blk_imp(MACRO_PROT_ARGS) { int la; char *p; struct roff_node *n; rew_scope(man, tok); man->flags |= ROFF_NONOFILL; if (tok == MAN_SH || tok == MAN_SS) man->flags &= ~ROFF_NOFILL; roff_block_alloc(man, line, ppos, tok); n = roff_head_alloc(man, line, ppos, tok); /* Add line arguments. */ for (;;) { la = *pos; if ( ! man_args(man, line, pos, buf, &p)) break; roff_word_alloc(man, line, la, p); free(p); } /* * For macros having optional next-line scope, * keep the head open if there were no arguments. * For `TP' and `TQ', always keep the head open. */ if (man_macro(tok)->flags & MAN_BSCOPED && (tok == MAN_TP || tok == MAN_TQ || n == man->last)) { man->flags |= MAN_BLINE; return; } /* Close out the head and open the body. */ man_unscope(man, n); roff_body_alloc(man, line, ppos, tok); man->flags &= ~ROFF_NONOFILL; } void in_line_eoln(MACRO_PROT_ARGS) { int la; char *p; struct roff_node *n; roff_elem_alloc(man, line, ppos, tok); n = man->last; if (tok == MAN_EX) man->flags |= ROFF_NOFILL; else if (tok == MAN_EE) man->flags &= ~ROFF_NOFILL; for (;;) { if (buf[*pos] != '\0' && man->last != n && tok == MAN_PD) { mandoc_msg(MANDOCERR_ARG_EXCESS, line, *pos, "%s ... %s", roff_name[tok], buf + *pos); break; } la = *pos; if ( ! man_args(man, line, pos, buf, &p)) break; if (man_macro(tok)->flags & MAN_JOIN && man->last->type == ROFFT_TEXT) roff_word_append(man, p); else roff_word_alloc(man, line, la, p); free(p); } /* * Append NODE_EOS in case the last snipped argument * ends with a dot, e.g. `.IR syslog (3).' */ if (n != man->last && mandoc_eos(man->last->string, strlen(man->last->string))) man->last->flags |= NODE_EOS; /* * If no arguments are specified and this is MAN_ESCOPED (i.e., * next-line scoped), then set our mode to indicate that we're * waiting for terms to load into our context. */ if (n == man->last && man_macro(tok)->flags & MAN_ESCOPED) { man->flags |= MAN_ELINE; return; } assert(man->last->type != ROFFT_ROOT); man->next = ROFF_NEXT_SIBLING; /* Rewind our element scope. */ for ( ; man->last; man->last = man->last->parent) { man->last->flags |= NODE_VALID; if (man->last == n) break; } /* Rewind next-line scoped ancestors, if any. */ if (man_macro(tok)->flags & MAN_ESCOPED) man_descope(man, line, ppos, NULL); } void man_endparse(struct roff_man *man) { man_unscope(man, man->meta.first); } static int man_args(struct roff_man *man, int line, int *pos, char *buf, char **v) { char *start; assert(*pos); *v = start = buf + *pos; assert(' ' != *start); if ('\0' == *start) return 0; *v = roff_getarg(man->roff, v, line, pos); return 1; } mandoc-1.14.6/man_term.c010064400017530001753000000600541412314055300153220ustar00schwarzeschwarze/* $Id: man_term.c,v 1.236 2021/06/28 19:50:15 schwarze Exp $ */ /* * Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Plain text formatter for man(7), used by mandoc(1) * for ASCII, UTF-8, PostScript, and PDF output. */ #include "config.h" #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "man.h" #include "out.h" #include "term.h" #include "term_tag.h" #include "main.h" #define MAXMARGINS 64 /* maximum number of indented scopes */ struct mtermp { int lmargin[MAXMARGINS]; /* margins (incl. vis. page) */ int lmargincur; /* index of current margin */ int lmarginsz; /* actual number of nested margins */ size_t offset; /* default offset to visible page */ int pardist; /* vert. space before par., unit: [v] */ }; #define DECL_ARGS struct termp *p, \ struct mtermp *mt, \ struct roff_node *n, \ const struct roff_meta *meta struct man_term_act { int (*pre)(DECL_ARGS); void (*post)(DECL_ARGS); int flags; #define MAN_NOTEXT (1 << 0) /* Never has text children. */ }; static void print_man_nodelist(DECL_ARGS); static void print_man_node(DECL_ARGS); static void print_man_head(struct termp *, const struct roff_meta *); static void print_man_foot(struct termp *, const struct roff_meta *); static void print_bvspace(struct termp *, struct roff_node *, int); static int pre_B(DECL_ARGS); static int pre_DT(DECL_ARGS); static int pre_HP(DECL_ARGS); static int pre_I(DECL_ARGS); static int pre_IP(DECL_ARGS); static int pre_OP(DECL_ARGS); static int pre_PD(DECL_ARGS); static int pre_PP(DECL_ARGS); static int pre_RS(DECL_ARGS); static int pre_SH(DECL_ARGS); static int pre_SS(DECL_ARGS); static int pre_SY(DECL_ARGS); static int pre_TP(DECL_ARGS); static int pre_UR(DECL_ARGS); static int pre_abort(DECL_ARGS); static int pre_alternate(DECL_ARGS); static int pre_ign(DECL_ARGS); static int pre_in(DECL_ARGS); static int pre_literal(DECL_ARGS); static void post_IP(DECL_ARGS); static void post_HP(DECL_ARGS); static void post_RS(DECL_ARGS); static void post_SH(DECL_ARGS); static void post_SY(DECL_ARGS); static void post_TP(DECL_ARGS); static void post_UR(DECL_ARGS); static const struct man_term_act man_term_acts[MAN_MAX - MAN_TH] = { { NULL, NULL, 0 }, /* TH */ { pre_SH, post_SH, 0 }, /* SH */ { pre_SS, post_SH, 0 }, /* SS */ { pre_TP, post_TP, 0 }, /* TP */ { pre_TP, post_TP, 0 }, /* TQ */ { pre_abort, NULL, 0 }, /* LP */ { pre_PP, NULL, 0 }, /* PP */ { pre_abort, NULL, 0 }, /* P */ { pre_IP, post_IP, 0 }, /* IP */ { pre_HP, post_HP, 0 }, /* HP */ { NULL, NULL, 0 }, /* SM */ { pre_B, NULL, 0 }, /* SB */ { pre_alternate, NULL, 0 }, /* BI */ { pre_alternate, NULL, 0 }, /* IB */ { pre_alternate, NULL, 0 }, /* BR */ { pre_alternate, NULL, 0 }, /* RB */ { NULL, NULL, 0 }, /* R */ { pre_B, NULL, 0 }, /* B */ { pre_I, NULL, 0 }, /* I */ { pre_alternate, NULL, 0 }, /* IR */ { pre_alternate, NULL, 0 }, /* RI */ { NULL, NULL, 0 }, /* RE */ { pre_RS, post_RS, 0 }, /* RS */ { pre_DT, NULL, 0 }, /* DT */ { pre_ign, NULL, MAN_NOTEXT }, /* UC */ { pre_PD, NULL, MAN_NOTEXT }, /* PD */ { pre_ign, NULL, 0 }, /* AT */ { pre_in, NULL, MAN_NOTEXT }, /* in */ { pre_SY, post_SY, 0 }, /* SY */ { NULL, NULL, 0 }, /* YS */ { pre_OP, NULL, 0 }, /* OP */ { pre_literal, NULL, 0 }, /* EX */ { pre_literal, NULL, 0 }, /* EE */ { pre_UR, post_UR, 0 }, /* UR */ { NULL, NULL, 0 }, /* UE */ { pre_UR, post_UR, 0 }, /* MT */ { NULL, NULL, 0 }, /* ME */ }; static const struct man_term_act *man_term_act(enum roff_tok); static const struct man_term_act * man_term_act(enum roff_tok tok) { assert(tok >= MAN_TH && tok <= MAN_MAX); return man_term_acts + (tok - MAN_TH); } void terminal_man(void *arg, const struct roff_meta *man) { struct mtermp mt; struct termp *p; struct roff_node *n, *nc, *nn; size_t save_defindent; p = (struct termp *)arg; save_defindent = p->defindent; if (p->synopsisonly == 0 && p->defindent == 0) p->defindent = 7; p->tcol->rmargin = p->maxrmargin = p->defrmargin; term_tab_set(p, NULL); term_tab_set(p, "T"); term_tab_set(p, ".5i"); memset(&mt, 0, sizeof(mt)); mt.lmargin[mt.lmargincur] = term_len(p, p->defindent); mt.offset = term_len(p, p->defindent); mt.pardist = 1; n = man->first->child; if (p->synopsisonly) { for (nn = NULL; n != NULL; n = n->next) { if (n->tok != MAN_SH) continue; nc = n->child->child; if (nc->type != ROFFT_TEXT) continue; if (strcmp(nc->string, "SYNOPSIS") == 0) break; if (nn == NULL && strcmp(nc->string, "NAME") == 0) nn = n; } if (n == NULL) n = nn; p->flags |= TERMP_NOSPACE; if (n != NULL && (n = n->child->next->child) != NULL) print_man_nodelist(p, &mt, n, man); term_newln(p); } else { term_begin(p, print_man_head, print_man_foot, man); p->flags |= TERMP_NOSPACE; if (n != NULL) print_man_nodelist(p, &mt, n, man); term_end(p); } p->defindent = save_defindent; } /* * Printing leading vertical space before a block. * This is used for the paragraph macros. * The rules are pretty simple, since there's very little nesting going * on here. Basically, if we're the first within another block (SS/SH), * then don't emit vertical space. If we are (RS), then do. If not the * first, print it. */ static void print_bvspace(struct termp *p, struct roff_node *n, int pardist) { struct roff_node *nch; int i; term_newln(p); if (n->body != NULL && (nch = roff_node_child(n->body)) != NULL && nch->type == ROFFT_TBL) return; if (n->parent->tok != MAN_RS && roff_node_prev(n) == NULL) return; for (i = 0; i < pardist; i++) term_vspace(p); } static int pre_abort(DECL_ARGS) { abort(); } static int pre_ign(DECL_ARGS) { return 0; } static int pre_I(DECL_ARGS) { term_fontrepl(p, TERMFONT_UNDER); return 1; } static int pre_literal(DECL_ARGS) { term_newln(p); /* * Unlike .IP and .TP, .HP does not have a HEAD. * So in case a second call to term_flushln() is needed, * indentation has to be set up explicitly. */ if (n->parent->tok == MAN_HP && p->tcol->rmargin < p->maxrmargin) { p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin; p->trailspace = 0; p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); p->flags |= TERMP_NOSPACE; } return 0; } static int pre_PD(DECL_ARGS) { struct roffsu su; n = n->child; if (n == NULL) { mt->pardist = 1; return 0; } assert(n->type == ROFFT_TEXT); if (a2roffsu(n->string, &su, SCALE_VS) != NULL) mt->pardist = term_vspan(p, &su); return 0; } static int pre_alternate(DECL_ARGS) { enum termfont font[2]; struct roff_node *nn; int i; switch (n->tok) { case MAN_RB: font[0] = TERMFONT_NONE; font[1] = TERMFONT_BOLD; break; case MAN_RI: font[0] = TERMFONT_NONE; font[1] = TERMFONT_UNDER; break; case MAN_BR: font[0] = TERMFONT_BOLD; font[1] = TERMFONT_NONE; break; case MAN_BI: font[0] = TERMFONT_BOLD; font[1] = TERMFONT_UNDER; break; case MAN_IR: font[0] = TERMFONT_UNDER; font[1] = TERMFONT_NONE; break; case MAN_IB: font[0] = TERMFONT_UNDER; font[1] = TERMFONT_BOLD; break; default: abort(); } for (i = 0, nn = n->child; nn != NULL; nn = nn->next, i = 1 - i) { term_fontrepl(p, font[i]); assert(nn->type == ROFFT_TEXT); term_word(p, nn->string); if (nn->flags & NODE_EOS) p->flags |= TERMP_SENTENCE; if (nn->next != NULL) p->flags |= TERMP_NOSPACE; } return 0; } static int pre_B(DECL_ARGS) { term_fontrepl(p, TERMFONT_BOLD); return 1; } static int pre_OP(DECL_ARGS) { term_word(p, "["); p->flags |= TERMP_KEEP | TERMP_NOSPACE; if ((n = n->child) != NULL) { term_fontrepl(p, TERMFONT_BOLD); term_word(p, n->string); } if (n != NULL && n->next != NULL) { term_fontrepl(p, TERMFONT_UNDER); term_word(p, n->next->string); } term_fontrepl(p, TERMFONT_NONE); p->flags &= ~TERMP_KEEP; p->flags |= TERMP_NOSPACE; term_word(p, "]"); return 0; } static int pre_in(DECL_ARGS) { struct roffsu su; const char *cp; size_t v; int less; term_newln(p); if (n->child == NULL) { p->tcol->offset = mt->offset; return 0; } cp = n->child->string; less = 0; if (*cp == '-') less = -1; else if (*cp == '+') less = 1; else cp--; if (a2roffsu(++cp, &su, SCALE_EN) == NULL) return 0; v = term_hen(p, &su); if (less < 0) p->tcol->offset -= p->tcol->offset > v ? v : p->tcol->offset; else if (less > 0) p->tcol->offset += v; else p->tcol->offset = v; if (p->tcol->offset > SHRT_MAX) p->tcol->offset = term_len(p, p->defindent); return 0; } static int pre_DT(DECL_ARGS) { term_tab_set(p, NULL); term_tab_set(p, "T"); term_tab_set(p, ".5i"); return 0; } static int pre_HP(DECL_ARGS) { struct roffsu su; const struct roff_node *nn; int len; switch (n->type) { case ROFFT_BLOCK: print_bvspace(p, n, mt->pardist); return 1; case ROFFT_HEAD: return 0; case ROFFT_BODY: break; default: abort(); } if (n->child == NULL) return 0; if ((n->child->flags & NODE_NOFILL) == 0) { p->flags |= TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 2; } /* Calculate offset. */ if ((nn = n->parent->head->child) != NULL && a2roffsu(nn->string, &su, SCALE_EN) != NULL) { len = term_hen(p, &su); if (len < 0 && (size_t)(-len) > mt->offset) len = -mt->offset; else if (len > SHRT_MAX) len = term_len(p, p->defindent); mt->lmargin[mt->lmargincur] = len; } else len = mt->lmargin[mt->lmargincur]; p->tcol->offset = mt->offset; p->tcol->rmargin = mt->offset + len; return 1; } static void post_HP(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: case ROFFT_HEAD: break; case ROFFT_BODY: term_newln(p); /* * Compatibility with a groff bug. * The .HP macro uses the undocumented .tag request * which causes a line break and cancels no-space * mode even if there isn't any output. */ if (n->child == NULL) term_vspace(p); p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); p->trailspace = 0; p->tcol->offset = mt->offset; p->tcol->rmargin = p->maxrmargin; break; default: abort(); } } static int pre_PP(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: mt->lmargin[mt->lmargincur] = term_len(p, p->defindent); print_bvspace(p, n, mt->pardist); break; case ROFFT_HEAD: return 0; case ROFFT_BODY: p->tcol->offset = mt->offset; break; default: abort(); } return 1; } static int pre_IP(DECL_ARGS) { struct roffsu su; const struct roff_node *nn; int len; switch (n->type) { case ROFFT_BLOCK: print_bvspace(p, n, mt->pardist); return 1; case ROFFT_HEAD: p->flags |= TERMP_NOBREAK; p->trailspace = 1; break; case ROFFT_BODY: p->flags |= TERMP_NOSPACE; break; default: abort(); } /* Calculate the offset from the optional second argument. */ if ((nn = n->parent->head->child) != NULL && (nn = nn->next) != NULL && a2roffsu(nn->string, &su, SCALE_EN) != NULL) { len = term_hen(p, &su); if (len < 0 && (size_t)(-len) > mt->offset) len = -mt->offset; else if (len > SHRT_MAX) len = term_len(p, p->defindent); mt->lmargin[mt->lmargincur] = len; } else len = mt->lmargin[mt->lmargincur]; switch (n->type) { case ROFFT_HEAD: p->tcol->offset = mt->offset; p->tcol->rmargin = mt->offset + len; if (n->child != NULL) print_man_node(p, mt, n->child, meta); return 0; case ROFFT_BODY: p->tcol->offset = mt->offset + len; p->tcol->rmargin = p->maxrmargin; break; default: abort(); } return 1; } static void post_IP(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: break; case ROFFT_HEAD: term_flushln(p); p->flags &= ~TERMP_NOBREAK; p->trailspace = 0; p->tcol->rmargin = p->maxrmargin; break; case ROFFT_BODY: term_newln(p); p->tcol->offset = mt->offset; break; default: abort(); } } static int pre_TP(DECL_ARGS) { struct roffsu su; struct roff_node *nn; int len; switch (n->type) { case ROFFT_BLOCK: if (n->tok == MAN_TP) print_bvspace(p, n, mt->pardist); return 1; case ROFFT_HEAD: p->flags |= TERMP_NOBREAK | TERMP_BRTRSP; p->trailspace = 1; break; case ROFFT_BODY: p->flags |= TERMP_NOSPACE; break; default: abort(); } /* Calculate offset. */ if ((nn = n->parent->head->child) != NULL && nn->string != NULL && ! (NODE_LINE & nn->flags) && a2roffsu(nn->string, &su, SCALE_EN) != NULL) { len = term_hen(p, &su); if (len < 0 && (size_t)(-len) > mt->offset) len = -mt->offset; else if (len > SHRT_MAX) len = term_len(p, p->defindent); mt->lmargin[mt->lmargincur] = len; } else len = mt->lmargin[mt->lmargincur]; switch (n->type) { case ROFFT_HEAD: p->tcol->offset = mt->offset; p->tcol->rmargin = mt->offset + len; /* Don't print same-line elements. */ nn = n->child; while (nn != NULL && (nn->flags & NODE_LINE) == 0) nn = nn->next; while (nn != NULL) { print_man_node(p, mt, nn, meta); nn = nn->next; } return 0; case ROFFT_BODY: p->tcol->offset = mt->offset + len; p->tcol->rmargin = p->maxrmargin; p->trailspace = 0; p->flags &= ~(TERMP_NOBREAK | TERMP_BRTRSP); break; default: abort(); } return 1; } static void post_TP(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: break; case ROFFT_HEAD: term_flushln(p); break; case ROFFT_BODY: term_newln(p); p->tcol->offset = mt->offset; break; default: abort(); } } static int pre_SS(DECL_ARGS) { int i; switch (n->type) { case ROFFT_BLOCK: mt->lmargin[mt->lmargincur] = term_len(p, p->defindent); mt->offset = term_len(p, p->defindent); /* * No vertical space before the first subsection * and after an empty subsection. */ if ((n = roff_node_prev(n)) == NULL || (n->tok == MAN_SS && roff_node_child(n->body) == NULL)) break; for (i = 0; i < mt->pardist; i++) term_vspace(p); break; case ROFFT_HEAD: term_fontrepl(p, TERMFONT_BOLD); p->tcol->offset = term_len(p, 3); p->tcol->rmargin = mt->offset; p->trailspace = mt->offset; p->flags |= TERMP_NOBREAK | TERMP_BRIND; break; case ROFFT_BODY: p->tcol->offset = mt->offset; p->tcol->rmargin = p->maxrmargin; p->trailspace = 0; p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); break; default: break; } return 1; } static int pre_SH(DECL_ARGS) { int i; switch (n->type) { case ROFFT_BLOCK: mt->lmargin[mt->lmargincur] = term_len(p, p->defindent); mt->offset = term_len(p, p->defindent); /* * No vertical space before the first section * and after an empty section. */ if ((n = roff_node_prev(n)) == NULL || (n->tok == MAN_SH && roff_node_child(n->body) == NULL)) break; for (i = 0; i < mt->pardist; i++) term_vspace(p); break; case ROFFT_HEAD: term_fontrepl(p, TERMFONT_BOLD); p->tcol->offset = 0; p->tcol->rmargin = mt->offset; p->trailspace = mt->offset; p->flags |= TERMP_NOBREAK | TERMP_BRIND; break; case ROFFT_BODY: p->tcol->offset = mt->offset; p->tcol->rmargin = p->maxrmargin; p->trailspace = 0; p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); break; default: abort(); } return 1; } static void post_SH(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: break; case ROFFT_HEAD: case ROFFT_BODY: term_newln(p); break; default: abort(); } } static int pre_RS(DECL_ARGS) { struct roffsu su; switch (n->type) { case ROFFT_BLOCK: term_newln(p); return 1; case ROFFT_HEAD: return 0; case ROFFT_BODY: break; default: abort(); } n = n->parent->head; n->aux = SHRT_MAX + 1; if (n->child == NULL) n->aux = mt->lmargin[mt->lmargincur]; else if (a2roffsu(n->child->string, &su, SCALE_EN) != NULL) n->aux = term_hen(p, &su); if (n->aux < 0 && (size_t)(-n->aux) > mt->offset) n->aux = -mt->offset; else if (n->aux > SHRT_MAX) n->aux = term_len(p, p->defindent); mt->offset += n->aux; p->tcol->offset = mt->offset; p->tcol->rmargin = p->maxrmargin; if (++mt->lmarginsz < MAXMARGINS) mt->lmargincur = mt->lmarginsz; mt->lmargin[mt->lmargincur] = term_len(p, p->defindent); return 1; } static void post_RS(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: case ROFFT_HEAD: return; case ROFFT_BODY: break; default: abort(); } term_newln(p); mt->offset -= n->parent->head->aux; p->tcol->offset = mt->offset; if (--mt->lmarginsz < MAXMARGINS) mt->lmargincur = mt->lmarginsz; } static int pre_SY(DECL_ARGS) { const struct roff_node *nn; int len; switch (n->type) { case ROFFT_BLOCK: if ((nn = roff_node_prev(n)) == NULL || nn->tok != MAN_SY) print_bvspace(p, n, mt->pardist); return 1; case ROFFT_HEAD: case ROFFT_BODY: break; default: abort(); } nn = n->parent->head->child; len = nn == NULL ? 1 : term_strlen(p, nn->string) + 1; switch (n->type) { case ROFFT_HEAD: p->tcol->offset = mt->offset; p->tcol->rmargin = mt->offset + len; if (n->next->child == NULL || (n->next->child->flags & NODE_NOFILL) == 0) p->flags |= TERMP_NOBREAK; term_fontrepl(p, TERMFONT_BOLD); break; case ROFFT_BODY: mt->lmargin[mt->lmargincur] = len; p->tcol->offset = mt->offset + len; p->tcol->rmargin = p->maxrmargin; p->flags |= TERMP_NOSPACE; break; default: abort(); } return 1; } static void post_SY(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: break; case ROFFT_HEAD: term_flushln(p); p->flags &= ~TERMP_NOBREAK; break; case ROFFT_BODY: term_newln(p); p->tcol->offset = mt->offset; break; default: abort(); } } static int pre_UR(DECL_ARGS) { return n->type != ROFFT_HEAD; } static void post_UR(DECL_ARGS) { if (n->type != ROFFT_BLOCK) return; term_word(p, "<"); p->flags |= TERMP_NOSPACE; if (n->child->child != NULL) print_man_node(p, mt, n->child->child, meta); p->flags |= TERMP_NOSPACE; term_word(p, ">"); } static void print_man_node(DECL_ARGS) { const struct man_term_act *act; int c; if (n->flags & NODE_ID) term_tag_write(n, p->line); switch (n->type) { case ROFFT_TEXT: /* * If we have a blank line, output a vertical space. * If we have a space as the first character, break * before printing the line's data. */ if (*n->string == '\0') { if (p->flags & TERMP_NONEWLINE) term_newln(p); else term_vspace(p); return; } else if (*n->string == ' ' && n->flags & NODE_LINE && (p->flags & TERMP_NONEWLINE) == 0) term_newln(p); else if (n->flags & NODE_DELIMC) p->flags |= TERMP_NOSPACE; term_word(p, n->string); goto out; case ROFFT_COMMENT: return; case ROFFT_EQN: if ( ! (n->flags & NODE_LINE)) p->flags |= TERMP_NOSPACE; term_eqn(p, n->eqn); if (n->next != NULL && ! (n->next->flags & NODE_LINE)) p->flags |= TERMP_NOSPACE; return; case ROFFT_TBL: if (p->tbl.cols == NULL) term_vspace(p); term_tbl(p, n->span); return; default: break; } if (n->tok < ROFF_MAX) { roff_term_pre(p, n); return; } act = man_term_act(n->tok); if ((act->flags & MAN_NOTEXT) == 0 && n->tok != MAN_SM) term_fontrepl(p, TERMFONT_NONE); c = 1; if (act->pre != NULL) c = (*act->pre)(p, mt, n, meta); if (c && n->child != NULL) print_man_nodelist(p, mt, n->child, meta); if (act->post != NULL) (*act->post)(p, mt, n, meta); if ((act->flags & MAN_NOTEXT) == 0 && n->tok != MAN_SM) term_fontrepl(p, TERMFONT_NONE); out: /* * If we're in a literal context, make sure that words * together on the same line stay together. This is a * POST-printing call, so we check the NEXT word. Since * -man doesn't have nested macros, we don't need to be * more specific than this. */ if (n->flags & NODE_NOFILL && ! (p->flags & (TERMP_NOBREAK | TERMP_NONEWLINE)) && (n->next == NULL || n->next->flags & NODE_LINE)) { p->flags |= TERMP_BRNEVER | TERMP_NOSPACE; if (n->string != NULL && *n->string != '\0') term_flushln(p); else term_newln(p); p->flags &= ~TERMP_BRNEVER; if (p->tcol->rmargin < p->maxrmargin && n->parent->tok == MAN_HP) { p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin; } } if (n->flags & NODE_EOS) p->flags |= TERMP_SENTENCE; } static void print_man_nodelist(DECL_ARGS) { while (n != NULL) { print_man_node(p, mt, n, meta); n = n->next; } } static void print_man_foot(struct termp *p, const struct roff_meta *meta) { char *title; size_t datelen, titlen; assert(meta->title); assert(meta->msec); assert(meta->date); term_fontrepl(p, TERMFONT_NONE); if (meta->hasbody) term_vspace(p); /* * Temporary, undocumented option to imitate mdoc(7) output. * In the bottom right corner, use the operating system * instead of the title. */ if ( ! p->mdocstyle) { mandoc_asprintf(&title, "%s(%s)", meta->title, meta->msec); } else if (meta->os != NULL) { title = mandoc_strdup(meta->os); } else { title = mandoc_strdup(""); } datelen = term_strlen(p, meta->date); /* Bottom left corner: operating system. */ p->flags |= TERMP_NOSPACE | TERMP_NOBREAK; p->trailspace = 1; p->tcol->offset = 0; p->tcol->rmargin = p->maxrmargin > datelen ? (p->maxrmargin + term_len(p, 1) - datelen) / 2 : 0; if (meta->os) term_word(p, meta->os); term_flushln(p); /* At the bottom in the middle: manual date. */ p->tcol->offset = p->tcol->rmargin; titlen = term_strlen(p, title); p->tcol->rmargin = p->maxrmargin > titlen ? p->maxrmargin - titlen : 0; p->flags |= TERMP_NOSPACE; term_word(p, meta->date); term_flushln(p); /* Bottom right corner: manual title and section. */ p->flags &= ~TERMP_NOBREAK; p->flags |= TERMP_NOSPACE; p->trailspace = 0; p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin; term_word(p, title); term_flushln(p); /* * Reset the terminal state for more output after the footer: * Some output modes, in particular PostScript and PDF, print * the header and the footer into a buffer such that it can be * reused for multiple output pages, then go on to format the * main text. */ p->tcol->offset = 0; p->flags = 0; free(title); } static void print_man_head(struct termp *p, const struct roff_meta *meta) { const char *volume; char *title; size_t vollen, titlen; assert(meta->title); assert(meta->msec); volume = NULL == meta->vol ? "" : meta->vol; vollen = term_strlen(p, volume); /* Top left corner: manual title and section. */ mandoc_asprintf(&title, "%s(%s)", meta->title, meta->msec); titlen = term_strlen(p, title); p->flags |= TERMP_NOBREAK | TERMP_NOSPACE; p->trailspace = 1; p->tcol->offset = 0; p->tcol->rmargin = 2 * (titlen+1) + vollen < p->maxrmargin ? (p->maxrmargin - vollen + term_len(p, 1)) / 2 : vollen < p->maxrmargin ? p->maxrmargin - vollen : 0; term_word(p, title); term_flushln(p); /* At the top in the middle: manual volume. */ p->flags |= TERMP_NOSPACE; p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->tcol->offset + vollen + titlen < p->maxrmargin ? p->maxrmargin - titlen : p->maxrmargin; term_word(p, volume); term_flushln(p); /* Top right corner: title and section, again. */ p->flags &= ~TERMP_NOBREAK; p->trailspace = 0; if (p->tcol->rmargin + titlen <= p->maxrmargin) { p->flags |= TERMP_NOSPACE; p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin; term_word(p, title); term_flushln(p); } p->flags &= ~TERMP_NOSPACE; p->tcol->offset = 0; p->tcol->rmargin = p->maxrmargin; /* * Groff prints three blank lines before the content. * Do the same, except in the temporary, undocumented * mode imitating mdoc(7) output. */ term_vspace(p); free(title); } mandoc-1.14.6/man_validate.c010064400017530001753000000340711412314055300161440ustar00schwarzeschwarze/* $Id: man_validate.c,v 1.156 2021/08/10 12:55:03 schwarze Exp $ */ /* * Copyright (c) 2010, 2012-2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Validation module for man(7) syntax trees used by mandoc(1). */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "man.h" #include "libmandoc.h" #include "roff_int.h" #include "libman.h" #include "tag.h" #define CHKARGS struct roff_man *man, struct roff_node *n typedef void (*v_check)(CHKARGS); static void check_abort(CHKARGS) __attribute__((__noreturn__)); static void check_par(CHKARGS); static void check_part(CHKARGS); static void check_root(CHKARGS); static void check_tag(struct roff_node *, struct roff_node *); static void check_text(CHKARGS); static void post_AT(CHKARGS); static void post_EE(CHKARGS); static void post_EX(CHKARGS); static void post_IP(CHKARGS); static void post_OP(CHKARGS); static void post_SH(CHKARGS); static void post_TH(CHKARGS); static void post_TP(CHKARGS); static void post_UC(CHKARGS); static void post_UR(CHKARGS); static void post_in(CHKARGS); static const v_check man_valids[MAN_MAX - MAN_TH] = { post_TH, /* TH */ post_SH, /* SH */ post_SH, /* SS */ post_TP, /* TP */ post_TP, /* TQ */ check_abort,/* LP */ check_par, /* PP */ check_abort,/* P */ post_IP, /* IP */ NULL, /* HP */ NULL, /* SM */ NULL, /* SB */ NULL, /* BI */ NULL, /* IB */ NULL, /* BR */ NULL, /* RB */ NULL, /* R */ NULL, /* B */ NULL, /* I */ NULL, /* IR */ NULL, /* RI */ NULL, /* RE */ check_part, /* RS */ NULL, /* DT */ post_UC, /* UC */ NULL, /* PD */ post_AT, /* AT */ post_in, /* in */ NULL, /* SY */ NULL, /* YS */ post_OP, /* OP */ post_EX, /* EX */ post_EE, /* EE */ post_UR, /* UR */ NULL, /* UE */ post_UR, /* MT */ NULL, /* ME */ }; /* Validate the subtree rooted at man->last. */ void man_validate(struct roff_man *man) { struct roff_node *n; const v_check *cp; /* * Translate obsolete macros such that later code * does not need to look for them. */ n = man->last; switch (n->tok) { case MAN_LP: case MAN_P: n->tok = MAN_PP; break; default: break; } /* * Iterate over all children, recursing into each one * in turn, depth-first. */ man->last = man->last->child; while (man->last != NULL) { man_validate(man); if (man->last == n) man->last = man->last->child; else man->last = man->last->next; } /* Finally validate the macro itself. */ man->last = n; man->next = ROFF_NEXT_SIBLING; switch (n->type) { case ROFFT_TEXT: check_text(man, n); break; case ROFFT_ROOT: check_root(man, n); break; case ROFFT_COMMENT: case ROFFT_EQN: case ROFFT_TBL: break; default: if (n->tok < ROFF_MAX) { roff_validate(man); break; } assert(n->tok >= MAN_TH && n->tok < MAN_MAX); cp = man_valids + (n->tok - MAN_TH); if (*cp) (*cp)(man, n); if (man->last == n) n->flags |= NODE_VALID; break; } } static void check_root(CHKARGS) { assert((man->flags & (MAN_BLINE | MAN_ELINE)) == 0); if (n->last == NULL || n->last->type == ROFFT_COMMENT) mandoc_msg(MANDOCERR_DOC_EMPTY, n->line, n->pos, NULL); else man->meta.hasbody = 1; if (NULL == man->meta.title) { mandoc_msg(MANDOCERR_TH_NOTITLE, n->line, n->pos, NULL); /* * If a title hasn't been set, do so now (by * implication, date and section also aren't set). */ man->meta.title = mandoc_strdup(""); man->meta.msec = mandoc_strdup(""); man->meta.date = mandoc_normdate(NULL, NULL); } if (man->meta.os_e && (man->meta.rcsids & (1 << man->meta.os_e)) == 0) mandoc_msg(MANDOCERR_RCS_MISSING, 0, 0, man->meta.os_e == MANDOC_OS_OPENBSD ? "(OpenBSD)" : "(NetBSD)"); } static void check_abort(CHKARGS) { abort(); } /* * Skip leading whitespace, dashes, backslashes, and font escapes, * then create a tag if the first following byte is a letter. * Priority is high unless whitespace is present. */ static void check_tag(struct roff_node *n, struct roff_node *nt) { const char *cp, *arg; int prio, sz; if (nt == NULL || nt->type != ROFFT_TEXT) return; cp = nt->string; prio = TAG_STRONG; for (;;) { switch (*cp) { case ' ': case '\t': prio = TAG_WEAK; /* FALLTHROUGH */ case '-': cp++; break; case '\\': cp++; switch (mandoc_escape(&cp, &arg, &sz)) { case ESCAPE_FONT: case ESCAPE_FONTBOLD: case ESCAPE_FONTITALIC: case ESCAPE_FONTBI: case ESCAPE_FONTROMAN: case ESCAPE_FONTCR: case ESCAPE_FONTCB: case ESCAPE_FONTCI: case ESCAPE_FONTPREV: case ESCAPE_IGNORE: break; case ESCAPE_SPECIAL: if (sz != 1) return; switch (*arg) { case '-': case 'e': break; default: return; } break; default: return; } break; default: if (isalpha((unsigned char)*cp)) tag_put(cp, prio, n); return; } } } static void check_text(CHKARGS) { char *cp, *p; if (n->flags & NODE_NOFILL) return; cp = n->string; for (p = cp; NULL != (p = strchr(p, '\t')); p++) mandoc_msg(MANDOCERR_FI_TAB, n->line, n->pos + (int)(p - cp), NULL); } static void post_EE(CHKARGS) { if ((n->flags & NODE_NOFILL) == 0) mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "EE"); } static void post_EX(CHKARGS) { if (n->flags & NODE_NOFILL) mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "EX"); } static void post_OP(CHKARGS) { if (n->child == NULL) mandoc_msg(MANDOCERR_OP_EMPTY, n->line, n->pos, "OP"); else if (n->child->next != NULL && n->child->next->next != NULL) { n = n->child->next->next; mandoc_msg(MANDOCERR_ARG_EXCESS, n->line, n->pos, "OP ... %s", n->string); } } static void post_SH(CHKARGS) { struct roff_node *nc; char *cp, *tag; nc = n->child; switch (n->type) { case ROFFT_HEAD: tag = NULL; deroff(&tag, n); if (tag != NULL) { for (cp = tag; *cp != '\0'; cp++) if (*cp == ' ') *cp = '_'; if (nc != NULL && nc->type == ROFFT_TEXT && strcmp(nc->string, tag) == 0) tag_put(NULL, TAG_STRONG, n); else tag_put(tag, TAG_FALLBACK, n); free(tag); } return; case ROFFT_BODY: if (nc != NULL) break; return; default: return; } if (nc->tok == MAN_PP && nc->body->child != NULL) { while (nc->body->last != NULL) { man->next = ROFF_NEXT_CHILD; roff_node_relink(man, nc->body->last); man->last = n; } } if (nc->tok == MAN_PP || nc->tok == ROFF_sp || nc->tok == ROFF_br) { mandoc_msg(MANDOCERR_PAR_SKIP, nc->line, nc->pos, "%s after %s", roff_name[nc->tok], roff_name[n->tok]); roff_node_delete(man, nc); } /* * Trailing PP is empty, so it is deleted by check_par(). * Trailing sp is significant. */ if ((nc = n->last) != NULL && nc->tok == ROFF_br) { mandoc_msg(MANDOCERR_PAR_SKIP, nc->line, nc->pos, "%s at the end of %s", roff_name[nc->tok], roff_name[n->tok]); roff_node_delete(man, nc); } } static void post_UR(CHKARGS) { if (n->type == ROFFT_HEAD && n->child == NULL) mandoc_msg(MANDOCERR_UR_NOHEAD, n->line, n->pos, "%s", roff_name[n->tok]); check_part(man, n); } static void check_part(CHKARGS) { if (n->type == ROFFT_BODY && n->child == NULL) mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, "%s", roff_name[n->tok]); } static void check_par(CHKARGS) { switch (n->type) { case ROFFT_BLOCK: if (n->body->child == NULL) roff_node_delete(man, n); break; case ROFFT_BODY: if (n->child != NULL && (n->child->tok == ROFF_sp || n->child->tok == ROFF_br)) { mandoc_msg(MANDOCERR_PAR_SKIP, n->child->line, n->child->pos, "%s after %s", roff_name[n->child->tok], roff_name[n->tok]); roff_node_delete(man, n->child); } if (n->child == NULL) mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, "%s empty", roff_name[n->tok]); break; case ROFFT_HEAD: if (n->child != NULL) mandoc_msg(MANDOCERR_ARG_SKIP, n->line, n->pos, "%s %s%s", roff_name[n->tok], n->child->string, n->child->next != NULL ? " ..." : ""); break; default: break; } } static void post_IP(CHKARGS) { switch (n->type) { case ROFFT_BLOCK: if (n->head->child == NULL && n->body->child == NULL) roff_node_delete(man, n); break; case ROFFT_HEAD: check_tag(n, n->child); break; case ROFFT_BODY: if (n->parent->head->child == NULL && n->child == NULL) mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, "%s empty", roff_name[n->tok]); break; default: break; } } /* * The first next-line element in the head is the tag. * If that's a font macro, use its first child instead. */ static void post_TP(CHKARGS) { struct roff_node *nt; if (n->type != ROFFT_HEAD || (nt = n->child) == NULL) return; while ((nt->flags & NODE_LINE) == 0) if ((nt = nt->next) == NULL) return; switch (nt->tok) { case MAN_B: case MAN_BI: case MAN_BR: case MAN_I: case MAN_IB: case MAN_IR: nt = nt->child; break; default: break; } check_tag(n, nt); } static void post_TH(CHKARGS) { struct roff_node *nb; const char *p; free(man->meta.title); free(man->meta.vol); free(man->meta.os); free(man->meta.msec); free(man->meta.date); man->meta.title = man->meta.vol = man->meta.date = man->meta.msec = man->meta.os = NULL; nb = n; /* ->TITLE<- MSEC DATE OS VOL */ n = n->child; if (n != NULL && n->string != NULL) { for (p = n->string; *p != '\0'; p++) { /* Only warn about this once... */ if (isalpha((unsigned char)*p) && ! isupper((unsigned char)*p)) { mandoc_msg(MANDOCERR_TITLE_CASE, n->line, n->pos + (int)(p - n->string), "TH %s", n->string); break; } } man->meta.title = mandoc_strdup(n->string); } else { man->meta.title = mandoc_strdup(""); mandoc_msg(MANDOCERR_TH_NOTITLE, nb->line, nb->pos, "TH"); } /* TITLE ->MSEC<- DATE OS VOL */ if (n != NULL) n = n->next; if (n != NULL && n->string != NULL) { man->meta.msec = mandoc_strdup(n->string); if (man->filesec != '\0' && man->filesec != *n->string && *n->string >= '1' && *n->string <= '9') mandoc_msg(MANDOCERR_MSEC_FILE, n->line, n->pos, "*.%c vs TH ... %c", man->filesec, *n->string); } else { man->meta.msec = mandoc_strdup(""); mandoc_msg(MANDOCERR_MSEC_MISSING, nb->line, nb->pos, "TH %s", man->meta.title); } /* TITLE MSEC ->DATE<- OS VOL */ if (n != NULL) n = n->next; if (man->quick && n != NULL) man->meta.date = mandoc_strdup(""); else man->meta.date = mandoc_normdate(n, nb); /* TITLE MSEC DATE ->OS<- VOL */ if (n && (n = n->next)) man->meta.os = mandoc_strdup(n->string); else if (man->os_s != NULL) man->meta.os = mandoc_strdup(man->os_s); if (man->meta.os_e == MANDOC_OS_OTHER && man->meta.os != NULL) { if (strstr(man->meta.os, "OpenBSD") != NULL) man->meta.os_e = MANDOC_OS_OPENBSD; else if (strstr(man->meta.os, "NetBSD") != NULL) man->meta.os_e = MANDOC_OS_NETBSD; } /* TITLE MSEC DATE OS ->VOL<- */ /* If missing, use the default VOL name for MSEC. */ if (n && (n = n->next)) man->meta.vol = mandoc_strdup(n->string); else if ('\0' != man->meta.msec[0] && (NULL != (p = mandoc_a2msec(man->meta.msec)))) man->meta.vol = mandoc_strdup(p); if (n != NULL && (n = n->next) != NULL) mandoc_msg(MANDOCERR_ARG_EXCESS, n->line, n->pos, "TH ... %s", n->string); /* * Remove the `TH' node after we've processed it for our * meta-data. */ roff_node_delete(man, man->last); } static void post_UC(CHKARGS) { static const char * const bsd_versions[] = { "3rd Berkeley Distribution", "4th Berkeley Distribution", "4.2 Berkeley Distribution", "4.3 Berkeley Distribution", "4.4 Berkeley Distribution", }; const char *p, *s; n = n->child; if (n == NULL || n->type != ROFFT_TEXT) p = bsd_versions[0]; else { s = n->string; if (0 == strcmp(s, "3")) p = bsd_versions[0]; else if (0 == strcmp(s, "4")) p = bsd_versions[1]; else if (0 == strcmp(s, "5")) p = bsd_versions[2]; else if (0 == strcmp(s, "6")) p = bsd_versions[3]; else if (0 == strcmp(s, "7")) p = bsd_versions[4]; else p = bsd_versions[0]; } free(man->meta.os); man->meta.os = mandoc_strdup(p); } static void post_AT(CHKARGS) { static const char * const unix_versions[] = { "7th Edition", "System III", "System V", "System V Release 2", }; struct roff_node *nn; const char *p, *s; n = n->child; if (n == NULL || n->type != ROFFT_TEXT) p = unix_versions[0]; else { s = n->string; if (0 == strcmp(s, "3")) p = unix_versions[0]; else if (0 == strcmp(s, "4")) p = unix_versions[1]; else if (0 == strcmp(s, "5")) { nn = n->next; if (nn != NULL && nn->type == ROFFT_TEXT && nn->string[0] != '\0') p = unix_versions[3]; else p = unix_versions[2]; } else p = unix_versions[0]; } free(man->meta.os); man->meta.os = mandoc_strdup(p); } static void post_in(CHKARGS) { char *s; if (n->parent->tok != MAN_TP || n->parent->type != ROFFT_HEAD || n->child == NULL || *n->child->string == '+' || *n->child->string == '-') return; mandoc_asprintf(&s, "+%s", n->child->string); free(n->child->string); n->child->string = s; } mandoc-1.14.6/mandoc.c010064400017530001753000000316631412314055300147650ustar00schwarzeschwarze/* $Id: mandoc.c,v 1.119 2021/08/10 12:55:03 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "libmandoc.h" #include "roff_int.h" static int a2time(time_t *, const char *, const char *); static char *time2a(time_t); enum mandoc_esc mandoc_font(const char *cp, int sz) { switch (sz) { case 0: return ESCAPE_FONTPREV; case 1: switch (cp[0]) { case 'B': case '3': return ESCAPE_FONTBOLD; case 'I': case '2': return ESCAPE_FONTITALIC; case 'P': return ESCAPE_FONTPREV; case 'R': case '1': return ESCAPE_FONTROMAN; case '4': return ESCAPE_FONTBI; default: return ESCAPE_ERROR; } case 2: switch (cp[0]) { case 'B': switch (cp[1]) { case 'I': return ESCAPE_FONTBI; default: return ESCAPE_ERROR; } case 'C': switch (cp[1]) { case 'B': return ESCAPE_FONTCB; case 'I': return ESCAPE_FONTCI; case 'R': case 'W': return ESCAPE_FONTCR; default: return ESCAPE_ERROR; } default: return ESCAPE_ERROR; } default: return ESCAPE_ERROR; } } enum mandoc_esc mandoc_escape(const char **end, const char **start, int *sz) { const char *local_start; int local_sz, c, i; char term; enum mandoc_esc gly; /* * When the caller doesn't provide return storage, * use local storage. */ if (NULL == start) start = &local_start; if (NULL == sz) sz = &local_sz; /* * Treat "\E" just like "\"; * it only makes a difference in copy mode. */ if (**end == 'E') ++*end; /* * Beyond the backslash, at least one input character * is part of the escape sequence. With one exception * (see below), that character won't be returned. */ gly = ESCAPE_ERROR; *start = ++*end; *sz = 0; term = '\0'; switch ((*start)[-1]) { /* * First the glyphs. There are several different forms of * these, but each eventually returns a substring of the glyph * name. */ case '(': gly = ESCAPE_SPECIAL; *sz = 2; break; case '[': if (**start == ' ') { ++*end; return ESCAPE_ERROR; } gly = ESCAPE_SPECIAL; term = ']'; break; case 'C': if ('\'' != **start) return ESCAPE_ERROR; *start = ++*end; gly = ESCAPE_SPECIAL; term = '\''; break; /* * Escapes taking no arguments at all. */ case '!': case '?': return ESCAPE_UNSUPP; case '%': case '&': case ')': case ',': case '/': case '^': case 'a': case 'd': case 'r': case 't': case 'u': case '{': case '|': case '}': return ESCAPE_IGNORE; case 'c': return ESCAPE_NOSPACE; case 'p': return ESCAPE_BREAK; /* * The \z escape is supposed to output the following * character without advancing the cursor position. * Since we are mostly dealing with terminal mode, * let us just skip the next character. */ case 'z': return ESCAPE_SKIPCHAR; /* * Handle all triggers matching \X(xy, \Xx, and \X[xxxx], where * 'X' is the trigger. These have opaque sub-strings. */ case 'F': case 'f': case 'g': case 'k': case 'M': case 'm': case 'n': case 'O': case 'V': case 'Y': case '*': switch ((*start)[-1]) { case 'f': gly = ESCAPE_FONT; break; case '*': gly = ESCAPE_DEVICE; break; default: gly = ESCAPE_IGNORE; break; } switch (**start) { case '(': if ((*start)[-1] == 'O') gly = ESCAPE_ERROR; *start = ++*end; *sz = 2; break; case '[': if ((*start)[-1] == 'O') gly = (*start)[1] == '5' ? ESCAPE_UNSUPP : ESCAPE_ERROR; *start = ++*end; term = ']'; break; default: if ((*start)[-1] == 'O') { switch (**start) { case '0': gly = ESCAPE_UNSUPP; break; case '1': case '2': case '3': case '4': break; default: gly = ESCAPE_ERROR; break; } } *sz = 1; break; } break; /* * These escapes are of the form \X'Y', where 'X' is the trigger * and 'Y' is any string. These have opaque sub-strings. * The \B and \w escapes are handled in roff.c, roff_res(). */ case 'A': case 'b': case 'D': case 'R': case 'X': case 'Z': gly = ESCAPE_IGNORE; /* FALLTHROUGH */ case 'o': if (**start == '\0') return ESCAPE_ERROR; if (gly == ESCAPE_ERROR) gly = ESCAPE_OVERSTRIKE; term = **start; *start = ++*end; break; /* * These escapes are of the form \X'N', where 'X' is the trigger * and 'N' resolves to a numerical expression. */ case 'h': case 'H': case 'L': case 'l': case 'S': case 'v': case 'x': if (strchr(" %&()*+-./0123456789:<=>", **start)) { if ('\0' != **start) ++*end; return ESCAPE_ERROR; } switch ((*start)[-1]) { case 'h': gly = ESCAPE_HORIZ; break; case 'l': gly = ESCAPE_HLINE; break; default: gly = ESCAPE_IGNORE; break; } term = **start; *start = ++*end; break; /* * Special handling for the numbered character escape. * XXX Do any other escapes need similar handling? */ case 'N': if ('\0' == **start) return ESCAPE_ERROR; (*end)++; if (isdigit((unsigned char)**start)) { *sz = 1; return ESCAPE_IGNORE; } (*start)++; while (isdigit((unsigned char)**end)) (*end)++; *sz = *end - *start; if ('\0' != **end) (*end)++; return ESCAPE_NUMBERED; /* * Sizes get a special category of their own. */ case 's': gly = ESCAPE_IGNORE; /* See +/- counts as a sign. */ if ('+' == **end || '-' == **end || ASCII_HYPH == **end) *start = ++*end; switch (**end) { case '(': *start = ++*end; *sz = 2; break; case '[': *start = ++*end; term = ']'; break; case '\'': *start = ++*end; term = '\''; break; case '3': case '2': case '1': *sz = (*end)[-1] == 's' && isdigit((unsigned char)(*end)[1]) ? 2 : 1; break; default: *sz = 1; break; } break; /* * Several special characters can be encoded as * one-byte escape sequences without using \[]. */ case ' ': case '\'': case '-': case '.': case '0': case ':': case '_': case '`': case 'e': case '~': gly = ESCAPE_SPECIAL; /* FALLTHROUGH */ default: if (gly == ESCAPE_ERROR) gly = ESCAPE_UNDEF; *start = --*end; *sz = 1; break; } /* * Read up to the terminating character, * paying attention to nested escapes. */ if ('\0' != term) { while (**end != term) { switch (**end) { case '\0': return ESCAPE_ERROR; case '\\': (*end)++; if (ESCAPE_ERROR == mandoc_escape(end, NULL, NULL)) return ESCAPE_ERROR; break; default: (*end)++; break; } } *sz = (*end)++ - *start; /* * The file chars.c only provides one common list * of character names, but \[-] == \- is the only * one of the characters with one-byte names that * allows enclosing the name in brackets. */ if (gly == ESCAPE_SPECIAL && *sz == 1 && **start != '-') return ESCAPE_ERROR; } else { assert(*sz > 0); if ((size_t)*sz > strlen(*start)) return ESCAPE_ERROR; *end += *sz; } /* Run post-processors. */ switch (gly) { case ESCAPE_FONT: gly = mandoc_font(*start, *sz); break; case ESCAPE_SPECIAL: if (**start == 'c') { if (*sz < 6 || *sz > 7 || strncmp(*start, "char", 4) != 0 || (int)strspn(*start + 4, "0123456789") + 4 < *sz) break; c = 0; for (i = 4; i < *sz; i++) c = 10 * c + ((*start)[i] - '0'); if (c < 0x21 || (c > 0x7e && c < 0xa0) || c > 0xff) break; *start += 4; *sz -= 4; gly = ESCAPE_NUMBERED; break; } /* * Unicode escapes are defined in groff as \[u0000] * to \[u10FFFF], where the contained value must be * a valid Unicode codepoint. Here, however, only * check the length and range. */ if (**start != 'u' || *sz < 5 || *sz > 7) break; if (*sz == 7 && ((*start)[1] != '1' || (*start)[2] != '0')) break; if (*sz == 6 && (*start)[1] == '0') break; if (*sz == 5 && (*start)[1] == 'D' && strchr("89ABCDEF", (*start)[2]) != NULL) break; if ((int)strspn(*start + 1, "0123456789ABCDEFabcdef") + 1 == *sz) gly = ESCAPE_UNICODE; break; case ESCAPE_DEVICE: assert(*sz == 2 && (*start)[0] == '.' && (*start)[1] == 'T'); break; default: break; } return gly; } static int a2time(time_t *t, const char *fmt, const char *p) { struct tm tm; char *pp; memset(&tm, 0, sizeof(struct tm)); pp = NULL; #if HAVE_STRPTIME pp = strptime(p, fmt, &tm); #endif if (NULL != pp && '\0' == *pp) { *t = mktime(&tm); return 1; } return 0; } static char * time2a(time_t t) { struct tm *tm; char *buf, *p; size_t ssz; int isz; buf = NULL; tm = localtime(&t); if (tm == NULL) goto fail; /* * Reserve space: * up to 9 characters for the month (September) + blank * up to 2 characters for the day + comma + blank * 4 characters for the year and a terminating '\0' */ p = buf = mandoc_malloc(10 + 4 + 4 + 1); if ((ssz = strftime(p, 10 + 1, "%B ", tm)) == 0) goto fail; p += (int)ssz; /* * The output format is just "%d" here, not "%2d" or "%02d". * That's also the reason why we can't just format the * date as a whole with "%B %e, %Y" or "%B %d, %Y". * Besides, the present approach is less prone to buffer * overflows, in case anybody should ever introduce the bug * of looking at LC_TIME. */ isz = snprintf(p, 4 + 1, "%d, ", tm->tm_mday); if (isz < 0 || isz > 4) goto fail; p += isz; if (strftime(p, 4 + 1, "%Y", tm) == 0) goto fail; return buf; fail: free(buf); return mandoc_strdup(""); } char * mandoc_normdate(struct roff_node *nch, struct roff_node *nbl) { char *cp; time_t t; /* No date specified. */ if (nch == NULL) { if (nbl == NULL) mandoc_msg(MANDOCERR_DATE_MISSING, 0, 0, NULL); else mandoc_msg(MANDOCERR_DATE_MISSING, nbl->line, nbl->pos, "%s", roff_name[nbl->tok]); return mandoc_strdup(""); } if (*nch->string == '\0') { mandoc_msg(MANDOCERR_DATE_MISSING, nch->line, nch->pos, "%s", roff_name[nbl->tok]); return mandoc_strdup(""); } if (strcmp(nch->string, "$" "Mdocdate$") == 0) return time2a(time(NULL)); /* Valid mdoc(7) date format. */ if (a2time(&t, "$" "Mdocdate: %b %d %Y $", nch->string) || a2time(&t, "%b %d, %Y", nch->string)) { cp = time2a(t); if (t > time(NULL) + 86400) mandoc_msg(MANDOCERR_DATE_FUTURE, nch->line, nch->pos, "%s %s", roff_name[nbl->tok], cp); else if (*nch->string != '$' && strcmp(nch->string, cp) != 0) mandoc_msg(MANDOCERR_DATE_NORM, nch->line, nch->pos, "%s %s", roff_name[nbl->tok], cp); return cp; } /* In man(7), do not warn about the legacy format. */ if (a2time(&t, "%Y-%m-%d", nch->string) == 0) mandoc_msg(MANDOCERR_DATE_BAD, nch->line, nch->pos, "%s %s", roff_name[nbl->tok], nch->string); else if (t > time(NULL) + 86400) mandoc_msg(MANDOCERR_DATE_FUTURE, nch->line, nch->pos, "%s %s", roff_name[nbl->tok], nch->string); else if (nbl->tok == MDOC_Dd) mandoc_msg(MANDOCERR_DATE_LEGACY, nch->line, nch->pos, "Dd %s", nch->string); /* Use any non-mdoc(7) date verbatim. */ return mandoc_strdup(nch->string); } int mandoc_eos(const char *p, size_t sz) { const char *q; int enclosed, found; if (0 == sz) return 0; /* * End-of-sentence recognition must include situations where * some symbols, such as `)', allow prior EOS punctuation to * propagate outward. */ enclosed = found = 0; for (q = p + (int)sz - 1; q >= p; q--) { switch (*q) { case '\"': case '\'': case ']': case ')': if (0 == found) enclosed = 1; break; case '.': case '!': case '?': found = 1; break; default: return found && (!enclosed || isalnum((unsigned char)*q)); } } return found && !enclosed; } /* * Convert a string to a long that may not be <0. * If the string is invalid, or is less than 0, return -1. */ int mandoc_strntoi(const char *p, size_t sz, int base) { char buf[32]; char *ep; long v; if (sz > 31) return -1; memcpy(buf, p, sz); buf[(int)sz] = '\0'; errno = 0; v = strtol(buf, &ep, base); if (buf[0] == '\0' || *ep != '\0') return -1; if (v > INT_MAX) v = INT_MAX; if (v < INT_MIN) v = INT_MIN; return (int)v; } mandoc-1.14.6/mandoc_aux.c010064400017530001753000000046551412314055300156430ustar00schwarzeschwarze/* $Id: mandoc_aux.c,v 1.11 2018/02/07 20:04:57 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #if HAVE_ERR #include #endif #include #include #include #include #include "mandoc.h" #include "mandoc_aux.h" int mandoc_asprintf(char **dest, const char *fmt, ...) { va_list ap; int ret; va_start(ap, fmt); ret = vasprintf(dest, fmt, ap); va_end(ap); if (ret == -1) err((int)MANDOCLEVEL_SYSERR, NULL); return ret; } void * mandoc_calloc(size_t num, size_t size) { void *ptr; ptr = calloc(num, size); if (ptr == NULL) err((int)MANDOCLEVEL_SYSERR, NULL); return ptr; } void * mandoc_malloc(size_t size) { void *ptr; ptr = malloc(size); if (ptr == NULL) err((int)MANDOCLEVEL_SYSERR, NULL); return ptr; } void * mandoc_realloc(void *ptr, size_t size) { ptr = realloc(ptr, size); if (ptr == NULL) err((int)MANDOCLEVEL_SYSERR, NULL); return ptr; } void * mandoc_reallocarray(void *ptr, size_t num, size_t size) { ptr = reallocarray(ptr, num, size); if (ptr == NULL) err((int)MANDOCLEVEL_SYSERR, NULL); return ptr; } void * mandoc_recallocarray(void *ptr, size_t oldnum, size_t num, size_t size) { ptr = recallocarray(ptr, oldnum, num, size); if (ptr == NULL) err((int)MANDOCLEVEL_SYSERR, NULL); return ptr; } char * mandoc_strdup(const char *ptr) { char *p; p = strdup(ptr); if (p == NULL) err((int)MANDOCLEVEL_SYSERR, NULL); return p; } char * mandoc_strndup(const char *ptr, size_t sz) { char *p; p = strndup(ptr, sz); if (p == NULL) err((int)MANDOCLEVEL_SYSERR, NULL); return p; } mandoc-1.14.6/mandoc_msg.c010064400017530001753000000223621412314055300156270ustar00schwarzeschwarze/* $OpenBSD: mandoc_msg.c,v 1.8 2020/01/19 17:59:01 schwarze Exp $ */ /* * Copyright (c) 2014-2021 Ingo Schwarze * Copyright (c) 2010, 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Implementation of warning and error messages for mandoc(1). */ #include "config.h" #include #include #include #include "mandoc.h" static const enum mandocerr lowest_type[MANDOCLEVEL_MAX] = { MANDOCERR_OK, MANDOCERR_OK, MANDOCERR_WARNING, MANDOCERR_ERROR, MANDOCERR_UNSUPP, MANDOCERR_BADARG, MANDOCERR_SYSERR }; static const char *const level_name[MANDOCLEVEL_MAX] = { "SUCCESS", "STYLE", "WARNING", "ERROR", "UNSUPP", "BADARG", "SYSERR" }; static const char *const type_message[MANDOCERR_MAX] = { "ok", "base system convention", "Mdocdate found", "Mdocdate missing", "unknown architecture", "operating system explicitly specified", "RCS id missing", "generic style suggestion", "legacy man(7) date format", "normalizing date format to", "lower case character in document title", "duplicate RCS id", "possible typo in section name", "unterminated quoted argument", "useless macro", "consider using OS macro", "errnos out of order", "duplicate errno", "referenced manual not found", "trailing delimiter", "no blank before trailing delimiter", "fill mode already enabled, skipping", "fill mode already disabled, skipping", "input text line longer than 80 bytes", "verbatim \"--\", maybe consider using \\(em", "function name without markup", "whitespace at end of input line", "bad comment style", "generic warning", /* related to the prologue */ "missing manual title, using UNTITLED", "missing manual title, using \"\"", "missing manual section, using \"\"", "unknown manual section", "filename/section mismatch", "missing date, using \"\"", "cannot parse date, using it verbatim", "date in the future, using it anyway", "missing Os macro, using \"\"", "late prologue macro", "prologue macros out of order", /* related to document structure */ ".so is fragile, better use ln(1)", "no document body", "content before first section header", "first section is not \"NAME\"", "NAME section without Nm before Nd", "NAME section without description", "description not at the end of NAME", "bad NAME section content", "missing comma before name", "missing description line, using \"\"", "description line outside NAME section", "sections out of conventional order", "duplicate section title", "unexpected section", "cross reference to self", "unusual Xr order", "unusual Xr punctuation", "AUTHORS section without An macro", /* related to macros and nesting */ "obsolete macro", "macro neither callable nor escaped", "skipping paragraph macro", "moving paragraph macro out of list", "skipping no-space macro", "blocks badly nested", "nested displays are not portable", "moving content out of list", "first macro on line", "line scope broken", "skipping blank line in line scope", /* related to missing macro arguments */ "skipping empty request", "conditional request controls empty scope", "skipping empty macro", "empty block", "empty argument, using 0n", "missing display type, using -ragged", "list type is not the first argument", "missing -width in -tag list, using 6n", "missing utility name, using \"\"", "missing function name, using \"\"", "empty head in list item", "empty list item", "missing argument, using next line", "missing font type, using \\fR", "unknown font type, using \\fR", "nothing follows prefix", "empty reference block", "missing section argument", "missing -std argument, adding it", "missing option string, using \"\"", "missing resource identifier, using \"\"", "missing eqn box, using \"\"", /* related to bad macro arguments */ "duplicate argument", "skipping duplicate argument", "skipping duplicate display type", "skipping duplicate list type", "skipping -width argument", "wrong number of cells", "unknown AT&T UNIX version", "comma in function argument", "parenthesis in function name", "unknown library name", "invalid content in Rs block", "invalid Boolean argument", "argument contains two font escapes", "unknown font, skipping request", "odd number of characters in request", /* related to plain text */ "blank line in fill mode, using .sp", "tab in filled text", "new sentence, new line", "invalid escape sequence", "undefined escape, printing literally", "undefined string, using \"\"", /* related to tables */ "tbl line starts with span", "tbl column starts with span", "skipping vertical bar in tbl layout", "generic error", /* related to tables */ "non-alphabetic character in tbl options", "skipping unknown tbl option", "missing tbl option argument", "wrong tbl option argument size", "empty tbl layout", "invalid character in tbl layout", "unmatched parenthesis in tbl layout", "ignoring excessive spacing in tbl layout", "tbl without any data cells", "ignoring data in spanned tbl cell", "ignoring extra tbl data cells", "data block open at end of tbl", /* related to document structure and macros */ "duplicate prologue macro", "skipping late title macro", "input stack limit exceeded, infinite loop?", "skipping bad character", "skipping unknown macro", "ignoring request outside macro", "skipping insecure request", "skipping item outside list", "skipping column outside column list", "skipping end of block that is not open", "fewer RS blocks open, skipping", "inserting missing end of block", "appending missing end of block", /* related to request and macro arguments */ "escaped character not allowed in a name", "using macro argument outside macro", "argument number is not numeric", "NOT IMPLEMENTED: Bd -file", "skipping display without arguments", "missing list type, using -item", "argument is not numeric, using 1", "argument is not a character", "missing manual name, using \"\"", "uname(3) system call failed, using UNKNOWN", "unknown standard specifier", "skipping request without numeric argument", "excessive shift", "NOT IMPLEMENTED: .so with absolute path or \"..\"", ".so request failed", "skipping tag containing whitespace", "skipping all arguments", "skipping excess arguments", "divide by zero", "unsupported feature", "input too large", "unsupported control character", "unsupported escape sequence", "unsupported roff request", "nested .while loops", "end of scope with open .while loop", "end of .while loop in inner scope", "cannot continue this .while loop", "eqn delim option in tbl", "unsupported tbl layout modifier", "ignoring macro in table", "skipping tbl in -Tman mode", "skipping eqn in -Tman mode", /* bad command line arguments */ NULL, "bad command line argument", "duplicate command line argument", "option has a superfluous value", "missing option value", "bad option value", "duplicate option value", "no such tag", "-Tmarkdown unsupported for man(7) input", /* system errors */ NULL, "dup", "exec", "fdopen", "fflush", "fork", "fstat", "getline", "glob", "gzclose", "gzdopen", "mkstemp", "open", "pledge", "read", "wait", "write", }; static FILE *fileptr = NULL; static const char *filename = NULL; static enum mandocerr min_type = MANDOCERR_BADARG; static enum mandoclevel rc = MANDOCLEVEL_OK; void mandoc_msg_setoutfile(FILE *fp) { fileptr = fp; } const char * mandoc_msg_getinfilename(void) { return filename; } void mandoc_msg_setinfilename(const char *fn) { filename = fn; } enum mandocerr mandoc_msg_getmin(void) { return min_type; } void mandoc_msg_setmin(enum mandocerr t) { min_type = t; } enum mandoclevel mandoc_msg_getrc(void) { return rc; } void mandoc_msg_setrc(enum mandoclevel level) { if (rc < level) rc = level; } void mandoc_msg(enum mandocerr t, int line, int col, const char *fmt, ...) { va_list ap; enum mandoclevel level; if (t < min_type) return; level = MANDOCLEVEL_SYSERR; while (t < lowest_type[level]) level--; mandoc_msg_setrc(level); if (fileptr == NULL) return; fprintf(fileptr, "%s:", getprogname()); if (filename != NULL) fprintf(fileptr, " %s:", filename); if (line > 0) fprintf(fileptr, "%d:%d:", line, col + 1); fprintf(fileptr, " %s", level_name[level]); if (type_message[t] != NULL) fprintf(fileptr, ": %s", type_message[t]); if (fmt != NULL) { fprintf(fileptr, ": "); va_start(ap, fmt); vfprintf(fileptr, fmt, ap); va_end(ap); } fputc('\n', fileptr); } void mandoc_msg_summary(void) { if (fileptr != NULL && rc != MANDOCLEVEL_OK) fprintf(fileptr, "%s: see above the output for %s messages\n", getprogname(), level_name[rc]); } mandoc-1.14.6/mandoc_ohash.c010064400017530001753000000031521412314055300161370ustar00schwarzeschwarze/* $Id: mandoc_ohash.c,v 1.3 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2014, 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include "mandoc_aux.h" #include "mandoc_ohash.h" static void *hash_alloc(size_t, void *); static void *hash_calloc(size_t, size_t, void *); static void hash_free(void *, void *); void mandoc_ohash_init(struct ohash *h, unsigned int sz, ptrdiff_t ko) { struct ohash_info info; info.alloc = hash_alloc; info.calloc = hash_calloc; info.free = hash_free; info.data = NULL; info.key_offset = ko; ohash_init(h, sz, &info); } static void * hash_alloc(size_t sz, void *arg) { return mandoc_malloc(sz); } static void * hash_calloc(size_t n, size_t sz, void *arg) { return mandoc_calloc(n, sz); } static void hash_free(void *p, void *arg) { free(p); } mandoc-1.14.6/mandoc_xr.c010064400017530001753000000054231412314055300154710ustar00schwarzeschwarze/* $Id: mandoc_xr.c,v 1.4 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc_ohash.h" #include "mandoc_xr.h" static struct ohash *xr_hash = NULL; static struct mandoc_xr *xr_first = NULL; static struct mandoc_xr *xr_last = NULL; static void mandoc_xr_clear(void); static void mandoc_xr_clear(void) { struct mandoc_xr *xr; unsigned int slot; if (xr_hash == NULL) return; for (xr = ohash_first(xr_hash, &slot); xr != NULL; xr = ohash_next(xr_hash, &slot)) free(xr); ohash_delete(xr_hash); } void mandoc_xr_reset(void) { if (xr_hash == NULL) xr_hash = mandoc_malloc(sizeof(*xr_hash)); else mandoc_xr_clear(); mandoc_ohash_init(xr_hash, 5, offsetof(struct mandoc_xr, hashkey)); xr_first = xr_last = NULL; } int mandoc_xr_add(const char *sec, const char *name, int line, int pos) { struct mandoc_xr *xr, *oxr; const char *pend; size_t ssz, nsz, tsz; unsigned int slot; int ret; uint32_t hv; if (xr_hash == NULL) return 0; ssz = strlen(sec) + 1; nsz = strlen(name) + 1; tsz = ssz + nsz; xr = mandoc_malloc(sizeof(*xr) + tsz); xr->next = NULL; xr->sec = xr->hashkey; xr->name = xr->hashkey + ssz; xr->line = line; xr->pos = pos; xr->count = 1; memcpy(xr->sec, sec, ssz); memcpy(xr->name, name, nsz); pend = xr->hashkey + tsz; hv = ohash_interval(xr->hashkey, &pend); slot = ohash_lookup_memory(xr_hash, xr->hashkey, tsz, hv); if ((oxr = ohash_find(xr_hash, slot)) == NULL) { ohash_insert(xr_hash, slot, xr); if (xr_first == NULL) xr_first = xr; else xr_last->next = xr; xr_last = xr; return 0; } oxr->count++; ret = (oxr->line == -1) ^ (xr->line == -1); if (xr->line == -1) oxr->line = -1; free(xr); return ret; } struct mandoc_xr * mandoc_xr_get(void) { return xr_first; } void mandoc_xr_free(void) { mandoc_xr_clear(); free(xr_hash); xr_hash = NULL; } mandoc-1.14.6/mandocd.c010064400017530001753000000137441412314055300151310ustar00schwarzeschwarze/* $Id: mandocd.c,v 1.12 2020/06/14 23:40:31 schwarze Exp $ */ /* * Copyright (c) 2017 Michael Stapelberg * Copyright (c) 2017, 2019 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #if NEED_XPG4_2 #define _XPG4_2 #endif #include #include #if HAVE_ERR #include #endif #include #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "man.h" #include "mandoc_parse.h" #include "main.h" #include "manconf.h" enum outt { OUTT_ASCII = 0, OUTT_UTF8, OUTT_HTML }; static void process(struct mparse *, enum outt, void *); static int read_fds(int, int *); static void usage(void) __attribute__((__noreturn__)); #define NUM_FDS 3 static int read_fds(int clientfd, int *fds) { struct msghdr msg; struct iovec iov[1]; unsigned char dummy[1]; struct cmsghdr *cmsg; int *walk; int cnt; /* Union used for alignment. */ union { uint8_t controlbuf[CMSG_SPACE(NUM_FDS * sizeof(int))]; struct cmsghdr align; } u; memset(&msg, '\0', sizeof(msg)); msg.msg_control = u.controlbuf; msg.msg_controllen = sizeof(u.controlbuf); /* * Read a dummy byte - sendmsg cannot send an empty message, * even if we are only interested in the OOB data. */ iov[0].iov_base = dummy; iov[0].iov_len = sizeof(dummy); msg.msg_iov = iov; msg.msg_iovlen = 1; switch (recvmsg(clientfd, &msg, 0)) { case -1: warn("recvmsg"); return -1; case 0: return 0; default: break; } if ((cmsg = CMSG_FIRSTHDR(&msg)) == NULL) { warnx("CMSG_FIRSTHDR: missing control message"); return -1; } if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS || cmsg->cmsg_len != CMSG_LEN(NUM_FDS * sizeof(int))) { warnx("CMSG_FIRSTHDR: invalid control message"); return -1; } walk = (int *)CMSG_DATA(cmsg); for (cnt = 0; cnt < NUM_FDS; cnt++) fds[cnt] = *walk++; return 1; } int main(int argc, char *argv[]) { struct manoutput options; struct mparse *parser; void *formatter; const char *defos; const char *errstr; int clientfd; int old_stdin; int old_stdout; int old_stderr; int fds[3]; int state, opt; enum outt outtype; defos = NULL; outtype = OUTT_ASCII; while ((opt = getopt(argc, argv, "I:T:")) != -1) { switch (opt) { case 'I': if (strncmp(optarg, "os=", 3) == 0) defos = optarg + 3; else { warnx("-I %s: Bad argument", optarg); usage(); } break; case 'T': if (strcmp(optarg, "ascii") == 0) outtype = OUTT_ASCII; else if (strcmp(optarg, "utf8") == 0) outtype = OUTT_UTF8; else if (strcmp(optarg, "html") == 0) outtype = OUTT_HTML; else { warnx("-T %s: Bad argument", optarg); usage(); } break; default: usage(); } } if (argc > 0) { argc -= optind; argv += optind; } if (argc != 1) usage(); errstr = NULL; clientfd = strtonum(argv[0], 3, INT_MAX, &errstr); if (errstr) errx(1, "file descriptor %s %s", argv[1], errstr); mchars_alloc(); parser = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1 | MPARSE_VALIDATE, MANDOC_OS_OTHER, defos); memset(&options, 0, sizeof(options)); switch (outtype) { case OUTT_ASCII: formatter = ascii_alloc(&options); break; case OUTT_UTF8: formatter = utf8_alloc(&options); break; case OUTT_HTML: options.fragment = 1; formatter = html_alloc(&options); break; } state = 1; /* work to do */ fflush(stdout); fflush(stderr); if ((old_stdin = dup(STDIN_FILENO)) == -1 || (old_stdout = dup(STDOUT_FILENO)) == -1 || (old_stderr = dup(STDERR_FILENO)) == -1) { warn("dup"); state = -1; /* error */ } while (state == 1 && (state = read_fds(clientfd, fds)) == 1) { if (dup2(fds[0], STDIN_FILENO) == -1 || dup2(fds[1], STDOUT_FILENO) == -1 || dup2(fds[2], STDERR_FILENO) == -1) { warn("dup2"); state = -1; break; } close(fds[0]); close(fds[1]); close(fds[2]); process(parser, outtype, formatter); mparse_reset(parser); if (outtype == OUTT_HTML) html_reset(formatter); fflush(stdout); fflush(stderr); /* Close file descriptors by restoring the old ones. */ if (dup2(old_stderr, STDERR_FILENO) == -1 || dup2(old_stdout, STDOUT_FILENO) == -1 || dup2(old_stdin, STDIN_FILENO) == -1) { warn("dup2"); state = -1; break; } } close(clientfd); switch (outtype) { case OUTT_ASCII: case OUTT_UTF8: ascii_free(formatter); break; case OUTT_HTML: html_free(formatter); break; } mparse_free(parser); mchars_free(); return state == -1 ? 1 : 0; } static void process(struct mparse *parser, enum outt outtype, void *formatter) { struct roff_meta *meta; mparse_readfd(parser, STDIN_FILENO, ""); meta = mparse_result(parser); if (meta->macroset == MACROSET_MDOC) { switch (outtype) { case OUTT_ASCII: case OUTT_UTF8: terminal_mdoc(formatter, meta); break; case OUTT_HTML: html_mdoc(formatter, meta); break; } } if (meta->macroset == MACROSET_MAN) { switch (outtype) { case OUTT_ASCII: case OUTT_UTF8: terminal_man(formatter, meta); break; case OUTT_HTML: html_man(formatter, meta); break; } } } void usage(void) { fprintf(stderr, "usage: mandocd [-I os=name] [-T output] socket_fd\n"); exit(1); } mandoc-1.14.6/mandocdb.c010064400017530001753000001617161412314055300152760ustar00schwarzeschwarze/* $Id: mandocdb.c,v 1.269 2021/08/19 16:55:31 schwarze Exp $ */ /* * Copyright (c) 2011-2020 Ingo Schwarze * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2016 Ed Maste * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Implementation of the makewhatis(8) program. */ #include "config.h" #include #include #include #include #include #if HAVE_ERR #include #endif #include #include #if HAVE_FTS #include #else #include "compat_fts.h" #endif #include #if HAVE_SANDBOX_INIT #include #endif #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc_ohash.h" #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "man.h" #include "mandoc_parse.h" #include "manconf.h" #include "mansearch.h" #include "dba_array.h" #include "dba.h" extern const char *const mansearch_keynames[]; enum op { OP_DEFAULT = 0, /* new dbs from dir list or default config */ OP_CONFFILE, /* new databases from custom config file */ OP_UPDATE, /* delete/add entries in existing database */ OP_DELETE, /* delete entries from existing database */ OP_TEST /* change no databases, report potential problems */ }; struct str { const struct mpage *mpage; /* if set, the owning parse */ uint64_t mask; /* bitmask in sequence */ char key[]; /* rendered text */ }; struct inodev { ino_t st_ino; dev_t st_dev; }; struct mpage { struct inodev inodev; /* used for hashing routine */ struct dba_array *dba; char *sec; /* section from file content */ char *arch; /* architecture from file content */ char *title; /* title from file content */ char *desc; /* description from file content */ struct mpage *next; /* singly linked list */ struct mlink *mlinks; /* singly linked list */ int name_head_done; enum form form; /* format from file content */ }; struct mlink { char file[PATH_MAX]; /* filename rel. to manpath */ char *dsec; /* section from directory */ char *arch; /* architecture from directory */ char *name; /* name from file name (not empty) */ char *fsec; /* section from file name suffix */ struct mlink *next; /* singly linked list */ struct mpage *mpage; /* parent */ int gzip; /* filename has a .gz suffix */ enum form dform; /* format from directory */ enum form fform; /* format from file name suffix */ }; typedef int (*mdoc_fp)(struct mpage *, const struct roff_meta *, const struct roff_node *); struct mdoc_handler { mdoc_fp fp; /* optional handler */ uint64_t mask; /* set unless handler returns 0 */ int taboo; /* node flags that must not be set */ }; int mandocdb(int, char *[]); static void dbadd(struct dba *, struct mpage *); static void dbadd_mlink(const struct mlink *); static void dbprune(struct dba *); static void dbwrite(struct dba *); static void filescan(const char *); #if HAVE_FTS_COMPARE_CONST static int fts_compare(const FTSENT *const *, const FTSENT *const *); #else static int fts_compare(const FTSENT **, const FTSENT **); #endif static void mlink_add(struct mlink *, const struct stat *); static void mlink_check(struct mpage *, struct mlink *); static void mlink_free(struct mlink *); static void mlinks_undupe(struct mpage *); static void mpages_free(void); static void mpages_merge(struct dba *, struct mparse *); static void parse_cat(struct mpage *, int); static void parse_man(struct mpage *, const struct roff_meta *, const struct roff_node *); static void parse_mdoc(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_head(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_Fa(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_Fd(struct mpage *, const struct roff_meta *, const struct roff_node *); static void parse_mdoc_fname(struct mpage *, const struct roff_node *); static int parse_mdoc_Fn(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_Fo(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_Nd(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_Nm(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_Sh(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_Va(struct mpage *, const struct roff_meta *, const struct roff_node *); static int parse_mdoc_Xr(struct mpage *, const struct roff_meta *, const struct roff_node *); static void putkey(const struct mpage *, char *, uint64_t); static void putkeys(const struct mpage *, char *, size_t, uint64_t); static void putmdockey(const struct mpage *, const struct roff_node *, uint64_t, int); #ifdef READ_ALLOWED_PATH static int read_allowed(const char *); #endif static int render_string(char **, size_t *); static void say(const char *, const char *, ...) __attribute__((__format__ (__printf__, 2, 3))); static int set_basedir(const char *, int); static int treescan(void); static size_t utf8(unsigned int, char [7]); static int nodb; /* no database changes */ static int mparse_options; /* abort the parse early */ static int use_all; /* use all found files */ static int debug; /* print what we're doing */ static int warnings; /* warn about crap */ static int write_utf8; /* write UTF-8 output; else ASCII */ static int exitcode; /* to be returned by main */ static enum op op; /* operational mode */ static char basedir[PATH_MAX]; /* current base directory */ static size_t basedir_len; /* strlen(basedir) */ static struct mpage *mpage_head; /* list of distinct manual pages */ static struct ohash mpages; /* table of distinct manual pages */ static struct ohash mlinks; /* table of directory entries */ static struct ohash names; /* table of all names */ static struct ohash strings; /* table of all strings */ static uint64_t name_mask; static const struct mdoc_handler mdoc_handlers[MDOC_MAX - MDOC_Dd] = { { NULL, 0, NODE_NOPRT }, /* Dd */ { NULL, 0, NODE_NOPRT }, /* Dt */ { NULL, 0, NODE_NOPRT }, /* Os */ { parse_mdoc_Sh, TYPE_Sh, 0 }, /* Sh */ { parse_mdoc_head, TYPE_Ss, 0 }, /* Ss */ { NULL, 0, 0 }, /* Pp */ { NULL, 0, 0 }, /* D1 */ { NULL, 0, 0 }, /* Dl */ { NULL, 0, 0 }, /* Bd */ { NULL, 0, 0 }, /* Ed */ { NULL, 0, 0 }, /* Bl */ { NULL, 0, 0 }, /* El */ { NULL, 0, 0 }, /* It */ { NULL, 0, 0 }, /* Ad */ { NULL, TYPE_An, 0 }, /* An */ { NULL, 0, 0 }, /* Ap */ { NULL, TYPE_Ar, 0 }, /* Ar */ { NULL, TYPE_Cd, 0 }, /* Cd */ { NULL, TYPE_Cm, 0 }, /* Cm */ { NULL, TYPE_Dv, 0 }, /* Dv */ { NULL, TYPE_Er, 0 }, /* Er */ { NULL, TYPE_Ev, 0 }, /* Ev */ { NULL, 0, 0 }, /* Ex */ { parse_mdoc_Fa, 0, 0 }, /* Fa */ { parse_mdoc_Fd, 0, 0 }, /* Fd */ { NULL, TYPE_Fl, 0 }, /* Fl */ { parse_mdoc_Fn, 0, 0 }, /* Fn */ { NULL, TYPE_Ft | TYPE_Vt, 0 }, /* Ft */ { NULL, TYPE_Ic, 0 }, /* Ic */ { NULL, TYPE_In, 0 }, /* In */ { NULL, TYPE_Li, 0 }, /* Li */ { parse_mdoc_Nd, 0, 0 }, /* Nd */ { parse_mdoc_Nm, 0, 0 }, /* Nm */ { NULL, 0, 0 }, /* Op */ { NULL, 0, 0 }, /* Ot */ { NULL, TYPE_Pa, NODE_NOSRC }, /* Pa */ { NULL, 0, 0 }, /* Rv */ { NULL, TYPE_St, 0 }, /* St */ { parse_mdoc_Va, TYPE_Va, 0 }, /* Va */ { parse_mdoc_Va, TYPE_Vt, 0 }, /* Vt */ { parse_mdoc_Xr, 0, 0 }, /* Xr */ { NULL, 0, 0 }, /* %A */ { NULL, 0, 0 }, /* %B */ { NULL, 0, 0 }, /* %D */ { NULL, 0, 0 }, /* %I */ { NULL, 0, 0 }, /* %J */ { NULL, 0, 0 }, /* %N */ { NULL, 0, 0 }, /* %O */ { NULL, 0, 0 }, /* %P */ { NULL, 0, 0 }, /* %R */ { NULL, 0, 0 }, /* %T */ { NULL, 0, 0 }, /* %V */ { NULL, 0, 0 }, /* Ac */ { NULL, 0, 0 }, /* Ao */ { NULL, 0, 0 }, /* Aq */ { NULL, TYPE_At, 0 }, /* At */ { NULL, 0, 0 }, /* Bc */ { NULL, 0, 0 }, /* Bf */ { NULL, 0, 0 }, /* Bo */ { NULL, 0, 0 }, /* Bq */ { NULL, TYPE_Bsx, NODE_NOSRC }, /* Bsx */ { NULL, TYPE_Bx, NODE_NOSRC }, /* Bx */ { NULL, 0, 0 }, /* Db */ { NULL, 0, 0 }, /* Dc */ { NULL, 0, 0 }, /* Do */ { NULL, 0, 0 }, /* Dq */ { NULL, 0, 0 }, /* Ec */ { NULL, 0, 0 }, /* Ef */ { NULL, TYPE_Em, 0 }, /* Em */ { NULL, 0, 0 }, /* Eo */ { NULL, TYPE_Fx, NODE_NOSRC }, /* Fx */ { NULL, TYPE_Ms, 0 }, /* Ms */ { NULL, 0, 0 }, /* No */ { NULL, 0, 0 }, /* Ns */ { NULL, TYPE_Nx, NODE_NOSRC }, /* Nx */ { NULL, TYPE_Ox, NODE_NOSRC }, /* Ox */ { NULL, 0, 0 }, /* Pc */ { NULL, 0, 0 }, /* Pf */ { NULL, 0, 0 }, /* Po */ { NULL, 0, 0 }, /* Pq */ { NULL, 0, 0 }, /* Qc */ { NULL, 0, 0 }, /* Ql */ { NULL, 0, 0 }, /* Qo */ { NULL, 0, 0 }, /* Qq */ { NULL, 0, 0 }, /* Re */ { NULL, 0, 0 }, /* Rs */ { NULL, 0, 0 }, /* Sc */ { NULL, 0, 0 }, /* So */ { NULL, 0, 0 }, /* Sq */ { NULL, 0, 0 }, /* Sm */ { NULL, 0, 0 }, /* Sx */ { NULL, TYPE_Sy, 0 }, /* Sy */ { NULL, TYPE_Tn, 0 }, /* Tn */ { NULL, 0, NODE_NOSRC }, /* Ux */ { NULL, 0, 0 }, /* Xc */ { NULL, 0, 0 }, /* Xo */ { parse_mdoc_Fo, 0, 0 }, /* Fo */ { NULL, 0, 0 }, /* Fc */ { NULL, 0, 0 }, /* Oo */ { NULL, 0, 0 }, /* Oc */ { NULL, 0, 0 }, /* Bk */ { NULL, 0, 0 }, /* Ek */ { NULL, 0, 0 }, /* Bt */ { NULL, 0, 0 }, /* Hf */ { NULL, 0, 0 }, /* Fr */ { NULL, 0, 0 }, /* Ud */ { NULL, TYPE_Lb, NODE_NOSRC }, /* Lb */ { NULL, 0, 0 }, /* Lp */ { NULL, TYPE_Lk, 0 }, /* Lk */ { NULL, TYPE_Mt, NODE_NOSRC }, /* Mt */ { NULL, 0, 0 }, /* Brq */ { NULL, 0, 0 }, /* Bro */ { NULL, 0, 0 }, /* Brc */ { NULL, 0, 0 }, /* %C */ { NULL, 0, 0 }, /* Es */ { NULL, 0, 0 }, /* En */ { NULL, TYPE_Dx, NODE_NOSRC }, /* Dx */ { NULL, 0, 0 }, /* %Q */ { NULL, 0, 0 }, /* %U */ { NULL, 0, 0 }, /* Ta */ }; int mandocdb(int argc, char *argv[]) { struct manconf conf; struct mparse *mp; struct dba *dba; const char *path_arg, *progname; size_t j, sz; int ch, i; #if HAVE_PLEDGE if (pledge("stdio rpath wpath cpath", NULL) == -1) { warn("pledge"); return (int)MANDOCLEVEL_SYSERR; } #endif #if HAVE_SANDBOX_INIT if (sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, NULL) == -1) { warnx("sandbox_init"); return (int)MANDOCLEVEL_SYSERR; } #endif memset(&conf, 0, sizeof(conf)); /* * We accept a few different invocations. * The CHECKOP macro makes sure that invocation styles don't * clobber each other. */ #define CHECKOP(_op, _ch) do \ if ((_op) != OP_DEFAULT) { \ warnx("-%c: Conflicting option", (_ch)); \ goto usage; \ } while (/*CONSTCOND*/0) mparse_options = MPARSE_VALIDATE; path_arg = NULL; op = OP_DEFAULT; while ((ch = getopt(argc, argv, "aC:Dd:npQT:tu:v")) != -1) switch (ch) { case 'a': use_all = 1; break; case 'C': CHECKOP(op, ch); path_arg = optarg; op = OP_CONFFILE; break; case 'D': debug++; break; case 'd': CHECKOP(op, ch); path_arg = optarg; op = OP_UPDATE; break; case 'n': nodb = 1; break; case 'p': warnings = 1; break; case 'Q': mparse_options |= MPARSE_QUICK; break; case 'T': if (strcmp(optarg, "utf8") != 0) { warnx("-T%s: Unsupported output format", optarg); goto usage; } write_utf8 = 1; break; case 't': CHECKOP(op, ch); dup2(STDOUT_FILENO, STDERR_FILENO); op = OP_TEST; nodb = warnings = 1; break; case 'u': CHECKOP(op, ch); path_arg = optarg; op = OP_DELETE; break; case 'v': /* Compatibility with espie@'s makewhatis. */ break; default: goto usage; } argc -= optind; argv += optind; #if HAVE_PLEDGE if (nodb) { if (pledge("stdio rpath", NULL) == -1) { warn("pledge"); return (int)MANDOCLEVEL_SYSERR; } } #endif if (op == OP_CONFFILE && argc > 0) { warnx("-C: Too many arguments"); goto usage; } exitcode = (int)MANDOCLEVEL_OK; mchars_alloc(); mp = mparse_alloc(mparse_options, MANDOC_OS_OTHER, NULL); mandoc_ohash_init(&mpages, 6, offsetof(struct mpage, inodev)); mandoc_ohash_init(&mlinks, 6, offsetof(struct mlink, file)); if (op == OP_UPDATE || op == OP_DELETE || op == OP_TEST) { /* * Most of these deal with a specific directory. * Jump into that directory first. */ if (op != OP_TEST && set_basedir(path_arg, 1) == 0) goto out; dba = nodb ? dba_new(128) : dba_read(MANDOC_DB); if (dba != NULL) { /* * The existing database is usable. Process * all files specified on the command-line. */ use_all = 1; for (i = 0; i < argc; i++) filescan(argv[i]); if (nodb == 0) dbprune(dba); } else { /* Database missing or corrupt. */ if (op != OP_UPDATE || errno != ENOENT) say(MANDOC_DB, "%s: Automatically recreating" " from scratch", strerror(errno)); exitcode = (int)MANDOCLEVEL_OK; op = OP_DEFAULT; if (treescan() == 0) goto out; dba = dba_new(128); } if (op != OP_DELETE) mpages_merge(dba, mp); if (nodb == 0) dbwrite(dba); dba_free(dba); } else { /* * If we have arguments, use them as our manpaths. * If we don't, use man.conf(5). */ if (argc > 0) { conf.manpath.paths = mandoc_reallocarray(NULL, argc, sizeof(char *)); conf.manpath.sz = (size_t)argc; for (i = 0; i < argc; i++) conf.manpath.paths[i] = mandoc_strdup(argv[i]); } else manconf_parse(&conf, path_arg, NULL, NULL); if (conf.manpath.sz == 0) { exitcode = (int)MANDOCLEVEL_BADARG; say("", "Empty manpath"); } /* * First scan the tree rooted at a base directory, then * build a new database and finally move it into place. * Ignore zero-length directories and strip trailing * slashes. */ for (j = 0; j < conf.manpath.sz; j++) { sz = strlen(conf.manpath.paths[j]); if (sz && conf.manpath.paths[j][sz - 1] == '/') conf.manpath.paths[j][--sz] = '\0'; if (sz == 0) continue; if (j) { mandoc_ohash_init(&mpages, 6, offsetof(struct mpage, inodev)); mandoc_ohash_init(&mlinks, 6, offsetof(struct mlink, file)); } if (set_basedir(conf.manpath.paths[j], argc > 0) == 0) continue; if (treescan() == 0) continue; dba = dba_new(128); mpages_merge(dba, mp); if (nodb == 0) dbwrite(dba); dba_free(dba); if (j + 1 < conf.manpath.sz) { mpages_free(); ohash_delete(&mpages); ohash_delete(&mlinks); } } } out: manconf_free(&conf); mparse_free(mp); mchars_free(); mpages_free(); ohash_delete(&mpages); ohash_delete(&mlinks); return exitcode; usage: progname = getprogname(); fprintf(stderr, "usage: %s [-aDnpQ] [-C file] [-Tutf8]\n" " %s [-aDnpQ] [-Tutf8] dir ...\n" " %s [-DnpQ] [-Tutf8] -d dir [file ...]\n" " %s [-Dnp] -u dir [file ...]\n" " %s [-Q] -t file ...\n", progname, progname, progname, progname, progname); return (int)MANDOCLEVEL_BADARG; } /* * To get a singly linked list in alpha order while inserting entries * at the beginning, process directory entries in reverse alpha order. */ static int #if HAVE_FTS_COMPARE_CONST fts_compare(const FTSENT *const *a, const FTSENT *const *b) #else fts_compare(const FTSENT **a, const FTSENT **b) #endif { return -strcmp((*a)->fts_name, (*b)->fts_name); } /* * Scan a directory tree rooted at "basedir" for manpages. * We use fts(), scanning directory parts along the way for clues to our * section and architecture. * * If use_all has been specified, grok all files. * If not, sanitise paths to the following: * * [./]man*[/]/.
* or * [./]cat
[/]/.0 * * TODO: accommodate for multi-language directories. */ static int treescan(void) { char buf[PATH_MAX]; FTS *f; FTSENT *ff; struct mlink *mlink; int gzip; enum form dform; char *dsec, *arch, *fsec, *cp; const char *path; const char *argv[2]; argv[0] = "."; argv[1] = NULL; f = fts_open((char * const *)argv, FTS_PHYSICAL | FTS_NOCHDIR, fts_compare); if (f == NULL) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "&fts_open"); return 0; } dsec = arch = NULL; dform = FORM_NONE; while ((ff = fts_read(f)) != NULL) { path = ff->fts_path + 2; switch (ff->fts_info) { /* * Symbolic links require various sanity checks, * then get handled just like regular files. */ case FTS_SL: if (realpath(path, buf) == NULL) { if (warnings) say(path, "&realpath"); continue; } if (strncmp(buf, basedir, basedir_len) != 0 #ifdef READ_ALLOWED_PATH && !read_allowed(buf) #endif ) { if (warnings) say("", "%s: outside base directory", buf); continue; } /* Use logical inode to avoid mpages dupe. */ if (stat(path, ff->fts_statp) == -1) { if (warnings) say(path, "&stat"); continue; } if ((ff->fts_statp->st_mode & S_IFMT) != S_IFREG) continue; /* FALLTHROUGH */ /* * If we're a regular file, add an mlink by using the * stored directory data and handling the filename. */ case FTS_F: if ( ! strcmp(path, MANDOC_DB)) continue; if ( ! use_all && ff->fts_level < 2) { if (warnings) say(path, "Extraneous file"); continue; } gzip = 0; fsec = NULL; while (fsec == NULL) { fsec = strrchr(ff->fts_name, '.'); if (fsec == NULL || strcmp(fsec+1, "gz")) break; gzip = 1; *fsec = '\0'; fsec = NULL; } if (fsec == NULL) { if ( ! use_all) { if (warnings) say(path, "No filename suffix"); continue; } } else if ( ! strcmp(++fsec, "html")) { if (warnings) say(path, "Skip html"); continue; } else if ( ! strcmp(fsec, "ps")) { if (warnings) say(path, "Skip ps"); continue; } else if ( ! strcmp(fsec, "pdf")) { if (warnings) say(path, "Skip pdf"); continue; } else if ( ! use_all && ((dform == FORM_SRC && strncmp(fsec, dsec, strlen(dsec))) || (dform == FORM_CAT && strcmp(fsec, "0")))) { if (warnings) say(path, "Wrong filename suffix"); continue; } else fsec[-1] = '\0'; mlink = mandoc_calloc(1, sizeof(struct mlink)); if (strlcpy(mlink->file, path, sizeof(mlink->file)) >= sizeof(mlink->file)) { say(path, "Filename too long"); free(mlink); continue; } mlink->dform = dform; mlink->dsec = dsec; mlink->arch = arch; mlink->name = ff->fts_name; mlink->fsec = fsec; mlink->gzip = gzip; mlink_add(mlink, ff->fts_statp); continue; case FTS_D: case FTS_DP: break; default: if (warnings) say(path, "Not a regular file"); continue; } switch (ff->fts_level) { case 0: /* Ignore the root directory. */ break; case 1: /* * This might contain manX/ or catX/. * Try to infer this from the name. * If we're not in use_all, enforce it. */ cp = ff->fts_name; if (ff->fts_info == FTS_DP) { dform = FORM_NONE; dsec = NULL; break; } if ( ! strncmp(cp, "man", 3)) { dform = FORM_SRC; dsec = cp + 3; } else if ( ! strncmp(cp, "cat", 3)) { dform = FORM_CAT; dsec = cp + 3; } else { dform = FORM_NONE; dsec = NULL; } if (dsec != NULL || use_all) break; if (warnings) say(path, "Unknown directory part"); fts_set(f, ff, FTS_SKIP); break; case 2: /* * Possibly our architecture. * If we're descending, keep tabs on it. */ if (ff->fts_info != FTS_DP && dsec != NULL) arch = ff->fts_name; else arch = NULL; break; default: if (ff->fts_info == FTS_DP || use_all) break; if (warnings) say(path, "Extraneous directory part"); fts_set(f, ff, FTS_SKIP); break; } } fts_close(f); return 1; } /* * Add a file to the mlinks table. * Do not verify that it's a "valid" looking manpage (we'll do that * later). * * Try to infer the manual section, architecture, and page name from the * path, assuming it looks like * * [./]man*[/]/.
* or * [./]cat
[/]/.0 * * See treescan() for the fts(3) version of this. */ static void filescan(const char *infile) { struct stat st; struct mlink *mlink; char *linkfile, *p, *realdir, *start, *usefile; size_t realdir_len; assert(use_all); if (strncmp(infile, "./", 2) == 0) infile += 2; /* * We have to do lstat(2) before realpath(3) loses * the information whether this is a symbolic link. * We need to know that because for symbolic links, * we want to use the orginal file name, while for * regular files, we want to use the real path. */ if (lstat(infile, &st) == -1) { exitcode = (int)MANDOCLEVEL_BADARG; say(infile, "&lstat"); return; } else if (S_ISREG(st.st_mode) == 0 && S_ISLNK(st.st_mode) == 0) { exitcode = (int)MANDOCLEVEL_BADARG; say(infile, "Not a regular file"); return; } /* * We have to resolve the file name to the real path * in any case for the base directory check. */ if ((usefile = realpath(infile, NULL)) == NULL) { exitcode = (int)MANDOCLEVEL_BADARG; say(infile, "&realpath"); return; } if (op == OP_TEST) start = usefile; else if (strncmp(usefile, basedir, basedir_len) == 0) start = usefile + basedir_len; #ifdef READ_ALLOWED_PATH else if (read_allowed(usefile)) start = usefile; #endif else { exitcode = (int)MANDOCLEVEL_BADARG; say("", "%s: outside base directory", infile); free(usefile); return; } /* * Now we are sure the file is inside our tree. * If it is a symbolic link, ignore the real path * and use the original name. */ do { if (S_ISLNK(st.st_mode) == 0) break; /* * Some implementations of realpath(3) may succeed * even if the target of the link does not exist, * so check again for extra safety. */ if (stat(usefile, &st) == -1) { exitcode = (int)MANDOCLEVEL_BADARG; say(infile, "&stat"); free(usefile); return; } linkfile = mandoc_strdup(infile); if (op == OP_TEST) { free(usefile); start = usefile = linkfile; break; } if (strncmp(infile, basedir, basedir_len) == 0) { free(usefile); usefile = linkfile; start = usefile + basedir_len; break; } /* * This symbolic link points into the basedir * from the outside. Let's see whether any of * the parent directories resolve to the basedir. */ p = strchr(linkfile, '\0'); do { while (*--p != '/') continue; *p = '\0'; if ((realdir = realpath(linkfile, NULL)) == NULL) { exitcode = (int)MANDOCLEVEL_BADARG; say(infile, "&realpath"); free(linkfile); free(usefile); return; } realdir_len = strlen(realdir) + 1; free(realdir); *p = '/'; } while (realdir_len > basedir_len); /* * If one of the directories resolves to the basedir, * use the rest of the original name. * Otherwise, the best we can do * is to use the filename pointed to. */ if (realdir_len == basedir_len) { free(usefile); usefile = linkfile; start = p + 1; } else { free(linkfile); start = usefile + basedir_len; } } while (/* CONSTCOND */ 0); mlink = mandoc_calloc(1, sizeof(struct mlink)); mlink->dform = FORM_NONE; if (strlcpy(mlink->file, start, sizeof(mlink->file)) >= sizeof(mlink->file)) { say(start, "Filename too long"); free(mlink); free(usefile); return; } /* * In test mode or when the original name is absolute * but outside our tree, guess the base directory. */ if (op == OP_TEST || (start == usefile && *start == '/')) { if (strncmp(usefile, "man/", 4) == 0) start = usefile + 4; else if ((start = strstr(usefile, "/man/")) != NULL) start += 5; else start = usefile; } /* * First try to guess our directory structure. * If we find a separator, try to look for man* or cat*. * If we find one of these and what's underneath is a directory, * assume it's an architecture. */ if ((p = strchr(start, '/')) != NULL) { *p++ = '\0'; if (strncmp(start, "man", 3) == 0) { mlink->dform = FORM_SRC; mlink->dsec = start + 3; } else if (strncmp(start, "cat", 3) == 0) { mlink->dform = FORM_CAT; mlink->dsec = start + 3; } start = p; if (mlink->dsec != NULL && (p = strchr(start, '/')) != NULL) { *p++ = '\0'; mlink->arch = start; start = p; } } /* * Now check the file suffix. * Suffix of `.0' indicates a catpage, `.1-9' is a manpage. */ p = strrchr(start, '\0'); while (p-- > start && *p != '/' && *p != '.') continue; if (*p == '.') { *p++ = '\0'; mlink->fsec = p; } /* * Now try to parse the name. * Use the filename portion of the path. */ mlink->name = start; if ((p = strrchr(start, '/')) != NULL) { mlink->name = p + 1; *p = '\0'; } mlink_add(mlink, &st); free(usefile); } static void mlink_add(struct mlink *mlink, const struct stat *st) { struct inodev inodev; struct mpage *mpage; unsigned int slot; assert(NULL != mlink->file); mlink->dsec = mandoc_strdup(mlink->dsec ? mlink->dsec : ""); mlink->arch = mandoc_strdup(mlink->arch ? mlink->arch : ""); mlink->name = mandoc_strdup(mlink->name ? mlink->name : ""); mlink->fsec = mandoc_strdup(mlink->fsec ? mlink->fsec : ""); if ('0' == *mlink->fsec) { free(mlink->fsec); mlink->fsec = mandoc_strdup(mlink->dsec); mlink->fform = FORM_CAT; } else if ('1' <= *mlink->fsec && '9' >= *mlink->fsec) mlink->fform = FORM_SRC; else mlink->fform = FORM_NONE; slot = ohash_qlookup(&mlinks, mlink->file); assert(NULL == ohash_find(&mlinks, slot)); ohash_insert(&mlinks, slot, mlink); memset(&inodev, 0, sizeof(inodev)); /* Clear padding. */ inodev.st_ino = st->st_ino; inodev.st_dev = st->st_dev; slot = ohash_lookup_memory(&mpages, (char *)&inodev, sizeof(struct inodev), inodev.st_ino); mpage = ohash_find(&mpages, slot); if (NULL == mpage) { mpage = mandoc_calloc(1, sizeof(struct mpage)); mpage->inodev.st_ino = inodev.st_ino; mpage->inodev.st_dev = inodev.st_dev; mpage->form = FORM_NONE; mpage->next = mpage_head; mpage_head = mpage; ohash_insert(&mpages, slot, mpage); } else mlink->next = mpage->mlinks; mpage->mlinks = mlink; mlink->mpage = mpage; } static void mlink_free(struct mlink *mlink) { free(mlink->dsec); free(mlink->arch); free(mlink->name); free(mlink->fsec); free(mlink); } static void mpages_free(void) { struct mpage *mpage; struct mlink *mlink; while ((mpage = mpage_head) != NULL) { while ((mlink = mpage->mlinks) != NULL) { mpage->mlinks = mlink->next; mlink_free(mlink); } mpage_head = mpage->next; free(mpage->sec); free(mpage->arch); free(mpage->title); free(mpage->desc); free(mpage); } } /* * For each mlink to the mpage, check whether the path looks like * it is formatted, and if it does, check whether a source manual * exists by the same name, ignoring the suffix. * If both conditions hold, drop the mlink. */ static void mlinks_undupe(struct mpage *mpage) { char buf[PATH_MAX]; struct mlink **prev; struct mlink *mlink; char *bufp; mpage->form = FORM_CAT; prev = &mpage->mlinks; while (NULL != (mlink = *prev)) { if (FORM_CAT != mlink->dform) { mpage->form = FORM_NONE; goto nextlink; } (void)strlcpy(buf, mlink->file, sizeof(buf)); bufp = strstr(buf, "cat"); assert(NULL != bufp); memcpy(bufp, "man", 3); if (NULL != (bufp = strrchr(buf, '.'))) *++bufp = '\0'; (void)strlcat(buf, mlink->dsec, sizeof(buf)); if (NULL == ohash_find(&mlinks, ohash_qlookup(&mlinks, buf))) goto nextlink; if (warnings) say(mlink->file, "Man source exists: %s", buf); if (use_all) goto nextlink; *prev = mlink->next; mlink_free(mlink); continue; nextlink: prev = &(*prev)->next; } } static void mlink_check(struct mpage *mpage, struct mlink *mlink) { struct str *str; unsigned int slot; /* * Check whether the manual section given in a file * agrees with the directory where the file is located. * Some manuals have suffixes like (3p) on their * section number either inside the file or in the * directory name, some are linked into more than one * section, like encrypt(1) = makekey(8). */ if (FORM_SRC == mpage->form && strcasecmp(mpage->sec, mlink->dsec)) say(mlink->file, "Section \"%s\" manual in %s directory", mpage->sec, mlink->dsec); /* * Manual page directories exist for each kernel * architecture as returned by machine(1). * However, many manuals only depend on the * application architecture as returned by arch(1). * For example, some (2/ARM) manuals are shared * across the "armish" and "zaurus" kernel * architectures. * A few manuals are even shared across completely * different architectures, for example fdformat(1) * on amd64, i386, and sparc64. */ if (strcasecmp(mpage->arch, mlink->arch)) say(mlink->file, "Architecture \"%s\" manual in " "\"%s\" directory", mpage->arch, mlink->arch); /* * XXX * parse_cat() doesn't set NAME_TITLE yet. */ if (FORM_CAT == mpage->form) return; /* * Check whether this mlink * appears as a name in the NAME section. */ slot = ohash_qlookup(&names, mlink->name); str = ohash_find(&names, slot); assert(NULL != str); if ( ! (NAME_TITLE & str->mask)) say(mlink->file, "Name missing in NAME section"); } /* * Run through the files in the global vector "mpages" * and add them to the database specified in "basedir". * * This handles the parsing scheme itself, using the cues of directory * and filename to determine whether the file is parsable or not. */ static void mpages_merge(struct dba *dba, struct mparse *mp) { struct mpage *mpage, *mpage_dest; struct mlink *mlink, *mlink_dest; struct roff_meta *meta; char *cp; int fd; for (mpage = mpage_head; mpage != NULL; mpage = mpage->next) { mlinks_undupe(mpage); if ((mlink = mpage->mlinks) == NULL) continue; name_mask = NAME_MASK; mandoc_ohash_init(&names, 4, offsetof(struct str, key)); mandoc_ohash_init(&strings, 6, offsetof(struct str, key)); mparse_reset(mp); meta = NULL; if ((fd = mparse_open(mp, mlink->file)) == -1) { say(mlink->file, "&open"); goto nextpage; } /* * Interpret the file as mdoc(7) or man(7) source * code, unless it is known to be formatted. */ if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) { mparse_readfd(mp, fd, mlink->file); close(fd); fd = -1; meta = mparse_result(mp); } if (meta != NULL && meta->sodest != NULL) { mlink_dest = ohash_find(&mlinks, ohash_qlookup(&mlinks, meta->sodest)); if (mlink_dest == NULL) { mandoc_asprintf(&cp, "%s.gz", meta->sodest); mlink_dest = ohash_find(&mlinks, ohash_qlookup(&mlinks, cp)); free(cp); } if (mlink_dest != NULL) { /* The .so target exists. */ mpage_dest = mlink_dest->mpage; while (1) { mlink->mpage = mpage_dest; /* * If the target was already * processed, add the links * to the database now. * Otherwise, this will * happen when we come * to the target. */ if (mpage_dest->dba != NULL) dbadd_mlink(mlink); if (mlink->next == NULL) break; mlink = mlink->next; } /* Move all links to the target. */ mlink->next = mlink_dest->next; mlink_dest->next = mpage->mlinks; mpage->mlinks = NULL; goto nextpage; } meta->macroset = MACROSET_NONE; } if (meta != NULL && meta->macroset == MACROSET_MDOC) { mpage->form = FORM_SRC; mpage->sec = meta->msec; mpage->sec = mandoc_strdup( mpage->sec == NULL ? "" : mpage->sec); mpage->arch = meta->arch; mpage->arch = mandoc_strdup( mpage->arch == NULL ? "" : mpage->arch); mpage->title = mandoc_strdup(meta->title); } else if (meta != NULL && meta->macroset == MACROSET_MAN) { if (*meta->msec != '\0' || *meta->title != '\0') { mpage->form = FORM_SRC; mpage->sec = mandoc_strdup(meta->msec); mpage->arch = mandoc_strdup(mlink->arch); mpage->title = mandoc_strdup(meta->title); } else meta = NULL; } assert(mpage->desc == NULL); if (meta == NULL || meta->sodest != NULL) { mpage->sec = mandoc_strdup(mlink->dsec); mpage->arch = mandoc_strdup(mlink->arch); mpage->title = mandoc_strdup(mlink->name); if (meta == NULL) { mpage->form = FORM_CAT; parse_cat(mpage, fd); } else mpage->form = FORM_SRC; } else if (meta->macroset == MACROSET_MDOC) parse_mdoc(mpage, meta, meta->first); else parse_man(mpage, meta, meta->first); if (mpage->desc == NULL) { mpage->desc = mandoc_strdup(mlink->name); if (warnings) say(mlink->file, "No one-line description, " "using filename \"%s\"", mlink->name); } for (mlink = mpage->mlinks; mlink != NULL; mlink = mlink->next) { putkey(mpage, mlink->name, NAME_FILE); if (warnings && !use_all) mlink_check(mpage, mlink); } dbadd(dba, mpage); nextpage: ohash_delete(&strings); ohash_delete(&names); } } static void parse_cat(struct mpage *mpage, int fd) { FILE *stream; struct mlink *mlink; char *line, *p, *title, *sec; size_t linesz, plen, titlesz; ssize_t len; int offs; mlink = mpage->mlinks; stream = fd == -1 ? fopen(mlink->file, "r") : fdopen(fd, "r"); if (stream == NULL) { if (fd != -1) close(fd); if (warnings) say(mlink->file, "&fopen"); return; } line = NULL; linesz = 0; /* Parse the section number from the header line. */ while (getline(&line, &linesz, stream) != -1) { if (*line == '\n') continue; if ((sec = strchr(line, '(')) == NULL) break; if ((p = strchr(++sec, ')')) == NULL) break; free(mpage->sec); mpage->sec = mandoc_strndup(sec, p - sec); if (warnings && *mlink->dsec != '\0' && strcasecmp(mpage->sec, mlink->dsec)) say(mlink->file, "Section \"%s\" manual in %s directory", mpage->sec, mlink->dsec); break; } /* Skip to first blank line. */ while (line == NULL || *line != '\n') if (getline(&line, &linesz, stream) == -1) break; /* * Assume the first line that is not indented * is the first section header. Skip to it. */ while (getline(&line, &linesz, stream) != -1) if (*line != '\n' && *line != ' ') break; /* * Read up until the next section into a buffer. * Strip the leading and trailing newline from each read line, * appending a trailing space. * Ignore empty (whitespace-only) lines. */ titlesz = 0; title = NULL; while ((len = getline(&line, &linesz, stream)) != -1) { if (*line != ' ') break; offs = 0; while (isspace((unsigned char)line[offs])) offs++; if (line[offs] == '\0') continue; title = mandoc_realloc(title, titlesz + len - offs); memcpy(title + titlesz, line + offs, len - offs); titlesz += len - offs; title[titlesz - 1] = ' '; } free(line); /* * If no page content can be found, or the input line * is already the next section header, or there is no * trailing newline, reuse the page title as the page * description. */ if (NULL == title || '\0' == *title) { if (warnings) say(mlink->file, "Cannot find NAME section"); fclose(stream); free(title); return; } title[titlesz - 1] = '\0'; /* * Skip to the first dash. * Use the remaining line as the description (no more than 70 * bytes). */ if (NULL != (p = strstr(title, "- "))) { for (p += 2; ' ' == *p || '\b' == *p; p++) /* Skip to next word. */ ; } else { if (warnings) say(mlink->file, "No dash in title line, " "reusing \"%s\" as one-line description", title); p = title; } plen = strlen(p); /* Strip backspace-encoding from line. */ while (NULL != (line = memchr(p, '\b', plen))) { len = line - p; if (0 == len) { memmove(line, line + 1, plen--); continue; } memmove(line - 1, line + 1, plen - len); plen -= 2; } /* * Cut off excessive one-line descriptions. * Bad pages are not worth better heuristics. */ mpage->desc = mandoc_strndup(p, 150); fclose(stream); free(title); } /* * Put a type/word pair into the word database for this particular file. */ static void putkey(const struct mpage *mpage, char *value, uint64_t type) { putkeys(mpage, value, strlen(value), type); } /* * Grok all nodes at or below a certain mdoc node into putkey(). */ static void putmdockey(const struct mpage *mpage, const struct roff_node *n, uint64_t m, int taboo) { for ( ; NULL != n; n = n->next) { if (n->flags & taboo) continue; if (NULL != n->child) putmdockey(mpage, n->child, m, taboo); if (n->type == ROFFT_TEXT) putkey(mpage, n->string, m); } } static void parse_man(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { const struct roff_node *head, *body; char *start, *title; char byte; size_t sz; if (n == NULL) return; /* * We're only searching for one thing: the first text child in * the BODY of a NAME section. Since we don't keep track of * sections in -man, run some hoops to find out whether we're in * the correct section or not. */ if (n->type == ROFFT_BODY && n->tok == MAN_SH) { body = n; if ((head = body->parent->head) != NULL && (head = head->child) != NULL && head->next == NULL && head->type == ROFFT_TEXT && strcmp(head->string, "NAME") == 0 && body->child != NULL) { /* * Suck the entire NAME section into memory. * Yes, we might run away. * But too many manuals have big, spread-out * NAME sections over many lines. */ title = NULL; deroff(&title, body); if (NULL == title) return; /* * Go through a special heuristic dance here. * Conventionally, one or more manual names are * comma-specified prior to a whitespace, then a * dash, then a description. Try to puzzle out * the name parts here. */ start = title; for ( ;; ) { sz = strcspn(start, " ,"); if ('\0' == start[sz]) break; byte = start[sz]; start[sz] = '\0'; /* * Assume a stray trailing comma in the * name list if a name begins with a dash. */ if ('-' == start[0] || ('\\' == start[0] && '-' == start[1])) break; putkey(mpage, start, NAME_TITLE); if ( ! (mpage->name_head_done || strcasecmp(start, meta->title))) { putkey(mpage, start, NAME_HEAD); mpage->name_head_done = 1; } if (' ' == byte) { start += sz + 1; break; } assert(',' == byte); start += sz + 1; while (' ' == *start) start++; } if (start == title) { putkey(mpage, start, NAME_TITLE); if ( ! (mpage->name_head_done || strcasecmp(start, meta->title))) { putkey(mpage, start, NAME_HEAD); mpage->name_head_done = 1; } free(title); return; } while (isspace((unsigned char)*start)) start++; if (0 == strncmp(start, "-", 1)) start += 1; else if (0 == strncmp(start, "\\-\\-", 4)) start += 4; else if (0 == strncmp(start, "\\-", 2)) start += 2; else if (0 == strncmp(start, "\\(en", 4)) start += 4; else if (0 == strncmp(start, "\\(em", 4)) start += 4; while (' ' == *start) start++; /* * Cut off excessive one-line descriptions. * Bad pages are not worth better heuristics. */ mpage->desc = mandoc_strndup(start, 150); free(title); return; } } for (n = n->child; n; n = n->next) { if (NULL != mpage->desc) break; parse_man(mpage, meta, n); } } static void parse_mdoc(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { const struct mdoc_handler *handler; for (n = n->child; n != NULL; n = n->next) { if (n->tok == TOKEN_NONE || n->tok < ROFF_MAX) continue; assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); handler = mdoc_handlers + (n->tok - MDOC_Dd); if (n->flags & handler->taboo) continue; switch (n->type) { case ROFFT_ELEM: case ROFFT_BLOCK: case ROFFT_HEAD: case ROFFT_BODY: case ROFFT_TAIL: if (handler->fp != NULL && (*handler->fp)(mpage, meta, n) == 0) break; if (handler->mask) putmdockey(mpage, n->child, handler->mask, handler->taboo); break; default: continue; } if (NULL != n->child) parse_mdoc(mpage, meta, n); } } static int parse_mdoc_Fa(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { uint64_t mask; mask = TYPE_Fa; if (n->sec == SEC_SYNOPSIS) mask |= TYPE_Vt; putmdockey(mpage, n->child, mask, 0); return 0; } static int parse_mdoc_Fd(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { char *start, *end; size_t sz; if (SEC_SYNOPSIS != n->sec || NULL == (n = n->child) || n->type != ROFFT_TEXT) return 0; /* * Only consider those `Fd' macro fields that begin with an * "inclusion" token (versus, e.g., #define). */ if (strcmp("#include", n->string)) return 0; if ((n = n->next) == NULL || n->type != ROFFT_TEXT) return 0; /* * Strip away the enclosing angle brackets and make sure we're * not zero-length. */ start = n->string; if ('<' == *start || '"' == *start) start++; if (0 == (sz = strlen(start))) return 0; end = &start[(int)sz - 1]; if ('>' == *end || '"' == *end) end--; if (end > start) putkeys(mpage, start, end - start + 1, TYPE_In); return 0; } static void parse_mdoc_fname(struct mpage *mpage, const struct roff_node *n) { char *cp; size_t sz; if (n->type != ROFFT_TEXT) return; /* Skip function pointer punctuation. */ cp = n->string; while (*cp == '(' || *cp == '*') cp++; sz = strcspn(cp, "()"); putkeys(mpage, cp, sz, TYPE_Fn); if (n->sec == SEC_SYNOPSIS) putkeys(mpage, cp, sz, NAME_SYN); } static int parse_mdoc_Fn(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { uint64_t mask; if (n->child == NULL) return 0; parse_mdoc_fname(mpage, n->child); n = n->child->next; if (n != NULL && n->type == ROFFT_TEXT) { mask = TYPE_Fa; if (n->sec == SEC_SYNOPSIS) mask |= TYPE_Vt; putmdockey(mpage, n, mask, 0); } return 0; } static int parse_mdoc_Fo(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { if (n->type != ROFFT_HEAD) return 1; if (n->child != NULL) parse_mdoc_fname(mpage, n->child); return 0; } static int parse_mdoc_Va(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { char *cp; if (n->type != ROFFT_ELEM && n->type != ROFFT_BODY) return 0; if (n->child != NULL && n->child->next == NULL && n->child->type == ROFFT_TEXT) return 1; cp = NULL; deroff(&cp, n); if (cp != NULL) { putkey(mpage, cp, TYPE_Vt | (n->tok == MDOC_Va || n->type == ROFFT_BODY ? TYPE_Va : 0)); free(cp); } return 0; } static int parse_mdoc_Xr(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { char *cp; if (NULL == (n = n->child)) return 0; if (NULL == n->next) { putkey(mpage, n->string, TYPE_Xr); return 0; } mandoc_asprintf(&cp, "%s(%s)", n->string, n->next->string); putkey(mpage, cp, TYPE_Xr); free(cp); return 0; } static int parse_mdoc_Nd(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { if (n->type == ROFFT_BODY) deroff(&mpage->desc, n); return 0; } static int parse_mdoc_Nm(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { if (SEC_NAME == n->sec) putmdockey(mpage, n->child, NAME_TITLE, 0); else if (n->sec == SEC_SYNOPSIS && n->type == ROFFT_HEAD) { if (n->child == NULL) putkey(mpage, meta->name, NAME_SYN); else putmdockey(mpage, n->child, NAME_SYN, 0); } if ( ! (mpage->name_head_done || n->child == NULL || n->child->string == NULL || strcasecmp(n->child->string, meta->title))) { putkey(mpage, n->child->string, NAME_HEAD); mpage->name_head_done = 1; } return 0; } static int parse_mdoc_Sh(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { return n->sec == SEC_CUSTOM && n->type == ROFFT_HEAD; } static int parse_mdoc_head(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { return n->type == ROFFT_HEAD; } /* * Add a string to the hash table for the current manual. * Each string has a bitmask telling which macros it belongs to. * When we finish the manual, we'll dump the table. */ static void putkeys(const struct mpage *mpage, char *cp, size_t sz, uint64_t v) { struct ohash *htab; struct str *s; const char *end; unsigned int slot; int i, mustfree; if (0 == sz) return; mustfree = render_string(&cp, &sz); if (TYPE_Nm & v) { htab = &names; v &= name_mask; if (v & NAME_FIRST) name_mask &= ~NAME_FIRST; if (debug > 1) say(mpage->mlinks->file, "Adding name %*s, bits=0x%llx", (int)sz, cp, (unsigned long long)v); } else { htab = &strings; if (debug > 1) for (i = 0; i < KEY_MAX; i++) if ((uint64_t)1 << i & v) say(mpage->mlinks->file, "Adding key %s=%*s", mansearch_keynames[i], (int)sz, cp); } end = cp + sz; slot = ohash_qlookupi(htab, cp, &end); s = ohash_find(htab, slot); if (NULL != s && mpage == s->mpage) { s->mask |= v; return; } else if (NULL == s) { s = mandoc_calloc(1, sizeof(struct str) + sz + 1); memcpy(s->key, cp, sz); ohash_insert(htab, slot, s); } s->mpage = mpage; s->mask = v; if (mustfree) free(cp); } /* * Take a Unicode codepoint and produce its UTF-8 encoding. * This isn't the best way to do this, but it works. * The magic numbers are from the UTF-8 packaging. * They're not as scary as they seem: read the UTF-8 spec for details. */ static size_t utf8(unsigned int cp, char out[7]) { size_t rc; rc = 0; if (cp <= 0x0000007F) { rc = 1; out[0] = (char)cp; } else if (cp <= 0x000007FF) { rc = 2; out[0] = (cp >> 6 & 31) | 192; out[1] = (cp & 63) | 128; } else if (cp <= 0x0000FFFF) { rc = 3; out[0] = (cp >> 12 & 15) | 224; out[1] = (cp >> 6 & 63) | 128; out[2] = (cp & 63) | 128; } else if (cp <= 0x001FFFFF) { rc = 4; out[0] = (cp >> 18 & 7) | 240; out[1] = (cp >> 12 & 63) | 128; out[2] = (cp >> 6 & 63) | 128; out[3] = (cp & 63) | 128; } else if (cp <= 0x03FFFFFF) { rc = 5; out[0] = (cp >> 24 & 3) | 248; out[1] = (cp >> 18 & 63) | 128; out[2] = (cp >> 12 & 63) | 128; out[3] = (cp >> 6 & 63) | 128; out[4] = (cp & 63) | 128; } else if (cp <= 0x7FFFFFFF) { rc = 6; out[0] = (cp >> 30 & 1) | 252; out[1] = (cp >> 24 & 63) | 128; out[2] = (cp >> 18 & 63) | 128; out[3] = (cp >> 12 & 63) | 128; out[4] = (cp >> 6 & 63) | 128; out[5] = (cp & 63) | 128; } else return 0; out[rc] = '\0'; return rc; } /* * If the string contains escape sequences, * replace it with an allocated rendering and return 1, * such that the caller can free it after use. * Otherwise, do nothing and return 0. */ static int render_string(char **public, size_t *psz) { const char *src, *scp, *addcp, *seq; char *dst; size_t ssz, dsz, addsz; char utfbuf[7], res[6]; int seqlen, unicode; res[0] = '\\'; res[1] = '\t'; res[2] = ASCII_NBRSP; res[3] = ASCII_HYPH; res[4] = ASCII_BREAK; res[5] = '\0'; src = scp = *public; ssz = *psz; dst = NULL; dsz = 0; while (scp < src + *psz) { /* Leave normal characters unchanged. */ if (strchr(res, *scp) == NULL) { if (dst != NULL) dst[dsz++] = *scp; scp++; continue; } /* * Found something that requires replacing, * make sure we have a destination buffer. */ if (dst == NULL) { dst = mandoc_malloc(ssz + 1); dsz = scp - src; memcpy(dst, src, dsz); } /* Handle single-char special characters. */ switch (*scp) { case '\\': break; case '\t': case ASCII_NBRSP: dst[dsz++] = ' '; scp++; continue; case ASCII_HYPH: dst[dsz++] = '-'; /* FALLTHROUGH */ case ASCII_BREAK: scp++; continue; default: abort(); } /* * Found an escape sequence. * Read past the slash, then parse it. * Ignore everything except characters. */ scp++; if (mandoc_escape(&scp, &seq, &seqlen) != ESCAPE_SPECIAL) continue; /* * Render the special character * as either UTF-8 or ASCII. */ if (write_utf8) { unicode = mchars_spec2cp(seq, seqlen); if (unicode <= 0) continue; addsz = utf8(unicode, utfbuf); if (addsz == 0) continue; addcp = utfbuf; } else { addcp = mchars_spec2str(seq, seqlen, &addsz); if (addcp == NULL) continue; if (*addcp == ASCII_NBRSP) { addcp = " "; addsz = 1; } } /* Copy the rendered glyph into the stream. */ ssz += addsz; dst = mandoc_realloc(dst, ssz + 1); memcpy(dst + dsz, addcp, addsz); dsz += addsz; } if (dst != NULL) { *public = dst; *psz = dsz; } /* Trim trailing whitespace and NUL-terminate. */ while (*psz > 0 && (*public)[*psz - 1] == ' ') --*psz; if (dst != NULL) { (*public)[*psz] = '\0'; return 1; } else return 0; } static void dbadd_mlink(const struct mlink *mlink) { dba_page_alias(mlink->mpage->dba, mlink->name, NAME_FILE); dba_page_add(mlink->mpage->dba, DBP_SECT, mlink->dsec); dba_page_add(mlink->mpage->dba, DBP_SECT, mlink->fsec); dba_page_add(mlink->mpage->dba, DBP_ARCH, mlink->arch); dba_page_add(mlink->mpage->dba, DBP_FILE, mlink->file); } /* * Flush the current page's terms (and their bits) into the database. * Also, handle escape sequences at the last possible moment. */ static void dbadd(struct dba *dba, struct mpage *mpage) { struct mlink *mlink; struct str *key; char *cp; uint64_t mask; size_t i; unsigned int slot; int mustfree; mlink = mpage->mlinks; if (nodb) { for (key = ohash_first(&names, &slot); NULL != key; key = ohash_next(&names, &slot)) free(key); for (key = ohash_first(&strings, &slot); NULL != key; key = ohash_next(&strings, &slot)) free(key); if (0 == debug) return; while (NULL != mlink) { fputs(mlink->name, stdout); if (NULL == mlink->next || strcmp(mlink->dsec, mlink->next->dsec) || strcmp(mlink->fsec, mlink->next->fsec) || strcmp(mlink->arch, mlink->next->arch)) { putchar('('); if ('\0' == *mlink->dsec) fputs(mlink->fsec, stdout); else fputs(mlink->dsec, stdout); if ('\0' != *mlink->arch) printf("/%s", mlink->arch); putchar(')'); } mlink = mlink->next; if (NULL != mlink) fputs(", ", stdout); } printf(" - %s\n", mpage->desc); return; } if (debug) say(mlink->file, "Adding to database"); cp = mpage->desc; i = strlen(cp); mustfree = render_string(&cp, &i); mpage->dba = dba_page_new(dba->pages, *mpage->arch == '\0' ? mlink->arch : mpage->arch, cp, mlink->file, mpage->form); if (mustfree) free(cp); dba_page_add(mpage->dba, DBP_SECT, mpage->sec); while (mlink != NULL) { dbadd_mlink(mlink); mlink = mlink->next; } for (key = ohash_first(&names, &slot); NULL != key; key = ohash_next(&names, &slot)) { assert(key->mpage == mpage); dba_page_alias(mpage->dba, key->key, key->mask); free(key); } for (key = ohash_first(&strings, &slot); NULL != key; key = ohash_next(&strings, &slot)) { assert(key->mpage == mpage); i = 0; for (mask = TYPE_Xr; mask <= TYPE_Lb; mask *= 2) { if (key->mask & mask) dba_macro_add(dba->macros, i, key->key, mpage->dba); i++; } free(key); } } static void dbprune(struct dba *dba) { struct dba_array *page, *files; char *file; dba_array_FOREACH(dba->pages, page) { files = dba_array_get(page, DBP_FILE); dba_array_FOREACH(files, file) { if (*file < ' ') file++; if (ohash_find(&mlinks, ohash_qlookup(&mlinks, file)) != NULL) { if (debug) say(file, "Deleting from database"); dba_array_del(dba->pages); break; } } } } /* * Write the database from memory to disk. */ static void dbwrite(struct dba *dba) { struct stat sb1, sb2; char tfn[33], *cp1, *cp2; off_t i; int fd1, fd2; /* * Do not write empty databases, and delete existing ones * when makewhatis -u causes them to become empty. */ dba_array_start(dba->pages); if (dba_array_next(dba->pages) == NULL) { if (unlink(MANDOC_DB) == -1 && errno != ENOENT) say(MANDOC_DB, "&unlink"); return; } /* * Build the database in a temporary file, * then atomically move it into place. */ if (dba_write(MANDOC_DB "~", dba) != -1) { if (rename(MANDOC_DB "~", MANDOC_DB) == -1) { exitcode = (int)MANDOCLEVEL_SYSERR; say(MANDOC_DB, "&rename"); unlink(MANDOC_DB "~"); } return; } /* * We lack write permission and cannot replace the database * file, but let's at least check whether the data changed. */ (void)strlcpy(tfn, "/tmp/mandocdb.XXXXXXXX", sizeof(tfn)); if (mkdtemp(tfn) == NULL) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "&%s", tfn); return; } cp1 = cp2 = MAP_FAILED; fd1 = fd2 = -1; (void)strlcat(tfn, "/" MANDOC_DB, sizeof(tfn)); if (dba_write(tfn, dba) == -1) { say(tfn, "&dba_write"); goto err; } if ((fd1 = open(MANDOC_DB, O_RDONLY, 0)) == -1) { say(MANDOC_DB, "&open"); goto err; } if ((fd2 = open(tfn, O_RDONLY, 0)) == -1) { say(tfn, "&open"); goto err; } if (fstat(fd1, &sb1) == -1) { say(MANDOC_DB, "&fstat"); goto err; } if (fstat(fd2, &sb2) == -1) { say(tfn, "&fstat"); goto err; } if (sb1.st_size != sb2.st_size) goto err; if ((cp1 = mmap(NULL, sb1.st_size, PROT_READ, MAP_PRIVATE, fd1, 0)) == MAP_FAILED) { say(MANDOC_DB, "&mmap"); goto err; } if ((cp2 = mmap(NULL, sb2.st_size, PROT_READ, MAP_PRIVATE, fd2, 0)) == MAP_FAILED) { say(tfn, "&mmap"); goto err; } for (i = 0; i < sb1.st_size; i++) if (cp1[i] != cp2[i]) goto err; goto out; err: exitcode = (int)MANDOCLEVEL_SYSERR; say(MANDOC_DB, "Data changed, but cannot replace database"); out: if (cp1 != MAP_FAILED) munmap(cp1, sb1.st_size); if (cp2 != MAP_FAILED) munmap(cp2, sb2.st_size); if (fd1 != -1) close(fd1); if (fd2 != -1) close(fd2); unlink(tfn); *strrchr(tfn, '/') = '\0'; rmdir(tfn); } static int set_basedir(const char *targetdir, int report_baddir) { static char startdir[PATH_MAX]; static int getcwd_status; /* 1 = ok, 2 = failure */ static int chdir_status; /* 1 = changed directory */ /* * Remember the original working directory, if possible. * This will be needed if the second or a later directory * on the command line is given as a relative path. * Do not error out if the current directory is not * searchable: Maybe it won't be needed after all. */ if (getcwd_status == 0) { if (getcwd(startdir, sizeof(startdir)) == NULL) { getcwd_status = 2; (void)strlcpy(startdir, strerror(errno), sizeof(startdir)); } else getcwd_status = 1; } /* * We are leaving the old base directory. * Do not use it any longer, not even for messages. */ *basedir = '\0'; basedir_len = 0; /* * If and only if the directory was changed earlier and * the next directory to process is given as a relative path, * first go back, or bail out if that is impossible. */ if (chdir_status && *targetdir != '/') { if (getcwd_status == 2) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "getcwd: %s", startdir); return 0; } if (chdir(startdir) == -1) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "&chdir %s", startdir); return 0; } } /* * Always resolve basedir to the canonicalized absolute * pathname and append a trailing slash, such that * we can reliably check whether files are inside. */ if (realpath(targetdir, basedir) == NULL) { if (report_baddir || errno != ENOENT) { exitcode = (int)MANDOCLEVEL_BADARG; say("", "&%s: realpath", targetdir); } *basedir = '\0'; return 0; } else if (chdir(basedir) == -1) { if (report_baddir || errno != ENOENT) { exitcode = (int)MANDOCLEVEL_BADARG; say("", "&chdir"); } *basedir = '\0'; return 0; } chdir_status = 1; basedir_len = strlen(basedir); if (basedir[basedir_len - 1] != '/') { if (basedir_len >= PATH_MAX - 1) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "Filename too long"); *basedir = '\0'; basedir_len = 0; return 0; } basedir[basedir_len++] = '/'; basedir[basedir_len] = '\0'; } return 1; } #ifdef READ_ALLOWED_PATH static int read_allowed(const char *candidate) { const char *cp; size_t len; for (cp = READ_ALLOWED_PATH;; cp += len) { while (*cp == ':') cp++; if (*cp == '\0') return 0; len = strcspn(cp, ":"); if (strncmp(candidate, cp, len) == 0) return 1; } } #endif static void say(const char *file, const char *format, ...) { va_list ap; int use_errno; if (*basedir != '\0') fprintf(stderr, "%s", basedir); if (*basedir != '\0' && *file != '\0') fputc('/', stderr); if (*file != '\0') fprintf(stderr, "%s", file); use_errno = 1; if (format != NULL) { switch (*format) { case '&': format++; break; case '\0': format = NULL; break; default: use_errno = 0; break; } } if (format != NULL) { if (*basedir != '\0' || *file != '\0') fputs(": ", stderr); va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } if (use_errno) { if (*basedir != '\0' || *file != '\0' || format != NULL) fputs(": ", stderr); perror(NULL); } else fputc('\n', stderr); } mandoc-1.14.6/manpath.c010064400017530001753000000202571412314055300151510ustar00schwarzeschwarze/* $Id: manpath.c,v 1.43 2020/08/27 14:59:47 schwarze Exp $ */ /* * Copyright (c) 2011,2014,2015,2017-2019 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "manconf.h" static void manconf_file(struct manconf *, const char *); static void manpath_add(struct manpaths *, const char *, char); static void manpath_parseline(struct manpaths *, char *, char); void manconf_parse(struct manconf *conf, const char *file, char *defp, char *auxp) { char *insert; /* Always prepend -m. */ manpath_parseline(&conf->manpath, auxp, 'm'); /* If -M is given, it overrides everything else. */ if (NULL != defp) { manpath_parseline(&conf->manpath, defp, 'M'); return; } /* MANPATH and man.conf(5) cooperate. */ defp = getenv("MANPATH"); if (NULL == file) file = MAN_CONF_FILE; /* No MANPATH; use man.conf(5) only. */ if (NULL == defp || '\0' == defp[0]) { manconf_file(conf, file); return; } /* Prepend man.conf(5) to MANPATH. */ if (':' == defp[0]) { manconf_file(conf, file); manpath_parseline(&conf->manpath, defp, '\0'); return; } /* Append man.conf(5) to MANPATH. */ if (':' == defp[strlen(defp) - 1]) { manpath_parseline(&conf->manpath, defp, '\0'); manconf_file(conf, file); return; } /* Insert man.conf(5) into MANPATH. */ insert = strstr(defp, "::"); if (NULL != insert) { *insert++ = '\0'; manpath_parseline(&conf->manpath, defp, '\0'); manconf_file(conf, file); manpath_parseline(&conf->manpath, insert + 1, '\0'); return; } /* MANPATH overrides man.conf(5) completely. */ manpath_parseline(&conf->manpath, defp, '\0'); } void manpath_base(struct manpaths *dirs) { char path_base[] = MANPATH_BASE; manpath_parseline(dirs, path_base, '\0'); } /* * Parse a FULL pathname from a colon-separated list of arrays. */ static void manpath_parseline(struct manpaths *dirs, char *path, char option) { char *dir; if (NULL == path) return; for (dir = strtok(path, ":"); dir; dir = strtok(NULL, ":")) manpath_add(dirs, dir, option); } /* * Add a directory to the array, ignoring bad directories. * Grow the array one-by-one for simplicity's sake. */ static void manpath_add(struct manpaths *dirs, const char *dir, char option) { char buf[PATH_MAX]; struct stat sb; char *cp; size_t i; if ((cp = realpath(dir, buf)) == NULL) goto fail; for (i = 0; i < dirs->sz; i++) if (strcmp(dirs->paths[i], dir) == 0) return; if (stat(cp, &sb) == -1) goto fail; dirs->paths = mandoc_reallocarray(dirs->paths, dirs->sz + 1, sizeof(*dirs->paths)); dirs->paths[dirs->sz++] = mandoc_strdup(cp); return; fail: if (option != '\0') mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "-%c %s: %s", option, dir, strerror(errno)); } void manconf_free(struct manconf *conf) { size_t i; for (i = 0; i < conf->manpath.sz; i++) free(conf->manpath.paths[i]); free(conf->manpath.paths); free(conf->output.includes); free(conf->output.man); free(conf->output.paper); free(conf->output.style); } static void manconf_file(struct manconf *conf, const char *file) { const char *const toks[] = { "manpath", "output" }; char manpath_default[] = MANPATH_DEFAULT; FILE *stream; char *line, *cp, *ep; size_t linesz, tok, toklen; ssize_t linelen; if ((stream = fopen(file, "r")) == NULL) goto out; line = NULL; linesz = 0; while ((linelen = getline(&line, &linesz, stream)) != -1) { cp = line; ep = cp + linelen - 1; while (ep > cp && isspace((unsigned char)*ep)) *ep-- = '\0'; while (isspace((unsigned char)*cp)) cp++; if (cp == ep || *cp == '#') continue; for (tok = 0; tok < sizeof(toks)/sizeof(toks[0]); tok++) { toklen = strlen(toks[tok]); if (cp + toklen < ep && isspace((unsigned char)cp[toklen]) && strncmp(cp, toks[tok], toklen) == 0) { cp += toklen; while (isspace((unsigned char)*cp)) cp++; break; } } switch (tok) { case 0: /* manpath */ manpath_add(&conf->manpath, cp, '\0'); *manpath_default = '\0'; break; case 1: /* output */ manconf_output(&conf->output, cp, 1); break; default: break; } } free(line); fclose(stream); out: if (*manpath_default != '\0') manpath_parseline(&conf->manpath, manpath_default, '\0'); } int manconf_output(struct manoutput *conf, const char *cp, int fromfile) { const char *const toks[] = { /* Tokens requiring an argument. */ "includes", "man", "paper", "style", "indent", "width", "outfilename", "tagfilename", /* Token taking an optional argument. */ "tag", /* Tokens not taking arguments. */ "fragment", "mdoc", "noval", "toc" }; const size_t ntoks = sizeof(toks) / sizeof(toks[0]); const char *errstr; char *oldval; size_t len, tok; for (tok = 0; tok < ntoks; tok++) { len = strlen(toks[tok]); if (strncmp(cp, toks[tok], len) == 0 && strchr(" = ", cp[len]) != NULL) { cp += len; if (*cp == '=') cp++; while (isspace((unsigned char)*cp)) cp++; break; } } if (tok < 8 && *cp == '\0') { mandoc_msg(MANDOCERR_BADVAL_MISS, 0, 0, "-O %s=?", toks[tok]); return -1; } if (tok > 8 && tok < ntoks && *cp != '\0') { mandoc_msg(MANDOCERR_BADVAL, 0, 0, "-O %s=%s", toks[tok], cp); return -1; } switch (tok) { case 0: if (conf->includes != NULL) { oldval = mandoc_strdup(conf->includes); break; } conf->includes = mandoc_strdup(cp); return 0; case 1: if (conf->man != NULL) { oldval = mandoc_strdup(conf->man); break; } conf->man = mandoc_strdup(cp); return 0; case 2: if (conf->paper != NULL) { oldval = mandoc_strdup(conf->paper); break; } conf->paper = mandoc_strdup(cp); return 0; case 3: if (conf->style != NULL) { oldval = mandoc_strdup(conf->style); break; } conf->style = mandoc_strdup(cp); return 0; case 4: if (conf->indent) { mandoc_asprintf(&oldval, "%zu", conf->indent); break; } conf->indent = strtonum(cp, 0, 1000, &errstr); if (errstr == NULL) return 0; mandoc_msg(MANDOCERR_BADVAL_BAD, 0, 0, "-O indent=%s is %s", cp, errstr); return -1; case 5: if (conf->width) { mandoc_asprintf(&oldval, "%zu", conf->width); break; } conf->width = strtonum(cp, 1, 1000, &errstr); if (errstr == NULL) return 0; mandoc_msg(MANDOCERR_BADVAL_BAD, 0, 0, "-O width=%s is %s", cp, errstr); return -1; case 6: if (conf->outfilename != NULL) { oldval = mandoc_strdup(conf->outfilename); break; } conf->outfilename = mandoc_strdup(cp); return 0; case 7: if (conf->tagfilename != NULL) { oldval = mandoc_strdup(conf->tagfilename); break; } conf->tagfilename = mandoc_strdup(cp); return 0; /* * If the index of the following token changes, * do not forget to adjust the range check above the switch. */ case 8: if (conf->tag != NULL) { oldval = mandoc_strdup(conf->tag); break; } conf->tag = mandoc_strdup(cp); return 0; case 9: conf->fragment = 1; return 0; case 10: conf->mdoc = 1; return 0; case 11: conf->noval = 1; return 0; case 12: conf->toc = 1; return 0; default: mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "-O %s", cp); return -1; } if (fromfile) { free(oldval); return 0; } else { mandoc_msg(MANDOCERR_BADVAL_DUPE, 0, 0, "-O %s=%s: already set to %s", toks[tok], cp, oldval); free(oldval); return -1; } } mandoc-1.14.6/mansearch.c010064400017530001753000000457641412314055300154740ustar00schwarzeschwarze/* $Id: mansearch.c,v 1.82 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013-2018 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #if HAVE_ERR #include #endif #include #include #include #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc_ohash.h" #include "manconf.h" #include "mansearch.h" #include "dbm.h" struct expr { /* Used for terms: */ struct dbm_match match; /* Match type and expression. */ uint64_t bits; /* Type mask. */ /* Used for OR and AND groups: */ struct expr *next; /* Next child in the parent group. */ struct expr *child; /* First child in this group. */ enum { EXPR_TERM, EXPR_OR, EXPR_AND } type; }; const char *const mansearch_keynames[KEY_MAX] = { "arch", "sec", "Xr", "Ar", "Fa", "Fl", "Dv", "Fn", "Ic", "Pa", "Cm", "Li", "Em", "Cd", "Va", "Ft", "Tn", "Er", "Ev", "Sy", "Sh", "In", "Ss", "Ox", "An", "Mt", "St", "Bx", "At", "Nx", "Fx", "Lk", "Ms", "Bsx", "Dx", "Rs", "Vt", "Lb", "Nm", "Nd" }; static struct ohash *manmerge(struct expr *, struct ohash *); static struct ohash *manmerge_term(struct expr *, struct ohash *); static struct ohash *manmerge_or(struct expr *, struct ohash *); static struct ohash *manmerge_and(struct expr *, struct ohash *); static char *buildnames(const struct dbm_page *); static char *buildoutput(size_t, struct dbm_page *); static size_t lstlen(const char *, size_t); static void lstcat(char *, size_t *, const char *, const char *); static int lstmatch(const char *, const char *); static struct expr *exprcomp(const struct mansearch *, int, char *[], int *); static struct expr *expr_and(const struct mansearch *, int, char *[], int *); static struct expr *exprterm(const struct mansearch *, int, char *[], int *); static void exprfree(struct expr *); static int manpage_compare(const void *, const void *); int mansearch(const struct mansearch *search, const struct manpaths *paths, int argc, char *argv[], struct manpage **res, size_t *sz) { char buf[PATH_MAX]; struct dbm_res *rp; struct expr *e; struct dbm_page *page; struct manpage *mpage; struct ohash *htab; size_t cur, i, maxres, outkey; unsigned int slot; int argi, chdir_status, getcwd_status, im; argi = 0; if ((e = exprcomp(search, argc, argv, &argi)) == NULL) { *sz = 0; return 0; } cur = maxres = 0; if (res != NULL) *res = NULL; outkey = KEY_Nd; if (search->outkey != NULL) for (im = 0; im < KEY_MAX; im++) if (0 == strcasecmp(search->outkey, mansearch_keynames[im])) { outkey = im; break; } /* * Remember the original working directory, if possible. * This will be needed if the second or a later directory * is given as a relative path. * Do not error out if the current directory is not * searchable: Maybe it won't be needed after all. */ if (getcwd(buf, PATH_MAX) == NULL) { getcwd_status = 0; (void)strlcpy(buf, strerror(errno), sizeof(buf)); } else getcwd_status = 1; /* * Loop over the directories (containing databases) for us to * search. * Don't let missing/bad databases/directories phase us. * In each, try to open the resident database and, if it opens, * scan it for our match expression. */ chdir_status = 0; for (i = 0; i < paths->sz; i++) { if (chdir_status && paths->paths[i][0] != '/') { if ( ! getcwd_status) { warnx("%s: getcwd: %s", paths->paths[i], buf); continue; } else if (chdir(buf) == -1) { warn("%s", buf); continue; } } if (chdir(paths->paths[i]) == -1) { warn("%s", paths->paths[i]); continue; } chdir_status = 1; if (dbm_open(MANDOC_DB) == -1) { if (errno != ENOENT) warn("%s/%s", paths->paths[i], MANDOC_DB); continue; } if ((htab = manmerge(e, NULL)) == NULL) { dbm_close(); continue; } for (rp = ohash_first(htab, &slot); rp != NULL; rp = ohash_next(htab, &slot)) { page = dbm_page_get(rp->page); if (lstmatch(search->sec, page->sect) == 0 || lstmatch(search->arch, page->arch) == 0 || (search->argmode == ARG_NAME && rp->bits <= (int32_t)(NAME_SYN & NAME_MASK))) continue; if (res == NULL) { cur = 1; break; } if (cur + 1 > maxres) { maxres += 1024; *res = mandoc_reallocarray(*res, maxres, sizeof(**res)); } mpage = *res + cur; mandoc_asprintf(&mpage->file, "%s/%s", paths->paths[i], page->file + 1); if (access(chdir_status ? page->file + 1 : mpage->file, R_OK) == -1) { warn("%s", mpage->file); warnx("outdated mandoc.db contains " "bogus %s entry, run makewhatis %s", page->file + 1, paths->paths[i]); free(mpage->file); free(rp); continue; } mpage->names = buildnames(page); mpage->output = buildoutput(outkey, page); mpage->bits = search->firstmatch ? rp->bits : 0; mpage->ipath = i; mpage->sec = *page->sect - '0'; if (mpage->sec < 0 || mpage->sec > 9) mpage->sec = 10; mpage->form = *page->file; free(rp); cur++; } ohash_delete(htab); free(htab); dbm_close(); /* * In man(1) mode, prefer matches in earlier trees * over matches in later trees. */ if (cur && search->firstmatch) break; } if (res != NULL) qsort(*res, cur, sizeof(struct manpage), manpage_compare); if (chdir_status && getcwd_status && chdir(buf) == -1) warn("%s", buf); exprfree(e); *sz = cur; return res != NULL || cur; } /* * Merge the results for the expression tree rooted at e * into the the result list htab. */ static struct ohash * manmerge(struct expr *e, struct ohash *htab) { switch (e->type) { case EXPR_TERM: return manmerge_term(e, htab); case EXPR_OR: return manmerge_or(e->child, htab); case EXPR_AND: return manmerge_and(e->child, htab); default: abort(); } } static struct ohash * manmerge_term(struct expr *e, struct ohash *htab) { struct dbm_res res, *rp; uint64_t ib; unsigned int slot; int im; if (htab == NULL) { htab = mandoc_malloc(sizeof(*htab)); mandoc_ohash_init(htab, 4, offsetof(struct dbm_res, page)); } for (im = 0, ib = 1; im < KEY_MAX; im++, ib <<= 1) { if ((e->bits & ib) == 0) continue; switch (ib) { case TYPE_arch: dbm_page_byarch(&e->match); break; case TYPE_sec: dbm_page_bysect(&e->match); break; case TYPE_Nm: dbm_page_byname(&e->match); break; case TYPE_Nd: dbm_page_bydesc(&e->match); break; default: dbm_page_bymacro(im - 2, &e->match); break; } /* * When hashing for deduplication, use the unique * page ID itself instead of a hash function; * that is quite efficient. */ for (;;) { res = dbm_page_next(); if (res.page == -1) break; slot = ohash_lookup_memory(htab, (char *)&res, sizeof(res.page), res.page); if ((rp = ohash_find(htab, slot)) != NULL) { rp->bits |= res.bits; continue; } rp = mandoc_malloc(sizeof(*rp)); *rp = res; ohash_insert(htab, slot, rp); } } return htab; } static struct ohash * manmerge_or(struct expr *e, struct ohash *htab) { while (e != NULL) { htab = manmerge(e, htab); e = e->next; } return htab; } static struct ohash * manmerge_and(struct expr *e, struct ohash *htab) { struct ohash *hand, *h1, *h2; struct dbm_res *res; unsigned int slot1, slot2; /* Evaluate the first term of the AND clause. */ hand = manmerge(e, NULL); while ((e = e->next) != NULL) { /* Evaluate the next term and prepare for ANDing. */ h2 = manmerge(e, NULL); if (ohash_entries(h2) < ohash_entries(hand)) { h1 = h2; h2 = hand; } else h1 = hand; hand = mandoc_malloc(sizeof(*hand)); mandoc_ohash_init(hand, 4, offsetof(struct dbm_res, page)); /* Keep all pages that are in both result sets. */ for (res = ohash_first(h1, &slot1); res != NULL; res = ohash_next(h1, &slot1)) { if (ohash_find(h2, ohash_lookup_memory(h2, (char *)res, sizeof(res->page), res->page)) == NULL) free(res); else ohash_insert(hand, ohash_lookup_memory(hand, (char *)res, sizeof(res->page), res->page), res); } /* Discard the merged results. */ for (res = ohash_first(h2, &slot2); res != NULL; res = ohash_next(h2, &slot2)) free(res); ohash_delete(h2); free(h2); ohash_delete(h1); free(h1); } /* Merge the result of the AND into htab. */ if (htab == NULL) return hand; for (res = ohash_first(hand, &slot1); res != NULL; res = ohash_next(hand, &slot1)) { slot2 = ohash_lookup_memory(htab, (char *)res, sizeof(res->page), res->page); if (ohash_find(htab, slot2) == NULL) ohash_insert(htab, slot2, res); else free(res); } /* Discard the merged result. */ ohash_delete(hand); free(hand); return htab; } void mansearch_free(struct manpage *res, size_t sz) { size_t i; for (i = 0; i < sz; i++) { free(res[i].file); free(res[i].names); free(res[i].output); } free(res); } static int manpage_compare(const void *vp1, const void *vp2) { const struct manpage *mp1, *mp2; const char *cp1, *cp2; size_t sz1, sz2; int diff; mp1 = vp1; mp2 = vp2; if ((diff = mp2->bits - mp1->bits) || (diff = mp1->sec - mp2->sec)) return diff; /* Fall back to alphabetic ordering of names. */ sz1 = strcspn(mp1->names, "("); sz2 = strcspn(mp2->names, "("); if (sz1 < sz2) sz1 = sz2; if ((diff = strncasecmp(mp1->names, mp2->names, sz1))) return diff; /* For identical names and sections, prefer arch-dependent. */ cp1 = strchr(mp1->names + sz1, '/'); cp2 = strchr(mp2->names + sz2, '/'); return cp1 != NULL && cp2 != NULL ? strcasecmp(cp1, cp2) : cp1 != NULL ? -1 : cp2 != NULL ? 1 : 0; } static char * buildnames(const struct dbm_page *page) { char *buf; size_t i, sz; sz = lstlen(page->name, 2) + 1 + lstlen(page->sect, 2) + (page->arch == NULL ? 0 : 1 + lstlen(page->arch, 2)) + 2; buf = mandoc_malloc(sz); i = 0; lstcat(buf, &i, page->name, ", "); buf[i++] = '('; lstcat(buf, &i, page->sect, ", "); if (page->arch != NULL) { buf[i++] = '/'; lstcat(buf, &i, page->arch, ", "); } buf[i++] = ')'; buf[i++] = '\0'; assert(i == sz); return buf; } /* * Count the buffer space needed to print the NUL-terminated * list of NUL-terminated strings, when printing sep separator * characters between strings. */ static size_t lstlen(const char *cp, size_t sep) { size_t sz; for (sz = 0; *cp != '\0'; cp++) { /* Skip names appearing only in the SYNOPSIS. */ if (*cp <= (char)(NAME_SYN & NAME_MASK)) { while (*cp != '\0') cp++; continue; } /* Skip name class markers. */ if (*cp < ' ') cp++; /* Print a separator before each but the first string. */ if (sz) sz += sep; /* Copy one string. */ while (*cp != '\0') { sz++; cp++; } } return sz; } /* * Print the NUL-terminated list of NUL-terminated strings * into the buffer, seperating strings with sep. */ static void lstcat(char *buf, size_t *i, const char *cp, const char *sep) { const char *s; size_t i_start; for (i_start = *i; *cp != '\0'; cp++) { /* Skip names appearing only in the SYNOPSIS. */ if (*cp <= (char)(NAME_SYN & NAME_MASK)) { while (*cp != '\0') cp++; continue; } /* Skip name class markers. */ if (*cp < ' ') cp++; /* Print a separator before each but the first string. */ if (*i > i_start) { s = sep; while (*s != '\0') buf[(*i)++] = *s++; } /* Copy one string. */ while (*cp != '\0') buf[(*i)++] = *cp++; } } /* * Return 1 if the string *want occurs in any of the strings * in the NUL-terminated string list *have, or 0 otherwise. * If either argument is NULL or empty, assume no filtering * is desired and return 1. */ static int lstmatch(const char *want, const char *have) { if (want == NULL || have == NULL || *have == '\0') return 1; while (*have != '\0') { if (strcasestr(have, want) != NULL) return 1; have = strchr(have, '\0') + 1; } return 0; } /* * Build a list of values taken by the macro im in the manual page. */ static char * buildoutput(size_t im, struct dbm_page *page) { const char *oldoutput, *sep, *input; char *output, *newoutput, *value; size_t sz, i; switch (im) { case KEY_Nd: return mandoc_strdup(page->desc); case KEY_Nm: input = page->name; break; case KEY_sec: input = page->sect; break; case KEY_arch: input = page->arch; if (input == NULL) input = "all\0"; break; default: input = NULL; break; } if (input != NULL) { sz = lstlen(input, 3) + 1; output = mandoc_malloc(sz); i = 0; lstcat(output, &i, input, " # "); output[i++] = '\0'; assert(i == sz); return output; } output = NULL; dbm_macro_bypage(im - 2, page->addr); while ((value = dbm_macro_next()) != NULL) { if (output == NULL) { oldoutput = ""; sep = ""; } else { oldoutput = output; sep = " # "; } mandoc_asprintf(&newoutput, "%s%s%s", oldoutput, sep, value); free(output); output = newoutput; } return output; } /* * Compile a set of string tokens into an expression. * Tokens in "argv" are assumed to be individual expression atoms (e.g., * "(", "foo=bar", etc.). */ static struct expr * exprcomp(const struct mansearch *search, int argc, char *argv[], int *argi) { struct expr *parent, *child; int needterm, nested; if ((nested = *argi) == argc) return NULL; needterm = 1; parent = child = NULL; while (*argi < argc) { if (strcmp(")", argv[*argi]) == 0) { if (needterm) warnx("missing term " "before closing parenthesis"); needterm = 0; if (nested) break; warnx("ignoring unmatched right parenthesis"); ++*argi; continue; } if (strcmp("-o", argv[*argi]) == 0) { if (needterm) { if (*argi > 0) warnx("ignoring -o after %s", argv[*argi - 1]); else warnx("ignoring initial -o"); } needterm = 1; ++*argi; continue; } needterm = 0; if (child == NULL) { child = expr_and(search, argc, argv, argi); continue; } if (parent == NULL) { parent = mandoc_calloc(1, sizeof(*parent)); parent->type = EXPR_OR; parent->next = NULL; parent->child = child; } child->next = expr_and(search, argc, argv, argi); child = child->next; } if (needterm && *argi) warnx("ignoring trailing %s", argv[*argi - 1]); return parent == NULL ? child : parent; } static struct expr * expr_and(const struct mansearch *search, int argc, char *argv[], int *argi) { struct expr *parent, *child; int needterm; needterm = 1; parent = child = NULL; while (*argi < argc) { if (strcmp(")", argv[*argi]) == 0) { if (needterm) warnx("missing term " "before closing parenthesis"); needterm = 0; break; } if (strcmp("-o", argv[*argi]) == 0) break; if (strcmp("-a", argv[*argi]) == 0) { if (needterm) { if (*argi > 0) warnx("ignoring -a after %s", argv[*argi - 1]); else warnx("ignoring initial -a"); } needterm = 1; ++*argi; continue; } if (needterm == 0) break; if (child == NULL) { child = exprterm(search, argc, argv, argi); if (child != NULL) needterm = 0; continue; } needterm = 0; if (parent == NULL) { parent = mandoc_calloc(1, sizeof(*parent)); parent->type = EXPR_AND; parent->next = NULL; parent->child = child; } child->next = exprterm(search, argc, argv, argi); if (child->next != NULL) { child = child->next; needterm = 0; } } if (needterm && *argi) warnx("ignoring trailing %s", argv[*argi - 1]); return parent == NULL ? child : parent; } static struct expr * exprterm(const struct mansearch *search, int argc, char *argv[], int *argi) { char errbuf[BUFSIZ]; struct expr *e; char *key, *val; uint64_t iterbit; int cs, i, irc; if (strcmp("(", argv[*argi]) == 0) { ++*argi; e = exprcomp(search, argc, argv, argi); if (*argi < argc) { assert(strcmp(")", argv[*argi]) == 0); ++*argi; } else warnx("unclosed parenthesis"); return e; } if (strcmp("-i", argv[*argi]) == 0 && *argi + 1 < argc) { cs = 0; ++*argi; } else cs = 1; e = mandoc_calloc(1, sizeof(*e)); e->type = EXPR_TERM; e->bits = 0; e->next = NULL; e->child = NULL; if (search->argmode == ARG_NAME) { e->bits = TYPE_Nm; e->match.type = DBM_EXACT; e->match.str = argv[(*argi)++]; return e; } /* * Separate macro keys from search string. * If needed, request regular expression handling. */ if (search->argmode == ARG_WORD) { e->bits = TYPE_Nm; e->match.type = DBM_REGEX; #if HAVE_REWB_BSD mandoc_asprintf(&val, "[[:<:]]%s[[:>:]]", argv[*argi]); #elif HAVE_REWB_SYSV mandoc_asprintf(&val, "\\<%s\\>", argv[*argi]); #else mandoc_asprintf(&val, "(^|[^a-zA-Z01-9_])%s([^a-zA-Z01-9_]|$)", argv[*argi]); #endif cs = 0; } else if ((val = strpbrk(argv[*argi], "=~")) == NULL) { e->bits = TYPE_Nm | TYPE_Nd; e->match.type = DBM_REGEX; val = argv[*argi]; cs = 0; } else { if (val == argv[*argi]) e->bits = TYPE_Nm | TYPE_Nd; if (*val == '=') { e->match.type = DBM_SUB; e->match.str = val + 1; } else e->match.type = DBM_REGEX; *val++ = '\0'; if (strstr(argv[*argi], "arch") != NULL) cs = 0; } /* Compile regular expressions. */ if (e->match.type == DBM_REGEX) { e->match.re = mandoc_malloc(sizeof(*e->match.re)); irc = regcomp(e->match.re, val, REG_EXTENDED | REG_NOSUB | (cs ? 0 : REG_ICASE)); if (irc) { regerror(irc, e->match.re, errbuf, sizeof(errbuf)); warnx("regcomp /%s/: %s", val, errbuf); } if (search->argmode == ARG_WORD) free(val); if (irc) { free(e->match.re); free(e); ++*argi; return NULL; } } if (e->bits) { ++*argi; return e; } /* * Parse out all possible fields. * If the field doesn't resolve, bail. */ while (NULL != (key = strsep(&argv[*argi], ","))) { if ('\0' == *key) continue; for (i = 0, iterbit = 1; i < KEY_MAX; i++, iterbit <<= 1) { if (0 == strcasecmp(key, mansearch_keynames[i])) { e->bits |= iterbit; break; } } if (i == KEY_MAX) { if (strcasecmp(key, "any")) warnx("treating unknown key " "\"%s\" as \"any\"", key); e->bits |= ~0ULL; } } ++*argi; return e; } static void exprfree(struct expr *e) { if (e->next != NULL) exprfree(e->next); if (e->child != NULL) exprfree(e->child); free(e); } mandoc-1.14.6/mdoc.c010064400017530001753000000241731412314055300144440ustar00schwarzeschwarze/* $Id: mdoc.c,v 1.275 2020/04/06 10:16:17 schwarze Exp $ */ /* * Copyright (c) 2010, 2012-2018, 2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Top level and utility functions of the mdoc(7) parser for mandoc(1). */ #include "config.h" #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "libmandoc.h" #include "roff_int.h" #include "libmdoc.h" const char *const __mdoc_argnames[MDOC_ARG_MAX] = { "split", "nosplit", "ragged", "unfilled", "literal", "file", "offset", "bullet", "dash", "hyphen", "item", "enum", "tag", "diag", "hang", "ohang", "inset", "column", "width", "compact", "std", "filled", "words", "emphasis", "symbolic", "nested", "centered" }; const char * const *mdoc_argnames = __mdoc_argnames; static int mdoc_ptext(struct roff_man *, int, char *, int); static int mdoc_pmacro(struct roff_man *, int, char *, int); /* * Main parse routine. Parses a single line -- really just hands off to * the macro (mdoc_pmacro()) or text parser (mdoc_ptext()). */ int mdoc_parseln(struct roff_man *mdoc, int ln, char *buf, int offs) { if (mdoc->last->type != ROFFT_EQN || ln > mdoc->last->line) mdoc->flags |= MDOC_NEWLINE; /* * Let the roff nS register switch SYNOPSIS mode early, * such that the parser knows at all times * whether this mode is on or off. * Note that this mode is also switched by the Sh macro. */ if (roff_getreg(mdoc->roff, "nS")) mdoc->flags |= MDOC_SYNOPSIS; else mdoc->flags &= ~MDOC_SYNOPSIS; return roff_getcontrol(mdoc->roff, buf, &offs) ? mdoc_pmacro(mdoc, ln, buf, offs) : mdoc_ptext(mdoc, ln, buf, offs); } void mdoc_tail_alloc(struct roff_man *mdoc, int line, int pos, enum roff_tok tok) { struct roff_node *p; p = roff_node_alloc(mdoc, line, pos, ROFFT_TAIL, tok); roff_node_append(mdoc, p); mdoc->next = ROFF_NEXT_CHILD; } struct roff_node * mdoc_endbody_alloc(struct roff_man *mdoc, int line, int pos, enum roff_tok tok, struct roff_node *body) { struct roff_node *p; body->flags |= NODE_ENDED; body->parent->flags |= NODE_ENDED; p = roff_node_alloc(mdoc, line, pos, ROFFT_BODY, tok); p->body = body; p->norm = body->norm; p->end = ENDBODY_SPACE; roff_node_append(mdoc, p); mdoc->next = ROFF_NEXT_SIBLING; return p; } struct roff_node * mdoc_block_alloc(struct roff_man *mdoc, int line, int pos, enum roff_tok tok, struct mdoc_arg *args) { struct roff_node *p; p = roff_node_alloc(mdoc, line, pos, ROFFT_BLOCK, tok); p->args = args; if (p->args) (args->refcnt)++; switch (tok) { case MDOC_Bd: case MDOC_Bf: case MDOC_Bl: case MDOC_En: case MDOC_Rs: p->norm = mandoc_calloc(1, sizeof(union mdoc_data)); break; default: break; } roff_node_append(mdoc, p); mdoc->next = ROFF_NEXT_CHILD; return p; } void mdoc_elem_alloc(struct roff_man *mdoc, int line, int pos, enum roff_tok tok, struct mdoc_arg *args) { struct roff_node *p; p = roff_node_alloc(mdoc, line, pos, ROFFT_ELEM, tok); p->args = args; if (p->args) (args->refcnt)++; switch (tok) { case MDOC_An: p->norm = mandoc_calloc(1, sizeof(union mdoc_data)); break; default: break; } roff_node_append(mdoc, p); mdoc->next = ROFF_NEXT_CHILD; } /* * Parse free-form text, that is, a line that does not begin with the * control character. */ static int mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) { struct roff_node *n; const char *cp, *sp; char *c, *ws, *end; n = mdoc->last; /* * If a column list contains plain text, assume an implicit item * macro. This can happen one or more times at the beginning * of such a list, intermixed with non-It mdoc macros and with * nodes generated on the roff level, for example by tbl. */ if ((n->tok == MDOC_Bl && n->type == ROFFT_BODY && n->end == ENDBODY_NOT && n->norm->Bl.type == LIST_column) || (n->parent != NULL && n->parent->tok == MDOC_Bl && n->parent->norm->Bl.type == LIST_column)) { mdoc->flags |= MDOC_FREECOL; (*mdoc_macro(MDOC_It)->fp)(mdoc, MDOC_It, line, offs, &offs, buf); return 1; } /* * Search for the beginning of unescaped trailing whitespace (ws) * and for the first character not to be output (end). */ /* FIXME: replace with strcspn(). */ ws = NULL; for (c = end = buf + offs; *c; c++) { switch (*c) { case ' ': if (NULL == ws) ws = c; continue; case '\t': /* * Always warn about trailing tabs, * even outside literal context, * where they should be put on the next line. */ if (NULL == ws) ws = c; /* * Strip trailing tabs in literal context only; * outside, they affect the next line. */ if (mdoc->flags & ROFF_NOFILL) continue; break; case '\\': /* Skip the escaped character, too, if any. */ if (c[1]) c++; /* FALLTHROUGH */ default: ws = NULL; break; } end = c + 1; } *end = '\0'; if (ws) mandoc_msg(MANDOCERR_SPACE_EOL, line, (int)(ws - buf), NULL); /* * Blank lines are allowed in no-fill mode * and cancel preceding \c, * but add a single vertical space elsewhere. */ if (buf[offs] == '\0' && (mdoc->flags & ROFF_NOFILL) == 0) { switch (mdoc->last->type) { case ROFFT_TEXT: sp = mdoc->last->string; cp = end = strchr(sp, '\0') - 2; if (cp < sp || cp[0] != '\\' || cp[1] != 'c') break; while (cp > sp && cp[-1] == '\\') cp--; if ((end - cp) % 2) break; *end = '\0'; return 1; default: break; } mandoc_msg(MANDOCERR_FI_BLANK, line, (int)(c - buf), NULL); roff_elem_alloc(mdoc, line, offs, ROFF_sp); mdoc->last->flags |= NODE_VALID | NODE_ENDED; mdoc->next = ROFF_NEXT_SIBLING; return 1; } roff_word_alloc(mdoc, line, offs, buf+offs); if (mdoc->flags & ROFF_NOFILL) return 1; /* * End-of-sentence check. If the last character is an unescaped * EOS character, then flag the node as being the end of a * sentence. The front-end will know how to interpret this. */ assert(buf < end); if (mandoc_eos(buf+offs, (size_t)(end-buf-offs))) mdoc->last->flags |= NODE_EOS; for (c = buf + offs; c != NULL; c = strchr(c + 1, '.')) { if (c - buf < offs + 2) continue; if (end - c < 3) break; if (c[1] != ' ' || isalnum((unsigned char)c[-2]) == 0 || isalnum((unsigned char)c[-1]) == 0 || (c[-2] == 'n' && c[-1] == 'c') || (c[-2] == 'v' && c[-1] == 's')) continue; c += 2; if (*c == ' ') c++; if (*c == ' ') c++; if (isupper((unsigned char)(*c))) mandoc_msg(MANDOCERR_EOS, line, (int)(c - buf), NULL); } return 1; } /* * Parse a macro line, that is, a line beginning with the control * character. */ static int mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs) { struct roff_node *n; const char *cp; size_t sz; enum roff_tok tok; int sv; /* Determine the line macro. */ sv = offs; tok = TOKEN_NONE; for (sz = 0; sz < 4 && strchr(" \t\\", buf[offs]) == NULL; sz++) offs++; if (sz == 2 || sz == 3) tok = roffhash_find(mdoc->mdocmac, buf + sv, sz); if (tok == TOKEN_NONE) { mandoc_msg(MANDOCERR_MACRO, ln, sv, "%s", buf + sv - 1); return 1; } /* Skip a leading escape sequence or tab. */ switch (buf[offs]) { case '\\': cp = buf + offs + 1; mandoc_escape(&cp, NULL, NULL); offs = cp - buf; break; case '\t': offs++; break; default: break; } /* Jump to the next non-whitespace word. */ while (buf[offs] == ' ') offs++; /* * Trailing whitespace. Note that tabs are allowed to be passed * into the parser as "text", so we only warn about spaces here. */ if ('\0' == buf[offs] && ' ' == buf[offs - 1]) mandoc_msg(MANDOCERR_SPACE_EOL, ln, offs - 1, NULL); /* * If an initial or transparent macro or a list invocation, * divert directly into macro processing. */ n = mdoc->last; if (n == NULL || tok == MDOC_It || tok == MDOC_El || roff_tok_transparent(tok)) { (*mdoc_macro(tok)->fp)(mdoc, tok, ln, sv, &offs, buf); return 1; } /* * If a column list contains a non-It macro, assume an implicit * item macro. This can happen one or more times at the * beginning of such a list, intermixed with text lines and * with nodes generated on the roff level, for example by tbl. */ if ((n->tok == MDOC_Bl && n->type == ROFFT_BODY && n->end == ENDBODY_NOT && n->norm->Bl.type == LIST_column) || (n->parent != NULL && n->parent->tok == MDOC_Bl && n->parent->norm->Bl.type == LIST_column)) { mdoc->flags |= MDOC_FREECOL; (*mdoc_macro(MDOC_It)->fp)(mdoc, MDOC_It, ln, sv, &sv, buf); return 1; } /* Normal processing of a macro. */ (*mdoc_macro(tok)->fp)(mdoc, tok, ln, sv, &offs, buf); /* In quick mode (for mandocdb), abort after the NAME section. */ if (mdoc->quick && MDOC_Sh == tok && SEC_NAME != mdoc->last->sec) return 2; return 1; } enum mdelim mdoc_isdelim(const char *p) { if ('\0' == p[0]) return DELIM_NONE; if ('\0' == p[1]) switch (p[0]) { case '(': case '[': return DELIM_OPEN; case '|': return DELIM_MIDDLE; case '.': case ',': case ';': case ':': case '?': case '!': case ')': case ']': return DELIM_CLOSE; default: return DELIM_NONE; } if ('\\' != p[0]) return DELIM_NONE; if (0 == strcmp(p + 1, ".")) return DELIM_CLOSE; if (0 == strcmp(p + 1, "fR|\\fP")) return DELIM_MIDDLE; return DELIM_NONE; } mandoc-1.14.6/mdoc_argv.c010064400017530001753000000403071412314055300154600ustar00schwarzeschwarze/* $Id: mdoc_argv.c,v 1.120 2019/07/11 17:06:17 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2012, 2014-2019 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "libmandoc.h" #include "roff_int.h" #include "libmdoc.h" #define MULTI_STEP 5 /* pre-allocate argument values */ #define DELIMSZ 6 /* max possible size of a delimiter */ enum argsflag { ARGSFL_NONE = 0, ARGSFL_DELIM, /* handle delimiters of [[::delim::][ ]+]+ */ ARGSFL_TABSEP /* handle tab/`Ta' separated phrases */ }; enum argvflag { ARGV_NONE, /* no args to flag (e.g., -split) */ ARGV_SINGLE, /* one arg to flag (e.g., -file xxx) */ ARGV_MULTI /* multiple args (e.g., -column xxx yyy) */ }; struct mdocarg { enum argsflag flags; const enum mdocargt *argvs; }; static void argn_free(struct mdoc_arg *, int); static enum margserr args(struct roff_man *, int, int *, char *, enum argsflag, char **); static int args_checkpunct(const char *, int); static void argv_multi(struct roff_man *, int, struct mdoc_argv *, int *, char *); static void argv_single(struct roff_man *, int, struct mdoc_argv *, int *, char *); static const enum argvflag argvflags[MDOC_ARG_MAX] = { ARGV_NONE, /* MDOC_Split */ ARGV_NONE, /* MDOC_Nosplit */ ARGV_NONE, /* MDOC_Ragged */ ARGV_NONE, /* MDOC_Unfilled */ ARGV_NONE, /* MDOC_Literal */ ARGV_SINGLE, /* MDOC_File */ ARGV_SINGLE, /* MDOC_Offset */ ARGV_NONE, /* MDOC_Bullet */ ARGV_NONE, /* MDOC_Dash */ ARGV_NONE, /* MDOC_Hyphen */ ARGV_NONE, /* MDOC_Item */ ARGV_NONE, /* MDOC_Enum */ ARGV_NONE, /* MDOC_Tag */ ARGV_NONE, /* MDOC_Diag */ ARGV_NONE, /* MDOC_Hang */ ARGV_NONE, /* MDOC_Ohang */ ARGV_NONE, /* MDOC_Inset */ ARGV_MULTI, /* MDOC_Column */ ARGV_SINGLE, /* MDOC_Width */ ARGV_NONE, /* MDOC_Compact */ ARGV_NONE, /* MDOC_Std */ ARGV_NONE, /* MDOC_Filled */ ARGV_NONE, /* MDOC_Words */ ARGV_NONE, /* MDOC_Emphasis */ ARGV_NONE, /* MDOC_Symbolic */ ARGV_NONE /* MDOC_Symbolic */ }; static const enum mdocargt args_Ex[] = { MDOC_Std, MDOC_ARG_MAX }; static const enum mdocargt args_An[] = { MDOC_Split, MDOC_Nosplit, MDOC_ARG_MAX }; static const enum mdocargt args_Bd[] = { MDOC_Ragged, MDOC_Unfilled, MDOC_Filled, MDOC_Literal, MDOC_File, MDOC_Offset, MDOC_Compact, MDOC_Centred, MDOC_ARG_MAX }; static const enum mdocargt args_Bf[] = { MDOC_Emphasis, MDOC_Literal, MDOC_Symbolic, MDOC_ARG_MAX }; static const enum mdocargt args_Bk[] = { MDOC_Words, MDOC_ARG_MAX }; static const enum mdocargt args_Bl[] = { MDOC_Bullet, MDOC_Dash, MDOC_Hyphen, MDOC_Item, MDOC_Enum, MDOC_Tag, MDOC_Diag, MDOC_Hang, MDOC_Ohang, MDOC_Inset, MDOC_Column, MDOC_Width, MDOC_Offset, MDOC_Compact, MDOC_Nested, MDOC_ARG_MAX }; static const struct mdocarg mdocargs[MDOC_MAX - MDOC_Dd] = { { ARGSFL_NONE, NULL }, /* Dd */ { ARGSFL_NONE, NULL }, /* Dt */ { ARGSFL_NONE, NULL }, /* Os */ { ARGSFL_NONE, NULL }, /* Sh */ { ARGSFL_NONE, NULL }, /* Ss */ { ARGSFL_NONE, NULL }, /* Pp */ { ARGSFL_DELIM, NULL }, /* D1 */ { ARGSFL_DELIM, NULL }, /* Dl */ { ARGSFL_NONE, args_Bd }, /* Bd */ { ARGSFL_NONE, NULL }, /* Ed */ { ARGSFL_NONE, args_Bl }, /* Bl */ { ARGSFL_NONE, NULL }, /* El */ { ARGSFL_NONE, NULL }, /* It */ { ARGSFL_DELIM, NULL }, /* Ad */ { ARGSFL_DELIM, args_An }, /* An */ { ARGSFL_DELIM, NULL }, /* Ap */ { ARGSFL_DELIM, NULL }, /* Ar */ { ARGSFL_DELIM, NULL }, /* Cd */ { ARGSFL_DELIM, NULL }, /* Cm */ { ARGSFL_DELIM, NULL }, /* Dv */ { ARGSFL_DELIM, NULL }, /* Er */ { ARGSFL_DELIM, NULL }, /* Ev */ { ARGSFL_NONE, args_Ex }, /* Ex */ { ARGSFL_DELIM, NULL }, /* Fa */ { ARGSFL_NONE, NULL }, /* Fd */ { ARGSFL_DELIM, NULL }, /* Fl */ { ARGSFL_DELIM, NULL }, /* Fn */ { ARGSFL_DELIM, NULL }, /* Ft */ { ARGSFL_DELIM, NULL }, /* Ic */ { ARGSFL_DELIM, NULL }, /* In */ { ARGSFL_DELIM, NULL }, /* Li */ { ARGSFL_NONE, NULL }, /* Nd */ { ARGSFL_DELIM, NULL }, /* Nm */ { ARGSFL_DELIM, NULL }, /* Op */ { ARGSFL_DELIM, NULL }, /* Ot */ { ARGSFL_DELIM, NULL }, /* Pa */ { ARGSFL_NONE, args_Ex }, /* Rv */ { ARGSFL_DELIM, NULL }, /* St */ { ARGSFL_DELIM, NULL }, /* Va */ { ARGSFL_DELIM, NULL }, /* Vt */ { ARGSFL_DELIM, NULL }, /* Xr */ { ARGSFL_NONE, NULL }, /* %A */ { ARGSFL_NONE, NULL }, /* %B */ { ARGSFL_NONE, NULL }, /* %D */ { ARGSFL_NONE, NULL }, /* %I */ { ARGSFL_NONE, NULL }, /* %J */ { ARGSFL_NONE, NULL }, /* %N */ { ARGSFL_NONE, NULL }, /* %O */ { ARGSFL_NONE, NULL }, /* %P */ { ARGSFL_NONE, NULL }, /* %R */ { ARGSFL_NONE, NULL }, /* %T */ { ARGSFL_NONE, NULL }, /* %V */ { ARGSFL_DELIM, NULL }, /* Ac */ { ARGSFL_NONE, NULL }, /* Ao */ { ARGSFL_DELIM, NULL }, /* Aq */ { ARGSFL_DELIM, NULL }, /* At */ { ARGSFL_DELIM, NULL }, /* Bc */ { ARGSFL_NONE, args_Bf }, /* Bf */ { ARGSFL_NONE, NULL }, /* Bo */ { ARGSFL_DELIM, NULL }, /* Bq */ { ARGSFL_DELIM, NULL }, /* Bsx */ { ARGSFL_DELIM, NULL }, /* Bx */ { ARGSFL_NONE, NULL }, /* Db */ { ARGSFL_DELIM, NULL }, /* Dc */ { ARGSFL_NONE, NULL }, /* Do */ { ARGSFL_DELIM, NULL }, /* Dq */ { ARGSFL_DELIM, NULL }, /* Ec */ { ARGSFL_NONE, NULL }, /* Ef */ { ARGSFL_DELIM, NULL }, /* Em */ { ARGSFL_NONE, NULL }, /* Eo */ { ARGSFL_DELIM, NULL }, /* Fx */ { ARGSFL_DELIM, NULL }, /* Ms */ { ARGSFL_DELIM, NULL }, /* No */ { ARGSFL_DELIM, NULL }, /* Ns */ { ARGSFL_DELIM, NULL }, /* Nx */ { ARGSFL_DELIM, NULL }, /* Ox */ { ARGSFL_DELIM, NULL }, /* Pc */ { ARGSFL_DELIM, NULL }, /* Pf */ { ARGSFL_NONE, NULL }, /* Po */ { ARGSFL_DELIM, NULL }, /* Pq */ { ARGSFL_DELIM, NULL }, /* Qc */ { ARGSFL_DELIM, NULL }, /* Ql */ { ARGSFL_NONE, NULL }, /* Qo */ { ARGSFL_DELIM, NULL }, /* Qq */ { ARGSFL_NONE, NULL }, /* Re */ { ARGSFL_NONE, NULL }, /* Rs */ { ARGSFL_DELIM, NULL }, /* Sc */ { ARGSFL_NONE, NULL }, /* So */ { ARGSFL_DELIM, NULL }, /* Sq */ { ARGSFL_NONE, NULL }, /* Sm */ { ARGSFL_DELIM, NULL }, /* Sx */ { ARGSFL_DELIM, NULL }, /* Sy */ { ARGSFL_DELIM, NULL }, /* Tn */ { ARGSFL_DELIM, NULL }, /* Ux */ { ARGSFL_DELIM, NULL }, /* Xc */ { ARGSFL_NONE, NULL }, /* Xo */ { ARGSFL_NONE, NULL }, /* Fo */ { ARGSFL_DELIM, NULL }, /* Fc */ { ARGSFL_NONE, NULL }, /* Oo */ { ARGSFL_DELIM, NULL }, /* Oc */ { ARGSFL_NONE, args_Bk }, /* Bk */ { ARGSFL_NONE, NULL }, /* Ek */ { ARGSFL_NONE, NULL }, /* Bt */ { ARGSFL_NONE, NULL }, /* Hf */ { ARGSFL_DELIM, NULL }, /* Fr */ { ARGSFL_NONE, NULL }, /* Ud */ { ARGSFL_DELIM, NULL }, /* Lb */ { ARGSFL_NONE, NULL }, /* Lp */ { ARGSFL_DELIM, NULL }, /* Lk */ { ARGSFL_DELIM, NULL }, /* Mt */ { ARGSFL_DELIM, NULL }, /* Brq */ { ARGSFL_NONE, NULL }, /* Bro */ { ARGSFL_DELIM, NULL }, /* Brc */ { ARGSFL_NONE, NULL }, /* %C */ { ARGSFL_NONE, NULL }, /* Es */ { ARGSFL_DELIM, NULL }, /* En */ { ARGSFL_DELIM, NULL }, /* Dx */ { ARGSFL_NONE, NULL }, /* %Q */ { ARGSFL_NONE, NULL }, /* %U */ { ARGSFL_NONE, NULL }, /* Ta */ }; /* * Parse flags and their arguments from the input line. * These come in the form -flag [argument ...]. * Some flags take no argument, some one, some multiple. */ void mdoc_argv(struct roff_man *mdoc, int line, enum roff_tok tok, struct mdoc_arg **reta, int *pos, char *buf) { struct mdoc_argv tmpv; struct mdoc_argv **retv; const enum mdocargt *argtable; char *argname; int ipos, retc; char savechar; *reta = NULL; /* Which flags does this macro support? */ assert(tok >= MDOC_Dd && tok < MDOC_MAX); argtable = mdocargs[tok - MDOC_Dd].argvs; if (argtable == NULL) return; /* Loop over the flags on the input line. */ ipos = *pos; while (buf[ipos] == '-') { /* Seek to the first unescaped space. */ for (argname = buf + ++ipos; buf[ipos] != '\0'; ipos++) if (buf[ipos] == ' ' && buf[ipos - 1] != '\\') break; /* * We want to nil-terminate the word to look it up. * But we may not have a flag, in which case we need * to restore the line as-is. So keep around the * stray byte, which we'll reset upon exiting. */ if ((savechar = buf[ipos]) != '\0') buf[ipos++] = '\0'; /* * Now look up the word as a flag. Use temporary * storage that we'll copy into the node's flags. */ while ((tmpv.arg = *argtable++) != MDOC_ARG_MAX) if ( ! strcmp(argname, mdoc_argnames[tmpv.arg])) break; /* If it isn't a flag, restore the saved byte. */ if (tmpv.arg == MDOC_ARG_MAX) { if (savechar != '\0') buf[ipos - 1] = savechar; break; } /* Read to the next word (the first argument). */ while (buf[ipos] == ' ') ipos++; /* Parse the arguments of the flag. */ tmpv.line = line; tmpv.pos = *pos; tmpv.sz = 0; tmpv.value = NULL; switch (argvflags[tmpv.arg]) { case ARGV_SINGLE: argv_single(mdoc, line, &tmpv, &ipos, buf); break; case ARGV_MULTI: argv_multi(mdoc, line, &tmpv, &ipos, buf); break; case ARGV_NONE: break; } /* Append to the return values. */ if (*reta == NULL) *reta = mandoc_calloc(1, sizeof(**reta)); retc = ++(*reta)->argc; retv = &(*reta)->argv; *retv = mandoc_reallocarray(*retv, retc, sizeof(**retv)); memcpy(*retv + retc - 1, &tmpv, sizeof(**retv)); /* Prepare for parsing the next flag. */ *pos = ipos; argtable = mdocargs[tok - MDOC_Dd].argvs; } } void mdoc_argv_free(struct mdoc_arg *p) { int i; if (NULL == p) return; if (p->refcnt) { --(p->refcnt); if (p->refcnt) return; } assert(p->argc); for (i = (int)p->argc - 1; i >= 0; i--) argn_free(p, i); free(p->argv); free(p); } static void argn_free(struct mdoc_arg *p, int iarg) { struct mdoc_argv *arg; int j; arg = &p->argv[iarg]; if (arg->sz && arg->value) { for (j = (int)arg->sz - 1; j >= 0; j--) free(arg->value[j]); free(arg->value); } for (--p->argc; iarg < (int)p->argc; iarg++) p->argv[iarg] = p->argv[iarg+1]; } enum margserr mdoc_args(struct roff_man *mdoc, int line, int *pos, char *buf, enum roff_tok tok, char **v) { struct roff_node *n; enum argsflag fl; fl = tok == TOKEN_NONE ? ARGSFL_NONE : mdocargs[tok - MDOC_Dd].flags; /* * We know that we're in an `It', so it's reasonable to expect * us to be sitting in a `Bl'. Someday this may not be the case * (if we allow random `It's sitting out there), so provide a * safe fall-back into the default behaviour. */ if (tok == MDOC_It) { for (n = mdoc->last; n != NULL; n = n->parent) { if (n->tok != MDOC_Bl) continue; if (n->norm->Bl.type == LIST_column) fl = ARGSFL_TABSEP; break; } } return args(mdoc, line, pos, buf, fl, v); } static enum margserr args(struct roff_man *mdoc, int line, int *pos, char *buf, enum argsflag fl, char **v) { char *p; char *v_local; int pairs; if (buf[*pos] == '\0') { if (mdoc->flags & MDOC_PHRASELIT && ! (mdoc->flags & MDOC_PHRASE)) { mandoc_msg(MANDOCERR_ARG_QUOTE, line, *pos, NULL); mdoc->flags &= ~MDOC_PHRASELIT; } mdoc->flags &= ~MDOC_PHRASEQL; return ARGS_EOLN; } if (v == NULL) v = &v_local; *v = buf + *pos; if (fl == ARGSFL_DELIM && args_checkpunct(buf, *pos)) return ARGS_PUNCT; /* * Tabs in `It' lines in `Bl -column' can't be escaped. * Phrases are reparsed for `Ta' and other macros later. */ if (fl == ARGSFL_TABSEP) { if ((p = strchr(*v, '\t')) != NULL) { /* * Words right before and right after * tab characters are not parsed, * unless there is a blank in between. */ if (p > buf && p[-1] != ' ') mdoc->flags |= MDOC_PHRASEQL; if (p[1] != ' ') mdoc->flags |= MDOC_PHRASEQN; /* * One or more blanks after a tab cause * one leading blank in the next column. * So skip all but one of them. */ *pos += (int)(p - *v) + 1; while (buf[*pos] == ' ' && buf[*pos + 1] == ' ') (*pos)++; /* * A tab at the end of an input line * switches to the next column. */ if (buf[*pos] == '\0' || buf[*pos + 1] == '\0') mdoc->flags |= MDOC_PHRASEQN; } else { p = strchr(*v, '\0'); if (p[-1] == ' ') mandoc_msg(MANDOCERR_SPACE_EOL, line, *pos, NULL); *pos += (int)(p - *v); } /* Skip any trailing blank characters. */ while (p > *v && p[-1] == ' ' && (p - 1 == *v || p[-2] != '\\')) p--; *p = '\0'; return ARGS_PHRASE; } /* * Process a quoted literal. A quote begins with a double-quote * and ends with a double-quote NOT preceded by a double-quote. * NUL-terminate the literal in place. * Collapse pairs of quotes inside quoted literals. * Whitespace is NOT involved in literal termination. */ if (mdoc->flags & MDOC_PHRASELIT || (mdoc->flags & MDOC_PHRASE && buf[*pos] == '\"')) { if ((mdoc->flags & MDOC_PHRASELIT) == 0) { *v = &buf[++(*pos)]; mdoc->flags |= MDOC_PHRASELIT; } pairs = 0; for ( ; buf[*pos]; (*pos)++) { /* Move following text left after quoted quotes. */ if (pairs) buf[*pos - pairs] = buf[*pos]; if ('\"' != buf[*pos]) continue; /* Unquoted quotes end quoted args. */ if ('\"' != buf[*pos + 1]) break; /* Quoted quotes collapse. */ pairs++; (*pos)++; } if (pairs) buf[*pos - pairs] = '\0'; if (buf[*pos] == '\0') { if ( ! (mdoc->flags & MDOC_PHRASE)) mandoc_msg(MANDOCERR_ARG_QUOTE, line, *pos, NULL); return ARGS_WORD; } mdoc->flags &= ~MDOC_PHRASELIT; buf[(*pos)++] = '\0'; if ('\0' == buf[*pos]) return ARGS_WORD; while (' ' == buf[*pos]) (*pos)++; if ('\0' == buf[*pos]) mandoc_msg(MANDOCERR_SPACE_EOL, line, *pos, NULL); return ARGS_WORD; } p = &buf[*pos]; *v = roff_getarg(mdoc->roff, &p, line, pos); if (v == &v_local) free(*v); /* * After parsing the last word in this phrase, * tell lookup() whether or not to interpret it. */ if (*p == '\0' && mdoc->flags & MDOC_PHRASEQL) { mdoc->flags &= ~MDOC_PHRASEQL; mdoc->flags |= MDOC_PHRASEQF; } return ARGS_ALLOC; } /* * Check if the string consists only of space-separated closing * delimiters. This is a bit of a dance: the first must be a close * delimiter, but it may be followed by middle delimiters. Arbitrary * whitespace may separate these tokens. */ static int args_checkpunct(const char *buf, int i) { int j; char dbuf[DELIMSZ]; enum mdelim d; /* First token must be a close-delimiter. */ for (j = 0; buf[i] && ' ' != buf[i] && j < DELIMSZ; j++, i++) dbuf[j] = buf[i]; if (DELIMSZ == j) return 0; dbuf[j] = '\0'; if (DELIM_CLOSE != mdoc_isdelim(dbuf)) return 0; while (' ' == buf[i]) i++; /* Remaining must NOT be open/none. */ while (buf[i]) { j = 0; while (buf[i] && ' ' != buf[i] && j < DELIMSZ) dbuf[j++] = buf[i++]; if (DELIMSZ == j) return 0; dbuf[j] = '\0'; d = mdoc_isdelim(dbuf); if (DELIM_NONE == d || DELIM_OPEN == d) return 0; while (' ' == buf[i]) i++; } return '\0' == buf[i]; } static void argv_multi(struct roff_man *mdoc, int line, struct mdoc_argv *v, int *pos, char *buf) { enum margserr ac; char *p; for (v->sz = 0; ; v->sz++) { if (buf[*pos] == '-') break; ac = args(mdoc, line, pos, buf, ARGSFL_NONE, &p); if (ac == ARGS_EOLN) break; if (v->sz % MULTI_STEP == 0) v->value = mandoc_reallocarray(v->value, v->sz + MULTI_STEP, sizeof(char *)); if (ac != ARGS_ALLOC) p = mandoc_strdup(p); v->value[(int)v->sz] = p; } } static void argv_single(struct roff_man *mdoc, int line, struct mdoc_argv *v, int *pos, char *buf) { enum margserr ac; char *p; ac = args(mdoc, line, pos, buf, ARGSFL_NONE, &p); if (ac == ARGS_EOLN) return; if (ac != ARGS_ALLOC) p = mandoc_strdup(p); v->sz = 1; v->value = mandoc_malloc(sizeof(char *)); v->value[0] = p; } mandoc-1.14.6/mdoc_html.c010064400017530001753000001057721412314055300154750ustar00schwarzeschwarze/* $Id: mdoc_html.c,v 1.342 2021/03/30 19:26:20 schwarze Exp $ */ /* * Copyright (c) 2014-2021 Ingo Schwarze * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * HTML formatter for mdoc(7) used by mandoc(1). */ #include "config.h" #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "out.h" #include "html.h" #include "main.h" #define MDOC_ARGS const struct roff_meta *meta, \ struct roff_node *n, \ struct html *h #ifndef MIN #define MIN(a,b) ((/*CONSTCOND*/(a)<(b))?(a):(b)) #endif struct mdoc_html_act { int (*pre)(MDOC_ARGS); void (*post)(MDOC_ARGS); }; static void print_mdoc_head(const struct roff_meta *, struct html *); static void print_mdoc_node(MDOC_ARGS); static void print_mdoc_nodelist(MDOC_ARGS); static void synopsis_pre(struct html *, struct roff_node *); static void mdoc_root_post(const struct roff_meta *, struct html *); static int mdoc_root_pre(const struct roff_meta *, struct html *); static void mdoc__x_post(MDOC_ARGS); static int mdoc__x_pre(MDOC_ARGS); static int mdoc_abort_pre(MDOC_ARGS); static int mdoc_ad_pre(MDOC_ARGS); static int mdoc_an_pre(MDOC_ARGS); static int mdoc_ap_pre(MDOC_ARGS); static int mdoc_ar_pre(MDOC_ARGS); static int mdoc_bd_pre(MDOC_ARGS); static int mdoc_bf_pre(MDOC_ARGS); static void mdoc_bk_post(MDOC_ARGS); static int mdoc_bk_pre(MDOC_ARGS); static int mdoc_bl_pre(MDOC_ARGS); static int mdoc_cd_pre(MDOC_ARGS); static int mdoc_code_pre(MDOC_ARGS); static int mdoc_d1_pre(MDOC_ARGS); static int mdoc_fa_pre(MDOC_ARGS); static int mdoc_fd_pre(MDOC_ARGS); static int mdoc_fl_pre(MDOC_ARGS); static int mdoc_fn_pre(MDOC_ARGS); static int mdoc_ft_pre(MDOC_ARGS); static int mdoc_em_pre(MDOC_ARGS); static void mdoc_eo_post(MDOC_ARGS); static int mdoc_eo_pre(MDOC_ARGS); static int mdoc_ex_pre(MDOC_ARGS); static void mdoc_fo_post(MDOC_ARGS); static int mdoc_fo_pre(MDOC_ARGS); static int mdoc_igndelim_pre(MDOC_ARGS); static int mdoc_in_pre(MDOC_ARGS); static int mdoc_it_pre(MDOC_ARGS); static int mdoc_lb_pre(MDOC_ARGS); static int mdoc_lk_pre(MDOC_ARGS); static int mdoc_mt_pre(MDOC_ARGS); static int mdoc_nd_pre(MDOC_ARGS); static int mdoc_nm_pre(MDOC_ARGS); static int mdoc_no_pre(MDOC_ARGS); static int mdoc_ns_pre(MDOC_ARGS); static int mdoc_pa_pre(MDOC_ARGS); static void mdoc_pf_post(MDOC_ARGS); static int mdoc_pp_pre(MDOC_ARGS); static void mdoc_quote_post(MDOC_ARGS); static int mdoc_quote_pre(MDOC_ARGS); static int mdoc_rs_pre(MDOC_ARGS); static int mdoc_sh_pre(MDOC_ARGS); static int mdoc_skip_pre(MDOC_ARGS); static int mdoc_sm_pre(MDOC_ARGS); static int mdoc_ss_pre(MDOC_ARGS); static int mdoc_st_pre(MDOC_ARGS); static int mdoc_sx_pre(MDOC_ARGS); static int mdoc_sy_pre(MDOC_ARGS); static int mdoc_tg_pre(MDOC_ARGS); static int mdoc_va_pre(MDOC_ARGS); static int mdoc_vt_pre(MDOC_ARGS); static int mdoc_xr_pre(MDOC_ARGS); static int mdoc_xx_pre(MDOC_ARGS); static const struct mdoc_html_act mdoc_html_acts[MDOC_MAX - MDOC_Dd] = { {NULL, NULL}, /* Dd */ {NULL, NULL}, /* Dt */ {NULL, NULL}, /* Os */ {mdoc_sh_pre, NULL }, /* Sh */ {mdoc_ss_pre, NULL }, /* Ss */ {mdoc_pp_pre, NULL}, /* Pp */ {mdoc_d1_pre, NULL}, /* D1 */ {mdoc_d1_pre, NULL}, /* Dl */ {mdoc_bd_pre, NULL}, /* Bd */ {NULL, NULL}, /* Ed */ {mdoc_bl_pre, NULL}, /* Bl */ {NULL, NULL}, /* El */ {mdoc_it_pre, NULL}, /* It */ {mdoc_ad_pre, NULL}, /* Ad */ {mdoc_an_pre, NULL}, /* An */ {mdoc_ap_pre, NULL}, /* Ap */ {mdoc_ar_pre, NULL}, /* Ar */ {mdoc_cd_pre, NULL}, /* Cd */ {mdoc_code_pre, NULL}, /* Cm */ {mdoc_code_pre, NULL}, /* Dv */ {mdoc_code_pre, NULL}, /* Er */ {mdoc_code_pre, NULL}, /* Ev */ {mdoc_ex_pre, NULL}, /* Ex */ {mdoc_fa_pre, NULL}, /* Fa */ {mdoc_fd_pre, NULL}, /* Fd */ {mdoc_fl_pre, NULL}, /* Fl */ {mdoc_fn_pre, NULL}, /* Fn */ {mdoc_ft_pre, NULL}, /* Ft */ {mdoc_code_pre, NULL}, /* Ic */ {mdoc_in_pre, NULL}, /* In */ {mdoc_code_pre, NULL}, /* Li */ {mdoc_nd_pre, NULL}, /* Nd */ {mdoc_nm_pre, NULL}, /* Nm */ {mdoc_quote_pre, mdoc_quote_post}, /* Op */ {mdoc_abort_pre, NULL}, /* Ot */ {mdoc_pa_pre, NULL}, /* Pa */ {mdoc_ex_pre, NULL}, /* Rv */ {mdoc_st_pre, NULL}, /* St */ {mdoc_va_pre, NULL}, /* Va */ {mdoc_vt_pre, NULL}, /* Vt */ {mdoc_xr_pre, NULL}, /* Xr */ {mdoc__x_pre, mdoc__x_post}, /* %A */ {mdoc__x_pre, mdoc__x_post}, /* %B */ {mdoc__x_pre, mdoc__x_post}, /* %D */ {mdoc__x_pre, mdoc__x_post}, /* %I */ {mdoc__x_pre, mdoc__x_post}, /* %J */ {mdoc__x_pre, mdoc__x_post}, /* %N */ {mdoc__x_pre, mdoc__x_post}, /* %O */ {mdoc__x_pre, mdoc__x_post}, /* %P */ {mdoc__x_pre, mdoc__x_post}, /* %R */ {mdoc__x_pre, mdoc__x_post}, /* %T */ {mdoc__x_pre, mdoc__x_post}, /* %V */ {NULL, NULL}, /* Ac */ {mdoc_quote_pre, mdoc_quote_post}, /* Ao */ {mdoc_quote_pre, mdoc_quote_post}, /* Aq */ {mdoc_xx_pre, NULL}, /* At */ {NULL, NULL}, /* Bc */ {mdoc_bf_pre, NULL}, /* Bf */ {mdoc_quote_pre, mdoc_quote_post}, /* Bo */ {mdoc_quote_pre, mdoc_quote_post}, /* Bq */ {mdoc_xx_pre, NULL}, /* Bsx */ {mdoc_xx_pre, NULL}, /* Bx */ {mdoc_skip_pre, NULL}, /* Db */ {NULL, NULL}, /* Dc */ {mdoc_quote_pre, mdoc_quote_post}, /* Do */ {mdoc_quote_pre, mdoc_quote_post}, /* Dq */ {NULL, NULL}, /* Ec */ /* FIXME: no space */ {NULL, NULL}, /* Ef */ {mdoc_em_pre, NULL}, /* Em */ {mdoc_eo_pre, mdoc_eo_post}, /* Eo */ {mdoc_xx_pre, NULL}, /* Fx */ {mdoc_no_pre, NULL}, /* Ms */ {mdoc_no_pre, NULL}, /* No */ {mdoc_ns_pre, NULL}, /* Ns */ {mdoc_xx_pre, NULL}, /* Nx */ {mdoc_xx_pre, NULL}, /* Ox */ {NULL, NULL}, /* Pc */ {mdoc_igndelim_pre, mdoc_pf_post}, /* Pf */ {mdoc_quote_pre, mdoc_quote_post}, /* Po */ {mdoc_quote_pre, mdoc_quote_post}, /* Pq */ {NULL, NULL}, /* Qc */ {mdoc_quote_pre, mdoc_quote_post}, /* Ql */ {mdoc_quote_pre, mdoc_quote_post}, /* Qo */ {mdoc_quote_pre, mdoc_quote_post}, /* Qq */ {NULL, NULL}, /* Re */ {mdoc_rs_pre, NULL}, /* Rs */ {NULL, NULL}, /* Sc */ {mdoc_quote_pre, mdoc_quote_post}, /* So */ {mdoc_quote_pre, mdoc_quote_post}, /* Sq */ {mdoc_sm_pre, NULL}, /* Sm */ {mdoc_sx_pre, NULL}, /* Sx */ {mdoc_sy_pre, NULL}, /* Sy */ {NULL, NULL}, /* Tn */ {mdoc_xx_pre, NULL}, /* Ux */ {NULL, NULL}, /* Xc */ {NULL, NULL}, /* Xo */ {mdoc_fo_pre, mdoc_fo_post}, /* Fo */ {NULL, NULL}, /* Fc */ {mdoc_quote_pre, mdoc_quote_post}, /* Oo */ {NULL, NULL}, /* Oc */ {mdoc_bk_pre, mdoc_bk_post}, /* Bk */ {NULL, NULL}, /* Ek */ {NULL, NULL}, /* Bt */ {NULL, NULL}, /* Hf */ {mdoc_em_pre, NULL}, /* Fr */ {NULL, NULL}, /* Ud */ {mdoc_lb_pre, NULL}, /* Lb */ {mdoc_abort_pre, NULL}, /* Lp */ {mdoc_lk_pre, NULL}, /* Lk */ {mdoc_mt_pre, NULL}, /* Mt */ {mdoc_quote_pre, mdoc_quote_post}, /* Brq */ {mdoc_quote_pre, mdoc_quote_post}, /* Bro */ {NULL, NULL}, /* Brc */ {mdoc__x_pre, mdoc__x_post}, /* %C */ {mdoc_skip_pre, NULL}, /* Es */ {mdoc_quote_pre, mdoc_quote_post}, /* En */ {mdoc_xx_pre, NULL}, /* Dx */ {mdoc__x_pre, mdoc__x_post}, /* %Q */ {mdoc__x_pre, mdoc__x_post}, /* %U */ {NULL, NULL}, /* Ta */ {mdoc_tg_pre, NULL}, /* Tg */ }; /* * See the same function in mdoc_term.c for documentation. */ static void synopsis_pre(struct html *h, struct roff_node *n) { struct roff_node *np; if ((n->flags & NODE_SYNPRETTY) == 0 || (np = roff_node_prev(n)) == NULL) return; if (np->tok == n->tok && MDOC_Fo != n->tok && MDOC_Ft != n->tok && MDOC_Fn != n->tok) { print_otag(h, TAG_BR, ""); return; } switch (np->tok) { case MDOC_Fd: case MDOC_Fn: case MDOC_Fo: case MDOC_In: case MDOC_Vt: break; case MDOC_Ft: if (n->tok != MDOC_Fn && n->tok != MDOC_Fo) break; /* FALLTHROUGH */ default: print_otag(h, TAG_BR, ""); return; } html_close_paragraph(h); print_otag(h, TAG_P, "c", "Pp"); } void html_mdoc(void *arg, const struct roff_meta *mdoc) { struct html *h; struct roff_node *n; struct tag *t; h = (struct html *)arg; n = mdoc->first->child; if ((h->oflags & HTML_FRAGMENT) == 0) { print_gen_decls(h); print_otag(h, TAG_HTML, ""); if (n != NULL && n->type == ROFFT_COMMENT) print_gen_comment(h, n); t = print_otag(h, TAG_HEAD, ""); print_mdoc_head(mdoc, h); print_tagq(h, t); print_otag(h, TAG_BODY, ""); } mdoc_root_pre(mdoc, h); t = print_otag(h, TAG_DIV, "c", "manual-text"); print_mdoc_nodelist(mdoc, n, h); print_tagq(h, t); mdoc_root_post(mdoc, h); print_tagq(h, NULL); } static void print_mdoc_head(const struct roff_meta *meta, struct html *h) { char *cp; print_gen_head(h); if (meta->arch != NULL && meta->msec != NULL) mandoc_asprintf(&cp, "%s(%s) (%s)", meta->title, meta->msec, meta->arch); else if (meta->msec != NULL) mandoc_asprintf(&cp, "%s(%s)", meta->title, meta->msec); else if (meta->arch != NULL) mandoc_asprintf(&cp, "%s (%s)", meta->title, meta->arch); else cp = mandoc_strdup(meta->title); print_otag(h, TAG_TITLE, ""); print_text(h, cp); free(cp); } static void print_mdoc_nodelist(MDOC_ARGS) { while (n != NULL) { print_mdoc_node(meta, n, h); n = n->next; } } static void print_mdoc_node(MDOC_ARGS) { struct tag *t; int child; if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; if ((n->flags & NODE_NOFILL) == 0) html_fillmode(h, ROFF_fi); else if (html_fillmode(h, ROFF_nf) == ROFF_nf && n->tok != ROFF_fi && n->flags & NODE_LINE) print_endline(h); child = 1; n->flags &= ~NODE_ENDED; switch (n->type) { case ROFFT_TEXT: if (n->flags & NODE_LINE) { switch (*n->string) { case '\0': h->col = 1; print_endline(h); return; case ' ': if ((h->flags & HTML_NONEWLINE) == 0 && (n->flags & NODE_NOFILL) == 0) print_otag(h, TAG_BR, ""); break; default: break; } } t = h->tag; t->refcnt++; if (n->flags & NODE_DELIMC) h->flags |= HTML_NOSPACE; if (n->flags & NODE_HREF) print_tagged_text(h, n->string, n); else print_text(h, n->string); if (n->flags & NODE_DELIMO) h->flags |= HTML_NOSPACE; break; case ROFFT_EQN: t = h->tag; t->refcnt++; print_eqn(h, n->eqn); break; case ROFFT_TBL: /* * This will take care of initialising all of the table * state data for the first table, then tearing it down * for the last one. */ print_tbl(h, n->span); return; default: /* * Close out the current table, if it's open, and unset * the "meta" table state. This will be reopened on the * next table element. */ if (h->tblt != NULL) print_tblclose(h); assert(h->tblt == NULL); t = h->tag; t->refcnt++; if (n->tok < ROFF_MAX) { roff_html_pre(h, n); t->refcnt--; print_stagq(h, t); return; } assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); if (mdoc_html_acts[n->tok - MDOC_Dd].pre != NULL && (n->end == ENDBODY_NOT || n->child != NULL)) child = (*mdoc_html_acts[n->tok - MDOC_Dd].pre)(meta, n, h); break; } if (h->flags & HTML_KEEP && n->flags & NODE_LINE) { h->flags &= ~HTML_KEEP; h->flags |= HTML_PREKEEP; } if (child && n->child != NULL) print_mdoc_nodelist(meta, n->child, h); t->refcnt--; print_stagq(h, t); switch (n->type) { case ROFFT_TEXT: case ROFFT_EQN: break; default: if (mdoc_html_acts[n->tok - MDOC_Dd].post == NULL || n->flags & NODE_ENDED) break; (*mdoc_html_acts[n->tok - MDOC_Dd].post)(meta, n, h); if (n->end != ENDBODY_NOT) n->body->flags |= NODE_ENDED; break; } } static void mdoc_root_post(const struct roff_meta *meta, struct html *h) { struct tag *t, *tt; t = print_otag(h, TAG_TABLE, "c", "foot"); tt = print_otag(h, TAG_TR, ""); print_otag(h, TAG_TD, "c", "foot-date"); print_text(h, meta->date); print_stagq(h, tt); print_otag(h, TAG_TD, "c", "foot-os"); print_text(h, meta->os); print_tagq(h, t); } static int mdoc_root_pre(const struct roff_meta *meta, struct html *h) { struct tag *t, *tt; char *volume, *title; if (NULL == meta->arch) volume = mandoc_strdup(meta->vol); else mandoc_asprintf(&volume, "%s (%s)", meta->vol, meta->arch); if (NULL == meta->msec) title = mandoc_strdup(meta->title); else mandoc_asprintf(&title, "%s(%s)", meta->title, meta->msec); t = print_otag(h, TAG_TABLE, "c", "head"); tt = print_otag(h, TAG_TR, ""); print_otag(h, TAG_TD, "c", "head-ltitle"); print_text(h, title); print_stagq(h, tt); print_otag(h, TAG_TD, "c", "head-vol"); print_text(h, volume); print_stagq(h, tt); print_otag(h, TAG_TD, "c", "head-rtitle"); print_text(h, title); print_tagq(h, t); free(title); free(volume); return 1; } static int mdoc_code_pre(MDOC_ARGS) { print_otag_id(h, TAG_CODE, roff_name[n->tok], n); return 1; } static int mdoc_sh_pre(MDOC_ARGS) { struct roff_node *sn, *subn; struct tag *t, *tsec, *tsub; char *id; int sc; switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); if ((h->oflags & HTML_TOC) == 0 || h->flags & HTML_TOCDONE || n->sec <= SEC_SYNOPSIS) { print_otag(h, TAG_SECTION, "c", "Sh"); break; } h->flags |= HTML_TOCDONE; sc = 0; for (sn = n->next; sn != NULL; sn = sn->next) if (sn->sec == SEC_CUSTOM) if (++sc == 2) break; if (sc < 2) break; t = print_otag(h, TAG_H1, "c", "Sh"); print_text(h, "TABLE OF CONTENTS"); print_tagq(h, t); t = print_otag(h, TAG_UL, "c", "Bl-compact"); for (sn = n; sn != NULL; sn = sn->next) { tsec = print_otag(h, TAG_LI, ""); id = html_make_id(sn->head, 0); tsub = print_otag(h, TAG_A, "hR", id); free(id); print_mdoc_nodelist(meta, sn->head->child, h); print_tagq(h, tsub); tsub = NULL; for (subn = sn->body->child; subn != NULL; subn = subn->next) { if (subn->tok != MDOC_Ss) continue; id = html_make_id(subn->head, 0); if (id == NULL) continue; if (tsub == NULL) print_otag(h, TAG_UL, "c", "Bl-compact"); tsub = print_otag(h, TAG_LI, ""); print_otag(h, TAG_A, "hR", id); free(id); print_mdoc_nodelist(meta, subn->head->child, h); print_tagq(h, tsub); } print_tagq(h, tsec); } print_tagq(h, t); print_otag(h, TAG_SECTION, "c", "Sh"); break; case ROFFT_HEAD: print_otag_id(h, TAG_H1, "Sh", n); break; case ROFFT_BODY: if (n->sec == SEC_AUTHORS) h->flags &= ~(HTML_SPLIT|HTML_NOSPLIT); break; default: break; } return 1; } static int mdoc_ss_pre(MDOC_ARGS) { switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); print_otag(h, TAG_SECTION, "c", "Ss"); break; case ROFFT_HEAD: print_otag_id(h, TAG_H2, "Ss", n); break; case ROFFT_BODY: break; default: abort(); } return 1; } static int mdoc_fl_pre(MDOC_ARGS) { struct roff_node *nn; print_otag_id(h, TAG_CODE, "Fl", n); print_text(h, "\\-"); if (n->child != NULL || ((nn = roff_node_next(n)) != NULL && nn->type != ROFFT_TEXT && (nn->flags & NODE_LINE) == 0)) h->flags |= HTML_NOSPACE; return 1; } static int mdoc_nd_pre(MDOC_ARGS) { switch (n->type) { case ROFFT_BLOCK: return 1; case ROFFT_HEAD: return 0; case ROFFT_BODY: break; default: abort(); } print_text(h, "\\(em"); print_otag(h, TAG_SPAN, "c", "Nd"); return 1; } static int mdoc_nm_pre(MDOC_ARGS) { switch (n->type) { case ROFFT_BLOCK: break; case ROFFT_HEAD: print_otag(h, TAG_TD, ""); /* FALLTHROUGH */ case ROFFT_ELEM: print_otag(h, TAG_CODE, "c", "Nm"); return 1; case ROFFT_BODY: print_otag(h, TAG_TD, ""); return 1; default: abort(); } html_close_paragraph(h); synopsis_pre(h, n); print_otag(h, TAG_TABLE, "c", "Nm"); print_otag(h, TAG_TR, ""); return 1; } static int mdoc_xr_pre(MDOC_ARGS) { if (NULL == n->child) return 0; if (h->base_man1) print_otag(h, TAG_A, "chM", "Xr", n->child->string, n->child->next == NULL ? NULL : n->child->next->string); else print_otag(h, TAG_A, "c", "Xr"); n = n->child; print_text(h, n->string); if (NULL == (n = n->next)) return 0; h->flags |= HTML_NOSPACE; print_text(h, "("); h->flags |= HTML_NOSPACE; print_text(h, n->string); h->flags |= HTML_NOSPACE; print_text(h, ")"); return 0; } static int mdoc_tg_pre(MDOC_ARGS) { char *id; if ((id = html_make_id(n, 1)) != NULL) { print_tagq(h, print_otag(h, TAG_MARK, "i", id)); free(id); } return 0; } static int mdoc_ns_pre(MDOC_ARGS) { if ( ! (NODE_LINE & n->flags)) h->flags |= HTML_NOSPACE; return 1; } static int mdoc_ar_pre(MDOC_ARGS) { print_otag(h, TAG_VAR, "c", "Ar"); return 1; } static int mdoc_xx_pre(MDOC_ARGS) { print_otag(h, TAG_SPAN, "c", "Ux"); return 1; } static int mdoc_it_pre(MDOC_ARGS) { const struct roff_node *bl; enum mdoc_list type; bl = n->parent; while (bl->tok != MDOC_Bl) bl = bl->parent; type = bl->norm->Bl.type; switch (type) { case LIST_bullet: case LIST_dash: case LIST_hyphen: case LIST_item: case LIST_enum: switch (n->type) { case ROFFT_HEAD: return 0; case ROFFT_BODY: print_otag_id(h, TAG_LI, NULL, n); break; default: break; } break; case LIST_diag: case LIST_hang: case LIST_inset: case LIST_ohang: switch (n->type) { case ROFFT_HEAD: print_otag_id(h, TAG_DT, NULL, n); break; case ROFFT_BODY: print_otag(h, TAG_DD, ""); break; default: break; } break; case LIST_tag: switch (n->type) { case ROFFT_HEAD: print_otag_id(h, TAG_DT, NULL, n); break; case ROFFT_BODY: if (n->child == NULL) { print_otag(h, TAG_DD, "s", "width", "auto"); print_text(h, "\\ "); } else print_otag(h, TAG_DD, ""); break; default: break; } break; case LIST_column: switch (n->type) { case ROFFT_HEAD: break; case ROFFT_BODY: print_otag(h, TAG_TD, ""); break; default: print_otag_id(h, TAG_TR, NULL, n); } default: break; } return 1; } static int mdoc_bl_pre(MDOC_ARGS) { char cattr[32]; struct mdoc_bl *bl; enum htmltag elemtype; switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); break; case ROFFT_HEAD: return 0; case ROFFT_BODY: return 1; default: abort(); } bl = &n->norm->Bl; switch (bl->type) { case LIST_bullet: elemtype = TAG_UL; (void)strlcpy(cattr, "Bl-bullet", sizeof(cattr)); break; case LIST_dash: case LIST_hyphen: elemtype = TAG_UL; (void)strlcpy(cattr, "Bl-dash", sizeof(cattr)); break; case LIST_item: elemtype = TAG_UL; (void)strlcpy(cattr, "Bl-item", sizeof(cattr)); break; case LIST_enum: elemtype = TAG_OL; (void)strlcpy(cattr, "Bl-enum", sizeof(cattr)); break; case LIST_diag: elemtype = TAG_DL; (void)strlcpy(cattr, "Bl-diag", sizeof(cattr)); break; case LIST_hang: elemtype = TAG_DL; (void)strlcpy(cattr, "Bl-hang", sizeof(cattr)); break; case LIST_inset: elemtype = TAG_DL; (void)strlcpy(cattr, "Bl-inset", sizeof(cattr)); break; case LIST_ohang: elemtype = TAG_DL; (void)strlcpy(cattr, "Bl-ohang", sizeof(cattr)); break; case LIST_tag: if (bl->offs) print_otag(h, TAG_DIV, "c", "Bd-indent"); print_otag_id(h, TAG_DL, bl->comp ? "Bl-tag Bl-compact" : "Bl-tag", n->body); return 1; case LIST_column: elemtype = TAG_TABLE; (void)strlcpy(cattr, "Bl-column", sizeof(cattr)); break; default: abort(); } if (bl->offs != NULL) (void)strlcat(cattr, " Bd-indent", sizeof(cattr)); if (bl->comp) (void)strlcat(cattr, " Bl-compact", sizeof(cattr)); print_otag_id(h, elemtype, cattr, n->body); return 1; } static int mdoc_ex_pre(MDOC_ARGS) { if (roff_node_prev(n) != NULL) print_otag(h, TAG_BR, ""); return 1; } static int mdoc_st_pre(MDOC_ARGS) { print_otag(h, TAG_SPAN, "c", "St"); return 1; } static int mdoc_em_pre(MDOC_ARGS) { print_otag_id(h, TAG_I, "Em", n); return 1; } static int mdoc_d1_pre(MDOC_ARGS) { switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); return 1; case ROFFT_HEAD: return 0; case ROFFT_BODY: break; default: abort(); } print_otag_id(h, TAG_DIV, "Bd Bd-indent", n); if (n->tok == MDOC_Dl) print_otag(h, TAG_CODE, "c", "Li"); return 1; } static int mdoc_sx_pre(MDOC_ARGS) { char *id; id = html_make_id(n, 0); print_otag(h, TAG_A, "chR", "Sx", id); free(id); return 1; } static int mdoc_bd_pre(MDOC_ARGS) { char buf[20]; struct roff_node *nn; int comp; switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); return 1; case ROFFT_HEAD: return 0; case ROFFT_BODY: break; default: abort(); } /* Handle preceding whitespace. */ comp = n->norm->Bd.comp; for (nn = n; nn != NULL && comp == 0; nn = nn->parent) { if (nn->type != ROFFT_BLOCK) continue; if (nn->tok == MDOC_Sh || nn->tok == MDOC_Ss) comp = 1; if (roff_node_prev(nn) != NULL) break; } (void)strlcpy(buf, "Bd", sizeof(buf)); if (comp == 0) (void)strlcat(buf, " Pp", sizeof(buf)); /* Handle the -offset argument. */ if (n->norm->Bd.offs != NULL && strcmp(n->norm->Bd.offs, "left") != 0) (void)strlcat(buf, " Bd-indent", sizeof(buf)); if (n->norm->Bd.type == DISP_literal) (void)strlcat(buf, " Li", sizeof(buf)); print_otag_id(h, TAG_DIV, buf, n); return 1; } static int mdoc_pa_pre(MDOC_ARGS) { print_otag(h, TAG_SPAN, "c", "Pa"); return 1; } static int mdoc_ad_pre(MDOC_ARGS) { print_otag(h, TAG_SPAN, "c", "Ad"); return 1; } static int mdoc_an_pre(MDOC_ARGS) { if (n->norm->An.auth == AUTH_split) { h->flags &= ~HTML_NOSPLIT; h->flags |= HTML_SPLIT; return 0; } if (n->norm->An.auth == AUTH_nosplit) { h->flags &= ~HTML_SPLIT; h->flags |= HTML_NOSPLIT; return 0; } if (h->flags & HTML_SPLIT) print_otag(h, TAG_BR, ""); if (n->sec == SEC_AUTHORS && ! (h->flags & HTML_NOSPLIT)) h->flags |= HTML_SPLIT; print_otag(h, TAG_SPAN, "c", "An"); return 1; } static int mdoc_cd_pre(MDOC_ARGS) { synopsis_pre(h, n); print_otag(h, TAG_CODE, "c", "Cd"); return 1; } static int mdoc_fa_pre(MDOC_ARGS) { const struct roff_node *nn; struct tag *t; if (n->parent->tok != MDOC_Fo) { print_otag(h, TAG_VAR, "c", "Fa"); return 1; } for (nn = n->child; nn != NULL; nn = nn->next) { t = print_otag(h, TAG_VAR, "c", "Fa"); print_text(h, nn->string); print_tagq(h, t); if (nn->next != NULL) { h->flags |= HTML_NOSPACE; print_text(h, ","); } } if (n->child != NULL && (nn = roff_node_next(n)) != NULL && nn->tok == MDOC_Fa) { h->flags |= HTML_NOSPACE; print_text(h, ","); } return 0; } static int mdoc_fd_pre(MDOC_ARGS) { struct tag *t; char *buf, *cp; synopsis_pre(h, n); if (NULL == (n = n->child)) return 0; assert(n->type == ROFFT_TEXT); if (strcmp(n->string, "#include")) { print_otag(h, TAG_CODE, "c", "Fd"); return 1; } print_otag(h, TAG_CODE, "c", "In"); print_text(h, n->string); if (NULL != (n = n->next)) { assert(n->type == ROFFT_TEXT); if (h->base_includes) { cp = n->string; if (*cp == '<' || *cp == '"') cp++; buf = mandoc_strdup(cp); cp = strchr(buf, '\0') - 1; if (cp >= buf && (*cp == '>' || *cp == '"')) *cp = '\0'; t = print_otag(h, TAG_A, "chI", "In", buf); free(buf); } else t = print_otag(h, TAG_A, "c", "In"); print_text(h, n->string); print_tagq(h, t); n = n->next; } for ( ; n; n = n->next) { assert(n->type == ROFFT_TEXT); print_text(h, n->string); } return 0; } static int mdoc_vt_pre(MDOC_ARGS) { if (n->type == ROFFT_BLOCK) { synopsis_pre(h, n); return 1; } else if (n->type == ROFFT_ELEM) { synopsis_pre(h, n); } else if (n->type == ROFFT_HEAD) return 0; print_otag(h, TAG_VAR, "c", "Vt"); return 1; } static int mdoc_ft_pre(MDOC_ARGS) { synopsis_pre(h, n); print_otag(h, TAG_VAR, "c", "Ft"); return 1; } static int mdoc_fn_pre(MDOC_ARGS) { struct tag *t; char nbuf[BUFSIZ]; const char *sp, *ep; int sz, pretty; pretty = NODE_SYNPRETTY & n->flags; synopsis_pre(h, n); /* Split apart into type and name. */ assert(n->child->string); sp = n->child->string; ep = strchr(sp, ' '); if (NULL != ep) { t = print_otag(h, TAG_VAR, "c", "Ft"); while (ep) { sz = MIN((int)(ep - sp), BUFSIZ - 1); (void)memcpy(nbuf, sp, (size_t)sz); nbuf[sz] = '\0'; print_text(h, nbuf); sp = ++ep; ep = strchr(sp, ' '); } print_tagq(h, t); } t = print_otag_id(h, TAG_CODE, "Fn", n); if (sp) print_text(h, sp); print_tagq(h, t); h->flags |= HTML_NOSPACE; print_text(h, "("); h->flags |= HTML_NOSPACE; for (n = n->child->next; n; n = n->next) { if (NODE_SYNPRETTY & n->flags) t = print_otag(h, TAG_VAR, "cs", "Fa", "white-space", "nowrap"); else t = print_otag(h, TAG_VAR, "c", "Fa"); print_text(h, n->string); print_tagq(h, t); if (n->next) { h->flags |= HTML_NOSPACE; print_text(h, ","); } } h->flags |= HTML_NOSPACE; print_text(h, ")"); if (pretty) { h->flags |= HTML_NOSPACE; print_text(h, ";"); } return 0; } static int mdoc_sm_pre(MDOC_ARGS) { if (NULL == n->child) h->flags ^= HTML_NONOSPACE; else if (0 == strcmp("on", n->child->string)) h->flags &= ~HTML_NONOSPACE; else h->flags |= HTML_NONOSPACE; if ( ! (HTML_NONOSPACE & h->flags)) h->flags &= ~HTML_NOSPACE; return 0; } static int mdoc_skip_pre(MDOC_ARGS) { return 0; } static int mdoc_pp_pre(MDOC_ARGS) { char *id; if (n->flags & NODE_NOFILL) { print_endline(h); if (n->flags & NODE_ID) mdoc_tg_pre(meta, n, h); else { h->col = 1; print_endline(h); } } else { html_close_paragraph(h); id = n->flags & NODE_ID ? html_make_id(n, 1) : NULL; print_otag(h, TAG_P, "ci", "Pp", id); free(id); } return 0; } static int mdoc_lk_pre(MDOC_ARGS) { const struct roff_node *link, *descr, *punct; struct tag *t; if ((link = n->child) == NULL) return 0; /* Find beginning of trailing punctuation. */ punct = n->last; while (punct != link && punct->flags & NODE_DELIMC) punct = punct->prev; punct = punct->next; /* Link target and link text. */ descr = link->next; if (descr == punct) descr = link; /* no text */ t = print_otag(h, TAG_A, "ch", "Lk", link->string); do { if (descr->flags & (NODE_DELIMC | NODE_DELIMO)) h->flags |= HTML_NOSPACE; print_text(h, descr->string); descr = descr->next; } while (descr != punct); print_tagq(h, t); /* Trailing punctuation. */ while (punct != NULL) { h->flags |= HTML_NOSPACE; print_text(h, punct->string); punct = punct->next; } return 0; } static int mdoc_mt_pre(MDOC_ARGS) { struct tag *t; char *cp; for (n = n->child; n; n = n->next) { assert(n->type == ROFFT_TEXT); mandoc_asprintf(&cp, "mailto:%s", n->string); t = print_otag(h, TAG_A, "ch", "Mt", cp); print_text(h, n->string); print_tagq(h, t); free(cp); } return 0; } static int mdoc_fo_pre(MDOC_ARGS) { struct tag *t; switch (n->type) { case ROFFT_BLOCK: synopsis_pre(h, n); return 1; case ROFFT_HEAD: if (n->child != NULL) { t = print_otag_id(h, TAG_CODE, "Fn", n); print_text(h, n->child->string); print_tagq(h, t); } return 0; case ROFFT_BODY: h->flags |= HTML_NOSPACE; print_text(h, "("); h->flags |= HTML_NOSPACE; return 1; default: abort(); } } static void mdoc_fo_post(MDOC_ARGS) { if (n->type != ROFFT_BODY) return; h->flags |= HTML_NOSPACE; print_text(h, ")"); h->flags |= HTML_NOSPACE; print_text(h, ";"); } static int mdoc_in_pre(MDOC_ARGS) { struct tag *t; synopsis_pre(h, n); print_otag(h, TAG_CODE, "c", "In"); /* * The first argument of the `In' gets special treatment as * being a linked value. Subsequent values are printed * afterward. groff does similarly. This also handles the case * of no children. */ if (NODE_SYNPRETTY & n->flags && NODE_LINE & n->flags) print_text(h, "#include"); print_text(h, "<"); h->flags |= HTML_NOSPACE; if (NULL != (n = n->child)) { assert(n->type == ROFFT_TEXT); if (h->base_includes) t = print_otag(h, TAG_A, "chI", "In", n->string); else t = print_otag(h, TAG_A, "c", "In"); print_text(h, n->string); print_tagq(h, t); n = n->next; } h->flags |= HTML_NOSPACE; print_text(h, ">"); for ( ; n; n = n->next) { assert(n->type == ROFFT_TEXT); print_text(h, n->string); } return 0; } static int mdoc_va_pre(MDOC_ARGS) { print_otag(h, TAG_VAR, "c", "Va"); return 1; } static int mdoc_ap_pre(MDOC_ARGS) { h->flags |= HTML_NOSPACE; print_text(h, "\\(aq"); h->flags |= HTML_NOSPACE; return 1; } static int mdoc_bf_pre(MDOC_ARGS) { const char *cattr; switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); return 1; case ROFFT_HEAD: return 0; case ROFFT_BODY: break; default: abort(); } if (FONT_Em == n->norm->Bf.font) cattr = "Bf Em"; else if (FONT_Sy == n->norm->Bf.font) cattr = "Bf Sy"; else if (FONT_Li == n->norm->Bf.font) cattr = "Bf Li"; else cattr = "Bf No"; /* Cannot use TAG_SPAN because it may contain blocks. */ print_otag(h, TAG_DIV, "c", cattr); return 1; } static int mdoc_igndelim_pre(MDOC_ARGS) { h->flags |= HTML_IGNDELIM; return 1; } static void mdoc_pf_post(MDOC_ARGS) { if ( ! (n->next == NULL || n->next->flags & NODE_LINE)) h->flags |= HTML_NOSPACE; } static int mdoc_rs_pre(MDOC_ARGS) { switch (n->type) { case ROFFT_BLOCK: if (n->sec == SEC_SEE_ALSO) html_close_paragraph(h); break; case ROFFT_HEAD: return 0; case ROFFT_BODY: if (n->sec == SEC_SEE_ALSO) print_otag(h, TAG_P, "c", "Pp"); print_otag(h, TAG_CITE, "c", "Rs"); break; default: abort(); } return 1; } static int mdoc_no_pre(MDOC_ARGS) { print_otag_id(h, TAG_SPAN, roff_name[n->tok], n); return 1; } static int mdoc_sy_pre(MDOC_ARGS) { print_otag_id(h, TAG_B, "Sy", n); return 1; } static int mdoc_lb_pre(MDOC_ARGS) { if (n->sec == SEC_LIBRARY && n->flags & NODE_LINE && roff_node_prev(n) != NULL) print_otag(h, TAG_BR, ""); print_otag(h, TAG_SPAN, "c", "Lb"); return 1; } static int mdoc__x_pre(MDOC_ARGS) { struct roff_node *nn; const char *cattr; enum htmltag t; t = TAG_SPAN; switch (n->tok) { case MDOC__A: cattr = "RsA"; if ((nn = roff_node_prev(n)) != NULL && nn->tok == MDOC__A && ((nn = roff_node_next(n)) == NULL || nn->tok != MDOC__A)) print_text(h, "and"); break; case MDOC__B: t = TAG_I; cattr = "RsB"; break; case MDOC__C: cattr = "RsC"; break; case MDOC__D: cattr = "RsD"; break; case MDOC__I: t = TAG_I; cattr = "RsI"; break; case MDOC__J: t = TAG_I; cattr = "RsJ"; break; case MDOC__N: cattr = "RsN"; break; case MDOC__O: cattr = "RsO"; break; case MDOC__P: cattr = "RsP"; break; case MDOC__Q: cattr = "RsQ"; break; case MDOC__R: cattr = "RsR"; break; case MDOC__T: cattr = "RsT"; break; case MDOC__U: print_otag(h, TAG_A, "ch", "RsU", n->child->string); return 1; case MDOC__V: cattr = "RsV"; break; default: abort(); } print_otag(h, t, "c", cattr); return 1; } static void mdoc__x_post(MDOC_ARGS) { struct roff_node *nn; if (n->tok == MDOC__A && (nn = roff_node_next(n)) != NULL && nn->tok == MDOC__A && ((nn = roff_node_next(nn)) == NULL || nn->tok != MDOC__A) && ((nn = roff_node_prev(n)) == NULL || nn->tok != MDOC__A)) return; /* TODO: %U */ if (n->parent == NULL || n->parent->tok != MDOC_Rs) return; h->flags |= HTML_NOSPACE; print_text(h, roff_node_next(n) ? "," : "."); } static int mdoc_bk_pre(MDOC_ARGS) { switch (n->type) { case ROFFT_BLOCK: break; case ROFFT_HEAD: return 0; case ROFFT_BODY: if (n->parent->args != NULL || n->prev->child == NULL) h->flags |= HTML_PREKEEP; break; default: abort(); } return 1; } static void mdoc_bk_post(MDOC_ARGS) { if (n->type == ROFFT_BODY) h->flags &= ~(HTML_KEEP | HTML_PREKEEP); } static int mdoc_quote_pre(MDOC_ARGS) { if (n->type != ROFFT_BODY) return 1; switch (n->tok) { case MDOC_Ao: case MDOC_Aq: print_text(h, n->child != NULL && n->child->next == NULL && n->child->tok == MDOC_Mt ? "<" : "\\(la"); break; case MDOC_Bro: case MDOC_Brq: print_text(h, "\\(lC"); break; case MDOC_Bo: case MDOC_Bq: print_text(h, "\\(lB"); break; case MDOC_Oo: case MDOC_Op: print_text(h, "\\(lB"); /* * Give up on semantic markup for now. * We cannot use TAG_SPAN because .Oo may contain blocks. * We cannot use TAG_DIV because we might be in a * phrasing context (like .Dl or .Pp); we cannot * close out a .Pp at this point either because * that would break the line. */ /* XXX print_otag(h, TAG_???, "c", "Op"); */ break; case MDOC_En: if (NULL == n->norm->Es || NULL == n->norm->Es->child) return 1; print_text(h, n->norm->Es->child->string); break; case MDOC_Do: case MDOC_Dq: print_text(h, "\\(lq"); break; case MDOC_Qo: case MDOC_Qq: print_text(h, "\""); break; case MDOC_Po: case MDOC_Pq: print_text(h, "("); break; case MDOC_Ql: print_text(h, "\\(oq"); h->flags |= HTML_NOSPACE; print_otag(h, TAG_CODE, "c", "Li"); break; case MDOC_So: case MDOC_Sq: print_text(h, "\\(oq"); break; default: abort(); } h->flags |= HTML_NOSPACE; return 1; } static void mdoc_quote_post(MDOC_ARGS) { if (n->type != ROFFT_BODY && n->type != ROFFT_ELEM) return; h->flags |= HTML_NOSPACE; switch (n->tok) { case MDOC_Ao: case MDOC_Aq: print_text(h, n->child != NULL && n->child->next == NULL && n->child->tok == MDOC_Mt ? ">" : "\\(ra"); break; case MDOC_Bro: case MDOC_Brq: print_text(h, "\\(rC"); break; case MDOC_Oo: case MDOC_Op: case MDOC_Bo: case MDOC_Bq: print_text(h, "\\(rB"); break; case MDOC_En: if (n->norm->Es == NULL || n->norm->Es->child == NULL || n->norm->Es->child->next == NULL) h->flags &= ~HTML_NOSPACE; else print_text(h, n->norm->Es->child->next->string); break; case MDOC_Do: case MDOC_Dq: print_text(h, "\\(rq"); break; case MDOC_Qo: case MDOC_Qq: print_text(h, "\""); break; case MDOC_Po: case MDOC_Pq: print_text(h, ")"); break; case MDOC_Ql: case MDOC_So: case MDOC_Sq: print_text(h, "\\(cq"); break; default: abort(); } } static int mdoc_eo_pre(MDOC_ARGS) { if (n->type != ROFFT_BODY) return 1; if (n->end == ENDBODY_NOT && n->parent->head->child == NULL && n->child != NULL && n->child->end != ENDBODY_NOT) print_text(h, "\\&"); else if (n->end != ENDBODY_NOT ? n->child != NULL : n->parent->head->child != NULL && (n->child != NULL || (n->parent->tail != NULL && n->parent->tail->child != NULL))) h->flags |= HTML_NOSPACE; return 1; } static void mdoc_eo_post(MDOC_ARGS) { int body, tail; if (n->type != ROFFT_BODY) return; if (n->end != ENDBODY_NOT) { h->flags &= ~HTML_NOSPACE; return; } body = n->child != NULL || n->parent->head->child != NULL; tail = n->parent->tail != NULL && n->parent->tail->child != NULL; if (body && tail) h->flags |= HTML_NOSPACE; else if ( ! tail) h->flags &= ~HTML_NOSPACE; } static int mdoc_abort_pre(MDOC_ARGS) { abort(); } mandoc-1.14.6/mdoc_macro.c010064400017530001753000001171321412314055300156230ustar00schwarzeschwarze/* $Id: mdoc_macro.c,v 1.234 2020/01/19 18:02:00 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2012-2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "libmandoc.h" #include "roff_int.h" #include "libmdoc.h" static void blk_full(MACRO_PROT_ARGS); static void blk_exp_close(MACRO_PROT_ARGS); static void blk_part_exp(MACRO_PROT_ARGS); static void blk_part_imp(MACRO_PROT_ARGS); static void ctx_synopsis(MACRO_PROT_ARGS); static void in_line_eoln(MACRO_PROT_ARGS); static void in_line_argn(MACRO_PROT_ARGS); static void in_line(MACRO_PROT_ARGS); static void phrase_ta(MACRO_PROT_ARGS); static void append_delims(struct roff_man *, int, int *, char *); static void dword(struct roff_man *, int, int, const char *, enum mdelim, int); static int find_pending(struct roff_man *, enum roff_tok, int, int, struct roff_node *); static int lookup(struct roff_man *, int, int, int, const char *); static int macro_or_word(MACRO_PROT_ARGS, char *, int); static void break_intermediate(struct roff_node *, struct roff_node *); static int parse_rest(struct roff_man *, enum roff_tok, int, int *, char *); static enum roff_tok rew_alt(enum roff_tok); static void rew_elem(struct roff_man *, enum roff_tok); static void rew_last(struct roff_man *, const struct roff_node *); static void rew_pending(struct roff_man *, const struct roff_node *); static const struct mdoc_macro mdoc_macros[MDOC_MAX - MDOC_Dd] = { { in_line_eoln, MDOC_PROLOGUE | MDOC_JOIN }, /* Dd */ { in_line_eoln, MDOC_PROLOGUE }, /* Dt */ { in_line_eoln, MDOC_PROLOGUE }, /* Os */ { blk_full, MDOC_PARSED | MDOC_JOIN }, /* Sh */ { blk_full, MDOC_PARSED | MDOC_JOIN }, /* Ss */ { in_line_eoln, 0 }, /* Pp */ { blk_part_imp, MDOC_PARSED | MDOC_JOIN }, /* D1 */ { blk_part_imp, MDOC_PARSED | MDOC_JOIN }, /* Dl */ { blk_full, MDOC_EXPLICIT }, /* Bd */ { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Ed */ { blk_full, MDOC_EXPLICIT }, /* Bl */ { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* El */ { blk_full, MDOC_PARSED | MDOC_JOIN }, /* It */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ad */ { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* An */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM | MDOC_JOIN }, /* Ap */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ar */ { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Cd */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Cm */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Dv */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Er */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ev */ { in_line_eoln, 0 }, /* Ex */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fa */ { in_line_eoln, 0 }, /* Fd */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fl */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fn */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ft */ { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ic */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* In */ { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Li */ { blk_full, MDOC_JOIN }, /* Nd */ { ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Op */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ot */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */ { in_line_eoln, 0 }, /* Rv */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* St */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Va */ { ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Vt */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Xr */ { in_line_eoln, MDOC_JOIN }, /* %A */ { in_line_eoln, MDOC_JOIN }, /* %B */ { in_line_eoln, MDOC_JOIN }, /* %D */ { in_line_eoln, MDOC_JOIN }, /* %I */ { in_line_eoln, MDOC_JOIN }, /* %J */ { in_line_eoln, 0 }, /* %N */ { in_line_eoln, MDOC_JOIN }, /* %O */ { in_line_eoln, 0 }, /* %P */ { in_line_eoln, MDOC_JOIN }, /* %R */ { in_line_eoln, MDOC_JOIN }, /* %T */ { in_line_eoln, 0 }, /* %V */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Ac */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Ao */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Aq */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* At */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Bc */ { blk_full, MDOC_EXPLICIT }, /* Bf */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Bo */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Bq */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Bsx */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Bx */ { in_line_eoln, 0 }, /* Db */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Dc */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Do */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Dq */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Ec */ { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Ef */ { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Em */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Eo */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Fx */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ms */ { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* No */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM | MDOC_JOIN }, /* Ns */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Nx */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ox */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Pc */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* Pf */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Po */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Pq */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Qc */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ql */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Qo */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Qq */ { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Re */ { blk_full, MDOC_EXPLICIT }, /* Rs */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Sc */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* So */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Sq */ { in_line_argn, 0 }, /* Sm */ { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Sx */ { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Sy */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Tn */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ux */ { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Xc */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Xo */ { blk_full, MDOC_EXPLICIT | MDOC_CALLABLE }, /* Fo */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Fc */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Oo */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Oc */ { blk_full, MDOC_EXPLICIT }, /* Bk */ { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Ek */ { in_line_eoln, 0 }, /* Bt */ { in_line_eoln, 0 }, /* Hf */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fr */ { in_line_eoln, 0 }, /* Ud */ { in_line, 0 }, /* Lb */ { in_line_eoln, 0 }, /* Lp */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Lk */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Mt */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Brq */ { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Bro */ { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT | MDOC_JOIN }, /* Brc */ { in_line_eoln, MDOC_JOIN }, /* %C */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Es */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* En */ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Dx */ { in_line_eoln, MDOC_JOIN }, /* %Q */ { in_line_eoln, 0 }, /* %U */ { phrase_ta, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ta */ { in_line_eoln, 0 }, /* Tg */ }; const struct mdoc_macro * mdoc_macro(enum roff_tok tok) { assert(tok >= MDOC_Dd && tok < MDOC_MAX); return mdoc_macros + (tok - MDOC_Dd); } /* * This is called at the end of parsing. It must traverse up the tree, * closing out open [implicit] scopes. Obviously, open explicit scopes * are errors. */ void mdoc_endparse(struct roff_man *mdoc) { struct roff_node *n; /* Scan for open explicit scopes. */ n = mdoc->last->flags & NODE_VALID ? mdoc->last->parent : mdoc->last; for ( ; n; n = n->parent) if (n->type == ROFFT_BLOCK && mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) mandoc_msg(MANDOCERR_BLK_NOEND, n->line, n->pos, "%s", roff_name[n->tok]); /* Rewind to the first. */ rew_last(mdoc, mdoc->meta.first); } /* * Look up the macro at *p called by "from", * or as a line macro if from == TOKEN_NONE. */ static int lookup(struct roff_man *mdoc, int from, int line, int ppos, const char *p) { enum roff_tok res; if (mdoc->flags & MDOC_PHRASEQF) { mdoc->flags &= ~MDOC_PHRASEQF; return TOKEN_NONE; } if (from == TOKEN_NONE || mdoc_macro(from)->flags & MDOC_PARSED) { res = roffhash_find(mdoc->mdocmac, p, 0); if (res != TOKEN_NONE) { if (mdoc_macro(res)->flags & MDOC_CALLABLE) return res; mandoc_msg(MANDOCERR_MACRO_CALL, line, ppos, "%s", p); } } return TOKEN_NONE; } /* * Rewind up to and including a specific node. */ static void rew_last(struct roff_man *mdoc, const struct roff_node *to) { if (to->flags & NODE_VALID) return; while (mdoc->last != to) { mdoc_state(mdoc, mdoc->last); mdoc->last->flags |= NODE_VALID | NODE_ENDED; mdoc->last = mdoc->last->parent; } mdoc_state(mdoc, mdoc->last); mdoc->last->flags |= NODE_VALID | NODE_ENDED; mdoc->next = ROFF_NEXT_SIBLING; } /* * Rewind up to a specific block, including all blocks that broke it. */ static void rew_pending(struct roff_man *mdoc, const struct roff_node *n) { for (;;) { rew_last(mdoc, n); if (mdoc->last == n) { switch (n->type) { case ROFFT_HEAD: roff_body_alloc(mdoc, n->line, n->pos, n->tok); if (n->tok == MDOC_Ss) mdoc->flags &= ~ROFF_NONOFILL; break; case ROFFT_BLOCK: break; default: return; } if ( ! (n->flags & NODE_BROKEN)) return; } else n = mdoc->last; for (;;) { if ((n = n->parent) == NULL) return; if (n->type == ROFFT_BLOCK || n->type == ROFFT_HEAD) { if (n->flags & NODE_ENDED) break; else return; } } } } /* * For a block closing macro, return the corresponding opening one. * Otherwise, return the macro itself. */ static enum roff_tok rew_alt(enum roff_tok tok) { switch (tok) { case MDOC_Ac: return MDOC_Ao; case MDOC_Bc: return MDOC_Bo; case MDOC_Brc: return MDOC_Bro; case MDOC_Dc: return MDOC_Do; case MDOC_Ec: return MDOC_Eo; case MDOC_Ed: return MDOC_Bd; case MDOC_Ef: return MDOC_Bf; case MDOC_Ek: return MDOC_Bk; case MDOC_El: return MDOC_Bl; case MDOC_Fc: return MDOC_Fo; case MDOC_Oc: return MDOC_Oo; case MDOC_Pc: return MDOC_Po; case MDOC_Qc: return MDOC_Qo; case MDOC_Re: return MDOC_Rs; case MDOC_Sc: return MDOC_So; case MDOC_Xc: return MDOC_Xo; default: return tok; } } static void rew_elem(struct roff_man *mdoc, enum roff_tok tok) { struct roff_node *n; n = mdoc->last; if (n->type != ROFFT_ELEM) n = n->parent; assert(n->type == ROFFT_ELEM); assert(tok == n->tok); rew_last(mdoc, n); } static void break_intermediate(struct roff_node *n, struct roff_node *breaker) { if (n != breaker && n->type != ROFFT_BLOCK && n->type != ROFFT_HEAD && (n->type != ROFFT_BODY || n->end != ENDBODY_NOT)) n = n->parent; while (n != breaker) { if ( ! (n->flags & NODE_VALID)) n->flags |= NODE_BROKEN; n = n->parent; } } /* * If there is an open sub-block of the target requiring * explicit close-out, postpone closing out the target until * the rew_pending() call closing out the sub-block. */ static int find_pending(struct roff_man *mdoc, enum roff_tok tok, int line, int ppos, struct roff_node *target) { struct roff_node *n; int irc; if (target->flags & NODE_VALID) return 0; irc = 0; for (n = mdoc->last; n != NULL && n != target; n = n->parent) { if (n->flags & NODE_ENDED) continue; if (n->type == ROFFT_BLOCK && mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) { irc = 1; break_intermediate(mdoc->last, target); if (target->type == ROFFT_HEAD) target->flags |= NODE_ENDED; else if ( ! (target->flags & NODE_ENDED)) { mandoc_msg(MANDOCERR_BLK_NEST, line, ppos, "%s breaks %s", roff_name[tok], roff_name[n->tok]); mdoc_endbody_alloc(mdoc, line, ppos, tok, target); } } } return irc; } /* * Allocate a word and check whether it's punctuation or not. * Punctuation consists of those tokens found in mdoc_isdelim(). */ static void dword(struct roff_man *mdoc, int line, int col, const char *p, enum mdelim d, int may_append) { if (d == DELIM_MAX) d = mdoc_isdelim(p); if (may_append && ! (mdoc->flags & (MDOC_SYNOPSIS | MDOC_KEEP | MDOC_SMOFF)) && d == DELIM_NONE && mdoc->last->type == ROFFT_TEXT && mdoc_isdelim(mdoc->last->string) == DELIM_NONE) { roff_word_append(mdoc, p); return; } roff_word_alloc(mdoc, line, col, p); /* * If the word consists of a bare delimiter, * flag the new node accordingly, * unless doing so was vetoed by the invoking macro. * Always clear the veto, it is only valid for one word. */ if (d == DELIM_OPEN) mdoc->last->flags |= NODE_DELIMO; else if (d == DELIM_CLOSE && ! (mdoc->flags & MDOC_NODELIMC) && mdoc->last->parent->tok != MDOC_Fd) mdoc->last->flags |= NODE_DELIMC; mdoc->flags &= ~MDOC_NODELIMC; } static void append_delims(struct roff_man *mdoc, int line, int *pos, char *buf) { char *p; int la; enum margserr ac; if (buf[*pos] == '\0') return; for (;;) { la = *pos; ac = mdoc_args(mdoc, line, pos, buf, TOKEN_NONE, &p); if (ac == ARGS_EOLN) break; dword(mdoc, line, la, p, DELIM_MAX, 1); /* * If we encounter end-of-sentence symbols, then trigger * the double-space. * * XXX: it's easy to allow this to propagate outward to * the last symbol, such that `. )' will cause the * correct double-spacing. However, (1) groff isn't * smart enough to do this and (2) it would require * knowing which symbols break this behaviour, for * example, `. ;' shouldn't propagate the double-space. */ if (mandoc_eos(p, strlen(p))) mdoc->last->flags |= NODE_EOS; if (ac == ARGS_ALLOC) free(p); } } /* * Parse one word. * If it is a macro, call it and return 1. * Otherwise, allocate it and return 0. */ static int macro_or_word(MACRO_PROT_ARGS, char *p, int parsed) { int ntok; ntok = buf[ppos] == '"' || parsed == 0 || mdoc->flags & MDOC_PHRASELIT ? TOKEN_NONE : lookup(mdoc, tok, line, ppos, p); if (ntok == TOKEN_NONE) { dword(mdoc, line, ppos, p, DELIM_MAX, tok == TOKEN_NONE || mdoc_macro(tok)->flags & MDOC_JOIN); return 0; } else { if (tok != TOKEN_NONE && mdoc_macro(tok)->fp == in_line_eoln) rew_elem(mdoc, tok); (*mdoc_macro(ntok)->fp)(mdoc, ntok, line, ppos, pos, buf); if (tok == TOKEN_NONE) append_delims(mdoc, line, pos, buf); return 1; } } /* * Close out block partial/full explicit. */ static void blk_exp_close(MACRO_PROT_ARGS) { struct roff_node *body; /* Our own body. */ struct roff_node *endbody; /* Our own end marker. */ struct roff_node *itblk; /* An It block starting later. */ struct roff_node *later; /* A sub-block starting later. */ struct roff_node *n; /* Search back to our block. */ struct roff_node *target; /* For find_pending(). */ int j, lastarg, maxargs, nl, pending; enum margserr ac; enum roff_tok atok, ntok; char *p; nl = MDOC_NEWLINE & mdoc->flags; switch (tok) { case MDOC_Ec: maxargs = 1; break; case MDOC_Ek: mdoc->flags &= ~MDOC_KEEP; /* FALLTHROUGH */ default: maxargs = 0; break; } /* Search backwards for the beginning of our own body. */ atok = rew_alt(tok); body = NULL; for (n = mdoc->last; n; n = n->parent) { if (n->flags & NODE_ENDED || n->tok != atok || n->type != ROFFT_BODY || n->end != ENDBODY_NOT) continue; body = n; break; } /* * Search backwards for beginnings of blocks, * both of our own and of pending sub-blocks. */ endbody = itblk = later = NULL; for (n = mdoc->last; n; n = n->parent) { if (n->flags & NODE_ENDED) continue; /* * Mismatching end macros can never break anything * and we only care about the breaking of BLOCKs. */ if (body == NULL || n->type != ROFFT_BLOCK) continue; /* * SYNOPSIS name blocks can not be broken themselves, * but they do get broken together with a broken child. */ if (n->tok == MDOC_Nm) { if (later != NULL) n->flags |= NODE_BROKEN | NODE_ENDED; continue; } if (n->tok == MDOC_It) { itblk = n; continue; } if (atok == n->tok) { /* * Found the start of our own block. * When there is no pending sub block, * just proceed to closing out. */ if (later == NULL || (tok == MDOC_El && itblk == NULL)) break; /* * When there is a pending sub block, postpone * closing out the current block until the * rew_pending() closing out the sub-block. * Mark the place where the formatting - but not * the scope - of the current block ends. */ mandoc_msg(MANDOCERR_BLK_NEST, line, ppos, "%s breaks %s", roff_name[atok], roff_name[later->tok]); endbody = mdoc_endbody_alloc(mdoc, line, ppos, atok, body); if (tok == MDOC_El) itblk->flags |= NODE_ENDED | NODE_BROKEN; /* * If a block closing macro taking arguments * breaks another block, put the arguments * into the end marker. */ if (maxargs) mdoc->next = ROFF_NEXT_CHILD; break; } /* * Explicit blocks close out description lines, but * even those can get broken together with a child. */ if (n->tok == MDOC_Nd) { if (later != NULL) n->flags |= NODE_BROKEN | NODE_ENDED; else rew_last(mdoc, n); continue; } /* Breaking an open sub block. */ break_intermediate(mdoc->last, body); n->flags |= NODE_BROKEN; if (later == NULL) later = n; } if (body == NULL) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, line, ppos, "%s", roff_name[tok]); if (maxargs && endbody == NULL) { /* * Stray .Ec without previous .Eo: * Break the output line, keep the arguments. */ roff_elem_alloc(mdoc, line, ppos, ROFF_br); rew_elem(mdoc, ROFF_br); } } else if (endbody == NULL) { rew_last(mdoc, body); if (maxargs) mdoc_tail_alloc(mdoc, line, ppos, atok); } if ((mdoc_macro(tok)->flags & MDOC_PARSED) == 0) { if (buf[*pos] != '\0') mandoc_msg(MANDOCERR_ARG_SKIP, line, ppos, "%s %s", roff_name[tok], buf + *pos); if (endbody == NULL && n != NULL) rew_pending(mdoc, n); /* * Restore the fill mode that was set before the display. * This needs to be done here rather than during validation * such that subsequent nodes get the right flags. */ if (tok == MDOC_Ed && body != NULL) { if (body->flags & NODE_NOFILL) mdoc->flags |= ROFF_NOFILL; else mdoc->flags &= ~ROFF_NOFILL; } return; } if (endbody != NULL) n = endbody; ntok = TOKEN_NONE; for (j = 0; ; j++) { lastarg = *pos; if (j == maxargs && n != NULL) rew_last(mdoc, n); ac = mdoc_args(mdoc, line, pos, buf, tok, &p); if (ac == ARGS_PUNCT || ac == ARGS_EOLN) break; ntok = lookup(mdoc, tok, line, lastarg, p); if (ntok == TOKEN_NONE) { dword(mdoc, line, lastarg, p, DELIM_MAX, mdoc_macro(tok)->flags & MDOC_JOIN); if (ac == ARGS_ALLOC) free(p); continue; } if (ac == ARGS_ALLOC) free(p); if (n != NULL) rew_last(mdoc, n); mdoc->flags &= ~MDOC_NEWLINE; (*mdoc_macro(ntok)->fp)(mdoc, ntok, line, lastarg, pos, buf); break; } if (n != NULL) { pending = 0; if (ntok != TOKEN_NONE && n->flags & NODE_BROKEN) { target = n; do target = target->parent; while ( ! (target->flags & NODE_ENDED)); pending = find_pending(mdoc, ntok, line, ppos, target); } if ( ! pending) rew_pending(mdoc, n); } if (nl) append_delims(mdoc, line, pos, buf); } static void in_line(MACRO_PROT_ARGS) { int la, scope, cnt, firstarg, mayopen, nc, nl; enum roff_tok ntok; enum margserr ac; enum mdelim d; struct mdoc_arg *arg; char *p; nl = MDOC_NEWLINE & mdoc->flags; /* * Whether we allow ignored elements (those without content, * usually because of reserved words) to squeak by. */ switch (tok) { case MDOC_An: case MDOC_Ar: case MDOC_Fl: case MDOC_Mt: case MDOC_Nm: case MDOC_Pa: nc = 1; break; default: nc = 0; break; } mdoc_argv(mdoc, line, tok, &arg, pos, buf); d = DELIM_NONE; firstarg = 1; mayopen = 1; for (cnt = scope = 0;; ) { la = *pos; ac = mdoc_args(mdoc, line, pos, buf, tok, &p); /* * At the end of a macro line, * opening delimiters do not suppress spacing. */ if (ac == ARGS_EOLN) { if (d == DELIM_OPEN) mdoc->last->flags &= ~NODE_DELIMO; break; } /* * The rest of the macro line is only punctuation, * to be handled by append_delims(). * If there were no other arguments, * do not allow the first one to suppress spacing, * even if it turns out to be a closing one. */ if (ac == ARGS_PUNCT) { if (cnt == 0 && (nc == 0 || tok == MDOC_An)) mdoc->flags |= MDOC_NODELIMC; break; } ntok = (tok == MDOC_Fn && !cnt) ? TOKEN_NONE : lookup(mdoc, tok, line, la, p); /* * In this case, we've located a submacro and must * execute it. Close out scope, if open. If no * elements have been generated, either create one (nc) * or raise a warning. */ if (ntok != TOKEN_NONE) { if (scope) rew_elem(mdoc, tok); if (nc && ! cnt) { mdoc_elem_alloc(mdoc, line, ppos, tok, arg); rew_last(mdoc, mdoc->last); } else if ( ! nc && ! cnt) { mdoc_argv_free(arg); mandoc_msg(MANDOCERR_MACRO_EMPTY, line, ppos, "%s", roff_name[tok]); } (*mdoc_macro(ntok)->fp)(mdoc, ntok, line, la, pos, buf); if (nl) append_delims(mdoc, line, pos, buf); if (ac == ARGS_ALLOC) free(p); return; } /* * Handle punctuation. Set up our scope, if a word; * rewind the scope, if a delimiter; then append the word. */ if ((d = mdoc_isdelim(p)) != DELIM_NONE) { /* * If we encounter closing punctuation, no word * has been emitted, no scope is open, and we're * allowed to have an empty element, then start * a new scope. */ if ((d == DELIM_CLOSE || (d == DELIM_MIDDLE && tok == MDOC_Fl)) && !cnt && !scope && nc && mayopen) { mdoc_elem_alloc(mdoc, line, ppos, tok, arg); scope = 1; cnt++; if (tok == MDOC_Nm) mayopen = 0; } /* * Close out our scope, if one is open, before * any punctuation. */ if (scope && tok != MDOC_Lk) { rew_elem(mdoc, tok); scope = 0; if (tok == MDOC_Fn) mayopen = 0; } } else if (mayopen && !scope) { mdoc_elem_alloc(mdoc, line, ppos, tok, arg); scope = 1; cnt++; } dword(mdoc, line, la, p, d, mdoc_macro(tok)->flags & MDOC_JOIN); if (ac == ARGS_ALLOC) free(p); /* * If the first argument is a closing delimiter, * do not suppress spacing before it. */ if (firstarg && d == DELIM_CLOSE && !nc) mdoc->last->flags &= ~NODE_DELIMC; firstarg = 0; /* * `Fl' macros have their scope re-opened with each new * word so that the `-' can be added to each one without * having to parse out spaces. */ if (scope && tok == MDOC_Fl) { rew_elem(mdoc, tok); scope = 0; } } if (scope && tok != MDOC_Lk) { rew_elem(mdoc, tok); scope = 0; } /* * If no elements have been collected and we're allowed to have * empties (nc), open a scope and close it out. Otherwise, * raise a warning. */ if ( ! cnt) { if (nc) { mdoc_elem_alloc(mdoc, line, ppos, tok, arg); rew_last(mdoc, mdoc->last); } else { mdoc_argv_free(arg); mandoc_msg(MANDOCERR_MACRO_EMPTY, line, ppos, "%s", roff_name[tok]); } } if (nl) append_delims(mdoc, line, pos, buf); if (scope) rew_elem(mdoc, tok); } static void blk_full(MACRO_PROT_ARGS) { struct mdoc_arg *arg; struct roff_node *blk; /* Our own or a broken block. */ struct roff_node *head; /* Our own head. */ struct roff_node *body; /* Our own body. */ struct roff_node *n; char *p; size_t iarg; int done, la, nl, parsed; enum margserr ac, lac; nl = MDOC_NEWLINE & mdoc->flags; if (buf[*pos] == '\0' && (tok == MDOC_Sh || tok == MDOC_Ss)) { mandoc_msg(MANDOCERR_MACRO_EMPTY, line, ppos, "%s", roff_name[tok]); return; } if ((mdoc_macro(tok)->flags & MDOC_EXPLICIT) == 0) { /* Here, tok is one of Sh Ss Nm Nd It. */ blk = NULL; for (n = mdoc->last; n != NULL; n = n->parent) { if (n->flags & NODE_ENDED) { if ( ! (n->flags & NODE_VALID)) n->flags |= NODE_BROKEN; continue; } if (n->type != ROFFT_BLOCK) continue; if (tok == MDOC_It && n->tok == MDOC_Bl) { if (blk != NULL) { mandoc_msg(MANDOCERR_BLK_BROKEN, line, ppos, "It breaks %s", roff_name[blk->tok]); rew_pending(mdoc, blk); } break; } if (mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) { switch (tok) { case MDOC_Sh: case MDOC_Ss: mandoc_msg(MANDOCERR_BLK_BROKEN, line, ppos, "%s breaks %s", roff_name[tok], roff_name[n->tok]); rew_pending(mdoc, n); n = mdoc->last; continue; case MDOC_It: /* Delay in case it's astray. */ blk = n; continue; default: break; } break; } /* Here, n is one of Sh Ss Nm Nd It. */ if (tok != MDOC_Sh && (n->tok == MDOC_Sh || (tok != MDOC_Ss && (n->tok == MDOC_Ss || (tok != MDOC_It && n->tok == MDOC_It))))) break; /* Item breaking an explicit block. */ if (blk != NULL) { mandoc_msg(MANDOCERR_BLK_BROKEN, line, ppos, "It breaks %s", roff_name[blk->tok]); rew_pending(mdoc, blk); blk = NULL; } /* Close out prior implicit scopes. */ rew_pending(mdoc, n); } /* Skip items outside lists. */ if (tok == MDOC_It && (n == NULL || n->tok != MDOC_Bl)) { mandoc_msg(MANDOCERR_IT_STRAY, line, ppos, "It %s", buf + *pos); roff_elem_alloc(mdoc, line, ppos, ROFF_br); rew_elem(mdoc, ROFF_br); return; } } /* * This routine accommodates implicitly- and explicitly-scoped * macro openings. Implicit ones first close out prior scope * (seen above). Delay opening the head until necessary to * allow leading punctuation to print. Special consideration * for `It -column', which has phrase-part syntax instead of * regular child nodes. */ switch (tok) { case MDOC_Sh: mdoc->flags &= ~ROFF_NOFILL; break; case MDOC_Ss: mdoc->flags |= ROFF_NONOFILL; break; default: break; } mdoc_argv(mdoc, line, tok, &arg, pos, buf); blk = mdoc_block_alloc(mdoc, line, ppos, tok, arg); head = body = NULL; /* * Exception: Heads of `It' macros in `-diag' lists are not * parsed, even though `It' macros in general are parsed. */ parsed = tok != MDOC_It || mdoc->last->parent->tok != MDOC_Bl || mdoc->last->parent->norm->Bl.type != LIST_diag; /* * The `Nd' macro has all arguments in its body: it's a hybrid * of block partial-explicit and full-implicit. Stupid. */ if (tok == MDOC_Nd) { head = roff_head_alloc(mdoc, line, ppos, tok); rew_last(mdoc, head); body = roff_body_alloc(mdoc, line, ppos, tok); } if (tok == MDOC_Bk) mdoc->flags |= MDOC_KEEP; ac = ARGS_EOLN; for (;;) { /* * If we are right after a tab character, * do not parse the first word for macros. */ if (mdoc->flags & MDOC_PHRASEQN) { mdoc->flags &= ~MDOC_PHRASEQN; mdoc->flags |= MDOC_PHRASEQF; } la = *pos; lac = ac; ac = mdoc_args(mdoc, line, pos, buf, tok, &p); if (ac == ARGS_EOLN) { if (lac != ARGS_PHRASE || ! (mdoc->flags & MDOC_PHRASEQF)) break; /* * This line ends in a tab; start the next * column now, with a leading blank. */ if (body != NULL) rew_last(mdoc, body); body = roff_body_alloc(mdoc, line, ppos, tok); roff_word_alloc(mdoc, line, ppos, "\\&"); break; } if (tok == MDOC_Bd || tok == MDOC_Bk) { mandoc_msg(MANDOCERR_ARG_EXCESS, line, la, "%s ... %s", roff_name[tok], buf + la); if (ac == ARGS_ALLOC) free(p); break; } if (tok == MDOC_Rs) { mandoc_msg(MANDOCERR_ARG_SKIP, line, la, "Rs %s", buf + la); if (ac == ARGS_ALLOC) free(p); break; } if (ac == ARGS_PUNCT) break; /* * Emit leading punctuation (i.e., punctuation before * the ROFFT_HEAD) for non-phrase types. */ if (head == NULL && ac != ARGS_PHRASE && mdoc_isdelim(p) == DELIM_OPEN) { dword(mdoc, line, la, p, DELIM_OPEN, 0); if (ac == ARGS_ALLOC) free(p); continue; } /* Open a head if one hasn't been opened. */ if (head == NULL) head = roff_head_alloc(mdoc, line, ppos, tok); if (ac == ARGS_PHRASE) { /* * If we haven't opened a body yet, rewind the * head; if we have, rewind that instead. */ rew_last(mdoc, body == NULL ? head : body); body = roff_body_alloc(mdoc, line, ppos, tok); /* Process to the tab or to the end of the line. */ mdoc->flags |= MDOC_PHRASE; parse_rest(mdoc, TOKEN_NONE, line, &la, buf); mdoc->flags &= ~MDOC_PHRASE; /* There may have been `Ta' macros. */ while (body->next != NULL) body = body->next; continue; } done = macro_or_word(mdoc, tok, line, la, pos, buf, p, parsed); if (ac == ARGS_ALLOC) free(p); if (done) break; } if (blk->flags & NODE_VALID) return; if (head == NULL) head = roff_head_alloc(mdoc, line, ppos, tok); if (nl && tok != MDOC_Bd && tok != MDOC_Bl && tok != MDOC_Rs) append_delims(mdoc, line, pos, buf); if (body != NULL) goto out; if (find_pending(mdoc, tok, line, ppos, head)) return; /* Close out scopes to remain in a consistent state. */ rew_last(mdoc, head); body = roff_body_alloc(mdoc, line, ppos, tok); if (tok == MDOC_Ss) mdoc->flags &= ~ROFF_NONOFILL; /* * Set up fill mode for display blocks. * This needs to be done here up front rather than during * validation such that child nodes get the right flags. */ if (tok == MDOC_Bd && arg != NULL) { for (iarg = 0; iarg < arg->argc; iarg++) { switch (arg->argv[iarg].arg) { case MDOC_Unfilled: case MDOC_Literal: mdoc->flags |= ROFF_NOFILL; break; case MDOC_Filled: case MDOC_Ragged: case MDOC_Centred: mdoc->flags &= ~ROFF_NOFILL; break; default: continue; } break; } } out: if (mdoc->flags & MDOC_FREECOL) { rew_last(mdoc, body); rew_last(mdoc, blk); mdoc->flags &= ~MDOC_FREECOL; } } static void blk_part_imp(MACRO_PROT_ARGS) { int done, la, nl; enum margserr ac; char *p; struct roff_node *blk; /* saved block context */ struct roff_node *body; /* saved body context */ struct roff_node *n; nl = MDOC_NEWLINE & mdoc->flags; /* * A macro that spans to the end of the line. This is generally * (but not necessarily) called as the first macro. The block * has a head as the immediate child, which is always empty, * followed by zero or more opening punctuation nodes, then the * body (which may be empty, depending on the macro), then zero * or more closing punctuation nodes. */ blk = mdoc_block_alloc(mdoc, line, ppos, tok, NULL); rew_last(mdoc, roff_head_alloc(mdoc, line, ppos, tok)); /* * Open the body scope "on-demand", that is, after we've * processed all our the leading delimiters (open parenthesis, * etc.). */ for (body = NULL; ; ) { la = *pos; ac = mdoc_args(mdoc, line, pos, buf, tok, &p); if (ac == ARGS_EOLN || ac == ARGS_PUNCT) break; if (body == NULL && mdoc_isdelim(p) == DELIM_OPEN) { dword(mdoc, line, la, p, DELIM_OPEN, 0); if (ac == ARGS_ALLOC) free(p); continue; } if (body == NULL) body = roff_body_alloc(mdoc, line, ppos, tok); done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); if (ac == ARGS_ALLOC) free(p); if (done) break; } if (body == NULL) body = roff_body_alloc(mdoc, line, ppos, tok); if (find_pending(mdoc, tok, line, ppos, body)) return; rew_last(mdoc, body); if (nl) append_delims(mdoc, line, pos, buf); rew_pending(mdoc, blk); /* Move trailing .Ns out of scope. */ for (n = body->child; n && n->next; n = n->next) /* Do nothing. */ ; if (n && n->tok == MDOC_Ns) roff_node_relink(mdoc, n); } static void blk_part_exp(MACRO_PROT_ARGS) { int done, la, nl; enum margserr ac; struct roff_node *head; /* keep track of head */ char *p; nl = MDOC_NEWLINE & mdoc->flags; /* * The opening of an explicit macro having zero or more leading * punctuation nodes; a head with optional single element (the * case of `Eo'); and a body that may be empty. */ roff_block_alloc(mdoc, line, ppos, tok); head = NULL; for (;;) { la = *pos; ac = mdoc_args(mdoc, line, pos, buf, tok, &p); if (ac == ARGS_PUNCT || ac == ARGS_EOLN) break; /* Flush out leading punctuation. */ if (head == NULL && mdoc_isdelim(p) == DELIM_OPEN) { dword(mdoc, line, la, p, DELIM_OPEN, 0); if (ac == ARGS_ALLOC) free(p); continue; } if (head == NULL) { head = roff_head_alloc(mdoc, line, ppos, tok); if (tok == MDOC_Eo) /* Not parsed. */ dword(mdoc, line, la, p, DELIM_MAX, 0); rew_last(mdoc, head); roff_body_alloc(mdoc, line, ppos, tok); if (tok == MDOC_Eo) { if (ac == ARGS_ALLOC) free(p); continue; } } done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); if (ac == ARGS_ALLOC) free(p); if (done) break; } /* Clean-up to leave in a consistent state. */ if (head == NULL) { rew_last(mdoc, roff_head_alloc(mdoc, line, ppos, tok)); roff_body_alloc(mdoc, line, ppos, tok); } if (nl) append_delims(mdoc, line, pos, buf); } static void in_line_argn(MACRO_PROT_ARGS) { struct mdoc_arg *arg; char *p; enum margserr ac; enum roff_tok ntok; int state; /* arg#; -1: not yet open; -2: closed */ int la, maxargs, nl; nl = mdoc->flags & MDOC_NEWLINE; /* * A line macro that has a fixed number of arguments (maxargs). * Only open the scope once the first non-leading-punctuation is * found (unless MDOC_IGNDELIM is noted, like in `Pf'), then * keep it open until the maximum number of arguments are * exhausted. */ switch (tok) { case MDOC_Ap: case MDOC_Ns: case MDOC_Ux: maxargs = 0; break; case MDOC_Bx: case MDOC_Es: case MDOC_Xr: maxargs = 2; break; default: maxargs = 1; break; } mdoc_argv(mdoc, line, tok, &arg, pos, buf); state = -1; p = NULL; for (;;) { la = *pos; ac = mdoc_args(mdoc, line, pos, buf, tok, &p); if ((ac == ARGS_WORD || ac == ARGS_ALLOC) && state == -1 && (mdoc_macro(tok)->flags & MDOC_IGNDELIM) == 0 && mdoc_isdelim(p) == DELIM_OPEN) { dword(mdoc, line, la, p, DELIM_OPEN, 0); if (ac == ARGS_ALLOC) free(p); continue; } if (state == -1 && tok != MDOC_In && tok != MDOC_St && tok != MDOC_Xr) { mdoc_elem_alloc(mdoc, line, ppos, tok, arg); state = 0; } if (ac == ARGS_PUNCT || ac == ARGS_EOLN) { if (abs(state) < 2 && tok == MDOC_Pf) mandoc_msg(MANDOCERR_PF_SKIP, line, ppos, "Pf %s", p == NULL ? "at eol" : p); break; } if (state == maxargs) { rew_elem(mdoc, tok); state = -2; } ntok = (tok == MDOC_Pf && state == 0) ? TOKEN_NONE : lookup(mdoc, tok, line, la, p); if (ntok != TOKEN_NONE) { if (state >= 0) { rew_elem(mdoc, tok); state = -2; } (*mdoc_macro(ntok)->fp)(mdoc, ntok, line, la, pos, buf); if (ac == ARGS_ALLOC) free(p); break; } if (mdoc_macro(tok)->flags & MDOC_IGNDELIM || mdoc_isdelim(p) == DELIM_NONE) { if (state == -1) { mdoc_elem_alloc(mdoc, line, ppos, tok, arg); state = 1; } else if (state >= 0) state++; } else if (state >= 0) { rew_elem(mdoc, tok); state = -2; } dword(mdoc, line, la, p, DELIM_MAX, mdoc_macro(tok)->flags & MDOC_JOIN); if (ac == ARGS_ALLOC) free(p); p = mdoc->last->string; } if (state == -1) { mandoc_msg(MANDOCERR_MACRO_EMPTY, line, ppos, "%s", roff_name[tok]); return; } if (state == 0 && tok == MDOC_Pf) append_delims(mdoc, line, pos, buf); if (state >= 0) rew_elem(mdoc, tok); if (nl) append_delims(mdoc, line, pos, buf); } static void in_line_eoln(MACRO_PROT_ARGS) { struct roff_node *n; struct mdoc_arg *arg; if ((tok == MDOC_Pp || tok == MDOC_Lp) && ! (mdoc->flags & MDOC_SYNOPSIS)) { n = mdoc->last; if (mdoc->next == ROFF_NEXT_SIBLING) n = n->parent; if (n->tok == MDOC_Nm) rew_last(mdoc, n->parent); } if (buf[*pos] == '\0' && (tok == MDOC_Fd || *roff_name[tok] == '%')) { mandoc_msg(MANDOCERR_MACRO_EMPTY, line, ppos, "%s", roff_name[tok]); return; } mdoc_argv(mdoc, line, tok, &arg, pos, buf); mdoc_elem_alloc(mdoc, line, ppos, tok, arg); if (parse_rest(mdoc, tok, line, pos, buf)) return; rew_elem(mdoc, tok); } /* * The simplest argument parser available: Parse the remaining * words until the end of the phrase or line and return 0 * or until the next macro, call that macro, and return 1. */ static int parse_rest(struct roff_man *mdoc, enum roff_tok tok, int line, int *pos, char *buf) { char *p; int done, la; enum margserr ac; for (;;) { la = *pos; ac = mdoc_args(mdoc, line, pos, buf, tok, &p); if (ac == ARGS_EOLN) return 0; done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); if (ac == ARGS_ALLOC) free(p); if (done) return 1; } } static void ctx_synopsis(MACRO_PROT_ARGS) { if (~mdoc->flags & (MDOC_SYNOPSIS | MDOC_NEWLINE)) in_line(mdoc, tok, line, ppos, pos, buf); else if (tok == MDOC_Nm) blk_full(mdoc, tok, line, ppos, pos, buf); else { assert(tok == MDOC_Vt); blk_part_imp(mdoc, tok, line, ppos, pos, buf); } } /* * Phrases occur within `Bl -column' entries, separated by `Ta' or tabs. * They're unusual because they're basically free-form text until a * macro is encountered. */ static void phrase_ta(MACRO_PROT_ARGS) { struct roff_node *body, *n; /* Make sure we are in a column list or ignore this macro. */ body = NULL; for (n = mdoc->last; n != NULL; n = n->parent) { if (n->flags & NODE_ENDED) continue; if (n->tok == MDOC_It && n->type == ROFFT_BODY) body = n; if (n->tok == MDOC_Bl && n->end == ENDBODY_NOT) break; } if (n == NULL || n->norm->Bl.type != LIST_column) { mandoc_msg(MANDOCERR_TA_STRAY, line, ppos, "Ta"); return; } /* Advance to the next column. */ rew_last(mdoc, body); roff_body_alloc(mdoc, line, ppos, MDOC_It); parse_rest(mdoc, TOKEN_NONE, line, pos, buf); } mandoc-1.14.6/mdoc_man.c010064400017530001753000001137041412314055300152760ustar00schwarzeschwarze/* $Id: mdoc_man.c,v 1.137 2021/07/04 15:38:26 schwarze Exp $ */ /* * Copyright (c) 2011-2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "man.h" #include "out.h" #include "main.h" #define DECL_ARGS const struct roff_meta *meta, struct roff_node *n typedef int (*int_fp)(DECL_ARGS); typedef void (*void_fp)(DECL_ARGS); struct mdoc_man_act { int_fp cond; /* DON'T run actions */ int_fp pre; /* pre-node action */ void_fp post; /* post-node action */ const char *prefix; /* pre-node string constant */ const char *suffix; /* post-node string constant */ }; static int cond_body(DECL_ARGS); static int cond_head(DECL_ARGS); static void font_push(char); static void font_pop(void); static int man_strlen(const char *); static void mid_it(void); static void post__t(DECL_ARGS); static void post_aq(DECL_ARGS); static void post_bd(DECL_ARGS); static void post_bf(DECL_ARGS); static void post_bk(DECL_ARGS); static void post_bl(DECL_ARGS); static void post_dl(DECL_ARGS); static void post_en(DECL_ARGS); static void post_enc(DECL_ARGS); static void post_eo(DECL_ARGS); static void post_fa(DECL_ARGS); static void post_fd(DECL_ARGS); static void post_fl(DECL_ARGS); static void post_fn(DECL_ARGS); static void post_fo(DECL_ARGS); static void post_font(DECL_ARGS); static void post_in(DECL_ARGS); static void post_it(DECL_ARGS); static void post_lb(DECL_ARGS); static void post_nm(DECL_ARGS); static void post_percent(DECL_ARGS); static void post_pf(DECL_ARGS); static void post_sect(DECL_ARGS); static void post_vt(DECL_ARGS); static int pre__t(DECL_ARGS); static int pre_abort(DECL_ARGS); static int pre_an(DECL_ARGS); static int pre_ap(DECL_ARGS); static int pre_aq(DECL_ARGS); static int pre_bd(DECL_ARGS); static int pre_bf(DECL_ARGS); static int pre_bk(DECL_ARGS); static int pre_bl(DECL_ARGS); static void pre_br(DECL_ARGS); static int pre_dl(DECL_ARGS); static int pre_en(DECL_ARGS); static int pre_enc(DECL_ARGS); static int pre_em(DECL_ARGS); static int pre_skip(DECL_ARGS); static int pre_eo(DECL_ARGS); static int pre_ex(DECL_ARGS); static int pre_fa(DECL_ARGS); static int pre_fd(DECL_ARGS); static int pre_fl(DECL_ARGS); static int pre_fn(DECL_ARGS); static int pre_fo(DECL_ARGS); static void pre_ft(DECL_ARGS); static int pre_Ft(DECL_ARGS); static int pre_in(DECL_ARGS); static int pre_it(DECL_ARGS); static int pre_lk(DECL_ARGS); static int pre_li(DECL_ARGS); static int pre_nm(DECL_ARGS); static int pre_no(DECL_ARGS); static void pre_noarg(DECL_ARGS); static int pre_ns(DECL_ARGS); static void pre_onearg(DECL_ARGS); static int pre_pp(DECL_ARGS); static int pre_rs(DECL_ARGS); static int pre_sm(DECL_ARGS); static void pre_sp(DECL_ARGS); static int pre_sect(DECL_ARGS); static int pre_sy(DECL_ARGS); static void pre_syn(struct roff_node *); static void pre_ta(DECL_ARGS); static int pre_vt(DECL_ARGS); static int pre_xr(DECL_ARGS); static void print_word(const char *); static void print_line(const char *, int); static void print_block(const char *, int); static void print_offs(const char *, int); static void print_width(const struct mdoc_bl *, const struct roff_node *); static void print_count(int *); static void print_node(DECL_ARGS); static const void_fp roff_man_acts[ROFF_MAX] = { pre_br, /* br */ pre_onearg, /* ce */ pre_noarg, /* fi */ pre_ft, /* ft */ pre_onearg, /* ll */ pre_onearg, /* mc */ pre_noarg, /* nf */ pre_onearg, /* po */ pre_onearg, /* rj */ pre_sp, /* sp */ pre_ta, /* ta */ pre_onearg, /* ti */ }; static const struct mdoc_man_act mdoc_man_acts[MDOC_MAX - MDOC_Dd] = { { NULL, NULL, NULL, NULL, NULL }, /* Dd */ { NULL, NULL, NULL, NULL, NULL }, /* Dt */ { NULL, NULL, NULL, NULL, NULL }, /* Os */ { NULL, pre_sect, post_sect, ".SH", NULL }, /* Sh */ { NULL, pre_sect, post_sect, ".SS", NULL }, /* Ss */ { NULL, pre_pp, NULL, NULL, NULL }, /* Pp */ { cond_body, pre_dl, post_dl, NULL, NULL }, /* D1 */ { cond_body, pre_dl, post_dl, NULL, NULL }, /* Dl */ { cond_body, pre_bd, post_bd, NULL, NULL }, /* Bd */ { NULL, NULL, NULL, NULL, NULL }, /* Ed */ { cond_body, pre_bl, post_bl, NULL, NULL }, /* Bl */ { NULL, NULL, NULL, NULL, NULL }, /* El */ { NULL, pre_it, post_it, NULL, NULL }, /* It */ { NULL, pre_em, post_font, NULL, NULL }, /* Ad */ { NULL, pre_an, NULL, NULL, NULL }, /* An */ { NULL, pre_ap, NULL, NULL, NULL }, /* Ap */ { NULL, pre_em, post_font, NULL, NULL }, /* Ar */ { NULL, pre_sy, post_font, NULL, NULL }, /* Cd */ { NULL, pre_sy, post_font, NULL, NULL }, /* Cm */ { NULL, pre_li, post_font, NULL, NULL }, /* Dv */ { NULL, pre_li, post_font, NULL, NULL }, /* Er */ { NULL, pre_li, post_font, NULL, NULL }, /* Ev */ { NULL, pre_ex, NULL, NULL, NULL }, /* Ex */ { NULL, pre_fa, post_fa, NULL, NULL }, /* Fa */ { NULL, pre_fd, post_fd, NULL, NULL }, /* Fd */ { NULL, pre_fl, post_fl, NULL, NULL }, /* Fl */ { NULL, pre_fn, post_fn, NULL, NULL }, /* Fn */ { NULL, pre_Ft, post_font, NULL, NULL }, /* Ft */ { NULL, pre_sy, post_font, NULL, NULL }, /* Ic */ { NULL, pre_in, post_in, NULL, NULL }, /* In */ { NULL, pre_li, post_font, NULL, NULL }, /* Li */ { cond_head, pre_enc, NULL, "\\- ", NULL }, /* Nd */ { NULL, pre_nm, post_nm, NULL, NULL }, /* Nm */ { cond_body, pre_enc, post_enc, "[", "]" }, /* Op */ { NULL, pre_abort, NULL, NULL, NULL }, /* Ot */ { NULL, pre_em, post_font, NULL, NULL }, /* Pa */ { NULL, pre_ex, NULL, NULL, NULL }, /* Rv */ { NULL, NULL, NULL, NULL, NULL }, /* St */ { NULL, pre_em, post_font, NULL, NULL }, /* Va */ { NULL, pre_vt, post_vt, NULL, NULL }, /* Vt */ { NULL, pre_xr, NULL, NULL, NULL }, /* Xr */ { NULL, NULL, post_percent, NULL, NULL }, /* %A */ { NULL, pre_em, post_percent, NULL, NULL }, /* %B */ { NULL, NULL, post_percent, NULL, NULL }, /* %D */ { NULL, pre_em, post_percent, NULL, NULL }, /* %I */ { NULL, pre_em, post_percent, NULL, NULL }, /* %J */ { NULL, NULL, post_percent, NULL, NULL }, /* %N */ { NULL, NULL, post_percent, NULL, NULL }, /* %O */ { NULL, NULL, post_percent, NULL, NULL }, /* %P */ { NULL, NULL, post_percent, NULL, NULL }, /* %R */ { NULL, pre__t, post__t, NULL, NULL }, /* %T */ { NULL, NULL, post_percent, NULL, NULL }, /* %V */ { NULL, NULL, NULL, NULL, NULL }, /* Ac */ { cond_body, pre_aq, post_aq, NULL, NULL }, /* Ao */ { cond_body, pre_aq, post_aq, NULL, NULL }, /* Aq */ { NULL, NULL, NULL, NULL, NULL }, /* At */ { NULL, NULL, NULL, NULL, NULL }, /* Bc */ { NULL, pre_bf, post_bf, NULL, NULL }, /* Bf */ { cond_body, pre_enc, post_enc, "[", "]" }, /* Bo */ { cond_body, pre_enc, post_enc, "[", "]" }, /* Bq */ { NULL, pre_bk, post_bk, NULL, NULL }, /* Bsx */ { NULL, pre_bk, post_bk, NULL, NULL }, /* Bx */ { NULL, pre_skip, NULL, NULL, NULL }, /* Db */ { NULL, NULL, NULL, NULL, NULL }, /* Dc */ { cond_body, pre_enc, post_enc, "\\(lq", "\\(rq" }, /* Do */ { cond_body, pre_enc, post_enc, "\\(lq", "\\(rq" }, /* Dq */ { NULL, NULL, NULL, NULL, NULL }, /* Ec */ { NULL, NULL, NULL, NULL, NULL }, /* Ef */ { NULL, pre_em, post_font, NULL, NULL }, /* Em */ { cond_body, pre_eo, post_eo, NULL, NULL }, /* Eo */ { NULL, pre_bk, post_bk, NULL, NULL }, /* Fx */ { NULL, pre_sy, post_font, NULL, NULL }, /* Ms */ { NULL, pre_no, NULL, NULL, NULL }, /* No */ { NULL, pre_ns, NULL, NULL, NULL }, /* Ns */ { NULL, pre_bk, post_bk, NULL, NULL }, /* Nx */ { NULL, pre_bk, post_bk, NULL, NULL }, /* Ox */ { NULL, NULL, NULL, NULL, NULL }, /* Pc */ { NULL, NULL, post_pf, NULL, NULL }, /* Pf */ { cond_body, pre_enc, post_enc, "(", ")" }, /* Po */ { cond_body, pre_enc, post_enc, "(", ")" }, /* Pq */ { NULL, NULL, NULL, NULL, NULL }, /* Qc */ { cond_body, pre_enc, post_enc, "\\(oq", "\\(cq" }, /* Ql */ { cond_body, pre_enc, post_enc, "\"", "\"" }, /* Qo */ { cond_body, pre_enc, post_enc, "\"", "\"" }, /* Qq */ { NULL, NULL, NULL, NULL, NULL }, /* Re */ { cond_body, pre_rs, NULL, NULL, NULL }, /* Rs */ { NULL, NULL, NULL, NULL, NULL }, /* Sc */ { cond_body, pre_enc, post_enc, "\\(oq", "\\(cq" }, /* So */ { cond_body, pre_enc, post_enc, "\\(oq", "\\(cq" }, /* Sq */ { NULL, pre_sm, NULL, NULL, NULL }, /* Sm */ { NULL, pre_em, post_font, NULL, NULL }, /* Sx */ { NULL, pre_sy, post_font, NULL, NULL }, /* Sy */ { NULL, pre_li, post_font, NULL, NULL }, /* Tn */ { NULL, NULL, NULL, NULL, NULL }, /* Ux */ { NULL, NULL, NULL, NULL, NULL }, /* Xc */ { NULL, NULL, NULL, NULL, NULL }, /* Xo */ { NULL, pre_fo, post_fo, NULL, NULL }, /* Fo */ { NULL, NULL, NULL, NULL, NULL }, /* Fc */ { cond_body, pre_enc, post_enc, "[", "]" }, /* Oo */ { NULL, NULL, NULL, NULL, NULL }, /* Oc */ { NULL, pre_bk, post_bk, NULL, NULL }, /* Bk */ { NULL, NULL, NULL, NULL, NULL }, /* Ek */ { NULL, NULL, NULL, NULL, NULL }, /* Bt */ { NULL, NULL, NULL, NULL, NULL }, /* Hf */ { NULL, pre_em, post_font, NULL, NULL }, /* Fr */ { NULL, NULL, NULL, NULL, NULL }, /* Ud */ { NULL, NULL, post_lb, NULL, NULL }, /* Lb */ { NULL, pre_abort, NULL, NULL, NULL }, /* Lp */ { NULL, pre_lk, NULL, NULL, NULL }, /* Lk */ { NULL, pre_em, post_font, NULL, NULL }, /* Mt */ { cond_body, pre_enc, post_enc, "{", "}" }, /* Brq */ { cond_body, pre_enc, post_enc, "{", "}" }, /* Bro */ { NULL, NULL, NULL, NULL, NULL }, /* Brc */ { NULL, NULL, post_percent, NULL, NULL }, /* %C */ { NULL, pre_skip, NULL, NULL, NULL }, /* Es */ { cond_body, pre_en, post_en, NULL, NULL }, /* En */ { NULL, pre_bk, post_bk, NULL, NULL }, /* Dx */ { NULL, NULL, post_percent, NULL, NULL }, /* %Q */ { NULL, NULL, post_percent, NULL, NULL }, /* %U */ { NULL, NULL, NULL, NULL, NULL }, /* Ta */ { NULL, pre_skip, NULL, NULL, NULL }, /* Tg */ }; static const struct mdoc_man_act *mdoc_man_act(enum roff_tok); static int outflags; #define MMAN_spc (1 << 0) /* blank character before next word */ #define MMAN_spc_force (1 << 1) /* even before trailing punctuation */ #define MMAN_nl (1 << 2) /* break man(7) code line */ #define MMAN_br (1 << 3) /* break output line */ #define MMAN_sp (1 << 4) /* insert a blank output line */ #define MMAN_PP (1 << 5) /* reset indentation etc. */ #define MMAN_Sm (1 << 6) /* horizontal spacing mode */ #define MMAN_Bk (1 << 7) /* word keep mode */ #define MMAN_Bk_susp (1 << 8) /* suspend this (after a macro) */ #define MMAN_An_split (1 << 9) /* author mode is "split" */ #define MMAN_An_nosplit (1 << 10) /* author mode is "nosplit" */ #define MMAN_PD (1 << 11) /* inter-paragraph spacing disabled */ #define MMAN_nbrword (1 << 12) /* do not break the next word */ #define BL_STACK_MAX 32 static int Bl_stack[BL_STACK_MAX]; /* offsets [chars] */ static int Bl_stack_post[BL_STACK_MAX]; /* add final .RE */ static int Bl_stack_len; /* number of nested Bl blocks */ static int TPremain; /* characters before tag is full */ static struct { char *head; char *tail; size_t size; } fontqueue; static const struct mdoc_man_act * mdoc_man_act(enum roff_tok tok) { assert(tok >= MDOC_Dd && tok <= MDOC_MAX); return mdoc_man_acts + (tok - MDOC_Dd); } static int man_strlen(const char *cp) { size_t rsz; int skip, sz; sz = 0; skip = 0; for (;;) { rsz = strcspn(cp, "\\"); if (rsz) { cp += rsz; if (skip) { skip = 0; rsz--; } sz += rsz; } if ('\0' == *cp) break; cp++; switch (mandoc_escape(&cp, NULL, NULL)) { case ESCAPE_ERROR: return sz; case ESCAPE_UNICODE: case ESCAPE_NUMBERED: case ESCAPE_SPECIAL: case ESCAPE_UNDEF: case ESCAPE_OVERSTRIKE: if (skip) skip = 0; else sz++; break; case ESCAPE_SKIPCHAR: skip = 1; break; default: break; } } return sz; } static void font_push(char newfont) { if (fontqueue.head + fontqueue.size <= ++fontqueue.tail) { fontqueue.size += 8; fontqueue.head = mandoc_realloc(fontqueue.head, fontqueue.size); } *fontqueue.tail = newfont; print_word(""); printf("\\f"); putchar(newfont); outflags &= ~MMAN_spc; } static void font_pop(void) { if (fontqueue.tail > fontqueue.head) fontqueue.tail--; outflags &= ~MMAN_spc; print_word(""); printf("\\f"); putchar(*fontqueue.tail); } static void print_word(const char *s) { if ((MMAN_PP | MMAN_sp | MMAN_br | MMAN_nl) & outflags) { /* * If we need a newline, print it now and start afresh. */ if (MMAN_PP & outflags) { if (MMAN_sp & outflags) { if (MMAN_PD & outflags) { printf("\n.PD"); outflags &= ~MMAN_PD; } } else if ( ! (MMAN_PD & outflags)) { printf("\n.PD 0"); outflags |= MMAN_PD; } printf("\n.PP\n"); } else if (MMAN_sp & outflags) printf("\n.sp\n"); else if (MMAN_br & outflags) printf("\n.br\n"); else if (MMAN_nl & outflags) putchar('\n'); outflags &= ~(MMAN_PP|MMAN_sp|MMAN_br|MMAN_nl|MMAN_spc); if (1 == TPremain) printf(".br\n"); TPremain = 0; } else if (MMAN_spc & outflags) { /* * If we need a space, only print it if * (1) it is forced by `No' or * (2) what follows is not terminating punctuation or * (3) what follows is longer than one character. */ if (MMAN_spc_force & outflags || '\0' == s[0] || NULL == strchr(".,:;)]?!", s[0]) || '\0' != s[1]) { if (MMAN_Bk & outflags && ! (MMAN_Bk_susp & outflags)) putchar('\\'); putchar(' '); if (TPremain) TPremain--; } } /* * Reassign needing space if we're not following opening * punctuation. */ if (MMAN_Sm & outflags && ('\0' == s[0] || (('(' != s[0] && '[' != s[0]) || '\0' != s[1]))) outflags |= MMAN_spc; else outflags &= ~MMAN_spc; outflags &= ~(MMAN_spc_force | MMAN_Bk_susp); for ( ; *s; s++) { switch (*s) { case ASCII_NBRSP: printf("\\ "); break; case ASCII_HYPH: putchar('-'); break; case ASCII_BREAK: printf("\\:"); break; case ' ': if (MMAN_nbrword & outflags) { printf("\\ "); break; } /* FALLTHROUGH */ default: putchar((unsigned char)*s); break; } if (TPremain) TPremain--; } outflags &= ~MMAN_nbrword; } static void print_line(const char *s, int newflags) { outflags |= MMAN_nl; print_word(s); outflags |= newflags; } static void print_block(const char *s, int newflags) { outflags &= ~MMAN_PP; if (MMAN_sp & outflags) { outflags &= ~(MMAN_sp | MMAN_br); if (MMAN_PD & outflags) { print_line(".PD", 0); outflags &= ~MMAN_PD; } } else if (! (MMAN_PD & outflags)) print_line(".PD 0", MMAN_PD); outflags |= MMAN_nl; print_word(s); outflags |= MMAN_Bk_susp | newflags; } static void print_offs(const char *v, int keywords) { char buf[24]; struct roffsu su; const char *end; int sz; print_line(".RS", MMAN_Bk_susp); /* Convert v into a number (of characters). */ if (NULL == v || '\0' == *v || (keywords && !strcmp(v, "left"))) sz = 0; else if (keywords && !strcmp(v, "indent")) sz = 6; else if (keywords && !strcmp(v, "indent-two")) sz = 12; else { end = a2roffsu(v, &su, SCALE_EN); if (end == NULL || *end != '\0') sz = man_strlen(v); else if (SCALE_EN == su.unit) sz = su.scale; else { /* * XXX * If we are inside an enclosing list, * there is no easy way to add the two * indentations because they are provided * in terms of different units. */ print_word(v); outflags |= MMAN_nl; return; } } /* * We are inside an enclosing list. * Add the two indentations. */ if (Bl_stack_len) sz += Bl_stack[Bl_stack_len - 1]; (void)snprintf(buf, sizeof(buf), "%dn", sz); print_word(buf); outflags |= MMAN_nl; } /* * Set up the indentation for a list item; used from pre_it(). */ static void print_width(const struct mdoc_bl *bl, const struct roff_node *child) { char buf[24]; struct roffsu su; const char *end; int numeric, remain, sz, chsz; numeric = 1; remain = 0; /* Convert the width into a number (of characters). */ if (bl->width == NULL) sz = (bl->type == LIST_hang) ? 6 : 0; else { end = a2roffsu(bl->width, &su, SCALE_MAX); if (end == NULL || *end != '\0') sz = man_strlen(bl->width); else if (SCALE_EN == su.unit) sz = su.scale; else { sz = 0; numeric = 0; } } /* XXX Rough estimation, might have multiple parts. */ if (bl->type == LIST_enum) chsz = (bl->count > 8) + 1; else if (child != NULL && child->type == ROFFT_TEXT) chsz = man_strlen(child->string); else chsz = 0; /* Maybe we are inside an enclosing list? */ mid_it(); /* * Save our own indentation, * such that child lists can use it. */ Bl_stack[Bl_stack_len++] = sz + 2; /* Set up the current list. */ if (chsz > sz && bl->type != LIST_tag) print_block(".HP", MMAN_spc); else { print_block(".TP", MMAN_spc); remain = sz + 2; } if (numeric) { (void)snprintf(buf, sizeof(buf), "%dn", sz + 2); print_word(buf); } else print_word(bl->width); TPremain = remain; } static void print_count(int *count) { char buf[24]; (void)snprintf(buf, sizeof(buf), "%d.\\&", ++*count); print_word(buf); } void man_mdoc(void *arg, const struct roff_meta *mdoc) { struct roff_node *n; printf(".\\\" Automatically generated from an mdoc input file." " Do not edit.\n"); for (n = mdoc->first->child; n != NULL; n = n->next) { if (n->type != ROFFT_COMMENT) break; printf(".\\\"%s\n", n->string); } printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", mdoc->title, (mdoc->msec == NULL ? "" : mdoc->msec), mdoc->date, mdoc->os, mdoc->vol); /* Disable hyphenation and if nroff, disable justification. */ printf(".nh\n.if n .ad l"); outflags = MMAN_nl | MMAN_Sm; if (0 == fontqueue.size) { fontqueue.size = 8; fontqueue.head = fontqueue.tail = mandoc_malloc(8); *fontqueue.tail = 'R'; } for (; n != NULL; n = n->next) print_node(mdoc, n); putchar('\n'); } static void print_node(DECL_ARGS) { const struct mdoc_man_act *act; struct roff_node *sub; int cond, do_sub; if (n->flags & NODE_NOPRT) return; /* * Break the line if we were parsed subsequent the current node. * This makes the page structure be more consistent. */ if (outflags & MMAN_spc && n->flags & NODE_LINE && !roff_node_transparent(n)) outflags |= MMAN_nl; act = NULL; cond = 0; do_sub = 1; n->flags &= ~NODE_ENDED; switch (n->type) { case ROFFT_EQN: case ROFFT_TBL: mandoc_msg(n->type == ROFFT_EQN ? MANDOCERR_EQN_TMAN : MANDOCERR_TBL_TMAN, n->line, n->pos, NULL); outflags |= MMAN_PP | MMAN_sp | MMAN_nl; print_word("The"); print_line(".B \\-T man", MMAN_nl); print_word("output mode does not support"); print_word(n->type == ROFFT_EQN ? "eqn(7)" : "tbl(7)"); print_word("input."); outflags |= MMAN_PP | MMAN_sp | MMAN_nl; return; case ROFFT_TEXT: /* * Make sure that we don't happen to start with a * control character at the start of a line. */ if (MMAN_nl & outflags && ('.' == *n->string || '\'' == *n->string)) { print_word(""); printf("\\&"); outflags &= ~MMAN_spc; } if (n->flags & NODE_DELIMC) outflags &= ~(MMAN_spc | MMAN_spc_force); else if (outflags & MMAN_Sm) outflags |= MMAN_spc_force; print_word(n->string); if (n->flags & NODE_DELIMO) outflags &= ~(MMAN_spc | MMAN_spc_force); else if (outflags & MMAN_Sm) outflags |= MMAN_spc; break; default: if (n->tok < ROFF_MAX) { (*roff_man_acts[n->tok])(meta, n); return; } act = mdoc_man_act(n->tok); cond = act->cond == NULL || (*act->cond)(meta, n); if (cond && act->pre != NULL && (n->end == ENDBODY_NOT || n->child != NULL)) do_sub = (*act->pre)(meta, n); break; } /* * Conditionally run all child nodes. * Note that this iterates over children instead of using * recursion. This prevents unnecessary depth in the stack. */ if (do_sub) for (sub = n->child; sub; sub = sub->next) print_node(meta, sub); /* * Lastly, conditionally run the post-node handler. */ if (NODE_ENDED & n->flags) return; if (cond && act->post) (*act->post)(meta, n); if (ENDBODY_NOT != n->end) n->body->flags |= NODE_ENDED; } static int cond_head(DECL_ARGS) { return n->type == ROFFT_HEAD; } static int cond_body(DECL_ARGS) { return n->type == ROFFT_BODY; } static int pre_abort(DECL_ARGS) { abort(); } static int pre_enc(DECL_ARGS) { const char *prefix; prefix = mdoc_man_act(n->tok)->prefix; if (NULL == prefix) return 1; print_word(prefix); outflags &= ~MMAN_spc; return 1; } static void post_enc(DECL_ARGS) { const char *suffix; suffix = mdoc_man_act(n->tok)->suffix; if (NULL == suffix) return; outflags &= ~(MMAN_spc | MMAN_nl); print_word(suffix); } static int pre_ex(DECL_ARGS) { outflags |= MMAN_br | MMAN_nl; return 1; } static void post_font(DECL_ARGS) { font_pop(); } static void post_percent(DECL_ARGS) { struct roff_node *np, *nn, *nnn; if (mdoc_man_act(n->tok)->pre == pre_em) font_pop(); if ((nn = roff_node_next(n)) != NULL) { np = roff_node_prev(n); nnn = nn == NULL ? NULL : roff_node_next(nn); if (nn->tok != n->tok || (np != NULL && np->tok == n->tok) || (nnn != NULL && nnn->tok == n->tok)) print_word(","); if (nn->tok == n->tok && (nnn == NULL || nnn->tok != n->tok)) print_word("and"); } else { print_word("."); outflags |= MMAN_nl; } } static int pre__t(DECL_ARGS) { if (n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) { print_word("\\(lq"); outflags &= ~MMAN_spc; } else font_push('I'); return 1; } static void post__t(DECL_ARGS) { if (n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) { outflags &= ~MMAN_spc; print_word("\\(rq"); } else font_pop(); post_percent(meta, n); } /* * Print before a section header. */ static int pre_sect(DECL_ARGS) { if (n->type == ROFFT_HEAD) { outflags |= MMAN_sp; print_block(mdoc_man_act(n->tok)->prefix, 0); print_word(""); putchar('\"'); outflags &= ~MMAN_spc; } return 1; } /* * Print subsequent a section header. */ static void post_sect(DECL_ARGS) { if (n->type != ROFFT_HEAD) return; outflags &= ~MMAN_spc; print_word(""); putchar('\"'); outflags |= MMAN_nl; if (MDOC_Sh == n->tok && SEC_AUTHORS == n->sec) outflags &= ~(MMAN_An_split | MMAN_An_nosplit); } /* See mdoc_term.c, synopsis_pre() for comments. */ static void pre_syn(struct roff_node *n) { struct roff_node *np; if ((n->flags & NODE_SYNPRETTY) == 0 || (np = roff_node_prev(n)) == NULL) return; if (np->tok == n->tok && MDOC_Ft != n->tok && MDOC_Fo != n->tok && MDOC_Fn != n->tok) { outflags |= MMAN_br; return; } switch (np->tok) { case MDOC_Fd: case MDOC_Fn: case MDOC_Fo: case MDOC_In: case MDOC_Vt: outflags |= MMAN_sp; break; case MDOC_Ft: if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) { outflags |= MMAN_sp; break; } /* FALLTHROUGH */ default: outflags |= MMAN_br; break; } } static int pre_an(DECL_ARGS) { switch (n->norm->An.auth) { case AUTH_split: outflags &= ~MMAN_An_nosplit; outflags |= MMAN_An_split; return 0; case AUTH_nosplit: outflags &= ~MMAN_An_split; outflags |= MMAN_An_nosplit; return 0; default: if (MMAN_An_split & outflags) outflags |= MMAN_br; else if (SEC_AUTHORS == n->sec && ! (MMAN_An_nosplit & outflags)) outflags |= MMAN_An_split; return 1; } } static int pre_ap(DECL_ARGS) { outflags &= ~MMAN_spc; print_word("'"); outflags &= ~MMAN_spc; return 0; } static int pre_aq(DECL_ARGS) { print_word(n->child != NULL && n->child->next == NULL && n->child->tok == MDOC_Mt ? "<" : "\\(la"); outflags &= ~MMAN_spc; return 1; } static void post_aq(DECL_ARGS) { outflags &= ~(MMAN_spc | MMAN_nl); print_word(n->child != NULL && n->child->next == NULL && n->child->tok == MDOC_Mt ? ">" : "\\(ra"); } static int pre_bd(DECL_ARGS) { outflags &= ~(MMAN_PP | MMAN_sp | MMAN_br); if (n->norm->Bd.type == DISP_unfilled || n->norm->Bd.type == DISP_literal) print_line(".nf", 0); if (n->norm->Bd.comp == 0 && roff_node_prev(n->parent) != NULL) outflags |= MMAN_sp; print_offs(n->norm->Bd.offs, 1); return 1; } static void post_bd(DECL_ARGS) { enum roff_tok bef, now; /* Close out this display. */ print_line(".RE", MMAN_nl); bef = n->flags & NODE_NOFILL ? ROFF_nf : ROFF_fi; if (n->last == NULL) now = n->norm->Bd.type == DISP_unfilled || n->norm->Bd.type == DISP_literal ? ROFF_nf : ROFF_fi; else if (n->last->tok == ROFF_nf) now = ROFF_nf; else if (n->last->tok == ROFF_fi) now = ROFF_fi; else now = n->last->flags & NODE_NOFILL ? ROFF_nf : ROFF_fi; if (bef != now) { outflags |= MMAN_nl; print_word("."); outflags &= ~MMAN_spc; print_word(roff_name[bef]); outflags |= MMAN_nl; } /* Maybe we are inside an enclosing list? */ if (roff_node_next(n->parent) != NULL) mid_it(); } static int pre_bf(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: return 1; case ROFFT_BODY: break; default: return 0; } switch (n->norm->Bf.font) { case FONT_Em: font_push('I'); break; case FONT_Sy: font_push('B'); break; default: font_push('R'); break; } return 1; } static void post_bf(DECL_ARGS) { if (n->type == ROFFT_BODY) font_pop(); } static int pre_bk(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: return 1; case ROFFT_BODY: case ROFFT_ELEM: outflags |= MMAN_Bk; return 1; default: return 0; } } static void post_bk(DECL_ARGS) { switch (n->type) { case ROFFT_ELEM: while ((n = n->parent) != NULL) if (n->tok == MDOC_Bk) return; /* FALLTHROUGH */ case ROFFT_BODY: outflags &= ~MMAN_Bk; break; default: break; } } static int pre_bl(DECL_ARGS) { size_t icol; /* * print_offs() will increase the -offset to account for * a possible enclosing .It, but any enclosed .It blocks * just nest and do not add up their indentation. */ if (n->norm->Bl.offs) { print_offs(n->norm->Bl.offs, 0); Bl_stack[Bl_stack_len++] = 0; } switch (n->norm->Bl.type) { case LIST_enum: n->norm->Bl.count = 0; return 1; case LIST_column: break; default: return 1; } if (n->child != NULL) { print_line(".TS", MMAN_nl); for (icol = 0; icol < n->norm->Bl.ncols; icol++) print_word("l"); print_word("."); } outflags |= MMAN_nl; return 1; } static void post_bl(DECL_ARGS) { switch (n->norm->Bl.type) { case LIST_column: if (n->child != NULL) print_line(".TE", 0); break; case LIST_enum: n->norm->Bl.count = 0; break; default: break; } if (n->norm->Bl.offs) { print_line(".RE", MMAN_nl); assert(Bl_stack_len); Bl_stack_len--; assert(Bl_stack[Bl_stack_len] == 0); } else { outflags |= MMAN_PP | MMAN_nl; outflags &= ~(MMAN_sp | MMAN_br); } /* Maybe we are inside an enclosing list? */ if (roff_node_next(n->parent) != NULL) mid_it(); } static void pre_br(DECL_ARGS) { outflags |= MMAN_br; } static int pre_dl(DECL_ARGS) { print_offs("6n", 0); return 1; } static void post_dl(DECL_ARGS) { print_line(".RE", MMAN_nl); /* Maybe we are inside an enclosing list? */ if (roff_node_next(n->parent) != NULL) mid_it(); } static int pre_em(DECL_ARGS) { font_push('I'); return 1; } static int pre_en(DECL_ARGS) { if (NULL == n->norm->Es || NULL == n->norm->Es->child) return 1; print_word(n->norm->Es->child->string); outflags &= ~MMAN_spc; return 1; } static void post_en(DECL_ARGS) { if (NULL == n->norm->Es || NULL == n->norm->Es->child || NULL == n->norm->Es->child->next) return; outflags &= ~MMAN_spc; print_word(n->norm->Es->child->next->string); return; } static int pre_eo(DECL_ARGS) { if (n->end == ENDBODY_NOT && n->parent->head->child == NULL && n->child != NULL && n->child->end != ENDBODY_NOT) print_word("\\&"); else if (n->end != ENDBODY_NOT ? n->child != NULL : n->parent->head->child != NULL && (n->child != NULL || (n->parent->tail != NULL && n->parent->tail->child != NULL))) outflags &= ~(MMAN_spc | MMAN_nl); return 1; } static void post_eo(DECL_ARGS) { int body, tail; if (n->end != ENDBODY_NOT) { outflags |= MMAN_spc; return; } body = n->child != NULL || n->parent->head->child != NULL; tail = n->parent->tail != NULL && n->parent->tail->child != NULL; if (body && tail) outflags &= ~MMAN_spc; else if ( ! (body || tail)) print_word("\\&"); else if ( ! tail) outflags |= MMAN_spc; } static int pre_fa(DECL_ARGS) { int am_Fa; am_Fa = MDOC_Fa == n->tok; if (am_Fa) n = n->child; while (NULL != n) { font_push('I'); if (am_Fa || NODE_SYNPRETTY & n->flags) outflags |= MMAN_nbrword; print_node(meta, n); font_pop(); if (NULL != (n = n->next)) print_word(","); } return 0; } static void post_fa(DECL_ARGS) { struct roff_node *nn; if ((nn = roff_node_next(n)) != NULL && nn->tok == MDOC_Fa) print_word(","); } static int pre_fd(DECL_ARGS) { pre_syn(n); font_push('B'); return 1; } static void post_fd(DECL_ARGS) { font_pop(); outflags |= MMAN_br; } static int pre_fl(DECL_ARGS) { font_push('B'); print_word("\\-"); if (n->child != NULL) outflags &= ~MMAN_spc; return 1; } static void post_fl(DECL_ARGS) { struct roff_node *nn; font_pop(); if (n->child == NULL && ((nn = roff_node_next(n)) != NULL && nn->type != ROFFT_TEXT && (nn->flags & NODE_LINE) == 0)) outflags &= ~MMAN_spc; } static int pre_fn(DECL_ARGS) { pre_syn(n); n = n->child; if (NULL == n) return 0; if (NODE_SYNPRETTY & n->flags) print_block(".HP 4n", MMAN_nl); font_push('B'); print_node(meta, n); font_pop(); outflags &= ~MMAN_spc; print_word("("); outflags &= ~MMAN_spc; n = n->next; if (NULL != n) pre_fa(meta, n); return 0; } static void post_fn(DECL_ARGS) { print_word(")"); if (NODE_SYNPRETTY & n->flags) { print_word(";"); outflags |= MMAN_PP; } } static int pre_fo(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: pre_syn(n); break; case ROFFT_HEAD: if (n->child == NULL) return 0; if (NODE_SYNPRETTY & n->flags) print_block(".HP 4n", MMAN_nl); font_push('B'); break; case ROFFT_BODY: outflags &= ~(MMAN_spc | MMAN_nl); print_word("("); outflags &= ~MMAN_spc; break; default: break; } return 1; } static void post_fo(DECL_ARGS) { switch (n->type) { case ROFFT_HEAD: if (n->child != NULL) font_pop(); break; case ROFFT_BODY: post_fn(meta, n); break; default: break; } } static int pre_Ft(DECL_ARGS) { pre_syn(n); font_push('I'); return 1; } static void pre_ft(DECL_ARGS) { print_line(".ft", 0); print_word(n->child->string); outflags |= MMAN_nl; } static int pre_in(DECL_ARGS) { if (NODE_SYNPRETTY & n->flags) { pre_syn(n); font_push('B'); print_word("#include <"); outflags &= ~MMAN_spc; } else { print_word("<"); outflags &= ~MMAN_spc; font_push('I'); } return 1; } static void post_in(DECL_ARGS) { if (NODE_SYNPRETTY & n->flags) { outflags &= ~MMAN_spc; print_word(">"); font_pop(); outflags |= MMAN_br; } else { font_pop(); outflags &= ~MMAN_spc; print_word(">"); } } static int pre_it(DECL_ARGS) { const struct roff_node *bln; switch (n->type) { case ROFFT_HEAD: outflags |= MMAN_PP | MMAN_nl; bln = n->parent->parent; if (bln->norm->Bl.comp == 0 || (n->parent->prev == NULL && roff_node_prev(bln->parent) == NULL)) outflags |= MMAN_sp; outflags &= ~MMAN_br; switch (bln->norm->Bl.type) { case LIST_item: return 0; case LIST_inset: case LIST_diag: case LIST_ohang: if (bln->norm->Bl.type == LIST_diag) print_line(".B \"", 0); else print_line(".BR \\& \"", 0); outflags &= ~MMAN_spc; return 1; case LIST_bullet: case LIST_dash: case LIST_hyphen: print_width(&bln->norm->Bl, NULL); TPremain = 0; outflags |= MMAN_nl; font_push('B'); if (LIST_bullet == bln->norm->Bl.type) print_word("\\(bu"); else print_word("-"); font_pop(); outflags |= MMAN_nl; return 0; case LIST_enum: print_width(&bln->norm->Bl, NULL); TPremain = 0; outflags |= MMAN_nl; print_count(&bln->norm->Bl.count); outflags |= MMAN_nl; return 0; case LIST_hang: print_width(&bln->norm->Bl, n->child); TPremain = 0; outflags |= MMAN_nl; return 1; case LIST_tag: print_width(&bln->norm->Bl, n->child); putchar('\n'); outflags &= ~MMAN_spc; return 1; default: return 1; } default: break; } return 1; } /* * This function is called after closing out an indented block. * If we are inside an enclosing list, restore its indentation. */ static void mid_it(void) { char buf[24]; /* Nothing to do outside a list. */ if (0 == Bl_stack_len || 0 == Bl_stack[Bl_stack_len - 1]) return; /* The indentation has already been set up. */ if (Bl_stack_post[Bl_stack_len - 1]) return; /* Restore the indentation of the enclosing list. */ print_line(".RS", MMAN_Bk_susp); (void)snprintf(buf, sizeof(buf), "%dn", Bl_stack[Bl_stack_len - 1]); print_word(buf); /* Remeber to close out this .RS block later. */ Bl_stack_post[Bl_stack_len - 1] = 1; } static void post_it(DECL_ARGS) { const struct roff_node *bln; bln = n->parent->parent; switch (n->type) { case ROFFT_HEAD: switch (bln->norm->Bl.type) { case LIST_diag: outflags &= ~MMAN_spc; print_word("\\ "); break; case LIST_ohang: outflags |= MMAN_br; break; default: break; } break; case ROFFT_BODY: switch (bln->norm->Bl.type) { case LIST_bullet: case LIST_dash: case LIST_hyphen: case LIST_enum: case LIST_hang: case LIST_tag: assert(Bl_stack_len); Bl_stack[--Bl_stack_len] = 0; /* * Our indentation had to be restored * after a child display or child list. * Close out that indentation block now. */ if (Bl_stack_post[Bl_stack_len]) { print_line(".RE", MMAN_nl); Bl_stack_post[Bl_stack_len] = 0; } break; case LIST_column: if (NULL != n->next) { putchar('\t'); outflags &= ~MMAN_spc; } break; default: break; } break; default: break; } } static void post_lb(DECL_ARGS) { if (SEC_LIBRARY == n->sec) outflags |= MMAN_br; } static int pre_lk(DECL_ARGS) { const struct roff_node *link, *descr, *punct; if ((link = n->child) == NULL) return 0; /* Find beginning of trailing punctuation. */ punct = n->last; while (punct != link && punct->flags & NODE_DELIMC) punct = punct->prev; punct = punct->next; /* Link text. */ if ((descr = link->next) != NULL && descr != punct) { font_push('I'); while (descr != punct) { print_word(descr->string); descr = descr->next; } font_pop(); print_word(":"); } /* Link target. */ font_push('B'); print_word(link->string); font_pop(); /* Trailing punctuation. */ while (punct != NULL) { print_word(punct->string); punct = punct->next; } return 0; } static void pre_onearg(DECL_ARGS) { outflags |= MMAN_nl; print_word("."); outflags &= ~MMAN_spc; print_word(roff_name[n->tok]); if (n->child != NULL) print_word(n->child->string); outflags |= MMAN_nl; if (n->tok == ROFF_ce) for (n = n->child->next; n != NULL; n = n->next) print_node(meta, n); } static int pre_li(DECL_ARGS) { font_push('R'); return 1; } static int pre_nm(DECL_ARGS) { char *name; switch (n->type) { case ROFFT_BLOCK: outflags |= MMAN_Bk; pre_syn(n); return 1; case ROFFT_HEAD: case ROFFT_ELEM: break; default: return 1; } name = n->child == NULL ? NULL : n->child->string; if (name == NULL) return 0; if (n->type == ROFFT_HEAD) { if (roff_node_prev(n->parent) == NULL) outflags |= MMAN_sp; print_block(".HP", 0); printf(" %dn", man_strlen(name) + 1); outflags |= MMAN_nl; } font_push('B'); return 1; } static void post_nm(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: outflags &= ~MMAN_Bk; break; case ROFFT_HEAD: case ROFFT_ELEM: if (n->child != NULL && n->child->string != NULL) font_pop(); break; default: break; } } static int pre_no(DECL_ARGS) { outflags |= MMAN_spc_force; return 1; } static void pre_noarg(DECL_ARGS) { outflags |= MMAN_nl; print_word("."); outflags &= ~MMAN_spc; print_word(roff_name[n->tok]); outflags |= MMAN_nl; } static int pre_ns(DECL_ARGS) { outflags &= ~MMAN_spc; return 0; } static void post_pf(DECL_ARGS) { if ( ! (n->next == NULL || n->next->flags & NODE_LINE)) outflags &= ~MMAN_spc; } static int pre_pp(DECL_ARGS) { if (MDOC_It != n->parent->tok) outflags |= MMAN_PP; outflags |= MMAN_sp | MMAN_nl; outflags &= ~MMAN_br; return 0; } static int pre_rs(DECL_ARGS) { if (SEC_SEE_ALSO == n->sec) { outflags |= MMAN_PP | MMAN_sp | MMAN_nl; outflags &= ~MMAN_br; } return 1; } static int pre_skip(DECL_ARGS) { return 0; } static int pre_sm(DECL_ARGS) { if (NULL == n->child) outflags ^= MMAN_Sm; else if (0 == strcmp("on", n->child->string)) outflags |= MMAN_Sm; else outflags &= ~MMAN_Sm; if (MMAN_Sm & outflags) outflags |= MMAN_spc; return 0; } static void pre_sp(DECL_ARGS) { if (outflags & MMAN_PP) { outflags &= ~MMAN_PP; print_line(".PP", 0); } else { print_line(".sp", 0); if (n->child != NULL) print_word(n->child->string); } outflags |= MMAN_nl; } static int pre_sy(DECL_ARGS) { font_push('B'); return 1; } static void pre_ta(DECL_ARGS) { print_line(".ta", 0); for (n = n->child; n != NULL; n = n->next) print_word(n->string); outflags |= MMAN_nl; } static int pre_vt(DECL_ARGS) { if (NODE_SYNPRETTY & n->flags) { switch (n->type) { case ROFFT_BLOCK: pre_syn(n); return 1; case ROFFT_BODY: break; default: return 0; } } font_push('I'); return 1; } static void post_vt(DECL_ARGS) { if (n->flags & NODE_SYNPRETTY && n->type != ROFFT_BODY) return; font_pop(); } static int pre_xr(DECL_ARGS) { n = n->child; if (NULL == n) return 0; print_node(meta, n); n = n->next; if (NULL == n) return 0; outflags &= ~MMAN_spc; print_word("("); print_node(meta, n); print_word(")"); return 0; } mandoc-1.14.6/mdoc_markdown.c010064400017530001753000001034331412314055300163430ustar00schwarzeschwarze/* $Id: mdoc_markdown.c,v 1.37 2021/08/10 12:55:03 schwarze Exp $ */ /* * Copyright (c) 2017, 2018, 2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Markdown formatter for mdoc(7) used by mandoc(1). */ #include "config.h" #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "main.h" struct md_act { int (*cond)(struct roff_node *); int (*pre)(struct roff_node *); void (*post)(struct roff_node *); const char *prefix; /* pre-node string constant */ const char *suffix; /* post-node string constant */ }; static void md_nodelist(struct roff_node *); static void md_node(struct roff_node *); static const char *md_stack(char); static void md_preword(void); static void md_rawword(const char *); static void md_word(const char *); static void md_named(const char *); static void md_char(unsigned char); static void md_uri(const char *); static int md_cond_head(struct roff_node *); static int md_cond_body(struct roff_node *); static int md_pre_abort(struct roff_node *); static int md_pre_raw(struct roff_node *); static int md_pre_word(struct roff_node *); static int md_pre_skip(struct roff_node *); static void md_pre_syn(struct roff_node *); static int md_pre_An(struct roff_node *); static int md_pre_Ap(struct roff_node *); static int md_pre_Bd(struct roff_node *); static int md_pre_Bk(struct roff_node *); static int md_pre_Bl(struct roff_node *); static int md_pre_D1(struct roff_node *); static int md_pre_Dl(struct roff_node *); static int md_pre_En(struct roff_node *); static int md_pre_Eo(struct roff_node *); static int md_pre_Fa(struct roff_node *); static int md_pre_Fd(struct roff_node *); static int md_pre_Fn(struct roff_node *); static int md_pre_Fo(struct roff_node *); static int md_pre_In(struct roff_node *); static int md_pre_It(struct roff_node *); static int md_pre_Lk(struct roff_node *); static int md_pre_Mt(struct roff_node *); static int md_pre_Nd(struct roff_node *); static int md_pre_Nm(struct roff_node *); static int md_pre_No(struct roff_node *); static int md_pre_Ns(struct roff_node *); static int md_pre_Pp(struct roff_node *); static int md_pre_Rs(struct roff_node *); static int md_pre_Sh(struct roff_node *); static int md_pre_Sm(struct roff_node *); static int md_pre_Vt(struct roff_node *); static int md_pre_Xr(struct roff_node *); static int md_pre__T(struct roff_node *); static int md_pre_br(struct roff_node *); static void md_post_raw(struct roff_node *); static void md_post_word(struct roff_node *); static void md_post_pc(struct roff_node *); static void md_post_Bk(struct roff_node *); static void md_post_Bl(struct roff_node *); static void md_post_D1(struct roff_node *); static void md_post_En(struct roff_node *); static void md_post_Eo(struct roff_node *); static void md_post_Fa(struct roff_node *); static void md_post_Fd(struct roff_node *); static void md_post_Fl(struct roff_node *); static void md_post_Fn(struct roff_node *); static void md_post_Fo(struct roff_node *); static void md_post_In(struct roff_node *); static void md_post_It(struct roff_node *); static void md_post_Lb(struct roff_node *); static void md_post_Nm(struct roff_node *); static void md_post_Pf(struct roff_node *); static void md_post_Vt(struct roff_node *); static void md_post__T(struct roff_node *); static const struct md_act md_acts[MDOC_MAX - MDOC_Dd] = { { NULL, NULL, NULL, NULL, NULL }, /* Dd */ { NULL, NULL, NULL, NULL, NULL }, /* Dt */ { NULL, NULL, NULL, NULL, NULL }, /* Os */ { NULL, md_pre_Sh, NULL, NULL, NULL }, /* Sh */ { NULL, md_pre_Sh, NULL, NULL, NULL }, /* Ss */ { NULL, md_pre_Pp, NULL, NULL, NULL }, /* Pp */ { md_cond_body, md_pre_D1, md_post_D1, NULL, NULL }, /* D1 */ { md_cond_body, md_pre_Dl, md_post_D1, NULL, NULL }, /* Dl */ { md_cond_body, md_pre_Bd, md_post_D1, NULL, NULL }, /* Bd */ { NULL, NULL, NULL, NULL, NULL }, /* Ed */ { md_cond_body, md_pre_Bl, md_post_Bl, NULL, NULL }, /* Bl */ { NULL, NULL, NULL, NULL, NULL }, /* El */ { NULL, md_pre_It, md_post_It, NULL, NULL }, /* It */ { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Ad */ { NULL, md_pre_An, NULL, NULL, NULL }, /* An */ { NULL, md_pre_Ap, NULL, NULL, NULL }, /* Ap */ { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Ar */ { NULL, md_pre_raw, md_post_raw, "**", "**" }, /* Cd */ { NULL, md_pre_raw, md_post_raw, "**", "**" }, /* Cm */ { NULL, md_pre_raw, md_post_raw, "`", "`" }, /* Dv */ { NULL, md_pre_raw, md_post_raw, "`", "`" }, /* Er */ { NULL, md_pre_raw, md_post_raw, "`", "`" }, /* Ev */ { NULL, NULL, NULL, NULL, NULL }, /* Ex */ { NULL, md_pre_Fa, md_post_Fa, NULL, NULL }, /* Fa */ { NULL, md_pre_Fd, md_post_Fd, "**", "**" }, /* Fd */ { NULL, md_pre_raw, md_post_Fl, "**-", "**" }, /* Fl */ { NULL, md_pre_Fn, md_post_Fn, NULL, NULL }, /* Fn */ { NULL, md_pre_Fd, md_post_raw, "*", "*" }, /* Ft */ { NULL, md_pre_raw, md_post_raw, "**", "**" }, /* Ic */ { NULL, md_pre_In, md_post_In, NULL, NULL }, /* In */ { NULL, md_pre_raw, md_post_raw, "`", "`" }, /* Li */ { md_cond_head, md_pre_Nd, NULL, NULL, NULL }, /* Nd */ { NULL, md_pre_Nm, md_post_Nm, "**", "**" }, /* Nm */ { md_cond_body, md_pre_word, md_post_word, "[", "]" }, /* Op */ { NULL, md_pre_abort, NULL, NULL, NULL }, /* Ot */ { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Pa */ { NULL, NULL, NULL, NULL, NULL }, /* Rv */ { NULL, NULL, NULL, NULL, NULL }, /* St */ { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Va */ { NULL, md_pre_Vt, md_post_Vt, "*", "*" }, /* Vt */ { NULL, md_pre_Xr, NULL, NULL, NULL }, /* Xr */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %A */ { NULL, md_pre_raw, md_post_pc, "*", "*" }, /* %B */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %D */ { NULL, md_pre_raw, md_post_pc, "*", "*" }, /* %I */ { NULL, md_pre_raw, md_post_pc, "*", "*" }, /* %J */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %N */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %O */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %P */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %R */ { NULL, md_pre__T, md_post__T, NULL, NULL }, /* %T */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %V */ { NULL, NULL, NULL, NULL, NULL }, /* Ac */ { md_cond_body, md_pre_word, md_post_word, "<", ">" }, /* Ao */ { md_cond_body, md_pre_word, md_post_word, "<", ">" }, /* Aq */ { NULL, NULL, NULL, NULL, NULL }, /* At */ { NULL, NULL, NULL, NULL, NULL }, /* Bc */ { NULL, NULL, NULL, NULL, NULL }, /* Bf XXX not implemented */ { md_cond_body, md_pre_word, md_post_word, "[", "]" }, /* Bo */ { md_cond_body, md_pre_word, md_post_word, "[", "]" }, /* Bq */ { NULL, NULL, NULL, NULL, NULL }, /* Bsx */ { NULL, NULL, NULL, NULL, NULL }, /* Bx */ { NULL, NULL, NULL, NULL, NULL }, /* Db */ { NULL, NULL, NULL, NULL, NULL }, /* Dc */ { md_cond_body, md_pre_word, md_post_word, "\"", "\"" }, /* Do */ { md_cond_body, md_pre_word, md_post_word, "\"", "\"" }, /* Dq */ { NULL, NULL, NULL, NULL, NULL }, /* Ec */ { NULL, NULL, NULL, NULL, NULL }, /* Ef */ { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Em */ { md_cond_body, md_pre_Eo, md_post_Eo, NULL, NULL }, /* Eo */ { NULL, NULL, NULL, NULL, NULL }, /* Fx */ { NULL, md_pre_raw, md_post_raw, "**", "**" }, /* Ms */ { NULL, md_pre_No, NULL, NULL, NULL }, /* No */ { NULL, md_pre_Ns, NULL, NULL, NULL }, /* Ns */ { NULL, NULL, NULL, NULL, NULL }, /* Nx */ { NULL, NULL, NULL, NULL, NULL }, /* Ox */ { NULL, NULL, NULL, NULL, NULL }, /* Pc */ { NULL, NULL, md_post_Pf, NULL, NULL }, /* Pf */ { md_cond_body, md_pre_word, md_post_word, "(", ")" }, /* Po */ { md_cond_body, md_pre_word, md_post_word, "(", ")" }, /* Pq */ { NULL, NULL, NULL, NULL, NULL }, /* Qc */ { md_cond_body, md_pre_raw, md_post_raw, "'`", "`'" }, /* Ql */ { md_cond_body, md_pre_word, md_post_word, "\"", "\"" }, /* Qo */ { md_cond_body, md_pre_word, md_post_word, "\"", "\"" }, /* Qq */ { NULL, NULL, NULL, NULL, NULL }, /* Re */ { md_cond_body, md_pre_Rs, NULL, NULL, NULL }, /* Rs */ { NULL, NULL, NULL, NULL, NULL }, /* Sc */ { md_cond_body, md_pre_word, md_post_word, "'", "'" }, /* So */ { md_cond_body, md_pre_word, md_post_word, "'", "'" }, /* Sq */ { NULL, md_pre_Sm, NULL, NULL, NULL }, /* Sm */ { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Sx */ { NULL, md_pre_raw, md_post_raw, "**", "**" }, /* Sy */ { NULL, md_pre_raw, md_post_raw, "`", "`" }, /* Tn */ { NULL, NULL, NULL, NULL, NULL }, /* Ux */ { NULL, NULL, NULL, NULL, NULL }, /* Xc */ { NULL, NULL, NULL, NULL, NULL }, /* Xo */ { NULL, md_pre_Fo, md_post_Fo, "**", "**" }, /* Fo */ { NULL, NULL, NULL, NULL, NULL }, /* Fc */ { md_cond_body, md_pre_word, md_post_word, "[", "]" }, /* Oo */ { NULL, NULL, NULL, NULL, NULL }, /* Oc */ { NULL, md_pre_Bk, md_post_Bk, NULL, NULL }, /* Bk */ { NULL, NULL, NULL, NULL, NULL }, /* Ek */ { NULL, NULL, NULL, NULL, NULL }, /* Bt */ { NULL, NULL, NULL, NULL, NULL }, /* Hf */ { NULL, md_pre_raw, md_post_raw, "*", "*" }, /* Fr */ { NULL, NULL, NULL, NULL, NULL }, /* Ud */ { NULL, NULL, md_post_Lb, NULL, NULL }, /* Lb */ { NULL, md_pre_abort, NULL, NULL, NULL }, /* Lp */ { NULL, md_pre_Lk, NULL, NULL, NULL }, /* Lk */ { NULL, md_pre_Mt, NULL, NULL, NULL }, /* Mt */ { md_cond_body, md_pre_word, md_post_word, "{", "}" }, /* Brq */ { md_cond_body, md_pre_word, md_post_word, "{", "}" }, /* Bro */ { NULL, NULL, NULL, NULL, NULL }, /* Brc */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %C */ { NULL, md_pre_skip, NULL, NULL, NULL }, /* Es */ { md_cond_body, md_pre_En, md_post_En, NULL, NULL }, /* En */ { NULL, NULL, NULL, NULL, NULL }, /* Dx */ { NULL, NULL, md_post_pc, NULL, NULL }, /* %Q */ { NULL, md_pre_Lk, md_post_pc, NULL, NULL }, /* %U */ { NULL, NULL, NULL, NULL, NULL }, /* Ta */ { NULL, md_pre_skip, NULL, NULL, NULL }, /* Tg */ }; static const struct md_act *md_act(enum roff_tok); static int outflags; #define MD_spc (1 << 0) /* Blank character before next word. */ #define MD_spc_force (1 << 1) /* Even before trailing punctuation. */ #define MD_nonl (1 << 2) /* Prevent linebreak in markdown code. */ #define MD_nl (1 << 3) /* Break markdown code line. */ #define MD_br (1 << 4) /* Insert an output line break. */ #define MD_sp (1 << 5) /* Insert a paragraph break. */ #define MD_Sm (1 << 6) /* Horizontal spacing mode. */ #define MD_Bk (1 << 7) /* Word keep mode. */ #define MD_An_split (1 << 8) /* Author mode is "split". */ #define MD_An_nosplit (1 << 9) /* Author mode is "nosplit". */ static int escflags; /* Escape in generated markdown code: */ #define ESC_BOL (1 << 0) /* "#*+-" near the beginning of a line. */ #define ESC_NUM (1 << 1) /* "." after a leading number. */ #define ESC_HYP (1 << 2) /* "(" immediately after "]". */ #define ESC_SQU (1 << 4) /* "]" when "[" is open. */ #define ESC_FON (1 << 5) /* "*" immediately after unrelated "*". */ #define ESC_EOL (1 << 6) /* " " at the and of a line. */ static int code_blocks, quote_blocks, list_blocks; static int outcount; static const struct md_act * md_act(enum roff_tok tok) { assert(tok >= MDOC_Dd && tok <= MDOC_MAX); return md_acts + (tok - MDOC_Dd); } void markdown_mdoc(void *arg, const struct roff_meta *mdoc) { outflags = MD_Sm; md_word(mdoc->title); if (mdoc->msec != NULL) { outflags &= ~MD_spc; md_word("("); md_word(mdoc->msec); md_word(")"); } md_word("-"); md_word(mdoc->vol); if (mdoc->arch != NULL) { md_word("("); md_word(mdoc->arch); md_word(")"); } outflags |= MD_sp; md_nodelist(mdoc->first->child); outflags |= MD_sp; md_word(mdoc->os); md_word("-"); md_word(mdoc->date); putchar('\n'); } static void md_nodelist(struct roff_node *n) { while (n != NULL) { md_node(n); n = n->next; } } static void md_node(struct roff_node *n) { const struct md_act *act; int cond, process_children; if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; if (outflags & MD_nonl) outflags &= ~(MD_nl | MD_sp); else if (outflags & MD_spc && n->flags & NODE_LINE && !roff_node_transparent(n)) outflags |= MD_nl; act = NULL; cond = 0; process_children = 1; n->flags &= ~NODE_ENDED; if (n->type == ROFFT_TEXT) { if (n->flags & NODE_DELIMC) outflags &= ~(MD_spc | MD_spc_force); else if (outflags & MD_Sm) outflags |= MD_spc_force; md_word(n->string); if (n->flags & NODE_DELIMO) outflags &= ~(MD_spc | MD_spc_force); else if (outflags & MD_Sm) outflags |= MD_spc; } else if (n->tok < ROFF_MAX) { switch (n->tok) { case ROFF_br: process_children = md_pre_br(n); break; case ROFF_sp: process_children = md_pre_Pp(n); break; default: process_children = 0; break; } } else { act = md_act(n->tok); cond = act->cond == NULL || (*act->cond)(n); if (cond && act->pre != NULL && (n->end == ENDBODY_NOT || n->child != NULL)) process_children = (*act->pre)(n); } if (process_children && n->child != NULL) md_nodelist(n->child); if (n->flags & NODE_ENDED) return; if (cond && act->post != NULL) (*act->post)(n); if (n->end != ENDBODY_NOT) n->body->flags |= NODE_ENDED; } static const char * md_stack(char c) { static char *stack; static size_t sz; static size_t cur; switch (c) { case '\0': break; case (char)-1: assert(cur); stack[--cur] = '\0'; break; default: if (cur + 1 >= sz) { sz += 8; stack = mandoc_realloc(stack, sz); } stack[cur] = c; stack[++cur] = '\0'; break; } return stack == NULL ? "" : stack; } /* * Handle vertical and horizontal spacing. */ static void md_preword(void) { const char *cp; /* * If a list block is nested inside a code block or a blockquote, * blank lines for paragraph breaks no longer work; instead, * they terminate the list. Work around this markdown issue * by using mere line breaks instead. */ if (list_blocks && outflags & MD_sp) { outflags &= ~MD_sp; outflags |= MD_br; } /* * End the old line if requested. * Escape whitespace at the end of the markdown line * such that it won't look like an output line break. */ if (outflags & MD_sp) putchar('\n'); else if (outflags & MD_br) { putchar(' '); putchar(' '); } else if (outflags & MD_nl && escflags & ESC_EOL) md_named("zwnj"); /* Start a new line if necessary. */ if (outflags & (MD_nl | MD_br | MD_sp)) { putchar('\n'); for (cp = md_stack('\0'); *cp != '\0'; cp++) { putchar(*cp); if (*cp == '>') putchar(' '); } outflags &= ~(MD_nl | MD_br | MD_sp); escflags = ESC_BOL; outcount = 0; /* Handle horizontal spacing. */ } else if (outflags & MD_spc) { if (outflags & MD_Bk) fputs(" ", stdout); else putchar(' '); escflags &= ~ESC_FON; outcount++; } outflags &= ~(MD_spc_force | MD_nonl); if (outflags & MD_Sm) outflags |= MD_spc; else outflags &= ~MD_spc; } /* * Print markdown syntax elements. * Can also be used for constant strings when neither escaping * nor delimiter handling is required. */ static void md_rawword(const char *s) { md_preword(); if (*s == '\0') return; if (escflags & ESC_FON) { escflags &= ~ESC_FON; if (*s == '*' && !code_blocks) fputs("‌", stdout); } while (*s != '\0') { switch(*s) { case '*': if (s[1] == '\0') escflags |= ESC_FON; break; case '[': escflags |= ESC_SQU; break; case ']': escflags |= ESC_HYP; escflags &= ~ESC_SQU; break; default: break; } md_char(*s++); } if (s[-1] == ' ') escflags |= ESC_EOL; else escflags &= ~ESC_EOL; } /* * Print text and mdoc(7) syntax elements. */ static void md_word(const char *s) { const char *seq, *prevfont, *currfont, *nextfont; char c; int bs, sz, uc, breakline; /* No spacing before closing delimiters. */ if (s[0] != '\0' && s[1] == '\0' && strchr("!),.:;?]", s[0]) != NULL && (outflags & MD_spc_force) == 0) outflags &= ~MD_spc; md_preword(); if (*s == '\0') return; /* No spacing after opening delimiters. */ if ((s[0] == '(' || s[0] == '[') && s[1] == '\0') outflags &= ~MD_spc; breakline = 0; prevfont = currfont = ""; while ((c = *s++) != '\0') { bs = 0; switch(c) { case ASCII_NBRSP: if (code_blocks) c = ' '; else { md_named("nbsp"); c = '\0'; } break; case ASCII_HYPH: bs = escflags & ESC_BOL && !code_blocks; c = '-'; break; case ASCII_BREAK: continue; case '#': case '+': case '-': bs = escflags & ESC_BOL && !code_blocks; break; case '(': bs = escflags & ESC_HYP && !code_blocks; break; case ')': bs = escflags & ESC_NUM && !code_blocks; break; case '*': case '[': case '_': case '`': bs = !code_blocks; break; case '.': bs = escflags & ESC_NUM && !code_blocks; break; case '<': if (code_blocks == 0) { md_named("lt"); c = '\0'; } break; case '=': if (escflags & ESC_BOL && !code_blocks) { md_named("equals"); c = '\0'; } break; case '>': if (code_blocks == 0) { md_named("gt"); c = '\0'; } break; case '\\': uc = 0; nextfont = NULL; switch (mandoc_escape(&s, &seq, &sz)) { case ESCAPE_UNICODE: uc = mchars_num2uc(seq + 1, sz - 1); break; case ESCAPE_NUMBERED: uc = mchars_num2char(seq, sz); break; case ESCAPE_SPECIAL: uc = mchars_spec2cp(seq, sz); break; case ESCAPE_UNDEF: uc = *seq; break; case ESCAPE_DEVICE: md_rawword("markdown"); continue; case ESCAPE_FONTBOLD: case ESCAPE_FONTCB: nextfont = "**"; break; case ESCAPE_FONTITALIC: case ESCAPE_FONTCI: nextfont = "*"; break; case ESCAPE_FONTBI: nextfont = "***"; break; case ESCAPE_FONT: case ESCAPE_FONTCR: case ESCAPE_FONTROMAN: nextfont = ""; break; case ESCAPE_FONTPREV: nextfont = prevfont; break; case ESCAPE_BREAK: breakline = 1; break; case ESCAPE_NOSPACE: case ESCAPE_SKIPCHAR: case ESCAPE_OVERSTRIKE: /* XXX not implemented */ /* FALLTHROUGH */ case ESCAPE_ERROR: default: break; } if (nextfont != NULL && !code_blocks) { if (*currfont != '\0') { outflags &= ~MD_spc; md_rawword(currfont); } prevfont = currfont; currfont = nextfont; if (*currfont != '\0') { outflags &= ~MD_spc; md_rawword(currfont); } } if (uc) { if ((uc < 0x20 && uc != 0x09) || (uc > 0x7E && uc < 0xA0)) uc = 0xFFFD; if (code_blocks) { seq = mchars_uc2str(uc); fputs(seq, stdout); outcount += strlen(seq); } else { printf("&#%d;", uc); outcount++; } escflags &= ~ESC_FON; } c = '\0'; break; case ']': bs = escflags & ESC_SQU && !code_blocks; escflags |= ESC_HYP; break; default: break; } if (bs) putchar('\\'); md_char(c); if (breakline && (*s == '\0' || *s == ' ' || *s == ASCII_NBRSP)) { printf(" \n"); breakline = 0; while (*s == ' ' || *s == ASCII_NBRSP) s++; } } if (*currfont != '\0') { outflags &= ~MD_spc; md_rawword(currfont); } else if (s[-2] == ' ') escflags |= ESC_EOL; else escflags &= ~ESC_EOL; } /* * Print a single HTML named character reference. */ static void md_named(const char *s) { printf("&%s;", s); escflags &= ~(ESC_FON | ESC_EOL); outcount++; } /* * Print a single raw character and maintain certain escape flags. */ static void md_char(unsigned char c) { if (c != '\0') { putchar(c); if (c == '*') escflags |= ESC_FON; else escflags &= ~ESC_FON; outcount++; } if (c != ']') escflags &= ~ESC_HYP; if (c == ' ' || c == '\t' || c == '>') return; if (isdigit(c) == 0) escflags &= ~ESC_NUM; else if (escflags & ESC_BOL) escflags |= ESC_NUM; escflags &= ~ESC_BOL; } static int md_cond_head(struct roff_node *n) { return n->type == ROFFT_HEAD; } static int md_cond_body(struct roff_node *n) { return n->type == ROFFT_BODY; } static int md_pre_abort(struct roff_node *n) { abort(); } static int md_pre_raw(struct roff_node *n) { const char *prefix; if ((prefix = md_act(n->tok)->prefix) != NULL) { md_rawword(prefix); outflags &= ~MD_spc; if (*prefix == '`') code_blocks++; } return 1; } static void md_post_raw(struct roff_node *n) { const char *suffix; if ((suffix = md_act(n->tok)->suffix) != NULL) { outflags &= ~(MD_spc | MD_nl); md_rawword(suffix); if (*suffix == '`') code_blocks--; } } static int md_pre_word(struct roff_node *n) { const char *prefix; if ((prefix = md_act(n->tok)->prefix) != NULL) { md_word(prefix); outflags &= ~MD_spc; } return 1; } static void md_post_word(struct roff_node *n) { const char *suffix; if ((suffix = md_act(n->tok)->suffix) != NULL) { outflags &= ~(MD_spc | MD_nl); md_word(suffix); } } static void md_post_pc(struct roff_node *n) { struct roff_node *nn; md_post_raw(n); if (n->parent->tok != MDOC_Rs) return; if ((nn = roff_node_next(n)) != NULL) { md_word(","); if (nn->tok == n->tok && (nn = roff_node_prev(n)) != NULL && nn->tok == n->tok) md_word("and"); } else { md_word("."); outflags |= MD_nl; } } static int md_pre_skip(struct roff_node *n) { return 0; } static void md_pre_syn(struct roff_node *n) { struct roff_node *np; if ((n->flags & NODE_SYNPRETTY) == 0 || (np = roff_node_prev(n)) == NULL) return; if (np->tok == n->tok && n->tok != MDOC_Ft && n->tok != MDOC_Fo && n->tok != MDOC_Fn) { outflags |= MD_br; return; } switch (np->tok) { case MDOC_Fd: case MDOC_Fn: case MDOC_Fo: case MDOC_In: case MDOC_Vt: outflags |= MD_sp; break; case MDOC_Ft: if (n->tok != MDOC_Fn && n->tok != MDOC_Fo) { outflags |= MD_sp; break; } /* FALLTHROUGH */ default: outflags |= MD_br; break; } } static int md_pre_An(struct roff_node *n) { switch (n->norm->An.auth) { case AUTH_split: outflags &= ~MD_An_nosplit; outflags |= MD_An_split; return 0; case AUTH_nosplit: outflags &= ~MD_An_split; outflags |= MD_An_nosplit; return 0; default: if (outflags & MD_An_split) outflags |= MD_br; else if (n->sec == SEC_AUTHORS && ! (outflags & MD_An_nosplit)) outflags |= MD_An_split; return 1; } } static int md_pre_Ap(struct roff_node *n) { outflags &= ~MD_spc; md_word("'"); outflags &= ~MD_spc; return 0; } static int md_pre_Bd(struct roff_node *n) { switch (n->norm->Bd.type) { case DISP_unfilled: case DISP_literal: return md_pre_Dl(n); default: return md_pre_D1(n); } } static int md_pre_Bk(struct roff_node *n) { switch (n->type) { case ROFFT_BLOCK: return 1; case ROFFT_BODY: outflags |= MD_Bk; return 1; default: return 0; } } static void md_post_Bk(struct roff_node *n) { if (n->type == ROFFT_BODY) outflags &= ~MD_Bk; } static int md_pre_Bl(struct roff_node *n) { n->norm->Bl.count = 0; if (n->norm->Bl.type == LIST_column) md_pre_Dl(n); outflags |= MD_sp; return 1; } static void md_post_Bl(struct roff_node *n) { n->norm->Bl.count = 0; if (n->norm->Bl.type == LIST_column) md_post_D1(n); outflags |= MD_sp; } static int md_pre_D1(struct roff_node *n) { /* * Markdown blockquote syntax does not work inside code blocks. * The best we can do is fall back to another nested code block. */ if (code_blocks) { md_stack('\t'); code_blocks++; } else { md_stack('>'); quote_blocks++; } outflags |= MD_sp; return 1; } static void md_post_D1(struct roff_node *n) { md_stack((char)-1); if (code_blocks) code_blocks--; else quote_blocks--; outflags |= MD_sp; } static int md_pre_Dl(struct roff_node *n) { /* * Markdown code block syntax does not work inside blockquotes. * The best we can do is fall back to another nested blockquote. */ if (quote_blocks) { md_stack('>'); quote_blocks++; } else { md_stack('\t'); code_blocks++; } outflags |= MD_sp; return 1; } static int md_pre_En(struct roff_node *n) { if (n->norm->Es == NULL || n->norm->Es->child == NULL) return 1; md_word(n->norm->Es->child->string); outflags &= ~MD_spc; return 1; } static void md_post_En(struct roff_node *n) { if (n->norm->Es == NULL || n->norm->Es->child == NULL || n->norm->Es->child->next == NULL) return; outflags &= ~MD_spc; md_word(n->norm->Es->child->next->string); } static int md_pre_Eo(struct roff_node *n) { if (n->end == ENDBODY_NOT && n->parent->head->child == NULL && n->child != NULL && n->child->end != ENDBODY_NOT) md_preword(); else if (n->end != ENDBODY_NOT ? n->child != NULL : n->parent->head->child != NULL && (n->child != NULL || (n->parent->tail != NULL && n->parent->tail->child != NULL))) outflags &= ~(MD_spc | MD_nl); return 1; } static void md_post_Eo(struct roff_node *n) { if (n->end != ENDBODY_NOT) { outflags |= MD_spc; return; } if (n->child == NULL && n->parent->head->child == NULL) return; if (n->parent->tail != NULL && n->parent->tail->child != NULL) outflags &= ~MD_spc; else outflags |= MD_spc; } static int md_pre_Fa(struct roff_node *n) { int am_Fa; am_Fa = n->tok == MDOC_Fa; if (am_Fa) n = n->child; while (n != NULL) { md_rawword("*"); outflags &= ~MD_spc; md_node(n); outflags &= ~MD_spc; md_rawword("*"); if ((n = n->next) != NULL) md_word(","); } return 0; } static void md_post_Fa(struct roff_node *n) { struct roff_node *nn; if ((nn = roff_node_next(n)) != NULL && nn->tok == MDOC_Fa) md_word(","); } static int md_pre_Fd(struct roff_node *n) { md_pre_syn(n); md_pre_raw(n); return 1; } static void md_post_Fd(struct roff_node *n) { md_post_raw(n); outflags |= MD_br; } static void md_post_Fl(struct roff_node *n) { struct roff_node *nn; md_post_raw(n); if (n->child == NULL && (nn = roff_node_next(n)) != NULL && nn->type != ROFFT_TEXT && (nn->flags & NODE_LINE) == 0) outflags &= ~MD_spc; } static int md_pre_Fn(struct roff_node *n) { md_pre_syn(n); if ((n = n->child) == NULL) return 0; md_rawword("**"); outflags &= ~MD_spc; md_node(n); outflags &= ~MD_spc; md_rawword("**"); outflags &= ~MD_spc; md_word("("); if ((n = n->next) != NULL) md_pre_Fa(n); return 0; } static void md_post_Fn(struct roff_node *n) { md_word(")"); if (n->flags & NODE_SYNPRETTY) { md_word(";"); outflags |= MD_sp; } } static int md_pre_Fo(struct roff_node *n) { switch (n->type) { case ROFFT_BLOCK: md_pre_syn(n); break; case ROFFT_HEAD: if (n->child == NULL) return 0; md_pre_raw(n); break; case ROFFT_BODY: outflags &= ~(MD_spc | MD_nl); md_word("("); break; default: break; } return 1; } static void md_post_Fo(struct roff_node *n) { switch (n->type) { case ROFFT_HEAD: if (n->child != NULL) md_post_raw(n); break; case ROFFT_BODY: md_post_Fn(n); break; default: break; } } static int md_pre_In(struct roff_node *n) { if (n->flags & NODE_SYNPRETTY) { md_pre_syn(n); md_rawword("**"); outflags &= ~MD_spc; md_word("#include <"); } else { md_word("<"); outflags &= ~MD_spc; md_rawword("*"); } outflags &= ~MD_spc; return 1; } static void md_post_In(struct roff_node *n) { if (n->flags & NODE_SYNPRETTY) { outflags &= ~MD_spc; md_rawword(">**"); outflags |= MD_nl; } else { outflags &= ~MD_spc; md_rawword("*>"); } } static int md_pre_It(struct roff_node *n) { struct roff_node *bln; switch (n->type) { case ROFFT_BLOCK: return 1; case ROFFT_HEAD: bln = n->parent->parent; if (bln->norm->Bl.comp == 0 && bln->norm->Bl.type != LIST_column) outflags |= MD_sp; outflags |= MD_nl; switch (bln->norm->Bl.type) { case LIST_item: outflags |= MD_br; return 0; case LIST_inset: case LIST_diag: case LIST_ohang: outflags |= MD_br; return 1; case LIST_tag: case LIST_hang: outflags |= MD_sp; return 1; case LIST_bullet: md_rawword("*\t"); break; case LIST_dash: case LIST_hyphen: md_rawword("-\t"); break; case LIST_enum: md_preword(); if (bln->norm->Bl.count < 99) bln->norm->Bl.count++; printf("%d.\t", bln->norm->Bl.count); escflags &= ~ESC_FON; break; case LIST_column: outflags |= MD_br; return 0; default: return 0; } outflags &= ~MD_spc; outflags |= MD_nonl; outcount = 0; md_stack('\t'); if (code_blocks || quote_blocks) list_blocks++; return 0; case ROFFT_BODY: bln = n->parent->parent; switch (bln->norm->Bl.type) { case LIST_ohang: outflags |= MD_br; break; case LIST_tag: case LIST_hang: md_pre_D1(n); break; default: break; } return 1; default: return 0; } } static void md_post_It(struct roff_node *n) { struct roff_node *bln; int i, nc; if (n->type != ROFFT_BODY) return; bln = n->parent->parent; switch (bln->norm->Bl.type) { case LIST_bullet: case LIST_dash: case LIST_hyphen: case LIST_enum: md_stack((char)-1); if (code_blocks || quote_blocks) list_blocks--; break; case LIST_tag: case LIST_hang: md_post_D1(n); break; case LIST_column: if (n->next == NULL) break; /* Calculate the array index of the current column. */ i = 0; while ((n = n->prev) != NULL && n->type != ROFFT_HEAD) i++; /* * If a width was specified for this column, * subtract what printed, and * add the same spacing as in mdoc_term.c. */ nc = bln->norm->Bl.ncols; i = i < nc ? strlen(bln->norm->Bl.cols[i]) - outcount + (nc < 5 ? 4 : nc == 5 ? 3 : 1) : 1; if (i < 1) i = 1; while (i-- > 0) putchar(' '); outflags &= ~MD_spc; escflags &= ~ESC_FON; outcount = 0; break; default: break; } } static void md_post_Lb(struct roff_node *n) { if (n->sec == SEC_LIBRARY) outflags |= MD_br; } static void md_uri(const char *s) { while (*s != '\0') { if (strchr("%()<>", *s) != NULL) { printf("%%%2.2hhX", *s); outcount += 3; } else { putchar(*s); outcount++; } s++; } } static int md_pre_Lk(struct roff_node *n) { const struct roff_node *link, *descr, *punct; if ((link = n->child) == NULL) return 0; /* Find beginning of trailing punctuation. */ punct = n->last; while (punct != link && punct->flags & NODE_DELIMC) punct = punct->prev; punct = punct->next; /* Link text. */ descr = link->next; if (descr == punct) descr = link; /* no text */ md_rawword("["); outflags &= ~MD_spc; do { md_word(descr->string); descr = descr->next; } while (descr != punct); outflags &= ~MD_spc; /* Link target. */ md_rawword("]("); md_uri(link->string); outflags &= ~MD_spc; md_rawword(")"); /* Trailing punctuation. */ while (punct != NULL) { md_word(punct->string); punct = punct->next; } return 0; } static int md_pre_Mt(struct roff_node *n) { const struct roff_node *nch; md_rawword("["); outflags &= ~MD_spc; for (nch = n->child; nch != NULL; nch = nch->next) md_word(nch->string); outflags &= ~MD_spc; md_rawword("](mailto:"); for (nch = n->child; nch != NULL; nch = nch->next) { md_uri(nch->string); if (nch->next != NULL) { putchar(' '); outcount++; } } outflags &= ~MD_spc; md_rawword(")"); return 0; } static int md_pre_Nd(struct roff_node *n) { outflags &= ~MD_nl; outflags |= MD_spc; md_word("-"); return 1; } static int md_pre_Nm(struct roff_node *n) { switch (n->type) { case ROFFT_BLOCK: outflags |= MD_Bk; md_pre_syn(n); break; case ROFFT_HEAD: case ROFFT_ELEM: md_pre_raw(n); break; default: break; } return 1; } static void md_post_Nm(struct roff_node *n) { switch (n->type) { case ROFFT_BLOCK: outflags &= ~MD_Bk; break; case ROFFT_HEAD: case ROFFT_ELEM: md_post_raw(n); break; default: break; } } static int md_pre_No(struct roff_node *n) { outflags |= MD_spc_force; return 1; } static int md_pre_Ns(struct roff_node *n) { outflags &= ~MD_spc; return 0; } static void md_post_Pf(struct roff_node *n) { if (n->next != NULL && (n->next->flags & NODE_LINE) == 0) outflags &= ~MD_spc; } static int md_pre_Pp(struct roff_node *n) { outflags |= MD_sp; return 0; } static int md_pre_Rs(struct roff_node *n) { if (n->sec == SEC_SEE_ALSO) outflags |= MD_sp; return 1; } static int md_pre_Sh(struct roff_node *n) { switch (n->type) { case ROFFT_BLOCK: if (n->sec == SEC_AUTHORS) outflags &= ~(MD_An_split | MD_An_nosplit); break; case ROFFT_HEAD: outflags |= MD_sp; md_rawword(n->tok == MDOC_Sh ? "#" : "##"); break; case ROFFT_BODY: outflags |= MD_sp; break; default: break; } return 1; } static int md_pre_Sm(struct roff_node *n) { if (n->child == NULL) outflags ^= MD_Sm; else if (strcmp("on", n->child->string) == 0) outflags |= MD_Sm; else outflags &= ~MD_Sm; if (outflags & MD_Sm) outflags |= MD_spc; return 0; } static int md_pre_Vt(struct roff_node *n) { switch (n->type) { case ROFFT_BLOCK: md_pre_syn(n); return 1; case ROFFT_BODY: case ROFFT_ELEM: md_pre_raw(n); return 1; default: return 0; } } static void md_post_Vt(struct roff_node *n) { switch (n->type) { case ROFFT_BODY: case ROFFT_ELEM: md_post_raw(n); break; default: break; } } static int md_pre_Xr(struct roff_node *n) { n = n->child; if (n == NULL) return 0; md_node(n); n = n->next; if (n == NULL) return 0; outflags &= ~MD_spc; md_word("("); md_node(n); md_word(")"); return 0; } static int md_pre__T(struct roff_node *n) { if (n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) md_word("\""); else md_rawword("*"); outflags &= ~MD_spc; return 1; } static void md_post__T(struct roff_node *n) { outflags &= ~MD_spc; if (n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) md_word("\""); else md_rawword("*"); md_post_pc(n); } static int md_pre_br(struct roff_node *n) { outflags |= MD_br; return 0; } mandoc-1.14.6/mdoc_state.c010064400017530001753000000124321412314055300156370ustar00schwarzeschwarze/* $Id: mdoc_state.c,v 1.17 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2014, 2015, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "libmandoc.h" #include "roff_int.h" #include "libmdoc.h" #define STATE_ARGS struct roff_man *mdoc, struct roff_node *n typedef void (*state_handler)(STATE_ARGS); static void state_bl(STATE_ARGS); static void state_sh(STATE_ARGS); static void state_sm(STATE_ARGS); static const state_handler state_handlers[MDOC_MAX - MDOC_Dd] = { NULL, /* Dd */ NULL, /* Dt */ NULL, /* Os */ state_sh, /* Sh */ NULL, /* Ss */ NULL, /* Pp */ NULL, /* D1 */ NULL, /* Dl */ NULL, /* Bd */ NULL, /* Ed */ state_bl, /* Bl */ NULL, /* El */ NULL, /* It */ NULL, /* Ad */ NULL, /* An */ NULL, /* Ap */ NULL, /* Ar */ NULL, /* Cd */ NULL, /* Cm */ NULL, /* Dv */ NULL, /* Er */ NULL, /* Ev */ NULL, /* Ex */ NULL, /* Fa */ NULL, /* Fd */ NULL, /* Fl */ NULL, /* Fn */ NULL, /* Ft */ NULL, /* Ic */ NULL, /* In */ NULL, /* Li */ NULL, /* Nd */ NULL, /* Nm */ NULL, /* Op */ NULL, /* Ot */ NULL, /* Pa */ NULL, /* Rv */ NULL, /* St */ NULL, /* Va */ NULL, /* Vt */ NULL, /* Xr */ NULL, /* %A */ NULL, /* %B */ NULL, /* %D */ NULL, /* %I */ NULL, /* %J */ NULL, /* %N */ NULL, /* %O */ NULL, /* %P */ NULL, /* %R */ NULL, /* %T */ NULL, /* %V */ NULL, /* Ac */ NULL, /* Ao */ NULL, /* Aq */ NULL, /* At */ NULL, /* Bc */ NULL, /* Bf */ NULL, /* Bo */ NULL, /* Bq */ NULL, /* Bsx */ NULL, /* Bx */ NULL, /* Db */ NULL, /* Dc */ NULL, /* Do */ NULL, /* Dq */ NULL, /* Ec */ NULL, /* Ef */ NULL, /* Em */ NULL, /* Eo */ NULL, /* Fx */ NULL, /* Ms */ NULL, /* No */ NULL, /* Ns */ NULL, /* Nx */ NULL, /* Ox */ NULL, /* Pc */ NULL, /* Pf */ NULL, /* Po */ NULL, /* Pq */ NULL, /* Qc */ NULL, /* Ql */ NULL, /* Qo */ NULL, /* Qq */ NULL, /* Re */ NULL, /* Rs */ NULL, /* Sc */ NULL, /* So */ NULL, /* Sq */ state_sm, /* Sm */ NULL, /* Sx */ NULL, /* Sy */ NULL, /* Tn */ NULL, /* Ux */ NULL, /* Xc */ NULL, /* Xo */ NULL, /* Fo */ NULL, /* Fc */ NULL, /* Oo */ NULL, /* Oc */ NULL, /* Bk */ NULL, /* Ek */ NULL, /* Bt */ NULL, /* Hf */ NULL, /* Fr */ NULL, /* Ud */ NULL, /* Lb */ NULL, /* Lp */ NULL, /* Lk */ NULL, /* Mt */ NULL, /* Brq */ NULL, /* Bro */ NULL, /* Brc */ NULL, /* %C */ NULL, /* Es */ NULL, /* En */ NULL, /* Dx */ NULL, /* %Q */ NULL, /* %U */ NULL, /* Ta */ NULL, /* Tg */ }; void mdoc_state(struct roff_man *mdoc, struct roff_node *n) { state_handler handler; if (n->tok == TOKEN_NONE || n->tok < ROFF_MAX) return; assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); if ((mdoc_macro(n->tok)->flags & MDOC_PROLOGUE) == 0) mdoc->flags |= MDOC_PBODY; handler = state_handlers[n->tok - MDOC_Dd]; if (*handler) (*handler)(mdoc, n); } static void state_bl(STATE_ARGS) { struct mdoc_arg *args; size_t i; if (n->type != ROFFT_HEAD || n->parent->args == NULL) return; args = n->parent->args; for (i = 0; i < args->argc; i++) { switch(args->argv[i].arg) { case MDOC_Diag: n->norm->Bl.type = LIST_diag; return; case MDOC_Column: n->norm->Bl.type = LIST_column; return; default: break; } } } static void state_sh(STATE_ARGS) { struct roff_node *nch; char *secname; if (n->type != ROFFT_HEAD) return; if ( ! (n->flags & NODE_VALID)) { secname = NULL; deroff(&secname, n); /* * Set the section attribute for the BLOCK, HEAD, * and HEAD children; the latter can only be TEXT * nodes, so no recursion is needed. For other * nodes, including the .Sh BODY, this is done * when allocating the node data structures, but * for .Sh BLOCK and HEAD, the section is still * unknown at that time. */ n->sec = n->parent->sec = secname == NULL ? SEC_CUSTOM : mdoc_a2sec(secname); for (nch = n->child; nch != NULL; nch = nch->next) nch->sec = n->sec; free(secname); } if ((mdoc->lastsec = n->sec) == SEC_SYNOPSIS) { roff_setreg(mdoc->roff, "nS", 1, '='); mdoc->flags |= MDOC_SYNOPSIS; } else { roff_setreg(mdoc->roff, "nS", 0, '='); mdoc->flags &= ~MDOC_SYNOPSIS; } } static void state_sm(STATE_ARGS) { if (n->child == NULL) mdoc->flags ^= MDOC_SMOFF; else if ( ! strcmp(n->child->string, "on")) mdoc->flags &= ~MDOC_SMOFF; else if ( ! strcmp(n->child->string, "off")) mdoc->flags |= MDOC_SMOFF; } mandoc-1.14.6/mdoc_term.c010064400017530001753000001237631412314055300155000ustar00schwarzeschwarze/* $Id: mdoc_term.c,v 1.380 2020/04/06 10:16:17 schwarze Exp $ */ /* * Copyright (c) 2010, 2012-2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013 Franco Fichtner * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Plain text formatter for mdoc(7), used by mandoc(1) * for ASCII, UTF-8, PostScript, and PDF output. */ #include "config.h" #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "roff.h" #include "mdoc.h" #include "out.h" #include "term.h" #include "term_tag.h" #include "main.h" struct termpair { struct termpair *ppair; int count; }; #define DECL_ARGS struct termp *p, \ struct termpair *pair, \ const struct roff_meta *meta, \ struct roff_node *n struct mdoc_term_act { int (*pre)(DECL_ARGS); void (*post)(DECL_ARGS); }; static int a2width(const struct termp *, const char *); static void print_bvspace(struct termp *, struct roff_node *, struct roff_node *); static void print_mdoc_node(DECL_ARGS); static void print_mdoc_nodelist(DECL_ARGS); static void print_mdoc_head(struct termp *, const struct roff_meta *); static void print_mdoc_foot(struct termp *, const struct roff_meta *); static void synopsis_pre(struct termp *, struct roff_node *); static void termp____post(DECL_ARGS); static void termp__t_post(DECL_ARGS); static void termp_bd_post(DECL_ARGS); static void termp_bk_post(DECL_ARGS); static void termp_bl_post(DECL_ARGS); static void termp_eo_post(DECL_ARGS); static void termp_fd_post(DECL_ARGS); static void termp_fo_post(DECL_ARGS); static void termp_in_post(DECL_ARGS); static void termp_it_post(DECL_ARGS); static void termp_lb_post(DECL_ARGS); static void termp_nm_post(DECL_ARGS); static void termp_pf_post(DECL_ARGS); static void termp_quote_post(DECL_ARGS); static void termp_sh_post(DECL_ARGS); static void termp_ss_post(DECL_ARGS); static void termp_xx_post(DECL_ARGS); static int termp__a_pre(DECL_ARGS); static int termp__t_pre(DECL_ARGS); static int termp_abort_pre(DECL_ARGS); static int termp_an_pre(DECL_ARGS); static int termp_ap_pre(DECL_ARGS); static int termp_bd_pre(DECL_ARGS); static int termp_bf_pre(DECL_ARGS); static int termp_bk_pre(DECL_ARGS); static int termp_bl_pre(DECL_ARGS); static int termp_bold_pre(DECL_ARGS); static int termp_d1_pre(DECL_ARGS); static int termp_eo_pre(DECL_ARGS); static int termp_ex_pre(DECL_ARGS); static int termp_fa_pre(DECL_ARGS); static int termp_fd_pre(DECL_ARGS); static int termp_fl_pre(DECL_ARGS); static int termp_fn_pre(DECL_ARGS); static int termp_fo_pre(DECL_ARGS); static int termp_ft_pre(DECL_ARGS); static int termp_in_pre(DECL_ARGS); static int termp_it_pre(DECL_ARGS); static int termp_li_pre(DECL_ARGS); static int termp_lk_pre(DECL_ARGS); static int termp_nd_pre(DECL_ARGS); static int termp_nm_pre(DECL_ARGS); static int termp_ns_pre(DECL_ARGS); static int termp_quote_pre(DECL_ARGS); static int termp_rs_pre(DECL_ARGS); static int termp_sh_pre(DECL_ARGS); static int termp_skip_pre(DECL_ARGS); static int termp_sm_pre(DECL_ARGS); static int termp_pp_pre(DECL_ARGS); static int termp_ss_pre(DECL_ARGS); static int termp_under_pre(DECL_ARGS); static int termp_vt_pre(DECL_ARGS); static int termp_xr_pre(DECL_ARGS); static int termp_xx_pre(DECL_ARGS); static const struct mdoc_term_act mdoc_term_acts[MDOC_MAX - MDOC_Dd] = { { NULL, NULL }, /* Dd */ { NULL, NULL }, /* Dt */ { NULL, NULL }, /* Os */ { termp_sh_pre, termp_sh_post }, /* Sh */ { termp_ss_pre, termp_ss_post }, /* Ss */ { termp_pp_pre, NULL }, /* Pp */ { termp_d1_pre, termp_bl_post }, /* D1 */ { termp_d1_pre, termp_bl_post }, /* Dl */ { termp_bd_pre, termp_bd_post }, /* Bd */ { NULL, NULL }, /* Ed */ { termp_bl_pre, termp_bl_post }, /* Bl */ { NULL, NULL }, /* El */ { termp_it_pre, termp_it_post }, /* It */ { termp_under_pre, NULL }, /* Ad */ { termp_an_pre, NULL }, /* An */ { termp_ap_pre, NULL }, /* Ap */ { termp_under_pre, NULL }, /* Ar */ { termp_fd_pre, NULL }, /* Cd */ { termp_bold_pre, NULL }, /* Cm */ { termp_li_pre, NULL }, /* Dv */ { NULL, NULL }, /* Er */ { NULL, NULL }, /* Ev */ { termp_ex_pre, NULL }, /* Ex */ { termp_fa_pre, NULL }, /* Fa */ { termp_fd_pre, termp_fd_post }, /* Fd */ { termp_fl_pre, NULL }, /* Fl */ { termp_fn_pre, NULL }, /* Fn */ { termp_ft_pre, NULL }, /* Ft */ { termp_bold_pre, NULL }, /* Ic */ { termp_in_pre, termp_in_post }, /* In */ { termp_li_pre, NULL }, /* Li */ { termp_nd_pre, NULL }, /* Nd */ { termp_nm_pre, termp_nm_post }, /* Nm */ { termp_quote_pre, termp_quote_post }, /* Op */ { termp_abort_pre, NULL }, /* Ot */ { termp_under_pre, NULL }, /* Pa */ { termp_ex_pre, NULL }, /* Rv */ { NULL, NULL }, /* St */ { termp_under_pre, NULL }, /* Va */ { termp_vt_pre, NULL }, /* Vt */ { termp_xr_pre, NULL }, /* Xr */ { termp__a_pre, termp____post }, /* %A */ { termp_under_pre, termp____post }, /* %B */ { NULL, termp____post }, /* %D */ { termp_under_pre, termp____post }, /* %I */ { termp_under_pre, termp____post }, /* %J */ { NULL, termp____post }, /* %N */ { NULL, termp____post }, /* %O */ { NULL, termp____post }, /* %P */ { NULL, termp____post }, /* %R */ { termp__t_pre, termp__t_post }, /* %T */ { NULL, termp____post }, /* %V */ { NULL, NULL }, /* Ac */ { termp_quote_pre, termp_quote_post }, /* Ao */ { termp_quote_pre, termp_quote_post }, /* Aq */ { NULL, NULL }, /* At */ { NULL, NULL }, /* Bc */ { termp_bf_pre, NULL }, /* Bf */ { termp_quote_pre, termp_quote_post }, /* Bo */ { termp_quote_pre, termp_quote_post }, /* Bq */ { termp_xx_pre, termp_xx_post }, /* Bsx */ { NULL, NULL }, /* Bx */ { termp_skip_pre, NULL }, /* Db */ { NULL, NULL }, /* Dc */ { termp_quote_pre, termp_quote_post }, /* Do */ { termp_quote_pre, termp_quote_post }, /* Dq */ { NULL, NULL }, /* Ec */ /* FIXME: no space */ { NULL, NULL }, /* Ef */ { termp_under_pre, NULL }, /* Em */ { termp_eo_pre, termp_eo_post }, /* Eo */ { termp_xx_pre, termp_xx_post }, /* Fx */ { termp_bold_pre, NULL }, /* Ms */ { termp_li_pre, NULL }, /* No */ { termp_ns_pre, NULL }, /* Ns */ { termp_xx_pre, termp_xx_post }, /* Nx */ { termp_xx_pre, termp_xx_post }, /* Ox */ { NULL, NULL }, /* Pc */ { NULL, termp_pf_post }, /* Pf */ { termp_quote_pre, termp_quote_post }, /* Po */ { termp_quote_pre, termp_quote_post }, /* Pq */ { NULL, NULL }, /* Qc */ { termp_quote_pre, termp_quote_post }, /* Ql */ { termp_quote_pre, termp_quote_post }, /* Qo */ { termp_quote_pre, termp_quote_post }, /* Qq */ { NULL, NULL }, /* Re */ { termp_rs_pre, NULL }, /* Rs */ { NULL, NULL }, /* Sc */ { termp_quote_pre, termp_quote_post }, /* So */ { termp_quote_pre, termp_quote_post }, /* Sq */ { termp_sm_pre, NULL }, /* Sm */ { termp_under_pre, NULL }, /* Sx */ { termp_bold_pre, NULL }, /* Sy */ { NULL, NULL }, /* Tn */ { termp_xx_pre, termp_xx_post }, /* Ux */ { NULL, NULL }, /* Xc */ { NULL, NULL }, /* Xo */ { termp_fo_pre, termp_fo_post }, /* Fo */ { NULL, NULL }, /* Fc */ { termp_quote_pre, termp_quote_post }, /* Oo */ { NULL, NULL }, /* Oc */ { termp_bk_pre, termp_bk_post }, /* Bk */ { NULL, NULL }, /* Ek */ { NULL, NULL }, /* Bt */ { NULL, NULL }, /* Hf */ { termp_under_pre, NULL }, /* Fr */ { NULL, NULL }, /* Ud */ { NULL, termp_lb_post }, /* Lb */ { termp_abort_pre, NULL }, /* Lp */ { termp_lk_pre, NULL }, /* Lk */ { termp_under_pre, NULL }, /* Mt */ { termp_quote_pre, termp_quote_post }, /* Brq */ { termp_quote_pre, termp_quote_post }, /* Bro */ { NULL, NULL }, /* Brc */ { NULL, termp____post }, /* %C */ { termp_skip_pre, NULL }, /* Es */ { termp_quote_pre, termp_quote_post }, /* En */ { termp_xx_pre, termp_xx_post }, /* Dx */ { NULL, termp____post }, /* %Q */ { NULL, termp____post }, /* %U */ { NULL, NULL }, /* Ta */ { termp_skip_pre, NULL }, /* Tg */ }; void terminal_mdoc(void *arg, const struct roff_meta *mdoc) { struct roff_node *n, *nn; struct termp *p; size_t save_defindent; p = (struct termp *)arg; p->tcol->rmargin = p->maxrmargin = p->defrmargin; term_tab_set(p, NULL); term_tab_set(p, "T"); term_tab_set(p, ".5i"); n = mdoc->first->child; if (p->synopsisonly) { for (nn = NULL; n != NULL; n = n->next) { if (n->tok != MDOC_Sh) continue; if (n->sec == SEC_SYNOPSIS) break; if (nn == NULL && n->sec == SEC_NAME) nn = n; } if (n == NULL) n = nn; p->flags |= TERMP_NOSPACE; if (n != NULL && (n = n->child->next->child) != NULL) print_mdoc_nodelist(p, NULL, mdoc, n); term_newln(p); } else { save_defindent = p->defindent; if (p->defindent == 0) p->defindent = 5; term_begin(p, print_mdoc_head, print_mdoc_foot, mdoc); while (n != NULL && (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT)) n = n->next; if (n != NULL) { if (n->tok != MDOC_Sh) term_vspace(p); print_mdoc_nodelist(p, NULL, mdoc, n); } term_end(p); p->defindent = save_defindent; } } static void print_mdoc_nodelist(DECL_ARGS) { while (n != NULL) { print_mdoc_node(p, pair, meta, n); n = n->next; } } static void print_mdoc_node(DECL_ARGS) { const struct mdoc_term_act *act; struct termpair npair; size_t offset, rmargin; int chld; /* * In no-fill mode, break the output line at the beginning * of new input lines except after \c, and nowhere else. */ if (n->flags & NODE_NOFILL) { if (n->flags & NODE_LINE && (p->flags & TERMP_NONEWLINE) == 0) term_newln(p); p->flags |= TERMP_BRNEVER; } else p->flags &= ~TERMP_BRNEVER; if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; chld = 1; offset = p->tcol->offset; rmargin = p->tcol->rmargin; n->flags &= ~NODE_ENDED; n->prev_font = p->fonti; memset(&npair, 0, sizeof(struct termpair)); npair.ppair = pair; if (n->flags & NODE_ID && n->tok != MDOC_Pp && (n->tok != MDOC_It || n->type != ROFFT_BLOCK)) term_tag_write(n, p->line); /* * Keeps only work until the end of a line. If a keep was * invoked in a prior line, revert it to PREKEEP. */ if (p->flags & TERMP_KEEP && n->flags & NODE_LINE) { p->flags &= ~TERMP_KEEP; p->flags |= TERMP_PREKEEP; } /* * After the keep flags have been set up, we may now * produce output. Note that some pre-handlers do so. */ act = NULL; switch (n->type) { case ROFFT_TEXT: if (n->flags & NODE_LINE) { switch (*n->string) { case '\0': if (p->flags & TERMP_NONEWLINE) term_newln(p); else term_vspace(p); return; case ' ': if ((p->flags & TERMP_NONEWLINE) == 0) term_newln(p); break; default: break; } } if (NODE_DELIMC & n->flags) p->flags |= TERMP_NOSPACE; term_word(p, n->string); if (NODE_DELIMO & n->flags) p->flags |= TERMP_NOSPACE; break; case ROFFT_EQN: if ( ! (n->flags & NODE_LINE)) p->flags |= TERMP_NOSPACE; term_eqn(p, n->eqn); if (n->next != NULL && ! (n->next->flags & NODE_LINE)) p->flags |= TERMP_NOSPACE; break; case ROFFT_TBL: if (p->tbl.cols == NULL) term_newln(p); term_tbl(p, n->span); break; default: if (n->tok < ROFF_MAX) { roff_term_pre(p, n); return; } assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); act = mdoc_term_acts + (n->tok - MDOC_Dd); if (act->pre != NULL && (n->end == ENDBODY_NOT || n->child != NULL)) chld = (*act->pre)(p, &npair, meta, n); break; } if (chld && n->child) print_mdoc_nodelist(p, &npair, meta, n->child); term_fontpopq(p, (ENDBODY_NOT == n->end ? n : n->body)->prev_font); switch (n->type) { case ROFFT_TEXT: break; case ROFFT_TBL: break; case ROFFT_EQN: break; default: if (act->post == NULL || n->flags & NODE_ENDED) break; (void)(*act->post)(p, &npair, meta, n); /* * Explicit end tokens not only call the post * handler, but also tell the respective block * that it must not call the post handler again. */ if (ENDBODY_NOT != n->end) n->body->flags |= NODE_ENDED; break; } if (NODE_EOS & n->flags) p->flags |= TERMP_SENTENCE; if (n->type != ROFFT_TEXT) p->tcol->offset = offset; p->tcol->rmargin = rmargin; } static void print_mdoc_foot(struct termp *p, const struct roff_meta *meta) { size_t sz; term_fontrepl(p, TERMFONT_NONE); /* * Output the footer in new-groff style, that is, three columns * with the middle being the manual date and flanking columns * being the operating system: * * SYSTEM DATE SYSTEM */ term_vspace(p); p->tcol->offset = 0; sz = term_strlen(p, meta->date); p->tcol->rmargin = p->maxrmargin > sz ? (p->maxrmargin + term_len(p, 1) - sz) / 2 : 0; p->trailspace = 1; p->flags |= TERMP_NOSPACE | TERMP_NOBREAK; term_word(p, meta->os); term_flushln(p); p->tcol->offset = p->tcol->rmargin; sz = term_strlen(p, meta->os); p->tcol->rmargin = p->maxrmargin > sz ? p->maxrmargin - sz : 0; p->flags |= TERMP_NOSPACE; term_word(p, meta->date); term_flushln(p); p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin; p->trailspace = 0; p->flags &= ~TERMP_NOBREAK; p->flags |= TERMP_NOSPACE; term_word(p, meta->os); term_flushln(p); p->tcol->offset = 0; p->tcol->rmargin = p->maxrmargin; p->flags = 0; } static void print_mdoc_head(struct termp *p, const struct roff_meta *meta) { char *volume, *title; size_t vollen, titlen; /* * The header is strange. It has three components, which are * really two with the first duplicated. It goes like this: * * IDENTIFIER TITLE IDENTIFIER * * The IDENTIFIER is NAME(SECTION), which is the command-name * (if given, or "unknown" if not) followed by the manual page * section. These are given in `Dt'. The TITLE is a free-form * string depending on the manual volume. If not specified, it * switches on the manual section. */ assert(meta->vol); if (NULL == meta->arch) volume = mandoc_strdup(meta->vol); else mandoc_asprintf(&volume, "%s (%s)", meta->vol, meta->arch); vollen = term_strlen(p, volume); if (NULL == meta->msec) title = mandoc_strdup(meta->title); else mandoc_asprintf(&title, "%s(%s)", meta->title, meta->msec); titlen = term_strlen(p, title); p->flags |= TERMP_NOBREAK | TERMP_NOSPACE; p->trailspace = 1; p->tcol->offset = 0; p->tcol->rmargin = 2 * (titlen+1) + vollen < p->maxrmargin ? (p->maxrmargin - vollen + term_len(p, 1)) / 2 : vollen < p->maxrmargin ? p->maxrmargin - vollen : 0; term_word(p, title); term_flushln(p); p->flags |= TERMP_NOSPACE; p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->tcol->offset + vollen + titlen < p->maxrmargin ? p->maxrmargin - titlen : p->maxrmargin; term_word(p, volume); term_flushln(p); p->flags &= ~TERMP_NOBREAK; p->trailspace = 0; if (p->tcol->rmargin + titlen <= p->maxrmargin) { p->flags |= TERMP_NOSPACE; p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin; term_word(p, title); term_flushln(p); } p->flags &= ~TERMP_NOSPACE; p->tcol->offset = 0; p->tcol->rmargin = p->maxrmargin; free(title); free(volume); } static int a2width(const struct termp *p, const char *v) { struct roffsu su; const char *end; end = a2roffsu(v, &su, SCALE_MAX); if (end == NULL || *end != '\0') { SCALE_HS_INIT(&su, term_strlen(p, v)); su.scale /= term_strlen(p, "0"); } return term_hen(p, &su); } /* * Determine how much space to print out before block elements of `It' * (and thus `Bl') and `Bd'. And then go ahead and print that space, * too. */ static void print_bvspace(struct termp *p, struct roff_node *bl, struct roff_node *n) { struct roff_node *nn; term_newln(p); if ((bl->tok == MDOC_Bd && bl->norm->Bd.comp) || (bl->tok == MDOC_Bl && bl->norm->Bl.comp)) return; /* Do not vspace directly after Ss/Sh. */ nn = n; while (roff_node_prev(nn) == NULL) { do { nn = nn->parent; if (nn->type == ROFFT_ROOT) return; } while (nn->type != ROFFT_BLOCK); if (nn->tok == MDOC_Sh || nn->tok == MDOC_Ss) return; if (nn->tok == MDOC_It && nn->parent->parent->norm->Bl.type != LIST_item) break; } /* * No vertical space after: * items in .Bl -column * items without a body in .Bl -diag */ if (bl->tok != MDOC_Bl || n->prev == NULL || n->prev->tok != MDOC_It || (bl->norm->Bl.type != LIST_column && (bl->norm->Bl.type != LIST_diag || n->prev->body->child != NULL))) term_vspace(p); } static int termp_it_pre(DECL_ARGS) { struct roffsu su; char buf[24]; const struct roff_node *bl, *nn; size_t ncols, dcol; int i, offset, width; enum mdoc_list type; if (n->type == ROFFT_BLOCK) { print_bvspace(p, n->parent->parent, n); if (n->flags & NODE_ID) term_tag_write(n, p->line); return 1; } bl = n->parent->parent->parent; type = bl->norm->Bl.type; /* * Defaults for specific list types. */ switch (type) { case LIST_bullet: case LIST_dash: case LIST_hyphen: case LIST_enum: width = term_len(p, 2); break; case LIST_hang: case LIST_tag: width = term_len(p, 8); break; case LIST_column: width = term_len(p, 10); break; default: width = 0; break; } offset = 0; /* * First calculate width and offset. This is pretty easy unless * we're a -column list, in which case all prior columns must * be accounted for. */ if (bl->norm->Bl.offs != NULL) { offset = a2width(p, bl->norm->Bl.offs); if (offset < 0 && (size_t)(-offset) > p->tcol->offset) offset = -p->tcol->offset; else if (offset > SHRT_MAX) offset = 0; } switch (type) { case LIST_column: if (n->type == ROFFT_HEAD) break; /* * Imitate groff's column handling: * - For each earlier column, add its width. * - For less than 5 columns, add four more blanks per * column. * - For exactly 5 columns, add three more blank per * column. * - For more than 5 columns, add only one column. */ ncols = bl->norm->Bl.ncols; dcol = ncols < 5 ? term_len(p, 4) : ncols == 5 ? term_len(p, 3) : term_len(p, 1); /* * Calculate the offset by applying all prior ROFFT_BODY, * so we stop at the ROFFT_HEAD (nn->prev == NULL). */ for (i = 0, nn = n->prev; nn->prev && i < (int)ncols; nn = nn->prev, i++) { SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i])); su.scale /= term_strlen(p, "0"); offset += term_hen(p, &su) + dcol; } /* * When exceeding the declared number of columns, leave * the remaining widths at 0. This will later be * adjusted to the default width of 10, or, for the last * column, stretched to the right margin. */ if (i >= (int)ncols) break; /* * Use the declared column widths, extended as explained * in the preceding paragraph. */ SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i])); su.scale /= term_strlen(p, "0"); width = term_hen(p, &su) + dcol; break; default: if (NULL == bl->norm->Bl.width) break; /* * Note: buffer the width by 2, which is groff's magic * number for buffering single arguments. See the above * handling for column for how this changes. */ width = a2width(p, bl->norm->Bl.width) + term_len(p, 2); if (width < 0 && (size_t)(-width) > p->tcol->offset) width = -p->tcol->offset; else if (width > SHRT_MAX) width = 0; break; } /* * Whitespace control. Inset bodies need an initial space, * while diagonal bodies need two. */ p->flags |= TERMP_NOSPACE; switch (type) { case LIST_diag: if (n->type == ROFFT_BODY) term_word(p, "\\ \\ "); break; case LIST_inset: if (n->type == ROFFT_BODY && n->parent->head->child != NULL) term_word(p, "\\ "); break; default: break; } p->flags |= TERMP_NOSPACE; switch (type) { case LIST_diag: if (n->type == ROFFT_HEAD) term_fontpush(p, TERMFONT_BOLD); break; default: break; } /* * Pad and break control. This is the tricky part. These flags * are documented in term_flushln() in term.c. Note that we're * going to unset all of these flags in termp_it_post() when we * exit. */ switch (type) { case LIST_enum: case LIST_bullet: case LIST_dash: case LIST_hyphen: if (n->type == ROFFT_HEAD) { p->flags |= TERMP_NOBREAK | TERMP_HANG; p->trailspace = 1; } else if (width <= (int)term_len(p, 2)) p->flags |= TERMP_NOPAD; break; case LIST_hang: if (n->type != ROFFT_HEAD) break; p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG; p->trailspace = 1; break; case LIST_tag: if (n->type != ROFFT_HEAD) break; p->flags |= TERMP_NOBREAK | TERMP_BRTRSP | TERMP_BRIND; p->trailspace = 2; if (NULL == n->next || NULL == n->next->child) p->flags |= TERMP_HANG; break; case LIST_column: if (n->type == ROFFT_HEAD) break; if (NULL == n->next) { p->flags &= ~TERMP_NOBREAK; p->trailspace = 0; } else { p->flags |= TERMP_NOBREAK; p->trailspace = 1; } break; case LIST_diag: if (n->type != ROFFT_HEAD) break; p->flags |= TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 1; break; default: break; } /* * Margin control. Set-head-width lists have their right * margins shortened. The body for these lists has the offset * necessarily lengthened. Everybody gets the offset. */ p->tcol->offset += offset; switch (type) { case LIST_bullet: case LIST_dash: case LIST_enum: case LIST_hyphen: case LIST_hang: case LIST_tag: if (n->type == ROFFT_HEAD) p->tcol->rmargin = p->tcol->offset + width; else p->tcol->offset += width; break; case LIST_column: assert(width); p->tcol->rmargin = p->tcol->offset + width; /* * XXX - this behaviour is not documented: the * right-most column is filled to the right margin. */ if (n->type == ROFFT_HEAD) break; if (n->next == NULL && p->tcol->rmargin < p->maxrmargin) p->tcol->rmargin = p->maxrmargin; break; default: break; } /* * The dash, hyphen, bullet and enum lists all have a special * HEAD character (temporarily bold, in some cases). */ if (n->type == ROFFT_HEAD) switch (type) { case LIST_bullet: term_fontpush(p, TERMFONT_BOLD); term_word(p, "\\[bu]"); term_fontpop(p); break; case LIST_dash: case LIST_hyphen: term_fontpush(p, TERMFONT_BOLD); term_word(p, "-"); term_fontpop(p); break; case LIST_enum: (pair->ppair->ppair->count)++; (void)snprintf(buf, sizeof(buf), "%d.", pair->ppair->ppair->count); term_word(p, buf); break; default: break; } /* * If we're not going to process our children, indicate so here. */ switch (type) { case LIST_bullet: case LIST_item: case LIST_dash: case LIST_hyphen: case LIST_enum: if (n->type == ROFFT_HEAD) return 0; break; case LIST_column: if (n->type == ROFFT_HEAD) return 0; p->minbl = 0; break; default: break; } return 1; } static void termp_it_post(DECL_ARGS) { enum mdoc_list type; if (n->type == ROFFT_BLOCK) return; type = n->parent->parent->parent->norm->Bl.type; switch (type) { case LIST_item: case LIST_diag: case LIST_inset: if (n->type == ROFFT_BODY) term_newln(p); break; case LIST_column: if (n->type == ROFFT_BODY) term_flushln(p); break; default: term_newln(p); break; } /* * Now that our output is flushed, we can reset our tags. Since * only `It' sets these flags, we're free to assume that nobody * has munged them in the meanwhile. */ p->flags &= ~(TERMP_NOBREAK | TERMP_BRTRSP | TERMP_BRIND | TERMP_HANG); p->trailspace = 0; } static int termp_nm_pre(DECL_ARGS) { const char *cp; if (n->type == ROFFT_BLOCK) { p->flags |= TERMP_PREKEEP; return 1; } if (n->type == ROFFT_BODY) { if (n->child == NULL) return 0; p->flags |= TERMP_NOSPACE; cp = NULL; if (n->prev->child != NULL) cp = n->prev->child->string; if (cp == NULL) cp = meta->name; if (cp == NULL) p->tcol->offset += term_len(p, 6); else p->tcol->offset += term_len(p, 1) + term_strlen(p, cp); return 1; } if (n->child == NULL) return 0; if (n->type == ROFFT_HEAD) synopsis_pre(p, n->parent); if (n->type == ROFFT_HEAD && n->next != NULL && n->next->child != NULL) { p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 1; p->tcol->rmargin = p->tcol->offset + term_len(p, 1); if (n->child == NULL) p->tcol->rmargin += term_strlen(p, meta->name); else if (n->child->type == ROFFT_TEXT) { p->tcol->rmargin += term_strlen(p, n->child->string); if (n->child->next != NULL) p->flags |= TERMP_HANG; } else { p->tcol->rmargin += term_len(p, 5); p->flags |= TERMP_HANG; } } return termp_bold_pre(p, pair, meta, n); } static void termp_nm_post(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); break; case ROFFT_HEAD: if (n->next == NULL || n->next->child == NULL) break; term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->trailspace = 0; break; case ROFFT_BODY: if (n->child != NULL) term_flushln(p); break; default: break; } } static int termp_fl_pre(DECL_ARGS) { struct roff_node *nn; term_fontpush(p, TERMFONT_BOLD); term_word(p, "\\-"); if (n->child != NULL || ((nn = roff_node_next(n)) != NULL && nn->type != ROFFT_TEXT && (nn->flags & NODE_LINE) == 0)) p->flags |= TERMP_NOSPACE; return 1; } static int termp__a_pre(DECL_ARGS) { struct roff_node *nn; if ((nn = roff_node_prev(n)) != NULL && nn->tok == MDOC__A && ((nn = roff_node_next(n)) == NULL || nn->tok != MDOC__A)) term_word(p, "and"); return 1; } static int termp_an_pre(DECL_ARGS) { if (n->norm->An.auth == AUTH_split) { p->flags &= ~TERMP_NOSPLIT; p->flags |= TERMP_SPLIT; return 0; } if (n->norm->An.auth == AUTH_nosplit) { p->flags &= ~TERMP_SPLIT; p->flags |= TERMP_NOSPLIT; return 0; } if (p->flags & TERMP_SPLIT) term_newln(p); if (n->sec == SEC_AUTHORS && ! (p->flags & TERMP_NOSPLIT)) p->flags |= TERMP_SPLIT; return 1; } static int termp_ns_pre(DECL_ARGS) { if ( ! (NODE_LINE & n->flags)) p->flags |= TERMP_NOSPACE; return 1; } static int termp_rs_pre(DECL_ARGS) { if (SEC_SEE_ALSO != n->sec) return 1; if (n->type == ROFFT_BLOCK && roff_node_prev(n) != NULL) term_vspace(p); return 1; } static int termp_ex_pre(DECL_ARGS) { term_newln(p); return 1; } static int termp_nd_pre(DECL_ARGS) { if (n->type == ROFFT_BODY) term_word(p, "\\(en"); return 1; } static int termp_bl_pre(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: term_newln(p); return 1; case ROFFT_HEAD: return 0; default: return 1; } } static void termp_bl_post(DECL_ARGS) { if (n->type != ROFFT_BLOCK) return; term_newln(p); if (n->tok != MDOC_Bl || n->norm->Bl.type != LIST_column) return; term_tab_set(p, NULL); term_tab_set(p, "T"); term_tab_set(p, ".5i"); } static int termp_xr_pre(DECL_ARGS) { if (NULL == (n = n->child)) return 0; assert(n->type == ROFFT_TEXT); term_word(p, n->string); if (NULL == (n = n->next)) return 0; p->flags |= TERMP_NOSPACE; term_word(p, "("); p->flags |= TERMP_NOSPACE; assert(n->type == ROFFT_TEXT); term_word(p, n->string); p->flags |= TERMP_NOSPACE; term_word(p, ")"); return 0; } /* * This decides how to assert whitespace before any of the SYNOPSIS set * of macros (which, as in the case of Ft/Fo and Ft/Fn, may contain * macro combos). */ static void synopsis_pre(struct termp *p, struct roff_node *n) { struct roff_node *np; if ((n->flags & NODE_SYNPRETTY) == 0 || (np = roff_node_prev(n)) == NULL) return; /* * If we're the second in a pair of like elements, emit our * newline and return. UNLESS we're `Fo', `Fn', `Fn', in which * case we soldier on. */ if (np->tok == n->tok && MDOC_Ft != n->tok && MDOC_Fo != n->tok && MDOC_Fn != n->tok) { term_newln(p); return; } /* * If we're one of the SYNOPSIS set and non-like pair-wise after * another (or Fn/Fo, which we've let slip through) then assert * vertical space, else only newline and move on. */ switch (np->tok) { case MDOC_Fd: case MDOC_Fn: case MDOC_Fo: case MDOC_In: case MDOC_Vt: term_vspace(p); break; case MDOC_Ft: if (n->tok != MDOC_Fn && n->tok != MDOC_Fo) { term_vspace(p); break; } /* FALLTHROUGH */ default: term_newln(p); break; } } static int termp_vt_pre(DECL_ARGS) { switch (n->type) { case ROFFT_ELEM: return termp_ft_pre(p, pair, meta, n); case ROFFT_BLOCK: synopsis_pre(p, n); return 1; case ROFFT_HEAD: return 0; default: return termp_under_pre(p, pair, meta, n); } } static int termp_bold_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_BOLD); return 1; } static int termp_fd_pre(DECL_ARGS) { synopsis_pre(p, n); return termp_bold_pre(p, pair, meta, n); } static void termp_fd_post(DECL_ARGS) { term_newln(p); } static int termp_sh_pre(DECL_ARGS) { struct roff_node *np; switch (n->type) { case ROFFT_BLOCK: /* * Vertical space before sections, except * when the previous section was empty. */ if ((np = roff_node_prev(n)) == NULL || np->tok != MDOC_Sh || (np->body != NULL && np->body->child != NULL)) term_vspace(p); break; case ROFFT_HEAD: return termp_bold_pre(p, pair, meta, n); case ROFFT_BODY: p->tcol->offset = term_len(p, p->defindent); term_tab_set(p, NULL); term_tab_set(p, "T"); term_tab_set(p, ".5i"); if (n->sec == SEC_AUTHORS) p->flags &= ~(TERMP_SPLIT|TERMP_NOSPLIT); break; default: break; } return 1; } static void termp_sh_post(DECL_ARGS) { switch (n->type) { case ROFFT_HEAD: term_newln(p); break; case ROFFT_BODY: term_newln(p); p->tcol->offset = 0; break; default: break; } } static void termp_lb_post(DECL_ARGS) { if (n->sec == SEC_LIBRARY && n->flags & NODE_LINE) term_newln(p); } static int termp_d1_pre(DECL_ARGS) { if (n->type != ROFFT_BLOCK) return 1; term_newln(p); p->tcol->offset += term_len(p, p->defindent + 1); term_tab_set(p, NULL); term_tab_set(p, "T"); term_tab_set(p, ".5i"); return 1; } static int termp_ft_pre(DECL_ARGS) { synopsis_pre(p, n); return termp_under_pre(p, pair, meta, n); } static int termp_fn_pre(DECL_ARGS) { size_t rmargin = 0; int pretty; synopsis_pre(p, n); pretty = n->flags & NODE_SYNPRETTY; if ((n = n->child) == NULL) return 0; if (pretty) { rmargin = p->tcol->rmargin; p->tcol->rmargin = p->tcol->offset + term_len(p, 4); p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG; } assert(n->type == ROFFT_TEXT); term_fontpush(p, TERMFONT_BOLD); term_word(p, n->string); term_fontpop(p); if (pretty) { term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->flags |= TERMP_NOPAD; p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = rmargin; } p->flags |= TERMP_NOSPACE; term_word(p, "("); p->flags |= TERMP_NOSPACE; for (n = n->next; n; n = n->next) { assert(n->type == ROFFT_TEXT); term_fontpush(p, TERMFONT_UNDER); if (pretty) p->flags |= TERMP_NBRWORD; term_word(p, n->string); term_fontpop(p); if (n->next) { p->flags |= TERMP_NOSPACE; term_word(p, ","); } } p->flags |= TERMP_NOSPACE; term_word(p, ")"); if (pretty) { p->flags |= TERMP_NOSPACE; term_word(p, ";"); term_flushln(p); } return 0; } static int termp_fa_pre(DECL_ARGS) { const struct roff_node *nn; if (n->parent->tok != MDOC_Fo) return termp_under_pre(p, pair, meta, n); for (nn = n->child; nn != NULL; nn = nn->next) { term_fontpush(p, TERMFONT_UNDER); p->flags |= TERMP_NBRWORD; term_word(p, nn->string); term_fontpop(p); if (nn->next != NULL) { p->flags |= TERMP_NOSPACE; term_word(p, ","); } } if (n->child != NULL && (nn = roff_node_next(n)) != NULL && nn->tok == MDOC_Fa) { p->flags |= TERMP_NOSPACE; term_word(p, ","); } return 0; } static int termp_bd_pre(DECL_ARGS) { int offset; if (n->type == ROFFT_BLOCK) { print_bvspace(p, n, n); return 1; } else if (n->type == ROFFT_HEAD) return 0; /* Handle the -offset argument. */ if (n->norm->Bd.offs == NULL || ! strcmp(n->norm->Bd.offs, "left")) /* nothing */; else if ( ! strcmp(n->norm->Bd.offs, "indent")) p->tcol->offset += term_len(p, p->defindent + 1); else if ( ! strcmp(n->norm->Bd.offs, "indent-two")) p->tcol->offset += term_len(p, (p->defindent + 1) * 2); else { offset = a2width(p, n->norm->Bd.offs); if (offset < 0 && (size_t)(-offset) > p->tcol->offset) p->tcol->offset = 0; else if (offset < SHRT_MAX) p->tcol->offset += offset; } switch (n->norm->Bd.type) { case DISP_literal: term_tab_set(p, NULL); term_tab_set(p, "T"); term_tab_set(p, "8n"); break; case DISP_centered: p->flags |= TERMP_CENTER; break; default: break; } return 1; } static void termp_bd_post(DECL_ARGS) { if (n->type != ROFFT_BODY) return; if (n->norm->Bd.type == DISP_unfilled || n->norm->Bd.type == DISP_literal) p->flags |= TERMP_BRNEVER; p->flags |= TERMP_NOSPACE; term_newln(p); p->flags &= ~TERMP_BRNEVER; if (n->norm->Bd.type == DISP_centered) p->flags &= ~TERMP_CENTER; } static int termp_xx_pre(DECL_ARGS) { if ((n->aux = p->flags & TERMP_PREKEEP) == 0) p->flags |= TERMP_PREKEEP; return 1; } static void termp_xx_post(DECL_ARGS) { if (n->aux == 0) p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); } static void termp_pf_post(DECL_ARGS) { if (n->next != NULL && (n->next->flags & NODE_LINE) == 0) p->flags |= TERMP_NOSPACE; } static int termp_ss_pre(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: if (roff_node_prev(n) == NULL) term_newln(p); else term_vspace(p); break; case ROFFT_HEAD: p->tcol->offset = term_len(p, (p->defindent+1)/2); return termp_bold_pre(p, pair, meta, n); case ROFFT_BODY: p->tcol->offset = term_len(p, p->defindent); term_tab_set(p, NULL); term_tab_set(p, "T"); term_tab_set(p, ".5i"); break; default: break; } return 1; } static void termp_ss_post(DECL_ARGS) { if (n->type == ROFFT_HEAD || n->type == ROFFT_BODY) term_newln(p); } static int termp_in_pre(DECL_ARGS) { synopsis_pre(p, n); if (n->flags & NODE_SYNPRETTY && n->flags & NODE_LINE) { term_fontpush(p, TERMFONT_BOLD); term_word(p, "#include"); term_word(p, "<"); } else { term_word(p, "<"); term_fontpush(p, TERMFONT_UNDER); } p->flags |= TERMP_NOSPACE; return 1; } static void termp_in_post(DECL_ARGS) { if (n->flags & NODE_SYNPRETTY) term_fontpush(p, TERMFONT_BOLD); p->flags |= TERMP_NOSPACE; term_word(p, ">"); if (n->flags & NODE_SYNPRETTY) term_fontpop(p); } static int termp_pp_pre(DECL_ARGS) { term_vspace(p); if (n->flags & NODE_ID) term_tag_write(n, p->line); return 0; } static int termp_skip_pre(DECL_ARGS) { return 0; } static int termp_quote_pre(DECL_ARGS) { if (n->type != ROFFT_BODY && n->type != ROFFT_ELEM) return 1; switch (n->tok) { case MDOC_Ao: case MDOC_Aq: term_word(p, n->child != NULL && n->child->next == NULL && n->child->tok == MDOC_Mt ? "<" : "\\(la"); break; case MDOC_Bro: case MDOC_Brq: term_word(p, "{"); break; case MDOC_Oo: case MDOC_Op: case MDOC_Bo: case MDOC_Bq: term_word(p, "["); break; case MDOC__T: /* FALLTHROUGH */ case MDOC_Do: case MDOC_Dq: term_word(p, "\\(lq"); break; case MDOC_En: if (NULL == n->norm->Es || NULL == n->norm->Es->child) return 1; term_word(p, n->norm->Es->child->string); break; case MDOC_Po: case MDOC_Pq: term_word(p, "("); break; case MDOC_Qo: case MDOC_Qq: term_word(p, "\""); break; case MDOC_Ql: case MDOC_So: case MDOC_Sq: term_word(p, "\\(oq"); break; default: abort(); } p->flags |= TERMP_NOSPACE; return 1; } static void termp_quote_post(DECL_ARGS) { if (n->type != ROFFT_BODY && n->type != ROFFT_ELEM) return; p->flags |= TERMP_NOSPACE; switch (n->tok) { case MDOC_Ao: case MDOC_Aq: term_word(p, n->child != NULL && n->child->next == NULL && n->child->tok == MDOC_Mt ? ">" : "\\(ra"); break; case MDOC_Bro: case MDOC_Brq: term_word(p, "}"); break; case MDOC_Oo: case MDOC_Op: case MDOC_Bo: case MDOC_Bq: term_word(p, "]"); break; case MDOC__T: /* FALLTHROUGH */ case MDOC_Do: case MDOC_Dq: term_word(p, "\\(rq"); break; case MDOC_En: if (n->norm->Es == NULL || n->norm->Es->child == NULL || n->norm->Es->child->next == NULL) p->flags &= ~TERMP_NOSPACE; else term_word(p, n->norm->Es->child->next->string); break; case MDOC_Po: case MDOC_Pq: term_word(p, ")"); break; case MDOC_Qo: case MDOC_Qq: term_word(p, "\""); break; case MDOC_Ql: case MDOC_So: case MDOC_Sq: term_word(p, "\\(cq"); break; default: abort(); } } static int termp_eo_pre(DECL_ARGS) { if (n->type != ROFFT_BODY) return 1; if (n->end == ENDBODY_NOT && n->parent->head->child == NULL && n->child != NULL && n->child->end != ENDBODY_NOT) term_word(p, "\\&"); else if (n->end != ENDBODY_NOT ? n->child != NULL : n->parent->head->child != NULL && (n->child != NULL || (n->parent->tail != NULL && n->parent->tail->child != NULL))) p->flags |= TERMP_NOSPACE; return 1; } static void termp_eo_post(DECL_ARGS) { int body, tail; if (n->type != ROFFT_BODY) return; if (n->end != ENDBODY_NOT) { p->flags &= ~TERMP_NOSPACE; return; } body = n->child != NULL || n->parent->head->child != NULL; tail = n->parent->tail != NULL && n->parent->tail->child != NULL; if (body && tail) p->flags |= TERMP_NOSPACE; else if ( ! (body || tail)) term_word(p, "\\&"); else if ( ! tail) p->flags &= ~TERMP_NOSPACE; } static int termp_fo_pre(DECL_ARGS) { size_t rmargin; switch (n->type) { case ROFFT_BLOCK: synopsis_pre(p, n); return 1; case ROFFT_BODY: rmargin = p->tcol->rmargin; if (n->flags & NODE_SYNPRETTY) { p->tcol->rmargin = p->tcol->offset + term_len(p, 4); p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG; } p->flags |= TERMP_NOSPACE; term_word(p, "("); p->flags |= TERMP_NOSPACE; if (n->flags & NODE_SYNPRETTY) { term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->flags |= TERMP_NOPAD; p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = rmargin; } return 1; default: return termp_bold_pre(p, pair, meta, n); } } static void termp_fo_post(DECL_ARGS) { if (n->type != ROFFT_BODY) return; p->flags |= TERMP_NOSPACE; term_word(p, ")"); if (n->flags & NODE_SYNPRETTY) { p->flags |= TERMP_NOSPACE; term_word(p, ";"); term_flushln(p); } } static int termp_bf_pre(DECL_ARGS) { switch (n->type) { case ROFFT_HEAD: return 0; case ROFFT_BODY: break; default: return 1; } switch (n->norm->Bf.font) { case FONT_Em: return termp_under_pre(p, pair, meta, n); case FONT_Sy: return termp_bold_pre(p, pair, meta, n); default: return termp_li_pre(p, pair, meta, n); } } static int termp_sm_pre(DECL_ARGS) { if (n->child == NULL) p->flags ^= TERMP_NONOSPACE; else if (strcmp(n->child->string, "on") == 0) p->flags &= ~TERMP_NONOSPACE; else p->flags |= TERMP_NONOSPACE; if (p->col && ! (TERMP_NONOSPACE & p->flags)) p->flags &= ~TERMP_NOSPACE; return 0; } static int termp_ap_pre(DECL_ARGS) { p->flags |= TERMP_NOSPACE; term_word(p, "'"); p->flags |= TERMP_NOSPACE; return 1; } static void termp____post(DECL_ARGS) { struct roff_node *nn; /* * Handle lists of authors. In general, print each followed by * a comma. Don't print the comma if there are only two * authors. */ if (n->tok == MDOC__A && (nn = roff_node_next(n)) != NULL && nn->tok == MDOC__A && ((nn = roff_node_next(nn)) == NULL || nn->tok != MDOC__A) && ((nn = roff_node_prev(n)) == NULL || nn->tok != MDOC__A)) return; /* TODO: %U. */ if (n->parent == NULL || n->parent->tok != MDOC_Rs) return; p->flags |= TERMP_NOSPACE; if (roff_node_next(n) == NULL) { term_word(p, "."); p->flags |= TERMP_SENTENCE; } else term_word(p, ","); } static int termp_li_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_NONE); return 1; } static int termp_lk_pre(DECL_ARGS) { const struct roff_node *link, *descr, *punct; if ((link = n->child) == NULL) return 0; /* Find beginning of trailing punctuation. */ punct = n->last; while (punct != link && punct->flags & NODE_DELIMC) punct = punct->prev; punct = punct->next; /* Link text. */ if ((descr = link->next) != NULL && descr != punct) { term_fontpush(p, TERMFONT_UNDER); while (descr != punct) { if (descr->flags & (NODE_DELIMC | NODE_DELIMO)) p->flags |= TERMP_NOSPACE; term_word(p, descr->string); descr = descr->next; } term_fontpop(p); p->flags |= TERMP_NOSPACE; term_word(p, ":"); } /* Link target. */ term_fontpush(p, TERMFONT_BOLD); term_word(p, link->string); term_fontpop(p); /* Trailing punctuation. */ while (punct != NULL) { p->flags |= TERMP_NOSPACE; term_word(p, punct->string); punct = punct->next; } return 0; } static int termp_bk_pre(DECL_ARGS) { switch (n->type) { case ROFFT_BLOCK: break; case ROFFT_HEAD: return 0; case ROFFT_BODY: if (n->parent->args != NULL || n->prev->child == NULL) p->flags |= TERMP_PREKEEP; break; default: abort(); } return 1; } static void termp_bk_post(DECL_ARGS) { if (n->type == ROFFT_BODY) p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); } /* * If we are in an `Rs' and there is a journal present, * then quote us instead of underlining us (for disambiguation). */ static void termp__t_post(DECL_ARGS) { if (n->parent != NULL && n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) termp_quote_post(p, pair, meta, n); termp____post(p, pair, meta, n); } static int termp__t_pre(DECL_ARGS) { if (n->parent != NULL && n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) return termp_quote_pre(p, pair, meta, n); else return termp_under_pre(p, pair, meta, n); } static int termp_under_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_UNDER); return 1; } static int termp_abort_pre(DECL_ARGS) { abort(); } mandoc-1.14.6/mdoc_validate.c010064400017530001753000002050331412314055300163110ustar00schwarzeschwarze/* $Id: mdoc_validate.c,v 1.389 2021/07/18 11:41:23 schwarze Exp $ */ /* * Copyright (c) 2010-2020 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Validation module for mdoc(7) syntax trees used by mandoc(1). */ #include "config.h" #include #ifndef OSNAME #include #endif #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "mandoc_xr.h" #include "roff.h" #include "mdoc.h" #include "libmandoc.h" #include "roff_int.h" #include "libmdoc.h" #include "tag.h" /* FIXME: .Bl -diag can't have non-text children in HEAD. */ #define POST_ARGS struct roff_man *mdoc enum check_ineq { CHECK_LT, CHECK_GT, CHECK_EQ }; typedef void (*v_post)(POST_ARGS); static int build_list(struct roff_man *, int); static void check_argv(struct roff_man *, struct roff_node *, struct mdoc_argv *); static void check_args(struct roff_man *, struct roff_node *); static void check_text(struct roff_man *, int, int, char *); static void check_text_em(struct roff_man *, int, int, char *); static void check_toptext(struct roff_man *, int, int, const char *); static int child_an(const struct roff_node *); static size_t macro2len(enum roff_tok); static void rewrite_macro2len(struct roff_man *, char **); static int similar(const char *, const char *); static void post_abort(POST_ARGS) __attribute__((__noreturn__)); static void post_an(POST_ARGS); static void post_an_norm(POST_ARGS); static void post_at(POST_ARGS); static void post_bd(POST_ARGS); static void post_bf(POST_ARGS); static void post_bk(POST_ARGS); static void post_bl(POST_ARGS); static void post_bl_block(POST_ARGS); static void post_bl_head(POST_ARGS); static void post_bl_norm(POST_ARGS); static void post_bx(POST_ARGS); static void post_defaults(POST_ARGS); static void post_display(POST_ARGS); static void post_dd(POST_ARGS); static void post_delim(POST_ARGS); static void post_delim_nb(POST_ARGS); static void post_dt(POST_ARGS); static void post_em(POST_ARGS); static void post_en(POST_ARGS); static void post_er(POST_ARGS); static void post_es(POST_ARGS); static void post_eoln(POST_ARGS); static void post_ex(POST_ARGS); static void post_fa(POST_ARGS); static void post_fl(POST_ARGS); static void post_fn(POST_ARGS); static void post_fname(POST_ARGS); static void post_fo(POST_ARGS); static void post_hyph(POST_ARGS); static void post_it(POST_ARGS); static void post_lb(POST_ARGS); static void post_nd(POST_ARGS); static void post_nm(POST_ARGS); static void post_ns(POST_ARGS); static void post_obsolete(POST_ARGS); static void post_os(POST_ARGS); static void post_par(POST_ARGS); static void post_prevpar(POST_ARGS); static void post_root(POST_ARGS); static void post_rs(POST_ARGS); static void post_rv(POST_ARGS); static void post_section(POST_ARGS); static void post_sh(POST_ARGS); static void post_sh_head(POST_ARGS); static void post_sh_name(POST_ARGS); static void post_sh_see_also(POST_ARGS); static void post_sh_authors(POST_ARGS); static void post_sm(POST_ARGS); static void post_st(POST_ARGS); static void post_std(POST_ARGS); static void post_sx(POST_ARGS); static void post_tag(POST_ARGS); static void post_tg(POST_ARGS); static void post_useless(POST_ARGS); static void post_xr(POST_ARGS); static void post_xx(POST_ARGS); static const v_post mdoc_valids[MDOC_MAX - MDOC_Dd] = { post_dd, /* Dd */ post_dt, /* Dt */ post_os, /* Os */ post_sh, /* Sh */ post_section, /* Ss */ post_par, /* Pp */ post_display, /* D1 */ post_display, /* Dl */ post_display, /* Bd */ NULL, /* Ed */ post_bl, /* Bl */ NULL, /* El */ post_it, /* It */ post_delim_nb, /* Ad */ post_an, /* An */ NULL, /* Ap */ post_defaults, /* Ar */ NULL, /* Cd */ post_tag, /* Cm */ post_tag, /* Dv */ post_er, /* Er */ post_tag, /* Ev */ post_ex, /* Ex */ post_fa, /* Fa */ NULL, /* Fd */ post_fl, /* Fl */ post_fn, /* Fn */ post_delim_nb, /* Ft */ post_tag, /* Ic */ post_delim_nb, /* In */ post_tag, /* Li */ post_nd, /* Nd */ post_nm, /* Nm */ post_delim_nb, /* Op */ post_abort, /* Ot */ post_defaults, /* Pa */ post_rv, /* Rv */ post_st, /* St */ post_tag, /* Va */ post_delim_nb, /* Vt */ post_xr, /* Xr */ NULL, /* %A */ post_hyph, /* %B */ /* FIXME: can be used outside Rs/Re. */ NULL, /* %D */ NULL, /* %I */ NULL, /* %J */ post_hyph, /* %N */ post_hyph, /* %O */ NULL, /* %P */ post_hyph, /* %R */ post_hyph, /* %T */ /* FIXME: can be used outside Rs/Re. */ NULL, /* %V */ NULL, /* Ac */ NULL, /* Ao */ post_delim_nb, /* Aq */ post_at, /* At */ NULL, /* Bc */ post_bf, /* Bf */ NULL, /* Bo */ NULL, /* Bq */ post_xx, /* Bsx */ post_bx, /* Bx */ post_obsolete, /* Db */ NULL, /* Dc */ NULL, /* Do */ NULL, /* Dq */ NULL, /* Ec */ NULL, /* Ef */ post_em, /* Em */ NULL, /* Eo */ post_xx, /* Fx */ post_tag, /* Ms */ post_tag, /* No */ post_ns, /* Ns */ post_xx, /* Nx */ post_xx, /* Ox */ NULL, /* Pc */ NULL, /* Pf */ NULL, /* Po */ post_delim_nb, /* Pq */ NULL, /* Qc */ post_delim_nb, /* Ql */ NULL, /* Qo */ post_delim_nb, /* Qq */ NULL, /* Re */ post_rs, /* Rs */ NULL, /* Sc */ NULL, /* So */ post_delim_nb, /* Sq */ post_sm, /* Sm */ post_sx, /* Sx */ post_em, /* Sy */ post_useless, /* Tn */ post_xx, /* Ux */ NULL, /* Xc */ NULL, /* Xo */ post_fo, /* Fo */ NULL, /* Fc */ NULL, /* Oo */ NULL, /* Oc */ post_bk, /* Bk */ NULL, /* Ek */ post_eoln, /* Bt */ post_obsolete, /* Hf */ post_obsolete, /* Fr */ post_eoln, /* Ud */ post_lb, /* Lb */ post_abort, /* Lp */ post_delim_nb, /* Lk */ post_defaults, /* Mt */ post_delim_nb, /* Brq */ NULL, /* Bro */ NULL, /* Brc */ NULL, /* %C */ post_es, /* Es */ post_en, /* En */ post_xx, /* Dx */ NULL, /* %Q */ NULL, /* %U */ NULL, /* Ta */ post_tg, /* Tg */ }; #define RSORD_MAX 14 /* Number of `Rs' blocks. */ static const enum roff_tok rsord[RSORD_MAX] = { MDOC__A, MDOC__T, MDOC__B, MDOC__I, MDOC__J, MDOC__R, MDOC__N, MDOC__V, MDOC__U, MDOC__P, MDOC__Q, MDOC__C, MDOC__D, MDOC__O }; static const char * const secnames[SEC__MAX] = { NULL, "NAME", "LIBRARY", "SYNOPSIS", "DESCRIPTION", "CONTEXT", "IMPLEMENTATION NOTES", "RETURN VALUES", "ENVIRONMENT", "FILES", "EXIT STATUS", "EXAMPLES", "DIAGNOSTICS", "COMPATIBILITY", "ERRORS", "SEE ALSO", "STANDARDS", "HISTORY", "AUTHORS", "CAVEATS", "BUGS", "SECURITY CONSIDERATIONS", NULL }; static int fn_prio = TAG_STRONG; /* Validate the subtree rooted at mdoc->last. */ void mdoc_validate(struct roff_man *mdoc) { struct roff_node *n, *np; const v_post *p; /* * Translate obsolete macros to modern macros first * such that later code does not need to look * for the obsolete versions. */ n = mdoc->last; switch (n->tok) { case MDOC_Lp: n->tok = MDOC_Pp; break; case MDOC_Ot: post_obsolete(mdoc); n->tok = MDOC_Ft; break; default: break; } /* * Iterate over all children, recursing into each one * in turn, depth-first. */ mdoc->last = mdoc->last->child; while (mdoc->last != NULL) { mdoc_validate(mdoc); if (mdoc->last == n) mdoc->last = mdoc->last->child; else mdoc->last = mdoc->last->next; } /* Finally validate the macro itself. */ mdoc->last = n; mdoc->next = ROFF_NEXT_SIBLING; switch (n->type) { case ROFFT_TEXT: np = n->parent; if (n->sec != SEC_SYNOPSIS || (np->tok != MDOC_Cd && np->tok != MDOC_Fd)) check_text(mdoc, n->line, n->pos, n->string); if ((n->flags & NODE_NOFILL) == 0 && (np->tok != MDOC_It || np->type != ROFFT_HEAD || np->parent->parent->norm->Bl.type != LIST_diag)) check_text_em(mdoc, n->line, n->pos, n->string); if (np->tok == MDOC_It || (np->type == ROFFT_BODY && (np->tok == MDOC_Sh || np->tok == MDOC_Ss))) check_toptext(mdoc, n->line, n->pos, n->string); break; case ROFFT_COMMENT: case ROFFT_EQN: case ROFFT_TBL: break; case ROFFT_ROOT: post_root(mdoc); break; default: check_args(mdoc, mdoc->last); /* * Closing delimiters are not special at the * beginning of a block, opening delimiters * are not special at the end. */ if (n->child != NULL) n->child->flags &= ~NODE_DELIMC; if (n->last != NULL) n->last->flags &= ~NODE_DELIMO; /* Call the macro's postprocessor. */ if (n->tok < ROFF_MAX) { roff_validate(mdoc); break; } assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); p = mdoc_valids + (n->tok - MDOC_Dd); if (*p) (*p)(mdoc); if (mdoc->last == n) mdoc_state(mdoc, n); break; } } static void check_args(struct roff_man *mdoc, struct roff_node *n) { int i; if (NULL == n->args) return; assert(n->args->argc); for (i = 0; i < (int)n->args->argc; i++) check_argv(mdoc, n, &n->args->argv[i]); } static void check_argv(struct roff_man *mdoc, struct roff_node *n, struct mdoc_argv *v) { int i; for (i = 0; i < (int)v->sz; i++) check_text(mdoc, v->line, v->pos, v->value[i]); } static void check_text(struct roff_man *mdoc, int ln, int pos, char *p) { char *cp; if (mdoc->last->flags & NODE_NOFILL) return; for (cp = p; NULL != (p = strchr(p, '\t')); p++) mandoc_msg(MANDOCERR_FI_TAB, ln, pos + (int)(p - cp), NULL); } static void check_text_em(struct roff_man *mdoc, int ln, int pos, char *p) { const struct roff_node *np, *nn; char *cp; np = mdoc->last->prev; nn = mdoc->last->next; /* Look for em-dashes wrongly encoded as "--". */ for (cp = p; *cp != '\0'; cp++) { if (cp[0] != '-' || cp[1] != '-') continue; cp++; /* Skip input sequences of more than two '-'. */ if (cp[1] == '-') { while (cp[1] == '-') cp++; continue; } /* Skip "--" directly attached to something else. */ if ((cp - p > 1 && cp[-2] != ' ') || (cp[1] != '\0' && cp[1] != ' ')) continue; /* Require a letter right before or right afterwards. */ if ((cp - p > 2 ? isalpha((unsigned char)cp[-3]) : np != NULL && np->type == ROFFT_TEXT && *np->string != '\0' && isalpha((unsigned char)np->string[ strlen(np->string) - 1])) || (cp[1] != '\0' && cp[2] != '\0' ? isalpha((unsigned char)cp[2]) : nn != NULL && nn->type == ROFFT_TEXT && isalpha((unsigned char)*nn->string))) { mandoc_msg(MANDOCERR_DASHDASH, ln, pos + (int)(cp - p) - 1, NULL); break; } } } static void check_toptext(struct roff_man *mdoc, int ln, int pos, const char *p) { const char *cp, *cpr; if (*p == '\0') return; if ((cp = strstr(p, "OpenBSD")) != NULL) mandoc_msg(MANDOCERR_BX, ln, pos + (int)(cp - p), "Ox"); if ((cp = strstr(p, "NetBSD")) != NULL) mandoc_msg(MANDOCERR_BX, ln, pos + (int)(cp - p), "Nx"); if ((cp = strstr(p, "FreeBSD")) != NULL) mandoc_msg(MANDOCERR_BX, ln, pos + (int)(cp - p), "Fx"); if ((cp = strstr(p, "DragonFly")) != NULL) mandoc_msg(MANDOCERR_BX, ln, pos + (int)(cp - p), "Dx"); cp = p; while ((cp = strstr(cp + 1, "()")) != NULL) { for (cpr = cp - 1; cpr >= p; cpr--) if (*cpr != '_' && !isalnum((unsigned char)*cpr)) break; if ((cpr < p || *cpr == ' ') && cpr + 1 < cp) { cpr++; mandoc_msg(MANDOCERR_FUNC, ln, pos + (int)(cpr - p), "%.*s()", (int)(cp - cpr), cpr); } } } static void post_abort(POST_ARGS) { abort(); } static void post_delim(POST_ARGS) { const struct roff_node *nch; const char *lc; enum mdelim delim; enum roff_tok tok; tok = mdoc->last->tok; nch = mdoc->last->last; if (nch == NULL || nch->type != ROFFT_TEXT) return; lc = strchr(nch->string, '\0') - 1; if (lc < nch->string) return; delim = mdoc_isdelim(lc); if (delim == DELIM_NONE || delim == DELIM_OPEN) return; if (*lc == ')' && (tok == MDOC_Nd || tok == MDOC_Sh || tok == MDOC_Ss || tok == MDOC_Fo)) return; mandoc_msg(MANDOCERR_DELIM, nch->line, nch->pos + (int)(lc - nch->string), "%s%s %s", roff_name[tok], nch == mdoc->last->child ? "" : " ...", nch->string); } static void post_delim_nb(POST_ARGS) { const struct roff_node *nch; const char *lc, *cp; int nw; enum mdelim delim; enum roff_tok tok; /* * Find candidates: at least two bytes, * the last one a closing or middle delimiter. */ tok = mdoc->last->tok; nch = mdoc->last->last; if (nch == NULL || nch->type != ROFFT_TEXT) return; lc = strchr(nch->string, '\0') - 1; if (lc <= nch->string) return; delim = mdoc_isdelim(lc); if (delim == DELIM_NONE || delim == DELIM_OPEN) return; /* * Reduce false positives by allowing various cases. */ /* Escaped delimiters. */ if (lc > nch->string + 1 && lc[-2] == '\\' && (lc[-1] == '&' || lc[-1] == 'e')) return; /* Specific byte sequences. */ switch (*lc) { case ')': for (cp = lc; cp >= nch->string; cp--) if (*cp == '(') return; break; case '.': if (lc > nch->string + 1 && lc[-2] == '.' && lc[-1] == '.') return; if (lc[-1] == '.') return; break; case ';': if (tok == MDOC_Vt) return; break; case '?': if (lc[-1] == '?') return; break; case ']': for (cp = lc; cp >= nch->string; cp--) if (*cp == '[') return; break; case '|': if (lc == nch->string + 1 && lc[-1] == '|') return; default: break; } /* Exactly two non-alphanumeric bytes. */ if (lc == nch->string + 1 && !isalnum((unsigned char)lc[-1])) return; /* At least three alphabetic words with a sentence ending. */ if (strchr("!.:?", *lc) != NULL && (tok == MDOC_Em || tok == MDOC_Li || tok == MDOC_Pq || tok == MDOC_Sy)) { nw = 0; for (cp = lc - 1; cp >= nch->string; cp--) { if (*cp == ' ') { nw++; if (cp > nch->string && cp[-1] == ',') cp--; } else if (isalpha((unsigned int)*cp)) { if (nw > 1) return; } else break; } } mandoc_msg(MANDOCERR_DELIM_NB, nch->line, nch->pos + (int)(lc - nch->string), "%s%s %s", roff_name[tok], nch == mdoc->last->child ? "" : " ...", nch->string); } static void post_bl_norm(POST_ARGS) { struct roff_node *n; struct mdoc_argv *argv, *wa; int i; enum mdocargt mdoclt; enum mdoc_list lt; n = mdoc->last->parent; n->norm->Bl.type = LIST__NONE; /* * First figure out which kind of list to use: bind ourselves to * the first mentioned list type and warn about any remaining * ones. If we find no list type, we default to LIST_item. */ wa = (n->args == NULL) ? NULL : n->args->argv; mdoclt = MDOC_ARG_MAX; for (i = 0; n->args && i < (int)n->args->argc; i++) { argv = n->args->argv + i; lt = LIST__NONE; switch (argv->arg) { /* Set list types. */ case MDOC_Bullet: lt = LIST_bullet; break; case MDOC_Dash: lt = LIST_dash; break; case MDOC_Enum: lt = LIST_enum; break; case MDOC_Hyphen: lt = LIST_hyphen; break; case MDOC_Item: lt = LIST_item; break; case MDOC_Tag: lt = LIST_tag; break; case MDOC_Diag: lt = LIST_diag; break; case MDOC_Hang: lt = LIST_hang; break; case MDOC_Ohang: lt = LIST_ohang; break; case MDOC_Inset: lt = LIST_inset; break; case MDOC_Column: lt = LIST_column; break; /* Set list arguments. */ case MDOC_Compact: if (n->norm->Bl.comp) mandoc_msg(MANDOCERR_ARG_REP, argv->line, argv->pos, "Bl -compact"); n->norm->Bl.comp = 1; break; case MDOC_Width: wa = argv; if (0 == argv->sz) { mandoc_msg(MANDOCERR_ARG_EMPTY, argv->line, argv->pos, "Bl -width"); n->norm->Bl.width = "0n"; break; } if (NULL != n->norm->Bl.width) mandoc_msg(MANDOCERR_ARG_REP, argv->line, argv->pos, "Bl -width %s", argv->value[0]); rewrite_macro2len(mdoc, argv->value); n->norm->Bl.width = argv->value[0]; break; case MDOC_Offset: if (0 == argv->sz) { mandoc_msg(MANDOCERR_ARG_EMPTY, argv->line, argv->pos, "Bl -offset"); break; } if (NULL != n->norm->Bl.offs) mandoc_msg(MANDOCERR_ARG_REP, argv->line, argv->pos, "Bl -offset %s", argv->value[0]); rewrite_macro2len(mdoc, argv->value); n->norm->Bl.offs = argv->value[0]; break; default: continue; } if (LIST__NONE == lt) continue; mdoclt = argv->arg; /* Check: multiple list types. */ if (LIST__NONE != n->norm->Bl.type) { mandoc_msg(MANDOCERR_BL_REP, n->line, n->pos, "Bl -%s", mdoc_argnames[argv->arg]); continue; } /* The list type should come first. */ if (n->norm->Bl.width || n->norm->Bl.offs || n->norm->Bl.comp) mandoc_msg(MANDOCERR_BL_LATETYPE, n->line, n->pos, "Bl -%s", mdoc_argnames[n->args->argv[0].arg]); n->norm->Bl.type = lt; if (LIST_column == lt) { n->norm->Bl.ncols = argv->sz; n->norm->Bl.cols = (void *)argv->value; } } /* Allow lists to default to LIST_item. */ if (LIST__NONE == n->norm->Bl.type) { mandoc_msg(MANDOCERR_BL_NOTYPE, n->line, n->pos, "Bl"); n->norm->Bl.type = LIST_item; mdoclt = MDOC_Item; } /* * Validate the width field. Some list types don't need width * types and should be warned about them. Others should have it * and must also be warned. Yet others have a default and need * no warning. */ switch (n->norm->Bl.type) { case LIST_tag: if (n->norm->Bl.width == NULL) mandoc_msg(MANDOCERR_BL_NOWIDTH, n->line, n->pos, "Bl -tag"); break; case LIST_column: case LIST_diag: case LIST_ohang: case LIST_inset: case LIST_item: if (n->norm->Bl.width != NULL) mandoc_msg(MANDOCERR_BL_SKIPW, wa->line, wa->pos, "Bl -%s", mdoc_argnames[mdoclt]); n->norm->Bl.width = NULL; break; case LIST_bullet: case LIST_dash: case LIST_hyphen: if (n->norm->Bl.width == NULL) n->norm->Bl.width = "2n"; break; case LIST_enum: if (n->norm->Bl.width == NULL) n->norm->Bl.width = "3n"; break; default: break; } } static void post_bd(POST_ARGS) { struct roff_node *n; struct mdoc_argv *argv; int i; enum mdoc_disp dt; n = mdoc->last; for (i = 0; n->args && i < (int)n->args->argc; i++) { argv = n->args->argv + i; dt = DISP__NONE; switch (argv->arg) { case MDOC_Centred: dt = DISP_centered; break; case MDOC_Ragged: dt = DISP_ragged; break; case MDOC_Unfilled: dt = DISP_unfilled; break; case MDOC_Filled: dt = DISP_filled; break; case MDOC_Literal: dt = DISP_literal; break; case MDOC_File: mandoc_msg(MANDOCERR_BD_FILE, n->line, n->pos, NULL); break; case MDOC_Offset: if (0 == argv->sz) { mandoc_msg(MANDOCERR_ARG_EMPTY, argv->line, argv->pos, "Bd -offset"); break; } if (NULL != n->norm->Bd.offs) mandoc_msg(MANDOCERR_ARG_REP, argv->line, argv->pos, "Bd -offset %s", argv->value[0]); rewrite_macro2len(mdoc, argv->value); n->norm->Bd.offs = argv->value[0]; break; case MDOC_Compact: if (n->norm->Bd.comp) mandoc_msg(MANDOCERR_ARG_REP, argv->line, argv->pos, "Bd -compact"); n->norm->Bd.comp = 1; break; default: abort(); } if (DISP__NONE == dt) continue; if (DISP__NONE == n->norm->Bd.type) n->norm->Bd.type = dt; else mandoc_msg(MANDOCERR_BD_REP, n->line, n->pos, "Bd -%s", mdoc_argnames[argv->arg]); } if (DISP__NONE == n->norm->Bd.type) { mandoc_msg(MANDOCERR_BD_NOTYPE, n->line, n->pos, "Bd"); n->norm->Bd.type = DISP_ragged; } } /* * Stand-alone line macros. */ static void post_an_norm(POST_ARGS) { struct roff_node *n; struct mdoc_argv *argv; size_t i; n = mdoc->last; if (n->args == NULL) return; for (i = 1; i < n->args->argc; i++) { argv = n->args->argv + i; mandoc_msg(MANDOCERR_AN_REP, argv->line, argv->pos, "An -%s", mdoc_argnames[argv->arg]); } argv = n->args->argv; if (argv->arg == MDOC_Split) n->norm->An.auth = AUTH_split; else if (argv->arg == MDOC_Nosplit) n->norm->An.auth = AUTH_nosplit; else abort(); } static void post_eoln(POST_ARGS) { struct roff_node *n; post_useless(mdoc); n = mdoc->last; if (n->child != NULL) mandoc_msg(MANDOCERR_ARG_SKIP, n->line, n->pos, "%s %s", roff_name[n->tok], n->child->string); while (n->child != NULL) roff_node_delete(mdoc, n->child); roff_word_alloc(mdoc, n->line, n->pos, n->tok == MDOC_Bt ? "is currently in beta test." : "currently under development."); mdoc->last->flags |= NODE_EOS | NODE_NOSRC; mdoc->last = n; } static int build_list(struct roff_man *mdoc, int tok) { struct roff_node *n; int ic; n = mdoc->last->next; for (ic = 1;; ic++) { roff_elem_alloc(mdoc, n->line, n->pos, tok); mdoc->last->flags |= NODE_NOSRC; roff_node_relink(mdoc, n); n = mdoc->last = mdoc->last->parent; mdoc->next = ROFF_NEXT_SIBLING; if (n->next == NULL) return ic; if (ic > 1 || n->next->next != NULL) { roff_word_alloc(mdoc, n->line, n->pos, ","); mdoc->last->flags |= NODE_DELIMC | NODE_NOSRC; } n = mdoc->last->next; if (n->next == NULL) { roff_word_alloc(mdoc, n->line, n->pos, "and"); mdoc->last->flags |= NODE_NOSRC; } } } static void post_ex(POST_ARGS) { struct roff_node *n; int ic; post_std(mdoc); n = mdoc->last; mdoc->next = ROFF_NEXT_CHILD; roff_word_alloc(mdoc, n->line, n->pos, "The"); mdoc->last->flags |= NODE_NOSRC; if (mdoc->last->next != NULL) ic = build_list(mdoc, MDOC_Nm); else if (mdoc->meta.name != NULL) { roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Nm); mdoc->last->flags |= NODE_NOSRC; roff_word_alloc(mdoc, n->line, n->pos, mdoc->meta.name); mdoc->last->flags |= NODE_NOSRC; mdoc->last = mdoc->last->parent; mdoc->next = ROFF_NEXT_SIBLING; ic = 1; } else { mandoc_msg(MANDOCERR_EX_NONAME, n->line, n->pos, "Ex"); ic = 0; } roff_word_alloc(mdoc, n->line, n->pos, ic > 1 ? "utilities exit\\~0" : "utility exits\\~0"); mdoc->last->flags |= NODE_NOSRC; roff_word_alloc(mdoc, n->line, n->pos, "on success, and\\~>0 if an error occurs."); mdoc->last->flags |= NODE_EOS | NODE_NOSRC; mdoc->last = n; } static void post_lb(POST_ARGS) { struct roff_node *n; const char *p; post_delim_nb(mdoc); n = mdoc->last; assert(n->child->type == ROFFT_TEXT); mdoc->next = ROFF_NEXT_CHILD; if ((p = mdoc_a2lib(n->child->string)) != NULL) { n->child->flags |= NODE_NOPRT; roff_word_alloc(mdoc, n->line, n->pos, p); mdoc->last->flags = NODE_NOSRC; mdoc->last = n; return; } mandoc_msg(MANDOCERR_LB_BAD, n->child->line, n->child->pos, "Lb %s", n->child->string); roff_word_alloc(mdoc, n->line, n->pos, "library"); mdoc->last->flags = NODE_NOSRC; roff_word_alloc(mdoc, n->line, n->pos, "\\(lq"); mdoc->last->flags = NODE_DELIMO | NODE_NOSRC; mdoc->last = mdoc->last->next; roff_word_alloc(mdoc, n->line, n->pos, "\\(rq"); mdoc->last->flags = NODE_DELIMC | NODE_NOSRC; mdoc->last = n; } static void post_rv(POST_ARGS) { struct roff_node *n; int ic; post_std(mdoc); n = mdoc->last; mdoc->next = ROFF_NEXT_CHILD; if (n->child != NULL) { roff_word_alloc(mdoc, n->line, n->pos, "The"); mdoc->last->flags |= NODE_NOSRC; ic = build_list(mdoc, MDOC_Fn); roff_word_alloc(mdoc, n->line, n->pos, ic > 1 ? "functions return" : "function returns"); mdoc->last->flags |= NODE_NOSRC; roff_word_alloc(mdoc, n->line, n->pos, "the value\\~0 if successful;"); } else roff_word_alloc(mdoc, n->line, n->pos, "Upon successful " "completion, the value\\~0 is returned;"); mdoc->last->flags |= NODE_NOSRC; roff_word_alloc(mdoc, n->line, n->pos, "otherwise " "the value\\~\\-1 is returned and the global variable"); mdoc->last->flags |= NODE_NOSRC; roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Va); mdoc->last->flags |= NODE_NOSRC; roff_word_alloc(mdoc, n->line, n->pos, "errno"); mdoc->last->flags |= NODE_NOSRC; mdoc->last = mdoc->last->parent; mdoc->next = ROFF_NEXT_SIBLING; roff_word_alloc(mdoc, n->line, n->pos, "is set to indicate the error."); mdoc->last->flags |= NODE_EOS | NODE_NOSRC; mdoc->last = n; } static void post_std(POST_ARGS) { struct roff_node *n; post_delim(mdoc); n = mdoc->last; if (n->args && n->args->argc == 1) if (n->args->argv[0].arg == MDOC_Std) return; mandoc_msg(MANDOCERR_ARG_STD, n->line, n->pos, "%s", roff_name[n->tok]); } static void post_st(POST_ARGS) { struct roff_node *n, *nch; const char *p; n = mdoc->last; nch = n->child; assert(nch->type == ROFFT_TEXT); if ((p = mdoc_a2st(nch->string)) == NULL) { mandoc_msg(MANDOCERR_ST_BAD, nch->line, nch->pos, "St %s", nch->string); roff_node_delete(mdoc, n); return; } nch->flags |= NODE_NOPRT; mdoc->next = ROFF_NEXT_CHILD; roff_word_alloc(mdoc, nch->line, nch->pos, p); mdoc->last->flags |= NODE_NOSRC; mdoc->last= n; } static void post_tg(POST_ARGS) { struct roff_node *n; /* The .Tg node. */ struct roff_node *nch; /* The first child of the .Tg node. */ struct roff_node *nn; /* The next node after the .Tg node. */ struct roff_node *np; /* The parent of the next node. */ struct roff_node *nt; /* The TEXT node containing the tag. */ size_t len; /* The number of bytes in the tag. */ /* Find the next node. */ n = mdoc->last; for (nn = n; nn != NULL; nn = nn->parent) { if (nn->next != NULL) { nn = nn->next; break; } } /* Find the tag. */ nt = nch = n->child; if (nch == NULL && nn != NULL && nn->child != NULL && nn->child->type == ROFFT_TEXT) nt = nn->child; /* Validate the tag. */ if (nt == NULL || *nt->string == '\0') mandoc_msg(MANDOCERR_MACRO_EMPTY, n->line, n->pos, "Tg"); if (nt == NULL) { roff_node_delete(mdoc, n); return; } len = strcspn(nt->string, " \t\\"); if (nt->string[len] != '\0') mandoc_msg(MANDOCERR_TG_SPC, nt->line, nt->pos + len, "Tg %s", nt->string); /* Keep only the first argument. */ if (nch != NULL && nch->next != NULL) { mandoc_msg(MANDOCERR_ARG_EXCESS, nch->next->line, nch->next->pos, "Tg ... %s", nch->next->string); while (nch->next != NULL) roff_node_delete(mdoc, nch->next); } /* Drop the macro if the first argument is invalid. */ if (len == 0 || nt->string[len] != '\0') { roff_node_delete(mdoc, n); return; } /* By default, tag the .Tg node itself. */ if (nn == NULL || nn->flags & NODE_ID) nn = n; /* Explicit tagging of specific macros. */ switch (nn->tok) { case MDOC_Sh: case MDOC_Ss: case MDOC_Fo: nn = nn->head->child == NULL ? n : nn->head; break; case MDOC_It: np = nn->parent; while (np->tok != MDOC_Bl) np = np->parent; switch (np->norm->Bl.type) { case LIST_column: break; case LIST_diag: case LIST_hang: case LIST_inset: case LIST_ohang: case LIST_tag: nn = nn->head; break; case LIST_bullet: case LIST_dash: case LIST_enum: case LIST_hyphen: case LIST_item: nn = nn->body->child == NULL ? n : nn->body; break; default: abort(); } break; case MDOC_Bd: case MDOC_Bl: case MDOC_D1: case MDOC_Dl: nn = nn->body->child == NULL ? n : nn->body; break; case MDOC_Pp: break; case MDOC_Cm: case MDOC_Dv: case MDOC_Em: case MDOC_Er: case MDOC_Ev: case MDOC_Fl: case MDOC_Fn: case MDOC_Ic: case MDOC_Li: case MDOC_Ms: case MDOC_No: case MDOC_Sy: if (nn->child == NULL) nn = n; break; default: nn = n; break; } tag_put(nt->string, TAG_MANUAL, nn); if (nn != n) n->flags |= NODE_NOPRT; } static void post_obsolete(POST_ARGS) { struct roff_node *n; n = mdoc->last; if (n->type == ROFFT_ELEM || n->type == ROFFT_BLOCK) mandoc_msg(MANDOCERR_MACRO_OBS, n->line, n->pos, "%s", roff_name[n->tok]); } static void post_useless(POST_ARGS) { struct roff_node *n; n = mdoc->last; mandoc_msg(MANDOCERR_MACRO_USELESS, n->line, n->pos, "%s", roff_name[n->tok]); } /* * Block macros. */ static void post_bf(POST_ARGS) { struct roff_node *np, *nch; /* * Unlike other data pointers, these are "housed" by the HEAD * element, which contains the goods. */ np = mdoc->last; if (np->type != ROFFT_HEAD) return; assert(np->parent->type == ROFFT_BLOCK); assert(np->parent->tok == MDOC_Bf); /* Check the number of arguments. */ nch = np->child; if (np->parent->args == NULL) { if (nch == NULL) { mandoc_msg(MANDOCERR_BF_NOFONT, np->line, np->pos, "Bf"); return; } nch = nch->next; } if (nch != NULL) mandoc_msg(MANDOCERR_ARG_EXCESS, nch->line, nch->pos, "Bf ... %s", nch->string); /* Extract argument into data. */ if (np->parent->args != NULL) { switch (np->parent->args->argv[0].arg) { case MDOC_Emphasis: np->norm->Bf.font = FONT_Em; break; case MDOC_Literal: np->norm->Bf.font = FONT_Li; break; case MDOC_Symbolic: np->norm->Bf.font = FONT_Sy; break; default: abort(); } return; } /* Extract parameter into data. */ if ( ! strcmp(np->child->string, "Em")) np->norm->Bf.font = FONT_Em; else if ( ! strcmp(np->child->string, "Li")) np->norm->Bf.font = FONT_Li; else if ( ! strcmp(np->child->string, "Sy")) np->norm->Bf.font = FONT_Sy; else mandoc_msg(MANDOCERR_BF_BADFONT, np->child->line, np->child->pos, "Bf %s", np->child->string); } static void post_fname(POST_ARGS) { struct roff_node *n, *nch; const char *cp; size_t pos; n = mdoc->last; nch = n->child; cp = nch->string; if (*cp == '(') { if (cp[strlen(cp + 1)] == ')') return; pos = 0; } else { pos = strcspn(cp, "()"); if (cp[pos] == '\0') { if (n->sec == SEC_DESCRIPTION || n->sec == SEC_CUSTOM) tag_put(NULL, fn_prio++, n); return; } } mandoc_msg(MANDOCERR_FN_PAREN, nch->line, nch->pos + pos, "%s", cp); } static void post_fn(POST_ARGS) { post_fname(mdoc); post_fa(mdoc); } static void post_fo(POST_ARGS) { const struct roff_node *n; n = mdoc->last; if (n->type != ROFFT_HEAD) return; if (n->child == NULL) { mandoc_msg(MANDOCERR_FO_NOHEAD, n->line, n->pos, "Fo"); return; } if (n->child != n->last) { mandoc_msg(MANDOCERR_ARG_EXCESS, n->child->next->line, n->child->next->pos, "Fo ... %s", n->child->next->string); while (n->child != n->last) roff_node_delete(mdoc, n->last); } else post_delim(mdoc); post_fname(mdoc); } static void post_fa(POST_ARGS) { const struct roff_node *n; const char *cp; for (n = mdoc->last->child; n != NULL; n = n->next) { for (cp = n->string; *cp != '\0'; cp++) { /* Ignore callbacks and alterations. */ if (*cp == '(' || *cp == '{') break; if (*cp != ',') continue; mandoc_msg(MANDOCERR_FA_COMMA, n->line, n->pos + (int)(cp - n->string), "%s", n->string); break; } } post_delim_nb(mdoc); } static void post_nm(POST_ARGS) { struct roff_node *n; n = mdoc->last; if (n->sec == SEC_NAME && n->child != NULL && n->child->type == ROFFT_TEXT && mdoc->meta.msec != NULL) mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1); if (n->last != NULL && n->last->tok == MDOC_Pp) roff_node_relink(mdoc, n->last); if (mdoc->meta.name == NULL) deroff(&mdoc->meta.name, n); if (mdoc->meta.name == NULL || (mdoc->lastsec == SEC_NAME && n->child == NULL)) mandoc_msg(MANDOCERR_NM_NONAME, n->line, n->pos, "Nm"); switch (n->type) { case ROFFT_ELEM: post_delim_nb(mdoc); break; case ROFFT_HEAD: post_delim(mdoc); break; default: return; } if ((n->child != NULL && n->child->type == ROFFT_TEXT) || mdoc->meta.name == NULL) return; mdoc->next = ROFF_NEXT_CHILD; roff_word_alloc(mdoc, n->line, n->pos, mdoc->meta.name); mdoc->last->flags |= NODE_NOSRC; mdoc->last = n; } static void post_nd(POST_ARGS) { struct roff_node *n; n = mdoc->last; if (n->type != ROFFT_BODY) return; if (n->sec != SEC_NAME) mandoc_msg(MANDOCERR_ND_LATE, n->line, n->pos, "Nd"); if (n->child == NULL) mandoc_msg(MANDOCERR_ND_EMPTY, n->line, n->pos, "Nd"); else post_delim(mdoc); post_hyph(mdoc); } static void post_display(POST_ARGS) { struct roff_node *n, *np; n = mdoc->last; switch (n->type) { case ROFFT_BODY: if (n->end != ENDBODY_NOT) { if (n->tok == MDOC_Bd && n->body->parent->args == NULL) roff_node_delete(mdoc, n); } else if (n->child == NULL) mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, "%s", roff_name[n->tok]); else if (n->tok == MDOC_D1) post_hyph(mdoc); break; case ROFFT_BLOCK: if (n->tok == MDOC_Bd) { if (n->args == NULL) { mandoc_msg(MANDOCERR_BD_NOARG, n->line, n->pos, "Bd"); mdoc->next = ROFF_NEXT_SIBLING; while (n->body->child != NULL) roff_node_relink(mdoc, n->body->child); roff_node_delete(mdoc, n); break; } post_bd(mdoc); post_prevpar(mdoc); } for (np = n->parent; np != NULL; np = np->parent) { if (np->type == ROFFT_BLOCK && np->tok == MDOC_Bd) { mandoc_msg(MANDOCERR_BD_NEST, n->line, n->pos, "%s in Bd", roff_name[n->tok]); break; } } break; default: break; } } static void post_defaults(POST_ARGS) { struct roff_node *n; n = mdoc->last; if (n->child != NULL) { post_delim_nb(mdoc); return; } mdoc->next = ROFF_NEXT_CHILD; switch (n->tok) { case MDOC_Ar: roff_word_alloc(mdoc, n->line, n->pos, "file"); mdoc->last->flags |= NODE_NOSRC; roff_word_alloc(mdoc, n->line, n->pos, "..."); break; case MDOC_Pa: case MDOC_Mt: roff_word_alloc(mdoc, n->line, n->pos, "~"); break; default: abort(); } mdoc->last->flags |= NODE_NOSRC; mdoc->last = n; } static void post_at(POST_ARGS) { struct roff_node *n, *nch; const char *att; n = mdoc->last; nch = n->child; /* * If we have a child, look it up in the standard keys. If a * key exist, use that instead of the child; if it doesn't, * prefix "AT&T UNIX " to the existing data. */ att = NULL; if (nch != NULL && ((att = mdoc_a2att(nch->string)) == NULL)) mandoc_msg(MANDOCERR_AT_BAD, nch->line, nch->pos, "At %s", nch->string); mdoc->next = ROFF_NEXT_CHILD; if (att != NULL) { roff_word_alloc(mdoc, nch->line, nch->pos, att); nch->flags |= NODE_NOPRT; } else roff_word_alloc(mdoc, n->line, n->pos, "AT&T UNIX"); mdoc->last->flags |= NODE_NOSRC; mdoc->last = n; } static void post_an(POST_ARGS) { struct roff_node *np, *nch; post_an_norm(mdoc); np = mdoc->last; nch = np->child; if (np->norm->An.auth == AUTH__NONE) { if (nch == NULL) mandoc_msg(MANDOCERR_MACRO_EMPTY, np->line, np->pos, "An"); else post_delim_nb(mdoc); } else if (nch != NULL) mandoc_msg(MANDOCERR_ARG_EXCESS, nch->line, nch->pos, "An ... %s", nch->string); } static void post_em(POST_ARGS) { post_tag(mdoc); tag_put(NULL, TAG_FALLBACK, mdoc->last); } static void post_en(POST_ARGS) { post_obsolete(mdoc); if (mdoc->last->type == ROFFT_BLOCK) mdoc->last->norm->Es = mdoc->last_es; } static void post_er(POST_ARGS) { struct roff_node *n; n = mdoc->last; if (n->sec == SEC_ERRORS && (n->parent->tok == MDOC_It || (n->parent->tok == MDOC_Bq && n->parent->parent->parent->tok == MDOC_It))) tag_put(NULL, TAG_STRONG, n); post_delim_nb(mdoc); } static void post_tag(POST_ARGS) { struct roff_node *n; n = mdoc->last; if ((n->prev == NULL || (n->prev->type == ROFFT_TEXT && strcmp(n->prev->string, "|") == 0)) && (n->parent->tok == MDOC_It || (n->parent->tok == MDOC_Xo && n->parent->parent->prev == NULL && n->parent->parent->parent->tok == MDOC_It))) tag_put(NULL, TAG_STRONG, n); post_delim_nb(mdoc); } static void post_es(POST_ARGS) { post_obsolete(mdoc); mdoc->last_es = mdoc->last; } static void post_fl(POST_ARGS) { struct roff_node *n; char *cp; /* * Transform ".Fl Fl long" to ".Fl \-long", * resulting for example in better HTML output. */ n = mdoc->last; if (n->prev != NULL && n->prev->tok == MDOC_Fl && n->prev->child == NULL && n->child != NULL && (n->flags & NODE_LINE) == 0) { mandoc_asprintf(&cp, "\\-%s", n->child->string); free(n->child->string); n->child->string = cp; roff_node_delete(mdoc, n->prev); } post_tag(mdoc); } static void post_xx(POST_ARGS) { struct roff_node *n; const char *os; char *v; post_delim_nb(mdoc); n = mdoc->last; switch (n->tok) { case MDOC_Bsx: os = "BSD/OS"; break; case MDOC_Dx: os = "DragonFly"; break; case MDOC_Fx: os = "FreeBSD"; break; case MDOC_Nx: os = "NetBSD"; if (n->child == NULL) break; v = n->child->string; if ((v[0] != '0' && v[0] != '1') || v[1] != '.' || v[2] < '0' || v[2] > '9' || v[3] < 'a' || v[3] > 'z' || v[4] != '\0') break; n->child->flags |= NODE_NOPRT; mdoc->next = ROFF_NEXT_CHILD; roff_word_alloc(mdoc, n->child->line, n->child->pos, v); v = mdoc->last->string; v[3] = toupper((unsigned char)v[3]); mdoc->last->flags |= NODE_NOSRC; mdoc->last = n; break; case MDOC_Ox: os = "OpenBSD"; break; case MDOC_Ux: os = "UNIX"; break; default: abort(); } mdoc->next = ROFF_NEXT_CHILD; roff_word_alloc(mdoc, n->line, n->pos, os); mdoc->last->flags |= NODE_NOSRC; mdoc->last = n; } static void post_it(POST_ARGS) { struct roff_node *nbl, *nit, *nch; int i, cols; enum mdoc_list lt; post_prevpar(mdoc); nit = mdoc->last; if (nit->type != ROFFT_BLOCK) return; nbl = nit->parent->parent; lt = nbl->norm->Bl.type; switch (lt) { case LIST_tag: case LIST_hang: case LIST_ohang: case LIST_inset: case LIST_diag: if (nit->head->child == NULL) mandoc_msg(MANDOCERR_IT_NOHEAD, nit->line, nit->pos, "Bl -%s It", mdoc_argnames[nbl->args->argv[0].arg]); break; case LIST_bullet: case LIST_dash: case LIST_enum: case LIST_hyphen: if (nit->body == NULL || nit->body->child == NULL) mandoc_msg(MANDOCERR_IT_NOBODY, nit->line, nit->pos, "Bl -%s It", mdoc_argnames[nbl->args->argv[0].arg]); /* FALLTHROUGH */ case LIST_item: if ((nch = nit->head->child) != NULL) mandoc_msg(MANDOCERR_ARG_SKIP, nit->line, nit->pos, "It %s", nch->type == ROFFT_TEXT ? nch->string : roff_name[nch->tok]); break; case LIST_column: cols = (int)nbl->norm->Bl.ncols; assert(nit->head->child == NULL); if (nit->head->next->child == NULL && nit->head->next->next == NULL) { mandoc_msg(MANDOCERR_MACRO_EMPTY, nit->line, nit->pos, "It"); roff_node_delete(mdoc, nit); break; } i = 0; for (nch = nit->child; nch != NULL; nch = nch->next) { if (nch->type != ROFFT_BODY) continue; if (i++ && nch->flags & NODE_LINE) mandoc_msg(MANDOCERR_TA_LINE, nch->line, nch->pos, "Ta"); } if (i < cols || i > cols + 1) mandoc_msg(MANDOCERR_BL_COL, nit->line, nit->pos, "%d columns, %d cells", cols, i); else if (nit->head->next->child != NULL && nit->head->next->child->flags & NODE_LINE) mandoc_msg(MANDOCERR_IT_NOARG, nit->line, nit->pos, "Bl -column It"); break; default: abort(); } } static void post_bl_block(POST_ARGS) { struct roff_node *n, *ni, *nc; post_prevpar(mdoc); n = mdoc->last; for (ni = n->body->child; ni != NULL; ni = ni->next) { if (ni->body == NULL) continue; nc = ni->body->last; while (nc != NULL) { switch (nc->tok) { case MDOC_Pp: case ROFF_br: break; default: nc = NULL; continue; } if (ni->next == NULL) { mandoc_msg(MANDOCERR_PAR_MOVE, nc->line, nc->pos, "%s", roff_name[nc->tok]); roff_node_relink(mdoc, nc); } else if (n->norm->Bl.comp == 0 && n->norm->Bl.type != LIST_column) { mandoc_msg(MANDOCERR_PAR_SKIP, nc->line, nc->pos, "%s before It", roff_name[nc->tok]); roff_node_delete(mdoc, nc); } else break; nc = ni->body->last; } } } /* * If the argument of -offset or -width is a macro, * replace it with the associated default width. */ static void rewrite_macro2len(struct roff_man *mdoc, char **arg) { size_t width; enum roff_tok tok; if (*arg == NULL) return; else if ( ! strcmp(*arg, "Ds")) width = 6; else if ((tok = roffhash_find(mdoc->mdocmac, *arg, 0)) == TOKEN_NONE) return; else width = macro2len(tok); free(*arg); mandoc_asprintf(arg, "%zun", width); } static void post_bl_head(POST_ARGS) { struct roff_node *nbl, *nh, *nch, *nnext; struct mdoc_argv *argv; int i, j; post_bl_norm(mdoc); nh = mdoc->last; if (nh->norm->Bl.type != LIST_column) { if ((nch = nh->child) == NULL) return; mandoc_msg(MANDOCERR_ARG_EXCESS, nch->line, nch->pos, "Bl ... %s", nch->string); while (nch != NULL) { roff_node_delete(mdoc, nch); nch = nh->child; } return; } /* * Append old-style lists, where the column width specifiers * trail as macro parameters, to the new-style ("normal-form") * lists where they're argument values following -column. */ if (nh->child == NULL) return; nbl = nh->parent; for (j = 0; j < (int)nbl->args->argc; j++) if (nbl->args->argv[j].arg == MDOC_Column) break; assert(j < (int)nbl->args->argc); /* * Accommodate for new-style groff column syntax. Shuffle the * child nodes, all of which must be TEXT, as arguments for the * column field. Then, delete the head children. */ argv = nbl->args->argv + j; i = argv->sz; for (nch = nh->child; nch != NULL; nch = nch->next) argv->sz++; argv->value = mandoc_reallocarray(argv->value, argv->sz, sizeof(char *)); nh->norm->Bl.ncols = argv->sz; nh->norm->Bl.cols = (void *)argv->value; for (nch = nh->child; nch != NULL; nch = nnext) { argv->value[i++] = nch->string; nch->string = NULL; nnext = nch->next; roff_node_delete(NULL, nch); } nh->child = NULL; } static void post_bl(POST_ARGS) { struct roff_node *nbody; /* of the Bl */ struct roff_node *nchild, *nnext; /* of the Bl body */ const char *prev_Er; int order; nbody = mdoc->last; switch (nbody->type) { case ROFFT_BLOCK: post_bl_block(mdoc); return; case ROFFT_HEAD: post_bl_head(mdoc); return; case ROFFT_BODY: break; default: return; } if (nbody->end != ENDBODY_NOT) return; /* * Up to the first item, move nodes before the list, * but leave transparent nodes where they are * if they precede an item. * The next non-transparent node is kept in nchild. * It only needs to be updated after a non-transparent * node was moved out, and at the very beginning * when no node at all was moved yet. */ nchild = mdoc->last; for (;;) { if (nchild == mdoc->last) nchild = roff_node_child(nbody); if (nchild == NULL) { mdoc->last = nbody; mandoc_msg(MANDOCERR_BLK_EMPTY, nbody->line, nbody->pos, "Bl"); return; } if (nchild->tok == MDOC_It) { mdoc->last = nbody; break; } mandoc_msg(MANDOCERR_BL_MOVE, nbody->child->line, nbody->child->pos, "%s", roff_name[nbody->child->tok]); if (nbody->parent->prev == NULL) { mdoc->last = nbody->parent->parent; mdoc->next = ROFF_NEXT_CHILD; } else { mdoc->last = nbody->parent->prev; mdoc->next = ROFF_NEXT_SIBLING; } roff_node_relink(mdoc, nbody->child); } /* * We have reached the first item, * so moving nodes out is no longer possible. * But in .Bl -column, the first rows may be implicit, * that is, they may not start with .It macros. * Such rows may be followed by nodes generated on the * roff level, for example .TS. * Wrap such roff nodes into an implicit row. */ while (nchild != NULL) { if (nchild->tok == MDOC_It) { nchild = roff_node_next(nchild); continue; } nnext = nchild->next; mdoc->last = nchild->prev; mdoc->next = ROFF_NEXT_SIBLING; roff_block_alloc(mdoc, nchild->line, nchild->pos, MDOC_It); roff_head_alloc(mdoc, nchild->line, nchild->pos, MDOC_It); mdoc->next = ROFF_NEXT_SIBLING; roff_body_alloc(mdoc, nchild->line, nchild->pos, MDOC_It); while (nchild->tok != MDOC_It) { roff_node_relink(mdoc, nchild); if (nnext == NULL) break; nchild = nnext; nnext = nchild->next; mdoc->next = ROFF_NEXT_SIBLING; } mdoc->last = nbody; } if (mdoc->meta.os_e != MANDOC_OS_NETBSD) return; prev_Er = NULL; for (nchild = nbody->child; nchild != NULL; nchild = nchild->next) { if (nchild->tok != MDOC_It) continue; if ((nnext = nchild->head->child) == NULL) continue; if (nnext->type == ROFFT_BLOCK) nnext = nnext->body->child; if (nnext == NULL || nnext->tok != MDOC_Er) continue; nnext = nnext->child; if (prev_Er != NULL) { order = strcmp(prev_Er, nnext->string); if (order > 0) mandoc_msg(MANDOCERR_ER_ORDER, nnext->line, nnext->pos, "Er %s %s (NetBSD)", prev_Er, nnext->string); else if (order == 0) mandoc_msg(MANDOCERR_ER_REP, nnext->line, nnext->pos, "Er %s (NetBSD)", prev_Er); } prev_Er = nnext->string; } } static void post_bk(POST_ARGS) { struct roff_node *n; n = mdoc->last; if (n->type == ROFFT_BLOCK && n->body->child == NULL) { mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, "Bk"); roff_node_delete(mdoc, n); } } static void post_sm(POST_ARGS) { struct roff_node *nch; nch = mdoc->last->child; if (nch == NULL) { mdoc->flags ^= MDOC_SMOFF; return; } assert(nch->type == ROFFT_TEXT); if ( ! strcmp(nch->string, "on")) { mdoc->flags &= ~MDOC_SMOFF; return; } if ( ! strcmp(nch->string, "off")) { mdoc->flags |= MDOC_SMOFF; return; } mandoc_msg(MANDOCERR_SM_BAD, nch->line, nch->pos, "%s %s", roff_name[mdoc->last->tok], nch->string); roff_node_relink(mdoc, nch); return; } static void post_root(POST_ARGS) { struct roff_node *n; /* Add missing prologue data. */ if (mdoc->meta.date == NULL) mdoc->meta.date = mandoc_normdate(NULL, NULL); if (mdoc->meta.title == NULL) { mandoc_msg(MANDOCERR_DT_NOTITLE, 0, 0, "EOF"); mdoc->meta.title = mandoc_strdup("UNTITLED"); } if (mdoc->meta.vol == NULL) mdoc->meta.vol = mandoc_strdup("LOCAL"); if (mdoc->meta.os == NULL) { mandoc_msg(MANDOCERR_OS_MISSING, 0, 0, NULL); mdoc->meta.os = mandoc_strdup(""); } else if (mdoc->meta.os_e && (mdoc->meta.rcsids & (1 << mdoc->meta.os_e)) == 0) mandoc_msg(MANDOCERR_RCS_MISSING, 0, 0, mdoc->meta.os_e == MANDOC_OS_OPENBSD ? "(OpenBSD)" : "(NetBSD)"); if (mdoc->meta.arch != NULL && arch_valid(mdoc->meta.arch, mdoc->meta.os_e) == 0) { n = mdoc->meta.first->child; while (n->tok != MDOC_Dt || n->child == NULL || n->child->next == NULL || n->child->next->next == NULL) n = n->next; n = n->child->next->next; mandoc_msg(MANDOCERR_ARCH_BAD, n->line, n->pos, "Dt ... %s %s", mdoc->meta.arch, mdoc->meta.os_e == MANDOC_OS_OPENBSD ? "(OpenBSD)" : "(NetBSD)"); } /* Check that we begin with a proper `Sh'. */ n = mdoc->meta.first->child; while (n != NULL && (n->type == ROFFT_COMMENT || (n->tok >= MDOC_Dd && mdoc_macro(n->tok)->flags & MDOC_PROLOGUE))) n = n->next; if (n == NULL) mandoc_msg(MANDOCERR_DOC_EMPTY, 0, 0, NULL); else if (n->tok != MDOC_Sh) mandoc_msg(MANDOCERR_SEC_BEFORE, n->line, n->pos, "%s", roff_name[n->tok]); } static void post_rs(POST_ARGS) { struct roff_node *np, *nch, *next, *prev; int i, j; np = mdoc->last; if (np->type != ROFFT_BODY) return; if (np->child == NULL) { mandoc_msg(MANDOCERR_RS_EMPTY, np->line, np->pos, "Rs"); return; } /* * The full `Rs' block needs special handling to order the * sub-elements according to `rsord'. Pick through each element * and correctly order it. This is an insertion sort. */ next = NULL; for (nch = np->child->next; nch != NULL; nch = next) { /* Determine order number of this child. */ for (i = 0; i < RSORD_MAX; i++) if (rsord[i] == nch->tok) break; if (i == RSORD_MAX) { mandoc_msg(MANDOCERR_RS_BAD, nch->line, nch->pos, "%s", roff_name[nch->tok]); i = -1; } else if (nch->tok == MDOC__J || nch->tok == MDOC__B) np->norm->Rs.quote_T++; /* * Remove this child from the chain. This somewhat * repeats roff_node_unlink(), but since we're * just re-ordering, there's no need for the * full unlink process. */ if ((next = nch->next) != NULL) next->prev = nch->prev; if ((prev = nch->prev) != NULL) prev->next = nch->next; nch->prev = nch->next = NULL; /* * Scan back until we reach a node that's * to be ordered before this child. */ for ( ; prev ; prev = prev->prev) { /* Determine order of `prev'. */ for (j = 0; j < RSORD_MAX; j++) if (rsord[j] == prev->tok) break; if (j == RSORD_MAX) j = -1; if (j <= i) break; } /* * Set this child back into its correct place * in front of the `prev' node. */ nch->prev = prev; if (prev == NULL) { np->child->prev = nch; nch->next = np->child; np->child = nch; } else { if (prev->next) prev->next->prev = nch; nch->next = prev->next; prev->next = nch; } } } /* * For some arguments of some macros, * convert all breakable hyphens into ASCII_HYPH. */ static void post_hyph(POST_ARGS) { struct roff_node *n, *nch; char *cp; n = mdoc->last; for (nch = n->child; nch != NULL; nch = nch->next) { if (nch->type != ROFFT_TEXT) continue; cp = nch->string; if (*cp == '\0') continue; while (*(++cp) != '\0') if (*cp == '-' && isalpha((unsigned char)cp[-1]) && isalpha((unsigned char)cp[1])) { if (n->tag == NULL && n->flags & NODE_ID) n->tag = mandoc_strdup(nch->string); *cp = ASCII_HYPH; } } } static void post_ns(POST_ARGS) { struct roff_node *n; n = mdoc->last; if (n->flags & NODE_LINE || (n->next != NULL && n->next->flags & NODE_DELIMC)) mandoc_msg(MANDOCERR_NS_SKIP, n->line, n->pos, NULL); } static void post_sx(POST_ARGS) { post_delim(mdoc); post_hyph(mdoc); } static void post_sh(POST_ARGS) { post_section(mdoc); switch (mdoc->last->type) { case ROFFT_HEAD: post_sh_head(mdoc); break; case ROFFT_BODY: switch (mdoc->lastsec) { case SEC_NAME: post_sh_name(mdoc); break; case SEC_SEE_ALSO: post_sh_see_also(mdoc); break; case SEC_AUTHORS: post_sh_authors(mdoc); break; default: break; } break; default: break; } } static void post_sh_name(POST_ARGS) { struct roff_node *n; int hasnm, hasnd; hasnm = hasnd = 0; for (n = mdoc->last->child; n != NULL; n = n->next) { switch (n->tok) { case MDOC_Nm: if (hasnm && n->child != NULL) mandoc_msg(MANDOCERR_NAMESEC_PUNCT, n->line, n->pos, "Nm %s", n->child->string); hasnm = 1; continue; case MDOC_Nd: hasnd = 1; if (n->next != NULL) mandoc_msg(MANDOCERR_NAMESEC_ND, n->line, n->pos, NULL); break; case TOKEN_NONE: if (n->type == ROFFT_TEXT && n->string[0] == ',' && n->string[1] == '\0' && n->next != NULL && n->next->tok == MDOC_Nm) { n = n->next; continue; } /* FALLTHROUGH */ default: mandoc_msg(MANDOCERR_NAMESEC_BAD, n->line, n->pos, "%s", roff_name[n->tok]); continue; } break; } if ( ! hasnm) mandoc_msg(MANDOCERR_NAMESEC_NONM, mdoc->last->line, mdoc->last->pos, NULL); if ( ! hasnd) mandoc_msg(MANDOCERR_NAMESEC_NOND, mdoc->last->line, mdoc->last->pos, NULL); } static void post_sh_see_also(POST_ARGS) { const struct roff_node *n; const char *name, *sec; const char *lastname, *lastsec, *lastpunct; int cmp; n = mdoc->last->child; lastname = lastsec = lastpunct = NULL; while (n != NULL) { if (n->tok != MDOC_Xr || n->child == NULL || n->child->next == NULL) break; /* Process one .Xr node. */ name = n->child->string; sec = n->child->next->string; if (lastsec != NULL) { if (lastpunct[0] != ',' || lastpunct[1] != '\0') mandoc_msg(MANDOCERR_XR_PUNCT, n->line, n->pos, "%s before %s(%s)", lastpunct, name, sec); cmp = strcmp(lastsec, sec); if (cmp > 0) mandoc_msg(MANDOCERR_XR_ORDER, n->line, n->pos, "%s(%s) after %s(%s)", name, sec, lastname, lastsec); else if (cmp == 0 && strcasecmp(lastname, name) > 0) mandoc_msg(MANDOCERR_XR_ORDER, n->line, n->pos, "%s after %s", name, lastname); } lastname = name; lastsec = sec; /* Process the following node. */ n = n->next; if (n == NULL) break; if (n->tok == MDOC_Xr) { lastpunct = "none"; continue; } if (n->type != ROFFT_TEXT) break; for (name = n->string; *name != '\0'; name++) if (isalpha((const unsigned char)*name)) return; lastpunct = n->string; if (n->next == NULL || n->next->tok == MDOC_Rs) mandoc_msg(MANDOCERR_XR_PUNCT, n->line, n->pos, "%s after %s(%s)", lastpunct, lastname, lastsec); n = n->next; } } static int child_an(const struct roff_node *n) { for (n = n->child; n != NULL; n = n->next) if ((n->tok == MDOC_An && n->child != NULL) || child_an(n)) return 1; return 0; } static void post_sh_authors(POST_ARGS) { if ( ! child_an(mdoc->last)) mandoc_msg(MANDOCERR_AN_MISSING, mdoc->last->line, mdoc->last->pos, NULL); } /* * Return an upper bound for the string distance (allowing * transpositions). Not a full Levenshtein implementation * because Levenshtein is quadratic in the string length * and this function is called for every standard name, * so the check for each custom name would be cubic. * The following crude heuristics is linear, resulting * in quadratic behaviour for checking one custom name, * which does not cause measurable slowdown. */ static int similar(const char *s1, const char *s2) { const int maxdist = 3; int dist = 0; while (s1[0] != '\0' && s2[0] != '\0') { if (s1[0] == s2[0]) { s1++; s2++; continue; } if (++dist > maxdist) return INT_MAX; if (s1[1] == s2[1]) { /* replacement */ s1++; s2++; } else if (s1[0] == s2[1] && s1[1] == s2[0]) { s1 += 2; /* transposition */ s2 += 2; } else if (s1[0] == s2[1]) /* insertion */ s2++; else if (s1[1] == s2[0]) /* deletion */ s1++; else return INT_MAX; } dist += strlen(s1) + strlen(s2); return dist > maxdist ? INT_MAX : dist; } static void post_sh_head(POST_ARGS) { struct roff_node *nch; const char *goodsec; const char *const *testsec; int dist, mindist; enum roff_sec sec; /* * Process a new section. Sections are either "named" or * "custom". Custom sections are user-defined, while named ones * follow a conventional order and may only appear in certain * manual sections. */ sec = mdoc->last->sec; /* The NAME should be first. */ if (sec != SEC_NAME && mdoc->lastnamed == SEC_NONE) mandoc_msg(MANDOCERR_NAMESEC_FIRST, mdoc->last->line, mdoc->last->pos, "Sh %s", sec != SEC_CUSTOM ? secnames[sec] : (nch = mdoc->last->child) == NULL ? "" : nch->type == ROFFT_TEXT ? nch->string : roff_name[nch->tok]); /* The SYNOPSIS gets special attention in other areas. */ if (sec == SEC_SYNOPSIS) { roff_setreg(mdoc->roff, "nS", 1, '='); mdoc->flags |= MDOC_SYNOPSIS; } else { roff_setreg(mdoc->roff, "nS", 0, '='); mdoc->flags &= ~MDOC_SYNOPSIS; } if (sec == SEC_DESCRIPTION) fn_prio = TAG_STRONG; /* Mark our last section. */ mdoc->lastsec = sec; /* We don't care about custom sections after this. */ if (sec == SEC_CUSTOM) { if ((nch = mdoc->last->child) == NULL || nch->type != ROFFT_TEXT || nch->next != NULL) return; goodsec = NULL; mindist = INT_MAX; for (testsec = secnames + 1; *testsec != NULL; testsec++) { dist = similar(nch->string, *testsec); if (dist < mindist) { goodsec = *testsec; mindist = dist; } } if (goodsec != NULL) mandoc_msg(MANDOCERR_SEC_TYPO, nch->line, nch->pos, "Sh %s instead of %s", nch->string, goodsec); return; } /* * Check whether our non-custom section is being repeated or is * out of order. */ if (sec == mdoc->lastnamed) mandoc_msg(MANDOCERR_SEC_REP, mdoc->last->line, mdoc->last->pos, "Sh %s", secnames[sec]); if (sec < mdoc->lastnamed) mandoc_msg(MANDOCERR_SEC_ORDER, mdoc->last->line, mdoc->last->pos, "Sh %s", secnames[sec]); /* Mark the last named section. */ mdoc->lastnamed = sec; /* Check particular section/manual conventions. */ if (mdoc->meta.msec == NULL) return; goodsec = NULL; switch (sec) { case SEC_ERRORS: if (*mdoc->meta.msec == '4') break; goodsec = "2, 3, 4, 9"; /* FALLTHROUGH */ case SEC_RETURN_VALUES: case SEC_LIBRARY: if (*mdoc->meta.msec == '2') break; if (*mdoc->meta.msec == '3') break; if (NULL == goodsec) goodsec = "2, 3, 9"; /* FALLTHROUGH */ case SEC_CONTEXT: if (*mdoc->meta.msec == '9') break; if (NULL == goodsec) goodsec = "9"; mandoc_msg(MANDOCERR_SEC_MSEC, mdoc->last->line, mdoc->last->pos, "Sh %s for %s only", secnames[sec], goodsec); break; default: break; } } static void post_xr(POST_ARGS) { struct roff_node *n, *nch; n = mdoc->last; nch = n->child; if (nch->next == NULL) { mandoc_msg(MANDOCERR_XR_NOSEC, n->line, n->pos, "Xr %s", nch->string); } else { assert(nch->next == n->last); if(mandoc_xr_add(nch->next->string, nch->string, nch->line, nch->pos)) mandoc_msg(MANDOCERR_XR_SELF, nch->line, nch->pos, "Xr %s %s", nch->string, nch->next->string); } post_delim_nb(mdoc); } static void post_section(POST_ARGS) { struct roff_node *n, *nch; char *cp, *tag; n = mdoc->last; switch (n->type) { case ROFFT_BLOCK: post_prevpar(mdoc); return; case ROFFT_HEAD: tag = NULL; deroff(&tag, n); if (tag != NULL) { for (cp = tag; *cp != '\0'; cp++) if (*cp == ' ') *cp = '_'; if ((nch = n->child) != NULL && nch->type == ROFFT_TEXT && strcmp(nch->string, tag) == 0) tag_put(NULL, TAG_STRONG, n); else tag_put(tag, TAG_FALLBACK, n); free(tag); } post_delim(mdoc); post_hyph(mdoc); return; case ROFFT_BODY: break; default: return; } if ((nch = n->child) != NULL && (nch->tok == MDOC_Pp || nch->tok == ROFF_br || nch->tok == ROFF_sp)) { mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos, "%s after %s", roff_name[nch->tok], roff_name[n->tok]); roff_node_delete(mdoc, nch); } if ((nch = n->last) != NULL && (nch->tok == MDOC_Pp || nch->tok == ROFF_br)) { mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos, "%s at the end of %s", roff_name[nch->tok], roff_name[n->tok]); roff_node_delete(mdoc, nch); } } static void post_prevpar(POST_ARGS) { struct roff_node *n, *np; n = mdoc->last; if (n->type != ROFFT_ELEM && n->type != ROFFT_BLOCK) return; if ((np = roff_node_prev(n)) == NULL) return; /* * Don't allow `Pp' prior to a paragraph-type * block: `Pp' or non-compact `Bd' or `Bl'. */ if (np->tok != MDOC_Pp && np->tok != ROFF_br) return; if (n->tok == MDOC_Bl && n->norm->Bl.comp) return; if (n->tok == MDOC_Bd && n->norm->Bd.comp) return; if (n->tok == MDOC_It && n->parent->norm->Bl.comp) return; mandoc_msg(MANDOCERR_PAR_SKIP, np->line, np->pos, "%s before %s", roff_name[np->tok], roff_name[n->tok]); roff_node_delete(mdoc, np); } static void post_par(POST_ARGS) { struct roff_node *np; fn_prio = TAG_STRONG; post_prevpar(mdoc); np = mdoc->last; if (np->child != NULL) mandoc_msg(MANDOCERR_ARG_SKIP, np->line, np->pos, "%s %s", roff_name[np->tok], np->child->string); } static void post_dd(POST_ARGS) { struct roff_node *n; n = mdoc->last; n->flags |= NODE_NOPRT; if (mdoc->meta.date != NULL) { mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Dd"); free(mdoc->meta.date); } else if (mdoc->flags & MDOC_PBODY) mandoc_msg(MANDOCERR_PROLOG_LATE, n->line, n->pos, "Dd"); else if (mdoc->meta.title != NULL) mandoc_msg(MANDOCERR_PROLOG_ORDER, n->line, n->pos, "Dd after Dt"); else if (mdoc->meta.os != NULL) mandoc_msg(MANDOCERR_PROLOG_ORDER, n->line, n->pos, "Dd after Os"); if (mdoc->quick && n != NULL) mdoc->meta.date = mandoc_strdup(""); else mdoc->meta.date = mandoc_normdate(n->child, n); } static void post_dt(POST_ARGS) { struct roff_node *nn, *n; const char *cp; char *p; n = mdoc->last; n->flags |= NODE_NOPRT; if (mdoc->flags & MDOC_PBODY) { mandoc_msg(MANDOCERR_DT_LATE, n->line, n->pos, "Dt"); return; } if (mdoc->meta.title != NULL) mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Dt"); else if (mdoc->meta.os != NULL) mandoc_msg(MANDOCERR_PROLOG_ORDER, n->line, n->pos, "Dt after Os"); free(mdoc->meta.title); free(mdoc->meta.msec); free(mdoc->meta.vol); free(mdoc->meta.arch); mdoc->meta.title = NULL; mdoc->meta.msec = NULL; mdoc->meta.vol = NULL; mdoc->meta.arch = NULL; /* Mandatory first argument: title. */ nn = n->child; if (nn == NULL || *nn->string == '\0') { mandoc_msg(MANDOCERR_DT_NOTITLE, n->line, n->pos, "Dt"); mdoc->meta.title = mandoc_strdup("UNTITLED"); } else { mdoc->meta.title = mandoc_strdup(nn->string); /* Check that all characters are uppercase. */ for (p = nn->string; *p != '\0'; p++) if (islower((unsigned char)*p)) { mandoc_msg(MANDOCERR_TITLE_CASE, nn->line, nn->pos + (int)(p - nn->string), "Dt %s", nn->string); break; } } /* Mandatory second argument: section. */ if (nn != NULL) nn = nn->next; if (nn == NULL) { mandoc_msg(MANDOCERR_MSEC_MISSING, n->line, n->pos, "Dt %s", mdoc->meta.title); mdoc->meta.vol = mandoc_strdup("LOCAL"); return; /* msec and arch remain NULL. */ } mdoc->meta.msec = mandoc_strdup(nn->string); /* Infer volume title from section number. */ cp = mandoc_a2msec(nn->string); if (cp == NULL) { mandoc_msg(MANDOCERR_MSEC_BAD, nn->line, nn->pos, "Dt ... %s", nn->string); mdoc->meta.vol = mandoc_strdup(nn->string); } else { mdoc->meta.vol = mandoc_strdup(cp); if (mdoc->filesec != '\0' && mdoc->filesec != *nn->string && *nn->string >= '1' && *nn->string <= '9') mandoc_msg(MANDOCERR_MSEC_FILE, nn->line, nn->pos, "*.%c vs Dt ... %c", mdoc->filesec, *nn->string); } /* Optional third argument: architecture. */ if ((nn = nn->next) == NULL) return; for (p = nn->string; *p != '\0'; p++) *p = tolower((unsigned char)*p); mdoc->meta.arch = mandoc_strdup(nn->string); /* Ignore fourth and later arguments. */ if ((nn = nn->next) != NULL) mandoc_msg(MANDOCERR_ARG_EXCESS, nn->line, nn->pos, "Dt ... %s", nn->string); } static void post_bx(POST_ARGS) { struct roff_node *n, *nch; const char *macro; post_delim_nb(mdoc); n = mdoc->last; nch = n->child; if (nch != NULL) { macro = !strcmp(nch->string, "Open") ? "Ox" : !strcmp(nch->string, "Net") ? "Nx" : !strcmp(nch->string, "Free") ? "Fx" : !strcmp(nch->string, "DragonFly") ? "Dx" : NULL; if (macro != NULL) mandoc_msg(MANDOCERR_BX, n->line, n->pos, "%s", macro); mdoc->last = nch; nch = nch->next; mdoc->next = ROFF_NEXT_SIBLING; roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); mdoc->last->flags |= NODE_NOSRC; mdoc->next = ROFF_NEXT_SIBLING; } else mdoc->next = ROFF_NEXT_CHILD; roff_word_alloc(mdoc, n->line, n->pos, "BSD"); mdoc->last->flags |= NODE_NOSRC; if (nch == NULL) { mdoc->last = n; return; } roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); mdoc->last->flags |= NODE_NOSRC; mdoc->next = ROFF_NEXT_SIBLING; roff_word_alloc(mdoc, n->line, n->pos, "-"); mdoc->last->flags |= NODE_NOSRC; roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); mdoc->last->flags |= NODE_NOSRC; mdoc->last = n; /* * Make `Bx's second argument always start with an uppercase * letter. Groff checks if it's an "accepted" term, but we just * uppercase blindly. */ *nch->string = (char)toupper((unsigned char)*nch->string); } static void post_os(POST_ARGS) { #ifndef OSNAME struct utsname utsname; static char *defbuf; #endif struct roff_node *n; n = mdoc->last; n->flags |= NODE_NOPRT; if (mdoc->meta.os != NULL) mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Os"); else if (mdoc->flags & MDOC_PBODY) mandoc_msg(MANDOCERR_PROLOG_LATE, n->line, n->pos, "Os"); post_delim(mdoc); /* * Set the operating system by way of the `Os' macro. * The order of precedence is: * 1. the argument of the `Os' macro, unless empty * 2. the -Ios=foo command line argument, if provided * 3. -DOSNAME="\"foo\"", if provided during compilation * 4. "sysname release" from uname(3) */ free(mdoc->meta.os); mdoc->meta.os = NULL; deroff(&mdoc->meta.os, n); if (mdoc->meta.os) goto out; if (mdoc->os_s != NULL) { mdoc->meta.os = mandoc_strdup(mdoc->os_s); goto out; } #ifdef OSNAME mdoc->meta.os = mandoc_strdup(OSNAME); #else /*!OSNAME */ if (defbuf == NULL) { if (uname(&utsname) == -1) { mandoc_msg(MANDOCERR_OS_UNAME, n->line, n->pos, "Os"); defbuf = mandoc_strdup("UNKNOWN"); } else mandoc_asprintf(&defbuf, "%s %s", utsname.sysname, utsname.release); } mdoc->meta.os = mandoc_strdup(defbuf); #endif /*!OSNAME*/ out: if (mdoc->meta.os_e == MANDOC_OS_OTHER) { if (strstr(mdoc->meta.os, "OpenBSD") != NULL) mdoc->meta.os_e = MANDOC_OS_OPENBSD; else if (strstr(mdoc->meta.os, "NetBSD") != NULL) mdoc->meta.os_e = MANDOC_OS_NETBSD; } /* * This is the earliest point where we can check * Mdocdate conventions because we don't know * the operating system earlier. */ if (n->child != NULL) mandoc_msg(MANDOCERR_OS_ARG, n->child->line, n->child->pos, "Os %s (%s)", n->child->string, mdoc->meta.os_e == MANDOC_OS_OPENBSD ? "OpenBSD" : "NetBSD"); while (n->tok != MDOC_Dd) if ((n = n->prev) == NULL) return; if ((n = n->child) == NULL) return; if (strncmp(n->string, "$" "Mdocdate", 9)) { if (mdoc->meta.os_e == MANDOC_OS_OPENBSD) mandoc_msg(MANDOCERR_MDOCDATE_MISSING, n->line, n->pos, "Dd %s (OpenBSD)", n->string); } else { if (mdoc->meta.os_e == MANDOC_OS_NETBSD) mandoc_msg(MANDOCERR_MDOCDATE, n->line, n->pos, "Dd %s (NetBSD)", n->string); } } enum roff_sec mdoc_a2sec(const char *p) { int i; for (i = 0; i < (int)SEC__MAX; i++) if (secnames[i] && 0 == strcmp(p, secnames[i])) return (enum roff_sec)i; return SEC_CUSTOM; } static size_t macro2len(enum roff_tok macro) { switch (macro) { case MDOC_Ad: return 12; case MDOC_Ao: return 12; case MDOC_An: return 12; case MDOC_Aq: return 12; case MDOC_Ar: return 12; case MDOC_Bo: return 12; case MDOC_Bq: return 12; case MDOC_Cd: return 12; case MDOC_Cm: return 10; case MDOC_Do: return 10; case MDOC_Dq: return 12; case MDOC_Dv: return 12; case MDOC_Eo: return 12; case MDOC_Em: return 10; case MDOC_Er: return 17; case MDOC_Ev: return 15; case MDOC_Fa: return 12; case MDOC_Fl: return 10; case MDOC_Fo: return 16; case MDOC_Fn: return 16; case MDOC_Ic: return 10; case MDOC_Li: return 16; case MDOC_Ms: return 6; case MDOC_Nm: return 10; case MDOC_No: return 12; case MDOC_Oo: return 10; case MDOC_Op: return 14; case MDOC_Pa: return 32; case MDOC_Pf: return 12; case MDOC_Po: return 12; case MDOC_Pq: return 12; case MDOC_Ql: return 16; case MDOC_Qo: return 12; case MDOC_So: return 12; case MDOC_Sq: return 12; case MDOC_Sy: return 6; case MDOC_Sx: return 16; case MDOC_Tn: return 10; case MDOC_Va: return 12; case MDOC_Vt: return 12; case MDOC_Xr: return 10; default: break; }; return 0; } mandoc-1.14.6/msec.c010064400017530001753000000021411412314055300144400ustar00schwarzeschwarze/* $Id: msec.c,v 1.16 2018/12/14 01:18:26 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include "mandoc.h" #include "libmandoc.h" #define LINE(x, y) \ if (0 == strcmp(p, x)) return(y); const char * mandoc_a2msec(const char *p) { #include "msec.in" return NULL; } mandoc-1.14.6/out.c010064400017530001753000000322241412314055300143250ustar00schwarzeschwarze/* $Id: out.c,v 1.82 2021/09/07 17:07:58 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014, 2015, 2017, 2018, 2019, 2021 * Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "tbl.h" #include "out.h" struct tbl_colgroup { struct tbl_colgroup *next; size_t wanted; int startcol; int endcol; }; static size_t tblcalc_data(struct rofftbl *, struct roffcol *, const struct tbl_opts *, const struct tbl_dat *, size_t); static size_t tblcalc_literal(struct rofftbl *, struct roffcol *, const struct tbl_dat *, size_t); static size_t tblcalc_number(struct rofftbl *, struct roffcol *, const struct tbl_opts *, const struct tbl_dat *); /* * Parse the *src string and store a scaling unit into *dst. * If the string doesn't specify the unit, use the default. * If no default is specified, fail. * Return a pointer to the byte after the last byte used, * or NULL on total failure. */ const char * a2roffsu(const char *src, struct roffsu *dst, enum roffscale def) { char *endptr; dst->unit = def == SCALE_MAX ? SCALE_BU : def; dst->scale = strtod(src, &endptr); if (endptr == src) return NULL; switch (*endptr++) { case 'c': dst->unit = SCALE_CM; break; case 'i': dst->unit = SCALE_IN; break; case 'f': dst->unit = SCALE_FS; break; case 'M': dst->unit = SCALE_MM; break; case 'm': dst->unit = SCALE_EM; break; case 'n': dst->unit = SCALE_EN; break; case 'P': dst->unit = SCALE_PC; break; case 'p': dst->unit = SCALE_PT; break; case 'u': dst->unit = SCALE_BU; break; case 'v': dst->unit = SCALE_VS; break; default: endptr--; if (SCALE_MAX == def) return NULL; dst->unit = def; break; } return endptr; } /* * Calculate the abstract widths and decimal positions of columns in a * table. This routine allocates the columns structures then runs over * all rows and cells in the table. The function pointers in "tbl" are * used for the actual width calculations. */ void tblcalc(struct rofftbl *tbl, const struct tbl_span *sp_first, size_t offset, size_t rmargin) { struct roffsu su; const struct tbl_opts *opts; const struct tbl_span *sp; const struct tbl_dat *dp; struct roffcol *col; struct tbl_colgroup *first_group, **gp, *g; size_t ewidth, min1, min2, wanted, width, xwidth; int done, icol, maxcol, necol, nxcol, quirkcol; /* * Allocate the master column specifiers. These will hold the * widths and decimal positions for all cells in the column. It * must be freed and nullified by the caller. */ assert(tbl->cols == NULL); tbl->cols = mandoc_calloc((size_t)sp_first->opts->cols, sizeof(struct roffcol)); opts = sp_first->opts; maxcol = -1; first_group = NULL; for (sp = sp_first; sp != NULL; sp = sp->next) { if (sp->pos != TBL_SPAN_DATA) continue; /* * Account for the data cells in the layout, matching it * to data cells in the data section. */ gp = &first_group; for (dp = sp->first; dp != NULL; dp = dp->next) { icol = dp->layout->col; while (maxcol < icol + dp->hspans) tbl->cols[++maxcol].spacing = SIZE_MAX; col = tbl->cols + icol; col->flags |= dp->layout->flags; if (dp->layout->flags & TBL_CELL_WIGN) continue; /* Handle explicit width specifications. */ if (dp->layout->wstr != NULL && dp->layout->width == 0 && a2roffsu(dp->layout->wstr, &su, SCALE_EN) != NULL) dp->layout->width = (*tbl->sulen)(&su, tbl->arg); if (col->width < dp->layout->width) col->width = dp->layout->width; if (dp->layout->spacing != SIZE_MAX && (col->spacing == SIZE_MAX || col->spacing < dp->layout->spacing)) col->spacing = dp->layout->spacing; /* * Calculate an automatic width. * Except for spanning cells, apply it. */ width = tblcalc_data(tbl, dp->hspans == 0 ? col : NULL, opts, dp, dp->block == 0 ? 0 : dp->layout->width ? dp->layout->width : rmargin ? (rmargin + sp->opts->cols / 2) / (sp->opts->cols + 1) : 0); if (dp->hspans == 0) continue; /* * Build an ordered, singly linked list * of all groups of columns joined by spans, * recording the minimum width for each group. */ while (*gp != NULL && ((*gp)->startcol < icol || (*gp)->endcol < icol + dp->hspans)) gp = &(*gp)->next; if (*gp == NULL || (*gp)->startcol > icol || (*gp)->endcol > icol + dp->hspans) { g = mandoc_malloc(sizeof(*g)); g->next = *gp; g->wanted = width; g->startcol = icol; g->endcol = icol + dp->hspans; *gp = g; } else if ((*gp)->wanted < width) (*gp)->wanted = width; } } /* * The minimum width of columns explicitly specified * in the layout is 1n. */ if (maxcol < sp_first->opts->cols - 1) maxcol = sp_first->opts->cols - 1; for (icol = 0; icol <= maxcol; icol++) { col = tbl->cols + icol; if (col->width < 1) col->width = 1; /* * Column spacings are needed for span width * calculations, so set the default values now. */ if (col->spacing == SIZE_MAX || icol == maxcol) col->spacing = 3; } /* * Replace the minimum widths with the missing widths, * and dismiss groups that are already wide enough. */ gp = &first_group; while ((g = *gp) != NULL) { done = 0; for (icol = g->startcol; icol <= g->endcol; icol++) { width = tbl->cols[icol].width; if (icol < g->endcol) width += tbl->cols[icol].spacing; if (g->wanted <= width) { done = 1; break; } else (*gp)->wanted -= width; } if (done) { *gp = g->next; free(g); } else gp = &(*gp)->next; } while (first_group != NULL) { /* * Find the smallest and second smallest column width * among the columns which may need expamsion. */ min1 = min2 = SIZE_MAX; for (icol = 0; icol <= maxcol; icol++) { width = tbl->cols[icol].width; if (min1 > width) { min2 = min1; min1 = width; } else if (min1 < width && min2 > width) min2 = width; } /* * Find the minimum wanted width * for any one of the narrowest columns, * and mark the columns wanting that width. */ wanted = min2; for (g = first_group; g != NULL; g = g->next) { necol = 0; for (icol = g->startcol; icol <= g->endcol; icol++) if (tbl->cols[icol].width == min1) necol++; if (necol == 0) continue; width = min1 + (g->wanted - 1) / necol + 1; if (width > min2) width = min2; if (wanted > width) wanted = width; } /* Record the effect of the widening. */ gp = &first_group; while ((g = *gp) != NULL) { done = 0; for (icol = g->startcol; icol <= g->endcol; icol++) { if (tbl->cols[icol].width != min1) continue; if (g->wanted <= wanted - min1) { tbl->cols[icol].width += g->wanted; done = 1; break; } tbl->cols[icol].width = wanted; g->wanted -= wanted - min1; } if (done) { *gp = g->next; free(g); } else gp = &(*gp)->next; } } /* * Align numbers with text. * Count columns to equalize and columns to maximize. * Find maximum width of the columns to equalize. * Find total width of the columns *not* to maximize. */ necol = nxcol = 0; ewidth = xwidth = 0; for (icol = 0; icol <= maxcol; icol++) { col = tbl->cols + icol; if (col->width > col->nwidth) col->decimal += (col->width - col->nwidth) / 2; if (col->flags & TBL_CELL_EQUAL) { necol++; if (ewidth < col->width) ewidth = col->width; } if (col->flags & TBL_CELL_WMAX) nxcol++; else xwidth += col->width; } /* * Equalize columns, if requested for any of them. * Update total width of the columns not to maximize. */ if (necol) { for (icol = 0; icol <= maxcol; icol++) { col = tbl->cols + icol; if ( ! (col->flags & TBL_CELL_EQUAL)) continue; if (col->width == ewidth) continue; if (nxcol && rmargin) xwidth += ewidth - col->width; col->width = ewidth; } } /* * If there are any columns to maximize, find the total * available width, deducting 3n margins between columns. * Distribute the available width evenly. */ if (nxcol && rmargin) { xwidth += 3*maxcol + (opts->opts & (TBL_OPT_BOX | TBL_OPT_DBOX) ? 2 : !!opts->lvert + !!opts->rvert); if (rmargin <= offset + xwidth) return; xwidth = rmargin - offset - xwidth; /* * Emulate a bug in GNU tbl width calculation that * manifests itself for large numbers of x-columns. * Emulating it for 5 x-columns gives identical * behaviour for up to 6 x-columns. */ if (nxcol == 5) { quirkcol = xwidth % nxcol + 2; if (quirkcol != 3 && quirkcol != 4) quirkcol = -1; } else quirkcol = -1; necol = 0; ewidth = 0; for (icol = 0; icol <= maxcol; icol++) { col = tbl->cols + icol; if ( ! (col->flags & TBL_CELL_WMAX)) continue; col->width = (double)xwidth * ++necol / nxcol - ewidth + 0.4995; if (necol == quirkcol) col->width--; ewidth += col->width; } } } static size_t tblcalc_data(struct rofftbl *tbl, struct roffcol *col, const struct tbl_opts *opts, const struct tbl_dat *dp, size_t mw) { size_t sz; /* Branch down into data sub-types. */ switch (dp->layout->pos) { case TBL_CELL_HORIZ: case TBL_CELL_DHORIZ: sz = (*tbl->len)(1, tbl->arg); if (col != NULL && col->width < sz) col->width = sz; return sz; case TBL_CELL_LONG: case TBL_CELL_CENTRE: case TBL_CELL_LEFT: case TBL_CELL_RIGHT: return tblcalc_literal(tbl, col, dp, mw); case TBL_CELL_NUMBER: return tblcalc_number(tbl, col, opts, dp); case TBL_CELL_DOWN: return 0; default: abort(); } } static size_t tblcalc_literal(struct rofftbl *tbl, struct roffcol *col, const struct tbl_dat *dp, size_t mw) { const char *str; /* Beginning of the first line. */ const char *beg; /* Beginning of the current line. */ char *end; /* End of the current line. */ size_t lsz; /* Length of the current line. */ size_t wsz; /* Length of the current word. */ size_t msz; /* Length of the longest line. */ if (dp->string == NULL || *dp->string == '\0') return 0; str = mw ? mandoc_strdup(dp->string) : dp->string; msz = lsz = 0; for (beg = str; beg != NULL && *beg != '\0'; beg = end) { end = mw ? strchr(beg, ' ') : NULL; if (end != NULL) { *end++ = '\0'; while (*end == ' ') end++; } wsz = (*tbl->slen)(beg, tbl->arg); if (mw && lsz && lsz + 1 + wsz <= mw) lsz += 1 + wsz; else lsz = wsz; if (msz < lsz) msz = lsz; } if (mw) free((void *)str); if (col != NULL && col->width < msz) col->width = msz; return msz; } static size_t tblcalc_number(struct rofftbl *tbl, struct roffcol *col, const struct tbl_opts *opts, const struct tbl_dat *dp) { const char *cp, *lastdigit, *lastpoint; size_t intsz, totsz; char buf[2]; if (dp->string == NULL || *dp->string == '\0') return 0; totsz = (*tbl->slen)(dp->string, tbl->arg); if (col == NULL) return totsz; /* * Find the last digit and * the last decimal point that is adjacent to a digit. * The alignment indicator "\&" overrides everything. */ lastdigit = lastpoint = NULL; for (cp = dp->string; cp[0] != '\0'; cp++) { if (cp[0] == '\\' && cp[1] == '&') { lastdigit = lastpoint = cp; break; } else if (cp[0] == opts->decimal && (isdigit((unsigned char)cp[1]) || (cp > dp->string && isdigit((unsigned char)cp[-1])))) lastpoint = cp; else if (isdigit((unsigned char)cp[0])) lastdigit = cp; } /* Not a number, treat as a literal string. */ if (lastdigit == NULL) { if (col != NULL && col->width < totsz) col->width = totsz; return totsz; } /* Measure the width of the integer part. */ if (lastpoint == NULL) lastpoint = lastdigit + 1; intsz = 0; buf[1] = '\0'; for (cp = dp->string; cp < lastpoint; cp++) { buf[0] = cp[0]; intsz += (*tbl->slen)(buf, tbl->arg); } /* * If this number has more integer digits than all numbers * seen on earlier lines, shift them all to the right. * If it has fewer, shift this number to the right. */ if (intsz > col->decimal) { col->nwidth += intsz - col->decimal; col->decimal = intsz; } else totsz += col->decimal - intsz; /* Update the maximum total width seen so far. */ if (totsz > col->nwidth) col->nwidth = totsz; if (col->nwidth > col->width) col->width = col->nwidth; return totsz; } mandoc-1.14.6/preconv.c010064400017530001753000000075411412314055300151760ustar00schwarzeschwarze/* $Id: preconv.c,v 1.17 2018/12/13 11:55:47 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include "mandoc.h" #include "roff.h" #include "mandoc_parse.h" #include "libmandoc.h" int preconv_encode(const struct buf *ib, size_t *ii, struct buf *ob, size_t *oi, int *filenc) { const unsigned char *cu; int nby; unsigned int accum; cu = (const unsigned char *)ib->buf + *ii; assert(*cu & 0x80); if ( ! (*filenc & MPARSE_UTF8)) goto latin; nby = 1; while (nby < 5 && *cu & (1 << (7 - nby))) nby++; switch (nby) { case 2: accum = *cu & 0x1f; if (accum < 0x02) /* Obfuscated ASCII. */ goto latin; break; case 3: accum = *cu & 0x0f; break; case 4: accum = *cu & 0x07; if (accum > 0x04) /* Beyond Unicode. */ goto latin; break; default: /* Bad sequence header. */ goto latin; } cu++; switch (nby) { case 3: if ((accum == 0x00 && ! (*cu & 0x20)) || /* Use 2-byte. */ (accum == 0x0d && *cu & 0x20)) /* Surrogates. */ goto latin; break; case 4: if ((accum == 0x00 && ! (*cu & 0x30)) || /* Use 3-byte. */ (accum == 0x04 && *cu & 0x30)) /* Beyond Unicode. */ goto latin; break; default: break; } while (--nby) { if ((*cu & 0xc0) != 0x80) /* Invalid continuation. */ goto latin; accum <<= 6; accum += *cu & 0x3f; cu++; } assert(accum > 0x7f); assert(accum < 0x110000); assert(accum < 0xd800 || accum > 0xdfff); *oi += snprintf(ob->buf + *oi, 11, "\\[u%.4X]", accum); *ii = (const char *)cu - ib->buf; *filenc &= ~MPARSE_LATIN1; return 1; latin: if ( ! (*filenc & MPARSE_LATIN1)) return 0; *oi += snprintf(ob->buf + *oi, 11, "\\[u%.4X]", (unsigned char)ib->buf[(*ii)++]); *filenc &= ~MPARSE_UTF8; return 1; } int preconv_cue(const struct buf *b, size_t offset) { const char *ln, *eoln, *eoph; size_t sz, phsz; ln = b->buf + offset; sz = b->sz - offset; /* Look for the end-of-line. */ if (NULL == (eoln = memchr(ln, '\n', sz))) eoln = ln + sz; /* Check if we have the correct header/trailer. */ if ((sz = (size_t)(eoln - ln)) < 10 || memcmp(ln, ".\\\" -*-", 7) || memcmp(eoln - 3, "-*-", 3)) return MPARSE_UTF8 | MPARSE_LATIN1; /* Move after the header and adjust for the trailer. */ ln += 7; sz -= 10; while (sz > 0) { while (sz > 0 && ' ' == *ln) { ln++; sz--; } if (0 == sz) break; /* Find the end-of-phrase marker (or eoln). */ if (NULL == (eoph = memchr(ln, ';', sz))) eoph = eoln - 3; else eoph++; /* Only account for the "coding" phrase. */ if ((phsz = eoph - ln) < 7 || strncasecmp(ln, "coding:", 7)) { sz -= phsz; ln += phsz; continue; } sz -= 7; ln += 7; while (sz > 0 && ' ' == *ln) { ln++; sz--; } if (0 == sz) return 0; /* Check us against known encodings. */ if (phsz > 4 && !strncasecmp(ln, "utf-8", 5)) return MPARSE_UTF8; if (phsz > 10 && !strncasecmp(ln, "iso-latin-1", 11)) return MPARSE_LATIN1; return 0; } return MPARSE_UTF8 | MPARSE_LATIN1; } mandoc-1.14.6/read.c010064400017530001753000000422151412314055300144320ustar00schwarzeschwarze/* $Id: read.c,v 1.220 2021/06/27 17:57:54 schwarze Exp $ */ /* * Copyright (c) 2010-2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Top-level functions of the mandoc(3) parser: * Parser and input encoding selection, decompression, * handling of input bytes, characters, lines, and files, * handling of roff(7) loops and file inclusion, * and steering of the various parsers. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "man.h" #include "mandoc_parse.h" #include "libmandoc.h" #include "roff_int.h" #include "tag.h" #define REPARSE_LIMIT 1000 struct mparse { struct roff *roff; /* roff parser (!NULL) */ struct roff_man *man; /* man parser */ struct buf *primary; /* buffer currently being parsed */ struct buf *secondary; /* copy of top level input */ struct buf *loop; /* open .while request line */ const char *os_s; /* default operating system */ int options; /* parser options */ int gzip; /* current input file is gzipped */ int filenc; /* encoding of the current file */ int reparse_count; /* finite interp. stack */ int line; /* line number in the file */ }; static void choose_parser(struct mparse *); static void free_buf_list(struct buf *); static void resize_buf(struct buf *, size_t); static int mparse_buf_r(struct mparse *, struct buf, size_t, int); static int read_whole_file(struct mparse *, int, struct buf *, int *); static void mparse_end(struct mparse *); static void resize_buf(struct buf *buf, size_t initial) { buf->sz = buf->sz > initial/2 ? 2 * buf->sz : initial; buf->buf = mandoc_realloc(buf->buf, buf->sz); } static void free_buf_list(struct buf *buf) { struct buf *tmp; while (buf != NULL) { tmp = buf; buf = tmp->next; free(tmp->buf); free(tmp); } } static void choose_parser(struct mparse *curp) { char *cp, *ep; int format; /* * If neither command line arguments -mdoc or -man select * a parser nor the roff parser found a .Dd or .TH macro * yet, look ahead in the main input buffer. */ if ((format = roff_getformat(curp->roff)) == 0) { cp = curp->primary->buf; ep = cp + curp->primary->sz; while (cp < ep) { if (*cp == '.' || *cp == '\'') { cp++; if (cp[0] == 'D' && cp[1] == 'd') { format = MPARSE_MDOC; break; } if (cp[0] == 'T' && cp[1] == 'H') { format = MPARSE_MAN; break; } } cp = memchr(cp, '\n', ep - cp); if (cp == NULL) break; cp++; } } if (format == MPARSE_MDOC) { curp->man->meta.macroset = MACROSET_MDOC; if (curp->man->mdocmac == NULL) curp->man->mdocmac = roffhash_alloc(MDOC_Dd, MDOC_MAX); } else { curp->man->meta.macroset = MACROSET_MAN; if (curp->man->manmac == NULL) curp->man->manmac = roffhash_alloc(MAN_TH, MAN_MAX); } curp->man->meta.first->tok = TOKEN_NONE; } /* * Main parse routine for a buffer. * It assumes encoding and line numbering are already set up. * It can recurse directly (for invocations of user-defined * macros, inline equations, and input line traps) * and indirectly (for .so file inclusion). */ static int mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start) { struct buf ln; struct buf *firstln, *lastln, *thisln, *loop; char *cp; size_t pos; /* byte number in the ln buffer */ size_t spos; /* at the start of the current line parse */ int line_result, result; int of; int lnn; /* line number in the real file */ int fd; int inloop; /* Saw .while on this level. */ unsigned char c; ln.sz = 256; ln.buf = mandoc_malloc(ln.sz); ln.next = NULL; firstln = lastln = loop = NULL; lnn = curp->line; pos = 0; inloop = 0; result = ROFF_CONT; while (i < blk.sz && (blk.buf[i] != '\0' || pos != 0)) { if (start) { curp->line = lnn; curp->reparse_count = 0; if (lnn < 3 && curp->filenc & MPARSE_UTF8 && curp->filenc & MPARSE_LATIN1) curp->filenc = preconv_cue(&blk, i); } spos = pos; while (i < blk.sz && (start || blk.buf[i] != '\0')) { /* * When finding an unescaped newline character, * leave the character loop to process the line. * Skip a preceding carriage return, if any. */ if ('\r' == blk.buf[i] && i + 1 < blk.sz && '\n' == blk.buf[i + 1]) ++i; if ('\n' == blk.buf[i]) { ++i; ++lnn; break; } /* * Make sure we have space for the worst * case of 12 bytes: "\\[u10ffff]\n\0" */ if (pos + 12 > ln.sz) resize_buf(&ln, 256); /* * Encode 8-bit input. */ c = blk.buf[i]; if (c & 0x80) { if ( ! (curp->filenc && preconv_encode( &blk, &i, &ln, &pos, &curp->filenc))) { mandoc_msg(MANDOCERR_CHAR_BAD, curp->line, pos, "0x%x", c); ln.buf[pos++] = '?'; i++; } continue; } /* * Exclude control characters. */ if (c == 0x7f || (c < 0x20 && c != 0x09)) { mandoc_msg(c == 0x00 || c == 0x04 || c > 0x0a ? MANDOCERR_CHAR_BAD : MANDOCERR_CHAR_UNSUPP, curp->line, pos, "0x%x", c); i++; if (c != '\r') ln.buf[pos++] = '?'; continue; } ln.buf[pos++] = blk.buf[i++]; } ln.buf[pos] = '\0'; /* * Maintain a lookaside buffer of all lines. * parsed from this input source. */ thisln = mandoc_malloc(sizeof(*thisln)); thisln->buf = mandoc_strdup(ln.buf); thisln->sz = strlen(ln.buf) + 1; thisln->next = NULL; if (firstln == NULL) { firstln = lastln = thisln; if (curp->secondary == NULL) curp->secondary = firstln; } else { lastln->next = thisln; lastln = thisln; } /* XXX Ugly hack to mark the end of the input. */ if (i == blk.sz || blk.buf[i] == '\0') { if (pos + 2 > ln.sz) resize_buf(&ln, 256); ln.buf[pos++] = '\n'; ln.buf[pos] = '\0'; } /* * A significant amount of complexity is contained by * the roff preprocessor. It's line-oriented but can be * expressed on one line, so we need at times to * readjust our starting point and re-run it. The roff * preprocessor can also readjust the buffers with new * data, so we pass them in wholesale. */ of = 0; rerun: line_result = roff_parseln(curp->roff, curp->line, &ln, &of, start && spos == 0 ? pos : 0); /* Process options. */ if (line_result & ROFF_APPEND) assert(line_result == (ROFF_IGN | ROFF_APPEND)); if (line_result & ROFF_USERCALL) assert((line_result & ROFF_MASK) == ROFF_REPARSE); if (line_result & ROFF_USERRET) { assert(line_result == (ROFF_IGN | ROFF_USERRET)); if (start == 0) { /* Return from the current macro. */ result = ROFF_USERRET; goto out; } } switch (line_result & ROFF_LOOPMASK) { case ROFF_IGN: break; case ROFF_WHILE: if (curp->loop != NULL) { if (loop == curp->loop) break; mandoc_msg(MANDOCERR_WHILE_NEST, curp->line, pos, NULL); } curp->loop = thisln; loop = NULL; inloop = 1; break; case ROFF_LOOPCONT: case ROFF_LOOPEXIT: if (curp->loop == NULL) { mandoc_msg(MANDOCERR_WHILE_FAIL, curp->line, pos, NULL); break; } if (inloop == 0) { mandoc_msg(MANDOCERR_WHILE_INTO, curp->line, pos, NULL); curp->loop = loop = NULL; break; } if (line_result & ROFF_LOOPCONT) loop = curp->loop; else { curp->loop = loop = NULL; inloop = 0; } break; default: abort(); } /* Process the main instruction from the roff parser. */ switch (line_result & ROFF_MASK) { case ROFF_IGN: break; case ROFF_CONT: if (curp->man->meta.macroset == MACROSET_NONE) choose_parser(curp); if ((curp->man->meta.macroset == MACROSET_MDOC ? mdoc_parseln(curp->man, curp->line, ln.buf, of) : man_parseln(curp->man, curp->line, ln.buf, of) ) == 2) goto out; break; case ROFF_RERUN: goto rerun; case ROFF_REPARSE: if (++curp->reparse_count > REPARSE_LIMIT) { /* Abort and return to the top level. */ result = ROFF_IGN; mandoc_msg(MANDOCERR_ROFFLOOP, curp->line, pos, NULL); goto out; } result = mparse_buf_r(curp, ln, of, 0); if (line_result & ROFF_USERCALL) { roff_userret(curp->roff); /* Continue normally. */ if (result & ROFF_USERRET) result = ROFF_CONT; } if (start == 0 && result != ROFF_CONT) goto out; break; case ROFF_SO: if ( ! (curp->options & MPARSE_SO) && (i >= blk.sz || blk.buf[i] == '\0')) { curp->man->meta.sodest = mandoc_strdup(ln.buf + of); goto out; } if ((fd = mparse_open(curp, ln.buf + of)) != -1) { mparse_readfd(curp, fd, ln.buf + of); close(fd); } else { mandoc_msg(MANDOCERR_SO_FAIL, curp->line, of, ".so %s: %s", ln.buf + of, strerror(errno)); ln.sz = mandoc_asprintf(&cp, ".sp\nSee the file %s.\n.sp", ln.buf + of); free(ln.buf); ln.buf = cp; of = 0; mparse_buf_r(curp, ln, of, 0); } break; default: abort(); } /* Start the next input line. */ if (loop != NULL && (line_result & ROFF_LOOPMASK) == ROFF_IGN) loop = loop->next; if (loop != NULL) { if ((line_result & ROFF_APPEND) == 0) *ln.buf = '\0'; if (ln.sz < loop->sz) resize_buf(&ln, loop->sz); (void)strlcat(ln.buf, loop->buf, ln.sz); of = 0; goto rerun; } pos = (line_result & ROFF_APPEND) ? strlen(ln.buf) : 0; } out: if (inloop) { if (result != ROFF_USERRET) mandoc_msg(MANDOCERR_WHILE_OUTOF, curp->line, pos, NULL); curp->loop = NULL; } free(ln.buf); if (firstln != curp->secondary) free_buf_list(firstln); return result; } static int read_whole_file(struct mparse *curp, int fd, struct buf *fb, int *with_mmap) { struct stat st; gzFile gz; size_t off; ssize_t ssz; int gzerrnum, retval; if (fstat(fd, &st) == -1) { mandoc_msg(MANDOCERR_FSTAT, 0, 0, "%s", strerror(errno)); return -1; } /* * If we're a regular file, try just reading in the whole entry * via mmap(). This is faster than reading it into blocks, and * since each file is only a few bytes to begin with, I'm not * concerned that this is going to tank any machines. */ if (curp->gzip == 0 && S_ISREG(st.st_mode)) { if (st.st_size > 0x7fffffff) { mandoc_msg(MANDOCERR_TOOLARGE, 0, 0, NULL); return -1; } *with_mmap = 1; fb->sz = (size_t)st.st_size; fb->buf = mmap(NULL, fb->sz, PROT_READ, MAP_SHARED, fd, 0); if (fb->buf != MAP_FAILED) return 0; } if (curp->gzip) { /* * Duplicating the file descriptor is required * because we will have to call gzclose(3) * to free memory used internally by zlib, * but that will also close the file descriptor, * which this function must not do. */ if ((fd = dup(fd)) == -1) { mandoc_msg(MANDOCERR_DUP, 0, 0, "%s", strerror(errno)); return -1; } if ((gz = gzdopen(fd, "rb")) == NULL) { mandoc_msg(MANDOCERR_GZDOPEN, 0, 0, "%s", strerror(errno)); close(fd); return -1; } } else gz = NULL; /* * If this isn't a regular file (like, say, stdin), then we must * go the old way and just read things in bit by bit. */ *with_mmap = 0; off = 0; retval = -1; fb->sz = 0; fb->buf = NULL; for (;;) { if (off == fb->sz) { if (fb->sz == (1U << 31)) { mandoc_msg(MANDOCERR_TOOLARGE, 0, 0, NULL); break; } resize_buf(fb, 65536); } ssz = curp->gzip ? gzread(gz, fb->buf + (int)off, fb->sz - off) : read(fd, fb->buf + (int)off, fb->sz - off); if (ssz == 0) { fb->sz = off; retval = 0; break; } if (ssz == -1) { if (curp->gzip) (void)gzerror(gz, &gzerrnum); mandoc_msg(MANDOCERR_READ, 0, 0, "%s", curp->gzip && gzerrnum != Z_ERRNO ? zError(gzerrnum) : strerror(errno)); break; } off += (size_t)ssz; } if (curp->gzip && (gzerrnum = gzclose(gz)) != Z_OK) mandoc_msg(MANDOCERR_GZCLOSE, 0, 0, "%s", gzerrnum == Z_ERRNO ? strerror(errno) : zError(gzerrnum)); if (retval == -1) { free(fb->buf); fb->buf = NULL; } return retval; } static void mparse_end(struct mparse *curp) { if (curp->man->meta.macroset == MACROSET_NONE) curp->man->meta.macroset = MACROSET_MAN; if (curp->man->meta.macroset == MACROSET_MDOC) mdoc_endparse(curp->man); else man_endparse(curp->man); roff_endparse(curp->roff); } /* * Read the whole file into memory and call the parsers. * Called recursively when an .so request is encountered. */ void mparse_readfd(struct mparse *curp, int fd, const char *filename) { static int recursion_depth; struct buf blk; struct buf *save_primary; const char *save_filename, *cp; size_t offset; int save_filenc, save_lineno; int with_mmap; if (recursion_depth > 64) { mandoc_msg(MANDOCERR_ROFFLOOP, curp->line, 0, NULL); return; } else if (recursion_depth == 0 && (cp = strrchr(filename, '.')) != NULL && cp[1] >= '1' && cp[1] <= '9') curp->man->filesec = cp[1]; else curp->man->filesec = '\0'; if (read_whole_file(curp, fd, &blk, &with_mmap) == -1) return; /* * Save some properties of the parent file. */ save_primary = curp->primary; save_filenc = curp->filenc; save_lineno = curp->line; save_filename = mandoc_msg_getinfilename(); curp->primary = &blk; curp->filenc = curp->options & (MPARSE_UTF8 | MPARSE_LATIN1); curp->line = 1; mandoc_msg_setinfilename(filename); /* Skip an UTF-8 byte order mark. */ if (curp->filenc & MPARSE_UTF8 && blk.sz > 2 && (unsigned char)blk.buf[0] == 0xef && (unsigned char)blk.buf[1] == 0xbb && (unsigned char)blk.buf[2] == 0xbf) { offset = 3; curp->filenc &= ~MPARSE_LATIN1; } else offset = 0; recursion_depth++; mparse_buf_r(curp, blk, offset, 1); if (--recursion_depth == 0) mparse_end(curp); /* * Clean up and restore saved parent properties. */ if (with_mmap) munmap(blk.buf, blk.sz); else free(blk.buf); curp->primary = save_primary; curp->filenc = save_filenc; curp->line = save_lineno; if (save_filename != NULL) mandoc_msg_setinfilename(save_filename); } int mparse_open(struct mparse *curp, const char *file) { char *cp; int fd, save_errno; cp = strrchr(file, '.'); curp->gzip = (cp != NULL && ! strcmp(cp + 1, "gz")); /* First try to use the filename as it is. */ if ((fd = open(file, O_RDONLY)) != -1) return fd; /* * If that doesn't work and the filename doesn't * already end in .gz, try appending .gz. */ if ( ! curp->gzip) { save_errno = errno; mandoc_asprintf(&cp, "%s.gz", file); fd = open(cp, O_RDONLY); free(cp); errno = save_errno; if (fd != -1) { curp->gzip = 1; return fd; } } /* Neither worked, give up. */ return -1; } struct mparse * mparse_alloc(int options, enum mandoc_os os_e, const char *os_s) { struct mparse *curp; curp = mandoc_calloc(1, sizeof(struct mparse)); curp->options = options; curp->os_s = os_s; curp->roff = roff_alloc(options); curp->man = roff_man_alloc(curp->roff, curp->os_s, curp->options & MPARSE_QUICK ? 1 : 0); if (curp->options & MPARSE_MDOC) { curp->man->meta.macroset = MACROSET_MDOC; if (curp->man->mdocmac == NULL) curp->man->mdocmac = roffhash_alloc(MDOC_Dd, MDOC_MAX); } else if (curp->options & MPARSE_MAN) { curp->man->meta.macroset = MACROSET_MAN; if (curp->man->manmac == NULL) curp->man->manmac = roffhash_alloc(MAN_TH, MAN_MAX); } curp->man->meta.first->tok = TOKEN_NONE; curp->man->meta.os_e = os_e; tag_alloc(); return curp; } void mparse_reset(struct mparse *curp) { tag_free(); roff_reset(curp->roff); roff_man_reset(curp->man); free_buf_list(curp->secondary); curp->secondary = NULL; curp->gzip = 0; tag_alloc(); } void mparse_free(struct mparse *curp) { tag_free(); roffhash_free(curp->man->mdocmac); roffhash_free(curp->man->manmac); roff_man_free(curp->man); roff_free(curp->roff); free_buf_list(curp->secondary); free(curp); } struct roff_meta * mparse_result(struct mparse *curp) { roff_state_reset(curp->man); if (curp->options & MPARSE_VALIDATE) { if (curp->man->meta.macroset == MACROSET_MDOC) mdoc_validate(curp->man); else man_validate(curp->man); tag_postprocess(curp->man, curp->man->meta.first); } return &curp->man->meta; } void mparse_copy(const struct mparse *p) { struct buf *buf; for (buf = p->secondary; buf != NULL; buf = buf->next) puts(buf->buf); } mandoc-1.14.6/roff.c010064400017530001753000003121361412314055300144550ustar00schwarzeschwarze/* $Id: roff.c,v 1.378 2021/08/10 12:55:04 schwarze Exp $ */ /* * Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Implementation of the roff(7) parser for mandoc(1). */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc_ohash.h" #include "mandoc.h" #include "roff.h" #include "mandoc_parse.h" #include "libmandoc.h" #include "roff_int.h" #include "tbl_parse.h" #include "eqn_parse.h" /* * ASCII_ESC is used to signal from roff_getarg() to roff_expand() * that an escape sequence resulted from copy-in processing and * needs to be checked or interpolated. As it is used nowhere * else, it is defined here rather than in a header file. */ #define ASCII_ESC 27 /* Maximum number of string expansions per line, to break infinite loops. */ #define EXPAND_LIMIT 1000 /* Types of definitions of macros and strings. */ #define ROFFDEF_USER (1 << 1) /* User-defined. */ #define ROFFDEF_PRE (1 << 2) /* Predefined. */ #define ROFFDEF_REN (1 << 3) /* Renamed standard macro. */ #define ROFFDEF_STD (1 << 4) /* mdoc(7) or man(7) macro. */ #define ROFFDEF_ANY (ROFFDEF_USER | ROFFDEF_PRE | \ ROFFDEF_REN | ROFFDEF_STD) #define ROFFDEF_UNDEF (1 << 5) /* Completely undefined. */ /* --- data types --------------------------------------------------------- */ /* * An incredibly-simple string buffer. */ struct roffstr { char *p; /* nil-terminated buffer */ size_t sz; /* saved strlen(p) */ }; /* * A key-value roffstr pair as part of a singly-linked list. */ struct roffkv { struct roffstr key; struct roffstr val; struct roffkv *next; /* next in list */ }; /* * A single number register as part of a singly-linked list. */ struct roffreg { struct roffstr key; int val; int step; struct roffreg *next; }; /* * Association of request and macro names with token IDs. */ struct roffreq { enum roff_tok tok; char name[]; }; /* * A macro processing context. * More than one is needed when macro calls are nested. */ struct mctx { char **argv; int argc; int argsz; }; struct roff { struct roff_man *man; /* mdoc or man parser */ struct roffnode *last; /* leaf of stack */ struct mctx *mstack; /* stack of macro contexts */ int *rstack; /* stack of inverted `ie' values */ struct ohash *reqtab; /* request lookup table */ struct roffreg *regtab; /* number registers */ struct roffkv *strtab; /* user-defined strings & macros */ struct roffkv *rentab; /* renamed strings & macros */ struct roffkv *xmbtab; /* multi-byte trans table (`tr') */ struct roffstr *xtab; /* single-byte trans table (`tr') */ const char *current_string; /* value of last called user macro */ struct tbl_node *first_tbl; /* first table parsed */ struct tbl_node *last_tbl; /* last table parsed */ struct tbl_node *tbl; /* current table being parsed */ struct eqn_node *last_eqn; /* equation parser */ struct eqn_node *eqn; /* active equation parser */ int eqn_inline; /* current equation is inline */ int options; /* parse options */ int mstacksz; /* current size of mstack */ int mstackpos; /* position in mstack */ int rstacksz; /* current size limit of rstack */ int rstackpos; /* position in rstack */ int format; /* current file in mdoc or man format */ char control; /* control character */ char escape; /* escape character */ }; /* * A macro definition, condition, or ignored block. */ struct roffnode { enum roff_tok tok; /* type of node */ struct roffnode *parent; /* up one in stack */ int line; /* parse line */ int col; /* parse col */ char *name; /* node name, e.g. macro name */ char *end; /* custom end macro of the block */ int endspan; /* scope to: 1=eol 2=next line -1=\} */ int rule; /* content is: 1=evaluated 0=skipped */ }; #define ROFF_ARGS struct roff *r, /* parse ctx */ \ enum roff_tok tok, /* tok of macro */ \ struct buf *buf, /* input buffer */ \ int ln, /* parse line */ \ int ppos, /* original pos in buffer */ \ int pos, /* current pos in buffer */ \ int *offs /* reset offset of buffer data */ typedef int (*roffproc)(ROFF_ARGS); struct roffmac { roffproc proc; /* process new macro */ roffproc text; /* process as child text of macro */ roffproc sub; /* process as child of macro */ int flags; #define ROFFMAC_STRUCT (1 << 0) /* always interpret */ }; struct predef { const char *name; /* predefined input name */ const char *str; /* replacement symbol */ }; #define PREDEF(__name, __str) \ { (__name), (__str) }, /* --- function prototypes ------------------------------------------------ */ static int roffnode_cleanscope(struct roff *); static int roffnode_pop(struct roff *); static void roffnode_push(struct roff *, enum roff_tok, const char *, int, int); static void roff_addtbl(struct roff_man *, int, struct tbl_node *); static int roff_als(ROFF_ARGS); static int roff_block(ROFF_ARGS); static int roff_block_text(ROFF_ARGS); static int roff_block_sub(ROFF_ARGS); static int roff_break(ROFF_ARGS); static int roff_cblock(ROFF_ARGS); static int roff_cc(ROFF_ARGS); static int roff_ccond(struct roff *, int, int); static int roff_char(ROFF_ARGS); static int roff_cond(ROFF_ARGS); static int roff_cond_checkend(ROFF_ARGS); static int roff_cond_text(ROFF_ARGS); static int roff_cond_sub(ROFF_ARGS); static int roff_ds(ROFF_ARGS); static int roff_ec(ROFF_ARGS); static int roff_eo(ROFF_ARGS); static int roff_eqndelim(struct roff *, struct buf *, int); static int roff_evalcond(struct roff *, int, char *, int *); static int roff_evalnum(struct roff *, int, const char *, int *, int *, int); static int roff_evalpar(struct roff *, int, const char *, int *, int *, int); static int roff_evalstrcond(const char *, int *); static int roff_expand(struct roff *, struct buf *, int, int, char); static void roff_free1(struct roff *); static void roff_freereg(struct roffreg *); static void roff_freestr(struct roffkv *); static size_t roff_getname(struct roff *, char **, int, int); static int roff_getnum(const char *, int *, int *, int); static int roff_getop(const char *, int *, char *); static int roff_getregn(struct roff *, const char *, size_t, char); static int roff_getregro(const struct roff *, const char *name); static const char *roff_getstrn(struct roff *, const char *, size_t, int *); static int roff_hasregn(const struct roff *, const char *, size_t); static int roff_insec(ROFF_ARGS); static int roff_it(ROFF_ARGS); static int roff_line_ignore(ROFF_ARGS); static void roff_man_alloc1(struct roff_man *); static void roff_man_free1(struct roff_man *); static int roff_manyarg(ROFF_ARGS); static int roff_noarg(ROFF_ARGS); static int roff_nop(ROFF_ARGS); static int roff_nr(ROFF_ARGS); static int roff_onearg(ROFF_ARGS); static enum roff_tok roff_parse(struct roff *, char *, int *, int, int); static int roff_parsetext(struct roff *, struct buf *, int, int *); static int roff_renamed(ROFF_ARGS); static int roff_return(ROFF_ARGS); static int roff_rm(ROFF_ARGS); static int roff_rn(ROFF_ARGS); static int roff_rr(ROFF_ARGS); static void roff_setregn(struct roff *, const char *, size_t, int, char, int); static void roff_setstr(struct roff *, const char *, const char *, int); static void roff_setstrn(struct roffkv **, const char *, size_t, const char *, size_t, int); static int roff_shift(ROFF_ARGS); static int roff_so(ROFF_ARGS); static int roff_tr(ROFF_ARGS); static int roff_Dd(ROFF_ARGS); static int roff_TE(ROFF_ARGS); static int roff_TS(ROFF_ARGS); static int roff_EQ(ROFF_ARGS); static int roff_EN(ROFF_ARGS); static int roff_T_(ROFF_ARGS); static int roff_unsupp(ROFF_ARGS); static int roff_userdef(ROFF_ARGS); /* --- constant data ------------------------------------------------------ */ #define ROFFNUM_SCALE (1 << 0) /* Honour scaling in roff_getnum(). */ #define ROFFNUM_WHITE (1 << 1) /* Skip whitespace in roff_evalnum(). */ const char *__roff_name[MAN_MAX + 1] = { "br", "ce", "fi", "ft", "ll", "mc", "nf", "po", "rj", "sp", "ta", "ti", NULL, "ab", "ad", "af", "aln", "als", "am", "am1", "ami", "ami1", "as", "as1", "asciify", "backtrace", "bd", "bleedat", "blm", "box", "boxa", "bp", "BP", "break", "breakchar", "brnl", "brp", "brpnl", "c2", "cc", "cf", "cflags", "ch", "char", "chop", "class", "close", "CL", "color", "composite", "continue", "cp", "cropat", "cs", "cu", "da", "dch", "Dd", "de", "de1", "defcolor", "dei", "dei1", "device", "devicem", "di", "do", "ds", "ds1", "dwh", "dt", "ec", "ecr", "ecs", "el", "em", "EN", "eo", "EP", "EQ", "errprint", "ev", "evc", "ex", "fallback", "fam", "fc", "fchar", "fcolor", "fdeferlig", "feature", "fkern", "fl", "flig", "fp", "fps", "fschar", "fspacewidth", "fspecial", "ftr", "fzoom", "gcolor", "hc", "hcode", "hidechar", "hla", "hlm", "hpf", "hpfa", "hpfcode", "hw", "hy", "hylang", "hylen", "hym", "hypp", "hys", "ie", "if", "ig", "index", "it", "itc", "IX", "kern", "kernafter", "kernbefore", "kernpair", "lc", "lc_ctype", "lds", "length", "letadj", "lf", "lg", "lhang", "linetabs", "lnr", "lnrf", "lpfx", "ls", "lsm", "lt", "mediasize", "minss", "mk", "mso", "na", "ne", "nh", "nhychar", "nm", "nn", "nop", "nr", "nrf", "nroff", "ns", "nx", "open", "opena", "os", "output", "padj", "papersize", "pc", "pev", "pi", "PI", "pl", "pm", "pn", "pnr", "ps", "psbb", "pshape", "pso", "ptr", "pvs", "rchar", "rd", "recursionlimit", "return", "rfschar", "rhang", "rm", "rn", "rnn", "rr", "rs", "rt", "schar", "sentchar", "shc", "shift", "sizes", "so", "spacewidth", "special", "spreadwarn", "ss", "sty", "substring", "sv", "sy", "T&", "tc", "TE", "TH", "tkf", "tl", "tm", "tm1", "tmc", "tr", "track", "transchar", "trf", "trimat", "trin", "trnt", "troff", "TS", "uf", "ul", "unformat", "unwatch", "unwatchn", "vpt", "vs", "warn", "warnscale", "watch", "watchlength", "watchn", "wh", "while", "write", "writec", "writem", "xflag", ".", NULL, NULL, "text", "Dd", "Dt", "Os", "Sh", "Ss", "Pp", "D1", "Dl", "Bd", "Ed", "Bl", "El", "It", "Ad", "An", "Ap", "Ar", "Cd", "Cm", "Dv", "Er", "Ev", "Ex", "Fa", "Fd", "Fl", "Fn", "Ft", "Ic", "In", "Li", "Nd", "Nm", "Op", "Ot", "Pa", "Rv", "St", "Va", "Vt", "Xr", "%A", "%B", "%D", "%I", "%J", "%N", "%O", "%P", "%R", "%T", "%V", "Ac", "Ao", "Aq", "At", "Bc", "Bf", "Bo", "Bq", "Bsx", "Bx", "Db", "Dc", "Do", "Dq", "Ec", "Ef", "Em", "Eo", "Fx", "Ms", "No", "Ns", "Nx", "Ox", "Pc", "Pf", "Po", "Pq", "Qc", "Ql", "Qo", "Qq", "Re", "Rs", "Sc", "So", "Sq", "Sm", "Sx", "Sy", "Tn", "Ux", "Xc", "Xo", "Fo", "Fc", "Oo", "Oc", "Bk", "Ek", "Bt", "Hf", "Fr", "Ud", "Lb", "Lp", "Lk", "Mt", "Brq", "Bro", "Brc", "%C", "Es", "En", "Dx", "%Q", "%U", "Ta", "Tg", NULL, "TH", "SH", "SS", "TP", "TQ", "LP", "PP", "P", "IP", "HP", "SM", "SB", "BI", "IB", "BR", "RB", "R", "B", "I", "IR", "RI", "RE", "RS", "DT", "UC", "PD", "AT", "in", "SY", "YS", "OP", "EX", "EE", "UR", "UE", "MT", "ME", NULL }; const char *const *roff_name = __roff_name; static struct roffmac roffs[TOKEN_NONE] = { { roff_noarg, NULL, NULL, 0 }, /* br */ { roff_onearg, NULL, NULL, 0 }, /* ce */ { roff_noarg, NULL, NULL, 0 }, /* fi */ { roff_onearg, NULL, NULL, 0 }, /* ft */ { roff_onearg, NULL, NULL, 0 }, /* ll */ { roff_onearg, NULL, NULL, 0 }, /* mc */ { roff_noarg, NULL, NULL, 0 }, /* nf */ { roff_onearg, NULL, NULL, 0 }, /* po */ { roff_onearg, NULL, NULL, 0 }, /* rj */ { roff_onearg, NULL, NULL, 0 }, /* sp */ { roff_manyarg, NULL, NULL, 0 }, /* ta */ { roff_onearg, NULL, NULL, 0 }, /* ti */ { NULL, NULL, NULL, 0 }, /* ROFF_MAX */ { roff_unsupp, NULL, NULL, 0 }, /* ab */ { roff_line_ignore, NULL, NULL, 0 }, /* ad */ { roff_line_ignore, NULL, NULL, 0 }, /* af */ { roff_unsupp, NULL, NULL, 0 }, /* aln */ { roff_als, NULL, NULL, 0 }, /* als */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* am */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* am1 */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* ami */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* ami1 */ { roff_ds, NULL, NULL, 0 }, /* as */ { roff_ds, NULL, NULL, 0 }, /* as1 */ { roff_unsupp, NULL, NULL, 0 }, /* asciify */ { roff_line_ignore, NULL, NULL, 0 }, /* backtrace */ { roff_line_ignore, NULL, NULL, 0 }, /* bd */ { roff_line_ignore, NULL, NULL, 0 }, /* bleedat */ { roff_unsupp, NULL, NULL, 0 }, /* blm */ { roff_unsupp, NULL, NULL, 0 }, /* box */ { roff_unsupp, NULL, NULL, 0 }, /* boxa */ { roff_line_ignore, NULL, NULL, 0 }, /* bp */ { roff_unsupp, NULL, NULL, 0 }, /* BP */ { roff_break, NULL, NULL, 0 }, /* break */ { roff_line_ignore, NULL, NULL, 0 }, /* breakchar */ { roff_line_ignore, NULL, NULL, 0 }, /* brnl */ { roff_noarg, NULL, NULL, 0 }, /* brp */ { roff_line_ignore, NULL, NULL, 0 }, /* brpnl */ { roff_unsupp, NULL, NULL, 0 }, /* c2 */ { roff_cc, NULL, NULL, 0 }, /* cc */ { roff_insec, NULL, NULL, 0 }, /* cf */ { roff_line_ignore, NULL, NULL, 0 }, /* cflags */ { roff_line_ignore, NULL, NULL, 0 }, /* ch */ { roff_char, NULL, NULL, 0 }, /* char */ { roff_unsupp, NULL, NULL, 0 }, /* chop */ { roff_line_ignore, NULL, NULL, 0 }, /* class */ { roff_insec, NULL, NULL, 0 }, /* close */ { roff_unsupp, NULL, NULL, 0 }, /* CL */ { roff_line_ignore, NULL, NULL, 0 }, /* color */ { roff_unsupp, NULL, NULL, 0 }, /* composite */ { roff_unsupp, NULL, NULL, 0 }, /* continue */ { roff_line_ignore, NULL, NULL, 0 }, /* cp */ { roff_line_ignore, NULL, NULL, 0 }, /* cropat */ { roff_line_ignore, NULL, NULL, 0 }, /* cs */ { roff_line_ignore, NULL, NULL, 0 }, /* cu */ { roff_unsupp, NULL, NULL, 0 }, /* da */ { roff_unsupp, NULL, NULL, 0 }, /* dch */ { roff_Dd, NULL, NULL, 0 }, /* Dd */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* de */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* de1 */ { roff_line_ignore, NULL, NULL, 0 }, /* defcolor */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* dei */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* dei1 */ { roff_unsupp, NULL, NULL, 0 }, /* device */ { roff_unsupp, NULL, NULL, 0 }, /* devicem */ { roff_unsupp, NULL, NULL, 0 }, /* di */ { roff_unsupp, NULL, NULL, 0 }, /* do */ { roff_ds, NULL, NULL, 0 }, /* ds */ { roff_ds, NULL, NULL, 0 }, /* ds1 */ { roff_unsupp, NULL, NULL, 0 }, /* dwh */ { roff_unsupp, NULL, NULL, 0 }, /* dt */ { roff_ec, NULL, NULL, 0 }, /* ec */ { roff_unsupp, NULL, NULL, 0 }, /* ecr */ { roff_unsupp, NULL, NULL, 0 }, /* ecs */ { roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT }, /* el */ { roff_unsupp, NULL, NULL, 0 }, /* em */ { roff_EN, NULL, NULL, 0 }, /* EN */ { roff_eo, NULL, NULL, 0 }, /* eo */ { roff_unsupp, NULL, NULL, 0 }, /* EP */ { roff_EQ, NULL, NULL, 0 }, /* EQ */ { roff_line_ignore, NULL, NULL, 0 }, /* errprint */ { roff_unsupp, NULL, NULL, 0 }, /* ev */ { roff_unsupp, NULL, NULL, 0 }, /* evc */ { roff_unsupp, NULL, NULL, 0 }, /* ex */ { roff_line_ignore, NULL, NULL, 0 }, /* fallback */ { roff_line_ignore, NULL, NULL, 0 }, /* fam */ { roff_unsupp, NULL, NULL, 0 }, /* fc */ { roff_unsupp, NULL, NULL, 0 }, /* fchar */ { roff_line_ignore, NULL, NULL, 0 }, /* fcolor */ { roff_line_ignore, NULL, NULL, 0 }, /* fdeferlig */ { roff_line_ignore, NULL, NULL, 0 }, /* feature */ { roff_line_ignore, NULL, NULL, 0 }, /* fkern */ { roff_line_ignore, NULL, NULL, 0 }, /* fl */ { roff_line_ignore, NULL, NULL, 0 }, /* flig */ { roff_line_ignore, NULL, NULL, 0 }, /* fp */ { roff_line_ignore, NULL, NULL, 0 }, /* fps */ { roff_unsupp, NULL, NULL, 0 }, /* fschar */ { roff_line_ignore, NULL, NULL, 0 }, /* fspacewidth */ { roff_line_ignore, NULL, NULL, 0 }, /* fspecial */ { roff_line_ignore, NULL, NULL, 0 }, /* ftr */ { roff_line_ignore, NULL, NULL, 0 }, /* fzoom */ { roff_line_ignore, NULL, NULL, 0 }, /* gcolor */ { roff_line_ignore, NULL, NULL, 0 }, /* hc */ { roff_line_ignore, NULL, NULL, 0 }, /* hcode */ { roff_line_ignore, NULL, NULL, 0 }, /* hidechar */ { roff_line_ignore, NULL, NULL, 0 }, /* hla */ { roff_line_ignore, NULL, NULL, 0 }, /* hlm */ { roff_line_ignore, NULL, NULL, 0 }, /* hpf */ { roff_line_ignore, NULL, NULL, 0 }, /* hpfa */ { roff_line_ignore, NULL, NULL, 0 }, /* hpfcode */ { roff_line_ignore, NULL, NULL, 0 }, /* hw */ { roff_line_ignore, NULL, NULL, 0 }, /* hy */ { roff_line_ignore, NULL, NULL, 0 }, /* hylang */ { roff_line_ignore, NULL, NULL, 0 }, /* hylen */ { roff_line_ignore, NULL, NULL, 0 }, /* hym */ { roff_line_ignore, NULL, NULL, 0 }, /* hypp */ { roff_line_ignore, NULL, NULL, 0 }, /* hys */ { roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT }, /* ie */ { roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT }, /* if */ { roff_block, roff_block_text, roff_block_sub, 0 }, /* ig */ { roff_unsupp, NULL, NULL, 0 }, /* index */ { roff_it, NULL, NULL, 0 }, /* it */ { roff_unsupp, NULL, NULL, 0 }, /* itc */ { roff_line_ignore, NULL, NULL, 0 }, /* IX */ { roff_line_ignore, NULL, NULL, 0 }, /* kern */ { roff_line_ignore, NULL, NULL, 0 }, /* kernafter */ { roff_line_ignore, NULL, NULL, 0 }, /* kernbefore */ { roff_line_ignore, NULL, NULL, 0 }, /* kernpair */ { roff_unsupp, NULL, NULL, 0 }, /* lc */ { roff_unsupp, NULL, NULL, 0 }, /* lc_ctype */ { roff_unsupp, NULL, NULL, 0 }, /* lds */ { roff_unsupp, NULL, NULL, 0 }, /* length */ { roff_line_ignore, NULL, NULL, 0 }, /* letadj */ { roff_insec, NULL, NULL, 0 }, /* lf */ { roff_line_ignore, NULL, NULL, 0 }, /* lg */ { roff_line_ignore, NULL, NULL, 0 }, /* lhang */ { roff_unsupp, NULL, NULL, 0 }, /* linetabs */ { roff_unsupp, NULL, NULL, 0 }, /* lnr */ { roff_unsupp, NULL, NULL, 0 }, /* lnrf */ { roff_unsupp, NULL, NULL, 0 }, /* lpfx */ { roff_line_ignore, NULL, NULL, 0 }, /* ls */ { roff_unsupp, NULL, NULL, 0 }, /* lsm */ { roff_line_ignore, NULL, NULL, 0 }, /* lt */ { roff_line_ignore, NULL, NULL, 0 }, /* mediasize */ { roff_line_ignore, NULL, NULL, 0 }, /* minss */ { roff_line_ignore, NULL, NULL, 0 }, /* mk */ { roff_insec, NULL, NULL, 0 }, /* mso */ { roff_line_ignore, NULL, NULL, 0 }, /* na */ { roff_line_ignore, NULL, NULL, 0 }, /* ne */ { roff_line_ignore, NULL, NULL, 0 }, /* nh */ { roff_line_ignore, NULL, NULL, 0 }, /* nhychar */ { roff_unsupp, NULL, NULL, 0 }, /* nm */ { roff_unsupp, NULL, NULL, 0 }, /* nn */ { roff_nop, NULL, NULL, 0 }, /* nop */ { roff_nr, NULL, NULL, 0 }, /* nr */ { roff_unsupp, NULL, NULL, 0 }, /* nrf */ { roff_line_ignore, NULL, NULL, 0 }, /* nroff */ { roff_line_ignore, NULL, NULL, 0 }, /* ns */ { roff_insec, NULL, NULL, 0 }, /* nx */ { roff_insec, NULL, NULL, 0 }, /* open */ { roff_insec, NULL, NULL, 0 }, /* opena */ { roff_line_ignore, NULL, NULL, 0 }, /* os */ { roff_unsupp, NULL, NULL, 0 }, /* output */ { roff_line_ignore, NULL, NULL, 0 }, /* padj */ { roff_line_ignore, NULL, NULL, 0 }, /* papersize */ { roff_line_ignore, NULL, NULL, 0 }, /* pc */ { roff_line_ignore, NULL, NULL, 0 }, /* pev */ { roff_insec, NULL, NULL, 0 }, /* pi */ { roff_unsupp, NULL, NULL, 0 }, /* PI */ { roff_line_ignore, NULL, NULL, 0 }, /* pl */ { roff_line_ignore, NULL, NULL, 0 }, /* pm */ { roff_line_ignore, NULL, NULL, 0 }, /* pn */ { roff_line_ignore, NULL, NULL, 0 }, /* pnr */ { roff_line_ignore, NULL, NULL, 0 }, /* ps */ { roff_unsupp, NULL, NULL, 0 }, /* psbb */ { roff_unsupp, NULL, NULL, 0 }, /* pshape */ { roff_insec, NULL, NULL, 0 }, /* pso */ { roff_line_ignore, NULL, NULL, 0 }, /* ptr */ { roff_line_ignore, NULL, NULL, 0 }, /* pvs */ { roff_unsupp, NULL, NULL, 0 }, /* rchar */ { roff_line_ignore, NULL, NULL, 0 }, /* rd */ { roff_line_ignore, NULL, NULL, 0 }, /* recursionlimit */ { roff_return, NULL, NULL, 0 }, /* return */ { roff_unsupp, NULL, NULL, 0 }, /* rfschar */ { roff_line_ignore, NULL, NULL, 0 }, /* rhang */ { roff_rm, NULL, NULL, 0 }, /* rm */ { roff_rn, NULL, NULL, 0 }, /* rn */ { roff_unsupp, NULL, NULL, 0 }, /* rnn */ { roff_rr, NULL, NULL, 0 }, /* rr */ { roff_line_ignore, NULL, NULL, 0 }, /* rs */ { roff_line_ignore, NULL, NULL, 0 }, /* rt */ { roff_unsupp, NULL, NULL, 0 }, /* schar */ { roff_line_ignore, NULL, NULL, 0 }, /* sentchar */ { roff_line_ignore, NULL, NULL, 0 }, /* shc */ { roff_shift, NULL, NULL, 0 }, /* shift */ { roff_line_ignore, NULL, NULL, 0 }, /* sizes */ { roff_so, NULL, NULL, 0 }, /* so */ { roff_line_ignore, NULL, NULL, 0 }, /* spacewidth */ { roff_line_ignore, NULL, NULL, 0 }, /* special */ { roff_line_ignore, NULL, NULL, 0 }, /* spreadwarn */ { roff_line_ignore, NULL, NULL, 0 }, /* ss */ { roff_line_ignore, NULL, NULL, 0 }, /* sty */ { roff_unsupp, NULL, NULL, 0 }, /* substring */ { roff_line_ignore, NULL, NULL, 0 }, /* sv */ { roff_insec, NULL, NULL, 0 }, /* sy */ { roff_T_, NULL, NULL, 0 }, /* T& */ { roff_unsupp, NULL, NULL, 0 }, /* tc */ { roff_TE, NULL, NULL, 0 }, /* TE */ { roff_Dd, NULL, NULL, 0 }, /* TH */ { roff_line_ignore, NULL, NULL, 0 }, /* tkf */ { roff_unsupp, NULL, NULL, 0 }, /* tl */ { roff_line_ignore, NULL, NULL, 0 }, /* tm */ { roff_line_ignore, NULL, NULL, 0 }, /* tm1 */ { roff_line_ignore, NULL, NULL, 0 }, /* tmc */ { roff_tr, NULL, NULL, 0 }, /* tr */ { roff_line_ignore, NULL, NULL, 0 }, /* track */ { roff_line_ignore, NULL, NULL, 0 }, /* transchar */ { roff_insec, NULL, NULL, 0 }, /* trf */ { roff_line_ignore, NULL, NULL, 0 }, /* trimat */ { roff_unsupp, NULL, NULL, 0 }, /* trin */ { roff_unsupp, NULL, NULL, 0 }, /* trnt */ { roff_line_ignore, NULL, NULL, 0 }, /* troff */ { roff_TS, NULL, NULL, 0 }, /* TS */ { roff_line_ignore, NULL, NULL, 0 }, /* uf */ { roff_line_ignore, NULL, NULL, 0 }, /* ul */ { roff_unsupp, NULL, NULL, 0 }, /* unformat */ { roff_line_ignore, NULL, NULL, 0 }, /* unwatch */ { roff_line_ignore, NULL, NULL, 0 }, /* unwatchn */ { roff_line_ignore, NULL, NULL, 0 }, /* vpt */ { roff_line_ignore, NULL, NULL, 0 }, /* vs */ { roff_line_ignore, NULL, NULL, 0 }, /* warn */ { roff_line_ignore, NULL, NULL, 0 }, /* warnscale */ { roff_line_ignore, NULL, NULL, 0 }, /* watch */ { roff_line_ignore, NULL, NULL, 0 }, /* watchlength */ { roff_line_ignore, NULL, NULL, 0 }, /* watchn */ { roff_unsupp, NULL, NULL, 0 }, /* wh */ { roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT }, /*while*/ { roff_insec, NULL, NULL, 0 }, /* write */ { roff_insec, NULL, NULL, 0 }, /* writec */ { roff_insec, NULL, NULL, 0 }, /* writem */ { roff_line_ignore, NULL, NULL, 0 }, /* xflag */ { roff_cblock, NULL, NULL, 0 }, /* . */ { roff_renamed, NULL, NULL, 0 }, { roff_userdef, NULL, NULL, 0 } }; /* Array of injected predefined strings. */ #define PREDEFS_MAX 38 static const struct predef predefs[PREDEFS_MAX] = { #include "predefs.in" }; static int roffce_lines; /* number of input lines to center */ static struct roff_node *roffce_node; /* active request */ static int roffit_lines; /* number of lines to delay */ static char *roffit_macro; /* nil-terminated macro line */ /* --- request table ------------------------------------------------------ */ struct ohash * roffhash_alloc(enum roff_tok mintok, enum roff_tok maxtok) { struct ohash *htab; struct roffreq *req; enum roff_tok tok; size_t sz; unsigned int slot; htab = mandoc_malloc(sizeof(*htab)); mandoc_ohash_init(htab, 8, offsetof(struct roffreq, name)); for (tok = mintok; tok < maxtok; tok++) { if (roff_name[tok] == NULL) continue; sz = strlen(roff_name[tok]); req = mandoc_malloc(sizeof(*req) + sz + 1); req->tok = tok; memcpy(req->name, roff_name[tok], sz + 1); slot = ohash_qlookup(htab, req->name); ohash_insert(htab, slot, req); } return htab; } void roffhash_free(struct ohash *htab) { struct roffreq *req; unsigned int slot; if (htab == NULL) return; for (req = ohash_first(htab, &slot); req != NULL; req = ohash_next(htab, &slot)) free(req); ohash_delete(htab); free(htab); } enum roff_tok roffhash_find(struct ohash *htab, const char *name, size_t sz) { struct roffreq *req; const char *end; if (sz) { end = name + sz; req = ohash_find(htab, ohash_qlookupi(htab, name, &end)); } else req = ohash_find(htab, ohash_qlookup(htab, name)); return req == NULL ? TOKEN_NONE : req->tok; } /* --- stack of request blocks -------------------------------------------- */ /* * Pop the current node off of the stack of roff instructions currently * pending. Return 1 if it is a loop or 0 otherwise. */ static int roffnode_pop(struct roff *r) { struct roffnode *p; int inloop; p = r->last; inloop = p->tok == ROFF_while; r->last = p->parent; free(p->name); free(p->end); free(p); return inloop; } /* * Push a roff node onto the instruction stack. This must later be * removed with roffnode_pop(). */ static void roffnode_push(struct roff *r, enum roff_tok tok, const char *name, int line, int col) { struct roffnode *p; p = mandoc_calloc(1, sizeof(struct roffnode)); p->tok = tok; if (name) p->name = mandoc_strdup(name); p->parent = r->last; p->line = line; p->col = col; p->rule = p->parent ? p->parent->rule : 0; r->last = p; } /* --- roff parser state data management ---------------------------------- */ static void roff_free1(struct roff *r) { int i; tbl_free(r->first_tbl); r->first_tbl = r->last_tbl = r->tbl = NULL; eqn_free(r->last_eqn); r->last_eqn = r->eqn = NULL; while (r->mstackpos >= 0) roff_userret(r); while (r->last) roffnode_pop(r); free (r->rstack); r->rstack = NULL; r->rstacksz = 0; r->rstackpos = -1; roff_freereg(r->regtab); r->regtab = NULL; roff_freestr(r->strtab); roff_freestr(r->rentab); roff_freestr(r->xmbtab); r->strtab = r->rentab = r->xmbtab = NULL; if (r->xtab) for (i = 0; i < 128; i++) free(r->xtab[i].p); free(r->xtab); r->xtab = NULL; } void roff_reset(struct roff *r) { roff_free1(r); r->options |= MPARSE_COMMENT; r->format = r->options & (MPARSE_MDOC | MPARSE_MAN); r->control = '\0'; r->escape = '\\'; roffce_lines = 0; roffce_node = NULL; roffit_lines = 0; roffit_macro = NULL; } void roff_free(struct roff *r) { int i; roff_free1(r); for (i = 0; i < r->mstacksz; i++) free(r->mstack[i].argv); free(r->mstack); roffhash_free(r->reqtab); free(r); } struct roff * roff_alloc(int options) { struct roff *r; r = mandoc_calloc(1, sizeof(struct roff)); r->reqtab = roffhash_alloc(0, ROFF_RENAMED); r->options = options | MPARSE_COMMENT; r->format = options & (MPARSE_MDOC | MPARSE_MAN); r->mstackpos = -1; r->rstackpos = -1; r->escape = '\\'; return r; } /* --- syntax tree state data management ---------------------------------- */ static void roff_man_free1(struct roff_man *man) { if (man->meta.first != NULL) roff_node_delete(man, man->meta.first); free(man->meta.msec); free(man->meta.vol); free(man->meta.os); free(man->meta.arch); free(man->meta.title); free(man->meta.name); free(man->meta.date); free(man->meta.sodest); } void roff_state_reset(struct roff_man *man) { man->last = man->meta.first; man->last_es = NULL; man->flags = 0; man->lastsec = man->lastnamed = SEC_NONE; man->next = ROFF_NEXT_CHILD; roff_setreg(man->roff, "nS", 0, '='); } static void roff_man_alloc1(struct roff_man *man) { memset(&man->meta, 0, sizeof(man->meta)); man->meta.first = mandoc_calloc(1, sizeof(*man->meta.first)); man->meta.first->type = ROFFT_ROOT; man->meta.macroset = MACROSET_NONE; roff_state_reset(man); } void roff_man_reset(struct roff_man *man) { roff_man_free1(man); roff_man_alloc1(man); } void roff_man_free(struct roff_man *man) { roff_man_free1(man); free(man); } struct roff_man * roff_man_alloc(struct roff *roff, const char *os_s, int quick) { struct roff_man *man; man = mandoc_calloc(1, sizeof(*man)); man->roff = roff; man->os_s = os_s; man->quick = quick; roff_man_alloc1(man); roff->man = man; return man; } /* --- syntax tree handling ----------------------------------------------- */ struct roff_node * roff_node_alloc(struct roff_man *man, int line, int pos, enum roff_type type, int tok) { struct roff_node *n; n = mandoc_calloc(1, sizeof(*n)); n->line = line; n->pos = pos; n->tok = tok; n->type = type; n->sec = man->lastsec; if (man->flags & MDOC_SYNOPSIS) n->flags |= NODE_SYNPRETTY; else n->flags &= ~NODE_SYNPRETTY; if ((man->flags & (ROFF_NOFILL | ROFF_NONOFILL)) == ROFF_NOFILL) n->flags |= NODE_NOFILL; else n->flags &= ~NODE_NOFILL; if (man->flags & MDOC_NEWLINE) n->flags |= NODE_LINE; man->flags &= ~MDOC_NEWLINE; return n; } void roff_node_append(struct roff_man *man, struct roff_node *n) { switch (man->next) { case ROFF_NEXT_SIBLING: if (man->last->next != NULL) { n->next = man->last->next; man->last->next->prev = n; } else man->last->parent->last = n; man->last->next = n; n->prev = man->last; n->parent = man->last->parent; break; case ROFF_NEXT_CHILD: if (man->last->child != NULL) { n->next = man->last->child; man->last->child->prev = n; } else man->last->last = n; man->last->child = n; n->parent = man->last; break; default: abort(); } man->last = n; switch (n->type) { case ROFFT_HEAD: n->parent->head = n; break; case ROFFT_BODY: if (n->end != ENDBODY_NOT) return; n->parent->body = n; break; case ROFFT_TAIL: n->parent->tail = n; break; default: return; } /* * Copy over the normalised-data pointer of our parent. Not * everybody has one, but copying a null pointer is fine. */ n->norm = n->parent->norm; assert(n->parent->type == ROFFT_BLOCK); } void roff_word_alloc(struct roff_man *man, int line, int pos, const char *word) { struct roff_node *n; n = roff_node_alloc(man, line, pos, ROFFT_TEXT, TOKEN_NONE); n->string = roff_strdup(man->roff, word); roff_node_append(man, n); n->flags |= NODE_VALID | NODE_ENDED; man->next = ROFF_NEXT_SIBLING; } void roff_word_append(struct roff_man *man, const char *word) { struct roff_node *n; char *addstr, *newstr; n = man->last; addstr = roff_strdup(man->roff, word); mandoc_asprintf(&newstr, "%s %s", n->string, addstr); free(addstr); free(n->string); n->string = newstr; man->next = ROFF_NEXT_SIBLING; } void roff_elem_alloc(struct roff_man *man, int line, int pos, int tok) { struct roff_node *n; n = roff_node_alloc(man, line, pos, ROFFT_ELEM, tok); roff_node_append(man, n); man->next = ROFF_NEXT_CHILD; } struct roff_node * roff_block_alloc(struct roff_man *man, int line, int pos, int tok) { struct roff_node *n; n = roff_node_alloc(man, line, pos, ROFFT_BLOCK, tok); roff_node_append(man, n); man->next = ROFF_NEXT_CHILD; return n; } struct roff_node * roff_head_alloc(struct roff_man *man, int line, int pos, int tok) { struct roff_node *n; n = roff_node_alloc(man, line, pos, ROFFT_HEAD, tok); roff_node_append(man, n); man->next = ROFF_NEXT_CHILD; return n; } struct roff_node * roff_body_alloc(struct roff_man *man, int line, int pos, int tok) { struct roff_node *n; n = roff_node_alloc(man, line, pos, ROFFT_BODY, tok); roff_node_append(man, n); man->next = ROFF_NEXT_CHILD; return n; } static void roff_addtbl(struct roff_man *man, int line, struct tbl_node *tbl) { struct roff_node *n; struct tbl_span *span; if (man->meta.macroset == MACROSET_MAN) man_breakscope(man, ROFF_TS); while ((span = tbl_span(tbl)) != NULL) { n = roff_node_alloc(man, line, 0, ROFFT_TBL, TOKEN_NONE); n->span = span; roff_node_append(man, n); n->flags |= NODE_VALID | NODE_ENDED; man->next = ROFF_NEXT_SIBLING; } } void roff_node_unlink(struct roff_man *man, struct roff_node *n) { /* Adjust siblings. */ if (n->prev) n->prev->next = n->next; if (n->next) n->next->prev = n->prev; /* Adjust parent. */ if (n->parent != NULL) { if (n->parent->child == n) n->parent->child = n->next; if (n->parent->last == n) n->parent->last = n->prev; } /* Adjust parse point. */ if (man == NULL) return; if (man->last == n) { if (n->prev == NULL) { man->last = n->parent; man->next = ROFF_NEXT_CHILD; } else { man->last = n->prev; man->next = ROFF_NEXT_SIBLING; } } if (man->meta.first == n) man->meta.first = NULL; } void roff_node_relink(struct roff_man *man, struct roff_node *n) { roff_node_unlink(man, n); n->prev = n->next = NULL; roff_node_append(man, n); } void roff_node_free(struct roff_node *n) { if (n->args != NULL) mdoc_argv_free(n->args); if (n->type == ROFFT_BLOCK || n->type == ROFFT_ELEM) free(n->norm); eqn_box_free(n->eqn); free(n->string); free(n->tag); free(n); } void roff_node_delete(struct roff_man *man, struct roff_node *n) { while (n->child != NULL) roff_node_delete(man, n->child); roff_node_unlink(man, n); roff_node_free(n); } int roff_node_transparent(struct roff_node *n) { if (n == NULL) return 0; if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return 1; return roff_tok_transparent(n->tok); } int roff_tok_transparent(enum roff_tok tok) { switch (tok) { case ROFF_ft: case ROFF_ll: case ROFF_mc: case ROFF_po: case ROFF_ta: case MDOC_Db: case MDOC_Es: case MDOC_Sm: case MDOC_Tg: case MAN_DT: case MAN_UC: case MAN_PD: case MAN_AT: return 1; default: return 0; } } struct roff_node * roff_node_child(struct roff_node *n) { for (n = n->child; roff_node_transparent(n); n = n->next) continue; return n; } struct roff_node * roff_node_prev(struct roff_node *n) { do { n = n->prev; } while (roff_node_transparent(n)); return n; } struct roff_node * roff_node_next(struct roff_node *n) { do { n = n->next; } while (roff_node_transparent(n)); return n; } void deroff(char **dest, const struct roff_node *n) { char *cp; size_t sz; if (n->string == NULL) { for (n = n->child; n != NULL; n = n->next) deroff(dest, n); return; } /* Skip leading whitespace. */ for (cp = n->string; *cp != '\0'; cp++) { if (cp[0] == '\\' && cp[1] != '\0' && strchr(" %&0^|~", cp[1]) != NULL) cp++; else if ( ! isspace((unsigned char)*cp)) break; } /* Skip trailing backslash. */ sz = strlen(cp); if (sz > 0 && cp[sz - 1] == '\\') sz--; /* Skip trailing whitespace. */ for (; sz; sz--) if ( ! isspace((unsigned char)cp[sz-1])) break; /* Skip empty strings. */ if (sz == 0) return; if (*dest == NULL) { *dest = mandoc_strndup(cp, sz); return; } mandoc_asprintf(&cp, "%s %*s", *dest, (int)sz, cp); free(*dest); *dest = cp; } /* --- main functions of the roff parser ---------------------------------- */ /* * In the current line, expand escape sequences that produce parsable * input text. Also check the syntax of the remaining escape sequences, * which typically produce output glyphs or change formatter state. */ static int roff_expand(struct roff *r, struct buf *buf, int ln, int pos, char newesc) { struct mctx *ctx; /* current macro call context */ char ubuf[24]; /* buffer to print the number */ struct roff_node *n; /* used for header comments */ const char *start; /* start of the string to process */ char *stesc; /* start of an escape sequence ('\\') */ const char *esct; /* type of esccape sequence */ char *ep; /* end of comment string */ const char *stnam; /* start of the name, after "[(*" */ const char *cp; /* end of the name, e.g. before ']' */ const char *res; /* the string to be substituted */ char *nbuf; /* new buffer to copy buf->buf to */ size_t maxl; /* expected length of the escape name */ size_t naml; /* actual length of the escape name */ size_t asz; /* length of the replacement */ size_t rsz; /* length of the rest of the string */ int inaml; /* length returned from mandoc_escape() */ int expand_count; /* to avoid infinite loops */ int npos; /* position in numeric expression */ int arg_complete; /* argument not interrupted by eol */ int quote_args; /* true for \\$@, false for \\$* */ int done; /* no more input available */ int deftype; /* type of definition to paste */ int rcsid; /* kind of RCS id seen */ enum mandocerr err; /* for escape sequence problems */ char sign; /* increment number register */ char term; /* character terminating the escape */ /* Search forward for comments. */ done = 0; start = buf->buf + pos; for (stesc = buf->buf + pos; *stesc != '\0'; stesc++) { if (stesc[0] != newesc || stesc[1] == '\0') continue; stesc++; if (*stesc != '"' && *stesc != '#') continue; /* Comment found, look for RCS id. */ rcsid = 0; if ((cp = strstr(stesc, "$" "OpenBSD")) != NULL) { rcsid = 1 << MANDOC_OS_OPENBSD; cp += 8; } else if ((cp = strstr(stesc, "$" "NetBSD")) != NULL) { rcsid = 1 << MANDOC_OS_NETBSD; cp += 7; } if (cp != NULL && isalnum((unsigned char)*cp) == 0 && strchr(cp, '$') != NULL) { if (r->man->meta.rcsids & rcsid) mandoc_msg(MANDOCERR_RCS_REP, ln, (int)(stesc - buf->buf) + 1, "%s", stesc + 1); r->man->meta.rcsids |= rcsid; } /* Handle trailing whitespace. */ ep = strchr(stesc--, '\0') - 1; if (*ep == '\n') { done = 1; ep--; } if (*ep == ' ' || *ep == '\t') mandoc_msg(MANDOCERR_SPACE_EOL, ln, (int)(ep - buf->buf), NULL); /* * Save comments preceding the title macro * in the syntax tree. */ if (newesc != ASCII_ESC && r->options & MPARSE_COMMENT) { while (*ep == ' ' || *ep == '\t') ep--; ep[1] = '\0'; n = roff_node_alloc(r->man, ln, stesc + 1 - buf->buf, ROFFT_COMMENT, TOKEN_NONE); n->string = mandoc_strdup(stesc + 2); roff_node_append(r->man, n); n->flags |= NODE_VALID | NODE_ENDED; r->man->next = ROFF_NEXT_SIBLING; } /* Line continuation with comment. */ if (stesc[1] == '#') { *stesc = '\0'; return ROFF_IGN | ROFF_APPEND; } /* Discard normal comments. */ while (stesc > start && stesc[-1] == ' ' && (stesc == start + 1 || stesc[-2] != '\\')) stesc--; *stesc = '\0'; break; } if (stesc == start) return ROFF_CONT; stesc--; /* Notice the end of the input. */ if (*stesc == '\n') { *stesc-- = '\0'; done = 1; } expand_count = 0; while (stesc >= start) { if (*stesc != newesc) { /* * If we have a non-standard escape character, * escape literal backslashes because all * processing in subsequent functions uses * the standard escaping rules. */ if (newesc != ASCII_ESC && *stesc == '\\') { *stesc = '\0'; buf->sz = mandoc_asprintf(&nbuf, "%s\\e%s", buf->buf, stesc + 1) + 1; start = nbuf + pos; stesc = nbuf + (stesc - buf->buf); free(buf->buf); buf->buf = nbuf; } /* Search backwards for the next escape. */ stesc--; continue; } /* If it is escaped, skip it. */ for (cp = stesc - 1; cp >= start; cp--) if (*cp != r->escape) break; if ((stesc - cp) % 2 == 0) { while (stesc > cp) *stesc-- = '\\'; continue; } else if (stesc[1] != '\0') { *stesc = '\\'; } else { *stesc-- = '\0'; if (done) continue; else return ROFF_IGN | ROFF_APPEND; } /* Decide whether to expand or to check only. */ term = '\0'; cp = stesc + 1; if (*cp == 'E') cp++; esct = cp; switch (*esct) { case '*': case '$': res = NULL; break; case 'B': case 'w': term = cp[1]; /* FALLTHROUGH */ case 'n': sign = cp[1]; if (sign == '+' || sign == '-') cp++; res = ubuf; break; default: err = MANDOCERR_OK; switch(mandoc_escape(&cp, &stnam, &inaml)) { case ESCAPE_SPECIAL: if (mchars_spec2cp(stnam, inaml) >= 0) break; /* FALLTHROUGH */ case ESCAPE_ERROR: err = MANDOCERR_ESC_BAD; break; case ESCAPE_UNDEF: err = MANDOCERR_ESC_UNDEF; break; case ESCAPE_UNSUPP: err = MANDOCERR_ESC_UNSUPP; break; default: break; } if (err != MANDOCERR_OK) mandoc_msg(err, ln, (int)(stesc - buf->buf), "%.*s", (int)(cp - stesc), stesc); stesc--; continue; } if (EXPAND_LIMIT < ++expand_count) { mandoc_msg(MANDOCERR_ROFFLOOP, ln, (int)(stesc - buf->buf), NULL); return ROFF_IGN; } /* * The third character decides the length * of the name of the string or register. * Save a pointer to the name. */ if (term == '\0') { switch (*++cp) { case '\0': maxl = 0; break; case '(': cp++; maxl = 2; break; case '[': cp++; term = ']'; maxl = 0; break; default: maxl = 1; break; } } else { cp += 2; maxl = 0; } stnam = cp; /* Advance to the end of the name. */ naml = 0; arg_complete = 1; while (maxl == 0 || naml < maxl) { if (*cp == '\0') { mandoc_msg(MANDOCERR_ESC_BAD, ln, (int)(stesc - buf->buf), "%s", stesc); arg_complete = 0; break; } if (maxl == 0 && *cp == term) { cp++; break; } if (*cp++ != '\\' || *esct != 'w') { naml++; continue; } switch (mandoc_escape(&cp, NULL, NULL)) { case ESCAPE_SPECIAL: case ESCAPE_UNICODE: case ESCAPE_NUMBERED: case ESCAPE_UNDEF: case ESCAPE_OVERSTRIKE: naml++; break; default: break; } } /* * Retrieve the replacement string; if it is * undefined, resume searching for escapes. */ switch (*esct) { case '*': if (arg_complete) { deftype = ROFFDEF_USER | ROFFDEF_PRE; res = roff_getstrn(r, stnam, naml, &deftype); /* * If not overriden, let \*(.T * through to the formatters. */ if (res == NULL && naml == 2 && stnam[0] == '.' && stnam[1] == 'T') { roff_setstrn(&r->strtab, ".T", 2, NULL, 0, 0); stesc--; continue; } } break; case '$': if (r->mstackpos < 0) { mandoc_msg(MANDOCERR_ARG_UNDEF, ln, (int)(stesc - buf->buf), "%.3s", stesc); break; } ctx = r->mstack + r->mstackpos; npos = esct[1] - '1'; if (npos >= 0 && npos <= 8) { res = npos < ctx->argc ? ctx->argv[npos] : ""; break; } if (esct[1] == '*') quote_args = 0; else if (esct[1] == '@') quote_args = 1; else { mandoc_msg(MANDOCERR_ARG_NONUM, ln, (int)(stesc - buf->buf), "%.3s", stesc); break; } asz = 0; for (npos = 0; npos < ctx->argc; npos++) { if (npos) asz++; /* blank */ if (quote_args) asz += 2; /* quotes */ asz += strlen(ctx->argv[npos]); } if (asz != 3) { rsz = buf->sz - (stesc - buf->buf) - 3; if (asz < 3) memmove(stesc + asz, stesc + 3, rsz); buf->sz += asz - 3; nbuf = mandoc_realloc(buf->buf, buf->sz); start = nbuf + pos; stesc = nbuf + (stesc - buf->buf); buf->buf = nbuf; if (asz > 3) memmove(stesc + asz, stesc + 3, rsz); } for (npos = 0; npos < ctx->argc; npos++) { if (npos) *stesc++ = ' '; if (quote_args) *stesc++ = '"'; cp = ctx->argv[npos]; while (*cp != '\0') *stesc++ = *cp++; if (quote_args) *stesc++ = '"'; } continue; case 'B': npos = 0; ubuf[0] = arg_complete && roff_evalnum(r, ln, stnam, &npos, NULL, ROFFNUM_SCALE) && stnam + npos + 1 == cp ? '1' : '0'; ubuf[1] = '\0'; break; case 'n': if (arg_complete) (void)snprintf(ubuf, sizeof(ubuf), "%d", roff_getregn(r, stnam, naml, sign)); else ubuf[0] = '\0'; break; case 'w': /* use even incomplete args */ (void)snprintf(ubuf, sizeof(ubuf), "%d", 24 * (int)naml); break; } if (res == NULL) { if (*esct == '*') mandoc_msg(MANDOCERR_STR_UNDEF, ln, (int)(stesc - buf->buf), "%.*s", (int)naml, stnam); res = ""; } else if (buf->sz + strlen(res) > SHRT_MAX) { mandoc_msg(MANDOCERR_ROFFLOOP, ln, (int)(stesc - buf->buf), NULL); return ROFF_IGN; } /* Replace the escape sequence by the string. */ *stesc = '\0'; buf->sz = mandoc_asprintf(&nbuf, "%s%s%s", buf->buf, res, cp) + 1; /* Prepare for the next replacement. */ start = nbuf + pos; stesc = nbuf + (stesc - buf->buf) + strlen(res); free(buf->buf); buf->buf = nbuf; } return ROFF_CONT; } /* * Parse a quoted or unquoted roff-style request or macro argument. * Return a pointer to the parsed argument, which is either the original * pointer or advanced by one byte in case the argument is quoted. * NUL-terminate the argument in place. * Collapse pairs of quotes inside quoted arguments. * Advance the argument pointer to the next argument, * or to the NUL byte terminating the argument line. */ char * roff_getarg(struct roff *r, char **cpp, int ln, int *pos) { struct buf buf; char *cp, *start; int newesc, pairs, quoted, white; /* Quoting can only start with a new word. */ start = *cpp; quoted = 0; if ('"' == *start) { quoted = 1; start++; } newesc = pairs = white = 0; for (cp = start; '\0' != *cp; cp++) { /* * Move the following text left * after quoted quotes and after "\\" and "\t". */ if (pairs) cp[-pairs] = cp[0]; if ('\\' == cp[0]) { /* * In copy mode, translate double to single * backslashes and backslash-t to literal tabs. */ switch (cp[1]) { case 'a': case 't': cp[-pairs] = '\t'; pairs++; cp++; break; case '\\': newesc = 1; cp[-pairs] = ASCII_ESC; pairs++; cp++; break; case ' ': /* Skip escaped blanks. */ if (0 == quoted) cp++; break; default: break; } } else if (0 == quoted) { if (' ' == cp[0]) { /* Unescaped blanks end unquoted args. */ white = 1; break; } } else if ('"' == cp[0]) { if ('"' == cp[1]) { /* Quoted quotes collapse. */ pairs++; cp++; } else { /* Unquoted quotes end quoted args. */ quoted = 2; break; } } } /* Quoted argument without a closing quote. */ if (1 == quoted) mandoc_msg(MANDOCERR_ARG_QUOTE, ln, *pos, NULL); /* NUL-terminate this argument and move to the next one. */ if (pairs) cp[-pairs] = '\0'; if ('\0' != *cp) { *cp++ = '\0'; while (' ' == *cp) cp++; } *pos += (int)(cp - start) + (quoted ? 1 : 0); *cpp = cp; if ('\0' == *cp && (white || ' ' == cp[-1])) mandoc_msg(MANDOCERR_SPACE_EOL, ln, *pos, NULL); start = mandoc_strdup(start); if (newesc == 0) return start; buf.buf = start; buf.sz = strlen(start) + 1; buf.next = NULL; if (roff_expand(r, &buf, ln, 0, ASCII_ESC) & ROFF_IGN) { free(buf.buf); buf.buf = mandoc_strdup(""); } return buf.buf; } /* * Process text streams. */ static int roff_parsetext(struct roff *r, struct buf *buf, int pos, int *offs) { size_t sz; const char *start; char *p; int isz; enum mandoc_esc esc; /* Spring the input line trap. */ if (roffit_lines == 1) { isz = mandoc_asprintf(&p, "%s\n.%s", buf->buf, roffit_macro); free(buf->buf); buf->buf = p; buf->sz = isz + 1; *offs = 0; free(roffit_macro); roffit_lines = 0; return ROFF_REPARSE; } else if (roffit_lines > 1) --roffit_lines; if (roffce_node != NULL && buf->buf[pos] != '\0') { if (roffce_lines < 1) { r->man->last = roffce_node; r->man->next = ROFF_NEXT_SIBLING; roffce_lines = 0; roffce_node = NULL; } else roffce_lines--; } /* Convert all breakable hyphens into ASCII_HYPH. */ start = p = buf->buf + pos; while (*p != '\0') { sz = strcspn(p, "-\\"); p += sz; if (*p == '\0') break; if (*p == '\\') { /* Skip over escapes. */ p++; esc = mandoc_escape((const char **)&p, NULL, NULL); if (esc == ESCAPE_ERROR) break; while (*p == '-') p++; continue; } else if (p == start) { p++; continue; } if (isalpha((unsigned char)p[-1]) && isalpha((unsigned char)p[1])) *p = ASCII_HYPH; p++; } return ROFF_CONT; } int roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs, size_t len) { enum roff_tok t; int e; int pos; /* parse point */ int spos; /* saved parse point for messages */ int ppos; /* original offset in buf->buf */ int ctl; /* macro line (boolean) */ ppos = pos = *offs; if (len > 80 && r->tbl == NULL && r->eqn == NULL && (r->man->flags & ROFF_NOFILL) == 0 && strchr(" .\\", buf->buf[pos]) == NULL && buf->buf[pos] != r->control && strcspn(buf->buf, " ") < 80) mandoc_msg(MANDOCERR_TEXT_LONG, ln, (int)len - 1, "%.20s...", buf->buf + pos); /* Handle in-line equation delimiters. */ if (r->tbl == NULL && r->last_eqn != NULL && r->last_eqn->delim && (r->eqn == NULL || r->eqn_inline)) { e = roff_eqndelim(r, buf, pos); if (e == ROFF_REPARSE) return e; assert(e == ROFF_CONT); } /* Expand some escape sequences. */ e = roff_expand(r, buf, ln, pos, r->escape); if ((e & ROFF_MASK) == ROFF_IGN) return e; assert(e == ROFF_CONT); ctl = roff_getcontrol(r, buf->buf, &pos); /* * First, if a scope is open and we're not a macro, pass the * text through the macro's filter. * Equations process all content themselves. * Tables process almost all content themselves, but we want * to warn about macros before passing it there. */ if (r->last != NULL && ! ctl) { t = r->last->tok; e = (*roffs[t].text)(r, t, buf, ln, pos, pos, offs); if ((e & ROFF_MASK) == ROFF_IGN) return e; e &= ~ROFF_MASK; } else e = ROFF_IGN; if (r->eqn != NULL && strncmp(buf->buf + ppos, ".EN", 3)) { eqn_read(r->eqn, buf->buf + ppos); return e; } if (r->tbl != NULL && (ctl == 0 || buf->buf[pos] == '\0')) { tbl_read(r->tbl, ln, buf->buf, ppos); roff_addtbl(r->man, ln, r->tbl); return e; } if ( ! ctl) { r->options &= ~MPARSE_COMMENT; return roff_parsetext(r, buf, pos, offs) | e; } /* Skip empty request lines. */ if (buf->buf[pos] == '"') { mandoc_msg(MANDOCERR_COMMENT_BAD, ln, pos, NULL); return ROFF_IGN; } else if (buf->buf[pos] == '\0') return ROFF_IGN; /* * If a scope is open, go to the child handler for that macro, * as it may want to preprocess before doing anything with it. * Don't do so if an equation is open. */ if (r->last) { t = r->last->tok; return (*roffs[t].sub)(r, t, buf, ln, ppos, pos, offs); } /* No scope is open. This is a new request or macro. */ r->options &= ~MPARSE_COMMENT; spos = pos; t = roff_parse(r, buf->buf, &pos, ln, ppos); /* Tables ignore most macros. */ if (r->tbl != NULL && (t == TOKEN_NONE || t == ROFF_TS || t == ROFF_br || t == ROFF_ce || t == ROFF_rj || t == ROFF_sp)) { mandoc_msg(MANDOCERR_TBLMACRO, ln, pos, "%s", buf->buf + spos); if (t != TOKEN_NONE) return ROFF_IGN; while (buf->buf[pos] != '\0' && buf->buf[pos] != ' ') pos++; while (buf->buf[pos] == ' ') pos++; tbl_read(r->tbl, ln, buf->buf, pos); roff_addtbl(r->man, ln, r->tbl); return ROFF_IGN; } /* For now, let high level macros abort .ce mode. */ if (ctl && roffce_node != NULL && (t == TOKEN_NONE || t == ROFF_Dd || t == ROFF_EQ || t == ROFF_TH || t == ROFF_TS)) { r->man->last = roffce_node; r->man->next = ROFF_NEXT_SIBLING; roffce_lines = 0; roffce_node = NULL; } /* * This is neither a roff request nor a user-defined macro. * Let the standard macro set parsers handle it. */ if (t == TOKEN_NONE) return ROFF_CONT; /* Execute a roff request or a user defined macro. */ return (*roffs[t].proc)(r, t, buf, ln, spos, pos, offs); } /* * Internal interface function to tell the roff parser that execution * of the current macro ended. This is required because macro * definitions usually do not end with a .return request. */ void roff_userret(struct roff *r) { struct mctx *ctx; int i; assert(r->mstackpos >= 0); ctx = r->mstack + r->mstackpos; for (i = 0; i < ctx->argc; i++) free(ctx->argv[i]); ctx->argc = 0; r->mstackpos--; } void roff_endparse(struct roff *r) { if (r->last != NULL) mandoc_msg(MANDOCERR_BLK_NOEND, r->last->line, r->last->col, "%s", roff_name[r->last->tok]); if (r->eqn != NULL) { mandoc_msg(MANDOCERR_BLK_NOEND, r->eqn->node->line, r->eqn->node->pos, "EQ"); eqn_parse(r->eqn); r->eqn = NULL; } if (r->tbl != NULL) { tbl_end(r->tbl, 1); r->tbl = NULL; } } /* * Parse a roff node's type from the input buffer. This must be in the * form of ".foo xxx" in the usual way. */ static enum roff_tok roff_parse(struct roff *r, char *buf, int *pos, int ln, int ppos) { char *cp; const char *mac; size_t maclen; int deftype; enum roff_tok t; cp = buf + *pos; if ('\0' == *cp || '"' == *cp || '\t' == *cp || ' ' == *cp) return TOKEN_NONE; mac = cp; maclen = roff_getname(r, &cp, ln, ppos); deftype = ROFFDEF_USER | ROFFDEF_REN; r->current_string = roff_getstrn(r, mac, maclen, &deftype); switch (deftype) { case ROFFDEF_USER: t = ROFF_USERDEF; break; case ROFFDEF_REN: t = ROFF_RENAMED; break; default: t = roffhash_find(r->reqtab, mac, maclen); break; } if (t != TOKEN_NONE) *pos = cp - buf; else if (deftype == ROFFDEF_UNDEF) { /* Using an undefined macro defines it to be empty. */ roff_setstrn(&r->strtab, mac, maclen, "", 0, 0); roff_setstrn(&r->rentab, mac, maclen, NULL, 0, 0); } return t; } /* --- handling of request blocks ----------------------------------------- */ /* * Close a macro definition block or an "ignore" block. */ static int roff_cblock(ROFF_ARGS) { int rr; if (r->last == NULL) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, ".."); return ROFF_IGN; } switch (r->last->tok) { case ROFF_am: case ROFF_ami: case ROFF_de: case ROFF_dei: case ROFF_ig: break; case ROFF_am1: case ROFF_de1: /* Remapped in roff_block(). */ abort(); default: mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, ".."); return ROFF_IGN; } roffnode_pop(r); roffnode_cleanscope(r); /* * If a conditional block with braces is still open, * check for "\}" block end markers. */ if (r->last != NULL && r->last->endspan < 0) { rr = 1; /* If arguments follow "\}", warn about them. */ roff_cond_checkend(r, tok, buf, ln, ppos, pos, &rr); } if (buf->buf[pos] != '\0') mandoc_msg(MANDOCERR_ARG_SKIP, ln, pos, ".. %s", buf->buf + pos); return ROFF_IGN; } /* * Pop all nodes ending at the end of the current input line. * Return the number of loops ended. */ static int roffnode_cleanscope(struct roff *r) { int inloop; inloop = 0; while (r->last != NULL && r->last->endspan > 0) { if (--r->last->endspan != 0) break; inloop += roffnode_pop(r); } return inloop; } /* * Handle the closing "\}" of a conditional block. * Apart from generating warnings, this only pops nodes. * Return the number of loops ended. */ static int roff_ccond(struct roff *r, int ln, int ppos) { if (NULL == r->last) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, "\\}"); return 0; } switch (r->last->tok) { case ROFF_el: case ROFF_ie: case ROFF_if: case ROFF_while: break; default: mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, "\\}"); return 0; } if (r->last->endspan > -1) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, "\\}"); return 0; } return roffnode_pop(r) + roffnode_cleanscope(r); } static int roff_block(ROFF_ARGS) { const char *name, *value; char *call, *cp, *iname, *rname; size_t csz, namesz, rsz; int deftype; /* Ignore groff compatibility mode for now. */ if (tok == ROFF_de1) tok = ROFF_de; else if (tok == ROFF_dei1) tok = ROFF_dei; else if (tok == ROFF_am1) tok = ROFF_am; else if (tok == ROFF_ami1) tok = ROFF_ami; /* Parse the macro name argument. */ cp = buf->buf + pos; if (tok == ROFF_ig) { iname = NULL; namesz = 0; } else { iname = cp; namesz = roff_getname(r, &cp, ln, ppos); iname[namesz] = '\0'; } /* Resolve the macro name argument if it is indirect. */ if (namesz && (tok == ROFF_dei || tok == ROFF_ami)) { deftype = ROFFDEF_USER; name = roff_getstrn(r, iname, namesz, &deftype); if (name == NULL) { mandoc_msg(MANDOCERR_STR_UNDEF, ln, (int)(iname - buf->buf), "%.*s", (int)namesz, iname); namesz = 0; } else namesz = strlen(name); } else name = iname; if (namesz == 0 && tok != ROFF_ig) { mandoc_msg(MANDOCERR_REQ_EMPTY, ln, ppos, "%s", roff_name[tok]); return ROFF_IGN; } roffnode_push(r, tok, name, ln, ppos); /* * At the beginning of a `de' macro, clear the existing string * with the same name, if there is one. New content will be * appended from roff_block_text() in multiline mode. */ if (tok == ROFF_de || tok == ROFF_dei) { roff_setstrn(&r->strtab, name, namesz, "", 0, 0); roff_setstrn(&r->rentab, name, namesz, NULL, 0, 0); } else if (tok == ROFF_am || tok == ROFF_ami) { deftype = ROFFDEF_ANY; value = roff_getstrn(r, iname, namesz, &deftype); switch (deftype) { /* Before appending, ... */ case ROFFDEF_PRE: /* copy predefined to user-defined. */ roff_setstrn(&r->strtab, name, namesz, value, strlen(value), 0); break; case ROFFDEF_REN: /* call original standard macro. */ csz = mandoc_asprintf(&call, ".%.*s \\$* \\\"\n", (int)strlen(value), value); roff_setstrn(&r->strtab, name, namesz, call, csz, 0); roff_setstrn(&r->rentab, name, namesz, NULL, 0, 0); free(call); break; case ROFFDEF_STD: /* rename and call standard macro. */ rsz = mandoc_asprintf(&rname, "__%s_renamed", name); roff_setstrn(&r->rentab, rname, rsz, name, namesz, 0); csz = mandoc_asprintf(&call, ".%.*s \\$* \\\"\n", (int)rsz, rname); roff_setstrn(&r->strtab, name, namesz, call, csz, 0); free(call); free(rname); break; default: break; } } if (*cp == '\0') return ROFF_IGN; /* Get the custom end marker. */ iname = cp; namesz = roff_getname(r, &cp, ln, ppos); /* Resolve the end marker if it is indirect. */ if (namesz && (tok == ROFF_dei || tok == ROFF_ami)) { deftype = ROFFDEF_USER; name = roff_getstrn(r, iname, namesz, &deftype); if (name == NULL) { mandoc_msg(MANDOCERR_STR_UNDEF, ln, (int)(iname - buf->buf), "%.*s", (int)namesz, iname); namesz = 0; } else namesz = strlen(name); } else name = iname; if (namesz) r->last->end = mandoc_strndup(name, namesz); if (*cp != '\0') mandoc_msg(MANDOCERR_ARG_EXCESS, ln, pos, ".%s ... %s", roff_name[tok], cp); return ROFF_IGN; } static int roff_block_sub(ROFF_ARGS) { enum roff_tok t; int i, j; /* * First check whether a custom macro exists at this level. If * it does, then check against it. This is some of groff's * stranger behaviours. If we encountered a custom end-scope * tag and that tag also happens to be a "real" macro, then we * need to try interpreting it again as a real macro. If it's * not, then return ignore. Else continue. */ if (r->last->end) { for (i = pos, j = 0; r->last->end[j]; j++, i++) if (buf->buf[i] != r->last->end[j]) break; if (r->last->end[j] == '\0' && (buf->buf[i] == '\0' || buf->buf[i] == ' ' || buf->buf[i] == '\t')) { roffnode_pop(r); roffnode_cleanscope(r); while (buf->buf[i] == ' ' || buf->buf[i] == '\t') i++; pos = i; if (roff_parse(r, buf->buf, &pos, ln, ppos) != TOKEN_NONE) return ROFF_RERUN; return ROFF_IGN; } } /* * If we have no custom end-query or lookup failed, then try * pulling it out of the hashtable. */ t = roff_parse(r, buf->buf, &pos, ln, ppos); if (t != ROFF_cblock) { if (tok != ROFF_ig) roff_setstr(r, r->last->name, buf->buf + ppos, 2); return ROFF_IGN; } return (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs); } static int roff_block_text(ROFF_ARGS) { if (tok != ROFF_ig) roff_setstr(r, r->last->name, buf->buf + pos, 2); return ROFF_IGN; } /* * Check for a closing "\}" and handle it. * In this function, the final "int *offs" argument is used for * different purposes than elsewhere: * Input: *offs == 0: caller wants to discard arguments following \} * *offs == 1: caller wants to preserve text following \} * Output: *offs = 0: tell caller to discard input line * *offs = 1: tell caller to use input line */ static int roff_cond_checkend(ROFF_ARGS) { char *ep; int endloop, irc, rr; irc = ROFF_IGN; rr = r->last->rule; endloop = tok != ROFF_while ? ROFF_IGN : rr ? ROFF_LOOPCONT : ROFF_LOOPEXIT; if (roffnode_cleanscope(r)) irc |= endloop; /* * If "\}" occurs on a macro line without a preceding macro or * a text line contains nothing else, drop the line completely. */ ep = buf->buf + pos; if (ep[0] == '\\' && ep[1] == '}' && (ep[2] == '\0' || *offs == 0)) rr = 0; /* * The closing delimiter "\}" rewinds the conditional scope * but is otherwise ignored when interpreting the line. */ while ((ep = strchr(ep, '\\')) != NULL) { switch (ep[1]) { case '}': if (ep[2] == '\0') ep[0] = '\0'; else if (rr) ep[1] = '&'; else memmove(ep, ep + 2, strlen(ep + 2) + 1); if (roff_ccond(r, ln, ep - buf->buf)) irc |= endloop; break; case '\0': ++ep; break; default: ep += 2; break; } } *offs = rr; return irc; } /* * Parse and process a request or macro line in conditional scope. */ static int roff_cond_sub(ROFF_ARGS) { struct roffnode *bl; int irc, rr; enum roff_tok t; rr = 0; /* If arguments follow "\}", skip them. */ irc = roff_cond_checkend(r, tok, buf, ln, ppos, pos, &rr); t = roff_parse(r, buf->buf, &pos, ln, ppos); /* For now, let high level macros abort .ce mode. */ if (roffce_node != NULL && (t == TOKEN_NONE || t == ROFF_Dd || t == ROFF_EQ || t == ROFF_TH || t == ROFF_TS)) { r->man->last = roffce_node; r->man->next = ROFF_NEXT_SIBLING; roffce_lines = 0; roffce_node = NULL; } /* * Fully handle known macros when they are structurally * required or when the conditional evaluated to true. */ if (t == ROFF_break) { if (irc & ROFF_LOOPMASK) irc = ROFF_IGN | ROFF_LOOPEXIT; else if (rr) { for (bl = r->last; bl != NULL; bl = bl->parent) { bl->rule = 0; if (bl->tok == ROFF_while) break; } } } else if (t != TOKEN_NONE && (rr || roffs[t].flags & ROFFMAC_STRUCT)) irc |= (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs); else irc |= rr ? ROFF_CONT : ROFF_IGN; return irc; } /* * Parse and process a text line in conditional scope. */ static int roff_cond_text(ROFF_ARGS) { int irc, rr; rr = 1; /* If arguments follow "\}", preserve them. */ irc = roff_cond_checkend(r, tok, buf, ln, ppos, pos, &rr); if (rr) irc |= ROFF_CONT; return irc; } /* --- handling of numeric and conditional expressions -------------------- */ /* * Parse a single signed integer number. Stop at the first non-digit. * If there is at least one digit, return success and advance the * parse point, else return failure and let the parse point unchanged. * Ignore overflows, treat them just like the C language. */ static int roff_getnum(const char *v, int *pos, int *res, int flags) { int myres, scaled, n, p; if (NULL == res) res = &myres; p = *pos; n = v[p] == '-'; if (n || v[p] == '+') p++; if (flags & ROFFNUM_WHITE) while (isspace((unsigned char)v[p])) p++; for (*res = 0; isdigit((unsigned char)v[p]); p++) *res = 10 * *res + v[p] - '0'; if (p == *pos + n) return 0; if (n) *res = -*res; /* Each number may be followed by one optional scaling unit. */ switch (v[p]) { case 'f': scaled = *res * 65536; break; case 'i': scaled = *res * 240; break; case 'c': scaled = *res * 240 / 2.54; break; case 'v': case 'P': scaled = *res * 40; break; case 'm': case 'n': scaled = *res * 24; break; case 'p': scaled = *res * 10 / 3; break; case 'u': scaled = *res; break; case 'M': scaled = *res * 6 / 25; break; default: scaled = *res; p--; break; } if (flags & ROFFNUM_SCALE) *res = scaled; *pos = p + 1; return 1; } /* * Evaluate a string comparison condition. * The first character is the delimiter. * Succeed if the string up to its second occurrence * matches the string up to its third occurence. * Advance the cursor after the third occurrence * or lacking that, to the end of the line. */ static int roff_evalstrcond(const char *v, int *pos) { const char *s1, *s2, *s3; int match; match = 0; s1 = v + *pos; /* initial delimiter */ s2 = s1 + 1; /* for scanning the first string */ s3 = strchr(s2, *s1); /* for scanning the second string */ if (NULL == s3) /* found no middle delimiter */ goto out; while ('\0' != *++s3) { if (*s2 != *s3) { /* mismatch */ s3 = strchr(s3, *s1); break; } if (*s3 == *s1) { /* found the final delimiter */ match = 1; break; } s2++; } out: if (NULL == s3) s3 = strchr(s2, '\0'); else if (*s3 != '\0') s3++; *pos = s3 - v; return match; } /* * Evaluate an optionally negated single character, numerical, * or string condition. */ static int roff_evalcond(struct roff *r, int ln, char *v, int *pos) { const char *start, *end; char *cp, *name; size_t sz; int deftype, len, number, savepos, istrue, wanttrue; if ('!' == v[*pos]) { wanttrue = 0; (*pos)++; } else wanttrue = 1; switch (v[*pos]) { case '\0': return 0; case 'n': case 'o': (*pos)++; return wanttrue; case 'e': case 't': case 'v': (*pos)++; return !wanttrue; case 'c': do { (*pos)++; } while (v[*pos] == ' '); /* * Quirk for groff compatibility: * The horizontal tab is neither available nor unavailable. */ if (v[*pos] == '\t') { (*pos)++; return 0; } /* Printable ASCII characters are available. */ if (v[*pos] != '\\') { (*pos)++; return wanttrue; } end = v + ++*pos; switch (mandoc_escape(&end, &start, &len)) { case ESCAPE_SPECIAL: istrue = mchars_spec2cp(start, len) != -1; break; case ESCAPE_UNICODE: istrue = 1; break; case ESCAPE_NUMBERED: istrue = mchars_num2char(start, len) != -1; break; default: istrue = !wanttrue; break; } *pos = end - v; return istrue == wanttrue; case 'd': case 'r': cp = v + *pos + 1; while (*cp == ' ') cp++; name = cp; sz = roff_getname(r, &cp, ln, cp - v); if (sz == 0) istrue = 0; else if (v[*pos] == 'r') istrue = roff_hasregn(r, name, sz); else { deftype = ROFFDEF_ANY; roff_getstrn(r, name, sz, &deftype); istrue = !!deftype; } *pos = (name + sz) - v; return istrue == wanttrue; default: break; } savepos = *pos; if (roff_evalnum(r, ln, v, pos, &number, ROFFNUM_SCALE)) return (number > 0) == wanttrue; else if (*pos == savepos) return roff_evalstrcond(v, pos) == wanttrue; else return 0; } static int roff_line_ignore(ROFF_ARGS) { return ROFF_IGN; } static int roff_insec(ROFF_ARGS) { mandoc_msg(MANDOCERR_REQ_INSEC, ln, ppos, "%s", roff_name[tok]); return ROFF_IGN; } static int roff_unsupp(ROFF_ARGS) { mandoc_msg(MANDOCERR_REQ_UNSUPP, ln, ppos, "%s", roff_name[tok]); return ROFF_IGN; } static int roff_cond(ROFF_ARGS) { int irc; roffnode_push(r, tok, NULL, ln, ppos); /* * An `.el' has no conditional body: it will consume the value * of the current rstack entry set in prior `ie' calls or * defaults to DENY. * * If we're not an `el', however, then evaluate the conditional. */ r->last->rule = tok == ROFF_el ? (r->rstackpos < 0 ? 0 : r->rstack[r->rstackpos--]) : roff_evalcond(r, ln, buf->buf, &pos); /* * An if-else will put the NEGATION of the current evaluated * conditional into the stack of rules. */ if (tok == ROFF_ie) { if (r->rstackpos + 1 == r->rstacksz) { r->rstacksz += 16; r->rstack = mandoc_reallocarray(r->rstack, r->rstacksz, sizeof(int)); } r->rstack[++r->rstackpos] = !r->last->rule; } /* If the parent has false as its rule, then so do we. */ if (r->last->parent && !r->last->parent->rule) r->last->rule = 0; /* * Determine scope. * If there is nothing on the line after the conditional, * not even whitespace, use next-line scope. * Except that .while does not support next-line scope. */ if (buf->buf[pos] == '\0' && tok != ROFF_while) { r->last->endspan = 2; goto out; } while (buf->buf[pos] == ' ') pos++; /* An opening brace requests multiline scope. */ if (buf->buf[pos] == '\\' && buf->buf[pos + 1] == '{') { r->last->endspan = -1; pos += 2; while (buf->buf[pos] == ' ') pos++; goto out; } /* * Anything else following the conditional causes * single-line scope. Warn if the scope contains * nothing but trailing whitespace. */ if (buf->buf[pos] == '\0') mandoc_msg(MANDOCERR_COND_EMPTY, ln, ppos, "%s", roff_name[tok]); r->last->endspan = 1; out: *offs = pos; irc = ROFF_RERUN; if (tok == ROFF_while) irc |= ROFF_WHILE; return irc; } static int roff_ds(ROFF_ARGS) { char *string; const char *name; size_t namesz; /* Ignore groff compatibility mode for now. */ if (tok == ROFF_ds1) tok = ROFF_ds; else if (tok == ROFF_as1) tok = ROFF_as; /* * The first word is the name of the string. * If it is empty or terminated by an escape sequence, * abort the `ds' request without defining anything. */ name = string = buf->buf + pos; if (*name == '\0') return ROFF_IGN; namesz = roff_getname(r, &string, ln, pos); switch (name[namesz]) { case '\\': return ROFF_IGN; case '\t': string = buf->buf + pos + namesz; break; default: break; } /* Read past the initial double-quote, if any. */ if (*string == '"') string++; /* The rest is the value. */ roff_setstrn(&r->strtab, name, namesz, string, strlen(string), ROFF_as == tok); roff_setstrn(&r->rentab, name, namesz, NULL, 0, 0); return ROFF_IGN; } /* * Parse a single operator, one or two characters long. * If the operator is recognized, return success and advance the * parse point, else return failure and let the parse point unchanged. */ static int roff_getop(const char *v, int *pos, char *res) { *res = v[*pos]; switch (*res) { case '+': case '-': case '*': case '/': case '%': case '&': case ':': break; case '<': switch (v[*pos + 1]) { case '=': *res = 'l'; (*pos)++; break; case '>': *res = '!'; (*pos)++; break; case '?': *res = 'i'; (*pos)++; break; default: break; } break; case '>': switch (v[*pos + 1]) { case '=': *res = 'g'; (*pos)++; break; case '?': *res = 'a'; (*pos)++; break; default: break; } break; case '=': if ('=' == v[*pos + 1]) (*pos)++; break; default: return 0; } (*pos)++; return *res; } /* * Evaluate either a parenthesized numeric expression * or a single signed integer number. */ static int roff_evalpar(struct roff *r, int ln, const char *v, int *pos, int *res, int flags) { if ('(' != v[*pos]) return roff_getnum(v, pos, res, flags); (*pos)++; if ( ! roff_evalnum(r, ln, v, pos, res, flags | ROFFNUM_WHITE)) return 0; /* * Omission of the closing parenthesis * is an error in validation mode, * but ignored in evaluation mode. */ if (')' == v[*pos]) (*pos)++; else if (NULL == res) return 0; return 1; } /* * Evaluate a complete numeric expression. * Proceed left to right, there is no concept of precedence. */ static int roff_evalnum(struct roff *r, int ln, const char *v, int *pos, int *res, int flags) { int mypos, operand2; char operator; if (NULL == pos) { mypos = 0; pos = &mypos; } if (flags & ROFFNUM_WHITE) while (isspace((unsigned char)v[*pos])) (*pos)++; if ( ! roff_evalpar(r, ln, v, pos, res, flags)) return 0; while (1) { if (flags & ROFFNUM_WHITE) while (isspace((unsigned char)v[*pos])) (*pos)++; if ( ! roff_getop(v, pos, &operator)) break; if (flags & ROFFNUM_WHITE) while (isspace((unsigned char)v[*pos])) (*pos)++; if ( ! roff_evalpar(r, ln, v, pos, &operand2, flags)) return 0; if (flags & ROFFNUM_WHITE) while (isspace((unsigned char)v[*pos])) (*pos)++; if (NULL == res) continue; switch (operator) { case '+': *res += operand2; break; case '-': *res -= operand2; break; case '*': *res *= operand2; break; case '/': if (operand2 == 0) { mandoc_msg(MANDOCERR_DIVZERO, ln, *pos, "%s", v); *res = 0; break; } *res /= operand2; break; case '%': if (operand2 == 0) { mandoc_msg(MANDOCERR_DIVZERO, ln, *pos, "%s", v); *res = 0; break; } *res %= operand2; break; case '<': *res = *res < operand2; break; case '>': *res = *res > operand2; break; case 'l': *res = *res <= operand2; break; case 'g': *res = *res >= operand2; break; case '=': *res = *res == operand2; break; case '!': *res = *res != operand2; break; case '&': *res = *res && operand2; break; case ':': *res = *res || operand2; break; case 'i': if (operand2 < *res) *res = operand2; break; case 'a': if (operand2 > *res) *res = operand2; break; default: abort(); } } return 1; } /* --- register management ------------------------------------------------ */ void roff_setreg(struct roff *r, const char *name, int val, char sign) { roff_setregn(r, name, strlen(name), val, sign, INT_MIN); } static void roff_setregn(struct roff *r, const char *name, size_t len, int val, char sign, int step) { struct roffreg *reg; /* Search for an existing register with the same name. */ reg = r->regtab; while (reg != NULL && (reg->key.sz != len || strncmp(reg->key.p, name, len) != 0)) reg = reg->next; if (NULL == reg) { /* Create a new register. */ reg = mandoc_malloc(sizeof(struct roffreg)); reg->key.p = mandoc_strndup(name, len); reg->key.sz = len; reg->val = 0; reg->step = 0; reg->next = r->regtab; r->regtab = reg; } if ('+' == sign) reg->val += val; else if ('-' == sign) reg->val -= val; else reg->val = val; if (step != INT_MIN) reg->step = step; } /* * Handle some predefined read-only number registers. * For now, return -1 if the requested register is not predefined; * in case a predefined read-only register having the value -1 * were to turn up, another special value would have to be chosen. */ static int roff_getregro(const struct roff *r, const char *name) { switch (*name) { case '$': /* Number of arguments of the last macro evaluated. */ return r->mstackpos < 0 ? 0 : r->mstack[r->mstackpos].argc; case 'A': /* ASCII approximation mode is always off. */ return 0; case 'g': /* Groff compatibility mode is always on. */ return 1; case 'H': /* Fixed horizontal resolution. */ return 24; case 'j': /* Always adjust left margin only. */ return 0; case 'T': /* Some output device is always defined. */ return 1; case 'V': /* Fixed vertical resolution. */ return 40; default: return -1; } } int roff_getreg(struct roff *r, const char *name) { return roff_getregn(r, name, strlen(name), '\0'); } static int roff_getregn(struct roff *r, const char *name, size_t len, char sign) { struct roffreg *reg; int val; if ('.' == name[0] && 2 == len) { val = roff_getregro(r, name + 1); if (-1 != val) return val; } for (reg = r->regtab; reg; reg = reg->next) { if (len == reg->key.sz && 0 == strncmp(name, reg->key.p, len)) { switch (sign) { case '+': reg->val += reg->step; break; case '-': reg->val -= reg->step; break; default: break; } return reg->val; } } roff_setregn(r, name, len, 0, '\0', INT_MIN); return 0; } static int roff_hasregn(const struct roff *r, const char *name, size_t len) { struct roffreg *reg; int val; if ('.' == name[0] && 2 == len) { val = roff_getregro(r, name + 1); if (-1 != val) return 1; } for (reg = r->regtab; reg; reg = reg->next) if (len == reg->key.sz && 0 == strncmp(name, reg->key.p, len)) return 1; return 0; } static void roff_freereg(struct roffreg *reg) { struct roffreg *old_reg; while (NULL != reg) { free(reg->key.p); old_reg = reg; reg = reg->next; free(old_reg); } } static int roff_nr(ROFF_ARGS) { char *key, *val, *step; size_t keysz; int iv, is, len; char sign; key = val = buf->buf + pos; if (*key == '\0') return ROFF_IGN; keysz = roff_getname(r, &val, ln, pos); if (key[keysz] == '\\' || key[keysz] == '\t') return ROFF_IGN; sign = *val; if (sign == '+' || sign == '-') val++; len = 0; if (roff_evalnum(r, ln, val, &len, &iv, ROFFNUM_SCALE) == 0) return ROFF_IGN; step = val + len; while (isspace((unsigned char)*step)) step++; if (roff_evalnum(r, ln, step, NULL, &is, 0) == 0) is = INT_MIN; roff_setregn(r, key, keysz, iv, sign, is); return ROFF_IGN; } static int roff_rr(ROFF_ARGS) { struct roffreg *reg, **prev; char *name, *cp; size_t namesz; name = cp = buf->buf + pos; if (*name == '\0') return ROFF_IGN; namesz = roff_getname(r, &cp, ln, pos); name[namesz] = '\0'; prev = &r->regtab; while (1) { reg = *prev; if (reg == NULL || !strcmp(name, reg->key.p)) break; prev = ®->next; } if (reg != NULL) { *prev = reg->next; free(reg->key.p); free(reg); } return ROFF_IGN; } /* --- handler functions for roff requests -------------------------------- */ static int roff_rm(ROFF_ARGS) { const char *name; char *cp; size_t namesz; cp = buf->buf + pos; while (*cp != '\0') { name = cp; namesz = roff_getname(r, &cp, ln, (int)(cp - buf->buf)); roff_setstrn(&r->strtab, name, namesz, NULL, 0, 0); roff_setstrn(&r->rentab, name, namesz, NULL, 0, 0); if (name[namesz] == '\\' || name[namesz] == '\t') break; } return ROFF_IGN; } static int roff_it(ROFF_ARGS) { int iv; /* Parse the number of lines. */ if ( ! roff_evalnum(r, ln, buf->buf, &pos, &iv, 0)) { mandoc_msg(MANDOCERR_IT_NONUM, ln, ppos, "%s", buf->buf + 1); return ROFF_IGN; } while (isspace((unsigned char)buf->buf[pos])) pos++; /* * Arm the input line trap. * Special-casing "an-trap" is an ugly workaround to cope * with DocBook stupidly fiddling with man(7) internals. */ roffit_lines = iv; roffit_macro = mandoc_strdup(iv != 1 || strcmp(buf->buf + pos, "an-trap") ? buf->buf + pos : "br"); return ROFF_IGN; } static int roff_Dd(ROFF_ARGS) { int mask; enum roff_tok t, te; switch (tok) { case ROFF_Dd: tok = MDOC_Dd; te = MDOC_MAX; if (r->format == 0) r->format = MPARSE_MDOC; mask = MPARSE_MDOC | MPARSE_QUICK; break; case ROFF_TH: tok = MAN_TH; te = MAN_MAX; if (r->format == 0) r->format = MPARSE_MAN; mask = MPARSE_QUICK; break; default: abort(); } if ((r->options & mask) == 0) for (t = tok; t < te; t++) roff_setstr(r, roff_name[t], NULL, 0); return ROFF_CONT; } static int roff_TE(ROFF_ARGS) { r->man->flags &= ~ROFF_NONOFILL; if (r->tbl == NULL) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, "TE"); return ROFF_IGN; } if (tbl_end(r->tbl, 0) == 0) { r->tbl = NULL; free(buf->buf); buf->buf = mandoc_strdup(".sp"); buf->sz = 4; *offs = 0; return ROFF_REPARSE; } r->tbl = NULL; return ROFF_IGN; } static int roff_T_(ROFF_ARGS) { if (NULL == r->tbl) mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, "T&"); else tbl_restart(ln, ppos, r->tbl); return ROFF_IGN; } /* * Handle in-line equation delimiters. */ static int roff_eqndelim(struct roff *r, struct buf *buf, int pos) { char *cp1, *cp2; const char *bef_pr, *bef_nl, *mac, *aft_nl, *aft_pr; /* * Outside equations, look for an opening delimiter. * If we are inside an equation, we already know it is * in-line, or this function wouldn't have been called; * so look for a closing delimiter. */ cp1 = buf->buf + pos; cp2 = strchr(cp1, r->eqn == NULL ? r->last_eqn->odelim : r->last_eqn->cdelim); if (cp2 == NULL) return ROFF_CONT; *cp2++ = '\0'; bef_pr = bef_nl = aft_nl = aft_pr = ""; /* Handle preceding text, protecting whitespace. */ if (*buf->buf != '\0') { if (r->eqn == NULL) bef_pr = "\\&"; bef_nl = "\n"; } /* * Prepare replacing the delimiter with an equation macro * and drop leading white space from the equation. */ if (r->eqn == NULL) { while (*cp2 == ' ') cp2++; mac = ".EQ"; } else mac = ".EN"; /* Handle following text, protecting whitespace. */ if (*cp2 != '\0') { aft_nl = "\n"; if (r->eqn != NULL) aft_pr = "\\&"; } /* Do the actual replacement. */ buf->sz = mandoc_asprintf(&cp1, "%s%s%s%s%s%s%s", buf->buf, bef_pr, bef_nl, mac, aft_nl, aft_pr, cp2) + 1; free(buf->buf); buf->buf = cp1; /* Toggle the in-line state of the eqn subsystem. */ r->eqn_inline = r->eqn == NULL; return ROFF_REPARSE; } static int roff_EQ(ROFF_ARGS) { struct roff_node *n; if (r->man->meta.macroset == MACROSET_MAN) man_breakscope(r->man, ROFF_EQ); n = roff_node_alloc(r->man, ln, ppos, ROFFT_EQN, TOKEN_NONE); if (ln > r->man->last->line) n->flags |= NODE_LINE; n->eqn = eqn_box_new(); roff_node_append(r->man, n); r->man->next = ROFF_NEXT_SIBLING; assert(r->eqn == NULL); if (r->last_eqn == NULL) r->last_eqn = eqn_alloc(); else eqn_reset(r->last_eqn); r->eqn = r->last_eqn; r->eqn->node = n; if (buf->buf[pos] != '\0') mandoc_msg(MANDOCERR_ARG_SKIP, ln, pos, ".EQ %s", buf->buf + pos); return ROFF_IGN; } static int roff_EN(ROFF_ARGS) { if (r->eqn != NULL) { eqn_parse(r->eqn); r->eqn = NULL; } else mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, "EN"); if (buf->buf[pos] != '\0') mandoc_msg(MANDOCERR_ARG_SKIP, ln, pos, "EN %s", buf->buf + pos); return ROFF_IGN; } static int roff_TS(ROFF_ARGS) { if (r->tbl != NULL) { mandoc_msg(MANDOCERR_BLK_BROKEN, ln, ppos, "TS breaks TS"); tbl_end(r->tbl, 0); } r->man->flags |= ROFF_NONOFILL; r->tbl = tbl_alloc(ppos, ln, r->last_tbl); if (r->last_tbl == NULL) r->first_tbl = r->tbl; r->last_tbl = r->tbl; return ROFF_IGN; } static int roff_noarg(ROFF_ARGS) { if (r->man->flags & (MAN_BLINE | MAN_ELINE)) man_breakscope(r->man, tok); if (tok == ROFF_brp) tok = ROFF_br; roff_elem_alloc(r->man, ln, ppos, tok); if (buf->buf[pos] != '\0') mandoc_msg(MANDOCERR_ARG_SKIP, ln, pos, "%s %s", roff_name[tok], buf->buf + pos); if (tok == ROFF_nf) r->man->flags |= ROFF_NOFILL; else if (tok == ROFF_fi) r->man->flags &= ~ROFF_NOFILL; r->man->last->flags |= NODE_LINE | NODE_VALID | NODE_ENDED; r->man->next = ROFF_NEXT_SIBLING; return ROFF_IGN; } static int roff_onearg(ROFF_ARGS) { struct roff_node *n; char *cp; int npos; if (r->man->flags & (MAN_BLINE | MAN_ELINE) && (tok == ROFF_ce || tok == ROFF_rj || tok == ROFF_sp || tok == ROFF_ti)) man_breakscope(r->man, tok); if (roffce_node != NULL && (tok == ROFF_ce || tok == ROFF_rj)) { r->man->last = roffce_node; r->man->next = ROFF_NEXT_SIBLING; } roff_elem_alloc(r->man, ln, ppos, tok); n = r->man->last; cp = buf->buf + pos; if (*cp != '\0') { while (*cp != '\0' && *cp != ' ') cp++; while (*cp == ' ') *cp++ = '\0'; if (*cp != '\0') mandoc_msg(MANDOCERR_ARG_EXCESS, ln, (int)(cp - buf->buf), "%s ... %s", roff_name[tok], cp); roff_word_alloc(r->man, ln, pos, buf->buf + pos); } if (tok == ROFF_ce || tok == ROFF_rj) { if (r->man->last->type == ROFFT_ELEM) { roff_word_alloc(r->man, ln, pos, "1"); r->man->last->flags |= NODE_NOSRC; } npos = 0; if (roff_evalnum(r, ln, r->man->last->string, &npos, &roffce_lines, 0) == 0) { mandoc_msg(MANDOCERR_CE_NONUM, ln, pos, "ce %s", buf->buf + pos); roffce_lines = 1; } if (roffce_lines < 1) { r->man->last = r->man->last->parent; roffce_node = NULL; roffce_lines = 0; } else roffce_node = r->man->last->parent; } else { n->flags |= NODE_VALID | NODE_ENDED; r->man->last = n; } n->flags |= NODE_LINE; r->man->next = ROFF_NEXT_SIBLING; return ROFF_IGN; } static int roff_manyarg(ROFF_ARGS) { struct roff_node *n; char *sp, *ep; roff_elem_alloc(r->man, ln, ppos, tok); n = r->man->last; for (sp = ep = buf->buf + pos; *sp != '\0'; sp = ep) { while (*ep != '\0' && *ep != ' ') ep++; while (*ep == ' ') *ep++ = '\0'; roff_word_alloc(r->man, ln, sp - buf->buf, sp); } n->flags |= NODE_LINE | NODE_VALID | NODE_ENDED; r->man->last = n; r->man->next = ROFF_NEXT_SIBLING; return ROFF_IGN; } static int roff_als(ROFF_ARGS) { char *oldn, *newn, *end, *value; size_t oldsz, newsz, valsz; newn = oldn = buf->buf + pos; if (*newn == '\0') return ROFF_IGN; newsz = roff_getname(r, &oldn, ln, pos); if (newn[newsz] == '\\' || newn[newsz] == '\t' || *oldn == '\0') return ROFF_IGN; end = oldn; oldsz = roff_getname(r, &end, ln, oldn - buf->buf); if (oldsz == 0) return ROFF_IGN; valsz = mandoc_asprintf(&value, ".%.*s \\$@\\\"\n", (int)oldsz, oldn); roff_setstrn(&r->strtab, newn, newsz, value, valsz, 0); roff_setstrn(&r->rentab, newn, newsz, NULL, 0, 0); free(value); return ROFF_IGN; } /* * The .break request only makes sense inside conditionals, * and that case is already handled in roff_cond_sub(). */ static int roff_break(ROFF_ARGS) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, pos, "break"); return ROFF_IGN; } static int roff_cc(ROFF_ARGS) { const char *p; p = buf->buf + pos; if (*p == '\0' || (r->control = *p++) == '.') r->control = '\0'; if (*p != '\0') mandoc_msg(MANDOCERR_ARG_EXCESS, ln, p - buf->buf, "cc ... %s", p); return ROFF_IGN; } static int roff_char(ROFF_ARGS) { const char *p, *kp, *vp; size_t ksz, vsz; int font; /* Parse the character to be replaced. */ kp = buf->buf + pos; p = kp + 1; if (*kp == '\0' || (*kp == '\\' && mandoc_escape(&p, NULL, NULL) != ESCAPE_SPECIAL) || (*p != ' ' && *p != '\0')) { mandoc_msg(MANDOCERR_CHAR_ARG, ln, pos, "char %s", kp); return ROFF_IGN; } ksz = p - kp; while (*p == ' ') p++; /* * If the replacement string contains a font escape sequence, * we have to restore the font at the end. */ vp = p; vsz = strlen(p); font = 0; while (*p != '\0') { if (*p++ != '\\') continue; switch (mandoc_escape(&p, NULL, NULL)) { case ESCAPE_FONT: case ESCAPE_FONTROMAN: case ESCAPE_FONTITALIC: case ESCAPE_FONTBOLD: case ESCAPE_FONTBI: case ESCAPE_FONTCR: case ESCAPE_FONTCB: case ESCAPE_FONTCI: case ESCAPE_FONTPREV: font++; break; default: break; } } if (font > 1) mandoc_msg(MANDOCERR_CHAR_FONT, ln, (int)(vp - buf->buf), "%s", vp); /* * Approximate the effect of .char using the .tr tables. * XXX In groff, .char and .tr interact differently. */ if (ksz == 1) { if (r->xtab == NULL) r->xtab = mandoc_calloc(128, sizeof(*r->xtab)); assert((unsigned int)*kp < 128); free(r->xtab[(int)*kp].p); r->xtab[(int)*kp].sz = mandoc_asprintf(&r->xtab[(int)*kp].p, "%s%s", vp, font ? "\fP" : ""); } else { roff_setstrn(&r->xmbtab, kp, ksz, vp, vsz, 0); if (font) roff_setstrn(&r->xmbtab, kp, ksz, "\\fP", 3, 1); } return ROFF_IGN; } static int roff_ec(ROFF_ARGS) { const char *p; p = buf->buf + pos; if (*p == '\0') r->escape = '\\'; else { r->escape = *p; if (*++p != '\0') mandoc_msg(MANDOCERR_ARG_EXCESS, ln, (int)(p - buf->buf), "ec ... %s", p); } return ROFF_IGN; } static int roff_eo(ROFF_ARGS) { r->escape = '\0'; if (buf->buf[pos] != '\0') mandoc_msg(MANDOCERR_ARG_SKIP, ln, pos, "eo %s", buf->buf + pos); return ROFF_IGN; } static int roff_nop(ROFF_ARGS) { while (buf->buf[pos] == ' ') pos++; *offs = pos; return ROFF_RERUN; } static int roff_tr(ROFF_ARGS) { const char *p, *first, *second; size_t fsz, ssz; enum mandoc_esc esc; p = buf->buf + pos; if (*p == '\0') { mandoc_msg(MANDOCERR_REQ_EMPTY, ln, ppos, "tr"); return ROFF_IGN; } while (*p != '\0') { fsz = ssz = 1; first = p++; if (*first == '\\') { esc = mandoc_escape(&p, NULL, NULL); if (esc == ESCAPE_ERROR) { mandoc_msg(MANDOCERR_ESC_BAD, ln, (int)(p - buf->buf), "%s", first); return ROFF_IGN; } fsz = (size_t)(p - first); } second = p++; if (*second == '\\') { esc = mandoc_escape(&p, NULL, NULL); if (esc == ESCAPE_ERROR) { mandoc_msg(MANDOCERR_ESC_BAD, ln, (int)(p - buf->buf), "%s", second); return ROFF_IGN; } ssz = (size_t)(p - second); } else if (*second == '\0') { mandoc_msg(MANDOCERR_TR_ODD, ln, (int)(first - buf->buf), "tr %s", first); second = " "; p--; } if (fsz > 1) { roff_setstrn(&r->xmbtab, first, fsz, second, ssz, 0); continue; } if (r->xtab == NULL) r->xtab = mandoc_calloc(128, sizeof(struct roffstr)); free(r->xtab[(int)*first].p); r->xtab[(int)*first].p = mandoc_strndup(second, ssz); r->xtab[(int)*first].sz = ssz; } return ROFF_IGN; } /* * Implementation of the .return request. * There is no need to call roff_userret() from here. * The read module will call that after rewinding the reader stack * to the place from where the current macro was called. */ static int roff_return(ROFF_ARGS) { if (r->mstackpos >= 0) return ROFF_IGN | ROFF_USERRET; mandoc_msg(MANDOCERR_REQ_NOMAC, ln, ppos, "return"); return ROFF_IGN; } static int roff_rn(ROFF_ARGS) { const char *value; char *oldn, *newn, *end; size_t oldsz, newsz; int deftype; oldn = newn = buf->buf + pos; if (*oldn == '\0') return ROFF_IGN; oldsz = roff_getname(r, &newn, ln, pos); if (oldn[oldsz] == '\\' || oldn[oldsz] == '\t' || *newn == '\0') return ROFF_IGN; end = newn; newsz = roff_getname(r, &end, ln, newn - buf->buf); if (newsz == 0) return ROFF_IGN; deftype = ROFFDEF_ANY; value = roff_getstrn(r, oldn, oldsz, &deftype); switch (deftype) { case ROFFDEF_USER: roff_setstrn(&r->strtab, newn, newsz, value, strlen(value), 0); roff_setstrn(&r->strtab, oldn, oldsz, NULL, 0, 0); roff_setstrn(&r->rentab, newn, newsz, NULL, 0, 0); break; case ROFFDEF_PRE: roff_setstrn(&r->strtab, newn, newsz, value, strlen(value), 0); roff_setstrn(&r->rentab, newn, newsz, NULL, 0, 0); break; case ROFFDEF_REN: roff_setstrn(&r->rentab, newn, newsz, value, strlen(value), 0); roff_setstrn(&r->rentab, oldn, oldsz, NULL, 0, 0); roff_setstrn(&r->strtab, newn, newsz, NULL, 0, 0); break; case ROFFDEF_STD: roff_setstrn(&r->rentab, newn, newsz, oldn, oldsz, 0); roff_setstrn(&r->strtab, newn, newsz, NULL, 0, 0); break; default: roff_setstrn(&r->strtab, newn, newsz, NULL, 0, 0); roff_setstrn(&r->rentab, newn, newsz, NULL, 0, 0); break; } return ROFF_IGN; } static int roff_shift(ROFF_ARGS) { struct mctx *ctx; int levels, i; levels = 1; if (buf->buf[pos] != '\0' && roff_evalnum(r, ln, buf->buf, &pos, &levels, 0) == 0) { mandoc_msg(MANDOCERR_CE_NONUM, ln, pos, "shift %s", buf->buf + pos); levels = 1; } if (r->mstackpos < 0) { mandoc_msg(MANDOCERR_REQ_NOMAC, ln, ppos, "shift"); return ROFF_IGN; } ctx = r->mstack + r->mstackpos; if (levels > ctx->argc) { mandoc_msg(MANDOCERR_SHIFT, ln, pos, "%d, but max is %d", levels, ctx->argc); levels = ctx->argc; } if (levels == 0) return ROFF_IGN; for (i = 0; i < levels; i++) free(ctx->argv[i]); ctx->argc -= levels; for (i = 0; i < ctx->argc; i++) ctx->argv[i] = ctx->argv[i + levels]; return ROFF_IGN; } static int roff_so(ROFF_ARGS) { char *name, *cp; name = buf->buf + pos; mandoc_msg(MANDOCERR_SO, ln, ppos, "so %s", name); /* * Handle `so'. Be EXTREMELY careful, as we shouldn't be * opening anything that's not in our cwd or anything beneath * it. Thus, explicitly disallow traversing up the file-system * or using absolute paths. */ if (*name == '/' || strstr(name, "../") || strstr(name, "/..")) { mandoc_msg(MANDOCERR_SO_PATH, ln, ppos, ".so %s", name); buf->sz = mandoc_asprintf(&cp, ".sp\nSee the file %s.\n.sp", name) + 1; free(buf->buf); buf->buf = cp; *offs = 0; return ROFF_REPARSE; } *offs = pos; return ROFF_SO; } /* --- user defined strings and macros ------------------------------------ */ static int roff_userdef(ROFF_ARGS) { struct mctx *ctx; char *arg, *ap, *dst, *src; size_t sz; /* If the macro is empty, ignore it altogether. */ if (*r->current_string == '\0') return ROFF_IGN; /* Initialize a new macro stack context. */ if (++r->mstackpos == r->mstacksz) { r->mstack = mandoc_recallocarray(r->mstack, r->mstacksz, r->mstacksz + 8, sizeof(*r->mstack)); r->mstacksz += 8; } ctx = r->mstack + r->mstackpos; ctx->argsz = 0; ctx->argc = 0; ctx->argv = NULL; /* * Collect pointers to macro argument strings, * NUL-terminating them and escaping quotes. */ src = buf->buf + pos; while (*src != '\0') { if (ctx->argc == ctx->argsz) { ctx->argsz += 8; ctx->argv = mandoc_reallocarray(ctx->argv, ctx->argsz, sizeof(*ctx->argv)); } arg = roff_getarg(r, &src, ln, &pos); sz = 1; /* For the terminating NUL. */ for (ap = arg; *ap != '\0'; ap++) sz += *ap == '"' ? 4 : 1; ctx->argv[ctx->argc++] = dst = mandoc_malloc(sz); for (ap = arg; *ap != '\0'; ap++) { if (*ap == '"') { memcpy(dst, "\\(dq", 4); dst += 4; } else *dst++ = *ap; } *dst = '\0'; free(arg); } /* Replace the macro invocation by the macro definition. */ free(buf->buf); buf->buf = mandoc_strdup(r->current_string); buf->sz = strlen(buf->buf) + 1; *offs = 0; return buf->buf[buf->sz - 2] == '\n' ? ROFF_REPARSE | ROFF_USERCALL : ROFF_IGN | ROFF_APPEND; } /* * Calling a high-level macro that was renamed with .rn. * r->current_string has already been set up by roff_parse(). */ static int roff_renamed(ROFF_ARGS) { char *nbuf; buf->sz = mandoc_asprintf(&nbuf, ".%s%s%s", r->current_string, buf->buf[pos] == '\0' ? "" : " ", buf->buf + pos) + 1; free(buf->buf); buf->buf = nbuf; *offs = 0; return ROFF_CONT; } /* * Measure the length in bytes of the roff identifier at *cpp * and advance the pointer to the next word. */ static size_t roff_getname(struct roff *r, char **cpp, int ln, int pos) { char *name, *cp; size_t namesz; name = *cpp; if (*name == '\0') return 0; /* Advance cp to the byte after the end of the name. */ for (cp = name; 1; cp++) { namesz = cp - name; if (*cp == '\0') break; if (*cp == ' ' || *cp == '\t') { cp++; break; } if (*cp != '\\') continue; if (cp[1] == '{' || cp[1] == '}') break; if (*++cp == '\\') continue; mandoc_msg(MANDOCERR_NAMESC, ln, pos, "%.*s", (int)(cp - name + 1), name); mandoc_escape((const char **)&cp, NULL, NULL); break; } /* Read past spaces. */ while (*cp == ' ') cp++; *cpp = cp; return namesz; } /* * Store *string into the user-defined string called *name. * To clear an existing entry, call with (*r, *name, NULL, 0). * append == 0: replace mode * append == 1: single-line append mode * append == 2: multiline append mode, append '\n' after each call */ static void roff_setstr(struct roff *r, const char *name, const char *string, int append) { size_t namesz; namesz = strlen(name); roff_setstrn(&r->strtab, name, namesz, string, string ? strlen(string) : 0, append); roff_setstrn(&r->rentab, name, namesz, NULL, 0, 0); } static void roff_setstrn(struct roffkv **r, const char *name, size_t namesz, const char *string, size_t stringsz, int append) { struct roffkv *n; char *c; int i; size_t oldch, newch; /* Search for an existing string with the same name. */ n = *r; while (n && (namesz != n->key.sz || strncmp(n->key.p, name, namesz))) n = n->next; if (NULL == n) { /* Create a new string table entry. */ n = mandoc_malloc(sizeof(struct roffkv)); n->key.p = mandoc_strndup(name, namesz); n->key.sz = namesz; n->val.p = NULL; n->val.sz = 0; n->next = *r; *r = n; } else if (0 == append) { free(n->val.p); n->val.p = NULL; n->val.sz = 0; } if (NULL == string) return; /* * One additional byte for the '\n' in multiline mode, * and one for the terminating '\0'. */ newch = stringsz + (1 < append ? 2u : 1u); if (NULL == n->val.p) { n->val.p = mandoc_malloc(newch); *n->val.p = '\0'; oldch = 0; } else { oldch = n->val.sz; n->val.p = mandoc_realloc(n->val.p, oldch + newch); } /* Skip existing content in the destination buffer. */ c = n->val.p + (int)oldch; /* Append new content to the destination buffer. */ i = 0; while (i < (int)stringsz) { /* * Rudimentary roff copy mode: * Handle escaped backslashes. */ if ('\\' == string[i] && '\\' == string[i + 1]) i++; *c++ = string[i++]; } /* Append terminating bytes. */ if (1 < append) *c++ = '\n'; *c = '\0'; n->val.sz = (int)(c - n->val.p); } static const char * roff_getstrn(struct roff *r, const char *name, size_t len, int *deftype) { const struct roffkv *n; int found, i; enum roff_tok tok; found = 0; for (n = r->strtab; n != NULL; n = n->next) { if (strncmp(name, n->key.p, len) != 0 || n->key.p[len] != '\0' || n->val.p == NULL) continue; if (*deftype & ROFFDEF_USER) { *deftype = ROFFDEF_USER; return n->val.p; } else { found = 1; break; } } for (n = r->rentab; n != NULL; n = n->next) { if (strncmp(name, n->key.p, len) != 0 || n->key.p[len] != '\0' || n->val.p == NULL) continue; if (*deftype & ROFFDEF_REN) { *deftype = ROFFDEF_REN; return n->val.p; } else { found = 1; break; } } for (i = 0; i < PREDEFS_MAX; i++) { if (strncmp(name, predefs[i].name, len) != 0 || predefs[i].name[len] != '\0') continue; if (*deftype & ROFFDEF_PRE) { *deftype = ROFFDEF_PRE; return predefs[i].str; } else { found = 1; break; } } if (r->man->meta.macroset != MACROSET_MAN) { for (tok = MDOC_Dd; tok < MDOC_MAX; tok++) { if (strncmp(name, roff_name[tok], len) != 0 || roff_name[tok][len] != '\0') continue; if (*deftype & ROFFDEF_STD) { *deftype = ROFFDEF_STD; return NULL; } else { found = 1; break; } } } if (r->man->meta.macroset != MACROSET_MDOC) { for (tok = MAN_TH; tok < MAN_MAX; tok++) { if (strncmp(name, roff_name[tok], len) != 0 || roff_name[tok][len] != '\0') continue; if (*deftype & ROFFDEF_STD) { *deftype = ROFFDEF_STD; return NULL; } else { found = 1; break; } } } if (found == 0 && *deftype != ROFFDEF_ANY) { if (*deftype & ROFFDEF_REN) { /* * This might still be a request, * so do not treat it as undefined yet. */ *deftype = ROFFDEF_UNDEF; return NULL; } /* Using an undefined string defines it to be empty. */ roff_setstrn(&r->strtab, name, len, "", 0, 0); roff_setstrn(&r->rentab, name, len, NULL, 0, 0); } *deftype = 0; return NULL; } static void roff_freestr(struct roffkv *r) { struct roffkv *n, *nn; for (n = r; n; n = nn) { free(n->key.p); free(n->val.p); nn = n->next; free(n); } } /* --- accessors and utility functions ------------------------------------ */ /* * Duplicate an input string, making the appropriate character * conversations (as stipulated by `tr') along the way. * Returns a heap-allocated string with all the replacements made. */ char * roff_strdup(const struct roff *r, const char *p) { const struct roffkv *cp; char *res; const char *pp; size_t ssz, sz; enum mandoc_esc esc; if (NULL == r->xmbtab && NULL == r->xtab) return mandoc_strdup(p); else if ('\0' == *p) return mandoc_strdup(""); /* * Step through each character looking for term matches * (remember that a `tr' can be invoked with an escape, which is * a glyph but the escape is multi-character). * We only do this if the character hash has been initialised * and the string is >0 length. */ res = NULL; ssz = 0; while ('\0' != *p) { assert((unsigned int)*p < 128); if ('\\' != *p && r->xtab && r->xtab[(unsigned int)*p].p) { sz = r->xtab[(int)*p].sz; res = mandoc_realloc(res, ssz + sz + 1); memcpy(res + ssz, r->xtab[(int)*p].p, sz); ssz += sz; p++; continue; } else if ('\\' != *p) { res = mandoc_realloc(res, ssz + 2); res[ssz++] = *p++; continue; } /* Search for term matches. */ for (cp = r->xmbtab; cp; cp = cp->next) if (0 == strncmp(p, cp->key.p, cp->key.sz)) break; if (NULL != cp) { /* * A match has been found. * Append the match to the array and move * forward by its keysize. */ res = mandoc_realloc(res, ssz + cp->val.sz + 1); memcpy(res + ssz, cp->val.p, cp->val.sz); ssz += cp->val.sz; p += (int)cp->key.sz; continue; } /* * Handle escapes carefully: we need to copy * over just the escape itself, or else we might * do replacements within the escape itself. * Make sure to pass along the bogus string. */ pp = p++; esc = mandoc_escape(&p, NULL, NULL); if (ESCAPE_ERROR == esc) { sz = strlen(pp); res = mandoc_realloc(res, ssz + sz + 1); memcpy(res + ssz, pp, sz); break; } /* * We bail out on bad escapes. * No need to warn: we already did so when * roff_expand() was called. */ sz = (int)(p - pp); res = mandoc_realloc(res, ssz + sz + 1); memcpy(res + ssz, pp, sz); ssz += sz; } res[(int)ssz] = '\0'; return res; } int roff_getformat(const struct roff *r) { return r->format; } /* * Find out whether a line is a macro line or not. * If it is, adjust the current position and return one; if it isn't, * return zero and don't change the current position. * If the control character has been set with `.cc', then let that grain * precedence. * This is slighly contrary to groff, where using the non-breaking * control character when `cc' has been invoked will cause the * non-breaking macro contents to be printed verbatim. */ int roff_getcontrol(const struct roff *r, const char *cp, int *ppos) { int pos; pos = *ppos; if (r->control != '\0' && cp[pos] == r->control) pos++; else if (r->control != '\0') return 0; else if ('\\' == cp[pos] && '.' == cp[pos + 1]) pos += 2; else if ('.' == cp[pos] || '\'' == cp[pos]) pos++; else return 0; while (' ' == cp[pos] || '\t' == cp[pos]) pos++; *ppos = pos; return 1; } mandoc-1.14.6/roff_html.c010064400017530001753000000057001412314055300154750ustar00schwarzeschwarze/* $Id: roff_html.c,v 1.21 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2010 Kristaps Dzonsons * Copyright (c) 2014, 2017, 2018, 2019 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include "mandoc.h" #include "roff.h" #include "out.h" #include "html.h" #define ROFF_HTML_ARGS struct html *h, const struct roff_node *n typedef void (*roff_html_pre_fp)(ROFF_HTML_ARGS); static void roff_html_pre_br(ROFF_HTML_ARGS); static void roff_html_pre_ce(ROFF_HTML_ARGS); static void roff_html_pre_fi(ROFF_HTML_ARGS); static void roff_html_pre_ft(ROFF_HTML_ARGS); static void roff_html_pre_nf(ROFF_HTML_ARGS); static void roff_html_pre_sp(ROFF_HTML_ARGS); static const roff_html_pre_fp roff_html_pre_acts[ROFF_MAX] = { roff_html_pre_br, /* br */ roff_html_pre_ce, /* ce */ roff_html_pre_fi, /* fi */ roff_html_pre_ft, /* ft */ NULL, /* ll */ NULL, /* mc */ roff_html_pre_nf, /* nf */ NULL, /* po */ roff_html_pre_ce, /* rj */ roff_html_pre_sp, /* sp */ NULL, /* ta */ NULL, /* ti */ }; void roff_html_pre(struct html *h, const struct roff_node *n) { assert(n->tok < ROFF_MAX); if (roff_html_pre_acts[n->tok] != NULL) (*roff_html_pre_acts[n->tok])(h, n); } static void roff_html_pre_br(ROFF_HTML_ARGS) { print_otag(h, TAG_BR, ""); } static void roff_html_pre_ce(ROFF_HTML_ARGS) { for (n = n->child->next; n != NULL; n = n->next) { if (n->type == ROFFT_TEXT) { if (n->flags & NODE_LINE) roff_html_pre_br(h, n); print_text(h, n->string); } else roff_html_pre(h, n); } roff_html_pre_br(h, n); } static void roff_html_pre_fi(ROFF_HTML_ARGS) { if (html_fillmode(h, TOKEN_NONE) == ROFF_fi) print_otag(h, TAG_BR, ""); } static void roff_html_pre_ft(ROFF_HTML_ARGS) { const char *cp; cp = n->child->string; html_setfont(h, mandoc_font(cp, (int)strlen(cp))); } static void roff_html_pre_nf(ROFF_HTML_ARGS) { if (html_fillmode(h, TOKEN_NONE) == ROFF_nf) print_otag(h, TAG_BR, ""); } static void roff_html_pre_sp(ROFF_HTML_ARGS) { if (html_fillmode(h, TOKEN_NONE) == ROFF_nf) { h->col++; print_endline(h); } else { html_close_paragraph(h); print_otag(h, TAG_P, "c", "Pp"); } } mandoc-1.14.6/roff_term.c010064400017530001753000000135551412314055300155070ustar00schwarzeschwarze/* $OpenBSD: roff_term.c,v 1.20 2020/09/03 17:37:06 schwarze Exp $ */ /* * Copyright (c) 2010,2014,2015,2017-2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include "mandoc.h" #include "roff.h" #include "out.h" #include "term.h" #define ROFF_TERM_ARGS struct termp *p, const struct roff_node *n typedef void (*roff_term_pre_fp)(ROFF_TERM_ARGS); static void roff_term_pre_br(ROFF_TERM_ARGS); static void roff_term_pre_ce(ROFF_TERM_ARGS); static void roff_term_pre_ft(ROFF_TERM_ARGS); static void roff_term_pre_ll(ROFF_TERM_ARGS); static void roff_term_pre_mc(ROFF_TERM_ARGS); static void roff_term_pre_po(ROFF_TERM_ARGS); static void roff_term_pre_sp(ROFF_TERM_ARGS); static void roff_term_pre_ta(ROFF_TERM_ARGS); static void roff_term_pre_ti(ROFF_TERM_ARGS); static const roff_term_pre_fp roff_term_pre_acts[ROFF_MAX] = { roff_term_pre_br, /* br */ roff_term_pre_ce, /* ce */ roff_term_pre_br, /* fi */ roff_term_pre_ft, /* ft */ roff_term_pre_ll, /* ll */ roff_term_pre_mc, /* mc */ roff_term_pre_br, /* nf */ roff_term_pre_po, /* po */ roff_term_pre_ce, /* rj */ roff_term_pre_sp, /* sp */ roff_term_pre_ta, /* ta */ roff_term_pre_ti, /* ti */ }; void roff_term_pre(struct termp *p, const struct roff_node *n) { assert(n->tok < ROFF_MAX); (*roff_term_pre_acts[n->tok])(p, n); } static void roff_term_pre_br(ROFF_TERM_ARGS) { term_newln(p); if (p->flags & TERMP_BRIND) { p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin; p->trailspace = 0; p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); p->flags |= TERMP_NOSPACE; } } static void roff_term_pre_ce(ROFF_TERM_ARGS) { const struct roff_node *nc1, *nc2; roff_term_pre_br(p, n); p->flags |= n->tok == ROFF_ce ? TERMP_CENTER : TERMP_RIGHT; nc1 = n->child->next; while (nc1 != NULL) { nc2 = nc1; do { nc2 = nc2->next; } while (nc2 != NULL && (nc2->type != ROFFT_TEXT || (nc2->flags & NODE_LINE) == 0)); while (nc1 != nc2) { if (nc1->type == ROFFT_TEXT) term_word(p, nc1->string); else roff_term_pre(p, nc1); nc1 = nc1->next; } p->flags |= TERMP_NOSPACE; term_flushln(p); } p->flags &= ~(TERMP_CENTER | TERMP_RIGHT); } static void roff_term_pre_ft(ROFF_TERM_ARGS) { const char *cp; cp = n->child->string; switch (mandoc_font(cp, (int)strlen(cp))) { case ESCAPE_FONTBOLD: case ESCAPE_FONTCB: term_fontrepl(p, TERMFONT_BOLD); break; case ESCAPE_FONTITALIC: case ESCAPE_FONTCI: term_fontrepl(p, TERMFONT_UNDER); break; case ESCAPE_FONTBI: term_fontrepl(p, TERMFONT_BI); break; case ESCAPE_FONTPREV: term_fontlast(p); break; case ESCAPE_FONTROMAN: case ESCAPE_FONTCR: term_fontrepl(p, TERMFONT_NONE); break; default: break; } } static void roff_term_pre_ll(ROFF_TERM_ARGS) { term_setwidth(p, n->child != NULL ? n->child->string : NULL); } static void roff_term_pre_mc(ROFF_TERM_ARGS) { if (p->col) { p->flags |= TERMP_NOBREAK; term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_NOSPACE); } if (n->child != NULL) { p->mc = n->child->string; p->flags |= TERMP_NEWMC; } else p->flags |= TERMP_ENDMC; } static void roff_term_pre_po(ROFF_TERM_ARGS) { struct roffsu su; static int po, pouse, polast; int ponew; /* Revert the currently active page offset. */ p->tcol->offset -= pouse; /* Determine the requested page offset. */ if (n->child != NULL && a2roffsu(n->child->string, &su, SCALE_EM) != NULL) { ponew = term_hen(p, &su); if (*n->child->string == '+' || *n->child->string == '-') ponew += po; } else ponew = polast; /* Remeber both the previous and the newly requested offset. */ polast = po; po = ponew; /* Truncate to the range [-offset, 60], remember, and apply it. */ pouse = po >= 60 ? 60 : po < -(int)p->tcol->offset ? -(int)p->tcol->offset : po; p->tcol->offset += pouse; } static void roff_term_pre_sp(ROFF_TERM_ARGS) { struct roffsu su; int len; if (n->child != NULL) { if (a2roffsu(n->child->string, &su, SCALE_VS) == NULL) su.scale = 1.0; len = term_vspan(p, &su); } else len = 1; if (len < 0) p->skipvsp -= len; else while (len--) term_vspace(p); roff_term_pre_br(p, n); } static void roff_term_pre_ta(ROFF_TERM_ARGS) { term_tab_set(p, NULL); for (n = n->child; n != NULL; n = n->next) term_tab_set(p, n->string); } static void roff_term_pre_ti(ROFF_TERM_ARGS) { struct roffsu su; const char *cp; const size_t maxoff = 72; int len, sign; roff_term_pre_br(p, n); if (n->child == NULL) return; cp = n->child->string; if (*cp == '+') { sign = 1; cp++; } else if (*cp == '-') { sign = -1; cp++; } else sign = 0; if (a2roffsu(cp, &su, SCALE_EM) == NULL) return; len = term_hen(p, &su); switch (sign) { case 1: if (p->tcol->offset + len <= maxoff) p->ti = len; else if (p->tcol->offset < maxoff) p->ti = maxoff - p->tcol->offset; else p->ti = 0; break; case -1: if ((size_t)len < p->tcol->offset) p->ti = -len; else p->ti = -p->tcol->offset; break; default: if ((size_t)len > maxoff) len = maxoff; p->ti = len - p->tcol->offset; break; } p->tcol->offset += p->ti; } mandoc-1.14.6/roff_validate.c010064400017530001753000000067211412314055300163260ustar00schwarzeschwarze/* $Id: roff_validate.c,v 1.20 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2010, 2017, 2018, 2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include "mandoc.h" #include "roff.h" #include "libmandoc.h" #include "roff_int.h" #define ROFF_VALID_ARGS struct roff_man *man, struct roff_node *n typedef void (*roff_valid_fp)(ROFF_VALID_ARGS); static void roff_valid_br(ROFF_VALID_ARGS); static void roff_valid_fi(ROFF_VALID_ARGS); static void roff_valid_ft(ROFF_VALID_ARGS); static void roff_valid_nf(ROFF_VALID_ARGS); static void roff_valid_sp(ROFF_VALID_ARGS); static const roff_valid_fp roff_valids[ROFF_MAX] = { roff_valid_br, /* br */ NULL, /* ce */ roff_valid_fi, /* fi */ roff_valid_ft, /* ft */ NULL, /* ll */ NULL, /* mc */ roff_valid_nf, /* nf */ NULL, /* po */ NULL, /* rj */ roff_valid_sp, /* sp */ NULL, /* ta */ NULL, /* ti */ }; void roff_validate(struct roff_man *man) { struct roff_node *n; n = man->last; assert(n->tok < ROFF_MAX); if (roff_valids[n->tok] != NULL) (*roff_valids[n->tok])(man, n); } static void roff_valid_br(ROFF_VALID_ARGS) { struct roff_node *np; if (n->next != NULL && n->next->type == ROFFT_TEXT && *n->next->string == ' ') { mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, "br before text line with leading blank"); roff_node_delete(man, n); return; } if ((np = roff_node_prev(n)) == NULL) return; switch (np->tok) { case ROFF_br: case ROFF_sp: case MDOC_Pp: mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, "br after %s", roff_name[np->tok]); roff_node_delete(man, n); break; default: break; } } static void roff_valid_fi(ROFF_VALID_ARGS) { if ((n->flags & NODE_NOFILL) == 0) mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "fi"); } static void roff_valid_ft(ROFF_VALID_ARGS) { const char *cp; if (n->child == NULL) { man->next = ROFF_NEXT_CHILD; roff_word_alloc(man, n->line, n->pos, "P"); man->last = n; return; } cp = n->child->string; if (mandoc_font(cp, (int)strlen(cp)) != ESCAPE_ERROR) return; mandoc_msg(MANDOCERR_FT_BAD, n->line, n->pos, "ft %s", cp); roff_node_delete(man, n); } static void roff_valid_nf(ROFF_VALID_ARGS) { if (n->flags & NODE_NOFILL) mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "nf"); } static void roff_valid_sp(ROFF_VALID_ARGS) { struct roff_node *np; if ((np = roff_node_prev(n)) == NULL) return; switch (np->tok) { case ROFF_br: mandoc_msg(MANDOCERR_PAR_SKIP, np->line, np->pos, "br before sp"); roff_node_delete(man, np); break; case MDOC_Pp: mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, "sp after Pp"); roff_node_delete(man, n); break; default: break; } } mandoc-1.14.6/soelim.c010064400017530001753000000074641412314055300150160ustar00schwarzeschwarze/* $Id: soelim.c,v 1.6 2021/09/19 18:14:24 schwarze Exp $ */ /* * Copyright (c) 2014 Baptiste Daroussin * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include #include #if HAVE_ERR #include #endif #include #include #include #include #if HAVE_STRINGLIST #include #else #include "compat_stringlist.h" #endif #include #define C_OPTION 0x1 static StringList *includes; static void usage(void) { fprintf(stderr, "usage: soelim [-Crtv] [-I dir] [files]\n"); exit(EXIT_FAILURE); } static FILE * soelim_fopen(const char *name) { FILE *f; char path[PATH_MAX]; size_t i; if (strcmp(name, "-") == 0) return (stdin); if ((f = fopen(name, "r")) != NULL) return (f); if (*name == '/') { warn("can't open '%s'", name); return (NULL); } for (i = 0; i < includes->sl_cur; i++) { snprintf(path, sizeof(path), "%s/%s", includes->sl_str[i], name); if ((f = fopen(path, "r")) != NULL) return (f); } warn("can't open '%s'", name); return (f); } static int soelim_file(FILE *f, int flag) { char *line = NULL; char *walk, *cp; size_t linecap = 0; ssize_t linelen; if (f == NULL) return (1); while ((linelen = getline(&line, &linecap, f)) > 0) { if (strncmp(line, ".so", 3) != 0) { printf("%s", line); continue; } walk = line + 3; if (!isspace((unsigned char)*walk) && (flag & C_OPTION) == 0) { printf("%s", line); continue; } while (isspace((unsigned char)*walk)) walk++; cp = walk; while (*cp != '\0' && !isspace((unsigned char)*cp)) cp++; *cp = 0; if (cp < line + linelen) cp++; if (*walk == '\0') { printf("%s", line); continue; } if (soelim_file(soelim_fopen(walk), flag) == 1) { free(line); return (1); } if (*cp != '\0') printf("%s", cp); } free(line); fclose(f); return (0); } int main(int argc, char **argv) { int ch, i; int ret = 0; int flags = 0; includes = sl_init(); if (includes == NULL) err(EXIT_FAILURE, "sl_init()"); while ((ch = getopt(argc, argv, "CrtvI:")) != -1) { switch (ch) { case 'C': flags |= C_OPTION; break; case 'r': case 'v': case 't': /* stub compatibility with groff's soelim */ break; case 'I': sl_add(includes, optarg); break; default: sl_free(includes, 0); usage(); } } argc -= optind; argv += optind; if (argc == 0) ret = soelim_file(stdin, flags); for (i = 0; i < argc; i++) ret = soelim_file(soelim_fopen(argv[i]), flags); sl_free(includes, 0); return (ret); } mandoc-1.14.6/st.c010064400017530001753000000102611412314055300141410ustar00schwarzeschwarze/* $Id: st.c,v 1.16 2018/12/14 01:18:26 schwarze Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include "mandoc.h" #include "roff.h" #include "libmdoc.h" #define LINE(x, y) \ if (0 == strcmp(p, x)) return(y); const char * mdoc_a2st(const char *p) { LINE("-p1003.1-88", "IEEE Std 1003.1-1988 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-90", "IEEE Std 1003.1-1990 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-96", "ISO/IEC 9945-1:1996 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-2001", "IEEE Std 1003.1-2001 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-2004", "IEEE Std 1003.1-2004 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-2008", "IEEE Std 1003.1-2008 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1", "IEEE Std 1003.1 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1b", "IEEE Std 1003.1b (\\(lqPOSIX.1b\\(rq)") LINE("-p1003.1b-93", "IEEE Std 1003.1b-1993 (\\(lqPOSIX.1b\\(rq)") LINE("-p1003.1c-95", "IEEE Std 1003.1c-1995 (\\(lqPOSIX.1c\\(rq)") LINE("-p1003.1g-2000", "IEEE Std 1003.1g-2000 (\\(lqPOSIX.1g\\(rq)") LINE("-p1003.1i-95", "IEEE Std 1003.1i-1995 (\\(lqPOSIX.1i\\(rq)") LINE("-p1003.2", "IEEE Std 1003.2 (\\(lqPOSIX.2\\(rq)") LINE("-p1003.2-92", "IEEE Std 1003.2-1992 (\\(lqPOSIX.2\\(rq)") LINE("-p1003.2a-92", "IEEE Std 1003.2a-1992 (\\(lqPOSIX.2\\(rq)") LINE("-isoC", "ISO/IEC 9899:1990 (\\(lqISO\\~C90\\(rq)") LINE("-isoC-90", "ISO/IEC 9899:1990 (\\(lqISO\\~C90\\(rq)") LINE("-isoC-amd1", "ISO/IEC 9899/AMD1:1995 (\\(lqISO\\~C90, Amendment 1\\(rq)") LINE("-isoC-tcor1", "ISO/IEC 9899/TCOR1:1994 (\\(lqISO\\~C90, Technical Corrigendum 1\\(rq)") LINE("-isoC-tcor2", "ISO/IEC 9899/TCOR2:1995 (\\(lqISO\\~C90, Technical Corrigendum 2\\(rq)") LINE("-isoC-99", "ISO/IEC 9899:1999 (\\(lqISO\\~C99\\(rq)") LINE("-isoC-2011", "ISO/IEC 9899:2011 (\\(lqISO\\~C11\\(rq)") LINE("-iso9945-1-90", "ISO/IEC 9945-1:1990 (\\(lqPOSIX.1\\(rq)") LINE("-iso9945-1-96", "ISO/IEC 9945-1:1996 (\\(lqPOSIX.1\\(rq)") LINE("-iso9945-2-93", "ISO/IEC 9945-2:1993 (\\(lqPOSIX.2\\(rq)") LINE("-ansiC", "ANSI X3.159-1989 (\\(lqANSI\\~C89\\(rq)") LINE("-ansiC-89", "ANSI X3.159-1989 (\\(lqANSI\\~C89\\(rq)") LINE("-ieee754", "IEEE Std 754-1985") LINE("-iso8802-3", "ISO 8802-3: 1989") LINE("-iso8601", "ISO 8601") LINE("-ieee1275-94", "IEEE Std 1275-1994 (\\(lqOpen Firmware\\(rq)") LINE("-xpg3", "X/Open Portability Guide Issue\\~3 (\\(lqXPG3\\(rq)") LINE("-xpg4", "X/Open Portability Guide Issue\\~4 (\\(lqXPG4\\(rq)") LINE("-xpg4.2", "X/Open Portability Guide Issue\\~4, Version\\~2 (\\(lqXPG4.2\\(rq)") LINE("-xbd5", "X/Open Base Definitions Issue\\~5 (\\(lqXBD5\\(rq)") LINE("-xcu5", "X/Open Commands and Utilities Issue\\~5 (\\(lqXCU5\\(rq)") LINE("-xsh4.2", "X/Open System Interfaces and Headers Issue\\~4, Version\\~2 (\\(lqXSH4.2\\(rq)") LINE("-xsh5", "X/Open System Interfaces and Headers Issue\\~5 (\\(lqXSH5\\(rq)") LINE("-xns5", "X/Open Networking Services Issue\\~5 (\\(lqXNS5\\(rq)") LINE("-xns5.2", "X/Open Networking Services Issue\\~5.2 (\\(lqXNS5.2\\(rq)") LINE("-xcurses4.2", "X/Open Curses Issue\\~4, Version\\~2 (\\(lqXCURSES4.2\\(rq)") LINE("-susv1", "Version\\~1 of the Single UNIX Specification (\\(lqSUSv1\\(rq)") LINE("-susv2", "Version\\~2 of the Single UNIX Specification (\\(lqSUSv2\\(rq)") LINE("-susv3", "Version\\~3 of the Single UNIX Specification (\\(lqSUSv3\\(rq)") LINE("-susv4", "Version\\~4 of the Single UNIX Specification (\\(lqSUSv4\\(rq)") LINE("-svid4", "System\\~V Interface Definition, Fourth Edition (\\(lqSVID4\\(rq)") return NULL; } mandoc-1.14.6/tag.c010064400017530001753000000160251412314055300142720ustar00schwarzeschwarze/* $Id: tag.c,v 1.36 2020/04/19 16:36:16 schwarze Exp $ */ /* * Copyright (c) 2015,2016,2018,2019,2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Functions to tag syntax tree nodes. * For internal use by mandoc(1) validation modules only. */ #include "config.h" #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc_ohash.h" #include "roff.h" #include "mdoc.h" #include "roff_int.h" #include "tag.h" struct tag_entry { struct roff_node **nodes; size_t maxnodes; size_t nnodes; int prio; char s[]; }; static void tag_move_href(struct roff_man *, struct roff_node *, const char *); static void tag_move_id(struct roff_node *); static struct ohash tag_data; /* * Set up the ohash table to collect nodes * where various marked-up terms are documented. */ void tag_alloc(void) { mandoc_ohash_init(&tag_data, 4, offsetof(struct tag_entry, s)); } void tag_free(void) { struct tag_entry *entry; unsigned int slot; if (tag_data.info.free == NULL) return; entry = ohash_first(&tag_data, &slot); while (entry != NULL) { free(entry->nodes); free(entry); entry = ohash_next(&tag_data, &slot); } ohash_delete(&tag_data); tag_data.info.free = NULL; } /* * Set a node where a term is defined, * unless it is already defined at a lower priority. */ void tag_put(const char *s, int prio, struct roff_node *n) { struct tag_entry *entry; struct roff_node *nold; const char *se; size_t len; unsigned int slot; assert(prio <= TAG_FALLBACK); if (s == NULL) { if (n->child == NULL || n->child->type != ROFFT_TEXT) return; s = n->child->string; switch (s[0]) { case '-': s++; break; case '\\': switch (s[1]) { case '&': case '-': case 'e': s += 2; break; default: break; } break; default: break; } } /* * Skip whitespace and escapes and whatever follows, * and if there is any, downgrade the priority. */ len = strcspn(s, " \t\\"); if (len == 0) return; se = s + len; if (*se != '\0' && prio < TAG_WEAK) prio = TAG_WEAK; slot = ohash_qlookupi(&tag_data, s, &se); entry = ohash_find(&tag_data, slot); /* Build a new entry. */ if (entry == NULL) { entry = mandoc_malloc(sizeof(*entry) + len + 1); memcpy(entry->s, s, len); entry->s[len] = '\0'; entry->nodes = NULL; entry->maxnodes = entry->nnodes = 0; ohash_insert(&tag_data, slot, entry); } /* * Lower priority numbers take precedence. * If a better entry is already present, ignore the new one. */ else if (entry->prio < prio) return; /* * If the existing entry is worse, clear it. * In addition, a tag with priority TAG_FALLBACK * is only used if the tag occurs exactly once. */ else if (entry->prio > prio || prio == TAG_FALLBACK) { while (entry->nnodes > 0) { nold = entry->nodes[--entry->nnodes]; nold->flags &= ~NODE_ID; free(nold->tag); nold->tag = NULL; } if (prio == TAG_FALLBACK) { entry->prio = TAG_DELETE; return; } } /* Remember the new node. */ if (entry->maxnodes == entry->nnodes) { entry->maxnodes += 4; entry->nodes = mandoc_reallocarray(entry->nodes, entry->maxnodes, sizeof(*entry->nodes)); } entry->nodes[entry->nnodes++] = n; entry->prio = prio; n->flags |= NODE_ID; if (n->child == NULL || n->child->string != s || *se != '\0') { assert(n->tag == NULL); n->tag = mandoc_strndup(s, len); } } int tag_exists(const char *tag) { return ohash_find(&tag_data, ohash_qlookup(&tag_data, tag)) != NULL; } /* * For in-line elements, move the link target * to the enclosing paragraph when appropriate. */ static void tag_move_id(struct roff_node *n) { struct roff_node *np; np = n; for (;;) { if (np->prev != NULL) np = np->prev; else if ((np = np->parent) == NULL) return; switch (np->tok) { case MDOC_It: switch (np->parent->parent->norm->Bl.type) { case LIST_column: /* Target the ROFFT_BLOCK = . */ np = np->parent; break; case LIST_diag: case LIST_hang: case LIST_inset: case LIST_ohang: case LIST_tag: /* Target the ROFFT_HEAD =
. */ np = np->parent->head; break; default: /* Target the ROFF_BODY =
  • . */ break; } /* FALLTHROUGH */ case MDOC_Pp: /* Target the ROFFT_ELEM =

    . */ if (np->tag == NULL) { np->tag = mandoc_strdup(n->tag == NULL ? n->child->string : n->tag); np->flags |= NODE_ID; n->flags &= ~NODE_ID; } return; case MDOC_Sh: case MDOC_Ss: case MDOC_Bd: case MDOC_Bl: case MDOC_D1: case MDOC_Dl: case MDOC_Rs: /* Do not move past major blocks. */ return; default: /* * Move past in-line content and partial * blocks, for example .It Xo or .It Bq Er. */ break; } } } /* * When a paragraph is tagged and starts with text, * move the permalink to the first few words. */ static void tag_move_href(struct roff_man *man, struct roff_node *n, const char *tag) { char *cp; if (n == NULL || n->type != ROFFT_TEXT || *n->string == '\0' || *n->string == ' ') return; cp = n->string; while (cp != NULL && cp - n->string < 5) cp = strchr(cp + 1, ' '); /* If the first text node is longer, split it. */ if (cp != NULL && cp[1] != '\0') { man->last = n; man->next = ROFF_NEXT_SIBLING; roff_word_alloc(man, n->line, n->pos + (cp - n->string), cp + 1); man->last->flags = n->flags & ~NODE_LINE; *cp = '\0'; } assert(n->tag == NULL); n->tag = mandoc_strdup(tag); n->flags |= NODE_HREF; } /* * When all tags have been set, decide where to put * the associated permalinks, and maybe move some tags * to the beginning of the respective paragraphs. */ void tag_postprocess(struct roff_man *man, struct roff_node *n) { if (n->flags & NODE_ID) { switch (n->tok) { case MDOC_Pp: tag_move_href(man, n->next, n->tag); break; case MDOC_Bd: case MDOC_D1: case MDOC_Dl: tag_move_href(man, n->child, n->tag); break; case MDOC_Bl: /* XXX No permalink for now. */ break; default: if (n->type == ROFFT_ELEM || n->tok == MDOC_Fo) tag_move_id(n); if (n->tok != MDOC_Tg) n->flags |= NODE_HREF; else if ((n->flags & NODE_ID) == 0) { n->flags |= NODE_NOPRT; free(n->tag); n->tag = NULL; } break; } } for (n = n->child; n != NULL; n = n->next) tag_postprocess(man, n); } mandoc-1.14.6/tbl.c010064400017530001753000000076221412314055300143030ustar00schwarzeschwarze/* $Id: tbl.c,v 1.46 2018/12/14 06:33:14 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "tbl.h" #include "libmandoc.h" #include "tbl_parse.h" #include "tbl_int.h" void tbl_read(struct tbl_node *tbl, int ln, const char *p, int pos) { const char *cp; int active; /* * In the options section, proceed to the layout section * after a semicolon, or right away if there is no semicolon. * Ignore semicolons in arguments. */ if (tbl->part == TBL_PART_OPTS) { tbl->part = TBL_PART_LAYOUT; active = 1; for (cp = p + pos; *cp != '\0'; cp++) { switch (*cp) { case '(': active = 0; continue; case ')': active = 1; continue; case ';': if (active) break; continue; default: continue; } break; } if (*cp == ';') { tbl_option(tbl, ln, p, &pos); if (p[pos] == '\0') return; } } /* Process the other section types. */ switch (tbl->part) { case TBL_PART_LAYOUT: tbl_layout(tbl, ln, p, pos); break; case TBL_PART_CDATA: tbl_cdata(tbl, ln, p, pos); break; default: tbl_data(tbl, ln, p, pos); break; } } struct tbl_node * tbl_alloc(int pos, int line, struct tbl_node *last_tbl) { struct tbl_node *tbl; tbl = mandoc_calloc(1, sizeof(*tbl)); if (last_tbl != NULL) last_tbl->next = tbl; tbl->line = line; tbl->pos = pos; tbl->part = TBL_PART_OPTS; tbl->opts.tab = '\t'; tbl->opts.decimal = '.'; return tbl; } void tbl_free(struct tbl_node *tbl) { struct tbl_node *old_tbl; struct tbl_row *rp; struct tbl_cell *cp; struct tbl_span *sp; struct tbl_dat *dp; while (tbl != NULL) { while ((rp = tbl->first_row) != NULL) { tbl->first_row = rp->next; while (rp->first != NULL) { cp = rp->first; rp->first = cp->next; free(cp->wstr); free(cp); } free(rp); } while ((sp = tbl->first_span) != NULL) { tbl->first_span = sp->next; while (sp->first != NULL) { dp = sp->first; sp->first = dp->next; free(dp->string); free(dp); } free(sp); } old_tbl = tbl; tbl = tbl->next; free(old_tbl); } } void tbl_restart(int line, int pos, struct tbl_node *tbl) { if (tbl->part == TBL_PART_CDATA) mandoc_msg(MANDOCERR_TBLDATA_BLK, line, pos, "T&"); tbl->part = TBL_PART_LAYOUT; tbl->line = line; tbl->pos = pos; } struct tbl_span * tbl_span(struct tbl_node *tbl) { struct tbl_span *span; span = tbl->current_span ? tbl->current_span->next : tbl->first_span; if (span != NULL) tbl->current_span = span; return span; } int tbl_end(struct tbl_node *tbl, int still_open) { struct tbl_span *sp; if (still_open) mandoc_msg(MANDOCERR_BLK_NOEND, tbl->line, tbl->pos, "TS"); else if (tbl->part == TBL_PART_CDATA) mandoc_msg(MANDOCERR_TBLDATA_BLK, tbl->line, tbl->pos, "TE"); sp = tbl->first_span; while (sp != NULL && sp->first == NULL) sp = sp->next; if (sp == NULL) { mandoc_msg(MANDOCERR_TBLDATA_NONE, tbl->line, tbl->pos, NULL); return 0; } return 1; } mandoc-1.14.6/tbl_data.c010064400017530001753000000176441412314055300153010ustar00schwarzeschwarze/* $Id: tbl_data.c,v 1.59 2021/09/10 13:24:38 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011,2015,2017-2019,2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "tbl.h" #include "libmandoc.h" #include "tbl_int.h" static void getdata(struct tbl_node *, struct tbl_span *, int, const char *, int *); static struct tbl_span *newspan(struct tbl_node *, int, struct tbl_row *); static void getdata(struct tbl_node *tbl, struct tbl_span *dp, int ln, const char *p, int *pos) { struct tbl_dat *dat, *pdat; struct tbl_cell *cp; struct tbl_span *pdp; const char *ccp; int startpos, endpos; /* * Determine the length of the string in the cell * and advance the parse point to the end of the cell. */ startpos = *pos; ccp = p + startpos; while (*ccp != '\0' && *ccp != tbl->opts.tab) if (*ccp++ == '\\') mandoc_escape(&ccp, NULL, NULL); *pos = ccp - p; /* Advance to the next layout cell, skipping spanners. */ cp = dp->last == NULL ? dp->layout->first : dp->last->layout->next; while (cp != NULL && cp->pos == TBL_CELL_SPAN) cp = cp->next; /* * If the current layout row is out of cells, allocate * a new cell if another row of the table has at least * this number of columns, or discard the input if we * are beyond the last column of the table as a whole. */ if (cp == NULL) { if (dp->layout->last->col + 1 < dp->opts->cols) { cp = mandoc_calloc(1, sizeof(*cp)); cp->pos = TBL_CELL_LEFT; cp->font = ESCAPE_FONTROMAN; cp->spacing = SIZE_MAX; dp->layout->last->next = cp; cp->col = dp->layout->last->col + 1; dp->layout->last = cp; } else { mandoc_msg(MANDOCERR_TBLDATA_EXTRA, ln, startpos, "%s", p + startpos); while (p[*pos] != '\0') (*pos)++; return; } } dat = mandoc_malloc(sizeof(*dat)); dat->layout = cp; dat->next = NULL; dat->string = NULL; dat->hspans = 0; dat->vspans = 0; dat->block = 0; dat->pos = TBL_DATA_NONE; /* * Increment the number of vertical spans in a data cell above, * if this cell vertically extends one or more cells above. * The iteration must be done over data rows, * not over layout rows, because one layout row * can be reused for more than one data row. */ if (cp->pos == TBL_CELL_DOWN || (*pos - startpos == 2 && p[startpos] == '\\' && p[startpos + 1] == '^')) { pdp = dp; while ((pdp = pdp->prev) != NULL) { pdat = pdp->first; while (pdat != NULL && pdat->layout->col < dat->layout->col) pdat = pdat->next; if (pdat == NULL) break; if (pdat->layout->pos != TBL_CELL_DOWN && strcmp(pdat->string, "\\^") != 0) { pdat->vspans++; break; } } } /* * Count the number of horizontal spans to the right of this cell. * This is purely a matter of the layout, independent of the data. */ for (cp = cp->next; cp != NULL; cp = cp->next) if (cp->pos == TBL_CELL_SPAN) dat->hspans++; else break; /* Append the new data cell to the data row. */ if (dp->last == NULL) dp->first = dat; else dp->last->next = dat; dp->last = dat; /* Strip leading and trailing spaces, if requested. */ endpos = *pos; if (dp->opts->opts & TBL_OPT_NOSPACE) { while (p[startpos] == ' ') startpos++; while (endpos > startpos && p[endpos - 1] == ' ') endpos--; } /* * Check for a continued-data scope opening. This consists of a * trailing `T{' at the end of the line. Subsequent lines, * until a standalone `T}', are included in our cell. */ if (endpos - startpos == 2 && p[startpos] == 'T' && p[startpos + 1] == '{') { tbl->part = TBL_PART_CDATA; return; } dat->string = mandoc_strndup(p + startpos, endpos - startpos); if (p[*pos] != '\0') (*pos)++; if ( ! strcmp(dat->string, "_")) dat->pos = TBL_DATA_HORIZ; else if ( ! strcmp(dat->string, "=")) dat->pos = TBL_DATA_DHORIZ; else if ( ! strcmp(dat->string, "\\_")) dat->pos = TBL_DATA_NHORIZ; else if ( ! strcmp(dat->string, "\\=")) dat->pos = TBL_DATA_NDHORIZ; else dat->pos = TBL_DATA_DATA; if ((dat->layout->pos == TBL_CELL_HORIZ || dat->layout->pos == TBL_CELL_DHORIZ || dat->layout->pos == TBL_CELL_DOWN) && dat->pos == TBL_DATA_DATA && *dat->string != '\0') mandoc_msg(MANDOCERR_TBLDATA_SPAN, ln, startpos, "%s", dat->string); } void tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos) { struct tbl_dat *dat; size_t sz; dat = tbl->last_span->last; if (p[pos] == 'T' && p[pos + 1] == '}') { pos += 2; if (tbl->opts.opts & TBL_OPT_NOSPACE) while (p[pos] == ' ') pos++; if (p[pos] == tbl->opts.tab) { tbl->part = TBL_PART_DATA; pos++; while (p[pos] != '\0') getdata(tbl, tbl->last_span, ln, p, &pos); return; } else if (p[pos] == '\0') { tbl->part = TBL_PART_DATA; return; } /* Fallthrough: T} is part of a word. */ } dat->pos = TBL_DATA_DATA; dat->block = 1; if (dat->string != NULL) { sz = strlen(p + pos) + strlen(dat->string) + 2; dat->string = mandoc_realloc(dat->string, sz); (void)strlcat(dat->string, " ", sz); (void)strlcat(dat->string, p + pos, sz); } else dat->string = mandoc_strdup(p + pos); if (dat->layout->pos == TBL_CELL_DOWN) mandoc_msg(MANDOCERR_TBLDATA_SPAN, ln, pos, "%s", dat->string); } static struct tbl_span * newspan(struct tbl_node *tbl, int line, struct tbl_row *rp) { struct tbl_span *dp; dp = mandoc_calloc(1, sizeof(*dp)); dp->line = line; dp->opts = &tbl->opts; dp->layout = rp; dp->prev = tbl->last_span; if (dp->prev == NULL) { tbl->first_span = dp; tbl->current_span = NULL; } else dp->prev->next = dp; tbl->last_span = dp; return dp; } void tbl_data(struct tbl_node *tbl, int ln, const char *p, int pos) { struct tbl_row *rp; struct tbl_cell *cp; struct tbl_span *sp; for (sp = tbl->last_span; sp != NULL; sp = sp->prev) if (sp->pos == TBL_SPAN_DATA) break; rp = sp == NULL ? tbl->first_row : sp->layout->next == NULL ? sp->layout : sp->layout->next; assert(rp != NULL); if (p[1] == '\0') { switch (p[0]) { case '.': /* * Empty request lines must be handled here * and cannot be discarded in roff_parseln() * because in the layout section, they * are significant and end the layout. */ return; case '_': sp = newspan(tbl, ln, rp); sp->pos = TBL_SPAN_HORIZ; return; case '=': sp = newspan(tbl, ln, rp); sp->pos = TBL_SPAN_DHORIZ; return; default: break; } } /* * If the layout row contains nothing but horizontal lines, * allocate an empty span for it and assign the current span * to the next layout row accepting data. */ while (rp->next != NULL) { if (rp->last->col + 1 < tbl->opts.cols) break; for (cp = rp->first; cp != NULL; cp = cp->next) if (cp->pos != TBL_CELL_HORIZ && cp->pos != TBL_CELL_DHORIZ) break; if (cp != NULL) break; sp = newspan(tbl, ln, rp); sp->pos = TBL_SPAN_DATA; rp = rp->next; } /* Process a real data row. */ sp = newspan(tbl, ln, rp); sp->pos = TBL_SPAN_DATA; while (p[pos] != '\0') getdata(tbl, sp, ln, p, &pos); } mandoc-1.14.6/tbl_html.c010064400017530001753000000153351412314055300153270ustar00schwarzeschwarze/* $Id: tbl_html.c,v 1.38 2021/09/09 16:52:52 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014,2015,2017,2018,2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "tbl.h" #include "out.h" #include "html.h" static void html_tblopen(struct html *, const struct tbl_span *); static size_t html_tbl_len(size_t, void *); static size_t html_tbl_strlen(const char *, void *); static size_t html_tbl_sulen(const struct roffsu *, void *); static size_t html_tbl_len(size_t sz, void *arg) { return sz; } static size_t html_tbl_strlen(const char *p, void *arg) { return strlen(p); } static size_t html_tbl_sulen(const struct roffsu *su, void *arg) { if (su->scale < 0.0) return 0; switch (su->unit) { case SCALE_FS: /* 2^16 basic units */ return su->scale * 65536.0 / 24.0; case SCALE_IN: /* 10 characters per inch */ return su->scale * 10.0; case SCALE_CM: /* 2.54 cm per inch */ return su->scale * 10.0 / 2.54; case SCALE_PC: /* 6 pica per inch */ case SCALE_VS: return su->scale * 10.0 / 6.0; case SCALE_EN: case SCALE_EM: return su->scale; case SCALE_PT: /* 12 points per pica */ return su->scale * 10.0 / 6.0 / 12.0; case SCALE_BU: /* 24 basic units per character */ return su->scale / 24.0; case SCALE_MM: /* 1/1000 inch */ return su->scale / 100.0; default: abort(); } } static void html_tblopen(struct html *h, const struct tbl_span *sp) { html_close_paragraph(h); if (h->tbl.cols == NULL) { h->tbl.len = html_tbl_len; h->tbl.slen = html_tbl_strlen; h->tbl.sulen = html_tbl_sulen; tblcalc(&h->tbl, sp, 0, 0); } assert(NULL == h->tblt); h->tblt = print_otag(h, TAG_TABLE, "c?ss", "tbl", "border", sp->opts->opts & TBL_OPT_ALLBOX ? "1" : NULL, "border-style", sp->opts->opts & TBL_OPT_DBOX ? "double" : sp->opts->opts & TBL_OPT_BOX ? "solid" : NULL, "border-top-style", sp->pos == TBL_SPAN_DHORIZ ? "double" : sp->pos == TBL_SPAN_HORIZ ? "solid" : NULL); } void print_tblclose(struct html *h) { assert(h->tblt); print_tagq(h, h->tblt); h->tblt = NULL; } void print_tbl(struct html *h, const struct tbl_span *sp) { const struct tbl_dat *dp; const struct tbl_cell *cp; const struct tbl_span *psp; const struct roffcol *col; struct tag *tt; const char *hspans, *vspans, *halign, *valign; const char *bborder, *lborder, *rborder; const char *ccp; char hbuf[4], vbuf[4]; size_t sz; enum mandoc_esc save_font; int i; if (h->tblt == NULL) html_tblopen(h, sp); /* * Horizontal lines spanning the whole table * are handled by previous or following table rows. */ if (sp->pos != TBL_SPAN_DATA) return; /* Inhibit printing of spaces: we do padding ourselves. */ h->flags |= HTML_NONOSPACE; h->flags |= HTML_NOSPACE; /* Draw a vertical line left of this row? */ switch (sp->layout->vert) { case 2: lborder = "double"; break; case 1: lborder = "solid"; break; default: lborder = NULL; break; } /* Draw a horizontal line below this row? */ bborder = NULL; if ((psp = sp->next) != NULL) { switch (psp->pos) { case TBL_SPAN_DHORIZ: bborder = "double"; break; case TBL_SPAN_HORIZ: bborder = "solid"; break; default: break; } } tt = print_otag(h, TAG_TR, "ss", "border-left-style", lborder, "border-bottom-style", bborder); for (dp = sp->first; dp != NULL; dp = dp->next) { print_stagq(h, tt); /* * Do not generate elements for continuations * of spanned cells. Larger elements covering * this space were already generated earlier. */ cp = dp->layout; if (cp->pos == TBL_CELL_SPAN || cp->pos == TBL_CELL_DOWN || (dp->string != NULL && strcmp(dp->string, "\\^") == 0)) continue; /* Determine the attribute values. */ if (dp->hspans > 0) { (void)snprintf(hbuf, sizeof(hbuf), "%d", dp->hspans + 1); hspans = hbuf; } else hspans = NULL; if (dp->vspans > 0) { (void)snprintf(vbuf, sizeof(vbuf), "%d", dp->vspans + 1); vspans = vbuf; } else vspans = NULL; switch (cp->pos) { case TBL_CELL_CENTRE: halign = "center"; break; case TBL_CELL_RIGHT: case TBL_CELL_NUMBER: halign = "right"; break; default: halign = NULL; break; } if (cp->flags & TBL_CELL_TALIGN) valign = "top"; else if (cp->flags & TBL_CELL_BALIGN) valign = "bottom"; else valign = NULL; for (i = dp->hspans; i > 0; i--) cp = cp->next; switch (cp->vert) { case 2: rborder = "double"; break; case 1: rborder = "solid"; break; default: rborder = NULL; break; } /* Print the element and the attributes. */ print_otag(h, TAG_TD, "??sss", "colspan", hspans, "rowspan", vspans, "vertical-align", valign, "text-align", halign, "border-right-style", rborder); if (dp->layout->pos == TBL_CELL_HORIZ || dp->layout->pos == TBL_CELL_DHORIZ || dp->pos == TBL_DATA_HORIZ || dp->pos == TBL_DATA_DHORIZ) print_otag(h, TAG_HR, ""); else if (dp->string != NULL) { save_font = h->metac; html_setfont(h, dp->layout->font); if (dp->layout->pos == TBL_CELL_LONG) print_text(h, "\\[u2003]"); /* em space */ print_text(h, dp->string); if (dp->layout->pos == TBL_CELL_NUMBER) { col = h->tbl.cols + dp->layout->col; if (col->decimal < col->nwidth) { if ((ccp = strrchr(dp->string, sp->opts->decimal)) == NULL) { /* Punctuation space. */ print_text(h, "\\[u2008]"); ccp = strchr(dp->string, '\0'); } else ccp++; sz = col->nwidth - col->decimal; while (--sz > 0) { if (*ccp == '\0') /* Figure space. */ print_text(h, "\\[u2007]"); else ccp++; } } } html_setfont(h, save_font); } } print_tagq(h, tt); h->flags &= ~HTML_NONOSPACE; if (sp->next == NULL) { assert(h->tbl.cols); free(h->tbl.cols); h->tbl.cols = NULL; print_tblclose(h); } } mandoc-1.14.6/tbl_layout.c010064400017530001753000000201761412314055300156770ustar00schwarzeschwarze/* $Id: tbl_layout.c,v 1.50 2021/08/10 12:55:04 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2012, 2014, 2015, 2017, 2020, 2021 * Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "mandoc_aux.h" #include "mandoc.h" #include "tbl.h" #include "libmandoc.h" #include "tbl_int.h" struct tbl_phrase { char name; enum tbl_cellt key; }; static const struct tbl_phrase keys[] = { { 'c', TBL_CELL_CENTRE }, { 'r', TBL_CELL_RIGHT }, { 'l', TBL_CELL_LEFT }, { 'n', TBL_CELL_NUMBER }, { 's', TBL_CELL_SPAN }, { 'a', TBL_CELL_LONG }, { '^', TBL_CELL_DOWN }, { '-', TBL_CELL_HORIZ }, { '_', TBL_CELL_HORIZ }, { '=', TBL_CELL_DHORIZ } }; #define KEYS_MAX ((int)(sizeof(keys)/sizeof(keys[0]))) static void mods(struct tbl_node *, struct tbl_cell *, int, const char *, int *); static void cell(struct tbl_node *, struct tbl_row *, int, const char *, int *); static struct tbl_cell *cell_alloc(struct tbl_node *, struct tbl_row *, enum tbl_cellt); static void mods(struct tbl_node *tbl, struct tbl_cell *cp, int ln, const char *p, int *pos) { char *endptr; unsigned long spacing; size_t sz; int isz; enum mandoc_esc fontesc; mod: while (p[*pos] == ' ' || p[*pos] == '\t') (*pos)++; /* Row delimiters and cell specifiers end modifier lists. */ if (strchr(".,-=^_ACLNRSaclnrs", p[*pos]) != NULL) return; /* Throw away parenthesised expression. */ if ('(' == p[*pos]) { (*pos)++; while (p[*pos] && ')' != p[*pos]) (*pos)++; if (')' == p[*pos]) { (*pos)++; goto mod; } mandoc_msg(MANDOCERR_TBLLAYOUT_PAR, ln, *pos, NULL); return; } /* Parse numerical spacing from modifier string. */ if (isdigit((unsigned char)p[*pos])) { if ((spacing = strtoul(p + *pos, &endptr, 10)) > 9) mandoc_msg(MANDOCERR_TBLLAYOUT_SPC, ln, *pos, "%lu", spacing); else cp->spacing = spacing; *pos = endptr - p; goto mod; } switch (tolower((unsigned char)p[(*pos)++])) { case 'b': cp->font = ESCAPE_FONTBOLD; goto mod; case 'd': cp->flags |= TBL_CELL_BALIGN; goto mod; case 'e': cp->flags |= TBL_CELL_EQUAL; goto mod; case 'f': break; case 'i': cp->font = ESCAPE_FONTITALIC; goto mod; case 'm': mandoc_msg(MANDOCERR_TBLLAYOUT_MOD, ln, *pos, "m"); goto mod; case 'p': case 'v': if (p[*pos] == '-' || p[*pos] == '+') (*pos)++; while (isdigit((unsigned char)p[*pos])) (*pos)++; goto mod; case 't': cp->flags |= TBL_CELL_TALIGN; goto mod; case 'u': cp->flags |= TBL_CELL_UP; goto mod; case 'w': sz = 0; if (p[*pos] == '(') { (*pos)++; while (p[*pos + sz] != '\0' && p[*pos + sz] != ')') sz++; } else while (isdigit((unsigned char)p[*pos + sz])) sz++; if (sz) { free(cp->wstr); cp->wstr = mandoc_strndup(p + *pos, sz); *pos += sz; if (p[*pos] == ')') (*pos)++; } goto mod; case 'x': cp->flags |= TBL_CELL_WMAX; goto mod; case 'z': cp->flags |= TBL_CELL_WIGN; goto mod; case '|': if (cp->vert < 2) cp->vert++; else mandoc_msg(MANDOCERR_TBLLAYOUT_VERT, ln, *pos - 1, NULL); goto mod; default: mandoc_msg(MANDOCERR_TBLLAYOUT_CHAR, ln, *pos - 1, "%c", p[*pos - 1]); goto mod; } while (p[*pos] == ' ' || p[*pos] == '\t') (*pos)++; /* Ignore parenthised font names for now. */ if (p[*pos] == '(') goto mod; isz = 0; if (p[*pos] != '\0') isz++; if (strchr(" \t.", p[*pos + isz]) == NULL) isz++; fontesc = mandoc_font(p + *pos, isz); switch (fontesc) { case ESCAPE_FONTPREV: case ESCAPE_ERROR: mandoc_msg(MANDOCERR_FT_BAD, ln, *pos, "TS %s", p + *pos - 1); break; default: cp->font = fontesc; break; } *pos += isz; goto mod; } static void cell(struct tbl_node *tbl, struct tbl_row *rp, int ln, const char *p, int *pos) { int i; enum tbl_cellt c; /* Handle leading vertical lines */ while (p[*pos] == ' ' || p[*pos] == '\t' || p[*pos] == '|') { if (p[*pos] == '|') { if (rp->vert < 2) rp->vert++; else mandoc_msg(MANDOCERR_TBLLAYOUT_VERT, ln, *pos, NULL); } (*pos)++; } again: while (p[*pos] == ' ' || p[*pos] == '\t') (*pos)++; if (p[*pos] == '.' || p[*pos] == '\0') return; /* Parse the column position (`c', `l', `r', ...). */ for (i = 0; i < KEYS_MAX; i++) if (tolower((unsigned char)p[*pos]) == keys[i].name) break; if (i == KEYS_MAX) { mandoc_msg(MANDOCERR_TBLLAYOUT_CHAR, ln, *pos, "%c", p[*pos]); (*pos)++; goto again; } c = keys[i].key; /* Special cases of spanners. */ if (c == TBL_CELL_SPAN) { if (rp->last == NULL) mandoc_msg(MANDOCERR_TBLLAYOUT_SPAN, ln, *pos, NULL); else if (rp->last->pos == TBL_CELL_HORIZ || rp->last->pos == TBL_CELL_DHORIZ) c = rp->last->pos; } else if (c == TBL_CELL_DOWN && rp == tbl->first_row) mandoc_msg(MANDOCERR_TBLLAYOUT_DOWN, ln, *pos, NULL); (*pos)++; /* Allocate cell then parse its modifiers. */ mods(tbl, cell_alloc(tbl, rp, c), ln, p, pos); } void tbl_layout(struct tbl_node *tbl, int ln, const char *p, int pos) { struct tbl_row *rp; rp = NULL; for (;;) { /* Skip whitespace before and after each cell. */ while (p[pos] == ' ' || p[pos] == '\t') pos++; switch (p[pos]) { case ',': /* Next row on this input line. */ pos++; rp = NULL; continue; case '\0': /* Next row on next input line. */ return; case '.': /* End of layout. */ pos++; tbl->part = TBL_PART_DATA; /* * When the layout is completely empty, * default to one left-justified column. */ if (tbl->first_row == NULL) { tbl->first_row = tbl->last_row = mandoc_calloc(1, sizeof(*rp)); } if (tbl->first_row->first == NULL) { mandoc_msg(MANDOCERR_TBLLAYOUT_NONE, ln, pos, NULL); cell_alloc(tbl, tbl->first_row, TBL_CELL_LEFT); if (tbl->opts.lvert < tbl->first_row->vert) tbl->opts.lvert = tbl->first_row->vert; return; } /* * Search for the widest line * along the left and right margins. */ for (rp = tbl->first_row; rp; rp = rp->next) { if (tbl->opts.lvert < rp->vert) tbl->opts.lvert = rp->vert; if (rp->last != NULL && rp->last->col + 1 == tbl->opts.cols && tbl->opts.rvert < rp->last->vert) tbl->opts.rvert = rp->last->vert; /* If the last line is empty, drop it. */ if (rp->next != NULL && rp->next->first == NULL) { free(rp->next); rp->next = NULL; tbl->last_row = rp; } } return; default: /* Cell. */ break; } /* * If the last line had at least one cell, * start a new one; otherwise, continue it. */ if (rp == NULL) { if (tbl->last_row == NULL || tbl->last_row->first != NULL) { rp = mandoc_calloc(1, sizeof(*rp)); if (tbl->last_row) tbl->last_row->next = rp; else tbl->first_row = rp; tbl->last_row = rp; } else rp = tbl->last_row; } cell(tbl, rp, ln, p, &pos); } } static struct tbl_cell * cell_alloc(struct tbl_node *tbl, struct tbl_row *rp, enum tbl_cellt pos) { struct tbl_cell *p, *pp; p = mandoc_calloc(1, sizeof(*p)); p->spacing = SIZE_MAX; p->font = ESCAPE_FONTROMAN; p->pos = pos; if ((pp = rp->last) != NULL) { pp->next = p; p->col = pp->col + 1; } else rp->first = p; rp->last = p; if (tbl->opts.cols <= p->col) tbl->opts.cols = p->col + 1; return p; } mandoc-1.14.6/tbl_opts.c010064400017530001753000000074261412314055300153520ustar00schwarzeschwarze/* $Id: tbl_opts.c,v 1.24 2018/12/14 05:18:03 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "mandoc.h" #include "tbl.h" #include "libmandoc.h" #include "tbl_int.h" #define KEY_DPOINT 0 #define KEY_DELIM 1 #define KEY_LINESIZE 2 #define KEY_TAB 3 struct tbl_phrase { const char *name; int key; }; static const struct tbl_phrase keys[] = { {"decimalpoint", 0}, {"delim", 0}, {"linesize", 0}, {"tab", 0}, {"allbox", TBL_OPT_ALLBOX | TBL_OPT_BOX}, {"box", TBL_OPT_BOX}, {"frame", TBL_OPT_BOX}, {"center", TBL_OPT_CENTRE}, {"centre", TBL_OPT_CENTRE}, {"doublebox", TBL_OPT_DBOX}, {"doubleframe", TBL_OPT_DBOX}, {"expand", TBL_OPT_EXPAND}, {"nokeep", TBL_OPT_NOKEEP}, {"nospaces", TBL_OPT_NOSPACE}, {"nowarn", TBL_OPT_NOWARN}, }; #define KEY_MAXKEYS ((int)(sizeof(keys)/sizeof(keys[0]))) static void arg(struct tbl_node *, int, const char *, int *, int); static void arg(struct tbl_node *tbl, int ln, const char *p, int *pos, int key) { int len, want; while (p[*pos] == ' ' || p[*pos] == '\t') (*pos)++; /* Arguments are enclosed in parentheses. */ len = 0; if (p[*pos] == '(') { (*pos)++; while (p[*pos + len] != ')') len++; } switch (key) { case KEY_DELIM: mandoc_msg(MANDOCERR_TBLOPT_EQN, ln, *pos, "%.*s", len, p + *pos); want = 2; break; case KEY_TAB: want = 1; if (len == want) tbl->opts.tab = p[*pos]; break; case KEY_LINESIZE: want = 0; break; case KEY_DPOINT: want = 1; if (len == want) tbl->opts.decimal = p[*pos]; break; default: abort(); } if (len == 0) mandoc_msg(MANDOCERR_TBLOPT_NOARG, ln, *pos, "%s", keys[key].name); else if (want && len != want) mandoc_msg(MANDOCERR_TBLOPT_ARGSZ, ln, *pos, "%s want %d have %d", keys[key].name, want, len); *pos += len; if (p[*pos] == ')') (*pos)++; } /* * Parse one line of options up to the semicolon. * Each option can be preceded by blanks and/or commas, * and some options are followed by arguments. */ void tbl_option(struct tbl_node *tbl, int ln, const char *p, int *offs) { int i, pos, len; pos = *offs; for (;;) { while (p[pos] == ' ' || p[pos] == '\t' || p[pos] == ',') pos++; if (p[pos] == ';') { *offs = pos + 1; return; } /* Parse one option name. */ len = 0; while (isalpha((unsigned char)p[pos + len])) len++; if (len == 0) { mandoc_msg(MANDOCERR_TBLOPT_ALPHA, ln, pos, "%c", p[pos]); pos++; continue; } /* Look up the option name. */ i = 0; while (i < KEY_MAXKEYS && (strncasecmp(p + pos, keys[i].name, len) || keys[i].name[len] != '\0')) i++; if (i == KEY_MAXKEYS) { mandoc_msg(MANDOCERR_TBLOPT_BAD, ln, pos, "%.*s", len, p + pos); pos += len; continue; } /* Handle the option. */ pos += len; if (keys[i].key) tbl->opts.opts |= keys[i].key; else arg(tbl, ln, p, &pos, i); } } mandoc-1.14.6/tbl_term.c010064400017530001753000000605161412314055300153330ustar00schwarzeschwarze/* $Id: tbl_term.c,v 1.75 2021/08/10 12:55:04 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011-2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "mandoc.h" #include "tbl.h" #include "out.h" #include "term.h" #define IS_HORIZ(cp) ((cp)->pos == TBL_CELL_HORIZ || \ (cp)->pos == TBL_CELL_DHORIZ) static size_t term_tbl_len(size_t, void *); static size_t term_tbl_strlen(const char *, void *); static size_t term_tbl_sulen(const struct roffsu *, void *); static void tbl_data(struct termp *, const struct tbl_opts *, const struct tbl_cell *, const struct tbl_dat *, const struct roffcol *); static void tbl_direct_border(struct termp *, int, size_t); static void tbl_fill_border(struct termp *, int, size_t); static void tbl_fill_char(struct termp *, char, size_t); static void tbl_fill_string(struct termp *, const char *, size_t); static void tbl_hrule(struct termp *, const struct tbl_span *, const struct tbl_span *, const struct tbl_span *, int); static void tbl_literal(struct termp *, const struct tbl_dat *, const struct roffcol *); static void tbl_number(struct termp *, const struct tbl_opts *, const struct tbl_dat *, const struct roffcol *); static void tbl_word(struct termp *, const struct tbl_dat *); /* * The following border-character tables are indexed * by ternary (3-based) numbers, as opposed to binary or decimal. * Each ternary digit describes the line width in one direction: * 0 means no line, 1 single or light line, 2 double or heavy line. */ /* Positional values of the four directions. */ #define BRIGHT 1 #define BDOWN 3 #define BLEFT (3 * 3) #define BUP (3 * 3 * 3) #define BHORIZ (BLEFT + BRIGHT) /* Code points to use for each combination of widths. */ static const int borders_utf8[81] = { 0x0020, 0x2576, 0x257a, /* 000 right */ 0x2577, 0x250c, 0x250d, /* 001 down */ 0x257b, 0x250e, 0x250f, /* 002 */ 0x2574, 0x2500, 0x257c, /* 010 left */ 0x2510, 0x252c, 0x252e, /* 011 left down */ 0x2512, 0x2530, 0x2532, /* 012 */ 0x2578, 0x257e, 0x2501, /* 020 left */ 0x2511, 0x252d, 0x252f, /* 021 left down */ 0x2513, 0x2531, 0x2533, /* 022 */ 0x2575, 0x2514, 0x2515, /* 100 up */ 0x2502, 0x251c, 0x251d, /* 101 up down */ 0x257d, 0x251f, 0x2522, /* 102 */ 0x2518, 0x2534, 0x2536, /* 110 up left */ 0x2524, 0x253c, 0x253e, /* 111 all */ 0x2527, 0x2541, 0x2546, /* 112 */ 0x2519, 0x2535, 0x2537, /* 120 up left */ 0x2525, 0x253d, 0x253f, /* 121 all */ 0x252a, 0x2545, 0x2548, /* 122 */ 0x2579, 0x2516, 0x2517, /* 200 up */ 0x257f, 0x251e, 0x2521, /* 201 up down */ 0x2503, 0x2520, 0x2523, /* 202 */ 0x251a, 0x2538, 0x253a, /* 210 up left */ 0x2526, 0x2540, 0x2544, /* 211 all */ 0x2528, 0x2542, 0x254a, /* 212 */ 0x251b, 0x2539, 0x253b, /* 220 up left */ 0x2529, 0x2543, 0x2547, /* 221 all */ 0x252b, 0x2549, 0x254b, /* 222 */ }; /* ASCII approximations for these code points, compatible with groff. */ static const int borders_ascii[81] = { ' ', '-', '=', /* 000 right */ '|', '+', '+', /* 001 down */ '|', '+', '+', /* 002 */ '-', '-', '=', /* 010 left */ '+', '+', '+', /* 011 left down */ '+', '+', '+', /* 012 */ '=', '=', '=', /* 020 left */ '+', '+', '+', /* 021 left down */ '+', '+', '+', /* 022 */ '|', '+', '+', /* 100 up */ '|', '+', '+', /* 101 up down */ '|', '+', '+', /* 102 */ '+', '+', '+', /* 110 up left */ '+', '+', '+', /* 111 all */ '+', '+', '+', /* 112 */ '+', '+', '+', /* 120 up left */ '+', '+', '+', /* 121 all */ '+', '+', '+', /* 122 */ '|', '+', '+', /* 200 up */ '|', '+', '+', /* 201 up down */ '|', '+', '+', /* 202 */ '+', '+', '+', /* 210 up left */ '+', '+', '+', /* 211 all */ '+', '+', '+', /* 212 */ '+', '+', '+', /* 220 up left */ '+', '+', '+', /* 221 all */ '+', '+', '+', /* 222 */ }; /* Either of the above according to the selected output encoding. */ static const int *borders_locale; static size_t term_tbl_sulen(const struct roffsu *su, void *arg) { int i; i = term_hen((const struct termp *)arg, su); return i > 0 ? i : 0; } static size_t term_tbl_strlen(const char *p, void *arg) { return term_strlen((const struct termp *)arg, p); } static size_t term_tbl_len(size_t sz, void *arg) { return term_len((const struct termp *)arg, sz); } void term_tbl(struct termp *tp, const struct tbl_span *sp) { const struct tbl_cell *cp, *cpn, *cpp, *cps; const struct tbl_dat *dp; static size_t offset; size_t save_offset; size_t coloff, tsz; int hspans, ic, more; int dvert, fc, horiz, lhori, rhori, uvert; /* Inhibit printing of spaces: we do padding ourselves. */ tp->flags |= TERMP_NOSPACE | TERMP_NONOSPACE; save_offset = tp->tcol->offset; /* * The first time we're invoked for a given table block, * calculate the table widths and decimal positions. */ if (tp->tbl.cols == NULL) { borders_locale = tp->enc == TERMENC_UTF8 ? borders_utf8 : borders_ascii; tp->tbl.len = term_tbl_len; tp->tbl.slen = term_tbl_strlen; tp->tbl.sulen = term_tbl_sulen; tp->tbl.arg = tp; tblcalc(&tp->tbl, sp, tp->tcol->offset, tp->tcol->rmargin); /* Center the table as a whole. */ offset = tp->tcol->offset; if (sp->opts->opts & TBL_OPT_CENTRE) { tsz = sp->opts->opts & (TBL_OPT_BOX | TBL_OPT_DBOX) ? 2 : !!sp->opts->lvert + !!sp->opts->rvert; for (ic = 0; ic + 1 < sp->opts->cols; ic++) tsz += tp->tbl.cols[ic].width + tp->tbl.cols[ic].spacing; if (sp->opts->cols) tsz += tp->tbl.cols[sp->opts->cols - 1].width; if (offset + tsz > tp->tcol->rmargin) tsz -= 1; offset = offset + tp->tcol->rmargin > tsz ? (offset + tp->tcol->rmargin - tsz) / 2 : 0; tp->tcol->offset = offset; } /* Horizontal frame at the start of boxed tables. */ if (tp->enc == TERMENC_ASCII && sp->opts->opts & TBL_OPT_DBOX) tbl_hrule(tp, NULL, sp, sp, TBL_OPT_DBOX); if (sp->opts->opts & (TBL_OPT_DBOX | TBL_OPT_BOX)) tbl_hrule(tp, NULL, sp, sp, TBL_OPT_BOX); } /* Set up the columns. */ tp->flags |= TERMP_MULTICOL; tp->tcol->offset = offset; horiz = 0; switch (sp->pos) { case TBL_SPAN_HORIZ: case TBL_SPAN_DHORIZ: horiz = 1; term_setcol(tp, 1); break; case TBL_SPAN_DATA: term_setcol(tp, sp->opts->cols + 2); coloff = tp->tcol->offset; /* Set up a column for a left vertical frame. */ if (sp->opts->opts & (TBL_OPT_BOX | TBL_OPT_DBOX) || sp->opts->lvert) coloff++; tp->tcol->rmargin = coloff; /* Set up the data columns. */ dp = sp->first; hspans = 0; for (ic = 0; ic < sp->opts->cols; ic++) { if (hspans == 0) { tp->tcol++; tp->tcol->offset = coloff; } coloff += tp->tbl.cols[ic].width; tp->tcol->rmargin = coloff; if (ic + 1 < sp->opts->cols) coloff += tp->tbl.cols[ic].spacing; if (hspans) { hspans--; continue; } if (dp != NULL && (ic || sp->layout->first->pos != TBL_CELL_SPAN)) { hspans = dp->hspans; dp = dp->next; } } /* Set up a column for a right vertical frame. */ tp->tcol++; tp->tcol->offset = coloff + 1; tp->tcol->rmargin = tp->maxrmargin; /* Spans may have reduced the number of columns. */ tp->lasttcol = tp->tcol - tp->tcols; /* Fill the buffers for all data columns. */ tp->tcol = tp->tcols; cp = cpn = sp->layout->first; dp = sp->first; hspans = 0; for (ic = 0; ic < sp->opts->cols; ic++) { if (cpn != NULL) { cp = cpn; cpn = cpn->next; } if (hspans) { hspans--; continue; } tp->tcol++; tp->col = 0; tbl_data(tp, sp->opts, cp, dp, tp->tbl.cols + ic); if (dp != NULL && (ic || sp->layout->first->pos != TBL_CELL_SPAN)) { hspans = dp->hspans; dp = dp->next; } } break; } do { /* Print the vertical frame at the start of each row. */ tp->tcol = tp->tcols; uvert = dvert = sp->opts->opts & TBL_OPT_DBOX ? 2 : sp->opts->opts & TBL_OPT_BOX ? 1 : 0; if (sp->pos == TBL_SPAN_DATA && uvert < sp->layout->vert) uvert = dvert = sp->layout->vert; if (sp->next != NULL && sp->next->pos == TBL_SPAN_DATA && dvert < sp->next->layout->vert) dvert = sp->next->layout->vert; if (sp->prev != NULL && uvert < sp->prev->layout->vert && (horiz || (IS_HORIZ(sp->layout->first) && !IS_HORIZ(sp->prev->layout->first)))) uvert = sp->prev->layout->vert; rhori = sp->pos == TBL_SPAN_DHORIZ || (sp->first != NULL && sp->first->pos == TBL_DATA_DHORIZ) || sp->layout->first->pos == TBL_CELL_DHORIZ ? 2 : sp->pos == TBL_SPAN_HORIZ || (sp->first != NULL && sp->first->pos == TBL_DATA_HORIZ) || sp->layout->first->pos == TBL_CELL_HORIZ ? 1 : 0; fc = BUP * uvert + BDOWN * dvert + BRIGHT * rhori; if (uvert > 0 || dvert > 0 || (horiz && sp->opts->lvert)) { (*tp->advance)(tp, tp->tcols->offset); tp->viscol = tp->tcol->offset; tbl_direct_border(tp, fc, 1); } /* Print the data cells. */ more = 0; if (horiz) tbl_hrule(tp, sp->prev, sp, sp->next, 0); else { cp = sp->layout->first; cpn = sp->next == NULL ? NULL : sp->next->layout->first; cpp = sp->prev == NULL ? NULL : sp->prev->layout->first; dp = sp->first; hspans = 0; for (ic = 0; ic < sp->opts->cols; ic++) { /* * Figure out whether to print a * vertical line after this cell * and advance to next layout cell. */ uvert = dvert = fc = 0; if (cp != NULL) { cps = cp; while (cps->next != NULL && cps->next->pos == TBL_CELL_SPAN) cps = cps->next; if (sp->pos == TBL_SPAN_DATA) uvert = dvert = cps->vert; switch (cp->pos) { case TBL_CELL_HORIZ: fc = BHORIZ; break; case TBL_CELL_DHORIZ: fc = BHORIZ * 2; break; default: break; } } if (cpp != NULL) { if (uvert < cpp->vert && cp != NULL && ((IS_HORIZ(cp) && !IS_HORIZ(cpp)) || (cp->next != NULL && cpp->next != NULL && IS_HORIZ(cp->next) && !IS_HORIZ(cpp->next)))) uvert = cpp->vert; cpp = cpp->next; } if (sp->opts->opts & TBL_OPT_ALLBOX) { if (uvert == 0) uvert = 1; if (dvert == 0) dvert = 1; } if (cpn != NULL) { if (dvert == 0 || (dvert < cpn->vert && tp->enc == TERMENC_UTF8)) dvert = cpn->vert; cpn = cpn->next; } lhori = (cp != NULL && cp->pos == TBL_CELL_DHORIZ) || (dp != NULL && dp->pos == TBL_DATA_DHORIZ) ? 2 : (cp != NULL && cp->pos == TBL_CELL_HORIZ) || (dp != NULL && dp->pos == TBL_DATA_HORIZ) ? 1 : 0; /* * Skip later cells in a span, * figure out whether to start a span, * and advance to next data cell. */ if (hspans) { hspans--; cp = cp->next; continue; } if (dp != NULL && (ic || sp->layout->first->pos != TBL_CELL_SPAN)) { hspans = dp->hspans; dp = dp->next; } /* * Print one line of text in the cell * and remember whether there is more. */ tp->tcol++; if (tp->tcol->col < tp->tcol->lastcol) term_flushln(tp); if (tp->tcol->col < tp->tcol->lastcol) more = 1; /* * Vertical frames between data cells, * but not after the last column. */ if (fc == 0 && ((uvert == 0 && dvert == 0 && cp != NULL && (cp->next == NULL || !IS_HORIZ(cp->next))) || tp->tcol + 1 == tp->tcols + tp->lasttcol)) { if (cp != NULL) cp = cp->next; continue; } if (tp->viscol < tp->tcol->rmargin) { (*tp->advance)(tp, tp->tcol->rmargin - tp->viscol); tp->viscol = tp->tcol->rmargin; } while (tp->viscol < tp->tcol->rmargin + tp->tbl.cols[ic].spacing / 2) tbl_direct_border(tp, BHORIZ * lhori, 1); if (tp->tcol + 1 == tp->tcols + tp->lasttcol) continue; if (cp != NULL) cp = cp->next; rhori = (cp != NULL && cp->pos == TBL_CELL_DHORIZ) || (dp != NULL && dp->pos == TBL_DATA_DHORIZ) ? 2 : (cp != NULL && cp->pos == TBL_CELL_HORIZ) || (dp != NULL && dp->pos == TBL_DATA_HORIZ) ? 1 : 0; if (tp->tbl.cols[ic].spacing) tbl_direct_border(tp, BLEFT * lhori + BRIGHT * rhori + BUP * uvert + BDOWN * dvert, 1); if (tp->enc == TERMENC_UTF8) uvert = dvert = 0; if (tp->tbl.cols[ic].spacing > 2 && (uvert > 1 || dvert > 1 || rhori)) tbl_direct_border(tp, BHORIZ * rhori + BUP * (uvert > 1) + BDOWN * (dvert > 1), 1); } } /* Print the vertical frame at the end of each row. */ uvert = dvert = sp->opts->opts & TBL_OPT_DBOX ? 2 : sp->opts->opts & TBL_OPT_BOX ? 1 : 0; if (sp->pos == TBL_SPAN_DATA && uvert < sp->layout->last->vert && sp->layout->last->col + 1 == sp->opts->cols) uvert = dvert = sp->layout->last->vert; if (sp->next != NULL && dvert < sp->next->layout->last->vert && sp->next->layout->last->col + 1 == sp->opts->cols) dvert = sp->next->layout->last->vert; if (sp->prev != NULL && uvert < sp->prev->layout->last->vert && sp->prev->layout->last->col + 1 == sp->opts->cols && (horiz || (IS_HORIZ(sp->layout->last) && !IS_HORIZ(sp->prev->layout->last)))) uvert = sp->prev->layout->last->vert; lhori = sp->pos == TBL_SPAN_DHORIZ || (sp->last != NULL && sp->last->pos == TBL_DATA_DHORIZ && sp->last->layout->col + 1 == sp->opts->cols) || (sp->layout->last->pos == TBL_CELL_DHORIZ && sp->layout->last->col + 1 == sp->opts->cols) ? 2 : sp->pos == TBL_SPAN_HORIZ || (sp->last != NULL && sp->last->pos == TBL_DATA_HORIZ && sp->last->layout->col + 1 == sp->opts->cols) || (sp->layout->last->pos == TBL_CELL_HORIZ && sp->layout->last->col + 1 == sp->opts->cols) ? 1 : 0; fc = BUP * uvert + BDOWN * dvert + BLEFT * lhori; if (uvert > 0 || dvert > 0 || (horiz && sp->opts->rvert)) { if (horiz == 0 && (IS_HORIZ(sp->layout->last) == 0 || sp->layout->last->col + 1 < sp->opts->cols)) { tp->tcol++; do { tbl_direct_border(tp, BHORIZ * lhori, 1); } while (tp->viscol < tp->tcol->offset); } tbl_direct_border(tp, fc, 1); } (*tp->endline)(tp); tp->viscol = 0; } while (more); /* * Clean up after this row. If it is the last line * of the table, print the box line and clean up * column data; otherwise, print the allbox line. */ term_setcol(tp, 1); tp->flags &= ~TERMP_MULTICOL; tp->tcol->rmargin = tp->maxrmargin; if (sp->next == NULL) { if (sp->opts->opts & (TBL_OPT_DBOX | TBL_OPT_BOX)) { tbl_hrule(tp, sp, sp, NULL, TBL_OPT_BOX); tp->skipvsp = 1; } if (tp->enc == TERMENC_ASCII && sp->opts->opts & TBL_OPT_DBOX) { tbl_hrule(tp, sp, sp, NULL, TBL_OPT_DBOX); tp->skipvsp = 2; } assert(tp->tbl.cols); free(tp->tbl.cols); tp->tbl.cols = NULL; } else if (horiz == 0 && sp->opts->opts & TBL_OPT_ALLBOX && (sp->next == NULL || sp->next->pos == TBL_SPAN_DATA || sp->next->next != NULL)) tbl_hrule(tp, sp, sp, sp->next, TBL_OPT_ALLBOX); tp->tcol->offset = save_offset; tp->flags &= ~TERMP_NONOSPACE; } static void tbl_hrule(struct termp *tp, const struct tbl_span *spp, const struct tbl_span *sp, const struct tbl_span *spn, int flags) { const struct tbl_cell *cpp; /* Layout cell above this line. */ const struct tbl_cell *cp; /* Layout cell in this line. */ const struct tbl_cell *cpn; /* Layout cell below this line. */ const struct tbl_dat *dpn; /* Data cell below this line. */ const struct roffcol *col; /* Contains width and spacing. */ int opts; /* For the table as a whole. */ int bw; /* Box line width. */ int hw; /* Horizontal line width. */ int lw, rw; /* Left and right line widths. */ int uw, dw; /* Vertical line widths. */ cpp = spp == NULL ? NULL : spp->layout->first; cp = sp == NULL ? NULL : sp->layout->first; cpn = spn == NULL ? NULL : spn->layout->first; dpn = NULL; if (spn != NULL) { if (spn->pos == TBL_SPAN_DATA) dpn = spn->first; else if (spn->next != NULL) dpn = spn->next->first; } opts = sp->opts->opts; bw = opts & TBL_OPT_DBOX ? (tp->enc == TERMENC_UTF8 ? 2 : 1) : opts & (TBL_OPT_BOX | TBL_OPT_ALLBOX) ? 1 : 0; hw = flags == TBL_OPT_DBOX || flags == TBL_OPT_BOX ? bw : sp->pos == TBL_SPAN_DHORIZ ? 2 : 1; /* Print the left end of the line. */ if (tp->viscol == 0) { (*tp->advance)(tp, tp->tcols->offset); tp->viscol = tp->tcols->offset; } if (flags != 0) tbl_direct_border(tp, (spp == NULL ? 0 : BUP * bw) + (spn == NULL ? 0 : BDOWN * bw) + (spp == NULL || cpn == NULL || cpn->pos != TBL_CELL_DOWN ? BRIGHT * hw : 0), 1); col = tp->tbl.cols; for (;;) { if (cp == NULL) col++; else col = tp->tbl.cols + cp->col; /* Print the horizontal line inside this column. */ lw = cpp == NULL || cpn == NULL || (cpn->pos != TBL_CELL_DOWN && (dpn == NULL || dpn->string == NULL || strcmp(dpn->string, "\\^") != 0)) ? hw : 0; tbl_direct_border(tp, BHORIZ * lw, col->width + col->spacing / 2); /* * Figure out whether a vertical line is crossing * at the end of this column, * and advance to the next column. */ uw = dw = 0; if (cpp != NULL) { if (flags != TBL_OPT_DBOX) { uw = cpp->vert; if (uw == 0 && opts & TBL_OPT_ALLBOX) uw = 1; } cpp = cpp->next; } else if (spp != NULL && opts & TBL_OPT_ALLBOX) uw = 1; if (cp != NULL) cp = cp->next; if (cpn != NULL) { if (flags != TBL_OPT_DBOX) { dw = cpn->vert; if (dw == 0 && opts & TBL_OPT_ALLBOX) dw = 1; } cpn = cpn->next; while (dpn != NULL && dpn->layout != cpn) dpn = dpn->next; } else if (spn != NULL && opts & TBL_OPT_ALLBOX) dw = 1; if (col + 1 == tp->tbl.cols + sp->opts->cols) break; /* Vertical lines do not cross spanned cells. */ if (cpp != NULL && cpp->pos == TBL_CELL_SPAN) uw = 0; if (cpn != NULL && cpn->pos == TBL_CELL_SPAN) dw = 0; /* The horizontal line inside the next column. */ rw = cpp == NULL || cpn == NULL || (cpn->pos != TBL_CELL_DOWN && (dpn == NULL || dpn->string == NULL || strcmp(dpn->string, "\\^") != 0)) ? hw : 0; /* The line crossing at the end of this column. */ if (col->spacing) tbl_direct_border(tp, BLEFT * lw + BRIGHT * rw + BUP * uw + BDOWN * dw, 1); /* * In ASCII output, a crossing may print two characters. */ if (tp->enc != TERMENC_ASCII || (uw < 2 && dw < 2)) uw = dw = 0; if (col->spacing > 2) tbl_direct_border(tp, BHORIZ * rw + BUP * uw + BDOWN * dw, 1); /* Padding before the start of the next column. */ if (col->spacing > 4) tbl_direct_border(tp, BHORIZ * rw, (col->spacing - 3) / 2); } /* Print the right end of the line. */ if (flags != 0) { tbl_direct_border(tp, (spp == NULL ? 0 : BUP * bw) + (spn == NULL ? 0 : BDOWN * bw) + (spp == NULL || spn == NULL || spn->layout->last->pos != TBL_CELL_DOWN ? BLEFT * hw : 0), 1); (*tp->endline)(tp); tp->viscol = 0; } } static void tbl_data(struct termp *tp, const struct tbl_opts *opts, const struct tbl_cell *cp, const struct tbl_dat *dp, const struct roffcol *col) { switch (cp->pos) { case TBL_CELL_HORIZ: tbl_fill_border(tp, BHORIZ, col->width); return; case TBL_CELL_DHORIZ: tbl_fill_border(tp, BHORIZ * 2, col->width); return; default: break; } if (dp == NULL) return; switch (dp->pos) { case TBL_DATA_NONE: return; case TBL_DATA_HORIZ: case TBL_DATA_NHORIZ: tbl_fill_border(tp, BHORIZ, col->width); return; case TBL_DATA_NDHORIZ: case TBL_DATA_DHORIZ: tbl_fill_border(tp, BHORIZ * 2, col->width); return; default: break; } switch (cp->pos) { case TBL_CELL_LONG: case TBL_CELL_CENTRE: case TBL_CELL_LEFT: case TBL_CELL_RIGHT: tbl_literal(tp, dp, col); break; case TBL_CELL_NUMBER: tbl_number(tp, opts, dp, col); break; case TBL_CELL_DOWN: case TBL_CELL_SPAN: break; default: abort(); } } static void tbl_fill_string(struct termp *tp, const char *cp, size_t len) { size_t i, sz; sz = term_strlen(tp, cp); for (i = 0; i < len; i += sz) term_word(tp, cp); } static void tbl_fill_char(struct termp *tp, char c, size_t len) { char cp[2]; cp[0] = c; cp[1] = '\0'; tbl_fill_string(tp, cp, len); } static void tbl_fill_border(struct termp *tp, int c, size_t len) { char buf[12]; if ((c = borders_locale[c]) > 127) { (void)snprintf(buf, sizeof(buf), "\\[u%04x]", c); tbl_fill_string(tp, buf, len); } else tbl_fill_char(tp, c, len); } static void tbl_direct_border(struct termp *tp, int c, size_t len) { size_t i, sz; c = borders_locale[c]; sz = (*tp->width)(tp, c); for (i = 0; i < len; i += sz) { (*tp->letter)(tp, c); tp->viscol += sz; } } static void tbl_literal(struct termp *tp, const struct tbl_dat *dp, const struct roffcol *col) { size_t len, padl, padr, width; int ic, hspans; assert(dp->string); len = term_strlen(tp, dp->string); width = col->width; ic = dp->layout->col; hspans = dp->hspans; while (hspans--) width += tp->tbl.cols[++ic].width + 3; padr = width > len ? width - len : 0; padl = 0; switch (dp->layout->pos) { case TBL_CELL_LONG: padl = term_len(tp, 1); padr = padr > padl ? padr - padl : 0; break; case TBL_CELL_CENTRE: if (2 > padr) break; padl = padr / 2; padr -= padl; break; case TBL_CELL_RIGHT: padl = padr; padr = 0; break; default: break; } tbl_fill_char(tp, ASCII_NBRSP, padl); tbl_word(tp, dp); tbl_fill_char(tp, ASCII_NBRSP, padr); } static void tbl_number(struct termp *tp, const struct tbl_opts *opts, const struct tbl_dat *dp, const struct roffcol *col) { const char *cp, *lastdigit, *lastpoint; size_t intsz, padl, totsz; char buf[2]; /* * Almost the same code as in tblcalc_number(): * First find the position of the decimal point. */ assert(dp->string); lastdigit = lastpoint = NULL; for (cp = dp->string; cp[0] != '\0'; cp++) { if (cp[0] == '\\' && cp[1] == '&') { lastdigit = lastpoint = cp; break; } else if (cp[0] == opts->decimal && (isdigit((unsigned char)cp[1]) || (cp > dp->string && isdigit((unsigned char)cp[-1])))) lastpoint = cp; else if (isdigit((unsigned char)cp[0])) lastdigit = cp; } /* Then measure both widths. */ padl = 0; totsz = term_strlen(tp, dp->string); if (lastdigit != NULL) { if (lastpoint == NULL) lastpoint = lastdigit + 1; intsz = 0; buf[1] = '\0'; for (cp = dp->string; cp < lastpoint; cp++) { buf[0] = cp[0]; intsz += term_strlen(tp, buf); } /* * Pad left to match the decimal position, * but avoid exceeding the total column width. */ if (col->decimal > intsz && col->width > totsz) { padl = col->decimal - intsz; if (padl + totsz > col->width) padl = col->width - totsz; } /* If it is not a number, simply center the string. */ } else if (col->width > totsz) padl = (col->width - totsz) / 2; tbl_fill_char(tp, ASCII_NBRSP, padl); tbl_word(tp, dp); /* Pad right to fill the column. */ if (col->width > padl + totsz) tbl_fill_char(tp, ASCII_NBRSP, col->width - padl - totsz); } static void tbl_word(struct termp *tp, const struct tbl_dat *dp) { int prev_font; prev_font = tp->fonti; switch (dp->layout->font) { case ESCAPE_FONTBI: term_fontpush(tp, TERMFONT_BI); break; case ESCAPE_FONTBOLD: case ESCAPE_FONTCB: term_fontpush(tp, TERMFONT_BOLD); break; case ESCAPE_FONTITALIC: case ESCAPE_FONTCI: term_fontpush(tp, TERMFONT_UNDER); break; case ESCAPE_FONTROMAN: case ESCAPE_FONTCR: break; default: abort(); } term_word(tp, dp->string); term_fontpopq(tp, prev_font); } mandoc-1.14.6/term.c010064400017530001753000000604401412314055300144660ustar00schwarzeschwarze/* $Id: term.c,v 1.283 2021/08/10 12:55:04 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "mandoc.h" #include "mandoc_aux.h" #include "out.h" #include "term.h" #include "main.h" static size_t cond_width(const struct termp *, int, int *); static void adjbuf(struct termp_col *, size_t); static void bufferc(struct termp *, char); static void encode(struct termp *, const char *, size_t); static void encode1(struct termp *, int); static void endline(struct termp *); static void term_field(struct termp *, size_t, size_t); static void term_fill(struct termp *, size_t *, size_t *, size_t); void term_setcol(struct termp *p, size_t maxtcol) { if (maxtcol > p->maxtcol) { p->tcols = mandoc_recallocarray(p->tcols, p->maxtcol, maxtcol, sizeof(*p->tcols)); p->maxtcol = maxtcol; } p->lasttcol = maxtcol - 1; p->tcol = p->tcols; } void term_free(struct termp *p) { for (p->tcol = p->tcols; p->tcol < p->tcols + p->maxtcol; p->tcol++) free(p->tcol->buf); free(p->tcols); free(p->fontq); free(p); } void term_begin(struct termp *p, term_margin head, term_margin foot, const struct roff_meta *arg) { p->headf = head; p->footf = foot; p->argf = arg; (*p->begin)(p); } void term_end(struct termp *p) { (*p->end)(p); } /* * Flush a chunk of text. By default, break the output line each time * the right margin is reached, and continue output on the next line * at the same offset as the chunk itself. By default, also break the * output line at the end of the chunk. There are many flags modifying * this behaviour, see the comments in the body of the function. */ void term_flushln(struct termp *p) { size_t vbl; /* Number of blanks to prepend to the output. */ size_t vbr; /* Actual visual position of the end of field. */ size_t vfield; /* Desired visual field width. */ size_t vtarget; /* Desired visual position of the right margin. */ size_t ic; /* Character position in the input buffer. */ size_t nbr; /* Number of characters to print in this field. */ /* * Normally, start writing at the left margin, but with the * NOPAD flag, start writing at the current position instead. */ vbl = (p->flags & TERMP_NOPAD) || p->tcol->offset < p->viscol ? 0 : p->tcol->offset - p->viscol; if (p->minbl && vbl < p->minbl) vbl = p->minbl; if ((p->flags & TERMP_MULTICOL) == 0) p->tcol->col = 0; /* Loop over output lines. */ for (;;) { vfield = p->tcol->rmargin > p->viscol + vbl ? p->tcol->rmargin - p->viscol - vbl : 0; /* * Normally, break the line at the the right margin * of the field, but with the NOBREAK flag, only * break it at the max right margin of the screen, * and with the BRNEVER flag, never break it at all. */ vtarget = (p->flags & TERMP_NOBREAK) == 0 ? vfield : p->maxrmargin > p->viscol + vbl ? p->maxrmargin - p->viscol - vbl : 0; /* * Figure out how much text will fit in the field. * If there is whitespace only, print nothing. */ term_fill(p, &nbr, &vbr, p->flags & TERMP_BRNEVER ? SIZE_MAX : vtarget); if (nbr == 0) break; /* * With the CENTER or RIGHT flag, increase the indentation * to center the text between the left and right margins * or to adjust it to the right margin, respectively. */ if (vbr < vtarget) { if (p->flags & TERMP_CENTER) vbl += (vtarget - vbr) / 2; else if (p->flags & TERMP_RIGHT) vbl += vtarget - vbr; } /* Finally, print the field content. */ term_field(p, vbl, nbr); /* * If there is no text left in the field, exit the loop. * If the BRTRSP flag is set, consider trailing * whitespace significant when deciding whether * the field fits or not. */ for (ic = p->tcol->col; ic < p->tcol->lastcol; ic++) { switch (p->tcol->buf[ic]) { case '\t': if (p->flags & TERMP_BRTRSP) vbr = term_tab_next(vbr); continue; case ' ': if (p->flags & TERMP_BRTRSP) vbr += (*p->width)(p, ' '); continue; case '\n': case ASCII_BREAK: continue; default: break; } break; } if (ic == p->tcol->lastcol) break; /* * At the location of an automtic line break, input * space characters are consumed by the line break. */ while (p->tcol->col < p->tcol->lastcol && p->tcol->buf[p->tcol->col] == ' ') p->tcol->col++; /* * In multi-column mode, leave the rest of the text * in the buffer to be handled by a subsequent * invocation, such that the other columns of the * table can be handled first. * In single-column mode, simply break the line. */ if (p->flags & TERMP_MULTICOL) return; endline(p); p->viscol = 0; /* * Normally, start the next line at the same indentation * as this one, but with the BRIND flag, start it at the * right margin instead. This is used together with * NOBREAK for the tags in various kinds of tagged lists. */ vbl = p->flags & TERMP_BRIND ? p->tcol->rmargin : p->tcol->offset; } /* Reset output state in preparation for the next field. */ p->col = p->tcol->col = p->tcol->lastcol = 0; p->minbl = p->trailspace; p->flags &= ~(TERMP_BACKAFTER | TERMP_BACKBEFORE | TERMP_NOPAD); if (p->flags & TERMP_MULTICOL) return; /* * The HANG flag means that the next field * always follows on the same line. * The NOBREAK flag means that the next field * follows on the same line unless the field was overrun. * Normally, break the line at the end of each field. */ if ((p->flags & TERMP_HANG) == 0 && ((p->flags & TERMP_NOBREAK) == 0 || vbr + term_len(p, p->trailspace) > vfield)) endline(p); } /* * Store the number of input characters to print in this field in *nbr * and their total visual width to print in *vbr. * If there is only whitespace in the field, both remain zero. * The desired visual width of the field is provided by vtarget. * If the first word is longer, the field will be overrun. */ static void term_fill(struct termp *p, size_t *nbr, size_t *vbr, size_t vtarget) { size_t ic; /* Character position in the input buffer. */ size_t vis; /* Visual position of the current character. */ size_t vn; /* Visual position of the next character. */ int breakline; /* Break at the end of this word. */ int graph; /* Last character was non-blank. */ *nbr = *vbr = vis = 0; breakline = graph = 0; for (ic = p->tcol->col; ic < p->tcol->lastcol; ic++) { switch (p->tcol->buf[ic]) { case '\b': /* Escape \o (overstrike) or backspace markup. */ assert(ic > 0); vis -= (*p->width)(p, p->tcol->buf[ic - 1]); continue; case '\t': /* Normal ASCII whitespace. */ case ' ': case ASCII_BREAK: /* Escape \: (breakpoint). */ switch (p->tcol->buf[ic]) { case '\t': vn = term_tab_next(vis); break; case ' ': vn = vis + (*p->width)(p, ' '); break; case ASCII_BREAK: vn = vis; break; default: abort(); } /* Can break at the end of a word. */ if (breakline || vn > vtarget) break; if (graph) { *nbr = ic; *vbr = vis; graph = 0; } vis = vn; continue; case '\n': /* Escape \p (break at the end of the word). */ breakline = 1; continue; case ASCII_HYPH: /* Breakable hyphen. */ graph = 1; /* * We are about to decide whether to break the * line or not, so we no longer need this hyphen * to be marked as breakable. Put back a real * hyphen such that we get the correct width. */ p->tcol->buf[ic] = '-'; vis += (*p->width)(p, '-'); if (vis > vtarget) { ic++; break; } *nbr = ic + 1; *vbr = vis; continue; case ASCII_NBRSP: /* Non-breakable space. */ p->tcol->buf[ic] = ' '; /* FALLTHROUGH */ default: /* Printable character. */ graph = 1; vis += (*p->width)(p, p->tcol->buf[ic]); if (vis > vtarget && *nbr > 0) return; continue; } break; } /* * If the last word extends to the end of the field without any * trailing whitespace, the loop could not check yet whether it * can remain on this line. So do the check now. */ if (graph && (vis <= vtarget || *nbr == 0)) { *nbr = ic; *vbr = vis; } } /* * Print the contents of one field * with an indentation of vbl visual columns, * and an input string length of nbr characters. */ static void term_field(struct termp *p, size_t vbl, size_t nbr) { size_t ic; /* Character position in the input buffer. */ size_t vis; /* Visual position of the current character. */ size_t dv; /* Visual width of the current character. */ size_t vn; /* Visual position of the next character. */ vis = 0; for (ic = p->tcol->col; ic < nbr; ic++) { /* * To avoid the printing of trailing whitespace, * do not print whitespace right away, only count it. */ switch (p->tcol->buf[ic]) { case '\n': case ASCII_BREAK: continue; case '\t': vn = term_tab_next(vis); vbl += vn - vis; vis = vn; continue; case ' ': case ASCII_NBRSP: dv = (*p->width)(p, ' '); vbl += dv; vis += dv; continue; default: break; } /* * We found a non-blank character to print, * so write preceding white space now. */ if (vbl > 0) { (*p->advance)(p, vbl); p->viscol += vbl; vbl = 0; } /* Print the character and adjust the visual position. */ (*p->letter)(p, p->tcol->buf[ic]); if (p->tcol->buf[ic] == '\b') { dv = (*p->width)(p, p->tcol->buf[ic - 1]); p->viscol -= dv; vis -= dv; } else { dv = (*p->width)(p, p->tcol->buf[ic]); p->viscol += dv; vis += dv; } } p->tcol->col = nbr; } static void endline(struct termp *p) { if ((p->flags & (TERMP_NEWMC | TERMP_ENDMC)) == TERMP_ENDMC) { p->mc = NULL; p->flags &= ~TERMP_ENDMC; } if (p->mc != NULL) { if (p->viscol && p->maxrmargin >= p->viscol) (*p->advance)(p, p->maxrmargin - p->viscol + 1); p->flags |= TERMP_NOBUF | TERMP_NOSPACE; term_word(p, p->mc); p->flags &= ~(TERMP_NOBUF | TERMP_NEWMC); } p->viscol = 0; p->minbl = 0; (*p->endline)(p); } /* * A newline only breaks an existing line; it won't assert vertical * space. All data in the output buffer is flushed prior to the newline * assertion. */ void term_newln(struct termp *p) { p->flags |= TERMP_NOSPACE; if (p->tcol->lastcol || p->viscol) term_flushln(p); } /* * Asserts a vertical space (a full, empty line-break between lines). * Note that if used twice, this will cause two blank spaces and so on. * All data in the output buffer is flushed prior to the newline * assertion. */ void term_vspace(struct termp *p) { term_newln(p); p->viscol = 0; p->minbl = 0; if (0 < p->skipvsp) p->skipvsp--; else (*p->endline)(p); } /* Swap current and previous font; for \fP and .ft P */ void term_fontlast(struct termp *p) { enum termfont f; f = p->fontl; p->fontl = p->fontq[p->fonti]; p->fontq[p->fonti] = f; } /* Set font, save current, discard previous; for \f, .ft, .B etc. */ void term_fontrepl(struct termp *p, enum termfont f) { p->fontl = p->fontq[p->fonti]; p->fontq[p->fonti] = f; } /* Set font, save previous. */ void term_fontpush(struct termp *p, enum termfont f) { p->fontl = p->fontq[p->fonti]; if (++p->fonti == p->fontsz) { p->fontsz += 8; p->fontq = mandoc_reallocarray(p->fontq, p->fontsz, sizeof(*p->fontq)); } p->fontq[p->fonti] = f; } /* Flush to make the saved pointer current again. */ void term_fontpopq(struct termp *p, int i) { assert(i >= 0); if (p->fonti > i) p->fonti = i; } /* Pop one font off the stack. */ void term_fontpop(struct termp *p) { assert(p->fonti); p->fonti--; } /* * Handle pwords, partial words, which may be either a single word or a * phrase that cannot be broken down (such as a literal string). This * handles word styling. */ void term_word(struct termp *p, const char *word) { struct roffsu su; const char nbrsp[2] = { ASCII_NBRSP, 0 }; const char *seq, *cp; int sz, uc; size_t csz, lsz, ssz; enum mandoc_esc esc; if ((p->flags & TERMP_NOBUF) == 0) { if ((p->flags & TERMP_NOSPACE) == 0) { if ((p->flags & TERMP_KEEP) == 0) { bufferc(p, ' '); if (p->flags & TERMP_SENTENCE) bufferc(p, ' '); } else bufferc(p, ASCII_NBRSP); } if (p->flags & TERMP_PREKEEP) p->flags |= TERMP_KEEP; if (p->flags & TERMP_NONOSPACE) p->flags |= TERMP_NOSPACE; else p->flags &= ~TERMP_NOSPACE; p->flags &= ~(TERMP_SENTENCE | TERMP_NONEWLINE); p->skipvsp = 0; } while ('\0' != *word) { if ('\\' != *word) { if (TERMP_NBRWORD & p->flags) { if (' ' == *word) { encode(p, nbrsp, 1); word++; continue; } ssz = strcspn(word, "\\ "); } else ssz = strcspn(word, "\\"); encode(p, word, ssz); word += (int)ssz; continue; } word++; esc = mandoc_escape(&word, &seq, &sz); switch (esc) { case ESCAPE_UNICODE: uc = mchars_num2uc(seq + 1, sz - 1); break; case ESCAPE_NUMBERED: uc = mchars_num2char(seq, sz); if (uc < 0) continue; break; case ESCAPE_SPECIAL: if (p->enc == TERMENC_ASCII) { cp = mchars_spec2str(seq, sz, &ssz); if (cp != NULL) encode(p, cp, ssz); } else { uc = mchars_spec2cp(seq, sz); if (uc > 0) encode1(p, uc); } continue; case ESCAPE_UNDEF: uc = *seq; break; case ESCAPE_FONTBOLD: case ESCAPE_FONTCB: term_fontrepl(p, TERMFONT_BOLD); continue; case ESCAPE_FONTITALIC: case ESCAPE_FONTCI: term_fontrepl(p, TERMFONT_UNDER); continue; case ESCAPE_FONTBI: term_fontrepl(p, TERMFONT_BI); continue; case ESCAPE_FONT: case ESCAPE_FONTCR: case ESCAPE_FONTROMAN: term_fontrepl(p, TERMFONT_NONE); continue; case ESCAPE_FONTPREV: term_fontlast(p); continue; case ESCAPE_BREAK: bufferc(p, '\n'); continue; case ESCAPE_NOSPACE: if (p->flags & TERMP_BACKAFTER) p->flags &= ~TERMP_BACKAFTER; else if (*word == '\0') p->flags |= (TERMP_NOSPACE | TERMP_NONEWLINE); continue; case ESCAPE_DEVICE: if (p->type == TERMTYPE_PDF) encode(p, "pdf", 3); else if (p->type == TERMTYPE_PS) encode(p, "ps", 2); else if (p->enc == TERMENC_ASCII) encode(p, "ascii", 5); else encode(p, "utf8", 4); continue; case ESCAPE_HORIZ: if (*seq == '|') { seq++; uc = -p->col; } else uc = 0; if (a2roffsu(seq, &su, SCALE_EM) == NULL) continue; uc += term_hen(p, &su); if (uc > 0) while (uc-- > 0) bufferc(p, ASCII_NBRSP); else if (p->col > (size_t)(-uc)) p->col += uc; else { uc += p->col; p->col = 0; if (p->tcol->offset > (size_t)(-uc)) { p->ti += uc; p->tcol->offset += uc; } else { p->ti -= p->tcol->offset; p->tcol->offset = 0; } } continue; case ESCAPE_HLINE: if ((cp = a2roffsu(seq, &su, SCALE_EM)) == NULL) continue; uc = term_hen(p, &su); if (uc <= 0) { if (p->tcol->rmargin <= p->tcol->offset) continue; lsz = p->tcol->rmargin - p->tcol->offset; } else lsz = uc; if (*cp == seq[-1]) uc = -1; else if (*cp == '\\') { seq = cp + 1; esc = mandoc_escape(&seq, &cp, &sz); switch (esc) { case ESCAPE_UNICODE: uc = mchars_num2uc(cp + 1, sz - 1); break; case ESCAPE_NUMBERED: uc = mchars_num2char(cp, sz); break; case ESCAPE_SPECIAL: uc = mchars_spec2cp(cp, sz); break; case ESCAPE_UNDEF: uc = *seq; break; default: uc = -1; break; } } else uc = *cp; if (uc < 0x20 || (uc > 0x7E && uc < 0xA0)) uc = '_'; if (p->enc == TERMENC_ASCII) { cp = ascii_uc2str(uc); csz = term_strlen(p, cp); ssz = strlen(cp); } else csz = (*p->width)(p, uc); while (lsz >= csz) { if (p->enc == TERMENC_ASCII) encode(p, cp, ssz); else encode1(p, uc); lsz -= csz; } continue; case ESCAPE_SKIPCHAR: p->flags |= TERMP_BACKAFTER; continue; case ESCAPE_OVERSTRIKE: cp = seq + sz; while (seq < cp) { if (*seq == '\\') { mandoc_escape(&seq, NULL, NULL); continue; } encode1(p, *seq++); if (seq < cp) { if (p->flags & TERMP_BACKBEFORE) p->flags |= TERMP_BACKAFTER; else p->flags |= TERMP_BACKBEFORE; } } /* Trim trailing backspace/blank pair. */ if (p->tcol->lastcol > 2 && (p->tcol->buf[p->tcol->lastcol - 1] == ' ' || p->tcol->buf[p->tcol->lastcol - 1] == '\t')) p->tcol->lastcol -= 2; if (p->col > p->tcol->lastcol) p->col = p->tcol->lastcol; continue; default: continue; } /* * Common handling for Unicode and numbered * character escape sequences. */ if (p->enc == TERMENC_ASCII) { cp = ascii_uc2str(uc); encode(p, cp, strlen(cp)); } else { if ((uc < 0x20 && uc != 0x09) || (uc > 0x7E && uc < 0xA0)) uc = 0xFFFD; encode1(p, uc); } } p->flags &= ~TERMP_NBRWORD; } static void adjbuf(struct termp_col *c, size_t sz) { if (c->maxcols == 0) c->maxcols = 1024; while (c->maxcols <= sz) c->maxcols <<= 2; c->buf = mandoc_reallocarray(c->buf, c->maxcols, sizeof(*c->buf)); } static void bufferc(struct termp *p, char c) { if (p->flags & TERMP_NOBUF) { (*p->letter)(p, c); return; } if (p->col + 1 >= p->tcol->maxcols) adjbuf(p->tcol, p->col + 1); if (p->tcol->lastcol <= p->col || (c != ' ' && c != ASCII_NBRSP)) p->tcol->buf[p->col] = c; if (p->tcol->lastcol < ++p->col) p->tcol->lastcol = p->col; } /* * See encode(). * Do this for a single (probably unicode) value. * Does not check for non-decorated glyphs. */ static void encode1(struct termp *p, int c) { enum termfont f; if (p->flags & TERMP_NOBUF) { (*p->letter)(p, c); return; } if (p->col + 7 >= p->tcol->maxcols) adjbuf(p->tcol, p->col + 7); f = (c == ASCII_HYPH || c > 127 || isgraph(c)) ? p->fontq[p->fonti] : TERMFONT_NONE; if (p->flags & TERMP_BACKBEFORE) { if (p->tcol->buf[p->col - 1] == ' ' || p->tcol->buf[p->col - 1] == '\t') p->col--; else p->tcol->buf[p->col++] = '\b'; p->flags &= ~TERMP_BACKBEFORE; } if (f == TERMFONT_UNDER || f == TERMFONT_BI) { p->tcol->buf[p->col++] = '_'; p->tcol->buf[p->col++] = '\b'; } if (f == TERMFONT_BOLD || f == TERMFONT_BI) { if (c == ASCII_HYPH) p->tcol->buf[p->col++] = '-'; else p->tcol->buf[p->col++] = c; p->tcol->buf[p->col++] = '\b'; } if (p->tcol->lastcol <= p->col || (c != ' ' && c != ASCII_NBRSP)) p->tcol->buf[p->col] = c; if (p->tcol->lastcol < ++p->col) p->tcol->lastcol = p->col; if (p->flags & TERMP_BACKAFTER) { p->flags |= TERMP_BACKBEFORE; p->flags &= ~TERMP_BACKAFTER; } } static void encode(struct termp *p, const char *word, size_t sz) { size_t i; if (p->flags & TERMP_NOBUF) { for (i = 0; i < sz; i++) (*p->letter)(p, word[i]); return; } if (p->col + 2 + (sz * 5) >= p->tcol->maxcols) adjbuf(p->tcol, p->col + 2 + (sz * 5)); for (i = 0; i < sz; i++) { if (ASCII_HYPH == word[i] || isgraph((unsigned char)word[i])) encode1(p, word[i]); else { if (p->tcol->lastcol <= p->col || (word[i] != ' ' && word[i] != ASCII_NBRSP)) p->tcol->buf[p->col] = word[i]; p->col++; /* * Postpone the effect of \z while handling * an overstrike sequence from ascii_uc2str(). */ if (word[i] == '\b' && (p->flags & TERMP_BACKBEFORE)) { p->flags &= ~TERMP_BACKBEFORE; p->flags |= TERMP_BACKAFTER; } } } if (p->tcol->lastcol < p->col) p->tcol->lastcol = p->col; } void term_setwidth(struct termp *p, const char *wstr) { struct roffsu su; int iop, width; iop = 0; width = 0; if (NULL != wstr) { switch (*wstr) { case '+': iop = 1; wstr++; break; case '-': iop = -1; wstr++; break; default: break; } if (a2roffsu(wstr, &su, SCALE_MAX) != NULL) width = term_hspan(p, &su); else iop = 0; } (*p->setwidth)(p, iop, width); } size_t term_len(const struct termp *p, size_t sz) { return (*p->width)(p, ' ') * sz; } static size_t cond_width(const struct termp *p, int c, int *skip) { if (*skip) { (*skip) = 0; return 0; } else return (*p->width)(p, c); } size_t term_strlen(const struct termp *p, const char *cp) { size_t sz, rsz, i; int ssz, skip, uc; const char *seq, *rhs; enum mandoc_esc esc; static const char rej[] = { '\\', ASCII_NBRSP, ASCII_HYPH, ASCII_BREAK, '\0' }; /* * Account for escaped sequences within string length * calculations. This follows the logic in term_word() as we * must calculate the width of produced strings. */ sz = 0; skip = 0; while ('\0' != *cp) { rsz = strcspn(cp, rej); for (i = 0; i < rsz; i++) sz += cond_width(p, *cp++, &skip); switch (*cp) { case '\\': cp++; rhs = NULL; esc = mandoc_escape(&cp, &seq, &ssz); switch (esc) { case ESCAPE_UNICODE: uc = mchars_num2uc(seq + 1, ssz - 1); break; case ESCAPE_NUMBERED: uc = mchars_num2char(seq, ssz); if (uc < 0) continue; break; case ESCAPE_SPECIAL: if (p->enc == TERMENC_ASCII) { rhs = mchars_spec2str(seq, ssz, &rsz); if (rhs != NULL) break; } else { uc = mchars_spec2cp(seq, ssz); if (uc > 0) sz += cond_width(p, uc, &skip); } continue; case ESCAPE_UNDEF: uc = *seq; break; case ESCAPE_DEVICE: if (p->type == TERMTYPE_PDF) { rhs = "pdf"; rsz = 3; } else if (p->type == TERMTYPE_PS) { rhs = "ps"; rsz = 2; } else if (p->enc == TERMENC_ASCII) { rhs = "ascii"; rsz = 5; } else { rhs = "utf8"; rsz = 4; } break; case ESCAPE_SKIPCHAR: skip = 1; continue; case ESCAPE_OVERSTRIKE: rsz = 0; rhs = seq + ssz; while (seq < rhs) { if (*seq == '\\') { mandoc_escape(&seq, NULL, NULL); continue; } i = (*p->width)(p, *seq++); if (rsz < i) rsz = i; } sz += rsz; continue; default: continue; } /* * Common handling for Unicode and numbered * character escape sequences. */ if (rhs == NULL) { if (p->enc == TERMENC_ASCII) { rhs = ascii_uc2str(uc); rsz = strlen(rhs); } else { if ((uc < 0x20 && uc != 0x09) || (uc > 0x7E && uc < 0xA0)) uc = 0xFFFD; sz += cond_width(p, uc, &skip); continue; } } if (skip) { skip = 0; break; } /* * Common handling for all escape sequences * printing more than one character. */ for (i = 0; i < rsz; i++) sz += (*p->width)(p, *rhs++); break; case ASCII_NBRSP: sz += cond_width(p, ' ', &skip); cp++; break; case ASCII_HYPH: sz += cond_width(p, '-', &skip); cp++; break; default: break; } } return sz; } int term_vspan(const struct termp *p, const struct roffsu *su) { double r; int ri; switch (su->unit) { case SCALE_BU: r = su->scale / 40.0; break; case SCALE_CM: r = su->scale * 6.0 / 2.54; break; case SCALE_FS: r = su->scale * 65536.0 / 40.0; break; case SCALE_IN: r = su->scale * 6.0; break; case SCALE_MM: r = su->scale * 0.006; break; case SCALE_PC: r = su->scale; break; case SCALE_PT: r = su->scale / 12.0; break; case SCALE_EN: case SCALE_EM: r = su->scale * 0.6; break; case SCALE_VS: r = su->scale; break; default: abort(); } ri = r > 0.0 ? r + 0.4995 : r - 0.4995; return ri < 66 ? ri : 1; } /* * Convert a scaling width to basic units, rounding towards 0. */ int term_hspan(const struct termp *p, const struct roffsu *su) { return (*p->hspan)(p, su); } /* * Convert a scaling width to basic units, rounding to closest. */ int term_hen(const struct termp *p, const struct roffsu *su) { int bu; if ((bu = (*p->hspan)(p, su)) >= 0) return (bu + 11) / 24; else return -((-bu + 11) / 24); } mandoc-1.14.6/term_ascii.c010064400017530001753000000246451412314055300156450ustar00schwarzeschwarze/* $Id: term_ascii.c,v 1.66 2020/09/09 13:45:05 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014,2015,2017,2018,2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #if HAVE_WCHAR #include #include #endif #include #include #include #include #include #if HAVE_WCHAR #include #endif #include "mandoc.h" #include "mandoc_aux.h" #include "out.h" #include "term.h" #include "manconf.h" #include "main.h" static struct termp *ascii_init(enum termenc, const struct manoutput *); static int ascii_hspan(const struct termp *, const struct roffsu *); static size_t ascii_width(const struct termp *, int); static void ascii_advance(struct termp *, size_t); static void ascii_begin(struct termp *); static void ascii_end(struct termp *); static void ascii_endline(struct termp *); static void ascii_letter(struct termp *, int); static void ascii_setwidth(struct termp *, int, int); #if HAVE_WCHAR static void locale_advance(struct termp *, size_t); static void locale_endline(struct termp *); static void locale_letter(struct termp *, int); static size_t locale_width(const struct termp *, int); #endif static struct termp * ascii_init(enum termenc enc, const struct manoutput *outopts) { #if HAVE_WCHAR char *v; #endif struct termp *p; p = mandoc_calloc(1, sizeof(*p)); p->tcol = p->tcols = mandoc_calloc(1, sizeof(*p->tcol)); p->maxtcol = 1; p->line = 1; p->defrmargin = p->lastrmargin = 78; p->fontq = mandoc_reallocarray(NULL, (p->fontsz = 8), sizeof(*p->fontq)); p->fontq[0] = p->fontl = TERMFONT_NONE; p->begin = ascii_begin; p->end = ascii_end; p->hspan = ascii_hspan; p->type = TERMTYPE_CHAR; p->enc = TERMENC_ASCII; p->advance = ascii_advance; p->endline = ascii_endline; p->letter = ascii_letter; p->setwidth = ascii_setwidth; p->width = ascii_width; #if HAVE_WCHAR if (enc != TERMENC_ASCII) { /* * Do not change any of this to LC_ALL. It might break * the formatting by subtly changing the behaviour of * various functions, for example strftime(3). As a * worst case, it might even cause buffer overflows. */ v = enc == TERMENC_LOCALE ? setlocale(LC_CTYPE, "") : setlocale(LC_CTYPE, UTF8_LOCALE); /* * We only support UTF-8, * so revert to ASCII for anything else. */ if (v != NULL && strcmp(nl_langinfo(CODESET), "UTF-8") != 0) v = setlocale(LC_CTYPE, "C"); if (v != NULL && MB_CUR_MAX > 1) { p->enc = TERMENC_UTF8; p->advance = locale_advance; p->endline = locale_endline; p->letter = locale_letter; p->width = locale_width; } } #endif if (outopts->mdoc) { p->mdocstyle = 1; p->defindent = 5; } if (outopts->indent) p->defindent = outopts->indent; if (outopts->width) p->defrmargin = outopts->width; if (outopts->synopsisonly) p->synopsisonly = 1; assert(p->defindent < UINT16_MAX); assert(p->defrmargin < UINT16_MAX); return p; } void * ascii_alloc(const struct manoutput *outopts) { return ascii_init(TERMENC_ASCII, outopts); } void * utf8_alloc(const struct manoutput *outopts) { return ascii_init(TERMENC_UTF8, outopts); } void * locale_alloc(const struct manoutput *outopts) { return ascii_init(TERMENC_LOCALE, outopts); } static void ascii_setwidth(struct termp *p, int iop, int width) { width /= 24; p->tcol->rmargin = p->defrmargin; if (iop > 0) p->defrmargin += width; else if (iop == 0) p->defrmargin = width ? (size_t)width : p->lastrmargin; else if (p->defrmargin > (size_t)width) p->defrmargin -= width; else p->defrmargin = 0; if (p->defrmargin > 1000) p->defrmargin = 1000; p->lastrmargin = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin = p->defrmargin; } void terminal_sepline(void *arg) { struct termp *p; size_t i; p = (struct termp *)arg; (*p->endline)(p); for (i = 0; i < p->defrmargin; i++) (*p->letter)(p, '-'); (*p->endline)(p); (*p->endline)(p); } static size_t ascii_width(const struct termp *p, int c) { return c != ASCII_BREAK; } void ascii_free(void *arg) { term_free((struct termp *)arg); } static void ascii_letter(struct termp *p, int c) { putchar(c); } static void ascii_begin(struct termp *p) { (*p->headf)(p, p->argf); } static void ascii_end(struct termp *p) { (*p->footf)(p, p->argf); } static void ascii_endline(struct termp *p) { p->line++; if ((int)p->tcol->offset > p->ti) p->tcol->offset -= p->ti; else p->tcol->offset = 0; p->ti = 0; putchar('\n'); } static void ascii_advance(struct termp *p, size_t len) { size_t i; /* * XXX We used to have "assert(len < UINT16_MAX)" here. * that is not quite right because the input document * can trigger that by merely providing large input. * For now, simply truncate. */ if (len > 256) len = 256; for (i = 0; i < len; i++) putchar(' '); } static int ascii_hspan(const struct termp *p, const struct roffsu *su) { double r; switch (su->unit) { case SCALE_BU: r = su->scale; break; case SCALE_CM: r = su->scale * 240.0 / 2.54; break; case SCALE_FS: r = su->scale * 65536.0; break; case SCALE_IN: r = su->scale * 240.0; break; case SCALE_MM: r = su->scale * 0.24; break; case SCALE_VS: case SCALE_PC: r = su->scale * 40.0; break; case SCALE_PT: r = su->scale * 10.0 / 3.0; break; case SCALE_EN: case SCALE_EM: r = su->scale * 24.0; break; default: abort(); } return r > 0.0 ? r + 0.01 : r - 0.01; } const char * ascii_uc2str(int uc) { static const char nbrsp[2] = { ASCII_NBRSP, '\0' }; static const char *tab[] = { "","","","","","","","", "", "\t", "", "", "", "", "", "", "","","","","","","","", "","", "","","", "", "", "", " ", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~", "", "<80>", "<81>", "<82>", "<83>", "<84>", "<85>", "<86>", "<87>", "<88>", "<89>", "<8A>", "<8B>", "<8C>", "<8D>", "<8E>", "<8F>", "<90>", "<91>", "<92>", "<93>", "<94>", "<95>", "<96>", "<97>", "<98>", "<99>", "<9A>", "<9B>", "<9C>", "<9D>", "<9E>", "<9F>", nbrsp, "!", "/\bc", "-\bL", "o\bx", "=\bY", "|", "

    ", "\"", "(C)", "_\ba", "<<", "~", "", "(R)", "-", "","+-","^2", "^3", "'","","",".", ",", "^1", "_\bo", ">>", "1/4", "1/2", "3/4", "?", "`\bA", "'\bA", "^\bA", "~\bA", "\"\bA","o\bA", "AE", ",\bC", "`\bE", "'\bE", "^\bE", "\"\bE","`\bI", "'\bI", "^\bI", "\"\bI", "Dh", "~\bN", "`\bO", "'\bO", "^\bO", "~\bO", "\"\bO","x", "/\bO", "`\bU", "'\bU", "^\bU", "\"\bU","'\bY", "Th", "ss", "`\ba", "'\ba", "^\ba", "~\ba", "\"\ba","o\ba", "ae", ",\bc", "`\be", "'\be", "^\be", "\"\be","`\bi", "'\bi", "^\bi", "\"\bi", "dh", "~\bn", "`\bo", "'\bo", "^\bo", "~\bo", "\"\bo","/", "/\bo", "`\bu", "'\bu", "^\bu", "\"\bu","'\by", "th", "\"\by", "A", "a", "A", "a", "A", "a", "'\bC", "'\bc", "^\bC", "^\bc", "C", "c", "C", "c", "D", "d", "/\bD", "/\bd", "E", "e", "E", "e", "E", "e", "E", "e", "E", "e", "^\bG", "^\bg", "G", "g", "G", "g", ",\bG", ",\bg", "^\bH", "^\bh", "/\bH", "/\bh", "~\bI", "~\bi", "I", "i", "I", "i", "I", "i", "I", "i", "IJ", "ij", "^\bJ", "^\bj", ",\bK", ",\bk", "q", "'\bL", "'\bl", ",\bL", ",\bl", "L", "l", "L", "l", "/\bL", "/\bl", "'\bN", "'\bn", ",\bN", ",\bn", "N", "n", "'n", "Ng", "ng", "O", "o", "O", "o", "O", "o", "OE", "oe", "'\bR", "'\br", ",\bR", ",\br", "R", "r", "'\bS", "'\bs", "^\bS", "^\bs", ",\bS", ",\bs", "S", "s", ",\bT", ",\bt", "T", "t", "/\bT", "/\bt", "~\bU", "~\bu", "U", "u", "U", "u", "U", "u", "U", "u", "U", "u", "^\bW", "^\bw", "^\bY", "^\by", "\"\bY","'\bZ", "'\bz", "Z", "z", "Z", "z", "s", "b", "B", "B", "b", "6", "6", "O", "C", "c", "D", "D", "D", "d", "d", "3", "@", "E", "F", ",\bf", "G", "G", "hv", "I", "/\bI", "K", "k", "/\bl", "l", "W", "N", "n", "~\bO", "O", "o", "OI", "oi", "P", "p", "YR", "2", "2", "SH", "sh", "t", "T", "t", "T", "U", "u", "Y", "V", "Y", "y", "/\bZ", "/\bz", "ZH", "ZH", "zh", "zh", "/\b2", "5", "5", "ts", "w", "|", "||", "|=", "!", "DZ", "Dz", "dz", "LJ", "Lj", "lj", "NJ", "Nj", "nj", "A", "a", "I", "i", "O", "o", "U", "u", "U", "u", "U", "u", "U", "u", "U", "u", "@", "A", "a", "A", "a", "AE", "ae", "/\bG", "/\bg", "G", "g", "K", "k", "O", "o", "O", "o", "ZH", "zh", "j", "DZ", "Dz", "dz", "'\bG", "'\bg", "HV", "W", "`\bN", "`\bn", "A", "a", "'\bAE","'\bae","O", "o"}; assert(uc >= 0); if ((size_t)uc < sizeof(tab)/sizeof(tab[0])) return tab[uc]; return mchars_uc2str(uc); } #if HAVE_WCHAR static size_t locale_width(const struct termp *p, int c) { int rc; if (c == ASCII_NBRSP) c = ' '; rc = wcwidth(c); if (rc < 0) rc = 0; return rc; } static void locale_advance(struct termp *p, size_t len) { size_t i; /* * XXX We used to have "assert(len < UINT16_MAX)" here. * that is not quite right because the input document * can trigger that by merely providing large input. * For now, simply truncate. */ if (len > 256) len = 256; for (i = 0; i < len; i++) putwchar(L' '); } static void locale_endline(struct termp *p) { p->line++; if ((int)p->tcol->offset > p->ti) p->tcol->offset -= p->ti; else p->tcol->offset = 0; p->ti = 0; putwchar(L'\n'); } static void locale_letter(struct termp *p, int c) { putwchar(c); } #endif mandoc-1.14.6/term_ps.c010064400017530001753000000667521412314055300152040ustar00schwarzeschwarze/* $Id: term_ps.c,v 1.92 2020/09/06 14:45:22 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014,2015,2016,2017,2020 Ingo Schwarze * Copyright (c) 2017 Marc Espie * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #if HAVE_ERR #include #endif #include #include #include #include #include #include #include "mandoc_aux.h" #include "out.h" #include "term.h" #include "manconf.h" #include "main.h" /* These work the buffer used by the header and footer. */ #define PS_BUFSLOP 128 /* Convert PostScript point "x" to an AFM unit. */ #define PNT2AFM(p, x) \ (size_t)((double)(x) * (1000.0 / (double)(p)->ps->scale)) /* Convert an AFM unit "x" to a PostScript points */ #define AFM2PNT(p, x) \ ((double)(x) / (1000.0 / (double)(p)->ps->scale)) struct glyph { unsigned short wx; /* WX in AFM */ }; struct font { const char *name; /* FontName in AFM */ #define MAXCHAR 95 /* total characters we can handle */ struct glyph gly[MAXCHAR]; /* glyph metrics */ }; struct termp_ps { int flags; #define PS_INLINE (1 << 0) /* we're in a word */ #define PS_MARGINS (1 << 1) /* we're in the margins */ #define PS_NEWPAGE (1 << 2) /* new page, no words yet */ #define PS_BACKSP (1 << 3) /* last character was backspace */ size_t pscol; /* visible column (AFM units) */ size_t pscolnext; /* used for overstrike */ size_t psrow; /* visible row (AFM units) */ size_t lastrow; /* psrow of the previous word */ char *psmarg; /* margin buf */ size_t psmargsz; /* margin buf size */ size_t psmargcur; /* cur index in margin buf */ char last; /* last non-backspace seen */ enum termfont lastf; /* last set font */ enum termfont nextf; /* building next font here */ size_t scale; /* font scaling factor */ size_t pages; /* number of pages shown */ size_t lineheight; /* line height (AFM units) */ size_t top; /* body top (AFM units) */ size_t bottom; /* body bottom (AFM units) */ const char *medianame; /* for DocumentMedia and PageSize */ size_t height; /* page height (AFM units */ size_t width; /* page width (AFM units) */ size_t lastwidth; /* page width before last ll */ size_t left; /* body left (AFM units) */ size_t header; /* header pos (AFM units) */ size_t footer; /* footer pos (AFM units) */ size_t pdfbytes; /* current output byte */ size_t pdflastpg; /* byte of last page mark */ size_t pdfbody; /* start of body object */ size_t *pdfobjs; /* table of object offsets */ size_t pdfobjsz; /* size of pdfobjs */ }; static int ps_hspan(const struct termp *, const struct roffsu *); static size_t ps_width(const struct termp *, int); static void ps_advance(struct termp *, size_t); static void ps_begin(struct termp *); static void ps_closepage(struct termp *); static void ps_end(struct termp *); static void ps_endline(struct termp *); static void ps_growbuf(struct termp *, size_t); static void ps_letter(struct termp *, int); static void ps_pclose(struct termp *); static void ps_plast(struct termp *); static void ps_pletter(struct termp *, int); static void ps_printf(struct termp *, const char *, ...) __attribute__((__format__ (__printf__, 2, 3))); static void ps_putchar(struct termp *, char); static void ps_setfont(struct termp *, enum termfont); static void ps_setwidth(struct termp *, int, int); static struct termp *pspdf_alloc(const struct manoutput *, enum termtype); static void pdf_obj(struct termp *, size_t); /* * We define, for the time being, three fonts: bold, oblique/italic, and * normal (roman). The following table hard-codes the font metrics for * ASCII, i.e., 32--127. */ static const struct font fonts[TERMFONT__MAX] = { { "Times-Roman", { { 250 }, { 333 }, { 408 }, { 500 }, { 500 }, { 833 }, { 778 }, { 333 }, { 333 }, { 333 }, { 500 }, { 564 }, { 250 }, { 333 }, { 250 }, { 278 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 278 }, { 278 }, { 564 }, { 564 }, { 564 }, { 444 }, { 921 }, { 722 }, { 667 }, { 667 }, { 722 }, { 611 }, { 556 }, { 722 }, { 722 }, { 333 }, { 389 }, { 722 }, { 611 }, { 889 }, { 722 }, { 722 }, { 556 }, { 722 }, { 667 }, { 556 }, { 611 }, { 722 }, { 722 }, { 944 }, { 722 }, { 722 }, { 611 }, { 333 }, { 278 }, { 333 }, { 469 }, { 500 }, { 333 }, { 444 }, { 500 }, { 444 }, { 500}, { 444}, { 333}, { 500}, { 500}, { 278}, { 278}, { 500}, { 278}, { 778}, { 500}, { 500}, { 500}, { 500}, { 333}, { 389}, { 278}, { 500}, { 500}, { 722}, { 500}, { 500}, { 444}, { 480}, { 200}, { 480}, { 541}, } }, { "Times-Bold", { { 250 }, { 333 }, { 555 }, { 500 }, { 500 }, { 1000 }, { 833 }, { 333 }, { 333 }, { 333 }, { 500 }, { 570 }, { 250 }, { 333 }, { 250 }, { 278 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 333 }, { 333 }, { 570 }, { 570 }, { 570 }, { 500 }, { 930 }, { 722 }, { 667 }, { 722 }, { 722 }, { 667 }, { 611 }, { 778 }, { 778 }, { 389 }, { 500 }, { 778 }, { 667 }, { 944 }, { 722 }, { 778 }, { 611 }, { 778 }, { 722 }, { 556 }, { 667 }, { 722 }, { 722 }, { 1000 }, { 722 }, { 722 }, { 667 }, { 333 }, { 278 }, { 333 }, { 581 }, { 500 }, { 333 }, { 500 }, { 556 }, { 444 }, { 556 }, { 444 }, { 333 }, { 500 }, { 556 }, { 278 }, { 333 }, { 556 }, { 278 }, { 833 }, { 556 }, { 500 }, { 556 }, { 556 }, { 444 }, { 389 }, { 333 }, { 556 }, { 500 }, { 722 }, { 500 }, { 500 }, { 444 }, { 394 }, { 220 }, { 394 }, { 520 }, } }, { "Times-Italic", { { 250 }, { 333 }, { 420 }, { 500 }, { 500 }, { 833 }, { 778 }, { 333 }, { 333 }, { 333 }, { 500 }, { 675 }, { 250 }, { 333 }, { 250 }, { 278 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 333 }, { 333 }, { 675 }, { 675 }, { 675 }, { 500 }, { 920 }, { 611 }, { 611 }, { 667 }, { 722 }, { 611 }, { 611 }, { 722 }, { 722 }, { 333 }, { 444 }, { 667 }, { 556 }, { 833 }, { 667 }, { 722 }, { 611 }, { 722 }, { 611 }, { 500 }, { 556 }, { 722 }, { 611 }, { 833 }, { 611 }, { 556 }, { 556 }, { 389 }, { 278 }, { 389 }, { 422 }, { 500 }, { 333 }, { 500 }, { 500 }, { 444 }, { 500 }, { 444 }, { 278 }, { 500 }, { 500 }, { 278 }, { 278 }, { 444 }, { 278 }, { 722 }, { 500 }, { 500 }, { 500 }, { 500 }, { 389 }, { 389 }, { 278 }, { 500 }, { 444 }, { 667 }, { 444 }, { 444 }, { 389 }, { 400 }, { 275 }, { 400 }, { 541 }, } }, { "Times-BoldItalic", { { 250 }, { 389 }, { 555 }, { 500 }, { 500 }, { 833 }, { 778 }, { 333 }, { 333 }, { 333 }, { 500 }, { 570 }, { 250 }, { 333 }, { 250 }, { 278 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 500 }, { 333 }, { 333 }, { 570 }, { 570 }, { 570 }, { 500 }, { 832 }, { 667 }, { 667 }, { 667 }, { 722 }, { 667 }, { 667 }, { 722 }, { 778 }, { 389 }, { 500 }, { 667 }, { 611 }, { 889 }, { 722 }, { 722 }, { 611 }, { 722 }, { 667 }, { 556 }, { 611 }, { 722 }, { 667 }, { 889 }, { 667 }, { 611 }, { 611 }, { 333 }, { 278 }, { 333 }, { 570 }, { 500 }, { 333 }, { 500 }, { 500 }, { 444 }, { 500 }, { 444 }, { 333 }, { 500 }, { 556 }, { 278 }, { 278 }, { 500 }, { 278 }, { 778 }, { 556 }, { 500 }, { 500 }, { 500 }, { 389 }, { 389 }, { 278 }, { 556 }, { 444 }, { 667 }, { 500 }, { 444 }, { 389 }, { 348 }, { 220 }, { 348 }, { 570 }, } }, }; void * pdf_alloc(const struct manoutput *outopts) { return pspdf_alloc(outopts, TERMTYPE_PDF); } void * ps_alloc(const struct manoutput *outopts) { return pspdf_alloc(outopts, TERMTYPE_PS); } static struct termp * pspdf_alloc(const struct manoutput *outopts, enum termtype type) { struct termp *p; unsigned int pagex, pagey; size_t marginx, marginy, lineheight; const char *pp; p = mandoc_calloc(1, sizeof(*p)); p->tcol = p->tcols = mandoc_calloc(1, sizeof(*p->tcol)); p->maxtcol = 1; p->type = type; p->enc = TERMENC_ASCII; p->fontq = mandoc_reallocarray(NULL, (p->fontsz = 8), sizeof(*p->fontq)); p->fontq[0] = p->fontl = TERMFONT_NONE; p->ps = mandoc_calloc(1, sizeof(*p->ps)); p->advance = ps_advance; p->begin = ps_begin; p->end = ps_end; p->endline = ps_endline; p->hspan = ps_hspan; p->letter = ps_letter; p->setwidth = ps_setwidth; p->width = ps_width; /* Default to US letter (millimetres). */ p->ps->medianame = "Letter"; pagex = 216; pagey = 279; /* * The ISO-269 paper sizes can be calculated automatically, but * it would require bringing in -lm for pow() and I'd rather not * do that. So just do it the easy way for now. Since this * only happens once, I'm not terribly concerned. */ pp = outopts->paper; if (pp != NULL && strcasecmp(pp, "letter") != 0) { if (strcasecmp(pp, "a3") == 0) { p->ps->medianame = "A3"; pagex = 297; pagey = 420; } else if (strcasecmp(pp, "a4") == 0) { p->ps->medianame = "A4"; pagex = 210; pagey = 297; } else if (strcasecmp(pp, "a5") == 0) { p->ps->medianame = "A5"; pagex = 148; pagey = 210; } else if (strcasecmp(pp, "legal") == 0) { p->ps->medianame = "Legal"; pagex = 216; pagey = 356; } else if (sscanf(pp, "%ux%u", &pagex, &pagey) == 2) p->ps->medianame = "CustomSize"; else warnx("%s: Unknown paper", pp); } /* * This MUST be defined before any PNT2AFM or AFM2PNT * calculations occur. */ p->ps->scale = 11; /* Remember millimetres -> AFM units. */ pagex = PNT2AFM(p, ((double)pagex * 72.0 / 25.4)); pagey = PNT2AFM(p, ((double)pagey * 72.0 / 25.4)); /* Margins are 1/9 the page x and y. */ marginx = (size_t)((double)pagex / 9.0); marginy = (size_t)((double)pagey / 9.0); /* Line-height is 1.4em. */ lineheight = PNT2AFM(p, ((double)p->ps->scale * 1.4)); p->ps->width = p->ps->lastwidth = (size_t)pagex; p->ps->height = (size_t)pagey; p->ps->header = pagey - (marginy / 2) - (lineheight / 2); p->ps->top = pagey - marginy; p->ps->footer = (marginy / 2) - (lineheight / 2); p->ps->bottom = marginy; p->ps->left = marginx; p->ps->lineheight = lineheight; p->defrmargin = pagex - (marginx * 2); return p; } static void ps_setwidth(struct termp *p, int iop, int width) { size_t lastwidth; lastwidth = p->ps->width; if (iop > 0) p->ps->width += width; else if (iop == 0) p->ps->width = width ? (size_t)width : p->ps->lastwidth; else if (p->ps->width > (size_t)width) p->ps->width -= width; else p->ps->width = 0; p->ps->lastwidth = lastwidth; } void pspdf_free(void *arg) { struct termp *p; p = (struct termp *)arg; free(p->ps->psmarg); free(p->ps->pdfobjs); free(p->ps); term_free(p); } static void ps_printf(struct termp *p, const char *fmt, ...) { va_list ap; int pos, len; va_start(ap, fmt); /* * If we're running in regular mode, then pipe directly into * vprintf(). If we're processing margins, then push the data * into our growable margin buffer. */ if ( ! (PS_MARGINS & p->ps->flags)) { len = vprintf(fmt, ap); va_end(ap); p->ps->pdfbytes += len < 0 ? 0 : (size_t)len; return; } /* * XXX: I assume that the in-margin print won't exceed * PS_BUFSLOP (128 bytes), which is reasonable but still an * assumption that will cause pukeage if it's not the case. */ ps_growbuf(p, PS_BUFSLOP); pos = (int)p->ps->psmargcur; vsnprintf(&p->ps->psmarg[pos], PS_BUFSLOP, fmt, ap); va_end(ap); p->ps->psmargcur = strlen(p->ps->psmarg); } static void ps_putchar(struct termp *p, char c) { int pos; /* See ps_printf(). */ if ( ! (PS_MARGINS & p->ps->flags)) { putchar(c); p->ps->pdfbytes++; return; } ps_growbuf(p, 2); pos = (int)p->ps->psmargcur++; p->ps->psmarg[pos++] = c; p->ps->psmarg[pos] = '\0'; } static void pdf_obj(struct termp *p, size_t obj) { assert(obj > 0); if ((obj - 1) >= p->ps->pdfobjsz) { p->ps->pdfobjsz = obj + 128; p->ps->pdfobjs = mandoc_reallocarray(p->ps->pdfobjs, p->ps->pdfobjsz, sizeof(size_t)); } p->ps->pdfobjs[(int)obj - 1] = p->ps->pdfbytes; ps_printf(p, "%zu 0 obj\n", obj); } static void ps_closepage(struct termp *p) { int i; size_t len, base; /* * Close out a page that we've already flushed to output. In * PostScript, we simply note that the page must be shown. In * PDF, we must now create the Length, Resource, and Page node * for the page contents. */ assert(p->ps->psmarg && p->ps->psmarg[0]); ps_printf(p, "%s", p->ps->psmarg); if (TERMTYPE_PS != p->type) { len = p->ps->pdfbytes - p->ps->pdflastpg; base = p->ps->pages * 4 + p->ps->pdfbody; ps_printf(p, "endstream\nendobj\n"); /* Length of content. */ pdf_obj(p, base + 1); ps_printf(p, "%zu\nendobj\n", len); /* Resource for content. */ pdf_obj(p, base + 2); ps_printf(p, "<<\n/ProcSet [/PDF /Text]\n"); ps_printf(p, "/Font <<\n"); for (i = 0; i < (int)TERMFONT__MAX; i++) ps_printf(p, "/F%d %d 0 R\n", i, 3 + i); ps_printf(p, ">>\n>>\nendobj\n"); /* Page node. */ pdf_obj(p, base + 3); ps_printf(p, "<<\n"); ps_printf(p, "/Type /Page\n"); ps_printf(p, "/Parent 2 0 R\n"); ps_printf(p, "/Resources %zu 0 R\n", base + 2); ps_printf(p, "/Contents %zu 0 R\n", base); ps_printf(p, ">>\nendobj\n"); } else ps_printf(p, "showpage\n"); p->ps->pages++; p->ps->psrow = p->ps->top; assert( ! (PS_NEWPAGE & p->ps->flags)); p->ps->flags |= PS_NEWPAGE; } static void ps_end(struct termp *p) { size_t i, xref, base; ps_plast(p); ps_pclose(p); /* * At the end of the file, do one last showpage. This is the * same behaviour as groff(1) and works for multiple pages as * well as just one. */ if ( ! (PS_NEWPAGE & p->ps->flags)) { assert(0 == p->ps->flags); assert('\0' == p->ps->last); ps_closepage(p); } if (TERMTYPE_PS == p->type) { ps_printf(p, "%%%%Trailer\n"); ps_printf(p, "%%%%Pages: %zu\n", p->ps->pages); ps_printf(p, "%%%%EOF\n"); return; } pdf_obj(p, 2); ps_printf(p, "<<\n/Type /Pages\n"); ps_printf(p, "/MediaBox [0 0 %zu %zu]\n", (size_t)AFM2PNT(p, p->ps->width), (size_t)AFM2PNT(p, p->ps->height)); ps_printf(p, "/Count %zu\n", p->ps->pages); ps_printf(p, "/Kids ["); for (i = 0; i < p->ps->pages; i++) ps_printf(p, " %zu 0 R", i * 4 + p->ps->pdfbody + 3); base = (p->ps->pages - 1) * 4 + p->ps->pdfbody + 4; ps_printf(p, "]\n>>\nendobj\n"); pdf_obj(p, base); ps_printf(p, "<<\n"); ps_printf(p, "/Type /Catalog\n"); ps_printf(p, "/Pages 2 0 R\n"); ps_printf(p, ">>\nendobj\n"); xref = p->ps->pdfbytes; ps_printf(p, "xref\n"); ps_printf(p, "0 %zu\n", base + 1); ps_printf(p, "0000000000 65535 f \n"); for (i = 0; i < base; i++) ps_printf(p, "%.10zu 00000 n \n", p->ps->pdfobjs[(int)i]); ps_printf(p, "trailer\n"); ps_printf(p, "<<\n"); ps_printf(p, "/Size %zu\n", base + 1); ps_printf(p, "/Root %zu 0 R\n", base); ps_printf(p, "/Info 1 0 R\n"); ps_printf(p, ">>\n"); ps_printf(p, "startxref\n"); ps_printf(p, "%zu\n", xref); ps_printf(p, "%%%%EOF\n"); } static void ps_begin(struct termp *p) { size_t width, height; int i; /* * Print margins into margin buffer. Nothing gets output to the * screen yet, so we don't need to initialise the primary state. */ if (p->ps->psmarg) { assert(p->ps->psmargsz); p->ps->psmarg[0] = '\0'; } /*p->ps->pdfbytes = 0;*/ p->ps->psmargcur = 0; p->ps->flags = PS_MARGINS; p->ps->pscol = p->ps->left; p->ps->psrow = p->ps->header; p->ps->lastrow = 0; /* impossible row */ ps_setfont(p, TERMFONT_NONE); (*p->headf)(p, p->argf); (*p->endline)(p); p->ps->pscol = p->ps->left; p->ps->psrow = p->ps->footer; (*p->footf)(p, p->argf); (*p->endline)(p); p->ps->flags &= ~PS_MARGINS; assert(0 == p->ps->flags); assert(p->ps->psmarg); assert('\0' != p->ps->psmarg[0]); /* * Print header and initialise page state. Following this, * stuff gets printed to the screen, so make sure we're sane. */ if (TERMTYPE_PS == p->type) { width = AFM2PNT(p, p->ps->width); height = AFM2PNT(p, p->ps->height); ps_printf(p, "%%!PS-Adobe-3.0\n"); ps_printf(p, "%%%%DocumentData: Clean7Bit\n"); ps_printf(p, "%%%%Orientation: Portrait\n"); ps_printf(p, "%%%%Pages: (atend)\n"); ps_printf(p, "%%%%PageOrder: Ascend\n"); ps_printf(p, "%%%%DocumentMedia: man-%s %zu %zu 0 () ()\n", p->ps->medianame, width, height); ps_printf(p, "%%%%DocumentNeededResources: font"); for (i = 0; i < (int)TERMFONT__MAX; i++) ps_printf(p, " %s", fonts[i].name); ps_printf(p, "\n%%%%DocumentSuppliedResources: " "procset MandocProcs 1.0 0\n"); ps_printf(p, "%%%%EndComments\n"); ps_printf(p, "%%%%BeginProlog\n"); ps_printf(p, "%%%%BeginResource: procset MandocProcs " "10170 10170\n"); /* The font size is effectively hard-coded for now. */ ps_printf(p, "/fs %zu def\n", p->ps->scale); for (i = 0; i < (int)TERMFONT__MAX; i++) ps_printf(p, "/f%d { /%s fs selectfont } def\n", i, fonts[i].name); ps_printf(p, "/s { 3 1 roll moveto show } bind def\n"); ps_printf(p, "/c { exch currentpoint exch pop " "moveto show } bind def\n"); ps_printf(p, "%%%%EndResource\n"); ps_printf(p, "%%%%EndProlog\n"); ps_printf(p, "%%%%BeginSetup\n"); ps_printf(p, "%%%%BeginFeature: *PageSize %s\n", p->ps->medianame); ps_printf(p, "<>setpagedevice\n", width, height); ps_printf(p, "%%%%EndFeature\n"); ps_printf(p, "%%%%EndSetup\n"); } else { ps_printf(p, "%%PDF-1.1\n"); pdf_obj(p, 1); ps_printf(p, "<<\n"); ps_printf(p, ">>\n"); ps_printf(p, "endobj\n"); for (i = 0; i < (int)TERMFONT__MAX; i++) { pdf_obj(p, (size_t)i + 3); ps_printf(p, "<<\n"); ps_printf(p, "/Type /Font\n"); ps_printf(p, "/Subtype /Type1\n"); ps_printf(p, "/Name /F%d\n", i); ps_printf(p, "/BaseFont /%s\n", fonts[i].name); ps_printf(p, ">>\nendobj\n"); } } p->ps->pdfbody = (size_t)TERMFONT__MAX + 3; p->ps->pscol = p->ps->left; p->ps->psrow = p->ps->top; p->ps->flags |= PS_NEWPAGE; ps_setfont(p, TERMFONT_NONE); } static void ps_pletter(struct termp *p, int c) { int f; /* * If we haven't opened a page context, then output that we're * in a new page and make sure the font is correctly set. */ if (PS_NEWPAGE & p->ps->flags) { if (TERMTYPE_PS == p->type) { ps_printf(p, "%%%%Page: %zu %zu\n", p->ps->pages + 1, p->ps->pages + 1); ps_printf(p, "f%d\n", (int)p->ps->lastf); } else { pdf_obj(p, p->ps->pdfbody + p->ps->pages * 4); ps_printf(p, "<<\n"); ps_printf(p, "/Length %zu 0 R\n", p->ps->pdfbody + 1 + p->ps->pages * 4); ps_printf(p, ">>\nstream\n"); } p->ps->pdflastpg = p->ps->pdfbytes; p->ps->flags &= ~PS_NEWPAGE; } /* * If we're not in a PostScript "word" context, then open one * now at the current cursor. */ if ( ! (PS_INLINE & p->ps->flags)) { if (TERMTYPE_PS != p->type) { ps_printf(p, "BT\n/F%d %zu Tf\n", (int)p->ps->lastf, p->ps->scale); ps_printf(p, "%.3f %.3f Td\n(", AFM2PNT(p, p->ps->pscol), AFM2PNT(p, p->ps->psrow)); } else { ps_printf(p, "%.3f", AFM2PNT(p, p->ps->pscol)); if (p->ps->psrow != p->ps->lastrow) ps_printf(p, " %.3f", AFM2PNT(p, p->ps->psrow)); ps_printf(p, "("); } p->ps->flags |= PS_INLINE; } assert( ! (PS_NEWPAGE & p->ps->flags)); /* * We need to escape these characters as per the PostScript * specification. We would also escape non-graphable characters * (like tabs), but none of them would get to this point and * it's superfluous to abort() on them. */ switch (c) { case '(': case ')': case '\\': ps_putchar(p, '\\'); break; default: break; } /* Write the character and adjust where we are on the page. */ f = (int)p->ps->lastf; if (c <= 32 || c - 32 >= MAXCHAR) c = 32; ps_putchar(p, (char)c); c -= 32; p->ps->pscol += (size_t)fonts[f].gly[c].wx; } static void ps_pclose(struct termp *p) { /* * Spit out that we're exiting a word context (this is a * "partial close" because we don't check the last-char buffer * or anything). */ if ( ! (PS_INLINE & p->ps->flags)) return; if (TERMTYPE_PS != p->type) ps_printf(p, ") Tj\nET\n"); else if (p->ps->psrow == p->ps->lastrow) ps_printf(p, ")c\n"); else { ps_printf(p, ")s\n"); p->ps->lastrow = p->ps->psrow; } p->ps->flags &= ~PS_INLINE; } /* If we have a `last' char that wasn't printed yet, print it now. */ static void ps_plast(struct termp *p) { size_t wx; if (p->ps->last == '\0') return; /* Check the font mode; open a new scope if it doesn't match. */ if (p->ps->nextf != p->ps->lastf) { ps_pclose(p); ps_setfont(p, p->ps->nextf); } p->ps->nextf = TERMFONT_NONE; /* * For an overstrike, if a previous character * was wider, advance to center the new one. */ if (p->ps->pscolnext) { wx = fonts[p->ps->lastf].gly[(int)p->ps->last-32].wx; if (p->ps->pscol + wx < p->ps->pscolnext) p->ps->pscol = (p->ps->pscol + p->ps->pscolnext - wx) / 2; } ps_pletter(p, p->ps->last); p->ps->last = '\0'; /* * For an overstrike, if a previous character * was wider, advance to the end of the old one. */ if (p->ps->pscol < p->ps->pscolnext) { ps_pclose(p); p->ps->pscol = p->ps->pscolnext; } } static void ps_letter(struct termp *p, int arg) { size_t savecol; char c; c = arg >= 128 || arg <= 0 ? '?' : arg; /* * When receiving a backspace, merely flag it. * We don't know yet whether it is * a font instruction or an overstrike. */ if (c == '\b') { assert(p->ps->last != '\0'); assert( ! (p->ps->flags & PS_BACKSP)); p->ps->flags |= PS_BACKSP; return; } /* * Decode font instructions. */ if (p->ps->flags & PS_BACKSP) { if (p->ps->last == '_') { switch (p->ps->nextf) { case TERMFONT_BI: break; case TERMFONT_BOLD: p->ps->nextf = TERMFONT_BI; break; default: p->ps->nextf = TERMFONT_UNDER; } p->ps->last = c; p->ps->flags &= ~PS_BACKSP; return; } if (p->ps->last == c) { switch (p->ps->nextf) { case TERMFONT_BI: break; case TERMFONT_UNDER: p->ps->nextf = TERMFONT_BI; break; default: p->ps->nextf = TERMFONT_BOLD; } p->ps->flags &= ~PS_BACKSP; return; } /* * This is not a font instruction, but rather * the next character. Prepare for overstrike. */ savecol = p->ps->pscol; } else savecol = SIZE_MAX; /* * We found the next character, so the font instructions * for the previous one are complete. * Use them and print it. */ ps_plast(p); /* * Do not print the current character yet because font * instructions might follow; only remember the character. * It will get printed later from ps_plast(). */ p->ps->last = c; /* * For an overstrike, back up to the previous position. * If the previous character is wider than any it overstrikes, * remember the current position, because it might also be * wider than all that will overstrike it. */ if (savecol != SIZE_MAX) { if (p->ps->pscolnext < p->ps->pscol) p->ps->pscolnext = p->ps->pscol; ps_pclose(p); p->ps->pscol = savecol; p->ps->flags &= ~PS_BACKSP; } else p->ps->pscolnext = 0; } static void ps_advance(struct termp *p, size_t len) { /* * Advance some spaces. This can probably be made smarter, * i.e., to have multiple space-separated words in the same * scope, but this is easier: just close out the current scope * and readjust our column settings. */ ps_plast(p); ps_pclose(p); p->ps->pscol += len; } static void ps_endline(struct termp *p) { /* Close out any scopes we have open: we're at eoln. */ ps_plast(p); ps_pclose(p); /* * If we're in the margin, don't try to recalculate our current * row. XXX: if the column tries to be fancy with multiple * lines, we'll do nasty stuff. */ if (PS_MARGINS & p->ps->flags) return; /* Left-justify. */ p->ps->pscol = p->ps->left; /* If we haven't printed anything, return. */ if (PS_NEWPAGE & p->ps->flags) return; /* * Put us down a line. If we're at the page bottom, spit out a * showpage and restart our row. */ if (p->ps->psrow >= p->ps->lineheight + p->ps->bottom) { p->ps->psrow -= p->ps->lineheight; return; } ps_closepage(p); if ((int)p->tcol->offset > p->ti) p->tcol->offset -= p->ti; else p->tcol->offset = 0; p->ti = 0; } static void ps_setfont(struct termp *p, enum termfont f) { assert(f < TERMFONT__MAX); p->ps->lastf = f; /* * If we're still at the top of the page, let the font-setting * be delayed until we actually have stuff to print. */ if (PS_NEWPAGE & p->ps->flags) return; if (TERMTYPE_PS == p->type) ps_printf(p, "f%d\n", (int)f); else ps_printf(p, "/F%d %zu Tf\n", (int)f, p->ps->scale); } static size_t ps_width(const struct termp *p, int c) { if (c <= 32 || c - 32 >= MAXCHAR) c = 0; else c -= 32; return (size_t)fonts[(int)TERMFONT_NONE].gly[c].wx; } static int ps_hspan(const struct termp *p, const struct roffsu *su) { double r; /* * All of these measurements are derived by converting from the * native measurement to AFM units. */ switch (su->unit) { case SCALE_BU: /* * Traditionally, the default unit is fixed to the * output media. So this would refer to the point. In * mandoc(1), however, we stick to the default terminal * scaling unit so that output is the same regardless * the media. */ r = PNT2AFM(p, su->scale * 72.0 / 240.0); break; case SCALE_CM: r = PNT2AFM(p, su->scale * 72.0 / 2.54); break; case SCALE_EM: r = su->scale * fonts[(int)TERMFONT_NONE].gly[109 - 32].wx; break; case SCALE_EN: r = su->scale * fonts[(int)TERMFONT_NONE].gly[110 - 32].wx; break; case SCALE_IN: r = PNT2AFM(p, su->scale * 72.0); break; case SCALE_MM: r = su->scale * fonts[(int)TERMFONT_NONE].gly[109 - 32].wx / 100.0; break; case SCALE_PC: r = PNT2AFM(p, su->scale * 12.0); break; case SCALE_PT: r = PNT2AFM(p, su->scale * 1.0); break; case SCALE_VS: r = su->scale * p->ps->lineheight; break; default: r = su->scale; break; } return r * 24.0; } static void ps_growbuf(struct termp *p, size_t sz) { if (p->ps->psmargcur + sz <= p->ps->psmargsz) return; if (sz < PS_BUFSLOP) sz = PS_BUFSLOP; p->ps->psmargsz += sz; p->ps->psmarg = mandoc_realloc(p->ps->psmarg, p->ps->psmargsz); } mandoc-1.14.6/term_tab.c010064400017530001753000000060301412314055300153070ustar00schwarzeschwarze/* $Id: term_tab.c,v 1.6 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include "mandoc_aux.h" #include "out.h" #include "term.h" struct tablist { size_t *t; /* Allocated array of tab positions. */ size_t s; /* Allocated number of positions. */ size_t n; /* Currently used number of positions. */ }; static struct { struct tablist a; /* All tab positions for lookup. */ struct tablist p; /* Periodic tab positions to add. */ size_t d; /* Default tab width in units of n. */ } tabs; void term_tab_set(const struct termp *p, const char *arg) { static int recording_period; struct roffsu su; struct tablist *tl; size_t pos; int add; /* Special arguments: clear all tabs or switch lists. */ if (arg == NULL) { tabs.a.n = tabs.p.n = 0; recording_period = 0; if (tabs.d == 0) { a2roffsu(".8i", &su, SCALE_IN); tabs.d = term_hen(p, &su); } return; } if (arg[0] == 'T' && arg[1] == '\0') { recording_period = 1; return; } /* Parse the sign, the number, and the unit. */ if (*arg == '+') { add = 1; arg++; } else add = 0; if (a2roffsu(arg, &su, SCALE_EM) == NULL) return; /* Select the list, and extend it if it is full. */ tl = recording_period ? &tabs.p : &tabs.a; if (tl->n >= tl->s) { tl->s += 8; tl->t = mandoc_reallocarray(tl->t, tl->s, sizeof(*tl->t)); } /* Append the new position. */ pos = term_hen(p, &su); tl->t[tl->n] = pos; if (add && tl->n) tl->t[tl->n] += tl->t[tl->n - 1]; tl->n++; } /* * Simplified version without a parser, * never incremental, never periodic, for use by tbl(7). */ void term_tab_iset(size_t inc) { if (tabs.a.n >= tabs.a.s) { tabs.a.s += 8; tabs.a.t = mandoc_reallocarray(tabs.a.t, tabs.a.s, sizeof(*tabs.a.t)); } tabs.a.t[tabs.a.n++] = inc; } size_t term_tab_next(size_t prev) { size_t i, j; for (i = 0;; i++) { if (i == tabs.a.n) { if (tabs.p.n == 0) return prev; tabs.a.n += tabs.p.n; if (tabs.a.s < tabs.a.n) { tabs.a.s = tabs.a.n; tabs.a.t = mandoc_reallocarray(tabs.a.t, tabs.a.s, sizeof(*tabs.a.t)); } for (j = 0; j < tabs.p.n; j++) tabs.a.t[i + j] = tabs.p.t[j] + (i ? tabs.a.t[i - 1] : 0); } if (prev < tabs.a.t[i]) return tabs.a.t[i]; } } mandoc-1.14.6/term_tag.c010064400017530001753000000131061412314055300153160ustar00schwarzeschwarze/* $Id: term_tag.c,v 1.6 2021/03/30 17:16:55 schwarze Exp $ */ /* * Copyright (c) 2015,2016,2018,2019,2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Functions to write a ctags(1) file. * For use by the mandoc(1) ASCII and UTF-8 formatters only. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "roff_int.h" #include "tag.h" #include "term_tag.h" static void tag_signal(int) __attribute__((__noreturn__)); static struct tag_files tag_files; /* * Prepare for using a pager. * Not all pagers are capable of using a tag file, * but for simplicity, create it anyway. */ struct tag_files * term_tag_init(const char *outfilename, const char *suffix, const char *tagfilename) { struct sigaction sa; int ofd; /* In /tmp/, dup(2)ed to stdout. */ int tfd; ofd = tfd = -1; tag_files.tfs = NULL; tag_files.tcpgid = -1; /* Clean up when dying from a signal. */ memset(&sa, 0, sizeof(sa)); sigfillset(&sa.sa_mask); sa.sa_handler = tag_signal; sigaction(SIGHUP, &sa, NULL); sigaction(SIGINT, &sa, NULL); sigaction(SIGTERM, &sa, NULL); /* * POSIX requires that a process calling tcsetpgrp(3) * from the background gets a SIGTTOU signal. * In that case, do not stop. */ sa.sa_handler = SIG_IGN; sigaction(SIGTTOU, &sa, NULL); /* Save the original standard output for use by the pager. */ if ((tag_files.ofd = dup(STDOUT_FILENO)) == -1) { mandoc_msg(MANDOCERR_DUP, 0, 0, "%s", strerror(errno)); goto fail; } /* Create both temporary output files. */ if (outfilename == NULL) { (void)snprintf(tag_files.ofn, sizeof(tag_files.ofn), "/tmp/man.XXXXXXXXXX%s", suffix); if ((ofd = mkstemps(tag_files.ofn, strlen(suffix))) == -1) { mandoc_msg(MANDOCERR_MKSTEMP, 0, 0, "%s: %s", tag_files.ofn, strerror(errno)); goto fail; } } else { (void)strlcpy(tag_files.ofn, outfilename, sizeof(tag_files.ofn)); unlink(outfilename); ofd = open(outfilename, O_WRONLY | O_CREAT | O_EXCL, 0644); if (ofd == -1) { mandoc_msg(MANDOCERR_OPEN, 0, 0, "%s: %s", outfilename, strerror(errno)); goto fail; } } if (tagfilename == NULL) { (void)strlcpy(tag_files.tfn, "/tmp/man.XXXXXXXXXX", sizeof(tag_files.tfn)); if ((tfd = mkstemp(tag_files.tfn)) == -1) { mandoc_msg(MANDOCERR_MKSTEMP, 0, 0, "%s: %s", tag_files.tfn, strerror(errno)); goto fail; } } else { (void)strlcpy(tag_files.tfn, tagfilename, sizeof(tag_files.tfn)); unlink(tagfilename); tfd = open(tagfilename, O_WRONLY | O_CREAT | O_EXCL, 0644); if (tfd == -1) { mandoc_msg(MANDOCERR_OPEN, 0, 0, "%s: %s", tagfilename, strerror(errno)); goto fail; } } if ((tag_files.tfs = fdopen(tfd, "w")) == NULL) { mandoc_msg(MANDOCERR_FDOPEN, 0, 0, "%s", strerror(errno)); goto fail; } tfd = -1; if (dup2(ofd, STDOUT_FILENO) == -1) { mandoc_msg(MANDOCERR_DUP, 0, 0, "%s", strerror(errno)); goto fail; } close(ofd); return &tag_files; fail: term_tag_unlink(); if (ofd != -1) close(ofd); if (tfd != -1) close(tfd); if (tag_files.ofd != -1) { close(tag_files.ofd); tag_files.ofd = -1; } return NULL; } void term_tag_write(struct roff_node *n, size_t line) { const char *cp; int len; if (tag_files.tfs == NULL) return; cp = n->tag == NULL ? n->child->string : n->tag; if (cp[0] == '\\' && (cp[1] == '&' || cp[1] == 'e')) cp += 2; len = strcspn(cp, " \t\\"); fprintf(tag_files.tfs, "%.*s %s %zu\n", len, cp, tag_files.ofn, line); } /* * Close both output files and restore the original standard output * to the terminal. In the unlikely case that the latter fails, * trying to start a pager would be useless, so report the failure * to the main program. */ int term_tag_close(void) { int irc = 0; if (tag_files.tfs != NULL) { fclose(tag_files.tfs); tag_files.tfs = NULL; } if (tag_files.ofd != -1) { fflush(stdout); if ((irc = dup2(tag_files.ofd, STDOUT_FILENO)) == -1) mandoc_msg(MANDOCERR_DUP, 0, 0, "%s", strerror(errno)); close(tag_files.ofd); tag_files.ofd = -1; } return irc; } void term_tag_unlink(void) { pid_t tc_pgid; if (tag_files.tcpgid != -1) { tc_pgid = tcgetpgrp(STDOUT_FILENO); if (tc_pgid == tag_files.pager_pid || tc_pgid == getpgid(0) || getpgid(tc_pgid) == -1) (void)tcsetpgrp(STDOUT_FILENO, tag_files.tcpgid); } if (strncmp(tag_files.ofn, "/tmp/man.", 9) == 0) { unlink(tag_files.ofn); *tag_files.ofn = '\0'; } if (strncmp(tag_files.tfn, "/tmp/man.", 9) == 0) { unlink(tag_files.tfn); *tag_files.tfn = '\0'; } } static void tag_signal(int signum) { struct sigaction sa; term_tag_unlink(); memset(&sa, 0, sizeof(sa)); sigemptyset(&sa.sa_mask); sa.sa_handler = SIG_DFL; sigaction(signum, &sa, NULL); kill(getpid(), signum); /* NOTREACHED */ _exit(1); } mandoc-1.14.6/tree.c010064400017530001753000000250571412314055300144630ustar00schwarzeschwarze/* $Id: tree.c,v 1.91 2021/09/07 10:59:18 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons * Copyright (c) 2013-2015, 2017-2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Formatting module to let mandoc(1) show * a human readable representation of the syntax tree. */ #include "config.h" #include #include #include #include #include #include #include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "man.h" #include "tbl.h" #include "eqn.h" #include "main.h" static void print_attr(const struct roff_node *); static void print_box(const struct eqn_box *, int); static void print_cellt(enum tbl_cellt); static void print_man(const struct roff_node *, int); static void print_meta(const struct roff_meta *); static void print_mdoc(const struct roff_node *, int); static void print_span(const struct tbl_span *, int); void tree_mdoc(void *arg, const struct roff_meta *mdoc) { print_meta(mdoc); putchar('\n'); print_mdoc(mdoc->first->child, 0); } void tree_man(void *arg, const struct roff_meta *man) { print_meta(man); if (man->hasbody == 0) puts("body = empty"); putchar('\n'); print_man(man->first->child, 0); } static void print_meta(const struct roff_meta *meta) { if (meta->title != NULL) printf("title = \"%s\"\n", meta->title); if (meta->name != NULL) printf("name = \"%s\"\n", meta->name); if (meta->msec != NULL) printf("sec = \"%s\"\n", meta->msec); if (meta->vol != NULL) printf("vol = \"%s\"\n", meta->vol); if (meta->arch != NULL) printf("arch = \"%s\"\n", meta->arch); if (meta->os != NULL) printf("os = \"%s\"\n", meta->os); if (meta->date != NULL) printf("date = \"%s\"\n", meta->date); } static void print_mdoc(const struct roff_node *n, int indent) { const char *p, *t; int i, j; size_t argc; struct mdoc_argv *argv; if (n == NULL) return; argv = NULL; argc = 0; t = p = NULL; switch (n->type) { case ROFFT_ROOT: t = "root"; break; case ROFFT_BLOCK: t = "block"; break; case ROFFT_HEAD: t = "head"; break; case ROFFT_BODY: if (n->end) t = "body-end"; else t = "body"; break; case ROFFT_TAIL: t = "tail"; break; case ROFFT_ELEM: t = "elem"; break; case ROFFT_TEXT: t = "text"; break; case ROFFT_COMMENT: t = "comment"; break; case ROFFT_TBL: break; case ROFFT_EQN: t = "eqn"; break; default: abort(); } switch (n->type) { case ROFFT_TEXT: case ROFFT_COMMENT: p = n->string; break; case ROFFT_BODY: p = roff_name[n->tok]; break; case ROFFT_HEAD: p = roff_name[n->tok]; break; case ROFFT_TAIL: p = roff_name[n->tok]; break; case ROFFT_ELEM: p = roff_name[n->tok]; if (n->args) { argv = n->args->argv; argc = n->args->argc; } break; case ROFFT_BLOCK: p = roff_name[n->tok]; if (n->args) { argv = n->args->argv; argc = n->args->argc; } break; case ROFFT_TBL: break; case ROFFT_EQN: p = "EQ"; break; case ROFFT_ROOT: p = "root"; break; default: abort(); } if (n->span) { assert(NULL == p && NULL == t); print_span(n->span, indent); } else { for (i = 0; i < indent; i++) putchar(' '); printf("%s (%s)", p, t); for (i = 0; i < (int)argc; i++) { printf(" -%s", mdoc_argnames[argv[i].arg]); if (argv[i].sz > 0) printf(" ["); for (j = 0; j < (int)argv[i].sz; j++) printf(" [%s]", argv[i].value[j]); if (argv[i].sz > 0) printf(" ]"); } print_attr(n); } if (n->eqn) print_box(n->eqn->first, indent + 4); if (n->child) print_mdoc(n->child, indent + (n->type == ROFFT_BLOCK ? 2 : 4)); if (n->next) print_mdoc(n->next, indent); } static void print_man(const struct roff_node *n, int indent) { const char *p, *t; int i; if (n == NULL) return; t = p = NULL; switch (n->type) { case ROFFT_ROOT: t = "root"; break; case ROFFT_ELEM: t = "elem"; break; case ROFFT_TEXT: t = "text"; break; case ROFFT_COMMENT: t = "comment"; break; case ROFFT_BLOCK: t = "block"; break; case ROFFT_HEAD: t = "head"; break; case ROFFT_BODY: t = "body"; break; case ROFFT_TBL: break; case ROFFT_EQN: t = "eqn"; break; default: abort(); } switch (n->type) { case ROFFT_TEXT: case ROFFT_COMMENT: p = n->string; break; case ROFFT_ELEM: case ROFFT_BLOCK: case ROFFT_HEAD: case ROFFT_BODY: p = roff_name[n->tok]; break; case ROFFT_ROOT: p = "root"; break; case ROFFT_TBL: break; case ROFFT_EQN: p = "EQ"; break; default: abort(); } if (n->span) { assert(NULL == p && NULL == t); print_span(n->span, indent); } else { for (i = 0; i < indent; i++) putchar(' '); printf("%s (%s)", p, t); print_attr(n); } if (n->eqn) print_box(n->eqn->first, indent + 4); if (n->child) print_man(n->child, indent + (n->type == ROFFT_BLOCK ? 2 : 4)); if (n->next) print_man(n->next, indent); } static void print_attr(const struct roff_node *n) { putchar(' '); if (n->flags & NODE_DELIMO) putchar('('); if (n->flags & NODE_LINE) putchar('*'); printf("%d:%d", n->line, n->pos + 1); if (n->flags & NODE_DELIMC) putchar(')'); if (n->flags & NODE_EOS) putchar('.'); if (n->flags & NODE_ID) { printf(" ID"); if (n->flags & NODE_HREF) printf("=HREF"); } else if (n->flags & NODE_HREF) printf(" HREF"); else if (n->tag != NULL) printf(" STRAYTAG"); if (n->tag != NULL) printf("=%s", n->tag); if (n->flags & NODE_BROKEN) printf(" BROKEN"); if (n->flags & NODE_NOFILL) printf(" NOFILL"); if (n->flags & NODE_NOSRC) printf(" NOSRC"); if (n->flags & NODE_NOPRT) printf(" NOPRT"); putchar('\n'); } static void print_box(const struct eqn_box *ep, int indent) { int i; const char *t; static const char *posnames[] = { NULL, "sup", "subsup", "sub", "to", "from", "fromto", "over", "sqrt", NULL }; if (NULL == ep) return; for (i = 0; i < indent; i++) putchar(' '); t = NULL; switch (ep->type) { case EQN_LIST: t = "eqn-list"; break; case EQN_SUBEXPR: t = "eqn-expr"; break; case EQN_TEXT: t = "eqn-text"; break; case EQN_PILE: t = "eqn-pile"; break; case EQN_MATRIX: t = "eqn-matrix"; break; } fputs(t, stdout); if (ep->pos) printf(" pos=%s", posnames[ep->pos]); if (ep->left) printf(" left=\"%s\"", ep->left); if (ep->right) printf(" right=\"%s\"", ep->right); if (ep->top) printf(" top=\"%s\"", ep->top); if (ep->bottom) printf(" bottom=\"%s\"", ep->bottom); if (ep->text) printf(" text=\"%s\"", ep->text); if (ep->font) printf(" font=%d", ep->font); if (ep->size != EQN_DEFSIZE) printf(" size=%d", ep->size); if (ep->expectargs != UINT_MAX && ep->expectargs != ep->args) printf(" badargs=%zu(%zu)", ep->args, ep->expectargs); else if (ep->args) printf(" args=%zu", ep->args); putchar('\n'); print_box(ep->first, indent + 4); print_box(ep->next, indent); } static void print_cellt(enum tbl_cellt pos) { switch(pos) { case TBL_CELL_LEFT: putchar('L'); break; case TBL_CELL_LONG: putchar('a'); break; case TBL_CELL_CENTRE: putchar('c'); break; case TBL_CELL_RIGHT: putchar('r'); break; case TBL_CELL_NUMBER: putchar('n'); break; case TBL_CELL_SPAN: putchar('s'); break; case TBL_CELL_DOWN: putchar('^'); break; case TBL_CELL_HORIZ: putchar('-'); break; case TBL_CELL_DHORIZ: putchar('='); break; case TBL_CELL_MAX: putchar('#'); break; } } static void print_span(const struct tbl_span *sp, int indent) { const struct tbl_dat *dp; const struct tbl_cell *cp; int i; if (sp->prev == NULL) { for (i = 0; i < indent; i++) putchar(' '); printf("%d", sp->opts->cols); if (sp->opts->opts & TBL_OPT_CENTRE) fputs(" center", stdout); if (sp->opts->opts & TBL_OPT_EXPAND) fputs(" expand", stdout); if (sp->opts->opts & TBL_OPT_ALLBOX) fputs(" allbox", stdout); if (sp->opts->opts & TBL_OPT_BOX) fputs(" box", stdout); if (sp->opts->opts & TBL_OPT_DBOX) fputs(" doublebox", stdout); if (sp->opts->opts & TBL_OPT_NOKEEP) fputs(" nokeep", stdout); if (sp->opts->opts & TBL_OPT_NOSPACE) fputs(" nospaces", stdout); if (sp->opts->opts & TBL_OPT_NOWARN) fputs(" nowarn", stdout); printf(" (tbl options) %d:1\n", sp->line); } for (i = 0; i < indent; i++) putchar(' '); switch (sp->pos) { case TBL_SPAN_HORIZ: putchar('-'); putchar(' '); break; case TBL_SPAN_DHORIZ: putchar('='); putchar(' '); break; default: for (cp = sp->layout->first; cp != NULL; cp = cp->next) print_cellt(cp->pos); putchar(' '); for (dp = sp->first; dp; dp = dp->next) { if ((cp = dp->layout) == NULL) putchar('*'); else { printf("%d", cp->col); print_cellt(dp->layout->pos); switch (cp->font) { case ESCAPE_FONTROMAN: break; case ESCAPE_FONTBOLD: putchar('b'); break; case ESCAPE_FONTITALIC: putchar('i'); break; case ESCAPE_FONTBI: fputs("bi", stdout); break; case ESCAPE_FONTCR: putchar('c'); break; case ESCAPE_FONTCB: fputs("cb", stdout); break; case ESCAPE_FONTCI: fputs("ci", stdout); break; default: abort(); } if (cp->flags & TBL_CELL_TALIGN) putchar('t'); if (cp->flags & TBL_CELL_UP) putchar('u'); if (cp->flags & TBL_CELL_BALIGN) putchar('d'); if (cp->flags & TBL_CELL_WIGN) putchar('z'); if (cp->flags & TBL_CELL_EQUAL) putchar('e'); if (cp->flags & TBL_CELL_WMAX) putchar('x'); } switch (dp->pos) { case TBL_DATA_HORIZ: case TBL_DATA_NHORIZ: putchar('-'); break; case TBL_DATA_DHORIZ: case TBL_DATA_NDHORIZ: putchar('='); break; default: putchar(dp->block ? '{' : '['); if (dp->string != NULL) fputs(dp->string, stdout); putchar(dp->block ? '}' : ']'); break; } if (dp->hspans) printf(">%d", dp->hspans); if (dp->vspans) printf("v%d", dp->vspans); putchar(' '); } break; } printf("(tbl) %d:1\n", sp->line); } mandoc-1.14.6/test-attribute.c010064400017530001753000000023631412314055300164770ustar00schwarzeschwarze/* $Id: test-attribute.c,v 1.1 2020/06/22 20:00:38 schwarze Exp $ */ /* * Copyright (c) 2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include void var_arg(const char *, ...) __attribute__((__format__ (__printf__, 1, 2))); void no_ret(int) __attribute__((__noreturn__)); void var_arg(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); } void no_ret(int i) { exit(i); } int main(void) { var_arg("Test output: %d\n", 42); no_ret(0); } mandoc-1.14.6/test-be32toh.c010064400017530001753000000002231412314055300157330ustar00schwarzeschwarze#ifdef SYS_ENDIAN #include #else #include #endif int main(void) { return htobe32(be32toh(0x3a7d0cdb)) != 0x3a7d0cdb; } mandoc-1.14.6/test-cmsg.c010064400017530001753000000002561412314055300154240ustar00schwarzeschwarze#include #include int main(void) { struct msghdr msg; msg.msg_control = NULL; msg.msg_controllen = 0; return CMSG_FIRSTHDR(&msg) != NULL; } mandoc-1.14.6/test-dirent-namlen.c010064400017530001753000000001741412314055300172270ustar00schwarzeschwarze#include #include int main(void) { struct dirent entry; return sizeof(entry.d_namlen) == 0; } mandoc-1.14.6/test-EFTYPE.c010064400017530001753000000000701412314055300154610ustar00schwarzeschwarze#include int main(void) { return !EFTYPE; } mandoc-1.14.6/test-err.c010064400017530001753000000017421412314055300152640ustar00schwarzeschwarze/* $Id: test-err.c,v 1.1 2015/10/11 21:12:55 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include int main(void) { warnx("%d. warnx", 1); warn("%d. warn", 2); err(0, "%d. err", 3); /* NOTREACHED */ return 1; } mandoc-1.14.6/test-fts.c010064400017530001753000000017041412314055300152660ustar00schwarzeschwarze#include #include #include #include #include #ifdef FTS_COMPARE_CONST int fts_compare(const FTSENT *const *, const FTSENT *const *); #else int fts_compare(const FTSENT **, const FTSENT **); #endif int main(void) { const char *argv[2]; FTS *ftsp; FTSENT *entry; argv[0] = "."; argv[1] = (char *)NULL; ftsp = fts_open((char * const *)argv, FTS_PHYSICAL | FTS_NOCHDIR, fts_compare); if (ftsp == NULL) { perror("fts_open"); return 1; } entry = fts_read(ftsp); if (entry == NULL) { perror("fts_read"); return 1; } if (fts_set(ftsp, entry, FTS_SKIP) != 0) { perror("fts_set"); return 1; } if (fts_close(ftsp) != 0) { perror("fts_close"); return 1; } return 0; } int #ifdef FTS_COMPARE_CONST fts_compare(const FTSENT *const *a, const FTSENT *const *b) #else fts_compare(const FTSENT **a, const FTSENT **b) #endif { return strcmp((*a)->fts_name, (*b)->fts_name); } mandoc-1.14.6/test-getline.c010064400017530001753000000002721412314055300161200ustar00schwarzeschwarze#include #include #include int main(void) { char *line = NULL; size_t linesz = 0; fclose(stdin); return getline(&line, &linesz, stdin) != -1; } mandoc-1.14.6/test-getsubopt.c010064400017530001753000000024731412314055300165120ustar00schwarzeschwarze/* $Id: test-getsubopt.c,v 1.6 2018/08/15 14:37:41 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include /* * NetBSD declared this function in the wrong header before August 2018. * No harm is done by allowing that, too: * The only file using it, main.c, also includes unistd.h, anyway. */ #include int main(void) { char buf[] = "k=v"; char *options = buf; char token0[] = "k"; char *const tokens[] = { token0, NULL }; char *value = NULL; return ! (getsubopt(&options, tokens, &value) == 0 && value == buf+2 && options == buf+3); } mandoc-1.14.6/test-isblank.c010064400017530001753000000001401412314055300161060ustar00schwarzeschwarze#include int main(void) { return !isblank(' ') || !isblank('\t') || isblank('_'); } mandoc-1.14.6/test-mkdtemp.c010064400017530001753000000002571412314055300161350ustar00schwarzeschwarze#include #include int main(void) { char dirname[] = "/tmp/temp.XXXXXX"; if (mkdtemp(dirname) != dirname) return 1; return rmdir(dirname) == -1; } mandoc-1.14.6/test-mkstemps.c010064400017530001753000000002711412314055300163330ustar00schwarzeschwarze#include #include int main(void) { char filename[] = "/tmp/temp.XXXXXX.suffix"; if (mkstemps(filename, 7) == -1) return 1; return unlink(filename) == -1; } mandoc-1.14.6/test-nanosleep.c010064400017530001753000000003571412314055300164610ustar00schwarzeschwarze#include #include int main(void) { struct timespec timeout; timeout.tv_sec = 0; timeout.tv_nsec = 100000000; /* 0.1 seconds */ if (nanosleep(&timeout, NULL)) { perror("nanosleep"); return 1; } return 0; } mandoc-1.14.6/test-noop.c010064400017530001753000000000361412314055300154420ustar00schwarzeschwarzeint main(void) { return 0; } mandoc-1.14.6/test-ntohl.c010064400017530001753000000001331412314055300156110ustar00schwarzeschwarze#include int main(void) { return htonl(ntohl(0x3a7d0cdb)) != 0x3a7d0cdb; } mandoc-1.14.6/test-O_DIRECTORY.c010064400017530001753000000001301412314055300163040ustar00schwarzeschwarze#include int main(void) { return open(".", O_RDONLY | O_DIRECTORY) == -1; } mandoc-1.14.6/test-ohash.c010064400017530001753000000011111412314055300155640ustar00schwarzeschwarze#include #include #include #include static void *xmalloc(size_t, void *); static void *xcalloc(size_t, size_t, void *); static void xfree(void *, void *); static void * xmalloc(size_t sz, void *arg) { return calloc(1,sz); } static void * xcalloc(size_t nmemb, size_t sz, void *arg) { return calloc(nmemb,sz); } static void xfree(void *p, void *arg) { free(p); } int main(void) { struct ohash h; struct ohash_info i; i.alloc = xmalloc; i.calloc = xcalloc; i.free = xfree; ohash_init(&h, 2, &i); ohash_delete(&h); return 0; } mandoc-1.14.6/test-PATH_MAX.c010064400017530001753000000020261412314055300157310ustar00schwarzeschwarze/* * POSIX allows PATH_MAX to not be defined, see * http://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html; * the GNU Hurd is an example of a system not having it. * * Arguably, it would be better to test sysconf(_SC_PATH_MAX), * but since the individual *.c files include "config.h" before * , overriding an excessive value of PATH_MAX from * "config.h" is impossible anyway, so for now, the simplest * fix is to provide a value only on systems not having any. * So far, we encountered no system defining PATH_MAX to an * impractically large value, even though POSIX explicitly * allows that. * * The real fix would be to replace all static buffers of size * PATH_MAX by dynamically allocated buffers. But that is * somewhat intrusive because it touches several files and * because it requires changing struct mlink in mandocdb.c. * So i'm postponing that for now. */ #include #include int main(void) { printf("PATH_MAX is defined to be %ld\n", (long)PATH_MAX); return 0; } mandoc-1.14.6/test-pledge.c010064400017530001753000000001111412314055300157210ustar00schwarzeschwarze#include int main(void) { return !!pledge("stdio", NULL); } mandoc-1.14.6/test-progname.c010064400017530001753000000001661412314055300163030ustar00schwarzeschwarze#include int main(void) { const char * progname; progname = getprogname(); return progname == NULL; } mandoc-1.14.6/test-reallocarray.c010064400017530001753000000001131412314055300171430ustar00schwarzeschwarze#include int main(void) { return !reallocarray(NULL, 2, 2); } mandoc-1.14.6/test-recallocarray.c010064400017530001753000000002041412314055300173070ustar00schwarzeschwarze#include int main(void) { void *p; if ((p = calloc(2, 2)) == NULL) return 1; return !recallocarray(p, 2, 3, 2); } mandoc-1.14.6/test-recvmsg.c010064400017530001753000000001441412314055300161350ustar00schwarzeschwarze#include #include int main(void) { return recvmsg(-1, NULL, 0) != -1; } mandoc-1.14.6/test-rewb-bsd.c010064400017530001753000000011521412314055300161740ustar00schwarzeschwarze#include #include #include int main(void) { regex_t re; if (regcomp(&re, "[[:<:]]word[[:>:]]", REG_EXTENDED | REG_NOSUB)) return 1; if (regexec(&re, "the word is here", 0, NULL, 0)) return 2; if (regexec(&re, "same word", 0, NULL, 0)) return 3; if (regexec(&re, "word again", 0, NULL, 0)) return 4; if (regexec(&re, "word", 0, NULL, 0)) return 5; if (regexec(&re, "wordy", 0, NULL, 0) != REG_NOMATCH) return 6; if (regexec(&re, "sword", 0, NULL, 0) != REG_NOMATCH) return 7; if (regexec(&re, "reworded", 0, NULL, 0) != REG_NOMATCH) return 8; return 0; } mandoc-1.14.6/test-rewb-sysv.c010064400017530001753000000011421412314055300164270ustar00schwarzeschwarze#include #include #include int main(void) { regex_t re; if (regcomp(&re, "\\", REG_EXTENDED | REG_NOSUB)) return 1; if (regexec(&re, "the word is here", 0, NULL, 0)) return 2; if (regexec(&re, "same word", 0, NULL, 0)) return 3; if (regexec(&re, "word again", 0, NULL, 0)) return 4; if (regexec(&re, "word", 0, NULL, 0)) return 5; if (regexec(&re, "wordy", 0, NULL, 0) != REG_NOMATCH) return 6; if (regexec(&re, "sword", 0, NULL, 0) != REG_NOMATCH) return 7; if (regexec(&re, "reworded", 0, NULL, 0) != REG_NOMATCH) return 8; return 0; } mandoc-1.14.6/test-sandbox_init.c010064400017530001753000000002721412314055300171520ustar00schwarzeschwarze#include int main(void) { char *ep; int rc; rc = sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, &ep); if (-1 == rc) sandbox_free_error(ep); return(-1 == rc); } mandoc-1.14.6/test-strcasestr.c010064400017530001753000000002031412314055300166600ustar00schwarzeschwarze#include int main(void) { const char *big = "BigString"; char *cp = strcasestr(big, "Gst"); return cp != big + 2; } mandoc-1.14.6/test-stringlist.c010064400017530001753000000022131412314055300166700ustar00schwarzeschwarze/* $Id: test-stringlist.c,v 1.3 2018/08/15 02:48:51 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include int main(void) { StringList *sl; char teststr[] = "test"; if ((sl = sl_init()) == NULL) return 1; if (sl_add(sl, teststr)) return 2; if (sl->sl_cur != 1) return 3; if (sl->sl_str[0] != teststr) return 4; sl_free(sl, 0); return 0; } mandoc-1.14.6/test-strlcat.c010064400017530001753000000002461412314055300161460ustar00schwarzeschwarze#include int main(void) { char buf[3] = "a"; return ! (strlcat(buf, "b", sizeof(buf)) == 2 && buf[0] == 'a' && buf[1] == 'b' && buf[2] == '\0'); } mandoc-1.14.6/test-strlcpy.c010064400017530001753000000002241412314055300161660ustar00schwarzeschwarze#include int main(void) { char buf[2] = ""; return ! (strlcpy(buf, "a", sizeof(buf)) == 1 && buf[0] == 'a' && buf[1] == '\0'); } mandoc-1.14.6/test-strndup.c010064400017530001753000000002151412314055300161650ustar00schwarzeschwarze#include int main(void) { char *s; s = strndup("123", 2); return s[0] != '1' ? 1 : s[1] != '2' ? 2 : s[2] != '\0' ? 3 : 0; } mandoc-1.14.6/test-strptime.c010064400017530001753000000003241412314055300163360ustar00schwarzeschwarze#include int main(void) { struct tm tm; const char input[] = "2014-01-04"; return ! (strptime(input, "%Y-%m-%d", &tm) == input + 10 && tm.tm_year == 114 && tm.tm_mon == 0 && tm.tm_mday == 4); } mandoc-1.14.6/test-strsep.c010064400017530001753000000002671412314055300160150ustar00schwarzeschwarze#include int main(void) { char buf[6] = "aybxc"; char *workp = buf; char *retp = strsep(&workp, "xy"); return ! (retp == buf && buf[1] == '\0' && workp == buf + 2); } mandoc-1.14.6/test-strtonum.c010064400017530001753000000023761412314055300163730ustar00schwarzeschwarze/* $Id: test-strtonum.c,v 1.2 2015/10/06 18:32:20 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include int main(void) { const char *errstr; if (strtonum("1", 0, 2, &errstr) != 1) return 1; if (errstr != NULL) return 2; if (strtonum("1x", 0, 2, &errstr) != 0) return 3; if (errstr == NULL) return 4; if (strtonum("2", 0, 1, &errstr) != 0) return 5; if (errstr == NULL) return 6; if (strtonum("0", 1, 2, &errstr) != 0) return 7; if (errstr == NULL) return 8; return 0; } mandoc-1.14.6/test-vasprintf.c010064400017530001753000000024051412314055300165050ustar00schwarzeschwarze/* $Id: test-vasprintf.c,v 1.5 2018/08/15 02:15:52 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include static int testfunc(char **, const char *, ...); static int testfunc(char **ret, const char *format, ...) { va_list ap; int irc; va_start(ap, format); irc = vasprintf(ret, format, ap); va_end(ap); return irc; } int main(void) { char *ret; if (testfunc(&ret, "%s.", "Text") != 5) return 1; if (strcmp(ret, "Text.")) return 2; return 0; } mandoc-1.14.6/test-wchar.c010064400017530001753000000031271412314055300155770ustar00schwarzeschwarze/* $Id: test-wchar.c,v 1.5 2018/08/15 02:15:52 schwarze Exp $ */ /* * Copyright (c) 2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include #include int main(void) { wchar_t wc; int width; if (setlocale(LC_ALL, "") == NULL) { fputs("setlocale(LC_ALL, \"\") failed\n", stderr); return 1; } if (setlocale(LC_CTYPE, UTF8_LOCALE) == NULL) { fprintf(stderr, "setlocale(LC_CTYPE, \"%s\") failed\n", UTF8_LOCALE); return 1; } if (sizeof(wchar_t) < 4) { fprintf(stderr, "wchar_t is only %zu bytes\n", sizeof(wchar_t)); return 1; } if ((width = wcwidth(L' ')) != 1) { fprintf(stderr, "wcwidth(L' ') returned %d\n", width); return 1; } dup2(STDERR_FILENO, STDOUT_FILENO); wc = L'*'; if (putwchar(wc) != (wint_t)wc) { fputs("bad putwchar return value\n", stderr); return 1; } return 0; }