diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/CONFIG.H | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/CONFIG.H')
| -rw-r--r-- | Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/CONFIG.H | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/CONFIG.H b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/CONFIG.H new file mode 100644 index 0000000..18f6fbf --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/CONFIG.H @@ -0,0 +1,74 @@ +/* + * config.h - modified specially for reentrant strlib. + * Copyright (C) Advanced RISC Machines Limited 1994. All rights reserved. + */ + +#define BYTESEX_EVEN 1 /* little-endian */ +/*#define BYTESEX_ODD 1 -- BIG-endian */ + +/* + * Define this to get a shared library with an initialised data image in the + * library. Undefine it to get the data image in the library stub. Remember + * To modify strshl in step (the line containing + {}). + */ +#define DATA_IN_LIBRARY 1 /* needs +{} in strshl */ + +#include "interns.h" + +#define memcpy_c +#define memmove_c +#define memchr_c +#define memcmp_c +#define memset_c +#define strcat_c +#define strchr_c +#define strcmp_c +#define strcoll_c +#define strcpy_c +#define strcspn_c +#define strerror_c +#define strlen_c +#define strncat_c +#define strncmp_c +#define strncpy_c +#define strpbrk_c +#define strrchr_c +#define strspn_c +#define strstr_c +#ifndef DATA_IN_LIBRARY +#define strtok_c +#endif +#define strxfrm_c +#define _strerror_c + +#include <string.h> + +static char *_hostos_error_string(unsigned int n, char *v) +{ char *s = v; + int j; + strcpy(s, "unknown shared string-library error 0x"); + s += strlen(s); + for (j = 0; j < 8; ++ j) + { *s++ = "0123456789ABCDEF"[n >> 28]; + n <<= 4; + } + *s = 0; + return v; +} + + +#ifdef DATA_IN_LIBRARY + +static char *saves1 = NULL; + +char *strtok(char *s1, const char *s2) +{ char *s0; + if (s1 == 0) s1 = (saves1 == NULL) ? "" : saves1; /* use saved pointer */ + if (*(s1 += strspn(s1,s2)) == 0) s0 = 0; /* no tokens */ + else { s0 = s1; + if (*(s1 += strcspn(s1,s2)) != 0) *s1++ = 0; /* insert 0 if nec */ + } + return (saves1 = s1, s0); +} + +#endif |
