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

Diff for /mandoc/mandoc.3 between version 1.41 and 1.44

version 1.41, 2017/07/04 23:40:01 version 1.44, 2018/12/30 00:49:55
Line 21 
Line 21 
 .Sh NAME  .Sh NAME
 .Nm mandoc ,  .Nm mandoc ,
 .Nm deroff ,  .Nm deroff ,
 .Nm mandocmsg ,  
 .Nm man_mparse ,  
 .Nm man_validate ,  
 .Nm mdoc_validate ,  
 .Nm mparse_alloc ,  .Nm mparse_alloc ,
   .Nm mparse_copy ,
 .Nm mparse_free ,  .Nm mparse_free ,
 .Nm mparse_getkeep ,  
 .Nm mparse_keep ,  
 .Nm mparse_open ,  .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_strlevel ,  
 .Nm mparse_updaterc  
 .Nd mandoc macro compiler library  .Nd mandoc macro compiler library
 .Sh SYNOPSIS  .Sh SYNOPSIS
 .In sys/types.h  .In sys/types.h
   .In stdio.h
 .In mandoc.h  .In mandoc.h
 .Pp  .Pp
 .Fd "#define ASCII_NBRSP"  .Fd "#define ASCII_NBRSP"
Line 47 
Line 40 
 .Ft struct mparse *  .Ft struct mparse *
 .Fo mparse_alloc  .Fo mparse_alloc
 .Fa "int options"  .Fa "int options"
 .Fa "enum mandocerr mmin"  
 .Fa "mandocmsg mmsg"  
 .Fa "enum mandoc_os oe_e"  .Fa "enum mandoc_os oe_e"
 .Fa "char *os_s"  .Fa "char *os_s"
 .Fc  .Fc
 .Ft void  .Ft void
 .Fo (*mandocmsg)  
 .Fa "enum mandocerr errtype"  
 .Fa "enum mandoclevel level"  
 .Fa "const char *file"  
 .Fa "int line"  
 .Fa "int col"  
 .Fa "const char *msg"  
 .Fc  
 .Ft void  
 .Fo mparse_free  .Fo mparse_free
 .Fa "struct mparse *parse"  .Fa "struct mparse *parse"
 .Fc  .Fc
 .Ft const char *  .Ft void
 .Fo mparse_getkeep  .Fo mparse_copy
 .Fa "const struct mparse *parse"  .Fa "const struct mparse *parse"
 .Fc  .Fc
 .Ft void  
 .Fo mparse_keep  
 .Fa "struct mparse *parse"  
 .Fc  
 .Ft int  .Ft int
 .Fo mparse_open  .Fo mparse_open
 .Fa "struct mparse *parse"  .Fa "struct mparse *parse"
 .Fa "const char *fname"  .Fa "const char *fname"
 .Fc  .Fc
 .Ft "enum mandoclevel"  .Ft void
 .Fo mparse_readfd  .Fo mparse_readfd
 .Fa "struct mparse *parse"  .Fa "struct mparse *parse"
 .Fa "int fd"  .Fa "int fd"
Line 88 
Line 66 
 .Fo mparse_reset  .Fo mparse_reset
 .Fa "struct mparse *parse"  .Fa "struct mparse *parse"
 .Fc  .Fc
 .Ft void  .Ft struct roff_meta *
 .Fo mparse_result  .Fo mparse_result
 .Fa "struct mparse *parse"  .Fa "struct mparse *parse"
 .Fa "struct roff_man **man"  
 .Fa "char **sodest"  
 .Fc  .Fc
 .Ft "const char *"  
 .Fo mparse_strerror  
 .Fa "enum mandocerr"  
 .Fc  
 .Ft "const char *"  
 .Fo mparse_strlevel  
 .Fa "enum mandoclevel"  
 .Fc  
 .Ft void  
 .Fo mparse_updaterc  
 .Fa "struct mparse *parse"  
 .Fa "enum mandoclevel *rc"  
 .Fc  
 .In roff.h  .In roff.h
 .Ft void  .Ft void
 .Fo deroff  .Fo deroff
