[BACK]Return to look.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / m4

Diff for /src/usr.bin/m4/look.c between version 1.21 and 1.22

version 1.21, 2009/10/14 17:23:17 version 1.22, 2010/09/07 19:58:09
Line 51 
Line 51 
 static void *hash_alloc(size_t, void *);  static void *hash_alloc(size_t, void *);
 static void hash_free(void *, size_t, void *);  static void hash_free(void *, size_t, void *);
 static void *element_alloc(size_t, void *);  static void *element_alloc(size_t, void *);
 static void setup_definition(struct macro_definition *, const char *,  static void setup_definition(struct macro_definition *, const char *,
     const char *);      const char *);
   
 static struct ohash_info macro_info = {  static struct ohash_info macro_info = {
Line 64 
Line 64 
 void *  void *
 hash_alloc(s, u)  hash_alloc(s, u)
         size_t s;          size_t s;
         void *u         UNUSED;          void *u         UNUSED;
 {  {
         void *storage = xalloc(s, "hash alloc");          void *storage = xalloc(s, "hash alloc");
         if (storage)          if (storage)
Line 76 
Line 76 
 hash_free(p, s, u)  hash_free(p, s, u)
         void *p;          void *p;
         size_t s        UNUSED;          size_t s        UNUSED;
         void *u         UNUSED;          void *u         UNUSED;
 {  {
         free(p);          free(p);
 }  }
Line 84 
Line 84 
 void *  void *
 element_alloc(s, u)  element_alloc(s, u)
         size_t s;          size_t s;
         void *u         UNUSED;          void *u         UNUSED;
 {  {
         return xalloc(s, "element alloc");          return xalloc(s, "element alloc");
 }  }
Line 98 
Line 98 
 /*  /*
  * find name in the hash table   * find name in the hash table
  */   */
 ndptr  ndptr
 lookup(const char *name)  lookup(const char *name)
 {  {
         return ohash_find(&macros, ohash_qlookup(&macros, name));          return ohash_find(&macros, ohash_qlookup(&macros, name));
Line 116 
Line 116 
                 return NULL;                  return NULL;
 }  }
   
 static void  static void
 setup_definition(struct macro_definition *d, const char *defn, const char *name)  setup_definition(struct macro_definition *d, const char *defn, const char *name)
 {  {
         ndptr p;          ndptr p;
Line 174 
Line 174 
 {  {
         ndptr n;          ndptr n;
         struct macro_definition *d;          struct macro_definition *d;
   
         n = create_entry(name);          n = create_entry(name);
         d = xalloc(sizeof(struct macro_definition), NULL);          d = xalloc(sizeof(struct macro_definition), NULL);
         d->next = n->d;          d->next = n->d;
Line 221 
Line 221 
         ndptr n;          ndptr n;
         unsigned int i;          unsigned int i;
   
         for (n = ohash_first(&macros, &i); n != NULL;          for (n = ohash_first(&macros, &i); n != NULL;
             n = ohash_next(&macros, &i))              n = ohash_next(&macros, &i))
                 if (n->d != NULL)                  if (n->d != NULL)
                         f(n->name, n->d);                          f(n->name, n->d);
 }  }
   
 void  void
 setup_builtin(const char *name, unsigned int type)  setup_builtin(const char *name, unsigned int type)
 {  {
         ndptr n;          ndptr n;
Line 259 
Line 259 
                         trace_flags |= TRACE_ALL;                          trace_flags |= TRACE_ALL;
                 else                  else
                         trace_flags &= ~TRACE_ALL;                          trace_flags &= ~TRACE_ALL;
                 for (p = ohash_first(&macros, &i); p != NULL;                  for (p = ohash_first(&macros, &i); p != NULL;
                     p = ohash_next(&macros, &i))                      p = ohash_next(&macros, &i))
                         p->trace_flags = FLAG_NO_TRACE;                          p->trace_flags = FLAG_NO_TRACE;
         } else {          } else {
                 p = create_entry(name);                  p = create_entry(name);
                 p->trace_flags = on;                  p->trace_flags = on;
         }          }
 }  }
   
 ndptr  ndptr
 macro_getbuiltin(const char *name)  macro_getbuiltin(const char *name)
 {  {
         ndptr p;          ndptr p;
Line 279 
Line 279 
         else          else
                 return p;                  return p;
 }  }
   

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