aboutsummaryrefslogtreecommitdiffstats
path: root/prefs.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-11-04 02:50:21 +0000
committerGuy Harris <guy@alum.mit.edu>2001-11-04 02:50:21 +0000
commitcc7347ebf6888d718c1216ff81488447eaaeafcd (patch)
tree571378721f73038ee7db6c58e814cde559b8a647 /prefs.h
parent52bf3d770f472b5a605ac4114c9ef1535a041f2f (diff)
Allow a dissector to register preferences that it no longer supports as
obsolete; we silently ignore attempts to set those in a preferences file, so that we don't spam the user with error messages caused by them having saved preferences in an earlier release that contained those preferences. Make the Diameter and iSCSI dissectors register obsolete preferences. Crash if some code tries to register a preferences module with a name that contains something other than lower-case ASCII letters, numbers, or underscores, or that has already been registered, or if some code tries to register a preference with a name that contains something other than lower-case ASCII letters, numbers, underscores, or periods, or that has already been registered, so that we don't put code like that in a release and have to shovel code into "prefs.c" to fix it up later. (The problem with multiple modules or preferences with the same name should be obvious; the problem with names with blanks, or upper-case letters, or punctuation, is that they're a pain to type on the command line.) svn path=/trunk/; revision=4148
Diffstat (limited to 'prefs.h')
-rw-r--r--prefs.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/prefs.h b/prefs.h
index b637f7f046..c8b88276dc 100644
--- a/prefs.h
+++ b/prefs.h
@@ -1,7 +1,7 @@
/* prefs.h
* Definitions for preference handling routines
*
- * $Id: prefs.h,v 1.33 2001/10/31 07:47:25 guy Exp $
+ * $Id: prefs.h,v 1.34 2001/11/04 02:50:19 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -161,6 +161,12 @@ extern void prefs_register_enum_preference(module_t *module, const char *name,
extern void prefs_register_string_preference(module_t *module, const char *name,
const char *title, const char *description, char **var);
+/*
+ * Register a preference that used to be supported but no longer is.
+ */
+extern void prefs_register_obsolete_preference(module_t *module,
+ const char *name);
+
typedef void (*pref_cb)(pref_t *pref, gpointer user_data);
/*
@@ -212,6 +218,7 @@ extern void free_prefs(e_prefs *pr);
#define PREFS_SET_OK 0 /* succeeded */
#define PREFS_SET_SYNTAX_ERR 1 /* syntax error in string */
#define PREFS_SET_NO_SUCH_PREF 2 /* no such preference */
+#define PREFS_SET_OBSOLETE 3 /* preference used to exist but no longer does */
extern int prefs_set_pref(char *prefarg);