summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_task.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_task.c
parentc9d98a8fc24f76d979ad479eff2fa66b31703832 (diff)
downloadrspamd-3215a8457fcedcbc400a9447d06c7f54b0af35a4.tar.gz
rspamd-3215a8457fcedcbc400a9447d06c7f54b0af35a4.zip
* Make lua api object oriented
Diffstat (limited to 'src/lua/lua_task.c')
-rw-r--r--src/lua/lua_task.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 2f55f0d71..e89572144 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -58,7 +58,7 @@ static const struct luaL_reg textpartlib_m[] = {
static struct worker_task *
lua_check_task (lua_State *L)
{
- void *ud = luaL_checkudata (L, 1, "Rspamd.task");
+ void *ud = luaL_checkudata (L, 1, "rspamd{task}");
luaL_argcheck (L, ud != NULL, 1, "'task' expected");
return *((struct worker_task **)ud);
}
@@ -66,7 +66,7 @@ lua_check_task (lua_State *L)
static struct mime_text_part *
lua_check_textpart (lua_State *L)
{
- void *ud = luaL_checkudata (L, 1, "Rspamd.textpart");
+ void *ud = luaL_checkudata (L, 1, "rspamd{textpart}");
luaL_argcheck (L, ud != NULL, 1, "'textpart' expected");
return *((struct mime_text_part **)ud);
}
@@ -81,7 +81,7 @@ lua_task_get_message (lua_State *L)
if (task != NULL) {
/* XXX write handler for message object */
pmsg = lua_newuserdata (L, sizeof (GMimeMessage *));
- lua_setclass (L, "Rspamd.message", -1);
+ lua_setclass (L, "rspamd{message}", -1);
*pmsg = task->message;
}
return 1;
@@ -135,7 +135,7 @@ lua_task_get_text_parts (lua_State *L)
while (cur) {
part = cur->data;
ppart = lua_newuserdata (L, sizeof (struct mime_text_part *));
- lua_setclass (L, "Rspamd.textpart", -1);
+ lua_setclass (L, "rspamd{textpart}", -1);
*ppart = part;
cur = g_list_next (cur);
}
@@ -209,8 +209,8 @@ lua_textpart_get_fuzzy (lua_State *L)
int
luaopen_task (lua_State *L)
{
- lua_newclass (L, "Rspamd.task", tasklib_m);
- luaL_openlib (L, "task", tasklib_m, 0);
+ lua_newclass (L, "rspamd{task}", tasklib_m);
+ luaL_openlib (L, NULL, null_reg, 0);
return 1;
}
@@ -218,8 +218,8 @@ luaopen_task (lua_State *L)
int
luaopen_textpart (lua_State *L)
{
- lua_newclass (L, "Rspamd.textpart", textpartlib_m);
- luaL_openlib (L, "textpart", textpartlib_m, 0);
+ lua_newclass (L, "rspamd{textpart}", textpartlib_m);
+ luaL_openlib (L, NULL, null_reg, 0);
return 1;
}