Lines Matching refs:fp
43 __slbexpand(FILE *fp, size_t newsize) in __slbexpand() argument
47 if (fp->_lb._size >= newsize) in __slbexpand()
49 if ((p = realloc(fp->_lb._base, newsize)) == NULL) in __slbexpand()
51 fp->_lb._base = p; in __slbexpand()
52 fp->_lb._size = newsize; in __slbexpand()
64 fgetln(FILE *fp, size_t *lenp) in fgetln() argument
71 FLOCKFILE(fp); in fgetln()
72 _SET_ORIENTATION(fp, -1); in fgetln()
75 if (fp->_r <= 0 && __srefill(fp)) in fgetln()
79 if ((p = memchr((void *)fp->_p, '\n', fp->_r)) != NULL) { in fgetln()
86 ret = (char *)fp->_p; in fgetln()
87 *lenp = len = p - fp->_p; in fgetln()
88 fp->_flags |= __SMOD; in fgetln()
89 fp->_r -= len; in fgetln()
90 fp->_p = p; in fgetln()
91 FUNLOCKFILE(fp); in fgetln()
105 for (len = fp->_r, off = 0;; len += fp->_r) { in fgetln()
113 if (__slbexpand(fp, len + OPTIMISTIC)) in fgetln()
115 (void)memcpy((void *)(fp->_lb._base + off), (void *)fp->_p, in fgetln()
118 if (__srefill(fp)) in fgetln()
120 if ((p = memchr((void *)fp->_p, '\n', fp->_r)) == NULL) in fgetln()
125 diff = p - fp->_p; in fgetln()
127 if (__slbexpand(fp, len)) in fgetln()
129 (void)memcpy((void *)(fp->_lb._base + off), (void *)fp->_p, in fgetln()
131 fp->_r -= diff; in fgetln()
132 fp->_p = p; in fgetln()
136 ret = (char *)fp->_lb._base; in fgetln()
137 FUNLOCKFILE(fp); in fgetln()
141 FUNLOCKFILE(fp); in fgetln()