aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_config.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-09-03 19:18:55 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-09-03 19:18:55 +0400
commit3215a8457fcedcbc400a9447d06c7f54b0af35a4 (patch)
treee7368d1c6e2bc98619a78b9551ee0116ea269875 /src/lua/lua_config.c
parentc9d98a8fc24f76d979ad479eff2fa66b31703832 (diff)
downloadrspamd-3215a8457fcedcbc400a9447d06c7f54b0af35a4.tar.gz
rspamd-3215a8457fcedcbc400a9447d06c7f54b0af35a4.zip
* Make lua api object oriented
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r--src/lua/lua_config.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index c385d24f7..0879cf835 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -48,7 +48,7 @@ static const struct luaL_reg metriclib_m[] = {
static struct config_file *
lua_check_config (lua_State *L)
{
- void *ud = luaL_checkudata (L, 1, "Rspamd.config");
+ void *ud = luaL_checkudata (L, 1, "rspamd{config}");
luaL_argcheck (L, ud != NULL, 1, "'config' expected");
return *((struct config_file **)ud);
}
@@ -56,7 +56,7 @@ lua_check_config (lua_State *L)
static struct metric *
lua_check_metric (lua_State *L)
{
- void *ud = luaL_checkudata (L, 1, "Rspamd.metric");
+ void *ud = luaL_checkudata (L, 1, "rspamd{metric}");
luaL_argcheck (L, ud != NULL, 1, "'metric' expected");
return *((struct metric **)ud);
}
@@ -128,7 +128,7 @@ lua_config_get_metric (lua_State *L)
metric = g_hash_table_lookup (cfg->metrics, name);
if (metric) {
pmetric = lua_newuserdata (L, sizeof (struct metric *));
- lua_setclass (L, "Rspamd.metric", -1);
+ lua_setclass (L, "rspamd{metric}", -1);
*pmetric = metric;
return 1;
}
@@ -154,7 +154,7 @@ lua_metric_symbol_callback (struct worker_task *task, gpointer ud)
lua_getglobal (cd->L, cd->name);
ptask = lua_newuserdata (cd->L, sizeof (struct worker_task *));
- lua_setclass (cd->L, "Rspamd.task", -1);
+ lua_setclass (cd->L, "rspamd{task}", -1);
*ptask = task;
if (lua_pcall(cd->L, 1, 1, 0) != 0) {
@@ -187,8 +187,8 @@ lua_metric_register_symbol (lua_State *L)
int
luaopen_config (lua_State *L)
{
- lua_newclass (L, "Rspamd.config", configlib_m);
- luaL_openlib (L, "config", configlib_m, 0);
+ lua_newclass (L, "rspamd{config}", configlib_m);
+ luaL_openlib (L, NULL, null_reg, 0);
return 1;
}
@@ -196,8 +196,8 @@ luaopen_config (lua_State *L)
int
luaopen_metric (lua_State *L)
{
- lua_newclass (L, "Rspamd.metric", configlib_m);
- luaL_openlib (L, "metric", configlib_m, 0);
+ lua_newclass (L, "rspamd{metric}", configlib_m);
+ luaL_openlib (L, NULL, null_reg, 0);
return 1;
}