forked from osmocom/wireshark
Revert "Make Lua taps work in out-of-source-tree builds."
Breaks on windows...
This reverts commit 6b11cd97f2
.
Change-Id: I1caf5500da993d7988e09fc0758950469f8252cf
Reviewed-on: https://code.wireshark.org/review/3346
Reviewed-by: Evan Huus <eapache@gmail.com>
This commit is contained in:
parent
fade4b4d97
commit
41e322594b
|
@ -71,7 +71,6 @@ ADD_CUSTOM_COMMAND(
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/wslua/taps
|
||||
${CMAKE_CURRENT_BINARY_DIR}/taps_wslua.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/taps.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wslua
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wslua
|
||||
DEPENDS
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
# Wireshark - Network traffic analyzer
|
||||
# By Gerald Combs <gerald@wireshark.org>
|
||||
# Copyright 1998 Gerald Combs
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
@ -108,7 +108,7 @@ taps: $(taps_used)
|
|||
touch taps
|
||||
|
||||
taps_wslua.c: make-taps.pl taps
|
||||
$(PERL) $(srcdir)/make-taps.pl $(srcdir)/taps taps_wslua.c taps.txt $(srcdir)
|
||||
$(PERL) $(srcdir)/make-taps.pl taps taps_wslua.c taps.txt
|
||||
|
||||
taps.txt: taps_wslua.c
|
||||
|
||||
|
|
|
@ -73,19 +73,19 @@ my %enums = ();
|
|||
sub dotap {
|
||||
my ($tname,$fname,$sname,@enums) = @_;
|
||||
my $buf = '';
|
||||
|
||||
|
||||
open FILE, "< $fname";
|
||||
while(<FILE>) {
|
||||
$buf .= $_;
|
||||
}
|
||||
close FILE;
|
||||
|
||||
|
||||
$buf =~ s@/\*.*?\*/@@;
|
||||
|
||||
for my $ename (@enums) {
|
||||
$enums{$ename} = [];
|
||||
my $a = $enums{$ename};
|
||||
|
||||
|
||||
my $enumre = "typedef\\s+enum[^{]*{([^}]*)}[\\s\\n]*" . ${ename} . "[\\s\\n]*;";
|
||||
if ($buf =~ s/$enumre//ms ) {
|
||||
$types{$ename} = "/*$ename*/ lua_pushnumber(L,(lua_Number)v->%s);";
|
||||
|
@ -127,13 +127,13 @@ sub dotap {
|
|||
|
||||
for my $n (sort keys %elems) {
|
||||
my $fmt = $types{$elems{$n}};
|
||||
|
||||
|
||||
if ($fmt) {
|
||||
$code .= "\tlua_pushstring(L,\"$n\"); ";
|
||||
$code .= sprintf($fmt,$n,$n) . " lua_settable(L,-3);\n";
|
||||
$doc .= "\t$n: $comments{$elems{$n}}\n";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$code .= "}\n\n";
|
||||
|
@ -148,7 +148,6 @@ sub dotap {
|
|||
open TAPSFILE, "< $ARGV[0]";
|
||||
open CFILE, "> $ARGV[1]";
|
||||
open DOCFILE, "> $ARGV[2]";
|
||||
my $srcdir=$ARGV[3] . "/";
|
||||
|
||||
print CFILE <<"HEADER";
|
||||
/* This file is autogenerated from ./taps by ./make-taps.pl */
|
||||
|
@ -166,7 +165,6 @@ while (<TAPSFILE>) {
|
|||
s@#.*@@;
|
||||
next if /^\s*$/;
|
||||
my ($tname,$fname,$sname,@enums) = split /\s+/;
|
||||
$fname=$srcdir . "/" . $fname;
|
||||
my ($c,$doc) = dotap($tname,$fname,$sname,@enums);
|
||||
print CFILE "#include \"$fname\"\n";
|
||||
print CFILE $c;
|
||||
|
@ -182,7 +180,7 @@ TBLHDR
|
|||
{"$tname", $functs{$tname} },
|
||||
TBLELEM
|
||||
}
|
||||
|
||||
|
||||
print CFILE <<"TBLFTR";
|
||||
{"frame",NULL},
|
||||
{NULL,NULL}
|
||||
|
@ -213,7 +211,7 @@ tap_extractor_t wslua_get_tap_extractor(const gchar* name) {
|
|||
for(t = tappables; t->name; t++ ) {
|
||||
if (g_str_equal(t->name,name)) return t->extractor;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue