aboutsummaryrefslogtreecommitdiff
path: root/src/urlregex.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/urlregex.h')
-rw-r--r--src/urlregex.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/urlregex.h b/src/urlregex.h
new file mode 100644
index 0000000..fecf418
--- /dev/null
+++ b/src/urlregex.h
@@ -0,0 +1,30 @@
+/*
+ * Functions for tokenizing a string and marking the urls.
+ */
+
+#ifndef __URLREGEX_H__
+#define __URLREGEX_H__
+
+#include <glib.h>
+
+typedef enum {
+ MATCHED,
+ NOT_MATCHED
+} MatchType;
+
+typedef struct {
+ char *text;
+ char *expanded;
+ MatchType type;
+} MatchGroup;
+
+void urlregex_init(void);
+guint urlregex_count(void);
+GList *urlregex_split(const char *text, guint index);
+GList *urlregex_split_all(const char *text);
+
+MatchGroup *urlregex_matchgroup_new(const char *text, const char *expanded, MatchType type);
+void urlregex_matchgroup_free(MatchGroup *group);
+void urlregex_matchgroup_list_free(GList *list);
+
+#endif