-CHANGES.txt - 2006-10-20
+CHANGES.txt - 2006-11-02
------------------------
+CHANGES IN CUPS V1.2.6
+
+ - The web interface was not localized on Mac OS X (STR
+ #2075)
+ - "lpc status" did not show the number of queued jobs for
+ disabled queues (STR #2069)
+ - The lpstat program could hang (STR #2073)
+ - The serial backend did not support the new USB serial
+ filenames on Linux (STR #2061)
+ - The parallel backend did not support bidirectional I/O
+ properly (STR #2056)
+ - The network backends now log the numeric address that
+ is being used (STR #2046)
+ - Fixed a compile error when using libpaper.
+ - Fixed a compile error when compiling on Solaris with
+ threading enabled (STR #2049, STR #2050)
+ - Missing printer-state-changed event for
+ printer-state-message updates (STR #2047)
+
+
CHANGES IN CUPS V1.2.5
- Documentation updates (STR #2038)
-INSTALL - CUPS v1.2.5 - 2006-10-20
+INSTALL - CUPS v1.2.6 - 2006-11-06
----------------------------------
This file describes how to compile and install CUPS from source
Apple operating systems and the OpenSSL toolkit. A copy of the
exceptions and licenses follow this introduction.
-The GNU LGPL applies to the CUPS API library, located in the
-"cups" subdirectory of the CUPS source distribution and in the
-"cups" include directory and library files in the binary
-distributions. The GNU GPL applies to the remainder of the CUPS
-distribution, including the "pdftops" filter which is based upon
-Xpdf and the CUPS imaging library.
+The GNU LGPL applies to the CUPS and CUPS Imaging libraries
+located in the "cups" and "filter" subdirectories of the CUPS
+source distribution and in the "cups" include directory and
+library files in the binary distributions. The GNU GPL applies to
+the remainder of the CUPS distribution, including the "pdftops"
+filter which is based upon Xpdf.
For those not familiar with the GNU GPL, the license basically
allows you to:
binary form.
- Sell verbatim copies of the software for a media fee, or
sell support for the software.
- - Distribute or sell printer drivers and filters that use
- CUPS so long as source code is made available under the
- GPL.
What this license *does not* allow you to do is make changes or
add features to CUPS and then sell a binary distribution without
-source code. You must provide source for any new drivers,
-changes, or additions to the software, and all code must be
-provided under the GPL or LGPL as appropriate. The only
-exceptions to this are the portions of the CUPS software covered
-by the Apple operating system license exceptions outlined later
-in this license agreement.
+source code. You must provide source for any changes or additions
+to the software, and all code must be provided under the GPL or
+LGPL as appropriate. The only exceptions to this are the portions
+of the CUPS software covered by the Apple operating system
+license exceptions outlined later in this license agreement.
The GNU LGPL relaxes the "link-to" restriction, allowing you to
-develop applications that use the CUPS API library under other
-licenses and/or conditions as appropriate for your application.
+develop applications that use the CUPS and CUPS Imaging libraries
+under other licenses and/or conditions as appropriate for your
+application, driver, or filter.
LICENSE EXCEPTIONS
Easy Software Products also sells rights to the CUPS source code
under a binary distribution license for vendors that are unable
-to release source code for their drivers, additions, and
-modifications to CUPS under the GNU GPL and LGPL. For
-information please contact us at the address shown above.
+to release source code for their additions and modifications to
+CUPS under the GNU GPL and LGPL. For information please contact
+us at the address shown above.
The Common UNIX Printing System provides a "pdftops" filter that
is based on the Xpdf software. For binary distribution licensing
-README - CUPS v1.2.5 - 2006-10-20
+README - CUPS v1.2.6 - 2006-11-06
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
#
-# "$Id: Makefile 5591 2006-05-26 19:51:59Z mike $"
+# "$Id: Makefile 6061 2006-10-23 00:26:52Z mike $"
#
# Backend makefile for the Common UNIX Printing System (CUPS).
#
#
clean:
- $(RM) $(OBJS) $(TARGETS) http
+ $(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http
#
#
-# End of "$Id: Makefile 5591 2006-05-26 19:51:59Z mike $".
+# End of "$Id: Makefile 6061 2006-10-23 00:26:52Z mike $".
#
/*
- * "$Id: ipp.c 5956 2006-09-13 18:22:34Z mike $"
+ * "$Id: ipp.c 6061 2006-10-23 00:26:52Z mike $"
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
hostname[1024], /* Hostname */
username[255], /* Username info */
resource[1024], /* Resource info (printer name) */
+ addrname[256], /* Address name */
*optptr, /* Pointer to URI options */
name[255], /* Name of option */
value[255], /* Value of option */
fputs("STATE: -connecting-to-device\n", stderr);
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
+#ifdef AF_INET6
+ if (http->hostaddr->addr.sa_family == AF_INET6)
+ fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
+ httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
+ ntohs(http->hostaddr->ipv6.sin6_port));
+ else
+#endif /* AF_INET6 */
+ if (http->hostaddr->addr.sa_family == AF_INET)
+ fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
+ httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
+ ntohs(http->hostaddr->ipv4.sin_port));
+
/*
* Build a URI for the printer and fill the standard IPP attributes for
* an IPP_PRINT_FILE request. We can't use the URI in argv[0] because it
/*
- * End of "$Id: ipp.c 5956 2006-09-13 18:22:34Z mike $".
+ * End of "$Id: ipp.c 6061 2006-10-23 00:26:52Z mike $".
*/
/*
- * "$Id: lpd.c 5886 2006-08-24 19:53:17Z mike $"
+ * "$Id: lpd.c 6061 2006-10-23 00:26:52Z mike $"
*
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
*
*cptr; /* Pointer into control file string */
char status; /* Status byte from command */
char portname[255]; /* Port name */
+ char addrname[256]; /* Address name */
http_addrlist_t *addrlist, /* Address list */
*addr; /* Socket address */
int copy; /* Copies written */
fputs("STATE: -connecting-to-device\n", stderr);
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
- fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
- lport);
+
+#ifdef AF_INET6
+ if (addr->addr.addr.sa_family == AF_INET6)
+ fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6) (local port %d)...\n",
+ httpAddrString(&addr->addr, addrname, sizeof(addrname)),
+ ntohs(addr->addr.ipv6.sin6_port), lport);
+ else
+#endif /* AF_INET6 */
+ if (addr->addr.addr.sa_family == AF_INET)
+ fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4) (local port %d)...\n",
+ httpAddrString(&addr->addr, addrname, sizeof(addrname)),
+ ntohs(addr->addr.ipv4.sin_port), lport);
/*
* Next, open the print file and figure out its size...
/*
- * End of "$Id: lpd.c 5886 2006-08-24 19:53:17Z mike $".
+ * End of "$Id: lpd.c 6061 2006-10-23 00:26:52Z mike $".
*/
/*
- * "$Id: parallel.c 5726 2006-07-12 20:00:11Z mike $"
+ * "$Id: parallel.c 6068 2006-10-27 17:10:34Z mike $"
*
* Parallel port backend for the Common UNIX Printing System (CUPS).
*
*options; /* Pointer to options */
int port; /* Port number (not used) */
int print_fd, /* Print file */
- device_fd; /* Parallel device */
+ device_fd, /* Parallel device */
+ use_bc; /* Read back-channel data? */
int copies; /* Number of copies to print */
size_t tbytes; /* Total number of bytes written */
struct termios opts; /* Parallel port options */
do
{
- if ((device_fd = open(resource, O_WRONLY | O_EXCL)) == -1)
+#ifdef __linux
+ /*
+ * The Linux parallel port driver currently is broken WRT select()
+ * and bidirection I/O...
+ */
+
+ device_fd = open(resource, O_WRONLY | O_EXCL);
+ use_bc = 0;
+
+#else
+ if ((device_fd = open(resource, O_RDWR | O_EXCL)) < 0)
+ {
+ device_fd = open(resource, O_WRONLY | O_EXCL);
+ use_bc = 0;
+ }
+ else
+ use_bc = 1;
+#endif /* __linux */
+
+ if (device_fd == -1)
{
if (getenv("CLASS") != NULL)
{
lseek(print_fd, 0, SEEK_SET);
}
- tbytes = backendRunLoop(print_fd, device_fd, 1);
+ tbytes = backendRunLoop(print_fd, device_fd, use_bc);
if (print_fd != 0 && tbytes >= 0)
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
/*
- * End of "$Id: parallel.c 5726 2006-07-12 20:00:11Z mike $".
+ * End of "$Id: parallel.c 6068 2006-10-27 17:10:34Z mike $".
*/
/*
- * "$Id: serial.c 5597 2006-05-30 14:29:12Z mike $"
+ * "$Id: serial.c 6068 2006-10-27 17:10:34Z mike $"
*
* Serial port backend for the Common UNIX Printing System (CUPS).
*
printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
device, i + 1);
}
+
+ sprintf(device, "/dev/ttyUSB%d", i);
+ if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
+ {
+ close(fd);
+ printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
+ device, i + 1);
+ }
}
for (i = 0; i < 64; i ++)
/*
- * End of "$Id: serial.c 5597 2006-05-30 14:29:12Z mike $".
+ * End of "$Id: serial.c 6068 2006-10-27 17:10:34Z mike $".
*/
/*
- * "$Id: socket.c 5948 2006-09-12 13:58:39Z mike $"
+ * "$Id: socket.c 6061 2006-10-23 00:26:52Z mike $"
*
* AppSocket backend for the Common UNIX Printing System (CUPS).
*
int delay; /* Delay for retries... */
int device_fd; /* AppSocket */
int error; /* Error code (if any) */
- http_addrlist_t *addrlist; /* Address list */
+ http_addrlist_t *addrlist, /* Address list */
+ *addr; /* Connected address */
+ char addrname[256]; /* Address name */
ssize_t tbytes; /* Total number of bytes written */
struct timeval timeout; /* Timeout for select() */
fd_set input; /* Input set for select() */
for (delay = 5;;)
{
- if (!httpAddrConnect(addrlist, &device_fd))
+ if ((addr = httpAddrConnect(addrlist, &device_fd)) == NULL)
{
error = errno;
device_fd = -1;
}
fputs("STATE: -connecting-to-device\n", stderr);
+ fprintf(stderr, "INFO: Connected to %s...\n", hostname);
+
+#ifdef AF_INET6
+ if (addr->addr.addr.sa_family == AF_INET6)
+ fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
+ httpAddrString(&addr->addr, addrname, sizeof(addrname)),
+ ntohs(addr->addr.ipv6.sin6_port));
+ else
+#endif /* AF_INET6 */
+ if (addr->addr.addr.sa_family == AF_INET)
+ fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
+ httpAddrString(&addr->addr, addrname, sizeof(addrname)),
+ ntohs(addr->addr.ipv4.sin_port));
/*
* Print everything...
/*
- * End of "$Id: socket.c 5948 2006-09-12 13:58:39Z mike $".
+ * End of "$Id: socket.c 6061 2006-10-23 00:26:52Z mike $".
*/
/*
- * "$Id: lpc.c 5926 2006-09-05 20:45:47Z mike $"
+ * "$Id: lpc.c 6073 2006-11-02 20:01:54Z mike $"
*
* "lpc" command for the Common UNIX Printing System (CUPS).
*
const char *dests) /* I - Destinations */
{
ipp_t *request, /* IPP Request */
- *response, /* IPP Response */
- *jobs; /* IPP Get Jobs response */
- ipp_attribute_t *attr, /* Current attribute */
- *jattr; /* Current job attribute */
+ *response; /* IPP Response */
+ ipp_attribute_t *attr; /* Current attribute */
cups_lang_t *language; /* Default language */
char *printer, /* Printer name */
*device, /* Device URI */
const char *dptr, /* Pointer into destination list */
*ptr; /* Pointer into printer name */
int match; /* Non-zero if this job matches */
- char printer_uri[HTTP_MAX_URI];
- /* Printer URI */
static const char *requested[] = /* Requested attributes */
{
- "printer-name",
"device-uri",
+ "printer-is-accepting-jobs",
+ "printer-name",
"printer-state",
- "printer-is-accepting-jobs"
+ "queued-job-count"
};
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
{
- if (!strcmp(attr->name, "printer-name") &&
- attr->value_tag == IPP_TAG_NAME)
- printer = attr->values[0].string.text;
-
if (!strcmp(attr->name, "device-uri") &&
attr->value_tag == IPP_TAG_URI)
device = attr->values[0].string.text;
-
- if (!strcmp(attr->name, "printer-state") &&
- attr->value_tag == IPP_TAG_ENUM)
- pstate = (ipp_pstate_t)attr->values[0].integer;
-
- if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
- attr->value_tag == IPP_TAG_BOOLEAN)
+ else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
+ attr->value_tag == IPP_TAG_BOOLEAN)
accepting = attr->values[0].boolean;
+ else if (!strcmp(attr->name, "printer-name") &&
+ attr->value_tag == IPP_TAG_NAME)
+ printer = attr->values[0].string.text;
+ else if (!strcmp(attr->name, "printer-state") &&
+ attr->value_tag == IPP_TAG_ENUM)
+ pstate = (ipp_pstate_t)attr->values[0].integer;
+ else if (!strcmp(attr->name, "queued-job-count") &&
+ attr->value_tag == IPP_TAG_INTEGER)
+ jobcount = attr->values[0].integer;
attr = attr->next;
}
*ptr != '\0' && *dptr != '\0' && *ptr == *dptr;
ptr ++, dptr ++);
- if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' || isspace(*dptr & 255)))
+ if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' ||
+ isspace(*dptr & 255)))
{
match = 1;
break;
if (match)
{
- /*
- * Build an IPP_GET_JOBS request, which requires the following
- * attributes:
- *
- * attributes-charset
- * attributes-natural-language
- * printer-uri
- * limit
- */
-
- request = ippNew();
-
- request->request.op.operation_id = IPP_GET_JOBS;
- request->request.op.request_id = 1;
-
- language = cupsLangDefault();
-
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
- "attributes-charset", NULL,
- cupsLangEncoding(language));
-
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
- "attributes-natural-language", NULL,
- language->language);
-
- httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
- "ipp", NULL, "localhost", 631, "/printers/%s",
- printer);
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
- "printer-uri", NULL, printer_uri);
-
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
- "requested-attributes", NULL, "job-id");
-
- if ((jobs = cupsDoRequest(http, request, "/")) != NULL)
- {
- /*
- * Grab the number of jobs for the printer.
- */
-
- for (jattr = jobs->attrs; jattr != NULL; jattr = jattr->next)
- if (jattr->name && !strcmp(jattr->name, "job-id"))
- jobcount ++;
-
- ippDelete(jobs);
- }
-
/*
* Display it...
*/
/*
- * End of "$Id: lpc.c 5926 2006-09-05 20:45:47Z mike $".
+ * End of "$Id: lpc.c 6073 2006-11-02 20:01:54Z mike $".
*/
dnl
-dnl "$Id: cups-common.m4 6032 2006-10-12 19:19:47Z mike $"
+dnl "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
AC_CONFIG_HEADER(config.h)
dnl Versio number information...
-CUPS_VERSION="1.2.5"
+CUPS_VERSION="1.2.6"
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'`"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
dnl
-dnl End of "$Id: cups-common.m4 6032 2006-10-12 19:19:47Z mike $".
+dnl End of "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $".
dnl
dnl
-dnl "$Id: cups-threads.m4 6012 2006-10-03 22:35:12Z mike $"
+dnl "$Id: cups-threads.m4 6061 2006-10-23 00:26:52Z mike $"
dnl
dnl Threading stuff for the Common UNIX Printing System (CUPS).
dnl
if test $have_pthread = yes; then
PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT"
- # Solaris requires _POSIX_PTHREAD_SEMANTICS to
+ # Solaris requires -D_POSIX_PTHREAD_SEMANTICS to
# be POSIX-compliant... :(
if test $uname = SunOS; then
- PTHREAD_FLAGS="$PTHREAD_FLAGS _POSIX_PTHREAD_SEMANTICS"
+ PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
fi
break
fi
AC_SUBST(PTHREAD_FLAGS)
dnl
-dnl End of "$Id: cups-threads.m4 6012 2006-10-03 22:35:12Z mike $".
+dnl End of "$Id: cups-threads.m4 6061 2006-10-23 00:26:52Z mike $".
dnl
/*
- * "$Id: config.h.in 6032 2006-10-12 19:19:47Z mike $"
+ * "$Id: config.h.in 6073 2006-11-02 20:01:54Z mike $"
*
* Configuration file for the Common UNIX Printing System (CUPS).
*
#undef HAVE_CFBUNDLEPRIV_H
+/*
+ * Do we have CFLocaleCreateCanonicalLocaleIdentifierFromString()?
+ */
+
+#undef HAVE_CF_LOCALE_ID
+
+
/*
* Do we have MacOSX 10.4's mbr_XXX functions()?
*/
#endif /* !_CUPS_CONFIG_H_ */
/*
- * End of "$Id: config.h.in 6032 2006-10-12 19:19:47Z mike $".
+ * End of "$Id: config.h.in 6073 2006-11-02 20:01:54Z mike $".
*/
/*
- * "$Id: cups.h 5993 2006-09-29 12:57:31Z mike $"
+ * "$Id: cups.h 6052 2006-10-20 20:35:41Z mike $"
*
* API definitions for the Common UNIX Printing System (CUPS).
*
* Constants...
*/
-# define CUPS_VERSION 1.0205
+# define CUPS_VERSION 1.0206
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 2
-# define CUPS_VERSION_PATCH 5
+# define CUPS_VERSION_PATCH 6
# define CUPS_DATE_ANY -1
#endif /* !_CUPS_CUPS_H_ */
/*
- * End of "$Id: cups.h 5993 2006-09-29 12:57:31Z mike $".
+ * End of "$Id: cups.h 6052 2006-10-20 20:35:41Z mike $".
*/
/*
- * "$Id: globals.h 5755 2006-07-19 13:29:44Z mike $"
+ * "$Id: globals.h 6073 2006-11-02 20:01:54Z mike $"
*
* Global variable definitions for the Common UNIX Printing System (CUPS).
*
/* language.c */
cups_lang_t *lang_default; /* Default language */
# ifdef __APPLE__
-# ifdef HAVE_CF_LOCALE_ID
char language[32]; /* Cached language */
-# else
- const char *language; /* Cached language */
-# endif /* HAVE_CF_LOCALE_ID */
# endif /* __APPLE__ */
/* ppd.c */
#endif /* !_CUPS_GLOBALS_H_ */
/*
- * End of "$Id: globals.h 5755 2006-07-19 13:29:44Z mike $".
+ * End of "$Id: globals.h 6073 2006-11-02 20:01:54Z mike $".
*/
/*
- * "$Id: http-support.c 5360 2006-03-30 17:02:17Z mike $"
+ * "$Id: http-support.c 6061 2006-10-23 00:26:52Z mike $"
*
* HTTP support routines for the Common UNIX Printing System (CUPS) scheduler.
*
if (outptr < outend)
*outptr ++ = base64[(in[0] & 255) >> 2];
+
if (outptr < outend)
- *outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
+ {
+ if (inlen > 1)
+ *outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
+ else
+ *outptr ++ = base64[((in[0] & 255) << 4) & 63];
+ }
in ++;
inlen --;
}
if (outptr < outend)
- *outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
+ {
+ if (inlen > 1)
+ *outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
+ else
+ *outptr ++ = base64[((in[0] & 255) << 2) & 63];
+ }
in ++;
inlen --;
/*
- * End of "$Id: http-support.c 5360 2006-03-30 17:02:17Z mike $".
+ * End of "$Id: http-support.c 6061 2006-10-23 00:26:52Z mike $".
*/
/*
- * "$Id: language.c 5980 2006-09-21 19:01:55Z mike $"
+ * "$Id: language.c 6073 2006-11-02 20:01:54Z mike $"
*
* I18N/language support for the Common UNIX Printing System (CUPS).
*
/* List of localization data */
CFStringRef languageName; /* Current name */
CFStringRef localeName; /* Canonical from of name */
+ char *lang; /* LANG environment variable */
_cups_globals_t *cg = _cupsGlobals();
/* Pointer to library globals */
if (!cg->language[0])
{
- localizationList =
- CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
- kCFPreferencesCurrentApplication);
-
- if (localizationList != NULL)
+ if ((lang = getenv("LANG")))
+ strlcpy(cg->language, lang, sizeof(cg->language));
+ else
{
- if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
- CFArrayGetCount(localizationList) > 0)
+ localizationList =
+ CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
+ kCFPreferencesCurrentApplication);
+
+ if (localizationList != NULL)
{
- languageName = CFArrayGetValueAtIndex(localizationList, 0);
+ if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
+ CFArrayGetCount(localizationList) > 0)
+ {
+ languageName = CFArrayGetValueAtIndex(localizationList, 0);
- if (languageName != NULL &&
- CFGetTypeID(languageName) == CFStringGetTypeID())
- {
- localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
- kCFAllocatorDefault, languageName);
+ if (languageName != NULL &&
+ CFGetTypeID(languageName) == CFStringGetTypeID())
+ {
+ localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
+ kCFAllocatorDefault, languageName);
- if (localeName != NULL)
- {
- CFStringGetCString(localeName, cg->language, sizeof(cg->language),
- kCFStringEncodingASCII);
- CFRelease(localeName);
-
- if (!strcmp(cg->language, "en"))
- strlcpy(cg->language, "en_US.UTF-8", sizeof(cg->language));
- else if (strchr(cg->language, '.') == NULL)
- strlcat(cg->language, ".UTF-8", sizeof(cg->language));
- }
- }
- }
+ if (localeName != NULL)
+ {
+ CFStringGetCString(localeName, cg->language, sizeof(cg->language),
+ kCFStringEncodingASCII);
+ CFRelease(localeName);
+
+ if (!strcmp(cg->language, "en"))
+ strlcpy(cg->language, "en_US.UTF-8", sizeof(cg->language));
+ else if (strchr(cg->language, '.') == NULL)
+ strlcat(cg->language, ".UTF-8", sizeof(cg->language));
+ }
+ }
+ }
- CFRelease(localizationList);
+ CFRelease(localizationList);
+ }
}
/*
char buff[256]; /* Temporary buffer */
_cups_globals_t *cg = _cupsGlobals();
/* Pointer to library globals */
+ char *lang; /* LANG environment variable */
/*
* Only do the lookup and translation the first time.
*/
- if (cg->language == NULL)
+ if (!cg->language[0])
{
- localizationList =
- CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
- kCFPreferencesCurrentApplication);
-
- if (localizationList != NULL)
+ if ((lang = getenv("LANG")))
+ strlcpy(cg->language, lang, sizeof(cg->language));
+ else
{
- if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
- CFArrayGetCount(localizationList) > 0)
- {
- localizationName = CFArrayGetValueAtIndex(localizationList, 0);
+ localizationList =
+ CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
+ kCFPreferencesCurrentApplication);
- if (localizationName != NULL &&
- CFGetTypeID(localizationName) == CFStringGetTypeID())
+ if (localizationList != NULL)
+ {
+ if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
+ CFArrayGetCount(localizationList) > 0)
{
- CFIndex length = CFStringGetLength(localizationName);
+ localizationName = CFArrayGetValueAtIndex(localizationList, 0);
- if (length <= sizeof(buff) &&
- CFStringGetCString(localizationName, buff, sizeof(buff),
- kCFStringEncodingASCII))
+ if (localizationName != NULL &&
+ CFGetTypeID(localizationName) == CFStringGetTypeID())
{
- buff[sizeof(buff) - 1] = '\0';
+ CFIndex length = CFStringGetLength(localizationName);
- for (i = 0;
- i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
- i++)
+ if (length <= sizeof(buff) &&
+ CFStringGetCString(localizationName, buff, sizeof(buff),
+ kCFStringEncodingASCII))
{
- if (!strcasecmp(buff, apple_name_locale[i].name))
+ buff[sizeof(buff) - 1] = '\0';
+
+ for (i = 0;
+ i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
+ i++)
{
- cg->language = apple_name_locale[i].locale;
- break;
+ if (!strcasecmp(buff, apple_name_locale[i].name))
+ {
+ strlcpy(cg->language, apple_name_locale[i].locale,
+ sizeof(cg->language));
+ break;
+ }
}
}
}
}
- }
- CFRelease(localizationList);
+ CFRelease(localizationList);
+ }
}
/*
* If we didn't find the language, default to en_US...
*/
- if (cg->language == NULL)
- cg->language = apple_name_locale[0].locale;
+ if (!cg->language[0])
+ strlcpy(cg->language, apple_name_locale[0].locale, sizeof(cg->language));
}
/*
/*
- * End of "$Id: language.c 5980 2006-09-21 19:01:55Z mike $".
+ * End of "$Id: language.c 6073 2006-11-02 20:01:54Z mike $".
*/
<h2 class='title'>Licensing</h2>
<p>The CUPS raster API is provided under the terms of the GNU
-General Public License, with exceptions for MacOS X-based
+Library General Public License, with exceptions for MacOS X-based
programs. Please see the CUPS license agreement for more
information.</p>
<h2 class='title'>Contents</h2>
<!-- NEW PAGE -->
<h2 class='title'><a name='ENUMERATIONS'>Enumerations</a></h2>
<ul>
+ <li><a href='#cups_adv_e'><tt>cups_adv_e</tt></a> </li>
<li><a href='#cups_bool_e'><tt>cups_bool_e</tt></a> </li>
+ <li><a href='#cups_cspace_e'><tt>cups_cspace_e</tt></a> </li>
+ <li><a href='#cups_cut_e'><tt>cups_cut_e</tt></a> </li>
+ <li><a href='#cups_edge_e'><tt>cups_edge_e</tt></a> </li>
+ <li><a href='#cups_jog_e'><tt>cups_jog_e</tt></a> </li>
<li><a href='#cups_mode_e'><tt>cups_mode_e</tt></a> </li>
+ <li><a href='#cups_order_e'><tt>cups_order_e</tt></a> </li>
+ <li><a href='#cups_orient_e'><tt>cups_orient_e</tt></a> </li>
</ul>
<!-- NEW PAGE -->
+<h3 class='title'><a name='cups_adv_e'>cups_adv_e</a></h3>
+<h4>Description</h4>
+<p></p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>CUPS_ADVANCE_FILE</tt> </td><td>Advance the roll after this file</td></tr>
+<tr><td><tt>CUPS_ADVANCE_JOB</tt> </td><td>Advance the roll after this job</td></tr>
+<tr><td><tt>CUPS_ADVANCE_NONE</tt> </td><td>Never advance the roll</td></tr>
+<tr><td><tt>CUPS_ADVANCE_PAGE</tt> </td><td>Advance the roll after this page</td></tr>
+<tr><td><tt>CUPS_ADVANCE_SET</tt> </td><td>Advance the roll after this set</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
<h3 class='title'><a name='cups_bool_e'>cups_bool_e</a></h3>
<h4>Description</h4>
<p>Types...</p>
<tr><td><tt>CUPS_TRUE</tt> </td><td>Logical true</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
+<h3 class='title'><a name='cups_cspace_e'>cups_cspace_e</a></h3>
+<h4>Description</h4>
+<p></p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>CUPS_CSPACE_CIELab</tt> <span class='info'> CUPS 1.1.19 </span></td><td>CIE Lab </td></tr>
+<tr><td><tt>CUPS_CSPACE_CIEXYZ</tt> <span class='info'> CUPS 1.1.19 </span></td><td>CIE XYZ </td></tr>
+<tr><td><tt>CUPS_CSPACE_CMY</tt> </td><td>Cyan, magenta, yellow</td></tr>
+<tr><td><tt>CUPS_CSPACE_CMYK</tt> </td><td>Cyan, magenta, yellow, black</td></tr>
+<tr><td><tt>CUPS_CSPACE_GMCK</tt> </td><td>Gold, magenta, yellow, black</td></tr>
+<tr><td><tt>CUPS_CSPACE_GMCS</tt> </td><td>Gold, magenta, yellow, silver</td></tr>
+<tr><td><tt>CUPS_CSPACE_GOLD</tt> </td><td>Gold foil</td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC1</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 1 color </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC2</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 2 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC3</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 3 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC4</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 4 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC5</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 5 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC6</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 6 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC7</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 7 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC8</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 8 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICC9</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 9 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICCA</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 10 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICCB</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 11 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICCC</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 12 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICCD</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 13 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICCE</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 14 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_ICCF</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 15 colors </td></tr>
+<tr><td><tt>CUPS_CSPACE_K</tt> </td><td>Black</td></tr>
+<tr><td><tt>CUPS_CSPACE_KCMY</tt> </td><td>Black, cyan, magenta, yellow</td></tr>
+<tr><td><tt>CUPS_CSPACE_KCMYcm</tt> </td><td>Black, cyan, magenta, yellow, *
+light-cyan, light-magenta</td></tr>
+<tr><td><tt>CUPS_CSPACE_RGB</tt> </td><td>Red, green, blue</td></tr>
+<tr><td><tt>CUPS_CSPACE_RGBA</tt> </td><td>Red, green, blue, alpha</td></tr>
+<tr><td><tt>CUPS_CSPACE_RGBW</tt> <span class='info'> CUPS 1.2 </span></td><td>Red, green, blue, white </td></tr>
+<tr><td><tt>CUPS_CSPACE_SILVER</tt> </td><td>Silver foil</td></tr>
+<tr><td><tt>CUPS_CSPACE_W</tt> </td><td>Luminance</td></tr>
+<tr><td><tt>CUPS_CSPACE_WHITE</tt> </td><td>White ink (as black)</td></tr>
+<tr><td><tt>CUPS_CSPACE_YMC</tt> </td><td>Yellow, magenta, cyan</td></tr>
+<tr><td><tt>CUPS_CSPACE_YMCK</tt> </td><td>Yellow, magenta, cyan, black</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='cups_cut_e'>cups_cut_e</a></h3>
+<h4>Description</h4>
+<p></p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>CUPS_CUT_FILE</tt> </td><td>Cut the roll after this file</td></tr>
+<tr><td><tt>CUPS_CUT_JOB</tt> </td><td>Cut the roll after this job</td></tr>
+<tr><td><tt>CUPS_CUT_NONE</tt> </td><td>Never cut the roll</td></tr>
+<tr><td><tt>CUPS_CUT_PAGE</tt> </td><td>Cut the roll after this page</td></tr>
+<tr><td><tt>CUPS_CUT_SET</tt> </td><td>Cut the roll after this set</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='cups_edge_e'>cups_edge_e</a></h3>
+<h4>Description</h4>
+<p></p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>CUPS_EDGE_BOTTOM</tt> </td><td>Leading edge is the bottom of the page</td></tr>
+<tr><td><tt>CUPS_EDGE_LEFT</tt> </td><td>Leading edge is the left of the page</td></tr>
+<tr><td><tt>CUPS_EDGE_RIGHT</tt> </td><td>Leading edge is the right of the page</td></tr>
+<tr><td><tt>CUPS_EDGE_TOP</tt> </td><td>Leading edge is the top of the page</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='cups_jog_e'>cups_jog_e</a></h3>
+<h4>Description</h4>
+<p></p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>CUPS_JOG_FILE</tt> </td><td>Move pages after this file</td></tr>
+<tr><td><tt>CUPS_JOG_JOB</tt> </td><td>Move pages after this job</td></tr>
+<tr><td><tt>CUPS_JOG_NONE</tt> </td><td>Never move pages</td></tr>
+<tr><td><tt>CUPS_JOG_SET</tt> </td><td>Move pages after this set</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
<h3 class='title'><a name='cups_mode_e'>cups_mode_e</a></h3>
<h4>Description</h4>
<p>Raster modes</p>
<tr><td><tt>CUPS_RASTER_WRITE</tt> </td><td>Open stream for writing</td></tr>
</tbody></table></div>
<!-- NEW PAGE -->
+<h3 class='title'><a name='cups_order_e'>cups_order_e</a></h3>
+<h4>Description</h4>
+<p></p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>CUPS_ORDER_BANDED</tt> </td><td>CCC MMM YYY KKK ...</td></tr>
+<tr><td><tt>CUPS_ORDER_CHUNKED</tt> </td><td>CMYK CMYK CMYK ...</td></tr>
+<tr><td><tt>CUPS_ORDER_PLANAR</tt> </td><td>CCC ... MMM ... YYY ... KKK ...</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
+<h3 class='title'><a name='cups_orient_e'>cups_orient_e</a></h3>
+<h4>Description</h4>
+<p></p>
+<h4>Values</h4>
+<div class='table'><table align='center' border='1' width='80%'>
+<thead><tr><th>Name</th><th>Description</th></tr></thead>
+<tbody>
+<tr><td><tt>CUPS_ORIENT_0</tt> </td><td>Don't rotate the page</td></tr>
+<tr><td><tt>CUPS_ORIENT_180</tt> </td><td>Turn the page upside down</td></tr>
+<tr><td><tt>CUPS_ORIENT_270</tt> </td><td>Rotate the page clockwise</td></tr>
+<tr><td><tt>CUPS_ORIENT_90</tt> </td><td>Rotate the page counter-clockwise</td></tr>
+</tbody></table></div>
+<!-- NEW PAGE -->
<h2 class='title'><a name='FUNCTIONS'>Functions</a></h2>
<ul>
<li><a href='#cupsRasterClose'><tt>cupsRasterClose()</tt></a> </li>
cupsRasterInterpretPPD() - this allows you to do per-page options
without manipulating the options array.
+The "func" argument specifies an optional callback function that is
+called prior to the computation of the final raster data. The function
+can make changes to the cups_page_header2_t data as needed to use a
+supported raster format and then returns 0 on success and -1 if the
+requested attributes cannot be supported.
+
</p>
<h4>Syntax</h4>
<pre>
<a href='#cups_page_header2_t'>cups_page_header2_t</a> * h,
ppd_file_t * ppd,
int num_options,
- cups_option_t * options);
+ cups_option_t * options,
+ <a href='#cups_interpret_cb_t'>cups_interpret_cb_t</a> func);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
<tr><td><tt>options</tt></td><td>Options</td></tr>
+<tr><td><tt>func</tt></td><td>Optional page header callback</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>0 on success, -1 on failure</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_page_header_s'>cups_page_header_s</a></h3>
<h4>Description</h4>
-<p>Version 1 Page Header</p>
+<p></p>
<h4>Definition</h4>
<pre>
struct cups_page_header_s
<!-- NEW PAGE -->
<h2 class='title'><a name='TYPES'>Types</a></h2>
<ul>
+ <li><a href='#cups_interpret_cb_t'><tt>cups_interpret_cb_t</tt></a> </li>
<li><a href='#cups_page_header2_t'><tt>cups_page_header2_t</tt></a> <span class='info'> CUPS 1.2 </span></li>
- <li><a href='#cups_page_header_t'><tt>cups_page_header_t</tt></a> </li>
<li><a href='#cups_raster_t'><tt>cups_raster_t</tt></a> </li>
</ul>
<!-- NEW PAGE -->
-<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cups_page_header2_t'>cups_page_header2_t</a></h3>
+<h3 class='title'><a name='cups_interpret_cb_t'>cups_interpret_cb_t</a></h3>
<h4>Description</h4>
-<p>Version 2 Page Header </p>
+<p>Prototypes...</p>
<h4>Definition</h4>
<pre>
-typedef struct <a href='#cups_page_header2_s'>cups_page_header2_s</a> cups_page_header2_t;
+typedef int (*cups_interpret_cb_t)(<a href='#cups_page_header2_t'>cups_page_header2_t</a> *header, int preferred_bits);
</pre>
<!-- NEW PAGE -->
-<h3 class='title'><a name='cups_page_header_t'>cups_page_header_t</a></h3>
+<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cups_page_header2_t'>cups_page_header2_t</a></h3>
<h4>Description</h4>
-<p>Version 1 Page Header</p>
+<p>Version 2 Page Header </p>
<h4>Definition</h4>
<pre>
-typedef struct <a href='#cups_page_header_s'>cups_page_header_s</a> cups_page_header_t;
+typedef struct <a href='#cups_page_header2_s'>cups_page_header2_s</a> cups_page_header2_t;
</pre>
<!-- NEW PAGE -->
<h3 class='title'><a name='cups_raster_t'>cups_raster_t</a></h3>
OpenSSL toolkit. A copy of the exceptions and licenses follow
this introduction.</P>
-<P>The GNU LGPL applies to the CUPS API library, located in the
-"cups" subdirectory of the CUPS source distribution and in the
-"cups" include directory and library files in the binary
-distributions. The GNU GPL applies to the remainder of the CUPS
-distribution, including the "pdftops" filter which is based upon
-Xpdf and the CUPS imaging library.</P>
+<P>The GNU LGPL applies to the CUPS and CUPS Imaging libraries
+located in the "cups" and "filter" subdirectories of the CUPS
+source distribution and in the "cups" include directory and
+library files in the binary distributions. The GNU GPL applies to
+the remainder of the CUPS distribution, including the "pdftops"
+filter which is based upon Xpdf.</P>
<P>For those not familiar with the GNU GPL, the license basically
allows you to:</P>
<LI>Sell verbatim copies of the software for a media
fee, or sell support for the software.</LI>
- <LI>Distribute or sell printer drivers and filters that
- use CUPS so long as source code is made available under
- the GPL.</LI>
-
</UL>
<P>What this license <EM>does not</EM> allow you to do is make
changes or add features to CUPS and then sell a binary
distribution without source code. You must provide source for any
-new drivers, changes, or additions to the software, and all code
-must be provided under the GPL or LGPL as appropriate. The only
+changes or additions to the software, and all code must be
+provided under the GPL or LGPL as appropriate. The only
exceptions to this are the portions of the CUPS software covered
by the Apple operating system license exceptions outlined later
in this license agreement.</P>
<P>The GNU LGPL relaxes the "link-to" restriction, allowing you
-to develop applications that use the CUPS API library under other
-licenses and/or conditions as appropriate for your
-application.</P>
+to develop applications that use the CUPS and CUPS Imaging
+libraries under other licenses and/or conditions as appropriate
+for your application, driver, or filter.</P>
<H2 CLASS="title"><A NAME="EXCEPTIONS">License Exceptions</A></H2>
<P>Easy Software Products also sells rights to the CUPS source
code under a binary distribution license for vendors that are
-unable to release source code for their drivers, additions, and
+unable to release source code for their additions and
modifications to CUPS under the GNU GPL and LGPL. For information
please contact us at the address shown above.</P>
<h2 class='title'>Licensing</h2>
<p>The CUPS raster API is provided under the terms of the GNU
-General Public License, with exceptions for MacOS X-based
+Library General Public License, with exceptions for MacOS X-based
programs. Please see the CUPS license agreement for more
information.</p>
/*
- * "$Id: raster.c 5671 2006-06-16 11:17:39Z mike $"
+ * "$Id: raster.c 6061 2006-10-23 00:26:52Z mike $"
*
* Raster file routines for the Common UNIX Printing System (CUPS).
*
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
- * This code and any derivative of it may be used and distributed
- * freely under the terms of the GNU General Public License when
- * used with GNU/GPL Ghostscript or its derivatives. Use of the
- * code (or any derivative of it) with software other than GNU/GPL
- * GhostScript (or its derivatives) is governed by the CUPS license
- * agreement.
- *
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
/*
- * End of "$Id: raster.c 5671 2006-06-16 11:17:39Z mike $".
+ * End of "$Id: raster.c 6061 2006-10-23 00:26:52Z mike $".
*/
/*
- * "$Id: raster.h 5671 2006-06-16 11:17:39Z mike $"
+ * "$Id: raster.h 6061 2006-10-23 00:26:52Z mike $"
*
* Raster file definitions for the Common UNIX Printing System (CUPS).
*
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
- * This code and any derivative of it may be used and distributed
- * freely under the terms of the GNU General Public License when
- * used with GNU/GPL Ghostscript or its derivatives. Use of the
- * code (or any derivative of it) with software other than GNU/GPL
- * GhostScript (or its derivatives) is governed by the CUPS license
- * agreement.
- *
* This file is subject to the Apple OS-Developed Software exception.
*/
#endif /* !_CUPS_RASTER_H_ */
/*
- * End of "$Id: raster.h 5671 2006-06-16 11:17:39Z mike $".
+ * End of "$Id: raster.h 6061 2006-10-23 00:26:52Z mike $".
*/
writePSFmt("%%Producer: xpdf/pdftops %s\n", xpdfVersion);
xref->getDocInfo(&info);
- if (info.dictLookup("Creator", &obj1)->isString()) {
+ if (info.isDict() && info.dictLookup("Creator", &obj1)->isString()) {
writePS("%%Creator: ");
s = obj1.getString();
if ((s->getChar(0) & 0xff) == 0xfe &&
writePS("\n");
}
obj1.free();
- if (info.dictLookup("Title", &obj1)->isString()) {
+ if (info.isDict() && info.dictLookup("Title", &obj1)->isString()) {
writePS("%%Title: ");
s = obj1.getString();
if ((s->getChar(0) & 0xff) == 0xfe &&
/*
- * "$Id: ipp.c 6032 2006-10-12 19:19:47Z mike $"
+ * "$Id: ipp.c 6052 2006-10-20 20:35:41Z mike $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
if ((!strcmp(system_paper, "Letter") && have_letter) ||
(!strcmp(system_paper, "A4") && have_a4))
{
- num_defaults = ppd_add_default("PageSize", system_paper,
- num_defaults, &defaults);
- num_defaults = ppd_add_default("PageRegion", system_paper,
- num_defaults, &defaults);
- num_defaults = ppd_add_default("PaperDimension", system_paper,
- num_defaults, &defaults);
- num_defaults = ppd_add_default("ImageableArea", system_paper,
- num_defaults, &defaults);
+ num_defaults = cupsAddOption("PageSize", system_paper,
+ num_defaults, &defaults);
+ num_defaults = cupsAddOption("PageRegion", system_paper,
+ num_defaults, &defaults);
+ num_defaults = cupsAddOption("PaperDimension", system_paper,
+ num_defaults, &defaults);
+ num_defaults = cupsAddOption("ImageableArea", system_paper,
+ num_defaults, &defaults);
}
}
#endif /* HAVE_LIBPAPER */
/*
- * End of "$Id: ipp.c 6032 2006-10-12 19:19:47Z mike $".
+ * End of "$Id: ipp.c 6052 2006-10-20 20:35:41Z mike $".
*/
/*
- * "$Id: job.c 6032 2006-10-12 19:19:47Z mike $"
+ * "$Id: job.c 6061 2006-10-23 00:26:52Z mike $"
*
* Job management routines for the Common UNIX Printing System (CUPS).
*
strlcpy(job->printer->state_message, message,
sizeof(job->printer->state_message));
cupsdAddPrinterHistory(job->printer);
+ event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
}
if (!strchr(job->status_buffer->buffer, '\n'))
/*
- * End of "$Id: job.c 6032 2006-10-12 19:19:47Z mike $".
+ * End of "$Id: job.c 6061 2006-10-23 00:26:52Z mike $".
*/
/*
- * "$Id: lpstat.c 5926 2006-09-05 20:45:47Z mike $"
+ * "$Id: lpstat.c 6073 2006-11-02 20:01:54Z mike $"
*
* "lpstat" command for the Common UNIX Printing System (CUPS).
*
cups_dest_t *dests, /* I - User-defined destinations */
int long_status) /* I - Show long status? */
{
- int i; /* Looping var */
+ int i, j; /* Looping vars */
ipp_t *request, /* IPP Request */
*response, /* IPP Response */
*jobs; /* IPP Get Jobs response */
if (reasons)
{
_cupsLangPuts(stdout, _("\tAlerts:"));
- for (i = 0; i < reasons->num_values; i ++)
+ for (j = 0; j < reasons->num_values; i ++)
_cupsLangPrintf(stdout, " %s",
- reasons->values[i].string.text);
+ reasons->values[j].string.text);
_cupsLangPuts(stdout, "\n");
}
}
if (allowed)
{
_cupsLangPuts(stdout, _("\tUsers allowed:\n"));
- for (i = 0; i < allowed->num_values; i ++)
+ for (j = 0; j < allowed->num_values; j ++)
_cupsLangPrintf(stdout, "\t\t%s\n",
- allowed->values[i].string.text);
+ allowed->values[j].string.text);
}
else if (denied)
{
_cupsLangPuts(stdout, _("\tUsers denied:\n"));
- for (i = 0; i < denied->num_values; i ++)
+ for (j = 0; j < denied->num_values; j ++)
_cupsLangPrintf(stdout, "\t\t%s\n",
- denied->values[i].string.text);
+ denied->values[j].string.text);
}
else
{
if (reasons)
{
_cupsLangPuts(stdout, _("\tAlerts:"));
- for (i = 0; i < reasons->num_values; i ++)
+ for (j = 0; j < reasons->num_values; j ++)
_cupsLangPrintf(stdout, " %s",
- reasons->values[i].string.text);
+ reasons->values[j].string.text);
_cupsLangPuts(stdout, "\n");
}
}
if (allowed)
{
_cupsLangPuts(stdout, _("\tUsers allowed:\n"));
- for (i = 0; i < allowed->num_values; i ++)
+ for (j = 0; j < allowed->num_values; j ++)
_cupsLangPrintf(stdout, "\t\t%s\n",
- allowed->values[i].string.text);
+ allowed->values[j].string.text);
}
else if (denied)
{
_cupsLangPuts(stdout, _("\tUsers denied:\n"));
- for (i = 0; i < denied->num_values; i ++)
+ for (j = 0; j < denied->num_values; j ++)
_cupsLangPrintf(stdout, "\t\t%s\n",
- denied->values[i].string.text);
+ denied->values[j].string.text);
}
else
{
/*
- * End of "$Id: lpstat.c 5926 2006-09-05 20:45:47Z mike $".
+ * End of "$Id: lpstat.c 6073 2006-11-02 20:01:54Z mike $".
*/