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.
16 #ifndef IOTJS_OBJECTWRAP_H
17 #define IOTJS_OBJECTWRAP_H
20 #include "iotjs_binding.h"
23 // This wrapper refer javascript object but never increase reference count
24 // If the object is freed by GC, then this wrapper instance will be also freed.
27 } IOTJS_VALIDATED_STRUCT(iotjs_jobjectwrap_t);
29 void iotjs_jobjectwrap_initialize(iotjs_jobjectwrap_t* jobjectwrap,
30 const iotjs_jval_t* jobject,
31 JFreeHandlerType jfreehandler);
33 void iotjs_jobjectwrap_destroy(iotjs_jobjectwrap_t* jobjectwrap);
35 iotjs_jval_t* iotjs_jobjectwrap_jobject(iotjs_jobjectwrap_t* jobjectwrap);
36 iotjs_jobjectwrap_t* iotjs_jobjectwrap_from_jobject(
37 const iotjs_jval_t* jobject);
40 #endif /* IOTJS_OBJECTWRAP_H */