diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2006-10-17 18:20:44 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2006-10-17 18:20:44 +0000 |
commit | b8ef88a6e224192c3d19310e859d655377c6ae1c (patch) | |
tree | 1ee746243482ff3fe184e88beb6b55dbdf219cbe /epan/wslua/make-taps.pl | |
parent | 482ded17c639d2722a9d6dbaba622cde358eae3e (diff) |
Several changes:
- do not #include a c code file in wslua_register.c compile a separate boject
- add the console and evaluate windows
- add some useful vars to the lua environment
- some cleanup
- add the dtd generator code (currently disabled)
svn path=/trunk/; revision=19579
Diffstat (limited to 'epan/wslua/make-taps.pl')
-rw-r--r-- | epan/wslua/make-taps.pl | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/epan/wslua/make-taps.pl b/epan/wslua/make-taps.pl index f287907ffb..fd340c0deb 100644 --- a/epan/wslua/make-taps.pl +++ b/epan/wslua/make-taps.pl @@ -124,7 +124,7 @@ sub dotap { $elems{$k} = $v; } - my $code = "void wslua_${tname}_to_table(lua_State* L, const void* p) { $sname* v = (void*)p; lua_newtable(L);\n"; + my $code = "static void wslua_${tname}_to_table(lua_State* L, const void* p) { $sname* v = (void*)p; lua_newtable(L);\n"; my $doc = "Tap: $tname\n"; for my $n (sort keys %elems) { @@ -155,6 +155,8 @@ print CFILE <<"HEADER"; /* This file is autogenerated from ./taps by ./make-taps.pl */ /* DO NOT EDIT! */ +#include "wslua.h" + HEADER print DOCFILE "\n"; @@ -170,7 +172,7 @@ while (<TAPSFILE>) { } print CFILE <<"TBLHDR"; -tappable_t tappables[] = { +static tappable_t tappables[] = { TBLHDR for my $tname (sort keys %functs) { @@ -184,7 +186,7 @@ print CFILE <<"TBLFTR"; {NULL,NULL} }; -void set_enums(lua_State* L) { +int wslua_set_tap_enums(lua_State* L) { TBLFTR @@ -199,7 +201,21 @@ ENUMELEM print CFILE "\tlua_settable(L,LUA_GLOBALSINDEX);\n"; } -print CFILE "};\n"; +print CFILE <<"TAIL"; + return 0; +}; + + +tap_extractor_t wslua_get_tap_extractor(const gchar* name) { + tappable_t* t; + for(t = tappables; t->name; t++ ) { + if (g_str_equal(t->name,name)) return t->extractor; + } + + return NULL; +} + +TAIL exit 0; |