[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.13 and 1.14

version 1.13, 2003/06/30 22:10:21 version 1.14, 2003/06/30 22:11:38
Line 53 
Line 53 
 #include "extern.h"  #include "extern.h"
   
 struct ndblock {                        /* hashtable structure         */  struct ndblock {                        /* hashtable structure         */
           unsigned int            builtin_type;
         struct macro_definition *d;          struct macro_definition *d;
         char            name[1];        /* entry name..               */          char            name[1];        /* entry name..               */
 };  };
Line 99 
Line 100 
 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)
 {  {
         int n;          ndptr p;
   
         if (strncmp(defn, BUILTIN_MARKER, sizeof(BUILTIN_MARKER)-1) == 0 &&          if (strncmp(defn, BUILTIN_MARKER, sizeof(BUILTIN_MARKER)-1) == 0 &&
             (n = builtin_type(defn+sizeof(BUILTIN_MARKER)-1)) != -1) {              (p = macro_getbuiltin(defn+sizeof(BUILTIN_MARKER)-1)) != NULL) {
                 d->type = n & TYPEMASK;                  d->type = macro_builtin_type(p);
                 if ((n & NOARGS) == 0)  
                         d->type |= NEEDARGS;  
                 d->defn = xstrdup(defn+sizeof(BUILTIN_MARKER)-1);                  d->defn = xstrdup(defn+sizeof(BUILTIN_MARKER)-1);
         } else {          } else {
                 if (!*defn)                  if (!*defn)
Line 130 
Line 129 
         if (n == NULL) {          if (n == NULL) {
                 n = ohash_create_entry(&macro_info, name, &end);                  n = ohash_create_entry(&macro_info, name, &end);
                 ohash_insert(&macros, i, n);                  ohash_insert(&macros, i, n);
                   n->builtin_type = MACRTYPE;
                 n->d = NULL;                  n->d = NULL;
         }          }
         return n;          return n;
Line 212 
Line 212 
         ndptr n;          ndptr n;
   
         n = create_entry(name);          n = create_entry(name);
           n->builtin_type = type;
         n->d = xalloc(sizeof(struct macro_definition));          n->d = xalloc(sizeof(struct macro_definition));
         n->d->defn = xstrdup(name);          n->d->defn = xstrdup(name);
         n->d->type = type;          n->d->type = type;
Line 229 
Line 230 
 {  {
         return p->d;          return p->d;
 }  }
   
   ndptr
   macro_getbuiltin(const char *name)
   {
           ndptr p;
   
           p = lookup(name);
           if (p == NULL || p->builtin_type == MACRTYPE)
                   return NULL;
           else
                   return p;
   }
   
   int
   macro_builtin_type(ndptr p)
   {
           return p->builtin_type;
   }
   

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14