]>
git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/printers.h
4 * Printer definitions for the CUPS scheduler.
6 * Copyright 2007-2011 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
18 #endif /* HAVE_DNSSD */
19 #include <cups/pwg-private.h>
28 char username
[33]; /* User data */
29 time_t next_update
; /* Next update time */
30 int page_count
, /* Count of pages */
31 k_count
; /* Count of kilobytes */
36 * Printer/class information structure...
39 typedef struct cupsd_job_s cupsd_job_t
;
41 struct cupsd_printer_s
43 char *uri
, /* Printer URI */
44 *uuid
, /* Printer UUID */
45 *hostname
, /* Host printer resides on */
46 *name
, /* Printer name */
47 *location
, /* Location code */
48 *make_model
, /* Make and model */
49 *info
, /* Description */
50 *op_policy
, /* Operation policy name */
51 *error_policy
; /* Error policy */
52 cupsd_policy_t
*op_policy_ptr
; /* Pointer to operation policy */
53 int shared
; /* Shared? */
54 int accepting
; /* Accepting jobs? */
55 int holding_new_jobs
; /* Holding new jobs for printing? */
56 int in_implicit_class
; /* In an implicit class? */
57 ipp_pstate_t state
; /* Printer state */
58 char state_message
[1024]; /* Printer state message */
59 int num_reasons
; /* Number of printer-state-reasons */
60 char *reasons
[64]; /* printer-state-reasons strings */
61 time_t state_time
; /* Time at this state */
62 char *job_sheets
[2]; /* Banners/job sheets */
63 cups_ptype_t type
; /* Printer type (color, small, etc.) */
64 char *device_uri
; /* Device URI */
65 char *sanitized_device_uri
; /* Sanitized device URI */
66 char *port_monitor
; /* Port monitor */
67 int raw
; /* Raw queue? */
68 int remote
; /* Remote queue? */
69 mime_type_t
*filetype
, /* Pseudo-filetype for printer */
70 *prefiltertype
; /* Pseudo-filetype for pre-filters */
71 cups_array_t
*filetypes
, /* Supported file types */
72 *dest_types
; /* Destination types for queue */
73 cupsd_job_t
*job
; /* Current job in queue */
74 ipp_t
*attrs
, /* Attributes supported by this printer */
75 *ppd_attrs
; /* Attributes based on the PPD */
76 int num_printers
, /* Number of printers in class */
77 last_printer
; /* Last printer job was sent to */
78 struct cupsd_printer_s
**printers
; /* Printers in class */
79 int quota_period
, /* Period for quotas */
80 page_limit
, /* Maximum number of pages */
81 k_limit
; /* Maximum number of kilobytes */
82 cups_array_t
*quotas
; /* Quota records */
83 int deny_users
; /* 1 = deny, 0 = allow */
84 cups_array_t
*users
; /* Allowed/denied users */
85 int sequence_number
; /* Increasing sequence number */
86 int num_options
; /* Number of default options */
87 cups_option_t
*options
; /* Default options */
88 int num_auth_info_required
; /* Number of required auth fields */
89 const char *auth_info_required
[4]; /* Required authentication fields */
90 char *alert
, /* PSX printer-alert value */
91 *alert_description
; /* PSX printer-alert-description value */
92 time_t marker_time
; /* Last time marker attributes were updated */
93 _ppd_cache_t
*pc
; /* PPD cache and mapping data */
96 char *reg_name
, /* Name used for service registration */
97 *pdl
, /* pdl value for TXT record */
98 *ipp_txt
, /* IPP TXT record contents */
99 *printer_txt
; /* LPD TXT record contents */
100 int ipp_len
, /* IPP TXT record length */
101 printer_len
; /* LPD TXT record length */
102 DNSServiceRef ipp_ref
, /* Reference for _ipp._tcp,_cups */
103 printer_ref
; /* Reference for _printer._tcp */
104 #endif /* HAVE_DNSSD */
112 VAR ipp_t
*CommonData
VALUE(NULL
);
113 /* Common printer object attrs */
114 VAR cups_array_t
*CommonDefaults
VALUE(NULL
);
115 /* Common -default option names */
116 VAR cups_array_t
*Printers
VALUE(NULL
);
118 VAR cupsd_printer_t
*DefaultPrinter
VALUE(NULL
);
119 /* Default printer */
120 VAR
char *DefaultPolicy
VALUE(NULL
);
121 /* Default policy name */
122 VAR cupsd_policy_t
*DefaultPolicyPtr
124 /* Pointer to default policy */
131 extern cupsd_printer_t
*cupsdAddPrinter(const char *name
);
132 extern void cupsdCreateCommonData(void);
133 extern void cupsdDeleteAllPrinters(void);
134 extern int cupsdDeletePrinter(cupsd_printer_t
*p
, int update
);
135 extern cupsd_printer_t
*cupsdFindDest(const char *name
);
136 extern cupsd_printer_t
*cupsdFindPrinter(const char *name
);
137 extern cupsd_quota_t
*cupsdFindQuota(cupsd_printer_t
*p
,
138 const char *username
);
139 extern void cupsdFreeQuotas(cupsd_printer_t
*p
);
140 extern void cupsdLoadAllPrinters(void);
141 extern void cupsdRenamePrinter(cupsd_printer_t
*p
,
143 extern void cupsdSaveAllPrinters(void);
144 extern int cupsdSetAuthInfoRequired(cupsd_printer_t
*p
,
146 ipp_attribute_t
*attr
);
147 extern void cupsdSetDeviceURI(cupsd_printer_t
*p
, const char *uri
);
148 extern void cupsdSetPrinterAttr(cupsd_printer_t
*p
,
149 const char *name
, char *value
);
150 extern void cupsdSetPrinterAttrs(cupsd_printer_t
*p
);
151 extern int cupsdSetPrinterReasons(cupsd_printer_t
*p
,
153 extern void cupsdSetPrinterState(cupsd_printer_t
*p
, ipp_pstate_t s
,
155 #define cupsdStartPrinter(p,u) cupsdSetPrinterState((p), IPP_PRINTER_IDLE, (u))
156 extern void cupsdStopPrinter(cupsd_printer_t
*p
, int update
);
157 extern int cupsdUpdatePrinterPPD(cupsd_printer_t
*p
,
159 cups_option_t
*keywords
);
160 extern void cupsdUpdatePrinters(void);
161 extern cupsd_quota_t
*cupsdUpdateQuota(cupsd_printer_t
*p
,
162 const char *username
, int pages
,
164 extern const char *cupsdValidateDest(const char *uri
,
166 cupsd_printer_t
**printer
);
167 extern void cupsdWritePrintcap(void);