2012-08-28 10:22:36 +08:00
|
|
|
//
|
|
|
|
// Created by Rohan Kuruvilla
|
|
|
|
// Copyright (c) 2012 Zynga Inc. All rights reserved.
|
|
|
|
//
|
2012-09-24 11:47:33 +08:00
|
|
|
#ifndef __JS_MANUAL_CONVERSIONS_H__
|
|
|
|
#define __JS_MANUAL_CONVERSIONS_H__
|
2012-08-28 10:22:36 +08:00
|
|
|
|
2012-09-21 08:09:40 +08:00
|
|
|
#include "jsapi.h"
|
2012-11-14 07:03:35 +08:00
|
|
|
#include "js_bindings_core.h"
|
2012-08-28 10:22:36 +08:00
|
|
|
|
2012-09-24 13:57:45 +08:00
|
|
|
//#ifdef __cplusplus
|
|
|
|
//extern "C" {
|
|
|
|
//#endif
|
2012-08-28 10:22:36 +08:00
|
|
|
|
2012-09-24 13:57:45 +08:00
|
|
|
extern JSBool jsval_to_opaque( JSContext *cx, jsval vp, void **out );
|
|
|
|
extern JSBool jsval_to_int( JSContext *cx, jsval vp, int *out);
|
2012-11-14 07:03:35 +08:00
|
|
|
extern JSBool jsval_to_uint( JSContext *cx, jsval vp, unsigned int *out);
|
2012-09-24 13:57:45 +08:00
|
|
|
extern JSBool jsval_to_long( JSContext *cx, jsval vp, long *out);
|
|
|
|
extern JSBool jsval_to_longlong( JSContext *cx, jsval vp, long long *out);
|
|
|
|
extern jsval opaque_to_jsval( JSContext *cx, void* opaque);
|
2012-11-14 07:03:35 +08:00
|
|
|
extern jsval c_class_to_jsval( JSContext *cx, void* handle, JSObject* object, JSClass *klass, const char* class_name);
|
|
|
|
extern JSBool jsval_to_c_class( JSContext *cx, jsval vp, void **out_native, struct jsb_c_proxy_s **out_proxy);
|
|
|
|
extern jsval int_to_jsval( JSContext *cx, int number );
|
|
|
|
extern jsval uint_to_jsval( JSContext *cx, unsigned int number );
|
|
|
|
extern jsval long_to_jsval( JSContext *cx, long number );
|
|
|
|
extern jsval longlong_to_jsval( JSContext *cx, long long number );
|
|
|
|
|
2012-09-21 08:09:40 +08:00
|
|
|
|
2012-09-24 13:57:45 +08:00
|
|
|
//#ifdef __cplusplus
|
|
|
|
//}
|
|
|
|
//#endif
|
2012-09-24 11:47:33 +08:00
|
|
|
|
|
|
|
#endif /* __JS_MANUAL_CONVERSIONS_H__ */
|
|
|
|
|