Home
last modified time | relevance | path

Searched refs:_bf (Results 1 – 18 of 18) sorted by relevance

/bionic/libc/upstream-openbsd/lib/libc/stdio/
Dvasprintf.c39 f._bf._base = f._p = malloc(INITIAL_SIZE); in vasprintf()
40 if (f._bf._base == NULL) in vasprintf()
42 f._bf._size = f._w = INITIAL_SIZE - 1; /* leave room for the NUL */ in vasprintf()
49 unsigned char *_base = recallocarray(f._bf._base, in vasprintf()
50 f._bf._size + 1, ret + 1, 1); in vasprintf()
56 *str = (char *)f._bf._base; in vasprintf()
60 free(f._bf._base); in vasprintf()
61 f._bf._base = NULL; in vasprintf()
Dfvwrite.c108 size_t blen = fp->_p - fp->_bf._base; in __sfvwrite()
115 _base = recallocarray(fp->_bf._base, in __sfvwrite()
116 fp->_bf._size + 1, _size + 1, 1); in __sfvwrite()
119 fp->_w += _size - fp->_bf._size; in __sfvwrite()
120 fp->_bf._base = _base; in __sfvwrite()
121 fp->_bf._size = _size; in __sfvwrite()
132 } else if (fp->_p > fp->_bf._base && len > w) { in __sfvwrite()
139 } else if (len >= (w = fp->_bf._size)) { in __sfvwrite()
172 w = fp->_w + fp->_bf._size; in __sfvwrite()
173 if (fp->_p > fp->_bf._base && s > w) { in __sfvwrite()
[all …]
Dvswprintf.c58 f._bf._base = f._p = malloc(128); in vswprintf()
59 if (f._bf._base == NULL) { in vswprintf()
63 f._bf._size = f._w = 127; /* Leave room for the NUL */ in vswprintf()
67 free(f._bf._base); in vswprintf()
73 free(f._bf._base); in vswprintf()
77 mbp = (char *)f._bf._base; in vswprintf()
84 free(f._bf._base); in vswprintf()
Dmakebuf.c57 fp->_bf._base = fp->_p = fp->_nbuf; in __smakebuf()
58 fp->_bf._size = 1; in __smakebuf()
64 fp->_bf._base = fp->_p = fp->_nbuf; in __smakebuf()
65 fp->_bf._size = 1; in __smakebuf()
69 fp->_bf._base = fp->_p = p; in __smakebuf()
70 fp->_bf._size = size; in __smakebuf()
Dsetvbuf.c73 free(fp->_bf._base); in setvbuf()
109 fp->_bf._base = fp->_p = fp->_nbuf; in setvbuf()
110 fp->_bf._size = 1; in setvbuf()
139 fp->_bf._base = fp->_p = (unsigned char *)buf; in setvbuf()
140 fp->_bf._size = size; in setvbuf()
149 fp->_lbfsize = -fp->_bf._size; in setvbuf()
Dwsetup.c62 fp->_p = fp->_bf._base; in __swsetup()
70 if (fp->_bf._base == NULL) { in __swsetup()
82 fp->_lbfsize = -fp->_bf._size; in __swsetup()
84 fp->_w = fp->_flags & __SNBF ? 0 : fp->_bf._size; in __swsetup()
Dwbuf.c72 n = fp->_p - fp->_bf._base; in __swbuf()
73 if (n >= fp->_bf._size) { in __swbuf()
80 if (++n == fp->_bf._size || (fp->_flags & __SLBF && c == '\n')) in __swbuf()
Dfpurge.c56 fp->_p = fp->_bf._base; in fpurge()
58 fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size; in fpurge()
Dvsscanf.c53 f._bf._base = f._p = (unsigned char *)str; in vsscanf()
54 f._bf._size = f._r = strlen(str); in vsscanf()
Dvdprintf.c64 f._bf._base = buf; in vdprintf()
65 f._bf._size = sizeof(buf); in vdprintf()
Dvswscanf.c80 f._bf._base = f._p = (unsigned char *)mbstr; in vswscanf()
81 f._bf._size = f._r = mlen; in vswscanf()
Dungetc.c126 if (fp->_bf._base != NULL && fp->_p > fp->_bf._base && in ungetc()
/bionic/libc/stdio/
Drefill.c94 if (fp->_bf._base == NULL) in __srefill()
112 fp->_p = fp->_bf._base; in __srefill()
113 fp->_r = (*fp->_read)(fp->_cookie, (char *)fp->_p, fp->_bf._size); in __srefill()
Dstdio_ext.cpp39 return fp->_bf._size; in __fbufsize()
67 return fp->_p - fp->_bf._base; in __fpending()
Dstdio.cpp191 fp->_bf._base = nullptr; /* no buffer */ in __sfp()
192 fp->_bf._size = 0; in __sfp()
357 if (fp->_flags & __SMBF) free(fp->_bf._base); in freopen()
361 fp->_bf._base = nullptr; in freopen()
362 fp->_bf._size = 0; in freopen()
421 if (fp->_flags & __SMBF) free(fp->_bf._base); in __FILE_close()
503 unsigned char* p = fp->_bf._base; in __sflush()
510 fp->_w = (fp->_flags & (__SLBF|__SNBF)) ? 0 : fp->_bf._size; in __sflush()
589 result += fp->_p - fp->_bf._base; in __ftello64_unlocked()
617 if (fp->_bf._base == nullptr) __smakebuf(fp); in __fseeko64()
[all …]
Dlocal.h72 struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ member
219 #define cantwrite(fp) ((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && __swsetup(fp))
Dprintf_common.h101 fake._bf._base = fake._p = buf; in __sbprintf()
102 fake._bf._size = fake._w = sizeof(buf); in __sbprintf()
/bionic/libc/bionic/
Dwcstod.cpp62 f._bf._base = f._p = reinterpret_cast<unsigned char*>(ascii_str); in wcstod()
63 f._bf._size = f._r = max_len; in wcstod()