From: Andre Date: Fri, 10 Mar 2006 21:41:50 +0000 (+0100) Subject: mmd: rename dbt_change to selector_change X-Git-Tag: v0.2.11~7 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=974c531493fb3c36243f266fb72e2cba561aafd6 mmd: rename dbt_change to selector_change --- diff --git a/command.c b/command.c index e94fb8ef..d317c345 100644 --- a/command.c +++ b/command.c @@ -865,7 +865,7 @@ static int com_chs(int fd, int argc, char **argv) if (strcmp(dblist[i].name, argv[1])) continue; mmd_lock(); - mmd->dbt_change = i; + mmd->selector_change = i; mmd->events++; mmd_unlock(); return 1; diff --git a/server.c b/server.c index 59bc7935..69643208 100644 --- a/server.c +++ b/server.c @@ -281,7 +281,7 @@ static void init_selector(void) { int i, ret; - mmd->dbt_change = -1; /* no change nec., set to new dbt num by com_cdt */ + mmd->selector_change = -1; /* no change nec., set to new num by com_chs */ if (!conf.selector_given) goto random; for (i = 0; dblist[i].name; i++) { @@ -370,13 +370,13 @@ static unsigned do_inits(int argc, char **argv) return sockfd; } -static void handle_dbt_change(void) +static void change_selector(void) { - int ret, old = mmd->selector_num, new = mmd->dbt_change; + int ret, old = mmd->selector_num, new = mmd->selector_change; dblist[old].shutdown(); ret = dblist[new].init(&dblist[new]); - mmd->dbt_change = -1; /* reset */ + mmd->selector_change = -1; /* reset */ if (ret >= 0) { mmd->selector_num = new; return; @@ -396,8 +396,8 @@ static void handle_sighup(void) close_log(logfile); /* gets reopened if necessary by parse_config */ logfile = NULL; parse_config(1); /* reopens log */ - mmd->dbt_change = mmd->selector_num; /* do not change selector */ - handle_dbt_change(); /* reload selector */ + mmd->selector_change = mmd->selector_num; /* do not change selector.. */ + change_selector(); /* .. just reload */ } static void status_refresh(void) @@ -469,8 +469,8 @@ repeat: err = errno; //PARA_DEBUG_LOG("%s: select returned %i\n", __func__, ret); mmd_lock(); - if (mmd->dbt_change >= 0) - handle_dbt_change(); + if (mmd->selector_change >= 0) + change_selector(); if (dblist[mmd->selector_num].post_select) dblist[mmd->selector_num].post_select(&rfds, &wfds); if (ret < 0 && err == EINTR) diff --git a/server.h b/server.h index 0ab0197d..fcda7a3a 100644 --- a/server.h +++ b/server.h @@ -141,10 +141,10 @@ struct misc_meta_data{ pid_t server_pid; /** a string that gets filled in by the current audio file selector */ char selector_info[MMD_INFO_SIZE]; -/** the number if the current database tool */ +/** the number if the current audio file selector */ int selector_num; -/** commands set this to non-zero to request a database tool change */ - int dbt_change; +/** commands set this to non-zero to change the current selector */ + int selector_change; /** used by the sender command */ struct sender_command_data sender_cmd_data; };