]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/custom.c
1d44826654ad5dbad668bac4b4d6b40eb9ddb461
2 * "$Id: custom.c 4938 2006-01-17 15:11:15Z mike $"
4 * PPD custom option routines for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * PostScript is a trademark of Adobe Systems, Inc.
26 * This code and any derivative of it may be used and distributed
27 * freely under the terms of the GNU General Public License when
28 * used with GNU Ghostscript or its derivatives. Use of the code
29 * (or any derivative of it) with software other than GNU
30 * GhostScript (or its derivatives) is governed by the CUPS license
33 * This file is subject to the Apple OS-Developed Software exception.
40 * Include necessary headers.
48 * 'ppdFindCustomOption()' - Find a custom option.
51 ppd_coption_t
* /* O - Custom option or NULL */
52 ppdFindCustomOption(ppd_file_t
*ppd
, /* I - PPD file */
53 const char *keyword
)/* I - Custom option name */
55 ppd_coption_t key
; /* Custom option search key */
61 strlcpy(key
.keyword
, keyword
, sizeof(key
.keyword
));
62 return ((ppd_coption_t
*)cupsArrayFind(ppd
->coptions
, &key
));
67 * 'ppdFindCustomParam()' - Find a parameter for a custom option.
70 ppd_cparam_t
* /* O - Custom parameter or NULL */
71 ppdFindCustomParam(ppd_coption_t
*opt
, /* I - Custom option */
72 const char *name
) /* I - Parameter name */
74 ppd_cparam_t key
; /* Custom parameter search key */
80 strlcpy(key
.name
, name
, sizeof(key
.name
));
81 return ((ppd_cparam_t
*)cupsArrayFind(opt
->params
, &key
));
86 * 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
89 ppd_cparam_t
* /* O - Custom parameter or NULL */
90 ppdFirstCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
95 return ((ppd_cparam_t
*)cupsArrayFirst(opt
->params
));
100 * 'ppdNextCustomParam()' - Return the next parameter for a custom option.
103 ppd_cparam_t
* /* O - Custom parameter or NULL */
104 ppdNextCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
109 return ((ppd_cparam_t
*)cupsArrayNext(opt
->params
));
114 * End of "$Id: custom.c 4938 2006-01-17 15:11:15Z mike $".