#define _GNU_SOURCE
#include <substrate.h>
-#include "cycript.h"
+#include "cycript.hpp"
#include <cstdio>
#include <sstream>
#define _GNU_SOURCE
#include <substrate.h>
-#include "cycript.h"
+#include "cycript.hpp"
#include "sig/parse.hpp"
#include "sig/ffi_type.hpp"
@end
-extern "C" JSContextRef CYGetJSContext() {
+JSContextRef CYGetJSContext() {
return Context_;
}
return value == nil ? JSValueMakeNull(context) : [value cy$JSValueInContext:context];
}
-extern "C" void CYThrowNSError(JSContextRef context, id error, JSValueRef *exception) {
+void CYThrow(JSContextRef context, id error, JSValueRef *exception) {
*exception = CYCastJSValue(context, error);
}
@end
-extern "C" CFStringRef CYCopyJSONString(JSContextRef context, JSValueRef value) {
+CFStringRef CYCopyJSONString(JSContextRef context, JSValueRef value) {
id object(CYCastNSObject(context, value));
return reinterpret_cast<CFStringRef>([(object == nil ? @"null" : [object cy$toJSON]) retain]);
}
+++ /dev/null
-#ifndef CYCRIPT_H
-#define CYCRIPT_H
-
-#ifdef __OBJC__
-#include <Foundation/Foundation.h>
-#endif
-
-#include <JavaScriptCore/JSBase.h>
-#include <JavaScriptCore/JSValueRef.h>
-#include <JavaScriptCore/JSObjectRef.h>
-#include <JavaScriptCore/JSContextRef.h>
-#include <JavaScriptCore/JSStringRef.h>
-#include <JavaScriptCore/JSStringRefCF.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-JSContextRef CYGetJSContext();
-CFStringRef CYCopyJSONString(JSContextRef context, JSValueRef value);
-
-#ifdef __OBJC__
-void CYThrowNSError(JSContextRef context, id error, JSValueRef *exception);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef __cplusplus
-inline void CYThrow(JSContextRef context, id error, JSValueRef *exception) {
- return CYThrowNSError(context, error, exception);
-}
-#endif
-
-#endif/*CYCRIPT_H*/
--- /dev/null
+#ifndef CYCRIPT_H
+#define CYCRIPT_H
+
+#ifdef __OBJC__
+#include <Foundation/Foundation.h>
+#endif
+
+#include <JavaScriptCore/JSBase.h>
+#include <JavaScriptCore/JSValueRef.h>
+#include <JavaScriptCore/JSObjectRef.h>
+#include <JavaScriptCore/JSContextRef.h>
+#include <JavaScriptCore/JSStringRef.h>
+#include <JavaScriptCore/JSStringRefCF.h>
+
+JSContextRef CYGetJSContext();
+CFStringRef CYCopyJSONString(JSContextRef context, JSValueRef value);
+
+#ifdef __OBJC__
+void CYThrow(JSContextRef context, id error, JSValueRef *exception);
+#endif
+
+#endif/*CYCRIPT_H*/
Output.o: Output.cpp Parser.hpp Pooling.hpp
$(target)g++ $(flags) -c -o $@ $<
-Library.o: Library.mm Cycript.tab.hh Parser.hpp Pooling.hpp Struct.hpp cycript.h
+Library.o: Library.mm Cycript.tab.hh Parser.hpp Pooling.hpp Struct.hpp cycript.hpp
$(target)g++ $(flags) -c -o $@ $<
-Application.o: Application.mm Cycript.tab.hh Parser.hpp Pooling.hpp cycript.h
+Application.o: Application.mm Cycript.tab.hh Parser.hpp Pooling.hpp cycript.hpp
$(target)g++ $(flags) -c -o $@ $<
libcycript.dylib: ffi_type.o parse.o Output.o Cycript.tab.o lex.cy.o Library.o