56 lines
1.8 KiB
Diff
56 lines
1.8 KiB
Diff
--- cups-1.2.10/backend/ipp.c.str2109 2007-04-03 11:05:13.000000000 +0100
|
|
+++ cups-1.2.10/backend/ipp.c 2007-04-03 11:05:33.000000000 +0100
|
|
@@ -210,6 +210,7 @@
|
|
"document-format-supported",
|
|
"printer-is-accepting-jobs",
|
|
"printer-state",
|
|
+ "printer-state-message",
|
|
"printer-state-reasons",
|
|
};
|
|
static const char * const jattrs[] =
|
|
@@ -1285,6 +1286,11 @@
|
|
{
|
|
ipp_t *request, /* IPP request */
|
|
*response; /* IPP response */
|
|
+ static const char * const attrs[] = /* Attributes we want */
|
|
+ {
|
|
+ "printer-state-message",
|
|
+ "printer-state-reasons"
|
|
+ };
|
|
|
|
|
|
/*
|
|
@@ -1301,8 +1307,9 @@
|
|
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
|
"requesting-user-name", NULL, user);
|
|
|
|
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
|
- "requested-attributes", NULL, "printer-state-reasons");
|
|
+ ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
|
+ "requested-attributes",
|
|
+ (int)(sizeof(attrs) / sizeof(attrs[0])), NULL, attrs);
|
|
|
|
/*
|
|
* Do the request...
|
|
@@ -1430,7 +1437,8 @@
|
|
{
|
|
int i; /* Looping var */
|
|
int count; /* Count of reasons shown... */
|
|
- ipp_attribute_t *reasons; /* printer-state-reasons */
|
|
+ ipp_attribute_t *psm, /* pritner-state-message */
|
|
+ *reasons; /* printer-state-reasons */
|
|
const char *reason; /* Current reason */
|
|
const char *message; /* Message to show */
|
|
char unknown[1024]; /* Unknown message string */
|
|
@@ -1438,6 +1446,10 @@
|
|
char state[1024]; /* State string */
|
|
|
|
|
|
+ if ((psm = ippFindAttribute(ipp, "printer-state-message",
|
|
+ IPP_TAG_TEXT)) != NULL)
|
|
+ fprintf(stderr, "INFO: %s\n", psm->values[0].string.text);
|
|
+
|
|
if ((reasons = ippFindAttribute(ipp, "printer-state-reasons",
|
|
IPP_TAG_KEYWORD)) == NULL)
|
|
return (0);
|