Mercurial > hg > xemacs-beta
annotate src/syswindows.h @ 4981:4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
-------------------- ChangeLog entries follow: --------------------
modules/ChangeLog addition:
2010-02-05 Ben Wing <ben@xemacs.org>
* postgresql/postgresql.c:
* postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
* postgresql/postgresql.c (Fpq_connectdb):
* postgresql/postgresql.c (Fpq_connect_start):
* postgresql/postgresql.c (Fpq_lo_import):
* postgresql/postgresql.c (Fpq_lo_export):
* ldap/eldap.c (Fldap_open):
* ldap/eldap.c (Fldap_search_basic):
* ldap/eldap.c (Fldap_add):
* ldap/eldap.c (Fldap_modify):
* ldap/eldap.c (Fldap_delete):
* canna/canna_api.c (Fcanna_initialize):
* canna/canna_api.c (Fcanna_store_yomi):
* canna/canna_api.c (Fcanna_parse):
* canna/canna_api.c (Fcanna_henkan_begin):
EXTERNAL_TO_C_STRING returns its argument instead of storing it
in a parameter, and is renamed to EXTERNAL_TO_ITEXT. Similar
things happen to related macros. See entry in src/ChangeLog.
More Mule-izing of postgresql.c. Extract out common code
between `pq-connectdb' and `pq-connect-start'. Fix places
that signal an error string using a formatted string to instead
follow the standard and have a fixed reason followed by the
particular error message stored as one of the frobs.
src/ChangeLog addition:
2010-02-05 Ben Wing <ben@xemacs.org>
* console-msw.c (write_string_to_mswindows_debugging_output):
* console-msw.c (Fmswindows_message_box):
* console-x.c (x_perhaps_init_unseen_key_defaults):
* console.c:
* database.c (dbm_get):
* database.c (dbm_put):
* database.c (dbm_remove):
* database.c (berkdb_get):
* database.c (berkdb_put):
* database.c (berkdb_remove):
* database.c (Fopen_database):
* device-gtk.c (gtk_init_device):
* device-msw.c (msprinter_init_device_internal):
* device-msw.c (msprinter_default_printer):
* device-msw.c (msprinter_init_device):
* device-msw.c (sync_printer_with_devmode):
* device-msw.c (Fmsprinter_select_settings):
* device-x.c (sanity_check_geometry_resource):
* device-x.c (Dynarr_add_validified_lisp_string):
* device-x.c (x_init_device):
* device-x.c (Fx_put_resource):
* device-x.c (Fx_valid_keysym_name_p):
* device-x.c (Fx_set_font_path):
* dialog-msw.c (push_lisp_string_as_unicode):
* dialog-msw.c (handle_directory_dialog_box):
* dialog-msw.c (handle_file_dialog_box):
* dialog-x.c (dbox_descriptor_to_widget_value):
* editfns.c (Fformat_time_string):
* editfns.c (Fencode_time):
* editfns.c (Fset_time_zone_rule):
* emacs.c (make_argc_argv):
* emacs.c (Fdump_emacs):
* emodules.c (emodules_load):
* eval.c:
* eval.c (maybe_signal_error_1):
* event-msw.c (Fdde_alloc_advise_item):
* event-msw.c (mswindows_dde_callback):
* event-msw.c (mswindows_wnd_proc):
* fileio.c (report_error_with_errno):
* fileio.c (Fsysnetunam):
* fileio.c (Fdo_auto_save):
* font-mgr.c (extract_fcapi_string):
* font-mgr.c (Ffc_config_app_font_add_file):
* font-mgr.c (Ffc_config_app_font_add_dir):
* font-mgr.c (Ffc_config_filename):
* frame-gtk.c (gtk_set_frame_text_value):
* frame-gtk.c (gtk_create_widgets):
* frame-msw.c (mswindows_init_frame_1):
* frame-msw.c (mswindows_set_title_from_ibyte):
* frame-msw.c (msprinter_init_frame_3):
* frame-x.c (x_set_frame_text_value):
* frame-x.c (x_set_frame_properties):
* frame-x.c (start_drag_internal_1):
* frame-x.c (x_cde_transfer_callback):
* frame-x.c (x_create_widgets):
* glyphs-eimage.c (my_jpeg_output_message):
* glyphs-eimage.c (jpeg_instantiate):
* glyphs-eimage.c (gif_instantiate):
* glyphs-eimage.c (png_instantiate):
* glyphs-eimage.c (tiff_instantiate):
* glyphs-gtk.c (xbm_instantiate_1):
* glyphs-gtk.c (gtk_xbm_instantiate):
* glyphs-gtk.c (gtk_xpm_instantiate):
* glyphs-gtk.c (gtk_xface_instantiate):
* glyphs-gtk.c (cursor_font_instantiate):
* glyphs-gtk.c (gtk_redisplay_widget):
* glyphs-gtk.c (gtk_widget_instantiate_1):
* glyphs-gtk.c (gtk_add_tab_item):
* glyphs-msw.c (mswindows_xpm_instantiate):
* glyphs-msw.c (bmp_instantiate):
* glyphs-msw.c (mswindows_resource_instantiate):
* glyphs-msw.c (xbm_instantiate_1):
* glyphs-msw.c (mswindows_xbm_instantiate):
* glyphs-msw.c (mswindows_xface_instantiate):
* glyphs-msw.c (mswindows_redisplay_widget):
* glyphs-msw.c (mswindows_widget_instantiate):
* glyphs-msw.c (add_tree_item):
* glyphs-msw.c (add_tab_item):
* glyphs-msw.c (mswindows_combo_box_instantiate):
* glyphs-msw.c (mswindows_widget_query_string_geometry):
* glyphs-x.c (x_locate_pixmap_file):
* glyphs-x.c (xbm_instantiate_1):
* glyphs-x.c (x_xbm_instantiate):
* glyphs-x.c (extract_xpm_color_names):
* glyphs-x.c (x_xpm_instantiate):
* glyphs-x.c (x_xface_instantiate):
* glyphs-x.c (autodetect_instantiate):
* glyphs-x.c (safe_XLoadFont):
* glyphs-x.c (cursor_font_instantiate):
* glyphs-x.c (x_redisplay_widget):
* glyphs-x.c (Fchange_subwindow_property):
* glyphs-x.c (x_widget_instantiate):
* glyphs-x.c (x_tab_control_redisplay):
* glyphs.c (pixmap_to_lisp_data):
* gui-x.c (menu_separator_style_and_to_external):
* gui-x.c (add_accel_and_to_external):
* gui-x.c (button_item_to_widget_value):
* hpplay.c (player_error_internal):
* hpplay.c (play_sound_file):
* hpplay.c (play_sound_data):
* intl.c (Fset_current_locale):
* lisp.h:
* menubar-gtk.c (gtk_xemacs_set_accel_keys):
* menubar-msw.c (populate_menu_add_item):
* menubar-msw.c (populate_or_checksum_helper):
* menubar-x.c (menu_item_descriptor_to_widget_value_1):
* nt.c (init_user_info):
* nt.c (get_long_basename):
* nt.c (nt_get_resource):
* nt.c (init_mswindows_environment):
* nt.c (get_cached_volume_information):
* nt.c (mswindows_readdir):
* nt.c (read_unc_volume):
* nt.c (mswindows_stat):
* nt.c (mswindows_getdcwd):
* nt.c (mswindows_executable_type):
* nt.c (Fmswindows_short_file_name):
* ntplay.c (nt_play_sound_file):
* objects-gtk.c:
* objects-gtk.c (gtk_valid_color_name_p):
* objects-gtk.c (gtk_initialize_font_instance):
* objects-gtk.c (gtk_font_list):
* objects-msw.c (font_enum_callback_2):
* objects-msw.c (parse_font_spec):
* objects-x.c (x_parse_nearest_color):
* objects-x.c (x_valid_color_name_p):
* objects-x.c (x_initialize_font_instance):
* objects-x.c (x_font_instance_truename):
* objects-x.c (x_font_list):
* objects-xlike-inc.c (XFUN):
* objects-xlike-inc.c (xft_find_charset_font):
* process-nt.c (mswindows_report_winsock_error):
* process-nt.c (nt_create_process):
* process-nt.c (get_internet_address):
* process-nt.c (nt_open_network_stream):
* process-unix.c:
* process-unix.c (allocate_pty):
* process-unix.c (get_internet_address):
* process-unix.c (unix_canonicalize_host_name):
* process-unix.c (unix_open_network_stream):
* realpath.c:
* select-common.h (lisp_data_to_selection_data):
* select-gtk.c (symbol_to_gtk_atom):
* select-gtk.c (atom_to_symbol):
* select-msw.c (symbol_to_ms_cf):
* select-msw.c (mswindows_register_selection_data_type):
* select-x.c (symbol_to_x_atom):
* select-x.c (x_atom_to_symbol):
* select-x.c (hack_motif_clipboard_selection):
* select-x.c (Fx_store_cutbuffer_internal):
* sound.c (Fplay_sound_file):
* sound.c (Fplay_sound):
* sound.h (sound_perror):
* sysdep.c:
* sysdep.c (qxe_allocating_getcwd):
* sysdep.c (qxe_execve):
* sysdep.c (copy_in_passwd):
* sysdep.c (qxe_getpwnam):
* sysdep.c (qxe_ctime):
* sysdll.c (dll_open):
* sysdll.c (dll_function):
* sysdll.c (dll_variable):
* sysdll.c (search_linked_libs):
* sysdll.c (dll_error):
* sysfile.h:
* sysfile.h (PATHNAME_CONVERT_OUT_TSTR):
* sysfile.h (PATHNAME_CONVERT_OUT_UTF_8):
* sysfile.h (PATHNAME_CONVERT_OUT):
* sysfile.h (LISP_PATHNAME_CONVERT_OUT):
* syswindows.h (ITEXT_TO_TSTR):
* syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR):
* syswindows.h (TSTR_TO_LOCAL_FILE_FORMAT):
* syswindows.h (LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN):
* syswindows.h (LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR):
* text.h:
* text.h (eicpy_ext_len):
* text.h (enum new_dfc_src_type):
* text.h (EXTERNAL_TO_ITEXT):
* text.h (GET_STRERROR):
* tooltalk.c (check_status):
* tooltalk.c (Fadd_tooltalk_message_arg):
* tooltalk.c (Fadd_tooltalk_pattern_attribute):
* tooltalk.c (Fadd_tooltalk_pattern_arg):
* win32.c (tstr_to_local_file_format):
* win32.c (mswindows_lisp_error_1):
* win32.c (mswindows_report_process_error):
* win32.c (Fmswindows_shell_execute):
* win32.c (mswindows_read_link_1):
Changes involving external/internal format conversion,
mostly code cleanup and renaming.
1. Eliminate the previous macros like LISP_STRING_TO_EXTERNAL
that stored its result in a parameter. The new version of
LISP_STRING_TO_EXTERNAL returns its result through the
return value, same as the previous NEW_LISP_STRING_TO_EXTERNAL.
Use the new-style macros throughout the code.
2. Rename C_STRING_TO_EXTERNAL and friends to ITEXT_TO_EXTERNAL,
in keeping with overall naming rationalization involving
Itext and related types.
Macros involved in previous two:
EXTERNAL_TO_C_STRING -> EXTERNAL_TO_ITEXT
EXTERNAL_TO_C_STRING_MALLOC -> EXTERNAL_TO_ITEXT_MALLOC
SIZED_EXTERNAL_TO_C_STRING -> SIZED_EXTERNAL_TO_ITEXT
SIZED_EXTERNAL_TO_C_STRING_MALLOC -> SIZED_EXTERNAL_TO_ITEXT_MALLOC
C_STRING_TO_EXTERNAL -> ITEXT_TO_EXTERNAL
C_STRING_TO_EXTERNAL_MALLOC -> ITEXT_TO_EXTERNAL_MALLOC
LISP_STRING_TO_EXTERNAL
LISP_STRING_TO_EXTERNAL_MALLOC
LISP_STRING_TO_TSTR
C_STRING_TO_TSTR -> ITEXT_TO_TSTR
TSTR_TO_C_STRING -> TSTR_TO_ITEXT
The following four still return their values through parameters,
since they have more than one value to return:
C_STRING_TO_SIZED_EXTERNAL -> ITEXT_TO_SIZED_EXTERNAL
LISP_STRING_TO_SIZED_EXTERNAL
C_STRING_TO_SIZED_EXTERNAL_MALLOC -> ITEXT_TO_SIZED_EXTERNAL_MALLOC
LISP_STRING_TO_SIZED_EXTERNAL_MALLOC
Sometimes additional casts had to be inserted, since the old
macros played strange games and completely defeated the type system
of the store params.
3. Rewrite many places where direct calls to TO_EXTERNAL_FORMAT
occurred with calls to one of the convenience macros listed above,
or to make_extstring().
4. Eliminate SIZED_C_STRING macros (they were hardly used, anyway)
and use a direct call to TO_EXTERNAL_FORMAT or TO_INTERNAL_FORMAT.
4. Use LISP_PATHNAME_CONVERT_OUT in many places instead of something
like LISP_STRING_TO_EXTERNAL(..., Qfile_name).
5. Eliminate some temporary variables that are no longer necessary
now that we return a value rather than storing it into a variable.
6. Some Mule-izing in database.c.
7. Error functions:
-- A bit of code cleanup in maybe_signal_error_1.
-- Eliminate report_file_type_error; it's just an alias for
signal_error_2 with params in a different order.
-- Fix some places in the hostname-handling code that directly
inserted externally-retrieved error strings into the
supposed ASCII "reason" param instead of doing the right thing
and sticking text descriptive of what was going on in "reason"
and putting the external message in a frob.
8. Use Ascbyte instead of CIbyte in process-unix.c and maybe one
or two other places.
9. Some code cleanup in copy_in_passwd() in sysdep.c.
10. Fix a real bug due to accidental variable shadowing in
tstr_to_local_file_format() in win32.c.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Fri, 05 Feb 2010 11:02:24 -0600 |
parents | bd169a24a554 |
children | 4cfb6aeb989d |
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 |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
847 #define ITEXT_TO_TSTR(in) ITEXT_TO_EXTERNAL (in, Qmswindows_tstr) |
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
848 #define LISP_STRING_TO_TSTR(in) LISP_STRING_TO_EXTERNAL (in, Qmswindows_tstr) |
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
849 #define TSTR_TO_ITEXT(in) EXTERNAL_TO_ITEXT (in, Qmswindows_tstr) |
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
850 #define TSTR_TO_ITEXT_MALLOC(in) \ |
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
851 EXTERNAL_TO_ITEXT_MALLOC (in, Qmswindows_tstr) |
771 | 852 |
853 #define build_tstr_string(in) \ | |
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
4952
diff
changeset
|
854 make_extstring (in, qxetcsbytelen ((Extbyte *) in), Qmswindows_tstr) |
771 | 855 |
856 #define MAX_ANSI_CHAR_LEN 1 | |
857 #define MAX_UNICODE_CHAR_LEN 2 | |
858 | |
859 DECLARE_INLINE_HEADER (int ansi_char_to_text (int ch, Extbyte *t)) | |
860 { | |
861 ch &= 0xFF; | |
862 t[0] = ch; | |
863 return 1; | |
864 } | |
865 | |
866 DECLARE_INLINE_HEADER (int unicode_char_to_text (int ch, Extbyte *t)) | |
867 { | |
868 t[0] = ch & 0xFF; | |
869 t[1] = (ch >> 8) & 0xFF; | |
870 return 2; | |
871 } | |
442 | 872 |
771 | 873 Extbyte *convert_multibyte_to_unicode_malloc (const Extbyte *src, |
874 Bytecount n, | |
875 int cp, Bytecount *size_out); | |
2367 | 876 Extbyte *convert_unicode_to_multibyte_malloc (const Extbyte *src, |
877 Bytecount n, | |
878 int cp, Bytecount *size_out); | |
867 | 879 Ibyte *convert_multibyte_to_internal_malloc (const Extbyte *src, |
771 | 880 Bytecount n, |
881 int cp, Bytecount *size_out); | |
882 void convert_multibyte_to_unicode_dynarr (const Extbyte *src, Bytecount n, | |
883 int cp, unsigned_char_dynarr *dst); | |
2367 | 884 void convert_unicode_to_multibyte_dynarr (const Extbyte *src, Bytecount n, |
885 int cp, unsigned_char_dynarr *dst); | |
886 | |
887 Bytecount unicode_multibyte_convert_size (const char *srctext, const void *src, | |
888 Bytecount src_size, int to_unicode, | |
889 int cp); | |
890 void *unicode_multibyte_convert_copy_data (const char *srctext, | |
891 void *alloca_data); | |
892 | |
893 /* NOTE: If you make two invocations of the following functions in the same | |
894 subexpression and use the exact same expression for the source in both | |
895 cases, you will lose. In this unlikely case, you may get an abort, and | |
896 need to rewrite the code. | |
897 | |
898 We need to use ALLOCA_FUNCALL_OK here, see NEW_DFC in text.h. | |
899 */ | |
900 | |
901 #ifdef WEXTTEXT_IS_WIDE | |
902 #define MULTIBYTE_TO_WEXTTEXT(str) \ | |
903 ((Wexttext *) \ | |
904 unicode_multibyte_convert_copy_data \ | |
905 (#str, ALLOCA_FUNCALL_OK (unicode_multibyte_convert_size \ | |
906 (#str, str, strlen (str) + 1, 1, CP_ACP)))) | |
907 | |
908 #define WEXTTEXT_TO_MULTIBYTE(str) \ | |
909 ((Extbyte *) \ | |
910 unicode_multibyte_convert_copy_data \ | |
911 (#str, ALLOCA_FUNCALL_OK (unicode_multibyte_convert_size \ | |
912 (#str, str, \ | |
913 (wcslen (str) + 1) * sizeof (WCHAR), 0, \ | |
914 CP_ACP)))) | |
915 #else | |
916 #define MULTIBYTE_TO_WEXTTEXT(str) ((Wexttext *) (str)) | |
917 #define WEXTTEXT_TO_MULTIBYTE(str) ((Extbyte *) (str)) | |
918 #endif | |
919 | |
920 /* #### mbstowcs() uses MB_ERR_INVALID_CHARS in addition to MB_PRECOMPOSED. | |
921 Should we do this? But then we have to handle errors. | |
922 #### Do we already check for invalid sequences in the coding system? */ | |
923 #define MBTOWC_OPTIONS MB_PRECOMPOSED /* | MB_ERR_INVALID_CHARS */ | |
924 /* The following options are what wcstombs() uses in the CRT. It uses | |
925 NULL in place of "~". */ | |
926 #define WCTOMB_OPTIONS WC_COMPOSITECHECK | WC_SEPCHARS | |
927 #define WCTOMB_INVALID_STRING "~" | |
771 | 928 |
929 /* ------------------------- Other Mule stuff ------------------------- */ | |
930 | |
931 LCID mswindows_current_locale (void); | |
932 int mswindows_locale_to_code_page (LCID lcid); | |
933 int mswindows_locale_to_oem_code_page (LCID lcid); | |
934 | |
935 /* ------------------------- Filename conversion ------------------------- */ | |
936 | |
937 #ifdef CYGWIN | |
1743 | 938 |
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
|
939 /* We should just remove the Windows 9x support */ |
1743 | 940 |
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
|
941 #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
|
942 (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
|
943 #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
|
944 (XEUNICODE_P ? CCP_WIN_W_TO_POSIX : CCP_WIN_A_TO_POSIX) |
1743 | 945 |
771 | 946 #endif |
947 | |
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
|
948 #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
|
949 #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
|
950 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
|
951 const Ibyte *lfftt = (path); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
952 const Extbyte **lffttout = (const Extbyte **) &(out); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
953 if (isalpha (lfftt[0]) && (IS_DEVICE_SEP (lfftt[1]))) \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
954 PATHNAME_CONVERT_OUT_TSTR (lfftt, *lffttout); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
955 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
|
956 { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.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 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
|
958 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
|
959 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
|
960 \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.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 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
|
962 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
|
963 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
|
964 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
|
965 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
|
966 lfftt_utf8_path, lfftt_tstr_path, lfftt_size); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
967 *lffttout = lfftt_tstr_path; \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
968 } \ |
442 | 969 } 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
|
970 #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
|
971 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
|
972 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
|
973 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
|
974 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
|
975 \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.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 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
|
977 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
|
978 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
|
979 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
|
980 ttlff, ttlff_utf8_path, ttlff_size); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
981 (out) = EXTERNAL_TO_ITEXT (ttlff_utf8_path, Qutf_8); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
982 } 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
|
983 #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
|
984 #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
|
985 do { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
986 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
|
987 \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.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 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
|
989 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
|
990 } 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
|
991 #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
|
992 do { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
993 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
|
994 \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
995 ttlff = TSTR_TO_ITEXT (path); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
996 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
|
997 } 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
|
998 #endif /* (not) HAVE_CYGWIN_CONV_PATH */ |
442 | 999 |
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
|
1000 #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
|
1001 LOCAL_FILE_FORMAT_TO_TSTR (XSTRING_DATA (path), out) |
826 | 1002 /* Convert from local file format, as used in XEmacs, to valid win32 |
1003 filenames as can be given to Windows API routines. Under native XEmacs, | |
1004 this is a no-op, but under Cygwin, the local names look different -- | |
1005 Cygwin mount points, forward slashes, etc. Currently, under Cygwin, we | |
1006 actually allow local names to be of both formats, i.e. Cygwin or Win32 | |
1007 native. So we check to see if we have Win32 native already (a cheesy | |
1008 check, look for letter plus colon at beginning of name) and do nothing | |
1009 in that case. */ | |
1010 | |
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
|
1011 #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
|
1012 /* 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
|
1013 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
|
1014 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
|
1015 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
|
1016 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
|
1017 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
|
1018 #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
|
1019 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
|
1020 { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1021 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
|
1022 \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.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 LOCAL_FILE_FORMAT_TO_TSTR (path, lfftiwp); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1024 (pathout) = TSTR_TO_ITEXT (lfftiwp); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1025 } \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.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 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
|
1027 #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
|
1028 do { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1029 const Extbyte *iwtlffp; \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1030 iwtlffp = ITEXT_TO_TSTR (path); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1031 TSTR_TO_LOCAL_FILE_FORMAT (iwtlffp, pathout); \ |
442 | 1032 } 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
|
1033 #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
|
1034 #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
|
1035 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
|
1036 /* 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
|
1037 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
|
1038 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
|
1039 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
|
1040 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
|
1041 is ASCII-compatible, and so these functions will work fine with \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1042 this data (maybe ... not when Cygwin uses UTF-8) */ \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1043 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
|
1044 if (isalpha (lfftiwp[0]) && (IS_DEVICE_SEP (lfftiwp[1]))) \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1045 (pathout) = lfftiwp; \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1046 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
|
1047 { \ |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.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 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
|
1049 cygwin_posix_to_win32_path_list_buf_size ((char *) lfftiwp); \ |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1050 (pathout) = alloca_ibytes (lfftiw2); \ |
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
4827
diff
changeset
|
1051 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
|
1052 } \ |
442 | 1053 } 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
|
1054 #define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout) \ |
593 | 1055 do { \ |
4867
7822019c5d98
Revert cast in check_writable() and fix up macros to use const.
Vin Shelton <acs@xemacs.org>
parents:
4858
diff
changeset
|
1056 const Ibyte *wtlff1 = (path); \ |
593 | 1057 int wtlff2 = \ |
1058 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \ | |
2367 | 1059 Ibyte *wtlff3 = alloca_ibytes (wtlff2); \ |
593 | 1060 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \ |
771 | 1061 (pathout) = wtlff3; \ |
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 #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
|
1064 #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
|
1065 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
|
1066 (pathout) = (path); \ |
442 | 1067 } 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
|
1068 #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
|
1069 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
|
1070 (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
|
1071 } 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
|
1072 #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
|
1073 |
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.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 Lisp_Object tstr_to_local_file_format (Extbyte *pathout); |
442 | 1075 |
826 | 1076 /* Convert a local-format file name or URL in internal format into a Win32 |
1077 file name or URL in tstr format. */ | |
1078 | |
1079 #ifdef CYGWIN | |
1080 | |
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
|
1081 #define LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \ |
2526 | 1082 do \ |
1083 { \ | |
1084 Ibyte *lffmutt_fname1; \ | |
1085 Ibyte *lffmutt_pathint = XSTRING_DATA (lispstr); \ | |
1086 \ | |
1087 if ((lffmutt_fname1 = qxestrchr (lffmutt_pathint, ':')) != NULL \ | |
1088 && *++lffmutt_fname1 == '/' && *++lffmutt_fname1 == '/') \ | |
1089 { \ | |
1090 /* If URL style file, the innards may have Cygwin mount points and \ | |
1091 the like. so separate out the innards, process them, and put back \ | |
1092 together. */ \ | |
1093 if (qxestrncasecmp_ascii (lffmutt_pathint, "file://", 7) == 0) \ | |
1094 { \ | |
1095 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
|
1096 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
|
1097 lffmutt_path1); \ |
2526 | 1098 if (lffmutt_path1 == lffmutt_pathint + 7) /* Optimization */ \ |
1099 lffmutt_path2 = lffmutt_pathint; \ | |
1100 else \ | |
1101 { \ | |
867 | 1102 lffmutt_path2 = alloca_ibytes (7 + qxestrlen (lffmutt_path1) \ |
2526 | 1103 + 1); \ |
1104 qxestrncpy (lffmutt_path2, lffmutt_pathint, 7); \ | |
1105 qxestrcpy (lffmutt_path2 + 7, lffmutt_path1); \ | |
1106 } \ | |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1107 (pathout) = ITEXT_TO_TSTR (lffmutt_path2); \ |
2526 | 1108 } \ |
1109 else \ | |
1110 /* A straight URL, just convert */ \ | |
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4959
diff
changeset
|
1111 (pathout) = LISP_STRING_TO_TSTR (lispstr); \ |
2526 | 1112 } \ |
1113 else \ | |
1114 /* 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
|
1115 LISP_LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout); \ |
826 | 1116 } while (0) |
1117 | |
1118 #else /* not CYGWIN */ | |
1119 | |
1120 /* 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
|
1121 #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
|
1122 LISP_LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout) |
826 | 1123 |
1124 #endif /* not CYGWIN */ | |
1125 | |
1126 | |
867 | 1127 Ibyte *urlify_filename (Ibyte *filename); |
1128 Ibyte *mswindows_canonicalize_filename (Ibyte *name); | |
771 | 1129 #define MSWINDOWS_NORMALIZE_FILENAME(name) \ |
867 | 1130 IBYTE_STRING_TO_ALLOCA (mswindows_canonicalize_filename (name), name) |
771 | 1131 |
1132 /* ------------------- Functions needed dynamic binding ------------------- */ | |
1133 | |
1134 typedef BOOL (WINAPI *pfSwitchToThread_t) (VOID); | |
1135 | |
1136 typedef NET_API_STATUS (NET_API_FUNCTION *pfNetUserEnum_t) | |
1137 (LPCWSTR, DWORD, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, LPDWORD); | |
1138 typedef NET_API_STATUS (NET_API_FUNCTION *pfNetApiBufferFree_t) (LPVOID); | |
1139 | |
1140 extern pfSwitchToThread_t xSwitchToThread; | |
1141 | |
1142 extern pfNetUserEnum_t xNetUserEnum; | |
1143 extern pfNetApiBufferFree_t xNetApiBufferFree; | |
1144 | |
1145 /* --------- Useful routines for manipulating memory-mapped files -------- */ | |
1146 | |
1147 typedef struct file_data | |
1148 { | |
867 | 1149 const Ibyte *name; |
771 | 1150 unsigned long size; |
1151 HANDLE file; | |
1152 HANDLE file_mapping; | |
1153 void *file_base; | |
1154 } file_data; | |
1155 | |
1156 #define OFFSET_TO_RVA(var,section) \ | |
1157 (section->VirtualAddress + \ | |
1158 ((DWORD)(var) - section->PointerToRawData)) | |
1159 | |
1160 #define RVA_TO_OFFSET(var,section) \ | |
1161 (section->PointerToRawData + \ | |
1162 ((DWORD)(var) - section->VirtualAddress)) | |
442 | 1163 |
771 | 1164 #define RVA_TO_PTR(var,section,filedata) \ |
1165 ((void *)(RVA_TO_OFFSET(var,section) + \ | |
1166 (char *)(filedata).file_base)) | |
1167 | |
867 | 1168 int open_input_file (file_data *p_file, const Ibyte *name); |
1169 int open_output_file (file_data *p_file, const Ibyte *name, | |
771 | 1170 unsigned long size); |
1171 void close_file_data (file_data *p_file); | |
1172 | |
1173 /* ------------------------- Heap related stuff ------------------------- */ | |
1174 | |
1175 #ifdef WIN32_NATIVE | |
442 | 1176 |
771 | 1177 #define get_reserved_heap_size() reserved_heap_size |
1178 #define get_committed_heap_size() (get_data_end () - get_data_start ()) | |
1179 #define get_heap_start() get_data_start () | |
1180 #define get_heap_end() get_data_end () | |
1181 #define get_page_size() sysinfo_cache.dwPageSize | |
1182 #define get_allocation_unit() sysinfo_cache.dwAllocationGranularity | |
1183 #define get_processor_type() sysinfo_cache.dwProcessorType | |
1184 #define get_nt_major_version() nt_major_version | |
1185 #define get_nt_minor_version() nt_minor_version | |
1186 | |
814 | 1187 unsigned char *get_data_start (void); |
1188 unsigned char *get_data_end (void); | |
771 | 1189 extern unsigned long data_region_size; |
1190 extern unsigned long reserved_heap_size; | |
1191 extern SYSTEM_INFO sysinfo_cache; | |
1192 extern int nt_major_version; | |
1193 extern int nt_minor_version; | |
1194 | |
1195 /* To prevent zero-initialized variables from being placed into the bss | |
1196 section, use non-zero values to represent an uninitialized state. */ | |
1197 #define UNINIT_PTR ((unsigned char*) 0xF0A0F0A0) | |
1198 #define UNINIT_LONG (0xF0A0F0A0L) | |
1199 | |
1200 /* Recreate the heap created during dumping. */ | |
814 | 1201 void recreate_heap (Extbyte *executable_path); |
771 | 1202 |
1203 /* Round the heap to this size. */ | |
814 | 1204 void round_heap (unsigned long size); |
771 | 1205 |
1206 /* Load in the dumped .bss section. */ | |
814 | 1207 void read_in_bss (Extbyte *name); |
771 | 1208 |
1209 /* Map in the dumped heap. */ | |
814 | 1210 void map_in_heap (Extbyte *name); |
771 | 1211 |
1212 /* Cache system info, e.g., the NT page size. */ | |
814 | 1213 void cache_system_info (void); |
771 | 1214 |
1215 /* Round ADDRESS up to be aligned with ALIGN. */ | |
814 | 1216 unsigned char *round_to_next (unsigned char *address, |
1217 unsigned long align); | |
771 | 1218 #endif /* WIN32_NATIVE */ |
1219 | |
1220 /* ------------------------- Misc prototypes ------------------------- */ | |
1221 | |
1222 #ifdef WIN32_NATIVE | |
1223 DECLARE_INLINE_HEADER (int strcasecmp (const char *a, const char *b)) | |
1224 { | |
867 | 1225 return qxestrcasecmp ((const Ibyte *) a, (const Ibyte *) b); |
771 | 1226 } |
1227 #endif /* WIN32_NATIVE */ | |
442 | 1228 |
771 | 1229 /* in nt.c */ |
867 | 1230 int mswindows_access (const Ibyte *path, int mode); |
3025 | 1231 int mswindows_link (const Ibyte *old, const Ibyte *new_); |
867 | 1232 int mswindows_rename (const Ibyte *oldname, const Ibyte *newname); |
1233 int mswindows_unlink (const Ibyte *path); | |
1234 int mswindows_stat (const Ibyte *path, struct stat *buf); | |
771 | 1235 int mswindows_fstat (int desc, struct stat *buf); |
1236 time_t mswindows_convert_time (FILETIME ft); | |
1204 | 1237 int mswindows_is_executable (const Ibyte *filename); |
1238 void mswindows_executable_type (const Ibyte *filename, int *is_dos_app, | |
1239 int *is_cygnus_app); | |
867 | 1240 Ibyte *mswindows_getdcwd (int drivelet); |
771 | 1241 |
872 | 1242 /* in process-nt.c */ |
771 | 1243 extern int mswindows_compare_env (const void *strp1, const void *strp2); |
1244 | |
1245 /* in win32.c */ | |
814 | 1246 Extbyte *mswindows_get_module_file_name (void); |
4932 | 1247 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
|
1248 DECLARE_DOESNT_RETURN (mswindows_report_process_error (const Ascbyte *reason, |
771 | 1249 Lisp_Object data, |
1250 int errnum)); | |
1251 Lisp_Object mswindows_lisp_error (int errnum); | |
2526 | 1252 Ibyte *mswindows_read_link (const Ibyte *fname); |
771 | 1253 |
872 | 1254 /* in intl-win32.c */ |
1255 extern Lisp_Object Qmswindows_tstr, Qmswindows_unicode; | |
1256 extern Lisp_Object Qmswindows_multibyte, Qmswindows_multibyte_to_unicode; | |
1257 | |
442 | 1258 #endif /* INCLUDED_syswindows_h_ */ |