]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pkt-line.h: move comment closer to the associated code
authorMatheus Tavares <matheus.bernardino@usp.br>
Fri, 22 Jul 2022 11:10:05 +0000 (08:10 -0300)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Jul 2022 21:06:05 +0000 (14:06 -0700)
ec9a37d ("pkt-line.[ch]: remove unused packet_read_line_buf()",
2021-10-14) removed the "src_buffer" and "src_len" parameters from
packet_read(), only leaving them at packet_read_with_status(). Let's
also update the function documentation by moving the comment about these
parameters from the former to the latter.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pkt-line.h

index 6d2a63db2387fbc37287988f93b4d927422008e5..1f623de60a856944b8c1b3e844228e36c8c07162 100644 (file)
@@ -49,14 +49,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 +96,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,