Home | History | Annotate | Download | only in c-ares

Lines Matching refs:buf

28  * ares__read_line multiple times with the same buf and bufsize
29 * pointers; *buf will be reallocated and *bufsize adjusted as
30 * appropriate. The initial value of *buf should be NULL. After the
31 * calling routine is done reading lines, it should free *buf.
33 int ares__read_line(FILE *fp, char **buf, size_t *bufsize)
39 if (*buf == NULL)
41 *buf = malloc(128);
42 if (!*buf)
51 if (!fgets(*buf + offset, bytestoread, fp))
53 len = offset + strlen(*buf + offset);
54 if ((*buf)[len - 1] == '\n')
56 (*buf)[len - 1] = 0;
64 newbuf = realloc(*buf, *bufsize * 2);
67 *buf = newbuf;