| 1 |
/* |
| 2 |
** Lua binding: tvariable |
| 3 |
** Generated automatically by tolua 5.0a-CDLVS2 on 08/08/03 17:06:18. |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef __cplusplus |
| 7 |
#include "stdlib.h" |
| 8 |
#endif |
| 9 |
#include "string.h" |
| 10 |
|
| 11 |
#include "tolua.h" |
| 12 |
|
| 13 |
/* Exported function */ |
| 14 |
TOLUA_API int tolua_tvariable_open (lua_State* tolua_S); |
| 15 |
|
| 16 |
#include "tvariable.h" |
| 17 |
|
| 18 |
/* function to register type */ |
| 19 |
static void tolua_reg_types (lua_State* tolua_S) |
| 20 |
{ |
| 21 |
tolua_usertype(tolua_S,"A"); |
| 22 |
tolua_usertype(tolua_S,"U"); |
| 23 |
tolua_usertype(tolua_S,"B"); |
| 24 |
} |
| 25 |
|
| 26 |
/* get function: i of class A */ |
| 27 |
static int tolua_get_A_i(lua_State* tolua_S) |
| 28 |
{ |
| 29 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 30 |
#ifndef TOLUA_RELEASE |
| 31 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'i'",NULL); |
| 32 |
#endif |
| 33 |
tolua_pushnumber(tolua_S,(double)self->i); |
| 34 |
return 1; |
| 35 |
} |
| 36 |
|
| 37 |
/* set function: i of class A */ |
| 38 |
static int tolua_set_A_i(lua_State* tolua_S) |
| 39 |
{ |
| 40 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 41 |
#ifndef TOLUA_RELEASE |
| 42 |
tolua_Error tolua_err; |
| 43 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'i'",NULL); |
| 44 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 45 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 46 |
#endif |
| 47 |
self->i = ((int) tolua_tonumber(tolua_S,2,0)); |
| 48 |
return 0; |
| 49 |
} |
| 50 |
|
| 51 |
/* get function: f of class A */ |
| 52 |
static int tolua_get_A_f(lua_State* tolua_S) |
| 53 |
{ |
| 54 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 55 |
#ifndef TOLUA_RELEASE |
| 56 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'f'",NULL); |
| 57 |
#endif |
| 58 |
tolua_pushnumber(tolua_S,(double)self->f); |
| 59 |
return 1; |
| 60 |
} |
| 61 |
|
| 62 |
/* set function: f of class A */ |
| 63 |
static int tolua_set_A_f(lua_State* tolua_S) |
| 64 |
{ |
| 65 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 66 |
#ifndef TOLUA_RELEASE |
| 67 |
tolua_Error tolua_err; |
| 68 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'f'",NULL); |
| 69 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 70 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 71 |
#endif |
| 72 |
self->f = ((float) tolua_tonumber(tolua_S,2,0)); |
| 73 |
return 0; |
| 74 |
} |
| 75 |
|
| 76 |
/* get function: d of class A */ |
| 77 |
static int tolua_get_A_d(lua_State* tolua_S) |
| 78 |
{ |
| 79 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 80 |
#ifndef TOLUA_RELEASE |
| 81 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'd'",NULL); |
| 82 |
#endif |
| 83 |
tolua_pushnumber(tolua_S,(double)self->d); |
| 84 |
return 1; |
| 85 |
} |
| 86 |
|
| 87 |
/* set function: d of class A */ |
| 88 |
static int tolua_set_A_d(lua_State* tolua_S) |
| 89 |
{ |
| 90 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 91 |
#ifndef TOLUA_RELEASE |
| 92 |
tolua_Error tolua_err; |
| 93 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'd'",NULL); |
| 94 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 95 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 96 |
#endif |
| 97 |
self->d = ((double) tolua_tonumber(tolua_S,2,0)); |
| 98 |
return 0; |
| 99 |
} |
| 100 |
|
| 101 |
/* get function: s of class A */ |
| 102 |
static int tolua_get_A_s(lua_State* tolua_S) |
| 103 |
{ |
| 104 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 105 |
#ifndef TOLUA_RELEASE |
| 106 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 's'",NULL); |
| 107 |
#endif |
| 108 |
tolua_pushstring(tolua_S,(const char*)self->s); |
| 109 |
return 1; |
| 110 |
} |
| 111 |
|
| 112 |
/* set function: s of class A */ |
| 113 |
static int tolua_set_A_s(lua_State* tolua_S) |
| 114 |
{ |
| 115 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 116 |
#ifndef TOLUA_RELEASE |
| 117 |
tolua_Error tolua_err; |
| 118 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 's'",NULL); |
| 119 |
if (!tolua_isstring(tolua_S,2,0,&tolua_err)) |
| 120 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 121 |
#endif |
| 122 |
self->s = ((char*) tolua_tostring(tolua_S,2,0)); |
| 123 |
return 0; |
| 124 |
} |
| 125 |
|
| 126 |
/* get function: v of class A */ |
| 127 |
static int tolua_get_A_v(lua_State* tolua_S) |
| 128 |
{ |
| 129 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 130 |
#ifndef TOLUA_RELEASE |
| 131 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'v'",NULL); |
| 132 |
#endif |
| 133 |
tolua_pushuserdata(tolua_S,(void*)self->v); |
| 134 |
return 1; |
| 135 |
} |
| 136 |
|
| 137 |
/* set function: v of class A */ |
| 138 |
static int tolua_set_A_v(lua_State* tolua_S) |
| 139 |
{ |
| 140 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 141 |
#ifndef TOLUA_RELEASE |
| 142 |
tolua_Error tolua_err; |
| 143 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'v'",NULL); |
| 144 |
if (!tolua_isuserdata(tolua_S,2,0,&tolua_err)) |
| 145 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 146 |
#endif |
| 147 |
self->v = ((void*) tolua_touserdata(tolua_S,2,0)); |
| 148 |
return 0; |
| 149 |
} |
| 150 |
|
| 151 |
/* get function: n of class A */ |
| 152 |
static int tolua_get_A_n(lua_State* tolua_S) |
| 153 |
{ |
| 154 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 155 |
#ifndef TOLUA_RELEASE |
| 156 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'n'",NULL); |
| 157 |
#endif |
| 158 |
tolua_pushstring(tolua_S,(const char*)self->n); |
| 159 |
return 1; |
| 160 |
} |
| 161 |
|
| 162 |
/* set function: n of class A */ |
| 163 |
static int tolua_set_A_n(lua_State* tolua_S) |
| 164 |
{ |
| 165 |
A* self = (A*) tolua_tousertype(tolua_S,1,0); |
| 166 |
#ifndef TOLUA_RELEASE |
| 167 |
tolua_Error tolua_err; |
| 168 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'n'",NULL); |
| 169 |
if (!tolua_isstring(tolua_S,2,0,&tolua_err)) |
| 170 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 171 |
#endif |
| 172 |
strncpy(self->n,tolua_tostring(tolua_S,2,0),64-1); |
| 173 |
return 0; |
| 174 |
} |
| 175 |
|
| 176 |
/* get function: a of class B */ |
| 177 |
static int tolua_get_B_a(lua_State* tolua_S) |
| 178 |
{ |
| 179 |
B* self = (B*) tolua_tousertype(tolua_S,1,0); |
| 180 |
#ifndef TOLUA_RELEASE |
| 181 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'a'",NULL); |
| 182 |
#endif |
| 183 |
tolua_pushusertype(tolua_S,(void*)&self->a,"A"); |
| 184 |
return 1; |
| 185 |
} |
| 186 |
|
| 187 |
/* set function: a of class B */ |
| 188 |
static int tolua_set_B_a(lua_State* tolua_S) |
| 189 |
{ |
| 190 |
B* self = (B*) tolua_tousertype(tolua_S,1,0); |
| 191 |
#ifndef TOLUA_RELEASE |
| 192 |
tolua_Error tolua_err; |
| 193 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'a'",NULL); |
| 194 |
if (!tolua_isusertype(tolua_S,2,"A",0,&tolua_err)) |
| 195 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 196 |
#endif |
| 197 |
self->a = *((A*) tolua_tousertype(tolua_S,2,0)); |
| 198 |
return 0; |
| 199 |
} |
| 200 |
|
| 201 |
/* get function: b of class B */ |
| 202 |
static int tolua_get_B_b_ptr(lua_State* tolua_S) |
| 203 |
{ |
| 204 |
B* self = (B*) tolua_tousertype(tolua_S,1,0); |
| 205 |
#ifndef TOLUA_RELEASE |
| 206 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'b'",NULL); |
| 207 |
#endif |
| 208 |
tolua_pushusertype(tolua_S,(void*)self->b,"B"); |
| 209 |
return 1; |
| 210 |
} |
| 211 |
|
| 212 |
/* set function: b of class B */ |
| 213 |
static int tolua_set_B_b_ptr(lua_State* tolua_S) |
| 214 |
{ |
| 215 |
B* self = (B*) tolua_tousertype(tolua_S,1,0); |
| 216 |
#ifndef TOLUA_RELEASE |
| 217 |
tolua_Error tolua_err; |
| 218 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'b'",NULL); |
| 219 |
if (!tolua_isusertype(tolua_S,2,"B",0,&tolua_err)) |
| 220 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 221 |
#endif |
| 222 |
self->b = ((B*) tolua_tousertype(tolua_S,2,0)); |
| 223 |
return 0; |
| 224 |
} |
| 225 |
|
| 226 |
/* get function: i of class U */ |
| 227 |
static int tolua_get_U_i(lua_State* tolua_S) |
| 228 |
{ |
| 229 |
U* self = (U*) tolua_tousertype(tolua_S,1,0); |
| 230 |
#ifndef TOLUA_RELEASE |
| 231 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'i'",NULL); |
| 232 |
#endif |
| 233 |
tolua_pushnumber(tolua_S,(double)self->i); |
| 234 |
return 1; |
| 235 |
} |
| 236 |
|
| 237 |
/* set function: i of class U */ |
| 238 |
static int tolua_set_U_i(lua_State* tolua_S) |
| 239 |
{ |
| 240 |
U* self = (U*) tolua_tousertype(tolua_S,1,0); |
| 241 |
#ifndef TOLUA_RELEASE |
| 242 |
tolua_Error tolua_err; |
| 243 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'i'",NULL); |
| 244 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 245 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 246 |
#endif |
| 247 |
self->i = ((int) tolua_tonumber(tolua_S,2,0)); |
| 248 |
return 0; |
| 249 |
} |
| 250 |
|
| 251 |
/* get function: f of class U */ |
| 252 |
static int tolua_get_U_f(lua_State* tolua_S) |
| 253 |
{ |
| 254 |
U* self = (U*) tolua_tousertype(tolua_S,1,0); |
| 255 |
#ifndef TOLUA_RELEASE |
| 256 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'f'",NULL); |
| 257 |
#endif |
| 258 |
tolua_pushnumber(tolua_S,(double)self->f); |
| 259 |
return 1; |
| 260 |
} |
| 261 |
|
| 262 |
/* set function: f of class U */ |
| 263 |
static int tolua_set_U_f(lua_State* tolua_S) |
| 264 |
{ |
| 265 |
U* self = (U*) tolua_tousertype(tolua_S,1,0); |
| 266 |
#ifndef TOLUA_RELEASE |
| 267 |
tolua_Error tolua_err; |
| 268 |
if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'f'",NULL); |
| 269 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 270 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 271 |
#endif |
| 272 |
self->f = ((float) tolua_tonumber(tolua_S,2,0)); |
| 273 |
return 0; |
| 274 |
} |
| 275 |
|
| 276 |
/* get function: i */ |
| 277 |
static int tolua_get_i(lua_State* tolua_S) |
| 278 |
{ |
| 279 |
tolua_pushnumber(tolua_S,(double)i); |
| 280 |
return 1; |
| 281 |
} |
| 282 |
|
| 283 |
/* set function: i */ |
| 284 |
static int tolua_set_i(lua_State* tolua_S) |
| 285 |
{ |
| 286 |
#ifndef TOLUA_RELEASE |
| 287 |
tolua_Error tolua_err; |
| 288 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 289 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 290 |
#endif |
| 291 |
i = ((int) tolua_tonumber(tolua_S,2,0)); |
| 292 |
return 0; |
| 293 |
} |
| 294 |
|
| 295 |
/* get function: f */ |
| 296 |
static int tolua_get_f(lua_State* tolua_S) |
| 297 |
{ |
| 298 |
tolua_pushnumber(tolua_S,(double)f); |
| 299 |
return 1; |
| 300 |
} |
| 301 |
|
| 302 |
/* set function: f */ |
| 303 |
static int tolua_set_f(lua_State* tolua_S) |
| 304 |
{ |
| 305 |
#ifndef TOLUA_RELEASE |
| 306 |
tolua_Error tolua_err; |
| 307 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 308 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 309 |
#endif |
| 310 |
f = ((float) tolua_tonumber(tolua_S,2,0)); |
| 311 |
return 0; |
| 312 |
} |
| 313 |
|
| 314 |
/* get function: d */ |
| 315 |
static int tolua_get_d(lua_State* tolua_S) |
| 316 |
{ |
| 317 |
tolua_pushnumber(tolua_S,(double)d); |
| 318 |
return 1; |
| 319 |
} |
| 320 |
|
| 321 |
/* set function: d */ |
| 322 |
static int tolua_set_d(lua_State* tolua_S) |
| 323 |
{ |
| 324 |
#ifndef TOLUA_RELEASE |
| 325 |
tolua_Error tolua_err; |
| 326 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 327 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 328 |
#endif |
| 329 |
d = ((double) tolua_tonumber(tolua_S,2,0)); |
| 330 |
return 0; |
| 331 |
} |
| 332 |
|
| 333 |
/* get function: s */ |
| 334 |
static int tolua_get_s(lua_State* tolua_S) |
| 335 |
{ |
| 336 |
tolua_pushstring(tolua_S,(const char*)s); |
| 337 |
return 1; |
| 338 |
} |
| 339 |
|
| 340 |
/* get function: v */ |
| 341 |
static int tolua_get_v(lua_State* tolua_S) |
| 342 |
{ |
| 343 |
tolua_pushuserdata(tolua_S,(void*)v); |
| 344 |
return 1; |
| 345 |
} |
| 346 |
|
| 347 |
/* set function: v */ |
| 348 |
static int tolua_set_v(lua_State* tolua_S) |
| 349 |
{ |
| 350 |
#ifndef TOLUA_RELEASE |
| 351 |
tolua_Error tolua_err; |
| 352 |
if (!tolua_isuserdata(tolua_S,2,0,&tolua_err)) |
| 353 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 354 |
#endif |
| 355 |
v = ((void*) tolua_touserdata(tolua_S,2,0)); |
| 356 |
return 0; |
| 357 |
} |
| 358 |
|
| 359 |
/* get function: n */ |
| 360 |
static int tolua_get_n(lua_State* tolua_S) |
| 361 |
{ |
| 362 |
tolua_pushstring(tolua_S,(const char*)n); |
| 363 |
return 1; |
| 364 |
} |
| 365 |
|
| 366 |
/* set function: n */ |
| 367 |
static int tolua_set_n(lua_State* tolua_S) |
| 368 |
{ |
| 369 |
#ifndef TOLUA_RELEASE |
| 370 |
tolua_Error tolua_err; |
| 371 |
if (!tolua_isstring(tolua_S,2,0,&tolua_err)) |
| 372 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 373 |
#endif |
| 374 |
strncpy(n,tolua_tostring(tolua_S,2,0),64-1); |
| 375 |
return 0; |
| 376 |
} |
| 377 |
|
| 378 |
/* get function: a */ |
| 379 |
static int tolua_get_a(lua_State* tolua_S) |
| 380 |
{ |
| 381 |
tolua_pushusertype(tolua_S,(void*)&a,"A"); |
| 382 |
return 1; |
| 383 |
} |
| 384 |
|
| 385 |
/* set function: a */ |
| 386 |
static int tolua_set_a(lua_State* tolua_S) |
| 387 |
{ |
| 388 |
#ifndef TOLUA_RELEASE |
| 389 |
tolua_Error tolua_err; |
| 390 |
if (!tolua_isusertype(tolua_S,2,"A",0,&tolua_err)) |
| 391 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 392 |
#endif |
| 393 |
a = *((A*) tolua_tousertype(tolua_S,2,0)); |
| 394 |
return 0; |
| 395 |
} |
| 396 |
|
| 397 |
/* get function: b */ |
| 398 |
static int tolua_get_b_ptr(lua_State* tolua_S) |
| 399 |
{ |
| 400 |
tolua_pushusertype(tolua_S,(void*)b,"B"); |
| 401 |
return 1; |
| 402 |
} |
| 403 |
|
| 404 |
/* set function: b */ |
| 405 |
static int tolua_set_b_ptr(lua_State* tolua_S) |
| 406 |
{ |
| 407 |
#ifndef TOLUA_RELEASE |
| 408 |
tolua_Error tolua_err; |
| 409 |
if (!tolua_isusertype(tolua_S,2,"B",0,&tolua_err)) |
| 410 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 411 |
#endif |
| 412 |
b = ((B*) tolua_tousertype(tolua_S,2,0)); |
| 413 |
return 0; |
| 414 |
} |
| 415 |
|
| 416 |
/* get function: u */ |
| 417 |
static int tolua_get_u(lua_State* tolua_S) |
| 418 |
{ |
| 419 |
tolua_pushusertype(tolua_S,(void*)&u,"U"); |
| 420 |
return 1; |
| 421 |
} |
| 422 |
|
| 423 |
/* set function: u */ |
| 424 |
static int tolua_set_u(lua_State* tolua_S) |
| 425 |
{ |
| 426 |
#ifndef TOLUA_RELEASE |
| 427 |
tolua_Error tolua_err; |
| 428 |
if (!tolua_isusertype(tolua_S,2,"U",0,&tolua_err)) |
| 429 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 430 |
#endif |
| 431 |
u = *((U*) tolua_tousertype(tolua_S,2,0)); |
| 432 |
return 0; |
| 433 |
} |
| 434 |
|
| 435 |
/* get function: mi */ |
| 436 |
static int tolua_get_M_mi(lua_State* tolua_S) |
| 437 |
{ |
| 438 |
tolua_pushnumber(tolua_S,(double)mi); |
| 439 |
return 1; |
| 440 |
} |
| 441 |
|
| 442 |
/* set function: mi */ |
| 443 |
static int tolua_set_M_mi(lua_State* tolua_S) |
| 444 |
{ |
| 445 |
#ifndef TOLUA_RELEASE |
| 446 |
tolua_Error tolua_err; |
| 447 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 448 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 449 |
#endif |
| 450 |
mi = ((int) tolua_tonumber(tolua_S,2,0)); |
| 451 |
return 0; |
| 452 |
} |
| 453 |
|
| 454 |
/* get function: mf */ |
| 455 |
static int tolua_get_M_mf(lua_State* tolua_S) |
| 456 |
{ |
| 457 |
tolua_pushnumber(tolua_S,(double)mf); |
| 458 |
return 1; |
| 459 |
} |
| 460 |
|
| 461 |
/* set function: mf */ |
| 462 |
static int tolua_set_M_mf(lua_State* tolua_S) |
| 463 |
{ |
| 464 |
#ifndef TOLUA_RELEASE |
| 465 |
tolua_Error tolua_err; |
| 466 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 467 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 468 |
#endif |
| 469 |
mf = ((float) tolua_tonumber(tolua_S,2,0)); |
| 470 |
return 0; |
| 471 |
} |
| 472 |
|
| 473 |
/* get function: md */ |
| 474 |
static int tolua_get_M_md(lua_State* tolua_S) |
| 475 |
{ |
| 476 |
tolua_pushnumber(tolua_S,(double)md); |
| 477 |
return 1; |
| 478 |
} |
| 479 |
|
| 480 |
/* set function: md */ |
| 481 |
static int tolua_set_M_md(lua_State* tolua_S) |
| 482 |
{ |
| 483 |
#ifndef TOLUA_RELEASE |
| 484 |
tolua_Error tolua_err; |
| 485 |
if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) |
| 486 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 487 |
#endif |
| 488 |
md = ((double) tolua_tonumber(tolua_S,2,0)); |
| 489 |
return 0; |
| 490 |
} |
| 491 |
|
| 492 |
/* get function: ms */ |
| 493 |
static int tolua_get_M_ms(lua_State* tolua_S) |
| 494 |
{ |
| 495 |
tolua_pushstring(tolua_S,(const char*)ms); |
| 496 |
return 1; |
| 497 |
} |
| 498 |
|
| 499 |
/* get function: mv */ |
| 500 |
static int tolua_get_M_mv(lua_State* tolua_S) |
| 501 |
{ |
| 502 |
tolua_pushuserdata(tolua_S,(void*)mv); |
| 503 |
return 1; |
| 504 |
} |
| 505 |
|
| 506 |
/* set function: mv */ |
| 507 |
static int tolua_set_M_mv(lua_State* tolua_S) |
| 508 |
{ |
| 509 |
#ifndef TOLUA_RELEASE |
| 510 |
tolua_Error tolua_err; |
| 511 |
if (!tolua_isuserdata(tolua_S,2,0,&tolua_err)) |
| 512 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 513 |
#endif |
| 514 |
mv = ((void*) tolua_touserdata(tolua_S,2,0)); |
| 515 |
return 0; |
| 516 |
} |
| 517 |
|
| 518 |
/* get function: mn */ |
| 519 |
static int tolua_get_M_mn(lua_State* tolua_S) |
| 520 |
{ |
| 521 |
tolua_pushstring(tolua_S,(const char*)mn); |
| 522 |
return 1; |
| 523 |
} |
| 524 |
|
| 525 |
/* get function: a */ |
| 526 |
static int tolua_get_M_a(lua_State* tolua_S) |
| 527 |
{ |
| 528 |
tolua_pushusertype(tolua_S,(void*)&a,"A"); |
| 529 |
return 1; |
| 530 |
} |
| 531 |
|
| 532 |
/* set function: a */ |
| 533 |
static int tolua_set_M_a(lua_State* tolua_S) |
| 534 |
{ |
| 535 |
#ifndef TOLUA_RELEASE |
| 536 |
tolua_Error tolua_err; |
| 537 |
if (!tolua_isusertype(tolua_S,2,"A",0,&tolua_err)) |
| 538 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 539 |
#endif |
| 540 |
a = *((A*) tolua_tousertype(tolua_S,2,0)); |
| 541 |
return 0; |
| 542 |
} |
| 543 |
|
| 544 |
/* get function: ma */ |
| 545 |
static int tolua_get_M_ma(lua_State* tolua_S) |
| 546 |
{ |
| 547 |
tolua_pushusertype(tolua_S,(void*)&ma,"A"); |
| 548 |
return 1; |
| 549 |
} |
| 550 |
|
| 551 |
/* set function: ma */ |
| 552 |
static int tolua_set_M_ma(lua_State* tolua_S) |
| 553 |
{ |
| 554 |
#ifndef TOLUA_RELEASE |
| 555 |
tolua_Error tolua_err; |
| 556 |
if (!tolua_isusertype(tolua_S,2,"A",0,&tolua_err)) |
| 557 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 558 |
#endif |
| 559 |
ma = *((A*) tolua_tousertype(tolua_S,2,0)); |
| 560 |
return 0; |
| 561 |
} |
| 562 |
|
| 563 |
/* get function: mb */ |
| 564 |
static int tolua_get_M_mb_ptr(lua_State* tolua_S) |
| 565 |
{ |
| 566 |
tolua_pushusertype(tolua_S,(void*)mb,"B"); |
| 567 |
return 1; |
| 568 |
} |
| 569 |
|
| 570 |
/* set function: mb */ |
| 571 |
static int tolua_set_M_mb_ptr(lua_State* tolua_S) |
| 572 |
{ |
| 573 |
#ifndef TOLUA_RELEASE |
| 574 |
tolua_Error tolua_err; |
| 575 |
if (!tolua_isusertype(tolua_S,2,"B",0,&tolua_err)) |
| 576 |
tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); |
| 577 |
#endif |
| 578 |
mb = ((B*) tolua_tousertype(tolua_S,2,0)); |
| 579 |
return 0; |
| 580 |
} |
| 581 |
|
| 582 |
/* Open function */ |
| 583 |
TOLUA_API int tolua_tvariable_open (lua_State* tolua_S) |
| 584 |
{ |
| 585 |
tolua_open(tolua_S); |
| 586 |
tolua_reg_types(tolua_S); |
| 587 |
tolua_module(tolua_S,NULL,1); |
| 588 |
tolua_beginmodule(tolua_S,NULL); |
| 589 |
tolua_cclass(tolua_S,"A","A","",NULL); |
| 590 |
tolua_beginmodule(tolua_S,"A"); |
| 591 |
tolua_variable(tolua_S,"i",tolua_get_A_i,tolua_set_A_i); |
| 592 |
tolua_variable(tolua_S,"f",tolua_get_A_f,tolua_set_A_f); |
| 593 |
tolua_variable(tolua_S,"d",tolua_get_A_d,tolua_set_A_d); |
| 594 |
tolua_variable(tolua_S,"s",tolua_get_A_s,tolua_set_A_s); |
| 595 |
tolua_variable(tolua_S,"v",tolua_get_A_v,tolua_set_A_v); |
| 596 |
tolua_variable(tolua_S,"n",tolua_get_A_n,tolua_set_A_n); |
| 597 |
tolua_endmodule(tolua_S); |
| 598 |
tolua_cclass(tolua_S,"B","B","",NULL); |
| 599 |
tolua_beginmodule(tolua_S,"B"); |
| 600 |
tolua_variable(tolua_S,"a",tolua_get_B_a,tolua_set_B_a); |
| 601 |
tolua_variable(tolua_S,"b",tolua_get_B_b_ptr,tolua_set_B_b_ptr); |
| 602 |
tolua_endmodule(tolua_S); |
| 603 |
tolua_cclass(tolua_S,"U","U","",NULL); |
| 604 |
tolua_beginmodule(tolua_S,"U"); |
| 605 |
tolua_variable(tolua_S,"i",tolua_get_U_i,tolua_set_U_i); |
| 606 |
tolua_variable(tolua_S,"f",tolua_get_U_f,tolua_set_U_f); |
| 607 |
tolua_endmodule(tolua_S); |
| 608 |
tolua_variable(tolua_S,"i",tolua_get_i,tolua_set_i); |
| 609 |
tolua_variable(tolua_S,"f",tolua_get_f,tolua_set_f); |
| 610 |
tolua_variable(tolua_S,"d",tolua_get_d,tolua_set_d); |
| 611 |
tolua_variable(tolua_S,"s",tolua_get_s,NULL); |
| 612 |
tolua_variable(tolua_S,"v",tolua_get_v,tolua_set_v); |
| 613 |
tolua_variable(tolua_S,"n",tolua_get_n,tolua_set_n); |
| 614 |
tolua_variable(tolua_S,"a",tolua_get_a,tolua_set_a); |
| 615 |
tolua_variable(tolua_S,"b",tolua_get_b_ptr,tolua_set_b_ptr); |
| 616 |
tolua_variable(tolua_S,"u",tolua_get_u,tolua_set_u); |
| 617 |
tolua_module(tolua_S,"M",1); |
| 618 |
tolua_beginmodule(tolua_S,"M"); |
| 619 |
tolua_variable(tolua_S,"mi",tolua_get_M_mi,tolua_set_M_mi); |
| 620 |
tolua_variable(tolua_S,"mf",tolua_get_M_mf,tolua_set_M_mf); |
| 621 |
tolua_variable(tolua_S,"md",tolua_get_M_md,tolua_set_M_md); |
| 622 |
tolua_variable(tolua_S,"ms",tolua_get_M_ms,NULL); |
| 623 |
tolua_variable(tolua_S,"mv",tolua_get_M_mv,tolua_set_M_mv); |
| 624 |
tolua_variable(tolua_S,"mn",tolua_get_M_mn,NULL); |
| 625 |
tolua_variable(tolua_S,"a",tolua_get_M_a,tolua_set_M_a); |
| 626 |
tolua_variable(tolua_S,"ma",tolua_get_M_ma,tolua_set_M_ma); |
| 627 |
tolua_variable(tolua_S,"mb",tolua_get_M_mb_ptr,tolua_set_M_mb_ptr); |
| 628 |
tolua_endmodule(tolua_S); |
| 629 |
tolua_endmodule(tolua_S); |
| 630 |
return 1; |
| 631 |
} |