diff --git a/CMakeLists.txt b/CMakeLists.txt index 357faaaf9..6e7594c85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,7 +377,6 @@ set(LIBFASTFETCH_SRC src/util/FFlist.c src/util/FFstrbuf.c src/util/platform/FFPlatform.c - src/util/stringUtils.c src/util/smbiosHelper.c ) diff --git a/src/util/stringUtils.c b/src/util/stringUtils.c deleted file mode 100644 index 07a3bd101..000000000 --- a/src/util/stringUtils.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "stringUtils.h" - -#include - -bool ffStrSet(const char* str) -{ - if(str == NULL) - return false; - - while(isspace(*str)) - str++; - - return *str != '\0'; -} - -bool ffStrHasNChars(const char* str, char c, uint32_t n) -{ - for(uint32_t i = 0; i < n; i++) - { - char* current = strchr(str, c); - if(current == NULL) - return false; - - str = current + 1; - } - - return true; -} diff --git a/src/util/stringUtils.h b/src/util/stringUtils.h index e67298224..e5fe80e12 100644 --- a/src/util/stringUtils.h +++ b/src/util/stringUtils.h @@ -3,9 +3,19 @@ #include #include #include +#include + +static inline bool ffStrSet(const char* str) +{ + if(str == NULL) + return false; + + while(isspace(*str)) + str++; + + return *str != '\0'; +} -bool ffStrSet(const char* str); -bool ffStrHasNChars(const char* str, char c, uint32_t n); static inline bool ffStrStartsWithIgnCase(const char* str, const char* compareTo) {