]>
Commit | Line | Data |
---|---|---|
a129ddbd | 1 | /* |
753453e4 | 2 | * "$Id: printers.h,v 1.22.2.1 2001/12/26 16:52:55 mike Exp $" |
a129ddbd | 3 | * |
a9de544f | 4 | * Printer definitions for the Common UNIX Printing System (CUPS) scheduler. |
a129ddbd | 5 | * |
d2935a0f | 6 | * Copyright 1997-2001 by Easy Software Products, all rights reserved. |
a129ddbd | 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 | |
8784b6a6 | 17 | * 44141 Airport View Drive, Suite 204 |
a129ddbd | 18 | * Hollywood, Maryland 20636-3111 USA |
19 | * | |
20 | * Voice: (301) 373-9603 | |
21 | * EMail: cups-info@cups.org | |
22 | * WWW: http://www.cups.org | |
a129ddbd | 23 | */ |
24 | ||
d7845573 | 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 | } quota_t; | |
36 | ||
37 | ||
fd8b1cf8 | 38 | /* |
cbbfcc63 | 39 | * Printer/class information structure... |
fd8b1cf8 | 40 | */ |
a129ddbd | 41 | |
a9de544f | 42 | typedef struct printer_str |
43 | { | |
44 | struct printer_str *next; /* Next printer in list */ | |
a74b005d | 45 | char uri[HTTP_MAX_URI], /* Printer URI */ |
1d2c70a6 | 46 | hostname[HTTP_MAX_HOST],/* Host printer resides on */ |
f3d580b9 | 47 | name[IPP_MAX_NAME], /* Printer name */ |
48 | location[IPP_MAX_NAME], /* Location code */ | |
a2c6b8b1 | 49 | make_model[IPP_MAX_NAME],/* Make and model */ |
753453e4 | 50 | info[IPP_MAX_NAME]; /* Description */ |
f3d580b9 | 51 | int accepting; /* Accepting jobs? */ |
a74b005d | 52 | ipp_pstate_t state; /* Printer state */ |
96df88bb | 53 | char state_message[1024]; /* Printer state message */ |
a9de544f | 54 | time_t state_time; /* Time at this state */ |
a3e17a89 | 55 | char job_sheets[2][IPP_MAX_NAME]; |
56 | /* Banners/job sheets */ | |
d6de4648 | 57 | cups_ptype_t type; /* Printer type (color, small, etc.) */ |
58 | time_t browse_time; /* Last time update was sent/received */ | |
f3d580b9 | 59 | char device_uri[HTTP_MAX_URI],/* Device URI */ |
6abc7437 | 60 | backend[1024]; /* Backend to use */ |
61 | mime_type_t *filetype; /* Pseudo-filetype for printer */ | |
a9de544f | 62 | void *job; /* Current job in queue */ |
1d2c70a6 | 63 | ipp_t *attrs; /* Attributes supported by this printer */ |
21eb8c86 | 64 | int num_printers, /* Number of printers in class */ |
65 | last_printer; /* Last printer job was sent to */ | |
cbbfcc63 | 66 | struct printer_str **printers; /* Printers in class */ |
d7845573 | 67 | int quota_period, /* Period for quotas */ |
68 | page_limit, /* Maximum number of pages */ | |
69 | k_limit, /* Maximum number of kilobytes */ | |
70 | num_quotas; /* Number of quota records */ | |
71 | quota_t *quotas; /* Quota records */ | |
72 | int deny_users, /* 1 = deny, 0 = allow */ | |
73 | num_users; /* Number of allowed/denied users */ | |
74 | const char **users; /* Allowed/denied users */ | |
a9de544f | 75 | } printer_t; |
76 | ||
77 | ||
78 | /* | |
79 | * Globals... | |
80 | */ | |
81 | ||
1d2c70a6 | 82 | VAR printer_t *Printers VALUE(NULL); /* Printer list */ |
cbbfcc63 | 83 | VAR printer_t *DefaultPrinter VALUE(NULL); |
1d2c70a6 | 84 | /* Default printer */ |
a9de544f | 85 | |
86 | /* | |
87 | * Prototypes... | |
88 | */ | |
89 | ||
1049abbe | 90 | extern printer_t *AddPrinter(const char *name); |
d7845573 | 91 | extern void AddPrinterFilter(printer_t *p, const char *filter); |
92 | extern void AddPrinterUser(printer_t *p, const char *username); | |
93 | extern quota_t *AddQuota(printer_t *p, const char *username); | |
a9de544f | 94 | extern void DeleteAllPrinters(void); |
95 | extern void DeletePrinter(printer_t *p); | |
20b85438 | 96 | extern void DeletePrinterFilters(printer_t *p); |
1049abbe | 97 | extern printer_t *FindPrinter(const char *name); |
d7845573 | 98 | extern quota_t *FindQuota(printer_t *p, const char *username); |
99 | extern void FreePrinterUsers(printer_t *p); | |
04d756fc | 100 | extern void FreeQuotas(printer_t *p); |
a9de544f | 101 | extern void LoadAllPrinters(void); |
102 | extern void SaveAllPrinters(void); | |
cbbfcc63 | 103 | extern void SetPrinterAttrs(printer_t *p); |
d6de4648 | 104 | extern void SetPrinterState(printer_t *p, ipp_pstate_t s); |
1cab4605 | 105 | extern void SortPrinters(void); |
d6de4648 | 106 | #define StartPrinter(p) SetPrinterState((p), IPP_PRINTER_IDLE) |
a9de544f | 107 | extern void StopPrinter(printer_t *p); |
d7845573 | 108 | extern quota_t *UpdateQuota(printer_t *p, const char *username, |
109 | int pages, int k); | |
ed3e11d8 | 110 | extern const char *ValidateDest(const char *hostname, |
111 | const char *resource, | |
112 | cups_ptype_t *dtype); | |
a9de544f | 113 | |
a129ddbd | 114 | |
115 | /* | |
753453e4 | 116 | * End of "$Id: printers.h,v 1.22.2.1 2001/12/26 16:52:55 mike Exp $". |
a129ddbd | 117 | */ |