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