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
b73c7af0
Commit
b73c7af0
authored
Apr 14, 2016
by
antirez
Browse files
zsetAdd() API exposed into server.h.
parent
b1f181a7
Changes
2
Show whitespace changes
Inline
Side-by-side
src/server.h
View file @
b73c7af0
...
@@ -1288,6 +1288,21 @@ unsigned long aofRewriteBufferSize(void);
...
@@ -1288,6 +1288,21 @@ unsigned long aofRewriteBufferSize(void);
/* Sorted sets data type */
/* Sorted sets data type */
/* Input flags. */
#define ZADD_NONE 0
#define ZADD_INCR (1<<0)
/* Increment the score instead of setting it. */
#define ZADD_NX (1<<1)
/* Don't touch elements not already existing. */
#define ZADD_XX (1<<2)
/* Only touch elements already exisitng. */
/* Output flags. */
#define ZADD_NOP (1<<3)
/* Operation not performed because of conditionals.*/
#define ZADD_NAN (1<<4)
/* Only touch elements already exisitng. */
#define ZADD_ADDED (1<<5)
/* The element was new and was added. */
#define ZADD_UPDATED (1<<6)
/* The element already existed, score updated. */
/* Flags only used by the ZADD command but not by zsetAdd() API: */
#define ZADD_CH (1<<16)
/* Return num of elements added or updated. */
/* Struct to hold a inclusive/exclusive range spec by score comparison. */
/* Struct to hold a inclusive/exclusive range spec by score comparison. */
typedef
struct
{
typedef
struct
{
double
min
,
max
;
double
min
,
max
;
...
@@ -1315,6 +1330,7 @@ void zsetConvert(robj *zobj, int encoding);
...
@@ -1315,6 +1330,7 @@ void zsetConvert(robj *zobj, int encoding);
void
zsetConvertToZiplistIfNeeded
(
robj
*
zobj
,
size_t
maxelelen
);
void
zsetConvertToZiplistIfNeeded
(
robj
*
zobj
,
size_t
maxelelen
);
int
zsetScore
(
robj
*
zobj
,
sds
member
,
double
*
score
);
int
zsetScore
(
robj
*
zobj
,
sds
member
,
double
*
score
);
unsigned
long
zslGetRank
(
zskiplist
*
zsl
,
double
score
,
sds
o
);
unsigned
long
zslGetRank
(
zskiplist
*
zsl
,
double
score
,
sds
o
);
int
zsetAdd
(
robj
*
zobj
,
double
score
,
sds
ele
,
int
*
flags
,
double
*
newscore
);
/* Core functions */
/* Core functions */
int
freeMemoryIfNeeded
(
void
);
int
freeMemoryIfNeeded
(
void
);
...
...
src/t_zset.c
View file @
b73c7af0
...
@@ -1215,21 +1215,6 @@ int zsetScore(robj *zobj, sds member, double *score) {
...
@@ -1215,21 +1215,6 @@ int zsetScore(robj *zobj, sds member, double *score) {
return
C_OK
;
return
C_OK
;
}
}
/* Input flags. */
#define ZADD_NONE 0
#define ZADD_INCR (1<<0)
/* Increment the score instead of setting it. */
#define ZADD_NX (1<<1)
/* Don't touch elements not already existing. */
#define ZADD_XX (1<<2)
/* Only touch elements already exisitng. */
/* Output flags. */
#define ZADD_NOP (1<<3)
/* Operation not performed because of conditionals.*/
#define ZADD_NAN (1<<4)
/* Only touch elements already exisitng. */
#define ZADD_ADDED (1<<5)
/* The element was new and was added. */
#define ZADD_UPDATED (1<<6)
/* The element already existed, score updated. */
/* Flags only used by the ZADD command but now by zsetAdd() API: */
#define ZADD_CH (1<<16)
/* Return num of elements added or updated. */
/* Add a new element or update the score of an existing element in a sorted
/* Add a new element or update the score of an existing element in a sorted
* set, regardless of its encoding.
* set, regardless of its encoding.
*
*
...
...
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