summaryrefslogtreecommitdiff
path: root/src/bookmarks.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-25 22:13:25 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-25 22:13:25 +0200
commitf35016f3ed7663fb61d7ac7dd1cf772089a39867 (patch)
tree8e37baa8f1e69eb196aa13ea823b13d4a26d664c /src/bookmarks.c
parent0aea9d2f870d6fcdbf050d6ae7df4fd849da0975 (diff)
SidebarWidget: Tagging bookmarks via menu
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) {