The memory and formatting routines libultra provides in place of a C library.
More...
#include <stddef.h>
#include <PR/ultratypes.h>
Go to the source code of this file.
|
| void * | bcopy (const void *src, void *dst, int n) |
| | Copy n bytes between buffers that may overlap.
|
| int | bcmp (const void *a, const void *b, int n) |
| | Compare n bytes of two buffers.
|
| void | bzero (void *p, int n) |
| | Clear n bytes.
|
| void * | memcpy (void *dst, const void *src, size_t n) |
| | Copy n bytes between buffers that do not overlap.
|
| size_t | strlen (const char *s) |
| | Return the length of a string.
|
| const char * | strchr (const char *s, int c) |
| | Find the first occurrence of a character in a string.
|
| int | sprintf (char *dst, const char *fmt,...) |
| | Format into a buffer.
|
| ldiv_t | ldiv (long num, long denom) |
| | Divide, truncating towards zero.
|
| lldiv_t | lldiv (long long num, long long denom) |
| | Divide 64-bit values, truncating towards zero.
|
The memory and formatting routines libultra provides in place of a C library.
◆ bcopy()
| void * bcopy |
( |
const void * | src, |
|
|
void * | dst, |
|
|
int | n ) |
Copy n bytes between buffers that may overlap.
- Parameters
-
| src | The buffer to copy from. |
| dst | The buffer to copy to. |
| n | The count of bytes. |
- Returns
- dst.
- Ghidra address:
- USA: 0x802674d0
- Ghidra address:
- Asia: 0x80267020
- Ghidra address:
- EUR: 0x80268cc0
- Ghidra address:
- JPN: 0x80268770
◆ bcmp()
| int bcmp |
( |
const void * | a, |
|
|
const void * | b, |
|
|
int | n ) |
Compare n bytes of two buffers.
- Parameters
-
| a | The first buffer. |
| b | The second buffer. |
| n | The count of bytes to compare. |
- Returns
- 0 when they are equal, and nonzero otherwise.
- Ghidra address:
- USA: 0x80262540
- Ghidra address:
- Asia: 0x80262090
- Ghidra address:
- EUR: 0x80263cc0
- Ghidra address:
- JPN: 0x80263760
◆ bzero()
| void bzero |
( |
void * | p, |
|
|
int | n ) |
Clear n bytes.
- Parameters
-
| p | The buffer to clear. |
| n | The count of bytes to clear. |
- Ghidra address:
- USA: 0x8026bba0
- Ghidra address:
- Asia: 0x8026B6F0
- Ghidra address:
- EUR: 0x8026db70
- Ghidra address:
- JPN: 0x8026d620
◆ memcpy()
| void * memcpy |
( |
void * | dst, |
|
|
const void * | src, |
|
|
size_t | n ) |
Copy n bytes between buffers that do not overlap.
- Parameters
-
| dst | The buffer to copy to. |
| src | The buffer to copy from. |
| n | The count of bytes. |
- Returns
- dst.
- Ghidra address:
- USA: 0x80260b20
- Ghidra address:
- Asia: 0x80260670
- Ghidra address:
- EUR: 0x80261fb0
- Ghidra address:
- JPN: 0x80261a60
◆ strlen()
| size_t strlen |
( |
const char * | s | ) |
|
Return the length of a string.
- Parameters
-
| s | The NUL-terminated string. |
- Returns
- The count of characters before the terminating NUL.
- Ghidra address:
- USA: 0x80260b4c
- Ghidra address:
- Asia: 0x8026069C
- Ghidra address:
- EUR: 0x80261fdc
- Ghidra address:
- JPN: 0x80261a8c
◆ strchr()
| const char * strchr |
( |
const char * | s, |
|
|
int | c ) |
Find the first occurrence of a character in a string.
- Parameters
-
| s | The NUL-terminated string. |
| c | The character to find, converted to char. |
- Returns
- The occurrence, or NULL when the character is absent from the string.
- Ghidra address:
- USA: 0x80260b74
- Ghidra address:
- Asia: 0x802606C4
- Ghidra address:
- EUR: 0x80262004
- Ghidra address:
- JPN: 0x80261ab4
◆ sprintf()
| int sprintf |
( |
char * | dst, |
|
|
const char * | fmt, |
|
|
| ... ) |
Format into a buffer.
- Parameters
-
| dst | The buffer written, NUL-terminated and large enough for the output. |
| fmt | The printf format, followed by its arguments. |
- Returns
- The number of characters written, not counting the terminating NUL.
- Ghidra address:
- USA: 0x80260dd4
- Ghidra address:
- Asia: 0x80260924
- Ghidra address:
- EUR: 0x80262264
- Ghidra address:
- JPN: 0x80261d14
◆ ldiv()
| ldiv_t ldiv |
( |
long | num, |
|
|
long | denom ) |
Divide, truncating towards zero.
- Parameters
-
| num | The dividend. |
| denom | The divisor, not 0. |
- Returns
- The quotient and the remainder, the remainder with the sign of the dividend.
- Ghidra address:
- USA: 0x8026e970
- Ghidra address:
- Asia: 0x8026E4C0
- Ghidra address:
- EUR: 0x80270940
- Ghidra address:
- JPN: 0x802703f0
◆ lldiv()
| lldiv_t lldiv |
( |
long long | num, |
|
|
long long | denom ) |
Divide 64-bit values, truncating towards zero.
- Parameters
-
| num | The dividend. |
| denom | The divisor, not 0. |
- Returns
- The quotient and the remainder, the remainder with the sign of the dividend.
- Ghidra address:
- USA: 0x8026e870
- Ghidra address:
- Asia: 0x8026E3C0
- Ghidra address:
- EUR: 0x80270840
- Ghidra address:
- JPN: 0x802702f0