platform/skeleton.c
author Ryan C. Gordon <icculus@icculus.org>
Tue, 06 Sep 2005 06:24:42 +0000
changeset 747 3da194b12f43
parent 691 71d9affe0d8a
child 754 e7cd7411eadf
permissions -rw-r--r--
Don't use size_t in physfs.h, since it relies on C runtime headers.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
152
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
/*
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
 * Skeleton platform-dependent support routines for PhysicsFS.
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
 *
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
 * Please see the file LICENSE in the source's root directory.
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
 *
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
 *  This file written by Ryan C. Gordon.
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
 */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
214
19846c18071b Initial autoconf support.
Ryan C. Gordon <icculus@icculus.org>
parents: 156
diff changeset
     9
#if HAVE_CONFIG_H
19846c18071b Initial autoconf support.
Ryan C. Gordon <icculus@icculus.org>
parents: 156
diff changeset
    10
#  include <config.h>
19846c18071b Initial autoconf support.
Ryan C. Gordon <icculus@icculus.org>
parents: 156
diff changeset
    11
#endif
19846c18071b Initial autoconf support.
Ryan C. Gordon <icculus@icculus.org>
parents: 156
diff changeset
    12
152
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
#define __PHYSICSFS_INTERNAL__
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
#include "physfs_internal.h"
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
#error DO NOT COMPILE THIS. IT IS JUST A SKELETON EXAMPLE FILE.
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
const char *__PHYSFS_platformDirSeparator = ":";
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
int __PHYSFS_platformInit(void)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
    return(1);  /* always succeed. */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
} /* __PHYSFS_platformInit */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
int __PHYSFS_platformDeinit(void)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
    return(1);  /* always succeed. */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
} /* __PHYSFS_platformDeinit */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
657
dad3b5c307a9 Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents: 596
diff changeset
    35
void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
152
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
} /* __PHYSFS_platformDetectAvailableCDs */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
char *__PHYSFS_platformCalcBaseDir(const char *argv0)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
} /* __PHYSFS_platformCalcBaseDir */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
char *__PHYSFS_platformGetUserName(void)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
} /* __PHYSFS_platformGetUserName */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52
char *__PHYSFS_platformGetUserDir(void)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    53
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    55
} /* __PHYSFS_platformGetUserDir */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    56
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58
PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    59
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    60
    return(1);  /* single threaded. */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    61
} /* __PHYSFS_platformGetThreadID */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    62
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    64
int __PHYSFS_platformStricmp(const char *x, const char *y)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    66
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
} /* __PHYSFS_platformStricmp */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    68
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    69
596
381b6ca0dd85 Added internal function __PHYSFS_platformStrnicmp().
Ryan C. Gordon <icculus@icculus.org>
parents: 240
diff changeset
    70
int __PHYSFS_platformStrnicmp(const char *x, const char *y, PHYSFS_uint32 l)
381b6ca0dd85 Added internal function __PHYSFS_platformStrnicmp().
Ryan C. Gordon <icculus@icculus.org>
parents: 240
diff changeset
    71
{
381b6ca0dd85 Added internal function __PHYSFS_platformStrnicmp().
Ryan C. Gordon <icculus@icculus.org>
parents: 240
diff changeset
    72
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
381b6ca0dd85 Added internal function __PHYSFS_platformStrnicmp().
Ryan C. Gordon <icculus@icculus.org>
parents: 240
diff changeset
    73
} /* __PHYSFS_platformStrnicmp */
381b6ca0dd85 Added internal function __PHYSFS_platformStrnicmp().
Ryan C. Gordon <icculus@icculus.org>
parents: 240
diff changeset
    74
381b6ca0dd85 Added internal function __PHYSFS_platformStrnicmp().
Ryan C. Gordon <icculus@icculus.org>
parents: 240
diff changeset
    75
152
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    76
int __PHYSFS_platformExists(const char *fname)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    77
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    78
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    79
} /* __PHYSFS_platformExists */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    80
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    81
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    82
int __PHYSFS_platformIsSymLink(const char *fname)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    85
} /* __PHYSFS_platformIsSymlink */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    86
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    88
int __PHYSFS_platformIsDirectory(const char *fname)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    89
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    90
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    91
} /* __PHYSFS_platformIsDirectory */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    92
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    93
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    94
char *__PHYSFS_platformCvtToDependent(const char *prepend,
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
                                      const char *dirName,
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
                                      const char *append)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    98
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    99
} /* __PHYSFS_platformCvtToDependent */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
void __PHYSFS_platformTimeslice(void)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   103
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
} /* __PHYSFS_platformTimeslice */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
657
dad3b5c307a9 Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents: 596
diff changeset
   107
void __PHYSFS_platformEnumerateFiles(const char *dirname,
dad3b5c307a9 Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents: 596
diff changeset
   108
                                     int omitSymLinks,
dad3b5c307a9 Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents: 596
diff changeset
   109
                                     PHYSFS_StringCallback callback,
dad3b5c307a9 Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents: 596
diff changeset
   110
                                     void *callbackdata)
