Back to index

glibc  2.9
strings.h
Go to the documentation of this file.
00001 /* Copyright (C) 1991,92,96,97,99,2000,2001 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef       _STRINGS_H
00020 #define       _STRINGS_H    1
00021 
00022 /* We don't need and should not read this file if <string.h> was already
00023    read. The one exception being that if __USE_BSD isn't defined, then
00024    these aren't defined in string.h, so we need to define them here.  */
00025 #if !defined _STRING_H || !defined __USE_BSD
00026 
00027 # include <features.h>
00028 # define __need_size_t
00029 # include <stddef.h>
00030 
00031 __BEGIN_DECLS
00032 
00033 /* Compare N bytes of S1 and S2 (same as memcmp).  */
00034 extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
00035      __THROW __attribute_pure__;
00036 
00037 /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
00038 extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW;
00039 
00040 /* Set N bytes of S to 0.  */
00041 extern void bzero (void *__s, size_t __n) __THROW;
00042 
00043 /* Return the position of the first bit set in I, or 0 if none are set.
00044    The least-significant bit is position 1, the most-significant 32.  */
00045 extern int ffs (int __i) __THROW __attribute__ ((const));
00046 
00047 /* Find the first occurrence of C in S (same as strchr).  */
00048 extern char *index (__const char *__s, int __c) __THROW __attribute_pure__;
00049 
00050 /* Find the last occurrence of C in S (same as strrchr).  */
00051 extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__;
00052 
00053 /* Compare S1 and S2, ignoring case.  */
00054 extern int strcasecmp (__const char *__s1, __const char *__s2)
00055      __THROW __attribute_pure__;
00056 
00057 /* Compare no more than N chars of S1 and S2, ignoring case.  */
00058 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
00059      __THROW __attribute_pure__;
00060 
00061 __END_DECLS
00062 
00063 #endif /* string.h  */
00064 
00065 #endif /* strings.h  */