CHANGES-1.6.txt
---------------
+CHANGES IN CUPS V1.6.3
+
+ - The configure script now prefers Clang over GCC.
+ - Fixed a compile problem on AIX (STR #4307)
+ - The Russian web interface templates were broken (STR #4310)
+ - The scheduler no longer tries to do Kerberos authentication over the
+ loopback interface.
+ - The IPP backend could fail to pause a job for authentication
+ (STR #4298)
+ - Fixed a regression on the handling of auth keys on OS X if the
+ cups-files.conf was not present or did not contain a SystemAuthKey
+ value.
+ - The scheduler incorrectly did a reverse lookup of the server address
+ when HostNameLookups was turned off (STR #4302)
+ - The scheduler incorrectly computed the final content type value when
+ null filters were present.
+
+
CHANGES IN CUPS V1.6.2
- Documentation fixes (STR #4229, STR #4239, STR #4234, STR #4248,
- Added a French localization (STR #4247)
- Added a Russian localization (STR #4228, STR #4285)
- Updated the Catalan localization (STR #4202)
+ - Local certificate authentication did not guard against an empty
+ certification file (STR #4293)
+ - The scheduler did not reject device URIs with spaces.
- Added USB quirk rule for Epson Stylus Photo 750 (STR #4286)
- The IPP backend could crash if the printer disconnects early
(STR #4284)
- The scheduler incorrectly advertised auth-info-required for local
queues needing local authentication (STR #4205)
- CUPS 1.6 clients using the ServerName directive in client.conf did not
- work with CUPS 1.3.x or older servers (STR #4231)
+ work with CUPS 1.3.x or older servers (STR #4231, STR #4291)
- The SNMP backend now tries to work around broken printers that use a
newline to separate key/value pairs.
- The IPP backend did not send a cancel request to printers when a job
-CHANGES.txt - 1.7b1 - 2013-01-30
+CHANGES.txt - 1.7b1 - 2013-04-09
--------------------------------
CHANGES IN CUPS V1.7b1
+ - The configure script now supports a --with-rundir option to change
+ the transient run-time state directory from the default to other
+ locations like /run/cups (STR #4306)
+ - The scheduler now supports PPD lookups for classes (STR #4296)
+ - The cupsfilter program did not set the FINAL_CONTENT_TYPE
+ environment variable for filters.
- Added a new "-x" option to the cancel command (STR #4103)
+ - Made the PWG media handling APIs public (STR #4267)
+ - Implemented ready media support for the cupsGetDestMediaXxx APIs
+ (STR #4289)
+ - Added new cupsFindDestDefault, cupsFindDestReady, and
+ cupsFindDestSupported APIs (STR #4289)
+ - Added new cupsGetDestMediaByIndex, cupsGetDestMediaCount, and
+ cupsGetDestMediaDefault APIs (STR #4289)
+ - Added new ippGet/SetOctetString APIs for getting and setting an
+ octetString value (STR #4289)
- Added new ippCreateRequestedArray API for generating a array of
attributes from the requested-attributes attribute.
- The ipptool utility now supports compression, conditional tests based
-INSTALL - CUPS v1.7b1 - 2013-01-11
+INSTALL - CUPS v1.7b1 - 2013-04-09
----------------------------------
This file describes how to compile and install CUPS from source code. For more
Compaq, HP, SGI, and Sun. BSD users should use GNU make (gmake) since BSD
make does not support "include".
- Besides these tools you'll want the JPEG, PNG, TIFF, and ZLIB libraries for
- image support, the CDSA, GNU TLS, or OpenSSL libraries for encryption
- support, the OpenLDAP and OpenSLP libraries for directory services support,
- and either MIT (1.6.3 or higher) or Heimdal Kerberos for Kerberos support.
- CUPS will compile and run without these, however you'll miss out on many of
- the features provided by CUPS.
-
- Also, please note that CUPS does not include the Ghostscript-based
- PostScript filter needed by non-PostScript printers. You *must* download
- GPL Ghostscript separately from the CUPS web site if you want to print
- PostScript files to non-PostScript printers on operating systems other than
- OS X.
+ Besides these tools you'll want ZLIB library for compression support, the
+ CDSA, GNU TLS, or OpenSSL libraries for encryption support, and either MIT
+ (1.6.3 or higher) or Heimdal Kerberos for Kerberos support. CUPS will
+ compile and run without these, however you'll miss out on many of the
+ features provided by CUPS.
+
+ Also, please note that CUPS does not include print filters to support PDF
+ or raster printing. You *must* download GPL Ghostscript and/or the Open
+ Printing CUPS filters package separately to print on operating systems
+ other than OS X.
COMPILING THE SUBVERSION REPOSITORY CODE
-README - CUPS v1.7b1 - 2013-01-11
+README - CUPS v1.7b1 - 2013-04-09
---------------------------------
************************************************
/* Username for device URI */
*password = NULL;
/* Password for device URI */
-static int password_tries = 0;
- /* Password tries */
static const char * const pattrs[] = /* Printer attributes we want */
{
#ifdef HAVE_LIBZ
int print_color_mode);
static const char *password_cb(const char *prompt, http_t *http,
const char *method, const char *resource,
- void *user_data);
+ int *user_data);
static const char *quote_string(const char *s, char *q, size_t qsize);
static void report_attr(ipp_attribute_t *attr);
static void report_printer_state(ipp_t *ipp);
*name, /* Name of option */
*value, /* Value of option */
sep; /* Separator character */
+ int password_tries = 0; /* Password tries */
http_addrlist_t *addrlist; /* Address of printer */
int snmp_enabled = 1; /* Is SNMP enabled? */
int snmp_fd, /* SNMP socket */
* Set the authentication info, if any...
*/
- cupsSetPasswordCB2(password_cb, NULL);
+ cupsSetPasswordCB2((cups_password_cb2_t)password_cb, &password_tries);
if (username[0])
{
}
else if (ipp_status == IPP_STATUS_ERROR_JOB_CANCELED ||
ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED ||
+ ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
check_printer_state(http, uri, resource, argv[2], version);
+ if (cupsLastError() <= IPP_OK_CONFLICT)
+ password_tries = 0;
+
/*
* Build an IPP_GET_JOB_ATTRIBUTES request...
*/
check_printer_state(http, uri, resource, argv[2], version);
+ if (cupsLastError() <= IPP_OK_CONFLICT)
+ password_tries = 0;
+
/*
* Collect the final page count as needed...
*/
fputs("JOBSTATE: account-authorization-failed\n", stderr);
if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN ||
- ipp_status == IPP_AUTHENTICATION_CANCELED ||
- ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
- ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
- ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
- ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
+ ipp_status == IPP_AUTHENTICATION_CANCELED)
return (CUPS_BACKEND_AUTH_REQUIRED);
+ else if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
+ ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
+ ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
+ ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
+ return (CUPS_BACKEND_HOLD);
else if (ipp_status == IPP_INTERNAL_ERROR)
return (CUPS_BACKEND_STOP);
else if (ipp_status == IPP_CONFLICT)
return (CUPS_BACKEND_FAILED);
else if (ipp_status == IPP_REQUEST_VALUE ||
+ ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||
ipp_status == IPP_DOCUMENT_FORMAT || job_canceled < 0)
{
if (ipp_status == IPP_REQUEST_VALUE)
else if (ipp_status == IPP_DOCUMENT_FORMAT)
_cupsLangPrintFilter(stderr, "ERROR",
_("Printer cannot print supplied content."));
+ else if (ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES)
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("Printer cannot print with supplied options."));
else
_cupsLangPrintFilter(stderr, "ERROR", _("Print job canceled at printer."));
fprintf(stderr, "DEBUG: Get-Printer-Attributes: %s (%s)\n",
ippErrorString(cupsLastError()), cupsLastErrorString());
- if (cupsLastError() <= IPP_OK_CONFLICT)
- password_tries = 0;
-
/*
* Return the printer-state value...
*/
const char *job_name; /* Job name */
ipp_jstate_t job_state; /* Job state */
const char *job_user; /* Job originating user name */
+ int password_tries = 0; /* Password tries */
/*
httpSetTimeout(http, 30.0, timeout_cb, NULL);
if (username[0])
cupsSetUser(username);
- cupsSetPasswordCB2(password_cb, NULL);
+
+ cupsSetPasswordCB2((cups_password_cb2_t)password_cb, &password_tries);
/*
* Loop until the job is canceled, aborted, or completed.
monitor->resource,
monitor->user,
monitor->version);
+ if (cupsLastError() <= IPP_OK_CONFLICT)
+ password_tries = 0;
/*
* Check the status of the job itself...
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id",
NULL, keyword);
- if (pc->account_id &&
+ if (pc->accounting_user_id &&
(keyword = cupsGetOption("job-accounting-user-id", num_options,
options)) != NULL)
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME,
http_t *http, /* I - Connection */
const char *method, /* I - Request method (not used) */
const char *resource, /* I - Resource path (not used) */
- void *user_data) /* I - User data (not used) */
+ int *password_tries) /* I - Password tries */
{
char def_username[HTTP_MAX_VALUE]; /* Default username */
- fprintf(stderr, "DEBUG: password_cb(prompt=\"%s\"), password=%p, "
- "password_tries=%d\n", prompt, password, password_tries);
+ fprintf(stderr, "DEBUG: password_cb(prompt=\"%s\", http=%p, method=\"%s\", "
+ "resource=\"%s\", password_tries=%p(%d)), password=%p\n",
+ prompt, http, method, resource, password_tries, *password_tries,
+ password);
(void)prompt;
(void)method;
(void)resource;
- (void)user_data;
/*
* Remember that we need to authenticate...
quote_string(def_username, quoted, sizeof(quoted)));
}
- if (password && *password && password_tries < 3)
+ if (password && *password && *password_tries < 3)
{
- password_tries ++;
+ (*password_tries) ++;
return (password);
}
static OSStatus copy_deviceid(classdriver_t **classdriver,
CFStringRef *deviceID)
{
- CFStringRef devID = NULL,
-
- deviceMake = NULL,
- deviceModel = NULL,
- deviceSerial = NULL;
+ CFStringRef devID = NULL;
+ CFStringRef deviceMake = NULL;
+ CFStringRef deviceModel = NULL;
+ CFStringRef deviceSerial = NULL;
+
+ *deviceID = NULL;
OSStatus err = (*classdriver)->GetDeviceID(classdriver, &devID, DEFAULT_TIMEOUT);
if (deviceSerial == NULL && desc.iSerialNumber != 0)
{
- CFStringRef data = NULL;
- err = (*classdriver)->GetString(classdriver, desc.iSerialNumber, kUSBLanguageEnglish, DEFAULT_TIMEOUT, &data);
- if (data != NULL)
+ err = (*classdriver)->GetString(classdriver, desc.iSerialNumber, kUSBLanguageEnglish, DEFAULT_TIMEOUT, &deviceSerial);
+ if (deviceSerial != NULL)
{
- CFStringAppendFormat(newDevID, NULL, CFSTR("SERN:%@;"), data);
- CFRelease(data);
+ CFStringAppendFormat(newDevID, NULL, CFSTR("SERN:%@;"), deviceSerial);
}
}
{
*deviceID = devID;
}
+
+ if (*deviceID == NULL)
+ return err;
+
+ /* Remove special characters from the serial number */
+ CFRange range = (deviceSerial != NULL ? CFStringFind(deviceSerial, CFSTR("+"), 0) : CFRangeMake(0, 0));
+ if (range.length == 1) {
+ range = CFStringFind(*deviceID, deviceSerial, 0);
+
+ CFMutableStringRef deviceIDString = CFStringCreateMutableCopy(NULL, 0, *deviceID);
+ CFStringFindAndReplace(deviceIDString, CFSTR("+"), CFSTR(""), range, 0);
+ CFRelease(*deviceID);
+ *deviceID = deviceIDString;
+ }
+
release_deviceinfo(&deviceMake, &deviceModel, &deviceSerial);
return err;
#define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
#define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific
Class or SubClass */
-#define USBLP_QUICK_BLACKLIST 0x8 /* these printers do not conform to the USB print spec */
+#define USBLP_QUIRK_BLACKLIST 0x8 /* these printers do not conform to the USB print spec */
#define USBLP_QUIRK_RESET 0x4000 /* After printing do a reset
for clean-up */
#define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach
AC_CONFIG_HEADER(config.h)
dnl Version number information...
-CUPS_VERSION="1.7svn"
+CUPS_VERSION="1.7b1"
CUPS_REVISION=""
-if test -z "$CUPS_REVISION" -a -d .svn; then
- CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
-fi
+#if test -z "$CUPS_REVISION" -a -d .svn; then
+# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
+#fi
CUPS_BUILD="cups-$CUPS_VERSION"
AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" string ],
dnl Checks for programs...
AC_PROG_AWK
-AC_PROG_CC
+AC_PROG_CC(clang cc gcc)
AC_PROG_CPP
-AC_PROG_CXX
+AC_PROG_CXX(clang++ c++ g++)
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CHMOD,chmod)
dnl Extra platform-specific libraries...
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@SYSTEM"
+CUPS_DEFAULT_SYSTEM_AUTHKEY=""
CUPS_SYSTEM_AUTHKEY=""
INSTALLXPC=""
if test "x$default_adminkey" != xdefault; then
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
+ CUPS_DEFAULT_SYSTEM_AUTHKEY="$default_adminkey"
elif grep -q system.print.operator /etc/authorization; then
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
+ CUPS_DEFAULT_SYSTEM_AUTHKEY="system.print.admin"
else
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
+ CUPS_DEFAULT_SYSTEM_AUTHKEY="system.preferences"
fi
if test "x$default_operkey" != xdefault; then
AC_SUBST(CUPS_DEFAULT_PRINTOPERATOR_AUTH)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTOPERATOR_AUTH, "$CUPS_DEFAULT_PRINTOPERATOR_AUTH")
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_AUTHKEY, "$CUPS_DEFAULT_SYSTEM_AUTHKEY")
AC_SUBST(CUPS_SYSTEM_AUTHKEY)
AC_SUBST(INSTALLXPC)
dnl
dnl Directory stuff for CUPS.
dnl
-dnl Copyright 2007-2012 by Apple Inc.
+dnl Copyright 2007-2013 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
AC_SUBST(CUPS_SERVERROOT)
# Transient run-time state
-case "$uname" in
- Darwin*)
- # Darwin (OS X)
- CUPS_STATEDIR="$CUPS_SERVERROOT"
- ;;
- *)
- # All others
- CUPS_STATEDIR="$localstatedir/run/cups"
- ;;
-esac
+AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
+ case "$uname" in
+ Darwin*)
+ # Darwin (OS X)
+ CUPS_STATEDIR="$CUPS_SERVERROOT"
+ ;;
+ *)
+ # All others
+ CUPS_STATEDIR="$localstatedir/run/cups"
+ ;;
+ esac])
AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
AC_SUBST(CUPS_STATEDIR)
#define CUPS_DEFAULT_GROUP "sys"
#define CUPS_DEFAULT_SYSTEM_GROUPS "sys root system"
#define CUPS_DEFAULT_PRINTOPERATOR_AUTH "@SYSTEM"
+#define CUPS_DEFAULT_SYSTEM_AUTHKEY "system.print.admin"
/*
ipp.h \
language.h \
ppd.h \
+ pwg.h \
raster.h \
sidechannel.h \
transcode.h \
$(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
+#
+# Run oclint to check code coverage...
+#
+
+oclint:
+ oclint -o=oclint.html -html $(LIBOBJS:.o=.c) -- $(ALL_CFLAGS)
+
+
#
# Install all targets...
#
--css ../doc/cups-printable.css \
--header api-cups.header --intro api-cups.shtml \
api-cups.xml \
- cups.h adminutil.c dest*.c language.c notify.c \
- options.c tempfile.c usersys.c \
+ cups.h pwg.h adminutil.c dest*.c language.c notify.c \
+ options.c pwg-media.c tempfile.c usersys.c \
util.c >../doc/help/api-cups.html
mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
$(RM) api-cups.xml
int pid; /* Current process ID */
FILE *fp; /* Certificate file */
char trc[16], /* Try Root Certificate parameter */
- filename[1024], /* Certificate filename */
- certificate[33];/* Certificate string */
+ filename[1024]; /* Certificate filename */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
# if defined(HAVE_AUTHORIZATION_H)
OSStatus status; /* Status */
* Read the certificate from the file...
*/
- fgets(certificate, sizeof(certificate), fp);
+ char certificate[33], /* Certificate string */
+ *certptr; /* Pointer to certificate string */
+
+ certptr = fgets(certificate, sizeof(certificate), fp);
fclose(fp);
- /*
- * Set the authorization string and return...
- */
+ if (certptr)
+ {
+ /*
+ * Set the authorization string and return...
+ */
- httpSetAuthString(http, "Local", certificate);
+ httpSetAuthString(http, "Local", certificate);
- DEBUG_printf(("8cups_local_auth: Returning authstring=\"%s\"",
- http->authstring));
+ DEBUG_printf(("8cups_local_auth: Returning authstring=\"%s\"",
+ http->authstring));
- return (0);
+ return (0);
+ }
}
return (1);
cups_array_t *leg_size_lut, /* Lookup table for legacy names */
*ppd_size_lut, /* Lookup table for PPD names */
*pwg_size_lut; /* Lookup table for PWG names */
- _pwg_media_t pwg_media; /* PWG media data for custom size */
+ pwg_media_t pwg_media; /* PWG media data for custom size */
char pwg_name[65]; /* PWG media name for custom size */
/* request.c */
struct _cups_dinfo_s /* Destination capability and status
* information */
{
+ int version; /* IPP version */
const char *uri; /* Printer URI */
char *resource; /* Resource path */
ipp_t *attrs; /* Printer attributes */
cups_array_t *media_db; /* Media database */
_cups_media_db_t min_size, /* Minimum size */
max_size; /* Maximum size */
+ unsigned cached_flags; /* Flags used for cached media */
+ cups_array_t *cached_db; /* Cache of media from last index/default */
+ time_t ready_time; /* When xxx-ready attributes were last queried */
+ ipp_t *ready_attrs; /* xxx-ready attributes */
+ cups_array_t *ready_db; /* media[-col]-ready media database */
};
*
* API definitions for CUPS.
*
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
# include "file.h"
# include "ipp.h"
# include "language.h"
+# include "pwg.h"
/*
int last_document) _CUPS_API_1_6;
/* New in CUPS 1.7 */
+extern ipp_attribute_t *cupsFindDestDefault(http_t *http, cups_dest_t *dest,
+ cups_dinfo_t *dinfo,
+ const char *option) _CUPS_API_1_7;
+extern ipp_attribute_t *cupsFindDestReady(http_t *http, cups_dest_t *dest,
+ cups_dinfo_t *dinfo,
+ const char *option) _CUPS_API_1_7;
+extern ipp_attribute_t *cupsFindDestSupported(http_t *http, cups_dest_t *dest,
+ cups_dinfo_t *dinfo,
+ const char *option)
+ _CUPS_API_1_7;
+extern int cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
+ cups_dinfo_t *dinfo, int n,
+ unsigned flags,
+ cups_size_t *size)
+ _CUPS_API_1_7;
+extern int cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
+ cups_dinfo_t *dinfo,
+ unsigned flags) _CUPS_API_1_7;
+extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
+ cups_dinfo_t *dinfo,
+ unsigned flags,
+ cups_size_t *size)
+ _CUPS_API_1_7;
extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
extern const char *cupsUserAgent(void) _CUPS_API_1_7;
return (IPP_STATUS_ERROR_INTERNAL);
}
+ ippSetVersion(request, info->version / 10, info->version % 10);
+
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, info->uri);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
return (IPP_STATUS_ERROR_INTERNAL);
}
+ ippSetVersion(request, info->version / 10, info->version % 10);
+
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, info->uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
return (HTTP_STATUS_ERROR);
}
+ ippSetVersion(request, info->version / 10, info->version % 10);
+
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, info->uri);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", job_id);
* option/value pair.
* cupsCopyDestInfo() - Get the supported values/capabilities for the
* destination.
+ * cupsFindDestDefault() - Find the default value(s) for the given
+ * option.
+ * cupsFindDestReady() - Find the default value(s) for the given
+ * option.
+ * cupsFindDestSupported() - Find the default value(s) for the given
+ * option.
* cupsFreeDestInfo() - Free destination information obtained using
* @link cupsCopyDestInfo@.
+ * cupsGetDestMediaByIndex() - Get a media name, dimension, and margins for a
+ * specific size.
* cupsGetDestMediaByName() - Get media names, dimensions, and margins.
* cupsGetDestMediaBySize() - Get media names, dimensions, and margins.
+ * cupsGetDestMediaCount() - Get the number of sizes supported by a
+ * destination.
+ * cupsGetDestMediaDefault() - Get the default size for a destination.
* cups_add_dconstres() - Add a constraint or resolver to an array.
* cups_compare_dconstres() - Compare to resolver entries.
* cups_compare_media_db() - Compare two media entries.
* cups_copy_media_db() - Copy a media entry.
+ * cups_create_cached() - Create the media selection cache.
* cups_create_constraints() - Create the constraints and resolvers arrays.
* cups_create_defaults() - Create the -default option array.
* cups_create_media_db() - Create the media database.
* cups_is_close_media_db() - Compare two media entries to see if they are
* close to the same size.
* cups_test_constraints() - Test constraints.
+ * cups_update_ready() - Update xxx-ready attributes for the printer.
*/
/*
#include "cups-private.h"
+/*
+ * Local constants...
+ */
+
+#define _CUPS_MEDIA_READY_TTL 30 /* Life of xxx-ready values */
+
+
/*
* Local functions...
*/
static int cups_compare_media_db(_cups_media_db_t *a,
_cups_media_db_t *b);
static _cups_media_db_t *cups_copy_media_db(_cups_media_db_t *mdb);
+static void cups_create_cached(http_t *http, cups_dinfo_t *dinfo,
+ unsigned flags);
static void cups_create_constraints(cups_dinfo_t *dinfo);
static void cups_create_defaults(cups_dinfo_t *dinfo);
-static void cups_create_media_db(cups_dinfo_t *dinfo);
+static void cups_create_media_db(cups_dinfo_t *dinfo,
+ unsigned flags);
static void cups_free_media_db(_cups_media_db_t *mdb);
-static int cups_get_media_db(cups_dinfo_t *dinfo,
- _pwg_media_t *pwg, unsigned flags,
+static int cups_get_media_db(http_t *http, cups_dinfo_t *dinfo,
+ pwg_media_t *pwg, unsigned flags,
cups_size_t *size);
static int cups_is_close_media_db(_cups_media_db_t *a,
_cups_media_db_t *b);
cups_option_t *options,
int *num_conflicts,
cups_option_t **conflicts);
+static void cups_update_ready(http_t *http, cups_dinfo_t *dinfo);
/*
* Check range of custom media sizes...
*/
- _pwg_media_t *pwg; /* Current PWG media size info */
+ pwg_media_t *pwg; /* Current PWG media size info */
int min_width, /* Minimum width */
min_length, /* Minimum length */
max_width, /* Maximum width */
i --, attrval ++)
{
if (!strncmp(attrval->string.text, "custom_min_", 11) &&
- (pwg = _pwgMediaForPWG(attrval->string.text)) != NULL)
+ (pwg = pwgMediaForPWG(attrval->string.text)) != NULL)
{
min_width = pwg->width;
min_length = pwg->length;
}
else if (!strncmp(attrval->string.text, "custom_max_", 11) &&
- (pwg = _pwgMediaForPWG(attrval->string.text)) != NULL)
+ (pwg = pwgMediaForPWG(attrval->string.text)) != NULL)
{
max_width = pwg->width;
max_length = pwg->length;
*/
if (min_width < INT_MAX && max_width > 0 &&
- (pwg = _pwgMediaForPWG(value)) != NULL &&
+ (pwg = pwgMediaForPWG(value)) != NULL &&
pwg->width >= min_width && pwg->width <= max_width &&
pwg->length >= min_length && pwg->length <= max_length)
return (1);
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
uri);
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
- NULL, cupsUser());
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
+ "requesting-user-name", NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes",
(int)(sizeof(requested_attrs) / sizeof(requested_attrs[0])),
return (NULL);
}
+ dinfo->version = version;
dinfo->uri = uri;
dinfo->resource = _cupsStrAlloc(resource);
dinfo->attrs = response;
}
+/*
+ * 'cupsFindDestDefault()' - Find the default value(s) for the given option.
+ *
+ * The returned value is an IPP attribute. Use the @code ippGetBoolean@,
+ * @code ippGetCollection@, @code ippGetCount@, @code ippGetDate@,
+ * @code ippGetInteger@, @code ippGetOctetString@, @code ippGetRange@,
+ * @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
+ * functions to inspect the default value(s) as needed.
+ *
+ * @since CUPS 1.7@
+ */
+
+ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
+cupsFindDestDefault(
+ http_t *http, /* I - Connection to destination */
+ cups_dest_t *dest, /* I - Destination */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ const char *option) /* I - Option/attribute name */
+{
+ char name[IPP_MAX_NAME]; /* Attribute name */
+
+
+ /*
+ * Range check input...
+ */
+
+ if (!http || !dest || !dinfo || !option)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
+ return (NULL);
+ }
+
+ /*
+ * Find and return the attribute...
+ */
+
+ snprintf(name, sizeof(name), "%s-default", option);
+ return (ippFindAttribute(dinfo->attrs, name, IPP_TAG_ZERO));
+}
+
+/*
+ * 'cupsFindDestReady()' - Find the default value(s) for the given option.
+ *
+ * The returned value is an IPP attribute. Use the @code ippGetBoolean@,
+ * @code ippGetCollection@, @code ippGetCount@, @code ippGetDate@,
+ * @code ippGetInteger@, @code ippGetOctetString@, @code ippGetRange@,
+ * @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
+ * functions to inspect the default value(s) as needed.
+ *
+ * @since CUPS 1.7@
+ */
+
+ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
+cupsFindDestReady(
+ http_t *http, /* I - Connection to destination */
+ cups_dest_t *dest, /* I - Destination */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ const char *option) /* I - Option/attribute name */
+{
+ char name[IPP_MAX_NAME]; /* Attribute name */
+
+
+ /*
+ * Range check input...
+ */
+
+ if (!http || !dest || !dinfo || !option)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
+ return (NULL);
+ }
+
+ /*
+ * Find and return the attribute...
+ */
+
+ cups_update_ready(http, dinfo);
+
+ snprintf(name, sizeof(name), "%s-ready", option);
+ return (ippFindAttribute(dinfo->ready_attrs, name, IPP_TAG_ZERO));
+}
+
+/*
+ * 'cupsFindDestSupported()' - Find the default value(s) for the given option.
+ *
+ * The returned value is an IPP attribute. Use the @code ippGetBoolean@,
+ * @code ippGetCollection@, @code ippGetCount@, @code ippGetDate@,
+ * @code ippGetInteger@, @code ippGetOctetString@, @code ippGetRange@,
+ * @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
+ * functions to inspect the default value(s) as needed.
+ *
+ * @since CUPS 1.7@
+ */
+
+ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
+cupsFindDestSupported(
+ http_t *http, /* I - Connection to destination */
+ cups_dest_t *dest, /* I - Destination */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ const char *option) /* I - Option/attribute name */
+{
+ char name[IPP_MAX_NAME]; /* Attribute name */
+
+
+ /*
+ * Range check input...
+ */
+
+ if (!http || !dest || !dinfo || !option)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
+ return (NULL);
+ }
+
+ /*
+ * Find and return the attribute...
+ */
+
+ snprintf(name, sizeof(name), "%s-supported", option);
+ return (ippFindAttribute(dinfo->attrs, name, IPP_TAG_ZERO));
+}
+
+
/*
* 'cupsFreeDestInfo()' - Free destination information obtained using
* @link cupsCopyDestInfo@.
cupsArrayDelete(dinfo->media_db);
+ cupsArrayDelete(dinfo->cached_db);
+
+ ippDelete(dinfo->ready_attrs);
+ cupsArrayDelete(dinfo->ready_db);
+
ippDelete(dinfo->attrs);
free(dinfo);
}
+/*
+ * 'cupsGetDestMediaByIndex()' - Get a media name, dimension, and margins for a
+ * specific size.
+ *
+ * The @code flags@ parameter determines which set of media are indexed. For
+ * example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will get the Nth
+ * borderless size supported by the printer.
+ *
+ * @since CUPS 1.7@
+ */
+
+int /* O - 1 on success, 0 on failure */
+cupsGetDestMediaByIndex(
+ http_t *http, /* I - Connection to destination */
+ cups_dest_t *dest, /* I - Destination */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ int n, /* I - Media size number (0-based) */
+ unsigned flags, /* I - Media flags */
+ cups_size_t *size) /* O - Media size information */
+{
+ cups_size_t *nsize; /* Size for N */
+
+
+ /*
+ * Range check input...
+ */
+
+ if (size)
+ memset(size, 0, sizeof(cups_size_t));
+
+ if (!http || !dest || !dinfo || n < 0 || !size)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
+ return (0);
+ }
+
+ /*
+ * Load media list as needed...
+ */
+
+ if (flags & CUPS_MEDIA_FLAGS_READY)
+ cups_update_ready(http, dinfo);
+
+ if (!dinfo->cached_db || dinfo->cached_flags != flags)
+ cups_create_cached(http, dinfo, flags);
+
+ /*
+ * Copy the size over and return...
+ */
+
+ if ((nsize = (cups_size_t *)cupsArrayIndex(dinfo->cached_db, n)) == NULL)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
+ return (0);
+ }
+
+ memcpy(size, nsize, sizeof(cups_size_t));
+
+ return (1);
+}
+
+
/*
* 'cupsGetDestMediaByName()' - Get media names, dimensions, and margins.
*
unsigned flags, /* I - Media matching flags */
cups_size_t *size) /* O - Media size information */
{
- _pwg_media_t *pwg; /* PWG media info */
+ pwg_media_t *pwg; /* PWG media info */
/*
* Lookup the media size name...
*/
- if ((pwg = _pwgMediaForPWG(media)) == NULL)
- if ((pwg = _pwgMediaForLegacy(media)) == NULL)
+ if ((pwg = pwgMediaForPWG(media)) == NULL)
+ if ((pwg = pwgMediaForLegacy(media)) == NULL)
{
DEBUG_printf(("1cupsGetDestMediaByName: Unknown size '%s'.", media));
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unknown media size name."), 1);
* Lookup the size...
*/
- return (cups_get_media_db(dinfo, pwg, flags, size));
+ return (cups_get_media_db(http, dinfo, pwg, flags, size));
}
unsigned flags, /* I - Media matching flags */
cups_size_t *size) /* O - Media size information */
{
- _pwg_media_t *pwg; /* PWG media info */
+ pwg_media_t *pwg; /* PWG media info */
/*
* Lookup the media size name...
*/
- if ((pwg = _pwgMediaForSize(width, length)) == NULL)
+ if ((pwg = pwgMediaForSize(width, length)) == NULL)
{
DEBUG_printf(("1cupsGetDestMediaBySize: Invalid size %dx%d.", width,
length));
* Lookup the size...
*/
- return (cups_get_media_db(dinfo, pwg, flags, size));
+ return (cups_get_media_db(http, dinfo, pwg, flags, size));
+}
+
+
+/*
+ * 'cupsGetDestMediaCount()' - Get the number of sizes supported by a
+ * destination.
+ *
+ * The @code flags@ parameter determines the set of media sizes that are
+ * counted. For example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will return
+ * the number of borderless sizes.
+ *
+ * @since CUPS 1.7@
+ */
+
+int /* O - Number of sizes */
+cupsGetDestMediaCount(
+ http_t *http, /* I - Connection to destination */
+ cups_dest_t *dest, /* I - Destination */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ unsigned flags) /* I - Media flags */
+{
+ /*
+ * Range check input...
+ */
+
+ if (!http || !dest || !dinfo)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
+ return (0);
+ }
+
+ /*
+ * Load media list as needed...
+ */
+
+ if (flags & CUPS_MEDIA_FLAGS_READY)
+ cups_update_ready(http, dinfo);
+
+ if (!dinfo->cached_db || dinfo->cached_flags != flags)
+ cups_create_cached(http, dinfo, flags);
+
+ return (cupsArrayCount(dinfo->cached_db));
+}
+
+
+/*
+ * 'cupsGetDestMediaDefault()' - Get the default size for a destination.
+ *
+ * The @code flags@ parameter determines which default size is returned. For
+ * example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will return the default
+ * borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
+ *
+ * @since CUPS 1.7@
+ */
+
+int /* O - 1 on success, 0 on failure */
+cupsGetDestMediaDefault(
+ http_t *http, /* I - Connection to destination */
+ cups_dest_t *dest, /* I - Destination */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ unsigned flags, /* I - Media flags */
+ cups_size_t *size) /* O - Media size information */
+{
+ const char *media; /* Default media size */
+
+
+ /*
+ * Range check input...
+ */
+
+ if (size)
+ memset(size, 0, sizeof(cups_size_t));
+
+ if (!http || !dest || !dinfo || !size)
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
+ return (0);
+ }
+
+ /*
+ * Get the default media size, if any...
+ */
+
+ if ((media = cupsGetOption("media", dest->num_options,
+ dest->options)) == NULL)
+ media = "na_letter_8.5x11in";
+
+ if (cupsGetDestMediaByName(http, dest, dinfo, media, flags, size))
+ return (1);
+
+ if (strcmp(media, "na_letter_8.5x11in") &&
+ cupsGetDestMediaByName(http, dest, dinfo, "iso_a4_210x297mm", flags,
+ size))
+ return (1);
+
+ if (strcmp(media, "iso_a4_210x297mm") &&
+ cupsGetDestMediaByName(http, dest, dinfo, "na_letter_8.5x11in", flags,
+ size))
+ return (1);
+
+ if ((flags & CUPS_MEDIA_FLAGS_BORDERLESS) &&
+ cupsGetDestMediaByName(http, dest, dinfo, "na_index_4x6in", flags, size))
+ return (1);
+
+ /*
+ * Fall back to the first matching media size...
+ */
+
+ return (cupsGetDestMediaByIndex(http, dest, dinfo, flags, 0, size));
}
}
+/*
+ * 'cups_create_cached()' - Create the media selection cache.
+ */
+
+static void
+cups_create_cached(http_t *http, /* I - Connection to destination */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ unsigned flags) /* I - Media selection flags */
+{
+ cups_array_t *db; /* Media database array to use */
+ _cups_media_db_t *mdb, /* Media database entry */
+ *first; /* First entry this size */
+
+
+ if (dinfo->cached_db)
+ cupsArrayDelete(dinfo->cached_db);
+
+ dinfo->cached_db = cupsArrayNew(NULL, NULL);
+ dinfo->cached_flags = flags;
+
+ if (flags & CUPS_MEDIA_FLAGS_READY)
+ {
+ cups_update_ready(http, dinfo);
+ db = dinfo->ready_db;
+ }
+ else
+ {
+ if (!dinfo->media_db)
+ cups_create_media_db(dinfo, CUPS_MEDIA_FLAGS_DEFAULT);
+
+ db = dinfo->media_db;
+ }
+
+ for (mdb = (_cups_media_db_t *)cupsArrayFirst(db), first = mdb;
+ mdb;
+ mdb = (_cups_media_db_t *)cupsArrayNext(db))
+ {
+ if (flags & CUPS_MEDIA_FLAGS_BORDERLESS)
+ {
+ if (!mdb->left && !mdb->right && !mdb->top && !mdb->bottom)
+ cupsArrayAdd(dinfo->cached_db, mdb);
+ }
+ else if (flags & CUPS_MEDIA_FLAGS_DUPLEX)
+ {
+ if (first->width != mdb->width || first->length != mdb->length)
+ {
+ cupsArrayAdd(dinfo->cached_db, first);
+ first = mdb;
+ }
+ else if (mdb->left >= first->left && mdb->right >= first->right &&
+ mdb->top >= first->top && mdb->bottom >= first->bottom)
+ first = mdb;
+ }
+ }
+
+ if (flags & CUPS_MEDIA_FLAGS_DUPLEX)
+ cupsArrayAdd(dinfo->cached_db, first);
+}
+
+
/*
* 'cups_create_constraints()' - Create the constraints and resolvers arrays.
*/
static void
cups_create_media_db(
- cups_dinfo_t *dinfo) /* I - Destination information */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ unsigned flags) /* I - Media flags */
{
int i; /* Looping var */
_ipp_value_t *val; /* Current value */
*media_attr, /* media-xxx */
*x_dimension, /* x-dimension */
*y_dimension; /* y-dimension */
- _pwg_media_t *pwg; /* PWG media info */
+ pwg_media_t *pwg; /* PWG media info */
+ cups_array_t *db; /* New media database array */
_cups_media_db_t mdb; /* Media entry */
- dinfo->media_db = cupsArrayNew3((cups_array_func_t)cups_compare_media_db,
- NULL, NULL, 0,
- (cups_acopy_func_t)cups_copy_media_db,
- (cups_afree_func_t)cups_free_media_db);
- dinfo->min_size.width = INT_MAX;
- dinfo->min_size.length = INT_MAX;
- dinfo->max_size.width = 0;
- dinfo->max_size.length = 0;
+ db = cupsArrayNew3((cups_array_func_t)cups_compare_media_db,
+ NULL, NULL, 0,
+ (cups_acopy_func_t)cups_copy_media_db,
+ (cups_afree_func_t)cups_free_media_db);
- if ((media_col_db = ippFindAttribute(dinfo->attrs, "media-col-database",
- IPP_TAG_BEGIN_COLLECTION)) != NULL)
+ if (flags == CUPS_MEDIA_FLAGS_READY)
+ {
+ dinfo->ready_db = db;
+
+ media_col_db = ippFindAttribute(dinfo->ready_attrs, "media-col-ready",
+ IPP_TAG_BEGIN_COLLECTION);
+ media_attr = ippFindAttribute(dinfo->ready_attrs, "media-ready",
+ IPP_TAG_ZERO);
+ }
+ else
+ {
+ dinfo->media_db = db;
+ dinfo->min_size.width = INT_MAX;
+ dinfo->min_size.length = INT_MAX;
+ dinfo->max_size.width = 0;
+ dinfo->max_size.length = 0;
+
+ media_col_db = ippFindAttribute(dinfo->attrs, "media-col-database",
+ IPP_TAG_BEGIN_COLLECTION);
+ media_attr = ippFindAttribute(dinfo->attrs, "media-supported",
+ IPP_TAG_ZERO);
+ }
+
+ if (media_col_db)
{
_ipp_value_t *custom = NULL; /* Custom size range value */
/* media-size collection value */
if ((x_dimension = ippFindAttribute(media_size, "x-dimension",
- IPP_TAG_INTEGER)) != NULL &&
+ IPP_TAG_INTEGER)) != NULL &&
(y_dimension = ippFindAttribute(media_size, "y-dimension",
IPP_TAG_INTEGER)) != NULL)
{
+ /*
+ * Fixed size...
+ */
+
mdb.width = x_dimension->values[0].integer;
mdb.length = y_dimension->values[0].integer;
}
- else if ((x_dimension = ippFindAttribute(media_size, "x-dimension",
- IPP_TAG_RANGE)) != NULL &&
+ else if ((x_dimension = ippFindAttribute(media_size, "x-dimension",
+ IPP_TAG_INTEGER)) != NULL &&
+ (y_dimension = ippFindAttribute(media_size, "y-dimension",
+ IPP_TAG_RANGE)) != NULL)
+ {
+ /*
+ * Roll limits...
+ */
+
+ mdb.width = x_dimension->values[0].integer;
+ mdb.length = y_dimension->values[0].range.upper;
+ }
+ else if (flags != CUPS_MEDIA_FLAGS_READY &&
+ (x_dimension = ippFindAttribute(media_size, "x-dimension",
+ IPP_TAG_RANGE)) != NULL &&
(y_dimension = ippFindAttribute(media_size, "y-dimension",
IPP_TAG_RANGE)) != NULL)
{
dinfo->max_size.right = 635; /* Default 1/4" side margins */
dinfo->max_size.top =
dinfo->max_size.bottom = 1270; /* Default 1/2" top/bottom margins */
-
continue;
}
}
IPP_TAG_INTEGER)) != NULL)
mdb.top = media_attr->values[0].integer;
- cupsArrayAdd(dinfo->media_db, &mdb);
+ cupsArrayAdd(db, &mdb);
}
if (custom)
}
}
}
- else if ((media_attr = ippFindAttribute(dinfo->attrs, "media-supported",
- IPP_TAG_ZERO)) != NULL &&
+ else if (media_attr &&
(media_attr->value_tag == IPP_TAG_NAME ||
media_attr->value_tag == IPP_TAG_NAMELANG ||
media_attr->value_tag == IPP_TAG_KEYWORD))
i > 0;
i --, val ++)
{
- if ((pwg = _pwgMediaForPWG(val->string.text)) == NULL)
- if ((pwg = _pwgMediaForLegacy(val->string.text)) == NULL)
+ if ((pwg = pwgMediaForPWG(val->string.text)) == NULL)
+ if ((pwg = pwgMediaForLegacy(val->string.text)) == NULL)
{
DEBUG_printf(("3cups_create_media_db: Ignoring unknown size '%s'.",
val->string.text));
mdb.width = pwg->width;
mdb.length = pwg->length;
- if (!strncmp(val->string.text, "custom_min_", 11))
+ if (flags != CUPS_MEDIA_FLAGS_READY &&
+ !strncmp(val->string.text, "custom_min_", 11))
{
mdb.size_name = NULL;
dinfo->min_size = mdb;
}
- else if (!strncmp(val->string.text, "custom_max_", 11))
+ else if (flags != CUPS_MEDIA_FLAGS_READY &&
+ !strncmp(val->string.text, "custom_max_", 11))
{
mdb.size_name = NULL;
dinfo->max_size = mdb;
{
mdb.size_name = val->string.text;
- cupsArrayAdd(dinfo->media_db, &mdb);
+ cupsArrayAdd(db, &mdb);
}
}
}
*/
static int /* O - 1 on match, 0 on failure */
-cups_get_media_db(cups_dinfo_t *dinfo, /* I - Destination information */
- _pwg_media_t *pwg, /* I - PWG media info */
+cups_get_media_db(http_t *http, /* I - Connection to destination */
+ cups_dinfo_t *dinfo, /* I - Destination information */
+ pwg_media_t *pwg, /* I - PWG media info */
unsigned flags, /* I - Media matching flags */
- cups_size_t *size) /* O - Media size/margin/name info */
+ cups_size_t *size) /* O - Media size/margin/name info */
{
+ cups_array_t *db; /* Which media database to query */
_cups_media_db_t *mdb, /* Current media database entry */
*best = NULL, /* Best matching entry */
key; /* Search key */
* Create the media database as needed...
*/
- if (!dinfo->media_db)
- cups_create_media_db(dinfo);
+ if (flags & CUPS_MEDIA_FLAGS_READY)
+ {
+ cups_update_ready(http, dinfo);
+ db = dinfo->ready_db;
+ }
+ else
+ {
+ if (!dinfo->media_db)
+ cups_create_media_db(dinfo, CUPS_MEDIA_FLAGS_DEFAULT);
+
+ db = dinfo->media_db;
+ }
/*
* Find a match...
key.width = pwg->width;
key.length = pwg->length;
- if ((mdb = cupsArrayFind(dinfo->media_db, &key)) != NULL)
+ if ((mdb = cupsArrayFind(db, &key)) != NULL)
{
/*
* Found an exact match, let's figure out the best margins for the flags
if (best->left != 0 || best->right != 0 || best->top != 0 ||
best->bottom != 0)
{
- for (mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db);
+ for (mdb = (_cups_media_db_t *)cupsArrayNext(db);
mdb && !cups_compare_media_db(mdb, &key);
- mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db))
+ mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
if (mdb->left <= best->left && mdb->right <= best->right &&
mdb->top <= best->top && mdb->bottom <= best->bottom)
* Look for the largest margins...
*/
- for (mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db);
+ for (mdb = (_cups_media_db_t *)cupsArrayNext(db);
mdb && !cups_compare_media_db(mdb, &key);
- mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db))
+ mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
if (mdb->left >= best->left && mdb->right >= best->right &&
mdb->top >= best->top && mdb->bottom >= best->bottom)
* Look for the smallest non-zero margins...
*/
- for (mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db);
+ for (mdb = (_cups_media_db_t *)cupsArrayNext(db);
mdb && !cups_compare_media_db(mdb, &key);
- mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db))
+ mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
if (((mdb->left > 0 && mdb->left <= best->left) || best->left == 0) &&
((mdb->right > 0 && mdb->right <= best->right) ||
* Find a close size...
*/
- for (mdb = (_cups_media_db_t *)cupsArrayFirst(dinfo->media_db);
+ for (mdb = (_cups_media_db_t *)cupsArrayFirst(db);
mdb;
- mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db))
+ mdb = (_cups_media_db_t *)cupsArrayNext(db))
if (cups_is_close_media_db(mdb, &key))
break;
if (best->left != 0 || best->right != 0 || best->top != 0 ||
best->bottom != 0)
{
- for (mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db);
+ for (mdb = (_cups_media_db_t *)cupsArrayNext(db);
mdb && cups_is_close_media_db(mdb, &key);
- mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db))
+ mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
if (mdb->left <= best->left && mdb->right <= best->right &&
mdb->top <= best->top && mdb->bottom <= best->bottom)
* Look for the largest margins...
*/
- for (mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db);
+ for (mdb = (_cups_media_db_t *)cupsArrayNext(db);
mdb && cups_is_close_media_db(mdb, &key);
- mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db))
+ mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
if (mdb->left >= best->left && mdb->right >= best->right &&
mdb->top >= best->top && mdb->bottom >= best->bottom)
* Look for the smallest non-zero margins...
*/
- for (mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db);
+ for (mdb = (_cups_media_db_t *)cupsArrayNext(db);
mdb && cups_is_close_media_db(mdb, &key);
- mdb = (_cups_media_db_t *)cupsArrayNext(dinfo->media_db))
+ mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
if (((mdb->left > 0 && mdb->left <= best->left) || best->left == 0) &&
((mdb->right > 0 && mdb->right <= best->right) ||
}
+/*
+ * 'cups_update_ready()' - Update xxx-ready attributes for the printer.
+ */
+
+static void
+cups_update_ready(http_t *http, /* I - Connection to destination */
+ cups_dinfo_t *dinfo) /* I - Destination information */
+{
+ ipp_t *request; /* Get-Printer-Attributes request */
+ static const char * const pattrs[] = /* Printer attributes we want */
+ {
+ "finishings-col-ready",
+ "finishings-ready",
+ "job-finishings-col-ready",
+ "job-finishings-ready",
+ "media-col-ready",
+ "media-ready"
+ };
+
+
+ /*
+ * Don't update more than once every 30 seconds...
+ */
+
+ if ((time(NULL) - dinfo->ready_time) < _CUPS_MEDIA_READY_TTL)
+ return;
+
+ /*
+ * Free any previous results...
+ */
+
+ if (dinfo->cached_flags & CUPS_MEDIA_FLAGS_READY)
+ {
+ cupsArrayDelete(dinfo->cached_db);
+ dinfo->cached_db = NULL;
+ dinfo->cached_flags = CUPS_MEDIA_FLAGS_DEFAULT;
+ }
+
+ ippDelete(dinfo->ready_attrs);
+ dinfo->ready_attrs = NULL;
+
+ cupsArrayDelete(dinfo->ready_db);
+ dinfo->ready_db = NULL;
+
+ /*
+ * Query the xxx-ready values...
+ */
+
+ request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
+ ippSetVersion(request, dinfo->version / 10, dinfo->version % 10);
+
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
+ dinfo->uri);
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
+ NULL, cupsUser());
+ ippAddStrings(request, IPP_TAG_OPERATION,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "requested-attributes",
+ (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
+
+ dinfo->ready_attrs = cupsDoRequest(http, request, dinfo->resource);
+
+ /*
+ * Update the ready media database...
+ */
+
+ cups_create_media_db(dinfo, CUPS_MEDIA_FLAGS_READY);
+
+ /*
+ * Update last lookup time and return...
+ */
+
+ dinfo->ready_time = time(NULL);
+}
+
+
/*
* End of "$Id$".
*/
int namesize) /* I - Size of buffer */
{
CFStringRef defaultPaperID; /* Default paper ID */
- _pwg_media_t *pwgmedia; /* PWG media size */
+ pwg_media_t *pwgmedia; /* PWG media size */
defaultPaperID = _cupsAppleCopyDefaultPaperID();
!CFStringGetCString(defaultPaperID, name, namesize,
kCFStringEncodingUTF8))
name[0] = '\0';
- else if ((pwgmedia = _pwgMediaForLegacy(name)) != NULL)
+ else if ((pwgmedia = pwgMediaForLegacy(name)) != NULL)
strlcpy(name, pwgmedia->pwg, namesize);
if (defaultPaperID)
*
* HTTP address routines for CUPS.
*
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
# include <poll.h>
#endif /* HAVE_POLL */
#ifndef WIN32
-# include <sys/fcntl.h>
+# include <fcntl.h>
#endif /* WIN32 */
* 'httpAddrConnect2()' - Connect to any of the addresses in the list with a
* timeout and optional cancel.
*
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.7@
*/
http_addrlist_t * /* O - Connected address or NULL on failure */
* number. The result is formatted as a UUID URN as defined in RFC 4122.
*
* The buffer needs to be at least 46 bytes in size.
+ *
+ * @since CUPS 1.7@
*/
char * /* I - UUID string */
return (NULL);
}
}
+ else if ((*src & 255) <= 0x20 || (*src & 255) >= 0x7f)
+ {
+ *ptr = '\0';
+ return (NULL);
+ }
else
*ptr++ = *src;
}
* _httpFreeCredentials() - Free internal credentials.
* httpFreeCredentials() - Free an array of credentials.
* httpGet() - Send a GET request to the server.
- * httpGetContentEncoding() - Get a common content encoding, if any,
- * between the client and server.
* httpGetAuthString() - Get the current authorization string.
* httpGetBlocking() - Get the blocking/non-block state of a
* connection.
+ * httpGetContentEncoding() - Get a common content encoding, if any,
+ * between the client and server.
* httpGetCookie() - Get any cookie data from the response.
* httpGetExpect() - Get the value of the Expect header, if any.
* httpGetFd() - Get the file descriptor associated with a
}
+/*
+ * 'httpGetAuthString()' - Get the current authorization string.
+ *
+ * The authorization string is set by cupsDoAuthentication() and
+ * httpSetAuthString(). Use httpGetAuthString() to retrieve the
+ * string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
+ * value.
+ *
+ * @since CUPS 1.3/OS X 10.5@
+ */
+
+char * /* O - Authorization string */
+httpGetAuthString(http_t *http) /* I - Connection to server */
+{
+ if (http)
+ return (http->authstring);
+ else
+ return (NULL);
+}
+
+
+/*
+ * 'httpGetBlocking()' - Get the blocking/non-block state of a connection.
+ *
+ * @since CUPS 1.2/OS X 10.5@
+ */
+
+int /* O - 1 if blocking, 0 if non-blocking */
+httpGetBlocking(http_t *http) /* I - Connection to server */
+{
+ return (http ? http->blocking : 0);
+}
+
+
/*
* 'httpGetContentEncoding()' - Get a common content encoding, if any, between
* the client and server.
}
-/*
- * 'httpGetAuthString()' - Get the current authorization string.
- *
- * The authorization string is set by cupsDoAuthentication() and
- * httpSetAuthString(). Use httpGetAuthString() to retrieve the
- * string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
- * value.
- *
- * @since CUPS 1.3/OS X 10.5@
- */
-
-char * /* O - Authorization string */
-httpGetAuthString(http_t *http) /* I - Connection to server */
-{
- if (http)
- return (http->authstring);
- else
- return (NULL);
-}
-
-
-/*
- * 'httpGetBlocking()' - Get the blocking/non-block state of a connection.
- *
- * @since CUPS 1.2/OS X 10.5@
- */
-
-int /* O - 1 if blocking, 0 if non-blocking */
-httpGetBlocking(http_t *http) /* I - Connection to server */
-{
- return (http ? http->blocking : 0);
-}
-
-
/*
* 'httpGetCookie()' - Get any cookie data from the response.
*
if (http->state == HTTP_STATE_POST_RECV)
http->state ++;
+ else if (http->state == HTTP_STATE_GET_SEND ||
+ http->state == HTTP_STATE_POST_SEND)
+ http->state = HTTP_STATE_WAITING;
else
http->state = HTTP_STATE_STATUS;
/*
* 'httpSetDefaultField()' - Set the default value of an HTTP header.
*
- * Currently only HTTP_FIELD_ACCEPT_ENCODING, HTTP_FIELD_SERVER, and
- * HTTP_FIELD_USER_AGENT can be set.
+ * Currently only @code HTTP_FIELD_ACCEPT_ENCODING@, @code HTTP_FIELD_SERVER@,
+ * and @code HTTP_FIELD_USER_AGENT@ can be set.
*
* @since CUPS 1.7@
*/
CUPS_LLCAST bytes));
#ifdef DEBUG
if (bytes > 0)
- http_debug_hex("http_read", http->buffer, (int)bytes);
+ http_debug_hex("http_read", buffer, (int)bytes);
#endif /* DEBUG */
if (bytes < 0)
http->error = EIO;
http->status = HTTP_STATUS_ERROR;
- _cupsSetError(IPP_PKI_ERROR, gnutls_strerror(status), 0);
+ _cupsSetError(IPP_STATUS_ERROR_CUPS_PKI, gnutls_strerror(status), 0);
gnutls_deinit(http->tls);
gnutls_certificate_free_credentials(*credentials);
"punch-dual-bottom",
"punch-triple-left",
"punch-triple-top",
- /* 0x40000050 - 0x40000055 */
+ /* 0x40000050 - 0x4000005F */
"punch-triple-right",
"punch-triple-bottom",
"punch-quad-left",
"punch-quad-top",
"punch-quad-right",
"punch-quad-bottom",
+ "0x40000056",
+ "0x40000057",
+ "0x40000058",
+ "0x40000059",
+ "fold-accordian",
+ "fold-double-gate",
+ "fold-gate",
+ "fold-half",
+ "fold-half-z",
+ "fold-left-gate",
+ /* 0x40000060 - 0x40000064 */
+ "fold-letter",
+ "fold-parallel",
+ "fold-poster",
+ "fold-right-gate",
+ "fold-z"
},
* const ipp_job_collation_types[] =
{ /* job-collation-type enums */
"print-content-optimize-actual",
"print-quality-actual",
"print-rendering-intent-actual",
+ "print-scaling-actual", /* IPP Paid Printing */
"printer-resolution-actual",
"printer-up-time",
"separator-sheets-actual",
"orientation-requested",
"orientation-requested-default",
"orientation-requested-supported",
+ "output-mode", /* CUPS extension */
+ "output-mode-default", /* CUPS extension */
+ "output-mode-supported", /* CUPS extension */
"overrides",
"overrides-supported",
"page-delivery",
"print-rendering-intent",
"print-rendering-intent-default",
"print-rendering-intent-supported",
+ "print-scaling", /* IPP Paid Printing */
+ "print-scaling-default", /* IPP Paid Printing */
+ "print-scaling-supported", /* IPP Paid Printing */
"printer-resolution",
"printer-resolution-default",
"printer-resolution-supported",
"print-content-optimize-actual",
"print-quality-actual",
"print-rendering-intent-actual",
+ "print-scaling-actual", /* IPP Paid Printing */
"printer-resolution-actual",
"separator-sheets-actual",
"sheet-collate-actual",
"output-device",
"output-device-default",
"output-device-supported",
+ "output-mode", /* CUPS extension */
+ "output-mode-default", /* CUPS extension */
+ "output-mode-supported", /* CUPS extension */
"overrides",
"overrides-supported",
"page-delivery",
"print-rendering-intent",
"print-rendering-intent-default",
"print-rendering-intent-supported",
+ "print-scaling", /* IPP Paid Printing */
+ "print-scaling-default", /* IPP Paid Printing */
+ "print-scaling-supported", /* IPP Paid Printing */
"printer-resolution",
"printer-resolution-default",
"printer-resolution-supported",
"printer-icons",
"printer-info",
"printer-is-accepting-jobs",
+ "printer-is-shared", /* CUPS extension */
+ "printer-kind", /* IPP Paid Printing */
"printer-location",
"printer-make-and-model",
"printer-mandatory-job-attributes",
"printer-more-info",
"printer-more-info-manufacturer",
"printer-name",
+ "printer-native-formats",
"printer-organization",
"printer-organizational-unit",
"printer-settable-attributes-supported",
"requesting-user-name-denied", /* CUPS extension */
"requesting-user-uri-supported",
"subordinate-printers-supported",
+ "urf-supported", /* CUPS extension */
"uri-authentication-supported",
"uri-security-supported",
"user-defined-value-supported",
!strcmp(attrname, "finishings-actual") ||
!strcmp(attrname, "finishings-default") ||
!strcmp(attrname, "finishings-ready") ||
- !strcmp(attrname, "finishings-supported"))
+ !strcmp(attrname, "finishings-supported") ||
+ !strcmp(attrname, "job-finishings") ||
+ !strcmp(attrname, "job-finishings-default") ||
+ !strcmp(attrname, "job-finishings-supported"))
{
if (enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_finishings) /
* ippGetGroupTag() - Get the group associated with an attribute.
* ippGetInteger() - Get the integer/enum value for an attribute.
* ippGetName() - Get the attribute name.
+ * ippGetOctetString() - Get an octetString value from an IPP attribute.
* ippGetOperation() - Get the operation ID in an IPP message.
* ippGetRange() - Get a rangeOfInteger value from an attribute.
* ippGetRequestId() - Get the request ID from an IPP message.
* ippSetGroupTag() - Set the group tag of an attribute.
* ippSetInteger() - Set an integer or enum value in an attribute.
* ippSetName() - Set the name of an attribute.
+ * ippSetOctetString() - Set an octetString value in an IPP attribute.
* ippSetOperation() - Set the operation ID in an IPP request message.
* ippSetRange() - Set a rangeOfInteger value in an attribute.
* ippSetRequestId() - Set the request ID in an IPP message.
}
+/*
+ * 'ippGetOctetString()' - Get an octetString value from an IPP attribute.
+ *
+ * The @code element@ parameter specifies which value to get from 0 to
+ * @link ippGetCount(attr)@ - 1.
+ *
+ * @since CUPS 1.7@
+ */
+
+void * /* O - Pointer to octetString data */
+ippGetOctetString(
+ ipp_attribute_t *attr, /* I - IPP attribute */
+ int element, /* I - Value number (0-based) */
+ int *datalen) /* O - Length of octetString data */
+{
+ /*
+ * Range check input...
+ */
+
+ if (!attr || attr->value_tag != IPP_TAG_STRING ||
+ element < 0 || element >= attr->num_values)
+ {
+ if (datalen)
+ *datalen = 0;
+
+ return (NULL);
+ }
+
+ /*
+ * Return the values...
+ */
+
+ if (datalen)
+ *datalen = attr->values[element].unknown.length;
+
+ return (attr->values[element].unknown.data);
+}
+
+
/*
* 'ippGetOperation()' - Get the operation ID in an IPP message.
*
*/
int /* O - 1 on success, 0 on failure */
-ippSetBoolean(ipp_t *ipp, /* IO - IPP message */
+ippSetBoolean(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
int boolvalue)/* I - Boolean value */
int /* O - 1 on success, 0 on failure */
ippSetCollection(
- ipp_t *ipp, /* IO - IPP message */
+ ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
ipp_t *colvalue) /* I - Collection value */
*/
int /* O - 1 on success, 0 on failure */
-ippSetDate(ipp_t *ipp, /* IO - IPP message */
+ippSetDate(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
const ipp_uchar_t *datevalue)/* I - Date value */
int /* O - 1 on success, 0 on failure */
ippSetGroupTag(
- ipp_t *ipp, /* IO - IPP message */
+ ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - Attribute */
ipp_tag_t group_tag) /* I - Group tag */
{
*/
int /* O - 1 on success, 0 on failure */
-ippSetInteger(ipp_t *ipp, /* IO - IPP message */
+ippSetInteger(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
int intvalue) /* I - Integer/enum value */
*/
int /* O - 1 on success, 0 on failure */
-ippSetName(ipp_t *ipp, /* IO - IPP message */
+ippSetName(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
const char *name) /* I - Attribute name */
{
}
+/*
+ * 'ippSetOctetString()' - Set an octetString value in an IPP attribute.
+ *
+ * The @code ipp@ parameter refers to an IPP message previously created using
+ * the @link ippNew@, @link ippNewRequest@, or @link ippNewResponse@ functions.
+ *
+ * The @code attr@ parameter may be modified as a result of setting the value.
+ *
+ * The @code element@ parameter specifies which value to set from 0 to
+ * @link ippGetCount(attr)@.
+ *
+ * @since CUPS 1.7@
+ */
+
+int /* O - 1 on success, 0 on failure */
+ippSetOctetString(
+ ipp_t *ipp, /* I - IPP message */
+ ipp_attribute_t **attr, /* IO - IPP attribute */
+ int element, /* I - Value number (0-based) */
+ const void *data, /* I - Pointer to octetString data */
+ int datalen) /* I - Length of octetString data */
+{
+ _ipp_value_t *value; /* Current value */
+
+
+ /*
+ * Range check input...
+ */
+
+ if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_STRING ||
+ element < 0 || element > (*attr)->num_values ||
+ datalen < 0 || datalen > IPP_MAX_LENGTH)
+ return (0);
+
+ /*
+ * Set the value and return...
+ */
+
+ if ((value = ipp_set_value(ipp, attr, element)) != NULL)
+ {
+ if ((int)((*attr)->value_tag) & IPP_TAG_CUPS_CONST)
+ {
+ /*
+ * Just copy the pointer...
+ */
+
+ value->unknown.data = (void *)data;
+ value->unknown.length = datalen;
+ }
+ else
+ {
+ /*
+ * Copy the data...
+ */
+
+ if (value->unknown.data)
+ {
+ /*
+ * Free previous data...
+ */
+
+ free(value->unknown.data);
+
+ value->unknown.data = NULL;
+ value->unknown.length = 0;
+ }
+
+ if (datalen > 0)
+ {
+ void *temp; /* Temporary data pointer */
+
+ if ((temp = malloc(datalen)) != NULL)
+ {
+ memcpy(temp, data, datalen);
+
+ value->unknown.data = temp;
+ value->unknown.length = datalen;
+ }
+ else
+ return (0);
+ }
+ }
+ }
+
+ return (value != NULL);
+}
+
+
/*
* 'ippSetOperation()' - Set the operation ID in an IPP request message.
*
*/
int /* O - 1 on success, 0 on failure */
-ippSetRange(ipp_t *ipp, /* IO - IPP message */
+ippSetRange(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
int lowervalue, /* I - Lower bound for range */
int /* O - 1 on success, 0 on failure */
ippSetResolution(
- ipp_t *ipp, /* IO - IPP message */
+ ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
ipp_res_t unitsvalue, /* I - Resolution units */
*/
int /* O - 1 on success, 0 on failure */
-ippSetString(ipp_t *ipp, /* IO - IPP message */
+ippSetString(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
const char *strvalue) /* I - String value */
*/
int /* O - 1 on success, 0 on failure */
-ippSetStringf(ipp_t *ipp, /* IO - IPP message */
+ippSetStringf(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
const char *format, /* I - Printf-style format string */
*/
int /* O - 1 on success, 0 on failure */
-ippSetStringfv(ipp_t *ipp, /* IO - IPP message */
+ippSetStringfv(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
const char *format, /* I - Printf-style format string */
int /* O - 1 on success, 0 on failure */
ippSetValueTag(
- ipp_t *ipp, /* IO - IPP message */
+ ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
ipp_tag_t value_tag) /* I - Value tag */
{
IPP_FINISHINGS_TRIM, /* Trim (any type) */
IPP_FINISHINGS_BALE, /* Bale (any type) */
IPP_FINISHINGS_BOOKLET_MAKER, /* Fold to make booklet */
- IPP_FINISHINGS_JOB_OFFSET, /* Offset for binding (any type) */
+ IPP_FINISHINGS_JOG_OFFSET, /* Offset for binding (any type) */
IPP_FINISHINGS_STAPLE_TOP_LEFT = 20, /* Staple top left corner */
IPP_FINISHINGS_STAPLE_BOTTOM_LEFT, /* Staple bottom left corner */
IPP_FINISHINGS_STAPLE_TOP_RIGHT, /* Staple top right corner */
IPP_FINISHINGS_CUPS_PUNCH_QUAD_LEFT, /* Punch 4 holes left side */
IPP_FINISHINGS_CUPS_PUNCH_QUAD_TOP, /* Punch 4 holes top edge */
IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side */
- IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM /* Punch 4 holes bottom edge */
+ IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM,/* Punch 4 holes bottom edge */
+
+ IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN = 0x4000005A,
+ /* Accordian-fold the paper vertically into four sections */
+ IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically */
+ IPP_FINISHINGS_CUPS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline */
+ IPP_FINISHINGS_CUPS_FOLD_HALF, /* Fold the paper in half vertically */
+ IPP_FINISHINGS_CUPS_FOLD_HALF_Z, /* Fold the paper in half horizontally, then Z-fold the paper vertically */
+ IPP_FINISHINGS_CUPS_FOLD_LEFT_GATE, /* Fold the top quarter of the paper towards the midline */
+ IPP_FINISHINGS_CUPS_FOLD_LETTER, /* Fold the paper into three sections vertically; sometimes also known as a C fold*/
+ IPP_FINISHINGS_CUPS_FOLD_PARALLEL, /* Fold the paper in half vertically two times, yielding four sections */
+ IPP_FINISHINGS_CUPS_FOLD_POSTER, /* Fold the paper in half horizontally and vertically; sometimes also called a cross fold */
+ IPP_FINISHINGS_CUPS_FOLD_RIGHT_GATE, /* Fold the bottom quarter of the paper towards the midline */
+ IPP_FINISHINGS_CUPS_FOLD_Z /* Fold the paper vertically into three sections, forming a Z */
} ipp_finishings_t;
# ifndef _CUPS_NO_DEPRECATED
+# define IPP_FINISHINGS_JOB_OFFSET IPP_FINISHINGS_JOG_OFFSET
+ /* Long-time misspelling... */
typedef enum ipp_finishings_e ipp_finish_t;
# endif /* !_CUPS_NO_DEPRECATED */
extern int ippContainsString(ipp_attribute_t *attr,
const char *value) _CUPS_API_1_7;
extern cups_array_t *ippCreateRequestedArray(ipp_t *request) _CUPS_API_1_7;
+extern void *ippGetOctetString(ipp_attribute_t *attr, int element,
+ int *datalen) _CUPS_API_1_7;
extern ipp_t *ippNewResponse(ipp_t *request) _CUPS_API_1_7;
+extern int ippSetOctetString(ipp_t *ipp, ipp_attribute_t **attr,
+ int element, const void *data,
+ int datalen) _CUPS_API_1_7;
extern int ippSetStringf(ipp_t *ipp, ipp_attribute_t **attr,
int element, const char *format,
...) _CUPS_API_1_7;
{
cups_file_t *fp; /* File */
_ppd_cache_t *pc; /* PWG mapping data */
- _pwg_size_t *size; /* Current size */
- _pwg_map_t *map; /* Current map */
+ pwg_size_t *size; /* Current size */
+ pwg_map_t *map; /* Current map */
_pwg_finishings_t *finishings; /* Current finishings option */
int linenum, /* Current line number */
num_bins, /* Number of bins in file */
goto create_error;
}
- if ((pc->bins = calloc(num_bins, sizeof(_pwg_map_t))) == NULL)
+ if ((pc->bins = calloc(num_bins, sizeof(pwg_map_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d bins.",
num_sizes));
if (num_sizes > 0)
{
- if ((pc->sizes = calloc(num_sizes, sizeof(_pwg_size_t))) == NULL)
+ if ((pc->sizes = calloc(num_sizes, sizeof(pwg_size_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d sizes.",
num_sizes));
goto create_error;
}
- _pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), "custom", "max",
- pc->custom_max_width, pc->custom_max_length);
+ pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "max",
+ pc->custom_max_width, pc->custom_max_length, NULL);
pc->custom_max_keyword = _cupsStrAlloc(pwg_keyword);
- _pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), "custom", "min",
- pc->custom_min_width, pc->custom_min_length);
+ pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "min",
+ pc->custom_min_width, pc->custom_min_length, NULL);
pc->custom_min_keyword = _cupsStrAlloc(pwg_keyword);
}
else if (!_cups_strcasecmp(line, "SourceOption"))
goto create_error;
}
- if ((pc->sources = calloc(num_sources, sizeof(_pwg_map_t))) == NULL)
+ if ((pc->sources = calloc(num_sources, sizeof(pwg_map_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d sources.",
num_sources));
goto create_error;
}
- if ((pc->types = calloc(num_types, sizeof(_pwg_map_t))) == NULL)
+ if ((pc->types = calloc(num_types, sizeof(pwg_map_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d types.",
num_types));
*color_model, /* ColorModel option */
*duplex; /* Duplex option */
ppd_choice_t *choice; /* Current InputSlot/MediaType */
- _pwg_map_t *map; /* Current source/type map */
+ pwg_map_t *map; /* Current source/type map */
ppd_attr_t *ppd_attr; /* Current PPD preset attribute */
int num_options; /* Number of preset options and props */
cups_option_t *options; /* Preset options and properties */
ppd_size_t *ppd_size; /* Current PPD size */
- _pwg_size_t *pwg_size; /* Current PWG size */
+ pwg_size_t *pwg_size; /* Current PWG size */
char pwg_keyword[3 + PPD_MAX_NAME + 1 + 12 + 1 + 12 + 3],
/* PWG keyword string */
ppd_name[PPD_MAX_NAME];
/* Normalized PPD name */
const char *pwg_name; /* Standard PWG media name */
- _pwg_media_t *pwg_media; /* PWG media data */
+ pwg_media_t *pwg_media; /* PWG media data */
_pwg_print_color_mode_t pwg_print_color_mode;
/* print-color-mode index */
_pwg_print_quality_t pwg_print_quality;
/* print-quality index */
int similar; /* Are the old and new size similar? */
- _pwg_size_t *old_size; /* Current old size */
+ pwg_size_t *old_size; /* Current old size */
int old_imageable, /* Old imageable length in 2540ths */
old_borderless, /* Old borderless state */
old_known_pwg; /* Old PWG name is well-known */
new_imageable, /* New imageable length in 2540ths */
new_borderless, /* New borderless state */
new_known_pwg; /* New PWG name is well-known */
- _pwg_size_t *new_size; /* New size to add, if any */
+ pwg_size_t *new_size; /* New size to add, if any */
const char *filter; /* Current filter */
_pwg_finishings_t *finishings; /* Current finishings value */
if (ppd->num_sizes > 0)
{
- if ((pc->sizes = calloc(ppd->num_sizes, sizeof(_pwg_size_t))) == NULL)
+ if ((pc->sizes = calloc(ppd->num_sizes, sizeof(pwg_size_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
- "_pwg_size_t's.", ppd->num_sizes));
+ "pwg_size_t's.", ppd->num_sizes));
goto create_error;
}
* Convert the PPD size name to the corresponding PWG keyword name.
*/
- if ((pwg_media = _pwgMediaForPPD(ppd_size->name)) != NULL)
+ if ((pwg_media = pwgMediaForPPD(ppd_size->name)) != NULL)
{
/*
* Standard name, do we have conflicts?
new_known_pwg = 0;
pwg_unppdize_name(ppd_size->name, ppd_name, sizeof(ppd_name), "_.");
- _pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), NULL, ppd_name,
- _PWG_FROMPTS(ppd_size->width),
- _PWG_FROMPTS(ppd_size->length));
+ pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), NULL, ppd_name,
+ PWG_FROM_POINTS(ppd_size->width),
+ PWG_FROM_POINTS(ppd_size->length), NULL);
}
/*
* dimensions that are <= 0...
*/
- if ((pwg_media = _pwgMediaForSize(_PWG_FROMPTS(ppd_size->width),
- _PWG_FROMPTS(ppd_size->length))) == NULL)
+ if ((pwg_media = pwgMediaForSize(PWG_FROM_POINTS(ppd_size->width),
+ PWG_FROM_POINTS(ppd_size->length))) == NULL)
continue;
new_width = pwg_media->width;
new_length = pwg_media->length;
- new_left = _PWG_FROMPTS(ppd_size->left);
- new_bottom = _PWG_FROMPTS(ppd_size->bottom);
- new_right = _PWG_FROMPTS(ppd_size->width - ppd_size->right);
- new_top = _PWG_FROMPTS(ppd_size->length - ppd_size->top);
+ new_left = PWG_FROM_POINTS(ppd_size->left);
+ new_bottom = PWG_FROM_POINTS(ppd_size->bottom);
+ new_right = PWG_FROM_POINTS(ppd_size->width - ppd_size->right);
+ new_top = PWG_FROM_POINTS(ppd_size->length - ppd_size->top);
new_imageable = new_length - new_top - new_bottom;
new_borderless = new_bottom == 0 && new_top == 0 &&
new_left == 0 && new_right == 0;
* Generate custom size data...
*/
- _pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), "custom", "max",
- _PWG_FROMPTS(ppd->custom_max[0]),
- _PWG_FROMPTS(ppd->custom_max[1]));
+ pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "max",
+ PWG_FROM_POINTS(ppd->custom_max[0]),
+ PWG_FROM_POINTS(ppd->custom_max[1]), NULL);
pc->custom_max_keyword = _cupsStrAlloc(pwg_keyword);
- pc->custom_max_width = _PWG_FROMPTS(ppd->custom_max[0]);
- pc->custom_max_length = _PWG_FROMPTS(ppd->custom_max[1]);
+ pc->custom_max_width = PWG_FROM_POINTS(ppd->custom_max[0]);
+ pc->custom_max_length = PWG_FROM_POINTS(ppd->custom_max[1]);
- _pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), "custom", "min",
- _PWG_FROMPTS(ppd->custom_min[0]),
- _PWG_FROMPTS(ppd->custom_min[1]));
+ pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "min",
+ PWG_FROM_POINTS(ppd->custom_min[0]),
+ PWG_FROM_POINTS(ppd->custom_min[1]), NULL);
pc->custom_min_keyword = _cupsStrAlloc(pwg_keyword);
- pc->custom_min_width = _PWG_FROMPTS(ppd->custom_min[0]);
- pc->custom_min_length = _PWG_FROMPTS(ppd->custom_min[1]);
+ pc->custom_min_width = PWG_FROM_POINTS(ppd->custom_min[0]);
+ pc->custom_min_length = PWG_FROM_POINTS(ppd->custom_min[1]);
- pc->custom_size.left = _PWG_FROMPTS(ppd->custom_margins[0]);
- pc->custom_size.bottom = _PWG_FROMPTS(ppd->custom_margins[1]);
- pc->custom_size.right = _PWG_FROMPTS(ppd->custom_margins[2]);
- pc->custom_size.top = _PWG_FROMPTS(ppd->custom_margins[3]);
+ pc->custom_size.left = PWG_FROM_POINTS(ppd->custom_margins[0]);
+ pc->custom_size.bottom = PWG_FROM_POINTS(ppd->custom_margins[1]);
+ pc->custom_size.right = PWG_FROM_POINTS(ppd->custom_margins[2]);
+ pc->custom_size.top = PWG_FROM_POINTS(ppd->custom_margins[3]);
}
/*
pc->source_option = _cupsStrAlloc(input_slot->keyword);
if ((pc->sources = calloc(input_slot->num_choices,
- sizeof(_pwg_map_t))) == NULL)
+ sizeof(pwg_map_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
- "_pwg_map_t's for InputSlot.", input_slot->num_choices));
+ "pwg_map_t's for InputSlot.", input_slot->num_choices));
goto create_error;
}
if ((media_type = ppdFindOption(ppd, "MediaType")) != NULL)
{
if ((pc->types = calloc(media_type->num_choices,
- sizeof(_pwg_map_t))) == NULL)
+ sizeof(pwg_map_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
- "_pwg_map_t's for MediaType.", media_type->num_choices));
+ "pwg_map_t's for MediaType.", media_type->num_choices));
goto create_error;
}
if ((output_bin = ppdFindOption(ppd, "OutputBin")) != NULL)
{
if ((pc->bins = calloc(output_bin->num_choices,
- sizeof(_pwg_map_t))) == NULL)
+ sizeof(pwg_map_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
- "_pwg_map_t's for OutputBin.", output_bin->num_choices));
+ "pwg_map_t's for OutputBin.", output_bin->num_choices));
goto create_error;
}
_ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
{
int i; /* Looping var */
- _pwg_map_t *map; /* Current map */
- _pwg_size_t *size; /* Current size */
+ pwg_map_t *map; /* Current map */
+ pwg_size_t *size; /* Current size */
/*
ipp_attribute_t *media_col, /* media-col attribute */
*media_source; /* media-source attribute */
- _pwg_size_t size; /* Dimensional size */
+ pwg_size_t size; /* Dimensional size */
int margins_set; /* Were the margins set? */
media_col = ippFindAttribute(job, "media-col", IPP_TAG_BEGIN_COLLECTION);
keyword = ippGetString(media_source, 0, NULL);
}
- else if (_pwgInitSize(&size, job, &margins_set))
+ else if (pwgInitSize(&size, job, &margins_set))
{
/*
* For media <= 5x7, look for a photo tray...
int *exact) /* O - 1 if exact match, 0 otherwise */
{
int i; /* Looping var */
- _pwg_size_t *size, /* Current size */
+ pwg_size_t *size, /* Current size */
*closest, /* Closest size */
jobsize; /* Size data from job */
int margins_set, /* Were the margins set? */
* media-col.
*/
- if (!_pwgInitSize(&jobsize, job, &margins_set))
+ if (!pwgInitSize(&jobsize, job, &margins_set))
return (NULL);
}
else
* Get the size using a media keyword...
*/
- _pwg_media_t *media; /* Media definition */
+ pwg_media_t *media; /* Media definition */
- if ((media = _pwgMediaForPWG(keyword)) == NULL)
- if ((media = _pwgMediaForLegacy(keyword)) == NULL)
- if ((media = _pwgMediaForPPD(keyword)) == NULL)
+ if ((media = pwgMediaForPWG(keyword)) == NULL)
+ if ((media = pwgMediaForLegacy(keyword)) == NULL)
+ if ((media = pwgMediaForPPD(keyword)) == NULL)
return (NULL);
jobsize.width = media->width;
*/
snprintf(pc->custom_ppd_size, sizeof(pc->custom_ppd_size), "Custom.%dx%d",
- (int)_PWG_TOPTS(jobsize.width), (int)_PWG_TOPTS(jobsize.length));
+ (int)PWG_TO_POINTS(jobsize.width), (int)PWG_TO_POINTS(jobsize.length));
if (margins_set && exact)
{
* '_ppdCacheGetSize()' - Get the PWG size associated with a PPD PageSize.
*/
-_pwg_size_t * /* O - PWG size or NULL */
+pwg_size_t * /* O - PWG size or NULL */
_ppdCacheGetSize(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
const char *page_size) /* I - PPD PageSize */
{
int i; /* Looping var */
- _pwg_media_t *media; /* Media */
- _pwg_size_t *size; /* Current size */
+ pwg_media_t *media; /* Media */
+ pwg_size_t *size; /* Current size */
/*
* Look up standard sizes...
*/
- if ((media = _pwgMediaForPPD(page_size)) == NULL)
- if ((media = _pwgMediaForLegacy(page_size)) == NULL)
- media = _pwgMediaForPWG(page_size);
+ if ((media = pwgMediaForPPD(page_size)) == NULL)
+ if ((media = pwgMediaForLegacy(page_size)) == NULL)
+ media = pwgMediaForPWG(page_size);
if (media)
{
const char *input_slot) /* I - PPD InputSlot */
{
int i; /* Looping var */
- _pwg_map_t *source; /* Current source */
+ pwg_map_t *source; /* Current source */
/*
const char *media_type) /* I - PPD MediaType */
{
int i; /* Looping var */
- _pwg_map_t *type; /* Current type */
+ pwg_map_t *type; /* Current type */
/*
{
int i, j, k; /* Looping vars */
cups_file_t *fp; /* Output file */
- _pwg_size_t *size; /* Current size */
- _pwg_map_t *map; /* Current map */
+ pwg_size_t *size; /* Current size */
+ pwg_map_t *map; /* Current map */
_pwg_finishings_t *f; /* Current finishing option */
cups_option_t *option; /* Current option */
const char *value; /* Filter/pre-filter value */
const char * /* O - PageSize name */
_pwgPageSizeForMedia(
- _pwg_media_t *media, /* I - Media */
+ pwg_media_t *media, /* I - Media */
char *name, /* I - PageSize name buffer */
size_t namesize) /* I - Size of name buffer */
{
* Use a name of the form "wNNNhNNN"...
*/
- snprintf(name, namesize, "w%dh%d", (int)_PWG_TOPTS(media->width),
- (int)_PWG_TOPTS(media->length));
+ snprintf(name, namesize, "w%dh%d", (int)PWG_TO_POINTS(media->width),
+ (int)PWG_TO_POINTS(media->length));
}
else
{
*
* Private PPD definitions for CUPS.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
{
int num_bins; /* Number of output bins */
- _pwg_map_t *bins; /* Output bins */
+ pwg_map_t *bins; /* Output bins */
int num_sizes; /* Number of media sizes */
- _pwg_size_t *sizes; /* Media sizes */
+ pwg_size_t *sizes; /* Media sizes */
int custom_max_width, /* Maximum custom width in 2540ths */
custom_max_length, /* Maximum custom length in 2540ths */
custom_min_width, /* Minimum custom width in 2540ths */
char *custom_max_keyword, /* Maximum custom size PWG keyword */
*custom_min_keyword, /* Minimum custom size PWG keyword */
custom_ppd_size[41]; /* Custom PPD size name */
- _pwg_size_t custom_size; /* Custom size record */
+ pwg_size_t custom_size; /* Custom size record */
char *source_option; /* PPD option for media source */
int num_sources; /* Number of media sources */
- _pwg_map_t *sources; /* Media sources */
+ pwg_map_t *sources; /* Media sources */
int num_types; /* Number of media types */
- _pwg_map_t *types; /* Media types */
+ pwg_map_t *types; /* Media types */
int num_presets[_PWG_PRINT_COLOR_MODE_MAX][_PWG_PRINT_QUALITY_MAX];
/* Number of print-color-mode/print-quality options */
cups_option_t *presets[_PWG_PRINT_COLOR_MODE_MAX][_PWG_PRINT_QUALITY_MAX];
const char *keyword);
extern const char *_ppdCacheGetPageSize(_ppd_cache_t *pc, ipp_t *job,
const char *keyword, int *exact);
-extern _pwg_size_t *_ppdCacheGetSize(_ppd_cache_t *pc,
+extern pwg_size_t *_ppdCacheGetSize(_ppd_cache_t *pc,
const char *page_size);
extern const char *_ppdCacheGetSource(_ppd_cache_t *pc,
const char *input_slot);
char *name, size_t namesize);
extern const char *_pwgMediaTypeForType(const char *media_type,
char *name, size_t namesize);
-extern const char *_pwgPageSizeForMedia(_pwg_media_t *media,
+extern const char *_pwgPageSizeForMedia(pwg_media_t *media,
char *name, size_t namesize);
*
* PWG media name API implementation for CUPS.
*
- * Copyright 2009-2012 by Apple Inc.
+ * Copyright 2009-2013 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
*
* Contents:
*
- * _pwgFormatInches() - Convert and format PWG units as inches.
- * _pwgFormatMillimeters() - Convert and format PWG units as millimeters.
- * _pwgGenerateSize() - Generate a PWG size keyword.
- * _pwgInitSize() - Initialize a PWG size using IPP job template
- * attributes.
- * _pwgMediaForLegacy() - Find a PWG media size by ISO/IPP legacy name.
- * _pwgMediaForPPD() - Find a PWG media size by Adobe PPD name.
- * _pwgMediaForPWG() - Find a PWG media size by 5101.1 self-describing
- * name.
- * _pwgMediaForSize() - Get the PWG media name for a given size.
- * pwg_compare_legacy() - Compare two sizes using the legacy names.
- * pwg_compare_ppd() - Compare two sizes using the PPD names.
- * pwg_compare_pwg() - Compare two sizes using the PWG names.
+ * pwgFormatSizeName() - Generate a PWG self-describing media size name.
+ * pwgInitSize() - Initialize a pwg_size_t structure using IPP Job
+ * Template attributes.
+ * pwgMediaForLegacy() - Find a PWG media size by ISO/IPP legacy name.
+ * pwgMediaForPPD() - Find a PWG media size by Adobe PPD name.
+ * pwgMediaForPWG() - Find a PWG media size by 5101.1 self-describing
+ * name.
+ * pwgMediaForSize() - Get the PWG media size for the given
+ * dimensions.
+ * pwg_compare_legacy() - Compare two sizes using the legacy names.
+ * pwg_compare_ppd() - Compare two sizes using the PPD names.
+ * pwg_compare_pwg() - Compare two sizes using the PWG names.
+ * pwg_format_inches() - Convert and format PWG units as inches.
+ * pwg_format_millimeters() - Convert and format PWG units as millimeters.
*/
/*
* Local functions...
*/
-static int pwg_compare_legacy(_pwg_media_t *a, _pwg_media_t *b);
-static int pwg_compare_pwg(_pwg_media_t *a, _pwg_media_t *b);
-static int pwg_compare_ppd(_pwg_media_t *a, _pwg_media_t *b);
+static int pwg_compare_legacy(pwg_media_t *a, pwg_media_t *b);
+static int pwg_compare_pwg(pwg_media_t *a, pwg_media_t *b);
+static int pwg_compare_ppd(pwg_media_t *a, pwg_media_t *b);
+static char *pwg_format_inches(char *buf, size_t bufsize, int val);
+static char *pwg_format_millimeters(char *buf, size_t bufsize, int val);
/*
* Local globals...
*/
-static _pwg_media_t const cups_pwg_media[] =
+static pwg_media_t const cups_pwg_media[] =
{ /* Media size lookup table */
/* North American Standard Sheet Media Sizes */
_PWG_MEDIA_IN("na_index-3x5_3x5in", NULL, "3x5", 3, 5),
/*
- * '_pwgFormatInches()' - Convert and format PWG units as inches.
+ * 'pwgFormatSizeName()' - Generate a PWG self-describing media size name.
+ *
+ * This function generates a PWG self-describing media size name of the form
+ * "prefix_name_WIDTHxLENGTHunits". The prefix is typically "custom" or "roll"
+ * for user-supplied sizes but can also be "disc", "iso", "jis", "jpn", "na",
+ * "oe", "om", "prc", or "roc". A value of @code NULL@ automatically chooses
+ * "oe" or "om" depending on the units.
+ *
+ * The size name may only contain lowercase letters, numbers, "-", and ".". If
+ * @code NULL@ is passed, the size name will contain the formatted dimensions.
+ *
+ * The width and length are specified in hundredths of millimeters, equivalent
+ * to 1/100000th of a meter or 1/2540th of an inch. The width, length, and
+ * units used for the generated size name are calculated automatically if the
+ * units string is @code NULL@, otherwise inches ("in") or millimeters ("mm")
+ * are used.
+ *
+ * @since CUPS 1.7@
*/
-char * /* O - String */
-_pwgFormatInches(char *buf, /* I - Buffer */
- size_t bufsize, /* I - Size of buffer */
- int val) /* I - Value in hundredths of millimeters */
+int /* O - 1 on success, 0 on failure */
+pwgFormatSizeName(char *keyword, /* I - Keyword buffer */
+ size_t keysize, /* I - Size of keyword buffer */
+ const char *prefix, /* I - Prefix for PWG size or @code NULL@ for automatic */
+ const char *name, /* I - Size name or @code NULL@ */
+ int width, /* I - Width of page in 2540ths */
+ int length, /* I - Length of page in 2540ths */
+ const char *units) /* I - Units - "in", "mm", or @code NULL@ for automatic */
{
- int thousandths, /* Thousandths of inches */
- integer, /* Integer portion */
- fraction; /* Fractional portion */
+ char usize[12 + 1 + 12 + 3], /* Unit size: NNNNNNNNNNNNxNNNNNNNNNNNNuu */
+ *uptr; /* Pointer into unit size */
+ char *(*format)(char *, size_t, int);
+ /* Formatting function */
/*
- * Convert hundredths of millimeters to thousandths of inches and round to
- * the nearest thousandth.
+ * Range check input...
*/
- thousandths = (val * 1000 + 1270) / 2540;
- integer = thousandths / 1000;
- fraction = thousandths % 1000;
+ DEBUG_printf(("pwgFormatSize(keyword=%p, keysize=" CUPS_LLFMT
+ ", prefix=\"%s\", name=\"%s\", width=%d, length=%d, "
+ "units=\"%s\")", keyword, CUPS_LLCAST keysize, prefix, name,
+ width, length, units));
- /*
- * Format as a pair of integers (avoids locale stuff), avoiding trailing
- * zeros...
- */
+ if (keyword)
+ *keyword = '\0';
- if (fraction == 0)
- snprintf(buf, bufsize, "%d", integer);
- else if (fraction % 10)
- snprintf(buf, bufsize, "%d.%03d", integer, fraction);
- else if (fraction % 100)
- snprintf(buf, bufsize, "%d.%02d", integer, fraction / 10);
- else
- snprintf(buf, bufsize, "%d.%01d", integer, fraction / 100);
-
- return (buf);
-}
-
-
-/*
- * '_pwgFormatMillimeters()' - Convert and format PWG units as millimeters.
- */
-
-char * /* O - String */
-_pwgFormatMillimeters(char *buf, /* I - Buffer */
- size_t bufsize, /* I - Size of buffer */
- int val) /* I - Value in hundredths of millimeters */
-{
- int integer, /* Integer portion */
- fraction; /* Fractional portion */
-
-
- /*
- * Convert hundredths of millimeters to integer and fractional portions.
- */
+ if (!keyword || keysize < 32 || width < 0 || length < 0 ||
+ (units && strcmp(units, "in") && strcmp(units, "mm")))
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid media name arguments."),
+ 1);
+ return (0);
+ }
- integer = val / 100;
- fraction = val % 100;
+ if (name)
+ {
+ /*
+ * Validate name...
+ */
- /*
- * Format as a pair of integers (avoids locale stuff), avoiding trailing
- * zeros...
- */
+ const char *nameptr; /* Pointer into name */
- if (fraction == 0)
- snprintf(buf, bufsize, "%d", integer);
- else if (fraction % 10)
- snprintf(buf, bufsize, "%d.%02d", integer, fraction);
+ for (nameptr = name; *nameptr; nameptr ++)
+ if (!(*nameptr >= 'a' && *nameptr <= 'z') &&
+ !(*nameptr >= '0' && *nameptr <= '9') &&
+ *nameptr != '.' && *nameptr != '-')
+ {
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
+ _("Invalid media name arguments."), 1);
+ return (0);
+ }
+ }
else
- snprintf(buf, bufsize, "%d.%01d", integer, fraction / 10);
-
- return (buf);
-}
+ name = usize;
-/*
- * '_pwgGenerateSize()' - Generate a PWG size keyword.
- */
+ if (!units)
+ {
+ if ((width % 635) == 0 && (length % 635) == 0)
+ {
+ /*
+ * Use inches since the size is a multiple of 1/4 inch.
+ */
-void
-_pwgGenerateSize(char *keyword, /* I - Keyword buffer */
- size_t keysize, /* I - Size of keyword buffer */
- const char *prefix, /* I - Prefix for PWG size or NULL */
- const char *name, /* I - Size name or NULL */
- int width, /* I - Width of page in 2540ths */
- int length) /* I - Length of page in 2540ths */
-{
- const char *units; /* Units to report */
- char usize[12 + 1 + 12 + 3], /* Unit size: NNNNNNNNNNNNxNNNNNNNNNNNNuu */
- *uptr; /* Pointer into unit size */
- char *(*format)(char *, size_t, int);
- /* Formatting function */
+ units = "in";
+ }
+ else
+ {
+ /*
+ * Use millimeters since the size is not a multiple of 1/4 inch.
+ */
+ units = "mm";
+ }
+ }
- if ((width % 635) == 0 && (length % 635) == 0)
+ if (!strcmp(units, "in"))
{
- /*
- * Use inches since the size is a multiple of 1/4 inch.
- */
-
- units = "in";
- format = _pwgFormatInches;
+ format = pwg_format_inches;
if (!prefix)
prefix = "oe";
}
else
{
- /*
- * Use millimeters since the size is not a multiple of 1/4 inch.
- */
-
- units = "mm";
- format = _pwgFormatMillimeters;
+ format = pwg_format_millimeters;
if (!prefix)
prefix = "om";
}
+ /*
+ * Format the size string...
+ */
+
uptr = usize;
(*format)(uptr, sizeof(usize) - (uptr - usize), width);
uptr += strlen(uptr);
memcpy(uptr, units, 3);
- if (!name)
- name = usize;
-
/*
* Format the name...
*/
snprintf(keyword, keysize, "%s_%s_%s", prefix, name, usize);
+
+ return (1);
}
+/* For OS X 10.8 and earlier... */
+void _pwgGenerateSize(char *keyword, size_t keysize, const char *prefix,
+ const char *name, int width, int length)
+{ pwgFormatSizeName(keyword, keysize, prefix, name, width, length, NULL); }
+
/*
- * '_pwgInitSize()' - Initialize a PWG size using IPP job template attributes.
+ * 'pwgInitSize()' - Initialize a pwg_size_t structure using IPP Job Template
+ * attributes.
+ *
+ * This function initializes a pwg_size_t structure from an IPP "media" or
+ * "media-col" attribute in the specified IPP message. 0 is returned if neither
+ * attribute is found in the message or the values are not valid.
+ *
+ * The "margins_set" variable is initialized to 1 if any "media-xxx-margin"
+ * member attribute was specified in the "media-col" Job Template attribute,
+ * otherwise it is initialized to 0.
+ *
+ * @since CUPS 1.7@
*/
-int /* O - 1 if size was initialize, 0 otherwise */
-_pwgInitSize(_pwg_size_t *size, /* I - Size to initialize */
- ipp_t *job, /* I - Job template attributes */
- int *margins_set) /* O - 1 if margins were set, 0 otherwise */
+int /* O - 1 if size was initialized, 0 otherwise */
+pwgInitSize(pwg_size_t *size, /* I - Size to initialize */
+ ipp_t *job, /* I - Job template attributes */
+ int *margins_set) /* O - 1 if margins were set, 0 otherwise */
{
ipp_attribute_t *media, /* media attribute */
*media_bottom_margin, /* media-bottom-margin member attribute */
*media_top_margin, /* media-top-margin member attribute */
*x_dimension, /* x-dimension member attribute */
*y_dimension; /* y-dimension member attribute */
- _pwg_media_t *pwg; /* PWG media value */
+ pwg_media_t *pwg; /* PWG media value */
/*
* Look for media-col and then media...
*/
- memset(size, 0, sizeof(_pwg_size_t));
+ memset(size, 0, sizeof(pwg_size_t));
*margins_set = 0;
if ((media_col = ippFindAttribute(job, "media-col",
const char *name = media->values[0].string.text;
/* Name string */
- if ((pwg = _pwgMediaForPWG(name)) == NULL)
+ if ((pwg = pwgMediaForPWG(name)) == NULL)
{
/*
* Not a PWG name, try a legacy name...
*/
- if ((pwg = _pwgMediaForLegacy(name)) == NULL)
+ if ((pwg = pwgMediaForLegacy(name)) == NULL)
{
/*
* Not a legacy name, try a PPD name...
const char *suffix; /* Suffix on media string */
- pwg = _pwgMediaForPPD(name);
+ pwg = pwgMediaForPPD(name);
if (pwg &&
(suffix = name + strlen(name) - 10 /* .FullBleed */) > name &&
!_cups_strcasecmp(suffix, ".FullBleed"))
return (1);
}
+/* For OS X 10.8 and earlier */
+int _pwgInitSize(pwg_size_t *size, ipp_t *job, int *margins_set)
+{ return (pwgInitSize(size, job, margins_set)); }
+
/*
- * '_pwgMediaForLegacy()' - Find a PWG media size by ISO/IPP legacy name.
+ * 'pwgMediaForLegacy()' - Find a PWG media size by ISO/IPP legacy name.
+ *
+ * The "name" argument specifies the legacy ISO media size name, for example
+ * "iso-a4" or "na-letter".
+ *
+ * @since CUPS 1.7@
*/
-_pwg_media_t * /* O - Matching size or NULL */
-_pwgMediaForLegacy(
- const char *legacy) /* I - Legacy size name */
+pwg_media_t * /* O - Matching size or NULL */
+pwgMediaForLegacy(const char *legacy) /* I - Legacy size name */
{
- _pwg_media_t key; /* Search key */
+ pwg_media_t key; /* Search key */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
if (!cg->leg_size_lut)
{
int i; /* Looping var */
- _pwg_media_t *size; /* Current size */
+ pwg_media_t *size; /* Current size */
cg->leg_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_legacy,
NULL);
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
- size = (_pwg_media_t *)cups_pwg_media;
+ size = (pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
if (size->legacy)
*/
key.legacy = legacy;
- return ((_pwg_media_t *)cupsArrayFind(cg->leg_size_lut, &key));
+ return ((pwg_media_t *)cupsArrayFind(cg->leg_size_lut, &key));
}
+/* For OS X 10.8 and earlier */
+pwg_media_t *_pwgMediaForLegacy(const char *legacy)
+{ return (pwgMediaForLegacy(legacy)); }
+
/*
- * '_pwgMediaForPPD()' - Find a PWG media size by Adobe PPD name.
+ * 'pwgMediaForPPD()' - Find a PWG media size by Adobe PPD name.
+ *
+ * The "ppd" argument specifies an Adobe page size name as defined in Table B.1
+ * of the Adobe PostScript Printer Description File Format Specification Version
+ * 4.3.
+ *
+ * If the name is non-standard, the returned PWG media size is stored in
+ * thread-local storage and is overwritten by each call to the function in the
+ * thread. Custom names can be of the form "Custom.WIDTHxLENGTH[units]" or
+ * "WIDTHxLENGTH[units]".
+ *
+ * @since CUPS 1.7@
*/
-_pwg_media_t * /* O - Matching size or NULL */
-_pwgMediaForPPD(const char *ppd) /* I - PPD size name */
+pwg_media_t * /* O - Matching size or NULL */
+pwgMediaForPPD(const char *ppd) /* I - PPD size name */
{
- _pwg_media_t key, /* Search key */
+ pwg_media_t key, /* Search key */
*size; /* Matching size */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
cg->ppd_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_ppd, NULL);
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
- size = (_pwg_media_t *)cups_pwg_media;
+ size = (pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
if (size->ppd)
*/
key.ppd = ppd;
- if ((size = (_pwg_media_t *)cupsArrayFind(cg->ppd_size_lut, &key)) == NULL)
+ if ((size = (pwg_media_t *)cupsArrayFind(cg->ppd_size_lut, &key)) == NULL)
{
/*
* See if the name is of the form:
size->length = (int)(l * factor);
size->pwg = cg->pwg_name;
- _pwgGenerateSize(cg->pwg_name, sizeof(cg->pwg_name),
- custom ? "custom" : NULL, custom ? ppd + 7 : NULL,
- size->width, size->length);
+ pwgFormatSizeName(cg->pwg_name, sizeof(cg->pwg_name),
+ custom ? "custom" : NULL, custom ? ppd + 7 : NULL,
+ size->width, size->length, NULL);
}
}
}
return (size);
}
+/* For OS X 10.8 and earlier */
+pwg_media_t *_pwgMediaForPPD(const char *ppd)
+{ return (pwgMediaForPPD(ppd)); }
+
/*
- * '_pwgMediaForPWG()' - Find a PWG media size by 5101.1 self-describing name.
+ * 'pwgMediaForPWG()' - Find a PWG media size by 5101.1 self-describing name.
+ *
+ * The "pwg" argument specifies a self-describing media size name of the form
+ * "prefix_name_WIDTHxLENGTHunits" as defined in PWG 5101.1.
+ *
+ * If the name is non-standard, the returned PWG media size is stored in
+ * thread-local storage and is overwritten by each call to the function in the
+ * thread.
+ *
+ * @since CUPS 1.7@
*/
-_pwg_media_t * /* O - Matching size or NULL */
-_pwgMediaForPWG(const char *pwg) /* I - PWG size name */
+pwg_media_t * /* O - Matching size or NULL */
+pwgMediaForPWG(const char *pwg) /* I - PWG size name */
{
char *ptr; /* Pointer into name */
- _pwg_media_t key, /* Search key */
+ pwg_media_t key, /* Search key */
*size; /* Matching size */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
cg->pwg_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_pwg, NULL);
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
- size = (_pwg_media_t *)cups_pwg_media;
+ size = (pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
cupsArrayAdd(cg->pwg_size_lut, size);
*/
key.pwg = pwg;
- if ((size = (_pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key)) == NULL &&
+ if ((size = (pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key)) == NULL &&
(ptr = (char *)strchr(pwg, '_')) != NULL &&
(ptr = (char *)strchr(ptr + 1, '_')) != NULL)
{
return (size);
}
+/* For OS X 10.8 and earlier */
+pwg_media_t *_pwgMediaForPWG(const char *pwg)
+{ return (pwgMediaForPWG(pwg)); }
+
/*
- * '_pwgMediaForSize()' - Get the PWG media name for a given size.
+ * 'pwgMediaForSize()' - Get the PWG media size for the given dimensions.
+ *
+ * The "width" and "length" are in hundredths of millimeters, equivalent to
+ * 1/100000th of a meter or 1/2540th of an inch.
+ *
+ * If the dimensions are non-standard, the returned PWG media size is stored in
+ * thread-local storage and is overwritten by each call to the function in the
+ * thread.
+ *
+ * @since CUPS 1.7@
*/
-_pwg_media_t * /* O - PWG media name */
-_pwgMediaForSize(int width, /* I - Width in 2540ths */
- int length) /* I - Length in 2540ths */
+pwg_media_t * /* O - PWG media name */
+pwgMediaForSize(int width, /* I - Width in hundredths of millimeters */
+ int length) /* I - Length in hundredths of millimeters */
{
int i; /* Looping var */
- _pwg_media_t *media, /* Current media */
+ pwg_media_t *media, /* Current media */
*best_media = NULL; /* Best match */
int dw, dl, /* Difference in width and length */
best_dw = 999, /* Best difference in width and length */
*/
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
- media = (_pwg_media_t *)cups_pwg_media;
+ media = (pwg_media_t *)cups_pwg_media;
i > 0;
i --, media ++)
{
* custom_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu
*/
- _pwgGenerateSize(cg->pwg_name, sizeof(cg->pwg_name), "custom", NULL, width,
- length);
+ pwgFormatSizeName(cg->pwg_name, sizeof(cg->pwg_name), "custom", NULL, width,
+ length, NULL);
cg->pwg_media.pwg = cg->pwg_name;
cg->pwg_media.width = width;
return (&(cg->pwg_media));
}
+/* For OS X 10.8 and earlier */
+pwg_media_t *_pwgMediaForSize(int width, int length)
+{ return (pwgMediaForSize(width, length)); }
+
/*
* 'pwg_compare_legacy()' - Compare two sizes using the legacy names.
*/
static int /* O - Result of comparison */
-pwg_compare_legacy(_pwg_media_t *a, /* I - First size */
- _pwg_media_t *b) /* I - Second size */
+pwg_compare_legacy(pwg_media_t *a, /* I - First size */
+ pwg_media_t *b) /* I - Second size */
{
return (strcmp(a->legacy, b->legacy));
}
*/
static int /* O - Result of comparison */
-pwg_compare_ppd(_pwg_media_t *a, /* I - First size */
- _pwg_media_t *b) /* I - Second size */
+pwg_compare_ppd(pwg_media_t *a, /* I - First size */
+ pwg_media_t *b) /* I - Second size */
{
return (strcmp(a->ppd, b->ppd));
}
*/
static int /* O - Result of comparison */
-pwg_compare_pwg(_pwg_media_t *a, /* I - First size */
- _pwg_media_t *b) /* I - Second size */
+pwg_compare_pwg(pwg_media_t *a, /* I - First size */
+ pwg_media_t *b) /* I - Second size */
{
return (strcmp(a->pwg, b->pwg));
}
+/*
+ * 'pwg_format_inches()' - Convert and format PWG units as inches.
+ */
+
+static char * /* O - String */
+pwg_format_inches(char *buf, /* I - Buffer */
+ size_t bufsize, /* I - Size of buffer */
+ int val) /* I - Value in hundredths of millimeters */
+{
+ int thousandths, /* Thousandths of inches */
+ integer, /* Integer portion */
+ fraction; /* Fractional portion */
+
+
+ /*
+ * Convert hundredths of millimeters to thousandths of inches and round to
+ * the nearest thousandth.
+ */
+
+ thousandths = (val * 1000 + 1270) / 2540;
+ integer = thousandths / 1000;
+ fraction = thousandths % 1000;
+
+ /*
+ * Format as a pair of integers (avoids locale stuff), avoiding trailing
+ * zeros...
+ */
+
+ if (fraction == 0)
+ snprintf(buf, bufsize, "%d", integer);
+ else if (fraction % 10)
+ snprintf(buf, bufsize, "%d.%03d", integer, fraction);
+ else if (fraction % 100)
+ snprintf(buf, bufsize, "%d.%02d", integer, fraction / 10);
+ else
+ snprintf(buf, bufsize, "%d.%01d", integer, fraction / 100);
+
+ return (buf);
+}
+
+
+/*
+ * 'pwg_format_millimeters()' - Convert and format PWG units as millimeters.
+ */
+
+static char * /* O - String */
+pwg_format_millimeters(char *buf, /* I - Buffer */
+ size_t bufsize, /* I - Size of buffer */
+ int val) /* I - Value in hundredths of millimeters */
+{
+ int integer, /* Integer portion */
+ fraction; /* Fractional portion */
+
+
+ /*
+ * Convert hundredths of millimeters to integer and fractional portions.
+ */
+
+ integer = val / 100;
+ fraction = val % 100;
+
+ /*
+ * Format as a pair of integers (avoids locale stuff), avoiding trailing
+ * zeros...
+ */
+
+ if (fraction == 0)
+ snprintf(buf, bufsize, "%d", integer);
+ else if (fraction % 10)
+ snprintf(buf, bufsize, "%d.%02d", integer, fraction);
+ else
+ snprintf(buf, bufsize, "%d.%01d", integer, fraction / 10);
+
+ return (buf);
+}
+
+
/*
* End of "$Id$".
*/
*
* Private PWG media API definitions for CUPS.
*
- * Copyright 2009-2012 by Apple Inc.
+ * Copyright 2009-2013 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
/*
- * Macros...
+ * Deprecated stuff for prior users of the private PWG media API...
*/
-/* Convert from points to 2540ths */
-# define _PWG_FROMPTS(n) (int)(((n) * 2540 + 36) / 72)
-/* Convert from 2540ths to points */
-# define _PWG_TOPTS(n) ((n) * 72.0 / 2540.0)
-
-
-/*
- * Types and structures...
- */
-
-typedef struct _pwg_map_s /**** Map element - PPD to/from PWG */
-{
- char *pwg, /* PWG media keyword */
- *ppd; /* PPD option keyword */
-} _pwg_map_t;
-
-typedef struct _pwg_media_s /**** Common media size data ****/
-{
- const char *pwg, /* PWG 5101.1 "self describing" name */
- *legacy, /* IPP/ISO legacy name */
- *ppd; /* Standard Adobe PPD name */
- int width, /* Width in 2540ths */
- length; /* Length in 2540ths */
-} _pwg_media_t;
-
-typedef struct _pwg_size_s /**** Size element - PPD to/from PWG */
-{
- _pwg_map_t map; /* Map element */
- int width, /* Width in 2540ths */
- length, /* Length in 2540ths */
- left, /* Left margin in 2540ths */
- bottom, /* Bottom margin in 2540ths */
- right, /* Right margin in 2540ths */
- top; /* Top margin in 2540ths */
-} _pwg_size_t;
+# ifndef _CUPS_NO_DEPRECATED
+typedef struct pwg_map_s _pwg_map_t;
+typedef struct pwg_media_s _pwg_media_t;
+typedef struct pwg_size_s _pwg_size_t;
+# endif /* _CUPS_NO_DEPRECATED */
/*
* Functions...
*/
-extern char *_pwgFormatInches(char *buf, size_t bufsize, int val);
-extern char *_pwgFormatMillimeters(char *buf, size_t bufsize,
- int val);
extern void _pwgGenerateSize(char *keyword, size_t keysize,
const char *prefix,
const char *name,
- int width, int length);
-extern int _pwgInitSize(_pwg_size_t *size, ipp_t *job,
- int *margins_set);
-extern _pwg_media_t *_pwgMediaForLegacy(const char *legacy);
-extern _pwg_media_t *_pwgMediaForPPD(const char *ppd);
-extern _pwg_media_t *_pwgMediaForPWG(const char *pwg);
-extern _pwg_media_t *_pwgMediaForSize(int width, int length);
+ int width, int length)
+ _CUPS_INTERNAL_MSG("Use pwgFormatSizeName instead.");
+extern int _pwgInitSize(pwg_size_t *size, ipp_t *job,
+ int *margins_set)
+ _CUPS_INTERNAL_MSG("Use pwgInitSize instead.");
+extern pwg_media_t *_pwgMediaForLegacy(const char *legacy)
+ _CUPS_INTERNAL_MSG("Use pwgMediaForLegacy instead.");
+extern pwg_media_t *_pwgMediaForPPD(const char *ppd)
+ _CUPS_INTERNAL_MSG("Use pwgMediaForPPD instead.");
+extern pwg_media_t *_pwgMediaForPWG(const char *pwg)
+ _CUPS_INTERNAL_MSG("Use pwgMediaForPWG instead.");
+extern pwg_media_t *_pwgMediaForSize(int width, int length)
+ _CUPS_INTERNAL_MSG("Use pwgMediaForSize instead.");
# ifdef __cplusplus
}
--- /dev/null
+/*
+ * "$Id$"
+ *
+ * PWG media API definitions for CUPS.
+ *
+ * Copyright 2009-2013 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/".
+ *
+ * This file is subject to the Apple OS-Developed Software exception.
+ */
+
+#ifndef _CUPS_PWG_H_
+# define _CUPS_PWG_H_
+
+
+/*
+ * C++ magic...
+ */
+
+# ifdef __cplusplus
+extern "C" {
+# endif /* __cplusplus */
+
+
+/*
+ * Macros...
+ */
+
+/* Convert from points to hundredths of millimeters */
+# define PWG_FROM_POINTS(n) (int)(((n) * 2540 + 36) / 72)
+/* Convert from hundredths of millimeters to points */
+# define PWG_TO_POINTS(n) ((n) * 72.0 / 2540.0)
+
+
+/*
+ * Types and structures...
+ */
+
+typedef struct pwg_map_s /**** Map element - PPD to/from PWG */
+{
+ char *pwg, /* PWG media keyword */
+ *ppd; /* PPD option keyword */
+} pwg_map_t;
+
+typedef struct pwg_media_s /**** Common media size data ****/
+{
+ const char *pwg, /* PWG 5101.1 "self describing" name */
+ *legacy, /* IPP/ISO legacy name */
+ *ppd; /* Standard Adobe PPD name */
+ int width, /* Width in 2540ths */
+ length; /* Length in 2540ths */
+} pwg_media_t;
+
+typedef struct pwg_size_s /**** Size element - PPD to/from PWG */
+{
+ pwg_map_t map; /* Map element */
+ int width, /* Width in 2540ths */
+ length, /* Length in 2540ths */
+ left, /* Left margin in 2540ths */
+ bottom, /* Bottom margin in 2540ths */
+ right, /* Right margin in 2540ths */
+ top; /* Top margin in 2540ths */
+} pwg_size_t;
+
+
+/*
+ * Functions...
+ */
+
+extern int pwgFormatSizeName(char *keyword, size_t keysize,
+ const char *prefix, const char *name,
+ int width, int length,
+ const char *units) _CUPS_API_1_7;
+extern int pwgInitSize(pwg_size_t *size, ipp_t *job,
+ int *margins_set) _CUPS_API_1_7;
+extern pwg_media_t *pwgMediaForLegacy(const char *legacy) _CUPS_API_1_7;
+extern pwg_media_t *pwgMediaForPPD(const char *ppd) _CUPS_API_1_7;
+extern pwg_media_t *pwgMediaForPWG(const char *pwg) _CUPS_API_1_7;
+extern pwg_media_t *pwgMediaForSize(int width, int length) _CUPS_API_1_7;
+
+# ifdef __cplusplus
+}
+# endif /* __cplusplus */
+
+#endif /* !_CUPS_PWG_H_ */
+
+/*
+ * End of "$Id$".
+ */
if (!http)
http = _cupsConnect();
- if (!http || (http->state != HTTP_STATE_POST_RECV && http->state != HTTP_STATE_POST_SEND))
+ if (!http || (http->state != HTTP_STATE_POST_RECV &&
+ http->state != HTTP_STATE_POST_SEND))
return (NULL);
/*
"http", "", "", "", 80, 0 },
{ HTTP_URI_STATUS_BAD_HOSTNAME, "http://serve%7/index.html",
"http", "", "", "", 80, 0 },
+ { HTTP_URI_STATUS_BAD_HOSTNAME, "http://server with spaces/index.html",
+ "http", "", "", "", 80, 0 },
/* Bad port number */
{ HTTP_URI_STATUS_BAD_PORT, "http://127.0.0.1:9999a/index.html",
/* Bad resource */
{ HTTP_URI_STATUS_BAD_RESOURCE, "http://server/index.html%",
+ "http", "", "server", "", 80, 0 },
+ { HTTP_URI_STATUS_BAD_RESOURCE, "http://server/index with spaces.html",
"http", "", "server", "", 80, 0 }
};
static const char * const base64_tests[][2] =
*
* PWG test program for CUPS.
*
- * Copyright 2009-2012 by Apple Inc.
+ * Copyright 2009-2013 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
const char *ppdfile; /* PPD filename */
ppd_file_t *ppd; /* PPD file */
_ppd_cache_t *pc; /* PPD cache and PWG mapping data */
- _pwg_media_t *pwgmedia; /* PWG media size */
+ pwg_media_t *pwgmedia; /* PWG media size */
status = 0;
puts("PASS");
}
- fputs("_pwgMediaForPWG(\"iso_a4_210x297mm\"): ", stdout);
- if ((pwgmedia = _pwgMediaForPWG("iso_a4_210x297mm")) == NULL)
+ fputs("pwgMediaForPWG(\"iso_a4_210x297mm\"): ", stdout);
+ if ((pwgmedia = pwgMediaForPWG("iso_a4_210x297mm")) == NULL)
{
puts("FAIL (not found)");
status ++;
else
puts("PASS");
- fputs("_pwgMediaForLegacy(\"na-letter\"): ", stdout);
- if ((pwgmedia = _pwgMediaForLegacy("na-letter")) == NULL)
+ fputs("pwgMediaForLegacy(\"na-letter\"): ", stdout);
+ if ((pwgmedia = pwgMediaForLegacy("na-letter")) == NULL)
{
puts("FAIL (not found)");
status ++;
else
puts("PASS");
- fputs("_pwgMediaForPPD(\"4x6\"): ", stdout);
- if ((pwgmedia = _pwgMediaForPPD("4x6")) == NULL)
+ fputs("pwgMediaForPPD(\"4x6\"): ", stdout);
+ if ((pwgmedia = pwgMediaForPPD("4x6")) == NULL)
{
puts("FAIL (not found)");
status ++;
else
puts("PASS");
- fputs("_pwgMediaForPPD(\"10x15cm\"): ", stdout);
- if ((pwgmedia = _pwgMediaForPPD("10x15cm")) == NULL)
+ fputs("pwgMediaForPPD(\"10x15cm\"): ", stdout);
+ if ((pwgmedia = pwgMediaForPPD("10x15cm")) == NULL)
{
puts("FAIL (not found)");
status ++;
else
puts("PASS");
- fputs("_pwgMediaForPPD(\"Custom.10x15cm\"): ", stdout);
- if ((pwgmedia = _pwgMediaForPPD("Custom.10x15cm")) == NULL)
+ fputs("pwgMediaForPPD(\"Custom.10x15cm\"): ", stdout);
+ if ((pwgmedia = pwgMediaForPPD("Custom.10x15cm")) == NULL)
{
puts("FAIL (not found)");
status ++;
else
puts("PASS");
- fputs("_pwgMediaForSize(29700, 42000): ", stdout);
- if ((pwgmedia = _pwgMediaForSize(29700, 42000)) == NULL)
+ fputs("pwgMediaForSize(29700, 42000): ", stdout);
+ if ((pwgmedia = pwgMediaForSize(29700, 42000)) == NULL)
{
puts("FAIL (not found)");
status ++;
else
puts("PASS");
- fputs("_pwgMediaForSize(9842, 19050): ", stdout);
- if ((pwgmedia = _pwgMediaForSize(9842, 19050)) == NULL)
+ fputs("pwgMediaForSize(9842, 19050): ", stdout);
+ if ((pwgmedia = pwgMediaForSize(9842, 19050)) == NULL)
{
puts("FAIL (not found)");
status ++;
else
printf("PASS (%s)\n", pwgmedia->pwg);
- fputs("_pwgMediaForSize(9800, 19000): ", stdout);
- if ((pwgmedia = _pwgMediaForSize(9800, 19000)) == NULL)
+ fputs("pwgMediaForSize(9800, 19000): ", stdout);
+ if ((pwgmedia = pwgMediaForSize(9800, 19000)) == NULL)
{
puts("FAIL (not found)");
status ++;
int i, /* Looping var */
status = 0; /* Return status */
_ppd_cache_t *pc2; /* Loaded data */
- _pwg_size_t *size, /* Size from original */
+ pwg_size_t *size, /* Size from original */
*size2; /* Size from saved */
- _pwg_map_t *map, /* Map from original */
+ pwg_map_t *map, /* Map from original */
*map2; /* Map from saved */
}
if ((!cg->server[0] || !cg->ipp_port) && cups_server)
- {
- if (!cg->server[0])
- {
- /*
- * Copy server name...
- */
-
- strlcpy(cg->server, cups_server, sizeof(cg->server));
-
- if (cg->server[0] != '/' && (value = strrchr(cg->server, ':')) != NULL &&
- !strchr(value, ']') && isdigit(value[1] & 255))
- *value++ = '\0';
- else
- value = NULL;
-
- if (cg->server[0] == '/')
- strlcpy(cg->servername, "localhost", sizeof(cg->servername));
- else
- strlcpy(cg->servername, cg->server, sizeof(cg->servername));
- }
- else if (cups_server[0] != '/' &&
- (value = strrchr(cups_server, ':')) != NULL &&
- !strchr(value, ']') && isdigit(value[1] & 255))
- value ++;
- else
- value = NULL;
-
- if (!cg->ipp_port && value)
- cg->ipp_port = atoi(value);
- }
+ cupsSetServer(cups_server);
if (!cg->server[0])
{
<li><a href="#cupsEncryption" title="Get the current encryption settings.">cupsEncryption</a></li>
<li><a href="#cupsEnumDests" title="Enumerate available destinations with a callback function.">cupsEnumDests</a></li>
<li><a href="#cupsEnumDestsBlock" title="Enumerate available destinations with a block.">cupsEnumDestsBlock</a></li>
+ <li><a href="#cupsFindDestDefault" title="Find the default value(s) for the given option.">cupsFindDestDefault</a></li>
+ <li><a href="#cupsFindDestReady" title="Find the default value(s) for the given option.">cupsFindDestReady</a></li>
+ <li><a href="#cupsFindDestSupported" title="Find the default value(s) for the given option.">cupsFindDestSupported</a></li>
<li><a href="#cupsFinishDestDocument" title="Finish the current document.">cupsFinishDestDocument</a></li>
<li><a href="#cupsFinishDocument" title="Finish sending a document.">cupsFinishDocument</a></li>
<li><a href="#cupsFreeDestInfo" title="Free destination information obtained using
<li><a href="#cupsGetDefault" title="Get the default printer or class for the default server.">cupsGetDefault</a></li>
<li><a href="#cupsGetDefault2" title="Get the default printer or class for the specified server.">cupsGetDefault2</a></li>
<li><a href="#cupsGetDest" title="Get the named destination from the list.">cupsGetDest</a></li>
+ <li><a href="#cupsGetDestMediaByIndex" title="Get a media name, dimension, and margins for a
+specific size.">cupsGetDestMediaByIndex</a></li>
<li><a href="#cupsGetDestMediaByName" title="Get media names, dimensions, and margins.">cupsGetDestMediaByName</a></li>
<li><a href="#cupsGetDestMediaBySize" title="Get media names, dimensions, and margins.">cupsGetDestMediaBySize</a></li>
+ <li><a href="#cupsGetDestMediaCount" title="Get the number of sizes supported by a
+destination.">cupsGetDestMediaCount</a></li>
+ <li><a href="#cupsGetDestMediaDefault" title="Get the default size for a destination.">cupsGetDestMediaDefault</a></li>
<li><a href="#cupsGetDests" title="Get the list of destinations from the default server.">cupsGetDests</a></li>
<li><a href="#cupsGetDests2" title="Get the list of destinations from the specified server.">cupsGetDests2</a></li>
<li><a href="#cupsGetJobs" title="Get the jobs from the default server.">cupsGetJobs</a></li>
<li><a href="#cupsTempFile2" title="Creates a temporary CUPS file.">cupsTempFile2</a></li>
<li><a href="#cupsUser" title="Return the current user's name.">cupsUser</a></li>
<li><a href="#cupsUserAgent" title="Return the default HTTP User-Agent string.">cupsUserAgent</a></li>
+ <li><a href="#pwgFormatSizeName" title="Generate a PWG self-describing media size name.">pwgFormatSizeName</a></li>
+ <li><a href="#pwgInitSize" title="Initialize a pwg_size_t structure using IPP Job Template
+attributes.">pwgInitSize</a></li>
+ <li><a href="#pwgMediaForLegacy" title="Find a PWG media size by ISO/IPP legacy name.">pwgMediaForLegacy</a></li>
+ <li><a href="#pwgMediaForPPD" title="Find a PWG media size by Adobe PPD name.">pwgMediaForPPD</a></li>
+ <li><a href="#pwgMediaForPWG" title="Find a PWG media size by 5101.1 self-describing name.">pwgMediaForPWG</a></li>
+ <li><a href="#pwgMediaForSize" title="Get the PWG media size for the given dimensions.">pwgMediaForSize</a></li>
</ul></li>
<li><a href="#TYPES">Data Types</a><ul class="code">
<li><a href="#cups_client_cert_cb_t" title="Client credentials callback
<li><a href="#cups_server_cert_cb_t" title="Server credentials callback
">cups_server_cert_cb_t</a></li>
<li><a href="#cups_size_t" title="Media Size ">cups_size_t</a></li>
+ <li><a href="#pwg_map_t" title="Map element - PPD to/from PWG">pwg_map_t</a></li>
+ <li><a href="#pwg_media_t" title="Common media size data">pwg_media_t</a></li>
+ <li><a href="#pwg_size_t" title="Size element - PPD to/from PWG">pwg_size_t</a></li>
</ul></li>
<li><a href="#STRUCTURES">Structures</a><ul class="code">
<li><a href="#cups_dest_s" title="Destination">cups_dest_s</a></li>
<li><a href="#cups_option_s" title="Printer Options">cups_option_s</a></li>
<li><a href="#cups_size_s" title="Media Size ">cups_size_s</a></li>
<li><a href="#pollfd" title="User data (unused)">pollfd</a></li>
+ <li><a href="#pwg_map_s" title="Map element - PPD to/from PWG">pwg_map_s</a></li>
+ <li><a href="#pwg_media_s" title="Common media size data">pwg_media_s</a></li>
+ <li><a href="#pwg_size_s" title="Size element - PPD to/from PWG">pwg_size_s</a></li>
</ul></li>
<li><a href="#VARIABLES">Variables</a><ul class="code">
<li><a href="#CF_RETURNS_RETAINED" title="Get the Apple language identifier associated with a
<p class="description">Cancel a job on a destination.</p>
<p class="discussion">The "job_id" is the number returned by cupsCreateDestJob.<br>
<br>
-Returns IPP_OK on success and IPP_NOT_AUTHORIZED or IPP_FORBIDDEN on
+Returns IPP_STATUS_OK on success and IPP_NOT_AUTHORIZED or IPP_FORBIDDEN on
failure.
</p>
<p class="description">IPP status code</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use when the last call to cupsStartDocument passed 0 for "last_document".
-"job_id" is the job ID returned by cupsCreateDestJob. Returns <code>IPP_OK</code>
+"job_id" is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
on success.
</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h4 class="discussion">Discussion</h4>
-<p class="discussion">Returns <code>IPP_OK</code> or <code>IPP_OK_SUBST</code> on success, saving the job ID
+<p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
in the variable pointed to by "job_id".
</p>
<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
environment variable, then the ~/.cups/client.conf file, and finally the
/etc/cups/client.conf file. If not set, the default is
-<code>HTTP_ENCRYPT_IF_REQUESTED</code>.<br>
+<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
<br>
Note: The current encryption setting is tracked separately for each thread
in a program. Multi-threaded programs that override the setting via the
Enumeration happens on the current thread and does not return until all
destinations have been enumerated or the block returns 0.
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="cupsFindDestDefault">cupsFindDestDefault</a></h3>
+<p class="description">Find the default value(s) for the given option.</p>
+<p class="code">
+ipp_attribute_t *cupsFindDestDefault (<br>
+ http_t *http,<br>
+ <a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
+ <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
+ const char *option<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>http</dt>
+<dd class="description">Connection to destination</dd>
+<dt>dest</dt>
+<dd class="description">Destination</dd>
+<dt>dinfo</dt>
+<dd class="description">Destination information</dd>
+<dt>option</dt>
+<dd class="description">Option/attribute name</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Default attribute or <code>NULL</code> for none</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
+<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
+<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
+<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
+functions to inspect the default value(s) as needed.
+
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="cupsFindDestReady">cupsFindDestReady</a></h3>
+<p class="description">Find the default value(s) for the given option.</p>
+<p class="code">
+ipp_attribute_t *cupsFindDestReady (<br>
+ http_t *http,<br>
+ <a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
+ <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
+ const char *option<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>http</dt>
+<dd class="description">Connection to destination</dd>
+<dt>dest</dt>
+<dd class="description">Destination</dd>
+<dt>dinfo</dt>
+<dd class="description">Destination information</dd>
+<dt>option</dt>
+<dd class="description">Option/attribute name</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Default attribute or <code>NULL</code> for none</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
+<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
+<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
+<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
+functions to inspect the default value(s) as needed.
+
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="cupsFindDestSupported">cupsFindDestSupported</a></h3>
+<p class="description">Find the default value(s) for the given option.</p>
+<p class="code">
+ipp_attribute_t *cupsFindDestSupported (<br>
+ http_t *http,<br>
+ <a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
+ <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
+ const char *option<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>http</dt>
+<dd class="description">Connection to destination</dd>
+<dt>dest</dt>
+<dd class="description">Destination</dd>
+<dt>dinfo</dt>
+<dd class="description">Destination information</dd>
+<dt>option</dt>
+<dd class="description">Option/attribute name</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Default attribute or <code>NULL</code> for none</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
+<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
+<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
+<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
+functions to inspect the default value(s) as needed.
+
</p>
<h3 class="function"><span class="info"> CUPS 1.6/OS X 10.8 </span><a name="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
<p class="description">Finish the current document.</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of document submission</p>
<h4 class="discussion">Discussion</h4>
-<p class="discussion">Returns <code>IPP_OK</code> or <code>IPP_OK_SUBST</code> on success.
+<p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
</p>
<h3 class="function"><span class="info"> CUPS 1.4/OS X 10.6 </span><a name="cupsFinishDocument">cupsFinishDocument</a></h3>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a
list of supported destinations for the current user.</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
+<p class="description">Get a media name, dimension, and margins for a
+specific size.</p>
+<p class="code">
+int cupsGetDestMediaByIndex (<br>
+ http_t *http,<br>
+ <a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
+ <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
+ int n,<br>
+ unsigned flags,<br>
+ <a href="#cups_size_t">cups_size_t</a> *size<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>http</dt>
+<dd class="description">Connection to destination</dd>
+<dt>dest</dt>
+<dd class="description">Destination</dd>
+<dt>dinfo</dt>
+<dd class="description">Destination information</dd>
+<dt>n</dt>
+<dd class="description">Media size number (0-based)</dd>
+<dt>flags</dt>
+<dd class="description">Media flags</dd>
+<dt>size</dt>
+<dd class="description">Media size information</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">1 on success, 0 on failure</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
+example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
+borderless size supported by the printer.
+
+</p>
<h3 class="function"><span class="info"> CUPS 1.6/OS X 10.8 </span><a name="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
<p class="description">Get media names, dimensions, and margins.</p>
<p class="code">
<br>
Returns 1 when there is a match and 0 if there is not a match.
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
+<p class="description">Get the number of sizes supported by a
+destination.</p>
+<p class="code">
+int cupsGetDestMediaCount (<br>
+ http_t *http,<br>
+ <a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
+ <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
+ unsigned flags<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>http</dt>
+<dd class="description">Connection to destination</dd>
+<dt>dest</dt>
+<dd class="description">Destination</dd>
+<dt>dinfo</dt>
+<dd class="description">Destination information</dd>
+<dt>flags</dt>
+<dd class="description">Media flags</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Number of sizes</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
+counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
+the number of borderless sizes.
+
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
+<p class="description">Get the default size for a destination.</p>
+<p class="code">
+int cupsGetDestMediaDefault (<br>
+ http_t *http,<br>
+ <a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
+ <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
+ unsigned flags,<br>
+ <a href="#cups_size_t">cups_size_t</a> *size<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>http</dt>
+<dd class="description">Connection to destination</dd>
+<dt>dest</dt>
+<dd class="description">Destination</dd>
+<dt>dinfo</dt>
+<dd class="description">Destination information</dd>
+<dt>flags</dt>
+<dd class="description">Media flags</dd>
+<dt>size</dt>
+<dd class="description">Media size information</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">1 on success, 0 on failure</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
+example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
+borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
+
</p>
<h3 class="function"><a name="cupsGetDests">cupsGetDests</a></h3>
<p class="description">Get the list of destinations from the default server.</p>
file will be overwritten as needed. The caller "owns" the file that is
created and must <code>unlink</code> the returned filename.<br>
<br>
-On success, <code>HTTP_OK</code> is returned for a new PPD file and
-<code>HTTP_NOT_MODIFIED</code> if the existing PPD file is up-to-date. Any other
+On success, <code>HTTP_STATUS_OK</code> is returned for a new PPD file and
+<code>HTTP_STATUS_NOT_MODIFIED</code> if the existing PPD file is up-to-date. Any other
status is an error.<br>
<br>
For classes, <code>cupsGetPPD3</code> returns the PPD file for the first printer
<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
environment variable, then the ~/.cups/client.conf file, and finally the
/etc/cups/client.conf file. If not set, the default is
-<code>HTTP_ENCRYPT_IF_REQUESTED</code>.<br>
+<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
<br>
Note: The current encryption setting is tracked separately for each thread
in a program. Multi-threaded programs that override the setting need to do
const char *cupsUserAgent (void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">User-Agent string</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="pwgFormatSizeName">pwgFormatSizeName</a></h3>
+<p class="description">Generate a PWG self-describing media size name.</p>
+<p class="code">
+int pwgFormatSizeName (<br>
+ char *keyword,<br>
+ size_t keysize,<br>
+ const char *prefix,<br>
+ const char *name,<br>
+ int width,<br>
+ int length,<br>
+ const char *units<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>keyword</dt>
+<dd class="description">Keyword buffer</dd>
+<dt>keysize</dt>
+<dd class="description">Size of keyword buffer</dd>
+<dt>prefix</dt>
+<dd class="description">Prefix for PWG size or <code>NULL</code> for automatic</dd>
+<dt>name</dt>
+<dd class="description">Size name or <code>NULL</code></dd>
+<dt>width</dt>
+<dd class="description">Width of page in 2540ths</dd>
+<dt>length</dt>
+<dd class="description">Length of page in 2540ths</dd>
+<dt>units</dt>
+<dd class="description">Units - "in", "mm", or <code>NULL</code> for automatic</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">1 on success, 0 on failure</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">This function generates a PWG self-describing media size name of the form
+"prefix_name_WIDTHxLENGTHunits". The prefix is typically "custom" or "roll"
+for user-supplied sizes but can also be "disc", "iso", "jis", "jpn", "na",
+"oe", "om", "prc", or "roc". A value of <code>NULL</code> automatically chooses
+"oe" or "om" depending on the units.<br>
+<br>
+The size name may only contain lowercase letters, numbers, "-", and ".". If
+<code>NULL</code> is passed, the size name will contain the formatted dimensions.<br>
+<br>
+The width and length are specified in hundredths of millimeters, equivalent
+to 1/100000th of a meter or 1/2540th of an inch. The width, length, and
+units used for the generated size name are calculated automatically if the
+units string is <code>NULL</code>, otherwise inches ("in") or millimeters ("mm")
+are used.
+
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="pwgInitSize">pwgInitSize</a></h3>
+<p class="description">Initialize a pwg_size_t structure using IPP Job Template
+attributes.</p>
+<p class="code">
+int pwgInitSize (<br>
+ <a href="#pwg_size_t">pwg_size_t</a> *size,<br>
+ ipp_t *job,<br>
+ int *margins_set<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>size</dt>
+<dd class="description">Size to initialize</dd>
+<dt>job</dt>
+<dd class="description">Job template attributes</dd>
+<dt>margins_set</dt>
+<dd class="description">1 if margins were set, 0 otherwise</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">1 if size was initialized, 0 otherwise</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">This function initializes a pwg_size_t structure from an IPP "media" or
+"media-col" attribute in the specified IPP message. 0 is returned if neither
+attribute is found in the message or the values are not valid.<br>
+<br>
+The "margins_set" variable is initialized to 1 if any "media-xxx-margin"
+member attribute was specified in the "media-col" Job Template attribute,
+otherwise it is initialized to 0.
+
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="pwgMediaForLegacy">pwgMediaForLegacy</a></h3>
+<p class="description">Find a PWG media size by ISO/IPP legacy name.</p>
+<p class="code">
+<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForLegacy (<br>
+ const char *legacy<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>legacy</dt>
+<dd class="description">Legacy size name</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Matching size or NULL</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The "name" argument specifies the legacy ISO media size name, for example
+"iso-a4" or "na-letter".
+
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="pwgMediaForPPD">pwgMediaForPPD</a></h3>
+<p class="description">Find a PWG media size by Adobe PPD name.</p>
+<p class="code">
+<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPPD (<br>
+ const char *ppd<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>ppd</dt>
+<dd class="description">PPD size name</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Matching size or NULL</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The "ppd" argument specifies an Adobe page size name as defined in Table B.1
+of the Adobe PostScript Printer Description File Format Specification Version
+4.3.<br>
+<br>
+If the name is non-standard, the returned PWG media size is stored in
+thread-local storage and is overwritten by each call to the function in the
+thread. Custom names can be of the form "Custom.WIDTHxLENGTH[units]" or
+"WIDTHxLENGTH[units]".
+
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="pwgMediaForPWG">pwgMediaForPWG</a></h3>
+<p class="description">Find a PWG media size by 5101.1 self-describing name.</p>
+<p class="code">
+<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPWG (<br>
+ const char *pwg<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>pwg</dt>
+<dd class="description">PWG size name</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Matching size or NULL</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The "pwg" argument specifies a self-describing media size name of the form
+"prefix_name_WIDTHxLENGTHunits" as defined in PWG 5101.1.<br>
+<br>
+If the name is non-standard, the returned PWG media size is stored in
+thread-local storage and is overwritten by each call to the function in the
+thread.
+
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="pwgMediaForSize">pwgMediaForSize</a></h3>
+<p class="description">Get the PWG media size for the given dimensions.</p>
+<p class="code">
+<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForSize (<br>
+ int width,<br>
+ int length<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>width</dt>
+<dd class="description">Width in hundredths of millimeters</dd>
+<dt>length</dt>
+<dd class="description">Length in hundredths of millimeters</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">PWG media name</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The "width" and "length" are in hundredths of millimeters, equivalent to
+1/100000th of a meter or 1/2540th of an inch.<br>
+<br>
+If the dimensions are non-standard, the returned PWG media size is stored in
+thread-local storage and is overwritten by each call to the function in the
+thread.
+
+</p>
<h2 class="title"><a name="TYPES">Data Types</a></h2>
<h3 class="typedef"><span class="info"> CUPS 1.5/OS X 10.7 </span><a name="cups_client_cert_cb_t">cups_client_cert_cb_t</a></h3>
<p class="description">Client credentials callback
<p class="code">
typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
</p>
+<h3 class="typedef"><a name="pwg_map_t">pwg_map_t</a></h3>
+<p class="description">Map element - PPD to/from PWG</p>
+<p class="code">
+typedef struct <a href="#pwg_map_s">pwg_map_s</a> pwg_map_t;
+</p>
+<h3 class="typedef"><a name="pwg_media_t">pwg_media_t</a></h3>
+<p class="description">Common media size data</p>
+<p class="code">
+typedef struct <a href="#pwg_media_s">pwg_media_s</a> pwg_media_t;
+</p>
+<h3 class="typedef"><a name="pwg_size_t">pwg_size_t</a></h3>
+<p class="description">Size element - PPD to/from PWG</p>
+<p class="code">
+typedef struct <a href="#pwg_size_s">pwg_size_s</a> pwg_size_t;
+</p>
<h2 class="title"><a name="STRUCTURES">Structures</a></h2>
<h3 class="struct"><a name="cups_dest_s">cups_dest_s</a></h3>
<p class="description">Destination</p>
<dt>val </dt>
<dd class="description">Return value</dd>
</dl>
+<h3 class="struct"><a name="pwg_map_s">pwg_map_s</a></h3>
+<p class="description">Map element - PPD to/from PWG</p>
+<p class="code">struct pwg_map_s {<br>
+ char *pwg, *ppd;<br>
+};</p>
+<h4 class="members">Members</h4>
+<dl>
+<dt>ppd </dt>
+<dd class="description">PPD option keyword</dd>
+</dl>
+<h3 class="struct"><a name="pwg_media_s">pwg_media_s</a></h3>
+<p class="description">Common media size data</p>
+<p class="code">struct pwg_media_s {<br>
+ int width, length;<br>
+ const char *pwg, *legacy, *ppd;<br>
+};</p>
+<h4 class="members">Members</h4>
+<dl>
+<dt>length </dt>
+<dd class="description">Length in 2540ths</dd>
+<dt>ppd </dt>
+<dd class="description">Standard Adobe PPD name</dd>
+</dl>
+<h3 class="struct"><a name="pwg_size_s">pwg_size_s</a></h3>
+<p class="description">Size element - PPD to/from PWG</p>
+<p class="code">struct pwg_size_s {<br>
+ <a href="#pwg_map_t">pwg_map_t</a> map;<br>
+ int width, length, left, bottom, right, top;<br>
+};</p>
+<h4 class="members">Members</h4>
+<dl>
+<dt>map </dt>
+<dd class="description">Map element</dd>
+<dt>top </dt>
+<dd class="description">Top margin in 2540ths</dd>
+</dl>
<h2 class="title"><a name="VARIABLES">Variables</a></h2>
<h3 class="variable"><a name="CF_RETURNS_RETAINED">CF_RETURNS_RETAINED</a></h3>
<p class="description">Get the Apple language identifier associated with a
<li><a href="#ippGetGroupTag" title="Get the group associated with an attribute.">ippGetGroupTag</a></li>
<li><a href="#ippGetInteger" title="Get the integer/enum value for an attribute.">ippGetInteger</a></li>
<li><a href="#ippGetName" title="Get the attribute name.">ippGetName</a></li>
+ <li><a href="#ippGetOctetString" title="Get an octetString value from an IPP attribute.">ippGetOctetString</a></li>
<li><a href="#ippGetOperation" title="Get the operation ID in an IPP message.">ippGetOperation</a></li>
<li><a href="#ippGetRange" title="Get a rangeOfInteger value from an attribute.">ippGetRange</a></li>
<li><a href="#ippGetRequestId" title="Get the request ID from an IPP message.">ippGetRequestId</a></li>
<li><a href="#ippSetGroupTag" title="Set the group tag of an attribute.">ippSetGroupTag</a></li>
<li><a href="#ippSetInteger" title="Set an integer or enum value in an attribute.">ippSetInteger</a></li>
<li><a href="#ippSetName" title="Set the name of an attribute.">ippSetName</a></li>
+ <li><a href="#ippSetOctetString" title="Set an octetString value in an IPP attribute.">ippSetOctetString</a></li>
<li><a href="#ippSetOperation" title="Set the operation ID in an IPP request message.">ippSetOperation</a></li>
<li><a href="#ippSetPort" title="Set the default port number.">ippSetPort</a></li>
<li><a href="#ippSetRange" title="Set a rangeOfInteger value in an attribute.">ippSetRange</a></li>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 on success, -1 on error</p>
<h4 class="discussion">Discussion</h4>
-<p class="discussion">This function should be called in response to a <code>HTTP_UNAUTHORIZED</code>
+<p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
status, prior to resubmitting your request.
</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h4 class="discussion">Discussion</h4>
-<p class="discussion">This function returns <code>HTTP_OK</code> when the file is successfully retrieved.
+<p class="discussion">This function returns <code>HTTP_STATUS_OK</code> when the file is successfully retrieved.
</p>
<h3 class="function"><span class="info"> CUPS 1.1.20/OS X 10.4 </span><a name="cupsGetFile">cupsGetFile</a></h3>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h4 class="discussion">Discussion</h4>
-<p class="discussion">This function returns <code>HTTP_OK</code> when the file is successfully retrieved.
+<p class="discussion">This function returns <code>HTTP_STATUS_OK</code> when the file is successfully retrieved.
</p>
<h3 class="function"><span class="info"> CUPS 1.4/OS X 10.6 </span><a name="cupsGetResponse">cupsGetResponse</a></h3>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h4 class="discussion">Discussion</h4>
-<p class="discussion">This function returns <code>HTTP_CREATED</code> when the file is stored
+<p class="discussion">This function returns <code>HTTP_STATUS_CREATED</code> when the file is stored
successfully.
</p>
response. Only one request can be sent/queued at a time per <code>http_t</code>
connection.<br>
<br>
-Returns the initial HTTP status code, which will be <code>HTTP_CONTINUE</code>
+Returns the initial HTTP status code, which will be <code>HTTP_STATUS_CONTINUE</code>
on a successful send of the request.<br>
<br>
Note: Unlike <a href="#cupsDoFileRequest"><code>cupsDoFileRequest</code></a>, <a href="#cupsDoIORequest"><code>cupsDoIORequest</code></a>, and
<dd class="description">Number of bytes to write</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
-<p class="description"><code>HTTP_CONTINUE</code> if OK or HTTP status on error</p>
+<p class="description"><code>HTTP_STATUS_CONTINUE</code> if OK or HTTP status on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function is used after <a href="#cupsSendRequest"><code>cupsSendRequest</code></a> to provide a PPD and
after <a href="#cupsStartDocument"><code>cupsStartDocument</code></a> to provide a document file.
you need to create a URI string.
</p>
-<h3 class="function"><a name="httpAssembleUUID">httpAssembleUUID</a></h3>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="httpAssembleUUID">httpAssembleUUID</a></h3>
<p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
<p class="code">
char *httpAssembleUUID (<br>
name, port number, random data, and optionally an object name and/or object
number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
<br>
-The buffer needs to be at least 46 bytes in size.</p>
+The buffer needs to be at least 46 bytes in size.
+
+</p>
<h3 class="function"><a name="httpBlocking">httpBlocking</a></h3>
<p class="description">Set blocking/non-blocking behavior on a connection.</p>
<p class="code">
<dd class="description">Value</dd>
</dl>
<h4 class="discussion">Discussion</h4>
-<p class="discussion">Currently only HTTP_FIELD_ACCEPT_ENCODING, HTTP_FIELD_SERVER, and
-HTTP_FIELD_USER_AGENT can be set.
+<p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
+and <code>HTTP_FIELD_USER_AGENT</code> can be set.
</p>
<h3 class="function"><span class="info"> CUPS 1.2/OS X 10.5 </span><a name="httpSetExpect">httpSetExpect</a></h3>
<dd class="description">Connection to server</dd>
<dt>expect</dt>
<dd class="description">HTTP status to expect
-(<code>HTTP_CONTINUE</code>)</dd>
+(<code>HTTP_STATUS_CONTINUE</code>)</dd>
</dl>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the "expect"
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Attribute name or <code>NULL</code> for separators</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="ippGetOctetString">ippGetOctetString</a></h3>
+<p class="description">Get an octetString value from an IPP attribute.</p>
+<p class="code">
+void *ippGetOctetString (<br>
+ <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
+ int element,<br>
+ int *datalen<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>attr</dt>
+<dd class="description">IPP attribute</dd>
+<dt>element</dt>
+<dd class="description">Value number (0-based)</dd>
+<dt>datalen</dt>
+<dd class="description">Length of octetString data</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Pointer to octetString data</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
+<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
+
+</p>
<h3 class="function"><span class="info"> CUPS 1.6/OS X 10.8 </span><a name="ippGetOperation">ippGetOperation</a></h3>
<p class="description">Get the operation ID in an IPP message.</p>
<p class="code">
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.
+</p>
+<h3 class="function"><span class="info"> CUPS 1.7 </span><a name="ippSetOctetString">ippSetOctetString</a></h3>
+<p class="description">Set an octetString value in an IPP attribute.</p>
+<p class="code">
+int ippSetOctetString (<br>
+ <a href="#ipp_t">ipp_t</a> *ipp,<br>
+ <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
+ int element,<br>
+ const void *data,<br>
+ int datalen<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>ipp</dt>
+<dd class="description">IPP message</dd>
+<dt>attr</dt>
+<dd class="description">IPP attribute</dd>
+<dt>element</dt>
+<dd class="description">Value number (0-based)</dd>
+<dt>data</dt>
+<dd class="description">Pointer to octetString data</dd>
+<dt>datalen</dt>
+<dd class="description">Length of octetString data</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">1 on success, 0 on failure</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
+the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
+<br>
+The <code>attr</code> parameter may be modified as a result of setting the value.<br>
+<br>
+The <code>element</code> parameter specifies which value to set from 0 to
+<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
+
</p>
<h3 class="function"><span class="info"> CUPS 1.6/OS X 10.8 </span><a name="ippSetOperation">ippSetOperation</a></h3>
<p class="description">Set the operation ID in an IPP request message.</p>
<p class="description">HTTP status codes</p>
<h4 class="constants">Constants</h4>
<dl>
-<dt>CUPS_STATUS_AUTHORIZATION_CANCELED <span class="info"> CUPS 1.4 </span></dt>
-<dd class="description">User canceled authorization </dd>
-<dt>CUPS_STATUS_PKI_ERROR <span class="info"> CUPS 1.5/OS X 10.7 </span></dt>
-<dd class="description">Error negotiating a secure connection </dd>
<dt>HTTP_STATUS_ACCEPTED </dt>
<dd class="description">DELETE command was successful</dd>
<dt>HTTP_STATUS_BAD_GATEWAY </dt>
<dd class="description">Everything OK, keep going...</dd>
<dt>HTTP_STATUS_CREATED </dt>
<dd class="description">PUT command was successful</dd>
+<dt>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info"> CUPS 1.4 </span></dt>
+<dd class="description">User canceled authorization </dd>
+<dt>HTTP_STATUS_CUPS_PKI_ERROR <span class="info"> CUPS 1.5/OS X 10.7 </span></dt>
+<dd class="description">Error negotiating a secure connection </dd>
<dt>HTTP_STATUS_ERROR </dt>
<dd class="description">An error response from httpXxxx()</dd>
<dt>HTTP_STATUS_EXPECTATION_FAILED </dt>
<dd class="description">Fold to make booklet</dd>
<dt>IPP_FINISHINGS_COVER </dt>
<dd class="description">Add cover</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN </dt>
+<dd class="description">Accordian-fold the paper vertically into four sections</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE </dt>
+<dd class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_GATE </dt>
+<dd class="description">Fold the top and bottom quarters of the paper towards the midline</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_HALF </dt>
+<dd class="description">Fold the paper in half vertically</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_HALF_Z </dt>
+<dd class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_LEFT_GATE </dt>
+<dd class="description">Fold the top quarter of the paper towards the midline</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_LETTER </dt>
+<dd class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_PARALLEL </dt>
+<dd class="description">Fold the paper in half vertically two times, yielding four sections</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_POSTER </dt>
+<dd class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_RIGHT_GATE </dt>
+<dd class="description">Fold the bottom quarter of the paper towards the midline</dd>
+<dt>IPP_FINISHINGS_CUPS_FOLD_Z </dt>
+<dd class="description">Fold the paper vertically into three sections, forming a Z</dd>
<dt>IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_LEFT </dt>
<dd class="description">Punch 1 hole bottom left</dd>
<dt>IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_RIGHT </dt>
<dd class="description">Stitch along top edge</dd>
<dt>IPP_FINISHINGS_FOLD </dt>
<dd class="description">Fold (any type)</dd>
-<dt>IPP_FINISHINGS_JOB_OFFSET </dt>
+<dt>IPP_FINISHINGS_JOG_OFFSET </dt>
<dd class="description">Offset for binding (any type)</dd>
<dt>IPP_FINISHINGS_NONE </dt>
<dd class="description">No finishing</dd>
<H1 CLASS="title">What's New in CUPS 1.7</H1>
-<P>CUPS 1.7 provides many changes and new features to CUPS 1.6.x. This page provides a high-level outline of these changes. If you have never used CUPS before, read the <A HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
+<P>This page provides a high-level outline of these changes. If you have never used CUPS before, read the <A HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
-<H2 CLASS="title"><A NAME="COMMANDS">General</A></H2>
+<P>CUPS 1.7 is primarily a "polish" release. Users will appreciate improved support for paid, PIN, and release printing, as well as expanded support for printers conforming to the <a href="http://www.pwg.org/ipp/everywhere.html">IPP Everywhere</a> specification. Full support for this functionality depends on additional software from your operating system vendor.</p>
-<OL START="1">
+<P>When supported by the printer or the remote server, CUPS now compresses print data sent over the network to greatly improve print speed and reduce bandwidth usage. This happens automatically when printing through IPP and is available as an option when using the <code>ipptool</code> utility.</P>
- <LI><EM>What;</EM> Description.</LI>
-
-</OL>
-
-
-<H2 CLASS="title"><A NAME="SCHEDULER">Scheduler</A></H2>
-
-<OL START="2">
-
- <LI><EM>What;</EM> Description.</LI>
-
-</OL>
-
-
-<H2 CLASS="title"><A NAME="CUPSAPI">CUPS API</A></H2>
-
-<OL START="3">
-
- <LI><EM>What;</EM> Description.</LI>
-
-</OL>
+<P>Developers can now enumerate supported sizes and option values, as well as query a printer to discovery which media is loaded, making it possible to easily build customized user interfaces without the use of printer drivers or PPD files.</P>
</BODY>
</HTML>
msgstr ""
"Project-Id-Version: CUPS 1.6\n"
"Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2013-03-08 13:23-0500\n"
+"POT-Creation-Date: 2013-03-20 15:42-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid " PASS"
msgstr ""
-#: cups/ipp.c:5114
+#: cups/ipp.c:5243
#, c-format
msgid "\"%s\": Bad URI value \"%s\" - %s (RFC 2911 section 4.1.5)."
msgstr ""
-#: cups/ipp.c:5125
+#: cups/ipp.c:5254
#, c-format
msgid "\"%s\": Bad URI value \"%s\" - bad length %d (RFC 2911 section 4.1.5)."
msgstr ""
-#: cups/ipp.c:4745
+#: cups/ipp.c:4874
#, c-format
msgid "\"%s\": Bad attribute name - bad length %d (RFC 2911 section 4.1.3)."
msgstr ""
-#: cups/ipp.c:4737
+#: cups/ipp.c:4866
#, c-format
msgid "\"%s\": Bad attribute name - invalid character (RFC 2911 section 4.1.3)."
msgstr ""
-#: cups/ipp.c:4763
+#: cups/ipp.c:4892
#, c-format
msgid "\"%s\": Bad boolen value %d (RFC 2911 section 4.1.11)."
msgstr ""
-#: cups/ipp.c:5177
+#: cups/ipp.c:5306
#, c-format
msgid "\"%s\": Bad charset value \"%s\" - bad characters (RFC 2911 section 4.1.7)."
msgstr ""
-#: cups/ipp.c:5186
+#: cups/ipp.c:5315
#, c-format
msgid "\"%s\": Bad charset value \"%s\" - bad length %d (RFC 2911 section 4.1.7)."
msgstr ""
-#: cups/ipp.c:4863
+#: cups/ipp.c:4992
#, c-format
msgid "\"%s\": Bad dateTime UTC hours %u (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4871
+#: cups/ipp.c:5000
#, c-format
msgid "\"%s\": Bad dateTime UTC minutes %u (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4855
+#: cups/ipp.c:4984
#, c-format
msgid "\"%s\": Bad dateTime UTC sign '%c' (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4815
+#: cups/ipp.c:4944
#, c-format
msgid "\"%s\": Bad dateTime day %u (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4847
+#: cups/ipp.c:4976
#, c-format
msgid "\"%s\": Bad dateTime deciseconds %u (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4823
+#: cups/ipp.c:4952
#, c-format
msgid "\"%s\": Bad dateTime hours %u (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4831
+#: cups/ipp.c:4960
#, c-format
msgid "\"%s\": Bad dateTime minutes %u (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4807
+#: cups/ipp.c:4936
#, c-format
msgid "\"%s\": Bad dateTime month %u (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4839
+#: cups/ipp.c:4968
#, c-format
msgid "\"%s\": Bad dateTime seconds %u (RFC 2911 section 4.1.14)."
msgstr ""
-#: cups/ipp.c:4777
+#: cups/ipp.c:4906
#, c-format
msgid "\"%s\": Bad enum value %d - out of range (RFC 2911 section 4.1.4)."
msgstr ""
-#: cups/ipp.c:5092
+#: cups/ipp.c:5221
#, c-format
msgid "\"%s\": Bad keyword value \"%s\" - bad length %d (RFC 2911 section 4.1.3)."
msgstr ""
-#: cups/ipp.c:5083
+#: cups/ipp.c:5212
#, c-format
msgid "\"%s\": Bad keyword value \"%s\" - invalid character (RFC 2911 section 4.1.3)."
msgstr ""
-#: cups/ipp.c:5286
+#: cups/ipp.c:5415
#, c-format
msgid "\"%s\": Bad mimeMediaType value \"%s\" - bad characters (RFC 2911 section 4.1.9)."
msgstr ""
-#: cups/ipp.c:5296
+#: cups/ipp.c:5425
#, c-format
msgid "\"%s\": Bad mimeMediaType value \"%s\" - bad length %d (RFC 2911 section 4.1.9)."
msgstr ""
-#: cups/ipp.c:5054
+#: cups/ipp.c:5183
#, c-format
msgid "\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 2911 section 4.1.2)."
msgstr ""
-#: cups/ipp.c:5063
+#: cups/ipp.c:5192
#, c-format
msgid "\"%s\": Bad name value \"%s\" - bad length %d (RFC 2911 section 4.1.2)."
msgstr ""
-#: cups/ipp.c:5232
+#: cups/ipp.c:5361
#, c-format
msgid "\"%s\": Bad naturalLanguage value \"%s\" - bad characters (RFC 2911 section 4.1.8)."
msgstr ""
-#: cups/ipp.c:5242
+#: cups/ipp.c:5371
#, c-format
msgid "\"%s\": Bad naturalLanguage value \"%s\" - bad length %d (RFC 2911 section 4.1.8)."
msgstr ""
-#: cups/ipp.c:4791
+#: cups/ipp.c:4920
#, c-format
msgid "\"%s\": Bad octetString value - bad length %d (RFC 2911 section 4.1.10)."
msgstr ""
-#: cups/ipp.c:4934
+#: cups/ipp.c:5063
#, c-format
msgid "\"%s\": Bad rangeOfInteger value %d-%d - lower greater than upper (RFC 2911 section 4.1.13)."
msgstr ""
-#: cups/ipp.c:4915
+#: cups/ipp.c:5044
#, c-format
msgid "\"%s\": Bad resolution value %dx%d%s - bad units value (RFC 2911 section 4.1.15)."
msgstr ""
-#: cups/ipp.c:4884
+#: cups/ipp.c:5013
#, c-format
msgid "\"%s\": Bad resolution value %dx%d%s - cross feed resolution must be positive (RFC 2911 section 4.1.15)."
msgstr ""
-#: cups/ipp.c:4899
+#: cups/ipp.c:5028
#, c-format
msgid "\"%s\": Bad resolution value %dx%d%s - feed resolution must be positive (RFC 2911 section 4.1.15)."
msgstr ""
-#: cups/ipp.c:4996
+#: cups/ipp.c:5125
#, c-format
msgid "\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 2911 section 4.1.1)."
msgstr ""
-#: cups/ipp.c:5005
+#: cups/ipp.c:5134
#, c-format
msgid "\"%s\": Bad text value \"%s\" - bad length %d (RFC 2911 section 4.1.1)."
msgstr ""
-#: cups/ipp.c:5148
+#: cups/ipp.c:5277
#, c-format
msgid "\"%s\": Bad uriScheme value \"%s\" - bad characters (RFC 2911 section 4.1.6)."
msgstr ""
-#: cups/ipp.c:5157
+#: cups/ipp.c:5286
#, c-format
msgid "\"%s\": Bad uriScheme value \"%s\" - bad length %d (RFC 2911 section 4.1.6)."
msgstr ""
msgid "%s accepting requests since %s"
msgstr ""
-#: scheduler/ipp.c:9907
+#: scheduler/ipp.c:9924
#, c-format
msgid "%s cannot be changed."
msgstr ""
msgid "Accept Jobs"
msgstr ""
-#: cups/http-support.c:1296
+#: cups/http-support.c:1298
msgid "Accepted"
msgstr ""
msgid "B9"
msgstr ""
-#: scheduler/ipp.c:10833
+#: scheduler/ipp.c:10850
#, c-format
msgid "Bad 'document-format' value \"%s\"."
msgstr ""
msgid "Bad PPD cache file."
msgstr ""
-#: cups/http-support.c:1311
+#: cups/http-support.c:1313
msgid "Bad Request"
msgstr ""
msgid "Bad custom parameter"
msgstr ""
-#: cups/http-support.c:1463 scheduler/ipp.c:2427
+#: cups/http-support.c:1465 scheduler/ipp.c:2446
#, c-format
msgid "Bad device-uri \"%s\"."
msgstr ""
-#: scheduler/ipp.c:2468
+#: scheduler/ipp.c:2485
#, c-format
msgid "Bad device-uri scheme \"%s\"."
msgstr ""
-#: scheduler/ipp.c:8085 scheduler/ipp.c:8101 scheduler/ipp.c:9316
+#: scheduler/ipp.c:8102 scheduler/ipp.c:8118 scheduler/ipp.c:9333
#, c-format
msgid "Bad document-format \"%s\"."
msgstr ""
-#: scheduler/ipp.c:9332
+#: scheduler/ipp.c:9349
#, c-format
msgid "Bad document-format-default \"%s\"."
msgstr ""
msgid "Bad job-name value: Wrong type or count."
msgstr ""
-#: scheduler/ipp.c:9922
+#: scheduler/ipp.c:9939
msgid "Bad job-priority value."
msgstr ""
msgid "Bad job-sheets value type."
msgstr ""
-#: scheduler/ipp.c:9952
+#: scheduler/ipp.c:9969
msgid "Bad job-state value."
msgstr ""
-#: scheduler/ipp.c:3051 scheduler/ipp.c:3511 scheduler/ipp.c:5950
-#: scheduler/ipp.c:6097 scheduler/ipp.c:7519 scheduler/ipp.c:7788
-#: scheduler/ipp.c:8637 scheduler/ipp.c:8863 scheduler/ipp.c:9212
-#: scheduler/ipp.c:9815
+#: scheduler/ipp.c:3068 scheduler/ipp.c:3528 scheduler/ipp.c:5967
+#: scheduler/ipp.c:6114 scheduler/ipp.c:7536 scheduler/ipp.c:7805
+#: scheduler/ipp.c:8654 scheduler/ipp.c:8880 scheduler/ipp.c:9229
+#: scheduler/ipp.c:9832
#, c-format
msgid "Bad job-uri \"%s\"."
msgstr ""
-#: scheduler/ipp.c:2126 scheduler/ipp.c:5494
+#: scheduler/ipp.c:2126 scheduler/ipp.c:5511
#, c-format
msgid "Bad notify-pull-method \"%s\"."
msgstr ""
-#: scheduler/ipp.c:2090 scheduler/ipp.c:5458
+#: scheduler/ipp.c:2090 scheduler/ipp.c:5475
#, c-format
msgid "Bad notify-recipient-uri \"%s\"."
msgstr ""
msgid "Bad page-ranges values %d-%d."
msgstr ""
-#: scheduler/ipp.c:2511
+#: scheduler/ipp.c:2528
#, c-format
msgid "Bad port-monitor \"%s\"."
msgstr ""
msgid "Bad printer URI."
msgstr ""
-#: scheduler/ipp.c:2572
+#: scheduler/ipp.c:2589
#, c-format
msgid "Bad printer-state value %d."
msgstr ""
msgid "Bond Paper"
msgstr ""
-#: backend/usb-darwin.c:1880
+#: backend/usb-darwin.c:1894
#, c-format
msgid "Boolean expected for waiteof option \"%s\"."
msgstr ""
msgid "Cancel RSS Subscription"
msgstr ""
-#: backend/ipp.c:2144
+#: backend/ipp.c:2150
msgid "Canceling print job."
msgstr ""
-#: scheduler/ipp.c:2552
+#: scheduler/ipp.c:2569
msgid "Cannot share a remote Kerberized printer."
msgstr ""
msgid "Change Settings"
msgstr ""
-#: scheduler/ipp.c:2138 scheduler/ipp.c:5506
+#: scheduler/ipp.c:2138 scheduler/ipp.c:5523
#, c-format
msgid "Character set \"%s\" not supported."
msgstr ""
msgid "Clean Print Heads"
msgstr ""
-#: scheduler/ipp.c:3963
+#: scheduler/ipp.c:3980
msgid "Close-Job doesn't support the job-uri attribute."
msgstr ""
msgid "Connecting to printer."
msgstr ""
-#: cups/http-support.c:1284
+#: cups/http-support.c:1286
msgid "Continue"
msgstr ""
msgid "Copying print data."
msgstr ""
-#: cups/http-support.c:1293
+#: cups/http-support.c:1295
msgid "Created"
msgstr ""
msgid "Disabled"
msgstr ""
-#: scheduler/ipp.c:5999
+#: scheduler/ipp.c:6016
#, c-format
msgid "Document #%d does not exist in job #%d."
msgstr ""
msgid "Executive"
msgstr ""
-#: cups/http-support.c:1339
+#: cups/http-support.c:1341
msgid "Expectation Failed"
msgstr ""
msgid "File Folder "
msgstr ""
-#: scheduler/ipp.c:2447
+#: scheduler/ipp.c:2464
#, c-format
msgid "File device URIs have been disabled. To enable, see the FileDevice directive in \"%s/cups-files.conf\"."
msgstr ""
msgid "Folio"
msgstr ""
-#: cups/http-support.c:1318
+#: cups/http-support.c:1320
msgid "Forbidden"
msgstr ""
msgid "Glossy Paper"
msgstr ""
-#: scheduler/ipp.c:3029 scheduler/ipp.c:3437 scheduler/ipp.c:3975
-#: scheduler/ipp.c:5928 scheduler/ipp.c:6075 scheduler/ipp.c:7496
-#: scheduler/ipp.c:8615 scheduler/ipp.c:8841 scheduler/ipp.c:9190
-#: scheduler/ipp.c:9793
+#: scheduler/ipp.c:3046 scheduler/ipp.c:3454 scheduler/ipp.c:3992
+#: scheduler/ipp.c:5945 scheduler/ipp.c:6092 scheduler/ipp.c:7513
+#: scheduler/ipp.c:8632 scheduler/ipp.c:8858 scheduler/ipp.c:9207
+#: scheduler/ipp.c:9810
msgid "Got a printer-uri attribute but no job-id."
msgstr ""
msgid "Help file not in index."
msgstr ""
-#: cups/ipp.c:3157 cups/ipp.c:3184 cups/ipp.c:3207
+#: cups/ipp.c:3198 cups/ipp.c:3225 cups/ipp.c:3248
msgid "IPP 1setOf attribute with incompatible value tags."
msgstr ""
-#: cups/ipp.c:3120
+#: cups/ipp.c:3161
msgid "IPP attribute has no name."
msgstr ""
-#: cups/ipp.c:6885
+#: cups/ipp.c:7014
msgid "IPP attribute is not a member of the message."
msgstr ""
-#: cups/ipp.c:3569
+#: cups/ipp.c:3610
msgid "IPP begCollection value not 0 bytes."
msgstr ""
-#: cups/ipp.c:3350
+#: cups/ipp.c:3391
msgid "IPP boolean value not 1 byte."
msgstr ""
-#: cups/ipp.c:3411
+#: cups/ipp.c:3452
msgid "IPP date value not 11 bytes."
msgstr ""
-#: cups/ipp.c:3590
+#: cups/ipp.c:3631
msgid "IPP endCollection value not 0 bytes."
msgstr ""
-#: cups/ipp.c:3325
+#: cups/ipp.c:3366
msgid "IPP enum value not 4 bytes."
msgstr ""
-#: cups/ipp.c:3049
+#: cups/ipp.c:3090
msgid "IPP extension tag larger than 0x7FFFFFFF."
msgstr ""
-#: cups/ipp.c:3322
+#: cups/ipp.c:3363
msgid "IPP integer value not 4 bytes."
msgstr ""
-#: cups/ipp.c:3522
+#: cups/ipp.c:3563
msgid "IPP language length overflows value."
msgstr ""
-#: cups/ipp.c:3531
+#: cups/ipp.c:3572
msgid "IPP language length too large."
msgstr ""
-#: cups/ipp.c:3234
+#: cups/ipp.c:3275
msgid "IPP member name is not empty."
msgstr ""
-#: cups/ipp.c:3616
+#: cups/ipp.c:3657
msgid "IPP memberName value is empty."
msgstr ""
-#: cups/ipp.c:3608
+#: cups/ipp.c:3649
msgid "IPP memberName with no attribute."
msgstr ""
-#: cups/ipp.c:3103
+#: cups/ipp.c:3144
msgid "IPP name larger than 32767 bytes."
msgstr ""
-#: cups/ipp.c:3488
+#: cups/ipp.c:3529
msgid "IPP nameWithLanguage value less than minimum 4 bytes."
msgstr ""
-#: cups/ipp.c:3646
+#: cups/ipp.c:3687
msgid "IPP octetString length too large."
msgstr ""
-#: cups/ipp.c:3456
+#: cups/ipp.c:3497
msgid "IPP rangeOfInteger value not 8 bytes."
msgstr ""
-#: cups/ipp.c:3429
+#: cups/ipp.c:3470
msgid "IPP resolution value not 9 bytes."
msgstr ""
-#: cups/ipp.c:3549
+#: cups/ipp.c:3590
msgid "IPP string length overflows value."
msgstr ""
-#: cups/ipp.c:3484
+#: cups/ipp.c:3525
msgid "IPP textWithLanguage value less than minimum 4 bytes."
msgstr ""
-#: cups/ipp.c:3308
+#: cups/ipp.c:3349
msgid "IPP value larger than 32767 bytes."
msgstr ""
msgid "Intellitech"
msgstr ""
-#: cups/http-support.c:1345
+#: cups/http-support.c:1347
msgid "Internal Server Error"
msgstr ""
msgid "Internet Printing Protocol"
msgstr ""
-#: cups/dest-options.c:837
+#: cups/pwg-media.c:311 cups/pwg-media.c:330
+msgid "Invalid media name arguments."
+msgstr ""
+
+#: cups/dest-options.c:1052
msgid "Invalid media size."
msgstr ""
msgid "JIS B9"
msgstr ""
-#: scheduler/ipp.c:8913
+#: scheduler/ipp.c:8930
#, c-format
msgid "Job #%d cannot be restarted - no files."
msgstr ""
-#: scheduler/ipp.c:3069 scheduler/ipp.c:3303 scheduler/ipp.c:3362
-#: scheduler/ipp.c:3539 scheduler/ipp.c:3985 scheduler/ipp.c:5592
-#: scheduler/ipp.c:5968 scheduler/ipp.c:6115 scheduler/ipp.c:6404
-#: scheduler/ipp.c:7343 scheduler/ipp.c:7365 scheduler/ipp.c:7537
-#: scheduler/ipp.c:7762 scheduler/ipp.c:7805 scheduler/ipp.c:8655
-#: scheduler/ipp.c:8881 scheduler/ipp.c:9230 scheduler/ipp.c:9833
+#: scheduler/ipp.c:3086 scheduler/ipp.c:3320 scheduler/ipp.c:3379
+#: scheduler/ipp.c:3556 scheduler/ipp.c:4002 scheduler/ipp.c:5609
+#: scheduler/ipp.c:5985 scheduler/ipp.c:6132 scheduler/ipp.c:6421
+#: scheduler/ipp.c:7360 scheduler/ipp.c:7382 scheduler/ipp.c:7554
+#: scheduler/ipp.c:7779 scheduler/ipp.c:7822 scheduler/ipp.c:8672
+#: scheduler/ipp.c:8898 scheduler/ipp.c:9247 scheduler/ipp.c:9850
#, c-format
msgid "Job #%d does not exist."
msgstr ""
-#: scheduler/ipp.c:3571
+#: scheduler/ipp.c:3588
#, c-format
msgid "Job #%d is already aborted - can't cancel."
msgstr ""
-#: scheduler/ipp.c:3565
+#: scheduler/ipp.c:3582
#, c-format
msgid "Job #%d is already canceled - can't cancel."
msgstr ""
-#: scheduler/ipp.c:3577
+#: scheduler/ipp.c:3594
#, c-format
msgid "Job #%d is already completed - can't cancel."
msgstr ""
-#: scheduler/ipp.c:7563 scheduler/ipp.c:7847 scheduler/ipp.c:9848
+#: scheduler/ipp.c:7580 scheduler/ipp.c:7864 scheduler/ipp.c:9865
#, c-format
msgid "Job #%d is finished and cannot be altered."
msgstr ""
-#: scheduler/ipp.c:8895
+#: scheduler/ipp.c:8912
#, c-format
msgid "Job #%d is not complete."
msgstr ""
-#: scheduler/ipp.c:3084
+#: scheduler/ipp.c:3101
#, c-format
msgid "Job #%d is not held for authentication."
msgstr ""
-#: scheduler/ipp.c:8669
+#: scheduler/ipp.c:8686
#, c-format
msgid "Job #%d is not held."
msgstr ""
msgid "Job Stopped"
msgstr ""
-#: scheduler/ipp.c:9930
+#: scheduler/ipp.c:9947
msgid "Job is completed and cannot be changed."
msgstr ""
msgid "Job operation failed"
msgstr ""
-#: scheduler/ipp.c:9966 scheduler/ipp.c:9985 scheduler/ipp.c:9996
+#: scheduler/ipp.c:9983 scheduler/ipp.c:10002 scheduler/ipp.c:10013
msgid "Job state cannot be changed."
msgstr ""
-#: scheduler/ipp.c:8761
+#: scheduler/ipp.c:8778
msgid "Job subscriptions cannot be renewed."
msgstr ""
msgid "Label Top"
msgstr ""
-#: scheduler/ipp.c:2147 scheduler/ipp.c:5515
+#: scheduler/ipp.c:2147 scheduler/ipp.c:5532
#, c-format
msgid "Language \"%s\" not supported."
msgstr ""
msgid "Long-Edge (Portrait)"
msgstr ""
-#: cups/http-support.c:1577
+#: cups/http-support.c:1579
msgid "Looking for printer."
msgstr ""
msgid "Missing asterisk in column 1"
msgstr ""
-#: scheduler/ipp.c:5991
+#: scheduler/ipp.c:6008
msgid "Missing document-number attribute."
msgstr ""
msgid "Missing form variable"
msgstr ""
-#: scheduler/ipp.c:9284
+#: scheduler/ipp.c:9301
msgid "Missing last-document attribute in request."
msgstr ""
-#: cups/pwg-media.c:559
+#: cups/pwg-media.c:573
msgid "Missing media or media-col."
msgstr ""
-#: cups/pwg-media.c:478
+#: cups/pwg-media.c:492
msgid "Missing media-size in media-col."
msgstr ""
-#: scheduler/ipp.c:6534
+#: scheduler/ipp.c:6551
msgid "Missing notify-subscription-ids attribute."
msgstr ""
msgid "Missing option keyword"
msgstr ""
-#: scheduler/ipp.c:3210 scheduler/ipp.c:3235
+#: scheduler/ipp.c:3227 scheduler/ipp.c:3252
msgid "Missing requesting-user-name attribute."
msgstr ""
msgid "Missing value string"
msgstr ""
-#: cups/pwg-media.c:466
+#: cups/pwg-media.c:480
msgid "Missing x-dimension in media-size."
msgstr ""
-#: cups/pwg-media.c:472
+#: cups/pwg-media.c:486
msgid "Missing y-dimension in media-size."
msgstr ""
msgid "Move Job"
msgstr ""
-#: cups/http-support.c:1302
+#: cups/http-support.c:1304
msgid "Moved Permanently"
msgstr ""
msgid "No"
msgstr ""
-#: cups/http-support.c:1299
+#: cups/http-support.c:1301
msgid "No Content"
msgstr ""
msgid "No active connection"
msgstr ""
-#: scheduler/ipp.c:3488
+#: scheduler/ipp.c:3505
#, c-format
msgid "No active jobs on %s."
msgstr ""
msgid "No attributes in request."
msgstr ""
-#: scheduler/ipp.c:3111
+#: scheduler/ipp.c:3128
msgid "No authentication information provided."
msgstr ""
msgid "No community name"
msgstr ""
-#: scheduler/ipp.c:5791
+#: scheduler/ipp.c:5808
msgid "No default printer."
msgstr ""
-#: cgi-bin/ipp-var.c:436 scheduler/ipp.c:7109
+#: cgi-bin/ipp-var.c:436 scheduler/ipp.c:7126
msgid "No destinations added."
msgstr ""
msgid "No error-status"
msgstr ""
-#: scheduler/ipp.c:8051 scheduler/ipp.c:9298
+#: scheduler/ipp.c:8068 scheduler/ipp.c:9315
msgid "No file in print request."
msgstr ""
msgid "No printer-uri found for class"
msgstr ""
-#: scheduler/ipp.c:6194
+#: scheduler/ipp.c:6211
msgid "No printer-uri in request."
msgstr ""
msgid "No request-id"
msgstr ""
-#: scheduler/ipp.c:5400
+#: scheduler/ipp.c:5417
msgid "No subscription attributes in request."
msgstr ""
-#: scheduler/ipp.c:7436
+#: scheduler/ipp.c:7453
msgid "No subscriptions found."
msgstr ""
msgid "Normal"
msgstr ""
-#: cups/http-support.c:1321
+#: cups/http-support.c:1323
msgid "Not Found"
msgstr ""
-#: cups/http-support.c:1333
+#: cups/http-support.c:1335
msgid "Not Implemented"
msgstr ""
msgid "Not Installed"
msgstr ""
-#: cups/http-support.c:1308
+#: cups/http-support.c:1310
msgid "Not Modified"
msgstr ""
-#: cups/http-support.c:1336
+#: cups/http-support.c:1338
msgid "Not Supported"
msgstr ""
-#: scheduler/ipp.c:1577 scheduler/ipp.c:10529
+#: scheduler/ipp.c:1577 scheduler/ipp.c:10546
msgid "Not allowed to print."
msgstr ""
msgid "Note: this program only validates the DSC comments, not the PostScript itself."
msgstr ""
-#: cups/http-support.c:1290 cups/ppd.c:338
+#: cups/http-support.c:1292 cups/ppd.c:338
msgid "OK"
msgstr ""
msgid "Print file sent."
msgstr ""
-#: backend/ipp.c:2118
+#: backend/ipp.c:2124
msgid "Print job canceled at printer."
msgstr ""
-#: backend/ipp.c:2113
+#: backend/ipp.c:2116
msgid "Print job too large."
msgstr ""
-#: backend/ipp.c:1618
+#: backend/ipp.c:1619
msgid "Print job was not accepted."
msgstr ""
msgid "Printer Settings"
msgstr ""
-#: backend/ipp.c:2116
+#: backend/ipp.c:2119
msgid "Printer cannot print supplied content."
msgstr ""
+#: backend/ipp.c:2122
+msgid "Printer cannot print with supplied options."
+msgstr ""
+
#: cups/notify.c:126
msgid "Printer:"
msgstr ""
msgid "Quarto"
msgstr ""
-#: scheduler/ipp.c:1572 scheduler/ipp.c:10524
+#: scheduler/ipp.c:1572 scheduler/ipp.c:10541
msgid "Quota limit reached."
msgstr ""
msgid "Reprint After Error"
msgstr ""
-#: cups/http-support.c:1324
+#: cups/http-support.c:1326
msgid "Request Entity Too Large"
msgstr ""
msgid "SEQUENCE uses indefinite length"
msgstr ""
-#: cups/http-support.c:1348
+#: cups/http-support.c:1350
msgid "SSL/TLS Negotiation Error"
msgstr ""
-#: cups/http-support.c:1305
+#: cups/http-support.c:1307
msgid "See Other"
msgstr ""
-#: backend/usb-darwin.c:573 backend/usb-libusb.c:441
+#: backend/usb-darwin.c:573 backend/usb-libusb.c:443
msgid "Sending data to printer."
msgstr ""
msgid "Server Stopped"
msgstr ""
-#: cups/http-support.c:1342
+#: cups/http-support.c:1344
msgid "Service Unavailable"
msgstr ""
msgid "Stylus Photo Series"
msgstr ""
-#: scheduler/ipp.c:3634 scheduler/ipp.c:6550 scheduler/ipp.c:7249
-#: scheduler/ipp.c:8749
+#: scheduler/ipp.c:3651 scheduler/ipp.c:6567 scheduler/ipp.c:7266
+#: scheduler/ipp.c:8766
#, c-format
msgid "Subscription #%d does not exist."
msgstr ""
msgid "Super B/A3"
msgstr ""
-#: cups/http-support.c:1287
+#: cups/http-support.c:1289
msgid "Switching Protocols"
msgstr ""
msgid "The \"%s\" attribute is required for print jobs."
msgstr ""
-#: scheduler/ipp.c:6265 scheduler/ipp.c:6343 scheduler/ipp.c:6359
-#: scheduler/ipp.c:6377
+#: scheduler/ipp.c:6282 scheduler/ipp.c:6360 scheduler/ipp.c:6376
+#: scheduler/ipp.c:6394
#, c-format
msgid "The %s attribute cannot be provided with job-ids."
msgstr ""
msgid "The '%s' Job Description attribute cannot be supplied in a job creation request."
msgstr ""
-#: scheduler/ipp.c:5207
+#: scheduler/ipp.c:5224
#, c-format
msgid "The '%s' operation attribute cannot be supplied in a Create-Job request."
msgstr ""
-#: scheduler/ipp.c:6780
+#: scheduler/ipp.c:6797
#, c-format
msgid "The PPD file \"%s\" could not be found."
msgstr ""
-#: scheduler/ipp.c:6767
+#: scheduler/ipp.c:6784
#, c-format
msgid "The PPD file \"%s\" could not be opened: %s"
msgstr ""
msgid "The notify-lease-duration attribute cannot be used with job subscriptions."
msgstr ""
-#: scheduler/ipp.c:2157 scheduler/ipp.c:5525
+#: scheduler/ipp.c:2157 scheduler/ipp.c:5542
#, c-format
msgid "The notify-user-data value is too large (%d > 63 octets)."
msgstr ""
msgid "The printer name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)."
msgstr ""
-#: scheduler/ipp.c:875 scheduler/ipp.c:1135 scheduler/ipp.c:3275
-#: scheduler/ipp.c:3454 scheduler/ipp.c:5190 scheduler/ipp.c:5359
-#: scheduler/ipp.c:5673 scheduler/ipp.c:6231 scheduler/ipp.c:6985
-#: scheduler/ipp.c:7041 scheduler/ipp.c:7355 scheduler/ipp.c:7621
-#: scheduler/ipp.c:7710 scheduler/ipp.c:7743 scheduler/ipp.c:8066
-#: scheduler/ipp.c:8459 scheduler/ipp.c:8541 scheduler/ipp.c:9702
-#: scheduler/ipp.c:10156 scheduler/ipp.c:10487 scheduler/ipp.c:10569
-#: scheduler/ipp.c:10943
+#: scheduler/ipp.c:875 scheduler/ipp.c:1135 scheduler/ipp.c:3292
+#: scheduler/ipp.c:3471 scheduler/ipp.c:5207 scheduler/ipp.c:5376
+#: scheduler/ipp.c:5690 scheduler/ipp.c:6248 scheduler/ipp.c:7002
+#: scheduler/ipp.c:7058 scheduler/ipp.c:7372 scheduler/ipp.c:7638
+#: scheduler/ipp.c:7727 scheduler/ipp.c:7760 scheduler/ipp.c:8083
+#: scheduler/ipp.c:8476 scheduler/ipp.c:8558 scheduler/ipp.c:9719
+#: scheduler/ipp.c:10173 scheduler/ipp.c:10504 scheduler/ipp.c:10586
+#: scheduler/ipp.c:10960
msgid "The printer or class does not exist."
msgstr ""
msgid "The printer-uri \"%s\" contains invalid characters."
msgstr ""
-#: scheduler/ipp.c:3252
+#: scheduler/ipp.c:3269
msgid "The printer-uri attribute is required."
msgstr ""
msgid "The web interface is currently disabled. Run \"cupsctl WebInterface=yes\" to enable it."
msgstr ""
-#: scheduler/ipp.c:6326
+#: scheduler/ipp.c:6343
#, c-format
msgid "The which-jobs value \"%s\" is not supported."
msgstr ""
-#: scheduler/ipp.c:5603
+#: scheduler/ipp.c:5620
msgid "There are too many subscriptions."
msgstr ""
msgstr ""
#: backend/usb-darwin.c:412 backend/usb-darwin.c:471 backend/usb-darwin.c:535
-#: backend/usb-darwin.c:556 backend/usb-libusb.c:366 backend/usb-libusb.c:420
+#: backend/usb-darwin.c:556 backend/usb-libusb.c:368 backend/usb-libusb.c:422
msgid "There was an unrecoverable USB error."
msgstr ""
msgid "Too many job-sheets values (%d > 2)."
msgstr ""
-#: scheduler/ipp.c:2606
+#: scheduler/ipp.c:2623
#, c-format
msgid "Too many printer-state-reasons values (%d > %d)."
msgstr ""
msgid "Tray 4"
msgstr ""
-#: cups/http-support.c:1327
+#: cups/http-support.c:1329
msgid "URI Too Long"
msgstr ""
msgid "Unable to add class"
msgstr ""
-#: backend/ipp.c:1773
+#: backend/ipp.c:1774
msgid "Unable to add document to print job."
msgstr ""
msgid "Unable to cancel RSS subscription"
msgstr ""
-#: backend/ipp.c:2165
+#: backend/ipp.c:2171
msgid "Unable to cancel print job."
msgstr ""
msgid "Unable to change server settings"
msgstr ""
-#: cups/ipp.c:5276
+#: cups/ipp.c:5405
#, c-format
msgid "Unable to compile mimeMediaType regular expression: %s."
msgstr ""
-#: cups/ipp.c:5222
+#: cups/ipp.c:5351
#, c-format
msgid "Unable to compile naturalLanguage regular expression: %s."
msgstr ""
msgid "Unable to copy CUPS printer driver files (%d)."
msgstr ""
-#: scheduler/ipp.c:2726
+#: scheduler/ipp.c:2743
#, c-format
msgid "Unable to copy PPD file - %s"
msgstr ""
-#: scheduler/ipp.c:2781
+#: scheduler/ipp.c:2798
msgid "Unable to copy PPD file."
msgstr ""
msgid "Unable to copy Windows 9x printer driver files (%d)."
msgstr ""
-#: scheduler/ipp.c:2703
+#: scheduler/ipp.c:2720
#, c-format
msgid "Unable to copy interface script - %s"
msgstr ""
msgid "Unable to edit cupsd.conf files larger than 1MB"
msgstr ""
-#: cups/http.c:5473
+#: cups/http.c:5478
msgid "Unable to establish a secure connection to host (certificate chain invalid)."
msgstr ""
-#: cups/http.c:5463
+#: cups/http.c:5468
msgid "Unable to establish a secure connection to host (certificate not yet valid)."
msgstr ""
-#: cups/http.c:5458
+#: cups/http.c:5463
msgid "Unable to establish a secure connection to host (expired certificate)."
msgstr ""
-#: cups/http.c:5468
+#: cups/http.c:5473
msgid "Unable to establish a secure connection to host (host name mismatch)."
msgstr ""
-#: cups/http.c:5478
+#: cups/http.c:5483
msgid "Unable to establish a secure connection to host (peer dropped connection before responding)."
msgstr ""
-#: cups/http.c:5453
+#: cups/http.c:5458
msgid "Unable to establish a secure connection to host (self-signed certificate)."
msgstr ""
-#: cups/http.c:5448
+#: cups/http.c:5453
msgid "Unable to establish a secure connection to host (untrusted certificate)."
msgstr ""
-#: cups/http.c:5249 cups/http.c:5505 cups/http.c:5538 cups/http.c:5555
+#: cups/http.c:5254 cups/http.c:5510 cups/http.c:5543 cups/http.c:5560
msgid "Unable to establish a secure connection to host."
msgstr ""
msgid "Unable to find destination for job"
msgstr ""
-#: cups/http-support.c:1767
+#: cups/http-support.c:1769
msgid "Unable to find printer."
msgstr ""
-#: backend/ipp.c:3387
+#: backend/ipp.c:3393
msgid "Unable to get backend exit status."
msgstr ""
msgid "Unable to open device file"
msgstr ""
-#: scheduler/ipp.c:6012
+#: scheduler/ipp.c:6029
#, c-format
msgid "Unable to open document #%d in job #%d."
msgstr ""
msgid "Unable to open help file."
msgstr ""
-#: backend/ipp.c:393 backend/ipp.c:1520 backend/ipp.c:1728 backend/lpd.c:505
+#: backend/ipp.c:393 backend/ipp.c:1520 backend/ipp.c:1729 backend/lpd.c:505
#: backend/socket.c:155 backend/usb.c:237 filter/gziptoany.c:71
#: filter/pstops.c:300
msgid "Unable to open print file"
msgstr ""
#: backend/runloop.c:96 backend/runloop.c:325 backend/usb-darwin.c:643
-#: backend/usb-darwin.c:687 backend/usb-libusb.c:511 backend/usb-libusb.c:546
+#: backend/usb-darwin.c:687 backend/usb-libusb.c:513 backend/usb-libusb.c:548
msgid "Unable to read print data."
msgstr ""
msgid "Unable to send command to printer driver"
msgstr ""
-#: backend/usb-darwin.c:765 backend/usb-libusb.c:622
+#: backend/usb-darwin.c:765 backend/usb-libusb.c:624
msgid "Unable to send data to printer."
msgstr ""
msgid "Unable to set server default"
msgstr ""
-#: backend/ipp.c:3246 backend/ipp.c:3323 backend/ipp.c:3331
+#: backend/ipp.c:3252 backend/ipp.c:3329 backend/ipp.c:3337
msgid "Unable to start backend process."
msgstr ""
msgid "Unable to upload cupsd.conf file"
msgstr ""
-#: backend/usb-darwin.c:2019 backend/usb-darwin.c:2043
+#: backend/usb-darwin.c:2033 backend/usb-darwin.c:2057
msgid "Unable to use legacy USB class driver."
msgstr ""
msgid "Unable to write uncompressed print data: %s"
msgstr ""
-#: cups/http-support.c:1315
+#: cups/http-support.c:1317
msgid "Unauthorized"
msgstr ""
msgid "Units"
msgstr ""
-#: cups/http-support.c:1355 cups/ppd.c:366
+#: cups/http-support.c:1357 cups/ppd.c:366
msgid "Unknown"
msgstr ""
msgid "Unknown format character: \"%c\"."
msgstr ""
-#: cups/dest-options.c:769
+#: cups/dest-options.c:984
msgid "Unknown media size name."
msgstr ""
msgid "Unknown print mode: \"%s\"."
msgstr ""
-#: scheduler/ipp.c:10358
+#: scheduler/ipp.c:10375
#, c-format
msgid "Unknown printer-error-policy \"%s\"."
msgstr ""
-#: scheduler/ipp.c:10341
+#: scheduler/ipp.c:10358
#, c-format
msgid "Unknown printer-op-policy \"%s\"."
msgstr ""
msgid "Unknown version option value: \"%s\"."
msgstr ""
-#: scheduler/ipp.c:10814
+#: scheduler/ipp.c:10831
#, c-format
msgid "Unsupported 'compression' value \"%s\"."
msgstr ""
-#: scheduler/ipp.c:10844
+#: scheduler/ipp.c:10861
#, c-format
msgid "Unsupported 'document-format' value \"%s\"."
msgstr ""
-#: scheduler/ipp.c:10919
+#: scheduler/ipp.c:10936
msgid "Unsupported 'job-name' value."
msgstr ""
msgid "Unsupported character set \"%s\"."
msgstr ""
-#: scheduler/ipp.c:8032 scheduler/ipp.c:9263
+#: scheduler/ipp.c:8049 scheduler/ipp.c:9280
#, c-format
msgid "Unsupported compression \"%s\"."
msgstr ""
-#: scheduler/ipp.c:8166 scheduler/ipp.c:9413
+#: scheduler/ipp.c:8183 scheduler/ipp.c:9430
#, c-format
msgid "Unsupported document-format \"%s\"."
msgstr ""
-#: scheduler/ipp.c:9396
+#: scheduler/ipp.c:9413
#, c-format
msgid "Unsupported document-format \"%s/%s\"."
msgstr ""
msgid "Unsupported margins."
msgstr ""
-#: cups/pwg-media.c:553
+#: cups/pwg-media.c:567
msgid "Unsupported media value."
msgstr ""
msgid "Unsupported value type"
msgstr ""
-#: cups/http-support.c:1330
+#: cups/http-support.c:1332
msgid "Upgrade Required"
msgstr ""
msgid "Version uses indefinite length"
msgstr ""
-#: backend/ipp.c:1874
+#: backend/ipp.c:1875
msgid "Waiting for job to complete."
msgstr ""
-#: backend/usb-darwin.c:490 backend/usb-libusb.c:318
+#: backend/usb-darwin.c:490 backend/usb-libusb.c:320
msgid "Waiting for printer to become available."
msgstr ""
msgid "Warning, no Windows 2000 printer drivers are installed."
msgstr ""
-#: cups/http-support.c:1351
+#: cups/http-support.c:1353
msgid "Web Interface is Disabled"
msgstr ""
msgid "completed"
msgstr ""
-#: scheduler/ipp.c:5884
+#: scheduler/ipp.c:5901
msgid "cups-deviced failed to execute."
msgstr ""
-#: scheduler/ipp.c:6703 scheduler/ipp.c:6952
+#: scheduler/ipp.c:6720 scheduler/ipp.c:6969
msgid "cups-driverd failed to execute."
msgstr ""
msgid "ipptool: Unknown option \"-%c\"."
msgstr ""
-#: scheduler/ipp.c:7699
+#: scheduler/ipp.c:7716
msgid "job-printer-uri attribute missing."
msgstr ""
msgid "no system default destination"
msgstr ""
-#: scheduler/ipp.c:5574
+#: scheduler/ipp.c:5591
msgid "notify-events not specified."
msgstr ""
-#: scheduler/ipp.c:2111 scheduler/ipp.c:5479
+#: scheduler/ipp.c:2111 scheduler/ipp.c:5496
#, c-format
msgid "notify-recipient-uri URI \"%s\" is already used."
msgstr ""
-#: scheduler/ipp.c:2101 scheduler/ipp.c:5469
+#: scheduler/ipp.c:2101 scheduler/ipp.c:5486
#, c-format
msgid "notify-recipient-uri URI \"%s\" uses unknown scheme."
msgstr ""
"Internet Postage 2-Part" = "Internet Postage 2-Part";
"Internet Postage 3-Part" = "Internet Postage 3-Part";
"Internet Printing Protocol" = "Internet Printing Protocol";
+"Invalid media name arguments." = "Invalid media name arguments.";
"Invalid media size." = "Invalid media size.";
"Invalid printer command \"%s\"." = "Invalid printer command \"%s\".";
"JCL" = "JCL";
"Printer Paused" = "Printer Paused";
"Printer Settings" = "Printer Settings";
"Printer cannot print supplied content." = "Printer cannot print supplied content.";
+"Printer cannot print with supplied options." = "Printer cannot print with supplied options.";
"Printer:" = "Printer:";
"Printers" = "Printers";
"Printing page %d, %d%% complete." = "Printing page %d, %d%% complete.";
msgstr ""
"Project-Id-Version: CUPS 1.4.6\n"
"Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2013-03-08 13:23-0500\n"
+"POT-Creation-Date: 2013-03-20 15:42-0400\n"
"PO-Revision-Date: 2012-09-29 11:21+0200\n"
"Last-Translator: Àngel Mompó <mecatxis@gmail.com>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
msgid "Internet Printing Protocol"
msgstr "Protocol d'impressió per Internet"
+msgid "Invalid media name arguments."
+msgstr ""
+
msgid "Invalid media size."
msgstr "Mida del suport no vàlida."
msgid "Printer cannot print supplied content."
msgstr "La impressora no pot imprimir el contingut subministrat."
+msgid "Printer cannot print with supplied options."
+msgstr ""
+
msgid "Printer:"
msgstr "Impressora:"
msgstr ""
"Project-Id-Version: CUPS 1.6\n"
"Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2013-03-08 13:23-0500\n"
+"POT-Creation-Date: 2013-03-20 15:42-0400\n"
"PO-Revision-Date: 2012-07-01 20:21+0100\n"
"Last-Translator: Juan Pablo González Riopedre <riopedre13@yahoo.es>\n"
"Language-Team: Spanish\n"
msgid "Internet Printing Protocol"
msgstr "Protocolo de Impresión de Internet IPP"
+msgid "Invalid media name arguments."
+msgstr ""
+
msgid "Invalid media size."
msgstr "Tamaño del papel no válido"
msgid "Printer cannot print supplied content."
msgstr "La impresora no puede imprimir el contenido suministrado."
+msgid "Printer cannot print with supplied options."
+msgstr ""
+
msgid "Printer:"
msgstr "Impresora:"
msgstr ""
"Project-Id-Version: CUPS 1.6\n"
"Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2013-03-08 13:23-0500\n"
+"POT-Creation-Date: 2013-03-20 15:42-0400\n"
"PO-Revision-Date: 2012-12-12 11:12+0100\n"
"Last-Translator: denis meramdjougoma <dcmeram@libertysurf.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Internet Printing Protocol"
msgstr "Internet Printing Protocol"
+msgid "Invalid media name arguments."
+msgstr ""
+
msgid "Invalid media size."
msgstr ""
msgid "Printer cannot print supplied content."
msgstr ""
+msgid "Printer cannot print with supplied options."
+msgstr ""
+
msgid "Printer:"
msgstr "Imprimante :"
msgstr ""
"Project-Id-Version: CUPS 1.6\n"
"Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2013-03-08 13:23-0500\n"
+"POT-Creation-Date: 2013-03-20 15:42-0400\n"
"PO-Revision-Date: 2012-06-13 01:20+0900\n"
"Last-Translator: OPFC TRANSCUPS <opfc-transcups@sourceforge.jp>\n"
"Language-Team: OPFC TRANSCUPS <opfc-transcups@sourceforge.jp>\n"
msgid "Internet Printing Protocol"
msgstr "インターネット印刷プロトコル"
+msgid "Invalid media name arguments."
+msgstr ""
+
msgid "Invalid media size."
msgstr "無効なメディアサイズです。"
msgid "Printer cannot print supplied content."
msgstr "プリンターは受信した内容を印刷できませんでした。"
+msgid "Printer cannot print with supplied options."
+msgstr ""
+
msgid "Printer:"
msgstr "プリンター:"
msgstr ""
"Project-Id-Version: CUPS 1.4\n"
"Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2013-03-08 13:23-0500\n"
+"POT-Creation-Date: 2013-03-20 15:42-0400\n"
"PO-Revision-Date: 2009-02-16 12:00-0800\n"
"Last-Translator: Apple Inc.\n"
"Language-Team: Apple Inc.\n"
msgid "Internet Printing Protocol"
msgstr "Протокол интернет-печати"
+msgid "Invalid media name arguments."
+msgstr ""
+
msgid "Invalid media size."
msgstr ""
msgid "Printer cannot print supplied content."
msgstr ""
+msgid "Printer cannot print with supplied options."
+msgstr ""
+
msgid "Printer:"
msgstr "Принтер:"
$(CXX) -MM $(ALL_CXXFLAGS) $(CXXOBJS:.o=.cxx) >>Dependencies
+#
+# Run oclint to check code coverage...
+#
+
+oclint:
+ oclint -o=oclint.html -html $(CUPSDOBJS:.o=.c) $(LIBOBJS:.o=.c) -- $(ALL_CFLAGS)
+
+
#
# Install all targets...
#
socklen_t peersize; /* Size of peer credentials */
#ifdef HAVE_AUTHORIZATION_H
const char *name; /* Authorizing name */
+ int no_peer = 0; /* Don't allow peer credentials? */
+
+ /*
+ * See if we should allow peer credentials...
+ */
for (name = (char *)cupsArrayFirst(con->best->names);
name;
name = (char *)cupsArrayNext(con->best->names))
+ {
if (!_cups_strncasecmp(name, "@AUTHKEY(", 9) ||
!_cups_strcasecmp(name, "@SYSTEM"))
{
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "[Client %d] PeerCred authentication not allowed for "
- "resource.", con->http.fd);
- return;
+ /* Normally don't want peer credentials if we need an auth key... */
+ no_peer = 1;
}
+ else if (!_cups_strcasecmp(name, "@OWNER"))
+ {
+ /* but if @OWNER is present then we allow it... */
+ no_peer = 0;
+ break;
+ }
+ }
+
+ if (no_peer)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "[Client %d] PeerCred authentication not allowed for "
+ "resource per AUTHKEY policy.", con->http.fd);
+ return;
+ }
#endif /* HAVE_AUTHORIZATION_H */
if ((pwd = getpwnam(authorization + 9)) == NULL)
{
if (httpAddrLocalhost(&temp))
strlcpy(con->servername, "localhost", sizeof(con->servername));
- else if (HostNameLookups || RemotePort)
+ else if (HostNameLookups)
httpAddrLookup(&temp, con->servername, sizeof(con->servername));
else
httpAddrString(&temp, con->servername, sizeof(con->servername));
{
case HTTP_STATE_GET_SEND :
if ((!strncmp(con->uri, "/ppd/", 5) ||
- !strncmp(con->uri, "/printers/", 10)) &&
+ !strncmp(con->uri, "/printers/", 10) ||
+ !strncmp(con->uri, "/classes/", 9)) &&
!strcmp(con->uri + strlen(con->uri) - 4, ".ppd"))
{
/*
if (!strncmp(con->uri, "/ppd/", 5))
p = cupsdFindPrinter(con->uri + 5);
- else
+ else if (!strncmp(con->uri, "/printers/", 10))
p = cupsdFindPrinter(con->uri + 10);
+ else
+ {
+ p = cupsdFindClass(con->uri + 9);
+
+ if (p)
+ {
+ int i; /* Looping var */
+
+ for (i = 0; i < p->num_printers; i ++)
+ {
+ if (!(p->printers[i]->type & CUPS_PRINTER_CLASS))
+ {
+ char ppdname[1024];/* PPD filename */
+
+ snprintf(ppdname, sizeof(ppdname), "%s/ppd/%s.ppd",
+ ServerRoot, p->printers[i]->name);
+ if (!access(ppdname, 0))
+ {
+ p = p->printers[i];
+ break;
+ }
+ }
+ }
+
+ if (i >= p->num_printers)
+ p = NULL;
+ }
+ }
if (p)
{
else if (!strncmp(con->uri, "/printers/", 10))
p = cupsdFindPrinter(con->uri + 10);
else
- p = cupsdFindClass(con->uri + 9);
+ {
+ p = cupsdFindClass(con->uri + 9);
+
+ if (p)
+ {
+ int i; /* Looping var */
+
+ for (i = 0; i < p->num_printers; i ++)
+ {
+ if (!(p->printers[i]->type & CUPS_PRINTER_CLASS))
+ {
+ char ppdname[1024];/* PPD filename */
+
+ snprintf(ppdname, sizeof(ppdname), "%s/ppd/%s.ppd",
+ ServerRoot, p->printers[i]->name);
+ if (!access(ppdname, 0))
+ {
+ p = p->printers[i];
+ break;
+ }
+ }
+ }
+
+ if (i >= p->num_printers)
+ p = NULL;
+ }
+ }
if (p)
snprintf(con->uri, sizeof(con->uri), "/icons/%s.png", p->name);
return;
}
+ if (data_ready(con))
+ continue;
break;
}
else
con->http.hostname);
#ifdef HAVE_GSSAPI
else if (auth_type == CUPSD_AUTH_NEGOTIATE)
+ {
+# ifdef AF_LOCAL
+ if (_httpAddrFamily(con->http.hostaddr) == AF_LOCAL)
+ strlcpy(auth_str, "Basic realm=\"CUPS\"", sizeof(auth_str));
+ else
+# endif /* AF_LOCAL */
strlcpy(auth_str, "Negotiate", sizeof(auth_str));
+ }
#endif /* HAVE_GSSAPI */
if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE &&
AccessLogLevel = CUPSD_ACCESSLOG_ACTIONS;
ConfigFilePerm = CUPS_DEFAULT_CONFIG_FILE_PERM;
FatalErrors = parse_fatal_errors(CUPS_DEFAULT_FATAL_ERRORS);
- default_auth_type = CUPSD_AUTH_BASIC;
+ default_auth_type = CUPSD_AUTH_BASIC;
#ifdef HAVE_SSL
DefaultEncryption = HTTP_ENCRYPT_REQUIRED;
SSLOptions = CUPSD_SSL_NONE;
cupsdClearString(&DefaultPolicy);
#ifdef HAVE_AUTHORIZATION_H
- cupsdClearString(&SystemGroupAuthKey);
+ cupsdSetString(&SystemGroupAuthKey, CUPS_DEFAULT_SYSTEM_AUTHKEY);
#endif /* HAVE_AUTHORIZATION_H */
MaxSubscriptions = 100;
!_cups_strcasecmp(line, "TempDir") ||
!_cups_strcasecmp(line, "User"))
{
- cupsdLogMessage(CUPSD_LOG_WARN,
+ cupsdLogMessage(CUPSD_LOG_INFO,
"Please move \"%s%s%s\" on line %d of %s to the %s file; "
"this will become an error in a future release.",
line, value ? " " : "", value ? value : "", linenum,
# ifndef SANDBOX_NAMED_EXTERNAL
# define SANDBOX_NAMED_EXTERNAL 0x0003
# endif /* !SANDBOX_NAMED_EXTERNAL */
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif /* HAVE_SANDBOX_H */
}
#ifdef HAVE_SANDBOX_H
-# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
/*
* Run in a separate security profile...
*/
{
int i; /* Looping var */
const char *argv[8], /* Command-line arguments */
- *envp[16], /* Environment variables */
+ *envp[17], /* Environment variables */
*temp; /* Temporary string */
char *optstr, /* Filter options */
content_type[1024], /* CONTENT_TYPE */
cups_fontpath[1024], /* CUPS_FONTPATH */
cups_serverbin[1024], /* CUPS_SERVERBIN */
cups_serverroot[1024], /* CUPS_SERVERROOT */
+ final_content_type[1024] = "",
+ /* FINAL_CONTENT_TYPE */
lang[1024], /* LANG */
path[1024], /* PATH */
ppd[1024], /* PPD */
cups_dest_t *dest; /* Destination information */
+ /*
+ * Figure out the final content type...
+ */
+
+ for (filter = (mime_filter_t *)cupsArrayLast(filters);
+ filter && filter->dst;
+ filter = (mime_filter_t *)cupsArrayPrev(filters))
+ if (strcmp(filter->dst->super, "printer"))
+ break;
+
+ if (filter && filter->dst)
+ {
+ const char *ptr; /* Pointer in type name */
+
+ if ((ptr = strchr(filter->dst->type, '/')) != NULL)
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=%s", ptr + 1);
+ else
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=%s/%s", filter->dst->super,
+ filter->dst->type);
+ }
+
+ /*
+ * Remove NULL ("-") filters...
+ */
+
+ for (filter = (mime_filter_t *)cupsArrayFirst(filters);
+ filter;
+ filter = (mime_filter_t *)cupsArrayNext(filters))
+ if (!strcmp(filter->filter, "-"))
+ cupsArrayRemove(filters, filter);
+
/*
* Setup the filter environment and command-line...
*/
envp[12] = rip_max_cache;
envp[13] = userenv;
envp[14] = "CHARSET=utf-8";
- envp[15] = NULL;
+ if (final_content_type[0])
+ {
+ envp[15] = final_content_type;
+ envp[16] = NULL;
+ }
+ else
+ envp[15] = NULL;
for (i = 0; argv[i]; i ++)
fprintf(stderr, "DEBUG: argv[%d]=\"%s\"\n", i, argv[i]);
http_uri_status_t uri_status; /* URI separation status */
char old_device_uri[1024];
/* Old device URI */
+ static const char * const uri_status_strings[] =
+ {
+ "URI too large.",
+ "Bad arguments to function.",
+ "Bad resource path.",
+ "Bad port number.",
+ "Bad hostname/address.",
+ "Bad username/password.",
+ "Bad URI scheme.",
+ "Bad URI.",
+ "OK",
+ "Missing URI scheme.",
+ "Unknown URI scheme",
+ "Missing resource path."
+ };
need_restart_job = 1;
host, sizeof(host), &port,
resource, sizeof(resource));
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "%s device-uri: %s", printer->name,
+ uri_status_strings[uri_status - HTTP_URI_STATUS_OVERFLOW]);
+
if (uri_status < HTTP_URI_OK)
{
send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri \"%s\"."),
attr->values[0].string.text);
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "add_printer: httpSeparateURI returned %d", uri_status);
return;
}
/* CONTENT_TYPE env variable */
device_uri[1024],
/* DEVICE_URI env variable */
- final_content_type[1024],
+ final_content_type[1024] = "",
/* FINAL_CONTENT_TYPE env variable */
lang[255], /* LANG env variable */
#ifdef __APPLE__
memset(job->filters, 0, sizeof(job->filters));
-
if (job->printer->raw)
{
/*
goto abort_job;
}
+ /*
+ * Figure out the final content type...
+ */
+
+ cupsdLogJob(job, CUPSD_LOG_DEBUG, "%d filters for job:",
+ cupsArrayCount(filters));
+ for (filter = (mime_filter_t *)cupsArrayFirst(filters);
+ filter;
+ filter = (mime_filter_t *)cupsArrayNext(filters))
+ cupsdLogJob(job, CUPSD_LOG_DEBUG, "%s (%s/%s to %s/%s, cost %d)",
+ filter->filter,
+ filter->src ? filter->src->super : "???",
+ filter->src ? filter->src->type : "???",
+ filter->dst ? filter->dst->super : "???",
+ filter->dst ? filter->dst->type : "???",
+ filter->cost);
+
+ if (!job->printer->remote)
+ {
+ for (filter = (mime_filter_t *)cupsArrayLast(filters);
+ filter && filter->dst;
+ filter = (mime_filter_t *)cupsArrayPrev(filters))
+ if (strcmp(filter->dst->super, "printer") ||
+ strcmp(filter->dst->type, job->printer->name))
+ break;
+
+ if (filter && filter->dst)
+ {
+ if ((ptr = strchr(filter->dst->type, '/')) != NULL)
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=%s", ptr + 1);
+ else
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=%s/%s", filter->dst->super,
+ filter->dst->type);
+ }
+ }
+
/*
* Remove NULL ("-") filters...
*/
envp[envc ++] = banner_page ? "CUPS_FILETYPE=job-sheet" :
"CUPS_FILETYPE=document";
- if (!job->printer->remote && !job->printer->raw)
- {
- filter = (mime_filter_t *)cupsArrayLast(filters);
-
- if (job->printer->port_monitor)
- filter = (mime_filter_t *)cupsArrayPrev(filters);
-
- if (filter && filter->dst)
- {
- if ((ptr = strchr(filter->dst->type, '/')) != NULL)
- snprintf(final_content_type, sizeof(final_content_type),
- "FINAL_CONTENT_TYPE=%s", ptr + 1);
- else
- snprintf(final_content_type, sizeof(final_content_type),
- "FINAL_CONTENT_TYPE=%s/%s", filter->dst->super,
- filter->dst->type);
- envp[envc ++] = final_content_type;
- }
- }
+ if (final_content_type[0])
+ envp[envc ++] = final_content_type;
if (Classification && !banner_page)
{
job_state = IPP_JOB_COMPLETED;
message = "Job completed.";
- ippSetString(job->attrs, &job->reasons, 0,
- "job-completed-successfully");
+ if (!job->status)
+ ippSetString(job->attrs, &job->reasons, 0,
+ "job-completed-successfully");
break;
case IPP_JOB_STOPPED :
* Hold the job...
*/
- cupsdSetJobHoldUntil(job, "indefinite", 1);
- ippSetString(job->attrs, &job->reasons, 0,
- "job-hold-until-specified");
+ const char *reason = ippGetString(job->reasons, 0, NULL);
- job_state = IPP_JOB_HELD;
- message = "Job held indefinitely due to backend errors; please "
+ cupsdLogJob(job, CUPSD_LOG_DEBUG, "job-state-reasons=\"%s\"",
+ reason);
+
+ if (!reason || strncmp(reason, "account-", 8))
+ {
+ cupsdSetJobHoldUntil(job, "indefinite", 1);
+
+ ippSetString(job->attrs, &job->reasons, 0,
+ "job-hold-until-specified");
+ message = "Job held indefinitely due to backend errors; please "
"consult the error_log file for details.";
+ }
+ else if (!strcmp(reason, "account-info-needed"))
+ {
+ cupsdSetJobHoldUntil(job, "indefinite", 0);
+
+ message = "Job held indefinitely - account information is "
+ "required.";
+ }
+ else if (!strcmp(reason, "account-closed"))
+ {
+ cupsdSetJobHoldUntil(job, "indefinite", 0);
+
+ message = "Job held indefinitely - account has been closed.";
+ }
+ else if (!strcmp(reason, "account-limit-reached"))
+ {
+ cupsdSetJobHoldUntil(job, "indefinite", 0);
+
+ message = "Job held indefinitely - account limit has been "
+ "reached.";
+ }
+ else
+ {
+ cupsdSetJobHoldUntil(job, "indefinite", 0);
+
+ message = "Job held indefinitely - account authorization failed.";
+ }
+
+ job_state = IPP_JOB_HELD;
}
break;
for (i = 0, name = (char *)cupsArrayFirst(p->users);
name;
i ++, name = (char *)cupsArrayNext(p->users))
- attr->values[i].string.text = _cupsStrRetain(name);
+ attr->values[i].string.text = _cupsStrAlloc(name);
}
ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
for (i = 0; i < p->num_printers; i ++)
{
if (attr != NULL)
- attr->values[i].string.text = _cupsStrRetain(p->printers[i]->name);
+ attr->values[i].string.text = _cupsStrAlloc(p->printers[i]->name);
p->type &= ~CUPS_PRINTER_OPTIONS | p->printers[i]->type;
}
{
for (i = 0; i < oldattr->num_values; i ++)
attr->values[i].string.text =
- _cupsStrRetain(oldattr->values[i].string.text);
+ _cupsStrAlloc(oldattr->values[i].string.text);
}
}
{
for (i = 0; i < oldattr->num_values; i ++)
attr->values[i].string.text =
- _cupsStrRetain(oldattr->values[i].string.text);
+ _cupsStrAlloc(oldattr->values[i].string.text);
}
}
{
for (i = 0; i < oldattr->num_values; i ++)
attr->values[i].string.text =
- _cupsStrRetain(oldattr->values[i].string.text);
+ _cupsStrAlloc(oldattr->values[i].string.text);
}
}
for (i = p->pc->num_sizes, pwgsize = p->pc->sizes;
i > 0;
i --, pwgsize ++, val ++)
- val->string.text = _cupsStrRetain(pwgsize->map.pwg);
+ val->string.text = _cupsStrAlloc(pwgsize->map.pwg);
if (p->pc->custom_min_keyword)
{
- val->string.text = _cupsStrRetain(p->pc->custom_min_keyword);
+ val->string.text = _cupsStrAlloc(p->pc->custom_min_keyword);
val ++;
- val->string.text = _cupsStrRetain(p->pc->custom_max_keyword);
+ val->string.text = _cupsStrAlloc(p->pc->custom_max_keyword);
}
}
val = attr->values;
i > 0;
i --, pwgsource ++, val ++)
- val->string.text = _cupsStrRetain(pwgsource->pwg);
+ val->string.text = _cupsStrAlloc(pwgsource->pwg);
}
/*
val = attr->values;
i > 0;
i --, pwgtype ++, val ++)
- val->string.text = _cupsStrRetain(pwgtype->pwg);
+ val->string.text = _cupsStrAlloc(pwgtype->pwg);
}
/*
mandatory = (char *)cupsArrayFirst(p->pc->mandatory);
mandatory;
val ++, mandatory = (char *)cupsArrayNext(p->pc->mandatory))
- val->string.text = _cupsStrRetain(mandatory);
+ val->string.text = _cupsStrAlloc(mandatory);
}
/*
*
* PPD test program for CUPS.
*
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
{
is_ok = 1;
width_2540ths = (size->length > size->width) ?
- _PWG_FROMPTS(size->width) :
- _PWG_FROMPTS(size->length);
+ PWG_FROM_POINTS(size->width) :
+ PWG_FROM_POINTS(size->length);
length_2540ths = (size->length > size->width) ?
- _PWG_FROMPTS(size->length) :
- _PWG_FROMPTS(size->width);
+ PWG_FROM_POINTS(size->length) :
+ PWG_FROM_POINTS(size->width);
pwg_media = _pwgMediaForSize(width_2540ths, length_2540ths);
if (pwg_media &&
ipp-everywhere.test \
print-job.test \
print-job-deflate.test \
- print-job-gzip.test
+ print-job-gzip.test \
+ validate-job.test
OBJS = \
ippserver.o \
ipptool.o \
else if (status != HTTP_OK)
{
httpFlush(http);
+
+ if (status == HTTP_STATUS_UNAUTHORIZED)
+ continue;
+
break;
}
}
--- /dev/null
+# Validate a test page using Validate-Job
+{
+ # The name of the test...
+ NAME "Validate file/ticket using Validate-Job"
+
+ # The operation to use
+ OPERATION Validate-Job
+
+ # Attributes, starting in the operation group...
+ GROUP operation-attributes-tag
+ ATTR charset attributes-charset utf-8
+ ATTR language attributes-natural-language en
+ ATTR uri printer-uri $uri
+ ATTR name requesting-user-name $user
+ ATTR mimeMediaType document-format $filetype
+
+ GROUP job-attributes-tag
+ ATTR integer copies 1
+
+ # What statuses are OK?
+ STATUS successful-ok
+ STATUS successful-ok-ignored-or-substituted-attributes
+}
273BF6B81333B4A90022CAAB /* tests */,
72220EAF1333047D00FCA411 /* Products */,
);
+ indentWidth = 2;
sourceTree = "<group>";
+ tabWidth = 8;
+ wrapsLines = 0;
};
72F75A681336FA42004BB496 /* libcupsimage */ = {
isa = PBXGroup;