1buffer_fromsa(3) Library Functions Manual buffer_fromsa(3)
2
3
4
6 buffer_fromsa - initialize buffer structure from stralloc
7
9 #include <buffer.h>
10
11 void buffer_fromsa(buffer* b,stralloc* sa);
12
14 buffer_fromsa makes a virtual read buffer from a stralloc. The buffer
15 reading functions will be able to read until the end of the data in the
16 stralloc, then signal EOF. The buffer does not have its own buffer
17 space, it reuses the one in the stralloc.
18
19 Do not touch the stralloc until your are done with the buffer! In par‐
20 ticular, do not call stralloc_free on it!
21
22 Reading data from the buffer will not change the stralloc.
23
25 buffer_init(3), buffer(3)
26
27
28
29 buffer_fromsa(3)