dol: initial dol commit
[jump.git] / dol / src / dol / visitor / protothread / lib / dol.h
1 #ifndef DOL_H
2 #define DOL_H
3
4 /************************************************************************
5  * do not add code to this header
6  ************************************************************************/
7
8 /**
9  *  Define the DOL process handler scheme.
10  *  - Local variables are defined in structure LocalState. Local
11  *    variables may vary from different processes.
12  *  - The ProcessInit function pointer points to a function which
13  *    initializes a process.
14  *  - The ProcessFire function pointer points to a function which
15  *    performs the actual computation. The communication between
16  *    processes is inside the ProcessFire function.
17  *  - The WPTR is a placeholder for callback. One can just
18  *    leave it blank.
19  */
20
21 //structure for local memory of process
22 typedef struct _local_states *LocalState;
23
24 //additional behavioral functions could be declared here
25 typedef void (*ProcessInit)(struct _process*);
26 typedef int (*ProcessFire)(struct _process*);
27 typedef void *WPTR;
28
29 //process handler
30 struct _process;
31
32 typedef struct _process {
33     LocalState     local;
34     ProcessInit    init;
35     ProcessFire    fire;
36     WPTR           wptr; //placeholder for wrapper instance
37 } DOLProcess;
38
39 #endif