Revert until we track down the RH9 bug
[mono.git] / mono / io-layer / daemon-messages.h
1 /*
2  * daemon-messages.h:  Communications to and from the handle daemon
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #ifndef _WAPI_DAEMON_MESSAGES_H_
11 #define _WAPI_DAEMON_MESSAGES_H_
12
13 #include <mono/io-layer/wapi-private.h>
14
15 typedef enum {
16         WapiHandleRequestType_Error,
17         WapiHandleRequestType_New,
18         WapiHandleRequestType_Open,
19         WapiHandleRequestType_Close,
20         WapiHandleRequestType_Scratch,
21         WapiHandleRequestType_ScratchFree,
22         WapiHandleRequestType_ProcessFork,
23 } WapiHandleRequestType;
24
25 typedef struct 
26 {
27         WapiHandleType type;
28 } WapiHandleRequest_New;
29
30 typedef struct 
31 {
32         guint32 handle;
33 } WapiHandleRequest_Open;
34
35 typedef struct 
36 {
37         guint32 handle;
38 } WapiHandleRequest_Close;
39
40 typedef struct
41 {
42         guint32 length;
43 } WapiHandleRequest_Scratch;
44
45 typedef struct
46 {
47         guint32 idx;
48 } WapiHandleRequest_ScratchFree;
49
50 typedef struct 
51 {
52         guint32 cmd;
53         guint32 env;
54         guint32 dir;
55         guint32 stdin_handle;
56         guint32 stdout_handle;
57         guint32 stderr_handle;
58         gboolean inherit;
59         guint32 flags;
60 } WapiHandleRequest_ProcessFork;
61
62 typedef struct 
63 {
64         WapiHandleRequestType type;
65         union 
66         {
67                 WapiHandleRequest_New new;
68                 WapiHandleRequest_Open open;
69                 WapiHandleRequest_Close close;
70                 WapiHandleRequest_Scratch scratch;
71                 WapiHandleRequest_ScratchFree scratch_free;
72                 WapiHandleRequest_ProcessFork process_fork;
73         } u;
74 } WapiHandleRequest;
75
76 typedef enum {
77         WapiHandleResponseType_Error,
78         WapiHandleResponseType_New,
79         WapiHandleResponseType_Open,
80         WapiHandleResponseType_Close,
81         WapiHandleResponseType_Scratch,
82         WapiHandleResponseType_ScratchFree,
83         WapiHandleResponseType_ProcessFork,
84 } WapiHandleResponseType;
85
86 typedef struct 
87 {
88         guint32 reason;
89 } WapiHandleResponse_Error;
90
91 typedef struct 
92 {
93         WapiHandleType type;
94         guint32 handle;
95 } WapiHandleResponse_New;
96
97 typedef struct 
98 {
99         WapiHandleType type;
100         guint32 handle;
101 } WapiHandleResponse_Open;
102
103 typedef struct 
104 {
105         gboolean destroy;
106 } WapiHandleResponse_Close;
107
108 typedef struct
109 {
110         guint32 idx;
111         gboolean remap;
112 } WapiHandleResponse_Scratch;
113
114 typedef struct
115 {
116         guint32 dummy;
117 } WapiHandleResponse_ScratchFree;
118
119 typedef struct
120 {
121         guint32 process_handle;
122         guint32 thread_handle;
123         guint32 pid;
124         guint32 tid;
125 } WapiHandleResponse_ProcessFork;
126
127 typedef struct
128 {
129         WapiHandleResponseType type;
130         union
131         {
132                 WapiHandleResponse_Error error;
133                 WapiHandleResponse_New new;
134                 WapiHandleResponse_Open open;
135                 WapiHandleResponse_Close close;
136                 WapiHandleResponse_Scratch scratch;
137                 WapiHandleResponse_ScratchFree scratch_free;
138                 WapiHandleResponse_ProcessFork process_fork;
139         } u;
140 } WapiHandleResponse;
141
142 extern void _wapi_daemon_request_response (int fd, WapiHandleRequest *req,
143                                            WapiHandleResponse *resp);
144 extern void _wapi_daemon_request_response_with_fds (int fd,
145                                                     WapiHandleRequest *req,
146                                                     WapiHandleResponse *resp,
147                                                     int in_fd, int out_fd,
148                                                     int err_fd);
149 extern int _wapi_daemon_request (int fd, WapiHandleRequest *req, int *fds,
150                                  gboolean *has_fds);
151 extern int _wapi_daemon_response (int fd, WapiHandleResponse *resp);
152
153 #endif /* _WAPI_DAEMON_MESSAGES_H_ */