Lines Matching full:sl
105 tw_str_add(stringlist_t *sl, size_t len) in tw_str_add() argument
109 if (sl->tlist <= sl->nlist) { in tw_str_add()
111 sl->tlist += TW_INCR; in tw_str_add()
112 sl->list = xrealloc(sl->list, sl->tlist * sizeof(Char *)); in tw_str_add()
115 if (sl->tbuff <= sl->nbuff + len) { in tw_str_add()
118 ptr = sl->buff; in tw_str_add()
120 sl->tbuff += TW_INCR + len; in tw_str_add()
121 sl->buff = xrealloc(sl->buff, sl->tbuff * sizeof(Char)); in tw_str_add()
123 if (ptr != NULL && ptr != sl->buff) { in tw_str_add()
124 for (i = 0; i < sl->nlist; i++) in tw_str_add()
125 sl->list[i] = sl->buff + (sl->list[i] - ptr); in tw_str_add()
129 ptr = sl->list[sl->nlist++] = &sl->buff[sl->nbuff]; in tw_str_add()
130 sl->nbuff += len; in tw_str_add()
139 tw_str_free(stringlist_t *sl) in tw_str_free() argument
142 if (sl->list) { in tw_str_free()
143 xfree(sl->list); in tw_str_free()
144 sl->list = NULL; in tw_str_free()
145 sl->tlist = sl->nlist = 0; in tw_str_free()
147 if (sl->buff) { in tw_str_free()
148 xfree(sl->buff); in tw_str_free()
149 sl->buff = NULL; in tw_str_free()
150 sl->tbuff = sl->nbuff = 0; in tw_str_free()