From 019a4caa2bf9232c7efd84ffe7424994de6358fb Mon Sep 17 00:00:00 2001 From: Andre Date: Fri, 10 Mar 2006 21:01:50 +0100 Subject: [PATCH] rename plm_dbtool.c to playlist_selector.c --- FEATURES | 2 +- INSTALL | 2 +- NEWS | 2 +- README | 14 ++++----- configure.ac | 2 +- db.h | 2 +- error.h | 7 +++-- plm_dbtool.c => playlist_selector.c | 46 ++++++++++++++--------------- server.c | 4 +-- 9 files changed, 41 insertions(+), 40 deletions(-) rename plm_dbtool.c => playlist_selector.c (87%) diff --git a/FEATURES b/FEATURES index fbc84290..bad8110d 100644 --- a/FEATURES +++ b/FEATURES @@ -26,7 +26,7 @@ configurable audio file selectors: There are three audio file selectors available: - random - - plm (playlist manager) + - playlist - mysql The first two of these are rather simple, and they are always diff --git a/INSTALL b/INSTALL index 41a45c45..04bf53fd 100644 --- a/INSTALL +++ b/INSTALL @@ -79,7 +79,7 @@ to retrieve the list of available commands and some server info. Choose an audio file selector ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ paraslash has three different audio file selectors: random (default), -plm (the playlist manager) and mysql. +playlist and mysql. The random selector chooses files randomly from the given directory. diff --git a/NEWS b/NEWS index ddaca554..5e7dfa88 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,7 @@ NEWS o the new ipc subsystem - o new audio file selector: plm, the playlist manager + o new audio file selector: playlist o para_server: the dopey selector is now called "random", and is the default selector. Use the --selector option to diff --git a/README b/README index 95410014..374fcf6e 100644 --- a/README +++ b/README @@ -24,15 +24,15 @@ It contains the following programs: All senders have the same set of commands that allow to control the access permissions of the stream. - para_server needs an "audio file selector" to work, mainly to - determine which song to stream next. There are three selectors - available: random, plm and mysql. The former chooses audio - files randomly and plm, the playlist manager, can handle + para_server needs an "audio file selector" to work, mainly + to determine which song to stream next. There are three + selectors available: random, playlist and mysql. The former + chooses audio files randomly and playlist can handle, well, playlists. Both are always supported. - The (optional) mysql selector connects to a mysql server - which holds information on your audio files. It has several - unusual features, see README.mysql for details. + The optional mysql selector connects to a mysql server which + holds information on your audio files. It has several unusual + features, see README.mysql for details. - para_client (obligatory): diff --git a/configure.ac b/configure.ac index fac1ab57..587e22f8 100644 --- a/configure.ac +++ b/configure.ac @@ -73,7 +73,7 @@ audiod_ldflags="" server_cmdline_objs="server.cmdline" server_errlist_objs="server mp3 afs command net string signal random_dbtool time daemon stat - crypt http_send db close_on_fork plm_dbtool ipc" + crypt http_send db close_on_fork playlist_selector ipc" server_ldflags="" ########################################################################### ssl diff --git a/db.h b/db.h index 80c0de89..578e4fd9 100644 --- a/db.h +++ b/db.h @@ -119,6 +119,6 @@ void *private_data; }; int mysql_selector_init(struct audio_file_selector*); -int plm_selector_init(struct audio_file_selector*); +int playlist_selector_init(struct audio_file_selector*); int random_selector_init(struct audio_file_selector*); diff --git a/error.h b/error.h index 98ca4ec6..a753bc45 100644 --- a/error.h +++ b/error.h @@ -23,7 +23,8 @@ enum para_subsystem {SS_RECV, SS_NET, SS_ORTP_RECV, SS_AUDIOD, SS_EXEC, SS_CLOSE_ON_FORK, SS_SIGNAL, SS_STRING, SS_DAEMON, SS_STAT, SS_TIME, SS_GRAB_CLIENT, SS_HTTP_RECV, SS_RECV_COMMON, SS_FILTER_CHAIN, SS_WAV, SS_COMPRESS, SS_OGGDEC, SS_FILTER, - SS_COMMAND, SS_RANDOM_DBTOOL, SS_PLM_DBTOOL, SS_CRYPT, SS_HTTP_SEND, SS_ORTP_SEND, SS_DB, SS_OGG, + SS_COMMAND, SS_RANDOM_DBTOOL, SS_PLAYLIST_SELECTOR, SS_CRYPT, + SS_HTTP_SEND, SS_ORTP_SEND, SS_DB, SS_OGG, SS_MP3, SS_MP3DEC, SS_SERVER, SS_AFS, SS_MYSQL, SS_IPC, SS_RINGBUFFER}; #define NUM_SS (SS_RINGBUFFER + 1) extern const char **para_errlist[]; @@ -224,7 +225,7 @@ extern const char **para_errlist[]; PARA_ERROR(LOCK, "lock error"), \ PARA_ERROR(SENDER_CMD, "command not supported by this sender"), \ -#define PLM_DBTOOL_ERRORS \ +#define PLAYLIST_SELECTOR_ERRORS \ PARA_ERROR(LOAD_PLAYLIST, "failed to load playlist"), \ @@ -343,7 +344,7 @@ SS_ENUM(SERVER); SS_ENUM(AFS); SS_ENUM(COMMAND); SS_ENUM(RANDOM_DBTOOL); -SS_ENUM(PLM_DBTOOL); +SS_ENUM(PLAYLIST_SELECTOR); SS_ENUM(CRYPT); SS_ENUM(HTTP_SEND); SS_ENUM(ORTP_SEND); diff --git a/plm_dbtool.c b/playlist_selector.c similarity index 87% rename from plm_dbtool.c rename to playlist_selector.c index d17ac3af..47fb2699 100644 --- a/plm_dbtool.c +++ b/playlist_selector.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ -/** \file plm_dbtool.c Playlist manager for paraslash */ +/** \file playlist_selector.c The playlist audio file selector of paraslash */ #include "server.h" #include "db.h" @@ -31,7 +31,7 @@ * There's one such struct which gets initialized during startup. It lives in * shared memory and is used by com_lpl(). */ -struct plm_client_data { +struct pls_client_data { /** allocated and set by com_lpl() (child) */ int shm_id; /** the size of the shared memory area identified by \a shm_id */ @@ -42,14 +42,14 @@ struct plm_client_data { int retval; }; -/** data specific to the plm database tool */ -struct private_plm_data { +/** data specific to the playlist selector */ +struct private_pls_data { /** guards against concurrent client access */ int client_mutex; /** guards against concurrent parent-child access */ int server_mutex; /** pointer to the client data */ - struct plm_client_data *client_data; + struct pls_client_data *client_data; /** id of the shm corresponding to \a client_data */ int client_data_shm_id; }; @@ -101,7 +101,7 @@ static void playlist_add(char *path) static int send_playlist_to_server(const char *buf, size_t size) { - struct private_plm_data *ppd = self->private_data; + struct private_pls_data *ppd = self->private_data; int ret, shm_mutex = -1, shm_id = -1; void *shm = NULL; @@ -187,7 +187,7 @@ static int com_ppl(int fd, __unused int argc, __unused char *argv[]) return 1; } -static char **plm_get_audio_file_list(unsigned int num) +static char **pls_get_audio_file_list(unsigned int num) { char **file_list; unsigned i; @@ -215,9 +215,9 @@ static void free_playlist_contents(void) playlist_len = 0; } -static void plm_shutdown(void) +static void pls_shutdown(void) { - struct private_plm_data *ppd = self->private_data; + struct private_pls_data *ppd = self->private_data; shm_detach(ppd->client_data); shm_destroy(ppd->client_data_shm_id); @@ -231,10 +231,10 @@ static void plm_shutdown(void) playlist_size = 0; } -static void plm_post_select(__unused fd_set *rfds, __unused fd_set *wfds) +static void pls_post_select(__unused fd_set *rfds, __unused fd_set *wfds) { - struct private_plm_data *ppd = self->private_data; - struct plm_client_data *pcd = ppd->client_data; + struct private_pls_data *ppd = self->private_data; + struct pls_client_data *pcd = ppd->client_data; int ret; void *shm; @@ -258,7 +258,7 @@ out: mutex_unlock(ppd->server_mutex); } -void plm_update_audio_file(char *audio_file) +void pls_update_audio_file(char *audio_file) { unsigned i; @@ -271,25 +271,25 @@ void plm_update_audio_file(char *audio_file) } /** - * the init function for the plm database tool + * the init function for the playlist selector * * Init all function pointers of \a db * * \sa struct audio_file_selector, misc_meta_data::dbinfo, mysql.c random_dbtool.c */ -int plm_selector_init(struct audio_file_selector *db) +int playlist_selector_init(struct audio_file_selector *db) { int ret; - struct private_plm_data *ppd = NULL; + struct private_pls_data *ppd = NULL; void *shm = NULL; self = db; db->cmd_list = cmds; - db->get_audio_file_list = plm_get_audio_file_list; - db->shutdown = plm_shutdown; - db->post_select = plm_post_select; - db->update_audio_file = plm_update_audio_file; - ppd = para_calloc(sizeof(struct private_plm_data)); + db->get_audio_file_list = pls_get_audio_file_list; + db->shutdown = pls_shutdown; + db->post_select = pls_post_select; + db->update_audio_file = pls_update_audio_file; + ppd = para_calloc(sizeof(struct private_pls_data)); db->private_data = ppd; ppd->client_mutex = -1; @@ -307,7 +307,7 @@ int plm_selector_init(struct audio_file_selector *db) goto err_out; ppd->server_mutex = ret; - ret = shm_new(sizeof(struct plm_client_data)); + ret = shm_new(sizeof(struct pls_client_data)); if (ret < 0) goto err_out; ppd->client_data_shm_id = ret; @@ -317,7 +317,7 @@ int plm_selector_init(struct audio_file_selector *db) goto err_out; ppd->client_data = shm; ppd->client_data->size = 0; - sprintf(mmd->dbinfo, "plm initialized"); + sprintf(mmd->dbinfo, "playlist selector initialized"); return 1; err_out: if (ppd->client_data_shm_id >= 0) diff --git a/server.c b/server.c index 3f5570dd..d881868c 100644 --- a/server.c +++ b/server.c @@ -69,8 +69,8 @@ struct audio_file_selector dblist[] = { .update_audio_file = NULL, }, { - .name = "plm", - .init = plm_selector_init, + .name = "playlist", + .init = playlist_selector_init, .update_audio_file = NULL, .pre_select = NULL, .post_select = NULL, -- 2.39.5