misc/libphyslayer/physfscompat.h
author unC0Rr
Fri, 19 Jan 2024 13:07:22 +0100
branchtransitional_engine
changeset 16009 7544a7d7c819
parent 15946 69479ac8f4c8
permissions -rw-r--r--
Start on adopting corrosion
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
15946
69479ac8f4c8 force dllexport for physlayer interface
alfadur
parents: 11046
diff changeset
    24
#if defined(_WIN32) 
69479ac8f4c8 force dllexport for physlayer interface
alfadur
parents: 11046
diff changeset
    25
#define PHYSFS_DECL __declspec(dllexport)
69479ac8f4c8 force dllexport for physlayer interface
alfadur
parents: 11046
diff changeset
    26
#endif
69479ac8f4c8 force dllexport for physlayer interface
alfadur
parents: 11046
diff changeset
    27
9991
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    28
#if PHYSFS_VER_MAJOR == 2
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    29
#if PHYSFS_VER_MINOR == 0
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    30
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    31
#define HW_PHYSFS_COMPAT
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    32
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    33
#ifdef __cplusplus
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    34
extern "C" {
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    35
#endif
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    36
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    37
#define PHYSFS_DECL __EXPORT__
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    38
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    39
typedef enum PHYSFS_FileType
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    40
{
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    41
    PHYSFS_FILETYPE_REGULAR,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    42
    PHYSFS_FILETYPE_DIRECTORY,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    43
    PHYSFS_FILETYPE_SYMLINK,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    44
    PHYSFS_FILETYPE_OTHER
9991
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    45
} PHYSFS_FileType;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    46
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    47
typedef struct PHYSFS_Stat
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    48
{
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    49
    PHYSFS_sint64 filesize;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    50
    PHYSFS_sint64 modtime;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    51
    PHYSFS_sint64 createtime;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    52
    PHYSFS_sint64 accesstime;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    53
    PHYSFS_FileType filetype;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9991
diff changeset
    54
    int readonly;
9991
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    55
} PHYSFS_Stat;
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    56
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    57
PHYSFS_DECL int PHYSFS_stat(const char *fname, PHYSFS_Stat *stat);
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_readBytes(PHYSFS_File *handle, void *buffer,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    60
                                           PHYSFS_uint64 len);
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    61
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    62
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    63
PHYSFS_DECL PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File *handle,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    64
                                            const void *buffer,
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    65
                                            PHYSFS_uint64 len);
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    66
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    67
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    68
#ifdef __cplusplus
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    69
}
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    70
#endif
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    71
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    72
#endif /* PHYSFS_VER_MAJOR == 2 */
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    73
#endif /* PHYSFS_VER_MINOR == 0 */
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    74
3858d99476f5 add compatibility for physicsfs 2.0
sheepluva
parents:
diff changeset
    75
#endif /* _HEDGEWARS_PHYSFSCOMPAT_C_ */