2 docCopyright("Steve Dekorte", 2002)
3 docLicense("BSD revised")
6 #ifndef IoCoroutine_DEFINED
7 #define IoCoroutine_DEFINED 1
19 #define ISCOROUTINE(self) IoObject_hasCloneFunc_(self, (IoTagCloneFunc *)IoCoroutine_rawClone)
21 typedef IoObject IoCoroutine
;
30 IOVM_API IoCoroutine
*IoCoroutine_proto(void *state
);
31 IOVM_API
void IoCoroutine_protoFinish(IoCoroutine
*self
);
32 IOVM_API IoCoroutine
*IoCoroutine_rawClone(IoCoroutine
*self
);
33 IOVM_API IoCoroutine
*IoCoroutine_new(void *state
);
35 IOVM_API
void IoCoroutine_free(IoCoroutine
*self
);
36 IOVM_API
void IoCoroutine_mark(IoCoroutine
*self
);
37 Stack
*IoCoroutine_rawIoStack(IoCoroutine
*self
);
38 IOVM_API
void IoCoroutine_rawShow(IoCoroutine
*self
);
40 IOVM_API IoObject
*IoCoroutine_main(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
41 IOVM_API IoObject
*IoCoroutine_freeStack(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
43 IOVM_API
void *IoCoroutine_cid(IoCoroutine
*self
);
47 //void IoCoroutine_rawSetLabel_(IoCoroutine *self, IoSymbol *s);
48 //IoObject *IoCoroutine_rawLabel(IoCoroutine *self);
50 IOVM_API IoObject
*IoCoroutine_setLabel(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
51 IOVM_API IoObject
*IoCoroutine_label(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
55 IOVM_API
void IoCoroutine_rawSetRunTarget_(IoCoroutine
*self
, IoObject
*v
);
56 IOVM_API IoObject
*IoCoroutine_rawRunTarget(IoCoroutine
*self
);
60 IOVM_API
void IoCoroutine_rawSetRunMessage_(IoCoroutine
*self
, IoObject
*v
);
61 IOVM_API IoObject
*IoCoroutine_rawRunMessage(IoCoroutine
*self
);
65 IOVM_API
void IoCoroutine_rawSetRunLocals_(IoCoroutine
*self
, IoObject
*v
);
66 IOVM_API IoObject
*IoCoroutine_rawRunLocals(IoCoroutine
*self
);
70 IOVM_API
void IoCoroutine_rawSetParentCoroutine_(IoCoroutine
*self
, IoObject
*v
);
71 IOVM_API IoObject
*IoCoroutine_rawParentCoroutine(IoCoroutine
*self
);
74 IOVM_API
void IoCoroutine_rawSetResult_(IoCoroutine
*self
, IoObject
*v
);
75 IOVM_API IoObject
*IoCoroutine_rawResult(IoCoroutine
*self
);
79 IOVM_API
void IoCoroutine_rawRemoveException(IoCoroutine
*self
);
80 IOVM_API
void IoCoroutine_rawSetException_(IoCoroutine
*self
, IoObject
*v
);
81 IOVM_API IoObject
*IoCoroutine_rawException(IoCoroutine
*self
);
85 IOVM_API IoObject
*IoCoroutine_ioStack(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
86 IOVM_API
int IoCoroutine_rawIoStackSize(IoCoroutine
*self
);
90 IOVM_API
void IoCoroutine_rawRun(IoCoroutine
*self
);
92 IOVM_API
void IoCoroutine_clearStack(IoCoroutine
*self
);
94 IOVM_API
void IoCoroutine_try(IoCoroutine
*self
, IoObject
*target
, IoObject
*locals
, IoMessage
*message
);
96 IOVM_API IoCoroutine
*IoCoroutine_newWithTry(void *state
,
101 IOVM_API
void IoCoroutine_raiseError(IoCoroutine
*self
, IoSymbol
*description
, IoMessage
*m
);
105 IOVM_API IoObject
*IoCoroutine_implementation(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
107 IOVM_API IoObject
*IoCoroutine_run(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
108 IOVM_API IoObject
*IoCoroutine_callStack(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
110 IOVM_API IoObject
*IoCoroutine_isCurrent(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
114 IOVM_API
void IoCoroutine_rawSetRunTarget_(IoCoroutine
*self
, IoObject
*v
);
115 IOVM_API IoObject
*IoCoroutine_rawRunTarget(IoCoroutine
*self
);
119 IOVM_API
void IoCoroutine_rawSetRunMessage_(IoCoroutine
*self
, IoObject
*v
);
120 IOVM_API IoObject
*IoCoroutine_rawRunMessage(IoCoroutine
*self
);
124 IOVM_API
void IoCoroutine_rawSetParentCoroutine_(IoCoroutine
*self
, IoObject
*v
);
125 IOVM_API IoObject
*IoCoroutine_rawParentCoroutine(IoCoroutine
*self
);
129 IOVM_API IoObject
*IoCoroutine_start(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
131 IOVM_API IoObject
*IoCoroutine_rawResume(IoCoroutine
*self
);
132 IOVM_API IoObject
*IoCoroutine_resume(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
134 IOVM_API IoObject
*IoCoroutine_isCurrent(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
135 IOVM_API IoObject
*IoCoroutine_currentCoroutine(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
139 IOVM_API IoObject
*IoObject_callStack(IoCoroutine
*self
);
141 IOVM_API
void IoObject_appendStackEntryDescription(IoCoroutine
*self
, UArray
*ba
);
143 IOVM_API
void IoCoroutine_rawPrint(IoCoroutine
*self
);
147 IOVM_API
int IoCoroutine_rawDebuggingOn(IoCoroutine
*self
);
149 IOVM_API IoObject
*IoCoroutine_setMessageDebugging(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
150 IOVM_API IoObject
*IoObject_performWithDebugger(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
152 IOVM_API IoObject
*IoCoroutine_callStack(IoCoroutine
*self
, IoObject
*locals
, IoMessage
*m
);
154 IOVM_API
void IoCoroutine_rawPrintBackTrace(IoCoroutine
*self
);