MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_InfoEndDictField

Function RM_InfoEndDictField

app/redis-6.2.6/src/module.c:6954–6963  ·  view source on GitHub ↗

Ends a dict field, see RedisModule_InfoBeginDictField */

Source from the content-addressed store, hash-verified

6952
6953/* Ends a dict field, see RedisModule_InfoBeginDictField */
6954int RM_InfoEndDictField(RedisModuleInfoCtx *ctx) {
6955 if (!ctx->in_dict_field)
6956 return REDISMODULE_ERR;
6957 /* trim the last ',' if found. */
6958 if (ctx->info[sdslen(ctx->info)-1]==',')
6959 sdsIncrLen(ctx->info, -1);
6960 ctx->info = sdscat(ctx->info, "\r\n");
6961 ctx->in_dict_field = 0;
6962 return REDISMODULE_OK;
6963}
6964
6965/* Used by RedisModuleInfoFunc to add info fields.
6966 * Each field will be automatically prefixed by `<modulename>_`.

Callers 3

RM_InfoAddSectionFunction · 0.85
RM_InfoBeginDictFieldFunction · 0.85
modulesCollectInfoFunction · 0.85

Calls 3

sdslenFunction · 0.85
sdsIncrLenFunction · 0.85
sdscatFunction · 0.85

Tested by

no test coverage detected