MCPcopy Create free account
hub / github.com/F-Stack/f-stack / addReplyHumanLongDouble

Function addReplyHumanLongDouble

app/redis-6.2.6/src/networking.c:709–721  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

707 * of the double instead of exposing the crude behavior of doubles to the
708 * dear user. */
709void addReplyHumanLongDouble(client *c, long double d) {
710 if (c->resp == 2) {
711 robj *o = createStringObjectFromLongDouble(d,1);
712 addReplyBulk(c,o);
713 decrRefCount(o);
714 } else {
715 char buf[MAX_LONG_DOUBLE_CHARS];
716 int len = ld2string(buf,sizeof(buf),d,LD_STR_HUMAN);
717 addReplyProto(c,",",1);
718 addReplyProto(c,buf,len);
719 addReplyProto(c,"\r\n",2);
720 }
721}
722
723/* Add a long long as integer reply or bulk len / multi bulk count.
724 * Basically this is used to output <prefix><long long><crlf>. */

Callers 3

georadiusGenericFunction · 0.85
geoposCommandFunction · 0.85
RM_ReplyWithLongDoubleFunction · 0.85

Calls 5

addReplyBulkFunction · 0.85
decrRefCountFunction · 0.85
ld2stringFunction · 0.85
addReplyProtoFunction · 0.85

Tested by

no test coverage detected