annotate src/syswindows.h @ 665:fdefd0186b75

[xemacs-hg @ 2001-09-20 06:28:42 by ben] The great integral types renaming. The purpose of this is to rationalize the names used for various integral types, so that they match their intended uses and follow consist conventions, and eliminate types that were not semantically different from each other. The conventions are: -- All integral types that measure quantities of anything are signed. Some people disagree vociferously with this, but their arguments are mostly theoretical, and are vastly outweighed by the practical headaches of mixing signed and unsigned values, and more importantly by the far increased likelihood of inadvertent bugs: Because of the broken "viral" nature of unsigned quantities in C (operations involving mixed signed/unsigned are done unsigned, when exactly the opposite is nearly always wanted), even a single error in declaring a quantity unsigned that should be signed, or even the even more subtle error of comparing signed and unsigned values and forgetting the necessary cast, can be catastrophic, as comparisons will yield wrong results. -Wsign-compare is turned on specifically to catch this, but this tends to result in a great number of warnings when mixing signed and unsigned, and the casts are annoying. More has been written on this elsewhere. -- All such quantity types just mentioned boil down to EMACS_INT, which is 32 bits on 32-bit machines and 64 bits on 64-bit machines. This is guaranteed to be the same size as Lisp objects of type `int', and (as far as I can tell) of size_t (unsigned!) and ssize_t. The only type below that is not an EMACS_INT is Hashcode, which is an unsigned value of the same size as EMACS_INT. -- Type names should be relatively short (no more than 10 characters or so), with the first letter capitalized and no underscores if they can at all be avoided. -- "count" == a zero-based measurement of some quantity. Includes sizes, offsets, and indexes. -- "bpos" == a one-based measurement of a position in a buffer. "Charbpos" and "Bytebpos" count text in the buffer, rather than bytes in memory; thus Bytebpos does not directly correspond to the memory representation. Use "Membpos" for this. -- "Char" refers to internal-format characters, not to the C type "char", which is really a byte. -- For the actual name changes, see the script below. I ran the following script to do the conversion. (NOTE: This script is idempotent. You can safely run it multiple times and it will not screw up previous results -- in fact, it will do nothing if nothing has changed. Thus, it can be run repeatedly as necessary to handle patches coming in from old workspaces, or old branches.) There are two tags, just before and just after the change: `pre-integral-type-rename' and `post-integral-type-rename'. When merging code from the main trunk into a branch, the best thing to do is first merge up to `pre-integral-type-rename', then apply the script and associated changes, then merge from `post-integral-type-change' to the present. (Alternatively, just do the merging in one operation; but you may then have a lot of conflicts needing to be resolved by hand.) Script `fixtypes.sh' follows: ----------------------------------- cut ------------------------------------ files="*.[ch] s/*.h m/*.h config.h.in ../configure.in Makefile.in.in ../lib-src/*.[ch] ../lwlib/*.[ch]" gr Memory_Count Bytecount $files gr Lstream_Data_Count Bytecount $files gr Element_Count Elemcount $files gr Hash_Code Hashcode $files gr extcount bytecount $files gr bufpos charbpos $files gr bytind bytebpos $files gr memind membpos $files gr bufbyte intbyte $files gr Extcount Bytecount $files gr Bufpos Charbpos $files gr Bytind Bytebpos $files gr Memind Membpos $files gr Bufbyte Intbyte $files gr EXTCOUNT BYTECOUNT $files gr BUFPOS CHARBPOS $files gr BYTIND BYTEBPOS $files gr MEMIND MEMBPOS $files gr BUFBYTE INTBYTE $files gr MEMORY_COUNT BYTECOUNT $files gr LSTREAM_DATA_COUNT BYTECOUNT $files gr ELEMENT_COUNT ELEMCOUNT $files gr HASH_CODE HASHCODE $files ----------------------------------- cut ------------------------------------ `fixtypes.sh' is a Bourne-shell script; it uses 'gr': ----------------------------------- cut ------------------------------------ #!/bin/sh # Usage is like this: # gr FROM TO FILES ... # globally replace FROM with TO in FILES. FROM and TO are regular expressions. # backup files are stored in the `backup' directory. from="$1" to="$2" shift 2 echo ${1+"$@"} | xargs global-replace "s/$from/$to/g" ----------------------------------- cut ------------------------------------ `gr' in turn uses a Perl script to do its real work, `global-replace', which follows: ----------------------------------- cut ------------------------------------ : #-*- Perl -*- ### global-modify --- modify the contents of a file by a Perl expression ## Copyright (C) 1999 Martin Buchholz. ## Copyright (C) 2001 Ben Wing. ## Authors: Martin Buchholz <martin@xemacs.org>, Ben Wing <ben@xemacs.org> ## Maintainer: Ben Wing <ben@xemacs.org> ## Current Version: 1.0, May 5, 2001 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with XEmacs; see the file COPYING. If not, write to the Free # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. eval 'exec perl -w -S $0 ${1+"$@"}' if 0; use strict; use FileHandle; use Carp; use Getopt::Long; use File::Basename; (my $myName = $0) =~ s@.*/@@; my $usage=" Usage: $myName [--help] [--backup-dir=DIR] [--line-mode] [--hunk-mode] PERLEXPR FILE ... Globally modify a file, either line by line or in one big hunk. Typical usage is like this: [with GNU print, GNU xargs: guaranteed to handle spaces, quotes, etc. in file names] find . -name '*.[ch]' -print0 | xargs -0 $0 's/\bCONST\b/const/g'\n [with non-GNU print, xargs] find . -name '*.[ch]' -print | xargs $0 's/\bCONST\b/const/g'\n The file is read in, either line by line (with --line-mode specified) or in one big hunk (with --hunk-mode specified; it's the default), and the Perl expression is then evalled with \$_ set to the line or hunk of text, including the terminating newline if there is one. It should destructively modify the value there, storing the changed result in \$_. Files in which any modifications are made are backed up to the directory specified using --backup-dir, or to `backup' by default. To disable this, use --backup-dir= with no argument. Hunk mode is the default because it is MUCH MUCH faster than line-by-line. Use line-by-line only when it matters, e.g. you want to do a replacement only once per line (the default without the `g' argument). Conversely, when using hunk mode, *ALWAYS* use `g'; otherwise, you will only make one replacement in the entire file! "; my %options = (); $Getopt::Long::ignorecase = 0; &GetOptions ( \%options, 'help', 'backup-dir=s', 'line-mode', 'hunk-mode', ); die $usage if $options{"help"} or @ARGV <= 1; my $code = shift; die $usage if grep (-d || ! -w, @ARGV); sub SafeOpen { open ((my $fh = new FileHandle), $_[0]); confess "Can't open $_[0]: $!" if ! defined $fh; return $fh; } sub SafeClose { close $_[0] or confess "Can't close $_[0]: $!"; } sub FileContents { my $fh = SafeOpen ("< $_[0]"); my $olddollarslash = $/; local $/ = undef; my $contents = <$fh>; $/ = $olddollarslash; return $contents; } sub WriteStringToFile { my $fh = SafeOpen ("> $_[0]"); binmode $fh; print $fh $_[1] or confess "$_[0]: $!\n"; SafeClose $fh; } foreach my $file (@ARGV) { my $changed_p = 0; my $new_contents = ""; if ($options{"line-mode"}) { my $fh = SafeOpen $file; while (<$fh>) { my $save_line = $_; eval $code; $changed_p = 1 if $save_line ne $_; $new_contents .= $_; } } else { my $orig_contents = $_ = FileContents $file; eval $code; if ($_ ne $orig_contents) { $changed_p = 1; $new_contents = $_; } } if ($changed_p) { my $backdir = $options{"backup-dir"}; $backdir = "backup" if !defined ($backdir); if ($backdir) { my ($name, $path, $suffix) = fileparse ($file, ""); my $backfulldir = $path . $backdir; my $backfile = "$backfulldir/$name"; mkdir $backfulldir, 0755 unless -d $backfulldir; print "modifying $file (original saved in $backfile)\n"; rename $file, $backfile; } WriteStringToFile ($file, $new_contents); } } ----------------------------------- cut ------------------------------------ In addition to those programs, I needed to fix up a few other things, particularly relating to the duplicate definitions of types, now that some types merged with others. Specifically: 1. in lisp.h, removed duplicate declarations of Bytecount. The changed code should now look like this: (In each code snippet below, the first and last lines are the same as the original, as are all lines outside of those lines. That allows you to locate the section to be replaced, and replace the stuff in that section, verifying that there isn't anything new added that would need to be kept.) --------------------------------- snip ------------------------------------- /* Counts of bytes or chars */ typedef EMACS_INT Bytecount; typedef EMACS_INT Charcount; /* Counts of elements */ typedef EMACS_INT Elemcount; /* Hash codes */ typedef unsigned long Hashcode; /* ------------------------ dynamic arrays ------------------- */ --------------------------------- snip ------------------------------------- 2. in lstream.h, removed duplicate declaration of Bytecount. Rewrote the comment about this type. The changed code should now look like this: --------------------------------- snip ------------------------------------- #endif /* The have been some arguments over the what the type should be that specifies a count of bytes in a data block to be written out or read in, using Lstream_read(), Lstream_write(), and related functions. Originally it was long, which worked fine; Martin "corrected" these to size_t and ssize_t on the grounds that this is theoretically cleaner and is in keeping with the C standards. Unfortunately, this practice is horribly error-prone due to design flaws in the way that mixed signed/unsigned arithmetic happens. In fact, by doing this change, Martin introduced a subtle but fatal error that caused the operation of sending large mail messages to the SMTP server under Windows to fail. By putting all values back to be signed, avoiding any signed/unsigned mixing, the bug immediately went away. The type then in use was Lstream_Data_Count, so that it be reverted cleanly if a vote came to that. Now it is Bytecount. Some earlier comments about why the type must be signed: This MUST BE SIGNED, since it also is used in functions that return the number of bytes actually read to or written from in an operation, and these functions can return -1 to signal error. Note that the standard Unix read() and write() functions define the count going in as a size_t, which is UNSIGNED, and the count going out as an ssize_t, which is SIGNED. This is a horrible design flaw. Not only is it highly likely to lead to logic errors when a -1 gets interpreted as a large positive number, but operations are bound to fail in all sorts of horrible ways when a number in the upper-half of the size_t range is passed in -- this number is unrepresentable as an ssize_t, so code that checks to see how many bytes are actually written (which is mandatory if you are dealing with certain types of devices) will get completely screwed up. --ben */ typedef enum lstream_buffering --------------------------------- snip ------------------------------------- 3. in dumper.c, there are four places, all inside of switch() statements, where XD_BYTECOUNT appears twice as a case tag. In each case, the two case blocks contain identical code, and you should *REMOVE THE SECOND* and leave the first.
author ben
date Thu, 20 Sep 2001 06:31:11 +0000
parents 5fd7ba8b56e7
children 685b588e92d8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
1 /* Copyright (C) 2000 Free Software Foundation, Inc.
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
2 Copyright (C) 2000, 2001 Ben Wing.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
3
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
4 This file is part of XEmacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
5
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
9 later version.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
10
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
14 for more details.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
15
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
20
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
22
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
23 /* Authorship:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
24
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
25 Created May 2000 by Andy Piper.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
26 Windows-Mule stuff added by Ben Wing.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
27 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
28
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
29 #ifndef INCLUDED_syswindows_h_
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
30 #define INCLUDED_syswindows_h_
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
31
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
32 /* Note that there are currently FOUR different general
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
33 Windows-related include files in src!
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
34
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
35 Uses are approximately:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
36
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
37 syswindows.h: Mostly a wrapper around <windows.h>, including missing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
38 defines as necessary. Also includes stuff needed on both Cygwin and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
39 native Windows, regardless of window system chosen.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
40
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
41 console-msw.h: Used on both Cygwin and native Windows, but only when
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
42 native window system (as opposed to X) chosen.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
43
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
44 nt.h: [will be renamed to win32.h] Used only on native Windows, and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
45 regardless of window system chosen -- but used on both purely native
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
46 Windows (s/windowsnt.h) and MinGW (s/mingw32.h).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
47
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
48 ntheap.h: Used only on native Windows and only when standard dumping
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
49 mechanism (unexnt.c) used.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
50
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
51 All of the last three files include the first.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
52 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
53
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
54 #ifndef WIN32_LEAN_AND_MEAN
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
55 #define WIN32_LEAN_AND_MEAN
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
56 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
57
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
58 #if defined (CYGWIN) || defined (MINGW)
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
59
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
60 #ifdef __cplusplus
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
61 extern "C" {
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
62 #endif
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
63
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
64 /* Fucking GCC complains about "no previous prototype" for inline
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
65 functions. DUH! See DECLARE_INLINE_HEADER. */
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
66 extern __inline void *GetCurrentFiber (void);
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
67 extern __inline void *GetFiberData (void);
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
68
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
69 #ifdef __cplusplus
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
70 }
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
71 #endif
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
72
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
73 #endif
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
74
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
75 #include <windows.h>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
76
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
77 #if defined (WIN32_LEAN_AND_MEAN)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
78 # ifdef HAVE_X_WINDOWS
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
79 /* Christ almighty. The problems you get when combining two large code bases,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
80 neither with any respect for namespace purity. */
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
81 # undef Status
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
82 # endif
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
83 # include <winspool.h>
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
84 # ifdef HAVE_X_WINDOWS
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
85 # define Status int
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
86 # endif
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
87 # include <mmsystem.h>
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
88 # include <shellapi.h>
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
89 # include <ddeml.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
90 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
91
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 531
diff changeset
92 #include <lmaccess.h> /* next three for NetUserEnum and friends */
531
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
93 #include <lmapibuf.h>
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
94 #include <lmerr.h>
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 531
diff changeset
95 #include <lmcons.h> /* for UNLEN and possibly other constants */
531
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
96
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
97 /* mmsystem.h defines. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
98 #ifndef SND_ASYNC
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
99 #define SND_ASYNC 1
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
100 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
101 #ifndef SND_NODEFAULT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
102 #define SND_NODEFAULT 2
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
103 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
104 #ifndef SND_MEMORY
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
105 #define SND_MEMORY 4
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
106 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
107 #ifndef SND_FILENAME
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
108 #define SND_FILENAME 0x2000L
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
109 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
110
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
111 /* winspool.h defines. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
112 #ifndef PHYSICALWIDTH
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
113 #define PHYSICALWIDTH 110
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
114 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
115 #ifndef PHYSICALHEIGHT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
116 #define PHYSICALHEIGHT 111
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
117 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
118 #ifndef PHYSICALOFFSETX
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
119 #define PHYSICALOFFSETX 112
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
120 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
121 #ifndef PHYSICALOFFSETY
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
122 #define PHYSICALOFFSETY 113
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
123 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
124
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
125 /* windows.h defines. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
126 #if defined (CYGWIN) && (CYGWIN_VERSION_DLL_MAJOR < 20)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
127 typedef NMHDR *LPNMHDR;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
128 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
129
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
130 #ifndef SPI_GETWHEELSCROLLLINES
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
131 #define SPI_GETWHEELSCROLLLINES 104
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
132 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
133 #ifndef WHEEL_PAGESCROLL
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
134 #define WHEEL_PAGESCROLL (UINT_MAX)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
135 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
136 #ifndef WHEEL_DELTA
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
137 #define WHEEL_DELTA 120
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
138 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
139 #ifndef WM_MOUSEWHEEL
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
140 #define WM_MOUSEWHEEL 0x20A
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
141 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
142 #ifndef VK_APPS
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
143 #define VK_APPS 0x5D
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
144 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
145 #ifndef SIF_TRACKPOS
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
146 #define SIF_TRACKPOS 0x0010
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
147 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
148 #ifndef FW_BLACK
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
149 #define FW_BLACK FW_HEAVY
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
150 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
151 #ifndef FW_ULTRABOLD
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
152 #define FW_ULTRABOLD FW_EXTRABOLD
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
153 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
154 #ifndef FW_DEMIBOLD
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
155 #define FW_DEMIBOLD FW_SEMIBOLD
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
156 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
157 #ifndef FW_ULTRALIGHT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
158 #define FW_ULTRALIGHT FW_EXTRALIGHT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
159 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
160 #ifndef APPCMD_FILTERINITS
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
161 #define APPCMD_FILTERINITS 0x20L
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
162 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
163 #ifndef CBF_FAIL_SELFCONNECTIONS
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
164 #define CBF_FAIL_SELFCONNECTIONS 0x1000
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
165 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
166 #ifndef CBF_SKIP_ALLNOTIFICATIONS
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
167 #define CBF_SKIP_ALLNOTIFICATIONS 0x3C0000
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
168 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
169 #ifndef CBF_FAIL_ADVISES
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
170 #define CBF_FAIL_ADVISES 0x4000
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
171 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
172 #ifndef CBF_FAIL_POKES
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
173 #define CBF_FAIL_POKES 0x10000
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
174 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
175 #ifndef CBF_FAIL_REQUESTS
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
176 #define CBF_FAIL_REQUESTS 0x20000
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
177 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
178 #ifndef SZDDESYS_TOPIC
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
179 #define SZDDESYS_TOPIC "System"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
180 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
181 #ifndef JOHAB_CHARSET
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
182 #define JOHAB_CHARSET 130
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
183 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
184 #ifndef MAC_CHARSET
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
185 #define MAC_CHARSET 77
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
186 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
187
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
188 /***************************************************************/
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
189
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
190 /* Definitions for Mule under MS Windows */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
191
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
192 #include <wchar.h>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
193
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
194 #ifdef CYGWIN
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
195
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
196 /* All but wcscmp and wcslen left out of Cygwin headers -- but present
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
197 in /usr/include/mingw32/string.h! */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
198 wchar_t* wcscat (wchar_t*, const wchar_t*);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
199 wchar_t* wcschr (const wchar_t*, wchar_t);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
200 int wcscoll (const wchar_t*, const wchar_t*);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
201 wchar_t* wcscpy (wchar_t*, const wchar_t*);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
202 size_t wcscspn (const wchar_t*, const wchar_t*);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
203 /* Note: No wcserror in CRTDLL. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
204 wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
205 int wcsncmp(const wchar_t*, const wchar_t*, size_t);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
206 wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
207 wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
208 wchar_t* wcsrchr(const wchar_t*, wchar_t);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
209 size_t wcsspn(const wchar_t*, const wchar_t*);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
210 wchar_t* wcsstr(const wchar_t*, const wchar_t*);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
211 wchar_t* wcstok(wchar_t*, const wchar_t*);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
212 size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
213
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
214 #endif /* CYGWIN */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
215
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
216 // extern int mswindows_windows9x_p;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
217 /* #define XEUNICODE_P (!mswindows_windows9x_p) */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
218 #define XEUNICODE_P 0
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
219
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
220 #define XETCHAR_SIZE (XEUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
221 #define MAX_XETCHAR_SIZE sizeof (WCHAR)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
222 #define XETEXT1(arg) (XEUNICODE_P ? ((char *) (L##arg)) : (arg))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
223 /* We need to do this indirection in case ARG is also a manifest constant.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
224 I don't really understand why. --ben */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
225 #define XETEXT(arg) XETEXT1(arg)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
226 #define XECOPY_TCHAR(ptr, ch) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
227 (XEUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
228 #define xetcslen(arg) (XEUNICODE_P ? wcslen ((wchar_t *) arg) : strlen (arg))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
229 #define xetcscmp(s1, s2) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
230 (XEUNICODE_P ? wcscmp ((wchar_t *) s1, (wchar_t *) s2) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
231 : strcmp (s1, s2))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
232 #define xetcscpy(s1, s2) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
233 (XEUNICODE_P ? (char *) wcscpy ((wchar_t *) s1, (wchar_t *) s2) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
234 : strcpy (s1, s2))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
235 #define xetcschr(s, ch) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
236 (XEUNICODE_P ? (char *) wcschr ((wchar_t *) s, (WCHAR) ch) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
237 : strchr (s, ch))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
238 #define xetcsrchr(s, ch) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
239 (XEUNICODE_P ? (char *) wcsrchr ((wchar_t *) s, (WCHAR) ch) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
240 : strrchr (s, ch))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
241
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
242
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
243 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
244 do { \
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
245 Intbyte *lttff; \
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
246 \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
247 LOCAL_TO_WIN32_FILE_FORMAT (path, lttff); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
248 C_STRING_TO_EXTERNAL (lttff, out, Qmswindows_tstr); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
249 } while (0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
250
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
251 Lisp_Object tstr_to_local_file_format (Extbyte *pathout);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
252
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
253 #ifdef CYGWIN
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
254 #define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
255 do { \
593
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
256 /* NOTE: It is a bit evil that here and below we are passing \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
257 internal-format data to a function that (nominally) should work \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
258 with external-format data. But in point of fact, the Cygwin \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
259 conversion functions are *NOT* localized, and will fail if they \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
260 get 7-bit ISO2022-encoded data. We know that our internal format \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
261 is ASCII-compatible, and so these functions will work fine with \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
262 this data. */ \
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
263 Lisp_Object ltwff1 = (path); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
264 int ltwff2 = \
593
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
265 cygwin_posix_to_win32_path_list_buf_size ((char *) \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
266 XSTRING_DATA (ltwff1)); \
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
267 pathout = (Intbyte *) alloca (ltwff2); \
593
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
268 cygwin_posix_to_win32_path_list ((char *) XSTRING_DATA (ltwff1), \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
269 (char *) pathout); \
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
270 } while (0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
271 #else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
272 #define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
273 do { \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
274 (pathout) = XSTRING_DATA (path); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
275 } while (0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
276 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
277
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
278 #ifdef CYGWIN
593
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
279 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
280 do { \
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
281 Intbyte *wtlff1 = (path); \
593
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
282 int wtlff2 = \
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
283 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
284 Intbyte *wtlff3 = (Intbyte *) alloca (wtlff2); \
593
5fd7ba8b56e7 [xemacs-hg @ 2001-05-31 12:45:27 by ben]
ben
parents: 558
diff changeset
285 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
286 (pathout) = build_string ((CIntbyte *) wtlff3); \
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
287 } while (0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
288 #else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
289 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
290 do { \
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 593
diff changeset
291 (pathout) = build_string ((CIntbyte *) path); \
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
292 } while (0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
293 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
294
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
295 extern BOOL (WINAPI *xSwitchToThread) (VOID);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
296
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
297 extern HKL (WINAPI *xGetKeyboardLayout) (DWORD);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
298 extern BOOL (WINAPI *xSetMenuDefaultItem) (HMENU, UINT, UINT);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
299 extern BOOL (WINAPI *xInsertMenuItemA) (HMENU, UINT, BOOL, LPCMENUITEMINFOA);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
300 extern BOOL (WINAPI *xInsertMenuItemW) (HMENU, UINT, BOOL, LPCMENUITEMINFOW);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
301 extern HANDLE (WINAPI *xLoadImageA) (HINSTANCE, LPCSTR, UINT, int, int, UINT);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
302 extern HANDLE (WINAPI *xLoadImageW) (HINSTANCE, LPCWSTR, UINT, int, int, UINT);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
303 extern ATOM (WINAPI *xRegisterClassExA) (CONST WNDCLASSEXA *);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
304 extern ATOM (WINAPI *xRegisterClassExW) (CONST WNDCLASSEXW *);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
305
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
306 extern int (WINAPI *xEnumFontFamiliesExA) (HDC, LPLOGFONTA, FONTENUMPROCA,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
307 LPARAM, DWORD);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
308 extern int (WINAPI *xEnumFontFamiliesExW) (HDC, LPLOGFONTW, FONTENUMPROCW,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
309 LPARAM, DWORD);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
310
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
311 extern DWORD (WINAPI *xSHGetFileInfoA) (LPCSTR, DWORD, SHFILEINFOA FAR *, UINT,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
312 UINT);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
313 extern DWORD (WINAPI *xSHGetFileInfoW) (LPCWSTR, DWORD, SHFILEINFOW FAR *,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
314 UINT, UINT);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
315
531
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
316 extern NET_API_STATUS (NET_API_FUNCTION *xNetUserEnum)
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
317 (
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
318 IN LPCWSTR servername OPTIONAL,
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
319 IN DWORD level,
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
320 IN DWORD filter,
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
321 OUT LPBYTE *bufptr,
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
322 IN DWORD prefmaxlen,
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
323 OUT LPDWORD entriesread,
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
324 OUT LPDWORD totalentries,
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
325 IN OUT LPDWORD resume_handle OPTIONAL
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
326 );
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
327
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
328 extern NET_API_STATUS (NET_API_FUNCTION *xNetApiBufferFree)
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
329 (
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
330 IN LPVOID Buffer
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
331 );
0493e9f3c27f [xemacs-hg @ 2001-05-12 11:16:12 by ben]
ben
parents: 442
diff changeset
332
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
333 #endif /* INCLUDED_syswindows_h_ */