Refactor: move parsing functions to own header

This commit is contained in:
Linus Dierheimer
2022-07-25 13:59:19 +02:00
parent 5c73125693
commit c41a29a5c1
19 changed files with 42 additions and 16 deletions
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/parsing.h"
bool ffStrSet(const char* str)
{
+24
View File
@@ -0,0 +1,24 @@
#pragma once
#ifndef FF_INCLUDED_parsing_h
#define FF_INCLUDED_parsing_h
#include <stdint.h>
typedef struct FFVersion
{
uint32_t major;
uint32_t minor;
uint32_t patch;
} FFVersion;
#define FF_VERSION_INIT ((FFVersion) {0})
bool ffStrSet(const char* str);
void ffParseSemver(FFstrbuf* buffer, const FFstrbuf* major, const FFstrbuf* minor, const FFstrbuf* patch);
void ffParseGTK(FFstrbuf* buffer, const FFstrbuf* gtk2, const FFstrbuf* gtk3, const FFstrbuf* gtk4);
void ffVersionToPretty(const FFVersion* version, FFstrbuf* pretty);
int8_t ffVersionCompare(const FFVersion* version1, const FFVersion* version2);
#endif
+2
View File
@@ -3,6 +3,8 @@
#ifndef FF_INCLUDED_common_properties
#define FF_INCLUDED_common_properties
#include "util/FFstrbuf.h"
typedef struct FFpropquery
{
const char* start;