|
Packit |
6c4009 |
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _STRINGS_H
|
|
Packit |
6c4009 |
#define _STRINGS_H 1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <features.h>
|
|
Packit |
6c4009 |
#define __need_size_t
|
|
Packit |
6c4009 |
#include <stddef.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Tell the caller that we provide correct C++ prototypes. */
|
|
Packit |
6c4009 |
#if defined __cplusplus && __GNUC_PREREQ (4, 4)
|
|
Packit |
6c4009 |
# define __CORRECT_ISO_CPP_STRINGS_H_PROTO
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__BEGIN_DECLS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#if defined __USE_MISC || !defined __USE_XOPEN2K8
|
|
Packit |
6c4009 |
/* Compare N bytes of S1 and S2 (same as memcmp). */
|
|
Packit |
6c4009 |
extern int bcmp (const void *__s1, const void *__s2, size_t __n)
|
|
Packit |
6c4009 |
__THROW __attribute_pure__ __nonnull ((1, 2));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
|
|
Packit |
6c4009 |
extern void bcopy (const void *__src, void *__dest, size_t __n)
|
|
Packit |
6c4009 |
__THROW __nonnull ((1, 2));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Set N bytes of S to 0. */
|
|
Packit |
6c4009 |
extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Find the first occurrence of C in S (same as strchr). */
|
|
Packit |
6c4009 |
# ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO
|
|
Packit |
6c4009 |
extern "C++"
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
extern char *index (char *__s, int __c)
|
|
Packit |
6c4009 |
__THROW __asm ("index") __attribute_pure__ __nonnull ((1));
|
|
Packit |
6c4009 |
extern const char *index (const char *__s, int __c)
|
|
Packit |
6c4009 |
__THROW __asm ("index") __attribute_pure__ __nonnull ((1));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# if defined __OPTIMIZE__
|
|
Packit |
6c4009 |
__extern_always_inline char *
|
|
Packit |
6c4009 |
index (char *__s, int __c) __THROW
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
return __builtin_index (__s, __c);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__extern_always_inline const char *
|
|
Packit |
6c4009 |
index (const char *__s, int __c) __THROW
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
return __builtin_index (__s, __c);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
# else
|
|
Packit |
6c4009 |
extern char *index (const char *__s, int __c)
|
|
Packit |
6c4009 |
__THROW __attribute_pure__ __nonnull ((1));
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Find the last occurrence of C in S (same as strrchr). */
|
|
Packit |
6c4009 |
# ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO
|
|
Packit |
6c4009 |
extern "C++"
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
extern char *rindex (char *__s, int __c)
|
|
Packit |
6c4009 |
__THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
|
|
Packit |
6c4009 |
extern const char *rindex (const char *__s, int __c)
|
|
Packit |
6c4009 |
__THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# if defined __OPTIMIZE__
|
|
Packit |
6c4009 |
__extern_always_inline char *
|
|
Packit |
6c4009 |
rindex (char *__s, int __c) __THROW
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
return __builtin_rindex (__s, __c);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__extern_always_inline const char *
|
|
Packit |
6c4009 |
rindex (const char *__s, int __c) __THROW
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
return __builtin_rindex (__s, __c);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
# else
|
|
Packit |
6c4009 |
extern char *rindex (const char *__s, int __c)
|
|
Packit |
6c4009 |
__THROW __attribute_pure__ __nonnull ((1));
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#if defined __USE_MISC || !defined __USE_XOPEN2K8 || defined __USE_XOPEN2K8XSI
|
|
Packit |
6c4009 |
/* Return the position of the first bit set in I, or 0 if none are set.
|
|
Packit |
6c4009 |
The least-significant bit is position 1, the most-significant 32. */
|
|
Packit |
6c4009 |
extern int ffs (int __i) __THROW __attribute_const__;
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* The following two functions are non-standard but necessary for non-32 bit
|
|
Packit |
6c4009 |
platforms. */
|
|
Packit |
6c4009 |
# ifdef __USE_MISC
|
|
Packit |
6c4009 |
extern int ffsl (long int __l) __THROW __attribute_const__;
|
|
Packit |
6c4009 |
__extension__ extern int ffsll (long long int __ll)
|
|
Packit |
6c4009 |
__THROW __attribute_const__;
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Compare S1 and S2, ignoring case. */
|
|
Packit |
6c4009 |
extern int strcasecmp (const char *__s1, const char *__s2)
|
|
Packit |
6c4009 |
__THROW __attribute_pure__ __nonnull ((1, 2));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Compare no more than N chars of S1 and S2, ignoring case. */
|
|
Packit |
6c4009 |
extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
|
|
Packit |
6c4009 |
__THROW __attribute_pure__ __nonnull ((1, 2));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifdef __USE_XOPEN2K8
|
|
Packit |
6c4009 |
/* POSIX.1-2008 extended locale interface (see locale.h). */
|
|
Packit |
6c4009 |
# include <bits/types/locale_t.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Compare S1 and S2, ignoring case, using collation rules from LOC. */
|
|
Packit |
6c4009 |
extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
|
|
Packit |
6c4009 |
__THROW __attribute_pure__ __nonnull ((1, 2, 3));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Compare no more than N chars of S1 and S2, ignoring case, using
|
|
Packit |
6c4009 |
collation rules from LOC. */
|
|
Packit |
6c4009 |
extern int strncasecmp_l (const char *__s1, const char *__s2,
|
|
Packit |
6c4009 |
size_t __n, locale_t __loc)
|
|
Packit |
6c4009 |
__THROW __attribute_pure__ __nonnull ((1, 2, 4));
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__END_DECLS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#if __GNUC_PREREQ (3,4) && __USE_FORTIFY_LEVEL > 0 \
|
|
Packit |
6c4009 |
&& defined __fortify_function
|
|
Packit |
6c4009 |
/* Functions with security checks. */
|
|
Packit |
6c4009 |
# if defined __USE_MISC || !defined __USE_XOPEN2K8
|
|
Packit |
6c4009 |
# include <bits/strings_fortified.h>
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* strings.h */
|