/*
- * "$Id: ppd.h 7791 2008-07-24 00:55:30Z mike $"
+ * "$Id$"
*
- * PostScript Printer Description definitions for the Common UNIX Printing
- * System (CUPS).
+ * PostScript Printer Description definitions for CUPS.
*
- * Copyright 2007-2008 by Apple Inc.
+ * 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.
+ *
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
*/
# include <stdio.h>
+# include "cups.h"
# include "array.h"
# include "file.h"
# endif /* __cplusplus */
+/*
+ * Define _PPD_DEPRECATED to silence the warnings about PPD functions being
+ * deprecated...
+ */
+
+# ifndef _PPD_DEPRECATED
+# if defined(__APPLE__)
+# if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
+ /* Building for OS X 10.7 and earlier */
+# define _PPD_DEPRECATED
+# elif !defined(MAC_OS_X_VERSION_10_8)
+ /* Building for OS X 10.7 and earlier */
+# define _PPD_DEPRECATED
+# else
+# define _PPD_DEPRECATED _CUPS_DEPRECATED
+# endif /* MAC_OS_X_VERSION_10_8 && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 */
+# else
+# define _PPD_DEPRECATED _CUPS_DEPRECATED
+# endif /* __APPLE__ */
+# endif /* !_PPD_DEPRECATED */
+
+
/*
* PPD version...
*/
PPD_CS_N /* DeviceN colorspace */
} ppd_cs_t;
-typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19/Mac OS X 10.3@ ****/
+typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19/OS X 10.3@ ****/
{
PPD_OK = 0, /* OK */
PPD_FILE_OPEN_ERROR, /* Unable to open PPD file */
PPD_BAD_CUSTOM_PARAM, /* Bad custom parameter */
PPD_MISSING_OPTION_KEYWORD, /* Missing option keyword */
PPD_BAD_VALUE, /* Bad value string */
+ PPD_MISSING_CLOSE_GROUP, /* Missing CloseGroup */
PPD_MAX_STATUS /* @private@ */
} ppd_status_t;
-enum ppd_conform_e /**** Conformance Levels @since CUPS 1.1.19/Mac OS X 10.3@ ****/
+enum ppd_conform_e /**** Conformance Levels @since CUPS 1.1.19/OS X 10.3@ ****/
{
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/Mac OS X 10.3@ ****/
+ /**** Conformance Levels @since CUPS 1.1.19/OS X 10.3@ ****/
-typedef struct ppd_attr_s /**** PPD Attribute Structure @since CUPS 1.1.19/Mac OS X 10.3@ ****/
+typedef struct ppd_attr_s /**** PPD Attribute Structure @since CUPS 1.1.19/OS X 10.3@ ****/
{
char name[PPD_MAX_NAME]; /* Name of attribute (cupsXYZ) */
char spec[PPD_MAX_NAME]; /* Specifier string, if any */
****/
char text[PPD_MAX_TEXT - PPD_MAX_NAME];
/* Human-readable group name */
- char name[PPD_MAX_NAME]; /* Group name @since CUPS 1.1.18/Mac OS X 10.3@ */
+ char name[PPD_MAX_NAME]; /* Group name @since CUPS 1.1.18/OS X 10.3@ */
int num_options; /* Number of options */
ppd_option_t *options; /* Options */
int num_subgroups; /* Number of sub-groups */
float matrix[3][3]; /* Transform matrix */
} ppd_profile_t;
-/**** New in CUPS 1.2/Mac OS X 10.5 ****/
-typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2/Mac OS X 10.5@ ****/
+/**** New in CUPS 1.2/OS X 10.5 ****/
+typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2/OS X 10.5@ ****/
{
PPD_CUSTOM_CURVE, /* Curve value for f(x) = x^value */
PPD_CUSTOM_INT, /* Integer number value */
PPD_CUSTOM_STRING /* String of characters */
} ppd_cptype_t;
-typedef union ppd_cplimit_u /**** Custom Parameter Limit @since CUPS 1.2/Mac OS X 10.5@ ****/
+typedef union ppd_cplimit_u /**** Custom Parameter Limit @since CUPS 1.2/OS X 10.5@ ****/
{
float custom_curve; /* Gamma value */
int custom_int; /* Integer value */
int custom_string; /* String length */
} ppd_cplimit_t;
-typedef union ppd_cpvalue_u /**** Custom Parameter Value @since CUPS 1.2/Mac OS X 10.5@ ****/
+typedef union ppd_cpvalue_u /**** Custom Parameter Value @since CUPS 1.2/OS X 10.5@ ****/
{
float custom_curve; /* Gamma value */
int custom_int; /* Integer value */
char *custom_string; /* String value */
} ppd_cpvalue_t;
-typedef struct ppd_cparam_s /**** Custom Parameter @since CUPS 1.2/Mac OS X 10.5@ ****/
+typedef struct ppd_cparam_s /**** Custom Parameter @since CUPS 1.2/OS X 10.5@ ****/
{
char name[PPD_MAX_NAME]; /* Parameter name */
char text[PPD_MAX_TEXT]; /* Human-readable text */
ppd_cpvalue_t current; /* Current value */
} ppd_cparam_t;
-typedef struct ppd_coption_s /**** Custom Option @since CUPS 1.2/Mac OS X 10.5@ ****/
+typedef struct ppd_coption_s /**** Custom Option @since CUPS 1.2/OS X 10.5@ ****/
{
char keyword[PPD_MAX_NAME]; /* Name of option that is being extended... */
ppd_option_t *option; /* Option that is being extended... */
cups_array_t *params; /* Parameters */
} ppd_coption_t;
+typedef struct _ppd_cache_s _ppd_cache_t;
+ /**** PPD cache and mapping data @since CUPS 1.5/OS X 10.7@ @private@ ****/
+
typedef struct ppd_file_s /**** PPD File ****/
{
int language_level; /* Language level of device */
int flip_duplex; /* 1 = Flip page for back sides @deprecated@ */
/**** New in CUPS 1.1.19 ****/
- char *protocols; /* Protocols (BCP, TBCP) string @since CUPS 1.1.19/Mac OS X 10.3@ */
- char *pcfilename; /* PCFileName string @since CUPS 1.1.19/Mac OS X 10.3@ */
- int num_attrs; /* Number of attributes @since CUPS 1.1.19/Mac OS X 10.3@ @private@ */
- int cur_attr; /* Current attribute @since CUPS 1.1.19/Mac OS X 10.3@ @private@ */
- ppd_attr_t **attrs; /* Attributes @since CUPS 1.1.19/Mac OS X 10.3@ @private@ */
-
- /**** New in CUPS 1.2/Mac OS X 10.5 ****/
- cups_array_t *sorted_attrs; /* Attribute lookup array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
- cups_array_t *options; /* Option lookup array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
- cups_array_t *coptions; /* Custom options array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
-
- /**** New in CUPS 1.3/Mac OS X 10.5 ****/
- cups_array_t *marked; /* Marked choices @since CUPS 1.3/Mac OS X 10.5@ @private@ */
-
- /**** New in CUPS 1.4/Mac OS X 10.6 ****/
- cups_array_t *cups_uiconstraints; /* cupsUIConstraints @since CUPS 1.4/Mac OS X 10.6@ @private@ */
+ char *protocols; /* Protocols (BCP, TBCP) string @since CUPS 1.1.19/OS X 10.3@ */
+ char *pcfilename; /* PCFileName string @since CUPS 1.1.19/OS X 10.3@ */
+ int num_attrs; /* Number of attributes @since CUPS 1.1.19/OS X 10.3@ @private@ */
+ int cur_attr; /* Current attribute @since CUPS 1.1.19/OS X 10.3@ @private@ */
+ ppd_attr_t **attrs; /* Attributes @since CUPS 1.1.19/OS X 10.3@ @private@ */
+
+ /**** New in CUPS 1.2/OS X 10.5 ****/
+ cups_array_t *sorted_attrs; /* Attribute lookup array @since CUPS 1.2/OS X 10.5@ @private@ */
+ cups_array_t *options; /* Option lookup array @since CUPS 1.2/OS X 10.5@ @private@ */
+ cups_array_t *coptions; /* Custom options array @since CUPS 1.2/OS X 10.5@ @private@ */
+
+ /**** New in CUPS 1.3/OS X 10.5 ****/
+ cups_array_t *marked; /* Marked choices @since CUPS 1.3/OS X 10.5@ @private@ */
+
+ /**** New in CUPS 1.4/OS X 10.6 ****/
+ cups_array_t *cups_uiconstraints; /* cupsUIConstraints @since CUPS 1.4/OS X 10.6@ @private@ */
+
+ /**** New in CUPS 1.5 ****/
+ _ppd_cache_t *cache; /* PPD cache and mapping data @since CUPS 1.5/OS X 10.7@ @private@ */
} ppd_file_t;
* Prototypes...
*/
+extern int cupsMarkOptions(ppd_file_t *ppd, int num_options,
+ cups_option_t *options);
extern void ppdClose(ppd_file_t *ppd);
extern int ppdCollect(ppd_file_t *ppd, ppd_section_t section,
ppd_choice_t ***choices);
extern int ppdEmitJCL(ppd_file_t *ppd, FILE *fp, int job_id,
const char *user, const char *title);
extern ppd_choice_t *ppdFindChoice(ppd_option_t *o, const char *option);
-extern ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd, const char *keyword);
+extern ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd,
+ const char *keyword);
extern ppd_option_t *ppdFindOption(ppd_file_t *ppd, const char *keyword);
extern int ppdIsMarked(ppd_file_t *ppd, const char *keyword,
const char *option);
extern float ppdPageWidth(ppd_file_t *ppd, const char *name);
/**** New in CUPS 1.1.19 ****/
-extern const char *ppdErrorString(ppd_status_t status) _CUPS_API_1_1_19;
+extern const char *ppdErrorString(ppd_status_t status) _PPD_DEPRECATED;
extern ppd_attr_t *ppdFindAttr(ppd_file_t *ppd, const char *name,
- const char *spec) _CUPS_API_1_1_19;
+ const char *spec) _PPD_DEPRECATED;
extern ppd_attr_t *ppdFindNextAttr(ppd_file_t *ppd, const char *name,
- const char *spec) _CUPS_API_1_1_19;
-extern ppd_status_t ppdLastError(int *line) _CUPS_API_1_1_19;
+ const char *spec) _PPD_DEPRECATED;
+extern ppd_status_t ppdLastError(int *line) _PPD_DEPRECATED;
/**** New in CUPS 1.1.20 ****/
-extern void ppdSetConformance(ppd_conform_t c) _CUPS_API_1_1_20;
+extern void ppdSetConformance(ppd_conform_t c) _PPD_DEPRECATED;
/**** New in CUPS 1.2 ****/
extern int ppdCollect2(ppd_file_t *ppd, ppd_section_t section,
- float min_order, ppd_choice_t ***choices) _CUPS_API_1_2;
+ float min_order, ppd_choice_t ***choices)
+ _PPD_DEPRECATED;
extern int ppdEmitAfterOrder(ppd_file_t *ppd, FILE *fp,
ppd_section_t section, int limit,
- float min_order) _CUPS_API_1_2;
-extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp) _CUPS_API_1_2;
+ float min_order) _PPD_DEPRECATED;
+extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp) _PPD_DEPRECATED;
extern char *ppdEmitString(ppd_file_t *ppd, ppd_section_t section,
- float min_order) _CUPS_API_1_2;
+ float min_order) _PPD_DEPRECATED;
extern ppd_coption_t *ppdFindCustomOption(ppd_file_t *ppd,
- const char *keyword) _CUPS_API_1_2;
+ const char *keyword) _PPD_DEPRECATED;
extern ppd_cparam_t *ppdFindCustomParam(ppd_coption_t *opt,
- const char *name) _CUPS_API_1_2;
-extern ppd_cparam_t *ppdFirstCustomParam(ppd_coption_t *opt) _CUPS_API_1_2;
-extern ppd_option_t *ppdFirstOption(ppd_file_t *ppd) _CUPS_API_1_2;
-extern ppd_cparam_t *ppdNextCustomParam(ppd_coption_t *opt) _CUPS_API_1_2;
-extern ppd_option_t *ppdNextOption(ppd_file_t *ppd) _CUPS_API_1_2;
-extern int ppdLocalize(ppd_file_t *ppd) _CUPS_API_1_2;
-extern ppd_file_t *ppdOpen2(cups_file_t *fp) _CUPS_API_1_2;
-
-/**** New in CUPS 1.3 ****/
+ const char *name) _PPD_DEPRECATED;
+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;
+
+/**** New in CUPS 1.3/OS X 10.5 ****/
extern const char *ppdLocalizeIPPReason(ppd_file_t *ppd,
const char *reason,
const char *scheme,
char *buffer,
- size_t bufsize) _CUPS_API_1_3;
-
-/**** New in CUPS 1.4 ****/
+ size_t bufsize) _PPD_DEPRECATED;
+
+/**** New in CUPS 1.4/OS X 10.6 ****/
+extern int cupsGetConflicts(ppd_file_t *ppd, const char *option,
+ const char *choice,
+ cups_option_t **options)
+ _PPD_DEPRECATED;
+extern int cupsResolveConflicts(ppd_file_t *ppd,
+ const char *option,
+ const char *choice,
+ int *num_options,
+ cups_option_t **options)
+ _PPD_DEPRECATED;
extern int ppdInstallableConflict(ppd_file_t *ppd,
const char *option,
- const char *choice);
+ const char *choice)
+ _PPD_DEPRECATED;
extern ppd_attr_t *ppdLocalizeAttr(ppd_file_t *ppd, const char *keyword,
- const char *spec);
+ const char *spec) _PPD_DEPRECATED;
extern const char *ppdLocalizeMarkerName(ppd_file_t *ppd,
- const char *name) _CUPS_API_1_4;
+ const char *name)
+ _PPD_DEPRECATED;
extern int ppdPageSizeLimits(ppd_file_t *ppd,
ppd_size_t *minimum,
- ppd_size_t *maximum) _CUPS_API_1_4;
+ ppd_size_t *maximum) _PPD_DEPRECATED;
/*
#endif /* !_CUPS_PPD_H_ */
/*
- * End of "$Id: ppd.h 7791 2008-07-24 00:55:30Z mike $".
+ * End of "$Id$".
*/