8 #include "rockmacros.h"
13 static event_t eventqueue
[MAX_EVENTS
];
14 static int eventhead
, eventpos
;
17 int ev_postevent(event_t
*ev
)
20 nextevent
= (eventhead
+1)%MAX_EVENTS
;
21 if (nextevent
== eventpos
)
23 eventqueue
[eventhead
] = *ev
;
24 eventhead
= nextevent
;
28 int ev_getevent(event_t
*ev
)
30 if (eventpos
== eventhead
)
35 *ev
= eventqueue
[eventpos
];
36 eventpos
= (eventpos
+1)%MAX_EVENTS
;