Lines Matching refs:n
21 static int getstr(char **lineptr, size_t *n, FILE *stream, in getstr() argument
28 if (!lineptr || !n || !stream) in getstr()
32 *n = MIN_CHUNK; in getstr()
33 *lineptr = malloc(*n); in getstr()
38 nchars_avail = *n - offset; in getstr()
48 assert(*n - nchars_avail == read_pos - *lineptr); in getstr()
50 if (*n > MIN_CHUNK) in getstr()
51 *n *= 2; in getstr()
53 *n += MIN_CHUNK; in getstr()
55 nchars_avail = *n + *lineptr - read_pos; in getstr()
56 *lineptr = realloc(*lineptr, *n); in getstr()
59 read_pos = *n - nchars_avail + *lineptr; in getstr()
60 assert(*n - nchars_avail == read_pos - *lineptr); in getstr()
86 int getline (char **lineptr, size_t *n, FILE *stream) in getline() argument
88 return getstr(lineptr, n, stream, '\n', 0); in getline()