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
79e553a5
Commit
79e553a5
authored
Feb 18, 2016
by
antirez
Browse files
addReplyHumanLongDouble() API added.
Send a long double or double as a bulk reply, in a human friendly format.
parent
158d1e2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
79e553a5
...
...
@@ -479,6 +479,15 @@ void addReplyDouble(client *c, double d) {
}
}
/* Add a long double as a bulk reply, but uses a human readable formatting
* of the double instead of exposing the crude behavior of doubles to the
* dear user. */
void
addReplyHumanLongDouble
(
client
*
c
,
long
double
d
)
{
robj
*
o
=
createStringObjectFromLongDouble
(
d
,
1
);
addReplyBulk
(
c
,
o
);
decrRefCount
(
o
);
}
/* Add a long long as integer reply or bulk len / multi bulk count.
* Basically this is used to output <prefix><long long><crlf>. */
void
addReplyLongLongWithPrefix
(
client
*
c
,
long
long
ll
,
char
prefix
)
{
...
...
src/server.h
View file @
79e553a5
...
...
@@ -1104,6 +1104,7 @@ void addReplyBulkSds(client *c, sds s);
void
addReplyError
(
client
*
c
,
const
char
*
err
);
void
addReplyStatus
(
client
*
c
,
const
char
*
status
);
void
addReplyDouble
(
client
*
c
,
double
d
);
void
addReplyHumanLongDouble
(
client
*
c
,
long
double
d
);
void
addReplyLongLong
(
client
*
c
,
long
long
ll
);
void
addReplyMultiBulkLen
(
client
*
c
,
long
length
);
void
copyClientOutputBuffer
(
client
*
dst
,
client
*
src
);
...
...
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