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 | 81d0ab4d99d34afc3fcec42dc52b81096a0c27a6 (patch) | |
tree | fbd9a5d69794febc476414c21982e26b2d64b324 /src/urlregex.h | |
parent | c5d5c0aae210dc8e440e879bd3c3fc38520adb41 (diff) | |
download | ayatana-indicator-notifications-81d0ab4d99d34afc3fcec42dc52b81096a0c27a6.tar.gz ayatana-indicator-notifications-81d0ab4d99d34afc3fcec42dc52b81096a0c27a6.tar.bz2 ayatana-indicator-notifications-81d0ab4d99d34afc3fcec42dc52b81096a0c27a6.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 |