|
GBDK 2020 Docs
4.4.0
API Documentation for GBDK 2020
|
#include <types.h>Go to the source code of this file.
Functions | |
| void | exit (int status) OLDCALL |
| int | abs (int i) |
| long | labs (long num) OLDCALL |
| int | atoi (const char *s) |
| long | atol (const char *s) |
| char * | itoa (int n, char *s, unsigned char radix) OLDCALL |
| char * | uitoa (unsigned int n, char *s, unsigned char radix) OLDCALL |
| char * | ltoa (long n, char *s, unsigned char radix) OLDCALL |
| char * | ultoa (unsigned long n, char *s, unsigned char radix) OLDCALL |
| void * | calloc (size_t nmemb, size_t size) |
| void * | malloc (size_t size) |
| void * | realloc (void *ptr, size_t size) |
| void | free (void *ptr) |
| void * | bsearch (const void *key, const void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *) REENTRANT) |
| void | qsort (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *) REENTRANT) |
| void exit | ( | int | status | ) |
file stdlib.h 'Standard library' functions, for whatever that means. Causes normal program termination and the value of status is returned to the parent. All open streams are flushed and closed.
| int abs | ( | int | i | ) |
Returns the absolute value of int i
| i | Int to obtain absolute value of |
If i is negative, returns -i; else returns i.
| long labs | ( | long | num | ) |
Returns the absolute value of long int num
| num | Long integer to obtain absolute value of |
| int atoi | ( | const char * | s | ) |
Converts an ASCII string to an int
| s | String to convert to an int |
The string may be of the format
i.e. any number of spaces, an optional + or -, then an arbitrary number of digits.
The result is undefined if the number doesnt fit in an int.
Returns: Int value of string
| long atol | ( | const char * | s | ) |
Converts an ASCII string to a long.
| s | String to convert to an long int |
Returns: Long int value of string
| char* itoa | ( | int | n, |
| char * | s, | ||
| unsigned char | radix | ||
| ) |
Converts an int into a base 10 ASCII string.
| n | Int to convert to a string |
| s | String to store the converted number |
| radix | Numerical base for converted number, ex: 10 is decimal base (parameter is required but not utilized on Game Boy and Analogue Pocket) |
Can be used with set_bkg_based_tiles() for printing if the digit character tiles are not ascii-mapped.
Returns: Pointer to converted string
| char* uitoa | ( | unsigned int | n, |
| char * | s, | ||
| unsigned char | radix | ||
| ) |
Converts an unsigned int into a base 10 ASCII string.
| n | Unsigned Int to convert to a string |
| s | String to store the converted number |
| radix | Numerical base for converted number, ex: 10 is decimal base (parameter is required but not utilized on Game Boy and Analogue Pocket) |
Can be used with set_bkg_based_tiles() for printing if the digit character tiles are not ascii-mapped.
Returns: Pointer to converted string
| char* ltoa | ( | long | n, |
| char * | s, | ||
| unsigned char | radix | ||
| ) |
Converts a long into a base 10 ASCII string.
| n | Long int to convert to a string |
| s | String to store the converted number |
| radix | Numerical base for converted number, ex: 10 is decimal base (parameter is required but not utilized on Game Boy and Analogue Pocket) |
Can be used with set_bkg_based_tiles() for printing if the digit character tiles are not ascii-mapped.
Returns: Pointer to converted string
| char* ultoa | ( | unsigned long | n, |
| char * | s, | ||
| unsigned char | radix | ||
| ) |
Converts an unsigned long into a base 10 ASCII string.
| n | Unsigned Long Int to convert to a string |
| s | String to store the converted number |
| radix | Numerical base for converted number, ex: 10 is decimal base (parameter is required but not utilized on Game Boy and Analogue Pocket) |
Can be used with set_bkg_based_tiles() for printing if the digit character tiles are not ascii-mapped.
Returns: Pointer to converted string
| void* malloc | ( | size_t | size | ) |
| void* realloc | ( | void * | ptr, |
| size_t | size | ||
| ) |
| void free | ( | void * | ptr | ) |
| void* bsearch | ( | const void * | key, |
| const void * | base, | ||
| size_t | nmemb, | ||
| size_t | size, | ||
| int(*)(const void *, const void *) REENTRANT | compar | ||
| ) |
search a sorted array of nmemb items
| key | Pointer to object that is the key for the search |
| base | Pointer to first object in the array to search |
| nmemb | Number of elements in the array |
| size | Size in bytes of each element in the array |
| compar | Function used to compare two elements of the array |
Returns: Pointer to array entry that matches the search key. If key is not found, NULL is returned.
| void qsort | ( | void * | base, |
| size_t | nmemb, | ||
| size_t | size, | ||
| int(*)(const void *, const void *) REENTRANT | compar | ||
| ) |
Sort an array of nmemb items
| base | Pointer to first object in the array to sort |
| nmemb | Number of elements in the array |
| size | Size in bytes of each element in the array |
| compar | Function used to compare and sort two elements of the array |