1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */
28 module derelict.physfs.statfun;
29 
30 version(Derelict_Static) version = DerelictPHYSFS_Static;
31 version(DerelictPHYSFS_Static):
32 
33 public import derelict.physfs.types;
34 
35 extern(C) @nogc nothrow {
36     // 2.0 API
37 	void PHYSFS_getLinkedVersion(PHYSFS_Version*);
38 	int PHYSFS_init(const(char)*);
39 	int PHYSFS_deinit();
40 	const(PHYSFS_ArchiveInfo*)* PHYSFS_supportedArchiveTypes();
41 	void PHYSFS_freeList(void*);
42 	const(char)* PHYSFS_getLastError();
43 	const(char)* PHYSFS_getDirSeparator();
44 	void PHYSFS_permitSymbolicLinks(int);
45 	char** PHYSFS_getCdRomDirs();
46 	const(char)* PHYSFS_getBaseDir();
47 	const(char)* PHYSFS_getUserDir();
48 	const(char)* PHYSFS_getWriteDir();
49 	int PHYSFS_setWriteDir(const(char)*);
50 	int PHYSFS_addToSearchPath(const(char)*, int);
51 	int PHYSFS_removeFromSearchPath(const(char)*);
52 	char** PHYSFS_getSearchPath();
53 	int PHYSFS_setSaneConfig(const(char)*, const(char)*, const(char)*, int, int);
54 	int PHYSFS_mkdir(const(char)*);
55 	int PHYSFS_delete(const(char)*);
56 	const(char)* PHYSFS_getRealDir(const(char)*);
57 	char** PHYSFS_enumerateFiles(const(char)*);
58 	int PHYSFS_exists(const(char)*);
59 	int PHYSFS_isDirectory(const(char)*);
60 	int PHYSFS_isSymbolicLink(const(char)*);
61 	PHYSFS_sint64 PHYSFS_getLastModTime(const(char)*);
62 	PHYSFS_File* PHYSFS_openWrite(const(char)*);
63 	PHYSFS_File* PHYSFS_openAppend(const(char)*);
64 	PHYSFS_File* PHYSFS_openRead(const(char)*);
65 	int PHYSFS_close(PHYSFS_File*);
66 	PHYSFS_sint64 PHYSFS_read(PHYSFS_File*, void*, PHYSFS_uint32, PHYSFS_uint32);
67 	PHYSFS_sint64 PHYSFS_write(PHYSFS_File*, const(void)*, PHYSFS_uint32, PHYSFS_uint32);
68 	int PHYSFS_eof(PHYSFS_File*);
69 	PHYSFS_sint64 PHYSFS_tell(PHYSFS_File*);
70 	int PHYSFS_seek(PHYSFS_File*, PHYSFS_uint64);
71 	PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_File*);
72 	int PHYSFS_setBuffer(PHYSFS_File*, PHYSFS_uint64);
73 	int PHYSFS_flush(PHYSFS_File*);
74 	PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16);
75 	PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16);
76 	PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32);
77 	PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32);
78 	PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64);
79 	PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64);
80 	PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16);
81 	PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16);
82 	PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32);
83 	PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32);
84 	PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64);
85 	PHYSFS_sint64 PHYSFS_swapUBE64(PHYSFS_uint64);
86 	int PHYSFS_readSLE16(PHYSFS_File*, PHYSFS_sint16*);
87 	int PHYSFS_readULE16(PHYSFS_File*, PHYSFS_uint16*);
88 	int PHYSFS_readSLE32(PHYSFS_File*, PHYSFS_sint32*);
89 	int PHYSFS_readULE32(PHYSFS_File*, PHYSFS_uint32*);
90 	int PHYSFS_readSLE64(PHYSFS_File*, PHYSFS_sint64*);
91 	int PHYSFS_readULE64(PHYSFS_File*, PHYSFS_uint64*);
92 	int PHYSFS_readSBE16(PHYSFS_File*, PHYSFS_sint16*);
93 	int PHYSFS_readUBE16(PHYSFS_File*, PHYSFS_uint16*);
94 	int PHYSFS_readSBE32(PHYSFS_File*, PHYSFS_sint32*);
95 	int PHYSFS_readUBE32(PHYSFS_File*, PHYSFS_uint32*);
96 	int PHYSFS_readSBE64(PHYSFS_File*, PHYSFS_sint64*);
97 	int PHYSFS_readUBE64(PHYSFS_File*, PHYSFS_uint64*);
98 	int PHYSFS_writeSLE16(PHYSFS_File*, PHYSFS_sint16);
99 	int PHYSFS_writeULE16(PHYSFS_File*, PHYSFS_uint16);
100 	int PHYSFS_writeSLE32(PHYSFS_File*, PHYSFS_sint32);
101 	int PHYSFS_writeULE32(PHYSFS_File*, PHYSFS_uint32);
102 	int PHYSFS_writeSLE64(PHYSFS_File*, PHYSFS_sint64);
103 	int PHYSFS_writeULE64(PHYSFS_File*, PHYSFS_uint64);
104 	int PHYSFS_writeSBE16(PHYSFS_File*, PHYSFS_sint16);
105 	int PHYSFS_writeUBE16(PHYSFS_File*, PHYSFS_uint16);
106 	int PHYSFS_writeSBE32(PHYSFS_File*, PHYSFS_sint32);
107 	int PHYSFS_writeUBE32(PHYSFS_File*, PHYSFS_uint32);
108 	int PHYSFS_writeSBE64(PHYSFS_File*, PHYSFS_sint64);
109 	int PHYSFS_writeUBE64(PHYSFS_File*, PHYSFS_uint64);
110 	int PHYSFS_isInit();
111 	int PHYSFS_symbolicLinksPermitted();
112 	int PHYSFS_setAllocator(const(PHYSFS_Allocator)*);
113 	int PHYSFS_mount(const(char)*, const(char)*, int);
114 	const(char)* PHYSFS_getMountPoint(const(char)*);
115 	void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback, void*);
116 	void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback, void*);
117 	void PHYSFS_enumerateFilesCallback(const(char)*, PHYSFS_EnumFilesCallback, void*);
118 	void PHYSFS_utf8FromUcs4(const(PHYSFS_uint32)*, char*, PHYSFS_uint64);
119 	void PHYSFS_utf8ToUcs4(const(char)*, PHYSFS_uint32*, PHYSFS_uint64);
120 	void PHYSFS_utf8FromUcs2(const(PHYSFS_uint16)*, char*, PHYSFS_uint64);
121 	void PHYSFS_utf8ToUcs2(const(char)*, PHYSFS_uint16*, PHYSFS_uint64);
122 	void PHYSFS_utf8FromLatin1(const(char)*, char*, PHYSFS_uint64);
123     // 2.1 API
124 	int PHYSFS_unmount(const(char)*);
125 	const(PHYSFS_Allocator)* PHYSFS_getAllocator();
126 	int PHYSFS_stat(const(char)*, PHYSFS_Stat*);
127 	void PHYSFS_utf8FromUtf16(const(PHYSFS_uint16)*, char*, PHYSFS_uint64);
128 	void PHYSFS_utf8ToUtf16(const(char)*, PHYSFS_uint16*, PHYSFS_uint64);
129 	PHYSFS_sint64 PHYSFS_readBytes(PHYSFS_File*, void*, PHYSFS_uint64);
130 	PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File*, const(void)*, PHYSFS_uint64);
131 	int PHYSFS_mountIo(PHYSFS_Io*, const(char)*, const(char)*, int);
132 	int PHYSFS_mountMemory(const(void)*, PHYSFS_uint64, UnmountCallback, const(char)*, int);
133 	int PHYSFS_mountHandle(PHYSFS_File*, const(char)*, const(char)*, int);
134 	PHYSFS_ErrorCode PHYSFS_getLastErrorCode();
135 	const(char)* PHYSFS_getErrorByCode(PHYSFS_ErrorCode);
136 	void PHYSFS_setErrorCode(PHYSFS_ErrorCode);
137 	const(char)* PHYSFS_getPrefDir(const(char)*, const(char)*);
138 	int PHYSFS_registerArchiver(const(PHYSFS_Archiver)*);
139 	int PHYSFS_deregisterArchiver(const(char)*);
140 }