diff options
author | Jacques Vidrine <nectar@FreeBSD.org> | 2004-04-03 21:17:01 +0000 |
---|---|---|
committer | Jacques Vidrine <nectar@FreeBSD.org> | 2004-04-03 21:17:01 +0000 |
commit | 2b2b372003418fc76bae940b52aab383780f54d7 (patch) | |
tree | ece6a707d8c4b0cbe892a48245084c0c427ee3cb /contrib/com_err/compile_et.c | |
parent | d2387d42b8da231a5b95cbc313825fb2aadf26f6 (diff) |
Resolve conflicts after import of Heimdal 0.6.1 libcom_err.
Notes
Notes:
svn path=/head/; revision=127807
Diffstat (limited to 'contrib/com_err/compile_et.c')
-rw-r--r-- | contrib/com_err/compile_et.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/contrib/com_err/compile_et.c b/contrib/com_err/compile_et.c index 345a39f0b140..59d9de996d63 100644 --- a/contrib/com_err/compile_et.c +++ b/contrib/com_err/compile_et.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1998-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -14,12 +14,7 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * 3. All advertising materials mentioning features or use of this software - * 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 + * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -35,13 +30,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +/* $FreeBSD$ */ #undef ROKEN_RENAME #include "compile_et.h" #include <getarg.h> #if 0 -RCSID("$Id: compile_et.c,v 1.12 1999/04/01 09:13:52 joda Exp $"); +RCSID("$Id: compile_et.c,v 1.16 2002/08/20 12:44:51 joda Exp $"); #endif #include <err.h> @@ -89,7 +85,7 @@ generate_c(void) fprintf(c_file, "#include \"%s\"\n", hfn); 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++) { while(n < ec->number) { @@ -104,20 +100,22 @@ generate_c(void) fprintf(c_file, "\tNULL\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, "void initialize_%s_error_table_r(struct et_list **list)\n", name); fprintf(c_file, "{\n"); fprintf(c_file, - " initialize_error_table_r(list, text, " - "%s_num_errors, ERROR_TABLE_BASE_%s);\n", name, name); + " initialize_error_table_r(list, %s_error_strings, " + "num_errors, ERROR_TABLE_BASE_%s);\n", name, name); fprintf(c_file, "}\n"); fprintf(c_file, "\n"); fprintf(c_file, "void initialize_%s_error_table(void)\n", name); fprintf(c_file, "{\n"); fprintf(c_file, - " init_error_table(text, ERROR_TABLE_BASE_%s, " - "%s_num_errors);\n", name, name); + " init_error_table(%s_error_strings, ERROR_TABLE_BASE_%s, " + "num_errors);\n", name, name); fprintf(c_file, "}\n"); fclose(c_file); @@ -147,7 +145,7 @@ generate_h(void) fprintf(h_file, "#ifndef %s\n", fn); fprintf(h_file, "#define %s\n", fn); fprintf(h_file, "\n"); - fprintf(h_file, "#include <com_right.h>\n"); + fprintf(h_file, "struct et_list;\n"); fprintf(h_file, "\n"); fprintf(h_file, "void initialize_%s_error_table_r(struct et_list **);\n", @@ -158,16 +156,16 @@ generate_h(void) name, name); fprintf(h_file, "\n"); 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) { - 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, "\n"); + fprintf(h_file, "#define ERROR_TABLE_BASE_%s %ld\n", name, base); + fprintf(h_file, "\n"); fprintf(h_file, "#endif /* %s */\n", fn); @@ -200,6 +198,7 @@ main(int argc, char **argv) char *p; int optind = 0; + setprogname(argv[0]); if(getarg(args, num_args, argc, argv, &optind)) usage(1); if(help_flag) |