mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-13 02:10:57 +00:00
First proper commit.
This commit is contained in:
parent
be78236d36
commit
087f561f77
14086 changed files with 1200489 additions and 1 deletions
33
src/libultra_boot_O2/string.c
Normal file
33
src/libultra_boot_O2/string.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include <global.h>
|
||||
|
||||
const u8 *strchr(const u8 *str, s32 ch)
|
||||
{
|
||||
u8 c = ch;
|
||||
while (*str != c)
|
||||
{
|
||||
if (*str == 0)
|
||||
return NULL;
|
||||
str++;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
size_t strlen(const u8 *str)
|
||||
{
|
||||
const u8 *ptr = str;
|
||||
while (*ptr)
|
||||
ptr++;
|
||||
return ptr - str;
|
||||
}
|
||||
|
||||
void *memcpy(void *dst, const void *src, size_t size)
|
||||
{
|
||||
u8 *_dst = dst;
|
||||
const u8 *_src = src;
|
||||
while (size > 0)
|
||||
{
|
||||
*_dst++ = *_src++;
|
||||
size--;
|
||||
}
|
||||
return dst;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue