From: Michael Sweet
marker-types
, printer-alert
, and
printer-alert-description
printer attributes. Standard
marker-types
values are listed in Table
- 1.
+ 1. String values need special handling - see Reporting Attribute String Values below.
When reporting string values using "ATTR:" messages, a filter or backend must take special care to appropriately quote those values. The scheduler uses the CUPS option parsing code for attributes, so the general syntax is:
+ ++name=simple +name=simple,simple,... +name='complex value' +name="complex value" +name='"complex value"','"complex value"',... ++ +
Simple values are strings that do not contain spaces, quotes, backslashes, or the comma and can be placed verbatim in the "ATTR:" message, for example:
+ ++int levels[4] = { 40, 50, 60, 70 }; /* CMYK */ + +fputs("ATTR: marker-colors=#00FFFF,#FF00FF,#FFFF00,#000000\n", stderr); +fputs("ATTR: marker-high-levels=100,100,100,100\n", stderr); +fprintf(stderr, "ATTR: marker-levels=%d,%d,%d,%d\n", levels[0], levels[1], + levels[2], levels[3], levels[4]); +fputs("ATTR: marker-low-levels=5,5,5,5\n", stderr); +fputs("ATTR: marker-types=toner,toner,toner,toner\n", stderr); ++ +
Complex values that contains spaces, quotes, backslashes, or the comma must be quoted. For a single value a single set of quotes is sufficient:
+ ++fputs("ATTR: marker-message='Levels shown are approximate.'\n", stderr); ++ +
When multiple values are reported, each value must be enclosed by a set of single and double quotes:
+ ++fputs("ATTR: marker-names='\"Cyan Toner\"','\"Magenta Toner\"'," + "'\"Yellow Toner\"','\"Black Toner\"'\n", stderr); ++ +
The IPP backend includes a quote_string function that may be used to properly quote a complex value in an "ATTR:" message:
+ ++static const char * /* O - Quoted string */ +quote_string(const char *s, /* I - String */ + char *q, /* I - Quoted string buffer */ + size_t qsize) /* I - Size of quoted string buffer */ +{ + char *qptr, /* Pointer into string buffer */ + *qend; /* End of string buffer */ + + + qptr = q; + qend = q + qsize - 5; + + if (qend < q) + { + *q = '\0'; + return (q); + } + + *qptr++ = '\''; + *qptr++ = '\"'; + + while (*s && qptr < qend) + { + if (*s == '\\' || *s == '\"' || *s == '\'') + { + if (qptr < (qend - 4)) + { + *qptr++ = '\\'; + *qptr++ = '\\'; + *qptr++ = '\\'; + } + else + break; + } + + *qptr++ = *s++; + } + + *qptr++ = '\"'; + *qptr++ = '\''; + *qptr = '\0'; + + return (q); +} ++ +
Filters are responsible for managing the state keywords they set using diff --git a/cups/cups.h b/cups/cups.h index 17f93a628d..8feaed050f 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -1,18 +1,18 @@ /* - * "$Id: cups.h 11367 2013-10-28 15:35:57Z msweet $" + * "$Id: cups.h 11551 2014-01-29 16:31:35Z msweet $" * - * API definitions for CUPS. + * API definitions for CUPS. * - * Copyright 2007-2013 by Apple Inc. - * Copyright 1997-2007 by Easy Software Products. + * Copyright 2007-2014 by Apple Inc. + * Copyright 1997-2007 by Easy Software Products. * - * 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/". + * 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/". * - * This file is subject to the Apple OS-Developed Software exception. + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_CUPS_H_ @@ -53,10 +53,10 @@ extern "C" { * Constants... */ -# define CUPS_VERSION 1.0701 +# define CUPS_VERSION 1.0702 # define CUPS_VERSION_MAJOR 1 # define CUPS_VERSION_MINOR 7 -# define CUPS_VERSION_PATCH 1 +# define CUPS_VERSION_PATCH 2 # define CUPS_BC_FD 3 /* Back-channel file descriptor for @@ -627,5 +627,5 @@ extern const char *cupsUserAgent(void) _CUPS_API_1_7; #endif /* !_CUPS_CUPS_H_ */ /* - * End of "$Id: cups.h 11367 2013-10-28 15:35:57Z msweet $". + * End of "$Id: cups.h 11551 2014-01-29 16:31:35Z msweet $". */ diff --git a/cups/dest.c b/cups/dest.c index cdf1c44915..7b30340a5f 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -1,5 +1,5 @@ /* - * "$Id: dest.c 11141 2013-07-16 14:58:25Z msweet $" + * "$Id: dest.c 11688 2014-03-05 21:11:32Z msweet $" * * User-defined destination (and option) support for CUPS. * @@ -891,6 +891,10 @@ cupsEnumDests( num_dests; /* Number of destinations */ cups_dest_t *dests = NULL, /* Destinations */ *dest; /* Current destination */ + const char *defprinter; /* Default printer */ + char name[1024], /* Copy of printer name */ + *instance, /* Pointer to instance name */ + *user_default; /* User default printer */ #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) int count, /* Number of queries started */ remaining; /* Remainder of timeout */ @@ -936,6 +940,31 @@ cupsEnumDests( num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, IPP_OP_CUPS_GET_PRINTERS, NULL, &dests, type, mask); + if ((user_default = _cupsUserDefault(name, sizeof(name))) != NULL) + defprinter = name; + else if ((defprinter = cupsGetDefault2(CUPS_HTTP_DEFAULT)) != NULL) + { + strlcpy(name, defprinter, sizeof(name)); + defprinter = name; + } + + if (defprinter) + { + /* + * Separate printer and instance name... + */ + + if ((instance = strchr(name, '/')) != NULL) + *instance++ = '\0'; + + /* + * Lookup the printer and instance and make it the default... + */ + + if ((dest = cupsGetDest(name, instance, num_dests, dests)) != NULL) + dest->is_default = 1; + } + for (i = num_dests, dest = dests; i > 0 && (!cancel || !*cancel); i --, dest ++) @@ -953,11 +982,11 @@ cupsEnumDests( * Get Bonjour-shared printers... */ - data.type = type; - data.mask = mask; - data.devices = cupsArrayNew3((cups_array_func_t)cups_dnssd_compare_devices, - NULL, NULL, 0, NULL, - (cups_afree_func_t)cups_dnssd_free_device); + data.type = type; + data.mask = mask; + data.cb = cb; + data.user_data = user_data; + data.devices = cupsArrayNew3((cups_array_func_t)cups_dnssd_compare_devices, NULL, NULL, 0, NULL, (cups_afree_func_t)cups_dnssd_free_device); # ifdef HAVE_DNSSD if (DNSServiceCreateConnection(&data.main_ref) != kDNSServiceErr_NoError) @@ -3891,5 +3920,5 @@ cups_make_string( /* - * End of "$Id: dest.c 11141 2013-07-16 14:58:25Z msweet $". + * End of "$Id: dest.c 11688 2014-03-05 21:11:32Z msweet $". */ diff --git a/cups/encode.c b/cups/encode.c index 32465526a4..32c2365d94 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -1,5 +1,5 @@ /* - * "$Id: encode.c 11115 2013-07-10 14:35:53Z msweet $" + * "$Id: encode.c 11734 2014-03-25 18:01:47Z msweet $" * * Option encoding routines for CUPS. * @@ -41,7 +41,10 @@ static const ipp_op_t ipp_job_creation[] = { IPP_OP_PRINT_JOB, IPP_OP_PRINT_URI, + IPP_OP_VALIDATE_JOB, IPP_OP_CREATE_JOB, + IPP_OP_HOLD_JOB, + IPP_OP_SET_JOB_ATTRIBUTES, IPP_OP_CUPS_NONE }; @@ -51,6 +54,8 @@ static const ipp_op_t ipp_doc_creation[] = IPP_OP_PRINT_URI, IPP_OP_SEND_DOCUMENT, IPP_OP_SEND_URI, + IPP_OP_SET_JOB_ATTRIBUTES, + IPP_OP_SET_DOCUMENT_ATTRIBUTES, IPP_OP_CUPS_NONE }; @@ -59,8 +64,8 @@ static const ipp_op_t ipp_sub_creation[] = IPP_OP_PRINT_JOB, IPP_OP_PRINT_URI, IPP_OP_CREATE_JOB, - IPP_OP_CREATE_PRINTER_SUBSCRIPTION, - IPP_OP_CREATE_JOB_SUBSCRIPTION, + IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS, + IPP_OP_CREATE_JOB_SUBSCRIPTIONS, IPP_OP_CUPS_NONE }; @@ -68,6 +73,7 @@ static const ipp_op_t ipp_all_print[] = { IPP_OP_PRINT_JOB, IPP_OP_PRINT_URI, + IPP_OP_VALIDATE_JOB, IPP_OP_CREATE_JOB, IPP_OP_SEND_DOCUMENT, IPP_OP_SEND_URI, @@ -872,5 +878,5 @@ compare_ipp_options(_ipp_option_t *a, /* I - First option */ /* - * End of "$Id: encode.c 11115 2013-07-10 14:35:53Z msweet $". + * End of "$Id: encode.c 11734 2014-03-25 18:01:47Z msweet $". */ diff --git a/cups/file-private.h b/cups/file-private.h index bb83c40c7e..bc147ff8fb 100644 --- a/cups/file-private.h +++ b/cups/file-private.h @@ -1,5 +1,5 @@ /* - * "$Id: file-private.h 3275 2011-05-20 07:26:13Z msweet $" + * "$Id: file-private.h 11642 2014-02-27 15:57:59Z msweet $" * * Private file definitions for CUPS. * @@ -16,6 +16,8 @@ * 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/". + * + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_FILE_PRIVATE_H_ @@ -133,5 +135,5 @@ extern void _cupsFileCheckFilter(void *context, #endif /* !_CUPS_FILE_PRIVATE_H_ */ /* - * End of "$Id: file-private.h 3275 2011-05-20 07:26:13Z msweet $". + * End of "$Id: file-private.h 11642 2014-02-27 15:57:59Z msweet $". */ diff --git a/cups/file.c b/cups/file.c index 8142a44e4a..e0ea5cef76 100644 --- a/cups/file.c +++ b/cups/file.c @@ -1,5 +1,5 @@ /* - * "$Id: file.c 11374 2013-11-04 23:49:10Z msweet $" + * "$Id: file.c 11642 2014-02-27 15:57:59Z msweet $" * * File functions for CUPS. * @@ -16,6 +16,8 @@ * 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/". + * + * This file is subject to the Apple OS-Developed Software exception. */ /* @@ -2670,5 +2672,5 @@ cups_write(cups_file_t *fp, /* I - CUPS file */ /* - * End of "$Id: file.c 11374 2013-11-04 23:49:10Z msweet $". + * End of "$Id: file.c 11642 2014-02-27 15:57:59Z msweet $". */ diff --git a/cups/file.h b/cups/file.h index e7994b7dc1..887c33a1e1 100644 --- a/cups/file.h +++ b/cups/file.h @@ -1,5 +1,5 @@ /* - * "$Id: file.h 10996 2013-05-29 11:51:34Z msweet $" + * "$Id: file.h 11642 2014-02-27 15:57:59Z msweet $" * * Public file definitions for CUPS. * @@ -16,6 +16,8 @@ * 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/". + * + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_FILE_H_ @@ -112,5 +114,5 @@ extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, #endif /* !_CUPS_FILE_H_ */ /* - * End of "$Id: file.h 10996 2013-05-29 11:51:34Z msweet $". + * End of "$Id: file.h 11642 2014-02-27 15:57:59Z msweet $". */ diff --git a/cups/http-addr.c b/cups/http-addr.c index 236baef4cb..e8daaf3e78 100644 --- a/cups/http-addr.c +++ b/cups/http-addr.c @@ -1,5 +1,5 @@ /* - * "$Id: http-addr.c 11374 2013-11-04 23:49:10Z msweet $" + * "$Id: http-addr.c 11642 2014-02-27 15:57:59Z msweet $" * * HTTP address routines for CUPS. * @@ -11,6 +11,8 @@ * 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/". + * + * This file is subject to the Apple OS-Developed Software exception. */ /* @@ -754,5 +756,5 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */ /* - * End of "$Id: http-addr.c 11374 2013-11-04 23:49:10Z msweet $". + * End of "$Id: http-addr.c 11642 2014-02-27 15:57:59Z msweet $". */ diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index 631cb52cc2..bb1ff949f7 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -1,5 +1,5 @@ /* - * "$Id: http-addrlist.c 11374 2013-11-04 23:49:10Z msweet $" + * "$Id: http-addrlist.c 11642 2014-02-27 15:57:59Z msweet $" * * HTTP address list routines for CUPS. * @@ -11,6 +11,8 @@ * 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/". + * + * This file is subject to the Apple OS-Developed Software exception. */ /* @@ -455,6 +457,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p if ((first = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t))) != NULL) { + addr = first; first->addr.un.sun_family = AF_LOCAL; strlcpy(first->addr.un.sun_path, hostname, sizeof(first->addr.un.sun_path)); } @@ -874,5 +877,5 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p /* - * End of "$Id: http-addrlist.c 11374 2013-11-04 23:49:10Z msweet $". + * End of "$Id: http-addrlist.c 11642 2014-02-27 15:57:59Z msweet $". */ diff --git a/cups/http.c b/cups/http.c index 579a3173be..d840769f93 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1,9 +1,9 @@ /* - * "$Id: http.c 11392 2013-11-06 01:29:56Z msweet $" + * "$Id: http.c 11761 2014-03-28 13:04:33Z msweet $" * * HTTP routines for CUPS. * - * Copyright 2007-2013 by Apple Inc. + * Copyright 2007-2014 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * This file contains Kerberos support code, copyright 2006 by Jelmer Vernooij. @@ -1748,7 +1748,7 @@ httpPeek(http_t *http, /* I - Connection to server */ */ #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding >= _HTTP_CODING_GUNZIP) http_content_coding_finish(http); #endif /* HAVE_LIBZ */ @@ -1776,7 +1776,8 @@ httpPeek(http_t *http, /* I - Connection to server */ #ifdef HAVE_LIBZ if (http->used == 0 && - (http->coding == _HTTP_CODING_IDENTITY || http->stream.avail_in == 0)) + (http->coding == _HTTP_CODING_IDENTITY || + (http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in == 0))) #else if (http->used == 0) #endif /* HAVE_LIBZ */ @@ -1819,7 +1820,7 @@ httpPeek(http_t *http, /* I - Connection to server */ } #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding >= _HTTP_CODING_GUNZIP) { # ifdef HAVE_INFLATECOPY int zerr; /* Decompressor error */ @@ -2056,7 +2057,7 @@ httpRead2(http_t *http, /* I - Connection to server */ return (0); #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding >= _HTTP_CODING_GUNZIP) { do { @@ -2210,14 +2211,15 @@ httpRead2(http_t *http, /* I - Connection to server */ if ( #ifdef HAVE_LIBZ - (http->coding == _HTTP_CODING_IDENTITY || http->stream.avail_in == 0) && + (http->coding == _HTTP_CODING_IDENTITY || + (http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in == 0)) && #endif /* HAVE_LIBZ */ ((http->data_remaining <= 0 && http->data_encoding == HTTP_ENCODING_LENGTH) || (http->data_encoding == HTTP_ENCODING_CHUNKED && bytes == 0))) { #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding >= _HTTP_CODING_GUNZIP) http_content_coding_finish(http); #endif /* HAVE_LIBZ */ @@ -3478,7 +3480,7 @@ httpWrite2(http_t *http, /* I - Connection to server */ */ #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding == _HTTP_CODING_GZIP || http->coding == _HTTP_CODING_DEFLATE) { DEBUG_printf(("1httpWrite2: http->coding=%d", http->coding)); @@ -3578,7 +3580,7 @@ httpWrite2(http_t *http, /* I - Connection to server */ */ #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding == _HTTP_CODING_GZIP || http->coding == _HTTP_CODING_DEFLATE) http_content_coding_finish(http); #endif /* HAVE_LIBZ */ @@ -5394,6 +5396,7 @@ http_setup_ssl(http_t *http) /* I - Connection to server */ if (!http->tls) { + DEBUG_puts("8http_setup_ssl: Unable to allocate SSPI data."); _cupsSetHTTPError(HTTP_STATUS_ERROR); return (-1); } @@ -5404,11 +5407,14 @@ http_setup_ssl(http_t *http) /* I - Connection to server */ _sntprintf_s(commonName, sizeof(commonName) / sizeof(TCHAR), sizeof(commonName) / sizeof(TCHAR), TEXT("CN=%s"), username); - if (!_sspiGetCredentials(http->tls_credentials, L"ClientContainer", - commonName, FALSE)) + DEBUG_printf(("8http_setup_ssl: commonName=\"%s\"", commonName)); + + if (!_sspiGetCredentials(http->tls, L"ClientContainer", commonName, FALSE)) { - _sspiFree(http->tls_credentials); - http->tls_credentials = NULL; + DEBUG_puts("8http_setup_ssl: _sspiGetCredentials failed."); + + _sspiFree(http->tls); + http->tls = NULL; http->error = EIO; http->status = HTTP_STATUS_ERROR; @@ -5419,13 +5425,15 @@ http_setup_ssl(http_t *http) /* I - Connection to server */ return (-1); } - _sspiSetAllowsAnyRoot(http->tls_credentials, TRUE); - _sspiSetAllowsExpiredCerts(http->tls_credentials, TRUE); + _sspiSetAllowsAnyRoot(http->tls, TRUE); + _sspiSetAllowsExpiredCerts(http->tls, TRUE); - if (!_sspiConnect(http->tls_credentials, hostname)) + if (!_sspiConnect(http->tls, hostname)) { - _sspiFree(http->tls_credentials); - http->tls_credentials = NULL; + DEBUG_printf(("8http_setup_ssl: _sspiConnect failed for \"%s\".", hostname)); + + _sspiFree(http->tls); + http->tls = NULL; http->error = EIO; http->status = HTTP_STATUS_ERROR; @@ -5478,7 +5486,7 @@ http_shutdown_ssl(http_t *http) /* I - Connection to server */ CFRelease(http->tls_credentials); # elif defined(HAVE_SSPISSL) - _sspiFree(http->tls_credentials); + _sspiFree(http->tls); # endif /* HAVE_LIBSSL */ http->tls = NULL; @@ -5898,5 +5906,5 @@ http_write_ssl(http_t *http, /* I - Connection to server */ /* - * End of "$Id: http.c 11392 2013-11-06 01:29:56Z msweet $". + * End of "$Id: http.c 11761 2014-03-28 13:04:33Z msweet $". */ diff --git a/cups/ipp-support.c b/cups/ipp-support.c index 604d65b4c1..2eaa8e5301 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp-support.c 11085 2013-07-03 13:53:05Z msweet $" + * "$Id: ipp-support.c 11734 2014-03-25 18:01:47Z msweet $" * * Internet Printing Protocol support functions for CUPS. * @@ -175,8 +175,8 @@ static const char * const ipp_std_ops[] = "Set-Printer-Attributes", "Set-Job-Attributes", "Get-Printer-Supported-Values", - "Create-Printer-Subscription", - "Create-Job-Subscription", + "Create-Printer-Subscriptions", + "Create-Job-Subscriptions", "Get-Subscription-Attributes", "Get-Subscriptions", "Renew-Subscription", @@ -2083,6 +2083,12 @@ ippOpValue(const char *name) /* I - Textual name */ if (!_cups_strcasecmp(name, ipp_cups_ops2[i])) return ((ipp_op_t)(i + 0x4027)); + if (!_cups_strcasecmp(name, "Create-Job-Subscription")) + return (IPP_OP_CREATE_JOB_SUBSCRIPTIONS); + + if (!_cups_strcasecmp(name, "Create-Printer-Subscription")) + return (IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS); + if (!_cups_strcasecmp(name, "CUPS-Add-Class")) return (IPP_OP_CUPS_ADD_MODIFY_CLASS); @@ -2248,5 +2254,5 @@ ipp_col_string(ipp_t *col, /* I - Collection attribute */ /* - * End of "$Id: ipp-support.c 11085 2013-07-03 13:53:05Z msweet $". + * End of "$Id: ipp-support.c 11734 2014-03-25 18:01:47Z msweet $". */ diff --git a/cups/ipp.h b/cups/ipp.h index c022547104..beada0af6e 100644 --- a/cups/ipp.h +++ b/cups/ipp.h @@ -1,18 +1,18 @@ /* - * "$Id: ipp.h 11085 2013-07-03 13:53:05Z msweet $" + * "$Id: ipp.h 11734 2014-03-25 18:01:47Z msweet $" * - * Internet Printing Protocol definitions for CUPS. + * Internet Printing Protocol definitions for CUPS. * - * Copyright 2007-2013 by Apple Inc. - * Copyright 1997-2006 by Easy Software Products. + * Copyright 2007-2014 by Apple Inc. + * Copyright 1997-2006 by Easy Software Products. * - * 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/". + * 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/". * - * This file is subject to the Apple OS-Developed Software exception. + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_IPP_H_ @@ -251,8 +251,8 @@ typedef enum ipp_op_e /**** IPP operations ****/ IPP_OP_SET_PRINTER_ATTRIBUTES, /* Set printer attributes @private@ */ IPP_OP_SET_JOB_ATTRIBUTES, /* Set job attributes */ IPP_OP_GET_PRINTER_SUPPORTED_VALUES, /* Get supported attribute values */ - IPP_OP_CREATE_PRINTER_SUBSCRIPTION, /* Create a printer subscription @since CUPS 1.2/OS X 10.5@ */ - IPP_OP_CREATE_JOB_SUBSCRIPTION, /* Create a job subscription @since CUPS 1.2/OS X 10.5@ */ + IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS, /* Create one or more printer subscriptions @since CUPS 1.2/OS X 10.5@ */ + IPP_OP_CREATE_JOB_SUBSCRIPTIONS, /* Create one of more job subscriptions @since CUPS 1.2/OS X 10.5@ */ IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES, /* Get subscription attributes @since CUPS 1.2/OS X 10.5@ */ IPP_OP_GET_SUBSCRIPTIONS, /* Get list of subscriptions @since CUPS 1.2/OS X 10.5@ */ IPP_OP_RENEW_SUBSCRIPTION, /* Renew a printer subscription @since CUPS 1.2/OS X 10.5@ */ @@ -331,8 +331,10 @@ typedef enum ipp_op_e /**** IPP operations ****/ # define IPP_SET_PRINTER_ATTRIBUTES IPP_OP_SET_PRINTER_ATTRIBUTES # define IPP_SET_JOB_ATTRIBUTES IPP_OP_SET_JOB_ATTRIBUTES # define IPP_GET_PRINTER_SUPPORTED_VALUES IPP_OP_GET_PRINTER_SUPPORTED_VALUES -# define IPP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTION -# define IPP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTION +# define IPP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS +# define IPP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTIONS +# define IPP_OP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS +# define IPP_OP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTIONS # define IPP_GET_SUBSCRIPTION_ATTRIBUTES IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES # define IPP_GET_SUBSCRIPTIONS IPP_OP_GET_SUBSCRIPTIONS # define IPP_RENEW_SUBSCRIPTION IPP_OP_RENEW_SUBSCRIPTION @@ -992,5 +994,5 @@ extern int ippValidateAttributes(ipp_t *ipp) _CUPS_API_1_7; #endif /* !_CUPS_IPP_H_ */ /* - * End of "$Id: ipp.h 11085 2013-07-03 13:53:05Z msweet $". + * End of "$Id: ipp.h 11734 2014-03-25 18:01:47Z msweet $". */ diff --git a/cups/request.c b/cups/request.c index 817169b6a7..6d27bdeaaa 100644 --- a/cups/request.c +++ b/cups/request.c @@ -1,5 +1,5 @@ /* - * "$Id: request.c 11174 2013-07-23 12:33:52Z msweet $" + * "$Id: request.c 11739 2014-03-26 21:06:04Z msweet $" * * IPP utilities for CUPS. * @@ -261,7 +261,7 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP * Get the server's response... */ - if (status != HTTP_STATUS_ERROR) + if (status <= HTTP_STATUS_CONTINUE || status == HTTP_STATUS_OK) { response = cupsGetResponse(http, resource); status = httpGetStatus(http); @@ -1177,5 +1177,5 @@ _cupsSetHTTPError(http_status_t status) /* I - HTTP status code */ /* - * End of "$Id: request.c 11174 2013-07-23 12:33:52Z msweet $". + * End of "$Id: request.c 11739 2014-03-26 21:06:04Z msweet $". */ diff --git a/cups/sspi.c b/cups/sspi.c index ff79e5a689..ba66f729b9 100644 --- a/cups/sspi.c +++ b/cups/sspi.c @@ -1,35 +1,15 @@ /* - * "$Id: sspi.c 3247 2011-05-12 06:22:31Z msweet $" + * "$Id: sspi.c 11760 2014-03-28 12:58:24Z msweet $" * - * Windows SSPI SSL implementation for CUPS. + * Windows SSPI SSL implementation for CUPS. * - * Copyright 2010-2011 by Apple Inc. + * Copyright 2010-2014 by Apple Inc. * - * 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/". - * - * Contents: - * - * sspi_alloc() - Allocate SSPI ssl object - * _sspiGetCredentials() - Retrieve an SSL/TLS certificate from the - * system store If one cannot be found, one is - * created. - * _sspiConnect() - Make an SSL connection. This function - * assumes a TCP/IP connection has already been - * successfully made - * _sspiAccept() - Accept an SSL/TLS connection - * _sspiSetAllowsAnyRoot() - Set the client cert policy for untrusted - * root certs - * _sspiSetAllowsExpiredCerts() - Set the client cert policy for expired root - * certs - * _sspiWrite() - Write a buffer to an ssl socket - * _sspiRead() - Read a buffer from an ssl socket - * _sspiPending() - Returns the number of available bytes - * _sspiFree() - Close a connection and free resources - * sspi_verify_certificate() - Verify a server certificate + * 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/". */ /* @@ -108,6 +88,9 @@ _sspiGetCredentials(_sspi_struct_t *conn, CRYPT_KEY_PROV_INFO ckp; /* Handle to crypto key */ BOOL ok = TRUE; /* Return value */ + + DEBUG_printf(("_sspiGetCredentials(conn=%p, container=%p, cn=\"%s\", isServer=%d)", conn, container, cn, isServer)); + if (!conn) return (FALSE); if (!cn) @@ -1481,5 +1464,5 @@ cleanup: /* - * End of "$Id: sspi.c 3247 2011-05-12 06:22:31Z msweet $". + * End of "$Id: sspi.c 11760 2014-03-28 12:58:24Z msweet $". */ diff --git a/cups/thread-private.h b/cups/thread-private.h index 3409be44ff..ae1b86a6ba 100644 --- a/cups/thread-private.h +++ b/cups/thread-private.h @@ -1,5 +1,5 @@ /* - * "$Id: thread-private.h 3794 2012-04-23 22:44:16Z msweet $" + * "$Id: thread-private.h 11642 2014-02-27 15:57:59Z msweet $" * * Private threading definitions for CUPS. * @@ -10,6 +10,8 @@ * 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/". + * + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_THREAD_PRIVATE_H_ @@ -94,5 +96,5 @@ extern int _cupsThreadCreate(_cups_thread_func_t func, void *arg); #endif /* !_CUPS_THREAD_PRIVATE_H_ */ /* - * End of "$Id: thread-private.h 3794 2012-04-23 22:44:16Z msweet $". + * End of "$Id: thread-private.h 11642 2014-02-27 15:57:59Z msweet $". */ diff --git a/cups/thread.c b/cups/thread.c index 0f623298b3..8c45252219 100644 --- a/cups/thread.c +++ b/cups/thread.c @@ -1,5 +1,5 @@ /* - * "$Id: thread.c 3794 2012-04-23 22:44:16Z msweet $" + * "$Id: thread.c 11642 2014-02-27 15:57:59Z msweet $" * * Threading primitives for CUPS. * @@ -11,6 +11,8 @@ * 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/". * + * This file is subject to the Apple OS-Developed Software exception. + * * Contents: * * _cupsMutexInit() - Initialize a mutex. @@ -332,5 +334,5 @@ _cupsThreadCreate( /* - * End of "$Id: thread.c 3794 2012-04-23 22:44:16Z msweet $". + * End of "$Id: thread.c 11642 2014-02-27 15:57:59Z msweet $". */ diff --git a/cups/usersys.c b/cups/usersys.c index 70372b41e5..457af4ab17 100644 --- a/cups/usersys.c +++ b/cups/usersys.c @@ -1,5 +1,5 @@ /* - * "$Id: usersys.c 11510 2014-01-08 16:00:25Z msweet $" + * "$Id: usersys.c 11689 2014-03-05 21:22:12Z msweet $" * * User, system, and password routines for CUPS. * @@ -703,7 +703,10 @@ _cupsGetPassword(const char *prompt) /* I - Prompt string */ while ((passbytes = read(tty, &passch, 1)) == 1) { - if (passch == noecho.c_cc[VEOL] || passch == noecho.c_cc[VEOL2] || + if (passch == noecho.c_cc[VEOL] || +# ifdef VEOL2 + passch == noecho.c_cc[VEOL2] || +# endif /* VEOL2 */ passch == 0x0A || passch == 0x0D) { /* @@ -851,6 +854,7 @@ _cupsSetDefaults(void) if ((cups_user = getenv("CUPS_USER")) == NULL) { +#ifndef WIN32 /* * Try the USER environment variable... */ @@ -868,6 +872,7 @@ _cupsSetDefaults(void) if ((pw = getpwnam(cups_user)) == NULL || pw->pw_uid != getuid()) cups_user = NULL; } +#endif /* !WIN32 */ } /* @@ -1136,5 +1141,5 @@ cups_read_client_conf( /* - * End of "$Id: usersys.c 11510 2014-01-08 16:00:25Z msweet $". + * End of "$Id: usersys.c 11689 2014-03-05 21:22:12Z msweet $". */ diff --git a/doc/de/index.html.in b/doc/de/index.html.in new file mode 100644 index 0000000000..0a3db7da3a --- /dev/null +++ b/doc/de/index.html.in @@ -0,0 +1,107 @@ + + +
+ +
+
| ||||||||||||||
CUPS und das CUPS Logo sind +eingetragene Warenzeichen der Apple Inc. +CUPS ist urheberrechtlich geschützt 2007-2014 von Apple Inc, alle Rechte vorbehalten. |
marker-types
, printer-alert
, and
printer-alert-description
printer attributes. Standard
marker-types
values are listed in Table
- 1.When reporting string values using "ATTR:" messages, a filter or backend must take special care to appropriately quote those values. The scheduler uses the CUPS option parsing code for attributes, so the general syntax is:
+ ++name=simple +name=simple,simple,... +name='complex value' +name="complex value" +name='"complex value"','"complex value"',... ++ +
Simple values are strings that do not contain spaces, quotes, backslashes, or the comma and can be placed verbatim in the "ATTR:" message, for example:
+ ++int levels[4] = { 40, 50, 60, 70 }; /* CMYK */ + +fputs("ATTR: marker-colors=#00FFFF,#FF00FF,#FFFF00,#000000\n", stderr); +fputs("ATTR: marker-high-levels=100,100,100,100\n", stderr); +fprintf(stderr, "ATTR: marker-levels=%d,%d,%d,%d\n", levels[0], levels[1], + levels[2], levels[3], levels[4]); +fputs("ATTR: marker-low-levels=5,5,5,5\n", stderr); +fputs("ATTR: marker-types=toner,toner,toner,toner\n", stderr); ++ +
Complex values that contains spaces, quotes, backslashes, or the comma must be quoted. For a single value a single set of quotes is sufficient:
+ ++fputs("ATTR: marker-message='Levels shown are approximate.'\n", stderr); ++ +
When multiple values are reported, each value must be enclosed by a set of single and double quotes:
+ ++fputs("ATTR: marker-names='\"Cyan Toner\"','\"Magenta Toner\"'," + "'\"Yellow Toner\"','\"Black Toner\"'\n", stderr); ++ +
The IPP backend includes a quote_string function that may be used to properly quote a complex value in an "ATTR:" message:
+ ++static const char * /* O - Quoted string */ +quote_string(const char *s, /* I - String */ + char *q, /* I - Quoted string buffer */ + size_t qsize) /* I - Size of quoted string buffer */ +{ + char *qptr, /* Pointer into string buffer */ + *qend; /* End of string buffer */ + + + qptr = q; + qend = q + qsize - 5; + + if (qend < q) + { + *q = '\0'; + return (q); + } + + *qptr++ = '\''; + *qptr++ = '\"'; + + while (*s && qptr < qend) + { + if (*s == '\\' || *s == '\"' || *s == '\'') + { + if (qptr < (qend - 4)) + { + *qptr++ = '\\'; + *qptr++ = '\\'; + *qptr++ = '\\'; + } + else + break; + } + + *qptr++ = *s++; + } + + *qptr++ = '\"'; + *qptr++ = '\''; + *qptr = '\0'; + + return (q); +} ++ +
Filters are responsible for managing the state keywords they set using diff --git a/doc/help/api-httpipp.html b/doc/help/api-httpipp.html index f6f117b56b..9023f0e980 100644 --- a/doc/help/api-httpipp.html +++ b/doc/help/api-httpipp.html @@ -5986,10 +5986,10 @@ are server-oriented...