Skip to content

Commit 2a3cb9c

Browse files
committed
CUPS_PRINTER_xxx -> CUPS_PTYPE_xxx
1 parent 69eb6c0 commit 2a3cb9c

4 files changed

Lines changed: 96 additions & 95 deletions

File tree

cups/cups.h

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -196,33 +196,34 @@ typedef unsigned cups_media_flags_t; // Combined flags for @link cupsGetDestMedi
196196

197197
enum cups_ptype_e // Printer type/capability flags
198198
{
199-
CUPS_PRINTER_LOCAL = 0x0000, // Local printer or class
200-
CUPS_PRINTER_CLASS = 0x0001, // Printer class
201-
CUPS_PRINTER_REMOTE = 0x0002, // Remote printer or class
202-
CUPS_PRINTER_BW = 0x0004, // Can do B&W printing
203-
CUPS_PRINTER_COLOR = 0x0008, // Can do color printing
204-
CUPS_PRINTER_DUPLEX = 0x0010, // Can do two-sided printing
205-
CUPS_PRINTER_STAPLE = 0x0020, // Can staple output
206-
CUPS_PRINTER_COPIES = 0x0040, // Can do copies in hardware
207-
CUPS_PRINTER_COLLATE = 0x0080, // Can quickly collate copies
208-
CUPS_PRINTER_PUNCH = 0x0100, // Can punch output
209-
CUPS_PRINTER_COVER = 0x0200, // Can cover output
210-
CUPS_PRINTER_BIND = 0x0400, // Can bind output
211-
CUPS_PRINTER_SORT = 0x0800, // Can sort output
212-
CUPS_PRINTER_SMALL = 0x1000, // Can print on Letter/Legal/A4-size media
213-
CUPS_PRINTER_MEDIUM = 0x2000, // Can print on Tabloid/B/C/A3/A2-size media
214-
CUPS_PRINTER_LARGE = 0x4000, // Can print on D/E/A1/A0-size media
215-
CUPS_PRINTER_VARIABLE = 0x8000, // Can print on rolls and custom-size media
216-
CUPS_PRINTER_DEFAULT = 0x20000, // Default printer on network
217-
CUPS_PRINTER_FAX = 0x40000, // Fax queue
218-
CUPS_PRINTER_REJECTING = 0x80000, // Printer is rejecting jobs
219-
CUPS_PRINTER_NOT_SHARED = 0x200000, // Printer is not shared
220-
CUPS_PRINTER_AUTHENTICATED = 0x400000, // Printer requires authentication
221-
CUPS_PRINTER_COMMANDS = 0x800000, // Printer supports maintenance commands
222-
CUPS_PRINTER_DISCOVERED = 0x1000000, // Printer was discovered
223-
CUPS_PRINTER_SCANNER = 0x2000000, // Scanner-only device
224-
CUPS_PRINTER_MFP = 0x4000000, // Printer with scanning capabilities
225-
CUPS_PRINTER_OPTIONS = 0x6fffc // ~(CLASS | REMOTE | IMPLICIT | DEFAULT | FAX | REJECTING | DELETE | NOT_SHARED | AUTHENTICATED | COMMANDS | DISCOVERED) @private@
199+
CUPS_PTYPE_LOCAL = 0x0000, // Local printer or class
200+
CUPS_PTYPE_CLASS = 0x0001, // Printer class
201+
CUPS_PTYPE_REMOTE = 0x0002, // Remote printer or class
202+
CUPS_PTYPE_BW = 0x0004, // Can do B&W printing
203+
CUPS_PTYPE_COLOR = 0x0008, // Can do color printing
204+
CUPS_PTYPE_DUPLEX = 0x0010, // Can do two-sided printing
205+
CUPS_PTYPE_STAPLE = 0x0020, // Can staple output
206+
CUPS_PTYPE_COPIES = 0x0040, // Can do copies in hardware
207+
CUPS_PTYPE_COLLATE = 0x0080, // Can quickly collate copies
208+
CUPS_PTYPE_PUNCH = 0x0100, // Can punch output
209+
CUPS_PTYPE_COVER = 0x0200, // Can cover output
210+
CUPS_PTYPE_BIND = 0x0400, // Can bind output
211+
CUPS_PTYPE_SORT = 0x0800, // Can sort output
212+
CUPS_PTYPE_SMALL = 0x1000, // Can print on Letter/Legal/A4-size media
213+
CUPS_PTYPE_MEDIUM = 0x2000, // Can print on Tabloid/B/C/A3/A2-size media
214+
CUPS_PTYPE_LARGE = 0x4000, // Can print on D/E/A1/A0-size media
215+
CUPS_PTYPE_VARIABLE = 0x8000, // Can print on rolls and custom-size media
216+
CUPS_PTYPE_DEFAULT = 0x20000, // Default printer on network
217+
CUPS_PTYPE_FAX = 0x40000, // Fax queue
218+
CUPS_PTYPE_REJECTING = 0x80000, // Printer is rejecting jobs
219+
CUPS_PTYPE_NOT_SHARED = 0x200000, // Printer is not shared
220+
CUPS_PTYPE_AUTHENTICATED = 0x400000, // Printer requires authentication
221+
CUPS_PTYPE_COMMANDS = 0x800000, // Printer supports maintenance commands
222+
CUPS_PTYPE_DISCOVERED = 0x1000000, // Printer was discovered
223+
CUPS_PTYPE_SCANNER = 0x2000000, // Scanner-only device
224+
CUPS_PTYPE_MFP = 0x4000000, // Printer with scanning capabilities
225+
CUPS_PTYPE_FOLD = 0x10000000, // Can fold output
226+
CUPS_PTYPE_OPTIONS = 0x6fffc // ~(CLASS | REMOTE | IMPLICIT | DEFAULT | FAX | REJECTING | DELETE | NOT_SHARED | AUTHENTICATED | COMMANDS | DISCOVERED) @private@
226227
};
227228
typedef unsigned cups_ptype_t; // Combined printer type/capability flags
228229

