From 9b0c58a012eed9fc62deab147948e7f9139da7ed Mon Sep 17 00:00:00 2001 From: Jason Conti Date: Sat, 27 Aug 2016 14:40:47 -0400 Subject: * Import urlregex files to handle matching and expanding urls --- src/urlregex.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/urlregex.h (limited to 'src/urlregex.h') 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 + +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 -- cgit v1.2.3