From cc7347ebf6888d718c1216ff81488447eaaeafcd Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 4 Nov 2001 02:50:21 +0000 Subject: 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 --- prefs.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'prefs.h') 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 @@ -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); -- cgit v1.2.3