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

Diff for /src/usr.bin/m4/mdef.h between version 1.29 and 1.30

version 1.29, 2006/03/20 20:27:45 version 1.30, 2010/09/07 19:58:09
Line 87 
Line 87 
 #define FORMATTYPE      44  #define FORMATTYPE      44
   
 #define BUILTIN_MARKER  "__builtin_"  #define BUILTIN_MARKER  "__builtin_"
   
 #define TYPEMASK        63      /* Keep bits really corresponding to a type. */  #define TYPEMASK        63      /* Keep bits really corresponding to a type. */
 #define RECDEF          256     /* Pure recursive def, don't expand it */  #define RECDEF          256     /* Pure recursive def, don't expand it */
 #define NOARGS          512     /* builtin needs no args */  #define NOARGS          512     /* builtin needs no args */
Line 96 
Line 96 
 /*  /*
  * m4 special characters   * m4 special characters
  */   */
   
 #define ARGFLAG         '$'  #define ARGFLAG         '$'
 #define LPAREN          '('  #define LPAREN          '('
 #define RPAREN          ')'  #define RPAREN          ')'
Line 115 
Line 115 
  */   */
   
 #define EOS             '\0'  #define EOS             '\0'
 #define MAXINP          10              /* maximum include files            */  #define MAXINP          10              /* maximum include files            */
 #define MAXOUT          10              /* maximum # of diversions          */  #define MAXOUT          10              /* maximum # of diversions          */
 #define BUFSIZE         4096            /* starting size of pushback buffer */  #define BUFSIZE         4096            /* starting size of pushback buffer */
 #define INITSTACKMAX    4096            /* starting size of call stack      */  #define INITSTACKMAX    4096            /* starting size of call stack      */
 #define STRSPMAX        4096            /* starting size of string space    */  #define STRSPMAX        4096            /* starting size of string space    */
 #define MAXTOK          512             /* maximum chars in a tokn          */  #define MAXTOK          512             /* maximum chars in a tokn          */
 #define HASHSIZE        199             /* maximum size of hashtab          */  #define HASHSIZE        199             /* maximum size of hashtab          */
 #define MAXCCHARS       5               /* max size of comment/quote delim  */  #define MAXCCHARS       5               /* max size of comment/quote delim  */
   
 #define ALL             1  #define ALL             1
 #define TOP             0  #define TOP             0
   
 #define TRUE            1  #define TRUE            1
 #define FALSE           0  #define FALSE           0
 #define cycle           for(;;)  #define cycle           for(;;)
Line 134 
Line 134 
 /*  /*
  * m4 data structures   * m4 data structures
  */   */
   
 typedef struct ndblock *ndptr;  typedef struct ndblock *ndptr;
   
 struct macro_definition {  struct macro_definition {
         struct macro_definition *next;          struct macro_definition *next;
         char            *defn;  /* definition..               */          char            *defn;  /* definition..               */
Line 145 
Line 145 
   
   
 struct ndblock {                        /* hashtable structure         */  struct ndblock {                        /* hashtable structure         */
         unsigned int            builtin_type;          unsigned int            builtin_type;
         unsigned int            trace_flags;          unsigned int            trace_flags;
         struct macro_definition *d;          struct macro_definition *d;
         char            name[1];        /* entry name..               */          char            name[1];        /* entry name..               */
 };  };
   
 typedef union {                 /* stack structure */  typedef union {                 /* stack structure */
         int     sfra;           /* frame entry  */          int     sfra;           /* frame entry  */
         char    *sstr;          /* string entry */          char    *sstr;          /* string entry */
 } stae;  } stae;
   
 struct input_file {  struct input_file {
         FILE            *file;          FILE            *file;
         char            *name;          char            *name;
         unsigned long   lineno;          unsigned long   lineno;
         unsigned long   synch_lineno;   /* used for -s */          unsigned long   synch_lineno;   /* used for -s */
         int             c;          int             c;
 };  };
   
 #define CURRENT_NAME    (infile[ilevel].name)  #define CURRENT_NAME    (infile[ilevel].name)
Line 173 
Line 173 
  *      pushf() - push a call frame entry onto stack   *      pushf() - push a call frame entry onto stack
  *      pushs() - push a string pointer onto stack   *      pushs() - push a string pointer onto stack
  */   */
 #define gpbc()   (bp > bufbase) ? *--bp : obtain_char(infile+ilevel)  #define gpbc()   (bp > bufbase) ? *--bp : obtain_char(infile+ilevel)
 #define pushf(x)                        \  #define pushf(x)                        \
         do {                            \          do {                            \
                 if (++sp == STACKMAX)   \                  if (++sp == STACKMAX)   \
                         enlarge_stack();\                          enlarge_stack();\
                 mstack[sp].sfra = (x);  \                  mstack[sp].sfra = (x);  \
                 sstack[sp] = 0; \                  sstack[sp] = 0; \
         } while (0)          } while (0)
   
 #define pushs(x)                        \  #define pushs(x)                        \
         do {                            \          do {                            \
                 if (++sp == STACKMAX)   \                  if (++sp == STACKMAX)   \
                         enlarge_stack();\                          enlarge_stack();\
                 mstack[sp].sstr = (x);  \                  mstack[sp].sstr = (x);  \
                 sstack[sp] = 1; \                  sstack[sp] = 1; \
         } while (0)          } while (0)
   
 #define pushs1(x)                       \  #define pushs1(x)                       \
         do {                            \          do {                            \
                 if (++sp == STACKMAX)   \                  if (++sp == STACKMAX)   \
                         enlarge_stack();\                          enlarge_stack();\
                 mstack[sp].sstr = (x);  \                  mstack[sp].sstr = (x);  \
                 sstack[sp] = 0; \                  sstack[sp] = 0; \
Line 204 
Line 204 
  *      +-------+                       +-----+   *      +-------+                       +-----+
  *      | arg 3 ----------------------->| str |   *      | arg 3 ----------------------->| str |
  *      +-------+                       |  .  |   *      +-------+                       |  .  |
  *      | arg 2 ---PREVEP-----+            .   *      | arg 2 ---PREVEP-----+            .
  *      +-------+             |   *      +-------+             |
  *          .                 |         |     |   *          .                 |         |     |
  *      +-------+             |         +-----+   *      +-------+             |         +-----+
  *      | plev  |  PARLEV     +-------->| str |   *      | plev  |  PARLEV     +-------->| str |
  *      +-------+                       |  .  |   *      +-------+                       |  .  |
  *      | type  |  CALTYP                  .   *      | type  |  CALTYP                  .
  *      +-------+   *      +-------+
  *      | prcf  ---PREVFP--+   *      | prcf  ---PREVFP--+
  *      +-------+          |   *      +-------+          |
  *      |   .   |  PREVSP  |   *      |   .   |  PREVSP  |
  *          .              |   *          .              |
  *      +-------+          |   *      +-------+          |
  *      |       <----------+   *      |       <----------+
  *      +-------+   *      +-------+

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30