summaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
commitc4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch)
tree93d5c6aa93d9987680dd1adad5685e2ad698f223 /epan/wslua/wslua.h
parentAdding upstream version 4.2.6. (diff)
downloadwireshark-upstream.tar.xz
wireshark-upstream.zip
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--epan/wslua/wslua.h272
1 files changed, 154 insertions, 118 deletions
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h
index c96f4f2c..00c8feea 100644
--- a/epan/wslua/wslua.h
+++ b/epan/wslua/wslua.h
@@ -58,39 +58,74 @@
#define WSLUA_PREFS_CHANGED "prefs_changed"
/* type conversion macros - lua_Number is a double, so casting isn't kosher; and
- using Lua's already-available lua_tointeger() and luaL_checkinteger() might be different
- on different machines; so use these instead please! */
-#define wslua_togint(L,i) (gint) ( lua_tointeger(L,i) )
-#define wslua_togint32(L,i) (gint32) ( lua_tonumber(L,i) )
-#define wslua_togint64(L,i) (gint64) ( lua_tonumber(L,i) )
-#define wslua_toguint(L,i) (guint) ( lua_tointeger(L,i) )
-#define wslua_toguint32(L,i) (guint32) ( lua_tonumber(L,i) )
-#define wslua_toguint64(L,i) (guint64) ( lua_tonumber(L,i) )
-
-#define wslua_checkgint(L,i) (gint) ( luaL_checkinteger(L,i) )
-#define wslua_checkgint32(L,i) (gint32) ( luaL_checknumber(L,i) )
-#define wslua_checkgint64(L,i) (gint64) ( luaL_checknumber(L,i) )
-#define wslua_checkguint(L,i) (guint) ( luaL_checkinteger(L,i) )
-#define wslua_checkguint32(L,i) (guint32) ( luaL_checknumber(L,i) )
-#define wslua_checkguint64(L,i) (guint64) ( luaL_checknumber(L,i) )
-
-#define wslua_optgint(L,i,d) (gint) ( luaL_optinteger(L,i,d) )
-#define wslua_optgint32(L,i,d) (gint32) ( luaL_optnumber(L,i,d) )
-#define wslua_optgint64(L,i,d) (gint64) ( luaL_optnumber(L,i,d) )
-#define wslua_optguint(L,i,d) (guint) ( luaL_optinteger(L,i,d) )
-#define wslua_optguint32(L,i,d) (guint32) ( luaL_optnumber(L,i,d) )
-#define wslua_optguint64(L,i,d) (guint64) ( luaL_optnumber(L,i,d) )
+ using Lua's already-available lua_tointeger() and luaL_checkinteger() might be
+ different on different machines; so use these instead please!
+
+ It can be important to choose the correct version of signed or unsigned
+ conversion macros; don't assume that you can freely convert to the signed
+ or unsigned integer of the same size later:
+
+ On 32-bit Windows x86, Lua 5.2 and earlier must use lua_tounsigned() and
+ luaL_checkunsigned() due to the use of float to integer inlined assembly.
+ (#18367)
+ On ARM, casting from a negative floating point number to an unsigned integer
+ type doesn't perform wraparound conversion in the same way as casting from
+ float to the same size signed integer then to unsigned does, unlike x86[-64].
+ (Commit 15392c324d5eaefcaa298cdee09cd5b40b12e09c)
+
+ On Lua 5.3 and later, numbers are stored as a kind of union between
+ Lua_Number and Lua_Integer. On 5.2 and earlier. all numbers are stored
+ as Lua_Number internally.
+
+ Be careful about using the 64-bit functions, as they convert from double
+ and lose precision at high values. See wslua_int64.c and the types there.
+ TODO: Check if Lua_Integer is 64 bit on Lua 5.3 and later.
+*/
+#define wslua_toint(L,i) (int) ( lua_tointeger(L,i) )
+#define wslua_toint32(L,i) (int32_t) ( lua_tointeger(L,i) )
+#define wslua_toint64(L,i) (int64_t) ( lua_tonumber(L,i) )
+#define wslua_touint64(L,i) (uint64_t) ( lua_tonumber(L,i) )
+
+#define wslua_checkint(L,i) (int) ( luaL_checkinteger(L,i) )
+#define wslua_checkint32(L,i) (int32_t) ( luaL_checkinteger(L,i) )
+#define wslua_checkint64(L,i) (int64_t) ( luaL_checknumber(L,i) )
+#define wslua_checkuint64(L,i) (uint64_t) ( luaL_checknumber(L,i) )
+
+#define wslua_optint(L,i,d) (int) ( luaL_optinteger(L,i,d) )
+#define wslua_optint32(L,i,d) (int32_t) ( luaL_optinteger(L,i,d) )
+#define wslua_optint64(L,i,d) (int64_t) ( luaL_optnumber(L,i,d) )
+#define wslua_optuint64(L,i,d) (uint64_t) ( luaL_optnumber(L,i,d) )
+/**
+ * On Lua 5.3 and later, the unsigned conversions may not be defined
+ * (depending on a compatibility define), and they're just casts if they
+ * are.
+ */
+#if LUA_VERSION_NUM < 503
+#define wslua_touint(L,i) (unsigned) ( lua_tounsigned(L,i) )
+#define wslua_touint32(L,i) (uint32_t) ( lua_tounsigned(L,i) )
+#define wslua_checkuint(L,i) (unsigned) ( luaL_checkunsigned(L,i) )
+#define wslua_checkuint32(L,i) (uint32_t) ( luaL_checkunsigned(L,i) )
+#define wslua_optuint(L,i,d) (unsigned) ( luaL_optunsigned(L,i,d) )
+#define wslua_optuint32(L,i,d) (uint32_t) ( luaL_optunsigned(L,i,d) )
+#else
+#define wslua_touint(L,i) (unsigned) ( lua_tointeger(L,i) )
+#define wslua_touint32(L,i) (uint32_t) ( lua_tointeger(L,i) )
+#define wslua_checkuint(L,i) (unsigned) ( luaL_checkinteger(L,i) )
+#define wslua_checkuint32(L,i) (uint32_t) ( luaL_checkinteger(L,i) )
+#define wslua_optuint(L,i,d) (unsigned) ( luaL_optinteger(L,i,d) )
+#define wslua_optuint32(L,i,d) (uint32_t) ( luaL_optinteger(L,i,d) )
+#endif
struct _wslua_tvb {
tvbuff_t* ws_tvb;
- gboolean expired;
- gboolean need_free;
+ bool expired;
+ bool need_free;
};
struct _wslua_pinfo {
packet_info* ws_pinfo;
- gboolean expired;
+ bool expired;
};
struct _wslua_tvbrange {
@@ -101,7 +136,7 @@ struct _wslua_tvbrange {
struct _wslua_tw {
funnel_text_window_t* ws_tw;
- gboolean expired;
+ bool expired;
void* close_cb_data;
};
@@ -114,13 +149,14 @@ typedef struct _wslua_field_t {
enum ftenum type;
unsigned base;
const void* vs;
- guint64 mask;
+ int valuestring_ref;
+ uint64_t mask;
} wslua_field_t;
typedef struct _wslua_expert_field_t {
expert_field ids;
- const gchar *abbrev;
- const gchar *text;
+ const char *abbrev;
+ const char *text;
int group;
int severity;
} wslua_expert_field_t;
@@ -140,28 +176,28 @@ typedef enum {
} pref_type_t;
typedef struct _wslua_pref_t {
- gchar* name;
- gchar* label;
- gchar* desc;
+ char* name;
+ char* label;
+ char* desc;
pref_type_t type;
union {
- gboolean b;
- guint u;
- gchar* s;
- gint e;
+ bool b;
+ unsigned u;
+ char* s;
+ int e;
range_t *r;
void* p;
} value;
union {
- guint32 max_value; /**< maximum value of a range */
+ uint32_t 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
+ bool 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 */
- gchar* default_s; /**< default value for value.s */
+ char* default_s; /**< default value for value.s */
} info; /**< display/text file information */
struct _wslua_pref_t* next;
@@ -170,9 +206,9 @@ typedef struct _wslua_pref_t {
} wslua_pref_t;
typedef struct _wslua_proto_t {
- gchar* name;
- gchar* loname;
- gchar* desc;
+ char* name;
+ char* loname;
+ char* desc;
int hfid;
int ett;
wslua_pref_t prefs;
@@ -184,8 +220,8 @@ typedef struct _wslua_proto_t {
GArray *hfa;
GArray *etta;
GArray *eia;
- gboolean is_postdissector;
- gboolean expired;
+ bool is_postdissector;
+ bool expired;
} wslua_proto_t;
/* a "DissectorTable" object can be different things under the hood,
@@ -194,33 +230,33 @@ typedef struct _wslua_proto_t {
struct _wslua_distbl_t {
dissector_table_t table;
heur_dissector_list_t heur_list;
- const gchar* name;
- const gchar* ui_name;
- gboolean created;
- gboolean expired;
+ const char* name;
+ const char* ui_name;
+ bool created;
+ bool expired;
};
struct _wslua_col_info {
column_info* cinfo;
- gint col;
- gboolean expired;
+ int col;
+ bool expired;
};
struct _wslua_cols {
column_info* cinfo;
- gboolean expired;
+ bool expired;
};
struct _wslua_private_table {
GHashTable *table;
- gboolean is_allocated;
- gboolean expired;
+ bool is_allocated;
+ bool expired;
};
struct _wslua_treeitem {
proto_item* item;
proto_tree* tree;
- gboolean expired;
+ bool expired;
};
// Internal structure for wslua_field.c to track info about registered fields.
@@ -231,20 +267,20 @@ struct _wslua_header_field_info {
struct _wslua_field_info {
field_info *ws_fi;
- gboolean expired;
+ bool expired;
};
typedef void (*tap_extractor_t)(lua_State*,const void*);
struct _wslua_tap {
- gchar* name;
- gchar* filter;
+ char* name;
+ char* filter;
tap_extractor_t extractor;
lua_State* L;
int packet_ref;
int draw_ref;
int reset_ref;
- gboolean all_fields;
+ bool all_fields;
};
/* a "File" object can be different things under the hood. It can either
@@ -255,35 +291,35 @@ struct _wslua_tap {
struct _wslua_file {
FILE_T file;
wtap_dumper *wdh; /* will be NULL during read usage */
- gboolean expired;
+ bool expired;
};
/* a "CaptureInfo" object can also be different things under the hood. */
struct _wslua_captureinfo {
wtap *wth; /* will be NULL during write usage */
wtap_dumper *wdh; /* will be NULL during read usage */
- gboolean expired;
+ bool expired;
};
struct _wslua_phdr {
wtap_rec *rec; /* this also exists in wtap struct, but is different for seek_read ops */
Buffer *buf; /* can't use the one in wtap because it's different for seek_read ops */
- gboolean expired;
+ bool expired;
};
struct _wslua_const_phdr {
const wtap_rec *rec;
- const guint8 *pd;
- gboolean expired;
+ const uint8_t *pd;
+ bool expired;
};
struct _wslua_filehandler {
struct file_type_subtype_info finfo;
- gboolean is_reader;
- gboolean is_writer;
- gchar* internal_description; /* XXX - this is redundant; finfo.description should suffice */
- gchar* type;
- gchar* extensions;
+ bool is_reader;
+ bool is_writer;
+ char* internal_description; /* XXX - this is redundant; finfo.description should suffice */
+ char* type;
+ char* extensions;
lua_State* L;
int read_open_ref;
int read_ref;
@@ -295,8 +331,8 @@ struct _wslua_filehandler {
int write_ref;
int write_close_ref;
int file_type;
- gboolean registered;
- gboolean removed; /* This is set during reload Lua plugins */
+ bool registered;
+ bool removed; /* This is set during reload Lua plugins */
};
struct _wslua_dir {
@@ -308,12 +344,12 @@ struct _wslua_progdlg {
struct progdlg* pw;
char* title;
char* task;
- gboolean stopped;
+ bool stopped;
};
typedef struct { const char* name; tap_extractor_t extractor; } tappable_t;
-typedef struct {const gchar* str; enum ftenum id; } wslua_ft_types_t;
+typedef struct {const char* str; enum ftenum id; } wslua_ft_types_t;
typedef wslua_pref_t* Pref;
typedef wslua_pref_t* Prefs;
@@ -331,8 +367,8 @@ typedef struct _wslua_pinfo* Pinfo;
typedef struct _wslua_treeitem* TreeItem;
typedef address* Address;
typedef nstime_t* NSTime;
-typedef gint64 Int64;
-typedef guint64 UInt64;
+typedef int64_t Int64;
+typedef uint64_t UInt64;
typedef struct _wslua_header_field_info* Field;
typedef struct _wslua_field_info* FieldInfo;
typedef struct _wslua_tap* Listener;
@@ -352,7 +388,7 @@ typedef tvbparse_elem_t* Node;
typedef tvbparse_action_t* Shortcut;
typedef struct _wslua_dir* Dir;
typedef struct _wslua_private_table* PrivateTable;
-typedef gchar* Struct;
+typedef char* Struct;
/*
* toXxx(L,idx) gets a Xxx from an index (Lua Error if fails)
@@ -386,14 +422,14 @@ C* push##C(lua_State* L, C v) { \
luaL_getmetatable(L, #C); lua_setmetatable(L, -2); \
return p; \
}\
-gboolean is##C(lua_State* L,int i) { \
+bool is##C(lua_State* L,int i) { \
void *p; \
- if(!lua_isuserdata(L,i)) return FALSE; \
+ if(!lua_isuserdata(L,i)) return false; \
p = lua_touserdata(L, i); \
lua_getfield(L, LUA_REGISTRYINDEX, #C); \
if (p == NULL || !lua_getmetatable(L, i) || !lua_rawequal(L, -1, -2)) p=NULL; \
lua_pop(L, 2); \
- return p ? TRUE : FALSE; \
+ return p ? true : false; \
} \
C shift##C(lua_State* L,int i) { \
C* p; \
@@ -408,11 +444,11 @@ C shift##C(lua_State* L,int i) { \
typedef int dummy##C
typedef struct _wslua_attribute_table {
- const gchar *fieldname;
+ const char *fieldname;
lua_CFunction getfunc;
lua_CFunction setfunc;
} wslua_attribute_table;
-extern int wslua_reg_attributes(lua_State *L, const wslua_attribute_table *t, gboolean is_getter);
+extern int wslua_reg_attributes(lua_State *L, const wslua_attribute_table *t, bool is_getter);
#define WSLUA_TYPEOF_FIELD "__typeof"
@@ -518,11 +554,11 @@ extern int wslua_reg_attributes(lua_State *L, const wslua_attribute_table *t, gb
#define WSLUA_ATTRIBUTE_NAMED_BOOLEAN_GETTER(C,name,member) \
WSLUA_ATTRIBUTE_GET(C,name,{lua_pushboolean(L, obj->member );})
-#define WSLUA_ATTRIBUTE_NAMED_NUMBER_GETTER(C,name,member) \
- WSLUA_ATTRIBUTE_GET(C,name,{lua_pushnumber(L,(lua_Number)(obj->member));})
+#define WSLUA_ATTRIBUTE_NAMED_INTEGER_GETTER(C,name,member) \
+ WSLUA_ATTRIBUTE_GET(C,name,{lua_pushinteger(L,(lua_Integer)(obj->member));})
-#define WSLUA_ATTRIBUTE_NUMBER_GETTER(C,member) \
- WSLUA_ATTRIBUTE_NAMED_NUMBER_GETTER(C,member,member)
+#define WSLUA_ATTRIBUTE_INTEGER_GETTER(C,member) \
+ WSLUA_ATTRIBUTE_NAMED_INTEGER_GETTER(C,member,member)
#define WSLUA_ATTRIBUTE_BLOCK_NUMBER_GETTER(C,name,block) \
WSLUA_ATTRIBUTE_GET(C,name,{lua_pushnumber(L,(lua_Number)(block));})
@@ -577,20 +613,20 @@ extern int wslua_reg_attributes(lua_State *L, const wslua_attribute_table *t, gb
/* to make this integral-safe, we treat it as int32 and then cast
Note: This will truncate 64-bit integers (but then Lua itself only has doubles */
-#define WSLUA_ATTRIBUTE_NAMED_NUMBER_SETTER(C,name,member,cast) \
+#define WSLUA_ATTRIBUTE_NAMED_INTEGER_SETTER(C,name,member,cast) \
WSLUA_ATTRIBUTE_SET(C,name, { \
- if (! lua_isnumber(L,-1) ) \
- return luaL_error(L, "%s's attribute `%s' must be a number", #C , #name ); \
- obj->member = (cast) wslua_togint32(L,-1); \
+ if (! lua_isinteger(L,-1) ) \
+ return luaL_error(L, "%s's attribute `%s' must be an integer", #C , #name ); \
+ obj->member = (cast) wslua_toint32(L,-1); \
})
-#define WSLUA_ATTRIBUTE_NUMBER_SETTER(C,member,cast) \
- WSLUA_ATTRIBUTE_NAMED_NUMBER_SETTER(C,member,member,cast)
+#define WSLUA_ATTRIBUTE_INTEGER_SETTER(C,member,cast) \
+ WSLUA_ATTRIBUTE_NAMED_INTEGER_SETTER(C,member,member,cast)
#define WSLUA_ATTRIBUTE_NAMED_STRING_SETTER(C,field,member,need_free) \
static int C##_set_##field (lua_State* L) { \
C obj = check##C (L,1); \
- gchar* s = NULL; \
+ char* s = NULL; \
if (lua_isstring(L,-1) || lua_isnil(L,-1)) { \
s = g_strdup(lua_tostring(L,-1)); \
} else { \
@@ -610,7 +646,7 @@ extern int wslua_reg_attributes(lua_State *L, const wslua_attribute_table *t, gb
#define WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_SETTER(C,field,member,option) \
static int C##_set_##field (lua_State* L) { \
C obj = check##C (L,1); \
- gchar* s = NULL; \
+ char* s = NULL; \
if (lua_isstring(L,-1) || lua_isnil(L,-1)) { \
s = g_strdup(lua_tostring(L,-1)); \
} else { \
@@ -628,7 +664,7 @@ extern int wslua_reg_attributes(lua_State *L, const wslua_attribute_table *t, gb
#define WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_NTH_STRING_SETTER(C,field,member,option) \
static int C##_set_##field (lua_State* L) { \
C obj = check##C (L,1); \
- gchar* s = NULL; \
+ char* s = NULL; \
if (lua_isstring(L,-1) || lua_isnil(L,-1)) { \
s = g_strdup(lua_tostring(L,-1)); \
} else { \
@@ -649,7 +685,7 @@ extern int wslua_reg_attributes(lua_State *L, const wslua_attribute_table *t, gb
#define WSLUA_REG_GLOBAL_BOOL(L,n,v) { lua_pushboolean(L,v); lua_setglobal(L,n); }
#define WSLUA_REG_GLOBAL_STRING(L,n,v) { lua_pushstring(L,v); lua_setglobal(L,n); }
-#define WSLUA_REG_GLOBAL_NUMBER(L,n,v) { lua_pushnumber(L,v); lua_setglobal(L,n); }
+#define WSLUA_REG_GLOBAL_INTEGER(L,n,v) { lua_pushinteger(L,v); lua_setglobal(L,n); }
#define WSLUA_RETURN(i) return (i)
@@ -684,7 +720,7 @@ extern C to##C(lua_State* L, int idx); \
extern C check##C(lua_State* L, int idx); \
extern C* push##C(lua_State* L, C v); \
extern int C##_register(lua_State* L); \
-extern gboolean is##C(lua_State* L,int i); \
+extern bool is##C(lua_State* L,int i); \
extern C shift##C(lua_State* L,int i)
@@ -696,12 +732,12 @@ extern C shift##C(lua_State* L,int i)
* Normal restrictions for TRY/CATCH apply, in particular, do not return! */
#define WRAP_NON_LUA_EXCEPTIONS(code) \
{ \
- volatile gboolean has_error = FALSE; \
+ volatile bool has_error = false; \
TRY { \
code \
} CATCH_ALL { \
lua_pushstring(L, GET_MESSAGE); \
- has_error = TRUE; \
+ has_error = true; \
} ENDTRY; \
if (has_error) { lua_error(L); } \
}
@@ -710,7 +746,7 @@ extern C shift##C(lua_State* L,int i)
extern packet_info* lua_pinfo;
extern TreeItem lua_tree;
extern tvbuff_t* lua_tvb;
-extern gboolean lua_initialized;
+extern bool lua_initialized;
extern int lua_dissectors_table_ref;
extern int lua_heur_dissectors_table_ref;
@@ -739,26 +775,26 @@ void wslua_register_classinstance_meta(lua_State *L, const wslua_class *cls_def)
void wslua_register_class(lua_State *L, const wslua_class *cls_def);
extern int wslua__concat(lua_State* L);
-extern gboolean wslua_toboolean(lua_State* L, int n);
-extern gboolean wslua_checkboolean(lua_State* L, int n);
-extern gboolean wslua_optbool(lua_State* L, int n, gboolean def);
+extern bool wslua_toboolean(lua_State* L, int n);
+extern bool wslua_checkboolean(lua_State* L, int n);
+extern bool wslua_optbool(lua_State* L, int n, bool def);
extern lua_Integer wslua_tointeger(lua_State* L, int n);
extern int wslua_optboolint(lua_State* L, int n, int def);
extern const char* wslua_checklstring_only(lua_State* L, int n, size_t *l);
extern const char* wslua_checkstring_only(lua_State* L, int n);
extern void wslua_setfuncs(lua_State *L, const luaL_Reg *l, int nup);
-extern const gchar* wslua_typeof_unknown;
-extern const gchar* wslua_typeof(lua_State *L, int idx);
-extern gboolean wslua_get_table(lua_State *L, int idx, const gchar *name);
-extern gboolean wslua_get_field(lua_State *L, int idx, const gchar *name);
+extern const char* wslua_typeof_unknown;
+extern const char* wslua_typeof(lua_State *L, int idx);
+extern bool wslua_get_table(lua_State *L, int idx, const char *name);
+extern bool wslua_get_field(lua_State *L, int idx, const char *name);
extern int dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data);
-extern int heur_dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data);
+extern bool heur_dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data);
extern expert_field* wslua_get_expert_field(const int group, const int severity);
extern void wslua_prefs_changed(void);
extern void proto_register_lua(void);
extern GString* lua_register_all_taps(void);
extern void wslua_prime_dfilter(epan_dissect_t *edt);
-extern gboolean wslua_has_field_extractors(void);
+extern bool wslua_has_field_extractors(void);
extern void lua_prime_all_fields(proto_tree* tree);
extern int Proto_commit(lua_State* L);
@@ -767,15 +803,15 @@ extern TreeItem create_TreeItem(proto_tree* tree, proto_item* item);
extern void clear_outstanding_FuncSavers(void);
-extern void Int64_pack(lua_State* L, luaL_Buffer *b, gint idx, gboolean asLittleEndian);
-extern int Int64_unpack(lua_State* L, const gchar *buff, gboolean asLittleEndian);
-extern void UInt64_pack(lua_State* L, luaL_Buffer *b, gint idx, gboolean asLittleEndian);
-extern int UInt64_unpack(lua_State* L, const gchar *buff, gboolean asLittleEndian);
-extern guint64 getUInt64(lua_State *L, int i);
+extern void Int64_pack(lua_State* L, luaL_Buffer *b, int idx, bool asLittleEndian);
+extern int Int64_unpack(lua_State* L, const char *buff, bool asLittleEndian);
+extern void UInt64_pack(lua_State* L, luaL_Buffer *b, int idx, bool asLittleEndian);
+extern int UInt64_unpack(lua_State* L, const char *buff, bool asLittleEndian);
+extern uint64_t getUInt64(lua_State *L, int i);
extern Tvb* push_Tvb(lua_State* L, tvbuff_t* tvb);
extern int push_wsluaTvb(lua_State* L, Tvb t);
-extern gboolean push_TvbRange(lua_State* L, tvbuff_t* tvb, int offset, int len);
+extern bool push_TvbRange(lua_State* L, tvbuff_t* tvb, int offset, int len);
extern void clear_outstanding_Tvb(void);
extern void clear_outstanding_TvbRange(void);
@@ -794,22 +830,22 @@ extern void clear_outstanding_FieldInfo(void);
extern void wslua_print_stack(char* s, lua_State* L);
-extern void wslua_init(register_cb cb, gpointer client_data);
+extern void wslua_init(register_cb cb, void *client_data);
extern void wslua_early_cleanup(void);
extern void wslua_cleanup(void);
-extern tap_extractor_t wslua_get_tap_extractor(const gchar* name);
+extern tap_extractor_t wslua_get_tap_extractor(const char* name);
extern int wslua_set_tap_enums(lua_State* L);
extern ProtoField wslua_is_field_available(lua_State* L, const char* field_abbr);
extern char* wslua_get_actual_filename(const char* fname);
-extern int wslua_bin2hex(lua_State* L, const guint8* data, const guint len, const gboolean lowercase, const gchar* sep);
-extern int wslua_hex2bin(lua_State* L, const char* data, const guint len, const gchar* sep);
+extern int wslua_bin2hex(lua_State* L, const uint8_t* data, const unsigned len, const bool lowercase, const char* sep);
+extern int wslua_hex2bin(lua_State* L, const char* data, const unsigned len, const char* sep);
extern int luaopen_rex_pcre2(lua_State *L);
-extern const gchar* get_current_plugin_version(void);
+extern const char* get_current_plugin_version(void);
extern void clear_current_plugin_version(void);
extern int wslua_deregister_heur_dissectors(lua_State* L);