blob: 806125790db6acf697eb2dda01dbd9cba4fac6dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include "parse.h"
int parse_doc(enum doc_type doct, int (*line_get)(char **, size_t *)) {
char *s;
size_t n;
switch (doct) {
case TYPE_PLAIN:
doc_new();
while (line_get(&s, &n)) {
doc_add(s, n);
doc_add("\n", 1);
}
return 0;
default:
return -1;
}
}
|