2008-10-31 09:19:53 +01:00
|
|
|
#ifndef MPD_DIRVEC_H
|
|
|
|
#define MPD_DIRVEC_H
|
2008-09-29 13:11:40 +02:00
|
|
|
|
2008-10-09 15:24:05 +02:00
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
struct dirvec {
|
|
|
|
struct directory **base;
|
|
|
|
size_t nr;
|
|
|
|
};
|
2008-09-29 13:11:40 +02:00
|
|
|
|
2008-10-08 06:55:10 +02:00
|
|
|
void dirvec_sort(struct dirvec *dv);
|
2008-09-29 13:11:40 +02:00
|
|
|
|
2008-10-09 15:24:34 +02:00
|
|
|
struct directory *dirvec_find(const struct dirvec *dv, const char *path);
|
2008-09-29 13:11:40 +02:00
|
|
|
|
2008-10-08 10:49:05 +02:00
|
|
|
int dirvec_delete(struct dirvec *dv, struct directory *del);
|
2008-09-29 13:11:40 +02:00
|
|
|
|
2008-10-08 10:49:05 +02:00
|
|
|
void dirvec_add(struct dirvec *dv, struct directory *add);
|
2008-09-29 13:11:40 +02:00
|
|
|
|
2008-10-09 15:37:41 +02:00
|
|
|
static inline void
|
|
|
|
dirvec_clear(struct dirvec *dv)
|
|
|
|
{
|
|
|
|
dv->nr = 0;
|
|
|
|
}
|
|
|
|
|
2008-10-08 06:55:10 +02:00
|
|
|
void dirvec_destroy(struct dirvec *dv);
|
2008-09-29 13:11:40 +02:00
|
|
|
|
2008-10-21 01:30:30 +02:00
|
|
|
int dirvec_for_each(const struct dirvec *dv,
|
|
|
|
int (*fn)(struct directory *, void *), void *arg);
|
|
|
|
|
2008-09-29 13:11:40 +02:00
|
|
|
#endif /* DIRVEC_H */
|