/* CQUEUE.C */ /* The command queue is the generic interface used for any */ /* component which wants to generate client commands. */ /* Commands to be performed are passed to push_command_queue, */ /* which are retrieved in order through pull_command_queue. */ /* The got_command_queue() function returns the number of */ /* command strings currently waiting in the queue. */ #include #include #include #define FORLOOP(I,K) for(I=0;I strlen(queue[0]) ) { strcpy ( retbuf, queue[0] ); } else { scrub_free ( retbuf, retbufmag ); retbuf = queue[0]; retbufmag = strlen(retbuf+1); } FORLOOP(i,qmag-1) queue[i] = queue[i+1]; qmag--; return retbuf; } int got_command_queue() { return qmag; }