]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
e00b005a | 2 | * "$Id: printers.h 5039 2006-02-01 16:29:57Z 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.) */ | |
63 | time_t browse_time; /* Last time update was sent/received */ | |
64 | char *device_uri; /* Device URI */ | |
65 | char *port_monitor; /* Port monitor */ | |
66 | int raw; /* Raw queue? */ | |
67 | mime_type_t *filetype; /* Pseudo-filetype for printer */ | |
68 | void *job; /* Current job in queue */ | |
69 | ipp_t *attrs; /* Attributes supported by this printer */ | |
70 | int num_printers, /* Number of printers in class */ | |
71 | last_printer; /* Last printer job was sent to */ | |
72 | struct cupsd_printer_s **printers; /* Printers in class */ | |
73 | int quota_period, /* Period for quotas */ | |
74 | page_limit, /* Maximum number of pages */ | |
fa73b229 | 75 | k_limit; /* Maximum number of kilobytes */ |
76 | cups_array_t *quotas; /* Quota records */ | |
ef416fc2 | 77 | int deny_users, /* 1 = deny, 0 = allow */ |
78 | num_users; /* Number of allowed/denied users */ | |
79 | const char **users; /* Allowed/denied users */ | |
80 | int num_history; /* Number of history collections */ | |
81 | ipp_t **history; /* History data */ | |
82 | int sequence_number; /* Increasing sequence number */ | |
e00b005a | 83 | #ifdef __APPLE__ |
84 | char *recoverable; /* com.apple.print.recoverable-message */ | |
85 | #endif /* __APPLE__ */ | |
ef416fc2 | 86 | } cupsd_printer_t; |
87 | ||
88 | ||
89 | /* | |
90 | * Globals... | |
91 | */ | |
92 | ||
93 | VAR ipp_t *CommonData VALUE(NULL); | |
94 | /* Common printer object attrs */ | |
95 | VAR cups_array_t *Printers VALUE(NULL), | |
96 | /* Printer list */ | |
97 | *ImplicitPrinters VALUE(NULL); | |
98 | /* Implicit class printers */ | |
99 | VAR cupsd_printer_t *DefaultPrinter VALUE(NULL); | |
100 | /* Default printer */ | |
101 | VAR char *DefaultPolicy VALUE(NULL); | |
102 | /* Default policy name */ | |
103 | VAR cupsd_policy_t *DefaultPolicyPtr | |
104 | VALUE(NULL); | |
105 | /* Pointer to default policy */ | |
106 | ||
107 | ||
108 | /* | |
109 | * Prototypes... | |
110 | */ | |
111 | ||
112 | extern cupsd_printer_t *cupsdAddPrinter(const char *name); | |
113 | extern void cupsdAddPrinterFilter(cupsd_printer_t *p, const char *filter); | |
114 | extern void cupsdAddPrinterHistory(cupsd_printer_t *p); | |
115 | extern void cupsdAddPrinterUser(cupsd_printer_t *p, const char *username); | |
116 | extern cupsd_quota_t *cupsdAddQuota(cupsd_printer_t *p, const char *username); | |
117 | extern void cupsdCreateCommonData(void); | |
118 | extern void cupsdDeleteAllPrinters(void); | |
119 | extern void cupsdDeletePrinter(cupsd_printer_t *p, int update); | |
120 | extern void cupsdDeletePrinterFilters(cupsd_printer_t *p); | |
121 | extern cupsd_printer_t *cupsdFindDest(const char *name); | |
122 | extern cupsd_printer_t *cupsdFindPrinter(const char *name); | |
123 | extern cupsd_quota_t *cupsdFindQuota(cupsd_printer_t *p, const char *username); | |
124 | extern void cupsdFreePrinterUsers(cupsd_printer_t *p); | |
125 | extern void cupsdFreeQuotas(cupsd_printer_t *p); | |
126 | extern void cupsdLoadAllPrinters(void); | |
127 | extern void cupsdSaveAllPrinters(void); | |
128 | extern void cupsdSetPrinterAttrs(cupsd_printer_t *p); | |
129 | extern void cupsdSetPrinterReasons(cupsd_printer_t *p, const char *s); | |
130 | extern void cupsdSetPrinterState(cupsd_printer_t *p, ipp_pstate_t s, int update); | |
131 | #define cupsdStartPrinter(p,u) cupsdSetPrinterState((p), IPP_PRINTER_IDLE, (u)) | |
132 | extern void cupsdStopPrinter(cupsd_printer_t *p, int update); | |
133 | extern void cupsdUpdatePrinters(void); | |
134 | extern cupsd_quota_t *cupsdUpdateQuota(cupsd_printer_t *p, const char *username, | |
135 | int pages, int k); | |
136 | extern const char *cupsdValidateDest(const char *hostname, | |
137 | const char *resource, | |
138 | cups_ptype_t *dtype, | |
139 | cupsd_printer_t **printer); | |
140 | extern void cupsdWritePrintcap(void); | |
141 | ||
142 | extern char *cupsdSanitizeURI(const char *uri, char *buffer, | |
143 | int buflen); | |
144 | ||
145 | ||
146 | /* | |
e00b005a | 147 | * End of "$Id: printers.h 5039 2006-02-01 16:29:57Z mike $". |
ef416fc2 | 148 | */ |