summaryrefslogtreecommitdiff
path: root/src/redismodule.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-10-03 00:08:35 +0200
committerantirez <antirez@gmail.com>2016-10-03 00:08:35 +0200
commit3dc84c530063e2ebd4f975e4066dd834cd6cbe9f (patch)
treebf347bbec08097173d9b54b683fa9b940053bfa2 /src/redismodule.h
parenta1b1fd4f392c59c5fc194e66856e1cb8d6a4f932 (diff)
downloadredis-3dc84c530063e2ebd4f975e4066dd834cd6cbe9f.tar.gz
Modules: API to save/load single precision floating point numbers.
When double precision is not needed, to take 2x space in the serialization is not good.
Diffstat (limited to 'src/redismodule.h')
-rw-r--r--src/redismodule.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/redismodule.h b/src/redismodule.h
index dcc0aa1ea..346110090 100644
--- a/src/redismodule.h
+++ b/src/redismodule.h
@@ -184,6 +184,8 @@ RedisModuleString *REDISMODULE_API_FUNC(RedisModule_LoadString)(RedisModuleIO *i
char *REDISMODULE_API_FUNC(RedisModule_LoadStringBuffer)(RedisModuleIO *io, size_t *lenptr);
void REDISMODULE_API_FUNC(RedisModule_SaveDouble)(RedisModuleIO *io, double value);
double REDISMODULE_API_FUNC(RedisModule_LoadDouble)(RedisModuleIO *io);
+void REDISMODULE_API_FUNC(RedisModule_SaveFloat)(RedisModuleIO *io, float value);
+float REDISMODULE_API_FUNC(RedisModule_LoadFloat)(RedisModuleIO *io);
void REDISMODULE_API_FUNC(RedisModule_Log)(RedisModuleCtx *ctx, const char *level, const char *fmt, ...);
void REDISMODULE_API_FUNC(RedisModule_LogIOError)(RedisModuleIO *io, const char *levelstr, const char *fmt, ...);
int REDISMODULE_API_FUNC(RedisModule_StringAppendBuffer)(RedisModuleCtx *ctx, RedisModuleString *str, const char *buf, size_t len);
@@ -281,6 +283,8 @@ static int RedisModule_Init(RedisModuleCtx *ctx, const char *name, int ver, int
REDISMODULE_GET_API(LoadStringBuffer);
REDISMODULE_GET_API(SaveDouble);
REDISMODULE_GET_API(LoadDouble);
+ REDISMODULE_GET_API(SaveFloat);
+ REDISMODULE_GET_API(LoadFloat);
REDISMODULE_GET_API(EmitAOF);
REDISMODULE_GET_API(Log);
REDISMODULE_GET_API(LogIOError);