projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* GRAD element for graph, it acts more or less like an AREA,
[rrdtool.git]
/
bindings
/
lua
/
rrdlua.c
diff --git
a/bindings/lua/rrdlua.c
b/bindings/lua/rrdlua.c
index
a786077
..
a733184
100644
(file)
--- a/
bindings/lua/rrdlua.c
+++ b/
bindings/lua/rrdlua.c
@@
-26,6
+26,14
@@
#include "lualib.h"
#include "../../src/rrd_tool.h"
#include "lualib.h"
#include "../../src/rrd_tool.h"
+#ifdef LUA50
+#ifdef HAVE_COMPAT51
+#include "compat-5.1.h"
+#else
+#include "compat-5.1r5/compat-5.1.h"
+#endif
+#endif
+
extern void rrd_freemem(void *mem);
extern int luaopen_rrd (lua_State * L);
extern void rrd_freemem(void *mem);
extern int luaopen_rrd (lua_State * L);
@@
-284,6
+292,12
@@
lua_rrd_graph (lua_State * L)
return 3;
}
return 3;
}
+static int
+lua_rrd_flushcached(lua_State *L)
+{
+ return rrd_common_call(L, "flushcached", rrd_flushcached);
+}
+
#if defined(DINF)
static int
lua_rrd_info (lua_State * L)
#if defined(DINF)
static int
lua_rrd_info (lua_State * L)
@@
-339,6
+353,7
@@
static const struct luaL_reg rrd[] = {
{"restore", lua_rrd_restore},
{"tune", lua_rrd_tune},
{"update", lua_rrd_update},
{"restore", lua_rrd_restore},
{"tune", lua_rrd_tune},
{"update", lua_rrd_update},
+ {"flushcached", lua_rrd_flushcached},
#if defined(DINF)
{"info", lua_rrd_info},
{"updatev", lua_rrd_updatev},
#if defined(DINF)
{"info", lua_rrd_info},
{"updatev", lua_rrd_updatev},
@@
-354,7
+369,12
@@
static const struct luaL_reg rrd[] = {
int
luaopen_rrd (lua_State * L)
{
int
luaopen_rrd (lua_State * L)
{
+#if defined LUA50
+ /* luaL_module is defined in compat-5.1.c */
+ luaL_module (L, "rrd", rrd, 0);
+#else
luaL_register (L, "rrd", rrd);
luaL_register (L, "rrd", rrd);
+#endif
set_info (L);
return 1;
}
set_info (L);
return 1;
}