Write multi bulk count in the format: "* \r\n". */
| 452 | |
| 453 | /* Write multi bulk count in the format: "*<count>\r\n". */ |
| 454 | size_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". */ |
| 467 | size_t rioWriteBulkString(rio *r, const char *buf, size_t len) { |
no test coverage detected