diff options
Diffstat (limited to 'contrib/openpam/misc/gendoc.pl')
-rw-r--r-- | contrib/openpam/misc/gendoc.pl | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/contrib/openpam/misc/gendoc.pl b/contrib/openpam/misc/gendoc.pl index 60c710c..e2501e3 100644 --- a/contrib/openpam/misc/gendoc.pl +++ b/contrib/openpam/misc/gendoc.pl @@ -32,7 +32,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $P4: //depot/projects/openpam/misc/gendoc.pl#10 $ +# $P4: //depot/projects/openpam/misc/gendoc.pl#13 $ # use strict; @@ -139,6 +139,7 @@ sub parse_source($) { $argnames =~ s/([\|\[\]\(\)\.\*\+\?])/\\$1/g; $argnames =~ s/\" \"/|/g; $argnames =~ s/^\"(.*)\"$/($1)/; + $inliteral = $inlist = 0; foreach (split("\n", $source)) { s/\s*$//; if (!defined($man)) { @@ -185,7 +186,7 @@ sub parse_source($) { $inlist = 0; } elsif ($inliteral && m/^\S/) { $man .= ".Ed\n"; - $inlist = 0; + $inliteral = 0; } elsif ($inliteral) { $man .= "$_\n"; next; @@ -211,10 +212,17 @@ sub parse_source($) { $man .= "$_\n"; } if (defined($man)) { + if ($inlist) { + $man .= ".El\n"; + } + if ($inliteral) { + $man .= ".Ed\n"; + } $man =~ s/(\n\.[A-Z][a-z] [\w ]+)\n([\.,:;-]\S*)\s*/$1 $2\n/gs; $man =~ s/\s*$/\n/gm; $man =~ s/\n+/\n/gs; $man =~ s/\0//gs; + $man =~ s/\n\n\./\n\./gs; chomp($man); } else { $man = "No description available."; @@ -307,6 +315,9 @@ sub gendoc($) { if ($func->{'name'} =~ m/_sm_/) { $mdoc .= ".In security/pam_modules.h\n" } + if ($func->{'name'} =~ m/openpam/) { + $mdoc .= ".In security/openpam.h\n" + } $mdoc .= ".Ft $func->{'type'} .Fn $func->{'name'} $func->{'args'} .Sh DESCRIPTION @@ -366,10 +377,12 @@ as part of the DARPA CHATS research program. "; $fn = "$func->{'name'}.3"; - sysopen(FILE, $fn, O_RDWR|O_CREAT|O_TRUNC) - or die("$fn: open(): $!\n"); - print(FILE $mdoc); - close(FILE); + if (sysopen(FILE, $fn, O_RDWR|O_CREAT|O_TRUNC)) { + print(FILE $mdoc); + close(FILE); + } else { + warn("$fn: open(): $!\n"); + } } sub gensummary() { |