This commit was generated by cvs2svn to compensate for changes in r1383,
[chise/xemacs-chise.git.1] / src / s / windowsnt.h
1 /* System description file for Windows NT.
2    Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING.  If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* Synched up with: FSF 19.31. */
22
23 #ifndef WINDOWSNT
24 #define WINDOWSNT
25 #endif
26
27 #ifndef DOS_NT
28 #define DOS_NT  /* MSDOS or WINDOWSNT */
29 #endif
30
31 /* In case non-Microsoft compiler is used, we fake _MSC_VER */
32 #ifndef _MSC_VER
33 #define _MSC_VER  1
34 #endif
35
36 typedef unsigned short mode_t;
37 /* typedef long ptrdiff_t; -kkm */
38 typedef int pid_t;
39
40 #include <stddef.h>
41
42 /* If you are compiling with a non-C calling convention but need to
43    declare vararg routines differently, put it here */
44 #define _VARARGS_ __cdecl
45
46 /* If you are providing a function to something that will call the
47    function back (like a signal handler and signal, or main) its calling
48    convention must be whatever standard the libraries expect */
49 #define _CALLBACK_ __cdecl
50
51 /* SYSTEM_TYPE should indicate the kind of system you are using.
52  It sets the Lisp variable system-type.  */
53
54 #define SYSTEM_TYPE "windows-nt"
55
56 #define NO_MATHERR
57
58 #define SIZEOF_SHORT 2
59 #define SIZEOF_INT 4
60 #define SIZEOF_LONG 4
61 #define SIZEOF_LONG_LONG 8
62 #define SIZEOF_VOID_P 4
63
64 /* NOMULTIPLEJOBS should be defined if your system's shell
65  does not have "job control" (the ability to stop a program,
66  run some other program, then continue the first one).  */
67
68 /* #define NOMULTIPLEJOBS */
69
70 /* Letter to use in finding device name of first pty,
71   if system supports pty's.  'a' means it is /dev/ptya0  */
72
73 #define FIRST_PTY_LETTER 'a'
74
75 /*
76  *      Define HAVE_TIMEVAL if the system supports the BSD style clock values.
77  *      Look in <sys/time.h> for a timeval structure.
78  */
79
80 #define HAVE_TIMEVAL
81
82 /*
83  *      Define HAVE_SELECT if the system supports the `select' system call.
84  */
85
86 /* #define HAVE_SELECT */
87
88 /*
89  *      Define HAVE_PTYS if the system supports pty devices.
90  */
91
92 /* #define HAVE_PTYS */
93
94 /* If your system uses COFF (Common Object File Format) then define the
95    preprocessor symbol "COFF". */
96
97 #define COFF
98
99 /* NT supports Winsock which is close enough (with some hacks) */
100
101 #define HAVE_SOCKETS
102
103 /* define MAIL_USE_FLOCK if the mailer uses flock
104    to interlock access to /usr/spool/mail/$USER.
105    The alternative is that a lock file named
106    /usr/spool/mail/$USER.lock.  */
107
108 #define MAIL_USE_POP
109 #define HAVE_LOCKING
110 #define MAIL_USE_LOCKING
111
112 /* If the character used to separate elements of the executable path
113    is not ':', #define this to be the appropriate character constant.  */
114 #define SEPCHAR ';'
115
116 /* ============================================================ */
117
118 /* Here, add any special hacks needed
119    to make Emacs work on this system.  For example,
120    you might define certain system call names that don't
121    exist on your system, or that do different things on
122    your system and must be used only through an encapsulation
123    (Which you should place, by convention, in sysdep.c).  */
124
125 /* XEmacs file I/O for DOS text files requires FILE_CODING */
126 #define FILE_CODING
127
128 #define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char))
129
130 /* Define this to be the separator between devices and paths */
131 #define DEVICE_SEP ':'
132
133 /* We'll support either convention on NT.  */
134 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
135 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
136
137 /* The null device on Windows NT. */
138 #define NULL_DEVICE     "NUL:"
139 #define EXEC_SUFFIXES   ".exe:.com:.bat:.cmd:"
140
141 #ifndef MAXPATHLEN
142 #define MAXPATHLEN      _MAX_PATH
143 #endif
144
145 #define LISP_FLOAT_TYPE
146
147 #define HAVE_GETTIMEOFDAY
148 #define HAVE_GETHOSTNAME
149 #define HAVE_DUP2
150 #define HAVE_RENAME
151 #define HAVE_CLOSEDIR
152
153 #define HAVE_TZNAME
154
155 #define HAVE_LONG_FILE_NAMES
156
157 #define HAVE_MKDIR
158 #define HAVE_RMDIR
159 #define HAVE_RANDOM
160 #define HAVE_LOGB
161 #define HAVE_FREXP
162 #define HAVE_FMOD
163 #define HAVE_FTIME
164 #define HAVE_MKTIME
165
166 #define HAVE_MOUSE
167 #define HAVE_H_ERRNO
168 #define HAVE_STRUCT_UTIMBUF
169
170 #ifdef HAVE_NTGUI
171 #define HAVE_WINDOW_SYSTEM
172 #define HAVE_FACES
173 #endif
174
175 #define HAVE_STRCASECMP
176
177 /* Compatibility macros. Some used to be routines in nt.c */
178 #define strcasecmp(x,y) _stricmp(x,y)
179 #define random() (rand() << 15 | rand())
180 #define srandom(seed) (srand(seed))
181 #define setpgrp(pid,gid)
182
183 #define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B")
184
185
186 #include <stdio.h>
187
188 /* subprocess calls that are emulated */
189 #ifndef DONT_ENCAPSULATE
190 #define spawnve sys_spawnve
191 int spawnve (int mode, const char *cmdname, 
192              const char * const *argv, const char *const *envp);
193 #endif
194
195 /* IO calls that are emulated or shadowed */
196 #define pipe    sys_pipe
197 int sys_pipe (int * phandles);
198
199 #ifndef HAVE_X_WINDOWS
200 #define sleep   sys_sleep
201 void sleep (int seconds);
202 #endif
203
204 #define wait    sys_wait
205 int wait (int *status);
206
207 #define kill    sys_kill
208 int kill (int pid, int sig);
209
210 /* map to MSVC names */
211 #define popen     _popen
212 #define pclose    _pclose
213
214 typedef int uid_t;
215 typedef int gid_t;
216 typedef int pid_t;
217 typedef int ssize_t;
218
219 /* Encapsulation of system calls */
220 #ifndef DONT_ENCAPSULATE
221 #define getpid sys_getpid
222 pid_t getpid (void);
223 #endif
224
225 /* Random global functions called everywhere. Implemented in nt.c */
226 /* #### Most of these are FSFisms and must be avoided */
227 /* #### All of these are FSFisms and must be avoided */
228 void dostounix_filename (char *p);
229 void unixtodos_filename (char *p);
230 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
231
232 char *getwd (char *dir);
233
234 void *sbrk (unsigned long increment);
235
236 struct passwd;
237 struct passwd *getpwuid (uid_t uid);
238 struct passwd *getpwnam (const char *name);
239 uid_t getuid (void);
240 uid_t geteuid (void);
241 gid_t getgid (void);
242 gid_t getegid (void);
243
244 /* Setitimer is emulated */
245 #define HAVE_SETITIMER
246
247 /* We now have emulation for some signals */
248 #define HAVE_SIGHOLD
249 #define sigset(s,h) msw_sigset(s,h)
250 #define sighold(s) msw_sighold(s)
251 #define sigrelse(s) msw_sigrelse(s)
252 #define sigpause(s) msw_sigpause(s)
253
254 /* Defines that we need that aren't in the standard signal.h  */
255 #define SIGHUP  1               /* Hang up */
256 #define SIGQUIT 3               /* Quit process */
257 #define SIGKILL 9               /* Die, die die */
258 #define SIGALRM 14              /* Alarm */
259 #define SIGPROF 29              /* Profiling timer exp */
260
261 /* For integration with MSDOS support.  */
262 #define getdisk()               (_getdrive () - 1)
263 #define getdefdir(_drv, _buf)   _getdcwd (_drv, _buf, MAXPATHLEN)
264
265 /* Defines size_t and alloca ().  */
266 #include <malloc.h>
267
268 #include <sys/stat.h>
269
270 /* Define for those source files that do not include enough NT 
271    system files.  */
272 #ifndef NULL
273 #ifdef __cplusplus
274 #define NULL    0
275 #else
276 #define NULL    ((void *)0)
277 #endif
278 #endif
279
280 /* For proper declaration of environ.  */
281 #include <stdlib.h>
282 #include <string.h>
283
284 /* Define process implementation */
285 #define HAVE_WIN32_PROCESSES
286
287 /* We need a little extra space, see ../../lisp/loadup.el */
288 #define SYSTEM_PURESIZE_EXTRA 15000
289
290 /* ============================================================ */
291
292 /* See unexnt.c */
293 #if (_MSC_VER >= 1100)
294 #define DUMP_SEPARATE_SECTION
295 #endif
296 #ifdef DUMP_SEPARATE_SECTION
297 #pragma data_seg("xdata")
298 #pragma bss_seg("xdata")
299 #endif
300
301 #ifdef HAVE_SCROLLBARS
302 /* Ensure the NT 4 mouse definitions in winuser.h are available */
303  #ifndef _WIN32_WINNT
304   #define _WIN32_WINNT 0x0400
305  #endif
306 #endif
307
308 /* MSVC 6.0 has a mechanism to declare functions which never return */
309 #if (_MSC_VER >= 1200)
310 #define DOESNT_RETURN __declspec(noreturn) void
311 #define DECLARE_DOESNT_RETURN(decl) __declspec(noreturn) extern void decl
312 #define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
313           __declspec(noreturn) extern void decl PRINTF_ARGS(str,idx)
314 #endif /* MSVC 6.0 */