Loading...
Searching...
No Matches
mjs_array_buf_public.h
1/*
2 * Copyright (c) 2016 Cesanta Software Limited
3 * All rights reserved
4 */
5
6#pragma once
7
8#include "mjs_core_public.h"
9
10#if defined(__cplusplus)
11extern "C" {
12#endif /* __cplusplus */
13
14typedef enum {
15 MJS_DATAVIEW_U8,
16 MJS_DATAVIEW_I8,
17 MJS_DATAVIEW_U16,
18 MJS_DATAVIEW_I16,
19 MJS_DATAVIEW_U32,
20 MJS_DATAVIEW_I32,
21} mjs_dataview_type_t;
22
23int mjs_is_array_buf(mjs_val_t v);
24
25int mjs_is_data_view(mjs_val_t v);
26
27int mjs_is_typed_array(mjs_val_t v);
28
29mjs_val_t mjs_mk_array_buf(struct mjs* mjs, char* data, size_t buf_len);
30
31char* mjs_array_buf_get_ptr(struct mjs* mjs, mjs_val_t buf, size_t* bytelen);
32
33mjs_val_t mjs_dataview_get_buf(struct mjs* mjs, mjs_val_t obj);
34
35#if defined(__cplusplus)
36}
37#endif /* __cplusplus */
Definition mjs_core.h:63