Mercurial > projects > dstep
comparison dstep/coreservices/osservices/OpenTransportProtocol.d @ 11:07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 01 Aug 2009 15:03:28 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
10:27e00625790b | 11:07194b026fa4 |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Jul 22, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.coreservices.osservices.OpenTransportProtocol; | |
8 | |
9 //import dstep.AvailabilityMacros; | |
10 import dstep.coreservices.carboncore.CodeFragments; | |
11 import dstep.coreservices.carboncore.ConditionalMacros; | |
12 import dstep.coreservices.carboncore.Files; | |
13 import dstep.coreservices.osservices.OpenTransport; | |
14 //import dstep.stddef; | |
15 | |
16 alias int OTTimerTask; | |
17 | |
18 extern (C) | |
19 { | |
20 alias ubyte function (void*, OTLink*) OTHashSearchProcPtr; | |
21 alias ubyte function (OTLink*) OTGateProcPtr; | |
22 alias uint function (OTLink*) OTHashProcPtr; | |
23 } | |
24 | |
25 enum | |
26 { | |
27 I_NREAD = ((MIOC_STREAMIO << 8) | 1), | |
28 I_PUSH = ((MIOC_STREAMIO << 8) | 2), | |
29 I_POP = ((MIOC_STREAMIO << 8) | 3), | |
30 I_LOOK = ((MIOC_STREAMIO << 8) | 4), | |
31 I_FLUSH = ((MIOC_STREAMIO << 8) | 5), | |
32 I_SRDOPT = ((MIOC_STREAMIO << 8) | 6), | |
33 I_GRDOPT = ((MIOC_STREAMIO << 8) | 7), | |
34 I_STR = ((MIOC_STREAMIO << 8) | 8), | |
35 I_SETSIG = ((MIOC_STREAMIO << 8) | 9), | |
36 I_GETSIG = ((MIOC_STREAMIO << 8) | 10), | |
37 I_FIND = ((MIOC_STREAMIO << 8) | 11), | |
38 I_LINK = ((MIOC_STREAMIO << 8) | 12), | |
39 I_UNLINK = ((MIOC_STREAMIO << 8) | 13), | |
40 I_PEEK = ((MIOC_STREAMIO << 8) | 15), | |
41 I_FDINSERT = ((MIOC_STREAMIO << 8) | 16), | |
42 I_SENDFD = ((MIOC_STREAMIO << 8) | 17), | |
43 I_RECVFD = ((MIOC_STREAMIO << 8) | 18), | |
44 I_FLUSHBAND = ((MIOC_STREAMIO << 8) | 19), | |
45 I_SWROPT = ((MIOC_STREAMIO << 8) | 20), | |
46 I_GWROPT = ((MIOC_STREAMIO << 8) | 21), | |
47 I_LIST = ((MIOC_STREAMIO << 8) | 22), | |
48 I_ATMARK = ((MIOC_STREAMIO << 8) | 23), | |
49 I_CKBAND = ((MIOC_STREAMIO << 8) | 24), | |
50 I_GETBAND = ((MIOC_STREAMIO << 8) | 25), | |
51 I_CANPUT = ((MIOC_STREAMIO << 8) | 26), | |
52 I_SETCLTIME = ((MIOC_STREAMIO << 8) | 27), | |
53 I_GETCLTIME = ((MIOC_STREAMIO << 8) | 28), | |
54 I_PLINK = ((MIOC_STREAMIO << 8) | 29), | |
55 I_PUNLINK = ((MIOC_STREAMIO << 8) | 30), | |
56 I_GETMSG = ((MIOC_STREAMIO << 8) | 40), | |
57 I_PUTMSG = ((MIOC_STREAMIO << 8) | 41), | |
58 I_POLL = ((MIOC_STREAMIO << 8) | 42), | |
59 I_SETDELAY = ((MIOC_STREAMIO << 8) | 43), | |
60 I_GETDELAY = ((MIOC_STREAMIO << 8) | 44), | |
61 I_RUN_QUEUES = ((MIOC_STREAMIO << 8) | 45), | |
62 I_GETPMSG = ((MIOC_STREAMIO << 8) | 46), | |
63 I_PUTPMSG = ((MIOC_STREAMIO << 8) | 47), | |
64 I_AUTOPUSH = ((MIOC_STREAMIO << 8) | 48), | |
65 I_PIPE = ((MIOC_STREAMIO << 8) | 49), | |
66 I_HEAP_REPORT = ((MIOC_STREAMIO << 8) | 50), | |
67 I_FIFO = ((MIOC_STREAMIO << 8) | 51) | |
68 } | |
69 | |
70 enum | |
71 { | |
72 RS_HIPRI = 0x01 | |
73 } | |
74 | |
75 enum | |
76 { | |
77 MSG_HIPRI = 0x01, | |
78 MSG_BAND = 0x02, | |
79 MSG_ANY = 0x04 | |
80 } | |
81 | |
82 enum | |
83 { | |
84 MORECTL = 0x01, | |
85 MOREDATA = 0x02 | |
86 } | |
87 | |
88 enum | |
89 { | |
90 FMNAMESZ = 31 | |
91 } | |
92 | |
93 enum : uint | |
94 { | |
95 INFTIM = 0xFFFFFFFF | |
96 } | |
97 | |
98 enum | |
99 { | |
100 FLUSHR = 0x01, | |
101 FLUSHW = 0x02, | |
102 FLUSHRW = (FLUSHW | FLUSHR) | |
103 } | |
104 | |
105 enum | |
106 { | |
107 FLUSHBAND = 0x40 | |
108 } | |
109 | |
110 enum | |
111 { | |
112 ANYMARK = 0x01, | |
113 LASTMARK = 0x02 | |
114 } | |
115 | |
116 enum | |
117 { | |
118 S_INPUT = 0x01, | |
119 S_HIPRI = 0x02, | |
120 S_OUTPUT = 0x04, | |
121 S_MSG = 0x08, | |
122 S_RDNORM = 0x10, | |
123 S_RDBAND = 0x20, | |
124 S_WRNORM = 0x40, | |
125 S_WRBAND = 0x80, | |
126 S_ERROR = 0x0100, | |
127 S_HANGUP = 0x0200, | |
128 S_BANDURG = 0x0400 | |
129 } | |
130 | |
131 enum | |
132 { | |
133 RNORM = 0x01, | |
134 RMSGD = 0x02, | |
135 RMSGN = 0x04, | |
136 RFILL = 0x08 | |
137 } | |
138 | |
139 enum | |
140 { | |
141 RPROTNORM = 0x10, | |
142 RPROTDIS = 0x20, | |
143 RPROTDAT = 0x40 | |
144 } | |
145 | |
146 enum | |
147 { | |
148 SNDZERO = 0x01 | |
149 } | |
150 | |
151 enum | |
152 { | |
153 MUXID_ALL = -1 | |
154 } | |
155 | |
156 enum | |
157 { | |
158 SL_FATAL = 0x01, | |
159 SL_NOTIFY = 0x02, | |
160 SL_ERROR = 0x04, | |
161 SL_TRACE = 0x08, | |
162 SL_CONSOLE = 0x00, | |
163 SL_WARN = 0x20, | |
164 SL_NOTE = 0x40 | |
165 } | |
166 | |
167 enum | |
168 { | |
169 I_TRCLOG = ((MIOC_STRLOG << 8) | 1), | |
170 I_ERRLOG = ((MIOC_STRLOG << 8) | 2) | |
171 } | |
172 | |
173 enum | |
174 { | |
175 LOGMSGSZ = 128 | |
176 } | |
177 | |
178 struct bandinfo | |
179 { | |
180 ubyte bi_pri; | |
181 byte pad1; | |
182 int bi_flag; | |
183 } | |
184 | |
185 | |
186 struct strfdinsert | |
187 { | |
188 strbuf ctlbuf; | |
189 strbuf databuf; | |
190 int flags; | |
191 int fildes; | |
192 int offset; | |
193 } | |
194 | |
195 | |
196 struct str_mlist | |
197 { | |
198 char* l_name; | |
199 } | |
200 | |
201 | |
202 struct str_list | |
203 { | |
204 int sl_nmods; | |
205 str_mlist* sl_modlist; | |
206 } | |
207 | |
208 | |
209 struct strpeek | |
210 { | |
211 strbuf ctlbuf; | |
212 strbuf databuf; | |
213 int flags; | |
214 } | |
215 | |
216 | |
217 struct strpmsg | |
218 { | |
219 strbuf ctlbuf; | |
220 strbuf databuf; | |
221 int band; | |
222 int flags; | |
223 } | |
224 | |
225 | |
226 struct strrecvfd | |
227 { | |
228 int fd; | |
229 ushort uid; | |
230 ushort gid; | |
231 char* fill; | |
232 } | |
233 | |
234 | |
235 struct strioctl | |
236 { | |
237 int ic_cmd; | |
238 int ic_timout; | |
239 int ic_len; | |
240 char* ic_dp; | |
241 } | |
242 | |
243 | |
244 struct log_ctl | |
245 { | |
246 short mid; | |
247 short sid; | |
248 byte level; | |
249 byte pad1; | |
250 short flags; | |
251 int ltime; | |
252 int ttime; | |
253 int seq_no; | |
254 } | |
255 | |
256 | |
257 struct trace_ids | |
258 { | |
259 short ti_mid; | |
260 short ti_sid; | |
261 byte ti_level; | |
262 } | |
263 | |
264 | |
265 struct OTPortCloseStruct | |
266 { | |
267 uint fPortRef; | |
268 ProviderRef fTheProvider; | |
269 int fDenyReason; | |
270 } | |
271 | |
272 | |
273 struct OTClientList | |
274 { | |
275 uint fNumClients; | |
276 char* fBuffer; | |
277 } | |
278 | |
279 | |
280 struct OTHashList | |
281 { | |
282 OTHashProcPtr fHashProc; | |
283 uint fHashTableSize; | |
284 OTLink** fHashBuckets; | |
285 } | |
286 | |
287 | |
288 struct OTGate | |
289 { | |
290 OTLIFO fLIFO; | |
291 OTList fList; | |
292 OTGateProcPtr fProc; | |
293 int fNumQueued; | |
294 int fInside; | |
295 } | |
296 |