cups/dest.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ _cupsCreateDest(const char *name, // I - Printer name
735735
//
736736
// The "type" and "mask" arguments allow the caller to filter the destinations
737737
// that are enumerated. Passing `0` for both will enumerate all printers. The
738-
// constant `CUPS_PRINTER_DISCOVERED` is used to filter on destinations that are
738+
// constant `CUPS_PTYPE_DISCOVERED` is used to filter on destinations that are
739739
// available but have not yet been added locally.
740740
//
741741
// Enumeration happens on the current thread and does not return until all
@@ -1324,7 +1324,7 @@ cupsGetDests(http_t *http, // I - Connection to server or @code CUPS_HTTP_
13241324
if (!httpAddrIsLocalhost(httpGetAddress(http)))
13251325
{
13261326
// When talking to a remote cupsd, just enumerate printers on the remote cupsd.
1327-
cups_enum_dests(http, 0, _CUPS_DNSSD_GET_DESTS, NULL, 0, CUPS_PRINTER_DISCOVERED, (cups_dest_cb_t)cups_get_cb, &data);
1327+
cups_enum_dests(http, 0, _CUPS_DNSSD_GET_DESTS, NULL, 0, CUPS_PTYPE_DISCOVERED, (cups_dest_cb_t)cups_get_cb, &data);
13281328
}
13291329
else
13301330
{
@@ -2257,7 +2257,7 @@ cups_dest_query_cb(
22572257
model[256], // Model
22582258
uriname[1024], // Name for URI
22592259
uri[1024]; // Printer URI
2260-
cups_ptype_t type = CUPS_PRINTER_DISCOVERED | CUPS_PRINTER_BW;
2260+
cups_ptype_t type = CUPS_PTYPE_DISCOVERED | CUPS_PTYPE_BW;
22612261
// Printer type
22622262
bool saw_printer_type = false;
22632263
// Did we see a printer-type key?
@@ -2364,66 +2364,66 @@ cups_dest_query_cb(
23642364
{
23652365
// Value is either NNNN or 0xXXXX
23662366
saw_printer_type = true;
2367-
type = (cups_ptype_t)strtol(value, NULL, 0) | CUPS_PRINTER_DISCOVERED;
2367+
type = (cups_ptype_t)strtol(value, NULL, 0) | CUPS_PTYPE_DISCOVERED;
23682368
}
23692369
else if (!saw_printer_type)
23702370
{
23712371
if (!_cups_strcasecmp(key, "air") && !_cups_strcasecmp(value, "t"))
23722372
{
2373-
type |= CUPS_PRINTER_AUTHENTICATED;
2373+
type |= CUPS_PTYPE_AUTHENTICATED;
23742374
}
23752375
else if (!_cups_strcasecmp(key, "bind") && !_cups_strcasecmp(value, "t"))
23762376
{
2377-
type |= CUPS_PRINTER_BIND;
2377+
type |= CUPS_PTYPE_BIND;
23782378
}
23792379
else if (!_cups_strcasecmp(key, "collate") && !_cups_strcasecmp(value, "t"))
23802380
{
2381-
type |= CUPS_PRINTER_COLLATE;
2381+
type |= CUPS_PTYPE_COLLATE;
23822382
}
23832383
else if (!_cups_strcasecmp(key, "color") && !_cups_strcasecmp(value, "t"))
23842384
{
2385-
type |= CUPS_PRINTER_COLOR;
2385+
type |= CUPS_PTYPE_COLOR;
23862386
}
23872387
else if (!_cups_strcasecmp(key, "copies") && !_cups_strcasecmp(value, "t"))
23882388
{
2389-
type |= CUPS_PRINTER_COPIES;
2389+
type |= CUPS_PTYPE_COPIES;
23902390
}
23912391
else if (!_cups_strcasecmp(key, "duplex") && !_cups_strcasecmp(value, "t"))
23922392
{
2393-
type |= CUPS_PRINTER_DUPLEX;
2393+
type |= CUPS_PTYPE_DUPLEX;
23942394
}
23952395
else if (!_cups_strcasecmp(key, "fax") && !_cups_strcasecmp(value, "t"))
23962396
{
2397-
type |= CUPS_PRINTER_MFP;
2397+
type |= CUPS_PTYPE_MFP;
23982398
}
23992399
else if (!_cups_strcasecmp(key, "papercustom") && !_cups_strcasecmp(value, "t"))
24002400
{
2401-
type |= CUPS_PRINTER_VARIABLE;
2401+
type |= CUPS_PTYPE_VARIABLE;
24022402
}
24032403
else if (!_cups_strcasecmp(key, "papermax"))
24042404
{
24052405
if (!_cups_strcasecmp(value, "legal-a4"))
2406-
type |= CUPS_PRINTER_SMALL;
2406+
type |= CUPS_PTYPE_SMALL;
24072407
else if (!_cups_strcasecmp(value, "isoc-a2"))
2408-
type |= CUPS_PRINTER_MEDIUM;
2408+
type |= CUPS_PTYPE_MEDIUM;
24092409
else if (!_cups_strcasecmp(value, ">isoc-a2"))
2410-
type |= CUPS_PRINTER_LARGE;
2410+
type |= CUPS_PTYPE_LARGE;
24112411
}
24122412
else if (!_cups_strcasecmp(key, "punch") && !_cups_strcasecmp(value, "t"))
24132413
{
2414-
type |= CUPS_PRINTER_PUNCH;
2414+
type |= CUPS_PTYPE_PUNCH;
24152415
}
24162416
else if (!_cups_strcasecmp(key, "scan") && !_cups_strcasecmp(value, "t"))
24172417
{
2418-
type |= CUPS_PRINTER_MFP;
2418+
type |= CUPS_PTYPE_MFP;
24192419
}
24202420
else if (!_cups_strcasecmp(key, "sort") && !_cups_strcasecmp(value, "t"))
24212421
{
2422-
type |= CUPS_PRINTER_SORT;
2422+
type |= CUPS_PTYPE_SORT;
24232423
}
24242424
else if (!_cups_strcasecmp(key, "staple") && !_cups_strcasecmp(value, "t"))
24252425
{
2426-
type |= CUPS_PRINTER_STAPLE;
2426+
type |= CUPS_PTYPE_STAPLE;
24272427
}
24282428
}
24292429
}
@@ -2695,7 +2695,7 @@ cups_enum_dests(
26952695
data.user_data = user_data;
26962696
data.devices = cupsArrayNew((cups_array_cb_t)cups_dnssd_compare_devices, NULL, NULL, 0, NULL, (cups_afree_cb_t)cups_dnssd_free_device);
26972697

2698-
if (!(mask & CUPS_PRINTER_DISCOVERED) || !(type & CUPS_PRINTER_DISCOVERED))
2698+
if (!(mask & CUPS_PTYPE_DISCOVERED) || !(type & CUPS_PTYPE_DISCOVERED))
26992699
{
27002700
// Get the list of local printers and pass them to the callback function...
27012701
num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &dests, type, mask);
@@ -2776,7 +2776,7 @@ cups_enum_dests(
27762776
}
27772777

27782778
// Return early if the caller doesn't want to do discovery...
2779-
if ((mask & CUPS_PRINTER_DISCOVERED) && !(type & CUPS_PRINTER_DISCOVERED))
2779+
if ((mask & CUPS_PTYPE_DISCOVERED) && !(type & CUPS_PTYPE_DISCOVERED))
27802780
goto enum_finished;
27812781

27822782
// Get DNS-SD printers...

cups/testcups.c

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ main(int argc, // I - Number of command-line arguments
5353
{
5454
// ./testcups enum [bw color mono duplex simplex staple copies collate
5555
// punch cover bind sort mfp printer large medium small]
56-
cups_ptype_t mask = CUPS_PRINTER_LOCAL,
56+
cups_ptype_t mask = CUPS_PTYPE_LOCAL,
5757
// Printer type mask
58-
type = CUPS_PRINTER_LOCAL;
58+
type = CUPS_PTYPE_LOCAL;
5959
// Printer type
6060
int msec = 0; // Timeout in milliseconds
6161

@@ -68,85 +68,85 @@ main(int argc, // I - Number of command-line arguments
6868
}
6969
else if (!_cups_strcasecmp(argv[i], "bw"))
7070
{
71-
mask |= CUPS_PRINTER_BW;
72-
type |= CUPS_PRINTER_BW;
71+
mask |= CUPS_PTYPE_BW;
72+
type |= CUPS_PTYPE_BW;
7373
}
7474
else if (!_cups_strcasecmp(argv[i], "color"))
7575
{
76-
mask |= CUPS_PRINTER_COLOR;
77-
type |= CUPS_PRINTER_COLOR;
76+
mask |= CUPS_PTYPE_COLOR;
77+
type |= CUPS_PTYPE_COLOR;
7878
}
7979
else if (!_cups_strcasecmp(argv[i], "mono"))
8080
{
81-
mask |= CUPS_PRINTER_COLOR;
81+
mask |= CUPS_PTYPE_COLOR;
8282
}
8383
else if (!_cups_strcasecmp(argv[i], "duplex"))
8484
{
85-
mask |= CUPS_PRINTER_DUPLEX;
86-
type |= CUPS_PRINTER_DUPLEX;
85+
mask |= CUPS_PTYPE_DUPLEX;
86+
type |= CUPS_PTYPE_DUPLEX;
8787
}
8888
else if (!_cups_strcasecmp(argv[i], "simplex"))
8989
{
90-
mask |= CUPS_PRINTER_DUPLEX;
90+
mask |= CUPS_PTYPE_DUPLEX;
9191
}
9292
else if (!_cups_strcasecmp(argv[i], "staple"))
9393
{
94-
mask |= CUPS_PRINTER_STAPLE;
95-
type |= CUPS_PRINTER_STAPLE;
94+
mask |= CUPS_PTYPE_STAPLE;
95+
type |= CUPS_PTYPE_STAPLE;
9696
}
9797
else if (!_cups_strcasecmp(argv[i], "copies"))
9898
{
99-
mask |= CUPS_PRINTER_COPIES;
100-
type |= CUPS_PRINTER_COPIES;
99+
mask |= CUPS_PTYPE_COPIES;
100+
type |= CUPS_PTYPE_COPIES;
101101
}
102102
else if (!_cups_strcasecmp(argv[i], "collate"))
103103
{
104-
mask |= CUPS_PRINTER_COLLATE;
105-
type |= CUPS_PRINTER_COLLATE;
104+
mask |= CUPS_PTYPE_COLLATE;
105+
type |= CUPS_PTYPE_COLLATE;
106106
}
107107
else if (!_cups_strcasecmp(argv[i], "punch"))
108108
{
109-
mask |= CUPS_PRINTER_PUNCH;
110-
type |= CUPS_PRINTER_PUNCH;
109+
mask |= CUPS_PTYPE_PUNCH;
110+
type |= CUPS_PTYPE_PUNCH;
111111
}
112112
else if (!_cups_strcasecmp(argv[i], "cover"))
113113
{
114-
mask |= CUPS_PRINTER_COVER;
115-
type |= CUPS_PRINTER_COVER;
114+
mask |= CUPS_PTYPE_COVER;
115+
type |= CUPS_PTYPE_COVER;
116116
}
117117
else if (!_cups_strcasecmp(argv[i], "bind"))
118118
{
119-
mask |= CUPS_PRINTER_BIND;
120-
type |= CUPS_PRINTER_BIND;
119+
mask |= CUPS_PTYPE_BIND;
120+
type |= CUPS_PTYPE_BIND;
121121
}
122122
else if (!_cups_strcasecmp(argv[i], "sort"))
123123
{
124-
mask |= CUPS_PRINTER_SORT;
125-
type |= CUPS_PRINTER_SORT;
124+
mask |= CUPS_PTYPE_SORT;
125+
type |= CUPS_PTYPE_SORT;
126126
}
127127
else if (!_cups_strcasecmp(argv[i], "mfp"))
128128
{
129-
mask |= CUPS_PRINTER_MFP;
130-
type |= CUPS_PRINTER_MFP;
129+
mask |= CUPS_PTYPE_MFP;
130+
type |= CUPS_PTYPE_MFP;
131131
}
132132
else if (!_cups_strcasecmp(argv[i], "printer"))
133133
{
134-
mask |= CUPS_PRINTER_MFP;
134+
mask |= CUPS_PTYPE_MFP;
135135
}
136136
else if (!_cups_strcasecmp(argv[i], "large"))
137137
{
138-
mask |= CUPS_PRINTER_LARGE;
139-
type |= CUPS_PRINTER_LARGE;
138+
mask |= CUPS_PTYPE_LARGE;
139+
type |= CUPS_PTYPE_LARGE;
140140
}
141141
else if (!_cups_strcasecmp(argv[i], "medium"))
142142
{
143-
mask |= CUPS_PRINTER_MEDIUM;
144-
type |= CUPS_PRINTER_MEDIUM;
143+
mask |= CUPS_PTYPE_MEDIUM;
144+
type |= CUPS_PTYPE_MEDIUM;
145145
}
146146
else if (!_cups_strcasecmp(argv[i], "small"))
147147
{
148-
mask |= CUPS_PRINTER_SMALL;
149-
type |= CUPS_PRINTER_SMALL;
148+
mask |= CUPS_PTYPE_SMALL;
149+
type |= CUPS_PTYPE_SMALL;
150150
}
151151
else
152152
{

cups/testdest.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,38 +68,38 @@ main(int argc, // I - Number of command-line arguments
6868
{
6969
if (!strcmp(argv[i], "grayscale"))
7070
{
71-
type |= CUPS_PRINTER_BW;
72-
mask |= CUPS_PRINTER_BW;
71+
type |= CUPS_PTYPE_BW;
72+
mask |= CUPS_PTYPE_BW;
7373
}
7474
else if (!strcmp(argv[i], "color"))
7575
{
76-
type |= CUPS_PRINTER_COLOR;
77-
mask |= CUPS_PRINTER_COLOR;
76+
type |= CUPS_PTYPE_COLOR;
77+
mask |= CUPS_PTYPE_COLOR;
7878
}
7979
else if (!strcmp(argv[i], "duplex"))
8080
{
81-
type |= CUPS_PRINTER_DUPLEX;
82-
mask |= CUPS_PRINTER_DUPLEX;
81+
type |= CUPS_PTYPE_DUPLEX;
82+
mask |= CUPS_PTYPE_DUPLEX;
8383
}
8484
else if (!strcmp(argv[i], "staple"))
8585
{
86-
type |= CUPS_PRINTER_STAPLE;
87-
mask |= CUPS_PRINTER_STAPLE;
86+
type |= CUPS_PTYPE_STAPLE;
87+
mask |= CUPS_PTYPE_STAPLE;
8888
}
8989
else if (!strcmp(argv[i], "small"))
9090
{
91-
type |= CUPS_PRINTER_SMALL;
92-
mask |= CUPS_PRINTER_SMALL;
91+
type |= CUPS_PTYPE_SMALL;
92+
mask |= CUPS_PTYPE_SMALL;
9393
}
9494
else if (!strcmp(argv[i], "medium"))
9595
{
96-
type |= CUPS_PRINTER_MEDIUM;
97-
mask |= CUPS_PRINTER_MEDIUM;
96+
type |= CUPS_PTYPE_MEDIUM;
97+
mask |= CUPS_PTYPE_MEDIUM;
9898
}
9999
else if (!strcmp(argv[i], "large"))
100100
{
101-
type |= CUPS_PRINTER_LARGE;
102-
mask |= CUPS_PRINTER_LARGE;
101+
type |= CUPS_PTYPE_LARGE;
102+
mask |= CUPS_PTYPE_LARGE;
103103
}
104104
else
105105
usage(argv[i]);

0 commit comments

Comments
 (0)