]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/ppd-custom.c
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 * Licensed under Apache License v2.0. See the file "LICENSE" for more
10 * PostScript is a trademark of Adobe Systems, Inc.
14 * Include necessary headers.
17 #include "cups-private.h"
18 #include "ppd-private.h"
19 #include "debug-internal.h"
23 * 'ppdFindCustomOption()' - Find a custom option.
25 * @since CUPS 1.2/macOS 10.5@
28 ppd_coption_t
* /* O - Custom option or NULL */
29 ppdFindCustomOption(ppd_file_t
*ppd
, /* I - PPD file */
30 const char *keyword
)/* I - Custom option name */
32 ppd_coption_t key
; /* Custom option search key */
38 strlcpy(key
.keyword
, keyword
, sizeof(key
.keyword
));
39 return ((ppd_coption_t
*)cupsArrayFind(ppd
->coptions
, &key
));
44 * 'ppdFindCustomParam()' - Find a parameter for a custom option.
46 * @since CUPS 1.2/macOS 10.5@
49 ppd_cparam_t
* /* O - Custom parameter or NULL */
50 ppdFindCustomParam(ppd_coption_t
*opt
, /* I - Custom option */
51 const char *name
) /* I - Parameter name */
53 ppd_cparam_t
*param
; /* Current custom parameter */
59 for (param
= (ppd_cparam_t
*)cupsArrayFirst(opt
->params
);
61 param
= (ppd_cparam_t
*)cupsArrayNext(opt
->params
))
62 if (!_cups_strcasecmp(param
->name
, name
))
70 * 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
72 * @since CUPS 1.2/macOS 10.5@
75 ppd_cparam_t
* /* O - Custom parameter or NULL */
76 ppdFirstCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
81 return ((ppd_cparam_t
*)cupsArrayFirst(opt
->params
));
86 * 'ppdNextCustomParam()' - Return the next parameter for a custom option.
88 * @since CUPS 1.2/macOS 10.5@
91 ppd_cparam_t
* /* O - Custom parameter or NULL */
92 ppdNextCustomParam(ppd_coption_t
*opt
) /* I - Custom option */
97 return ((ppd_cparam_t
*)cupsArrayNext(opt
->params
));