/picolibc-latest/newlib/libc/tinystdio/ |
D | fgetc.c | 35 fgetc(FILE *stream) in fgetc() argument 40 if ((stream->flags & __SRD) == 0) { in fgetc() 41 stream->flags |= __SERR; in fgetc() 45 if ((unget = __atomic_exchange_ungetc(&stream->unget, 0)) != 0) in fgetc() 48 rv = stream->get(stream); in fgetc() 51 stream->flags |= (rv == _FDEV_ERR)? __SERR: __SEOF; in fgetc() 64 int getc(FILE *stream) { return fgetc(stream); } in getc() argument 65 int getc_unlocked(FILE *stream) { return fgetc(stream); } in getc_unlocked() argument
|
D | fputc.c | 35 fputc(int c, FILE *stream) in fputc() argument 37 if ((stream->flags & __SWR) == 0) in fputc() 40 if (stream->put(c, stream) < 0) { in fputc() 41 stream->flags |= __SERR; in fputc() 54 int putc(int c, FILE *stream) { return fputc(c, stream); } in putc() argument 55 int putc_unlocked(int c, FILE *stream) { return fputc(c, stream); } in putc_unlocked() argument
|
D | fwrite.c | 39 fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) in fwrite() argument 44 if ((stream->flags & __SWR) == 0 || size == 0) in fwrite() 49 struct __file_bufio *bf = (struct __file_bufio *) stream; in fwrite() 51 if ((stream->flags & __SBUF) != 0 && in fwrite() 56 __bufio_lock(stream); in fwrite() 57 __bufio_setdir_locked(stream, __SWR); in fwrite() 64 int ret = __bufio_flush_locked(stream); in fwrite() 66 stream->flags |= ret; in fwrite() 79 if (__bufio_flush_locked(stream) >= 0) { in fwrite() 83 stream->flags |= _FDEV_ERR; in fwrite() [all …]
|
D | freopen.c | 39 freopen(const char *pathname, const char *mode, FILE *stream) in freopen() argument 41 struct __file_bufio *pf = (struct __file_bufio *) stream; in freopen() 47 if (!(stream->flags & __SBUF)) in freopen() 58 fflush(stream); in freopen() 60 __bufio_lock(stream); in freopen() 62 (void) __atomic_exchange_ungetc(&stream->unget, 0); in freopen() 63 stream->flags = (stream->flags & ~(__SRD|__SWR|__SERR|__SEOF)) | stdio_flags; in freopen() 73 __bufio_unlock(stream); in freopen() 75 return stream; in freopen()
|
D | fread.c | 42 fread(void *ptr, size_t size, size_t nmemb, FILE *stream) in fread() argument 48 if ((stream->flags & __SRD) == 0 || size == 0) in fread() 53 if ((stream->flags & __SBUF) != 0 && in fread() 56 struct __file_bufio *bf = (struct __file_bufio *) stream; in fread() 61 __bufio_lock(stream); in fread() 62 __bufio_setdir_locked(stream, __SRD); in fread() 65 if ((unget = __atomic_exchange_ungetc(&stream->unget, 0)) != 0) { in fread() 85 if (&stdin != NULL && &stdout != NULL && stream == stdin) { in fread() 86 __bufio_unlock(stream); in fread() 93 int ret = __bufio_fill_locked(stream); in fread() [all …]
|
D | fgetwc.c | 33 fgetwc(FILE *stream) in fgetwc() argument 43 stream->flags |= __SWIDE; in fgetwc() 45 if ((stream->flags & __SRD) == 0) in fgetwc() 48 if ((unget = __atomic_exchange_ungetc(&stream->unget, 0)) != 0) in fgetwc() 52 sc = stream->get(stream); in fgetwc() 64 wint_t getwc(FILE *stream) { return fgetwc(stream); } in getwc() argument
|
D | fputwc.c | 33 fputwc(wchar_t c, FILE *stream) in fputwc() argument 41 stream->flags |= __SWIDE; in fputwc() 43 if ((stream->flags & __SWR) == 0) in fputwc() 48 if (stream->put(u.c[i], stream) < 0) in fputwc() 57 wint_t putwc(wchar_t c, FILE *stream) { return fputwc(c, stream); } in putwc() argument
|
D | fseek.c | 43 int FSEEK(FILE *stream, FSEEK_TYPE offset, int whence) in FSEEK() argument 45 struct __file_ext *xf = (struct __file_ext *) stream; in FSEEK() 46 if ((stream->flags & __SEXT) && xf->seek) { in FSEEK() 47 if ((xf->seek) (stream, (__off_t) offset, whence) >= 0) { in FSEEK() 48 stream->flags &= ~__SEOF; in FSEEK() 49 (void) __atomic_exchange_ungetc(&stream->unget, 0); in FSEEK()
|
D | vfscanf.c | 112 scanf_getc(FILE *stream, scanf_context_t *context) in scanf_getc() argument 120 c = GETC(stream); in scanf_getc() 127 scanf_ungetc(INT c, FILE *stream, scanf_context_t *context) in scanf_ungetc() argument 132 (void) stream; in scanf_ungetc() 135 UNGETC(c, stream); in scanf_ungetc() 141 getmb(FILE *stream, scanf_context_t *context, mbstate_t *ps, uint16_t flags) in getmb() argument 153 i = scanf_getc (stream, context); in getmb() 171 i = scanf_getc(stream, context); in getmb() 253 conv_int (FILE *stream, scanf_context_t *context, width_t width, void *addr, uint16_t flags, unsign… in conv_int() argument 258 i = scanf_getc (stream, context); /* after scanf_ungetc() */ in conv_int() [all …]
|
D | fputs.c | 35 fputs(const char *str, FILE *stream) in fputs() argument 40 if ((stream->flags & __SWR) == 0) in fputs() 43 put = stream->put; in fputs() 46 if (put(c, stream) < 0) { in fputs() 47 stream->flags |= __SERR; in fputs()
|
D | ftell.c | 44 FTELL(FILE *stream) in FTELL() argument 46 struct __file_ext *xf = (struct __file_ext *) stream; in FTELL() 47 if ((stream->flags & __SEXT) && xf->seek) { in FTELL() 48 FTELL_TYPE ret = (FTELL_TYPE) (xf->seek) (stream, 0, SEEK_CUR); in FTELL() 49 if (__atomic_load_ungetc(&stream->unget) != 0) in FTELL()
|
D | vfprintf.c | 480 int vfprintf (FILE * stream, const CHAR *fmt, va_list ap_orig) in vfprintf() argument 516 #define my_putc(c, stream) do { ++stream_len; if (putwc(c, stream) == WEOF) goto fail; } while(0) in vfprintf() argument 518 int (*put)(char, FILE *) = stream->put; in vfprintf() 519 #define my_putc(c, stream) do { ++stream_len; if (put(c, stream) < 0) goto fail; } while(0) in vfprintf() argument 523 if ((stream->flags & __SWR) == 0) in vfprintf() 539 my_putc (c, stream); in vfprintf() 829 my_putc (' ', stream); in vfprintf() 836 my_putc (sign, stream); in vfprintf() 841 my_putc (TOCASE(c), stream); in vfprintf() 935 my_putc (' ', stream); in vfprintf() [all …]
|
D | fflush.c | 38 int fflush(FILE *stream) in fflush() argument 40 if (stream->flush) in fflush() 41 return (stream->flush)(stream); in fflush()
|
D | fwide.c | 39 fwide(FILE *stream, int mode) in fwide() argument 42 stream->flags = (stream->flags & ~__SWIDE) | ((mode > 0) ? __SWIDE : 0); in fwide() 43 return (stream->flags & __SWIDE) ? 1 : -1; in fwide()
|
D | ungetc.c | 35 ungetc(int c, FILE *stream) in ungetc() argument 43 if ((stream->flags & __SRD) == 0 || c == EOF) in ungetc() 46 if (!__atomic_compare_exchange_ungetc(&stream->unget, 0, (__ungetc_t) (unsigned char) c + 1 )) in ungetc() 49 stream->flags &= ~__SEOF; in ungetc()
|
D | setvbuf.c | 39 setvbuf(FILE *stream, char *buf, int mode, size_t size) in setvbuf() argument 41 struct __file_ext *xf = (struct __file_ext *) stream; in setvbuf() 42 if ((stream->flags & __SEXT) && xf->setvbuf) in setvbuf() 43 return (xf->setvbuf)(stream, buf, mode, size); in setvbuf()
|
D | ungetwc.c | 33 ungetwc(wint_t c, FILE *stream) in ungetwc() argument 41 if ((stream->flags & __SRD) == 0 || c == WEOF) in ungetwc() 44 if (!__atomic_compare_exchange_ungetc(&stream->unget, 0, (__ungetc_t) c + 1)) in ungetwc() 47 stream->flags &= ~__SEOF; in ungetwc()
|
D | rewind.c | 38 void rewind(FILE *stream) in rewind() argument 40 (void) fseek(stream, 0L, SEEK_SET); in rewind() 41 clearerr(stream); in rewind()
|
D | stdio.h | 164 #define fdev_setup_stream(stream, p, g, fl, f) \ argument 166 (stream)->flags = f; \ 167 (stream)->put = p; \ 168 (stream)->get = g; \ 169 (stream)->flush = fl; \ 200 int fflush(FILE *stream); 334 int fgetpos(FILE * __restrict stream, fpos_t * __restrict pos); 336 FILE *freopen(const char *path, const char *mode, FILE *stream); 339 int fseek(FILE *stream, long offset, int whence); 340 int fseeko(FILE *stream, __off_t offset, int whence); [all …]
|
D | fputws.c | 35 fputws(const wchar_t *str, FILE *stream) in fputws() argument 40 if ((stream->flags & __SWR) == 0) in fputws() 44 if (fputwc(c, stream) == WEOF) in fputws()
|
D | fgets.c | 35 fgets(char *str, int size, FILE *stream) in fgets() argument 40 if ((stream->flags & __SRD) == 0 || size <= 0) in fgets() 45 if ((c = getc(stream)) == EOF) { in fgets()
|
D | fgetws.c | 33 fgetws(wchar_t *str, int size, FILE *stream) in fgetws() argument 38 if ((stream->flags & __SRD) == 0 || size <= 0) in fgetws() 43 if ((c = getwc(stream)) == WEOF) in fgetws()
|
D | conv_flt.c | 201 conv_flt (FLT_STREAM *stream, FLT_CONTEXT *context, width_t width, void *addr, uint16_t flags) in conv_flt() argument 211 i = scanf_getc (stream, context); /* after scanf_ungetc() */ in conv_flt() 218 if (!CHECK_WIDTH() || (i = scanf_getc (stream, context)) < 0) in conv_flt() 237 if ((i = scanf_getc (stream, context)) >= 0) { in conv_flt() 240 scanf_ungetc (i, stream, context); in conv_flt() 249 if ((i = scanf_getc (stream, context)) == '(') { in conv_flt() 250 while (CHECK_WIDTH() && (i = scanf_getc (stream, context)) != ')') { in conv_flt() 259 scanf_ungetc (i, stream, context); in conv_flt() 353 } while (CHECK_WIDTH() && (i = scanf_getc (stream, context)) >= 0); in conv_flt() 375 esign = scanf_getc (stream, context); in conv_flt() [all …]
|
D | setlinebuf.c | 39 setlinebuf(FILE *stream) in setlinebuf() argument 41 setvbuf(stream, NULL, _IOLBF, 0); in setlinebuf()
|
/picolibc-latest/newlib/libc/stdio/ |
D | stdio.tex | 43 * Function clearerr:: Clear file or stream error indicator 48 * Function fdopen:: Turn an open file into a stream 52 * Function fgetc:: Get a character from a file or stream 53 * Function fgetpos:: Record position in a stream or file 54 * Function fgets:: Get character string from a file or stream 55 * Function fgetwc:: Get a wide character from a file or stream 56 * Function fgetws:: Get a wide character string from a file or stream 57 * Function fileno:: Get file descriptor associated with stream 58 * Function fmemopen:: Open a stream around a fixed-length buffer 60 * Function fopencookie:: Open a stream with custom callbacks [all …]
|