Add CUPS_PTYPE_FOLD to support fold finishing.
enum cups_ptype_e // Printer type/capability flags
{
- CUPS_PRINTER_LOCAL = 0x0000, // Local printer or class
- CUPS_PRINTER_CLASS = 0x0001, // Printer class
- CUPS_PRINTER_REMOTE = 0x0002, // Remote printer or class
- CUPS_PRINTER_BW = 0x0004, // Can do B&W printing
- CUPS_PRINTER_COLOR = 0x0008, // Can do color printing
- CUPS_PRINTER_DUPLEX = 0x0010, // Can do two-sided printing
- CUPS_PRINTER_STAPLE = 0x0020, // Can staple output
- CUPS_PRINTER_COPIES = 0x0040, // Can do copies in hardware
- CUPS_PRINTER_COLLATE = 0x0080, // Can quickly collate copies
- CUPS_PRINTER_PUNCH = 0x0100, // Can punch output
- CUPS_PRINTER_COVER = 0x0200, // Can cover output
- CUPS_PRINTER_BIND = 0x0400, // Can bind output
- CUPS_PRINTER_SORT = 0x0800, // Can sort output
- CUPS_PRINTER_SMALL = 0x1000, // Can print on Letter/Legal/A4-size media
- CUPS_PRINTER_MEDIUM = 0x2000, // Can print on Tabloid/B/C/A3/A2-size media
- CUPS_PRINTER_LARGE = 0x4000, // Can print on D/E/A1/A0-size media
- CUPS_PRINTER_VARIABLE = 0x8000, // Can print on rolls and custom-size media
- CUPS_PRINTER_DEFAULT = 0x20000, // Default printer on network
- CUPS_PRINTER_FAX = 0x40000, // Fax queue
- CUPS_PRINTER_REJECTING = 0x80000, // Printer is rejecting jobs
- CUPS_PRINTER_NOT_SHARED = 0x200000, // Printer is not shared
- CUPS_PRINTER_AUTHENTICATED = 0x400000, // Printer requires authentication
- CUPS_PRINTER_COMMANDS = 0x800000, // Printer supports maintenance commands
- CUPS_PRINTER_DISCOVERED = 0x1000000, // Printer was discovered
- CUPS_PRINTER_SCANNER = 0x2000000, // Scanner-only device
- CUPS_PRINTER_MFP = 0x4000000, // Printer with scanning capabilities
- CUPS_PRINTER_3D = 0x8000000, // Printer with 3D capabilities @exclude all@ @private@ @deprecated@
- CUPS_PRINTER_OPTIONS = 0x6fffc // ~(CLASS | REMOTE | IMPLICIT | DEFAULT | FAX | REJECTING | DELETE | NOT_SHARED | AUTHENTICATED | COMMANDS | DISCOVERED) @private@
+ CUPS_PTYPE_LOCAL = 0x0000, // Local printer or class
+ CUPS_PTYPE_CLASS = 0x0001, // Printer class
+ CUPS_PTYPE_REMOTE = 0x0002, // Remote printer or class
+ CUPS_PTYPE_BW = 0x0004, // Can do B&W printing
+ CUPS_PTYPE_COLOR = 0x0008, // Can do color printing
+ CUPS_PTYPE_DUPLEX = 0x0010, // Can do two-sided printing
+ CUPS_PTYPE_STAPLE = 0x0020, // Can staple output
+ CUPS_PTYPE_COPIES = 0x0040, // Can do copies in hardware
+ CUPS_PTYPE_COLLATE = 0x0080, // Can quickly collate copies
+ CUPS_PTYPE_PUNCH = 0x0100, // Can punch output
+ CUPS_PTYPE_COVER = 0x0200, // Can cover output
+ CUPS_PTYPE_BIND = 0x0400, // Can bind output
+ CUPS_PTYPE_SORT = 0x0800, // Can sort output
+ CUPS_PTYPE_SMALL = 0x1000, // Can print on Letter/Legal/A4-size media
+ CUPS_PTYPE_MEDIUM = 0x2000, // Can print on Tabloid/B/C/A3/A2-size media
+ CUPS_PTYPE_LARGE = 0x4000, // Can print on D/E/A1/A0-size media
+ CUPS_PTYPE_VARIABLE = 0x8000, // Can print on rolls and custom-size media
+ CUPS_PTYPE_DEFAULT = 0x20000, // Default printer on network
+ CUPS_PTYPE_FAX = 0x40000, // Fax queue
+ CUPS_PTYPE_REJECTING = 0x80000, // Printer is rejecting jobs
+ CUPS_PTYPE_NOT_SHARED = 0x200000, // Printer is not shared
+ CUPS_PTYPE_AUTHENTICATED = 0x400000, // Printer requires authentication
+ CUPS_PTYPE_COMMANDS = 0x800000, // Printer supports maintenance commands
+ CUPS_PTYPE_DISCOVERED = 0x1000000, // Printer was discovered
+ CUPS_PTYPE_SCANNER = 0x2000000, // Scanner-only device
+ CUPS_PTYPE_MFP = 0x4000000, // Printer with scanning capabilities
+ CUPS_PTYPE_3D = 0x8000000, // Printer with 3D capabilities @exclude all@ @private@ @deprecated@
+ CUPS_PTYPE_FOLD = 0x10000000, // Can fold output @since CUPS 2.5@
+ CUPS_PTYPE_OPTIONS = 0x1006fffc // ~(CLASS | REMOTE | IMPLICIT | DEFAULT | FAX | REJECTING | DELETE | NOT_SHARED | AUTHENTICATED | COMMANDS | DISCOVERED) @private@
};
+# ifndef _CUPS_NO_DEPRECATED
+# define CUPS_PRINTER_LOCAL CUPS_PTYPE_LOCAL
+# define CUPS_PRINTER_CLASS CUPS_PTYPE_CLASS
+# define CUPS_PRINTER_REMOTE CUPS_PTYPE_REMOTE
+# define CUPS_PRINTER_BW CUPS_PTYPE_BW
+# define CUPS_PRINTER_COLOR CUPS_PTYPE_COLOR
+# define CUPS_PRINTER_DUPLEX CUPS_PTYPE_DUPLEX
+# define CUPS_PRINTER_STAPLE CUPS_PTYPE_STAPLE
+# define CUPS_PRINTER_COPIES CUPS_PTYPE_COPIES
+# define CUPS_PRINTER_COLLATE CUPS_PTYPE_COLLATE
+# define CUPS_PRINTER_PUNCH CUPS_PTYPE_PUNCH
+# define CUPS_PRINTER_COVER CUPS_PTYPE_COVER
+# define CUPS_PRINTER_BIND CUPS_PTYPE_BIND
+# define CUPS_PRINTER_SORT CUPS_PTYPE_SORT
+# define CUPS_PRINTER_SMALL CUPS_PTYPE_SMALL
+# define CUPS_PRINTER_MEDIUM CUPS_PTYPE_MEDIUM
+# define CUPS_PRINTER_LARGE CUPS_PTYPE_LARGE
+# define CUPS_PRINTER_VARIABLE CUPS_PTYPE_VARIABLE
+# define CUPS_PRINTER_DEFAULT CUPS_PTYPE_DEFAULT
+# define CUPS_PRINTER_FAX CUPS_PTYPE_FAX
+# define CUPS_PRINTER_REJECTING CUPS_PTYPE_REJECTING
+# define CUPS_PRINTER_NOT CUPS_PTYPE_NOT
+# define CUPS_PRINTER_AUTHENTICATED CUPS_PTYPE_AUTHENTICATED
+# define CUPS_PRINTER_COMMANDS CUPS_PTYPE_COMMANDS
+# define CUPS_PRINTER_DISCOVERED CUPS_PTYPE_DISCOVERED
+# define CUPS_PRINTER_SCANNER CUPS_PTYPE_SCANNER
+# define CUPS_PRINTER_MFP CUPS_PTYPE_MFP
+# define CUPS_PRINTER_3D CUPS_PTYPE_3D
+# define CUPS_PRINTER_OPTIONS CUPS_PTYPE_OPTIONS
+# endif // !_CUPS_NO_DEPRECATED
typedef unsigned cups_ptype_t; // Combined printer type/capability flags
typedef enum cups_whichjobs_e // Which jobs for @link cupsGetJobs@
//
// The @code type@ and @code mask@ arguments allow the caller to filter the
// destinations that are enumerated. Passing 0 for both will enumerate all
-// printers. The constant @code CUPS_PRINTER_DISCOVERED@ is used to filter on
+// printers. The constant @code CUPS_PTYPE_DISCOVERED@ is used to filter on
// destinations that are available but have not yet been added locally.
//
// Enumeration happens on the current thread and does not return until all
//
// The @code type@ and @code mask@ arguments allow the caller to filter the
// destinations that are enumerated. Passing 0 for both will enumerate all
-// printers. The constant @code CUPS_PRINTER_DISCOVERED@ is used to filter on
+// printers. The constant @code CUPS_PTYPE_DISCOVERED@ is used to filter on
// destinations that are available but have not yet been added locally.
//
// Enumeration happens on the current thread and does not return until all
* cupsd.
*/
- cups_enum_dests(http, 0, _CUPS_DNSSD_GET_DESTS, NULL, 0, CUPS_PRINTER_DISCOVERED, (cups_dest_cb_t)cups_get_cb, &data);
+ cups_enum_dests(http, 0, _CUPS_DNSSD_GET_DESTS, NULL, 0, CUPS_PTYPE_DISCOVERED, (cups_dest_cb_t)cups_get_cb, &data);
}
else
{
model[256], // Model
uriname[1024], // Name for URI
uri[1024]; // Printer URI
- cups_ptype_t type = CUPS_PRINTER_DISCOVERED | CUPS_PRINTER_BW;
+ cups_ptype_t type = CUPS_PTYPE_DISCOVERED | CUPS_PTYPE_BW;
// Printer type
bool saw_printer_type = false;
// Did we see a printer-type key?
{
// Value is either NNNN or 0xXXXX
saw_printer_type = true;
- type = (cups_ptype_t)strtol(value, NULL, 0) | CUPS_PRINTER_DISCOVERED;
+ type = (cups_ptype_t)strtol(value, NULL, 0) | CUPS_PTYPE_DISCOVERED;
}
else if (!saw_printer_type)
{
if (!_cups_strcasecmp(key, "air") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_AUTHENTICATED;
+ type |= CUPS_PTYPE_AUTHENTICATED;
}
else if (!_cups_strcasecmp(key, "bind") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_BIND;
+ type |= CUPS_PTYPE_BIND;
}
else if (!_cups_strcasecmp(key, "collate") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_COLLATE;
+ type |= CUPS_PTYPE_COLLATE;
}
else if (!_cups_strcasecmp(key, "color") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_COLOR;
+ type |= CUPS_PTYPE_COLOR;
}
else if (!_cups_strcasecmp(key, "copies") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_COPIES;
+ type |= CUPS_PTYPE_COPIES;
}
else if (!_cups_strcasecmp(key, "duplex") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_DUPLEX;
+ type |= CUPS_PTYPE_DUPLEX;
}
else if (!_cups_strcasecmp(key, "fax") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_MFP;
+ type |= CUPS_PTYPE_MFP;
}
else if (!_cups_strcasecmp(key, "papercustom") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_VARIABLE;
+ type |= CUPS_PTYPE_VARIABLE;
}
else if (!_cups_strcasecmp(key, "papermax"))
{
if (!_cups_strcasecmp(value, "legal-a4"))
- type |= CUPS_PRINTER_SMALL;
+ type |= CUPS_PTYPE_SMALL;
else if (!_cups_strcasecmp(value, "isoc-a2"))
- type |= CUPS_PRINTER_MEDIUM;
+ type |= CUPS_PTYPE_MEDIUM;
else if (!_cups_strcasecmp(value, ">isoc-a2"))
- type |= CUPS_PRINTER_LARGE;
+ type |= CUPS_PTYPE_LARGE;
}
else if (!_cups_strcasecmp(key, "punch") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_PUNCH;
+ type |= CUPS_PTYPE_PUNCH;
}
else if (!_cups_strcasecmp(key, "scan") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_MFP;
+ type |= CUPS_PTYPE_MFP;
}
else if (!_cups_strcasecmp(key, "sort") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_SORT;
+ type |= CUPS_PTYPE_SORT;
}
else if (!_cups_strcasecmp(key, "staple") && !_cups_strcasecmp(value, "t"))
{
- type |= CUPS_PRINTER_STAPLE;
+ type |= CUPS_PTYPE_STAPLE;
}
}
}
data.user_data = user_data;
data.devices = cupsArrayNew3((cups_array_func_t)cups_dnssd_compare_devices, NULL, NULL, 0, NULL, (cups_afree_func_t)cups_dnssd_free_device);
- if (!(mask & CUPS_PRINTER_DISCOVERED) || !(type & CUPS_PRINTER_DISCOVERED))
+ if (!(mask & CUPS_PTYPE_DISCOVERED) || !(type & CUPS_PTYPE_DISCOVERED))
{
// Get the list of local printers and pass them to the callback function...
num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &dests, type, mask);
}
// Return early if the caller doesn't want to do discovery...
- if ((mask & CUPS_PRINTER_DISCOVERED) && !(type & CUPS_PRINTER_DISCOVERED))
+ if ((mask & CUPS_PTYPE_DISCOVERED) && !(type & CUPS_PTYPE_DISCOVERED))
goto enum_finished;
// Get DNS-SD printers...
{
if (!strcmp(argv[1], "enum"))
{
- cups_ptype_t mask = CUPS_PRINTER_LOCAL,
+ cups_ptype_t mask = CUPS_PTYPE_LOCAL,
/* Printer type mask */
- type = CUPS_PRINTER_LOCAL;
+ type = CUPS_PTYPE_LOCAL;
/* Printer type */
int msec = 0; /* Timeout in milliseconds */
msec = (int)(atof(argv[i]) * 1000);
else if (!_cups_strcasecmp(argv[i], "bw"))
{
- mask |= CUPS_PRINTER_BW;
- type |= CUPS_PRINTER_BW;
+ mask |= CUPS_PTYPE_BW;
+ type |= CUPS_PTYPE_BW;
}
else if (!_cups_strcasecmp(argv[i], "color"))
{
- mask |= CUPS_PRINTER_COLOR;
- type |= CUPS_PRINTER_COLOR;
+ mask |= CUPS_PTYPE_COLOR;
+ type |= CUPS_PTYPE_COLOR;
}
else if (!_cups_strcasecmp(argv[i], "mono"))
{
- mask |= CUPS_PRINTER_COLOR;
+ mask |= CUPS_PTYPE_COLOR;
}
else if (!_cups_strcasecmp(argv[i], "duplex"))
{
- mask |= CUPS_PRINTER_DUPLEX;
- type |= CUPS_PRINTER_DUPLEX;
+ mask |= CUPS_PTYPE_DUPLEX;
+ type |= CUPS_PTYPE_DUPLEX;
}
else if (!_cups_strcasecmp(argv[i], "simplex"))
{
- mask |= CUPS_PRINTER_DUPLEX;
+ mask |= CUPS_PTYPE_DUPLEX;
}
else if (!_cups_strcasecmp(argv[i], "staple"))
{
- mask |= CUPS_PRINTER_STAPLE;
- type |= CUPS_PRINTER_STAPLE;
+ mask |= CUPS_PTYPE_STAPLE;
+ type |= CUPS_PTYPE_STAPLE;
}
else if (!_cups_strcasecmp(argv[i], "copies"))
{
- mask |= CUPS_PRINTER_COPIES;
- type |= CUPS_PRINTER_COPIES;
+ mask |= CUPS_PTYPE_COPIES;
+ type |= CUPS_PTYPE_COPIES;
}
else if (!_cups_strcasecmp(argv[i], "collate"))
{
- mask |= CUPS_PRINTER_COLLATE;
- type |= CUPS_PRINTER_COLLATE;
+ mask |= CUPS_PTYPE_COLLATE;
+ type |= CUPS_PTYPE_COLLATE;
}
else if (!_cups_strcasecmp(argv[i], "punch"))
{
- mask |= CUPS_PRINTER_PUNCH;
- type |= CUPS_PRINTER_PUNCH;
+ mask |= CUPS_PTYPE_PUNCH;
+ type |= CUPS_PTYPE_PUNCH;
}
else if (!_cups_strcasecmp(argv[i], "cover"))
{
- mask |= CUPS_PRINTER_COVER;
- type |= CUPS_PRINTER_COVER;
+ mask |= CUPS_PTYPE_COVER;
+ type |= CUPS_PTYPE_COVER;
}
else if (!_cups_strcasecmp(argv[i], "bind"))
{
- mask |= CUPS_PRINTER_BIND;
- type |= CUPS_PRINTER_BIND;
+ mask |= CUPS_PTYPE_BIND;
+ type |= CUPS_PTYPE_BIND;
}
else if (!_cups_strcasecmp(argv[i], "sort"))
{
- mask |= CUPS_PRINTER_SORT;
- type |= CUPS_PRINTER_SORT;
+ mask |= CUPS_PTYPE_SORT;
+ type |= CUPS_PTYPE_SORT;
}
else if (!_cups_strcasecmp(argv[i], "mfp"))
{
- mask |= CUPS_PRINTER_MFP;
- type |= CUPS_PRINTER_MFP;
+ mask |= CUPS_PTYPE_MFP;
+ type |= CUPS_PTYPE_MFP;
}
else if (!_cups_strcasecmp(argv[i], "printer"))
{
- mask |= CUPS_PRINTER_MFP;
+ mask |= CUPS_PTYPE_MFP;
}
else if (!_cups_strcasecmp(argv[i], "large"))
{
- mask |= CUPS_PRINTER_LARGE;
- type |= CUPS_PRINTER_LARGE;
+ mask |= CUPS_PTYPE_LARGE;
+ type |= CUPS_PTYPE_LARGE;
}
else if (!_cups_strcasecmp(argv[i], "medium"))
{
- mask |= CUPS_PRINTER_MEDIUM;
- type |= CUPS_PRINTER_MEDIUM;
+ mask |= CUPS_PTYPE_MEDIUM;
+ type |= CUPS_PTYPE_MEDIUM;
}
else if (!_cups_strcasecmp(argv[i], "small"))
{
- mask |= CUPS_PRINTER_SMALL;
- type |= CUPS_PRINTER_SMALL;
+ mask |= CUPS_PTYPE_SMALL;
+ type |= CUPS_PTYPE_SMALL;
}
else
fprintf(stderr, "Unknown argument \"%s\" ignored...\n", argv[i]);
{
if (!strcmp(argv[i], "grayscale"))
{
- type |= CUPS_PRINTER_BW;
- mask |= CUPS_PRINTER_BW;
+ type |= CUPS_PTYPE_BW;
+ mask |= CUPS_PTYPE_BW;
}
else if (!strcmp(argv[i], "color"))
{
- type |= CUPS_PRINTER_COLOR;
- mask |= CUPS_PRINTER_COLOR;
+ type |= CUPS_PTYPE_COLOR;
+ mask |= CUPS_PTYPE_COLOR;
}
else if (!strcmp(argv[i], "duplex"))
{
- type |= CUPS_PRINTER_DUPLEX;
- mask |= CUPS_PRINTER_DUPLEX;
+ type |= CUPS_PTYPE_DUPLEX;
+ mask |= CUPS_PTYPE_DUPLEX;
}
else if (!strcmp(argv[i], "staple"))
{
- type |= CUPS_PRINTER_STAPLE;
- mask |= CUPS_PRINTER_STAPLE;
+ type |= CUPS_PTYPE_STAPLE;
+ mask |= CUPS_PTYPE_STAPLE;
}
else if (!strcmp(argv[i], "small"))
{
- type |= CUPS_PRINTER_SMALL;
- mask |= CUPS_PRINTER_SMALL;
+ type |= CUPS_PTYPE_SMALL;
+ mask |= CUPS_PTYPE_SMALL;
}
else if (!strcmp(argv[i], "medium"))
{
- type |= CUPS_PRINTER_MEDIUM;
- mask |= CUPS_PRINTER_MEDIUM;
+ type |= CUPS_PTYPE_MEDIUM;
+ mask |= CUPS_PTYPE_MEDIUM;
}
else if (!strcmp(argv[i], "large"))
{
- type |= CUPS_PRINTER_LARGE;
- mask |= CUPS_PRINTER_LARGE;
+ type |= CUPS_PTYPE_LARGE;
+ mask |= CUPS_PTYPE_LARGE;
}
else
usage(argv[i]);
* Change from a printer to a class...
*/
- c->type = CUPS_PRINTER_CLASS;
+ c->type = CUPS_PTYPE_CLASS;
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
ServerName, RemotePort, "/classes/%s", name);
for (c = (cupsd_printer_t *)cupsArrayFirst(Printers);
c;
c = (cupsd_printer_t *)cupsArrayNext(Printers))
- if (c->type & CUPS_PRINTER_CLASS)
+ if (c->type & CUPS_PTYPE_CLASS)
changed |= cupsdDeletePrinterFromClass(c, p);
return (changed);
if (c->printers[i]->accepting &&
(c->printers[i]->state == IPP_PSTATE_IDLE ||
- ((c->printers[i]->type & CUPS_PRINTER_REMOTE) && !c->printers[i]->job)))
+ ((c->printers[i]->type & CUPS_PTYPE_REMOTE) && !c->printers[i]->job)))
{
c->last_printer = i;
return (c->printers[i]);
cupsd_printer_t *c; /* Current class/printer */
- if ((c = cupsdFindDest(name)) != NULL && (c->type & CUPS_PRINTER_CLASS))
+ if ((c = cupsdFindDest(name)) != NULL && (c->type & CUPS_PTYPE_CLASS))
return (c);
else
return (NULL);
if ((p = cupsdFindDest(value)) != NULL)
{
- p->type = CUPS_PRINTER_CLASS;
+ p->type = CUPS_PTYPE_CLASS;
cupsdSetStringf(&p->uri, "ipp://%s:%d/classes/%s", ServerName,
LocalPort, value);
cupsdSetString(&p->error_policy, "retry-job");
cupsdSetString(&temp->make_model, "Remote Printer on unknown");
temp->state = IPP_PSTATE_STOPPED;
- temp->type |= CUPS_PRINTER_REMOTE;
+ temp->type |= CUPS_PTYPE_REMOTE;
cupsdSetString(&temp->location, "Location Unknown");
cupsdSetString(&temp->info, "No Information Available");
* Skip remote destinations and regular printers...
*/
- if ((pclass->type & CUPS_PRINTER_REMOTE) ||
- !(pclass->type & CUPS_PRINTER_CLASS))
+ if ((pclass->type & CUPS_PTYPE_REMOTE) ||
+ !(pclass->type & CUPS_PTYPE_CLASS))
continue;
/*
return (NULL);
}
- if (p->type & CUPS_PRINTER_CLASS)
+ if (p->type & CUPS_PTYPE_CLASS)
{
int i; /* Looping var */
for (i = 0; i < p->num_printers; i ++)
{
- if (!(p->printers[i]->type & CUPS_PRINTER_CLASS))
+ if (!(p->printers[i]->type & CUPS_PTYPE_CLASS))
{
snprintf(filename, len, "%s/ppd/%s.ppd", ServerRoot, p->printers[i]->name);
if (!access(filename, 0))
return (NULL);
}
- if (p->type & CUPS_PRINTER_CLASS)
+ if (p->type & CUPS_PTYPE_CLASS)
{
int i; /* Looping var */
for (i = 0; i < p->num_printers; i ++)
{
- if (!(p->printers[i]->type & CUPS_PRINTER_CLASS))
+ if (!(p->printers[i]->type & CUPS_PTYPE_CLASS))
{
snprintf(filename, len, "%s/images/%s.png", CacheDir, p->printers[i]->name);
if (!access(filename, 0))
removeit);
if (!Browsing || !p->shared ||
- (p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
+ (p->type & (CUPS_PTYPE_REMOTE | CUPS_PTYPE_SCANNER)))
return;
/*
p->name);
if (!Browsing || !BrowseLocalProtocols ||
- (p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
+ (p->type & (CUPS_PTYPE_REMOTE | CUPS_PTYPE_SCANNER)))
return;
if ((BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDMaster)
keyvalue[count ][0] = "rp";
keyvalue[count++][1] = rp_str;
- snprintf(rp_str, sizeof(rp_str), "%s/%s", (p->type & CUPS_PRINTER_CLASS) ? "classes" : "printers", p->name);
+ snprintf(rp_str, sizeof(rp_str), "%s/%s", (p->type & CUPS_PTYPE_CLASS) ? "classes" : "printers", p->name);
keyvalue[count ][0] = "ty";
keyvalue[count++][1] = p->make_model ? p->make_model : "Unknown";
}
}
- httpAssembleURIf(HTTP_URI_CODING_ALL, adminurl_str, sizeof(adminurl_str), admin_scheme, NULL, admin_hostname, DNSSDPort, "/%s/%s", (p->type & CUPS_PRINTER_CLASS) ? "classes" : "printers", p->name);
+ httpAssembleURIf(HTTP_URI_CODING_ALL, adminurl_str, sizeof(adminurl_str), admin_scheme, NULL, admin_hostname, DNSSDPort, "/%s/%s", (p->type & CUPS_PTYPE_CLASS) ? "classes" : "printers", p->name);
keyvalue[count ][0] = "adminurl";
keyvalue[count++][1] = adminurl_str;
keyvalue[count ][0] = "mopria-certified";
keyvalue[count++][1] = "1.3";
- if (p->type & CUPS_PRINTER_FAX)
+ if (p->type & CUPS_PTYPE_FAX)
{
keyvalue[count ][0] = "Fax";
keyvalue[count++][1] = "T";
keyvalue[count++][1] = rp_str;
}
- if (p->type & CUPS_PRINTER_COLOR)
+ if (p->type & CUPS_PTYPE_COLOR)
{
keyvalue[count ][0] = "Color";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_COLOR) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_COLOR) ? "T" : "F";
}
- if (p->type & CUPS_PRINTER_DUPLEX)
+ if (p->type & CUPS_PTYPE_DUPLEX)
{
keyvalue[count ][0] = "Duplex";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_DUPLEX) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_DUPLEX) ? "T" : "F";
}
- if (p->type & CUPS_PRINTER_STAPLE)
+ if (p->type & CUPS_PTYPE_STAPLE)
{
keyvalue[count ][0] = "Staple";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_STAPLE) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_STAPLE) ? "T" : "F";
}
- if (p->type & CUPS_PRINTER_COPIES)
+ if (p->type & CUPS_PTYPE_COPIES)
{
keyvalue[count ][0] = "Copies";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_COPIES) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_COPIES) ? "T" : "F";
}
- if (p->type & CUPS_PRINTER_COLLATE)
+ if (p->type & CUPS_PTYPE_COLLATE)
{
keyvalue[count ][0] = "Collate";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_COLLATE) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_COLLATE) ? "T" : "F";
}
- if (p->type & CUPS_PRINTER_PUNCH)
+ if (p->type & CUPS_PTYPE_PUNCH)
{
keyvalue[count ][0] = "Punch";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_PUNCH) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_PUNCH) ? "T" : "F";
}
- if (p->type & CUPS_PRINTER_BIND)
+ if (p->type & CUPS_PTYPE_BIND)
{
keyvalue[count ][0] = "Bind";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_BIND) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_BIND) ? "T" : "F";
}
- if (p->type & CUPS_PRINTER_SORT)
+ if (p->type & CUPS_PTYPE_SORT)
{
keyvalue[count ][0] = "Sort";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_SORT) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_SORT) ? "T" : "F";
}
- if (p->type & CUPS_PRINTER_MFP)
+ if (p->type & CUPS_PTYPE_MFP)
{
keyvalue[count ][0] = "Scan";
- keyvalue[count++][1] = (p->type & CUPS_PRINTER_MFP) ? "T" : "F";
+ keyvalue[count++][1] = (p->type & CUPS_PTYPE_MFP) ? "T" : "F";
}
- snprintf(type_str, sizeof(type_str), "0x%X", p->type | CUPS_PRINTER_REMOTE);
+ snprintf(type_str, sizeof(type_str), "0x%X", p->type | CUPS_PTYPE_REMOTE);
keyvalue[count ][0] = "printer-type";
keyvalue[count++][1] = type_str;
for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
p;
p = (cupsd_printer_t *)cupsArrayNext(Printers))
- if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
+ if (!(p->type & (CUPS_PTYPE_REMOTE | CUPS_PTYPE_SCANNER)))
dnssdDeregisterPrinter(p, 1, from_callback);
}
for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
p;
p = (cupsd_printer_t *)cupsArrayNext(Printers))
- if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
+ if (!(p->type & (CUPS_PTYPE_REMOTE | CUPS_PTYPE_SCANNER)))
dnssdRegisterPrinter(p, from_callback);
}
* Use the "_fax-ipp" service type for fax queues, otherwise use "_ipp"...
*/
- if (p->type & CUPS_PRINTER_FAX)
+ if (p->type & CUPS_PTYPE_FAX)
status = dnssdRegisterInstance(NULL, p, name, "_fax-ipp._tcp", DNSSDSubTypes, DNSSDPort, &ipp_txt, 1, from_callback);
else
status = dnssdRegisterInstance(NULL, p, name, "_ipp._tcp", DNSSDSubTypes, DNSSDPort, &ipp_txt, 1, from_callback);
* Figure out the authentication data requirements to advertise...
*/
- if (p->type & CUPS_PRINTER_CLASS)
+ if (p->type & CUPS_PTYPE_CLASS)
snprintf(resource, sizeof(resource), "/classes/%s", p->name);
else
snprintf(resource, sizeof(resource), "/printers/%s", p->name);
break;
case IPP_OP_CUPS_GET_CLASSES :
- get_printers(con, CUPS_PRINTER_CLASS);
+ get_printers(con, CUPS_PTYPE_CLASS);
break;
case IPP_OP_CUPS_ADD_MODIFY_PRINTER :
printer = cupsdFindDest(job->dest);
attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME);
- if (printer && !(printer->type & CUPS_PRINTER_REMOTE) &&
+ if (printer && !(printer->type & CUPS_PTYPE_REMOTE) &&
attr && attr->num_values > 1)
{
/*
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, printer, NULL,
"Now accepting jobs.");
- if (dtype & CUPS_PRINTER_CLASS)
+ if (dtype & CUPS_PTYPE_CLASS)
{
cupsdMarkDirty(CUPSD_DIRTY_CLASSES);
if ((attr = ippFindAttribute(con->request, "printer-is-shared", IPP_TAG_BOOLEAN)) != NULL)
{
- if (pclass->type & CUPS_PRINTER_REMOTE)
+ if (pclass->type & CUPS_PTYPE_REMOTE)
{
/*
* Cannot re-share remote printers.
return;
}
- else if (dtype & CUPS_PRINTER_CLASS)
+ else if (dtype & CUPS_PTYPE_CLASS)
{
send_ipp_status(con, IPP_STATUS_ERROR_BAD_REQUEST,
_("Nested classes are not allowed."));
return (NULL);
}
- job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
+ job->dtype = printer->type & (CUPS_PTYPE_CLASS | CUPS_PTYPE_REMOTE);
job->attrs = con->request;
job->dirty = 1;
con->request = ippNewRequest(job->attrs->request.op.operation_id);
ippSetString(job->attrs, &job->reasons, 0, "none");
}
- if (!(printer->type & CUPS_PRINTER_REMOTE) || Classification)
+ if (!(printer->type & CUPS_PTYPE_REMOTE) || Classification)
{
/*
* Add job sheets options...
* See if we need to add the starting sheet...
*/
- if (!(printer->type & CUPS_PRINTER_REMOTE))
+ if (!(printer->type & CUPS_PTYPE_REMOTE))
{
cupsdLogJob(job, CUPSD_LOG_INFO, "Adding start banner page \"%s\".",
attr->values[0].string.text);
return;
}
- if (printer->type & CUPS_PRINTER_REMOTE)
+ if (printer->type & CUPS_PTYPE_REMOTE)
{
/*
* Cannot re-share remote printers.
{
httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL,
con->clientname, con->clientport,
- (job->dtype & CUPS_PRINTER_CLASS) ? "/classes/%s" :
+ (job->dtype & CUPS_PTYPE_CLASS) ? "/classes/%s" :
"/printers/%s",
job->dest);
ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI,
}
else
{
- httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), is_encrypted ? "ipps" : "ipp", NULL, con->clientname, con->clientport, (p2->type & CUPS_PRINTER_CLASS) ? "/classes/%s" : "/printers/%s", p2->name);
+ httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), is_encrypted ? "ipps" : "ipp", NULL, con->clientname, con->clientport, (p2->type & CUPS_PTYPE_CLASS) ? "/classes/%s" : "/printers/%s", p2->name);
member_uris->values[i].string.text = _cupsStrAlloc(uri);
}
}
"stop-printer"
};
- if (printer->type & CUPS_PRINTER_CLASS)
+ if (printer->type & CUPS_PTYPE_CLASS)
ippAddString(con->response, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_NAME), "printer-error-policy-supported", NULL, "retry-current-job");
else
ippAddStrings(con->response, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_NAME), "printer-error-policy-supported", sizeof(errors) / sizeof(errors[0]), NULL, errors);
if (!ra || cupsArrayFind(ra, "printer-more-info"))
{
- httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), is_encrypted ? "https" : "http", NULL, con->clientname, con->clientport, (printer->type & CUPS_PRINTER_CLASS) ? "/classes/%s" : "/printers/%s", printer->name);
+ httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), is_encrypted ? "https" : "http", NULL, con->clientname, con->clientport, (printer->type & CUPS_PTYPE_CLASS) ? "/classes/%s" : "/printers/%s", printer->name);
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, "printer-more-info", NULL, uri);
}
type = printer->type;
if (printer == DefaultPrinter)
- type |= CUPS_PRINTER_DEFAULT;
+ type |= CUPS_PTYPE_DEFAULT;
if (!printer->accepting)
- type |= CUPS_PRINTER_REJECTING;
+ type |= CUPS_PTYPE_REJECTING;
if (!printer->shared)
- type |= CUPS_PRINTER_NOT_SHARED;
+ type |= CUPS_PTYPE_NOT_SHARED;
ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-type", (int)type);
}
if (!ra || cupsArrayFind(ra, "printer-uri-supported"))
{
- httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), is_encrypted ? "ipps" : "ipp", NULL, con->clientname, con->clientport, (printer->type & CUPS_PRINTER_CLASS) ? "/classes/%s" : "/printers/%s", printer->name);
+ httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), is_encrypted ? "ipps" : "ipp", NULL, con->clientname, con->clientport, (printer->type & CUPS_PTYPE_CLASS) ? "/classes/%s" : "/printers/%s", printer->name);
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, "printer-uri-supported", NULL, uri);
cupsdLogMessage(CUPSD_LOG_DEBUG2, "printer-uri-supported=\"%s\"", uri);
}
}
else if (!strncmp(resource, "/classes", 8) && strlen(resource) <= 9)
{
- dtype = CUPS_PRINTER_CLASS;
+ dtype = CUPS_PTYPE_CLASS;
printer = NULL;
}
else if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
cupsdAddEvent(CUPSD_EVENT_PRINTER_DELETED, printer, NULL,
"%s \"%s\" deleted by \"%s\".",
- (dtype & CUPS_PRINTER_CLASS) ? "Class" : "Printer",
+ (dtype & CUPS_PTYPE_CLASS) ? "Class" : "Printer",
printer->name, get_username(con));
cupsdExpireSubscriptions(printer, NULL);
temporary = printer->temporary;
- if (dtype & CUPS_PRINTER_CLASS)
+ if (dtype & CUPS_PTYPE_CLASS)
{
cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" deleted by \"%s\".",
printer->name, get_username(con));
{
dest = NULL;
dtype = (cups_ptype_t)0;
- dmask = CUPS_PRINTER_CLASS;
+ dmask = CUPS_PTYPE_CLASS;
printer = NULL;
}
else if (!strncmp(resource, "/classes", 8) && strlen(resource) <= 9)
{
dest = NULL;
- dtype = CUPS_PRINTER_CLASS;
- dmask = CUPS_PRINTER_CLASS;
+ dtype = CUPS_PTYPE_CLASS;
+ dmask = CUPS_PTYPE_CLASS;
printer = NULL;
}
else if ((dest = cupsdValidateDest(uri->values[0].string.text, &dtype,
}
else
{
- dtype &= CUPS_PRINTER_CLASS;
- dmask = CUPS_PRINTER_CLASS;
+ dtype &= CUPS_PTYPE_CLASS;
+ dmask = CUPS_PTYPE_CLASS;
}
/*
snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot, dest->name);
- if ((dtype & CUPS_PRINTER_REMOTE) && access(filename, 0))
+ if ((dtype & CUPS_PTYPE_REMOTE) && access(filename, 0))
{
send_ipp_status(con, IPP_STATUS_CUPS_SEE_OTHER, _("See remote printer."));
ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, dest->uri);
return;
}
- else if (dtype & CUPS_PRINTER_CLASS)
+ else if (dtype & CUPS_PTYPE_CLASS)
{
for (i = 0; i < dest->num_printers; i ++)
- if (!(dest->printers[i]->type & CUPS_PRINTER_CLASS))
+ if (!(dest->printers[i]->type & CUPS_PTYPE_CLASS))
{
snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot, dest->printers[i]->name);
static void
get_printers(cupsd_client_t *con, /* I - Client connection */
- int type) /* I - 0 or CUPS_PRINTER_CLASS */
+ int type) /* I - 0 or CUPS_PTYPE_CLASS */
{
http_status_t status; /* Policy status */
ipp_attribute_t *attr; /* Current attribute */
if (printer_id && printer->printer_id != printer_id)
continue;
- if ((!type || (printer->type & CUPS_PRINTER_CLASS) == type) &&
+ if ((!type || (printer->type & CUPS_PTYPE_CLASS) == type) &&
(printer->type & printer_mask) == printer_type &&
(!location ||
(printer->location && !_cups_strcasecmp(printer->location, location))))
cupsdSetPrinterReasons(printer, "+hold-new-jobs");
- if (dtype & CUPS_PRINTER_CLASS)
+ if (dtype & CUPS_PTYPE_CLASS)
cupsdLogMessage(CUPSD_LOG_INFO,
"Class \"%s\" now holding pending/new jobs (\"%s\").",
printer->name, get_username(con));
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, printer, NULL,
"No longer accepting jobs.");
- if (dtype & CUPS_PRINTER_CLASS)
+ if (dtype & CUPS_PTYPE_CLASS)
{
cupsdMarkDirty(CUPSD_DIRTY_CLASSES);
cupsdSetPrinterReasons(printer, "-hold-new-jobs");
- if (dtype & CUPS_PRINTER_CLASS)
+ if (dtype & CUPS_PTYPE_CLASS)
cupsdLogMessage(CUPSD_LOG_INFO,
"Class \"%s\" now printing pending/new jobs (\"%s\").",
printer->name, get_username(con));
cupsd_location_t *auth; /* Pointer to authentication element */
- if (printer->type & CUPS_PRINTER_CLASS)
+ if (printer->type & CUPS_PTYPE_CLASS)
snprintf(resource, sizeof(resource), "/classes/%s", printer->name);
else
snprintf(resource, sizeof(resource), "/printers/%s", printer->name);
continue;
if (strcmp(attr->values[0].string.text, "retry-current-job") &&
- ((printer->type & CUPS_PRINTER_CLASS) ||
+ ((printer->type & CUPS_PTYPE_CLASS) ||
(strcmp(attr->values[0].string.text, "abort-job") &&
strcmp(attr->values[0].string.text, "retry-job") &&
strcmp(attr->values[0].string.text, "stop-printer"))))
cupsdStartPrinter(printer, 1);
- if (dtype & CUPS_PRINTER_CLASS)
+ if (dtype & CUPS_PTYPE_CLASS)
cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" started by \"%s\".",
printer->name, get_username(con));
else
cupsdStopPrinter(printer, 1);
- if (dtype & CUPS_PRINTER_CLASS)
+ if (dtype & CUPS_PTYPE_CLASS)
cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" stopped by \"%s\".",
printer->name, get_username(con));
else
printer = cupsdFindDest(job->dest);
pclass = NULL;
- while (printer && (printer->type & CUPS_PRINTER_CLASS))
+ while (printer && (printer->type & CUPS_PTYPE_CLASS))
{
/*
* If the class is remote, just pass it to the remote server...
if (pclass->state == IPP_PSTATE_STOPPED)
printer = NULL;
- else if (pclass->type & CUPS_PRINTER_REMOTE)
+ else if (pclass->type & CUPS_PTYPE_REMOTE)
break;
else
printer = cupsdFindAvailablePrinter(printer->name);
job->job_sheets->values[0].string.text,
job->job_sheets->values[1].string.text);
- if (job->printer->type & CUPS_PRINTER_REMOTE)
+ if (job->printer->type & CUPS_PTYPE_REMOTE)
banner_page = 0;
else if (job->job_sheets == NULL)
banner_page = 0;
envp[envc ++] = classification;
}
- if (job->dtype & CUPS_PRINTER_CLASS)
+ if (job->dtype & CUPS_PTYPE_CLASS)
{
snprintf(class_name, sizeof(class_name), "CLASS=%s", job->dest);
envp[envc ++] = class_name;
p->name);
cupsdSetString(&job->dest, p->name);
- job->dtype = p->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
+ job->dtype = p->type & (CUPS_PTYPE_CLASS | CUPS_PTYPE_REMOTE);
if ((attr = ippFindAttribute(job->attrs, "job-printer-uri",
IPP_TAG_URI)) != NULL)
* act...
*/
- if (job->dtype & CUPS_PRINTER_CLASS)
+ if (job->dtype & CUPS_PTYPE_CLASS)
{
/*
* Queued on a class - mark the job as pending and we'll retry on
ippSetString(job->attrs, &job->reasons, 0, "none");
}
}
- else if ((job->printer->type & CUPS_PRINTER_FAX) ||
+ else if ((job->printer->type & CUPS_PTYPE_FAX) ||
!strcmp(job->printer->error_policy, "retry-job"))
{
if (job_state == IPP_JSTATE_COMPLETED)
* Map destination-uris value...
*/
- if ((job->printer->type & CUPS_PRINTER_FAX) && (attr = ippFindAttribute(job->attrs, "destination-uris", IPP_TAG_BEGIN_COLLECTION)) != NULL)
+ if ((job->printer->type & CUPS_PTYPE_FAX) && (attr = ippFindAttribute(job->attrs, "destination-uris", IPP_TAG_BEGIN_COLLECTION)) != NULL)
{
ipp_t *ipp = ippGetCollection(attr, 0); // Collection value
const char *destination_uri = ippGetString(ippFindAttribute(ipp, "destination-uri", IPP_TAG_URI), 0, NULL);
strcmp(attr->name, "job-password") &&
strcmp(attr->name, "job-password-encryption") &&
strcmp(attr->name, "job-uuid") &&
- !(job->printer->type & CUPS_PRINTER_REMOTE))
+ !(job->printer->type & CUPS_PTYPE_REMOTE))
continue;
if ((!strcmp(attr->name, "job-impressions") ||
"%s", job->printer->state_message);
if (event & CUPSD_EVENT_PRINTER_STATE)
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, job->printer, NULL,
- (job->printer->type & CUPS_PRINTER_CLASS) ?
+ (job->printer->type & CUPS_PTYPE_CLASS) ?
"Class \"%s\" state changed." :
"Printer \"%s\" state changed.",
job->printer->name);
cupsd_printer_t *p; /* Printer in list */
- if ((p = cupsdFindDest(name)) != NULL && (p->type & CUPS_PRINTER_CLASS))
+ if ((p = cupsdFindDest(name)) != NULL && (p->type & CUPS_PTYPE_CLASS))
return (NULL);
else
return (p);
* Skip printer classes and temporary queues...
*/
- if ((printer->type & CUPS_PRINTER_CLASS) || printer->temporary)
+ if ((printer->type & CUPS_PTYPE_CLASS) || printer->temporary)
continue;
/*
if (p->num_auth_info_required > 1 ||
strcmp(p->auth_info_required[0], "none"))
- p->type |= CUPS_PRINTER_AUTHENTICATED;
+ p->type |= CUPS_PTYPE_AUTHENTICATED;
else
- p->type &= (cups_ptype_t)~CUPS_PRINTER_AUTHENTICATED;
+ p->type &= (cups_ptype_t)~CUPS_PTYPE_AUTHENTICATED;
return (1);
}
auth_supported = "requesting-user-name";
- if (p->type & CUPS_PRINTER_CLASS)
+ if (p->type & CUPS_PTYPE_CLASS)
snprintf(resource, sizeof(resource), "/classes/%s", p->name);
else
snprintf(resource, sizeof(resource), "/printers/%s", p->name);
#endif /* HAVE_GSSAPI */
if (auth_type != CUPSD_AUTH_NONE)
- p->type |= CUPS_PRINTER_AUTHENTICATED;
+ p->type |= CUPS_PTYPE_AUTHENTICATED;
else
- p->type &= (cups_ptype_t)~CUPS_PRINTER_AUTHENTICATED;
+ p->type &= (cups_ptype_t)~CUPS_PTYPE_AUTHENTICATED;
}
else
- p->type &= (cups_ptype_t)~CUPS_PRINTER_AUTHENTICATED;
+ p->type &= (cups_ptype_t)~CUPS_PTYPE_AUTHENTICATED;
/*
* Create the required IPP attributes for a printer...
* or class...
*/
- if (p->type & CUPS_PRINTER_CLASS)
+ if (p->type & CUPS_PTYPE_CLASS)
{
p->raw = 1;
- p->type &= (cups_ptype_t)~CUPS_PRINTER_OPTIONS;
+ p->type &= (cups_ptype_t)~CUPS_PTYPE_OPTIONS;
/*
* Add class-specific attributes...
attr = ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_NAME,
"member-names", p->num_printers, NULL, NULL);
- p->type |= CUPS_PRINTER_OPTIONS;
+ p->type |= CUPS_PTYPE_OPTIONS;
for (i = 0; i < p->num_printers; i ++)
{
if (attr != NULL)
attr->values[i].string.text = _cupsStrAlloc(p->printers[i]->name);
- p->type &= (cups_ptype_t)~CUPS_PRINTER_OPTIONS | p->printers[i]->type;
+ p->type &= (cups_ptype_t)~CUPS_PTYPE_OPTIONS | p->printers[i]->type;
}
}
}
filter = (char *)cupsArrayNext(p->pc->filters))
add_printer_filter(p, p->filetype, filter);
}
- else if (!(p->type & CUPS_PRINTER_REMOTE))
+ else if (!(p->type & CUPS_PTYPE_REMOTE))
{
/*
* Add a filter from application/vnd.cups-raw to printer/name to
* Force sharing off for remote queues...
*/
- if (p->type & CUPS_PRINTER_REMOTE)
+ if (p->type & CUPS_PTYPE_REMOTE)
p->shared = 0;
/*
cupsdAddEvent(s == IPP_PSTATE_STOPPED ? CUPSD_EVENT_PRINTER_STOPPED :
CUPSD_EVENT_PRINTER_STATE, p, NULL,
"%s \"%s\" state changed to %s.",
- (p->type & CUPS_PRINTER_CLASS) ? "Class" : "Printer",
+ (p->type & CUPS_PTYPE_CLASS) ? "Class" : "Printer",
p->name, printer_states[p->state - IPP_PSTATE_IDLE]);
/*
*printer = p;
if (dtype)
- *dtype = p->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
+ *dtype = p->type & (CUPS_PTYPE_CLASS | CUPS_PTYPE_REMOTE);
return (p->name);
}
*printer = p;
if (dtype)
- *dtype = p->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
+ *dtype = p->type & (CUPS_PTYPE_CLASS | CUPS_PTYPE_REMOTE);
return (p->name);
}
ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_NOVALUE, "orientation-requested-default", NULL, NULL);
if (!cupsGetOption("print-color-mode", p->num_options, p->options))
- ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "print-color-mode-default", NULL, (p->type & CUPS_PRINTER_COLOR) ? "color" : "monochrome");
+ ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "print-color-mode-default", NULL, (p->type & CUPS_PTYPE_COLOR) ? "color" : "monochrome");
if (!cupsGetOption("print-quality", p->num_options, p->options))
ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "print-quality-default", IPP_QUALITY_NORMAL);
static void
dirty_printer(cupsd_printer_t *p) /* I - Printer */
{
- if (p->type & CUPS_PRINTER_CLASS)
+ if (p->type & CUPS_PTYPE_CLASS)
cupsdMarkDirty(CUPSD_DIRTY_CLASSES);
else
cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
cupsdClearString(&(p->make_model));
- p->type &= (cups_ptype_t)~CUPS_PRINTER_OPTIONS;
- p->type |= CUPS_PRINTER_BW;
+ p->type &= (cups_ptype_t)~CUPS_PTYPE_OPTIONS;
+ p->type |= CUPS_PTYPE_BW;
finishings[0] = IPP_FINISHINGS_NONE;
num_finishings = 1;
p->ppd_attrs = ippNew();
- if (p->type & CUPS_PRINTER_FAX)
+ if (p->type & CUPS_PTYPE_FAX)
{
/* confirmation-sheet-print-default */
ippAddBoolean(p->ppd_attrs, IPP_TAG_PRINTER, "confirmation-sheet-default", 0);
ppdMarkDefaults(ppd);
if (ppd->color_device)
- p->type |= CUPS_PRINTER_COLOR;
+ p->type |= CUPS_PTYPE_COLOR;
if (ppd->variable_sizes)
- p->type |= CUPS_PRINTER_VARIABLE;
+ p->type |= CUPS_PTYPE_VARIABLE;
if (!ppd->manual_copies)
- p->type |= CUPS_PRINTER_COPIES;
+ p->type |= CUPS_PTYPE_COPIES;
if ((ppd_attr = ppdFindAttr(ppd, "cupsFax", NULL)) != NULL)
if (ppd_attr->value && !_cups_strcasecmp(ppd_attr->value, "true"))
- p->type |= CUPS_PRINTER_FAX;
+ p->type |= CUPS_PTYPE_FAX;
ippAddBoolean(p->ppd_attrs, IPP_TAG_PRINTER, "color-supported", (char)ppd->color_device);
if (duplex && duplex->num_choices > 1 &&
!ppdInstallableConflict(ppd, duplex->keyword, "DuplexTumble"))
{
- p->type |= CUPS_PRINTER_DUPLEX;
+ p->type |= CUPS_PTYPE_DUPLEX;
ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "pwg-raster-document-sheet-back", NULL, "normal");
}
if (ppdFindOption(ppd, "Collate") != NULL)
- p->type |= CUPS_PRINTER_COLLATE;
+ p->type |= CUPS_PTYPE_COLLATE;
if (p->pc && p->pc->finishings)
{
case IPP_FINISHINGS_EDGE_STITCH_TOP :
case IPP_FINISHINGS_EDGE_STITCH_RIGHT :
case IPP_FINISHINGS_EDGE_STITCH_BOTTOM :
- p->type |= CUPS_PRINTER_BIND;
+ p->type |= CUPS_PTYPE_BIND;
break;
case IPP_FINISHINGS_COVER :
- p->type |= CUPS_PRINTER_COVER;
+ p->type |= CUPS_PTYPE_COVER;
break;
case IPP_FINISHINGS_PUNCH :
case IPP_FINISHINGS_PUNCH_QUAD_TOP :
case IPP_FINISHINGS_PUNCH_QUAD_RIGHT :
case IPP_FINISHINGS_PUNCH_QUAD_BOTTOM :
- p->type |= CUPS_PRINTER_PUNCH;
+ p->type |= CUPS_PTYPE_PUNCH;
break;
case IPP_FINISHINGS_STAPLE :
case IPP_FINISHINGS_STAPLE_TRIPLE_TOP :
case IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT :
case IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM :
- p->type |= CUPS_PRINTER_STAPLE;
+ p->type |= CUPS_PTYPE_STAPLE;
break;
default :
for (i = 0; i < ppd->num_sizes; i ++)
if (ppd->sizes[i].length > 1728)
- p->type |= CUPS_PRINTER_LARGE;
+ p->type |= CUPS_PTYPE_LARGE;
else if (ppd->sizes[i].length > 1008)
- p->type |= CUPS_PRINTER_MEDIUM;
+ p->type |= CUPS_PTYPE_MEDIUM;
else
- p->type |= CUPS_PRINTER_SMALL;
+ p->type |= CUPS_PTYPE_SMALL;
if ((ppd_attr = ppdFindAttr(ppd, "APICADriver", NULL)) != NULL &&
ppd_attr->value && !_cups_strcasecmp(ppd_attr->value, "true"))
{
if ((ppd_attr = ppdFindAttr(ppd, "APScannerOnly", NULL)) != NULL &&
ppd_attr->value && !_cups_strcasecmp(ppd_attr->value, "true"))
- p->type |= CUPS_PRINTER_SCANNER;
+ p->type |= CUPS_PTYPE_SCANNER;
else
- p->type |= CUPS_PRINTER_MFP;
+ p->type |= CUPS_PTYPE_MFP;
}
/*
if (!_cups_strncasecmp(filter, "application/vnd.cups-command", 28) &&
_cups_isspace(filter[28]))
{
- p->type |= CUPS_PRINTER_COMMANDS;
+ p->type |= CUPS_PTYPE_COMMANDS;
break;
}
}
}
- if (p->type & CUPS_PRINTER_COMMANDS)
+ if (p->type & CUPS_PTYPE_COMMANDS)
{
char *commands, /* Copy of commands */
*start, /* Start of name */
}
if (ppdFindAttr(ppd, "APRemoteQueueID", NULL))
- p->type |= CUPS_PRINTER_REMOTE;
+ p->type |= CUPS_PTYPE_REMOTE;
#ifdef HAVE_APPLICATIONSERVICES_H
/*
* Tell the client this is really a hard-wired remote printer.
*/
- p->type |= CUPS_PRINTER_REMOTE;
+ p->type |= CUPS_PTYPE_REMOTE;
/*
* Then set the make-and-model accordingly...