A new user interface for you! Read more...

File src2man.1 of Package txt2man

.\" Text automatically generated by txt2man
.TH src2man 1 "03 Januar 2016" "src2man-1.5.6" ""
.SH NAME
\fBsrc2man \fP- extract man pages from source files.
.SH SYNOPSIS
.nf
.fam C
\fBsrc2man\fP [\fB-n\fP][\fB-v\fP volume][\fB-r\fP \fIrelease\fP] [\fIsrcfile\fP \.\.\.]
.fam T
.fi
.fam T
.fi
.SH DESCRIPTION
\fBsrc2man\fP scans source file \fIsrcfile\fP. Only C source files are supported
for now. Comments blocks starting by "/** num", where num is a section
number, are converted into a man file, using \fBtxt2man\fP(1).
.PP
The first line of the comment block must contain the name of the manpage,
usually the function name, followed by a "-" and a short description.
The following lines are the "DESCRIPTION" section content, except if they
are in upper case, in which case they define a new section.
.PP
If the next line after a comment block is a C function prototype, then a
"SYNOPSIS" section will be filled using that prototype. This avoids to
duplicate the prototype in the comment block.
.PP
The best place for code documentation is in the source file, where the body is
implemented, not the header file which only contains the prototype. \fBsrc2man\fP
automatically searches for the presence of a prototype in the corresponding
header file, and if found, will print a "#include" statement in the synopsis.
.SH OPTIONS
.TP
.B
\fB-n\fP
No man page is created. The name of the manpages that would
be created are printed.
.TP
.B
\fB-p\fP volume
Specify the name of the volume to be printed in center header
of generated manpages.
.TP
.B
\fB-r\fP \fIrelease\fP
Specify the project and \fIrelease\fP number for the generated
manpage.
.SH EXAMPLE
The following example displays C code and comments to generate a manpage
foobar.3:
.PP
.nf
.fam C
     /** 3
      * foobar - a sample dummy function
      * This line is now the first of the description section.
      * Note that function parameters parm1 and parm2 are highlighted
      * in the generated man page.
      */
     int foobar(char *parm1, int parm2)
     {
        \.\.\.
        return 0;
     }

.fam T
.fi
.SH SEE ALSO
\fBtxt2man\fP(1), \fBbookman\fP(1).
.SH AUTHOR
Marc Vertes <mvertes@free.fr>