annotate src/s/cygwin32.h @ 593:5fd7ba8b56e7

[xemacs-hg @ 2001-05-31 12:45:27 by ben] xemacs-faq.texi: Major rewrite. Update all MS Windows info to current. Redo section 6.1 almost completely. Incorporate sections 1 and 2 of Hrvoje's FAQ. etags.el: Fix infloop when going up to the root. s\cygwin32.h: Don't unilaterally include ntplay, but only when we're compiling with native sound (look in configure now). event-msw.c: Fix yet more problems with C-g handling. Implement debug-mswindows-events. event-stream.c, events.h, signal.c, sysdep.h: Rearrange the signal-handling code to eliminate the former spaghetti logic paths in it. Document clearly what "low-level" and "high-level" timeouts are. Rename some functions with unclear names (e.g. "...alarm...") to names that reflect what they actually do (e.g. "...async_timeout..."). Fix numerous bugs discovered in the process. console-x.h, event-Xt.c, event-msw.c, frame-x.c: Hopefully make XEmacs properly maintain the "iconified" state on frames at all times. This should fix the "can't delete a frame with C-x 5 0 when there's another iconified frame out there" bug. Put a notice in of further changes that should probably be made to clean up the frame-visibility support. (especially directed at Jan Vroonhof) lisp.h, miscplay.c: Rename SBufbyte to CBufbyte to avoid a misleading name. Eliminate UChar, which is not used anywhere and contributes no semantic info. Add a comment about the documentation-only properties of the char/unsigned char typedefs. Add SChar_Binary as an explicitly `signed' version of Char_Binary and put back the `signed' declarations in miscplay.c. alloc.c: Use char typedefs. console-msw.c, device-msw.c, dialog-msw.c, editfns.c, fileio.c, glyphs-eimage.c, menubar-msw.c, ntplay.c, objects-msw.c, realpath.c, redisplay-msw.c, select-msw.c, syswindows.h, win32.c: Eliminate numerous C++ errors. frame-msw.c: Eliminate numerous C++ errors and Mule-ize. glyphs-msw.c: Eliminate numerous C++ errors and use char typedefs. configure.in: Fix problems detecting both native and Linux sound on Cygwin when compiled with --with-msw=no. Rearrange file-coding handling a bit to avoid warning when compiling with Mule. configure.in, configure.usage, INSTALL: Document XEMACS_CC and corresponding compiler option --xemacs-compiler. Explain how to build xemacs using a C++ compiler.
author ben
date Thu, 31 May 2001 12:45:41 +0000
parents ed498ef2108b
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 cygwin32.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 535
diff changeset
3 Copyright (C) 2001 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 This file is part of GNU Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 GNU Emacs is free software; you can redistribute it and/or modify
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 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
9 the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 GNU Emacs is distributed in the hope that it will be useful,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 GNU General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 /* Building under cygwin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 *
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
24 * The approach I have taken with this port is to use primarily the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
25 * UNIX code base adding stuff that is MS-Windows specific. This works
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
26 * quite well, and is in keeping with my perception of the cygwin
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
27 * philosophy. Note that if you make changes to this file you do NOT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
28 * want to define WIN32_NATIVE (formerly "WINDOWSNT"), I repeat - do
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
29 * not define this, it will break everything horribly. What does get
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
30 * defined is HAVE_MS_WINDOWS, but this is done by configure and only
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
31 * applies to the window system.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 * When building make sure your HOME path is unix style - i.e. without
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 * a drive letter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 * once you have done this, configure and make.
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 * windows '95 - I haven't tested this under '95, it will probably
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 * build but I konw there are some limitations with cygwin under 95 so
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 * YMMV. I build with NT4 SP3.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 * Andy Piper <andy@xemacs.org> 8/1/98
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 * http://www.xemacs.freeserve.co.uk/ */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
45 /* Identify ourselves */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
46 #define CYGWIN
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
47
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 /* cheesy way to determine cygwin version */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 #ifndef NOT_C_CODE
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
50 # include <signal.h>
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 535
diff changeset
51 # include <cygwin/version.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
52
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 535
diff changeset
53 void cygwin_win32_to_posix_path_list (const char *, char *);
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 535
diff changeset
54 int cygwin_win32_to_posix_path_list_buf_size (const char *);
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 535
diff changeset
55 void cygwin_posix_to_win32_path_list (const char *, char *);
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 535
diff changeset
56 int cygwin_posix_to_win32_path_list_buf_size (const char *);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
58 /* Still left out of 1.1! */
464
5aa1854ad537 Import from CVS: tag r21-2-47
cvs
parents: 446
diff changeset
59 double logb (double);
5aa1854ad537 Import from CVS: tag r21-2-47
cvs
parents: 446
diff changeset
60 int killpg (int pgrp, int sig);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
61
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 #ifndef ORDINARY_LINK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 #define ORDINARY_LINK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 535
diff changeset
68 #define C_SWITCH_SYSTEM -fno-caller-saves
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 #define LIBS_SYSTEM -lwinmm
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
70 #define WIN32_LEAN_AND_MEAN
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 #define TEXT_START -1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 #define TEXT_END -1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 #define DATA_END -1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 #define HEAP_IN_DATA
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
76 #define NO_LIM_DATA
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 #define UNEXEC "unexcw.o"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 #define BROKEN_SIGIO
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 535
diff changeset
80
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 #define strnicmp strncasecmp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 #ifndef HAVE_SOCKETS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 #define HAVE_SOCKETS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 #undef MAIL_USE_SYSTEM_LOCK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
88 /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
89 since there is no load average available. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 /* Define VIRT_ADDR_VARIES if the virtual addresses of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 pure and impure space as loaded can vary, and even their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 relative order cannot be relied on.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 Otherwise Emacs assumes that text space precedes data space,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 numerically. */
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 /* Text does precede data space, but this is never a safe assumption. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 #define VIRT_ADDR_VARIES
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 /* 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
102 declare vararg routines differently, put it here */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 #define _VARARGS_ __cdecl
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 you are providing a function to something that will call the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 function back (like a signal handler and signal, or main) its calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 convention must be whatever standard the libraries expect */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 #define _CALLBACK_ __cdecl
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 /* SYSTEM_TYPE should indicate the kind of system you are using.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 It sets the Lisp variable system-type. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 #define SYSTEM_TYPE "cygwin32"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 #define NO_MATHERR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 /* define MAIL_USE_FLOCK if the mailer uses flock
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 to interlock access to /usr/spool/mail/$USER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 The alternative is that a lock file named
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 /usr/spool/mail/$USER.lock. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 /* If the character used to separate elements of the executable path
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 is not ':', #define this to be the appropriate character constant. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 #define SEPCHAR ':'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 /* ============================================================ */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 /* Here, add any special hacks needed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 to make Emacs work on this system. For example,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 you might define certain system call names that don't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 exist on your system, or that do different things on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 your system and must be used only through an encapsulation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 (Which you should place, by convention, in sysdep.c). */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 /* Define this to be the separator between path elements */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 /* #define DIRECTORY_SEP XINT (Vdirectory_sep_char) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 /* Define this to be the separator between devices and paths */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 #define DEVICE_SEP ':'
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 /* We'll support either convention on NT. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 #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
144 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 /* We need a little extra space, see ../../lisp/loadup.el */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 #define SYSTEM_PURESIZE_EXTRA 15000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 #define CYGWIN_CONV_PATH(src, dst) \
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
150 dst = alloca (cygwin_win32_to_posix_path_list_buf_size(src)); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
151 cygwin_win32_to_posix_path_list(src, dst)
593
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
152 /* !!#### more mule bogosity */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 #define CYGWIN_WIN32_PATH(src, dst) \
593
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
154 dst = (Extbyte *) alloca (cygwin_posix_to_win32_path_list_buf_size(src)); \
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
155 cygwin_posix_to_win32_path_list(src, dst)