Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
554bd0e7
Commit
554bd0e7
authored
Jul 26, 2015
by
antirez
Browse files
RDMF: use client instead of redisClient, like Disque.
parent
424fe9af
Changes
29
Hide whitespace changes
Inline
Side-by-side
src/server.h
View file @
554bd0e7
...
@@ -528,7 +528,7 @@ typedef struct readyList {
...
@@ -528,7 +528,7 @@ typedef struct readyList {
/* With multiplexing we need to take per-client state.
/* With multiplexing we need to take per-client state.
* Clients are taken in a linked list. */
* Clients are taken in a linked list. */
typedef
struct
redisC
lient
{
typedef
struct
c
lient
{
uint64_t
id
;
/* Client incremental unique ID. */
uint64_t
id
;
/* Client incremental unique ID. */
int
fd
;
int
fd
;
redisDb
*
db
;
redisDb
*
db
;
...
@@ -574,7 +574,7 @@ typedef struct redisClient {
...
@@ -574,7 +574,7 @@ typedef struct redisClient {
/* Response buffer */
/* Response buffer */
int
bufpos
;
int
bufpos
;
char
buf
[
REDIS_REPLY_CHUNK_BYTES
];
char
buf
[
REDIS_REPLY_CHUNK_BYTES
];
}
redisC
lient
;
}
c
lient
;
struct
saveparam
{
struct
saveparam
{
time_t
seconds
;
time_t
seconds
;
...
@@ -695,7 +695,7 @@ struct redisServer {
...
@@ -695,7 +695,7 @@ struct redisServer {
list
*
clients
;
/* List of active clients */
list
*
clients
;
/* List of active clients */
list
*
clients_to_close
;
/* Clients to close asynchronously */
list
*
clients_to_close
;
/* Clients to close asynchronously */
list
*
slaves
,
*
monitors
;
/* List of slaves and MONITORs */
list
*
slaves
,
*
monitors
;
/* List of slaves and MONITORs */
redisC
lient
*
current_client
;
/* Current client, only used on crash report */
c
lient
*
current_client
;
/* Current client, only used on crash report */
int
clients_paused
;
/* True if clients are currently paused */
int
clients_paused
;
/* True if clients are currently paused */
mstime_t
clients_pause_end_time
;
/* Time when we undo clients_paused */
mstime_t
clients_pause_end_time
;
/* Time when we undo clients_paused */
char
neterr
[
ANET_ERR_LEN
];
/* Error buffer for anet.c */
char
neterr
[
ANET_ERR_LEN
];
/* Error buffer for anet.c */
...
@@ -835,8 +835,8 @@ struct redisServer {
...
@@ -835,8 +835,8 @@ struct redisServer {
char
*
masterhost
;
/* Hostname of master */
char
*
masterhost
;
/* Hostname of master */
int
masterport
;
/* Port of master */
int
masterport
;
/* Port of master */
int
repl_timeout
;
/* Timeout after N seconds of master idle */
int
repl_timeout
;
/* Timeout after N seconds of master idle */
redisC
lient
*
master
;
/* Client that is master for this slave */
c
lient
*
master
;
/* Client that is master for this slave */
redisC
lient
*
cached_master
;
/* Cached master to be reused for PSYNC. */
c
lient
*
cached_master
;
/* Cached master to be reused for PSYNC. */
int
repl_syncio_timeout
;
/* Timeout for synchronous I/O calls */
int
repl_syncio_timeout
;
/* Timeout for synchronous I/O calls */
int
repl_state
;
/* Replication status if the instance is a slave */
int
repl_state
;
/* Replication status if the instance is a slave */
off_t
repl_transfer_size
;
/* Size of RDB to read from master during sync. */
off_t
repl_transfer_size
;
/* Size of RDB to read from master during sync. */
...
@@ -904,8 +904,8 @@ struct redisServer {
...
@@ -904,8 +904,8 @@ struct redisServer {
there is at least an uncovered slot. */
there is at least an uncovered slot. */
/* Scripting */
/* Scripting */
lua_State
*
lua
;
/* The Lua interpreter. We use just one for all clients */
lua_State
*
lua
;
/* The Lua interpreter. We use just one for all clients */
redisC
lient
*
lua_client
;
/* The "fake client" to query Redis from Lua */
c
lient
*
lua_client
;
/* The "fake client" to query Redis from Lua */
redisC
lient
*
lua_caller
;
/* The client running EVAL right now, or NULL */
c
lient
*
lua_caller
;
/* The client running EVAL right now, or NULL */
dict
*
lua_scripts
;
/* A dictionary of SHA1 -> Lua scripts */
dict
*
lua_scripts
;
/* A dictionary of SHA1 -> Lua scripts */
mstime_t
lua_time_limit
;
/* Script timeout in milliseconds */
mstime_t
lua_time_limit
;
/* Script timeout in milliseconds */
mstime_t
lua_time_start
;
/* Start time of script, milliseconds time */
mstime_t
lua_time_start
;
/* Start time of script, milliseconds time */
...
@@ -930,11 +930,11 @@ struct redisServer {
...
@@ -930,11 +930,11 @@ struct redisServer {
};
};
typedef
struct
pubsubPattern
{
typedef
struct
pubsubPattern
{
redisC
lient
*
client
;
c
lient
*
client
;
robj
*
pattern
;
robj
*
pattern
;
}
pubsubPattern
;
}
pubsubPattern
;
typedef
void
redisCommandProc
(
redisC
lient
*
c
);
typedef
void
redisCommandProc
(
c
lient
*
c
);
typedef
int
*
redisGetKeysProc
(
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
numkeys
);
typedef
int
*
redisGetKeysProc
(
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
numkeys
);
struct
redisCommand
{
struct
redisCommand
{
char
*
name
;
char
*
name
;
...
@@ -1039,46 +1039,46 @@ size_t redisPopcount(void *s, long count);
...
@@ -1039,46 +1039,46 @@ size_t redisPopcount(void *s, long count);
void
redisSetProcTitle
(
char
*
title
);
void
redisSetProcTitle
(
char
*
title
);
/* networking.c -- Networking and Client related operations */
/* networking.c -- Networking and Client related operations */
redisC
lient
*
createClient
(
int
fd
);
c
lient
*
createClient
(
int
fd
);
void
closeTimedoutClients
(
void
);
void
closeTimedoutClients
(
void
);
void
freeClient
(
redisC
lient
*
c
);
void
freeClient
(
c
lient
*
c
);
void
freeClientAsync
(
redisC
lient
*
c
);
void
freeClientAsync
(
c
lient
*
c
);
void
resetClient
(
redisC
lient
*
c
);
void
resetClient
(
c
lient
*
c
);
void
sendReplyToClient
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
sendReplyToClient
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
*
addDeferredMultiBulkLength
(
redisC
lient
*
c
);
void
*
addDeferredMultiBulkLength
(
c
lient
*
c
);
void
setDeferredMultiBulkLength
(
redisC
lient
*
c
,
void
*
node
,
long
length
);
void
setDeferredMultiBulkLength
(
c
lient
*
c
,
void
*
node
,
long
length
);
void
processInputBuffer
(
redisC
lient
*
c
);
void
processInputBuffer
(
c
lient
*
c
);
void
acceptHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
acceptHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
acceptTcpHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
acceptTcpHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
acceptUnixHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
acceptUnixHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
readQueryFromClient
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
readQueryFromClient
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
addReplyBulk
(
redisC
lient
*
c
,
robj
*
obj
);
void
addReplyBulk
(
c
lient
*
c
,
robj
*
obj
);
void
addReplyBulkCString
(
redisC
lient
*
c
,
const
char
*
s
);
void
addReplyBulkCString
(
c
lient
*
c
,
const
char
*
s
);
void
addReplyBulkCBuffer
(
redisC
lient
*
c
,
const
void
*
p
,
size_t
len
);
void
addReplyBulkCBuffer
(
c
lient
*
c
,
const
void
*
p
,
size_t
len
);
void
addReplyBulkLongLong
(
redisC
lient
*
c
,
long
long
ll
);
void
addReplyBulkLongLong
(
c
lient
*
c
,
long
long
ll
);
void
addReply
(
redisC
lient
*
c
,
robj
*
obj
);
void
addReply
(
c
lient
*
c
,
robj
*
obj
);
void
addReplySds
(
redisC
lient
*
c
,
sds
s
);
void
addReplySds
(
c
lient
*
c
,
sds
s
);
void
addReplyBulkSds
(
redisC
lient
*
c
,
sds
s
);
void
addReplyBulkSds
(
c
lient
*
c
,
sds
s
);
void
addReplyError
(
redisC
lient
*
c
,
const
char
*
err
);
void
addReplyError
(
c
lient
*
c
,
const
char
*
err
);
void
addReplyStatus
(
redisC
lient
*
c
,
const
char
*
status
);
void
addReplyStatus
(
c
lient
*
c
,
const
char
*
status
);
void
addReplyDouble
(
redisC
lient
*
c
,
double
d
);
void
addReplyDouble
(
c
lient
*
c
,
double
d
);
void
addReplyLongLong
(
redisC
lient
*
c
,
long
long
ll
);
void
addReplyLongLong
(
c
lient
*
c
,
long
long
ll
);
void
addReplyMultiBulkLen
(
redisC
lient
*
c
,
long
length
);
void
addReplyMultiBulkLen
(
c
lient
*
c
,
long
length
);
void
copyClientOutputBuffer
(
redisC
lient
*
dst
,
redisC
lient
*
src
);
void
copyClientOutputBuffer
(
c
lient
*
dst
,
c
lient
*
src
);
void
*
dupClientReplyValue
(
void
*
o
);
void
*
dupClientReplyValue
(
void
*
o
);
void
getClientsMaxBuffers
(
unsigned
long
*
longest_output_list
,
void
getClientsMaxBuffers
(
unsigned
long
*
longest_output_list
,
unsigned
long
*
biggest_input_buffer
);
unsigned
long
*
biggest_input_buffer
);
void
formatPeerId
(
char
*
peerid
,
size_t
peerid_len
,
char
*
ip
,
int
port
);
void
formatPeerId
(
char
*
peerid
,
size_t
peerid_len
,
char
*
ip
,
int
port
);
char
*
getClientPeerId
(
redisC
lient
*
client
);
char
*
getClientPeerId
(
c
lient
*
client
);
sds
catClientInfoString
(
sds
s
,
redisC
lient
*
client
);
sds
catClientInfoString
(
sds
s
,
c
lient
*
client
);
sds
getAllClientsInfoString
(
void
);
sds
getAllClientsInfoString
(
void
);
void
rewriteClientCommandVector
(
redisC
lient
*
c
,
int
argc
,
...);
void
rewriteClientCommandVector
(
c
lient
*
c
,
int
argc
,
...);
void
rewriteClientCommandArgument
(
redisC
lient
*
c
,
int
i
,
robj
*
newval
);
void
rewriteClientCommandArgument
(
c
lient
*
c
,
int
i
,
robj
*
newval
);
void
replaceClientCommandVector
(
redisC
lient
*
c
,
int
argc
,
robj
**
argv
);
void
replaceClientCommandVector
(
c
lient
*
c
,
int
argc
,
robj
**
argv
);
unsigned
long
getClientOutputBufferMemoryUsage
(
redisC
lient
*
c
);
unsigned
long
getClientOutputBufferMemoryUsage
(
c
lient
*
c
);
void
freeClientsInAsyncFreeQueue
(
void
);
void
freeClientsInAsyncFreeQueue
(
void
);
void
asyncCloseClientOnOutputBufferLimitReached
(
redisC
lient
*
c
);
void
asyncCloseClientOnOutputBufferLimitReached
(
c
lient
*
c
);
int
getClientType
(
redisC
lient
*
c
);
int
getClientType
(
c
lient
*
c
);
int
getClientTypeByName
(
char
*
name
);
int
getClientTypeByName
(
char
*
name
);
char
*
getClientTypeName
(
int
class
);
char
*
getClientTypeName
(
int
class
);
void
flushSlavesOutputBuffers
(
void
);
void
flushSlavesOutputBuffers
(
void
);
...
@@ -1089,13 +1089,13 @@ int clientsArePaused(void);
...
@@ -1089,13 +1089,13 @@ int clientsArePaused(void);
int
processEventsWhileBlocked
(
void
);
int
processEventsWhileBlocked
(
void
);
#ifdef __GNUC__
#ifdef __GNUC__
void
addReplyErrorFormat
(
redisC
lient
*
c
,
const
char
*
fmt
,
...)
void
addReplyErrorFormat
(
c
lient
*
c
,
const
char
*
fmt
,
...)
__attribute__
((
format
(
printf
,
2
,
3
)));
__attribute__
((
format
(
printf
,
2
,
3
)));
void
addReplyStatusFormat
(
redisC
lient
*
c
,
const
char
*
fmt
,
...)
void
addReplyStatusFormat
(
c
lient
*
c
,
const
char
*
fmt
,
...)
__attribute__
((
format
(
printf
,
2
,
3
)));
__attribute__
((
format
(
printf
,
2
,
3
)));
#else
#else
void
addReplyErrorFormat
(
redisC
lient
*
c
,
const
char
*
fmt
,
...);
void
addReplyErrorFormat
(
c
lient
*
c
,
const
char
*
fmt
,
...);
void
addReplyStatusFormat
(
redisC
lient
*
c
,
const
char
*
fmt
,
...);
void
addReplyStatusFormat
(
c
lient
*
c
,
const
char
*
fmt
,
...);
#endif
#endif
/* List data type */
/* List data type */
...
@@ -1111,20 +1111,20 @@ void listTypeInsert(listTypeEntry *entry, robj *value, int where);
...
@@ -1111,20 +1111,20 @@ void listTypeInsert(listTypeEntry *entry, robj *value, int where);
int
listTypeEqual
(
listTypeEntry
*
entry
,
robj
*
o
);
int
listTypeEqual
(
listTypeEntry
*
entry
,
robj
*
o
);
void
listTypeDelete
(
listTypeIterator
*
iter
,
listTypeEntry
*
entry
);
void
listTypeDelete
(
listTypeIterator
*
iter
,
listTypeEntry
*
entry
);
void
listTypeConvert
(
robj
*
subject
,
int
enc
);
void
listTypeConvert
(
robj
*
subject
,
int
enc
);
void
unblockClientWaitingData
(
redisC
lient
*
c
);
void
unblockClientWaitingData
(
c
lient
*
c
);
void
handleClientsBlockedOnLists
(
void
);
void
handleClientsBlockedOnLists
(
void
);
void
popGenericCommand
(
redisC
lient
*
c
,
int
where
);
void
popGenericCommand
(
c
lient
*
c
,
int
where
);
void
signalListAsReady
(
redisDb
*
db
,
robj
*
key
);
void
signalListAsReady
(
redisDb
*
db
,
robj
*
key
);
/* MULTI/EXEC/WATCH... */
/* MULTI/EXEC/WATCH... */
void
unwatchAllKeys
(
redisC
lient
*
c
);
void
unwatchAllKeys
(
c
lient
*
c
);
void
initClientMultiState
(
redisC
lient
*
c
);
void
initClientMultiState
(
c
lient
*
c
);
void
freeClientMultiState
(
redisC
lient
*
c
);
void
freeClientMultiState
(
c
lient
*
c
);
void
queueMultiCommand
(
redisC
lient
*
c
);
void
queueMultiCommand
(
c
lient
*
c
);
void
touchWatchedKey
(
redisDb
*
db
,
robj
*
key
);
void
touchWatchedKey
(
redisDb
*
db
,
robj
*
key
);
void
touchWatchedKeysOnFlush
(
int
dbid
);
void
touchWatchedKeysOnFlush
(
int
dbid
);
void
discardTransaction
(
redisC
lient
*
c
);
void
discardTransaction
(
c
lient
*
c
);
void
flagTransaction
(
redisC
lient
*
c
);
void
flagTransaction
(
c
lient
*
c
);
/* Redis object implementation */
/* Redis object implementation */
void
decrRefCount
(
robj
*
o
);
void
decrRefCount
(
robj
*
o
);
...
@@ -1154,13 +1154,13 @@ robj *createIntsetObject(void);
...
@@ -1154,13 +1154,13 @@ robj *createIntsetObject(void);
robj
*
createHashObject
(
void
);
robj
*
createHashObject
(
void
);
robj
*
createZsetObject
(
void
);
robj
*
createZsetObject
(
void
);
robj
*
createZsetZiplistObject
(
void
);
robj
*
createZsetZiplistObject
(
void
);
int
getLongFromObjectOrReply
(
redisC
lient
*
c
,
robj
*
o
,
long
*
target
,
const
char
*
msg
);
int
getLongFromObjectOrReply
(
c
lient
*
c
,
robj
*
o
,
long
*
target
,
const
char
*
msg
);
int
checkType
(
redisC
lient
*
c
,
robj
*
o
,
int
type
);
int
checkType
(
c
lient
*
c
,
robj
*
o
,
int
type
);
int
getLongLongFromObjectOrReply
(
redisC
lient
*
c
,
robj
*
o
,
long
long
*
target
,
const
char
*
msg
);
int
getLongLongFromObjectOrReply
(
c
lient
*
c
,
robj
*
o
,
long
long
*
target
,
const
char
*
msg
);
int
getDoubleFromObjectOrReply
(
redisC
lient
*
c
,
robj
*
o
,
double
*
target
,
const
char
*
msg
);
int
getDoubleFromObjectOrReply
(
c
lient
*
c
,
robj
*
o
,
double
*
target
,
const
char
*
msg
);
int
getLongLongFromObject
(
robj
*
o
,
long
long
*
target
);
int
getLongLongFromObject
(
robj
*
o
,
long
long
*
target
);
int
getLongDoubleFromObject
(
robj
*
o
,
long
double
*
target
);
int
getLongDoubleFromObject
(
robj
*
o
,
long
double
*
target
);
int
getLongDoubleFromObjectOrReply
(
redisC
lient
*
c
,
robj
*
o
,
long
double
*
target
,
const
char
*
msg
);
int
getLongDoubleFromObjectOrReply
(
c
lient
*
c
,
robj
*
o
,
long
double
*
target
,
const
char
*
msg
);
char
*
strEncoding
(
int
encoding
);
char
*
strEncoding
(
int
encoding
);
int
compareStringObjects
(
robj
*
a
,
robj
*
b
);
int
compareStringObjects
(
robj
*
a
,
robj
*
b
);
int
collateStringObjects
(
robj
*
a
,
robj
*
b
);
int
collateStringObjects
(
robj
*
a
,
robj
*
b
);
...
@@ -1175,11 +1175,11 @@ ssize_t syncReadLine(int fd, char *ptr, ssize_t size, long long timeout);
...
@@ -1175,11 +1175,11 @@ ssize_t syncReadLine(int fd, char *ptr, ssize_t size, long long timeout);
/* Replication */
/* Replication */
void
replicationFeedSlaves
(
list
*
slaves
,
int
dictid
,
robj
**
argv
,
int
argc
);
void
replicationFeedSlaves
(
list
*
slaves
,
int
dictid
,
robj
**
argv
,
int
argc
);
void
replicationFeedMonitors
(
redisC
lient
*
c
,
list
*
monitors
,
int
dictid
,
robj
**
argv
,
int
argc
);
void
replicationFeedMonitors
(
c
lient
*
c
,
list
*
monitors
,
int
dictid
,
robj
**
argv
,
int
argc
);
void
updateSlavesWaitingBgsave
(
int
bgsaveerr
,
int
type
);
void
updateSlavesWaitingBgsave
(
int
bgsaveerr
,
int
type
);
void
replicationCron
(
void
);
void
replicationCron
(
void
);
void
replicationHandleMasterDisconnection
(
void
);
void
replicationHandleMasterDisconnection
(
void
);
void
replicationCacheMaster
(
redisC
lient
*
c
);
void
replicationCacheMaster
(
c
lient
*
c
);
void
resizeReplicationBacklog
(
long
long
newsize
);
void
resizeReplicationBacklog
(
long
long
newsize
);
void
replicationSetMaster
(
char
*
ip
,
int
port
);
void
replicationSetMaster
(
char
*
ip
,
int
port
);
void
replicationUnsetMaster
(
void
);
void
replicationUnsetMaster
(
void
);
...
@@ -1189,11 +1189,11 @@ void replicationScriptCacheFlush(void);
...
@@ -1189,11 +1189,11 @@ void replicationScriptCacheFlush(void);
void
replicationScriptCacheAdd
(
sds
sha1
);
void
replicationScriptCacheAdd
(
sds
sha1
);
int
replicationScriptCacheExists
(
sds
sha1
);
int
replicationScriptCacheExists
(
sds
sha1
);
void
processClientsWaitingReplicas
(
void
);
void
processClientsWaitingReplicas
(
void
);
void
unblockClientWaitingReplicas
(
redisC
lient
*
c
);
void
unblockClientWaitingReplicas
(
c
lient
*
c
);
int
replicationCountAcksByOffset
(
long
long
offset
);
int
replicationCountAcksByOffset
(
long
long
offset
);
void
replicationSendNewlineToMaster
(
void
);
void
replicationSendNewlineToMaster
(
void
);
long
long
replicationGetSlaveOffset
(
void
);
long
long
replicationGetSlaveOffset
(
void
);
char
*
replicationGetSlaveName
(
redisC
lient
*
c
);
char
*
replicationGetSlaveName
(
c
lient
*
c
);
/* Generic persistence functions */
/* Generic persistence functions */
void
startLoading
(
FILE
*
fp
);
void
startLoading
(
FILE
*
fp
);
...
@@ -1246,16 +1246,16 @@ unsigned long zslGetRank(zskiplist *zsl, double score, robj *o);
...
@@ -1246,16 +1246,16 @@ unsigned long zslGetRank(zskiplist *zsl, double score, robj *o);
/* Core functions */
/* Core functions */
int
freeMemoryIfNeeded
(
void
);
int
freeMemoryIfNeeded
(
void
);
int
processCommand
(
redisC
lient
*
c
);
int
processCommand
(
c
lient
*
c
);
void
setupSignalHandlers
(
void
);
void
setupSignalHandlers
(
void
);
struct
redisCommand
*
lookupCommand
(
sds
name
);
struct
redisCommand
*
lookupCommand
(
sds
name
);
struct
redisCommand
*
lookupCommandByCString
(
char
*
s
);
struct
redisCommand
*
lookupCommandByCString
(
char
*
s
);
struct
redisCommand
*
lookupCommandOrOriginal
(
sds
name
);
struct
redisCommand
*
lookupCommandOrOriginal
(
sds
name
);
void
call
(
redisC
lient
*
c
,
int
flags
);
void
call
(
c
lient
*
c
,
int
flags
);
void
propagate
(
struct
redisCommand
*
cmd
,
int
dbid
,
robj
**
argv
,
int
argc
,
int
flags
);
void
propagate
(
struct
redisCommand
*
cmd
,
int
dbid
,
robj
**
argv
,
int
argc
,
int
flags
);
void
alsoPropagate
(
struct
redisCommand
*
cmd
,
int
dbid
,
robj
**
argv
,
int
argc
,
int
target
);
void
alsoPropagate
(
struct
redisCommand
*
cmd
,
int
dbid
,
robj
**
argv
,
int
argc
,
int
target
);
void
forceCommandPropagation
(
redisC
lient
*
c
,
int
flags
);
void
forceCommandPropagation
(
c
lient
*
c
,
int
flags
);
void
preventCommandPropagation
(
redisC
lient
*
c
);
void
preventCommandPropagation
(
c
lient
*
c
);
int
prepareForShutdown
();
int
prepareForShutdown
();
#ifdef __GNUC__
#ifdef __GNUC__
void
serverLog
(
int
level
,
const
char
*
fmt
,
...)
void
serverLog
(
int
level
,
const
char
*
fmt
,
...)
...
@@ -1310,11 +1310,11 @@ void hashTypeCurrentFromZiplist(hashTypeIterator *hi, int what,
...
@@ -1310,11 +1310,11 @@ void hashTypeCurrentFromZiplist(hashTypeIterator *hi, int what,
long
long
*
vll
);
long
long
*
vll
);
void
hashTypeCurrentFromHashTable
(
hashTypeIterator
*
hi
,
int
what
,
robj
**
dst
);
void
hashTypeCurrentFromHashTable
(
hashTypeIterator
*
hi
,
int
what
,
robj
**
dst
);
robj
*
hashTypeCurrentObject
(
hashTypeIterator
*
hi
,
int
what
);
robj
*
hashTypeCurrentObject
(
hashTypeIterator
*
hi
,
int
what
);
robj
*
hashTypeLookupWriteOrCreate
(
redisC
lient
*
c
,
robj
*
key
);
robj
*
hashTypeLookupWriteOrCreate
(
c
lient
*
c
,
robj
*
key
);
/* Pub / Sub */
/* Pub / Sub */
int
pubsubUnsubscribeAllChannels
(
redisC
lient
*
c
,
int
notify
);
int
pubsubUnsubscribeAllChannels
(
c
lient
*
c
,
int
notify
);
int
pubsubUnsubscribeAllPatterns
(
redisC
lient
*
c
,
int
notify
);
int
pubsubUnsubscribeAllPatterns
(
c
lient
*
c
,
int
notify
);
void
freePubsubPattern
(
void
*
p
);
void
freePubsubPattern
(
void
*
p
);
int
listMatchPubsubPattern
(
void
*
a
,
void
*
b
);
int
listMatchPubsubPattern
(
void
*
a
,
void
*
b
);
int
pubsubPublishMessage
(
robj
*
channel
,
robj
*
message
);
int
pubsubPublishMessage
(
robj
*
channel
,
robj
*
message
);
...
@@ -1341,8 +1341,8 @@ void setExpire(redisDb *db, robj *key, long long when);
...
@@ -1341,8 +1341,8 @@ void setExpire(redisDb *db, robj *key, long long when);
robj
*
lookupKey
(
redisDb
*
db
,
robj
*
key
);
robj
*
lookupKey
(
redisDb
*
db
,
robj
*
key
);
robj
*
lookupKeyRead
(
redisDb
*
db
,
robj
*
key
);
robj
*
lookupKeyRead
(
redisDb
*
db
,
robj
*
key
);
robj
*
lookupKeyWrite
(
redisDb
*
db
,
robj
*
key
);
robj
*
lookupKeyWrite
(
redisDb
*
db
,
robj
*
key
);
robj
*
lookupKeyReadOrReply
(
redisC
lient
*
c
,
robj
*
key
,
robj
*
reply
);
robj
*
lookupKeyReadOrReply
(
c
lient
*
c
,
robj
*
key
,
robj
*
reply
);
robj
*
lookupKeyWriteOrReply
(
redisC
lient
*
c
,
robj
*
key
,
robj
*
reply
);
robj
*
lookupKeyWriteOrReply
(
c
lient
*
c
,
robj
*
key
,
robj
*
reply
);
void
dbAdd
(
redisDb
*
db
,
robj
*
key
,
robj
*
val
);
void
dbAdd
(
redisDb
*
db
,
robj
*
key
,
robj
*
val
);
void
dbOverwrite
(
redisDb
*
db
,
robj
*
key
,
robj
*
val
);
void
dbOverwrite
(
redisDb
*
db
,
robj
*
key
,
robj
*
val
);
void
setKey
(
redisDb
*
db
,
robj
*
key
,
robj
*
val
);
void
setKey
(
redisDb
*
db
,
robj
*
key
,
robj
*
val
);
...
@@ -1351,15 +1351,15 @@ robj *dbRandomKey(redisDb *db);
...
@@ -1351,15 +1351,15 @@ robj *dbRandomKey(redisDb *db);
int
dbDelete
(
redisDb
*
db
,
robj
*
key
);
int
dbDelete
(
redisDb
*
db
,
robj
*
key
);
robj
*
dbUnshareStringValue
(
redisDb
*
db
,
robj
*
key
,
robj
*
o
);
robj
*
dbUnshareStringValue
(
redisDb
*
db
,
robj
*
key
,
robj
*
o
);
long
long
emptyDb
(
void
(
callback
)(
void
*
));
long
long
emptyDb
(
void
(
callback
)(
void
*
));
int
selectDb
(
redisC
lient
*
c
,
int
id
);
int
selectDb
(
c
lient
*
c
,
int
id
);
void
signalModifiedKey
(
redisDb
*
db
,
robj
*
key
);
void
signalModifiedKey
(
redisDb
*
db
,
robj
*
key
);
void
signalFlushedDb
(
int
dbid
);
void
signalFlushedDb
(
int
dbid
);
unsigned
int
getKeysInSlot
(
unsigned
int
hashslot
,
robj
**
keys
,
unsigned
int
count
);
unsigned
int
getKeysInSlot
(
unsigned
int
hashslot
,
robj
**
keys
,
unsigned
int
count
);
unsigned
int
countKeysInSlot
(
unsigned
int
hashslot
);
unsigned
int
countKeysInSlot
(
unsigned
int
hashslot
);
unsigned
int
delKeysInSlot
(
unsigned
int
hashslot
);
unsigned
int
delKeysInSlot
(
unsigned
int
hashslot
);
int
verifyClusterConfigWithData
(
void
);
int
verifyClusterConfigWithData
(
void
);
void
scanGenericCommand
(
redisC
lient
*
c
,
robj
*
o
,
unsigned
long
cursor
);
void
scanGenericCommand
(
c
lient
*
c
,
robj
*
o
,
unsigned
long
cursor
);
int
parseScanCursorOrReply
(
redisC
lient
*
c
,
robj
*
o
,
unsigned
long
*
cursor
);
int
parseScanCursorOrReply
(
c
lient
*
c
,
robj
*
o
,
unsigned
long
*
cursor
);
/* API to get key arguments from commands */
/* API to get key arguments from commands */
int
*
getKeysFromCommand
(
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
numkeys
);
int
*
getKeysFromCommand
(
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
numkeys
);
...
@@ -1393,10 +1393,10 @@ void scriptingInit(void);
...
@@ -1393,10 +1393,10 @@ void scriptingInit(void);
/* Blocked clients */
/* Blocked clients */
void
processUnblockedClients
(
void
);
void
processUnblockedClients
(
void
);
void
blockClient
(
redisC
lient
*
c
,
int
btype
);
void
blockClient
(
c
lient
*
c
,
int
btype
);
void
unblockClient
(
redisC
lient
*
c
);
void
unblockClient
(
c
lient
*
c
);
void
replyToBlockedClientTimedOut
(
redisC
lient
*
c
);
void
replyToBlockedClientTimedOut
(
c
lient
*
c
);
int
getTimeoutFromObjectOrReply
(
redisC
lient
*
c
,
robj
*
object
,
mstime_t
*
timeout
,
int
unit
);
int
getTimeoutFromObjectOrReply
(
c
lient
*
c
,
robj
*
object
,
mstime_t
*
timeout
,
int
unit
);
void
disconnectAllBlockedClients
(
void
);
void
disconnectAllBlockedClients
(
void
);
/* Git SHA1 */
/* Git SHA1 */
...
@@ -1405,173 +1405,173 @@ char *redisGitDirty(void);
...
@@ -1405,173 +1405,173 @@ char *redisGitDirty(void);
uint64_t
redisBuildId
(
void
);
uint64_t
redisBuildId
(
void
);
/* Commands prototypes */
/* Commands prototypes */
void
authCommand
(
redisC
lient
*
c
);
void
authCommand
(
c
lient
*
c
);
void
pingCommand
(
redisC
lient
*
c
);
void
pingCommand
(
c
lient
*
c
);
void
echoCommand
(
redisC
lient
*
c
);
void
echoCommand
(
c
lient
*
c
);
void
commandCommand
(
redisC
lient
*
c
);
void
commandCommand
(
c
lient
*
c
);
void
setCommand
(
redisC
lient
*
c
);
void
setCommand
(
c
lient
*
c
);
void
setnxCommand
(
redisC
lient
*
c
);
void
setnxCommand
(
c
lient
*
c
);
void
setexCommand
(
redisC
lient
*
c
);
void
setexCommand
(
c
lient
*
c
);
void
psetexCommand
(
redisC
lient
*
c
);
void
psetexCommand
(
c
lient
*
c
);
void
getCommand
(
redisC
lient
*
c
);
void
getCommand
(
c
lient
*
c
);
void
delCommand
(
redisC
lient
*
c
);
void
delCommand
(
c
lient
*
c
);
void
existsCommand
(
redisC
lient
*
c
);
void
existsCommand
(
c
lient
*
c
);
void
setbitCommand
(
redisC
lient
*
c
);
void
setbitCommand
(
c
lient
*
c
);
void
getbitCommand
(
redisC
lient
*
c
);
void
getbitCommand
(
c
lient
*
c
);
void
setrangeCommand
(
redisC
lient
*
c
);
void
setrangeCommand
(
c
lient
*
c
);
void
getrangeCommand
(
redisC
lient
*
c
);
void
getrangeCommand
(
c
lient
*
c
);
void
incrCommand
(
redisC
lient
*
c
);
void
incrCommand
(
c
lient
*
c
);
void
decrCommand
(
redisC
lient
*
c
);
void
decrCommand
(
c
lient
*
c
);
void
incrbyCommand
(
redisC
lient
*
c
);
void
incrbyCommand
(
c
lient
*
c
);
void
decrbyCommand
(
redisC
lient
*
c
);
void
decrbyCommand
(
c
lient
*
c
);
void
incrbyfloatCommand
(
redisC
lient
*
c
);
void
incrbyfloatCommand
(
c
lient
*
c
);
void
selectCommand
(
redisC
lient
*
c
);
void
selectCommand
(
c
lient
*
c
);
void
randomkeyCommand
(
redisC
lient
*
c
);
void
randomkeyCommand
(
c
lient
*
c
);
void
keysCommand
(
redisC
lient
*
c
);
void
keysCommand
(
c
lient
*
c
);
void
scanCommand
(
redisC
lient
*
c
);
void
scanCommand
(
c
lient
*
c
);
void
dbsizeCommand
(
redisC
lient
*
c
);
void
dbsizeCommand
(
c
lient
*
c
);
void
lastsaveCommand
(
redisC
lient
*
c
);
void
lastsaveCommand
(
c
lient
*
c
);
void
saveCommand
(
redisC
lient
*
c
);
void
saveCommand
(
c
lient
*
c
);
void
bgsaveCommand
(
redisC
lient
*
c
);
void
bgsaveCommand
(
c
lient
*
c
);
void
bgrewriteaofCommand
(
redisC
lient
*
c
);
void
bgrewriteaofCommand
(
c
lient
*
c
);
void
shutdownCommand
(
redisC
lient
*
c
);
void
shutdownCommand
(
c
lient
*
c
);
void
moveCommand
(
redisC
lient
*
c
);
void
moveCommand
(
c
lient
*
c
);
void
renameCommand
(
redisC
lient
*
c
);
void
renameCommand
(
c
lient
*
c
);
void
renamenxCommand
(
redisC
lient
*
c
);
void
renamenxCommand
(
c
lient
*
c
);
void
lpushCommand
(
redisC
lient
*
c
);
void
lpushCommand
(
c
lient
*
c
);
void
rpushCommand
(
redisC
lient
*
c
);
void
rpushCommand
(
c
lient
*
c
);
void
lpushxCommand
(
redisC
lient
*
c
);
void
lpushxCommand
(
c
lient
*
c
);
void
rpushxCommand
(
redisC
lient
*
c
);
void
rpushxCommand
(
c
lient
*
c
);
void
linsertCommand
(
redisC
lient
*
c
);
void
linsertCommand
(
c
lient
*
c
);
void
lpopCommand
(
redisC
lient
*
c
);
void
lpopCommand
(
c
lient
*
c
);
void
rpopCommand
(
redisC
lient
*
c
);
void
rpopCommand
(
c
lient
*
c
);
void
llenCommand
(
redisC
lient
*
c
);
void
llenCommand
(
c
lient
*
c
);
void
lindexCommand
(
redisC
lient
*
c
);
void
lindexCommand
(
c
lient
*
c
);
void
lrangeCommand
(
redisC
lient
*
c
);
void
lrangeCommand
(
c
lient
*
c
);
void
ltrimCommand
(
redisC
lient
*
c
);
void
ltrimCommand
(
c
lient
*
c
);
void
typeCommand
(
redisC
lient
*
c
);
void
typeCommand
(
c
lient
*
c
);
void
lsetCommand
(
redisC
lient
*
c
);
void
lsetCommand
(
c
lient
*
c
);
void
saddCommand
(
redisC
lient
*
c
);
void
saddCommand
(
c
lient
*
c
);
void
sremCommand
(
redisC
lient
*
c
);
void
sremCommand
(
c
lient
*
c
);
void
smoveCommand
(
redisC
lient
*
c
);
void
smoveCommand
(
c
lient
*
c
);
void
sismemberCommand
(
redisC
lient
*
c
);
void
sismemberCommand
(
c
lient
*
c
);
void
scardCommand
(
redisC
lient
*
c
);
void
scardCommand
(
c
lient
*
c
);
void
spopCommand
(
redisC
lient
*
c
);
void
spopCommand
(
c
lient
*
c
);
void
srandmemberCommand
(
redisC
lient
*
c
);
void
srandmemberCommand
(
c
lient
*
c
);
void
sinterCommand
(
redisC
lient
*
c
);
void
sinterCommand
(
c
lient
*
c
);
void
sinterstoreCommand
(
redisC
lient
*
c
);
void
sinterstoreCommand
(
c
lient
*
c
);
void
sunionCommand
(
redisC
lient
*
c
);
void
sunionCommand
(
c
lient
*
c
);
void
sunionstoreCommand
(
redisC
lient
*
c
);
void
sunionstoreCommand
(
c
lient
*
c
);
void
sdiffCommand
(
redisC
lient
*
c
);
void
sdiffCommand
(
c
lient
*
c
);
void
sdiffstoreCommand
(
redisC
lient
*
c
);
void
sdiffstoreCommand
(
c
lient
*
c
);
void
sscanCommand
(
redisC
lient
*
c
);
void
sscanCommand
(
c
lient
*
c
);
void
syncCommand
(
redisC
lient
*
c
);
void
syncCommand
(
c
lient
*
c
);
void
flushdbCommand
(
redisC
lient
*
c
);
void
flushdbCommand
(
c
lient
*
c
);
void
flushallCommand
(
redisC
lient
*
c
);
void
flushallCommand
(
c
lient
*
c
);
void
sortCommand
(
redisC
lient
*
c
);
void
sortCommand
(
c
lient
*
c
);
void
lremCommand
(
redisC
lient
*
c
);
void
lremCommand
(
c
lient
*
c
);
void
rpoplpushCommand
(
redisC
lient
*
c
);
void
rpoplpushCommand
(
c
lient
*
c
);
void
infoCommand
(
redisC
lient
*
c
);
void
infoCommand
(
c
lient
*
c
);
void
mgetCommand
(
redisC
lient
*
c
);
void
mgetCommand
(
c
lient
*
c
);
void
monitorCommand
(
redisC
lient
*
c
);
void
monitorCommand
(
c
lient
*
c
);
void
expireCommand
(
redisC
lient
*
c
);
void
expireCommand
(
c
lient
*
c
);
void
expireatCommand
(
redisC
lient
*
c
);
void
expireatCommand
(
c
lient
*
c
);
void
pexpireCommand
(
redisC
lient
*
c
);
void
pexpireCommand
(
c
lient
*
c
);
void
pexpireatCommand
(
redisC
lient
*
c
);
void
pexpireatCommand
(
c
lient
*
c
);
void
getsetCommand
(
redisC
lient
*
c
);
void
getsetCommand
(
c
lient
*
c
);
void
ttlCommand
(
redisC
lient
*
c
);
void
ttlCommand
(
c
lient
*
c
);
void
pttlCommand
(
redisC
lient
*
c
);
void
pttlCommand
(
c
lient
*
c
);
void
persistCommand
(
redisC
lient
*
c
);
void
persistCommand
(
c
lient
*
c
);
void
slaveofCommand
(
redisC
lient
*
c
);
void
slaveofCommand
(
c
lient
*
c
);
void
roleCommand
(
redisC
lient
*
c
);
void
roleCommand
(
c
lient
*
c
);
void
debugCommand
(
redisC
lient
*
c
);
void
debugCommand
(
c
lient
*
c
);
void
msetCommand
(
redisC
lient
*
c
);
void
msetCommand
(
c
lient
*
c
);
void
msetnxCommand
(
redisC
lient
*
c
);
void
msetnxCommand
(
c
lient
*
c
);
void
zaddCommand
(
redisC
lient
*
c
);
void
zaddCommand
(
c
lient
*
c
);
void
zincrbyCommand
(
redisC
lient
*
c
);
void
zincrbyCommand
(
c
lient
*
c
);
void
zrangeCommand
(
redisC
lient
*
c
);
void
zrangeCommand
(
c
lient
*
c
);
void
zrangebyscoreCommand
(
redisC
lient
*
c
);
void
zrangebyscoreCommand
(
c
lient
*
c
);
void
zrevrangebyscoreCommand
(
redisC
lient
*
c
);
void
zrevrangebyscoreCommand
(
c
lient
*
c
);
void
zrangebylexCommand
(
redisC
lient
*
c
);
void
zrangebylexCommand
(
c
lient
*
c
);
void
zrevrangebylexCommand
(
redisC
lient
*
c
);
void
zrevrangebylexCommand
(
c
lient
*
c
);
void
zcountCommand
(
redisC
lient
*
c
);
void
zcountCommand
(
c
lient
*
c
);
void
zlexcountCommand
(
redisC
lient
*
c
);
void
zlexcountCommand
(
c
lient
*
c
);
void
zrevrangeCommand
(
redisC
lient
*
c
);
void
zrevrangeCommand
(
c
lient
*
c
);
void
zcardCommand
(
redisC
lient
*
c
);
void
zcardCommand
(
c
lient
*
c
);
void
zremCommand
(
redisC
lient
*
c
);
void
zremCommand
(
c
lient
*
c
);
void
zscoreCommand
(
redisC
lient
*
c
);
void
zscoreCommand
(
c
lient
*
c
);
void
zremrangebyscoreCommand
(
redisC
lient
*
c
);
void
zremrangebyscoreCommand
(
c
lient
*
c
);
void
zremrangebylexCommand
(
redisC
lient
*
c
);
void
zremrangebylexCommand
(
c
lient
*
c
);
void
multiCommand
(
redisC
lient
*
c
);
void
multiCommand
(
c
lient
*
c
);
void
execCommand
(
redisC
lient
*
c
);
void
execCommand
(
c
lient
*
c
);
void
discardCommand
(
redisC
lient
*
c
);
void
discardCommand
(
c
lient
*
c
);
void
blpopCommand
(
redisC
lient
*
c
);
void
blpopCommand
(
c
lient
*
c
);
void
brpopCommand
(
redisC
lient
*
c
);
void
brpopCommand
(
c
lient
*
c
);
void
brpoplpushCommand
(
redisC
lient
*
c
);
void
brpoplpushCommand
(
c
lient
*
c
);
void
appendCommand
(
redisC
lient
*
c
);
void
appendCommand
(
c
lient
*
c
);
void
strlenCommand
(
redisC
lient
*
c
);
void
strlenCommand
(
c
lient
*
c
);
void
zrankCommand
(
redisC
lient
*
c
);
void
zrankCommand
(
c
lient
*
c
);
void
zrevrankCommand
(
redisC
lient
*
c
);
void
zrevrankCommand
(
c
lient
*
c
);
void
hsetCommand
(
redisC
lient
*
c
);
void
hsetCommand
(
c
lient
*
c
);
void
hsetnxCommand
(
redisC
lient
*
c
);
void
hsetnxCommand
(
c
lient
*
c
);
void
hgetCommand
(
redisC
lient
*
c
);
void
hgetCommand
(
c
lient
*
c
);
void
hmsetCommand
(
redisC
lient
*
c
);
void
hmsetCommand
(
c
lient
*
c
);
void
hmgetCommand
(
redisC
lient
*
c
);
void
hmgetCommand
(
c
lient
*
c
);
void
hdelCommand
(
redisC
lient
*
c
);
void
hdelCommand
(
c
lient
*
c
);
void
hlenCommand
(
redisC
lient
*
c
);
void
hlenCommand
(
c
lient
*
c
);
void
hstrlenCommand
(
redisC
lient
*
c
);
void
hstrlenCommand
(
c
lient
*
c
);
void
zremrangebyrankCommand
(
redisC
lient
*
c
);
void
zremrangebyrankCommand
(
c
lient
*
c
);
void
zunionstoreCommand
(
redisC
lient
*
c
);
void
zunionstoreCommand
(
c
lient
*
c
);
void
zinterstoreCommand
(
redisC
lient
*
c
);
void
zinterstoreCommand
(
c
lient
*
c
);
void
zscanCommand
(
redisC
lient
*
c
);
void
zscanCommand
(
c
lient
*
c
);
void
hkeysCommand
(
redisC
lient
*
c
);
void
hkeysCommand
(
c
lient
*
c
);
void
hvalsCommand
(
redisC
lient
*
c
);
void
hvalsCommand
(
c
lient
*
c
);
void
hgetallCommand
(
redisC
lient
*
c
);
void
hgetallCommand
(
c
lient
*
c
);
void
hexistsCommand
(
redisC
lient
*
c
);
void
hexistsCommand
(
c
lient
*
c
);
void
hscanCommand
(
redisC
lient
*
c
);
void
hscanCommand
(
c
lient
*
c
);
void
configCommand
(
redisC
lient
*
c
);
void
configCommand
(
c
lient
*
c
);
void
hincrbyCommand
(
redisC
lient
*
c
);
void
hincrbyCommand
(
c
lient
*
c
);
void
hincrbyfloatCommand
(
redisC
lient
*
c
);
void
hincrbyfloatCommand
(
c
lient
*
c
);
void
subscribeCommand
(
redisC
lient
*
c
);
void
subscribeCommand
(
c
lient
*
c
);
void
unsubscribeCommand
(
redisC
lient
*
c
);
void
unsubscribeCommand
(
c
lient
*
c
);
void
psubscribeCommand
(
redisC
lient
*
c
);
void
psubscribeCommand
(
c
lient
*
c
);
void
punsubscribeCommand
(
redisC
lient
*
c
);
void
punsubscribeCommand
(
c
lient
*
c
);
void
publishCommand
(
redisC
lient
*
c
);
void
publishCommand
(
c
lient
*
c
);
void
pubsubCommand
(
redisC
lient
*
c
);
void
pubsubCommand
(
c
lient
*
c
);
void
watchCommand
(
redisC
lient
*
c
);
void
watchCommand
(
c
lient
*
c
);
void
unwatchCommand
(
redisC
lient
*
c
);
void
unwatchCommand
(
c
lient
*
c
);
void
clusterCommand
(
redisC
lient
*
c
);
void
clusterCommand
(
c
lient
*
c
);
void
restoreCommand
(
redisC
lient
*
c
);
void
restoreCommand
(
c
lient
*
c
);
void
migrateCommand
(
redisC
lient
*
c
);
void
migrateCommand
(
c
lient
*
c
);
void
askingCommand
(
redisC
lient
*
c
);
void
askingCommand
(
c
lient
*
c
);
void
readonlyCommand
(
redisC
lient
*
c
);
void
readonlyCommand
(
c
lient
*
c
);
void
readwriteCommand
(
redisC
lient
*
c
);
void
readwriteCommand
(
c
lient
*
c
);
void
dumpCommand
(
redisC
lient
*
c
);
void
dumpCommand
(
c
lient
*
c
);
void
objectCommand
(
redisC
lient
*
c
);
void
objectCommand
(
c
lient
*
c
);
void
clientCommand
(
redisC
lient
*
c
);
void
clientCommand
(
c
lient
*
c
);
void
evalCommand
(
redisC
lient
*
c
);
void
evalCommand
(
c
lient
*
c
);
void
evalShaCommand
(
redisC
lient
*
c
);
void
evalShaCommand
(
c
lient
*
c
);
void
scriptCommand
(
redisC
lient
*
c
);
void
scriptCommand
(
c
lient
*
c
);
void
timeCommand
(
redisC
lient
*
c
);
void
timeCommand
(
c
lient
*
c
);
void
bitopCommand
(
redisC
lient
*
c
);
void
bitopCommand
(
c
lient
*
c
);
void
bitcountCommand
(
redisC
lient
*
c
);
void
bitcountCommand
(
c
lient
*
c
);
void
bitposCommand
(
redisC
lient
*
c
);
void
bitposCommand
(
c
lient
*
c
);
void
replconfCommand
(
redisC
lient
*
c
);
void
replconfCommand
(
c
lient
*
c
);
void
waitCommand
(
redisC
lient
*
c
);
void
waitCommand
(
c
lient
*
c
);
void
geoencodeCommand
(
redisC
lient
*
c
);
void
geoencodeCommand
(
c
lient
*
c
);
void
geodecodeCommand
(
redisC
lient
*
c
);
void
geodecodeCommand
(
c
lient
*
c
);
void
georadiusByMemberCommand
(
redisC
lient
*
c
);
void
georadiusByMemberCommand
(
c
lient
*
c
);
void
georadiusCommand
(
redisC
lient
*
c
);
void
georadiusCommand
(
c
lient
*
c
);
void
geoaddCommand
(
redisC
lient
*
c
);
void
geoaddCommand
(
c
lient
*
c
);
void
geohashCommand
(
redisC
lient
*
c
);
void
geohashCommand
(
c
lient
*
c
);
void
geoposCommand
(
redisC
lient
*
c
);
void
geoposCommand
(
c
lient
*
c
);
void
geodistCommand
(
redisC
lient
*
c
);
void
geodistCommand
(
c
lient
*
c
);
void
pfselftestCommand
(
redisC
lient
*
c
);
void
pfselftestCommand
(
c
lient
*
c
);
void
pfaddCommand
(
redisC
lient
*
c
);
void
pfaddCommand
(
c
lient
*
c
);
void
pfcountCommand
(
redisC
lient
*
c
);
void
pfcountCommand
(
c
lient
*
c
);
void
pfmergeCommand
(
redisC
lient
*
c
);
void
pfmergeCommand
(
c
lient
*
c
);
void
pfdebugCommand
(
redisC
lient
*
c
);
void
pfdebugCommand
(
c
lient
*
c
);
void
latencyCommand
(
redisC
lient
*
c
);
void
latencyCommand
(
c
lient
*
c
);
#if defined(__GNUC__)
#if defined(__GNUC__)
void
*
calloc
(
size_t
count
,
size_t
size
)
__attribute__
((
deprecated
));
void
*
calloc
(
size_t
count
,
size_t
size
)
__attribute__
((
deprecated
));
...
@@ -1581,7 +1581,7 @@ void *realloc(void *ptr, size_t size) __attribute__ ((deprecated));
...
@@ -1581,7 +1581,7 @@ void *realloc(void *ptr, size_t size) __attribute__ ((deprecated));
#endif
#endif
/* Debugging stuff */
/* Debugging stuff */
void
_redisAssertWithInfo
(
redisC
lient
*
c
,
robj
*
o
,
char
*
estr
,
char
*
file
,
int
line
);
void
_redisAssertWithInfo
(
c
lient
*
c
,
robj
*
o
,
char
*
estr
,
char
*
file
,
int
line
);
void
_redisAssert
(
char
*
estr
,
char
*
file
,
int
line
);
void
_redisAssert
(
char
*
estr
,
char
*
file
,
int
line
);
void
_redisPanic
(
char
*
msg
,
char
*
file
,
int
line
);
void
_redisPanic
(
char
*
msg
,
char
*
file
,
int
line
);
void
bugReportStart
(
void
);
void
bugReportStart
(
void
);
...
...
src/slowlog.c
View file @
554bd0e7
...
@@ -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
(
redisC
lient
*
c
)
{
void
slowlogCommand
(
c
lient
*
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
);
...
...
src/slowlog.h
View file @
554bd0e7
...
@@ -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
(
redisC
lient
*
c
);
void
slowlogCommand
(
c
lient
*
c
);
src/sort.c
View file @
554bd0e7
...
@@ -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
(
redisC
lient
*
c
)
{
void
sortCommand
(
c
lient
*
c
)
{
list
*
operations
;
list
*
operations
;
unsigned
int
outputlen
=
0
;
unsigned
int
outputlen
=
0
;
int
desc
=
0
,
alpha
=
0
;
int
desc
=
0
,
alpha
=
0
;
...
...
src/t_hash.c
View file @
554bd0e7
...
@@ -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
(
redisC
lient
*
c
,
robj
*
key
)
{
robj
*
hashTypeLookupWriteOrCreate
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hsetCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hsetnxCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hmsetCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hincrbyCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hincrbyfloatCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
robj
*
o
,
robj
*
field
)
{
static
void
addHashFieldToReply
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hgetCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hmgetCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hdelCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hlenCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hstrlenCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
hashTypeIterator
*
hi
,
int
what
)
{
static
void
addHashIteratorCursorToReply
(
c
lient
*
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
(
redisC
lient
*
c
,
int
flags
)
{
void
genericHgetallCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hkeysCommand
(
c
lient
*
c
)
{
genericHgetallCommand
(
c
,
REDIS_HASH_KEY
);
genericHgetallCommand
(
c
,
REDIS_HASH_KEY
);
}
}
void
hvalsCommand
(
redisC
lient
*
c
)
{
void
hvalsCommand
(
c
lient
*
c
)
{
genericHgetallCommand
(
c
,
REDIS_HASH_VALUE
);
genericHgetallCommand
(
c
,
REDIS_HASH_VALUE
);
}
}
void
hgetallCommand
(
redisC
lient
*
c
)
{
void
hgetallCommand
(
c
lient
*
c
)
{
genericHgetallCommand
(
c
,
REDIS_HASH_KEY
|
REDIS_HASH_VALUE
);
genericHgetallCommand
(
c
,
REDIS_HASH_KEY
|
REDIS_HASH_VALUE
);
}
}
void
hexistsCommand
(
redisC
lient
*
c
)
{
void
hexistsCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
hscanCommand
(
c
lient
*
c
)
{
robj
*
o
;
robj
*
o
;
unsigned
long
cursor
;
unsigned
long
cursor
;
...
...
src/t_list.c
View file @
554bd0e7
...
@@ -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
(
redisC
lient
*
c
,
int
where
)
{
void
pushGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
lpushCommand
(
c
lient
*
c
)
{
pushGenericCommand
(
c
,
REDIS_HEAD
);
pushGenericCommand
(
c
,
REDIS_HEAD
);
}
}
void
rpushCommand
(
redisC
lient
*
c
)
{
void
rpushCommand
(
c
lient
*
c
)
{
pushGenericCommand
(
c
,
REDIS_TAIL
);
pushGenericCommand
(
c
,
REDIS_TAIL
);
}
}
void
pushxGenericCommand
(
redisC
lient
*
c
,
robj
*
refval
,
robj
*
val
,
int
where
)
{
void
pushxGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
lpushxCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
rpushxCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
linsertCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
llenCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
lindexCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
lsetCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
int
where
)
{
void
popGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
lpopCommand
(
c
lient
*
c
)
{
popGenericCommand
(
c
,
REDIS_HEAD
);
popGenericCommand
(
c
,
REDIS_HEAD
);
}
}
void
rpopCommand
(
redisC
lient
*
c
)
{
void
rpopCommand
(
c
lient
*
c
)
{
popGenericCommand
(
c
,
REDIS_TAIL
);
popGenericCommand
(
c
,
REDIS_TAIL
);
}
}
void
lrangeCommand
(
redisC
lient
*
c
)
{
void
lrangeCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
ltrimCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
lremCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
robj
*
dstkey
,
robj
*
dstobj
,
robj
*
value
)
{
void
rpoplpushHandlePush
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
rpoplpushCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
robj
**
keys
,
int
numkeys
,
mstime_t
timeout
,
robj
*
target
)
{
void
blockForKeys
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
unblockClientWaitingData
(
c
lient
*
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
(
redisC
lient
*
receiver
,
robj
*
key
,
robj
*
dstkey
,
redisDb
*
db
,
robj
*
value
,
int
where
)
int
serveClientBlockedOnList
(
c
lient
*
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
);
redisC
lient
*
receiver
=
clientnode
->
value
;
c
lient
*
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
(
redisC
lient
*
c
,
int
where
)
{
void
blockingPopGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
blpopCommand
(
c
lient
*
c
)
{
blockingPopGenericCommand
(
c
,
REDIS_HEAD
);
blockingPopGenericCommand
(
c
,
REDIS_HEAD
);
}
}
void
brpopCommand
(
redisC
lient
*
c
)
{
void
brpopCommand
(
c
lient
*
c
)
{
blockingPopGenericCommand
(
c
,
REDIS_TAIL
);
blockingPopGenericCommand
(
c
,
REDIS_TAIL
);
}
}
void
brpoplpushCommand
(
redisC
lient
*
c
)
{
void
brpoplpushCommand
(
c
lient
*
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
)
...
...
src/t_set.c
View file @
554bd0e7
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
* Set Commands
* Set Commands
*----------------------------------------------------------------------------*/
*----------------------------------------------------------------------------*/
void
sunionDiffGenericCommand
(
redisC
lient
*
c
,
robj
**
setkeys
,
int
setnum
,
void
sunionDiffGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
saddCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
sremCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
smoveCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
sismemberCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
scardCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
spopWithCountCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
spopCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
srandmemberWithCountCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
srandmemberCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
robj
**
setkeys
,
void
sinterGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
sinterCommand
(
c
lient
*
c
)
{
sinterGenericCommand
(
c
,
c
->
argv
+
1
,
c
->
argc
-
1
,
NULL
);
sinterGenericCommand
(
c
,
c
->
argv
+
1
,
c
->
argc
-
1
,
NULL
);
}
}
void
sinterstoreCommand
(
redisC
lient
*
c
)
{
void
sinterstoreCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
robj
**
setkeys
,
int
setnum
,
void
sunionDiffGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
sunionCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
sunionstoreCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
sdiffCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
sdiffstoreCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
sscanCommand
(
c
lient
*
c
)
{
robj
*
set
;
robj
*
set
;
unsigned
long
cursor
;
unsigned
long
cursor
;
...
...
src/t_string.c
View file @
554bd0e7
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
* String Commands
* String Commands
*----------------------------------------------------------------------------*/
*----------------------------------------------------------------------------*/
static
int
checkStringLength
(
redisC
lient
*
c
,
long
long
size
)
{
static
int
checkStringLength
(
c
lient
*
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
(
redisC
lient
*
c
,
int
flags
,
robj
*
key
,
robj
*
val
,
robj
*
expire
,
int
unit
,
robj
*
ok_reply
,
robj
*
abort_reply
)
{
void
setGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
setCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
setnxCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
setexCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
psetexCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
int
getGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
getCommand
(
c
lient
*
c
)
{
getGenericCommand
(
c
);
getGenericCommand
(
c
);
}
}
void
getsetCommand
(
redisC
lient
*
c
)
{
void
getsetCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
setrangeCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
getrangeCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
mgetCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
int
nx
)
{
void
msetGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
msetCommand
(
c
lient
*
c
)
{
msetGenericCommand
(
c
,
0
);
msetGenericCommand
(
c
,
0
);
}
}
void
msetnxCommand
(
redisC
lient
*
c
)
{
void
msetnxCommand
(
c
lient
*
c
)
{
msetGenericCommand
(
c
,
1
);
msetGenericCommand
(
c
,
1
);
}
}
void
incrDecrCommand
(
redisC
lient
*
c
,
long
long
incr
)
{
void
incrDecrCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
incrCommand
(
c
lient
*
c
)
{
incrDecrCommand
(
c
,
1
);
incrDecrCommand
(
c
,
1
);
}
}
void
decrCommand
(
redisC
lient
*
c
)
{
void
decrCommand
(
c
lient
*
c
)
{
incrDecrCommand
(
c
,
-
1
);
incrDecrCommand
(
c
,
-
1
);
}
}
void
incrbyCommand
(
redisC
lient
*
c
)
{
void
incrbyCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
decrbyCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
incrbyfloatCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
appendCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
strlenCommand
(
c
lient
*
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
;
...
...
src/t_zset.c
View file @
554bd0e7
...
@@ -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
(
redisC
lient
*
c
,
int
flags
)
{
void
zaddGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zaddCommand
(
c
lient
*
c
)
{
zaddGenericCommand
(
c
,
ZADD_NONE
);
zaddGenericCommand
(
c
,
ZADD_NONE
);
}
}
void
zincrbyCommand
(
redisC
lient
*
c
)
{
void
zincrbyCommand
(
c
lient
*
c
)
{
zaddGenericCommand
(
c
,
ZADD_INCR
);
zaddGenericCommand
(
c
,
ZADD_INCR
);
}
}
void
zremCommand
(
redisC
lient
*
c
)
{
void
zremCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
int
rangetype
)
{
void
zremrangeGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zremrangebyrankCommand
(
c
lient
*
c
)
{
zremrangeGenericCommand
(
c
,
ZRANGE_RANK
);
zremrangeGenericCommand
(
c
,
ZRANGE_RANK
);
}
}
void
zremrangebyscoreCommand
(
redisC
lient
*
c
)
{
void
zremrangebyscoreCommand
(
c
lient
*
c
)
{
zremrangeGenericCommand
(
c
,
ZRANGE_SCORE
);
zremrangeGenericCommand
(
c
,
ZRANGE_SCORE
);
}
}
void
zremrangebylexCommand
(
redisC
lient
*
c
)
{
void
zremrangebylexCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
robj
*
dstkey
,
int
op
)
{
void
zunionInterGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zunionstoreCommand
(
c
lient
*
c
)
{
zunionInterGenericCommand
(
c
,
c
->
argv
[
1
],
REDIS_OP_UNION
);
zunionInterGenericCommand
(
c
,
c
->
argv
[
1
],
REDIS_OP_UNION
);
}
}
void
zinterstoreCommand
(
redisC
lient
*
c
)
{
void
zinterstoreCommand
(
c
lient
*
c
)
{
zunionInterGenericCommand
(
c
,
c
->
argv
[
1
],
REDIS_OP_INTER
);
zunionInterGenericCommand
(
c
,
c
->
argv
[
1
],
REDIS_OP_INTER
);
}
}
void
zrangeGenericCommand
(
redisC
lient
*
c
,
int
reverse
)
{
void
zrangeGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zrangeCommand
(
c
lient
*
c
)
{
zrangeGenericCommand
(
c
,
0
);
zrangeGenericCommand
(
c
,
0
);
}
}
void
zrevrangeCommand
(
redisC
lient
*
c
)
{
void
zrevrangeCommand
(
c
lient
*
c
)
{
zrangeGenericCommand
(
c
,
1
);
zrangeGenericCommand
(
c
,
1
);
}
}
/* This command implements ZRANGEBYSCORE, ZREVRANGEBYSCORE. */
/* This command implements ZRANGEBYSCORE, ZREVRANGEBYSCORE. */
void
genericZrangebyscoreCommand
(
redisC
lient
*
c
,
int
reverse
)
{
void
genericZrangebyscoreCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zrangebyscoreCommand
(
c
lient
*
c
)
{
genericZrangebyscoreCommand
(
c
,
0
);
genericZrangebyscoreCommand
(
c
,
0
);
}
}
void
zrevrangebyscoreCommand
(
redisC
lient
*
c
)
{
void
zrevrangebyscoreCommand
(
c
lient
*
c
)
{
genericZrangebyscoreCommand
(
c
,
1
);
genericZrangebyscoreCommand
(
c
,
1
);
}
}
void
zcountCommand
(
redisC
lient
*
c
)
{
void
zcountCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zlexcountCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
int
reverse
)
{
void
genericZrangebylexCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zrangebylexCommand
(
c
lient
*
c
)
{
genericZrangebylexCommand
(
c
,
0
);
genericZrangebylexCommand
(
c
,
0
);
}
}
void
zrevrangebylexCommand
(
redisC
lient
*
c
)
{
void
zrevrangebylexCommand
(
c
lient
*
c
)
{
genericZrangebylexCommand
(
c
,
1
);
genericZrangebylexCommand
(
c
,
1
);
}
}
void
zcardCommand
(
redisC
lient
*
c
)
{
void
zcardCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zscoreCommand
(
c
lient
*
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
(
redisC
lient
*
c
,
int
reverse
)
{
void
zrankGenericCommand
(
c
lient
*
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
(
redisC
lient
*
c
)
{
void
zrankCommand
(
c
lient
*
c
)
{
zrankGenericCommand
(
c
,
0
);
zrankGenericCommand
(
c
,
0
);
}
}
void
zrevrankCommand
(
redisC
lient
*
c
)
{
void
zrevrankCommand
(
c
lient
*
c
)
{
zrankGenericCommand
(
c
,
1
);
zrankGenericCommand
(
c
,
1
);
}
}
void
zscanCommand
(
redisC
lient
*
c
)
{
void
zscanCommand
(
c
lient
*
c
)
{
robj
*
o
;
robj
*
o
;
unsigned
long
cursor
;
unsigned
long
cursor
;
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment