X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/98735bfe852adb9e5421e5c04bb2e0119af443bd..dace80755cd90ff908df4a546f5a0e17a8dad186:/JavaScript.hpp diff --git a/JavaScript.hpp b/JavaScript.hpp index 920df8c..38b2f60 100644 --- a/JavaScript.hpp +++ b/JavaScript.hpp @@ -1,21 +1,21 @@ /* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2013 Jay Freeman (saurik) + * Copyright (C) 2009-2014 Jay Freeman (saurik) */ -/* GNU General Public License, Version 3 {{{ */ +/* GNU Affero General Public License, Version 3 {{{ */ /* - * Cycript is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * Cycript is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Cycript. If not, see . + * GNU Affero General Public License for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . **/ /* }}} */ @@ -66,6 +66,9 @@ void CYSetArgs(int argc, const char *argv[]); bool CYCastBool(JSContextRef context, JSValueRef value); double CYCastDouble(JSContextRef context, JSValueRef value); +bool CYIsEqual(JSContextRef context, JSValueRef lhs, JSValueRef rhs); +bool CYIsStrictEqual(JSContextRef context, JSValueRef lhs, JSValueRef rhs); + CYUTF8String CYPoolUTF8String(CYPool &pool, JSContextRef context, JSStringRef value); const char *CYPoolCString(CYPool &pool, JSContextRef context, JSStringRef value); @@ -115,7 +118,7 @@ JSValueRef CYCallAsFunction(JSContextRef context, JSObjectRef function, JSObject const char *CYPoolCCYON(CYPool &pool, JSContextRef context, JSObjectRef object, std::set &objects); std::set *CYCastObjects(JSContextRef context, JSObjectRef _this, size_t count, const JSValueRef arguments[]); -struct CYHooks { +struct CYHook { void *(*ExecuteStart)(JSContextRef); void (*ExecuteEnd)(JSContextRef, void *); @@ -128,11 +131,12 @@ struct CYHooks { JSValueRef (*FromFFI)(JSContextRef, sig::Type *, ffi_type *, void *, bool, JSObjectRef); }; -extern struct CYHooks *hooks_; +struct CYRegisterHook { + CYRegisterHook(CYHook *hook); +}; 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);