]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/ppd-custom.c
6e4d3bd6e2ff6adc7cd84647016486132b591b61
2 * PPD custom option routines for CUPS.
4 * Copyright 2007-2015 by Apple Inc.
5 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
7 * These coded instructions, statements, and computer programs are the
8 * property of Apple Inc. and are protected by Federal copyright
9 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 * which should have been included with this file. If this file is
11 * file is missing or damaged, see the license at "http://www.cups.org/".
13 * PostScript is a trademark of Adobe Systems, Inc.
15 * This code and any derivative of it may be used and distributed
16 * freely under the terms of the GNU General Public License when
17 * used with GNU Ghostscript or its derivatives. Use of the code
18 * (or any derivative of it) with software other than GNU
19 * GhostScript (or its derivatives) is governed by the CUPS license
22 * This file is subject to the Apple OS-Developed Software exception.
26 * Include necessary headers.
29 #include "cups-private.h"
30 #include "ppd-private.h"
34 * 'ppdFindCustomOption()' - Find a custom option.
36 * @since CUPS 1.2/macOS 10.5@
39 ppd_coption_t
* /* O - Custom option or NULL */
40 ppdFindCustomOption(ppd_file_t
*ppd
, /* I - PPD file */
41 const char *keyword
)/* I - Custom option name */
43 ppd_coption_t key
; /* Custom option search key */
49 strlcpy(key
.keyword
, keyword
, sizeof(key
.keyword
));
50 return ((ppd_coption_t
*)cupsArrayFind(ppd
->coptions
, &key
));
55 * 'ppdFindCustomParam()' - Find a parameter for a custom option.
57 * @since CUPS 1.2/macOS 10.5@
60 ppd_cparam_t
* /* O - Custom parameter or NULL */
61 ppdFindCustomParam(ppd_coption_t
*opt
, /* I - Custom option */
62 const char *name
) /* I - Parameter name */
64 ppd_cparam_t
*param
; /* Current custom parameter */
70 for (param
= (ppd_cparam_t
*)cupsArrayFirst(opt
->params
);
72 param
= (ppd_cparam_t
*)cupsArrayNext(opt
->params
))
73 if (!_cups_strcasecmp(param
->name
, name
))
81 * 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
83 * @since CUPS 1.2/macOS 10.5@
86 ppd_cparam_t
* /* O - Custom parameter or NULL */
87 ppdFirstCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
92 return ((ppd_cparam_t
*)cupsArrayFirst(opt
->params
));
97 * 'ppdNextCustomParam()' - Return the next parameter for a custom option.
99 * @since CUPS 1.2/macOS 10.5@
102 ppd_cparam_t
* /* O - Custom parameter or NULL */
103 ppdNextCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
108 return ((ppd_cparam_t
*)cupsArrayNext(opt
->params
));