diff options
author | Thomas Rast <trast@student.ethz.ch> | 2012-02-23 10:42:21 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-23 13:52:11 -0800 |
commit | 1c5f93b9a69f4c1c3d09853243562b9ae3bf79a6 (patch) | |
tree | e639aa563361b2a58018dbab3cb72779768c4923 | |
parent | bc2fed496baa54ae99dede7da23dec938adbf0eb (diff) | |
download | git-1c5f93b9a69f4c1c3d09853243562b9ae3bf79a6.tar.gz |
strbuf: improve strbuf_get*line documentation
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>
-rw-r--r-- | Documentation/technical/api-strbuf.txt | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt index afe2759951..95a8bf3846 100644 --- a/Documentation/technical/api-strbuf.txt +++ b/Documentation/technical/api-strbuf.txt @@ -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`:: |