Line 118 
Line 81 
 .In mdoc.h  .In mdoc.h
 .Vt extern const char * const * mdoc_argnames;  .Vt extern const char * const * mdoc_argnames;
 .Vt extern const char * const * mdoc_macronames;  .Vt extern const char * const * mdoc_macronames;
 .Ft void  
 .Fo mdoc_validate  
 .Fa "struct roff_man *mdoc"  
 .Fc  
 .In sys/types.h  .In sys/types.h
 .In mandoc.h  .In mandoc.h
 .In man.h  .In man.h
 .Vt extern const char * const * man_macronames;  .Vt extern const char * const * man_macronames;
 .Ft "const struct mparse *"  
 .Fo man_mparse  
 .Fa "const struct roff_man *man"  
 .Fc  
 .Ft void  
 .Fo man_validate  
 .Fa "struct roff_man *man"  
 .Fc  
 .Sh DESCRIPTION  .Sh DESCRIPTION
 The  The
 .Nm mandoc  .Nm mandoc
Line 174  close it with
Line 125  close it with
 retrieve the syntax tree with  retrieve the syntax tree with
 .Fn mparse_result ;  .Fn mparse_result ;
 .It  .It
 depending on whether the  
 .Fa macroset  
 member of the returned  
 .Vt struct roff_man  
 is  
 .Dv MACROSET_MDOC  
 or  
 .Dv MACROSET_MAN ,  
 validate it with  
 .Fn mdoc_validate  
 or  
 .Fn man_validate ,  
 respectively;  
 .It  
 if information about the validity of the input is needed, fetch it with  if information about the validity of the input is needed, fetch it with
 .Fn mparse_updaterc ;  .Fn mparse_updaterc ;
 .It  .It
 iterate over parse nodes with starting from the  iterate over parse nodes with starting from the
 .Fa first  .Fa first
 member of the returned  member of the returned
 .Vt struct roff_man ;  .Vt struct roff_meta ;
 .It  .It
 free all allocated memory with  free all allocated memory with
 .Fn mparse_free  .Fn mparse_free
Line 232  and freed with
Line 169  and freed with
 This may be used across parsed input if  This may be used across parsed input if
 .Fn mparse_reset  .Fn mparse_reset
 is called between parses.  is called between parses.
 .It Vt "mandocmsg"  
 A prototype for a function to handle error and warning  
 messages emitted by the parser.  
 .El  .El
 .Ss Functions  .Ss Functions
 .Bl -ohang  .Bl -ohang
Line 245  including text contained in its child nodes.
Line 179  including text contained in its child nodes.
 To be used on children of the  To be used on children of the
 .Fa first  .Fa first
 member of  member of
 .Vt struct roff_man .  .Vt struct roff_meta .
 When it is no longer needed, the pointer returned from  When it is no longer needed, the pointer returned from
 .Fn deroff  .Fn deroff
 can be passed to  can be passed to
 .Xr free 3 .  .Xr free 3 .
 .It Fn man_mparse  
 Get the parser used for the current output.  
 Declared in  
 .In man.h ,  
 implemented in  
 .Pa man.c .  
 .It Fn man_validate  
 Validate the  
 .Dv MACROSET_MAN  
 parse tree obtained with  
 .Fn mparse_result .  
 Declared in  
 .In man.h ,  
 implemented in  
 .Pa man.c .  
 .It Fn mdoc_validate  
 Validate the  
 .Dv MACROSET_MDOC  
 parse tree obtained with  
 .Fn mparse_result .  
 Declared in  
 .In mdoc.h ,  
 implemented in  
 .Pa mdoc.c .  
 .It Fn mparse_alloc  .It Fn mparse_alloc
 Allocate a parser.  Allocate a parser.
 The arguments have the following effect:  The arguments have the following effect:
