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

Function rioWriteBulkCount

src/rio.cpp:454–464  ·  view source on GitHub ↗

Write multi bulk count in the format: "* \r\n". */

Source from the content-addressed store, hash-verified

452
453/* Write multi bulk count in the format: "*<count>\r\n". */
454size_t rioWriteBulkCount(rio *r, char prefix, long count) {
455 char cbuf[128];
456 int clen;
457
458 cbuf[0] = prefix;
459 clen = 1+ll2string(cbuf+1,sizeof(cbuf)-1,count);
460 cbuf[clen++] = '\r';
461 cbuf[clen++] = '\n';
462 if (rioWrite(r,cbuf,clen) == 0) return 0;
463 return clen;
464}
465
466/* Write binary-safe string in the format: "$<count>\r\n<payload>\r\n". */
467size_t rioWriteBulkString(rio *r, const char *buf, size_t len) {

Callers 10

migrateCommandFunction · 0.85
RM_EmitAOFFunction · 0.85
rioWriteBulkStringFunction · 0.85
rewriteListObjectFunction · 0.85
rewriteSetObjectFunction · 0.85
rewriteSortedSetObjectFunction · 0.85
rewriteHashObjectFunction · 0.85
rewriteStreamObjectFunction · 0.85

Calls 2

ll2stringFunction · 0.85
rioWriteFunction · 0.85

Tested by

no test coverage detected