| 8 | #include <fcntl.h> |
| 9 | |
| 10 | bool rbuf_open(struct rbuf *rbuf, const char *name, char *buf, size_t buf_max, |
| 11 | void *(*expandfn)(struct membuf *, void *, size_t)) |
| 12 | { |
| 13 | int fd = open(name, O_RDONLY); |
| 14 | if (fd >= 0) { |
| 15 | rbuf_init(rbuf, fd, buf, buf_max, expandfn); |
| 16 | return true; |
| 17 | } |
| 18 | return false; |
| 19 | } |
| 20 | |
| 21 | size_t rbuf_good_size(int fd) |
| 22 | { |