* Moved function 'exists' (file presense check) to utils.c, so that it is available to code outside of lock.c
- Fixed associated F_OK and R_OK defines causing 'already defined' warnings on MinGW (since r1361). git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14528 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
df022f175d
commit
c792e189e4
@ -1,11 +1,13 @@
|
|||||||
Date Added
|
Date Added
|
||||||
|
|
||||||
2010/11/30
|
2010/11/30
|
||||||
|
* Moved function 'exists' (file presense check) to utils.c, so that it is available to code outside of lock.c [Ai4rei]
|
||||||
|
- Fixed associated F_OK and R_OK defines causing 'already defined' warnings on MinGW (since r1361).
|
||||||
* Resolved missing script documentation (bugreport:4578). [Ai4rei]
|
* Resolved missing script documentation (bugreport:4578). [Ai4rei]
|
||||||
- Added documentation for bonus bAutoSpellOnSkill (follow up to r13596).
|
- Added documentation for bonus bAutoSpellOnSkill (follow up to r13596).
|
||||||
- Added documentation for script command progressbar (follow up to r14024).
|
- Added documentation for script command progressbar (follow up to r14024).
|
||||||
* Made job_db1.txt, job_db2.txt, size_fix.txt and refine_db.txt reading use sv_readdb. [Ai4rei]
|
* Made job_db1.txt, job_db2.txt, size_fix.txt and refine_db.txt reading use sv_readdb. [Ai4rei]
|
||||||
- NOTE: Any MAX_LEVEL (map.h) increase requires at least same increase of SV_READDB_MAX_FIELDS as well.
|
- NOTE: Any MAX_LEVEL (map.h) increase requires at least same increase of SV_READDB_MAX_FIELDS (strlib.c) as well.
|
||||||
* Added SV_READDB_MAX_FIELDS define for configuration of the sv_readdb limit. [Ai4rei]
|
* Added SV_READDB_MAX_FIELDS define for configuration of the sv_readdb limit. [Ai4rei]
|
||||||
* Made skill_tree.txt reading use sv_readdb. [Ai4rei]
|
* Made skill_tree.txt reading use sv_readdb. [Ai4rei]
|
||||||
- Added define for skill entry requirements.
|
- Added define for skill entry requirements.
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||||
// For more information, see LICENCE in the main folder
|
// For more information, see LICENCE in the main folder
|
||||||
|
|
||||||
#include "../common/cbasetypes.h"
|
#include "cbasetypes.h"
|
||||||
#include "../common/showmsg.h"
|
#include "showmsg.h"
|
||||||
|
#include "utils.h"
|
||||||
#include "lock.h"
|
#include "lock.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -12,12 +13,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#define F_OK 0x0
|
|
||||||
#define R_OK 0x4
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define exists(filename) (!access(filename, F_OK))
|
|
||||||
|
|
||||||
// 書き込みファイルの保護処理
|
// 書き込みファイルの保護処理
|
||||||
// (書き込みが終わるまで、旧ファイルを保管しておく)
|
// (書き込みが終わるまで、旧ファイルを保管しておく)
|
||||||
|
|
||||||
|
@ -14,7 +14,11 @@
|
|||||||
#include <math.h> // floor()
|
#include <math.h> // floor()
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
#include <io.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#ifndef F_OK
|
||||||
|
#define F_OK 0x0
|
||||||
|
#endif /* F_OK */
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
@ -182,6 +186,11 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool exists(const char* filename)
|
||||||
|
{
|
||||||
|
return !access(filename, F_OK);
|
||||||
|
}
|
||||||
|
|
||||||
uint8 GetByte(uint32 val, int idx)
|
uint8 GetByte(uint32 val, int idx)
|
||||||
{
|
{
|
||||||
switch( idx )
|
switch( idx )
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
void dump(FILE* fp, const unsigned char* buffer, int length);
|
void dump(FILE* fp, const unsigned char* buffer, int length);
|
||||||
|
|
||||||
void findfile(const char *p, const char *pat, void (func)(const char*));
|
void findfile(const char *p, const char *pat, void (func)(const char*));
|
||||||
|
bool exists(const char* filename);
|
||||||
|
|
||||||
//Caps values to min/max
|
//Caps values to min/max
|
||||||
#define cap_value(a, min, max) ((a >= max) ? max : (a <= min) ? min : a)
|
#define cap_value(a, min, max) ((a >= max) ? max : (a <= min) ? min : a)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user