diff options
Diffstat (limited to 'src/bookmarks.c')
-rw-r--r-- | src/bookmarks.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bookmarks.c b/src/bookmarks.c index 0791a207..8bde5b8b 100644 --- a/src/bookmarks.c +++ b/src/bookmarks.c | |||
@@ -50,6 +50,19 @@ iBool hasTag_Bookmark(const iBookmark *d, const char *tag) { | |||
50 | return found; | 50 | return found; |
51 | } | 51 | } |
52 | 52 | ||
53 | void addTag_Bookmark(iBookmark *d, const char *tag) { | ||
54 | if (!isEmpty_String(&d->tags)) { | ||
55 | appendChar_String(&d->tags, ' '); | ||
56 | } | ||
57 | appendCStr_String(&d->tags, tag); | ||
58 | } | ||
59 | |||
60 | void removeTag_Bookmark(iBookmark *d, const char *tag) { | ||
61 | const size_t pos = indexOfCStr_String(&d->tags, tag); | ||
62 | remove_Block(&d->tags.chars, pos, strlen(tag)); | ||
63 | trim_String(&d->tags); | ||
64 | } | ||
65 | |||
53 | iDefineTypeConstruction(Bookmark) | 66 | iDefineTypeConstruction(Bookmark) |
54 | 67 | ||
55 | static int cmpTimeDescending_Bookmark_(const iBookmark **a, const iBookmark **b) { | 68 | static int cmpTimeDescending_Bookmark_(const iBookmark **a, const iBookmark **b) { |