diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-04 14:46:55 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-04 14:46:55 +0100 |
commit | d52a62c089c6e498e936bd53ebd59b1a774b62a8 (patch) | |
tree | 8b478a75331ceb6f158cf3f7bc1ae9636e7b811f /src/lua | |
parent | 683164999675314cb35353df413decbcd5489b45 (diff) | |
download | rspamd-d52a62c089c6e498e936bd53ebd59b1a774b62a8.tar.gz rspamd-d52a62c089c6e498e936bd53ebd59b1a774b62a8.zip |
[Rework] Rename mime parts structures
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_mimepart.c | 44 | ||||
-rw-r--r-- | src/lua/lua_task.c | 8 | ||||
-rw-r--r-- | src/lua/lua_trie.c | 2 |
3 files changed, 27 insertions, 27 deletions
diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c index b0bbce85f..933059603 100644 --- a/src/lua/lua_mimepart.c +++ b/src/lua/lua_mimepart.c @@ -223,27 +223,27 @@ static const struct luaL_reg mimepartlib_m[] = { }; -static struct mime_text_part * +static struct rspamd_mime_text_part * lua_check_textpart (lua_State * L) { void *ud = rspamd_lua_check_udata (L, 1, "rspamd{textpart}"); luaL_argcheck (L, ud != NULL, 1, "'textpart' expected"); - return ud ? *((struct mime_text_part **)ud) : NULL; + return ud ? *((struct rspamd_mime_text_part **)ud) : NULL; } -static struct mime_part * +static struct rspamd_mime_part * lua_check_mimepart (lua_State * L) { void *ud = rspamd_lua_check_udata (L, 1, "rspamd{mimepart}"); luaL_argcheck (L, ud != NULL, 1, "'mimepart' expected"); - return ud ? *((struct mime_part **)ud) : NULL; + return ud ? *((struct rspamd_mime_part **)ud) : NULL; } static gint lua_textpart_is_utf (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); if (part == NULL || IS_PART_EMPTY (part)) { lua_pushboolean (L, FALSE); @@ -259,7 +259,7 @@ lua_textpart_is_utf (lua_State * L) static gint lua_textpart_get_content (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); struct rspamd_lua_text *t; if (part == NULL || IS_PART_EMPTY (part)) { @@ -279,7 +279,7 @@ lua_textpart_get_content (lua_State * L) static gint lua_textpart_get_length (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); if (part == NULL) { lua_pushnil (L); @@ -299,7 +299,7 @@ lua_textpart_get_length (lua_State * L) static gint lua_textpart_get_raw_length (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); if (part == NULL) { lua_pushnil (L); @@ -319,7 +319,7 @@ lua_textpart_get_raw_length (lua_State * L) static gint lua_textpart_get_lines_count (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); if (part == NULL) { lua_pushnil (L); @@ -339,7 +339,7 @@ lua_textpart_get_lines_count (lua_State * L) static gint lua_textpart_get_words_count (lua_State *L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); if (part == NULL) { lua_pushnil (L); @@ -359,7 +359,7 @@ lua_textpart_get_words_count (lua_State *L) static gint lua_textpart_is_empty (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); if (part == NULL) { lua_pushnil (L); @@ -374,7 +374,7 @@ lua_textpart_is_empty (lua_State * L) static gint lua_textpart_is_html (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); if (part == NULL) { lua_pushnil (L); @@ -389,7 +389,7 @@ lua_textpart_is_html (lua_State * L) static gint lua_textpart_get_html (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); struct html_content **phc; if (part == NULL || part->html == NULL) { @@ -407,7 +407,7 @@ lua_textpart_get_html (lua_State * L) static gint lua_textpart_get_language (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_text_part *part = lua_check_textpart (L); if (part != NULL) { if (part->lang_code != NULL && part->lang_code[0] != '\0') { @@ -423,12 +423,12 @@ lua_textpart_get_language (lua_State * L) static gint lua_textpart_get_mimepart (lua_State * L) { - struct mime_text_part *part = lua_check_textpart (L); - struct mime_part **pmime; + struct rspamd_mime_text_part *part = lua_check_textpart (L); + struct rspamd_mime_part **pmime; if (part != NULL) { if (part->mime_part != NULL) { - pmime = lua_newuserdata (L, sizeof (struct mime_part *)); + pmime = lua_newuserdata (L, sizeof (struct rspamd_mime_part *)); rspamd_lua_setclass (L, "rspamd{mimepart}", -1); *pmime = part->mime_part; @@ -445,7 +445,7 @@ lua_textpart_get_mimepart (lua_State * L) static gint lua_mimepart_get_content (lua_State * L) { - struct mime_part *part = lua_check_mimepart (L); + struct rspamd_mime_part *part = lua_check_mimepart (L); struct rspamd_lua_text *t; if (part == NULL) { @@ -465,7 +465,7 @@ lua_mimepart_get_content (lua_State * L) static gint lua_mimepart_get_length (lua_State * L) { - struct mime_part *part = lua_check_mimepart (L); + struct rspamd_mime_part *part = lua_check_mimepart (L); if (part == NULL) { lua_pushnil (L); @@ -480,7 +480,7 @@ lua_mimepart_get_length (lua_State * L) static gint lua_mimepart_get_type (lua_State * L) { - struct mime_part *part = lua_check_mimepart (L); + struct rspamd_mime_part *part = lua_check_mimepart (L); if (part == NULL) { lua_pushnil (L); @@ -501,7 +501,7 @@ lua_mimepart_get_type (lua_State * L) static gint lua_mimepart_get_filename (lua_State * L) { - struct mime_part *part = lua_check_mimepart (L); + struct rspamd_mime_part *part = lua_check_mimepart (L); if (part == NULL || part->filename == NULL) { lua_pushnil (L); @@ -517,7 +517,7 @@ static gint lua_mimepart_get_header_common (lua_State *L, gboolean full, gboolean raw) { gboolean strong = FALSE; - struct mime_part *part = lua_check_mimepart (L); + struct rspamd_mime_part *part = lua_check_mimepart (L); const gchar *name; name = luaL_checkstring (L, 2); diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 15b0ae0b7..b46fd2671 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -1135,14 +1135,14 @@ lua_task_get_text_parts (lua_State * L) { guint i; struct rspamd_task *task = lua_check_task (L, 1); - struct mime_text_part *part, **ppart; + struct rspamd_mime_text_part *part, **ppart; if (task != NULL) { lua_newtable (L); for (i = 0; i < task->text_parts->len; i ++) { part = g_ptr_array_index (task->text_parts, i); - ppart = lua_newuserdata (L, sizeof (struct mime_text_part *)); + ppart = lua_newuserdata (L, sizeof (struct rspamd_mime_text_part *)); *ppart = part; rspamd_lua_setclass (L, "rspamd{textpart}", -1); /* Make it array */ @@ -1161,14 +1161,14 @@ lua_task_get_parts (lua_State * L) { guint i; struct rspamd_task *task = lua_check_task (L, 1); - struct mime_part *part, **ppart; + struct rspamd_mime_part *part, **ppart; if (task != NULL) { lua_newtable (L); for (i = 0; i < task->parts->len; i ++) { part = g_ptr_array_index (task->parts, i); - ppart = lua_newuserdata (L, sizeof (struct mime_part *)); + ppart = lua_newuserdata (L, sizeof (struct rspamd_mime_part *)); *ppart = part; rspamd_lua_setclass (L, "rspamd{mimepart}", -1); /* Make it array */ diff --git a/src/lua/lua_trie.c b/src/lua/lua_trie.c index a0bf3afd4..0531197a2 100644 --- a/src/lua/lua_trie.c +++ b/src/lua/lua_trie.c @@ -251,7 +251,7 @@ lua_trie_search_mime (lua_State *L) { struct rspamd_multipattern *trie = lua_check_trie (L, 1); struct rspamd_task *task = lua_check_task (L, 2); - struct mime_text_part *part; + struct rspamd_mime_text_part *part; const gchar *text; gsize len, i; gboolean found = FALSE; |