Line 295  file inclusion requests are always honoured.
Line 205  file inclusion requests are always honoured.
 Otherwise, if the request is the only content in an input file,  Otherwise, if the request is the only content in an input file,
 only the file name is remembered, to be returned in the  only the file name is remembered, to be returned in the
 .Fa sodest  .Fa sodest
 argument of  field of
 .Fn mparse_result .  .Vt struct roff_meta .
 .Pp  .Pp
 When the  When the
 .Dv MPARSE_QUICK  .Dv MPARSE_QUICK
Line 305  This is for example useful in
Line 215  This is for example useful in
 .Xr makewhatis 8  .Xr makewhatis 8
 .Fl Q  .Fl Q
 to quickly build minimal databases.  to quickly build minimal databases.
 .It Ar mmin  .Pp
 Can be set to  When the
 .Dv MANDOCERR_BASE ,  .Dv MARSE_VALIDATE
 .Dv MANDOCERR_STYLE ,  bit is set,
 .Dv MANDOCERR_WARNING ,  .Fn mparse_result
 .Dv MANDOCERR_ERROR ,  runs the validation functions before returning the syntax tree.
 .Dv MANDOCERR_UNSUPP ,  This is almost always required, except in certain debugging scenarios,
 or  for example to dump unvalidated syntax trees.
 .Dv MANDOCERR_MAX .  
 Messages below the selected level will be suppressed.  
 .It Ar mmsg  
 A callback function to handle errors and warnings.  
 See  
 .Pa main.c  
 for an example.  
 If printing of error messages is not desired,  
 .Dv NULL  
 may be passed.  
 .It Ar os_e  .It Ar os_e
 Operating system to check base system conventions for.  Operating system to check base system conventions for.
 If  If
Line 361  Declared in
Line 261  Declared in
 .In mandoc.h ,  .In mandoc.h ,
 implemented in  implemented in
 .Pa read.c .  .Pa read.c .
 .It Fn mparse_getkeep  .It Fn mparse_copy
 Acquire the keep buffer.  Dump a copy of the input to the standard output; used for
 Must follow a call of  .Fl man T Ns Cm man .
 .Fn mparse_keep .  
 Declared in  Declared in
 .In mandoc.h ,  .In mandoc.h ,
 implemented in  implemented in
 .Pa read.c .  .Pa read.c .
 .It Fn mparse_keep  
 Instruct the parser to retain a copy of its parsed input.  
 This can be acquired with subsequent  
 .Fn mparse_getkeep  
 calls.  
 Declared in  
 .In mandoc.h ,  
 implemented in  
 .Pa read.c .  
 .It Fn mparse_open  .It Fn mparse_open
 Open the file for reading.  Open the file for reading.
 If that fails and  If that fails and
Line 421  implemented in
Line 311  implemented in
 .Pa read.c .  .Pa read.c .
 .It Fn mparse_result  .It Fn mparse_result
 Obtain the result of a parse.  Obtain the result of a parse.
 One of the two pointers will be filled in.  
 Declared in  
 .In mandoc.h ,  
 implemented in  
 .Pa read.c .  
 .It Fn mparse_strerror  
 Return a statically-allocated string representation of an error code.  
 Declared in  
 .In mandoc.h ,  
 implemented in  
 .Pa read.c .  
 .It Fn mparse_strlevel  
 Return a statically-allocated string representation of a level code.  
 Declared in  
 .In mandoc.h ,  
 implemented in  
 .Pa read.c .  
 .It Fn mparse_updaterc  
 If the highest warning or error level that occurred during the current  
 .Fa parse  
 is higher than  
 .Pf * Fa rc ,  
 update  
 .Pf * Fa rc  
 accordingly.  
 This is useful after calling  
 .Fn mdoc_validate  
 or  
 .Fn man_validate .  
 Declared in  Declared in
 .In mandoc.h ,  .In mandoc.h ,
 implemented in  implemented in

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.44

CVSweb