X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/9d512587dc4e4ff598d4663ca1e43996a8cfd9e9..5da4d29c4227ae2392f7902c0a83afd8437c7308:/JavaScript.hpp diff --git a/JavaScript.hpp b/JavaScript.hpp index 944c89e..3fb2e6c 100644 --- a/JavaScript.hpp +++ b/JavaScript.hpp @@ -39,6 +39,7 @@ extern JSStringRef Array_s; extern JSStringRef cy_s; +extern JSStringRef cyi_s; extern JSStringRef length_s; extern JSStringRef message_s; extern JSStringRef name_s; @@ -56,7 +57,7 @@ JSGlobalContextRef CYGetJSContext(); JSObjectRef CYGetGlobalObject(JSContextRef context); extern "C" void CYSetupContext(JSGlobalContextRef context); -const char *CYExecute(CYPool &pool, CYUTF8String code); +const char *CYExecute(JSContextRef context, CYPool &pool, CYUTF8String code); void CYSetArgs(int argc, const char *argv[]); @@ -66,6 +67,7 @@ double CYCastDouble(JSContextRef context, JSValueRef value); CYUTF8String CYPoolUTF8String(CYPool &pool, JSContextRef context, JSStringRef value); const char *CYPoolCString(CYPool &pool, JSContextRef context, JSStringRef value); +bool CYHasProperty(JSContextRef context, JSObjectRef object, JSStringRef name); JSValueRef CYGetProperty(JSContextRef context, JSObjectRef object, size_t index); JSValueRef CYGetProperty(JSContextRef context, JSObjectRef object, JSStringRef name); @@ -125,6 +127,10 @@ extern struct CYHooks *hooks_; JSObjectRef CYMakePointer(JSContextRef context, void *pointer, size_t length, sig::Type *type, ffi_type *ffi, JSObjectRef owner); +JSObjectRef CYMakeType(JSContextRef context, const char *encoding); +JSObjectRef CYMakeType(JSContextRef context, sig::Type *type); +JSObjectRef CYMakeType(JSContextRef context, sig::Signature *signature); + void CYFinalize(JSObjectRef object); size_t CYArrayLength(JSContextRef context, JSObjectRef array); @@ -138,6 +144,9 @@ JSStringRef CYCopyJSString(JSStringRef value); JSStringRef CYCopyJSString(CYUTF8String value); JSStringRef CYCopyJSString(JSContextRef context, JSValueRef value); +void CYGarbageCollect(JSContextRef context); +void CYDestroyContext(); + class CYJSString { private: JSStringRef string_;