MCPcopy Create free account
hub / github.com/ElementsProject/lightning / rbuf_open

Function rbuf_open

ccan/ccan/rbuf/rbuf.c:10–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <fcntl.h>
9
10bool 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
21size_t rbuf_good_size(int fd)
22{

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 1

rbuf_initFunction · 0.85

Tested by 2

mainFunction · 0.68
mainFunction · 0.68