MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / nextArgument

Function nextArgument

deps/hiredis/async.c:720–732  ·  view source on GitHub ↗

Sets a pointer to the first argument and its length starting at p. Returns * the number of bytes to skip to get to the following argument. */

Source from the content-addressed store, hash-verified

718/* Sets a pointer to the first argument and its length starting at p. Returns
719 * the number of bytes to skip to get to the following argument. */
720static const char *nextArgument(const char *start, const char **str, size_t *len) {
721 const char *p = start;
722 if (p[0] != '$') {
723 p = strchr(p,'$');
724 if (p == NULL) return NULL;
725 }
726
727 *len = (int)strtol(p+1,NULL,10);
728 p = strchr(p,'\r');
729 assert(p);
730 *str = p+2;
731 return p+2+(*len)+2;
732}
733
734/* Helper function for the redisAsyncCommand* family of functions. Writes a
735 * formatted command to the output buffer and registers the provided callback

Callers 1

__redisAsyncCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected