Not functional, but stable--sese invocation code pulls from an SESErecord
[IRC.git] / Robust / src / Runtime / mlp_runtime.h
1 #ifndef __MLP_RUNTIME__
2 #define __MLP_RUNTIME__
3
4
5 // value mode means the variable's value
6 // is present in the SESEvar struct
7 #define SESEvar_MODE_VALUE   3001
8
9 // static move means the variable's value
10 // will come from a statically known SESE
11 #define SESEvar_MODE_STATIC  3002
12
13 // dynamic mode means the variable's value
14 // will come from an SESE, and the exact
15 // SESE will be determined at runtime
16 #define SESEvar_MODE_DYNAMIC 3003
17
18
19 // a forward delcaration for SESEvar
20 struct SESErecord;
21
22
23 struct SESEvar {
24   unsigned char mode;
25
26   // the value when it is known will be placed
27   // in this location, which can be accessed
28   // as a variety of types
29   union {
30     char   sesetype_byte;
31     char   sesetype_boolean;
32     short  sesetype_short;
33     int    sesetype_int;
34     long   sesetype_long;
35     char   sesetype_char;
36     float  sesetype_float;
37     double sesetype_double;
38   };
39   
40   // a statically or dynamically known SESE
41   // to gather the variable's value from
42   struct SESErecord* source;
43   unsigned int index;
44 };
45
46
47 struct SESErecord {  
48   // the identifier for the class of sese's that
49   // are instances of one particular static code block
50   int classID;
51
52   // not globally unqiue, but each parent ensures that
53   // its children have unique identifiers, including to
54   // the parent itself
55   int instanceID;
56
57   // for state of vars after issue
58   struct SESEvar* vars;
59   
60   // when this sese is ready to be invoked,
61   // allocate and fill in this structure, and
62   // the primitives will be passed out of the
63   // above var array at the call site
64   void* paramStruct;
65 };
66
67
68 void mlpInit();
69
70 void mlpIssue     ( struct SESErecord* sese );
71 void mlpStall     ( struct SESErecord* sese );
72 void mlpNotifyExit( struct SESErecord* sese );
73
74
75 #endif /* __MLP_RUNTIME__ */