#ifndef FUNCTIONS_H #define FUNCTIONS_H #include #include "DataType.h" #include "vm/Script.h" #define FUNCTION_ARGUMENTS 9 typedef void (*ScriptFunction)(Script*); typedef struct { const char* name; int arguments; DataType argumentTypes[FUNCTION_ARGUMENTS]; DataType returnType; int address; int size; int line; bool global; ScriptFunction scriptFunction; } Function; typedef struct { int capacity; int entries; Function* data; } Functions; void fInit(Function* f, const char* name, int line); bool fAddArgument(Function* f, DataType type, Structs* sts); void fsInit(Functions* fs); void fsDelete(Functions* fs); Function* fsSearch(Functions* fs, Function* f); void fsAdd(Functions* fs, Function* f); void gfInit(Function* f, const char* name, DataType r, ScriptFunction sf); void gfsInit(); bool gfsAdd(Function* f); bool gfsCall(Script* sc, int id); void gfsDelete(); #endif