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

Function RM_ServerInfoGetFieldUnsigned

app/redis-6.2.6/src/module.c:7176–7189  ·  view source on GitHub ↗

Get the value of a field from data collected with RM_GetServerInfo(). If the * field is not found, or is not numerical or out of range, return value will be * 0, and the optional out_err argument will be set to REDISMODULE_ERR. */

Source from the content-addressed store, hash-verified

7174 * field is not found, or is not numerical or out of range, return value will be
7175 * 0, and the optional out_err argument will be set to REDISMODULE_ERR. */
7176unsigned long long RM_ServerInfoGetFieldUnsigned(RedisModuleServerInfoData *data, const char* field, int *out_err) {
7177 unsigned long long ll;
7178 sds val = raxFind(data->rax, (unsigned char *)field, strlen(field));
7179 if (val == raxNotFound) {
7180 if (out_err) *out_err = REDISMODULE_ERR;
7181 return 0;
7182 }
7183 if (!string2ull(val,&ll)) {
7184 if (out_err) *out_err = REDISMODULE_ERR;
7185 return 0;
7186 }
7187 if (out_err) *out_err = REDISMODULE_OK;
7188 return ll;
7189}
7190
7191/* Get the value of a field from data collected with RM_GetServerInfo(). If the
7192 * field is not found, or is not a double, return value will be 0, and the

Callers

nothing calls this directly

Calls 2

raxFindFunction · 0.85
string2ullFunction · 0.85

Tested by

no test coverage detected