1 /* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include "iotjs_string.h"
23 // Return value should be released with iotjs_string_destroy()
24 iotjs_string_t iotjs_file_read(const char* path);
26 char* iotjs_buffer_allocate(unsigned size);
27 char* iotjs_buffer_reallocate(char* buffer, unsigned size);
28 void iotjs_buffer_release(char* buff);
30 #define IOTJS_ALLOC(type) /* Allocate (type)-sized, (type*)-typed memory */ \
31 (type*)iotjs_buffer_allocate(sizeof(type))
33 #define IOTJS_RELEASE(ptr) /* Release memory allocated by IOTJS_ALLOC() */ \
34 iotjs_buffer_release((char*)ptr)
37 #endif /* IOTJS_UTIL_H */