]> git.lizzy.rs Git - uwu-lang.git/blob - common/file.h
common/ refactoring
[uwu-lang.git] / common / file.h
1 #ifndef _COMMON_FILE_H_
2 #define _COMMON_FILE_H_
3
4 #include <stdio.h>
5 #include <stdbool.h>
6
7 inline static bool file_exists(const char *filename)
8 {
9         FILE *f = fopen(filename, "r");
10
11         if (f) {
12                 fclose(f);
13                 return true;
14         }
15
16         return false;
17 }
18
19 #endif