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

Diff for /mandoc/mdoc.c between version 1.21 and 1.22

version 1.21, 2009/01/07 15:57:14 version 1.22, 2009/01/07 16:11:40
Line 121  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
Line 121  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
         { macro_obsolete, 0 }, /* Ot */          { macro_obsolete, 0 }, /* Ot */
         { macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */          { macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */
         { macro_constant, 0 }, /* Rv */          { macro_constant, 0 }, /* Rv */
         /* XXX - supposed to be (but isn't) callable. */          /* XXX - .St supposed to be (but isn't) callable. */
         { macro_constant_delimited, MDOC_PARSED }, /* St */          { macro_constant_delimited, MDOC_PARSED }, /* St */
         { macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Va */          { macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Va */
         { macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Vt */          { macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Vt */
Line 278  mdoc_parseln(struct mdoc *mdoc, int line, char *buf)
Line 278  mdoc_parseln(struct mdoc *mdoc, int line, char *buf)
         if ('.' != *buf) {          if ('.' != *buf) {
                 if (SEC_PROLOGUE == mdoc->sec_lastn)                  if (SEC_PROLOGUE == mdoc->sec_lastn)
                         return(mdoc_err(mdoc, -1, 0, ERR_SYNTAX_NOTEXT));                          return(mdoc_err(mdoc, -1, 0, ERR_SYNTAX_NOTEXT));
                 mdoc_word_alloc(mdoc, 0, buf);                  mdoc_word_alloc(mdoc, line, 0, buf);
                 mdoc->next = MDOC_NEXT_SIBLING;                  mdoc->next = MDOC_NEXT_SIBLING;
                 return(1);                  return(1);
         }          }
Line 376  mdoc_macro(struct mdoc *mdoc, int tok, 
Line 376  mdoc_macro(struct mdoc *mdoc, int tok, 
                 return(0);                  return(0);
         }          }
   
         return((*mdoc_macros[tok].fp)(mdoc, tok, line, ppos, pos, buf));          return((*mdoc_macros[tok].fp)(mdoc, tok,
                                   line, ppos, pos, buf));
 }  }
   
   
Line 478  mdoc_node_append(struct mdoc *mdoc, int pos, struct md
Line 479  mdoc_node_append(struct mdoc *mdoc, int pos, struct md
   
   
 void  void
 mdoc_tail_alloc(struct mdoc *mdoc, int pos, int tok)  mdoc_tail_alloc(struct mdoc *mdoc, int line, int pos, int tok)
 {  {
         struct mdoc_node *p;          struct mdoc_node *p;
   
Line 487  mdoc_tail_alloc(struct mdoc *mdoc, int pos, int tok)
Line 488  mdoc_tail_alloc(struct mdoc *mdoc, int pos, int tok)
   
         p = xcalloc(1, sizeof(struct mdoc_node));          p = xcalloc(1, sizeof(struct mdoc_node));
   
           p->line = line;
           p->pos = pos;
         p->type = MDOC_TAIL;          p->type = MDOC_TAIL;
         p->data.tail.tok = tok;          p->data.tail.tok = tok;
   
Line 495  mdoc_tail_alloc(struct mdoc *mdoc, int pos, int tok)
Line 498  mdoc_tail_alloc(struct mdoc *mdoc, int pos, int tok)
   
   
 void  void
 mdoc_head_alloc(struct mdoc *mdoc, int pos, int tok)  mdoc_head_alloc(struct mdoc *mdoc, int line, int pos, int tok)
 {  {
         struct mdoc_node *p;          struct mdoc_node *p;
   
Line 504  mdoc_head_alloc(struct mdoc *mdoc, int pos, int tok)
Line 507  mdoc_head_alloc(struct mdoc *mdoc, int pos, int tok)
   
         p = xcalloc(1, sizeof(struct mdoc_node));          p = xcalloc(1, sizeof(struct mdoc_node));
   
           p->line = line;
           p->pos = pos;
         p->type = MDOC_HEAD;          p->type = MDOC_HEAD;
         p->data.head.tok = tok;          p->data.head.tok = tok;
   
Line 512  mdoc_head_alloc(struct mdoc *mdoc, int pos, int tok)
Line 517  mdoc_head_alloc(struct mdoc *mdoc, int pos, int tok)
   
   
 void  void
 mdoc_body_alloc(struct mdoc *mdoc, int pos, int tok)  mdoc_body_alloc(struct mdoc *mdoc, int line, int pos, int tok)
 {  {
         struct mdoc_node *p;          struct mdoc_node *p;
   
Line 521  mdoc_body_alloc(struct mdoc *mdoc, int pos, int tok)
Line 526  mdoc_body_alloc(struct mdoc *mdoc, int pos, int tok)
   
         p = xcalloc(1, sizeof(struct mdoc_node));          p = xcalloc(1, sizeof(struct mdoc_node));
   
           p->line = line;
           p->pos = pos;
         p->type = MDOC_BODY;          p->type = MDOC_BODY;
         p->data.body.tok = tok;          p->data.body.tok = tok;
   
Line 529  mdoc_body_alloc(struct mdoc *mdoc, int pos, int tok)
Line 536  mdoc_body_alloc(struct mdoc *mdoc, int pos, int tok)
   
   
 void  void
 mdoc_block_alloc(struct mdoc *mdoc, int pos, int tok,  mdoc_block_alloc(struct mdoc *mdoc, int line, int pos,
                 size_t argsz, const struct mdoc_arg *args)                  int tok, size_t argsz, const struct mdoc_arg *args)
 {  {
         struct mdoc_node *p;          struct mdoc_node *p;
   
         p = xcalloc(1, sizeof(struct mdoc_node));          p = xcalloc(1, sizeof(struct mdoc_node));
   
           p->pos = pos;
           p->line = line;
         p->type = MDOC_BLOCK;          p->type = MDOC_BLOCK;
         p->data.block.tok = tok;          p->data.block.tok = tok;
         p->data.block.argc = argsz;          p->data.block.argc = argsz;
Line 546  mdoc_block_alloc(struct mdoc *mdoc, int pos, int tok,
Line 555  mdoc_block_alloc(struct mdoc *mdoc, int pos, int tok,
   
   
 void  void
 mdoc_elem_alloc(struct mdoc *mdoc, int pos, int tok,  mdoc_elem_alloc(struct mdoc *mdoc, int line, int pos,
                 size_t argsz, const struct mdoc_arg *args)                  int tok, size_t argsz, const struct mdoc_arg *args)
 {  {
         struct mdoc_node *p;          struct mdoc_node *p;
   
         p = xcalloc(1, sizeof(struct mdoc_node));          p = xcalloc(1, sizeof(struct mdoc_node));
   
           p->line = line;
           p->pos = pos;
         p->type = MDOC_ELEM;          p->type = MDOC_ELEM;
         p->data.elem.tok = tok;          p->data.elem.tok = tok;
         p->data.elem.argc = argsz;          p->data.elem.argc = argsz;
Line 562  mdoc_elem_alloc(struct mdoc *mdoc, int pos, int tok, 
Line 574  mdoc_elem_alloc(struct mdoc *mdoc, int pos, int tok, 
   
   
 void  void
 mdoc_word_alloc(struct mdoc *mdoc, int pos, const char *word)  mdoc_word_alloc(struct mdoc *mdoc,
                   int line, int pos, const char *word)
 {  {
         struct mdoc_node *p;          struct mdoc_node *p;
   
         p = xcalloc(1, sizeof(struct mdoc_node));          p = xcalloc(1, sizeof(struct mdoc_node));
           p->line = line;
           p->pos = pos;
         p->type = MDOC_TEXT;          p->type = MDOC_TEXT;
         p->data.text.string = xstrdup(word);          p->data.text.string = xstrdup(word);
   

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

CVSweb