From: Andre Date: Fri, 10 Mar 2006 21:28:01 +0000 (+0100) Subject: mmd: rename dbinfo to selector_info X-Git-Tag: v0.2.11~9 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=9f10e6742ffc2ac5e4bf6224e1ff882074c7ca45;p=paraslash.git mmd: rename dbinfo to selector_info --- diff --git a/afs.c b/afs.c index 6c3df15e..a51db969 100644 --- a/afs.c +++ b/afs.c @@ -353,7 +353,7 @@ static void afs_eof(struct audio_format *af) 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; diff --git a/command.c b/command.c index 9d473019..ee165e88 100644 --- a/command.c +++ b/command.c @@ -430,7 +430,7 @@ static char *get_status(struct misc_meta_data *nmmd) 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, @@ -676,7 +676,6 @@ static int com_sb(int socket_fd, int argc, char **argv) /* 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 */ diff --git a/mysql_selector.c b/mysql_selector.c index 88e31f3c..9f5a14f3 100644 --- a/mysql_selector.c +++ b/mysql_selector.c @@ -1807,8 +1807,8 @@ out: 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) @@ -2427,7 +2427,7 @@ static int init_mysql_server(void) /* 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)); @@ -2512,9 +2512,10 @@ static void shutdown_connection(void) * 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) { diff --git a/playlist_selector.c b/playlist_selector.c index f3f556cd..346f1ce1 100644 --- a/playlist_selector.c +++ b/playlist_selector.c @@ -275,7 +275,7 @@ void pls_update_audio_file(char *audio_file) * * 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) @@ -318,7 +318,7 @@ 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) diff --git a/random_selector.c b/random_selector.c index 37e9116b..0dca1727 100644 --- a/random_selector.c +++ b/random_selector.c @@ -130,17 +130,17 @@ static void random_shutdown(void) /** * 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; diff --git a/server.h b/server.h index 1e4a75f8..da777f77 100644 --- a/server.h +++ b/server.h @@ -21,7 +21,7 @@ #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 /** @@ -140,7 +140,7 @@ struct misc_meta_data{ /** 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 */