Phoenix
Object-oriented orthogonally persistent operating system
|
Run-time mid-level support functions. More...
#include <sys.h>
Functions | |
ASMCALL void * | memset (void *dst, u8 value, size_t size) |
Fill block of memory. | |
ASMCALL void * | memcpy (void *dst, const void *src, size_t size) |
Copy block of memory. | |
ASMCALL void * | memmove (void *dst, const void *src, size_t size) |
Move block of memory. | |
ASMCALL int | memcmp (const void *ptr1, const void *ptr2, size_t size) |
Compare two blocks of memory. | |
ASMCALL void * | memchr (void *ptr, int value, size_t size) |
Locate character in block of memory. | |
ASMCALL int | toupper (int c) |
Convert ASCII character to upper case. | |
ASMCALL int | tolower (int c) |
Convert ASCII character to lower case. | |
ASMCALL bool | isalnum (int c) |
Check if ASCII character belongs to alphanumeric class. | |
ASMCALL bool | isalpha (int c) |
Check if ASCII character is alphabetic. | |
ASMCALL bool | iscntrl (int c) |
Check is ASCII character is control character. | |
ASMCALL bool | isdigit (int c) |
Check if ASCII character is digit. | |
ASMCALL bool | isgraph (int c) |
Check if ASCII character is pseudo-graphical character. | |
ASMCALL bool | islower (int c) |
Check if ASCII character is lower case alphabetical character. | |
ASMCALL bool | isprint (int c) |
Check if ASCII character is printable. | |
ASMCALL bool | ispunct (int c) |
Check if ASCII character is punctuation character. | |
ASMCALL bool | isspace (int c) |
Check if ASCII character is space character. | |
ASMCALL bool | isupper (int c) |
Check if ASCII character is upper case alphabetical character. | |
ASMCALL bool | isxdigit (int c) |
Check if ASCII character is hexadecimal digit. | |
ASMCALL bool | isascii (int c) |
Check if ASCII character belongs to low part half of ASCII table. | |
int | sscanf (const char *str, const char *fmt,...) |
Parse string into provided variables. | |
int | vsscanf (const char *str, char const *fmt, va_list ap) |
Parse string into provided variables. |
Run-time mid-level support functions.
This file contains definitions for C run-time support functions.
ASMCALL bool isalnum | ( | int | c | ) |
Check if ASCII character belongs to alphanumeric class.
ASMCALL bool isalpha | ( | int | c | ) |
Check if ASCII character is alphabetic.
ASMCALL bool isascii | ( | int | c | ) |
Check if ASCII character belongs to low part half of ASCII table.
ASMCALL bool iscntrl | ( | int | c | ) |
Check is ASCII character is control character.
ASMCALL bool isdigit | ( | int | c | ) |
Check if ASCII character is digit.
ASMCALL bool isgraph | ( | int | c | ) |
Check if ASCII character is pseudo-graphical character.
ASMCALL bool islower | ( | int | c | ) |
Check if ASCII character is lower case alphabetical character.
ASMCALL bool isprint | ( | int | c | ) |
Check if ASCII character is printable.
ASMCALL bool ispunct | ( | int | c | ) |
Check if ASCII character is punctuation character.
ASMCALL bool isspace | ( | int | c | ) |
Check if ASCII character is space character.
ASMCALL bool isupper | ( | int | c | ) |
Check if ASCII character is upper case alphabetical character.
ASMCALL bool isxdigit | ( | int | c | ) |
Check if ASCII character is hexadecimal digit.
ASMCALL void* memchr | ( | void * | ptr, |
int | value, | ||
size_t | size | ||
) |
Locate character in block of memory.
Searches within the first size 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. |
size | Number of bytes to be analyzed. |
ASMCALL int memcmp | ( | const void * | ptr1, |
const void * | ptr2, | ||
size_t | size | ||
) |
Compare two blocks of memory.
Compares the first size bytes of the block of memory pointed by ptr1 to the first size 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. |
size | Number of bytes to compare. |
ASMCALL void* memcpy | ( | void * | dst, |
const void * | src, | ||
size_t | size | ||
) |
Copy block of memory.
Copies the values of size bytes from the location pointed by src directly to the memory block pointed by dst.
dst | Pointer to the destination array where the content is to be copied, type-casted to a pointer of type void* . |
src | Pointer to the source of data to be copied, type-casted to a pointer of type void* . |
size | Number of bytes to copy. |
ASMCALL void* memmove | ( | void * | dst, |
const void * | src, | ||
size_t | size | ||
) |
Move block of memory.
Copies the values of size bytes from the location pointed by src to the memory block pointed by dst. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap.
dst | Pointer to the destination array where the content is to be copied, type-casted to a pointer of type void* . |
src | Pointer to the source of data to be copied, type-casted to a pointer of type const void* . |
size | Number of bytes to copy. |
ASMCALL void* memset | ( | void * | dst, |
u8 | value, | ||
size_t | size | ||
) |
Fill block of memory.
Sets the first size bytes of the block of memory pointed by dst to the specified value (interpreted as an unsigned char).
dst | 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. |
int sscanf | ( | const char * | str, |
const char * | fmt, | ||
... | |||
) |
Parse string into provided variables.
str | Null terminated input string. |
fmt | Format specifier for input string parsing. |
ASMCALL int tolower | ( | int | c | ) |
Convert ASCII character to lower case.
ASMCALL int toupper | ( | int | c | ) |
Convert ASCII character to upper case.
int vsscanf | ( | const char * | str, |
char const * | fmt, | ||
va_list | ap | ||
) |
Parse string into provided variables.
str | Null terminated input string. |
fmt | Format specifier for input string parsing. |
ap | Arguments list with pointer to variables to assign values to. |