mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 09:33:39 +01:00
Separate cpu detection and printing logic
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
static char* CHAR_NULL_PTR = "";
|
||||
|
||||
@@ -553,6 +554,15 @@ double ffStrbufToDouble(const FFstrbuf* strbuf)
|
||||
return value;
|
||||
}
|
||||
|
||||
uint16_t ffStrbufToUInt16(const FFstrbuf* strbuf, uint16_t defaultValue)
|
||||
{
|
||||
uint16_t value;
|
||||
if(sscanf(strbuf->chars, "%"SCNu16, &value) != 1)
|
||||
return defaultValue;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
void ffStrbufDestroy(FFstrbuf* strbuf)
|
||||
{
|
||||
free(strbuf->chars);
|
||||
|
||||
@@ -99,6 +99,7 @@ void ffStrbufWriteTo(const FFstrbuf* strbuf, FILE* file);
|
||||
void ffStrbufPutTo(const FFstrbuf* strbuf, FILE* file);
|
||||
|
||||
double ffStrbufToDouble(const FFstrbuf* strbuf);
|
||||
uint16_t ffStrbufToUInt16(const FFstrbuf* strbuf, uint16_t defaultValue);
|
||||
|
||||
void ffStrbufDestroy(FFstrbuf* strbuf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user