struct rspamd_dkim_key_s;
typedef struct rspamd_dkim_key_s rspamd_dkim_key_t;
-
-struct rspamd_dkim_key_s;
typedef struct rspamd_dkim_key_s rspamd_dkim_sign_key_t;
struct rspamd_task;
*/
LUA_FUNCTION_DEF (task, lookup_words);
+/**
+ * @method task:topointer()
+ *
+ * Returns raw C pointer (lightuserdata) associated with task
+ */
+LUA_FUNCTION_DEF (task, topointer);
+
static const struct luaL_reg tasklib_f[] = {
LUA_INTERFACE_DEF (task, load_from_file),
LUA_INTERFACE_DEF (task, load_from_string),
LUA_INTERFACE_DEF (task, get_stat_tokens),
LUA_INTERFACE_DEF (task, get_meta_words),
LUA_INTERFACE_DEF (task, lookup_words),
+ LUA_INTERFACE_DEF (task, topointer),
{"__tostring", rspamd_lua_class_tostring},
{NULL, NULL}
};
return 1;
}
+static gint
+lua_task_topointer (lua_State *L)
+{
+ LUA_TRACE_POINT;
+ struct rspamd_task *task = lua_check_task (L, 1);
+
+ if (task) {
+ lua_pushlightuserdata (L, task);
+ }
+ else {
+ return luaL_error (L, "invalid arguments");
+ }
+
+ return 1;
+}
+
/* Image functions */
static gint