2 //metadoc Coroutine copyright Steve Dekorte 2002
3 //metadoc Coroutine license BSD revised
5 #ifndef IoCoroutine_DEFINED
6 #define IoCoroutine_DEFINED 1
18 #define ISCOROUTINE(self) IoObject_hasCloneFunc_(self, (IoTagCloneFunc *)IoCoroutine_rawClone)
20 typedef IoObject IoCoroutine
;
29 IOVM_API IoCoroutine
*IoCoroutine_proto(void *state
);
30 IOVM_API
void IoCoroutine_protoFinish(IoCoroutine
*self
);
31 IOVM_API IoCoroutine
*IoCoroutine_rawClone(IoCoroutine
*self
);
32 IOVM_API IoCoroutine
*IoCoroutine_new(void *state
);
34 IOVM_API
void IoCoroutine_free(IoCoroutine
*self
);
35 IOVM_API
void IoCoroutine_mark(IoCoroutine
*self
);
36 Stack
*IoCoroutine_rawIoStack(IoCoroutine
*self
);
37 IOVM_API
void IoCoroutine_rawShow(IoCoroutine
*self
);
39 IOVM_API IoObject
*IoCoroutine_main(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
40 IOVM_API IoObject
*IoCoroutine_freeStack(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
42 IOVM_API
void *IoCoroutine_cid(IoCoroutine
*self
);
46 //void IoCoroutine_rawSetLabel_(IoCoroutine *self, IoSymbol *s);
47 //IoObject *IoCoroutine_rawLabel(IoCoroutine *self);
49 IOVM_API IoObject
*IoCoroutine_setLabel(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
50 IOVM_API IoObject
*IoCoroutine_label(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
54 IOVM_API
void IoCoroutine_rawSetRunTarget_(IoCoroutine
*self
, IoObject
*v
);
55 IOVM_API IoObject
*IoCoroutine_rawRunTarget(IoCoroutine
*self
);
59 IOVM_API
void IoCoroutine_rawSetRunMessage_(IoCoroutine
*self
, IoObject
*v
);
60 IOVM_API IoObject
*IoCoroutine_rawRunMessage(IoCoroutine
*self
);
64 IOVM_API
void IoCoroutine_rawSetRunLocals_(IoCoroutine
*self
, IoObject
*v
);
65 IOVM_API IoObject
*IoCoroutine_rawRunLocals(IoCoroutine
*self
);
69 IOVM_API
void IoCoroutine_rawSetParentCoroutine_(IoCoroutine
*self
, IoObject
*v
);
70 IOVM_API IoObject
*IoCoroutine_rawParentCoroutine(IoCoroutine
*self
);
73 IOVM_API
void IoCoroutine_rawSetResult_(IoCoroutine
*self
, IoObject
*v
);
74 IOVM_API IoObject
*IoCoroutine_rawResult(IoCoroutine
*self
);
78 IOVM_API
void IoCoroutine_rawRemoveException(IoCoroutine
*self
);
79 IOVM_API
void IoCoroutine_rawSetException_(IoCoroutine
*self
, IoObject
*v
);
80 IOVM_API IoObject
*IoCoroutine_rawException(IoCoroutine
*self
);
84 IOVM_API IoObject
*IoCoroutine_ioStack(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
85 IOVM_API
int IoCoroutine_rawIoStackSize(IoCoroutine
*self
);
89 IOVM_API
void IoCoroutine_rawRun(IoCoroutine
*self
);
91 IOVM_API
void IoCoroutine_clearStack(IoCoroutine
*self
);
93 IOVM_API
void IoCoroutine_try(IoCoroutine
*self
, IoObject
*target
, IoObject
*locals
, IoMessage
*message
);
95 IOVM_API IoCoroutine
*IoCoroutine_newWithTry(void *state
,
100 IOVM_API
void IoCoroutine_raiseError(IoCoroutine
*self
, IoSymbol
*description
, IoMessage
*m
);
104 IOVM_API IoObject
*IoCoroutine_implementation(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
106 IOVM_API IoObject
*IoCoroutine_run(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
107 IOVM_API IoObject
*IoCoroutine_callStack(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
109 IOVM_API IoObject
*IoCoroutine_isCurrent(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
113 IOVM_API
void IoCoroutine_rawSetRunTarget_(IoCoroutine
*self
, IoObject
*v
);
114 IOVM_API IoObject
*IoCoroutine_rawRunTarget(IoCoroutine
*self
);
118 IOVM_API
void IoCoroutine_rawSetRunMessage_(IoCoroutine
*self
, IoObject
*v
);
119 IOVM_API IoObject
*IoCoroutine_rawRunMessage(IoCoroutine
*self
);
123 IOVM_API
void IoCoroutine_rawSetParentCoroutine_(IoCoroutine
*self
, IoObject
*v
);
124 IOVM_API IoObject
*IoCoroutine_rawParentCoroutine(IoCoroutine
*self
);
128 IOVM_API IoObject
*IoCoroutine_start(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
130 IOVM_API IoObject
*IoCoroutine_rawResume(IoCoroutine
*self
);
131 IOVM_API IoObject
*IoCoroutine_resume(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
133 IOVM_API IoObject
*IoCoroutine_isCurrent(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
134 IOVM_API IoObject
*IoCoroutine_currentCoroutine(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
138 IOVM_API IoObject
*IoObject_callStack(IoCoroutine
*self
);
140 IOVM_API
void IoObject_appendStackEntryDescription(IoCoroutine
*self
, UArray
*ba
);
142 IOVM_API
void IoCoroutine_rawPrint(IoCoroutine
*self
);
146 IOVM_API
int IoCoroutine_rawDebuggingOn(IoCoroutine
*self
);
148 IOVM_API IoObject
*IoCoroutine_setMessageDebugging(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
149 IOVM_API IoObject
*IoObject_performWithDebugger(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
151 IOVM_API IoObject
*IoCoroutine_callStack(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
153 IOVM_API
void IoCoroutine_rawPrintBackTrace(IoCoroutine
*self
);
157 IOVM_API IoObject
*IoCoroutine_rawSetErrorDescription_(IoCoroutine
*self
, IoSymbol
*description
);
158 IOVM_API IoObject
*IoCoroutine_setErrorDescription(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);