From df7494fab974ecf685d6b689a97d95c1f131e723 Mon Sep 17 00:00:00 2001 From: nishi Date: Tue, 21 May 2024 05:55:34 +0000 Subject: [PATCH] change the doc git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@53 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- Client/main.c | 2 +- FORMATv1.md | 2 +- Library/database.c | 4 ++-- Library/dataworks.c | 5 +++++ Library/dataworks.h | 12 ++++++++++-- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Client/main.c b/Client/main.c index 0280ac3..d7b6863 100644 --- a/Client/main.c +++ b/Client/main.c @@ -99,7 +99,7 @@ int main(int argc, char** argv) { printf("This system is big-endian.\n"); } printf("\n"); - printf("Copyright (c) Nishi 2024\n"); + printf("%s\n", dataworks_get_copyright()); printf("All rights reserved.\n"); if(create) { printf("\n"); diff --git a/FORMATv1.md b/FORMATv1.md index 0088e76..b287f59 100644 --- a/FORMATv1.md +++ b/FORMATv1.md @@ -59,6 +59,7 @@ Info entry (`infoentry`) MUST be in this format: | Name | Size | Type | Info | | ---- | ---- | ---- | ---- | | version | 2 bytes | uint16\_t | MUST be 1 for 1.0 | +| mtime | 8 bytes | int64\_t | Last modified time of the database | `infoentry` IS the only thing which SHOULD be compatible in later format. File MUST look like this: @@ -66,7 +67,6 @@ File MUST look like this: | ---- | ---- | | `signature` | | | `infoentry` | | -| uint64\_t | Last modified time of the database | | `indexentry` | 1st one | | `indexentry` | 2nd one | | ... | | diff --git a/Library/database.c b/Library/database.c index ce64a4d..2f2a90c 100644 --- a/Library/database.c +++ b/Library/database.c @@ -58,8 +58,8 @@ int dataworks_database_create(const char* fname) { nul[0] = 0; nul[1] = 1; fwrite(nul, 1, 2, f); - uint64_t t = time(NULL); - __dw_big_endian(t, uint64_t, fwrite(__converted_ptr, 1, 8, f)); + int64_t t = time(NULL); + __dw_big_endian(t, int64_t, fwrite(__converted_ptr, 1, 8, f)); for(i = 0; i < 16; i++) nul[i] = 0; for(i = 0; i < 256; i++) { fwrite(nul, 1, 1, f); diff --git a/Library/dataworks.c b/Library/dataworks.c index b46d438..e06d03c 100644 --- a/Library/dataworks.c +++ b/Library/dataworks.c @@ -30,6 +30,7 @@ const char* dataworks_version = "0.0.0"; const char* dataworks_compile_date = __DATE__; +const char* dataworks_copyright = "Copyright (c) Crabware 2024"; #if defined(__MINGW32__) const char* dataworks_platform = "Windows/" @@ -51,3 +52,7 @@ char dataworks_get_endian(void) { volatile unsigned short n = 1; return *(char*)&n == 1 ? 'L' : 'B'; } + +const char* dataworks_get_copyright(void){ + return dataworks_copyright; +} diff --git a/Library/dataworks.h b/Library/dataworks.h index b3d1021..8a54f77 100644 --- a/Library/dataworks.h +++ b/Library/dataworks.h @@ -66,12 +66,20 @@ const char* dataworks_get_platform(void); /** * @~english - * @brief Get the compilation endian of DataWorks - * @return Compilation endian of DataWorks + * @brief Get the Endian of the platform + * @return Endian of the platform * */ char dataworks_get_endian(void); +/** + * @~english + * @brief Get the copyright of DataWorks + * @return Copyright of DataWorks + * + */ +const char* dataworks_get_copyright(void); + #ifdef __cplusplus } #endif -- 2.43.0