diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-03-27 16:35:48 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-03-28 04:27:43 +0000 |
commit | 2c1e673fa2e361c73858709c7a06396c6df470ef (patch) | |
tree | eed3464aa681e031c1c7eb7f0ae7e38633b001e4 /epan/wslua/wslua.h | |
parent | 0ffc690da40edf31acb95b2a15033d43a3f35ebd (diff) |
Allow chained calls with Lua TreeItem functions, and fix a couple of minor errors.
A common Lua idiom is to use chained calls, i.e. tree:foo():bar():choo(). This actually
works for tree:add() because it returns the new child tree item which is then the one
being applied to the next chained call. But it doesn't work beyond that for things like
set_generated() and so on. So this commit fixes that.
This also fixes the Lua tree:add() function for the FT_BOOL type to let it be a Lua boolean value.
And it reverts a previous change to Struct.tohex() to allow coercion of the argument.
Change-Id: I10f819d363163914ba320c87d4bedebe5b50cacf
Reviewed-on: https://code.wireshark.org/review/851
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/wslua/wslua.h')
-rw-r--r-- | epan/wslua/wslua.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h index 1ec3087233..5909027273 100644 --- a/epan/wslua/wslua.h +++ b/epan/wslua/wslua.h @@ -661,7 +661,10 @@ WSLUA_DECLARE_FUNCTIONS() extern lua_State* wslua_state(void); extern int wslua__concat(lua_State* L); +extern gboolean wslua_toboolean(lua_State* L, int n); +extern gboolean wslua_checkboolean(lua_State* L, int n); extern gboolean wslua_optbool(lua_State* L, int n, gboolean def); +extern lua_Integer wslua_tointeger(lua_State* L, int n); extern int wslua_optboolint(lua_State* L, int n, int def); extern const char* wslua_checklstring_only(lua_State* L, int n, size_t *l); extern const char* wslua_checkstring_only(lua_State* L, int n); |