dol: initial dol commit
[jump.git] / dol / src / dol / visitor / cell / lib / dol.h
diff --git a/dol/src/dol/visitor/cell/lib/dol.h b/dol/src/dol/visitor/cell/lib/dol.h
new file mode 100644 (file)
index 0000000..297f8c5
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __DOL_H__
+#define __DOL_H__
+
+// structure for local memory of process
+typedef struct _local_states *LocalState;
+
+// structure for process
+struct _process;
+
+// standard functions
+typedef void (*ProcessInit)(struct _process*);
+typedef int (*ProcessFire)(struct _process*);
+typedef void *WPTR;
+
+typedef struct _process {
+    LocalState     local;
+    ProcessInit    init;
+    ProcessFire    fire;
+    WPTR           wptr;
+} DOLProcess;
+
+void DOL_read(void *port, void *buf, int len, DOLProcess *process);
+void DOL_write(void *port, void *buf, int len, DOLProcess *process);
+
+unsigned DOL_reserve(void* port, void** destination, unsigned len, DOLProcess* process); 
+void DOL_release(void* port, DOLProcess* process); 
+unsigned DOL_capture(void* port, void** destination, unsigned len, DOLProcess* process);  
+void DOL_consume(void* port, DOLProcess* process); 
+void DOL_detach(DOLProcess *process);
+int getIndex(const char* string, char* tokens, int indexNumber); 
+int *createPort(int *port, int base, int number_of_indices, int index_range_pairs, ...); 
+
+#endif