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

Diff for /mandoc/tag.c between version 1.28 and 1.32

version 1.28, 2020/03/13 15:32:29 version 1.32, 2020/04/03 10:30:09
Line 24 
Line 24 
 #include <assert.h>  #include <assert.h>
 #include <limits.h>  #include <limits.h>
 #include <stddef.h>  #include <stddef.h>
   #include <stdint.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
Line 59  tag_free(void)
Line 60  tag_free(void)
         struct tag_entry        *entry;          struct tag_entry        *entry;
         unsigned int             slot;          unsigned int             slot;
   
           if (tag_data.info.free == NULL)
                   return;
         entry = ohash_first(&tag_data, &slot);          entry = ohash_first(&tag_data, &slot);
         while (entry != NULL) {          while (entry != NULL) {
                 free(entry->nodes);                  free(entry->nodes);
Line 66  tag_free(void)
Line 69  tag_free(void)
                 entry = ohash_next(&tag_data, &slot);                  entry = ohash_next(&tag_data, &slot);
         }          }
         ohash_delete(&tag_data);          ohash_delete(&tag_data);
           tag_data.info.free = NULL;
 }  }
   
 /*  /*
Line 86  tag_put(const char *s, int prio, struct roff_node *n)
Line 90  tag_put(const char *s, int prio, struct roff_node *n)
                 if (n->child == NULL || n->child->type != ROFFT_TEXT)                  if (n->child == NULL || n->child->type != ROFFT_TEXT)
                         return;                          return;
                 s = n->child->string;                  s = n->child->string;
                 if (s[0] == '\\' && (s[1] == '&' || s[1] == 'e'))                  switch (s[0]) {
                         s += 2;                  case '-':
                           s++;
                           break;
                   case '\\':
                           switch (s[1]) {
                           case '&':
                           case '-':
                           case 'e':
                                   s += 2;
                                   break;
                           default:
                                   break;
                           }
                           break;
                   default:
                           break;
                   }
         }          }
   
         /*          /*
Line 157  tag_put(const char *s, int prio, struct roff_node *n)
Line 177  tag_put(const char *s, int prio, struct roff_node *n)
         }          }
 }  }
   
 enum tag_result  int
 tag_check(const char *test_tag)  tag_exists(const char *tag)
 {  {
         unsigned int slot;          return ohash_find(&tag_data, ohash_qlookup(&tag_data, tag)) != NULL;
   
         if (ohash_first(&tag_data, &slot) == NULL)  
                 return TAG_EMPTY;  
         else if (test_tag != NULL && ohash_find(&tag_data,  
             ohash_qlookup(&tag_data, test_tag)) == NULL)  
                 return TAG_MISS;  
         else  
                 return TAG_OK;  
 }  }

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.32

CVSweb