annotate lib/swig/swigwin-2.0.11/Lib/lua/luaruntime.swg @ 2353:bb9f180d50f6

Removing a few unsorted_subs includes
author Grumpy7
date Wed, 09 Apr 2014 21:58:09 +0200
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 /* -----------------------------------------------------------------------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 * luaruntime.swg
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 * all the runtime code for .
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 * ----------------------------------------------------------------------------- */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 %runtime "swigrun.swg"; /* Common C API type-checking code */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 %runtime "luarun.swg"; /* Lua runtime stuff */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 %insert(initbeforefunc) "swiginit.swg"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 %insert(initbeforefunc) %{
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 /* Forward declaration of where the user's %init{} gets inserted */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 void SWIG_init_user(lua_State* L );
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 #ifdef __cplusplus
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 extern "C" {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 /* this is the initialization function
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 added at the very end of the code
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 the function is always called SWIG_init, but an earlier #define will rename it
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 LUALIB_API int SWIG_init(lua_State* L)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 #else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 int i;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 /* start with global table */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 lua_pushglobaltable (L);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 /* SWIG's internal initalisation */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 SWIG_InitializeModule((void*)L);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 SWIG_PropagateClientData();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 /* add a global fn */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 /* begin the module (its a table with the same name as the module) */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 SWIG_Lua_module_begin(L,SWIG_name);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 /* add commands/functions */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 for (i = 0; swig_commands[i].name; i++){
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 /* add variables */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 for (i = 0; swig_variables[i].name; i++){
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 /* set up base class pointers (the hierarchy) */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 for (i = 0; swig_types[i]; i++){
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 if (swig_types[i]->clientdata){
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 /* additional registration structs & classes in lua */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 for (i = 0; swig_types[i]; i++){
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 if (swig_types[i]->clientdata){
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 /* constants */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 SWIG_Lua_InstallConstants(L,swig_constants);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 /* invoke user-specific initialization */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 SWIG_init_user(L);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 /* end module */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 /* Note: We do not clean up the stack here (Lua will do this for us). At this
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 point, we have the globals table and out module table on the stack. Returning
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 one value makes the module table the result of the require command. */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82 return 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 #else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
88 #ifdef __cplusplus
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
89 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
90 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
91
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
92 %}
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
93
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
94 /* Note: the initialization function is closed after all code is generated */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
95