Fixed a lazySlot bug where lazy slots in different objects end up pointing to the...
[io/quag.git] / libs / iovm / source / IoTag.h
bloba3fcabab37c3904129252e2cb4b232ec236841a7
1 /*#io
2 docCopyright("Steve Dekorte", 2002)
3 docLicense("BSD revised")
4 */
6 #ifndef IOTAG_DEFINED
7 #define IOTAG_DEFINED 1
9 #include "Common.h"
10 //#include "Stack.h"
11 #include "BStream.h"
13 #include "IoVMApi.h"
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
19 typedef void * (IoTagCloneFunc)(void *); // self
20 typedef void (IoTagFreeFunc)(void *); // self
21 typedef void (IoTagMarkFunc)(void *); // self
22 typedef void (IoTagNotificationFunc)(void *, void *); // self, notification
23 typedef void (IoTagCleanupFunc)(void *); // self
25 typedef void * (IoTagPerformFunc)(void *, void *, void *); // self, locals, message
26 typedef void * (IoTagActivateFunc)(void *, void *, void *, void *, void *); // self, target, locals, message, slotContext
27 typedef int (IoTagCompareFunc)(void *, void *); // self and another IoObject
29 typedef void (IoTagWriteToStreamFunc)(void *, BStream *); // self, store, stream
30 typedef void * (IoTagAllocFromStreamFunc)(void *, BStream *); // self, store, stream
31 typedef void (IoTagReadFromStreamFunc)(void *, BStream *); // self, store, stream
33 typedef struct
35 void *state;
36 char *name;
38 // memory management
40 IoTagCloneFunc *cloneFunc;
41 IoTagFreeFunc *freeFunc;
42 IoTagCleanupFunc *tagCleanupFunc;
43 IoTagMarkFunc *markFunc;
44 IoTagNotificationFunc *notificationFunc;
46 // actions
48 //IoTagTouchFunc *touchFunc; // if present, call before type check
49 IoTagPerformFunc *performFunc; // lookup and activate, return result
50 IoTagActivateFunc *activateFunc; // return the receiver or compute and return a value
51 IoTagCompareFunc *compareFunc;
53 // persistence
55 IoTagWriteToStreamFunc *writeToStreamFunc;
56 IoTagAllocFromStreamFunc *allocFromStreamFunc;
57 IoTagReadFromStreamFunc *readFromStreamFunc;
59 // Stack *recyclableInstances;
60 // int maxRecyclableInstances;
61 } IoTag;
63 IOVM_API IoTag *IoTag_new(void);
64 IOVM_API IoTag *IoTag_newWithName_(const char *name);
65 IOVM_API void IoTag_free(IoTag *self);
67 IOVM_API void IoTag_name_(IoTag *self, const char *name);
68 IOVM_API const char *IoTag_name(IoTag *self);
70 IOVM_API void IoTag_mark(IoTag *self);
72 #include "IoTag_inline.h"
74 #ifdef __cplusplus
76 #endif
77 #endif