Mercurial > hg > xemacs-beta
annotate src/syswindows.h @ 5933:c1e8f3294298 cygwin
revert timeval comment, backed out change to winsock.h and just lots of warnings???
Also updated config.inc.samp to reflect a way to work around lack of windows-runnable hg
author | Henry Thompson <ht@markup.co.uk> |
---|---|
date | Thu, 10 Dec 2015 17:55:59 +0000 |
parents | a0d9bfe304de |
children | 574f0cded429 |
rev | line source |
---|---|
442 | 1 /* Copyright (C) 2000 Free Software Foundation, Inc. |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
2 Copyright (C) 2000, 2001, 2002, 2004, 2010 Ben Wing. |
442 | 3 |
4 This file is part of XEmacs. | |
5 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5048
diff
changeset
|
6 XEmacs is free software: you can redistribute it and/or modify it |
442 | 7 under the terms of the GNU General Public License as published by the |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5048
diff
changeset
|
8 Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5048
diff
changeset
|
9 option) any later version. |
442 | 10 |
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5048
diff
changeset
|
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
442 | 18 |
19 /* Synched up with: Not in FSF. */ | |
20 | |
5022
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
21 #ifndef INCLUDED_syswindows_h_ |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
22 #define INCLUDED_syswindows_h_ |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
23 |
442 | 24 /* Authorship: |
25 | |
771 | 26 Current primary author: Ben Wing <ben@xemacs.org> |
27 | |
442 | 28 Created May 2000 by Andy Piper. |
771 | 29 Windows-Mule stuff added by Ben Wing, 2000-2001. |
30 September 2001 Ben Wing reorganized and included nt.h and ntheap.h into | |
31 this file; comments in those files say: | |
32 * Adapted for XEmacs by David Hobley <david@spook-le0.cia.com.au> | |
33 * Sync'ed with Emacs 19.34.6 by Marc Paquette <marcpa@cam.org> | |
34 (Note: Sync messages from Marc Paquette may indicate | |
35 incomplete synching, so beware.) | |
36 (in ntheap.h only) Geoff Voelker (voelker@cs.washington.edu) 7-29-94 | |
37 | |
442 | 38 */ |
39 | |
5022
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
40 /* See win32.c for info about the different Windows files in XEmacs. */ |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
41 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
42 /* |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
43 A capsule introduction to Windows-related build flags: |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
44 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
45 See also: (Info-goto-node "(internals)Windows Build Flags") |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
46 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
47 1. Operating-system level: |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
48 -------------------------- |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
49 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
50 `CYGWIN' Compiled for Cygwin. Cygwin provides a full Unix-like |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
51 environment under Windows. Applications compiled for Cygwin |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
52 are linked with CYGWIN1.DLL, which provides the POSIX |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
53 emulation. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
54 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
55 Corresponding s/ file: s/cygwin32.h |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
56 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
57 `MINGW' Compiled for MinGW. MinGW is a Unix-like environment under |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
58 Windows that allows for the use of `gcc' to create fully |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
59 native Windows applications that link with the normal |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
60 Microsoft C-runtime library (e.g. MSVCRT.DLL), and don't |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
61 require a special POSIX-emulation DLL (e.g. CYGWIN1.DLL). |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
62 Conversely, the only POSIX-like services available are |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
63 those in MSVCRT.DLL, which isn't much. Essentially, coding |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
64 for MinGW is identical to coding for native Windows using |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
65 Visual C++ or the like, whereas coding for Cygwin is like |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
66 coding for Linux, but with the additional possibility of |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
67 making Win32-API calls. Additional confusion comes from |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
68 the fact that you can use the Cygwin environment and |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
69 compilers to build a MINGW application (e.g. by passing the |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
70 `-mno-cygwin' command-line argument to `gcc'). |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
71 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
72 Corresponding s/ file: s/mingw32.h |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
73 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
74 (none) There's no flag to indicate that you are specifically |
5384
3889ef128488
Fix misspelled words, and some grammar, across the entire source tree.
Jerry James <james@xemacs.org>
parents:
5048
diff
changeset
|
75 targeting native Windows and not doing this with MINGW. |
5022
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
76 Presumably this means you're using Visual C++. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
77 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
78 Corresponding s/ file: s/windowsnt.h |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
79 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
80 `WIN32_ANY' Any of the above three environments. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
81 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
82 Corresponding s/ file: s/win32-common.h |
442 | 83 |
5022
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
84 `WIN32_NATIVE' |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
85 Native Windows target, either MinGW or Visual C++. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
86 That is, not Cygwin. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
87 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
88 Corresponding s/ file: s/win32-native.h |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
89 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
90 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
91 2. Compiler level: |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
92 ------------------ |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
93 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
94 `__GNUC__' Defined whenever compiling with gcc (Cygwin or MinGW). |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
95 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
96 `_MSC_VER' Defined whenever compiling with Visual C++. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
97 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
98 `CYGWIN_HEADERS' |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
99 Defined whenever using Cygwin-style header files rather |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
100 than Visual C++ headers. Currently this means the same |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
101 as "Cygwin or MinGW" and the same as "compiling with gcc". |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
102 This applies especially to the header files in |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
103 /usr/include/w32api, which is a free replacement for the |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
104 standard Visual C++ headers for the Win32 API. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
105 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
106 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
107 3. Window-system level: |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
108 ----------------------- |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
109 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
110 `HAVE_MS_WINDOWS' |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
111 MS Windows native windowing system (anything related to the |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
112 appearance of the graphical screen). May or may not apply |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
113 to any of VC++, MinGW, or Cygwin. For example, it's |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
114 definitely possible to compile XEmacs under Cygwin with |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
115 support for X-Windows frames and TTY frames, but no |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
116 native MS Windows frames. It may also be possible to do that |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
117 under MinGW or (less likely, but feasible) Visual C++. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
118 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
119 `HAVE_X_WINDOWS' |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
120 Support for X-Windows frames, regardless of whether under |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
121 MS Windows. You can certainly compile XEmacs with support |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
122 for X-Windows frames when running on MS Windows, using Cygwin. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
123 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
124 `HAVE_GTK', `HAVE_TTY' |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
125 Likewise. All are available on MS Windows with Cygwin. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
126 |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
127 Note further that more than one of these can be defined at the same time. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
128 In fact, in general, it's possible to compile with support for all of |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
129 these at the same time. |
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
130 |
5046 | 131 |
132 | |
133 Here is a table mapping from GNU Emacs constants to XEmacs constants for | |
134 use in porting code. | |
135 | |
136 | |
137 Old Constant New Constant | |
138 --------------------------------------------------------------- | |
139 `WINDOWSNT' `WIN32_NATIVE' | |
140 `WIN32' `WIN32_NATIVE' | |
141 `_WIN32' `WIN32_NATIVE' | |
142 `HAVE_WIN32' `WIN32_NATIVE' | |
143 `DOS_NT' `WIN32_NATIVE' | |
144 `HAVE_NTGUI' `WIN32_NATIVE', unless it ends up already bracketed | |
145 by this | |
146 `HAVE_FACES' always true | |
147 `MSDOS' determine whether this code is really specific to | |
148 MS-DOS (and not Windows - e.g. DJGPP code); if so, | |
149 delete the code; otherwise, convert to `WIN32_NATIVE' | |
150 (we do not support MS-DOS w/DOS Extender under XEmacs) | |
151 `__CYGWIN__' `CYGWIN' | |
152 `__CYGWIN32__' `CYGWIN' | |
153 `__MINGW32__' `MINGW' | |
154 | |
5022
cfe36e196dc7
long comment in syswindows.h about build constants
Ben Wing <ben@xemacs.org>
parents:
4988
diff
changeset
|
155 */ |
442 | 156 |
771 | 157 /* ------------------------- Basic includes ------------------------- */ |
442 | 158 |
159 #ifndef WIN32_LEAN_AND_MEAN | |
160 #define WIN32_LEAN_AND_MEAN | |
161 #endif | |
162 | |
4858
e1d8b6b0c589
Define CYGWIN_HEADERS in s/cygwin32.h and s/mingw32.h instead of syswindows.h, so they're available everywhere
Ben Wing <ben@xemacs.org>
parents:
4854
diff
changeset
|
163 #ifdef CYGWIN_HEADERS |
771 | 164 # ifndef _WIN32_IE |
165 # define _WIN32_IE 0x0400 | |
166 # endif | |
665 | 167 |
1743 | 168 BEGIN_C_DECLS |
665 | 169 |
4827
11daf37dae4d
more fixes to get a clean compile
Ben Wing <ben@xemacs.org>
parents:
4824
diff
changeset
|
170 #if 0 /* breaks the build, as of GCC 3.4.4 or earlier, since the prototype |
11daf37dae4d
more fixes to get a clean compile
Ben Wing <ben@xemacs.org>
parents:
4824
diff
changeset
|
171 is now declared static */ |
665 | 172 /* Fucking GCC complains about "no previous prototype" for inline |
173 functions. DUH! See DECLARE_INLINE_HEADER. */ | |
174 extern __inline void *GetCurrentFiber (void); | |
175 extern __inline void *GetFiberData (void); | |
4824
c12b646d84ee
changes to get things to compile under latest cygwin
Ben Wing <ben@xemacs.org>
parents:
4538
diff
changeset
|
176 #endif |
665 | 177 |
1743 | 178 END_C_DECLS |
665 | 179 |
180 #endif | |
181 | |
771 | 182 /* Defines for COM so it's usable in both C and C++. XECOMCALLn() calls a |
183 method with the specified number of parameters. XECOMID() surrounds a | |
184 class or interface name when passed to CoCreateInstance, a | |
185 QueryInterface method, or the like. */ | |
186 #ifdef __cplusplus | |
187 #define XECOMCALL0(cl, meth) ((cl)->meth ()) | |
188 #define XECOMCALL1(cl, meth, a1) ((cl)->meth (a1)) | |
189 #define XECOMCALL2(cl, meth, a1, a2) ((cl)->meth (a1, a2)) | |
190 #define XECOMCALL3(cl, meth, a1, a2, a3) ((cl)->meth (a1, a2, a3)) | |
191 #define XECOMCALL4(cl, meth, a1, a2, a3, a4) ((cl)->meth (a1, a2, a3, a4)) | |
192 #define XECOMID(id) (id) | |
193 #else | |
194 #define XECOMCALL0(cl, meth) ((cl)->lpVtbl->meth (cl)) | |
195 #define XECOMCALL1(cl, meth, a1) ((cl)->lpVtbl->meth (cl, a1)) | |
196 #define XECOMCALL2(cl, meth, a1, a2) ((cl)->lpVtbl->meth (cl, a1, a2)) | |
197 #define XECOMCALL3(cl, meth, a1, a2, a3) ((cl)->lpVtbl->meth (cl, a1, a2, a3)) | |
198 #define XECOMCALL4(cl, meth, a1, a2, a3, a4) \ | |
199 ((cl)->lpVtbl->meth (cl, a1, a2, a3, a4)) | |
200 #define XECOMID(id) (&(id)) | |
201 #endif | |
202 | |
203 #define OEMRESOURCE /* Define OCR_ and friend constants */ | |
442 | 204 #include <windows.h> |
205 | |
3728 | 206 #include <aclapi.h> |
207 | |
558 | 208 #if defined (WIN32_LEAN_AND_MEAN) |
209 # ifdef HAVE_X_WINDOWS | |
442 | 210 /* Christ almighty. The problems you get when combining two large code bases, |
211 neither with any respect for namespace purity. */ | |
558 | 212 # undef Status |
213 # endif | |
214 # include <winspool.h> | |
215 # ifdef HAVE_X_WINDOWS | |
216 # define Status int | |
217 # endif | |
218 # include <mmsystem.h> | |
673 | 219 # include <shlobj.h> |
558 | 220 # include <shellapi.h> |
221 # include <ddeml.h> | |
442 | 222 #endif |
223 | |
546 | 224 #include <lmaccess.h> /* next three for NetUserEnum and friends */ |
531 | 225 #include <lmapibuf.h> |
226 #include <lmerr.h> | |
546 | 227 #include <lmcons.h> /* for UNLEN and possibly other constants */ |
531 | 228 |
771 | 229 #include <cderr.h> |
230 #include <commdlg.h> | |
231 | |
232 #ifdef NEED_MSWINDOWS_COMMCTRL | |
233 #include <commctrl.h> | |
442 | 234 #endif |
771 | 235 #ifdef NEED_MSWINDOWS_OBJBASE |
236 #include <objbase.h> | |
442 | 237 #endif |
771 | 238 #ifdef NEED_MSWINDOWS_SHLOBJ |
239 #include <shlobj.h> | |
442 | 240 #endif |
241 | |
771 | 242 #include <zmouse.h> /* WHEEL_PAGESCROLL under Cygwin */ |
243 | |
244 #include <wchar.h> | |
442 | 245 |
771 | 246 /* ------------------------- Cygwin header brokenness ---------------------- */ |
247 | |
248 #ifdef CYGWIN_HEADERS | |
249 | |
1683 | 250 #include <cygwin/stat.h> /* for struct stat */ |
1304 | 251 #include <w32api.h> /* for version info */ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
252 #include <sys/cygwin.h> /* path conversion functions */ |
1304 | 253 |
1683 | 254 /* Test for a specific version of w32api */ |
255 #define W32API_VER(major,minor) (((major) << 16) + (minor)) | |
256 #define W32API_INSTALLED_VER \ | |
257 W32API_VER (__W32API_MAJOR_VERSION, __W32API_MINOR_VERSION) | |
1304 | 258 |
771 | 259 /* Various brokennesses in various versions of Cygwin */ |
673 | 260 |
442 | 261 /* windows.h defines. */ |
262 #ifndef SPI_GETWHEELSCROLLLINES | |
263 #define SPI_GETWHEELSCROLLLINES 104 | |
264 #endif | |
771 | 265 |
266 /* commctrl.h defines. */ | |
267 #ifndef TB_SETIMAGELIST | |
268 #define TB_SETIMAGELIST (WM_USER + 48) | |
442 | 269 #endif |
771 | 270 #ifndef TB_GETIMAGELIST |
271 #define TB_GETIMAGELIST (WM_USER + 49) | |
272 #endif | |
273 #ifndef TB_SETDISABLEDIMAGELIST | |
274 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54) | |
275 #endif | |
276 #ifndef TB_GETDISABLEDIMAGELIST | |
277 #define TB_GETDISABLEDIMAGELIST (WM_USER + 55) | |
442 | 278 #endif |
771 | 279 #ifndef TB_SETPADDING |
280 #define TB_SETPADDING (WM_USER + 87) | |
281 #endif | |
282 #ifndef TB_GETBUTTONINFOA | |
283 #define TB_GETBUTTONINFOA (WM_USER + 65) | |
284 #endif | |
285 #ifndef TB_GETBUTTONINFOW | |
286 #define TB_GETBUTTONINFOW (WM_USER + 63) | |
442 | 287 #endif |
771 | 288 #ifndef TB_SETBUTTONINFOA |
289 #define TB_SETBUTTONINFOA (WM_USER + 66) | |
290 #endif | |
291 #ifndef TB_SETBUTTONINFOW | |
292 #define TB_SETBUTTONINFOW (WM_USER + 64) | |
293 #endif | |
294 #ifndef TB_INSERTBUTTONA | |
295 #define TB_INSERTBUTTONA (WM_USER + 21) | |
442 | 296 #endif |
771 | 297 #ifndef TB_INSERTBUTTONW |
298 #define TB_INSERTBUTTONW (WM_USER + 67) | |
299 #endif | |
300 #ifndef TB_ADDBUTTONSA | |
301 #define TB_ADDBUTTONSA (WM_USER + 20) | |
302 #endif | |
303 #ifndef TB_ADDBUTTONSW | |
304 #define TB_ADDBUTTONSW (WM_USER + 68) | |
442 | 305 #endif |
771 | 306 #ifndef LVM_SETBKIMAGEA |
307 #define LVM_SETBKIMAGEA (LVM_FIRST + 68) | |
308 #endif | |
309 #ifndef LVM_SETBKIMAGEW | |
310 #define LVM_SETBKIMAGEW (LVM_FIRST + 138) | |
311 #endif | |
312 #ifndef LVM_GETBKIMAGEA | |
313 #define LVM_GETBKIMAGEA (LVM_FIRST + 69) | |
442 | 314 #endif |
771 | 315 #ifndef LVM_GETBKIMAGEW |
316 #define LVM_GETBKIMAGEW (LVM_FIRST + 139) | |
317 #endif | |
318 #ifndef WC_COMBOBOXEXW | |
319 #define WC_COMBOBOXEXW L"ComboBoxEx32" | |
320 #endif | |
321 #ifndef CBEM_INSERTITEMA | |
322 #define CBEM_INSERTITEMA (WM_USER + 1) | |
442 | 323 #endif |
771 | 324 #ifndef CBEM_INSERTITEMW |
325 #define CBEM_INSERTITEMW (WM_USER + 11) | |
442 | 326 #endif |
771 | 327 #ifndef CBEM_SETITEMA |
328 #define CBEM_SETITEMA (WM_USER + 5) | |
329 #endif | |
330 #ifndef CBEM_SETITEMW | |
331 #define CBEM_SETITEMW (WM_USER + 12) | |
442 | 332 #endif |
771 | 333 #ifndef CBEM_GETITEMA |
334 #define CBEM_GETITEMA (WM_USER + 4) | |
335 #endif | |
336 #ifndef CBEM_GETITEMW | |
337 #define CBEM_GETITEMW (WM_USER + 13) | |
442 | 338 #endif |
771 | 339 #ifndef HDN_GETDISPINFOA |
340 #define HDN_GETDISPINFOA (HDN_FIRST - 9) | |
341 #endif | |
342 #ifndef HDN_GETDISPINFOW | |
343 #define HDN_GETDISPINFOW (HDN_FIRST - 29) | |
344 #endif | |
345 #ifndef TBN_GETDISPINFOA | |
346 #define TBN_GETDISPINFOA (TBN_FIRST - 16) | |
442 | 347 #endif |
771 | 348 #ifndef TBN_GETDISPINFOW |
349 #define TBN_GETDISPINFOW (TBN_FIRST - 17) | |
350 #endif | |
351 #ifndef TBN_GETINFOTIPA | |
352 #define TBN_GETINFOTIPA (TBN_FIRST - 18) | |
442 | 353 #endif |
771 | 354 #ifndef TBN_GETINFOTIPW |
355 #define TBN_GETINFOTIPW (TBN_FIRST - 19) | |
356 #endif | |
357 #ifndef TTN_GETDISPINFOA | |
358 #define TTN_GETDISPINFOA (TTN_FIRST - 0) | |
359 #endif | |
360 #ifndef TTN_GETDISPINFOW | |
361 #define TTN_GETDISPINFOW (TTN_FIRST - 10) | |
442 | 362 #endif |
771 | 363 |
364 #if (_WIN32_IE >= 0x0400) | |
365 | |
366 #ifndef LVN_GETINFOTIPA | |
367 #define LVN_GETINFOTIPA (LVN_FIRST - 57) | |
368 #endif | |
369 #ifndef LVN_GETINFOTIPW | |
370 #define LVN_GETINFOTIPW (LVN_FIRST - 58) | |
442 | 371 #endif |
771 | 372 #ifndef TVN_GETINFOTIPA |
373 #define TVN_GETINFOTIPA (TVN_FIRST - 13) | |
374 #endif | |
375 #ifndef TVN_GETINFOTIPW | |
376 #define TVN_GETINFOTIPW (TVN_FIRST - 14) | |
377 #endif | |
378 #ifndef CBEN_GETDISPINFOA | |
379 #define CBEN_GETDISPINFOA (CBEN_FIRST - 0) | |
442 | 380 #endif |
771 | 381 #ifndef CBEN_GETDISPINFOW |
382 #define CBEN_GETDISPINFOW (CBEN_FIRST - 7) | |
383 #endif | |
384 #ifndef CBEN_DRAGBEGINA | |
385 #define CBEN_DRAGBEGINA (CBEN_FIRST - 8) | |
386 #endif | |
387 #ifndef CBEN_DRAGBEGINW | |
388 #define CBEN_DRAGBEGINW (CBEN_FIRST - 9) | |
442 | 389 #endif |
771 | 390 |
391 #endif /* (_WIN32_IE >= 0x0400) */ | |
392 | |
393 #ifndef CBEN_ENDEDITA | |
394 #define CBEN_ENDEDITA (CBEN_FIRST - 5) | |
442 | 395 #endif |
771 | 396 #ifndef CBEN_ENDEDITW |
397 #define CBEN_ENDEDITW (CBEN_FIRST - 6) | |
398 #endif | |
399 | |
400 #ifndef CBEMAXSTRLEN | |
401 #define CBEMAXSTRLEN 260 | |
442 | 402 #endif |
403 | |
1111 | 404 #ifndef NMCBEENDEDIT |
405 | |
406 typedef struct | |
407 { | |
408 NMHDR hdr; | |
409 BOOL fChanged; | |
410 int iNewSelection; | |
411 WCHAR szText[CBEMAXSTRLEN]; | |
412 int iWhy; | |
771 | 413 } NMCBEENDEDITW, *LPNMCBEENDEDITW, *PNMCBEENDEDITW; |
414 | |
1111 | 415 typedef struct |
416 { | |
417 NMHDR hdr; | |
418 BOOL fChanged; | |
419 int iNewSelection; | |
420 char szText[CBEMAXSTRLEN]; | |
421 int iWhy; | |
771 | 422 } NMCBEENDEDITA, *LPNMCBEENDEDITA,*PNMCBEENDEDITA; |
423 | |
1111 | 424 #endif /* not NMCBEENDEDIT */ |
425 | |
771 | 426 #if (_WIN32_IE >= 0x0400) |
427 | |
1111 | 428 #ifndef NMCBEDRAGBEGIN |
429 | |
430 typedef struct | |
431 { | |
432 NMHDR hdr; | |
433 int iItemid; | |
434 WCHAR szText[CBEMAXSTRLEN]; | |
435 } NMCBEDRAGBEGINW, *LPNMCBEDRAGBEGINW, *PNMCBEDRAGBEGINW; | |
771 | 436 |
1111 | 437 typedef struct |
438 { | |
439 NMHDR hdr; | |
440 int iItemid; | |
441 char szText[CBEMAXSTRLEN]; | |
442 } NMCBEDRAGBEGINA, *LPNMCBEDRAGBEGINA, *PNMCBEDRAGBEGINA; | |
443 | |
444 #endif /* not NMCBEDRAGBEGIN */ | |
445 | |
5716
1003acd5a4b8
Fix cygwin build on new win32api.
Vin Shelton <acs@xemacs.org>
parents:
5474
diff
changeset
|
446 #if W32API_INSTALLED_VER < W32API_VER(3,14) |
771 | 447 typedef struct tagNMDATETIMEFORMATA |
448 { | |
1111 | 449 NMHDR nmhdr; |
450 LPCSTR pszFormat; | |
451 SYSTEMTIME st; | |
452 LPCSTR pszDisplay; | |
453 CHAR szDisplay[64]; | |
771 | 454 } NMDATETIMEFORMATA, FAR * LPNMDATETIMEFORMATA; |
455 | |
456 typedef struct tagNMDATETIMEFORMATW | |
457 { | |
1111 | 458 NMHDR nmhdr; |
459 LPCWSTR pszFormat; | |
460 SYSTEMTIME st; | |
461 LPCWSTR pszDisplay; | |
462 WCHAR szDisplay[64]; | |
771 | 463 } NMDATETIMEFORMATW, FAR * LPNMDATETIMEFORMATW; |
5716
1003acd5a4b8
Fix cygwin build on new win32api.
Vin Shelton <acs@xemacs.org>
parents:
5474
diff
changeset
|
464 #endif |
771 | 465 |
1683 | 466 #if W32API_INSTALLED_VER < W32API_VER(2,2) |
1304 | 467 |
1111 | 468 typedef struct tagNMTTDISPIFNOA |
469 { | |
470 NMHDR hdr; | |
471 LPSTR lpszText; | |
472 char szText[80]; | |
473 HINSTANCE hinst; | |
474 UINT uFlags; | |
771 | 475 #if (_WIN32_IE >= 0x0300) |
1111 | 476 LPARAM lParam; |
771 | 477 #endif |
478 } NMTTDISPINFOA, FAR *LPNMTTDISPINFOA; | |
479 | |
1111 | 480 typedef struct tagNMTTDISPINFOW |
481 { | |
482 NMHDR hdr; | |
483 LPWSTR lpszText; | |
484 WCHAR szText[80]; | |
485 HINSTANCE hinst; | |
486 UINT uFlags; | |
771 | 487 #if (_WIN32_IE >= 0x0300) |
1111 | 488 LPARAM lParam; |
771 | 489 #endif |
490 } NMTTDISPINFOW, FAR *LPNMTTDISPINFOW; | |
491 | |
1683 | 492 #endif /* W32API_INSTALLED_VER < W32API_VER(2,2) */ |
1304 | 493 |
771 | 494 #endif /* (_WIN32_IE >= 0x0400) */ |
442 | 495 |
771 | 496 /* shlobj.h defines */ |
497 #ifndef BFFM_VALIDATEFAILEDA | |
498 #define BFFM_VALIDATEFAILEDA 3 | |
499 #endif | |
500 #ifndef BFFM_VALIDATEFAILEDW | |
501 #define BFFM_VALIDATEFAILEDW 4 | |
502 #endif | |
503 #ifndef BFFM_SETSELECTIONA | |
504 #define BFFM_SETSELECTIONA (WM_USER + 102) | |
505 #endif | |
506 #ifndef BFFM_SETSELECTIONW | |
507 #define BFFM_SETSELECTIONW (WM_USER + 103) | |
508 #endif | |
509 #ifndef BFFM_SETSTATUSTEXTA | |
510 #define BFFM_SETSTATUSTEXTA (WM_USER + 100) | |
511 #endif | |
512 #ifndef BFFM_SETSTATUSTEXTW | |
513 #define BFFM_SETSTATUSTEXTW (WM_USER + 104) | |
514 #endif | |
515 #ifndef SHARD_PATHA | |
516 #define SHARD_PATHA 2 | |
517 #endif | |
518 #ifndef SHARD_PATHW | |
519 #define SHARD_PATHW 3 | |
520 #endif | |
521 #ifndef SHCNF_PATHA | |
522 #define SHCNF_PATHA 1 | |
523 #endif | |
524 #ifndef SHCNF_PATHW | |
525 #define SHCNF_PATHW 5 | |
526 #endif | |
527 #ifndef SHCNF_PRINTERA | |
528 #define SHCNF_PRINTERA 2 | |
529 #endif | |
530 #ifndef SHCNF_PRINTERW | |
531 #define SHCNF_PRINTERW 6 | |
532 #endif | |
533 #ifndef BFFM_VALIDATEFAILED | |
534 #ifdef UNICODE | |
535 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW | |
536 #else | |
537 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA | |
538 #endif | |
819 | 539 #endif |
442 | 540 |
800 | 541 /* winnls.h defines */ |
819 | 542 #ifndef MAC_CHARSET |
543 #define MAC_CHARSET 77 | |
544 #endif | |
800 | 545 #ifndef LOCALE_RETURN_NUMBER |
819 | 546 #define LOCALE_RETURN_NUMBER 0x20000000 |
800 | 547 #endif |
548 | |
771 | 549 /* OEM resources */ |
550 #ifndef OCR_ICOCUR | |
551 #define OCR_ICOCUR 32647 | |
552 #define OIC_SAMPLE 32512 | |
553 #define OIC_HAND 32513 | |
554 #define OIC_QUES 32514 | |
555 #define OIC_BANG 32515 | |
556 #define OIC_NOTE 32516 | |
557 #define OIC_WINLOGO 32517 | |
558 #endif | |
559 | |
5716
1003acd5a4b8
Fix cygwin build on new win32api.
Vin Shelton <acs@xemacs.org>
parents:
5474
diff
changeset
|
560 #if W32API_INSTALLED_VER < W32API_VER(3,14) |
771 | 561 /* More Cygwin stupidity: Current w32api's winuser.h has IME message |
562 constants and they conflict with imm.h. (NOTE: Currently fixed, but | |
563 I'm sure the problems were present post 1.0.) */ | |
564 #undef WM_IME_STARTCOMPOSITION | |
565 #undef WM_IME_ENDCOMPOSITION | |
566 #undef WM_IME_COMPOSITION | |
567 #undef WM_IME_KEYLAST | |
568 #undef WM_IME_SETCONTEXT | |
569 #undef WM_IME_NOTIFY | |
570 #undef WM_IME_CONTROL | |
571 #undef WM_IME_COMPOSITIONFULL | |
572 #undef WM_IME_SELECT | |
573 #undef WM_IME_CHAR | |
574 #undef WM_IME_KEYDOWN | |
575 #undef WM_IME_KEYUP | |
5716
1003acd5a4b8
Fix cygwin build on new win32api.
Vin Shelton <acs@xemacs.org>
parents:
5474
diff
changeset
|
576 #endif |
771 | 577 |
578 #include <imm.h> | |
579 | |
1683 | 580 #if W32API_INSTALLED_VER < W32API_VER(2,4) |
771 | 581 typedef struct _SHQUERYRBINFO |
582 { | |
583 DWORD cbSize; | |
584 __int64 i64Size; | |
585 __int64 i64NumItems; | |
586 } SHQUERYRBINFO, *LPSHQUERYRBINFO; | |
1683 | 587 #endif |
771 | 588 |
589 typedef LPCDLGTEMPLATE LPCDLGTEMPLATEW; | |
590 typedef LPCDLGTEMPLATE LPCDLGTEMPLATEA; | |
591 | |
5716
1003acd5a4b8
Fix cygwin build on new win32api.
Vin Shelton <acs@xemacs.org>
parents:
5474
diff
changeset
|
592 #if W32API_VER(3,14) <= W32API_INSTALLED_VER |
1003acd5a4b8
Fix cygwin build on new win32api.
Vin Shelton <acs@xemacs.org>
parents:
5474
diff
changeset
|
593 typedef LPCVOID PCVOID; |
1003acd5a4b8
Fix cygwin build on new win32api.
Vin Shelton <acs@xemacs.org>
parents:
5474
diff
changeset
|
594 #endif |
1003acd5a4b8
Fix cygwin build on new win32api.
Vin Shelton <acs@xemacs.org>
parents:
5474
diff
changeset
|
595 |
1685 | 596 #else /* !CYGWIN_HEADERS */ |
4893
99f2102552d7
Add typedefs for PCVOID and PDWORD_PTR for non-Cygwin-headers folks.
Ben Wing <ben@xemacs.org>
parents:
4867
diff
changeset
|
597 |
1685 | 598 #define W32API_VER(major,minor) 0 |
599 #define W32API_INSTALLED_VER 0 | |
4893
99f2102552d7
Add typedefs for PCVOID and PDWORD_PTR for non-Cygwin-headers folks.
Ben Wing <ben@xemacs.org>
parents:
4867
diff
changeset
|
600 |
99f2102552d7
Add typedefs for PCVOID and PDWORD_PTR for non-Cygwin-headers folks.
Ben Wing <ben@xemacs.org>
parents:
4867
diff
changeset
|
601 /* Some types that show up in Cygwin headers but not in Visual Studio headers, |
99f2102552d7
Add typedefs for PCVOID and PDWORD_PTR for non-Cygwin-headers folks.
Ben Wing <ben@xemacs.org>
parents:
4867
diff
changeset
|
602 and cause problems if we used Cygwin headers to generate |
99f2102552d7
Add typedefs for PCVOID and PDWORD_PTR for non-Cygwin-headers folks.
Ben Wing <ben@xemacs.org>
parents:
4867
diff
changeset
|
603 intl-auto-encap-win32.[ch]. */ |
99f2102552d7
Add typedefs for PCVOID and PDWORD_PTR for non-Cygwin-headers folks.
Ben Wing <ben@xemacs.org>
parents:
4867
diff
changeset
|
604 typedef LPCVOID PCVOID; |
99f2102552d7
Add typedefs for PCVOID and PDWORD_PTR for non-Cygwin-headers folks.
Ben Wing <ben@xemacs.org>
parents:
4867
diff
changeset
|
605 |
5928 | 606 /* from Vin */ |
607 | |
608 typedef int WINBOOL; | |
609 /*typedef intptr_t LONG_PTR; | |
610 typedef uintptr_t ULONG_PTR; | |
611 typedef uintptr_t DWORD_PTR;*/ | |
612 | |
613 typedef ITEMIDLIST ITEMIDLIST_ABSOLUTE; | |
614 | |
5930
a0d9bfe304de
more 64-bit patches for VS, not sure of many of them
Henry Thompson <ht@markup.co.uk>
parents:
5928
diff
changeset
|
615 /*typedef ITEMIDLIST_ABSOLUTE *PIDLIST_ABSOLUTE; |
a0d9bfe304de
more 64-bit patches for VS, not sure of many of them
Henry Thompson <ht@markup.co.uk>
parents:
5928
diff
changeset
|
616 typedef const ITEMIDLIST_ABSOLUTE *PCIDLIST_ABSOLUTE; is this overkill? HST*/ |
5928 | 617 |
618 /* Defined in w32api/winuser.h */ | |
619 #define GCLP_MENUNAME (-8) | |
620 #define GCLP_HBRBACKGROUND (-10) | |
621 #define GCLP_HCURSOR (-12) | |
622 #define GCLP_HICON (-14) | |
623 #define GCLP_HMODULE (-16) | |
624 #define GCLP_WNDPROC (-24) | |
625 #define GCLP_HICONSM (-34) | |
626 #define GWLP_USERDATA (-21) | |
627 #define GWLP_WNDPROC (-4) | |
628 #define GWLP_HINSTANCE (-6) | |
629 #define GWLP_HWNDPARENT (-8) | |
630 #define GWLP_USERDATA (-21) | |
631 #define GWLP_ID (-12) | |
632 | |
633 #define DWL_MSGRESULT 0 | |
634 #define DWL_DLGPROC 4 | |
635 #define DWL_USER 8 | |
636 | |
637 #ifdef _WIN64 | |
638 | |
639 #undef DWL_MSGRESULT | |
640 #undef DWL_DLGPROC | |
641 #undef DWL_USER | |
642 #endif | |
643 | |
644 #define DWLP_MSGRESULT 0 | |
645 #define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT) | |
646 #define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC) | |
647 | |
648 | |
771 | 649 #endif /* CYGWIN_HEADERS */ |
650 | |
651 /* Not in VC 6 */ | |
652 #ifndef BIF_NEWDIALOGSTYLE | |
653 #define BIF_NEWDIALOGSTYLE 64 | |
654 #endif | |
442 | 655 |
4538 | 656 #if defined (CYGWIN) && (CYGWIN_VERSION_DLL_COMBINED < 190) |
442 | 657 |
658 /* All but wcscmp and wcslen left out of Cygwin headers -- but present | |
771 | 659 in /usr/include/mingw/string.h! */ |
442 | 660 wchar_t* wcscat (wchar_t*, const wchar_t*); |
661 wchar_t* wcschr (const wchar_t*, wchar_t); | |
662 int wcscoll (const wchar_t*, const wchar_t*); | |
663 wchar_t* wcscpy (wchar_t*, const wchar_t*); | |
771 | 664 wchar_t* wcsdup (const wchar_t*); |
442 | 665 size_t wcscspn (const wchar_t*, const wchar_t*); |
666 /* Note: No wcserror in CRTDLL. */ | |
667 wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t); | |
771 | 668 int wcsncmp (const wchar_t*, const wchar_t*, size_t); |
669 wchar_t* wcsncpy (wchar_t*, const wchar_t*, size_t); | |
670 wchar_t* wcspbrk (const wchar_t*, const wchar_t*); | |
671 wchar_t* wcsrchr (const wchar_t*, wchar_t); | |
672 size_t wcsspn (const wchar_t*, const wchar_t*); | |
673 wchar_t* wcsstr (const wchar_t*, const wchar_t*); | |
674 wchar_t* wcstok (wchar_t*, const wchar_t*); | |
675 size_t wcsxfrm (wchar_t*, const wchar_t*, size_t); | |
442 | 676 |
677 #endif /* CYGWIN */ | |
678 | |
771 | 679 /* ------------------------- Unicode encapsulation ------------------------- */ |
680 | |
2367 | 681 /* See intl-win32.c for more information about Unicode-encapsulation */ |
771 | 682 |
800 | 683 #define ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
684 | |
771 | 685 #include "intl-auto-encap-win32.h" |
686 | |
687 /* would be encapsulatable but for parsing problems */ | |
800 | 688 |
689 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
690 #undef DefWindowProc | |
691 #define DefWindowProc error use qxeDefWindowProc or DefWindowProcA/DefWindowProcW | |
692 #endif | |
771 | 693 LRESULT qxeDefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); |
800 | 694 |
695 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
696 #undef CallWindowProc | |
697 #define CallWindowProc error use qxeCallWindowProc or CallWindowProcA/CallWindowProcW | |
698 #endif | |
771 | 699 LRESULT qxeCallWindowProc (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, |
700 WPARAM wParam, LPARAM lParam); | |
800 | 701 |
702 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
703 #undef DefDlgProc | |
704 #define DefDlgProc error use qxeDefDlgProc or DefDlgProcA/DefDlgProcW | |
705 #endif | |
771 | 706 LRESULT qxeDefDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); |
800 | 707 |
708 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
709 #undef SetWindowsHook | |
710 #define SetWindowsHook error use qxeSetWindowsHook or SetWindowsHookA/SetWindowsHookW | |
711 #endif | |
771 | 712 HHOOK qxeSetWindowsHook (int nFilterType, HOOKPROC pfnFilterProc); |
800 | 713 |
714 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
715 #undef DefMDIChildProc | |
716 #define DefMDIChildProc error use qxeDefMDIChildProc or DefMDIChildProcA/DefMDIChildProcW | |
717 #endif | |
771 | 718 LRESULT qxeDefMDIChildProc (HWND hWnd, UINT uMsg, WPARAM wParam, |
719 LPARAM lParam); | |
720 | |
800 | 721 #undef GetEnvironmentStrings |
722 #undef GetEnvironmentStringsA | |
723 #define GetEnvironmentStringsA GetEnvironmentStrings | |
724 Extbyte * qxeGetEnvironmentStrings (void); | |
725 | |
771 | 726 /* would be encapsulatable but for Cygwin problems */ |
800 | 727 |
728 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
1111 | 729 #undef DdeCreateStringHandle |
730 #define DdeCreateStringHandle error use qxeDdeCreateStringHandle or DdeCreateStringHandleA/DdeCreateStringHandleW | |
731 #endif | |
732 HSZ qxeDdeCreateStringHandle (DWORD idInst, const Extbyte * psz, int iCodePage); | |
733 | |
734 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
800 | 735 #undef RegConnectRegistry |
736 #define RegConnectRegistry error use qxeRegConnectRegistry or RegConnectRegistryA/RegConnectRegistryW | |
737 #endif | |
771 | 738 LONG qxeRegConnectRegistry (const Extbyte * lpMachineName, HKEY hKey, PHKEY phkResult); |
800 | 739 |
740 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
741 #undef ExtractIconEx | |
742 #define ExtractIconEx error use qxeExtractIconEx or ExtractIconExA/ExtractIconExW | |
743 #endif | |
771 | 744 UINT qxeExtractIconEx (const Extbyte * lpszFile, int nIconIndex, HICON FAR * phiconLarge, HICON FAR * phiconSmall, UINT nIcons); |
800 | 745 |
746 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
747 #undef GetICMProfile | |
748 #define GetICMProfile error use qxeGetICMProfile or GetICMProfileA/GetICMProfileW | |
749 #endif | |
771 | 750 BOOL qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3); |
800 | 751 |
752 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
753 #undef UpdateICMRegKey | |
754 #define UpdateICMRegKey error use qxeUpdateICMRegKey or UpdateICMRegKeyA/UpdateICMRegKeyW | |
755 #endif | |
771 | 756 BOOL qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4); |
757 | |
2500 | 758 /* would be encapsulatable but for header changes in different versions of VC++ */ |
759 | |
760 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
761 #undef EnumResourceTypes | |
762 #define EnumResourceTypes error_use_qxeEnumResourceTypes_or_EnumResourceTypesA_and_EnumResourceTypesW | |
763 #endif | |
764 #if MSC_VERSION >= 1300 | |
765 BOOL qxeEnumResourceTypes (HMODULE hModule, ENUMRESTYPEPROCW lpEnumFunc, LONG lParam); | |
766 #else | |
767 BOOL qxeEnumResourceTypes (HMODULE hModule, ENUMRESTYPEPROC lpEnumFunc, LONG lParam); | |
768 #endif | |
769 | |
770 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
771 #undef EnumResourceNames | |
772 #define EnumResourceNames error_use_qxeEnumResourceNames_or_EnumResourceNamesA_and_EnumResourceNamesW | |
773 #endif | |
774 #if MSC_VERSION >= 1300 | |
775 BOOL qxeEnumResourceNames (HMODULE hModule, const Extbyte * lpType, ENUMRESNAMEPROCW lpEnumFunc, LONG lParam); | |
776 #else | |
777 BOOL qxeEnumResourceNames (HMODULE hModule, const Extbyte * lpType, ENUMRESNAMEPROC lpEnumFunc, LONG lParam); | |
778 #endif | |
779 | |
780 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
781 #undef EnumResourceLanguages | |
782 #define EnumResourceLanguages error_use_qxeEnumResourceLanguages_or_EnumResourceLanguagesA_and_EnumResourceLanguagesW | |
783 #endif | |
784 #if MSC_VERSION >= 1300 | |
785 BOOL qxeEnumResourceLanguages (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, ENUMRESLANGPROCW lpEnumFunc, LONG lParam); | |
786 #else | |
787 BOOL qxeEnumResourceLanguages (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, ENUMRESLANGPROC lpEnumFunc, LONG lParam); | |
788 #endif | |
789 | |
771 | 790 /* files */ |
800 | 791 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
792 #undef FindFirstFile | |
793 #define FindFirstFile error use qxeFindFirstFile or FindFirstFileA/FindFirstFileW | |
794 #endif | |
771 | 795 HANDLE qxeFindFirstFile (const Extbyte *lpFileName, |
796 WIN32_FIND_DATAW *lpFindFileData); | |
800 | 797 |
798 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
799 #undef FindNextFile | |
800 #define FindNextFile error use qxeFindNextFile or FindNextFileA/FindNextFileW | |
801 #endif | |
771 | 802 BOOL qxeFindNextFile (HANDLE hFindFile, WIN32_FIND_DATAW *lpFindFileData); |
803 | |
804 /* shell */ | |
800 | 805 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
806 #undef SHGetFileInfo | |
807 #define SHGetFileInfo error use qxeSHGetFileInfo or SHGetFileInfoA/SHGetFileInfoW | |
808 #endif | |
771 | 809 DWORD qxeSHGetFileInfo (const Extbyte *pszPath, DWORD dwFileAttributes, |
810 SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags); | |
800 | 811 |
812 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
813 #undef SHBrowseForFolder | |
814 #define SHBrowseForFolder error use qxeSHBrowseForFolder or SHBrowseForFolderA/SHBrowseForFolderW | |
815 #endif | |
771 | 816 LPITEMIDLIST qxeSHBrowseForFolder (LPBROWSEINFOW lpbi); |
800 | 817 |
818 /* Not Unicode-split */ | |
771 | 819 VOID qxeSHAddToRecentDocs (UINT uFlags, LPCVOID pv); |
800 | 820 |
821 /* Not Unicode-split */ | |
771 | 822 VOID qxeSHChangeNotify (LONG wEventId, UINT uFlags, LPCVOID dwItem1, |
823 LPCVOID dwItem2); | |
800 | 824 |
825 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
826 #undef SHGetDataFromIDList | |
827 #define SHGetDataFromIDList error use qxeSHGetDataFromIDList or SHGetDataFromIDListA/SHGetDataFromIDListW | |
828 #endif | |
771 | 829 HRESULT qxeSHGetDataFromIDList (IShellFolder *psf, LPCITEMIDLIST pidl, |
830 int nFormat, PVOID pv, int cb); | |
831 | |
832 /* devmode */ | |
800 | 833 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
834 #undef CreateDC | |
835 #define CreateDC error use qxeCreateDC or CreateDCA/CreateDCW | |
836 #endif | |
771 | 837 HDC qxeCreateDC (const Extbyte *lpszDriver, const Extbyte *lpszDevice, |
838 const Extbyte *lpszOutput, CONST DEVMODEW *lpInitData); | |
800 | 839 |
840 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
841 #undef ResetDC | |
842 #define ResetDC error use qxeResetDC or ResetDCA/ResetDCW | |
843 #endif | |
771 | 844 HDC qxeResetDC (HDC hdc, CONST DEVMODEW *lpInitData); |
800 | 845 |
846 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
847 #undef OpenPrinter | |
848 #define OpenPrinter error use qxeOpenPrinter or OpenPrinterA/OpenPrinterW | |
849 #endif | |
771 | 850 DWORD qxeOpenPrinter (Extbyte *pPrinterName, LPHANDLE phPrinter, |
851 LPPRINTER_DEFAULTSW pDefaultconst); | |
800 | 852 |
853 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
854 #undef DocumentProperties | |
855 #define DocumentProperties error use qxeDocumentProperties or DocumentPropertiesA/DocumentPropertiesW | |
856 #endif | |
771 | 857 LONG qxeDocumentProperties (HWND hWnd, HANDLE hPrinter, Extbyte *pDeviceName, |
858 DEVMODEW *pDevModeOutput, DEVMODEW *pDevModeInput, | |
859 DWORD fMode); | |
800 | 860 |
861 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
862 #undef PrintDlg | |
863 #define PrintDlg error use qxePrintDlg or PrintDlgA/PrintDlgW | |
864 #endif | |
771 | 865 BOOL qxePrintDlg (PRINTDLGW *lppd); |
800 | 866 |
867 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
868 #undef PageSetupDlg | |
869 #define PageSetupDlg error use qxePageSetupDlg or PageSetupDlgA/PageSetupDlgW | |
870 #endif | |
771 | 871 BOOL qxePageSetupDlg (PAGESETUPDLGW *lppd); |
872 | |
873 /* fonts */ | |
800 | 874 |
875 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
876 #undef EnumFontFamiliesEx | |
877 #define EnumFontFamiliesEx error use qxeEnumFontFamiliesEx or EnumFontFamiliesExA/EnumFontFamiliesExW | |
878 #endif | |
771 | 879 int qxeEnumFontFamiliesEx (HDC hdc, LOGFONTW *lpLogfont, |
880 FONTENUMPROCW lpEnumFontFamProc, LPARAM lParam, | |
881 DWORD dwFlags); | |
800 | 882 |
883 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
884 #undef CreateFontIndirect | |
885 #define CreateFontIndirect error use qxeCreateFontIndirect or CreateFontIndirectA/CreateFontIndirectW | |
886 #endif | |
771 | 887 HFONT qxeCreateFontIndirect (CONST LOGFONTW *lplf); |
800 | 888 |
2500 | 889 #if defined (HAVE_MS_WINDOWS) |
800 | 890 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
891 #undef ImmSetCompositionFont | |
892 #define ImmSetCompositionFont error use qxeImmSetCompositionFont or ImmSetCompositionFontA/ImmSetCompositionFontW | |
893 #endif | |
771 | 894 BOOL qxeImmSetCompositionFont (HIMC imc, LOGFONTW *lplf); |
2500 | 895 #endif /* defined (HAVE_MS_WINDOWS) */ |
800 | 896 |
2500 | 897 #if defined (HAVE_MS_WINDOWS) |
800 | 898 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
899 #undef ImmGetCompositionFont | |
900 #define ImmGetCompositionFont error use qxeImmGetCompositionFont or ImmGetCompositionFontA/ImmGetCompositionFontW | |
901 #endif | |
771 | 902 BOOL qxeImmGetCompositionFont (HIMC imc, LOGFONTW *lplf); |
2500 | 903 #endif /* defined (HAVE_MS_WINDOWS) */ |
904 | |
905 #if defined (HAVE_MS_WINDOWS) | |
906 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
907 #undef ImmSetCompositionString | |
908 #define ImmSetCompositionString error_use_qxeImmSetCompositionString_or_ImmSetCompositionStringA_and_ImmSetCompositionStringW | |
909 #endif | |
910 #if MSC_VERSION >= 1300 | |
911 BOOL qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPVOID lpComp, DWORD arg4, LPCVOID lpRead, DWORD arg6); | |
912 #else | |
913 BOOL qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPCVOID lpComp, DWORD arg4, LPCVOID lpRead, DWORD arg6); | |
914 #endif | |
915 #endif /* defined (HAVE_MS_WINDOWS) */ | |
800 | 916 |
917 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
918 #undef GetObject | |
919 #define GetObject error use qxeGetObject or GetObjectA/GetObjectW | |
920 #endif | |
771 | 921 int qxeGetObject (HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject); |
800 | 922 |
923 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
924 #undef GetTextMetrics | |
925 #define GetTextMetrics error use qxeGetTextMetrics or GetTextMetricsA/GetTextMetricsW | |
926 #endif | |
771 | 927 BOOL qxeGetTextMetrics (HDC hdc, LPTEXTMETRICW lptm); |
928 | |
929 /* COMMCTRL.H */ | |
800 | 930 |
931 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
932 #undef SendMessage | |
933 #define SendMessage error use qxeSendMessage or SendMessageA/SendMessageW | |
934 #endif | |
771 | 935 LRESULT qxeSendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); |
936 | |
937 /* windows */ | |
800 | 938 |
939 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
940 #undef RegisterClass | |
941 #define RegisterClass error use qxeRegisterClass or RegisterClassA/RegisterClassW | |
942 #endif | |
771 | 943 ATOM qxeRegisterClass (CONST WNDCLASSW * lpWndClass); |
800 | 944 |
945 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
946 #undef UnregisterClass | |
947 #define UnregisterClass error use qxeUnregisterClass or UnregisterClassA/UnregisterClassW | |
948 #endif | |
771 | 949 BOOL qxeUnregisterClass (const Extbyte * lpClassName, HINSTANCE hInstance); |
800 | 950 |
951 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
952 #undef RegisterClassEx | |
953 #define RegisterClassEx error use qxeRegisterClassEx or RegisterClassExA/RegisterClassExW | |
954 #endif | |
771 | 955 ATOM qxeRegisterClassEx (CONST WNDCLASSEXW * arg1); |
800 | 956 |
957 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
958 #undef CreateWindow | |
959 #define CreateWindow error use qxeCreateWindow or CreateWindowA/CreateWindowW | |
960 #endif | |
771 | 961 #define qxeCreateWindow(lpClassName, lpWindowName, dwStyle, x, y, \ |
962 nWidth, nHeight, hWndParent, hMenu, hInstance, \ | |
963 lpParam) \ | |
964 qxeCreateWindowEx (0L, lpClassName, lpWindowName, dwStyle, x, y, \ | |
965 nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) | |
966 | |
967 /* ------------------------- Unicode conversion ------------------------- */ | |
968 | |
969 /* Set early in command-line processing, when -nuni or | |
970 --no-unicode-lib-calls is seen. */ | |
971 extern int no_mswin_unicode_lib_calls; | |
2367 | 972 /* Set early, in init_win32_very_very_early(). */ |
771 | 973 extern int mswindows_windows9x_p; |
974 #define XEUNICODE_P (!mswindows_windows9x_p && !no_mswin_unicode_lib_calls) | |
975 | |
976 #define XELPTSTR LPWSTR | |
977 #define XELPCTSTR LPCWSTR | |
442 | 978 |
979 #define XETCHAR_SIZE (XEUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR)) | |
980 #define MAX_XETCHAR_SIZE sizeof (WCHAR) | |
981 #define XETEXT1(arg) (XEUNICODE_P ? ((char *) (L##arg)) : (arg)) | |
982 /* We need to do this indirection in case ARG is also a manifest constant. | |
983 I don't really understand why. --ben */ | |
984 #define XETEXT(arg) XETEXT1(arg) | |
985 #define XECOPY_TCHAR(ptr, ch) \ | |
986 (XEUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch))) | |
2421 | 987 #define qxetcslen(arg) \ |
771 | 988 (XEUNICODE_P ? wcslen ((wchar_t *) arg) : strlen (arg)) |
2421 | 989 #define qxetcsbytelen(arg) \ |
771 | 990 (XEUNICODE_P ? wcslen ((wchar_t *) arg) * XETCHAR_SIZE : strlen (arg)) |
2421 | 991 #define qxetcscmp(s1, s2) \ |
442 | 992 (XEUNICODE_P ? wcscmp ((wchar_t *) s1, (wchar_t *) s2) \ |
993 : strcmp (s1, s2)) | |
2421 | 994 #define qxetcscpy(s1, s2) \ |
442 | 995 (XEUNICODE_P ? (char *) wcscpy ((wchar_t *) s1, (wchar_t *) s2) \ |
996 : strcpy (s1, s2)) | |
2421 | 997 #define qxetcsncpy(s1, s2, n) \ |
771 | 998 (XEUNICODE_P ? (char *) wcsncpy ((wchar_t *) s1, (wchar_t *) s2, n) \ |
999 : strncpy (s1, s2, n)) | |
2421 | 1000 #define qxetcschr(s, ch) \ |
442 | 1001 (XEUNICODE_P ? (char *) wcschr ((wchar_t *) s, (WCHAR) ch) \ |
1002 : strchr (s, ch)) | |
2421 | 1003 #define qxetcsrchr(s, ch) \ |
442 | 1004 (XEUNICODE_P ? (char *) wcsrchr ((wchar_t *) s, (WCHAR) ch) \ |
1005 : strrchr (s, ch)) | |
2421 | 1006 #define qxetcsdup(s) \ |
771 | 1007 (XEUNICODE_P ? (char *) wcsdup ((wchar_t *) s) \ |
1008 : xstrdup (s)) | |
442 | 1009 |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1010 #define ITEXT_TO_TSTR(in) ITEXT_TO_EXTERNAL (in, Qmswindows_tstr) |
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1011 #define LISP_STRING_TO_TSTR(in) LISP_STRING_TO_EXTERNAL (in, Qmswindows_tstr) |
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1012 #define TSTR_TO_ITEXT(in) EXTERNAL_TO_ITEXT (in, Qmswindows_tstr) |
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1013 #define TSTR_TO_ITEXT_MALLOC(in) \ |
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1014 EXTERNAL_TO_ITEXT_MALLOC (in, Qmswindows_tstr) |
771 | 1015 |
1016 #define build_tstr_string(in) \ | |
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
4952
diff
changeset
|
1017 make_extstring (in, qxetcsbytelen ((Extbyte *) in), Qmswindows_tstr) |
771 | 1018 |
1019 #define MAX_ANSI_CHAR_LEN 1 | |
1020 #define MAX_UNICODE_CHAR_LEN 2 | |
1021 | |
1022 DECLARE_INLINE_HEADER (int ansi_char_to_text (int ch, Extbyte *t)) | |
1023 { | |
1024 ch &= 0xFF; | |
1025 t[0] = ch; | |
1026 return 1; | |
1027 } | |
1028 | |
1029 DECLARE_INLINE_HEADER (int unicode_char_to_text (int ch, Extbyte *t)) | |
1030 { | |
1031 t[0] = ch & 0xFF; | |
1032 t[1] = (ch >> 8) & 0xFF; | |
1033 return 2; | |
1034 } | |
442 | 1035 |
771 | 1036 Extbyte *convert_multibyte_to_unicode_malloc (const Extbyte *src, |
1037 Bytecount n, | |
1038 int cp, Bytecount *size_out); | |
2367 | 1039 Extbyte *convert_unicode_to_multibyte_malloc (const Extbyte *src, |
1040 Bytecount n, | |
1041 int cp, Bytecount *size_out); | |
867 | 1042 Ibyte *convert_multibyte_to_internal_malloc (const Extbyte *src, |
771 | 1043 Bytecount n, |
1044 int cp, Bytecount *size_out); | |
1045 void convert_multibyte_to_unicode_dynarr (const Extbyte *src, Bytecount n, | |
1046 int cp, unsigned_char_dynarr *dst); | |
2367 | 1047 void convert_unicode_to_multibyte_dynarr (const Extbyte *src, Bytecount n, |
1048 int cp, unsigned_char_dynarr *dst); | |
1049 | |
1050 Bytecount unicode_multibyte_convert_size (const char *srctext, const void *src, | |
1051 Bytecount src_size, int to_unicode, | |
1052 int cp); | |
1053 void *unicode_multibyte_convert_copy_data (const char *srctext, | |
1054 void *alloca_data); | |
1055 | |
1056 /* NOTE: If you make two invocations of the following functions in the same | |
1057 subexpression and use the exact same expression for the source in both | |
1058 cases, you will lose. In this unlikely case, you may get an abort, and | |
1059 need to rewrite the code. | |
1060 | |
1061 We need to use ALLOCA_FUNCALL_OK here, see NEW_DFC in text.h. | |
1062 */ | |
1063 | |
1064 #ifdef WEXTTEXT_IS_WIDE | |
1065 #define MULTIBYTE_TO_WEXTTEXT(str) \ | |
1066 ((Wexttext *) \ | |
1067 unicode_multibyte_convert_copy_data \ | |
1068 (#str, ALLOCA_FUNCALL_OK (unicode_multibyte_convert_size \ | |
1069 (#str, str, strlen (str) + 1, 1, CP_ACP)))) | |
1070 | |
1071 #define WEXTTEXT_TO_MULTIBYTE(str) \ | |
1072 ((Extbyte *) \ | |
1073 unicode_multibyte_convert_copy_data \ | |
1074 (#str, ALLOCA_FUNCALL_OK (unicode_multibyte_convert_size \ | |
1075 (#str, str, \ | |
1076 (wcslen (str) + 1) * sizeof (WCHAR), 0, \ | |
1077 CP_ACP)))) | |
1078 #else | |
1079 #define MULTIBYTE_TO_WEXTTEXT(str) ((Wexttext *) (str)) | |
1080 #define WEXTTEXT_TO_MULTIBYTE(str) ((Extbyte *) (str)) | |
1081 #endif | |
1082 | |
1083 /* #### mbstowcs() uses MB_ERR_INVALID_CHARS in addition to MB_PRECOMPOSED. | |
1084 Should we do this? But then we have to handle errors. | |
1085 #### Do we already check for invalid sequences in the coding system? */ | |
1086 #define MBTOWC_OPTIONS MB_PRECOMPOSED /* | MB_ERR_INVALID_CHARS */ | |
1087 /* The following options are what wcstombs() uses in the CRT. It uses | |
1088 NULL in place of "~". */ | |
1089 #define WCTOMB_OPTIONS WC_COMPOSITECHECK | WC_SEPCHARS | |
1090 #define WCTOMB_INVALID_STRING "~" | |
771 | 1091 |
1092 /* ------------------------- Other Mule stuff ------------------------- */ | |
1093 | |
1094 LCID mswindows_current_locale (void); | |
1095 int mswindows_locale_to_code_page (LCID lcid); | |
1096 int mswindows_locale_to_oem_code_page (LCID lcid); | |
1097 | |
1098 /* ------------------------- Filename conversion ------------------------- */ | |
1099 | |
1100 #ifdef CYGWIN | |
1743 | 1101 |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1102 /* We should just remove the Windows 9x support */ |
1743 | 1103 |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1104 #define CCP_POSIX_TO_WIN_T \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1105 (XEUNICODE_P ? CCP_POSIX_TO_WIN_W : CCP_POSIX_TO_WIN_A) |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1106 #define CCP_WIN_T_TO_POSIX \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1107 (XEUNICODE_P ? CCP_WIN_W_TO_POSIX : CCP_WIN_A_TO_POSIX) |
1743 | 1108 |
771 | 1109 #endif |
1110 | |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1111 #ifdef HAVE_CYGWIN_CONV_PATH |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1112 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1113 do { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1114 const Ibyte *lfftt = (path); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1115 const Extbyte **lffttout = (const Extbyte **) &(out); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1116 if (isalpha (lfftt[0]) && (IS_DEVICE_SEP (lfftt[1]))) \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1117 PATHNAME_CONVERT_OUT_TSTR (lfftt, *lffttout); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1118 else \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1119 { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1120 int lfftt_size; \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1121 Extbyte *lfftt_utf8_path; \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1122 Extbyte *lfftt_tstr_path; \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1123 \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1124 PATHNAME_CONVERT_OUT_UTF_8 (lfftt, lfftt_utf8_path); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1125 lfftt_size = cygwin_conv_path (CCP_POSIX_TO_WIN_T | CCP_RELATIVE, \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1126 lfftt_utf8_path, NULL, 0); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1127 lfftt_tstr_path = alloca_extbytes (lfftt_size); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1128 cygwin_conv_path (CCP_POSIX_TO_WIN_T | CCP_RELATIVE, \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1129 lfftt_utf8_path, lfftt_tstr_path, lfftt_size); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1130 *lffttout = lfftt_tstr_path; \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1131 } \ |
442 | 1132 } while (0) |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1133 #define TSTR_TO_LOCAL_FILE_FORMAT(path, out) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1134 do { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1135 const Extbyte *ttlff = (path); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1136 int ttlff_size; \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1137 Extbyte *ttlff_utf8_path; \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1138 \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1139 ttlff_size = cygwin_conv_path (CCP_WIN_T_TO_POSIX | CCP_RELATIVE, \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1140 ttlff, NULL, 0); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1141 ttlff_utf8_path = alloca_extbytes (ttlff_size); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1142 cygwin_conv_path (CCP_WIN_T_TO_POSIX | CCP_RELATIVE, \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1143 ttlff, ttlff_utf8_path, ttlff_size); \ |
4988
4cfb6aeb989d
fix compile problems on Windows native
Ben Wing <ben@xemacs.org>
parents:
4981
diff
changeset
|
1144 (out) = EXTERNAL_TO_ITEXT (ttlff_utf8_path, Qutf_8); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1145 } while (0) |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1146 #else /* not HAVE_CYGWIN_CONV_PATH */ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1147 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1148 do { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1149 const Ibyte *lfftt; \ |
4988
4cfb6aeb989d
fix compile problems on Windows native
Ben Wing <ben@xemacs.org>
parents:
4981
diff
changeset
|
1150 const Extbyte **lffttout = (const Extbyte **) &(out); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1151 \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1152 LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (path, lfftt); \ |
4988
4cfb6aeb989d
fix compile problems on Windows native
Ben Wing <ben@xemacs.org>
parents:
4981
diff
changeset
|
1153 PATHNAME_CONVERT_OUT_TSTR (lfftt, *lffttout); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1154 } while (0) |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1155 #define TSTR_TO_LOCAL_FILE_FORMAT(path, out) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1156 do { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1157 const Ibyte *ttlff; \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1158 \ |
4988
4cfb6aeb989d
fix compile problems on Windows native
Ben Wing <ben@xemacs.org>
parents:
4981
diff
changeset
|
1159 ttlff = TSTR_TO_ITEXT (path); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1160 INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT (ttlff, out); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1161 } while (0) |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1162 #endif /* (not) HAVE_CYGWIN_CONV_PATH */ |
442 | 1163 |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1164 #define LISP_LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1165 LOCAL_FILE_FORMAT_TO_TSTR (XSTRING_DATA (path), out) |
826 | 1166 /* Convert from local file format, as used in XEmacs, to valid win32 |
1167 filenames as can be given to Windows API routines. Under native XEmacs, | |
1168 this is a no-op, but under Cygwin, the local names look different -- | |
1169 Cygwin mount points, forward slashes, etc. Currently, under Cygwin, we | |
1170 actually allow local names to be of both formats, i.e. Cygwin or Win32 | |
1171 native. So we check to see if we have Win32 native already (a cheesy | |
1172 check, look for letter plus colon at beginning of name) and do nothing | |
1173 in that case. */ | |
1174 | |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1175 #ifdef HAVE_CYGWIN_CONV_PATH |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1176 /* When Cygwin uses UTF-8, we can't just manipulate internal-format data |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1177 with its routines because it will mangle the high bytes, so we need to |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1178 convert to UTF-8 first, then to Win32 TSTR format (i.e. UTF-16, on |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1179 Windows NT), then back to internal format. Routines that want external |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1180 format should avoid this by using LISP_LOCAL_FILE_FORMAT_TO_TSTR(). |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1181 Same thing applies going the other direction. */ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1182 #define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1183 do \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1184 { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1185 const Extbyte *lfftiwp; \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1186 \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1187 LOCAL_FILE_FORMAT_TO_TSTR (path, lfftiwp); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1188 (pathout) = TSTR_TO_ITEXT (lfftiwp); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1189 } \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1190 while (0) |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1191 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1192 do { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1193 const Extbyte *iwtlffp; \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1194 iwtlffp = ITEXT_TO_TSTR (path); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1195 TSTR_TO_LOCAL_FILE_FORMAT (iwtlffp, pathout); \ |
442 | 1196 } while (0) |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1197 #elif defined (CYGWIN) |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1198 #define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1199 do { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1200 /* NOTE: It is a bit evil that here and below we are passing \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1201 internal-format data to a function that (nominally) should work \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1202 with external-format data. But in point of fact, the Cygwin \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1203 conversion functions are *NOT* localized, and will fail if they \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1204 get 7-bit ISO2022-encoded data. We know that our internal format \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1205 is ASCII-compatible, and so these functions will work fine with \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1206 this data (maybe ... not when Cygwin uses UTF-8) */ \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1207 const Ibyte *lfftiwp = (path); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1208 if (isalpha (lfftiwp[0]) && (IS_DEVICE_SEP (lfftiwp[1]))) \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1209 (pathout) = lfftiwp; \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1210 else \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1211 { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1212 int lfftiw2 = \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1213 cygwin_posix_to_win32_path_list_buf_size ((char *) lfftiwp); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1214 (pathout) = alloca_ibytes (lfftiw2); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1215 cygwin_posix_to_win32_path_list ((char *) lfftiwp, (char *) pathout); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1216 } \ |
442 | 1217 } while (0) |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1218 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \ |
593 | 1219 do { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1220 const Ibyte *wtlff1 = (path); \ |
593 | 1221 int wtlff2 = \ |
1222 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \ | |
2367 | 1223 Ibyte *wtlff3 = alloca_ibytes (wtlff2); \ |
593 | 1224 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \ |
771 | 1225 (pathout) = wtlff3; \ |
442 | 1226 } while (0) |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1227 #else /* not defined (CYGWIN) */ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1228 #define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1229 do { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1230 (pathout) = (path); \ |
442 | 1231 } while (0) |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1232 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1233 do { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1234 (pathout) = (path); \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1235 } while (0) |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1236 #endif /* (not) defined (CYGWIN) */ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1237 |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1238 Lisp_Object tstr_to_local_file_format (Extbyte *pathout); |
442 | 1239 |
826 | 1240 /* Convert a local-format file name or URL in internal format into a Win32 |
1241 file name or URL in tstr format. */ | |
1242 | |
1243 #ifdef CYGWIN | |
1244 | |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1245 #define LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \ |
2526 | 1246 do \ |
1247 { \ | |
1248 Ibyte *lffmutt_fname1; \ | |
1249 Ibyte *lffmutt_pathint = XSTRING_DATA (lispstr); \ | |
1250 \ | |
1251 if ((lffmutt_fname1 = qxestrchr (lffmutt_pathint, ':')) != NULL \ | |
1252 && *++lffmutt_fname1 == '/' && *++lffmutt_fname1 == '/') \ | |
1253 { \ | |
1254 /* If URL style file, the innards may have Cygwin mount points and \ | |
1255 the like. so separate out the innards, process them, and put back \ | |
1256 together. */ \ | |
1257 if (qxestrncasecmp_ascii (lffmutt_pathint, "file://", 7) == 0) \ | |
1258 { \ | |
1259 Ibyte *lffmutt_path1, *lffmutt_path2; \ | |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1260 LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (lffmutt_pathint + 7, \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1261 lffmutt_path1); \ |
2526 | 1262 if (lffmutt_path1 == lffmutt_pathint + 7) /* Optimization */ \ |
1263 lffmutt_path2 = lffmutt_pathint; \ | |
1264 else \ | |
1265 { \ | |
867 | 1266 lffmutt_path2 = alloca_ibytes (7 + qxestrlen (lffmutt_path1) \ |
2526 | 1267 + 1); \ |
1268 qxestrncpy (lffmutt_path2, lffmutt_pathint, 7); \ | |
1269 qxestrcpy (lffmutt_path2 + 7, lffmutt_path1); \ | |
1270 } \ | |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1271 (pathout) = ITEXT_TO_TSTR (lffmutt_path2); \ |
2526 | 1272 } \ |
1273 else \ | |
1274 /* A straight URL, just convert */ \ | |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1275 (pathout) = LISP_STRING_TO_TSTR (lispstr); \ |
2526 | 1276 } \ |
1277 else \ | |
1278 /* Not URL-style, must be a straight filename. */ \ | |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1279 LISP_LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout); \ |
826 | 1280 } while (0) |
1281 | |
1282 #else /* not CYGWIN */ | |
1283 | |
1284 /* URL's (and everything else) are already in the right format */ | |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1285 #define LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1286 LISP_LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout) |
826 | 1287 |
1288 #endif /* not CYGWIN */ | |
1289 | |
1290 | |
867 | 1291 Ibyte *urlify_filename (Ibyte *filename); |
1292 Ibyte *mswindows_canonicalize_filename (Ibyte *name); | |
771 | 1293 #define MSWINDOWS_NORMALIZE_FILENAME(name) \ |
867 | 1294 IBYTE_STRING_TO_ALLOCA (mswindows_canonicalize_filename (name), name) |
771 | 1295 |
1296 /* ------------------- Functions needed dynamic binding ------------------- */ | |
1297 | |
1298 typedef BOOL (WINAPI *pfSwitchToThread_t) (VOID); | |
1299 | |
1300 typedef NET_API_STATUS (NET_API_FUNCTION *pfNetUserEnum_t) | |
1301 (LPCWSTR, DWORD, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, LPDWORD); | |
1302 typedef NET_API_STATUS (NET_API_FUNCTION *pfNetApiBufferFree_t) (LPVOID); | |
1303 | |
1304 extern pfSwitchToThread_t xSwitchToThread; | |
1305 | |
1306 extern pfNetUserEnum_t xNetUserEnum; | |
1307 extern pfNetApiBufferFree_t xNetApiBufferFree; | |
1308 | |
1309 /* --------- Useful routines for manipulating memory-mapped files -------- */ | |
1310 | |
1311 typedef struct file_data | |
1312 { | |
867 | 1313 const Ibyte *name; |
771 | 1314 unsigned long size; |
1315 HANDLE file; | |
1316 HANDLE file_mapping; | |
1317 void *file_base; | |
1318 } file_data; | |
1319 | |
1320 #define OFFSET_TO_RVA(var,section) \ | |
1321 (section->VirtualAddress + \ | |
1322 ((DWORD)(var) - section->PointerToRawData)) | |
1323 | |
1324 #define RVA_TO_OFFSET(var,section) \ | |
1325 (section->PointerToRawData + \ | |
1326 ((DWORD)(var) - section->VirtualAddress)) | |
442 | 1327 |
771 | 1328 #define RVA_TO_PTR(var,section,filedata) \ |
1329 ((void *)(RVA_TO_OFFSET(var,section) + \ | |
1330 (char *)(filedata).file_base)) | |
1331 | |
867 | 1332 int open_input_file (file_data *p_file, const Ibyte *name); |
1333 int open_output_file (file_data *p_file, const Ibyte *name, | |
771 | 1334 unsigned long size); |
1335 void close_file_data (file_data *p_file); | |
1336 | |
1337 /* ------------------------- Heap related stuff ------------------------- */ | |
1338 | |
1339 #ifdef WIN32_NATIVE | |
442 | 1340 |
771 | 1341 #define get_reserved_heap_size() reserved_heap_size |
1342 #define get_committed_heap_size() (get_data_end () - get_data_start ()) | |
1343 #define get_heap_start() get_data_start () | |
1344 #define get_heap_end() get_data_end () | |
1345 #define get_page_size() sysinfo_cache.dwPageSize | |
1346 #define get_allocation_unit() sysinfo_cache.dwAllocationGranularity | |
1347 #define get_processor_type() sysinfo_cache.dwProcessorType | |
1348 #define get_nt_major_version() nt_major_version | |
1349 #define get_nt_minor_version() nt_minor_version | |
1350 | |
814 | 1351 unsigned char *get_data_start (void); |
1352 unsigned char *get_data_end (void); | |
771 | 1353 extern unsigned long data_region_size; |
1354 extern unsigned long reserved_heap_size; | |
1355 extern SYSTEM_INFO sysinfo_cache; | |
1356 extern int nt_major_version; | |
1357 extern int nt_minor_version; | |
1358 | |
1359 /* To prevent zero-initialized variables from being placed into the bss | |
1360 section, use non-zero values to represent an uninitialized state. */ | |
1361 #define UNINIT_PTR ((unsigned char*) 0xF0A0F0A0) | |
1362 #define UNINIT_LONG (0xF0A0F0A0L) | |
1363 | |
1364 /* Recreate the heap created during dumping. */ | |
814 | 1365 void recreate_heap (Extbyte *executable_path); |
771 | 1366 |
1367 /* Round the heap to this size. */ | |
814 | 1368 void round_heap (unsigned long size); |
771 | 1369 |
1370 /* Load in the dumped .bss section. */ | |
814 | 1371 void read_in_bss (Extbyte *name); |
771 | 1372 |
1373 /* Map in the dumped heap. */ | |
814 | 1374 void map_in_heap (Extbyte *name); |
771 | 1375 |
1376 /* Cache system info, e.g., the NT page size. */ | |
814 | 1377 void cache_system_info (void); |
771 | 1378 |
1379 /* Round ADDRESS up to be aligned with ALIGN. */ | |
814 | 1380 unsigned char *round_to_next (unsigned char *address, |
1381 unsigned long align); | |
771 | 1382 #endif /* WIN32_NATIVE */ |
1383 | |
1384 /* ------------------------- Misc prototypes ------------------------- */ | |
1385 | |
1386 #ifdef WIN32_NATIVE | |
1387 DECLARE_INLINE_HEADER (int strcasecmp (const char *a, const char *b)) | |
1388 { | |
867 | 1389 return qxestrcasecmp ((const Ibyte *) a, (const Ibyte *) b); |
771 | 1390 } |
1391 #endif /* WIN32_NATIVE */ | |
442 | 1392 |
771 | 1393 /* in nt.c */ |
867 | 1394 int mswindows_access (const Ibyte *path, int mode); |
3025 | 1395 int mswindows_link (const Ibyte *old, const Ibyte *new_); |
867 | 1396 int mswindows_rename (const Ibyte *oldname, const Ibyte *newname); |
1397 int mswindows_unlink (const Ibyte *path); | |
1398 int mswindows_stat (const Ibyte *path, struct stat *buf); | |
771 | 1399 int mswindows_fstat (int desc, struct stat *buf); |
1400 time_t mswindows_convert_time (FILETIME ft); | |
1204 | 1401 int mswindows_is_executable (const Ibyte *filename); |
1402 void mswindows_executable_type (const Ibyte *filename, int *is_dos_app, | |
1403 int *is_cygnus_app); | |
867 | 1404 Ibyte *mswindows_getdcwd (int drivelet); |
771 | 1405 |
872 | 1406 /* in process-nt.c */ |
771 | 1407 extern int mswindows_compare_env (const void *strp1, const void *strp2); |
1408 | |
1409 /* in win32.c */ | |
814 | 1410 Extbyte *mswindows_get_module_file_name (void); |
4932 | 1411 void mswindows_output_last_error (const Ascbyte *frob); |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4932
diff
changeset
|
1412 DECLARE_DOESNT_RETURN (mswindows_report_process_error (const Ascbyte *reason, |
771 | 1413 Lisp_Object data, |
1414 int errnum)); | |
1415 Lisp_Object mswindows_lisp_error (int errnum); | |
2526 | 1416 Ibyte *mswindows_read_link (const Ibyte *fname); |
771 | 1417 |
872 | 1418 /* in intl-win32.c */ |
1419 extern Lisp_Object Qmswindows_tstr, Qmswindows_unicode; | |
1420 extern Lisp_Object Qmswindows_multibyte, Qmswindows_multibyte_to_unicode; | |
1421 | |
442 | 1422 #endif /* INCLUDED_syswindows_h_ */ |