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