]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
d09495fa | 2 | * "$Id: printers.h 5828 2006-08-15 21:21:45Z mike $" |
ef416fc2 | 3 | * |
4 | * Printer definitions for the Common UNIX Printing System (CUPS) scheduler. | |
5 | * | |
fa73b229 | 6 | * Copyright 1997-2006 by Easy Software Products, all rights reserved. |
ef416fc2 | 7 | * |
8 | * These coded instructions, statements, and computer programs are the | |
9 | * property of Easy Software Products and are protected by Federal | |
10 | * copyright law. Distribution and use rights are outlined in the file | |
11 | * "LICENSE.txt" which should have been included with this file. If this | |
12 | * file is missing or damaged please contact Easy Software Products | |
13 | * at: | |
14 | * | |
15 | * Attn: CUPS Licensing Information | |
16 | * Easy Software Products | |
17 | * 44141 Airport View Drive, Suite 204 | |
18 | * Hollywood, Maryland 20636 USA | |
19 | * | |
20 | * Voice: (301) 373-9600 | |
21 | * EMail: cups-info@cups.org | |
22 | * WWW: http://www.cups.org | |
23 | */ | |
24 | ||
25 | /* | |
26 | * Quota data... | |
27 | */ | |
28 | ||
29 | typedef struct | |
30 | { | |
31 | char username[33]; /* User data */ | |
32 | time_t next_update; /* Next update time */ | |
33 | int page_count, /* Count of pages */ | |
34 | k_count; /* Count of kilobytes */ | |
35 | } cupsd_quota_t; | |
36 | ||
37 | ||
38 | /* | |
39 | * Printer/class information structure... | |
40 | */ | |
41 | ||
42 | typedef struct cupsd_printer_s | |
43 | { | |
44 | char *uri, /* Printer URI */ | |
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 in_implicit_class; /* In an implicit class? */ | |
56 | ipp_pstate_t state; /* Printer state */ | |
57 | char state_message[1024]; /* Printer state message */ | |
58 | int num_reasons; /* Number of printer-state-reasons */ | |
59 | char *reasons[16]; /* printer-state-reasons strings */ | |
60 | time_t state_time; /* Time at this state */ | |
61 | char *job_sheets[2]; /* Banners/job sheets */ | |
62 | cups_ptype_t type; /* Printer type (color, small, etc.) */ | |
b423cd4c | 63 | char *browse_attrs; /* Attributes sent with browse data */ |
64 | time_t browse_expire; /* Expiration time for printer */ | |
ef416fc2 | 65 | time_t browse_time; /* Last time update was sent/received */ |
66 | char *device_uri; /* Device URI */ | |
67 | char *port_monitor; /* Port monitor */ | |
68 | int raw; /* Raw queue? */ | |
d09495fa | 69 | int remote; /* Remote queue? */ |
ef416fc2 | 70 | mime_type_t *filetype; /* Pseudo-filetype for printer */ |
80ca4592 | 71 | cups_array_t *filetypes; /* Supported file types */ |
ef416fc2 | 72 | void *job; /* Current job in queue */ |
73 | ipp_t *attrs; /* Attributes supported by this printer */ | |
74 | int num_printers, /* Number of printers in class */ | |
75 | last_printer; /* Last printer job was sent to */ | |
76 | struct cupsd_printer_s **printers; /* Printers in class */ | |
77 | int quota_period, /* Period for quotas */ | |
78 | page_limit, /* Maximum number of pages */ | |
fa73b229 | 79 | k_limit; /* Maximum number of kilobytes */ |
80 | cups_array_t *quotas; /* Quota records */ | |
ef416fc2 | 81 | int deny_users, /* 1 = deny, 0 = allow */ |
82 | num_users; /* Number of allowed/denied users */ | |
83 | const char **users; /* Allowed/denied users */ | |
84 | int num_history; /* Number of history collections */ | |
85 | ipp_t **history; /* History data */ | |
86 | int sequence_number; /* Increasing sequence number */ | |
b423cd4c | 87 | int num_options; /* Number of default options */ |
88 | cups_option_t *options; /* Default options */ | |
e00b005a | 89 | #ifdef __APPLE__ |
90 | char *recoverable; /* com.apple.print.recoverable-message */ | |
91 | #endif /* __APPLE__ */ | |
ef416fc2 | 92 | } cupsd_printer_t; |
93 | ||
94 | ||
95 | /* | |
96 | * Globals... | |
97 | */ | |
98 | ||
99 | VAR ipp_t *CommonData VALUE(NULL); | |
100 | /* Common printer object attrs */ | |
101 | VAR cups_array_t *Printers VALUE(NULL), | |
102 | /* Printer list */ | |
103 | *ImplicitPrinters VALUE(NULL); | |
104 | /* Implicit class printers */ | |
105 | VAR cupsd_printer_t *DefaultPrinter VALUE(NULL); | |
106 | /* Default printer */ | |
107 | VAR char *DefaultPolicy VALUE(NULL); | |
108 | /* Default policy name */ | |
109 | VAR cupsd_policy_t *DefaultPolicyPtr | |
110 | VALUE(NULL); | |
111 | /* Pointer to default policy */ | |
112 | ||
113 | ||
114 | /* | |
115 | * Prototypes... | |
116 | */ | |
117 | ||
118 | extern cupsd_printer_t *cupsdAddPrinter(const char *name); | |
ef416fc2 | 119 | extern void cupsdAddPrinterHistory(cupsd_printer_t *p); |
120 | extern void cupsdAddPrinterUser(cupsd_printer_t *p, const char *username); | |
ef416fc2 | 121 | extern void cupsdCreateCommonData(void); |
122 | extern void cupsdDeleteAllPrinters(void); | |
123 | extern void cupsdDeletePrinter(cupsd_printer_t *p, int update); | |
ef416fc2 | 124 | extern cupsd_printer_t *cupsdFindDest(const char *name); |
125 | extern cupsd_printer_t *cupsdFindPrinter(const char *name); | |
ef416fc2 | 126 | extern void cupsdFreePrinterUsers(cupsd_printer_t *p); |
127 | extern void cupsdFreeQuotas(cupsd_printer_t *p); | |
128 | extern void cupsdLoadAllPrinters(void); | |
b423cd4c | 129 | extern void cupsdRenamePrinter(cupsd_printer_t *p, const char *name); |
ef416fc2 | 130 | extern void cupsdSaveAllPrinters(void); |
131 | extern void cupsdSetPrinterAttrs(cupsd_printer_t *p); | |
132 | extern void cupsdSetPrinterReasons(cupsd_printer_t *p, const char *s); | |
133 | extern void cupsdSetPrinterState(cupsd_printer_t *p, ipp_pstate_t s, int update); | |
134 | #define cupsdStartPrinter(p,u) cupsdSetPrinterState((p), IPP_PRINTER_IDLE, (u)) | |
135 | extern void cupsdStopPrinter(cupsd_printer_t *p, int update); | |
136 | extern void cupsdUpdatePrinters(void); | |
137 | extern cupsd_quota_t *cupsdUpdateQuota(cupsd_printer_t *p, const char *username, | |
138 | int pages, int k); | |
f7faf1f5 | 139 | extern const char *cupsdValidateDest(const char *hostname, |
140 | const char *resource, | |
ef416fc2 | 141 | cups_ptype_t *dtype, |
142 | cupsd_printer_t **printer); | |
143 | extern void cupsdWritePrintcap(void); | |
144 | ||
145 | extern char *cupsdSanitizeURI(const char *uri, char *buffer, | |
146 | int buflen); | |
147 | ||
148 | ||
149 | /* | |
d09495fa | 150 | * End of "$Id: printers.h 5828 2006-08-15 21:21:45Z mike $". |
ef416fc2 | 151 | */ |