annotate src/s/windowsnt.h @ 288:e11d67e05968 r21-0b42

Import from CVS: tag r21-0b42
author cvs
date Mon, 13 Aug 2007 10:35:54 +0200
parents c42ec1d1cded
children 70ad99077275
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* System description file for Windows NT.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: FSF 19.31. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #ifndef WINDOWSNT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 #define WINDOWSNT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #endif
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
26
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #ifndef DOS_NT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #define DOS_NT /* MSDOS or WINDOWSNT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
31 /* In case non-Microsoft compiler is used, we fake _MSC_VER */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
32 #ifndef _MSC_VER
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
33 #define _MSC_VER 1
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
34 #endif
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
35
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
36 typedef unsigned short mode_t;
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
37 /* typedef long ptrdiff_t; -kkm */
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
38 typedef int pid_t;
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
39
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
40 #include <stddef.h>
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
41
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 /* If you are compiling with a non-C calling convention but need to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 declare vararg routines differently, put it here */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #define _VARARGS_ __cdecl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 /* If you are providing a function to something that will call the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 function back (like a signal handler and signal, or main) its calling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 convention must be whatever standard the libraries expect */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #define _CALLBACK_ __cdecl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 /* SYSTEM_TYPE should indicate the kind of system you are using.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 It sets the Lisp variable system-type. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 #define SYSTEM_TYPE "windows-nt"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 #define NO_MATHERR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 265
diff changeset
58 #define SIZEOF_SHORT 2
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
59 #define SIZEOF_INT 4
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 265
diff changeset
60 #define SIZEOF_LONG 4
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 265
diff changeset
61 #define SIZEOF_LONG_LONG 8
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 265
diff changeset
62 #define SIZEOF_VOID_P 4
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
63
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 /* NOMULTIPLEJOBS should be defined if your system's shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 does not have "job control" (the ability to stop a program,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 run some other program, then continue the first one). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 /* #define NOMULTIPLEJOBS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 /* Letter to use in finding device name of first pty,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 if system supports pty's. 'a' means it is /dev/ptya0 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 #define FIRST_PTY_LETTER 'a'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 * Define HAVE_TIMEVAL if the system supports the BSD style clock values.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 * Look in <sys/time.h> for a timeval structure.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 #define HAVE_TIMEVAL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 * Define HAVE_SELECT if the system supports the `select' system call.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 /* #define HAVE_SELECT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 * Define HAVE_PTYS if the system supports pty devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 /* #define HAVE_PTYS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 /* If your system uses COFF (Common Object File Format) then define the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 preprocessor symbol "COFF". */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #define COFF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 /* NT supports Winsock which is close enough (with some hacks) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 #define HAVE_SOCKETS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 /* define MAIL_USE_FLOCK if the mailer uses flock
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 to interlock access to /usr/spool/mail/$USER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 The alternative is that a lock file named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 /usr/spool/mail/$USER.lock. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 /* #define MAIL_USE_FLOCK */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 #define MAIL_USE_POP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #define MAIL_USE_SYSTEM_LOCK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 /* If the character used to separate elements of the executable path
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 is not ':', #define this to be the appropriate character constant. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 #define SEPCHAR ';'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 /* ============================================================ */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 /* Here, add any special hacks needed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 to make Emacs work on this system. For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 you might define certain system call names that don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 exist on your system, or that do different things on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 your system and must be used only through an encapsulation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (Which you should place, by convention, in sysdep.c). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 239
diff changeset
125 /* XEmacs file I/O for DOS text files requires FILE_CODING */
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 239
diff changeset
126 #define FILE_CODING
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 239
diff changeset
127
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
128 #define DIRECTORY_SEP '\\'
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
129
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 /* Define this to be the separator between devices and paths */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 #define DEVICE_SEP ':'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 /* We'll support either convention on NT. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 /* The null device on Windows NT. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 #define NULL_DEVICE "NUL:"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 #ifndef MAXPATHLEN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 #define MAXPATHLEN _MAX_PATH
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 #define LISP_FLOAT_TYPE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 #define HAVE_GETTIMEOFDAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 #define HAVE_GETHOSTNAME
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 #define HAVE_DUP2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 #define HAVE_RENAME
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #define HAVE_CLOSEDIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 #define HAVE_TZNAME
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 #define HAVE_LONG_FILE_NAMES
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 #define HAVE_MKDIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 #define HAVE_RMDIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 #define HAVE_RANDOM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 #define HAVE_LOGB
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 #define HAVE_FREXP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 #define HAVE_FMOD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 #define HAVE_FTIME
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 #define HAVE_MKTIME
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 #define HAVE_MOUSE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 #define HAVE_H_ERRNO
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
168 #define HAVE_STRUCT_UTIMBUF
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 #ifdef HAVE_NTGUI
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 #define HAVE_WINDOW_SYSTEM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 #define HAVE_FACES
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
175 #define HAVE_STRCASECMP
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
176
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
177 /* Compatibility macros. Some used to be routines in nt.c */
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
178 #define strcasecmp(x,y) _stricmp(x,y)
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
179 #define random() (rand() << 15 | rand())
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
180 #define srandom(seed) (srand(seed))
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
181 #define setpgrp(pid,gid)
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
182
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 #define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 /* get some redefinitions in place */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
187 #if 0
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 /* IO calls that are emulated or shadowed */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 #define access sys_access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 #define chdir sys_chdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 #define chmod sys_chmod
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 #define close sys_close
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 #define creat sys_creat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 #define ctime sys_ctime
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 #define dup sys_dup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 #define dup2 sys_dup2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 #define fopen sys_fopen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 #define link sys_link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 #define mktemp sys_mktemp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 #define open sys_open
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 #define read sys_read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 #define rename sys_rename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 #define unlink sys_unlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 #define write sys_write
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
205 #define mkdir sys_mkdir
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
206 #define rmdir sys_rmdir
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
208 #endif
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
209
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
210 #if 0
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 /* this is hacky, but is necessary to avoid warnings about macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 redefinitions using the SDK compilers */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 #ifndef __STDC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 #define __STDC__ 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 #define MUST_UNDEF__STDC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 #include <direct.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 #include <io.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 #include <stdio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 #ifdef MUST_UNDEF__STDC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 #undef __STDC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 #undef MUST_UNDEF__STDC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 #endif
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
224 #endif
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
225
211
78478c60bfcd Import from CVS: tag r20-4b4
cvs
parents: 169
diff changeset
226 #include <stdio.h>
78478c60bfcd Import from CVS: tag r20-4b4
cvs
parents: 169
diff changeset
227
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
228
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
229 /* IO calls that are emulated or shadowed */
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
230 #define pipe sys_pipe
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
231 int sys_pipe (int * phandles);
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
232
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
233 #ifndef HAVE_X_WINDOWS
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
234 #define sleep sys_sleep
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
235 void sleep (int seconds);
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
236 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 /* subprocess calls that are emulated */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 #define spawnve sys_spawnve
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
240 int spawnve (int mode, CONST char *cmdname,
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
241 CONST char * CONST *argv, CONST char *CONST *envp);
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
242
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 #define wait sys_wait
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
244 int wait (int *status);
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
245
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 #define kill sys_kill
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
247 int kill (int pid, int sig);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 /* map to MSVC names */
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
250 #define popen _popen
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
251 #define pclose _pclose
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
252
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
253 #if 0
211
78478c60bfcd Import from CVS: tag r20-4b4
cvs
parents: 169
diff changeset
254 #define chdir _chdir
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 #define execlp _execlp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 #define execvp _execvp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 #define fcloseall _fcloseall
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
258 #define fdopen _fdopen
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 #define fgetchar _fgetchar
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
260 #define fileno _fileno
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 #define flushall _flushall
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 #define fputchar _fputchar
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
263 #define getw _getw
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 #define getpid _getpid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 #define isatty _isatty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 #define logb _logb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 #define _longjmp longjmp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 #define lseek _lseek
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
269 #define putw _putw
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
270 #define umask _umask
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
271 /* #define utime _utime */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 #define index strchr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 #define rindex strrchr
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
274 #define read _read
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
275 #define write _write
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 100
diff changeset
276 #define getcwd _getcwd
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 #ifdef HAVE_NTGUI
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 #define abort win32_abort
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
282 #endif /* 0 */
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
283
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
284 /* Encapsulation of system calls */
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
285 #ifndef DONT_ENCAPSULATE
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
286 #define getpid sys_getpid
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
287 int getpid (void);
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
288 #endif
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
289
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 239
diff changeset
290 /* Random global functions called everywhere. Implemented in nt.c */
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
291 /* #### Most of these are FSFisms and must be avoided */
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
292 /* #### All of these are FSFisms and must be avoided */
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 239
diff changeset
293 void dostounix_filename (char *p);
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 239
diff changeset
294 void unixtodos_filename (char *p);
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
295 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
296
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 239
diff changeset
297 char *getwd (char *dir);
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 239
diff changeset
298
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
299 void *sbrk (unsigned long increment);
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
300
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
301 struct passwd;
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
302 struct passwd *getpwuid (int uid);
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
303 struct passwd *getpwnam (const char *name);
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
304 int getuid ();
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
305 int geteuid ();
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
306 int getgid (void);
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
307 int getegid ();
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
308
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
309 /* Setitimer is emulated */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
310 #define HAVE_SETITIMER
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
311
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
312 /* We now have emulation for some signals */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
313 #define HAVE_SIGHOLD
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
314 #define sigset(s,h) msw_sigset(s,h)
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
315 #define sighold(s) msw_sighold(s)
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
316 #define sigrelse(s) msw_sigrelse(s)
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
317 #define sigpause(s) msw_sigpause(s)
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
318 #define signal sigset
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
319
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 /* Defines that we need that aren't in the standard signal.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 #define SIGHUP 1 /* Hang up */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 #define SIGQUIT 3 /* Quit process */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 #define SIGKILL 9 /* Die, die die */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 #define SIGALRM 14 /* Alarm */
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 211
diff changeset
325 #define SIGPROF 29 /* Profiling timer exp */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 /* For integration with MSDOS support. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 #define getdisk() (_getdrive () - 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 #define EMACS_CONFIGURATION get_emacs_configuration ()
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 282
diff changeset
332 const char *get_emacs_configuration (void);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 #define EMACS_CONFIG_OPTIONS "NT" /* Not very meaningful yet. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
335 #if 0 /* they do. -kkm */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 /* Define this so that winsock.h definitions don't get included when windows.h
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 is... I don't know if they do the right thing for emacs. For this to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 have proper effect, config.h must always be included before windows.h. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 #define _WINSOCKAPI_ 1
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
340 #endif /* 0 */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 /* Defines size_t and alloca (). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 #include <malloc.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 #include <sys/stat.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 /* Define for those source files that do not include enough NT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 system files. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 #ifndef NULL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 #ifdef __cplusplus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 #define NULL 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 #define NULL ((void *)0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 /* For proper declaration of environ. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 #include <stdlib.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 #include <string.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
361 /* Define process implementation */
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
362 #define HAVE_WIN32_PROCESSES
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
363
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 /* We need a little extra space, see ../../lisp/loadup.el */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 #define SYSTEM_PURESIZE_EXTRA 15000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 /* ============================================================ */