|
| template<class T, std::same_as< T >... Args> |
| constexpr auto | make_kflags (const Args... flags) noexcept -> kFlags< T > |
| | Flags creation helper function from set flags.
|
| constexpr auto | kudivmod64 (const igros_quad_t dividend, const igros_quad_t divisor) noexcept -> divmod_t< igros_quad_t > |
| | 64-bit unsigned division for 32-bit CPU (no 64-bit "/" and "%" without libgcc __udivdi3/__umoddi3)
|
template<std::integral T, std::integral D>
requires kdivisible<T, D> |
| constexpr auto | kdivmod (const T dividend, const D divisor) noexcept -> divmod_t< T > |
| | Divide integer by integer of the same signedness.
|
| auto | kvsnprintf (char *const buffer, const igros_usize_t size, const char *const format, std::va_list list) noexcept -> igros_usize_t |
| | Kernel vsnprintf function (returns written length without terminator).
|
| auto | ksnprintf (char *const buffer, const igros_usize_t size, const char *const format,...) noexcept -> igros_usize_t |
| | Kernel snprintf function (returns written length without terminator).
|
| void | kprintf (const char *const format,...) noexcept |
| | Kernel printf function (arguments are checked against format at compile time).
|
| template<std::unsigned_integral U> |
| constexpr auto | kdigits (const std::span< char > buffer, U value, const radix_t radix, const bool upper=false) noexcept -> std::string_view |
| | Digits of unsigned value written to the end of buffer (no sign, no terminator).
|
| constexpr auto | kstrview (const char *const src) noexcept -> std::string_view |
| | View of null-terminated string (null pointer is empty string).
|
Freestanding kernel library: printing, math, alignment, flags, strings.
IgrOS Kernel Library namespace.
template<std::unsigned_integral U>
| auto igros::klib::kdigits |
( |
const std::span< char > | buffer, |
|
|
U | value, |
|
|
const radix_t | radix, |
|
|
const bool | upper = false )->std::string_view |
|
nodiscardconstexprnoexcept |
Digits of unsigned value written to the end of buffer (no sign, no terminator).
Buffer must fit all digits (std::numeric_limits<U>::digits for binary)
- Template Parameters
-
- Parameters
-
| buffer | Output buffer (digits end at its end) |
| value | Value |
| radix | Radix |
| upper | Uppercase hexadecimal digits |
- Returns
- View of written digits (inside buffer)
Definition at line 54 of file kPrint.hpp.
template<std::integral T, std::integral D>
requires kdivisible<T, D>
| auto igros::klib::kdivmod |
( |
const T | dividend, |
|
|
const D | divisor )->divmod_t< T > |
|
nodiscardconstexprnoexcept |
Divide integer by integer of the same signedness.
Returns quotient (truncated towards zero) and remainder (sign of dividend), like C++ "/" and "%" Divisor must not be zero (traps like native division, except software 64-bit division on i386)
- Template Parameters
-
| T | Dividend type |
| D | Divisor type (same signedness) |
- Parameters
-
| dividend | Dividend |
| divisor | Divisor (not zero) |
- Returns
- Quotient and remainder
Definition at line 115 of file kMath.hpp.