physfs.h
author Ryan C. Gordon <icculus@icculus.org>
Thu, 07 Jun 2001 04:10:40 +0000
changeset 1 b5ce9d35fdb4
child 2 24ba671694af
permissions -rw-r--r--
Initial revision
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
 * PhysicsFS; a portable, flexible file i/o abstraction.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
 * This API gives you access to a system file system in ways superior to the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
 *  stdio or system i/o calls. The brief benefits:
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
 *   - It's portable.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
 *   - It can handle byte ordering on alternative processors.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
 *   - It's safe. No file access is permitted outside the specified dirs.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
 *   - It's flexible. Archives (.ZIP files) can be used transparently as
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
 *      directory structures.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
 * This system is largely inspired by Quake 3's PK3 files and the related
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
 *  fs_* cvars. If you've ever tinkered with these, then this API will be very
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
 *  familiar to you.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
 * With the PhysicsFS, you have a single writing directory and multiple
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
 *  "search paths" for reading. You can think of this as a filesystem within a
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
 *  filesystem. If (on Windows) you were to set the writing directory to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
 *  "C:\MyGame\MyWritingDirectory", then no PHYSFS calls could touch anything
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
 *  above this directory, including the "C:\MyGame" and "C:\" directories.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
 *  This prevents an application's internal scripting language from piddling
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
 *  over c:\config.sys, for example. If you'd rather give PHYSFS full access
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
 *  to the system's REAL file system, set the writing path to "C:\", but
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
 *  that's generally A Bad Thing for several reasons.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
 * Drive letters are hidden in PhysicsFS once you set up your initial paths.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
 *  The search paths create a single, hierarchical directory structure.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
 *  Not only does this lend itself well to general abstraction with archives,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
 *  it also gives better support to operating systems like MacOS and Unix.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
 *  Generally speaking, you shouldn't ever hardcode a drive letter; not only
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
 *  does this hurt portability to non-Microsoft OSes, but it limits your win32
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
 *  users to a single drive, too. Use the PhysicsFS abstraction functions and
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
 *  allow user-defined configuration options, too. When opening a file, you
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
 *  specify it like it was on a Unix filesystem: if you want to write to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
 *  "C:\MyGame\MyConfigFiles\game.cfg", then you might set the write path to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
 *  "C:\MyGame" and then open "MyConfigFiles/game.cfg". This gives an
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
 *  abstraction across all platforms.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
 * All files opened for writing are opened in relation to the write path,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
 *  which is the root of the writable filesystem. When opening a file for
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
 *  reading, PhysicsFS goes through it's internal search path. This is NOT the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
 *  same thing as the PATH environment variable. An application using
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
 *  PhysicsFS specifies directories to be searched which may be actual
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
 *  directories, or archive files that contain files and subdirectories of
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
 *  their own. See the end of these docs for currently supported archive
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
 *  formats.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
 * Once a search path is defined, you may open files for reading. If you've
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
 *  got the following search path defined (to use a win32 example again):
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52
 *    C:\mygame
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    53
 *    C:\mygame\myuserfiles
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54
 *    D:\mygamescdromdatafiles
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    55
 *    C:\mygame\installeddatafiles.zip
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    56
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
 * Then a call to PHYSFS_openread("textfiles/myfile.txt") (note the directory
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58
 *  separator) will check for C:\mygame\textfiles\myfile.txt, then
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    59
 *  C:\mygame\myuserfiles\textfiles\myfile.txt, then
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    60
 *  D:\mygamescdromdatafiles\textfiles\myfile.txt, then, finally, for
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    61
 *  textfiles\myfile.txt inside of C:\mygame\installeddatafiles.zip. Remember
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    62
 *  that most archive types and platform filesystems store their filenames in
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63
 *  a case-sensitive manner.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    64
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
 * Files opened through PhysicsFS may NOT contain "." or ".." as path
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    66
 *  elements. Not only are these meaningless on MacOS, they are a security
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
 *  hole. Also, symbolic links (which can be found in some archive types and
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    68
 *  directly in the filesystem on Unix platforms) are NOT followed until you
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    69
 *  call PHYSFS_permitSymbolicLinks(). That's left to your own discretion, as
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    70
 *  following a symlink can allow for access outside the write and search
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    71
 *  paths. There is no mechanism for creating new symlinks in PhysicsFS.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    72
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    73
 * The write path is not included in the search path unless you specifically
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    74
 *  add it. While you CAN change the write path as many times as you like,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    75
 *  you should probably set it once and stick to that path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    76
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    77
 * All files are opened in binary mode; there is no endline conversion for
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    78
 *  textfiles. Other than that, PhysicsFS has some convenience functions for
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    79
 *  platform-independence. There are functions that give you the current
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    80
 *  platform's path separator ("\\" on windows, "/" on Unix, ":" on MacOS),
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    81
 *  which is needed only to set up your search/write paths. There are
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    82
 *  functions to tell you what CD-ROM drives contain accessible discs, and
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
 *  functions to recommend good search paths, etc. There are also functions
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
 *  to read 16 and 32 bit numbers from files and convert them to the native
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    85
 *  byte order of your processor.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    86
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
 * A recommended order for a search path is the write path, then the base path,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    88
 *  then the cdrom path, then any archives discovered. Quake 3 does something
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    89
 *  like this, but moves the archives to the start of the search path. There
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    90
 *  is a helper function (PHYSFS_setSanePaths()) that does this for you,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    91
 *  based on a few parameters. Also see the comments on PHYSFS_getBasePath(),
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    92
 *  and PHYSFS_getUserPath() for info on what those are and how they can help
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    93
 *  you determine an optimal searchpath.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    94
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
 * While you CAN mix stdio/syscall file access with PHYSFS_* calls in a
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
 *  program, doing so is not recommended, and you can not use system
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
 *  filehandles with PhysicsFS filehandles and vice versa.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    98
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    99
 * Note that archives need not be named as such: if you have a ZIP file and
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
 *  rename it with a .PKG extention, the file will still be recognized as a
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
 *  ZIP archive by PhysicsFS; the file's contents are used to determine its
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
 *  type.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   103
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
 * Currently supported archive types:
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
 *   - .ZIP (pkZip/WinZip/Info-ZIP compatible)
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   107
 * Please see the file LICENSE in the source's root directory.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   108
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
 *  This file written by Ryan C. Gordon.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
