aboutsummaryrefslogtreecommitdiffstats
path: root/src/url.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-20 19:35:07 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-20 19:35:07 +0400
commit5c9372c4a8678c6856360891180b02c2fdf688ee (patch)
treebc67f5cb057c4784c67e691f76aa8a8f80a40e51 /src/url.h
parent9bc06fea2eac12cc46028fcdd630d291a76b68ae (diff)
downloadrspamd-5c9372c4a8678c6856360891180b02c2fdf688ee.tar.gz
rspamd-5c9372c4a8678c6856360891180b02c2fdf688ee.zip
* Add start script for red hat compatible systems
Add descriptions for some rspamd API functions (no functional changes). --HG-- rename : linux/rspamd => linux/rspamd_debian.in
Diffstat (limited to 'src/url.h')
-rw-r--r--src/url.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/url.h b/src/url.h
index 5a8e7e1e2..f90820e75 100644
--- a/src/url.h
+++ b/src/url.h
@@ -74,9 +74,38 @@ enum protocol {
#define struri(uri) ((uri)->string)
+/*
+ * Parse urls inside text
+ * @param pool memory pool
+ * @param task task object
+ * @param part current text part
+ * @param is_html turn on html euristic
+ */
void url_parse_text (memory_pool_t *pool, struct worker_task *task, struct mime_text_part *part, gboolean is_html);
+
+/*
+ * Parse a single url into an uri structure
+ * @param pool memory pool
+ * @param uristring text form of url
+ * @param uri url object, must be pre allocated
+ */
enum uri_errno parse_uri(struct uri *uri, gchar *uristring, memory_pool_t *pool);
+
+/*
+ * Try to extract url from a text
+ * @param pool memory pool
+ * @param begin begin of text
+ * @param len length of text
+ * @param start storage for start position of url found (or NULL)
+ * @param end storage for end position of url found (or NULL)
+ * @param url_str storage for url string(or NULL)
+ * @return TRUE if url is found in specified text
+ */
gboolean url_try_text (memory_pool_t *pool, const gchar *begin, gsize len, gchar **start, gchar **end, gchar **url_str);
+
+/*
+ * Return text representation of url parsing error
+ */
const gchar* url_strerror (enum uri_errno err);
#endif