KCMS Application Developer's Guide


typedef struct KcsProfileDesc_s {
 	KcsProfileType					type;
 	union {
 		struct file_f {
 			long			offset;			/* Offset into the file */
 			KcsFileId			openFileId;	/* File descriptor */
 		} file;
 		struct memPtr_f {
 			void			*memPtr;			/* Pointer to start of memory */
 			long			offset;			/* Offset to the profile */
 			long			size;			/* Size of the profile */
 		} memPtr;
 		struct solarisFile_f {
 			char			*fileName;			/* Name of the file */
 			char			*hostName;			/* Host name */
 			int			oflag;			/* How to open it, see open(2) */
 			mode_t			mode;			/* This is a u_long, see open(2) */
 		} solarisFile;
 		struct xWindow_f {
 			Display			*dpy;			/* Display pointer */
 			int			screen;			/* Screen number */
 			Visual			*visual;			/* Pointer to windows visual */
 			long			reserved;			/* Reserved for KCMS internal use */
 		} xwin;
 		long pad[4];	/* Maximum size of union */
 	} desc;
 } KcsProfileDesc;

KcsProfileDesc is a data structure that describes a profile and the kind of mechanism in which to load and save that profile. The mechanism is platform independent. A profile can reside in the file system, on a remote network device, in a piece of hardware or its device driver, in a contiguous piece of memory, and so on. KcsProfileDesc is a union to minimize space and to allow for future flexibility. Thus, the actual definition can be augmented to provide additional locations where a profile may reside in the system.

The types of profiles supported by each type are summarized below. See "KcsProfileType " for more information on these profiles.


The calling application opens the file and passes the KCMS framework a KcsFileId, openFileId, and an offset from the start of the file to the start of the profile data. This profile type is most likely used for profiles embedded in other files, such as TIFF.


The calling application has loaded the profile into program memory. The offset value determines where the profile data starts relative to memPtr. The size value is the profile's size in bytes.


The calling application supplies the name of a file, fileName, and its location, hostName. The KcsSolarisProfile loadable module searches for the name supplied in fileName. It searches the following directories in the order listed:

  1. The current directory

  2. Directories listed by the KCMS_PROFILES environment variable, which is a colon-separated list of directories

  3. /etc/openwin/devdata/profiles

  4. /usr/openwin/etc/devdata/profiles

If hostName is non-NULL, the KcsSolarisProfile loadable module first checks if the name supplied is the name of the current machine. If it is not the the current machine's name, the KcsSolarisProfile loadable module opens a connection to the RPC daemon, kcms_server(1)() and tries to locate the profile on a remote machine. The RPC daemon searches only in the last two directories for the profile (#3 and #4), and only reads remote profiles.

The application does not need to supply the full name of the file; the KcsSolarisProfile loadable module automatically adds the following suffixes.




Color space 


Input (scanner) 


Output (printer)