From 34eb29d7978ff61ff000748943af4d1f9fed8222 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sun, 19 Jun 2022 15:05:39 +0300 Subject: [PATCH] Cleanup db.h See #42 --- src/db.cc | 15 +++++++++++---- src/db.h | 12 ------------ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/db.cc b/src/db.cc index 734cc37..b419d07 100644 --- a/src/db.cc +++ b/src/db.cc @@ -7,10 +7,17 @@ #include #include +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. // // 0x51DEEC -FileReadProgressHandler* gFileReadProgressHandler = NULL; +static FileReadProgressHandler* gFileReadProgressHandler = NULL; // Bytes read so far while tracking progress. // @@ -18,15 +25,15 @@ FileReadProgressHandler* gFileReadProgressHandler = NULL; // and this value resets to zero. // // 0x51DEF0 -int gFileReadProgressBytesRead = 0; +static int gFileReadProgressBytesRead = 0; // The number of bytes to read between calls to progress handler. // // 0x673040 -int gFileReadProgressChunkSize; +static int gFileReadProgressChunkSize; // 0x673044 -FileList* gFileListHead; +static FileList* gFileListHead; // Opens file database. // diff --git a/src/db.h b/src/db.h index 6d4ce6e..f6206a6 100644 --- a/src/db.h +++ b/src/db.h @@ -10,17 +10,6 @@ typedef XFile File; typedef void FileReadProgressHandler(); 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 _db_current(int a1); bool _db_total(); @@ -75,6 +64,5 @@ void _db_register_mem(MallocProc* mallocProc, StrdupProc* strdupProc, FreeProc* int fileGetSize(File* stream); void fileSetReadProgressHandler(FileReadProgressHandler* handler, int size); void _db_enable_hash_table_(); -int _db_list_compare(const void* p1, const void* p2); #endif /* DB_H */