X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/6b4d92e21de8b7937fb7f71c0c12b72e18554fb4..b8ce9a84c57eba13a157d7c1074254b5ce6bebd3:/src/rdb.c diff --git a/src/rdb.c b/src/rdb.c index a7ce031a..90c2ea08 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -21,6 +21,9 @@ int rdbSaveType(rio *rdb, unsigned char type) { return rdbWriteRaw(rdb,&type,1); } +/* Load a "type" in RDB format, that is a one byte unsigned integer. + * This function is not only used to load object types, but also special + * "types" like the end-of-file type, the EXPIRE type, and so forth. */ int rdbLoadType(rio *rdb) { unsigned char type; if (rioRead(rdb,&type,1) == 0) return -1; @@ -433,7 +436,8 @@ int rdbSaveObjectType(rio *rdb, robj *o) { return -1; /* avoid warning */ } -/* Load object type. Return -1 when the byte doesn't contain an object type. */ +/* Use rdbLoadType() to load a TYPE in RDB format, but returns -1 if the + * type is not specifically a valid Object Type. */ int rdbLoadObjectType(rio *rdb) { int type; if ((type = rdbLoadType(rdb)) == -1) return -1;