CFNetServices.pas 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  1. {
  2. File: CFNetwork/CFNetServices.h
  3. Contains: CoreFoundation Network Net Services header
  4. Version: CFNetwork-71.2~1
  5. Copyright: © 2001-2003 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit CFNetServices;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,CFBase,CFStream,CFArray,CFRunLoop;
  92. {$ALIGN MAC68K}
  93. {
  94. CFNetServices
  95. Network Services is composed of two objects, a Network Service and
  96. a Network Service Browser. A Network Service represents a single
  97. point service on the network. Associated with a service is its name,
  98. type of service, domain, port, and possibly protocol specific information
  99. (for legacy protocols). Services can be registered and resolved.
  100. Registering a service advertises the service on the network, so other
  101. computers can use the service. Resolving a service performs a network
  102. lookup in order to find the computer which has registered the service.
  103. Lookup is contained by the services name, type of service, and the domain.
  104. The port and address of the registered service will be returned. Services
  105. can be created or discovered.
  106. Discovery of services takes place through the use of the Network Service
  107. Browser. Given a domain and a service type, the browser will search out
  108. those services on the network. The returned services can then be resolved
  109. and then used.
  110. Service type values are keywords as registered with IANA. A list of values
  111. may be retrieved from their web site at
  112. <http://www.iana.org/assignments/port-numbers>.
  113. }
  114. {
  115. * CFNetServiceRef
  116. *
  117. * Discussion:
  118. * This is the type of a reference to a service. It may be used for
  119. * registering or for resolving.
  120. }
  121. type
  122. CFNetServiceRef = ^SInt32;
  123. {
  124. * CFNetServiceBrowserRef
  125. *
  126. * Discussion:
  127. * This is the type of a reference to a service or domain browser.
  128. * It may be used for discovering services or domains.
  129. }
  130. type
  131. CFNetServiceBrowserRef = ^SInt32;
  132. {
  133. * kCFStreamErrorDomainMach
  134. *
  135. * Discussion:
  136. * Errors reported by mach. See <mach/error.h>
  137. *
  138. * Availability:
  139. * Mac OS X: in version 10.2 and later in CoreServices.framework
  140. * CarbonLib: not available
  141. * Non-Carbon CFM: not available
  142. }
  143. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  144. var kCFStreamErrorDomainMach: SInt32; external name '_kCFStreamErrorDomainMach'; (* attribute const *)
  145. {
  146. * kCFStreamErrorDomainNetServices
  147. *
  148. * Discussion:
  149. * Errors listed below
  150. *
  151. * Availability:
  152. * Mac OS X: in version 10.2 and later in CoreServices.framework
  153. * CarbonLib: not available
  154. * Non-Carbon CFM: not available
  155. }
  156. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  157. var kCFStreamErrorDomainNetServices: SInt32; external name '_kCFStreamErrorDomainNetServices'; (* attribute const *)
  158. {
  159. * CFNetServicesError
  160. *
  161. * Discussion:
  162. * Errors from the kCFStreamErrorDomainNetServices domain.
  163. }
  164. type CFNetServicesError = SInt32;
  165. const
  166. {
  167. * An error of unknown type has occured.
  168. }
  169. kCFNetServicesErrorUnknown = -72000;
  170. {
  171. * The given registration has had a name collision. Registration
  172. * should be cancelled and should try again probably with a different
  173. * name.
  174. }
  175. kCFNetServicesErrorCollision = -72001;
  176. {
  177. * Not used
  178. }
  179. kCFNetServicesErrorNotFound = -72002;
  180. {
  181. * There is already a register, resolve, or browse invoke on the
  182. * given object.
  183. }
  184. kCFNetServicesErrorInProgress = -72003;
  185. {
  186. * Not used
  187. }
  188. kCFNetServicesErrorBadArgument = -72004;
  189. {
  190. * The register, resolve, or browse on the object has been cancelled.
  191. }
  192. kCFNetServicesErrorCancel = -72005;
  193. {
  194. * The given CFNetServiceBrowser has already been invalidated and can
  195. * no longer be used for browsing.
  196. }
  197. kCFNetServicesErrorInvalid = -72006;
  198. {
  199. * CFNetServiceBrowser flags
  200. *
  201. * Discussion:
  202. * Result bit flags passed to CFNetServiceBrowserClientCallBack.
  203. }
  204. const
  205. kCFNetServiceFlagMoreComing = 1; { Client will get another callback briefly and shouldn't do costly screen updates (or such). }
  206. kCFNetServiceFlagIsDomain = 2; { If off, the result is a service. }
  207. kCFNetServiceFlagIsRegistrationDomain = 4; { The result domain is the default registration domain. }
  208. kCFNetServiceFlagRemove = 8; { The result item should be removed and not added. }
  209. {
  210. * CFNetServiceClientContext
  211. *
  212. * Discussion:
  213. * Structure containing the user-defined data and callbacks for
  214. * CFNetService and CFNetServiceBrowser objects.
  215. }
  216. type CFNetServiceClientContext = record
  217. {
  218. * The version number of the structure type being passed in as a
  219. * parameter to the CFNetService(Browser) client function. Valid
  220. * version number is currently 0.
  221. }
  222. version: CFIndex;
  223. {
  224. * An arbitrary pointer to client-defined data, which can be
  225. * associated with the service/browser and is passed to the callbacks.
  226. }
  227. info: Ptr;
  228. {
  229. * The callback used to add a retain for the service/browser on the
  230. * info pointer for the life of the service/browser, and may be used
  231. * for temporary references the service/browser needs to take. This
  232. * callback returns the actual info pointer to store in the
  233. * service/browser, almost always just the pointer passed as the
  234. * parameter.
  235. }
  236. retain: CFAllocatorRetainCallBack;
  237. {
  238. * The callback used to remove a retain previously added for the
  239. * service/browser on the info pointer.
  240. }
  241. release: CFAllocatorReleaseCallBack;
  242. {
  243. * The callback used to create a descriptive string representation of
  244. * the info pointer (or the data pointed to by the info pointer) for
  245. * debugging purposes. This is used by the CFCopyDescription()
  246. * function.
  247. }
  248. copyDescription: CFAllocatorCopyDescriptionCallBack;
  249. end;
  250. CFNetServiceClientContextPtr = ^CFNetServiceClientContext;
  251. {
  252. * CFNetServiceClientCallBack
  253. *
  254. * Discussion:
  255. * Callback function which is called upon error or completion of
  256. * resolve or register. If resolving, the callback may be called
  257. * multiple times, once for each resolved address.
  258. *
  259. * Parameters:
  260. *
  261. * theService:
  262. * Service receiving the event.
  263. *
  264. * error:
  265. * Reference to an error structure if the event is a failure.
  266. *
  267. * info:
  268. * Client's info reference which was passed into the client
  269. * context.
  270. }
  271. type
  272. CFNetServiceClientCallBack = procedure( service: CFNetServiceRef; var error: CFStreamError; info: Ptr );
  273. {
  274. * CFNetServiceBrowserClientCallBack
  275. *
  276. * Discussion:
  277. * Callback function which is called upon error or upon successful
  278. * discovery of services or domains.
  279. *
  280. * Parameters:
  281. *
  282. * browser:
  283. * CFNetServiceBrowser receiving the event.
  284. *
  285. * flags:
  286. * Bitwise flags indicating the event or further information about
  287. * the event.
  288. *
  289. * domainOrService:
  290. * If searching for domains, a CFStringRef indicating the domain
  291. * which was found or is going away. If searching for services,
  292. * the service which was found or is going away.
  293. *
  294. * error:
  295. * Reference to an error structure if the event is a failure.
  296. *
  297. * info:
  298. * Client's info reference which was passed into the client
  299. * context.
  300. }
  301. type
  302. CFNetServiceBrowserClientCallBack = procedure( browser: CFNetServiceBrowserRef; flags: CFOptionFlags; domainOrService: CFTypeRef; var error: CFStreamError; info: Ptr );
  303. {
  304. * CFNetServiceGetTypeID()
  305. *
  306. * Discussion:
  307. * Returns the type identifier of all CFNetService instances.
  308. *
  309. * Mac OS X threading:
  310. * Thread safe
  311. *
  312. * Availability:
  313. * Mac OS X: in version 10.2 and later in CoreServices.framework
  314. * CarbonLib: not available
  315. * Non-Carbon CFM: not available
  316. }
  317. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  318. function CFNetServiceGetTypeID: CFTypeID; external name '_CFNetServiceGetTypeID';
  319. {
  320. * CFNetServiceBrowserGetTypeID()
  321. *
  322. * Discussion:
  323. * Returns the type identifier of all CFNetServiceBrowser instances.
  324. *
  325. * Mac OS X threading:
  326. * Thread safe
  327. *
  328. * Availability:
  329. * Mac OS X: in version 10.2 and later in CoreServices.framework
  330. * CarbonLib: not available
  331. * Non-Carbon CFM: not available
  332. }
  333. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  334. function CFNetServiceBrowserGetTypeID: CFTypeID; external name '_CFNetServiceBrowserGetTypeID';
  335. {
  336. * CFNetServiceCreate()
  337. *
  338. * Discussion:
  339. * Creates an instance of a Network Service.
  340. *
  341. * Mac OS X threading:
  342. * Thread safe
  343. *
  344. * Parameters:
  345. *
  346. * alloc:
  347. * The CFAllocator which should be used to allocate memory for the
  348. * service and its storage for values. If this reference is not a
  349. * valid CFAllocator, the behavior is undefined.
  350. *
  351. * domain:
  352. * The network domain in which it is registered or will be
  353. * registered. This value must be non-NULL.
  354. *
  355. * serviceType:
  356. * The type of service being registered or resolved on the
  357. * network. This value must be non-NULL.
  358. *
  359. * name:
  360. * The name of the machine or application advertising the service.
  361. * If this value is not unique, registering will eventually fail.
  362. * This value must be non-NULL. This value is usually displayed
  363. * in a browser for the user.
  364. *
  365. * port:
  366. * The port on which the service is listening. This must be
  367. * non-zero for services which are to be registered.
  368. *
  369. * Result:
  370. * A valid CFNetService which may now be registered or resolved, or
  371. * NULL if unsuccessful.
  372. *
  373. * Availability:
  374. * Mac OS X: in version 10.2 and later in CoreServices.framework
  375. * CarbonLib: not available
  376. * Non-Carbon CFM: not available
  377. }
  378. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  379. function CFNetServiceCreate(alloc: CFAllocatorRef; domain: CFStringRef; typ: CFStringRef; name: CFStringRef; port: UInt32): CFNetServiceRef; external name '_CFNetServiceCreate';
  380. {
  381. * CFNetServiceCreateCopy()
  382. *
  383. * Discussion:
  384. * Creates a new CFNetService object as a copy of service argument.
  385. *
  386. * Mac OS X threading:
  387. * Thread safe
  388. *
  389. * Parameters:
  390. *
  391. * alloc:
  392. * The CFAllocator which should be used to allocate memory for the
  393. * new service. If this reference is not a valid CFAllocator, the
  394. * behavior is undefined.
  395. *
  396. * service:
  397. * A CFNetServiceRef representing the original service. Must be
  398. * non-NULL. If this If this reference is not a valid
  399. * CFNetServiceRef, the behavior is undefined.
  400. *
  401. * Result:
  402. * Returns a valid CFNetServiceRef which contains a copy of all
  403. * previously resolved data from the original. NULL is returned in
  404. * the case of failure.
  405. *
  406. * Availability:
  407. * Mac OS X: in version 10.3 and later in CoreServices.framework
  408. * CarbonLib: not available
  409. * Non-Carbon CFM: not available
  410. }
  411. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  412. function CFNetServiceCreateCopy( alloc: CFAllocatorRef; service: CFNetServiceRef ): CFNetServiceRef; external name '_CFNetServiceCreateCopy';
  413. {
  414. * CFNetServiceGetDomain()
  415. *
  416. * Discussion:
  417. * Query a Network Service for its domain.
  418. *
  419. * Mac OS X threading:
  420. * Thread safe
  421. * The function gets the data in a thread-safe manner, but the
  422. * resulting data is not safe. Since it is returned as a matter of
  423. * a get opposed to a copy, the data is not safe if the service is
  424. * being altered from another thread.
  425. *
  426. * Parameters:
  427. *
  428. * theService:
  429. * The Network Service to be queried. Must be non-NULL.
  430. *
  431. * Result:
  432. * CFStringRef which is the service's domain.
  433. *
  434. * Availability:
  435. * Mac OS X: in version 10.2 and later in CoreServices.framework
  436. * CarbonLib: not available
  437. * Non-Carbon CFM: not available
  438. }
  439. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  440. function CFNetServiceGetDomain(theService: CFNetServiceRef): CFStringRef; external name '_CFNetServiceGetDomain';
  441. {
  442. * CFNetServiceGetType()
  443. *
  444. * Discussion:
  445. * Query a Network Service for its type.
  446. *
  447. * Mac OS X threading:
  448. * Thread safe
  449. * The function gets the data in a thread-safe manner, but the
  450. * resulting data is not safe. Since it is returned as a matter of
  451. * a get opposed to a copy, the data is not safe if the service is
  452. * being altered from another thread.
  453. *
  454. * Parameters:
  455. *
  456. * theService:
  457. * The Network Service to be queried. Must be non-NULL.
  458. *
  459. * Result:
  460. * CFStringRef which is the service's service type.
  461. *
  462. * Availability:
  463. * Mac OS X: in version 10.2 and later in CoreServices.framework
  464. * CarbonLib: not available
  465. * Non-Carbon CFM: not available
  466. }
  467. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  468. function CFNetServiceGetType(theService: CFNetServiceRef): CFStringRef; external name '_CFNetServiceGetType';
  469. {
  470. * CFNetServiceGetName()
  471. *
  472. * Discussion:
  473. * Query a Network Service for its name.
  474. *
  475. * Mac OS X threading:
  476. * Thread safe
  477. * The function gets the data in a thread-safe manner, but the
  478. * resulting data is not safe. Since it is returned as a matter of
  479. * a get opposed to a copy, the data is not safe if the service is
  480. * being altered from another thread.
  481. *
  482. * Parameters:
  483. *
  484. * theService:
  485. * The Network Service to be queried. Must be non-NULL.
  486. *
  487. * Result:
  488. * CFStringRef which is the service's name.
  489. *
  490. * Availability:
  491. * Mac OS X: in version 10.2 and later in CoreServices.framework
  492. * CarbonLib: not available
  493. * Non-Carbon CFM: not available
  494. }
  495. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  496. function CFNetServiceGetName(theService: CFNetServiceRef): CFStringRef; external name '_CFNetServiceGetName';
  497. {
  498. * CFNetServiceGetAddressing()
  499. *
  500. * Discussion:
  501. * Query a Network Service for its addressing.
  502. *
  503. * Mac OS X threading:
  504. * Thread safe
  505. * The function gets the data in a thread-safe manner, but the
  506. * resulting data is not safe. Since it is returned as a matter of
  507. * a get opposed to a copy, the data is not safe if the service is
  508. * being altered from another thread.
  509. *
  510. * Parameters:
  511. *
  512. * theService:
  513. * The Network Service to be queried. Must be non-NULL.
  514. *
  515. * Result:
  516. * Returns NULL if the entity's addressing is not known (has not
  517. * been resolved). The array will contain a CFDataRef for each
  518. * address resolved. Each CFDataRef contains a struct sockaddr
  519. * representing the address of the service.
  520. *
  521. * Availability:
  522. * Mac OS X: in version 10.2 and later in CoreServices.framework
  523. * CarbonLib: not available
  524. * Non-Carbon CFM: not available
  525. }
  526. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  527. function CFNetServiceGetAddressing(theService: CFNetServiceRef): CFArrayRef; external name '_CFNetServiceGetAddressing';
  528. {
  529. * CFNetServiceGetProtocolSpecificInformation()
  530. *
  531. * Discussion:
  532. * Query a Network Service for its protocol specific information.
  533. *
  534. * Mac OS X threading:
  535. * Thread safe
  536. * The function gets the data in a thread-safe manner, but the
  537. * resulting data is not safe. Since it is returned as a matter of
  538. * a get opposed to a copy, the data is not safe if the service is
  539. * being altered from another thread.
  540. *
  541. * Parameters:
  542. *
  543. * theService:
  544. * The Network Service to be queried. Must be non-NULL.
  545. *
  546. * Result:
  547. * Returns NULL if a resolve has not been performed or if
  548. * CFNetServiceSetProtocolSpecificInformation has not been called.
  549. * It will return a CFStringRef containing the specific information
  550. * if there is some.
  551. *
  552. * Availability:
  553. * Mac OS X: in version 10.2 and later in CoreServices.framework
  554. * CarbonLib: not available
  555. * Non-Carbon CFM: not available
  556. }
  557. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  558. function CFNetServiceGetProtocolSpecificInformation(theService: CFNetServiceRef): CFStringRef; external name '_CFNetServiceGetProtocolSpecificInformation';
  559. {
  560. * CFNetServiceSetProtocolSpecificInformation()
  561. *
  562. * Discussion:
  563. * Set a Network Service's protocol specific information.
  564. *
  565. * Mac OS X threading:
  566. * Thread safe
  567. *
  568. * Parameters:
  569. *
  570. * theService:
  571. * The Network Service to be queried. Must be non-NULL.
  572. *
  573. * theInfo:
  574. * The protocol specific information to be added. Pass NULL to
  575. * remove the information from the service.
  576. *
  577. * Availability:
  578. * Mac OS X: in version 10.2 and later in CoreServices.framework
  579. * CarbonLib: not available
  580. * Non-Carbon CFM: not available
  581. }
  582. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  583. procedure CFNetServiceSetProtocolSpecificInformation(theService: CFNetServiceRef;theInfo: CFStringRef); external name '_CFNetServiceSetProtocolSpecificInformation';
  584. {
  585. * CFNetServiceRegister()
  586. *
  587. * Discussion:
  588. * Registers the entity on the network. This requires that the
  589. * service has a domain, a type, a name, and a port. The service is
  590. * registered on the network until this function returns or is
  591. * cancelled by calling CFNetServiceCancel. In synchronous mode,
  592. * this function will block until there is an error or it is
  593. * cancelled from another thread. In asynchronous mode, this
  594. * function returns immediately and the underlying network
  595. * registration process will start.
  596. *
  597. * Mac OS X threading:
  598. * Thread safe
  599. *
  600. * Parameters:
  601. *
  602. * theService:
  603. * The Network Service to register on the network. Must be
  604. * non-NULL.
  605. *
  606. * error:
  607. * A reference to an error struct which will be set to the error
  608. * and domain of the error should one occur. If the value of
  609. * error is not desired, set to NULL.
  610. *
  611. * Result:
  612. * Returns FALSE if domain, type, name or port is NULL. In
  613. * synchronous mode, it will always return FALSE as a result of the
  614. * error or the cancellation. In asynchronous mode, it will return
  615. * TRUE if the registration process could start.
  616. *
  617. * Availability:
  618. * Mac OS X: in version 10.2 and later in CoreServices.framework
  619. * CarbonLib: not available
  620. * Non-Carbon CFM: not available
  621. }
  622. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  623. function CFNetServiceRegister(theService: CFNetServiceRef;error: CFStreamErrorPtr): Boolean; external name '_CFNetServiceRegister';
  624. {
  625. * CFNetServiceResolve()
  626. *
  627. * Discussion:
  628. * Resolves the addressing for the given service. This requires
  629. * that the service has a domain, a type, and a name. The service
  630. * is resolved on the network until this function returns or is
  631. * cancelled by calling CFNetServiceCancel. In synchronous mode,
  632. * this function will block until there is an error or it is
  633. * cancelled from another thread. In asynchronous mode, this
  634. * function returns immediately and the underlying network
  635. * resolution process will start.
  636. *
  637. * Mac OS X threading:
  638. * Thread safe
  639. *
  640. * Parameters:
  641. *
  642. * theService:
  643. * The Network Service to resolve on the network. Must be
  644. * non-NULL.
  645. *
  646. * error:
  647. * A reference to an error struct which will be set to the error
  648. * and domain of the error should one occur. If the value of
  649. * error is not desired, set to NULL.
  650. *
  651. * Result:
  652. * Returns FALSE if domain, type, or name is NULL. In synchronous
  653. * mode, it will return FALSE as a result of an error or a
  654. * cancellation. It will return TRUE if the resolution does
  655. * succeed. In asynchronous mode, it will return TRUE if the
  656. * resolution process could start.
  657. *
  658. * Availability:
  659. * Mac OS X: in version 10.2 and later in CoreServices.framework
  660. * CarbonLib: not available
  661. * Non-Carbon CFM: not available
  662. }
  663. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  664. function CFNetServiceResolve(theService: CFNetServiceRef;error: CFStreamErrorPtr): Boolean; external name '_CFNetServiceResolve';
  665. {
  666. * CFNetServiceCancel()
  667. *
  668. * Discussion:
  669. * Cancels an outstanding request for registration or resolution.
  670. *
  671. * Mac OS X threading:
  672. * Thread safe
  673. *
  674. * Parameters:
  675. *
  676. * theService:
  677. * The Network Service which is active. Must be non-NULL.
  678. *
  679. * Availability:
  680. * Mac OS X: in version 10.2 and later in CoreServices.framework
  681. * CarbonLib: not available
  682. * Non-Carbon CFM: not available
  683. }
  684. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  685. procedure CFNetServiceCancel(theService: CFNetServiceRef); external name '_CFNetServiceCancel';
  686. {
  687. * CFNetServiceSetClient()
  688. *
  689. * Discussion:
  690. * Sets up the service to be used in asynchronous mode.
  691. * Notification of registration failure or resolution completion
  692. * will occur through the given callback. Once the client is set,
  693. * the service must be scheduled on a runloop. The client callback
  694. * will be triggered via one of the scheduled run loops; It is the
  695. * caller's responsibility to ensure that at least one of the
  696. * scheduled run loops is being run. This call must be performed
  697. * before calling CFNetServiceRegister or CFNetServiceResolve,
  698. * otherwise it will return FALSE. TRUE will be returned if the
  699. * client could be set.
  700. *
  701. * Mac OS X threading:
  702. * Thread safe
  703. *
  704. * Parameters:
  705. *
  706. * theService:
  707. * The service to set up for asynchronous mode. Must be non-NULL.
  708. *
  709. * clientCB:
  710. * Function pointer will be called upon registration failure or
  711. * upon resolution completion. In the case of resolution, this
  712. * callback may be called multiple times if there is more than one
  713. * address for a service. Passing NULL will remove the client
  714. * from the entity and cancel any outstanding activity.
  715. *
  716. * clientContext:
  717. * Client contextual information to be used when calling clientCB.
  718. * Passing NULL will remove the client from the entity and cancel
  719. * any outstanding activity.
  720. *
  721. * Result:
  722. * Returns FALSE if the client could not be set, TRUE otherwise.
  723. *
  724. * Availability:
  725. * Mac OS X: in version 10.2 and later in CoreServices.framework
  726. * CarbonLib: not available
  727. * Non-Carbon CFM: not available
  728. }
  729. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  730. function CFNetServiceSetClient(theService: CFNetServiceRef; clientCB: CFNetServiceClientCallBack; clientContext: CFNetServiceClientContextPtr): Boolean; external name '_CFNetServiceSetClient';
  731. {
  732. * CFNetServiceScheduleWithRunLoop()
  733. *
  734. * Discussion:
  735. * Schedule the given service on the given run loop and mode.
  736. *
  737. * Mac OS X threading:
  738. * Thread safe
  739. *
  740. * Parameters:
  741. *
  742. * theService:
  743. * The service which is set up for asynchronous mode. Must be
  744. * non-NULL.
  745. *
  746. * runLoop:
  747. * A reference to a runloop on which the service should be
  748. * scheduled. Must be non-NULL.
  749. *
  750. * runLoopMode:
  751. * The mode on which to schedule the service. Must be non-NULL.
  752. *
  753. * Availability:
  754. * Mac OS X: in version 10.2 and later in CoreServices.framework
  755. * CarbonLib: not available
  756. * Non-Carbon CFM: not available
  757. }
  758. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  759. procedure CFNetServiceScheduleWithRunLoop(theService: CFNetServiceRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef); external name '_CFNetServiceScheduleWithRunLoop';
  760. {
  761. * CFNetServiceUnscheduleFromRunLoop()
  762. *
  763. * Discussion:
  764. * Unschedule the given service from the given run loop and mode.
  765. *
  766. * Mac OS X threading:
  767. * Thread safe
  768. *
  769. * Parameters:
  770. *
  771. * theService:
  772. * The service which is set up for asynchronous mode. Must be
  773. * non-NULL.
  774. *
  775. * runLoop:
  776. * A reference to a runloop from which the service should be
  777. * unscheduled. Must be non-NULL.
  778. *
  779. * runLoopMode:
  780. * The mode from which to unschedule the service. Must be
  781. * non-NULL.
  782. *
  783. * Availability:
  784. * Mac OS X: in version 10.2 and later in CoreServices.framework
  785. * CarbonLib: not available
  786. * Non-Carbon CFM: not available
  787. }
  788. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  789. procedure CFNetServiceUnscheduleFromRunLoop(theService: CFNetServiceRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef); external name '_CFNetServiceUnscheduleFromRunLoop';
  790. {
  791. * CFNetServiceBrowserCreate()
  792. *
  793. * Discussion:
  794. * Creates an instance of a browser object.
  795. *
  796. * Mac OS X threading:
  797. * Thread safe
  798. *
  799. * Parameters:
  800. *
  801. * alloc:
  802. * The CFAllocator which should be used to allocate memory for the
  803. * browser and its storage for values. If this reference is not a
  804. * valid CFAllocator, the behavior is undefined.
  805. *
  806. * clientCB:
  807. * Function pointer that will be called as domains or services are
  808. * found on the network. Must be non-NULL.
  809. *
  810. * clientContext:
  811. * Client ontextual information to be used when calling clientCB.
  812. * Must be non-NULL.
  813. *
  814. * Result:
  815. * Returns a new instance of a browser, or NULL if the instance
  816. * could not be created.
  817. *
  818. * Availability:
  819. * Mac OS X: in version 10.2 and later in CoreServices.framework
  820. * CarbonLib: not available
  821. * Non-Carbon CFM: not available
  822. }
  823. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  824. function CFNetServiceBrowserCreate(alloc: CFAllocatorRef; clientCB: CFNetServiceBrowserClientCallBack; var clientContext: CFNetServiceClientContext): CFNetServiceBrowserRef; external name '_CFNetServiceBrowserCreate';
  825. {
  826. * CFNetServiceBrowserInvalidate()
  827. *
  828. * Discussion:
  829. * Invalidates the given browser object so that it may no longer be
  830. * scheduled and callback never be called. This will also stop any
  831. * searches currently in progress.
  832. *
  833. * Parameters:
  834. *
  835. * browser:
  836. * Network Service Browser to invalidate. Must be non-NULL.
  837. *
  838. * Availability:
  839. * Mac OS X: in version 10.2 and later in CoreServices.framework
  840. * CarbonLib: not available
  841. * Non-Carbon CFM: not available
  842. }
  843. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  844. procedure CFNetServiceBrowserInvalidate(browser: CFNetServiceBrowserRef); external name '_CFNetServiceBrowserInvalidate';
  845. {
  846. * CFNetServiceBrowserSearchForDomains()
  847. *
  848. * Discussion:
  849. * Starts a search for domains. The browser will either try to find
  850. * "Browse" domains or will search for "Registration" domains. If
  851. * there is already an outstanding search, it will return FALSE. In
  852. * syncronous mode, this call blocks until the search is stopped.
  853. * It will return FALSE if there is an error performing the search.
  854. * It will return TRUE otherwise. In asynchronous mode, this call
  855. * will return TRUE or FALSE depending if the underlying network
  856. * search could be started.
  857. *
  858. * Mac OS X threading:
  859. * Thread safe
  860. *
  861. * Parameters:
  862. *
  863. * browser:
  864. * Network Service Browser to perform the search. Must be
  865. * non-NULL.
  866. *
  867. * registrationDomains:
  868. * FALSE if "Browse" domains are to be discovered. TRUE if only
  869. * "Registration" domains are to be discovered.
  870. *
  871. * error:
  872. * A reference to an error struct which will be set to the error
  873. * and domain of the error should one occur. If the value of
  874. * error is not desired, set to NULL.
  875. *
  876. * Result:
  877. * Returns FALSE if an error occurs during a synchronous search or
  878. * if the search could not start. It returns TRUE otherwise.
  879. *
  880. * Availability:
  881. * Mac OS X: in version 10.2 and later in CoreServices.framework
  882. * CarbonLib: not available
  883. * Non-Carbon CFM: not available
  884. }
  885. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  886. function CFNetServiceBrowserSearchForDomains(browser: CFNetServiceBrowserRef; registrationDomains: Boolean; error: CFStreamErrorPtr): Boolean; external name '_CFNetServiceBrowserSearchForDomains';
  887. {
  888. * CFNetServiceBrowserSearchForServices()
  889. *
  890. * Discussion:
  891. * Starts a search for a service type on the given domain. If there
  892. * is already an outstanding search, it will return FALSE. In
  893. * syncronous mode, this call blocks until the search is stopped.
  894. * It will return FALSE if there is an error performing the search
  895. * or if there is some other error. It will return TRUE otherwise.
  896. * In asynchronous mode, this call will return TRUE or FALSE
  897. * depending if the underlying network search could be instantiated.
  898. *
  899. * Mac OS X threading:
  900. * Thread safe
  901. *
  902. * Parameters:
  903. *
  904. * browser:
  905. * Network Service Browser to perform the search. Must be
  906. * non-NULL.
  907. *
  908. * domain:
  909. * Network domain to search in order to find the service. Must be
  910. * non-NULL.
  911. *
  912. * serviceType:
  913. * Service type for which to search. Must be non-NULL.
  914. *
  915. * error:
  916. * A reference to an error struct which will be set to the error
  917. * and domain of the error should one occur. If the value of
  918. * error is not desired, set to NULL.
  919. *
  920. * Result:
  921. * Returns FALSE if an error occurs during a synchronous search or
  922. * if the search could not start. It returns TRUE otherwise.
  923. *
  924. * Availability:
  925. * Mac OS X: in version 10.2 and later in CoreServices.framework
  926. * CarbonLib: not available
  927. * Non-Carbon CFM: not available
  928. }
  929. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  930. function CFNetServiceBrowserSearchForServices(browser: CFNetServiceBrowserRef; domain: CFStringRef; typ: CFStringRef; error: CFStreamErrorPtr): Boolean; external name '_CFNetServiceBrowserSearchForServices';
  931. {
  932. * CFNetServiceBrowserStopSearch()
  933. *
  934. * Discussion:
  935. * Stops an outstanding browser search.
  936. *
  937. * Mac OS X threading:
  938. * Thread safe
  939. *
  940. * Parameters:
  941. *
  942. * browser:
  943. * Network Service Browser performing the search. Must be
  944. * non-NULL.
  945. *
  946. * error:
  947. * Error value to be returned in "error" in
  948. * CFNetServiceBrowserStartServiceSearch if search is being
  949. * performed in synchronous mode. In this case, a non-zero of the
  950. * error field of the struct will cause
  951. * CFNetServiceBrowserStartServiceSearch to return FALSE. In
  952. * asynchronous mode, the client call back will be called with
  953. * this error.
  954. *
  955. * Availability:
  956. * Mac OS X: in version 10.2 and later in CoreServices.framework
  957. * CarbonLib: not available
  958. * Non-Carbon CFM: not available
  959. }
  960. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  961. procedure CFNetServiceBrowserStopSearch(browser: CFNetServiceBrowserRef;var error: CFStreamError); external name '_CFNetServiceBrowserStopSearch';
  962. {
  963. * CFNetServiceBrowserScheduleWithRunLoop()
  964. *
  965. * Discussion:
  966. * Schedules the browser on a run loop and mode. Use this to place
  967. * the given browser into asynchronous mode. The client callback
  968. * will be triggered via one of the scheduled run loops; It is the
  969. * caller's responsibility to ensure that at least one of the
  970. * scheduled run loops is being run.
  971. *
  972. * Mac OS X threading:
  973. * Thread safe
  974. *
  975. * Parameters:
  976. *
  977. * browser:
  978. * Network Service Browser to schedule. Must be non-NULL.
  979. *
  980. * runLoop:
  981. * A reference to a runloop on which the browser should be
  982. * scheduled. Must be non-NULL.
  983. *
  984. * runLoopMode:
  985. * The mode on which to schedule the browser. Must be non-NULL.
  986. *
  987. * Availability:
  988. * Mac OS X: in version 10.2 and later in CoreServices.framework
  989. * CarbonLib: not available
  990. * Non-Carbon CFM: not available
  991. }
  992. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  993. procedure CFNetServiceBrowserScheduleWithRunLoop(browser: CFNetServiceBrowserRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef); external name '_CFNetServiceBrowserScheduleWithRunLoop';
  994. {
  995. * CFNetServiceBrowserUnscheduleFromRunLoop()
  996. *
  997. * Discussion:
  998. * Unschedules the browser from a run loop and mode.
  999. *
  1000. * Mac OS X threading:
  1001. * Thread safe
  1002. *
  1003. * Parameters:
  1004. *
  1005. * browser:
  1006. * Network Service Browser to unschedule. Must be non-NULL.
  1007. *
  1008. * runLoop:
  1009. * A reference to a runloop from which the browser should be
  1010. * unscheduled. Must be non-NULL.
  1011. *
  1012. * runLoopMode:
  1013. * The mode from which to unschedule the browser. Must be
  1014. * non-NULL.
  1015. *
  1016. * Availability:
  1017. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1018. * CarbonLib: not available
  1019. * Non-Carbon CFM: not available
  1020. }
  1021. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  1022. procedure CFNetServiceBrowserUnscheduleFromRunLoop(browser: CFNetServiceBrowserRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef); external name '_CFNetServiceBrowserUnscheduleFromRunLoop';
  1023. end.