Write multi bulk count in the format: "* \r\n". */
| 408 | |
| 409 | /* Write multi bulk count in the format: "*<count>\r\n". */ |
| 410 | size_t rioWriteBulkCount(rio *r, char prefix, long count) { |
| 411 | char cbuf[128]; |
| 412 | int clen; |
| 413 | |
| 414 | cbuf[0] = prefix; |
| 415 | clen = 1+ll2string(cbuf+1,sizeof(cbuf)-1,count); |
| 416 | cbuf[clen++] = '\r'; |
| 417 | cbuf[clen++] = '\n'; |
| 418 | if (rioWrite(r,cbuf,clen) == 0) return 0; |
| 419 | return clen; |
| 420 | } |
| 421 | |
| 422 | /* Write binary-safe string in the format: "$<count>\r\n<payload>\r\n". */ |
| 423 | size_t rioWriteBulkString(rio *r, const char *buf, size_t len) { |
no test coverage detected