author | Ryan C. Gordon <icculus@icculus.org> |
Sun, 11 Mar 2007 10:10:28 +0000 | |
changeset 809 | 116b8fe30371 |
parent 767 | db29bf06d171 |
child 1024 | 199e38498938 |
permissions | -rw-r--r-- |
123 | 1 |
/* |
2 |
* This code provides a glue layer between PhysicsFS and Simple Directmedia |
|
3 |
* Layer's (SDL) RWops i/o abstraction. |
|
4 |
* |
|
5 |
* License: this code is public domain. I make no warranty that it is useful, |
|
6 |
* correct, harmless, or environmentally safe. |
|
7 |
* |
|
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 |
|
576
5da65f8e9a50
Switched to zlib license.
Ryan C. Gordon <icculus@icculus.org>
parents:
132
diff
changeset
|
12 |
* not require you to send me patches if you make changes. This code has |
5da65f8e9a50
Switched to zlib license.
Ryan C. Gordon <icculus@icculus.org>
parents:
132
diff
changeset
|
13 |
* NO WARRANTY. |
123 | 14 |
* |
576
5da65f8e9a50
Switched to zlib license.
Ryan C. Gordon <icculus@icculus.org>
parents:
132
diff
changeset
|
15 |
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license. |
809
116b8fe30371
Renamed LICENSE to LICENSE.txt
Ryan C. Gordon <icculus@icculus.org>
parents:
767
diff
changeset
|
16 |
* Please see LICENSE.txt in the root of the source tree. |
123 | 17 |
* |
576
5da65f8e9a50
Switched to zlib license.
Ryan C. Gordon <icculus@icculus.org>
parents:
132
diff
changeset
|
18 |
* SDL falls under the LGPL license. You can get SDL at http://www.libsdl.org/ |
123 | 19 |
* |
767
db29bf06d171
Changed my email address.
Ryan C. Gordon <icculus@icculus.org>
parents:
654
diff
changeset
|
20 |
* This file was written by Ryan C. Gordon. (icculus@icculus.org). |
123 | 21 |
*/ |
22 |
||
23 |
#ifndef _INCLUDE_PHYSFSRWOPS_H_ |
|
24 |
#define _INCLUDE_PHYSFSRWOPS_H_ |
|
25 |
||
26 |
#include "physfs.h" |
|
27 |
#include "SDL.h" |
|
28 |
||
29 |
#ifdef __cplusplus |
|
30 |
extern "C" { |
|
31 |
#endif |
|
32 |
||
33 |
/** |
|
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. |
|
38 |
* |
|
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(). |
|
42 |
*/ |
|
43 |
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname); |
|
44 |
||
45 |
/** |
|
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. |
|
50 |
* |
|
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(). |
|
54 |
*/ |
|
55 |
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname); |
|
56 |
||
57 |
/** |
|
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. |
|
62 |
* |
|
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(). |
|
66 |
*/ |
|
67 |
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname); |
|
68 |
||
69 |
/** |
|
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 |
|
73 |
* RWops is closed. |
|
74 |
* |
|
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(). |
|
78 |
*/ |
|
654
c0ae01de361d
Changed PHYSFS_file to PHYSFS_File to match rest of API's naming
Ryan C. Gordon <icculus@icculus.org>
parents:
576
diff
changeset
|
79 |
__EXPORT__ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle); |
123 | 80 |
|
81 |
#ifdef __cplusplus |
|
82 |
} |
|
83 |
#endif |
|
84 |
||
85 |
#endif /* include-once blocker */ |
|
86 |
||
87 |
/* end of physfsrwops.h ... */ |
|
88 |