summaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua_wtap.c
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_wtap.c
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 'epan/wslua/wslua_wtap.c')
-rw-r--r--epan/wslua/wslua_wtap.c40
1 files changed, 11 insertions, 29 deletions
diff --git a/epan/wslua/wslua_wtap.c b/epan/wslua/wslua_wtap.c
index 524ed7c3..147b774a 100644
--- a/epan/wslua/wslua_wtap.c
+++ b/epan/wslua/wslua_wtap.c
@@ -30,8 +30,6 @@ WSLUA_FUNCTION wslua_wtap_file_type_subtype_description(lua_State* LS) {
/*
Get a string describing a capture file type, given a filetype
value for that file type.
-
- @since 3.2.12, 3.4.4
*/
#define WSLUA_ARG_wtap_file_type_subtype_description_FILETYPE 1 /* The type for which the description is to be fetched - a number returned by `wtap_name_to_file_type_subtype()`. */
lua_Number filetype = luaL_checknumber(LS,WSLUA_ARG_wtap_file_type_subtype_description_FILETYPE);
@@ -40,7 +38,7 @@ WSLUA_FUNCTION wslua_wtap_file_type_subtype_description(lua_State* LS) {
/* Too big. */
lua_pushnil(LS);
} else {
- const gchar* str = wtap_file_type_subtype_description((int)filetype);
+ const char* str = wtap_file_type_subtype_description((int)filetype);
if (str == NULL)
lua_pushnil(LS);
else
@@ -53,8 +51,6 @@ WSLUA_FUNCTION wslua_wtap_file_type_subtype_name(lua_State* LS) {
/*
Get a string giving the name for a capture file type, given a filetype
value for that file type.
-
- @since 3.2.12, 3.4.4
*/
#define WSLUA_ARG_wtap_file_type_subtype_name_FILETYPE 1 /* The type for which the name is to be fetched - a number returned by `wtap_name_to_file_type_subtype()`. */
lua_Number filetype = luaL_checknumber(LS,WSLUA_ARG_wtap_file_type_subtype_name_FILETYPE);
@@ -63,7 +59,7 @@ WSLUA_FUNCTION wslua_wtap_file_type_subtype_name(lua_State* LS) {
/* Too big. */
lua_pushnil(LS);
} else {
- const gchar* str = wtap_file_type_subtype_name((int)filetype);
+ const char* str = wtap_file_type_subtype_name((int)filetype);
if (str == NULL)
lua_pushnil(LS);
else
@@ -76,8 +72,6 @@ WSLUA_FUNCTION wslua_wtap_name_to_file_type_subtype(lua_State* LS) {
/*
Get a filetype value for a file type, given the name for that
file type.
-
- @since 3.2.12, 3.4.4
*/
#define WSLUA_ARG_wtap_name_to_file_type_subtype_NAME 1 /* The name of a file type. */
const char* name = luaL_checkstring(LS,WSLUA_ARG_wtap_name_to_file_type_subtype_NAME);
@@ -85,40 +79,28 @@ WSLUA_FUNCTION wslua_wtap_name_to_file_type_subtype(lua_State* LS) {
if (filetype == -1)
lua_pushnil(LS);
else
- lua_pushnumber(LS,filetype);
+ lua_pushinteger(LS,filetype);
WSLUA_RETURN(1); /* The filetype value for the file type with that name, or nil if there is no such file type. */
}
WSLUA_FUNCTION wslua_wtap_pcap_file_type_subtype(lua_State* LS) {
- /*
- Get the filetype value for pcap files.
-
- @since 3.2.12, 3.4.4
- */
+ /* Get the filetype value for pcap files. */
lua_Number filetype = wtap_pcap_file_type_subtype();
- lua_pushnumber(LS,filetype);
+ lua_pushinteger(LS,filetype);
WSLUA_RETURN(1); /* The filetype value for pcap files. */
}
WSLUA_FUNCTION wslua_wtap_pcap_nsec_file_type_subtype(lua_State* LS) {
- /*
- Get the filetype value for nanosecond-resolution pcap files.
-
- @since 3.2.12, 3.4.4
- */
+ /* Get the filetype value for nanosecond-resolution pcap files. */
lua_Number filetype = wtap_pcap_nsec_file_type_subtype();
- lua_pushnumber(LS,filetype);
+ lua_pushinteger(LS,filetype);
WSLUA_RETURN(1); /* The filetype value for nanosecond-resolution pcap files. */
}
WSLUA_FUNCTION wslua_wtap_pcapng_file_type_subtype(lua_State* LS) {
- /*
- Get the filetype value for pcapng files.
-
- @since 3.2.12, 3.4.4
- */
+ /* Get the filetype value for pcapng files. */
lua_Number filetype = wtap_pcapng_file_type_subtype();
- lua_pushnumber(LS,filetype);
+ lua_pushinteger(LS,filetype);
WSLUA_RETURN(1); /* The filetype value for pcapng files. */
}
@@ -135,7 +117,7 @@ extern void wslua_init_wtap_filetypes(lua_State* LS) {
* so none of the entries will be in a sequence.
*/
lua_createtable(LS,0,table->len);
- for (guint i = 0; i < table->len; i++) {
+ for (unsigned i = 0; i < table->len; i++) {
struct backwards_compatibiliity_lua_name *entry;
entry = &g_array_index(table,
@@ -148,7 +130,7 @@ extern void wslua_init_wtap_filetypes(lua_State* LS) {
* it.
*/
lua_pushstring(LS, entry->name);
- lua_pushnumber(LS, entry->ft);
+ lua_pushinteger(LS, entry->ft);
/*
* The -3 is the index, relative to the top of the stack, of
* the table; the two elements on top of it are the ft and