mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-05 20:54:21 +01:00
better disk output
This commit is contained in:
@@ -333,6 +333,16 @@ void ffStrbufRemoveStrings(FFstrbuf* strbuf, uint32_t numStrings, ...)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t ffStrbufFirstIndexC(FFstrbuf* strbuf, const char c)
|
||||
{
|
||||
for(uint32_t i = 0; i < strbuf->length; i++)
|
||||
{
|
||||
if(strbuf->chars[i] == c)
|
||||
return i;
|
||||
}
|
||||
return strbuf->length;
|
||||
}
|
||||
|
||||
uint32_t ffStrbufLastIndexC(FFstrbuf* strbuf, const char c)
|
||||
{
|
||||
//We need to loop one higher than the actual index, because uint32_t is guranteed to be >= 0, so this statement would always be true
|
||||
|
||||
@@ -68,6 +68,7 @@ void ffStrbufTrim(FFstrbuf* strbuf, char c);
|
||||
|
||||
void ffStrbufRemoveStrings(FFstrbuf* strbuf, uint32_t numStrings, ...);
|
||||
|
||||
uint32_t ffStrbufFirstIndexC(FFstrbuf* strbuf, const char c);
|
||||
uint32_t ffStrbufLastIndexC(FFstrbuf* strbuf, const char c);
|
||||
|
||||
void ffStrbufLimitLength(FFstrbuf* strbuf, uint32_t length);
|
||||
|
||||
Reference in New Issue
Block a user