physfs.h
changeset 625 60b5f566a258
parent 609 3a91332776e0
child 644 1cb5533d369c
child 655 1c64ddf508f1
equal deleted inserted replaced
624:7da70fac2126 625:60b5f566a258
    24  *  directories (the "search path") for reading. You can think of this as a
    24  *  directories (the "search path") for reading. You can think of this as a
    25  *  filesystem within a filesystem. If (on Windows) you were to set the
    25  *  filesystem within a filesystem. If (on Windows) you were to set the
    26  *  writing directory to "C:\MyGame\MyWritingDirectory", then no PHYSFS calls
    26  *  writing directory to "C:\MyGame\MyWritingDirectory", then no PHYSFS calls
    27  *  could touch anything above this directory, including the "C:\MyGame" and
    27  *  could touch anything above this directory, including the "C:\MyGame" and
    28  *  "C:\" directories. This prevents an application's internal scripting
    28  *  "C:\" directories. This prevents an application's internal scripting
    29  *  language from piddling over c:\config.sys, for example. If you'd rather
    29  *  language from piddling over c:\\config.sys, for example. If you'd rather
    30  *  give PHYSFS full access to the system's REAL file system, set the writing
    30  *  give PHYSFS full access to the system's REAL file system, set the writing
    31  *  dir to "C:\", but that's generally A Bad Thing for several reasons.
    31  *  dir to "C:\", but that's generally A Bad Thing for several reasons.
    32  *
    32  *
    33  * Drive letters are hidden in PhysicsFS once you set up your initial paths.
    33  * Drive letters are hidden in PhysicsFS once you set up your initial paths.
    34  *  The search path creates a single, hierarchical directory structure.
    34  *  The search path creates a single, hierarchical directory structure.
    59  *  formats.
    59  *  formats.
    60  *
    60  *
    61  * Once the search path is defined, you may open files for reading. If you've
    61  * Once the search path is defined, you may open files for reading. If you've
    62  *  got the following search path defined (to use a win32 example again):
    62  *  got the following search path defined (to use a win32 example again):
    63  *
    63  *
    64  *    C:\mygame
    64  *  - C:\\mygame
    65  *    C:\mygame\myuserfiles
    65  *  - C:\\mygame\\myuserfiles
    66  *    D:\mygamescdromdatafiles
    66  *  - D:\\mygamescdromdatafiles
    67  *    C:\mygame\installeddatafiles.zip
    67  *  - C:\\mygame\\installeddatafiles.zip
    68  *
    68  *
    69  * Then a call to PHYSFS_openRead("textfiles/myfile.txt") (note the directory
    69  * Then a call to PHYSFS_openRead("textfiles/myfile.txt") (note the directory
    70  *  separator, lack of drive letter, and lack of dir separator at the start of
    70  *  separator, lack of drive letter, and lack of dir separator at the start of
    71  *  the string; this is platform-independent notation) will check for
    71  *  the string; this is platform-independent notation) will check for
    72  *  C:\mygame\textfiles\myfile.txt, then
    72  *  C:\\mygame\\textfiles\\myfile.txt, then
    73  *  C:\mygame\myuserfiles\textfiles\myfile.txt, then
    73  *  C:\\mygame\\myuserfiles\\textfiles\\myfile.txt, then
    74  *  D:\mygamescdromdatafiles\textfiles\myfile.txt, then, finally, for
    74  *  D:\\mygamescdromdatafiles\\textfiles\\myfile.txt, then, finally, for
    75  *  textfiles\myfile.txt inside of C:\mygame\installeddatafiles.zip. Remember
    75  *  textfiles\\myfile.txt inside of C:\\mygame\\installeddatafiles.zip.
    76  *  that most archive types and platform filesystems store their filenames in
    76  *  Remember that most archive types and platform filesystems store their
    77  *  a case-sensitive manner, so you should be careful to specify it correctly.
    77  *  filenames in a case-sensitive manner, so you should be careful to specify
       
    78  *  it correctly.
    78  *
    79  *
    79  * Files opened through PhysicsFS may NOT contain "." or ".." or ":" as dir
    80  * Files opened through PhysicsFS may NOT contain "." or ".." or ":" as dir
    80  *  elements. Not only are these meaningless on MacOS and/or Unix, they are a
    81  *  elements. Not only are these meaningless on MacOS and/or Unix, they are a
    81  *  security hole. Also, symbolic links (which can be found in some archive
    82  *  security hole. Also, symbolic links (which can be found in some archive
    82  *  types and directly in the filesystem on Unix platforms) are NOT followed
    83  *  types and directly in the filesystem on Unix platforms) are NOT followed
   315     PHYSFS_uint8 minor; /**< minor revision */
   316     PHYSFS_uint8 minor; /**< minor revision */
   316     PHYSFS_uint8 patch; /**< patchlevel */
   317     PHYSFS_uint8 patch; /**< patchlevel */
   317 } PHYSFS_Version;
   318 } PHYSFS_Version;
   318 
   319 
   319 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
   320 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
   320 #define PHYSFS_VER_MAJOR 0
   321 #define PHYSFS_VER_MAJOR 1
   321 #define PHYSFS_VER_MINOR 1
   322 #define PHYSFS_VER_MINOR 0
   322 #define PHYSFS_VER_PATCH 9
   323 #define PHYSFS_VER_PATCH 0
   323 #endif  /* DOXYGEN_SHOULD_IGNORE_THIS */
   324 #endif  /* DOXYGEN_SHOULD_IGNORE_THIS */
   324 
   325 
   325 
   326 
   326 /* PhysicsFS state stuff ... */
   327 /* PhysicsFS state stuff ... */
   327 
   328 
   852  *  filename will be the element of the search path where the file was found,
   853  *  filename will be the element of the search path where the file was found,
   853  *  which may be a directory, or an archive. Even if there are multiple
   854  *  which may be a directory, or an archive. Even if there are multiple
   854  *  matches in different parts of the search path, only the first one found
   855  *  matches in different parts of the search path, only the first one found
   855  *  is used, just like when opening a file.
   856  *  is used, just like when opening a file.
   856  *
   857  *
   857  * So, if you look for "maps/level1.map", and C:\mygame is in your search
   858  * So, if you look for "maps/level1.map", and C:\\mygame is in your search
   858  *  path and C:\mygame\maps\level1.map exists, then "C:\mygame" is returned.
   859  *  path and C:\\mygame\\maps\\level1.map exists, then "C:\mygame" is returned.
   859  *
   860  *
   860  * If a any part of a match is a symbolic link, and you've not explicitly
   861  * If a any part of a match is a symbolic link, and you've not explicitly
   861  *  permitted symlinks, then it will be ignored, and the search for a match
   862  *  permitted symlinks, then it will be ignored, and the search for a match
   862  *  will continue.
   863  *  will continue.
   863  *
   864  *