3 stralloc \- dynamically allocated strings
5 .B #include <stralloc.h>
7 int \fBstralloc_ready\fP(&\fIsa\fR,\fIlen\fR);
9 int \fBstralloc_readyplus\fP(&\fIsa\fR,\fIlen\fR);
11 int \fBstralloc_copy\fP(&\fIsa\fR,&\fIsa2\fR);
13 int \fBstralloc_copys\fP(&\fIsa\fR,\fIbuf\fR);
15 int \fBstralloc_copyb\fP(&\fIsa\fR,\fIbuf\fR,\fIlen\fR);
17 int \fBstralloc_cat\fP(&\fIsa\fR,&\fIsa2\fR);
19 int \fBstralloc_cats\fP(&\fIsa\fR,\fIbuf\fR);
21 int \fBstralloc_catb\fP(&\fIsa\fR,\fIbuf\fR,\fIlen\fR);
23 int \fBstralloc_append\fP(&\fIsa\fR,\fIbuf\fR);
25 int \fBstralloc_0\fP(&\fIsa\fR);
27 int \fBstralloc_starts\fP(&\fIsa\fR,\fIbuf\fR);
29 stralloc \fIsa\fR = {0};
31 stralloc \fIsa2\fR = {0};
33 unsigned int \fIlen\fR;
39 variable holds a string in dynamically allocated space.
40 String length is limited only by memory.
41 String contents are unrestricted.
45 structure has three components:
47 is a pointer to the string, or 0 if it is not allocated;
49 is the number of bytes in the string, if it is allocated;
51 is the number of bytes allocated for the string, if it is allocated.
54 variable should be initialized to {0},
60 has enough space allocated for
63 It allocates extra space if necessary.
68 has enough space allocated for
70 characters more than its current length.
83 allocating space if necessary.
91 copies a 0-terminated string,
110 allocating space if necessary.
127 adds a single character,
131 allocating space if necessary.
134 adds a single 0 character
139 returns 1 if the 0-terminated string
147 routine runs out of memory,
154 On success it returns 1;