[BACK]Return to mandoc.3 CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/mandoc.3 between version 1.25 and 1.30

version 1.25, 2014/08/05 05:48:56 version 1.30, 2015/01/15 02:29:26
Line 31 
Line 31 
 .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
Line 50 
Line 52 
 .Fa "int options"  .Fa "int options"
 .Fa "enum mandoclevel wlevel"  .Fa "enum mandoclevel wlevel"
 .Fa "mandocmsg mmsg"  .Fa "mandocmsg mmsg"
   .Fa "const struct mchars *mchars"
 .Fa "char *defos"  .Fa "char *defos"
 .Fc  .Fc
 .Ft void  .Ft void
Line 74 
Line 77 
 .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"
   .Fc
   .Ft "enum mandoclevel"
 .Fo mparse_readfd  .Fo mparse_readfd
 .Fa "struct mparse *parse"  .Fa "struct mparse *parse"
 .Fa "int fd"  .Fa "int fd"
Line 98 
Line 107 
 .Fo mparse_strlevel  .Fo mparse_strlevel
 .Fa "enum mandoclevel"  .Fa "enum mandoclevel"
 .Fc  .Fc
   .Ft "enum mandoclevel"
   .Fo mparse_wait
   .Fa "struct mparse *parse"
   .Fc
 .In sys/types.h  .In sys/types.h
 .In mandoc.h  .In mandoc.h
 .In mdoc.h  .In mdoc.h
Line 159  The following describes a general parse sequence:
Line 172  The following describes a general parse sequence:
 .Bl -enum  .Bl -enum
 .It  .It
 initiate a parsing sequence with  initiate a parsing sequence with
   .Xr mchars_alloc 3
   and
 .Fn mparse_alloc ;  .Fn mparse_alloc ;
 .It  .It
 parse files or file descriptors with  parse files with
   .Fn mparse_open
   and
 .Fn mparse_readfd ;  .Fn mparse_readfd ;
 .It  .It
 retrieve a parsed syntax tree, if the parse was successful, with  retrieve a parsed syntax tree, if the parse was successful, with
Line 173  or
Line 190  or
 .Fn man_node ;  .Fn man_node ;
 .It  .It
 free all allocated memory with  free all allocated memory with
 .Fn mparse_free ,  .Fn mparse_free
   and
   .Xr mchars_free 3 ,
 or invoke  or invoke
 .Fn mparse_reset  .Fn mparse_reset
 and parse new files.  and parse new files.
Line 194  A fatal error, error, or warning message during parsin
Line 213  A fatal error, error, or warning message during parsin
 A classification of an  A classification of an
 .Vt "enum mandocerr"  .Vt "enum mandocerr"
 as regards system operation.  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"  .It Vt "struct mparse"
 An opaque pointer to a running parse sequence.  An opaque pointer to a running parse sequence.
 Created with  Created with
Line 318  A callback function to handle errors and warnings.
Line 343  A callback function to handle errors and warnings.
 See  See
 .Pa main.c  .Pa main.c
 for an example.  for an example.
   .It Ar mchars
   An opaque pointer to a a character table obtained from
   .Xr mchars_alloc 3 .
 .It Ar defos  .It Ar defos
 A default string for the  A default string for the
 .Xr mdoc 7  .Xr mdoc 7
Line 361  Declared in
Line 389  Declared in
 .In mandoc.h ,  .In mandoc.h ,
 implemented in  implemented in
 .Pa read.c .  .Pa read.c .
 .It Fn mparse_readfd  .It Fn mparse_open
 Parse a file or file descriptor.  If the
   .Fa fname
   ends in
   .Pa .gz ,
   open with
   .Xr gunzip 1 ;
   otherwise, with
   .Xr open 2 .
 If  If
 .Va fd  .Xr open 2
 is -1,  fails, append
 .Va fname  .Pa .gz
 is opened for reading.  and try with
 Otherwise,  .Xr gunzip 1 .
 .Va fname  Return a file descriptor open for reading in
 is assumed to be the name associated with  .Fa fd ,
 .Va fd .  or -1 on failure.
 This may be called multiple times with different parameters; however,  It can be passed to
   .Fn mparse_readfd
   or used directly.
   Declared in
   .In mandoc.h ,
   implemented in
   .Pa read.c .
   .It Fn mparse_readfd
   Parse a file descriptor opened with
   .Xr open 2
   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,
 .Fn mparse_reset  .Fn mparse_reset
 should be invoked between parses.  should be invoked between parses.
 Declared in  Declared in
Line 409  implemented in
Line 461  implemented in
 .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 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  Declared in
 .In mandoc.h ,  .In mandoc.h ,
 implemented in  implemented in

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.30

CVSweb