Fix lua bindings for timestamp precision
authorHadriel Kaplan <hadrielk@yahoo.com>
Mon, 29 Sep 2014 15:34:46 +0000 (11:34 -0400)
committerEvan Huus <eapache@gmail.com>
Mon, 29 Sep 2014 15:50:18 +0000 (15:50 +0000)
The changes to the timestamp define names broke the init.lua file
generation.  Change-id Id0c27b31c5 tried to fix this, but would break
backwards compatibility of exisitng Lua scripts.  This commit fixes
that change by adding the timestamp variables in both a new Lua table
as well as the old filetypes table.

Change-Id: I74749acb51dc85094e8c63b240a1951bd4cc0330
Reviewed-on: https://code.wireshark.org/review/4370
Reviewed-by: Evan Huus <eapache@gmail.com>
epan/wslua/make-init-lua.pl

index cf63863a821395dff701a3ffaf5ef47a82005d3b..457d5331b5318e6a985e3eb2531596d647bca1d6 100755 (executable)
@@ -99,6 +99,8 @@ while(<WTAP_H>) {
 
     if ( /^#define WTAP_TSPREC_([A-Z0-9_]+)\s+(\d+)/ ) {
         $wtap_tsprecs_table .= "\t[\"$1\"] = $2,\n";
+        # for backwards compatibility we need to add them to the filetypes table too
+        $wtap_filetypes_table .= "\t[\"TSPREC_$1\"] = $2,\n";
     }
 
     if ( /^#define WTAP_COMMENT_([A-Z0-9_]+)\s+(0x\d+)/ ) {