1998-09-25 23:24:07 +00:00
|
|
|
/* prefs.h
|
|
|
|
* Definitions for preference handling routines
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1998-09-25 23:24:07 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1998-09-25 23:24:07 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-25 23:24:07 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-25 23:24:07 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-25 23:24:07 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PREFS_H__
|
|
|
|
#define __PREFS_H__
|
|
|
|
|
2000-11-21 23:54:10 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include "color.h"
|
|
|
|
|
2004-10-14 23:45:09 +00:00
|
|
|
#include <epan/range.h>
|
|
|
|
|
1998-10-28 21:38:11 +00:00
|
|
|
#define PR_DEST_CMD 0
|
|
|
|
#define PR_DEST_FILE 1
|
|
|
|
|
2001-12-31 04:41:50 +00:00
|
|
|
#define DEF_WIDTH 750
|
|
|
|
#define DEF_HEIGHT 550
|
|
|
|
|
2003-09-08 21:44:42 +00:00
|
|
|
#define MAX_VAL_LEN 1024
|
|
|
|
|
2008-01-16 07:36:34 +00:00
|
|
|
#define RTP_PLAYER_DEFAULT_VISIBLE 4
|
2008-04-21 10:57:32 +00:00
|
|
|
#define TAP_UPDATE_DEFAULT_INTERVAL 3000
|
2008-01-16 07:36:34 +00:00
|
|
|
|
2001-05-31 08:36:46 +00:00
|
|
|
/*
|
|
|
|
* Convert a string listing name resolution types to a bitmask of
|
|
|
|
* those types.
|
|
|
|
*
|
|
|
|
* Set "*name_resolve" to the bitmask, and return '\0', on success;
|
|
|
|
* return the bad character in the string on error.
|
|
|
|
*/
|
|
|
|
char string_to_name_resolve(char *string, guint32 *name_resolve);
|
|
|
|
|
2003-10-14 23:20:17 +00:00
|
|
|
/*
|
|
|
|
* Modes for the starting directory in File Open dialogs.
|
|
|
|
*/
|
|
|
|
#define FO_STYLE_LAST_OPENED 0 /* start in last directory we looked at */
|
|
|
|
#define FO_STYLE_SPECIFIED 1 /* start in specified directory */
|
|
|
|
|
2003-10-16 21:19:12 +00:00
|
|
|
/*
|
|
|
|
* Toolbar styles.
|
|
|
|
*/
|
|
|
|
#define TB_STYLE_ICONS 0
|
|
|
|
#define TB_STYLE_TEXT 1
|
|
|
|
#define TB_STYLE_BOTH 2
|
|
|
|
|
2004-04-30 00:40:45 +00:00
|
|
|
/*
|
|
|
|
* Types of layout of summary/details/hex panes.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
layout_unused, /* entry currently unused */
|
|
|
|
layout_type_5,
|
|
|
|
layout_type_2,
|
|
|
|
layout_type_1,
|
|
|
|
layout_type_4,
|
|
|
|
layout_type_3,
|
2004-05-05 07:31:05 +00:00
|
|
|
layout_type_6,
|
|
|
|
layout_type_max
|
2004-04-30 00:40:45 +00:00
|
|
|
} layout_type_e;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Types of pane.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
layout_pane_content_none,
|
|
|
|
layout_pane_content_plist,
|
|
|
|
layout_pane_content_pdetails,
|
|
|
|
layout_pane_content_pbytes
|
|
|
|
} layout_pane_content_e;
|
|
|
|
|
2004-05-13 15:28:02 +00:00
|
|
|
/*
|
|
|
|
* open console behaviour (win32 only)
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
console_open_never,
|
|
|
|
console_open_auto,
|
2004-05-13 16:34:29 +00:00
|
|
|
console_open_always
|
2004-05-13 15:28:02 +00:00
|
|
|
} console_open_e;
|
|
|
|
|
2004-04-30 00:40:45 +00:00
|
|
|
|
1998-10-28 21:38:11 +00:00
|
|
|
typedef struct _e_prefs {
|
1999-12-02 04:30:15 +00:00
|
|
|
gint pr_format;
|
|
|
|
gint pr_dest;
|
|
|
|
gchar *pr_file;
|
|
|
|
gchar *pr_cmd;
|
|
|
|
GList *col_list;
|
|
|
|
gint num_cols;
|
2000-11-21 23:54:10 +00:00
|
|
|
color_t st_client_fg, st_client_bg, st_server_fg, st_server_bg;
|
Instead of having the normal-weight and bold fonts set separately,
generate the name of the boldface font from the Roman font; if the two
fonts don't have the same widths, the display will look weird when a
field is selected, and it's a bit of a pain for the user to have to
select *two* fonts.
On UNIX/X, default to
"-*-fixed-medium-r-semicondensed-*-*-120-*-*-*-*-*-" rather than to
"-*-lucidatypewriter-medium-r-normal-*-*-120-*-*-*-*-iso8859-1" - some
Linux distributions appear to lack the Lucida typewriter font.
Add a "gui.font_name" preference to the preferences file, specifying the
normal-weight font to use. Have it settable from the "GUI" tab in the
Preferences dialog box - the "Font..." button, when clicked, pops up a
font selection dialog box.
If we either can't open the selected font or the boldfaced version of
the font, default to "6x13" and "6x13bold" as fallbacks - the former
will probably be "fixed", and the latter would be "fixedbold" if X
actually created such an alias, but it doesn't so we use "6x13bold"
instead.
svn path=/trunk/; revision=2304
2000-08-20 07:53:45 +00:00
|
|
|
gboolean gui_scrollbar_on_right;
|
|
|
|
gboolean gui_plist_sel_browse;
|
|
|
|
gboolean gui_ptree_sel_browse;
|
2002-09-14 10:07:40 +00:00
|
|
|
gboolean gui_altern_colors;
|
2004-04-06 19:02:18 +00:00
|
|
|
gboolean filter_toolbar_show_in_statusbar;
|
Instead of having the normal-weight and bold fonts set separately,
generate the name of the boldface font from the Roman font; if the two
fonts don't have the same widths, the display will look weird when a
field is selected, and it's a bit of a pain for the user to have to
select *two* fonts.
On UNIX/X, default to
"-*-fixed-medium-r-semicondensed-*-*-120-*-*-*-*-*-" rather than to
"-*-lucidatypewriter-medium-r-normal-*-*-120-*-*-*-*-iso8859-1" - some
Linux distributions appear to lack the Lucida typewriter font.
Add a "gui.font_name" preference to the preferences file, specifying the
normal-weight font to use. Have it settable from the "GUI" tab in the
Preferences dialog box - the "Font..." button, when clicked, pops up a
font selection dialog box.
If we either can't open the selected font or the boldfaced version of
the font, default to "6x13" and "6x13bold" as fallbacks - the former
will probably be "fixed", and the latter would be "fixedbold" if X
actually created such an alias, but it doesn't so we use "6x13bold"
instead.
svn path=/trunk/; revision=2304
2000-08-20 07:53:45 +00:00
|
|
|
gint gui_ptree_line_style;
|
|
|
|
gint gui_ptree_expander_style;
|
2000-09-08 09:50:08 +00:00
|
|
|
gboolean gui_hex_dump_highlight_style;
|
2003-10-16 21:19:12 +00:00
|
|
|
gint gui_toolbar_main_style;
|
2008-04-08 04:47:32 +00:00
|
|
|
gchar *gui_font_name;
|
2000-11-21 23:54:10 +00:00
|
|
|
color_t gui_marked_fg;
|
|
|
|
color_t gui_marked_bg;
|
2007-11-24 11:38:16 +00:00
|
|
|
gchar *gui_colorized_fg;
|
|
|
|
gchar *gui_colorized_bg;
|
2001-12-31 04:41:50 +00:00
|
|
|
gboolean gui_geometry_save_position;
|
|
|
|
gboolean gui_geometry_save_size;
|
2004-02-01 20:28:11 +00:00
|
|
|
gboolean gui_geometry_save_maximized;
|
2008-10-26 23:07:37 +00:00
|
|
|
gboolean gui_macosx_style;
|
2004-05-13 15:28:02 +00:00
|
|
|
console_open_e gui_console_open;
|
2008-08-08 19:41:35 +00:00
|
|
|
guint gui_recent_df_entries_max;
|
2003-12-29 19:59:05 +00:00
|
|
|
guint gui_recent_files_count_max;
|
2004-08-31 09:22:57 +00:00
|
|
|
guint gui_fileopen_style;
|
2003-10-14 23:20:17 +00:00
|
|
|
gchar *gui_fileopen_dir;
|
2004-08-31 09:22:57 +00:00
|
|
|
guint gui_fileopen_preview;
|
2004-06-20 15:57:11 +00:00
|
|
|
gboolean gui_ask_unsaved;
|
2004-08-15 19:26:25 +00:00
|
|
|
gboolean gui_find_wrap;
|
2006-10-03 19:53:10 +00:00
|
|
|
gboolean gui_use_pref_save;
|
2004-06-29 17:10:53 +00:00
|
|
|
gchar *gui_webbrowser;
|
2004-12-02 11:30:24 +00:00
|
|
|
gchar *gui_window_title;
|
2008-10-06 22:49:01 +00:00
|
|
|
gchar *gui_start_title;
|
2008-10-07 15:18:40 +00:00
|
|
|
gboolean gui_version_in_start_page;
|
2004-04-30 00:40:45 +00:00
|
|
|
layout_type_e gui_layout_type;
|
|
|
|
layout_pane_content_e gui_layout_content_1;
|
|
|
|
layout_pane_content_e gui_layout_content_2;
|
|
|
|
layout_pane_content_e gui_layout_content_3;
|
2005-10-12 21:26:27 +00:00
|
|
|
gint console_log_level;
|
2001-05-31 08:36:46 +00:00
|
|
|
guint32 name_resolve;
|
2003-07-22 03:14:31 +00:00
|
|
|
gint name_resolve_concurrency;
|
2002-01-10 07:43:39 +00:00
|
|
|
gchar *capture_device;
|
2008-06-02 17:45:03 +00:00
|
|
|
gchar *capture_devices_linktypes;
|
2003-09-08 21:44:42 +00:00
|
|
|
gchar *capture_devices_descr;
|
|
|
|
gchar *capture_devices_hide;
|
2001-04-13 14:59:30 +00:00
|
|
|
gboolean capture_prom_mode;
|
2009-06-15 16:36:02 +00:00
|
|
|
gboolean capture_pcap_ng;
|
2001-04-13 14:59:30 +00:00
|
|
|
gboolean capture_real_time;
|
|
|
|
gboolean capture_auto_scroll;
|
2004-06-20 14:48:24 +00:00
|
|
|
gboolean capture_show_info;
|
2008-01-16 07:36:34 +00:00
|
|
|
guint rtp_player_max_visible;
|
2008-04-21 10:57:32 +00:00
|
|
|
guint tap_update_interval;
|
2008-04-17 23:14:01 +00:00
|
|
|
gboolean display_hidden_proto_items;
|
1998-10-28 21:38:11 +00:00
|
|
|
} e_prefs;
|
|
|
|
|
2006-06-20 18:30:54 +00:00
|
|
|
WS_VAR_IMPORT e_prefs prefs;
|
1999-07-23 08:29:24 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Routines to let modules that have preference settings register
|
|
|
|
* themselves by name, and to let them register preference settings
|
|
|
|
* by name.
|
|
|
|
*/
|
|
|
|
struct pref_module;
|
|
|
|
|
|
|
|
typedef struct pref_module module_t;
|
|
|
|
|
2007-11-30 09:22:01 +00:00
|
|
|
/** Sets up memory used by proto routines. Called at program startup */
|
|
|
|
extern void prefs_init(void);
|
|
|
|
|
2008-01-14 16:40:23 +00:00
|
|
|
/** Reset preferences to default values. Called at profile change */
|
|
|
|
extern void prefs_reset(void);
|
|
|
|
|
2007-11-30 09:22:01 +00:00
|
|
|
/** Frees memory used by proto routines. Called at program shutdown */
|
|
|
|
extern void prefs_cleanup(void);
|
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Register a module that will have preferences.
|
2002-12-20 01:48:57 +00:00
|
|
|
* Specify the module under which to register it or NULL to register it
|
|
|
|
* at the top level, the name used for the module in the preferences file,
|
|
|
|
* the title used in the tab for it in a preferences dialog box, and a
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
* routine to call back when we apply the preferences.
|
2002-12-20 01:48:57 +00:00
|
|
|
*
|
|
|
|
* This should not be used for dissector preferences;
|
|
|
|
* "prefs_register_protocol()" should be used for that, so that the
|
|
|
|
* preferences go under the "Protocols" subtree, and so that the
|
|
|
|
* name is the protocol name specified at the "proto_register_protocol()"
|
|
|
|
* call so that the "Protocol Properties..." menu item works.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2002-12-20 01:48:57 +00:00
|
|
|
extern module_t *prefs_register_module(module_t *parent, const char *name,
|
2006-09-29 22:48:38 +00:00
|
|
|
const char *title, const char *description, void (*apply_cb)(void));
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2002-12-20 01:48:57 +00:00
|
|
|
/*
|
|
|
|
* Register a subtree that will have modules under it.
|
|
|
|
* Specify the module under which to register it or NULL to register it
|
|
|
|
* at the top level and the title used in the tab for it in a preferences
|
|
|
|
* dialog box.
|
|
|
|
*/
|
2006-09-29 22:48:38 +00:00
|
|
|
extern module_t *prefs_register_subtree(module_t *parent, const char *title,
|
|
|
|
const char *description);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2001-01-03 07:53:48 +00:00
|
|
|
/*
|
|
|
|
* Register that a protocol has preferences.
|
|
|
|
*/
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern module_t *prefs_register_protocol(int id, void (*apply_cb)(void));
|
2001-01-03 07:53:48 +00:00
|
|
|
|
This change allows a structure to be created under the "Protocols" section of the preferences.
A new function is introduced, prefs_register_protocol_subtree(), that allows the subtree the protocol should appear under to be specified. The subtree is specified as a string, with a '/' delimiting each subtree element. For example,
prefs_register_protocol(proto_dap, prefs_register_dap);
becomes
prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap);
The function will create all the intermediate subtree nodes that are required, if they don't already exist.
This allows the grouping of procotols which should make the list of protocols more manageable as even more are added. The current aim is to group by protocol family e.g.
+ OSI
+ X.400
X.411
X.420
+ X.500
DISP
DAP
DOP
DSP
+ X.509
X509AF
X509CE
...
but others grouping could be envisioned (e.g. by first letter).
As the intermediate nodes may already have preferences (e.g. OSI), then modules are now allowed to have submodules. Previously each node was either a subtree or held preferences. This is consistent with the "User Interface" node.
The subtree structure has no effect on how the preferences are saved to file, and the "Protocol Preferences..." menu option will bring up the preferences expanded to the correct node.
In addition, a new "blank page" has been introduced for intermediate nodes that have no preferences (and is also used when the "Protocols" node itself is chosen). This prevents confusion when the user moves from a node with preferences to a node without preferences, but the page old page is still shown.
There is also a change to prevent '#' characters in a value being treated as a comment when parsing the preferences file. (There is nothing that adds comments when writing the preferences file.)
svn path=/trunk/; revision=21066
2007-03-19 19:08:22 +00:00
|
|
|
/*
|
|
|
|
* Register that a protocol has preferences and group it under a single
|
2008-10-06 22:49:01 +00:00
|
|
|
* subtree
|
This change allows a structure to be created under the "Protocols" section of the preferences.
A new function is introduced, prefs_register_protocol_subtree(), that allows the subtree the protocol should appear under to be specified. The subtree is specified as a string, with a '/' delimiting each subtree element. For example,
prefs_register_protocol(proto_dap, prefs_register_dap);
becomes
prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap);
The function will create all the intermediate subtree nodes that are required, if they don't already exist.
This allows the grouping of procotols which should make the list of protocols more manageable as even more are added. The current aim is to group by protocol family e.g.
+ OSI
+ X.400
X.411
X.420
+ X.500
DISP
DAP
DOP
DSP
+ X.509
X509AF
X509CE
...
but others grouping could be envisioned (e.g. by first letter).
As the intermediate nodes may already have preferences (e.g. OSI), then modules are now allowed to have submodules. Previously each node was either a subtree or held preferences. This is consistent with the "User Interface" node.
The subtree structure has no effect on how the preferences are saved to file, and the "Protocol Preferences..." menu option will bring up the preferences expanded to the correct node.
In addition, a new "blank page" has been introduced for intermediate nodes that have no preferences (and is also used when the "Protocols" node itself is chosen). This prevents confusion when the user moves from a node with preferences to a node without preferences, but the page old page is still shown.
There is also a change to prevent '#' characters in a value being treated as a comment when parsing the preferences file. (There is nothing that adds comments when writing the preferences file.)
svn path=/trunk/; revision=21066
2007-03-19 19:08:22 +00:00
|
|
|
*/
|
|
|
|
#define PREFERENCE_GROUPING
|
2008-10-06 22:49:01 +00:00
|
|
|
extern module_t *prefs_register_protocol_subtree(const char *subtree, int id,
|
This change allows a structure to be created under the "Protocols" section of the preferences.
A new function is introduced, prefs_register_protocol_subtree(), that allows the subtree the protocol should appear under to be specified. The subtree is specified as a string, with a '/' delimiting each subtree element. For example,
prefs_register_protocol(proto_dap, prefs_register_dap);
becomes
prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap);
The function will create all the intermediate subtree nodes that are required, if they don't already exist.
This allows the grouping of procotols which should make the list of protocols more manageable as even more are added. The current aim is to group by protocol family e.g.
+ OSI
+ X.400
X.411
X.420
+ X.500
DISP
DAP
DOP
DSP
+ X.509
X509AF
X509CE
...
but others grouping could be envisioned (e.g. by first letter).
As the intermediate nodes may already have preferences (e.g. OSI), then modules are now allowed to have submodules. Previously each node was either a subtree or held preferences. This is consistent with the "User Interface" node.
The subtree structure has no effect on how the preferences are saved to file, and the "Protocol Preferences..." menu option will bring up the preferences expanded to the correct node.
In addition, a new "blank page" has been introduced for intermediate nodes that have no preferences (and is also used when the "Protocols" node itself is chosen). This prevents confusion when the user moves from a node with preferences to a node without preferences, but the page old page is still shown.
There is also a change to prevent '#' characters in a value being treated as a comment when parsing the preferences file. (There is nothing that adds comments when writing the preferences file.)
svn path=/trunk/; revision=21066
2007-03-19 19:08:22 +00:00
|
|
|
void (*apply_cb)(void));
|
|
|
|
|
2002-05-11 18:58:02 +00:00
|
|
|
/*
|
|
|
|
* Register that a protocol used to have preferences but no longer does,
|
|
|
|
* by creating an "obsolete" module for it.
|
|
|
|
*/
|
|
|
|
extern module_t *prefs_register_protocol_obsolete(int id);
|
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
2002-12-20 01:48:57 +00:00
|
|
|
* Callback function for module list scanners.
|
|
|
|
*/
|
2004-10-12 03:13:17 +00:00
|
|
|
typedef guint (*module_cb)(module_t *module, gpointer user_data);
|
2002-12-20 01:48:57 +00:00
|
|
|
|
|
|
|
/*
|
2007-11-29 07:52:52 +00:00
|
|
|
* Returns TRUE if module has any submodules
|
2002-12-20 01:48:57 +00:00
|
|
|
*/
|
2007-11-29 07:52:52 +00:00
|
|
|
extern gboolean prefs_module_has_submodules(module_t *module);
|
2002-12-20 01:48:57 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Call a callback function, with a specified argument, for each module
|
|
|
|
* in the list of all modules. (This list does not include subtrees.)
|
|
|
|
*
|
2002-05-11 18:58:02 +00:00
|
|
|
* Ignores "obsolete" modules; their sole purpose is to allow old
|
|
|
|
* preferences for dissectors that no longer have preferences to be
|
|
|
|
* silently ignored in preference files.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2004-10-12 03:13:17 +00:00
|
|
|
extern guint prefs_modules_foreach(module_cb callback, gpointer user_data);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2007-11-29 07:52:52 +00:00
|
|
|
/*
|
|
|
|
* Call a callback function, with a specified argument, for each submodule
|
|
|
|
* of specified modules. If the module is NULL, goes through the top-level
|
|
|
|
* list in the display tree of modules.
|
|
|
|
*
|
|
|
|
* Ignores "obsolete" modules; their sole purpose is to allow old
|
|
|
|
* preferences for dissectors that no longer have preferences to be
|
|
|
|
* silently ignored in preference files. Does not ignore subtrees,
|
|
|
|
* as this can be used when walking the display tree of modules.
|
|
|
|
*/
|
|
|
|
extern guint prefs_modules_foreach_submodules(module_t *module, module_cb callback, gpointer user_data);
|
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
2000-07-09 03:29:42 +00:00
|
|
|
* Call the "apply" callback function for each module if any of its
|
|
|
|
* preferences have changed, and then clear the flag saying its
|
|
|
|
* preferences have changed, as the module has been notified of that
|
|
|
|
* fact.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern void prefs_apply_all(void);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2006-10-11 00:37:29 +00:00
|
|
|
/*
|
|
|
|
* Call the "apply" callback function for a specific module if any of
|
|
|
|
* its preferences have changed, and then clear the flag saying its
|
|
|
|
* preferences have changed, as the module has been notified of that
|
|
|
|
* fact.
|
|
|
|
*/
|
|
|
|
extern void prefs_apply(module_t *module);
|
|
|
|
|
2006-11-17 01:24:03 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
struct preference;
|
|
|
|
|
|
|
|
typedef struct preference pref_t;
|
|
|
|
|
2000-08-15 20:46:17 +00:00
|
|
|
/*
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
* Returns TRUE if the given protocol has registered preferences.
|
2000-08-15 20:46:17 +00:00
|
|
|
*/
|
2005-06-24 01:32:42 +00:00
|
|
|
extern gboolean prefs_is_registered_protocol(const char *name);
|
2000-08-15 20:46:17 +00:00
|
|
|
|
|
|
|
/*
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
* Returns the module title of a registered protocol (or NULL if unknown).
|
2000-08-15 20:46:17 +00:00
|
|
|
*/
|
2005-06-24 01:32:42 +00:00
|
|
|
extern const char *prefs_get_title_by_name(const char *name);
|
2000-08-15 20:46:17 +00:00
|
|
|
|
2006-11-17 01:24:03 +00:00
|
|
|
/** Given a module name, return a pointer to its pref_module struct,
|
|
|
|
* or NULL if it's not found.
|
|
|
|
*
|
|
|
|
* @param name The preference module name. Usually the same as the protocol
|
|
|
|
* name, e.g. "tcp".
|
|
|
|
* @return A pointer to the corresponding preference module, or NULL if it
|
|
|
|
* wasn't found.
|
|
|
|
*/
|
|
|
|
extern module_t *prefs_find_module(const char *name);
|
|
|
|
|
2009-01-06 14:34:18 +00:00
|
|
|
/** Given a module name, and a preference name return a pointer to the given
|
|
|
|
* module's given preference or NULL if it's not found.
|
|
|
|
*
|
|
|
|
* @param module The preference module name. Usually the same as the protocol
|
|
|
|
* name, e.g. "tcp".
|
|
|
|
* @param pref The preference name, e.g. "desegment".
|
|
|
|
* @return A pointer to the corresponding preference, or NULL if it
|
|
|
|
* wasn't found.
|
|
|
|
*/
|
|
|
|
extern pref_t *prefs_find_preference(module_t * module, const char *pref);
|
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Register a preference with an unsigned integral value.
|
|
|
|
*/
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern void prefs_register_uint_preference(module_t *module, const char *name,
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
const char *title, const char *description, guint base, guint *var);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Register a preference with an Boolean value.
|
2008-03-05 20:44:02 +00:00
|
|
|
* Note that the name must be in lowercase letters only (underscore allowed).
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern void prefs_register_bool_preference(module_t *module, const char *name,
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
const char *title, const char *description, gboolean *var);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Register a preference with an enumerated value.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
2005-07-21 17:04:10 +00:00
|
|
|
const char *name;
|
|
|
|
const char *description;
|
|
|
|
gint value;
|
2000-11-18 21:41:40 +00:00
|
|
|
} enum_val_t;
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern void prefs_register_enum_preference(module_t *module, const char *name,
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
const char *title, const char *description, gint *var,
|
2000-11-18 21:41:40 +00:00
|
|
|
const enum_val_t *enumvals, gboolean radio_buttons);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Register a preference with a character-string value.
|
|
|
|
*/
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern void prefs_register_string_preference(module_t *module, const char *name,
|
2005-07-23 11:41:25 +00:00
|
|
|
const char *title, const char *description, const char **var);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2004-10-14 23:45:09 +00:00
|
|
|
/*
|
|
|
|
* Register a preference with a ranged value.
|
|
|
|
*/
|
|
|
|
extern void prefs_register_range_preference(module_t *module, const char *name,
|
2004-10-16 23:32:24 +00:00
|
|
|
const char *title, const char *description, range_t **var,
|
2004-10-14 23:45:09 +00:00
|
|
|
guint32 max_value);
|
|
|
|
|
2006-12-05 00:43:00 +00:00
|
|
|
/*
|
|
|
|
* Register a static text 'preference'. It can be used to add some info/explanation.
|
|
|
|
*/
|
|
|
|
extern void prefs_register_static_text_preference(module_t *module, const char *name,
|
|
|
|
const char *title, const char *description);
|
|
|
|
|
2007-02-03 14:25:02 +00:00
|
|
|
/*
|
|
|
|
* Register a uat 'preference'. It adds a button that opens the uat's window in the
|
|
|
|
* preferences tab of the module.
|
|
|
|
*/
|
|
|
|
extern void prefs_register_uat_preference(module_t *module,
|
|
|
|
const char *name,
|
|
|
|
const char* title,
|
|
|
|
const char *description,
|
|
|
|
void* uat);
|
|
|
|
|
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
2001-11-04 02:50:21 +00:00
|
|
|
/*
|
|
|
|
* Register a preference that used to be supported but no longer is.
|
|
|
|
*/
|
|
|
|
extern void prefs_register_obsolete_preference(module_t *module,
|
|
|
|
const char *name);
|
|
|
|
|
2003-10-02 21:06:11 +00:00
|
|
|
typedef guint (*pref_cb)(pref_t *pref, gpointer user_data);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Call a callback function, with a specified argument, for each preference
|
|
|
|
* in a given module.
|
2003-10-02 21:06:11 +00:00
|
|
|
*
|
|
|
|
* If any of the callbacks return a non-zero value, stop and return that
|
|
|
|
* value, otherwise return 0.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2003-10-02 21:06:11 +00:00
|
|
|
extern guint prefs_pref_foreach(module_t *module, pref_cb callback,
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
gpointer user_data);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2008-04-12 19:37:05 +00:00
|
|
|
/* Parse through a list of comma-separated, possibly quoted strings.
|
2008-10-06 22:49:01 +00:00
|
|
|
* Return a list of the string data.
|
2008-04-12 19:37:05 +00:00
|
|
|
*/
|
|
|
|
extern GList *prefs_get_string_list(gchar *str);
|
|
|
|
|
|
|
|
/* Clear the given list of string data. */
|
|
|
|
extern void prefs_clear_string_list(GList *sl);
|
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Register all non-dissector modules' preferences.
|
|
|
|
*/
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern void prefs_register_modules(void);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
/* Read the preferences file, fill in "prefs", and return a pointer to it.
|
|
|
|
|
|
|
|
If we got an error (other than "it doesn't exist") trying to read
|
|
|
|
the global preferences file, stuff the errno into "*gpf_errno_return"
|
2003-08-07 00:41:28 +00:00
|
|
|
on an open error and into "*gpf_read_errno_return" on a read error,
|
|
|
|
stuff a pointer to the path of the file into "*gpf_path_return", and
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
return NULL.
|
|
|
|
|
|
|
|
If we got an error (other than "it doesn't exist") trying to read
|
|
|
|
the user's preferences file, stuff the errno into "*pf_errno_return"
|
2003-08-07 00:41:28 +00:00
|
|
|
on an open error and into "*pf_read_errno_return" on a read error,
|
|
|
|
stuff a pointer to the path of the file into "*pf_path_return", and
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
return NULL. */
|
2003-08-07 00:41:28 +00:00
|
|
|
extern e_prefs *read_prefs(int *, int *, char **, int *, int *, char **);
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
|
|
|
|
/* Write out "prefs" to the user's preferences file, and return 0.
|
|
|
|
|
|
|
|
If we got an error, stuff a pointer to the path of the preferences file
|
|
|
|
into "*pf_path_return", and return the errno. */
|
2002-08-01 03:15:29 +00:00
|
|
|
extern int write_prefs(char **);
|
1998-09-25 23:24:07 +00:00
|
|
|
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
/* Copy a set of preferences. */
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern void copy_prefs(e_prefs *dest, e_prefs *src);
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
|
|
|
|
/* Free a set of preferences. */
|
Put "extern" in front of a pile of function declarations.
It makes no difference if they really are function declarations;
however, in plugins, when building on OSes that don't let
dynamically-loaded modules access functions in the main program (e.g.,
Windows), when compiling a plugin, <plugin_api.h> defines the names of
those functions as (*pointer_name), so they turn into declarations of
pointer variables pointing to the functions in question, and, on
platforms with a def/ref model in the linker, if a plugin has more than
one source file that gets linked into the plugin, the linker may get
upset at two definitions of the same variable.
svn path=/trunk/; revision=4114
2001-10-31 07:47:27 +00:00
|
|
|
extern void free_prefs(e_prefs *pr);
|
Instead of each set of built-in preferences having "ok", "save",
"cancel", and "delete" methods, give them:
"fetch" - fetch from the notebook tab any values not already
stored in "prefs", and store them there, but doesn't apply them;
"apply" - apply the settings in "prefs";
"destroy" - clean up any windows created from the tab.
As we no longer have "cancel" methods, we don't have per-preference code
to revert preference values; instead, we have the common preference
dialog box code make a copy of all the current preferences, and, when
the "Cancel" button is clicked, free the current preferences and copy
the saved preferences to it, and apply the preferences.
Add an "Apply" button to the preference dialog box, which applies the
current preferences without closing the dialog box.
Treat a request to delete the preferences dialog box as equivalent to
clicking "Cancel".
Have a "remember_ptree_widget()" routine to remember all protocol tree
widgets, and use the list of those widgets when we set GUI preferences
for the protocol tree widgets, rather than setting the main protocol
tree widget and then using the list of packet windows. Move that code
out of "main.c" to "proto_draw.c", as it's not used by anything in
"main.c", but is used by stuff in "proto_draw.c".
Make the font one of the preferences we can set on the fly for protocol
tree widgets. Also make it something we can set on the fly for the
packet list widget.
svn path=/trunk/; revision=2316
2000-08-21 08:09:17 +00:00
|
|
|
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
/*
|
|
|
|
* Given a string of the form "<pref name>:<pref value>", as might appear
|
|
|
|
* as an argument to a "-o" option, parse it and set the preference in
|
|
|
|
* question. Return an indication of whether it succeeded or failed
|
|
|
|
* in some fashion.
|
2001-07-22 21:25:11 +00:00
|
|
|
*
|
|
|
|
* XXX - should supply, for syntax errors, a detailed explanation of
|
|
|
|
* the syntax error.
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
*/
|
2006-11-17 01:24:03 +00:00
|
|
|
typedef enum {
|
|
|
|
PREFS_SET_OK, /* succeeded */
|
|
|
|
PREFS_SET_SYNTAX_ERR, /* syntax error in string */
|
|
|
|
PREFS_SET_NO_SUCH_PREF, /* no such preference */
|
|
|
|
PREFS_SET_OBSOLETE /* preference used to exist but no longer does */
|
|
|
|
} prefs_set_pref_e;
|
2006-10-10 00:28:53 +00:00
|
|
|
|
2006-11-17 01:24:03 +00:00
|
|
|
extern prefs_set_pref_e prefs_set_pref(char *prefarg);
|
Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).
Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:
can be put into the global or the user's preference file;
can be set from the command line, with arguments to the "-o"
flag;
can be set from tabs in the "Preferences" dialog box.
Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.
Stuff that still needs to be done:
documenting the API for registering preferences;
documenting the "-o" values in the man page (probably needs a
flag similar to "-G", and a Perl script to turn the output into
documentation as is done with the list of field);
handling error checking for numeric values (range checking,
making sure that if the user changes the variable from the GUI
they change it to a valid numeric value);
using the callbacks to, for example, update the display when
preferences are changed (could be expensive);
panic if the user specifies a numeric value with a base other
than 10, 8, or 16.
We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.
svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
|
|
|
|
2008-01-31 16:47:05 +00:00
|
|
|
/*
|
|
|
|
* Returns TRUE if the given device is hidden
|
|
|
|
*/
|
|
|
|
extern gboolean prefs_is_capture_device_hidden(const char *name);
|
|
|
|
|
1998-09-25 23:24:07 +00:00
|
|
|
#endif /* prefs.h */
|