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

Diff for /mandoc/man.c between version 1.52 and 1.53

version 1.52, 2010/03/23 11:30:48 version 1.53, 2010/03/23 21:50:43
Line 67  const char *const __man_macronames[MAN_MAX] = {   
Line 67  const char *const __man_macronames[MAN_MAX] = {   
 const   char * const *man_macronames = __man_macronames;  const   char * const *man_macronames = __man_macronames;
   
 static  struct man_node *man_node_alloc(int, int,  static  struct man_node *man_node_alloc(int, int,
                                 enum man_type, int);                                  enum man_type, enum mant);
 static  int              man_node_append(struct man *,  static  int              man_node_append(struct man *,
                                 struct man_node *);                                  struct man_node *);
 static  int              man_ptext(struct man *, int, char *);  static  int              man_ptext(struct man *, int, char *);
Line 242  man_node_append(struct man *man, struct man_node *p)
Line 242  man_node_append(struct man *man, struct man_node *p)
   
   
 static struct man_node *  static struct man_node *
 man_node_alloc(int line, int pos, enum man_type type, int tok)  man_node_alloc(int line, int pos, enum man_type type, enum mant tok)
 {  {
         struct man_node *p;          struct man_node *p;
   
Line 256  man_node_alloc(int line, int pos, enum man_type type, 
Line 256  man_node_alloc(int line, int pos, enum man_type type, 
   
   
 int  int
 man_elem_alloc(struct man *m, int line, int pos, int tok)  man_elem_alloc(struct man *m, int line, int pos, enum mant tok)
 {  {
         struct man_node *p;          struct man_node *p;
   
Line 269  man_elem_alloc(struct man *m, int line, int pos, int t
Line 269  man_elem_alloc(struct man *m, int line, int pos, int t
   
   
 int  int
 man_head_alloc(struct man *m, int line, int pos, int tok)  man_head_alloc(struct man *m, int line, int pos, enum mant tok)
 {  {
         struct man_node *p;          struct man_node *p;
   
Line 282  man_head_alloc(struct man *m, int line, int pos, int t
Line 282  man_head_alloc(struct man *m, int line, int pos, int t
   
   
 int  int
 man_body_alloc(struct man *m, int line, int pos, int tok)  man_body_alloc(struct man *m, int line, int pos, enum mant tok)
 {  {
         struct man_node *p;          struct man_node *p;
   
Line 295  man_body_alloc(struct man *m, int line, int pos, int t
Line 295  man_body_alloc(struct man *m, int line, int pos, int t
   
   
 int  int
 man_block_alloc(struct man *m, int line, int pos, int tok)  man_block_alloc(struct man *m, int line, int pos, enum mant tok)
 {  {
         struct man_node *p;          struct man_node *p;
   
Line 314  pstring(struct man *m, int line, int pos, 
Line 314  pstring(struct man *m, int line, int pos, 
         struct man_node *n;          struct man_node *n;
         size_t           sv;          size_t           sv;
   
         n = man_node_alloc(line, pos, MAN_TEXT, -1);          n = man_node_alloc(line, pos, MAN_TEXT, MAN_MAX);
         n->string = mandoc_malloc(len + 1);          n->string = mandoc_malloc(len + 1);
         sv = strlcpy(n->string, p, len + 1);          sv = strlcpy(n->string, p, len + 1);
   
Line 469  macrowarn(struct man *m, int ln, const char *buf)
Line 469  macrowarn(struct man *m, int ln, const char *buf)
 int  int
 man_pmacro(struct man *m, int ln, char *buf)  man_pmacro(struct man *m, int ln, char *buf)
 {  {
         int              i, j, c, ppos, fl;          int              i, j, ppos, fl;
           enum mant        tok;
         char             mac[5];          char             mac[5];
         struct man_node *n;          struct man_node *n;
   
Line 519  man_pmacro(struct man *m, int ln, char *buf)
Line 520  man_pmacro(struct man *m, int ln, char *buf)
                 return(1);                  return(1);
         }          }
   
         if (MAN_MAX == (c = man_hash_find(mac))) {          if (MAN_MAX == (tok = man_hash_find(mac))) {
                 if ( ! macrowarn(m, ln, mac))                  if ( ! macrowarn(m, ln, mac))
                         goto err;                          goto err;
                 return(1);                  return(1);
Line 542  man_pmacro(struct man *m, int ln, char *buf)
Line 543  man_pmacro(struct man *m, int ln, char *buf)
          * macros---they don't print text---so we let those slip by.           * macros---they don't print text---so we let those slip by.
          */           */
   
         if ( ! (MAN_NSCOPED & man_macros[c].flags) &&          if ( ! (MAN_NSCOPED & man_macros[tok].flags) &&
                         m->flags & MAN_ELINE) {                          m->flags & MAN_ELINE) {
                 assert(MAN_TEXT != m->last->type);                  assert(MAN_TEXT != m->last->type);
   
Line 574  man_pmacro(struct man *m, int ln, char *buf)
Line 575  man_pmacro(struct man *m, int ln, char *buf)
   
         /* Begin recursive parse sequence. */          /* Begin recursive parse sequence. */
   
         assert(man_macros[c].fp);          assert(man_macros[tok].fp);
   
         if ( ! (*man_macros[c].fp)(m, c, ln, ppos, &i, buf))          if ( ! (*man_macros[tok].fp)(m, tok, ln, ppos, &i, buf))
                 goto err;                  goto err;
   
 out:  out:

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

CVSweb