CFNetServices.pas 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831
  1. {
  2. File: CFNetwork/CFNetServices.h
  3. Contains: CoreFoundation Network Net Services header
  4. Copyright: Copyright (c) 2001-2008, Apple Inc. All rights reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://bugs.freepascal.org
  8. }
  9. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  10. { Pascal Translation Updated: Gale R Paeper, <[email protected]>, 2008 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  12. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  13. { Pascal Translation Updated: Jonas Maebe <[email protected]>, August 2015 }
  14. {
  15. Modified for use with Free Pascal
  16. Version 308
  17. Please report any bugs to <[email protected]>
  18. }
  19. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  20. {$mode macpas}
  21. {$modeswitch cblocks}
  22. {$packenum 1}
  23. {$macro on}
  24. {$inline on}
  25. {$calling mwpascal}
  26. unit CFNetServices;
  27. interface
  28. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  29. {$setc GAP_INTERFACES_VERSION := $0308}
  30. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  31. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  32. {$endc}
  33. {$ifc defined CPUPOWERPC and defined CPUI386}
  34. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  35. {$endc}
  36. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  37. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  38. {$endc}
  39. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  40. {$setc __ppc__ := 1}
  41. {$elsec}
  42. {$setc __ppc__ := 0}
  43. {$endc}
  44. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  45. {$setc __ppc64__ := 1}
  46. {$elsec}
  47. {$setc __ppc64__ := 0}
  48. {$endc}
  49. {$ifc not defined __i386__ and defined CPUI386}
  50. {$setc __i386__ := 1}
  51. {$elsec}
  52. {$setc __i386__ := 0}
  53. {$endc}
  54. {$ifc not defined __x86_64__ and defined CPUX86_64}
  55. {$setc __x86_64__ := 1}
  56. {$elsec}
  57. {$setc __x86_64__ := 0}
  58. {$endc}
  59. {$ifc not defined __arm__ and defined CPUARM}
  60. {$setc __arm__ := 1}
  61. {$elsec}
  62. {$setc __arm__ := 0}
  63. {$endc}
  64. {$ifc not defined __arm64__ and defined CPUAARCH64}
  65. {$setc __arm64__ := 1}
  66. {$elsec}
  67. {$setc __arm64__ := 0}
  68. {$endc}
  69. {$ifc defined cpu64}
  70. {$setc __LP64__ := 1}
  71. {$elsec}
  72. {$setc __LP64__ := 0}
  73. {$endc}
  74. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  75. {$error Conflicting definitions for __ppc__ and __i386__}
  76. {$endc}
  77. {$ifc defined __ppc__ and __ppc__}
  78. {$setc TARGET_CPU_PPC := TRUE}
  79. {$setc TARGET_CPU_PPC64 := FALSE}
  80. {$setc TARGET_CPU_X86 := FALSE}
  81. {$setc TARGET_CPU_X86_64 := FALSE}
  82. {$setc TARGET_CPU_ARM := FALSE}
  83. {$setc TARGET_CPU_ARM64 := FALSE}
  84. {$setc TARGET_OS_MAC := TRUE}
  85. {$setc TARGET_OS_IPHONE := FALSE}
  86. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  87. {$setc TARGET_OS_EMBEDDED := FALSE}
  88. {$elifc defined __ppc64__ and __ppc64__}
  89. {$setc TARGET_CPU_PPC := FALSE}
  90. {$setc TARGET_CPU_PPC64 := TRUE}
  91. {$setc TARGET_CPU_X86 := FALSE}
  92. {$setc TARGET_CPU_X86_64 := FALSE}
  93. {$setc TARGET_CPU_ARM := FALSE}
  94. {$setc TARGET_CPU_ARM64 := FALSE}
  95. {$setc TARGET_OS_MAC := TRUE}
  96. {$setc TARGET_OS_IPHONE := FALSE}
  97. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  98. {$setc TARGET_OS_EMBEDDED := FALSE}
  99. {$elifc defined __i386__ and __i386__}
  100. {$setc TARGET_CPU_PPC := FALSE}
  101. {$setc TARGET_CPU_PPC64 := FALSE}
  102. {$setc TARGET_CPU_X86 := TRUE}
  103. {$setc TARGET_CPU_X86_64 := FALSE}
  104. {$setc TARGET_CPU_ARM := FALSE}
  105. {$setc TARGET_CPU_ARM64 := FALSE}
  106. {$ifc defined iphonesim}
  107. {$setc TARGET_OS_MAC := FALSE}
  108. {$setc TARGET_OS_IPHONE := TRUE}
  109. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  110. {$elsec}
  111. {$setc TARGET_OS_MAC := TRUE}
  112. {$setc TARGET_OS_IPHONE := FALSE}
  113. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  114. {$endc}
  115. {$setc TARGET_OS_EMBEDDED := FALSE}
  116. {$elifc defined __x86_64__ and __x86_64__}
  117. {$setc TARGET_CPU_PPC := FALSE}
  118. {$setc TARGET_CPU_PPC64 := FALSE}
  119. {$setc TARGET_CPU_X86 := FALSE}
  120. {$setc TARGET_CPU_X86_64 := TRUE}
  121. {$setc TARGET_CPU_ARM := FALSE}
  122. {$setc TARGET_CPU_ARM64 := FALSE}
  123. {$ifc defined iphonesim}
  124. {$setc TARGET_OS_MAC := FALSE}
  125. {$setc TARGET_OS_IPHONE := TRUE}
  126. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  127. {$elsec}
  128. {$setc TARGET_OS_MAC := TRUE}
  129. {$setc TARGET_OS_IPHONE := FALSE}
  130. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  131. {$endc}
  132. {$setc TARGET_OS_EMBEDDED := FALSE}
  133. {$elifc defined __arm__ and __arm__}
  134. {$setc TARGET_CPU_PPC := FALSE}
  135. {$setc TARGET_CPU_PPC64 := FALSE}
  136. {$setc TARGET_CPU_X86 := FALSE}
  137. {$setc TARGET_CPU_X86_64 := FALSE}
  138. {$setc TARGET_CPU_ARM := TRUE}
  139. {$setc TARGET_CPU_ARM64 := FALSE}
  140. {$setc TARGET_OS_MAC := FALSE}
  141. {$setc TARGET_OS_IPHONE := TRUE}
  142. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  143. {$setc TARGET_OS_EMBEDDED := TRUE}
  144. {$elifc defined __arm64__ and __arm64__}
  145. {$setc TARGET_CPU_PPC := FALSE}
  146. {$setc TARGET_CPU_PPC64 := FALSE}
  147. {$setc TARGET_CPU_X86 := FALSE}
  148. {$setc TARGET_CPU_X86_64 := FALSE}
  149. {$setc TARGET_CPU_ARM := FALSE}
  150. {$setc TARGET_CPU_ARM64 := TRUE}
  151. {$ifc defined ios}
  152. {$setc TARGET_OS_MAC := FALSE}
  153. {$setc TARGET_OS_IPHONE := TRUE}
  154. {$setc TARGET_OS_EMBEDDED := TRUE}
  155. {$elsec}
  156. {$setc TARGET_OS_MAC := TRUE}
  157. {$setc TARGET_OS_IPHONE := FALSE}
  158. {$setc TARGET_OS_EMBEDDED := FALSE}
  159. {$endc}
  160. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  161. {$elsec}
  162. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  163. {$endc}
  164. {$ifc defined __LP64__ and __LP64__ }
  165. {$setc TARGET_CPU_64 := TRUE}
  166. {$elsec}
  167. {$setc TARGET_CPU_64 := FALSE}
  168. {$endc}
  169. {$ifc defined FPC_BIG_ENDIAN}
  170. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  171. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  172. {$elifc defined FPC_LITTLE_ENDIAN}
  173. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  174. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  175. {$elsec}
  176. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  177. {$endc}
  178. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  179. {$setc CALL_NOT_IN_CARBON := FALSE}
  180. {$setc OLDROUTINENAMES := FALSE}
  181. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  182. {$setc OPAQUE_UPP_TYPES := TRUE}
  183. {$setc OTCARBONAPPLICATION := TRUE}
  184. {$setc OTKERNEL := FALSE}
  185. {$setc PM_USE_SESSION_APIS := TRUE}
  186. {$setc TARGET_API_MAC_CARBON := TRUE}
  187. {$setc TARGET_API_MAC_OS8 := FALSE}
  188. {$setc TARGET_API_MAC_OSX := TRUE}
  189. {$setc TARGET_CARBON := TRUE}
  190. {$setc TARGET_CPU_68K := FALSE}
  191. {$setc TARGET_CPU_MIPS := FALSE}
  192. {$setc TARGET_CPU_SPARC := FALSE}
  193. {$setc TARGET_OS_UNIX := FALSE}
  194. {$setc TARGET_OS_WIN32 := FALSE}
  195. {$setc TARGET_RT_MAC_68881 := FALSE}
  196. {$setc TARGET_RT_MAC_CFM := FALSE}
  197. {$setc TARGET_RT_MAC_MACHO := TRUE}
  198. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  199. {$setc TYPE_BOOL := FALSE}
  200. {$setc TYPE_EXTENDED := FALSE}
  201. {$setc TYPE_LONGLONG := TRUE}
  202. uses MacTypes,CFBase,CFStream,CFArray,CFRunLoop, CFData, CFDate, CFDictionary;
  203. {$endc} {not MACOSALLINCLUDE}
  204. {$ALIGN MAC68K}
  205. {
  206. * CFNetServiceRef
  207. *
  208. * Discussion:
  209. * This is the type of a reference to a service. It may be used for
  210. * registering or for resolving.
  211. }
  212. type
  213. CFNetServiceRef = ^__CFNetService; { an opaque type }
  214. __CFNetService = record end;
  215. {
  216. * CFNetServiceMonitorRef
  217. *
  218. * Discussion:
  219. * This is the type of a reference to a service monitor. It may be
  220. * used for watching record changes on a CFNetServiceRef.
  221. }
  222. type
  223. CFNetServiceMonitorRef = ^__CFNetServiceMonitor; { an opaque type }
  224. __CFNetServiceMonitor = record end;
  225. {
  226. * CFNetServiceBrowserRef
  227. *
  228. * Discussion:
  229. * This is the type of a reference to a service or domain browser.
  230. * It may be used for discovering services or domains.
  231. }
  232. type
  233. CFNetServiceBrowserRef = ^__CFNetServiceBrowser; { an opaque type }
  234. __CFNetServiceBrowser = record end;
  235. {
  236. * kCFStreamErrorDomainMach
  237. *
  238. * Discussion:
  239. * Errors reported by mach. See <mach/error.h>
  240. *
  241. * Availability:
  242. * Mac OS X: in version 10.2 and later in CoreServices.framework
  243. * CarbonLib: not available
  244. * Non-Carbon CFM: not available
  245. }
  246. var kCFStreamErrorDomainMach: SInt32; external name '_kCFStreamErrorDomainMach'; (* attribute const *)
  247. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  248. {
  249. * kCFStreamErrorDomainNetServices
  250. *
  251. * Discussion:
  252. * Errors listed below or reported by the Service Discovery API's.
  253. * See <dns_sd.h>. The Service Discovery errors will only be
  254. * returned when using the new, Mac OS X 10.4-based API's or
  255. * CFNetServiceBrowser.
  256. *
  257. * Availability:
  258. * Mac OS X: in version 10.2 and later in CoreServices.framework
  259. * CarbonLib: not available
  260. * Non-Carbon CFM: not available
  261. }
  262. var kCFStreamErrorDomainNetServices: SInt32; external name '_kCFStreamErrorDomainNetServices'; (* attribute const *)
  263. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  264. {
  265. * CFNetServicesError
  266. *
  267. * Discussion:
  268. * Errors from the kCFStreamErrorDomainNetServices domain.
  269. }
  270. type
  271. CFNetServicesError = SInt32;
  272. const
  273. {
  274. * An error of unknown type has occured.
  275. }
  276. kCFNetServicesErrorUnknown = -72000;
  277. {
  278. * The given registration has had a name collision. Registration
  279. * should be cancelled and should try again probably with a different
  280. * name.
  281. }
  282. kCFNetServicesErrorCollision = -72001;
  283. {
  284. * Not used
  285. }
  286. kCFNetServicesErrorNotFound = -72002;
  287. {
  288. * There is already a register, resolve, browse, or monitor in
  289. * progress on the given object.
  290. }
  291. kCFNetServicesErrorInProgress = -72003;
  292. {
  293. * Not used
  294. }
  295. kCFNetServicesErrorBadArgument = -72004;
  296. {
  297. * The register, resolve, or browse on the object has been cancelled.
  298. }
  299. kCFNetServicesErrorCancel = -72005;
  300. {
  301. * The given CFNetServiceBrowser or CFNetServiceMonitor has already
  302. * been invalidated and can no longer be used.
  303. }
  304. kCFNetServicesErrorInvalid = -72006;
  305. {
  306. * The given CFNetServiceResolveWithTimeout has hit the timeout
  307. * before a successful resolve.
  308. }
  309. kCFNetServicesErrorTimeout = -72007;
  310. {
  311. * CFNetServiceMonitorType
  312. *
  313. * Discussion:
  314. * Record type specifier in order to inform CFNetServiceMonitor to
  315. * watch for certain record changes.
  316. }
  317. type
  318. CFNetServiceMonitorType = SInt32;
  319. const
  320. {
  321. * Watch for TXT record changes.
  322. }
  323. kCFNetServiceMonitorTXT = 1;
  324. {
  325. * CFNetService flags
  326. *
  327. * Discussion:
  328. * Bit flags to be used for registration of a service with CFNetServiceRegisterWithOptions.
  329. }
  330. const
  331. kCFNetServiceFlagNoAutoRename = 1; { Indicate that registration should not auto-rename the service to prevent name conflicts.}
  332. {
  333. * CFNetServiceBrowser flags
  334. *
  335. * Discussion:
  336. * Result bit flags passed to CFNetServiceBrowserClientCallBack.
  337. }
  338. const
  339. kCFNetServiceFlagMoreComing = 1; { Client will get another callback briefly and shouldn't do costly screen updates (or such).}
  340. kCFNetServiceFlagIsDomain = 2; { If off, the result is a service.}
  341. kCFNetServiceFlagIsDefault = 4; { The result domain is the default domain for the given domain browse type (registration or browse).}
  342. kCFNetServiceFlagIsRegistrationDomain = 4; { Same as the previous but incorrectly named. Kept for compatibility.}
  343. kCFNetServiceFlagRemove = 8; { The result item should be removed and not added.}
  344. {
  345. * CFNetServiceClientContext
  346. *
  347. * Discussion:
  348. * Structure containing the user-defined data and callbacks for
  349. * CFNetService and CFNetServiceBrowser objects.
  350. }
  351. type
  352. CFNetServiceClientContext = record
  353. {
  354. * The version number of the structure type being passed in as a
  355. * parameter to the CFNetService, Browser, or Monitor client
  356. * function. The current version number is 0.
  357. }
  358. version: CFIndex;
  359. {
  360. * An arbitrary pointer to client-defined data, which can be
  361. * associated with the service/browser and is passed to the callbacks.
  362. }
  363. info: UnivPtr;
  364. {
  365. * The callback used to add a retain for the service/browser on the
  366. * info pointer for the life of the service/browser, and may be used
  367. * for temporary references the service/browser needs to take. This
  368. * callback returns the actual info pointer to store in the
  369. * service/browser, almost always just the pointer passed as the
  370. * parameter.
  371. }
  372. retain: CFAllocatorRetainCallBack;
  373. {
  374. * The callback used to remove a retain previously added for the
  375. * service/browser on the info pointer.
  376. }
  377. release: CFAllocatorReleaseCallBack;
  378. {
  379. * The callback used to create a descriptive string representation of
  380. * the info pointer (or the data pointed to by the info pointer) for
  381. * debugging purposes. This is used by the CFCopyDescription()
  382. * function.
  383. }
  384. copyDescription: CFAllocatorCopyDescriptionCallBack;
  385. end;
  386. CFNetServiceClientContextPtr = ^CFNetServiceClientContext;
  387. {
  388. * CFNetServiceClientCallBack
  389. *
  390. * Discussion:
  391. * Callback function which is called upon error or completion of
  392. * resolve or register. If resolving with the deprecated API's, the
  393. * callback may be called multiple times, once for each resolved
  394. * address.
  395. *
  396. * Parameters:
  397. *
  398. * theService:
  399. * Service receiving the event.
  400. *
  401. * error:
  402. * Reference to an error structure if the event is a failure.
  403. *
  404. * info:
  405. * Client's info reference which was passed into the client
  406. * context.
  407. }
  408. type
  409. CFNetServiceClientCallBack = procedure( theService: CFNetServiceRef; var error: CFStreamError; info: UnivPtr );
  410. {
  411. * CFNetServiceMonitorClientCallBack
  412. *
  413. * Discussion:
  414. * Callback function which is called as the monitored record changes.
  415. *
  416. * Parameters:
  417. *
  418. * theMonitor:
  419. * CFNetServiceMonitor receiving the event.
  420. *
  421. * theService:
  422. * Service receiving the event.
  423. *
  424. * typeInfo:
  425. * The information type which changed.
  426. *
  427. * rdata:
  428. * The contents of the record that changed.
  429. *
  430. * error:
  431. * Reference to an error structure if the event is a failure.
  432. *
  433. * info:
  434. * Client's info reference which was passed into the client
  435. * context.
  436. }
  437. type
  438. CFNetServiceMonitorClientCallBack = procedure( theMonitor: CFNetServiceMonitorRef; theService: CFNetServiceRef; typeInfo: CFNetServiceMonitorType; rdata: CFDataRef; var error: CFStreamError; info: UnivPtr );
  439. {
  440. * CFNetServiceBrowserClientCallBack
  441. *
  442. * Discussion:
  443. * Callback function which is called upon error or upon successful
  444. * discovery of services or domains.
  445. *
  446. * Parameters:
  447. *
  448. * browser:
  449. * CFNetServiceBrowser receiving the event.
  450. *
  451. * flags:
  452. * Bitwise flags indicating the event or further information about
  453. * the event.
  454. *
  455. * domainOrService:
  456. * If searching for domains, a CFStringRef indicating the domain
  457. * which was found or is going away. If searching for services,
  458. * the service which was found or is going away.
  459. *
  460. * error:
  461. * Reference to an error structure if the event is a failure.
  462. *
  463. * info:
  464. * Client's info reference which was passed into the client
  465. * context.
  466. }
  467. type
  468. CFNetServiceBrowserClientCallBack = procedure( browser: CFNetServiceBrowserRef; flags: CFOptionFlags; domainOrService: CFTypeRef; var error: CFStreamError; info: UnivPtr );
  469. {
  470. * CFNetServiceGetTypeID()
  471. *
  472. * Discussion:
  473. * Returns the type identifier of all CFNetService instances.
  474. *
  475. * Mac OS X threading:
  476. * Thread safe
  477. *
  478. * Availability:
  479. * Mac OS X: in version 10.2 and later in CoreServices.framework
  480. * CarbonLib: not available
  481. * Non-Carbon CFM: not available
  482. }
  483. function CFNetServiceGetTypeID: CFTypeID; external name '_CFNetServiceGetTypeID';
  484. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  485. {
  486. * CFNetServiceMonitorGetTypeID()
  487. *
  488. * Discussion:
  489. * Returns the type identifier of all CFNetServiceMonitor instances.
  490. *
  491. * Mac OS X threading:
  492. * Thread safe
  493. *
  494. * Availability:
  495. * Mac OS X: in version 10.4 and later in CoreServices.framework
  496. * CarbonLib: not available
  497. * Non-Carbon CFM: not available
  498. }
  499. function CFNetServiceMonitorGetTypeID: CFTypeID; external name '_CFNetServiceMonitorGetTypeID';
  500. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  501. {
  502. * CFNetServiceBrowserGetTypeID()
  503. *
  504. * Discussion:
  505. * Returns the type identifier of all CFNetServiceBrowser instances.
  506. *
  507. * Mac OS X threading:
  508. * Thread safe
  509. *
  510. * Availability:
  511. * Mac OS X: in version 10.2 and later in CoreServices.framework
  512. * CarbonLib: not available
  513. * Non-Carbon CFM: not available
  514. }
  515. function CFNetServiceBrowserGetTypeID: CFTypeID; external name '_CFNetServiceBrowserGetTypeID';
  516. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  517. {
  518. * CFNetServiceCreate()
  519. *
  520. * Discussion:
  521. * Creates an instance of a Network Service.
  522. *
  523. * Mac OS X threading:
  524. * Thread safe
  525. *
  526. * Parameters:
  527. *
  528. * alloc:
  529. * The CFAllocator which should be used to allocate memory for the
  530. * service and its storage for values. If this reference is not a
  531. * valid CFAllocator, the behavior is undefined.
  532. *
  533. * domain:
  534. * The network domain in which it is registered or will be
  535. * registered. This value must be non-NULL.
  536. *
  537. * serviceType:
  538. * The type of service being registered or resolved on the
  539. * network. The service type consists of the application protocol
  540. * name followed by the transport protocol name, separated by a
  541. * dot (e.g. "_ftp._tcp"). The application protocol name should
  542. * be 14 characters or less, and should only contain lower-case
  543. * letters, digits, and hyphens. New service types should be
  544. * registered at <htp://www.dns-sd.org/ServiceTypes.html>. This
  545. * value must be non-NULL.
  546. *
  547. * name:
  548. * The name of the machine or application advertising the service.
  549. * If this value is not unique, registering will eventually fail.
  550. * This value must be non-NULL. This value is usually displayed
  551. * in a browser for the user.
  552. *
  553. * port:
  554. * The port on which the service is listening. This must be
  555. * non-zero for services which are to be registered.
  556. *
  557. * Result:
  558. * A valid CFNetService which may now be registered or resolved, or
  559. * NULL if unsuccessful.
  560. *
  561. * Availability:
  562. * Mac OS X: in version 10.2 and later in CoreServices.framework
  563. * CarbonLib: not available
  564. * Non-Carbon CFM: not available
  565. }
  566. function CFNetServiceCreate( alloc: CFAllocatorRef; domain: CFStringRef; serviceType: CFStringRef; name: CFStringRef; port: SInt32 ): CFNetServiceRef; external name '_CFNetServiceCreate';
  567. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  568. {
  569. * CFNetServiceCreateCopy()
  570. *
  571. * Discussion:
  572. * Creates a new CFNetService object as a copy of service argument.
  573. *
  574. * Mac OS X threading:
  575. * Thread safe
  576. *
  577. * Parameters:
  578. *
  579. * alloc:
  580. * The CFAllocator which should be used to allocate memory for the
  581. * new service. If this reference is not a valid CFAllocator, the
  582. * behavior is undefined.
  583. *
  584. * service:
  585. * A CFNetServiceRef representing the original service. Must be
  586. * non-NULL. If this If this reference is not a valid
  587. * CFNetServiceRef, the behavior is undefined.
  588. *
  589. * Result:
  590. * Returns a valid CFNetServiceRef which contains a copy of all
  591. * previously resolved data from the original. NULL is returned in
  592. * the case of failure.
  593. *
  594. * Availability:
  595. * Mac OS X: in version 10.3 and later in CoreServices.framework
  596. * CarbonLib: not available
  597. * Non-Carbon CFM: not available
  598. }
  599. function CFNetServiceCreateCopy( alloc: CFAllocatorRef; service: CFNetServiceRef ): CFNetServiceRef; external name '_CFNetServiceCreateCopy';
  600. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
  601. {
  602. * CFNetServiceGetDomain()
  603. *
  604. * Discussion:
  605. * Query a Network Service for its domain.
  606. *
  607. * Mac OS X threading:
  608. * Thread safe
  609. * The function gets the data in a thread-safe manner, but the
  610. * resulting data is not safe. Since it is returned as a matter of
  611. * a get opposed to a copy, the data is not safe if the service is
  612. * being altered from another thread.
  613. *
  614. * Parameters:
  615. *
  616. * theService:
  617. * The Network Service to be queried. Must be non-NULL.
  618. *
  619. * Result:
  620. * CFStringRef which is the service's domain.
  621. *
  622. * Availability:
  623. * Mac OS X: in version 10.2 and later in CoreServices.framework
  624. * CarbonLib: not available
  625. * Non-Carbon CFM: not available
  626. }
  627. function CFNetServiceGetDomain( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetDomain';
  628. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  629. {
  630. * CFNetServiceGetType()
  631. *
  632. * Discussion:
  633. * Query a Network Service for its type.
  634. *
  635. * Mac OS X threading:
  636. * Thread safe
  637. * The function gets the data in a thread-safe manner, but the
  638. * resulting data is not safe. Since it is returned as a matter of
  639. * a get opposed to a copy, the data is not safe if the service is
  640. * being altered from another thread.
  641. *
  642. * Parameters:
  643. *
  644. * theService:
  645. * The Network Service to be queried. Must be non-NULL.
  646. *
  647. * Result:
  648. * CFStringRef which is the service's service type.
  649. *
  650. * Availability:
  651. * Mac OS X: in version 10.2 and later in CoreServices.framework
  652. * CarbonLib: not available
  653. * Non-Carbon CFM: not available
  654. }
  655. function CFNetServiceGetType( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetType';
  656. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  657. {
  658. * CFNetServiceGetName()
  659. *
  660. * Discussion:
  661. * Query a Network Service for its name.
  662. *
  663. * Mac OS X threading:
  664. * Thread safe
  665. * The function gets the data in a thread-safe manner, but the
  666. * resulting data is not safe. Since it is returned as a matter of
  667. * a get opposed to a copy, the data is not safe if the service is
  668. * being altered from another thread.
  669. *
  670. * Parameters:
  671. *
  672. * theService:
  673. * The Network Service to be queried. Must be non-NULL.
  674. *
  675. * Result:
  676. * CFStringRef which is the service's name.
  677. *
  678. * Availability:
  679. * Mac OS X: in version 10.2 and later in CoreServices.framework
  680. * CarbonLib: not available
  681. * Non-Carbon CFM: not available
  682. }
  683. function CFNetServiceGetName( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetName';
  684. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  685. {
  686. * CFNetServiceRegisterWithOptions()
  687. *
  688. * Discussion:
  689. * Registers the entity on the network. This requires that the
  690. * service has a domain, a type, a name, and a port. The service is
  691. * registered on the network until this function returns or is
  692. * cancelled by calling CFNetServiceCancel. In synchronous mode,
  693. * this function will block until there is an error or it is
  694. * cancelled from another thread. In asynchronous mode, this
  695. * function returns immediately and the underlying network
  696. * registration process will start.
  697. *
  698. * Mac OS X threading:
  699. * Thread safe
  700. *
  701. * Parameters:
  702. *
  703. * theService:
  704. * The Network Service to register on the network. Must be
  705. * non-NULL.
  706. *
  707. * options:
  708. * A set of bit options used to instruct the registration process.
  709. * Current supported option is kCFNetServiceFlagNoAutoRename.
  710. *
  711. * error:
  712. * A reference to an error struct which will be set to the error
  713. * and domain of the error should one occur. If the value of
  714. * error is not desired, set to NULL.
  715. *
  716. * Result:
  717. * Returns FALSE if domain, type, name or port is NULL. In
  718. * synchronous mode, it will always return FALSE as a result of the
  719. * error or the cancellation. In asynchronous mode, it will return
  720. * TRUE if the registration process could start.
  721. *
  722. * Availability:
  723. * Mac OS X: in version 10.4 and later in CoreServices.framework
  724. * CarbonLib: not available
  725. * Non-Carbon CFM: not available
  726. }
  727. function CFNetServiceRegisterWithOptions( theService: CFNetServiceRef; options: CFOptionFlags; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceRegisterWithOptions';
  728. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  729. {
  730. * CFNetServiceResolveWithTimeout()
  731. *
  732. * Discussion:
  733. * Resolves the information related to this service. It will
  734. * resolve the target host, the addresses, and the first TXT record
  735. * associated with the service.
  736. *
  737. * Mac OS X threading:
  738. * Thread safe
  739. *
  740. * Parameters:
  741. *
  742. * theService:
  743. * The CFNetServiceRef which should be resolved. Must be non-NULL.
  744. * If this reference is not a valid CFNetServiceRef, the behavior
  745. * is undefined.
  746. *
  747. * timeout:
  748. * CFTimeInterval representing the maximum amount of time to take
  749. * to perform the resolve. If the resolve can not be performed
  750. * within this timeout, the function or callback will recieve a
  751. * timeout error. Values less than or equal to zero indicate an
  752. * infinite timeout.
  753. *
  754. * error:
  755. * A reference to a CFStreamError structure which will be filled
  756. * with any error information should an error occur. May be set
  757. * to NULL if error information is not wanted.
  758. *
  759. * Result:
  760. * Returns TRUE on success and FALSE on failure. In asynchronous
  761. * mode, this function will return immediately. In synchronous
  762. * mode, it will block until the resolve has completed or until the
  763. * resolve is cancelled.
  764. *
  765. * Availability:
  766. * Mac OS X: in version 10.4 and later in CoreServices.framework
  767. * CarbonLib: not available
  768. * Non-Carbon CFM: not available
  769. }
  770. function CFNetServiceResolveWithTimeout( theService: CFNetServiceRef; timeout: CFTimeInterval; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceResolveWithTimeout';
  771. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  772. {
  773. * CFNetServiceCancel()
  774. *
  775. * Discussion:
  776. * Cancels an outstanding request for registration or resolution.
  777. *
  778. * Mac OS X threading:
  779. * Thread safe
  780. *
  781. * Parameters:
  782. *
  783. * theService:
  784. * The Network Service which is active. Must be non-NULL.
  785. *
  786. * Availability:
  787. * Mac OS X: in version 10.2 and later in CoreServices.framework
  788. * CarbonLib: not available
  789. * Non-Carbon CFM: not available
  790. }
  791. procedure CFNetServiceCancel( theService: CFNetServiceRef ); external name '_CFNetServiceCancel';
  792. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  793. {
  794. * CFNetServiceGetTargetHost()
  795. *
  796. * Discussion:
  797. * Query a Network Service for its resolve target.
  798. *
  799. * Mac OS X threading:
  800. * Thread safe
  801. * The function gets the data in a thread-safe manner, but the
  802. * resulting data is not safe. Since it is returned as a matter of
  803. * a get opposed to a copy, the data is not safe if the service is
  804. * being altered from another thread.
  805. *
  806. * Parameters:
  807. *
  808. * theService:
  809. * The Network Service to be queried. Must be non-NULL.
  810. *
  811. * Result:
  812. * Returns The target hostname of the machine providing the service,
  813. * or NULL if the entity's target is not known (has not been
  814. * resolved).
  815. *
  816. * Availability:
  817. * Mac OS X: in version 10.4 and later in CoreServices.framework
  818. * CarbonLib: not available
  819. * Non-Carbon CFM: not available
  820. }
  821. function CFNetServiceGetTargetHost( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetTargetHost';
  822. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  823. {
  824. * CFNetServiceGetPortNumber()
  825. *
  826. * Discussion:
  827. * Query a Network Service for its port number.
  828. *
  829. * Mac OS X threading:
  830. * Thread safe
  831. * The function gets the data in a thread-safe manner.
  832. *
  833. * Parameters:
  834. *
  835. * theService:
  836. * The Network Service to be queried. Must be non-NULL.
  837. *
  838. * Result:
  839. * Returns a SInt32 containing the port number in host byte order.
  840. * Returns -1 if the entity's port is not known (has not been
  841. * resolved)
  842. *
  843. * Availability:
  844. * Mac OS X: in version 10.5 and later in CoreServices.framework
  845. * CarbonLib: not available
  846. * Non-Carbon CFM: not available
  847. }
  848. function CFNetServiceGetPortNumber( theService: CFNetServiceRef ): SInt32; external name '_CFNetServiceGetPortNumber';
  849. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
  850. {
  851. * CFNetServiceGetAddressing()
  852. *
  853. * Discussion:
  854. * Query a Network Service for its addressing.
  855. *
  856. * Mac OS X threading:
  857. * Thread safe
  858. * The function gets the data in a thread-safe manner, but the
  859. * resulting data is not safe. Since it is returned as a matter of
  860. * a get opposed to a copy, the data is not safe if the service is
  861. * being altered from another thread.
  862. *
  863. * Parameters:
  864. *
  865. * theService:
  866. * The Network Service to be queried. Must be non-NULL.
  867. *
  868. * Result:
  869. * Returns NULL if the entity's addressing is not known (has not
  870. * been resolved). The array will contain a CFDataRef for each
  871. * address resolved. Each CFDataRef contains a struct sockaddr
  872. * representing the address of the service.
  873. *
  874. * Availability:
  875. * Mac OS X: in version 10.2 and later in CoreServices.framework
  876. * CarbonLib: not available
  877. * Non-Carbon CFM: not available
  878. }
  879. function CFNetServiceGetAddressing( theService: CFNetServiceRef ): CFArrayRef; external name '_CFNetServiceGetAddressing';
  880. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  881. {
  882. * CFNetServiceGetTXTData()
  883. *
  884. * Discussion:
  885. * Query a Network Service for its TXT record contents.
  886. *
  887. * Mac OS X threading:
  888. * Thread safe
  889. * The function gets the data in a thread-safe manner, but the
  890. * resulting data is not safe. Since it is returned as a matter of
  891. * a get opposed to a copy, the data is not safe if the service is
  892. * being altered from another thread.
  893. *
  894. * Parameters:
  895. *
  896. * theService:
  897. * The Network Service to be queried. Must be non-NULL.
  898. *
  899. * Result:
  900. * Returns NULL if the entity's TXT is not known (has not been
  901. * resolved). The result will contain the contents of the TXT
  902. * record. This is suitable to pass to
  903. * CFNetServiceCreateDictionaryWithTXTData.
  904. *
  905. * Availability:
  906. * Mac OS X: in version 10.4 and later in CoreServices.framework
  907. * CarbonLib: not available
  908. * Non-Carbon CFM: not available
  909. }
  910. function CFNetServiceGetTXTData( theService: CFNetServiceRef ): CFDataRef; external name '_CFNetServiceGetTXTData';
  911. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  912. {
  913. * CFNetServiceSetTXTData()
  914. *
  915. * Discussion:
  916. * Sets the TXT record for the service. If the service is currently
  917. * registered on the network, the record will be broadcast. Setting
  918. * the TXT record on a resolving service is not allowed.
  919. *
  920. * Mac OS X threading:
  921. * Thread safe
  922. *
  923. * Parameters:
  924. *
  925. * theService:
  926. * The Network Service to receive the new record. Must be
  927. * non-NULL.
  928. *
  929. * txtRecord:
  930. * The contents of the TXT record. This should not exceed a
  931. * length of 1450 bytes.
  932. *
  933. * Availability:
  934. * Mac OS X: in version 10.4 and later in CoreServices.framework
  935. * CarbonLib: not available
  936. * Non-Carbon CFM: not available
  937. }
  938. function CFNetServiceSetTXTData( theService: CFNetServiceRef; txtRecord: CFDataRef ): Boolean; external name '_CFNetServiceSetTXTData';
  939. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  940. {
  941. * CFNetServiceCreateDictionaryWithTXTData()
  942. *
  943. * Discussion:
  944. * Parses the given TXT record data into a set of key/value pairs as
  945. * a CFDictionary where keys are CFStringRefs and values are
  946. * CFDataRefs. If the given record can not be parsed, NULL will be
  947. * returned. READ THE COMMENTS FOR
  948. * CFNetServiceCreateTXTDataWithDictionary TO FULLY UNDERSTAND THE
  949. * USE AND RESULTS OF THIS FUNCTION.
  950. *
  951. * Mac OS X threading:
  952. * Thread safe
  953. *
  954. * Parameters:
  955. *
  956. * alloc:
  957. * CFAllocatorRef to be used for the creation of the result.
  958. *
  959. * txtRecord:
  960. * The TXT record data as returned by CFNetServiceGetInfo.
  961. *
  962. * Result:
  963. * CFDictionaryRef containing the key/value pairs parsed from the
  964. * record. It will return NULL if the record could not be parsed.
  965. * Keys in the dictionary are CFStringRef's. Values are CFDataRef's.
  966. *
  967. * Availability:
  968. * Mac OS X: in version 10.4 and later in CoreServices.framework
  969. * CarbonLib: not available
  970. * Non-Carbon CFM: not available
  971. }
  972. function CFNetServiceCreateDictionaryWithTXTData( alloc: CFAllocatorRef; txtRecord: CFDataRef ): CFDictionaryRef; external name '_CFNetServiceCreateDictionaryWithTXTData';
  973. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  974. {
  975. * CFNetServiceCreateTXTDataWithDictionary()
  976. *
  977. * Discussion:
  978. * Flattens a set of key/value pairs into a CFDataRef suitable to
  979. * pass into CFNetServiceSetTXTData. This function will properly
  980. * format the data for TXT record usage. THIS IS NOT A GENERAL
  981. * CFDictionaryRef FLATTENING ROUTINE. CFDictionaryRef keys should
  982. * be CFStringRef's and values should be CFDataRef's. For
  983. * convenience, values that are CFStringRef's will be converted to
  984. * CFDataRef's representing the flattened UTF-8 bytes of the string.
  985. * The types of the values are not encoded in the CFDataRef's,
  986. * therefore CFStringRef's will be flattened into CFDataRef's, and
  987. * they will come out of CFNetServiceCreateDictionaryWithTXTData as
  988. * CFDataRef's.
  989. *
  990. * Mac OS X threading:
  991. * Thread safe
  992. *
  993. * Parameters:
  994. *
  995. * alloc:
  996. * CFAllocatorRef to be used for the creation of the result.
  997. *
  998. * keyValuePairs:
  999. * CFDictionaryRef containing keys and values to be placed into
  1000. * the TXT record. The keys must be CFStringRef's. The values
  1001. * should be CFDataRef's (CFStringRef's are permitted for
  1002. * convenience). Any other types will cause a failure. The
  1003. * length of a key and its value should not exceed 255.
  1004. *
  1005. * Result:
  1006. * CFDataRef containing the flattened form of the keys and values.
  1007. * If the dictionary could not be flattend, NULL will be returned.
  1008. *
  1009. * Availability:
  1010. * Mac OS X: in version 10.4 and later in CoreServices.framework
  1011. * CarbonLib: not available
  1012. * Non-Carbon CFM: not available
  1013. }
  1014. function CFNetServiceCreateTXTDataWithDictionary( alloc: CFAllocatorRef; keyValuePairs: CFDictionaryRef ): CFDataRef; external name '_CFNetServiceCreateTXTDataWithDictionary';
  1015. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  1016. {
  1017. * CFNetServiceSetClient()
  1018. *
  1019. * Discussion:
  1020. * Sets up the service to be used in asynchronous mode.
  1021. * Notification of registration failure or resolution completion
  1022. * will occur through the given callback. Once the client is set,
  1023. * the service must be scheduled on a runloop. The client callback
  1024. * will be triggered via one of the scheduled run loops; It is the
  1025. * caller's responsibility to ensure that at least one of the
  1026. * scheduled run loops is being run. This call must be performed
  1027. * before calling CFNetServiceRegister or CFNetServiceResolve,
  1028. * otherwise it will return FALSE. TRUE will be returned if the
  1029. * client could be set.
  1030. *
  1031. * Mac OS X threading:
  1032. * Thread safe
  1033. *
  1034. * Parameters:
  1035. *
  1036. * theService:
  1037. * The service to set up for asynchronous mode. Must be non-NULL.
  1038. *
  1039. * clientCB:
  1040. * Function pointer will be called upon registration failure or
  1041. * upon resolution completion. In the case of resolution, this
  1042. * callback may be called multiple times if there is more than one
  1043. * address for a service. Passing NULL will remove the client
  1044. * from the entity and cancel any outstanding activity.
  1045. *
  1046. * clientContext:
  1047. * Client contextual information to be used when calling clientCB.
  1048. * Passing NULL will remove the client from the entity and cancel
  1049. * any outstanding activity.
  1050. *
  1051. * Result:
  1052. * Returns FALSE if the client could not be set, TRUE otherwise.
  1053. *
  1054. * Availability:
  1055. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1056. * CarbonLib: not available
  1057. * Non-Carbon CFM: not available
  1058. }
  1059. function CFNetServiceSetClient( theService: CFNetServiceRef; clientCB: CFNetServiceClientCallBack { can be NULL }; clientContext: CFNetServiceClientContextPtr { can be NULL } ): Boolean; external name '_CFNetServiceSetClient';
  1060. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1061. {
  1062. * CFNetServiceScheduleWithRunLoop()
  1063. *
  1064. * Discussion:
  1065. * Schedule the given service on the given run loop and mode.
  1066. *
  1067. * Mac OS X threading:
  1068. * Thread safe
  1069. *
  1070. * Parameters:
  1071. *
  1072. * theService:
  1073. * The service which is set up for asynchronous mode. Must be
  1074. * non-NULL.
  1075. *
  1076. * runLoop:
  1077. * A reference to a runloop on which the service should be
  1078. * scheduled. Must be non-NULL.
  1079. *
  1080. * runLoopMode:
  1081. * The mode on which to schedule the service. Must be non-NULL.
  1082. *
  1083. * Availability:
  1084. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1085. * CarbonLib: not available
  1086. * Non-Carbon CFM: not available
  1087. }
  1088. procedure CFNetServiceScheduleWithRunLoop( theService: CFNetServiceRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceScheduleWithRunLoop';
  1089. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1090. {
  1091. * CFNetServiceUnscheduleFromRunLoop()
  1092. *
  1093. * Discussion:
  1094. * Unschedule the given service from the given run loop and mode.
  1095. *
  1096. * Mac OS X threading:
  1097. * Thread safe
  1098. *
  1099. * Parameters:
  1100. *
  1101. * theService:
  1102. * The service which is set up for asynchronous mode. Must be
  1103. * non-NULL.
  1104. *
  1105. * runLoop:
  1106. * A reference to a runloop from which the service should be
  1107. * unscheduled. Must be non-NULL.
  1108. *
  1109. * runLoopMode:
  1110. * The mode from which to unschedule the service. Must be
  1111. * non-NULL.
  1112. *
  1113. * Availability:
  1114. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1115. * CarbonLib: not available
  1116. * Non-Carbon CFM: not available
  1117. }
  1118. procedure CFNetServiceUnscheduleFromRunLoop( theService: CFNetServiceRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceUnscheduleFromRunLoop';
  1119. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1120. {
  1121. * CFNetServiceMonitorCreate()
  1122. *
  1123. * Discussion:
  1124. * Creates an instance of an object suitable for watching for
  1125. * CFNetService record changes on the network.
  1126. *
  1127. * Mac OS X threading:
  1128. * Thread safe
  1129. *
  1130. * Parameters:
  1131. *
  1132. * alloc:
  1133. * The CFAllocator which should be used to allocate memory for the
  1134. * monitor and its storage for values. If this reference is not a
  1135. * valid CFAllocator, the behavior is undefined.
  1136. *
  1137. * theService:
  1138. * The CFNetService to be monitored for record changes.
  1139. *
  1140. * clientCB:
  1141. * Function pointer that will be called as record changes occur.
  1142. * Must be non-NULL.
  1143. *
  1144. * clientContext:
  1145. * Client contextual information to be used when calling clientCB.
  1146. * Must be non-NULL.
  1147. *
  1148. * Result:
  1149. * Returns a new instance of a CFNetServiceMonitor, or NULL if the
  1150. * object could not be created.
  1151. *
  1152. * Availability:
  1153. * Mac OS X: in version 10.4 and later in CoreServices.framework
  1154. * CarbonLib: not available
  1155. * Non-Carbon CFM: not available
  1156. }
  1157. function CFNetServiceMonitorCreate( alloc: CFAllocatorRef; theService: CFNetServiceRef; clientCB: CFNetServiceMonitorClientCallBack; var clientContext: CFNetServiceClientContext ): CFNetServiceMonitorRef; external name '_CFNetServiceMonitorCreate';
  1158. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  1159. {
  1160. * CFNetServiceMonitorInvalidate()
  1161. *
  1162. * Discussion:
  1163. * Invalidates the given monitor object so that it may no longer be
  1164. * scheduled and callback never be called. This will also stop any
  1165. * monitors currently in progress.
  1166. *
  1167. * Mac OS X threading:
  1168. * Thread safe
  1169. *
  1170. * Parameters:
  1171. *
  1172. * monitor:
  1173. * CFNetServiceMonitor to invalidate. Must be non-NULL.
  1174. *
  1175. * Availability:
  1176. * Mac OS X: in version 10.4 and later in CoreServices.framework
  1177. * CarbonLib: not available
  1178. * Non-Carbon CFM: not available
  1179. }
  1180. procedure CFNetServiceMonitorInvalidate( monitor: CFNetServiceMonitorRef ); external name '_CFNetServiceMonitorInvalidate';
  1181. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  1182. {
  1183. * CFNetServiceMonitorStart()
  1184. *
  1185. * Discussion:
  1186. * Starts monitoring for record changes on a service. It watches
  1187. * for changes of the given record type. If there is already an
  1188. * outstanding monitor, it will return FALSE. In synchronous mode,
  1189. * this call blocks until the monitor is stopped. It will return
  1190. * FALSE if there is an error performing the monitor or if there is
  1191. * some other error. It will return TRUE otherwise. In
  1192. * asynchronous mode, this call will return TRUE or FALSE depending
  1193. * if the underlying network query could be instantiated.
  1194. *
  1195. * Mac OS X threading:
  1196. * Thread safe
  1197. *
  1198. * Parameters:
  1199. *
  1200. * monitor:
  1201. * CFNetServiceMonitor to perform the watch.
  1202. *
  1203. * recordType:
  1204. * CFNetServiceMonitorType indicating the record type to watch.
  1205. *
  1206. * error:
  1207. * A reference to an error struct which will be set to the error
  1208. * and domain of the error should one occur. If the value of
  1209. * error is not desired, set to NULL.
  1210. *
  1211. * Result:
  1212. * Returns FALSE if an error occurs during a synchronous monitor or
  1213. * if the monitor could not start. It returns TRUE otherwise.
  1214. *
  1215. * Availability:
  1216. * Mac OS X: in version 10.4 and later in CoreServices.framework
  1217. * CarbonLib: not available
  1218. * Non-Carbon CFM: not available
  1219. }
  1220. function CFNetServiceMonitorStart( monitor: CFNetServiceMonitorRef; recordType: CFNetServiceMonitorType; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceMonitorStart';
  1221. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  1222. {
  1223. * CFNetServiceMonitorStop()
  1224. *
  1225. * Discussion:
  1226. * Stops an outstanding monitor.
  1227. *
  1228. * Mac OS X threading:
  1229. * Thread safe
  1230. *
  1231. * Parameters:
  1232. *
  1233. * monitor:
  1234. * CFNetServiceMonitor with an active monitor. Must be non-NULL.
  1235. *
  1236. * error:
  1237. * Error value to be returned in "error" in
  1238. * CFNetServiceMonitorStart if monitor is being performed in
  1239. * synchronous mode. In this case, a non-zero of the error field
  1240. * of the struct will cause CFNetServiceMonitorStart to return
  1241. * FALSE. In asynchronous mode, the client call back will be
  1242. * called with this error.
  1243. *
  1244. * Availability:
  1245. * Mac OS X: in version 10.4 and later in CoreServices.framework
  1246. * CarbonLib: not available
  1247. * Non-Carbon CFM: not available
  1248. }
  1249. procedure CFNetServiceMonitorStop( monitor: CFNetServiceMonitorRef; error: CFStreamErrorPtr { can be NULL } ); external name '_CFNetServiceMonitorStop';
  1250. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  1251. {
  1252. * CFNetServiceMonitorScheduleWithRunLoop()
  1253. *
  1254. * Discussion:
  1255. * Schedules the monitor on a run loop and mode. Use this to place
  1256. * the given monitor into asynchronous mode. The client callback
  1257. * will be triggered via one of the scheduled run loops; It is the
  1258. * caller's responsibility to ensure that at least one of the
  1259. * scheduled run loops is being run.
  1260. *
  1261. * Mac OS X threading:
  1262. * Thread safe
  1263. *
  1264. * Parameters:
  1265. *
  1266. * monitor:
  1267. * CFNetServiceMonitor to schedule. Must be non-NULL.
  1268. *
  1269. * runLoop:
  1270. * A reference to a runloop on which the monitor should be
  1271. * scheduled. Must be non-NULL.
  1272. *
  1273. * runLoopMode:
  1274. * The mode on which to schedule the monitor. Must be non-NULL.
  1275. *
  1276. * Availability:
  1277. * Mac OS X: in version 10.4 and later in CoreServices.framework
  1278. * CarbonLib: not available
  1279. * Non-Carbon CFM: not available
  1280. }
  1281. procedure CFNetServiceMonitorScheduleWithRunLoop( monitor: CFNetServiceMonitorRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceMonitorScheduleWithRunLoop';
  1282. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  1283. {
  1284. * CFNetServiceMonitorUnscheduleFromRunLoop()
  1285. *
  1286. * Discussion:
  1287. * Unschedules the browser from a run loop and mode.
  1288. *
  1289. * Mac OS X threading:
  1290. * Thread safe
  1291. *
  1292. * Parameters:
  1293. *
  1294. * monitor:
  1295. * CFNetServiceMonitor to unschedule. Must be non-NULL.
  1296. *
  1297. * runLoop:
  1298. * A reference to a runloop from which the monitor should be
  1299. * unscheduled. Must be non-NULL.
  1300. *
  1301. * runLoopMode:
  1302. * The mode from which to unschedule the monitor. Must be
  1303. * non-NULL.
  1304. *
  1305. * Availability:
  1306. * Mac OS X: in version 10.4 and later in CoreServices.framework
  1307. * CarbonLib: not available
  1308. * Non-Carbon CFM: not available
  1309. }
  1310. procedure CFNetServiceMonitorUnscheduleFromRunLoop( monitor: CFNetServiceMonitorRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceMonitorUnscheduleFromRunLoop';
  1311. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  1312. {
  1313. * CFNetServiceBrowserCreate()
  1314. *
  1315. * Discussion:
  1316. * Creates an instance of a browser object.
  1317. *
  1318. * Mac OS X threading:
  1319. * Thread safe
  1320. *
  1321. * Parameters:
  1322. *
  1323. * alloc:
  1324. * The CFAllocator which should be used to allocate memory for the
  1325. * browser and its storage for values. If this reference is not a
  1326. * valid CFAllocator, the behavior is undefined.
  1327. *
  1328. * clientCB:
  1329. * Function pointer that will be called as domains or services are
  1330. * found on the network. Must be non-NULL.
  1331. *
  1332. * clientContext:
  1333. * Client contextual information to be used when calling clientCB.
  1334. * Must be non-NULL.
  1335. *
  1336. * Result:
  1337. * Returns a new instance of a browser, or NULL if the instance
  1338. * could not be created.
  1339. *
  1340. * Availability:
  1341. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1342. * CarbonLib: not available
  1343. * Non-Carbon CFM: not available
  1344. }
  1345. function CFNetServiceBrowserCreate( alloc: CFAllocatorRef; clientCB: CFNetServiceBrowserClientCallBack; var clientContext: CFNetServiceClientContext ): CFNetServiceBrowserRef; external name '_CFNetServiceBrowserCreate';
  1346. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1347. {
  1348. * CFNetServiceBrowserInvalidate()
  1349. *
  1350. * Discussion:
  1351. * Invalidates the given browser object so that it may no longer be
  1352. * scheduled and callback never be called. This will also stop any
  1353. * searches currently in progress.
  1354. *
  1355. * Parameters:
  1356. *
  1357. * browser:
  1358. * Network Service Browser to invalidate. Must be non-NULL.
  1359. *
  1360. * Availability:
  1361. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1362. * CarbonLib: not available
  1363. * Non-Carbon CFM: not available
  1364. }
  1365. procedure CFNetServiceBrowserInvalidate( browser: CFNetServiceBrowserRef ); external name '_CFNetServiceBrowserInvalidate';
  1366. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1367. {
  1368. * CFNetServiceBrowserSearchForDomains()
  1369. *
  1370. * Discussion:
  1371. * Starts a search for domains. The browser will either try to find
  1372. * "Browse" domains or will search for "Registration" domains. If
  1373. * there is already an outstanding search, it will return FALSE. In
  1374. * syncronous mode, this call blocks until the search is stopped.
  1375. * It will return FALSE if there is an error performing the search.
  1376. * It will return TRUE otherwise. In asynchronous mode, this call
  1377. * will return TRUE or FALSE depending if the underlying network
  1378. * search could be started.
  1379. *
  1380. * Mac OS X threading:
  1381. * Thread safe
  1382. *
  1383. * Parameters:
  1384. *
  1385. * browser:
  1386. * Network Service Browser to perform the search. Must be
  1387. * non-NULL.
  1388. *
  1389. * registrationDomains:
  1390. * FALSE if "Browse" domains are to be discovered. TRUE if only
  1391. * "Registration" domains are to be discovered.
  1392. *
  1393. * error:
  1394. * A reference to an error struct which will be set to the error
  1395. * and domain of the error should one occur. If the value of
  1396. * error is not desired, set to NULL.
  1397. *
  1398. * Result:
  1399. * Returns FALSE if an error occurs during a synchronous search or
  1400. * if the search could not start. It returns TRUE otherwise.
  1401. *
  1402. * Availability:
  1403. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1404. * CarbonLib: not available
  1405. * Non-Carbon CFM: not available
  1406. }
  1407. function CFNetServiceBrowserSearchForDomains( browser: CFNetServiceBrowserRef; registrationDomains: Boolean; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceBrowserSearchForDomains';
  1408. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1409. {
  1410. * CFNetServiceBrowserSearchForServices()
  1411. *
  1412. * Discussion:
  1413. * Starts a search for a service type on the given domain. If there
  1414. * is already an outstanding search, it will return FALSE. In
  1415. * syncronous mode, this call blocks until the search is stopped.
  1416. * It will return FALSE if there is an error performing the search
  1417. * or if there is some other error. It will return TRUE otherwise.
  1418. * In asynchronous mode, this call will return TRUE or FALSE
  1419. * depending if the underlying network search could be instantiated.
  1420. *
  1421. * Mac OS X threading:
  1422. * Thread safe
  1423. *
  1424. * Parameters:
  1425. *
  1426. * browser:
  1427. * Network Service Browser to perform the search. Must be
  1428. * non-NULL.
  1429. *
  1430. * domain:
  1431. * Network domain to search in order to find the service. Must be
  1432. * non-NULL.
  1433. *
  1434. * serviceType:
  1435. * Service type for which to search. Must be non-NULL.
  1436. *
  1437. * error:
  1438. * A reference to an error struct which will be set to the error
  1439. * and domain of the error should one occur. If the value of
  1440. * error is not desired, set to NULL.
  1441. *
  1442. * Result:
  1443. * Returns FALSE if an error occurs during a synchronous search or
  1444. * if the search could not start. It returns TRUE otherwise.
  1445. *
  1446. * Availability:
  1447. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1448. * CarbonLib: not available
  1449. * Non-Carbon CFM: not available
  1450. }
  1451. function CFNetServiceBrowserSearchForServices( browser: CFNetServiceBrowserRef; domain: CFStringRef; serviceType: CFStringRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceBrowserSearchForServices';
  1452. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1453. {
  1454. * CFNetServiceBrowserStopSearch()
  1455. *
  1456. * Discussion:
  1457. * Stops an outstanding browser search.
  1458. *
  1459. * Mac OS X threading:
  1460. * Thread safe
  1461. *
  1462. * Parameters:
  1463. *
  1464. * browser:
  1465. * Network Service Browser performing the search. Must be
  1466. * non-NULL.
  1467. *
  1468. * error:
  1469. * Error value to be returned in "error" in
  1470. * CFNetServiceBrowserStartServiceSearch if search is being
  1471. * performed in synchronous mode. In this case, a non-zero of the
  1472. * error field of the struct will cause
  1473. * CFNetServiceBrowserStartServiceSearch to return FALSE. In
  1474. * asynchronous mode, the client call back will be called with
  1475. * this error.
  1476. *
  1477. * Availability:
  1478. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1479. * CarbonLib: not available
  1480. * Non-Carbon CFM: not available
  1481. }
  1482. procedure CFNetServiceBrowserStopSearch( browser: CFNetServiceBrowserRef; error: CFStreamErrorPtr { can be NULL } ); external name '_CFNetServiceBrowserStopSearch';
  1483. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1484. {
  1485. * CFNetServiceBrowserScheduleWithRunLoop()
  1486. *
  1487. * Discussion:
  1488. * Schedules the browser on a run loop and mode. Use this to place
  1489. * the given browser into asynchronous mode. The client callback
  1490. * will be triggered via one of the scheduled run loops; It is the
  1491. * caller's responsibility to ensure that at least one of the
  1492. * scheduled run loops is being run.
  1493. *
  1494. * Mac OS X threading:
  1495. * Thread safe
  1496. *
  1497. * Parameters:
  1498. *
  1499. * browser:
  1500. * Network Service Browser to schedule. Must be non-NULL.
  1501. *
  1502. * runLoop:
  1503. * A reference to a runloop on which the browser should be
  1504. * scheduled. Must be non-NULL.
  1505. *
  1506. * runLoopMode:
  1507. * The mode on which to schedule the browser. Must be non-NULL.
  1508. *
  1509. * Availability:
  1510. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1511. * CarbonLib: not available
  1512. * Non-Carbon CFM: not available
  1513. }
  1514. procedure CFNetServiceBrowserScheduleWithRunLoop( browser: CFNetServiceBrowserRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceBrowserScheduleWithRunLoop';
  1515. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1516. {
  1517. * CFNetServiceBrowserUnscheduleFromRunLoop()
  1518. *
  1519. * Discussion:
  1520. * Unschedules the browser from a run loop and mode.
  1521. *
  1522. * Mac OS X threading:
  1523. * Thread safe
  1524. *
  1525. * Parameters:
  1526. *
  1527. * browser:
  1528. * Network Service Browser to unschedule. Must be non-NULL.
  1529. *
  1530. * runLoop:
  1531. * A reference to a runloop from which the browser should be
  1532. * unscheduled. Must be non-NULL.
  1533. *
  1534. * runLoopMode:
  1535. * The mode from which to unschedule the browser. Must be
  1536. * non-NULL.
  1537. *
  1538. * Availability:
  1539. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1540. * CarbonLib: not available
  1541. * Non-Carbon CFM: not available
  1542. }
  1543. procedure CFNetServiceBrowserUnscheduleFromRunLoop( browser: CFNetServiceBrowserRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceBrowserUnscheduleFromRunLoop';
  1544. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  1545. {$ifc TARGET_OS_MAC}
  1546. {
  1547. * CFNetServiceRegister() *** DEPRECATED ***
  1548. *
  1549. * Discussion:
  1550. * Registers the entity on the network. This requires that the
  1551. * service has a domain, a type, a name, and a port. The service is
  1552. * registered on the network until this function returns or is
  1553. * cancelled by calling CFNetServiceCancel. In synchronous mode,
  1554. * this function will block until there is an error or it is
  1555. * cancelled from another thread. In asynchronous mode, this
  1556. * function returns immediately and the underlying network
  1557. * registration process will start.
  1558. *
  1559. * As a result of new, better performing API's in Service Discovery,
  1560. * users should now call CFNetServiceRegisterWithOptions. Using the
  1561. * new calls will allow your application to perform better on the
  1562. * network.
  1563. *
  1564. * Mac OS X threading:
  1565. * Thread safe
  1566. *
  1567. * Parameters:
  1568. *
  1569. * theService:
  1570. * The Network Service to register on the network. Must be
  1571. * non-NULL.
  1572. *
  1573. * error:
  1574. * A reference to an error struct which will be set to the error
  1575. * and domain of the error should one occur. If the value of
  1576. * error is not desired, set to NULL.
  1577. *
  1578. * Result:
  1579. * Returns FALSE if domain, type, name or port is NULL. In
  1580. * synchronous mode, it will always return FALSE as a result of the
  1581. * error or the cancellation. In asynchronous mode, it will return
  1582. * TRUE if the registration process could start.
  1583. *
  1584. * Availability:
  1585. * Mac OS X: in version 10.2 and later in CoreServices.framework but deprecated in 10.4
  1586. * CarbonLib: not available
  1587. * Non-Carbon CFM: not available
  1588. }
  1589. function CFNetServiceRegister( theService: CFNetServiceRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceRegister';
  1590. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4,__IPHONE_NA,__IPHONE_NA) *)
  1591. {
  1592. * CFNetServiceResolve() *** DEPRECATED ***
  1593. *
  1594. * Discussion:
  1595. * Resolves the addressing for the given service. This requires
  1596. * that the service has a domain, a type, and a name. The service
  1597. * is resolved on the network until this function returns or is
  1598. * cancelled by calling CFNetServiceCancel. In synchronous mode,
  1599. * this function will block until there is an error or it is
  1600. * cancelled from another thread. In asynchronous mode, this
  1601. * function returns immediately and the underlying network
  1602. * resolution process will start.
  1603. *
  1604. * As a result of new, better performing API's in Service Discovery,
  1605. * users should now call CFNetServiceResolveWithTimeout. If needing
  1606. * to monitor TXT record changes, users should use the new
  1607. * CFNetServiceMonitor object. Using the new calls will allow your
  1608. * application to perform better on the network.
  1609. *
  1610. * Mac OS X threading:
  1611. * Thread safe
  1612. *
  1613. * Parameters:
  1614. *
  1615. * theService:
  1616. * The Network Service to resolve on the network. Must be
  1617. * non-NULL.
  1618. *
  1619. * error:
  1620. * A reference to an error struct which will be set to the error
  1621. * and domain of the error should one occur. If the value of
  1622. * error is not desired, set to NULL.
  1623. *
  1624. * Result:
  1625. * Returns FALSE if domain, type, or name is NULL. In synchronous
  1626. * mode, it will return FALSE as a result of an error or a
  1627. * cancellation. It will return TRUE if the resolution does
  1628. * succeed. In asynchronous mode, it will return TRUE if the
  1629. * resolution process could start.
  1630. *
  1631. * Availability:
  1632. * Mac OS X: in version 10.2 and later in CoreServices.framework but deprecated in 10.4
  1633. * CarbonLib: not available
  1634. * Non-Carbon CFM: not available
  1635. }
  1636. function CFNetServiceResolve( theService: CFNetServiceRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceResolve';
  1637. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4,__IPHONE_NA,__IPHONE_NA) *)
  1638. {
  1639. * CFNetServiceGetProtocolSpecificInformation() *** DEPRECATED ***
  1640. *
  1641. * Discussion:
  1642. * Query a Network Service for its protocol specific information.
  1643. *
  1644. *
  1645. * As a result of new, better performing API's in Service Discovery,
  1646. * users should now call CFNetServiceGetTXTData. If needing to
  1647. * monitor TXT record changes, users should use the new
  1648. * CFNetServiceMonitor object. Using the new calls will allow your
  1649. * application to perform better on the network.
  1650. *
  1651. * Mac OS X threading:
  1652. * Thread safe
  1653. * The function gets the data in a thread-safe manner, but the
  1654. * resulting data is not safe. Since it is returned as a matter of
  1655. * a get opposed to a copy, the data is not safe if the service is
  1656. * being altered from another thread.
  1657. *
  1658. * Parameters:
  1659. *
  1660. * theService:
  1661. * The Network Service to be queried. Must be non-NULL.
  1662. *
  1663. * Result:
  1664. * Returns NULL if a resolve has not been performed or if
  1665. * CFNetServiceSetProtocolSpecificInformation has not been called.
  1666. * It will return a CFStringRef containing the specific information
  1667. * if there is some.
  1668. *
  1669. * Availability:
  1670. * Mac OS X: in version 10.2 and later in CoreServices.framework but deprecated in 10.4
  1671. * CarbonLib: not available
  1672. * Non-Carbon CFM: not available
  1673. }
  1674. function CFNetServiceGetProtocolSpecificInformation( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetProtocolSpecificInformation';
  1675. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4,__IPHONE_NA,__IPHONE_NA) *)
  1676. {
  1677. * CFNetServiceSetProtocolSpecificInformation() *** DEPRECATED ***
  1678. *
  1679. * Discussion:
  1680. * Set a Network Service's protocol specific information.
  1681. *
  1682. * As a result of new, better performing API's in Service Discovery,
  1683. * users should now call CFNetServiceSetTXTData. Using the new
  1684. * calls will allow your application to perform better on the
  1685. * network.
  1686. *
  1687. * Mac OS X threading:
  1688. * Thread safe
  1689. *
  1690. * Parameters:
  1691. *
  1692. * theService:
  1693. * The Network Service to be queried. Must be non-NULL.
  1694. *
  1695. * theInfo:
  1696. * The protocol specific information to be added. Pass NULL to
  1697. * remove the information from the service.
  1698. *
  1699. * Availability:
  1700. * Mac OS X: in version 10.2 and later in CoreServices.framework but deprecated in 10.4
  1701. * CarbonLib: not available
  1702. * Non-Carbon CFM: not available
  1703. }
  1704. procedure CFNetServiceSetProtocolSpecificInformation( theService: CFNetServiceRef; theInfo: CFStringRef ); external name '_CFNetServiceSetProtocolSpecificInformation';
  1705. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4,__IPHONE_NA,__IPHONE_NA) *)
  1706. {$endc} {TARGET_OS_MAC}
  1707. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1708. end.
  1709. {$endc} {not MACOSALLINCLUDE}