Commit 554bd0e7 authored by antirez's avatar antirez
Browse files

RDMF: use client instead of redisClient, like Disque.

parent 424fe9af
This diff is collapsed.
...@@ -127,7 +127,7 @@ void slowlogReset(void) { ...@@ -127,7 +127,7 @@ void slowlogReset(void) {
/* The SLOWLOG command. Implements all the subcommands needed to handle the /* The SLOWLOG command. Implements all the subcommands needed to handle the
* Redis slow log. */ * Redis slow log. */
void slowlogCommand(redisClient *c) { void slowlogCommand(client *c) {
if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"reset")) { if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"reset")) {
slowlogReset(); slowlogReset();
addReply(c,shared.ok); addReply(c,shared.ok);
......
...@@ -44,4 +44,4 @@ void slowlogInit(void); ...@@ -44,4 +44,4 @@ void slowlogInit(void);
void slowlogPushEntryIfNeeded(robj **argv, int argc, long long duration); void slowlogPushEntryIfNeeded(robj **argv, int argc, long long duration);
/* Exported commands */ /* Exported commands */
void slowlogCommand(redisClient *c); void slowlogCommand(client *c);
...@@ -186,7 +186,7 @@ int sortCompare(const void *s1, const void *s2) { ...@@ -186,7 +186,7 @@ int sortCompare(const void *s1, const void *s2) {
/* The SORT command is the most complex command in Redis. Warning: this code /* The SORT command is the most complex command in Redis. Warning: this code
* is optimized for speed and a bit less for readability */ * is optimized for speed and a bit less for readability */
void sortCommand(redisClient *c) { void sortCommand(client *c) {
list *operations; list *operations;
unsigned int outputlen = 0; unsigned int outputlen = 0;
int desc = 0, alpha = 0; int desc = 0, alpha = 0;
......
...@@ -415,7 +415,7 @@ robj *hashTypeCurrentObject(hashTypeIterator *hi, int what) { ...@@ -415,7 +415,7 @@ robj *hashTypeCurrentObject(hashTypeIterator *hi, int what) {
return dst; return dst;
} }
robj *hashTypeLookupWriteOrCreate(redisClient *c, robj *key) { robj *hashTypeLookupWriteOrCreate(client *c, robj *key) {
robj *o = lookupKeyWrite(c->db,key); robj *o = lookupKeyWrite(c->db,key);
if (o == NULL) { if (o == NULL) {
o = createHashObject(); o = createHashObject();
...@@ -483,7 +483,7 @@ void hashTypeConvert(robj *o, int enc) { ...@@ -483,7 +483,7 @@ void hashTypeConvert(robj *o, int enc) {
* Hash type commands * Hash type commands
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void hsetCommand(redisClient *c) { void hsetCommand(client *c) {
int update; int update;
robj *o; robj *o;
...@@ -497,7 +497,7 @@ void hsetCommand(redisClient *c) { ...@@ -497,7 +497,7 @@ void hsetCommand(redisClient *c) {
server.dirty++; server.dirty++;
} }
void hsetnxCommand(redisClient *c) { void hsetnxCommand(client *c) {
robj *o; robj *o;
if ((o = hashTypeLookupWriteOrCreate(c,c->argv[1])) == NULL) return; if ((o = hashTypeLookupWriteOrCreate(c,c->argv[1])) == NULL) return;
hashTypeTryConversion(o,c->argv,2,3); hashTypeTryConversion(o,c->argv,2,3);
...@@ -514,7 +514,7 @@ void hsetnxCommand(redisClient *c) { ...@@ -514,7 +514,7 @@ void hsetnxCommand(redisClient *c) {
} }
} }
void hmsetCommand(redisClient *c) { void hmsetCommand(client *c) {
int i; int i;
robj *o; robj *o;
...@@ -535,7 +535,7 @@ void hmsetCommand(redisClient *c) { ...@@ -535,7 +535,7 @@ void hmsetCommand(redisClient *c) {
server.dirty++; server.dirty++;
} }
void hincrbyCommand(redisClient *c) { void hincrbyCommand(client *c) {
long long value, incr, oldvalue; long long value, incr, oldvalue;
robj *o, *current, *new; robj *o, *current, *new;
...@@ -569,7 +569,7 @@ void hincrbyCommand(redisClient *c) { ...@@ -569,7 +569,7 @@ void hincrbyCommand(redisClient *c) {
server.dirty++; server.dirty++;
} }
void hincrbyfloatCommand(redisClient *c) { void hincrbyfloatCommand(client *c) {
double long value, incr; double long value, incr;
robj *o, *current, *new, *aux; robj *o, *current, *new, *aux;
...@@ -605,7 +605,7 @@ void hincrbyfloatCommand(redisClient *c) { ...@@ -605,7 +605,7 @@ void hincrbyfloatCommand(redisClient *c) {
decrRefCount(new); decrRefCount(new);
} }
static void addHashFieldToReply(redisClient *c, robj *o, robj *field) { static void addHashFieldToReply(client *c, robj *o, robj *field) {
int ret; int ret;
if (o == NULL) { if (o == NULL) {
...@@ -644,7 +644,7 @@ static void addHashFieldToReply(redisClient *c, robj *o, robj *field) { ...@@ -644,7 +644,7 @@ static void addHashFieldToReply(redisClient *c, robj *o, robj *field) {
} }
} }
void hgetCommand(redisClient *c) { void hgetCommand(client *c) {
robj *o; robj *o;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL || if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL ||
...@@ -653,7 +653,7 @@ void hgetCommand(redisClient *c) { ...@@ -653,7 +653,7 @@ void hgetCommand(redisClient *c) {
addHashFieldToReply(c, o, c->argv[2]); addHashFieldToReply(c, o, c->argv[2]);
} }
void hmgetCommand(redisClient *c) { void hmgetCommand(client *c) {
robj *o; robj *o;
int i; int i;
...@@ -671,7 +671,7 @@ void hmgetCommand(redisClient *c) { ...@@ -671,7 +671,7 @@ void hmgetCommand(redisClient *c) {
} }
} }
void hdelCommand(redisClient *c) { void hdelCommand(client *c) {
robj *o; robj *o;
int j, deleted = 0, keyremoved = 0; int j, deleted = 0, keyremoved = 0;
...@@ -699,7 +699,7 @@ void hdelCommand(redisClient *c) { ...@@ -699,7 +699,7 @@ void hdelCommand(redisClient *c) {
addReplyLongLong(c,deleted); addReplyLongLong(c,deleted);
} }
void hlenCommand(redisClient *c) { void hlenCommand(client *c) {
robj *o; robj *o;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL || if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
...@@ -708,7 +708,7 @@ void hlenCommand(redisClient *c) { ...@@ -708,7 +708,7 @@ void hlenCommand(redisClient *c) {
addReplyLongLong(c,hashTypeLength(o)); addReplyLongLong(c,hashTypeLength(o));
} }
void hstrlenCommand(redisClient *c) { void hstrlenCommand(client *c) {
robj *o; robj *o;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL || if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
...@@ -716,7 +716,7 @@ void hstrlenCommand(redisClient *c) { ...@@ -716,7 +716,7 @@ void hstrlenCommand(redisClient *c) {
addReplyLongLong(c,hashTypeGetValueLength(o,c->argv[2])); addReplyLongLong(c,hashTypeGetValueLength(o,c->argv[2]));
} }
static void addHashIteratorCursorToReply(redisClient *c, hashTypeIterator *hi, int what) { static void addHashIteratorCursorToReply(client *c, hashTypeIterator *hi, int what) {
if (hi->encoding == REDIS_ENCODING_ZIPLIST) { if (hi->encoding == REDIS_ENCODING_ZIPLIST) {
unsigned char *vstr = NULL; unsigned char *vstr = NULL;
unsigned int vlen = UINT_MAX; unsigned int vlen = UINT_MAX;
...@@ -740,7 +740,7 @@ static void addHashIteratorCursorToReply(redisClient *c, hashTypeIterator *hi, i ...@@ -740,7 +740,7 @@ static void addHashIteratorCursorToReply(redisClient *c, hashTypeIterator *hi, i
} }
} }
void genericHgetallCommand(redisClient *c, int flags) { void genericHgetallCommand(client *c, int flags) {
robj *o; robj *o;
hashTypeIterator *hi; hashTypeIterator *hi;
int multiplier = 0; int multiplier = 0;
...@@ -771,19 +771,19 @@ void genericHgetallCommand(redisClient *c, int flags) { ...@@ -771,19 +771,19 @@ void genericHgetallCommand(redisClient *c, int flags) {
redisAssert(count == length); redisAssert(count == length);
} }
void hkeysCommand(redisClient *c) { void hkeysCommand(client *c) {
genericHgetallCommand(c,REDIS_HASH_KEY); genericHgetallCommand(c,REDIS_HASH_KEY);
} }
void hvalsCommand(redisClient *c) { void hvalsCommand(client *c) {
genericHgetallCommand(c,REDIS_HASH_VALUE); genericHgetallCommand(c,REDIS_HASH_VALUE);
} }
void hgetallCommand(redisClient *c) { void hgetallCommand(client *c) {
genericHgetallCommand(c,REDIS_HASH_KEY|REDIS_HASH_VALUE); genericHgetallCommand(c,REDIS_HASH_KEY|REDIS_HASH_VALUE);
} }
void hexistsCommand(redisClient *c) { void hexistsCommand(client *c) {
robj *o; robj *o;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL || if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
checkType(c,o,REDIS_HASH)) return; checkType(c,o,REDIS_HASH)) return;
...@@ -791,7 +791,7 @@ void hexistsCommand(redisClient *c) { ...@@ -791,7 +791,7 @@ void hexistsCommand(redisClient *c) {
addReply(c, hashTypeExists(o,c->argv[2]) ? shared.cone : shared.czero); addReply(c, hashTypeExists(o,c->argv[2]) ? shared.cone : shared.czero);
} }
void hscanCommand(redisClient *c) { void hscanCommand(client *c) {
robj *o; robj *o;
unsigned long cursor; unsigned long cursor;
......
...@@ -194,7 +194,7 @@ void listTypeConvert(robj *subject, int enc) { ...@@ -194,7 +194,7 @@ void listTypeConvert(robj *subject, int enc) {
* List Commands * List Commands
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void pushGenericCommand(redisClient *c, int where) { void pushGenericCommand(client *c, int where) {
int j, waiting = 0, pushed = 0; int j, waiting = 0, pushed = 0;
robj *lobj = lookupKeyWrite(c->db,c->argv[1]); robj *lobj = lookupKeyWrite(c->db,c->argv[1]);
...@@ -224,15 +224,15 @@ void pushGenericCommand(redisClient *c, int where) { ...@@ -224,15 +224,15 @@ void pushGenericCommand(redisClient *c, int where) {
server.dirty += pushed; server.dirty += pushed;
} }
void lpushCommand(redisClient *c) { void lpushCommand(client *c) {
pushGenericCommand(c,REDIS_HEAD); pushGenericCommand(c,REDIS_HEAD);
} }
void rpushCommand(redisClient *c) { void rpushCommand(client *c) {
pushGenericCommand(c,REDIS_TAIL); pushGenericCommand(c,REDIS_TAIL);
} }
void pushxGenericCommand(redisClient *c, robj *refval, robj *val, int where) { void pushxGenericCommand(client *c, robj *refval, robj *val, int where) {
robj *subject; robj *subject;
listTypeIterator *iter; listTypeIterator *iter;
listTypeEntry entry; listTypeEntry entry;
...@@ -275,17 +275,17 @@ void pushxGenericCommand(redisClient *c, robj *refval, robj *val, int where) { ...@@ -275,17 +275,17 @@ void pushxGenericCommand(redisClient *c, robj *refval, robj *val, int where) {
addReplyLongLong(c,listTypeLength(subject)); addReplyLongLong(c,listTypeLength(subject));
} }
void lpushxCommand(redisClient *c) { void lpushxCommand(client *c) {
c->argv[2] = tryObjectEncoding(c->argv[2]); c->argv[2] = tryObjectEncoding(c->argv[2]);
pushxGenericCommand(c,NULL,c->argv[2],REDIS_HEAD); pushxGenericCommand(c,NULL,c->argv[2],REDIS_HEAD);
} }
void rpushxCommand(redisClient *c) { void rpushxCommand(client *c) {
c->argv[2] = tryObjectEncoding(c->argv[2]); c->argv[2] = tryObjectEncoding(c->argv[2]);
pushxGenericCommand(c,NULL,c->argv[2],REDIS_TAIL); pushxGenericCommand(c,NULL,c->argv[2],REDIS_TAIL);
} }
void linsertCommand(redisClient *c) { void linsertCommand(client *c) {
c->argv[4] = tryObjectEncoding(c->argv[4]); c->argv[4] = tryObjectEncoding(c->argv[4]);
if (strcasecmp(c->argv[2]->ptr,"after") == 0) { if (strcasecmp(c->argv[2]->ptr,"after") == 0) {
pushxGenericCommand(c,c->argv[3],c->argv[4],REDIS_TAIL); pushxGenericCommand(c,c->argv[3],c->argv[4],REDIS_TAIL);
...@@ -296,13 +296,13 @@ void linsertCommand(redisClient *c) { ...@@ -296,13 +296,13 @@ void linsertCommand(redisClient *c) {
} }
} }
void llenCommand(redisClient *c) { void llenCommand(client *c) {
robj *o = lookupKeyReadOrReply(c,c->argv[1],shared.czero); robj *o = lookupKeyReadOrReply(c,c->argv[1],shared.czero);
if (o == NULL || checkType(c,o,REDIS_LIST)) return; if (o == NULL || checkType(c,o,REDIS_LIST)) return;
addReplyLongLong(c,listTypeLength(o)); addReplyLongLong(c,listTypeLength(o));
} }
void lindexCommand(redisClient *c) { void lindexCommand(client *c) {
robj *o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk); robj *o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk);
if (o == NULL || checkType(c,o,REDIS_LIST)) return; if (o == NULL || checkType(c,o,REDIS_LIST)) return;
long index; long index;
...@@ -329,7 +329,7 @@ void lindexCommand(redisClient *c) { ...@@ -329,7 +329,7 @@ void lindexCommand(redisClient *c) {
} }
} }
void lsetCommand(redisClient *c) { void lsetCommand(client *c) {
robj *o = lookupKeyWriteOrReply(c,c->argv[1],shared.nokeyerr); robj *o = lookupKeyWriteOrReply(c,c->argv[1],shared.nokeyerr);
if (o == NULL || checkType(c,o,REDIS_LIST)) return; if (o == NULL || checkType(c,o,REDIS_LIST)) return;
long index; long index;
...@@ -355,7 +355,7 @@ void lsetCommand(redisClient *c) { ...@@ -355,7 +355,7 @@ void lsetCommand(redisClient *c) {
} }
} }
void popGenericCommand(redisClient *c, int where) { void popGenericCommand(client *c, int where) {
robj *o = lookupKeyWriteOrReply(c,c->argv[1],shared.nullbulk); robj *o = lookupKeyWriteOrReply(c,c->argv[1],shared.nullbulk);
if (o == NULL || checkType(c,o,REDIS_LIST)) return; if (o == NULL || checkType(c,o,REDIS_LIST)) return;
...@@ -378,15 +378,15 @@ void popGenericCommand(redisClient *c, int where) { ...@@ -378,15 +378,15 @@ void popGenericCommand(redisClient *c, int where) {
} }
} }
void lpopCommand(redisClient *c) { void lpopCommand(client *c) {
popGenericCommand(c,REDIS_HEAD); popGenericCommand(c,REDIS_HEAD);
} }
void rpopCommand(redisClient *c) { void rpopCommand(client *c) {
popGenericCommand(c,REDIS_TAIL); popGenericCommand(c,REDIS_TAIL);
} }
void lrangeCommand(redisClient *c) { void lrangeCommand(client *c) {
robj *o; robj *o;
long start, end, llen, rangelen; long start, end, llen, rangelen;
...@@ -432,7 +432,7 @@ void lrangeCommand(redisClient *c) { ...@@ -432,7 +432,7 @@ void lrangeCommand(redisClient *c) {
} }
} }
void ltrimCommand(redisClient *c) { void ltrimCommand(client *c) {
robj *o; robj *o;
long start, end, llen, ltrim, rtrim; long start, end, llen, ltrim, rtrim;
...@@ -478,7 +478,7 @@ void ltrimCommand(redisClient *c) { ...@@ -478,7 +478,7 @@ void ltrimCommand(redisClient *c) {
addReply(c,shared.ok); addReply(c,shared.ok);
} }
void lremCommand(redisClient *c) { void lremCommand(client *c) {
robj *subject, *obj; robj *subject, *obj;
obj = c->argv[3]; obj = c->argv[3];
long toremove; long toremove;
...@@ -533,7 +533,7 @@ void lremCommand(redisClient *c) { ...@@ -533,7 +533,7 @@ void lremCommand(redisClient *c) {
* as well. This command was originally proposed by Ezra Zygmuntowicz. * as well. This command was originally proposed by Ezra Zygmuntowicz.
*/ */
void rpoplpushHandlePush(redisClient *c, robj *dstkey, robj *dstobj, robj *value) { void rpoplpushHandlePush(client *c, robj *dstkey, robj *dstobj, robj *value) {
/* Create the list if the key does not exist */ /* Create the list if the key does not exist */
if (!dstobj) { if (!dstobj) {
dstobj = createQuicklistObject(); dstobj = createQuicklistObject();
...@@ -548,7 +548,7 @@ void rpoplpushHandlePush(redisClient *c, robj *dstkey, robj *dstobj, robj *value ...@@ -548,7 +548,7 @@ void rpoplpushHandlePush(redisClient *c, robj *dstkey, robj *dstobj, robj *value
addReplyBulk(c,value); addReplyBulk(c,value);
} }
void rpoplpushCommand(redisClient *c) { void rpoplpushCommand(client *c) {
robj *sobj, *value; robj *sobj, *value;
if ((sobj = lookupKeyWriteOrReply(c,c->argv[1],shared.nullbulk)) == NULL || if ((sobj = lookupKeyWriteOrReply(c,c->argv[1],shared.nullbulk)) == NULL ||
checkType(c,sobj,REDIS_LIST)) return; checkType(c,sobj,REDIS_LIST)) return;
...@@ -608,7 +608,7 @@ void rpoplpushCommand(redisClient *c) { ...@@ -608,7 +608,7 @@ void rpoplpushCommand(redisClient *c) {
/* Set a client in blocking mode for the specified key, with the specified /* Set a client in blocking mode for the specified key, with the specified
* timeout */ * timeout */
void blockForKeys(redisClient *c, robj **keys, int numkeys, mstime_t timeout, robj *target) { void blockForKeys(client *c, robj **keys, int numkeys, mstime_t timeout, robj *target) {
dictEntry *de; dictEntry *de;
list *l; list *l;
int j; int j;
...@@ -643,7 +643,7 @@ void blockForKeys(redisClient *c, robj **keys, int numkeys, mstime_t timeout, ro ...@@ -643,7 +643,7 @@ void blockForKeys(redisClient *c, robj **keys, int numkeys, mstime_t timeout, ro
/* Unblock a client that's waiting in a blocking operation such as BLPOP. /* Unblock a client that's waiting in a blocking operation such as BLPOP.
* You should never call this function directly, but unblockClient() instead. */ * You should never call this function directly, but unblockClient() instead. */
void unblockClientWaitingData(redisClient *c) { void unblockClientWaitingData(client *c) {
dictEntry *de; dictEntry *de;
dictIterator *di; dictIterator *di;
list *l; list *l;
...@@ -721,7 +721,7 @@ void signalListAsReady(redisDb *db, robj *key) { ...@@ -721,7 +721,7 @@ void signalListAsReady(redisDb *db, robj *key) {
* should be undone as the client was not served: This only happens for * should be undone as the client was not served: This only happens for
* BRPOPLPUSH that fails to push the value to the destination key as it is * BRPOPLPUSH that fails to push the value to the destination key as it is
* of the wrong type. */ * of the wrong type. */
int serveClientBlockedOnList(redisClient *receiver, robj *key, robj *dstkey, redisDb *db, robj *value, int where) int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb *db, robj *value, int where)
{ {
robj *argv[3]; robj *argv[3];
...@@ -815,7 +815,7 @@ void handleClientsBlockedOnLists(void) { ...@@ -815,7 +815,7 @@ void handleClientsBlockedOnLists(void) {
while(numclients--) { while(numclients--) {
listNode *clientnode = listFirst(clients); listNode *clientnode = listFirst(clients);
redisClient *receiver = clientnode->value; client *receiver = clientnode->value;
robj *dstkey = receiver->bpop.target; robj *dstkey = receiver->bpop.target;
int where = (receiver->lastcmd && int where = (receiver->lastcmd &&
receiver->lastcmd->proc == blpopCommand) ? receiver->lastcmd->proc == blpopCommand) ?
...@@ -863,7 +863,7 @@ void handleClientsBlockedOnLists(void) { ...@@ -863,7 +863,7 @@ void handleClientsBlockedOnLists(void) {
} }
/* Blocking RPOP/LPOP */ /* Blocking RPOP/LPOP */
void blockingPopGenericCommand(redisClient *c, int where) { void blockingPopGenericCommand(client *c, int where) {
robj *o; robj *o;
mstime_t timeout; mstime_t timeout;
int j; int j;
...@@ -919,15 +919,15 @@ void blockingPopGenericCommand(redisClient *c, int where) { ...@@ -919,15 +919,15 @@ void blockingPopGenericCommand(redisClient *c, int where) {
blockForKeys(c, c->argv + 1, c->argc - 2, timeout, NULL); blockForKeys(c, c->argv + 1, c->argc - 2, timeout, NULL);
} }
void blpopCommand(redisClient *c) { void blpopCommand(client *c) {
blockingPopGenericCommand(c,REDIS_HEAD); blockingPopGenericCommand(c,REDIS_HEAD);
} }
void brpopCommand(redisClient *c) { void brpopCommand(client *c) {
blockingPopGenericCommand(c,REDIS_TAIL); blockingPopGenericCommand(c,REDIS_TAIL);
} }
void brpoplpushCommand(redisClient *c) { void brpoplpushCommand(client *c) {
mstime_t timeout; mstime_t timeout;
if (getTimeoutFromObjectOrReply(c,c->argv[3],&timeout,UNIT_SECONDS) if (getTimeoutFromObjectOrReply(c,c->argv[3],&timeout,UNIT_SECONDS)
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* Set Commands * Set Commands
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void sunionDiffGenericCommand(redisClient *c, robj **setkeys, int setnum, void sunionDiffGenericCommand(client *c, robj **setkeys, int setnum,
robj *dstkey, int op); robj *dstkey, int op);
/* Factory method to return a set that *can* hold "value". When the object has /* Factory method to return a set that *can* hold "value". When the object has
...@@ -269,7 +269,7 @@ void setTypeConvert(robj *setobj, int enc) { ...@@ -269,7 +269,7 @@ void setTypeConvert(robj *setobj, int enc) {
} }
} }
void saddCommand(redisClient *c) { void saddCommand(client *c) {
robj *set; robj *set;
int j, added = 0; int j, added = 0;
...@@ -296,7 +296,7 @@ void saddCommand(redisClient *c) { ...@@ -296,7 +296,7 @@ void saddCommand(redisClient *c) {
addReplyLongLong(c,added); addReplyLongLong(c,added);
} }
void sremCommand(redisClient *c) { void sremCommand(client *c) {
robj *set; robj *set;
int j, deleted = 0, keyremoved = 0; int j, deleted = 0, keyremoved = 0;
...@@ -324,7 +324,7 @@ void sremCommand(redisClient *c) { ...@@ -324,7 +324,7 @@ void sremCommand(redisClient *c) {
addReplyLongLong(c,deleted); addReplyLongLong(c,deleted);
} }
void smoveCommand(redisClient *c) { void smoveCommand(client *c) {
robj *srcset, *dstset, *ele; robj *srcset, *dstset, *ele;
srcset = lookupKeyWrite(c->db,c->argv[1]); srcset = lookupKeyWrite(c->db,c->argv[1]);
dstset = lookupKeyWrite(c->db,c->argv[2]); dstset = lookupKeyWrite(c->db,c->argv[2]);
...@@ -377,7 +377,7 @@ void smoveCommand(redisClient *c) { ...@@ -377,7 +377,7 @@ void smoveCommand(redisClient *c) {
addReply(c,shared.cone); addReply(c,shared.cone);
} }
void sismemberCommand(redisClient *c) { void sismemberCommand(client *c) {
robj *set; robj *set;
if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL || if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
...@@ -390,7 +390,7 @@ void sismemberCommand(redisClient *c) { ...@@ -390,7 +390,7 @@ void sismemberCommand(redisClient *c) {
addReply(c,shared.czero); addReply(c,shared.czero);
} }
void scardCommand(redisClient *c) { void scardCommand(client *c) {
robj *o; robj *o;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL || if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
...@@ -407,7 +407,7 @@ void scardCommand(redisClient *c) { ...@@ -407,7 +407,7 @@ void scardCommand(redisClient *c) {
* implementation for more info. */ * implementation for more info. */
#define SPOP_MOVE_STRATEGY_MUL 5 #define SPOP_MOVE_STRATEGY_MUL 5
void spopWithCountCommand(redisClient *c) { void spopWithCountCommand(client *c) {
long l; long l;
unsigned long count, size; unsigned long count, size;
robj *set; robj *set;
...@@ -556,7 +556,7 @@ void spopWithCountCommand(redisClient *c) { ...@@ -556,7 +556,7 @@ void spopWithCountCommand(redisClient *c) {
preventCommandPropagation(c); preventCommandPropagation(c);
} }
void spopCommand(redisClient *c) { void spopCommand(client *c) {
robj *set, *ele, *aux; robj *set, *ele, *aux;
int64_t llele; int64_t llele;
int encoding; int encoding;
...@@ -616,7 +616,7 @@ void spopCommand(redisClient *c) { ...@@ -616,7 +616,7 @@ void spopCommand(redisClient *c) {
* implementation for more info. */ * implementation for more info. */
#define SRANDMEMBER_SUB_STRATEGY_MUL 3 #define SRANDMEMBER_SUB_STRATEGY_MUL 3
void srandmemberWithCountCommand(redisClient *c) { void srandmemberWithCountCommand(client *c) {
long l; long l;
unsigned long count, size; unsigned long count, size;
int uniq = 1; int uniq = 1;
...@@ -749,7 +749,7 @@ void srandmemberWithCountCommand(redisClient *c) { ...@@ -749,7 +749,7 @@ void srandmemberWithCountCommand(redisClient *c) {
} }
} }
void srandmemberCommand(redisClient *c) { void srandmemberCommand(client *c) {
robj *set, *ele; robj *set, *ele;
int64_t llele; int64_t llele;
int encoding; int encoding;
...@@ -785,7 +785,7 @@ int qsortCompareSetsByRevCardinality(const void *s1, const void *s2) { ...@@ -785,7 +785,7 @@ int qsortCompareSetsByRevCardinality(const void *s1, const void *s2) {
return (o2 ? setTypeSize(o2) : 0) - (o1 ? setTypeSize(o1) : 0); return (o2 ? setTypeSize(o2) : 0) - (o1 ? setTypeSize(o1) : 0);
} }
void sinterGenericCommand(redisClient *c, robj **setkeys, void sinterGenericCommand(client *c, robj **setkeys,
unsigned long setnum, robj *dstkey) { unsigned long setnum, robj *dstkey) {
robj **sets = zmalloc(sizeof(robj*)*setnum); robj **sets = zmalloc(sizeof(robj*)*setnum);
setTypeIterator *si; setTypeIterator *si;
...@@ -921,11 +921,11 @@ void sinterGenericCommand(redisClient *c, robj **setkeys, ...@@ -921,11 +921,11 @@ void sinterGenericCommand(redisClient *c, robj **setkeys,
zfree(sets); zfree(sets);
} }
void sinterCommand(redisClient *c) { void sinterCommand(client *c) {
sinterGenericCommand(c,c->argv+1,c->argc-1,NULL); sinterGenericCommand(c,c->argv+1,c->argc-1,NULL);
} }
void sinterstoreCommand(redisClient *c) { void sinterstoreCommand(client *c) {
sinterGenericCommand(c,c->argv+2,c->argc-2,c->argv[1]); sinterGenericCommand(c,c->argv+2,c->argc-2,c->argv[1]);
} }
...@@ -933,7 +933,7 @@ void sinterstoreCommand(redisClient *c) { ...@@ -933,7 +933,7 @@ void sinterstoreCommand(redisClient *c) {
#define REDIS_OP_DIFF 1 #define REDIS_OP_DIFF 1
#define REDIS_OP_INTER 2 #define REDIS_OP_INTER 2
void sunionDiffGenericCommand(redisClient *c, robj **setkeys, int setnum, void sunionDiffGenericCommand(client *c, robj **setkeys, int setnum,
robj *dstkey, int op) { robj *dstkey, int op) {
robj **sets = zmalloc(sizeof(robj*)*setnum); robj **sets = zmalloc(sizeof(robj*)*setnum);
setTypeIterator *si; setTypeIterator *si;
...@@ -1092,23 +1092,23 @@ void sunionDiffGenericCommand(redisClient *c, robj **setkeys, int setnum, ...@@ -1092,23 +1092,23 @@ void sunionDiffGenericCommand(redisClient *c, robj **setkeys, int setnum,
zfree(sets); zfree(sets);
} }
void sunionCommand(redisClient *c) { void sunionCommand(client *c) {
sunionDiffGenericCommand(c,c->argv+1,c->argc-1,NULL,REDIS_OP_UNION); sunionDiffGenericCommand(c,c->argv+1,c->argc-1,NULL,REDIS_OP_UNION);
} }
void sunionstoreCommand(redisClient *c) { void sunionstoreCommand(client *c) {
sunionDiffGenericCommand(c,c->argv+2,c->argc-2,c->argv[1],REDIS_OP_UNION); sunionDiffGenericCommand(c,c->argv+2,c->argc-2,c->argv[1],REDIS_OP_UNION);
} }
void sdiffCommand(redisClient *c) { void sdiffCommand(client *c) {
sunionDiffGenericCommand(c,c->argv+1,c->argc-1,NULL,REDIS_OP_DIFF); sunionDiffGenericCommand(c,c->argv+1,c->argc-1,NULL,REDIS_OP_DIFF);
} }
void sdiffstoreCommand(redisClient *c) { void sdiffstoreCommand(client *c) {
sunionDiffGenericCommand(c,c->argv+2,c->argc-2,c->argv[1],REDIS_OP_DIFF); sunionDiffGenericCommand(c,c->argv+2,c->argc-2,c->argv[1],REDIS_OP_DIFF);
} }
void sscanCommand(redisClient *c) { void sscanCommand(client *c) {
robj *set; robj *set;
unsigned long cursor; unsigned long cursor;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* String Commands * String Commands
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
static int checkStringLength(redisClient *c, long long size) { static int checkStringLength(client *c, long long size) {
if (size > 512*1024*1024) { if (size > 512*1024*1024) {
addReplyError(c,"string exceeds maximum allowed size (512MB)"); addReplyError(c,"string exceeds maximum allowed size (512MB)");
return REDIS_ERR; return REDIS_ERR;
...@@ -64,7 +64,7 @@ static int checkStringLength(redisClient *c, long long size) { ...@@ -64,7 +64,7 @@ static int checkStringLength(redisClient *c, long long size) {
#define REDIS_SET_EX (1<<2) /* Set if time in seconds is given */ #define REDIS_SET_EX (1<<2) /* Set if time in seconds is given */
#define REDIS_SET_PX (1<<3) /* Set if time in ms in given */ #define REDIS_SET_PX (1<<3) /* Set if time in ms in given */
void setGenericCommand(redisClient *c, int flags, robj *key, robj *val, robj *expire, int unit, robj *ok_reply, robj *abort_reply) { void setGenericCommand(client *c, int flags, robj *key, robj *val, robj *expire, int unit, robj *ok_reply, robj *abort_reply) {
long long milliseconds = 0; /* initialized to avoid any harmness warning */ long long milliseconds = 0; /* initialized to avoid any harmness warning */
if (expire) { if (expire) {
...@@ -93,7 +93,7 @@ void setGenericCommand(redisClient *c, int flags, robj *key, robj *val, robj *ex ...@@ -93,7 +93,7 @@ void setGenericCommand(redisClient *c, int flags, robj *key, robj *val, robj *ex
} }
/* SET key value [NX] [XX] [EX <seconds>] [PX <milliseconds>] */ /* SET key value [NX] [XX] [EX <seconds>] [PX <milliseconds>] */
void setCommand(redisClient *c) { void setCommand(client *c) {
int j; int j;
robj *expire = NULL; robj *expire = NULL;
int unit = UNIT_SECONDS; int unit = UNIT_SECONDS;
...@@ -139,22 +139,22 @@ void setCommand(redisClient *c) { ...@@ -139,22 +139,22 @@ void setCommand(redisClient *c) {
setGenericCommand(c,flags,c->argv[1],c->argv[2],expire,unit,NULL,NULL); setGenericCommand(c,flags,c->argv[1],c->argv[2],expire,unit,NULL,NULL);
} }
void setnxCommand(redisClient *c) { void setnxCommand(client *c) {
c->argv[2] = tryObjectEncoding(c->argv[2]); c->argv[2] = tryObjectEncoding(c->argv[2]);
setGenericCommand(c,REDIS_SET_NX,c->argv[1],c->argv[2],NULL,0,shared.cone,shared.czero); setGenericCommand(c,REDIS_SET_NX,c->argv[1],c->argv[2],NULL,0,shared.cone,shared.czero);
} }
void setexCommand(redisClient *c) { void setexCommand(client *c) {
c->argv[3] = tryObjectEncoding(c->argv[3]); c->argv[3] = tryObjectEncoding(c->argv[3]);
setGenericCommand(c,REDIS_SET_NO_FLAGS,c->argv[1],c->argv[3],c->argv[2],UNIT_SECONDS,NULL,NULL); setGenericCommand(c,REDIS_SET_NO_FLAGS,c->argv[1],c->argv[3],c->argv[2],UNIT_SECONDS,NULL,NULL);
} }
void psetexCommand(redisClient *c) { void psetexCommand(client *c) {
c->argv[3] = tryObjectEncoding(c->argv[3]); c->argv[3] = tryObjectEncoding(c->argv[3]);
setGenericCommand(c,REDIS_SET_NO_FLAGS,c->argv[1],c->argv[3],c->argv[2],UNIT_MILLISECONDS,NULL,NULL); setGenericCommand(c,REDIS_SET_NO_FLAGS,c->argv[1],c->argv[3],c->argv[2],UNIT_MILLISECONDS,NULL,NULL);
} }
int getGenericCommand(redisClient *c) { int getGenericCommand(client *c) {
robj *o; robj *o;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL) if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL)
...@@ -169,11 +169,11 @@ int getGenericCommand(redisClient *c) { ...@@ -169,11 +169,11 @@ int getGenericCommand(redisClient *c) {
} }
} }
void getCommand(redisClient *c) { void getCommand(client *c) {
getGenericCommand(c); getGenericCommand(c);
} }
void getsetCommand(redisClient *c) { void getsetCommand(client *c) {
if (getGenericCommand(c) == REDIS_ERR) return; if (getGenericCommand(c) == REDIS_ERR) return;
c->argv[2] = tryObjectEncoding(c->argv[2]); c->argv[2] = tryObjectEncoding(c->argv[2]);
setKey(c->db,c->argv[1],c->argv[2]); setKey(c->db,c->argv[1],c->argv[2]);
...@@ -181,7 +181,7 @@ void getsetCommand(redisClient *c) { ...@@ -181,7 +181,7 @@ void getsetCommand(redisClient *c) {
server.dirty++; server.dirty++;
} }
void setrangeCommand(redisClient *c) { void setrangeCommand(client *c) {
robj *o; robj *o;
long offset; long offset;
sds value = c->argv[3]->ptr; sds value = c->argv[3]->ptr;
...@@ -241,7 +241,7 @@ void setrangeCommand(redisClient *c) { ...@@ -241,7 +241,7 @@ void setrangeCommand(redisClient *c) {
addReplyLongLong(c,sdslen(o->ptr)); addReplyLongLong(c,sdslen(o->ptr));
} }
void getrangeCommand(redisClient *c) { void getrangeCommand(client *c) {
robj *o; robj *o;
long long start, end; long long start, end;
char *str, llbuf[32]; char *str, llbuf[32];
...@@ -278,7 +278,7 @@ void getrangeCommand(redisClient *c) { ...@@ -278,7 +278,7 @@ void getrangeCommand(redisClient *c) {
} }
} }
void mgetCommand(redisClient *c) { void mgetCommand(client *c) {
int j; int j;
addReplyMultiBulkLen(c,c->argc-1); addReplyMultiBulkLen(c,c->argc-1);
...@@ -296,7 +296,7 @@ void mgetCommand(redisClient *c) { ...@@ -296,7 +296,7 @@ void mgetCommand(redisClient *c) {
} }
} }
void msetGenericCommand(redisClient *c, int nx) { void msetGenericCommand(client *c, int nx) {
int j, busykeys = 0; int j, busykeys = 0;
if ((c->argc % 2) == 0) { if ((c->argc % 2) == 0) {
...@@ -326,15 +326,15 @@ void msetGenericCommand(redisClient *c, int nx) { ...@@ -326,15 +326,15 @@ void msetGenericCommand(redisClient *c, int nx) {
addReply(c, nx ? shared.cone : shared.ok); addReply(c, nx ? shared.cone : shared.ok);
} }
void msetCommand(redisClient *c) { void msetCommand(client *c) {
msetGenericCommand(c,0); msetGenericCommand(c,0);
} }
void msetnxCommand(redisClient *c) { void msetnxCommand(client *c) {
msetGenericCommand(c,1); msetGenericCommand(c,1);
} }
void incrDecrCommand(redisClient *c, long long incr) { void incrDecrCommand(client *c, long long incr) {
long long value, oldvalue; long long value, oldvalue;
robj *o, *new; robj *o, *new;
...@@ -372,29 +372,29 @@ void incrDecrCommand(redisClient *c, long long incr) { ...@@ -372,29 +372,29 @@ void incrDecrCommand(redisClient *c, long long incr) {
addReply(c,shared.crlf); addReply(c,shared.crlf);
} }
void incrCommand(redisClient *c) { void incrCommand(client *c) {
incrDecrCommand(c,1); incrDecrCommand(c,1);
} }
void decrCommand(redisClient *c) { void decrCommand(client *c) {
incrDecrCommand(c,-1); incrDecrCommand(c,-1);
} }
void incrbyCommand(redisClient *c) { void incrbyCommand(client *c) {
long long incr; long long incr;
if (getLongLongFromObjectOrReply(c, c->argv[2], &incr, NULL) != REDIS_OK) return; if (getLongLongFromObjectOrReply(c, c->argv[2], &incr, NULL) != REDIS_OK) return;
incrDecrCommand(c,incr); incrDecrCommand(c,incr);
} }
void decrbyCommand(redisClient *c) { void decrbyCommand(client *c) {
long long incr; long long incr;
if (getLongLongFromObjectOrReply(c, c->argv[2], &incr, NULL) != REDIS_OK) return; if (getLongLongFromObjectOrReply(c, c->argv[2], &incr, NULL) != REDIS_OK) return;
incrDecrCommand(c,-incr); incrDecrCommand(c,-incr);
} }
void incrbyfloatCommand(redisClient *c) { void incrbyfloatCommand(client *c) {
long double incr, value; long double incr, value;
robj *o, *new, *aux; robj *o, *new, *aux;
...@@ -428,7 +428,7 @@ void incrbyfloatCommand(redisClient *c) { ...@@ -428,7 +428,7 @@ void incrbyfloatCommand(redisClient *c) {
rewriteClientCommandArgument(c,2,new); rewriteClientCommandArgument(c,2,new);
} }
void appendCommand(redisClient *c) { void appendCommand(client *c) {
size_t totlen; size_t totlen;
robj *o, *append; robj *o, *append;
...@@ -461,7 +461,7 @@ void appendCommand(redisClient *c) { ...@@ -461,7 +461,7 @@ void appendCommand(redisClient *c) {
addReplyLongLong(c,totlen); addReplyLongLong(c,totlen);
} }
void strlenCommand(redisClient *c) { void strlenCommand(client *c) {
robj *o; robj *o;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL || if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
checkType(c,o,REDIS_STRING)) return; checkType(c,o,REDIS_STRING)) return;
......
...@@ -1196,7 +1196,7 @@ int zsetScore(robj *zobj, robj *member, double *score) { ...@@ -1196,7 +1196,7 @@ int zsetScore(robj *zobj, robj *member, double *score) {
#define ZADD_NX (1<<1) /* Don't touch elements not already existing. */ #define ZADD_NX (1<<1) /* Don't touch elements not already existing. */
#define ZADD_XX (1<<2) /* Only touch elements already exisitng. */ #define ZADD_XX (1<<2) /* Only touch elements already exisitng. */
#define ZADD_CH (1<<3) /* Return num of elements added or updated. */ #define ZADD_CH (1<<3) /* Return num of elements added or updated. */
void zaddGenericCommand(redisClient *c, int flags) { void zaddGenericCommand(client *c, int flags) {
static char *nanerr = "resulting score is not a number (NaN)"; static char *nanerr = "resulting score is not a number (NaN)";
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *ele; robj *ele;
...@@ -1388,15 +1388,15 @@ cleanup: ...@@ -1388,15 +1388,15 @@ cleanup:
} }
} }
void zaddCommand(redisClient *c) { void zaddCommand(client *c) {
zaddGenericCommand(c,ZADD_NONE); zaddGenericCommand(c,ZADD_NONE);
} }
void zincrbyCommand(redisClient *c) { void zincrbyCommand(client *c) {
zaddGenericCommand(c,ZADD_INCR); zaddGenericCommand(c,ZADD_INCR);
} }
void zremCommand(redisClient *c) { void zremCommand(client *c) {
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
int deleted = 0, keyremoved = 0, j; int deleted = 0, keyremoved = 0, j;
...@@ -1460,7 +1460,7 @@ void zremCommand(redisClient *c) { ...@@ -1460,7 +1460,7 @@ void zremCommand(redisClient *c) {
#define ZRANGE_RANK 0 #define ZRANGE_RANK 0
#define ZRANGE_SCORE 1 #define ZRANGE_SCORE 1
#define ZRANGE_LEX 2 #define ZRANGE_LEX 2
void zremrangeGenericCommand(redisClient *c, int rangetype) { void zremrangeGenericCommand(client *c, int rangetype) {
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
int keyremoved = 0; int keyremoved = 0;
...@@ -1560,15 +1560,15 @@ cleanup: ...@@ -1560,15 +1560,15 @@ cleanup:
if (rangetype == ZRANGE_LEX) zslFreeLexRange(&lexrange); if (rangetype == ZRANGE_LEX) zslFreeLexRange(&lexrange);
} }
void zremrangebyrankCommand(redisClient *c) { void zremrangebyrankCommand(client *c) {
zremrangeGenericCommand(c,ZRANGE_RANK); zremrangeGenericCommand(c,ZRANGE_RANK);
} }
void zremrangebyscoreCommand(redisClient *c) { void zremrangebyscoreCommand(client *c) {
zremrangeGenericCommand(c,ZRANGE_SCORE); zremrangeGenericCommand(c,ZRANGE_SCORE);
} }
void zremrangebylexCommand(redisClient *c) { void zremrangebylexCommand(client *c) {
zremrangeGenericCommand(c,ZRANGE_LEX); zremrangeGenericCommand(c,ZRANGE_LEX);
} }
...@@ -1922,7 +1922,7 @@ inline static void zunionInterAggregate(double *target, double val, int aggregat ...@@ -1922,7 +1922,7 @@ inline static void zunionInterAggregate(double *target, double val, int aggregat
} }
} }
void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) { void zunionInterGenericCommand(client *c, robj *dstkey, int op) {
int i, j; int i, j;
long setnum; long setnum;
int aggregate = REDIS_AGGR_SUM; int aggregate = REDIS_AGGR_SUM;
...@@ -2163,15 +2163,15 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) { ...@@ -2163,15 +2163,15 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
zfree(src); zfree(src);
} }
void zunionstoreCommand(redisClient *c) { void zunionstoreCommand(client *c) {
zunionInterGenericCommand(c,c->argv[1], REDIS_OP_UNION); zunionInterGenericCommand(c,c->argv[1], REDIS_OP_UNION);
} }
void zinterstoreCommand(redisClient *c) { void zinterstoreCommand(client *c) {
zunionInterGenericCommand(c,c->argv[1], REDIS_OP_INTER); zunionInterGenericCommand(c,c->argv[1], REDIS_OP_INTER);
} }
void zrangeGenericCommand(redisClient *c, int reverse) { void zrangeGenericCommand(client *c, int reverse) {
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
int withscores = 0; int withscores = 0;
...@@ -2273,16 +2273,16 @@ void zrangeGenericCommand(redisClient *c, int reverse) { ...@@ -2273,16 +2273,16 @@ void zrangeGenericCommand(redisClient *c, int reverse) {
} }
} }
void zrangeCommand(redisClient *c) { void zrangeCommand(client *c) {
zrangeGenericCommand(c,0); zrangeGenericCommand(c,0);
} }
void zrevrangeCommand(redisClient *c) { void zrevrangeCommand(client *c) {
zrangeGenericCommand(c,1); zrangeGenericCommand(c,1);
} }
/* This command implements ZRANGEBYSCORE, ZREVRANGEBYSCORE. */ /* This command implements ZRANGEBYSCORE, ZREVRANGEBYSCORE. */
void genericZrangebyscoreCommand(redisClient *c, int reverse) { void genericZrangebyscoreCommand(client *c, int reverse) {
zrangespec range; zrangespec range;
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
...@@ -2468,15 +2468,15 @@ void genericZrangebyscoreCommand(redisClient *c, int reverse) { ...@@ -2468,15 +2468,15 @@ void genericZrangebyscoreCommand(redisClient *c, int reverse) {
setDeferredMultiBulkLength(c, replylen, rangelen); setDeferredMultiBulkLength(c, replylen, rangelen);
} }
void zrangebyscoreCommand(redisClient *c) { void zrangebyscoreCommand(client *c) {
genericZrangebyscoreCommand(c,0); genericZrangebyscoreCommand(c,0);
} }
void zrevrangebyscoreCommand(redisClient *c) { void zrevrangebyscoreCommand(client *c) {
genericZrangebyscoreCommand(c,1); genericZrangebyscoreCommand(c,1);
} }
void zcountCommand(redisClient *c) { void zcountCommand(client *c) {
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
zrangespec range; zrangespec range;
...@@ -2553,7 +2553,7 @@ void zcountCommand(redisClient *c) { ...@@ -2553,7 +2553,7 @@ void zcountCommand(redisClient *c) {
addReplyLongLong(c, count); addReplyLongLong(c, count);
} }
void zlexcountCommand(redisClient *c) { void zlexcountCommand(client *c) {
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
zlexrangespec range; zlexrangespec range;
...@@ -2633,7 +2633,7 @@ void zlexcountCommand(redisClient *c) { ...@@ -2633,7 +2633,7 @@ void zlexcountCommand(redisClient *c) {
} }
/* This command implements ZRANGEBYLEX, ZREVRANGEBYLEX. */ /* This command implements ZRANGEBYLEX, ZREVRANGEBYLEX. */
void genericZrangebylexCommand(redisClient *c, int reverse) { void genericZrangebylexCommand(client *c, int reverse) {
zlexrangespec range; zlexrangespec range;
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
...@@ -2809,15 +2809,15 @@ void genericZrangebylexCommand(redisClient *c, int reverse) { ...@@ -2809,15 +2809,15 @@ void genericZrangebylexCommand(redisClient *c, int reverse) {
setDeferredMultiBulkLength(c, replylen, rangelen); setDeferredMultiBulkLength(c, replylen, rangelen);
} }
void zrangebylexCommand(redisClient *c) { void zrangebylexCommand(client *c) {
genericZrangebylexCommand(c,0); genericZrangebylexCommand(c,0);
} }
void zrevrangebylexCommand(redisClient *c) { void zrevrangebylexCommand(client *c) {
genericZrangebylexCommand(c,1); genericZrangebylexCommand(c,1);
} }
void zcardCommand(redisClient *c) { void zcardCommand(client *c) {
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
...@@ -2827,7 +2827,7 @@ void zcardCommand(redisClient *c) { ...@@ -2827,7 +2827,7 @@ void zcardCommand(redisClient *c) {
addReplyLongLong(c,zsetLength(zobj)); addReplyLongLong(c,zsetLength(zobj));
} }
void zscoreCommand(redisClient *c) { void zscoreCommand(client *c) {
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *zobj; robj *zobj;
double score; double score;
...@@ -2842,7 +2842,7 @@ void zscoreCommand(redisClient *c) { ...@@ -2842,7 +2842,7 @@ void zscoreCommand(redisClient *c) {
} }
} }
void zrankGenericCommand(redisClient *c, int reverse) { void zrankGenericCommand(client *c, int reverse) {
robj *key = c->argv[1]; robj *key = c->argv[1];
robj *ele = c->argv[2]; robj *ele = c->argv[2];
robj *zobj; robj *zobj;
...@@ -2904,15 +2904,15 @@ void zrankGenericCommand(redisClient *c, int reverse) { ...@@ -2904,15 +2904,15 @@ void zrankGenericCommand(redisClient *c, int reverse) {
} }
} }
void zrankCommand(redisClient *c) { void zrankCommand(client *c) {
zrankGenericCommand(c, 0); zrankGenericCommand(c, 0);
} }
void zrevrankCommand(redisClient *c) { void zrevrankCommand(client *c) {
zrankGenericCommand(c, 1); zrankGenericCommand(c, 1);
} }
void zscanCommand(redisClient *c) { void zscanCommand(client *c) {
robj *o; robj *o;
unsigned long cursor; unsigned long cursor;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment