mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
@@ -3,17 +3,6 @@
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
bool ffStrSet(const char* str)
|
||||
{
|
||||
if(str == NULL)
|
||||
return false;
|
||||
|
||||
while(isspace(*str))
|
||||
str++;
|
||||
|
||||
return *str != '\0';
|
||||
}
|
||||
|
||||
static char* CHAR_NULL_PTR = "";
|
||||
|
||||
void ffStrbufInitA(FFstrbuf* strbuf, uint32_t allocate)
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
#define strcasestr StrStrIA
|
||||
#endif
|
||||
|
||||
bool ffStrSet(const char* str);
|
||||
|
||||
#define FASTFETCH_STRBUF_DEFAULT_ALLOC 32
|
||||
|
||||
typedef struct FFstrbuf
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "FFPlatform_private.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
void ffPlatformInit(FFPlatform* platform)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "FFPlatform_private.h"
|
||||
|
||||
#include "util/stringUtils.h"
|
||||
#include "fastfetch_config.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#include "stringUtils.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef FF_INCLUDED_util_stringUtils_h
|
||||
#define FF_INCLUDED_util_stringUtils_h
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
bool ffStrSet(const char* str);
|
||||
bool ffStrHasNChars(const char* str, char c, uint32_t n);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user