[v0.03] Add printer backend from cpufetch (still printing CPU logo)

This commit is contained in:
Dr-Noob
2021-08-15 23:23:36 +02:00
parent 8f31748d1e
commit 7ad484b938
13 changed files with 609 additions and 30 deletions

View File

@@ -6,9 +6,13 @@
#include "args.hpp"
#include "global.hpp"
#define NUM_COLORS 4
struct args_struct {
bool help_flag;
bool version_flag;
STYLE style;
struct color** colors;
};
const char args_chr[] = {
@@ -23,6 +27,14 @@ const char *args_str[] = {
static struct args_struct args;
STYLE get_style() {
return args.style;
}
struct color** get_colors() {
return args.colors;
}
bool show_help() {
return args.help_flag;
}
@@ -97,3 +109,10 @@ bool parse_args(int argc, char* argv[]) {
return true;
}
void free_colors_struct(struct color** cs) {
for(int i=0; i < NUM_COLORS; i++) {
free(cs[i]);
}
free(cs);
}