mirror of
https://github.com/git/git.git
synced 2024-11-19 23:04:05 +01:00
3bbaec00a8
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>
13 lines
290 B
C
13 lines
290 B
C
#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
|