OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [lcc/] [src/] [event.c] - Blame information for rev 79

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 hellwig
#include "c.h"
2
 
3
static char rcsid[] = "$Id: event.c,v 1.1 2002/08/28 23:12:43 drh Exp $";
4
 
5
struct entry {
6
        Apply func;
7
        void *cl;
8
};
9
 
10
Events events;
11
void attach(Apply func, void *cl, List *list) {
12
        struct entry *p;
13
 
14
        NEW(p, PERM);
15
        p->func = func;
16
        p->cl = cl;
17
        *list = append(p, *list);
18
}
19
void apply(List event, void *arg1, void *arg2) {
20
        if (event) {
21
                List lp = event;
22
                do {
23
                        struct entry *p = lp->x;
24
                        (*p->func)(p->cl, arg1, arg2);
25
                        lp = lp->link;
26
                } while (lp != event);
27
        }
28
}
29
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.