MuckyFoot-UrbanChaos/fallen/DDLibrary/Headers/AsyncFile.h

49 lines
789 B
C
Raw Permalink Normal View History

2017-05-20 03:14:17 +02:00
// AsyncFile
//
// asynchronous file loading
// InitAsyncFile
//
// initialize
void InitAsyncFile(void);
// TermAsyncFile
//
// terminate
void TermAsyncFile(void);
// LoadAsyncFile
//
// load <filename> into buffer
bool LoadAsyncFile(char* filename, void* buffer, DWORD blen, void* key);
// GetNextCompletedAsyncFile
//
// return key of next completed file, else NULL
void* GetNextCompletedAsyncFile(void);
// CancelAsyncFile
//
// cancel async file loading - if NULL, cancels all files
void CancelAsyncFile(void* key);
// AsyncFile
//
// control block
struct AsyncFile
{
HANDLE hFile; // file handle
OVERLAPPED Control; // control block
void* hKey; // user key
AsyncFile* prev; // previous in chain
AsyncFile* next; // next in chain
};
#define MAX_ASYNC_FILES 16