Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_mem_util.h
Go to the documentation of this file.
1#ifndef SAFEAPI_MEM_UTIL_H
2#define SAFEAPI_MEM_UTIL_H
3
27
28#include <stddef.h>
29#include <string.h>
30
39static inline void sapi_mem_set(void *dest, int value, size_t count)
40{
41 (void)memset(dest, value, count);
42}
43
56static inline void sapi_mem_copy(void *dest, const void *src, size_t count)
57{
58 (void)memcpy(dest, src, count);
59}
60
70static inline int sapi_mem_compare(const void *a, const void *b, size_t count)
71{
72 return memcmp(a, b, count);
73}
74
75#endif /* SAFEAPI_MEM_UTIL_H */
static void sapi_mem_set(void *dest, int value, size_t count)
Fills count bytes starting at dest with value - the one sanctioned call site for libc memset() in thi...
static void sapi_mem_copy(void *dest, const void *src, size_t count)
Copies count bytes from src to dest - the one sanctioned call site for libc memcpy() in this framewor...
static int sapi_mem_compare(const void *a, const void *b, size_t count)
Byte-for-byte compares count bytes of a against b - the one sanctioned call site for libc memcmp() in...