wslua: Improve documentation

Rename `desc` and `descr` to description in the documentation to
make the name more self explaining.

Added and fixed some @since tags.
This commit is contained in:
Stig Bjørlykke 2024-04-05 14:35:02 +02:00
parent f3e4237af7
commit d17e3a2842
5 changed files with 95 additions and 58 deletions

View File

@ -55,6 +55,7 @@ WSLUA_METAMETHOD NSTime__call(lua_State* L) { /* Creates a NSTime object. */
WSLUA_METHOD NSTime_tonumber(lua_State* L) {
/* Returns a Lua number of the `NSTime` representing seconds from epoch
@since 2.4.0
*/
NSTime nstime = checkNSTime(L,1);

View File

@ -177,7 +177,7 @@ WSLUA_CONSTRUCTOR Pref_bool(lua_State* L) {
#define WSLUA_ARG_Pref_bool_LABEL 1 /* The Label (text in the right side of the
preference input) for this preference. */
#define WSLUA_ARG_Pref_bool_DEFAULT 2 /* The default value for this preference. */
#define WSLUA_ARG_Pref_bool_DESCR 3 /* A description of this preference. */
#define WSLUA_ARG_Pref_bool_DESCRIPTION 3 /* A description of this preference. */
return new_pref(L,PREF_BOOL);
}
@ -186,7 +186,7 @@ WSLUA_CONSTRUCTOR Pref_uint(lua_State* L) {
#define WSLUA_ARG_Pref_uint_LABEL 1 /* The Label (text in the right side of the
preference input) for this preference. */
#define WSLUA_ARG_Pref_uint_DEFAULT 2 /* The default value for this preference. */
#define WSLUA_ARG_Pref_uint_DESCR 3 /* A description of what this preference is. */
#define WSLUA_ARG_Pref_uint_DESCRIPTION 3 /* A description of what this preference is. */
return new_pref(L,PREF_UINT);
}
@ -195,7 +195,7 @@ WSLUA_CONSTRUCTOR Pref_string(lua_State* L) {
#define WSLUA_ARG_Pref_string_LABEL 1 /* The Label (text in the right side of the
preference input) for this preference. */
#define WSLUA_ARG_Pref_string_DEFAULT 2 /* The default value for this preference. */
#define WSLUA_ARG_Pref_string_DESCR 3 /* A description of what this preference is. */
#define WSLUA_ARG_Pref_string_DESCRIPTION 3 /* A description of what this preference is. */
return new_pref(L,PREF_STRING);
}
@ -240,7 +240,7 @@ WSLUA_CONSTRUCTOR Pref_enum(lua_State* L) {
#define WSLUA_ARG_Pref_enum_LABEL 1 /* The Label (text in the right side of the
preference input) for this preference. */
#define WSLUA_ARG_Pref_enum_DEFAULT 2 /* The default value for this preference. */
#define WSLUA_ARG_Pref_enum_DESCR 3 /* A description of what this preference is. */
#define WSLUA_ARG_Pref_enum_DESCRIPTION 3 /* A description of what this preference is. */
#define WSLUA_ARG_Pref_enum_ENUM 4 /* An enum Lua table. */
#define WSLUA_ARG_Pref_enum_RADIO 5 /* Radio button (true) or Combobox (false). */
return new_pref(L,PREF_ENUM);
@ -252,7 +252,7 @@ WSLUA_CONSTRUCTOR Pref_range(lua_State* L) {
input) for this preference. */
#define WSLUA_ARG_Pref_range_DEFAULT 2 /* The default value for this preference, e.g., "53",
"10-30", or "10-30,53,55,100-120". */
#define WSLUA_ARG_Pref_range_DESCR 3 /* A description of what this preference is. */
#define WSLUA_ARG_Pref_range_DESCRIPTION 3 /* A description of what this preference is. */
#define WSLUA_ARG_Pref_range_MAX 4 /* The maximum value. */
return new_pref(L,PREF_RANGE);
}
@ -260,7 +260,7 @@ WSLUA_CONSTRUCTOR Pref_range(lua_State* L) {
WSLUA_CONSTRUCTOR Pref_statictext(lua_State* L) {
/* Creates a static text string to be added to a <<lua_class_attrib_proto_prefs,`Proto.prefs`>> Lua table. */
#define WSLUA_ARG_Pref_statictext_LABEL 1 /* The static text. */
#define WSLUA_ARG_Pref_statictext_DESCR 2 /* The static text description. */
#define WSLUA_ARG_Pref_statictext_DESCRIPTION 2 /* The static text description. */
return new_pref(L,PREF_STATIC_TEXT);
}

View File

@ -70,9 +70,9 @@ static int protocols_table_ref = LUA_NOREF;
WSLUA_CONSTRUCTOR Proto_new(lua_State* L) { /* Creates a new <<lua_class_Proto,`Proto`>> object. */
#define WSLUA_ARG_Proto_new_NAME 1 /* The name of the protocol. */
#define WSLUA_ARG_Proto_new_DESC 2 /* A Long Text description of the protocol (usually lowercase). */
#define WSLUA_ARG_Proto_new_DESCRIPTION 2 /* A Long Text description of the protocol (usually lowercase). */
const char* name = luaL_checkstring(L,WSLUA_ARG_Proto_new_NAME);
const char* desc = luaL_checkstring(L,WSLUA_ARG_Proto_new_DESC);
const char* desc = luaL_checkstring(L,WSLUA_ARG_Proto_new_DESCRIPTION);
Proto proto;
char *loname, *hiname;
@ -83,12 +83,12 @@ WSLUA_CONSTRUCTOR Proto_new(lua_State* L) { /* Creates a new <<lua_class_Proto,`
}
if (!desc[0]) {
WSLUA_ARG_ERROR(Proto_new,DESC,"must not be an empty string");
WSLUA_ARG_ERROR(Proto_new,DESCRIPTION,"must not be an empty string");
return 0;
}
if (proto_name_already_registered(desc)) {
WSLUA_ARG_ERROR(Proto_new,DESC,"there cannot be two protocols with the same description");
WSLUA_ARG_ERROR(Proto_new,DESCRIPTION,"there cannot be two protocols with the same description");
return 0;
}
@ -150,7 +150,7 @@ WSLUA_CONSTRUCTOR Proto_new(lua_State* L) { /* Creates a new <<lua_class_Proto,`
WSLUA_METAMETHOD Proto__call(lua_State* L) { /* Creates a <<lua_class_Proto,`Proto`>> object. */
#define WSLUA_ARG_Proto__call_NAME 1 /* The name of the protocol. */
#define WSLUA_ARG_Proto__call_DESC 2 /* A Long Text description of the protocol (usually lowercase). */
#define WSLUA_ARG_Proto__call_DESCRIPTION 2 /* A Long Text description of the protocol (usually lowercase). */
lua_remove(L,1); /* remove the table */
WSLUA_RETURN(Proto_new(L)); /* The new <<lua_class_Proto,`Proto`>> object. */
}

View File

@ -548,7 +548,7 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) {
`base.HEX_DEC`, `base.UNIT_STRING` or
`base.RANGE_STRING`. */
#define WSLUA_OPTARG_ProtoField_new_MASK 6 /* The bitmask to be used. */
#define WSLUA_OPTARG_ProtoField_new_DESCR 7 /* The description of the field. */
#define WSLUA_OPTARG_ProtoField_new_DESCRIPTION 7 /* The description of the field. */
ProtoField f;
int nargs = lua_gettop(L);
@ -563,7 +563,7 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) {
unit_name_string *uns = NULL;
unsigned base;
uint64_t mask = get_mask(L,WSLUA_OPTARG_ProtoField_new_MASK, 0x0);
const char *blob = luaL_optstring(L,WSLUA_OPTARG_ProtoField_new_DESCR,NULL);
const char *blob = luaL_optstring(L,WSLUA_OPTARG_ProtoField_new_DESCRIPTION,NULL);
bool base_unit_string = false;
bool base_range_string = false;
@ -973,7 +973,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_char_BASE One of `base.NONE`, `base.HEX`, `base.OCT` or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_char_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_char_MASK Integer mask of this field. */
/* WSLUA_OPTARG_ProtoField_char_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_char_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint8 Creates a <<lua_class_ProtoField,`ProtoField`>> of an unsigned 8-bit integer (i.e., a byte). */
@ -982,7 +982,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_uint8_BASE One of `base.DEC`, `base.HEX` or `base.OCT`, `base.DEC_HEX`, `base.HEX_DEC`, `base.UNIT_STRING` or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint8_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing the unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint8_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_uint8_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_uint8_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint16 Creates a <<lua_class_ProtoField,`ProtoField`>> of an unsigned 16-bit integer. */
@ -991,7 +991,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_uint16_BASE One of `base.DEC`, `base.HEX`, `base.OCT`, `base.DEC_HEX`, `base.HEX_DEC`, `base.UNIT_STRING` or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint16_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint16_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_uint16_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_uint16_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint24 Creates a <<lua_class_ProtoField,`ProtoField`>> of an unsigned 24-bit integer. */
@ -1000,7 +1000,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_uint24_BASE One of `base.DEC`, `base.HEX`, `base.OCT`, `base.DEC_HEX`, `base.HEX_DEC`, `base.UNIT_STRING`, or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint24_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing the unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint24_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_uint24_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_uint24_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint32 Creates a <<lua_class_ProtoField,`ProtoField`>> of an unsigned 32-bit integer. */
@ -1009,7 +1009,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_uint32_BASE One of `base.DEC`, `base.HEX`, `base.OCT`, `base.DEC_HEX`, `base.HEX_DEC`, `base.UNIT_STRING`, or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint32_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing the unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint32_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_uint32_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_uint32_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint64 Creates a <<lua_class_ProtoField,`ProtoField`>> of an unsigned 64-bit integer. */
@ -1018,7 +1018,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_uint64_BASE One of `base.DEC`, `base.HEX`, `base.OCT`, `base.DEC_HEX`, `base.HEX_DEC`, `base.UNIT_STRING`, or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint64_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing the unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_uint64_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_uint64_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_uint64_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int8 Creates a <<lua_class_ProtoField,`ProtoField`>> of a signed 8-bit integer (i.e., a byte). */
@ -1027,7 +1027,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_int8_BASE One of `base.DEC`, `base.UNIT_STRING`, or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_int8_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_int8_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_int8_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_int8_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int16 Creates a <<lua_class_ProtoField,`ProtoField`>> of a signed 16-bit integer. */
@ -1036,7 +1036,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_int16_BASE One of `base.DEC`, `base.UNIT_STRING`, or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_int16_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_int16_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_int16_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_int16_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int24 Creates a <<lua_class_ProtoField,`ProtoField`>> of a signed 24-bit integer. */
@ -1045,7 +1045,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_int24_BASE One of `base.DEC`, `base.UNIT_STRING`, or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_int24_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_int24_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_int24_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_int24_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int32 Creates a <<lua_class_ProtoField,`ProtoField`>> of a signed 32-bit integer. */
@ -1054,7 +1054,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_int32_BASE One of `base.DEC`, `base.UNIT_STRING`, or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_int32_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_int32_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_int32_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_int32_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int64 Creates a <<lua_class_ProtoField,`ProtoField`>> of a signed 64-bit integer. */
@ -1063,7 +1063,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_int64_BASE One of `base.DEC`, `base.UNIT_STRING`, or `base.RANGE_STRING`. */
/* WSLUA_OPTARG_ProtoField_int64_VALUESTRING A table containing the text that corresponds to the values, or a table containing tables of range string values that correspond to the values ({min, max, "string"}) if the base is `base.RANGE_STRING`, or a table containing unit name for the values if base is `base.UNIT_STRING`. */
/* WSLUA_OPTARG_ProtoField_int64_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_int64_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_int64_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_framenum Creates a <<lua_class_ProtoField,`ProtoField`>> for a frame number (for hyperlinks between frames). */
@ -1072,7 +1072,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_framenum_BASE Only `base.NONE` is supported for framenum. */
/* WSLUA_OPTARG_ProtoField_framenum_FRAMETYPE One of `frametype.NONE`, `frametype.REQUEST`, `frametype.RESPONSE`, `frametype.ACK` or `frametype.DUP_ACK`. */
/* WSLUA_OPTARG_ProtoField_framenum_MASK Integer, String or UInt64 mask of this field, which must be 0 for framenum. */
/* WSLUA_OPTARG_ProtoField_framenum_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_framenum_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
PROTOFIELD_INTEGER(char,FT_CHAR)
@ -1152,7 +1152,7 @@ static int ProtoField_boolean(lua_State* L, enum ftenum type) {
/* WSLUA_OPTARG_ProtoField_bool_DISPLAY How wide the parent bitfield is (`base.NONE` is used for NULL-value). */
/* WSLUA_OPTARG_ProtoField_bool_VALUESTRING A table containing the text that corresponds to the values. */
/* WSLUA_OPTARG_ProtoField_bool_MASK Integer, String or UInt64 mask of this field. */
/* WSLUA_OPTARG_ProtoField_bool_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_bool_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
PROTOFIELD_BOOL(bool,FT_BOOLEAN)
@ -1203,13 +1203,13 @@ static int ProtoField_time(lua_State* L,enum ftenum type) {
/* WSLUA_ARG_ProtoField_absolute_time_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_absolute_time_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_absolute_time_BASE One of `base.LOCAL`, `base.UTC` or `base.DOY_UTC`. */
/* WSLUA_OPTARG_ProtoField_absolute_time_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_absolute_time_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_relative_time Creates a <<lua_class_ProtoField,`ProtoField`>> of a time_t structure value. */
/* WSLUA_ARG_ProtoField_relative_time_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_relative_time_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_relative_time_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_relative_time_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
@ -1268,14 +1268,14 @@ static int ProtoField_floating(lua_State* L,enum ftenum type) {
/* WSLUA_ARG_ProtoField_float_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_float_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_float_VALUESTRING A table containing unit name for the values. */
/* WSLUA_OPTARG_ProtoField_float_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_float_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_double Creates a <<lua_class_ProtoField,`ProtoField`>> of a double-precision floating point (8 bytes). */
/* WSLUA_ARG_ProtoField_double_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_double_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_double_VALUESTRING A table containing unit name for the values. */
/* WSLUA_OPTARG_ProtoField_double_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_double_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
PROTOFIELD_FLOATING(float,FT_FLOAT)
@ -1339,28 +1339,28 @@ static int ProtoField_other_display(lua_State* L,enum ftenum type) {
/* WSLUA_ARG_ProtoField_string_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_string_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_string_DISPLAY One of `base.ASCII` or `base.UNICODE`. */
/* WSLUA_OPTARG_ProtoField_string_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_string_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_stringz Creates a <<lua_class_ProtoField,`ProtoField`>> of a zero-terminated string value. */
/* WSLUA_ARG_ProtoField_stringz_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_stringz_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_stringz_DISPLAY One of `base.ASCII` or `base.UNICODE`. */
/* WSLUA_OPTARG_ProtoField_stringz_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_stringz_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_bytes Creates a <<lua_class_ProtoField,`ProtoField`>> for an arbitrary number of bytes. */
/* WSLUA_ARG_ProtoField_bytes_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_bytes_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_bytes_DISPLAY One of `base.NONE`, `base.DOT`, `base.DASH`, `base.COLON` or `base.SPACE`. */
/* WSLUA_OPTARG_ProtoField_bytes_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_bytes_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_ubytes Creates a <<lua_class_ProtoField,`ProtoField`>> for an arbitrary number of unsigned bytes. */
/* WSLUA_ARG_ProtoField_ubytes_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_ubytes_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_ubytes_DISPLAY One of `base.NONE`, `base.DOT`, `base.DASH`, `base.COLON` or `base.SPACE`. */
/* WSLUA_OPTARG_ProtoField_ubytes_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_ubytes_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
@ -1406,61 +1406,64 @@ static int ProtoField_other(lua_State* L,enum ftenum type) {
/* _WSLUA_CONSTRUCTOR_ ProtoField_none Creates a <<lua_class_ProtoField,`ProtoField`>> of an unstructured type. */
/* WSLUA_ARG_ProtoField_none_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_none_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_none_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_none_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_ipv4 Creates a <<lua_class_ProtoField,`ProtoField`>> of an IPv4 address (4 bytes). */
/* WSLUA_ARG_ProtoField_ipv4_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_ipv4_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_ipv4_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_ipv4_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_ipv6 Creates a <<lua_class_ProtoField,`ProtoField`>> of an IPv6 address (16 bytes). */
/* WSLUA_ARG_ProtoField_ipv6_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_ipv6_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_ipv6_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_ipv6_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_ether Creates a <<lua_class_ProtoField,`ProtoField`>> of an Ethernet address (6 bytes). */
/* WSLUA_ARG_ProtoField_ether_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_ether_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_ether_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_ether_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_guid Creates a <<lua_class_ProtoField,`ProtoField`>> for a Globally Unique IDentifier (GUID). */
/* WSLUA_ARG_ProtoField_guid_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_guid_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_guid_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_guid_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_oid Creates a <<lua_class_ProtoField,`ProtoField`>> for an ASN.1 Organizational IDentified (OID). */
/* WSLUA_ARG_ProtoField_oid_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_oid_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_oid_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_oid_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_protocol Creates a <<lua_class_ProtoField,`ProtoField`>> for a sub-protocol. Since 1.99.9. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_protocol Creates a <<lua_class_ProtoField,`ProtoField`>> for a sub-protocol.
@since 1.99.9
*/
/* WSLUA_ARG_ProtoField_protocol_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_protocol_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_protocol_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_protocol_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_rel_oid Creates a <<lua_class_ProtoField,`ProtoField`>> for an ASN.1 Relative-OID. */
/* WSLUA_ARG_ProtoField_rel_oid_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_rel_oid_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_rel_oid_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_rel_oid_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_systemid Creates a <<lua_class_ProtoField,`ProtoField`>> for an OSI System ID. */
/* WSLUA_ARG_ProtoField_systemid_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_systemid_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_systemid_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_systemid_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
/* _WSLUA_CONSTRUCTOR_ ProtoField_eui64 Creates a <<lua_class_ProtoField,`ProtoField`>> for an EUI64. */
/* WSLUA_ARG_ProtoField_eui64_ABBR Abbreviated name of the field (the string used in filters). */
/* WSLUA_OPTARG_ProtoField_eui64_NAME Actual name of the field (the string that appears in the tree). */
/* WSLUA_OPTARG_ProtoField_eui64_DESC Description of the field. */
/* WSLUA_OPTARG_ProtoField_eui64_DESCRIPTION Description of the field. */
/* _WSLUA_RETURNS_ A <<lua_class_ProtoField,`ProtoField`>> object to be added to a table set to the <<lua_class_attrib_proto_fields,`Proto.fields`>> attribute. */
PROTOFIELD_OTHER(none,FT_NONE)
@ -1476,19 +1479,34 @@ PROTOFIELD_OTHER(rel_oid,FT_REL_OID)
PROTOFIELD_OTHER(systemid,FT_SYSTEM_ID)
PROTOFIELD_OTHER(eui64,FT_EUI64)
/* WSLUA_ATTRIBUTE ProtoField_type RO The type of the field. */
/* WSLUA_ATTRIBUTE ProtoField_type RO The type of the field.
@since 4.3.0
*/
WSLUA_ATTRIBUTE_INTEGER_GETTER(ProtoField,type);
/* WSLUA_ATTRIBUTE ProtoField_abbr RO The abbreviated name of the field. */
/* WSLUA_ATTRIBUTE ProtoField_abbr RO The abbreviated name of the field.
@since 4.3.0
*/
WSLUA_ATTRIBUTE_NAMED_STRING_GETTER(ProtoField,abbr,abbrev);
/* WSLUA_ATTRIBUTE ProtoField_name RO The actual name of the field. */
/* WSLUA_ATTRIBUTE ProtoField_name RO The actual name of the field.
@since 4.3.0
*/
WSLUA_ATTRIBUTE_STRING_GETTER(ProtoField,name);
/* WSLUA_ATTRIBUTE ProtoField_type RO The base of the field. */
/* WSLUA_ATTRIBUTE ProtoField_base RO The base of the field.
@since 4.3.0
*/
WSLUA_ATTRIBUTE_INTEGER_GETTER(ProtoField,base);
/* WSLUA_ATTRIBUTE ProtoField_type RO The valuestring of the field. */
/* WSLUA_ATTRIBUTE ProtoField_valuestring RO The valuestring of the field.
@since 4.3.0
*/
WSLUA_METAMETHOD ProtoField_get_valuestring(lua_State* L) {
ProtoField f = checkProtoField(L,1);
if (f->valuestring_ref != LUA_NOREF) {
@ -1499,11 +1517,17 @@ WSLUA_METAMETHOD ProtoField_get_valuestring(lua_State* L) {
return 1;
}
/* WSLUA_ATTRIBUTE ProtoField_type RO The mask of the field. */
/* WSLUA_ATTRIBUTE ProtoField_mask RO The mask of the field.
@since 4.3.0
*/
WSLUA_ATTRIBUTE_INTEGER_GETTER(ProtoField,mask);
/* WSLUA_ATTRIBUTE ProtoField_desc RO The description of this field. */
WSLUA_ATTRIBUTE_NAMED_STRING_GETTER(ProtoField,desc,blob);
/* WSLUA_ATTRIBUTE ProtoField_description RO The description of this field.
@since 4.3.0
*/
WSLUA_ATTRIBUTE_NAMED_STRING_GETTER(ProtoField,description,blob);
WSLUA_METAMETHOD ProtoField__tostring(lua_State* L) {
/* Returns a string with info about a protofield (for debugging purposes). */
@ -1593,7 +1617,7 @@ WSLUA_ATTRIBUTES ProtoField_attributes[] = {
WSLUA_ATTRIBUTE_ROREG(ProtoField,base),
WSLUA_ATTRIBUTE_ROREG(ProtoField,valuestring),
WSLUA_ATTRIBUTE_ROREG(ProtoField,mask),
WSLUA_ATTRIBUTE_ROREG(ProtoField,desc),
WSLUA_ATTRIBUTE_ROREG(ProtoField,description),
{ NULL, NULL, NULL }
};

View File

@ -147,7 +147,10 @@ WSLUA_FUNCTION wslua_format_time(lua_State* LS) { /* Formats a relative timestam
}
WSLUA_FUNCTION wslua_get_preference(lua_State *L) {
/* Get a preference value. @since 3.5.0 */
/* Get a preference value.
@since 3.5.0
*/
#define WSLUA_ARG_get_preference_PREFERENCE 1 /* The name of the preference. */
const char* preference = luaL_checkstring(L,WSLUA_ARG_get_preference_PREFERENCE);
@ -227,7 +230,10 @@ WSLUA_FUNCTION wslua_get_preference(lua_State *L) {
}
WSLUA_FUNCTION wslua_set_preference(lua_State *L) {
/* Set a preference value. @since 3.5.0 */
/* Set a preference value.
@since 3.5.0
*/
#define WSLUA_ARG_set_preference_PREFERENCE 1 /* The name of the preference. */
#define WSLUA_ARG_set_preference_VALUE 2 /* The preference value to set. */
const char* preference = luaL_checkstring(L,WSLUA_ARG_set_preference_PREFERENCE);
@ -315,7 +321,10 @@ WSLUA_FUNCTION wslua_set_preference(lua_State *L) {
}
WSLUA_FUNCTION wslua_reset_preference(lua_State *L) {
/* Reset a preference to default value. @since 3.5.0 */
/* Reset a preference to default value.
@since 3.5.0
*/
#define WSLUA_ARG_reset_preference_PREFERENCE 1 /* The name of the preference. */
const char* preference = luaL_checkstring(L,WSLUA_ARG_reset_preference_PREFERENCE);
@ -345,7 +354,10 @@ WSLUA_FUNCTION wslua_reset_preference(lua_State *L) {
}
WSLUA_FUNCTION wslua_apply_preferences(lua_State *L) {
/* Write preferences to file and apply changes. @since 3.5.0 */
/* Write preferences to file and apply changes.
@since 3.5.0
*/
char *pf_path = NULL;
int err = write_prefs(&pf_path);