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. */
| 6934 | * RedisModule_InfoAddField* functions to add the items to this field, and |
| 6935 | * terminate with RedisModule_InfoEndDictField. */ |
| 6936 | int RM_InfoBeginDictField(RedisModuleInfoCtx *ctx, char *name) { |
| 6937 | if (!ctx->in_section) |
| 6938 | return REDISMODULE_ERR; |
| 6939 | /* Implicitly end dicts, instead of returning an error which is likely un checked. */ |
| 6940 | if (ctx->in_dict_field) |
| 6941 | RM_InfoEndDictField(ctx); |
| 6942 | char *tmpmodname, *tmpname; |
| 6943 | ctx->info = sdscatfmt(ctx->info, |
| 6944 | "%s_%s:", |
| 6945 | getSafeInfoString(ctx->module->name, strlen(ctx->module->name), &tmpmodname), |
| 6946 | getSafeInfoString(name, strlen(name), &tmpname)); |
| 6947 | if (tmpmodname != NULL) zfree(tmpmodname); |
| 6948 | if (tmpname != NULL) zfree(tmpname); |
| 6949 | ctx->in_dict_field = 1; |
| 6950 | return REDISMODULE_OK; |
| 6951 | } |
| 6952 | |
| 6953 | /* Ends a dict field, see RedisModule_InfoBeginDictField */ |
| 6954 | int RM_InfoEndDictField(RedisModuleInfoCtx *ctx) { |
nothing calls this directly
no test coverage detected