diff options
author | Jason Conti <jason.conti@gmail.com> | 2016-08-27 14:40:47 -0400 |
---|---|---|
committer | Jason Conti <jason.conti@gmail.com> | 2016-08-27 14:40:47 -0400 |
commit | 9b0c58a012eed9fc62deab147948e7f9139da7ed (patch) | |
tree | fbd9a5d69794febc476414c21982e26b2d64b324 /src/urlregex.h | |
parent | 9cb6e6e7bea6e7cded5212d99083ff948cb100bb (diff) | |
download | ayatana-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.h | 30 |
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 |