Cleanup db.h

See #42
This commit is contained in:
Alexander Batalov 2022-06-19 15:05:39 +03:00
parent ebee02e196
commit 34eb29d797
2 changed files with 11 additions and 16 deletions

View File

@ -7,10 +7,17 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
typedef struct FileList {
XList xlist;
struct FileList* next;
} FileList;
static int _db_list_compare(const void* p1, const void* p2);
// Generic file progress report handler. // Generic file progress report handler.
// //
// 0x51DEEC // 0x51DEEC
FileReadProgressHandler* gFileReadProgressHandler = NULL; static FileReadProgressHandler* gFileReadProgressHandler = NULL;
// Bytes read so far while tracking progress. // Bytes read so far while tracking progress.
// //
@ -18,15 +25,15 @@ FileReadProgressHandler* gFileReadProgressHandler = NULL;
// and this value resets to zero. // and this value resets to zero.
// //
// 0x51DEF0 // 0x51DEF0
int gFileReadProgressBytesRead = 0; static int gFileReadProgressBytesRead = 0;
// The number of bytes to read between calls to progress handler. // The number of bytes to read between calls to progress handler.
// //
// 0x673040 // 0x673040
int gFileReadProgressChunkSize; static int gFileReadProgressChunkSize;
// 0x673044 // 0x673044
FileList* gFileListHead; static FileList* gFileListHead;
// Opens file database. // Opens file database.
// //

View File

@ -10,17 +10,6 @@ typedef XFile File;
typedef void FileReadProgressHandler(); typedef void FileReadProgressHandler();
typedef char* StrdupProc(const char* string); typedef char* StrdupProc(const char* string);
typedef struct FileList {
XList xlist;
struct FileList* next;
} FileList;
extern FileReadProgressHandler* gFileReadProgressHandler;
extern int gFileReadProgressBytesRead;
extern int gFileReadProgressChunkSize;
extern FileList* gFileListHead;
int dbOpen(const char* filePath1, int a2, const char* filePath2, int a4); int dbOpen(const char* filePath1, int a2, const char* filePath2, int a4);
int _db_current(int a1); int _db_current(int a1);
bool _db_total(); bool _db_total();
@ -75,6 +64,5 @@ void _db_register_mem(MallocProc* mallocProc, StrdupProc* strdupProc, FreeProc*
int fileGetSize(File* stream); int fileGetSize(File* stream);
void fileSetReadProgressHandler(FileReadProgressHandler* handler, int size); void fileSetReadProgressHandler(FileReadProgressHandler* handler, int size);
void _db_enable_hash_table_(); void _db_enable_hash_table_();
int _db_list_compare(const void* p1, const void* p2);
#endif /* DB_H */ #endif /* DB_H */