Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/core/tolua/tolua_bind.cc @ 1037

Last change on this file since 1037 was 1037, checked in by landauf, 16 years ago

moved tolua from util to core because of circular dependencies
reverted some bugfixes in ParticleInterface

File size: 2.8 KB
Line 
1/*
2** Lua binding: orxonox
3** Generated automatically by tolua++-1.0.92 on Sun Apr  6 15:44:17 2008.
4*/
5
6#ifndef __cplusplus
7#include "stdlib.h"
8#endif
9#include "string.h"
10
11#include "tolua++.h"
12
13/* Exported function */
14TOLUA_API int  tolua_orxonox_open (lua_State* tolua_S);
15
16#include "../Script.h"
17
18/* function to register type */
19static void tolua_reg_types (lua_State* tolua_S)
20{
21 tolua_usertype(tolua_S,"orxonox::Script");
22}
23
24/* method: getInstance of class  orxonox::Script */
25#ifndef TOLUA_DISABLE_tolua_orxonox_orxonox_Script_getInstance00
26static int tolua_orxonox_orxonox_Script_getInstance00(lua_State* tolua_S)
27{
28#ifndef TOLUA_RELEASE
29 tolua_Error tolua_err;
30 if (
31     !tolua_isusertable(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
32     !tolua_isnoobj(tolua_S,2,&tolua_err)
33 )
34  goto tolua_lerror;
35 else
36#endif
37 {
38  {
39   orxonox::Script* tolua_ret = (orxonox::Script*)  orxonox::Script::getInstance();
40    tolua_pushusertype(tolua_S,(void*)tolua_ret,"orxonox::Script");
41  }
42 }
43 return 1;
44#ifndef TOLUA_RELEASE
45 tolua_lerror:
46 tolua_error(tolua_S,"#ferror in function 'getInstance'.",&tolua_err);
47 return 0;
48#endif
49}
50#endif //#ifndef TOLUA_DISABLE
51
52/* method: luaPrint of class  orxonox::Script */
53#ifndef TOLUA_DISABLE_tolua_orxonox_orxonox_Script_luaPrint00
54static int tolua_orxonox_orxonox_Script_luaPrint00(lua_State* tolua_S)
55{
56#ifndef TOLUA_RELEASE
57 tolua_Error tolua_err;
58 if (
59     !tolua_isusertype(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
60     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
61     !tolua_isnoobj(tolua_S,3,&tolua_err)
62 )
63  goto tolua_lerror;
64 else
65#endif
66 {
67  orxonox::Script* self = (orxonox::Script*)  tolua_tousertype(tolua_S,1,0);
68  std::string str = ((std::string)  tolua_tocppstring(tolua_S,2,0));
69#ifndef TOLUA_RELEASE
70  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'luaPrint'",NULL);
71#endif
72  {
73   self->luaPrint(str);
74  }
75 }
76 return 0;
77#ifndef TOLUA_RELEASE
78 tolua_lerror:
79 tolua_error(tolua_S,"#ferror in function 'luaPrint'.",&tolua_err);
80 return 0;
81#endif
82}
83#endif //#ifndef TOLUA_DISABLE
84
85/* Open function */
86TOLUA_API int tolua_orxonox_open (lua_State* tolua_S)
87{
88 tolua_open(tolua_S);
89 tolua_reg_types(tolua_S);
90 tolua_module(tolua_S,NULL,0);
91 tolua_beginmodule(tolua_S,NULL);
92  tolua_module(tolua_S,"orxonox",0);
93  tolua_beginmodule(tolua_S,"orxonox");
94   tolua_cclass(tolua_S,"Script","orxonox::Script","",NULL);
95   tolua_beginmodule(tolua_S,"Script");
96    tolua_function(tolua_S,"getInstance",tolua_orxonox_orxonox_Script_getInstance00);
97    tolua_function(tolua_S,"luaPrint",tolua_orxonox_orxonox_Script_luaPrint00);
98   tolua_endmodule(tolua_S);
99  tolua_endmodule(tolua_S);
100 tolua_endmodule(tolua_S);
101 return 1;
102}
103
104
105#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
106 TOLUA_API int luaopen_orxonox (lua_State* tolua_S) {
107 return tolua_orxonox_open(tolua_S);
108};
109#endif
110
Note: See TracBrowser for help on using the repository browser.