Lines Matching refs:sl
109 tw_str_add(stringlist_t *sl, size_t len)
113 if (sl->tlist <= sl->nlist) {
115 sl->tlist += TW_INCR;
116 sl->list = xrealloc(sl->list, sl->tlist * sizeof(Char *));
119 if (sl->tbuff <= sl->nbuff + len) {
122 ptr = sl->buff;
124 sl->tbuff += TW_INCR + len;
125 sl->buff = xrealloc(sl->buff, sl->tbuff * sizeof(Char));
127 if (ptr != NULL && ptr != sl->buff) {
128 intptr_t offs = sl->buff - ptr;
129 for (i = 0; i < sl->nlist; i++)
130 sl->list[i] += offs;
134 ptr = sl->list[sl->nlist++] = &sl->buff[sl->nbuff];
135 sl->nbuff += len;
144 tw_str_free(stringlist_t *sl)
147 if (sl->list) {
148 xfree(sl->list);
149 sl->list = NULL;
150 sl->tlist = sl->nlist = 0;
152 if (sl->buff) {
153 xfree(sl->buff);
154 sl->buff = NULL;
155 sl->tbuff = sl->nbuff = 0;