From: nishi Date: Mon, 20 May 2024 05:42:54 +0000 (+0000) Subject: add field X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=82fd084ab8554ea7224d8fe68d8b3b60b176dcb3;p=dataworks.git add field git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@41 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/FORMAT b/FORMAT index 11e282d..e85cf7f 100644 --- a/FORMAT +++ b/FORMAT @@ -45,6 +45,7 @@ version : 2 bytes uint16_t (MUST be 1 for 1.0) File MUST look like this: `signature` `infoentry` + uint64_t for the last modified time 256 `indexentry` `dbentry` 0 `dbentry` 1 diff --git a/Library/dw_database.h b/Library/dw_database.h index 62561f8..47815ac 100644 --- a/Library/dw_database.h +++ b/Library/dw_database.h @@ -55,12 +55,20 @@ struct dataworks_db { * */ FILE* fp; + /** * @~english - * @brief Version of the database version. + * @brief Version of the database. * */ uint16_t version; + + /** + * @~english + * @brief Last modified time of the database. + * + */ + uint64_t mtime; }; /** @@ -92,6 +100,15 @@ struct dataworks_db* dataworks_database_open(const char* fname); */ int dataworks_database_get_version(struct dataworks_db* db); +/** + * @~english + * @brief Get the last modified time of the database. + * @param db Database + * @return Last modified time of the database + * + */ +uint64_t dataworks_database_get_mtime(struct dataworks_db* db); + #ifdef __cplusplus } #endif