]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afs.c
Rename mood_switch(), mood_close(), playlist_{open/close}.
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index 06b4132acde340d16500a321e756dac57221fc6c..cea8f2707491f00bab0f457a3463fd4762147a21 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -100,7 +100,7 @@ extern uint32_t afs_socket_cookie;
  */
 struct callback_query {
        /** The function to be called. */
-       afs_callback *handler;
+       afs_callback *cb;
        /** The number of bytes of the query */
        size_t query_size;
 };
@@ -191,7 +191,7 @@ int send_callback_request(afs_callback *f, struct osl_object *query,
        if (ret < 0)
                goto out;
        cq = query_shm;
-       cq->handler = f;
+       cq->cb = f;
        cq->query_size = query_shm_size - sizeof(*cq);
 
        if (query)
@@ -438,13 +438,13 @@ static int activate_mood_or_playlist(const char *arg, struct para_buffer *pb)
        char *msg;
 
        if (!arg) {
-               ret = mood_switch(NULL, &msg);
+               ret = mood_load(NULL, &msg);
                mode = PLAY_MODE_MOOD;
        } else if (!strncmp(arg, "p/", 2)) {
-               ret = playlist_open(arg + 2, &msg);
+               ret = playlist_load(arg + 2, &msg);
                mode = PLAY_MODE_PLAYLIST;
        } else if (!strncmp(arg, "m/", 2)) {
-               ret = mood_switch(arg + 2, &msg);
+               ret = mood_load(arg + 2, &msg);
                mode = PLAY_MODE_MOOD;
        } else {
                ret = -ERRNO_TO_PARA_ERROR(EINVAL);
@@ -534,15 +534,11 @@ static int com_select_callback(struct afs_callback_arg *aca)
        ret = lls_deserialize_parse_result(aca->query.data, cmd, &aca->lpr);
        assert(ret >= 0);
        arg = lls_input(0, aca->lpr);
-       ret = clear_score_table();
-       if (ret < 0) {
-               para_printf(&aca->pbout, "could not clear score table\n");
-               goto free_lpr;
-       }
+       score_clear();
        if (current_play_mode == PLAY_MODE_MOOD)
-               close_current_mood();
+               mood_unload();
        else
-               playlist_close();
+               playlist_unload();
        ret = activate_mood_or_playlist(arg, &aca->pbout);
        if (ret >= 0)
                goto free_lpr;
@@ -798,7 +794,7 @@ static int call_callback(int fd, int query_shmid)
                .fd = fd,
                .band = SBD_OUTPUT
        };
-       ret = cq->handler(&aca);
+       ret = cq->cb(&aca);
        ret2 = shm_detach(query_shm);
        if (ret2 < 0) {
                if (ret < 0) /* ignore (but log) detach error */
@@ -976,7 +972,7 @@ __noreturn void afs_init(int socket_fd)
        }
        ret = schedule(&s);
        sched_shutdown(&s);
-       close_current_mood();
+       mood_unload();
 out_close:
        close_afs_tables();
 out: