X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fprotothread%2Flib%2Fdol.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fprotothread%2Flib%2Fdol.h;h=8fbefe4315a7f75216ab683cdc1b1c6327488383;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/protothread/lib/dol.h b/dol/src/dol/visitor/protothread/lib/dol.h new file mode 100644 index 0000000..8fbefe4 --- /dev/null +++ b/dol/src/dol/visitor/protothread/lib/dol.h @@ -0,0 +1,39 @@ +#ifndef DOL_H +#define DOL_H + +/************************************************************************ + * do not add code to this header + ************************************************************************/ + +/** + * Define the DOL process handler scheme. + * - Local variables are defined in structure LocalState. Local + * variables may vary from different processes. + * - The ProcessInit function pointer points to a function which + * initializes a process. + * - The ProcessFire function pointer points to a function which + * performs the actual computation. The communication between + * processes is inside the ProcessFire function. + * - The WPTR is a placeholder for callback. One can just + * leave it blank. + */ + +//structure for local memory of process +typedef struct _local_states *LocalState; + +//additional behavioral functions could be declared here +typedef void (*ProcessInit)(struct _process*); +typedef int (*ProcessFire)(struct _process*); +typedef void *WPTR; + +//process handler +struct _process; + +typedef struct _process { + LocalState local; + ProcessInit init; + ProcessFire fire; + WPTR wptr; //placeholder for wrapper instance +} DOLProcess; + +#endif