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

Diff for /src/usr.bin/m4/main.c between version 1.16 and 1.17

version 1.16, 1999/09/14 08:30:20 version 1.17, 1999/09/14 08:35:16
Line 146 
Line 146 
         int argc;          int argc;
         char *argv[];          char *argv[];
 {  {
         register int c;          int c;
         register int n;          int n;
         char *p;          char *p;
         register FILE *ifp;          FILE *ifp;
   
         if (signal(SIGINT, SIG_IGN) != SIG_IGN)          if (signal(SIGINT, SIG_IGN) != SIG_IGN)
                 signal(SIGINT, onintr);                  signal(SIGINT, onintr);
Line 263 
Line 263 
  * macro - the work horse..   * macro - the work horse..
  */   */
 void  void
 macro() {  macro()
   {
         char token[MAXTOK], chars[2];          char token[MAXTOK], chars[2];
         register char *s;          char *s;
         register int t, l;          int t, l;
         register ndptr p;          ndptr p;
         register int  nlpar;          int  nlpar;
   
         cycle {          cycle {
                 t = gpbc();                  t = gpbc();
Line 330 
Line 331 
                                 } else if (LOOK_AHEAD(l,lquote)) {                                  } else if (LOOK_AHEAD(l,lquote)) {
                                         nlpar++;                                          nlpar++;
                                         s = lquote;                                          s = lquote;
                                 } else if (l == EOF)                                  } else if (l == EOF) {
                                         errx(1, "missing right quote");                                          if (nlpar == 1)
                                 else {                                                  errx(1, "missing right quote.");
                                           else
                                                   errx(1, "missing %d right quotes.", nlpar);
                                   } else {
                                         chars[0] = l;                                          chars[0] = l;
                                         chars[1] = EOS;                                          chars[1] = EOS;
                                         s = chars;                                          s = chars;
Line 428 
Line 432 
  */   */
 ndptr  ndptr
 inspect(tp)  inspect(tp)
 register char *tp;          char *tp;
 {  {
         register char c;          char c;
         register char *name = tp;          char *name = tp;
         register char *etp = tp+MAXTOK;          char *etp = tp+MAXTOK;
         register ndptr p;          ndptr p;
         register unsigned long h = 0;          unsigned long h = 0;
   
         while ((isalnum(c = gpbc()) || c == '_') && tp < etp)          while ((isalnum(c = gpbc()) || c == '_') && tp < etp)
                 h = (h << 5) + h + (*tp++ = c);                  h = (h << 5) + h + (*tp++ = c);
Line 454 
Line 458 
  * initkwds - initialise m4 keywords as fast as possible.   * initkwds - initialise m4 keywords as fast as possible.
  * This very similar to install, but without certain overheads,   * This very similar to install, but without certain overheads,
  * such as calling lookup. Malloc is not used for storing the   * such as calling lookup. Malloc is not used for storing the
  * keyword strings, since we simply use the static  pointers   * keyword strings, since we simply use the static pointers
  * within keywrds block.   * within keywrds block.
  */   */
 void  void
 initkwds() {  initkwds()
         register int i;  {
         register int h;          size_t i;
         register ndptr p;          int h;
           ndptr p;
   
         for (i = 0; i < MAXKEYS; i++) {          for (i = 0; i < MAXKEYS; i++) {
                 h = hash(keywrds[i].knam);                  h = hash(keywrds[i].knam);
Line 473 
Line 478 
                 p->type = keywrds[i].ktyp | STATIC;                  p->type = keywrds[i].ktyp | STATIC;
         }          }
 }  }
   

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17