Fawkes API
Fawkes Development Version
|
00001 /* 00002 ** Lua binding: fawkeslogging 00003 ** Generated automatically by tolua++-1.0.92 00004 */ 00005 /* This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. A runtime exception applies to 00009 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU Library General Public License for more details. 00015 * 00016 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00017 */ 00018 00019 #ifndef __cplusplus 00020 #include "stdlib.h" 00021 #endif 00022 #include "string.h" 00023 00024 #include "tolua++.h" 00025 00026 /* Exported function */ 00027 TOLUA_API int tolua_fawkeslogging_open (lua_State* tolua_S); 00028 00029 #include <logging/component.h> 00030 00031 /* function to register type */ 00032 static void tolua_reg_types (lua_State* tolua_S) 00033 { 00034 tolua_usertype(tolua_S,"fawkes::ComponentLogger"); 00035 } 00036 00037 /* method: log_debug of class fawkes::ComponentLogger */ 00038 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00 00039 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00(lua_State* tolua_S) 00040 { 00041 #ifndef TOLUA_RELEASE 00042 tolua_Error tolua_err; 00043 if ( 00044 !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) || 00045 !tolua_iscppstring(tolua_S,2,0,&tolua_err) || 00046 !tolua_isnoobj(tolua_S,3,&tolua_err) 00047 ) 00048 goto tolua_lerror; 00049 else 00050 #endif 00051 { 00052 fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0); 00053 std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0)); 00054 #ifndef TOLUA_RELEASE 00055 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_debug'", NULL); 00056 #endif 00057 { 00058 self->log_debug(message); 00059 } 00060 } 00061 return 0; 00062 #ifndef TOLUA_RELEASE 00063 tolua_lerror: 00064 tolua_error(tolua_S,"#ferror in function 'log_debug'.",&tolua_err); 00065 return 0; 00066 #endif 00067 } 00068 #endif //#ifndef TOLUA_DISABLE 00069 00070 /* method: log_info of class fawkes::ComponentLogger */ 00071 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_info00 00072 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_info00(lua_State* tolua_S) 00073 { 00074 #ifndef TOLUA_RELEASE 00075 tolua_Error tolua_err; 00076 if ( 00077 !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) || 00078 !tolua_iscppstring(tolua_S,2,0,&tolua_err) || 00079 !tolua_isnoobj(tolua_S,3,&tolua_err) 00080 ) 00081 goto tolua_lerror; 00082 else 00083 #endif 00084 { 00085 fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0); 00086 std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0)); 00087 #ifndef TOLUA_RELEASE 00088 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_info'", NULL); 00089 #endif 00090 { 00091 self->log_info(message); 00092 } 00093 } 00094 return 0; 00095 #ifndef TOLUA_RELEASE 00096 tolua_lerror: 00097 tolua_error(tolua_S,"#ferror in function 'log_info'.",&tolua_err); 00098 return 0; 00099 #endif 00100 } 00101 #endif //#ifndef TOLUA_DISABLE 00102 00103 /* method: log_warn of class fawkes::ComponentLogger */ 00104 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00 00105 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00(lua_State* tolua_S) 00106 { 00107 #ifndef TOLUA_RELEASE 00108 tolua_Error tolua_err; 00109 if ( 00110 !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) || 00111 !tolua_iscppstring(tolua_S,2,0,&tolua_err) || 00112 !tolua_isnoobj(tolua_S,3,&tolua_err) 00113 ) 00114 goto tolua_lerror; 00115 else 00116 #endif 00117 { 00118 fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0); 00119 std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0)); 00120 #ifndef TOLUA_RELEASE 00121 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_warn'", NULL); 00122 #endif 00123 { 00124 self->log_warn(message); 00125 } 00126 } 00127 return 0; 00128 #ifndef TOLUA_RELEASE 00129 tolua_lerror: 00130 tolua_error(tolua_S,"#ferror in function 'log_warn'.",&tolua_err); 00131 return 0; 00132 #endif 00133 } 00134 #endif //#ifndef TOLUA_DISABLE 00135 00136 /* method: log_error of class fawkes::ComponentLogger */ 00137 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_error00 00138 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_error00(lua_State* tolua_S) 00139 { 00140 #ifndef TOLUA_RELEASE 00141 tolua_Error tolua_err; 00142 if ( 00143 !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) || 00144 !tolua_iscppstring(tolua_S,2,0,&tolua_err) || 00145 !tolua_isnoobj(tolua_S,3,&tolua_err) 00146 ) 00147 goto tolua_lerror; 00148 else 00149 #endif 00150 { 00151 fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0); 00152 std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0)); 00153 #ifndef TOLUA_RELEASE 00154 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_error'", NULL); 00155 #endif 00156 { 00157 self->log_error(message); 00158 } 00159 } 00160 return 0; 00161 #ifndef TOLUA_RELEASE 00162 tolua_lerror: 00163 tolua_error(tolua_S,"#ferror in function 'log_error'.",&tolua_err); 00164 return 0; 00165 #endif 00166 } 00167 #endif //#ifndef TOLUA_DISABLE 00168 00169 /* Open function */ 00170 TOLUA_API int tolua_fawkeslogging_open (lua_State* tolua_S) 00171 { 00172 tolua_open(tolua_S); 00173 tolua_reg_types(tolua_S); 00174 tolua_module(tolua_S,NULL,0); 00175 tolua_beginmodule(tolua_S,NULL); 00176 tolua_module(tolua_S,"fawkes",0); 00177 tolua_beginmodule(tolua_S,"fawkes"); 00178 tolua_cclass(tolua_S,"ComponentLogger","fawkes::ComponentLogger","",NULL); 00179 tolua_beginmodule(tolua_S,"ComponentLogger"); 00180 tolua_function(tolua_S,"log_debug",tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00); 00181 tolua_function(tolua_S,"log_info",tolua_fawkeslogging_fawkes_ComponentLogger_log_info00); 00182 tolua_function(tolua_S,"log_warn",tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00); 00183 tolua_function(tolua_S,"log_error",tolua_fawkeslogging_fawkes_ComponentLogger_log_error00); 00184 tolua_endmodule(tolua_S); 00185 tolua_endmodule(tolua_S); 00186 tolua_endmodule(tolua_S); 00187 return 1; 00188 } 00189 00190 00191 extern "C" { 00192 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501 00193 TOLUA_API int luaopen_fawkeslogging (lua_State* tolua_S) { 00194 return tolua_fawkeslogging_open(tolua_S); 00195 }; 00196 #endif 00197 } 00198 00199