]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
Move all database format definition into format.h
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 12 Dec 2017 11:43:59 +0000 (11:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 12 Dec 2017 11:43:59 +0000 (11:43 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c
src/loc/format.h

index e81ea44e2ca5c7ea4cff1d40788f698c945fe789..345b4f7ec272c5b80f811be188b2987369194fde 100644 (file)
@@ -46,16 +46,6 @@ struct loc_database {
        struct loc_stringpool* pool;
 };
 
-const char* LOC_DATABASE_MAGIC = "LOCDBXX";
-unsigned int LOC_DATABASE_VERSION = 0;
-
-struct loc_database_magic {
-       char magic[7];
-
-       // Database version information
-       uint8_t version;
-};
-
 LOC_EXPORT int loc_database_new(struct loc_ctx* ctx, struct loc_database** database, size_t pool_size) {
        struct loc_database* db = calloc(1, sizeof(*db));
        if (!db)
index deec7f10757bf9b84bfe007470726df2ffa7b675..130d0ff6b732416ad7cb9cda2bda356b0073209a 100644 (file)
 
 #include <stdint.h>
 
+#define LOC_DATABASE_MAGIC      "LOCDBXX"
+#define LOC_DATABASE_VERSION    0
+
+struct loc_database_magic {
+       char magic[7];
+
+       // Database version information
+       uint8_t version;
+};
+
 struct loc_database_header_v0 {
        // Vendor who created the database
        uint32_t vendor;