cvm.c: added cosmoV_undump

This commit is contained in:
2023-05-27 23:16:47 -05:00
parent 45f36e6e87
commit 355842989b
2 changed files with 34 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ COSMO_API void cosmo_insert(CState *state, int indx, CValue val);
COSMO_API bool cosmoV_registerProtoObject(CState *state, CObjType objType, CObjObject *obj);
/*
compiles string into a <closure>, if successful, <closure> will be pushed onto the stack
compiles string into a <closure>. if successful, <closure> will be pushed onto the stack
otherwise the <error> will be pushed.
returns:
@@ -47,6 +47,16 @@ COSMO_API bool cosmoV_registerProtoObject(CState *state, CObjType objType, CObjO
*/
COSMO_API bool cosmoV_compileString(CState *state, const char *src, const char *name);
/*
loads a <closure> from a dump. if successful, <closure> will be pushed onto the stack
otherwise the <error> will be pushed.
returns:
false : <error> is at the top of the stack
true : <closure> is at the top of the stack
*/
COSMO_API bool cosmoV_undump(CState *state, cosmo_Reader reader, const void *ud);
/*
expects object to be pushed, then the key.