#include <stdarg.h>
#include <stddef.h>
Go to the source code of this file.
|
void | _putchar (char character) |
|
int | fctprintf (void(*out)(char character, void *arg), void *arg, const char *format,...) |
|
int | printf_ (const char *format,...) |
|
int | snprintf_ (char *buffer, size_t count, const char *format,...) |
|
int | sprintf_ (char *buffer, const char *format,...) |
|
int | vprintf_ (const char *format, va_list va) |
|
int | vsnprintf_ (char *buffer, size_t count, const char *format, va_list va) |
|
◆ _PRINTF_H_
◆ printf [1/2]
Tiny printf implementation You have to implement putchar if you use printf() To avoid conflicts with the regular printf() API it is overridden by macro defines and internal underscore-appended functions like printf() are used
- Parameters
-
format | A string that specifies the format of the output |
- Returns
- The number of characters that are written into the array, not counting the terminating null character
Definition at line 61 of file test_suite.cpp.
◆ printf [2/2]
◆ snprintf [1/2]
◆ snprintf [2/2]
Tiny SNPRINTF/vsnprintf implementation
- Parameters
-
buffer | A pointer to the buffer where to store the formatted string |
count | The maximum number of characters to store in the buffer, including a terminating null character |
format | A string that specifies the format of the output |
va | A value identifying a variable arguments list |
- Returns
- The number of characters that COULD have been written into the buffer, not counting the terminating null character. A value equal or larger than count indicates truncation. Only when the returned value is non-negative and less than count, the string has been completely written.
Definition at line 86 of file test_suite.cpp.
◆ sprintf [1/2]
◆ sprintf [2/2]
Tiny sprintf implementation Due to security reasons (buffer overflow) YOU SHOULD CONSIDER USING (V)SNPRINTF INSTEAD!
- Parameters
-
buffer | A pointer to the buffer where to store the formatted string. MUST be big enough to store the output! |
format | A string that specifies the format of the output |
- Returns
- The number of characters that are WRITTEN into the buffer, not counting the terminating null character
Definition at line 72 of file test_suite.cpp.
◆ vprintf [1/2]
Tiny vprintf implementation
- Parameters
-
format | A string that specifies the format of the output |
va | A value identifying a variable arguments list |
- Returns
- The number of characters that are WRITTEN into the buffer, not counting the terminating null character
Definition at line 98 of file test_suite.cpp.
◆ vprintf [2/2]
◆ vsnprintf [1/2]
◆ vsnprintf [2/2]
◆ _putchar()
void _putchar |
( |
char |
character | ) |
|
Output a character to a custom device like UART, used by the printf() function This function is declared here only. You have to write your custom implementation somewhere
- Parameters
-
character | Character to output |
◆ fctprintf()
int fctprintf |
( |
void(*)(char character, void *arg) |
out, |
|
|
void * |
arg, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
printf with output function You may use this as dynamic alternative to printf() with its fixed _putchar() output
- Parameters
-
out | An output function which takes one character and an argument pointer |
arg | An argument pointer for user data passed to output function |
format | A string that specifies the format of the output |
- Returns
- The number of characters that are sent to the output function, not counting the terminating null character
Definition at line 906 of file printf.c.
◆ printf_()
int printf_ |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ snprintf_()
int snprintf_ |
( |
char * |
buffer, |
|
|
size_t |
count, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ sprintf_()
int sprintf_ |
( |
char * |
buffer, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ vprintf_()
int vprintf_ |
( |
const char * |
format, |
|
|
va_list |
va |
|
) |
| |
◆ vsnprintf_()
int vsnprintf_ |
( |
char * |
buffer, |
|
|
size_t |
count, |
|
|
const char * |
format, |
|
|
va_list |
va |
|
) |
| |