Logger.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // Copyright (C) 2009-2020, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. // WARNING: This file is auto generated.
  6. #include <anki/script/LuaBinder.h>
  7. namespace anki
  8. {
  9. /// Pre-wrap function logi.
  10. static inline int pwraplogi(lua_State* l)
  11. {
  12. LuaUserData* ud;
  13. (void)ud;
  14. void* voidp;
  15. (void)voidp;
  16. PtrSize size;
  17. (void)size;
  18. if(ANKI_UNLIKELY(LuaBinder::checkArgsCount(l, 1)))
  19. {
  20. return -1;
  21. }
  22. // Pop arguments
  23. const char* arg0;
  24. if(ANKI_UNLIKELY(LuaBinder::checkString(l, 1, arg0)))
  25. {
  26. return -1;
  27. }
  28. // Call the function
  29. ANKI_SCRIPT_LOGI("%s", arg0);
  30. return 0;
  31. }
  32. /// Wrap function logi.
  33. static int wraplogi(lua_State* l)
  34. {
  35. int res = pwraplogi(l);
  36. if(res >= 0)
  37. {
  38. return res;
  39. }
  40. lua_error(l);
  41. return 0;
  42. }
  43. /// Pre-wrap function loge.
  44. static inline int pwraploge(lua_State* l)
  45. {
  46. LuaUserData* ud;
  47. (void)ud;
  48. void* voidp;
  49. (void)voidp;
  50. PtrSize size;
  51. (void)size;
  52. if(ANKI_UNLIKELY(LuaBinder::checkArgsCount(l, 1)))
  53. {
  54. return -1;
  55. }
  56. // Pop arguments
  57. const char* arg0;
  58. if(ANKI_UNLIKELY(LuaBinder::checkString(l, 1, arg0)))
  59. {
  60. return -1;
  61. }
  62. // Call the function
  63. ANKI_SCRIPT_LOGE("%s", arg0);
  64. return 0;
  65. }
  66. /// Wrap function loge.
  67. static int wraploge(lua_State* l)
  68. {
  69. int res = pwraploge(l);
  70. if(res >= 0)
  71. {
  72. return res;
  73. }
  74. lua_error(l);
  75. return 0;
  76. }
  77. /// Pre-wrap function logw.
  78. static inline int pwraplogw(lua_State* l)
  79. {
  80. LuaUserData* ud;
  81. (void)ud;
  82. void* voidp;
  83. (void)voidp;
  84. PtrSize size;
  85. (void)size;
  86. if(ANKI_UNLIKELY(LuaBinder::checkArgsCount(l, 1)))
  87. {
  88. return -1;
  89. }
  90. // Pop arguments
  91. const char* arg0;
  92. if(ANKI_UNLIKELY(LuaBinder::checkString(l, 1, arg0)))
  93. {
  94. return -1;
  95. }
  96. // Call the function
  97. ANKI_SCRIPT_LOGW("%s", arg0);
  98. return 0;
  99. }
  100. /// Wrap function logw.
  101. static int wraplogw(lua_State* l)
  102. {
  103. int res = pwraplogw(l);
  104. if(res >= 0)
  105. {
  106. return res;
  107. }
  108. lua_error(l);
  109. return 0;
  110. }
  111. /// Wrap the module.
  112. void wrapModuleLogger(lua_State* l)
  113. {
  114. LuaBinder::pushLuaCFunc(l, "logi", wraplogi);
  115. LuaBinder::pushLuaCFunc(l, "loge", wraploge);
  116. LuaBinder::pushLuaCFunc(l, "logw", wraplogw);
  117. }
  118. } // end namespace anki