#ifndef _INCLUDE_PHYSFS_H_
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
#define _INCLUDE_PHYSFS_H_
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
#ifdef __cplusplus
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
extern "C" {
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
#endif
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   119
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
/* functions... */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
 * Get the last PhysicsFS error message as a null-terminated string.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
 *  This will be NULL if there's been no error since the last call to this
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
 *  function. The pointer returned by this call points to a static buffer
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
 *  internal buffer, and this call is not thread safe.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
 *   @return READ ONLY string of last error message.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
const char *PHYSFS_getLastError(void);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   135
 * Get a platform-dependent path separator. This is "\\" on win32, "/" on Unix,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
 *  and ":" on MacOS. It may be more than one character, depending on the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   137
 *  platform, and your code should take that into account. Note that this is
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   138
 *  only useful for setting up the search/write paths, since access into those
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
 *  paths always use '/' to separate directories. This is also handy for
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
 *  getting platform-independent access when using stdio calls.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   141
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   142
 *   @return READ ONLY null-terminated string of platform's path separator.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   143
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   144
const char *PHYSFS_getPathSeparator(void);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   145
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   146
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   147
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   148
 * Get an array of paths to available CD-ROM drives. This return value should
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   149
 *  be considered READ ONLY and points to an internal buffer which may change
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   150
 *  with each call to this function. This means that this function is NOT
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   151
 *  thread safe.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   152
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   153
 * The paths returned are platform-dependent ("D:\" on Win32, "/cdrom" or
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   154
 *  whatnot on Unix). Paths are only returned if there is a disc ready and
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
 *  accessible in the drive. So if you've got two drives (D: and E:), and only
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
 *  E: has a disc in it, then that's all you get. If the user inserts a disc
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
 *  in D: and you call this function again, you get both drives. If, on a
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
 *  Unix box, the user unmounts a disc and remounts it elsewhere, the next
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
 *  call to this function will reflect that change. Fun.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
 * The returned value is an array of strings, with a NULL entry to signify the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   162
 *  end of the list:
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   164
 * char **i;
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   165
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   166
 * // lock thread here, if needed.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   168
 * for (i = PHYSFS__getCdRomPaths(); *i != NULL; i++)
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   169
 *     printf("cdrom path [%s] is available.\n", *i);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
 * // unlock thread here, if needed.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
 * This call may block while drives spin up. Be forewarned.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
 *   @return READ ONLY null-term'd array of READ ONLY null-terminated strings.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
const char **PHYSFS_getCdRomPaths(void);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   179
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   181
 * Helper function.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   182
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
 * Get the "base path". This is the directory where the application was run
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   184
 *  from, which is probably the installation directory.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   185
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   186
 * You should probably use the base path in your search path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   187
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   188
 *   @param buffer pointer to buffer to fill with recommended path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   189
 *   @param bufsize size of buffer pointed to by (buffer).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   190
 *  @return a copy of (buffer), for easy use as another function's parameter.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   191
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   192
char *PHYSFS_getBasePath(char *buffer, int bufferSize);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   193
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   194
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   195
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   196
 * Helper function.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   197
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   198
 * Get the "user path". This is meant to be a suggestion of where a specific
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   199
 *  user of the system can store files. On Unix, this is her home directory.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   200
 *  On systems with no concept of multiple users (MacOS, win95), this will
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   201
 *  default to the "base path" returned by PHYSFS_getBasePath().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   202
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   203
 * You should probably use the user path as the basis for your write path, and
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   204
 *  also put it near the beginning of your search path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   205
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   206
 *   @param buffer pointer to buffer to fill with recommended path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   207
 *   @param bufsize size of buffer pointed to by (buffer).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   208
 *  @return a copy of (buffer), for easy use as another function's parameter.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   209
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   210
char *PHYSFS_getUserPath(char *buffer, int bufferSize);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   211
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   212
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   213
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   214
 * Get the current write path. The default write path is NULL.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   215
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   216
 *   @param buffer pointer to buffer to fill with recommended path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   217
 *   @param bufsize size of buffer pointed to by (buffer).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   218
 *  @return a copy of (buffer), for easy use as another function's parameter,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   219
 *           OR NULL IF NO WRITE PATH IS CURRENTLY SET.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   220
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   221
char *PHYSFS_getWritePath(char *buffer, int bufferSize);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   222
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   223
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   224
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   225
 * Set a new write path. This will override the previous setting. If the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   226
 *  directory or a parent directory doesn't exist in the physical filesystem,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   227
 *  PhysicsFS will attempt to create them as needed.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   228
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   229
 * This call will fail (and fail to change the write path) if the current path
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   230
 *  still has files open in it.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   231
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   232
 *   @param newPath The new directory to be the root of the write path,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   233
 *                   specified in a platform-dependent manner. Setting to NULL
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   234
 *                   disables the write path, so no files can be opened for
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   235
 *                   writing via PhysicsFS.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   236
 *  @return non-zero on success, zero on failure. All attempts to open a file
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   237
 *           for writing via PhysicsFS will fail until this call succeeds.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   238
 *           Specifics of the error can be gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   239
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   240
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   241
int PHYSFS_setWritePath(const char *newPath);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   242
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   243
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   244
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   245
 * Add a directory or archive to the search path. If this is a duplicate, the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   246
 *  entry is not added again, even though the function succeeds.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   247
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   248
 *   @param newPath directory or archive to add to the path, in
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   249
 *                   platform-dependent notation.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   250
 *   @param appendToPath nonzero to append to search path, zero to prepend.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   251
 *  @return nonzero if added to path, zero on failure (bogus archive, path
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   252
 *                   missing, etc). Specifics of the error can be
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   253
 *                   gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   254
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   255
int PHYSFS_addToSearchPath(const char *newPath, int appendToPath);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   256
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   257
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   258
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   259
 * Remove a directory or archive to the search path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   260
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   261
 * This must be a (case-sensitive) match to a dir or archive already in the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   262
 *  search path, specified in platform-dependent notation.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   263
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   264
 * This call will fail (and fail to remove from the path) if the element still
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   265
 *  has files open in it.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   266
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   267
 *    @param oldPath dir/archive to remove.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   268
 *   @return nonzero on success, zero on failure.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   269
 *            Specifics of the error can be gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   270
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   271
int PHYSFS_removeFromSearchPath(const char *oldPath);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   272
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   273
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   274
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   275
 * Get the current search path. The default search path is an empty list.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   276
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   277
 * This return value should be considered READ ONLY and points to an internal
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   278
 *  buffer which may change with each call to this function. This means that
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   279
 *  this function is NOT thread safe.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   280
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   281
 * The returned value is an array of strings, with a NULL entry to signify the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   282
 *  end of the list:
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   283
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   284
 * char **i;
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   285
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   286
 * // lock thread here, if needed.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   287
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   288
 * for (i = PHYSFS_getSearchPath(); *i != NULL; i++)
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   289
 *     printf("[%s] is in the search path.\n", *i);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   290
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   291
 * // unlock thread here, if needed.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   292
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   293
 *   @return READ ONLY null-term'd array of READ ONLY null-terminated strings.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   294
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   295
const char **PHYSFS_getSearchPath(void);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   296
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   297
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   298
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   299
 * Helper function.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   300
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   301
 * Set up sane, default paths. The write path will be set to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   302
 *  "userpath/.appName", which is created if it doesn't exist.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   303
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   304
 * The above is sufficient to make sure your program's configuration directory
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   305
 *  is separated from other clutter, and platform-independent. The period
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   306
 *  before "mygame" even hides the directory on Unix systems.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   307
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   308
 *  The search path will be:
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   309
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   310
 *    - The Write Path
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   311
 *    - The Write Path/appName
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   312
 *    - The Base Path (PHYSFS_getBasePath())
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   313
 *    - The Base Path/appName
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   314
 *    - All found CD-ROM paths (optionally)
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   315
 *    - All found CD-ROM paths/appName (optionally)
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   316
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   317
 * These directories are then searched for files ending with the extension
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   318
 *  (archiveExt), which, if they are valid and supported archives, will also
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   319
 *  be added to the search path. If you specified "PKG" for (archiveExt), and
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   320
 *  there's a file named data.PKG in the base dir, it'll be checked. Archives
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   321
 *  can either be appended or prepended to the search path in alphabetical
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   322
 *  order, regardless of which directories they were found in.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   323
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   324
 * All of this can be accomplished from the application, but this just does it
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   325
 *  all for you.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   326
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   327
 *    @param appName Program-specific name of your program, to separate it
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   328
 *                   from other programs using PhysicsFS.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   329
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   330
 *    @param archiveExt File extention used by your program to specify an
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   331
 *                      archive. For example, Quake 3 uses "pk3", even though
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   332
 *                      they are just zipfiles. Specify NULL to not dig out
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   333
 *                      archives automatically.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   334
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   335
 *    @param includeCdRoms Non-zero to include CD-ROMs in the search path, and
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   336
 *                         search them for archives. This may cause a
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   337
 *                         significant amount of blocking while discs are
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   338
 *                         accessed, and if there are no discs in the drive
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   339
 *                         (or even not mounted on Unix systems), then they
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   340
 *                         may not be made available anyhow. You may want to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   341
 *                         specify zero and handle the disc setup yourself.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   342
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   343
 *    @param archivesFirst Non-zero to prepend the archives to the search path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   344
 *                          Zero to append them.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   345
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   346
void PHYSFS_setSanePaths(const char *appName, const char *archiveExt,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   347
                         int includeCdRoms, int archivesFirst);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   348
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   349
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   350
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   351
 * Create a directory. This is specified in platform-independent notation in
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   352
 *  relation to the write path. All missing parent directories are also
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   353
 *  created if they don't exist.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   354
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   355
 * So if you've got the write path set to "C:\mygame\writepath" and call
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   356
 *  PHYSFS_mkdir("downloads/maps") then the directories
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   357
 *  "C:\mygame\writepath\downloads" and "C:\mygame\writepath\downloads\maps"
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   358
 *  will be created if possible.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   359
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   360
 *   @param dirname New path to create.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   361
 *  @return nonzero on success, zero on error. Specifics of the error can be
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   362
 *          gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   363
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   364
int PHYSFS_mkdir(const char *dirName);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   365
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   366
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   367
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   368
 * Delete a file or directory. This is specified in platform-independent
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   369
 *  notation in relation to the write path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   370
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   371
 * A directory must be empty before this call can delete it. If you need to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   372
 *  nuke a whole directory tree, use PHYSFS_deltree()...with care.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   373
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   374
 * So if you've got the write path set to "C:\mygame\writepath" and call
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   375
 *  PHYSFS_delete("downloads/maps/level1.map") then the file
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   376
 *  "C:\mygame\writepath\downloads\maps\level1.map" is removed from the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   377
 *  physical filesystem, if it exists and the operating system permits the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   378
 *  deletion.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   379
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   380
 *   @param filename Filename to delete.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   381
 *  @return nonzero on success, zero on error. Specifics of the error can be
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   382
 *          gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   383
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   384
int PHYSFS_delete(const char *filename);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   385
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   386
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   387
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   388
 * Delete a directory tree. This is specified in platform-independent
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   389
 *  notation in relation to the write path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   390
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   391
 * Be CAREFUL with this function; it will take out EVERYTHING under the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   392
 *  specified directory with extreme prejudice.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   393
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   394
 * If you specify a filename that is not a directory, PhysicsFS will attempt
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   395
 *  to delete that single file.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   396
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   397
 * So if you've got the write path set to "C:\mygame\writepath" and call
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   398
 *  PHYSFS_deltree("downloads/maps") then the directory
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   399
 *  "C:\mygame\writepath\downloads\maps" and everything in it (including child
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   400
 *  directories) is removed from the physical filesystem, if it exists and the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   401
 *  operating system permits the deletion.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   402
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   403
 *   @param filename root of directory tree to delete.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   404
 *  @return nonzero on success, zero on error. Specifics of the error can be
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   405
 *          gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   406
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   407
int PHYSFS_deltree(const char *filename);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   408
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   409
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   410
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   411
 * Enable symbolic links. Some physical filesystems and archives contain
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   412
 *  files that are just pointers to other files. On the physical filesystem,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   413
 *  opening such a link will (transparently) open the file that is pointed to.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   414
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   415
 * By default, PhysicsFS will check if a file is really a symlink during open
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   416
 *  calls and fail if it is. Otherwise, the link could take you outside the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   417
 *  write and search paths, and compromise security.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   418
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   419
 * If you want to take that risk, call this function with a non-zero parameter.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   420
 *  Note that this is more for sandboxing a program's scripting language, in
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   421
 *  case untrusted scripts try to compromise the system. Generally speaking,
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   422
 *  a user could very well have a legitimate reason to set up a symlink, so
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   423
 *  unless you feel there's a specific danger in allowing them, you should
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   424
 *  permit them.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   425
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   426
 * Symbolic link permission can be enabled or disabled at any time, and is
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   427
 *  disabled by default.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   428
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   429
 *   @param allow nonzero to permit symlinks, zero to deny linking.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   430
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   431
void PHYSFS_permitSymbolicLinks(int allow);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   432
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   433
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   434
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   435
 * Determine if a file exists. Just because it exists does NOT mean that you
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   436
 *  will have access to read or write it.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   437
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   438
 *   @param filename a file in platform-independent notation.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   439
 *   @param inWritePath nonzero to check write path, zero to check search path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   440
 *  @return nonzero if exists, zero otherwise.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   441
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   442
int PHYSFS_exists(const char *filename, int inWritePath);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   443
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   444
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   445
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   446
 * Figure out where in the search path a file resides. The file is specified
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   447
 *  in platform-independent notation. The returned filename will be the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   448
 *  element of the search path where the file was found, which may be a
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   449
 *  directory, or an archive. Even if there are multiple matches in different
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   450
 *  parts of the search path, only the first one found is used, just like
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   451
 *  when opening a file.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   452
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   453
 * So, if you look for "maps/level1.map", and C:\mygame is in your search
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   454
 *  path and C:\mygame\maps\level1.map exists, then buffer will be filled in
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   455
 *  with "C:\mygame\maps\level1.map" and the function returns nonzero.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   456
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   457
 *     @param buffer pointer to buffer to fill with path.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   458
 *     @param bufsize size of buffer pointed to by (buffer).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   459
 *     @param filename file to look for.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   460
 *    @return nonzero if file was found, zero otherwise. If found, (buffer)
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   461
 *             will be filled in.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   462
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   463
int PHYSFS_getRealPath(const char *filename, char *buffer, int bufSize);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   464
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   465
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   466
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   467
 * Open a file for writing, in platform-independent notation and in relation
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   468
 *  to the write path as the root of the writable filesystem. The specified
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   469
 *  file is created if it doesn't exist. If it does exist, it is truncated to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   470
 *  zero bytes, and the writing offset is set to the start.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   471
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   472
 *   @param filename File to open.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   473
 *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   474
 *           of the error can be gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   475
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   476
void *PHYSFS_openWrite(const char *filename);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   477
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   478
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   479
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   480
 * Open a file for writing, in platform-independent notation and in relation
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   481
 *  to the write path as the root of the writable filesystem. The specified
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   482
 *  file is created if it doesn't exist. If it does exist, the writing offset
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   483
 *  is set to the end of the file, so the first write will be the byte after
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   484
 *  the end.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   485
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   486
 *   @param filename File to open.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   487
 *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   488
 *           of the error can be gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   489
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   490
void *PHYSFS_openAppend(const char *filename);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   491
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   492
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   493
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   494
 * Open a file for reading, in platform-independent notation. The search path
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   495
 *  is checked one at a time until a matching file is found, in which case an
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   496
 *  abstract filehandle is associated with it, and reading may be done.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   497
 *  The reading offset is set to the first byte of the file.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   498
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   499
 *   @param filename File to open.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   500
 *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   501
 *           of the error can be gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   502
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   503
void *PHYSFS_openRead(const char *filename);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   504
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   505
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   506
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   507
 * Close a PhysicsFS filehandle. This call is capable of failing if the
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   508
 *  operating system was buffering writes to this file, and (now forced to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   509
 *  write those changes to physical media) can not store the data for any
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   510
 *  reason. In such a case, the filehandle stays open. A well-written program
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   511
 *  should ALWAYS check the return value from the close call in addition to
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   512
 *  every writing call!
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   513
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   514
 *   @param handle handle returned from PHYSFS_open*().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   515
 *  @return nonzero on success, zero on error. Specifics of the error can be
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   516
 *          gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   517
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   518
int PHYSFS_close(void *handle);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   519
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   520
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   521
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   522
 * Read data from a PhysicsFS filehandle. The file must be opened for reading.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   523
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   524
 *   @param handle handle returned from PHYSFS_openRead().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   525
 *   @param buffer buffer to store read data into.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   526
 *   @param objSize size in bytes of objects being read from (handle).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   527
 *   @param objCount number of (objSize) objects to read from (handle).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   528
 *  @return number of objects read. PHYSFS_getLastError() can shed light on
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   529
 *           the reason this might be < (objCount).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   530
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   531
int PHYSFS_read(void *handle, void *buffer, int objSize, int objCount);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   532
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   533
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   534
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   535
 * Write data to a PhysicsFS filehandle. The file must be opened for writing.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   536
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   537
 *   @param handle retval from PHYSFS_openWrite() or PHYSFS_openAppend().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   538
 *   @param buffer buffer to store read data into.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   539
 *   @param objSize size in bytes of objects being read from (handle).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   540
 *   @param objCount number of (objSize) objects to read from (handle).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   541
 *  @return number of objects read. PHYSFS_getLastError() can shed light on
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   542
 *           the reason this might be < (objCount).
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   543
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   544
int PHYSFS_write(void *handle, void *buffer, int objSize, int objCount);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   545
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   546
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   547
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   548
 * Determine if the end of file has been reached in a PhysicsFS filehandle.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   549
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   550
 *   @param handle handle returned from PHYSFS_openRead().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   551
 *  @return nonzero if EOF, zero if not.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   552
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   553
int PHYSFS_eof(void *handle);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   554
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   555
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   556
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   557
 * Determine current position within a PhysicsFS filehandle.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   558
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   559
 *   @param handle handle returned from PHYSFS_open*().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   560
 *  @return offset in bytes from start of file. -1 if error occurred.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   561
 *           Specifics of the error can be gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   562
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   563
int PHYSFS_tell(void *handle);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   564
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   565
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   566
/**
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   567
 * Seek to a new position within a PhysicsFS filehandle. The next read or write
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   568
 *  will occur at that place. Seeking past the beginning or end of the file is
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   569
 *  not allowed.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   570
 *
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   571
 *   @param handle handle returned from PHYSFS_open*().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   572
 *   @param pos number of bytes from start of file to seek to.
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   573
 *  @return nonzero on success, zero on error. Specifics of the error can be
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   574
 *          gleaned from PHYSFS_getLastError().
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   575
 */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   576
int PHYSFS_seek(void *handle, int pos);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   577
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   578
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   579
/* Byte-order reading. !!!  Need types (Int16, Int32, etc) for these...
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   580
int PHYSFS_readLE16(void *handle, int *buffer);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   581
int PHYSFS_readLE32(void *handle, int *buffer);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   582
int PHYSFS_readBE16(void *handle, int *buffer);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   583
int PHYSFS_readBE32(void *handle, int *buffer);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   584
int PHYSFS_writeLE16(void *handle, int buffer);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   585
int PHYSFS_writeLE32(void *handle, int buffer);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   586
int PHYSFS_writeBE16(void *handle, int buffer);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   587
int PHYSFS_writeBE32(void *handle, int buffer);
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   588
*/
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   589
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   590
#ifdef __cplusplus
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   591
}
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   592
#endif
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   593
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   594
#endif  /* !defined _INCLUDE_PHYSFS_H_ */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   595
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   596
/* end of physfs.h ... */
b5ce9d35fdb4 Initial revision
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   597