152
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
} /* __PHYSFS_platformEnumerateFiles */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
char *__PHYSFS_platformCurrentDir(void)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
} /* __PHYSFS_platformCurrentDir */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   119
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
char *__PHYSFS_platformRealPath(const char *path)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
} /* __PHYSFS_platformRealPath */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
int __PHYSFS_platformMkDir(const char *path)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
} /* __PHYSFS_platformMkDir */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
void *__PHYSFS_platformOpenRead(const char *filename)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   135
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
} /* __PHYSFS_platformOpenRead */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   137
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   138
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
void *__PHYSFS_platformOpenWrite(const char *filename)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   141
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   142
} /* __PHYSFS_platformOpenWrite */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   143
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   144
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   145
void *__PHYSFS_platformOpenAppend(const char *filename)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   146
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   147
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   148
} /* __PHYSFS_platformOpenAppend */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   149
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   150
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   151
PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   152
                                    PHYSFS_uint32 size, PHYSFS_uint32 count)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   153
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   154
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
} /* __PHYSFS_platformRead */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
                                     PHYSFS_uint32 size, PHYSFS_uint32 count)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   162
} /* __PHYSFS_platformWrite */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   164
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   165
int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   166
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   168
} /* __PHYSFS_platformSeek */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   169
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
} /* __PHYSFS_platformTell */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   179
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
} /* __PHYSFS_platformFileLength */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   181
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   182
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
int __PHYSFS_platformEOF(void *opaque)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   184
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   185
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   186
} /* __PHYSFS_platformEOF */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   187
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   188
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   189
int __PHYSFS_platformFlush(void *opaque)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   190
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   191
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   192
} /* __PHYSFS_platformFlush */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   193
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   194
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   195
int __PHYSFS_platformClose(void *opaque)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   196
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   197
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   198
} /* __PHYSFS_platformClose */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   199
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   200
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   201
int __PHYSFS_platformDelete(const char *path)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   202
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   203
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   204
} /* __PHYSFS_platformDelete */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   205
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   206
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   207
void *__PHYSFS_platformCreateMutex(void)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   208
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   209
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   210
} /* __PHYSFS_platformCreateMutex */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   211
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   212
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   213
void __PHYSFS_platformDestroyMutex(void *mutex)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   214
{
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   215
} /* __PHYSFS_platformDestroyMutex */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   216
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   217
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   218
int __PHYSFS_platformGrabMutex(void *mutex)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   219
{
156
f45e26b5f398 Added warning about potential infinite recursion between setError and grabMutex.
Ryan C. Gordon <icculus@icculus.org>
parents: 152
diff changeset
   220
    /* not implemented, but can't call __PHYSFS_setError! */
f45e26b5f398 Added warning about potential infinite recursion between setError and grabMutex.
Ryan C. Gordon <icculus@icculus.org>
parents: 152
diff changeset
   221
    return(0);
152
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   222
} /* __PHYSFS_platformGrabMutex */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   223
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   224
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   225
void __PHYSFS_platformReleaseMutex(void *mutex)
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   226
{
156
f45e26b5f398 Added warning about potential infinite recursion between setError and grabMutex.
Ryan C. Gordon <icculus@icculus.org>
parents: 152
diff changeset
   227
    /* not implemented, but can't call __PHYSFS_setError! */
152
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   228
} /* __PHYSFS_platformReleaseMutex */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   229
240
052041af9001 Added PHYSFS_getLastModTime() API. (Thanks, John Hall!)
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
   230
052041af9001 Added PHYSFS_getLastModTime() API. (Thanks, John Hall!)
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
   231
PHYSFS_sint64 __PHYSFS_platformGetLastModTime(const char *fname)
052041af9001 Added PHYSFS_getLastModTime() API. (Thanks, John Hall!)
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
   232
{
052041af9001 Added PHYSFS_getLastModTime() API. (Thanks, John Hall!)
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
   233
    BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
052041af9001 Added PHYSFS_getLastModTime() API. (Thanks, John Hall!)
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
   234
} /* __PHYSFS_platformGetLastModTime */
052041af9001 Added PHYSFS_getLastModTime() API. (Thanks, John Hall!)
Ryan C. Gordon <icculus@icculus.org>
parents: 214
diff changeset
   235
691
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   236
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   237
int __PHYSFS_platformAllocatorInit(void)
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   238
{
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   239
    return(1);  /* always succeeds. */
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   240
} /* __PHYSFS_platformAllocatorInit */
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   241
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   242
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   243
void __PHYSFS_platformAllocatorDeinit(void)
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   244
{
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   245
    /* no-op */
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   246
} /* __PHYSFS_platformAllocatorInit */
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   247
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   248
747
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   249
void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
691
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   250
{
747
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   251
    /* make sure s isn't larger than the address space of the platform... */
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   252
    if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   253
        BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
691
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   254
    #undef malloc
747
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   255
    return(malloc((size_t) s));
691
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   256
} /* __PHYSFS_platformMalloc */
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   257
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   258
747
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   259
void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
691
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   260
{
747
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   261
    /* make sure s isn't larger than the address space of the platform... */
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   262
    if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   263
        BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
691
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   264
    #undef realloc
747
3da194b12f43 Don't use size_t in physfs.h, since it relies on C runtime headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 691
diff changeset
   265
    return(realloc(ptr, (size_t) s));
691
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   266
} /* __PHYSFS_platformRealloc */
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   267
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   268
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   269
void __PHYSFS_platformAllocatorFree(void *ptr)
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   270
{
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   271
    #undef free
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   272
    free(ptr);
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   273
} /* __PHYSFS_platformAllocatorFree */
71d9affe0d8a All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents: 657
diff changeset
   274
152
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   275
/* end of skeleton.c ... */
14927fc344b0 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   276