MyCMProfileFilterProc
Application-defined function that examines the profile whose reference you specify and determines whether to include it in the profile search result list.After a profile has been included in the profile search result based on criteria specified in the search record, your
MyCMProfileFilterProc
function can further examine the profile. For example, you may wish to include or exclude the profile based on criteria such as an element or elements not included in theCMSearchRecord
search record. YourMyCMProfileFilterProc
function can also perform searching usingAND
orOR
logic.This application-supplied function must conform to the following declaration, although the function name is arbitrary:
pascal Boolean MyCMProfileFilterProc ( CMProfileRef prof, void *refCon);
prof
- A profile reference (page 3-63) to the profile to test.
refCon
- A reference constant that holds data passed through from the
CMNewProfileSearch
function or theCMUpdateProfileSearch
function.- function result
- A result code of type Boolean. A return value of
false
indicates that the profile should be included. A return value oftrue
indicates that the profile should be filtered out.DISCUSSION
Your MyCMProfileFilterProc function is called after theCMNewProfileSearch
function searches for profiles based on the search record's contents as specified by the search bitmask.When your application calls
CMNewProfileSearch
, it passes a reference to a search specification record of typeCMSearchRecord
(page 3-51) that contains afilter
field. If thefilter
field contains a pointer to yourMyCMProfileFilterProc
function, then your function is called to determine whether to exclude a profile from the search result list. Your function should returntrue
for a given profile to exclude that profile from the search result list. If you do not want to filter profiles beyond the criteria in the search record, specify aNULL
value for the search record'sfilter
field.