Cosmo/src/cbaselib.h

22 lines
858 B
C
Raw Normal View History

2020-10-28 05:16:30 +00:00
#ifndef COSMO_BASELIB
#define COSMO_BASELIB
#include "cstate.h"
/* loads all of the base library, including:
- base library ("print", "assert", "type", "pcall", "loadstring", etc.)
- string library ("string.sub", "string.split", "string.find")
*/
2020-11-13 05:04:09 +00:00
COSMO_API void cosmoB_loadLibrary(CState *state);
COSMO_API void cosmoB_loadStrLib(CState *state);
2020-11-13 05:04:09 +00:00
COSMO_API void cosmoB_loadDebug(CState *state);
COSMO_API int cosmoB_print(CState *state, int nargs, CValue *args);
COSMO_API int cosmoB_assert(CState *state, int nargs, CValue *args);
2021-01-02 20:33:11 +00:00
COSMO_API int cosmoB_type(CState *state, int nargs, CValue *args);
COSMO_API int cosmoB_pcall(CState *state, int nargs, CValue *args);
#define cosmoV_typeError(state, name, expectedTypes, formatStr, ...) \
cosmoV_error(state, name " expected (" expectedTypes "), got (" formatStr ")!", __VA_ARGS__);
2020-10-28 05:16:30 +00:00
2021-01-02 05:06:24 +00:00
#endif