mirror of
git://git.suckless.org/sbase
synced 2024-12-22 23:13:44 +00:00
3276fbea1c
If we are just copying data from one file to another, we don't need to fill a complete buffer, just read a chunk at a time, and write it to the output.
17 lines
299 B
C
17 lines
299 B
C
/* See LICENSE file for copyright and license details. */
|
|
|
|
struct line {
|
|
char *data;
|
|
size_t len;
|
|
};
|
|
|
|
struct linebuf {
|
|
struct line *lines;
|
|
size_t nlines;
|
|
size_t capacity;
|
|
};
|
|
#define EMPTY_LINEBUF {NULL, 0, 0,}
|
|
void getlines(FILE *, struct linebuf *);
|
|
|
|
int linecmp(struct line *, struct line *);
|