Lines Matching refs:length

70     size_t length;  in stats_prefix_find()  local
75 for (length = 0; length < nkey && key[length] != '\0'; length++) { in stats_prefix_find()
76 if (key[length] == settings.prefix_delimiter) { in stats_prefix_find()
86 hashval = hash(key, length) % PREFIX_HASH_SIZE; in stats_prefix_find()
89 if (strncmp(pfs->prefix, key, length) == 0) in stats_prefix_find()
99 pfs->prefix = malloc(length + 1); in stats_prefix_find()
106 strncpy(pfs->prefix, key, length); in stats_prefix_find()
107 pfs->prefix[length] = '\0'; /* because strncpy() sucks */ in stats_prefix_find()
108 pfs->prefix_len = length; in stats_prefix_find()
114 total_prefix_size += length; in stats_prefix_find()
168 char *stats_prefix_dump(int *length) { in stats_prefix_dump() argument
208 *length = pos + 5; in stats_prefix_dump()
302 int length; in test_prefix_dump() local
304 test_equals_str("empty stats", "END\r\n", stats_prefix_dump(&length)); in test_prefix_dump()
305 test_equals_int("empty stats length", 5, length); in test_prefix_dump()
308 test_equals_str("stats after set", expected, stats_prefix_dump(&length)); in test_prefix_dump()
309 test_equals_int("stats length after set", strlen(expected), length); in test_prefix_dump()
312 test_equals_str("stats after get #1", expected, stats_prefix_dump(&length)); in test_prefix_dump()
313 test_equals_int("stats length after get #1", strlen(expected), length); in test_prefix_dump()
316 test_equals_str("stats after get #2", expected, stats_prefix_dump(&length)); in test_prefix_dump()
317 test_equals_int("stats length after get #2", strlen(expected), length); in test_prefix_dump()
320 test_equals_str("stats after del #1", expected, stats_prefix_dump(&length)); in test_prefix_dump()
321 test_equals_int("stats length after del #1", strlen(expected), length); in test_prefix_dump()
328 test_equals_str("stats after del #2", expected, stats_prefix_dump(&length)); in test_prefix_dump()
329 test_equals_int("stats length after del #2", strlen(expected), length); in test_prefix_dump()
345 tmp, stats_prefix_dump(&length)); in test_prefix_dump()
347 strlen(tmp), length); in test_prefix_dump()