+2003-02-07 Tom Yu <tlyu@mit.edu>
+
+ * Makefile.in: Add rules for generating lib/krb4/krb_err_txt.c for
+ Windows.
+
2003-01-14 Ezra Peisach <epeisach@bu.edu>
* Makefile.in (check-unix): Invoke t_krbconf instead of struggling
$(INC)/kerberosIV/krb_err.h lib/krb4/krb_err.c \
$(PR)prof_err.h $(PR)prof_err.c \
$(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.c \
- $(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.c
+ $(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.c \
+ lib$(S)krb4$(S)krb_err_txt.c
HOUT = $(INC)krb5.h $(GG)gssapi.h $(PR)profile.h
$(GK)gssapi_err_krb5.c: $(AC) $(GK)gssapi_err_krb5.et
$(AWK) -f $(AC) outfile=$@ $(GK)gssapi_err_krb5.et
+lib$(S)krb4$(S)krb_err_txt.c: lib$(S)krb4$(S)krb_err.et
+ $(AWK) -f lib$(S)krb4$(S)et_errtxt.awk outfile=$@ \
+ lib$(S)krb4$(S)krb_err.et
+
KRBHDEP = $(INC)krb5.hin $(INC)krb5_err.h $(INC)kdb5_err.h \
$(INC)kv5m_err.h $(INC)asn1_err.h
+2003-02-07 Tom Yu <tlyu@mit.edu>
+
+ * krb.h: Declare krb_err_txt differently on Mac.
+
2003-01-16 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (all-unix, install): Build and install kadm_err.h.
#define KRB_UINT32 DES_UINT32
#define MAX_KRB_ERRORS 256
+
+#if TARGET_OS_MAC
+/* ABI divergence on Mac for backwards compatibility. */
extern const char * const * const krb_err_txt;
+#else
+extern const char * const krb_err_txt[MAX_KRB_ERRORS];
+#endif
/* General definitions */
#define KSUCCESS 0
/* Used to return pointer to non-const char */
const char * KRB5_CALLCONV tkt_string
(void);
+/* Previously not KRB5_CALLCONV */
void KRB5_CALLCONV krb_set_tkt_string
(char *);
+2003-02-07 Tom Yu <tlyu@mit.edu>
+
+ * Makefile.in: Add rules to generate krb_err_txt.c.
+
+ * err_txt.c: Include two copies of the error table, one generated
+ by com_err, and one generated by a special-purpose awk script.
+
+ * et_errtxt.awk: New file; used to generate krb_err_txt.c
+
2003-02-04 Tom Yu <tlyu@mit.edu>
* decomp_tkt.c (dcmp_tkt_int): Patch from Booker Bense to use
kadm_err.h: kadm_err.et
kadm_err.c: kadm_err.et
+GEN_ERRTXT=$(AWK) -f $(srcdir)$(S)et_errtxt.awk outfile=$@
+
+krb_err_txt.c: krb_err.et $(srcdir)$(S)et_errtxt.awk
+ $(GEN_ERRTXT) $(srcdir)/krb_err.et
+
+err_txt.so err_txt.po $(OUTPRE)err_txt.$(OBJEXT): err_txt.c krb_err_txt.c
+
depend-dependencies: krb_err.h $(EHDRDIR)$(S)krb_err.h \
kadm_err.h $(EHDRDIR)$(S)kadm_err.h \
krb_err.c
/*
* This is gross. We want krb_err_txt to match the contents of the
- * com_err error table, but the text is static in krb_err.c. To avoid
- * multiple registrations of the error table, we also want to override
+ * com_err error table, but the text is static in krb_err.c. We can't
+ * alias it by making a pointer to it, either, so we have to suck in
+ * another copy of it that is named differently. Also, to avoid
+ * multiple registrations of the error table, we want to override
* initialize_krb_error_table() in case someone decides to call it.
*/
#undef initialize_krb_error_table
void krb4int_init_krb_err_tbl(void);
#include "krb_err.c"
#undef initialize_krb_error_table
+#include "krb_err_txt.c"
void initialize_krb_error_table(void);
-/* YUCK -- depends on naming of the static table. */
-const char * const * const krb_err_txt = text;
-
static int inited = 0;
void
--- /dev/null
+/^[ \t]*(error_table|et)[ \t]+[a-zA-Z][a-zA-Z0-9_]+/ {
+ print "/*" > outfile
+ print " * " outfile ":" > outfile
+ print " * This file is automatically generated; please do not edit it." > outfile
+ print " */" > outfile
+ print "#if TARGET_OS_MAC" > outfile
+ print "const char * const * const krb_err_txt" > outfile
+ print "#else" > outfile
+ print "const char * const krb_err_txt[]" > outfile
+ print "#endif" > outfile
+ print "\t= {" > outfile
+ table_item_count = 0
+}
+
+(continuation == 1) && ($0 ~ /\\[ \t]*$/) {
+ text=substr($0,1,length($0)-1);
+# printf "\t\t\"%s\"\n", text > outfile
+ cont_buf=cont_buf text;
+}
+
+(continuation == 1) && ($0 ~ /"[ \t]*$/) {
+# "
+# printf "\t\t\"%s,\n", $0 > outfile
+ printf "\t%s,\n", cont_buf $0 > outfile
+ continuation = 0;
+}
+/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,[ \t]*$/ {
+ table_item_count++
+ skipone=1
+ next
+}
+
+/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,[ \t]*".*"[ \t]*$/ {
+ text=""
+ for (i=3; i<=NF; i++) {
+ text = text FS $i
+ }
+ text=substr(text,2,length(text)-1);
+ printf "\t%s,\n", text > outfile
+ table_item_count++
+}
+/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,[ \t]*".*\\[ \t]*$/ {
+ text=""
+ for (i=3; i<=NF; i++) {
+ text = text FS $i
+ }
+ text=substr(text,2,length(text)-2);
+# printf "\t%s\"\n", text > outfile
+ cont_buf=text
+ continuation++;
+}
+
+/^[ \t]*".*\\[ \t]*$/ {
+ if (skipone) {
+ text=substr($0,1,length($0)-1);
+# printf "\t%s\"\n", text > outfile
+ cont_buf=text
+ continuation++;
+ }
+ skipone=0
+}
+
+{
+ if (skipone) {
+ printf "\t%s,\n", $0 > outfile
+ }
+ skipone=0
+}
+END {
+ print "};" > outfile
+}