| stralloc_0 | - append \0 to a stralloc |
| stralloc_append | - append a character to a stralloc |
| stralloc_cat | - append data to a stralloc |
| stralloc_catb | - append data to a stralloc |
| stralloc_catlong0 | - append an integer to a stralloc |
| stralloc_cats | - append data to a stralloc |
| stralloc_catulong0 | - append an integer to a stralloc |
| stralloc_copy | - copy data into a stralloc |
| stralloc_copyb | - copy data into a stralloc |
| stralloc_copys | - copy data into a stralloc |
| stralloc_free | - free storage associated with a stralloc |
| stralloc_ready | - provide space in a stralloc |
| stralloc_readyplus | - provide space in a stralloc |
| stralloc_starts | - check if string is prefix of stralloc |
stralloc_append appends the byte from *buf to the string stored in sa, allocating space if necessary, and returns 1. If it runs out of memory, stralloc_append leaves sa alone and returns 0.
stralloc_cat appendsthe string stored in safrom to sa. It is the same as stralloc_catb(&sato, safrom.s, safrom.len). safrom must already be allocated. The data that sa previously contained is overwritten and truncated.
stralloc_catb adds the string buf[0], buf[1], ... buf[len-1] to the end of the string stored in sa, allocating space if necessary, and returns 1. If sa is unallocated, stralloc_catb is the same as stralloc_copyb. If it runs out of memory, stralloc_catb leaves sa alone and returns 0.
stralloc_catlong0 converts in to a string using fmt_long0 and appends the result to sa, allocating memory as necessary. If there was a memory allocation failure, stralloc_catlong0 returns 0, else 1.
stralloc_cats append sa \0 terminated string from buf to the end of the string stored in sa, allocating space if necessary, and returns 1. If sa is unallocated, stralloc_cats is the same as stralloc_copys. If it runs out of memory, stralloc_cats leaves sa alone and returns 0.
stralloc_catulong0 converts in to a string using fmt_ulong0 and appends the result to sa, allocating memory as necessary. If there was a memory allocation failure, stralloc_catulong0 returns 0, else 1.
stralloc_copy copies the string stored in sa from in to sa. It is the same as stralloc_copyb(&sato, safrom.s, safrom.len).safrom must already be allocated.The data that sa previously contained is overwritten and truncated.
stralloc_copyb makes sure that sa has enough space allocated to hold len bytes.Then it copies the first len bytes from buf into the stralloc.The data that sa previously contained is overwritten and truncated.
stralloc_copys copies a \0 terminated string from buf into sa, without the \0. It is the same as stralloc_copyb(&sa, buf, str_len(buf)). The data that sa previously contained is overwritten and truncated.
stralloc_free returnsthe storage associated with sa to the system. Afterwards, the stralloc is unallocated.
stralloc_ready makes sure that sa has enough space allocated to hold len bytes: If sa is not allocated, stralloc_ready allocates at least len bytes of space, and returns 1. If sa is already allocated, but not enough to hold len bytes, stralloc_ready allocates at least len bytes of space, copies the old string into the new space, frees the old space, and returns 1. Note that this changes sa.s.
stralloc_readyplus makes sure that sa has enough space allocated to hold an additional len bytes: If sa is not allocated, stralloc_ready allocates at least len bytes of space, and returns 1. If sa is already allocated, but not enough to hold len additional bytes, stralloc_ready allocates at least sa->len+len bytes of space, copies the old string into the new space, frees the oldspace, and returns 1. Note that this changes sa.s.
stralloc_starts returns 1 if the \0 terminated string in buf, without the terminating \0, is a prefix of the string stored in sa. Otherwise it returns 0. sa must already be allocated.
Tino Reichardt <der@mcmilk.de>, Felix von Leitner <der@fefe.de> Version: 5.2, Date: 2001/05/26