1 module stormlibd.StaticFunctions;
2 
3 version(DerelictPQ_Static):
4 
5 public import stormlibd.Types;
6 
7 extern(C) @nogc nothrow {
8 	// Functions for manipulation with StormLib global flags
9 	LCID SFileGetLocale();
10 	LCID SFileSetLocale(LCID);
11 	
12 	// Functions for archive manipulation
13 	bool SFileOpenArchive(const TCHAR*, DWORD, DWORD, HANDLE*);
14 	bool SFileCreateArchive(const TCHAR*, DWORD, DWORD, HANDLE*);
15 	bool SFileCreateArchive2(const TCHAR*, PSFILE_CREATE_MPQ, HANDLE*);
16 
17 	bool SFileSetDownloadCallback(HANDLE, SFILE_DOWNLOAD_CALLBACK, void*);
18 	bool SFileFlushArchive(HANDLE);
19 	bool SFileCloseArchive(HANDLE);
20 
21 	// Adds another listfile into MPQ. The currently added listfile(s) remain,
22 	// so you can use this API to combining more listfiles.
23 	// Note that this function is internally called by SFileFindFirstFile
24 	int SFileAddListFile(HANDLE, const TCHAR*);
25 
26 	// Archive compacting
27 	bool SFileSetCompactCallback(HANDLE, SFILE_COMPACT_CALLBACK, void*);
28 	bool SFileCompactArchive(HANDLE, const TCHAR*, bool);
29 
30 	// Changing the maximum file count
31 	DWORD SFileGetMaxFileCount(HANDLE);
32 	bool SFileSetMaxFileCount(HANDLE, DWORD);
33 
34 	// Changing (attributes) file
35 	DWORD SFileGetAttributes(HANDLE);
36 	bool SFileSetAttributes(HANDLE, DWORD);
37 	bool SFileUpdateFileAttributes(HANDLE, const char*);
38 
39 	// Functions for manipulation with patch archives
40     bool SFileOpenPatchArchive(HANDLE, const TCHAR*, const char*, DWORD);
41     bool SFileIsPatchedArchive(HANDLE);
42 
43     // Functions for file manipulation
44 
45     // Reading from MPQ file
46     bool SFileHasFile(HANDLE, const char*);
47     bool SFileOpenFileEx(HANDLE, const char*, DWORD, HANDLE*);
48     DWORD SFileGetFileSize(HANDLE, LPDWORD);
49     DWORD SFileSetFilePointer(HANDLE, LONG, LONG*, DWORD);
50     bool SFileReadFile(HANDLE, void*, DWORD, LPDWORD, LPOVERLAPPED);
51     bool SFileCloseFile(HANDLE);
52 
53     // Retrieving info about a file in the archive
54     bool SFileGetFileInfo(HANDLE, SFileInfoClass, void*, DWORD, LPDWORD);
55     bool SFileGetFileName(HANDLE, char*);
56     bool SFileFreeFileInfo(void*, SFileInfoClass);
57 
58     // High-level extract function
59     bool SFileExtractFile(HANDLE, const char*, const TCHAR*, DWORD);
60 }