+/** Struct to hold preference data */
+struct preference {
+ const char *name; /**< name of preference */
+ const char *title; /**< title to use in GUI */
+ const char *description; /**< human-readable description of preference */
+ int ordinal; /**< ordinal number of this preference */
+ int type; /**< type of that preference */
+ unsigned int effect_flags; /**< Flags of types effected by preference (PREF_TYPE_DISSECTION, PREF_EFFECT_CAPTURE, etc).
+ Flags must be non-zero to ensure saving to disk */
+ gui_type_t gui; /**< type of the GUI (QT, GTK or both) the preference is registered for */
+ union { /* The Qt preference code assumes that these will all be pointers (and unique) */
+ guint *uint;
+ gboolean *boolp;
+ gint *enump;
+ char **string;
+ range_t **range;
+ struct epan_uat* uat;
+ color_t *colorp;
+ GList** list;
+ } varp; /**< pointer to variable storing the value */
+ union {
+ guint uint;
+ gboolean boolval;
+ gint enumval;
+ char *string;
+ range_t *range;
+ color_t color;
+ GList* list;
+ } stashed_val; /**< original value, when editing from the GUI */
+ union {
+ guint uint;
+ gboolean boolval;
+ gint enumval;
+ char *string;
+ range_t *range;
+ color_t color;
+ GList* list;
+ } default_val; /**< the default value of the preference */
+ union {
+ guint base; /**< input/output base, for PREF_UINT */
+ guint32 max_value; /**< maximum value of a range */
+ struct {
+ const enum_val_t *enumvals; /**< list of name & values */
+ gboolean radio_buttons; /**< TRUE if it should be shown as
+ radio buttons rather than as an
+ option menu or combo box in
+ the preferences tab */
+ } enum_info; /**< for PREF_ENUM */
+ } info; /**< display/text file information */
+ struct pref_custom_cbs custom_cbs; /**< for PREF_CUSTOM */
+ void *control; /**< handle for GUI control for this preference. GTK+ only? */
+};
+
+const char* prefs_get_description(pref_t *pref)
+{
+ return pref->description;
+}
+
+const char* prefs_get_title(pref_t *pref)
+{
+ return pref->title;
+}
+
+int prefs_get_type(pref_t *pref)
+{
+ return pref->type;
+}
+
+gui_type_t prefs_get_gui_type(pref_t *pref)
+{
+ return pref->gui;
+}
+
+const char* prefs_get_name(pref_t *pref)
+{
+ return pref->name;
+}
+
+guint32 prefs_get_max_value(pref_t *pref)
+{
+ return pref->info.max_value;
+}
+