1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #if __GNUC__ >= 3
19 @PRAGMA_SYSTEM_HEADER@
20 #endif
21 @PRAGMA_COLUMNS@
22
23 #if defined _GL_ALREADY_INCLUDING_STRING_H
24
25
26
27
28
29
30 #@INCLUDE_NEXT@ @NEXT_STRING_H@
31
32 #else
33
34
35 #ifndef _@GUARD_PREFIX@_STRING_H
36
37 #define _GL_ALREADY_INCLUDING_STRING_H
38
39
40 #@INCLUDE_NEXT@ @NEXT_STRING_H@
41
42 #undef _GL_ALREADY_INCLUDING_STRING_H
43
44 #ifndef _@GUARD_PREFIX@_STRING_H
45 #define _@GUARD_PREFIX@_STRING_H
46
47
48 #include <stddef.h>
49
50
51 #if @GNULIB_MBSLEN@ && defined __MirBSD__
52 # include <wchar.h>
53 #endif
54
55
56
57 #if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
58 && ! defined __GLIBC__
59 # include <unistd.h>
60 #endif
61
62
63
64 #if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \
65 && defined _AIX) \
66 && ! defined __GLIBC__
67 # include <strings.h>
68 #endif
69
70
71
72 #ifndef _GL_ATTRIBUTE_PURE
73 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
74 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
75 # else
76 # define _GL_ATTRIBUTE_PURE
77 # endif
78 #endif
79
80
81
82
83
84
85
86
87 _GL_EXTERN_C void free (void *);
88 #if @GNULIB_FREE_POSIX@
89 # if (@REPLACE_FREE@ && !defined free \
90 && !(defined __cplusplus && defined GNULIB_NAMESPACE))
91 # define free rpl_free
92 _GL_EXTERN_C void free (void *);
93 # endif
94 #endif
95
96
97
98 #if @GNULIB_EXPLICIT_BZERO@
99 # if ! @HAVE_EXPLICIT_BZERO@
100 _GL_FUNCDECL_SYS (explicit_bzero, void,
101 (void *__dest, size_t __n) _GL_ARG_NONNULL ((1)));
102 # endif
103 _GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n));
104 _GL_CXXALIASWARN (explicit_bzero);
105 #elif defined GNULIB_POSIXCHECK
106 # undef explicit_bzero
107 # if HAVE_RAW_DECL_EXPLICIT_BZERO
108 _GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - "
109 "use gnulib module explicit_bzero for portability");
110 # endif
111 #endif
112
113
114 #if @GNULIB_FFSL@
115 # if !@HAVE_FFSL@
116 _GL_FUNCDECL_SYS (ffsl, int, (long int i));
117 # endif
118 _GL_CXXALIAS_SYS (ffsl, int, (long int i));
119 _GL_CXXALIASWARN (ffsl);
120 #elif defined GNULIB_POSIXCHECK
121 # undef ffsl
122 # if HAVE_RAW_DECL_FFSL
123 _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
124 # endif
125 #endif
126
127
128
129 #if @GNULIB_FFSLL@
130 # if @REPLACE_FFSLL@
131 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
132 # define ffsll rpl_ffsll
133 # endif
134 _GL_FUNCDECL_RPL (ffsll, int, (long long int i));
135 _GL_CXXALIAS_RPL (ffsll, int, (long long int i));
136 # else
137 # if !@HAVE_FFSLL@
138 _GL_FUNCDECL_SYS (ffsll, int, (long long int i));
139 # endif
140 _GL_CXXALIAS_SYS (ffsll, int, (long long int i));
141 # endif
142 _GL_CXXALIASWARN (ffsll);
143 #elif defined GNULIB_POSIXCHECK
144 # undef ffsll
145 # if HAVE_RAW_DECL_FFSLL
146 _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
147 # endif
148 #endif
149
150
151 #if @GNULIB_MDA_MEMCCPY@
152
153
154
155 # if defined _WIN32 && !defined __CYGWIN__
156 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
157 # undef memccpy
158 # define memccpy _memccpy
159 # endif
160 _GL_CXXALIAS_MDA (memccpy, void *,
161 (void *dest, const void *src, int c, size_t n));
162 # else
163 _GL_CXXALIAS_SYS (memccpy, void *,
164 (void *dest, const void *src, int c, size_t n));
165 # endif
166 _GL_CXXALIASWARN (memccpy);
167 #endif
168
169
170
171 #if @GNULIB_MEMCHR@
172 # if @REPLACE_MEMCHR@
173 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
174 # undef memchr
175 # define memchr rpl_memchr
176 # endif
177 _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
178 _GL_ATTRIBUTE_PURE
179 _GL_ARG_NONNULL ((1)));
180 _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
181 # else
182
183
184
185 _GL_CXXALIAS_SYS_CAST2 (memchr,
186 void *, (void const *__s, int __c, size_t __n),
187 void const *, (void const *__s, int __c, size_t __n));
188 # endif
189 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
190 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
191 _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
192 _GL_CXXALIASWARN1 (memchr, void const *,
193 (void const *__s, int __c, size_t __n));
194 # elif __GLIBC__ >= 2
195 _GL_CXXALIASWARN (memchr);
196 # endif
197 #elif defined GNULIB_POSIXCHECK
198 # undef memchr
199
200 _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
201 "use gnulib module memchr for portability" );
202 #endif
203
204
205 #if @GNULIB_MEMMEM@
206 # if @REPLACE_MEMMEM@
207 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
208 # define memmem rpl_memmem
209 # endif
210 _GL_FUNCDECL_RPL (memmem, void *,
211 (void const *__haystack, size_t __haystack_len,
212 void const *__needle, size_t __needle_len)
213 _GL_ATTRIBUTE_PURE
214 _GL_ARG_NONNULL ((1, 3)));
215 _GL_CXXALIAS_RPL (memmem, void *,
216 (void const *__haystack, size_t __haystack_len,
217 void const *__needle, size_t __needle_len));
218 # else
219 # if ! @HAVE_DECL_MEMMEM@
220 _GL_FUNCDECL_SYS (memmem, void *,
221 (void const *__haystack, size_t __haystack_len,
222 void const *__needle, size_t __needle_len)
223 _GL_ATTRIBUTE_PURE
224 _GL_ARG_NONNULL ((1, 3)));
225 # endif
226 _GL_CXXALIAS_SYS (memmem, void *,
227 (void const *__haystack, size_t __haystack_len,
228 void const *__needle, size_t __needle_len));
229 # endif
230 _GL_CXXALIASWARN (memmem);
231 #elif defined GNULIB_POSIXCHECK
232 # undef memmem
233 # if HAVE_RAW_DECL_MEMMEM
234 _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
235 "use gnulib module memmem-simple for portability, "
236 "and module memmem for speed" );
237 # endif
238 #endif
239
240
241
242 #if @GNULIB_MEMPCPY@
243 # if ! @HAVE_MEMPCPY@
244 _GL_FUNCDECL_SYS (mempcpy, void *,
245 (void *restrict __dest, void const *restrict __src,
246 size_t __n)
247 _GL_ARG_NONNULL ((1, 2)));
248 # endif
249 _GL_CXXALIAS_SYS (mempcpy, void *,
250 (void *restrict __dest, void const *restrict __src,
251 size_t __n));
252 _GL_CXXALIASWARN (mempcpy);
253 #elif defined GNULIB_POSIXCHECK
254 # undef mempcpy
255 # if HAVE_RAW_DECL_MEMPCPY
256 _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
257 "use gnulib module mempcpy for portability");
258 # endif
259 #endif
260
261
262 #if @GNULIB_MEMRCHR@
263 # if ! @HAVE_DECL_MEMRCHR@
264 _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
265 _GL_ATTRIBUTE_PURE
266 _GL_ARG_NONNULL ((1)));
267 # endif
268
269
270
271 _GL_CXXALIAS_SYS_CAST2 (memrchr,
272 void *, (void const *, int, size_t),
273 void const *, (void const *, int, size_t));
274 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
275 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
276 _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
277 _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
278 # else
279 _GL_CXXALIASWARN (memrchr);
280 # endif
281 #elif defined GNULIB_POSIXCHECK
282 # undef memrchr
283 # if HAVE_RAW_DECL_MEMRCHR
284 _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
285 "use gnulib module memrchr for portability");
286 # endif
287 #endif
288
289
290
291
292 #if @GNULIB_RAWMEMCHR@
293 # if ! @HAVE_RAWMEMCHR@
294 _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
295 _GL_ATTRIBUTE_PURE
296 _GL_ARG_NONNULL ((1)));
297 # endif
298
299
300
301 _GL_CXXALIAS_SYS_CAST2 (rawmemchr,
302 void *, (void const *__s, int __c_in),
303 void const *, (void const *__s, int __c_in));
304 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
305 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
306 _GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
307 _GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
308 # else
309 _GL_CXXALIASWARN (rawmemchr);
310 # endif
311 #elif defined GNULIB_POSIXCHECK
312 # undef rawmemchr
313 # if HAVE_RAW_DECL_RAWMEMCHR
314 _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
315 "use gnulib module rawmemchr for portability");
316 # endif
317 #endif
318
319
320 #if @GNULIB_STPCPY@
321 # if ! @HAVE_STPCPY@
322 _GL_FUNCDECL_SYS (stpcpy, char *,
323 (char *restrict __dst, char const *restrict __src)
324 _GL_ARG_NONNULL ((1, 2)));
325 # endif
326 _GL_CXXALIAS_SYS (stpcpy, char *,
327 (char *restrict __dst, char const *restrict __src));
328 _GL_CXXALIASWARN (stpcpy);
329 #elif defined GNULIB_POSIXCHECK
330 # undef stpcpy
331 # if HAVE_RAW_DECL_STPCPY
332 _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
333 "use gnulib module stpcpy for portability");
334 # endif
335 #endif
336
337
338
339 #if @GNULIB_STPNCPY@
340 # if @REPLACE_STPNCPY@
341 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
342 # undef stpncpy
343 # define stpncpy rpl_stpncpy
344 # endif
345 _GL_FUNCDECL_RPL (stpncpy, char *,
346 (char *restrict __dst, char const *restrict __src,
347 size_t __n)
348 _GL_ARG_NONNULL ((1, 2)));
349 _GL_CXXALIAS_RPL (stpncpy, char *,
350 (char *restrict __dst, char const *restrict __src,
351 size_t __n));
352 # else
353 # if ! @HAVE_STPNCPY@
354 _GL_FUNCDECL_SYS (stpncpy, char *,
355 (char *restrict __dst, char const *restrict __src,
356 size_t __n)
357 _GL_ARG_NONNULL ((1, 2)));
358 # endif
359 _GL_CXXALIAS_SYS (stpncpy, char *,
360 (char *restrict __dst, char const *restrict __src,
361 size_t __n));
362 # endif
363 _GL_CXXALIASWARN (stpncpy);
364 #elif defined GNULIB_POSIXCHECK
365 # undef stpncpy
366 # if HAVE_RAW_DECL_STPNCPY
367 _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
368 "use gnulib module stpncpy for portability");
369 # endif
370 #endif
371
372 #if defined GNULIB_POSIXCHECK
373
374
375 # undef strchr
376
377 _GL_WARN_ON_USE_CXX (strchr,
378 const char *, char *, (const char *, int),
379 "strchr cannot work correctly on character strings "
380 "in some multibyte locales - "
381 "use mbschr if you care about internationalization");
382 #endif
383
384
385 #if @GNULIB_STRCHRNUL@
386 # if @REPLACE_STRCHRNUL@
387 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
388 # define strchrnul rpl_strchrnul
389 # endif
390 _GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
391 _GL_ATTRIBUTE_PURE
392 _GL_ARG_NONNULL ((1)));
393 _GL_CXXALIAS_RPL (strchrnul, char *,
394 (const char *str, int ch));
395 # else
396 # if ! @HAVE_STRCHRNUL@
397 _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
398 _GL_ATTRIBUTE_PURE
399 _GL_ARG_NONNULL ((1)));
400 # endif
401
402
403
404 _GL_CXXALIAS_SYS_CAST2 (strchrnul,
405 char *, (char const *__s, int __c_in),
406 char const *, (char const *__s, int __c_in));
407 # endif
408 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
409 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
410 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
411 _GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
412 # else
413 _GL_CXXALIASWARN (strchrnul);
414 # endif
415 #elif defined GNULIB_POSIXCHECK
416 # undef strchrnul
417 # if HAVE_RAW_DECL_STRCHRNUL
418 _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
419 "use gnulib module strchrnul for portability");
420 # endif
421 #endif
422
423
424 #if @GNULIB_STRDUP@
425 # if @REPLACE_STRDUP@
426 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
427 # undef strdup
428 # define strdup rpl_strdup
429 # endif
430 _GL_FUNCDECL_RPL (strdup, char *,
431 (char const *__s)
432 _GL_ARG_NONNULL ((1))
433 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
434 _GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
435 # elif defined _WIN32 && !defined __CYGWIN__
436 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
437 # undef strdup
438 # define strdup _strdup
439 # endif
440 _GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
441 # else
442 # if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
443
444 # undef strdup
445 # endif
446 # if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup
447 _GL_FUNCDECL_SYS (strdup, char *,
448 (char const *__s)
449 _GL_ARG_NONNULL ((1))
450 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
451 # endif
452 _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
453 # endif
454 _GL_CXXALIASWARN (strdup);
455 #else
456 # if __GNUC__ >= 11 && !defined strdup
457
458 _GL_FUNCDECL_SYS (strdup, char *,
459 (char const *__s)
460 _GL_ARG_NONNULL ((1))
461 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
462 # endif
463 # if defined GNULIB_POSIXCHECK
464 # undef strdup
465 # if HAVE_RAW_DECL_STRDUP
466 _GL_WARN_ON_USE (strdup, "strdup is unportable - "
467 "use gnulib module strdup for portability");
468 # endif
469 # elif @GNULIB_MDA_STRDUP@
470
471
472
473 # if defined _WIN32 && !defined __CYGWIN__
474 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
475 # undef strdup
476 # define strdup _strdup
477 # endif
478 _GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
479 # else
480 # if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
481 # undef strdup
482 # endif
483 _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
484 # endif
485 _GL_CXXALIASWARN (strdup);
486 # endif
487 #endif
488
489
490 #if @GNULIB_STRNCAT@
491 # if @REPLACE_STRNCAT@
492 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
493 # undef strncat
494 # define strncat rpl_strncat
495 # endif
496 _GL_FUNCDECL_RPL (strncat, char *,
497 (char *restrict dest, const char *restrict src, size_t n)
498 _GL_ARG_NONNULL ((1, 2)));
499 _GL_CXXALIAS_RPL (strncat, char *,
500 (char *restrict dest, const char *restrict src, size_t n));
501 # else
502 _GL_CXXALIAS_SYS (strncat, char *,
503 (char *restrict dest, const char *restrict src, size_t n));
504 # endif
505 # if __GLIBC__ >= 2
506 _GL_CXXALIASWARN (strncat);
507 # endif
508 #elif defined GNULIB_POSIXCHECK
509 # undef strncat
510 # if HAVE_RAW_DECL_STRNCAT
511 _GL_WARN_ON_USE (strncat, "strncat is unportable - "
512 "use gnulib module strncat for portability");
513 # endif
514 #endif
515
516
517 #if @GNULIB_STRNDUP@
518 # if @REPLACE_STRNDUP@
519 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
520 # undef strndup
521 # define strndup rpl_strndup
522 # endif
523 _GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n)
524 _GL_ARG_NONNULL ((1)));
525 _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
526 # else
527 # if ! @HAVE_DECL_STRNDUP@
528 _GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n)
529 _GL_ARG_NONNULL ((1)));
530 # endif
531 _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
532 # endif
533 _GL_CXXALIASWARN (strndup);
534 #elif defined GNULIB_POSIXCHECK
535 # undef strndup
536 # if HAVE_RAW_DECL_STRNDUP
537 _GL_WARN_ON_USE (strndup, "strndup is unportable - "
538 "use gnulib module strndup for portability");
539 # endif
540 #endif
541
542
543
544
545 #if @GNULIB_STRNLEN@
546 # if @REPLACE_STRNLEN@
547 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
548 # undef strnlen
549 # define strnlen rpl_strnlen
550 # endif
551 _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)
552 _GL_ATTRIBUTE_PURE
553 _GL_ARG_NONNULL ((1)));
554 _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen));
555 # else
556 # if ! @HAVE_DECL_STRNLEN@
557 _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)
558 _GL_ATTRIBUTE_PURE
559 _GL_ARG_NONNULL ((1)));
560 # endif
561 _GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen));
562 # endif
563 _GL_CXXALIASWARN (strnlen);
564 #elif defined GNULIB_POSIXCHECK
565 # undef strnlen
566 # if HAVE_RAW_DECL_STRNLEN
567 _GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
568 "use gnulib module strnlen for portability");
569 # endif
570 #endif
571
572 #if defined GNULIB_POSIXCHECK
573
574
575
576
577 # undef strcspn
578
579 _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
580 "in multibyte locales - "
581 "use mbscspn if you care about internationalization");
582 #endif
583
584
585 #if @GNULIB_STRPBRK@
586 # if ! @HAVE_STRPBRK@
587 _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
588 _GL_ATTRIBUTE_PURE
589 _GL_ARG_NONNULL ((1, 2)));
590 # endif
591
592
593
594 _GL_CXXALIAS_SYS_CAST2 (strpbrk,
595 char *, (char const *__s, char const *__accept),
596 const char *, (char const *__s, char const *__accept));
597 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
598 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
599 _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
600 _GL_CXXALIASWARN1 (strpbrk, char const *,
601 (char const *__s, char const *__accept));
602 # elif __GLIBC__ >= 2
603 _GL_CXXALIASWARN (strpbrk);
604 # endif
605 # if defined GNULIB_POSIXCHECK
606
607
608
609
610 # undef strpbrk
611 _GL_WARN_ON_USE_CXX (strpbrk,
612 const char *, char *, (const char *, const char *),
613 "strpbrk cannot work correctly on character strings "
614 "in multibyte locales - "
615 "use mbspbrk if you care about internationalization");
616 # endif
617 #elif defined GNULIB_POSIXCHECK
618 # undef strpbrk
619 # if HAVE_RAW_DECL_STRPBRK
620 _GL_WARN_ON_USE_CXX (strpbrk,
621 const char *, char *, (const char *, const char *),
622 "strpbrk is unportable - "
623 "use gnulib module strpbrk for portability");
624 # endif
625 #endif
626
627 #if defined GNULIB_POSIXCHECK
628
629
630 # undef strspn
631
632 _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
633 "in multibyte locales - "
634 "use mbsspn if you care about internationalization");
635 #endif
636
637 #if defined GNULIB_POSIXCHECK
638
639
640 # undef strrchr
641
642 _GL_WARN_ON_USE_CXX (strrchr,
643 const char *, char *, (const char *, int),
644 "strrchr cannot work correctly on character strings "
645 "in some multibyte locales - "
646 "use mbsrchr if you care about internationalization");
647 #endif
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665 #if @GNULIB_STRSEP@
666 # if ! @HAVE_STRSEP@
667 _GL_FUNCDECL_SYS (strsep, char *,
668 (char **restrict __stringp, char const *restrict __delim)
669 _GL_ARG_NONNULL ((1, 2)));
670 # endif
671 _GL_CXXALIAS_SYS (strsep, char *,
672 (char **restrict __stringp, char const *restrict __delim));
673 _GL_CXXALIASWARN (strsep);
674 # if defined GNULIB_POSIXCHECK
675 # undef strsep
676 _GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
677 "in multibyte locales - "
678 "use mbssep if you care about internationalization");
679 # endif
680 #elif defined GNULIB_POSIXCHECK
681 # undef strsep
682 # if HAVE_RAW_DECL_STRSEP
683 _GL_WARN_ON_USE (strsep, "strsep is unportable - "
684 "use gnulib module strsep for portability");
685 # endif
686 #endif
687
688 #if @GNULIB_STRSTR@
689 # if @REPLACE_STRSTR@
690 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
691 # define strstr rpl_strstr
692 # endif
693 _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
694 _GL_ATTRIBUTE_PURE
695 _GL_ARG_NONNULL ((1, 2)));
696 _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
697 # else
698
699
700
701 _GL_CXXALIAS_SYS_CAST2 (strstr,
702 char *, (const char *haystack, const char *needle),
703 const char *, (const char *haystack, const char *needle));
704 # endif
705 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
706 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
707 _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
708 _GL_CXXALIASWARN1 (strstr, const char *,
709 (const char *haystack, const char *needle));
710 # elif __GLIBC__ >= 2
711 _GL_CXXALIASWARN (strstr);
712 # endif
713 #elif defined GNULIB_POSIXCHECK
714
715
716
717
718 # undef strstr
719
720 _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
721 "work correctly on character strings in most "
722 "multibyte locales - "
723 "use mbsstr if you care about internationalization, "
724 "or use strstr if you care about speed");
725 #endif
726
727
728
729 #if @GNULIB_STRCASESTR@
730 # if @REPLACE_STRCASESTR@
731 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
732 # define strcasestr rpl_strcasestr
733 # endif
734 _GL_FUNCDECL_RPL (strcasestr, char *,
735 (const char *haystack, const char *needle)
736 _GL_ATTRIBUTE_PURE
737 _GL_ARG_NONNULL ((1, 2)));
738 _GL_CXXALIAS_RPL (strcasestr, char *,
739 (const char *haystack, const char *needle));
740 # else
741 # if ! @HAVE_STRCASESTR@
742 _GL_FUNCDECL_SYS (strcasestr, char *,
743 (const char *haystack, const char *needle)
744 _GL_ATTRIBUTE_PURE
745 _GL_ARG_NONNULL ((1, 2)));
746 # endif
747
748
749
750 _GL_CXXALIAS_SYS_CAST2 (strcasestr,
751 char *, (const char *haystack, const char *needle),
752 const char *, (const char *haystack, const char *needle));
753 # endif
754 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
755 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
756 _GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
757 _GL_CXXALIASWARN1 (strcasestr, const char *,
758 (const char *haystack, const char *needle));
759 # else
760 _GL_CXXALIASWARN (strcasestr);
761 # endif
762 #elif defined GNULIB_POSIXCHECK
763
764
765
766 # undef strcasestr
767 # if HAVE_RAW_DECL_STRCASESTR
768 _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
769 "strings in multibyte locales - "
770 "use mbscasestr if you care about "
771 "internationalization, or use c-strcasestr if you want "
772 "a locale independent function");
773 # endif
774 #endif
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798 #if @GNULIB_STRTOK_R@
799 # if @REPLACE_STRTOK_R@
800 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
801 # undef strtok_r
802 # define strtok_r rpl_strtok_r
803 # endif
804 _GL_FUNCDECL_RPL (strtok_r, char *,
805 (char *restrict s, char const *restrict delim,
806 char **restrict save_ptr)
807 _GL_ARG_NONNULL ((2, 3)));
808 _GL_CXXALIAS_RPL (strtok_r, char *,
809 (char *restrict s, char const *restrict delim,
810 char **restrict save_ptr));
811 # else
812 # if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
813 # undef strtok_r
814 # endif
815 # if ! @HAVE_DECL_STRTOK_R@
816 _GL_FUNCDECL_SYS (strtok_r, char *,
817 (char *restrict s, char const *restrict delim,
818 char **restrict save_ptr)
819 _GL_ARG_NONNULL ((2, 3)));
820 # endif
821 _GL_CXXALIAS_SYS (strtok_r, char *,
822 (char *restrict s, char const *restrict delim,
823 char **restrict save_ptr));
824 # endif
825 _GL_CXXALIASWARN (strtok_r);
826 # if defined GNULIB_POSIXCHECK
827 _GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
828 "strings in multibyte locales - "
829 "use mbstok_r if you care about internationalization");
830 # endif
831 #elif defined GNULIB_POSIXCHECK
832 # undef strtok_r
833 # if HAVE_RAW_DECL_STRTOK_R
834 _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
835 "use gnulib module strtok_r for portability");
836 # endif
837 #endif
838
839
840
841
842
843 #if @GNULIB_MBSLEN@
844
845
846 # ifdef __MirBSD__
847 # undef mbslen
848 # endif
849 # if @HAVE_MBSLEN@
850 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
851 # define mbslen rpl_mbslen
852 # endif
853 _GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
854 _GL_ATTRIBUTE_PURE
855 _GL_ARG_NONNULL ((1)));
856 _GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
857 # else
858 _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
859 _GL_ATTRIBUTE_PURE
860 _GL_ARG_NONNULL ((1)));
861 _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
862 # endif
863 _GL_CXXALIASWARN (mbslen);
864 #endif
865
866 #if @GNULIB_MBSNLEN@
867
868
869 _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
870 _GL_ATTRIBUTE_PURE
871 _GL_ARG_NONNULL ((1));
872 #endif
873
874 #if @GNULIB_MBSCHR@
875
876
877
878
879 # if defined __hpux
880 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
881 # define mbschr rpl_mbschr
882 # endif
883 _GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
884 _GL_ATTRIBUTE_PURE
885 _GL_ARG_NONNULL ((1)));
886 _GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
887 # else
888 _GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
889 _GL_ATTRIBUTE_PURE
890 _GL_ARG_NONNULL ((1)));
891 _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
892 # endif
893 _GL_CXXALIASWARN (mbschr);
894 #endif
895
896 #if @GNULIB_MBSRCHR@
897
898
899
900
901 # if defined __hpux || defined __INTERIX
902 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
903 # define mbsrchr rpl_mbsrchr
904 # endif
905 _GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
906 _GL_ATTRIBUTE_PURE
907 _GL_ARG_NONNULL ((1)));
908 _GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
909 # else
910 _GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
911 _GL_ATTRIBUTE_PURE
912 _GL_ARG_NONNULL ((1)));
913 _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
914 # endif
915 _GL_CXXALIASWARN (mbsrchr);
916 #endif
917
918 #if @GNULIB_MBSSTR@
919
920
921
922
923 _GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
924 _GL_ATTRIBUTE_PURE
925 _GL_ARG_NONNULL ((1, 2));
926 #endif
927
928 #if @GNULIB_MBSCASECMP@
929
930
931
932
933
934
935 _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
936 _GL_ATTRIBUTE_PURE
937 _GL_ARG_NONNULL ((1, 2));
938 #endif
939
940 #if @GNULIB_MBSNCASECMP@
941
942
943
944
945
946
947
948
949
950 _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
951 _GL_ATTRIBUTE_PURE
952 _GL_ARG_NONNULL ((1, 2));
953 #endif
954
955 #if @GNULIB_MBSPCASECMP@
956
957
958
959
960
961
962
963
964 _GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
965 _GL_ATTRIBUTE_PURE
966 _GL_ARG_NONNULL ((1, 2));
967 #endif
968
969 #if @GNULIB_MBSCASESTR@
970
971
972
973
974
975 _GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
976 _GL_ATTRIBUTE_PURE
977 _GL_ARG_NONNULL ((1, 2));
978 #endif
979
980 #if @GNULIB_MBSCSPN@
981
982
983
984
985
986 _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
987 _GL_ATTRIBUTE_PURE
988 _GL_ARG_NONNULL ((1, 2));
989 #endif
990
991 #if @GNULIB_MBSPBRK@
992
993
994
995
996 # if defined __hpux
997 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
998 # define mbspbrk rpl_mbspbrk
999 # endif
1000 _GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
1001 _GL_ATTRIBUTE_PURE
1002 _GL_ARG_NONNULL ((1, 2)));
1003 _GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
1004 # else
1005 _GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
1006 _GL_ATTRIBUTE_PURE
1007 _GL_ARG_NONNULL ((1, 2)));
1008 _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
1009 # endif
1010 _GL_CXXALIASWARN (mbspbrk);
1011 #endif
1012
1013 #if @GNULIB_MBSSPN@
1014
1015
1016
1017
1018
1019 _GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
1020 _GL_ATTRIBUTE_PURE
1021 _GL_ARG_NONNULL ((1, 2));
1022 #endif
1023
1024 #if @GNULIB_MBSSEP@
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039 _GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
1040 _GL_ARG_NONNULL ((1, 2));
1041 #endif
1042
1043 #if @GNULIB_MBSTOK_R@
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060 _GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
1061 char **save_ptr)
1062 _GL_ARG_NONNULL ((2, 3));
1063 #endif
1064
1065
1066 #if @GNULIB_STRERROR@
1067 # if @REPLACE_STRERROR@
1068 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1069 # undef strerror
1070 # define strerror rpl_strerror
1071 # endif
1072 _GL_FUNCDECL_RPL (strerror, char *, (int));
1073 _GL_CXXALIAS_RPL (strerror, char *, (int));
1074 # else
1075 _GL_CXXALIAS_SYS (strerror, char *, (int));
1076 # endif
1077 # if __GLIBC__ >= 2
1078 _GL_CXXALIASWARN (strerror);
1079 # endif
1080 #elif defined GNULIB_POSIXCHECK
1081 # undef strerror
1082
1083 _GL_WARN_ON_USE (strerror, "strerror is unportable - "
1084 "use gnulib module strerror to guarantee non-NULL result");
1085 #endif
1086
1087
1088
1089 #if @GNULIB_STRERROR_R@
1090 # if @REPLACE_STRERROR_R@
1091 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1092 # undef strerror_r
1093 # define strerror_r rpl_strerror_r
1094 # endif
1095 _GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
1096 _GL_ARG_NONNULL ((2)));
1097 _GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
1098 # else
1099 # if !@HAVE_DECL_STRERROR_R@
1100 _GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
1101 _GL_ARG_NONNULL ((2)));
1102 # endif
1103 _GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
1104 # endif
1105 # if @HAVE_DECL_STRERROR_R@
1106 _GL_CXXALIASWARN (strerror_r);
1107 # endif
1108 #elif defined GNULIB_POSIXCHECK
1109 # undef strerror_r
1110 # if HAVE_RAW_DECL_STRERROR_R
1111 _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
1112 "use gnulib module strerror_r-posix for portability");
1113 # endif
1114 #endif
1115
1116
1117 #if @GNULIB_STRERRORNAME_NP@
1118 # if @REPLACE_STRERRORNAME_NP@
1119 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1120 # undef strerrorname_np
1121 # define strerrorname_np rpl_strerrorname_np
1122 # endif
1123 _GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum));
1124 _GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum));
1125 # else
1126 # if !@HAVE_STRERRORNAME_NP@
1127 _GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum));
1128 # endif
1129 _GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum));
1130 # endif
1131 _GL_CXXALIASWARN (strerrorname_np);
1132 #elif defined GNULIB_POSIXCHECK
1133 # undef strerrorname_np
1134 # if HAVE_RAW_DECL_STRERRORNAME_NP
1135 _GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - "
1136 "use gnulib module strerrorname_np for portability");
1137 # endif
1138 #endif
1139
1140
1141 #if @GNULIB_SIGABBREV_NP@
1142 # if ! @HAVE_SIGABBREV_NP@
1143 _GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig));
1144 # endif
1145 _GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig));
1146 _GL_CXXALIASWARN (sigabbrev_np);
1147 #elif defined GNULIB_POSIXCHECK
1148 # undef sigabbrev_np
1149 # if HAVE_RAW_DECL_SIGABBREV_NP
1150 _GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - "
1151 "use gnulib module sigabbrev_np for portability");
1152 # endif
1153 #endif
1154
1155
1156 #if @GNULIB_SIGDESCR_NP@
1157 # if ! @HAVE_SIGDESCR_NP@
1158 _GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig));
1159 # endif
1160 _GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig));
1161 _GL_CXXALIASWARN (sigdescr_np);
1162 #elif defined GNULIB_POSIXCHECK
1163 # undef sigdescr_np
1164 # if HAVE_RAW_DECL_SIGDESCR_NP
1165 _GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - "
1166 "use gnulib module sigdescr_np for portability");
1167 # endif
1168 #endif
1169
1170 #if @GNULIB_STRSIGNAL@
1171 # if @REPLACE_STRSIGNAL@
1172 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1173 # define strsignal rpl_strsignal
1174 # endif
1175 _GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
1176 _GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
1177 # else
1178 # if ! @HAVE_DECL_STRSIGNAL@
1179 _GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
1180 # endif
1181
1182
1183 _GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
1184 # endif
1185 _GL_CXXALIASWARN (strsignal);
1186 #elif defined GNULIB_POSIXCHECK
1187 # undef strsignal
1188 # if HAVE_RAW_DECL_STRSIGNAL
1189 _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
1190 "use gnulib module strsignal for portability");
1191 # endif
1192 #endif
1193
1194 #if @GNULIB_STRVERSCMP@
1195 # if !@HAVE_STRVERSCMP@
1196 _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
1197 _GL_ATTRIBUTE_PURE
1198 _GL_ARG_NONNULL ((1, 2)));
1199 # endif
1200 _GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
1201 _GL_CXXALIASWARN (strverscmp);
1202 #elif defined GNULIB_POSIXCHECK
1203 # undef strverscmp
1204 # if HAVE_RAW_DECL_STRVERSCMP
1205 _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
1206 "use gnulib module strverscmp for portability");
1207 # endif
1208 #endif
1209
1210
1211 #endif
1212 #endif
1213 #endif