version 1.25, 2014/08/05 05:48:56 |
version 1.26, 2014/09/03 23:21:47 |
|
|
.Nm mparse_free , |
.Nm mparse_free , |
.Nm mparse_getkeep , |
.Nm mparse_getkeep , |
.Nm mparse_keep , |
.Nm mparse_keep , |
|
.Nm mparse_open , |
.Nm mparse_readfd , |
.Nm mparse_readfd , |
.Nm mparse_reset , |
.Nm mparse_reset , |
.Nm mparse_result , |
.Nm mparse_result , |
.Nm mparse_strerror , |
.Nm mparse_strerror , |
.Nm mparse_strlevel |
.Nm mparse_strlevel |
|
.Nm mparse_wait , |
.Nd mandoc macro compiler library |
.Nd mandoc macro compiler library |
.Sh LIBRARY |
.Sh LIBRARY |
.Lb libmandoc |
.Lb libmandoc |
|
|
.Fa "struct mparse *parse" |
.Fa "struct mparse *parse" |
.Fc |
.Fc |
.Ft "enum mandoclevel" |
.Ft "enum mandoclevel" |
|
.Fo mparse_open |
|
.Fa "struct mparse *parse" |
|
.Fa "int *fd" |
|
.Fa "const char *fname" |
|
.Fa "pid_t *child_pid" |
|
.Fc |
|
.Ft "enum mandoclevel" |
.Fo mparse_readfd |
.Fo mparse_readfd |
.Fa "struct mparse *parse" |
.Fa "struct mparse *parse" |
.Fa "int fd" |
.Fa "int fd" |
|
|
.Fo mparse_strlevel |
.Fo mparse_strlevel |
.Fa "enum mandoclevel" |
.Fa "enum mandoclevel" |
.Fc |
.Fc |
|
.Ft "enum mandoclevel" |
|
.Fo mparse_wait |
|
.Fa "struct mparse *parse" |
|
.Fa "pid_t child_pid" |
|
.Fc |
.In sys/types.h |
.In sys/types.h |
.In mandoc.h |
.In mandoc.h |
.In mdoc.h |
.In mdoc.h |
|
|
.In mandoc.h , |
.In mandoc.h , |
implemented in |
implemented in |
.Pa read.c . |
.Pa read.c . |
|
.It Fn mparse_open |
|
If the |
|
.Fa fname |
|
ends in |
|
.Pa .gz , |
|
open with |
|
.Xr gunzip 1 ; |
|
otherwise, with |
|
.Xr open 2 . |
|
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 |
.It Fn mparse_readfd |
Parse a file or file descriptor. |
Parse a file or file descriptor. |
If |
If |
|
|
.Pa read.c . |
.Pa read.c . |
.It Fn mparse_strlevel |
.It Fn mparse_strlevel |
Return a statically-allocated string representation of a level code. |
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 |
|
.Fa child_pid |
|
that was spawned with |
|
.Fn mparse_open . |
|
To be called after the parse sequence is complete. |
|
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 |
Declared in |
.In mandoc.h , |
.In mandoc.h , |
implemented in |
implemented in |