Skip to content

Commit

Permalink
Use LUA_FUNCTION_STATIC
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed May 31, 2024
1 parent f56c1b6 commit a0aa348
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 106 deletions.
20 changes: 10 additions & 10 deletions source/library_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,63 @@
#include <icommandline.h>
#include <eiface.h>

LUA_FUNCTION(engine_GetAddons)
LUA_FUNCTION_STATIC_STATIC(engine_GetAddons)
{
PushValue(LUA, GMOD->addons);

return 1;
}

LUA_FUNCTION(engine_GetUserContent) // Deprecated. If anyone wants to use it, tell me. Until then, I won't bother implementing it.
LUA_FUNCTION_STATIC(engine_GetUserContent) // Deprecated. If anyone wants to use it, tell me. Until then, I won't bother implementing it.
{
PushValue(LUA, GMOD->usercontent);

return 1;
}

LUA_FUNCTION(engine_GetGames)
LUA_FUNCTION_STATIC(engine_GetGames)
{
PushValue(LUA, GMOD->games);

return 1;
}

LUA_FUNCTION(engine_GetGamemodes)
LUA_FUNCTION_STATIC(engine_GetGamemodes)
{
PushValue(LUA, GMOD->gamemodes);

return 1;
}

LUA_FUNCTION(engine_ActiveGamemode)
LUA_FUNCTION_STATIC(engine_ActiveGamemode)
{
LUA->PushString(GMOD->active_gamemode);

return 1;
}

LUA_FUNCTION(engine_TickInterval)
LUA_FUNCTION_STATIC(engine_TickInterval)
{
LUA->PushNumber(gpGlobals->interval_per_tick);

return 1;
}

LUA_FUNCTION(engine_AbsoluteFrameTime)
LUA_FUNCTION_STATIC(engine_AbsoluteFrameTime)
{
LUA->PushNumber(gpGlobals->absoluteframetime);

return 1;
}

LUA_FUNCTION(engine_TickCount)
LUA_FUNCTION_STATIC(engine_TickCount)
{
LUA->PushNumber(gpGlobals->tickcount);

return 1;
}

LUA_FUNCTION(engine_CloseServer)
LUA_FUNCTION_STATIC(engine_CloseServer)
{
if (CommandLine()->FindParm("-systemtest"))
{
Expand All @@ -68,7 +68,7 @@ LUA_FUNCTION(engine_CloseServer)
return 0;
}

LUA_FUNCTION(engine_LightStyle)
LUA_FUNCTION_STATIC(engine_LightStyle)
{
int lightstyle = LUA->CheckNumber(1);
const char* pattern = LUA->CheckString(2);
Expand Down
20 changes: 10 additions & 10 deletions source/library_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void AsyncCallback(const FileAsyncRequest_t &request, int nBytesRead, FSAsyncSta
}
}

LUA_FUNCTION(file_AsyncRead)
LUA_FUNCTION_STATIC(file_AsyncRead)
{
ILuaThread* thread = GetValidThread(LUA, 1);
const char* fileName = LUA->CheckString(1);
Expand Down Expand Up @@ -72,21 +72,21 @@ void FileLibThink(ILuaThread* thread)
}
}

LUA_FUNCTION(file_CreateDir)
LUA_FUNCTION_STATIC(file_CreateDir)
{
filesystem->CreateDirHierarchy(LUA->CheckString(1), "DATA");

return 0;
}

LUA_FUNCTION(file_Delete)
LUA_FUNCTION_STATIC(file_Delete)
{
filesystem->RemoveFile(LUA->CheckString(1), "DATA");

return 0;
}

LUA_FUNCTION(file_Exists)
LUA_FUNCTION_STATIC(file_Exists)
{
LUA->PushBool(filesystem->FileExists(LUA->CheckString(1), LUA->CheckString(2)));

Expand Down Expand Up @@ -121,7 +121,7 @@ std::vector<std::string> SortByDate(std::vector<std::string> files, const char*
return files;
}

LUA_FUNCTION(file_Find)
LUA_FUNCTION_STATIC(file_Find)
{
std::vector<std::string> files;
std::vector<std::string> folders;
Expand Down Expand Up @@ -189,14 +189,14 @@ LUA_FUNCTION(file_Find)
return 2;
}

LUA_FUNCTION(file_IsDir)
LUA_FUNCTION_STATIC(file_IsDir)
{
LUA->PushBool(filesystem->IsDirectory(LUA->CheckString(1), LUA->CheckString(2)));

return 1;
}

LUA_FUNCTION(file_Open) // ToDo: Add the File class
LUA_FUNCTION_STATIC(file_Open) // ToDo: Add the File class
{
const char* filename = LUA->CheckString(1);
const char* fileMode = LUA->CheckString(2);
Expand All @@ -210,7 +210,7 @@ LUA_FUNCTION(file_Open) // ToDo: Add the File class
return 1;
}

LUA_FUNCTION(file_Rename)
LUA_FUNCTION_STATIC(file_Rename)
{
const char* original = LUA->CheckString(1);
const char* newname = LUA->CheckString(2);
Expand All @@ -220,7 +220,7 @@ LUA_FUNCTION(file_Rename)
return 1;
}

LUA_FUNCTION(file_Size)
LUA_FUNCTION_STATIC(file_Size)
{
const char* path = LUA->GetString(2);
if (path == NULL)
Expand All @@ -231,7 +231,7 @@ LUA_FUNCTION(file_Size)
return 1;
}

LUA_FUNCTION(file_Time)
LUA_FUNCTION_STATIC(file_Time)
{
const char* path = LUA->GetString(2);
if (path == NULL)
Expand Down

0 comments on commit a0aa348

Please sign in to comment.