tab_base_low, table_item_count) > outfile
}
print "" > outfile
- print "typedef long errcode_t;" > outfile
- print "" > outfile
- print "extern KRB5_DLLIMP errcode_t KRB5_CALLCONV" > outfile
- print " add_error_table P((const struct error_table FAR *));" > outfile
- print "extern KRB5_DLLIMP errcode_t KRB5_CALLCONV" > outfile
- print " remove_error_table P((const struct error_table FAR *));" > outfile
- print "" > outfile
- print "static int init = 0;" > outfile
- print "" > outfile
- print "void initialize_" table_name "_error_table P((void)) {" > outfile
- print " if (init) return;" > outfile
- print " init++;" > outfile
- print " add_error_table(&et_" table_name "_error_table);" > outfile
- print "}" > outfile
- print "" > outfile
- print "void cleanup_" table_name "_error_table P((void)) {" > outfile
- print " if (!init) return;" > outfile
- print " init--;" > outfile
- print " remove_error_table(&et_" table_name "_error_table);" > outfile
+ print "#ifdef unix" > outfile
+ print "struct et_list {" > outfile
+ print " struct et_list *next;" > outfile
+ print " const struct error_table * table;" > outfile
+ print "};" > outfile
+ print "extern struct et_list *_et_list;" > outfile
+ print "static struct et_list link = { 0, 0 };" > outfile
+ print "void initialize_" table_name "_error_table (NOARGS) {" > outfile
+ print " if (!link.table) {" > outfile
+ print " link.next = _et_list;" > outfile
+ print " link.table = &et;" > outfile
+ print " _et_list = &link;" > outfile
+ print " }" > outfile
print "}" > outfile
+ print "#endif" > outfile
}
print " * " outfile ":" > outfile
print " * This file is automatically generated; please do not edit it." > outfile
print " */" > outfile
+ print "" > outfile
+ print "#include <com_err.h>" > outfile
+ print "" > outfile
}
/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,/ {
}
END {
- print "extern void initialize_" table_name "_error_table ();" > outfile
- print "extern void cleanup_" table_name "_error_table ();" > outfile
if (tab_base_high == 0) {
print "#define ERROR_TABLE_BASE_" table_name " (" \
sprintf("%d", tab_base_sign*tab_base_low) \
tab_base_low) "L)" > outfile
}
print "" > outfile
+ print "extern struct error_table et_" table_name "_error_table;" > outfile
+ print "" > outfile
+ print "#ifdef unix" > outfile
print "/* for compatibility with older versions... */" > outfile
+ print "extern void initialize_" table_name "_error_table ();" > outfile
print "#define init_" table_name "_err_tbl initialize_" table_name "_error_table" > outfile
print "#define " table_name "_err_base ERROR_TABLE_BASE_" table_name > outfile
+ print "#else" > outfile
+ print "#define initialize_" table_name "_error_table()" > outfile
+ print "#endif" > outfile
}