summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2001-01-20 01:54:16 +0000
committerKen Raeburn <raeburn@mit.edu>2001-01-20 01:54:16 +0000
commit5f337297f9e6f6f22473e6226c41b8a105c4dbab (patch)
tree2a6b49d52c9ed307c04cd130cb32443f4470e0d7
parent926dbfad5bd7cdda2545e082c40e3ad531154302 (diff)
downloadkrb5-5f337297f9e6f6f22473e6226c41b8a105c4dbab.tar.gz
krb5-5f337297f9e6f6f22473e6226c41b8a105c4dbab.tar.xz
krb5-5f337297f9e6f6f22473e6226c41b8a105c4dbab.zip
* 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
-rw-r--r--src/util/et/ChangeLog16
-rw-r--r--src/util/et/com_err.h18
-rw-r--r--src/util/et/error_message.c20
-rw-r--r--src/util/et/error_table.h8
-rw-r--r--src/util/et/et_c.awk11
5 files changed, 48 insertions, 25 deletions
diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog
index 0ab1891988..8853feb548 100644
--- a/src/util/et/ChangeLog
+++ b/src/util/et/ChangeLog
@@ -1,3 +1,19 @@
+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
diff --git a/src/util/et/com_err.h b/src/util/et/com_err.h
index dca104b131..4e519ccb0b 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 1afdeb8638..50f313cbcd 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 18bf676804..6c32f6a9b9 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 65396d443f..5e55235e31 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
}