NSLCore.pas 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046
  1. {
  2. File: NSLCore/NSLCore.h
  3. Contains: Interface to API for using the NSL Manager
  4. Version: NSLCore-145~102
  5. Copyright: © 2000-2008 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 308
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  17. {$mode macpas}
  18. {$modeswitch cblocks}
  19. {$packenum 1}
  20. {$macro on}
  21. {$inline on}
  22. {$calling mwpascal}
  23. {$IFNDEF FPC_DOTTEDUNITS}
  24. unit NSLCore;
  25. {$ENDIF FPC_DOTTEDUNITS}
  26. interface
  27. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  28. {$setc GAP_INTERFACES_VERSION := $0308}
  29. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  30. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  31. {$endc}
  32. {$ifc defined CPUPOWERPC and defined CPUI386}
  33. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  34. {$endc}
  35. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  36. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  37. {$endc}
  38. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  39. {$setc __ppc__ := 1}
  40. {$elsec}
  41. {$setc __ppc__ := 0}
  42. {$endc}
  43. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  44. {$setc __ppc64__ := 1}
  45. {$elsec}
  46. {$setc __ppc64__ := 0}
  47. {$endc}
  48. {$ifc not defined __i386__ and defined CPUI386}
  49. {$setc __i386__ := 1}
  50. {$elsec}
  51. {$setc __i386__ := 0}
  52. {$endc}
  53. {$ifc not defined __x86_64__ and defined CPUX86_64}
  54. {$setc __x86_64__ := 1}
  55. {$elsec}
  56. {$setc __x86_64__ := 0}
  57. {$endc}
  58. {$ifc not defined __arm__ and defined CPUARM}
  59. {$setc __arm__ := 1}
  60. {$elsec}
  61. {$setc __arm__ := 0}
  62. {$endc}
  63. {$ifc not defined __arm64__ and defined CPUAARCH64}
  64. {$setc __arm64__ := 1}
  65. {$elsec}
  66. {$setc __arm64__ := 0}
  67. {$endc}
  68. {$ifc defined cpu64}
  69. {$setc __LP64__ := 1}
  70. {$elsec}
  71. {$setc __LP64__ := 0}
  72. {$endc}
  73. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  74. {$error Conflicting definitions for __ppc__ and __i386__}
  75. {$endc}
  76. {$ifc defined __ppc__ and __ppc__}
  77. {$setc TARGET_CPU_PPC := TRUE}
  78. {$setc TARGET_CPU_PPC64 := FALSE}
  79. {$setc TARGET_CPU_X86 := FALSE}
  80. {$setc TARGET_CPU_X86_64 := FALSE}
  81. {$setc TARGET_CPU_ARM := FALSE}
  82. {$setc TARGET_CPU_ARM64 := FALSE}
  83. {$setc TARGET_OS_MAC := TRUE}
  84. {$setc TARGET_OS_IPHONE := FALSE}
  85. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  86. {$setc TARGET_OS_EMBEDDED := FALSE}
  87. {$elifc defined __ppc64__ and __ppc64__}
  88. {$setc TARGET_CPU_PPC := FALSE}
  89. {$setc TARGET_CPU_PPC64 := TRUE}
  90. {$setc TARGET_CPU_X86 := FALSE}
  91. {$setc TARGET_CPU_X86_64 := FALSE}
  92. {$setc TARGET_CPU_ARM := FALSE}
  93. {$setc TARGET_CPU_ARM64 := FALSE}
  94. {$setc TARGET_OS_MAC := TRUE}
  95. {$setc TARGET_OS_IPHONE := FALSE}
  96. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  97. {$setc TARGET_OS_EMBEDDED := FALSE}
  98. {$elifc defined __i386__ and __i386__}
  99. {$setc TARGET_CPU_PPC := FALSE}
  100. {$setc TARGET_CPU_PPC64 := FALSE}
  101. {$setc TARGET_CPU_X86 := TRUE}
  102. {$setc TARGET_CPU_X86_64 := FALSE}
  103. {$setc TARGET_CPU_ARM := FALSE}
  104. {$setc TARGET_CPU_ARM64 := FALSE}
  105. {$ifc defined iphonesim}
  106. {$setc TARGET_OS_MAC := FALSE}
  107. {$setc TARGET_OS_IPHONE := TRUE}
  108. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  109. {$elsec}
  110. {$setc TARGET_OS_MAC := TRUE}
  111. {$setc TARGET_OS_IPHONE := FALSE}
  112. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  113. {$endc}
  114. {$setc TARGET_OS_EMBEDDED := FALSE}
  115. {$elifc defined __x86_64__ and __x86_64__}
  116. {$setc TARGET_CPU_PPC := FALSE}
  117. {$setc TARGET_CPU_PPC64 := FALSE}
  118. {$setc TARGET_CPU_X86 := FALSE}
  119. {$setc TARGET_CPU_X86_64 := TRUE}
  120. {$setc TARGET_CPU_ARM := FALSE}
  121. {$setc TARGET_CPU_ARM64 := FALSE}
  122. {$ifc defined iphonesim}
  123. {$setc TARGET_OS_MAC := FALSE}
  124. {$setc TARGET_OS_IPHONE := TRUE}
  125. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  126. {$elsec}
  127. {$setc TARGET_OS_MAC := TRUE}
  128. {$setc TARGET_OS_IPHONE := FALSE}
  129. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  130. {$endc}
  131. {$setc TARGET_OS_EMBEDDED := FALSE}
  132. {$elifc defined __arm__ and __arm__}
  133. {$setc TARGET_CPU_PPC := FALSE}
  134. {$setc TARGET_CPU_PPC64 := FALSE}
  135. {$setc TARGET_CPU_X86 := FALSE}
  136. {$setc TARGET_CPU_X86_64 := FALSE}
  137. {$setc TARGET_CPU_ARM := TRUE}
  138. {$setc TARGET_CPU_ARM64 := FALSE}
  139. {$setc TARGET_OS_MAC := FALSE}
  140. {$setc TARGET_OS_IPHONE := TRUE}
  141. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  142. {$setc TARGET_OS_EMBEDDED := TRUE}
  143. {$elifc defined __arm64__ and __arm64__}
  144. {$setc TARGET_CPU_PPC := FALSE}
  145. {$setc TARGET_CPU_PPC64 := FALSE}
  146. {$setc TARGET_CPU_X86 := FALSE}
  147. {$setc TARGET_CPU_X86_64 := FALSE}
  148. {$setc TARGET_CPU_ARM := FALSE}
  149. {$setc TARGET_CPU_ARM64 := TRUE}
  150. {$ifc defined ios}
  151. {$setc TARGET_OS_MAC := FALSE}
  152. {$setc TARGET_OS_IPHONE := TRUE}
  153. {$setc TARGET_OS_EMBEDDED := TRUE}
  154. {$elsec}
  155. {$setc TARGET_OS_MAC := TRUE}
  156. {$setc TARGET_OS_IPHONE := FALSE}
  157. {$setc TARGET_OS_EMBEDDED := FALSE}
  158. {$endc}
  159. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  160. {$elsec}
  161. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  162. {$endc}
  163. {$ifc defined __LP64__ and __LP64__ }
  164. {$setc TARGET_CPU_64 := TRUE}
  165. {$elsec}
  166. {$setc TARGET_CPU_64 := FALSE}
  167. {$endc}
  168. {$ifc defined FPC_BIG_ENDIAN}
  169. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  170. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  171. {$elifc defined FPC_LITTLE_ENDIAN}
  172. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  173. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  174. {$elsec}
  175. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  176. {$endc}
  177. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  178. {$setc CALL_NOT_IN_CARBON := FALSE}
  179. {$setc OLDROUTINENAMES := FALSE}
  180. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  181. {$setc OPAQUE_UPP_TYPES := TRUE}
  182. {$setc OTCARBONAPPLICATION := TRUE}
  183. {$setc OTKERNEL := FALSE}
  184. {$setc PM_USE_SESSION_APIS := TRUE}
  185. {$setc TARGET_API_MAC_CARBON := TRUE}
  186. {$setc TARGET_API_MAC_OS8 := FALSE}
  187. {$setc TARGET_API_MAC_OSX := TRUE}
  188. {$setc TARGET_CARBON := TRUE}
  189. {$setc TARGET_CPU_68K := FALSE}
  190. {$setc TARGET_CPU_MIPS := FALSE}
  191. {$setc TARGET_CPU_SPARC := FALSE}
  192. {$setc TARGET_OS_UNIX := FALSE}
  193. {$setc TARGET_OS_WIN32 := FALSE}
  194. {$setc TARGET_RT_MAC_68881 := FALSE}
  195. {$setc TARGET_RT_MAC_CFM := FALSE}
  196. {$setc TARGET_RT_MAC_MACHO := TRUE}
  197. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  198. {$setc TYPE_BOOL := FALSE}
  199. {$setc TYPE_EXTENDED := FALSE}
  200. {$setc TYPE_LONGLONG := TRUE}
  201. {$IFDEF FPC_DOTTEDUNITS}
  202. uses MacOsApi.MacTypes,MacOsApi.MacErrors,MacOsApi.CodeFragments,MacOsApi.Files,MacOsApi.Threads;
  203. {$ELSE FPC_DOTTEDUNITS}
  204. uses MacTypes,MacErrors,CodeFragments,Files,Threads;
  205. {$ENDIF FPC_DOTTEDUNITS}
  206. {$endc} {not MACOSALLINCLUDE}
  207. {$ifc TARGET_OS_MAC}
  208. {$ALIGN MAC68K}
  209. const
  210. kNSLMinSystemVersion = $0900; { equivalent to 9.0}
  211. kNSLMinOTVersion = $0130; { equivalent to 1.3}
  212. const
  213. kNSLDefaultListSize = 256; { default list size for service and protocol lists}
  214. const
  215. kNSLURLDelimiter = 44; { delimits URL's within memory buffers}
  216. const
  217. kNSLNoContext = 0; { the default context for NSLError structs}
  218. type
  219. NSLError = record
  220. theErr: OSStatus;
  221. theContext: UInt32;
  222. end;
  223. NSLErrorPtr = ^NSLError;
  224. const
  225. { Constants to use with NSLPrepareRequest}
  226. { kNSLDuplicateSearchInProgress is not strictly an error. The client is free to ignore}
  227. { this result, and nothing bad will happen if it does. It is}
  228. { informational only.}
  229. kNSLDuplicateSearchInProgress = 100;
  230. kNSLUserCanceled = userCanceledErr; { User hit cancel from the NSLStandardGetURL dialog }
  231. { Invalid enumeratorRef }
  232. kNSLInvalidEnumeratorRef = 0; { this is not an error; it is the equiv to a NULL ptr}
  233. type
  234. NSLSearchState = UInt16;
  235. const
  236. { State codes for notifiers.}
  237. kNSLSearchStateBufferFull = 1;
  238. kNSLSearchStateOnGoing = 2;
  239. kNSLSearchStateComplete = 3;
  240. kNSLSearchStateStalled = 4;
  241. kNSLWaitingForContinue = 5;
  242. type
  243. NSLEventCode = UInt32;
  244. const
  245. { Event codes}
  246. kNSLServicesLookupDataEvent = 6;
  247. kNSLNeighborhoodLookupDataEvent = 7;
  248. kNSLNewDataEvent = 8;
  249. kNSLContinueLookupEvent = 9;
  250. type
  251. NSLClientRef = UInt32;
  252. NSLRequestRef = UInt32;
  253. NSLOneBasedIndex = UInt32;
  254. NSLPath = CStringPtr;
  255. NSLServiceType = CStringPtr;
  256. NSLServicesList = Handle;
  257. NSLNeighborhood = UInt8Ptr;
  258. {
  259. cstring which is a comma delimited list of protocols which can be used to
  260. create a NSLProtocolList internally
  261. }
  262. { the async information block for client<->manager interaction}
  263. type
  264. NSLClientAsyncInfo = record
  265. clientContextPtr: UnivPtr; { set by the client for its own use}
  266. mgrContextPtr: UnivPtr; { set by NSL mgr; ptr to request object ptr}
  267. resultBuffer: CStringPtr;
  268. bufferLen: SIGNEDLONG;
  269. maxBufferSize: SIGNEDLONG;
  270. startTime: UInt32; { when the search starts, to use with maxSearchTime to determine time-out condition}
  271. intStartTime: UInt32; { used with alertInterval}
  272. maxSearchTime: UInt32; { total time for search, in ticks (0 == no time limit)}
  273. alertInterval: UInt32; { call client's notifier or return, every this many ticks ( 0 == don't use this param)}
  274. totalItems: UInt32; { total number of tuples currently in buffer}
  275. alertThreshold: UInt32; { call client's notifier or return, every this many items found ( 0 == don't use this param)}
  276. searchState: NSLSearchState;
  277. searchResult: NSLError;
  278. searchDataType: NSLEventCode; { this is a data type code which allows the client's asyncNotifier to properly}
  279. { handle the data in resultBuffer.}
  280. end;
  281. NSLClientAsyncInfoPtr = ^NSLClientAsyncInfo;
  282. { the async information block plugin<->manager interaction}
  283. type
  284. NSLPluginAsyncInfo = record
  285. mgrContextPtr: UnivPtr; { set by NSL mgr; ptr to request object ptr}
  286. pluginContextPtr: UnivPtr; { set/used by individual plugins}
  287. pluginPtr: UnivPtr; { ptr to the plugin object waiting for continue lookup call}
  288. resultBuffer: CStringPtr; { set by plugin to point at data}
  289. bufferLen: SIGNEDLONG;
  290. maxBufferSize: SIGNEDLONG;
  291. maxSearchTime: UInt32; { total time for search, in ticks (0 == no time limit)}
  292. reserved1: UInt32;
  293. reserved2: UInt32;
  294. reserved3: UInt32;
  295. clientRef: NSLClientRef;
  296. requestRef: NSLRequestRef;
  297. searchState: NSLSearchState;
  298. searchResult: OSStatus;
  299. end;
  300. NSLPluginAsyncInfoPtr = ^NSLPluginAsyncInfo;
  301. { the manager asynchronous notifier routine.}
  302. type
  303. NSLMgrNotifyProcPtr = procedure( var thePluginAsyncInfo: NSLPluginAsyncInfo );
  304. { the client asynchronous notifier routine.}
  305. type
  306. NSLClientNotifyProcPtr = procedure( var theClientAsyncInfo: NSLClientAsyncInfo );
  307. NSLMgrNotifyUPP = NSLMgrNotifyProcPtr;
  308. NSLClientNotifyUPP = NSLClientNotifyProcPtr;
  309. {
  310. * NewNSLMgrNotifyUPP()
  311. *
  312. * Availability:
  313. * Mac OS X: in version 10.0 and later in CoreServices.framework
  314. * CarbonLib: in CarbonLib 1.0 and later
  315. * Non-Carbon CFM: available as macro/inline
  316. }
  317. function NewNSLMgrNotifyUPP( userRoutine: NSLMgrNotifyProcPtr ): NSLMgrNotifyUPP; external name '_NewNSLMgrNotifyUPP';
  318. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  319. {
  320. * NewNSLClientNotifyUPP()
  321. *
  322. * Availability:
  323. * Mac OS X: in version 10.0 and later in CoreServices.framework
  324. * CarbonLib: in CarbonLib 1.0 and later
  325. * Non-Carbon CFM: available as macro/inline
  326. }
  327. function NewNSLClientNotifyUPP( userRoutine: NSLClientNotifyProcPtr ): NSLClientNotifyUPP; external name '_NewNSLClientNotifyUPP';
  328. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  329. {
  330. * DisposeNSLMgrNotifyUPP()
  331. *
  332. * Availability:
  333. * Mac OS X: in version 10.0 and later in CoreServices.framework
  334. * CarbonLib: in CarbonLib 1.0 and later
  335. * Non-Carbon CFM: available as macro/inline
  336. }
  337. procedure DisposeNSLMgrNotifyUPP( userUPP: NSLMgrNotifyUPP ); external name '_DisposeNSLMgrNotifyUPP';
  338. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  339. {
  340. * DisposeNSLClientNotifyUPP()
  341. *
  342. * Availability:
  343. * Mac OS X: in version 10.0 and later in CoreServices.framework
  344. * CarbonLib: in CarbonLib 1.0 and later
  345. * Non-Carbon CFM: available as macro/inline
  346. }
  347. procedure DisposeNSLClientNotifyUPP( userUPP: NSLClientNotifyUPP ); external name '_DisposeNSLClientNotifyUPP';
  348. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  349. {
  350. * InvokeNSLMgrNotifyUPP()
  351. *
  352. * Availability:
  353. * Mac OS X: in version 10.0 and later in CoreServices.framework
  354. * CarbonLib: in CarbonLib 1.0 and later
  355. * Non-Carbon CFM: available as macro/inline
  356. }
  357. procedure InvokeNSLMgrNotifyUPP( var thePluginAsyncInfo: NSLPluginAsyncInfo; userUPP: NSLMgrNotifyUPP ); external name '_InvokeNSLMgrNotifyUPP';
  358. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  359. {
  360. * InvokeNSLClientNotifyUPP()
  361. *
  362. * Availability:
  363. * Mac OS X: in version 10.0 and later in CoreServices.framework
  364. * CarbonLib: in CarbonLib 1.0 and later
  365. * Non-Carbon CFM: available as macro/inline
  366. }
  367. procedure InvokeNSLClientNotifyUPP( var theClientAsyncInfo: NSLClientAsyncInfo; userUPP: NSLClientNotifyUPP ); external name '_InvokeNSLClientNotifyUPP';
  368. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  369. {
  370. this struct is a format for dealing with our internal data representation. Typed data will be contiguous chunk of
  371. memory, with the first 4 bytes being a data "descriptor".
  372. }
  373. type
  374. NSLTypedData = record
  375. dataType: UNSIGNEDLONG;
  376. lengthOfData: UNSIGNEDLONG;
  377. { void* theData; }
  378. end;
  379. NSLTypedDataPtr = ^NSLTypedData;
  380. const
  381. kNSLDataType = FourCharCode('NSL_');
  382. {
  383. This is just a header at the beginning of a handle that stores our list of service types.
  384. Each service type is a pascal string, so each service type starts after the end of the
  385. previous one.
  386. }
  387. type
  388. NSLServicesListHeader = record
  389. numServices: UNSIGNEDLONG;
  390. logicalLen: UNSIGNEDLONG; { length of all usable data in handle}
  391. { Ptr firstService; }
  392. end;
  393. NSLServicesListHeaderPtr = ^NSLServicesListHeader;
  394. { some defs for common protocols}
  395. const
  396. kSLPProtocolType = 'SLP';
  397. const
  398. kDNSProtocolType = 'DNS';
  399. const
  400. kLDAPProtocolType = 'LDAP';
  401. const
  402. kNBPProtocolType = 'NBP';
  403. const
  404. kNSLDirectoryServiceProtocolType = 'DirService';
  405. {
  406. general information from a plug-in. Includes supported protocols, data types and services,
  407. as well as an info/comment string describing the function of the plug-in in human-readable
  408. form. The offsets point to the beginning of each list of data returned, and the protocol
  409. data offset is the startOfData member of the struct
  410. }
  411. type
  412. NSLPluginData = record
  413. reserved1: SIGNEDLONG;
  414. reserved2: SIGNEDLONG;
  415. reserved3: SIGNEDLONG;
  416. supportsRegistration: Boolean;
  417. isPurgeable: Boolean;
  418. totalLen: UInt16; { length of everything, including header}
  419. dataTypeOffset: UInt16;
  420. serviceListOffset: UInt16;
  421. protocolListOffset: UInt16;
  422. commentStringOffset: UInt16;
  423. { AnsiChar* startOfData; }
  424. { protocol data is first on the list}
  425. end;
  426. NSLPluginDataPtr = ^NSLPluginData;
  427. {
  428. -----------------------------------------------------------------------------
  429. Finding out if the library is present and getting its version
  430. -----------------------------------------------------------------------------
  431. }
  432. {$ifc not TARGET_CPU_64}
  433. {
  434. * NSLLibraryVersion() *** DEPRECATED ***
  435. *
  436. * Availability:
  437. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  438. * CarbonLib: in CarbonLib 1.0 and later
  439. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  440. }
  441. function NSLLibraryVersion: UInt32; external name '_NSLLibraryVersion';
  442. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  443. {$endc} {not TARGET_CPU_64}
  444. // #define NSLLibraryPresent() true
  445. {
  446. -----------------------------------------------------------------------------
  447. High level API calls: the following two calls are ALL an application needs
  448. to register/deregister its service.
  449. If you use these, you don't need to make any of the other calls to NSLAPI
  450. (including NSLOpenNavigationAPI)
  451. -----------------------------------------------------------------------------
  452. }
  453. { <--- error code from registration }
  454. { ---> urlToRegister is a null terminated url that has only legal characters defined for URLs. Use HexEncodeText to encode}
  455. { portions of the url that have illegal characters }
  456. { ---> neighborhoodToRegisterIn is an optional parameter for explicitly defining a neighborhood to register in.
  457. If parameter is NULL, then the plugins will determine where to register the service }
  458. {$ifc not TARGET_CPU_64}
  459. {
  460. * NSLStandardRegisterURL() *** DEPRECATED ***
  461. *
  462. * Availability:
  463. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  464. * CarbonLib: in CarbonLib 1.0 and later
  465. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  466. }
  467. function NSLStandardRegisterURL( urlToRegister: NSLPath; neighborhoodToRegisterIn: NSLNeighborhood { can be NULL } ): NSLError; external name '_NSLStandardRegisterURL';
  468. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  469. { <--- error code from registration }
  470. { ---> urlToRegister is a null terminated url that has only legal characters defined for URLs. Use HexEncodeText to encode}
  471. { portions of the url that have illegal characters }
  472. { ---> neighborhoodToDeregisterIn is an optional parameter for explicitly defining a neighborhood to register in.
  473. If parameter is NULL, then the plugins will determine where to register the service }
  474. {
  475. * NSLStandardDeregisterURL() *** DEPRECATED ***
  476. *
  477. * Availability:
  478. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  479. * CarbonLib: in CarbonLib 1.0 and later
  480. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  481. }
  482. function NSLStandardDeregisterURL( urlToDeregister: NSLPath; neighborhoodToDeregisterIn: NSLNeighborhood { can be NULL } ): NSLError; external name '_NSLStandardDeregisterURL';
  483. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  484. {-----------------------------------------------------------------------------}
  485. {
  486. * NSLHexEncodeText() *** DEPRECATED ***
  487. *
  488. * Availability:
  489. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  490. * CarbonLib: in CarbonLib 1.0 and later
  491. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  492. }
  493. function NSLHexEncodeText( rawText: ConstCStringPtr; rawTextLen: UInt16; newTextBuffer: CStringPtr; var newTextBufferLen: UInt16; var textChanged: Boolean ): OSStatus; external name '_NSLHexEncodeText';
  494. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  495. {
  496. * NSLHexDecodeText() *** DEPRECATED ***
  497. *
  498. * Availability:
  499. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  500. * CarbonLib: in CarbonLib 1.0 and later
  501. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  502. }
  503. function NSLHexDecodeText( encodedText: ConstCStringPtr; encodedTextLen: UInt16; decodedTextBuffer: CStringPtr; var decodedTextBufferLen: UInt16; var textChanged: Boolean ): OSStatus; external name '_NSLHexDecodeText';
  504. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  505. {
  506. -----------------------------------------------------------------------------
  507. Basic API Utility calls: sufficient to create, and parse data structures
  508. -----------------------------------------------------------------------------
  509. }
  510. {
  511. * NSLMakeNewServicesList() *** DEPRECATED ***
  512. *
  513. * Availability:
  514. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  515. * CarbonLib: in CarbonLib 1.0 and later
  516. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  517. }
  518. function NSLMakeNewServicesList( initialServiceList: ConstCStringPtr ): NSLServicesList; external name '_NSLMakeNewServicesList';
  519. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  520. {
  521. * NSLAddServiceToServicesList() *** DEPRECATED ***
  522. *
  523. * Availability:
  524. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  525. * CarbonLib: in CarbonLib 1.0 and later
  526. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  527. }
  528. function NSLAddServiceToServicesList( serviceList: NSLServicesList; serviceType: NSLServiceType ): NSLError; external name '_NSLAddServiceToServicesList';
  529. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  530. {
  531. * NSLDisposeServicesList() *** DEPRECATED ***
  532. *
  533. * Availability:
  534. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  535. * CarbonLib: in CarbonLib 1.0 and later
  536. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  537. }
  538. procedure NSLDisposeServicesList( theList: NSLServicesList ); external name '_NSLDisposeServicesList';
  539. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  540. {
  541. The name reflects the name of the Neighborhood, i.e. "apple.com." or "AppleTalk Zone One".
  542. The protocolList is a comma delimited list of protocols that the Neighborhood might exist in.
  543. If the user passes in NULL, then all protocols will be queried. The result must be disposed
  544. of by the user by calling NSLFreeNeighborhood.
  545. }
  546. {
  547. * NSLMakeNewNeighborhood() *** DEPRECATED ***
  548. *
  549. * Availability:
  550. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  551. * CarbonLib: in CarbonLib 1.0 and later
  552. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  553. }
  554. function NSLMakeNewNeighborhood( name: ConstCStringPtr; protocolList: ConstCStringPtr { can be NULL } ): NSLNeighborhood; external name '_NSLMakeNewNeighborhood';
  555. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  556. { creates an exact copy of an existing neighborhood }
  557. {
  558. * NSLCopyNeighborhood() *** DEPRECATED ***
  559. *
  560. * Availability:
  561. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  562. * CarbonLib: in CarbonLib 1.0 and later
  563. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  564. }
  565. function NSLCopyNeighborhood( neighborhood: NSLNeighborhood ): NSLNeighborhood; external name '_NSLCopyNeighborhood';
  566. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  567. {
  568. * NSLFreeNeighborhood() *** DEPRECATED ***
  569. *
  570. * Availability:
  571. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  572. * CarbonLib: in CarbonLib 1.0 and later
  573. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  574. }
  575. function NSLFreeNeighborhood( neighborhood: NSLNeighborhood ): NSLNeighborhood; external name '_NSLFreeNeighborhood';
  576. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  577. {
  578. * NSLGetNameFromNeighborhood() *** DEPRECATED ***
  579. *
  580. * Availability:
  581. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  582. * CarbonLib: in CarbonLib 1.0 and later
  583. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  584. }
  585. procedure NSLGetNameFromNeighborhood( neighborhood: NSLNeighborhood; var name: CStringPtr; var length: SIGNEDLONG ); external name '_NSLGetNameFromNeighborhood';
  586. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  587. {
  588. create a block of formatted data, pointed to by newDataPtr. This will be used
  589. in calls (typically request-related calls) for plug-ins that handle the NSL data type.
  590. }
  591. {
  592. * NSLMakeServicesRequestPB() *** DEPRECATED ***
  593. *
  594. * Availability:
  595. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  596. * CarbonLib: in CarbonLib 1.0 and later
  597. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  598. }
  599. function NSLMakeServicesRequestPB( serviceList: NSLServicesList; var newDataPtr: NSLTypedDataPtr ): OSStatus; external name '_NSLMakeServicesRequestPB';
  600. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  601. { releases any storage created with MakeXXXPB calls, associated with TypedData.}
  602. {
  603. * NSLFreeTypedDataPtr() *** DEPRECATED ***
  604. *
  605. * Availability:
  606. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  607. * CarbonLib: in CarbonLib 1.0 and later
  608. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  609. }
  610. function NSLFreeTypedDataPtr( nslTypeData: NSLTypedDataPtr ): NSLTypedDataPtr; external name '_NSLFreeTypedDataPtr';
  611. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  612. {
  613. utility function that returns whether a url was found, a pointer to the beginning
  614. of the url, and the length of the URL.
  615. }
  616. {
  617. * NSLGetNextUrl() *** DEPRECATED ***
  618. *
  619. * Availability:
  620. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  621. * CarbonLib: in CarbonLib 1.0 and later
  622. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  623. }
  624. function NSLGetNextUrl( infoPtr: NSLClientAsyncInfoPtr; var urlPtr: CStringPtr; var urlLength: SIGNEDLONG ): Boolean; external name '_NSLGetNextUrl';
  625. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  626. {
  627. utility function that returns whether a Neighborhood was found, a pointer to the beginning
  628. of the Neighborhood, and the length of the Neighborhood.
  629. }
  630. {
  631. * NSLGetNextNeighborhood() *** DEPRECATED ***
  632. *
  633. * Availability:
  634. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  635. * CarbonLib: in CarbonLib 1.0 and later
  636. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  637. }
  638. function NSLGetNextNeighborhood( infoPtr: NSLClientAsyncInfoPtr; var neighborhood: NSLNeighborhood; var neighborhoodLength: SIGNEDLONG ): Boolean; external name '_NSLGetNextNeighborhood';
  639. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  640. {
  641. NSLErrorToString: convert a numeric error code to its string equivalent. Caller must
  642. have allocated sufficient space to store both strings. (Max 255 chars each)
  643. The errorString parameter will return a textual explanation of what is wrong,
  644. while the solutionString returns a possible solution to get around the problem
  645. }
  646. {
  647. * NSLErrorToString() *** DEPRECATED ***
  648. *
  649. * Availability:
  650. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  651. * CarbonLib: in CarbonLib 1.0 and later
  652. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  653. }
  654. function NSLErrorToString( theErr: NSLError; errorString: CStringPtr; solutionString: CStringPtr ): OSStatus; external name '_NSLErrorToString';
  655. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  656. {
  657. -----------------------------------------------------------------------------
  658. Basic API calls: sufficient to create simple requests, and receive answers
  659. -----------------------------------------------------------------------------
  660. }
  661. {
  662. * NSLOpenNavigationAPI() *** DEPRECATED ***
  663. *
  664. * Availability:
  665. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  666. * CarbonLib: in CarbonLib 1.0 and later
  667. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  668. }
  669. function NSLOpenNavigationAPI( var newRef: NSLClientRef ): OSStatus; external name '_NSLOpenNavigationAPI';
  670. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  671. {
  672. * NSLCloseNavigationAPI() *** DEPRECATED ***
  673. *
  674. * Availability:
  675. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  676. * CarbonLib: in CarbonLib 1.0 and later
  677. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  678. }
  679. procedure NSLCloseNavigationAPI( theClient: NSLClientRef ); external name '_NSLCloseNavigationAPI';
  680. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  681. {
  682. NSLPrepareRequest: creates an NSLRequestRef, sets up some internal data
  683. notifier is an NSLClientNotifyUPP that will be called when data is available, when the lookup has
  684. completed, or if an error occurs. When the notifier is called, the cookie will be the NSLRequestRef.
  685. If notifier is NULL, then the NSLManager will assume that the request is made synchronously. This
  686. should only be used while in a separate thread, so that the client app can still process events, etc.
  687. contextPtr is a void* which is passed as the contextPtr argument when the notifier is called.
  688. upon exit:
  689. 1) ref will contain a pointer to a NSLRequestRef which must be passed to all other functions
  690. which require a NSLRequestRef.
  691. 2) infoPtr will point to a newly created ClientAsycnInfoPtr which will be disposed by the manager when the search is completed
  692. NOTE: Only one search can be running at a time per clientRef.
  693. }
  694. {
  695. * NSLPrepareRequest() *** DEPRECATED ***
  696. *
  697. * Availability:
  698. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  699. * CarbonLib: in CarbonLib 1.0 and later
  700. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  701. }
  702. function NSLPrepareRequest( notifier: NSLClientNotifyUPP; contextPtr: UnivPtr; theClient: NSLClientRef; var ref: NSLRequestRef; bufPtr: CStringPtr; bufLen: UNSIGNEDLONG; var infoPtr: NSLClientAsyncInfoPtr ): NSLError; external name '_NSLPrepareRequest';
  703. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  704. {
  705. NSLStartNeighborhoodLookup: looking for neighborhoods associated with or neighboring a particular neighborhood
  706. Passing in NULL for neighborhood will generate a list of a default neighborhood(s)
  707. }
  708. {
  709. * NSLStartNeighborhoodLookup() *** DEPRECATED ***
  710. *
  711. * Availability:
  712. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  713. * CarbonLib: in CarbonLib 1.0 and later
  714. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  715. }
  716. function NSLStartNeighborhoodLookup( ref: NSLRequestRef; neighborhood: NSLNeighborhood; var asyncInfo: NSLClientAsyncInfo ): NSLError; external name '_NSLStartNeighborhoodLookup';
  717. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  718. {
  719. NSLStartServicesLookup: starts looking for entities if the specified type in the specified neighborhood
  720. }
  721. {
  722. * NSLStartServicesLookup() *** DEPRECATED ***
  723. *
  724. * Availability:
  725. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  726. * CarbonLib: in CarbonLib 1.0 and later
  727. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  728. }
  729. function NSLStartServicesLookup( ref: NSLRequestRef; neighborhood: NSLNeighborhood; requestData: NSLTypedDataPtr; var asyncInfo: NSLClientAsyncInfo ): NSLError; external name '_NSLStartServicesLookup';
  730. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  731. { NSLContinueLookup: continues a paused/outstanding lookup}
  732. {
  733. * NSLContinueLookup() *** DEPRECATED ***
  734. *
  735. * Availability:
  736. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  737. * CarbonLib: in CarbonLib 1.0 and later
  738. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  739. }
  740. function NSLContinueLookup( var asyncInfo: NSLClientAsyncInfo ): NSLError; external name '_NSLContinueLookup';
  741. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  742. { NSLCancelRequest: cancels an ongoing search}
  743. {
  744. * NSLCancelRequest() *** DEPRECATED ***
  745. *
  746. * Availability:
  747. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  748. * CarbonLib: in CarbonLib 1.0 and later
  749. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  750. }
  751. function NSLCancelRequest( ref: NSLRequestRef ): NSLError; external name '_NSLCancelRequest';
  752. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  753. {
  754. NSLDeleteRequest: deletes info associated with this ref. The ClientAsyncInfoPtr will no longer be valid
  755. This must be called when the client is no longer using this requestRef.
  756. }
  757. {
  758. * NSLDeleteRequest() *** DEPRECATED ***
  759. *
  760. * Availability:
  761. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  762. * CarbonLib: in CarbonLib 1.0 and later
  763. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  764. }
  765. function NSLDeleteRequest( ref: NSLRequestRef ): NSLError; external name '_NSLDeleteRequest';
  766. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  767. {
  768. -----------------------------------------------------------------------------
  769. Utility API calls: use these accessors to manipulate NSL's typed data
  770. -----------------------------------------------------------------------------
  771. }
  772. { NSLParseServicesRequestPB provides the inverse of NSLMakeRequestPB, filling out the offsets found within newDataPtr}
  773. { <--- returns an OSStatus if any errors occur parsing the data }
  774. { <--- newDataPtr is the construct passed to the plugin }
  775. { ---> serviceListPtr is the address of a pointer which will be set to point at the portion of the newDataPtr that holds the serviceList to be searched }
  776. { ---> serviceListLen is the length of the serviceListPtr data pointed to by serviceListPtr }
  777. {
  778. * NSLParseServicesRequestPB() *** DEPRECATED ***
  779. *
  780. * Availability:
  781. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  782. * CarbonLib: in CarbonLib 1.0 and later
  783. * Non-Carbon CFM: in NSLPPCLib 1.0 and later
  784. }
  785. function NSLParseServicesRequestPB( newDataPtr: NSLTypedDataPtr; var serviceListPtr: CStringPtr; var serviceListLen: UInt16 ): OSStatus; external name '_NSLParseServicesRequestPB';
  786. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  787. { NSLParseServiceRegistrationPB provides for breaking apart a registration request from a client to a plugin }
  788. { <--- returns an OSStatus if any errors occur parsing the data }
  789. { <--- newDataPtr is the construct passed to the plugin }
  790. { ---> neighborhoodPtr gets set to point at the portion of the newDataPtr that contains the neighborhood }
  791. { ---> neighborhoodLen is the length of the neighborhood pointed to by neighborhoodPtr }
  792. { ---> urlPtr is the address of a pointer which will be set to point at the portion of the newDataPtr that holds the url to be registered }
  793. { ---> urlLen is the length of the url data pointed to by urlPtr }
  794. {
  795. * NSLParseServiceRegistrationPB() *** DEPRECATED ***
  796. *
  797. * Availability:
  798. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  799. * CarbonLib: in CarbonLib 1.0 and later
  800. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  801. }
  802. function NSLParseServiceRegistrationPB( newDataPtr: NSLTypedDataPtr; var neighborhoodPtr: NSLNeighborhood; var neighborhoodLen: UInt16; var urlPtr: CStringPtr; var urlLen: UInt16 ): OSStatus; external name '_NSLParseServiceRegistrationPB';
  803. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  804. { NSLGetErrorStringsFromResource is obsolete in X. It will ignore the fileSpecPtr }
  805. { and errorResID parameters and return the standard error strings. }
  806. { NSLGetErrorStringsFromResource makes a basic assumption: }
  807. { errorString and solutionString both point to valid memory of at least 256 bytes! }
  808. { <--- returns an OSStatus if any errors occur }
  809. { ---> theErr is an OSStatus to be matched against a resource list of errors }
  810. { ---> fileSpecPtr is a FSSpecPtr to the resource containing the list of errors }
  811. { ---> errorResID is the resourceID of the NSLI resource of the list of errors }
  812. { <--> errorString is a pointer to valid memory of at least 256 bytes which will be filled out by the error portion of the error string }
  813. { <--> solutionString is a pointer to valid memory of at least 256 bytes which will be filled out by the solution portion of the error string }
  814. {
  815. * NSLGetErrorStringsFromResource() *** DEPRECATED ***
  816. *
  817. * Availability:
  818. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  819. * CarbonLib: in CarbonLib 1.0 and later
  820. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  821. }
  822. function NSLGetErrorStringsFromResource( theErr: OSStatus; const (*var*) fileSpecPtr: FSSpec; errorResID: SInt16; errorString: CStringPtr; solutionString: CStringPtr ): OSStatus; external name '_NSLGetErrorStringsFromResource';
  823. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  824. { <--- Returns true if given service is in the given service list }
  825. { ---> serviceList is a valid NSLServicesList containing information about services to be searched }
  826. { ---> svcToFind is an NSLServiceType of a particular service to check if it is in the serviceList }
  827. {
  828. * NSLServiceIsInServiceList() *** DEPRECATED ***
  829. *
  830. * Availability:
  831. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  832. * CarbonLib: in CarbonLib 1.0 and later
  833. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  834. }
  835. function NSLServiceIsInServiceList( serviceList: NSLServicesList; svcToFind: NSLServiceType ): Boolean; external name '_NSLServiceIsInServiceList';
  836. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  837. { <--- returns an OSStatus if any errors occur parsing the data }
  838. { ---> svcString is the address of a pointer which will be set to point at the portion of theURL that holds the serviceType of theURL }
  839. { ---> svcLen is the length of the serviceType pointed to by svcString }
  840. {
  841. * NSLGetServiceFromURL() *** DEPRECATED ***
  842. *
  843. * Availability:
  844. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  845. * CarbonLib: in CarbonLib 1.0 and later
  846. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  847. }
  848. function NSLGetServiceFromURL( theURL: CStringPtr; var svcString: CStringPtr; var svcLen: UInt16 ): OSStatus; external name '_NSLGetServiceFromURL';
  849. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  850. { <--- returns the length of a Neighborhood data structure }
  851. { ---> neighborhood is a valid NSLNeighborhood }
  852. {
  853. * NSLGetNeighborhoodLength() *** DEPRECATED ***
  854. *
  855. * Availability:
  856. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  857. * CarbonLib: in CarbonLib 1.0 and later
  858. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  859. }
  860. function NSLGetNeighborhoodLength( neighborhood: NSLNeighborhood ): SIGNEDLONG; external name '_NSLGetNeighborhoodLength';
  861. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  862. {
  863. -------------------------------------------------------------------------------------
  864. Utility API calls: use these routines to separate plugin threads from client threads
  865. -------------------------------------------------------------------------------------
  866. }
  867. { this routine works the same as the Thread manager's routine NewThread, except }
  868. { that the thread is added to the NSL manager's thread list. }
  869. {
  870. * NSLNewThread() *** DEPRECATED ***
  871. *
  872. * Availability:
  873. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  874. * CarbonLib: in CarbonLib 1.0 and later
  875. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  876. }
  877. function NSLNewThread( threadStyle_: ThreadStyle; threadEntry: ThreadEntryProcPtr; threadParam: UnivPtr; stackSize: Size; options: ThreadOptions; var threadResult: UnivPtr; var threadMade: ThreadID ): OSErr; external name '_NSLNewThread';
  878. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  879. { this routine works the same as the Thread manager's routine DisposeThread, except }
  880. { that the thread is removed from the NSL manager's thread list. }
  881. {
  882. * NSLDisposeThread() *** DEPRECATED ***
  883. *
  884. * Availability:
  885. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  886. * CarbonLib: in CarbonLib 1.0 and later
  887. * Non-Carbon CFM: in NSLPPCLib 1.1 and later
  888. }
  889. function NSLDisposeThread( threadToDump: ThreadID; threadResult: UnivPtr; recycleThread: Boolean ): OSErr; external name '_NSLDisposeThread';
  890. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  891. {$endc} {not TARGET_CPU_64}
  892. {$ifc OLDROUTINENAMES}
  893. type
  894. ClientAsyncInfo = NSLClientAsyncInfo;
  895. PluginAsyncInfo = NSLPluginAsyncInfo;
  896. TypedData = NSLTypedData;
  897. PluginData = NSLPluginData;
  898. ClientAsyncInfoPtr = NSLClientAsyncInfoPtr;
  899. PluginAsyncInfoPtr = NSLPluginAsyncInfoPtr;
  900. TypedDataPtr = NSLTypedDataPtr;
  901. PluginDataPtr = NSLPluginDataPtr;
  902. {$endc} {OLDROUTINENAMES}
  903. {$endc} {TARGET_OS_MAC}
  904. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  905. end.
  906. {$endc} {not MACOSALLINCLUDE}