aboutsummaryrefslogtreecommitdiffstats
path: root/src/dirvec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dirvec.c')
-rw-r--r--src/dirvec.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/dirvec.c b/src/dirvec.c
index f84aa37fc..9226fca74 100644
--- a/src/dirvec.c
+++ b/src/dirvec.c
@@ -1,26 +1,27 @@
#include "dirvec.h"
+#include "directory.h"
#include "os_compat.h"
#include "utils.h"
static size_t dv_size(struct dirvec *dv)
{
- return dv->nr * sizeof(Directory *);
+ return dv->nr * sizeof(struct directory *);
}
/* Only used for sorting/searching a dirvec, not general purpose compares */
static int dirvec_cmp(const void *d1, const void *d2)
{
- const Directory *a = ((const Directory * const *)d1)[0];
- const Directory *b = ((const Directory * const *)d2)[0];
+ const struct directory *a = ((const struct directory * const *)d1)[0];
+ const struct directory *b = ((const struct directory * const *)d2)[0];
return strcmp(a->path, b->path);
}
void dirvec_sort(struct dirvec *dv)
{
- qsort(dv->base, dv->nr, sizeof(Directory *), dirvec_cmp);
+ qsort(dv->base, dv->nr, sizeof(struct directory *), dirvec_cmp);
}
-Directory *dirvec_find(struct dirvec *dv, const char *path)
+struct directory *dirvec_find(struct dirvec *dv, const char *path)
{
int i;
@@ -30,7 +31,7 @@ Directory *dirvec_find(struct dirvec *dv, const char *path)
return NULL;
}
-int dirvec_delete(struct dirvec *dv, Directory *del)
+int dirvec_delete(struct dirvec *dv, struct directory *del)
{
int i;
@@ -43,7 +44,7 @@ int dirvec_delete(struct dirvec *dv, Directory *del)
dv->base = NULL;
} else {
memmove(&dv->base[i], &dv->base[i + 1],
- (dv->nr - i + 1) * sizeof(Directory *));
+ (dv->nr - i + 1) * sizeof(struct directory *));
dv->base = xrealloc(dv->base, dv_size(dv));
}
return i;
@@ -52,7 +53,7 @@ int dirvec_delete(struct dirvec *dv, Directory *del)
return -1; /* not found */
}
-void dirvec_add(struct dirvec *dv, Directory *add)
+void dirvec_add(struct dirvec *dv, struct directory *add)
{
++dv->nr;
dv->base = xrealloc(dv->base, dv_size(dv));