Redirects the <string.h> names onto MMgr's bounded implementations. More...
#include "mmgr.h"#include "cellularum_laboro/cellularum_laboro.h"#include "memoria_operor/memoria_operor.h"Go to the source code of this file.
Macros | |
| #define | memcpy(dest, source, bytes) |
| Replaces memcpy with mmgr_shim_cpy. | |
| #define | memmove(dest, source, bytes) |
| Replaces memmove with mmgr_shim_move. | |
| #define | memset(dest, value, bytes) |
| Replaces memset with mmgr_shim_set. | |
| #define | memcmp(left, right, bytes) |
| Replaces memcmp with mmgr_shim_cmp. | |
| #define | memchr(region, value, bytes) |
| Replaces memchr with mmgr_shim_chr. | |
| #define | strlen(text) |
| Replaces strlen with a scan bounded at MMGR_STR_MAX. | |
| #define | strnlen(text, limit) |
| Replaces strnlen with a scan bounded at limit. | |
| #define | strstr(haystack, needle) |
| Replaces strstr with a case-sensitive search bounded at MMGR_STR_MAX. | |
| #define | strcasestr(haystack, needle) |
| Replaces strcasestr with a case-folded search bounded at MMGR_STR_MAX. | |
| #define | strcmp(left, right) |
| Replaces strcmp with an equality test bounded at MMGR_STR_MAX. | |
| #define | strcasecmp(left, right) |
| Replaces strcasecmp with a case-folded equality test bounded at MMGR_STR_MAX. | |
| #define | strncmp(left, right, limit) |
| Replaces strncmp with an equality test over at most limit bytes. | |
| #define | strncasecmp(left, right, limit) |
| Replaces strncasecmp with a case-folded equality test over at most limit bytes. | |
| #define | strlcpy(dest, source, limit) |
| Replaces strlcpy with a bounded copy that always terminates unless limit is 0. | |
| #define | strchr(text, value) |
| Replaces strchr with a search bounded at MMGR_STR_MAX. | |
Functions | |
| static void * | mmgr_shim_cpy (void *dest, const void *source, size_t bytes) |
| Copies bytes from source to dest and returns dest. | |
| static void * | mmgr_shim_move (void *dest, const void *source, size_t bytes) |
| Copies bytes from source to dest, tolerating overlap, and returns dest. | |
| static void * | mmgr_shim_set (void *dest, embed_iword value, size_t bytes) |
| Fills bytes of dest with the low byte of value and returns dest. | |
| static embed_iword | mmgr_shim_cmp (const void *left, const void *right, size_t bytes) |
| Compares bytes of left against right. | |
| static void * | mmgr_shim_chr (const void *region, embed_iword value, size_t bytes) |
| Finds the first byte in region equal to the low byte of value. | |
Redirects the <string.h> names onto MMgr's bounded implementations.
Definition in file mmgr_string_shim.h.
| #define memcpy | ( | dest, | |
| source, | |||
| bytes ) |
Replaces memcpy with mmgr_shim_cpy.
Definition at line 152 of file mmgr_string_shim.h.
| #define memmove | ( | dest, | |
| source, | |||
| bytes ) |
Replaces memmove with mmgr_shim_move.
Definition at line 159 of file mmgr_string_shim.h.
| #define memset | ( | dest, | |
| value, | |||
| bytes ) |
Replaces memset with mmgr_shim_set.
Definition at line 167 of file mmgr_string_shim.h.
| #define memcmp | ( | left, | |
| right, | |||
| bytes ) |
Replaces memcmp with mmgr_shim_cmp.
Definition at line 174 of file mmgr_string_shim.h.
| #define memchr | ( | region, | |
| value, | |||
| bytes ) |
Replaces memchr with mmgr_shim_chr.
Definition at line 182 of file mmgr_string_shim.h.
| #define strlen | ( | text | ) |
Replaces strlen with a scan bounded at MMGR_STR_MAX.
Definition at line 192 of file mmgr_string_shim.h.
| #define strnlen | ( | text, | |
| limit ) |
Replaces strnlen with a scan bounded at limit.
Definition at line 202 of file mmgr_string_shim.h.
| #define strstr | ( | haystack, | |
| needle ) |
Replaces strstr with a case-sensitive search bounded at MMGR_STR_MAX.
Definition at line 212 of file mmgr_string_shim.h.
| #define strcasestr | ( | haystack, | |
| needle ) |
Replaces strcasestr with a case-folded search bounded at MMGR_STR_MAX.
Definition at line 224 of file mmgr_string_shim.h.
| #define strcmp | ( | left, | |
| right ) |
Replaces strcmp with an equality test bounded at MMGR_STR_MAX.
Definition at line 237 of file mmgr_string_shim.h.
| #define strcasecmp | ( | left, | |
| right ) |
Replaces strcasecmp with a case-folded equality test bounded at MMGR_STR_MAX.
Definition at line 248 of file mmgr_string_shim.h.
| #define strncmp | ( | left, | |
| right, | |||
| limit ) |
Replaces strncmp with an equality test over at most limit bytes.
Definition at line 260 of file mmgr_string_shim.h.
| #define strncasecmp | ( | left, | |
| right, | |||
| limit ) |
Replaces strncasecmp with a case-folded equality test over at most limit bytes.
Definition at line 273 of file mmgr_string_shim.h.
| #define strlcpy | ( | dest, | |
| source, | |||
| limit ) |
Replaces strlcpy with a bounded copy that always terminates unless limit is 0.
Definition at line 285 of file mmgr_string_shim.h.
| #define strchr | ( | text, | |
| value ) |
Replaces strchr with a search bounded at MMGR_STR_MAX.
Definition at line 298 of file mmgr_string_shim.h.
|
inlinestatic |
Copies bytes from source to dest and returns dest.
| [out] | dest | Destination to write [BORROWS]. |
| [in] | source | Bytes to read [BORROWS]. |
| [in] | bytes | Number of bytes to copy. |
Definition at line 69 of file mmgr_string_shim.h.
References MemoriaCfg::dst, and mmgr_shim_cpy().
Referenced by mmgr_shim_cpy().
|
inlinestatic |
Copies bytes from source to dest, tolerating overlap, and returns dest.
| [out] | dest | Destination to write [BORROWS]. |
| [in] | source | Bytes to read [BORROWS]. |
| [in] | bytes | Number of bytes to copy. |
Definition at line 86 of file mmgr_string_shim.h.
References MemoriaCfg::dst, and mmgr_shim_move().
Referenced by mmgr_shim_move().
|
inlinestatic |
Fills bytes of dest with the low byte of value and returns dest.
| [out] | dest | Destination to write [BORROWS]. |
| [in] | value | Fill value, of which only the low eight bits are used. |
| [in] | bytes | Number of bytes to write. |
Definition at line 111 of file mmgr_string_shim.h.
References MemoriaCfg::dst, and mmgr_shim_set().
Referenced by mmgr_shim_set().
|
inlinestatic |
Compares bytes of left against right.
| [in] | left | First region [BORROWS]. |
| [in] | right | Second region [BORROWS]. |
| [in] | bytes | Number of bytes to compare. |
Definition at line 127 of file mmgr_string_shim.h.
References mmgr_shim_cmp(), and MemoriaCfg::src.
Referenced by mmgr_shim_cmp().
|
inlinestatic |
Finds the first byte in region equal to the low byte of value.
| [in] | region | Bytes to search [BORROWS]. |
| [in] | value | Byte sought, of which only the low eight bits are used. |
| [in] | bytes | Number of bytes to search. |
Definition at line 142 of file mmgr_string_shim.h.
References mmgr_shim_chr(), and MemoriaCfg::src.
Referenced by mmgr_shim_chr().