OSDN Git Service

Merge branch 'master' of git://git.sourceforge.jp/gitroot/localjavascript/localJS-dev
[localjavascript/localJS-dev.git] / js.h
1 #ifndef JS_CONSOLE
2 #define JS_CONSOLE
3
4 #define ARG_ERR_MSG "Wrong argument. Aborting…\n"
5
6 #ifndef IOS
7 #include <JavascriptCore/JavascriptCore.h>//-framework JavaScriptCoreオプションを使用の事
8 #else
9 #include <JavaScriptCore/JavascriptCore.h>
10 #endif
11
12
13 static JSValueRef jsGlobalPrint(
14                                                                 JSContextRef        ctx,
15                                                                 JSObjectRef         jobj,
16                                                                 JSObjectRef         jobjThis,
17                                                                 size_t              argLen,
18                                                                 const JSObjectRef   args[],
19                                                                 JSValueRef*         jobjExp);
20 static JSValueRef jsGlobalScan(
21                                                            JSContextRef        ctx,
22                                                            JSObjectRef         jobj,
23                                                            JSObjectRef         jobjThis,
24                                                            size_t              argLen,
25                                                            const JSObjectRef   args[],
26                                                            JSValueRef*         jobjExp);
27 static JSValueRef jsGlobalF_Open(
28                                                                  JSContextRef        ctx,
29                                                                  JSObjectRef         jobj,
30                                                                  JSObjectRef         jobjThis,
31                                                                  size_t              argLen,
32                                                                  const JSObjectRef   args[],
33                                                                  JSValueRef*         jobjExp);
34 static JSValueRef jsGlobalExec(
35                                                            JSContextRef        ctx,
36                                                            JSObjectRef         jobj,
37                                                            JSObjectRef         jobjThis,
38                                                            size_t              argLen,
39                                                            const JSObjectRef   args[],
40                                                            JSValueRef*         jobjExp);
41 /////TEST/////
42 static JSValueRef jsGlobalTest(
43                                                            JSContextRef        ctx,
44                                                            JSObjectRef         jobj,
45                                                            JSObjectRef         jobjThis,
46                                                            size_t              argLen,
47                                                            const JSObjectRef   args[],
48                                                            JSValueRef*         jobjExp);
49 /////////////
50 static JSValueRef jsGlobalCaller(
51                                                                  JSContextRef        ctx,
52                                                                  JSObjectRef         jobj,
53                                                                  JSObjectRef         jobjThis,
54                                                                  size_t              argLen,
55                                                                  const JSObjectRef   args[],
56                                                                  JSValueRef*         jobjExp);
57 static JSValueRef jsGlobalExit(
58                                                            JSContextRef        ctx,
59                                                            JSObjectRef         jobj,
60                                                            JSObjectRef         jobjThis,
61                                                            size_t              argLen,
62                                                            const JSObjectRef   args[],
63                                                            JSValueRef*         jobjExp);
64
65 extern int interpreter(char* code);
66 extern void functionWrapper(JSGlobalContextRef ctx, JSObjectRef jobjGlobal, char* name, JSObjectCallAsFunctionCallback jsGlobalFunction);
67 extern void classWrapper(JSGlobalContextRef ctx, JSObjectRef jobjGlobal, char* name, JSObjectRef* classObject, JSObjectCallAsConstructorCallback callAsConstructor);
68 extern int dialogtest( int argc, char **argv );
69 extern int g_argc;
70 extern char** g_argv;
71 char* loadFile(const char* fileName);
72 char* execCmd(const char* cmd);
73 void callJsFunction(JSContextRef ctx, const char* func);
74 void functionLoader(JSGlobalContextRef ctx, JSObjectRef parentObj);
75 static JSValueRef makeException(JSGlobalContextRef ctx, char* ename);
76 #endif
77