author | Ryan C. Gordon <icculus@icculus.org> |
Mon, 18 Jan 2021 18:33:00 -0500 | |
changeset 1693 | d233dd1faf89 |
parent 1509 | 691220545679 |
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 |
* |
1509
691220545679
Fixed a comment about SDL licensing.
Ryan C. Gordon <icculus@icculus.org>
parents:
1373
diff
changeset
|
18 |
* SDL 1.2 falls under the LGPL license. SDL 1.3+ is zlib, like PhysicsFS. |
691220545679
Fixed a comment about SDL licensing.
Ryan C. Gordon <icculus@icculus.org>
parents:
1373
diff
changeset
|
19 |
* You can get SDL at https://www.libsdl.org/ |
123 | 20 |
* |
767
db29bf06d171
Changed my email address.
Ryan C. Gordon <icculus@icculus.org>
parents:
654
diff
changeset
|
21 |
* This file was written by Ryan C. Gordon. (icculus@icculus.org). |
123 | 22 |
*/ |
23 |
||
24 |
#ifndef _INCLUDE_PHYSFSRWOPS_H_ |
|
25 |
#define _INCLUDE_PHYSFSRWOPS_H_ |
|
26 |
||
27 |
#include "physfs.h" |
|
28 |
#include "SDL.h" |
|
29 |
||
30 |
#ifdef __cplusplus |
|
31 |
extern "C" { |
|
32 |
#endif |
|
33 |
||
34 |
/** |
|
35 |
* Open a platform-independent filename for reading, and make it accessible |
|
36 |
* via an SDL_RWops structure. The file will be closed in PhysicsFS when the |
|
37 |
* RWops is closed. PhysicsFS should be configured to your liking before |
|
38 |
* opening files through this method. |
|
39 |
* |
|
40 |
* @param filename File to open in platform-independent notation. |
|
41 |
* @return A valid SDL_RWops structure on success, NULL on error. Specifics |
|
42 |
* of the error can be gleaned from PHYSFS_getLastError(). |
|
43 |
*/ |
|
1024
199e38498938
Renamed __EXPORT__ to PHYSFS_DECL.
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
44 |
PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openRead(const char *fname); |
123 | 45 |
|
46 |
/** |
|
47 |
* Open a platform-independent filename for writing, and make it accessible |
|
48 |
* via an SDL_RWops structure. The file will be closed in PhysicsFS when the |
|
49 |
* RWops is closed. PhysicsFS should be configured to your liking before |
|
50 |
* opening files through this method. |
|
51 |
* |
|
52 |
* @param filename File to open in platform-independent notation. |
|
53 |
* @return A valid SDL_RWops structure on success, NULL on error. Specifics |
|
54 |
* of the error can be gleaned from PHYSFS_getLastError(). |
|
55 |
*/ |
|
1024
199e38498938
Renamed __EXPORT__ to PHYSFS_DECL.
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
56 |
PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname); |
123 | 57 |
|
58 |
/** |
|
59 |
* Open a platform-independent filename for appending, and make it accessible |
|
60 |
* via an SDL_RWops structure. The file will be closed in PhysicsFS when the |
|
61 |
* RWops is closed. PhysicsFS should be configured to your liking before |
|
62 |
* opening files through this method. |
|
63 |
* |
|
64 |
* @param filename File to open in platform-independent notation. |
|
65 |
* @return A valid SDL_RWops structure on success, NULL on error. Specifics |
|
66 |
* of the error can be gleaned from PHYSFS_getLastError(). |
|
67 |
*/ |
|
1024
199e38498938
Renamed __EXPORT__ to PHYSFS_DECL.
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
68 |
PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname); |
123 | 69 |
|
70 |
/** |
|
71 |
* Make a SDL_RWops from an existing PhysicsFS file handle. You should |
|
72 |
* dispose of any references to the handle after successful creation of |
|
73 |
* the RWops. The actual PhysicsFS handle will be destroyed when the |
|
74 |
* RWops is closed. |
|
75 |
* |
|
76 |
* @param handle a valid PhysicsFS file handle. |
|
77 |
* @return A valid SDL_RWops structure on success, NULL on error. Specifics |
|
78 |
* of the error can be gleaned from PHYSFS_getLastError(). |
|
79 |
*/ |
|
1024
199e38498938
Renamed __EXPORT__ to PHYSFS_DECL.
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
80 |
PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle); |
123 | 81 |
|
82 |
#ifdef __cplusplus |
|
83 |
} |
|
84 |
#endif |
|
85 |
||
86 |
#endif /* include-once blocker */ |
|
87 |
||
88 |
/* end of physfsrwops.h ... */ |
|
89 |