|
PatchworkOS
|
#include "print.h"#include "common/digits.h"#include <inttypes.h>#include <limits.h>#include <stdarg.h>#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "user/common/file.h"Go to the source code of this file.
Macros | |
| #define | _DBL_SIGN(bytes) (((unsigned)bytes[7] & 0x80) >> 7) |
| #define | _DBL_DEC(bytes) ((_DBL_EXP(bytes) > 0) ? 1 : 0) |
| #define | _DBL_EXP(bytes) ((((unsigned)bytes[7] & 0x7f) << 4) | (((unsigned)bytes[6] & 0xf0) >> 4)) |
| #define | _DBL_BIAS 1023 |
| #define | _DBL_MANT_START(bytes) (bytes + 6) |
| #define | _LDBL_SIGN(bytes) (((unsigned)bytes[7] & 0x80) >> 7) |
| #define | _LDBL_DEC(bytes) ((_LDBL_EXP(bytes) > 0) ? 1 : 0) |
| #define | _LDBL_EXP(bytes) ((((unsigned)bytes[7] & 0x7f) << 4) | (((unsigned)bytes[6] & 0xf0) >> 4)) |
| #define | _LDBL_BIAS 1023 |
| #define | _LDBL_MANT_START(bytes) (bytes + 6) |
| #define | _PRINT_PUT(ctx, x) |
Functions | |
| static void | _print_hexa (int sign, int exp, int dec, unsigned char const *mant, size_t mant_dig, _format_ctx_t *ctx) |
| static void | _print_fp (int sign, int exp, int dec, unsigned char const *mant, size_t mant_dig, _format_ctx_t *ctx) |
| static void | _print_double (double value, _format_ctx_t *ctx) |
| static void | _print_ldouble (long double value, _format_ctx_t *ctx) |
| static void | _int_format (intmax_t value, _format_ctx_t *ctx) |
| static void | _print_integer (imaxdiv_t div, _format_ctx_t *ctx) |
| static void | _print_string (const char *s, _format_ctx_t *ctx) |
| const char * | _print (const char *spec, _format_ctx_t *ctx) |
| #define _DBL_EXP | ( | bytes | ) | ((((unsigned)bytes[7] & 0x7f) << 4) | (((unsigned)bytes[6] & 0xf0) >> 4)) |
| #define _DBL_SIGN | ( | bytes | ) | (((unsigned)bytes[7] & 0x80) >> 7) |
| #define _LDBL_EXP | ( | bytes | ) | ((((unsigned)bytes[7] & 0x7f) << 4) | (((unsigned)bytes[6] & 0xf0) >> 4)) |
| #define _LDBL_SIGN | ( | bytes | ) | (((unsigned)bytes[7] & 0x80) >> 7) |
| #define _PRINT_PUT | ( | ctx, | |
| x | |||
| ) |
|
static |
Definition at line 367 of file print.c.
References _PRINT_PUT, _format_ctx_t::base, _format_ctx_t::currentChars, _format_ctx_t::flags, FORMAT_ALT, FORMAT_LOWER, FORMAT_MINUS, FORMAT_PLUS, FORMAT_SPACE, FORMAT_UNSIGNED, FORMAT_ZERO, _format_ctx_t::precision, and _format_ctx_t::width.
Referenced by _print_integer().
| const char * _print | ( | const char * | spec, |
| _format_ctx_t * | ctx | ||
| ) |
Definition at line 561 of file print.c.
References _print_double(), _print_integer(), _print_ldouble(), _PRINT_PUT, _print_string(), abs(), _format_ctx_t::arg, _format_ctx_t::base, _format_ctx_t::buffer, _format_ctx_t::currentChars, div(), EOF, _format_ctx_t::flags, FORMAT_ALT, FORMAT_CHAR, FORMAT_DECIMAL, FORMAT_DONE, FORMAT_DOUBLE, FORMAT_EXPONENT, FORMAT_GENERIC, FORMAT_HEXA, FORMAT_INTMAX, FORMAT_LDOUBLE, FORMAT_LLONG, FORMAT_LONG, FORMAT_LOWER, FORMAT_MINUS, FORMAT_PLUS, FORMAT_POINTER, FORMAT_PTRDIFF, FORMAT_SHORT, FORMAT_SIZE, FORMAT_SPACE, FORMAT_UNSIGNED, FORMAT_ZERO, imaxdiv(), _format_ctx_t::maxChars, NULL, _format_ctx_t::precision, div_t::quot, div_t::rem, strtol, _format_ctx_t::totalChars, va_arg, and _format_ctx_t::width.
Referenced by vfprintf(), and vsnprintf().
|
static |
|
static |
Definition at line 270 of file print.c.
References _print_hexa(), _PRINT_PUT, _format_ctx_t::currentChars, exp(), _format_ctx_t::flags, FORMAT_DECIMAL, FORMAT_EXPONENT, FORMAT_GENERIC, FORMAT_HEXA, FORMAT_LOWER, FORMAT_MINUS, FORMAT_PLUS, FORMAT_SPACE, INT_MAX, INT_MIN, and _format_ctx_t::width.
Referenced by _print_double(), and _print_ldouble().
|
static |
Definition at line 86 of file print.c.
References _digits, _PRINT_PUT, _xdigits, _format_ctx_t::currentChars, div(), exp(), _format_ctx_t::flags, FORMAT_ALT, FORMAT_LOWER, FORMAT_MINUS, FORMAT_ZERO, _format_ctx_t::precision, div_t::quot, div_t::rem, and _format_ctx_t::width.
Referenced by _print_fp().
|
static |
Definition at line 473 of file print.c.
References _digits, _int_format(), _print_integer(), _PRINT_PUT, _xdigits, _format_ctx_t::base, _format_ctx_t::currentChars, div(), _format_ctx_t::flags, FORMAT_LOWER, imaxdiv(), _format_ctx_t::precision, div_t::quot, and div_t::rem.
Referenced by _print(), and _print_integer().
|
static |
Definition at line 349 of file print.c.
References _LDBL_BIAS, _LDBL_DEC, _LDBL_EXP, _LDBL_MANT_START, _LDBL_SIGN, _print_fp(), exp(), INT_MAX, INT_MIN, and memcpy().
Referenced by _print().
|
static |
Definition at line 508 of file print.c.
References _PRINT_PUT, _format_ctx_t::currentChars, _format_ctx_t::flags, FORMAT_CHAR, FORMAT_MINUS, _format_ctx_t::precision, strlen(), and _format_ctx_t::width.
Referenced by _print().