Mercurial > emacs
annotate src/w32.h @ 19860:c17fd465ea95 libc-970911 libc-970912 libc-970913 libc-970914 libc-970915 libc-970916 libc-970917 libc-970918 libc-970919 libc-970920 libc-970921 libc-970922 libc-970923 libc-970924 libc-970925 libc-970926 libc-970927 libc-970928 libc-970929 libc-970930 libc-971001 libc-971018 libc-971019 libc-971020 libc-971021 libc-971022 libc-971023 libc-971024 libc-971025 libc-971026 libc-971027 libc-971028 libc-971029 libc-971030 libc-971031 libc-971101 libc-971102 libc-971103 libc-971104 libc-971105 libc-971106 libc-971107 libc-971108 libc-971109 libc-971110 libc-971111 libc-971112 libc-971113 libc-971114 libc-971115 libc-971116 libc-971117 libc-971118 libc-971120 libc-971121 libc-971122 libc-971123 libc-971124 libc-971125 libc-971126 libc-971127 libc-971128 libc-971129 libc-971130 libc-971201 libc-971203 libc-971204 libc-971205 libc-971206 libc-971207 libc-971208 libc-971209 libc-971210 libc-971211 libc-971212 libc-971213 libc-971214 libc-971217 libc-971218 libc-971219 libc-971220 libc-971221 libc-971222 libc-971223 libc-971224 libc-971225 libc-971226 libc-971227 libc-971228 libc-971229 libc-971230 libc-971231 libc-980103 libc-980104 libc-980105 libc-980106 libc-980107 libc-980108 libc-980109 libc-980110 libc-980111 libc-980112 libc-980114 libc-980115 libc-980116 libc-980117 libc-980118 libc-980119 libc-980120 libc-980121 libc-980122 libc-980123 libc-980124 libc-980125 libc-980126 libc-980127 libc-980128
typos.
author | Jeff Law <law@redhat.com> |
---|---|
date | Wed, 10 Sep 1997 21:16:20 +0000 |
parents | 8f868d8be49a |
children | 8f5ea092125c |
rev | line source |
---|---|
15142
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
1 #ifndef _NT_H_ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
2 #define _NT_H_ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
3 |
9803 | 4 /* Support routines for the NT version of Emacs. |
5 Copyright (C) 1994 Free Software Foundation, Inc. | |
6 | |
7 This file is part of GNU Emacs. | |
8 | |
9 GNU Emacs is free software; you can redistribute it and/or modify | |
10 it under the terms of the GNU General Public License as published by | |
11 the Free Software Foundation; either version 2, or (at your option) | |
12 any later version. | |
13 | |
14 GNU Emacs is distributed in the hope that it will be useful, | |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 GNU General Public License for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
20 along with GNU Emacs; see the file COPYING. If not, write to | |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13426
diff
changeset
|
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13426
diff
changeset
|
22 Boston, MA 02111-1307, USA. */ |
9803 | 23 |
24 /* File descriptor set emulation. */ | |
25 | |
15142
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
26 /* MSVC runtime library has limit of 64 descriptors by default */ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
27 #define FD_SETSIZE 64 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
28 typedef struct { |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
29 unsigned int bits[FD_SETSIZE / 32]; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
30 } fd_set; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
31 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
32 /* standard access macros */ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
33 #define FD_SET(n, p) \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
34 do { \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
35 if ((n) < FD_SETSIZE) { \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
36 (p)->bits[(n)/32] |= (1 << (n)%32); \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
37 } \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
38 } while (0) |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
39 #define FD_CLR(n, p) \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
40 do { \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
41 if ((n) < FD_SETSIZE) { \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
42 (p)->bits[(n)/32] &= ~(1 << (n)%32); \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
43 } \ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
44 } while (0) |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
45 #define FD_ISSET(n, p) ((n) < FD_SETSIZE ? ((p)->bits[(n)/32] & (1 << (n)%32)) : 0) |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
46 #define FD_ZERO(p) memset((p), 0, sizeof(fd_set)) |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
47 |
9803 | 48 #define SELECT_TYPE fd_set |
15142
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
49 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
50 /* ------------------------------------------------------------------------- */ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
51 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
52 /* child_process.status values */ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
53 enum { |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
54 STATUS_READ_ERROR = -1, |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
55 STATUS_READ_READY, |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
56 STATUS_READ_IN_PROGRESS, |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
57 STATUS_READ_FAILED, |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
58 STATUS_READ_SUCCEEDED, |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
59 STATUS_READ_ACKNOWLEDGED |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
60 }; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
61 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
62 /* This structure is used for both pipes and sockets; for |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
63 a socket, the process handle in pi is NULL. */ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
64 typedef struct _child_process |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
65 { |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
66 int fd; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
67 int pid; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
68 HANDLE char_avail; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
69 HANDLE char_consumed; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
70 HANDLE thrd; |
19705
8f868d8be49a
Remove debugging macros.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
71 HWND hwnd; |
15142
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
72 PROCESS_INFORMATION procinfo; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
73 volatile int status; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
74 char chr; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
75 } child_process; |
9803 | 76 |
15142
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
77 #define MAXDESC FD_SETSIZE |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
78 #define MAX_CHILDREN MAXDESC/2 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
79 #define CHILD_ACTIVE(cp) ((cp)->char_avail != NULL) |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
80 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
81 /* parallel array of private info on file handles */ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
82 typedef struct |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
83 { |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
84 unsigned flags; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
85 HANDLE hnd; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
86 child_process * cp; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
87 } filedesc; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
88 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
89 extern filedesc fd_info [ MAXDESC ]; |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
90 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
91 /* fd_info flag definitions */ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
92 #define FILE_READ 0x0001 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
93 #define FILE_WRITE 0x0002 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
94 #define FILE_BINARY 0x0010 |
19705
8f868d8be49a
Remove debugging macros.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
95 #define FILE_LAST_CR 0x0020 |
15142
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
96 #define FILE_PIPE 0x0100 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
97 #define FILE_SOCKET 0x0200 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
98 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
99 extern child_process * new_child (void); |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
100 extern void delete_child (child_process *cp); |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
101 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
102 /* ------------------------------------------------------------------------- */ |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
103 |
19705
8f868d8be49a
Remove debugging macros.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
104 /* Get long (aka "true") form of file name, if it exists. */ |
8f868d8be49a
Remove debugging macros.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
105 extern BOOL w32_get_long_filename (char * name, char * buf, int size); |
9803 | 106 |
107 /* Prepare our standard handles for proper inheritance by child processes. */ | |
108 extern void prepare_standard_handles (int in, int out, | |
109 int err, HANDLE handles[4]); | |
110 | |
111 /* Reset our standard handles to their original state. */ | |
112 extern void reset_standard_handles (int in, int out, | |
113 int err, HANDLE handles[4]); | |
114 | |
13426
8074deaef2f4
(nt_get_resource): Prototype defined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
9803
diff
changeset
|
115 /* Return the string resource associated with KEY of type TYPE. */ |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15248
diff
changeset
|
116 extern LPBYTE w32_get_resource (char * key, LPDWORD type); |
13426
8074deaef2f4
(nt_get_resource): Prototype defined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
9803
diff
changeset
|
117 |
15142
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
118 extern void init_ntproc (); |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
119 extern void term_ntproc (); |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
120 |
6879c02a290c
Check to see if already included.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
121 #endif /* _NT_H_ */ |