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