Debian Codegraph @

3rdparty/toluapp/src/tests/tmodulebind.c

raw
1 /*
2 ** Lua binding: tmodule
3 ** Generated automatically by tolua 5.0a-CDLVS2 on 08/08/03 17:06:13.
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_tmodule_open (lua_State* tolua_S);
15
16 #include "tmodule.h"
17
18 /* function to register type */
19 static void tolua_reg_types (lua_State* tolua_S)
20 {
21 }
22
23 /* get function: a */
24 static int tolua_get_A_a(lua_State* tolua_S)
25 {
26 tolua_pushnumber(tolua_S,(double)a);
27 return 1;
28 }
29
30 /* set function: a */
31 static int tolua_set_A_a(lua_State* tolua_S)
32 {
33 #ifndef TOLUA_RELEASE
34 tolua_Error tolua_err;
35 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
36 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
37 #endif
38 a = ((int) tolua_tonumber(tolua_S,2,0));
39 return 0;
40 }
41
42 /* get function: b */
43 static int tolua_get_B_b(lua_State* tolua_S)
44 {
45 tolua_pushnumber(tolua_S,(double)b);
46 return 1;
47 }
48
49 /* set function: b */
50 static int tolua_set_B_b(lua_State* tolua_S)
51 {
52 #ifndef TOLUA_RELEASE
53 tolua_Error tolua_err;
54 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
55 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
56 #endif
57 b = ((int) tolua_tonumber(tolua_S,2,0));
58 return 0;
59 }
60
61 /* get function: c */
62 static int tolua_get_C_c(lua_State* tolua_S)
63 {
64 tolua_pushnumber(tolua_S,(double)c);
65 return 1;
66 }
67
68 /* set function: c */
69 static int tolua_set_C_c(lua_State* tolua_S)
70 {
71 #ifndef TOLUA_RELEASE
72 tolua_Error tolua_err;
73 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
74 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
75 #endif
76 c = ((int) tolua_tonumber(tolua_S,2,0));
77 return 0;
78 }
79
80 /* get function: d */
81 static int tolua_get_A_d(lua_State* tolua_S)
82 {
83 tolua_pushnumber(tolua_S,(double)d);
84 return 1;
85 }
86
87 /* set function: d */
88 static int tolua_set_A_d(lua_State* tolua_S)
89 {
90 #ifndef TOLUA_RELEASE
91 tolua_Error tolua_err;
92 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
93 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
94 #endif
95 d = ((int) tolua_tonumber(tolua_S,2,0));
96 return 0;
97 }
98
99 /* Open function */
100 TOLUA_API int tolua_tmodule_open (lua_State* tolua_S)
101 {
102 tolua_open(tolua_S);
103 tolua_reg_types(tolua_S);
104 tolua_module(tolua_S,NULL,0);
105 tolua_beginmodule(tolua_S,NULL);
106 tolua_module(tolua_S,"A",1);
107 tolua_beginmodule(tolua_S,"A");
108 tolua_variable(tolua_S,"a",tolua_get_A_a,tolua_set_A_a);
109 tolua_module(tolua_S,"B",1);
110 tolua_beginmodule(tolua_S,"B");
111 tolua_variable(tolua_S,"b",tolua_get_B_b,tolua_set_B_b);
112 tolua_module(tolua_S,"C",1);
113 tolua_beginmodule(tolua_S,"C");
114 tolua_variable(tolua_S,"c",tolua_get_C_c,tolua_set_C_c);
115 tolua_endmodule(tolua_S);
116 tolua_endmodule(tolua_S);
117 tolua_endmodule(tolua_S);
118 tolua_module(tolua_S,"A",1);
119 tolua_beginmodule(tolua_S,"A");
120 tolua_variable(tolua_S,"d",tolua_get_A_d,tolua_set_A_d);
121 tolua_endmodule(tolua_S);
122 tolua_endmodule(tolua_S);
123 return 1;
124 }