1openreadclose(3) Library Functions Manual openreadclose(3)
2
3
4
6 openreadclose - read a whole file into a stralloc
7
9 #include <openreadclose.h>
10
11 int openreadclose(const char *filename,
12 stralloc* sa,size_t bufsize);
13
15 openreadclose opens the file filename for reading and reads the whole
16 content into the stralloc sa. The file is read in chunks of bufsize
17 bytes size. If everything worked fine, openreadclose returns 1. If
18 the file did not exist, openreadclose returns 0. On every other error,
19 openreadclose returns -1 and sets errno appropriately.
20
22 open_read(3), readclose(3)
23
24
25
26 openreadclose(3)