]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
fa73b229 | 2 | * "$Id: printers.h 4970 2006-01-24 14:05: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.) */ | |
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 */ | |
83 | } cupsd_printer_t; | |
84 | ||
85 | ||
86 | /* | |
87 | * Globals... | |
88 | */ | |
89 | ||
90 | VAR ipp_t *CommonData VALUE(NULL); | |
91 | /* Common printer object attrs */ | |
92 | VAR cups_array_t *Printers VALUE(NULL), | |
93 | /* Printer list */ | |
94 | *ImplicitPrinters VALUE(NULL); | |
95 | /* Implicit class printers */ | |
96 | VAR cupsd_printer_t *DefaultPrinter VALUE(NULL); | |
97 | /* Default printer */ | |
98 | VAR char *DefaultPolicy VALUE(NULL); | |
99 | /* Default policy name */ | |
100 | VAR cupsd_policy_t *DefaultPolicyPtr | |
101 | VALUE(NULL); | |
102 | /* Pointer to default policy */ | |
103 | ||
104 | ||
105 | /* | |
106 | * Prototypes... | |
107 | */ | |
108 | ||
109 | extern cupsd_printer_t *cupsdAddPrinter(const char *name); | |
110 | extern void cupsdAddPrinterFilter(cupsd_printer_t *p, const char *filter); | |
111 | extern void cupsdAddPrinterHistory(cupsd_printer_t *p); | |
112 | extern void cupsdAddPrinterUser(cupsd_printer_t *p, const char *username); | |
113 | extern cupsd_quota_t *cupsdAddQuota(cupsd_printer_t *p, const char *username); | |
114 | extern void cupsdCreateCommonData(void); | |
115 | extern void cupsdDeleteAllPrinters(void); | |
116 | extern void cupsdDeletePrinter(cupsd_printer_t *p, int update); | |
117 | extern void cupsdDeletePrinterFilters(cupsd_printer_t *p); | |
118 | extern cupsd_printer_t *cupsdFindDest(const char *name); | |
119 | extern cupsd_printer_t *cupsdFindPrinter(const char *name); | |
120 | extern cupsd_quota_t *cupsdFindQuota(cupsd_printer_t *p, const char *username); | |
121 | extern void cupsdFreePrinterUsers(cupsd_printer_t *p); | |
122 | extern void cupsdFreeQuotas(cupsd_printer_t *p); | |
123 | extern void cupsdLoadAllPrinters(void); | |
124 | extern void cupsdSaveAllPrinters(void); | |
125 | extern void cupsdSetPrinterAttrs(cupsd_printer_t *p); | |
126 | extern void cupsdSetPrinterReasons(cupsd_printer_t *p, const char *s); | |
127 | extern void cupsdSetPrinterState(cupsd_printer_t *p, ipp_pstate_t s, int update); | |
128 | #define cupsdStartPrinter(p,u) cupsdSetPrinterState((p), IPP_PRINTER_IDLE, (u)) | |
129 | extern void cupsdStopPrinter(cupsd_printer_t *p, int update); | |
130 | extern void cupsdUpdatePrinters(void); | |
131 | extern cupsd_quota_t *cupsdUpdateQuota(cupsd_printer_t *p, const char *username, | |
132 | int pages, int k); | |
133 | extern const char *cupsdValidateDest(const char *hostname, | |
134 | const char *resource, | |
135 | cups_ptype_t *dtype, | |
136 | cupsd_printer_t **printer); | |
137 | extern void cupsdWritePrintcap(void); | |
138 | ||
139 | extern char *cupsdSanitizeURI(const char *uri, char *buffer, | |
140 | int buflen); | |
141 | ||
142 | ||
143 | /* | |
fa73b229 | 144 | * End of "$Id: printers.h 4970 2006-01-24 14:05:45Z mike $". |
ef416fc2 | 145 | */ |