summaryrefslogtreecommitdiff
path: root/systemv
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
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')
-rw-r--r--systemv/Makefile14
-rw-r--r--systemv/cupstestppd.c73
-rw-r--r--systemv/lpstat.c26
3 files changed, 99 insertions, 14 deletions
diff --git a/systemv/Makefile b/systemv/Makefile
index 053fe2b6b..c9be899b0 100644
--- a/systemv/Makefile
+++ b/systemv/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile 5627 2006-06-05 15:24:20Z mike $"
+# "$Id: Makefile 6574 2007-06-19 23:52:37Z mike $"
#
# System V commands makefile for the Common UNIX Printing System (CUPS).
#
@@ -79,6 +79,12 @@ install: all
$(INSTALL_BIN) lpoptions $(BINDIR)
$(INSTALL_BIN) lpstat $(BINDIR)
$(INSTALL_BIN) -m 4755 -o root lppasswd $(BINDIR) || $(INSTALL_BIN) lppasswd $(BINDIR)
+ if test "x$(SYMROOT)" != "x"; then \
+ $(INSTALL_DIR) $(SYMROOT); \
+ for file in $(TARGETS); do \
+ cp $$file $(SYMROOT); \
+ done \
+ fi
#
@@ -149,9 +155,9 @@ cupstestdsc: cupstestdsc.o ../cups/$(LIBCUPS)
# cupstestppd
#
-cupstestppd: cupstestppd.o ../cups/$(LIBCUPS)
+cupstestppd: cupstestppd.o ../cups/$(LIBCUPS) ../filter/$(LIBCUPSIMAGE)
echo Linking $@...
- $(CC) $(LDFLAGS) -o $@ cupstestppd.o $(LIBS)
+ $(CC) $(LDFLAGS) -o $@ cupstestppd.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
#
@@ -225,5 +231,5 @@ include Dependencies
#
-# End of "$Id: Makefile 5627 2006-06-05 15:24:20Z mike $".
+# End of "$Id: Makefile 6574 2007-06-19 23:52:37Z mike $".
#
diff --git a/systemv/cupstestppd.c b/systemv/cupstestppd.c
index e2f203e19..4f4c6964f 100644
--- a/systemv/cupstestppd.c
+++ b/systemv/cupstestppd.c
@@ -1,5 +1,5 @@
/*
- * "$Id: cupstestppd.c 6533 2007-05-15 15:54:23Z mike $"
+ * "$Id: cupstestppd.c 6574 2007-06-19 23:52:37Z mike $"
*
* PPD test program for the Common UNIX Printing System (CUPS).
*
@@ -27,10 +27,16 @@
*
* Contents:
*
- * main() - Main entry for test program.
- * show_conflicts() - Show option conflicts in a PPD file.
- * usage() - Show program usage...
- * valid_utf8() - Check whether a string contains valid UTF-8 text.
+ * main() - Main entry for test program.
+ * check_basics() - Check for CR LF, mixed line endings, and blank lines.
+ * check_constraints() - Check UIConstraints in the PPD file.
+ * check_defaults() - Check default option keywords in the PPD file.
+ * check_filters() - Check filters in the PPD file.
+ * check_translations() - Check translations in the PPD file.
+ * show_conflicts() - Show option conflicts in a PPD file.
+ * test_raster() - Test PostScript commands for raster printers.
+ * usage() - Show program usage...
+ * valid_utf8() - Check whether a string contains valid UTF-8 text.
*/
/*
@@ -40,6 +46,7 @@
#include <cups/string.h>
#include <cups/cups.h>
#include <cups/i18n.h>
+#include <filter/raster.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/stat.h>
@@ -101,6 +108,7 @@ static int check_filters(ppd_file_t *ppd, const char *root, int errors,
static int check_translations(ppd_file_t *ppd, int errors, int verbose,\
int warn);
static void show_conflicts(ppd_file_t *ppd);
+static int test_raster(ppd_file_t *ppd, int verbose);
static void usage(void);
static int valid_utf8(const char *s);
@@ -367,6 +375,14 @@ main(int argc, /* I - Number of command-line args */
attr->value)
ppdversion = (int)(10 * atof(attr->value) + 0.5);
+ for (j = 0; j < ppd->num_filters; j ++)
+ if (strstr(ppd->filters[j], "application/vnd.cups-raster"))
+ {
+ if (!test_raster(ppd, verbose))
+ errors ++;
+ break;
+ }
+
/*
* Look for default keywords with no matching option...
*/
@@ -1206,9 +1222,12 @@ main(int argc, /* I - Number of command-line args */
if (!strcmp(attr->name, "DefaultColorSpace") ||
!strcmp(attr->name, "DefaultColorSep") ||
!strcmp(attr->name, "DefaultFont") ||
+ !strcmp(attr->name, "DefaultHalftoneType") ||
!strcmp(attr->name, "DefaultImageableArea") ||
+ !strcmp(attr->name, "DefaultLeadingEdge") ||
!strcmp(attr->name, "DefaultOutputOrder") ||
!strcmp(attr->name, "DefaultPaperDimension") ||
+ !strcmp(attr->name, "DefaultResolution") ||
!strcmp(attr->name, "DefaultScreenProc") ||
!strcmp(attr->name, "DefaultTransfer"))
continue;
@@ -1543,6 +1562,14 @@ main(int argc, /* I - Number of command-line args */
}
}
+ _cupsLangPrintf(stdout, " num_consts = %d\n",
+ ppd->num_consts);
+ for (j = 0; j < ppd->num_consts; j ++)
+ _cupsLangPrintf(stdout,
+ " consts[%d] = *%s %s *%s %s\n",
+ j, ppd->consts[j].option1, ppd->consts[j].choice1,
+ ppd->consts[j].option2, ppd->consts[j].choice2);
+
_cupsLangPrintf(stdout, " num_profiles = %d\n",
ppd->num_profiles);
for (j = 0; j < ppd->num_profiles; j ++)
@@ -1781,7 +1808,9 @@ check_defaults(ppd_file_t *ppd, /* I - PPD file */
if (!strcmp(attr->name, "DefaultColorSpace") ||
!strcmp(attr->name, "DefaultFont") ||
+ !strcmp(attr->name, "DefaultHalftoneType") ||
!strcmp(attr->name, "DefaultImageableArea") ||
+ !strcmp(attr->name, "DefaultLeadingEdge") ||
!strcmp(attr->name, "DefaultOutputOrder") ||
!strcmp(attr->name, "DefaultPaperDimension") ||
!strcmp(attr->name, "DefaultResolution") ||
@@ -2044,6 +2073,9 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */
option;
option = ppdNextOption(ppd))
{
+ if (!strcmp(option->keyword, "PageRegion"))
+ continue;
+
snprintf(keyword, sizeof(keyword), "%s.Translation", langstart);
snprintf(llkeyword, sizeof(llkeyword), "%s.Translation", ll);
@@ -2347,6 +2379,35 @@ show_conflicts(ppd_file_t *ppd) /* I - PPD to check */
/*
+ * 'test_raster()' - Test PostScript commands for raster printers.
+ */
+
+static int /* O - 1 on success, 0 on failure */
+test_raster(ppd_file_t *ppd, /* I - PPD file */
+ int verbose) /* I - Verbosity */
+{
+ cups_page_header2_t header; /* Page header */
+
+
+ ppdMarkDefaults(ppd);
+ if (cupsRasterInterpretPPD(&header, ppd, 0, NULL, 0))
+ {
+ if (!verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" **FAIL** Default option code cannot be "
+ "interpreted: %s\n"), cupsRasterErrorString());
+
+ return (0);
+ }
+ else
+ return (1);
+}
+
+
+/*
* 'usage()' - Show program usage...
*/
@@ -2449,5 +2510,5 @@ valid_utf8(const char *s) /* I - String to check */
/*
- * End of "$Id: cupstestppd.c 6533 2007-05-15 15:54:23Z mike $".
+ * End of "$Id: cupstestppd.c 6574 2007-06-19 23:52:37Z mike $".
*/
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 $".
*/