react-native/React/Executors/RCTJSCWrapper.h
Martin Konicek 7991d1206b Revert import from D4133936 (13aba8)
Summary:
This broke the open source build: http://imgur.com/a/1Btd1

javache tells me reverting this line should fix it.

Reviewed By: javache, ericvicenti

Differential Revision: D4178951

fbshipit-source-id: c680de6b3b48bf137294dfe053afaff7b0613caf
2016-11-14 16:28:55 -08:00

88 lines
4.4 KiB
Objective-C

/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <JavaScriptCore/JavaScriptCore.h>
#import "RCTDefines.h"
typedef void (*voidWithNoParamsFuncType)();
typedef JSStringRef (*JSStringCreateWithCFStringFuncType)(CFStringRef);
typedef JSStringRef (*JSStringCreateWithUTF8CStringFuncType)(const char *);
typedef CFStringRef (*JSStringCopyCFStringFuncType)(CFAllocatorRef, JSStringRef);
typedef void (*JSStringReleaseFuncType)(JSStringRef);
typedef void (*JSGlobalContextSetNameFuncType)(JSGlobalContextRef, JSStringRef);
typedef void (*JSObjectSetPropertyFuncType)(JSContextRef, JSObjectRef, JSStringRef, JSValueRef, JSPropertyAttributes, JSValueRef *);
typedef JSObjectRef (*JSContextGetGlobalObjectFuncType)(JSContextRef);
typedef JSValueRef (*JSObjectGetPropertyFuncType)(JSContextRef, JSObjectRef, JSStringRef, JSValueRef *);
typedef bool (*JSObjectIsFunctionFuncType)(JSContextRef, JSObjectRef);
typedef bool (*JSObjectIsConstructorFuncType)(JSContextRef, JSObjectRef);
typedef JSPropertyNameArrayRef (*JSObjectCopyPropertyNamesFuncType)(JSContextRef, JSObjectRef);
typedef size_t (*JSPropertyNameArrayGetCountFuncType)(JSPropertyNameArrayRef);
typedef JSStringRef (*JSPropertyNameArrayGetNameAtIndexFuncType)(JSPropertyNameArrayRef, size_t);
typedef void (*JSPropertyNameArrayReleaseFuncType)(JSPropertyNameArrayRef);
typedef JSValueRef (*JSValueMakeFromJSONStringFuncType)(JSContextRef, JSStringRef);
typedef JSValueRef (*JSObjectCallAsFunctionFuncType)(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef *, JSValueRef *);
typedef JSValueRef (*JSValueMakeNullFuncType)(JSContextRef);
typedef JSStringRef (*JSValueCreateJSONStringFuncType)(JSContextRef, JSValueRef, unsigned, JSValueRef *);
typedef bool (*JSValueIsUndefinedFuncType)(JSContextRef, JSValueRef);
typedef bool (*JSValueIsNullFuncType)(JSContextRef, JSValueRef);
typedef JSObjectRef (*JSValueToObjectFuncType)(JSContextRef, JSValueRef, JSValueRef *);
typedef JSValueRef (*JSEvaluateScriptFuncType)(JSContextRef, JSStringRef, JSObjectRef, JSStringRef, int, JSValueRef *);
typedef JSValueRef (*JSEvaluateBytecodeBundleFuncType)(JSContextRef, JSObjectRef, int, JSStringRef, JSValueRef *);
/**
* JSNoBytecodeFileFormatVersion
*
* Version number indicating that bytecode is not supported by this runtime.
*/
extern const int32_t JSNoBytecodeFileFormatVersion;
typedef struct RCTJSCWrapper {
JSStringCreateWithCFStringFuncType JSStringCreateWithCFString;
JSStringCreateWithUTF8CStringFuncType JSStringCreateWithUTF8CString;
JSStringCopyCFStringFuncType JSStringCopyCFString;
JSStringReleaseFuncType JSStringRelease;
JSGlobalContextSetNameFuncType JSGlobalContextSetName;
JSObjectSetPropertyFuncType JSObjectSetProperty;
JSContextGetGlobalObjectFuncType JSContextGetGlobalObject;
JSObjectGetPropertyFuncType JSObjectGetProperty;
JSObjectIsFunctionFuncType JSObjectIsFunction;
JSObjectIsConstructorFuncType JSObjectIsConstructor;
JSObjectCopyPropertyNamesFuncType JSObjectCopyPropertyNames;
JSPropertyNameArrayGetCountFuncType JSPropertyNameArrayGetCount;
JSPropertyNameArrayGetNameAtIndexFuncType JSPropertyNameArrayGetNameAtIndex;
JSPropertyNameArrayReleaseFuncType JSPropertyNameArrayRelease;
JSValueMakeFromJSONStringFuncType JSValueMakeFromJSONString;
JSObjectCallAsFunctionFuncType JSObjectCallAsFunction;
JSValueMakeNullFuncType JSValueMakeNull;
JSValueCreateJSONStringFuncType JSValueCreateJSONString;
JSValueIsUndefinedFuncType JSValueIsUndefined;
JSValueIsNullFuncType JSValueIsNull;
JSValueToObjectFuncType JSValueToObject;
JSEvaluateScriptFuncType JSEvaluateScript;
JSEvaluateBytecodeBundleFuncType JSEvaluateBytecodeBundle;
voidWithNoParamsFuncType configureJSCForIOS;
const int32_t JSBytecodeFileFormatVersion;
Class JSContext;
Class JSValue;
} RCTJSCWrapper;
RCT_EXTERN RCTJSCWrapper *RCTJSCWrapperCreate(BOOL useCustomJSC);
RCT_EXTERN void RCTJSCWrapperRelease(RCTJSCWrapper *wrapper);
/**
* Link time overridable initialization function to execute custom
* initialization code when loading custom JSC.
*
* By default it does nothing.
*
* @param handle to the dlopen'd JSC library.
*/
void __attribute__((visibility("hidden"))) RCTCustomJSCInit(void *handle);