aboutsummaryrefslogtreecommitdiff
path: root/common/file.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-12-30 21:09:41 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-12-30 21:09:41 +0100
commita454f9e1f2b09d4799e8ac3c4a4eb62bbba7b823 (patch)
tree99c17c5dc928143645dee9c57d346f8f8c3e3607 /common/file.h
parent8b1de3b34222ec6d8e6c99f7897b9cbd5fbba264 (diff)
downloaduwu-lang-a454f9e1f2b09d4799e8ac3c4a4eb62bbba7b823.tar.xz
common/ refactoring
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..c5e8036
--- /dev/null
+++ b/common/file.h
@@ -0,0 +1,19 @@
+#ifndef _COMMON_FILE_H_
+#define _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