aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua.h
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-05-02 23:39:44 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-05-02 23:39:44 +0000
commit8a293db12188152f4bcaa6695419cec6aa9e3ca6 (patch)
treedf3ed284572bf5436af51312ff758bdd07d6e231 /epan/wslua/wslua.h
parentbb76982d2c9aa9588f37976c6533b51b105e9bda (diff)
From Tamas Regos (Via Balint Reczey)
The attached patch adds ability of of creating radio button, drop-down list and range type preference entries to the Lua plugin. It also fixes a lua compile warning/error in wslua_gui.c. The patch is written by Tamas Regos, he asked me to send it to the list. svn path=/trunk/; revision=21655
Diffstat (limited to 'epan/wslua/wslua.h')
-rw-r--r--epan/wslua/wslua.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h
index ebef7d214c..ec19f03b7c 100644
--- a/epan/wslua/wslua.h
+++ b/epan/wslua/wslua.h
@@ -4,6 +4,7 @@
* Wireshark's interface to the Lua Programming Language
*
* (c) 2006, Luis E. Garcia Ontanon <luis.ontanon@gmail.com>
+ * (c) 2007, Tamas Regos <tamas.regos@ericsson.com>
*
* $Id$
*
@@ -76,7 +77,19 @@ typedef struct _wslua_field_t {
guint32 mask;
} wslua_field_t;
-typedef enum {PREF_NONE,PREF_BOOL,PREF_UINT,PREF_STRING} pref_type_t;
+/*
+ * PREF_OBSOLETE is used for preferences that a module used to support
+ * but no longer supports; we give different error messages for them.
+ */
+typedef enum {
+ PREF_UINT,
+ PREF_BOOL,
+ PREF_ENUM,
+ PREF_STRING,
+ PREF_RANGE,
+ PREF_STATIC_TEXT,
+ PREF_OBSOLETE
+} pref_type_t;
typedef struct _wslua_pref_t {
gchar* name;
@@ -87,8 +100,20 @@ typedef struct _wslua_pref_t {
gboolean b;
guint u;
const gchar* s;
- void* p;
+ gint e;
+ range_t *r;
+ void* p;
} value;
+ union {
+ 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 _wslua_pref_t* next;
struct _wslua_proto_t* proto;