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

Function RM_StringToStreamID

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

Convert the string into a stream ID, storing it at `*id`. * Returns REDISMODULE_OK on success and returns REDISMODULE_ERR if the string * is not a valid string representation of a stream ID. The special IDs "+" and * "-" are allowed. */

Source from the content-addressed store, hash-verified

1385 * "-" are allowed.
1386 */
1387int RM_StringToStreamID(const RedisModuleString *str, RedisModuleStreamID *id) {
1388 streamID streamid;
1389 if (streamParseID(str, &streamid) == C_OK) {
1390 id->ms = streamid.ms;
1391 id->seq = streamid.seq;
1392 return REDISMODULE_OK;
1393 } else {
1394 return REDISMODULE_ERR;
1395 }
1396}
1397
1398/* Compare two string objects, returning -1, 0 or 1 respectively if
1399 * a < b, a == b, a > b. Strings are compared byte by byte as two

Callers

nothing calls this directly

Calls 1

streamParseIDFunction · 0.85

Tested by

no test coverage detected