Back to index

glibc  2.9
Defines | Functions
string.h File Reference
#include <features.h>
#include <stddef.h>

Go to the source code of this file.

Defines

#define __need_size_t
#define __need_NULL

Functions

__BEGIN_NAMESPACE_STD void * memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __THROW __nonnull((1
__BEGIN_NAMESPACE_STD void void * memmove (void *__dest, __const void *__src, size_t __n) __THROW __nonnull((1
__BEGIN_NAMESPACE_STD void
void __END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD void * 
memset (void *__s, int __c, size_t __n) __THROW __nonnull((1))
int memcmp (__const void *__s1, __const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1
int void * memchr (__const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull((1))
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char * 
strcpy (char *__restrict __dest, __const char *__restrict __src) __THROW __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char
char * 
strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __THROW __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char
char char * 
strcat (char *__restrict __dest, __const char *__restrict __src) __THROW __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char
char char char * 
strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) __THROW __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char
char char char int 
strcmp (__const char *__s1, __const char *__s2) __THROW __attribute_pure__ __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char
char char char int int 
strncmp (__const char *__s1, __const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char
char char char int int int 
strcoll (__const char *__s1, __const char *__s2) __THROW __attribute_pure__ __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char
char char char int int int
size_t 
strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) __THROW __nonnull((2))
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char * 
strchr (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1))
char * strrchr (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1))
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD size_t 
strcspn (__const char *__s, __const char *__reject) __THROW __attribute_pure__ __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD size_t
size_t 
strspn (__const char *__s, __const char *__accept) __THROW __attribute_pure__ __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD size_t
size_t char * 
strpbrk (__const char *__s, __const char *__accept) __THROW __attribute_pure__ __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD size_t
size_t char char * 
strstr (__const char *__haystack, __const char *__needle) __THROW __attribute_pure__ __nonnull((1
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD size_t
size_t char char char * 
strtok (char *__restrict __s, __const char *__restrict __delim) __THROW __nonnull((2))
__END_NAMESPACE_STD char * __strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull((2
__END_NAMESPACE_STD char
__BEGIN_NAMESPACE_STD size_t 
strlen (__const char *__s) __THROW __attribute_pure__ __nonnull((1))
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char * 
strerror (int __errnum) __THROW
__END_NAMESPACE_STD void __bzero (void *__s, size_t __n) __THROW __nonnull((1))

Define Documentation

#define __need_NULL

Definition at line 32 of file string.h.

#define __need_size_t

Definition at line 31 of file string.h.


Function Documentation

__END_NAMESPACE_STD void __bzero ( void *  __s,
size_t  __n 
)

Definition at line 27 of file bzero.c.

{
  long int dstp = (long int) s;
  const op_t zero = 0;

  if (len >= 8)
    {
      size_t xlen;

      /* There are at least some bytes to zero.  No need to test
        for LEN == 0 in this alignment loop.  */
      while (dstp % OPSIZ != 0)
       {
         ((byte *) dstp)[0] = 0;
         dstp += 1;
         len -= 1;
       }

      /* Write 8 op_t per iteration until less than 8 op_t remain.  */
      xlen = len / (OPSIZ * 8);
      while (xlen != 0)
       {
         ((op_t *) dstp)[0] = zero;
         ((op_t *) dstp)[1] = zero;
         ((op_t *) dstp)[2] = zero;
         ((op_t *) dstp)[3] = zero;
         ((op_t *) dstp)[4] = zero;
         ((op_t *) dstp)[5] = zero;
         ((op_t *) dstp)[6] = zero;
         ((op_t *) dstp)[7] = zero;
         dstp += 8 * OPSIZ;
         xlen -= 1;
       }
      len %= OPSIZ * 8;

      /* Write 1 op_t per iteration until less than op_t remain.  */
      xlen = len / OPSIZ;
      while (xlen != 0)
       {
         ((op_t *) dstp)[0] = zero;
         dstp += OPSIZ;
         xlen -= 1;
       }
      len %= OPSIZ;
    }

  /* Write the last few bytes.  */
  while (len != 0)
    {
      ((byte *) dstp)[0] = 0;
      dstp += 1;
      len -= 1;
    }
}

Here is the caller graph for this function:

__END_NAMESPACE_STD char* __strtok_r ( char *__restrict  __s,
__const char *__restrict  __delim,
char **__restrict  __save_ptr 
)
int void* memchr ( __const void *  __s,
int  __c,
size_t  __n 
)

Here is the caller graph for this function:

int memcmp ( __const void *  __s1,
__const void *  __s2,
size_t  __n 
)
__BEGIN_NAMESPACE_STD void* memcpy ( void *__restrict  __dest,
__const void *__restrict  __src,
size_t  __n 
)
__BEGIN_NAMESPACE_STD void void* memmove ( void *  __dest,
__const void *  __src,
size_t  __n 
)
__BEGIN_NAMESPACE_STD void void __END_NAMESPACE_STD __BEGIN_NAMESPACE_STD void* memset ( void *  __s,
int  __c,
size_t  __n 
)

Definition at line 25 of file memset.c.

{
  long int dstp = (long int) dstpp;

  if (len >= 8)
    {
      size_t xlen;
      op_t cccc;

      cccc = (unsigned char) c;
      cccc |= cccc << 8;
      cccc |= cccc << 16;
      if (OPSIZ > 4)
       /* Do the shift in two steps to avoid warning if long has 32 bits.  */
       cccc |= (cccc << 16) << 16;

      /* There are at least some bytes to set.
        No need to test for LEN == 0 in this alignment loop.  */
      while (dstp % OPSIZ != 0)
       {
         ((byte *) dstp)[0] = c;
         dstp += 1;
         len -= 1;
       }

      /* Write 8 `op_t' per iteration until less than 8 `op_t' remain.  */
      xlen = len / (OPSIZ * 8);
      while (xlen > 0)
       {
         ((op_t *) dstp)[0] = cccc;
         ((op_t *) dstp)[1] = cccc;
         ((op_t *) dstp)[2] = cccc;
         ((op_t *) dstp)[3] = cccc;
         ((op_t *) dstp)[4] = cccc;
         ((op_t *) dstp)[5] = cccc;
         ((op_t *) dstp)[6] = cccc;
         ((op_t *) dstp)[7] = cccc;
         dstp += 8 * OPSIZ;
         xlen -= 1;
       }
      len %= OPSIZ * 8;

      /* Write 1 `op_t' per iteration until less than OPSIZ bytes remain.  */
      xlen = len / OPSIZ;
      while (xlen > 0)
       {
         ((op_t *) dstp)[0] = cccc;
         dstp += OPSIZ;
         xlen -= 1;
       }
      len %= OPSIZ;
    }

  /* Write the last few bytes.  */
  while (len > 0)
    {
      ((byte *) dstp)[0] = c;
      dstp += 1;
      len -= 1;
    }

  return dstpp;
}
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char* strcat ( char *__restrict  __dest,
__const char *__restrict  __src 
)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char* strchr ( __const char *  __s,
int  __c 
)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char char int strcmp ( __const char *  __s1,
__const char *  __s2 
)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char char int int int strcoll ( __const char *  __s1,
__const char *  __s2 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char* strcpy ( char *__restrict  __dest,
__const char *__restrict  __src 
)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD size_t strcspn ( __const char *  __s,
__const char *  __reject 
)

Definition at line 30 of file strerror.c.

{
  char *ret = __strerror_r (errnum, NULL, 0);
  int saved_errno;

  if (__builtin_expect (ret != NULL, 1))
    return ret;
  saved_errno = errno;
  if (buf == NULL)
    buf = malloc (1024);
  __set_errno (saved_errno);
  if (buf == NULL)
    return _("Unknown error");
  return __strerror_r (errnum, buf, 1024);
}
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char char* strncat ( char *__restrict  __dest,
__const char *__restrict  __src,
size_t  __n 
)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char char int int strncmp ( __const char *  __s1,
__const char *  __s2,
size_t  __n 
)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char* strncpy ( char *__restrict  __dest,
__const char *__restrict  __src,
size_t  __n 
)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD size_t size_t char* strpbrk ( __const char *  __s,
__const char *  __accept 
)
char* strrchr ( __const char *  __s,
int  __c 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD size_t size_t char char* strstr ( __const char *  __haystack,
__const char *  __needle 
)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD size_t size_t char char char* strtok ( char *__restrict  __s,
__const char *__restrict  __delim 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char char int int int size_t strxfrm ( char *__restrict  __dest,
__const char *__restrict  __src,
size_t  __n 
)

Here is the caller graph for this function: