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

Diff for /src/usr.bin/compile_et/Attic/compile_et.c between version 1.2 and 1.3

version 1.2, 1996/12/11 13:44:56 version 1.3, 1997/06/17 20:28:56
Line 30 
Line 30 
 extern char *current_token;  extern char *current_token;
 extern int table_number, current;  extern int table_number, current;
 char buffer[BUFSIZ];  char buffer[BUFSIZ];
 char *table_name = (char *)NULL;  char *table_name = NULL;
 FILE *hfile, *cfile;  FILE *hfile, *cfile;
   
 /* C library */  /* C library */
Line 197 
Line 197 
     strcpy (p, filename);      strcpy (p, filename);
     filename = p;      filename = p;
     p = strrchr(filename, '/');      p = strrchr(filename, '/');
     if (p == (char *)NULL)      if (p == NULL)
         p = filename;          p = filename;
     else      else
         p++;          p++;
Line 222 
Line 222 
     }      }
   
     hfile = fopen(h_file, "w");      hfile = fopen(h_file, "w");
     if (hfile == (FILE *)NULL) {      if (hfile == NULL) {
         perror(h_file);          perror(h_file);
         exit(1);          exit(1);
     }      }
     fprintf (hfile, warning, h_file);      fprintf (hfile, warning, h_file);
   
     cfile = fopen(c_file, "w");      cfile = fopen(c_file, "w");
     if (cfile == (FILE *)NULL) {      if (cfile == NULL) {
         perror(c_file);          perror(c_file);
         exit(1);          exit(1);
     }      }
Line 253 
Line 253 
     for (cpp = struct_def; *cpp; cpp++)      for (cpp = struct_def; *cpp; cpp++)
         fputs (*cpp, cfile);          fputs (*cpp, cfile);
     fprintf(cfile,      fprintf(cfile,
             "static const struct error_table et = { text, %ldL, %d };\n\n",              "static const struct error_table et = { text, %dL, %d };\n\n",
             table_number, current);              table_number, current);
     fputs("static struct et_list link = { 0, 0 };\n\n",      fputs("static struct et_list link = { 0, 0 };\n\n",
           cfile);            cfile);
Line 269 
Line 269 
   
     fprintf (hfile, "extern void initialize_%s_error_table ();\n",      fprintf (hfile, "extern void initialize_%s_error_table ();\n",
              table_name);               table_name);
     fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%ldL)\n",      fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%dL)\n",
              table_name, table_number);               table_name, table_number);
     /* compatibility... */      /* compatibility... */
     fprintf (hfile, "\n/* for compatibility with older versions... */\n");      fprintf (hfile, "\n/* for compatibility with older versions... */\n");
Line 286 
Line 286 
     fputs(s, stderr);      fputs(s, stderr);
     fprintf(stderr, "\nLine number %d; last token was '%s'\n",      fprintf(stderr, "\nLine number %d; last token was '%s'\n",
             lineno, current_token);              lineno, current_token);
   
       return 0;
 }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3