Lines Matching refs:new_length
291 static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned perc… in ascii_ellipsize_mem() argument
297 assert(new_length != SIZE_MAX); in ascii_ellipsize_mem()
299 if (old_length <= new_length) in ascii_ellipsize_mem()
303 switch (new_length) { in ascii_ellipsize_mem()
329 t = new(char, new_length+3); in ascii_ellipsize_mem()
333 assert(new_length >= need_space); in ascii_ellipsize_mem()
335 x = ((new_length - need_space) * percent + 50) / 100; in ascii_ellipsize_mem()
336 assert(x <= new_length - need_space); in ascii_ellipsize_mem()
340 suffix_len = new_length - x - need_space; in ascii_ellipsize_mem()
347 char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) { in ellipsize_mem() argument
368 if (new_length == SIZE_MAX) in ellipsize_mem()
371 if (new_length == 0) in ellipsize_mem()
376 return ascii_ellipsize_mem(s, old_length, new_length, percent); in ellipsize_mem()
378 x = ((new_length - 1) * percent) / 100; in ellipsize_mem()
379 assert(x <= new_length - 1); in ellipsize_mem()
408 if (k + w <= new_length) { in ellipsize_mem()