summaryrefslogtreecommitdiffstats
path: root/tag.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2021-12-16 17:11:12 +0100
committerLouis Burda <quent.burda@gmail.com>2021-12-20 15:31:31 +0100
commit3eea7a245a7ed49127a222628543f9509a6ff2b6 (patch)
tree345a923819b73bc88b551af5f708476239b6b7d9 /tag.c
parent15a8fe2cf2b16af8739a7ec2b64b5c5f184161b8 (diff)
downloadtmus-3eea7a245a7ed49127a222628543f9509a6ff2b6.tar.gz
tmus-3eea7a245a7ed49127a222628543f9509a6ff2b6.zip
Switched most buffers to wide chars, added general ref class, now clear mpd errors, added track and command completion
Diffstat (limited to 'tag.c')
-rw-r--r--tag.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/tag.c b/tag.c
index e464dbc..452d099 100644
--- a/tag.c
+++ b/tag.c
@@ -1,53 +1,4 @@
#include "tag.h"
#include "link.h"
-static struct link *
-tagrefs_ffind(struct link *head, struct tag *tag)
-{
- struct link *iter;
- for (iter = head->next; iter; iter = iter->next) {
- if (UPCAST(iter, struct tag_ref)->tag == tag)
- return iter;
- }
-
- return NULL;
-}
-
-int
-tagrefs_incl(struct link *head, struct tag *tag)
-{
- struct link *ref;
-
- ref = tagrefs_ffind(head, tag);
- return ref != NULL;
-}
-
-void
-tagrefs_add(struct link *head, struct tag *tag)
-{
- struct tag_ref *ref;
-
- if (tagrefs_incl(head, tag))
- return;
-
- ref = malloc(sizeof(struct tag_ref));
- ASSERT(ref != NULL);
- ref->link = LINK_EMPTY;
- ref->tag = tag;
- link_push_back(head, &ref->link);
-}
-
-void
-tagrefs_rm(struct link *head, struct tag *tag)
-{
- struct link *ref;
- struct tag_ref *tagref;
-
- ref = tagrefs_ffind(head, tag);
- if (!ref) return;
-
- tagref = UPCAST(ref, struct tag_ref);
- link_pop(ref);
- free(tagref);
-}