Starts a dict field, similar to the ones in INFO KEYSPACE. Use normal * RedisModule_InfoAddField* functions to add the items to this field, and * terminate with RedisModule_InfoEndDictField. */
| 7126 | * RedisModule_InfoAddField* functions to add the items to this field, and |
| 7127 | * terminate with RedisModule_InfoEndDictField. */ |
| 7128 | int RM_InfoBeginDictField(RedisModuleInfoCtx *ctx, char *name) { |
| 7129 | if (!ctx->in_section) |
| 7130 | return REDISMODULE_ERR; |
| 7131 | /* Implicitly end dicts, instead of returning an error which is likely un checked. */ |
| 7132 | if (ctx->in_dict_field) |
| 7133 | RM_InfoEndDictField(ctx); |
| 7134 | char *tmpmodname, *tmpname; |
| 7135 | ctx->info = sdscatfmt(ctx->info, |
| 7136 | "%s_%s:", |
| 7137 | getSafeInfoString(ctx->module->name, strlen(ctx->module->name), &tmpmodname), |
| 7138 | getSafeInfoString(name, strlen(name), &tmpname)); |
| 7139 | if (tmpmodname != NULL) zfree(tmpmodname); |
| 7140 | if (tmpname != NULL) zfree(tmpname); |
| 7141 | ctx->in_dict_field = 1; |
| 7142 | return REDISMODULE_OK; |
| 7143 | } |
| 7144 | |
| 7145 | /* Ends a dict field, see RedisModule_InfoBeginDictField */ |
| 7146 | int RM_InfoEndDictField(RedisModuleInfoCtx *ctx) { |
nothing calls this directly
no test coverage detected