aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/playlist_database.c')
-rw-r--r--src/playlist_database.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/playlist_database.c b/src/playlist_database.c
index 0a8a6f139..6b9d87155 100644
--- a/src/playlist_database.c
+++ b/src/playlist_database.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -21,6 +21,7 @@
#include "playlist_database.h"
#include "playlist_vector.h"
#include "text_file.h"
+#include "string_util.h"
#include <string.h>
#include <stdlib.h>
@@ -32,10 +33,10 @@ playlist_database_quark(void)
}
void
-playlist_vector_save(FILE *fp, const struct playlist_vector *pv)
+playlist_vector_save(FILE *fp, const struct list_head *pv)
{
- for (const struct playlist_metadata *pm = pv->head;
- pm != NULL; pm = pm->next)
+ struct playlist_metadata *pm;
+ playlist_vector_for_each(pm, pv)
fprintf(fp, PLAYLIST_META_BEGIN "%s\n"
"mtime: %li\n"
"playlist_end\n",
@@ -43,7 +44,7 @@ playlist_vector_save(FILE *fp, const struct playlist_vector *pv)
}
bool
-playlist_metadata_load(FILE *fp, struct playlist_vector *pv, const char *name,
+playlist_metadata_load(FILE *fp, struct list_head *pv, const char *name,
GString *buffer, GError **error_r)
{
struct playlist_metadata pm = {
@@ -62,7 +63,7 @@ playlist_metadata_load(FILE *fp, struct playlist_vector *pv, const char *name,
}
*colon++ = 0;
- value = g_strchug(colon);
+ value = strchug_fast_c(colon);
if (strcmp(line, "mtime") == 0)
pm.mtime = strtol(value, NULL, 10);