-.\" $Id: mandoc.3,v 1.32 2015/07/19 06:05:16 schwarze Exp $
+.\" $Id: mandoc.3,v 1.36 2016/01/08 17:48:09 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
-.\" Copyright (c) 2010, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 19 2015 $
+.Dd $Mdocdate: January 8 2016 $
.Dt MANDOC 3
.Os
.Sh NAME
.Fa "int options"
.Fa "enum mandoclevel wlevel"
.Fa "mandocmsg mmsg"
-.Fa "const struct mchars *mchars"
.Fa "char *defos"
.Fc
.Ft void
.Fo mparse_keep
.Fa "struct mparse *parse"
.Fc
-.Ft "enum mandoclevel"
+.Ft int
.Fo mparse_open
.Fa "struct mparse *parse"
-.Fa "int *fd"
.Fa "const char *fname"
.Fc
.Ft "enum mandoclevel"
parse it with
.Fn mparse_readfd ;
.It
+close it with
+.Xr close 2 ;
+.It
retrieve the syntax tree with
.Fn mparse_result ;
.It
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
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
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.
+Return a file descriptor open for reading or -1 on failure.
It can be passed to
.Fn mparse_readfd
or used directly.
Pass the associated filename in
.Va fname .
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
fields), its position in the tree (the
.Va parent ,
.Va child ,
-.Va nchild ,
+.Va last ,
.Va next
and
.Va prev