aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua/make-init-lua.pl
diff options
context:
space:
mode:
Diffstat (limited to 'epan/wslua/make-init-lua.pl')
-rwxr-xr-xepan/wslua/make-init-lua.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/epan/wslua/make-init-lua.pl b/epan/wslua/make-init-lua.pl
index 328dd9fc92..29df74019f 100755
--- a/epan/wslua/make-init-lua.pl
+++ b/epan/wslua/make-init-lua.pl
@@ -34,6 +34,7 @@ my $wtap_encaps_table = '';
my $wtap_filetypes_table = '';
my $wtap_commenttypes_table = '';
my $ft_types_table = '';
+my $wtap_rec_types_table = '';
my $wtap_presence_flags_table = '';
my $bases_table = '';
my $encodings = '';
@@ -48,6 +49,7 @@ my %replacements = %{{
WTAP_FILETYPES => \$wtap_filetypes_table,
WTAP_COMMENTTYPES => \$wtap_commenttypes_table,
FT_TYPES => \$ft_types_table,
+ WTAP_REC_TYPES => \$wtap_rec_types_table,
WTAP_PRESENCE_FLAGS => \$wtap_presence_flags_table,
BASES => \$bases_table,
ENCODINGS => \$encodings,
@@ -78,6 +80,7 @@ close TEMPLATE;
$wtap_encaps_table = "-- Wiretap encapsulations XXX\nwtap_encaps = {\n";
$wtap_filetypes_table = "-- Wiretap file types\nwtap_filetypes = {\n";
$wtap_commenttypes_table = "-- Wiretap file comment types\nwtap_comments = {\n";
+$wtap_rec_types_table = "-- Wiretap record_types\nwtap_rec_types = {\n";
$wtap_presence_flags_table = "-- Wiretap presence flags\nwtap_presence_flags = {\n";
open WTAP_H, "< $WSROOT/wiretap/wtap.h" or die "cannot open '$WSROOT/wiretap/wtap.h': $!";
@@ -96,6 +99,10 @@ while(<WTAP_H>) {
$wtap_commenttypes_table .= "\t[\"$1\"] = $2,\n";
}
+ if ( /^#define REC_TYPE_([A-Z0-9_]+)\s+(\d+)\s+\/\*\*<([^\*]+)\*\// ) {
+ $wtap_rec_types_table .= "\t[\"$1\"] = $2, --$3\n";
+ }
+
if ( /^#define WTAP_HAS_([A-Z0-9_]+)\s+(0x\d+)\s+\/\*\*<([^\*]+)\*\// ) {
my $num = hex($2);
$wtap_presence_flags_table .= "\t[\"$1\"] = $num, --$3\n";
@@ -105,6 +112,9 @@ while(<WTAP_H>) {
$wtap_encaps_table =~ s/,\n$/\n}\nwtap = wtap_encaps -- for bw compatibility\n/msi;
$wtap_filetypes_table =~ s/,\n$/\n}\n/msi;
$wtap_commenttypes_table =~ s/,\n$/\n}\n/msi;
+# wtap_rec_types_table has comments at the end (not a comma),
+# but Lua doesn't care about extra commas so leave it in
+$wtap_rec_types_table =~ s/\n$/\n}\n/msi;
# wtap_presence_flags_table has comments at the end (not a comma),
# but Lua doesn't care about extra commas so leave it in
$wtap_presence_flags_table =~ s/\n$/\n}\n/msi;