MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / getLongFromObjectOrReply

Function getLongFromObjectOrReply

src/object.cpp:799–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797}
798
799int getLongFromObjectOrReply(client *c, robj *o, long *target, const char *msg) {
800 long long value;
801
802 if (getLongLongFromObjectOrReply(c, o, &value, msg) != C_OK) return C_ERR;
803 if (value < LONG_MIN || value > LONG_MAX) {
804 if (msg != NULL) {
805 addReplyError(c,(char*)msg);
806 } else {
807 addReplyError(c,"value is out of range");
808 }
809 return C_ERR;
810 }
811 *target = value;
812 return C_OK;
813}
814
815int getRangeLongFromObjectOrReply(client *c, robj *o, long min, long max, long *target, const char *msg) {
816 if (getLongFromObjectOrReply(c, o, target, msg) != C_OK) return C_ERR;

Callers 15

scanGenericCommandFunction · 0.85
lolwutCommandFunction · 0.85
migrateCommandFunction · 0.85
sortCommandFunction · 0.85
lolwut5CommandFunction · 0.85
replconfCommandFunction · 0.85
replicaofCommandFunction · 0.85
waitCommandFunction · 0.85
failoverCommandFunction · 0.85
zremrangeGenericCommandFunction · 0.85

Calls 2

addReplyErrorFunction · 0.85

Tested by

no test coverage detected