lua_task.c
lua_message.c
lua_config.c
+ lua_rcl.c
lua_classifier.c
lua_cfg_file.c
lua_regexp.c
lua_session.c
lua_buffer.c
lua_dns.c
- lua_rsa.c
- lua_rcl.c)
+ lua_rsa.c)
ADD_LIBRARY(rspamd-lua ${LINK_TYPE} ${LUASRC})
SET_TARGET_PROPERTIES(rspamd-lua PROPERTIES VERSION ${RSPAMD_VERSION})
*/
gint lua_rcl_obj_push (lua_State *L, rspamd_cl_object_t *obj);
+/**
+ * Extract rcl object from lua object
+ * @param L
+ * @return
+ */
+rspamd_cl_object_t * lua_rcl_obj_get (lua_State *L);
+
/**
* Open libraries functions
*/
lua_rcl_obj_push_elt (lua_State *L, const char *key, rspamd_cl_object_t *obj)
{
lua_pushstring (L, key);
- lua_push_obj_simple (L, obj);
+ lua_rcl_obj_push (L, obj);
lua_settable (L, -3);
}
return lua_rcl_obj_push_simple (L, obj);
}
}
+
+/**
+ * Extract rcl object from lua object
+ * @param L
+ * @return
+ */
+rspamd_cl_object_t *
+lua_rcl_obj_get (lua_State *L)
+{
+ rspamd_cl_object_t *obj;
+ gint t;
+
+ obj = rspamd_cl_object_new ();
+
+ if (obj != NULL) {
+ t = lua_type (L, 1);
+ }
+
+ return obj;
+}
UT_hash_handle hh; /**< hash handle */
} rspamd_cl_object_t;
+
+/**
+ * Creates a new object
+ * @return new object
+ */
+static inline rspamd_cl_object_t *
+rspamd_cl_object_new (void)
+{
+ rspamd_cl_object_t *new;
+ new = g_slice_alloc0 (sizeof (rspamd_cl_object_t));
+ if (new != NULL) {
+ new->ref = 1;
+ }
+ return new;
+}
+
+
/**
* Converts an object to double value
* @param obj CL object
* The implementation of rcl parser
*/
-/**
- * Create a new object
- * @return new object
- */
-static inline rspamd_cl_object_t *
-rspamd_cl_object_new (void)
-{
- rspamd_cl_object_t *new;
- new = g_slice_alloc0 (sizeof (rspamd_cl_object_t));
- new->ref = 1;
- return new;
-}
-
/**
* Move up to len characters
* @param parser