< Previous PageNext Page > Hide TOC

Other Types

Core Foundation defines a number of data types for general use in functions. The purpose of some of these types is to abstract primitive values that might have to change as the processor address space changes. The CFIndex type, for example, is used in index, count, length, and size parameters. The CFOptionFlags type is used for bitfield parameters and the CFHashCode type holds hashing results returned from the CFHash function and certain hashing callbacks.

Other base types are used in functions that take and return comparison and range values. CFRange is a structure that specifies any part of a linear sequence of items, from characters in a string to elements in a collection. For comparison functions, the CFComparisonResult type defines enum constants to represent appropriate return values (equal, less than, greater than). Some Core Foundation functions take callbacks to comparator functions; if you want a custom comparator, the function must conform to the signature specified by the CFComparatorFunction type.

Important: The integer value certain Core Foundation types, particularly CFIndex and CFTypeID, can grow over time as the processor’s address size grows. By using the base types for variables that interact with Core Foundation arguments of the same type, you will ensure a higher degree of source compatibility for your code.

Other opaque types provided by Core Foundation are discussed in separate topics.



< Previous PageNext Page > Hide TOC


© 2003, 2005 Apple Computer, Inc. All Rights Reserved. (Last updated: 2005-08-11)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.