#include <stdio.h>
#include <ctype.h>
#include <inttypes.h>
#include <round.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | vsnprintf_aux |
struct | printf_conversion |
struct | integer_base |
Functions | |
static void | vsnprintf_helper (char, void *) |
int | vsnprintf (char *buffer, size_t buf_size, const char *format, va_list args) |
int | snprintf (char *buffer, size_t buf_size, const char *format,...) |
int | printf (const char *format,...) |
static const char * | parse_conversion (const char *format, struct printf_conversion *, va_list *) |
static void | format_integer (uintmax_t value, bool is_signed, bool negative, const struct integer_base *, const struct printf_conversion *, void(*output)(char, void *), void *aux) |
static void | output_dup (char ch, size_t cnt, void(*output)(char, void *), void *aux) |
static void | format_string (const char *string, int length, struct printf_conversion *, void(*output)(char, void *), void *aux) |
void | __vprintf (const char *format, va_list args, void(*output)(char, void *), void *aux) |
void | __printf (const char *format, void(*output)(char, void *), void *aux,...) |
void | hex_dump (uintptr_t ofs, const void *buf_, size_t size, bool ascii) |
void | print_human_readable_size (uint64_t size) |
Variables | |
static struct integer_base | base_d = {10, "0123456789", 0, 3} |
static struct integer_base | base_o = {8, "01234567", 0, 3} |
static struct integer_base | base_x = {16, "0123456789abcdef", 'x', 4} |
static struct integer_base | base_X = {16, "0123456789ABCDEF", 'X', 4} |
void __printf | ( | const char * | format, | |
void(*)(char, void *) | output, | |||
void * | aux, | |||
... | ||||
) |
Definition at line 578 of file stdio.c.
References __vprintf(), va_end, and va_start.
Referenced by __vprintf().
void __vprintf | ( | const char * | format, | |
va_list | args, | |||
void(*)(char, void *) | output, | |||
void * | aux | |||
) |
Definition at line 158 of file stdio.c.
References __printf(), printf_conversion::CHAR, printf_conversion::flags, format_integer(), format_string(), printf_conversion::INT, printf_conversion::INTMAX, printf_conversion::LONG, printf_conversion::LONGLONG, NOT_REACHED, NULL, parse_conversion(), printf_conversion::precision, PTRDIFF_MAX, printf_conversion::PTRDIFFT, s, printf_conversion::SHORT, SIZE_MAX, printf_conversion::SIZET, strnlen(), printf_conversion::type, and va_arg.
Referenced by __printf(), vhprintf(), vprintf(), and vsnprintf().
static void format_integer | ( | uintmax_t | value, | |
bool | is_signed, | |||
bool | negative, | |||
const struct integer_base * | b, | |||
const struct printf_conversion * | c, | |||
void(*)(char, void *) | output, | |||
void * | aux | |||
) | [static] |
Definition at line 471 of file stdio.c.
References integer_base::base, buf, integer_base::digits, printf_conversion::flags, integer_base::group, output_dup(), printf_conversion::precision, printf_conversion::width, integer_base::x, and x.
Referenced by __vprintf().
static void format_string | ( | const char * | string, | |
int | length, | |||
struct printf_conversion * | c, | |||
void(*)(char, void *) | output, | |||
void * | aux | |||
) | [static] |
Definition at line 562 of file stdio.c.
References printf_conversion::flags, output_dup(), and printf_conversion::width.
Referenced by __vprintf().
Definition at line 594 of file stdio.c.
References buf, isprint(), printf(), ROUND_DOWN, and start.
Referenced by bitmap_dump(), compare_bytes(), fsutil_cat(), main(), uhci_tx_pkt_wait(), and usb_load_config().
static void output_dup | ( | char | ch, | |
size_t | cnt, | |||
void(*)(char, void *) | output, | |||
void * | aux | |||
) | [static] |
static const char * parse_conversion | ( | const char * | format, | |
struct printf_conversion * | c, | |||
va_list * | args | |||
) | [static] |
Definition at line 341 of file stdio.c.
References printf_conversion::flags, isdigit(), printf_conversion::precision, printf_conversion::type, va_arg, and printf_conversion::width.
Referenced by __vprintf().
void print_human_readable_size | ( | uint64_t | size | ) |
Definition at line 643 of file stdio.c.
References NULL, printf(), and PRIu64.
Referenced by block_register(), and identify_ata_device().
int printf | ( | const char * | format, | |
... | ||||
) |
Definition at line 80 of file stdio.c.
References va_end, va_start, and vprintf().
Referenced by archive_directory(), archive_file(), archive_ordinary_file(), backspace(), block_print_stats(), block_register(), check_free_list_size(), checkf(), console_print_stats(), debug_backtrace(), debug_panic(), do_format(), do_write(), dump_all_qh(), dump_qh(), dump_regs(), ehci_init(), exception_print_stats(), fail(), found_partition(), fsutil_append(), fsutil_cat(), fsutil_extract(), fsutil_ls(), fsutil_rm(), hex_dump(), identify_ata_device(), init_pool(), interrupt_handler(), intr_dump_frame(), kbd_print_stats(), kill(), list_dir(), load(), main(), make_tar_archive(), msc_attached(), msc_io(), msg(), page_fault(), partition_scan(), pass(), pci_print_dev_info(), pci_setup_io(), power_off(), print_human_readable_size(), print_stacktrace(), read_command_line(), read_partition_table(), reboot(), run_task(), sema_self_test(), send_status(), syscall_handler(), test(), test_priority_fifo(), thread_print_stats(), timer_calibrate(), timer_print_stats(), uhci_init(), uhci_remove_stalled(), uhci_stall_watchdog(), uhci_tx_pkt_wait(), usage(), usb_configure_default(), usb_dev_setup(), usb_init(), usb_load_config(), usb_scan_devices(), ustar_make_header(), wait_until_idle(), and wait_while_busy().
int snprintf | ( | char * | buffer, | |
size_t | buf_size, | |||
const char * | format, | |||
... | ||||
) |
Definition at line 63 of file stdio.c.
References va_end, va_start, and vsnprintf().
Referenced by exec_children(), found_partition(), ide_init(), identify_ata_device(), list_dir(), main(), make_tree(), msc_attached(), remove_tree(), sort_chunks(), spawn_child(), test_alarm_priority(), test_main(), test_mlfqs_fair(), test_mlfqs_load_60(), test_mlfqs_load_avg(), test_priority_condvar(), test_priority_donate_chain(), test_priority_fifo(), test_priority_sema(), test_sleep(), ustar_make_header(), and vmsg().
Definition at line 27 of file stdio.c.
References __vprintf(), vsnprintf_aux::length, vsnprintf_aux::max_length, vsnprintf_aux::p, and vsnprintf_helper().
Referenced by checkf(), do_mkdir(), do_remove(), do_touch(), snprintf(), and vmsg().
static void vsnprintf_helper | ( | char | ch, | |
void * | aux_ | |||
) | [static] |
Definition at line 47 of file stdio.c.
References vsnprintf_aux::length, vsnprintf_aux::max_length, and vsnprintf_aux::p.
Referenced by vsnprintf().
struct integer_base base_d = {10, "0123456789", 0, 3} [static] |
struct integer_base base_o = {8, "01234567", 0, 3} [static] |
struct integer_base base_X = {16, "0123456789ABCDEF", 'X', 4} [static] |
struct integer_base base_x = {16, "0123456789abcdef", 'x', 4} [static] |