6#ifndef MJS_PRIMITIVE_PUBLIC_H_
7#define MJS_PRIMITIVE_PUBLIC_H_
9#include "mjs_core_public.h"
11#if defined(__cplusplus)
16#define MJS_NULL MJS_TAG_NULL
19#define MJS_UNDEFINED MJS_TAG_UNDEFINED
21#define MJS_MK_FN(fn) mjs_mk_foreign_func(mjs, (mjs_func_ptr_t)fn)
24typedef void (*mjs_func_ptr_t)(void);
32mjs_val_t mjs_mk_null(
void);
35int mjs_is_null(mjs_val_t v);
43mjs_val_t mjs_mk_undefined(
void);
46int mjs_is_undefined(mjs_val_t v);
49mjs_val_t mjs_mk_number(
struct mjs*
mjs,
double num);
56double mjs_get_double(
struct mjs*
mjs, mjs_val_t v);
64int mjs_get_int(
struct mjs*
mjs, mjs_val_t v);
70int32_t mjs_get_int32(
struct mjs*
mjs, mjs_val_t v);
73int mjs_is_number(mjs_val_t v);
94mjs_val_t mjs_mk_foreign(
struct mjs*
mjs,
void* ptr);
100mjs_val_t mjs_mk_foreign_func(
struct mjs*
mjs, mjs_func_ptr_t fn);
107void* mjs_get_ptr(
struct mjs*
mjs, mjs_val_t v);
110int mjs_is_foreign(mjs_val_t v);
112mjs_val_t mjs_mk_boolean(
struct mjs*
mjs,
int v);
113int mjs_get_bool(
struct mjs*
mjs, mjs_val_t v);
114int mjs_is_boolean(mjs_val_t v);
116mjs_val_t mjs_mk_function(
struct mjs*
mjs,
size_t off);
117int mjs_is_function(mjs_val_t v);
119#if defined(__cplusplus)