Commit 3cd6c260 authored by Itamar Haber's avatar Itamar Haber Committed by Oran Agra
Browse files

Documents RM_Call's fmt (#5448)



Improve RM_Call inline documentation about the fmt argument
so that we don't completely depend on the web docs.
Co-authored-by: default avatarOran Agra <oran@redislabs.com>
(cherry picked from commit ce15620d)
parent 8b0d797e
......@@ -3303,6 +3303,23 @@ fmterr:
}
/* Exported API to call any Redis command from modules.
*
* * **cmdname**: The Redis command to call.
* * **fmt**: A format specifier string for the command's arguments. Each
* of the arguments should be specified by a valid type specification:
* b The argument is a buffer and is immediately followed by another
* argument that is the buffer's length.
* c The argument is a pointer to a plain C string (null-terminated).
* l The argument is long long integer.
* s The argument is a RedisModuleString.
* v The argument(s) is a vector of RedisModuleString.
*
* The format specifier can also include modifiers:
* ! Sends the Redis command and its arguments to replicas and AOF.
* A Suppress AOF propagation, send only to replicas (requires `!`).
* R Suppress replicas propagation, send only to AOF (requires `!`).
* * **...**: The actual arguments to the Redis command.
*
* On success a RedisModuleCallReply object is returned, otherwise
* NULL is returned and errno is set to the following values:
*
......@@ -3314,6 +3331,14 @@ fmterr:
* in a readonly state.
* ENETDOWN: operation in Cluster instance when cluster is down.
*
* Example code fragment:
*
* reply = RedisModule_Call(ctx,"INCRBY","sc",argv[1],"10");
* if (RedisModule_CallReplyType(reply) == REDISMODULE_REPLY_INTEGER) {
* long long myval = RedisModule_CallReplyInteger(reply);
* // Do something with myval.
* }
*
* This API is documented here: https://redis.io/topics/modules-intro
*/
RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const char *fmt, ...) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment