summaryrefslogtreecommitdiff
path: root/src/lua/tolua_bd.c
blob: d36a5ce98ada8ee9780e20cb06087125ea537024 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/*
** Lua binding: tolua
** Generated automatically by tolua 4.0b on Tue Nov 14 14:18:50 2000.
*/

#include "tolua.h"

/* Exported function */
int  tolua_tolua_open (lua_State* tolua_S);
void tolua_tolua_close (lua_State* tolua_S);

#define tolua_using(module)       (tolua_using)(tolua_S,module)
#define tolua_type(lo)            (tolua_type)(tolua_S,lo)
#define tolua_foreach(lo,f)       (tolua_foreach)(tolua_S,lo,f)
#define tolua_class(derived,base) (tolua_class)(tolua_S,derived,base)
#define tolua_instance(inst,cobj) (tolua_instance)(tolua_S,inst,cobj)
#define tolua_base(lo)            (tolua_base)(tolua_S,lo)
#define tolua_cast(lo,type)       (tolua_cast)(tolua_S,lo,type)
#define tolua_takeownership(lo)   (tolua_takeownership)(tolua_S,lo)

/* function to register type */
static void toluaI_reg_types (lua_State* tolua_S)
{
}

/* function: tolua_using */
static int toluaI_tolua_tolua_using00(lua_State* tolua_S)
{
 if (
     !tolua_isnoobj(tolua_S,2)
 )
  goto tolua_lerror;
 else
 {
  LUA_VALUE module = ((LUA_VALUE)  tolua_getvalue(tolua_S,1,0));
  {
   tolua_using(module);
  }
 }
 return 0;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'using'.");
 return 0;
}

/* function: tolua_type */
static int toluaI_tolua_tolua_type00(lua_State* tolua_S)
{
 if (
     !tolua_isnoobj(tolua_S,2)
 )
  goto tolua_lerror;
 else
 {
  LUA_VALUE lo = ((LUA_VALUE)  tolua_getvalue(tolua_S,1,0));
  {
   char* toluaI_ret = (char*)  tolua_type(lo);
   tolua_pushstring(tolua_S,toluaI_ret);
  }
 }
 return 1;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'type'.");
 return 0;
}

/* function: tolua_foreach */
static int toluaI_tolua_tolua_foreach00(lua_State* tolua_S)
{
 if (
     !tolua_isnoobj(tolua_S,3)
 )
  goto tolua_lerror;
 else
 {
  LUA_VALUE lo = ((LUA_VALUE)  tolua_getvalue(tolua_S,1,0));
  LUA_VALUE f = ((LUA_VALUE)  tolua_getvalue(tolua_S,2,0));
  {
   tolua_foreach(lo,f);
  }
 }
 return 0;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'foreach'.");
 return 0;
}

/* function: tolua_class */
static int toluaI_tolua_tolua_class00(lua_State* tolua_S)
{
 if (
     !tolua_isnoobj(tolua_S,3)
 )
  goto tolua_lerror;
 else
 {
  LUA_VALUE derived = ((LUA_VALUE)  tolua_getvalue(tolua_S,1,0));
  LUA_VALUE base = ((LUA_VALUE)  tolua_getvalue(tolua_S,2,0));
  {
   tolua_class(derived,base);
  }
 }
 return 0;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'class'.");
 return 0;
}

/* function: tolua_instance */
static int toluaI_tolua_tolua_instance00(lua_State* tolua_S)
{
 if (
     !tolua_isnoobj(tolua_S,3)
 )
  goto tolua_lerror;
 else
 {
  LUA_VALUE instance = ((LUA_VALUE)  tolua_getvalue(tolua_S,1,0));
  LUA_VALUE classobj = ((LUA_VALUE)  tolua_getvalue(tolua_S,2,0));
  {
   tolua_instance(instance,classobj);
  }
 }
 return 0;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'instance'.");
 return 0;
}

/* function: tolua_base */
static int toluaI_tolua_tolua_base00(lua_State* tolua_S)
{
 if (
     !tolua_isnoobj(tolua_S,2)
 )
  goto tolua_lerror;
 else
 {
  LUA_VALUE lo = ((LUA_VALUE)  tolua_getvalue(tolua_S,1,0));
  {
   LUA_VALUE toluaI_ret = (LUA_VALUE)  tolua_base(lo);
   tolua_pushvalue(tolua_S,toluaI_ret);
  }
 }
 return 1;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'base'.");
 return 0;
}

/* function: tolua_cast */
static int toluaI_tolua_tolua_cast00(lua_State* tolua_S)
{
 if (
     !tolua_istype(tolua_S,2,LUA_TSTRING,0) ||
     !tolua_isnoobj(tolua_S,3)
 )
  goto tolua_lerror;
 else
 {
  LUA_VALUE lo = ((LUA_VALUE)  tolua_getvalue(tolua_S,1,0));
  char* type = ((char*)  tolua_getstring(tolua_S,2,0));
  {
   LUA_VALUE toluaI_ret = (LUA_VALUE)  tolua_cast(lo,type);
   tolua_pushvalue(tolua_S,toluaI_ret);
  }
 }
 return 1;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'cast'.");
 return 0;
}

/* function: tolua_takeownership */
static int toluaI_tolua_tolua_takeownership00(lua_State* tolua_S)
{
 if (
     !tolua_isnoobj(tolua_S,2)
 )
  goto tolua_lerror;
 else
 {
  LUA_VALUE lo = ((LUA_VALUE)  tolua_getvalue(tolua_S,1,0));
  {
   tolua_takeownership(lo);
  }
 }
 return 0;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'takeownership'.");
 return 0;
}

/* Open function */
int tolua_tolua_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 toluaI_reg_types(tolua_S);
 tolua_module(tolua_S,"tolua");
 tolua_function(tolua_S,"tolua","using",toluaI_tolua_tolua_using00);
 tolua_function(tolua_S,"tolua","type",toluaI_tolua_tolua_type00);
 tolua_function(tolua_S,"tolua","foreach",toluaI_tolua_tolua_foreach00);
 tolua_function(tolua_S,"tolua","class",toluaI_tolua_tolua_class00);
 tolua_function(tolua_S,"tolua","instance",toluaI_tolua_tolua_instance00);
 tolua_function(tolua_S,"tolua","base",toluaI_tolua_tolua_base00);
 tolua_function(tolua_S,"tolua","cast",toluaI_tolua_tolua_cast00);
 tolua_function(tolua_S,"tolua","takeownership",toluaI_tolua_tolua_takeownership00);
 return 1;
}
/* Close function */
void tolua_tolua_close (lua_State* tolua_S)
{
 lua_pushnil(tolua_S); lua_setglobal(tolua_S,"tolua");
}