/+junk/c_sdl_joypad_ducktape

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad_ducktape

« back to all changes in this revision

Viewing changes to src/JSParser.h

  • Committer: Gustav Hartvigsson
  • Date: 2014-06-15 19:55:43 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20140615195543-3lxnj0fmvn0imgzr
* it compiles...

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 *
14
14
 */
15
15
 
16
 
#include "ducktape.h"
 
16
#include "duktape.h"
17
17
#include "Game.h"
18
18
 
19
 
 
20
 
 
21
 
/**
22
 
 * The maximum size of the memory after which GC is run.
23
 
 */
24
 
#define JS_RUNTIME_SIZE 1024*64
25
 
 
26
19
/******************************************************************************/
27
20
 
28
21
typedef struct GameJSParser GameJSParser;
46
39
  GameJSParserLoadDataFunc load_data_func;
47
40
  GameJSParserDumpDataFunc dump_data_func;
48
41
  
49
 
  JSRuntime * js_rt;
50
 
  JSContext * js_cx;
51
 
  JSObject * js_global;
52
 
  
53
 
  JSFunctionSpec * js_global_funcs; /**< Treat as an array, end with NULL */
54
 
  
 
42
  duk_context * ctx;
 
43
  duk_function_list_entry * function_array;
55
44
  
56
45
  Game * game; /**< DO NOT FREE! */
57
46
  
90
79
void * game_js_parser_dump_settings (GameJSParser * self);
91
80
 
92
81
 
93
 
/**
94
 
 * This just wraps JS_DefineFunction:
95
 
 * https://developer.mozilla.org/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_DefineFunction
96
 
 */
97
 
void game_js_parser_add_js_global_callback (GameJSParser * self,
98
 
                                            const char * name,
99
 
                                            JSNative call,
100
 
                                            uint16 nargs,
101
 
                                            uint16 flags);
102
 
 
103
 
void game_js_parser_add_js_private_callback (GameJSParser * self,
104
 
                                            JSObject * context,
105
 
                                            const char * name,
106
 
                                            JSNative call,
107
 
                                            uint16 nargs,
108
 
                                            uint16 flags);
109
 
 
110
82
void game_js_parser_run (GameJSParser * self);
111
83
 
112
84
/******************************************************************************/