=================================================================== RCS file: /cvs/mandoc/Attic/mdoc.3,v retrieving revision 1.52 retrieving revision 1.57 diff -u -p -r1.52 -r1.57 --- mandoc/Attic/mdoc.3 2011/01/01 12:18:37 1.52 +++ mandoc/Attic/mdoc.3 2011/02/09 09:18:15 1.57 @@ -1,4 +1,4 @@ -.\" $Id: mdoc.3,v 1.52 2011/01/01 12:18:37 kristaps Exp $ +.\" $Id: mdoc.3,v 1.57 2011/02/09 09:18:15 kristaps Exp $ .\" .\" Copyright (c) 2009, 2010 Kristaps Dzonsons .\" Copyright (c) 2010 Ingo Schwarze @@ -15,11 +15,13 @@ .\" 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 1 2011 $ +.Dd $Mdocdate: February 9 2011 $ .Dt MDOC 3 .Os .Sh NAME .Nm mdoc , +.Nm mdoc_addeqn , +.Nm mdoc_addspan , .Nm mdoc_alloc , .Nm mdoc_endparse , .Nm mdoc_free , @@ -34,8 +36,13 @@ .Vt extern const char * const * mdoc_macronames; .Vt extern const char * const * mdoc_argnames; .Ft int -.Fo mdoc_addspan +.Fo mdoc_addeqn .Fa "struct mdoc *mdoc" +.Fa "const struct eqn *eqn" +.Fc +.Ft int +.Fo mdoc_addspan +.Fa "struct mdoc *mdoc" .Fa "const struct tbl_span *span" .Fc .Ft "struct mdoc *" @@ -96,7 +103,21 @@ See for details. .El .Ss Functions +If +.Fn mdoc_addeqn , +.Fn mdoc_addspan , +.Fn mdoc_parseln , +or +.Fn mdoc_endparse +return 0, calls to any function but +.Fn mdoc_reset +or +.Fn mdoc_free +will raise an assertion. .Bl -ohang +.It Fn mdoc_addeqn +Add an equation to the parsing stream. +Returns 0 on failure, 1 on success. .It Fn mdoc_addspan Add a table span to the parsing stream. Returns 0 on failure, 1 on success. @@ -106,8 +127,8 @@ The .Fa data pointer is passed to .Fa msgs . -Returns NULL on failure. -If non-NULL, the pointer must be freed with +Always returns a valid pointer. +The pointer must be freed with .Fn mdoc_free . .It Fn mdoc_reset Reset the parser for another parse routine. @@ -127,26 +148,11 @@ The input buffer is modified by this function. .It Fn mdoc_endparse Signals that the parse is complete. -Note that if -.Fn mdoc_endparse -is called subsequent to -.Fn mdoc_node , -the resulting tree is incomplete. Returns 0 on failure, 1 on success. .It Fn mdoc_node Returns the first node of the parse. -Note that if -.Fn mdoc_parseln -or -.Fn mdoc_endparse -return 0, the tree will be incomplete. .It Fn mdoc_meta Returns the document's parsed meta-data. -If this information has not yet been supplied or -.Fn mdoc_parseln -or -.Fn mdoc_endparse -return 0, the data will be incomplete. .El .Ss Variables .Bl -ohang