X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/1992b825704eafa4e0c875db0d46352973a30c9c..549c472d7e41f41808f53e1112c336027fcfa92f:/lib/sq.c?ds=sidebyside diff --git a/lib/sq.c b/lib/sq.c index fd2d163d..72fcfbac 100644 --- a/lib/sq.c +++ b/lib/sq.c @@ -1,9 +1,14 @@ /* $Header$ * * Generic Queue Routines + * + * (c) Copyright 1988 by the Massachusetts Institute of Technology. + * For copying and distribution information, please see the file + * . */ -#include "sms_app.h" +#include +#include struct save_queue * sq_create() @@ -89,6 +94,29 @@ sq_get_data(sq, data) return(1); } +sq_remove_data(sq, data) + register struct save_queue *sq; + register char **data; +{ + if (sq->q_next != sq) { + *data = sq->q_next->q_data; + sq->q_next = sq->q_next->q_next; + free(sq->q_next->q_prev); + sq->q_next->q_prev = sq; + return(1); + } + return(0); +} + +int sq_empty(sq) + register struct save_queue *sq; +{ + if (sq->q_next == sq) + return(1); + else + return(0); +} + sq_destroy(sq) register struct save_queue *sq; {