summaryrefslogtreecommitdiff
path: root/client/lua.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/lua.cc')
-rw-r--r--client/lua.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/client/lua.cc b/client/lua.cc
index 3dd5381..062e520 100644
--- a/client/lua.cc
+++ b/client/lua.cc
@@ -32,6 +32,9 @@
#include "luawidget.h"
+#define DEBUG(fmt...) printf("LUA (%p)", this); printf(fmt); fflush(stdout)
+//#define DEBUG(ftm...)
+
#define GLOBAL_POINTER "_pracroGlobalLUAObjectPointerThisShouldBeANameThatIsNotAccidentallyOverwritten"
static int get_widget(lua_State *L)
@@ -58,7 +61,7 @@ static int get_widget(lua_State *L)
Widget *widget = lua->getWidget(name);
- // printf("FIND: %s (%p)\n", name.toStdString().c_str(), widget);
+ // DEBUG("FIND: %s (%p)\n", name.toStdString().c_str(), widget);
if(widget) {
wdg_make_widget(L, widget);
@@ -66,7 +69,7 @@ static int get_widget(lua_State *L)
lua_pushnil(L);
}
- // printf("DONE\n");
+ // DEBUG("DONE\n");
return 1;
}
@@ -111,7 +114,7 @@ QString LUA::runParser(QString program)
return false;
}
- printf("Running %s\n", program.toStdString().c_str());
+ DEBUG("Running %s\n", program.toStdString().c_str());
int top = lua_gettop(L);
@@ -152,10 +155,10 @@ bool LUA::runScript(QString script, Widget *widget, QString name)
return false;
}
- printf("Running %s script %s on %s widget.\n",
- name.toStdString().c_str(),
- script.toStdString().c_str(),
- widget?widget->name().toStdString().c_str():"NULL");
+ DEBUG("Running %s script %s on %s widget.\n",
+ name.toStdString().c_str(),
+ script.toStdString().c_str(),
+ widget?widget->name().toStdString().c_str():"NULL");
if(widget) {
wdg_make_widget(L, widget);
@@ -181,7 +184,7 @@ bool LUA::runScript(QString script, Widget *widget, QString name)
void LUA::error(QString message)
{
- printf("LUA ERROR: %s\n", message.toStdString().c_str());
+ DEBUG("LUA ERROR: %s\n", message.toStdString().c_str());
}
Widget *LUA::getWidget(QString name)