fflush(stdout);
}
printf("DataWorks version %s %s %s\n", dataworks_get_version(), dataworks_get_compile_date(), dataworks_get_platform());
+ if(dataworks_get_endian() == 'L') {
+ printf("This system is little-endian.\n");
+ } else {
+ printf("This system is big-endian.\n");
+ }
printf("\n");
printf("Copyright (c) Nishi 2024\n");
printf("All rights reserved.\n");
DataWorks Database Format
==============================================
Extension should be .dwf
+
+
First 3 bytes should be 7F 44 57 (\x7F DW)
+
+Every entries should look like this:
+type: 1 byte ASCII
+length: 4, uint32_t
==============================================
$Id$
#else
const char* dataworks_platform = "Unknown/"
#endif
-PLATFORM_M " (" PLATFORM_P ")";
+ PLATFORM_M " (" PLATFORM_P ")";
const char* dataworks_get_version(void) { return dataworks_version; }
const char* dataworks_get_compile_date(void) { return dataworks_compile_date; }
const char* dataworks_get_platform(void) { return dataworks_platform; }
+char dataworks_get_endian(void) {
+ unsigned short n = 1;
+ return *(char*)&n == 1 ? 'L' : 'B';
+}
*/
const char* dataworks_get_platform(void);
+/**
+ * @~english
+ * @brief Get the compilation endian of DataWorks
+ * @return Compilation endian of DataWorks
+ *
+ */
+char dataworks_get_endian(void);
+
#ifdef __cplusplus
}
#endif