6#ifndef MJS_UTIL_PUBLIC_H_
7#define MJS_UTIL_PUBLIC_H_
9#include "mjs_core_public.h"
12#if defined(__cplusplus)
16typedef void (*MjsPrintCallback)(
void* ctx,
const char* format, ...);
18const char* mjs_typeof(mjs_val_t v);
20void mjs_fprintf(mjs_val_t v,
struct mjs*
mjs, FILE* fp);
21void mjs_sprintf(mjs_val_t v,
struct mjs*
mjs,
char* buf,
size_t buflen);
23void mjs_disasm_all(
struct mjs*
mjs, MjsPrintCallback print_cb,
void* print_ctx);
24void mjs_dump(
struct mjs*
mjs,
int do_disasm, MjsPrintCallback print_cb,
void* print_ctx);
29const char* mjs_get_bcode_filename_by_offset(
struct mjs*
mjs,
int offset);
34int mjs_get_lineno_by_offset(
struct mjs*
mjs,
int offset);
42int mjs_get_offset_by_call_frame_num(
struct mjs*
mjs,
int cf_num);
54mjs_err_t mjs_to_string(
struct mjs*
mjs, mjs_val_t* v,
char** p,
size_t* sizep,
int* need_free);
59mjs_val_t mjs_to_boolean_v(
struct mjs*
mjs, mjs_val_t v);
61int mjs_is_truthy(
struct mjs*
mjs, mjs_val_t v);
63#if defined(__cplusplus)