+/* Write a multi bulk count in the form "*<count>\r\n" */
+int fwriteBulkCount(FILE *fp, char prefix, int count) {
+ char cbuf[128];
+ int clen;
+
+ cbuf[0] = prefix;
+ clen = 1+ll2string(cbuf+1,sizeof(cbuf)-1,count);
+ cbuf[clen++] = '\r';
+ cbuf[clen++] = '\n';
+ if (fwrite(cbuf,clen,1,fp) == 0) return 0;
+ return 1;
+}
+