Wireshark-commits: [Wireshark-commits] master 2c1e673: Allow chained calls with Lua TreeItem functi
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 28 Mar 2014 04:27:46 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=2c1e673fa2e361c73858709c7a06396c6df470ef
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

2c1e673 by Hadriel Kaplan (hadrielk@xxxxxxxxx):

    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@xxxxxxxxx>
    

Actions performed:

    from  0ffc690   dissect sRGB chunk
    adds  2c1e673   Allow chained calls with Lua TreeItem functions, and fix a couple of minor errors.


Summary of changes:
 epan/wslua/wslua.h           |    3 ++
 epan/wslua/wslua_internals.c |   48 ++++++++++++++++++++++++
 epan/wslua/wslua_proto.c     |    4 +-
 epan/wslua/wslua_struct.c    |    5 ++-
 epan/wslua/wslua_tree.c      |   84 ++++++++++++++++++++++++++++++++----------
 5 files changed, 121 insertions(+), 23 deletions(-)