summaryrefslogtreecommitdiff
path: root/systemv/lpstat.c
diff options
context:
space:
mode:
authorjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>2007-06-23 05:26:17 +0000
committerjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>2007-06-23 05:26:17 +0000
commit09a101d671d39312a756c325d8463a1a02f582a6 (patch)
tree09a2338172d0eca839ad4f82524f2846aae6ffdd /systemv/lpstat.c
parent3d8365b8dc12c660de084e4047b8648fc377ed16 (diff)
Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@334 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'systemv/lpstat.c')
-rw-r--r--systemv/lpstat.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/systemv/lpstat.c b/systemv/lpstat.c
index 4830117c1..be86072ab 100644
--- a/systemv/lpstat.c
+++ b/systemv/lpstat.c
@@ -1,5 +1,5 @@
/*
- * "$Id: lpstat.c 6084 2006-11-14 14:35:53Z mike $"
+ * "$Id: lpstat.c 6559 2007-06-18 21:09:03Z mike $"
*
* "lpstat" command for the Common UNIX Printing System (CUPS).
*
@@ -1397,9 +1397,11 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
int ranking, /* I - Show job ranking? */
const char *which) /* I - Show which jobs? */
{
+ int i; /* Looping var */
ipp_t *request, /* IPP Request */
*response; /* IPP Response */
- ipp_attribute_t *attr; /* Current attribute */
+ ipp_attribute_t *attr, /* Current attribute */
+ *reasons; /* Job state reasons attribute */
const char *dest, /* Pointer into job-printer-uri */
*username, /* Pointer to job-originating-user-name */
*title; /* Pointer to job-name */
@@ -1420,7 +1422,8 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
"job-name",
"time-at-creation",
"job-printer-uri",
- "job-originating-user-name"
+ "job-originating-user-name",
+ "job-state-reasons"
};
@@ -1495,6 +1498,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
dest = NULL;
jobtime = 0;
title = "no title";
+ reasons = NULL;
while (attr != NULL && attr->group_tag == IPP_TAG_JOB)
{
@@ -1523,6 +1527,10 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
attr->value_tag == IPP_TAG_NAME)
title = attr->values[0].string.text;
+ if (!strcmp(attr->name, "job-state-reasons") &&
+ attr->value_tag == IPP_TAG_KEYWORD)
+ reasons = attr;
+
attr = attr->next;
}
@@ -1665,7 +1673,17 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
temp, username ? username : "unknown",
1024.0 * size, date);
if (long_status)
+ {
+ if (reasons)
+ {
+ _cupsLangPuts(stdout, _("\tAlerts:"));
+ for (i = 0; i < reasons->num_values; i ++)
+ _cupsLangPrintf(stdout, " %s",
+ reasons->values[i].string.text);
+ _cupsLangPuts(stdout, "\n");
+ }
_cupsLangPrintf(stdout, _("\tqueued for %s\n"), dest);
+ }
}
}
@@ -2249,5 +2267,5 @@ show_scheduler(http_t *http) /* I - HTTP connection to server */
/*
- * End of "$Id: lpstat.c 6084 2006-11-14 14:35:53Z mike $".
+ * End of "$Id: lpstat.c 6559 2007-06-18 21:09:03Z mike $".
*/