summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-01-23 00:04:18 -0500
committerAnders Broman <a.broman58@gmail.com>2015-01-23 05:31:04 +0000
commit407b7034e34265a3dff67cb28a6a8bac89f41a30 (patch)
treee8073ad34d9e9f44a2d5b961eced9b1445e780ff
parent8d1a9848e3acc266447e1ccc032f377ba559ca50 (diff)
downloadwireshark-407b7034e34265a3dff67cb28a6a8bac89f41a30.tar.gz
Fix some WsLua documentation errors
The format of the API chapter was a bit screwed up, as was the indentation level of attributes. Also, some functions introduced in 1.11.3 were not documented as being since that version. Change-Id: I7912488c6da5b5ae72933e4c5ce49f8fbf0b0e34 Reviewed-on: https://code.wireshark.org/review/6753 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rwxr-xr-xdocbook/make-wsluarm.pl2
-rw-r--r--docbook/wsluarm.asciidoc2
-rw-r--r--epan/wslua/wslua_struct.c1
-rw-r--r--epan/wslua/wslua_tvb.c42
4 files changed, 36 insertions, 11 deletions
diff --git a/docbook/make-wsluarm.pl b/docbook/make-wsluarm.pl
index 4bd121426b..35f92a8644 100755
--- a/docbook/make-wsluarm.pl
+++ b/docbook/make-wsluarm.pl
@@ -310,7 +310,7 @@ my $asciidoc_template = {
"==== %s\n\n",
#class_desc => "\t\t<para>%s</para>\n",
class_attr_header => "[[lua_class_attrib_%s]]\n\n" .
- "==== %s\n\n",
+ "===== %s\n\n",
#class_attr_descr => "\t\t\t<para>%s%s</para>\n",
class_attr_footer => "// End %s\n\n",
function_header => "[[lua_fn_%s]]\n\n" .
diff --git a/docbook/wsluarm.asciidoc b/docbook/wsluarm.asciidoc
index a92aafc503..2142092c55 100644
--- a/docbook/wsluarm.asciidoc
+++ b/docbook/wsluarm.asciidoc
@@ -164,7 +164,7 @@ register_menu("Test/Packets", menuable_tap, MENU_TOOLS_UNSORTED)
[[wsluarm_modules]]
-=== Wireshark's Lua API Reference Manual
+== Wireshark's Lua API Reference Manual
This Part of the User Guide describes the Wireshark specific functions in the embedded Lua.
diff --git a/epan/wslua/wslua_struct.c b/epan/wslua/wslua_struct.c
index ea9e36d2c5..f5d562e9e1 100644
--- a/epan/wslua/wslua_struct.c
+++ b/epan/wslua/wslua_struct.c
@@ -155,6 +155,7 @@
so unpacking a 64-bit field (`i8`/`I8`) will lose precision.
Use `e`/`E` to unpack into a Wireshark `Int64`/`UInt64` object instead.
+ @since 1.11.3
*/
diff --git a/epan/wslua/wslua_tvb.c b/epan/wslua/wslua_tvb.c
index 3c65d57ef3..30610a4351 100644
--- a/epan/wslua/wslua_tvb.c
+++ b/epan/wslua/wslua_tvb.c
@@ -37,7 +37,13 @@
WSLUA_CLASS_DEFINE(ByteArray,FAIL_ON_NULL("ByteArray"),NOP);
-WSLUA_CONSTRUCTOR ByteArray_new(lua_State* L) { /* Creates a `ByteArray` object. */
+WSLUA_CONSTRUCTOR ByteArray_new(lua_State* L) {
+ /* Creates a `ByteArray` object.
+
+ Starting in version 1.11.3, if the second argument is a boolean `true`,
+ then the first argyument is treated as a raw Lua string of bytes to use,
+ instead of a hexadecimal string.
+ */
#define WSLUA_OPTARG_ByteArray_new_HEXBYTES 1 /* A string consisting of hexadecimal bytes like "00 B1 A2" or "1a2b3c4d". */
#define WSLUA_OPTARG_ByteArray_new_SEPARATOR 2 /* A string separator between hex bytes/words (default=" "),
or if the boolean value `true` is used, then the first argument
@@ -248,7 +254,10 @@ WSLUA_METHOD ByteArray_subset(lua_State* L) {
}
WSLUA_METHOD ByteArray_base64_decode(lua_State* L) {
- /* Obtain a base64 decoded `ByteArray`. */
+ /* Obtain a base64 decoded `ByteArray`.
+
+ @since 1.11.3
+ */
ByteArray ba = checkByteArray(L,1);
ByteArray ba2;
gchar *data;
@@ -268,7 +277,10 @@ WSLUA_METHOD ByteArray_base64_decode(lua_State* L) {
}
WSLUA_METHOD ByteArray_raw(lua_State* L) {
- /* Obtain a Lua string of the binary bytes in a `ByteArray`. */
+ /* Obtain a Lua string of the binary bytes in a `ByteArray`.
+
+ @since 1.11.3
+ */
#define WSLUA_OPTARG_ByteArray_raw_OFFSET 2 /* The position of the first byte (default=0/first). */
#define WSLUA_OPTARG_ByteArray_raw_LENGTH 3 /* The length of the segment to get (default=all). */
ByteArray ba = checkByteArray(L,1);
@@ -291,7 +303,10 @@ WSLUA_METHOD ByteArray_raw(lua_State* L) {
}
WSLUA_METHOD ByteArray_tohex(lua_State* L) {
- /* Obtain a Lua string of the bytes in a `ByteArray` as hex-ascii, with given separator */
+ /* Obtain a Lua string of the bytes in a `ByteArray` as hex-ascii, with given separator
+
+ @since 1.11.3
+ */
#define WSLUA_OPTARG_ByteArray_tohex_LOWERCASE 2 /* True to use lower-case hex characters (default=false). */
#define WSLUA_OPTARG_ByteArray_tohex_SEPARATOR 3 /* A string separator to insert between hex bytes (default=nil). */
ByteArray ba = checkByteArray(L,1);
@@ -622,7 +637,10 @@ WSLUA_METHOD Tvb_range(lua_State* L) {
}
WSLUA_METHOD Tvb_raw(lua_State* L) {
- /* Obtain a Lua string of the binary bytes in a `Tvb`. */
+ /* Obtain a Lua string of the binary bytes in a `Tvb`.
+
+ @since 1.11.3
+ */
#define WSLUA_OPTARG_Tvb_raw_OFFSET 2 /* The position of the first byte (default=0/first). */
#define WSLUA_OPTARG_Tvb_raw_LENGTH 3 /* The length of the segment to get (default=all). */
Tvb tvb = checkTvb(L,1);
@@ -1242,7 +1260,10 @@ WSLUA_METHOD TvbRange_stringz(lua_State* L) {
WSLUA_METHOD TvbRange_strsize(lua_State* L) {
/* Find the size of a zero terminated string from a `TvbRange`.
- The size of the string includes the terminating zero. */
+ The size of the string includes the terminating zero.
+
+ @since 1.11.3
+ */
#define WSLUA_OPTARG_TvbRange_strsize_ENCODING 2 /* The encoding to use. Defaults to ENC_ASCII. */
TvbRange tvbr = checkTvbRange(L,1);
guint encoding = (guint)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_strsize_ENCODING, ENC_ASCII|ENC_NA);
@@ -1450,8 +1471,8 @@ WSLUA_METHOD TvbRange_range(lua_State* L) {
return 0;
}
-static int TvbRange_uncompress(lua_State* L) {
- /* Obtain a uncompressed TvbRange from a TvbRange */
+WSLUA_METHOD TvbRange_uncompress(lua_State* L) {
+ /* Obtain an uncompressed TvbRange from a TvbRange */
#define WSLUA_ARG_TvbRange_uncompress_NAME 2 /* The name to be given to the new data-source. */
TvbRange tvbr = checkTvbRange(L,1);
#ifdef HAVE_LIBZ
@@ -1518,7 +1539,10 @@ WSLUA_METHOD TvbRange_offset(lua_State* L) {
}
WSLUA_METHOD TvbRange_raw(lua_State* L) {
- /* Obtain a Lua string of the binary bytes in a `TvbRange`. */
+ /* Obtain a Lua string of the binary bytes in a `TvbRange`.
+
+ @since 1.11.3
+ */
#define WSLUA_OPTARG_TvbRange_raw_OFFSET 2 /* The position of the first byte (default=0/first). */
#define WSLUA_OPTARG_TvbRange_raw_LENGTH 3 /* The length of the segment to get (default=all). */
TvbRange tvbr = checkTvbRange(L,1);