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. This code has
15 * Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
16 * Please see LICENSE in the root of the source tree.
18 * SDL falls under the LGPL license. You can get SDL at http://www.libsdl.org/
20 * This file was written by Ryan C. Gordon. (icculus@clutteredmind.org).
23 #ifndef _INCLUDE_PHYSFSRWOPS_H_
24 #define _INCLUDE_PHYSFSRWOPS_H_
34 * Open a platform-independent filename for reading, and make it accessible
35 * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
36 * RWops is closed. PhysicsFS should be configured to your liking before
37 * opening files through this method.
39 * @param filename File to open in platform-independent notation.
40 * @return A valid SDL_RWops structure on success, NULL on error. Specifics
41 * of the error can be gleaned from PHYSFS_getLastError().
43 __EXPORT__ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
46 * Open a platform-independent filename for writing, and make it accessible
47 * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
48 * RWops is closed. PhysicsFS should be configured to your liking before
49 * opening files through this method.
51 * @param filename File to open in platform-independent notation.
52 * @return A valid SDL_RWops structure on success, NULL on error. Specifics
53 * of the error can be gleaned from PHYSFS_getLastError().
55 __EXPORT__ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
58 * Open a platform-independent filename for appending, and make it accessible
59 * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
60 * RWops is closed. PhysicsFS should be configured to your liking before
61 * opening files through this method.
63 * @param filename File to open in platform-independent notation.
64 * @return A valid SDL_RWops structure on success, NULL on error. Specifics
65 * of the error can be gleaned from PHYSFS_getLastError().
67 __EXPORT__ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
70 * Make a SDL_RWops from an existing PhysicsFS file handle. You should
71 * dispose of any references to the handle after successful creation of
72 * the RWops. The actual PhysicsFS handle will be destroyed when the
75 * @param handle a valid PhysicsFS file handle.
76 * @return A valid SDL_RWops structure on success, NULL on error. Specifics
77 * of the error can be gleaned from PHYSFS_getLastError().
79 __EXPORT__ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle);
85 #endif /* include-once blocker */
87 /* end of physfsrwops.h ... */