master xplshn/aruu / shared / text.h
 1/* See LICENSE file for copyright and license details. */
 2
 3#include <stddef.h>
 4#include <stdio.h>
 5#include <sys/types.h>
 6
 7struct line {
 8	char *data;
 9	size_t len;
10};
11
12struct linebuf {
13	struct line *lines;
14	size_t nlines;
15	size_t capacity;
16};
17#define EMPTY_LINEBUF {NULL, 0, 0,}
18void getlines(FILE *, struct linebuf *);
19
20int linecmp(struct line *, struct line *);
21
22ssize_t agetline(char **, size_t *, FILE *);
23void fconcat(FILE *, const char *, FILE *, const char *);