aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-06-17 12:19:01 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-06-17 12:19:01 +0100
commit99c748761b602296cb3d23a0843c68c9f7b496b5 (patch)
treeb73055e62582252fc1e66aa5b4bed744f9d72683 /src/lua/lua_common.h
parent678596c9987d1f758f4240aabb429d14b1def96b (diff)
downloadrspamd-99c748761b602296cb3d23a0843c68c9f7b496b5.tar.gz
rspamd-99c748761b602296cb3d23a0843c68c9f7b496b5.zip
[Minor] Allow to allocate rspamd_text from task
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r--src/lua/lua_common.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
index 2ea51249d..226b250a7 100644
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -255,10 +255,28 @@ struct rspamd_lua_text *lua_check_text (lua_State *L, gint pos);
* @return
*/
struct rspamd_lua_text *lua_check_text_or_string (lua_State *L, gint pos);
-/* Creates and *pushes* new rspamd text, data is copied if RSPAMD_TEXT_FLAG_OWN is in flags*/
+/**
+ * Create new text object
+ * @param L
+ * @param start
+ * @param len
+ * @param own
+ * @return
+ */
struct rspamd_lua_text *lua_new_text (lua_State *L, const gchar *start,
gsize len, gboolean own);
/**
+ * Create new text object from task pool if allocation is needed
+ * @param task
+ * @param L
+ * @param start
+ * @param len
+ * @param own
+ * @return
+ */
+struct rspamd_lua_text * lua_new_text_task(lua_State *L, struct rspamd_task *task,
+ const gchar *start, gsize len, gboolean own);
+/**
* Checks if a text has binary characters (non ascii and non-utf8 characters)
* @param t
* @return