1 /*
2 * cupsRasterInterpretPPD stub for CUPS.
3 *
4 * Copyright © 2020-2024 by OpenPrinting.
5 * Copyright © 2018 by Apple Inc.
6 *
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more
8 * information.
9 */
10
11 /*
12 * Include necessary headers...
13 */
14
15 #include <cups/ppd-private.h>
16
17
18 /*
19 * This stub wraps the _cupsRasterInterpretPPD function in libcups - this allows
20 * one library to provide all of the CUPS API functions while still supporting
21 * the old split library organization...
22 */
23
24
25 /*
26 * 'cupsRasterInterpretPPD()' - Interpret PPD commands to create a page header.
27 *
28 * This function is used by raster image processing (RIP) filters like
29 * cgpdftoraster and imagetoraster when writing CUPS raster data for a page.
30 * It is not used by raster printer driver filters which only read CUPS
31 * raster data.
32 *
33 *
34 * @code cupsRasterInterpretPPD@ does not mark the options in the PPD using
35 * the "num_options" and "options" arguments. Instead, mark the options with
36 * @code cupsMarkOptions@ and @code ppdMarkOption@ prior to calling it -
37 * this allows for per-page options without manipulating the options array.
38 *
39 * The "func" argument specifies an optional callback function that is
40 * called prior to the computation of the final raster data. The function
41 * can make changes to the @link cups_page_header2_t@ data as needed to use a
42 * supported raster format and then returns 0 on success and -1 if the
43 * requested attributes cannot be supported.
44 *
45 *
46 * @code cupsRasterInterpretPPD@ supports a subset of the PostScript language.
47 * Currently only the @code [@, @code ]@, @code <<@, @code >>@, @code {@,
48 * @code }@, @code cleartomark@, @code copy@, @code dup@, @code index@,
49 * @code pop@, @code roll@, @code setpagedevice@, and @code stopped@ operators
50 * are supported.
51 *
52 * @since CUPS 1.2/macOS 10.5@
53 */
54
55 int /* O - 0 on success, -1 on failure */
cupsRasterInterpretPPD(cups_page_header2_t * h,ppd_file_t * ppd,int num_options,cups_option_t * options,cups_interpret_cb_t func)56 cupsRasterInterpretPPD(
57 cups_page_header2_t *h, /* O - Page header to create */
58 ppd_file_t *ppd, /* I - PPD file */
59 int num_options, /* I - Number of options */
60 cups_option_t *options, /* I - Options */
61 cups_interpret_cb_t func) /* I - Optional page header callback (@code NULL@ for none) */
62 {
63 return (_cupsRasterInterpretPPD(h, ppd, num_options, options, func));
64 }
65