/*
- * "$Id$"
- *
* Internet Printing Protocol support functions for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
"client-error-document-password-error",
"client-error-document-permission-error",
"client-error-document-security-error",
- "client-error-document-unprintable-error"
+ "client-error-document-unprintable-error",
+ "client-error-account-info-needed",
+ "client-error-account-closed",
+ "client-error-account-limit-reached",
+ "client-error-account-authorization-failed",
+ "client-error-not-fetchable"
},
* const ipp_status_480s[] = /* Vendor client errors */
{
"Set-Printer-Attributes",
"Set-Job-Attributes",
"Get-Printer-Supported-Values",
- "Create-Printer-Subscription",
- "Create-Job-Subscription",
+ "Create-Printer-Subscriptions",
+ "Create-Job-Subscriptions",
"Get-Subscription-Attributes",
"Get-Subscriptions",
"Renew-Subscription",
"Suspend-Current-Job",
"Resume-Job",
- /* 0x0030 - 0x003e */
+ /* 0x0030 - 0x003f */
"Promote-Job",
"Schedule-Job-After",
"0x0032",
"Close-Job",
"Identify-Printer",
"Validate-Document",
- "Send-Hardcopy-Document"
+ "Send-Hardcopy-Document",
+ "Acknowledge-Document",
+
+ /* 0x0040 - 0x004a */
+ "Acknowledge-Identify-Printer",
+ "Acknowledge-Job",
+ "Fetch-Document",
+ "Fetch-Job",
+ "Get-Output-Device-Attributes",
+ "Update-Active-Jobs",
+ "Deregister-Output-Device",
+ "Update-Document-Status",
+ "Update-Job-Status",
+ "Update-Output-Device-Attributes",
+ "Get-Next-Document-Data"
},
* const ipp_cups_ops[] =
{
},
* const ipp_cups_ops2[] =
{
- "CUPS-Get-Document"
+ "CUPS-Get-Document",
+ "CUPS-Create-Local-Printer"
},
* const ipp_tag_names[] =
{ /* Value/group tag names */
break;
case IPP_TAG_RESOLUTION :
- if (buffer && bufptr < bufend)
+ if (val->resolution.xres == val->resolution.yres)
+ {
+ if (buffer && bufptr < bufend)
+ bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d%s", val->resolution.xres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
+ else
+ bufptr += snprintf(temp, sizeof(temp), "%d%s", val->resolution.xres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
+ }
+ else if (buffer && bufptr < bufend)
bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
else
bufptr += snprintf(temp, sizeof(temp), "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
"printer-input-tray", /* IPP JPS3 */
"printer-is-accepting-jobs",
"printer-is-shared", /* CUPS extension */
+ "printer-is-temporary", /* CUPS extension */
"printer-kind", /* IPP Paid Printing */
"printer-location",
"printer-make-and-model",
"printer-organization",
"printer-organizational-unit",
"printer-output-tray", /* IPP JPS3 */
+ "printer-queue-id", /* CUPS extension */
"printer-settable-attributes-supported",
"printer-state",
"printer-state-change-date-time",
else if (error == IPP_STATUS_CUPS_SEE_OTHER)
return ("cups-see-other");
else if (error >= IPP_STATUS_ERROR_BAD_REQUEST &&
- error <= IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE)
+ error <= IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED)
return (ipp_status_400s[error - IPP_STATUS_ERROR_BAD_REQUEST]);
else if (error >= 0x480 &&
error <= IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
return ("windows-ext");
else if (op >= IPP_OP_CUPS_GET_DEFAULT && op <= IPP_OP_CUPS_GET_PPD)
return (ipp_cups_ops[op - IPP_OP_CUPS_GET_DEFAULT]);
- else if (op == IPP_OP_CUPS_GET_DOCUMENT)
- return (ipp_cups_ops2[0]);
+ else if (op >= IPP_OP_CUPS_GET_DOCUMENT && op <= IPP_OP_CUPS_CREATE_LOCAL_PRINTER)
+ return (ipp_cups_ops2[op - IPP_OP_CUPS_GET_DOCUMENT]);
/*
* No, build an "0xxxxx" operation string...
if (!_cups_strcasecmp(name, ipp_cups_ops2[i]))
return ((ipp_op_t)(i + 0x4027));
+ if (!_cups_strcasecmp(name, "Create-Job-Subscription"))
+ return (IPP_OP_CREATE_JOB_SUBSCRIPTIONS);
+
+ if (!_cups_strcasecmp(name, "Create-Printer-Subscription"))
+ return (IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS);
+
if (!_cups_strcasecmp(name, "CUPS-Add-Class"))
return (IPP_OP_CUPS_ADD_MODIFY_CLASS);
/*
* 'ippStateString()' - Return the name corresponding to a state value.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
const char * /* O - State name */
ipp_attribute_t *attr; /* Current member attribute */
+ if (!col)
+ {
+ if (buffer)
+ *buffer = '\0';
+
+ return (0);
+ }
+
bufptr = buffer;
bufend = buffer + bufsize - 1;
return ((size_t)(bufptr - buffer));
}
-
-
-/*
- * End of "$Id$".
- */