misc/libphyslayer/physfscompat.h
author Wuzzy <Wuzzy2@mail.ru>
Fri, 11 Oct 2019 18:41:56 +0200
changeset 15490 a18f7e4681b8
parent 11046 47a8c19ecb60
child 15976 69479ac8f4c8
permissions -rw-r--r--
Add flame-less dynamite sprite for drowning dynamite
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
11046
47a8c19ecb60 more copyright fixes
sheepluva
parents: 10108
diff changeset
     3
 * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
9991
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
10108
c68cf030eded update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents: 10017
diff changeset
    16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
9991
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
{
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    37
    PHYSFS_FILETYPE_REGULAR,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    38
    PHYSFS_FILETYPE_DIRECTORY,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    39
    PHYSFS_FILETYPE_SYMLINK,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    40
    PHYSFS_FILETYPE_OTHER
9991
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
{
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    45
    PHYSFS_sint64 filesize;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    46
    PHYSFS_sint64 modtime;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    47
    PHYSFS_sint64 createtime;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    48
    PHYSFS_sint64 accesstime;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    49
    PHYSFS_FileType filetype;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    50
    int readonly;
9991
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_ */