physfs.h
changeset 101 bd18e17ad6ad
parent 99 5a5a0d60cbf1
child 126 f5135b499c0c
equal deleted inserted replaced
100:d2f04ab4b412 101:bd18e17ad6ad
   476 
   476 
   477 /**
   477 /**
   478  * Helper function.
   478  * Helper function.
   479  *
   479  *
   480  * Set up sane, default paths. The write dir will be set to
   480  * Set up sane, default paths. The write dir will be set to
   481  *  "userdir/.appName", which is created if it doesn't exist.
   481  *  "userdir/.organization/appName", which is created if it doesn't exist.
   482  *
   482  *
   483  * The above is sufficient to make sure your program's configuration directory
   483  * The above is sufficient to make sure your program's configuration directory
   484  *  is separated from other clutter, and platform-independent. The period
   484  *  is separated from other clutter, and platform-independent. The period
   485  *  before "mygame" even hides the directory on Unix systems.
   485  *  before "mygame" even hides the directory on Unix systems.
   486  *
   486  *
   487  *  The search path will be:
   487  *  The search path will be:
   488  *
   488  *
   489  *    - The Write Dir (created if it doesn't exist)
   489  *    - The Write Dir (created if it doesn't exist)
   490  *    - The Write Dir/appName (created if it doesn't exist)
       
   491  *    - The Base Dir (PHYSFS_getBaseDir())
   490  *    - The Base Dir (PHYSFS_getBaseDir())
   492  *    - The Base Dir/appName (if it exists)
       
   493  *    - All found CD-ROM dirs (optionally)
   491  *    - All found CD-ROM dirs (optionally)
   494  *    - All found CD-ROM dirs/appName (optionally, and if they exist)
       
   495  *
   492  *
   496  * These directories are then searched for files ending with the extension
   493  * These directories are then searched for files ending with the extension
   497  *  (archiveExt), which, if they are valid and supported archives, will also
   494  *  (archiveExt), which, if they are valid and supported archives, will also
   498  *  be added to the search path. If you specified "PKG" for (archiveExt), and
   495  *  be added to the search path. If you specified "PKG" for (archiveExt), and
   499  *  there's a file named data.PKG in the base dir, it'll be checked. Archives
   496  *  there's a file named data.PKG in the base dir, it'll be checked. Archives
   500  *  can either be appended or prepended to the search path in alphabetical
   497  *  can either be appended or prepended to the search path in alphabetical
   501  *  order, regardless of which directories they were found in.
   498  *  order, regardless of which directories they were found in.
   502  *
   499  *
   503  * All of this can be accomplished from the application, but this just does it
   500  * All of this can be accomplished from the application, but this just does it
   504  *  all for you. Feel free to add more to the search path manually, too.
   501  *  all for you. Feel free to add more to the search path manually, too.
       
   502  *
       
   503  *    @param organization Name of your company/group/etc to be used as a
       
   504  *                         dirname, so keep it small, and no-frills.
   505  *
   505  *
   506  *    @param appName Program-specific name of your program, to separate it
   506  *    @param appName Program-specific name of your program, to separate it
   507  *                   from other programs using PhysicsFS.
   507  *                   from other programs using PhysicsFS.
   508  *
   508  *
   509  *    @param archiveExt File extention used by your program to specify an
   509  *    @param archiveExt File extention used by your program to specify an
   522  *                         want to specify zero and handle the disc setup
   522  *                         want to specify zero and handle the disc setup
   523  *                         yourself.
   523  *                         yourself.
   524  *
   524  *
   525  *    @param archivesFirst Non-zero to prepend the archives to the search path.
   525  *    @param archivesFirst Non-zero to prepend the archives to the search path.
   526  *                          Zero to append them. Ignored if !(archiveExt).
   526  *                          Zero to append them. Ignored if !(archiveExt).
       
   527  *
   527  *  @return nonzero on success, zero on error. Specifics of the error can be
   528  *  @return nonzero on success, zero on error. Specifics of the error can be
   528  *          gleaned from PHYSFS_getLastError().
   529  *          gleaned from PHYSFS_getLastError().
   529  */
   530  */
   530 __EXPORT__ int PHYSFS_setSaneConfig(const char *appName,
   531 __EXPORT__ int PHYSFS_setSaneConfig(const char *organization,
       
   532                                     const char *appName,
   531                                     const char *archiveExt,
   533                                     const char *archiveExt,
   532                                     int includeCdRoms,
   534                                     int includeCdRoms,
   533                                     int archivesFirst);
   535                                     int archivesFirst);
   534 
   536 
   535 
   537