summaryrefslogtreecommitdiff
path: root/src/login/loginlog.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-06-24 05:19:37 +0200
committerHaru <haru@dotalux.com>2018-07-01 21:09:25 +0200
commit4552fc0eab5cd9b723180a12d4ef50f7fe998b55 (patch)
treeb57573940e5bd1922deb9fcb5d05f6941cbf7109 /src/login/loginlog.c
parent2e89d5b2824801ed49c62db9f6743f32593018bc (diff)
downloadhercules-4552fc0eab5cd9b723180a12d4ef50f7fe998b55.tar.gz
hercules-4552fc0eab5cd9b723180a12d4ef50f7fe998b55.tar.bz2
hercules-4552fc0eab5cd9b723180a12d4ef50f7fe998b55.tar.xz
hercules-4552fc0eab5cd9b723180a12d4ef50f7fe998b55.zip
Change functions to static where possible (Part 2 - login)
This fixes issues with plugins defining symbols with the same names Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/login/loginlog.c')
-rw-r--r--src/login/loginlog.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/login/loginlog.c b/src/login/loginlog.c
index bf40d6ed8..19f269ab5 100644
--- a/src/login/loginlog.c
+++ b/src/login/loginlog.c
@@ -34,13 +34,13 @@
#include <stdlib.h> // exit
-struct loginlog_interface loginlog_s;
+static struct loginlog_interface loginlog_s;
struct loginlog_interface *loginlog;
-struct s_loginlog_dbs loginlogdbs;
+static struct s_loginlog_dbs loginlogdbs;
// Returns the number of failed login attempts by the ip in the last minutes.
-unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes)
+static unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes)
{
unsigned long failures = 0;
@@ -66,7 +66,7 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes)
* Records an event in the login log
*---------------------------------------------*/
// TODO: add an enum of rcode values
-void loginlog_log(uint32 ip, const char* username, int rcode, const char* message)
+static void loginlog_log(uint32 ip, const char *username, int rcode, const char *message)
{
char esc_username[NAME_LENGTH*2+1];
char esc_message[255*2+1];
@@ -88,7 +88,7 @@ void loginlog_log(uint32 ip, const char* username, int rcode, const char* messag
Sql_ShowDebug(loginlog->sql_handle);
}
-bool loginlog_init(void)
+static bool loginlog_init(void)
{
loginlog->sql_handle = SQL->Malloc();
@@ -107,7 +107,7 @@ bool loginlog_init(void)
return true;
}
-bool loginlog_final(void)
+static bool loginlog_final(void)
{
SQL->Free(loginlog->sql_handle);
loginlog->sql_handle = NULL;
@@ -124,7 +124,7 @@ bool loginlog_final(void)
*
* @retval false in case of error.
*/
-bool loginlog_config_read_names(const char *filename, struct config_t *config, bool imported)
+static bool loginlog_config_read_names(const char *filename, struct config_t *config, bool imported)
{
struct config_setting_t *setting = NULL;
@@ -153,7 +153,7 @@ bool loginlog_config_read_names(const char *filename, struct config_t *config, b
*
* @retval false in case of error.
*/
-bool loginlog_config_read_log(const char *filename, struct config_t *config, bool imported)
+static bool loginlog_config_read_log(const char *filename, struct config_t *config, bool imported)
{
struct config_setting_t *setting = NULL;
@@ -188,7 +188,7 @@ bool loginlog_config_read_log(const char *filename, struct config_t *config, boo
*
* @retval false in case of error.
**/
-bool loginlog_config_read(const char *filename, bool imported)
+static bool loginlog_config_read(const char *filename, bool imported)
{
struct config_t config;
const char *import = NULL;