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
+2001-01-19 Ken Raeburn <raeburn@mit.edu>
+
+ * 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 <raeburn@mit.edu>
* error_message.c (add_error_table, remove_error_table): Allow
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
(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)
/*
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;
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;
#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;
}
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
}