MuckyFoot-UrbanChaos/fallen/DDLibrary/Headers/AsyncFile.h
2017-05-20 11:14:17 +10:00

49 lines
789 B
C

// 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