/*
- * "$Id: encode.c 7696 2008-06-26 00:54:42Z mike $"
+ * "$Id$"
*
- * Option encoding routines for CUPS.
+ * Option encoding routines 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.
- *
- * Contents:
- *
- * cupsEncodeOptions() - Encode printer options into IPP attributes.
- * cupsEncodeOptions2() - Encode printer options into IPP attributes for
- * a group.
- * _ippFindOption() - Find the attribute information for an option.
- * compare_ipp_options() - Compare two IPP options.
+ * This file is subject to the Apple OS-Developed Software exception.
*/
/*
{ 0, "job-accounting-user-id", IPP_TAG_NAME, IPP_TAG_JOB },
{ 0, "job-accounting-user-id-default", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ 0, "job-authorization-uri", IPP_TAG_URI, IPP_TAG_OPERATION },
+ { 0, "job-cancel-after", IPP_TAG_INTEGER, IPP_TAG_JOB },
+ { 0, "job-cancel-after-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "job-hold-until", IPP_TAG_KEYWORD, IPP_TAG_JOB },
{ 0, "job-id", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-impressions", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
else
ops ++;
- if (*ops == IPP_OP_CUPS_NONE)
+ if (*ops == IPP_OP_CUPS_NONE && op != IPP_OP_CUPS_NONE)
{
DEBUG_printf(("2cupsEncodeOptions2: Skipping \"%s\".", option->name));
continue;
* Integer/enumeration value...
*/
- attr->values[j].integer = strtol(val, &s, 10);
+ attr->values[j].integer = (int)strtol(val, &s, 10);
DEBUG_printf(("2cupsEncodeOptions2: Added integer option value "
"%d...", attr->values[j].integer));
s = val;
}
else
- attr->values[j].range.lower = strtol(val, &s, 10);
+ attr->values[j].range.lower = (int)strtol(val, &s, 10);
if (*s == '-')
{
if (s[1])
- attr->values[j].range.upper = strtol(s + 1, NULL, 10);
+ attr->values[j].range.upper = (int)strtol(s + 1, NULL, 10);
else
attr->values[j].range.upper = 2147483647;
}
* Resolution...
*/
- attr->values[j].resolution.xres = strtol(val, &s, 10);
+ attr->values[j].resolution.xres = (int)strtol(val, &s, 10);
if (*s == 'x')
- attr->values[j].resolution.yres = strtol(s + 1, &s, 10);
+ attr->values[j].resolution.yres = (int)strtol(s + 1, &s, 10);
else
attr->values[j].resolution.yres = attr->values[j].resolution.xres;
/*
- * End of "$Id: encode.c 7696 2008-06-26 00:54:42Z mike $".
+ * End of "$Id$".
*/