diff --git a/src/info/info.c b/src/info/info.c index 4b8bb3a7e..2061ab39b 100644 --- a/src/info/info.c +++ b/src/info/info.c @@ -33,7 +33,7 @@ Object type ***********************************************************************************************************************************/ struct Info { - MemContext *memContext; // Context that contains the info + MemContext *memContext; // Mem context String *fileName; // Full path name of the file Ini *ini; // Parsed file contents const String *cipherPass; // Cipher passphrase if set @@ -206,11 +206,13 @@ infoNew(const Storage *storage, const String *fileName, CipherType cipherType, c FUNCTION_TEST_PARAM(STRING, cipherPass); FUNCTION_LOG_END(); + ASSERT(storage != NULL); ASSERT(fileName != NULL); + ASSERT(cipherType == cipherTypeNone || cipherPass != NULL); Info *this = NULL; - MEM_CONTEXT_NEW_BEGIN("info") + MEM_CONTEXT_NEW_BEGIN("Info") { // Create object this = memNew(sizeof(Info)); @@ -263,7 +265,6 @@ infoNew(const Storage *storage, const String *fileName, CipherType cipherType, c } MEM_CONTEXT_NEW_END(); - // Return buffer FUNCTION_LOG_RETURN(INFO, this); } diff --git a/src/info/infoArchive.c b/src/info/infoArchive.c index f03111467..5dc566244 100644 --- a/src/info/infoArchive.c +++ b/src/info/infoArchive.c @@ -20,7 +20,7 @@ Object type ***********************************************************************************************************************************/ struct InfoArchive { - MemContext *memContext; // Context that contains the InfoArchive + MemContext *memContext; // Mem context InfoPg *infoPg; // Contents of the DB data String *archiveId; // Archive id for the current PG version }; @@ -40,11 +40,13 @@ infoArchiveNew(const Storage *storage, const String *fileName, bool ignoreMissin FUNCTION_TEST_PARAM(STRING, cipherPass); FUNCTION_LOG_END(); + ASSERT(storage != NULL); ASSERT(fileName != NULL); + ASSERT(cipherType == cipherTypeNone || cipherPass != NULL); InfoArchive *this = NULL; - MEM_CONTEXT_NEW_BEGIN("infoArchive") + MEM_CONTEXT_NEW_BEGIN("InfoArchive") { // Create object this = memNew(sizeof(InfoArchive)); @@ -73,7 +75,6 @@ infoArchiveNew(const Storage *storage, const String *fileName, bool ignoreMissin } MEM_CONTEXT_NEW_END(); - // Return buffer FUNCTION_LOG_RETURN(INFO_ARCHIVE, this); } diff --git a/src/info/infoBackup.c b/src/info/infoBackup.c index c60a91fc9..295978dfd 100644 --- a/src/info/infoBackup.c +++ b/src/info/infoBackup.c @@ -37,7 +37,7 @@ Object type ***********************************************************************************************************************************/ struct InfoBackup { - MemContext *memContext; // Context that contains the InfoBackup + MemContext *memContext; // Mem context InfoPg *infoPg; // Contents of the DB data List *backup; // List of current backups and their associated data }; @@ -51,17 +51,20 @@ InfoBackup * infoBackupNew(const Storage *storage, const String *fileName, bool ignoreMissing, CipherType cipherType, const String *cipherPass) { FUNCTION_LOG_BEGIN(logLevelDebug); + FUNCTION_LOG_PARAM(STORAGE, storage); FUNCTION_LOG_PARAM(STRING, fileName); FUNCTION_LOG_PARAM(BOOL, ignoreMissing); FUNCTION_LOG_PARAM(ENUM, cipherType); FUNCTION_TEST_PARAM(STRING, cipherPass); FUNCTION_LOG_END(); + ASSERT(storage != NULL); ASSERT(fileName != NULL); + ASSERT(cipherType == cipherTypeNone || cipherPass != NULL); InfoBackup *this = NULL; - MEM_CONTEXT_NEW_BEGIN("infoBackup") + MEM_CONTEXT_NEW_BEGIN("InfoBackup") { // Create object this = memNew(sizeof(InfoBackup)); @@ -139,7 +142,6 @@ infoBackupNew(const Storage *storage, const String *fileName, bool ignoreMissing } MEM_CONTEXT_NEW_END(); - // Return buffer FUNCTION_LOG_RETURN(INFO_BACKUP, this); } diff --git a/src/info/infoManifest.h b/src/info/infoManifest.h index b6f6f9059..cd89a30ef 100644 --- a/src/info/infoManifest.h +++ b/src/info/infoManifest.h @@ -4,6 +4,9 @@ Manifest Info Handler #ifndef INFO_INFOMANIFEST_H #define INFO_INFOMANIFEST_H +/*********************************************************************************************************************************** +Constants +***********************************************************************************************************************************/ #define INFO_MANIFEST_KEY_BACKUP_ARCHIVE_START "backup-archive-start" STRING_DECLARE(INFO_MANIFEST_KEY_BACKUP_ARCHIVE_START_STR); #define INFO_MANIFEST_KEY_BACKUP_ARCHIVE_STOP "backup-archive-stop" diff --git a/src/info/infoPg.c b/src/info/infoPg.c index c65f2d279..d24ea608e 100644 --- a/src/info/infoPg.c +++ b/src/info/infoPg.c @@ -36,7 +36,7 @@ Object type ***********************************************************************************************************************************/ struct InfoPg { - MemContext *memContext; // Context that contains the infoPg + MemContext *memContext; // Mem context List *history; // A list of InfoPgData unsigned int historyCurrent; // Index of the current history item Info *info; // Info contents @@ -61,11 +61,13 @@ infoPgNew(const Storage *storage, const String *fileName, InfoPgType type, Ciphe FUNCTION_TEST_PARAM(STRING, cipherPass); FUNCTION_LOG_END(); + ASSERT(storage != NULL); ASSERT(fileName != NULL); + ASSERT(cipherType == cipherTypeNone || cipherPass != NULL); InfoPg *this = NULL; - MEM_CONTEXT_NEW_BEGIN("infoPg") + MEM_CONTEXT_NEW_BEGIN("InfoPg") { // Create object this = memNew(sizeof(InfoPg)); @@ -136,7 +138,6 @@ infoPgNew(const Storage *storage, const String *fileName, InfoPgType type, Ciphe } MEM_CONTEXT_NEW_END(); - // Return buffer FUNCTION_LOG_RETURN(INFO_PG, this); }