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
MyCMProfileFilterProcfunction 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 theCMSearchRecordsearch record. YourMyCMProfileFilterProcfunction can also perform searching usingANDorORlogic.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
CMNewProfileSearchfunction or theCMUpdateProfileSearchfunction.- function result
- A result code of type Boolean. A return value of
falseindicates that the profile should be included. A return value oftrueindicates that the profile should be filtered out.DISCUSSION
Your MyCMProfileFilterProc function is called after theCMNewProfileSearchfunction 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 afilterfield. If thefilterfield contains a pointer to yourMyCMProfileFilterProcfunction, then your function is called to determine whether to exclude a profile from the search result list. Your function should returntruefor 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 aNULLvalue for the search record'sfilterfield.