comparison src/w32.c @ 16884:36babc489b0c

Change all uses of win95, winnt, and win32 into Windows 95, Windows NT, and W32, respectively. Expand "win" substring in variables referring to Microsoft Windows constructs into "windows". Canonicalize header comments to use same terminology.
author Geoff Voelker <voelker@cs.washington.edu>
date Mon, 20 Jan 1997 00:38:22 +0000
parents 1c792ac8facd
children a8a539285d69
comparison
equal deleted inserted replaced
16883:d1d4d81f9ece 16884:36babc489b0c
1 /* Utility and Unix shadow routines for GNU Emacs on Windows NT. 1 /* Utility and Unix shadow routines for GNU Emacs on the Microsoft W32 API.
2 Copyright (C) 1994, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1994, 1995 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
6 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
1061 sys_rename (const char * oldname, const char * newname) 1061 sys_rename (const char * oldname, const char * newname)
1062 { 1062 {
1063 char temp[MAX_PATH]; 1063 char temp[MAX_PATH];
1064 DWORD attr; 1064 DWORD attr;
1065 1065
1066 /* MoveFile on Win95 doesn't correctly change the short file name 1066 /* MoveFile on Windows 95 doesn't correctly change the short file name
1067 alias in a number of circumstances (it is not easy to predict when 1067 alias in a number of circumstances (it is not easy to predict when
1068 just by looking at oldname and newname, unfortunately). In these 1068 just by looking at oldname and newname, unfortunately). In these
1069 cases, renaming through a temporary name avoids the problem. 1069 cases, renaming through a temporary name avoids the problem.
1070 1070
1071 A second problem on Win95 is that renaming through a temp name when 1071 A second problem on Windows 95 is that renaming through a temp name when
1072 newname is uppercase fails (the final long name ends up in 1072 newname is uppercase fails (the final long name ends up in
1073 lowercase, although the short alias might be uppercase) UNLESS the 1073 lowercase, although the short alias might be uppercase) UNLESS the
1074 long temp name is not 8.3. 1074 long temp name is not 8.3.
1075 1075
1076 So, on Win95 we always rename through a temp name, and we make sure 1076 So, on Windows 95 we always rename through a temp name, and we make sure
1077 the temp name has a long extension to ensure correct renaming. */ 1077 the temp name has a long extension to ensure correct renaming. */
1078 1078
1079 strcpy (temp, map_w32_filename (oldname, NULL)); 1079 strcpy (temp, map_w32_filename (oldname, NULL));
1080 1080
1081 if (GetVersion () & 0x80000000) 1081 if (GetVersion () & 0x80000000)
1825 } 1825 }
1826 } 1826 }
1827 } 1827 }
1828 1828
1829 /* Note that sockets do not need special treatment here (at least on 1829 /* Note that sockets do not need special treatment here (at least on
1830 NT and Win95 using the standard tcp/ip stacks) - it appears that 1830 NT and Windows 95 using the standard tcp/ip stacks) - it appears that
1831 closesocket is equivalent to CloseHandle, which is to be expected 1831 closesocket is equivalent to CloseHandle, which is to be expected
1832 because socket handles are fully fledged kernel handles. */ 1832 because socket handles are fully fledged kernel handles. */
1833 rc = _close (fd); 1833 rc = _close (fd);
1834 1834
1835 if (rc == 0) 1835 if (rc == 0)
1963 { 1963 {
1964 /* Use read to get CRLF translation */ 1964 /* Use read to get CRLF translation */
1965 rc = _read (fd, &cp->chr, sizeof (char)); 1965 rc = _read (fd, &cp->chr, sizeof (char));
1966 1966
1967 /* Give subprocess time to buffer some more output for us before 1967 /* Give subprocess time to buffer some more output for us before
1968 reporting that input is available; we need this because Win95 1968 reporting that input is available; we need this because Windows 95
1969 connects DOS programs to pipes by making the pipe appear to be 1969 connects DOS programs to pipes by making the pipe appear to be
1970 the normal console stdout - as a result most DOS programs will 1970 the normal console stdout - as a result most DOS programs will
1971 write to stdout without buffering, ie. one character at a 1971 write to stdout without buffering, ie. one character at a
1972 time. Even some W32 programs do this - "dir" in a command 1972 time. Even some W32 programs do this - "dir" in a command
1973 shell on NT is very slow if we don't do this. */ 1973 shell on NT is very slow if we don't do this. */