#ifndef _CUPS_PPD_H_
# define _CUPS_PPD_H_
# include <stdio.h>
# include "cups.h"
# include "array.h"
# include "file.h"
# include "raster.h"
# ifdef __cplusplus
extern "C" {
# endif
# define PPD_VERSION 4.3
# define PPD_MAX_NAME 41
# define PPD_MAX_TEXT 81
# define PPD_MAX_LINE 256
typedef int (*cups_interpret_cb_t)(cups_page_header2_t *header, int preferred_bits);
typedef enum ppd_ui_e
{
PPD_UI_BOOLEAN,
PPD_UI_PICKONE,
PPD_UI_PICKMANY
} ppd_ui_t;
typedef enum ppd_section_e
{
PPD_ORDER_ANY,
PPD_ORDER_DOCUMENT,
PPD_ORDER_EXIT,
PPD_ORDER_JCL,
PPD_ORDER_PAGE,
PPD_ORDER_PROLOG
} ppd_section_t;
typedef enum ppd_cs_e
{
PPD_CS_CMYK = -4,
PPD_CS_CMY,
PPD_CS_GRAY = 1,
PPD_CS_RGB = 3,
PPD_CS_RGBK,
PPD_CS_N
} ppd_cs_t;
typedef enum ppd_status_e
{
PPD_OK = 0,
PPD_FILE_OPEN_ERROR,
PPD_NULL_FILE,
PPD_ALLOC_ERROR,
PPD_MISSING_PPDADOBE4,
PPD_MISSING_VALUE,
PPD_INTERNAL_ERROR,
PPD_BAD_OPEN_GROUP,
PPD_NESTED_OPEN_GROUP,
PPD_BAD_OPEN_UI,
PPD_NESTED_OPEN_UI,
PPD_BAD_ORDER_DEPENDENCY,
PPD_BAD_UI_CONSTRAINTS,
PPD_MISSING_ASTERISK,
PPD_LINE_TOO_LONG,
PPD_ILLEGAL_CHARACTER,
PPD_ILLEGAL_MAIN_KEYWORD,
PPD_ILLEGAL_OPTION_KEYWORD,
PPD_ILLEGAL_TRANSLATION,
PPD_ILLEGAL_WHITESPACE,
PPD_BAD_CUSTOM_PARAM,
PPD_MISSING_OPTION_KEYWORD,
PPD_BAD_VALUE,
PPD_MISSING_CLOSE_GROUP,
PPD_BAD_CLOSE_UI,
PPD_MISSING_CLOSE_UI,
PPD_MAX_STATUS
} ppd_status_t;
enum ppd_conform_e
{
PPD_CONFORM_RELAXED,
PPD_CONFORM_STRICT
};
typedef enum ppd_conform_e ppd_conform_t;
typedef struct ppd_attr_s
{
char name[PPD_MAX_NAME];
char spec[PPD_MAX_NAME];
char text[PPD_MAX_TEXT];
char *value;
} ppd_attr_t;
typedef struct ppd_option_s ppd_option_t;
typedef struct ppd_choice_s
{
char marked;
char choice[PPD_MAX_NAME];
char text[PPD_MAX_TEXT];
char *code;
ppd_option_t *option;
} ppd_choice_t;
struct ppd_option_s
{
char conflicted;
char keyword[PPD_MAX_NAME];
char defchoice[PPD_MAX_NAME];
char text[PPD_MAX_TEXT];
ppd_ui_t ui;
ppd_section_t section;
float order;
int num_choices;
ppd_choice_t *choices;
};
typedef struct ppd_group_s
{
char text[PPD_MAX_TEXT - PPD_MAX_NAME];
char name[PPD_MAX_NAME];
int num_options;
ppd_option_t *options;
int num_subgroups;
struct ppd_group_s *subgroups;
} ppd_group_t;
typedef struct ppd_const_s
{
char option1[PPD_MAX_NAME];
char choice1[PPD_MAX_NAME];
char option2[PPD_MAX_NAME];
char choice2[PPD_MAX_NAME];
} ppd_const_t;
typedef struct ppd_size_s
{
int marked;
char name[PPD_MAX_NAME];
float width;
float length;
float left;
float bottom;
float right;
float top;
} ppd_size_t;
typedef struct ppd_emul_s
{
char name[PPD_MAX_NAME];
char *start;
char *stop;
} ppd_emul_t;
typedef struct ppd_profile_s
{
char resolution[PPD_MAX_NAME];
char media_type[PPD_MAX_NAME];
float density;
float gamma;
float matrix[3][3];
} ppd_profile_t;
typedef enum ppd_cptype_e
{
PPD_CUSTOM_UNKNOWN = -1,
PPD_CUSTOM_CURVE,
PPD_CUSTOM_INT,
PPD_CUSTOM_INVCURVE,
PPD_CUSTOM_PASSCODE,
PPD_CUSTOM_PASSWORD,
PPD_CUSTOM_POINTS,
PPD_CUSTOM_REAL,
PPD_CUSTOM_STRING
} ppd_cptype_t;
typedef union ppd_cplimit_u
{
float custom_curve;
int custom_int;
float custom_invcurve;
int custom_passcode;
int custom_password;
float custom_points;
float custom_real;
int custom_string;
} ppd_cplimit_t;
typedef union ppd_cpvalue_u
{
float custom_curve;
int custom_int;
float custom_invcurve;
char *custom_passcode;
char *custom_password;
float custom_points;
float custom_real;
char *custom_string;
} ppd_cpvalue_t;
typedef struct ppd_cparam_s
{
char name[PPD_MAX_NAME];
char text[PPD_MAX_TEXT];
int order;
ppd_cptype_t type;
ppd_cplimit_t minimum,
maximum;
ppd_cpvalue_t current;
} ppd_cparam_t;
typedef struct ppd_coption_s
{
char keyword[PPD_MAX_NAME];
ppd_option_t *option;
int marked;
cups_array_t *params;
} ppd_coption_t;
typedef struct _ppd_cache_s _ppd_cache_t;
typedef struct ppd_file_s
{
int language_level;
int color_device;
int variable_sizes;
int accurate_screens;
int contone_only;
int landscape;
int model_number;
int manual_copies;
int throughput;
ppd_cs_t colorspace;
char *patches;
int num_emulations;
ppd_emul_t *emulations;
char *jcl_begin;
char *jcl_ps;
char *jcl_end;
char *lang_encoding;
char *lang_version;
char *modelname;
char *ttrasterizer;
char *manufacturer;
char *product;
char *nickname;
char *shortnickname;
int num_groups;
ppd_group_t *groups;
int num_sizes;
ppd_size_t *sizes;
float custom_min[2];
float custom_max[2];
float custom_margins[4];
int num_consts;
ppd_const_t *consts;
int num_fonts;
char **fonts;
int num_profiles;
ppd_profile_t *profiles;
int num_filters;
char **filters;
int flip_duplex;
char *protocols;
char *pcfilename;
int num_attrs;
int cur_attr;
ppd_attr_t **attrs;
cups_array_t *sorted_attrs;
cups_array_t *options;
cups_array_t *coptions;
cups_array_t *marked;
cups_array_t *cups_uiconstraints;
_ppd_cache_t *cache;
} ppd_file_t;
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) _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) _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) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdEmitFd(ppd_file_t *ppd, int fd,
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)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_choice_t *ppdFindChoice(ppd_option_t *o, const char *option)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd,
const char *keyword)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_option_t *ppdFindOption(ppd_file_t *ppd, const char *keyword)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdIsMarked(ppd_file_t *ppd, const char *keyword,
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) _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)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_size_t *ppdPageSize(ppd_file_t *ppd, const char *name)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern float ppdPageWidth(ppd_file_t *ppd, const char *name)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
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) _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) _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.");
extern void ppdSetConformance(ppd_conform_t c) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int cupsRasterInterpretPPD(cups_page_header2_t *h,
ppd_file_t *ppd,
int num_options,
cups_option_t *options,
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)
_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) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern char *ppdEmitString(ppd_file_t *ppd, ppd_section_t section,
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)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_cparam_t *ppdFindCustomParam(ppd_coption_t *opt,
const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_cparam_t *ppdFirstCustomParam(ppd_coption_t *opt)
_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.");
extern const char *ppdLocalizeIPPReason(ppd_file_t *ppd,
const char *reason,
const char *scheme,
char *buffer,
size_t bufsize) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int cupsGetConflicts(ppd_file_t *ppd, const char *option,
const char *choice,
cups_option_t **options)
_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)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdInstallableConflict(ppd_file_t *ppd,
const char *option,
const char *choice)
_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) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern const char *ppdLocalizeMarkerName(ppd_file_t *ppd,
const char *name)
_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) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
# ifdef __cplusplus
}
# endif
#endif