-
Notifications
You must be signed in to change notification settings - Fork 1
/
os.h
40 lines (33 loc) · 1006 Bytes
/
os.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef _OS_H_
#define _OS_H_
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#if defined(_unix) || defined(__unix) || defined(__unix__) || defined(__CYGWIN__)
#define OS_UNIX
#elif defined(_WIN32) || defined(WIN32) || defined(WIN64) || defined(_WIN64) || defined(__MINGW32__) || defined(__MINGW64__)
#define OS_WINDOWS
#elif defined(_DOS) || defined(DOS)
#define OS_DOS
#elif defined(_KOLIBRI) || defined(KOLIBRI)
#define OS_KOLIBRI
#else
#error "The platform is not supported. Implement functions for your platform in os.c"
#endif
char *dirname(char *path);
#ifdef OS_KOLIBRI
#include <conio.h>
#define OS_CON_SET_TITLE(title) \
con_init(); \
(*con_set_title)(title)
#define OS_CON_EXIT(status) (*con_exit)(status)
#else
#define OS_CON_SET_TITLE(title)
#define OS_CON_EXIT(status)
#endif
#define OS_PATH_MAX 4096
size_t os_get_fsize(const char *fname);
bool os_is_dir(const char *name);
bool os_exist(const char *name);
bool os_mkdir(const char *name);
#endif