Hard reset

This commit is contained in:
Ley0k 2016-03-27 11:49:47 +02:00
commit 09bed43f97
1594 changed files with 892326 additions and 0 deletions

View file

@ -0,0 +1,28 @@
#include "c.h"
struct entry {
Apply func;
void *cl;
};
Events events;
void attach(Apply func, void *cl, List *list) {
struct entry *p;
NEW(p, PERM);
p->func = func;
p->cl = cl;
*list = append(p, *list);
}
void apply(List event, void *arg1, void *arg2) {
if (event) {
List lp = event;
do {
struct entry *p = lp->x;
(*p->func)(p->cl, arg1, arg2);
lp = lp->link;
} while (lp != event);
}
}