Mercurial > projects > dstep
comparison dstep/coreservices/osservices/NSLCore.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.NSLCore; | |
8 | |
9 //import dstep.AvailabilityMacros; | |
10 import dstep.coreservices.carboncore.CarbonCore; | |
11 | |
12 alias NSLError* NSLErrorPtr; | |
13 alias ushort NSLSearchState; | |
14 alias uint NSLEventCode; | |
15 alias uint NSLClientRef; | |
16 alias uint NSLRequestRef; | |
17 alias uint NSLOneBasedIndex; | |
18 alias char* NSLPath; | |
19 alias char* NSLServiceType; | |
20 alias Handle NSLServicesList; | |
21 alias char* NSLNeighborhood; | |
22 alias NSLClientAsyncInfo* NSLClientAsyncInfoPtr; | |
23 alias NSLPluginAsyncInfo* NSLPluginAsyncInfoPtr; | |
24 alias NSLMgrNotifyProcPtr NSLMgrNotifyUPP; | |
25 alias NSLClientNotifyProcPtr NSLClientNotifyUPP; | |
26 alias NSLTypedData* NSLTypedDataPtr; | |
27 alias NSLServicesListHeader* NSLServicesListHeaderPtr; | |
28 alias NSLPluginData* NSLPluginDataPtr; | |
29 | |
30 extern (C) | |
31 { | |
32 alias void function (NSLClientAsyncInfo*) NSLClientNotifyProcPtr; | |
33 alias void function (NSLPluginAsyncInfo*) NSLMgrNotifyProcPtr; | |
34 } | |
35 | |
36 enum | |
37 { | |
38 kNSLMinSystemVersion = 0x0900, | |
39 kNSLMinOTVersion = 0x0130 | |
40 } | |
41 | |
42 enum | |
43 { | |
44 kNSLDefaultListSize = 256 | |
45 } | |
46 | |
47 enum | |
48 { | |
49 kNSLURLDelimiter = ',' | |
50 } | |
51 | |
52 enum | |
53 { | |
54 kNSLNoContext = 0 | |
55 } | |
56 | |
57 enum | |
58 { | |
59 kNSLDuplicateSearchInProgress = 100, | |
60 kNSLUserCanceled = userCanceledErr, | |
61 kNSLInvalidEnumeratorRef = 0 | |
62 } | |
63 | |
64 enum | |
65 { | |
66 kNSLSearchStateBufferFull = 1, | |
67 kNSLSearchStateOnGoing = 2, | |
68 kNSLSearchStateComplete = 3, | |
69 kNSLSearchStateStalled = 4, | |
70 kNSLWaitingForContinue = 5 | |
71 } | |
72 | |
73 enum | |
74 { | |
75 kNSLServicesLookupDataEvent = 6, | |
76 kNSLNeighborhoodLookupDataEvent = 7, | |
77 kNSLNewDataEvent = 8, | |
78 kNSLContinueLookupEvent = 9 | |
79 } | |
80 | |
81 struct NSLError | |
82 { | |
83 int theErr; | |
84 uint theContext; | |
85 } | |
86 | |
87 | |
88 struct NSLClientAsyncInfo | |
89 { | |
90 void* clientContextPtr; | |
91 void* mgrContextPtr; | |
92 char* resultBuffer; | |
93 int bufferLen; | |
94 int maxBufferSize; | |
95 uint startTime; | |
96 uint intStartTime; | |
97 uint maxSearchTime; | |
98 uint alertInterval; | |
99 uint totalItems; | |
100 uint alertThreshold; | |
101 ushort searchState; | |
102 NSLError searchResult; | |
103 uint searchDataType; | |
104 } | |
105 | |
106 | |
107 struct NSLPluginAsyncInfo | |
108 { | |
109 void* mgrContextPtr; | |
110 void* pluginContextPtr; | |
111 void* pluginPtr; | |
112 char* resultBuffer; | |
113 int bufferLen; | |
114 int maxBufferSize; | |
115 uint maxSearchTime; | |
116 uint reserved1; | |
117 uint reserved2; | |
118 uint reserved3; | |
119 uint clientRef; | |
120 uint requestRef; | |
121 ushort searchState; | |
122 int searchResult; | |
123 } | |
124 | |
125 | |
126 struct NSLTypedData | |
127 { | |
128 uint dataType; | |
129 uint lengthOfData; | |
130 } | |
131 | |
132 | |
133 struct NSLServicesListHeader | |
134 { | |
135 uint numServices; | |
136 uint logicalLen; | |
137 } | |
138 | |
139 | |
140 struct NSLPluginData | |
141 { | |
142 int reserved1; | |
143 int reserved2; | |
144 int reserved3; | |
145 ubyte supportsRegistration; | |
146 ubyte isPurgeable; | |
147 ushort totalLen; | |
148 ushort dataTypeOffset; | |
149 ushort serviceListOffset; | |
150 ushort protocolListOffset; | |
151 ushort commentStringOffset; | |
152 } | |
153 | |
154 extern (C) | |
155 { | |
156 NSLMgrNotifyUPP NewNSLMgrNotifyUPP (NSLMgrNotifyProcPtr userRoutine); | |
157 NSLClientNotifyUPP NewNSLClientNotifyUPP (NSLClientNotifyProcPtr userRoutine); | |
158 void DisposeNSLMgrNotifyUPP (NSLMgrNotifyUPP userUPP); | |
159 void DisposeNSLClientNotifyUPP (NSLClientNotifyUPP userUPP); | |
160 void InvokeNSLMgrNotifyUPP (NSLPluginAsyncInfo* thePluginAsyncInfo, NSLMgrNotifyUPP userUPP); | |
161 void InvokeNSLClientNotifyUPP (NSLClientAsyncInfo* theClientAsyncInfo, NSLClientNotifyUPP userUPP); | |
162 } |