A simple printf utility for debug prints and cli support.
More...
|
typedef void(* | putchar_cb) (char ch) |
| Function pointer definition for put char callback.
|
|
typedef void(* | putstr_cb) (const char *str, int len) |
| Function pointer definition for put string callback.
|
|
|
void | tr_printf_init (putchar_cb putc, putstr_cb puts) |
| Initializes the printf utility.
|
|
void | tr_vsprintf (char *buf, int maxlen, const char *fmt, const va_list args) |
| Write formated data from variable argument list to string.
|
|
void | tr_printf (const char *fmt,...) |
| Writes the passed in C string to the standard output (stdout).
|
|
A simple printf utility for debug prints and cli support.
◆ putchar_cb
typedef void(* putchar_cb) (char ch) |
Function pointer definition for put char callback.
◆ putstr_cb
typedef void(* putstr_cb) (const char *str, int len) |
Function pointer definition for put string callback.
◆ tr_printf()
void tr_printf |
( |
const char * | fmt, |
|
|
| ... ) |
Writes the passed in C string to the standard output (stdout).
- Parameters
-
[in] | fmt | C string that contains the text to be written to stdout. |
[in] | ... | Depends on the format string |
◆ tr_printf_init()
Initializes the printf utility.
- Parameters
-
[in] | putc | Function pointer to a putc function used for writing a single byte. |
[in] | puts | Function pointer to a puts function used for writing a string of bytes. |
◆ tr_vsprintf()
void tr_vsprintf |
( |
char * | buf, |
|
|
int | maxlen, |
|
|
const char * | fmt, |
|
|
const va_list | args ) |
Write formated data from variable argument list to string.
- Parameters
-
[in] | buf | Pointer to a buffer where the resulting C-string is stored. The buffer should be large enough to contain the resulting string. |
[in] | maxlen | The max len of the buffer. |
[in] | fmt | A printf formatted C string. |
[in] | args | A value identifying a variable argument list initialized with va_start(). |