MicrOS
|
#include "stdint.h"
#include "stddef.h"
Go to the source code of this file.
Typedefs | |
typedef size_t | uint32_t |
Unsigned integral type. More... | |
Functions | |
void * | memcpy (void *destination, const void *source, size_t size) |
Copy block of memory. More... | |
void * | memmove (void *destination, const void *source, size_t size) |
Move block of memory. More... | |
char * | strcpy (char *destination, const char *source) |
Copy string. More... | |
char * | strncpy (char *destination, const char *source, size_t num) |
Copy characters from string. More... | |
char * | strcat (char *destination, const char *source) |
Concatenate strings. More... | |
char * | strncat (char *destination, const char *source, size_t num) |
Append characters from string. More... | |
int | memcmp (const void *buffer1, const void *buffer2, size_t size) |
Compare two blocks of memory. More... | |
int | strcmp (const char *str1, const char *str2) |
Compare two strings. More... | |
int | strcoll (const char *str1, const char *str2) |
Compare two strings using locale. More... | |
int | strncmp (const char *str1, const char *str2, size_t num) |
Compare two strings using locale. More... | |
size_t | strxfrm (char *destination, const char *source, size_t num) |
Transform string using locale. More... | |
void * | memchr (void *ptr, int value, size_t num) |
Locate character in block of memory. More... | |
char * | strchr (const char *str, int character) |
Locate first occurrence of character in string. More... | |
size_t | strcspn (const char *str1, const char *str2) |
Get span until character in string. More... | |
char * | strpbrk (char *str1, const char *str2) |
Locate characters in string. More... | |
char * | strrchr (char *str, int character) |
Locate last occurrence of character in string. More... | |
size_t | strspn (const char *str1, const char *str2) |
Get span of character set in string. More... | |
char * | strstr (const char *str1, const char *str2) |
Locate substring. More... | |
char * | strtok (char *str, const char *delimiters) |
Split string into tokens. More... | |
void * | memset (void *buffer, int value, size_t size) |
Fill block of memory. More... | |
char * | strerror (int errnum) |
Get pointer to error message string. More... | |
size_t | strlen (const char *str) |
Get string length. More... | |
void* memchr | ( | void * | ptr, |
int | value, | ||
size_t | num | ||
) |
Locate character in block of memory.
Searches within the first num bytes of the block of memory pointed by ptr for the first occurrence of value (interpreted as an unsigned char), and returns a pointer to it.
ptr | Pointer to the block of memory where the search is performed. |
value | Value to be located. The value is passed as an int, but the function performs a byte per byte search using the unsigned char conversion of this value. |
num | Number of bytes to be analyzed. |
int memcmp | ( | const void * | buffer1, |
const void * | buffer2, | ||
size_t | size | ||
) |
Compare two blocks of memory.
Compares the first num bytes of the block of memory pointed by ptr1 to the first num bytes pointed by ptr2, returning zero if they all match or a value different from zero representing which is greater if they do not.
ptr1 | Pointer to block of memory. |
ptr2 | Pointer to block of memory. |
num | Number of bytes to compare. |
void* memcpy | ( | void * | destination, |
const void * | source, | ||
size_t | size | ||
) |
Copy block of memory.
Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
destination | Pointer to the destination array where the content is to be copied, type-casted to a pointer of type void*. |
source | Pointer to the source of data to be copied, type-casted to a pointer of type const void*. |
num | Number of bytes to copy. |
void* memmove | ( | void * | destination, |
const void * | source, | ||
size_t | size | ||
) |
Move block of memory.
Copies the values of num bytes from the location pointed by source to the memory block pointed by destination. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap.
destination | Pointer to the destination array where the content is to be copied, type-casted to a pointer of type void*. |
source | Pointer to the source of data to be copied, type-casted to a pointer of type const void*. |
num | Number of bytes to copy. |
void* memset | ( | void * | buffer, |
int | value, | ||
size_t | size | ||
) |
Fill block of memory.
Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char).
buffer | Pointer to the block of memory to fill. |
value | Value to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value. |
size | Number of bytes to be set to the value. |
char* strcat | ( | char * | destination, |
const char * | source | ||
) |
Concatenate strings.
Appends a copy of the source string to the destination string. The terminating null character in destination is overwritten by the first character of source, and a null-character is included at the end of the new string formed by the concatenation of both in destination.
destination | Pointer to the destination array, which should contain a C string, and be large enough to contain the concatenated resulting string. |
source | C string to be appended. This should not overlap destination. |
char* strchr | ( | const char * | str, |
int | character | ||
) |
Locate first occurrence of character in string.
Returns a pointer to the first occurrence of character in the C string str.
str | C string. |
character | Character to be located. It is passed as its int promotion, but it is internally converted back to char for the comparison. |
int strcmp | ( | const char * | str1, |
const char * | str2 | ||
) |
Compare two strings.
Compares the C string str1 to the C string str2. This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ or until a terminating null-character is reached.
str1 | C string to be compared. |
str2 | C string to be compared. |
int strcoll | ( | const char * | str1, |
const char * | str2 | ||
) |
Compare two strings using locale.
Compares the C string str1 to the C string str2, both interpreted appropriately according to the LC_COLLATE category of the C locale currently selected.
str1 | C string to be compared. |
str2 | C string to be compared. |
num | Maximum number of characters to compare. |
char* strcpy | ( | char * | destination, |
const char * | source | ||
) |
Copy string.
Copies the C string pointed by source into the array pointed by destination, including the terminating null character (and stopping at that point).
destination | Pointer to the destination array where the content is to be copied. |
source | C string to be copied. |
size_t strcspn | ( | const char * | str1, |
const char * | str2 | ||
) |
Get span until character in string.
Scans str1 for the first occurrence of any of the characters that are part of str2, returning the number of characters of str1 read before this first occurrence.
str1 | C string to be scanned. |
str2 | C string containing the characters to match. |
char* strerror | ( | int | errnum | ) |
Get pointer to error message string.
Interprets the value of errnum, generating a string with a message that describes the error condition as if set to errno by a function of the library.
errnum | Error number. |
size_t strlen | ( | const char * | str | ) |
Get string length.
Returns the length of the C string str. The length of a C string is determined by the terminating null-character.
str | C string. |
char* strncat | ( | char * | destination, |
const char * | source, | ||
size_t | num | ||
) |
Append characters from string.
Appends the first num characters of source to destination, plus a terminating null-character.
destination | Pointer to the destination array, which should contain a C string, and be large enough to contain the concatenated resulting string, including the additional null-character. |
source | C string to be appended. |
num | Maximum number of characters to be appended. |
int strncmp | ( | const char * | str1, |
const char * | str2, | ||
size_t | num | ||
) |
Compare two strings using locale.
Compares up to num characters of the C string str1 to those of the C string str2.
str1 | C string to be compared. |
str2 | C string to be compared. |
char* strncpy | ( | char * | destination, |
const char * | source, | ||
size_t | num | ||
) |
Copy characters from string.
Copies the first num characters of source to destination. If the end of the source C string (which is signaled by a null-character) is found before num characters have been copied, destination is padded with zeros until a total of num characters have been written to it.
destination | Pointer to the destination array where the content is to be copied. |
source | C string to be copied. |
num | Maximum number of characters to be copied from source. |
char* strpbrk | ( | char * | str1, |
const char * | str2 | ||
) |
Locate characters in string.
Returns a pointer to the first occurrence in str1 of any of the characters that are part of str2, or a null pointer if there are no matches.
str1 | C string to be scanned. |
str2 | C string containing the characters to match. |
char* strrchr | ( | char * | str, |
int | character | ||
) |
Locate last occurrence of character in string.
Returns a pointer to the last occurrence of character in the C string str.
str1 | C string. |
character | Character to be located. It is passed as its int promotion, but it is internally converted back to char. |
size_t strspn | ( | const char * | str1, |
const char * | str2 | ||
) |
Get span of character set in string.
Returns the length of the initial portion of str1 which consists only of characters that are part of str2.
str1 | C string to be scanned. |
str2 | C string containing the characters to match. |
char* strstr | ( | const char * | str1, |
const char * | str2 | ||
) |
Locate substring.
Returns a pointer to the first occurrence of str2 in str1, or a null pointer if str2 is not part of str1.
str1 | C string to be scanned. |
str2 | C string containing the characters to match. |
char* strtok | ( | char * | str, |
const char * | delimiters | ||
) |
Split string into tokens.
A sequence of calls to this function split str into tokens, which are sequences of contiguous characters separated by any of the characters that are part of delimiters.
str | C string to truncate. |
delimeters | C string containing the delimiter characters. |
Transform string using locale.
Transforms the C string pointed by source according to the current locale and copies the first num characters of the transformed string to destination, returning its length.
destinatino | Pointer to the destination array where the content is to be copied. It can be a null pointer if the argument for num is zero. |
source | C string to be transformed. |
num | Maximum number of characters to be copied to destination. |