Lines Matching refs:target
198 void simplestring_addn(simplestring* target, const char* source, size_t add_len) { in simplestring_addn() argument
199 size_t newsize = target->size, incr = 0; in simplestring_addn()
200 if(target && source) { in simplestring_addn()
201 if(!target->str) { in simplestring_addn()
202 simplestring_init_str(target); in simplestring_addn()
205 if((SIZE_MAX - add_len) < target->len || (SIZE_MAX - add_len - 1) < target->len) { in simplestring_addn()
210 if(target->len + add_len + 1 > target->size) { in simplestring_addn()
212 newsize = target->len + add_len + 1; in simplestring_addn()
213 incr = target->size * 2; in simplestring_addn()
219 if(newsize < (target->len + add_len + 1)) { in simplestring_addn()
223 target->str = (char*)erealloc(target->str, newsize); in simplestring_addn()
225 target->size = target->str ? newsize : 0; in simplestring_addn()
228 if(target->str) { in simplestring_addn()
230 memcpy(target->str + target->len, source, add_len); in simplestring_addn()
232 target->len += add_len; in simplestring_addn()
233 target->str[target->len] = 0; /* null terminate */ in simplestring_addn()
256 void simplestring_add(simplestring* target, const char* source) { in simplestring_add() argument
257 if(target && source) { in simplestring_add()
258 simplestring_addn(target, source, strlen(source)); in simplestring_add()