1
/* $Xorg: PrOfId.c,v 1.3 2000/08/17 19:44:48 cpqbld Exp $ */
4
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
7
* This file is a component of an X Window System-specific implementation
8
* of Xcms based on the TekColor Color Management System. Permission is
9
* hereby granted to use, copy, modify, sell, and otherwise distribute this
10
* software and its documentation for any purpose and without fee, provided
11
* that this copyright, permission, and disclaimer notice is reproduced in
12
* all copies of this software and in supporting documentation. TekColor
13
* is a trademark of Tektronix, Inc.
15
* Tektronix makes no representation about the suitability of this software
16
* for any purpose. It is provided "as is" and with all faults.
18
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
19
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
21
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
22
* RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
23
* CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
24
* CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
31
* Source for XcmsPrefixOfFormat()
42
extern XcmsColorSpace **_XcmsDIColorSpaces;
43
extern XcmsColorSpace **_XcmsDDColorSpaces;
53
XcmsPrefixOfFormat(id)
57
* Returns the color space prefix for the specified color
58
* space ID if the color space is found in the Color
62
* Returns a color space prefix.
65
* Space is allocated for the returned string, therefore,
66
* the application is responsible for freeing (using XFree)
71
XcmsColorSpace **papColorSpaces;
75
* First try Device-Independent color spaces
77
papColorSpaces = _XcmsDIColorSpaces;
78
if (papColorSpaces != NULL) {
79
while (*papColorSpaces != NULL) {
80
if ((*papColorSpaces)->id == id) {
81
prefix = (char *)Xmalloc((strlen((*papColorSpaces)->prefix) +
83
strcpy(prefix, (*papColorSpaces)->prefix);
91
* Next try Device-Dependent color spaces
93
papColorSpaces = _XcmsDDColorSpaces;
94
if (papColorSpaces != NULL) {
95
while (*papColorSpaces != NULL) {
96
if ((*papColorSpaces)->id == id) {
97
prefix = (char *)Xmalloc((strlen((*papColorSpaces)->prefix) +
99
strcpy(prefix, (*papColorSpaces)->prefix);