00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MPD_PLAYLIST_VECTOR_H
00021 #define MPD_PLAYLIST_VECTOR_H
00022
00023 #include "util/list.h"
00024
00025 #include <stdbool.h>
00026 #include <stddef.h>
00027 #include <sys/time.h>
00028
00029 #define playlist_vector_for_each(pos, head) \
00030 list_for_each_entry(pos, head, siblings)
00031
00032 #define playlist_vector_for_each_safe(pos, n, head) \
00033 list_for_each_entry_safe(pos, n, head, siblings)
00034
00038 struct playlist_metadata {
00039 struct list_head siblings;
00040
00044 char *name;
00045
00046 time_t mtime;
00047 };
00048
00049 void
00050 playlist_vector_deinit(struct list_head *pv);
00051
00055 struct playlist_metadata *
00056 playlist_vector_find(struct list_head *pv, const char *name);
00057
00061 void
00062 playlist_vector_add(struct list_head *pv,
00063 const char *name, time_t mtime);
00064
00070 bool
00071 playlist_vector_update_or_add(struct list_head *pv,
00072 const char *name, time_t mtime);
00073
00077 bool
00078 playlist_vector_remove(struct list_head *pv, const char *name);
00079
00080 #endif