New tools refactor first pass

This commit is contained in:
2023-02-06 22:43:39 -08:00
parent 192f6b7f59
commit 12dd50ef77
26 changed files with 181 additions and 111 deletions

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "dawnsharedlibs.hpp"
static inline void stringRemoveAll(char *string, char remove) {
size_t len = strlen(string);
size_t i, j;
i = 0;
while(i < len) {
char c = string[i];
if(c != remove) {
i++;
continue;
}
j = i + 1;
while(j < len) {
string[j-1] = string[j];
j++;
}
len--;
}
}