1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 2 /* A substitute <strings.h>. 3 4 Copyright (C) 2007-2018 Free Software Foundation, Inc. 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 3, or (at your option) 9 any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, see <https://www.gnu.org/licenses/>. */ 18 19 #ifndef _GL_STRINGS_H 20 21 #if __GNUC__ >= 3 22 #pragma GCC system_header 23 #endif 24 25 26 /* Minix 3.1.8 has a bug: <sys/types.h> must be included before <strings.h>. 27 But avoid namespace pollution on glibc systems. */ 28 #if defined __minix && !defined __GLIBC__ 29 # include <sys/types.h> 30 #endif 31 32 /* The include_next requires a split double-inclusion guard. */ 33 #if 1 34 # include_next <strings.h> 35 #endif 36 37 #ifndef _GL_STRINGS_H 38 #define _GL_STRINGS_H 39 40 #if ! 1 41 /* Get size_t. */ 42 # include <stddef.h> 43 #endif 44 45 46 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 47 /* C++ compatible function declaration macros. 48 Copyright (C) 2010-2018 Free Software Foundation, Inc. 49 50 This program is free software: you can redistribute it and/or modify it 51 under the terms of the GNU General Public License as published 52 by the Free Software Foundation; either version 3 of the License, or 53 (at your option) any later version. 54 55 This program is distributed in the hope that it will be useful, 56 but WITHOUT ANY WARRANTY; without even the implied warranty of 57 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 58 General Public License for more details. 59 60 You should have received a copy of the GNU General Public License 61 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 62 63 #ifndef _GL_CXXDEFS_H 64 #define _GL_CXXDEFS_H 65 66 /* Begin/end the GNULIB_NAMESPACE namespace. */ 67 #if defined __cplusplus && defined GNULIB_NAMESPACE 68 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { 69 # define _GL_END_NAMESPACE } 70 #else 71 # define _GL_BEGIN_NAMESPACE 72 # define _GL_END_NAMESPACE 73 #endif 74 75 /* The three most frequent use cases of these macros are: 76 77 * For providing a substitute for a function that is missing on some 78 platforms, but is declared and works fine on the platforms on which 79 it exists: 80 81 #if @GNULIB_FOO@ 82 # if !@HAVE_FOO@ 83 _GL_FUNCDECL_SYS (foo, ...); 84 # endif 85 _GL_CXXALIAS_SYS (foo, ...); 86 _GL_CXXALIASWARN (foo); 87 #elif defined GNULIB_POSIXCHECK 88 ... 89 #endif 90 91 * For providing a replacement for a function that exists on all platforms, 92 but is broken/insufficient and needs to be replaced on some platforms: 93 94 #if @GNULIB_FOO@ 95 # if @REPLACE_FOO@ 96 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 97 # undef foo 98 # define foo rpl_foo 99 # endif 100 _GL_FUNCDECL_RPL (foo, ...); 101 _GL_CXXALIAS_RPL (foo, ...); 102 # else 103 _GL_CXXALIAS_SYS (foo, ...); 104 # endif 105 _GL_CXXALIASWARN (foo); 106 #elif defined GNULIB_POSIXCHECK 107 ... 108 #endif 109 110 * For providing a replacement for a function that exists on some platforms 111 but is broken/insufficient and needs to be replaced on some of them and 112 is additionally either missing or undeclared on some other platforms: 113 114 #if @GNULIB_FOO@ 115 # if @REPLACE_FOO@ 116 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 117 # undef foo 118 # define foo rpl_foo 119 # endif 120 _GL_FUNCDECL_RPL (foo, ...); 121 _GL_CXXALIAS_RPL (foo, ...); 122 # else 123 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ 124 _GL_FUNCDECL_SYS (foo, ...); 125 # endif 126 _GL_CXXALIAS_SYS (foo, ...); 127 # endif 128 _GL_CXXALIASWARN (foo); 129 #elif defined GNULIB_POSIXCHECK 130 ... 131 #endif 132 */ 133 134 /* _GL_EXTERN_C declaration; 135 performs the declaration with C linkage. */ 136 #if defined __cplusplus 137 # define _GL_EXTERN_C extern "C" 138 #else 139 # define _GL_EXTERN_C extern 140 #endif 141 142 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); 143 declares a replacement function, named rpl_func, with the given prototype, 144 consisting of return type, parameters, and attributes. 145 Example: 146 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) 147 _GL_ARG_NONNULL ((1))); 148 */ 149 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ 150 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) 151 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ 152 _GL_EXTERN_C rettype rpl_func parameters_and_attributes 153 154 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); 155 declares the system function, named func, with the given prototype, 156 consisting of return type, parameters, and attributes. 157 Example: 158 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) 159 _GL_ARG_NONNULL ((1))); 160 */ 161 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ 162 _GL_EXTERN_C rettype func parameters_and_attributes 163 164 /* _GL_CXXALIAS_RPL (func, rettype, parameters); 165 declares a C++ alias called GNULIB_NAMESPACE::func 166 that redirects to rpl_func, if GNULIB_NAMESPACE is defined. 167 Example: 168 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); 169 170 Wrapping rpl_func in an object with an inline conversion operator 171 avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is 172 actually used in the program. */ 173 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ 174 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) 175 #if defined __cplusplus && defined GNULIB_NAMESPACE 176 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 177 namespace GNULIB_NAMESPACE \ 178 { \ 179 static const struct _gl_ ## func ## _wrapper \ 180 { \ 181 typedef rettype (*type) parameters; \ 182 \ 183 inline operator type () const \ 184 { \ 185 return ::rpl_func; \ 186 } \ 187 } func = {}; \ 188 } \ 189 _GL_EXTERN_C int _gl_cxxalias_dummy 190 #else 191 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 192 _GL_EXTERN_C int _gl_cxxalias_dummy 193 #endif 194 195 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); 196 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); 197 except that the C function rpl_func may have a slightly different 198 declaration. A cast is used to silence the "invalid conversion" error 199 that would otherwise occur. */ 200 #if defined __cplusplus && defined GNULIB_NAMESPACE 201 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 202 namespace GNULIB_NAMESPACE \ 203 { \ 204 static const struct _gl_ ## func ## _wrapper \ 205 { \ 206 typedef rettype (*type) parameters; \ 207 \ 208 inline operator type () const \ 209 { \ 210 return reinterpret_cast<type>(::rpl_func); \ 211 } \ 212 } func = {}; \ 213 } \ 214 _GL_EXTERN_C int _gl_cxxalias_dummy 215 #else 216 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 217 _GL_EXTERN_C int _gl_cxxalias_dummy 218 #endif 219 220 /* _GL_CXXALIAS_SYS (func, rettype, parameters); 221 declares a C++ alias called GNULIB_NAMESPACE::func 222 that redirects to the system provided function func, if GNULIB_NAMESPACE 223 is defined. 224 Example: 225 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); 226 227 Wrapping func in an object with an inline conversion operator 228 avoids a reference to func unless GNULIB_NAMESPACE::func is 229 actually used in the program. */ 230 #if defined __cplusplus && defined GNULIB_NAMESPACE 231 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 232 namespace GNULIB_NAMESPACE \ 233 { \ 234 static const struct _gl_ ## func ## _wrapper \ 235 { \ 236 typedef rettype (*type) parameters; \ 237 \ 238 inline operator type () const \ 239 { \ 240 return ::func; \ 241 } \ 242 } func = {}; \ 243 } \ 244 _GL_EXTERN_C int _gl_cxxalias_dummy 245 #else 246 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 247 _GL_EXTERN_C int _gl_cxxalias_dummy 248 #endif 249 250 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); 251 is like _GL_CXXALIAS_SYS (func, rettype, parameters); 252 except that the C function func may have a slightly different declaration. 253 A cast is used to silence the "invalid conversion" error that would 254 otherwise occur. */ 255 #if defined __cplusplus && defined GNULIB_NAMESPACE 256 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 257 namespace GNULIB_NAMESPACE \ 258 { \ 259 static const struct _gl_ ## func ## _wrapper \ 260 { \ 261 typedef rettype (*type) parameters; \ 262 \ 263 inline operator type () const \ 264 { \ 265 return reinterpret_cast<type>(::func); \ 266 } \ 267 } func = {}; \ 268 } \ 269 _GL_EXTERN_C int _gl_cxxalias_dummy 270 #else 271 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 272 _GL_EXTERN_C int _gl_cxxalias_dummy 273 #endif 274 275 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); 276 is like _GL_CXXALIAS_SYS (func, rettype, parameters); 277 except that the C function is picked among a set of overloaded functions, 278 namely the one with rettype2 and parameters2. Two consecutive casts 279 are used to silence the "cannot find a match" and "invalid conversion" 280 errors that would otherwise occur. */ 281 #if defined __cplusplus && defined GNULIB_NAMESPACE 282 /* The outer cast must be a reinterpret_cast. 283 The inner cast: When the function is defined as a set of overloaded 284 functions, it works as a static_cast<>, choosing the designated variant. 285 When the function is defined as a single variant, it works as a 286 reinterpret_cast<>. The parenthesized cast syntax works both ways. */ 287 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 288 namespace GNULIB_NAMESPACE \ 289 { \ 290 static const struct _gl_ ## func ## _wrapper \ 291 { \ 292 typedef rettype (*type) parameters; \ 293 \ 294 inline operator type () const \ 295 { \ 296 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ 297 } \ 298 } func = {}; \ 299 } \ 300 _GL_EXTERN_C int _gl_cxxalias_dummy 301 #else 302 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 303 _GL_EXTERN_C int _gl_cxxalias_dummy 304 #endif 305 306 /* _GL_CXXALIASWARN (func); 307 causes a warning to be emitted when ::func is used but not when 308 GNULIB_NAMESPACE::func is used. func must be defined without overloaded 309 variants. */ 310 #if defined __cplusplus && defined GNULIB_NAMESPACE 311 # define _GL_CXXALIASWARN(func) \ 312 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 313 # define _GL_CXXALIASWARN_1(func,namespace) \ 314 _GL_CXXALIASWARN_2 (func, namespace) 315 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 316 we enable the warning only when not optimizing. */ 317 # if !__OPTIMIZE__ 318 # define _GL_CXXALIASWARN_2(func,namespace) \ 319 _GL_WARN_ON_USE (func, \ 320 "The symbol ::" #func " refers to the system function. " \ 321 "Use " #namespace "::" #func " instead.") 322 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 323 # define _GL_CXXALIASWARN_2(func,namespace) \ 324 extern __typeof__ (func) func 325 # else 326 # define _GL_CXXALIASWARN_2(func,namespace) \ 327 _GL_EXTERN_C int _gl_cxxalias_dummy 328 # endif 329 #else 330 # define _GL_CXXALIASWARN(func) \ 331 _GL_EXTERN_C int _gl_cxxalias_dummy 332 #endif 333 334 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); 335 causes a warning to be emitted when the given overloaded variant of ::func 336 is used but not when GNULIB_NAMESPACE::func is used. */ 337 #if defined __cplusplus && defined GNULIB_NAMESPACE 338 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 339 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 340 GNULIB_NAMESPACE) 341 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 342 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 343 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 344 we enable the warning only when not optimizing. */ 345 # if !__OPTIMIZE__ 346 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 347 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ 348 "The symbol ::" #func " refers to the system function. " \ 349 "Use " #namespace "::" #func " instead.") 350 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 351 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 352 extern __typeof__ (func) func 353 # else 354 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 355 _GL_EXTERN_C int _gl_cxxalias_dummy 356 # endif 357 #else 358 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 359 _GL_EXTERN_C int _gl_cxxalias_dummy 360 #endif 361 362 #endif /* _GL_CXXDEFS_H */ 363 364 /* The definition of _GL_ARG_NONNULL is copied here. */ 365 /* A C macro for declaring that specific arguments must not be NULL. 366 Copyright (C) 2009-2018 Free Software Foundation, Inc. 367 368 This program is free software: you can redistribute it and/or modify it 369 under the terms of the GNU General Public License as published 370 by the Free Software Foundation; either version 3 of the License, or 371 (at your option) any later version. 372 373 This program is distributed in the hope that it will be useful, 374 but WITHOUT ANY WARRANTY; without even the implied warranty of 375 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 376 General Public License for more details. 377 378 You should have received a copy of the GNU General Public License 379 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 380 381 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools 382 that the values passed as arguments n, ..., m must be non-NULL pointers. 383 n = 1 stands for the first argument, n = 2 for the second argument etc. */ 384 #ifndef _GL_ARG_NONNULL 385 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 386 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 387 # else 388 # define _GL_ARG_NONNULL(params) 389 # endif 390 #endif 391 392 /* The definition of _GL_WARN_ON_USE is copied here. */ 393 /* A C macro for emitting warnings if a function is used. 394 Copyright (C) 2010-2018 Free Software Foundation, Inc. 395 396 This program is free software: you can redistribute it and/or modify it 397 under the terms of the GNU General Public License as published 398 by the Free Software Foundation; either version 3 of the License, or 399 (at your option) any later version. 400 401 This program is distributed in the hope that it will be useful, 402 but WITHOUT ANY WARRANTY; without even the implied warranty of 403 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 404 General Public License for more details. 405 406 You should have received a copy of the GNU General Public License 407 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 408 409 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration 410 for FUNCTION which will then trigger a compiler warning containing 411 the text of "literal string" anywhere that function is called, if 412 supported by the compiler. If the compiler does not support this 413 feature, the macro expands to an unused extern declaration. 414 415 _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the 416 attribute used in _GL_WARN_ON_USE. If the compiler does not support 417 this feature, it expands to empty. 418 419 These macros are useful for marking a function as a potential 420 portability trap, with the intent that "literal string" include 421 instructions on the replacement function that should be used 422 instead. 423 _GL_WARN_ON_USE is for functions with 'extern' linkage. 424 _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' 425 linkage. 426 427 However, one of the reasons that a function is a portability trap is 428 if it has the wrong signature. Declaring FUNCTION with a different 429 signature in C is a compilation error, so this macro must use the 430 same type as any existing declaration so that programs that avoid 431 the problematic FUNCTION do not fail to compile merely because they 432 included a header that poisoned the function. But this implies that 433 _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already 434 have a declaration. Use of this macro implies that there must not 435 be any other macro hiding the declaration of FUNCTION; but 436 undefining FUNCTION first is part of the poisoning process anyway 437 (although for symbols that are provided only via a macro, the result 438 is a compilation error rather than a warning containing 439 "literal string"). Also note that in C++, it is only safe to use if 440 FUNCTION has no overloads. 441 442 For an example, it is possible to poison 'getline' by: 443 - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], 444 [getline]) in configure.ac, which potentially defines 445 HAVE_RAW_DECL_GETLINE 446 - adding this code to a header that wraps the system <stdio.h>: 447 #undef getline 448 #if HAVE_RAW_DECL_GETLINE 449 _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" 450 "not universally present; use the gnulib module getline"); 451 #endif 452 453 It is not possible to directly poison global variables. But it is 454 possible to write a wrapper accessor function, and poison that 455 (less common usage, like &environ, will cause a compilation error 456 rather than issue the nice warning, but the end result of informing 457 the developer about their portability problem is still achieved): 458 #if HAVE_RAW_DECL_ENVIRON 459 static char *** 460 rpl_environ (void) { return &environ; } 461 _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); 462 # undef environ 463 # define environ (*rpl_environ ()) 464 #endif 465 or better (avoiding contradictory use of 'static' and 'extern'): 466 #if HAVE_RAW_DECL_ENVIRON 467 static char *** 468 _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") 469 rpl_environ (void) { return &environ; } 470 # undef environ 471 # define environ (*rpl_environ ()) 472 #endif 473 */ 474 #ifndef _GL_WARN_ON_USE 475 476 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 477 /* A compiler attribute is available in gcc versions 4.3.0 and later. */ 478 # define _GL_WARN_ON_USE(function, message) \ 479 extern __typeof__ (function) function __attribute__ ((__warning__ (message))) 480 # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ 481 __attribute__ ((__warning__ (message))) 482 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 483 /* Verify the existence of the function. */ 484 # define _GL_WARN_ON_USE(function, message) \ 485 extern __typeof__ (function) function 486 # define _GL_WARN_ON_USE_ATTRIBUTE(message) 487 # else /* Unsupported. */ 488 # define _GL_WARN_ON_USE(function, message) \ 489 _GL_WARN_EXTERN_C int _gl_warn_on_use 490 # define _GL_WARN_ON_USE_ATTRIBUTE(message) 491 # endif 492 #endif 493 494 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") 495 is like _GL_WARN_ON_USE (function, "string"), except that the function is 496 declared with the given prototype, consisting of return type, parameters, 497 and attributes. 498 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does 499 not work in this case. */ 500 #ifndef _GL_WARN_ON_USE_CXX 501 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 502 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 503 extern rettype function parameters_and_attributes \ 504 __attribute__ ((__warning__ (msg))) 505 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 506 /* Verify the existence of the function. */ 507 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 508 extern rettype function parameters_and_attributes 509 # else /* Unsupported. */ 510 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 511 _GL_WARN_EXTERN_C int _gl_warn_on_use 512 # endif 513 #endif 514 515 /* _GL_WARN_EXTERN_C declaration; 516 performs the declaration with C linkage. */ 517 #ifndef _GL_WARN_EXTERN_C 518 # if defined __cplusplus 519 # define _GL_WARN_EXTERN_C extern "C" 520 # else 521 # define _GL_WARN_EXTERN_C extern 522 # endif 523 #endif 524 525 #ifdef __cplusplus 526 extern "C" { 527 #endif 528 529 530 /* Find the index of the least-significant set bit. */ 531 #if 0 532 # if !1 533 _GL_FUNCDECL_SYS (ffs, int, (int i)); 534 # endif 535 _GL_CXXALIAS_SYS (ffs, int, (int i)); 536 _GL_CXXALIASWARN (ffs); 537 #elif defined GNULIB_POSIXCHECK 538 # undef ffs 539 # if HAVE_RAW_DECL_FFS 540 _GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module"); 541 # endif 542 #endif 543 544 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or 545 greater than zero if S1 is lexicographically less than, equal to or greater 546 than S2. 547 Note: This function does not work in multibyte locales. */ 548 #if ! 1 549 extern int strcasecmp (char const *s1, char const *s2) 550 _GL_ARG_NONNULL ((1, 2)); 551 #endif 552 #if defined GNULIB_POSIXCHECK 553 /* strcasecmp() does not work with multibyte strings: 554 POSIX says that it operates on "strings", and "string" in POSIX is defined 555 as a sequence of bytes, not of characters. */ 556 # undef strcasecmp 557 # if HAVE_RAW_DECL_STRCASECMP 558 _GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character " 559 "strings in multibyte locales - " 560 "use mbscasecmp if you care about " 561 "internationalization, or use c_strcasecmp , " 562 "gnulib module c-strcase) if you want a locale " 563 "independent function"); 564 # endif 565 #endif 566 567 /* Compare no more than N bytes of strings S1 and S2, ignoring case, 568 returning less than, equal to or greater than zero if S1 is 569 lexicographically less than, equal to or greater than S2. 570 Note: This function cannot work correctly in multibyte locales. */ 571 #if ! 1 572 extern int strncasecmp (char const *s1, char const *s2, size_t n) 573 _GL_ARG_NONNULL ((1, 2)); 574 #endif 575 #if defined GNULIB_POSIXCHECK 576 /* strncasecmp() does not work with multibyte strings: 577 POSIX says that it operates on "strings", and "string" in POSIX is defined 578 as a sequence of bytes, not of characters. */ 579 # undef strncasecmp 580 # if HAVE_RAW_DECL_STRNCASECMP 581 _GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character " 582 "strings in multibyte locales - " 583 "use mbsncasecmp or mbspcasecmp if you care about " 584 "internationalization, or use c_strncasecmp , " 585 "gnulib module c-strcase) if you want a locale " 586 "independent function"); 587 # endif 588 #endif 589 590 591 #ifdef __cplusplus 592 } 593 #endif 594 595 #endif /* _GL_STRING_H */ 596 #endif /* _GL_STRING_H */ 597