GBDK 2020 Docs
4.1.1
API Documentation for GBDK 2020
|
#include <types.h>
Go to the source code of this file.
Functions | |
char * | strcpy (char *dest, const char *src) OLDCALL |
int | strcmp (const char *s1, const char *s2) |
void * | memcpy (void *dest, const void *src, size_t len) |
void * | memmove (void *dest, const void *src, size_t n) OLDCALL |
void * | memset (void *s, int c, size_t n) Z88DK_CALLEE |
char * | reverse (char *s) NONBANKED |
char * | strcat (char *s1, const char *s2) NONBANKED |
int | strlen (const char *s) OLDCALL |
char * | strncat (char *s1, const char *s2, int n) NONBANKED |
int | strncmp (const char *s1, const char *s2, int n) NONBANKED |
char * | strncpy (char *s1, const char *s2, int n) NONBANKED |
int | memcmp (const void *buf1, const void *buf2, size_t count) Z88DK_CALLEE |
Generic string functions.
char* strcpy | ( | char * | dest, |
const char * | src | ||
) |
Copies the string pointed to by src (including the terminating ‘\0’ character) to the array pointed to by dest.
The strings may not overlap, and the destination string dest must be large enough to receive the copy.
dest | Array to copy into |
src | Array to copy from |
int strcmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Compares strings
s1 | First string to compare |
s2 | Second string to compare |
Returns:
void* memcpy | ( | void * | dest, |
const void * | src, | ||
size_t | len | ||
) |
Copies n bytes from memory area src to memory area dest.
The memory areas may not overlap.
dest | Buffer to copy into |
src | Buffer to copy from |
len | Number of Bytes to copy |
void* memmove | ( | void * | dest, |
const void * | src, | ||
size_t | n | ||
) |
Copies n bytes from memory area src to memory area dest, areas may overlap
void* memset | ( | void * | s, |
int | c, | ||
size_t | n | ||
) |
Fills the memory region s with n bytes using value c
s | Buffer to fill |
c | char value to fill with (truncated from int) |
n | Number of bytes to fill |
char* reverse | ( | char * | s | ) |
Reverses the characters in a string
s | Pointer to string to reverse. |
For example 'abcdefg' will become 'gfedcba'.
Banked as the string must be modifiable.
Returns: Pointer to s
char* strcat | ( | char * | s1, |
const char * | s2 | ||
) |
Concatenate Strings. Appends string s2 to the end of string s1
s1 | String to append onto |
s2 | String to copy from |
For example 'abc' and 'def' will become 'abcdef'.
String s1 must be large enough to store both s1 and s2.
Returns: Pointer to s1
int strlen | ( | const char * | s | ) |
Calculates the length of a string
s | String to calculate length of |
Returns: Length of string not including the terminating ‘\0’ character.
char* strncat | ( | char * | s1, |
const char * | s2, | ||
int | n | ||
) |
Concatenate at most n characters from string s2 onto the end of s1.
s1 | String to append onto |
s2 | String to copy from |
n | Max number of characters to copy from s2 |
String s1 must be large enough to store both s1 and n characters of s2
Returns: Pointer to s1
int strncmp | ( | const char * | s1, |
const char * | s2, | ||
int | n | ||
) |
Compare strings (at most n characters):
s1 | First string to compare |
s2 | Second string to compare |
n | Max number of characters to compare |
Returns:
char* strncpy | ( | char * | s1, |
const char * | s2, | ||
int | n | ||
) |
Copy n characters from string s2 to s1
s1 | String to copy into |
s2 | String to copy from |
n | Max number of characters to copy from s2 |
If s2 is shorter than n, the remaining bytes in s1 are filled with \0.
Warning: If there is no \0 in the first n bytes of s2 then s1 will not be null terminated.
Returns: Pointer to s1
int memcmp | ( | const void * | buf1, |
const void * | buf2, | ||
size_t | count | ||
) |
Compares buffers
buf1 | First buffer to compare |
buf2 | Second buffer to compare |
count | Buffer length |
Returns: