|
PatchworkOS
|
#include <stdarg.h>#include "_internal/MAX_PATH.h"#include "_internal/NULL.h"#include "_internal/SEEK.h"#include "_internal/config.h"#include "_internal/fd_t.h"#include "_internal/size_t.h"Go to the source code of this file.
Macros | |
| #define | _IOFBF (1u << 0) |
| #define | _IOLBF (1u << 1) |
| #define | _IONBF (1u << 2) |
| #define | EOF (-1) |
| #define | BUFSIZ 1024 |
| #define | FOPEN_MAX 8 |
| #define | FILENAME_MAX MAX_PATH |
| #define | L_tmpnam 46 |
| #define | TMP_MAX 50 |
Typedefs | |
| typedef struct fpos | fpos_t |
Functions | |
| _PUBLIC int | remove (const char *filename) |
| _PUBLIC int | rename (const char *oldpath, const char *newpath) |
| _PUBLIC FILE * | tmpfile (void) |
| _PUBLIC char * | tmpnam (char *s) |
| _PUBLIC int | fclose (FILE *stream) |
| _PUBLIC int | fflush (FILE *stream) |
| _PUBLIC FILE * | fopen (const char *_RESTRICT filename, const char *_RESTRICT mode) |
| _PUBLIC FILE * | freopen (const char *_RESTRICT filename, const char *_RESTRICT mode, FILE *_RESTRICT stream) |
| _PUBLIC void | setbuf (FILE *_RESTRICT stream, char *_RESTRICT buf) |
| _PUBLIC int | setvbuf (FILE *_RESTRICT stream, char *_RESTRICT buf, int mode, size_t size) |
| _PUBLIC int | fprintf (FILE *_RESTRICT stream, const char *_RESTRICT format,...) |
| _PUBLIC int | fscanf (FILE *_RESTRICT stream, const char *_RESTRICT format,...) |
| _PUBLIC int | printf (const char *_RESTRICT format,...) |
| _PUBLIC int | scanf (const char *_RESTRICT format,...) |
| _PUBLIC int | snprintf (char *_RESTRICT s, size_t n, const char *_RESTRICT format,...) |
| _PUBLIC int | sprintf (char *_RESTRICT s, const char *_RESTRICT format,...) |
| _PUBLIC int | sscanf (const char *_RESTRICT s, const char *_RESTRICT format,...) |
| _PUBLIC int | vfprintf (FILE *_RESTRICT stream, const char *_RESTRICT format, va_list arg) |
| _PUBLIC int | vfscanf (FILE *_RESTRICT stream, const char *_RESTRICT format, va_list arg) |
| _PUBLIC int | vprintf (const char *_RESTRICT format, va_list arg) |
| _PUBLIC int | vscanf (const char *_RESTRICT format, va_list arg) |
| _PUBLIC int | vsnprintf (char *_RESTRICT s, size_t n, const char *_RESTRICT format, va_list arg) |
| _PUBLIC int | vsprintf (char *_RESTRICT s, const char *_RESTRICT format, va_list arg) |
| _PUBLIC int | vsscanf (const char *_RESTRICT s, const char *_RESTRICT format, va_list arg) |
| _PUBLIC int | fgetc (FILE *stream) |
| _PUBLIC char * | fgets (char *_RESTRICT s, int n, FILE *_RESTRICT stream) |
| _PUBLIC int | fputc (int c, FILE *stream) |
| _PUBLIC int | fputs (const char *_RESTRICT s, FILE *_RESTRICT stream) |
| _PUBLIC int | getc (FILE *stream) |
| _PUBLIC int | getchar (void) |
| _PUBLIC int | putc (int c, FILE *stream) |
| _PUBLIC int | putchar (int c) |
| _PUBLIC int | puts (const char *s) |
| _PUBLIC int | ungetc (int c, FILE *stream) |
| _PUBLIC size_t | fread (void *_RESTRICT ptr, size_t size, size_t nmemb, FILE *_RESTRICT stream) |
| _PUBLIC size_t | fwrite (const void *_RESTRICT ptr, size_t size, size_t nmemb, FILE *_RESTRICT stream) |
| _PUBLIC int | fgetpos (FILE *_RESTRICT stream, fpos_t *_RESTRICT pos) |
| _PUBLIC int | fseek (FILE *stream, long int offset, int whence) |
| _PUBLIC int | fsetpos (FILE *stream, const fpos_t *pos) |
| _PUBLIC long int | ftell (FILE *stream) |
| _PUBLIC void | rewind (FILE *stream) |
| _PUBLIC void | clearerr (FILE *stream) |
| _PUBLIC int | feof (FILE *stream) |
| _PUBLIC int | ferror (FILE *stream) |
| _PUBLIC void | perror (const char *s) |
Variables | |
| FILE * | stdin |
| FILE * | stdout |
| FILE * | stderr |
Definition at line 5 of file clearerr.c.
References _FILE_EOF, _FILE_ERROR, and FILE::flags.
Definition at line 7 of file fclose.c.
References _file_deinit(), _file_flush_buffer(), _file_free(), _FILE_WRITE, _files_remove(), EOF, ERR, FILE::flags, FILE::mtx, mtx_lock(), and mtx_unlock().
Referenced by _files_close(), config_open(), cpu_stat_count_cpus(), cpu_stat_read(), and mem_stat_read().
Definition at line 5 of file feof.c.
References _FILE_EOF, and FILE::flags.
Referenced by vfscanf().
Definition at line 5 of file ferror.c.
References _FILE_ERROR, and FILE::flags.
Referenced by vfscanf().
Definition at line 6 of file fflush.c.
References _file_flush_buffer(), _files_flush(), EOF, ERR, FILE::mtx, mtx_lock(), mtx_unlock(), and NULL.
Referenced by _files_flush(), benchmark(), interactive_handle_ansi(), interactive_prompt(), stats_print(), and terminal_columns_get().
Definition at line 7 of file fgetc.c.
References _FILE_CHECK_AVAIL, _FILE_GETC, _file_prepare_read(), EOF, ERR, FILE::mtx, mtx_lock(), and mtx_unlock().
Definition at line 5 of file fgets.c.
References _FILE_CHECK_AVAIL, _FILE_GETC, _file_prepare_read(), ERR, mtx_lock(), mtx_unlock(), and NULL.
Referenced by config_open(), cpu_stat_count_cpus(), and cpu_stat_read().
Definition at line 27 of file fopen.c.
References _file_flags_parse(), _file_free(), _FILE_FULLY_BUFFERED, _file_init(), _file_new(), _files_push(), _flags_to_string(), BUFSIZ, close(), EINVAL, ENOMEM, ERR, errno, NULL, and openf().
Referenced by config_open(), cpu_stat_count_cpus(), cpu_stat_read(), and mem_stat_read().
Definition at line 5 of file fprintf.c.
References va_end, va_start, and vfprintf().
Referenced by _files_init(), _std_stream_init(), abort_handler_s(), builtin_cd(), main(), main(), perror(), pipeline_execute_cmd(), print_dir(), and thrd_exit().
Definition at line 7 of file fputc.c.
References _file_flush_buffer(), _FILE_LINE_BUFFERED, _file_prepare_write(), _FILE_UNBUFFERED, FILE::buf, FILE::bufIndex, FILE::bufSize, EOF, ERR, FILE::flags, FILE::mtx, mtx_lock(), and mtx_unlock().
Definition at line 5 of file fputs.c.
References _file_flush_buffer(), _FILE_LINE_BUFFERED, _file_prepare_write(), _FILE_UNBUFFERED, EOF, ERR, mtx_lock(), and mtx_unlock().
Referenced by _assert_89(), and _assert_99().
Definition at line 7 of file fread.c.
References _FILE_CHECK_AVAIL, _FILE_GETC, _file_prepare_read(), ERR, mtx_lock(), and mtx_unlock().
| _PUBLIC FILE * freopen | ( | const char *_RESTRICT | filename, |
| const char *_RESTRICT | mode, | ||
| FILE *_RESTRICT | stream | ||
| ) |
Definition at line 7 of file ftell.c.
References FILE::bufEnd, FILE::bufIndex, ERANGE, errno, LONG_MAX, FILE::mtx, mtx_lock(), mtx_unlock(), fpos_t::offset, FILE::pos, and FILE::ungetIndex.
| _PUBLIC size_t fwrite | ( | const void *_RESTRICT | ptr, |
| size_t | size, | ||
| size_t | nmemb, | ||
| FILE *_RESTRICT | stream | ||
| ) |
Definition at line 8 of file fwrite.c.
References _file_flush_buffer(), _FILE_LINE_BUFFERED, _file_prepare_write(), _FILE_UNBUFFERED, ERR, memmove(), mtx_lock(), and mtx_unlock().
| _PUBLIC void perror | ( | const char * | s | ) |
Definition at line 5 of file perror.c.
References errno, fprintf(), NULL, stderr, and strerror().
Referenced by benchmark_mmap(), client_receive_cmds(), and client_send_all().
Definition at line 5 of file printf.c.
References stdout, va_end, va_start, and vfprintf().
Referenced by backbuffer_init(), benchmark(), benchmark_mmap(), builtin_clear(), builtin_help(), client_process_cmds(), client_receive_cmds(), dwm_attach(), dwm_client_accept(), dwm_client_disconnect(), dwm_detach(), dwm_init(), dwm_kbd_read(), dwm_mouse_read(), dwm_poll(), dwm_poll_ctx_update(), dwm_update(), execute_commands(), free(), frontbuffer_init(), interactive_execute_command(), interactive_handle_ansi(), interactive_handle_input(), interactive_prompt(), interactive_shell(), main(), main(), main(), pipeline_execute(), pipeline_execute_cmd(), pipeline_init(), print_dir(), print_stat(), procedure(), read_fd(), realloc(), screen_swap(), screen_transfer_frontbuffer(), spawn_program(), start_menu_load_entries(), start_menu_new(), start_services(), startmenu_procedure(), stats_print(), stats_update(), surface_new(), taskbar_new(), taskbar_procedure(), taskbar_update_clock(), terminal_columns_get(), and theme_lazy_load().
| _PUBLIC int putchar | ( | int | c | ) |
| _PUBLIC int puts | ( | const char * | s | ) |
| _PUBLIC int remove | ( | const char * | filename | ) |
Definition at line 6 of file remove.c.
References _syscall_errno(), _syscall_remove(), EOF, ERR, and errno.
Referenced by main().
| _PUBLIC int rename | ( | const char * | oldpath, |
| const char * | newpath | ||
| ) |
Definition at line 5 of file rename.c.
References _syscall_errno(), _syscall_link(), _syscall_remove(), EOF, ERR, and errno.
Referenced by main().
Definition at line 3 of file snprintf.c.
References va_end, va_start, and vsnprintf().
Referenced by acpi_tables_expose(), aml_convert_to_decimal_string(), aml_convert_to_hex_string(), aml_name_string_to_string(), aml_object_to_string(), config_open(), dentry_generic_getdents(), fb_new(), getdents_recursive_traversal(), kbd_new(), mouse_new(), process_new(), process_prio_read(), process_procfs_init(), process_wait_read(), socket_new(), start_menu_load_entries(), ternminal_execute_ansi(), and theme_lazy_load().
Definition at line 5 of file sprintf.c.
References SIZE_MAX, va_end, va_start, and vsnprintf().
Referenced by log_print_header(), pipeline_execute_cmd(), procedure(), startmenu_procedure(), statistics_cpu_read(), statistics_mem_read(), and taskbar_update_clock().
Definition at line 4 of file sscanf.c.
References va_end, va_start, and vsscanf().
Referenced by cpu_stat_read(), and terminal_columns_get().
| _PUBLIC char * tmpnam | ( | char * | s | ) |
Definition at line 5 of file ungetc.c.
References _UNGETC_MAX, EOF, FILE::mtx, mtx_lock(), mtx_unlock(), FILE::ungetBuf, and FILE::ungetIndex.
Referenced by _scan_unget(), and vfscanf().
Definition at line 8 of file vfprintf.c.
References _file_flush_buffer(), _FILE_LINE_BUFFERED, _file_prepare_write(), _FILE_UNBUFFERED, _print(), _format_ctx_t::arg, _format_ctx_t::base, _format_ctx_t::buffer, _format_ctx_t::currentChars, EOF, ERR, _format_ctx_t::flags, _format_ctx_t::maxChars, mtx_lock(), mtx_unlock(), NULL, _format_ctx_t::precision, SIZE_MAX, _format_ctx_t::stream, _format_ctx_t::totalChars, va_copy, va_end, and _format_ctx_t::width.
Definition at line 8 of file vfscanf.c.
References _FILE_CHECK_AVAIL, _file_prepare_read(), _scan(), _format_ctx_t::arg, _format_ctx_t::base, _format_ctx_t::buffer, _format_ctx_t::currentChars, EOF, ERR, feof(), ferror(), _format_ctx_t::flags, getc(), isspace(), _format_ctx_t::maxChars, mtx_lock(), mtx_unlock(), NULL, _format_ctx_t::precision, _format_ctx_t::stream, _format_ctx_t::totalChars, ungetc(), va_copy, va_end, and _format_ctx_t::width.
Referenced by fscanf().
Definition at line 5 of file vprintf.c.
References stdout, and vfprintf().
Definition at line 5 of file vsnprintf.c.
References _print(), _format_ctx_t::arg, _format_ctx_t::base, _format_ctx_t::buffer, _format_ctx_t::currentChars, EOF, _format_ctx_t::flags, _format_ctx_t::maxChars, NULL, _format_ctx_t::precision, _format_ctx_t::stream, _format_ctx_t::totalChars, va_copy, va_end, and _format_ctx_t::width.
Referenced by log_vprint(), openf(), panic(), snprintf(), sprintf(), vopenf(), vremovef(), vsprintf(), and vwritef().
Definition at line 5 of file vsprintf.c.
References SIZE_MAX, and vsnprintf().
Definition at line 7 of file vsscanf.c.
References _scan(), _format_ctx_t::arg, _format_ctx_t::base, _format_ctx_t::buffer, _format_ctx_t::currentChars, EOF, _format_ctx_t::flags, isspace(), _format_ctx_t::maxChars, NULL, _format_ctx_t::precision, _format_ctx_t::stream, _format_ctx_t::totalChars, va_copy, va_end, and _format_ctx_t::width.
|
extern |
Definition at line 18 of file std_streams.c.
Referenced by _assert_89(), _assert_99(), _file_free(), _files_init(), _std_stream_init(), _std_streams_init(), abort_handler_s(), builtin_cd(), main(), main(), perror(), pipeline_execute_cmd(), print_dir(), and thrd_exit().
|
extern |
Definition at line 16 of file std_streams.c.
Referenced by _file_free(), _std_streams_init(), and getchar().
|
extern |
Definition at line 17 of file std_streams.c.
Referenced by _file_free(), _std_streams_init(), benchmark(), interactive_handle_ansi(), interactive_prompt(), printf(), putchar(), puts(), stats_print(), terminal_columns_get(), and vprintf().