diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-10-17 02:08:44 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-10-18 04:09:14 +0000 |
commit | 8a1adf1a66cb0324e418e2e588cf47c68c4a287a (patch) | |
tree | aecd0a2c6c3805b98445f4a17c1d076f07d7f3f5 /epan/wslua | |
parent | f07b1bc6042925cba6ca2bfb762c9521513259ba (diff) |
wslua: fix errors in documentation, add notational conventions
Improve example with better formatting, clarification comments and more
common variable names.
Extend make-wsluarm.pl to support arguments containing underscores.
Fixes the description of dissect_tcp_pdus.
Change TvbRange.tvb(tvb) into tvbrange:tvb() and ByteArray.tvb(name)
into bytearray:tvb(name), these are really instance methods.
Change-Id: I1e20ef46195dc6c06f9ac790d3432db283d21a5e
Reviewed-on: https://code.wireshark.org/review/18226
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_byte_array.c | 5 | ||||
-rw-r--r-- | epan/wslua/wslua_field.c | 3 | ||||
-rw-r--r-- | epan/wslua/wslua_tvb.c | 5 |
3 files changed, 4 insertions, 9 deletions
diff --git a/epan/wslua/wslua_byte_array.c b/epan/wslua/wslua_byte_array.c index 59c932ffa6..e375afa954 100644 --- a/epan/wslua/wslua_byte_array.c +++ b/epan/wslua/wslua_byte_array.c @@ -336,10 +336,7 @@ WSLUA_METAMETHOD ByteArray__tostring(lua_State* L) { WSLUA_RETURN(1); /* A hex-ascii string representation of the `ByteArray`. */ } -/* - * ByteArray_tvb(name) - */ -WSLUA_CONSTRUCTOR ByteArray_tvb (lua_State *L) { +WSLUA_METHOD ByteArray_tvb (lua_State *L) { /* Creates a new `Tvb` from a `ByteArray` (it gets added to the current frame too). */ #define WSLUA_ARG_ByteArray_tvb_NAME 2 /* The name to be given to the new data-source. */ ByteArray ba = checkByteArray(L,1); diff --git a/epan/wslua/wslua_field.c b/epan/wslua/wslua_field.c index d64513c5a2..29335ba541 100644 --- a/epan/wslua/wslua_field.c +++ b/epan/wslua/wslua_field.c @@ -308,9 +308,8 @@ static int FieldInfo_get_source(lua_State* L) { return 1; } -/* WSLUA_ATTRIBUTE FieldInfo_range RO The `TvbRange` covering this field. */ +/* WSLUA_ATTRIBUTE FieldInfo_range RO The `TvbRange` covering the bytes of this field in a Tvb. */ static int FieldInfo_get_range(lua_State* L) { - /* The `TvbRange` covering this field. */ FieldInfo fi = checkFieldInfo(L,1); if (push_TvbRange (L, fi->ws_fi->ds_tvb, fi->ws_fi->start, fi->ws_fi->length)) { diff --git a/epan/wslua/wslua_tvb.c b/epan/wslua/wslua_tvb.c index 1f06dd1160..e10ff394d8 100644 --- a/epan/wslua/wslua_tvb.c +++ b/epan/wslua/wslua_tvb.c @@ -391,11 +391,10 @@ gboolean push_TvbRange(lua_State* L, tvbuff_t* ws_tvb, int offset, int len) { } -WSLUA_CONSTRUCTOR TvbRange_tvb (lua_State *L) { +WSLUA_METHOD TvbRange_tvb(lua_State *L) { /* Creates a (sub)`Tvb` from a `TvbRange`. */ -#define WSLUA_ARG_Tvb_new_subset_RANGE 1 /* The `TvbRange` from which to create the new `Tvb`. */ - TvbRange tvbr = checkTvbRange(L,WSLUA_ARG_Tvb_new_subset_RANGE); + TvbRange tvbr = checkTvbRange(L,1); Tvb tvb; if (! (tvbr && tvbr->tvb)) return 0; |