forked from ground/ground-old
Add groundFindField to groundvm.h
This commit is contained in:
@@ -208,6 +208,8 @@ GroundProgram groundParseFile(const char* code);
|
|||||||
GroundStruct groundCreateStruct();
|
GroundStruct groundCreateStruct();
|
||||||
void groundAddFieldToStruct(GroundStruct* gstruct, char* name, GroundValue field);
|
void groundAddFieldToStruct(GroundStruct* gstruct, char* name, GroundValue field);
|
||||||
|
|
||||||
|
GroundObjectField* groundFindField(GroundObject head, const char *id);
|
||||||
|
|
||||||
// Run function returned by Ground code
|
// Run function returned by Ground code
|
||||||
// Use argc to set count of args, accepts that amount of GroundValue's after
|
// Use argc to set count of args, accepts that amount of GroundValue's after
|
||||||
GroundValue groundRunFunction(GroundFunction* function, size_t argc, ...);
|
GroundValue groundRunFunction(GroundFunction* function, size_t argc, ...);
|
||||||
|
|||||||
@@ -180,3 +180,9 @@ GroundValue groundRunFunction(GroundFunction* function, size_t argc, ...) {
|
|||||||
|
|
||||||
return interpretGroundProgram(&function->program, &callScope);
|
return interpretGroundProgram(&function->program, &callScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GroundObjectField* groundFindField(GroundObject head, const char *id) {
|
||||||
|
GroundObjectField* s;
|
||||||
|
HASH_FIND_STR(head.fields, id, s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user