CFArrayCreateMutable |
||||
Header: | CFArray.h | Carbon status: | Supported | |
Creates a new empty mutable array.
CFMutableArrayRef CFArrayCreateMutable ( CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks );
The CFAllocator which should be used to allocate memory for the array and its storage for values. This parameter may be NULL in which case the current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined.
The maximum number of values that can be contained by the CFArray. The array starts empty, and can grow to this number of values (and it can have less). If this parameter is 0, the array's maximum capacity is unlimited (or rather, only limited by address space and available memory constraints). If this parameter is negative, the behavior is undefined.
A pointer to a CFArrayCallBacks structure initialized with the callbacks for the array to use on each value in the array. A copy of the contents of the callbacks structure is made, so that a pointer to a structure on the stack can be passed in, or can be reused for multiple array creations. If the version field of this callbacks structure is not one of the defined ones for CFArray, the behavior is undefined. The retain field may be NULL, in which case the CFArray will do nothing to add a retain to the contained values for the array. The release field may be NULL, in which case the CFArray will do nothing to remove the arrays retain (if any) on the values when the array is destroyed. If the copyDescription field is NULL, the array will create a simple description for the value. If the equal field is NULL, the array will use pointer equality to test for equality of values. This callbacks parameter itself may be NULL, which is treated as if a valid structure of version 0 with all fields NULL had been passed in. Otherwise, if any of the fields are not valid pointers to functions of the correct type, or this parameter is not a valid pointer to a CFArrayCallBacks callbacks structure, the behavior is undefined. If any of the values put into the array is not one understood by one of the callback functions the behavior when that callback function is used is undefined.
A reference to the new mutable CFArray.
Supported in Carbon. Available in Carbon 1.0.2 and later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)