diff options
author | Lars Roland <Lars.Roland@gmx.net> | 2006-02-07 09:12:43 +0000 |
---|---|---|
committer | Lars Roland <Lars.Roland@gmx.net> | 2006-02-07 09:12:43 +0000 |
commit | 5f1e470cc2a42387a4b8823f53b826ce8d82b7e5 (patch) | |
tree | 59919707a0240a17f3c27533f162ae0ffa6d1fff /plugins | |
parent | baed8f088844966923d42e056f79dcdfaaa91f36 (diff) |
changes to build lua plugin with MSVC6:
- nmake makefile for lua plugin added.
- declare variables at the beginning of a function.
- proto_reg_handoff_lua was removed, remove remaining calls, too.
- missing functions to libethereal.def added.
add lua plugin to installer, if available.
svn path=/trunk/; revision=17196
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Makefile.nmake | 17 | ||||
-rw-r--r-- | plugins/lua/Makefile.nmake | 41 | ||||
-rw-r--r-- | plugins/lua/lua_tvb.c | 22 | ||||
-rw-r--r-- | plugins/lua/plugin.c | 4 |
4 files changed, 70 insertions, 14 deletions
diff --git a/plugins/Makefile.nmake b/plugins/Makefile.nmake index d3fdeedfe1..c3cb1cc06b 100644 --- a/plugins/Makefile.nmake +++ b/plugins/Makefile.nmake @@ -18,6 +18,7 @@ all: \ gryphon \ h223 \ irda \ + lua\ lwres \ mate \ megaco \ @@ -88,6 +89,13 @@ irda:: $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake cd .. +lua:: +!IFDEF LUA_DIR + cd lua + $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake + cd .. +!ENDIF + lwres:: cd lwres $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake @@ -176,6 +184,8 @@ clean: $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean cd ../irda $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean + cd ../lua + $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean cd ../lwres $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean cd ../mate @@ -227,6 +237,8 @@ distclean: clean $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean cd ../irda $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean + cd ../lua + $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean cd ../lwres $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean cd ../mate @@ -278,6 +290,8 @@ maintainer-clean: distclean $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean cd ../irda $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean + cd ../lua + $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean cd ../lwres $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean cd ../mate @@ -324,6 +338,9 @@ install-plugins: xcopy gryphon\*.dll $(VERSION) /d xcopy h223\*.dll $(VERSION) /d xcopy irda\*.dll $(VERSION) /d +!IFDEF LUA_DIR + xcopy lua\*.dll $(VERSION) /d +!ENDIF xcopy lwres\*.dll $(VERSION) /d xcopy mate\*.dll $(VERSION) /d xcopy megaco\*.dll $(VERSION) /d diff --git a/plugins/lua/Makefile.nmake b/plugins/lua/Makefile.nmake new file mode 100644 index 0000000000..bf74bf0264 --- /dev/null +++ b/plugins/lua/Makefile.nmake @@ -0,0 +1,41 @@ +# +# $Id$ +# + +include ..\..\config.nmake + +############### no need to modify below this line ######### + +CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) $(LUA_CFLAGS)\ + /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS) + +LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS) + +!IFDEF LUA_DIR +!IFDEF ENABLE_LIBETHEREAL +LINK_PLUGIN_WITH=..\..\epan\libethereal.lib +CFLAGS=/DHAVE_WIN32_LIBETHEREAL_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS) + +OBJECTS= \ + lua_tvb.obj \ + lua_proto.obj \ + lua_tree.obj \ + lua_pinfo.obj \ + lua_tap.obj \ + lua_gui.obj \ + packet-lua.obj \ + plugin.obj + +lua.dll lua.exp lua.lib : $(OBJECTS) $(LINK_PLUGIN_WITH) + link -dll /out:lua.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \ + $(GLIB_LIBS) $(LUA_LIBS) + +!ENDIF +!ENDIF + +clean: + rm -f $(OBJECTS) lua.dll lua.exp lua.lib *.pdb + +distclean: clean + +maintainer-clean: distclean diff --git a/plugins/lua/lua_tvb.c b/plugins/lua/lua_tvb.c index 7d3abb60c1..5b86af79e2 100644 --- a/plugins/lua/lua_tvb.c +++ b/plugins/lua/lua_tvb.c @@ -34,20 +34,20 @@ LUA_CLASS_DEFINE(ByteArray,BYTE_ARRAY,if (! *p) luaL_argerror(L,index,"null byte static int ByteArray_new(lua_State* L) { GByteArray* ba = g_byte_array_new(); + const gchar* s; + /* XXX: slow! */ + int nibble[2]; + int i = 0; + gchar c; if (lua_gettop(L) == 1) { - const gchar* s = luaL_checkstring(L,1); + s = luaL_checkstring(L,1); if (!s) { luaL_argerror(L,1,"not a string"); return 0; } - /* XXX: slow! */ - int nibble[2]; - int i = 0; - gchar c; - for (; (c = *s); s++) { switch(c) { case '0': case '1': case '2': case '3': case '4': case '5' : case '6' : case '7': case '8' : case '9' : @@ -282,6 +282,9 @@ int ByteArray_register(lua_State* L) { static int Tvb_new_real (lua_State *L) { ByteArray ba = checkByteArray(L,1); + const gchar* name = luaL_optstring(L,2,"Unnamed") ; + guint8* data; + Tvb tvb; if (!ba) return 0; @@ -294,14 +297,12 @@ static int Tvb_new_real (lua_State *L) { return 0; } - const gchar* name = luaL_optstring(L,2,"Unnamed") ; - guint8* data; if (! ba) return 0; data = g_memdup(ba->data, ba->len); - Tvb tvb = tvb_new_real_data(data, ba->len,ba->len); + tvb = tvb_new_real_data(data, ba->len,ba->len); tvb_set_free_cb(tvb, g_free); add_new_data_source(lua_pinfo, tvb, name); @@ -334,11 +335,12 @@ static int Tvb_new_subset (lua_State *L) { static int Tvb_tostring(lua_State* L) { Tvb tvb = checkTvb(L,1); int len; + gchar* str; if (!tvb) return 0; len = tvb_length(tvb); - gchar* str = ep_strdup_printf("TVB(%i) : %s",len,tvb_bytes_to_str(tvb,0,len)); + str = ep_strdup_printf("TVB(%i) : %s",len,tvb_bytes_to_str(tvb,0,len)); lua_pushstring(L,str); return 1; } diff --git a/plugins/lua/plugin.c b/plugins/lua/plugin.c index 5d9c55e075..9e449d1fb9 100644 --- a/plugins/lua/plugin.c +++ b/plugins/lua/plugin.c @@ -50,7 +50,6 @@ #endif void proto_register_lua(void); -void proto_reg_handoff_lua(void); static gboolean initialized = FALSE; @@ -67,8 +66,5 @@ G_MODULE_EXPORT void plugin_reg_handoff(void) proto_register_lua(); initialized = 1; } - - proto_reg_handoff_lua(); - } #endif |