diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-03-19 22:58:49 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-03-19 22:58:49 -0400 |
commit | 187b9322c81a1cebe586f15054cfc94481773b6e (patch) | |
tree | c552523c316cb1cc0caa8baed67b7c06d941e3fa /cups/ppd.h | |
parent | 5192eac3e64c95d2ae89bdfc110486317cc7855b (diff) | |
download | cups-187b9322c81a1cebe586f15054cfc94481773b6e.tar.gz |
Fully deprecate PPD API - no more _PPD_DEPRECATED cheat.
Diffstat (limited to 'cups/ppd.h')
-rw-r--r-- | cups/ppd.h | 159 |
1 files changed, 74 insertions, 85 deletions
diff --git a/cups/ppd.h b/cups/ppd.h index e5c04ed60..8b3ab24b7 100644 --- a/cups/ppd.h +++ b/cups/ppd.h @@ -1,12 +1,11 @@ /* * PostScript Printer Description definitions for CUPS. * - * THESE APIS ARE DEPRECATED. TO COMPILE WITHOUT WARNINGS ADD - * -D_PPD_DEPRECATED="" TO YOUR COMPILE OPTIONS. THIS HEADER AND THESE - * FUNCTIONS WILL BE REMOVED IN A FUTURE RELEASE OF CUPS. + * THESE APIS ARE DEPRECATED. THIS HEADER AND THESE FUNCTIONS WILL BE REMOVED + * IN A FUTURE RELEASE OF CUPS. * - * Copyright 2007-2015 by Apple Inc. - * Copyright 1997-2007 by Easy Software Products, all rights reserved. + * Copyright © 2007-2018 by Apple Inc. + * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -38,16 +37,6 @@ extern "C" { /* - * Define _PPD_DEPRECATED to silence the warnings about PPD functions being - * deprecated... - */ - -# ifndef _PPD_DEPRECATED -# define _PPD_DEPRECATED _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.") -# endif /* !_PPD_DEPRECATED */ - - -/* * PPD version... */ @@ -67,14 +56,14 @@ extern "C" { * Types and structures... */ -typedef enum ppd_ui_e /**** UI Types ****/ +typedef enum ppd_ui_e /**** UI Types @deprecated@ ****/ { PPD_UI_BOOLEAN, /* True or False option */ PPD_UI_PICKONE, /* Pick one from a list */ PPD_UI_PICKMANY /* Pick zero or more from a list */ } ppd_ui_t; -typedef enum ppd_section_e /**** Order dependency sections ****/ +typedef enum ppd_section_e /**** Order dependency sections @deprecated@ ****/ { PPD_ORDER_ANY, /* Option code can be anywhere in the file */ PPD_ORDER_DOCUMENT, /* ... must be in the DocumentSetup section */ @@ -84,7 +73,7 @@ typedef enum ppd_section_e /**** Order dependency sections ****/ PPD_ORDER_PROLOG /* ... must be in the Prolog section */ } ppd_section_t; -typedef enum ppd_cs_e /**** Colorspaces ****/ +typedef enum ppd_cs_e /**** Colorspaces @deprecated@ ****/ { PPD_CS_CMYK = -4, /* CMYK colorspace */ PPD_CS_CMY, /* CMY colorspace */ @@ -94,7 +83,7 @@ typedef enum ppd_cs_e /**** Colorspaces ****/ PPD_CS_N /* DeviceN colorspace */ } ppd_cs_t; -typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19/macOS 10.3@ ****/ +typedef enum ppd_status_e /**** Status Codes @deprecated@ ****/ { PPD_OK = 0, /* OK */ PPD_FILE_OPEN_ERROR, /* Unable to open PPD file */ @@ -123,16 +112,16 @@ typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19/macOS 10.3@ *** PPD_MAX_STATUS /* @private@ */ } ppd_status_t; -enum ppd_conform_e /**** Conformance Levels @since CUPS 1.1.19/macOS 10.3@ ****/ +enum ppd_conform_e /**** Conformance Levels @deprecated@ ****/ { PPD_CONFORM_RELAXED, /* Relax whitespace and control char */ PPD_CONFORM_STRICT /* Require strict conformance */ }; typedef enum ppd_conform_e ppd_conform_t; - /**** Conformance Levels @since CUPS 1.1.19/macOS 10.3@ ****/ + /**** Conformance Levels @deprecated@ ****/ -typedef struct ppd_attr_s /**** PPD Attribute Structure @since CUPS 1.1.19/macOS 10.3@ ****/ +typedef struct ppd_attr_s /**** PPD Attribute Structure @deprecated@ ****/ { char name[PPD_MAX_NAME]; /* Name of attribute (cupsXYZ) */ char spec[PPD_MAX_NAME]; /* Specifier string, if any */ @@ -141,9 +130,9 @@ typedef struct ppd_attr_s /**** PPD Attribute Structure @since CUPS 1.1.19/macO } ppd_attr_t; typedef struct ppd_option_s ppd_option_t; - /**** Options ****/ + /**** Options @deprecated@ ****/ -typedef struct ppd_choice_s /**** Option choices ****/ +typedef struct ppd_choice_s /**** Option choices @deprecated@ ****/ { char marked; /* 0 if not selected, 1 otherwise */ char choice[PPD_MAX_NAME]; /* Computer-readable option name */ @@ -152,7 +141,7 @@ typedef struct ppd_choice_s /**** Option choices ****/ ppd_option_t *option; /* Pointer to parent option structure */ } ppd_choice_t; -struct ppd_option_s /**** Options ****/ +struct ppd_option_s /**** Options @deprecated@ ****/ { char conflicted; /* 0 if no conflicts exist, 1 otherwise */ char keyword[PPD_MAX_NAME]; /* Option keyword name ("PageSize", etc.) */ @@ -165,7 +154,7 @@ struct ppd_option_s /**** Options ****/ ppd_choice_t *choices; /* Option choices */ }; -typedef struct ppd_group_s /**** Groups ****/ +typedef struct ppd_group_s /**** Groups @deprecated@ ****/ { /**** Group text strings are limited to 39 chars + nul in order to **** preserve binary compatibility and allow applications to get @@ -180,7 +169,7 @@ typedef struct ppd_group_s /**** Groups ****/ struct ppd_group_s *subgroups; /* Sub-groups (max depth = 1) */ } ppd_group_t; -typedef struct ppd_const_s /**** Constraints ****/ +typedef struct ppd_const_s /**** Constraints @deprecated@ ****/ { char option1[PPD_MAX_NAME]; /* First keyword */ char choice1[PPD_MAX_NAME]; /* First option/choice (blank for all) */ @@ -188,7 +177,7 @@ typedef struct ppd_const_s /**** Constraints ****/ char choice2[PPD_MAX_NAME]; /* Second option/choice (blank for all) */ } ppd_const_t; -typedef struct ppd_size_s /**** Page Sizes ****/ +typedef struct ppd_size_s /**** Page Sizes @deprecated@ ****/ { int marked; /* Page size selected? */ char name[PPD_MAX_NAME]; /* Media size option */ @@ -200,14 +189,14 @@ typedef struct ppd_size_s /**** Page Sizes ****/ float top; /* Top printable margin in points */ } ppd_size_t; -typedef struct ppd_emul_s /**** Emulators ****/ +typedef struct ppd_emul_s /**** Emulators @deprecated@ ****/ { char name[PPD_MAX_NAME]; /* Emulator name */ char *start; /* Code to switch to this emulation */ char *stop; /* Code to stop this emulation */ } ppd_emul_t; -typedef struct ppd_profile_s /**** sRGB Color Profiles ****/ +typedef struct ppd_profile_s /**** sRGB Color Profiles @deprecated@ ****/ { char resolution[PPD_MAX_NAME]; /* Resolution or "-" */ @@ -219,7 +208,7 @@ typedef struct ppd_profile_s /**** sRGB Color Profiles ****/ } ppd_profile_t; /**** New in CUPS 1.2/macOS 10.5 ****/ -typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2/macOS 10.5@ ****/ +typedef enum ppd_cptype_e /**** Custom Parameter Type @deprecated@ ****/ { PPD_CUSTOM_CURVE, /* Curve value for f(x) = x^value */ PPD_CUSTOM_INT, /* Integer number value */ @@ -231,7 +220,7 @@ typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2/macOS 10. PPD_CUSTOM_STRING /* String of characters */ } ppd_cptype_t; -typedef union ppd_cplimit_u /**** Custom Parameter Limit @since CUPS 1.2/macOS 10.5@ ****/ +typedef union ppd_cplimit_u /**** Custom Parameter Limit @deprecated@ ****/ { float custom_curve; /* Gamma value */ int custom_int; /* Integer value */ @@ -243,7 +232,7 @@ typedef union ppd_cplimit_u /**** Custom Parameter Limit @since CUPS 1.2/macOS int custom_string; /* String length */ } ppd_cplimit_t; -typedef union ppd_cpvalue_u /**** Custom Parameter Value @since CUPS 1.2/macOS 10.5@ ****/ +typedef union ppd_cpvalue_u /**** Custom Parameter Value @deprecated@ ****/ { float custom_curve; /* Gamma value */ int custom_int; /* Integer value */ @@ -255,7 +244,7 @@ typedef union ppd_cpvalue_u /**** Custom Parameter Value @since CUPS 1.2/macOS char *custom_string; /* String value */ } ppd_cpvalue_t; -typedef struct ppd_cparam_s /**** Custom Parameter @since CUPS 1.2/macOS 10.5@ ****/ +typedef struct ppd_cparam_s /**** Custom Parameter @deprecated@ ****/ { char name[PPD_MAX_NAME]; /* Parameter name */ char text[PPD_MAX_TEXT]; /* Human-readable text */ @@ -266,7 +255,7 @@ typedef struct ppd_cparam_s /**** Custom Parameter @since CUPS 1.2/macOS 10.5@ ppd_cpvalue_t current; /* Current value */ } ppd_cparam_t; -typedef struct ppd_coption_s /**** Custom Option @since CUPS 1.2/macOS 10.5@ ****/ +typedef struct ppd_coption_s /**** Custom Option @deprecated@ ****/ { char keyword[PPD_MAX_NAME]; /* Name of option that is being extended... */ ppd_option_t *option; /* Option that is being extended... */ @@ -275,9 +264,9 @@ typedef struct ppd_coption_s /**** Custom Option @since CUPS 1.2/macOS 10.5@ ** } ppd_coption_t; typedef struct _ppd_cache_s _ppd_cache_t; - /**** PPD cache and mapping data @since CUPS 1.5/macOS 10.7@ @private@ ****/ + /**** PPD cache and mapping data @deprecated@ ****/ -typedef struct ppd_file_s /**** PPD File ****/ +typedef struct ppd_file_s /**** PPD File @deprecated@ ****/ { int language_level; /* Language level of device */ int color_device; /* 1 = color device, 0 = grayscale */ @@ -349,115 +338,115 @@ typedef struct ppd_file_s /**** PPD File ****/ * Prototypes... */ -extern const char *cupsGetPPD(const char *name) _PPD_DEPRECATED; -extern const char *cupsGetPPD2(http_t *http, const char *name) _PPD_DEPRECATED; -extern http_status_t cupsGetPPD3(http_t *http, const char *name, time_t *modtime, char *buffer, size_t bufsize) _PPD_DEPRECATED; -extern char *cupsGetServerPPD(http_t *http, const char *name) _PPD_DEPRECATED; -extern int cupsMarkOptions(ppd_file_t *ppd, int num_options, cups_option_t *options) _PPD_DEPRECATED; +extern const char *cupsGetPPD(const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern const char *cupsGetPPD2(http_t *http, const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern http_status_t cupsGetPPD3(http_t *http, const char *name, time_t *modtime, char *buffer, size_t bufsize) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern char *cupsGetServerPPD(http_t *http, const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern int cupsMarkOptions(ppd_file_t *ppd, int num_options, cups_option_t *options) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); -extern void ppdClose(ppd_file_t *ppd) _PPD_DEPRECATED; +extern void ppdClose(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdCollect(ppd_file_t *ppd, ppd_section_t section, - ppd_choice_t ***choices) _PPD_DEPRECATED; -extern int ppdConflicts(ppd_file_t *ppd) _PPD_DEPRECATED; + ppd_choice_t ***choices) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern int ppdConflicts(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdEmit(ppd_file_t *ppd, FILE *fp, - ppd_section_t section) _PPD_DEPRECATED; + ppd_section_t section) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdEmitFd(ppd_file_t *ppd, int fd, - ppd_section_t section) _PPD_DEPRECATED; + ppd_section_t section) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdEmitJCL(ppd_file_t *ppd, FILE *fp, int job_id, const char *user, const char *title) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_choice_t *ppdFindChoice(ppd_option_t *o, const char *option) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd, const char *keyword) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_option_t *ppdFindOption(ppd_file_t *ppd, const char *keyword) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdIsMarked(ppd_file_t *ppd, const char *keyword, - const char *option) _PPD_DEPRECATED; -extern void ppdMarkDefaults(ppd_file_t *ppd) _PPD_DEPRECATED; + const char *option) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern void ppdMarkDefaults(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdMarkOption(ppd_file_t *ppd, const char *keyword, - const char *option) _PPD_DEPRECATED; -extern ppd_file_t *ppdOpen(FILE *fp) _PPD_DEPRECATED; -extern ppd_file_t *ppdOpenFd(int fd) _PPD_DEPRECATED; -extern ppd_file_t *ppdOpenFile(const char *filename) _PPD_DEPRECATED; + const char *option) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern ppd_file_t *ppdOpen(FILE *fp) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern ppd_file_t *ppdOpenFd(int fd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern ppd_file_t *ppdOpenFile(const char *filename) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern float ppdPageLength(ppd_file_t *ppd, const char *name) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_size_t *ppdPageSize(ppd_file_t *ppd, const char *name) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern float ppdPageWidth(ppd_file_t *ppd, const char *name) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); /**** New in CUPS 1.1.19 ****/ -extern const char *ppdErrorString(ppd_status_t status) _PPD_DEPRECATED; +extern const char *ppdErrorString(ppd_status_t status) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_attr_t *ppdFindAttr(ppd_file_t *ppd, const char *name, - const char *spec) _PPD_DEPRECATED; + const char *spec) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_attr_t *ppdFindNextAttr(ppd_file_t *ppd, const char *name, - const char *spec) _PPD_DEPRECATED; -extern ppd_status_t ppdLastError(int *line) _PPD_DEPRECATED; + const char *spec) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern ppd_status_t ppdLastError(int *line) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); /**** New in CUPS 1.1.20 ****/ -extern void ppdSetConformance(ppd_conform_t c) _PPD_DEPRECATED; +extern void ppdSetConformance(ppd_conform_t c) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); /**** New in CUPS 1.2 ****/ extern int cupsRasterInterpretPPD(cups_page_header2_t *h, ppd_file_t *ppd, int num_options, cups_option_t *options, - cups_interpret_cb_t func) _PPD_DEPRECATED; + cups_interpret_cb_t func) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdCollect2(ppd_file_t *ppd, ppd_section_t section, float min_order, ppd_choice_t ***choices) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdEmitAfterOrder(ppd_file_t *ppd, FILE *fp, ppd_section_t section, int limit, - float min_order) _PPD_DEPRECATED; + float min_order) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern char *ppdEmitString(ppd_file_t *ppd, ppd_section_t section, - float min_order) _PPD_DEPRECATED; + float min_order) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_coption_t *ppdFindCustomOption(ppd_file_t *ppd, const char *keyword) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_cparam_t *ppdFindCustomParam(ppd_coption_t *opt, - const char *name) _PPD_DEPRECATED; + const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_cparam_t *ppdFirstCustomParam(ppd_coption_t *opt) - _PPD_DEPRECATED; -extern ppd_option_t *ppdFirstOption(ppd_file_t *ppd) _PPD_DEPRECATED; -extern ppd_cparam_t *ppdNextCustomParam(ppd_coption_t *opt) _PPD_DEPRECATED; -extern ppd_option_t *ppdNextOption(ppd_file_t *ppd) _PPD_DEPRECATED; -extern int ppdLocalize(ppd_file_t *ppd) _PPD_DEPRECATED; -extern ppd_file_t *ppdOpen2(cups_file_t *fp) _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern ppd_option_t *ppdFirstOption(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern ppd_cparam_t *ppdNextCustomParam(ppd_coption_t *opt) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern ppd_option_t *ppdNextOption(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern int ppdLocalize(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); +extern ppd_file_t *ppdOpen2(cups_file_t *fp) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); /**** New in CUPS 1.3/macOS 10.5 ****/ extern const char *ppdLocalizeIPPReason(ppd_file_t *ppd, const char *reason, const char *scheme, char *buffer, - size_t bufsize) _PPD_DEPRECATED; + size_t bufsize) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); /**** New in CUPS 1.4/macOS 10.6 ****/ extern int cupsGetConflicts(ppd_file_t *ppd, const char *option, const char *choice, cups_option_t **options) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int cupsResolveConflicts(ppd_file_t *ppd, const char *option, const char *choice, int *num_options, cups_option_t **options) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdInstallableConflict(ppd_file_t *ppd, const char *option, const char *choice) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern ppd_attr_t *ppdLocalizeAttr(ppd_file_t *ppd, const char *keyword, - const char *spec) _PPD_DEPRECATED; + const char *spec) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern const char *ppdLocalizeMarkerName(ppd_file_t *ppd, const char *name) - _PPD_DEPRECATED; + _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); extern int ppdPageSizeLimits(ppd_file_t *ppd, ppd_size_t *minimum, - ppd_size_t *maximum) _PPD_DEPRECATED; + ppd_size_t *maximum) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead."); /* |