[SCM] Development fot GoFind! branch, master, updated. da9995f04381bb14adb683dbe21525dbd0ab9945
Miriam Ruiz
miriam at debian.org
Tue Nov 25 00:47:43 UTC 2008
The following commit has been merged in the master branch:
commit da9995f04381bb14adb683dbe21525dbd0ab9945
Author: Miriam Ruiz <miriam at debian.org>
Date: Tue Nov 25 01:50:22 2008 +0100
different plugins for plain lua and luagtk
diff --git a/Makefile b/Makefile
index a5e4237..f39f86a 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ OBJS= Engine.o Environment.o filter.o field.o gofind.o \
taghandler.o cfgmanager.o boolparser.o \
utf8.o dll.o guiplugin.o pkgdata.o slre.o
-PLUGINS= gui_cli.so gui_fltk.so gui_lua.so
+PLUGINS= gui_cli.so gui_fltk.so gui_lua.so gui_luagtk.so
all: gofind $(PLUGINS)
@@ -56,11 +56,17 @@ fltk/ui.h fltk/ui.cpp: fltk/ui.fld
cd fltk && fluid -c -o ui.cpp -h ui.h ui.fld
gui_lua.so : gui_lua.o
+ g++ $(LDFLAGS) -shared $^ -o $@ `pkg-config lua5.1 --libs` $(LIBS)
+
+gui_luagtk.so : gui_lua.o gui_luagtk.o
g++ $(LDFLAGS) -shared $^ -o $@ `pkg-config lua5.1 --libs` $(LIBS) -llua5.1-gtk
gui_lua.o: gui_lua.cpp
g++ -o $@ -c $+ $(CFLAGS) `pkg-config lua5.1 --cflags`
+gui_luagtk.o: gui_luagtk.cpp
+ g++ -o $@ -c $+ $(CFLAGS) `pkg-config lua5.1 --cflags`
+
TEST_OBJS= filter.test.o taghandler.test.o cfgmanager.test.o boolparser.test.o slre.test.o utf8.test.o CuTest.o dll.test.o test.o
TEST_PLUGINS= testplugin.test.so
diff --git a/gui_lua.cpp b/gui_lua.cpp
index 1cfe69a..9250f62 100644
--- a/gui_lua.cpp
+++ b/gui_lua.cpp
@@ -35,6 +35,9 @@
#include <iostream>
#include <cmath>
+#include <stdlib.h>
+#include <stdio.h>
+
#ifdef USE_GETTEXT
#include <libintl.h>
#include <locale.h>
@@ -49,25 +52,6 @@ using namespace ept::debtags;
using namespace ept::apt;
using namespace ept::textsearch;
-#include <stdlib.h>
-#include <stdio.h>
-
-static int argc = 0;
-static const char **argv = NULL;
-
-extern "C" int init(int _argc, const char *_argv[])
-{
- std::cout << _("Lua Plugin successfully loaded") << std::endl;
- argc = _argc;
- argv = _argv;
- return 1; // true
-}
-
-extern "C" void comment(const char *text)
-{
- std::cout << "# " << text << std::endl;
-}
-
/******************************************************************************
* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved.
*
@@ -288,19 +272,8 @@ static int pmain (lua_State *L)
}
-/* Declare the Lua libraries we wish to use. */
-/* Note: If you are opening and running a file containing Lua code */
-/* using 'lua_dofile(l, "myfile.lua") - you must delcare all the libraries */
-/* used in that file here also. */
-
-extern "C" int luaopen_base(lua_State *L);
-extern "C" int luaopen_gtk(lua_State *L);
-
-static const luaL_reg lualibs[] =
-{
- { "base", luaopen_base },
- { "gtk", luaopen_gtk },
-};
+static int argc = 0;
+static const char **argv = NULL;
extern "C" int go(PackageData &pkgdata)
{
@@ -319,3 +292,16 @@ extern "C" int go(PackageData &pkgdata)
lua_close(L);
return (status || s.status) ? 0 /* FAILURE */ : 1 /* SUCCESS */;
}
+
+extern "C" int init(int _argc, const char *_argv[])
+{
+ std::cout << _("Lua Plugin successfully loaded") << std::endl;
+ argc = _argc;
+ argv = _argv;
+ return 1; // true
+}
+
+extern "C" void comment(const char *text)
+{
+ std::cout << "# " << text << std::endl;
+}
diff --git a/cfgmanager.cpp b/gui_luagtk.cpp
similarity index 80%
copy from cfgmanager.cpp
copy to gui_luagtk.cpp
index e88b595..311f538 100644
--- a/cfgmanager.cpp
+++ b/gui_luagtk.cpp
@@ -16,19 +16,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "common.h"
-#include "cfgmanager.h"
+#include <lua.hpp>
-ConfigManager::ConfigManager()
-{
-}
-
-ConfigManager::~ConfigManager()
-{
-}
+extern "C" int luaopen_base(lua_State *L);
+extern "C" int luaopen_gtk(lua_State *L);
-#ifdef UNIT_TEST
-TEST_FUNCTION TestCuConfigManager(CuTest* tc)
+static const luaL_reg lualibs[] =
{
-}
-#endif
+ { "base", luaopen_base },
+ { "gtk", luaopen_gtk },
+};
--
Development fot GoFind!
More information about the Pkg-games-commits
mailing list