Skip to content

Commit

Permalink
strbuf: improve strbuf_get*line documentation
Browse files Browse the repository at this point in the history
Clarify strbuf_getline() documentation, and add the missing documentation
for strbuf_getwholeline() and strbuf_getwholeline_fd().

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Feb 23, 2012
1 parent bc2fed4 commit 1c5f93b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Documentation/technical/api-strbuf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,24 @@ same behaviour as well.

`strbuf_getline`::

Read a line from a FILE* pointer. The second argument specifies the line
Read a line from a FILE *, overwriting the existing contents
of the strbuf. The second argument specifies the line
terminator character, typically `'\n'`.
Reading stops after the terminator or at EOF. The terminator
is removed from the buffer before returning. Returns 0 unless
there was nothing left before EOF, in which case it returns `EOF`.

`strbuf_getwholeline`::

Like `strbuf_getline`, but keeps the trailing terminator (if
any) in the buffer.

`strbuf_getwholeline_fd`::

Like `strbuf_getwholeline`, but operates on a file descriptor.
It reads one character at a time, so it is very slow. Do not
use it unless you need the correct position in the file
descriptor.

`stripspace`::

Expand Down

0 comments on commit 1c5f93b

Please sign in to comment.