event.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EVENT_H
00020 #define EVENT_H
00021 #include <SDL/SDL.h>
00022 #include <stdlib.h>
00023 #include <string.h>
00024 #include <libguile.h>
00025 #include "sequence.h"
00026
00027
00028 typedef struct
00029 {
00030 SCM type;
00031 SCM data;
00032 }event;
00033
00034 typedef struct
00035 {
00036 unsigned int index;
00037 char block;
00038 } user;
00039
00040 typedef struct
00041 {
00042 sequence events;
00043 sequence indices;
00044
00045 SDL_mutex* lock;
00046
00047 SDL_cond* block;
00048 } eventstack;
00049
00050 extern eventstack global_usereventstack;
00051
00052 eventstack eventstack_init();
00053 void eventstack_clear(eventstack* stackptr);
00054 void eventstack_addevent(eventstack* stackptr, event event);
00055 event eventstack_getfirstevent(eventstack* stackptr);
00056 event make_event(SCM type, SCM data);
00057 unsigned long int eventstack_open(eventstack* es,char block);
00058 void eventstack_close(eventstack* es,unsigned long int luser);
00059 event evenstack_get_next_event(eventstack es, unsigned long int luser);
00060 int eventstack_get_index_of_user(eventstack es, unsigned long int luser);
00061 event eventstack_get_first_of_user(eventstack* es, unsigned long int luser);
00062 #endif