misc/libphyslayer/physfscompat.h
author sheepluva
Wed, 15 Jan 2014 23:48:18 +0100
changeset 9991 3858d99476f5
child 10017 de822cd3df3a
permissions -rw-r--r--
add compatibility for physicsfs 2.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9991
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     1
/*
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     3
 * Copyright (c) 2004-2014 Andrey Korotaev <unC0Rr@gmail.com>
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     4
 *
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     8
 *
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    12
 * GNU General Public License for more details.
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    13
 *
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    17
 */
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    18
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    19
#ifndef _HEDGEWARS_PHYSFSCOMPAT_C_
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    20
#define _HEDGEWARS_PHYSFSCOMPAT_C_
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    21
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    22
#include "physfs.h"
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    23
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    24
#if PHYSFS_VER_MAJOR == 2
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    25
#if PHYSFS_VER_MINOR == 0
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    26
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    27
#define HW_PHYSFS_COMPAT
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    28
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    29
#ifdef __cplusplus
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    30
extern "C" {
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    31
#endif
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    32
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    33
#define PHYSFS_DECL __EXPORT__
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    34
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    35
typedef enum PHYSFS_FileType
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    36
{
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    37
	PHYSFS_FILETYPE_REGULAR,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    38
	PHYSFS_FILETYPE_DIRECTORY,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    39
	PHYSFS_FILETYPE_SYMLINK,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    40
	PHYSFS_FILETYPE_OTHER
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    41
} PHYSFS_FileType;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    42
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    43
typedef struct PHYSFS_Stat
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    44
{
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    45
	PHYSFS_sint64 filesize;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    46
	PHYSFS_sint64 modtime;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    47
	PHYSFS_sint64 createtime;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    48
	PHYSFS_sint64 accesstime;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    49
	PHYSFS_FileType filetype;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    50
	int readonly;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    51
} PHYSFS_Stat;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    52
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    53
PHYSFS_DECL int PHYSFS_stat(const char *fname, PHYSFS_Stat *stat);
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    54
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    55
PHYSFS_DECL PHYSFS_sint64 PHYSFS_readBytes(PHYSFS_File *handle, void *buffer,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    56
                                           PHYSFS_uint64 len);
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    57
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    58
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    59
PHYSFS_DECL PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File *handle,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    60
                                            const void *buffer,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    61
                                            PHYSFS_uint64 len);
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    62
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    63
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    64
#ifdef __cplusplus
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    65
}
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    66
#endif
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    67
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    68
#endif /* PHYSFS_VER_MAJOR == 2 */
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    69
#endif /* PHYSFS_VER_MINOR == 0 */
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    70
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    71
#endif /* _HEDGEWARS_PHYSFSCOMPAT_C_ */