/*
- * "$Id: ipp.c 6422 2007-03-30 20:49:37Z mike $"
+ * "$Id: ipp.c 6434 2007-04-02 22:07:10Z mike $"
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
"document-format-supported",
"printer-is-accepting-jobs",
"printer-state",
+ "printer-state-message",
"printer-state-reasons",
};
static const char * const jattrs[] =
{
ipp_t *request, /* IPP request */
*response; /* IPP response */
+ static const char * const attrs[] = /* Attributes we want */
+ {
+ "printer-state-message",
+ "printer-state-reasons"
+ };
/*
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...
{
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 */
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);
/*
- * End of "$Id: ipp.c 6422 2007-03-30 20:49:37Z mike $".
+ * End of "$Id: ipp.c 6434 2007-04-02 22:07:10Z mike $".
*/