comparison src/syswindows.h @ 771:943eaba38521

[xemacs-hg @ 2002-03-13 08:51:24 by ben] The big ben-mule-21-5 check-in! Various files were added and deleted. See CHANGES-ben-mule. There are still some test suite failures. No crashes, though. Many of the failures have to do with problems in the test suite itself rather than in the actual code. I'll be addressing these in the next day or so -- none of the test suite failures are at all critical. Meanwhile I'll be trying to address the biggest issues -- i.e. build or run failures, which will almost certainly happen on various platforms. All comments should be sent to ben@xemacs.org -- use a Cc: if necessary when sending to mailing lists. There will be pre- and post- tags, something like pre-ben-mule-21-5-merge-in, and post-ben-mule-21-5-merge-in.
author ben
date Wed, 13 Mar 2002 08:54:06 +0000
parents 685b588e92d8
children a5954632b187
comparison
equal deleted inserted replaced
770:336a418893b5 771:943eaba38521
1 /* Copyright (C) 2000 Free Software Foundation, Inc. 1 /* Copyright (C) 2000 Free Software Foundation, Inc.
2 Copyright (C) 2000, 2001 Ben Wing. 2 Copyright (C) 2000, 2001, 2002 Ben Wing.
3 3
4 This file is part of XEmacs. 4 This file is part of XEmacs.
5 5
6 XEmacs is free software; you can redistribute it and/or modify it 6 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the 7 under the terms of the GNU General Public License as published by the
20 20
21 /* Synched up with: Not in FSF. */ 21 /* Synched up with: Not in FSF. */
22 22
23 /* Authorship: 23 /* Authorship:
24 24
25 Current primary author: Ben Wing <ben@xemacs.org>
26
25 Created May 2000 by Andy Piper. 27 Created May 2000 by Andy Piper.
26 Windows-Mule stuff added by Ben Wing. 28 Windows-Mule stuff added by Ben Wing, 2000-2001.
29 September 2001 Ben Wing reorganized and included nt.h and ntheap.h into
30 this file; comments in those files say:
31 * Adapted for XEmacs by David Hobley <david@spook-le0.cia.com.au>
32 * Sync'ed with Emacs 19.34.6 by Marc Paquette <marcpa@cam.org>
33 (Note: Sync messages from Marc Paquette may indicate
34 incomplete synching, so beware.)
35 (in ntheap.h only) Geoff Voelker (voelker@cs.washington.edu) 7-29-94
36
27 */ 37 */
28 38
29 #ifndef INCLUDED_syswindows_h_ 39 #ifndef INCLUDED_syswindows_h_
30 #define INCLUDED_syswindows_h_ 40 #define INCLUDED_syswindows_h_
31 41
32 /* Note that there are currently FOUR different general 42 /* There are two different general Windows-related include files in src.
33 Windows-related include files in src!
34 43
35 Uses are approximately: 44 Uses are approximately:
36 45
37 syswindows.h: Mostly a wrapper around <windows.h>, including missing 46 syswindows.h: Wrapper around <windows.h>, including missing defines as
38 defines as necessary. Also includes stuff needed on both Cygwin and 47 necessary. Includes stuff needed on both Cygwin and native Windows,
39 native Windows, regardless of window system chosen. 48 regardless of window system chosen. Includes definitions needed for
49 Unicode conversion/encapsulation, and other Mule-related stuff, plus
50 various other prototypes and Windows-specific, but not GUI-specific,
51 stuff.
40 52
41 console-msw.h: Used on both Cygwin and native Windows, but only when 53 console-msw.h: Used on both Cygwin and native Windows, but only when
42 native window system (as opposed to X) chosen. 54 native window system (as opposed to X) chosen. Includes syswindows.h.
43
44 nt.h: [will be renamed to win32.h] Used only on native Windows, and
45 regardless of window system chosen -- but used on both purely native
46 Windows (s/windowsnt.h) and MinGW (s/mingw32.h).
47
48 ntheap.h: Used only on native Windows and only when standard dumping
49 mechanism (unexnt.c) used.
50
51 All of the last three files include the first.
52 */ 55 */
56
57 /* See s/windowsnt.h for a description of what exactly the various
58 constants such as WIN32_NATIVE, HAVE_MS_WINDOWS, CYGWIN, and MINGW
59 mean, and how they relate to each other. */
60
61 /* ------------------------- Basic includes ------------------------- */
53 62
54 #ifndef WIN32_LEAN_AND_MEAN 63 #ifndef WIN32_LEAN_AND_MEAN
55 #define WIN32_LEAN_AND_MEAN 64 #define WIN32_LEAN_AND_MEAN
56 #endif 65 #endif
57 66
58 #if defined (CYGWIN) || defined (MINGW) 67 #if defined (CYGWIN) || defined (MINGW)
68 # define CYGWIN_HEADERS
69 # ifndef _WIN32_IE
70 # define _WIN32_IE 0x0400
71 # endif
59 72
60 #ifdef __cplusplus 73 #ifdef __cplusplus
61 extern "C" { 74 extern "C" {
62 #endif 75 #endif
63 76
70 } 83 }
71 #endif 84 #endif
72 85
73 #endif 86 #endif
74 87
88 /* Defines for COM so it's usable in both C and C++. XECOMCALLn() calls a
89 method with the specified number of parameters. XECOMID() surrounds a
90 class or interface name when passed to CoCreateInstance, a
91 QueryInterface method, or the like. */
92 #ifdef __cplusplus
93 #define XECOMCALL0(cl, meth) ((cl)->meth ())
94 #define XECOMCALL1(cl, meth, a1) ((cl)->meth (a1))
95 #define XECOMCALL2(cl, meth, a1, a2) ((cl)->meth (a1, a2))
96 #define XECOMCALL3(cl, meth, a1, a2, a3) ((cl)->meth (a1, a2, a3))
97 #define XECOMCALL4(cl, meth, a1, a2, a3, a4) ((cl)->meth (a1, a2, a3, a4))
98 #define XECOMID(id) (id)
99 #else
100 #define XECOMCALL0(cl, meth) ((cl)->lpVtbl->meth (cl))
101 #define XECOMCALL1(cl, meth, a1) ((cl)->lpVtbl->meth (cl, a1))
102 #define XECOMCALL2(cl, meth, a1, a2) ((cl)->lpVtbl->meth (cl, a1, a2))
103 #define XECOMCALL3(cl, meth, a1, a2, a3) ((cl)->lpVtbl->meth (cl, a1, a2, a3))
104 #define XECOMCALL4(cl, meth, a1, a2, a3, a4) \
105 ((cl)->lpVtbl->meth (cl, a1, a2, a3, a4))
106 #define XECOMID(id) (&(id))
107 #endif
108
109 #define OEMRESOURCE /* Define OCR_ and friend constants */
75 #include <windows.h> 110 #include <windows.h>
76 111
77 #if defined (WIN32_LEAN_AND_MEAN) 112 #if defined (WIN32_LEAN_AND_MEAN)
78 # ifdef HAVE_X_WINDOWS 113 # ifdef HAVE_X_WINDOWS
79 /* Christ almighty. The problems you get when combining two large code bases, 114 /* Christ almighty. The problems you get when combining two large code bases,
93 #include <lmaccess.h> /* next three for NetUserEnum and friends */ 128 #include <lmaccess.h> /* next three for NetUserEnum and friends */
94 #include <lmapibuf.h> 129 #include <lmapibuf.h>
95 #include <lmerr.h> 130 #include <lmerr.h>
96 #include <lmcons.h> /* for UNLEN and possibly other constants */ 131 #include <lmcons.h> /* for UNLEN and possibly other constants */
97 132
98 /* mmsystem.h defines. */ 133 #include <cderr.h>
99 #ifndef SND_ASYNC 134 #include <commdlg.h>
100 #define SND_ASYNC 1 135
101 #endif 136 #ifdef NEED_MSWINDOWS_COMMCTRL
102 #ifndef SND_NODEFAULT 137 #include <commctrl.h>
103 #define SND_NODEFAULT 2 138 #endif
104 #endif 139 #ifdef NEED_MSWINDOWS_OBJBASE
105 #ifndef SND_MEMORY 140 #include <objbase.h>
106 #define SND_MEMORY 4 141 #endif
107 #endif 142 #ifdef NEED_MSWINDOWS_SHLOBJ
108 #ifndef SND_FILENAME 143 #include <shlobj.h>
109 #define SND_FILENAME 0x2000L 144 #endif
110 #endif 145
111 146 #include <zmouse.h> /* WHEEL_PAGESCROLL under Cygwin */
112 /* winspool.h defines. */ 147
113 #ifndef PHYSICALWIDTH 148 #include <wchar.h>
114 #define PHYSICALWIDTH 110 149
115 #endif 150 /* ------------------------- Cygwin header brokenness ---------------------- */
116 #ifndef PHYSICALHEIGHT 151
117 #define PHYSICALHEIGHT 111 152 #ifdef CYGWIN_HEADERS
118 #endif 153
119 #ifndef PHYSICALOFFSETX 154 /* Various brokennesses in various versions of Cygwin */
120 #define PHYSICALOFFSETX 112
121 #endif
122 #ifndef PHYSICALOFFSETY
123 #define PHYSICALOFFSETY 113
124 #endif
125
126 /* shlobj.h defines. */
127 #ifndef BIF_EDITBOX
128 #define BIF_EDITBOX 0x10
129 #endif
130 #ifndef BIF_VALIDATE
131 #define BIF_VALIDATE 0x20
132 #endif
133 #ifndef BFFM_VALIDATEFAILED
134 #define BFFM_VALIDATEFAILED 3
135 #endif
136 155
137 /* windows.h defines. */ 156 /* windows.h defines. */
138 #if defined (CYGWIN) && (CYGWIN_VERSION_DLL_MAJOR < 20)
139 typedef NMHDR *LPNMHDR;
140 #endif
141
142 #ifndef SPI_GETWHEELSCROLLLINES 157 #ifndef SPI_GETWHEELSCROLLLINES
143 #define SPI_GETWHEELSCROLLLINES 104 158 #define SPI_GETWHEELSCROLLLINES 104
144 #endif 159 #endif
145 #ifndef WHEEL_PAGESCROLL 160
146 #define WHEEL_PAGESCROLL (UINT_MAX) 161 /* commctrl.h defines. */
147 #endif 162 #ifndef TB_SETIMAGELIST
148 #ifndef WHEEL_DELTA 163 #define TB_SETIMAGELIST (WM_USER + 48)
149 #define WHEEL_DELTA 120 164 #endif
150 #endif 165 #ifndef TB_GETIMAGELIST
151 #ifndef WM_MOUSEWHEEL 166 #define TB_GETIMAGELIST (WM_USER + 49)
152 #define WM_MOUSEWHEEL 0x20A 167 #endif
153 #endif 168 #ifndef TB_SETDISABLEDIMAGELIST
154 #ifndef VK_APPS 169 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
155 #define VK_APPS 0x5D 170 #endif
156 #endif 171 #ifndef TB_GETDISABLEDIMAGELIST
157 #ifndef SIF_TRACKPOS 172 #define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
158 #define SIF_TRACKPOS 0x0010 173 #endif
159 #endif 174 #ifndef TB_SETPADDING
160 #ifndef FW_BLACK 175 #define TB_SETPADDING (WM_USER + 87)
161 #define FW_BLACK FW_HEAVY 176 #endif
162 #endif 177 #ifndef TB_GETBUTTONINFOA
163 #ifndef FW_ULTRABOLD 178 #define TB_GETBUTTONINFOA (WM_USER + 65)
164 #define FW_ULTRABOLD FW_EXTRABOLD 179 #endif
165 #endif 180 #ifndef TB_GETBUTTONINFOW
166 #ifndef FW_DEMIBOLD 181 #define TB_GETBUTTONINFOW (WM_USER + 63)
167 #define FW_DEMIBOLD FW_SEMIBOLD 182 #endif
168 #endif 183 #ifndef TB_SETBUTTONINFOA
169 #ifndef FW_ULTRALIGHT 184 #define TB_SETBUTTONINFOA (WM_USER + 66)
170 #define FW_ULTRALIGHT FW_EXTRALIGHT 185 #endif
171 #endif 186 #ifndef TB_SETBUTTONINFOW
172 #ifndef APPCMD_FILTERINITS 187 #define TB_SETBUTTONINFOW (WM_USER + 64)
173 #define APPCMD_FILTERINITS 0x20L 188 #endif
174 #endif 189 #ifndef TB_INSERTBUTTONA
175 #ifndef CBF_FAIL_SELFCONNECTIONS 190 #define TB_INSERTBUTTONA (WM_USER + 21)
176 #define CBF_FAIL_SELFCONNECTIONS 0x1000 191 #endif
177 #endif 192 #ifndef TB_INSERTBUTTONW
178 #ifndef CBF_SKIP_ALLNOTIFICATIONS 193 #define TB_INSERTBUTTONW (WM_USER + 67)
179 #define CBF_SKIP_ALLNOTIFICATIONS 0x3C0000 194 #endif
180 #endif 195 #ifndef TB_ADDBUTTONSA
181 #ifndef CBF_FAIL_ADVISES 196 #define TB_ADDBUTTONSA (WM_USER + 20)
182 #define CBF_FAIL_ADVISES 0x4000 197 #endif
183 #endif 198 #ifndef TB_ADDBUTTONSW
184 #ifndef CBF_FAIL_POKES 199 #define TB_ADDBUTTONSW (WM_USER + 68)
185 #define CBF_FAIL_POKES 0x10000 200 #endif
186 #endif 201 #ifndef LVM_SETBKIMAGEA
187 #ifndef CBF_FAIL_REQUESTS 202 #define LVM_SETBKIMAGEA (LVM_FIRST + 68)
188 #define CBF_FAIL_REQUESTS 0x20000 203 #endif
189 #endif 204 #ifndef LVM_SETBKIMAGEW
190 #ifndef SZDDESYS_TOPIC 205 #define LVM_SETBKIMAGEW (LVM_FIRST + 138)
191 #define SZDDESYS_TOPIC "System" 206 #endif
192 #endif 207 #ifndef LVM_GETBKIMAGEA
193 #ifndef JOHAB_CHARSET 208 #define LVM_GETBKIMAGEA (LVM_FIRST + 69)
194 #define JOHAB_CHARSET 130 209 #endif
195 #endif 210 #ifndef LVM_GETBKIMAGEW
196 #ifndef MAC_CHARSET 211 #define LVM_GETBKIMAGEW (LVM_FIRST + 139)
197 #define MAC_CHARSET 77 212 #endif
198 #endif 213 #ifndef WC_COMBOBOXEXW
199 214 #define WC_COMBOBOXEXW L"ComboBoxEx32"
200 /***************************************************************/ 215 #endif
201 216 #ifndef CBEM_INSERTITEMA
202 /* Definitions for Mule under MS Windows */ 217 #define CBEM_INSERTITEMA (WM_USER + 1)
203 218 #endif
204 #include <wchar.h> 219 #ifndef CBEM_INSERTITEMW
220 #define CBEM_INSERTITEMW (WM_USER + 11)
221 #endif
222 #ifndef CBEM_SETITEMA
223 #define CBEM_SETITEMA (WM_USER + 5)
224 #endif
225 #ifndef CBEM_SETITEMW
226 #define CBEM_SETITEMW (WM_USER + 12)
227 #endif
228 #ifndef CBEM_GETITEMA
229 #define CBEM_GETITEMA (WM_USER + 4)
230 #endif
231 #ifndef CBEM_GETITEMW
232 #define CBEM_GETITEMW (WM_USER + 13)
233 #endif
234 #ifndef HDN_GETDISPINFOA
235 #define HDN_GETDISPINFOA (HDN_FIRST - 9)
236 #endif
237 #ifndef HDN_GETDISPINFOW
238 #define HDN_GETDISPINFOW (HDN_FIRST - 29)
239 #endif
240 #ifndef TBN_GETDISPINFOA
241 #define TBN_GETDISPINFOA (TBN_FIRST - 16)
242 #endif
243 #ifndef TBN_GETDISPINFOW
244 #define TBN_GETDISPINFOW (TBN_FIRST - 17)
245 #endif
246 #ifndef TBN_GETINFOTIPA
247 #define TBN_GETINFOTIPA (TBN_FIRST - 18)
248 #endif
249 #ifndef TBN_GETINFOTIPW
250 #define TBN_GETINFOTIPW (TBN_FIRST - 19)
251 #endif
252 #ifndef TTN_GETDISPINFOA
253 #define TTN_GETDISPINFOA (TTN_FIRST - 0)
254 #endif
255 #ifndef TTN_GETDISPINFOW
256 #define TTN_GETDISPINFOW (TTN_FIRST - 10)
257 #endif
258
259 #if (_WIN32_IE >= 0x0400)
260
261 #ifndef LVN_GETINFOTIPA
262 #define LVN_GETINFOTIPA (LVN_FIRST - 57)
263 #endif
264 #ifndef LVN_GETINFOTIPW
265 #define LVN_GETINFOTIPW (LVN_FIRST - 58)
266 #endif
267 #ifndef TVN_GETINFOTIPA
268 #define TVN_GETINFOTIPA (TVN_FIRST - 13)
269 #endif
270 #ifndef TVN_GETINFOTIPW
271 #define TVN_GETINFOTIPW (TVN_FIRST - 14)
272 #endif
273 #ifndef CBEN_GETDISPINFOA
274 #define CBEN_GETDISPINFOA (CBEN_FIRST - 0)
275 #endif
276 #ifndef CBEN_GETDISPINFOW
277 #define CBEN_GETDISPINFOW (CBEN_FIRST - 7)
278 #endif
279 #ifndef CBEN_DRAGBEGINA
280 #define CBEN_DRAGBEGINA (CBEN_FIRST - 8)
281 #endif
282 #ifndef CBEN_DRAGBEGINW
283 #define CBEN_DRAGBEGINW (CBEN_FIRST - 9)
284 #endif
285
286 #endif /* (_WIN32_IE >= 0x0400) */
287
288 #ifndef CBEN_ENDEDITA
289 #define CBEN_ENDEDITA (CBEN_FIRST - 5)
290 #endif
291 #ifndef CBEN_ENDEDITW
292 #define CBEN_ENDEDITW (CBEN_FIRST - 6)
293 #endif
294
295 #ifndef CBEMAXSTRLEN
296 #define CBEMAXSTRLEN 260
297 #endif
298
299 typedef struct {
300 NMHDR hdr;
301 BOOL fChanged;
302 int iNewSelection;
303 WCHAR szText[CBEMAXSTRLEN];
304 int iWhy;
305 } NMCBEENDEDITW, *LPNMCBEENDEDITW, *PNMCBEENDEDITW;
306
307 typedef struct {
308 NMHDR hdr;
309 BOOL fChanged;
310 int iNewSelection;
311 char szText[CBEMAXSTRLEN];
312 int iWhy;
313 } NMCBEENDEDITA, *LPNMCBEENDEDITA,*PNMCBEENDEDITA;
314
315 #if (_WIN32_IE >= 0x0400)
316
317 typedef struct {
318 NMHDR hdr;
319 int iItemid;
320 WCHAR szText[CBEMAXSTRLEN];
321 }NMCBEDRAGBEGINW, *LPNMCBEDRAGBEGINW, *PNMCBEDRAGBEGINW;
322
323 typedef struct {
324 NMHDR hdr;
325 int iItemid;
326 char szText[CBEMAXSTRLEN];
327 }NMCBEDRAGBEGINA, *LPNMCBEDRAGBEGINA, *PNMCBEDRAGBEGINA;
328 typedef struct tagNMDATETIMEFORMATA
329 {
330 NMHDR nmhdr;
331 LPCSTR pszFormat;
332 SYSTEMTIME st;
333 LPCSTR pszDisplay;
334 CHAR szDisplay[64];
335 } NMDATETIMEFORMATA, FAR * LPNMDATETIMEFORMATA;
336
337 typedef struct tagNMDATETIMEFORMATW
338 {
339 NMHDR nmhdr;
340 LPCWSTR pszFormat;
341 SYSTEMTIME st;
342 LPCWSTR pszDisplay;
343 WCHAR szDisplay[64];
344 } NMDATETIMEFORMATW, FAR * LPNMDATETIMEFORMATW;
345
346 typedef struct tagNMTTDISPIFNOA {
347 NMHDR hdr;
348 LPSTR lpszText;
349 char szText[80];
350 HINSTANCE hinst;
351 UINT uFlags;
352 #if (_WIN32_IE >= 0x0300)
353 LPARAM lParam;
354 #endif
355 } NMTTDISPINFOA, FAR *LPNMTTDISPINFOA;
356
357 typedef struct tagNMTTDISPINFOW {
358 NMHDR hdr;
359 LPWSTR lpszText;
360 WCHAR szText[80];
361 HINSTANCE hinst;
362 UINT uFlags;
363 #if (_WIN32_IE >= 0x0300)
364 LPARAM lParam;
365 #endif
366 } NMTTDISPINFOW, FAR *LPNMTTDISPINFOW;
367
368 #endif /* (_WIN32_IE >= 0x0400) */
369
370 /* shlobj.h defines */
371 #ifndef BFFM_VALIDATEFAILEDA
372 #define BFFM_VALIDATEFAILEDA 3
373 #endif
374 #ifndef BFFM_VALIDATEFAILEDW
375 #define BFFM_VALIDATEFAILEDW 4
376 #endif
377 #ifndef BFFM_SETSELECTIONA
378 #define BFFM_SETSELECTIONA (WM_USER + 102)
379 #endif
380 #ifndef BFFM_SETSELECTIONW
381 #define BFFM_SETSELECTIONW (WM_USER + 103)
382 #endif
383 #ifndef BFFM_SETSTATUSTEXTA
384 #define BFFM_SETSTATUSTEXTA (WM_USER + 100)
385 #endif
386 #ifndef BFFM_SETSTATUSTEXTW
387 #define BFFM_SETSTATUSTEXTW (WM_USER + 104)
388 #endif
389 #ifndef SHARD_PATHA
390 #define SHARD_PATHA 2
391 #endif
392 #ifndef SHARD_PATHW
393 #define SHARD_PATHW 3
394 #endif
395 #ifndef SHCNF_PATHA
396 #define SHCNF_PATHA 1
397 #endif
398 #ifndef SHCNF_PATHW
399 #define SHCNF_PATHW 5
400 #endif
401 #ifndef SHCNF_PRINTERA
402 #define SHCNF_PRINTERA 2
403 #endif
404 #ifndef SHCNF_PRINTERW
405 #define SHCNF_PRINTERW 6
406 #endif
407 #ifndef BFFM_VALIDATEFAILED
408 #ifdef UNICODE
409 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
410 #else
411 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
412 #endif
413 #endif /* not BFFM_VALIDATEFAILED */
414
415 /* OEM resources */
416 #ifndef OCR_ICOCUR
417 #define OCR_ICOCUR 32647
418 #define OIC_SAMPLE 32512
419 #define OIC_HAND 32513
420 #define OIC_QUES 32514
421 #define OIC_BANG 32515
422 #define OIC_NOTE 32516
423 #define OIC_WINLOGO 32517
424 #endif
425
426 /* More Cygwin stupidity: Current w32api's winuser.h has IME message
427 constants and they conflict with imm.h. (NOTE: Currently fixed, but
428 I'm sure the problems were present post 1.0.) */
429 #undef WM_IME_STARTCOMPOSITION
430 #undef WM_IME_ENDCOMPOSITION
431 #undef WM_IME_COMPOSITION
432 #undef WM_IME_KEYLAST
433 #undef WM_IME_SETCONTEXT
434 #undef WM_IME_NOTIFY
435 #undef WM_IME_CONTROL
436 #undef WM_IME_COMPOSITIONFULL
437 #undef WM_IME_SELECT
438 #undef WM_IME_CHAR
439 #undef WM_IME_KEYDOWN
440 #undef WM_IME_KEYUP
441
442 #include <imm.h>
443
444 typedef struct _SHQUERYRBINFO
445 {
446 DWORD cbSize;
447 __int64 i64Size;
448 __int64 i64NumItems;
449 } SHQUERYRBINFO, *LPSHQUERYRBINFO;
450
451 typedef LPCDLGTEMPLATE LPCDLGTEMPLATEW;
452 typedef LPCDLGTEMPLATE LPCDLGTEMPLATEA;
453
454 #endif /* CYGWIN_HEADERS */
455
456 /* Not in VC 6 */
457 #ifndef BIF_NEWDIALOGSTYLE
458 #define BIF_NEWDIALOGSTYLE 64
459 #endif
205 460
206 #ifdef CYGWIN 461 #ifdef CYGWIN
207 462
208 /* All but wcscmp and wcslen left out of Cygwin headers -- but present 463 /* All but wcscmp and wcslen left out of Cygwin headers -- but present
209 in /usr/include/mingw32/string.h! */ 464 in /usr/include/mingw/string.h! */
210 wchar_t* wcscat (wchar_t*, const wchar_t*); 465 wchar_t* wcscat (wchar_t*, const wchar_t*);
211 wchar_t* wcschr (const wchar_t*, wchar_t); 466 wchar_t* wcschr (const wchar_t*, wchar_t);
212 int wcscoll (const wchar_t*, const wchar_t*); 467 int wcscoll (const wchar_t*, const wchar_t*);
213 wchar_t* wcscpy (wchar_t*, const wchar_t*); 468 wchar_t* wcscpy (wchar_t*, const wchar_t*);
469 wchar_t* wcsdup (const wchar_t*);
214 size_t wcscspn (const wchar_t*, const wchar_t*); 470 size_t wcscspn (const wchar_t*, const wchar_t*);
215 /* Note: No wcserror in CRTDLL. */ 471 /* Note: No wcserror in CRTDLL. */
216 wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t); 472 wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
217 int wcsncmp(const wchar_t*, const wchar_t*, size_t); 473 int wcsncmp (const wchar_t*, const wchar_t*, size_t);
218 wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t); 474 wchar_t* wcsncpy (wchar_t*, const wchar_t*, size_t);
219 wchar_t* wcspbrk(const wchar_t*, const wchar_t*); 475 wchar_t* wcspbrk (const wchar_t*, const wchar_t*);
220 wchar_t* wcsrchr(const wchar_t*, wchar_t); 476 wchar_t* wcsrchr (const wchar_t*, wchar_t);
221 size_t wcsspn(const wchar_t*, const wchar_t*); 477 size_t wcsspn (const wchar_t*, const wchar_t*);
222 wchar_t* wcsstr(const wchar_t*, const wchar_t*); 478 wchar_t* wcsstr (const wchar_t*, const wchar_t*);
223 wchar_t* wcstok(wchar_t*, const wchar_t*); 479 wchar_t* wcstok (wchar_t*, const wchar_t*);
224 size_t wcsxfrm(wchar_t*, const wchar_t*, size_t); 480 size_t wcsxfrm (wchar_t*, const wchar_t*, size_t);
225 481
226 #endif /* CYGWIN */ 482 #endif /* CYGWIN */
227 483
228 // extern int mswindows_windows9x_p; 484 /* ------------------------- Unicode encapsulation ------------------------- */
229 /* #define XEUNICODE_P (!mswindows_windows9x_p) */ 485
230 #define XEUNICODE_P 0 486 /* See intl-encap-win32.c for more information about Unicode-encapsulation */
487
488 #include "intl-auto-encap-win32.h"
489
490 /* would be encapsulatable but for parsing problems */
491 LRESULT qxeDefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
492 LRESULT qxeCallWindowProc (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg,
493 WPARAM wParam, LPARAM lParam);
494 LRESULT qxeDefDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
495 HHOOK qxeSetWindowsHook (int nFilterType, HOOKPROC pfnFilterProc);
496 LRESULT qxeDefMDIChildProc (HWND hWnd, UINT uMsg, WPARAM wParam,
497 LPARAM lParam);
498
499 /* would be encapsulatable but for Cygwin problems */
500 LONG qxeRegConnectRegistry (const Extbyte * lpMachineName, HKEY hKey, PHKEY phkResult);
501 UINT qxeExtractIconEx (const Extbyte * lpszFile, int nIconIndex, HICON FAR * phiconLarge, HICON FAR * phiconSmall, UINT nIcons);
502 BOOL qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3);
503 BOOL qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4);
504
505 /* files */
506 HANDLE qxeFindFirstFile (const Extbyte *lpFileName,
507 WIN32_FIND_DATAW *lpFindFileData);
508 BOOL qxeFindNextFile (HANDLE hFindFile, WIN32_FIND_DATAW *lpFindFileData);
509
510 /* shell */
511 DWORD qxeSHGetFileInfo (const Extbyte *pszPath, DWORD dwFileAttributes,
512 SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags);
513 LPITEMIDLIST qxeSHBrowseForFolder (LPBROWSEINFOW lpbi);
514 VOID qxeSHAddToRecentDocs (UINT uFlags, LPCVOID pv);
515 VOID qxeSHChangeNotify (LONG wEventId, UINT uFlags, LPCVOID dwItem1,
516 LPCVOID dwItem2);
517 HRESULT qxeSHGetDataFromIDList (IShellFolder *psf, LPCITEMIDLIST pidl,
518 int nFormat, PVOID pv, int cb);
519
520 /* devmode */
521 HDC qxeCreateDC (const Extbyte *lpszDriver, const Extbyte *lpszDevice,
522 const Extbyte *lpszOutput, CONST DEVMODEW *lpInitData);
523 HDC qxeResetDC (HDC hdc, CONST DEVMODEW *lpInitData);
524 DWORD qxeOpenPrinter (Extbyte *pPrinterName, LPHANDLE phPrinter,
525 LPPRINTER_DEFAULTSW pDefaultconst);
526 LONG qxeDocumentProperties (HWND hWnd, HANDLE hPrinter, Extbyte *pDeviceName,
527 DEVMODEW *pDevModeOutput, DEVMODEW *pDevModeInput,
528 DWORD fMode);
529 BOOL qxePrintDlg (PRINTDLGW *lppd);
530 BOOL qxePageSetupDlg (PAGESETUPDLGW *lppd);
531
532 /* fonts */
533 int qxeEnumFontFamiliesEx (HDC hdc, LOGFONTW *lpLogfont,
534 FONTENUMPROCW lpEnumFontFamProc, LPARAM lParam,
535 DWORD dwFlags);
536 HFONT qxeCreateFontIndirect (CONST LOGFONTW *lplf);
537 BOOL qxeImmSetCompositionFont (HIMC imc, LOGFONTW *lplf);
538 BOOL qxeImmGetCompositionFont (HIMC imc, LOGFONTW *lplf);
539 int qxeGetObject (HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject);
540 BOOL qxeGetTextMetrics (HDC hdc, LPTEXTMETRICW lptm);
541
542 /* COMMCTRL.H */
543 LRESULT qxeSendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
544
545 /* windows */
546 ATOM qxeRegisterClass (CONST WNDCLASSW * lpWndClass);
547 BOOL qxeUnregisterClass (const Extbyte * lpClassName, HINSTANCE hInstance);
548 ATOM qxeRegisterClassEx (CONST WNDCLASSEXW * arg1);
549 #define qxeCreateWindow(lpClassName, lpWindowName, dwStyle, x, y, \
550 nWidth, nHeight, hWndParent, hMenu, hInstance, \
551 lpParam) \
552 qxeCreateWindowEx (0L, lpClassName, lpWindowName, dwStyle, x, y, \
553 nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
554
555 /* ------------------------- Unicode conversion ------------------------- */
556
557 /* Set early in command-line processing, when -nuni or
558 --no-unicode-lib-calls is seen. */
559 extern int no_mswin_unicode_lib_calls;
560 /* Set early, in init_win32_very_early(). */
561 extern int mswindows_windows9x_p;
562 #define XEUNICODE_P (!mswindows_windows9x_p && !no_mswin_unicode_lib_calls)
563
564 #define XELPTSTR LPWSTR
565 #define XELPCTSTR LPCWSTR
231 566
232 #define XETCHAR_SIZE (XEUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR)) 567 #define XETCHAR_SIZE (XEUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR))
233 #define MAX_XETCHAR_SIZE sizeof (WCHAR) 568 #define MAX_XETCHAR_SIZE sizeof (WCHAR)
234 #define XETEXT1(arg) (XEUNICODE_P ? ((char *) (L##arg)) : (arg)) 569 #define XETEXT1(arg) (XEUNICODE_P ? ((char *) (L##arg)) : (arg))
235 /* We need to do this indirection in case ARG is also a manifest constant. 570 /* We need to do this indirection in case ARG is also a manifest constant.
236 I don't really understand why. --ben */ 571 I don't really understand why. --ben */
237 #define XETEXT(arg) XETEXT1(arg) 572 #define XETEXT(arg) XETEXT1(arg)
238 #define XECOPY_TCHAR(ptr, ch) \ 573 #define XECOPY_TCHAR(ptr, ch) \
239 (XEUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch))) 574 (XEUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch)))
240 #define xetcslen(arg) (XEUNICODE_P ? wcslen ((wchar_t *) arg) : strlen (arg)) 575 #define xetcslen(arg) \
576 (XEUNICODE_P ? wcslen ((wchar_t *) arg) : strlen (arg))
577 #define xetcsbytelen(arg) \
578 (XEUNICODE_P ? wcslen ((wchar_t *) arg) * XETCHAR_SIZE : strlen (arg))
241 #define xetcscmp(s1, s2) \ 579 #define xetcscmp(s1, s2) \
242 (XEUNICODE_P ? wcscmp ((wchar_t *) s1, (wchar_t *) s2) \ 580 (XEUNICODE_P ? wcscmp ((wchar_t *) s1, (wchar_t *) s2) \
243 : strcmp (s1, s2)) 581 : strcmp (s1, s2))
244 #define xetcscpy(s1, s2) \ 582 #define xetcscpy(s1, s2) \
245 (XEUNICODE_P ? (char *) wcscpy ((wchar_t *) s1, (wchar_t *) s2) \ 583 (XEUNICODE_P ? (char *) wcscpy ((wchar_t *) s1, (wchar_t *) s2) \
246 : strcpy (s1, s2)) 584 : strcpy (s1, s2))
585 #define xetcsncpy(s1, s2, n) \
586 (XEUNICODE_P ? (char *) wcsncpy ((wchar_t *) s1, (wchar_t *) s2, n) \
587 : strncpy (s1, s2, n))
247 #define xetcschr(s, ch) \ 588 #define xetcschr(s, ch) \
248 (XEUNICODE_P ? (char *) wcschr ((wchar_t *) s, (WCHAR) ch) \ 589 (XEUNICODE_P ? (char *) wcschr ((wchar_t *) s, (WCHAR) ch) \
249 : strchr (s, ch)) 590 : strchr (s, ch))
250 #define xetcsrchr(s, ch) \ 591 #define xetcsrchr(s, ch) \
251 (XEUNICODE_P ? (char *) wcsrchr ((wchar_t *) s, (WCHAR) ch) \ 592 (XEUNICODE_P ? (char *) wcsrchr ((wchar_t *) s, (WCHAR) ch) \
252 : strrchr (s, ch)) 593 : strrchr (s, ch))
253 594 #define xetcsdup(s) \
254 595 (XEUNICODE_P ? (char *) wcsdup ((wchar_t *) s) \
255 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ 596 : xstrdup (s))
256 do { \ 597
257 Intbyte *lttff; \ 598 #define C_STRING_TO_TSTR(in, out) \
258 \ 599 C_STRING_TO_EXTERNAL (in, out, Qmswindows_tstr)
259 LOCAL_TO_WIN32_FILE_FORMAT (path, lttff); \ 600 #define LISP_STRING_TO_TSTR(in, out) \
260 C_STRING_TO_EXTERNAL (lttff, out, Qmswindows_tstr); \ 601 LISP_STRING_TO_EXTERNAL (in, out, Qmswindows_tstr)
602 #define TSTR_TO_C_STRING(in, out) \
603 EXTERNAL_TO_C_STRING (in, out, Qmswindows_tstr)
604 #define TSTR_TO_C_STRING_MALLOC(in, out) \
605 EXTERNAL_TO_C_STRING_MALLOC (in, out, Qmswindows_tstr)
606
607 #define build_tstr_string(in) \
608 make_ext_string (in, xetcsbytelen ((Extbyte *) in), Qmswindows_tstr)
609
610 #define MAX_ANSI_CHAR_LEN 1
611 #define MAX_UNICODE_CHAR_LEN 2
612
613 DECLARE_INLINE_HEADER (int ansi_char_to_text (int ch, Extbyte *t))
614 {
615 ch &= 0xFF;
616 t[0] = ch;
617 return 1;
618 }
619
620 DECLARE_INLINE_HEADER (int unicode_char_to_text (int ch, Extbyte *t))
621 {
622 t[0] = ch & 0xFF;
623 t[1] = (ch >> 8) & 0xFF;
624 return 2;
625 }
626
627 Extbyte *convert_multibyte_to_unicode_malloc (const Extbyte *src,
628 Bytecount n,
629 int cp, Bytecount *size_out);
630 Intbyte *convert_multibyte_to_internal_malloc (const Extbyte *src,
631 Bytecount n,
632 int cp, Bytecount *size_out);
633 void convert_multibyte_to_unicode_dynarr (const Extbyte *src, Bytecount n,
634 int cp, unsigned_char_dynarr *dst);
635
636 /* ------------------------- Other Mule stuff ------------------------- */
637
638 LCID mswindows_current_locale (void);
639 int mswindows_locale_to_code_page (LCID lcid);
640 int mswindows_locale_to_oem_code_page (LCID lcid);
641
642 /* ------------------------- Filename conversion ------------------------- */
643
644 #ifdef CYGWIN
645 #ifdef __cplusplus
646 extern "C" {
647 #endif
648 void cygwin_win32_to_posix_path_list (const char *, char *);
649 int cygwin_win32_to_posix_path_list_buf_size (const char *);
650 void cygwin_posix_to_win32_path_list (const char *, char *);
651 int cygwin_posix_to_win32_path_list_buf_size (const char *);
652 #ifdef __cplusplus
653 }
654 #endif
655 #endif
656
657 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \
658 do { \
659 Intbyte *lttff; \
660 \
661 LOCAL_TO_WIN32_FILE_FORMAT (XSTRING_DATA (path), lttff); \
662 C_STRING_TO_TSTR (lttff, out); \
261 } while (0) 663 } while (0)
262 664
263 Lisp_Object tstr_to_local_file_format (Extbyte *pathout); 665 Lisp_Object tstr_to_local_file_format (Extbyte *pathout);
264 666
265 #ifdef CYGWIN 667 #ifdef CYGWIN
266 #define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \ 668 #define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \
267 do { \ 669 do { \
268 /* NOTE: It is a bit evil that here and below we are passing \ 670 /* NOTE: It is a bit evil that here and below we are passing \
269 internal-format data to a function that (nominally) should work \ 671 internal-format data to a function that (nominally) should work \
270 with external-format data. But in point of fact, the Cygwin \ 672 with external-format data. But in point of fact, the Cygwin \
271 conversion functions are *NOT* localized, and will fail if they \ 673 conversion functions are *NOT* localized, and will fail if they \
272 get 7-bit ISO2022-encoded data. We know that our internal format \ 674 get 7-bit ISO2022-encoded data. We know that our internal format \
273 is ASCII-compatible, and so these functions will work fine with \ 675 is ASCII-compatible, and so these functions will work fine with \
274 this data. */ \ 676 this data. */ \
275 Lisp_Object ltwff1 = (path); \ 677 Intbyte *ltwffp = (path); \
276 Intbyte* ltwffp = XSTRING_DATA (ltwff1); \ 678 if (isalpha (ltwffp[0]) && (IS_DEVICE_SEP (ltwffp[1]))) \
277 if (isalpha (ltwffp[0]) && (IS_DEVICE_SEP (ltwffp[1]))) \ 679 pathout = ltwffp; \
278 pathout = ltwffp; \ 680 else \
279 else { \ 681 { \
280 int ltwff2 = \ 682 int ltwff2 = \
281 cygwin_posix_to_win32_path_list_buf_size ((char*)ltwffp); \ 683 cygwin_posix_to_win32_path_list_buf_size ((char *) ltwffp); \
282 pathout = (Intbyte *) alloca (ltwff2); \ 684 pathout = (Intbyte *) alloca (ltwff2); \
283 cygwin_posix_to_win32_path_list ((char*) ltwffp, (char*) pathout); \ 685 cygwin_posix_to_win32_path_list ((char *) ltwffp, (char *) pathout); \
284 } \ 686 } \
285 } while (0) 687 } while (0)
286 #else 688 #else
287 #define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \ 689 #define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \
288 do { \ 690 do { \
289 (pathout) = XSTRING_DATA (path); \ 691 (pathout) = (path); \
290 } while (0) 692 } while (0)
291 #endif 693 #endif
292 694
293 #ifdef CYGWIN 695 #ifdef CYGWIN
294 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \ 696 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \
296 Intbyte *wtlff1 = (path); \ 698 Intbyte *wtlff1 = (path); \
297 int wtlff2 = \ 699 int wtlff2 = \
298 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \ 700 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \
299 Intbyte *wtlff3 = (Intbyte *) alloca (wtlff2); \ 701 Intbyte *wtlff3 = (Intbyte *) alloca (wtlff2); \
300 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \ 702 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \
301 (pathout) = build_string ((CIntbyte *) wtlff3); \ 703 (pathout) = wtlff3; \
302 } while (0) 704 } while (0)
303 #else 705 #else
304 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \ 706 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \
305 do { \ 707 do { \
306 (pathout) = build_string ((CIntbyte *) path); \ 708 (pathout) = (path); \
307 } while (0) 709 } while (0)
308 #endif 710 #endif
309 711
310 extern BOOL (WINAPI *xSwitchToThread) (VOID); 712 Intbyte *urlify_filename (Intbyte *filename);
311 713 Intbyte *mswindows_canonicalize_filename (Intbyte *name);
312 extern HKL (WINAPI *xGetKeyboardLayout) (DWORD); 714 #define MSWINDOWS_NORMALIZE_FILENAME(name) \
313 extern BOOL (WINAPI *xSetMenuDefaultItem) (HMENU, UINT, UINT); 715 INTBYTE_STRING_TO_ALLOCA (mswindows_canonicalize_filename (name), name)
314 extern BOOL (WINAPI *xInsertMenuItemA) (HMENU, UINT, BOOL, LPCMENUITEMINFOA); 716
315 extern BOOL (WINAPI *xInsertMenuItemW) (HMENU, UINT, BOOL, LPCMENUITEMINFOW); 717 /* ------------------- Functions needed dynamic binding ------------------- */
316 extern HANDLE (WINAPI *xLoadImageA) (HINSTANCE, LPCSTR, UINT, int, int, UINT); 718
317 extern HANDLE (WINAPI *xLoadImageW) (HINSTANCE, LPCWSTR, UINT, int, int, UINT); 719 typedef BOOL (WINAPI *pfSwitchToThread_t) (VOID);
318 extern ATOM (WINAPI *xRegisterClassExA) (CONST WNDCLASSEXA *); 720
319 extern ATOM (WINAPI *xRegisterClassExW) (CONST WNDCLASSEXW *); 721 typedef NET_API_STATUS (NET_API_FUNCTION *pfNetUserEnum_t)
320 722 (LPCWSTR, DWORD, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, LPDWORD);
321 extern int (WINAPI *xEnumFontFamiliesExA) (HDC, LPLOGFONTA, FONTENUMPROCA, 723 typedef NET_API_STATUS (NET_API_FUNCTION *pfNetApiBufferFree_t) (LPVOID);
322 LPARAM, DWORD); 724
323 extern int (WINAPI *xEnumFontFamiliesExW) (HDC, LPLOGFONTW, FONTENUMPROCW, 725 extern pfSwitchToThread_t xSwitchToThread;
324 LPARAM, DWORD); 726
325 727 extern pfNetUserEnum_t xNetUserEnum;
326 extern DWORD (WINAPI *xSHGetFileInfoA) (LPCSTR, DWORD, SHFILEINFOA FAR *, UINT, 728 extern pfNetApiBufferFree_t xNetApiBufferFree;
327 UINT); 729
328 extern DWORD (WINAPI *xSHGetFileInfoW) (LPCWSTR, DWORD, SHFILEINFOW FAR *, 730 /* --------- Useful routines for manipulating memory-mapped files -------- */
329 UINT, UINT); 731
330 732 typedef struct file_data
331 extern NET_API_STATUS (NET_API_FUNCTION *xNetUserEnum) 733 {
332 ( 734 const Intbyte *name;
333 IN LPCWSTR servername OPTIONAL, 735 unsigned long size;
334 IN DWORD level, 736 HANDLE file;
335 IN DWORD filter, 737 HANDLE file_mapping;
336 OUT LPBYTE *bufptr, 738 void *file_base;
337 IN DWORD prefmaxlen, 739 } file_data;
338 OUT LPDWORD entriesread, 740
339 OUT LPDWORD totalentries, 741 #define OFFSET_TO_RVA(var,section) \
340 IN OUT LPDWORD resume_handle OPTIONAL 742 (section->VirtualAddress + \
341 ); 743 ((DWORD)(var) - section->PointerToRawData))
342 744
343 extern NET_API_STATUS (NET_API_FUNCTION *xNetApiBufferFree) 745 #define RVA_TO_OFFSET(var,section) \
344 ( 746 (section->PointerToRawData + \
345 IN LPVOID Buffer 747 ((DWORD)(var) - section->VirtualAddress))
346 ); 748
749 #define RVA_TO_PTR(var,section,filedata) \
750 ((void *)(RVA_TO_OFFSET(var,section) + \
751 (char *)(filedata).file_base))
752
753 int open_input_file (file_data *p_file, const Intbyte *name);
754 int open_output_file (file_data *p_file, const Intbyte *name,
755 unsigned long size);
756 void close_file_data (file_data *p_file);
757
758 /* ------------------------- Heap related stuff ------------------------- */
759
760 #ifdef WIN32_NATIVE
761
762 #define get_reserved_heap_size() reserved_heap_size
763 #define get_committed_heap_size() (get_data_end () - get_data_start ())
764 #define get_heap_start() get_data_start ()
765 #define get_heap_end() get_data_end ()
766 #define get_page_size() sysinfo_cache.dwPageSize
767 #define get_allocation_unit() sysinfo_cache.dwAllocationGranularity
768 #define get_processor_type() sysinfo_cache.dwProcessorType
769 #define get_nt_major_version() nt_major_version
770 #define get_nt_minor_version() nt_minor_version
771
772 extern unsigned char *get_data_start();
773 extern unsigned char *get_data_end();
774 extern unsigned long data_region_size;
775 extern unsigned long reserved_heap_size;
776 extern SYSTEM_INFO sysinfo_cache;
777 extern int nt_major_version;
778 extern int nt_minor_version;
779
780 /* To prevent zero-initialized variables from being placed into the bss
781 section, use non-zero values to represent an uninitialized state. */
782 #define UNINIT_PTR ((unsigned char*) 0xF0A0F0A0)
783 #define UNINIT_LONG (0xF0A0F0A0L)
784
785 /* Emulation of Unix sbrk(). */
786 extern void *sbrk (unsigned long size);
787
788 /* Recreate the heap created during dumping. */
789 extern void recreate_heap (char *executable_path);
790
791 /* Round the heap to this size. */
792 extern void round_heap (unsigned long size);
793
794 /* Load in the dumped .bss section. */
795 extern void read_in_bss (char *name);
796
797 /* Map in the dumped heap. */
798 extern void map_in_heap (char *name);
799
800 /* Cache system info, e.g., the NT page size. */
801 extern void cache_system_info (void);
802
803 /* Round ADDRESS up to be aligned with ALIGN. */
804 extern unsigned char *round_to_next (unsigned char *address,
805 unsigned long align);
806 #endif /* WIN32_NATIVE */
807
808 /* ------------------------- Misc prototypes ------------------------- */
809
810 #ifdef WIN32_NATIVE
811 DECLARE_INLINE_HEADER (int strcasecmp (const char *a, const char *b))
812 {
813 return qxestrcasecmp ((const Intbyte *) a, (const Intbyte *) b);
814 }
815 #endif /* WIN32_NATIVE */
816
817 /* in nt.c */
818 int mswindows_access (const Intbyte *path, int mode);
819 int mswindows_link (const Intbyte *old, const Intbyte *new);
820 int mswindows_rename (const Intbyte *oldname, const Intbyte *newname);
821 int mswindows_unlink (const Intbyte *path);
822 int mswindows_stat (const Intbyte *path, struct stat *buf);
823 int mswindows_fstat (int desc, struct stat *buf);
824 time_t mswindows_convert_time (FILETIME ft);
825 void mswindows_executable_type (const Intbyte * filename, int * is_dos_app,
826 int * is_cygnus_app);
827 Intbyte *mswindows_getdcwd (int drivelet);
828
829 /* In process-nt.c */
830 extern int mswindows_compare_env (const void *strp1, const void *strp2);
831
832 /* in sysdep.c */
833 #ifdef WIN32_NATIVE
834 void wait_for_termination (HANDLE pid);
835 #endif
836
837 /* in win32.c */
838 void mswindows_output_last_error (char *frob);
839 DECLARE_DOESNT_RETURN (mswindows_report_process_error (const char *string,
840 Lisp_Object data,
841 int errnum));
842 Lisp_Object mswindows_lisp_error (int errnum);
843
844
845 /*--------------------------------------------------------------------*/
846 /* stuff in ntproc.c */
847 /* DIE DIE DIE */
848 /*--------------------------------------------------------------------*/
849
850 /* Prepare our standard handles for proper inheritance by child processes. */
851 extern void prepare_standard_handles (int in, int out,
852 int err, HANDLE handles[4]);
853 /* Reset our standard handles to their original state. */
854 extern void reset_standard_handles (int in, int out,
855 int err, HANDLE handles[4]);
856 void set_process_dir (const char * dir);
857 extern void init_ntproc (void);
858 /* Will die as soon as callproc.c dies */
859 int spawnve_will_die_soon (int mode, const Intbyte *cmdname,
860 const Intbyte * const *argv,
861 const Intbyte *const *envp);
862 int pipe_will_die_soon (int *phandles);
347 863
348 #endif /* INCLUDED_syswindows_h_ */ 864 #endif /* INCLUDED_syswindows_h_ */