Searching for Profiles With ColorSync 2.5
Starting with version 2.5, ColorSync provides a profile cache, described in
The Profile Cache and Optimized Searching
, for keeping track of profile files. A flexible new routine,
CMIterateColorSyncFolder
, takes advantage of the profile cache to provide truly optimized searching and quick access to profile information. Your application can quickly examine all the profile files in the ColorSync Profiles folder to find those that match a desired criteria.
For additional information on profile searching, see
Searching for Profiles Prior to ColorSync 2.5
and
Searching for a Profile by Profile Identifier
.
CMIterateColorSyncFolder
New in ColorSync 2.5
Iterates over the available profiles.
pascal CMError CMIterateColorSyncFolder (
CMProfileIterateUPP proc,
unsigned long * seed,
unsigned long * count,
void * refCon);
-
proc
-
A universal procedure pointer of type
CMProfileIterateUPP
, which is described in
CMProfileIterateProcPtr
. If you do not wish to receive callbacks, pass
NULL
for this parameter. Otherwise, pass a pointer to your callback routine.
-
seed
-
A pointer to a value of type
long
. The first time you call
CMIterateColorSyncFolder
, you typically set the value to 0. In subsequent calls, you set the value to the seed value obtained from the previous call. ColorSync uses the value in determining whether to call your callback routine, as described in the discussion for this function. On return, the value is the current seed for the profile cache (unless you pass
NULL
, as described in the discussion).
-
count
-
A pointer to a value of type
long
. On return, the value is the number of available profiles.
CMIterateColorSyncFolder
provides the number of profiles even when no iteration occurs (unless you pass
NULL
, as described in the discussion below). To determine the count alone, without iteration, call
CMIterateColorSyncFolder
and pass a value of
NULL
for all parameters except
count
.
-
refCon
-
An untyped pointer to arbitrary data supplied by your application.
CMIterateColorSyncFolder
passes this data to your callback routine. If you pass
NULL
for the
refCon
parameter,
CMIterateColorSyncFolder
passes
NULL
to your callback routine.
-
function result
-
A result code of type
CMError
. If your callback function returns an error,
CMIterateColorSyncFolder
stops iterating and returns the error value to its caller (presumably your code). For possible values, see
Result Codes for the ColorSync Manager
.
DISCUSSION
Starting with ColorSync version 2.5, when your application needs information about the profiles currently available in the ColorSync Profiles folder, it can call the
CMIterateColorSyncFolder
routine, which in turn calls your callback routine once for each profile.
© 1988-1999 Apple Computer, Inc. (Last Updated 20 Jan 99)