diff options
author | Fox Caminiti <fox@foxcam.net> | 2022-11-23 20:39:55 -0500 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2022-11-23 20:39:55 -0500 |
commit | fd315f15828b8537a48530c094ced845edc3a1d3 (patch) | |
tree | e4c028f1b33c7dfd8de24d2ad2331ef4547cc3d9 /strings.cpp | |
parent | 6799b157bae5654d77d0fc2685a1ef3e4a7d9f4c (diff) |
effects reintroduction
Diffstat (limited to 'strings.cpp')
-rw-r--r-- | strings.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/strings.cpp b/strings.cpp index 0842576..d2acc03 100644 --- a/strings.cpp +++ b/strings.cpp @@ -37,3 +37,56 @@ String_AddToFile(memory *Memory, char *Char) } return FileIndex; } + +static bool32 +String_Compare(char *String1, char *String2, uint32 Length) +{ + for (int i = 0; i < Length; i++) { + if (String1[i] != String2[i]) + return 0; + } + return 1; +} + +static uint32 +String_Length(char *Char) +{ + int32 i = 0; + while (Char[i] != '\0') { + i++; + } + return i; +} + +static void +String_Copy(char *String1, char *String2, uint32 Length) +{ + int32 i = 0; + while (i < Length) { + String1[i] = String2[i]; + i++; + } +} + +static void +String_Append(char *String1, char *String2, uint32 Length) +{ + int32 i = 0; + while (String1[i] != '\0') { + String1[i] = String2[i]; + } +} + +static void +String_PathToLayerName(char *Path, char *Dest) +{ + uint32 i = 0; + uint32 LastSlash = 0; + while (Path[i] != '\0') { + if (Path[i] == '/') + LastSlash = i; + i++; + } + for (int s = 0; s < i - LastSlash; s++) + Dest[s] = Path[s + LastSlash + 1]; +} |