aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua.h
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2006-10-12 17:00:11 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2006-10-12 17:00:11 +0000
commit02a2382a36646539f06085a0b23015584f66cda3 (patch)
tree948e49860d0f1a0f7c7d378ed5a9aa7a6bf82af6 /epan/wslua/wslua.h
parent44318bc1f1b5580eb399b393445b54b61103cf38 (diff)
- add persconffile(opt_str)
- add datafile_path(opt_str) - add Dir class -- a Directory Iterator svn path=/trunk/; revision=19507
Diffstat (limited to 'epan/wslua/wslua.h')
-rw-r--r--epan/wslua/wslua.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h
index c8dde86a9a..6490fa492e 100644
--- a/epan/wslua/wslua.h
+++ b/epan/wslua/wslua.h
@@ -121,12 +121,32 @@ struct _wslua_treeitem {
proto_tree* tree;
};
-#if 0
-struct _wslua_main {
- capture_options capture_opts;
-};
+
+#if GLIB_MAJOR_VERSION < 2
+# define DIRECTORY_T DIR
+# define FILE_T struct dirent
+# define OPENDIR_OP(name) opendir(name)
+# define DIRGETNEXT_OP(dir) readdir(dir)
+# define GETFNAME_OP(file) (gchar *)file->d_name
+# define CLOSEDIR_OP(dir) closedir(dir)
+#else /* GLIB 2 */
+# define DIRECTORY_T GDir
+# define FILE_T gchar
+# define OPENDIR_OP(name) g_dir_open(name, 0, dir->dummy)
+# define DIRGETNEXT_OP(dir) g_dir_read_name(dir)
+# define GETFNAME_OP(file) (file);
+# define CLOSEDIR_OP(dir) g_dir_close(dir)
+#endif
+
+struct _wslua_dir {
+ DIRECTORY_T* dir;
+ char* ext;
+#if GLIB_MAJOR_VERSION >= 2
+ GError** dummy;
#endif
+};
+
typedef void (*tap_extractor_t)(lua_State*,const void*);
typedef struct { const char* name; tap_extractor_t extractor; } tappable_t;
@@ -158,6 +178,7 @@ typedef tvbparse_wanted_t* Rule;
typedef tvbparse_elem_t* Node;
typedef tvbparse_action_t* Shortcut;
typedef struct _wslua_main* WireShark;
+typedef struct _wslua_dir* Dir;
/*
* toXxx(L,idx) gets a Xxx from an index (Lua Error if fails)