/script_binding/lua/lua_ftk_source.c

http://ftk.googlecode.com/ · 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. static void tolua_reg_types (lua_State* L)
  5. {
  6. tolua_usertype(L, "FtkSource");
  7. }
  8. static int lua_ftk_source_disable(lua_State* L)
  9. {
  10. tolua_Error err = {0};
  11. Ret retv;
  12. FtkSource* thiz;
  13. int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
  14. return_val_if_fail(param_ok, 0);
  15. thiz = tolua_tousertype(L, 1, 0);
  16. retv = ftk_source_disable(thiz);
  17. tolua_pushnumber(L, (lua_Number)retv);
  18. return 1;
  19. }
  20. static int lua_ftk_source_enable(lua_State* L)
  21. {
  22. tolua_Error err = {0};
  23. Ret retv;
  24. FtkSource* thiz;
  25. int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
  26. return_val_if_fail(param_ok, 0);
  27. thiz = tolua_tousertype(L, 1, 0);
  28. retv = ftk_source_enable(thiz);
  29. tolua_pushnumber(L, (lua_Number)retv);
  30. return 1;
  31. }
  32. static int lua_ftk_source_get_fd(lua_State* L)
  33. {
  34. tolua_Error err = {0};
  35. int retv;
  36. FtkSource* thiz;
  37. int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
  38. return_val_if_fail(param_ok, 0);
  39. thiz = tolua_tousertype(L, 1, 0);
  40. retv = ftk_source_get_fd(thiz);
  41. tolua_pushnumber(L, (lua_Number)retv);
  42. return 1;
  43. }
  44. static int lua_ftk_source_check(lua_State* L)
  45. {
  46. tolua_Error err = {0};
  47. int retv;
  48. FtkSource* thiz;
  49. int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
  50. return_val_if_fail(param_ok, 0);
  51. thiz = tolua_tousertype(L, 1, 0);
  52. retv = ftk_source_check(thiz);
  53. tolua_pushnumber(L, (lua_Number)retv);
  54. return 1;
  55. }
  56. static int lua_ftk_source_dispatch(lua_State* L)
  57. {
  58. tolua_Error err = {0};
  59. Ret retv;
  60. FtkSource* thiz;
  61. int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
  62. return_val_if_fail(param_ok, 0);
  63. thiz = tolua_tousertype(L, 1, 0);
  64. retv = ftk_source_dispatch(thiz);
  65. tolua_pushnumber(L, (lua_Number)retv);
  66. return 1;
  67. }
  68. static int lua_ftk_source_destroy(lua_State* L)
  69. {
  70. tolua_Error err = {0};
  71. FtkSource* thiz;
  72. int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
  73. return_val_if_fail(param_ok, 0);
  74. thiz = tolua_tousertype(L, 1, 0);
  75. ftk_source_destroy(thiz);
  76. return 1;
  77. }
  78. static int lua_ftk_source_ref(lua_State* L)
  79. {
  80. tolua_Error err = {0};
  81. FtkSource* thiz;
  82. int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
  83. return_val_if_fail(param_ok, 0);
  84. thiz = tolua_tousertype(L, 1, 0);
  85. ftk_source_ref(thiz);
  86. return 1;
  87. }
  88. static int lua_ftk_source_unref(lua_State* L)
  89. {
  90. tolua_Error err = {0};
  91. FtkSource* thiz;
  92. int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
  93. return_val_if_fail(param_ok, 0);
  94. thiz = tolua_tousertype(L, 1, 0);
  95. ftk_source_unref(thiz);
  96. return 1;
  97. }
  98. int tolua_ftk_source_init(lua_State* L)
  99. {
  100. tolua_open(L);
  101. tolua_reg_types(L);
  102. tolua_module(L, NULL, 0);
  103. tolua_beginmodule(L, NULL);
  104. tolua_cclass(L,"FtkSource", "FtkSource", "", NULL);
  105. tolua_beginmodule(L, "FtkSource");
  106. tolua_function(L, "Disable", lua_ftk_source_disable);
  107. tolua_function(L, "Enable", lua_ftk_source_enable);
  108. tolua_function(L, "GetFd", lua_ftk_source_get_fd);
  109. tolua_function(L, "Check", lua_ftk_source_check);
  110. tolua_function(L, "Dispatch", lua_ftk_source_dispatch);
  111. tolua_function(L, "Destroy", lua_ftk_source_destroy);
  112. tolua_function(L, "Ref", lua_ftk_source_ref);
  113. tolua_function(L, "Unref", lua_ftk_source_unref);
  114. tolua_endmodule(L);
  115. tolua_endmodule(L);
  116. return 1;
  117. }