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. */
| 4771 | * be called in the context of the `rdb_load` method of modules implementing |
| 4772 | * new data types. */ |
| 4773 | uint64_t RM_LoadUnsigned(RedisModuleIO *io) { |
| 4774 | int retval; |
| 4775 | if (io->error) return 0; |
| 4776 | if (io->ver == 2) { |
| 4777 | uint64_t opcode = rdbLoadLen(io->prio,NULL); |
| 4778 | if (opcode != RDB_MODULE_OPCODE_UINT) goto loaderr; |
| 4779 | } |
| 4780 | uint64_t value; |
| 4781 | retval = rdbLoadLenByRef(io->prio, NULL, &value); |
| 4782 | if (retval == -1) goto loaderr; |
| 4783 | return value; |
| 4784 | |
| 4785 | loaderr: |
| 4786 | moduleRDBLoadError(io); |
| 4787 | return 0; |
| 4788 | } |
| 4789 | |
| 4790 | /* Like RedisModule_SaveUnsigned() but for signed 64 bit values. */ |
| 4791 | void RM_SaveSigned(RedisModuleIO *io, int64_t value) { |
no test coverage detected