diff --git a/epan/wslua/wslua_dumper.c b/epan/wslua/wslua_dumper.c index 9a7112c90e..530504ed15 100644 --- a/epan/wslua/wslua_dumper.c +++ b/epan/wslua/wslua_dumper.c @@ -20,7 +20,11 @@ The classes/functions defined in this module are for using a `Dumper` object to make Wireshark save a capture file to disk. `Dumper` represents Wireshark's built-in - file format writers (see the `wtap_filetypes` table in `init.lua`). + file format writers (see the `wtap_name_to_file_type_subtype` function). + + (The `wtap_filetypes` table in `init.lua` is deprecated, and should + only be used in code that must run on Wireshark 3.4.3 and earlier 3.4 + releases or in Wireshark 3.2.11 and earlier 3.2.x releases.) To have a Lua script create its own file format writer, see the chapter titled "Custom file format reading/writing". @@ -197,7 +201,12 @@ WSLUA_CONSTRUCTOR Dumper_new(lua_State* L) { `Dumper:new_for_current()` will probably be a better choice. */ #define WSLUA_ARG_Dumper_new_FILENAME 1 /* The name of the capture file to be created. */ -#define WSLUA_OPTARG_Dumper_new_FILETYPE 2 /* The type of the file to be created - a number entry from the `wtap_filetypes` table in `init.lua`. */ +#define WSLUA_OPTARG_Dumper_new_FILETYPE 2 /* The type of the file to be created - a number returned by `wtap_name_to_file_type_subtype()`. + (The `wtap_filetypes` table in `init.lua` + is deprecated, and should only be used + in code that must run on Wireshark 3.4.3 and earlier 3.4 releases + or in Wireshark 3.2.11 and earlier + 3.2.x releases.) */ #define WSLUA_OPTARG_Dumper_new_ENCAP 3 /* The encapsulation to be used in the file to be created - a number entry from the `wtap_encaps` table in `init.lua`. */ Dumper d; const char* fname = luaL_checkstring(L,WSLUA_ARG_Dumper_new_FILENAME); diff --git a/epan/wslua/wslua_wtap.c b/epan/wslua/wslua_wtap.c index bda17e32d4..68914ddcf6 100644 --- a/epan/wslua/wslua_wtap.c +++ b/epan/wslua/wslua_wtap.c @@ -27,7 +27,7 @@ WSLUA_FUNCTION wslua_wtap_file_type_subtype_description(lua_State* LS) { @since 3.2.12, 3.4.4 */ -#define WSLUA_ARG_file_type_subtype_description_FILETYPE 1 /* The type for which the description is to be fetched - a number entry from the `wtap_filetypes` table in `init.lua`. */ +#define WSLUA_ARG_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_file_type_subtype_description_FILETYPE); /* wtap_file_type_subtype_string()'s name isn't really descriptive. */ if (filetype > INT_MAX) { @@ -40,7 +40,7 @@ WSLUA_FUNCTION wslua_wtap_file_type_subtype_description(lua_State* LS) { else lua_pushstring(LS,str); } - WSLUA_RETURN(1); /* The description of the file type with that filetype value, or nul if there is no such file type. */ + WSLUA_RETURN(1); /* The description of the file type with that filetype value, or nil if there is no such file type. */ } WSLUA_FUNCTION wslua_wtap_file_type_subtype_name(lua_State* LS) { @@ -50,7 +50,7 @@ WSLUA_FUNCTION wslua_wtap_file_type_subtype_name(lua_State* LS) { @since 3.2.12, 3.4.4 */ -#define WSLUA_ARG_file_type_subtype_name_FILETYPE 1 /* The type for which the name is to be fetched - a number entry from the `wtap_filetypes` table in `init.lua`. */ +#define WSLUA_ARG_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_file_type_subtype_name_FILETYPE); /* wtap_file_type_subtype_string()'s name isn't really descriptive. */ if (filetype > INT_MAX) { @@ -63,7 +63,7 @@ WSLUA_FUNCTION wslua_wtap_file_type_subtype_name(lua_State* LS) { else lua_pushstring(LS,str); } - WSLUA_RETURN(1); /* The name of the file type with that filetype value, or nul if there is no such file type. */ + WSLUA_RETURN(1); /* The name of the file type with that filetype value, or nil if there is no such file type. */ } WSLUA_FUNCTION wslua_wtap_name_to_file_type_subtype(lua_State* LS) { @@ -73,7 +73,7 @@ WSLUA_FUNCTION wslua_wtap_name_to_file_type_subtype(lua_State* LS) { @since 3.2.12, 3.4.4 */ -#define WSLUA_ARG_name_to_file_type_subtype_NAME 1 /* A timestamp value to convert. */ +#define WSLUA_ARG_name_to_file_type_subtype_NAME 1 /* The name of a file type. */ const char* name = luaL_checkstring(LS,WSLUA_ARG_name_to_file_type_subtype_NAME); /* wtap_short_string_to_file_type_subtype()'s name isn't really descriptive. */ lua_Number filetype = wtap_short_string_to_file_type_subtype(name);