mirror of
https://github.com/git/git
synced 2024-10-30 14:03:28 +00: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>
12 lines
290 B
C
12 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
|