annotate src/s/mingw32.h @ 558:ed498ef2108b

[xemacs-hg @ 2001-05-23 09:59:33 by ben] xemacs.mak: call `ver' to get the exact os version and put it in the installation; suggestion from adrian. behavior-defs.el: Add scroll-in-place, jka-compr, efs, fix up some things. pop.c: Remove BROKEN_CYGWIN. etc\sample.init.el: Rewrite to be much more careful about loading features -- now it decays gracefully even in the complete absence of packages. Also avoid doing obnoxious things when loading efs. configure.in: add some support for eventually turning on file coding by default. Fix numerous places where AC_MSG_WARN had quotes around its arg, which is bad. Replace with []. Same for AC_MSG_ERROR. s\cygwin32.h, s\mingw32.h: remove support for way old beta versions of cygwin. don't put -Wno-sign-compare in the system switches; this isn't a system issue. define BROKEN_SIGIO for cygwin to get C-g support. device-msw.c: signal an error rather than crash with an unavailable network printer (from Mike Alexander). event-msw.c: cleanup headers. fix (hopefully) an error with data corruption when sending to a network connection. fileio.c: Fix evil code that attempts to handle the ~user prefix by (a) always assuming we're referencing ourselves and not even verifying the user -- hence any file with a tilde as its first char is invalid! (b) if there wasn't a slash following the filename, the pointer was set *past* the end of file and we started reading from uninitialized memory. Now we simply treat these as files, always. optionally for 21.4 (doc fix): lread.c: cambia de pas_de_lache_ici -- al minimo usa la palabra certa. frame.c: fix warnings. emacs.c, nt.c, ntproc.c, process-nt.c, realpath.c, unexnt.c: rename MAX_PATH to standard PATH_MAX. process-nt.c, realpath.c: cleanup headers. process-unix.c, sysdep.c, systime.h, syswindows.h: kill BROKEN_CYGWIN and support for way old beta versions of cygwin. sysfile.h: use _MAX_PATH (Windows) preferentially for PATH_MAX if defined. include io.h on Cygwin (we need get_osfhandle()). include sys/fcntl.h always, since we were including it in various header files anyway. unexcw.c: fix up style to conform to standard. remove duplicate definition of PERROR. buffer.c: comment change. database.c, debug.h, device-tty.c, dired-msw.c, glyphs-msw.c: header cleanups (remove places that directly include a system header file, because we have our own layer to do this more cleanly and portably); indentation fixes.
author ben
date Wed, 23 May 2001 09:59:48 +0000
parents 666d73d6ac56
children 023b83f4e54b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* system description file for mingw32.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994, 1995, 1999 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 This file is part of GNU Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 GNU General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 /* based on cygwin32.h by Andy Piper <andy@xemacs.org> */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
23 /* Identify ourselves */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
24 #ifndef WIN32_NATIVE
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
25 #define WIN32_NATIVE
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
28 #define MINGW
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 #ifndef ORDINARY_LINK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 #define ORDINARY_LINK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
34 #define C_SWITCH_SYSTEM "-mno-cygwin -fno-caller-saves -DWIN32_NATIVE"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
35 #define LIBS_SYSTEM "-mno-cygwin -mwindows -lwinmm -lwsock32"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
36 #define WIN32_LEAN_AND_MEAN
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 #define TEXT_START -1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 #define TEXT_END -1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 #define DATA_END -1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 #define HEAP_IN_DATA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 #define UNEXEC "unexcw.o"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 #define TIME_ONESHOT 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 #define TIME_PERIODIC 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 #define LOCALE_USE_CP_ACP 0x40000000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 #define NSIG 23
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
49 /* this is necessary to get the TCS_* definitions in <commctrl.h> */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
50 #define _WIN32_IE 0x0400
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 /* translate NT world unexec stuff to our a.out definitions */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 #define strnicmp strncasecmp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 /* #ifndef HAVE_SOCKETS */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 #define HAVE_SOCKETS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 /* #endif */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 #undef MAIL_USE_SYSTEM_LOCK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 #define HAVE_MSW_C_DIRED
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 /* System calls that are encapsulated */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 #define ENCAPSULATE_RENAME
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 #define ENCAPSULATE_OPEN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 #define ENCAPSULATE_FOPEN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 #define ENCAPSULATE_MKDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
68 #define ENCAPSULATE_STAT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
69 #define ENCAPSULATE_FSTAT
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
71 /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
72 since there is no load average available. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 /* Define VIRT_ADDR_VARIES if the virtual addresses of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 pure and impure space as loaded can vary, and even their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 relative order cannot be relied on.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 Otherwise Emacs assumes that text space precedes data space,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 numerically. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 /* Text does precede data space, but this is never a safe assumption. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 #define VIRT_ADDR_VARIES
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 /* If you are compiling with a non-C calling convention but need to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 declare vararg routines differently, put it here */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 #define _VARARGS_ __cdecl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 /* If you are providing a function to something that will call the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 function back (like a signal handler and signal, or main) its calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 convention must be whatever standard the libraries expect */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 #define _CALLBACK_ __cdecl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 /* SYSTEM_TYPE should indicate the kind of system you are using.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 It sets the Lisp variable system-type. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 #define SYSTEM_TYPE "windows-nt"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 #define NO_MATHERR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 /* define MAIL_USE_FLOCK if the mailer uses flock
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 to interlock access to /usr/spool/mail/$USER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 The alternative is that a lock file named
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 /usr/spool/mail/$USER.lock. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 /* If the character used to separate elements of the executable path
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 is not ':', #define this to be the appropriate character constant. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 #define SEPCHAR ';'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 /* ============================================================ */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 /* Here, add any special hacks needed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 to make Emacs work on this system. For example,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 you might define certain system call names that don't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 exist on your system, or that do different things on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 your system and must be used only through an encapsulation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 (Which you should place, by convention, in sysdep.c). */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 /* Define this to be the separator between devices and paths */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 #define DEVICE_SEP ':'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
121 #define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 /* The null device on Windows NT. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 #define NULL_DEVICE "NUL:"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 /* We'll support either convention on NT. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 /* We need a little extra space, see ../../lisp/loadup.el */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 #define SYSTEM_PURESIZE_EXTRA 15000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 #ifndef NOT_C_CODE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 #include <stdlib.h>
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 462
diff changeset
136 #include <../mingw/process.h>
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 #define mkdir __mkdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 #include <dir.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 #undef mkdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 /* IO calls that are emulated or shadowed */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 #define pipe sys_pipe
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 int sys_pipe (int * phandles);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 #ifndef HAVE_X_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 #define sleep sys_sleep
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 void sleep (int seconds);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 /* subprocess calls that are emulated */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 #define spawnve sys_spawnve
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
152 int spawnve (int mode, const char *cmdname,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
153 const char * const *argv, const char *const *envp);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 #define wait sys_wait
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 int wait (int *status);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 #define kill sys_kill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 int kill (int pid, int sig);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 /* map to MSVC names */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 #define popen _popen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 #define pclose _pclose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 /* Encapsulation of system calls */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 #ifndef DONT_ENCAPSULATE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 #define getpid sys_getpid
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 pid_t getpid (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 #define DONT_USE_LITOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 /* Random global functions called everywhere. Implemented in nt.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 /* #### Most of these are FSFisms and must be avoided */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 /* #### All of these are FSFisms and must be avoided */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 void dostounix_filename (char *p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 void unixtodos_filename (char *p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 char *getwd (char *dir);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 void *sbrk (unsigned long increment);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 struct passwd;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 struct passwd *getpwuid (uid_t uid);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 struct passwd *getpwnam (const char *name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 uid_t getuid (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 uid_t geteuid (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 gid_t getgid (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 gid_t getegid (void);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
191
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 /* Stuff that gets set wrongly or otherwise */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 #define HAVE_SETITIMER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 #define HAVE_GETTIMEOFDAY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 #define HAVE_SELECT
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
196 /* systime.h includes winsock.h which defines timeval */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
197 #define HAVE_TIMEVAL
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
198 #define HAVE_GETPAGESIZE
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
199 #define getpagesize() 4096
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
200 #ifndef HAVE_H_ERRNO
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
201 #define HAVE_H_ERRNO
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
202 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
203 #ifndef HAVE_TZNAME
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
204 #define HAVE_TZNAME
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
205 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 #undef GETTIMEOFDAY_ONE_ARGUMENT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 #undef HAVE_SYS_WAIT_H
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 #undef HAVE_TERMIOS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 #undef SYSV_SYSTEM_DIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
211 #undef CLASH_DETECTION
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 /* We now have emulation for some signals */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 #define HAVE_SIGHOLD
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
215 #define sigset(s,h) mswindows_sigset(s,h)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
216 #define sighold(s) mswindows_sighold(s)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
217 #define sigrelse(s) mswindows_sigrelse(s)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
218 #define sigpause(s) mswindows_sigpause(s)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 #define signal sigset
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 /* Defines that we need that aren't in the standard signal.h */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 #define SIGHUP 1 /* Hang up */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 #define SIGQUIT 3 /* Quit process */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 #define SIGKILL 9 /* Die, die die */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 #define SIGALRM 14 /* Alarm */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 #define SIGPROF 29 /* Profiling timer exp */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 #ifndef MAXPATHLEN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 #define MAXPATHLEN _MAX_PATH
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 #endif
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
231 #endif /* !NOT_C_CODE */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 /* Define for those source files that do not include enough NT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 system files. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 #ifndef NULL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 #ifdef __cplusplus
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 #define NULL 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 #define NULL ((void *)0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 /* Define process implementation */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 #define HAVE_WIN32_PROCESSES
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
246 #define CORRECT_DIR_SEPS(s) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
247 do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
248 else unixtodos_filename (s); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
249 } while (0)