1 
2 // automatically generated by m4 from headers in proto subdir
3 
4 
5 #ifndef __STRING_H__
6 #define __STRING_H__
7 
8 #include <stddef.h>
9 
10 #ifndef _SIZE_T_DEFINED
11 #define _SIZE_T_DEFINED
12 typedef unsigned int  size_t;
13 #endif
14 
15 #ifndef NULL
16 #define NULL            ((void*)(0))
17 #endif
18 
19 extern int __LIB__ bcmp(const void *b1,const void *b2,size_t len) __smallc;
20 extern int __LIB__ bcmp_callee(const void *b1,const void *b2,size_t len) __smallc __z88dk_callee;
21 #define bcmp(a,b,c) bcmp_callee(a,b,c)
22 
23 
24 extern void __LIB__ bcopy(const void *src,void *dst,size_t len) __smallc;
25 extern void __LIB__ bcopy_callee(const void *src,void *dst,size_t len) __smallc __z88dk_callee;
26 #define bcopy(a,b,c) bcopy_callee(a,b,c)
27 
28 
29 extern void __LIB__ bzero(void *mem,size_t n) __smallc;
30 extern void __LIB__ bzero_callee(void *mem,size_t n) __smallc __z88dk_callee;
31 #define bzero(a,b) bzero_callee(a,b)
32 
33 
34 extern char __LIB__ *index(const char *s,int c) __smallc;
35 extern char __LIB__ *index_callee(const char *s,int c) __smallc __z88dk_callee;
36 #define index(a,b) index_callee(a,b)
37 
38 
39 extern char __LIB__ *rindex(const char *s,int c) __smallc;
40 extern char __LIB__ *rindex_callee(const char *s,int c) __smallc __z88dk_callee;
41 #define rindex(a,b) rindex_callee(a,b)
42 
43 
44 extern char __LIB__ *strset(char *s,int c) __smallc;
45 extern char __LIB__ *strset_callee(char *s,int c) __smallc __z88dk_callee;
46 #define strset(a,b) strset_callee(a,b)
47 
48 
49 extern char __LIB__ *strnset(char *s,int c,size_t n) __smallc;
50 extern char __LIB__ *strnset_callee(char *s,int c,size_t n) __smallc __z88dk_callee;
51 #define strnset(a,b,c) strnset_callee(a,b,c)
52 
53 
54 extern void __LIB__ *rawmemchr(const void *mem,int c) __smallc;
55 extern void __LIB__ *rawmemchr_callee(const void *mem,int c) __smallc __z88dk_callee;
56 #define rawmemchr(a,b) rawmemchr_callee(a,b)
57 
58 
59 
60 extern char __LIB__ *_memlwr_(void *p,size_t n) __smallc;
61 extern char __LIB__ *_memlwr__callee(void *p,size_t n) __smallc __z88dk_callee;
62 #define _memlwr_(a,b) _memlwr__callee(a,b)
63 
64 
65 extern char __LIB__ *_memstrcpy_(void *p,const char *s,size_t n) __smallc;
66 extern char __LIB__ *_memstrcpy__callee(void *p,const char *s,size_t n) __smallc __z88dk_callee;
67 #define _memstrcpy_(a,b,c) _memstrcpy__callee(a,b,c)
68 
69 
70 extern char __LIB__ *_memupr_(void *p,size_t n) __smallc;
71 extern char __LIB__ *_memupr__callee(void *p,size_t n) __smallc __z88dk_callee;
72 #define _memupr_(a,b) _memupr__callee(a,b)
73 
74 
75 extern char __LIB__ *_strrstrip_(char *s) __smallc __z88dk_fastcall;
76 
77 
78 extern int __LIB__ ffs(int i) __smallc __z88dk_fastcall;
79 
80 
81 extern int __LIB__ ffsl(long i) __smallc __z88dk_fastcall;
82 
83 
84 extern void __LIB__ *memccpy(void *dst,const void *src,int c,size_t n) __smallc;
85 extern void __LIB__ *memccpy_callee(void *dst,const void *src,int c,size_t n) __smallc __z88dk_callee;
86 #define memccpy(a,b,c,d) memccpy_callee(a,b,c,d)
87 
88 
89 extern void __LIB__ *memchr(const void *s,int c,size_t n) __smallc;
90 extern void __LIB__ *memchr_callee(const void *s,int c,size_t n) __smallc __z88dk_callee;
91 #define memchr(a,b,c) memchr_callee(a,b,c)
92 
93 
94 extern int __LIB__ memcmp(const void *s1,const void *s2,size_t n) __smallc;
95 extern int __LIB__ memcmp_callee(const void *s1,const void *s2,size_t n) __smallc __z88dk_callee;
96 #define memcmp(a,b,c) memcmp_callee(a,b,c)
97 
98 
99 extern void __LIB__ *memcpy(void *dst,const void *src,size_t n) __smallc;
100 extern void __LIB__ *memcpy_callee(void *dst,const void *src,size_t n) __smallc __z88dk_callee;
101 #define memcpy(a,b,c) memcpy_callee(a,b,c)
102 
103 
104 extern void __LIB__ *memmem(const void *haystack,size_t haystack_len,const void *needle,size_t needle_len) __smallc;
105 extern void __LIB__ *memmem_callee(const void *haystack,size_t haystack_len,const void *needle,size_t needle_len) __smallc __z88dk_callee;
106 #define memmem(a,b,c,d) memmem_callee(a,b,c,d)
107 
108 
109 extern void __LIB__ *memmove(void *dst,const void *src,size_t n) __smallc;
110 extern void __LIB__ *memmove_callee(void *dst,const void *src,size_t n) __smallc __z88dk_callee;
111 #define memmove(a,b,c) memmove_callee(a,b,c)
112 
113 
114 extern void __LIB__ *memrchr(const void *s,int c,size_t n) __smallc;
115 extern void __LIB__ *memrchr_callee(const void *s,int c,size_t n) __smallc __z88dk_callee;
116 #define memrchr(a,b,c) memrchr_callee(a,b,c)
117 
118 
119 extern void __LIB__ *memset(void *s,int c,size_t n) __smallc;
120 extern void __LIB__ *memset_callee(void *s,int c,size_t n) __smallc __z88dk_callee;
121 #define memset(a,b,c) memset_callee(a,b,c)
122 
123 
124 extern void __LIB__ *memswap(void *s1,void *s2,size_t n) __smallc;
125 extern void __LIB__ *memswap_callee(void *s1,void *s2,size_t n) __smallc __z88dk_callee;
126 #define memswap(a,b,c) memswap_callee(a,b,c)
127 
128 
129 extern char __LIB__ *stpcpy(char *dst,const char *src) __smallc;
130 extern char __LIB__ *stpcpy_callee(char *dst,const char *src) __smallc __z88dk_callee;
131 #define stpcpy(a,b) stpcpy_callee(a,b)
132 
133 
134 extern char __LIB__ *stpncpy(char *dst,const char *src,size_t n) __smallc;
135 extern char __LIB__ *stpncpy_callee(char *dst,const char *src,size_t n) __smallc __z88dk_callee;
136 #define stpncpy(a,b,c) stpncpy_callee(a,b,c)
137 
138 
139 extern int __LIB__ strcasecmp(const char *s1,const char *s2) __smallc;
140 extern int __LIB__ strcasecmp_callee(const char *s1,const char *s2) __smallc __z88dk_callee;
141 #define strcasecmp(a,b) strcasecmp_callee(a,b)
142 
143 
144 extern char __LIB__ *strcat(char *dst,const char *src) __smallc;
145 extern char __LIB__ *strcat_callee(char *dst,const char *src) __smallc __z88dk_callee;
146 #define strcat(a,b) strcat_callee(a,b)
147 
148 
149 extern char __LIB__ *strchr(const char *s,int c) __smallc;
150 extern char __LIB__ *strchr_callee(const char *s,int c) __smallc __z88dk_callee;
151 #define strchr(a,b) strchr_callee(a,b)
152 
153 
154 extern char __LIB__ *strchrnul(const char *s,int c) __smallc;
155 extern char __LIB__ *strchrnul_callee(const char *s,int c) __smallc __z88dk_callee;
156 #define strchrnul(a,b) strchrnul_callee(a,b)
157 
158 
159 extern int __LIB__ strcmp(const char *s1,const char *s2) __smallc;
160 extern int __LIB__ strcmp_callee(const char *s1,const char *s2) __smallc __z88dk_callee;
161 #define strcmp(a,b) strcmp_callee(a,b)
162 
163 
164 extern int __LIB__ strcoll(const char *s1,const char *s2) __smallc;
165 extern int __LIB__ strcoll_callee(const char *s1,const char *s2) __smallc __z88dk_callee;
166 #define strcoll(a,b) strcoll_callee(a,b)
167 
168 
169 extern char __LIB__ *strcpy(char *dst,const char *src) __smallc;
170 extern char __LIB__ *strcpy_callee(char *dst,const char *src) __smallc __z88dk_callee;
171 #define strcpy(a,b) strcpy_callee(a,b)
172 
173 
174 extern size_t __LIB__ strcspn(const char *s,const char *nspn) __smallc;
175 extern size_t __LIB__ strcspn_callee(const char *s,const char *nspn) __smallc __z88dk_callee;
176 #define strcspn(a,b) strcspn_callee(a,b)
177 
178 
179 extern char __LIB__ *strdup(const char *s) __smallc __z88dk_fastcall;
180 
181 
182 extern char __LIB__ *strerror(int errnum) __smallc __z88dk_fastcall;
183 
184 
185 extern int __LIB__ stricmp(const char *s1,const char *s2) __smallc;
186 extern int __LIB__ stricmp_callee(const char *s1,const char *s2) __smallc __z88dk_callee;
187 #define stricmp(a,b) stricmp_callee(a,b)
188 
189 
190 extern size_t __LIB__ strlcat(char *dst,const char *src,size_t n) __smallc;
191 extern size_t __LIB__ strlcat_callee(char *dst,const char *src,size_t n) __smallc __z88dk_callee;
192 #define strlcat(a,b,c) strlcat_callee(a,b,c)
193 
194 
195 extern size_t __LIB__ strlcpy(char *dst,const char *src,size_t n) __smallc;
196 extern size_t __LIB__ strlcpy_callee(char *dst,const char *src,size_t n) __smallc __z88dk_callee;
197 #define strlcpy(a,b,c) strlcpy_callee(a,b,c)
198 
199 
200 extern size_t __LIB__ strlen(const char *s) __smallc __z88dk_fastcall;
201 
202 
203 extern char __LIB__ *strlwr(char *s) __smallc __z88dk_fastcall;
204 
205 
206 extern int __LIB__ strncasecmp(const char *s1,const char *s2,size_t n) __smallc;
207 extern int __LIB__ strncasecmp_callee(const char *s1,const char *s2,size_t n) __smallc __z88dk_callee;
208 #define strncasecmp(a,b,c) strncasecmp_callee(a,b,c)
209 
210 
211 extern char __LIB__ *strncat(char *dst,const char *src,size_t n) __smallc;
212 extern char __LIB__ *strncat_callee(char *dst,const char *src,size_t n) __smallc __z88dk_callee;
213 #define strncat(a,b,c) strncat_callee(a,b,c)
214 
215 
216 extern char __LIB__ *strnchr(const char *s,size_t n,int c) __smallc;
217 extern char __LIB__ *strnchr_callee(const char *s,size_t n,int c) __smallc __z88dk_callee;
218 #define strnchr(a,b,c) strnchr_callee(a,b,c)
219 
220 
221 extern int __LIB__ strncmp(const char *s1,const char *s2,size_t n) __smallc;
222 extern int __LIB__ strncmp_callee(const char *s1,const char *s2,size_t n) __smallc __z88dk_callee;
223 #define strncmp(a,b,c) strncmp_callee(a,b,c)
224 
225 
226 extern char __LIB__ *strncpy(char *dst,const char *src,size_t n) __smallc;
227 extern char __LIB__ *strncpy_callee(char *dst,const char *src,size_t n) __smallc __z88dk_callee;
228 #define strncpy(a,b,c) strncpy_callee(a,b,c)
229 
230 
231 extern char __LIB__ *strndup(const char *s,size_t n) __smallc;
232 extern char __LIB__ *strndup_callee(const char *s,size_t n) __smallc __z88dk_callee;
233 #define strndup(a,b) strndup_callee(a,b)
234 
235 
236 extern int __LIB__ strnicmp(const char *s1,const char *s2,size_t n) __smallc;
237 extern int __LIB__ strnicmp_callee(const char *s1,const char *s2,size_t n) __smallc __z88dk_callee;
238 #define strnicmp(a,b,c) strnicmp_callee(a,b,c)
239 
240 
241 extern size_t __LIB__ strnlen(const char *s,size_t max_len) __smallc;
242 extern size_t __LIB__ strnlen_callee(const char *s,size_t max_len) __smallc __z88dk_callee;
243 #define strnlen(a,b) strnlen_callee(a,b)
244 
245 
246 extern char __LIB__ *strpbrk(const char *s,const char *set) __smallc;
247 extern char __LIB__ *strpbrk_callee(const char *s,const char *set) __smallc __z88dk_callee;
248 #define strpbrk(a,b) strpbrk_callee(a,b)
249 
250 
251 extern char __LIB__ *strrchr(const char *s,int c) __smallc;
252 extern char __LIB__ *strrchr_callee(const char *s,int c) __smallc __z88dk_callee;
253 #define strrchr(a,b) strrchr_callee(a,b)
254 
255 
256 extern size_t __LIB__ strrcspn(const char *s,const char *set) __smallc;
257 extern size_t __LIB__ strrcspn_callee(const char *s,const char *set) __smallc __z88dk_callee;
258 #define strrcspn(a,b) strrcspn_callee(a,b)
259 
260 
261 extern char __LIB__ *strrev(char *s) __smallc __z88dk_fastcall;
262 
263 
264 extern size_t __LIB__ strrspn(const char *s,const char *set) __smallc;
265 extern size_t __LIB__ strrspn_callee(const char *s,const char *set) __smallc __z88dk_callee;
266 #define strrspn(a,b) strrspn_callee(a,b)
267 
268 
269 extern char __LIB__ *strrstr(const char *s,const char *subs) __smallc;
270 extern char __LIB__ *strrstr_callee(const char *s,const char *subs) __smallc __z88dk_callee;
271 #define strrstr(a,b) strrstr_callee(a,b)
272 
273 
274 extern char __LIB__ *strrstrip(char *s) __smallc __z88dk_fastcall;
275 
276 
277 extern char __LIB__ *strsep(char **s,const char *delim) __smallc;
278 extern char __LIB__ *strsep_callee(char **s,const char *delim) __smallc __z88dk_callee;
279 #define strsep(a,b) strsep_callee(a,b)
280 
281 
282 extern size_t __LIB__ strspn(const char *s,const char *pfx) __smallc;
283 extern size_t __LIB__ strspn_callee(const char *s,const char *pfx) __smallc __z88dk_callee;
284 #define strspn(a,b) strspn_callee(a,b)
285 
286 
287 extern char __LIB__ *strstr(const char *s,const char *subs) __smallc;
288 extern char __LIB__ *strstr_callee(const char *s,const char *subs) __smallc __z88dk_callee;
289 #define strstr(a,b) strstr_callee(a,b)
290 
291 
292 extern char __LIB__ *strstrip(char *s) __smallc __z88dk_fastcall;
293 
294 
295 extern char __LIB__ *strtok(char *s,const char *delim) __smallc;
296 extern char __LIB__ *strtok_callee(char *s,const char *delim) __smallc __z88dk_callee;
297 #define strtok(a,b) strtok_callee(a,b)
298 
299 
300 extern char __LIB__ *strtok_r(char *s,const char *delim,char **last_s) __smallc;
301 extern char __LIB__ *strtok_r_callee(char *s,const char *delim,char **last_s) __smallc __z88dk_callee;
302 #define strtok_r(a,b,c) strtok_r_callee(a,b,c)
303 
304 
305 extern char __LIB__ *strupr(char *s) __smallc __z88dk_fastcall;
306 
307 
308 extern size_t __LIB__ strxfrm(char *dst,const char *src,size_t n) __smallc;
309 extern size_t __LIB__ strxfrm_callee(char *dst,const char *src,size_t n) __smallc __z88dk_callee;
310 #define strxfrm(a,b,c) strxfrm_callee(a,b,c)
311 
312 
313 
314 #ifdef __CLANG
315 
316    extern int ffsll(long long i);
317 
318 #endif
319 
320 #ifdef __SCCZ80
321 
322    #ifndef __DISABLE_BUILTIN
323 
324    #ifndef __DISABLE_BUILTIN_MEMSET
325    #undef  memset
326    #define memset(a,b,c)   __builtin_memset(a,b,c)
327    extern void __LIB__    *__builtin_memset(void *dst, int c, size_t n) __smallc;
328    #endif
329 
330    #ifndef __DISABLE_BUILTIN_MEMCPY
331    #undef  memcpy
332    #define memcpy(a,b,c)   __builtin_memcpy(a,b,c)
333    extern void __LIB__    *__builtin_memcpy(void *dst, void *src,size_t n) __smallc;
334    #endif
335 
336    #ifndef __DISABLE_BUILTIN_STRCPY
337    #undef  strcpy
338    #define strcpy(a,b)     __builtin_strcpy(a,b)
339    extern char __LIB__    *__builtin_strcpy(char *dst, const char *src) __smallc;
340    #endif
341 
342    #ifndef __DISABLE_BUILTIN_STRCHR
343    #undef  strchr
344    #define strchr(a,b)     __builtin_strchr(a,b)
345    extern char __LIB__    *__builtin_strchr(const char *haystack, int needle) __smallc;
346    #endif
347 
348    #endif
349 
350 #endif
351 
352 #ifdef __SDCC
353 
354    extern int ffsll(long long i) __preserves_regs(b,c);
355    extern int ffsll_callee(long long i) __preserves_regs(b,c) __z88dk_callee;
356    #define ffsll(a) ffsll_callee(a)
357 
358    #ifndef __DISABLE_BUILTIN
359 
360    #ifndef __DISABLE_BUILTIN_MEMCPY
361    #undef  memcpy
362    #define memcpy(dst, src, n)    __builtin_memcpy(dst, src, n)
363    #endif
364 
365    #ifndef __DISABLE_BUILTIN_STRCPY
366    #undef  strcpy
367    #define strcpy(dst, src)       __builtin_strcpy(dst, src)
368    #endif
369 
370    #ifndef __DISABLE_BUILTIN_STRNCPY
371    #undef  strncpy
372    #define strncpy(dst, src, n)   __builtin_strncpy(dst, src, n)
373    #endif
374 
375    #ifndef __DISABLE_BUILTIN_STRCHR
376    #undef  strchr
377    #define strchr(s, c)           __builtin_strchr(s, c)
378    #endif
379 
380    #ifndef __DISABLE_BUILTIN_MEMSET
381    #undef  memset
382    #define memset(dst, c, n)      __builtin_memset(dst, c, n)
383    #endif
384 
385    #endif
386 
387 #endif
388 
389 #endif
390