mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-07 03:54:58 -04:00
Reorganize library code into libs/ (#3119)
* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}
* Update configure.py and project.py for new libs structure
* Refactor `#include <dolphin/x.h>` -> `<x.h>`
* Remove `__REVOLUTION_SDK__` forwards from dolphin
* Fix dolphin/ references in revolution
* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`
* Always build TRK against dolphin headers
* Resolve revolution SDK header resolution issues
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
#include <charPipeline/structures/dolphinString.h>
|
||||
|
||||
u8 Strcat(char* str1, char* str2, char* dst) {
|
||||
char* srcCursor = str1;
|
||||
char* dstCursor = dst;;
|
||||
|
||||
if (!dst) {
|
||||
return 0;
|
||||
}
|
||||
if (!str1) {
|
||||
return 0;
|
||||
}
|
||||
if (!str2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((s8)*srcCursor != 0) {
|
||||
*dstCursor = *srcCursor;
|
||||
dstCursor++;
|
||||
srcCursor++;
|
||||
}
|
||||
|
||||
srcCursor = str2;
|
||||
while ((s8)*srcCursor != 0) {
|
||||
*dstCursor = *srcCursor;
|
||||
dstCursor++;
|
||||
srcCursor++;
|
||||
}
|
||||
|
||||
*dstCursor = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Strcpy(char* dst, char* src) {
|
||||
do {
|
||||
*dst = *src;
|
||||
dst++;
|
||||
src++;
|
||||
} while ((s8)*src != 0);
|
||||
}
|
||||
|
||||
s8 Strcmp(char* str1, char* str2) {
|
||||
char* cursor1 = str1;
|
||||
char* cursor2 = str2;
|
||||
while (1) {
|
||||
if ((s8)*cursor1 < (s8)*cursor2) {
|
||||
return 1;
|
||||
}
|
||||
if ((s8)*cursor1 > (s8)*cursor2) {
|
||||
return -1;
|
||||
}
|
||||
cursor1++;
|
||||
cursor2++;
|
||||
if ((s8)*cursor1 == 0 || (s8)*cursor2 == 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 Strlen(char* str) {
|
||||
char* cursor = str;
|
||||
u32 counter = 0;
|
||||
|
||||
if (!str) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((s8)*cursor != 0) {
|
||||
cursor++;
|
||||
counter++;
|
||||
}
|
||||
|
||||
return counter;
|
||||
}
|
||||
Reference in New Issue
Block a user