]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/custom.c
2 * "$Id: custom.c 177 2006-06-21 00:20:03Z jlovell $"
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.
37 * ppdFindCustomOption() - Find a custom option.
38 * ppdFindCustomParam() - Find a parameter for a custom option.
39 * ppdFirstCustomParam() - Return the first parameter for a custom option.
40 * ppdNextCustomParam() - Return the next parameter for a custom option.
44 * Include necessary headers.
52 * 'ppdFindCustomOption()' - Find a custom option.
57 ppd_coption_t
* /* O - Custom option or NULL */
58 ppdFindCustomOption(ppd_file_t
*ppd
, /* I - PPD file */
59 const char *keyword
)/* I - Custom option name */
61 ppd_coption_t key
; /* Custom option search key */
67 strlcpy(key
.keyword
, keyword
, sizeof(key
.keyword
));
68 return ((ppd_coption_t
*)cupsArrayFind(ppd
->coptions
, &key
));
73 * 'ppdFindCustomParam()' - Find a parameter for a custom option.
78 ppd_cparam_t
* /* O - Custom parameter or NULL */
79 ppdFindCustomParam(ppd_coption_t
*opt
, /* I - Custom option */
80 const char *name
) /* I - Parameter name */
82 ppd_cparam_t key
; /* Custom parameter search key */
88 strlcpy(key
.name
, name
, sizeof(key
.name
));
89 return ((ppd_cparam_t
*)cupsArrayFind(opt
->params
, &key
));
94 * 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
99 ppd_cparam_t
* /* O - Custom parameter or NULL */
100 ppdFirstCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
105 return ((ppd_cparam_t
*)cupsArrayFirst(opt
->params
));
110 * 'ppdNextCustomParam()' - Return the next parameter for a custom option.
115 ppd_cparam_t
* /* O - Custom parameter or NULL */
116 ppdNextCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
121 return ((ppd_cparam_t
*)cupsArrayNext(opt
->params
));
126 * End of "$Id: custom.c 177 2006-06-21 00:20:03Z jlovell $".