From: msweet Date: Tue, 4 Mar 2008 01:12:17 +0000 (+0000) Subject: Merge changes from CUPS 1.4svn-r7366. X-Git-Tag: release-1.6.3~184 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=commitdiff_plain;h=a603edef72e293330df701a66d6ead8aafe2f5b1 Merge changes from CUPS 1.4svn-r7366. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@656 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/berkeley/Dependencies b/berkeley/Dependencies index b22e00768..460f6e0b7 100644 --- a/berkeley/Dependencies +++ b/berkeley/Dependencies @@ -1,13 +1,16 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -lpc.o: lpc.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h \ - ../cups/transcode.h ../cups/debug.h ../cups/string.h ../config.h -lpq.o: lpq.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h -lpr.o: lpr.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/i18n.h ../cups/transcode.h -lprm.o: lprm.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h \ - ../cups/transcode.h ../cups/string.h ../config.h + +lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h +lpc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +lpc.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h ../cups/string.h +lpc.o: ../config.h +lpq.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h +lpq.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h ../cups/array.h +lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h +lpq.o: ../cups/debug.h +lpr.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h +lpr.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h ../cups/array.h +lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h +lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h +lprm.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +lprm.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h diff --git a/cgi-bin/Dependencies b/cgi-bin/Dependencies index 42aa24791..63395ad5e 100644 --- a/cgi-bin/Dependencies +++ b/cgi-bin/Dependencies @@ -1,56 +1,58 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \ - ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h ../cups/array.h help-index.h \ - ../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \ - ../config.h ../cups/dir.h -html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h \ - ../cups/adminutil.h ../cups/cups.h ../cups/file.h -classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/array.h help-index.h -testhi.o: testhi.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/array.h help-index.h -testtemplate.o: testtemplate.c cgi.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/array.h help-index.h + +help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +help-index.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h +help-index.o: ../cups/file.h ../cups/language.h ../cups/array.h help-index.h +help-index.o: ../cups/debug.h ../cups/i18n.h ../cups/transcode.h +help-index.o: ../cups/string.h ../config.h ../cups/dir.h +html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +html.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +html.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +html.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +ipp-var.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +ipp-var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +ipp-var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +search.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +search.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +search.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +template.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +template.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +template.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +var.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +admin.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +admin.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +admin.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/file.h +classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +classes.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +classes.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +classes.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +help.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +help.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +help.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +jobs.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +jobs.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +jobs.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +printers.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +printers.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h +printers.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +testcgi.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +testcgi.o: ../cups/language.h ../cups/array.h help-index.h +testhi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +testhi.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +testhi.o: ../cups/language.h ../cups/array.h help-index.h +testtemplate.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +testtemplate.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h +testtemplate.o: ../cups/file.h ../cups/language.h ../cups/array.h +testtemplate.o: help-index.h diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 index ae1db0873..f39f30982 100644 --- a/config-scripts/cups-compiler.m4 +++ b/config-scripts/cups-compiler.m4 @@ -27,19 +27,24 @@ AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no], dnl Setup general architecture flags... AC_ARG_WITH(archflags, [ --with-archflags="flags" set default architecture flags ]) +AC_ARG_WITH(ldarchflags, [ --with-ldarchflags="flags" + set default program architecture flags ]) if test -z "$with_archflags"; then ARCHFLAGS="" - LDARCHFLAGS="" else ARCHFLAGS="$with_archflags" +fi + +if test -z "$with_ldarchflags"; then if test "$uname" = Darwin; then - # Only link 32-bit programs - 64-bit is for the shared - # libraries... + # Only create 32-bit programs by default LDARCHFLAGS="`echo $ARCHFLAGS | sed -e '1,$s/-arch x86_64//' -e '1,$s/-arch ppc64//'`" else LDARCHFLAGS="$ARCHFLAGS" fi +else + LDARCHFLAGS="$with_archflags" fi AC_SUBST(ARCHFLAGS) diff --git a/cups/Dependencies b/cups/Dependencies index 3e54079d5..9f00bdad7 100644 --- a/cups/Dependencies +++ b/cups/Dependencies @@ -58,7 +58,7 @@ language.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h language.o: i18n.h transcode.h debug.h localize.o: globals.h string.h ../config.h http-private.h http.h versioning.h localize.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h -localize.o: i18n.h transcode.h debug.h +localize.o: i18n.h transcode.h ppd-private.h debug.h mark.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h mark.o: string.h ../config.h debug.h md5.o: md5.h string.h ../config.h @@ -170,7 +170,7 @@ language.32.o: language.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.32.o: language.c i18n.h transcode.h debug.h localize.32.o: localize.c globals.h string.h ../config.h http-private.h http.h versioning.h localize.32.o: localize.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h -localize.32.o: localize.c i18n.h transcode.h debug.h +localize.32.o: localize.c i18n.h transcode.h ppd-private.h debug.h mark.32.o: mark.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h mark.32.o: mark.c string.h ../config.h debug.h md5.32.o: md5.c md5.h string.h ../config.h @@ -282,7 +282,7 @@ language.64.o: language.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.64.o: language.c i18n.h transcode.h debug.h localize.64.o: localize.c globals.h string.h ../config.h http-private.h http.h versioning.h localize.64.o: localize.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h -localize.64.o: localize.c i18n.h transcode.h debug.h +localize.64.o: localize.c i18n.h transcode.h ppd-private.h debug.h mark.64.o: mark.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h mark.64.o: mark.c string.h ../config.h debug.h md5.64.o: md5.c md5.h string.h ../config.h diff --git a/cups/getputfile.c b/cups/getputfile.c index 1694f498a..6af7b56b1 100644 --- a/cups/getputfile.c +++ b/cups/getputfile.c @@ -78,7 +78,8 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA } if (!http) - http = _cupsConnect(); + if ((http = _cupsConnect()) == NULL) + return (HTTP_SERVICE_UNAVAILABLE); /* * Then send GET requests to the HTTP server... @@ -285,7 +286,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA } if (!http) - http = _cupsConnect(); + if ((http = _cupsConnect()) == NULL) + return (HTTP_SERVICE_UNAVAILABLE); /* * Then send PUT requests to the HTTP server... diff --git a/cups/http.c b/cups/http.c index 82b612aca..2faa1262e 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1292,8 +1292,8 @@ httpRead2(http_t *http, /* I - Connection to server */ char len[32]; /* Length string */ - DEBUG_printf(("httpRead(http=%p, buffer=%p, length=%d)\n", - http, buffer, length)); + DEBUG_printf(("httpRead(http=%p, buffer=%p, length=" CUPS_LLFMT ")\n", + http, buffer, CUPS_LLCAST length)); if (http == NULL || buffer == NULL) return (-1); @@ -1372,12 +1372,12 @@ httpRead2(http_t *http, /* I - Connection to server */ #endif /* HAVE_SSL */ { DEBUG_printf(("httpRead2: reading %d bytes from socket into buffer...\n", - bytes)); + (int)bytes)); bytes = recv(http->fd, http->buffer, bytes, 0); DEBUG_printf(("httpRead2: read %d bytes from socket into buffer...\n", - bytes)); + (int)bytes)); } if (bytes > 0) @@ -1409,7 +1409,8 @@ httpRead2(http_t *http, /* I - Connection to server */ bytes = (ssize_t)length; - DEBUG_printf(("httpRead2: grabbing %d bytes from input buffer...\n", bytes)); + DEBUG_printf(("httpRead2: grabbing %d bytes from input buffer...\n", + (int)bytes)); memcpy(buffer, http->buffer, length); http->used -= (int)length; @@ -1431,7 +1432,8 @@ httpRead2(http_t *http, /* I - Connection to server */ if (!http->blocking && !httpWait(http, 10000)) return (0); - DEBUG_printf(("httpRead2: reading %d bytes from socket...\n", length)); + DEBUG_printf(("httpRead2: reading " CUPS_LLFMT " bytes from socket...\n", + CUPS_LLCAST length)); #ifdef WIN32 bytes = (ssize_t)recv(http->fd, buffer, (int)length, 0); @@ -1441,7 +1443,8 @@ httpRead2(http_t *http, /* I - Connection to server */ break; #endif /* WIN32 */ - DEBUG_printf(("httpRead2: read %d bytes from socket...\n", bytes)); + DEBUG_printf(("httpRead2: read " CUPS_LLFMT " bytes from socket...\n", + CUPS_LLCAST bytes)); } if (bytes > 0) @@ -1487,7 +1490,7 @@ httpRead2(http_t *http, /* I - Connection to server */ #ifdef DEBUG { int i, j, ch; - printf("httpRead2: Read %d bytes:\n", bytes); + printf("httpRead2: Read " CUPS_LLFMT " bytes:\n", CUPS_LLCAST bytes); for (i = 0; i < bytes; i += 16) { printf(" "); @@ -2122,8 +2125,8 @@ httpWrite2(http_t *http, /* I - Connection to server */ ssize_t bytes; /* Bytes written */ - DEBUG_printf(("httpWrite(http=%p, buffer=%p, length=%d)\n", http, - buffer, length)); + DEBUG_printf(("httpWrite(http=%p, buffer=%p, length=" CUPS_LLFMT ")\n", http, + buffer, CUPS_LLCAST length)); /* * Range check input... @@ -2146,8 +2149,8 @@ httpWrite2(http_t *http, /* I - Connection to server */ { if (http->wused && (length + http->wused) > sizeof(http->wbuffer)) { - DEBUG_printf((" flushing buffer (wused=%d, length=%d)\n", - http->wused, length)); + DEBUG_printf((" flushing buffer (wused=%d, length=" CUPS_LLFMT ")\n", + http->wused, CUPS_LLCAST length)); httpFlushWrite(http); } @@ -2158,7 +2161,8 @@ httpWrite2(http_t *http, /* I - Connection to server */ * Write to buffer... */ - DEBUG_printf((" copying %d bytes to wbuffer...\n", length)); + DEBUG_printf((" copying " CUPS_LLFMT " bytes to wbuffer...\n", + CUPS_LLCAST length)); memcpy(http->wbuffer + http->wused, buffer, length); http->wused += (int)length; @@ -2170,14 +2174,15 @@ httpWrite2(http_t *http, /* I - Connection to server */ * Otherwise write the data directly... */ - DEBUG_printf((" writing %d bytes to socket...\n", length)); + DEBUG_printf((" writing " CUPS_LLFMT " bytes to socket...\n", + CUPS_LLCAST length)); if (http->data_encoding == HTTP_ENCODE_CHUNKED) bytes = (ssize_t)http_write_chunk(http, buffer, (int)length); else bytes = (ssize_t)http_write(http, buffer, (int)length); - DEBUG_printf((" wrote %d bytes...\n", bytes)); + DEBUG_printf((" wrote " CUPS_LLFMT " bytes...\n", CUPS_LLCAST bytes)); } if (http->data_encoding == HTTP_ENCODE_LENGTH) diff --git a/cups/i18n.h b/cups/i18n.h index 5bb0fbd65..71eb9f64d 100644 --- a/cups/i18n.h +++ b/cups/i18n.h @@ -103,6 +103,7 @@ extern cups_array_t *_cupsMessageLoad(const char *filename); extern const char *_cupsMessageLookup(cups_array_t *a, const char *m); extern void _cupsSetLocale(char *argv[]); + # ifdef __cplusplus } # endif /* __cplusplus */ diff --git a/cups/libcups.exp b/cups/libcups.exp index c90f5c9d5..35f309431 100644 --- a/cups/libcups.exp +++ b/cups/libcups.exp @@ -31,7 +31,11 @@ __httpWriteCDSA __ippAddAttr __ippFindOption __ippFreeAttr +__ppdFreeLanguages __ppdGetEncoding +__ppdGetLanguages +__ppdHashName +__ppdLocalizedAttr _cupsAddDest _cupsAddOption _cupsAdminCreateWindowsPPD diff --git a/cups/libcups_s.exp b/cups/libcups_s.exp index 71f9c7e69..261f2ab86 100644 --- a/cups/libcups_s.exp +++ b/cups/libcups_s.exp @@ -31,4 +31,8 @@ _cups_strlcpy _httpBIOMethods _ippAddAttr _ippFreeAttr +_ppdFreeLanguages _ppdGetEncoding +_ppdGetLanguages +_ppdHashName +_ppdLocalizedAttr diff --git a/cups/localize.c b/cups/localize.c index 9c91f6260..fc981e2d1 100644 --- a/cups/localize.c +++ b/cups/localize.c @@ -1,5 +1,5 @@ /* - * "$Id: localize.c 6882 2007-08-29 21:05:10Z mike $" + * "$Id: localize.c 7363 2008-03-03 22:19:24Z mike $" * * PPD localization routines for the Common UNIX Printing System (CUPS). * @@ -30,8 +30,12 @@ * attribute. * ppdLocalizeMarkerName() - Get the localized version of a marker-names * attribute value. + * _ppdFreeLanguages() - Free an array of languages from _ppdGetLanguages. + * _ppdGetLanguages() - Get an array of languages from a PPD file. + * _ppdHashName() - Generate a hash value for a device or profile + * name. + * _ppdLocalizedAttr() - Find a localized attribute. * ppd_ll_CC() - Get the current locale names. - * ppd_localized_attr() - Find a localized attribute. */ /* @@ -39,6 +43,7 @@ */ #include "globals.h" +#include "ppd-private.h" #include "debug.h" @@ -46,12 +51,7 @@ * Local functions... */ -static void ppd_ll_CC(char *ll_CC, int ll_CC_size, - char *ll, int ll_size); -static ppd_attr_t *ppd_localized_attr(ppd_file_t *ppd, - const char *keyword, - const char *spec, const char *ll_CC, - const char *ll); +static void ppd_ll_CC(char *ll_CC, int ll_CC_size); /* @@ -76,8 +76,7 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ ppd_attr_t *attr, /* Current attribute */ *locattr; /* Localized attribute */ char ckeyword[PPD_MAX_NAME], /* Custom keyword */ - ll_CC[6], /* Language + country locale */ - ll[3]; /* Language locale */ + ll_CC[6]; /* Language + country locale */ /* @@ -93,7 +92,7 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ * Get the default language... */ - ppd_ll_CC(ll_CC, sizeof(ll_CC), ll, sizeof(ll)); + ppd_ll_CC(ll_CC, sizeof(ll_CC)); /* * Now lookup all of the groups, options, choices, etc. @@ -101,14 +100,14 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++) { - if ((locattr = ppd_localized_attr(ppd, "Translation", group->name, - ll_CC, ll)) != NULL) + if ((locattr = _ppdLocalizedAttr(ppd, "Translation", group->name, + ll_CC)) != NULL) strlcpy(group->text, locattr->text, sizeof(group->text)); for (j = group->num_options, option = group->options; j > 0; j --, option ++) { - if ((locattr = ppd_localized_attr(ppd, "Translation", option->keyword, - ll_CC, ll)) != NULL) + if ((locattr = _ppdLocalizedAttr(ppd, "Translation", option->keyword, + ll_CC)) != NULL) strlcpy(option->text, locattr->text, sizeof(option->text)); for (k = option->num_choices, choice = option->choices; @@ -116,13 +115,13 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ k --, choice ++) { if (strcmp(choice->choice, "Custom")) - locattr = ppd_localized_attr(ppd, option->keyword, choice->choice, - ll_CC, ll); + locattr = _ppdLocalizedAttr(ppd, option->keyword, choice->choice, + ll_CC); else { snprintf(ckeyword, sizeof(ckeyword), "Custom%s", option->keyword); - locattr = ppd_localized_attr(ppd, ckeyword, "True", ll_CC, ll); + locattr = _ppdLocalizedAttr(ppd, ckeyword, "True", ll_CC); } if (locattr) @@ -145,8 +144,8 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ { snprintf(ckeyword, sizeof(ckeyword), "ParamCustom%s", coption->keyword); - if ((locattr = ppd_localized_attr(ppd, ckeyword, cparam->name, - ll_CC, ll)) != NULL) + if ((locattr = _ppdLocalizedAttr(ppd, ckeyword, cparam->name, + ll_CC)) != NULL) strlcpy(cparam->text, locattr->text, sizeof(cparam->text)); } } @@ -157,8 +156,8 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ if ((attr = ppdFindAttr(ppd, "APCustomColorMatchingName", NULL)) != NULL) { - if ((locattr = ppd_localized_attr(ppd, "APCustomColorMatchingName", - attr->spec, ll_CC, ll)) != NULL) + if ((locattr = _ppdLocalizedAttr(ppd, "APCustomColorMatchingName", + attr->spec, ll_CC)) != NULL) strlcpy(attr->text, locattr->text, sizeof(attr->text)); } @@ -168,8 +167,8 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ { cupsArraySave(ppd->sorted_attrs); - if ((locattr = ppd_localized_attr(ppd, "cupsICCProfile", attr->spec, - ll_CC, ll)) != NULL) + if ((locattr = _ppdLocalizedAttr(ppd, "cupsICCProfile", attr->spec, + ll_CC)) != NULL) strlcpy(attr->text, locattr->text, sizeof(attr->text)); cupsArrayRestore(ppd->sorted_attrs); @@ -185,8 +184,8 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ { cupsArraySave(ppd->sorted_attrs); - if ((locattr = ppd_localized_attr(ppd, "APPrinterPreset", attr->spec, - ll_CC, ll)) != NULL) + if ((locattr = _ppdLocalizedAttr(ppd, "APPrinterPreset", attr->spec, + ll_CC)) != NULL) strlcpy(attr->text, locattr->text, sizeof(attr->text)); cupsArrayRestore(ppd->sorted_attrs); @@ -220,7 +219,6 @@ ppdLocalizeIPPReason( { ppd_attr_t *locattr; /* Localized attribute */ char ll_CC[6], /* Language + country locale */ - ll[3], /* Language locale */ *bufptr, /* Pointer into buffer */ *bufend, /* Pointer to end of buffer */ *valptr; /* Pointer into value */ @@ -243,14 +241,14 @@ ppdLocalizeIPPReason( * Get the default language... */ - ppd_ll_CC(ll_CC, sizeof(ll_CC), ll, sizeof(ll)); + ppd_ll_CC(ll_CC, sizeof(ll_CC)); /* * Find the localized attribute... */ - if ((locattr = ppd_localized_attr(ppd, "cupsIPPReason", reason, - ll_CC, ll)) == NULL) + if ((locattr = _ppdLocalizedAttr(ppd, "cupsIPPReason", reason, + ll_CC)) == NULL) locattr = ppdFindAttr(ppd, "cupsIPPReason", reason); if (!locattr) @@ -405,8 +403,7 @@ ppdLocalizeMarkerName( const char *name) /* I - Marker name to look up */ { ppd_attr_t *locattr; /* Localized attribute */ - char ll_CC[6], /* Language + country locale */ - ll[3]; /* Language locale */ + char ll_CC[6]; /* Language + country locale */ /* @@ -420,14 +417,14 @@ ppdLocalizeMarkerName( * Get the default language... */ - ppd_ll_CC(ll_CC, sizeof(ll_CC), ll, sizeof(ll)); + ppd_ll_CC(ll_CC, sizeof(ll_CC)); /* * Find the localized attribute... */ - if ((locattr = ppd_localized_attr(ppd, "cupsMarkerName", name, - ll_CC, ll)) == NULL) + if ((locattr = _ppdLocalizedAttr(ppd, "cupsMarkerName", name, + ll_CC)) == NULL) locattr = ppdFindAttr(ppd, "cupsMarkerName", name); return (locattr ? locattr->text : NULL); @@ -435,87 +432,140 @@ ppdLocalizeMarkerName( /* - * 'ppd_ll_CC()' - Get the current locale names. + * '_ppdFreeLanguages()' - Free an array of languages from _ppdGetLanguages. */ -static void -ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */ - int ll_CC_size, /* I - Size of country-specific name */ - char *ll, /* O - Generic locale name */ - int ll_size) /* I - Size of generic name */ +void +_ppdFreeLanguages( + cups_array_t *languages) /* I - Languages array */ { - cups_lang_t *lang; /* Current language */ + char *language; /* Current language */ + + + for (language = (char *)cupsArrayFirst(languages); + language; + language = (char *)cupsArrayNext(languages)) + free(language); + + cupsArrayDelete(languages); +} + + +/* + * '_ppdGetLanguages()' - Get an array of languages from a PPD file. + */ + +cups_array_t * /* O - Languages array */ +_ppdGetLanguages(ppd_file_t *ppd) /* I - PPD file */ +{ + cups_array_t *languages; /* Languages array */ + ppd_attr_t *attr; /* cupsLanguages attribute */ + char *value, /* Copy of attribute value */ + *start, /* Start of current language */ + *ptr; /* Pointer into languages */ /* - * Get the current locale... + * See if we have a cupsLanguages attribute... */ - if ((lang = cupsLangDefault()) == NULL) - { - strlcpy(ll_CC, "en_US", ll_CC_size); - strlcpy(ll, "en", ll_size); - return; - } + if ((attr = ppdFindAttr(ppd, "cupsLanguages", NULL)) == NULL || !attr->value) + return (NULL); /* - * Copy the locale name... + * Yes, load the list... */ - strlcpy(ll_CC, lang->language, ll_CC_size); - strlcpy(ll, lang->language, ll_size); + if ((languages = cupsArrayNew((cups_array_func_t)strcmp, NULL)) == NULL) + return (NULL); - DEBUG_printf(("ll_CC=\"%s\", ll=\"%s\"\n", ll_CC, ll)); + if ((value = strdup(attr->value)) == NULL) + { + cupsArrayDelete(languages); + return (NULL); + } - if (strlen(ll_CC) == 2) + for (ptr = value; *ptr;) { /* - * Map "ll" to primary/origin country locales to have the best - * chance of finding a match... + * Skip leading whitespace... */ - if (!strcmp(ll_CC, "cs")) - strlcpy(ll_CC, "cs_CZ", ll_CC_size); - else if (!strcmp(ll_CC, "en")) - strlcpy(ll_CC, "en_US", ll_CC_size); - else if (!strcmp(ll_CC, "ja")) - strlcpy(ll_CC, "ja_JP", ll_CC_size); - else if (!strcmp(ll_CC, "sv")) - strlcpy(ll_CC, "sv_SE", ll_CC_size); - else if (!strcmp(ll_CC, "zh")) /* Simplified Chinese */ - strlcpy(ll_CC, "zh_CN", ll_CC_size); - else if (ll_CC_size >= 6) - { - ll_CC[2] = '_'; - ll_CC[3] = toupper(ll_CC[0] & 255); - ll_CC[4] = toupper(ll_CC[1] & 255); - ll_CC[5] = '\0'; - } + while (isspace(*ptr & 255)) + ptr ++; + + if (!*ptr) + break; + + /* + * Find the end of this language name... + */ + + for (start = ptr; *ptr && !isspace(*ptr & 255); ptr ++); + + if (*ptr) + *ptr++ = '\0'; + + if (!strcmp(start, "en")) + continue; + + cupsArrayAdd(languages, strdup(start)); + } + + /* + * Free the temporary string and return either an array with one or more + * values or a NULL pointer... + */ + + free(value); + + if (cupsArrayCount(languages) == 0) + { + cupsArrayDelete(languages); + return (NULL); } + else + return (languages); +} + + +/* + * '_ppdHashName()' - Generate a hash value for a device or profile name. + * + * This function is primarily used on Mac OS X, but is generally accessible + * since cupstestppd needs to check for profile name collisions in PPD files... + */ + +unsigned /* O - Hash value */ +_ppdHashName(const char *name) /* I - Name to hash */ +{ + int mult; /* Multiplier */ + unsigned hash = 0; /* Hash value */ + - DEBUG_printf(("ppd_ll_CC: lang->language=\"%s\", ll=\"%s\", ll_CC=\"%s\"...\n", - lang->language, ll, ll_CC)); + for (mult = 1; *name && mult <= 128; mult ++, name ++) + hash += (*name & 255) * mult; + + return (hash); } /* - * 'ppd_localized_attr()' - Find a localized attribute. + * '_ppdLocalizedAttr()' - Find a localized attribute. */ -static ppd_attr_t * /* O - Localized attribute or NULL */ -ppd_localized_attr(ppd_file_t *ppd, /* I - PPD file */ - const char *keyword, /* I - Main keyword */ - const char *spec, /* I - Option keyword */ - const char *ll_CC, /* I - Language + country locale */ - const char *ll) /* I - Language locale */ +ppd_attr_t * /* O - Localized attribute or NULL */ +_ppdLocalizedAttr(ppd_file_t *ppd, /* I - PPD file */ + const char *keyword, /* I - Main keyword */ + const char *spec, /* I - Option keyword */ + const char *ll_CC) /* I - Language + country locale */ { char lkeyword[PPD_MAX_NAME]; /* Localization keyword */ ppd_attr_t *attr; /* Current attribute */ - DEBUG_printf(("ppd_text(ppd=%p, keyword=\"%s\", spec=\"%s\", " - "ll_CC=\"%s\", ll=\"%s\")\n", - ppd, keyword, spec, ll_CC, ll)); + DEBUG_printf(("_ppdLocalizedAttr(ppd=%p, keyword=\"%s\", spec=\"%s\", " + "ll_CC=\"%s\")\n", ppd, keyword, spec, ll_CC)); /* * Look for Keyword.ll_CC, then Keyword.ll... @@ -524,12 +574,12 @@ ppd_localized_attr(ppd_file_t *ppd, /* I - PPD file */ snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll_CC, keyword); if ((attr = ppdFindAttr(ppd, lkeyword, spec)) == NULL) { - snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll, keyword); + snprintf(lkeyword, sizeof(lkeyword), "%2s.%s", ll_CC, keyword); attr = ppdFindAttr(ppd, lkeyword, spec); if (!attr) { - if (!strcmp(ll, "ja")) + if (!strncmp(ll_CC, "ja", 2)) { /* * Due to a bug in the CUPS DDK 1.1.0 ppdmerge program, Japanese @@ -541,7 +591,7 @@ ppd_localized_attr(ppd_file_t *ppd, /* I - PPD file */ snprintf(lkeyword, sizeof(lkeyword), "jp.%s", keyword); attr = ppdFindAttr(ppd, lkeyword, spec); } - else if (!strcmp(ll, "no")) + else if (!strncmp(ll_CC, "no", 2)) { /* * Norway has two languages, "Bokmal" (the primary one) @@ -568,5 +618,63 @@ ppd_localized_attr(ppd_file_t *ppd, /* I - PPD file */ /* - * End of "$Id: localize.c 6882 2007-08-29 21:05:10Z mike $". + * 'ppd_ll_CC()' - Get the current locale names. + */ + +static void +ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */ + int ll_CC_size) /* I - Size of country-specific name */ +{ + cups_lang_t *lang; /* Current language */ + + + /* + * Get the current locale... + */ + + if ((lang = cupsLangDefault()) == NULL) + { + strlcpy(ll_CC, "en_US", ll_CC_size); + return; + } + + /* + * Copy the locale name... + */ + + strlcpy(ll_CC, lang->language, ll_CC_size); + + if (strlen(ll_CC) == 2) + { + /* + * Map "ll" to primary/origin country locales to have the best + * chance of finding a match... + */ + + if (!strcmp(ll_CC, "cs")) + strlcpy(ll_CC, "cs_CZ", ll_CC_size); + else if (!strcmp(ll_CC, "en")) + strlcpy(ll_CC, "en_US", ll_CC_size); + else if (!strcmp(ll_CC, "ja")) + strlcpy(ll_CC, "ja_JP", ll_CC_size); + else if (!strcmp(ll_CC, "sv")) + strlcpy(ll_CC, "sv_SE", ll_CC_size); + else if (!strcmp(ll_CC, "zh")) /* Simplified Chinese */ + strlcpy(ll_CC, "zh_CN", ll_CC_size); + else if (ll_CC_size >= 6) + { + ll_CC[2] = '_'; + ll_CC[3] = toupper(ll_CC[0] & 255); + ll_CC[4] = toupper(ll_CC[1] & 255); + ll_CC[5] = '\0'; + } + } + + DEBUG_printf(("ppd_ll_CC: lang->language=\"%s\", ll_CC=\"%s\"...\n", + lang->language, ll_CC)); +} + + +/* + * End of "$Id: localize.c 7363 2008-03-03 22:19:24Z mike $". */ diff --git a/cups/ppd-private.h b/cups/ppd-private.h new file mode 100644 index 000000000..ffbebfc59 --- /dev/null +++ b/cups/ppd-private.h @@ -0,0 +1,64 @@ +/* + * "$Id$" + * + * Private PPD definitions for the Common UNIX Printing System (CUPS). + * + * Copyright 2007-2008 by Apple Inc. + * Copyright 1997-2007 by Easy Software Products, all rights reserved. + * + * These coded instructions, statements, and computer programs are the + * property of Apple Inc. and are protected by Federal copyright + * law. Distribution and use rights are outlined in the file "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". + * + * PostScript is a trademark of Adobe Systems, Inc. + * + * This code and any derivative of it may be used and distributed + * freely under the terms of the GNU General Public License when + * used with GNU Ghostscript or its derivatives. Use of the code + * (or any derivative of it) with software other than GNU + * GhostScript (or its derivatives) is governed by the CUPS license + * agreement. + * + * This file is subject to the Apple OS-Developed Software exception. + */ + +#ifndef _CUPS_PPD_PRIVATE_H_ +# define _CUPS_PPD_PRIVATE_H_ + +/* + * Include necessary headers... + */ + +# include "ppd.h" + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +extern void _ppdFreeLanguages(cups_array_t *languages); +extern cups_array_t *_ppdGetLanguages(ppd_file_t *ppd); +extern unsigned _ppdHashName(const char *name); +extern ppd_attr_t *_ppdLocalizedAttr(ppd_file_t *ppd, const char *keyword, + const char *spec, const char *ll_CC); + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +} +# endif /* __cplusplus */ +#endif /* !_CUPS_PPD_PRIVATE_H_ */ + +/* + * End of "$Id$". + */ diff --git a/cups/request.c b/cups/request.c index bab7c7e66..99cf9ff5a 100644 --- a/cups/request.c +++ b/cups/request.c @@ -65,6 +65,12 @@ cupsDoFileRequest(http_t *http, /* I - Connection to server or @code CUPS_HT int infile; /* Input file */ + DEBUG_printf(("cupsDoFileRequest(http=%p, request=%p(%s), resource=\"%s\", " + "filename=\"%s\")\n", http, request, + request ? ippOpString(request->request.op.operation_id) : "?", + resource ? resource : "(null)", + filename ? filename : "(null)")); + if (filename) { if ((infile = open(filename, O_RDONLY | O_BINARY)) < 0) @@ -124,8 +130,9 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP char buffer[32768]; /* Output buffer */ - DEBUG_printf(("cupsDoIORequest(http=%p, request=%p, resource=\"%s\"" + DEBUG_printf(("cupsDoIORequest(http=%p, request=%p(%s), resource=\"%s\", " "infile=%d, outfile=%d)\n", http, request, + request ? ippOpString(request->request.op.operation_id) : "?", resource ? resource : "(null)", infile, outfile)); /* @@ -146,7 +153,8 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP */ if (!http) - http = _cupsConnect(); + if ((http = _cupsConnect()) == NULL) + return (NULL); /* * See if we have a file to send... @@ -296,6 +304,11 @@ cupsDoRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP_ ipp_t *request, /* I - IPP request */ const char *resource) /* I - HTTP resource for POST */ { + DEBUG_printf(("cupsDoRequest(http=%p, request=%p(%s), resource=\"%s\")\n", + http, request, + request ? ippOpString(request->request.op.operation_id) : "?", + resource ? resource : "(null)")); + return (cupsDoFileRequest(http, request, resource, NULL)); } @@ -319,7 +332,8 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP ipp_t *response = NULL; /* IPP response */ - DEBUG_printf(("cupsGetReponse(http=%p)\n", http)); + DEBUG_printf(("cupsGetReponse(http=%p, resource=\"%s\")\n", http, + resource ? resource : "(null)")); /* * Connect to the default server as needed... @@ -351,12 +365,12 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP * Wait for a response from the server... */ - DEBUG_puts("cupsGetResponse: update..."); + DEBUG_puts("cupsGetResponse: Update loop..."); while ((status = httpUpdate(http)) == HTTP_CONTINUE) /* Do nothing but update */; - DEBUG_printf(("cupsGetResponse: status = %d\n", status)); + DEBUG_printf(("cupsGetResponse: status=%d\n", status)); if (status == HTTP_OK) { @@ -376,7 +390,7 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP * Delete the response... */ - DEBUG_puts("IPP read error!"); + DEBUG_puts("cupsGetResponse: IPP read error!"); ippDelete(response); response = NULL; @@ -434,6 +448,10 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT); + DEBUG_printf(("cupsGetResponse: status-code=%s, status-message=\"%s\"\n", + ippErrorString(response->request.status.status_code), + attr ? attr->values[0].string.text : "")); + _cupsSetError(response->request.status.status_code, attr ? attr->values[0].string.text : ippErrorString(response->request.status.status_code)); @@ -464,6 +482,9 @@ cupsReadResponseData( * Get the default connection as needed... */ + DEBUG_printf(("cupsReadResponseData(http=%p, buffer=%p, " + "length=" CUPS_LLFMT ")\n", http, buffer, CUPS_LLCAST length)); + if (!http) { _cups_globals_t *cg = _cupsGlobals(); @@ -510,8 +531,9 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP http_status_t expect; /* Expect: header to use */ - DEBUG_printf(("cupsSendRequest(http=%p, request=%p, resource=\"%s\", " + DEBUG_printf(("cupsSendRequest(http=%p, request=%p(%s), resource=\"%s\", " "length=" CUPS_LLFMT ")\n", http, request, + request ? ippOpString(request->request.op.operation_id) : "?", resource ? resource : "(null)", CUPS_LLCAST length)); /* @@ -530,7 +552,8 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP */ if (!http) - http = _cupsConnect(); + if ((http = _cupsConnect()) == NULL) + return (HTTP_SERVICE_UNAVAILABLE); #ifdef HAVE_SSL /* @@ -554,7 +577,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP for (;;) { - DEBUG_puts("cupsSendRequest: setup..."); + DEBUG_puts("cupsSendRequest: Setup..."); /* * Setup the HTTP variables needed... @@ -572,7 +595,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP * Try the request... */ - DEBUG_puts("cupsSendRequest: post..."); + DEBUG_puts("cupsSendRequest: Sending HTTP POST..."); if (httpPost(http, resource)) { @@ -586,7 +609,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP * Send the IPP data... */ - DEBUG_puts("cupsSendRequest: ipp write..."); + DEBUG_puts("cupsSendRequest: Writing IPP request..."); request->state = IPP_IDLE; status = HTTP_CONTINUE; @@ -609,12 +632,18 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP if (!got_status && expect == HTTP_CONTINUE) { + DEBUG_puts("cupsSendRequest: Waiting for 100-continue..."); + if (httpWait(http, 1000)) status = httpUpdate(http); + else + status = HTTP_EXPECTATION_FAILED; } else if (httpCheck(http)) status = httpUpdate(http); + DEBUG_printf(("cupsSendRequest: status=%d\n", status)); + /* * Process the current HTTP status... */ @@ -654,6 +683,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP */ expect = (http_status_t)0; + break; default : /* @@ -685,6 +715,9 @@ cupsWriteRequestData( * Get the default connection as needed... */ + DEBUG_printf(("cupsWriteRequestData(http=%p, buffer=%p, " + "length=" CUPS_LLFMT ")\n", http, buffer, CUPS_LLCAST length)); + if (!http) { _cups_globals_t *cg = _cupsGlobals(); @@ -738,6 +771,9 @@ _cupsSetError(ipp_status_t status, /* I - IPP status code */ if (message) cg->last_status_message = strdup(message); + + DEBUG_printf(("_cupsSetError: last_error=%s, last_status_message=\"%s\"\n", + ippErrorString(cg->last_error), message ? message : "")); } diff --git a/cups/util.c b/cups/util.c index a572e6fa9..7c7e4f406 100644 --- a/cups/util.c +++ b/cups/util.c @@ -942,7 +942,8 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL */ if (!http) - http = _cupsConnect(); + if ((http = _cupsConnect()) == NULL) + return (HTTP_SERVICE_UNAVAILABLE); if (!cups_get_printer_uri(http, name, hostname, sizeof(hostname), &port, resource, sizeof(resource), 0)) diff --git a/locale/Dependencies b/locale/Dependencies index 8b2873ab3..8541e9d26 100644 --- a/locale/Dependencies +++ b/locale/Dependencies @@ -1,7 +1,9 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -po2strings.o: po2strings.c ../cups/i18n.h ../cups/transcode.h \ - ../cups/language.h ../cups/array.h -strings2po.o: strings2po.c -translate.o: translate.c ../cups/string.h ../config.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/language.h \ - ../cups/array.h + +checkpo.o: ../cups/string.h ../config.h ../cups/i18n.h ../cups/transcode.h +checkpo.o: ../cups/language.h ../cups/array.h ../cups/versioning.h +po2strings.o: ../cups/i18n.h ../cups/transcode.h ../cups/language.h +po2strings.o: ../cups/array.h ../cups/versioning.h +translate.o: ../cups/string.h ../config.h ../cups/file.h ../cups/versioning.h +translate.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h +translate.o: ../cups/language.h ../cups/array.h diff --git a/man/cupstestppd.man b/man/cupstestppd.man index 6cd622bdf..9cbfbd0e4 100644 --- a/man/cupstestppd.man +++ b/man/cupstestppd.man @@ -3,7 +3,7 @@ .\" .\" cupstestppd man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 2007 by Apple Inc. +.\" Copyright 2007-2008 by Apple Inc. .\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the @@ -59,6 +59,10 @@ Except for size-related options, report all default option errors as warnings. .br Report all filter errors as warnings. .TP 5 +-W profiles +.br +Report all profile errors as warnings. +.TP 5 -W translations .br Report all translation errors as warnings. @@ -137,7 +141,7 @@ http://localhost:631/help .br Adobe PostScript Printer Description File Format Specification, Version 4.3. .SH COPYRIGHT -Copyright 2007 by Apple Inc. +Copyright 2007-2008 by Apple Inc. .\" .\" End of "$Id: cupstestppd.man 6649 2007-07-11 21:46:42Z mike $". .\" diff --git a/monitor/Dependencies b/monitor/Dependencies index fed36ed6b..af9676644 100644 --- a/monitor/Dependencies +++ b/monitor/Dependencies @@ -1,7 +1,8 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -bcp.o: bcp.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h -tbcp.o: tbcp.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h + +bcp.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h +bcp.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h ../cups/array.h +bcp.o: ../cups/file.h ../cups/language.h +tbcp.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h +tbcp.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h ../cups/array.h +tbcp.o: ../cups/file.h ../cups/language.h diff --git a/notifier/Dependencies b/notifier/Dependencies index bb815b1be..a27cdfea4 100644 --- a/notifier/Dependencies +++ b/notifier/Dependencies @@ -1,10 +1,12 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -mailto.o: mailto.c ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h -rss.o: rss.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h ../cups/language.h \ - ../cups/string.h ../config.h ../cups/array.h -testnotify.o: testnotify.c ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/language.h ../cups/string.h ../config.h + +mailto.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h +mailto.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +mailto.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +rss.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h +rss.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +rss.o: ../cups/language.h ../cups/string.h ../config.h ../cups/array.h +testnotify.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h +testnotify.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h +testnotify.o: ../cups/file.h ../cups/language.h ../cups/language.h +testnotify.o: ../cups/string.h ../config.h diff --git a/ppdc/Dependencies b/ppdc/Dependencies index 3cd35def7..5e7bbc69e 100644 --- a/ppdc/Dependencies +++ b/ppdc/Dependencies @@ -4,6 +4,17 @@ drv.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h drv.o: ../cups/versioning.h ../cups/cups.h ../cups/ipp.h ../cups/http.h drv.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h drv.o: ../cups/dir.h +ppdc.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h +ppdc.o: ../cups/versioning.h +ppdhtml.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h +ppdhtml.o: ../cups/versioning.h +ppdi.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h +ppdi.o: ../cups/versioning.h +ppdmerge.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h +ppdmerge.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +ppdmerge.o: ../cups/array.h ../cups/string.h ../config.h +ppdpo.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h +ppdpo.o: ../cups/versioning.h ppdc-array.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h ppdc-array.o: ../cups/versioning.h ppdc-attr.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h @@ -49,20 +60,9 @@ ppdc-source.o: ../cups/http-private.h ../cups/http.h ../cups/md5.h ppdc-source.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h ppdc-source.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ppdc-source.o: ../cups/language.h ../cups/i18n.h ../cups/transcode.h -ppdc-source.o: ../data/epson.h ../data/escp.h ../data/hp.h ../data/label.h -ppdc-source.o: ../data/pcl.h +ppdc-source.o: ../cups/raster.h ../cups/cups.h ../data/epson.h ../data/escp.h +ppdc-source.o: ../data/hp.h ../data/label.h ../data/pcl.h ppdc-string.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h ppdc-string.o: ../cups/versioning.h ppdc-variable.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h ppdc-variable.o: ../cups/versioning.h -ppdc.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h -ppdc.o: ../cups/versioning.h -ppdhtml.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h -ppdhtml.o: ../cups/versioning.h -ppdi.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h -ppdi.o: ../cups/versioning.h -ppdmerge.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h -ppdmerge.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h -ppdmerge.o: ../cups/array.h ../cups/string.h ../config.h -ppdpo.o: ppdc.h ../cups/string.h ../config.h ../cups/file.h -ppdpo.o: ../cups/versioning.h diff --git a/ppdc/ppdc-source.cxx b/ppdc/ppdc-source.cxx index c85dd6c60..e397f0abb 100644 --- a/ppdc/ppdc-source.cxx +++ b/ppdc/ppdc-source.cxx @@ -1183,8 +1183,8 @@ ppdcSource::get_installable(ppdcFile *fp) int // O - Integer value ppdcSource::get_integer(const char *v) // I - Value string { - int val; // Value - int temp; // Temporary value + long val; // Value + long temp; // Temporary value char *newv; // New value string pointer @@ -1199,7 +1199,7 @@ ppdcSource::get_integer(const char *v) // I - Value string if (*v || val == LONG_MIN) return (-1); else - return (val); + return ((int)val); } else if (*v == '(') { @@ -1220,7 +1220,7 @@ ppdcSource::get_integer(const char *v) // I - Value string } if (*v == ')') - return (val); + return ((int)val); else return (-1); } diff --git a/scheduler/Dependencies b/scheduler/Dependencies index cd7664659..9bf513e2d 100644 --- a/scheduler/Dependencies +++ b/scheduler/Dependencies @@ -1,222 +1,243 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -auth.o: auth.c cupsd.h ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h \ - ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h \ - sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h classes.h \ - job.h conf.h banners.h dirsvc.h network.h subscriptions.h -banners.o: banners.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h ../cups/dir.h -cert.o: cert.c cupsd.h ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h \ - ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h \ - sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h classes.h \ - job.h conf.h banners.h dirsvc.h network.h subscriptions.h -classes.o: classes.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -client.o: client.c ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h cupsd.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -conf.o: conf.c cupsd.h ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h \ - ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h \ - sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h classes.h \ - job.h conf.h banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h -dirsvc.o: dirsvc.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -env.o: env.c cupsd.h ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h \ - ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h \ - sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h classes.h \ - job.h conf.h banners.h dirsvc.h network.h subscriptions.h -main.o: main.c cupsd.h ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h \ - ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h \ - sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h classes.h \ - job.h conf.h banners.h dirsvc.h network.h subscriptions.h -ipp.o: ipp.c cupsd.h ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h \ - ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h \ - sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h classes.h \ - job.h conf.h banners.h dirsvc.h network.h subscriptions.h -listen.o: listen.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -job.o: job.c cupsd.h ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h \ - ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h \ - sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h classes.h \ - job.h conf.h banners.h dirsvc.h network.h subscriptions.h \ - ../cups/backend.h ../cups/dir.h -log.o: log.c cupsd.h ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h \ - ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h \ - ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h \ - sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h classes.h \ - job.h conf.h banners.h dirsvc.h network.h subscriptions.h -network.o: network.c ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h cupsd.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -policy.o: policy.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -printers.o: printers.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h ../cups/dir.h -process.o: process.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -quotas.o: quotas.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -select.o: select.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -server.o: server.c ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h cupsd.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -statbuf.o: statbuf.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -subscriptions.o: subscriptions.c cupsd.h ../cups/http-private.h \ - ../config.h ../cups/http.h ../cups/md5.h ../cups/ipp-private.h \ - ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h mime.h \ - ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h \ - ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h \ - client.h policy.h printers.h classes.h job.h conf.h banners.h dirsvc.h \ - network.h subscriptions.h -sysman.o: sysman.c cupsd.h ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h \ - ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h \ - ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h \ - ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h \ - printers.h classes.h job.h conf.h banners.h dirsvc.h network.h \ - subscriptions.h -filter.o: filter.c ../cups/debug.h ../cups/string.h ../config.h mime.h \ - ../cups/array.h ../cups/ipp.h ../cups/http.h ../cups/file.h -mime.o: mime.c ../cups/debug.h ../cups/dir.h ../cups/string.h ../config.h \ - mime.h ../cups/array.h ../cups/ipp.h ../cups/http.h ../cups/file.h -type.o: type.c ../cups/string.h ../config.h mime.h ../cups/array.h \ - ../cups/ipp.h ../cups/http.h ../cups/file.h ../cups/debug.h -cupsfilter.o: cupsfilter.c ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h mime.h \ - ../cups/array.h ../cups/ipp.h ../cups/file.h -cups-deviced.o: cups-deviced.c util.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/file.h ../cups/string.h ../config.h \ - ../cups/array.h ../cups/dir.h -cups-driverd.o: cups-driverd.c util.h ../cups/cups.h ../cups/ipp.h \ - ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/file.h ../cups/string.h ../config.h \ - ../cups/dir.h ../cups/transcode.h -cups-lpd.o: cups-lpd.c ../cups/http-private.h ../config.h ../cups/http.h \ - ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/string.h ../cups/language.h -cups-polld.o: cups-polld.c ../cups/http-private.h ../config.h \ - ../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \ - ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h \ - ../cups/language.h ../cups/language.h ../cups/string.h -testdirsvc.o: testdirsvc.c ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/string.h ../config.h -testlpd.o: testlpd.c ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/string.h ../config.h -testmime.o: testmime.c ../cups/string.h ../config.h mime.h \ - ../cups/array.h ../cups/ipp.h ../cups/http.h ../cups/file.h \ - ../cups/dir.h -testspeed.o: testspeed.c ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/language.h ../cups/debug.h -testsub.o: testsub.c ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/debug.h ../cups/string.h ../config.h -util.o: util.c util.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \ - ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \ - ../cups/file.h ../cups/string.h ../config.h + +auth.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +auth.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +auth.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +auth.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +auth.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +auth.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h +auth.o: client.h policy.h printers.h classes.h job.h conf.h banners.h +auth.o: dirsvc.h network.h subscriptions.h +banners.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +banners.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +banners.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +banners.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +banners.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +banners.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +banners.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +banners.o: banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h +cert.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +cert.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +cert.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +cert.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +cert.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +cert.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h +cert.o: client.h policy.h printers.h classes.h job.h conf.h banners.h +cert.o: dirsvc.h network.h subscriptions.h +classes.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +classes.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +classes.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +classes.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +classes.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +classes.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +classes.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +classes.o: banners.h dirsvc.h network.h subscriptions.h +client.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +client.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +client.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +client.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +client.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +client.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +client.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +client.o: banners.h dirsvc.h network.h subscriptions.h +conf.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +conf.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +conf.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +conf.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +conf.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +conf.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h +conf.o: client.h policy.h printers.h classes.h job.h conf.h banners.h +conf.o: dirsvc.h network.h subscriptions.h +dirsvc.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +dirsvc.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +dirsvc.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +dirsvc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +dirsvc.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +dirsvc.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +dirsvc.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +dirsvc.o: banners.h dirsvc.h network.h subscriptions.h +env.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +env.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h +env.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h +env.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h +env.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h +env.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h +env.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h +env.o: subscriptions.h +main.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +main.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +main.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +main.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +main.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +main.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h +main.o: client.h policy.h printers.h classes.h job.h conf.h banners.h +main.o: dirsvc.h network.h subscriptions.h ../cups/dir.h +ipp.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +ipp.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h +ipp.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h +ipp.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h +ipp.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h +ipp.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h +ipp.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h +ipp.o: subscriptions.h ../cups/ppd-private.h +listen.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +listen.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +listen.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +listen.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +listen.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +listen.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +listen.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +listen.o: banners.h dirsvc.h network.h subscriptions.h +job.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +job.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h +job.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h +job.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h +job.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h +job.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h +job.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h +job.o: subscriptions.h ../cups/backend.h ../cups/dir.h +log.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +log.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h +log.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h +log.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h +log.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h +log.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h +log.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h +log.o: subscriptions.h +network.o: ../cups/http-private.h ../config.h ../cups/http.h +network.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +network.o: ../cups/ipp.h cupsd.h ../cups/string.h ../cups/array.h +network.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h +network.o: ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h +network.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h +network.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +network.o: classes.h job.h conf.h banners.h dirsvc.h network.h +network.o: subscriptions.h +policy.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +policy.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +policy.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +policy.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +policy.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +policy.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +policy.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +policy.o: banners.h dirsvc.h network.h subscriptions.h +printers.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +printers.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +printers.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +printers.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +printers.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +printers.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +printers.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +printers.o: banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h +process.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +process.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +process.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +process.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +process.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +process.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +process.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +process.o: banners.h dirsvc.h network.h subscriptions.h +quotas.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +quotas.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +quotas.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +quotas.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +quotas.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +quotas.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +quotas.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +quotas.o: banners.h dirsvc.h network.h subscriptions.h +removefile.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +removefile.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +removefile.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +removefile.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +removefile.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h +removefile.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h sysman.h +removefile.o: statbuf.h cert.h auth.h client.h policy.h printers.h classes.h +removefile.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h +select.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +select.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +select.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +select.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +select.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +select.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +select.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +select.o: banners.h dirsvc.h network.h subscriptions.h +server.o: ../cups/http-private.h ../config.h ../cups/http.h +server.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +server.o: ../cups/ipp.h cupsd.h ../cups/string.h ../cups/array.h +server.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h +server.o: ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h +server.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h +server.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +server.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h +statbuf.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +statbuf.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +statbuf.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +statbuf.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +statbuf.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +statbuf.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +statbuf.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +statbuf.o: banners.h dirsvc.h network.h subscriptions.h +subscriptions.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +subscriptions.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +subscriptions.o: ../cups/ipp.h ../cups/string.h ../cups/array.h +subscriptions.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h +subscriptions.o: ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h +subscriptions.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h +subscriptions.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h +subscriptions.o: policy.h printers.h classes.h job.h conf.h banners.h +subscriptions.o: dirsvc.h network.h subscriptions.h +sysman.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h +sysman.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +sysman.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h +sysman.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +sysman.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h +sysman.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h +sysman.o: auth.h client.h policy.h printers.h classes.h job.h conf.h +sysman.o: banners.h dirsvc.h network.h subscriptions.h +filter.o: ../cups/debug.h ../cups/string.h ../config.h mime.h ../cups/array.h +filter.o: ../cups/versioning.h ../cups/ipp.h ../cups/file.h +mime.o: ../cups/debug.h ../cups/dir.h ../cups/versioning.h ../cups/string.h +mime.o: ../config.h mime.h ../cups/array.h ../cups/ipp.h ../cups/file.h +type.o: ../cups/string.h ../config.h mime.h ../cups/array.h +type.o: ../cups/versioning.h ../cups/ipp.h ../cups/file.h ../cups/debug.h +cupsfilter.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h +cupsfilter.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h +cupsfilter.o: ../cups/file.h ../cups/language.h ../cups/i18n.h +cupsfilter.o: ../cups/transcode.h ../cups/string.h ../config.h mime.h +cupsfilter.o: ../cups/array.h ../cups/ipp.h ../cups/file.h +cups-deviced.o: util.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +cups-deviced.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h +cups-deviced.o: ../cups/file.h ../cups/language.h ../cups/file.h +cups-deviced.o: ../cups/string.h ../config.h ../cups/array.h ../cups/dir.h +cups-driverd.o: util.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +cups-driverd.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h +cups-driverd.o: ../cups/file.h ../cups/language.h ../cups/file.h +cups-driverd.o: ../cups/string.h ../config.h ../cups/dir.h +cups-driverd.o: ../cups/transcode.h +cups-lpd.o: ../cups/http-private.h ../config.h ../cups/http.h +cups-lpd.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +cups-lpd.o: ../cups/ipp.h ../cups/cups.h ../cups/ppd.h ../cups/array.h +cups-lpd.o: ../cups/file.h ../cups/language.h ../cups/string.h +cups-lpd.o: ../cups/language.h +cups-polld.o: ../cups/http-private.h ../config.h ../cups/http.h +cups-polld.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h +cups-polld.o: ../cups/ipp.h ../cups/cups.h ../cups/ppd.h ../cups/array.h +cups-polld.o: ../cups/file.h ../cups/language.h ../cups/language.h +cups-polld.o: ../cups/string.h +testdirsvc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h +testdirsvc.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h +testdirsvc.o: ../cups/file.h ../cups/language.h ../cups/string.h ../config.h +testlpd.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h +testlpd.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +testlpd.o: ../cups/string.h ../config.h +testmime.o: ../cups/string.h ../config.h mime.h ../cups/array.h +testmime.o: ../cups/versioning.h ../cups/ipp.h ../cups/file.h ../cups/dir.h +testspeed.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h +testspeed.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +testspeed.o: ../cups/language.h ../cups/debug.h +testsub.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h +testsub.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h +testsub.o: ../cups/debug.h ../cups/string.h ../config.h +util.o: util.h ../cups/cups.h ../cups/ipp.h ../cups/http.h +util.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h +util.o: ../cups/language.h ../cups/file.h ../cups/string.h ../config.h diff --git a/scheduler/client.c b/scheduler/client.c index ada07dfea..c2d772b6a 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -45,7 +45,6 @@ * Include necessary headers... */ -#include #include "cupsd.h" #ifdef HAVE_CDSASSL diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 507ecf280..f9ee02320 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -33,6 +33,7 @@ * cupsdUpdateLDAPBrowse() - Scan for new printers via LDAP... * cupsdUpdateSLPBrowse() - Get browsing information via SLP. * dequote() - Remote quotes from a string. + * get_hostconfig() - Get an /etc/hostconfig service setting. * is_local_queue() - Determine whether the URI points at a local * queue. * process_browse_data() - Process new browse data. @@ -87,6 +88,9 @@ */ static char *dequote(char *d, const char *s, int dlen); +#ifdef __APPLE__ +static int get_hostconfig(const char *name); +#endif /* __APPLE__ */ static int is_local_queue(const char *uri, char *host, int hostlen, char *resource, int resourcelen); static void process_browse_data(const char *uri, const char *host, @@ -1624,6 +1628,58 @@ dequote(char *d, /* I - Destination string */ } +#ifdef __APPLE__ +/* + * 'get_hostconfig()' - Get an /etc/hostconfig service setting. + */ + +static int /* O - 1 for YES or AUTOMATIC, 0 for NO */ +get_hostconfig(const char *name) /* I - Name of service */ +{ + cups_file_t *fp; /* Hostconfig file */ + char line[1024], /* Line from file */ + *ptr; /* Pointer to value */ + int state = 1; /* State of service */ + + + /* + * Try opening the /etc/hostconfig file; if we can't open it, assume that + * the service is enabled/auto. + */ + + if ((fp = cupsFileOpen("/etc/hostconfig", "r")) != NULL) + { + /* + * Read lines from the file until we find the service... + */ + + while (cupsFileGets(fp, line, sizeof(line))) + { + if (line[0] == '#' || (ptr = strchr(line, '=')) == NULL) + continue; + + *ptr++ = '\0'; + + if (!strcasecmp(line, name)) + { + /* + * Found the service, see if it is set to "-NO-"... + */ + + if (!strncasecmp(ptr, "-NO-", 4)) + state = 0; + break; + } + } + + cupsFileClose(fp); + } + + return (state); +} +#endif /* __APPLE__ */ + + /* * 'is_local_queue()' - Determine whether the URI points at a local queue. */ @@ -3871,6 +3927,16 @@ update_lpd(int onoff) /* - 1 = turn on, 0 = turn off */ if (!LPDConfigFile) return; +#ifdef __APPLE__ + /* + * Allow /etc/hostconfig CUPS_LPD service setting to override cupsd.conf + * setting for backwards-compatibility. + */ + + if (onoff && !get_hostconfig("CUPS_LPD")) + onoff = 0; +#endif /* __APPLE__ */ + if (!strncmp(LPDConfigFile, "xinetd:///", 10)) { /* diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 183b839cc..2c1ae3050 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -17,6 +17,86 @@ * * Contents: * + * cupsdProcessIPPRequest() - Process an incoming IPP request. + * cupsdTimeoutJob() - Timeout a job waiting on job files. + * accept_jobs() - Accept print jobs to a printer. + * add_class() - Add a class to the system. + * add_file() - Add a file to a job. + * add_job() - Add a job to a print queue. + * add_job_state_reasons() - Add the "job-state-reasons" attribute based + * upon the job and printer state... + * add_job_subscriptions() - Add any subcriptions for a job. + * add_job_uuid() - Add job-uuid attribute to a job. + * add_printer() - Add a printer to the system. + * add_printer_state_reasons() - Add the "printer-state-reasons" attribute + * based upon the printer state... + * add_queued_job_count() - Add the "queued-job-count" attribute for the + * specified printer or class. + * apple_init_profile() - Initialize a color profile. + * apple_register_profiles() - Register color profiles for a printer. + * apple_unregister_profiles() - Remove color profiles for the specified + * printer. + * apply_printer_defaults() - Apply printer default options to a job. + * authenticate_job() - Set job authentication info. + * cancel_all_jobs() - Cancel all print jobs. + * cancel_job() - Cancel a print job. + * cancel_subscription() - Cancel a subscription. + * check_quotas() - Check quotas for a printer and user. + * copy_attribute() - Copy a single attribute. + * copy_attrs() - Copy attributes from one request to another. + * copy_banner() - Copy a banner file to the requests directory + * for the specified job. + * copy_file() - Copy a PPD file or interface script... + * copy_model() - Copy a PPD model file, substituting default + * values as needed... + * copy_job_attrs() - Copy job attributes. + * copy_printer_attrs() - Copy printer attributes. + * copy_subscription_attrs() - Copy subscription attributes. + * create_job() - Print a file to a printer or class. + * create_requested_array() - Create an array for the requested-attributes. + * create_subscription() - Create a notification subscription. + * delete_printer() - Remove a printer or class from the system. + * get_default() - Get the default destination. + * get_devices() - Get the list of available devices on the + * local system. + * get_document() - Get a copy of a job file. + * get_job_attrs() - Get job attributes. + * get_jobs() - Get a list of jobs for the specified printer. + * get_notifications() - Get events for a subscription. + * get_ppd() - Get a named PPD from the local system. + * get_ppds() - Get the list of PPD files on the local + * system. + * get_printer_attrs() - Get printer attributes. + * get_printers() - Get a list of printers or classes. + * get_subscription_attrs() - Get subscription attributes. + * get_subscriptions() - Get subscriptions. + * get_username() - Get the username associated with a request. + * hold_job() - Hold a print job. + * move_job() - Move a job to a new destination. + * ppd_parse_line() - Parse a PPD default line. + * print_job() - Print a file to a printer or class. + * read_ps_job_ticket() - Reads a job ticket embedded in a PS file. + * reject_jobs() - Reject print jobs to a printer. + * release_job() - Release a held print job. + * renew_subscription() - Renew an existing subscription... + * restart_job() - Restart an old print job. + * save_auth_info() - Save authentication information for a job. + * save_krb5_creds() - Save Kerberos credentials for the job. + * send_document() - Send a file to a printer or class. + * send_http_error() - Send a HTTP error back to the IPP client. + * send_ipp_status() - Send a status back to the IPP client. + * set_default() - Set the default destination... + * set_job_attrs() - Set job attributes. + * set_printer_defaults() - Set printer default options from a request. + * start_printer() - Start a printer. + * stop_printer() - Stop a printer. + * url_encode_attr() - URL-encode a string attribute. + * url_encode_string() - URL-encode a string. + * user_allowed() - See if a user is allowed to print to a queue. + * validate_job() - Validate printer options and destination. + * validate_name() - Make sure the printer name only contains + * valid chars. + * validate_user() - Validate the user for the request. */ /* @@ -24,6 +104,7 @@ */ #include "cupsd.h" +#include #ifdef HAVE_LIBPAPER # include @@ -63,9 +144,10 @@ static void add_printer_state_reasons(cupsd_client_t *con, cupsd_printer_t *p); static void add_queued_job_count(cupsd_client_t *con, cupsd_printer_t *p); #ifdef __APPLE__ -static unsigned apple_hash_name(const char *name); -static void apple_init_profile(CMDeviceProfileInfo *profile, unsigned id, - const char *name, const char *iccfile); +static void apple_init_profile(ppd_file_t *ppd, cups_array_t *languages, + CMDeviceProfileInfo *profile, unsigned id, + const char *name, const char *text, + const char *iccfile); static void apple_register_profiles(cupsd_printer_t *p); static void apple_unregister_profiles(cupsd_printer_t *p); #endif /* __APPLE__ */ @@ -2735,47 +2817,72 @@ add_queued_job_count( #ifdef __APPLE__ -/* - * 'apple_hash_name()' - Calculate a 32-bit hash of a printer/profile name. - */ - -static unsigned /* O - Hash value */ -apple_hash_name(const char *name) /* I - Printer/profile name */ -{ - int mult; /* Multiplier */ - unsigned hash = 0; /* Hash value */ - - - for (mult = 1; *name && mult <= 128; mult ++, name ++) - hash += (*name & 255) & mult; - - return (hash); -} - - /* * 'apple_init_profile()' - Initialize a color profile. */ static void apple_init_profile( + ppd_file_t *ppd, /* I - PPD file */ + cups_array_t *languages, /* I - Languages in the PPD file */ CMDeviceProfileInfo *profile, /* I - Profile record */ unsigned id, /* I - Profile ID */ const char *name, /* I - Profile name */ + const char *text, /* I - Profile UI text */ const char *iccfile) /* I - ICC filename */ { char url[1024]; /* URL for profile filename */ CFMutableDictionaryRef dict; /* Dictionary for name */ + char *language; /* Current language */ + ppd_attr_t *attr; /* Profile attribute */ - if (iccfile) - httpAssembleURI(HTTP_URI_CODING_ALL, url, sizeof(url), "file", NULL, "", 0, - iccfile); + /* + * Build the profile name dictionary... + */ dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + CFDictionarySetValue(dict, CFSTR("en"), + CFStringCreateWithCString(kCFAllocatorDefault, + text, kCFStringEncodingUTF8)); + + if (iccfile && languages) + { + /* + * Find localized names for the color profiles... + */ + + cupsArraySave(ppd->sorted_attrs); + + for (language = (char *)cupsArrayFirst(languages); + language; + language = (char *)cupsArrayNext(languages)) + { + if ((attr = _ppdLocalizedAttr(ppd, "cupsICCProfile", name, + language)) != NULL && attr->text[0]) + CFDictionarySetValue(dict, + CFStringCreateWithCString(kCFAllocatorDefault, + language, + kCFStringEncodingUTF8), + CFStringCreateWithCString(kCFAllocatorDefault, + attr->text, + kCFStringEncodingUTF8)); + } + + cupsArrayRestore(ppd->sorted_attrs); + } + + /* + * Fill in the profile data... + */ + + if (iccfile) + httpAssembleURI(HTTP_URI_CODING_ALL, url, sizeof(url), "file", NULL, "", 0, + iccfile); + profile->dataVersion = cmDeviceProfileInfoVersion1; profile->profileID = id; profile->profileLoc.locType = iccfile ? cmPathBasedProfile : cmNoProfileBase; @@ -2784,20 +2891,6 @@ apple_init_profile( if (iccfile) strlcpy(profile->profileLoc.u.pathLoc.path, iccfile, sizeof(profile->profileLoc.u.pathLoc.path)); - - CFDictionarySetValue(dict, CFSTR("PMColorDeviceProfileID"), - CFNumberCreate(kCFAllocatorDefault, - kCFNumberSInt32Type, - &profile->profileID)); - CFDictionarySetValue(dict, CFSTR("PMColorDeviceProfileName"), - CFStringCreateWithCString(kCFAllocatorDefault, - name, - kCFStringEncodingUTF8)); - if (iccfile) - CFDictionarySetValue(dict, CFSTR("PMColorDeviceProfileURL"), - CFStringCreateWithCString(kCFAllocatorDefault, - url, - kCFStringEncodingUTF8)); } @@ -2827,6 +2920,7 @@ apple_register_profiles( }; CMDeviceProfileArrayPtr profiles; /* Profiles */ CMDeviceProfileInfo *profile; /* Current profile */ + cups_array_t *languages; /* Languages array */ /* @@ -2880,6 +2974,7 @@ apple_register_profiles( } profiles->profileCount = num_profiles; + languages = _ppdGetLanguages(ppd); for (profile = profiles->profiles, attr = ppdFindAttr(ppd, "cupsICCProfile", NULL); @@ -2900,11 +2995,14 @@ apple_register_profiles( if (access(iccfile, 0)) continue; - apple_init_profile(profile, apple_hash_name(attr->spec), attr->spec, + apple_init_profile(ppd, languages, profile, _ppdHashName(attr->spec), + attr->spec, attr->text[0] ? attr->text : attr->spec, iccfile); profile ++; } + + _ppdFreeLanguages(languages); } else if ((cm_option = ppdFindOption(ppd, "ColorModel")) != NULL) { @@ -2944,17 +3042,20 @@ apple_register_profiles( i --, cm_choice ++) if (!strcmp(cm_choice->choice, "Gray")) { - apple_init_profile(profile, apple_hash_name("Gray.."), "Gray", NULL); + apple_init_profile(ppd, NULL, profile, _ppdHashName("Gray.."), + "Gray", "Gray", NULL); profile ++; } else if (!strcmp(cm_choice->choice, "RGB")) { - apple_init_profile(profile, apple_hash_name("RGB.."), "RGB", NULL); + apple_init_profile(ppd, NULL, profile, _ppdHashName("RGB.."), + "RGB", "RGB", NULL); profile ++; } else if (!strcmp(cm_choice->choice, "CMYK")) { - apple_init_profile(profile, apple_hash_name("CMYK.."), "CMYK", NULL); + apple_init_profile(ppd, NULL, profile, _ppdHashName("CMYK.."), + "CMYK", "CMYK", NULL); profile ++; } } @@ -2980,16 +3081,16 @@ apple_register_profiles( switch (ppd->colorspace) { case PPD_CS_GRAY : - apple_init_profile(profiles->profiles, apple_hash_name("Gray.."), - "Gray", NULL); + apple_init_profile(ppd, NULL, profiles->profiles, + _ppdHashName("Gray.."), "Gray", "Gray", NULL); break; case PPD_CS_RGB : - apple_init_profile(profiles->profiles, apple_hash_name("RGB.."), - "RGB", NULL); + apple_init_profile(ppd, NULL, profiles->profiles, + _ppdHashName("RGB.."), "RGB", "RGB", NULL); break; case PPD_CS_CMYK : - apple_init_profile(profiles->profiles, apple_hash_name("CMYK.."), - "CMYK", NULL); + apple_init_profile(ppd, NULL, profiles->profiles, + _ppdHashName("CMYK.."), "CMYK", "CMYK", NULL); break; default : @@ -3008,7 +3109,7 @@ apple_register_profiles( cupsdLogMessage(CUPSD_LOG_INFO, "Registering ICC color profiles for \"%s\"", p->name); - id = apple_hash_name(p->name); + id = _ppdHashName(p->name); name = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); @@ -3063,7 +3164,7 @@ static void apple_unregister_profiles( cupsd_printer_t *p) /* I - Printer */ { - CMUnregisterColorDevice(cmPrinterDeviceClass, apple_hash_name(p->name)); + CMUnregisterColorDevice(cmPrinterDeviceClass, _ppdHashName(p->name)); } #endif /* __APPLE__ */ diff --git a/scripting/php/Dependencies b/scripting/php/Dependencies index 5e21a181f..50d872b4b 100644 --- a/scripting/php/Dependencies +++ b/scripting/php/Dependencies @@ -1 +1,6 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. + +phpcups.o: ../../cups/string.h ../../config.h phpcups.h ../../cups/cups.h +phpcups.o: ../../cups/ipp.h ../../cups/http.h ../../cups/versioning.h +phpcups.o: ../../cups/ppd.h ../../cups/array.h ../../cups/file.h +phpcups.o: ../../cups/language.h ../../cups/language.h ../../cups/debug.h diff --git a/systemv/cupstestppd.c b/systemv/cupstestppd.c index 54b3b4c62..6bbf63ada 100644 --- a/systemv/cupstestppd.c +++ b/systemv/cupstestppd.c @@ -18,16 +18,6 @@ * * Contents: * - * 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. */ /* @@ -36,6 +26,7 @@ #include #include +#include #include #include #include @@ -53,8 +44,9 @@ enum WARN_CONSTRAINTS = 1, WARN_DEFAULTS = 2, WARN_FILTERS = 4, - WARN_TRANSLATIONS = 8, - WARN_ALL = 15 + WARN_PROFILES = 8, + WARN_TRANSLATIONS = 16, + WARN_ALL = 31 }; @@ -96,6 +88,8 @@ static int check_defaults(ppd_file_t *ppd, int errors, int verbose, int warn); static int check_filters(ppd_file_t *ppd, const char *root, int errors, int verbose, int warn); +static int check_profiles(ppd_file_t *ppd, const char *root, int errors, + int verbose, int warn); static int check_translations(ppd_file_t *ppd, int errors, int verbose,\ int warn); static void show_conflicts(ppd_file_t *ppd); @@ -125,8 +119,7 @@ main(int argc, /* I - Number of command-line args */ ppd_status_t error; /* Status of ppdOpen*() */ int line; /* Line number for error */ struct stat statbuf; /* File information */ - char pathprog[1024], /* Complete path to program/filter */ - *root; /* Root directory */ + char *root; /* Root directory */ int xdpi, /* X resolution */ ydpi; /* Y resolution */ ppd_file_t *ppd; /* PPD file record */ @@ -186,6 +179,8 @@ main(int argc, /* I - Number of command-line args */ warn |= WARN_DEFAULTS; else if (!strcmp(argv[i], "filters")) warn |= WARN_FILTERS; + else if (!strcmp(argv[i], "profiles")) + warn |= WARN_PROFILES; else if (!strcmp(argv[i], "translations")) warn |= WARN_TRANSLATIONS; else if (!strcmp(argv[i], "all")) @@ -1072,6 +1067,9 @@ main(int argc, /* I - Number of command-line args */ if (!(warn & WARN_FILTERS)) errors = check_filters(ppd, root, errors, verbose, 0); + if (!(warn & WARN_PROFILES)) + errors = check_profiles(ppd, root, errors, verbose, 0); + if (!(warn & WARN_TRANSLATIONS)) errors = check_translations(ppd, errors, verbose, 0); @@ -1197,6 +1195,9 @@ main(int argc, /* I - Number of command-line args */ if (warn & WARN_DEFAULTS) errors = check_defaults(ppd, errors, verbose, 1); + if (warn & WARN_PROFILES) + errors = check_profiles(ppd, root, errors, verbose, 1); + if (warn & WARN_FILTERS) errors = check_filters(ppd, root, errors, verbose, 1); @@ -1360,43 +1361,6 @@ main(int argc, /* I - Number of command-line args */ } } - /* - * cupsICCProfile - */ - - for (attr = ppdFindAttr(ppd, "cupsICCProfile", NULL); - attr != NULL; - attr = ppdFindNextAttr(ppd, "cupsICCProfile", NULL)) - { - if (attr->value) - { - if (attr->value[0] == '/') - snprintf(pathprog, sizeof(pathprog), "%s%s", root, attr->value); - else - { - if ((ptr = getenv("CUPS_DATADIR")) == NULL) - ptr = CUPS_DATADIR; - - if (*ptr == '/' || !*root) - snprintf(pathprog, sizeof(pathprog), "%s%s/profiles/%s", root, - ptr, attr->value); - else - snprintf(pathprog, sizeof(pathprog), "%s/%s/profiles/%s", root, - ptr, attr->value); - } - } - - if (!attr->value || !attr->value[0] || stat(pathprog, &statbuf)) - { - if (verbose >= 0) - _cupsLangPrintf(stdout, - _(" WARN Missing cupsICCProfile " - "file \"%s\"\n"), - !attr->value || !attr->value[0] ? "" : - attr->value); - } - } - #ifdef __APPLE__ /* * APDialogExtension @@ -1856,7 +1820,6 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ { ppd_attr_t *attr; /* PPD attribute */ const char *ptr; /* Pointer into string */ - struct stat statbuf; /* File information */ char super[16], /* Super-type for filter */ type[256], /* Type for filter */ program[256], /* Program/filter name */ @@ -1903,7 +1866,7 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ program); } - if (stat(pathprog, &statbuf)) + if (access(pathprog, X_OK)) { if (!warn && !errors && !verbose) _cupsLangPuts(stdout, _(" FAIL\n")); @@ -1954,7 +1917,7 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ program); } - if (stat(pathprog, &statbuf)) + if (access(pathprog, X_OK)) { if (!warn && !errors && !verbose) _cupsLangPuts(stdout, _(" FAIL\n")); @@ -1973,6 +1936,133 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ } +/* + * 'check_profiles()' - Check ICC color profiles in the PPD file. + */ + +static int /* O - Errors found */ +check_profiles(ppd_file_t *ppd, /* I - PPD file */ + const char *root, /* I - Root directory */ + int errors, /* I - Errors found */ + int verbose, /* I - Verbosity level */ + int warn) /* I - Warnings only? */ +{ + int i; /* Looping var */ + ppd_attr_t *attr; /* PPD attribute */ + const char *ptr; /* Pointer into string */ + const char *prefix; /* WARN/FAIL prefix */ + char filename[1024]; /* Profile filename */ + int num_profiles = 0; /* Number of profiles */ + unsigned hash, /* Current hash value */ + hashes[1000]; /* Hash values of profile names */ + const char *specs[1000]; /* Specifiers for profiles */ + + + prefix = warn ? " WARN " : "**FAIL**"; + + for (attr = ppdFindAttr(ppd, "cupsICCProfile", NULL); + attr; + attr = ppdFindNextAttr(ppd, "cupsICCProfile", NULL)) + { + /* + * Check for valid selector... + */ + + for (i = 0, ptr = strchr(attr->spec, '.'); ptr; ptr = strchr(ptr + 1, '.')) + i ++; + + if (!attr->value || i < 2) + { + if (!warn && !errors && !verbose) + _cupsLangPuts(stdout, _(" FAIL\n")); + + if (verbose >= 0) + _cupsLangPrintf(stdout, + _(" %s Bad cupsICCProfile %s!\n"), + prefix, attr->spec); + + if (!warn) + errors ++; + + continue; + } + + /* + * Check for valid profile filename... + */ + + if (attr->value[0] == '/') + snprintf(filename, sizeof(filename), "%s%s", root, attr->value); + else + { + if ((ptr = getenv("CUPS_DATADIR")) == NULL) + ptr = CUPS_DATADIR; + + if (*ptr == '/' || !*root) + snprintf(filename, sizeof(filename), "%s%s/profiles/%s", root, ptr, + attr->value); + else + snprintf(filename, sizeof(filename), "%s/%s/profiles/%s", root, ptr, + attr->value); + } + + if (access(filename, 0)) + { + if (!warn && !errors && !verbose) + _cupsLangPuts(stdout, _(" FAIL\n")); + + if (verbose >= 0) + _cupsLangPrintf(stdout, _(" %s Missing cupsICCProfile " + "file \"%s\"!\n"), prefix, attr->value); + + if (!warn) + errors ++; + } + + /* + * Check for hash collisions... + */ + + hash = _ppdHashName(attr->spec); + + if (num_profiles > 0) + { + for (i = 0; i < num_profiles; i ++) + if (hashes[i] == hash) + break; + + if (i < num_profiles) + { + if (!warn && !errors && !verbose) + _cupsLangPuts(stdout, _(" FAIL\n")); + + if (verbose >= 0) + _cupsLangPrintf(stdout, + _(" %s cupsICCProfile %s hash value " + "collides with %s!\n"), prefix, attr->spec, + specs[i]); + + if (!warn) + errors ++; + } + } + + /* + * Remember up to 1000 profiles... + */ + + if (num_profiles < 1000) + { + hashes[num_profiles] = hash; + specs[num_profiles] = attr->spec; + num_profiles ++; + } + } + + return (errors); +} + + /* * 'check_translations()' - Check translations in the PPD file. */ @@ -1985,9 +2075,9 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ { int j; /* Looping var */ ppd_attr_t *attr; /* PPD attribute */ - char *languages, /* Copy of attribute value */ - *langstart, /* Start of current language */ - *langptr, /* Pointer into languages */ + cups_array_t *languages; /* Array of languages */ + int langlen; /* Length of language */ + char *language, /* Current language */ keyword[PPD_MAX_NAME], /* Localization keyword (full) */ llkeyword[PPD_MAX_NAME],/* Localization keyword (base) */ ckeyword[PPD_MAX_NAME], /* Custom option keyword (full) */ @@ -1996,50 +2086,24 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ ppd_option_t *option; /* Standard UI option */ ppd_coption_t *coption; /* Custom option */ ppd_cparam_t *cparam; /* Custom parameter */ - cups_array_t *langlist; /* List of languages so far */ char ll[3]; /* Base language */ const char *prefix; /* WARN/FAIL prefix */ prefix = warn ? " WARN " : "**FAIL**"; - if ((attr = ppdFindAttr(ppd, "cupsLanguages", NULL)) != NULL && - attr->value) + if ((languages = _ppdGetLanguages(ppd)) != NULL) { /* * This file contains localizations, check them... */ - if ((languages = strdup(attr->value)) == NULL) - return (1); - - langlist = cupsArrayNew((cups_array_func_t)strcmp, NULL); - - for (langptr = languages; *langptr;) + for (language = (char *)cupsArrayFirst(languages); + language; + language = (char *)cupsArrayNext(languages)) { - /* - * Skip leading whitespace... - */ - - while (isspace(*langptr & 255)) - langptr ++; - - if (!*langptr) - break; - - /* - * Find the end of this language name... - */ - - for (langstart = langptr; - *langptr && !isspace(*langptr & 255); - langptr ++); - - if (*langptr) - *langptr++ = '\0'; - - j = strlen(langstart); - if (j != 2 && j != 5) + langlen = strlen(language); + if (langlen != 2 && langlen != 5) { if (!warn && !errors && !verbose) _cupsLangPuts(stdout, _(" FAIL\n")); @@ -2047,7 +2111,7 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ if (verbose >= 0) _cupsLangPrintf(stdout, _(" %s Bad language \"%s\"!\n"), - prefix, langstart); + prefix, language); if (!warn) errors ++; @@ -2055,12 +2119,10 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ continue; } - if (!strcmp(langstart, "en")) + if (!strcmp(language, "en")) continue; - cupsArrayAdd(langlist, langstart); - - strlcpy(ll, langstart, sizeof(ll)); + strlcpy(ll, language, sizeof(ll)); /* * Loop through all options and choices... @@ -2073,7 +2135,7 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ if (!strcmp(option->keyword, "PageRegion")) continue; - snprintf(keyword, sizeof(keyword), "%s.Translation", langstart); + snprintf(keyword, sizeof(keyword), "%s.Translation", language); snprintf(llkeyword, sizeof(llkeyword), "%s.Translation", ll); if ((attr = ppdFindAttr(ppd, keyword, option->keyword)) == NULL && @@ -2086,7 +2148,7 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ _cupsLangPrintf(stdout, _(" %s Missing \"%s\" translation " "string for option %s!\n"), - prefix, langstart, option->keyword); + prefix, language, option->keyword); if (!warn) errors ++; @@ -2100,13 +2162,13 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ _cupsLangPrintf(stdout, _(" %s Bad UTF-8 \"%s\" translation " "string for option %s!\n"), - prefix, langstart, option->keyword); + prefix, language, option->keyword); if (!warn) errors ++; } - snprintf(keyword, sizeof(keyword), "%s.%s", langstart, + snprintf(keyword, sizeof(keyword), "%s.%s", language, option->keyword); snprintf(llkeyword, sizeof(llkeyword), "%s.%s", ll, option->keyword); @@ -2118,7 +2180,7 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ option->keyword)) != NULL) { snprintf(ckeyword, sizeof(ckeyword), "%s.Custom%s", - langstart, option->keyword); + language, option->keyword); if ((attr = ppdFindAttr(ppd, ckeyword, "True")) != NULL && !valid_utf8(attr->text)) @@ -2131,8 +2193,8 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ _(" %s Bad UTF-8 \"%s\" " "translation string for option %s, " "choice %s!\n"), - prefix, langstart, - ckeyword + 1 + strlen(langstart), + prefix, language, + ckeyword + 1 + strlen(language), "True"); if (!warn) @@ -2146,7 +2208,7 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ cparam = (ppd_cparam_t *)cupsArrayNext(coption->params)) { snprintf(ckeyword, sizeof(ckeyword), "%s.ParamCustom%s", - langstart, option->keyword); + language, option->keyword); snprintf(cllkeyword, sizeof(cllkeyword), "%s.ParamCustom%s", ll, option->keyword); @@ -2163,8 +2225,8 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ _(" %s Missing \"%s\" " "translation string for option %s, " "choice %s!\n"), - prefix, langstart, - ckeyword + 1 + strlen(langstart), + prefix, language, + ckeyword + 1 + strlen(language), cparam->name); if (!warn) @@ -2180,8 +2242,8 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ _(" %s Bad UTF-8 \"%s\" " "translation string for option %s, " "choice %s!\n"), - prefix, langstart, - ckeyword + 1 + strlen(langstart), + prefix, language, + ckeyword + 1 + strlen(language), cparam->name); if (!warn) @@ -2203,7 +2265,7 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ _(" %s Missing \"%s\" " "translation string for option %s, " "choice %s!\n"), - prefix, langstart, option->keyword, + prefix, language, option->keyword, option->choices[j].choice); if (!warn) @@ -2219,7 +2281,7 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ _(" %s Bad UTF-8 \"%s\" " "translation string for option %s, " "choice %s!\n"), - prefix, langstart, option->keyword, + prefix, language, option->keyword, option->choices[j].choice); if (!warn) @@ -2233,20 +2295,20 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ * Verify that we have the base language for each localized one... */ - for (langptr = (char *)cupsArrayFirst(langlist); - langptr; - langptr = (char *)cupsArrayNext(langlist)) - if (langptr[2]) + for (language = (char *)cupsArrayFirst(languages); + language; + language = (char *)cupsArrayNext(languages)) + if (language[2]) { /* * Lookup the base language... */ - cupsArraySave(langlist); + cupsArraySave(languages); - strlcpy(ll, langptr, sizeof(ll)); + strlcpy(ll, language, sizeof(ll)); - if (!cupsArrayFind(langlist, ll) && strcmp(ll, "zh")) + if (!cupsArrayFind(languages, ll) && strcmp(ll, "zh")) { if (!warn && !errors && !verbose) _cupsLangPuts(stdout, _(" FAIL\n")); @@ -2260,15 +2322,14 @@ check_translations(ppd_file_t *ppd, /* I - PPD file */ errors ++; } - cupsArrayRestore(langlist); + cupsArrayRestore(languages); } /* * Free memory used for the languages... */ - cupsArrayDelete(langlist); - free(languages); + _ppdFreeLanguages(languages); } return (errors); diff --git a/test/Dependencies b/test/Dependencies index 157aef1fb..43ea40074 100644 --- a/test/Dependencies +++ b/test/Dependencies @@ -1,4 +1,5 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -ipptest.o: ipptest.c ../cups/string.h ../config.h ../cups/cups.h \ - ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h \ - ../cups/file.h ../cups/language.h ../cups/language.h + +ipptest.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h +ipptest.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h ../cups/array.h +ipptest.o: ../cups/file.h ../cups/language.h ../cups/language.h