1 | #ifndef NVIM_OS_OS_DEFS_H |
2 | #define NVIM_OS_OS_DEFS_H |
3 | |
4 | #include <ctype.h> |
5 | #include <stdio.h> |
6 | #include <stdlib.h> |
7 | #include <sys/stat.h> |
8 | #include <sys/types.h> |
9 | |
10 | #ifdef WIN32 |
11 | # include "nvim/os/win_defs.h" |
12 | #else |
13 | # include "nvim/os/unix_defs.h" |
14 | #endif |
15 | |
16 | #define BASENAMELEN (NAME_MAX - 5) |
17 | |
18 | // Use the system path length if it makes sense. |
19 | #if defined(PATH_MAX) && (PATH_MAX > 1024) |
20 | # define MAXPATHL PATH_MAX |
21 | #else |
22 | # define MAXPATHL 1024 |
23 | #endif |
24 | |
25 | // Command-processing buffer. Use large buffers for all platforms. |
26 | #define CMDBUFFSIZE 1024 |
27 | |
28 | // Note: Some systems need both string.h and strings.h (Savage). However, |
29 | // some systems can't handle both, only use string.h in that case. |
30 | #include <string.h> |
31 | #if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H) |
32 | # include <strings.h> |
33 | #endif |
34 | |
35 | /// Converts libuv error (negative int) to error description string. |
36 | #define os_strerror uv_strerror |
37 | |
38 | /// Converts system error code to libuv error code. |
39 | #define os_translate_sys_error uv_translate_sys_error |
40 | |
41 | #ifdef WIN32 |
42 | # define os_strtok strtok_s |
43 | #else |
44 | # define os_strtok strtok_r |
45 | #endif |
46 | |
47 | #endif // NVIM_OS_OS_DEFS_H |
48 | |