aboutsummaryrefslogtreecommitdiff
path: root/common/file.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-01-02 11:53:21 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-01-02 11:53:21 +0100
commit56caeb540795fb92f3289bbc4744e94da0c20654 (patch)
treeb8e0e2dffd87835dabe377aab53e5c1d89810233 /common/file.h
parent31cf3ac5ac7054890810190d6f526ec1eb38c64d (diff)
downloaduwu-lang-56caeb540795fb92f3289bbc4744e94da0c20654.tar.xz
Turn common back into a normal directory (instead of a submodule)
Diffstat (limited to 'common/file.h')
-rw-r--r--common/file.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/file.h b/common/file.h
new file mode 100644
index 0000000..5d875c9
--- /dev/null
+++ b/common/file.h
@@ -0,0 +1,19 @@
+#ifndef _UWU_COMMON_FILE_H_
+#define _UWU_COMMON_FILE_H_
+
+#include <stdio.h>
+#include <stdbool.h>
+
+inline static bool file_exists(const char *filename)
+{
+ FILE *f = fopen(filename, "r");
+
+ if (f) {
+ fclose(f);
+ return true;
+ }
+
+ return false;
+}
+
+#endif