chore(file): add initial file headers (#107)

This commit is contained in:
Marco Tylus 2025-12-29 02:35:05 +09:00 committed by GitHub
parent ca6dd93c84
commit cac1cf7a1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 50 additions and 0 deletions

25
storm/File.hpp Normal file
View file

@ -0,0 +1,25 @@
#ifndef STORM_FILE_HPP
#define STORM_FILE_HPP
#include <cstdint>
#include "storm/Core.hpp"
#if defined(WHOA_SYSTEM_WIN)
#include <Windows.h>
#else
typedef void* HANDLE;
typedef uint32_t DWORD;
typedef uint32_t* LPDWORD;
typedef int32_t LONG;
typedef void* LPOVERLAPPED;
#endif
bool STORMAPI SFileOpenArchive(const char* mpqName, DWORD priority, DWORD flags, HANDLE* archive);
bool STORMAPI SFileCloseArchive(HANDLE archive);
bool STORMAPI SFileOpenFileEx(HANDLE archive, const char* fileName, DWORD searchScope, HANDLE* file);
bool STORMAPI SFileReadFile(HANDLE file, void* buffer, DWORD toRead, LPDWORD read, LPOVERLAPPED overlapped);
DWORD STORMAPI SFileGetFileSize(HANDLE file, LPDWORD fileSizeHigh);
DWORD STORMAPI SFileSetFilePointer(HANDLE file, LONG filePos, LONG* filePosHigh, DWORD moveMethod);
bool STORMAPI SFileCloseFile(HANDLE file);
#endif