/* procedure to scan all files */
/* */
/********************************************************/
-static void scantrans(const char *ext,_Bool todo)
+static _Bool scantrans(const char *ext,_Bool todo)
{
#define OPEP "sorter.c:scantrans,"
+_Bool action;
char **fname;
TRATYP **trans;
int phase;
_Bool proceed;
+action=false;
fname=(char **)0;
trans=(TRATYP **)0;
phase=0;
phase=999; //Nothing to do
break;
case 1 : //Building the "trans" list
+ action=true;
if (fname!=(char **)0) { //always
char **ptr;
phase++;
}
#undef OPEP
+return action;
}
/*
\f
{
#define OPEP "sorter.c:sorting,"
-#define TSLEEP 20
+#define TSLEEP 10
+_Bool action;
+int delay;
int phase;
_Bool proceed;
+action=false;
+delay=1;
phase=0;
proceed=true;
while (proceed==true) {
}
break;
case 1 : //got signal
+ action=false;
if ((hangup==true)||((reload==true))) {
(void) rou_alert(0,"%s got hangup or reload signal",OPEP);
phase=999;
}
break;
case 2 : //got signal
- (void) scantrans(EXTRANS,true);
+ action|=scantrans(EXTRANS,true);
break;
case 3 : //got signal
- (void) scantrans(EXTRANS,true);
+ action|=scantrans(EXTRANS,true);
break;
case 4 : //one passe only?
if (foreground==true)
phase=999; //Immediate ending
break;
- case 5 : //lets time pass
- (void) sleep(TSLEEP);
+ case 5 : //lets time pass according "busy"
+ delay=TSLEEP;
+ if (action==true)
+ delay=1;
+ (void) sleep(delay);
phase=0; //Looping
break;
default : //SAFE Guard