-
Notifications
You must be signed in to change notification settings - Fork 9
Tagha API Reference
assyrianic edited this page Jul 14, 2018
·
64 revisions
void Tagha_Init(struct Tagha *vm, void *script);- intializes the Tagha VM with a script pointer.
void Tagha_InitN(struct Tagha *vm, void *script, const struct NativeInfo natives[]);- intializes the Tagha VM with a script pointer and registers a set array of natives in one go.
int32_t Tagha_RunScript(struct Tagha *vm, int32_t args, char *argvector[]);- executes a script loaded on the vm until the script halts, returns on empty stack, or an error occurs.
bool Tagha_RegisterNatives(struct Tagha *vm, const struct NativeInfo natives[]);- registers an array of natives to Tagha's native map. returns
trueon success,falseon failure.falsecan occur ifvmornativesisNULL, orNativesHashmap methods returns false.
int32_t Tagha_CallFunc(struct Tagha *vm, const char *funcname, size_t args, union Value values[]);- matches
strFuncin a script's function table to invoke the function's instructions.
void *Tagha_GetGlobalVarByName(struct Tagha *vm, const char *varname);- matches
varnamein a script's var table to retrieve the address of the global variable and returns it as avoid *pointer. Returns NULL if the variable doesn't exist.
union Value Tagha_GetReturnValue(struct Tagha *vm);- gets the value of the VM's
Alafregister.