Make struct signal_task generic and make afs use it.
[paraslash.git] / playlist_selector.c
index a497ec1..0da63ad 100644 (file)
@@ -6,12 +6,15 @@
 
 /** \file playlist_selector.c The playlist audio file selector of paraslash  */
 
+#include "para.h"
+#include "afh.h"
 #include "server.h"
 #include "afs_common.h"
 #include "error.h"
 #include "net.h"
 #include "string.h"
 #include "ipc.h"
+#include "list.h"
 #include "user_list.h"
 #include "playlist_selector_command_list.h"
 
@@ -53,7 +56,7 @@ static struct audio_file_selector *self;
 
 extern struct misc_meta_data *mmd;
 
-static void playlist_add(char *path)
+static int playlist_add(char *path, __a_unused void *data)
 {
        if (playlist_len >= playlist_size) {
                playlist_size = 2 * playlist_size + 1;
@@ -61,6 +64,7 @@ static void playlist_add(char *path)
        }
        PARA_DEBUG_LOG("adding #%d/%d: %s\n", playlist_len, playlist_size, path);
        playlist[playlist_len++] = para_strdup(path);
+       return 1;
 }
 
 static int send_playlist_to_server(const char *buf, size_t size)
@@ -212,7 +216,7 @@ static void pls_post_select(__a_unused fd_set *rfds, __a_unused fd_set *wfds)
                goto out;
        }
        PARA_DEBUG_LOG("loading new playlist (%zd bytes)\n", pcd->size);
-       ret = for_each_line((char *)shm, pcd->size, &playlist_add);
+       ret = for_each_line((char *)shm, pcd->size, &playlist_add, NULL);
        shm_detach(shm);
        PARA_NOTICE_LOG("new playlist (%d entries)\n", playlist_len);
        sprintf(mmd->selector_info, "dbinfo1:new playlist: %d files\n"