aboutsummaryrefslogtreecommitdiff
path: root/src/urlregex.h
diff options
context:
space:
mode:
authorJason Conti <jason.conti@gmail.com>2016-08-27 14:40:47 -0400
committerJason Conti <jason.conti@gmail.com>2016-08-27 14:40:47 -0400
commit9b0c58a012eed9fc62deab147948e7f9139da7ed (patch)
treefbd9a5d69794febc476414c21982e26b2d64b324 /src/urlregex.h
parent9cb6e6e7bea6e7cded5212d99083ff948cb100bb (diff)
downloadayatana-indicator-notifications-9b0c58a012eed9fc62deab147948e7f9139da7ed.tar.gz
ayatana-indicator-notifications-9b0c58a012eed9fc62deab147948e7f9139da7ed.tar.bz2
ayatana-indicator-notifications-9b0c58a012eed9fc62deab147948e7f9139da7ed.zip
* Import urlregex files to handle matching and expanding urls
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