]> git.tue.mpg.de Git - paraslash.git/commitdiff
mmd: rename dbt_change to selector_change
authorAndre <maan@p133.(none)>
Fri, 10 Mar 2006 21:41:50 +0000 (22:41 +0100)
committerAndre <maan@p133.(none)>
Fri, 10 Mar 2006 21:41:50 +0000 (22:41 +0100)
command.c
server.c
server.h

index e94fb8efa88748566e7904f81dd0a9c001a1cdf1..d317c345314908b4629d7452e2f5fec4cb172f67 100644 (file)
--- 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;
index 59bc7935645a59907a17f1172500a7f19e38818e..69643208beea484ea067cac2f09b8ad1fe6c24f5 100644 (file)
--- 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)
index 0ab0197df1bd66ed9db6b7c56b6eca5e64c46cee..fcda7a3ace835d65c0e960640291396e62f628ea 100644 (file)
--- 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;
 };