CFBagCreate

Header: CFBag.h Carbon status: Supported

Creates an immutable CFBag object containing specified values.

CFBagRef CFBagCreate (
    CFAllocatorRef allocator, 
    void **values, 
    CFIndex numValues, 
    const CFBagCallBacks *callBacks
);
Parameter descriptions
allocator

Pass a reference to an allocator object to be used to allocate memory for the CFBag object and its stored values. Pass NULL or kCFAllocatorDefault if the current default allocator should be used.

values

Pass a pointer to a C array containing the values to put into the created CFBag object. The items in the C arrray must be pointers or pointer-size values. The C array is not changed or freed by the function. If values is not a valid pointer to a C array of at least numValues elements, the behavior is undefined.

numValues

The number of values to copy from the values C array in the CFBag. If the number is negative or is greater than the actual number of values, the behavior is undefined.

callBacks

Pass a pointer to a CFBagCallBacks structure initialized with the callbacks to use to retain, release, describe, and compare values in the CFBag object. See CFBagCallBacks for information on the fields of this structure.

function result

A reference to an immutable CFBag object or NULL if there was a problem creating the object.

DISCUSSION

The CFBagCreate function creates an immutable CFBag object from a C array containing pointers to values (or values if they are pointer size or smaller). The numValues parameter specifies the count of the values in the bag. If this value is less than the actual number of values in the array, only that many values are copied. If this value is more than the actual number of values in the C array, the behavior is undefined.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)