echo 'extern struct server_command random_selector_cmds[];' > $@
./command_util.sh proto < $< >> $@
+playlist_selector_command_list.c: playlist_selector.cmd playlist_selector_command_list.h
+ echo '#include "server.h"' > $@
+ echo '#include "user_list.h"' >> $@
+ echo '#include "playlist_selector_command_list.h"' >> $@
+ echo 'struct server_command playlist_selector_cmds[] = {' >>$@
+ ./command_util.sh array < $< >>$@
+ echo '{.name = NULL}};' >> $@
+playlist_selector_command_list.h: playlist_selector.cmd
+ echo 'extern struct server_command playlist_selector_cmds[];' > $@
+ ./command_util.sh proto < $< >> $@
+
ortp_recv.o: ortp_recv.c
$(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
audiod_ldflags=""
audiod_audio_formats=""
-server_cmdline_objs="server.cmdline server_command_list random_selector_command_list"
+server_cmdline_objs="server.cmdline server_command_list random_selector_command_list
+ playlist_selector_command_list"
server_errlist_objs="server mp3_afh vss command net string signal random_selector
time daemon stat crypt http_send db close_on_fork playlist_selector
ipc dccp dccp_send fd user_list"
/*
- * Copyright (C) 2006 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "string.h"
#include "ipc.h"
#include "user_list.h"
+#include "playlist_selector_command_list.h"
/**
* structure used for transmission of the playlist
static char **playlist;
static struct audio_file_selector *self;
-static int com_ppl(int, int, char **);
-static int com_lpl(int, int, char **);
extern struct misc_meta_data *mmd;
-/* array of supported commands */
-static struct server_command cmds[] = {
-{
-.name = "ppl",
-.handler = com_ppl,
-.perms = DB_READ,
-.description = "print playlist",
-.synopsis = "ppl",
-.help =
-"Print out the current playlist"
-}, {
-.name = "lpl",
-.handler = com_lpl,
-.perms = DB_WRITE,
-.description = "load playlist",
-.synopsis = "lpl",
-.help =
-"Read a new playlist from stdin. Example:\n"
-"\tfind /audio -name '*.mp3' | para_client lpl"
-}, {
-.name = NULL,
-}
-};
-
static void playlist_add(char *path)
{
if (playlist_len >= playlist_size) {
return ret;
}
-static int com_lpl(int fd, __a_unused int argc, __a_unused char *argv[])
+int com_lpl(int fd, __a_unused int argc, __a_unused char *argv[])
{
unsigned loaded = 0;
size_t bufsize = 4096; /* guess that's enough */
return ret;
}
-static int com_ppl(int fd, __a_unused int argc, __a_unused char *argv[])
+int com_ppl(int fd, __a_unused int argc, __a_unused char *argv[])
{
unsigned i;
void *shm = NULL;
self = db;
- db->cmd_list = cmds;
+ db->cmd_list = playlist_selector_cmds;
db->get_audio_file_list = pls_get_audio_file_list;
db->shutdown = pls_shutdown;
db->post_select = pls_post_select;