diff options
author | David Barr <david.barr@cordelta.com> | 2010-08-09 17:39:43 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-14 19:35:37 -0700 |
commit | 3bbaec00a8ffc6ea7e71c3b707851fe663d93a45 (patch) | |
tree | 5af41401b9e6764754058d4305a0d212190828b9 /vcs-svn/line_buffer.h | |
parent | 1d73b52f5ba4184de6acf474f14668001304a10c (diff) | |
download | git-3bbaec00a8ffc6ea7e71c3b707851fe663d93a45.tar.gz |
Add stream helper library
This library provides thread-unsafe fgets()- and fread()-like
functions where the caller does not have to supply a buffer. It
maintains a couple of static buffers and provides an API to use
them.
[rr: allow input from files other than stdin]
[jn: with tests, documentation, and error handling improvements]
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'vcs-svn/line_buffer.h')
-rw-r--r-- | vcs-svn/line_buffer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vcs-svn/line_buffer.h b/vcs-svn/line_buffer.h new file mode 100644 index 0000000000..9c78ae11a1 --- /dev/null +++ b/vcs-svn/line_buffer.h @@ -0,0 +1,12 @@ +#ifndef LINE_BUFFER_H_ +#define LINE_BUFFER_H_ + +int buffer_init(const char *filename); +int buffer_deinit(void); +char *buffer_read_line(void); +char *buffer_read_string(uint32_t len); +void buffer_copy_bytes(uint32_t len); +void buffer_skip_bytes(uint32_t len); +void buffer_reset(void); + +#endif |