mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-11-23 22:39:39 +00:00
[bot] Implement SignalHandler, GetTickCount, strlwr
This commit is contained in:
parent
04dece8c8b
commit
37bc99154a
33
bot/main.cpp
33
bot/main.cpp
@ -140,3 +140,36 @@ void SetStringFromCommandLine(char* szCmdLine, char* szString)
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
#ifdef LINUX
|
||||
|
||||
void SignalHandler(int sig)
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
#include <time.h>
|
||||
|
||||
long GetTickCount()
|
||||
{
|
||||
tms tm;
|
||||
return (times(&tm) * 10);
|
||||
}
|
||||
|
||||
// strlwr is not included with the GNU C lib it seems.
|
||||
char* strlwr(char* str)
|
||||
{
|
||||
for (size_t i=0; i<strlen(str); i++)
|
||||
{
|
||||
if ((str[i] >= 'A') && (str[i] <= 'Z'))
|
||||
{
|
||||
str[i] -= 32;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------
|
||||
|
@ -33,3 +33,9 @@ typedef struct _GAME_SETTINGS {
|
||||
#include "net/netgame.h"
|
||||
|
||||
void logprintf(char* format, ...);
|
||||
|
||||
#ifdef LINUX
|
||||
void SignalHandler(int sig);
|
||||
long GetTickCount();
|
||||
char* strlwr(char* str);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user