00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _GL_STRING_H
00020
00021
00022 #@INCLUDE_NEXT@ @NEXT_STRING_H@
00023
00024 #ifndef _GL_STRING_H
00025 #define _GL_STRING_H
00026
00027
00028 #ifndef __attribute__
00029
00030 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
00031 # define __attribute__(Spec)
00032 # endif
00033
00034 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
00035 # define __pure__
00036 # endif
00037 #endif
00038
00039
00040
00041
00042
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046
00047
00048
00049 #if @GNULIB_MEMMEM@
00050 # if @REPLACE_MEMMEM@
00051 # define memmem rpl_memmem
00052 # endif
00053 # if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@
00054 extern void *memmem (void const *__haystack, size_t __haystack_len,
00055 void const *__needle, size_t __needle_len)
00056 __attribute__ ((__pure__));
00057 # endif
00058 #elif defined GNULIB_POSIXCHECK
00059 # undef memmem
00060 # define memmem(a,al,b,bl) \
00061 (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \
00062 "use gnulib module memmem-simple for portability, " \
00063 "and module memmem for speed" ), \
00064 memmem (a, al, b, bl))
00065 #endif
00066
00067
00068
00069 #if @GNULIB_MEMPCPY@
00070 # if ! @HAVE_MEMPCPY@
00071 extern void *mempcpy (void *restrict __dest, void const *restrict __src,
00072 size_t __n);
00073 # endif
00074 #elif defined GNULIB_POSIXCHECK
00075 # undef mempcpy
00076 # define mempcpy(a,b,n) \
00077 (GL_LINK_WARNING ("mempcpy is unportable - " \
00078 "use gnulib module mempcpy for portability"), \
00079 mempcpy (a, b, n))
00080 #endif
00081
00082
00083 #if @GNULIB_MEMRCHR@
00084 # if ! @HAVE_DECL_MEMRCHR@
00085 extern void *memrchr (void const *, int, size_t)
00086 __attribute__ ((__pure__));
00087 # endif
00088 #elif defined GNULIB_POSIXCHECK
00089 # undef memrchr
00090 # define memrchr(a,b,c) \
00091 (GL_LINK_WARNING ("memrchr is unportable - " \
00092 "use gnulib module memrchr for portability"), \
00093 memrchr (a, b, c))
00094 #endif
00095
00096
00097 #if @GNULIB_STPCPY@
00098 # if ! @HAVE_STPCPY@
00099 extern char *stpcpy (char *restrict __dst, char const *restrict __src);
00100 # endif
00101 #elif defined GNULIB_POSIXCHECK
00102 # undef stpcpy
00103 # define stpcpy(a,b) \
00104 (GL_LINK_WARNING ("stpcpy is unportable - " \
00105 "use gnulib module stpcpy for portability"), \
00106 stpcpy (a, b))
00107 #endif
00108
00109
00110
00111 #if @GNULIB_STPNCPY@
00112 # if ! @HAVE_STPNCPY@
00113 # define stpncpy gnu_stpncpy
00114 extern char *stpncpy (char *restrict __dst, char const *restrict __src,
00115 size_t __n);
00116 # endif
00117 #elif defined GNULIB_POSIXCHECK
00118 # undef stpncpy
00119 # define stpncpy(a,b,n) \
00120 (GL_LINK_WARNING ("stpncpy is unportable - " \
00121 "use gnulib module stpncpy for portability"), \
00122 stpncpy (a, b, n))
00123 #endif
00124
00125 #if defined GNULIB_POSIXCHECK
00126
00127
00128 # undef strchr
00129 # define strchr(s,c) \
00130 (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \
00131 "in some multibyte locales - " \
00132 "use mbschr if you care about internationalization"), \
00133 strchr (s, c))
00134 #endif
00135
00136
00137 #if @GNULIB_STRCHRNUL@
00138 # if ! @HAVE_STRCHRNUL@
00139 extern char *strchrnul (char const *__s, int __c_in)
00140 __attribute__ ((__pure__));
00141 # endif
00142 #elif defined GNULIB_POSIXCHECK
00143 # undef strchrnul
00144 # define strchrnul(a,b) \
00145 (GL_LINK_WARNING ("strchrnul is unportable - " \
00146 "use gnulib module strchrnul for portability"), \
00147 strchrnul (a, b))
00148 #endif
00149
00150
00151 #if @GNULIB_STRDUP@
00152 # if ! @HAVE_DECL_STRDUP@ && ! defined strdup
00153 extern char *strdup (char const *__s);
00154 # endif
00155 #elif defined GNULIB_POSIXCHECK
00156 # undef strdup
00157 # define strdup(a) \
00158 (GL_LINK_WARNING ("strdup is unportable - " \
00159 "use gnulib module strdup for portability"), \
00160 strdup (a))
00161 #endif
00162
00163
00164 #if @GNULIB_STRNDUP@
00165 # if ! @HAVE_STRNDUP@
00166 # undef strndup
00167 # define strndup rpl_strndup
00168 # endif
00169 # if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
00170 extern char *strndup (char const *__string, size_t __n);
00171 # endif
00172 #elif defined GNULIB_POSIXCHECK
00173 # undef strndup
00174 # define strndup(a,n) \
00175 (GL_LINK_WARNING ("strndup is unportable - " \
00176 "use gnulib module strndup for portability"), \
00177 strndup (a, n))
00178 #endif
00179
00180
00181
00182
00183 #if @GNULIB_STRNLEN@
00184 # if ! @HAVE_DECL_STRNLEN@
00185 extern size_t strnlen (char const *__string, size_t __maxlen)
00186 __attribute__ ((__pure__));
00187 # endif
00188 #elif defined GNULIB_POSIXCHECK
00189 # undef strnlen
00190 # define strnlen(a,n) \
00191 (GL_LINK_WARNING ("strnlen is unportable - " \
00192 "use gnulib module strnlen for portability"), \
00193 strnlen (a, n))
00194 #endif
00195
00196 #if defined GNULIB_POSIXCHECK
00197
00198
00199
00200
00201 # undef strcspn
00202 # define strcspn(s,a) \
00203 (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \
00204 "in multibyte locales - " \
00205 "use mbscspn if you care about internationalization"), \
00206 strcspn (s, a))
00207 #endif
00208
00209
00210 #if @GNULIB_STRPBRK@
00211 # if ! @HAVE_STRPBRK@
00212 extern char *strpbrk (char const *__s, char const *__accept)
00213 __attribute__ ((__pure__));
00214 # endif
00215 # if defined GNULIB_POSIXCHECK
00216
00217
00218
00219
00220 # undef strpbrk
00221 # define strpbrk(s,a) \
00222 (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \
00223 "in multibyte locales - " \
00224 "use mbspbrk if you care about internationalization"), \
00225 strpbrk (s, a))
00226 # endif
00227 #elif defined GNULIB_POSIXCHECK
00228 # undef strpbrk
00229 # define strpbrk(s,a) \
00230 (GL_LINK_WARNING ("strpbrk is unportable - " \
00231 "use gnulib module strpbrk for portability"), \
00232 strpbrk (s, a))
00233 #endif
00234
00235 #if defined GNULIB_POSIXCHECK
00236
00237
00238 # undef strspn
00239 # define strspn(s,a) \
00240 (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \
00241 "in multibyte locales - " \
00242 "use mbsspn if you care about internationalization"), \
00243 strspn (s, a))
00244 #endif
00245
00246 #if defined GNULIB_POSIXCHECK
00247
00248
00249 # undef strrchr
00250 # define strrchr(s,c) \
00251 (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \
00252 "in some multibyte locales - " \
00253 "use mbsrchr if you care about internationalization"), \
00254 strrchr (s, c))
00255 #endif
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273 #if @GNULIB_STRSEP@
00274 # if ! @HAVE_STRSEP@
00275 extern char *strsep (char **restrict __stringp, char const *restrict __delim);
00276 # endif
00277 # if defined GNULIB_POSIXCHECK
00278 # undef strsep
00279 # define strsep(s,d) \
00280 (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \
00281 "in multibyte locales - " \
00282 "use mbssep if you care about internationalization"), \
00283 strsep (s, d))
00284 # endif
00285 #elif defined GNULIB_POSIXCHECK
00286 # undef strsep
00287 # define strsep(s,d) \
00288 (GL_LINK_WARNING ("strsep is unportable - " \
00289 "use gnulib module strsep for portability"), \
00290 strsep (s, d))
00291 #endif
00292
00293 #if @GNULIB_STRSTR@
00294 # if @REPLACE_STRSTR@
00295 # define strstr rpl_strstr
00296 char *strstr (const char *haystack, const char *needle)
00297 __attribute__ ((__pure__));
00298 # endif
00299 #elif defined GNULIB_POSIXCHECK
00300
00301
00302
00303
00304 # undef strstr
00305 # define strstr(a,b) \
00306 (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \
00307 "work correctly on character strings in most " \
00308 "multibyte locales - " \
00309 "use mbsstr if you care about internationalization, " \
00310 "or use strstr if you care about speed"), \
00311 strstr (a, b))
00312 #endif
00313
00314
00315
00316 #if @GNULIB_STRCASESTR@
00317 # if @REPLACE_STRCASESTR@
00318 # define strcasestr rpl_strcasestr
00319 # endif
00320 # if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@
00321 extern char *strcasestr (const char *haystack, const char *needle)
00322 __attribute__ ((__pure__));
00323 # endif
00324 #elif defined GNULIB_POSIXCHECK
00325
00326
00327
00328 # undef strcasestr
00329 # define strcasestr(a,b) \
00330 (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \
00331 "in multibyte locales - " \
00332 "use mbscasestr if you care about " \
00333 "internationalization, or use c-strcasestr if you want " \
00334 "a locale independent function"), \
00335 strcasestr (a, b))
00336 #endif
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360 #if @GNULIB_STRTOK_R@
00361 # if ! @HAVE_DECL_STRTOK_R@
00362 extern char *strtok_r (char *restrict s, char const *restrict delim,
00363 char **restrict save_ptr);
00364 # endif
00365 # if defined GNULIB_POSIXCHECK
00366 # undef strtok_r
00367 # define strtok_r(s,d,p) \
00368 (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \
00369 "in multibyte locales - " \
00370 "use mbstok_r if you care about internationalization"), \
00371 strtok_r (s, d, p))
00372 # endif
00373 #elif defined GNULIB_POSIXCHECK
00374 # undef strtok_r
00375 # define strtok_r(s,d,p) \
00376 (GL_LINK_WARNING ("strtok_r is unportable - " \
00377 "use gnulib module strtok_r for portability"), \
00378 strtok_r (s, d, p))
00379 #endif
00380
00381
00382
00383
00384
00385 #if @GNULIB_MBSLEN@
00386
00387
00388 extern size_t mbslen (const char *string);
00389 #endif
00390
00391 #if @GNULIB_MBSNLEN@
00392
00393
00394 extern size_t mbsnlen (const char *string, size_t len);
00395 #endif
00396
00397 #if @GNULIB_MBSCHR@
00398
00399
00400
00401
00402 # define mbschr rpl_mbschr
00403 extern char * mbschr (const char *string, int c);
00404 #endif
00405
00406 #if @GNULIB_MBSRCHR@
00407
00408
00409
00410
00411 # define mbsrchr rpl_mbsrchr
00412 extern char * mbsrchr (const char *string, int c);
00413 #endif
00414
00415 #if @GNULIB_MBSSTR@
00416
00417
00418
00419
00420 extern char * mbsstr (const char *haystack, const char *needle);
00421 #endif
00422
00423 #if @GNULIB_MBSCASECMP@
00424
00425
00426
00427
00428
00429
00430 extern int mbscasecmp (const char *s1, const char *s2);
00431 #endif
00432
00433 #if @GNULIB_MBSNCASECMP@
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443 extern int mbsncasecmp (const char *s1, const char *s2, size_t n);
00444 #endif
00445
00446 #if @GNULIB_MBSPCASECMP@
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456 extern char * mbspcasecmp (const char *string, const char *prefix);
00457 #endif
00458
00459 #if @GNULIB_MBSCASESTR@
00460
00461
00462
00463
00464
00465 extern char * mbscasestr (const char *haystack, const char *needle);
00466 #endif
00467
00468 #if @GNULIB_MBSCSPN@
00469
00470
00471
00472
00473
00474 extern size_t mbscspn (const char *string, const char *accept);
00475 #endif
00476
00477 #if @GNULIB_MBSPBRK@
00478
00479
00480
00481
00482 # define mbspbrk rpl_mbspbrk
00483 extern char * mbspbrk (const char *string, const char *accept);
00484 #endif
00485
00486 #if @GNULIB_MBSSPN@
00487
00488
00489
00490
00491
00492 extern size_t mbsspn (const char *string, const char *reject);
00493 #endif
00494
00495 #if @GNULIB_MBSSEP@
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510 extern char * mbssep (char **stringp, const char *delim);
00511 #endif
00512
00513 #if @GNULIB_MBSTOK_R@
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530 extern char * mbstok_r (char *string, const char *delim, char **save_ptr);
00531 #endif
00532
00533
00534 #if @GNULIB_STRERROR@
00535 # if @REPLACE_STRERROR@
00536 # undef strerror
00537 # define strerror rpl_strerror
00538 extern char *strerror (int);
00539 # endif
00540 #elif defined GNULIB_POSIXCHECK
00541 # undef strerror
00542 # define strerror(e) \
00543 (GL_LINK_WARNING ("strerror is unportable - " \
00544 "use gnulib module strerror to guarantee non-NULL result"), \
00545 strerror (e))
00546 #endif
00547
00548 #if @GNULIB_STRSIGNAL@
00549 # if @REPLACE_STRSIGNAL@
00550 # define strsignal rpl_strsignal
00551 # endif
00552 # if ! @HAVE_DECL_STRSIGNAL@ || @REPLACE_STRSIGNAL@
00553 extern char *strsignal (int __sig);
00554 # endif
00555 #elif defined GNULIB_POSIXCHECK
00556 # undef strsignal
00557 # define strsignal(a) \
00558 (GL_LINK_WARNING ("strsignal is unportable - " \
00559 "use gnulib module strsignal for portability"), \
00560 strsignal (a))
00561 #endif
00562
00563
00564 #ifdef __cplusplus
00565 }
00566 #endif
00567
00568 #endif
00569 #endif