=================================================================== RCS file: /cvs/mandoc/mandoc.3,v retrieving revision 1.31 retrieving revision 1.34 diff -u -p -r1.31 -r1.34 --- mandoc/mandoc.3 2015/01/15 04:26:40 1.31 +++ mandoc/mandoc.3 2016/01/08 02:13:39 1.34 @@ -1,4 +1,4 @@ -.\" $Id: mandoc.3,v 1.31 2015/01/15 04:26:40 schwarze Exp $ +.\" $Id: mandoc.3,v 1.34 2016/01/08 02:13:39 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons .\" Copyright (c) 2010, 2013, 2014, 2015 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: January 15 2015 $ +.Dd $Mdocdate: January 8 2016 $ .Dt MANDOC 3 .Os .Sh NAME @@ -37,7 +37,6 @@ .Nm mparse_result , .Nm mparse_strerror , .Nm mparse_strlevel -.Nm mparse_wait , .Nd mandoc macro compiler library .Sh SYNOPSIS .In sys/types.h @@ -51,7 +50,6 @@ .Fa "int options" .Fa "enum mandoclevel wlevel" .Fa "mandocmsg mmsg" -.Fa "const struct mchars *mchars" .Fa "char *defos" .Fc .Ft void @@ -106,10 +104,6 @@ .Fo mparse_strlevel .Fa "enum mandoclevel" .Fc -.Ft "enum mandoclevel" -.Fo mparse_wait -.Fa "struct mparse *parse" -.Fc .In sys/types.h .In mandoc.h .In mdoc.h @@ -183,6 +177,9 @@ or parse it with .Fn mparse_readfd ; .It +close it with +.Xr close 2 ; +.It retrieve the syntax tree with .Fn mparse_result ; .It @@ -215,12 +212,6 @@ An error or warning message during parsing. A classification of an .Vt "enum mandocerr" as regards system operation. -.It Vt "struct mchars" -An opaque pointer to a a character table. -Created with -.Xr mchars_alloc 3 -and freed with -.Xr mchars_free 3 . .It Vt "struct mparse" An opaque pointer to a running parse sequence. Created with @@ -345,9 +336,6 @@ A callback function to handle errors and warnings. See .Pa main.c for an example. -.It Ar mchars -An opaque pointer to a a character table obtained from -.Xr mchars_alloc 3 . .It Ar defos A default string for the .Xr mdoc 7 @@ -392,20 +380,14 @@ Declared in implemented in .Pa read.c . .It Fn mparse_open -If the +Open the file for reading. +If that fails and .Fa fname -ends in -.Pa .gz , -open with -.Xr gunzip 1 ; -otherwise, with -.Xr open 2 . -If -.Xr open 2 -fails, append -.Pa .gz -and try with -.Xr gunzip 1 . +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 in .Fa fd , or -1 on failure. @@ -423,10 +405,9 @@ 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, +.Xr close 2 +and .Fn mparse_reset should be invoked between parses. Declared in @@ -456,28 +437,6 @@ implemented in .Pa read.c . .It Fn mparse_strlevel Return a statically-allocated string representation of a level code. -Declared in -.In mandoc.h , -implemented in -.Pa read.c . -.It Fn mparse_wait -Bury a -.Xr gunzip 1 -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 -.Dv MANDOCLEVEL_SYSERR -on failure, that is, when -.Xr wait 2 -fails, or when -.Xr gunzip 1 -died from a signal or exited with non-zero status. Declared in .In mandoc.h , implemented in