1stralloc_ready(3) Library Functions Manual stralloc_ready(3)
2
3
4
6 stralloc_ready - provide space in a stralloc
7
9 #include <stralloc.h>
10
11 int stralloc_ready(stralloc* sa,size_t len);
12
14 stralloc_ready makes sure that sa has enough space allocated to hold
15 len bytes: If sa is not allocated, stralloc_ready allocates at least
16 len bytes of space, and returns 1. If sa is already allocated, but not
17 enough to hold len bytes, stralloc_ready allocates at least len bytes
18 of space, copies the old string into the new space, frees the old
19 space, and returns 1. Note that this changes sa.s.
20
21 If stralloc_ready runs out of memory, it leaves sa alone and returns 0.
22
24 1 for success, 0 on memory allocation failure.
25
27 stralloc_readyplus(3)
28
29
30
31 stralloc_ready(3)