Index
Records
Functions
path_validate_char
_Bool path_validate_char(char ch)
path_validate
_Bool path_validate(const char * path)
path_parse
_Bool path_parse(const char * source, char * volume, const char ** path)
path_basename
const char * path_basename(const char * path)
putchar_
void putchar_(char c)
Prints/send a single character to some opaque output entity
note This function is not implemented by the library, only declared; you must provide an implementation if you wish to use the ref / ref function (and possibly for linking against the library, if your toolchain does not support discarding unused functions)
note The output could be as simple as a wrapper for the write() system call on a Unix-like * system, or even libc's ref , for replicating actual functionality of libc's ref * function; but on an embedded system it may involve interaction with a special output device, like a UART, etc.
note in libc's ref the parameter type is an int; this was intended to support the representation of either a proper character or EOF in a variable - but this is really not meaningful to pass into ref and is discouraged today. See further discussion in:
https://stackoverflow.com/q/17452847/1593077
@param c the single character to print
printf
int printf(const char * format)
An implementation of the C standard's printf/vprintf
note you must implement a ref function for using this function - it invokes ref * rather than directly performing any I/O (which insulates it from any dependence on the operating system * and external libraries).
format A string specifying the format of the output, with %-marked specifiers of how to interpret additional arguments.
arg Additional arguments to the function, one for each %-specifier inp
return The number of characters written into p not counting the terminating null character
@{
vprintf
int vprintf(const char * format, va_list arg)
sprintf
int sprintf(char * s, const char * format)
An implementation of the C standard's sprintf/vsprintf
note For security considerations (the potential for exceeding the buffer bounds), please consider using the size-constrained variant, ref /ref instead.
s An array in which to store the formatted string. It must be large enough to fit the formatted output!
format A string specifying the format of the output, with %-marked specifiers of how to interpret additional arguments
arg Additional arguments to the function, one for each specifier inp
return The number of characters written into p not counting the terminating null character
@{
vsprintf
int vsprintf(char * s, const char * format, va_list arg)
snprintf
int snprintf(char * s, size_t count, const char * format)
An implementation of the C standard's snprintf/vsnprintf
s An array in which to store the formatted string. It must be large enough to fit either the entire formatted output, or at least p characters. Alternatively, it can be NULL, in which case nothing will be printed, and only the number of characters which could have been printed is tallied and returned.
n The maximum number of characters to write to the array, including a terminating null character
format A string specifying the format of the output, with %-marked specifiers of how to interpret additional arguments.
arg Additional arguments to the function, one for each specifier inp
return The number of characters that COULD have been written into p not counting the terminating null character. A value equal or larger thanp indicates truncation. Only when the returned value is non-negative and less than p the null-terminated string has been fully and successfully printed.
@{
vsnprintf
int vsnprintf(char * s, size_t count, const char * format, va_list arg)
fctprintf
int fctprintf(void ()(char, void ) out, void * extra_arg, const char * format)
printf/vprintf with user-specified output function
An alternative to ref in which the output function is specified dynamically (rather than ref being used)
out An output function which takes one character and a type-erased additional parameters
extra_arg The type-erased argument to pass to the output function p with each call
format A string specifying the format of the output, with %-marked specifiers of how to interpret additional arguments.
arg Additional arguments to the function, one for each specifier inp
return The number of characters for which the output f unction was invoked, not counting the terminating null character
vfctprintf
int vfctprintf(void ()(char, void ) out, void * extra_arg, const char * format, va_list arg)