6#ifndef MJS_OBJECT_PUBLIC_H_
7#define MJS_OBJECT_PUBLIC_H_
10#include "mjs_core_public.h"
11#include "mjs_ffi_public.h"
13#if defined(__cplusplus)
20int mjs_is_object(mjs_val_t v);
25int mjs_is_object_based(mjs_val_t v);
28mjs_val_t mjs_mk_object(
struct mjs*
mjs);
31enum mjs_struct_field_type {
32 MJS_STRUCT_FIELD_TYPE_INVALID,
33 MJS_STRUCT_FIELD_TYPE_STRUCT,
34 MJS_STRUCT_FIELD_TYPE_STRUCT_PTR,
35 MJS_STRUCT_FIELD_TYPE_INT,
36 MJS_STRUCT_FIELD_TYPE_BOOL,
37 MJS_STRUCT_FIELD_TYPE_DOUBLE,
38 MJS_STRUCT_FIELD_TYPE_FLOAT,
39 MJS_STRUCT_FIELD_TYPE_CHAR_PTR,
40 MJS_STRUCT_FIELD_TYPE_VOID_PTR,
41 MJS_STRUCT_FIELD_TYPE_MG_STR_PTR,
42 MJS_STRUCT_FIELD_TYPE_MG_STR,
43 MJS_STRUCT_FIELD_TYPE_DATA,
44 MJS_STRUCT_FIELD_TYPE_INT8,
45 MJS_STRUCT_FIELD_TYPE_INT16,
46 MJS_STRUCT_FIELD_TYPE_UINT8,
47 MJS_STRUCT_FIELD_TYPE_UINT16,
53 MJS_STRUCT_FIELD_TYPE_CUSTOM,
60 enum mjs_struct_field_type type;
75mjs_val_t mjs_get(
struct mjs*
mjs, mjs_val_t obj,
const char* name,
size_t name_len);
80mjs_val_t mjs_get_v(
struct mjs*
mjs, mjs_val_t obj, mjs_val_t name);
85mjs_val_t mjs_get_v_proto(
struct mjs*
mjs, mjs_val_t obj, mjs_val_t key);
90mjs_err_t mjs_set(
struct mjs*
mjs, mjs_val_t obj,
const char* name,
size_t len, mjs_val_t val);
95mjs_err_t mjs_set_v(
struct mjs*
mjs, mjs_val_t obj, mjs_val_t name, mjs_val_t val);
106int mjs_del(
struct mjs*
mjs, mjs_val_t obj,
const char* name,
size_t len);
120mjs_val_t mjs_next(
struct mjs*
mjs, mjs_val_t obj, mjs_val_t* iterator);
122typedef void (*mjs_custom_obj_destructor_t)(
struct mjs*
mjs, mjs_val_t object);
128#define MJS_DESTRUCTOR_PROP_NAME "__d"
130#if defined(__cplusplus)
Definition mjs_object_public.h:57