mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 18:04:52 +00:00
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: Oran Agra <oran@redislabs.com>
(cherry picked from commit ce15620dc1
)
This commit is contained in:
parent
8b0d797ecd
commit
3cd6c26056
25
src/module.c
25
src/module.c
@ -3303,6 +3303,23 @@ fmterr:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Exported API to call any Redis command from modules.
|
/* 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
|
* On success a RedisModuleCallReply object is returned, otherwise
|
||||||
* NULL is returned and errno is set to the following values:
|
* NULL is returned and errno is set to the following values:
|
||||||
*
|
*
|
||||||
@ -3314,6 +3331,14 @@ fmterr:
|
|||||||
* in a readonly state.
|
* in a readonly state.
|
||||||
* ENETDOWN: operation in Cluster instance when cluster is down.
|
* 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
|
* This API is documented here: https://redis.io/topics/modules-intro
|
||||||
*/
|
*/
|
||||||
RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const char *fmt, ...) {
|
RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const char *fmt, ...) {
|
||||||
|
Loading…
Reference in New Issue
Block a user