1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

implement Get{Db,Log,Pid}{,W} function

DbDir  : directory to store files such as vpn_server.config and backups etc
LogDir : directory to write logs (sub directories is created in this dir)
PidDir : directory to put PID files such as .ctl-* .pid-* .VPN-*
This commit is contained in:
Koichiro IWAO 2019-11-29 22:31:06 +09:00
parent 3a309c9f6e
commit 18c9b74ff0
No known key found for this signature in database
GPG Key ID: 9F72CDBC01BF10EB
2 changed files with 60 additions and 0 deletions

View File

@ -1295,6 +1295,60 @@ void GetExeNameW(wchar_t *name, UINT size)
UniStrCpy(name, size, exe_file_name_w); UniStrCpy(name, size, exe_file_name_w);
} }
void GetLogDir(char *name, UINT size)
{
#ifdef SE_LOGDIR
Format(name, size, SE_LOGDIR);
#else
GetExeDir(name, size);
#endif
}
void GetLogDirW(wchar_t *name, UINT size)
{
#ifdef SE_LOGDIR
UniFormat(name, size, L""SE_LOGDIR);
#else
GetExeDirW(name, size);
#endif
}
void GetDbDir(char *name, UINT size)
{
#ifdef SE_DBDIR
Format(name, size, SE_DBDIR);
#else
GetExeDir(name, size);
#endif
}
void GetDbDirW(wchar_t *name, UINT size)
{
#ifdef SE_DBDIR
UniFormat(name, size, L""SE_DBDIR);
#else
GetExeDirW(name, size);
#endif
}
void GetPidDir(char *name, UINT size)
{
#ifdef SE_PIDDIR
Format(name, size, SE_PIDDIR);
#else
GetExeDir(name, size);
#endif
}
void GetPidDirW(wchar_t *name, UINT size)
{
#ifdef SE_PIDDIR
UniFormat(name, size, L""SE_PIDDIR);
#else
GetExeDirW(name, size);
#endif
}
// Initialization of the acquisition of the EXE file name // Initialization of the acquisition of the EXE file name
void InitGetExeName(char *arg) void InitGetExeName(char *arg)
{ {

View File

@ -228,6 +228,12 @@ void GetExeName(char *name, UINT size);
void GetExeNameW(wchar_t *name, UINT size); void GetExeNameW(wchar_t *name, UINT size);
void GetExeDir(char *name, UINT size); void GetExeDir(char *name, UINT size);
void GetExeDirW(wchar_t *name, UINT size); void GetExeDirW(wchar_t *name, UINT size);
void GetLogDir(char *name, UINT size);
void GetLogDirW(wchar_t *name, UINT size);
void GetDbDir(char *name, UINT size);
void GetDbDirW(wchar_t *name, UINT size);
void GetPidDir(char *name, UINT size);
void GetPidDirW(wchar_t *name, UINT size);
void BuildHamcore(char *dst_filename, char *src_dir, bool unix_only); void BuildHamcore(char *dst_filename, char *src_dir, bool unix_only);
int CompareHamcore(void *p1, void *p2); int CompareHamcore(void *p1, void *p2);
void InitHamcore(); void InitHamcore();