Declarations for functions implementing libc stdio functions. More...
Go to the source code of this file.
Macros | |
#define | EOF -1 |
Functions | |
int | setvbuf (void *stream, char *buf, int mode, size_t size) |
int | putchar (int c) |
int | puts (const char *s) |
int | printf (const char *fmt,...) |
int | sprintf (char *s, const char *fmt,...) |
int | snprintf (char *s, size_t size, const char *fmt,...) |
Declarations for functions implementing libc stdio functions.
Using EMBTEXTF_PROVIDE_LIBC embtextf can provide implementations for standard libc functions such as printf(), puts(), etc. based on an application-provided putchar() implementation.
These functions are provided: printf(), sprintf(), snprintf(), setvbuf()
These functions are required: putchar()
These functions are not provided: fprintf(), fputc(), fputs(), putc()
Stream-oriented functions (viz. those that reference a libc FILE
object) are not included as one might conceivably want to use FILE
to hold the embtextf_putchar_fn instance that is used to perform output to that stream. If such an interface is desired it can be provided by the application.
libembtextf-libc.a
along with libembtextf
to incorporate the libc-related function wrappers into your application.#define EOF -1 |
int printf | ( | const char * | fmt, |
... | |||
) |
ISO C standard function based on embtextf_vuprintf() dependent on EMBTEXTF_PROVIDE_LIBC.
int putchar | ( | int | c | ) |
Write a single character, cast to an unsigned char, to an output device.
c | the character to be emitted. |
int puts | ( | const char * | s | ) |
ISO C standard function based on putchar() dependent on EMBTEXTF_PROVIDE_LIBC.
s | the string to be written. The terminating NUL is not emitted. |
int setvbuf | ( | void * | stream, |
char * | buf, | ||
int | mode, | ||
size_t | size | ||
) |
Declaration for stream-dependent function
This function is defined at the link-level because some BSPs (e.g. for Energy Micro's chips) assume it is available when using GCC and newlib. Since a major purpose of this module is to bypass newlib's bloated i/o infrastructure we stub the function so that it's ignored.
Note that because the real function prototype depends on FILE
and we don't know that type we're describing the corresponding argument as if it were a pointer-to-void; in fact, this prototype is present only in the documentation, not in the actual header used when building the library or applications that use it. We assume that at the binary interface level a pointer-to-void will be passed in the same manner as a pointer-to-FILE
.
The implementation does nothing but return EOF.
int snprintf | ( | char * | s, |
size_t | size, | ||
const char * | fmt, | ||
... | |||
) |
ISO C standard function based on embtextf_vuprintf() dependent on EMBTEXTF_PROVIDE_LIBC.
int sprintf | ( | char * | s, |
const char * | fmt, | ||
... | |||
) |
ISO C standard function based on embtextf_vuprintf() dependent on EMBTEXTF_PROVIDE_LIBC.