Loading...
Searching...
No Matches

Utility functions that are missing in string.h More...

Detailed Description

Utility functions that are missing in string.h

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file string_utils.h.

#include <assert.h>
#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <sys/types.h>
#include "flash_utils.h"
#include "modules.h"
+ Include dependency graph for string_utils.h:

Go to the source code of this file.

Data Structures

struct  string_writer_t
 String Writer structure. More...
 

Macros

#define __swprintf   swprintf
 internal helper macro
 

Functions

static void string_writer_init (string_writer_t *sw, void *buffer, size_t len)
 Initialize a string writer structure.
 
static size_t string_writer_len (const string_writer_t *sw)
 Get the size of the string contained by the string writer.
 
static const char * string_writer_str (const string_writer_t *sw)
 Get the string contained by the string writer.
 
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 in the destination buffer.
 
static void explicit_bzero (void *dest, size_t n_bytes)
 Like memset(dest, 0, n_bytes), but secure.
 
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.
 
const void * memchk (const void *data, uint8_t c, size_t len)
 Check if the entire buffer is filled with the same byte.