[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.12 and 1.13

version 1.12, 2005/05/13 05:05:22 version 1.13, 2005/10/17 07:35:29
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
 /*  /*
  * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan   * Copyright (c) 1998-2002 Kungliga Tekniska Högskolan
  * (Royal Institute of Technology, Stockholm, Sweden).   * (Royal Institute of Technology, Stockholm, Sweden).
  * All rights reserved.   * All rights reserved.
  *   *
Line 15 
Line 15 
  *    notice, this list of conditions and the following disclaimer in the   *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.   *    documentation and/or other materials provided with the distribution.
  *   *
  * 3. All advertising materials mentioning features or use of this software   * 3. Neither the name of the Institute nor the names of its contributors
  *    must display the following acknowledgement:  
  *      This product includes software developed by Kungliga Tekniska  
  *      Högskolan and its contributors.  
  *  
  * 4. Neither the name of the Institute nor the names of its contributors  
  *    may be used to endorse or promote products derived from this software   *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.   *    without specific prior written permission.
  *   *
Line 40 
Line 35 
 #undef ROKEN_RENAME  #undef ROKEN_RENAME
 #include "compile_et.h"  #include "compile_et.h"
   
 /* RCSID("$KTH: compile_et.c,v 1.12 1999/04/01 09:13:52 joda Exp $"); */  /* RCSID("$KTH: compile_et.c,v 1.17 2005/05/16 08:42:45 lha Exp $"); */
   
 #include <err.h>  #include <err.h>
 #include "error_table.h"  #include "error_table.h"
Line 88 
Line 83 
         fprintf(c_file, "#include \"%s\"\n", hfn);          fprintf(c_file, "#include \"%s\"\n", hfn);
         fprintf(c_file, "\n");          fprintf(c_file, "\n");
   
         fprintf(c_file, "static const char *text[] = {\n");          fprintf(c_file, "static const char *%s_error_strings[] = {\n", name);
   
         for (ec = codes, n = 0; ec; ec = ec->next, n++) {          for (ec = codes, n = 0; ec; ec = ec->next, n++) {
                 while (n < ec->number) {                  while (n < ec->number) {
Line 104 
Line 99 
         fprintf(c_file, "\tNULL\n");          fprintf(c_file, "\tNULL\n");
         fprintf(c_file, "};\n");          fprintf(c_file, "};\n");
         fprintf(c_file, "\n");          fprintf(c_file, "\n");
           fprintf(c_file, "#define num_errors %d\n", number);
           fprintf(c_file, "\n");
         fprintf(c_file,          fprintf(c_file,
             "void initialize_%s_error_table_r(struct et_list **list)\n", name);              "void initialize_%s_error_table_r(struct et_list **list)\n", name);
         fprintf(c_file, "{\n");          fprintf(c_file, "{\n");
         fprintf(c_file,          fprintf(c_file,
             "    initialize_error_table_r(list, text, "              "    initialize_error_table_r(list, %s_error_strings, "
             "%s_num_errors, ERROR_TABLE_BASE_%s);\n", name, name);              "num_errors, ERROR_TABLE_BASE_%s);\n", name, name);
         fprintf(c_file, "}\n");          fprintf(c_file, "}\n");
         fprintf(c_file, "\n");          fprintf(c_file, "\n");
         fprintf(c_file, "void initialize_%s_error_table(void)\n", name);          fprintf(c_file, "void initialize_%s_error_table(void)\n", name);
         fprintf(c_file, "{\n");          fprintf(c_file, "{\n");
         fprintf(c_file,          fprintf(c_file,
             "    init_error_table(text, ERROR_TABLE_BASE_%s, "              "    init_error_table(%s_error_strings, ERROR_TABLE_BASE_%s, "
             "%s_num_errors);\n", name, name);              "num_errors);\n", name, name);
         fprintf(c_file, "}\n");          fprintf(c_file, "}\n");
   
         fclose(c_file);          fclose(c_file);
Line 147 
Line 144 
         fprintf(h_file, "#ifndef %s\n", fn);          fprintf(h_file, "#ifndef %s\n", fn);
         fprintf(h_file, "#define %s\n", fn);          fprintf(h_file, "#define %s\n", fn);
         fprintf(h_file, "\n");          fprintf(h_file, "\n");
         fprintf(h_file, "#include <kerberosV/com_err.h>\n");          fprintf(h_file, "struct et_list;\n");
         fprintf(h_file, "\n");          fprintf(h_file, "\n");
         fprintf(h_file,          fprintf(h_file,
             "void initialize_%s_error_table_r(struct et_list **);\n",              "void initialize_%s_error_table_r(struct et_list **);\n",
Line 158 
Line 155 
             name, name);              name, name);
         fprintf(h_file, "\n");          fprintf(h_file, "\n");
         fprintf(h_file, "typedef enum %s_error_number{\n", name);          fprintf(h_file, "typedef enum %s_error_number{\n", name);
         fprintf(h_file, "\tERROR_TABLE_BASE_%s = %ld,\n", name, base);  
         fprintf(h_file, "\t%s_err_base = %ld,\n", name, base);  
   
         for (ec = codes; ec; ec = ec->next)          for (ec = codes; ec; ec = ec->next)
                 fprintf(h_file, "\t%s = %ld,\n", ec->name, base + ec->number);                  fprintf(h_file, "\t%s = %ld%s\n", ec->name, base + ec->number,
                       (ec->next != NULL) ? "," : "");
   
         fprintf(h_file, "\t%s_num_errors = %d\n", name, number);  
         fprintf(h_file, "} %s_error_number;\n", name);          fprintf(h_file, "} %s_error_number;\n", name);
           fprintf(h_file, "\n");
           fprintf(h_file, "#define ERROR_TABLE_BASE_%s %ld\n", name, base);
         fprintf(h_file, "\n");          fprintf(h_file, "\n");
         fprintf(h_file, "#endif /* %s */\n", fn);          fprintf(h_file, "#endif /* %s */\n", fn);
   

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