summaryrefslogtreecommitdiff
path: root/src/util/shared.h
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-04-30 02:12:02 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-04-30 02:12:02 -0400
commit49f7c2be366f0b918b68a4cc8e4335ebab0a15ba (patch)
tree16a9123cdab4863c283050690a6889803e92a92c /src/util/shared.h
parentadded tail and head (diff)
downloadlazysphere-49f7c2be366f0b918b68a4cc8e4335ebab0a15ba.tar.gz
lazysphere-49f7c2be366f0b918b68a4cc8e4335ebab0a15ba.tar.bz2
lazysphere-49f7c2be366f0b918b68a4cc8e4335ebab0a15ba.zip
fix ls and add start of ed
Diffstat (limited to 'src/util/shared.h')
-rw-r--r--src/util/shared.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/util/shared.h b/src/util/shared.h
new file mode 100644
index 0000000..5e5f4a9
--- /dev/null
+++ b/src/util/shared.h
@@ -0,0 +1,46 @@
+#pragma once
+
+#include <stdio.h>
+#include <stdbool.h>
+#include <time.h>
+
+#define ANSCII "\x1b["
+#define NEXT ";"
+
+#define RESET "0"
+#define BOLD "1"
+
+#define NORMAL "3"
+#define BACKGROUND "4"
+#define HIGHLIGHT "9"
+
+#define BLACK "0"
+#define RED "1"
+#define GREEN "2"
+#define YELLOW "3"
+#define BLUE "4"
+#define MAGENTA "5"
+#define TURQUOISE "6"
+#define WHITE "7"
+
+#define COLOR "m"
+
+enum When {
+ YES,
+ NO,
+ AUTO
+};
+
+__attribute__ ((__format__(printf, 1, 2)))
+void error(const char* format, ...);
+
+FILE* get_file_s(const char* path, const char* type);
+FILE* get_file(const char* path, const char* type);
+long int get_number(const char* text);
+long int get_blkm(const char* text);
+
+bool streql(const char* a, const char* b);
+bool prefix(const char* pre, const char* str);
+
+void print_file_size(size_t bytes, char buf[5]);
+void print_date_time(time_t mills, char buf[13]);