Return a new string object from a call reply of type string, error or * integer. Otherwise (wrong reply type) return NULL. */
| 3944 | /* Return a new string object from a call reply of type string, error or |
| 3945 | * integer. Otherwise (wrong reply type) return NULL. */ |
| 3946 | RedisModuleString *RM_CreateStringFromCallReply(RedisModuleCallReply *reply) { |
| 3947 | moduleParseCallReply(reply); |
| 3948 | switch(reply->type) { |
| 3949 | case REDISMODULE_REPLY_STRING: |
| 3950 | case REDISMODULE_REPLY_ERROR: |
| 3951 | return RM_CreateString(reply->ctx,reply->val.str,reply->len); |
| 3952 | case REDISMODULE_REPLY_INTEGER: { |
| 3953 | char buf[64]; |
| 3954 | int len = ll2string(buf,sizeof(buf),reply->val.ll); |
| 3955 | return RM_CreateString(reply->ctx,buf,len); |
| 3956 | } |
| 3957 | default: return NULL; |
| 3958 | } |
| 3959 | } |
| 3960 | |
| 3961 | /* Returns an array of robj pointers, and populates *argc with the number |
| 3962 | * of items, by parsing the format specifier "fmt" as described for |
nothing calls this directly
no test coverage detected