]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/custom.c
2 * "$Id: custom.c 6649 2007-07-11 21:46:42Z mike $"
4 * PPD custom option routines for the Common UNIX Printing System (CUPS).
6 * Copyright 2007 by Apple Inc.
7 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
15 * PostScript is a trademark of Adobe Systems, Inc.
17 * This code and any derivative of it may be used and distributed
18 * freely under the terms of the GNU General Public License when
19 * used with GNU Ghostscript or its derivatives. Use of the code
20 * (or any derivative of it) with software other than GNU
21 * GhostScript (or its derivatives) is governed by the CUPS license
24 * This file is subject to the Apple OS-Developed Software exception.
28 * ppdFindCustomOption() - Find a custom option.
29 * ppdFindCustomParam() - Find a parameter for a custom option.
30 * ppdFirstCustomParam() - Return the first parameter for a custom option.
31 * ppdNextCustomParam() - Return the next parameter for a custom option.
35 * Include necessary headers.
43 * 'ppdFindCustomOption()' - Find a custom option.
48 ppd_coption_t
* /* O - Custom option or NULL */
49 ppdFindCustomOption(ppd_file_t
*ppd
, /* I - PPD file */
50 const char *keyword
)/* I - Custom option name */
52 ppd_coption_t key
; /* Custom option search key */
58 strlcpy(key
.keyword
, keyword
, sizeof(key
.keyword
));
59 return ((ppd_coption_t
*)cupsArrayFind(ppd
->coptions
, &key
));
64 * 'ppdFindCustomParam()' - Find a parameter for a custom option.
69 ppd_cparam_t
* /* O - Custom parameter or NULL */
70 ppdFindCustomParam(ppd_coption_t
*opt
, /* I - Custom option */
71 const char *name
) /* I - Parameter name */
73 ppd_cparam_t key
; /* Custom parameter search key */
79 strlcpy(key
.name
, name
, sizeof(key
.name
));
80 return ((ppd_cparam_t
*)cupsArrayFind(opt
->params
, &key
));
85 * 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
90 ppd_cparam_t
* /* O - Custom parameter or NULL */
91 ppdFirstCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
96 return ((ppd_cparam_t
*)cupsArrayFirst(opt
->params
));
101 * 'ppdNextCustomParam()' - Return the next parameter for a custom option.
106 ppd_cparam_t
* /* O - Custom parameter or NULL */
107 ppdNextCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
112 return ((ppd_cparam_t
*)cupsArrayNext(opt
->params
));
117 * End of "$Id: custom.c 6649 2007-07-11 21:46:42Z mike $".