| iMatix home page | << | < | > | >> |
SMT Version 2.81 |
#include "smtlib.h" int queue_flush ( QUEUE *queue /* Queue to flush */ )
Expires any out-of-date events in the queue: calls event expire() for each event who's timeout has passed. Returns the number of events expired. In case of error, returns -1 and sets smt_errno to one of these values:
SMT NOTREADY | smt_init() was not called, or failed |
SMT NOSUCHQUEUE | The event queue is not defined |
{ time_t time_now; /* Current time */ int feedback = 0; /* Number of events we delivered */ EVENT *event; /* Event information block */ #if (defined (SMT_TRACE)) trace ("queue_flush"); #endif ASSERT (queue); if (!smt_alive) /* If SMT API was not correctly */ { /* initialised, forget it */ smt_errno = SMT_NOTREADY; return (-1); } time_now = time (NULL); FORLIST (event, queue-> events) if (event-> timeout && event-> timeout < time_now) { event expire (queue, event); feedback++; } return (feedback); }
| << | < | > | >> | Copyright © 1996-99 iMatix Corporation |