equal
deleted
inserted
replaced
13 * NO WARRANTY. |
13 * NO WARRANTY. |
14 * |
14 * |
15 * Unless otherwise stated, the rest of PhysicsFS falls under the zlib license. |
15 * Unless otherwise stated, the rest of PhysicsFS falls under the zlib license. |
16 * Please see LICENSE.txt in the root of the source tree. |
16 * Please see LICENSE.txt in the root of the source tree. |
17 * |
17 * |
18 * SDL falls under the LGPL license. You can get SDL at http://www.libsdl.org/ |
18 * SDL 1.2 falls under the LGPL license. SDL 1.3+ is zlib, like PhysicsFS. |
|
19 * You can get SDL at https://www.libsdl.org/ |
19 * |
20 * |
20 * This file was written by Ryan C. Gordon. (icculus@icculus.org). |
21 * This file was written by Ryan C. Gordon. (icculus@icculus.org). |
21 */ |
22 */ |
22 |
23 |
23 #ifndef _INCLUDE_PHYSFSRWOPS_H_ |
24 #ifndef _INCLUDE_PHYSFSRWOPS_H_ |
24 #define _INCLUDE_PHYSFSRWOPS_H_ |
25 #define _INCLUDE_PHYSFSRWOPS_H_ |
25 |
26 |
26 #include "physfs.h" |
27 #include "physfs.h" |
27 |
|
28 #include "SDL.h" |
28 #include "SDL.h" |
29 |
|
30 #include "physfscompat.h" |
|
31 |
29 |
32 #ifdef __cplusplus |
30 #ifdef __cplusplus |
33 extern "C" { |
31 extern "C" { |
34 #endif |
32 #endif |
35 |
33 |
39 * RWops is closed. PhysicsFS should be configured to your liking before |
37 * RWops is closed. PhysicsFS should be configured to your liking before |
40 * opening files through this method. |
38 * opening files through this method. |
41 * |
39 * |
42 * @param filename File to open in platform-independent notation. |
40 * @param filename File to open in platform-independent notation. |
43 * @return A valid SDL_RWops structure on success, NULL on error. Specifics |
41 * @return A valid SDL_RWops structure on success, NULL on error. Specifics |
44 * of the error can be gleaned from PHYSFS_getLastErrorCode(). |
42 * of the error can be gleaned from PHYSFS_getLastError(). |
45 */ |
43 */ |
46 PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openRead(const char *fname); |
44 PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openRead(const char *fname); |
47 |
45 |
48 /** |
46 /** |
49 * Open a platform-independent filename for writing, and make it accessible |
47 * Open a platform-independent filename for writing, and make it accessible |
51 * RWops is closed. PhysicsFS should be configured to your liking before |
49 * RWops is closed. PhysicsFS should be configured to your liking before |
52 * opening files through this method. |
50 * opening files through this method. |
53 * |
51 * |
54 * @param filename File to open in platform-independent notation. |
52 * @param filename File to open in platform-independent notation. |
55 * @return A valid SDL_RWops structure on success, NULL on error. Specifics |
53 * @return A valid SDL_RWops structure on success, NULL on error. Specifics |
56 * of the error can be gleaned from PHYSFS_getLastErrorCode(). |
54 * of the error can be gleaned from PHYSFS_getLastError(). |
57 */ |
55 */ |
58 PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname); |
56 PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname); |
59 |
57 |
60 /** |
58 /** |
61 * Open a platform-independent filename for appending, and make it accessible |
59 * Open a platform-independent filename for appending, and make it accessible |
63 * RWops is closed. PhysicsFS should be configured to your liking before |
61 * RWops is closed. PhysicsFS should be configured to your liking before |
64 * opening files through this method. |
62 * opening files through this method. |
65 * |
63 * |
66 * @param filename File to open in platform-independent notation. |
64 * @param filename File to open in platform-independent notation. |
67 * @return A valid SDL_RWops structure on success, NULL on error. Specifics |
65 * @return A valid SDL_RWops structure on success, NULL on error. Specifics |
68 * of the error can be gleaned from PHYSFS_getLastErrorCode(). |
66 * of the error can be gleaned from PHYSFS_getLastError(). |
69 */ |
67 */ |
70 PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname); |
68 PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname); |
71 |
69 |
72 /** |
70 /** |
73 * Make a SDL_RWops from an existing PhysicsFS file handle. You should |
71 * Make a SDL_RWops from an existing PhysicsFS file handle. You should |
75 * the RWops. The actual PhysicsFS handle will be destroyed when the |
73 * the RWops. The actual PhysicsFS handle will be destroyed when the |
76 * RWops is closed. |
74 * RWops is closed. |
77 * |
75 * |
78 * @param handle a valid PhysicsFS file handle. |
76 * @param handle a valid PhysicsFS file handle. |
79 * @return A valid SDL_RWops structure on success, NULL on error. Specifics |
77 * @return A valid SDL_RWops structure on success, NULL on error. Specifics |
80 * of the error can be gleaned from PHYSFS_getLastErrorCode(). |
78 * of the error can be gleaned from PHYSFS_getLastError(). |
81 */ |
79 */ |
82 PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle); |
80 PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle); |
83 |
81 |
84 #ifdef __cplusplus |
82 #ifdef __cplusplus |
85 } |
83 } |