Return a new string object from a call reply of type string, error or * integer. Otherwise (wrong reply type) return NULL. */
| 4032 | /* Return a new string object from a call reply of type string, error or |
| 4033 | * integer. Otherwise (wrong reply type) return NULL. */ |
| 4034 | RedisModuleString *RM_CreateStringFromCallReply(RedisModuleCallReply *reply) { |
| 4035 | moduleParseCallReply(reply); |
| 4036 | switch(reply->type) { |
| 4037 | case REDISMODULE_REPLY_STRING: |
| 4038 | case REDISMODULE_REPLY_ERROR: |
| 4039 | return RM_CreateString(reply->ctx,reply->val.str,reply->len); |
| 4040 | case REDISMODULE_REPLY_INTEGER: { |
| 4041 | char buf[64]; |
| 4042 | int len = ll2string(buf,sizeof(buf),reply->val.ll); |
| 4043 | return RM_CreateString(reply->ctx,buf,len); |
| 4044 | } |
| 4045 | default: return NULL; |
| 4046 | } |
| 4047 | } |
| 4048 | |
| 4049 | /* Returns an array of robj pointers, and populates *argc with the number |
| 4050 | * of items, by parsing the format specifier "fmt" as described for |
nothing calls this directly
no test coverage detected