Load an unsigned 64 bit value from the RDB file. This function should only * be called in the context of the `rdb_load` method of modules implementing * new data types. */
| 4666 | * be called in the context of the `rdb_load` method of modules implementing |
| 4667 | * new data types. */ |
| 4668 | uint64_t RM_LoadUnsigned(RedisModuleIO *io) { |
| 4669 | if (io->error) return 0; |
| 4670 | if (io->ver == 2) { |
| 4671 | uint64_t opcode = rdbLoadLen(io->rio,NULL); |
| 4672 | if (opcode != RDB_MODULE_OPCODE_UINT) goto loaderr; |
| 4673 | } |
| 4674 | uint64_t value; |
| 4675 | int retval = rdbLoadLenByRef(io->rio, NULL, &value); |
| 4676 | if (retval == -1) goto loaderr; |
| 4677 | return value; |
| 4678 | |
| 4679 | loaderr: |
| 4680 | moduleRDBLoadError(io); |
| 4681 | return 0; |
| 4682 | } |
| 4683 | |
| 4684 | /* Like RedisModule_SaveUnsigned() but for signed 64 bit values. */ |
| 4685 | void RM_SaveSigned(RedisModuleIO *io, int64_t value) { |
no test coverage detected