/script_binding/lua/lua_ftk_source.c
C | 153 lines | 116 code | 36 blank | 1 comment | 0 complexity | 624b19304fa848514ead8687a2ab4606 MD5 | raw file
1/*This file is generated by luagen.*/ 2#include "lua_ftk_source.h" 3#include "lua_ftk_callbacks.h" 4 5static void tolua_reg_types (lua_State* L) 6{ 7 tolua_usertype(L, "FtkSource"); 8} 9 10static int lua_ftk_source_disable(lua_State* L) 11{ 12 tolua_Error err = {0}; 13 Ret retv; 14 FtkSource* thiz; 15 int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err); 16 17 return_val_if_fail(param_ok, 0); 18 19 thiz = tolua_tousertype(L, 1, 0); 20 retv = ftk_source_disable(thiz); 21 tolua_pushnumber(L, (lua_Number)retv); 22 23 return 1; 24} 25 26static int lua_ftk_source_enable(lua_State* L) 27{ 28 tolua_Error err = {0}; 29 Ret retv; 30 FtkSource* thiz; 31 int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err); 32 33 return_val_if_fail(param_ok, 0); 34 35 thiz = tolua_tousertype(L, 1, 0); 36 retv = ftk_source_enable(thiz); 37 tolua_pushnumber(L, (lua_Number)retv); 38 39 return 1; 40} 41 42static int lua_ftk_source_get_fd(lua_State* L) 43{ 44 tolua_Error err = {0}; 45 int retv; 46 FtkSource* thiz; 47 int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err); 48 49 return_val_if_fail(param_ok, 0); 50 51 thiz = tolua_tousertype(L, 1, 0); 52 retv = ftk_source_get_fd(thiz); 53 tolua_pushnumber(L, (lua_Number)retv); 54 55 return 1; 56} 57 58static int lua_ftk_source_check(lua_State* L) 59{ 60 tolua_Error err = {0}; 61 int retv; 62 FtkSource* thiz; 63 int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err); 64 65 return_val_if_fail(param_ok, 0); 66 67 thiz = tolua_tousertype(L, 1, 0); 68 retv = ftk_source_check(thiz); 69 tolua_pushnumber(L, (lua_Number)retv); 70 71 return 1; 72} 73 74static int lua_ftk_source_dispatch(lua_State* L) 75{ 76 tolua_Error err = {0}; 77 Ret retv; 78 FtkSource* thiz; 79 int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err); 80 81 return_val_if_fail(param_ok, 0); 82 83 thiz = tolua_tousertype(L, 1, 0); 84 retv = ftk_source_dispatch(thiz); 85 tolua_pushnumber(L, (lua_Number)retv); 86 87 return 1; 88} 89 90static int lua_ftk_source_destroy(lua_State* L) 91{ 92 tolua_Error err = {0}; 93 FtkSource* thiz; 94 int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err); 95 96 return_val_if_fail(param_ok, 0); 97 98 thiz = tolua_tousertype(L, 1, 0); 99 ftk_source_destroy(thiz); 100 101 return 1; 102} 103 104static int lua_ftk_source_ref(lua_State* L) 105{ 106 tolua_Error err = {0}; 107 FtkSource* thiz; 108 int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err); 109 110 return_val_if_fail(param_ok, 0); 111 112 thiz = tolua_tousertype(L, 1, 0); 113 ftk_source_ref(thiz); 114 115 return 1; 116} 117 118static int lua_ftk_source_unref(lua_State* L) 119{ 120 tolua_Error err = {0}; 121 FtkSource* thiz; 122 int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err); 123 124 return_val_if_fail(param_ok, 0); 125 126 thiz = tolua_tousertype(L, 1, 0); 127 ftk_source_unref(thiz); 128 129 return 1; 130} 131 132int tolua_ftk_source_init(lua_State* L) 133{ 134 tolua_open(L); 135 tolua_reg_types(L); 136 tolua_module(L, NULL, 0); 137 tolua_beginmodule(L, NULL); 138 tolua_cclass(L,"FtkSource", "FtkSource", "", NULL); 139 tolua_beginmodule(L, "FtkSource"); 140 tolua_function(L, "Disable", lua_ftk_source_disable); 141 tolua_function(L, "Enable", lua_ftk_source_enable); 142 tolua_function(L, "GetFd", lua_ftk_source_get_fd); 143 tolua_function(L, "Check", lua_ftk_source_check); 144 tolua_function(L, "Dispatch", lua_ftk_source_dispatch); 145 tolua_function(L, "Destroy", lua_ftk_source_destroy); 146 tolua_function(L, "Ref", lua_ftk_source_ref); 147 tolua_function(L, "Unref", lua_ftk_source_unref); 148 tolua_endmodule(L); 149 tolua_endmodule(L); 150 151 152 return 1; 153}