X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/ebd85e9a455df689c9be02a93354f580df4cafd8..89514f80e91b8759ae0b8e0ff763c9764af4ff04:/src/rdb.h?ds=sidebyside diff --git a/src/rdb.h b/src/rdb.h index 45beaa93..1c07994f 100644 --- a/src/rdb.h +++ b/src/rdb.h @@ -7,6 +7,10 @@ /* TBD: include only necessary headers. */ #include "redis.h" +/* The current RDB version. When the format changes in a way that is no longer + * backward compatible this number gets incremented. */ +#define REDIS_RDB_VERSION 6 + /* Defines related to the dump file format. To store 32 bits lengths for short * keys requires a lot of space, so we check the most significant 2 bits of * the first byte to interpreter the length: @@ -50,7 +54,7 @@ #define REDIS_RDB_TYPE_HASH_ZIPLIST 13 /* Test if a type is an object type. */ -#define rdbIsObjectType(t) ((t >= 0 && t <= 4) || (t >= 9 && t <= 12)) +#define rdbIsObjectType(t) ((t >= 0 && t <= 4) || (t >= 9 && t <= 13)) /* Special RDB opcodes (saved/loaded with rdbSaveType/rdbLoadType). */ #define REDIS_RDB_OPCODE_EXPIRETIME_MS 252 @@ -58,9 +62,6 @@ #define REDIS_RDB_OPCODE_SELECTDB 254 #define REDIS_RDB_OPCODE_EOF 255 -/* Test if a type is an opcode. */ -#define rdbIsOpcode(t) (t >= 253 && t <= 255) - int rdbSaveType(rio *rdb, unsigned char type); int rdbLoadType(rio *rdb); int rdbSaveTime(rio *rdb, time_t t);