summaryrefslogtreecommitdiff
path: root/src/bookmarks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks.c')
-rw-r--r--src/bookmarks.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bookmarks.c b/src/bookmarks.c
index f97ef0c6..0791a207 100644
--- a/src/bookmarks.c
+++ b/src/bookmarks.c
@@ -41,6 +41,15 @@ void deinit_Bookmark(iBookmark *d) {
41 deinit_String(&d->url); 41 deinit_String(&d->url);
42} 42}
43 43
44iBool hasTag_Bookmark(const iBookmark *d, const char *tag) {
45 iRegExp *pattern = new_RegExp(format_CStr("\\b%s\\b", tag), caseSensitive_RegExpOption);
46 iRegExpMatch m;
47 init_RegExpMatch(&m);
48 const iBool found = matchString_RegExp(pattern, &d->tags, &m);
49 iRelease(pattern);
50 return found;
51}
52
44iDefineTypeConstruction(Bookmark) 53iDefineTypeConstruction(Bookmark)
45 54
46static int cmpTimeDescending_Bookmark_(const iBookmark **a, const iBookmark **b) { 55static int cmpTimeDescending_Bookmark_(const iBookmark **a, const iBookmark **b) {