00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _GL_STRING_H
00023
00024 #if __GNUC__ >= 3
00025 #pragma GCC system_header
00026 #endif
00027
00028
00029
00030 #include_next <string.h>
00031
00032 #ifndef _GL_STRING_H
00033 #define _GL_STRING_H
00034
00035
00036 #include <stddef.h>
00037
00038
00039 #if 0 && defined __MirBSD__
00040 # include <wchar.h>
00041 #endif
00042
00043 #ifndef __attribute__
00044
00045 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
00046 # define __attribute__(Spec)
00047 # endif
00048 #endif
00049
00050 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
00051 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
00052 #else
00053 # define _GL_ATTRIBUTE_PURE
00054 #endif
00055
00056
00057
00058 #if (0 || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
00059 && ! defined __GLIBC__
00060 # include <unistd.h>
00061 #endif
00062
00063
00064 #ifndef _GL_CXXDEFS_H
00065 #define _GL_CXXDEFS_H
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128 #if defined __cplusplus
00129 # define _GL_EXTERN_C extern "C"
00130 #else
00131 # define _GL_EXTERN_C extern
00132 #endif
00133
00134
00135
00136
00137
00138
00139
00140
00141 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
00142 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
00143 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
00144 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
00145
00146
00147
00148
00149
00150
00151
00152
00153 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
00154 _GL_EXTERN_C rettype func parameters_and_attributes
00155
00156
00157
00158
00159
00160
00161
00162 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
00163 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
00164 #if defined __cplusplus && defined GNULIB_NAMESPACE
00165 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00166 namespace GNULIB_NAMESPACE \
00167 { \
00168 rettype (*const func) parameters = ::rpl_func; \
00169 } \
00170 _GL_EXTERN_C int _gl_cxxalias_dummy
00171 #else
00172 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00173 _GL_EXTERN_C int _gl_cxxalias_dummy
00174 #endif
00175
00176
00177
00178
00179
00180
00181 #if defined __cplusplus && defined GNULIB_NAMESPACE
00182 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00183 namespace GNULIB_NAMESPACE \
00184 { \
00185 rettype (*const func) parameters = \
00186 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
00187 } \
00188 _GL_EXTERN_C int _gl_cxxalias_dummy
00189 #else
00190 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00191 _GL_EXTERN_C int _gl_cxxalias_dummy
00192 #endif
00193
00194
00195
00196
00197
00198
00199
00200
00201 #if defined __cplusplus && defined GNULIB_NAMESPACE
00202
00203
00204
00205
00206
00207
00208 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00209 namespace GNULIB_NAMESPACE \
00210 { \
00211 static rettype (*func) parameters = ::func; \
00212 } \
00213 _GL_EXTERN_C int _gl_cxxalias_dummy
00214 #else
00215 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00216 _GL_EXTERN_C int _gl_cxxalias_dummy
00217 #endif
00218
00219
00220
00221
00222
00223
00224 #if defined __cplusplus && defined GNULIB_NAMESPACE
00225 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00226 namespace GNULIB_NAMESPACE \
00227 { \
00228 static rettype (*func) parameters = \
00229 reinterpret_cast<rettype(*)parameters>(::func); \
00230 } \
00231 _GL_EXTERN_C int _gl_cxxalias_dummy
00232 #else
00233 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00234 _GL_EXTERN_C int _gl_cxxalias_dummy
00235 #endif
00236
00237
00238
00239
00240
00241
00242
00243 #if defined __cplusplus && defined GNULIB_NAMESPACE
00244
00245
00246
00247
00248
00249 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00250 namespace GNULIB_NAMESPACE \
00251 { \
00252 static rettype (*func) parameters = \
00253 reinterpret_cast<rettype(*)parameters>( \
00254 (rettype2(*)parameters2)(::func)); \
00255 } \
00256 _GL_EXTERN_C int _gl_cxxalias_dummy
00257 #else
00258 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00259 _GL_EXTERN_C int _gl_cxxalias_dummy
00260 #endif
00261
00262
00263
00264
00265
00266 #if defined __cplusplus && defined GNULIB_NAMESPACE
00267 # define _GL_CXXALIASWARN(func) \
00268 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
00269 # define _GL_CXXALIASWARN_1(func,namespace) \
00270 _GL_CXXALIASWARN_2 (func, namespace)
00271
00272
00273 # if !__OPTIMIZE__
00274 # define _GL_CXXALIASWARN_2(func,namespace) \
00275 _GL_WARN_ON_USE (func, \
00276 "The symbol ::" #func " refers to the system function. " \
00277 "Use " #namespace "::" #func " instead.")
00278 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00279 # define _GL_CXXALIASWARN_2(func,namespace) \
00280 extern __typeof__ (func) func
00281 # else
00282 # define _GL_CXXALIASWARN_2(func,namespace) \
00283 _GL_EXTERN_C int _gl_cxxalias_dummy
00284 # endif
00285 #else
00286 # define _GL_CXXALIASWARN(func) \
00287 _GL_EXTERN_C int _gl_cxxalias_dummy
00288 #endif
00289
00290
00291
00292
00293 #if defined __cplusplus && defined GNULIB_NAMESPACE
00294 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00295 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
00296 GNULIB_NAMESPACE)
00297 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
00298 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
00299
00300
00301 # if !__OPTIMIZE__
00302 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00303 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
00304 "The symbol ::" #func " refers to the system function. " \
00305 "Use " #namespace "::" #func " instead.")
00306 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00307 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00308 extern __typeof__ (func) func
00309 # else
00310 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00311 _GL_EXTERN_C int _gl_cxxalias_dummy
00312 # endif
00313 #else
00314 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00315 _GL_EXTERN_C int _gl_cxxalias_dummy
00316 #endif
00317
00318 #endif
00319
00320
00321
00322
00323
00324 #ifndef _GL_ARG_NONNULL
00325 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
00326 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
00327 # else
00328 # define _GL_ARG_NONNULL(params)
00329 # endif
00330 #endif
00331
00332
00333 #ifndef _GL_WARN_ON_USE
00334
00335 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00336
00337 # define _GL_WARN_ON_USE(function, message) \
00338 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
00339 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00340
00341 # define _GL_WARN_ON_USE(function, message) \
00342 extern __typeof__ (function) function
00343 # else
00344 # define _GL_WARN_ON_USE(function, message) \
00345 _GL_WARN_EXTERN_C int _gl_warn_on_use
00346 # endif
00347 #endif
00348
00349
00350
00351
00352
00353
00354
00355 #ifndef _GL_WARN_ON_USE_CXX
00356 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00357 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00358 extern rettype function parameters_and_attributes \
00359 __attribute__ ((__warning__ (msg)))
00360 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00361
00362 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00363 extern rettype function parameters_and_attributes
00364 # else
00365 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00366 _GL_WARN_EXTERN_C int _gl_warn_on_use
00367 # endif
00368 #endif
00369
00370
00371
00372 #ifndef _GL_WARN_EXTERN_C
00373 # if defined __cplusplus
00374 # define _GL_WARN_EXTERN_C extern "C"
00375 # else
00376 # define _GL_WARN_EXTERN_C extern
00377 # endif
00378 #endif
00379
00380
00381
00382 #if 1
00383 # if 0
00384 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00385 # define memchr rpl_memchr
00386 # endif
00387 _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
00388 _GL_ATTRIBUTE_PURE
00389 _GL_ARG_NONNULL ((1)));
00390 _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
00391 # else
00392 # if ! 1
00393 _GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
00394 _GL_ATTRIBUTE_PURE
00395 _GL_ARG_NONNULL ((1)));
00396 # endif
00397
00398
00399
00400 _GL_CXXALIAS_SYS_CAST2 (memchr,
00401 void *, (void const *__s, int __c, size_t __n),
00402 void const *, (void const *__s, int __c, size_t __n));
00403 # endif
00404 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
00405 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
00406 _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
00407 _GL_CXXALIASWARN1 (memchr, void const *,
00408 (void const *__s, int __c, size_t __n));
00409 # else
00410 _GL_CXXALIASWARN (memchr);
00411 # endif
00412 #elif defined GNULIB_POSIXCHECK
00413 # undef memchr
00414
00415 _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
00416 "use gnulib module memchr for portability" );
00417 #endif
00418
00419
00420 #if 0
00421 # if 0
00422 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00423 # define memmem rpl_memmem
00424 # endif
00425 _GL_FUNCDECL_RPL (memmem, void *,
00426 (void const *__haystack, size_t __haystack_len,
00427 void const *__needle, size_t __needle_len)
00428 _GL_ATTRIBUTE_PURE
00429 _GL_ARG_NONNULL ((1, 3)));
00430 _GL_CXXALIAS_RPL (memmem, void *,
00431 (void const *__haystack, size_t __haystack_len,
00432 void const *__needle, size_t __needle_len));
00433 # else
00434 # if ! 1
00435 _GL_FUNCDECL_SYS (memmem, void *,
00436 (void const *__haystack, size_t __haystack_len,
00437 void const *__needle, size_t __needle_len)
00438 _GL_ATTRIBUTE_PURE
00439 _GL_ARG_NONNULL ((1, 3)));
00440 # endif
00441 _GL_CXXALIAS_SYS (memmem, void *,
00442 (void const *__haystack, size_t __haystack_len,
00443 void const *__needle, size_t __needle_len));
00444 # endif
00445 _GL_CXXALIASWARN (memmem);
00446 #elif defined GNULIB_POSIXCHECK
00447 # undef memmem
00448 # if HAVE_RAW_DECL_MEMMEM
00449 _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
00450 "use gnulib module memmem-simple for portability, "
00451 "and module memmem for speed" );
00452 # endif
00453 #endif
00454
00455
00456
00457 #if 1
00458 # if ! 1
00459 _GL_FUNCDECL_SYS (mempcpy, void *,
00460 (void *restrict __dest, void const *restrict __src,
00461 size_t __n)
00462 _GL_ARG_NONNULL ((1, 2)));
00463 # endif
00464 _GL_CXXALIAS_SYS (mempcpy, void *,
00465 (void *restrict __dest, void const *restrict __src,
00466 size_t __n));
00467 _GL_CXXALIASWARN (mempcpy);
00468 #elif defined GNULIB_POSIXCHECK
00469 # undef mempcpy
00470 # if HAVE_RAW_DECL_MEMPCPY
00471 _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
00472 "use gnulib module mempcpy for portability");
00473 # endif
00474 #endif
00475
00476
00477 #if 1
00478 # if ! 1
00479 _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
00480 _GL_ATTRIBUTE_PURE
00481 _GL_ARG_NONNULL ((1)));
00482 # endif
00483
00484
00485
00486 _GL_CXXALIAS_SYS_CAST2 (memrchr,
00487 void *, (void const *, int, size_t),
00488 void const *, (void const *, int, size_t));
00489 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
00490 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
00491 _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
00492 _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
00493 # else
00494 _GL_CXXALIASWARN (memrchr);
00495 # endif
00496 #elif defined GNULIB_POSIXCHECK
00497 # undef memrchr
00498 # if HAVE_RAW_DECL_MEMRCHR
00499 _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
00500 "use gnulib module memrchr for portability");
00501 # endif
00502 #endif
00503
00504
00505
00506
00507 #if 0
00508 # if ! 1
00509 _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
00510 _GL_ATTRIBUTE_PURE
00511 _GL_ARG_NONNULL ((1)));
00512 # endif
00513
00514
00515
00516 _GL_CXXALIAS_SYS_CAST2 (rawmemchr,
00517 void *, (void const *__s, int __c_in),
00518 void const *, (void const *__s, int __c_in));
00519 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
00520 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
00521 _GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
00522 _GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
00523 # else
00524 _GL_CXXALIASWARN (rawmemchr);
00525 # endif
00526 #elif defined GNULIB_POSIXCHECK
00527 # undef rawmemchr
00528 # if HAVE_RAW_DECL_RAWMEMCHR
00529 _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
00530 "use gnulib module rawmemchr for portability");
00531 # endif
00532 #endif
00533
00534
00535 #if 0
00536 # if ! 1
00537 _GL_FUNCDECL_SYS (stpcpy, char *,
00538 (char *restrict __dst, char const *restrict __src)
00539 _GL_ARG_NONNULL ((1, 2)));
00540 # endif
00541 _GL_CXXALIAS_SYS (stpcpy, char *,
00542 (char *restrict __dst, char const *restrict __src));
00543 _GL_CXXALIASWARN (stpcpy);
00544 #elif defined GNULIB_POSIXCHECK
00545 # undef stpcpy
00546 # if HAVE_RAW_DECL_STPCPY
00547 _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
00548 "use gnulib module stpcpy for portability");
00549 # endif
00550 #endif
00551
00552
00553
00554 #if 0
00555 # if 0
00556 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00557 # undef stpncpy
00558 # define stpncpy rpl_stpncpy
00559 # endif
00560 _GL_FUNCDECL_RPL (stpncpy, char *,
00561 (char *restrict __dst, char const *restrict __src,
00562 size_t __n)
00563 _GL_ARG_NONNULL ((1, 2)));
00564 _GL_CXXALIAS_RPL (stpncpy, char *,
00565 (char *restrict __dst, char const *restrict __src,
00566 size_t __n));
00567 # else
00568 # if ! 1
00569 _GL_FUNCDECL_SYS (stpncpy, char *,
00570 (char *restrict __dst, char const *restrict __src,
00571 size_t __n)
00572 _GL_ARG_NONNULL ((1, 2)));
00573 # endif
00574 _GL_CXXALIAS_SYS (stpncpy, char *,
00575 (char *restrict __dst, char const *restrict __src,
00576 size_t __n));
00577 # endif
00578 _GL_CXXALIASWARN (stpncpy);
00579 #elif defined GNULIB_POSIXCHECK
00580 # undef stpncpy
00581 # if HAVE_RAW_DECL_STPNCPY
00582 _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
00583 "use gnulib module stpncpy for portability");
00584 # endif
00585 #endif
00586
00587 #if defined GNULIB_POSIXCHECK
00588
00589
00590 # undef strchr
00591
00592 _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
00593 "in some multibyte locales - "
00594 "use mbschr if you care about internationalization");
00595 #endif
00596
00597
00598 #if 0
00599 # if ! 1
00600 _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
00601 _GL_ATTRIBUTE_PURE
00602 _GL_ARG_NONNULL ((1)));
00603 # endif
00604
00605
00606
00607 _GL_CXXALIAS_SYS_CAST2 (strchrnul,
00608 char *, (char const *__s, int __c_in),
00609 char const *, (char const *__s, int __c_in));
00610 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
00611 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
00612 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
00613 _GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
00614 # else
00615 _GL_CXXALIASWARN (strchrnul);
00616 # endif
00617 #elif defined GNULIB_POSIXCHECK
00618 # undef strchrnul
00619 # if HAVE_RAW_DECL_STRCHRNUL
00620 _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
00621 "use gnulib module strchrnul for portability");
00622 # endif
00623 #endif
00624
00625
00626 #if 1
00627 # if 0
00628 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00629 # undef strdup
00630 # define strdup rpl_strdup
00631 # endif
00632 _GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
00633 _GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
00634 # else
00635 # if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
00636
00637 # undef strdup
00638 # endif
00639 # if !(1 || defined strdup)
00640 _GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
00641 # endif
00642 _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
00643 # endif
00644 _GL_CXXALIASWARN (strdup);
00645 #elif defined GNULIB_POSIXCHECK
00646 # undef strdup
00647 # if HAVE_RAW_DECL_STRDUP
00648 _GL_WARN_ON_USE (strdup, "strdup is unportable - "
00649 "use gnulib module strdup for portability");
00650 # endif
00651 #endif
00652
00653
00654 #if 0
00655 # if 0
00656 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00657 # undef strncat
00658 # define strncat rpl_strncat
00659 # endif
00660 _GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n)
00661 _GL_ARG_NONNULL ((1, 2)));
00662 _GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n));
00663 # else
00664 _GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n));
00665 # endif
00666 _GL_CXXALIASWARN (strncat);
00667 #elif defined GNULIB_POSIXCHECK
00668 # undef strncat
00669 # if HAVE_RAW_DECL_STRNCAT
00670 _GL_WARN_ON_USE (strncat, "strncat is unportable - "
00671 "use gnulib module strncat for portability");
00672 # endif
00673 #endif
00674
00675
00676 #if 0
00677 # if 0
00678 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00679 # undef strndup
00680 # define strndup rpl_strndup
00681 # endif
00682 _GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n)
00683 _GL_ARG_NONNULL ((1)));
00684 _GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
00685 # else
00686 # if ! 1
00687 _GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
00688 _GL_ARG_NONNULL ((1)));
00689 # endif
00690 _GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n));
00691 # endif
00692 _GL_CXXALIASWARN (strndup);
00693 #elif defined GNULIB_POSIXCHECK
00694 # undef strndup
00695 # if HAVE_RAW_DECL_STRNDUP
00696 _GL_WARN_ON_USE (strndup, "strndup is unportable - "
00697 "use gnulib module strndup for portability");
00698 # endif
00699 #endif
00700
00701
00702
00703
00704 #if 0
00705 # if 0
00706 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00707 # undef strnlen
00708 # define strnlen rpl_strnlen
00709 # endif
00710 _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
00711 _GL_ATTRIBUTE_PURE
00712 _GL_ARG_NONNULL ((1)));
00713 _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
00714 # else
00715 # if ! 1
00716 _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
00717 _GL_ATTRIBUTE_PURE
00718 _GL_ARG_NONNULL ((1)));
00719 # endif
00720 _GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
00721 # endif
00722 _GL_CXXALIASWARN (strnlen);
00723 #elif defined GNULIB_POSIXCHECK
00724 # undef strnlen
00725 # if HAVE_RAW_DECL_STRNLEN
00726 _GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
00727 "use gnulib module strnlen for portability");
00728 # endif
00729 #endif
00730
00731 #if defined GNULIB_POSIXCHECK
00732
00733
00734
00735
00736 # undef strcspn
00737
00738 _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
00739 "in multibyte locales - "
00740 "use mbscspn if you care about internationalization");
00741 #endif
00742
00743
00744 #if 0
00745 # if ! 1
00746 _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
00747 _GL_ATTRIBUTE_PURE
00748 _GL_ARG_NONNULL ((1, 2)));
00749 # endif
00750
00751
00752
00753 _GL_CXXALIAS_SYS_CAST2 (strpbrk,
00754 char *, (char const *__s, char const *__accept),
00755 const char *, (char const *__s, char const *__accept));
00756 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
00757 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
00758 _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
00759 _GL_CXXALIASWARN1 (strpbrk, char const *,
00760 (char const *__s, char const *__accept));
00761 # else
00762 _GL_CXXALIASWARN (strpbrk);
00763 # endif
00764 # if defined GNULIB_POSIXCHECK
00765
00766
00767
00768
00769 # undef strpbrk
00770 _GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings "
00771 "in multibyte locales - "
00772 "use mbspbrk if you care about internationalization");
00773 # endif
00774 #elif defined GNULIB_POSIXCHECK
00775 # undef strpbrk
00776 # if HAVE_RAW_DECL_STRPBRK
00777 _GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - "
00778 "use gnulib module strpbrk for portability");
00779 # endif
00780 #endif
00781
00782 #if defined GNULIB_POSIXCHECK
00783
00784
00785 # undef strspn
00786
00787 _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
00788 "in multibyte locales - "
00789 "use mbsspn if you care about internationalization");
00790 #endif
00791
00792 #if defined GNULIB_POSIXCHECK
00793
00794
00795 # undef strrchr
00796
00797 _GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
00798 "in some multibyte locales - "
00799 "use mbsrchr if you care about internationalization");
00800 #endif
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818 #if 0
00819 # if ! 1
00820 _GL_FUNCDECL_SYS (strsep, char *,
00821 (char **restrict __stringp, char const *restrict __delim)
00822 _GL_ARG_NONNULL ((1, 2)));
00823 # endif
00824 _GL_CXXALIAS_SYS (strsep, char *,
00825 (char **restrict __stringp, char const *restrict __delim));
00826 _GL_CXXALIASWARN (strsep);
00827 # if defined GNULIB_POSIXCHECK
00828 # undef strsep
00829 _GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
00830 "in multibyte locales - "
00831 "use mbssep if you care about internationalization");
00832 # endif
00833 #elif defined GNULIB_POSIXCHECK
00834 # undef strsep
00835 # if HAVE_RAW_DECL_STRSEP
00836 _GL_WARN_ON_USE (strsep, "strsep is unportable - "
00837 "use gnulib module strsep for portability");
00838 # endif
00839 #endif
00840
00841 #if 0
00842 # if 0
00843 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00844 # define strstr rpl_strstr
00845 # endif
00846 _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
00847 _GL_ATTRIBUTE_PURE
00848 _GL_ARG_NONNULL ((1, 2)));
00849 _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
00850 # else
00851
00852
00853
00854 _GL_CXXALIAS_SYS_CAST2 (strstr,
00855 char *, (const char *haystack, const char *needle),
00856 const char *, (const char *haystack, const char *needle));
00857 # endif
00858 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
00859 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
00860 _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
00861 _GL_CXXALIASWARN1 (strstr, const char *,
00862 (const char *haystack, const char *needle));
00863 # else
00864 _GL_CXXALIASWARN (strstr);
00865 # endif
00866 #elif defined GNULIB_POSIXCHECK
00867
00868
00869
00870
00871 # undef strstr
00872
00873 _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
00874 "work correctly on character strings in most "
00875 "multibyte locales - "
00876 "use mbsstr if you care about internationalization, "
00877 "or use strstr if you care about speed");
00878 #endif
00879
00880
00881
00882 #if 0
00883 # if 0
00884 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00885 # define strcasestr rpl_strcasestr
00886 # endif
00887 _GL_FUNCDECL_RPL (strcasestr, char *,
00888 (const char *haystack, const char *needle)
00889 _GL_ATTRIBUTE_PURE
00890 _GL_ARG_NONNULL ((1, 2)));
00891 _GL_CXXALIAS_RPL (strcasestr, char *,
00892 (const char *haystack, const char *needle));
00893 # else
00894 # if ! 1
00895 _GL_FUNCDECL_SYS (strcasestr, char *,
00896 (const char *haystack, const char *needle)
00897 _GL_ATTRIBUTE_PURE
00898 _GL_ARG_NONNULL ((1, 2)));
00899 # endif
00900
00901
00902
00903 _GL_CXXALIAS_SYS_CAST2 (strcasestr,
00904 char *, (const char *haystack, const char *needle),
00905 const char *, (const char *haystack, const char *needle));
00906 # endif
00907 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
00908 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
00909 _GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
00910 _GL_CXXALIASWARN1 (strcasestr, const char *,
00911 (const char *haystack, const char *needle));
00912 # else
00913 _GL_CXXALIASWARN (strcasestr);
00914 # endif
00915 #elif defined GNULIB_POSIXCHECK
00916
00917
00918
00919 # undef strcasestr
00920 # if HAVE_RAW_DECL_STRCASESTR
00921 _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
00922 "strings in multibyte locales - "
00923 "use mbscasestr if you care about "
00924 "internationalization, or use c-strcasestr if you want "
00925 "a locale independent function");
00926 # endif
00927 #endif
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951 #if 0
00952 # if 0
00953 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00954 # undef strtok_r
00955 # define strtok_r rpl_strtok_r
00956 # endif
00957 _GL_FUNCDECL_RPL (strtok_r, char *,
00958 (char *restrict s, char const *restrict delim,
00959 char **restrict save_ptr)
00960 _GL_ARG_NONNULL ((2, 3)));
00961 _GL_CXXALIAS_RPL (strtok_r, char *,
00962 (char *restrict s, char const *restrict delim,
00963 char **restrict save_ptr));
00964 # else
00965 # if 0 || defined GNULIB_POSIXCHECK
00966 # undef strtok_r
00967 # endif
00968 # if ! 1
00969 _GL_FUNCDECL_SYS (strtok_r, char *,
00970 (char *restrict s, char const *restrict delim,
00971 char **restrict save_ptr)
00972 _GL_ARG_NONNULL ((2, 3)));
00973 # endif
00974 _GL_CXXALIAS_SYS (strtok_r, char *,
00975 (char *restrict s, char const *restrict delim,
00976 char **restrict save_ptr));
00977 # endif
00978 _GL_CXXALIASWARN (strtok_r);
00979 # if defined GNULIB_POSIXCHECK
00980 _GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
00981 "strings in multibyte locales - "
00982 "use mbstok_r if you care about internationalization");
00983 # endif
00984 #elif defined GNULIB_POSIXCHECK
00985 # undef strtok_r
00986 # if HAVE_RAW_DECL_STRTOK_R
00987 _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
00988 "use gnulib module strtok_r for portability");
00989 # endif
00990 #endif
00991
00992
00993
00994
00995
00996 #if 0
00997
00998
00999 # ifdef __MirBSD__
01000 # undef mbslen
01001 # endif
01002 # if 0
01003 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01004 # define mbslen rpl_mbslen
01005 # endif
01006 _GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
01007 _GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
01008 # else
01009 _GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
01010 _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
01011 # endif
01012 _GL_CXXALIASWARN (mbslen);
01013 #endif
01014
01015 #if 0
01016
01017
01018 _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
01019 _GL_ARG_NONNULL ((1));
01020 #endif
01021
01022 #if 0
01023
01024
01025
01026
01027 # if defined __hpux
01028 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01029 # define mbschr rpl_mbschr
01030 # endif
01031 _GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
01032 _GL_ARG_NONNULL ((1)));
01033 _GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
01034 # else
01035 _GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
01036 _GL_ARG_NONNULL ((1)));
01037 _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
01038 # endif
01039 _GL_CXXALIASWARN (mbschr);
01040 #endif
01041
01042 #if 0
01043
01044
01045
01046
01047 # if defined __hpux
01048 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01049 # define mbsrchr rpl_mbsrchr
01050 # endif
01051 _GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
01052 _GL_ARG_NONNULL ((1)));
01053 _GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
01054 # else
01055 _GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
01056 _GL_ARG_NONNULL ((1)));
01057 _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
01058 # endif
01059 _GL_CXXALIASWARN (mbsrchr);
01060 #endif
01061
01062 #if 0
01063
01064
01065
01066
01067 _GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
01068 _GL_ARG_NONNULL ((1, 2));
01069 #endif
01070
01071 #if 0
01072
01073
01074
01075
01076
01077
01078 _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
01079 _GL_ARG_NONNULL ((1, 2));
01080 #endif
01081
01082 #if 0
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092 _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
01093 _GL_ARG_NONNULL ((1, 2));
01094 #endif
01095
01096 #if 0
01097
01098
01099
01100
01101
01102
01103
01104
01105 _GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
01106 _GL_ARG_NONNULL ((1, 2));
01107 #endif
01108
01109 #if 0
01110
01111
01112
01113
01114
01115 _GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
01116 _GL_ARG_NONNULL ((1, 2));
01117 #endif
01118
01119 #if 0
01120
01121
01122
01123
01124
01125 _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
01126 _GL_ARG_NONNULL ((1, 2));
01127 #endif
01128
01129 #if 0
01130
01131
01132
01133
01134 # if defined __hpux
01135 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01136 # define mbspbrk rpl_mbspbrk
01137 # endif
01138 _GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
01139 _GL_ARG_NONNULL ((1, 2)));
01140 _GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
01141 # else
01142 _GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
01143 _GL_ARG_NONNULL ((1, 2)));
01144 _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
01145 # endif
01146 _GL_CXXALIASWARN (mbspbrk);
01147 #endif
01148
01149 #if 0
01150
01151
01152
01153
01154
01155 _GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
01156 _GL_ARG_NONNULL ((1, 2));
01157 #endif
01158
01159 #if 0
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174 _GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
01175 _GL_ARG_NONNULL ((1, 2));
01176 #endif
01177
01178 #if 0
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195 _GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
01196 _GL_ARG_NONNULL ((2, 3));
01197 #endif
01198
01199
01200 #if 1
01201 # if 0
01202 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01203 # undef strerror
01204 # define strerror rpl_strerror
01205 # endif
01206 _GL_FUNCDECL_RPL (strerror, char *, (int));
01207 _GL_CXXALIAS_RPL (strerror, char *, (int));
01208 # else
01209 _GL_CXXALIAS_SYS (strerror, char *, (int));
01210 # endif
01211 _GL_CXXALIASWARN (strerror);
01212 #elif defined GNULIB_POSIXCHECK
01213 # undef strerror
01214
01215 _GL_WARN_ON_USE (strerror, "strerror is unportable - "
01216 "use gnulib module strerror to guarantee non-NULL result");
01217 #endif
01218
01219
01220
01221 #if 0
01222 # if 0
01223 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01224 # undef strerror_r
01225 # define strerror_r rpl_strerror_r
01226 # endif
01227 _GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
01228 _GL_ARG_NONNULL ((2)));
01229 _GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
01230 # else
01231 # if !1
01232 _GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
01233 _GL_ARG_NONNULL ((2)));
01234 # endif
01235 _GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
01236 # endif
01237 # if 1
01238 _GL_CXXALIASWARN (strerror_r);
01239 # endif
01240 #elif defined GNULIB_POSIXCHECK
01241 # undef strerror_r
01242 # if HAVE_RAW_DECL_STRERROR_R
01243 _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
01244 "use gnulib module strerror_r-posix for portability");
01245 # endif
01246 #endif
01247
01248 #if 0
01249 # if 0
01250 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01251 # define strsignal rpl_strsignal
01252 # endif
01253 _GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
01254 _GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
01255 # else
01256 # if ! 1
01257 _GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
01258 # endif
01259
01260
01261 _GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
01262 # endif
01263 _GL_CXXALIASWARN (strsignal);
01264 #elif defined GNULIB_POSIXCHECK
01265 # undef strsignal
01266 # if HAVE_RAW_DECL_STRSIGNAL
01267 _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
01268 "use gnulib module strsignal for portability");
01269 # endif
01270 #endif
01271
01272 #if 0
01273 # if !1
01274 _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
01275 _GL_ARG_NONNULL ((1, 2)));
01276 # endif
01277 _GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
01278 _GL_CXXALIASWARN (strverscmp);
01279 #elif defined GNULIB_POSIXCHECK
01280 # undef strverscmp
01281 # if HAVE_RAW_DECL_STRVERSCMP
01282 _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
01283 "use gnulib module strverscmp for portability");
01284 # endif
01285 #endif
01286
01287
01288 #endif
01289 #endif