Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 3 - ColorSync Manager Reference for Applications and Device Drivers / ColorSync Manager Functions
Application-Defined Functions for the ColorSync Manager /


MyCMProfileAccessProc

Application-defined function that provides procedure-based access to a profile.

When your application calls the CMOpenProfile, CMNewProfile, CMCopyProfile, or CMNewLinkProfile functions, it may supply the ColorSync Manager with a profile location structure (page 3-40) that specifies a procedure that provides access to a profile. In the structure, you provide a universal procedure pointer to a profile access procedure supplied by you and, optionally, a pointer to data your procedure can use. The ColorSync Manager calls your procedure when the profile is created, initialized, opened, read, updated, or closed.

The profile access procedure supplied by your application must conform to the following declaration, although the procedure name is arbitrary.

pascal OSErr MyCMProfileAccessProc (
long command,
long offset,
long *size,
void *data,
void *refConPtr);
command
A command value indicating the operation to perform. Operation constants are described in "Profile Access Procedure Operation Codes" (page 3-12).
offset
For read and write operations, the offset from the beginning of the profile at which to read or write data.
size
A pointer to a size value. On input, for the cmReadAccess and cmWriteAccess command constants, a pointer to a value indicating the number of bytes to read or write; for the cmOpenWriteAccess command, the total size of the profile. On output, after reading or writing, the actual number of bytes read or written.
data
A pointer to a buffer containing data to read or write. On output, for a read operation, contains the data that was read.
refConPtr
A reference constant pointer that can store private data for the MyCMProfileAccessProc procedure.
function result
A result code of type OSErr. If an error occurs during processing, your routine returns the appropriate error value. If no error occurs, it returns noErr.
DISCUSSION
When the ColorSync Manager calls your profile access procedure, it passes a constant indicating the operation to perform. The operations include creating a new profile, reading from the profile, writing the profile, and so on. Operation constants are described in "Profile Access Procedure Operation Codes" (page 3-12). Your procedure must be able to respond to each of these constants.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996