11 #include <Coconut/Coconut.h>
19 KEUnsignedIntegerValue,
31 static inline CNBoolean
34 return type >= KEStringValue ;
45 CNBoolean booleanValue ;
49 struct CNString * stringValue ;
59 KEInitValue(
struct KEValue * dst)
61 dst->
type = KENilValue ;
69 KEDestroyValue(
struct KEValue * dst)
71 if(KEIsObjectValueType(dst->
type)){
72 extern void KEDestroyObjectValue(
struct KEValue *) ;
73 KEDestroyObjectValue(dst) ;
75 dst->
type = KENilValue ;
84 KETypeOfValue(
const struct KEValue * src)
95 KEMakeValue(const struct
KEValue * src)
98 if(KEIsObjectValueType(src->type)){
99 extern struct KEValue KEMakeObjectValueBody(const struct
KEValue * src) ;
100 newval = KEMakeObjectValueBody(src) ;
115 struct KEValue newval = KEMakeValue(src) ;
116 KEDestroyValue(dst) ;
126 KEMakeBooleanValue(CNBoolean src)
129 .
type = KEBooleanValue,
143 KEUpdateBooleanValue(
struct KEValue * dst, CNBoolean src)
145 KEDestroyValue(dst) ;
146 *dst = KEMakeBooleanValue(src) ;
155 KEMakeSignedIntegerValue(int64_t src)
158 .
type = KESignedIntegerValue,
172 KEUpdateSignedIntegerValue(
struct KEValue * dst, int64_t src)
174 KEDestroyValue(dst) ;
175 *dst = KEMakeSignedIntegerValue(src) ;
184 KEMakeUnsignedIntegerValue(uint64_t src)
187 .
type = KEUnsignedIntegerValue,
201 KEUpdateUnsignedIntegerValue(
struct KEValue * dst, uint64_t src)
203 KEDestroyValue(dst) ;
204 *dst = KEMakeUnsignedIntegerValue(src) ;
213 KEMakeFloatValue(double src)
216 .
type = KEFloatValue,
230 KEUpdateFloatValue(
struct KEValue * dst,
double src)
232 KEDestroyValue(dst) ;
233 *dst = KEMakeFloatValue(src) ;
242 KEMakeStringValue(struct CNString * src)
245 .
type = KEStringValue,
248 CNRetainString(val.stringValue) ;
260 KEUpdateStringValue(
struct KEValue * dst,
struct CNString * src)
262 CNRetainString(src) ;
263 KEDestroyValue(dst) ;
264 dst->
type = KEStringValue ;
265 dst->stringValue = src ;
283 static inline CNBoolean
284 KEIsFrameValue(
const struct KEValue * src)
322 static inline CNBoolean
323 KEIsArrayValue(
const struct KEValue * src)
361 static inline CNBoolean
362 KEIsDictionaryValue(
const struct KEValue * src)
400 static inline CNBoolean
401 KEIsPathValue(
const struct KEValue * src)
439 static inline CNBoolean
440 KEIsFunctionValue(
const struct KEValue * src)
478 static inline CNBoolean
479 KEIsBuiltinFuncValue(
const struct KEValue * src)
507 static inline CNBoolean
508 KEHasValidValue(
struct KEValue * src)
510 return KETypeOfValue(src) != KENilValue ;
void KEUpdateDictionaryValue(struct KEValue *dst, struct KEDictionary *src)
Set the value to dictionary object.
void KEUpdateArrayValue(struct KEValue *dst, struct KEArray *src)
Set the value to array object.
struct KEValue KEMakePathValue(struct KEPath *src)
Make the value which has the dictionary.
struct KEPath * KEPathInValue(const struct KEValue *src)
Get path in value.
KEValueType
Definition: KEValue.h:15
struct KEValue KEMakeBuiltinFuncValue(struct KEBuiltinFunc *src)
Make the value which has the builtin-func.
void KEDumpValue(struct CNText *outbuf, const struct KEValue *src)
Dump context of the buffer.
struct KEFrame * KEFrameInValue(const struct KEValue *src)
Get frame in value.
struct KEValue KEMakeFunctionValue(struct KEFunction *src)
Make the value which has the function.
struct KEValue KEMakeArrayValue(struct KEArray *src)
Make the value which has the array.
struct KEArray * KEArrayInValue(const struct KEValue *src)
Get array in value.
Definition: KEFunction.h:18
struct KEValue KEMakeFrameValue(struct KEFrame *src)
Make the value which has the frame.
Array of KEValue.
Definition: KEArray.h:21
Definition: KEBuiltinFunc.h:36
Definition: KEObject.h:42
void KEUpdateFunctionValue(struct KEValue *dst, struct KEFunction *src)
Set the value to function object.
void KEUpdateFrameValue(struct KEValue *dst, struct KEFrame *src)
Set the value to frame object.
struct KEBuiltinFunc * KEBuiltinFuncInValue(const struct KEValue *src)
Get builtin-func in value.
const char * KEStringOfValueType(struct KEValue *src)
Get description of given type.
Dictionary class. The key is CNString and the value is KEValue.
Definition: KEDictionary.h:24
struct KEFunction * KEFunctionInValue(const struct KEValue *src)
Get function in value.
struct KEValue KEMakeDictionaryValue(struct KEDictionary *src)
Make the value which has the dictionary.
Forward declarations of the data type in KiwiEngine.
struct KEDictionary * KEDictionaryInValue(const struct KEValue *src)
Get dictionary in value.
void KEUpdatePathValue(struct KEValue *dst, struct KEPath *src)
Set the value to path object.
void KEUpdateBuiltinFuncValue(struct KEValue *dst, struct KEBuiltinFunc *src)
Set the value to builtin-func object.
KEValueType type
Definition: KEValue.h:42