physfs.h
changeset 74 a4a5066fb640
parent 69 546a95cc5591
child 80 e0f3c372cb9d
equal deleted inserted replaced
73:96828990c739 74:a4a5066fb640
   139 
   139 
   140 #ifdef __cplusplus
   140 #ifdef __cplusplus
   141 extern "C" {
   141 extern "C" {
   142 #endif
   142 #endif
   143 
   143 
       
   144 #if (defined _MSC_VER)
       
   145 #define __EXPORT__ __declspec(dllexport)
       
   146 #else
       
   147 #define __EXPORT__
       
   148 #endif
       
   149 
   144 
   150 
   145 typedef struct __PHYSFS_FILE__
   151 typedef struct __PHYSFS_FILE__
   146 {
   152 {
   147     void *opaque;
   153     void *opaque;
   148 } PHYSFS_file;
   154 } PHYSFS_file;
   193  * printf("But we linked against PhysFS version %d.%d.%d.\n",
   199  * printf("But we linked against PhysFS version %d.%d.%d.\n",
   194  *           linked.major, linked.minor, linked.patch);
   200  *           linked.major, linked.minor, linked.patch);
   195  *
   201  *
   196  * This function may be called safely at any time, even before PHYSFS_init().
   202  * This function may be called safely at any time, even before PHYSFS_init().
   197  */
   203  */
   198 void PHYSFS_getLinkedVersion(PHYSFS_Version *ver);
   204 __EXPORT__ void PHYSFS_getLinkedVersion(PHYSFS_Version *ver);
   199 
   205 
   200 
   206 
   201 /**
   207 /**
   202  * Initialize PhysicsFS. This must be called before any other PhysicsFS
   208  * Initialize PhysicsFS. This must be called before any other PhysicsFS
   203  *  function.
   209  *  function.
   207  *
   213  *
   208  *   @param argv0 the argv[0] string passed to your program's mainline.
   214  *   @param argv0 the argv[0] string passed to your program's mainline.
   209  *  @return nonzero on success, zero on error. Specifics of the error can be
   215  *  @return nonzero on success, zero on error. Specifics of the error can be
   210  *          gleaned from PHYSFS_getLastError().
   216  *          gleaned from PHYSFS_getLastError().
   211  */
   217  */
   212 int PHYSFS_init(const char *argv0);
   218 __EXPORT__ int PHYSFS_init(const char *argv0);
   213 
   219 
   214 
   220 
   215 /**
   221 /**
   216  * Shutdown PhysicsFS. This closes any files opened via PhysicsFS, blanks the
   222  * Shutdown PhysicsFS. This closes any files opened via PhysicsFS, blanks the
   217  *  search/write paths, frees memory, and invalidates all of your handles.
   223  *  search/write paths, frees memory, and invalidates all of your handles.
   229  *
   235  *
   230  *  @return nonzero on success, zero on error. Specifics of the error can be
   236  *  @return nonzero on success, zero on error. Specifics of the error can be
   231  *          gleaned from PHYSFS_getLastError(). If failure, state of PhysFS is
   237  *          gleaned from PHYSFS_getLastError(). If failure, state of PhysFS is
   232  *          undefined, and probably badly screwed up.
   238  *          undefined, and probably badly screwed up.
   233  */
   239  */
   234 int PHYSFS_deinit(void);
   240 __EXPORT__ int PHYSFS_deinit(void);
   235 
   241 
   236 
   242 
   237 /**
   243 /**
   238  * Get a list of archive types supported by this implementation of PhysicFS.
   244  * Get a list of archive types supported by this implementation of PhysicFS.
   239  *  These are the file formats usable for search path entries. This is for
   245  *  These are the file formats usable for search path entries. This is for
   255  * The return values are pointers to static internal memory, and should
   261  * The return values are pointers to static internal memory, and should
   256  *  be considered READ ONLY, and never freed.
   262  *  be considered READ ONLY, and never freed.
   257  *
   263  *
   258  *   @return READ ONLY Null-terminated array of READ ONLY structures.
   264  *   @return READ ONLY Null-terminated array of READ ONLY structures.
   259  */
   265  */
   260 const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void);
   266 __EXPORT__ const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void);
   261 
   267 
   262 
   268 
   263 /**
   269 /**
   264  * Certain PhysicsFS functions return lists of information that are
   270  * Certain PhysicsFS functions return lists of information that are
   265  *  dynamically allocated. Use this function to free those resources.
   271  *  dynamically allocated. Use this function to free those resources.
   266  *
   272  *
   267  *   @param list List of information specified as freeable by this function.
   273  *   @param list List of information specified as freeable by this function.
   268  */
   274  */
   269 void PHYSFS_freeList(void *list);
   275 __EXPORT__ void PHYSFS_freeList(void *list);
   270 
   276 
   271 
   277 
   272 /**
   278 /**
   273  * Get the last PhysicsFS error message as a null-terminated string.
   279  * Get the last PhysicsFS error message as a null-terminated string.
   274  *  This will be NULL if there's been no error since the last call to this
   280  *  This will be NULL if there's been no error since the last call to this
   278  *  with that thread. It is safe to call this function at anytime, even
   284  *  with that thread. It is safe to call this function at anytime, even
   279  *  before PHYSFS_init().
   285  *  before PHYSFS_init().
   280  *
   286  *
   281  *   @return READ ONLY string of last error message.
   287  *   @return READ ONLY string of last error message.
   282  */
   288  */
   283 const char *PHYSFS_getLastError(void);
   289 __EXPORT__ const char *PHYSFS_getLastError(void);
   284 
   290 
   285 
   291 
   286 /**
   292 /**
   287  * Get a platform-dependent dir separator. This is "\\" on win32, "/" on Unix,
   293  * Get a platform-dependent dir separator. This is "\\" on win32, "/" on Unix,
   288  *  and ":" on MacOS. It may be more than one character, depending on the
   294  *  and ":" on MacOS. It may be more than one character, depending on the
   292  *  directories. This is also handy for getting platform-independent access
   298  *  directories. This is also handy for getting platform-independent access
   293  *  when using stdio calls.
   299  *  when using stdio calls.
   294  *
   300  *
   295  *   @return READ ONLY null-terminated string of platform's dir separator.
   301  *   @return READ ONLY null-terminated string of platform's dir separator.
   296  */
   302  */
   297 const char *PHYSFS_getDirSeparator(void);
   303 __EXPORT__ const char *PHYSFS_getDirSeparator(void);
   298 
   304 
   299 
   305 
   300 /**
   306 /**
   301  * Enable symbolic links. Some physical filesystems and archives contain
   307  * Enable symbolic links. Some physical filesystems and archives contain
   302  *  files that are just pointers to other files. On the physical filesystem,
   308  *  files that are just pointers to other files. On the physical filesystem,
   320  * Symbolic link permission can be enabled or disabled at any time, and is
   326  * Symbolic link permission can be enabled or disabled at any time, and is
   321  *  disabled by default.
   327  *  disabled by default.
   322  *
   328  *
   323  *   @param allow nonzero to permit symlinks, zero to deny linking.
   329  *   @param allow nonzero to permit symlinks, zero to deny linking.
   324  */
   330  */
   325 void PHYSFS_permitSymbolicLinks(int allow);
   331 __EXPORT__ void PHYSFS_permitSymbolicLinks(int allow);
   326 
   332 
   327 
   333 
   328 /**
   334 /**
   329  * Get an array of dirs to available CD-ROM drives.
   335  * Get an array of dirs to available CD-ROM drives.
   330  *
   336  *
   352  * When you are done with the returned information, you may dispose of the
   358  * When you are done with the returned information, you may dispose of the
   353  *  resources by calling PHYSFS_freeList() with the returned pointer.
   359  *  resources by calling PHYSFS_freeList() with the returned pointer.
   354  *
   360  *
   355  *   @return Null-terminated array of null-terminated strings.
   361  *   @return Null-terminated array of null-terminated strings.
   356  */
   362  */
   357 char **PHYSFS_getCdRomDirs(void);
   363 __EXPORT__ char **PHYSFS_getCdRomDirs(void);
   358 
   364 
   359 
   365 
   360 /**
   366 /**
   361  * Helper function.
   367  * Helper function.
   362  *
   368  *
   366  *
   372  *
   367  * You should probably use the base dir in your search path.
   373  * You should probably use the base dir in your search path.
   368  *
   374  *
   369  *  @return READ ONLY string of base dir in platform-dependent notation.
   375  *  @return READ ONLY string of base dir in platform-dependent notation.
   370  */
   376  */
   371 const char *PHYSFS_getBaseDir(void);
   377 __EXPORT__ const char *PHYSFS_getBaseDir(void);
   372 
   378 
   373 
   379 
   374 /**
   380 /**
   375  * Helper function.
   381  * Helper function.
   376  *
   382  *
   384  * You should probably use the user dir as the basis for your write dir, and
   390  * You should probably use the user dir as the basis for your write dir, and
   385  *  also put it near the beginning of your search path.
   391  *  also put it near the beginning of your search path.
   386  *
   392  *
   387  *  @return READ ONLY string of user dir in platform-dependent notation.
   393  *  @return READ ONLY string of user dir in platform-dependent notation.
   388  */
   394  */
   389 const char *PHYSFS_getUserDir(void);
   395 __EXPORT__ const char *PHYSFS_getUserDir(void);
   390 
   396 
   391 
   397 
   392 /**
   398 /**
   393  * Get the current write dir. The default write dir is NULL.
   399  * Get the current write dir. The default write dir is NULL.
   394  *
   400  *
   395  *  @return READ ONLY string of write dir in platform-dependent notation,
   401  *  @return READ ONLY string of write dir in platform-dependent notation,
   396  *           OR NULL IF NO WRITE PATH IS CURRENTLY SET.
   402  *           OR NULL IF NO WRITE PATH IS CURRENTLY SET.
   397  */
   403  */
   398 const char *PHYSFS_getWriteDir(void);
   404 __EXPORT__ const char *PHYSFS_getWriteDir(void);
   399 
   405 
   400 
   406 
   401 /**
   407 /**
   402  * Set a new write dir. This will override the previous setting. If the
   408  * Set a new write dir. This will override the previous setting. If the
   403  *  directory or a parent directory doesn't exist in the physical filesystem,
   409  *  directory or a parent directory doesn't exist in the physical filesystem,
   413  *  @return non-zero on success, zero on failure. All attempts to open a file
   419  *  @return non-zero on success, zero on failure. All attempts to open a file
   414  *           for writing via PhysicsFS will fail until this call succeeds.
   420  *           for writing via PhysicsFS will fail until this call succeeds.
   415  *           Specifics of the error can be gleaned from PHYSFS_getLastError().
   421  *           Specifics of the error can be gleaned from PHYSFS_getLastError().
   416  *
   422  *
   417  */
   423  */
   418 int PHYSFS_setWriteDir(const char *newDir);
   424 __EXPORT__ int PHYSFS_setWriteDir(const char *newDir);
   419 
   425 
   420 
   426 
   421 /**
   427 /**
   422  * Add a directory or archive to the search path. If this is a duplicate, the
   428  * Add a directory or archive to the search path. If this is a duplicate, the
   423  *  entry is not added again, even though the function succeeds.
   429  *  entry is not added again, even though the function succeeds.
   427  *   @param appendToPath nonzero to append to search path, zero to prepend.
   433  *   @param appendToPath nonzero to append to search path, zero to prepend.
   428  *  @return nonzero if added to path, zero on failure (bogus archive, dir
   434  *  @return nonzero if added to path, zero on failure (bogus archive, dir
   429  *                   missing, etc). Specifics of the error can be
   435  *                   missing, etc). Specifics of the error can be
   430  *                   gleaned from PHYSFS_getLastError().
   436  *                   gleaned from PHYSFS_getLastError().
   431  */
   437  */
   432 int PHYSFS_addToSearchPath(const char *newDir, int appendToPath);
   438 __EXPORT__ int PHYSFS_addToSearchPath(const char *newDir, int appendToPath);
   433 
   439 
   434 
   440 
   435 /**
   441 /**
   436  * Remove a directory or archive from the search path.
   442  * Remove a directory or archive from the search path.
   437  *
   443  *
   443  *
   449  *
   444  *    @param oldDir dir/archive to remove.
   450  *    @param oldDir dir/archive to remove.
   445  *   @return nonzero on success, zero on failure.
   451  *   @return nonzero on success, zero on failure.
   446  *            Specifics of the error can be gleaned from PHYSFS_getLastError().
   452  *            Specifics of the error can be gleaned from PHYSFS_getLastError().
   447  */
   453  */
   448 int PHYSFS_removeFromSearchPath(const char *oldDir);
   454 __EXPORT__ int PHYSFS_removeFromSearchPath(const char *oldDir);
   449 
   455 
   450 
   456 
   451 /**
   457 /**
   452  * Get the current search path. The default search path is an empty list.
   458  * Get the current search path. The default search path is an empty list.
   453  *
   459  *
   463  *  resources by calling PHYSFS_freeList() with the returned pointer.
   469  *  resources by calling PHYSFS_freeList() with the returned pointer.
   464  *
   470  *
   465  *   @return Null-terminated array of null-terminated strings. NULL if there
   471  *   @return Null-terminated array of null-terminated strings. NULL if there
   466  *            was a problem (read: OUT OF MEMORY).
   472  *            was a problem (read: OUT OF MEMORY).
   467  */
   473  */
   468 char **PHYSFS_getSearchPath(void);
   474 __EXPORT__ char **PHYSFS_getSearchPath(void);
   469 
   475 
   470 
   476 
   471 /**
   477 /**
   472  * Helper function.
   478  * Helper function.
   473  *
   479  *
   519  *    @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.
   520  *                          Zero to append them. Ignored if !(archiveExt).
   526  *                          Zero to append them. Ignored if !(archiveExt).
   521  *  @return nonzero on success, zero on error. Specifics of the error can be
   527  *  @return nonzero on success, zero on error. Specifics of the error can be
   522  *          gleaned from PHYSFS_getLastError().
   528  *          gleaned from PHYSFS_getLastError().
   523  */
   529  */
   524 int PHYSFS_setSaneConfig(const char *appName, const char *archiveExt,
   530 __EXPORT__ int PHYSFS_setSaneConfig(const char *appName,
   525                           int includeCdRoms, int archivesFirst);
   531                                     const char *archiveExt,
       
   532                                     int includeCdRoms,
       
   533                                     int archivesFirst);
   526 
   534 
   527 
   535 
   528 /**
   536 /**
   529  * Create a directory. This is specified in platform-independent notation in
   537  * Create a directory. This is specified in platform-independent notation in
   530  *  relation to the write dir. All missing parent directories are also
   538  *  relation to the write dir. All missing parent directories are also
   539  *
   547  *
   540  *   @param dirname New dir to create.
   548  *   @param dirname New dir to create.
   541  *  @return nonzero on success, zero on error. Specifics of the error can be
   549  *  @return nonzero on success, zero on error. Specifics of the error can be
   542  *          gleaned from PHYSFS_getLastError().
   550  *          gleaned from PHYSFS_getLastError().
   543  */
   551  */
   544 int PHYSFS_mkdir(const char *dirName);
   552 __EXPORT__ int PHYSFS_mkdir(const char *dirName);
   545 
   553 
   546 
   554 
   547 /**
   555 /**
   548  * Delete a file or directory. This is specified in platform-independent
   556  * Delete a file or directory. This is specified in platform-independent
   549  *  notation in relation to the write dir.
   557  *  notation in relation to the write dir.
   562  *
   570  *
   563  *   @param filename Filename to delete.
   571  *   @param filename Filename to delete.
   564  *  @return nonzero on success, zero on error. Specifics of the error can be
   572  *  @return nonzero on success, zero on error. Specifics of the error can be
   565  *          gleaned from PHYSFS_getLastError().
   573  *          gleaned from PHYSFS_getLastError().
   566  */
   574  */
   567 int PHYSFS_delete(const char *filename);
   575 __EXPORT__ int PHYSFS_delete(const char *filename);
   568 
   576 
   569 
   577 
   570 /**
   578 /**
   571  * Figure out where in the search path a file resides. The file is specified
   579  * Figure out where in the search path a file resides. The file is specified
   572  *  in platform-independent notation. The returned filename will be the
   580  *  in platform-independent notation. The returned filename will be the
   584  *
   592  *
   585  *     @param filename file to look for.
   593  *     @param filename file to look for.
   586  *    @return READ ONLY string of element of search path containing the
   594  *    @return READ ONLY string of element of search path containing the
   587  *             the file in question. NULL if not found.
   595  *             the file in question. NULL if not found.
   588  */
   596  */
   589 const char *PHYSFS_getRealDir(const char *filename);
   597 __EXPORT__ const char *PHYSFS_getRealDir(const char *filename);
   590 
   598 
   591 
   599 
   592 
   600 
   593 /**
   601 /**
   594  * Get a file listing of a search path's directory. Matching directories are
   602  * Get a file listing of a search path's directory. Matching directories are
   623  *  function when you are done with it.
   631  *  function when you are done with it.
   624  *
   632  *
   625  *    @param dir directory in platform-independent notation to enumerate.
   633  *    @param dir directory in platform-independent notation to enumerate.
   626  *   @return Null-terminated array of null-terminated strings.
   634  *   @return Null-terminated array of null-terminated strings.
   627  */
   635  */
   628 char **PHYSFS_enumerateFiles(const char *dir);
   636 __EXPORT__ char **PHYSFS_enumerateFiles(const char *dir);
   629 
   637 
   630 
   638 
   631 /**
   639 /**
   632  * Determine if there is an entry anywhere in the search path by the
   640  * Determine if there is an entry anywhere in the search path by the
   633  *  name of (fname).
   641  *  name of (fname).
   637  *  might end up further down in the search path than expected.
   645  *  might end up further down in the search path than expected.
   638  *
   646  *
   639  *    @param fname filename in platform-independent notation.
   647  *    @param fname filename in platform-independent notation.
   640  *   @return non-zero if filename exists. zero otherwise.
   648  *   @return non-zero if filename exists. zero otherwise.
   641  */
   649  */
   642 int PHYSFS_exists(const char *fname);
   650 __EXPORT__ int PHYSFS_exists(const char *fname);
   643 
   651 
   644 
   652 
   645 /**
   653 /**
   646  * Determine if the first occurence of (fname) in the search path is
   654  * Determine if the first occurence of (fname) in the search path is
   647  *  really a directory entry.
   655  *  really a directory entry.
   651  *  might end up further down in the search path than expected.
   659  *  might end up further down in the search path than expected.
   652  *
   660  *
   653  *    @param fname filename in platform-independent notation.
   661  *    @param fname filename in platform-independent notation.
   654  *   @return non-zero if filename exists and is a directory.  zero otherwise.
   662  *   @return non-zero if filename exists and is a directory.  zero otherwise.
   655  */
   663  */
   656 int PHYSFS_isDirectory(const char *fname);
   664 __EXPORT__ int PHYSFS_isDirectory(const char *fname);
   657 
   665 
   658 
   666 
   659 /**
   667 /**
   660  * Determine if the first occurence of (fname) in the search path is
   668  * Determine if the first occurence of (fname) in the search path is
   661  *  really a symbolic link.
   669  *  really a symbolic link.
   665  *  this function will always return 0 in that case.
   673  *  this function will always return 0 in that case.
   666  *
   674  *
   667  *    @param fname filename in platform-independent notation.
   675  *    @param fname filename in platform-independent notation.
   668  *   @return non-zero if filename exists and is a symlink.  zero otherwise.
   676  *   @return non-zero if filename exists and is a symlink.  zero otherwise.
   669  */
   677  */
   670 int PHYSFS_isSymbolicLink(const char *fname);
   678 __EXPORT__ int PHYSFS_isSymbolicLink(const char *fname);
   671 
   679 
   672 
   680 
   673 /**
   681 /**
   674  * Open a file for writing, in platform-independent notation and in relation
   682  * Open a file for writing, in platform-independent notation and in relation
   675  *  to the write dir as the root of the writable filesystem. The specified
   683  *  to the write dir as the root of the writable filesystem. The specified
   682  *
   690  *
   683  *   @param filename File to open.
   691  *   @param filename File to open.
   684  *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
   692  *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
   685  *           of the error can be gleaned from PHYSFS_getLastError().
   693  *           of the error can be gleaned from PHYSFS_getLastError().
   686  */
   694  */
   687 PHYSFS_file *PHYSFS_openWrite(const char *filename);
   695 __EXPORT__ PHYSFS_file *PHYSFS_openWrite(const char *filename);
   688 
   696 
   689 
   697 
   690 /**
   698 /**
   691  * Open a file for writing, in platform-independent notation and in relation
   699  * Open a file for writing, in platform-independent notation and in relation
   692  *  to the write dir as the root of the writable filesystem. The specified
   700  *  to the write dir as the root of the writable filesystem. The specified
   700  *
   708  *
   701  *   @param filename File to open.
   709  *   @param filename File to open.
   702  *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
   710  *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
   703  *           of the error can be gleaned from PHYSFS_getLastError().
   711  *           of the error can be gleaned from PHYSFS_getLastError().
   704  */
   712  */
   705 PHYSFS_file *PHYSFS_openAppend(const char *filename);
   713 __EXPORT__ PHYSFS_file *PHYSFS_openAppend(const char *filename);
   706 
   714 
   707 
   715 
   708 /**
   716 /**
   709  * Open a file for reading, in platform-independent notation. The search path
   717  * Open a file for reading, in platform-independent notation. The search path
   710  *  is checked one at a time until a matching file is found, in which case an
   718  *  is checked one at a time until a matching file is found, in which case an
   717  *
   725  *
   718  *   @param filename File to open.
   726  *   @param filename File to open.
   719  *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
   727  *  @return A valid PhysicsFS filehandle on success, NULL on error. Specifics
   720  *           of the error can be gleaned from PHYSFS_getLastError().
   728  *           of the error can be gleaned from PHYSFS_getLastError().
   721  */
   729  */
   722 PHYSFS_file *PHYSFS_openRead(const char *filename);
   730 __EXPORT__ PHYSFS_file *PHYSFS_openRead(const char *filename);
   723 
   731 
   724 
   732 
   725 /**
   733 /**
   726  * Close a PhysicsFS filehandle. This call is capable of failing if the
   734  * Close a PhysicsFS filehandle. This call is capable of failing if the
   727  *  operating system was buffering writes to this file, and (now forced to
   735  *  operating system was buffering writes to this file, and (now forced to
   732  *
   740  *
   733  *   @param handle handle returned from PHYSFS_open*().
   741  *   @param handle handle returned from PHYSFS_open*().
   734  *  @return nonzero on success, zero on error. Specifics of the error can be
   742  *  @return nonzero on success, zero on error. Specifics of the error can be
   735  *          gleaned from PHYSFS_getLastError().
   743  *          gleaned from PHYSFS_getLastError().
   736  */
   744  */
   737 int PHYSFS_close(PHYSFS_file *handle);
   745 __EXPORT__ int PHYSFS_close(PHYSFS_file *handle);
   738 
   746 
   739 
   747 
   740 /**
   748 /**
   741  * Read data from a PhysicsFS filehandle. The file must be opened for reading.
   749  * Read data from a PhysicsFS filehandle. The file must be opened for reading.
   742  *
   750  *
   746  *   @param objCount number of (objSize) objects to read from (handle).
   754  *   @param objCount number of (objSize) objects to read from (handle).
   747  *  @return number of objects read. PHYSFS_getLastError() can shed light on
   755  *  @return number of objects read. PHYSFS_getLastError() can shed light on
   748  *           the reason this might be < (objCount), as can PHYSFS_eof().
   756  *           the reason this might be < (objCount), as can PHYSFS_eof().
   749  *            -1 if complete failure.
   757  *            -1 if complete failure.
   750  */
   758  */
   751 int PHYSFS_read(PHYSFS_file *handle, void *buffer,
   759 __EXPORT__ int PHYSFS_read(PHYSFS_file *handle, void *buffer,
   752                 unsigned int objSize, unsigned int objCount);
   760                            unsigned int objSize, unsigned int objCount);
   753 
   761 
   754 
   762 
   755 /**
   763 /**
   756  * Write data to a PhysicsFS filehandle. The file must be opened for writing.
   764  * Write data to a PhysicsFS filehandle. The file must be opened for writing.
   757  *
   765  *
   760  *   @param objSize size in bytes of objects being read from (handle).
   768  *   @param objSize size in bytes of objects being read from (handle).
   761  *   @param objCount number of (objSize) objects to read from (handle).
   769  *   @param objCount number of (objSize) objects to read from (handle).
   762  *  @return number of objects written. PHYSFS_getLastError() can shed light on
   770  *  @return number of objects written. PHYSFS_getLastError() can shed light on
   763  *           the reason this might be < (objCount). -1 if complete failure.
   771  *           the reason this might be < (objCount). -1 if complete failure.
   764  */
   772  */
   765 int PHYSFS_write(PHYSFS_file *handle, void *buffer,
   773 __EXPORT__ int PHYSFS_write(PHYSFS_file *handle, void *buffer,
   766                  unsigned int objSize, unsigned int objCount);
   774                             unsigned int objSize, unsigned int objCount);
   767 
   775 
   768 
   776 
   769 /**
   777 /**
   770  * Determine if the end of file has been reached in a PhysicsFS filehandle.
   778  * Determine if the end of file has been reached in a PhysicsFS filehandle.
   771  *
   779  *
   772  *   @param handle handle returned from PHYSFS_openRead().
   780  *   @param handle handle returned from PHYSFS_openRead().
   773  *  @return nonzero if EOF, zero if not.
   781  *  @return nonzero if EOF, zero if not.
   774  */
   782  */
   775 int PHYSFS_eof(PHYSFS_file *handle);
   783 __EXPORT__ int PHYSFS_eof(PHYSFS_file *handle);
   776 
   784 
   777 
   785 
   778 /**
   786 /**
   779  * Determine current position within a PhysicsFS filehandle.
   787  * Determine current position within a PhysicsFS filehandle.
   780  *
   788  *
   781  *   @param handle handle returned from PHYSFS_open*().
   789  *   @param handle handle returned from PHYSFS_open*().
   782  *  @return offset in bytes from start of file. -1 if error occurred.
   790  *  @return offset in bytes from start of file. -1 if error occurred.
   783  *           Specifics of the error can be gleaned from PHYSFS_getLastError().
   791  *           Specifics of the error can be gleaned from PHYSFS_getLastError().
   784  */
   792  */
   785 int PHYSFS_tell(PHYSFS_file *handle);
   793 __EXPORT__ int PHYSFS_tell(PHYSFS_file *handle);
   786 
   794 
   787 
   795 
   788 /**
   796 /**
   789  * Seek to a new position within a PhysicsFS filehandle. The next read or write
   797  * Seek to a new position within a PhysicsFS filehandle. The next read or write
   790  *  will occur at that place. Seeking past the beginning or end of the file is
   798  *  will occur at that place. Seeking past the beginning or end of the file is
   793  *   @param handle handle returned from PHYSFS_open*().
   801  *   @param handle handle returned from PHYSFS_open*().
   794  *   @param pos number of bytes from start of file to seek to.
   802  *   @param pos number of bytes from start of file to seek to.
   795  *  @return nonzero on success, zero on error. Specifics of the error can be
   803  *  @return nonzero on success, zero on error. Specifics of the error can be
   796  *          gleaned from PHYSFS_getLastError().
   804  *          gleaned from PHYSFS_getLastError().
   797  */
   805  */
   798 int PHYSFS_seek(PHYSFS_file *handle, int pos);
   806 __EXPORT__ int PHYSFS_seek(PHYSFS_file *handle, int pos);
   799 
   807 
   800 
   808 
   801 /**
   809 /**
   802  * Get total length of a file in bytes. Note that if the file size can't
   810  * Get total length of a file in bytes. Note that if the file size can't
   803  *  be determined (since the archive is "streamed" or whatnot) than this
   811  *  be determined (since the archive is "streamed" or whatnot) than this
   807  *  better yet, don't use at all.
   815  *  better yet, don't use at all.
   808  *
   816  *
   809  *   @param handle handle returned from PHYSFS_open*().
   817  *   @param handle handle returned from PHYSFS_open*().
   810  *  @return size in bytes of the file. -1 if can't be determined.
   818  *  @return size in bytes of the file. -1 if can't be determined.
   811  */
   819  */
   812 int PHYSFS_fileLength(PHYSFS_file *handle);
   820 __EXPORT__ int PHYSFS_fileLength(PHYSFS_file *handle);
   813 
   821 
   814 #ifdef __cplusplus
   822 #ifdef __cplusplus
   815 }
   823 }
   816 #endif
   824 #endif
   817 
   825