ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_freestanding.h
Go to the documentation of this file.
1
18
19#pragma once
20
21#include <stddef.h>
22#include <stdint.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#if defined(RA8_TEST_FREESTANDING)
29#undef memset
30#undef memcpy
31#undef memmove
32#undef memcmp
33#undef memchr
34#undef strlen
35#undef strnlen
36#undef strcmp
37#undef strncmp
38#undef strchr
39#undef strrchr
40#undef strstr
41#undef strcpy
42#undef strncpy
43#undef abs
44
46#define memset ra8_memset
48#define memcpy ra8_memcpy
50#define memmove ra8_memmove
52#define memcmp ra8_memcmp
54#define memchr ra8_memchr
56#define strlen ra8_strlen
58#define strnlen ra8_strnlen
60#define strcmp ra8_strcmp
62#define strncmp ra8_strncmp
64#define strchr ra8_strchr
66#define strrchr ra8_strrchr
68#define strstr ra8_strstr
70#define strcpy ra8_strcpy
72#define strncpy ra8_strncpy
74#define abs ra8_abs
75#endif /* RA8_TEST_FREESTANDING */
76
93void* memset(void* dst, int value, size_t n);
94
111void* memcpy(void* dst, const void* src, size_t n);
112
129void* memmove(void* dst, const void* src, size_t n);
130
149int memcmp(const void* a, const void* b, size_t n);
150
167void* memchr(const void* s, int c, size_t n);
168
182size_t strlen(const char* s);
183
198size_t strnlen(const char* s, size_t maxlen);
199
216int strcmp(const char* s1, const char* s2);
217
235int strncmp(const char* s1, const char* s2, size_t n);
236
252char* strchr(const char* s, int c);
253
269char* strrchr(const char* s, int c);
270
286char* strstr(const char* haystack, const char* needle);
287
302char* strcpy(char* dst, const char* src);
303
320char* strncpy(char* dst, const char* src, size_t n);
321
335int abs(int j);
336
337#ifdef __cplusplus
338}
339#endif
int strncmp(const char *s1, const char *s2, size_t n)
Compare two strings up to a specified length.
void * memchr(const void *s, int c, size_t n)
Locate a byte in a memory area.
int strcmp(const char *s1, const char *s2)
Compare two null-terminated strings.
void * memset(void *dst, int value, size_t n)
Fill memory with a constant byte value.
char * strcpy(char *dst, const char *src)
Copy string to destination buffer.
int memcmp(const void *a, const void *b, size_t n)
Compare bytes in two memory areas.
void * memmove(void *dst, const void *src, size_t n)
Copy memory area between potentially overlapping regions.
char * strncpy(char *dst, const char *src, size_t n)
Copy bounded string to destination buffer.
size_t strlen(const char *s)
Calculate string length.
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
char * strstr(const char *haystack, const char *needle)
Locate substring in string.
char * strchr(const char *s, int c)
Locate first occurrence of character in string.
int abs(int j)
Compute absolute value of integer.
char * strrchr(const char *s, int c)
Locate last occurrence of character in string.
size_t strnlen(const char *s, size_t maxlen)
Calculate bounded string length.