Kiwi Engine
VM for interpreter
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
KESlot.h
Go to the documentation of this file.
1 
8 #ifndef KESLOT_H
9 #define KESLOT_H
10 
11 #include "KEValue.h"
12 
17 struct KESlot {
19  struct CNObject superClass ;
21  const struct CNFixedString * identifier ;
23  struct KEValue value ;
25  struct KELineInfo * lineInfo ;
26 } ;
27 
36 struct KESlot *
37 KEAllocateSlot(const struct CNFixedString * ident, const struct KEValue * val, struct KELineInfo * linfo, struct CNResource * resource) ;
38 
45 static inline struct KESlot *
46 KEAllocateSlotWithSlot(struct KESlot * src, struct CNResource * resource)
47 {
48  return KEAllocateSlot(src->identifier, &(src->value), src->lineInfo, resource) ;
49 }
50 
55 static inline void
56 KERetainSlot(struct KESlot * dst)
57 {
58  CNRetainObject(&(dst->superClass)) ;
59 }
60 
65 static inline void
66 KEReleaseSlot(struct KESlot * dst)
67 {
68  CNReleaseObject(&(dst->superClass)) ;
69 }
70 
76 static inline struct CNResource *
77 KEResourceOfSlot(struct KESlot * src)
78 {
79  return CNResourceOfObject(&(src->superClass)) ;
80 }
81 
87 static inline const struct CNFixedString *
88 KEIdentifierOfSlot(const struct KESlot * src)
89 {
90  return src->identifier ;
91 }
92 
98 static inline struct KEValue *
99 KEValueOfSlot(struct KESlot * src)
100 {
101  return &(src->value) ;
102 }
103 
109 static inline void
110 KEUpdateValueInSlot(struct KESlot * dst, const struct KEValue * src)
111 {
112  KEUpdateValue(&(dst->value), src) ;
113 }
114 
120 static inline struct KELineInfo *
121 KELineInfoInSlot(struct KESlot * src)
122 {
123  return src->lineInfo ;
124 }
125 
126 #endif /* KESLOT_H */
KEProgram class.
Definition: KELineInfo.h:19
Define KEValue data structure.
struct KESlot * KEAllocateSlot(const struct CNFixedString *ident, const struct KEValue *val, struct KELineInfo *linfo, struct CNResource *resource)
Allocate slot for the value.
struct CNFixedString * identifier
Definition: KESlot.h:21
struct KELineInfo * lineInfo
Definition: KESlot.h:25
Definition: KEValue.h:40
struct CNObject superClass
Definition: KESlot.h:19
struct KEValue value
Definition: KESlot.h:23
Definition: KESlot.h:17