mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
remove unused and not implemented IOFLAG_RANDOM, add assert
This commit is contained in:
parent
d51f20586c
commit
75662b6c1a
|
@ -283,6 +283,7 @@ void mem_zero(void *block, unsigned size)
|
||||||
|
|
||||||
IOHANDLE io_open(const char *filename, int flags)
|
IOHANDLE io_open(const char *filename, int flags)
|
||||||
{
|
{
|
||||||
|
dbg_assert(flags == IOFLAG_READ || flags == IOFLAG_WRITE || flags == IOFLAG_APPEND, "flags must be read, write or append");
|
||||||
if(flags == IOFLAG_READ)
|
if(flags == IOFLAG_READ)
|
||||||
return (IOHANDLE)fopen(filename, "rb");
|
return (IOHANDLE)fopen(filename, "rb");
|
||||||
if(flags == IOFLAG_WRITE)
|
if(flags == IOFLAG_WRITE)
|
||||||
|
|
|
@ -170,8 +170,7 @@ enum
|
||||||
{
|
{
|
||||||
IOFLAG_READ = 1,
|
IOFLAG_READ = 1,
|
||||||
IOFLAG_WRITE = 2,
|
IOFLAG_WRITE = 2,
|
||||||
IOFLAG_RANDOM = 4,
|
IOFLAG_APPEND = 4,
|
||||||
IOFLAG_APPEND = 8,
|
|
||||||
|
|
||||||
IOSEEK_START = 0,
|
IOSEEK_START = 0,
|
||||||
IOSEEK_CUR = 1,
|
IOSEEK_CUR = 1,
|
||||||
|
@ -186,7 +185,7 @@ typedef struct IOINTERNAL *IOHANDLE;
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
filename - File to open.
|
filename - File to open.
|
||||||
flags - A set of flags. IOFLAG_READ, IOFLAG_WRITE, IOFLAG_RANDOM, IOFLAG_APPEND.
|
flags - A set of flags. IOFLAG_READ, IOFLAG_WRITE, IOFLAG_APPEND.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Returns a handle to the file on success and 0 on failure.
|
Returns a handle to the file on success and 0 on failure.
|
||||||
|
|
Loading…
Reference in a new issue