5 open(INPUT
, $ARGV[0]) || die("cannot open $ARGV[0]");
6 open(OUTPUT
, "> $ARGV[1]") || die("cannot create $ARGV[1]");
12 if (/^\.XREF (.*)$/) {
18 open(XREF
, "> $xref.$suffix");
19 print XREF
".so man$extension/$ARGV[1]\n";
24 $insynopsis = /SYNOPSIS/;
34 # if (m/^([a-zA-Z][a-zA-Z0-9_]*\s+[a-zA-Z][a-zA-Z0-9_]*)\(/) {
35 # print ".B \"", $1, "\"\n";
38 # s/([a-zA-Z][a-zA-Z0-9_]*)(\s*[,()=])/" \1 "\2/g;
39 s/([ *])([a-zA-Z][a-zA-Z0-9_]*)(\s*[,)=])/\1" \2 "\3/g;
40 print ".BI \"", $_, "\"\n";
48 s/!([^!]+)!\|([^|]+)\|([^\s]*)\s*/\n.BI "\1" "\2\3"\n/g;
49 s/([!|])([^!|]+)\1([^\s]*)\s*/do subst($1,$2,$3)/eg;
60 local ($a, $b, $c) = @_;
62 "\n" . ($a eq "!" ?
".BR " : ".IR ") . "\"$b\" $c\n"
64 "\n" . ($a eq "!" ?
".B " : ".I ") . "\"$b\"\n"