2 * This code provides a glue layer between PhysicsFS and Simple Directmedia
3 * Layer's (SDL) RWops i/o abstraction.
5 * License: this code is public domain. I make no warranty that it is useful,
6 * correct, harmless, or environmentally safe.
8 * This particular file may be used however you like, including copying it
9 * verbatim into a closed-source project, exploiting it commercially, and
10 * removing any trace of my name from the source (although I hope you won't
11 * do that). I welcome enhancements and corrections to this file, but I do
12 * not require you to send me patches if you make changes.
14 * Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser
15 * General Public License: http://www.gnu.org/licenses/lgpl.txt
17 * SDL falls under the LGPL, too. You can get SDL at http://www.libsdl.org/
19 * This file was written by Ryan C. Gordon. (icculus@icculus.org).
22 #ifndef _INCLUDE_PHYSFSRWOPS_H_
23 #define _INCLUDE_PHYSFSRWOPS_H_
33 * Open a platform-independent filename for reading, and make it accessible
34 * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
35 * RWops is closed. PhysicsFS should be configured to your liking before
36 * opening files through this method.
38 * @param filename File to open in platform-independent notation.
39 * @return A valid SDL_RWops structure on success, NULL on error. Specifics
40 * of the error can be gleaned from PHYSFS_getLastError().
42 __EXPORT__ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
45 * Open a platform-independent filename for writing, and make it accessible
46 * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
47 * RWops is closed. PhysicsFS should be configured to your liking before
48 * opening files through this method.
50 * @param filename File to open in platform-independent notation.
51 * @return A valid SDL_RWops structure on success, NULL on error. Specifics
52 * of the error can be gleaned from PHYSFS_getLastError().
54 __EXPORT__ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
57 * Open a platform-independent filename for appending, and make it accessible
58 * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
59 * RWops is closed. PhysicsFS should be configured to your liking before
60 * opening files through this method.
62 * @param filename File to open in platform-independent notation.
63 * @return A valid SDL_RWops structure on success, NULL on error. Specifics
64 * of the error can be gleaned from PHYSFS_getLastError().
66 __EXPORT__ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
69 * Make a SDL_RWops from an existing PhysicsFS file handle. You should
70 * dispose of any references to the handle after successful creation of
71 * the RWops. The actual PhysicsFS handle will be destroyed when the
74 * @param handle a valid PhysicsFS file handle.
75 * @return A valid SDL_RWops structure on success, NULL on error. Specifics
76 * of the error can be gleaned from PHYSFS_getLastError().
78 __EXPORT__ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle);
84 #endif /* include-once blocker */
86 /* end of physfsrwops.h ... */