1 /* Copyright JS Foundation and other contributors, http://js.foundation 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ECMA_ARRAYBUFFER_OBJECT_H 17 #define ECMA_ARRAYBUFFER_OBJECT_H 18 19 #include "ecma-globals.h" 20 21 #if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) 22 23 /** \addtogroup ecma ECMA 24 * @{ 25 * 26 * \addtogroup ecmaarraybufferobject ECMA ArrayBuffer object related routines 27 * @{ 28 */ 29 30 ecma_value_t 31 ecma_op_create_arraybuffer_object (const ecma_value_t *, ecma_length_t); 32 33 /** 34 * Helper functions for arraybuffer. 35 */ 36 ecma_object_t * 37 ecma_arraybuffer_new_object (ecma_length_t lengh); 38 ecma_object_t * 39 ecma_arraybuffer_new_object_external (ecma_length_t length, 40 void *buffer_p, 41 ecma_object_native_free_callback_t free_cb); 42 lit_utf8_byte_t * JERRY_ATTR_PURE 43 ecma_arraybuffer_get_buffer (ecma_object_t *obj_p); 44 ecma_length_t JERRY_ATTR_PURE 45 ecma_arraybuffer_get_length (ecma_object_t *obj_p); 46 bool JERRY_ATTR_PURE 47 ecma_arraybuffer_is_detached (ecma_object_t *obj_p); 48 bool JERRY_ATTR_PURE 49 ecma_arraybuffer_is_detachable (ecma_object_t *obj_p); 50 bool 51 ecma_arraybuffer_detach (ecma_object_t *obj_p); 52 bool 53 ecma_is_arraybuffer (ecma_value_t val); 54 55 /** 56 * @} 57 * @} 58 */ 59 60 #endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ 61 #endif /* !ECMA_ARRAYBUFFER_OBJECT_H */ 62