forked from ground/ground
groundFindVariable function
This commit is contained in:
@@ -20,7 +20,7 @@ typedef enum GroundInstType {
|
|||||||
} GroundInstType;
|
} GroundInstType;
|
||||||
|
|
||||||
typedef enum GroundValueType {
|
typedef enum GroundValueType {
|
||||||
INT, DOUBLE, STRING, CHAR, BOOL, LIST, FUNCTION, STRUCTVAL, CUSTOM, ERROR, NONE
|
INT, DOUBLE, STRING, CHAR, BOOL, LIST, FUNCTION, STRUCTVAL, CUSTOM, ERROR, NONE, ANY
|
||||||
} GroundValueType;
|
} GroundValueType;
|
||||||
|
|
||||||
typedef enum GroundArgType {
|
typedef enum GroundArgType {
|
||||||
@@ -209,6 +209,7 @@ 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);
|
GroundObjectField* groundFindField(GroundObject head, const char *id);
|
||||||
|
GroundVariable* groundFindVariable(GroundScope* gs, 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
|
||||||
|
|||||||
@@ -221,3 +221,9 @@ GroundObjectField* groundFindField(GroundObject head, const char *id) {
|
|||||||
HASH_FIND_STR(head.fields, id, s);
|
HASH_FIND_STR(head.fields, id, s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GroundVariable* groundFindVariable(GroundScope* gs, const char *id) {
|
||||||
|
GroundVariable* var;
|
||||||
|
HASH_FIND_STR(*gs->variables, id, var);
|
||||||
|
return var;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user