From 045ec753fb97b0ab6d239c06caa0f2285c72afd7 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 3 May 2013 23:59:44 +0000 Subject: mainly source code formatting git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2982 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lua/ULuaLog.pas | 91 +++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 45 deletions(-) (limited to 'src/lua/ULuaLog.pas') diff --git a/src/lua/ULuaLog.pas b/src/lua/ULuaLog.pas index 95efaa19..561a9bae 100644 --- a/src/lua/ULuaLog.pas +++ b/src/lua/ULuaLog.pas @@ -57,111 +57,112 @@ function ULuaLog_SetLogLevel(L: Plua_State): Integer; cdecl; const ULuaLog_Lib_f: array [0..13] of lual_reg = ( - (name:'LogError';func:ULuaLog_LogError), - (name:'LogMsg';func:ULuaLog_LogMsg), - (name:'BenchmarkStart';func:ULuaLog_BenchmarkStart), - (name:'BenchmarkEnd';func:ULuaLog_BenchmarkEnd), - (name:'LogBenchmark';func:ULuaLog_LogBenchmark), - (name:'LogDebug';func:ULuaLog_LogDebug), - (name:'LogInfo';func:ULuaLog_LogInfo), - (name:'LogStatus';func:ULuaLog_LogStatus), - (name:'LogWarn';func:ULuaLog_LogWarn), - (name:'LogCritical';func:ULuaLog_LogCritical), - (name:'CriticalError';func:ULuaLog_CriticalError), - (name:'SetLogLevel';func:ULuaLog_GetLogLevel), - (name:'GetLogLevel';func:ULuaLog_SetLogLevel), - (name:nil;func:nil) - ); + (name:'LogError';func:ULuaLog_LogError), + (name:'LogMsg';func:ULuaLog_LogMsg), + (name:'BenchmarkStart';func:ULuaLog_BenchmarkStart), + (name:'BenchmarkEnd';func:ULuaLog_BenchmarkEnd), + (name:'LogBenchmark';func:ULuaLog_LogBenchmark), + (name:'LogDebug';func:ULuaLog_LogDebug), + (name:'LogInfo';func:ULuaLog_LogInfo), + (name:'LogStatus';func:ULuaLog_LogStatus), + (name:'LogWarn';func:ULuaLog_LogWarn), + (name:'LogCritical';func:ULuaLog_LogCritical), + (name:'CriticalError';func:ULuaLog_CriticalError), + (name:'SetLogLevel';func:ULuaLog_GetLogLevel), + (name:'GetLogLevel';func:ULuaLog_SetLogLevel), + (name:nil;func:nil) + ); implementation function ULuaLog_LogError(L: Plua_State): Integer; cdecl; begin if (lua_gettop(L) > 1) then - Log.LogError(luaL_checkstring(L,-2),luaL_checkstring(L,-1)) + Log.LogError(luaL_checkstring(L, -2), luaL_checkstring(L, -1)) else - Log.LogError(luaL_checkstring(L,-1)); - result:=0; // number of results + Log.LogError(luaL_checkstring(L, -1)); + result := 0; // number of results end; function ULuaLog_LogMsg(L: Plua_State): Integer; cdecl; begin if (lua_gettop(L) > 2) then - Log.LogMsg(luaL_checkstring(L,-3),luaL_checkstring(L,-1),luaL_checkinteger(L,-2)) + Log.LogMsg(luaL_checkstring(L, -3), luaL_checkstring(L, -1), luaL_checkinteger(L, -2)) else - Log.LogMsg(luaL_checkstring(L,-2),luaL_checkinteger(L,-1)); - result:=0; // number of results + Log.LogMsg(luaL_checkstring(L, -2), luaL_checkinteger(L, -1)); + result := 0; // number of results end; function ULuaLog_BenchmarkStart(L: Plua_State): Integer; cdecl; begin - Log.BenchmarkStart(luaL_checkinteger(L,-1)); - result:=0; // number of results + Log.BenchmarkStart(luaL_checkinteger(L, -1)); + result := 0; // number of results end; function ULuaLog_BenchmarkEnd(L: Plua_State): Integer; cdecl; begin - Log.BenchmarkEnd(luaL_checkinteger(L,-1)); - result:=0; // number of results + Log.BenchmarkEnd(luaL_checkinteger(L, -1)); + result := 0; // number of results end; function ULuaLog_LogBenchmark(L: Plua_State): Integer; cdecl; begin - Log.LogBenchmark(luaL_checkstring(L,-2),luaL_checkinteger(L,-1)); - result:=0; // number of results + Log.LogBenchmark(luaL_checkstring(L, -2), luaL_checkinteger(L, -1)); + result := 0; // number of results end; function ULuaLog_LogDebug(L: Plua_State): Integer; cdecl; begin - Log.LogDebug(luaL_checkstring(L,-2),luaL_checkstring(L,-1)); - result:=0; // number of results + Log.LogDebug(luaL_checkstring(L, -2), luaL_checkstring(L, -1)); + result := 0; // number of results end; function ULuaLog_LogInfo(L: Plua_State): Integer; cdecl; begin - Log.LogInfo(luaL_checkstring(L,-2),luaL_checkstring(L,-1)); - result:=0; // number of results + Log.LogInfo(luaL_checkstring(L, -2), luaL_checkstring(L, -1)); + result := 0; // number of results end; function ULuaLog_LogStatus(L: Plua_State): Integer; cdecl; begin - Log.LogStatus(luaL_checkstring(L,-2),luaL_checkstring(L,-1)); - result:=0; // number of results + Log.LogStatus(luaL_checkstring(L, -2), luaL_checkstring(L, -1)); + result := 0; // number of results end; function ULuaLog_LogWarn(L: Plua_State): Integer; cdecl; begin - Log.LogWarn(luaL_checkstring(L,-2),luaL_checkstring(L,-1)); - result:=0; // number of results + Log.LogWarn(luaL_checkstring(L, -2), luaL_checkstring(L, -1)); + result := 0; // number of results end; function ULuaLog_LogCritical(L: Plua_State): Integer; cdecl; begin - Log.LogCritical(luaL_checkstring(L,-2),luaL_checkstring(L,-1)); - result:=0; // number of results + Log.LogCritical(luaL_checkstring(L, -2), luaL_checkstring(L, -1)); + result := 0; // number of results end; function ULuaLog_CriticalError(L: Plua_State): Integer; cdecl; begin - Log.CriticalError(luaL_checkstring(L,-1)); - result:=0; // number of results + Log.CriticalError(luaL_checkstring(L, -1)); + result := 0; // number of results end; function ULuaLog_GetLogLevel(L: Plua_State): Integer; cdecl; begin - lua_pushinteger(L,Log.GetLogLevel()); - result:=1; // number of results + lua_pushinteger(L, Log.GetLogLevel()); + result := 1; // number of results end; function ULuaLog_SetLogLevel(L: Plua_State): Integer; cdecl; begin - Log.SetLogLevel(luaL_checkinteger(L,-1)); - result:=0; // number of results + Log.SetLogLevel(luaL_checkinteger(L, -1)); + result := 0; // number of results end; function luaopen_Log (L: Plua_State): Integer; cdecl; begin - luaL_register(L,'Log',@ULuaLog_Lib_f[0]); - result:=1; + luaL_register(L, 'Log', @ULuaLog_Lib_f[0]); + result := 1; end; + end. -- cgit v1.2.3