From: Ken Raeburn Date: Sat, 20 Jan 2001 01:54:16 +0000 (+0000) Subject: * com_err.h (add_error_table, remove_error_table): Annotate as modifying X-Git-Tag: krb5-1.3-alpha1~1714 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5f337297f9e6f6f22473e6226c41b8a105c4dbab;p=krb5.git * com_err.h (add_error_table, remove_error_table): Annotate as modifying internal state. (struct et_list, _et_list): Remove. * error_table.h (struct et_list, _et_list): Put back here. * error_message.c (add_error_table, remove_error_table): Annotate specific modifications. Disable inconsistent-defifition checks since _et_list isn't describe in the header file but is global and modified. * et_c.awk: Make the generated initialization function simply call add_error_table, and drop the static linked-list node. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12915 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog index 0ab189198..8853feb54 100644 --- a/src/util/et/ChangeLog +++ b/src/util/et/ChangeLog @@ -1,3 +1,19 @@ +2001-01-19 Ken Raeburn + + * com_err.h (add_error_table, remove_error_table): Annotate as + modifying internal state. + (struct et_list, _et_list): Remove. + + * error_table.h (struct et_list, _et_list): Put back here. + + * error_message.c (add_error_table, remove_error_table): Annotate + specific modifications. Disable inconsistent-defifition checks + since _et_list isn't describe in the header file but is global and + modified. + + * et_c.awk: Make the generated initialization function simply call + add_error_table, and drop the static linked-list node. + 2001-01-17 Ken Raeburn * error_message.c (add_error_table, remove_error_table): Allow diff --git a/src/util/et/com_err.h b/src/util/et/com_err.h index dca104b13..4e519ccb0 100644 --- a/src/util/et/com_err.h +++ b/src/util/et/com_err.h @@ -45,18 +45,6 @@ struct error_table { unsigned int n_msgs; }; -/* These are for INTERNAL USE ONLY! Don't rely on them, we're trying - to eliminate them. They're currently used for some internal stuff - in generated files. */ -struct et_list { - /*@dependent@*//*@null@*/ struct et_list *next; - /*@dependent@*//*@null@*/ const struct error_table FAR *table; -}; -#if !defined(_MSDOS) && !defined(_WIN32) && !defined(macintosh) -/*@null@*//*@dependent@*/ extern struct et_list * _et_list; -#endif -/* end INTERNAL stuff */ - #ifdef __cplusplus extern "C" { #endif @@ -71,9 +59,11 @@ KRB5_DLLIMP extern /*@observer@*//*@dependent@*/ const char FAR * KRB5_CALLCONV (errcode_t) /*@modifies internalState@*/; KRB5_DLLIMP extern errcode_t KRB5_CALLCONV add_error_table - (/*@dependent@*/ const struct error_table FAR *); + (/*@dependent@*/ const struct error_table FAR *) + /*@modifies internalState@*/; KRB5_DLLIMP extern errcode_t KRB5_CALLCONV remove_error_table - (const struct error_table FAR *); + (const struct error_table FAR *) + /*@modifies internalState@*/; #if !defined(_MSDOS) && !defined(_WIN32) && !defined(macintosh) /* diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c index 1afdeb863..50f313cbc 100644 --- a/src/util/et/error_message.c +++ b/src/util/et/error_message.c @@ -231,9 +231,15 @@ oops: return(buffer); } +/*@-incondefs@*/ /* _et_list is global on unix but not in header annotations */ KRB5_DLLIMP errcode_t KRB5_CALLCONV -add_error_table(et) - /*@dependent@*/ const struct error_table FAR * et; +add_error_table(/*@dependent@*/ const struct error_table FAR * et) +#ifndef _MSDOS + /*@modifies _et_list,et_list_dynamic@*/ +#else + /*@modifies _et_list,et_list_dynamic,etl_used,etl@*/ +#endif +/*@=incondefs@*/ { struct dynamic_et_list *del; @@ -257,9 +263,15 @@ add_error_table(et) return 0; } +/*@-incondefs@*/ /* _et_list is global on unix but not in header annotations */ KRB5_DLLIMP errcode_t KRB5_CALLCONV -remove_error_table(et) - const struct error_table FAR * et; +remove_error_table(const struct error_table FAR * et) +#ifdef _MSDOS + /*@modifies _et_list,et_list_dynamic,etl_used,etl@*/ +#else + /*@modifies _et_list,et_list_dynamic@*/ +#endif +/*@=incondefs@*/ { struct dynamic_et_list **del; struct et_list **el; diff --git a/src/util/et/error_table.h b/src/util/et/error_table.h index 18bf67680..6c32f6a9b 100644 --- a/src/util/et/error_table.h +++ b/src/util/et/error_table.h @@ -15,6 +15,14 @@ #define ET_EBUFSIZ 64 #endif +struct et_list { + /*@dependent@*//*@null@*/ struct et_list *next; + /*@dependent@*//*@null@*/ const struct error_table FAR *table; +}; +#if !defined(_MSDOS) && !defined(_WIN32) && !defined(macintosh) +/*@null@*//*@dependent@*/ extern struct et_list * _et_list; +#endif + struct dynamic_et_list { /*@only@*//*@null@*/ struct dynamic_et_list *next; /*@dependent@*/ const struct error_table FAR *table; diff --git a/src/util/et/et_c.awk b/src/util/et/et_c.awk index 65396d443..5e55235e3 100644 --- a/src/util/et/et_c.awk +++ b/src/util/et/et_c.awk @@ -200,13 +200,10 @@ END { } print "" > outfile print "#if !defined(_MSDOS) && !defined(_WIN32) && !defined(macintosh)" > outfile - print "static struct et_list link = { 0, 0 };" > outfile - print "void initialize_" table_name "_error_table (void) {" > outfile - print " if (!link.table) {" > outfile - print " link.next = _et_list;" > outfile - print " link.table = &et_" table_name "_error_table;" > outfile - print " _et_list = &link;" > outfile - print " }" > outfile + print "void initialize_" table_name "_error_table (void)" > outfile + print " /*@modifies internalState@*/" > outfile + print "{" > outfile + print " (void) add_error_table (&et_" table_name "_error_table);" > outfile print "}" > outfile print "#endif" > outfile }