Mercurial > hg > xemacs-beta
annotate src/syswindows.h @ 4842:1d775c6304d1
Use with-FOO consistently instead of enable-FOO
INSTALL, PROBLEMS, configure, configure.ac: Rename all instances of enable-FOO to with-FOO. enable-FOO has long
been aliased to with-FOO and we still preserve this, but formerly
we randomly used enable-FOO but with-BAR.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 13 Jan 2010 02:28:37 -0600 |
parents | b3ea9c582280 |
children | 95c4ced5c07c |
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 | |
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 | |
8 Free Software Foundation; either version 2, or (at your option) any | |
9 later version. | |
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 | |
17 along with XEmacs; see the file COPYING. If not, write to | |
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
19 Boston, MA 02111-1307, USA. */ | |
20 | |
21 /* Synched up with: Not in FSF. */ | |
22 | |
23 /* Authorship: | |
24 | |
771 | 25 Current primary author: Ben Wing <ben@xemacs.org> |
26 | |
442 | 27 Created May 2000 by Andy Piper. |
771 | 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 | |
442 | 37 */ |
38 | |
39 #ifndef INCLUDED_syswindows_h_ | |
40 #define INCLUDED_syswindows_h_ | |
41 | |
2367 | 42 /* See win32.c for info about the different Windows files in XEmacs. */ |
442 | 43 |
771 | 44 /* ------------------------- Basic includes ------------------------- */ |
442 | 45 |
46 #ifndef WIN32_LEAN_AND_MEAN | |
47 #define WIN32_LEAN_AND_MEAN | |
48 #endif | |
49 | |
665 | 50 #if defined (CYGWIN) || defined (MINGW) |
771 | 51 # define CYGWIN_HEADERS |
52 # ifndef _WIN32_IE | |
53 # define _WIN32_IE 0x0400 | |
54 # endif | |
665 | 55 |
1743 | 56 BEGIN_C_DECLS |
665 | 57 |
4827
11daf37dae4d
more fixes to get a clean compile
Ben Wing <ben@xemacs.org>
parents:
4824
diff
changeset
|
58 #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
|
59 is now declared static */ |
665 | 60 /* Fucking GCC complains about "no previous prototype" for inline |
61 functions. DUH! See DECLARE_INLINE_HEADER. */ | |
62 extern __inline void *GetCurrentFiber (void); | |
63 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
|
64 #endif |
665 | 65 |
1743 | 66 END_C_DECLS |
665 | 67 |
68 #endif | |
69 | |
771 | 70 /* Defines for COM so it's usable in both C and C++. XECOMCALLn() calls a |
71 method with the specified number of parameters. XECOMID() surrounds a | |
72 class or interface name when passed to CoCreateInstance, a | |
73 QueryInterface method, or the like. */ | |
74 #ifdef __cplusplus | |
75 #define XECOMCALL0(cl, meth) ((cl)->meth ()) | |
76 #define XECOMCALL1(cl, meth, a1) ((cl)->meth (a1)) | |
77 #define XECOMCALL2(cl, meth, a1, a2) ((cl)->meth (a1, a2)) | |
78 #define XECOMCALL3(cl, meth, a1, a2, a3) ((cl)->meth (a1, a2, a3)) | |
79 #define XECOMCALL4(cl, meth, a1, a2, a3, a4) ((cl)->meth (a1, a2, a3, a4)) | |
80 #define XECOMID(id) (id) | |
81 #else | |
82 #define XECOMCALL0(cl, meth) ((cl)->lpVtbl->meth (cl)) | |
83 #define XECOMCALL1(cl, meth, a1) ((cl)->lpVtbl->meth (cl, a1)) | |
84 #define XECOMCALL2(cl, meth, a1, a2) ((cl)->lpVtbl->meth (cl, a1, a2)) | |
85 #define XECOMCALL3(cl, meth, a1, a2, a3) ((cl)->lpVtbl->meth (cl, a1, a2, a3)) | |
86 #define XECOMCALL4(cl, meth, a1, a2, a3, a4) \ | |
87 ((cl)->lpVtbl->meth (cl, a1, a2, a3, a4)) | |
88 #define XECOMID(id) (&(id)) | |
89 #endif | |
90 | |
91 #define OEMRESOURCE /* Define OCR_ and friend constants */ | |
442 | 92 #include <windows.h> |
93 | |
3728 | 94 #include <aclapi.h> |
95 | |
558 | 96 #if defined (WIN32_LEAN_AND_MEAN) |
97 # ifdef HAVE_X_WINDOWS | |
442 | 98 /* Christ almighty. The problems you get when combining two large code bases, |
99 neither with any respect for namespace purity. */ | |
558 | 100 # undef Status |
101 # endif | |
102 # include <winspool.h> | |
103 # ifdef HAVE_X_WINDOWS | |
104 # define Status int | |
105 # endif | |
106 # include <mmsystem.h> | |
673 | 107 # include <shlobj.h> |
558 | 108 # include <shellapi.h> |
109 # include <ddeml.h> | |
442 | 110 #endif |
111 | |
546 | 112 #include <lmaccess.h> /* next three for NetUserEnum and friends */ |
531 | 113 #include <lmapibuf.h> |
114 #include <lmerr.h> | |
546 | 115 #include <lmcons.h> /* for UNLEN and possibly other constants */ |
531 | 116 |
771 | 117 #include <cderr.h> |
118 #include <commdlg.h> | |
119 | |
120 #ifdef NEED_MSWINDOWS_COMMCTRL | |
121 #include <commctrl.h> | |
442 | 122 #endif |
771 | 123 #ifdef NEED_MSWINDOWS_OBJBASE |
124 #include <objbase.h> | |
442 | 125 #endif |
771 | 126 #ifdef NEED_MSWINDOWS_SHLOBJ |
127 #include <shlobj.h> | |
442 | 128 #endif |
129 | |
771 | 130 #include <zmouse.h> /* WHEEL_PAGESCROLL under Cygwin */ |
131 | |
132 #include <wchar.h> | |
442 | 133 |
771 | 134 /* ------------------------- Cygwin header brokenness ---------------------- */ |
135 | |
136 #ifdef CYGWIN_HEADERS | |
137 | |
1683 | 138 #include <cygwin/stat.h> /* for struct stat */ |
1304 | 139 #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
|
140 #include <sys/cygwin.h> /* path conversion functions */ |
1304 | 141 |
1683 | 142 /* Test for a specific version of w32api */ |
143 #define W32API_VER(major,minor) (((major) << 16) + (minor)) | |
144 #define W32API_INSTALLED_VER \ | |
145 W32API_VER (__W32API_MAJOR_VERSION, __W32API_MINOR_VERSION) | |
1304 | 146 |
771 | 147 /* Various brokennesses in various versions of Cygwin */ |
673 | 148 |
442 | 149 /* windows.h defines. */ |
150 #ifndef SPI_GETWHEELSCROLLLINES | |
151 #define SPI_GETWHEELSCROLLLINES 104 | |
152 #endif | |
771 | 153 |
154 /* commctrl.h defines. */ | |
155 #ifndef TB_SETIMAGELIST | |
156 #define TB_SETIMAGELIST (WM_USER + 48) | |
442 | 157 #endif |
771 | 158 #ifndef TB_GETIMAGELIST |
159 #define TB_GETIMAGELIST (WM_USER + 49) | |
160 #endif | |
161 #ifndef TB_SETDISABLEDIMAGELIST | |
162 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54) | |
163 #endif | |
164 #ifndef TB_GETDISABLEDIMAGELIST | |
165 #define TB_GETDISABLEDIMAGELIST (WM_USER + 55) | |
442 | 166 #endif |
771 | 167 #ifndef TB_SETPADDING |
168 #define TB_SETPADDING (WM_USER + 87) | |
169 #endif | |
170 #ifndef TB_GETBUTTONINFOA | |
171 #define TB_GETBUTTONINFOA (WM_USER + 65) | |
172 #endif | |
173 #ifndef TB_GETBUTTONINFOW | |
174 #define TB_GETBUTTONINFOW (WM_USER + 63) | |
442 | 175 #endif |
771 | 176 #ifndef TB_SETBUTTONINFOA |
177 #define TB_SETBUTTONINFOA (WM_USER + 66) | |
178 #endif | |
179 #ifndef TB_SETBUTTONINFOW | |
180 #define TB_SETBUTTONINFOW (WM_USER + 64) | |
181 #endif | |
182 #ifndef TB_INSERTBUTTONA | |
183 #define TB_INSERTBUTTONA (WM_USER + 21) | |
442 | 184 #endif |
771 | 185 #ifndef TB_INSERTBUTTONW |
186 #define TB_INSERTBUTTONW (WM_USER + 67) | |
187 #endif | |
188 #ifndef TB_ADDBUTTONSA | |
189 #define TB_ADDBUTTONSA (WM_USER + 20) | |
190 #endif | |
191 #ifndef TB_ADDBUTTONSW | |
192 #define TB_ADDBUTTONSW (WM_USER + 68) | |
442 | 193 #endif |
771 | 194 #ifndef LVM_SETBKIMAGEA |
195 #define LVM_SETBKIMAGEA (LVM_FIRST + 68) | |
196 #endif | |
197 #ifndef LVM_SETBKIMAGEW | |
198 #define LVM_SETBKIMAGEW (LVM_FIRST + 138) | |
199 #endif | |
200 #ifndef LVM_GETBKIMAGEA | |
201 #define LVM_GETBKIMAGEA (LVM_FIRST + 69) | |
442 | 202 #endif |
771 | 203 #ifndef LVM_GETBKIMAGEW |
204 #define LVM_GETBKIMAGEW (LVM_FIRST + 139) | |
205 #endif | |
206 #ifndef WC_COMBOBOXEXW | |
207 #define WC_COMBOBOXEXW L"ComboBoxEx32" | |
208 #endif | |
209 #ifndef CBEM_INSERTITEMA | |
210 #define CBEM_INSERTITEMA (WM_USER + 1) | |
442 | 211 #endif |
771 | 212 #ifndef CBEM_INSERTITEMW |
213 #define CBEM_INSERTITEMW (WM_USER + 11) | |
442 | 214 #endif |
771 | 215 #ifndef CBEM_SETITEMA |
216 #define CBEM_SETITEMA (WM_USER + 5) | |
217 #endif | |
218 #ifndef CBEM_SETITEMW | |
219 #define CBEM_SETITEMW (WM_USER + 12) | |
442 | 220 #endif |
771 | 221 #ifndef CBEM_GETITEMA |
222 #define CBEM_GETITEMA (WM_USER + 4) | |
223 #endif | |
224 #ifndef CBEM_GETITEMW | |
225 #define CBEM_GETITEMW (WM_USER + 13) | |
442 | 226 #endif |
771 | 227 #ifndef HDN_GETDISPINFOA |
228 #define HDN_GETDISPINFOA (HDN_FIRST - 9) | |
229 #endif | |
230 #ifndef HDN_GETDISPINFOW | |
231 #define HDN_GETDISPINFOW (HDN_FIRST - 29) | |
232 #endif | |
233 #ifndef TBN_GETDISPINFOA | |
234 #define TBN_GETDISPINFOA (TBN_FIRST - 16) | |
442 | 235 #endif |
771 | 236 #ifndef TBN_GETDISPINFOW |
237 #define TBN_GETDISPINFOW (TBN_FIRST - 17) | |
238 #endif | |
239 #ifndef TBN_GETINFOTIPA | |
240 #define TBN_GETINFOTIPA (TBN_FIRST - 18) | |
442 | 241 #endif |
771 | 242 #ifndef TBN_GETINFOTIPW |
243 #define TBN_GETINFOTIPW (TBN_FIRST - 19) | |
244 #endif | |
245 #ifndef TTN_GETDISPINFOA | |
246 #define TTN_GETDISPINFOA (TTN_FIRST - 0) | |
247 #endif | |
248 #ifndef TTN_GETDISPINFOW | |
249 #define TTN_GETDISPINFOW (TTN_FIRST - 10) | |
442 | 250 #endif |
771 | 251 |
252 #if (_WIN32_IE >= 0x0400) | |
253 | |
254 #ifndef LVN_GETINFOTIPA | |
255 #define LVN_GETINFOTIPA (LVN_FIRST - 57) | |
256 #endif | |
257 #ifndef LVN_GETINFOTIPW | |
258 #define LVN_GETINFOTIPW (LVN_FIRST - 58) | |
442 | 259 #endif |
771 | 260 #ifndef TVN_GETINFOTIPA |
261 #define TVN_GETINFOTIPA (TVN_FIRST - 13) | |
262 #endif | |
263 #ifndef TVN_GETINFOTIPW | |
264 #define TVN_GETINFOTIPW (TVN_FIRST - 14) | |
265 #endif | |
266 #ifndef CBEN_GETDISPINFOA | |
267 #define CBEN_GETDISPINFOA (CBEN_FIRST - 0) | |
442 | 268 #endif |
771 | 269 #ifndef CBEN_GETDISPINFOW |
270 #define CBEN_GETDISPINFOW (CBEN_FIRST - 7) | |
271 #endif | |
272 #ifndef CBEN_DRAGBEGINA | |
273 #define CBEN_DRAGBEGINA (CBEN_FIRST - 8) | |
274 #endif | |
275 #ifndef CBEN_DRAGBEGINW | |
276 #define CBEN_DRAGBEGINW (CBEN_FIRST - 9) | |
442 | 277 #endif |
771 | 278 |
279 #endif /* (_WIN32_IE >= 0x0400) */ | |
280 | |
281 #ifndef CBEN_ENDEDITA | |
282 #define CBEN_ENDEDITA (CBEN_FIRST - 5) | |
442 | 283 #endif |
771 | 284 #ifndef CBEN_ENDEDITW |
285 #define CBEN_ENDEDITW (CBEN_FIRST - 6) | |
286 #endif | |
287 | |
288 #ifndef CBEMAXSTRLEN | |
289 #define CBEMAXSTRLEN 260 | |
442 | 290 #endif |
291 | |
1111 | 292 #ifndef NMCBEENDEDIT |
293 | |
294 typedef struct | |
295 { | |
296 NMHDR hdr; | |
297 BOOL fChanged; | |
298 int iNewSelection; | |
299 WCHAR szText[CBEMAXSTRLEN]; | |
300 int iWhy; | |
771 | 301 } NMCBEENDEDITW, *LPNMCBEENDEDITW, *PNMCBEENDEDITW; |
302 | |
1111 | 303 typedef struct |
304 { | |
305 NMHDR hdr; | |
306 BOOL fChanged; | |
307 int iNewSelection; | |
308 char szText[CBEMAXSTRLEN]; | |
309 int iWhy; | |
771 | 310 } NMCBEENDEDITA, *LPNMCBEENDEDITA,*PNMCBEENDEDITA; |
311 | |
1111 | 312 #endif /* not NMCBEENDEDIT */ |
313 | |
771 | 314 #if (_WIN32_IE >= 0x0400) |
315 | |
1111 | 316 #ifndef NMCBEDRAGBEGIN |
317 | |
318 typedef struct | |
319 { | |
320 NMHDR hdr; | |
321 int iItemid; | |
322 WCHAR szText[CBEMAXSTRLEN]; | |
323 } NMCBEDRAGBEGINW, *LPNMCBEDRAGBEGINW, *PNMCBEDRAGBEGINW; | |
771 | 324 |
1111 | 325 typedef struct |
326 { | |
327 NMHDR hdr; | |
328 int iItemid; | |
329 char szText[CBEMAXSTRLEN]; | |
330 } NMCBEDRAGBEGINA, *LPNMCBEDRAGBEGINA, *PNMCBEDRAGBEGINA; | |
331 | |
332 #endif /* not NMCBEDRAGBEGIN */ | |
333 | |
771 | 334 typedef struct tagNMDATETIMEFORMATA |
335 { | |
1111 | 336 NMHDR nmhdr; |
337 LPCSTR pszFormat; | |
338 SYSTEMTIME st; | |
339 LPCSTR pszDisplay; | |
340 CHAR szDisplay[64]; | |
771 | 341 } NMDATETIMEFORMATA, FAR * LPNMDATETIMEFORMATA; |
342 | |
343 typedef struct tagNMDATETIMEFORMATW | |
344 { | |
1111 | 345 NMHDR nmhdr; |
346 LPCWSTR pszFormat; | |
347 SYSTEMTIME st; | |
348 LPCWSTR pszDisplay; | |
349 WCHAR szDisplay[64]; | |
771 | 350 } NMDATETIMEFORMATW, FAR * LPNMDATETIMEFORMATW; |
351 | |
1683 | 352 #if W32API_INSTALLED_VER < W32API_VER(2,2) |
1304 | 353 |
1111 | 354 typedef struct tagNMTTDISPIFNOA |
355 { | |
356 NMHDR hdr; | |
357 LPSTR lpszText; | |
358 char szText[80]; | |
359 HINSTANCE hinst; | |
360 UINT uFlags; | |
771 | 361 #if (_WIN32_IE >= 0x0300) |
1111 | 362 LPARAM lParam; |
771 | 363 #endif |
364 } NMTTDISPINFOA, FAR *LPNMTTDISPINFOA; | |
365 | |
1111 | 366 typedef struct tagNMTTDISPINFOW |
367 { | |
368 NMHDR hdr; | |
369 LPWSTR lpszText; | |
370 WCHAR szText[80]; | |
371 HINSTANCE hinst; | |
372 UINT uFlags; | |
771 | 373 #if (_WIN32_IE >= 0x0300) |
1111 | 374 LPARAM lParam; |
771 | 375 #endif |
376 } NMTTDISPINFOW, FAR *LPNMTTDISPINFOW; | |
377 | |
1683 | 378 #endif /* W32API_INSTALLED_VER < W32API_VER(2,2) */ |
1304 | 379 |
771 | 380 #endif /* (_WIN32_IE >= 0x0400) */ |
442 | 381 |
771 | 382 /* shlobj.h defines */ |
383 #ifndef BFFM_VALIDATEFAILEDA | |
384 #define BFFM_VALIDATEFAILEDA 3 | |
385 #endif | |
386 #ifndef BFFM_VALIDATEFAILEDW | |
387 #define BFFM_VALIDATEFAILEDW 4 | |
388 #endif | |
389 #ifndef BFFM_SETSELECTIONA | |
390 #define BFFM_SETSELECTIONA (WM_USER + 102) | |
391 #endif | |
392 #ifndef BFFM_SETSELECTIONW | |
393 #define BFFM_SETSELECTIONW (WM_USER + 103) | |
394 #endif | |
395 #ifndef BFFM_SETSTATUSTEXTA | |
396 #define BFFM_SETSTATUSTEXTA (WM_USER + 100) | |
397 #endif | |
398 #ifndef BFFM_SETSTATUSTEXTW | |
399 #define BFFM_SETSTATUSTEXTW (WM_USER + 104) | |
400 #endif | |
401 #ifndef SHARD_PATHA | |
402 #define SHARD_PATHA 2 | |
403 #endif | |
404 #ifndef SHARD_PATHW | |
405 #define SHARD_PATHW 3 | |
406 #endif | |
407 #ifndef SHCNF_PATHA | |
408 #define SHCNF_PATHA 1 | |
409 #endif | |
410 #ifndef SHCNF_PATHW | |
411 #define SHCNF_PATHW 5 | |
412 #endif | |
413 #ifndef SHCNF_PRINTERA | |
414 #define SHCNF_PRINTERA 2 | |
415 #endif | |
416 #ifndef SHCNF_PRINTERW | |
417 #define SHCNF_PRINTERW 6 | |
418 #endif | |
419 #ifndef BFFM_VALIDATEFAILED | |
420 #ifdef UNICODE | |
421 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW | |
422 #else | |
423 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA | |
424 #endif | |
819 | 425 #endif |
442 | 426 |
800 | 427 /* winnls.h defines */ |
819 | 428 #ifndef MAC_CHARSET |
429 #define MAC_CHARSET 77 | |
430 #endif | |
800 | 431 #ifndef LOCALE_RETURN_NUMBER |
819 | 432 #define LOCALE_RETURN_NUMBER 0x20000000 |
800 | 433 #endif |
434 | |
771 | 435 /* OEM resources */ |
436 #ifndef OCR_ICOCUR | |
437 #define OCR_ICOCUR 32647 | |
438 #define OIC_SAMPLE 32512 | |
439 #define OIC_HAND 32513 | |
440 #define OIC_QUES 32514 | |
441 #define OIC_BANG 32515 | |
442 #define OIC_NOTE 32516 | |
443 #define OIC_WINLOGO 32517 | |
444 #endif | |
445 | |
446 /* More Cygwin stupidity: Current w32api's winuser.h has IME message | |
447 constants and they conflict with imm.h. (NOTE: Currently fixed, but | |
448 I'm sure the problems were present post 1.0.) */ | |
449 #undef WM_IME_STARTCOMPOSITION | |
450 #undef WM_IME_ENDCOMPOSITION | |
451 #undef WM_IME_COMPOSITION | |
452 #undef WM_IME_KEYLAST | |
453 #undef WM_IME_SETCONTEXT | |
454 #undef WM_IME_NOTIFY | |
455 #undef WM_IME_CONTROL | |
456 #undef WM_IME_COMPOSITIONFULL | |
457 #undef WM_IME_SELECT | |
458 #undef WM_IME_CHAR | |
459 #undef WM_IME_KEYDOWN | |
460 #undef WM_IME_KEYUP | |
461 | |
462 #include <imm.h> | |
463 | |
1683 | 464 #if W32API_INSTALLED_VER < W32API_VER(2,4) |
771 | 465 typedef struct _SHQUERYRBINFO |
466 { | |
467 DWORD cbSize; | |
468 __int64 i64Size; | |
469 __int64 i64NumItems; | |
470 } SHQUERYRBINFO, *LPSHQUERYRBINFO; | |
1683 | 471 #endif |
771 | 472 |
473 typedef LPCDLGTEMPLATE LPCDLGTEMPLATEW; | |
474 typedef LPCDLGTEMPLATE LPCDLGTEMPLATEA; | |
475 | |
1685 | 476 #else /* !CYGWIN_HEADERS */ |
477 #define W32API_VER(major,minor) 0 | |
478 #define W32API_INSTALLED_VER 0 | |
771 | 479 #endif /* CYGWIN_HEADERS */ |
480 | |
481 /* Not in VC 6 */ | |
482 #ifndef BIF_NEWDIALOGSTYLE | |
483 #define BIF_NEWDIALOGSTYLE 64 | |
484 #endif | |
442 | 485 |
4538 | 486 #if defined (CYGWIN) && (CYGWIN_VERSION_DLL_COMBINED < 190) |
442 | 487 |
488 /* All but wcscmp and wcslen left out of Cygwin headers -- but present | |
771 | 489 in /usr/include/mingw/string.h! */ |
442 | 490 wchar_t* wcscat (wchar_t*, const wchar_t*); |
491 wchar_t* wcschr (const wchar_t*, wchar_t); | |
492 int wcscoll (const wchar_t*, const wchar_t*); | |
493 wchar_t* wcscpy (wchar_t*, const wchar_t*); | |
771 | 494 wchar_t* wcsdup (const wchar_t*); |
442 | 495 size_t wcscspn (const wchar_t*, const wchar_t*); |
496 /* Note: No wcserror in CRTDLL. */ | |
497 wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t); | |
771 | 498 int wcsncmp (const wchar_t*, const wchar_t*, size_t); |
499 wchar_t* wcsncpy (wchar_t*, const wchar_t*, size_t); | |
500 wchar_t* wcspbrk (const wchar_t*, const wchar_t*); | |
501 wchar_t* wcsrchr (const wchar_t*, wchar_t); | |
502 size_t wcsspn (const wchar_t*, const wchar_t*); | |
503 wchar_t* wcsstr (const wchar_t*, const wchar_t*); | |
504 wchar_t* wcstok (wchar_t*, const wchar_t*); | |
505 size_t wcsxfrm (wchar_t*, const wchar_t*, size_t); | |
442 | 506 |
507 #endif /* CYGWIN */ | |
508 | |
771 | 509 /* ------------------------- Unicode encapsulation ------------------------- */ |
510 | |
2367 | 511 /* See intl-win32.c for more information about Unicode-encapsulation */ |
771 | 512 |
800 | 513 #define ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
514 | |
771 | 515 #include "intl-auto-encap-win32.h" |
516 | |
517 /* would be encapsulatable but for parsing problems */ | |
800 | 518 |
519 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
520 #undef DefWindowProc | |
521 #define DefWindowProc error use qxeDefWindowProc or DefWindowProcA/DefWindowProcW | |
522 #endif | |
771 | 523 LRESULT qxeDefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); |
800 | 524 |
525 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
526 #undef CallWindowProc | |
527 #define CallWindowProc error use qxeCallWindowProc or CallWindowProcA/CallWindowProcW | |
528 #endif | |
771 | 529 LRESULT qxeCallWindowProc (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, |
530 WPARAM wParam, LPARAM lParam); | |
800 | 531 |
532 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
533 #undef DefDlgProc | |
534 #define DefDlgProc error use qxeDefDlgProc or DefDlgProcA/DefDlgProcW | |
535 #endif | |
771 | 536 LRESULT qxeDefDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); |
800 | 537 |
538 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
539 #undef SetWindowsHook | |
540 #define SetWindowsHook error use qxeSetWindowsHook or SetWindowsHookA/SetWindowsHookW | |
541 #endif | |
771 | 542 HHOOK qxeSetWindowsHook (int nFilterType, HOOKPROC pfnFilterProc); |
800 | 543 |
544 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
545 #undef DefMDIChildProc | |
546 #define DefMDIChildProc error use qxeDefMDIChildProc or DefMDIChildProcA/DefMDIChildProcW | |
547 #endif | |
771 | 548 LRESULT qxeDefMDIChildProc (HWND hWnd, UINT uMsg, WPARAM wParam, |
549 LPARAM lParam); | |
550 | |
800 | 551 #undef GetEnvironmentStrings |
552 #undef GetEnvironmentStringsA | |
553 #define GetEnvironmentStringsA GetEnvironmentStrings | |
554 Extbyte * qxeGetEnvironmentStrings (void); | |
555 | |
771 | 556 /* would be encapsulatable but for Cygwin problems */ |
800 | 557 |
558 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
1111 | 559 #undef DdeCreateStringHandle |
560 #define DdeCreateStringHandle error use qxeDdeCreateStringHandle or DdeCreateStringHandleA/DdeCreateStringHandleW | |
561 #endif | |
562 HSZ qxeDdeCreateStringHandle (DWORD idInst, const Extbyte * psz, int iCodePage); | |
563 | |
564 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
800 | 565 #undef RegConnectRegistry |
566 #define RegConnectRegistry error use qxeRegConnectRegistry or RegConnectRegistryA/RegConnectRegistryW | |
567 #endif | |
771 | 568 LONG qxeRegConnectRegistry (const Extbyte * lpMachineName, HKEY hKey, PHKEY phkResult); |
800 | 569 |
570 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
571 #undef ExtractIconEx | |
572 #define ExtractIconEx error use qxeExtractIconEx or ExtractIconExA/ExtractIconExW | |
573 #endif | |
771 | 574 UINT qxeExtractIconEx (const Extbyte * lpszFile, int nIconIndex, HICON FAR * phiconLarge, HICON FAR * phiconSmall, UINT nIcons); |
800 | 575 |
576 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
577 #undef GetICMProfile | |
578 #define GetICMProfile error use qxeGetICMProfile or GetICMProfileA/GetICMProfileW | |
579 #endif | |
771 | 580 BOOL qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3); |
800 | 581 |
582 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
583 #undef UpdateICMRegKey | |
584 #define UpdateICMRegKey error use qxeUpdateICMRegKey or UpdateICMRegKeyA/UpdateICMRegKeyW | |
585 #endif | |
771 | 586 BOOL qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4); |
587 | |
2500 | 588 /* would be encapsulatable but for header changes in different versions of VC++ */ |
589 | |
590 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
591 #undef EnumResourceTypes | |
592 #define EnumResourceTypes error_use_qxeEnumResourceTypes_or_EnumResourceTypesA_and_EnumResourceTypesW | |
593 #endif | |
594 #if MSC_VERSION >= 1300 | |
595 BOOL qxeEnumResourceTypes (HMODULE hModule, ENUMRESTYPEPROCW lpEnumFunc, LONG lParam); | |
596 #else | |
597 BOOL qxeEnumResourceTypes (HMODULE hModule, ENUMRESTYPEPROC lpEnumFunc, LONG lParam); | |
598 #endif | |
599 | |
600 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
601 #undef EnumResourceNames | |
602 #define EnumResourceNames error_use_qxeEnumResourceNames_or_EnumResourceNamesA_and_EnumResourceNamesW | |
603 #endif | |
604 #if MSC_VERSION >= 1300 | |
605 BOOL qxeEnumResourceNames (HMODULE hModule, const Extbyte * lpType, ENUMRESNAMEPROCW lpEnumFunc, LONG lParam); | |
606 #else | |
607 BOOL qxeEnumResourceNames (HMODULE hModule, const Extbyte * lpType, ENUMRESNAMEPROC lpEnumFunc, LONG lParam); | |
608 #endif | |
609 | |
610 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
611 #undef EnumResourceLanguages | |
612 #define EnumResourceLanguages error_use_qxeEnumResourceLanguages_or_EnumResourceLanguagesA_and_EnumResourceLanguagesW | |
613 #endif | |
614 #if MSC_VERSION >= 1300 | |
615 BOOL qxeEnumResourceLanguages (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, ENUMRESLANGPROCW lpEnumFunc, LONG lParam); | |
616 #else | |
617 BOOL qxeEnumResourceLanguages (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, ENUMRESLANGPROC lpEnumFunc, LONG lParam); | |
618 #endif | |
619 | |
771 | 620 /* files */ |
800 | 621 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
622 #undef FindFirstFile | |
623 #define FindFirstFile error use qxeFindFirstFile or FindFirstFileA/FindFirstFileW | |
624 #endif | |
771 | 625 HANDLE qxeFindFirstFile (const Extbyte *lpFileName, |
626 WIN32_FIND_DATAW *lpFindFileData); | |
800 | 627 |
628 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
629 #undef FindNextFile | |
630 #define FindNextFile error use qxeFindNextFile or FindNextFileA/FindNextFileW | |
631 #endif | |
771 | 632 BOOL qxeFindNextFile (HANDLE hFindFile, WIN32_FIND_DATAW *lpFindFileData); |
633 | |
634 /* shell */ | |
800 | 635 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
636 #undef SHGetFileInfo | |
637 #define SHGetFileInfo error use qxeSHGetFileInfo or SHGetFileInfoA/SHGetFileInfoW | |
638 #endif | |
771 | 639 DWORD qxeSHGetFileInfo (const Extbyte *pszPath, DWORD dwFileAttributes, |
640 SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags); | |
800 | 641 |
642 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
643 #undef SHBrowseForFolder | |
644 #define SHBrowseForFolder error use qxeSHBrowseForFolder or SHBrowseForFolderA/SHBrowseForFolderW | |
645 #endif | |
771 | 646 LPITEMIDLIST qxeSHBrowseForFolder (LPBROWSEINFOW lpbi); |
800 | 647 |
648 /* Not Unicode-split */ | |
771 | 649 VOID qxeSHAddToRecentDocs (UINT uFlags, LPCVOID pv); |
800 | 650 |
651 /* Not Unicode-split */ | |
771 | 652 VOID qxeSHChangeNotify (LONG wEventId, UINT uFlags, LPCVOID dwItem1, |
653 LPCVOID dwItem2); | |
800 | 654 |
655 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
656 #undef SHGetDataFromIDList | |
657 #define SHGetDataFromIDList error use qxeSHGetDataFromIDList or SHGetDataFromIDListA/SHGetDataFromIDListW | |
658 #endif | |
771 | 659 HRESULT qxeSHGetDataFromIDList (IShellFolder *psf, LPCITEMIDLIST pidl, |
660 int nFormat, PVOID pv, int cb); | |
661 | |
662 /* devmode */ | |
800 | 663 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
664 #undef CreateDC | |
665 #define CreateDC error use qxeCreateDC or CreateDCA/CreateDCW | |
666 #endif | |
771 | 667 HDC qxeCreateDC (const Extbyte *lpszDriver, const Extbyte *lpszDevice, |
668 const Extbyte *lpszOutput, CONST DEVMODEW *lpInitData); | |
800 | 669 |
670 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
671 #undef ResetDC | |
672 #define ResetDC error use qxeResetDC or ResetDCA/ResetDCW | |
673 #endif | |
771 | 674 HDC qxeResetDC (HDC hdc, CONST DEVMODEW *lpInitData); |
800 | 675 |
676 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
677 #undef OpenPrinter | |
678 #define OpenPrinter error use qxeOpenPrinter or OpenPrinterA/OpenPrinterW | |
679 #endif | |
771 | 680 DWORD qxeOpenPrinter (Extbyte *pPrinterName, LPHANDLE phPrinter, |
681 LPPRINTER_DEFAULTSW pDefaultconst); | |
800 | 682 |
683 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
684 #undef DocumentProperties | |
685 #define DocumentProperties error use qxeDocumentProperties or DocumentPropertiesA/DocumentPropertiesW | |
686 #endif | |
771 | 687 LONG qxeDocumentProperties (HWND hWnd, HANDLE hPrinter, Extbyte *pDeviceName, |
688 DEVMODEW *pDevModeOutput, DEVMODEW *pDevModeInput, | |
689 DWORD fMode); | |
800 | 690 |
691 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
692 #undef PrintDlg | |
693 #define PrintDlg error use qxePrintDlg or PrintDlgA/PrintDlgW | |
694 #endif | |
771 | 695 BOOL qxePrintDlg (PRINTDLGW *lppd); |
800 | 696 |
697 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
698 #undef PageSetupDlg | |
699 #define PageSetupDlg error use qxePageSetupDlg or PageSetupDlgA/PageSetupDlgW | |
700 #endif | |
771 | 701 BOOL qxePageSetupDlg (PAGESETUPDLGW *lppd); |
702 | |
703 /* fonts */ | |
800 | 704 |
705 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
706 #undef EnumFontFamiliesEx | |
707 #define EnumFontFamiliesEx error use qxeEnumFontFamiliesEx or EnumFontFamiliesExA/EnumFontFamiliesExW | |
708 #endif | |
771 | 709 int qxeEnumFontFamiliesEx (HDC hdc, LOGFONTW *lpLogfont, |
710 FONTENUMPROCW lpEnumFontFamProc, LPARAM lParam, | |
711 DWORD dwFlags); | |
800 | 712 |
713 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
714 #undef CreateFontIndirect | |
715 #define CreateFontIndirect error use qxeCreateFontIndirect or CreateFontIndirectA/CreateFontIndirectW | |
716 #endif | |
771 | 717 HFONT qxeCreateFontIndirect (CONST LOGFONTW *lplf); |
800 | 718 |
2500 | 719 #if defined (HAVE_MS_WINDOWS) |
800 | 720 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
721 #undef ImmSetCompositionFont | |
722 #define ImmSetCompositionFont error use qxeImmSetCompositionFont or ImmSetCompositionFontA/ImmSetCompositionFontW | |
723 #endif | |
771 | 724 BOOL qxeImmSetCompositionFont (HIMC imc, LOGFONTW *lplf); |
2500 | 725 #endif /* defined (HAVE_MS_WINDOWS) */ |
800 | 726 |
2500 | 727 #if defined (HAVE_MS_WINDOWS) |
800 | 728 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED |
729 #undef ImmGetCompositionFont | |
730 #define ImmGetCompositionFont error use qxeImmGetCompositionFont or ImmGetCompositionFontA/ImmGetCompositionFontW | |
731 #endif | |
771 | 732 BOOL qxeImmGetCompositionFont (HIMC imc, LOGFONTW *lplf); |
2500 | 733 #endif /* defined (HAVE_MS_WINDOWS) */ |
734 | |
735 #if defined (HAVE_MS_WINDOWS) | |
736 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
737 #undef ImmSetCompositionString | |
738 #define ImmSetCompositionString error_use_qxeImmSetCompositionString_or_ImmSetCompositionStringA_and_ImmSetCompositionStringW | |
739 #endif | |
740 #if MSC_VERSION >= 1300 | |
741 BOOL qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPVOID lpComp, DWORD arg4, LPCVOID lpRead, DWORD arg6); | |
742 #else | |
743 BOOL qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPCVOID lpComp, DWORD arg4, LPCVOID lpRead, DWORD arg6); | |
744 #endif | |
745 #endif /* defined (HAVE_MS_WINDOWS) */ | |
800 | 746 |
747 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
748 #undef GetObject | |
749 #define GetObject error use qxeGetObject or GetObjectA/GetObjectW | |
750 #endif | |
771 | 751 int qxeGetObject (HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject); |
800 | 752 |
753 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
754 #undef GetTextMetrics | |
755 #define GetTextMetrics error use qxeGetTextMetrics or GetTextMetricsA/GetTextMetricsW | |
756 #endif | |
771 | 757 BOOL qxeGetTextMetrics (HDC hdc, LPTEXTMETRICW lptm); |
758 | |
759 /* COMMCTRL.H */ | |
800 | 760 |
761 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
762 #undef SendMessage | |
763 #define SendMessage error use qxeSendMessage or SendMessageA/SendMessageW | |
764 #endif | |
771 | 765 LRESULT qxeSendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); |
766 | |
767 /* windows */ | |
800 | 768 |
769 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
770 #undef RegisterClass | |
771 #define RegisterClass error use qxeRegisterClass or RegisterClassA/RegisterClassW | |
772 #endif | |
771 | 773 ATOM qxeRegisterClass (CONST WNDCLASSW * lpWndClass); |
800 | 774 |
775 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
776 #undef UnregisterClass | |
777 #define UnregisterClass error use qxeUnregisterClass or UnregisterClassA/UnregisterClassW | |
778 #endif | |
771 | 779 BOOL qxeUnregisterClass (const Extbyte * lpClassName, HINSTANCE hInstance); |
800 | 780 |
781 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
782 #undef RegisterClassEx | |
783 #define RegisterClassEx error use qxeRegisterClassEx or RegisterClassExA/RegisterClassExW | |
784 #endif | |
771 | 785 ATOM qxeRegisterClassEx (CONST WNDCLASSEXW * arg1); |
800 | 786 |
787 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED | |
788 #undef CreateWindow | |
789 #define CreateWindow error use qxeCreateWindow or CreateWindowA/CreateWindowW | |
790 #endif | |
771 | 791 #define qxeCreateWindow(lpClassName, lpWindowName, dwStyle, x, y, \ |
792 nWidth, nHeight, hWndParent, hMenu, hInstance, \ | |
793 lpParam) \ | |
794 qxeCreateWindowEx (0L, lpClassName, lpWindowName, dwStyle, x, y, \ | |
795 nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) | |
796 | |
797 /* ------------------------- Unicode conversion ------------------------- */ | |
798 | |
799 /* Set early in command-line processing, when -nuni or | |
800 --no-unicode-lib-calls is seen. */ | |
801 extern int no_mswin_unicode_lib_calls; | |
2367 | 802 /* Set early, in init_win32_very_very_early(). */ |
771 | 803 extern int mswindows_windows9x_p; |
804 #define XEUNICODE_P (!mswindows_windows9x_p && !no_mswin_unicode_lib_calls) | |
805 | |
806 #define XELPTSTR LPWSTR | |
807 #define XELPCTSTR LPCWSTR | |
442 | 808 |
809 #define XETCHAR_SIZE (XEUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR)) | |
810 #define MAX_XETCHAR_SIZE sizeof (WCHAR) | |
811 #define XETEXT1(arg) (XEUNICODE_P ? ((char *) (L##arg)) : (arg)) | |
812 /* We need to do this indirection in case ARG is also a manifest constant. | |
813 I don't really understand why. --ben */ | |
814 #define XETEXT(arg) XETEXT1(arg) | |
815 #define XECOPY_TCHAR(ptr, ch) \ | |
816 (XEUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch))) | |
2421 | 817 #define qxetcslen(arg) \ |
771 | 818 (XEUNICODE_P ? wcslen ((wchar_t *) arg) : strlen (arg)) |
2421 | 819 #define qxetcsbytelen(arg) \ |
771 | 820 (XEUNICODE_P ? wcslen ((wchar_t *) arg) * XETCHAR_SIZE : strlen (arg)) |
2421 | 821 #define qxetcscmp(s1, s2) \ |
442 | 822 (XEUNICODE_P ? wcscmp ((wchar_t *) s1, (wchar_t *) s2) \ |
823 : strcmp (s1, s2)) | |
2421 | 824 #define qxetcscpy(s1, s2) \ |
442 | 825 (XEUNICODE_P ? (char *) wcscpy ((wchar_t *) s1, (wchar_t *) s2) \ |
826 : strcpy (s1, s2)) | |
2421 | 827 #define qxetcsncpy(s1, s2, n) \ |
771 | 828 (XEUNICODE_P ? (char *) wcsncpy ((wchar_t *) s1, (wchar_t *) s2, n) \ |
829 : strncpy (s1, s2, n)) | |
2421 | 830 #define qxetcschr(s, ch) \ |
442 | 831 (XEUNICODE_P ? (char *) wcschr ((wchar_t *) s, (WCHAR) ch) \ |
832 : strchr (s, ch)) | |
2421 | 833 #define qxetcsrchr(s, ch) \ |
442 | 834 (XEUNICODE_P ? (char *) wcsrchr ((wchar_t *) s, (WCHAR) ch) \ |
835 : strrchr (s, ch)) | |
2421 | 836 #define qxetcsdup(s) \ |
771 | 837 (XEUNICODE_P ? (char *) wcsdup ((wchar_t *) s) \ |
838 : xstrdup (s)) | |
442 | 839 |
771 | 840 #define C_STRING_TO_TSTR(in, out) \ |
841 C_STRING_TO_EXTERNAL (in, out, Qmswindows_tstr) | |
842 #define LISP_STRING_TO_TSTR(in, out) \ | |
843 LISP_STRING_TO_EXTERNAL (in, out, Qmswindows_tstr) | |
844 #define TSTR_TO_C_STRING(in, out) \ | |
845 EXTERNAL_TO_C_STRING (in, out, Qmswindows_tstr) | |
846 #define TSTR_TO_C_STRING_MALLOC(in, out) \ | |
847 EXTERNAL_TO_C_STRING_MALLOC (in, out, Qmswindows_tstr) | |
848 | |
849 #define build_tstr_string(in) \ | |
2421 | 850 make_ext_string (in, qxetcsbytelen ((Extbyte *) in), Qmswindows_tstr) |
771 | 851 |
852 #define MAX_ANSI_CHAR_LEN 1 | |
853 #define MAX_UNICODE_CHAR_LEN 2 | |
854 | |
855 DECLARE_INLINE_HEADER (int ansi_char_to_text (int ch, Extbyte *t)) | |
856 { | |
857 ch &= 0xFF; | |
858 t[0] = ch; | |
859 return 1; | |
860 } | |
861 | |
862 DECLARE_INLINE_HEADER (int unicode_char_to_text (int ch, Extbyte *t)) | |
863 { | |
864 t[0] = ch & 0xFF; | |
865 t[1] = (ch >> 8) & 0xFF; | |
866 return 2; | |
867 } | |
442 | 868 |
771 | 869 Extbyte *convert_multibyte_to_unicode_malloc (const Extbyte *src, |
870 Bytecount n, | |
871 int cp, Bytecount *size_out); | |
2367 | 872 Extbyte *convert_unicode_to_multibyte_malloc (const Extbyte *src, |
873 Bytecount n, | |
874 int cp, Bytecount *size_out); | |
867 | 875 Ibyte *convert_multibyte_to_internal_malloc (const Extbyte *src, |
771 | 876 Bytecount n, |
877 int cp, Bytecount *size_out); | |
878 void convert_multibyte_to_unicode_dynarr (const Extbyte *src, Bytecount n, | |
879 int cp, unsigned_char_dynarr *dst); | |
2367 | 880 void convert_unicode_to_multibyte_dynarr (const Extbyte *src, Bytecount n, |
881 int cp, unsigned_char_dynarr *dst); | |
882 | |
883 Bytecount unicode_multibyte_convert_size (const char *srctext, const void *src, | |
884 Bytecount src_size, int to_unicode, | |
885 int cp); | |
886 void *unicode_multibyte_convert_copy_data (const char *srctext, | |
887 void *alloca_data); | |
888 | |
889 /* NOTE: If you make two invocations of the following functions in the same | |
890 subexpression and use the exact same expression for the source in both | |
891 cases, you will lose. In this unlikely case, you may get an abort, and | |
892 need to rewrite the code. | |
893 | |
894 We need to use ALLOCA_FUNCALL_OK here, see NEW_DFC in text.h. | |
895 */ | |
896 | |
897 #ifdef WEXTTEXT_IS_WIDE | |
898 #define MULTIBYTE_TO_WEXTTEXT(str) \ | |
899 ((Wexttext *) \ | |
900 unicode_multibyte_convert_copy_data \ | |
901 (#str, ALLOCA_FUNCALL_OK (unicode_multibyte_convert_size \ | |
902 (#str, str, strlen (str) + 1, 1, CP_ACP)))) | |
903 | |
904 #define WEXTTEXT_TO_MULTIBYTE(str) \ | |
905 ((Extbyte *) \ | |
906 unicode_multibyte_convert_copy_data \ | |
907 (#str, ALLOCA_FUNCALL_OK (unicode_multibyte_convert_size \ | |
908 (#str, str, \ | |
909 (wcslen (str) + 1) * sizeof (WCHAR), 0, \ | |
910 CP_ACP)))) | |
911 #else | |
912 #define MULTIBYTE_TO_WEXTTEXT(str) ((Wexttext *) (str)) | |
913 #define WEXTTEXT_TO_MULTIBYTE(str) ((Extbyte *) (str)) | |
914 #endif | |
915 | |
916 /* #### mbstowcs() uses MB_ERR_INVALID_CHARS in addition to MB_PRECOMPOSED. | |
917 Should we do this? But then we have to handle errors. | |
918 #### Do we already check for invalid sequences in the coding system? */ | |
919 #define MBTOWC_OPTIONS MB_PRECOMPOSED /* | MB_ERR_INVALID_CHARS */ | |
920 /* The following options are what wcstombs() uses in the CRT. It uses | |
921 NULL in place of "~". */ | |
922 #define WCTOMB_OPTIONS WC_COMPOSITECHECK | WC_SEPCHARS | |
923 #define WCTOMB_INVALID_STRING "~" | |
771 | 924 |
925 /* ------------------------- Other Mule stuff ------------------------- */ | |
926 | |
927 LCID mswindows_current_locale (void); | |
928 int mswindows_locale_to_code_page (LCID lcid); | |
929 int mswindows_locale_to_oem_code_page (LCID lcid); | |
930 | |
931 /* ------------------------- Filename conversion ------------------------- */ | |
932 | |
933 #ifdef CYGWIN | |
1743 | 934 |
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
|
935 /* We should just remove the Windows 9x support */ |
1743 | 936 |
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
|
937 #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
|
938 (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
|
939 #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
|
940 (XEUNICODE_P ? CCP_WIN_W_TO_POSIX : CCP_WIN_A_TO_POSIX) |
1743 | 941 |
771 | 942 #endif |
943 | |
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
|
944 #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
|
945 #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
|
946 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
|
947 const Ibyte *lfftt = (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
|
948 if (isalpha (lfftt[0]) && (IS_DEVICE_SEP (lfftt[1]))) \ |
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
|
949 PATHNAME_CONVERT_OUT_TSTR (lfftt, 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
|
950 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
|
951 { \ |
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
|
952 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
|
953 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
|
954 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
|
955 \ |
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
|
956 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
|
957 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
|
958 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
|
959 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
|
960 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
|
961 lfftt_utf8_path, lfftt_tstr_path, 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
|
962 * (Extbyte **) &(out) = 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
|
963 } \ |
442 | 964 } 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
|
965 #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
|
966 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
|
967 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
|
968 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
|
969 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
|
970 \ |
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
|
971 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
|
972 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
|
973 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
|
974 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
|
975 ttlff, ttlff_utf8_path, 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
|
976 EXTERNAL_TO_C_STRING (ttlff_utf8_path, out, Qutf_8); \ |
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
|
977 } 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
|
978 #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
|
979 #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
|
980 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
|
981 Ibyte *lfftt; \ |
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
|
982 \ |
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
|
983 LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (path, lfftt); \ |
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
|
984 PATHNAME_CONVERT_OUT_TSTR (lfftt, 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
|
985 } 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
|
986 #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
|
987 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
|
988 Ibyte *ttlff; \ |
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
|
989 \ |
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
|
990 TSTR_TO_C_STRING (path, ttlff); \ |
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
|
991 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
|
992 } 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
|
993 #endif /* (not) HAVE_CYGWIN_CONV_PATH */ |
442 | 994 |
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
|
995 #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
|
996 LOCAL_FILE_FORMAT_TO_TSTR (XSTRING_DATA (path), out) |
826 | 997 /* Convert from local file format, as used in XEmacs, to valid win32 |
998 filenames as can be given to Windows API routines. Under native XEmacs, | |
999 this is a no-op, but under Cygwin, the local names look different -- | |
1000 Cygwin mount points, forward slashes, etc. Currently, under Cygwin, we | |
1001 actually allow local names to be of both formats, i.e. Cygwin or Win32 | |
1002 native. So we check to see if we have Win32 native already (a cheesy | |
1003 check, look for letter plus colon at beginning of name) and do nothing | |
1004 in that case. */ | |
1005 | |
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
|
1006 #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
|
1007 /* 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
|
1008 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
|
1009 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
|
1010 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
|
1011 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
|
1012 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
|
1013 #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
|
1014 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
|
1015 { \ |
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
|
1016 Extbyte *lfftiwp; \ |
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
|
1017 \ |
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
|
1018 LOCAL_FILE_FORMAT_TO_TSTR (path, lfftiwp); \ |
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
|
1019 TSTR_TO_C_STRING (lfftiwp, 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
|
1020 } \ |
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
|
1021 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
|
1022 #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
|
1023 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
|
1024 Extbyte *iwtlffp; \ |
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
|
1025 C_STRING_TO_TSTR (path, iwtlffp); \ |
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
|
1026 TSTR_TO_LOCAL_FILE_FORMAT (iwtlffp, pathout); \ |
442 | 1027 } 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
|
1028 #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
|
1029 #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
|
1030 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
|
1031 /* 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
|
1032 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
|
1033 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
|
1034 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
|
1035 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
|
1036 is ASCII-compatible, and so these functions will work fine with \ |
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
|
1037 this 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
|
1038 Ibyte *lfftiwp = (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
|
1039 if (isalpha (lfftiwp[0]) && (IS_DEVICE_SEP (lfftiwp[1]))) \ |
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
|
1040 pathout = lfftiwp; \ |
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
|
1041 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
|
1042 { \ |
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
|
1043 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
|
1044 cygwin_posix_to_win32_path_list_buf_size ((char *) lfftiwp); \ |
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
|
1045 pathout = alloca_ibytes (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
|
1046 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
|
1047 } \ |
442 | 1048 } 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
|
1049 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \ |
593 | 1050 do { \ |
867 | 1051 Ibyte *wtlff1 = (path); \ |
593 | 1052 int wtlff2 = \ |
1053 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \ | |
2367 | 1054 Ibyte *wtlff3 = alloca_ibytes (wtlff2); \ |
593 | 1055 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \ |
771 | 1056 (pathout) = wtlff3; \ |
442 | 1057 } 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
|
1058 #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
|
1059 #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
|
1060 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
|
1061 (pathout) = (path); \ |
442 | 1062 } 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
|
1063 #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
|
1064 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
|
1065 (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
|
1066 } 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
|
1067 #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
|
1068 |
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
|
1069 Lisp_Object tstr_to_local_file_format (Extbyte *pathout); |
442 | 1070 |
826 | 1071 /* Convert a local-format file name or URL in internal format into a Win32 |
1072 file name or URL in tstr format. */ | |
1073 | |
1074 #ifdef CYGWIN | |
1075 | |
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
|
1076 #define LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \ |
2526 | 1077 do \ |
1078 { \ | |
1079 Ibyte *lffmutt_fname1; \ | |
1080 Ibyte *lffmutt_pathint = XSTRING_DATA (lispstr); \ | |
1081 \ | |
1082 if ((lffmutt_fname1 = qxestrchr (lffmutt_pathint, ':')) != NULL \ | |
1083 && *++lffmutt_fname1 == '/' && *++lffmutt_fname1 == '/') \ | |
1084 { \ | |
1085 /* If URL style file, the innards may have Cygwin mount points and \ | |
1086 the like. so separate out the innards, process them, and put back \ | |
1087 together. */ \ | |
1088 if (qxestrncasecmp_ascii (lffmutt_pathint, "file://", 7) == 0) \ | |
1089 { \ | |
1090 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
|
1091 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
|
1092 lffmutt_path1); \ |
2526 | 1093 if (lffmutt_path1 == lffmutt_pathint + 7) /* Optimization */ \ |
1094 lffmutt_path2 = lffmutt_pathint; \ | |
1095 else \ | |
1096 { \ | |
867 | 1097 lffmutt_path2 = alloca_ibytes (7 + qxestrlen (lffmutt_path1) \ |
2526 | 1098 + 1); \ |
1099 qxestrncpy (lffmutt_path2, lffmutt_pathint, 7); \ | |
1100 qxestrcpy (lffmutt_path2 + 7, lffmutt_path1); \ | |
1101 } \ | |
1102 C_STRING_TO_TSTR (lffmutt_path2, pathout); \ | |
1103 } \ | |
1104 else \ | |
1105 /* A straight URL, just convert */ \ | |
1106 LISP_STRING_TO_TSTR (lispstr, pathout); \ | |
1107 } \ | |
1108 else \ | |
1109 /* 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
|
1110 LISP_LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout); \ |
826 | 1111 } while (0) |
1112 | |
1113 #else /* not CYGWIN */ | |
1114 | |
1115 /* 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
|
1116 #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
|
1117 LISP_LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout) |
826 | 1118 |
1119 #endif /* not CYGWIN */ | |
1120 | |
1121 | |
867 | 1122 Ibyte *urlify_filename (Ibyte *filename); |
1123 Ibyte *mswindows_canonicalize_filename (Ibyte *name); | |
771 | 1124 #define MSWINDOWS_NORMALIZE_FILENAME(name) \ |
867 | 1125 IBYTE_STRING_TO_ALLOCA (mswindows_canonicalize_filename (name), name) |
771 | 1126 |
1127 /* ------------------- Functions needed dynamic binding ------------------- */ | |
1128 | |
1129 typedef BOOL (WINAPI *pfSwitchToThread_t) (VOID); | |
1130 | |
1131 typedef NET_API_STATUS (NET_API_FUNCTION *pfNetUserEnum_t) | |
1132 (LPCWSTR, DWORD, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, LPDWORD); | |
1133 typedef NET_API_STATUS (NET_API_FUNCTION *pfNetApiBufferFree_t) (LPVOID); | |
1134 | |
1135 extern pfSwitchToThread_t xSwitchToThread; | |
1136 | |
1137 extern pfNetUserEnum_t xNetUserEnum; | |
1138 extern pfNetApiBufferFree_t xNetApiBufferFree; | |
1139 | |
1140 /* --------- Useful routines for manipulating memory-mapped files -------- */ | |
1141 | |
1142 typedef struct file_data | |
1143 { | |
867 | 1144 const Ibyte *name; |
771 | 1145 unsigned long size; |
1146 HANDLE file; | |
1147 HANDLE file_mapping; | |
1148 void *file_base; | |
1149 } file_data; | |
1150 | |
1151 #define OFFSET_TO_RVA(var,section) \ | |
1152 (section->VirtualAddress + \ | |
1153 ((DWORD)(var) - section->PointerToRawData)) | |
1154 | |
1155 #define RVA_TO_OFFSET(var,section) \ | |
1156 (section->PointerToRawData + \ | |
1157 ((DWORD)(var) - section->VirtualAddress)) | |
442 | 1158 |
771 | 1159 #define RVA_TO_PTR(var,section,filedata) \ |
1160 ((void *)(RVA_TO_OFFSET(var,section) + \ | |
1161 (char *)(filedata).file_base)) | |
1162 | |
867 | 1163 int open_input_file (file_data *p_file, const Ibyte *name); |
1164 int open_output_file (file_data *p_file, const Ibyte *name, | |
771 | 1165 unsigned long size); |
1166 void close_file_data (file_data *p_file); | |
1167 | |
1168 /* ------------------------- Heap related stuff ------------------------- */ | |
1169 | |
1170 #ifdef WIN32_NATIVE | |
442 | 1171 |
771 | 1172 #define get_reserved_heap_size() reserved_heap_size |
1173 #define get_committed_heap_size() (get_data_end () - get_data_start ()) | |
1174 #define get_heap_start() get_data_start () | |
1175 #define get_heap_end() get_data_end () | |
1176 #define get_page_size() sysinfo_cache.dwPageSize | |
1177 #define get_allocation_unit() sysinfo_cache.dwAllocationGranularity | |
1178 #define get_processor_type() sysinfo_cache.dwProcessorType | |
1179 #define get_nt_major_version() nt_major_version | |
1180 #define get_nt_minor_version() nt_minor_version | |
1181 | |
814 | 1182 unsigned char *get_data_start (void); |
1183 unsigned char *get_data_end (void); | |
771 | 1184 extern unsigned long data_region_size; |
1185 extern unsigned long reserved_heap_size; | |
1186 extern SYSTEM_INFO sysinfo_cache; | |
1187 extern int nt_major_version; | |
1188 extern int nt_minor_version; | |
1189 | |
1190 /* To prevent zero-initialized variables from being placed into the bss | |
1191 section, use non-zero values to represent an uninitialized state. */ | |
1192 #define UNINIT_PTR ((unsigned char*) 0xF0A0F0A0) | |
1193 #define UNINIT_LONG (0xF0A0F0A0L) | |
1194 | |
1195 /* Recreate the heap created during dumping. */ | |
814 | 1196 void recreate_heap (Extbyte *executable_path); |
771 | 1197 |
1198 /* Round the heap to this size. */ | |
814 | 1199 void round_heap (unsigned long size); |
771 | 1200 |
1201 /* Load in the dumped .bss section. */ | |
814 | 1202 void read_in_bss (Extbyte *name); |
771 | 1203 |
1204 /* Map in the dumped heap. */ | |
814 | 1205 void map_in_heap (Extbyte *name); |
771 | 1206 |
1207 /* Cache system info, e.g., the NT page size. */ | |
814 | 1208 void cache_system_info (void); |
771 | 1209 |
1210 /* Round ADDRESS up to be aligned with ALIGN. */ | |
814 | 1211 unsigned char *round_to_next (unsigned char *address, |
1212 unsigned long align); | |
771 | 1213 #endif /* WIN32_NATIVE */ |
1214 | |
1215 /* ------------------------- Misc prototypes ------------------------- */ | |
1216 | |
1217 #ifdef WIN32_NATIVE | |
1218 DECLARE_INLINE_HEADER (int strcasecmp (const char *a, const char *b)) | |
1219 { | |
867 | 1220 return qxestrcasecmp ((const Ibyte *) a, (const Ibyte *) b); |
771 | 1221 } |
1222 #endif /* WIN32_NATIVE */ | |
442 | 1223 |
771 | 1224 /* in nt.c */ |
867 | 1225 int mswindows_access (const Ibyte *path, int mode); |
3025 | 1226 int mswindows_link (const Ibyte *old, const Ibyte *new_); |
867 | 1227 int mswindows_rename (const Ibyte *oldname, const Ibyte *newname); |
1228 int mswindows_unlink (const Ibyte *path); | |
1229 int mswindows_stat (const Ibyte *path, struct stat *buf); | |
771 | 1230 int mswindows_fstat (int desc, struct stat *buf); |
1231 time_t mswindows_convert_time (FILETIME ft); | |
1204 | 1232 int mswindows_is_executable (const Ibyte *filename); |
1233 void mswindows_executable_type (const Ibyte *filename, int *is_dos_app, | |
1234 int *is_cygnus_app); | |
867 | 1235 Ibyte *mswindows_getdcwd (int drivelet); |
771 | 1236 |
872 | 1237 /* in process-nt.c */ |
771 | 1238 extern int mswindows_compare_env (const void *strp1, const void *strp2); |
1239 | |
1240 /* in win32.c */ | |
814 | 1241 Extbyte *mswindows_get_module_file_name (void); |
771 | 1242 void mswindows_output_last_error (char *frob); |
1243 DECLARE_DOESNT_RETURN (mswindows_report_process_error (const char *string, | |
1244 Lisp_Object data, | |
1245 int errnum)); | |
1246 Lisp_Object mswindows_lisp_error (int errnum); | |
2526 | 1247 Ibyte *mswindows_read_link (const Ibyte *fname); |
771 | 1248 |
872 | 1249 /* in intl-win32.c */ |
1250 extern Lisp_Object Qmswindows_tstr, Qmswindows_unicode; | |
1251 extern Lisp_Object Qmswindows_multibyte, Qmswindows_multibyte_to_unicode; | |
1252 | |
442 | 1253 #endif /* INCLUDED_syswindows_h_ */ |