1
2
3
4
8
9
17
20
21
22
26
27
28
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef JIMIOCOMPAT_H
#define JIMIOCOMPAT_H
/* ... */
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#include "jimautoconf.h"
#include <jim.h>
#include <jim-win32compat.h>
6 includes
/* ... */
void Jim_SetResultErrno(Jim_Interp *interp, const char *msg);
/* ... */
int Jim_OpenForWrite(const char *filename, int append);
/* ... */
int Jim_OpenForRead(const char *filename);
#if defined(__MINGW32__)
#ifndef STRICT
#define STRICT
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <fcntl.h>
#include <io.h>
#include <process.h>
typedef HANDLE pidtype;
#define JIM_BAD_PID INVALID_HANDLE_VALUE
#define JIM_NO_PID INVALID_HANDLE_VALUE
#define WIFEXITED(STATUS) (((STATUS) & 0xff00) == 0)
#define WEXITSTATUS(STATUS) ((STATUS) & 0x00ff)
#define WIFSIGNALED(STATUS) (((STATUS) & 0xff00) != 0)
#define WTERMSIG(STATUS) (((STATUS) >> 8) & 0xff)
#define WNOHANG 1
7 defines
/* ... */
int Jim_Errno(void);
pidtype waitpid(pidtype pid, int *status, int nohang);
#define HAVE_PIPE
#define pipe(P) _pipe((P), 0, O_NOINHERIT)
typedef struct _stat64 jim_stat_t;
#define Jim_Stat __stat64
/* ... */
#else
typedef struct stat jim_stat_t;
#define Jim_Stat stat
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#include <fcntl.h>
#include <sys/wait.h>
typedef int pidtype;
#define Jim_Errno() errno
#define JIM_BAD_PID -1
#define JIM_NO_PID 0
#ifndef HAVE_EXECVPE
#define execvpe(ARG0, ARGV, ENV) execvp(ARG0, ARGV)
#endif/* ... */
#endif/* ... */
#endif
/* ... */
#endif