summaryrefslogtreecommitdiffstats
path: root/src/common/parsing.h
blob: c3a4bee93a2273b537d8a124ccfcd99e035e6281 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "common/FFstrbuf.h"

#include <stdint.h>

typedef struct FFVersion {
    uint32_t major;
    uint32_t minor;
    uint32_t patch;
} FFVersion;

typedef struct FFColorRangeConfig {
    uint8_t green;
    uint8_t yellow;
} FFColorRangeConfig;

#define FF_VERSION_INIT ((FFVersion) { 0 })

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);