strings.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Copyright (C) 1991,92,96,97,99,2000,2001 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _STRINGS_H
  16. #define _STRINGS_H 1
  17. /* We don't need and should not read this file if <string.h> was already
  18. read. The one exception being that if __USE_BSD isn't defined, then
  19. these aren't defined in string.h, so we need to define them here. */
  20. #if !defined _STRING_H || !defined __USE_BSD
  21. # include <features.h>
  22. # define __need_size_t
  23. # include <stddef.h>
  24. __BEGIN_DECLS
  25. /* Compare N bytes of S1 and S2 (same as memcmp). */
  26. extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
  27. __THROW __attribute_pure__;
  28. /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
  29. extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW;
  30. /* Set N bytes of S to 0. */
  31. extern void bzero (void *__s, size_t __n) __THROW;
  32. /* Return the position of the first bit set in I, or 0 if none are set.
  33. The least-significant bit is position 1, the most-significant 32. */
  34. extern int ffs (int __i) __THROW __attribute__ ((const));
  35. /* Find the first occurrence of C in S (same as strchr). */
  36. extern char *index (__const char *__s, int __c) __THROW __attribute_pure__;
  37. /* Find the last occurrence of C in S (same as strrchr). */
  38. extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__;
  39. /* Compare S1 and S2, ignoring case. */
  40. extern int strcasecmp (__const char *__s1, __const char *__s2)
  41. __THROW __attribute_pure__;
  42. /* Compare no more than N chars of S1 and S2, ignoring case. */
  43. extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
  44. __THROW __attribute_pure__;
  45. __END_DECLS
  46. #endif /* string.h */
  47. #endif /* strings.h */