diff options
Diffstat (limited to 'pkt-line.h')
| -rw-r--r-- | pkt-line.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/pkt-line.h b/pkt-line.h index 6d2a63db23..79c538b99e 100644 --- a/pkt-line.h +++ b/pkt-line.h @@ -32,7 +32,13 @@ void packet_buf_write(struct strbuf *buf, const char *fmt, ...) __attribute__((f int packet_flush_gently(int fd); int packet_write_fmt_gently(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3))); int write_packetized_from_fd_no_flush(int fd_in, int fd_out); -int write_packetized_from_buf_no_flush(const char *src_in, size_t len, int fd_out); +int write_packetized_from_buf_no_flush_count(const char *src_in, size_t len, + int fd_out, int *packet_counter); +static inline int write_packetized_from_buf_no_flush(const char *src_in, + size_t len, int fd_out) +{ + return write_packetized_from_buf_no_flush_count(src_in, len, fd_out, NULL); +} /* * Stdio versions of packet_write functions. When mixing these with fd @@ -49,14 +55,6 @@ void packet_fflush(FILE *f); * Read a packetized line into the buffer, which must be at least size bytes * long. The return value specifies the number of bytes read into the buffer. * - * If src_buffer and *src_buffer are not NULL, it should point to a buffer - * containing the packet data to parse, of at least *src_len bytes. After the - * function returns, src_buf will be incremented and src_len decremented by the - * number of bytes consumed. - * - * If src_buffer (or *src_buffer) is NULL, then data is read from the - * descriptor "fd". - * * If options does not contain PACKET_READ_GENTLE_ON_EOF, we will die under any * of the following conditions: * @@ -104,6 +102,14 @@ int packet_length(const char lenbuf_hex[4]); * returns an 'enum packet_read_status' which indicates the status of the read. * The number of bytes read will be assigned to *pktlen if the status of the * read was 'PACKET_READ_NORMAL'. + * + * If src_buffer and *src_buffer are not NULL, it should point to a buffer + * containing the packet data to parse, of at least *src_len bytes. After the + * function returns, src_buf will be incremented and src_len decremented by the + * number of bytes consumed. + * + * If src_buffer (or *src_buffer) is NULL, then data is read from the + * descriptor "fd". */ enum packet_read_status { PACKET_READ_EOF, |
