aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-29 02:48:09 -0700
committerEric Wong <normalperson@yhbt.net>2008-09-29 03:04:29 -0700
commit659a543da853bcb28c22df300a93bd22dc9ae877 (patch)
tree7b3651df4ec404fe7041b5a9b698e7ac17307b7e /src/directory.h
parent887f97b868886a66d7bb2fcd0e1fd6810297299d (diff)
downloadmpd-659a543da853bcb28c22df300a93bd22dc9ae877.tar.gz
mpd-659a543da853bcb28c22df300a93bd22dc9ae877.tar.xz
mpd-659a543da853bcb28c22df300a93bd22dc9ae877.zip
update: move path sanitation up the stack to avoid extra copies
Remove yet another use of our old malloc-happy linked list implementation and replace it with a simple array of strings. This also implements more eager error handling of invalid paths (still centralized in updateInit) so we can filter out bad paths before we spawn a thread. This also does its part to fix the "update" command inside list mode which lost its static variable in ada24f9a921ff95d874195acf253b5a9dd12213d (although it was broken and requires the fix in 769939b62f7557f8e7c483223d68a8b39af43e37, too).
Diffstat (limited to 'src/directory.h')
-rw-r--r--src/directory.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/directory.h b/src/directory.h
index 9161efc38..eb1b35aa7 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -21,7 +21,6 @@
#include "song.h"
#include "songvec.h"
-#include "list.h"
struct dirvec {
struct _Directory **base;
@@ -42,8 +41,13 @@ void reap_update_task(void);
int isUpdatingDB(void);
-/* returns the non-negative update job ID on success, -1 on error */
-int updateInit(List * pathList);
+/*
+ * returns the non-negative update job ID on success,
+ * -1 if busy, -2 if invalid argument
+ * @argv itself is safe to free once updateInit returns, but the
+ * string values contained by @argv MUST NOT be freed manually
+ */
+int updateInit(int argc, char *argv[]);
void directory_init(void);