Logger.cpp 2.1 KB

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