![]() |
Xyris
0.5
|
Go to the source code of this file.
Macros | |
#define | STACK_WIDTH sizeof(int) |
#define | TYPE_WIDTH(TYPE) ((sizeof(TYPE) + STACK_WIDTH - 1) & ~(STACK_WIDTH - 1)) |
#define | PR_BUFLEN 32 |
Enumerations | |
enum | printf_state { PR_LJ = 0b000000001, PR_CA = 0b000000010, PR_SG = 0b000000100, PR_64 = 0b000001000, PR_32 = 0b000010000, PR_16 = 0b000100000, PR_WS = 0b001000000, PR_LZ = 0b010000000, PR_FP = 0b100000000 } |
Functions | |
int | printf_helper (const char *fmt, va_list args, printf_cb_fnptr_t fn, void *ptr) |
int | kvsprintf (char *buf, const char *fmt, va_list args) |
int | ksprintf (char *buf, const char *fmt,...) |
A printf implementation released under the public domain.
http://www.osdev.labedz.org/src/lib/stdio/printf.c
Definition in file printf.cpp.
#define PR_BUFLEN 32 |
Definition at line 97 of file printf.cpp.
#define STACK_WIDTH sizeof(int) |
Definition at line 76 of file printf.cpp.
#define TYPE_WIDTH | ( | TYPE | ) | ((sizeof(TYPE) + STACK_WIDTH - 1) & ~(STACK_WIDTH - 1)) |
Definition at line 80 of file printf.cpp.
enum printf_state |
Enumerator | |
---|---|
PR_LJ | |
PR_CA | |
PR_SG | |
PR_64 | |
PR_32 | |
PR_16 | |
PR_WS | |
PR_LZ | |
PR_FP |
Definition at line 83 of file printf.cpp.
int ksprintf | ( | char * | buf, |
const char * | fmt, | ||
... | |||
) |
Sends formatted output to a string.
buf | Pointer to a buffer where the result is stored |
fmt | C string that contains a format string |
... | Sequence of additional arguments |
Definition at line 342 of file printf.cpp.
int kvsprintf | ( | char * | buf, |
const char * | fmt, | ||
va_list | args | ||
) |
Sends formatted output to a string using an argument list.
buf | Pointer to a buffer where the result is stored |
fmt | C string that contains a format string |
args | A value identifying a variable arguments list |
Definition at line 333 of file printf.cpp.
int printf_helper | ( | const char * | fmt, |
va_list | args, | ||
printf_cb_fnptr_t | fn, | ||
void * | ptr | ||
) |
Perform all printf operations on the format string using the provided argument list and uses the callback function to perform the character printing operation. This allows for adding printf capabilities to a wide range of text output applications, such as an RS232 debug driver, or a framebuffer console.
fmt | Format string |
args | Arguments list |
fn | Character printing callback function pointer |
ptr | User-provided data / handle pointer |
Definition at line 105 of file printf.cpp.