diff options
Diffstat (limited to 'c/data.h')
-rw-r--r-- | c/data.h | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -10,8 +10,11 @@ #include "win.h" /* Fetch data from the web. */ -void FetchData(); -void WaitFetchData(bool* bDone) noexcept; +void FetchData(unsigned char* sig); +void FetchScreenwriters(unsigned char* sig); + +/* Wait for thread. */ +void WaitFor(void (*f)(unsigned char*)); /* The structs ending with A are written as-is to disk. As such, they * should be regarded as immutable. If the format needs to be changed @@ -54,7 +57,7 @@ struct CfgA unsigned short cEp = 4096; unsigned short iFocus = 0; unsigned short heightDlv = 0; - wchar_t limitScreenwriter[64] = {0}; + wchar_t limitScreenwriter[64] = {0}; /* TODO: 64 -> 48 */ wchar_t root[260] = {0}; wchar_t glob[64] = {0}; wchar_t url[192] = {0}; @@ -76,6 +79,11 @@ constexpr inline bool HasVersion<T, decltype((void) T::version, 0)> = true; template <typename T> struct FileView { + HANDLE hf; + HANDLE hm; + T* view; + size_t c; + static FileView Initialized(const wchar_t* filename, size_t c, size_t cInit = 0) { bool bExisting = GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES; @@ -150,6 +158,9 @@ struct FileView return t; } + T* begin() { return *view; } + T* end() { return view[c-1]; } + inline operator T*() noexcept { return view; @@ -159,11 +170,6 @@ struct FileView { return view; } - - HANDLE hf; - HANDLE hm; - T* view; - size_t c; }; inline int FromWeb(const int iEp, ElvDataA& e, DlvDataA& d) noexcept |