=================================================================== RCS file: /cvs/mandoc/mandoc.3,v retrieving revision 1.27 retrieving revision 1.30 diff -u -p -r1.27 -r1.30 --- mandoc/mandoc.3 2014/10/28 17:36:19 1.27 +++ mandoc/mandoc.3 2015/01/15 02:29:26 1.30 @@ -1,4 +1,4 @@ -.\" $Id: mandoc.3,v 1.27 2014/10/28 17:36:19 schwarze Exp $ +.\" $Id: mandoc.3,v 1.30 2015/01/15 02:29:26 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons .\" Copyright (c) 2010 Ingo Schwarze @@ -15,7 +15,7 @@ .\" 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 28 2014 $ +.Dd $Mdocdate: January 15 2015 $ .Dt MANDOC 3 .Os .Sh NAME @@ -81,7 +81,6 @@ .Fa "struct mparse *parse" .Fa "int *fd" .Fa "const char *fname" -.Fa "pid_t *child_pid" .Fc .Ft "enum mandoclevel" .Fo mparse_readfd @@ -111,7 +110,6 @@ .Ft "enum mandoclevel" .Fo mparse_wait .Fa "struct mparse *parse" -.Fa "pid_t child_pid" .Fc .In sys/types.h .In mandoc.h @@ -178,7 +176,9 @@ initiate a parsing sequence with and .Fn mparse_alloc ; .It -parse files or file descriptors with +parse files with +.Fn mparse_open +and .Fn mparse_readfd ; .It retrieve a parsed syntax tree, if the parse was successful, with @@ -398,36 +398,33 @@ open with .Xr gunzip 1 ; otherwise, with .Xr open 2 . +If +.Xr open 2 +fails, append +.Pa .gz +and try with +.Xr gunzip 1 . Return a file descriptor open for reading in .Fa fd , or -1 on failure. It can be passed to .Fn mparse_readfd or used directly. -If applicable, return the -.Xr gunzip 1 -child process ID in -.Fa child_pid , -or otherwise 0. -If non-zero, it should be passed to -.Fn mparse_wait -after completing the parse sequence. Declared in .In mandoc.h , implemented in .Pa read.c . .It Fn mparse_readfd -Parse a file or file descriptor. -If -.Va fd -is -1, -.Va fname -is opened for reading. -Otherwise, -.Va fname -is assumed to be the name associated with -.Va fd . -This may be called multiple times with different parameters; however, +Parse a file descriptor opened with +.Xr open 2 +or +.Fn mparse_open . +Pass the associated filename in +.Va fname . +Calls +.Fn mparse_wait +before returning. +This function may be called multiple times with different parameters; however, .Fn mparse_reset should be invoked between parses. Declared in @@ -471,11 +468,12 @@ implemented in .It Fn mparse_wait Bury a .Xr gunzip 1 -child process -.Fa child_pid -that was spawned with +child process that was spawned with .Fn mparse_open . To be called after the parse sequence is complete. +Not needed after +.Fn mparse_readfd , +but does no harm in that case, either. Returns .Dv MANDOCLEVEL_OK on success and