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

Function streamDecodeID

src/t_stream.cpp:381–386  ·  view source on GitHub ↗

This is the reverse of streamEncodeID(): the decoded ID will be stored * in the 'id' structure passed by reference. The buffer 'buf' must point * to a 128 bit big-endian encoded ID. */

Source from the content-addressed store, hash-verified

379 * in the 'id' structure passed by reference. The buffer 'buf' must point
380 * to a 128 bit big-endian encoded ID. */
381void streamDecodeID(void *buf, streamID *id) {
382 uint64_t e[2];
383 memcpy(e,buf,sizeof(e));
384 id->ms = ntohu64(e[0]);
385 id->seq = ntohu64(e[1]);
386}
387
388/* Compare two stream IDs. Return -1 if a < b, 0 if a == b, 1 if a > b. */
389int streamCompareID(streamID *a, streamID *b) {

Callers 10

streamGetEdgeIDFunction · 0.85
streamAppendItemFunction · 0.85
streamTrimFunction · 0.85
streamIteratorGetIDFunction · 0.85
xpendingCommandFunction · 0.85
xautoclaimCommandFunction · 0.85
xinfoReplyWithStreamInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected