| /third_party/ulib/musl/src/internal/ |
| A D | shgetc.c | 4 f->shlim = lim; in __shlim() 5 f->shcnt = f->rend - f->rpos; in __shlim() 7 f->shend = f->rpos + lim; in __shlim() 9 f->shend = f->rend; in __shlim() 14 if ((f->shlim && f->shcnt >= f->shlim) || (c = __uflow(f)) < 0) { in __shgetc() 15 f->shend = 0; in __shgetc() 18 if (f->shlim && f->rend - f->rpos > f->shlim - f->shcnt - 1) in __shgetc() 19 f->shend = f->rpos + (f->shlim - f->shcnt - 1); in __shgetc() 21 f->shend = f->rend; in __shgetc() 22 if (f->rend) in __shgetc() [all …]
|
| A D | shgetc.h | 6 #define shcnt(f) ((f)->shcnt + ((f)->rpos - (f)->rend)) argument 7 #define shlim(f, lim) __shlim((f), (lim)) argument 8 #define shgetc(f) (((f)->rpos < (f)->shend) ? *(f)->rpos++ : __shgetc(f)) argument 9 #define shunget(f) ((f)->shend ? (void)(f)->rpos-- : (void)0) argument
|
| /third_party/ulib/musl/src/stdio/ |
| A D | fflush.c | 5 if (f->wpos > f->wbase) { in __fflush_unlocked() 6 f->write(f, 0, 0); in __fflush_unlocked() 12 if (f->rpos < f->rend) in __fflush_unlocked() 13 f->seek(f, f->rpos - f->rend, SEEK_CUR); in __fflush_unlocked() 16 f->wpos = f->wbase = f->wend = 0; in __fflush_unlocked() 17 f->rpos = f->rend = 0; in __fflush_unlocked() 25 if (f) { in fflush() 26 FLOCK(f); in fflush() 34 for (f = *__ofl_lock(); f; f = f->next) { in fflush() 35 FLOCK(f); in fflush() [all …]
|
| A D | __stdio_exit.c | 3 static void close_file(FILE* f) { in close_file() argument 4 if (!f) in close_file() 6 FFINALLOCK(f); in close_file() 7 if (f->wpos > f->wbase) in close_file() 8 f->write(f, 0, 0); in close_file() 9 if (f->rpos < f->rend) in close_file() 10 f->seek(f, f->rpos - f->rend, SEEK_CUR); in close_file() 14 FILE* f; in __stdio_exit() local 15 for (f = *__ofl_lock(); f; f = f->next) in __stdio_exit() 16 close_file(f); in __stdio_exit()
|
| A D | fseek.c | 6 off -= f->rend - f->rpos; in __fseeko_unlocked() 9 if (f->wpos > f->wbase) { in __fseeko_unlocked() 10 f->write(f, 0, 0); in __fseeko_unlocked() 11 if (!f->wpos) in __fseeko_unlocked() 16 f->wpos = f->wbase = f->wend = 0; in __fseeko_unlocked() 19 if (f->seek(f, off, whence) < 0) in __fseeko_unlocked() 23 f->rpos = f->rend = 0; in __fseeko_unlocked() 24 f->flags &= ~F_EOF; in __fseeko_unlocked() 31 FLOCK(f); in __fseeko() 33 FUNLOCK(f); in __fseeko() [all …]
|
| A D | __toread.c | 3 int __toread(FILE* f) { in __toread() argument 4 f->mode |= f->mode - 1; in __toread() 5 if (f->wpos > f->wbase) in __toread() 6 f->write(f, 0, 0); in __toread() 7 f->wpos = f->wbase = f->wend = 0; in __toread() 8 if (f->flags & F_NORD) { in __toread() 9 f->flags |= F_ERR; in __toread() 12 f->rpos = f->rend = f->buf + f->buf_size; in __toread() 13 return (f->flags & F_EOF) ? EOF : 0; in __toread()
|
| A D | fclose.c | 4 int fclose(FILE* f) { in fclose() argument 8 FLOCK(f); in fclose() 12 if (f->prev) in fclose() 13 f->prev->next = f->next; in fclose() 14 if (f->next) in fclose() 15 f->next->prev = f->prev; in fclose() 21 r = fflush(f); in fclose() 22 r |= f->close(f); in fclose() 24 if (f->getln_buf) in fclose() 27 free(f); in fclose() [all …]
|
| A D | __fdopen.c | 10 FILE* f; in __fdopen() local 25 if (!(f = malloc(sizeof *f + UNGET + BUFSIZ))) in __fdopen() 29 memset(f, 0, sizeof *f); in __fdopen() 43 f->flags |= F_APP; in __fdopen() 46 f->fd = fd; in __fdopen() 47 f->buf = (unsigned char*)f + sizeof *f + UNGET; in __fdopen() 48 f->buf_size = BUFSIZ; in __fdopen() 51 f->lbf = EOF; in __fdopen() 53 f->lbf = '\n'; in __fdopen() 56 f->read = __stdio_read; in __fdopen() [all …]
|
| A D | fmemopen.c | 40 f->rpos = f->buf; in mread() 41 f->rend = f->buf + rem; in mread() 50 size_t len2 = f->wpos - f->wbase; in mwrite() 52 f->wpos = f->wbase; in mwrite() 53 if (mwrite(f, f->wpos, len2) < len2) in mwrite() 78 FILE* f; in fmemopen() local 93 if (!f) in fmemopen() 95 f->cookie = c = (void*)(f + 1); in fmemopen() 96 f->fd = -1; in fmemopen() 97 f->lbf = EOF; in fmemopen() [all …]
|
| A D | ftell.c | 5 off_t __ftello_unlocked(FILE* f) { in __ftello_unlocked() argument 6 off_t pos = f->seek(f, 0, (f->flags & F_APP) && f->wpos > f->wbase ? SEEK_END : SEEK_CUR); in __ftello_unlocked() 11 return pos - (f->rend - f->rpos) + (f->wpos - f->wbase); in __ftello_unlocked() 14 off_t __ftello(FILE* f) { in __ftello() argument 16 FLOCK(f); in __ftello() 17 pos = __ftello_unlocked(f); in __ftello() 18 FUNLOCK(f); in __ftello() 22 long ftell(FILE* f) { in ftell() argument 23 off_t pos = __ftello(f); in ftell()
|
| A D | __towrite.c | 3 int __towrite(FILE* f) { in __towrite() argument 4 f->mode |= f->mode - 1; in __towrite() 5 if (f->flags & (F_NOWR)) { in __towrite() 6 f->flags |= F_ERR; in __towrite() 10 f->rpos = f->rend = 0; in __towrite() 13 f->wpos = f->wbase = f->buf; in __towrite() 14 f->wend = f->buf + f->buf_size; in __towrite()
|
| A D | open_memstream.c | 31 size_t len2 = f->wpos - f->wbase; in ms_write() 34 f->wpos = f->wbase; in ms_write() 35 if (ms_write(f, f->wbase, len2) < len2) in ms_write() 60 FILE* f; in open_memstream() local 64 if (!(f = malloc(sizeof *f + sizeof *c + BUFSIZ))) in open_memstream() 67 free(f); in open_memstream() 70 memset(f, 0, sizeof *f + sizeof *c); in open_memstream() 71 f->cookie = c = (void*)(f + 1); in open_memstream() 79 f->flags = F_NORD; in open_memstream() 80 f->fd = -1; in open_memstream() [all …]
|
| A D | __fopen_rb_ca.c | 6 memset(f, 0, sizeof *f); in __fopen_rb_ca() 9 if (f->fd < 0) in __fopen_rb_ca() 11 fcntl(f->fd, F_SETFD, FD_CLOEXEC); in __fopen_rb_ca() 13 f->flags = F_NOWR | F_PERM; in __fopen_rb_ca() 14 f->buf = buf + UNGET; in __fopen_rb_ca() 15 f->buf_size = len - UNGET; in __fopen_rb_ca() 16 f->read = __stdio_read; in __fopen_rb_ca() 17 f->seek = __stdio_seek; in __fopen_rb_ca() 18 f->close = __stdio_close; in __fopen_rb_ca() 19 f->lock = -1; in __fopen_rb_ca() [all …]
|
| A D | fgetwc.c | 14 if (f->rpos < f->rend) { in __fgetwc_unlocked_internal() 15 l = mbrtowc(&wc, (void*)f->rpos, f->rend - f->rpos, &st); in __fgetwc_unlocked_internal() 21 f->rpos++; in __fgetwc_unlocked_internal() 29 b = c = getc_unlocked(f); in __fgetwc_unlocked_internal() 45 if (f->mode <= 0) in __fgetwc_unlocked() 46 fwide(f, 1); in __fgetwc_unlocked() 47 *ploc = f->locale; in __fgetwc_unlocked() 53 wint_t fgetwc(FILE* f) { in fgetwc() argument 55 FLOCK(f); in fgetwc() 56 c = __fgetwc_unlocked(f); in fgetwc() [all …]
|
| A D | ungetwc.c | 13 FLOCK(f); in ungetwc() 15 if (f->mode <= 0) in ungetwc() 16 fwide(f, 1); in ungetwc() 17 *ploc = f->locale; in ungetwc() 19 if (!f->rpos) in ungetwc() 20 __toread(f); in ungetwc() 22 f->rpos < f->buf - UNGET + l) { in ungetwc() 23 FUNLOCK(f); in ungetwc() 29 *--f->rpos = c; in ungetwc() 33 f->flags &= ~F_EOF; in ungetwc() [all …]
|
| A D | fgetln.c | 5 char* fgetln(FILE* f, size_t* plen) { in fgetln() argument 8 FLOCK(f); in fgetln() 9 ungetc(getc_unlocked(f), f); in fgetln() 10 if ((z = memchr(f->rpos, '\n', f->rend - f->rpos))) { in fgetln() 11 ret = (char*)f->rpos; in fgetln() 13 f->rpos = (void*)z; in fgetln() 14 } else if ((l = getline(&f->getln_buf, (size_t[]){}, f)) > 0) { in fgetln() 16 ret = f->getln_buf; in fgetln() 18 FUNLOCK(f); in fgetln()
|
| A D | fgets.c | 6 char* fgets(char* restrict s, int n, FILE* restrict f) { in fgets() argument 12 FLOCK(f); in fgets() 15 f->mode |= f->mode - 1; in fgets() 16 FUNLOCK(f); in fgets() 24 z = memchr(f->rpos, '\n', f->rend - f->rpos); in fgets() 25 k = z ? z - f->rpos + 1 : f->rend - f->rpos; in fgets() 27 memcpy(p, f->rpos, k); in fgets() 28 f->rpos += k; in fgets() 33 if ((c = getc_unlocked(f)) < 0) { in fgets() 34 if (p == s || !feof(f)) in fgets() [all …]
|
| A D | fwrite.c | 4 size_t __fwritex(const unsigned char* restrict s, size_t l, FILE* restrict f) { in __fwritex() argument 7 if (!f->wend && __towrite(f)) in __fwritex() 10 if (l > f->wend - f->wpos) in __fwritex() 11 return f->write(f, s, l); in __fwritex() 13 if (f->lbf >= 0) { in __fwritex() 18 size_t n = f->write(f, s, i); in __fwritex() 26 memcpy(f->wpos, s, l); in __fwritex() 27 f->wpos += l; in __fwritex() 35 FLOCK(f); in fwrite() 36 k = __fwritex(src, l, f); in fwrite() [all …]
|
| A D | freopen.c | 17 FLOCK(f); in freopen() 19 fflush(f); in freopen() 31 if (f2->fd == f->fd) in freopen() 36 f->flags = (f->flags & F_PERM) | f2->flags; in freopen() 37 f->read = f2->read; in freopen() 38 f->write = f2->write; in freopen() 39 f->seek = f2->seek; in freopen() 40 f->close = f2->close; in freopen() 45 FUNLOCK(f); in freopen() 46 return f; in freopen() [all …]
|
| A D | vswscanf.c | 5 static size_t wstring_read(FILE* f, unsigned char* buf, size_t len) { in wstring_read() argument 6 const wchar_t* src = f->cookie; in wstring_read() 12 k = wcsrtombs((void*)f->buf, &src, f->buf_size, 0); in wstring_read() 14 f->rpos = f->rend = 0; in wstring_read() 18 f->rpos = f->buf; in wstring_read() 19 f->rend = f->buf + k; in wstring_read() 20 f->cookie = (void*)src; in wstring_read() 25 *buf = *f->rpos++; in wstring_read() 31 FILE f = { in vswscanf() local 33 return vfwscanf(&f, fmt, ap); in vswscanf()
|
| A D | vswprintf.c | 16 struct cookie* c = f->cookie; in sw_write() 17 if (s != f->wbase && sw_write(f, f->wbase, f->wpos - f->wbase) == -1) in sw_write() 31 FILE f; in vswprintf() local 36 f.lbf = EOF; in vswprintf() 37 f.write = sw_write; in vswprintf() 38 f.buf_size = sizeof buf; in vswprintf() 39 f.buf = buf; in vswprintf() 40 f.lock = -1; in vswprintf() 41 f.cookie = &c; in vswprintf() 48 r = vfwprintf(&f, fmt, ap); in vswprintf() [all …]
|
| A D | fread.c | 6 size_t fread(void* restrict destv, size_t size, size_t nmemb, FILE* restrict f) { in fread() argument 12 FLOCK(f); in fread() 14 f->mode |= f->mode - 1; in fread() 16 if (f->rend - f->rpos > 0) { in fread() 18 k = MIN(f->rend - f->rpos, l); in fread() 19 memcpy(dest, f->rpos, k); in fread() 20 f->rpos += k; in fread() 27 k = __toread(f) ? 0 : f->read(f, dest, l); in fread() 29 FUNLOCK(f); in fread() 34 FUNLOCK(f); in fread()
|
| /third_party/ulib/musl/src/stdlib/ |
| A D | wcstod.c | 19 f->rpos = f->buf; in do_read() 20 f->rend = f->buf + i; in do_read() 24 *buf = *f->rpos++; in do_read() 33 FILE f = {}; in wcstox() local 34 f.flags = 0; in wcstox() 35 f.rpos = f.rend = 0; in wcstox() 36 f.buf = buf + 4; in wcstox() 38 f.lock = -1; in wcstox() 39 f.read = do_read; in wcstox() 42 f.cookie = (void*)t; in wcstox() [all …]
|
| A D | wcstol.c | 21 f->rpos = f->buf; in do_read() 22 f->rend = f->buf + i; in do_read() 26 *buf = *f->rpos++; in do_read() 35 FILE f = {}; in wcstox() local 36 f.flags = 0; in wcstox() 37 f.rpos = f.rend = 0; in wcstox() 38 f.buf = buf + 4; in wcstox() 40 f.lock = -1; in wcstox() 41 f.read = do_read; in wcstox() 44 f.cookie = (void*)t; in wcstox() [all …]
|
| /third_party/lib/acpica/source/common/ |
| A D | dmtbinfo.c | 81 #define ACPI_FACS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FACS,f) argument 84 #define ACPI_RSDP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RSDP,f) argument 85 #define ACPI_BERT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BERT,f) argument 86 #define ACPI_BGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f) argument 87 #define ACPI_BOOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f) argument 88 #define ACPI_CPEP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f) argument 89 #define ACPI_DBG2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBG2,f) argument 90 #define ACPI_DBGP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f) argument 128 #define ACPI_ASF0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_INFO,f) argument 133 #define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f) argument [all …]
|