388
|
1 // #define DEBUG
|
|
2 // #define DEBUGALL
|
|
3
|
|
4 // B19 - egcs automatically defines CYGWIN32 but not CYGWIN
|
|
5 // B20 - egcs automatically defines both CYGWIN32 and CYGWIN
|
|
6 // Bfuture - (???) defines CYGWIN but not CYGWIN32
|
|
7 #if defined(__CYGWIN32__)
|
|
8 #if !defined(__CYGWIN__)
|
|
9 #define B19
|
|
10 #define __CYGWIN__
|
|
11 #else
|
|
12 #define B20
|
|
13 #endif
|
|
14 #else
|
|
15 #if defined(__CYGWIN__)
|
|
16 #define B21
|
|
17 #endif
|
|
18 #endif
|
|
19 // Now: use __CYGWIN__ to represent any version
|
|
20 // distinguish using B19, B20, or B21
|
|
21
|
|
22 #if defined(__CYGWIN__)
|
|
23 #ifdef B19
|
|
24 #define CYGWIN_ATTACH_HANDLE_TO_FD(a) cygwin32_attach_handle_to_fd a
|
|
25 #define CYGWIN_CONV_TO_FULL_POSIX_PATH(a) cygwin32_conv_to_full_posix_path a
|
|
26 #define CYGWIN_CONV_TO_FULL_WIN32_PATH(a) cygwin32_conv_to_full_win32_path a
|
|
27 #define CYGWIN_CONV_TO_POSIX_PATH(a) cygwin32_conv_to_posix_path a
|
|
28 #define CYGWIN_CONV_TO_WIN32_PATH(a) cygwin32_conv_to_win32_path a
|
|
29 #define CYGWIN_DETACH_DLL(a) cygwin32_detach_dll a
|
|
30 #define CYGWIN_GETSHARED(a) cygwin32_getshared a
|
|
31 #define CYGWIN_INTERNAL(a) cygwin32_internal a
|
|
32 #define CYGWIN_POSIX_PATH_LIST_P(a) cygwin32_posix_path_list_p a
|
|
33 #define CYGWIN_POSIX_TO_WIN32_PATH_LIST(a) cygwin32_posix_to_win32_path_list a
|
|
34 #define CYGWIN_POSIX_TO_WIN32_PATH_LIST_BUF_SIZE(a) cygwin32_posix_to_win32_path_list_buf_size a
|
|
35 #define CYGWIN_SPLIT_PATH(a) cygwin32_split_path a
|
|
36 #define CYGWIN_WIN32_TO_POSIX_PATH_LIST(a) cygwin32_win32_to_posix_path_list a
|
|
37 #define CYGWIN_WIN32_TO_POSIX_PATH_LIST_BUF_SIZE(a) cygwin32_win32_to_posix_path_list_buf_size a
|
|
38 #define CYGWIN_WINPID_TO_PID(a) cygwin32_winpid_to_pid a
|
|
39 #else
|
|
40 #define CYGWIN_ATTACH_HANDLE_TO_FD(a) cygwin_attach_handle_to_fd a
|
|
41 #define CYGWIN_CONV_TO_FULL_POSIX_PATH(a) cygwin_conv_to_full_posix_path a
|
|
42 #define CYGWIN_CONV_TO_FULL_WIN32_PATH(a) cygwin_conv_to_full_win32_path a
|
|
43 #define CYGWIN_CONV_TO_POSIX_PATH(a) cygwin_conv_to_posix_path a
|
|
44 #define CYGWIN_CONV_TO_WIN32_PATH(a) cygwin_conv_to_win32_path a
|
|
45 #define CYGWIN_DETACH_DLL(a) cygwin_detach_dll a
|
|
46 #define CYGWIN_GETSHARED(a) cygwin_getshared a
|
|
47 #define CYGWIN_INTERNAL(a) cygwin_internal a
|
|
48 #define CYGWIN_POSIX_PATH_LIST_P(a) cygwin_posix_path_list_p a
|
|
49 #define CYGWIN_POSIX_TO_WIN32_PATH_LIST(a) cygwin_posix_to_win32_path_list a
|
|
50 #define CYGWIN_POSIX_TO_WIN32_PATH_LIST_BUF_SIZE(a) cygwin_posix_to_win32_path_list_buf_size a
|
|
51 #define CYGWIN_SPLIT_PATH(a) cygwin_split_path a
|
|
52 #define CYGWIN_WIN32_TO_POSIX_PATH_LIST(a) cygwin_win32_to_posix_path_list a
|
|
53 #define CYGWIN_WIN32_TO_POSIX_PATH_LIST_BUF_SIZE(a) cygwin_win32_to_posix_path_list_buf_size a
|
|
54 #define CYGWIN_WINPID_TO_PID(a) cygwin_winpid_to_pid a
|
|
55 #endif
|
|
56 #endif
|
|
57
|
|
58 #if defined(__CYGWIN__)
|
|
59 #define PATH_SEP_CHAR_STR "/"
|
|
60 #define SEP_CHARS ":"
|
|
61 #else
|
|
62 #define PATH_SEP_CHAR_STR "\\"
|
|
63 #define SEP_CHARS ";"
|
|
64 #endif
|
|
65
|
|
66 #ifndef RC_INVOKED
|
|
67
|
|
68 #define MAX_ARGS 20
|
|
69
|
|
70 #ifdef DEBUG
|
|
71 #define Trace(x) Trace_ x
|
|
72 #else
|
|
73 #define Trace(x)
|
|
74 #endif
|
|
75
|
|
76 #define NUM_EXTENSIONS 2
|
|
77 const char* exts[NUM_EXTENSIONS] = { "", ".exe" };
|
|
78
|
|
79 char* pfopen(char *retval, const char *name, const char *dirs);
|
|
80 void error(char* fmt, ...);
|
|
81 void message(char* fmt, ...);
|
|
82 void Trace_(char* fmt, ...);
|
|
83 int get_exec_name_and_path(char* execname, char* execpath);
|
|
84 char* my_strtok(char* s, const char* delim, char** lasts);
|
|
85 int parse_cmdline_to_arg_array(char* argv[MAX_ARGS], char* cmdline);
|
|
86 void strip_exe(char* s);
|
|
87 int start_child(char* cmdline, int wait_for_child);
|
|
88 void xemacs_special(char* exec);
|
|
89 int build_cmdline(char* new_cmdline, char* exec, int argc, char* argv[]);
|
|
90 void process_execname(char *exec, const char* execname, const char* execpath);
|
|
91 int fileExists(char* fullname, const char* path, const char* name);
|
|
92 int endsWith(const char* s1, const char* s2);
|
|
93 int fileExistsMulti(char* fullname, const char* path,
|
|
94 const char* name_noext, const char* exts[],
|
|
95 const int extcnt);
|
|
96
|
|
97 #endif /* RC_INVOKED */
|
|
98
|
|
99
|
|
100
|