armOS  0.1.0
Minimal ARM Operating System for the Raspberry Pi - Documentation generated for Pi 4.
string

Small subset of string.h. More...

Collaboration diagram for string:

Files

file  string.c
 Implementation of some string.h functions.
 
file  string.h
 Definition of some string.h functions.
 

Functions

void * memset (void *s, int c, size_t n)
 
void * memcpy (void *dest, const void *src, size_t n)
 
size_t strlen (const char *s)
 
int strcmp (const char *s1, const char *s2)
 
char * strcpy (char *dest, const char *src)
 
char * strcat (char *dest, const char *src)
 
void strrev (char *s)
 

Detailed Description

Small subset of string.h.

Function Documentation

◆ memcpy()

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

Copies n bytes from memory area src to memory area dest. The memory areas must not overlap.

Returns
A pointer to dest.

◆ memset()

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

Fills the first n bytes of the memory area pointed to by s with the constant byte c.

Returns
A pointer to the memory area s.

◆ strcat()

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

Appends the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and then adds a terminating null byte.

Parameters
destA string pointer.
srcA string pointer.
Returns
A pointer to the resulting string dest.

◆ strcmp()

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

Compares the two strings s1 and s2.

Parameters
s1A string pointer.
s2A string pointer.
Returns
An integer less than, equal to, or greater than 0 if s1 is found, respectively, to be less than, to match, or be greater than s2.

◆ strcpy()

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

Copies the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest.

Parameters
destA string pointer.
srcA string pointer.
Returns
A pointer to the destination string dest.

◆ strlen()

size_t strlen ( const char *  s)

Calculates the length of the string pointed to by s, excluding the terminating null byte ('\0').

Parameters
sA string pointer.
Returns
The number of bytes in the string pointed to by s.

◆ strrev()

void strrev ( char *  s)

Reverses a given string in place.

Parameters
sA string pointer.
See also
strlen()