include/string.h File Reference

#include <sys/types.h>

Include dependency graph for string.h:

Go to the source code of this file.

Defines

#define _ABLE_CLIB_STRING_H   1

Functions

char * strcpy (char *dest, const char *src)
 Copy one string to another.
char * strncpy (char *dest, const char *src, size_t count)
 Copy one string to another, potentially bounded by length.
size_t strlcpy (char *dest, const char *src, size_t count)
 Copy one string to another without overflow ensuring termination.
char * strcat (char *dest, const char *src)
 Concatinate two strings.
char * strncat (char *dest, const char *src, size_t n)
 Concatinate two strings, potentially bounded by length.
int stricmp (const char *, const char *, size_t)
 Compare two strings.
int strncmp (const char *s1, const char *s2, size_t n)
 Compare two strings, potentially bounded by length.
int strcmp (const char *s1, const char *s2)
 Compare two strings.
char * strdup (const char *s)
 Duplicate a string.
char * strndup (const char *s, size_t n)
 Duplicate a string, potentially bounded by length.
char * strchr (const char *s, int c)
 Find the first occurrence of a character in a string.
char * strrchr (const char *s, int c)
 Find the last occurrence of a character in a string.
char * strnchr (const char *buff, int c, int len)
 Find the first occurrence of a character in a string, potentially bounded by length.
int strnicmp (const char *s1, const char *s2, size_t len)
 Compare two strings ignoring their case, potentially bounded by length.
void * memmove (void *dest, const void *src, size_t n)
 Copy one area of memory to another, potentialy overlapping, area.
void * memcpy (void *, const void *, size_t)
 Copy one area of memory to another non-overlapping area.
int memcmp (const void *s1, const void *s2, size_t n)
 Compare to areas of memory.
void * memset (void *s, int c, size_t n)
 Set an area of memory to a value.
const char * strerror (int err)
 Get a string representing the system error message.
size_t strspn (const char *s, const char *accept)
 Search a string for the first match of a substring.
size_t strcspn (const char *s, const char *reject)
 Search a string for the first non matching segment of a substring.
char * strtok (char *str, const char *delim)
 Detokenise a string.
char * strtok_r (char *str, const char *delim, char **saveptr)
 Detokenise a string in a thread safe manner.
int strcoll (const char *s1, const char *s2)
 Compare two strings using the current locale.
char * strstr (const char *haystack, const char *needle)
 Locate a substring.
char * strpbrk (const char *s, const char *accept)
 Find the first occurrence of any of a set of characters in a string.
size_t strlen (const char *s)
 Obtain the length of a string.
char * index (const char *s, int c)
 Find the first occurrence of a character in a string.
char * rindex (const char *s, int c)
 Find the last occurrence of a character in a string.
void * memchr (const void *s, int c, size_t n)
 Scan memory for a character, potentially bounded by length.
void * memrchr (const void *s, int c, size_t n)
 Scan memory backwards for a character.
int strrespan (char **s, size_t start, size_t length, const char *replacement, size_t rep_length)
 Replaces a span within one string with another.


Define Documentation

#define _ABLE_CLIB_STRING_H   1


Function Documentation

char* index ( const char *  s,
int  c 
)

Find the first occurrence of a character in a string.

void* memchr ( const void *  s,
int  c,
size_t  n 
)

Scan memory for a character, potentially bounded by length.

int memcmp ( const void *  s1,
const void *  s2,
size_t  n 
)

Compare to areas of memory.

void* memcpy ( void *  ,
const void *  ,
size_t   
)

Copy one area of memory to another non-overlapping area.

void* memmove ( void *  dest,
const void *  src,
size_t  n 
)

Copy one area of memory to another, potentialy overlapping, area.

void* memrchr ( const void *  s,
int  c,
size_t  n 
)

Scan memory backwards for a character.

void* memset ( void *  s,
int  c,
size_t  n 
)

Set an area of memory to a value.

char* rindex ( const char *  s,
int  c 
)

Find the last occurrence of a character in a string.

char* strcat ( char *  dest,
const char *  src 
)

Concatinate two strings.

char* strchr ( const char *  s,
int  c 
)

Find the first occurrence of a character in a string.

int strcmp ( const char *  s1,
const char *  s2 
)

Compare two strings.

int strcoll ( const char *  s1,
const char *  s2 
)

Compare two strings using the current locale.

char* strcpy ( char *  dest,
const char *  src 
)

Copy one string to another.

size_t strcspn ( const char *  s,
const char *  reject 
)

Search a string for the first non matching segment of a substring.

char* strdup ( const char *  s  ) 

Duplicate a string.

const char* strerror ( int  err  ) 

Get a string representing the system error message.

int stricmp ( const char *  ,
const char *  ,
size_t   
)

Compare two strings.

size_t strlcpy ( char *  dest,
const char *  src,
size_t  count 
)

Copy one string to another without overflow ensuring termination.

Copy /a src to string /a dest of size /a count. At most count - 1 characters will be copied. Always NUL terminates (unless count == 0).

Parameters:
dest The destination string buffer.
src The source string buffer.
count The maximum size of data to place in dest.
Returns:
The length of the source string, if longer than count not all of the src string was copied.

size_t strlen ( const char *  s  ) 

Obtain the length of a string.

char* strncat ( char *  dest,
const char *  src,
size_t  n 
)

Concatinate two strings, potentially bounded by length.

char* strnchr ( const char *  buff,
int  c,
int  len 
)

Find the first occurrence of a character in a string, potentially bounded by length.

int strncmp ( const char *  s1,
const char *  s2,
size_t  n 
)

Compare two strings, potentially bounded by length.

char* strncpy ( char *  dest,
const char *  src,
size_t  count 
)

Copy one string to another, potentially bounded by length.

char* strndup ( const char *  s,
size_t  n 
)

Duplicate a string, potentially bounded by length.

The source string is copied into a new heap block but its length is limited. If the source string is longer than the limit a terminator (0) is added.

Parameters:
s The source string.
n The limit of the output strings length.
Returns:
The NULL terminated duplicated string.

int strnicmp ( const char *  s1,
const char *  s2,
size_t  len 
)

Compare two strings ignoring their case, potentially bounded by length.

char* strpbrk ( const char *  s,
const char *  accept 
)

Find the first occurrence of any of a set of characters in a string.

char* strrchr ( const char *  s,
int  c 
)

Find the last occurrence of a character in a string.

int strrespan ( char **  s,
size_t  start,
size_t  length,
const char *  replacement,
size_t  rep_length 
)

Replaces a span within one string with another.

Replaces one section of a string with a different string resizing the original string as required.

The string pointed to by s must be allocated in the heap and it must be acceptable for it to be freed. Thus once this routine has been called, the caller must not assume any pointers inside the string will remain valid.

The source span may be zero length to insert a string.

The replacement string may be empty, by setting the length set to 0, which will cause the source span to be removed.

Parameters:
s String which source span resides within.
start The offset of the span to be replaced.
length The length of the span to be replaced.
replacement The string to use as the replacement.
rep_length The length of the replacement string.
Returns:
The new length of the string or -1 on error.

size_t strspn ( const char *  s,
const char *  accept 
)

Search a string for the first match of a substring.

char* strstr ( const char *  haystack,
const char *  needle 
)

Locate a substring.

char* strtok ( char *  str,
const char *  delim 
)

Detokenise a string.

char* strtok_r ( char *  str,
const char *  delim,
char **  saveptr 
)

Detokenise a string in a thread safe manner.


Generated on Tue Jan 20 14:28:58 2009 for ABLE LIBC by  doxygen 1.5.6