33 #include <sys/types.h> 
   93 #if IS_ACTIVE(HAS_FLASH_UTILS_ARCH) 
   94 #define __swprintf flash_swprintf 
   96 #define __swprintf swprintf 
   97 __attribute__ ((format (
printf, 2, 3)))
 
  116 #if IS_ACTIVE(HAS_FLASH_UTILS_ARCH) 
  117 #define swprintf(sw, fmt, ...) flash_swprintf(sw, TO_FLASH(fmt), ## __VA_ARGS__) 
  128 #if !defined(CPU_NATIVE) \ 
  129     && !(IS_USED(MODULE_PICOLIBC) && __BSD_VISIBLE) \ 
  130     && !(IS_USED(MODULE_NEWLIB) && __BSD_VISIBLE && !defined(CPU_ESP8266)) 
  146     volatile uint8_t *tmp = dest;
 
  147     for (
size_t i = 0; i < n_bytes; i++) {
 
  171 ssize_t 
strscpy(
char *dest, 
const char *src, 
size_t count);
 
  183 const void *
memchk(
const void *data, uint8_t c, 
size_t len);
 
POSIX.1-2008 compliant version of the assert macro.
 
#define assert(cond)
abort the program if assertion is false
 
Utility functions, macros, and types for read-only memory.
 
#define printf(...)
A wrapper for the printf() function that passes arguments through unmodified, but fails to compile if...
 
#define FLASH_ATTR
C type qualifier required to place a variable in flash.
 
int swprintf(string_writer_t *sw, FLASH_ATTR const char *restrict format,...)
Write a formatted string to a buffer The string will be truncated if there is not enough space left i...
 
static const char * string_writer_str(const string_writer_t *sw)
Get the string contained by the string writer.
 
ssize_t strscpy(char *dest, const char *src, size_t count)
Copy the string, or as much of it as fits, into the dest buffer.
 
void reverse_buf(void *buf, size_t len)
Reverse the order of bytes in a buffer.
 
static size_t string_writer_len(const string_writer_t *sw)
Get the size of the string contained by the string writer.
 
const void * memchk(const void *data, uint8_t c, size_t len)
Check if the entire buffer is filled with the same byte.
 
static void explicit_bzero(void *dest, size_t n_bytes)
Like memset(dest, 0, n_bytes), but secure.
 
static void string_writer_init(string_writer_t *sw, void *buffer, size_t len)
Initialize a string writer structure.
 
Common macros and compiler attributes/pragmas configuration.
 
char * position
current write pointer
 
const char * start
start of the target buffer
 
size_t capacity
remaining capacity of the buffer