SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Functions
string.h File Reference
#include <stdarg.h>
#include <types.h>
Include dependency graph for string.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void * memcpy (void *dst, const void *src, int cnt) __attribute__((optimize("O0")))
 Copies the values of 'cnt' bytes from memory area 'src' to memory area 'dst'.
 
void * memset (void *dst, int val, int cnt) __attribute__((optimize("O0")))
 Sets the first 'cnt' bytes of the memory area pointed to by 'dst' to the specified value 'val'.
 
int memcmp (const void *dst, const void *src, unsigned int cnt) __attribute__((optimize("O0")))
 Compares the first 'cnt' bytes of the memory areas 'dst' and 'src'.
 
unsigned int strlen (const char *str) __attribute__((optimize("O0")))
 Calculates the length of the string 'str', excluding the terminating null byte.
 
unsigned int strnlen (const char *s, unsigned int n) __attribute__((optimize("O0")))
 Calculates the length of the string 's', but not more than 'n' characters.
 
char * strcpy (char *dst, const char *src) __attribute__((optimize("O0")))
 Copies the string pointed to by 'src', including the terminating null byte, to the buffer pointed to by 'dst'.
 
char * strncpy (char *dest, const char *src, unsigned int n) __attribute__((optimize("O0")))
 Copies up to 'n' characters from the string pointed to by 'src', including the terminating null byte, to the buffer pointed to by 'dest'.
 
char * strcat (char *dst, const char *src) __attribute__((optimize("O0")))
 Appends the string pointed to by 'src', including the terminating null byte, to the end of the string pointed to by 'dst'.
 
int strcmp (const char *p1, const char *p2) __attribute__((optimize("O0")))
 Compares the string pointed to by 'p1' to the string pointed to by 'p2'.
 
int strncmp (const char *p1, const char *p2, unsigned int cnt) __attribute__((optimize("O0")))
 Compares at most the first 'cnt' characters of the string pointed to by 'p1' to the string pointed to by 'p2'.
 
char * strchr (const char *s, int c) __attribute__((optimize("O0")))
 Finds the first occurrence of the character 'c' (converted to a char) in the string pointed to by 's', including the terminating null byte.
 
char * strrchr (const char *s, int c) __attribute__((optimize("O0")))
 Finds the last occurrence of the character 'c' (converted to a char) in the string pointed to by 's', including the terminating null byte.
 
char * strstr (const char *s, const char *what) __attribute__((optimize("O0")))
 Finds the first occurrence of the substring 'what' in the string 's'.
 
void * memchr (void *ptr, int value, unsigned int num) __attribute__((optimize("O0")))
 Locates the first occurrence of the character 'value' (converted to an unsigned char) in the first 'num' bytes of the memory area pointed to by 'ptr'.
 
void * memmove (void *dest, const void *src, unsigned int count) __attribute__((optimize("O0")))
 Copies 'count' bytes from the memory area 'src' to the memory area 'dest'.
 

Function Documentation

◆ memchr()

void * memchr ( void *  ptr,
int  value,
unsigned int  num 
)

Locates the first occurrence of the character 'value' (converted to an unsigned char) in the first 'num' bytes of the memory area pointed to by 'ptr'.

Parameters
ptrThe input memory area.
valueThe value to search for.
numThe number of bytes to examine.
Returns
A pointer to the located character, or NULL if the character does not occur in the memory area.

◆ memcmp()

int memcmp ( const void *  dst,
const void *  src,
unsigned int  cnt 
)

Compares the first 'cnt' bytes of the memory areas 'dst' and 'src'.

Parameters
dstThe first memory area to compare.
srcThe second memory area to compare.
cntThe number of bytes to compare.
Returns
An integer less than, equal to, or greater than zero if 'dst' is found, respectively, to be less than, to match, or be greater than 'src'.

◆ memcpy()

void * memcpy ( void *  dst,
const void *  src,
int  cnt 
)

Copies the values of 'cnt' bytes from memory area 'src' to memory area 'dst'.

Parameters
dstThe destination memory area.
srcThe source memory area.
cntThe number of bytes to copy.
Returns
A pointer to the destination memory area.

◆ memmove()

void * memmove ( void *  dest,
const void *  src,
unsigned int  count 
)

Copies 'count' bytes from the memory area 'src' to the memory area 'dest'.

The memory areas may overlap.

Parameters
destThe destination memory area.
srcThe source memory area.
countThe number of bytes to copy.
Returns
A pointer to the destination memory area.

◆ memset()

void * memset ( void *  dst,
int  val,
int  cnt 
)

Sets the first 'cnt' bytes of the memory area pointed to by 'dst' to the specified value 'val'.

Parameters
dstThe memory area to be filled.
valThe value to be set.
cntThe number of bytes to be set to the value.
Returns
A pointer to the destination memory area.

◆ strcat()

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

Appends the string pointed to by 'src', including the terminating null byte, to the end of the string pointed to by 'dst'.

Parameters
dstThe destination string.
srcThe source string.
Returns
A pointer to the destination string.

◆ strchr()

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

Finds the first occurrence of the character 'c' (converted to a char) in the string pointed to by 's', including the terminating null byte.

Parameters
sThe input string.
cThe character to search for.
Returns
A pointer to the located character, or NULL if the character does not occur in the string.

◆ strcmp()

int strcmp ( const char *  p1,
const char *  p2 
)

Compares the string pointed to by 'p1' to the string pointed to by 'p2'.

Parameters
p1The first string to compare.
p2The second string to compare.
Returns
An integer less than, equal to, or greater than zero if 'p1' is found, respectively, to be less than, to match, or be greater than 'p2'.

◆ strcpy()

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

Copies the string pointed to by 'src', including the terminating null byte, to the buffer pointed to by 'dst'.

Parameters
dstThe destination buffer.
srcThe source string.
Returns
A pointer to the destination buffer.

◆ strlen()

unsigned int strlen ( const char *  str)

Calculates the length of the string 'str', excluding the terminating null byte.

Parameters
strThe input string.
Returns
The length of the input string.

◆ strncmp()

int strncmp ( const char *  p1,
const char *  p2,
unsigned int  cnt 
)

Compares at most the first 'cnt' characters of the string pointed to by 'p1' to the string pointed to by 'p2'.

Parameters
p1The first string to compare.
p2The second string to compare.
cntThe maximum number of characters to compare.
Returns
An integer less than, equal to, or greater than zero if 'p1' is found, respectively, to be less than, to match, or be greater than 'p2'.

◆ strncpy()

char * strncpy ( char *  dest,
const char *  src,
unsigned int  n 
)

Copies up to 'n' characters from the string pointed to by 'src', including the terminating null byte, to the buffer pointed to by 'dest'.

Parameters
destThe destination buffer.
srcThe source string.
nThe maximum number of characters to be copied.
Returns
A pointer to the destination buffer.

◆ strnlen()

unsigned int strnlen ( const char *  s,
unsigned int  n 
)

Calculates the length of the string 's', but not more than 'n' characters.

Parameters
sThe input string.
nThe maximum number of characters to examine.
Returns
The length of the input string, but not more than 'n'.

◆ strrchr()

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

Finds the last occurrence of the character 'c' (converted to a char) in the string pointed to by 's', including the terminating null byte.

Parameters
sThe input string.
cThe character to search for.
Returns
A pointer to the located character, or NULL if the character does not occur in the string.

◆ strstr()

char * strstr ( const char *  s,
const char *  what 
)

Finds the first occurrence of the substring 'what' in the string 's'.

Parameters
sThe input string.
whatThe substring to search for.
Returns
A pointer to the beginning of the located substring, or NULL if the substring does not occur in the string.