=================================================================== RCS file: /cvs/mandoc/Attic/mdoc.3,v retrieving revision 1.25 retrieving revision 1.32 diff -u -p -r1.25 -r1.32 --- mandoc/Attic/mdoc.3 2009/03/27 14:56:15 1.25 +++ mandoc/Attic/mdoc.3 2009/07/19 08:34:59 1.32 @@ -1,23 +1,21 @@ -.\" $Id: mdoc.3,v 1.25 2009/03/27 14:56:15 kristaps Exp $ +.\" $Id: mdoc.3,v 1.32 2009/07/19 08:34:59 kristaps Exp $ .\" -.\" Copyright (c) 2009 Kristaps Dzonsons +.\" Copyright (c) 2009 Kristaps Dzonsons .\" .\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the -.\" above copyright notice and this permission notice appear in all -.\" copies. +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL -.\" WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -.\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -.\" AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -.\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -.\" PERFORMANCE OF THIS SOFTWARE. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 27 2009 $ -.Dt mdoc 3 +.Dd $Mdocdate: July 19 2009 $ +.Dt MDOC 3 .Os .\" SECTION .Sh NAME @@ -36,16 +34,16 @@ .Vt extern const char * const * mdoc_argnames; .Ft "struct mdoc *" .Fn mdoc_alloc "void *data" "int pflags" "const struct mdoc_cb *cb" -.Ft void +.Ft int .Fn mdoc_reset "struct mdoc *mdoc" .Ft void .Fn mdoc_free "struct mdoc *mdoc" .Ft int .Fn mdoc_parseln "struct mdoc *mdoc" "int line" "char *buf" .Ft "const struct mdoc_node *" -.Fn mdoc_node "struct mdoc *mdoc" +.Fn mdoc_node "const struct mdoc *mdoc" .Ft "const struct mdoc_meta *" -.Fn mdoc_meta "struct mdoc *mdoc" +.Fn mdoc_meta "const struct mdoc *mdoc" .Ft int .Fn mdoc_endparse "struct mdoc *mdoc" .\" SECTION @@ -133,7 +131,8 @@ Returns NULL on failure. If non-NULL, the pointer mus .It Fn mdoc_reset Reset the parser for another parse routine. After its use, .Fn mdoc_parseln -behaves as if invoked for the first time. +behaves as if invoked for the first time. If it returns 0, memory could +not be allocated. .\" LIST-ITEM .It Fn mdoc_free Free all resources of a parser. The pointer is no longer valid after @@ -266,7 +265,7 @@ will truncate the file's last character (see Further, this example does not error-check nor free memory upon failure. .Bd -literal -offset "XXXX" struct mdoc *mdoc; -struct mdoc_node *node; +const struct mdoc_node *node; char *buf; size_t len; int line; @@ -298,7 +297,7 @@ mdoc_free(mdoc); The .Nm utility was written by -.An Kristaps Dzonsons Aq kristaps@openbsd.org . +.An Kristaps Dzonsons Aq kristaps@kth.se . .\" SECTION .Sh CAVEATS .Bl -dash -compact @@ -334,12 +333,4 @@ Columns widths in should default to width .Qq if not included. -.\" LIST-ITEM -.It -List-width suffix -.Qq m -isn't handled. -.\" LIST-ITEM -.It -Contents of the SYNOPSIS section aren't checked. .El