Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

event.c

Go to the documentation of this file.
00001 #include "c.h"
00002 
00003 
00004 struct entry {
00005     Apply func;
00006     void *cl;
00007 };
00008 
00009 Events events;
00010 void attach(Apply func, void *cl, List *list) {
00011     struct entry *p;
00012 
00013     NEW(p, PERM);
00014     p->func = func;
00015     p->cl = cl;
00016     *list = append(p, *list);
00017 }
00018 void apply(List event, void *arg1, void *arg2) {
00019     if (event) {
00020         List lp = event;
00021         do {
00022             struct entry *p = lp->x;
00023             (*p->func)(p->cl, arg1, arg2);
00024             lp = lp->link;
00025         } while (lp != event);
00026     }
00027 }
00028 

Generated on Thu Aug 25 12:38:13 2005 for Quake III Arena by  doxygen 1.3.9.1