free(tmp);
tmp = make_message("%s:\n%s:\n%s:\n", status_item_list[SI_DBINFO1],
status_item_list[SI_DBINFO2], status_item_list[SI_DBINFO3]);
- strcpy(mmd->dbinfo, tmp);
+ strcpy(mmd->selector_info, tmp);
free(tmp);
mmd->filename[0] = '\0';
mmd->size = 0;
status_item_list[SI_OFFSET], offset,
status_item_list[SI_FORMAT], audio_format_name(nmmd->audio_format),
- nmmd->dbinfo,
+ nmmd->selector_info,
nmmd->audio_file_info,
status_item_list[SI_UPTIME], ut,
/* stat */
static int com_stat(int socket_fd, int argc, char **argv)
{
-// char *old_stat = NULL, *old_dbinfo = NULL;
int ret, num = 0;/* status will be printed that many
* times. num <= 0 means: print forever
*/
static void update_mmd(char *info)
{
PARA_DEBUG_LOG("%s", "updating shared memory area\n");
- strncpy(mmd->dbinfo, info, MMD_INFO_SIZE - 1);
- mmd->dbinfo[MMD_INFO_SIZE - 1] = '\0';
+ strncpy(mmd->selector_info, info, MMD_INFO_SIZE - 1);
+ mmd->selector_info[MMD_INFO_SIZE - 1] = '\0';
}
static void update_audio_file_server_handler(char *name)
/* mmd lock must be held */
static void write_msg2mmd(int success)
{
- sprintf(mmd->dbinfo, "dbinfo1:%s\ndbinfo2:mysql-%s\ndbinfo3:\n",
+ sprintf(mmd->selector_info, "dbinfo1:%s\ndbinfo2:mysql-%s\ndbinfo3:\n",
success < 0? PARA_STRERROR(-success) :
"successfully connected to mysql server",
success < 0? "" : mysql_get_server_info(mysql_ptr));
* the init function of the mysql-based audio file selector
*
* Check the command line options and initialize all function pointers of \a db.
- * Connect to the mysql server and initialize the dbinfo string.
+ * Connect to the mysql server and initialize the info string.
*
- * \sa struct audio_file_selector, misc_meta_data::dbinfo, random_selector.c
+ * \sa struct audio_file_selector, misc_meta_data::selector_info,
+ * random_selector.c
*/
int mysql_selector_init(struct audio_file_selector *db)
{
*
* Init all function pointers of \a db
*
- * \sa struct audio_file_selector, misc_meta_data::dbinfo, mysql.c
+ * \sa struct audio_file_selector, misc_meta_data::selector_info, mysql.c
* random_selector.c.
*/
int playlist_selector_init(struct audio_file_selector *db)
goto err_out;
ppd->client_data = shm;
ppd->client_data->size = 0;
- sprintf(mmd->dbinfo, "playlist selector initialized");
+ sprintf(mmd->selector_info, "playlist selector initialized");
return 1;
err_out:
if (ppd->client_data_shm_id >= 0)
/**
* the init function for the random audio file selector
*
- * Init all function pointers of \a db, init the dbinfo text and seed the
+ * Init all function pointers of \a db, init the info text and seed the
* PRNG.
*
- * \sa struct audio_file_selector, misc_meta_data::dbinfo, mysql.c
+ * \sa struct audio_file_selector, misc_meta_data::selector_info, mysql.c
*/
int random_selector_init(struct audio_file_selector *db)
{
struct timeval now;
PARA_INFO_LOG("%s", "registering random handlers ;)\n");
- sprintf(mmd->dbinfo, DBINFO);
+ sprintf(mmd->selector_info, DBINFO);
gettimeofday(&now, NULL);
srand(now.tv_usec);
db->cmd_list = cmds;
#include "para.h"
-/** size of the dbinfo and audio_file info strings of struct misc_meta_data */
+/** size of the selector_info and audio_file info strings of struct misc_meta_data */
#define MMD_INFO_SIZE 16384
/**
/** the process id of para_server */
pid_t server_pid;
/** a string that gets filled in by the current audio file selector */
- char dbinfo[MMD_INFO_SIZE];
+ char selector_info[MMD_INFO_SIZE];
/** the number if the current database tool */
int dbt_num;
/** commands set this to non-zero to request a database tool change */