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

Function getLongLongFromObject

app/redis-6.2.6/src/object.c:682–699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680}
681
682int getLongLongFromObject(robj *o, long long *target) {
683 long long value;
684
685 if (o == NULL) {
686 value = 0;
687 } else {
688 serverAssertWithInfo(NULL,o,o->type == OBJ_STRING);
689 if (sdsEncodedObject(o)) {
690 if (string2ll(o->ptr,sdslen(o->ptr),&value) == 0) return C_ERR;
691 } else if (o->encoding == OBJ_ENCODING_INT) {
692 value = (long)o->ptr;
693 } else {
694 serverPanic("Unknown string encoding");
695 }
696 }
697 if (target) *target = value;
698 return C_OK;
699}
700
701int getLongLongFromObjectOrReply(client *c, robj *o, long long *target, const char *msg) {
702 long long value;

Callers 6

sentinelConfigSetCommandFunction · 0.85
sentinelSetCommandFunction · 0.85
replconfCommandFunction · 0.85
getSlotOrReplyFunction · 0.85
clusterCommandFunction · 0.85

Calls 2

sdslenFunction · 0.85
string2llFunction · 0.70

Tested by

no test coverage detected