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

Diff for /mandoc/Attic/mdoc.3 between version 1.38 and 1.44

version 1.38, 2010/05/25 21:38:05 version 1.44, 2010/06/27 16:18:13
Line 18 
Line 18 
 .Dt MDOC 3  .Dt MDOC 3
 .Os  .Os
 .Sh NAME  .Sh NAME
   .Nm mdoc ,
 .Nm mdoc_alloc ,  .Nm mdoc_alloc ,
 .Nm mdoc_endparse ,  .Nm mdoc_endparse ,
 .Nm mdoc_free ,  .Nm mdoc_free ,
Line 28 
Line 29 
 .Nd mdoc macro compiler library  .Nd mdoc macro compiler library
 .Sh SYNOPSIS  .Sh SYNOPSIS
 .In mandoc.h  .In mandoc.h
   .In regs.h
 .In mdoc.h  .In mdoc.h
 .Vt extern const char * const * mdoc_macronames;  .Vt extern const char * const * mdoc_macronames;
 .Vt extern const char * const * mdoc_argnames;  .Vt extern const char * const * mdoc_argnames;
 .Ft "struct mdoc *"  .Ft "struct mdoc *"
 .Fn mdoc_alloc "void *data" "int pflags" "mandocmsg msgs"  .Fo mdoc_alloc
   .Fa "struct regset *regs"
   .Fa "void *data"
   .Fa "int pflags"
   .Fa "mandocmsg msgs"
   .Fc
 .Ft int  .Ft int
 .Fn mdoc_endparse "struct mdoc *mdoc"  .Fn mdoc_endparse "struct mdoc *mdoc"
 .Ft void  .Ft void
Line 42 
Line 49 
 .Ft "const struct mdoc_node *"  .Ft "const struct mdoc_node *"
 .Fn mdoc_node "const struct mdoc *mdoc"  .Fn mdoc_node "const struct mdoc *mdoc"
 .Ft int  .Ft int
 .Fn mdoc_parseln "struct mdoc *mdoc" "int line" "char *buf"  .Fo mdoc_parseln
   .Fa "struct mdoc *mdoc"
   .Fa "int line"
   .Fa "char *buf"
   .Fc
 .Ft int  .Ft int
 .Fn mdoc_reset "struct mdoc *mdoc"  .Fn mdoc_reset "struct mdoc *mdoc"
 .Sh DESCRIPTION  .Sh DESCRIPTION
Line 111  Function descriptions follow:
Line 122  Function descriptions follow:
 Allocates a parsing structure.  Allocates a parsing structure.
 The  The
 .Fa data  .Fa data
 pointer is passed to callbacks in  pointer is passed to
 .Fa cb ,  .Fa msgs .
 which are documented further in the header file.  
 The  The
 .Fa pflags  .Fa pflags
 arguments are defined in  arguments are defined in
Line 221  where capitalised non-terminals represent nodes.
Line 231  where capitalised non-terminals represent nodes.
 .It mnode  .It mnode
 \(<- BLOCK | ELEMENT | TEXT  \(<- BLOCK | ELEMENT | TEXT
 .It BLOCK  .It BLOCK
 \(<- (HEAD [TEXT])+ [BODY [TEXT]] [TAIL [TEXT]]  \(<- HEAD [TEXT] (BODY [TEXT])+ [TAIL [TEXT]]
 .It BLOCK  
 \(<- BODY [TEXT] [TAIL [TEXT]]  
 .It ELEMENT  .It ELEMENT
 \(<- TEXT*  \(<- TEXT*
 .It HEAD  .It HEAD
Line 237  where capitalised non-terminals represent nodes.
Line 245  where capitalised non-terminals represent nodes.
 .El  .El
 .Pp  .Pp
 Of note are the TEXT nodes following the HEAD, BODY and TAIL nodes of  Of note are the TEXT nodes following the HEAD, BODY and TAIL nodes of
 the BLOCK production.  the BLOCK production: these refer to punctuation marks.
 These refer to punctuation marks.  
 Furthermore, although a TEXT node will generally have a non-zero-length  Furthermore, although a TEXT node will generally have a non-zero-length
 string, in the specific case of  string, in the specific case of
 .Sq \&.Bd \-literal ,  .Sq \&.Bd \-literal ,
 an empty line will produce a zero-length string.  an empty line will produce a zero-length string.
   Multiple body parts are only found in invocations of
   .Sq \&Bl \-column ,
   where a new body introduces a new phrase.
 .Sh EXAMPLES  .Sh EXAMPLES
 The following example reads lines from stdin and parses them, operating  The following example reads lines from stdin and parses them, operating
 on the finished parse tree with  on the finished parse tree with
 .Fn parsed .  .Fn parsed .
 This example does not error-check nor free memory upon failure.  This example does not error-check nor free memory upon failure.
 .Bd -literal -offset indent  .Bd -literal -offset indent
   struct regset regs;
 struct mdoc *mdoc;  struct mdoc *mdoc;
 const struct mdoc_node *node;  const struct mdoc_node *node;
 char *buf;  char *buf;
 size_t len;  size_t len;
 int line;  int line;
   
   bzero(&regs, sizeof(struct regset));
 line = 1;  line = 1;
 mdoc = mdoc_alloc(NULL, 0, NULL);  mdoc = mdoc_alloc(&regs, NULL, 0, NULL);
 buf = NULL;  buf = NULL;
 alloc_len = 0;  alloc_len = 0;
   

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

CVSweb