CFSet.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. { CFSet.h
  2. Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
  3. }
  4. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, September 2005 }
  5. {
  6. Modified for use with Free Pascal
  7. Version 200
  8. Please report any bugs to <[email protected]>
  9. }
  10. {$mode macpas}
  11. {$packenum 1}
  12. {$macro on}
  13. {$inline on}
  14. {$CALLING MWPASCAL}
  15. unit CFSet;
  16. interface
  17. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  18. {$setc GAP_INTERFACES_VERSION := $0200}
  19. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  20. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  21. {$endc}
  22. {$ifc defined CPUPOWERPC and defined CPUI386}
  23. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  24. {$endc}
  25. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  26. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  27. {$endc}
  28. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  29. {$setc __ppc__ := 1}
  30. {$elsec}
  31. {$setc __ppc__ := 0}
  32. {$endc}
  33. {$ifc not defined __i386__ and defined CPUI386}
  34. {$setc __i386__ := 1}
  35. {$elsec}
  36. {$setc __i386__ := 0}
  37. {$endc}
  38. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  39. {$error Conflicting definitions for __ppc__ and __i386__}
  40. {$endc}
  41. {$ifc defined __ppc__ and __ppc__}
  42. {$setc TARGET_CPU_PPC := TRUE}
  43. {$setc TARGET_CPU_X86 := FALSE}
  44. {$elifc defined __i386__ and __i386__}
  45. {$setc TARGET_CPU_PPC := FALSE}
  46. {$setc TARGET_CPU_X86 := TRUE}
  47. {$elsec}
  48. {$error Neither __ppc__ nor __i386__ is defined.}
  49. {$endc}
  50. {$setc TARGET_CPU_PPC_64 := FALSE}
  51. {$ifc defined FPC_BIG_ENDIAN}
  52. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  53. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  54. {$elifc defined FPC_LITTLE_ENDIAN}
  55. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  56. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  57. {$elsec}
  58. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  59. {$endc}
  60. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  61. {$setc CALL_NOT_IN_CARBON := FALSE}
  62. {$setc OLDROUTINENAMES := FALSE}
  63. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  64. {$setc OPAQUE_UPP_TYPES := TRUE}
  65. {$setc OTCARBONAPPLICATION := TRUE}
  66. {$setc OTKERNEL := FALSE}
  67. {$setc PM_USE_SESSION_APIS := TRUE}
  68. {$setc TARGET_API_MAC_CARBON := TRUE}
  69. {$setc TARGET_API_MAC_OS8 := FALSE}
  70. {$setc TARGET_API_MAC_OSX := TRUE}
  71. {$setc TARGET_CARBON := TRUE}
  72. {$setc TARGET_CPU_68K := FALSE}
  73. {$setc TARGET_CPU_MIPS := FALSE}
  74. {$setc TARGET_CPU_SPARC := FALSE}
  75. {$setc TARGET_OS_MAC := TRUE}
  76. {$setc TARGET_OS_UNIX := FALSE}
  77. {$setc TARGET_OS_WIN32 := FALSE}
  78. {$setc TARGET_RT_MAC_68881 := FALSE}
  79. {$setc TARGET_RT_MAC_CFM := FALSE}
  80. {$setc TARGET_RT_MAC_MACHO := TRUE}
  81. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  82. {$setc TYPE_BOOL := FALSE}
  83. {$setc TYPE_EXTENDED := FALSE}
  84. {$setc TYPE_LONGLONG := TRUE}
  85. uses MacTypes,CFBase;
  86. {$ALIGN POWER}
  87. {!
  88. @header CFSet
  89. CFSet implements a container which stores unique values.
  90. }
  91. {!
  92. @typedef CFSetRetainCallBack
  93. Type of the callback function used by CFSets for retaining values.
  94. @param allocator The allocator of the CFSet.
  95. @param value The value to retain.
  96. @result The value to store in the set, which is usually the value
  97. parameter passed to this callback, but may be a different
  98. value if a different value should be stored in the set.
  99. }
  100. type
  101. CFSetRetainCallBack = function( allocator: CFAllocatorRef; value: {const} UnivPtr ): UnivPtr;
  102. {!
  103. @typedef CFSetReleaseCallBack
  104. Type of the callback function used by CFSets for releasing a retain on values.
  105. @param allocator The allocator of the CFSet.
  106. @param value The value to release.
  107. }
  108. type
  109. CFSetReleaseCallBack = procedure( allocator: CFAllocatorRef; value: {const} UnivPtr );
  110. {!
  111. @typedef CFSetCopyDescriptionCallBack
  112. Type of the callback function used by CFSets for describing values.
  113. @param value The value to describe.
  114. @result A description of the specified value.
  115. }
  116. type
  117. CFSetCopyDescriptionCallBack = function( value: {const} UnivPtr ): CFStringRef;
  118. {!
  119. @typedef CFSetEqualCallBack
  120. Type of the callback function used by CFSets for comparing values.
  121. @param value1 The first value to compare.
  122. @param value2 The second value to compare.
  123. @result True if the values are equal, otherwise false.
  124. }
  125. type
  126. CFSetEqualCallBack = function( value1: {const} UnivPtr; value2: {const} UnivPtr ): Boolean;
  127. {!
  128. @typedef CFSetHashCallBack
  129. Type of the callback function used by CFSets for hashing values.
  130. @param value The value to hash.
  131. @result The hash of the value.
  132. }
  133. type
  134. CFSetHashCallBack = function( value: {const} UnivPtr ): CFHashCode;
  135. {!
  136. @typedef CFSetCallBacks
  137. Structure containing the callbacks of a CFSet.
  138. @field version The version number of the structure type being passed
  139. in as a parameter to the CFSet creation functions. This
  140. structure is version 0.
  141. @field retain The callback used to add a retain for the set on
  142. values as they are put into the set. This callback returns
  143. the value to store in the set, which is usually the value
  144. parameter passed to this callback, but may be a different
  145. value if a different value should be stored in the set.
  146. The set's allocator is passed as the first argument.
  147. @field release The callback used to remove a retain previously added
  148. for the set from values as they are removed from the
  149. set. The set's allocator is passed as the first
  150. argument.
  151. @field copyDescription The callback used to create a descriptive
  152. string representation of each value in the set. This is
  153. used by the CFCopyDescription() function.
  154. @field equal The callback used to compare values in the set for
  155. equality for some operations.
  156. @field hash The callback used to compare values in the set for
  157. uniqueness for some operations.
  158. }
  159. type
  160. CFSetCallBacks = record
  161. version: CFIndex;
  162. retain: CFSetRetainCallBack;
  163. release: CFSetReleaseCallBack;
  164. copyDescription: CFSetCopyDescriptionCallBack;
  165. equal: CFSetEqualCallBack;
  166. hash: CFSetHashCallBack;
  167. end;
  168. CFSetCallBacksPtr = ^CFSetCallBacks;
  169. {!
  170. @constant kCFTypeSetCallBacks
  171. Predefined CFSetCallBacks structure containing a set of callbacks
  172. appropriate for use when the values in a CFSet are all CFTypes.
  173. }
  174. var kCFTypeSetCallBacks: CFSetCallBacks; external name '_kCFTypeSetCallBacks'; (* attribute const *)
  175. {!
  176. @constant kCFCopyStringSetCallBacks
  177. Predefined CFSetCallBacks structure containing a set of callbacks
  178. appropriate for use when the values in a CFSet should be copies
  179. of a CFString.
  180. }
  181. var kCFCopyStringSetCallBacks: CFSetCallBacks; external name '_kCFCopyStringSetCallBacks'; (* attribute const *)
  182. {!
  183. @typedef CFSetApplierFunction
  184. Type of the callback function used by the apply functions of
  185. CFSets.
  186. @param value The current value from the set.
  187. @param context The user-defined context parameter given to the apply
  188. function.
  189. }
  190. type
  191. CFSetApplierFunction = procedure( value: {const} UnivPtr; context: UnivPtr );
  192. {!
  193. @typedef CFSetRef
  194. This is the type of a reference to immutable CFSets.
  195. }
  196. type
  197. CFSetRef = ^SInt32; { an opaque 32-bit type }
  198. CFSetRefPtr = ^CFSetRef;
  199. {!
  200. @typedef CFMutableSetRef
  201. This is the type of a reference to mutable CFSets.
  202. }
  203. type
  204. CFMutableSetRef = CFSetRef;
  205. CFMutableSetRefPtr = ^CFMutableSetRef;
  206. {!
  207. @function CFSetGetTypeID
  208. Returns the type identifier of all CFSet instances.
  209. }
  210. function CFSetGetTypeID: CFTypeID; external name '_CFSetGetTypeID';
  211. {!
  212. @function CFSetCreate
  213. Creates a new immutable set with the given values.
  214. @param allocator The CFAllocator which should be used to allocate
  215. memory for the set and its storage for values. This
  216. parameter may be NULL in which case the current default
  217. CFAllocator is used. If this reference is not a valid
  218. CFAllocator, the behavior is undefined.
  219. @param values A C array of the pointer-sized values to be in the
  220. set. This C array is not changed or freed by this function.
  221. If this parameter is not a valid pointer to a C array of at
  222. least numValues pointers, the behavior is undefined.
  223. @param numValues The number of values to copy from the values C
  224. array into the CFSet. This number will be the count of the
  225. set. If this parameter is zero, negative, or greater than
  226. the number of values actually in the values C array, the
  227. behavior is undefined.
  228. @param callBacks A C pointer to a CFSetCallBacks structure
  229. initialized with the callbacks for the set to use on each
  230. value in the set. A copy of the contents of the
  231. callbacks structure is made, so that a pointer to a
  232. structure on the stack can be passed in, or can be reused
  233. for multiple set creations. If the version field of this
  234. callbacks structure is not one of the defined ones for
  235. CFSet, the behavior is undefined. The retain field may be
  236. NULL, in which case the CFSet will do nothing to add a
  237. retain to the contained values for the set. The release
  238. field may be NULL, in which case the CFSet will do nothing
  239. to remove the set's retain (if any) on the values when the
  240. set is destroyed. If the copyDescription field is NULL,
  241. the set will create a simple description for the value. If
  242. the equal field is NULL, the set will use pointer equality
  243. to test for equality of values. The hash field may be NULL,
  244. in which case the CFSet will determine uniqueness by pointer
  245. equality. This callbacks parameter
  246. itself may be NULL, which is treated as if a valid structure
  247. of version 0 with all fields NULL had been passed in.
  248. Otherwise, if any of the fields are not valid pointers to
  249. functions of the correct type, or this parameter is not a
  250. valid pointer to a CFSetCallBacks callbacks structure,
  251. the behavior is undefined. If any of the values put into the
  252. set is not one understood by one of the callback functions
  253. the behavior when that callback function is used is
  254. undefined.
  255. @result A reference to the new immutable CFSet.
  256. }
  257. function CFSetCreate( allocator: CFAllocatorRef; {const} values: UnivPtrPtr; numValues: CFIndex; {const} callBacks: CFSetCallBacksPtr { can be NULL } ): CFSetRef; external name '_CFSetCreate';
  258. {!
  259. @function CFSetCreateCopy
  260. Creates a new immutable set with the values from the given set.
  261. @param allocator The CFAllocator which should be used to allocate
  262. memory for the set and its storage for values. This
  263. parameter may be NULL in which case the current default
  264. CFAllocator is used. If this reference is not a valid
  265. CFAllocator, the behavior is undefined.
  266. @param theSet The set which is to be copied. The values from the
  267. set are copied as pointers into the new set (that is,
  268. the values themselves are copied, not that which the values
  269. point to, if anything). However, the values are also
  270. retained by the new set. The count of the new set will
  271. be the same as the copied set. The new set uses the same
  272. callbacks as the set to be copied. If this parameter is
  273. not a valid CFSet, the behavior is undefined.
  274. @result A reference to the new immutable CFSet.
  275. }
  276. function CFSetCreateCopy( allocator: CFAllocatorRef; theSet: CFSetRef ): CFSetRef; external name '_CFSetCreateCopy';
  277. {!
  278. @function CFSetCreateMutable
  279. Creates a new empty mutable set.
  280. @param allocator The CFAllocator which should be used to allocate
  281. memory for the set and its storage for values. This
  282. parameter may be NULL in which case the current default
  283. CFAllocator is used. If this reference is not a valid
  284. CFAllocator, the behavior is undefined.
  285. @param capacity The maximum number of values that can be contained
  286. by the CFSet. The set starts empty, and can grow to this
  287. number of values (and it can have less). If this parameter
  288. is 0, the set's maximum capacity is unlimited (or rather,
  289. only limited by address space and available memory
  290. constraints). If this parameter is negative, the behavior is
  291. undefined.
  292. @param callBacks A C pointer to a CFSetCallBacks structure
  293. initialized with the callbacks for the set to use on each
  294. value in the set. A copy of the contents of the
  295. callbacks structure is made, so that a pointer to a
  296. structure on the stack can be passed in, or can be reused
  297. for multiple set creations. If the version field of this
  298. callbacks structure is not one of the defined ones for
  299. CFSet, the behavior is undefined. The retain field may be
  300. NULL, in which case the CFSet will do nothing to add a
  301. retain to the contained values for the set. The release
  302. field may be NULL, in which case the CFSet will do nothing
  303. to remove the set's retain (if any) on the values when the
  304. set is destroyed. If the copyDescription field is NULL,
  305. the set will create a simple description for the value. If
  306. the equal field is NULL, the set will use pointer equality
  307. to test for equality of values. The hash field may be NULL,
  308. in which case the CFSet will determine uniqueness by pointer
  309. equality. This callbacks parameter
  310. itself may be NULL, which is treated as if a valid structure
  311. of version 0 with all fields NULL had been passed in.
  312. Otherwise, if any of the fields are not valid pointers to
  313. functions of the correct type, or this parameter is not a
  314. valid pointer to a CFSetCallBacks callbacks structure,
  315. the behavior is undefined. If any of the values put into the
  316. set is not one understood by one of the callback functions
  317. the behavior when that callback function is used is
  318. undefined.
  319. @result A reference to the new mutable CFSet.
  320. }
  321. function CFSetCreateMutable( allocator: CFAllocatorRef; capacity: CFIndex; {const} callBacks: CFSetCallBacksPtr { can be NULL } ): CFMutableSetRef; external name '_CFSetCreateMutable';
  322. {!
  323. @function CFSetCreateMutableCopy
  324. Creates a new immutable set with the values from the given set.
  325. @param allocator The CFAllocator which should be used to allocate
  326. memory for the set and its storage for values. This
  327. parameter may be NULL in which case the current default
  328. CFAllocator is used. If this reference is not a valid
  329. CFAllocator, the behavior is undefined.
  330. @param capacity The maximum number of values that can be contained
  331. by the CFSet. The set starts with the same values as the
  332. set to be copied, and can grow to this number of values.
  333. If this parameter is 0, the set's maximum capacity is
  334. unlimited (or rather, only limited by address space and
  335. available memory constraints). This parameter must be
  336. greater than or equal to the count of the set which is to
  337. be copied, or the behavior is undefined.
  338. @param theSet The set which is to be copied. The values from the
  339. set are copied as pointers into the new set (that is,
  340. the values themselves are copied, not that which the values
  341. point to, if anything). However, the values are also
  342. retained by the new set. The count of the new set will
  343. be the same as the copied set. The new set uses the same
  344. callbacks as the set to be copied. If this parameter is
  345. not a valid CFSet, the behavior is undefined.
  346. @result A reference to the new mutable CFSet.
  347. }
  348. function CFSetCreateMutableCopy( allocator: CFAllocatorRef; capacity: CFIndex; theSet: CFSetRef ): CFMutableSetRef; external name '_CFSetCreateMutableCopy';
  349. {!
  350. @function CFSetGetCount
  351. Returns the number of values currently in the set.
  352. @param theSet The set to be queried. If this parameter is not a valid
  353. CFSet, the behavior is undefined.
  354. @result The number of values in the set.
  355. }
  356. function CFSetGetCount( theSet: CFSetRef ): CFIndex; external name '_CFSetGetCount';
  357. {!
  358. @function CFSetGetCountOfValue
  359. Counts the number of times the given value occurs in the set. Since
  360. sets by definition contain only one instance of a value, this function
  361. is synomous to SFSetContainsValue.
  362. @param theSet The set to be searched. If this parameter is not a
  363. valid CFSet, the behavior is undefined.
  364. @param value The value for which to find matches in the set. The
  365. equal() callback provided when the set was created is
  366. used to compare. If the equal() callback was NULL, pointer
  367. equality (in C, ==) is used. If value, or any of the values
  368. in the set, are not understood by the equal() callback,
  369. the behavior is undefined.
  370. @result The number of times the given value occurs in the set.
  371. }
  372. function CFSetGetCountOfValue( theSet: CFSetRef; value: {const} UnivPtr ): CFIndex; external name '_CFSetGetCountOfValue';
  373. {!
  374. @function CFSetContainsValue
  375. Reports whether or not the value is in the set.
  376. @param theSet The set to be searched. If this parameter is not a
  377. valid CFSet, the behavior is undefined.
  378. @param value The value for which to find matches in the set. The
  379. equal() callback provided when the set was created is
  380. used to compare. If the equal() callback was NULL, pointer
  381. equality (in C, ==) is used. If value, or any of the values
  382. in the set, are not understood by the equal() callback,
  383. the behavior is undefined.
  384. @result true, if the value is in the set, otherwise false.
  385. }
  386. function CFSetContainsValue( theSet: CFSetRef; value: {const} UnivPtr ): Boolean; external name '_CFSetContainsValue';
  387. {!
  388. @function CFSetGetValue
  389. Retrieves a value in the set which hashes the same as the specified value.
  390. @param theSet The set to be queried. If this parameter is not a
  391. valid CFSet, the behavior is undefined.
  392. @param value The value to retrieve. The equal() callback provided when
  393. the set was created is used to compare. If the equal() callback
  394. was NULL, pointer equality (in C, ==) is used. If a value, or
  395. any of the values in the set, are not understood by the equal()
  396. callback, the behavior is undefined.
  397. @result The value in the set with the given hash.
  398. }
  399. function CFSetGetValue( theSet: CFSetRef; value: {const} UnivPtr ): UnivPtr; external name '_CFSetGetValue';
  400. {!
  401. @function CFSetGetValue
  402. Retrieves a value in the set which hashes the same as the specified value,
  403. if present.
  404. @param theSet The set to be queried. If this parameter is not a
  405. valid CFSet, the behavior is undefined.
  406. @param candidate This value is hashed and compared with values in the
  407. set to determine which value to retrieve. The equal() callback provided when
  408. the set was created is used to compare. If the equal() callback
  409. was NULL, pointer equality (in C, ==) is used. If a value, or
  410. any of the values in the set, are not understood by the equal()
  411. callback, the behavior is undefined.
  412. @param value A pointer to memory which should be filled with the
  413. pointer-sized value if a matching value is found. If no
  414. match is found, the contents of the storage pointed to by
  415. this parameter are undefined. This parameter may be NULL,
  416. in which case the value from the dictionary is not returned
  417. (but the return value of this function still indicates
  418. whether or not the value was present).
  419. @result True if the value was present in the set, otherwise false.
  420. }
  421. function CFSetGetValueIfPresent( theSet: CFSetRef; candidate: {const} UnivPtr; {const} value: UnivPtrPtr ): Boolean; external name '_CFSetGetValueIfPresent';
  422. {!
  423. @function CFSetGetValues
  424. Fills the buffer with values from the set.
  425. @param theSet The set to be queried. If this parameter is not a
  426. valid CFSet, the behavior is undefined.
  427. @param values A C array of pointer-sized values to be filled with
  428. values from the set. The values in the C array are ordered
  429. in the same order in which they appear in the set. If this
  430. parameter is not a valid pointer to a C array of at least
  431. CFSetGetCount() pointers, the behavior is undefined.
  432. }
  433. procedure CFSetGetValues( theSet: CFSetRef; {const} values: UnivPtrPtr ); external name '_CFSetGetValues';
  434. {!
  435. @function CFSetApplyFunction
  436. Calls a function once for each value in the set.
  437. @param theSet The set to be operated upon. If this parameter is not
  438. a valid CFSet, the behavior is undefined.
  439. @param applier The callback function to call once for each value in
  440. the given set. If this parameter is not a
  441. pointer to a function of the correct prototype, the behavior
  442. is undefined. If there are values in the set which the
  443. applier function does not expect or cannot properly apply
  444. to, the behavior is undefined.
  445. @param context A pointer-sized user-defined value, which is passed
  446. as the second parameter to the applier function, but is
  447. otherwise unused by this function. If the context is not
  448. what is expected by the applier function, the behavior is
  449. undefined.
  450. }
  451. procedure CFSetApplyFunction( theSet: CFSetRef; applier: CFSetApplierFunction; context: UnivPtr ); external name '_CFSetApplyFunction';
  452. {!
  453. @function CFSetAddValue
  454. Adds the value to the set if it is not already present.
  455. @param theSet The set to which the value is to be added. If this
  456. parameter is not a valid mutable CFSet, the behavior is
  457. undefined. If the set is a fixed-capacity set and it
  458. is full before this operation, the behavior is undefined.
  459. @param value The value to add to the set. The value is retained by
  460. the set using the retain callback provided when the set
  461. was created. If the value is not of the sort expected by the
  462. retain callback, the behavior is undefined. The count of the
  463. set is increased by one.
  464. }
  465. procedure CFSetAddValue( theSet: CFMutableSetRef; value: {const} UnivPtr ); external name '_CFSetAddValue';
  466. {!
  467. @function CFSetReplaceValue
  468. Replaces the value in the set if it is present.
  469. @param theSet The set to which the value is to be replaced. If this
  470. parameter is not a valid mutable CFSet, the behavior is
  471. undefined.
  472. @param value The value to replace in the set. The equal() callback provided when
  473. the set was created is used to compare. If the equal() callback
  474. was NULL, pointer equality (in C, ==) is used. If a value, or
  475. any of the values in the set, are not understood by the equal()
  476. callback, the behavior is undefined. The value is retained by
  477. the set using the retain callback provided when the set
  478. was created. If the value is not of the sort expected by the
  479. retain callback, the behavior is undefined. The count of the
  480. set is increased by one.
  481. }
  482. procedure CFSetReplaceValue( theSet: CFMutableSetRef; value: {const} UnivPtr ); external name '_CFSetReplaceValue';
  483. {!
  484. @function CFSetSetValue
  485. Replaces the value in the set if it is present, or adds the value to
  486. the set if it is absent.
  487. @param theSet The set to which the value is to be replaced. If this
  488. parameter is not a valid mutable CFSet, the behavior is
  489. undefined.
  490. @param value The value to set in the CFSet. The equal() callback provided when
  491. the set was created is used to compare. If the equal() callback
  492. was NULL, pointer equality (in C, ==) is used. If a value, or
  493. any of the values in the set, are not understood by the equal()
  494. callback, the behavior is undefined. The value is retained by
  495. the set using the retain callback provided when the set
  496. was created. If the value is not of the sort expected by the
  497. retain callback, the behavior is undefined. The count of the
  498. set is increased by one.
  499. }
  500. procedure CFSetSetValue( theSet: CFMutableSetRef; value: {const} UnivPtr ); external name '_CFSetSetValue';
  501. {!
  502. @function CFSetRemoveValue
  503. Removes the specified value from the set.
  504. @param theSet The set from which the value is to be removed.
  505. If this parameter is not a valid mutable CFSet,
  506. the behavior is undefined.
  507. @param value The value to remove. The equal() callback provided when
  508. the set was created is used to compare. If the equal() callback
  509. was NULL, pointer equality (in C, ==) is used. If a value, or
  510. any of the values in the set, are not understood by the equal()
  511. callback, the behavior is undefined.
  512. }
  513. procedure CFSetRemoveValue( theSet: CFMutableSetRef; value: {const} UnivPtr ); external name '_CFSetRemoveValue';
  514. {!
  515. @function CFSetRemoveAllValues
  516. Removes all the values from the set, making it empty.
  517. @param theSet The set from which all of the values are to be
  518. removed. If this parameter is not a valid mutable CFSet,
  519. the behavior is undefined.
  520. }
  521. procedure CFSetRemoveAllValues( theSet: CFMutableSetRef ); external name '_CFSetRemoveAllValues';
  522. end.