OSDN Git Service

Major change; Object oriented re-design, re-structure.
[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 #include <JavascriptCore/JavascriptCore.h>//-framework JavaScriptCoreオプションを使用の事
7
8
9 static JSValueRef jsGlobalPrint(
10                                                                 JSContextRef        ctx,
11                                                                 JSObjectRef         jobj,
12                                                                 JSObjectRef         jobjThis,
13                                                                 size_t              argLen,
14                                                                 const JSObjectRef   args[],
15                                                                 JSValueRef*         jobjExp);
16 static JSValueRef jsGlobalScan(
17                                                            JSContextRef        ctx,
18                                                            JSObjectRef         jobj,
19                                                            JSObjectRef         jobjThis,
20                                                            size_t              argLen,
21                                                            const JSObjectRef   args[],
22                                                            JSValueRef*         jobjExp);
23 static JSValueRef jsGlobalF_Open(
24                                                                  JSContextRef        ctx,
25                                                                  JSObjectRef         jobj,
26                                                                  JSObjectRef         jobjThis,
27                                                                  size_t              argLen,
28                                                                  const JSObjectRef   args[],
29                                                                  JSValueRef*         jobjExp);
30 static JSValueRef jsGlobalExec(
31                                                            JSContextRef        ctx,
32                                                            JSObjectRef         jobj,
33                                                            JSObjectRef         jobjThis,
34                                                            size_t              argLen,
35                                                            const JSObjectRef   args[],
36                                                            JSValueRef*         jobjExp);
37 /////TEST/////
38 static JSValueRef jsGlobalTest(
39                                                            JSContextRef        ctx,
40                                                            JSObjectRef         jobj,
41                                                            JSObjectRef         jobjThis,
42                                                            size_t              argLen,
43                                                            const JSObjectRef   args[],
44                                                            JSValueRef*         jobjExp);
45 /////////////
46 static JSValueRef jsGlobalCaller(
47                                                                  JSContextRef        ctx,
48                                                                  JSObjectRef         jobj,
49                                                                  JSObjectRef         jobjThis,
50                                                                  size_t              argLen,
51                                                                  const JSObjectRef   args[],
52                                                                  JSValueRef*         jobjExp);
53 static JSValueRef jsGlobalExit(
54                                                                  JSContextRef        ctx,
55                                                                  JSObjectRef         jobj,
56                                                                  JSObjectRef         jobjThis,
57                                                                  size_t              argLen,
58                                                                  const JSObjectRef   args[],
59                                                                  JSValueRef*         jobjExp);
60
61 extern int interpreter(char* code);
62 extern void functionWrapper(JSGlobalContextRef ctx, JSObjectRef jobjGlobal, char* name, JSObjectCallAsFunctionCallback jsGlobalFunction);
63 extern void classWrapper(JSGlobalContextRef ctx, JSObjectRef jobjGlobal, char* name, JSObjectRef* classObject);
64 extern int dialogtest( int argc, char **argv );
65 extern int g_argc;
66 extern char** g_argv;
67 char* loadFile(const char* fileName);
68 char* execCmd(const char* cmd);
69 void callJsFunction(JSContextRef ctx, const char* func);
70 void functionLoader(JSGlobalContextRef ctx, JSObjectRef parentObj);
71 static JSValueRef makeException(JSGlobalContextRef ctx, char* ename);
72 #endif
73