CHANGES IN CUPS V1.4.7
- Documentation changes (STR #3710, STR #3720, STR #3745, STR #3750,
- STR #3757, STR #3758)
+ STR #3757, STR #3758, STR #3782)
- Web interface fixes (STR #3412, STR #3345, STR #3455, STR #3707,
- STR #3755, STR #3769)
+ STR #3755, STR #3769, STR #3783)
- Configure script fixes (STR #3659, STR #3691)
- Compilation fixes (STR #3718, STR #3771, STR #3774)
+ - The gziptoany filter did not report the correct error if it was unable
+ to write the uncompressed document to the next filter or backend in
+ the chain (STR #3797)
+ - The Epson and Oki 9-pin drivers had a bad resolution option
+ (STR #3798)
- The scheduler did not always register the correct default ICC profile
on Mac OS X.
- The scheduler did not use the job owner when authorizing access for
-CHANGES.txt - 2011-01-21
+CHANGES.txt - 2011-02-21
------------------------
CHANGES IN CUPS V1.5b1
+ - Added support for a new cupsIPPSupplies keyword in PPD files to allow
+ drivers to disable IPP supply level reporting.
+ - Added support for a new cupsFilter2 keyword in PPD files to allow for
+ the propagation of the actual MIME media type produced by a filter.
+ - The scheduler did not always get the correct Kerberos username when
+ authenticating (STR #3670)
+ - Added new cupsRasterOpenIO function and CUPS_RASTER_WRITE_PWG to the
+ CUPS imaging library to support printing to IPP Everywhere raster
+ printers.
- The scheduler now provides default values for the pages-per-minute and
pages-per-minute-color attributes for PPD files that lack a
Throughput keyword.
elements.
- Added several new color spaces to the CUPS raster format (STR #3419)
- The Validate-Job operation now uses the same policy as Print-Job by
- default.
+ default.
- CUPS now uses iconv to implement all of its character encoding
support (STR #3097)
- The scheduler now implements the Cancel-Jobs, Cancel-My-Jobs, and
#define CUPS_TC_csUTF32LE 1019
+/*
+ * Types...
+ */
+
+typedef int (*_cups_sccb_t)(int print_fd, int device_fd, int snmp_fd,
+ http_addr_t *addr, int use_bc);
+
+
/*
* Prototypes...
*/
int snmp_fd, http_addr_t *addr,
int use_bc);
extern ssize_t backendRunLoop(int print_fd, int device_fd, int snmp_fd,
- http_addr_t *addr, int use_bc,
- int update_state,
- int (*side_cb)(int print_fd,
- int device_fd,
- int snmp_fd,
- http_addr_t *addr,
- int use_bc));
+ http_addr_t *addr, int use_bc,
+ int update_state, _cups_sccb_t side_cb);
extern int backendSNMPSupplies(int snmp_fd, http_addr_t *addr,
int *page_count,
int *printer_state);
+extern int backendWaitLoop(int snmp_fd, http_addr_t *addr,
+ _cups_sccb_t side_cb);
+
# ifdef __cplusplus
}
"marker-names",
"marker-types",
"media-col-supported",
+ "operations-supported",
"printer-alert",
"printer-alert-description",
"printer-is-accepting-jobs",
*name, /* Name of option */
*value, /* Value of option */
sep; /* Separator character */
+ http_addrlist_t *addrlist; /* Address of printer */
int snmp_fd, /* SNMP socket */
start_count, /* Page count via SNMP at start */
page_count, /* Page count via SNMP */
int num_files; /* Number of files to print */
char **files; /* Files to print */
int port; /* Port number (not used) */
+ char portname[255]; /* Port name */
char uri[HTTP_MAX_URI]; /* Updated URI without user/pass */
http_status_t http_status; /* Status of HTTP request */
ipp_status_t ipp_status; /* Status of IPP request */
}
/*
- * Try connecting to the remote server...
+ * Try finding the remote server...
*/
- delay = 5;
start_time = time(NULL);
+ sprintf(portname, "%d", port);
+
fputs("STATE: +connecting-to-device\n", stderr);
+ fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
+
+ while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
+ {
+ _cupsLangPrintFilter(stderr, "INFO",
+ _("Unable to locate printer \"%s\"."), hostname);
+ sleep(10);
+
+ if (getenv("CLASS") != NULL)
+ {
+ fputs("STATE: -connecting-to-device\n", stderr);
+ return (CUPS_BACKEND_STOP);
+ }
+ }
+
+ http = _httpCreate(hostname, port, addrlist, cupsEncryption(), AF_UNSPEC);
+
+ /*
+ * See if the printer supports SNMP...
+ */
+
+ if ((snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family)) >= 0)
+ {
+ have_supplies = !backendSNMPSupplies(snmp_fd, &(addrlist->addr),
+ &start_count, NULL);
+ }
+ else
+ have_supplies = start_count = 0;
+
+ /*
+ * Wait for data from the filter...
+ */
+
+ if (num_files == 0)
+ if (!backendWaitLoop(snmp_fd, &(addrlist->addr), backendNetworkSideCB))
+ return (CUPS_BACKEND_OK);
+
+ /*
+ * Try connecting to the remote server...
+ */
+
+ delay = 5;
do
{
fprintf(stderr, "DEBUG: Connecting to %s:%d\n", hostname, port);
_cupsLangPrintFilter(stderr, "INFO", _("Connecting to printer."));
- if ((http = httpConnectEncrypt(hostname, port,
- cupsEncryption())) == NULL)
+ if (httpReconnect(http))
{
-#if 0 /* These need to go in here someplace when we see HTTP_PKI_ERROR or IPP_PKI_ERROR */
- fputs("STATE: +cups-certificate-error\n", stderr);
- fputs("STATE: -cups-certificate-error\n", stderr);
-#endif /* 0 */
-
int error = errno; /* Connection error */
+ if (http->status == HTTP_PKI_ERROR)
+ fputs("STATE: +cups-certificate-error\n", stderr);
+
if (job_canceled)
break;
sleep(5);
+ fputs("STATE: -connecting-to-device\n", stderr);
+
return (CUPS_BACKEND_FAILED);
}
{
_cupsLangPrintFilter(stderr, "ERROR",
_("The printer is not responding."));
+ fputs("STATE: -connecting-to-device\n", stderr);
return (CUPS_BACKEND_FAILED);
}
if (delay < 30)
delay += 5;
}
- else if (h_errno)
- {
- _cupsLangPrintFilter(stderr, "ERROR",
- _("Unable to locate network printer \"%s\"."),
- hostname);
- return (CUPS_BACKEND_STOP);
- }
else
{
_cupsLangPrintFilter(stderr, "ERROR",
if (job_canceled)
break;
}
+ else
+ fputs("STATE: -cups-certificate-error\n", stderr);
}
- while (http == NULL);
+ while (http->fd < 0);
if (job_canceled || !http)
return (CUPS_BACKEND_FAILED);
httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
ntohs(http->hostaddr->ipv4.sin_port));
- /*
- * See if the printer supports SNMP...
- */
-
- if ((snmp_fd = _cupsSNMPOpen(http->hostaddr->addr.sa_family)) >= 0)
- have_supplies = !backendSNMPSupplies(snmp_fd, http->hostaddr, &start_count,
- NULL);
- else
- have_supplies = start_count = 0;
-
/*
* 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
document_format = final_content_type;
break;
}
+
+ if (!document_format)
+ {
+ for (i = 0; i < format_sup->num_values; i ++)
+ if (!strcasecmp("application/octet-stream",
+ format_sup->values[i].string.text))
+ {
+ document_format = "application/octet-stream";
+ break;
+ }
+ }
}
/*
ipp_status = cupsLastError();
- if (ipp_status > IPP_OK_CONFLICT)
+ if (ipp_status > IPP_OK_CONFLICT &&
+ ipp_status != IPP_OPERATION_NOT_SUPPORTED)
{
if (job_canceled)
break;
if (job_state->values[0].integer > IPP_JOB_STOPPED)
{
- if ((job_sheets = ippFindAttribute(response,
+ if ((job_sheets = ippFindAttribute(response,
"job-media-sheets-completed",
IPP_TAG_INTEGER)) != NULL)
fprintf(stderr, "PAGE: total %d\n",
* Collect the final page count as needed...
*/
- if (have_supplies &&
+ if (have_supplies &&
!backendSNMPSupplies(snmp_fd, http->hostaddr, &page_count, NULL) &&
page_count > start_count)
fprintf(stderr, "PAGE: total %d\n", page_count - start_count);
* Make a copy of the printer connection...
*/
- http = _httpCreate(monitor->hostname, monitor->port, monitor->encryption,
+ http = _httpCreate(monitor->hostname, monitor->port, NULL, monitor->encryption,
AF_UNSPEC);
cupsSetPasswordCB(password_cb);
int num_options, /* I - Number of options to send */
cups_option_t *options, /* I - Options to send */
const char *compression, /* I - compression value or NULL */
- int copies, /* I - copies value or 0 */
+ int copies, /* I - copies value or 0 */
const char *format, /* I - documet-format value or NULL */
_pwg_t *pwg, /* I - PWG<->PPD mapping data */
ipp_attribute_t *media_col_sup) /* I - media-col-supported values */
const char *prefix; /* Prefix for STATE: line */
char value[1024], /* State/message string */
*valptr; /* Pointer into string */
+ static int ipp_supplies = -1;
+ /* Report supply levels? */
/*
* Relay the current marker-* attribute values...
*/
- if ((marker = ippFindAttribute(ipp, "marker-colors", IPP_TAG_NAME)) != NULL)
- report_attr(marker);
- if ((marker = ippFindAttribute(ipp, "marker-high-levels",
- IPP_TAG_INTEGER)) != NULL)
- report_attr(marker);
- if ((marker = ippFindAttribute(ipp, "marker-levels",
- IPP_TAG_INTEGER)) != NULL)
- report_attr(marker);
- if ((marker = ippFindAttribute(ipp, "marker-low-levels",
- IPP_TAG_INTEGER)) != NULL)
- report_attr(marker);
- if ((marker = ippFindAttribute(ipp, "marker-message", IPP_TAG_TEXT)) != NULL)
- report_attr(marker);
- if ((marker = ippFindAttribute(ipp, "marker-names", IPP_TAG_NAME)) != NULL)
- report_attr(marker);
- if ((marker = ippFindAttribute(ipp, "marker-types", IPP_TAG_KEYWORD)) != NULL)
- report_attr(marker);
+ if (ipp_supplies < 0)
+ {
+ ppd_file_t *ppd; /* PPD file */
+ ppd_attr_t *ppdattr; /* Attribute in PPD file */
+
+ if ((ppd = ppdOpenFile(getenv("PPD"))) != NULL &&
+ (ppdattr = ppdFindAttr(ppd, "cupsIPPSupplies", NULL)) != NULL &&
+ ppdattr->value && strcasecmp(ppdattr->value, "true"))
+ ipp_supplies = 0;
+ else
+ ipp_supplies = 1;
+
+ ppdClose(ppd);
+ }
+
+ if (ipp_supplies > 0)
+ {
+ if ((marker = ippFindAttribute(ipp, "marker-colors", IPP_TAG_NAME)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-high-levels",
+ IPP_TAG_INTEGER)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-levels",
+ IPP_TAG_INTEGER)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-low-levels",
+ IPP_TAG_INTEGER)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-message",
+ IPP_TAG_TEXT)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-names", IPP_TAG_NAME)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-types",
+ IPP_TAG_KEYWORD)) != NULL)
+ report_attr(marker);
+ }
return (count);
}
*/
static int lpd_command(int lpd_fd, int timeout, char *format, ...);
-static int lpd_queue(const char *hostname, int port, const char *printer,
- int print_fd, int mode, const char *user,
- const char *title, int copies, int banner,
- int format, int order, int reserve,
- int manual_copies, int timeout, int contimeout);
+static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
+ const char *printer, int print_fd, int snmp_fd,
+ int mode, const char *user, const char *title,
+ int copies, int banner, int format, int order,
+ int reserve, int manual_copies, int timeout,
+ int contimeout);
static void lpd_timeout(int sig);
static int lpd_write(int lpd_fd, char *buffer, int length);
#ifndef HAVE_RRESVPORT_AF
*filename, /* File to print */
title[256]; /* Title string */
int port; /* Port number */
+ char portname[256]; /* Port name (string) */
+ http_addrlist_t *addrlist; /* List of addresses for printer */
+ int snmp_fd; /* SNMP socket */
int fd; /* Print file */
int status; /* Status of LPD job */
int mode; /* Print mode */
if (mode == MODE_STREAM)
order = ORDER_CONTROL_DATA;
+ /*
+ * Find the printer...
+ */
+
+ snprintf(portname, sizeof(portname), "%d", port);
+
+ fputs("STATE: +connecting-to-device\n", stderr);
+ fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
+
+ while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
+ {
+ _cupsLangPrintFilter(stderr, "INFO",
+ _("Unable to locate printer \"%s\"."), hostname);
+ sleep(10);
+
+ if (getenv("CLASS") != NULL)
+ {
+ fputs("STATE: -connecting-to-device\n", stderr);
+ exit(CUPS_BACKEND_FAILED);
+ }
+ }
+
+ snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
+
+ /*
+ * Wait for data from the filter...
+ */
+
+ if (argc == 6)
+ if (!backendWaitLoop(snmp_fd, &(addrlist->addr), backendNetworkSideCB))
+ return (CUPS_BACKEND_OK);
+
/*
* If we have 7 arguments, print the file named on the command-line.
* Otherwise, copy stdin to a temporary file and print the temporary
* Copy stdin to a temporary file...
*/
- http_addrlist_t *addrlist; /* Address list */
- int snmp_fd; /* SNMP socket */
-
-
- fputs("STATE: +connecting-to-device\n", stderr);
- fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
-
- while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, "1")) == NULL)
- {
- _cupsLangPrintFilter(stderr, "INFO",
- _("Unable to locate printer \"%s\"."), hostname);
- sleep(10);
-
- if (getenv("CLASS") != NULL)
- exit(CUPS_BACKEND_FAILED);
- }
-
- snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
-
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
{
perror("DEBUG: Unable to create temporary file");
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
backendNetworkSideCB);
-
- if (snmp_fd >= 0)
- _cupsSNMPClose(snmp_fd);
-
- httpAddrFreeList(addrlist);
}
else if (argc == 6)
{
copies = atoi(argv[4]);
}
- status = lpd_queue(hostname, port, resource + 1, fd, mode,
- username, title, copies,
- banner, format, order, reserve, manual_copies,
- timeout, contimeout);
+ status = lpd_queue(hostname, addrlist, resource + 1, fd, snmp_fd, mode,
+ username, title, copies, banner, format, order, reserve,
+ manual_copies, timeout, contimeout);
if (!status)
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
}
else
- status = lpd_queue(hostname, port, resource + 1, fd, mode,
- username, title, 1,
- banner, format, order, reserve, 1,
+ status = lpd_queue(hostname, addrlist, resource + 1, fd, snmp_fd, mode,
+ username, title, 1, banner, format, order, reserve, 1,
timeout, contimeout);
/*
if (fd)
close(fd);
+ if (snmp_fd >= 0)
+ _cupsSNMPClose(snmp_fd);
+
/*
* Return the queue status...
*/
/*
- * Don't try to send commands if the job has been cancelled...
+ * Don't try to send commands if the job has been canceled...
*/
if (abort_job)
*/
static int /* O - Zero on success, non-zero on failure */
-lpd_queue(const char *hostname, /* I - Host to connect to */
- int port, /* I - Port to connect on */
- const char *printer, /* I - Printer/queue name */
- int print_fd, /* I - File to print */
- int mode, /* I - Print mode */
- const char *user, /* I - Requesting user */
- const char *title, /* I - Job title */
- int copies, /* I - Number of copies */
- int banner, /* I - Print LPD banner? */
- int format, /* I - Format specifier */
- int order, /* I - Order of data/control files */
- int reserve, /* I - Reserve ports? */
- int manual_copies, /* I - Do copies by hand... */
- int timeout, /* I - Timeout... */
- int contimeout) /* I - Connection timeout */
+lpd_queue(const char *hostname, /* I - Host to connect to */
+ http_addrlist_t *addrlist, /* I - List of host addresses */
+ const char *printer, /* I - Printer/queue name */
+ int print_fd, /* I - File to print */
+ int snmp_fd, /* I - SNMP socket */
+ int mode, /* I - Print mode */
+ const char *user, /* I - Requesting user */
+ const char *title, /* I - Job title */
+ int copies, /* I - Number of copies */
+ int banner, /* I - Print LPD banner? */
+ int format, /* I - Format specifier */
+ int order, /* I - Order of data/control files */
+ int reserve, /* I - Reserve ports? */
+ int manual_copies,/* I - Do copies by hand... */
+ int timeout, /* I - Timeout... */
+ int contimeout) /* I - Connection timeout */
{
char localhost[255]; /* Local host name */
int error; /* Error number */
char control[10240], /* LPD control 'file' */
*cptr; /* Pointer into control file string */
char status; /* Status byte from command */
- char portname[255]; /* Port name */
int delay; /* Delay for retries... */
char addrname[256]; /* Address name */
- http_addrlist_t *addrlist, /* Address list */
- *addr; /* Socket address */
- int snmp_fd, /* SNMP socket */
- have_supplies; /* Printer supports supply levels? */
+ http_addrlist_t *addr; /* Socket address */
+ int have_supplies; /* Printer supports supply levels? */
int copy; /* Copies written */
time_t start_time; /* Time of first connect */
size_t nbytes; /* Number of bytes written */
signal(SIGALRM, lpd_timeout);
#endif /* HAVE_SIGSET */
- /*
- * Find the printer...
- */
-
- sprintf(portname, "%d", port);
-
- fputs("STATE: +connecting-to-device\n", stderr);
- fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
-
- while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
- {
- _cupsLangPrintFilter(stderr, "INFO", _("Unable to locate printer \"%s\"."),
- hostname);
- sleep(10);
-
- if (getenv("CLASS") != NULL)
- exit(CUPS_BACKEND_FAILED);
- }
-
/*
* Remember when we started trying to connect to the printer...
*/
*/
fprintf(stderr, "DEBUG: Connecting to %s:%d for printer %s\n", hostname,
- port, printer);
+ _httpAddrPort(&(addrlist->addr)), printer);
_cupsLangPrintFilter(stderr, "INFO", _("Connecting to printer."));
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist,
addr = addr->next)
{
/*
- * Stop if this job has been cancelled...
+ * Stop if this job has been canceled...
*/
if (abort_job)
- {
- httpAddrFreeList(addrlist);
-
return (CUPS_BACKEND_FAILED);
- }
/*
* Choose the next priviledged port...
if (abort_job)
{
- httpAddrFreeList(addrlist);
-
close(fd);
return (CUPS_BACKEND_FAILED);
_("Unable to contact printer, queuing on next "
"printer in class."));
- httpAddrFreeList(addrlist);
-
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
*/
* See if the printer supports SNMP...
*/
- if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
- have_supplies = !backendSNMPSupplies(snmp_fd, &(addr->addr), NULL, NULL);
+ if (snmp_fd >= 0)
+ have_supplies = !backendSNMPSupplies(snmp_fd, &(addrlist->addr), NULL,
+ NULL);
else
have_supplies = 0;
* Check for side-channel requests...
*/
- backendCheckSideChannel(snmp_fd, &(addr->addr));
+ backendCheckSideChannel(snmp_fd, &(addrlist->addr));
/*
* Next, open the print file and figure out its size...
if (fstat(print_fd, &filestats))
{
- httpAddrFreeList(addrlist);
close(fd);
perror("DEBUG: unable to stat print file");
if (lpd_command(fd, timeout, "\002%s\n",
printer)) /* Receive print job(s) */
{
- httpAddrFreeList(addrlist);
close(fd);
return (CUPS_BACKEND_FAILED);
}
if (lpd_command(fd, timeout, "\002%d cfA%03.3d%.15s\n", strlen(control),
(int)getpid() % 1000, localhost))
{
- httpAddrFreeList(addrlist);
close(fd);
return (CUPS_BACKEND_FAILED);
CUPS_LLCAST filestats.st_size, (int)getpid() % 1000,
localhost))
{
- httpAddrFreeList(addrlist);
close(fd);
return (CUPS_BACKEND_FAILED);
if (lpd_command(fd, timeout, "\002%d cfA%03.3d%.15s\n", strlen(control),
(int)getpid() % 1000, localhost))
{
- httpAddrFreeList(addrlist);
close(fd);
return (CUPS_BACKEND_FAILED);
close(fd);
if (status == 0)
- {
- httpAddrFreeList(addrlist);
-
return (CUPS_BACKEND_OK);
- }
/*
* Waiting for a retry...
sleep(30);
}
- httpAddrFreeList(addrlist);
-
/*
- * If we get here, then the job has been cancelled...
+ * If we get here, then the job has been canceled...
*/
return (CUPS_BACKEND_FAILED);
*
* Parallel port backend for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
if (print_fd != 0)
close(print_fd);
- return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
+ return (CUPS_BACKEND_OK);
}
/*
- * "$Id: runloop.c 7895 2008-09-02 19:19:43Z mike $"
+ * "$Id: runloop.c 9565 2011-02-23 00:08:08Z mike $"
*
- * Common run loop APIs for CUPS.
+ * Common run loop APIs for CUPS backends.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
*
* backendDrainOutput() - Drain pending print data to the device.
* backendRunLoop() - Read and write print and back-channel data.
+ * backendWaitLoop() - Wait for input from stdin while handling
+ * side-channel queries.
*/
/*
ssize_t /* O - Total bytes on success, -1 on error */
backendRunLoop(
- int print_fd, /* I - Print file descriptor */
- int device_fd, /* I - Device file descriptor */
- int snmp_fd, /* I - SNMP socket or -1 if none */
- http_addr_t *addr, /* I - Address of device */
- int use_bc, /* I - Use back-channel? */
- int update_state, /* I - Update printer-state-reasons? */
- int (*side_cb)(int, int, int, http_addr_t *, int))
- /* I - Side-channel callback */
+ int print_fd, /* I - Print file descriptor */
+ int device_fd, /* I - Device file descriptor */
+ int snmp_fd, /* I - SNMP socket or -1 if none */
+ http_addr_t *addr, /* I - Address of device */
+ int use_bc, /* I - Use back-channel? */
+ int update_state, /* I - Update printer-state-reasons? */
+ _cups_sccb_t side_cb) /* I - Side-channel callback */
{
int nfds; /* Maximum file descriptor value + 1 */
fd_set input, /* Input set for reading */
else if (errno == EINTR && total_bytes == 0)
{
fputs("DEBUG: Received an interrupt before any bytes were "
- "written, aborting\n", stderr);
+ "written, aborting.\n", stderr);
return (0);
}
/*
- * End of "$Id: runloop.c 7895 2008-09-02 19:19:43Z mike $".
+ * 'backendWaitLoop()' - Wait for input from stdin while handling side-channel
+ * queries.
+ */
+
+int /* O - 1 if data is ready, 0 if not */
+backendWaitLoop(
+ int snmp_fd, /* I - SNMP socket or -1 if none */
+ http_addr_t *addr, /* I - Address of device */
+ _cups_sccb_t side_cb) /* I - Side-channel callback */
+{
+ fd_set input; /* Input set for reading */
+ time_t curtime, /* Current time */
+ snmp_update = 0;
+#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
+ struct sigaction action; /* Actions for POSIX signals */
+#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+
+
+ fprintf(stderr, "DEBUG: backendWaitLoop(snmp_fd=%d, addr=%p, side_cb=%p)\n",
+ snmp_fd, addr, side_cb);
+
+ /*
+ * Now loop until we receive data from stdin...
+ */
+
+ for (;;)
+ {
+ /*
+ * Use select() to determine whether we have data to copy around...
+ */
+
+ FD_ZERO(&input);
+ FD_SET(0, &input);
+ if (side_cb)
+ FD_SET(CUPS_SC_FD, &input);
+
+ if (select(CUPS_SC_FD + 1, &input, NULL, NULL, NULL) < 0)
+ {
+ /*
+ * Pause printing to clear any pending errors...
+ */
+
+ if (errno == EINTR)
+ {
+ fputs("DEBUG: Received an interrupt before any bytes were "
+ "written, aborting.\n", stderr);
+ return (0);
+ }
+
+ sleep(1);
+ continue;
+ }
+
+ /*
+ * Check for input on stdin...
+ */
+
+ if (FD_ISSET(0, &input))
+ break;
+
+ /*
+ * Check if we have a side-channel request ready...
+ */
+
+ if (side_cb && FD_ISSET(CUPS_SC_FD, &input))
+ {
+ /*
+ * Do the side-channel request, then start back over in the select
+ * loop since it may have read from print_fd...
+ */
+
+ if ((*side_cb)(0, -1, snmp_fd, addr, 0))
+ side_cb = NULL;
+ continue;
+ }
+
+ /*
+ * Do SNMP updates periodically...
+ */
+
+ if (snmp_fd >= 0 && time(&curtime) >= snmp_update)
+ {
+ if (backendSNMPSupplies(snmp_fd, addr, NULL, NULL))
+ snmp_update = INT_MAX;
+ else
+ snmp_update = curtime + 5;
+ }
+ }
+
+ /*
+ * Return with success...
+ */
+
+ return (1);
+}
+
+
+/*
+ * End of "$Id: runloop.c 9565 2011-02-23 00:08:08Z mike $".
*/
*
* Serial port backend for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
if (print_fd != 0)
close(print_fd);
- return (total_bytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
+ return (CUPS_BACKEND_OK);
}
/* Check if hidden... */
- hiddenVal = IORegistryEntrySearchCFProperty(serialService,
+ hiddenVal = IORegistryEntrySearchCFProperty(serialService,
kIOServicePlane,
CFSTR("HiddenPort"),
kCFAllocatorDefault,
- kIORegistryIterateRecursively |
+ kIORegistryIterateRecursively |
kIORegistryIterateParents);
if (hiddenVal)
CFRelease(hiddenVal); /* This interface should not be used */
sizeof(serialName),
kCFStringEncodingASCII);
CFRelease(serialNameAsCFString);
-
+
if (result)
{
bsdPathAsCFString =
sizeof(bsdPath),
kCFStringEncodingASCII);
CFRelease(bsdPathAsCFString);
-
+
if (result)
printf("serial serial:%s?baud=115200 \"Unknown\" \"%s\"\n",
bsdPath, serialName);
/*
* "$Id$"
*
- * SNMP supplies functions for the Common UNIX Printing System (CUPS).
+ * SNMP supplies functions for CUPS.
*
- * Copyright 2008-2009 by Apple Inc.
+ * Copyright 2008-2011 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
#define CUPS_MAX_SUPPLIES 32 /* Maximum number of supplies for a printer */
#define CUPS_SUPPLY_TIMEOUT 2.0 /* Timeout for SNMP lookups */
+#define CUPS_DEVELOPER_LOW 1
+#define CUPS_DEVELOPER_EMPTY 2
+#define CUPS_MARKER_SUPPLY_LOW 4
+#define CUPS_MARKER_SUPPLY_EMPTY 8
+#define CUPS_MARKER_WASTE_ALMOST_FULL 16
+#define CUPS_MARKER_WASTE_FULL 32
+#define CUPS_OPC_NEAR_EOL 64
+#define CUPS_OPC_LIFE_OVER 128
+#define CUPS_TONER_LOW 256
+#define CUPS_TONER_EMPTY 512
+
/*
* Local structures...
static int current_state = -1;
/* Current device state bits */
static int charset = -1; /* Character set for supply names */
-static int laser_printer = -1,
- /* Laser printer with toner? */
- num_supplies = 0;
+static int num_supplies = 0;
/* Number of supplies found */
static backend_supplies_t supplies[CUPS_MAX_SUPPLIES];
/* Supply information */
+static int supply_state = -1;
+ /* Supply state info */
static const int hrDeviceDescr[] =
{ CUPS_OID_hrDeviceDescr, 1, -1 };
{
{ CUPS_TC_lowPaper, "media-low-report" },
{ CUPS_TC_noPaper | CUPS_TC_inputTrayEmpty, "media-empty-warning" },
- { CUPS_TC_lowToner, "toner-low-report" },
- { CUPS_TC_noToner, "toner-empty-warning" },
+ /* { CUPS_TC_lowToner, "toner-low-report" }, */ /* now use prtMarkerSupplies */
+ /* { CUPS_TC_noToner, "toner-empty-warning" }, */ /* now use prtMarkerSupplies */
{ CUPS_TC_doorOpen, "door-open-report" },
{ CUPS_TC_jammed, "media-jam-warning" },
/* { CUPS_TC_offline, "offline-report" }, */ /* unreliable */
{ CUPS_TC_outputFull, "output-area-full-warning" }
};
+static const backend_state_t const supply_states[] =
+ {
+ { CUPS_DEVELOPER_LOW, "developer-low-report" },
+ { CUPS_DEVELOPER_EMPTY, "developer-empty-warning" },
+ { CUPS_MARKER_SUPPLY_LOW, "marker-supply-low-report" },
+ { CUPS_MARKER_SUPPLY_EMPTY, "marker-supply-empty-warning" },
+ { CUPS_MARKER_WASTE_ALMOST_FULL, "marker-waste-almost-full-report" },
+ { CUPS_MARKER_WASTE_FULL, "marker-waste-full-warning" },
+ { CUPS_OPC_NEAR_EOL, "opc-near-eol-report" },
+ { CUPS_OPC_LIFE_OVER, "opc-life-over-warning" },
+ { CUPS_TONER_LOW, "toner-low-report" },
+ { CUPS_TONER_EMPTY, "toner-empty-warning" }
+ };
+
/*
* Local functions...
if (num_supplies > 0)
{
int i, /* Looping var */
+ percent, /* Percent full */
new_state, /* New state value */
- change_state; /* State change */
+ change_state, /* State change */
+ new_supply_state = 0; /* Supply state */
char value[CUPS_MAX_SUPPLIES * 4],
/* marker-levels value string */
*ptr; /* Pointer into value string */
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
{
+ percent = 100 * supplies[i].level / supplies[i].max_capacity;
+
+ if (percent <= 10)
+ {
+ switch (supplies[i].type)
+ {
+ case CUPS_TC_toner :
+ case CUPS_TC_tonerCartridge :
+ if (percent <= 1)
+ new_supply_state |= CUPS_TONER_EMPTY;
+ else
+ new_supply_state |= CUPS_TONER_LOW;
+ break;
+ case CUPS_TC_wasteToner :
+ case CUPS_TC_wasteInk :
+ if (percent <= 1)
+ new_supply_state |= CUPS_MARKER_WASTE_FULL;
+ else
+ new_supply_state |= CUPS_MARKER_WASTE_ALMOST_FULL;
+ break;
+ case CUPS_TC_ink :
+ case CUPS_TC_inkCartridge :
+ case CUPS_TC_inkRibbon :
+ case CUPS_TC_solidWax :
+ case CUPS_TC_ribbonWax :
+ if (percent <= 1)
+ new_supply_state |= CUPS_MARKER_SUPPLY_EMPTY;
+ else
+ new_supply_state |= CUPS_MARKER_SUPPLY_LOW;
+ break;
+ case CUPS_TC_developer :
+ if (percent <= 1)
+ new_supply_state |= CUPS_DEVELOPER_EMPTY;
+ else
+ new_supply_state |= CUPS_DEVELOPER_LOW;
+ break;
+ case CUPS_TC_coronaWire :
+ case CUPS_TC_fuser :
+ case CUPS_TC_opc :
+ case CUPS_TC_transferUnit :
+ if (percent <= 1)
+ new_supply_state |= CUPS_OPC_LIFE_OVER;
+ else
+ new_supply_state |= CUPS_OPC_NEAR_EOL;
+ break;
+ }
+ }
+
if (i)
*ptr++ = ',';
if (supplies[i].max_capacity > 0)
- sprintf(ptr, "%d", 100 * supplies[i].level / supplies[i].max_capacity);
+ sprintf(ptr, "%d", percent);
else
strcpy(ptr, "-1");
}
fprintf(stderr, "ATTR: marker-levels=%s\n", value);
+ if (supply_state < 0)
+ change_state = 0xffff;
+ else
+ change_state = supply_state ^ new_supply_state;
+
+ fprintf(stderr, "DEBUG: new_supply_state=%x, change_state=%x\n",
+ new_supply_state, change_state);
+
+ for (i = 0;
+ i < (int)(sizeof(supply_states) / sizeof(supply_states[0]));
+ i ++)
+ if (change_state & supply_states[i].bit)
+ {
+ fprintf(stderr, "STATE: %c%s\n",
+ (new_supply_state & supply_states[i].bit) ? '+' : '-',
+ supply_states[i].keyword);
+ }
+
+ supply_state = new_supply_state;
+
/*
* Get the current printer status bits...
*/
else
change_state = current_state ^ new_state;
- fprintf(stderr, "DEBUG: new_state=%x, change_state=%x, laser_printer=%d\n",
- new_state, change_state, laser_printer);
+ fprintf(stderr, "DEBUG: new_state=%x, change_state=%x\n", new_state,
+ change_state);
for (i = 0;
i < (int)(sizeof(printer_states) / sizeof(printer_states[0]));
i ++)
if (change_state & printer_states[i].bit)
{
- if (!laser_printer && !strncmp(printer_states[i].keyword, "toner-", 6))
- {
- /*
- * Map toner-xxx to marker-supply-xxx to avoid confusing "out of toner"
- * messages on inkjet print queues...
- */
-
- if (printer_states[i].bit == CUPS_TC_lowToner)
- fprintf(stderr, "STATE: %cmarker-supply-low-report\n",
- (new_state & CUPS_TC_lowToner) ? '+' : '-');
- else
- fprintf(stderr, "STATE: %cmarker-supply-empty-warning\n",
- (new_state & CUPS_TC_noToner) ? '+' : '-');
- }
- else
- fprintf(stderr, "STATE: %c%s\n",
- (new_state & printer_states[i].bit) ? '+' : '-',
- printer_states[i].keyword);
+ fprintf(stderr, "STATE: %c%s\n",
+ (new_state & printer_states[i].bit) ? '+' : '-',
+ printer_states[i].keyword);
}
current_state = new_state;
* Output the marker-types attribute...
*/
- laser_printer = 0;
-
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
{
if (i)
type = supplies[i].type;
- if (type == CUPS_TC_toner)
- laser_printer = 1;
-
if (type < CUPS_TC_other || type > CUPS_TC_covers)
strcpy(ptr, "unknown");
else
}
/*
- * Then try to connect to the remote host...
+ * Then try finding the remote host...
*/
start_time = time(NULL);
sleep(10);
if (getenv("CLASS") != NULL)
+ {
+ fputs("STATE: -connecting-to-device\n", stderr);
return (CUPS_BACKEND_STOP);
+ }
+ }
+
+ /*
+ * See if the printer supports SNMP...
+ */
+
+ if ((snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family)) >= 0)
+ {
+ have_supplies = !backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count,
+ NULL);
}
+ else
+ have_supplies = start_count = 0;
+
+ /*
+ * Wait for data from the filter...
+ */
+
+ if (print_fd == 0)
+ if (!backendWaitLoop(snmp_fd, &(addrlist->addr), backendNetworkSideCB))
+ return (CUPS_BACKEND_OK);
+
+ /*
+ * Connect to the printer...
+ */
fprintf(stderr, "DEBUG: Connecting to %s:%d\n", hostname, port);
_cupsLangPrintFilter(stderr, "INFO", _("Connecting to printer."));
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv4.sin_port));
- /*
- * See if the printer supports SNMP...
- */
-
- if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
- {
- have_supplies = !backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count,
- NULL);
- }
- else
- have_supplies = start_count = 0;
-
/*
* Print everything...
*/
if (print_fd != 0)
close(print_fd);
- if (tbytes >= 0)
- _cupsLangPrintFilter(stderr, "INFO", _("Ready to print."));
+ _cupsLangPrintFilter(stderr, "INFO", _("Ready to print."));
- return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
+ return (CUPS_BACKEND_OK);
}
/*
* "$Id: usb-unix.c 7810 2008-07-29 01:11:15Z mike $"
*
- * USB port backend for the Common UNIX Printing System (CUPS).
+ * USB port backend for CUPS.
*
* This file is included from "usb.c" when compiled on UNIX/Linux.
*
- * Copyright 2007-2009 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
close(device_fd);
- return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
+ return (CUPS_BACKEND_OK);
}
#undef HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY
+
/*
* Do we have the SecPolicyCreateSSL function?
*/
#
# API library Makefile for CUPS.
#
-# Copyright 2007-2010 by Apple Inc.
+# Copyright 2007-2011 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
if (!cg->http)
{
- if ((cg->http = _httpCreate(cupsServer(), ippPort(),
+ if ((cg->http = _httpCreate(cupsServer(), ippPort(), NULL,
cupsEncryption(), AF_UNSPEC)) == NULL)
{
if (errno)
*
* Private definitions for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
# include "language-private.h"
# include "pwg-private.h"
# include "thread-private.h"
+# ifdef __APPLE__
+# include <sys/cdefs.h>
+# include <CoreFoundation/CoreFoundation.h>
+# endif /* __APPLE__ */
/*
* Prototypes...
*/
+# ifdef __APPLE__
+extern CFStringRef _cupsAppleCopyDefaultPaperID(void);
+extern int _cupsAppleGetUseLastPrinter(void);
+extern void _cupsAppleSetDefaultPaperID(CFStringRef name);
+extern void _cupsAppleSetUseLastPrinter(int uselast);
+# endif /* __APPLE__ */
+
extern http_t *_cupsConnect(void);
extern int _cupsGet1284Values(const char *device_id,
cups_option_t **values);
+extern int _cupsGetDests(http_t *http, ipp_op_t op,
+ const char *name, cups_dest_t **dests);
extern const char *_cupsGetPassword(const char *prompt);
extern void _cupsGlobalLock(void);
extern _cups_globals_t *_cupsGlobals(void);
*
* User-defined destination (and option) support for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
*
* Contents:
*
- * cupsAddDest() - Add a destination to the list of destinations.
- * cupsFreeDests() - Free the memory used by the list of destinations.
- * cupsGetDest() - Get the named destination from the list.
- * cupsGetDests() - Get the list of destinations from the default
- * server.
- * cupsGetDests2() - Get the list of destinations from the specified
- * server.
- * cupsGetNamedDest() - Get options for the named destination.
- * cupsRemoveDest() - Remove a destination from the destination list.
- * cupsSetDefaultDest() - Set the default destination.
- * cupsSetDests() - Save the list of destinations for the default
- * server.
- * cupsSetDests2() - Save the list of destinations for the specified
- * server.
- * appleCopyLocations() - Copy the location history array.
- * appleCopyNetwork() - Get the network ID for the current location.
- * appleGetPaperSize() - Get the default paper size.
- * appleGetPrinter() - Get a printer from the history array.
- * appleSetDefault() - Set the default printer for this location.
- * appleUseLastPrinter() - Get the default printer preference value.
- * cups_add_dest() - Add a destination to the array.
- * cups_compare_dests() - Compare two destinations.
- * cups_find_dest() - Find a destination using a binary search.
- * cups_get_default() - Get the default destination from an lpoptions file.
- * cups_get_dests() - Get destinations from a file.
- * cups_get_sdests() - Get destinations from a server.
- * cups_make_string() - Make a comma-separated string of values from an IPP
- * attribute.
+ * cupsAddDest() - Add a destination to the list of
+ * destinations.
+ * _cupsAppleCopyDefaultPaperID() - Get the default paper ID.
+ * _cupsAppleGetUseLastPrinter() - Get whether to use the last used printer.
+ * _cupsAppleSetDefaultPaperID() - Set the default paper id.
+ * _cupsAppleSetUseLastPrinter() - Set whether to use the last used printer.
+ * cupsFreeDests() - Free the memory used by the list of
+ * destinations.
+ * cupsGetDest() - Get the named destination from the list.
+ * _cupsGetDests() - Get destinations from a server.
+ * cupsGetDests() - Get the list of destinations from the
+ * default server.
+ * cupsGetDests2() - Get the list of destinations from the
+ * specified server.
+ * cupsGetNamedDest() - Get options for the named destination.
+ * cupsRemoveDest() - Remove a destination from the destination
+ * list.
+ * cupsSetDefaultDest() - Set the default destination.
+ * cupsSetDests() - Save the list of destinations for the
+ * default server.
+ * cupsSetDests2() - Save the list of destinations for the
+ * specified server.
+ * _cupsUserDefault() - Get the user default printer from
+ * environment variables and location
+ * information.
+ * appleCopyLocations() - Copy the location history array.
+ * appleCopyNetwork() - Get the network ID for the current
+ * location.
+ * appleGetPaperSize() - Get the default paper size.
+ * appleGetPrinter() - Get a printer from the history array.
+ * appleSetDefault() - Set the default printer for this location.
+ * cups_add_dest() - Add a destination to the array.
+ * cups_compare_dests() - Compare two destinations.
+ * cups_find_dest() - Find a destination using a binary search.
+ * cups_get_default() - Get the default destination from an
+ * lpoptions file.
+ * cups_get_dests() - Get destinations from a file.
+ * cups_make_string() - Make a comma-separated string of values
+ * from an IPP attribute.
*/
/*
#endif /* HAVE_NOTIFY_H */
#ifdef __APPLE__
-# include <sys/cdefs.h>
-# include <CoreFoundation/CoreFoundation.h>
# include <SystemConfiguration/SystemConfiguration.h>
# define kDefaultPaperIDKey CFSTR("DefaultPaperID")
# define kLocationHistoryArrayKey CFSTR("kLocationHistoryArrayKeyTMP")
# define kLocationNetworkKey CFSTR("kLocationNetworkKey")
# define kLocationPrinterIDKey CFSTR("kLocationPrinterIDKey")
# define kPMPrintingPreferences CFSTR("com.apple.print.PrintingPrefs")
+# define kCUPSPrintingPreferences CFSTR("org.cups.PrintingPrefs")
# define kUseLastPrinterAsCurrentPrinterKey CFSTR("UseLastPrinterAsCurrentPrinter")
#endif /* __APPLE__ */
static CFStringRef appleGetPrinter(CFArrayRef locations, CFStringRef network,
CFIndex *locindex);
static void appleSetDefault(const char *name);
-static int appleUseLastPrinter(void);
#endif /* __APPLE__ */
static cups_dest_t *cups_add_dest(const char *name, const char *instance,
int *num_dests, cups_dest_t **dests);
static int cups_get_dests(const char *filename, const char *match_name,
const char *match_inst, int user_default_set,
int num_dests, cups_dest_t **dests);
-static int cups_get_sdests(http_t *http, ipp_op_t op, const char *name,
- int num_dests, cups_dest_t **dests);
static char *cups_make_string(ipp_attribute_t *attr, char *buffer,
size_t bufsize);
}
+#ifdef __APPLE__
+/*
+ * '_cupsAppleCopyDefaultPaperID()' - Get the default paper ID.
+ */
+
+CFStringRef /* O - Default paper ID */
+_cupsAppleCopyDefaultPaperID(void)
+{
+ CFStringRef paper; /* Default paper ID */
+
+
+ paper = CFPreferencesCopyAppValue(kDefaultPaperIDKey,
+ kCUPSPrintingPreferences);
+
+ if (!paper)
+ paper = CFPreferencesCopyAppValue(kDefaultPaperIDKey,
+ kPMPrintingPreferences);
+
+ return (paper);
+}
+
+
+/*
+ * '_cupsAppleGetUseLastPrinter()' - Get whether to use the last used printer.
+ */
+
+int /* O - 1 to use last printer, 0 otherwise */
+_cupsAppleGetUseLastPrinter(void)
+{
+ Boolean uselast, /* Use last printer preference value */
+ uselast_set; /* Valid is set? */
+
+
+ if (getenv("CUPS_DISABLE_APPLE_DEFAULT"))
+ return (0);
+
+ uselast = CFPreferencesGetAppBooleanValue(kUseLastPrinterAsCurrentPrinterKey,
+ kCUPSPrintingPreferences,
+ &uselast_set);
+ if (!uselast_set)
+ uselast = CFPreferencesGetAppBooleanValue(kUseLastPrinterAsCurrentPrinterKey,
+ kPMPrintingPreferences,
+ &uselast_set);
+ if (!uselast_set)
+ return (1);
+ else
+ return (uselast);
+}
+
+
+/*
+ * '_cupsAppleSetDefaultPaperID()' - Set the default paper id.
+ */
+
+void
+_cupsAppleSetDefaultPaperID(
+ CFStringRef name) /* I - New paper ID */
+{
+ CFPreferencesSetAppValue(kDefaultPaperIDKey, name, kCUPSPrintingPreferences);
+}
+
+
+/*
+ * '_cupsAppleSetUseLastPrinter()' - Set whether to use the last used printer.
+ */
+
+void
+_cupsAppleSetUseLastPrinter(
+ int uselast) /* O - 1 to use last printer, 0 otherwise */
+{
+ CFPreferencesSetAppValue(kUseLastPrinterAsCurrentPrinterKey,
+ uselast ? kCFBooleanTrue : kCFBooleanFalse,
+ kCUPSPrintingPreferences);
+}
+#endif /* __APPLE__ */
+
+
/*
* 'cupsFreeDests()' - Free the memory used by the list of destinations.
*/
}
+/*
+ * '_cupsGetDests()' - Get destinations from a server.
+ *
+ * "op" is CUPS_GET_PRINTERS to get a full list, CUPS_GET_DEFAULT to get the
+ * system-wide default printer, or IPP_GET_PRINTER_ATTRIBUTES for a known
+ * printer.
+ *
+ * "name" is the name of an existing printer and is only used when "op" is
+ * IPP_GET_PRINTER_ATTRIBUTES.
+ *
+ * "dest" is initialized to point to the array of destinations.
+ *
+ * 0 is returned if there are no printers, no default printer, or the named
+ * printer does not exist, respectively.
+ *
+ * Free the memory used by the destination array using the @link cupsFreeDests@
+ * function.
+ *
+ * Note: On Mac OS X this function also gets the default paper from the system
+ * preferences (~/L/P/org.cups.PrintingPrefs.plist) and includes it in the
+ * options array for each destination that supports it.
+ */
+
+int /* O - Number of destinations */
+_cupsGetDests(http_t *http, /* I - Connection to server or CUPS_HTTP_DEFAULT */
+ ipp_op_t op, /* I - IPP operation */
+ const char *name, /* I - Name of destination */
+ cups_dest_t **dests) /* IO - Destinations */
+{
+ int num_dests = 0; /* Number of destinations */
+ cups_dest_t *dest; /* Current destination */
+ ipp_t *request, /* IPP Request */
+ *response; /* IPP Response */
+ ipp_attribute_t *attr; /* Current attribute */
+ const char *printer_name; /* printer-name attribute */
+ char uri[1024]; /* printer-uri value */
+ int num_options; /* Number of options */
+ cups_option_t *options; /* Options */
+#ifdef __APPLE__
+ char media_default[41]; /* Default paper size */
+#endif /* __APPLE__ */
+ char optname[1024], /* Option name */
+ value[2048], /* Option value */
+ *ptr; /* Pointer into name/value */
+ static const char * const pattrs[] = /* Attributes we're interested in */
+ {
+ "auth-info-required",
+ "device-uri",
+ "job-sheets-default",
+ "marker-change-time",
+ "marker-colors",
+ "marker-high-levels",
+ "marker-levels",
+ "marker-low-levels",
+ "marker-message",
+ "marker-names",
+ "marker-types",
+#ifdef __APPLE__
+ "media-supported",
+#endif /* __APPLE__ */
+ "printer-commands",
+ "printer-defaults",
+ "printer-info",
+ "printer-is-accepting-jobs",
+ "printer-is-shared",
+ "printer-location",
+ "printer-make-and-model",
+ "printer-name",
+ "printer-state",
+ "printer-state-change-time",
+ "printer-state-reasons",
+ "printer-type",
+ "printer-uri-supported"
+ };
+
+
+#ifdef __APPLE__
+ /*
+ * Get the default paper size...
+ */
+
+ appleGetPaperSize(media_default, sizeof(media_default));
+#endif /* __APPLE__ */
+
+ /*
+ * Build a CUPS_GET_PRINTERS or IPP_GET_PRINTER_ATTRIBUTES request, which
+ * require the following attributes:
+ *
+ * attributes-charset
+ * attributes-natural-language
+ * requesting-user-name
+ * printer-uri [for IPP_GET_PRINTER_ATTRIBUTES]
+ */
+
+ request = ippNewRequest(op);
+
+ ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+ "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]),
+ NULL, pattrs);
+
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
+ "requesting-user-name", NULL, cupsUser());
+
+ if (name && op != CUPS_GET_DEFAULT)
+ {
+ httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
+ "localhost", ippPort(), "/printers/%s", name);
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
+ uri);
+ }
+
+ /*
+ * Do the request and get back a response...
+ */
+
+ if ((response = cupsDoRequest(http, request, "/")) != NULL)
+ {
+ for (attr = response->attrs; attr != NULL; attr = attr->next)
+ {
+ /*
+ * Skip leading attributes until we hit a printer...
+ */
+
+ while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
+ attr = attr->next;
+
+ if (attr == NULL)
+ break;
+
+ /*
+ * Pull the needed attributes from this printer...
+ */
+
+ printer_name = NULL;
+ num_options = 0;
+ options = NULL;
+
+ for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next)
+ {
+ if (attr->value_tag != IPP_TAG_INTEGER &&
+ attr->value_tag != IPP_TAG_ENUM &&
+ attr->value_tag != IPP_TAG_BOOLEAN &&
+ attr->value_tag != IPP_TAG_TEXT &&
+ attr->value_tag != IPP_TAG_TEXTLANG &&
+ attr->value_tag != IPP_TAG_NAME &&
+ attr->value_tag != IPP_TAG_NAMELANG &&
+ attr->value_tag != IPP_TAG_KEYWORD &&
+ attr->value_tag != IPP_TAG_RANGE &&
+ attr->value_tag != IPP_TAG_URI)
+ continue;
+
+ if (!strcmp(attr->name, "auth-info-required") ||
+ !strcmp(attr->name, "device-uri") ||
+ !strcmp(attr->name, "marker-change-time") ||
+ !strcmp(attr->name, "marker-colors") ||
+ !strcmp(attr->name, "marker-high-levels") ||
+ !strcmp(attr->name, "marker-levels") ||
+ !strcmp(attr->name, "marker-low-levels") ||
+ !strcmp(attr->name, "marker-message") ||
+ !strcmp(attr->name, "marker-names") ||
+ !strcmp(attr->name, "marker-types") ||
+ !strcmp(attr->name, "printer-commands") ||
+ !strcmp(attr->name, "printer-info") ||
+ !strcmp(attr->name, "printer-is-shared") ||
+ !strcmp(attr->name, "printer-make-and-model") ||
+ !strcmp(attr->name, "printer-state") ||
+ !strcmp(attr->name, "printer-state-change-time") ||
+ !strcmp(attr->name, "printer-type") ||
+ !strcmp(attr->name, "printer-is-accepting-jobs") ||
+ !strcmp(attr->name, "printer-location") ||
+ !strcmp(attr->name, "printer-state-reasons") ||
+ !strcmp(attr->name, "printer-uri-supported"))
+ {
+ /*
+ * Add a printer description attribute...
+ */
+
+ num_options = cupsAddOption(attr->name,
+ cups_make_string(attr, value,
+ sizeof(value)),
+ num_options, &options);
+ }
+#ifdef __APPLE__
+ else if (!strcmp(attr->name, "media-supported"))
+ {
+ /*
+ * See if we can set a default media size...
+ */
+
+ int i; /* Looping var */
+
+ for (i = 0; i < attr->num_values; i ++)
+ if (!strcasecmp(media_default, attr->values[i].string.text))
+ {
+ num_options = cupsAddOption("media", media_default, num_options,
+ &options);
+ break;
+ }
+ }
+#endif /* __APPLE__ */
+ else if (!strcmp(attr->name, "printer-name") &&
+ attr->value_tag == IPP_TAG_NAME)
+ printer_name = attr->values[0].string.text;
+ else if (strncmp(attr->name, "notify-", 7) &&
+ (attr->value_tag == IPP_TAG_BOOLEAN ||
+ attr->value_tag == IPP_TAG_ENUM ||
+ attr->value_tag == IPP_TAG_INTEGER ||
+ attr->value_tag == IPP_TAG_KEYWORD ||
+ attr->value_tag == IPP_TAG_NAME ||
+ attr->value_tag == IPP_TAG_RANGE) &&
+ (ptr = strstr(attr->name, "-default")) != NULL)
+ {
+ /*
+ * Add a default option...
+ */
+
+ strlcpy(optname, attr->name, sizeof(optname));
+ optname[ptr - attr->name] = '\0';
+
+ if (strcasecmp(optname, "media") ||
+ !cupsGetOption("media", num_options, options))
+ num_options = cupsAddOption(optname,
+ cups_make_string(attr, value,
+ sizeof(value)),
+ num_options, &options);
+ }
+ }
+
+ /*
+ * See if we have everything needed...
+ */
+
+ if (!printer_name)
+ {
+ cupsFreeOptions(num_options, options);
+
+ if (attr == NULL)
+ break;
+ else
+ continue;
+ }
+
+ if ((dest = cups_add_dest(printer_name, NULL, &num_dests, dests)) != NULL)
+ {
+ dest->num_options = num_options;
+ dest->options = options;
+ }
+ else
+ cupsFreeOptions(num_options, options);
+
+ if (attr == NULL)
+ break;
+ }
+
+ ippDelete(response);
+ }
+
+ /*
+ * Return the count...
+ */
+
+ return (num_dests);
+}
+
+
/*
* 'cupsGetDests()' - Get the list of destinations from the default server.
*
{
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad NULL dests pointer"), 1);
return (0);
- }
-
- /*
- * Initialize destination array...
- */
-
- num_dests = 0;
- *dests = (cups_dest_t *)0;
+ }
/*
* Grab the printers and classes...
*/
- num_dests = cups_get_sdests(http, CUPS_GET_PRINTERS, NULL, num_dests, dests);
+ *dests = (cups_dest_t *)0;
+ num_dests = _cupsGetDests(http, CUPS_GET_PRINTERS, NULL, dests);
if (cupsLastError() >= IPP_REDIRECTION_OTHER_SITE)
{
* Get the printer's attributes...
*/
- if (!cups_get_sdests(http, op, name, 0, &dest))
+ if (!_cupsGetDests(http, op, name, &dest))
{
if (op == CUPS_GET_DEFAULT || (name && !set_as_default))
return (NULL);
* configuration file does not exist. Find out the real default.
*/
- if (!cups_get_sdests(http, CUPS_GET_DEFAULT, NULL, 0, &dest))
+ if (!_cupsGetDests(http, CUPS_GET_DEFAULT, NULL, &dest))
return (NULL);
}
* Get the server destinations...
*/
- num_temps = cups_get_sdests(http, CUPS_GET_PRINTERS, NULL, 0, &temps);
+ num_temps = _cupsGetDests(http, CUPS_GET_PRINTERS, NULL, &temps);
if (cupsLastError() >= IPP_REDIRECTION_OTHER_SITE)
{
* system preferences...
*/
- if (!appleUseLastPrinter())
+ if (!_cupsAppleGetUseLastPrinter())
{
DEBUG_puts("1_cupsUserDefault: Not using last printer as default...");
name[0] = '\0';
* 'appleGetPaperSize()' - Get the default paper size.
*/
-static char * /* O - Default paper size */
+char * /* O - Default paper size */
appleGetPaperSize(char *name, /* I - Paper size name buffer */
int namesize) /* I - Size of buffer */
{
_pwg_media_t *pwgmedia; /* PWG media size */
- defaultPaperID = CFPreferencesCopyAppValue(kDefaultPaperIDKey,
- kPMPrintingPreferences);
+ defaultPaperID = _cupsAppleCopyDefaultPaperID();
if (!defaultPaperID ||
CFGetTypeID(defaultPaperID) != CFStringGetTypeID() ||
!CFStringGetCString(defaultPaperID, name, namesize,
}
-/*
- * 'appleUseLastPrinter()' - Get the default printer preference value.
- */
-
-static int /* O - 1 to use last printer, 0 otherwise */
-appleUseLastPrinter(void)
-{
- CFPropertyListRef uselast; /* Use last printer preference value */
-
-
- if (getenv("CUPS_DISABLE_APPLE_DEFAULT"))
- return (0);
-
- if ((uselast = CFPreferencesCopyAppValue(kUseLastPrinterAsCurrentPrinterKey,
- kPMPrintingPreferences)) != NULL)
- {
- CFRelease(uselast);
-
- if (uselast == kCFBooleanFalse)
- return (0);
- }
-
- return (1);
-}
#endif /* __APPLE__ */
}
-/*
- * 'cups_get_sdests()' - Get destinations from a server.
- */
-
-static int /* O - Number of destinations */
-cups_get_sdests(http_t *http, /* I - Connection to server or CUPS_HTTP_DEFAULT */
- ipp_op_t op, /* I - IPP operation */
- const char *name, /* I - Name of destination */
- int num_dests, /* I - Number of destinations */
- cups_dest_t **dests) /* IO - Destinations */
-{
- cups_dest_t *dest; /* Current destination */
- ipp_t *request, /* IPP Request */
- *response; /* IPP Response */
- ipp_attribute_t *attr; /* Current attribute */
- const char *printer_name; /* printer-name attribute */
- char uri[1024]; /* printer-uri value */
- int num_options; /* Number of options */
- cups_option_t *options; /* Options */
-#ifdef __APPLE__
- char media_default[41]; /* Default paper size */
-#endif /* __APPLE__ */
- char optname[1024], /* Option name */
- value[2048], /* Option value */
- *ptr; /* Pointer into name/value */
- static const char * const pattrs[] = /* Attributes we're interested in */
- {
- "auth-info-required",
- "device-uri",
- "job-sheets-default",
- "marker-change-time",
- "marker-colors",
- "marker-high-levels",
- "marker-levels",
- "marker-low-levels",
- "marker-message",
- "marker-names",
- "marker-types",
-#ifdef __APPLE__
- "media-supported",
-#endif /* __APPLE__ */
- "printer-commands",
- "printer-defaults",
- "printer-info",
- "printer-is-accepting-jobs",
- "printer-is-shared",
- "printer-location",
- "printer-make-and-model",
- "printer-name",
- "printer-state",
- "printer-state-change-time",
- "printer-state-reasons",
- "printer-type",
- "printer-uri-supported"
- };
-
-
-#ifdef __APPLE__
- /*
- * Get the default paper size...
- */
-
- appleGetPaperSize(media_default, sizeof(media_default));
-#endif /* __APPLE__ */
-
- /*
- * Build a CUPS_GET_PRINTERS or IPP_GET_PRINTER_ATTRIBUTES request, which
- * require the following attributes:
- *
- * attributes-charset
- * attributes-natural-language
- * requesting-user-name
- * printer-uri [for IPP_GET_PRINTER_ATTRIBUTES]
- */
-
- request = ippNewRequest(op);
-
- ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
- "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]),
- NULL, pattrs);
-
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
- "requesting-user-name", NULL, cupsUser());
-
- if (name && op != CUPS_GET_DEFAULT)
- {
- httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
- "localhost", ippPort(), "/printers/%s", name);
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
- uri);
- }
-
- /*
- * Do the request and get back a response...
- */
-
- if ((response = cupsDoRequest(http, request, "/")) != NULL)
- {
- for (attr = response->attrs; attr != NULL; attr = attr->next)
- {
- /*
- * Skip leading attributes until we hit a printer...
- */
-
- while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
- attr = attr->next;
-
- if (attr == NULL)
- break;
-
- /*
- * Pull the needed attributes from this printer...
- */
-
- printer_name = NULL;
- num_options = 0;
- options = NULL;
-
- for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next)
- {
- if (attr->value_tag != IPP_TAG_INTEGER &&
- attr->value_tag != IPP_TAG_ENUM &&
- attr->value_tag != IPP_TAG_BOOLEAN &&
- attr->value_tag != IPP_TAG_TEXT &&
- attr->value_tag != IPP_TAG_TEXTLANG &&
- attr->value_tag != IPP_TAG_NAME &&
- attr->value_tag != IPP_TAG_NAMELANG &&
- attr->value_tag != IPP_TAG_KEYWORD &&
- attr->value_tag != IPP_TAG_RANGE &&
- attr->value_tag != IPP_TAG_URI)
- continue;
-
- if (!strcmp(attr->name, "auth-info-required") ||
- !strcmp(attr->name, "device-uri") ||
- !strcmp(attr->name, "marker-change-time") ||
- !strcmp(attr->name, "marker-colors") ||
- !strcmp(attr->name, "marker-high-levels") ||
- !strcmp(attr->name, "marker-levels") ||
- !strcmp(attr->name, "marker-low-levels") ||
- !strcmp(attr->name, "marker-message") ||
- !strcmp(attr->name, "marker-names") ||
- !strcmp(attr->name, "marker-types") ||
- !strcmp(attr->name, "printer-commands") ||
- !strcmp(attr->name, "printer-info") ||
- !strcmp(attr->name, "printer-is-shared") ||
- !strcmp(attr->name, "printer-make-and-model") ||
- !strcmp(attr->name, "printer-state") ||
- !strcmp(attr->name, "printer-state-change-time") ||
- !strcmp(attr->name, "printer-type") ||
- !strcmp(attr->name, "printer-is-accepting-jobs") ||
- !strcmp(attr->name, "printer-location") ||
- !strcmp(attr->name, "printer-state-reasons") ||
- !strcmp(attr->name, "printer-uri-supported"))
- {
- /*
- * Add a printer description attribute...
- */
-
- num_options = cupsAddOption(attr->name,
- cups_make_string(attr, value,
- sizeof(value)),
- num_options, &options);
- }
-#ifdef __APPLE__
- else if (!strcmp(attr->name, "media-supported"))
- {
- /*
- * See if we can set a default media size...
- */
-
- int i; /* Looping var */
-
- for (i = 0; i < attr->num_values; i ++)
- if (!strcasecmp(media_default, attr->values[i].string.text))
- {
- num_options = cupsAddOption("media", media_default, num_options,
- &options);
- break;
- }
- }
-#endif /* __APPLE__ */
- else if (!strcmp(attr->name, "printer-name") &&
- attr->value_tag == IPP_TAG_NAME)
- printer_name = attr->values[0].string.text;
- else if (strncmp(attr->name, "notify-", 7) &&
- (attr->value_tag == IPP_TAG_BOOLEAN ||
- attr->value_tag == IPP_TAG_ENUM ||
- attr->value_tag == IPP_TAG_INTEGER ||
- attr->value_tag == IPP_TAG_KEYWORD ||
- attr->value_tag == IPP_TAG_NAME ||
- attr->value_tag == IPP_TAG_RANGE) &&
- (ptr = strstr(attr->name, "-default")) != NULL)
- {
- /*
- * Add a default option...
- */
-
- strlcpy(optname, attr->name, sizeof(optname));
- optname[ptr - attr->name] = '\0';
-
- if (strcasecmp(optname, "media") ||
- !cupsGetOption("media", num_options, options))
- num_options = cupsAddOption(optname,
- cups_make_string(attr, value,
- sizeof(value)),
- num_options, &options);
- }
- }
-
- /*
- * See if we have everything needed...
- */
-
- if (!printer_name)
- {
- cupsFreeOptions(num_options, options);
-
- if (attr == NULL)
- break;
- else
- continue;
- }
-
- if ((dest = cups_add_dest(printer_name, NULL, &num_dests, dests)) != NULL)
- {
- dest->num_options = num_options;
- dest->options = options;
- }
- else
- cupsFreeOptions(num_options, options);
-
- if (attr == NULL)
- break;
- }
-
- ippDelete(response);
- }
-
- /*
- * Return the count...
- */
-
- return (num_dests);
-}
-
-
/*
* 'cups_make_string()' - Make a comma-separated string of values from an IPP
* attribute.
extern http_tls_credentials_t
_httpConvertCredentials(cups_array_t *credentials);
extern http_t *_httpCreate(const char *host, int port,
- http_encryption_t encryption,
+ http_addrlist_t *addrlist,
+ http_encryption_t encryption,
int family);
extern char *_httpDecodeURI(char *dst, const char *src,
size_t dstsize);
* Create the HTTP structure...
*/
- if ((http = _httpCreate(host, port, encryption, AF_UNSPEC)) == NULL)
+ if ((http = _httpCreate(host, port, NULL, encryption, AF_UNSPEC)) == NULL)
return (NULL);
/*
_httpCreate(
const char *host, /* I - Hostname */
int port, /* I - Port number */
+ http_addrlist_t *addrlist, /* I - Address list or NULL */
http_encryption_t encryption, /* I - Encryption to use */
int family) /* I - Address family or AF_UNSPEC */
{
- http_t *http; /* New HTTP connection */
- http_addrlist_t *addrlist; /* Host address data */
- char service[255]; /* Service name */
+ http_t *http; /* New HTTP connection */
+ char service[255]; /* Service name */
DEBUG_printf(("4_httpCreate(host=\"%s\", port=%d, encryption=%d)",
sprintf(service, "%d", port);
- if ((addrlist = httpAddrGetList(host, family, service)) == NULL)
- return (NULL);
+ if (!addrlist)
+ if ((addrlist = httpAddrGetList(host, family, service)) == NULL)
+ return (NULL);
/*
* Allocate memory for the structure...
if (http->timeout_value.tv_sec > 0)
{
+#ifdef WIN32
+ DWORD timeout_value = http->timeout_value.tv_sec * 1000 +
+ http->timeout_value.tv_usec / 1000;
+ /* Timeout in milliseconds */
+
+ setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout_value,
+ sizeof(timeout_value));
+ setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout_value,
+ sizeof(timeout_value));
+#else
setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, &(http->timeout_value),
sizeof(http->timeout_value));
setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, &(http->timeout_value),
sizeof(http->timeout_value));
+#endif /* WIN32 */
}
http->hostaddr = &(addr->addr);
if (http->fd >= 0)
{
+#ifdef WIN32
+ DWORD timeout_value = http->timeout_value.tv_sec * 1000 +
+ http->timeout_value.tv_usec / 1000;
+ /* Timeout in milliseconds */
+
+ setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout_value,
+ sizeof(timeout_value));
+ setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout_value,
+ sizeof(timeout_value));
+#else
setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, &(http->timeout_value),
sizeof(http->timeout_value));
setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, &(http->timeout_value),
sizeof(http->timeout_value));
+#endif /* WIN32 */
}
}
* Format the message...
*/
- snprintf(buffer, sizeof(buffer), "%s%s: %s\n", prefix ? prefix : "",
+ snprintf(buffer, sizeof(buffer), "%s%s%s: %s\n", prefix ? prefix : "",
+ prefix ? ": " : "",
_cupsLangString(cg->lang_default, message), strerror(last_errno));
/*
strcpy(charset, "UTF8");
/*
- * Apple's setlocale doesn't give us the user's localization
+ * Apple's setlocale doesn't give us the user's localization
* preference so we have to look it up this way...
*/
/*
* Find start of value...
*/
-
+
if ((ptr = strchr(s, '\"')) == NULL)
continue;
CFStringGetCString(cfstr, buffer, sizeof(buffer), kCFStringEncodingUTF8);
match->str = strdup(buffer);
+
+ DEBUG_printf(("1_cupsMessageLookup: Found \"%s\" as \"%s\"...",
+ m, buffer));
}
else
+ {
match->str = strdup(m);
+ DEBUG_printf(("1_cupsMessageLookup: Did not find \"%s\"...", m));
+ }
+
cupsArrayAdd(a, match);
if (cfm)
{
DEBUG_printf(("9appleLangDefault: mapping \"%s\" to \"%s\"...",
cg->language, apple_language_locale[i].locale));
- strlcpy(cg->language, apple_language_locale[i].locale,
+ strlcpy(cg->language, apple_language_locale[i].locale,
sizeof(cg->language));
break;
}
CFRelease(localizationList);
}
-
+
/*
* If we didn't find the language, default to en_US...
*/
char filename[1024], /* Path to cups.strings file */
applelang[256]; /* Apple language ID */
CFURLRef url; /* URL to cups.strings file */
- CFReadStreamRef stream; /* File */
- CFDictionaryRef dict; /* Localization dictionary */
+ CFReadStreamRef stream = NULL; /* File stream */
+ CFPropertyListRef plist = NULL; /* Localization file */
+#ifdef DEBUG
+ CFErrorRef error = NULL; /* Error when opening file */
+#endif /* DEBUG */
+
+
+ DEBUG_printf(("appleMessageLoad(locale=\"%s\")", locale));
/*
* Load the cups.strings file...
snprintf(filename, sizeof(filename),
CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings",
_cupsAppleLanguage(locale, applelang, sizeof(applelang)));
+ DEBUG_printf(("1appleMessageLoad: filename=\"%s\"", filename));
+
+ if (access(filename, 0))
+ {
+ /*
+ * Try alternate lproj directory names...
+ */
+
+ if (!strncmp(locale, "en", 2))
+ locale = "English";
+ else if (!strncmp(locale, "nb", 2) || !strncmp(locale, "nl", 2))
+ locale = "Dutch";
+ else if (!strncmp(locale, "fr", 2))
+ locale = "French";
+ else if (!strncmp(locale, "de", 2))
+ locale = "German";
+ else if (!strncmp(locale, "it", 2))
+ locale = "Italian";
+ else if (!strncmp(locale, "ja", 2))
+ locale = "Japanese";
+ else if (!strncmp(locale, "es", 2))
+ locale = "Spanish";
+
+ snprintf(filename, sizeof(filename),
+ CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", locale);
+ DEBUG_printf(("1appleMessageLoad: alternate filename=\"%s\"", filename));
+ }
+
+ url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+ (UInt8 *)filename,
+ strlen(filename), false);
+ if (url)
+ {
+ stream = CFReadStreamCreateWithFile(kCFAllocatorDefault, url);
+ if (stream)
+ {
+ CFReadStreamOpen(stream);
+
+#ifdef DEBUG
+ plist = CFPropertyListCreateWithStream(kCFAllocatorDefault, stream, 0,
+ kCFPropertyListImmutable, NULL,
+ &error);
+ if (error)
+ {
+ CFStringRef msg = CFErrorCopyDescription(error);
+ /* Error message */
+
+ CFStringGetCString(msg, filename, sizeof(filename),
+ kCFStringEncodingUTF8);
+ DEBUG_printf(("1appleMessageLoad: %s", filename));
+
+ CFRelease(error);
+ }
+
+#else
+ plist = CFPropertyListCreateWithStream(kCFAllocatorDefault, stream, 0,
+ kCFPropertyListImmutable, NULL,
+ NULL);
+#endif /* DEBUG */
+
+ if (plist && CFGetTypeID(plist) != CFDictionaryGetTypeID())
+ {
+ CFRelease(plist);
+ plist = NULL;
+ }
+
+ CFRelease(stream);
+ }
+
+ CFRelease(url);
+ }
- url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
- (UInt8 *)filename,
- strlen(filename), false);
- stream = CFReadStreamCreateWithFile(kCFAllocatorDefault, url);
- dict = (CFDictionaryRef)CFPropertyListCreateWithStream(
- kCFAllocatorDefault, stream, 0, kCFPropertyListImmutable, NULL,
- NULL);
- CFRelease(stream);
- CFRelease(url);
+ DEBUG_printf(("1appleMessageLoad: url=%p, stream=%p, plist=%p", url, stream,
+ plist));
/*
* Create and return an empty array to act as a cache for messages, passing the
- * dictionary as the user data.
+ * plist as the user data.
*/
- return (cupsArrayNew3((cups_array_func_t)cups_message_compare, (void *)dict,
+ return (cupsArrayNew3((cups_array_func_t)cups_message_compare, (void *)plist,
(cups_ahash_func_t)NULL, 0,
(cups_acopy_func_t)NULL,
(cups_afree_func_t)cups_message_free));
LIBRARY libcups2\r
VERSION 2.9\r
EXPORTS\r
+_cupsGet1284Values\r
+_cupsGetDests\r
_cupsGetPassword\r
_cupsGlobals\r
+_cupsLangPrintError\r
_cupsLangPrintf\r
_cupsLangPuts\r
_cupsLangString\r
_cupsStrFlush\r
_cupsStrFormatd\r
_cupsStrFree\r
+_cupsStrRetain\r
_cupsStrScand\r
_cupsStrStatistics\r
_cups_strcpy\r
_cups_strlcat\r
_cups_strlcpy\r
+_httpAddrPort\r
+_httpCreate\r
+_httpEncodeURI\r
+_httpPeek\r
_httpResolveURI\r
_httpSetTimeout\r
+_httpWait\r
_ippAddAttr\r
_ippAttrString\r
_ippFindOption\r
_ppdGetEncoding\r
_ppdGetLanguages\r
_ppdHashName\r
+_ppdLocalizedAttr\r
+_ppdNormalizeMakeAndModel\r
+_ppdParseOptions\r
_pwgCreateWithFile\r
_pwgDestroy\r
_pwgWriteFile\r
cupsArrayDup\r
cupsArrayFind\r
cupsArrayFirst\r
+cupsArrayGetIndex\r
+cupsArrayGetInsert\r
cupsArrayIndex\r
cupsArrayInsert\r
cupsArrayLast\r
cupsArrayNew\r
+cupsArrayNew2\r
+cupsArrayNew3\r
cupsArrayNext\r
cupsArrayPrev\r
cupsArrayRemove\r
cupsResolveConflicts\r
cupsSendRequest\r
cupsServer\r
+cupsSetClientCertCB\r
cupsSetCredentials\r
cupsSetDests\r
cupsSetDests2\r
cupsSetEncryption\r
cupsSetPasswordCB\r
cupsSetServer\r
+cupsSetServerCertCB\r
cupsSetUser\r
cupsTempFd\r
cupsTempFile\r
_cups_debug_fd
_cupsGet1284Values
+_cupsGetDests
_cupsGetPassword
_cupsGlobals
_cupsLangPrintError
_httpEncodeURI
_httpPeek
_httpResolveURI
+_httpSetTimeout
_httpWait
_ippAddAttr
+_ippFindOption
_ippFreeAttr
_ppdFreeLanguages
_ppdGetEncoding
# define CUPS_RASTER_SYNCv2 0x52615332 /* RaS2 */
# define CUPS_RASTER_REVSYNCv2 0x32536152 /* 2SaR */
+# define CUPS_RASTER_SYNC_PWG CUPS_RASTER_SYNCv2
+
/*
* The following definition can be used to determine if the
{
CUPS_RASTER_READ = 0, /* Open stream for reading */
CUPS_RASTER_WRITE = 1, /* Open stream for writing */
- CUPS_RASTER_WRITE_COMPRESSED = 2 /* Open stream for compressed writing @since CUPS 1.3/Mac OS X 10.5@ */
+ CUPS_RASTER_WRITE_COMPRESSED = 2, /* Open stream for compressed writing @since CUPS 1.3/Mac OS X 10.5@ */
+ CUPS_RASTER_WRITE_PWG = 3 /* Open stream for compressed writing in PWG mode @since CUPS 1.5@ */
};
typedef enum cups_mode_e cups_mode_t; /**** cupsRasterOpen modes ****/
* dictionary and is 0 if undefined.
****/
+/**** New in CUPS 1.5 ****/
+typedef ssize_t (*cups_raster_iocb_t)(void *ctx, unsigned char *buffer, size_t length);
+ /**** cupsRasterOpenIO callback function
+ *
+ * This function is specified when
+ * creating a raster stream with
+ * @link cupsRasterOpenIO@ and handles
+ * generic reading and writing of raster
+ * data. It must return -1 on error or
+ * the number of bytes specified by
+ * "length" on success.
+ ****/
+
/*
* Prototypes...
/**** New in CUPS 1.3 ****/
extern const char *cupsRasterErrorString(void) _CUPS_API_1_3;
+/**** New in CUPS 1.5 ****/
+extern cups_raster_t *cupsRasterOpenIO(cups_raster_iocb_t iocb, void *ctx,
+ cups_mode_t mode);
+
# ifdef __cplusplus
}
# endif /* __cplusplus */
if (!strncmp(argv[1], "-d", 2))
{
- filename = cupsGetPPD(argv[1] + 2);
+ const char *printer; /* Printer name */
+
+ if (argv[1][2])
+ printer = argv[1] + 2;
+ else if (argv[2])
+ printer = argv[2];
+ else
+ {
+ puts("Usage: ./testppd -d printer");
+ return (1);
+ }
+
+ filename = cupsGetPPD(printer);
+
if (!filename)
{
- printf("%s: %s\n", argv[1], cupsLastErrorString());
+ printf("%s: %s\n", printer, cupsLastErrorString());
return (1);
}
}
</TD></TR>
<TR><TD> </TD></TR>
-<TR><TD CLASS="trailer">CUPS eta CUPSen logotipoa <A HREF="http://www.apple.com">Apple Inc.</A>en marka erregistratuaj dira.
+<TR><TD CLASS="trailer">CUPS eta CUPSen logotipoa <A HREF="http://www.apple.com">Apple Inc.</A> en marka erregistratuak dira.
CUPSen copyright-a 2007-2011 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
</TABLE>
</BODY>
<li><a href="#FUNCTIONS">Functions</a><ul class="code">
<li><a href="#cupsRasterClose" title="Close a raster stream.">cupsRasterClose</a></li>
<li><a href="#cupsRasterInterpretPPD" title="Interpret PPD commands to create a page header.">cupsRasterInterpretPPD</a></li>
- <li><a href="#cupsRasterOpen" title="Open a raster stream.">cupsRasterOpen</a></li>
+ <li><a href="#cupsRasterOpen" title="Open a raster stream using a file descriptor.">cupsRasterOpen</a></li>
+ <li><a href="#cupsRasterOpenIO" title="Open a raster stream using a callback function.">cupsRasterOpenIO</a></li>
<li><a href="#cupsRasterReadHeader" title="Read a raster page header and store it in a
version 1 page header structure.">cupsRasterReadHeader</a></li>
<li><a href="#cupsRasterReadHeader2" title="Read a raster page header and store it in a
<li><a href="#cups_orient_t" title="Orientation attribute values">cups_orient_t</a></li>
<li><a href="#cups_page_header2_t" title="Version 2 page header ">cups_page_header2_t</a></li>
<li><a href="#cups_page_header_t" title="Version 1 page header ">cups_page_header_t</a></li>
+ <li><a href="#cups_raster_iocb_t" title="cupsRasterOpenIO callback function">cups_raster_iocb_t</a></li>
<li><a href="#cups_raster_t" title="Raster stream data">cups_raster_t</a></li>
</ul></li>
<li><a href="#STRUCTURES">Structures</a><ul class="code">
</p>
<h3 class="function"><a name="cupsRasterOpen">cupsRasterOpen</a></h3>
-<p class="description">Open a raster stream.</p>
+<p class="description">Open a raster stream using a file descriptor.</p>
<p class="code">
<a href="#cups_raster_t">cups_raster_t</a> *cupsRasterOpen (<br>
int fd,<br>
<dt>fd</dt>
<dd class="description">File descriptor</dd>
<dt>mode</dt>
-<dd class="description">Mode - <code>CUPS_RASTER_READ</code>, <code>CUPS_RASTER_WRITE</code>, or <code>CUPS_RASTER_WRITE_COMPRESSED</code></dd>
+<dd class="description">Mode - <code>CUPS_RASTER_READ</code>,
+<code>CUPS_RASTER_WRITE</code>,
+<code>CUPS_RASTER_WRITE_COMPRESSED</code>,
+or <code>CUPS_RASTER_WRITE_PWG</code></dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New stream</p>
image processor (RIP) filters that generate raster data, "fd" will be 1
(stdout).<br>
<br>
-When writing raster data, the <code>CUPS_RASTER_WRITE</code> or
-<code>CUPS_RASTER_WRITE_COMPRESS</code> mode can be used - compressed output
-is generally 25-50% smaller but adds a 100-300% execution time overhead.</p>
+When writing raster data, the <code>CUPS_RASTER_WRITE</code>,
+<code>CUPS_RASTER_WRITE_COMPRESS</code>, or <code>CUPS_RASTER_WRITE_PWG</code> mode can
+be used - compressed and PWG output is generally 25-50% smaller but adds a
+100-300% execution time overhead.</p>
+<h3 class="function"><a name="cupsRasterOpenIO">cupsRasterOpenIO</a></h3>
+<p class="description">Open a raster stream using a callback function.</p>
+<p class="code">
+<a href="#cups_raster_t">cups_raster_t</a> *cupsRasterOpenIO (<br>
+ <a href="#cups_raster_iocb_t">cups_raster_iocb_t</a> iocb,<br>
+ void *ctx,<br>
+ <a href="#cups_mode_t">cups_mode_t</a> mode<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>iocb</dt>
+<dd class="description">Read/write callback</dd>
+<dt>ctx</dt>
+<dd class="description">Context pointer for callback</dd>
+<dt>mode</dt>
+<dd class="description">Mode - <code>CUPS_RASTER_READ</code>,
+<code>CUPS_RASTER_WRITE</code>,
+<code>CUPS_RASTER_WRITE_COMPRESSED</code>,
+or <code>CUPS_RASTER_WRITE_PWG</code></dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">New stream</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">This function associates a raster stream with the given callback function and
+context pointer.<br>
+<br>
+When writing raster data, the <code>CUPS_RASTER_WRITE</code>,
+<code>CUPS_RASTER_WRITE_COMPRESS</code>, or <code>CUPS_RASTER_WRITE_PWG</code> mode can
+be used - compressed and PWG output is generally 25-50% smaller but adds a
+100-300% execution time overhead.</p>
<h3 class="function"><span class="info"> DEPRECATED </span><a name="cupsRasterReadHeader">cupsRasterReadHeader</a></h3>
<p class="description">Read a raster page header and store it in a
version 1 page header structure.</p>
<p class="code">
typedef struct <a href="#cups_page_header_s">cups_page_header_s</a> cups_page_header_t;
</p>
+<h3 class="typedef"><a name="cups_raster_iocb_t">cups_raster_iocb_t</a></h3>
+<p class="description">cupsRasterOpenIO callback function</p>
+<p class="code">
+typedef ssize_t (*cups_raster_iocb_t)(void *ctx, unsigned char *buffer, size_t length);
+</p>
<h3 class="typedef"><a name="cups_raster_t">cups_raster_t</a></h3>
<p class="description">Raster stream data</p>
<p class="code">
<dd class="description">Open stream for writing</dd>
<dt>CUPS_RASTER_WRITE_COMPRESSED <span class="info"> CUPS 1.3/Mac OS X 10.5 </span></dt>
<dd class="description">Open stream for compressed writing </dd>
+<dt>CUPS_RASTER_WRITE_PWG <span class="info"> CUPS 1.5 </span></dt>
+<dd class="description">Open stream for compressed writing in PWG mode </dd>
</dl>
<h3 class="enumeration"><a name="cups_order_e">cups_order_e</a></h3>
<p class="description">cupsColorOrder attribute values</p>
which influences where the job appears in the print queue. Higher
priority jobs are printed before lower priority jobs, however
submitting a new job with a high priority will not interrupt an
-</P>
+already printing job.</P>
<H3><A NAME="OUTPUTORDER">Specifying the Output Order</A></H3>
<H3><A NAME="MIRROR">Printing Mirrored Pages</A></H3>
<P>The <CODE>-o mirror</CODE> option flips each page along the
-vertical access to produce a mirrored image:</P>
+vertical axis to produce a mirrored image:</P>
<PRE CLASS="command">
lp -o mirror filename
<li><a href="#cupsEvenDuplex">cupsEvenDuplex</a></li>
<li><a href="#cupsFax">cupsFax</a></li>
<li><a href="#cupsFilter">cupsFilter</a></li>
+ <li><a href="#cupsFilter2">cupsFilter2</a></li>
<li><a href="#cupsFlipDuplex">cupsFlipDuplex</a></li>
<li><a href="#cupsIPPFinishings">cupsIPPFinishings</a></li>
<li><a href="#cupsIPPReason">cupsIPPReason</a></li>
+ <li><a href="#cupsIPPSupplies">cupsIPPSupplies</a></li>
<li><a href="#cupsLanguages">cupsLanguages</a></li>
<li><a href="#cupsManualCopies">cupsManualCopies</a></li>
<li><a href="#cupsMarkerName">cupsMarkerName</a></li>
<p>CUPS supports several methods of auto-configuration via PPD keywords.</p>
-<h3><span class='info'>Deprecated</span><a name='APAutoSetupTool'>APAutoSetupTool</a></h3>
+<h3><span class='info'>Mac OS X 10.5</span><a name='APAutoSetupTool'>APAutoSetupTool</a></h3>
<p class='summary'>*APAutoSetupTool: "/LibraryPrinters/vendor/filename"</p>
-<p>This deprecated keyword defines a program that sets the default option choices. It is run when a printer is added from the <var>Add Printer</var> window or the <var>Nearby Printers</var> list in the <var>Print</var> dialog.</p>
+<p>This Mac OS X keyword defines a program that sets the default option choices. It is run when a printer is added from the <var>Add Printer</var> window or the <var>Nearby Printers</var> list in the <var>Print</var> dialog.</p>
<p>The program is provided with two arguments: the printer's device URI and the PPD file to be used for the printer. The program must write an updated PPD file to stdout.</p>
-<blockquote><b>Note:</b>
-
-<p>This keyword is deprecated. New printer drivers SHOULD provide a CUPS command filter and support the "AutoConfigure" command. Alternately, drivers MAY use the <a href="#OID">SNMP OID</a> keywords to configure network printers or <a href="#QUERYKEYWORD">PostScript query keywords</a> to configure PostScript printers.</p>
-
-</blockquote>
<p>Examples:</p>
<pre class='command'>
<p>Examples:</p>
<pre class='command'>
-<em>*% Specify a profile for printing at 360dpi on all media types</em>
+<em>*% Specify a profile for printing at 360dpi on all media types</em>
*cupsColorProfile 360dpi/-: "1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
-<em>*% Specify a profile for printing at 720dpi on Glossy media</em>
+<em>*% Specify a profile for printing at 720dpi on Glossy media</em>
*cupsColorProfile 720dpi/Glossy: "1.0 2.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
-<em>*% Specify a default profile for printing at all other resolutions and media types</em>
+<em>*% Specify a default profile for printing at all other resolutions and media types</em>
*cupsColorProfile -/-: "0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Specify a profile for CMYK printing at 360dpi on all media types</em>
+<em>*% Specify a profile for CMYK printing at 360dpi on all media types</em>
*cupsICCProfile CMYK..360dpi/360dpi CMYK: "/Library/Printers/vendor/Profiles/foo-360-cmyk.icc"
-<em>*% Specify a profile for RGB printing at 720dpi on Glossy media</em>
+<em>*% Specify a profile for RGB printing at 720dpi on Glossy media</em>
*cupsColorProfile RGB.Glossy.720dpi/720dpi Glossy: "/Library/Printers/vendor/Profiles/foo-720-glossy-rgb.icc"
-<em>*% Specify a default profile for printing at all other resolutions and media types</em>
+<em>*% Specify a default profile for printing at all other resolutions and media types</em>
*cupsICCProfile ../Default: "/Library/Printers/vendor/Profiles/foo-default.icc"
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Specify that 2-sided printing cannot happen on transparencies</em>
+<em>*% Specify that 2-sided printing cannot happen on transparencies</em>
*cupsUIConstraints transparency: "*Duplex *MediaType Transparency"
-<em>*% Specify that envelope printing cannot happen from the paper trays</em>
+<em>*% Specify that envelope printing cannot happen from the paper trays</em>
*cupsUIConstraints envelope: "*PageSize Env10 *InputSlot Tray1"
*cupsUIConstraints envelope: "*PageSize Env10 *InputSlot Tray1"
*cupsUIConstraints envelope: "*PageSize EnvDL *InputSlot Tray2"
<em>*% Specify an installable option constraint for the envelope feeder</em>
*cupsUIConstraints: "*InputSlot EnvFeeder *InstalledEnvFeeder"
-<em>*% Specify that photo printing cannot happen on plain paper or transparencies at 1200dpi</em>
+<em>*% Specify that photo printing cannot happen on plain paper or transparencies at 1200dpi</em>
*cupsUIConstraints photo: "*OutputMode Photo *MediaType Plain *Resolution 1200dpi"
*cupsUIConstraints photo: "*OutputMode Photo *MediaType Transparency *Resolution 1200dpi"
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Specify the options to change for the 2-sided transparency constraint</em>
+<em>*% Specify the options to change for the 2-sided transparency constraint</em>
*cupsUIResolver transparency: "*Duplex None *MediaType Plain"
<em>*% Specify the options to change for the envelope printing constraints. Notice
*% manual feed first, then we change the page size...</em>
*cupsUIResolver envelope: "*InputSlot EnvFeeder *InputSlot ManualFeed *PageSize Letter"
-<em>*% Specify the options to change for the photo printing constraints</em>
+<em>*% Specify the options to change for the photo printing constraints</em>
*cupsUIResolver photo: "*OutputMode Best *Resolution 600dpi"
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Base JCL key code option</em>
+<em>*% Base JCL key code option</em>
*JCLOpenUI JCLPasscode/Key Code: PickOne
*OrderDependency: 10 JCLSetup *JCLPasscode
*DefaultJCLPasscode: None
*JCLPasscode 3333: "@PJL SET PASSCODE = 3333<0A>"
*JCLCloseUI: *JCLPasscode
-<em>*% Custom JCL key code option</em>
+<em>*% Custom JCL key code option</em>
*CustomJCLPasscode True: "@PJL SET PASSCODE = \1<0A>"
*ParamCustomJCLPasscode Code/Key Code: 1 passcode 4 4
*ParamCustomWatermarkText Text: 1 string 0 32
-<em>*% Base PostScript gamma/density option</em>
+<em>*% Base PostScript gamma/density option</em>
*OpenUI GammaDensity/Gamma and Density: PickOne
*OrderDependency: 10 AnySetup *GammaDensity
*DefaultGammaDensity: Normal
*GammaDensity Dark/Darker: "<</cupsReal1 1.1/cupsReal2 1.5>>setpagedevice"
*CloseUI: *GammaDensity
-<em>*% Custom PostScript gamma/density option</em>
+<em>*% Custom PostScript gamma/density option</em>
*CustomGammaDensity True: "<</cupsReal1 3 -1 roll/cupsReal2 5 -1>>setpagedevice"
*ParamCustomGammaDensity Gamma: 1 curve 0.1 10
*ParamCustomGammaDensity Density: 2 real 0 2
<p>Examples:</p>
<pre class='command'>
-<em>*% Flip the page image for the back side of duplexed output</em>
+<em>*% Flip the page image for the back side of duplexed output</em>
*cupsBackSide: Flipped
-<em>*% Rotate the page image for the back side of duplexed output</em>
+<em>*% Rotate the page image for the back side of duplexed output</em>
*cupsBackSide: Rotated
</pre>
<p>Example:</p>
<pre class='command'>
-<em>*% Specify the list of commands we support</em>
+<em>*% Specify the list of commands we support</em>
*cupsCommands: "AutoConfigure Clean PrintSelfTestPage ReportLevels com.vendor.foo"
</pre>
<p>Example:</p>
<pre class='command'>
-<em>*% Always send an even number of pages when duplexing</em>
+<em>*% Always send an even number of pages when duplexing</em>
*cupsEvenDuplex: true
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Standard raster printer driver filter</em>
+<em>*% Standard raster printer driver filter</em>
*cupsFilter: "application/vnd.cups-raster 100 rastertofoo"
-<em>*% Plain text filter</em>
+<em>*% Plain text filter</em>
*cupsFilter: "text/plain 10 texttofoo"
-<em>*% Pass-through filter for PostScript printers</em>
+<em>*% Pass-through filter for PostScript printers</em>
*cupsFilter: "application/vnd.cups-postscript 0 -"
</pre>
+<h3><a name='cupsFilter2'>cupsFilter2</a></h3>
+
+<p class='summary'>*cupsFilter2: "source/type destination/type cost program"</p>
+
+<p>This string keyword provides a conversion rule from the given source type to the printer's native format using the filter "program". If a printer supports the source type directly, the special filter program "-" may be specified. The destination type is automatically created as needed and is passed to the filters and backend as the FINAL_CONTENT_TYPE value.</p>
+
+<p>Examples:</p>
+
+<pre class='command'>
+<em>*% Standard raster printer driver filter</em>
+*cupsFilter2: "application/vnd.cups-raster application/vnd.foo 100 rastertofoo"
+
+<em>*% Plain text filter</em>
+*cupsFilter2: "text/plain application/vnd.foo 10 texttofoo"
+
+<em>*% Pass-through filter for PostScript printers</em>
+*cupsFilter2: "application/vnd.cups-postscript application/postscript 0 -"
+</pre>
+
<h3><span class='info'>Deprecated</span><a name='cupsFlipDuplex'>cupsFlipDuplex</a></h3>
<p class='summary'>*cupsFlipDuplex: boolean</p>
*End
</pre>
+<h3><span class='info'>CUPS 1.5</span><a name='cupsIPPSupplies'>cupsIPPSupplies</a></h3>
+
+<p class='summary'>*cupsIPPSupplies: boolean</p>
+
+<p>This keyword tells the IPP backend whether it should report the current marker-xxx supply attribute values. The default value is <code>True</code>.
+
+<p>Example:</p>
+
+<pre class='command'>
+<em>*% Do not use IPP marker-xxx attributes to report supply levels</em>
+*cupsIPPSupplies: False
+</pre>
+
<h3><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a name='cupsLanguages'>cupsLanguages</a></h3>
<p class='summary'>*cupsLanguages: "locale list"</p>
<p>Example:</p>
<pre class='command'>
-<em>*% Specify Canadian, UK, and US English, and Candian and French French</em>
+<em>*% Specify Canadian, UK, and US English, and Candian and French French</em>
*cupsLanguages: "en_CA en_UK en_US fr_CA fr_FR"
</pre>
<p>Example:</p>
<pre class='command'>
-<em>*% Tell the RIP filters to generate the copies for us</em>
+<em>*% Tell the RIP filters to generate the copies for us</em>
*cupsManualCopies: true
</pre>
<p>Example:</p>
<pre class='command'>
-<em>*% Specify an integer for a driver-specific model number</em>
+<em>*% Specify an integer for a driver-specific model number</em>
*cupsModelNumber: 1234
</pre>
*cupsPortMonitor socket/AppSocket Printing: "tbcp"
*cupsPortMonitor usb/USB Printing: "none"
-<em>*% Specify a printer-specific port monitor for an Epson USB printer</em>
+<em>*% Specify a printer-specific port monitor for an Epson USB printer</em>
*cupsPortMonitor usb/USB Status Monitor: "epson-usb"
</pre>
<p class='summary'>*cupsPreFilter: "source/type cost program"</p>
<p>This string keyword provides a pre-filter rule. The pre-filter
-program will be inserted in the conversion chain immediately
+program will be inserted in the conversion chain immediately
before the filter that accepts the given MIME type.</p>
<p>Examples:</p>
<p>Example:</p>
<pre class='command'>
-<em>*% Specify a CUPS 1.2 driver</em>
+<em>*% Specify a CUPS 1.2 driver</em>
*cupsVersion: "1.2"
</pre>
<em>*% Rotate the back side images</em>
*cupsBackSide: Rotated
-<em>*% Don't swap the top and bottom margins for the back side</em>
+<em>*% Don't swap the top and bottom margins for the back side</em>
*APDuplexRequiresFlippedMargin: false
</pre>
linenum ++;
+ fprintf(stderr, "DEBUG: %4d %s\n", linenum, line);
+
if (line[0] == '#' || !line[0])
continue;
if (bytes >= sizeof(s))
return;
- if (bytes > (buf->end - buf->current))
+ if (bytes > (size_t)(buf->end - buf->current))
{
/*
* Allocate more memory...
*
* GZIP/raw pre-filter for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1993-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* Copy the file to stdout...
*/
- setbuf(stdout, NULL);
-
while (copies > 0)
{
if (!getenv("FINAL_CONTENT_TYPE"))
cupsFileRewind(fp);
while ((bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
- if (fwrite(buffer, 1, bytes, stdout) < bytes)
+ if (write(1, buffer, bytes) < bytes)
{
_cupsLangPrintFilter(stderr, "ERROR",
_("Unable to write uncompressed print data: %s"),
- strerror(ferror(stdout)));
+ strerror(errno));
cupsFileClose(fp);
return (1);
if ((val = cupsGetOption("cupsBorderlessScalingFactor", num_options,
options)) != NULL)
{
- float sc = atof(val);
+ double sc = atof(val); /* Scale factor */
if (sc >= 0.1 && sc <= 2.0)
- h->cupsBorderlessScalingFactor = sc;
+ h->cupsBorderlessScalingFactor = (float)sc;
}
/*
top = 792.0f;
}
- h->PageSize[0] = h->cupsPageSize[0] *
- h->cupsBorderlessScalingFactor;
- h->PageSize[1] = h->cupsPageSize[1] *
- h->cupsBorderlessScalingFactor;
- h->Margins[0] = left * h->cupsBorderlessScalingFactor;
- h->Margins[1] = bottom * h->cupsBorderlessScalingFactor;
- h->ImagingBoundingBox[0] = left * h->cupsBorderlessScalingFactor;
- h->ImagingBoundingBox[1] = bottom * h->cupsBorderlessScalingFactor;
- h->ImagingBoundingBox[2] = right * h->cupsBorderlessScalingFactor;
- h->ImagingBoundingBox[3] = top * h->cupsBorderlessScalingFactor;
- h->cupsImagingBBox[0] = left;
- h->cupsImagingBBox[1] = bottom;
- h->cupsImagingBBox[2] = right;
- h->cupsImagingBBox[3] = top;
+ h->PageSize[0] = (unsigned)(h->cupsPageSize[0] *
+ h->cupsBorderlessScalingFactor);
+ h->PageSize[1] = (unsigned)(h->cupsPageSize[1] *
+ h->cupsBorderlessScalingFactor);
+ h->Margins[0] = (unsigned)(left *
+ h->cupsBorderlessScalingFactor);
+ h->Margins[1] = (unsigned)(bottom *
+ h->cupsBorderlessScalingFactor);
+ h->ImagingBoundingBox[0] = (unsigned)(left *
+ h->cupsBorderlessScalingFactor);
+ h->ImagingBoundingBox[1] = (unsigned)(bottom *
+ h->cupsBorderlessScalingFactor);
+ h->ImagingBoundingBox[2] = (unsigned)(right *
+ h->cupsBorderlessScalingFactor);
+ h->ImagingBoundingBox[3] = (unsigned)(top *
+ h->cupsBorderlessScalingFactor);
+ h->cupsImagingBBox[0] = (float)left;
+ h->cupsImagingBBox[1] = (float)bottom;
+ h->cupsImagingBBox[2] = (float)right;
+ h->cupsImagingBBox[3] = (float)top;
/*
* Use the callback to validate the page header...
if (obj[1].type == CUPS_PS_NUMBER && obj[2].type == CUPS_PS_NUMBER &&
obj[3].type == CUPS_PS_END_ARRAY)
{
- h->cupsPageSize[0] = obj[1].value.number;
- h->cupsPageSize[1] = obj[2].value.number;
+ h->cupsPageSize[0] = (float)obj[1].value.number;
+ h->cupsPageSize[1] = (float)obj[2].value.number;
h->PageSize[0] = (unsigned)obj[1].value.number;
h->PageSize[1] = (unsigned)obj[2].value.number;
h->cupsRowStep = (unsigned)obj->value.number;
else if (!strcmp(name, "cupsBorderlessScalingFactor") &&
obj->type == CUPS_PS_NUMBER)
- h->cupsBorderlessScalingFactor = obj->value.number;
+ h->cupsBorderlessScalingFactor = (float)obj->value.number;
else if (!strncmp(name, "cupsInteger", 11) && obj->type == CUPS_PS_NUMBER)
{
if ((i = atoi(name + 11)) < 0 || i > 15)
if ((i = atoi(name + 8)) < 0 || i > 15)
return (-1);
- h->cupsReal[i] = obj->value.number;
+ h->cupsReal[i] = (float)obj->value.number;
}
else if (!strncmp(name, "cupsString", 10) && obj->type == CUPS_PS_STRING)
{
fclose(fp);
}
else
- fprintf(stderr, "DEBUG: Unable to open font file \"%s\" - %s\n",
- filename, strerror(errno));
+ {
+ _cupsLangPrintError("ERROR", _("Unable to open print file"));
+ fprintf(stderr, "DEBUG: Unable to open \"%s\".\n", filename);
+ }
puts("\n%%EndResource");
}
else
{
_cupsLangPrintError("ERROR", _("Unable to open print file"));
+ fprintf(stderr, "DEBUG: Unable to open \"%s\".\n", filename);
exit(1);
}
*/
_cupsLangPrintError("ERROR", _("Unable to open print file"));
+ fprintf(stderr, "DEBUG: Unable to open \"%s\".\n", filename);
exit(1);
}
*
* Raster file routines for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* This file is part of the CUPS Imaging library.
* Contents:
*
* cupsRasterClose() - Close a raster stream.
- * cupsRasterOpen() - Open a raster stream.
+ * cupsRasterOpen() - Open a raster stream using a file descriptor.
+ * cupsRasterOpenIO() - Open a raster stream using a callback function.
* cupsRasterReadHeader() - Read a raster page header and store it in a
* version 1 page header structure.
* cupsRasterReadHeader2() - Read a raster page header and store it in a
* cupsRasterWriteHeader2() - Write a raster page header from a version 2
* page header structure.
* cupsRasterWritePixels() - Write raster pixels.
- * cups_raster_read() - Read through the raster buffer.
* cups_raster_read_header() - Read a raster page header.
+ * cups_raster_read() - Read through the raster buffer.
* cups_raster_update() - Update the raster header and row count for the
* current page.
- * cups_raster_write() - Write a row of raster data...
- * cups_read() - Read bytes from a file.
+ * cups_raster_write() - Write a row of compressed raster data...
+ * cups_read_fd() - Read bytes from a file.
* cups_swap() - Swap bytes in raster data...
- * cups_write() - Write bytes to a file.
+ * cups_write_fd() - Write bytes to a file.
*/
/*
#include "image-private.h"
#if defined(WIN32) || defined(__EMX__)
# include <io.h>
+# include <winsock2.h> /* for htonl() definition */
#else
# include <unistd.h>
#endif /* WIN32 || __EMX__ */
struct _cups_raster_s /**** Raster stream data ****/
{
unsigned sync; /* Sync word from start of stream */
- int fd; /* File descriptor */
+ void *ctx; /* File descriptor */
+ cups_raster_iocb_t iocb; /* IO callback */
cups_mode_t mode; /* Read/write mode */
cups_page_header2_t header; /* Raster header for current page */
int count, /* Current row run-length count */
unsigned char *buffer, /* Read/write buffer */
*bufptr, /* Current (read) position in buffer */
*bufend; /* End of current (read) buffer */
- int bufsize; /* Buffer size */
+ size_t bufsize; /* Buffer size */
};
static int cups_raster_read(cups_raster_t *r, unsigned char *buf,
int bytes);
static void cups_raster_update(cups_raster_t *r);
-static int cups_raster_write(cups_raster_t *r, const unsigned char *pixels);
-static int cups_read(int fd, unsigned char *buf, int bytes);
+static int cups_raster_write(cups_raster_t *r,
+ const unsigned char *pixels);
+static ssize_t cups_read_fd(void *ctx, unsigned char *buf, size_t bytes);
static void cups_swap(unsigned char *buf, int bytes);
-static int cups_write(int fd, const unsigned char *buf, int bytes);
+static ssize_t cups_write_fd(void *ctx, unsigned char *buf, size_t bytes);
/*
/*
- * 'cupsRasterOpen()' - Open a raster stream.
+ * 'cupsRasterOpen()' - Open a raster stream using a file descriptor.
*
* This function associates a raster stream with the given file descriptor.
* For most printer driver filters, "fd" will be 0 (stdin). For most raster
* image processor (RIP) filters that generate raster data, "fd" will be 1
* (stdout).
*
- * When writing raster data, the @code CUPS_RASTER_WRITE@ or
- * @code CUPS_RASTER_WRITE_COMPRESS@ mode can be used - compressed output
- * is generally 25-50% smaller but adds a 100-300% execution time overhead.
+ * When writing raster data, the @code CUPS_RASTER_WRITE@,
+ * @code CUPS_RASTER_WRITE_COMPRESS@, or @code CUPS_RASTER_WRITE_PWG@ mode can
+ * be used - compressed and PWG output is generally 25-50% smaller but adds a
+ * 100-300% execution time overhead.
*/
cups_raster_t * /* O - New stream */
cupsRasterOpen(int fd, /* I - File descriptor */
- cups_mode_t mode) /* I - Mode - @code CUPS_RASTER_READ@, @code CUPS_RASTER_WRITE@, or @code CUPS_RASTER_WRITE_COMPRESSED@ */
+ cups_mode_t mode) /* I - Mode - @code CUPS_RASTER_READ@,
+ @code CUPS_RASTER_WRITE@,
+ @code CUPS_RASTER_WRITE_COMPRESSED@,
+ or @code CUPS_RASTER_WRITE_PWG@ */
+{
+ if (mode == CUPS_RASTER_READ)
+ return (cupsRasterOpenIO(cups_read_fd, (void *)((intptr_t)fd), mode));
+ else
+ return (cupsRasterOpenIO(cups_write_fd, (void *)((intptr_t)fd), mode));
+}
+
+
+/*
+ * 'cupsRasterOpenIO()' - Open a raster stream using a callback function.
+ *
+ * This function associates a raster stream with the given callback function and
+ * context pointer.
+ *
+ * When writing raster data, the @code CUPS_RASTER_WRITE@,
+ * @code CUPS_RASTER_WRITE_COMPRESS@, or @code CUPS_RASTER_WRITE_PWG@ mode can
+ * be used - compressed and PWG output is generally 25-50% smaller but adds a
+ * 100-300% execution time overhead.
+ */
+
+cups_raster_t * /* O - New stream */
+cupsRasterOpenIO(
+ cups_raster_iocb_t iocb, /* I - Read/write callback */
+ void *ctx, /* I - Context pointer for callback */
+ cups_mode_t mode) /* I - Mode - @code CUPS_RASTER_READ@,
+ @code CUPS_RASTER_WRITE@,
+ @code CUPS_RASTER_WRITE_COMPRESSED@,
+ or @code CUPS_RASTER_WRITE_PWG@ */
{
cups_raster_t *r; /* New stream */
return (NULL);
}
- r->fd = fd;
- r->mode = mode == CUPS_RASTER_WRITE_COMPRESSED ? CUPS_RASTER_WRITE : mode;
+ r->ctx = ctx;
+ r->iocb = iocb;
+ r->mode = mode;
if (mode == CUPS_RASTER_READ)
{
* Open for read - get sync word...
*/
- if (!cups_read(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync)))
+ if ((*r->iocb)(r->ctx, (unsigned char *)&(r->sync), sizeof(r->sync)) !=
+ sizeof(r->sync))
{
_cupsRasterAddError("Unable to read header from raster stream: %s\n",
strerror(errno));
* Open for write - put sync word...
*/
- if (mode == CUPS_RASTER_WRITE_COMPRESSED)
+ switch (mode)
{
- r->compressed = 1;
- r->sync = CUPS_RASTER_SYNCv2;
+ default :
+ case CUPS_RASTER_WRITE :
+ r->sync = CUPS_RASTER_SYNC;
+ break;
+
+ case CUPS_RASTER_WRITE_COMPRESSED :
+ r->compressed = 1;
+ r->sync = CUPS_RASTER_SYNCv2;
+ break;
+
+ case CUPS_RASTER_WRITE_PWG :
+ r->compressed = 1;
+ r->sync = htonl(CUPS_RASTER_SYNC_PWG);
+ r->swapped = r->sync != CUPS_RASTER_SYNC_PWG;
+ break;
}
- else
- r->sync = CUPS_RASTER_SYNC;
- if (cups_write(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync))
+ if ((*r->iocb)(r->ctx, (unsigned char *)&(r->sync), sizeof(r->sync))
< sizeof(r->sync))
{
_cupsRasterAddError("Unable to write raster stream header: %s\n",
r->remaining -= len / r->header.cupsBytesPerLine;
- if (!cups_read(r->fd, p, len))
+ if ((*r->iocb)(r->ctx, p, len) < (ssize_t)len)
return (0);
/*
* Swap bytes as needed...
*/
- if ((r->header.cupsBitsPerColor == 16 ||
+ if (r->swapped &&
+ (r->header.cupsBitsPerColor == 16 ||
r->header.cupsBitsPerPixel == 12 ||
- r->header.cupsBitsPerPixel == 16) &&
- r->swapped)
+ r->header.cupsBitsPerPixel == 16))
cups_swap(p, len);
/*
ptr = r->pixels;
/*
- * Read using a modified TIFF "packbits" compression...
+ * Read using a modified PackBits compression...
*/
if (!cups_raster_read(r, &byte, 1))
* Copy fragment from buffer...
*/
- if ((bytes = r->pend - r->pcurrent) > remaining)
+ if ((unsigned)(bytes = r->pend - r->pcurrent) > remaining)
bytes = remaining;
memcpy(p, r->pcurrent, bytes);
cups_raster_t *r, /* I - Raster stream */
cups_page_header_t *h) /* I - Raster page header */
{
- if (r == NULL || r->mode != CUPS_RASTER_WRITE)
+ if (r == NULL || r->mode == CUPS_RASTER_READ)
return (0);
/*
* Write the raster header...
*/
- return (cups_write(r->fd, (unsigned char *)&(r->header), sizeof(r->header))
- > 0);
+ if (r->mode == CUPS_RASTER_WRITE_PWG)
+ {
+ /*
+ * PWG raster data is always network byte order with most of the page header
+ * zeroed.
+ */
+
+ cups_page_header2_t fh; /* File page header */
+
+ memset(&fh, 0, sizeof(fh));
+ fh.HWResolution[0] = htonl(r->header.HWResolution[0]);
+ fh.HWResolution[1] = htonl(r->header.HWResolution[1]);
+ fh.cupsWidth = htonl(r->header.cupsWidth);
+ fh.cupsHeight = htonl(r->header.cupsHeight);
+ fh.cupsBitsPerColor = htonl(r->header.cupsBitsPerColor);
+ fh.cupsBitsPerPixel = htonl(r->header.cupsBitsPerPixel);
+ fh.cupsBytesPerLine = htonl(r->header.cupsBytesPerLine);
+ fh.cupsColorOrder = htonl(r->header.cupsColorOrder);
+ fh.cupsColorSpace = htonl(r->header.cupsColorSpace);
+
+ return ((*r->iocb)(r->ctx, (unsigned char *)&fh, sizeof(fh)) == sizeof(fh));
+ }
+ else
+ return ((*r->iocb)(r->ctx, (unsigned char *)&(r->header), sizeof(r->header))
+ == sizeof(r->header));
}
cups_raster_t *r, /* I - Raster stream */
cups_page_header2_t *h) /* I - Raster page header */
{
- if (r == NULL || r->mode != CUPS_RASTER_WRITE)
+ if (r == NULL || r->mode == CUPS_RASTER_READ)
return (0);
/*
* Write the raster header...
*/
- return (cups_write(r->fd, (unsigned char *)&(r->header), sizeof(r->header))
- > 0);
+ if (r->mode == CUPS_RASTER_WRITE_PWG)
+ {
+ /*
+ * PWG raster data is always network byte order with most of the page header
+ * zeroed.
+ */
+
+ cups_page_header2_t fh; /* File page header */
+
+ memset(&fh, 0, sizeof(fh));
+ fh.HWResolution[0] = htonl(r->header.HWResolution[0]);
+ fh.HWResolution[1] = htonl(r->header.HWResolution[1]);
+ fh.cupsWidth = htonl(r->header.cupsWidth);
+ fh.cupsHeight = htonl(r->header.cupsHeight);
+ fh.cupsBitsPerColor = htonl(r->header.cupsBitsPerColor);
+ fh.cupsBitsPerPixel = htonl(r->header.cupsBitsPerPixel);
+ fh.cupsBytesPerLine = htonl(r->header.cupsBytesPerLine);
+ fh.cupsColorOrder = htonl(r->header.cupsColorOrder);
+ fh.cupsColorSpace = htonl(r->header.cupsColorSpace);
+
+ return ((*r->iocb)(r->ctx, (unsigned char *)&fh, sizeof(fh)) == sizeof(fh));
+ }
+ else
+ return ((*r->iocb)(r->ctx, (unsigned char *)&(r->header), sizeof(r->header))
+ == sizeof(r->header));
}
DEBUG_printf(("cupsRasterWritePixels(r=%p, p=%p, len=%u), remaining=%u\n",
r, p, len, r->remaining));
- if (r == NULL || r->mode != CUPS_RASTER_WRITE || r->remaining == 0)
+ if (r == NULL || r->mode == CUPS_RASTER_READ || r->remaining == 0)
return (0);
if (!r->compressed)
{
/*
- * Without compression, just write the raster data raw...
+ * Without compression, just write the raster data raw unless the data needs
+ * to be swapped...
*/
r->remaining -= len / r->header.cupsBytesPerLine;
- return (cups_write(r->fd, p, len));
+ if (r->swapped &&
+ (r->header.cupsBitsPerColor == 16 ||
+ r->header.cupsBitsPerPixel == 12 ||
+ r->header.cupsBitsPerPixel == 16))
+ {
+ unsigned char *bufptr; /* Pointer into write buffer */
+ unsigned count; /* Remaining count */
+
+ /*
+ * Allocate a write buffer as needed...
+ */
+
+ if ((size_t)len > r->bufsize)
+ {
+ if (r->buffer)
+ bufptr = realloc(r->buffer, len);
+ else
+ bufptr = malloc(len);
+
+ if (!bufptr)
+ return (0);
+
+ r->buffer = bufptr;
+ r->bufsize = len;
+ }
+
+ /*
+ * Byte swap the pixels...
+ */
+
+ for (bufptr = r->buffer, count = len; count > 1; count -= 2, bufptr += 2)
+ {
+ bufptr[1] = *p++;
+ bufptr[0] = *p++;
+ }
+
+ if (count) /* This should never happen... */
+ *bufptr = *p;
+
+ /*
+ * Write the byte-swapped buffer...
+ */
+
+ return ((*r->iocb)(r->ctx, r->buffer, len));
+ }
+ else
+ return ((*r->iocb)(r->ctx, p, len));
}
/*
DEBUG_printf(("cups_raster_read(r=%p, buf=%p, bytes=%d)\n", r, buf, bytes));
if (!r->compressed)
- return (cups_read(r->fd, buf, bytes));
+ return ((*r->iocb)(r->ctx, buf, bytes));
/*
* Allocate a read buffer as needed...
count = 2 * r->header.cupsBytesPerLine;
- if (count > r->bufsize)
+ if ((size_t)count > r->bufsize)
{
int offset = r->bufptr - r->buffer; /* Offset to current start of buffer */
int end = r->bufend - r->buffer; /* Offset to current end of buffer */
* Read into the raster buffer and then copy...
*/
- remaining = cups_read(r->fd, r->buffer, r->bufsize);
+ remaining = (*r->iocb)(r->ctx, r->buffer, r->bufsize);
if (remaining <= 0)
return (0);
* Read directly into "buf"...
*/
- count = cups_read(r->fd, buf, count);
+ count = (*r->iocb)(r->ctx, buf, count);
if (count <= 0)
return (0);
*/
count = r->header.cupsBytesPerLine * 2;
- if (count > r->bufsize)
+ if ((size_t)count > r->bufsize)
{
if (r->buffer)
wptr = realloc(r->buffer, count);
}
}
- return (cups_write(r->fd, r->buffer, wptr - r->buffer));
+ return ((*r->iocb)(r->ctx, r->buffer, wptr - r->buffer));
}
/*
- * 'cups_read()' - Read bytes from a file.
+ * 'cups_read_fd()' - Read bytes from a file.
*/
-static int /* O - Bytes read or -1 */
-cups_read(int fd, /* I - File descriptor */
- unsigned char *buf, /* I - Buffer for read */
- int bytes) /* I - Number of bytes to read */
+static ssize_t /* O - Bytes read or -1 */
+cups_read_fd(void *ctx, /* I - File descriptor as pointer */
+ unsigned char *buf, /* I - Buffer for read */
+ size_t bytes) /* I - Number of bytes to read */
{
- int count, /* Number of bytes read */
- total; /* Total bytes read */
+ int fd = (int)((intptr_t)ctx);
+ /* File descriptor */
+ ssize_t count; /* Number of bytes read */
+ size_t total; /* Total bytes read */
for (total = 0; total < bytes; total += count, buf += count)
}
}
- return (total);
+ return ((ssize_t)total);
}
/*
- * 'cups_write()' - Write bytes to a file.
+ * 'cups_write_fd()' - Write bytes to a file.
*/
-static int /* O - Bytes written or -1 */
-cups_write(int fd, /* I - File descriptor */
- const unsigned char *buf, /* I - Bytes to write */
- int bytes) /* I - Number of bytes to write */
+static ssize_t /* O - Bytes written or -1 */
+cups_write_fd(void *ctx, /* I - File descriptor pointer */
+ unsigned char *buf, /* I - Bytes to write */
+ size_t bytes) /* I - Number of bytes to write */
{
- int count, /* Number of bytes written */
- total; /* Total bytes written */
+ int fd = (int)((intptr_t)ctx);
+ /* File descriptor */
+ ssize_t count; /* Number of bytes written */
+ size_t total; /* Total bytes written */
for (total = 0; total < bytes; total += count, buf += count)
}
}
- return (total);
+ return ((ssize_t)total);
}
<p>CUPS supports several methods of auto-configuration via PPD keywords.</p>
-<h3><span class='info'>Deprecated</span><a name='APAutoSetupTool'>APAutoSetupTool</a></h3>
+<h3><span class='info'>Mac OS X 10.5</span><a name='APAutoSetupTool'>APAutoSetupTool</a></h3>
<p class='summary'>*APAutoSetupTool: "/LibraryPrinters/vendor/filename"</p>
-<p>This deprecated keyword defines a program that sets the default option choices. It is run when a printer is added from the <var>Add Printer</var> window or the <var>Nearby Printers</var> list in the <var>Print</var> dialog.</p>
+<p>This Mac OS X keyword defines a program that sets the default option choices. It is run when a printer is added from the <var>Add Printer</var> window or the <var>Nearby Printers</var> list in the <var>Print</var> dialog.</p>
<p>The program is provided with two arguments: the printer's device URI and the PPD file to be used for the printer. The program must write an updated PPD file to stdout.</p>
-<blockquote><b>Note:</b>
-
-<p>This keyword is deprecated. New printer drivers SHOULD provide a CUPS command filter and support the "AutoConfigure" command. Alternately, drivers MAY use the <a href="#OID">SNMP OID</a> keywords to configure network printers or <a href="#QUERYKEYWORD">PostScript query keywords</a> to configure PostScript printers.</p>
-
-</blockquote>
<p>Examples:</p>
<pre class='command'>
<p>Examples:</p>
<pre class='command'>
-<em>*% Specify a profile for printing at 360dpi on all media types</em>
+<em>*% Specify a profile for printing at 360dpi on all media types</em>
*cupsColorProfile 360dpi/-: "1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
-<em>*% Specify a profile for printing at 720dpi on Glossy media</em>
+<em>*% Specify a profile for printing at 720dpi on Glossy media</em>
*cupsColorProfile 720dpi/Glossy: "1.0 2.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
-<em>*% Specify a default profile for printing at all other resolutions and media types</em>
+<em>*% Specify a default profile for printing at all other resolutions and media types</em>
*cupsColorProfile -/-: "0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Specify a profile for CMYK printing at 360dpi on all media types</em>
+<em>*% Specify a profile for CMYK printing at 360dpi on all media types</em>
*cupsICCProfile CMYK..360dpi/360dpi CMYK: "/Library/Printers/vendor/Profiles/foo-360-cmyk.icc"
-<em>*% Specify a profile for RGB printing at 720dpi on Glossy media</em>
+<em>*% Specify a profile for RGB printing at 720dpi on Glossy media</em>
*cupsColorProfile RGB.Glossy.720dpi/720dpi Glossy: "/Library/Printers/vendor/Profiles/foo-720-glossy-rgb.icc"
-<em>*% Specify a default profile for printing at all other resolutions and media types</em>
+<em>*% Specify a default profile for printing at all other resolutions and media types</em>
*cupsICCProfile ../Default: "/Library/Printers/vendor/Profiles/foo-default.icc"
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Specify that 2-sided printing cannot happen on transparencies</em>
+<em>*% Specify that 2-sided printing cannot happen on transparencies</em>
*cupsUIConstraints transparency: "*Duplex *MediaType Transparency"
-<em>*% Specify that envelope printing cannot happen from the paper trays</em>
+<em>*% Specify that envelope printing cannot happen from the paper trays</em>
*cupsUIConstraints envelope: "*PageSize Env10 *InputSlot Tray1"
*cupsUIConstraints envelope: "*PageSize Env10 *InputSlot Tray1"
*cupsUIConstraints envelope: "*PageSize EnvDL *InputSlot Tray2"
<em>*% Specify an installable option constraint for the envelope feeder</em>
*cupsUIConstraints: "*InputSlot EnvFeeder *InstalledEnvFeeder"
-<em>*% Specify that photo printing cannot happen on plain paper or transparencies at 1200dpi</em>
+<em>*% Specify that photo printing cannot happen on plain paper or transparencies at 1200dpi</em>
*cupsUIConstraints photo: "*OutputMode Photo *MediaType Plain *Resolution 1200dpi"
*cupsUIConstraints photo: "*OutputMode Photo *MediaType Transparency *Resolution 1200dpi"
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Specify the options to change for the 2-sided transparency constraint</em>
+<em>*% Specify the options to change for the 2-sided transparency constraint</em>
*cupsUIResolver transparency: "*Duplex None *MediaType Plain"
<em>*% Specify the options to change for the envelope printing constraints. Notice
*% manual feed first, then we change the page size...</em>
*cupsUIResolver envelope: "*InputSlot EnvFeeder *InputSlot ManualFeed *PageSize Letter"
-<em>*% Specify the options to change for the photo printing constraints</em>
+<em>*% Specify the options to change for the photo printing constraints</em>
*cupsUIResolver photo: "*OutputMode Best *Resolution 600dpi"
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Base JCL key code option</em>
+<em>*% Base JCL key code option</em>
*JCLOpenUI JCLPasscode/Key Code: PickOne
*OrderDependency: 10 JCLSetup *JCLPasscode
*DefaultJCLPasscode: None
*JCLPasscode 3333: "@PJL SET PASSCODE = 3333<0A>"
*JCLCloseUI: *JCLPasscode
-<em>*% Custom JCL key code option</em>
+<em>*% Custom JCL key code option</em>
*CustomJCLPasscode True: "@PJL SET PASSCODE = \1<0A>"
*ParamCustomJCLPasscode Code/Key Code: 1 passcode 4 4
*ParamCustomWatermarkText Text: 1 string 0 32
-<em>*% Base PostScript gamma/density option</em>
+<em>*% Base PostScript gamma/density option</em>
*OpenUI GammaDensity/Gamma and Density: PickOne
*OrderDependency: 10 AnySetup *GammaDensity
*DefaultGammaDensity: Normal
*GammaDensity Dark/Darker: "<</cupsReal1 1.1/cupsReal2 1.5>>setpagedevice"
*CloseUI: *GammaDensity
-<em>*% Custom PostScript gamma/density option</em>
+<em>*% Custom PostScript gamma/density option</em>
*CustomGammaDensity True: "<</cupsReal1 3 -1 roll/cupsReal2 5 -1>>setpagedevice"
*ParamCustomGammaDensity Gamma: 1 curve 0.1 10
*ParamCustomGammaDensity Density: 2 real 0 2
<p>Examples:</p>
<pre class='command'>
-<em>*% Flip the page image for the back side of duplexed output</em>
+<em>*% Flip the page image for the back side of duplexed output</em>
*cupsBackSide: Flipped
-<em>*% Rotate the page image for the back side of duplexed output</em>
+<em>*% Rotate the page image for the back side of duplexed output</em>
*cupsBackSide: Rotated
</pre>
<p>Example:</p>
<pre class='command'>
-<em>*% Specify the list of commands we support</em>
+<em>*% Specify the list of commands we support</em>
*cupsCommands: "AutoConfigure Clean PrintSelfTestPage ReportLevels com.vendor.foo"
</pre>
<p>Example:</p>
<pre class='command'>
-<em>*% Always send an even number of pages when duplexing</em>
+<em>*% Always send an even number of pages when duplexing</em>
*cupsEvenDuplex: true
</pre>
<p>Examples:</p>
<pre class='command'>
-<em>*% Standard raster printer driver filter</em>
+<em>*% Standard raster printer driver filter</em>
*cupsFilter: "application/vnd.cups-raster 100 rastertofoo"
-<em>*% Plain text filter</em>
+<em>*% Plain text filter</em>
*cupsFilter: "text/plain 10 texttofoo"
-<em>*% Pass-through filter for PostScript printers</em>
+<em>*% Pass-through filter for PostScript printers</em>
*cupsFilter: "application/vnd.cups-postscript 0 -"
</pre>
+<h3><a name='cupsFilter2'>cupsFilter2</a></h3>
+
+<p class='summary'>*cupsFilter2: "source/type destination/type cost program"</p>
+
+<p>This string keyword provides a conversion rule from the given source type to the printer's native format using the filter "program". If a printer supports the source type directly, the special filter program "-" may be specified. The destination type is automatically created as needed and is passed to the filters and backend as the FINAL_CONTENT_TYPE value.</p>
+
+<p>Examples:</p>
+
+<pre class='command'>
+<em>*% Standard raster printer driver filter</em>
+*cupsFilter2: "application/vnd.cups-raster application/vnd.foo 100 rastertofoo"
+
+<em>*% Plain text filter</em>
+*cupsFilter2: "text/plain application/vnd.foo 10 texttofoo"
+
+<em>*% Pass-through filter for PostScript printers</em>
+*cupsFilter2: "application/vnd.cups-postscript application/postscript 0 -"
+</pre>
+
<h3><span class='info'>Deprecated</span><a name='cupsFlipDuplex'>cupsFlipDuplex</a></h3>
<p class='summary'>*cupsFlipDuplex: boolean</p>
*End
</pre>
+<h3><span class='info'>CUPS 1.5</span><a name='cupsIPPSupplies'>cupsIPPSupplies</a></h3>
+
+<p class='summary'>*cupsIPPSupplies: boolean</p>
+
+<p>This keyword tells the IPP backend whether it should report the current marker-xxx supply attribute values. The default value is <code>True</code>.
+
+<p>Example:</p>
+
+<pre class='command'>
+<em>*% Do not use IPP marker-xxx attributes to report supply levels</em>
+*cupsIPPSupplies: False
+</pre>
+
<h3><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a name='cupsLanguages'>cupsLanguages</a></h3>
<p class='summary'>*cupsLanguages: "locale list"</p>
<p>Example:</p>
<pre class='command'>
-<em>*% Specify Canadian, UK, and US English, and Candian and French French</em>
+<em>*% Specify Canadian, UK, and US English, and Candian and French French</em>
*cupsLanguages: "en_CA en_UK en_US fr_CA fr_FR"
</pre>
<p>Example:</p>
<pre class='command'>
-<em>*% Tell the RIP filters to generate the copies for us</em>
+<em>*% Tell the RIP filters to generate the copies for us</em>
*cupsManualCopies: true
</pre>
<p>Example:</p>
<pre class='command'>
-<em>*% Specify an integer for a driver-specific model number</em>
+<em>*% Specify an integer for a driver-specific model number</em>
*cupsModelNumber: 1234
</pre>
*cupsPortMonitor socket/AppSocket Printing: "tbcp"
*cupsPortMonitor usb/USB Printing: "none"
-<em>*% Specify a printer-specific port monitor for an Epson USB printer</em>
+<em>*% Specify a printer-specific port monitor for an Epson USB printer</em>
*cupsPortMonitor usb/USB Status Monitor: "epson-usb"
</pre>
<p class='summary'>*cupsPreFilter: "source/type cost program"</p>
<p>This string keyword provides a pre-filter rule. The pre-filter
-program will be inserted in the conversion chain immediately
+program will be inserted in the conversion chain immediately
before the filter that accepts the given MIME type.</p>
<p>Examples:</p>
<p>Example:</p>
<pre class='command'>
-<em>*% Specify a CUPS 1.2 driver</em>
+<em>*% Specify a CUPS 1.2 driver</em>
*cupsVersion: "1.2"
</pre>
<em>*% Rotate the back side images</em>
*cupsBackSide: Rotated
-<em>*% Don't swap the top and bottom margins for the back side</em>
+<em>*% Don't swap the top and bottom margins for the back side</em>
*APDuplexRequiresFlippedMargin: false
</pre>
*
* Raster test program routines for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
errors = do_ps_tests();
errors += do_raster_tests(CUPS_RASTER_WRITE);
errors += do_raster_tests(CUPS_RASTER_WRITE_COMPRESSED);
+ errors += do_raster_tests(CUPS_RASTER_WRITE_PWG);
}
else
{
printf("cupsRasterOpen(%s): ",
mode == CUPS_RASTER_WRITE ? "CUPS_RASTER_WRITE" :
- "CUPS_RASTER_WRITE_COMPRESSED");
+ mode == CUPS_RASTER_WRITE ? "CUPS_RASTER_WRITE_COMPRESSED" :
+ "CUPS_RASTER_WRITE_PWG");
fflush(stdout);
if ((fp = fopen("test.raster", "wb")) == NULL)
//
// Driver info file for CUPS-supplied PPDs.
//
-// Copyright 2007-2010 by Apple Inc.
+// Copyright 2007-2011 by Apple Inc.
// Copyright 1993-2006 by Easy Software Products.
//
// These coded instructions, statements, and computer programs are the
Attribute "LandscapeOrientation" "" "Plus90"
Attribute "TTRasterizer" "" "Type42"
-Copyright "Copyright 2007-2010 by Apple Inc."
+Copyright "Copyright 2007-2011 by Apple Inc."
Copyright "Copyright 1997-2007 by Easy Software Products."
Copyright ""
Copyright "These coded instructions, statements, and computer programs are the"
MediaSize w41h144
MediaSize w153h198
- Resolution k 1 0 0 0 136dpi
- Resolution k 1 0 0 0 203dpi
- *Resolution k 1 0 0 0 300dpi
+ Resolution k 1 0 0 0 136dpi
+ Resolution k 1 0 0 0 203dpi
+ *Resolution k 1 0 0 0 300dpi
Darkness 0 Light
Darkness 1 Medium
MediaSize A4
MediaSize FanFoldUS
- Resolution k 1 8 0 0 60x720dpi
+ Resolution k 1 8 0 0 60x72dpi
*Resolution k 1 8 0 0 120x72dpi
Resolution k 1 8 0 0 240x72dpi
}
Resolution - 1 0 0 0 600dpi
*InputSlot 1 Tray
- InputSlot 2 "Manual/Manual Feed"
+ InputSlot 2 "Manual/Manual Feed"
InputSlot 3 "Envelope/Envelope Feed"
*MediaType 0 "Plain/Plain Paper"
*MediaSize w288h432
- *Resolution k 1 0 0 0 300dpi
+ *Resolution k 1 0 0 0 300dpi
Group "PrinterSettings/Printer Settings"
Option "inPrintDensity/Print Density" PickOne DocumentSetup 20.0
ModelNumber $EPSON_9PIN
ColorDevice No
- Resolution k 1 8 0 0 60x720dpi
+ Resolution k 1 8 0 0 60x72dpi
*Resolution k 1 8 0 0 120x72dpi
Resolution k 1 8 0 0 240x72dpi
}
*
* Authorization routines for the CUPS scheduler.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
return;
}
#ifdef HAVE_AUTHORIZATION_H
- else if (!strncmp(authorization, "AuthRef", 6) &&
+ else if (!strncmp(authorization, "AuthRef ", 8) &&
!strcasecmp(con->http.hostname, "localhost"))
{
OSStatus status; /* Status */
* Get the Authorization Services data...
*/
- authorization += 7;
+ authorization += 8;
while (isspace(*authorization & 255))
authorization ++;
return;
}
- strlcpy(username, "_AUTHREF_", sizeof(username));
+ username[0] = '\0';
- if (!AuthorizationCopyInfo(con->authref, kAuthorizationEnvironmentUsername,
+ if (!AuthorizationCopyInfo(con->authref, kAuthorizationEnvironmentUsername,
&authinfo))
{
if (authinfo->count == 1 && authinfo->items[0].value &&
authinfo->items[0].valueLength >= 2)
+ {
strlcpy(username, authinfo->items[0].value, sizeof(username));
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "cupsdAuthorize: Authorized as \"%s\" using AuthRef",
+ username);
+ }
+
AuthorizationFreeItemSet(authinfo);
}
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "cupsdAuthorize: Authorized as \"%s\" using AuthRef",
- username);
+ if (!username[0])
+ {
+ /*
+ * No username in AuthRef, grab username using peer credentials...
+ */
+
+ struct passwd *pwd; /* Password entry for this user */
+ cupsd_ucred_t peercred; /* Peer credentials */
+ socklen_t peersize; /* Size of peer credentials */
+
+ peersize = sizeof(peercred);
+
+ if (getsockopt(con->http.fd, 0, LOCAL_PEERCRED, &peercred, &peersize))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to get peer credentials - %s",
+ strerror(errno));
+ return;
+ }
+
+ if ((pwd = getpwuid(CUPSD_UCRED_UID(peercred))) == NULL)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unable to find UID %d for peer credentials.",
+ (int)CUPSD_UCRED_UID(peercred));
+ return;
+ }
+
+ strlcpy(username, pwd->pw_name, sizeof(username));
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "cupsdAuthorize: Authorized as \"%s\" using "
+ "AuthRef + PeerCred", username);
+ }
+
con->type = CUPSD_AUTH_BASIC;
}
#endif /* HAVE_AUTHORIZATION_H */
#ifdef HAVE_GSSAPI
# ifdef HAVE_KRB5_IPC_CLIENT_SET_TARGET_UID
else if (con->http.hostaddr->addr.sa_family == AF_LOCAL &&
- !strncmp(authorization, "Negotiate", 9))
+ !strncmp(authorization, "Negotiate", 9))
{
/*
* Pull the credentials directly from the user...
cupsd_ucred_t peercred; /* Peer credentials */
socklen_t peersize; /* Size of peer credentials */
krb5_ccache peerccache; /* Peer Kerberos credentials */
- const char *peername; /* Peer username */
+ krb5_principal peerprncpl; /* Peer's default principal */
+ char *peername; /* Peer username */
peersize = sizeof(peercred);
cupsdLogMessage(CUPSD_LOG_ERROR,
"Unable to get credentials cache for UID %d (%d/%s)",
(int)CUPSD_UCRED_UID(peercred), error, strerror(errno));
+ krb5_ipc_client_clear_target();
return;
}
- if ((peername = krb5_cc_get_name(KerberosContext, peerccache)) != NULL)
+ if ((error = krb5_cc_get_principal(KerberosContext, peerccache,
+ &peerprncpl)) != 0)
{
- strlcpy(username, peername, sizeof(username));
-
- con->have_gss = 1;
- con->type = CUPSD_AUTH_NEGOTIATE;
-
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "cupsdAuthorize: Authorized as %s using Negotiate",
- username);
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unable to get Kerberos principal for UID %d",
+ (int)CUPSD_UCRED_UID(peercred));
+ krb5_cc_close(KerberosContext, peerccache);
+ krb5_ipc_client_clear_target();
+ return;
}
- else
+
+ if ((error = krb5_unparse_name(KerberosContext, peerprncpl,
+ &peername)) != 0)
+ {
cupsdLogMessage(CUPSD_LOG_ERROR,
"Unable to get Kerberos name for UID %d",
(int)CUPSD_UCRED_UID(peercred));
+ krb5_cc_close(KerberosContext, peerccache);
+ krb5_ipc_client_clear_target();
+ return;
+ }
+
+ strlcpy(username, peername, sizeof(username));
+
+ con->have_gss = 1;
+ con->type = CUPSD_AUTH_NEGOTIATE;
+
+ free(peername);
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "cupsdAuthorize: Authorized as %s using Negotiate",
+ username);
krb5_cc_close(KerberosContext, peerccache);
krb5_ipc_client_clear_target();
}
# endif /* HAVE_KRB5_IPC_CLIENT_SET_TARGET_UID */
- else if (!strncmp(authorization, "Negotiate", 9))
+ else if (!strncmp(authorization, "Negotiate", 9))
{
int len; /* Length of authorization string */
gss_ctx_id_t context; /* Authorization context */
client_name = GSS_C_NO_NAME;
major_status = gss_accept_sec_context(&minor_status,
&context,
- GSS_C_NO_CREDENTIAL,
+ GSS_C_NO_CREDENTIAL,
&input_token,
GSS_C_NO_CHANNEL_BINDINGS,
&client_name,
"cupsdAuthorize: Credentials not complete");
else if (major_status == GSS_S_COMPLETE)
{
- major_status = gss_display_name(&minor_status, client_name,
+ major_status = gss_display_name(&minor_status, client_name,
&output_token, NULL);
if (GSS_ERROR(major_status))
if ((best->encryption >= HTTP_ENCRYPT_REQUIRED && !con->http.tls &&
strcasecmp(con->http.hostname, "localhost") &&
best->satisfy == CUPSD_AUTH_SATISFY_ALL) &&
- !(type == CUPSD_AUTH_NEGOTIATE ||
+ !(type == CUPSD_AUTH_NEGOTIATE ||
(type == CUPSD_AUTH_NONE && DefaultAuthType == CUPSD_AUTH_NEGOTIATE)))
{
cupsdLogMessage(CUPSD_LOG_DEBUG,
authrights.count = 1;
authrights.items = &authright;
- authflags = kAuthorizationFlagDefaults |
+ authflags = kAuthorizationFlagDefaults |
kAuthorizationFlagExtendRights;
- if ((status = AuthorizationCopyRights(con->authref, &authrights,
- kAuthorizationEmptyEnvironment,
+ if ((status = AuthorizationCopyRights(con->authref, &authrights,
+ kAuthorizationEmptyEnvironment,
authflags, NULL)) != 0)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
if (line[0])
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Bad request line \"%s\" from %s!", line,
+ "Bad request line \"%s\" from %s!",
+ _httpEncodeURI(buf, line, sizeof(buf)),
con->http.hostname);
cupsdSendError(con, HTTP_BAD_REQUEST, CUPSD_AUTH_NONE);
cupsdCloseClient(con);
if (sscanf(version, "HTTP/%d.%d", &major, &minor) != 2)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Bad request line \"%s\" from %s!", line,
+ "Bad request line \"%s\" from %s!",
+ _httpEncodeURI(buf, line, sizeof(buf)),
con->http.hostname);
cupsdSendError(con, HTTP_BAD_REQUEST, CUPSD_AUTH_NONE);
cupsdCloseClient(con);
{
cupsdLogMessage(CUPSD_LOG_ERROR,
"Unsupported request line \"%s\" from %s!",
- line, con->http.hostname);
+ _httpEncodeURI(buf, line, sizeof(buf)),
+ con->http.hostname);
cupsdSendError(con, HTTP_NOT_SUPPORTED, CUPSD_AUTH_NONE);
cupsdCloseClient(con);
return;
if (!dir_created && !is_dir && !S_ISREG(fileinfo.st_mode))
{
- cupsdLogMessage(CUPSD_LOG_ERROR, "\"%s\" is not a regular file!", filename);
+ cupsdLogMessage(CUPSD_LOG_ERROR, "\"%s\" is not a regular file.", filename);
return (-1);
}
if (!dir_created && is_dir && !S_ISDIR(fileinfo.st_mode))
{
if (create_dir >= 0)
- cupsdLogMessage(CUPSD_LOG_ERROR, "\"%s\" is not a directory!", filename);
+ cupsdLogMessage(CUPSD_LOG_ERROR, "\"%s\" is not a directory.", filename);
else
- syslog(LOG_ERR, "\"%s\" is not a directory!", filename);
+ syslog(LOG_ERR, "\"%s\" is not a directory.", filename);
return (-1);
}
*/
cupsdLogMessage(CUPSD_LOG_NOTICE,
- "Group and SystemGroup cannot use the same groups!");
+ "Group and SystemGroup cannot use the same groups.");
cupsdLogMessage(CUPSD_LOG_INFO, "Resetting Group to \"nobody\"...");
group = getgrnam("nobody");
cupsdLogMessage(CUPSD_LOG_EMERG,
"No valid Listen or Port lines were found in the "
- "configuration file!");
+ "configuration file.");
/*
* Commit suicide...
cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to access TMPDIR (%s): %s",
tmpdir, strerror(errno));
else if (!S_ISDIR(tmpinfo.st_mode))
- cupsdLogMessage(CUPSD_LOG_ERROR, "TMPDIR (%s) is not a directory!",
+ cupsdLogMessage(CUPSD_LOG_ERROR, "TMPDIR (%s) is not a directory.",
tmpdir);
else if ((tmpinfo.st_uid != User || !(tmpinfo.st_mode & S_IWUSR)) &&
(tmpinfo.st_gid != Group || !(tmpinfo.st_mode & S_IWGRP)) &&
!(tmpinfo.st_mode & S_IWOTH))
cupsdLogMessage(CUPSD_LOG_ERROR,
- "TMPDIR (%s) has the wrong permissions!", tmpdir);
+ "TMPDIR (%s) has the wrong permissions.", tmpdir);
else
cupsdSetString(&TempDir, tmpdir);
}
if (BrowseTimeout < (2 * BrowseInterval) || BrowseTimeout <= 0)
{
- cupsdLogMessage(CUPSD_LOG_ALERT, "Invalid BrowseTimeout value %d!",
+ cupsdLogMessage(CUPSD_LOG_ALERT, "Invalid BrowseTimeout value %d.",
BrowseTimeout);
if (BrowseInterval)
else
BrowseTimeout = DEFAULT_TIMEOUT;
- cupsdLogMessage(CUPSD_LOG_ALERT, "Reset BrowseTimeout to %d!",
+ cupsdLogMessage(CUPSD_LOG_ALERT, "Reset BrowseTimeout to %d.",
BrowseTimeout);
}
if (DefaultPolicy)
- cupsdLogMessage(CUPSD_LOG_ERROR, "Default policy \"%s\" not found!",
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Default policy \"%s\" not found.",
DefaultPolicy);
cupsdSetString(&DefaultPolicy, "default");
if ((DefaultPolicyPtr = cupsdFindPolicy("default")) != NULL)
cupsdLogMessage(CUPSD_LOG_INFO,
- "Using policy \"default\" as the default!");
+ "Using policy \"default\" as the default.");
else
{
cupsdLogMessage(CUPSD_LOG_INFO,
if (!MimeDatabase)
{
cupsdLogMessage(CUPSD_LOG_EMERG,
- "Unable to load MIME database from \"%s\" or \"%s\"!",
+ "Unable to load MIME database from \"%s\" or \"%s\".",
mimedir, ServerRoot);
if (FatalErrors & CUPSD_FATAL_CONFIG)
return (0);
if ((MimeTypes = calloc(NumMimeTypes, sizeof(const char *))) == NULL)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unable to allocate memory for %d MIME types!",
+ "Unable to allocate memory for %d MIME types.",
NumMimeTypes);
NumMimeTypes = 0;
}
if (!*value)
{
- cupsdLogMessage(CUPSD_LOG_ERROR, "Bad (empty) address!");
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Bad (empty) address.");
return (NULL);
}
*/
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
- cupsdLogMessage(CUPSD_LOG_ERROR, "Hostname lookup for \"%s\" failed!",
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Hostname lookup for \"%s\" failed.",
hostname ? hostname : "(nil)");
return (addrlist);
fatal &= ~CUPSD_FATAL_PERMISSIONS;
else if (strcasecmp(valstart, "none"))
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown FatalErrors kind \"%s\" ignored!", valstart);
+ "Unknown FatalErrors kind \"%s\" ignored.", valstart);
for (valstart = valend; *valstart; valstart ++)
if (!isspace(*valstart & 255) || *valstart != ',')
protocols |= BROWSE_ALL;
else if (strcasecmp(valstart, "none"))
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown browse protocol \"%s\" ignored!", valstart);
+ "Unknown browse protocol \"%s\" ignored.", valstart);
for (valstart = valend; *valstart; valstart ++)
if (!isspace(*valstart & 255) || *valstart != ',')
{
httpAddrString(&lis->address, temp, sizeof(temp));
cupsdLogMessage(CUPSD_LOG_WARN,
- "Duplicate listen address \"%s\" ignored!", temp);
+ "Duplicate listen address \"%s\" ignored.", temp);
continue;
}
if (location == NULL)
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unable to initialize browse access control list!");
+ "Unable to initialize browse access control list.");
else if (!strncasecmp(value, "deny", 4))
location->order_type = CUPSD_AUTH_ALLOW;
else if (!strncasecmp(value, "allow", 5))
if (location == NULL)
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unable to initialize browse access control list!");
+ "Unable to initialize browse access control list.");
else
{
if (!strncasecmp(value, "from", 4))
portnum = ntohs(service->s_port);
else
{
- cupsdLogMessage(CUPSD_LOG_ERROR, "Lookup of service \"%s\" failed!",
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Lookup of service \"%s\" failed.",
portname);
continue;
}
}
else
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown User \"%s\" on line %d, ignoring!",
+ "Unknown User \"%s\" on line %d, ignoring.",
value, linenum);
}
}
Group = group->gr_gid;
else
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown Group \"%s\" on line %d, ignoring!",
+ "Unknown Group \"%s\" on line %d, ignoring.",
value, linenum);
}
}
if (!parse_groups(value))
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown SystemGroup \"%s\" on line %d, ignoring!",
+ "Unknown SystemGroup \"%s\" on line %d, ignoring.",
value, linenum);
}
else if (!strcasecmp(line, "HostNameLookups") && value)
case CUPSD_VARTYPE_INTEGER :
if (!value)
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Missing integer value for %s on line %d!",
+ "Missing integer value for %s on line %d.",
line, linenum);
else
{
if (n < 0)
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Bad negative integer value for %s on line %d!",
+ "Bad negative integer value for %s on line %d.",
line, linenum);
else
*((int *)var->ptr) = n;
case CUPSD_VARTYPE_BOOLEAN :
if (!value)
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Missing boolean value for %s on line %d!",
+ "Missing boolean value for %s on line %d.",
line, linenum);
else if (!strcasecmp(value, "true") ||
!strcasecmp(value, "on") ||
if (!value)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Missing pathname value for %s on line %d!",
+ "Missing pathname value for %s on line %d.",
line, linenum);
break;
}
{
cupsdLogMessage(CUPSD_LOG_ERROR,
"File or directory for \"%s %s\" on line %d "
- "does not exist!", line, value, linenum);
+ "does not exist.", line, value, linenum);
break;
}
*valptr; /* Pointer into value */
- if ((parent = cupsdNewLocation(location)) == NULL)
+ if ((parent = cupsdFindLocation(location)) != NULL)
+ cupsdLogMessage(CUPSD_LOG_WARN, "Duplicate <Location %s> on line %d.",
+ location, linenum);
+ else if ((parent = cupsdNewLocation(location)) == NULL)
return (0);
+ else
+ {
+ cupsdAddLocation(parent);
- cupsdAddLocation(parent);
+ parent->limit = CUPSD_AUTH_LIMIT_ALL;
+ }
- parent->limit = CUPSD_AUTH_LIMIT_ALL;
- loc = parent;
+ loc = parent;
while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
{
else if (!strcmp(value, "TRACE"))
loc->limit |= CUPSD_AUTH_LIMIT_TRACE;
else
- cupsdLogMessage(CUPSD_LOG_WARN, "Unknown request type %s on line %d!",
+ cupsdLogMessage(CUPSD_LOG_WARN, "Unknown request type %s on line %d.",
value, linenum);
for (value = valptr; isspace(*value & 255); value ++);
}
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unexpected end-of-file at line %d while reading location!",
+ "Unexpected end-of-file at line %d while reading location.",
linenum);
return ((FatalErrors & CUPSD_FATAL_CONFIG) ? 0 : linenum);
* Create the policy...
*/
- if ((pol = cupsdAddPolicy(policy)) == NULL)
+ if ((pol = cupsdFindPolicy(policy)) != NULL)
+ cupsdLogMessage(CUPSD_LOG_WARN, "Duplicate <Policy %s> on line %d.",
+ policy, linenum);
+ else if ((pol = cupsdAddPolicy(policy)) == NULL)
return (0);
/*
{
if (op)
cupsdLogMessage(CUPSD_LOG_WARN,
- "Missing </Limit> before </Policy> on line %d!",
+ "Missing </Limit> before </Policy> on line %d.",
linenum);
set_policy_defaults(pol);
ops[num_ops] = IPP_ANY_OPERATION;
else if ((ops[num_ops] = ippOpValue(value)) == IPP_BAD_OPERATION)
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Bad IPP operation name \"%s\" on line %d!",
+ "Bad IPP operation name \"%s\" on line %d.",
value, linenum);
else
num_ops ++;
}
else
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Too many operations listed on line %d!",
+ "Too many operations listed on line %d.",
linenum);
for (value = valptr; isspace(*value & 255); value ++);
}
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unexpected end-of-file at line %d while reading policy \"%s\"!",
- linenum, policy);
+ "Unexpected end-of-file at line %d while reading policy "
+ "\"%s\".", linenum, policy);
return ((FatalErrors & CUPSD_FATAL_CONFIG) ? 0 : linenum);
}
}
else if ((attr = ippFindAttribute(job->attrs, "job-sheets",
IPP_TAG_ZERO)) != NULL)
- job->sheets = attr;
+ job->job_sheets = attr;
/*
* Fill in the response info...
# ifdef HAVE_COLORSYNCREGISTERDEVICE
if (iccfile)
{
- url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+ url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
(const UInt8 *)iccfile,
strlen(iccfile), false);
cupsdReleaseJob(job);
+ cupsdAddEvent(CUPSD_EVENT_JOB_STATE, NULL, job, "Job authenticated by user");
+
cupsdLogJob(job, CUPSD_LOG_INFO, "Authenticated by \"%s\".", con->username);
+
+ cupsdCheckJobs();
}
fromattr->group_tag != IPP_TAG_ZERO) || !fromattr->name)
continue;
- if (exclude &&
+ if (exclude &&
(cupsArrayFind(exclude, fromattr->name) ||
cupsArrayFind(exclude, "all")))
{
if (filter && filter->dst)
{
- snprintf(final_content_type, sizeof(final_content_type),
- "FINAL_CONTENT_TYPE=%s/%s",
- filter->dst->super, filter->dst->type);
+ if (strchr(filter->dst->type, '/'))
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=%s", filter->dst->type);
+ 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;
}
}
*
* Log file routines for the CUPS scheduler.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
cupsFilePrintf(AccessFile,
"%s - %s %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
- con->http.hostname, con->username[0] != '\0' ? con->username : "-",
+ con->http.hostname,
+ con->username[0] != '\0' ? con->username : "-",
cupsdGetDateTime(&(con->start), LogTimeFormat),
states[con->operation],
_httpEncodeURI(temp, con->uri, sizeof(temp)),
{
char super[MIME_MAX_SUPER], /* Super-type for filter */
type[MIME_MAX_TYPE], /* Type for filter */
+ dsuper[MIME_MAX_SUPER], /* Destination super-type for filter */
+ dtype[MIME_MAX_TYPE], /* Destination type for filter */
+ dest[MIME_MAX_SUPER + MIME_MAX_TYPE + 2],
+ /* Destination super/type */
program[1024]; /* Program/filter name */
int cost; /* Cost of filter */
- mime_type_t *temptype; /* MIME type looping var */
+ mime_type_t *temptype, /* MIME type looping var */
+ *desttype; /* Destination MIME type */
char filename[1024], /* Full filter filename */
*dirsep; /* Pointer to directory separator */
struct stat fileinfo; /* File information */
/*
- * Parse the filter string; it should be in the following format:
+ * Parse the filter string; it should be in one of the following formats:
*
- * super/type cost program
+ * source/type cost program
+ * source/type dest/type cost program
*/
- if (sscanf(filter, "%15[^/]/%31s%d%*[ \t]%1023[^\n]", super, type, &cost,
- program) != 4)
+ if (sscanf(filter, "%15[^/]/%255s%*[ \t]%15[^/]/%255s%d%*[ \t]%1023[^\n]",
+ super, type, dsuper, dtype, &cost, program) == 6)
{
- cupsdLogMessage(CUPSD_LOG_ERROR, "%s: invalid filter string \"%s\"!",
- p->name, filter);
- return;
+ snprintf(dest, sizeof(dest), "%s/%s", dsuper, dtype);
+ }
+ else
+ {
+ if (sscanf(filter, "%15[^/]/%255s%d%*[ \t]%1023[^\n]", super, type, &cost,
+ program) == 4)
+ {
+ strlcpy(dest, p->name, sizeof(dest));
+ }
+ else
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "%s: invalid filter string \"%s\"!",
+ p->name, filter);
+ return;
+ }
}
/*
memset(&fileinfo, 0, sizeof(fileinfo));
snprintf(p->state_message, sizeof(p->state_message),
- "Filter \"%s\" for printer \"%s\" not available: %s",
- filename, p->name, strerror(errno));
+ "Printer driver \"%s\" not available: %s", filename,
+ strerror(errno));
cupsdSetPrinterReasons(p, "+cups-missing-filter-warning");
- cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
+ cupsdLogMessage(CUPSD_LOG_ERROR, "%s: %s", p->name, p->state_message);
}
/*
* When running as root, do additional security checks...
*/
- if (!RunUser)
+ else if (!RunUser)
{
/*
* Only use filters that are owned by root and do not have world write
* permissions.
*/
- if (fileinfo.st_uid || (fileinfo.st_mode & (S_ISUID | S_IWOTH)) != 0)
+ if (fileinfo.st_uid ||
+ (fileinfo.st_mode & (S_ISUID | S_IWGRP | S_IWOTH)) != 0)
{
- if (fileinfo.st_uid)
- snprintf(p->state_message, sizeof(p->state_message),
- "Filter \"%s\" for printer \"%s\" not owned by root",
- filename, p->name);
- else
- snprintf(p->state_message, sizeof(p->state_message),
- "Filter \"%s\" for printer \"%s\" has insecure permissions "
- "(0%o)", filename, p->name, fileinfo.st_mode);
+ snprintf(p->state_message, sizeof(p->state_message),
+ "Printer driver \"%s\" has insecure permissions (%d/0%o).",
+ filename, (int)fileinfo.st_uid, fileinfo.st_mode);
cupsdSetPrinterReasons(p, "+cups-insecure-filter-warning");
- cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
+ cupsdLogMessage(CUPSD_LOG_WARN, "%s: %s", p->name, p->state_message);
}
else if (fileinfo.st_mode)
{
(fileinfo.st_uid ||
(fileinfo.st_mode & (S_ISUID | S_IWOTH)) != 0))
{
- if (fileinfo.st_uid)
- snprintf(p->state_message, sizeof(p->state_message),
- "Filter directory \"%s\" for printer \"%s\" not owned by "
- "root", filename, p->name);
- else
- snprintf(p->state_message, sizeof(p->state_message),
- "Filter directory \"%s\" for printer \"%s\" has insecure "
- "permissions (0%o)", filename, p->name, fileinfo.st_mode);
+ snprintf(p->state_message, sizeof(p->state_message),
+ "Printer driver directory \"%s\" has insecure permissions "
+ "(%d/0%o).", filename, (int)fileinfo.st_uid,
+ fileinfo.st_mode);
cupsdSetPrinterReasons(p, "+cups-insecure-filter-warning");
- cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
+ cupsdLogMessage(CUPSD_LOG_WARN, "%s: %s", p->name, p->state_message);
}
}
}
* Add the filter to the MIME database, supporting wildcards as needed...
*/
+ if ((desttype = mimeType(MimeDatabase, "printer", dest)) == NULL)
+ {
+ desttype = mimeAddType(MimeDatabase, "printer", dest);
+ if (!p->dest_types)
+ p->dest_types = cupsArrayNew(NULL, NULL);
+
+ cupsArrayAdd(p->dest_types, desttype);
+ }
+
for (temptype = mimeFirstType(MimeDatabase);
temptype;
temptype = mimeNextType(MimeDatabase))
!strcasecmp(temptype->super, super)) &&
(type[0] == '*' || !strcasecmp(temptype->type, type)))
{
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "add_printer_filter: %s: adding filter %s/%s %s/%s %d %s",
- p->name, temptype->super, temptype->type,
- filtertype->super, filtertype->type,
- cost, program);
- mimeAddFilter(MimeDatabase, temptype, filtertype, cost, program);
+ if (desttype != filtertype)
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "add_printer_filter: %s: adding filter %s/%s %s/%s %d "
+ "%s", p->name, temptype->super, temptype->type,
+ desttype->super, desttype->type,
+ cost, program);
+ mimeAddFilter(MimeDatabase, temptype, desttype, cost, program);
+
+ if (!mimeFilterLookup(MimeDatabase, desttype, filtertype))
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "add_printer_filter: %s: adding filter %s/%s %s/%s "
+ "0 -", p->name, desttype->super, desttype->type,
+ filtertype->super, filtertype->type);
+ mimeAddFilter(MimeDatabase, desttype, filtertype, cost, "-");
+ }
+ }
+ else
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG2,
+ "add_printer_filter: %s: adding filter %s/%s %s/%s %d "
+ "%s", p->name, temptype->super, temptype->type,
+ filtertype->super, filtertype->type,
+ cost, program);
+ mimeAddFilter(MimeDatabase, temptype, filtertype, cost, program);
+ }
}
}
type;
type = mimeNextType(MimeDatabase))
{
+ if (!strcasecmp(type->super, "printer"))
+ continue;
+
snprintf(mimetype, sizeof(mimetype), "%s/%s", type->super, type->type);
if ((filters = mimeFilter(MimeDatabase, type, p->filetype, NULL)) != NULL)
strlcat(pdl, "image/jpeg,", sizeof(pdl));
else if (!strcasecmp(type->type, "png"))
strlcat(pdl, "image/png,", sizeof(pdl));
+ else if (!strcasecmp(type->type, "pwg-raster"))
+ strlcat(pdl, "image/pwg-raster,", sizeof(pdl));
}
}
cupsd_printer_t *p) /* I - Printer to remove from */
{
mime_filter_t *filter; /* MIME filter looping var */
+ mime_type_t *type; /* Destination types for filters */
/*
for (filter = mimeFirstFilter(MimeDatabase);
filter;
filter = mimeNextFilter(MimeDatabase))
- if (filter->dst == p->filetype || filter->dst == p->prefiltertype)
+ if (filter->dst == p->filetype || filter->dst == p->prefiltertype ||
+ cupsArrayFind(p->dest_types, filter->dst))
{
/*
* Delete the current filter...
mimeDeleteFilter(MimeDatabase, filter);
}
+ for (type = (mime_type_t *)cupsArrayFirst(p->dest_types);
+ type;
+ type = (mime_type_t *)cupsArrayNext(p->dest_types))
+ mimeDeleteType(MimeDatabase, type);
+
+ cupsArrayDelete(p->dest_types);
+ p->dest_types = NULL;
+
cupsdSetPrinterReasons(p, "-cups-insecure-filter-warning"
",cups-missing-filter-warning");
}
* Add any filters in the PPD file...
*/
- DEBUG_printf(("ppd->num_filters = %d\n", ppd->num_filters));
- for (i = 0; i < ppd->num_filters; i ++)
+ if ((ppd_attr = ppdFindAttr(ppd, "cupsFilter2", NULL)) != NULL)
{
- DEBUG_printf(("ppd->filters[%d] = \"%s\"\n", i, ppd->filters[i]));
- add_string_array(&(p->filters), ppd->filters[i]);
+ /*
+ * Use new cupsFilter2 filter syntax...
+ */
+
+ for (; ppd_attr; ppd_attr = ppdFindNextAttr(ppd, "cupsFilter2", NULL))
+ {
+ add_string_array(&(p->filters), ppd_attr->value);
- if (!strncasecmp(ppd->filters[i], "application/vnd.cups-command", 28) &&
- isspace(ppd->filters[i][28] & 255))
- p->type |= CUPS_PRINTER_COMMANDS;
+ if (!strncasecmp(ppd_attr->value, "application/vnd.cups-command", 28) &&
+ isspace(ppd_attr->value[28] & 255))
+ p->type |= CUPS_PRINTER_COMMANDS;
+ }
+ }
+ else
+ {
+ /*
+ * Use old cupsFilter syntax...
+ */
+
+ DEBUG_printf(("ppd->num_filters = %d\n", ppd->num_filters));
+ for (i = 0; i < ppd->num_filters; i ++)
+ {
+ DEBUG_printf(("ppd->filters[%d] = \"%s\"\n", i, ppd->filters[i]));
+ add_string_array(&(p->filters), ppd->filters[i]);
+
+ if (!strncasecmp(ppd->filters[i], "application/vnd.cups-command", 28) &&
+ isspace(ppd->filters[i][28] & 255))
+ p->type |= CUPS_PRINTER_COMMANDS;
+ }
}
if ((ppd_attr = ppdFindAttr(ppd, "cupsCommands", NULL)) != NULL &&
*/
add_string_array(&(p->filters),
- "application/vnd.cups-command 0 commandtops");
+ "application/vnd.cups-command application/postscript "
+ "0 commandtops");
p->type |= CUPS_PRINTER_COMMANDS;
}
}
for (i = 0; i < CGImageSourceGetCount(sourceRef); i ++)
{
imageRef = CGImageSourceCreateImageAtIndex(sourceRef, i, NULL);
- if (imageRef &&
- CGImageGetWidth(imageRef) == CGImageGetHeight(imageRef))
+ if (!imageRef)
+ continue;
+
+ if (CGImageGetWidth(imageRef) == CGImageGetHeight(imageRef))
{
/*
* Loop through remembering the icon closest to 128 but >= 128
CGImageRetain(imageRef);
biggestIconRef = imageRef;
}
+ }
- CGImageRelease(imageRef);
- }
+ CGImageRelease(imageRef);
}
if (biggestIconRef)
biggestIconRef;
CGImageRetain(imageRef);
CGImageRelease(biggestIconRef);
- CGImageRelease(closestTo128IconRef);
+ if (closestTo128IconRef)
+ CGImageRelease(closestTo128IconRef);
destRef = CGImageDestinationCreateWithURL(outUrl, kUTTypePNG, 1,
NULL);
if (destRef)
CGImageDestinationFinalize(destRef);
CFRelease(destRef);
}
- }
- if (imageRef)
CGImageRelease(imageRef);
+ }
CFRelease(sourceRef);
}
*
* Printer definitions for the CUPS scheduler.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
*alert_description; /* PSX printer-alert-description value */
time_t marker_time; /* Last time marker attributes were updated */
cups_array_t *filters, /* Filters for queue */
- *pre_filters; /* Pre-filters for queue */
+ *pre_filters, /* Pre-filters for queue */
+ *dest_types; /* Destination types for queue */
_pwg_t *pwg; /* PWG<->PPD mapping data */
#ifdef HAVE_DNSSD
"profile=%p, job=%p(%d), pid=%p) = %d",
command, argv, envp, infd, outfd, errfd, backfd, sidefd,
root, profile, job, job ? job->id : 0, pid, *pid);
- cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to execute %s: %s", command,
- strerror(errno));
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "%s%s \"%s\" not available: %s",
+ job && job->printer ? job->printer->name : "",
+ job && job->printer ? ": Printer driver" : "Program",
+ command, strerror(errno));
if (job && job->printer)
{
if (cupsdSetPrinterReasons(job->printer, "+cups-missing-filter-warning"))
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, job->printer, NULL,
- "Printer driver %s is missing.", command);
+ "Printer driver \"%s\" not available.", command);
}
return (0);
}
else if (!RunUser &&
- ((commandinfo.st_mode & (S_ISUID | S_IWGRP | S_IWOTH)) ||
+ ((commandinfo.st_mode & (S_ISUID | S_IWOTH)) ||
commandinfo.st_uid))
{
*pid = 0;
command, argv, envp, infd, outfd, errfd, backfd, sidefd,
root, profile, job, job ? job->id : 0, pid, *pid);
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unable to execute %s: insecure file permissions (0%o)",
- command, commandinfo.st_mode);
+ "%s%s \"%s\" has insecure permissions (%d/0%o).",
+ job && job->printer ? job->printer->name : "",
+ job && job->printer ? ": Printer driver" : "Program",
+ command, (int)commandinfo.st_uid, commandinfo.st_mode);
if (job && job->printer)
{
if (cupsdSetPrinterReasons(job->printer, "+cups-insecure-filter-warning"))
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, job->printer, NULL,
- "Printer driver %s has insecure file permissions (0%o).",
- command, commandinfo.st_mode);
+ "Printer driver \"%s\" has insecure permissions "
+ "(%d/0%o).", command,
+ (int)commandinfo.st_uid, commandinfo.st_mode);
}
errno = EPERM;
command, argv, envp, infd, outfd, errfd, backfd, sidefd,
root, profile, job, job ? job->id : 0, pid, *pid);
cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unable to execute %s: no execute permissions (0%o)",
- command, commandinfo.st_mode);
+ "%s%s \"%s\" does not have execute permissions (%d/0%o).",
+ job && job->printer ? job->printer->name : "",
+ job && job->printer ? ": Printer driver" : "Program",
+ command, (int)commandinfo.st_uid, commandinfo.st_mode);
errno = EPERM;
return (0);
}
+ else if (!RunUser && (commandinfo.st_mode & S_IWGRP))
+ {
+ cupsdLogMessage(CUPSD_LOG_WARN,
+ "%s%s \"%s\" has insecure permissions (%d/0%o).",
+ job && job->printer ? job->printer->name : "",
+ job && job->printer ? ": Printer driver" : "Program",
+ command, (int)commandinfo.st_uid, commandinfo.st_mode);
+
+ if (job && job->printer)
+ {
+ if (cupsdSetPrinterReasons(job->printer, "+cups-insecure-filter-warning"))
+ cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, job->printer, NULL,
+ "Printer driver \"%s\" has insecure permissions "
+ "(%d/0%o).", command, (int)commandinfo.st_uid,
+ commandinfo.st_mode);
+ }
+ }
#if defined(__APPLE__)
if (envp)
* Connect to the server...
*/
- if ((http = _httpCreate(vars->hostname, vars->port, vars->encryption,
+ if ((http = _httpCreate(vars->hostname, vars->port, NULL, vars->encryption,
vars->family)) == NULL)
{
print_fatal_error("Unable to connect to %s on port %d - %s", vars->hostname,
print_xml_string("string", ippOpString(op));
puts("<key>RequestAttributes</key>");
puts("<array>");
- puts("<dict>");
- for (attrptr = request->attrs, group = attrptr->group_tag;
- attrptr;
- attrptr = attrptr->next)
- print_attr(attrptr, &group);
- puts("</dict>");
+ if (request->attrs)
+ {
+ puts("<dict>");
+ for (attrptr = request->attrs, group = attrptr->group_tag;
+ attrptr;
+ attrptr = attrptr->next)
+ print_attr(attrptr, &group);
+ puts("</dict>");
+ }
puts("</array>");
}
else if (Output == _CUPS_OUTPUT_TEST)
*%
*% "$Id: testhp.ppd 6649 2007-07-11 21:46:42Z mike $"
*%
-*% Test HP PPD file for the Common UNIX Printing System (CUPS).
+*% Test HP PPD file for CUPS.
*%
-*% Copyright 2007 by Apple Inc.
+*% Copyright 2007-2011 by Apple Inc.
*% Copyright 1997-2005 by Easy Software Products.
*%
*% These coded instructions, statements, and computer programs are the
*%
*FormatVersion: "4.3"
*FileVersion: "1.1"
-*LanguageVersion: English
+*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "TESTHP.PPD"
*Manufacturer: "ESP"
-*Product: "(CUPS v1.1)"
+*Product: "(CUPS v1.5)"
*cupsVersion: 1.1
*cupsManualCopies: True
*cupsFilter: "application/vnd.cups-raster 50 rastertohp"
+*cupsFilter2: "application/vnd.cups-raster application/vnd.hp-pcl 50 rastertohp"
*ModelName: "Test HP Printer"
*ShortNickName: "Test HP Printer"
*NickName: "Test HP Printer CUPS v1.1"
*PageRegion EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageRegion
-*DefaultImageableArea: Letter
+*DefaultImageableArea: Letter
*ImageableArea Letter/US Letter: "18 36 594 756"
*ImageableArea Legal/US Legal: "18 36 594 972"
*ImageableArea Executive/US Executive: "18 36 504 684"
#
# Make an ipptool package for CUPS.
#
-# Copyright 2007-2010 by Apple Inc.
+# Copyright 2007-2011 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
cp doc/help/man-ipptool*.html $pkgdir
cp test/create-printer-subscription.test $pkgdir
cp test/get-completed-jobs.test test/get-jobs.test $pkgdir
+cp test/get-printer-attributes.test $pkgdir
cp test/ipp-[12].*.test $pkgdir
cp test/ipptool-static $pkgdir/ipptool
cp test/testfile.* $pkgdir
Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual C++ Express 2005\r
+# Visual Studio 2005\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcups2", "libcups2.vcproj", "{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}"\r
EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcupsimage2", "libcupsimage2.vcproj", "{CB4AA6F2-3E84-45BE-B505-95CD375E1234}"\r
+ ProjectSection(ProjectDependencies) = postProject\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3} = {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}\r
+ EndProjectSection\r
+EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "testfile.vcproj", "{CE75FC5F-E0CF-45DC-AD27-84666D3FBA30}"\r
ProjectSection(ProjectDependencies) = postProject\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3} = {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cupstestppd", "cupstestppd.vcproj", "{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}"\r
ProjectSection(ProjectDependencies) = postProject\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3} = {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234} = {CB4AA6F2-3E84-45BE-B505-95CD375E1234}\r
EndProjectSection\r
EndProject\r
Global\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|Win32.Build.0 = Debug|Win32\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|x64.ActiveCfg = Debug|x64\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|x64.Build.0 = Debug|x64\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Debug|Win32.Build.0 = Debug|Win32\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Debug|x64.ActiveCfg = Debug|x64\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Debug|x64.Build.0 = Debug|x64\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Release|Win32.ActiveCfg = Release|Win32\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Release|Win32.Build.0 = Release|Win32\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Release|x64.ActiveCfg = Release|x64\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Release|x64.Build.0 = Release|x64\r
{CE75FC5F-E0CF-45DC-AD27-84666D3FBA30}.Debug|Win32.ActiveCfg = Debug|Win32\r
{CE75FC5F-E0CF-45DC-AD27-84666D3FBA30}.Debug|Win32.Build.0 = Debug|Win32\r
{CE75FC5F-E0CF-45DC-AD27-84666D3FBA30}.Debug|x64.ActiveCfg = Debug|x64\r
{90B0058C-8393-411F-BD3B-E2C831D4E883}.Release|x64.Build.0 = Debug|x64\r
{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|Win32.ActiveCfg = Debug|Win32\r
{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|Win32.Build.0 = Debug|Win32\r
- {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|x64.ActiveCfg = Debug|Win32\r
+ {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|x64.ActiveCfg = Debug|x64\r
+ {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|x64.Build.0 = Debug|x64\r
{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|Win32.ActiveCfg = Release|Win32\r
{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|Win32.Build.0 = Release|Win32\r
- {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|x64.ActiveCfg = Release|Win32\r
+ {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|x64.ActiveCfg = Release|x64\r
+ {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|x64.Build.0 = Release|x64\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
<Platform\r
Name="Win32"\r
/>\r
+ <Platform\r
+ Name="x64"\r
+ />\r
</Platforms>\r
<ToolFiles>\r
</ToolFiles>\r
Name="VCPostBuildEventTool"\r
/>\r
</Configuration>\r
+ <Configuration\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="..;..\vcnet"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="1"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="2"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalIncludeDirectories="..;..\vcnet"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="1"\r
+ Detect64BitPortabilityProblems="true"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="1"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
</Configurations>\r
<References>\r
</References>\r
RelativePath="..\systemv\cupstestppd.c"\r
>\r
</File>\r
- <File\r
- RelativePath="..\filter\error.c"\r
- >\r
- </File>\r
- <File\r
- RelativePath="..\filter\interpret.c"\r
- >\r
- </File>\r
- <File\r
- RelativePath="..\filter\raster.c"\r
- >\r
- </File>\r
</Filter>\r
<Filter\r
Name="Header Files"\r
Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
>\r
- <File\r
- RelativePath="..\cups\raster.h"\r
- >\r
- </File>\r
</Filter>\r
<Filter\r
Name="Resource Files"\r
/>\r
</Configuration>\r
<Configuration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
ConfigurationType="2"\r
/>\r
<Tool\r
Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- Optimization="1"\r
+ Optimization="0"\r
AdditionalIncludeDirectories="..\vcnet,.."\r
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
- RuntimeLibrary="2"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ BufferSecurityCheck="true"\r
UsePrecompiledHeader="0"\r
WarningLevel="3"\r
Detect64BitPortabilityProblems="false"\r
Name="VCLinkerTool"\r
AdditionalDependencies="ws2_32.lib advapi32.lib"\r
OutputFile="$(OutDir)\libcups2.dll"\r
- LinkIncremental="1"\r
+ LinkIncremental="2"\r
ModuleDefinitionFile="..\cups\libcups2.def"\r
GenerateDebugInformation="true"\r
- ProgramDatabaseFile="libcups2.pdb"\r
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\libcups2.pdb"\r
SubSystem="2"\r
- OptimizeReferences="2"\r
- EnableCOMDATFolding="2"\r
ImportLibrary="$(OutDir)\libcups2.lib"\r
- TargetMachine="1"\r
+ TargetMachine="17"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
<Tool\r
Name="VCPostBuildEventTool"\r
- CommandLine="if not "%RC_XBS%" == "YES" goto END
if not exist "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)" mkdir "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
:END
"\r
/>\r
</Configuration>\r
<Configuration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
ConfigurationType="2"\r
/>\r
<Tool\r
Name="VCMIDLTool"\r
- TargetEnvironment="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- Optimization="0"\r
+ Optimization="1"\r
AdditionalIncludeDirectories="..\vcnet,.."\r
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
- MinimalRebuild="true"\r
- BasicRuntimeChecks="3"\r
- RuntimeLibrary="3"\r
- BufferSecurityCheck="true"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ RuntimeLibrary="2"\r
UsePrecompiledHeader="0"\r
WarningLevel="3"\r
Detect64BitPortabilityProblems="false"\r
Name="VCLinkerTool"\r
AdditionalDependencies="ws2_32.lib advapi32.lib"\r
OutputFile="$(OutDir)\libcups2.dll"\r
- LinkIncremental="2"\r
+ LinkIncremental="1"\r
ModuleDefinitionFile="..\cups\libcups2.def"\r
GenerateDebugInformation="true"\r
- ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\libcups2.pdb"\r
+ ProgramDatabaseFile="libcups2.pdb"\r
SubSystem="2"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
ImportLibrary="$(OutDir)\libcups2.lib"\r
- TargetMachine="17"\r
+ TargetMachine="1"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
<Tool\r
Name="VCPostBuildEventTool"\r
+ CommandLine="if not "%RC_XBS%" == "YES" goto END
if not exist "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)" mkdir "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
:END
"\r
/>\r
</Configuration>\r
<Configuration\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
</FileConfiguration>\r
</File>\r
<File\r
- RelativePath="..\cups\pwgmedia.c"\r
+ RelativePath="..\cups\pwg-file.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\cups\pwg-media.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\cups\pwg-ppd.c"\r
>\r
</File>\r
<File\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
</File>\r
+ <File\r
+ RelativePath="..\cups\sspi.c"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\cups\string.c"\r
>\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
</File>\r
+ <File\r
+ RelativePath="..\cups\thread.c"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\cups\transcode.c"\r
>\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
RelativePath="..\cups\backend.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\cups\cups-private.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\cups\cups.h"\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\debug.h"\r
+ RelativePath="..\cups\debug-private.h"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\file.h"\r
+ RelativePath="..\cups\file-private.h"\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\globals.h"\r
+ RelativePath="..\cups\file.h"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\i18n.h"\r
+ RelativePath="..\cups\ipp-private.h"\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\ipp-private.h"\r
+ RelativePath="..\cups\ipp.h"\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\ipp.h"\r
+ RelativePath="..\cups\language-private.h"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\md5-apple.h"\r
+ RelativePath="..\cups\md5-private.h"\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\md5.h"\r
+ RelativePath="..\cups\ppd-private.h"\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\normalize.h"\r
+ RelativePath="..\cups\ppd.h"\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\ppd.h"\r
+ RelativePath="..\cups\pwg-private.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\cups\sspi-private.h"\r
>\r
</File>\r
<File\r
- RelativePath="..\cups\string.h"\r
+ RelativePath="..\cups\string-private.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\cups\thread-private.h"\r
>\r
</File>\r
<File\r
RelativePath="..\cups\transcode.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\cups\versioning.h"\r
+ >\r
+ </File>\r
</Filter>\r
<Filter\r
Name="Resource Files"\r
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="8.00"\r
+ Name="libcupsimage2"\r
+ ProjectGUID="{CB4AA6F2-3E84-45BE-B505-95CD375E1234}"\r
+ Keyword="Win32Proj"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ <Platform\r
+ Name="x64"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="..\vcnet,.."\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ BufferSecurityCheck="true"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="ws2_32.lib"\r
+ OutputFile="$(OutDir)\libcupsimage2.dll"\r
+ LinkIncremental="2"\r
+ ModuleDefinitionFile="..\filter\libcupsimage2.def"\r
+ GenerateDebugInformation="true"\r
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\libcupsimage2.pdb"\r
+ SubSystem="2"\r
+ ImportLibrary="$(OutDir)\libcupsimage2.lib"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="..\vcnet,.."\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ BufferSecurityCheck="true"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="ws2_32.lib"\r
+ OutputFile="$(OutDir)\libcupsimage2.dll"\r
+ LinkIncremental="2"\r
+ ModuleDefinitionFile="..\filter\libcupsimage2.def"\r
+ GenerateDebugInformation="true"\r
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\libcupsimage2.pdb"\r
+ SubSystem="2"\r
+ ImportLibrary="$(OutDir)\libcupsimage2.lib"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="1"\r
+ AdditionalIncludeDirectories="..\vcnet,.."\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="ws2_32.lib"\r
+ OutputFile="$(OutDir)\libcupsimage2.dll"\r
+ LinkIncremental="1"\r
+ ModuleDefinitionFile="..\filter\libcupsimage2.def"\r
+ GenerateDebugInformation="true"\r
+ ProgramDatabaseFile="libcupsimage2.pdb"\r
+ SubSystem="2"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ ImportLibrary="$(OutDir)\libcupsimage2.lib"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ CommandLine="if not "%RC_XBS%" == "YES" goto END
if not exist "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)" mkdir "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
:END
"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="1"\r
+ AdditionalIncludeDirectories="..\vcnet,.."\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="ws2_32.lib"\r
+ OutputFile="$(OutDir)\libcupsimage2.dll"\r
+ LinkIncremental="1"\r
+ ModuleDefinitionFile="..\filter\libcupsimage2.def"\r
+ GenerateDebugInformation="true"\r
+ ProgramDatabaseFile="libcupsimage2.pdb"\r
+ SubSystem="2"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ ImportLibrary="$(OutDir)\libcupsimage2.lib"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ CommandLine="if not "%RC_XBS%" == "YES" goto END
if not exist "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)" mkdir "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
:END
"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D7521234}"\r
+ >\r
+ <File\r
+ RelativePath="..\filter\error.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\filter\interpret.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\filter\raster.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE521234}"\r
+ >\r
+ <File\r
+ RelativePath="..\cups\raster.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121A1234}"\r
+ >\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
# Visual Studio 2008\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcups2", "libcups2.vcproj", "{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}"\r
EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcupsimage2", "libcupsimage2.vcproj", "{CB4AA6F2-3E84-45BE-B505-95CD375E1234}"\r
+ ProjectSection(ProjectDependencies) = postProject\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3} = {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}\r
+ EndProjectSection\r
+EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "testfile.vcproj", "{CE75FC5F-E0CF-45DC-AD27-84666D3FBA30}"\r
ProjectSection(ProjectDependencies) = postProject\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3} = {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cupstestppd", "cupstestppd.vcproj", "{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}"\r
ProjectSection(ProjectDependencies) = postProject\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234} = {CB4AA6F2-3E84-45BE-B505-95CD375E1234}\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3} = {CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}\r
EndProjectSection\r
EndProject\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|Win32.Build.0 = Release|Win32\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|x64.ActiveCfg = Debug|x64\r
{CB4AA6F2-3E84-45BE-B505-95CD375E8BE3}.Release|x64.Build.0 = Debug|x64\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Debug|Win32.Build.0 = Debug|Win32\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Debug|x64.ActiveCfg = Debug|x64\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Debug|x64.Build.0 = Debug|x64\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Release|Win32.ActiveCfg = Release|Win32\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Release|Win32.Build.0 = Release|Win32\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Release|x64.ActiveCfg = Release|x64\r
+ {CB4AA6F2-3E84-45BE-B505-95CD375E1234}.Release|x64.Build.0 = Release|x64\r
{CE75FC5F-E0CF-45DC-AD27-84666D3FBA30}.Debug|Win32.ActiveCfg = Debug|Win32\r
{CE75FC5F-E0CF-45DC-AD27-84666D3FBA30}.Debug|Win32.Build.0 = Debug|Win32\r
{CE75FC5F-E0CF-45DC-AD27-84666D3FBA30}.Debug|x64.ActiveCfg = Debug|x64\r
{90B0058C-8393-411F-BD3B-E2C831D4E883}.Release|x64.Build.0 = Debug|x64\r
{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|Win32.ActiveCfg = Debug|Win32\r
{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|Win32.Build.0 = Debug|Win32\r
- {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|x64.ActiveCfg = Debug|Win32\r
+ {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|x64.ActiveCfg = Debug|x64\r
+ {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Debug|x64.Build.0 = Debug|x64\r
{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|Win32.ActiveCfg = Release|Win32\r
{6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|Win32.Build.0 = Release|Win32\r
- {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|x64.ActiveCfg = Release|Win32\r
- {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|x64.Build.0 = Release|Win32\r
+ {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|x64.ActiveCfg = Release|x64\r
+ {6BE0CDD3-4ED7-409C-A80F-19DF73664B1F}.Release|x64.Build.0 = Release|x64\r
{B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Debug|Win32.ActiveCfg = Debug|Win32\r
{B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Debug|Win32.Build.0 = Debug|Win32\r
- {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Debug|x64.ActiveCfg = Debug|Win32\r
+ {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Debug|x64.ActiveCfg = Debug|x64\r
+ {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Debug|x64.Build.0 = Debug|x64\r
{B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|Win32.ActiveCfg = Release|Win32\r
{B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|Win32.Build.0 = Release|Win32\r
- {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|x64.ActiveCfg = Release|Win32\r
- {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|x64.Build.0 = Release|Win32\r
+ {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|x64.ActiveCfg = Release|x64\r
+ {B246D91E-61F2-4433-BFD2-6C2A96FBD4D4}.Release|x64.Build.0 = Release|x64\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
<Platform\r
Name="Win32"\r
/>\r
+ <Platform\r
+ Name="x64"\r
+ />\r
</Platforms>\r
<ToolFiles>\r
</ToolFiles>\r
Name="VCPostBuildEventTool"\r
/>\r
</Configuration>\r
+ <Configuration\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="..;..\vcnet"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="1"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="2"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalIncludeDirectories="..;..\vcnet"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="1"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="1"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
</Configurations>\r
<References>\r
</References>\r
RelativePath="..\systemv\cupstestppd.c"\r
>\r
</File>\r
- <File\r
- RelativePath="..\filter\error.c"\r
- >\r
- </File>\r
- <File\r
- RelativePath="..\filter\interpret.c"\r
- >\r
- </File>\r
- <File\r
- RelativePath="..\filter\raster.c"\r
- >\r
- </File>\r
</Filter>\r
<Filter\r
Name="Header Files"\r
Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
>\r
- <File\r
- RelativePath="..\cups\raster.h"\r
- >\r
- </File>\r
</Filter>\r
<Filter\r
Name="Resource Files"\r
<Platform\r
Name="Win32"\r
/>\r
+ <Platform\r
+ Name="x64"\r
+ />\r
</Platforms>\r
<ToolFiles>\r
</ToolFiles>\r
Name="VCPostBuildEventTool"\r
/>\r
</Configuration>\r
+ <Configuration\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="..\vcnet;..;..\vcnet\regex"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="1"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="2"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalIncludeDirectories="..\vcnet;..;..\vcnet\regex"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="1"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="1"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
</Configurations>\r
<References>\r
</References>\r
AdditionalDependencies="ws2_32.lib advapi32.lib"\r
OutputFile="$(OutDir)\libcups2.dll"\r
LinkIncremental="2"\r
- ModuleDefinitionFile="..\vc2005\libcups2.def"\r
+ ModuleDefinitionFile="..\cups\libcups2.def"\r
GenerateDebugInformation="true"\r
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\libcups2.pdb"\r
SubSystem="2"\r
/>\r
<Tool\r
Name="VCPostBuildEventTool"\r
- CommandLine="if not "%RC_XBS%" == "YES" goto END
if not exist "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)" mkdir "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
:END
"\r
+ CommandLine=""\r
/>\r
</Configuration>\r
<Configuration\r
AdditionalDependencies="ws2_32.lib advapi32.lib"\r
OutputFile="$(OutDir)\libcups2.dll"\r
LinkIncremental="1"\r
- ModuleDefinitionFile="..\vc2005\libcups2.def"\r
+ ModuleDefinitionFile="..\cups\libcups2.def"\r
GenerateDebugInformation="true"\r
ProgramDatabaseFile="libcups2.pdb"\r
SubSystem="2"\r
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9.00"\r
+ Name="libcupsimage2"\r
+ ProjectGUID="{CB4AA6F2-3E84-45BE-B505-95CD375E1234}"\r
+ Keyword="Win32Proj"\r
+ TargetFrameworkVersion="131072"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ <Platform\r
+ Name="x64"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="..\vcnet,.."\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ BufferSecurityCheck="true"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="ws2_32.lib"\r
+ OutputFile="$(OutDir)\libcupsimage2.dll"\r
+ LinkIncremental="2"\r
+ ModuleDefinitionFile="..\filter\libcupsimage2.def"\r
+ GenerateDebugInformation="true"\r
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\libcupsimage2.pdb"\r
+ SubSystem="2"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ ImportLibrary="$(OutDir)\libcupsimage2.lib"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="..\vcnet,.."\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ BufferSecurityCheck="true"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="ws2_32.lib"\r
+ OutputFile="$(OutDir)\libcupsimage2.dll"\r
+ LinkIncremental="2"\r
+ ModuleDefinitionFile="..\filter\libcupsimage2.def"\r
+ GenerateDebugInformation="true"\r
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\libcupsimage2.pdb"\r
+ SubSystem="2"\r
+ ImportLibrary="$(OutDir)\libcupsimage2.lib"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="1"\r
+ AdditionalIncludeDirectories="..\vcnet,.."\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="ws2_32.lib"\r
+ OutputFile="$(OutDir)\libcupsimage2.dll"\r
+ LinkIncremental="1"\r
+ ModuleDefinitionFile="..\filter\libcupsimage2.def"\r
+ GenerateDebugInformation="true"\r
+ ProgramDatabaseFile="libcupsimage2.pdb"\r
+ SubSystem="2"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ ImportLibrary="$(OutDir)\libcupsimage2.lib"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ CommandLine=""\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="1"\r
+ AdditionalIncludeDirectories="..\vcnet,.."\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUPS2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ Detect64BitPortabilityProblems="false"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="ws2_32.lib"\r
+ OutputFile="$(OutDir)\libcupsimage2.dll"\r
+ LinkIncremental="1"\r
+ ModuleDefinitionFile="..\filter\libcupsimage2.def"\r
+ GenerateDebugInformation="true"\r
+ ProgramDatabaseFile="libcupsimage2.pdb"\r
+ SubSystem="2"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ ImportLibrary="$(OutDir)\libcupsimage2.lib"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ CommandLine="if not "%RC_XBS%" == "YES" goto END
if not exist "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)" mkdir "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour\$(PlatformName)"
:END
"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D7521234}"\r
+ >\r
+ <File\r
+ RelativePath="..\filter\error.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\filter\interpret.c"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\filter\raster.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE521234}"\r
+ >\r
+ <File\r
+ RelativePath="..\cups\raster.h"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121A1234}"\r
+ >\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r