blob: 11b51543f8de42a31e5c55cb185a6e6384bbe007 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* ISC license. */
#include <skalibs/genqdyn.h>
#include "event.h"
/* Event queue */
static genqdyn evq = GENQDYN_INIT(event_t, 0, 1) ; /* only clean when it's empty */
int event_enqueue (event_t const *ev)
{
return genqdyn_push(&evq, ev) ;
}
int event_pop (event_t *ev)
{
if (!genqdyn_n(&evq)) return 0 ;
*ev = *GENQDYN_PEEK(s6rc_event_t, &evq) ;
return genqdyn_pop(&evq) ;
}
/* Event processing (builtins) */
void event_handle (event_t const *ev)
{
}
|