Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet d35c99205a Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.4.2@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
474 arquivos alterados com 3583 adições e 18214 exclusões
+1 -127
Ver Arquivo
@@ -1,132 +1,6 @@
CHANGES.txt - 2010-06-17
CHANGES.txt - 2009-11-09
------------------------
CHANGES IN CUPS V1.4.4
- Documentation updates (STR #3453, STR #3527, STR #3528, STR #3529)
- Security: The texttops filter did not check the results of allocations
(STR #3516)
- Security: The fix for CVE-2009-3553 was incomplete (STR #3490)
- Security: The web admin interface could disclose the contents of
memory (STR #3577)
- Security: CUPS could overwrite files as root in directories owned or
writable by non-root users (STR #3510)
- The cups-config utility did not return the correct linker options on
AIX (STR #3587)
- Fixed some IPP conformance issues with the scheduler's
ippget-event-life, operations-supported, output-bin, and sides
attributes (STR #3554)
- The OpenSSL interfaces have been made thread-safe and the GNU TLS
interface is explicitly forbidden when threading is enabled
(STR #3461)
- Fixed an IPP conformance issue with the scheduler's Send-Document
implementation (STR #3514)
- Added additional validation checks for the 1284 device ID (STR #3534)
- Fixed a problem with the RPM spec file (STR #3544)
- The lpstat command did not limit the job list to the specified
printers (STR #3541)
- The cupsfilter command did not set the RIP_MAX_CACHE environment
variable (STR #3531)
- Fixed support for media-col and page size variants (STR #3394)
- The PostScript filter did not support all media selection options for
the first page (STR #3525)
- The scheduler did not always remove job control files (STR #3425)
- The scheduler could crash on restart if classes were defined
(STR #3524)
- The scheduler no longer looks up network interface hostnames by
default on Mac OS X (STR #3523)
- ippWriteIO did not write collection (member) attributes properly in
all cases (STR #3521)
- The "cupsctl --remote-any" and corresponding web interface check box
(allow printing from the Internet) did not work reliably (STR #3520)
- The lpq and lpr commands would sometimes choose different default
printers (STR #3503)
- cupsDo*Request did not flush error text, leading to multiple issues
(STR #3325, STR #3519)
- cupsDoAuthentication did not cancel password authentication after 3
failures (STR #3518)
- Fixed several LDAP browsing bugs (STR #3392)
- The Dymo driver did not support copies (STR #3457)
- The scheduler did not update the classes.conf file when deleting a
printer belonging to a class (STR #3505)
- The lppasswd command did not use localized password prompts
(STR #3492)
- The socket backend no longer waits for back-channel data on platforms
other than Mac OS X (STR #3495)
- The scheduler didn't send events when a printer started accepting or
rejecting jobs (STR #3480)
- The web interface now includes additional CSRF protection (STR #3498)
CHANGES IN CUPS V1.4.3
- SECURITY: The scheduler could try responding on a closed client
connection, leading to a crash (STR #3200)
- SECURITY: The lppasswd program allowed the localization files to be
overridden when running in setuid mode (STR #3482)
- Localization updates (STR #3352, STR #3409, STR #3422, STR #3452,
STR #3473, STR #3502)
- Documentation updates (STR #3451, STR #3504)
- The IPP backend now sets the printer-state-message to "Ready to
print." at the end of a successful job (STR #3460)
- The PPD compiler did not correctly add the manufacturer to the output
filename when using the "-m" option (STR #3469)
- The IPP backend did not handle authentication properly for the Get-
Printer-Attributes operation (STR 3458)
- Getting SNMP values larger than 127 bytes did not work.
- IPP conformance: Get-Jobs has a default value for requested-attributes
(STR #3383)
- cupsPrintFiles() did not report all errors (STR #3449)
- cupsAddDest() could read freed memory (STR #3448)
- The DBUS notifier did not build (STR #3447)
- The scheduler would crash when an active printer was deleted.
- The snmp backend did not work with some printers (STR #3413)
- The web interface did not show the conflicting values when setting
options (STR #3440)
- Setting options in the web interface did not always work (STR #3439)
- The scheduler did not use the Get-Job-Attributes policy for a printer
(STR #3431)
- The scheduler added two job-name attributes to each job object
(STR #3428)
- CSS files would not print (STR #3442)
- The scheduler did not clean out completed jobs when PreserveJobHistory
was turned off (STR #3425)
- The web interface did not show completed jobs for a printer
(STR #3436)
- Authenticated printing did not always work when printing directly to
a remote server (STR #3435)
- The USB backend did not work on Solaris (STR #3423)
- cupstestppd didn't catch problems with JobPatchFile definitions
(STR #3421)
- The socket backend could crash if a SNMP string had a negative length.
- Fixed some termination issues with the USB backend on Mac OS X.
- The side-channel APIs did not handle interrupts properly.
- The network backends incorrectly cleared the media-empty-warning
state.
- The web interface did not allow users to successfully add serial
printers (STR #3391)
- cupsTempFd() did not work in some situations (STR #3382)
- Some C API headers were missing C++ wrapper logic.
- The PPD compiler did not localize single-language PPD options properly
(STR #3386)
- Modifying a printer from the web interface sometimes caused the wrong
driver to be selected (STR #3418)
- The scheduler did not handle out-of-memory conditions properly when
loading a job (STR #3407)
- When adding printers from the web interface, the dynamic updates of
the device list made it hard to pick a device (STR #3406)
- Fixed a typo in the web interface admin page template (STR 3403)
- The web interface did not preserve the "printer is shared" state when
modifying a printer (STR #3390)
- The PPD compiler incorrectly inserted translations of empty strings
(STR #3411)
- The scheduler did not reset the SIGPIPE handler of child processes
(STR #3399)
- cupsGetNamedDest() incorrectly returned the default printer if the
named printer did not exist (STR #3397)
- Fixed a GNU TLS error handling bug (STR #3381)
CHANGES IN CUPS V1.4.2
- SECURITY: The CUPS web interface was vulnerable to several XSS and
+2 -2
Ver Arquivo
@@ -1,4 +1,4 @@
CREDITS.txt - 2010-03-13
CREDITS.txt - 2009-07-07
------------------------
Few projects are completed by one person, and CUPS is no exception. We'd
@@ -40,7 +40,7 @@ like to thank the following individuals for their contributions:
Opher Shachar - Hebrew localization.
Stuart Stevens - HP JetDirect IPP information.
Andrea Suatoni - IRIX desktop integration and testing.
Teppo Turliainen - Finnish localization.
Teppo Turlianen - Finnish localization.
Tim Waugh - Lots of patches, testing, and Linux
integration.
Yugami - LDAP browsing support.
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.4.4 - 2010-06-17
INSTALL - CUPS v1.4.0 - 2009-06-26
----------------------------------
This file describes how to compile and install CUPS from source code. For more
+4 -4
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id$"
#
# Common makefile definitions for CUPS.
# Common makefile definitions for the Common UNIX Printing System (CUPS).
#
# Copyright 2007-2010 by Apple Inc.
# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -263,7 +263,7 @@ DBUSDIR = @DBUSDIR@
.c.o:
echo Compiling $<...
$(CC) $(ARCHFLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
$(CC) $(ARCHFLAGS) $(OPTIM) $(ALL_CFLAGS) -c $<
.c.32.o:
echo Compiling 32-bit $<...
@@ -275,7 +275,7 @@ DBUSDIR = @DBUSDIR@
.cxx.o:
echo Compiling $<...
$(CXX) $(ARCHFLAGS) $(OPTIM) $(ALL_CXXFLAGS) -c -o $@ $<
$(CXX) $(ARCHFLAGS) $(OPTIM) $(ALL_CXXFLAGS) -c $<
.man.1 .man.1m .man.3 .man.5 .man.7 .man.8:
echo Linking $<...
+13 -15
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id$"
#
# Top-level Makefile for CUPS.
# Top-level Makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 2007-2010 by Apple Inc.
# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -16,6 +16,13 @@
include Makedefs
#
# Don't run top-level build targets in parallel...
#
.NOTPARALLEL:
#
# Directories to make...
#
@@ -132,15 +139,13 @@ depend:
#
# Run the clang.llvm.org static code analysis tool on the C sources.
# (at least checker-231 is required for scan-build to work this way)
#
.PHONY: clang clang-changes
.PHONY: clang
clang:
$(RM) -r clang
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
clang-changes:
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) \
CC=ccc-analyzer CXX=ccc-analyzer clean all
#
@@ -395,7 +400,7 @@ docset: apihelp
#
# Make software distributions using EPM (http://www.epmhome.org/)...
# Make software distributions using EPM (http://www.easysw.com/epm/)...
#
EPMFLAGS = -v --output-dir dist $(EPMARCH)
@@ -425,13 +430,6 @@ dist: all
esac
#
# Don't run top-level build targets in parallel...
#
.NOTPARALLEL:
#
# End of "$Id$".
#
+2 -2
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.4.4 - 2010-06-17
README - CUPS v1.4.0 - 2009-06-26
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
@@ -150,7 +150,7 @@ PRINTING FILES
LEGAL STUFF
CUPS is Copyright 2007-2010 by Apple Inc. CUPS and the CUPS logo are
CUPS is Copyright 2007-2009 by Apple Inc. CUPS and the CUPS logo are
trademarks of Apple Inc.
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
+1 -22
Ver Arquivo
@@ -34,26 +34,6 @@
# include <cups/string.h>
# include <signal.h>
# ifdef __linux
# include <sys/ioctl.h>
# include <linux/lp.h>
# define IOCNR_GET_DEVICE_ID 1
# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
# include <linux/parport.h>
# include <linux/ppdev.h>
# include <unistd.h>
# include <fcntl.h>
# endif /* __linux */
# ifdef __sun
# ifdef __sparc
# include <sys/ecppio.h>
# else
# include <sys/ioccom.h>
# include <sys/ecppsys.h>
# endif /* __sparc */
# endif /* __sun */
/*
* C++ magic...
@@ -300,8 +280,7 @@ extern int backendNetworkSideCB(int print_fd, int device_fd,
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,
http_addr_t *addr, int use_bc,
int (*side_cb)(int print_fd,
int device_fd,
int snmp_fd,
+30 -33
Ver Arquivo
@@ -3,7 +3,7 @@
*
* IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -27,6 +27,26 @@
#include "backend-private.h"
#ifdef __linux
# include <sys/ioctl.h>
# include <linux/lp.h>
# define IOCNR_GET_DEVICE_ID 1
# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
# include <linux/parport.h>
# include <linux/ppdev.h>
# include <unistd.h>
# include <fcntl.h>
#endif /* __linux */
#ifdef __sun
# ifdef __sparc
# include <sys/ecppio.h>
# else
# include <sys/ioccom.h>
# include <sys/ecppsys.h>
# endif /* __sparc */
#endif /* __sun */
/*
* 'backendGetDeviceID()' - Get the IEEE-1284 device ID string and
@@ -185,34 +205,18 @@ backendGetDeviceID(
/*
* The length field counts the number of bytes in the string
* including the length field itself (2 bytes). The minimum
* length for a valid/usable device ID is 14 bytes:
*
* <LENGTH> MFG: <MFG> ;MDL: <MDL> ;
* 2 + 4 + 1 + 5 + 1 + 1
* including the length field itself (2 bytes).
*/
if (length < 14)
{
/*
* Can't use this device ID, so don't try to copy it...
*/
length -= 2;
device_id[0] = '\0';
got_id = 0;
}
else
{
/*
* Copy the device ID text to the beginning of the buffer and
* nul-terminate.
*/
/*
* Copy the device ID text to the beginning of the buffer and
* nul-terminate.
*/
length -= 2;
memmove(device_id, device_id + 2, length);
device_id[length] = '\0';
}
memmove(device_id, device_id + 2, length);
device_id[length] = '\0';
}
# ifdef DEBUG
else
@@ -309,9 +313,6 @@ backendGetDeviceID(
mfg = temp;
}
if (!mdl)
mdl = "";
if (!strncasecmp(mdl, mfg, strlen(mfg)))
{
mdl += strlen(mfg);
@@ -403,11 +404,7 @@ backendGetMakeModel(
char temp[1024]; /* Temporary make and model */
if (mfg)
snprintf(temp, sizeof(temp), "%s %s", mfg, mdl);
else
snprintf(temp, sizeof(temp), "%s", mdl);
snprintf(temp, sizeof(temp), "%s %s", mfg, mdl);
_ppdNormalizeMakeAndModel(temp, make_model, make_model_size);
}
}
+4 -19
Ver Arquivo
@@ -3,7 +3,7 @@
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -434,7 +434,7 @@ main(int argc, /* I - Number of command-line args */
_cupsLangPuts(stderr, _("INFO: Copying print data...\n"));
tbytes = backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
tbytes = backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0,
backendNetworkSideCB);
if (snmp_fd >= 0)
@@ -738,15 +738,6 @@ main(int argc, /* I - Number of command-line args */
return (CUPS_BACKEND_STOP);
}
else if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN)
{
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
"Negotiate", 9))
auth_info_required = "negotiate";
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
return (CUPS_BACKEND_AUTH_REQUIRED);
}
else
{
_cupsLangPrintf(stderr,
@@ -1362,10 +1353,7 @@ main(int argc, /* I - Number of command-line args */
else if (ipp_status > IPP_OK_CONFLICT)
return (CUPS_BACKEND_FAILED);
else
{
_cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
return (CUPS_BACKEND_OK);
}
}
@@ -1843,11 +1831,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
* Change to an unpriviledged user...
*/
if (setgid(fileinfo.st_gid))
return (errno);
if (setuid(fileinfo.st_uid))
return (errno);
setgid(fileinfo.st_gid);
setuid(fileinfo.st_uid);
}
execlp("pictwpstops", printer, argv[1], argv[2], argv[3], argv[4], argv[5],
+2 -2
Ver Arquivo
@@ -447,8 +447,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
_cupsLangPuts(stderr, _("INFO: Copying print data...\n"));
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
backendNetworkSideCB);
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, backendNetworkSideCB);
if (snmp_fd >= 0)
_cupsSNMPClose(snmp_fd);
@@ -798,6 +797,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
error = errno;
close(fd);
fd = -1;
if (addr->next)
continue;
+2 -6
Ver Arquivo
@@ -170,13 +170,9 @@ backendNetworkSideCB(
case CUPS_ASN1_BIT_STRING :
case CUPS_ASN1_OCTET_STRING :
if (packet.object_value.string.num_bytes < 0)
i = 0;
else if (packet.object_value.string.num_bytes <
(sizeof(data) - (dataptr - data)))
i = (int)(sizeof(data) - (dataptr - data));
if (packet.object_value.string.num_bytes < i)
i = packet.object_value.string.num_bytes;
else
i = (int)(sizeof(data) - (dataptr - data));
memcpy(dataptr, packet.object_value.string.bytes, i);
+1 -1
Ver Arquivo
@@ -284,7 +284,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
lseek(print_fd, 0, SEEK_SET);
}
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, side_cb);
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, side_cb);
if (print_fd != 0 && tbytes >= 0)
_cupsLangPrintf(stderr,
+5 -6
Ver Arquivo
@@ -147,7 +147,6 @@ backendRunLoop(
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 */
{
@@ -246,7 +245,7 @@ backendRunLoop(
* Pause printing to clear any pending errors...
*/
if (errno == ENXIO && offline != 1 && update_state)
if (errno == ENXIO && offline != 1)
{
fputs("STATE: +offline-report\n", stderr);
_cupsLangPuts(stderr, _("INFO: Printer is currently offline.\n"));
@@ -352,7 +351,7 @@ backendRunLoop(
if (errno == ENOSPC)
{
if (paperout != 1 && update_state)
if (paperout != 1)
{
fputs("STATE: +media-empty-warning\n", stderr);
_cupsLangPuts(stderr, _("ERROR: Out of paper!\n"));
@@ -361,7 +360,7 @@ backendRunLoop(
}
else if (errno == ENXIO)
{
if (offline != 1 && update_state)
if (offline != 1)
{
fputs("STATE: +offline-report\n", stderr);
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
@@ -377,13 +376,13 @@ backendRunLoop(
}
else
{
if (paperout && update_state)
if (paperout)
{
fputs("STATE: -media-empty-warning\n", stderr);
paperout = 0;
}
if (offline && update_state)
if (offline)
{
fputs("STATE: -offline-report\n", stderr);
_cupsLangPuts(stderr, _("INFO: Printer is now online.\n"));
-2
Ver Arquivo
@@ -232,8 +232,6 @@ backendSNMPSupplies(
if (packet.object_value.string.num_bytes == 2)
new_state = (packet.object_value.string.bytes[0] << 8) |
packet.object_value.string.bytes[1];
else if (packet.object_value.string.num_bytes == 1)
new_state = (packet.object_value.string.bytes[0] << 8);
else
new_state = 0;
+3 -5
Ver Arquivo
@@ -999,7 +999,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
DEVICE_PRODUCT, LexmarkProductOID2);
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
packet.community, CUPS_ASN1_GET_REQUEST,
DEVICE_ID, LexmarkDeviceIdOID);
DEVICE_URI, LexmarkDeviceIdOID);
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
packet.community, CUPS_ASN1_GET_REQUEST,
DEVICE_PRODUCT, XeroxProductOID);
@@ -1054,9 +1054,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
break;
case DEVICE_ID :
if (device && packet.object_type == CUPS_ASN1_OCTET_STRING &&
(!device->id ||
strlen(device->id) < packet.object_value.string.num_bytes))
if (device && packet.object_type == CUPS_ASN1_OCTET_STRING)
{
/*
* Update an existing cache entry...
@@ -1109,7 +1107,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
case DEVICE_URI :
if (device && packet.object_type == CUPS_ASN1_OCTET_STRING &&
!device->uri && packet.object_value.string.num_bytes > 0)
!device->uri)
{
/*
* Update an existing cache entry...
+2 -4
Ver Arquivo
@@ -3,7 +3,7 @@
*
* AppSocket backend for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -393,7 +393,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
lseek(print_fd, 0, SEEK_SET);
}
tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addr->addr), 1, 0,
tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addr->addr), 1,
backendNetworkSideCB);
if (print_fd != 0 && tbytes >= 0)
@@ -406,7 +406,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
CUPS_LLCAST tbytes);
}
#ifdef __APPLE__
/*
* Wait up to 5 seconds to get any pending back-channel data...
*/
@@ -415,7 +414,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
while (wait_time >= time(&current_time))
if (wait_bc(device_fd, wait_time - current_time) <= 0)
break;
#endif /* __APPLE__ */
if (waiteof)
{
+131 -40
Ver Arquivo
@@ -112,6 +112,12 @@ extern char **environ;
#define DEBUG_WRITES 0
/*
* WAIT_EOF_DELAY is number of seconds we'll wait for responses from
* the printer after we've finished sending all the data
*/
#define WAIT_EOF_DELAY 7
#define WAIT_SIDE_DELAY 3
#define DEFAULT_TIMEOUT 5000L
#define USB_INTERFACE_KIND CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID190)
@@ -241,6 +247,11 @@ typedef struct globals_s
Boolean wait_eof;
int drain_output; /* Drain all pending output */
int bidi_flag; /* 0=unidirectional, 1=bidirectional */
pthread_mutex_t sidechannel_thread_mutex;
pthread_cond_t sidechannel_thread_cond;
int sidechannel_thread_stop;
int sidechannel_thread_done;
} globals_t;
@@ -333,6 +344,7 @@ print_device(const char *uri, /* I - Device URI */
UInt32 bytes; /* Bytes written */
struct timeval *timeout, /* Timeout pointer */
stimeout; /* Timeout for select() */
struct timespec cond_timeout; /* pthread condition timeout */
/*
@@ -361,12 +373,12 @@ print_device(const char *uri, /* I - Device URI */
if (!g.make || !g.model)
{
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
_cupsLangPuts(stderr, _("ERROR: Fatal USB error!\n"));
if (!g.make)
fputs("DEBUG: USB make string is NULL\n", stderr);
fputs("DEBUG: USB make string is NULL!\n", stderr);
if (!g.model)
fputs("DEBUG: USB model string is NULL\n", stderr);
fputs("DEBUG: USB model string is NULL!\n", stderr);
return (CUPS_BACKEND_STOP);
}
@@ -419,7 +431,7 @@ print_device(const char *uri, /* I - Device URI */
strlcpy(print_buffer, "USB class driver", sizeof(print_buffer));
fputs("STATE: +apple-missing-usbclassdriver-error\n", stderr);
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
_cupsLangPuts(stderr, _("ERROR: Fatal USB error!\n"));
fprintf(stderr, "DEBUG: Could not load %s\n", print_buffer);
if (driverBundlePath)
@@ -476,11 +488,16 @@ print_device(const char *uri, /* I - Device URI */
if (have_sidechannel)
{
g.sidechannel_thread_stop = 0;
g.sidechannel_thread_done = 0;
pthread_cond_init(&g.sidechannel_thread_cond, NULL);
pthread_mutex_init(&g.sidechannel_thread_mutex, NULL);
if (pthread_create(&sidechannel_thread_id, NULL, sidechannel_thread, NULL))
{
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
fputs("DEBUG: Couldn't create side-channel thread\n", stderr);
registry_close();
_cupsLangPuts(stderr, _("ERROR: Fatal USB error!\n"));
fputs("DEBUG: Couldn't create side-channel thread!\n", stderr);
return (CUPS_BACKEND_STOP);
}
}
@@ -497,9 +514,8 @@ print_device(const char *uri, /* I - Device URI */
if (pthread_create(&read_thread_id, NULL, read_thread, NULL))
{
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
fputs("DEBUG: Couldn't create read thread\n", stderr);
registry_close();
_cupsLangPuts(stderr, _("ERROR: Fatal USB error!\n"));
fputs("DEBUG: Couldn't create read thread!\n", stderr);
return (CUPS_BACKEND_STOP);
}
@@ -577,16 +593,14 @@ print_device(const char *uri, /* I - Device URI */
if (errno == EINTR && total_bytes == 0)
{
fputs("DEBUG: Received an interrupt before any bytes were "
"written, aborting\n", stderr);
registry_close();
"written, aborting!\n", stderr);
return (CUPS_BACKEND_OK);
}
else if (errno != EAGAIN && errno != EINTR)
{
_cupsLangPuts(stderr, _("ERROR: Unable to read print data\n"));
_cupsLangPuts(stderr, _("ERROR: Unable to read print data!\n"));
perror("DEBUG: select");
registry_close();
return (CUPS_BACKEND_FAILED);
return (CUPS_BACKEND_FAILED);
}
}
@@ -626,9 +640,8 @@ print_device(const char *uri, /* I - Device URI */
if (errno != EAGAIN && errno != EINTR)
{
_cupsLangPuts(stderr, _("ERROR: Unable to read print data\n"));
_cupsLangPuts(stderr, _("ERROR: Unable to read print data!\n"));
perror("DEBUG: read");
registry_close();
return (CUPS_BACKEND_FAILED);
}
@@ -661,7 +674,7 @@ print_device(const char *uri, /* I - Device URI */
if (iostatus == kIOUSBTransactionTimeout)
{
fputs("DEBUG: Got USB transaction timeout during write\n", stderr);
fputs("DEBUG: Got USB transaction timeout during write!\n", stderr);
iostatus = 0;
}
@@ -671,7 +684,7 @@ print_device(const char *uri, /* I - Device URI */
else if (iostatus == kIOUSBPipeStalled)
{
fputs("DEBUG: Got USB pipe stalled during write\n", stderr);
fputs("DEBUG: Got USB pipe stalled during write!\n", stderr);
bytes = g.print_bytes;
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
@@ -684,7 +697,7 @@ print_device(const char *uri, /* I - Device URI */
else if (iostatus == kIOReturnAborted)
{
fputs("DEBUG: Got USB return aborted during write\n", stderr);
fputs("DEBUG: Got USB return aborted during write!\n", stderr);
IOReturn err = (*g.classdriver)->Abort(g.classdriver);
fprintf(stderr, "DEBUG: USB class driver Abort returned %x\n", err);
@@ -703,7 +716,7 @@ print_device(const char *uri, /* I - Device URI */
* Write error - bail if we don't see an error we can retry...
*/
_cupsLangPuts(stderr, _("ERROR: Unable to send print data\n"));
_cupsLangPuts(stderr, _("ERROR: Unable to send print data!\n"));
fprintf(stderr, "DEBUG: USB class driver WritePipe returned %x\n",
iostatus);
@@ -732,6 +745,86 @@ print_device(const char *uri, /* I - Device URI */
fprintf(stderr, "DEBUG: Sent %lld bytes...\n", (off_t)total_bytes);
/*
* Wait for the side channel thread to exit...
*/
if (have_sidechannel)
{
close(CUPS_SC_FD);
pthread_mutex_lock(&g.readwrite_lock_mutex);
g.readwrite_lock = 0;
pthread_cond_signal(&g.readwrite_lock_cond);
pthread_mutex_unlock(&g.readwrite_lock_mutex);
g.sidechannel_thread_stop = 1;
pthread_mutex_lock(&g.sidechannel_thread_mutex);
if (!g.sidechannel_thread_done)
{
/*
* Wait for the side-channel thread to exit...
*/
cond_timeout.tv_sec = time(NULL) + WAIT_SIDE_DELAY;
cond_timeout.tv_nsec = 0;
if (pthread_cond_timedwait(&g.sidechannel_thread_cond,
&g.sidechannel_thread_mutex,
&cond_timeout) != 0)
{
/*
* Force the side-channel thread to exit...
*/
pthread_kill(sidechannel_thread_id, SIGTERM);
}
}
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
pthread_join(sidechannel_thread_id, NULL);
pthread_cond_destroy(&g.sidechannel_thread_cond);
pthread_mutex_destroy(&g.sidechannel_thread_mutex);
}
pthread_cond_destroy(&g.readwrite_lock_cond);
pthread_mutex_destroy(&g.readwrite_lock_mutex);
/*
* Signal the read thread to stop...
*/
g.read_thread_stop = 1;
/*
* Give the read thread WAIT_EOF_DELAY seconds to complete all the data. If
* we are not signaled in that time then force the thread to exit.
*/
pthread_mutex_lock(&g.read_thread_mutex);
if (!g.read_thread_done)
{
cond_timeout.tv_sec = time(NULL) + WAIT_EOF_DELAY;
cond_timeout.tv_nsec = 0;
if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
&cond_timeout) != 0)
{
/*
* Force the read thread to exit...
*/
g.wait_eof = 0;
pthread_kill(read_thread_id, SIGTERM);
}
}
pthread_mutex_unlock(&g.read_thread_mutex);
pthread_join(read_thread_id, NULL); /* wait for the read thread to return */
pthread_cond_destroy(&g.read_thread_cond);
pthread_mutex_destroy(&g.read_thread_mutex);
/*
* Close the connection and input file and general clean up...
*/
@@ -804,11 +897,11 @@ static void *read_thread(void *reference)
#endif
}
else if (readstatus == kIOUSBTransactionTimeout)
fputs("DEBUG: Got USB transaction timeout during read\n", stderr);
fputs("DEBUG: Got USB transaction timeout during read!\n", stderr);
else if (readstatus == kIOUSBPipeStalled)
fputs("DEBUG: Got USB pipe stalled during read\n", stderr);
fputs("DEBUG: Got USB pipe stalled during read!\n", stderr);
else if (readstatus == kIOReturnAborted)
fputs("DEBUG: Got USB return aborted during read\n", stderr);
fputs("DEBUG: Got USB return aborted during read!\n", stderr);
/*
* Make sure this loop executes no more than once every 250 miliseconds...
@@ -850,12 +943,7 @@ sidechannel_thread(void *reference)
datalen = sizeof(data);
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
{
if (status == CUPS_SC_STATUS_TIMEOUT)
continue;
else
break;
}
break;
switch (command)
{
@@ -940,7 +1028,12 @@ sidechannel_thread(void *reference)
break;
}
}
while (1);
while (!g.sidechannel_thread_stop);
pthread_mutex_lock(&g.sidechannel_thread_mutex);
g.sidechannel_thread_done = 1;
pthread_cond_signal(&g.sidechannel_thread_cond);
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
return NULL;
}
@@ -1808,7 +1901,6 @@ static void run_legacy_backend(int argc,
* Setup a SIGTERM handler then block it before forking...
*/
int err; /* posix_spawn result */
struct sigaction action; /* POSIX signal action */
sigset_t newmask, /* New signal mask */
oldmask; /* Old signal mask */
@@ -1857,7 +1949,7 @@ static void run_legacy_backend(int argc,
# else
perror("DEBUG: Unable to set binary preference to ppc");
# endif /* __x86_64__ */
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver\n"));
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n"));
exit(CUPS_BACKEND_STOP);
}
}
@@ -1875,12 +1967,11 @@ static void run_legacy_backend(int argc,
my_argv[i] = NULL;
if ((err = posix_spawn(&child_pid, usbpath, NULL, &attrs, my_argv,
environ)) != 0)
if (posix_spawn(&child_pid, usbpath, NULL, &attrs, my_argv, environ))
{
fprintf(stderr, "DEBUG: Unable to exec %s: %s\n", usbpath,
strerror(err));
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver\n"));
strerror(errno));
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n"));
exit(CUPS_BACKEND_STOP);
}
@@ -1906,14 +1997,14 @@ static void run_legacy_backend(int argc,
if (WIFSIGNALED(childstatus))
{
exitstatus = CUPS_BACKEND_STOP;
fprintf(stderr, "DEBUG: usb(legacy) backend %d crashed on signal %d\n",
fprintf(stderr, "DEBUG: usb(legacy) backend %d crashed on signal %d!\n",
child_pid, WTERMSIG(childstatus));
}
else
{
if ((exitstatus = WEXITSTATUS(childstatus)) != 0)
fprintf(stderr,
"DEBUG: usb(legacy) backend %d stopped with status %d\n",
"DEBUG: usb(legacy) backend %d stopped with status %d!\n",
child_pid, exitstatus);
else
fprintf(stderr, "DEBUG: usb(legacy) backend %d exited with no errors\n",
@@ -1955,7 +2046,7 @@ sigterm_handler(int sig) /* I - Signal */
exit(0);
else
{
fprintf(stderr, "DEBUG: Child crashed on signal %d\n", status);
fprintf(stderr, "DEBUG: Child crashed on signal %d!\n", status);
exit(CUPS_BACKEND_STOP);
}
}
+3 -3
Ver Arquivo
@@ -5,7 +5,7 @@
*
* This file is included from "usb.c" when compiled on UNIX/Linux.
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -187,10 +187,10 @@ print_device(const char *uri, /* I - Device URI */
* select() or poll(), so we can't support the sidechannel either...
*/
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, NULL);
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, NULL);
#else
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, side_cb);
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, side_cb);
#endif /* __sun */
if (print_fd != 0 && tbytes >= 0)
+1 -17
Ver Arquivo
@@ -340,18 +340,7 @@ show_jobs(const char *command, /* I - Command name */
char resource[1024]; /* Resource string */
char rankstr[255]; /* Rank string */
char namestr[1024]; /* Job name string */
static const char * const jobattrs[] =/* Job attributes we want to see */
{
"copies",
"job-id",
"job-k-octets",
"job-name",
"job-originating-user-name",
"job-printer-uri",
"job-priority",
"job-state"
};
static const char * const ranks[10] = /* Ranking strings */
static const char *ranks[10] = /* Ranking strings */
{
"th",
"st",
@@ -379,7 +368,6 @@ show_jobs(const char *command, /* I - Command name */
* attributes-charset
* attributes-natural-language
* job-uri or printer-uri
* requested-attributes
*/
request = ippNewRequest(id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS);
@@ -409,10 +397,6 @@ show_jobs(const char *command, /* I - Command name */
ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1);
}
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes",
(int)(sizeof(jobattrs) / sizeof(jobattrs[0])), NULL, jobattrs);
/*
* Do the request and get back a response...
*/
+3 -3
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id$"
#
# CGI makefile for CUPS.
# CGI makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 2007-2010 by Apple Inc.
# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
@@ -118,7 +118,7 @@ install-exec:
done
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(CGIS); do \
for file in $(TARGETS); do \
cp $$file $(SYMROOT); \
done \
fi
+59 -67
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Administration CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -52,7 +52,8 @@
* Local globals...
*/
static int current_device = 0; /* Current device shown */
static int current_device; /* Current device for add/modify */
static time_t last_device_time; /* Last update time for device list */
/*
@@ -291,21 +292,6 @@ choose_device_cb(
const char *device_location, /* I - Location */
const char *title) /* I - Page title */
{
/*
* For modern browsers, start a multi-part page so we can show that something
* is happening. Non-modern browsers just get everything at the end...
*/
if (current_device == 0 && cgiSupportsMultipart())
{
cgiStartMultipart();
cgiStartHTML(title);
cgiCopyTemplateLang("choose-device.tmpl");
cgiEndHTML();
fflush(stdout);
}
/*
* Add the device to the array...
*/
@@ -318,6 +304,23 @@ choose_device_cb(
cgiSetArray("device_location", current_device, device_location);
current_device ++;
if (time(NULL) > last_device_time && cgiSupportsMultipart())
{
/*
* Update the page...
*/
if (!last_device_time)
cgiStartMultipart();
cgiStartHTML(title);
cgiCopyTemplateLang("choose-device.tmpl");
cgiEndHTML();
fflush(stdout);
time(&last_device_time);
}
}
@@ -771,7 +774,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
attr = ippAddStrings(request, IPP_TAG_PRINTER, IPP_TAG_URI, "member-uris",
num_printers, NULL, NULL);
for (i = 0; i < num_printers; i ++)
attr->values[i].string.text = _cupsStrAlloc(cgiGetArray("MEMBER_URIS", i));
attr->values[i].string.text = strdup(cgiGetArray("MEMBER_URIS", i));
}
/*
@@ -969,8 +972,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
if (isalnum(*uriptr & 255) || *uriptr == '_' || *uriptr == '-' ||
*uriptr == '.')
*tptr++ = *uriptr;
else if ((*uriptr == ' ' || *uriptr == '/') && tptr > template &&
tptr[-1] != '_')
else if ((*uriptr == ' ' || *uriptr == '/') && tptr[-1] != '_')
*tptr++ = '_';
else if (*uriptr == '?' || *uriptr == '(')
break;
@@ -999,28 +1001,31 @@ do_am_printer(http_t *http, /* I - HTTP connection */
}
/*
* Scan for devices for up to 30 seconds...
* Scan for devices for up to 30 seconds, updating the page as we find
* them...
*/
fputs("DEBUG: Getting list of devices...\n", stderr);
current_device = 0;
last_device_time = 0;
current_device = 0;
if (cupsGetDevices(http, 30, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
(cups_device_cb_t)choose_device_cb,
(void *)title) == IPP_OK)
{
fputs("DEBUG: Got device list!\n", stderr);
if (cgiSupportsMultipart())
cgiStartMultipart();
if (!cgiSupportsMultipart())
{
/*
* Non-modern browsers that don't support multi-part documents get
* everything at the end...
*/
cgiSetVariable("CUPS_GET_DEVICES_DONE", "1");
cgiStartHTML(title);
cgiCopyTemplateLang("choose-device.tmpl");
cgiEndHTML();
if (cgiSupportsMultipart())
cgiEndMultipart();
cgiStartHTML(title);
cgiCopyTemplateLang("choose-device.tmpl");
cgiEndHTML();
}
}
else
{
@@ -1041,6 +1046,16 @@ do_am_printer(http_t *http, /* I - HTTP connection */
return;
}
}
/*
* Show the final selection page...
*/
cgiSetVariable("CUPS_GET_DEVICES_DONE", "1");
cgiStartHTML(title);
cgiCopyTemplateLang("choose-device.tmpl");
cgiEndHTML();
cgiEndMultipart();
}
else if (strchr(var, '/') == NULL)
{
@@ -1106,11 +1121,6 @@ do_am_printer(http_t *http, /* I - HTTP connection */
if ((attr = ippFindAttribute(oldinfo, "printer-location",
IPP_TAG_TEXT)) != NULL)
cgiSetVariable("PRINTER_LOCATION", attr->values[0].string.text);
if ((attr = ippFindAttribute(oldinfo, "printer-is-shared",
IPP_TAG_BOOLEAN)) != NULL)
cgiSetVariable("PRINTER_IS_SHARED",
attr->values[0].boolean ? "1" : "0");
}
cgiCopyTemplateLang("modify-printer.tmpl");
@@ -1246,7 +1256,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
* Got the list of PPDs, see if the user has selected a make...
*/
if (cgiSetIPPVars(response, NULL, NULL, NULL, 0) == 0 && !modify)
if (cgiSetIPPVars(response, NULL, NULL, NULL, 0) == 0)
{
/*
* No PPD files with this make, try again with all makes...
@@ -1282,11 +1292,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
*/
cgiStartHTML(title);
if (!cgiGetVariable("PPD_MAKE"))
cgiSetVariable("PPD_MAKE", cgiGetVariable("CURRENT_MAKE"));
if (!modify)
cgiSetVariable("CURRENT_MAKE_AND_MODEL",
cgiGetArray("PPD_MAKE_AND_MODEL", 0));
cgiSetVariable("CURRENT_MAKE_AND_MODEL",
cgiGetArray("PPD_MAKE_AND_MODEL", 0));
cgiCopyTemplateLang("choose-model.tmpl");
cgiEndHTML();
}
@@ -1578,7 +1585,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
#ifdef HAVE_GSSAPI
char default_auth_type[255];
/* DefaultAuthType value */
const char *val; /* Setting value */
const char *val; /* Setting value */
#endif /* HAVE_GSSAPI */
@@ -1650,7 +1657,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
strcat(local_protocols, "slp");
}
#endif /* HAVE_SLP */
if (cgiGetVariable("BROWSE_REMOTE_CUPS"))
strcpy(remote_protocols, "cups");
else
@@ -1903,7 +1910,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
cgiSetVariable("ERROR", strerror(errno));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
perror(tempfile);
return;
}
@@ -1915,7 +1922,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
cgiSetVariable("ERROR", strerror(errno));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
perror(tempfile);
close(tempfd);
unlink(tempfile);
@@ -2481,7 +2488,7 @@ do_list_printers(http_t *http) /* I - HTTP connection */
attr;
attr = ippFindNextAttribute(response, "device-uri", IPP_TAG_URI))
{
cupsArrayAdd(printer_devices, _cupsStrAlloc(attr->values[0].string.text));
cupsArrayAdd(printer_devices, strdup(attr->values[0].string.text));
}
/*
@@ -2618,7 +2625,7 @@ do_list_printers(http_t *http) /* I - HTTP connection */
for (printer_device = (char *)cupsArrayFirst(printer_devices);
printer_device;
printer_device = (char *)cupsArrayNext(printer_devices))
_cupsStrFree(printer_device);
free(printer_device);
cupsArrayDelete(printer_devices);
}
@@ -3059,7 +3066,7 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */
* Add the name...
*/
attr->values[i].string.text = _cupsStrAlloc(ptr);
attr->values[i].string.text = strdup(ptr);
/*
* Advance to the next name...
@@ -3305,16 +3312,11 @@ do_set_options(http_t *http, /* I - HTTP connection */
for (option = ppdFirstOption(ppd);
option;
option = ppdNextOption(ppd))
{
if ((var = cgiGetVariable(option->keyword)) != NULL)
{
have_options = 1;
ppdMarkOption(ppd, option->keyword, var);
fprintf(stderr, "DEBUG: Set %s to %s...\n", option->keyword, var);
}
else
fprintf(stderr, "DEBUG: Didn't find %s...\n", option->keyword);
}
}
if (!have_options || ppdConflicts(ppd))
@@ -3335,7 +3337,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
((ppdattr = ppdFindAttr(ppd, "cupsCommands", NULL)) != NULL &&
ppdattr->value && strstr(ppdattr->value, "AutoConfigure")))
cgiSetVariable("HAVE_AUTOCONFIGURE", "YES");
else
else
{
for (i = 0; i < ppd->num_filters; i ++)
if (!strncmp(ppd->filters[i], "application/vnd.cups-postscript", 31))
@@ -3421,16 +3423,6 @@ do_set_options(http_t *http, /* I - HTTP connection */
{
cgiSetArray("ckeyword", k, option->keyword);
cgiSetArray("ckeytext", k, option->text);
for (m = 0; m < option->num_choices; m ++)
{
if (option->choices[m].marked)
{
cgiSetArray("cchoice", k, option->choices[m].text);
break;
}
}
k ++;
}
@@ -3449,7 +3441,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
cgiSetVariable("GROUP", group->text);
cgiCopyTemplateLang("option-header.tmpl");
for (j = group->num_options, option = group->options;
j > 0;
j --, option ++)
@@ -4093,7 +4085,7 @@ get_option_value(
snprintf(buffer, bufsize, "Custom.%gx%g%s", width, length, uval);
}
else if (cupsArrayCount(coption->params) == 1)
else if (cupsArrayCount(coption->params) == 1)
{
cparam = ppdFirstCustomParam(coption);
snprintf(keyword, sizeof(keyword), "%s.%s", coption->keyword, cparam->name);
+4 -17
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* CGI support library definitions for CUPS.
* CGI support library definitions.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -33,14 +33,6 @@
# include "help-index.h"
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Types...
*/
@@ -69,12 +61,11 @@ extern void cgiCopyTemplateLang(const char *tmpl);
extern int cgiDoSearch(void *search, const char *text);
extern void cgiEndHTML(void);
extern void cgiEndMultipart(void);
extern char *cgiFormEncode(char *dst, const char *src,
size_t dstsize);
extern char *cgiFormEncode(char *dst, const char *src, size_t dstsize);
extern void cgiFreeSearch(void *search);
extern const char *cgiGetArray(const char *name, int element);
extern void cgiGetAttributes(ipp_t *request, const char *tmpl);
extern const char *cgiGetCookie(const char *name);
extern char *cgiGetCookie(const char *name, char *buf, int buflen);
extern const cgi_file_t *cgiGetFile(void);
extern cups_array_t *cgiGetIPPObjects(ipp_t *response, void *search);
extern int cgiGetSize(const char *name);
@@ -108,10 +99,6 @@ extern void cgiStartMultipart(void);
extern int cgiSupportsMultipart(void);
extern const char *cgiText(const char *message);
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_CGI_H_ */
/*
-12
Ver Arquivo
@@ -23,14 +23,6 @@
# include <cups/array.h>
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Data structures...
*/
@@ -76,10 +68,6 @@ extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query,
const char *filename);
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_HELP_INDEX_H_ */
/*
+2 -6
Ver Arquivo
@@ -333,7 +333,7 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
NULL, job_uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", NULL, "job-printer-uri");
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
if ((attr = ippFindAttribute(response, "job-printer-uri",
@@ -926,7 +926,7 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
ishttps ? "https" : "http",
userpass, hostname, port, resource);
else
snprintf(url, urlsize, "%s://%s:%d%s",
snprintf(url, urlsize, "%s://%s:%d%s",
ishttps ? "https" : "http",
hostname, port, resource);
}
@@ -1518,11 +1518,7 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
*/
if (dest)
{
snprintf(val, sizeof(val), "/%s/%s", section, dest);
cgiSetVariable("PRINTER_NAME", dest);
cgiSetVariable("PRINTER_URI_SUPPORTED", val);
}
else
strlcpy(val, "/jobs/", sizeof(val));
-2
Ver Arquivo
@@ -10,7 +10,6 @@ _cgiFormEncode
_cgiFreeSearch
_cgiGetArray
_cgiGetAttributes
_cgiGetCookie
_cgiGetFile
_cgiGetIPPObjects
_cgiGetSize
@@ -25,7 +24,6 @@ _cgiRewriteURL
_cgiSetArray
_cgiSetIPPObjectVars
_cgiSetIPPVars
_cgiSetCookie
_cgiSetServerVersion
_cgiSetSize
_cgiSetVariable
+3 -24
Ver Arquivo
@@ -3,7 +3,7 @@
*
* CGI template function.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -119,7 +119,7 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
*locptr = '\0'; /* Strip charset */
}
fprintf(stderr, "DEBUG2: lang=\"%s\", locale=\"%s\"...\n",
fprintf(stderr, "DEBUG: lang=\"%s\", locale=\"%s\"...\n",
lang ? lang : "(null)", locale);
/*
@@ -369,20 +369,6 @@ cgi_copy(FILE *out, /* I - Output file */
continue;
}
else if (name[0] == '$')
{
/*
* Insert cookie value or nothing if not defined.
*/
if ((value = cgiGetCookie(name + 1)) != NULL)
outptr = value;
else
{
outval[0] = '\0';
outptr = outval;
}
}
else
{
/*
@@ -451,14 +437,7 @@ cgi_copy(FILE *out, /* I - Output file */
* Test for existance...
*/
if (name[0] == '?')
result = cgiGetArray(name + 1, element) != NULL;
else if (name[0] == '#')
result = cgiGetVariable(name + 1) != NULL;
else
result = cgiGetArray(name, element) != NULL;
result = result && outptr[0];
result = cgiGetArray(name, element) != NULL && outptr[0];
compare[0] = '\0';
}
else
+24 -252
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* CGI form variable and array functions for CUPS.
* CGI form variable and array functions.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -14,34 +14,25 @@
*
* Contents:
*
* cgiCheckVariables() - Check for the presence of "required"
* variables.
* cgiCheckVariables() - Check for the presence of "required" variables.
* cgiClearVariables() - Clear all form variables.
* cgiGetArray() - Get an element from a form array.
* cgiGetCookie() - Get a cookie value.
* cgiGetFile() - Get the file (if any) that was submitted in
* the form.
* cgiGetArray() - Get an element from a form array...
* cgiGetFile() - Get the file (if any) that was submitted in the form.
* cgiGetSize() - Get the size of a form array value.
* cgiGetVariable() - Get a CGI variable from the database.
* cgiInitialize() - Initialize the CGI variable "database".
* cgiGetVariable() - Get a CGI variable from the database...
* cgiInitialize() - Initialize the CGI variable "database"...
* cgiIsPOST() - Determine whether this page was POSTed.
* cgiSetArray() - Set array element N to the specified string.
* cgiSetCookie() - Set a cookie value.
* cgiSetSize() - Set the array size.
* cgiSetVariable() - Set a CGI variable in the database.
* cgiSetVariable() - Set a CGI variable in the database...
* cgi_add_variable() - Add a form variable.
* cgi_compare_variables() - Compare two variables.
* cgi_find_variable() - Find a variable.
* cgi_initialize_cookies() - Initialize cookies.
* cgi_initialize_get() - Initialize form variables using the GET
* method.
* cgi_initialize_multipart() - Initialize variables and file using the POST
* method.
* cgi_find_variable() - Find a variable...
* cgi_initialize_get() - Initialize form variables using the GET method.
* cgi_initialize_multipart() - Initialize variables and file using the POST method.
* cgi_initialize_post() - Initialize variables using the POST method.
* cgi_initialize_string() - Initialize form variables from a string.
* cgi_passwd() - Catch authentication requests and notify the
* server.
* cgi_set_sid() - Set the CUPS session ID.
* cgi_passwd() - Catch authentication requests and notify the server.
* cgi_sort_variables() - Sort all form variables for faster lookup.
* cgi_unlink_file() - Remove the uploaded form.
*/
@@ -49,15 +40,6 @@
/*#define DEBUG*/
#include "cgi-private.h"
#include <errno.h>
#include <cups/http.h>
#include <cups/md5.h>
/*
* Session ID name
*/
#define CUPS_SID "org.cups.sid"
/*
@@ -77,8 +59,6 @@ typedef struct /**** Form variable structure ****/
* Local globals...
*/
static int num_cookies = 0;/* Number of cookies */
static cups_option_t *cookies = NULL;/* Cookies */
static int form_count = 0, /* Form variable count */
form_alloc = 0; /* Number of variables allocated */
static _cgi_var_t *form_vars = NULL;
@@ -96,13 +76,11 @@ static void cgi_add_variable(const char *name, int element,
static int cgi_compare_variables(const _cgi_var_t *v1,
const _cgi_var_t *v2);
static _cgi_var_t *cgi_find_variable(const char *name);
static void cgi_initialize_cookies(void);
static int cgi_initialize_get(void);
static int cgi_initialize_multipart(const char *boundary);
static int cgi_initialize_post(void);
static int cgi_initialize_string(const char *data);
static const char *cgi_passwd(const char *prompt);
static const char *cgi_set_sid(void);
static void cgi_sort_variables(void);
static void cgi_unlink_file(void);
@@ -183,7 +161,7 @@ cgiClearVariables(void)
/*
* 'cgiGetArray()' - Get an element from a form array.
* 'cgiGetArray()' - Get an element from a form array...
*/
const char * /* O - Element value or NULL */
@@ -203,17 +181,6 @@ cgiGetArray(const char *name, /* I - Name of array variable */
}
/*
* 'cgiGetCookie()' - Get a cookie value.
*/
const char * /* O - Value or NULL */
cgiGetCookie(const char *name) /* I - Name of cookie */
{
return (cupsGetOption(name, num_cookies, cookies));
}
/*
* 'cgiGetFile()' - Get the file (if any) that was submitted in the form.
*/
@@ -243,10 +210,10 @@ cgiGetSize(const char *name) /* I - Name of variable */
/*
* 'cgiGetVariable()' - Get a CGI variable from the database.
* 'cgiGetVariable()' - Get a CGI variable from the database...
*
* Returns NULL if the variable doesn't exist. If the variable is an
* array of values, returns the last element.
* array of values, returns the last element...
*/
const char * /* O - Value of variable */
@@ -270,16 +237,14 @@ cgiGetVariable(const char *name) /* I - Name of variable */
/*
* 'cgiInitialize()' - Initialize the CGI variable "database".
* 'cgiInitialize()' - Initialize the CGI variable "database"...
*/
int /* O - Non-zero if there was form data */
cgiInitialize(void)
{
const char *method, /* Form posting method */
*content_type, /* Content-Type of post data */
*cups_sid_cookie, /* SID cookie */
*cups_sid_form; /* SID form variable */
const char *method; /* Form posting method */
const char *content_type; /* Content-Type of post data */
/*
@@ -302,20 +267,6 @@ cgiInitialize(void)
setbuf(stdout, NULL);
#endif /* DEBUG */
/*
* Get cookies...
*/
cgi_initialize_cookies();
if ((cups_sid_cookie = cgiGetCookie(CUPS_SID)) == NULL)
{
fputs("DEBUG: " CUPS_SID " cookie not found, initializing!\n", stderr);
cups_sid_cookie = cgi_set_sid();
}
fprintf(stderr, "DEBUG: " CUPS_SID " cookie is \"%s\"\n", cups_sid_cookie);
/*
* Get the request method (GET or POST)...
*/
@@ -339,27 +290,9 @@ cgiInitialize(void)
boundary += 9;
if (content_type && !strncmp(content_type, "multipart/form-data; ", 21))
{
if (!cgi_initialize_multipart(boundary))
return (0);
}
else if (!cgi_initialize_post())
return (0);
if ((cups_sid_form = cgiGetVariable(CUPS_SID)) == NULL ||
strcmp(cups_sid_cookie, cups_sid_form))
{
if (cups_sid_form)
fprintf(stderr, "DEBUG: " CUPS_SID " form variable is \"%s\"\n",
cups_sid_form);
else
fputs("DEBUG: " CUPS_SID " form variable is not present.\n", stderr);
cgiClearVariables();
return (0);
}
return (cgi_initialize_multipart(boundary));
else
return (1);
return (cgi_initialize_post());
}
else
return (0);
@@ -437,38 +370,6 @@ cgiSetArray(const char *name, /* I - Name of variable */
}
/*
* 'cgiSetCookie()' - Set a cookie value.
*/
void
cgiSetCookie(const char *name, /* I - Name */
const char *value, /* I - Value */
const char *path, /* I - Path (typically "/") */
const char *domain, /* I - Domain name */
time_t expires, /* I - Expiration date (0 for session) */
int secure) /* I - Require SSL */
{
num_cookies = cupsAddOption(name, value, num_cookies, &cookies);
printf("Set-Cookie: %s=%s;", name, value);
if (path)
printf("; path=%s", path);
if (domain)
printf("; domain=%s", domain);
if (expires)
{
char date[256]; /* Date string */
printf("; expires=%s", httpGetDateString2(expires, date, sizeof(date)));
}
if (secure)
puts("; secure;");
else
puts(";");
}
/*
* 'cgiSetSize()' - Set the array size.
*/
@@ -517,7 +418,7 @@ cgiSetSize(const char *name, /* I - Name of variable */
/*
* 'cgiSetVariable()' - Set a CGI variable in the database.
* 'cgiSetVariable()' - Set a CGI variable in the database...
*
* If the variable is an array, this truncates the array to a single element.
*/
@@ -613,7 +514,7 @@ cgi_compare_variables(
/*
* 'cgi_find_variable()' - Find a variable.
* 'cgi_find_variable()' - Find a variable...
*/
static _cgi_var_t * /* O - Variable pointer or NULL */
@@ -632,91 +533,6 @@ cgi_find_variable(const char *name) /* I - Name of variable */
}
/*
* 'cgi_initialize_cookies()' - Initialize cookies.
*/
static void
cgi_initialize_cookies(void)
{
const char *cookie; /* HTTP_COOKIE environment variable */
char name[128], /* Name string */
value[512], /* Value string */
*ptr; /* Pointer into name/value */
if ((cookie = getenv("HTTP_COOKIE")) == NULL)
return;
while (*cookie)
{
/*
* Skip leading whitespace...
*/
while (isspace(*cookie & 255))
cookie ++;
if (!*cookie)
break;
/*
* Copy the name...
*/
for (ptr = name; *cookie && *cookie != '=';)
if (ptr < (name + sizeof(name) - 1))
*ptr++ = *cookie++;
else
break;
if (*cookie != '=')
break;
*ptr = '\0';
cookie ++;
/*
* Then the value...
*/
if (*cookie == '\"')
{
for (cookie ++, ptr = value; *cookie && *cookie != '\"';)
if (ptr < (value + sizeof(value) - 1))
*ptr++ = *cookie++;
else
break;
if (*cookie == '\"')
cookie ++;
}
else
{
for (ptr = value; *cookie && *cookie != ';';)
if (ptr < (value + sizeof(value) - 1))
*ptr++ = *cookie++;
else
break;
}
if (*cookie == ';')
cookie ++;
else if (*cookie)
break;
*ptr = '\0';
/*
* Then add the cookie to an array as long as the name doesn't start with
* "$"...
*/
if (name[0] != '$')
num_cookies = cupsAddOption(name, value, num_cookies, &cookies);
}
}
/*
* 'cgi_initialize_get()' - Initialize form variables using the GET method.
*/
@@ -746,8 +562,7 @@ cgi_initialize_get(void)
/*
* 'cgi_initialize_multipart()' - Initialize variables and file using the POST
* method.
* 'cgi_initialize_multipart()' - Initialize variables and file using the POST method.
*
* TODO: Update to support files > 2GB.
*/
@@ -1059,7 +874,7 @@ cgi_initialize_string(const char *data) /* I - Form data string */
char *s, /* Pointer to current form string */
ch, /* Temporary character */
name[255], /* Name of form variable */
value[65536]; /* Variable value */
value[65536]; /* Variable value... */
/*
@@ -1112,9 +927,6 @@ cgi_initialize_string(const char *data) /* I - Form data string */
* Read the hex code...
*/
if (!isxdigit(data[1] & 255) || !isxdigit(data[2] & 255))
return (0);
if (s < (value + sizeof(value) - 1))
{
data ++;
@@ -1202,46 +1014,6 @@ cgi_passwd(const char *prompt) /* I - Prompt (not used) */
}
/*
* 'cgi_set_sid()' - Set the CUPS session ID.
*/
static const char * /* O - New session ID */
cgi_set_sid(void)
{
char buffer[512], /* SID data */
sid[33]; /* SID string */
_cups_md5_state_t md5; /* MD5 state */
unsigned char sum[16]; /* MD5 sum */
const char *remote_addr, /* REMOTE_ADDR */
*server_name, /* SERVER_NAME */
*server_port; /* SERVER_PORT */
if ((remote_addr = getenv("REMOTE_ADDR")) == NULL)
remote_addr = "REMOTE_ADDR";
if ((server_name = getenv("SERVER_NAME")) == NULL)
server_name = "SERVER_NAME";
if ((server_port = getenv("SERVER_PORT")) == NULL)
server_port = "SERVER_PORT";
CUPS_SRAND(time(NULL));
snprintf(buffer, sizeof(buffer), "%s:%s:%s:%02X%02X%02X%02X%02X%02X%02X%02X",
remote_addr, server_name, server_port,
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255,
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255,
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255,
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255);
_cupsMD5Init(&md5);
_cupsMD5Append(&md5, (unsigned char *)buffer, (int)strlen(buffer));
_cupsMD5Finish(&md5, sum);
cgiSetCookie(CUPS_SID, httpMD5String(sum, sid), "/", NULL, 0, 0);
return (cupsGetOption(CUPS_SID, num_cookies, cookies));
}
/*
* 'cgi_sort_variables()' - Sort all form variables for faster lookup.
*/
-1
Ver Arquivo
@@ -46,7 +46,6 @@ application/x-csource application/postscript 33 texttops
application/x-perl application/postscript 33 texttops
application/x-shell application/postscript 33 texttops
text/plain application/postscript 33 texttops
text/css application/postscript 33 texttops
text/html application/postscript 33 texttops
image/gif application/vnd.cups-postscript 66 imagetops
image/png application/vnd.cups-postscript 66 imagetops
+1 -1
Ver Arquivo
@@ -1,7 +1,7 @@
#
# "$Id$"
#
# Sample SNMP configuration file for CUPS. See "man cups-snmp.conf" for a
# Sample SNMP configuration file for CUPS. See "man cups-smnp.conf" for a
# complete description of this file.
#
+7 -20
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-common.m4 9160 2010-06-16 20:25:12Z mike $"
dnl "$Id: cups-common.m4 8841 2009-10-07 16:24:25Z mike $"
dnl
dnl Common configuration stuff for CUPS.
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007-2010 by Apple Inc.
dnl Copyright 2007-2009 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -20,7 +20,7 @@ dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Version number information...
CUPS_VERSION="1.4.4"
CUPS_VERSION="1.4.2"
CUPS_REVISION=""
#if test -z "$CUPS_REVISION" -a -d .svn; then
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
@@ -142,7 +142,7 @@ else
fi
dnl Check for random number functions...
AC_CHECK_FUNCS(random lrand48 arc4random)
AC_CHECK_FUNCS(random mrand48 lrand48)
dnl Check for geteuid function.
AC_CHECK_FUNCS(geteuid)
@@ -174,14 +174,6 @@ AC_TRY_COMPILE([#include <time.h>],[struct tm t;
AC_DEFINE(HAVE_TM_GMTOFF),
AC_MSG_RESULT(no))
dnl See if the stat structure has the st_gen member...
AC_MSG_CHECKING(for st_gen member in stat structure)
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat t;
int o = t.st_gen;],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ST_GEN),
AC_MSG_RESULT(no))
dnl See if we have the removefile(3) function for securely removing files
AC_CHECK_FUNCS(removefile)
@@ -270,8 +262,6 @@ if test "x$enable_dbus" != xno; then
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="$CUPSDLIBS `$PKGCONFIG --libs dbus-1`"
DBUS_NOTIFIER="dbus"
DBUS_NOTIFIERLIBS="`$PKGCONFIG --libs dbus-1`"
AC_CHECK_LIB(dbus-1,
dbus_message_iter_init_append,
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),,
@@ -297,16 +287,13 @@ case $uname in
LEGACY_BACKENDS=""
BACKLIBS="$BACKLIBS -framework IOKit"
CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration -weak_framework ApplicationServices"
LIBS="-framework SystemConfiguration -framework CoreFoundation -framework Security $LIBS"
LIBS="-framework SystemConfiguration -framework CoreFoundation $LIBS"
dnl Check for framework headers...
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
dnl Check for dynamic store function...
AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName)
dnl Check for the new membership functions in MacOSX 10.4...
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
@@ -362,5 +349,5 @@ AC_SUBST(FONTS)
AC_SUBST(LEGACY_BACKENDS)
dnl
dnl End of "$Id: cups-common.m4 9160 2010-06-16 20:25:12Z mike $".
dnl End of "$Id: cups-common.m4 8841 2009-10-07 16:24:25Z mike $".
dnl
+3 -16
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-defaults.m4 8929 2009-12-15 22:40:37Z mike $"
dnl "$Id: cups-defaults.m4 8841 2009-10-07 16:24:25Z mike $"
dnl
dnl Default cupsd configuration settings for the Common UNIX Printing System
dnl (CUPS).
@@ -208,10 +208,6 @@ AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
AC_MSG_RESULT(no password file, using "$CUPS_USER")
fi)
if test "x$CUPS_USER" = "xroot" -o "x$CUPS_USER" = "x0"; then
AC_MSG_ERROR([The default user for CUPS cannot be root!])
fi
AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
CUPS_GROUP="$withval",
AC_MSG_CHECKING(for default print group)
@@ -242,10 +238,6 @@ AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
fi)
if test "x$CUPS_GROUP" = "xroot" -o "x$CUPS_GROUP" = "xwheel" -o "x$CUPS_GROUP" = "x0"; then
AC_MSG_ERROR([The default group for CUPS cannot be root!])
fi
AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
CUPS_SYSTEM_GROUPS="$withval",
if test x$uname = xDarwin; then
@@ -277,13 +269,8 @@ AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups
fi
fi)
CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
for group in $CUPS_SYSTEM_GROUPS; do
if test "x$CUPS_GROUP" = "x$group"; then
AC_MSG_ERROR([The default system groups cannot contain the default CUPS group!])
fi
done
CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
AC_SUBST(CUPS_USER)
AC_SUBST(CUPS_GROUP)
@@ -448,5 +435,5 @@ AC_SUBST(BANNERTOPS)
AC_SUBST(TEXTTOPS)
dnl
dnl End of "$Id: cups-defaults.m4 8929 2009-12-15 22:40:37Z mike $".
dnl End of "$Id: cups-defaults.m4 8841 2009-10-07 16:24:25Z mike $".
dnl
+5 -4
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-launchd.m4 9120 2010-04-23 18:56:34Z mike $"
dnl "$Id: cups-launchd.m4 8344 2009-02-10 17:05:35Z mike $"
dnl
dnl launchd stuff for CUPS.
dnl launchd stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007-2010 by Apple Inc.
dnl Copyright 2007-2009 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -35,9 +35,10 @@ if test x$enable_launchd != xno; then
esac
fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LAUNCHD_CONF, "$DEFAULT_LAUNCHD_CONF")
AC_SUBST(DEFAULT_LAUNCHD_CONF)
AC_SUBST(LAUNCHDLIBS)
dnl
dnl End of "$Id: cups-launchd.m4 9120 2010-04-23 18:56:34Z mike $".
dnl End of "$Id: cups-launchd.m4 8344 2009-02-10 17:05:35Z mike $".
dnl
+2 -17
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-sharedlibs.m4 9154 2010-06-16 00:49:01Z mike $"
dnl "$Id: cups-sharedlibs.m4 8344 2009-02-10 17:05:35Z mike $"
dnl
dnl Shared library support for the Common UNIX Printing System (CUPS).
dnl
@@ -158,31 +158,16 @@ AC_SUBST(LIBCUPSPPDC)
if test x$enable_shared = xno; then
LINKCUPS="../cups/libcups.a"
LINKCUPSIMAGE="../filter/libcupsimage.a"
EXTLINKCUPS="-lcups"
EXTLINKCUPSDRIVER="-lcupsdriver"
EXTLINKCUPSIMAGE="-lcupsimage"
else
if test $uname = AIX; then
LINKCUPS="-lcups_s"
LINKCUPSIMAGE="-lcupsimage_s"
EXTLINKCUPS="-lcups_s"
EXTLINKCUPSDRIVER="-lcupsdriver_s"
EXTLINKCUPSIMAGE="-lcupsimage_s"
else
LINKCUPS="-lcups"
LINKCUPSIMAGE="-lcupsimage"
EXTLINKCUPS="-lcups"
EXTLINKCUPSDRIVER="-lcupsdriver"
EXTLINKCUPSIMAGE="-lcupsimage"
fi
fi
AC_SUBST(EXTLINKCUPS)
AC_SUBST(EXTLINKCUPSDRIVER)
AC_SUBST(EXTLINKCUPSIMAGE)
AC_SUBST(LINKCUPS)
AC_SUBST(LINKCUPSIMAGE)
@@ -259,5 +244,5 @@ AC_SUBST(IMGLIBS)
AC_SUBST(EXPORT_LDFLAGS)
dnl
dnl End of "$Id: cups-sharedlibs.m4 9154 2010-06-16 00:49:01Z mike $".
dnl End of "$Id: cups-sharedlibs.m4 8344 2009-02-10 17:05:35Z mike $".
dnl
+14 -42
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-ssl.m4 9165 2010-06-17 18:20:39Z mike $"
dnl "$Id: cups-ssl.m4 8591 2009-05-04 23:40:10Z mike $"
dnl
dnl OpenSSL/GNUTLS stuff for CUPS.
dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007-2010 by Apple Inc.
dnl Copyright 2007-2009 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -26,14 +26,13 @@ AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenS
SSLFLAGS=""
SSLLIBS=""
have_ssl=0
if test x$enable_ssl != xno; then
dnl Look for CDSA...
if test $have_ssl = 0 -a "x${enable_cdsassl}" != "xno"; then
if test "x${SSLLIBS}" = "x" -a "x${enable_cdsassl}" != "xno"; then
if test $uname = Darwin; then
AC_CHECK_HEADER(Security/SecureTransport.h, [
have_ssl=1
SSLLIBS="-framework CoreFoundation -framework Security"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_CDSASSL)
@@ -59,44 +58,18 @@ if test x$enable_ssl != xno; then
fi
dnl Then look for GNU TLS...
if test $have_ssl = 0 -a "x${enable_gnutls}" != "xno" -a "x$PKGCONFIG" != x; then
if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno" -a "x$PKGCONFIG" != x; then
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
AC_PATH_PROG(LIBGCRYPTCONFIG,libgcrypt-config)
if $PKGCONFIG --exists gnutls; then
if test "x$have_pthread" = xyes; then
AC_MSG_WARN([The current version of GNU TLS cannot be made thread-safe.])
else
have_ssl=1
SSLLIBS=`$PKGCONFIG --libs gnutls`
SSLFLAGS=`$PKGCONFIG --cflags gnutls`
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)
fi
elif test "x$LIBGNUTLSCONFIG" != x; then
if test "x$have_pthread" = xyes; then
AC_MSG_WARN([The current version of GNU TLS cannot be made thread-safe.])
else
have_ssl=1
SSLLIBS=`$LIBGNUTLSCONFIG --libs`
SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)
fi
fi
if test $have_ssl = 1; then
if $PKGCONFIG --exists gcrypt; then
SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`"
SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`"
elif test "x$LIBGCRYPTCONFIG" != x; then
SSLLIBS="$SSLLIBS `$LIBGCRYPTCONFIG --libs`"
SSLFLAGS="$SSLFLAGS `$LIBGCRYPTCONFIG --cflags`"
fi
SSLLIBS=`$PKGCONFIG --libs gnutls`
SSLFLAGS=`$PKGCONFIG --cflags gnutls`
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)
fi
fi
dnl Check for the OpenSSL library last...
if test $have_ssl = 0 -a "x${enable_openssl}" != "xno"; then
if test "x${SSLLIBS}" = "x" -a "x${enable_openssl}" != "xno"; then
AC_CHECK_HEADER(openssl/ssl.h,
dnl Save the current libraries so the crypto stuff isn't always
dnl included...
@@ -114,8 +87,7 @@ if test x$enable_ssl != xno; then
"-lcrypto -lRSAglue -lrsaref"
do
AC_CHECK_LIB(ssl,SSL_new,
[have_ssl=1
SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
[SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
SSLLIBS="-lssl $libcrypto"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_LIBSSL)],,
@@ -130,7 +102,7 @@ if test x$enable_ssl != xno; then
fi
fi
if test $have_ssl = 1; then
if test "x$SSLLIBS" != x; then
AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
fi
@@ -143,5 +115,5 @@ AC_SUBST(EXPORT_SSLLIBS)
dnl
dnl End of "$Id: cups-ssl.m4 9165 2010-06-17 18:20:39Z mike $".
dnl End of "$Id: cups-ssl.m4 8591 2009-05-04 23:40:10Z mike $".
dnl
+6 -33
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Configuration file for CUPS.
* Configuration file for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -342,13 +342,6 @@
#undef HAVE_SYS_IOCTL_H
/*
* Does the "stat" structure contain the "st_gen" member?
*/
#undef HAVE_ST_GEN
/*
* Does the "tm" structure contain the "tm_gmtoff" member?
*/
@@ -439,6 +432,7 @@
#undef HAVE_LAUNCH_H
#undef HAVE_LAUNCHD
#define CUPS_DEFAULT_LAUNCHD_CONF ""
/*
@@ -489,14 +483,7 @@
/*
* Do we have the SCDynamicStoreCopyComputerName function?
*/
#undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME
/*
* Do we have MacOSX 10.4's mbr_XXX functions?
* Do we have MacOSX 10.4's mbr_XXX functions()?
*/
#undef HAVE_MEMBERSHIP_H
@@ -505,7 +492,7 @@
/*
* Do we have Darwin's notify_post header and function?
* Do we have Darwin's notify_post() header and function?
*/
#undef HAVE_NOTIFY_H
@@ -599,24 +586,10 @@
* Which random number generator function to use...
*/
#undef HAVE_ARC4RANDOM
#undef HAVE_RANDOM
#undef HAVE_MRAND48
#undef HAVE_LRAND48
#ifdef HAVE_ARC4RANDOM
# define CUPS_RAND() arc4random()
# define CUPS_SRAND(v) arc4random_stir()
#elif defined(HAVE_RANDOM)
# define CUPS_RAND() random()
# define CUPS_SRAND(v) srandom(v)
#elif defined(HAVE_LRAND48)
# define CUPS_RAND() lrand48()
# define CUPS_SRAND(v) srand48(v)
#else
# define CUPS_RAND() rand()
# define CUPS_SRAND(v) srand(v)
#endif /* HAVE_ARC4RANDOM */
/*
* Do we have vproc_transaction_begin/end?
+1 -1
Ver Arquivo
@@ -31,9 +31,9 @@ sinclude(config-scripts/cups-poll.m4)
sinclude(config-scripts/cups-slp.m4)
sinclude(config-scripts/cups-gssapi.m4)
sinclude(config-scripts/cups-ldap.m4)
sinclude(config-scripts/cups-threads.m4)
sinclude(config-scripts/cups-ssl.m4)
sinclude(config-scripts/cups-pam.m4)
sinclude(config-scripts/cups-threads.m4)
sinclude(config-scripts/cups-largefile.m4)
sinclude(config-scripts/cups-dnssd.m4)
sinclude(config-scripts/cups-launchd.m4)
+4 -4
Ver Arquivo
@@ -4,7 +4,7 @@
#
# CUPS configuration utility.
#
# Copyright 2007-2010 by Apple Inc.
# Copyright 2007-2008 by Apple Inc.
# Copyright 2001-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -113,12 +113,12 @@ while test $# -gt 0; do
;;
--libs)
if test $static = no; then
libs="@EXTLINKCUPS@ $LIBS";
libs="-lcups $LIBS";
if test $image = yes; then
libs="@EXTLINKCUPSIMAGE@ $libs"
libs="-lcupsimage $libs"
fi
if test $driver = yes; then
libs="@EXTLINKCUPSDRIVER@ $libs"
libs="-lcupsdriver $libs"
fi
else
libs="$libdir/libcups.a $LIBS";
+102 -159
Ver Arquivo
@@ -2,131 +2,112 @@
adminutil.o: adminutil.h cups.h ipp.h http.h versioning.h ppd.h array.h
adminutil.o: file.h language.h globals.h string.h ../config.h http-private.h
adminutil.o: md5.h ipp-private.h i18n.h transcode.h pwg-private.h
adminutil.o: ../cups/cups.h debug.h
adminutil.o: md5.h ipp-private.h i18n.h transcode.h debug.h
array.o: array.h versioning.h string.h ../config.h debug.h
attr.o: ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
attr.o: language.h debug.h string.h ../config.h
auth.o: globals.h string.h ../config.h http-private.h http.h versioning.h
auth.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
auth.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
auth.o: i18n.h transcode.h debug.h
backchannel.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h
backchannel.o: language.h
backend.o: backend.h versioning.h globals.h string.h ../config.h
backend.o: http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h
backend.o: array.h file.h language.h i18n.h transcode.h pwg-private.h
backend.o: ../cups/cups.h
backend.o: array.h file.h language.h i18n.h transcode.h
conflicts.o: ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h
conflicts.o: file.h language.h string.h ../config.h debug.h
custom.o: globals.h string.h ../config.h http-private.h http.h versioning.h
custom.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
custom.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
custom.o: i18n.h transcode.h debug.h
debug.o: globals.h string.h ../config.h http-private.h http.h versioning.h
debug.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
debug.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
debug.o: i18n.h transcode.h debug.h
dest.o: debug.h globals.h string.h ../config.h http-private.h http.h
dest.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
dest.o: language.h i18n.h transcode.h pwg-private.h ../cups/cups.h
dest.o: language.h i18n.h transcode.h pwgmedia.h
dir.o: dir.h versioning.h string.h ../config.h debug.h
emit.o: ppd.h array.h versioning.h file.h string.h ../config.h debug.h
encode.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
encode.o: ipp-private.h string.h ../config.h debug.h
file.o: file-private.h http-private.h ../config.h http.h versioning.h md5.h
file.o: ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h
file.o: language.h i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
file.o: language.h i18n.h transcode.h debug.h
getdevices.o: globals.h string.h ../config.h http-private.h http.h
getdevices.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
getdevices.o: file.h language.h i18n.h transcode.h pwg-private.h
getdevices.o: ../cups/cups.h debug.h
getdevices.o: file.h language.h i18n.h transcode.h debug.h
getifaddrs.o: http-private.h ../config.h http.h versioning.h md5.h
getifaddrs.o: ipp-private.h ipp.h
getputfile.o: globals.h string.h ../config.h http-private.h http.h
getputfile.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
getputfile.o: file.h language.h i18n.h transcode.h pwg-private.h
getputfile.o: ../cups/cups.h debug.h
getputfile.o: file.h language.h i18n.h transcode.h debug.h
globals.o: http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
globals.o: ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
globals.o: i18n.h transcode.h pwg-private.h ../cups/cups.h
globals.o: i18n.h transcode.h
http.o: http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
http.o: ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
http.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
http.o: i18n.h transcode.h debug.h
http-addr.o: http-private.h ../config.h http.h versioning.h md5.h
http-addr.o: ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
http-addr.o: file.h language.h i18n.h transcode.h pwg-private.h
http-addr.o: ../cups/cups.h debug.h
http-addr.o: file.h language.h i18n.h transcode.h debug.h
http-addrlist.o: http-private.h ../config.h http.h versioning.h md5.h
http-addrlist.o: ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
http-addrlist.o: file.h language.h i18n.h transcode.h pwg-private.h
http-addrlist.o: ../cups/cups.h debug.h
http-addrlist.o: file.h language.h i18n.h transcode.h debug.h
http-support.o: debug.h globals.h string.h ../config.h http-private.h http.h
http-support.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
http-support.o: file.h language.h i18n.h transcode.h pwg-private.h
http-support.o: ../cups/cups.h
http-support.o: file.h language.h i18n.h transcode.h
ipp.o: http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
ipp.o: ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
ipp.o: transcode.h pwg-private.h ../cups/cups.h debug.h
ipp.o: transcode.h debug.h
ipp-support.o: globals.h string.h ../config.h http-private.h http.h
ipp-support.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
ipp-support.o: file.h language.h i18n.h transcode.h pwg-private.h
ipp-support.o: ../cups/cups.h debug.h
ipp-support.o: file.h language.h i18n.h transcode.h debug.h
langprintf.o: globals.h string.h ../config.h http-private.h http.h
langprintf.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
langprintf.o: file.h language.h i18n.h transcode.h pwg-private.h
langprintf.o: ../cups/cups.h
langprintf.o: file.h language.h i18n.h transcode.h
language.o: globals.h string.h ../config.h http-private.h http.h versioning.h
language.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
language.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
language.o: i18n.h transcode.h debug.h
localize.o: globals.h string.h ../config.h http-private.h http.h versioning.h
localize.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
localize.o: i18n.h transcode.h pwg-private.h ../cups/cups.h ppd-private.h
localize.o: debug.h
localize.o: i18n.h transcode.h ppd-private.h debug.h
mark.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
mark.o: string.h ../config.h debug.h pwg-private.h ../cups/cups.h
mark.o: string.h ../config.h debug.h pwgmedia.h
md5.o: md5.h string.h ../config.h
md5passwd.o: http-private.h ../config.h http.h versioning.h md5.h
md5passwd.o: ipp-private.h ipp.h string.h
notify.o: globals.h string.h ../config.h http-private.h http.h versioning.h
notify.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
notify.o: i18n.h transcode.h pwg-private.h ../cups/cups.h
notify.o: i18n.h transcode.h
options.o: cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
options.o: string.h ../config.h debug.h
page.o: ppd.h array.h versioning.h file.h string.h ../config.h debug.h
ppd.o: ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
ppd.o: language.h pwg-private.h ../cups/cups.h globals.h string.h ../config.h
ppd.o: http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
pwg-file.o: pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-file.o: http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-file.o: cups.h ppd.h array.h file.h language.h i18n.h transcode.h debug.h
pwg-media.o: pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-media.o: http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-media.o: cups.h ppd.h array.h file.h language.h i18n.h transcode.h
pwg-media.o: debug.h
pwg-ppd.o: pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-ppd.o: http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-ppd.o: cups.h ppd.h array.h file.h language.h i18n.h transcode.h debug.h
ppd.o: language.h globals.h string.h ../config.h http-private.h md5.h
ppd.o: ipp-private.h i18n.h transcode.h debug.h
pwgmedia.o: pwgmedia.h globals.h string.h ../config.h http-private.h http.h
pwgmedia.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
pwgmedia.o: file.h language.h i18n.h transcode.h debug.h
request.o: globals.h string.h ../config.h http-private.h http.h versioning.h
request.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
request.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
request.o: i18n.h transcode.h debug.h
sidechannel.o: sidechannel.h versioning.h string.h ../config.h debug.h
snmp.o: globals.h string.h ../config.h http-private.h http.h versioning.h
snmp.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
snmp.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
snmp.o: snmp-private.h
snmp.o: i18n.h transcode.h debug.h snmp-private.h
snprintf.o: string.h ../config.h
string.o: array.h versioning.h debug.h string.h ../config.h
tempfile.o: globals.h string.h ../config.h http-private.h http.h versioning.h
tempfile.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
tempfile.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
tempfile.o: i18n.h transcode.h debug.h
transcode.o: globals.h string.h ../config.h http-private.h http.h
transcode.o: versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
transcode.o: file.h language.h i18n.h transcode.h pwg-private.h
transcode.o: ../cups/cups.h debug.h
transcode.o: file.h language.h i18n.h transcode.h debug.h
usersys.o: http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
usersys.o: ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
usersys.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
usersys.o: i18n.h transcode.h debug.h
util.o: globals.h string.h ../config.h http-private.h http.h versioning.h
util.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
util.o: i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
util.o: i18n.h transcode.h debug.h
testadmin.o: adminutil.h cups.h ipp.h http.h versioning.h ppd.h array.h
testadmin.o: file.h language.h string.h ../config.h
testarray.o: ../cups/string.h ../config.h string.h array.h versioning.h dir.h
@@ -146,138 +127,119 @@ testoptions.o: string.h ../config.h cups.h ipp.h http.h versioning.h ppd.h
testoptions.o: array.h file.h language.h
testlang.o: i18n.h transcode.h language.h array.h versioning.h string.h
testlang.o: ../config.h
testppd.o: ../cups/cups.h ../cups/string.h ../config.h string.h
testpwg.o: pwg-private.h ../cups/cups.h
testppd.o: ../cups/string.h ../config.h string.h cups.h ipp.h http.h
testppd.o: versioning.h ppd.h array.h file.h language.h pwgmedia.h
testsnmp.o: string.h ../config.h snmp-private.h http.h versioning.h
# DO NOT DELETE
adminutil.32.o: adminutil.c adminutil.h cups.h ipp.h http.h versioning.h ppd.h array.h
adminutil.32.o: adminutil.c file.h language.h globals.h string.h ../config.h http-private.h
adminutil.32.o: adminutil.c md5.h ipp-private.h i18n.h transcode.h pwg-private.h
adminutil.32.o: adminutil.c ../cups/cups.h debug.h
adminutil.32.o: adminutil.c md5.h ipp-private.h i18n.h transcode.h debug.h
array.32.o: array.c array.h versioning.h string.h ../config.h debug.h
attr.32.o: attr.c ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
attr.32.o: attr.c language.h debug.h string.h ../config.h
auth.32.o: auth.c globals.h string.h ../config.h http-private.h http.h versioning.h
auth.32.o: auth.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
auth.32.o: auth.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
auth.32.o: auth.c i18n.h transcode.h debug.h
backchannel.32.o: backchannel.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h
backchannel.32.o: backchannel.c language.h
backend.32.o: backend.c backend.h versioning.h globals.h string.h ../config.h
backend.32.o: backend.c http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h
backend.32.o: backend.c array.h file.h language.h i18n.h transcode.h pwg-private.h
backend.32.o: backend.c ../cups/cups.h
backend.32.o: backend.c array.h file.h language.h i18n.h transcode.h
conflicts.32.o: conflicts.c ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h
conflicts.32.o: conflicts.c file.h language.h string.h ../config.h debug.h
custom.32.o: custom.c globals.h string.h ../config.h http-private.h http.h versioning.h
custom.32.o: custom.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
custom.32.o: custom.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
custom.32.o: custom.c i18n.h transcode.h debug.h
debug.32.o: debug.c globals.h string.h ../config.h http-private.h http.h versioning.h
debug.32.o: debug.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
debug.32.o: debug.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
debug.32.o: debug.c i18n.h transcode.h debug.h
dest.32.o: dest.c debug.h globals.h string.h ../config.h http-private.h http.h
dest.32.o: dest.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
dest.32.o: dest.c language.h i18n.h transcode.h pwg-private.h ../cups/cups.h
dest.32.o: dest.c language.h i18n.h transcode.h pwgmedia.h
dir.32.o: dir.c dir.h versioning.h string.h ../config.h debug.h
emit.32.o: emit.c ppd.h array.h versioning.h file.h string.h ../config.h debug.h
encode.32.o: encode.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
encode.32.o: encode.c ipp-private.h string.h ../config.h debug.h
file.32.o: file.c file-private.h http-private.h ../config.h http.h versioning.h md5.h
file.32.o: file.c ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h
file.32.o: file.c language.h i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
file.32.o: file.c language.h i18n.h transcode.h debug.h
getdevices.32.o: getdevices.c globals.h string.h ../config.h http-private.h http.h
getdevices.32.o: getdevices.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
getdevices.32.o: getdevices.c file.h language.h i18n.h transcode.h pwg-private.h
getdevices.32.o: getdevices.c ../cups/cups.h debug.h
getdevices.32.o: getdevices.c file.h language.h i18n.h transcode.h debug.h
getifaddrs.32.o: getifaddrs.c http-private.h ../config.h http.h versioning.h md5.h
getifaddrs.32.o: getifaddrs.c ipp-private.h ipp.h
getputfile.32.o: getputfile.c globals.h string.h ../config.h http-private.h http.h
getputfile.32.o: getputfile.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
getputfile.32.o: getputfile.c file.h language.h i18n.h transcode.h pwg-private.h
getputfile.32.o: getputfile.c ../cups/cups.h debug.h
getputfile.32.o: getputfile.c file.h language.h i18n.h transcode.h debug.h
globals.32.o: globals.c http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
globals.32.o: globals.c ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
globals.32.o: globals.c i18n.h transcode.h pwg-private.h ../cups/cups.h
globals.32.o: globals.c i18n.h transcode.h
http.32.o: http.c http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
http.32.o: http.c ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
http.32.o: http.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
http.32.o: http.c i18n.h transcode.h debug.h
http-addr.32.o: http-addr.c http-private.h ../config.h http.h versioning.h md5.h
http-addr.32.o: http-addr.c ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
http-addr.32.o: http-addr.c file.h language.h i18n.h transcode.h pwg-private.h
http-addr.32.o: http-addr.c ../cups/cups.h debug.h
http-addr.32.o: http-addr.c file.h language.h i18n.h transcode.h debug.h
http-addrlist.32.o: http-addrlist.c http-private.h ../config.h http.h versioning.h md5.h
http-addrlist.32.o: http-addrlist.c ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
http-addrlist.32.o: http-addrlist.c file.h language.h i18n.h transcode.h pwg-private.h
http-addrlist.32.o: http-addrlist.c ../cups/cups.h debug.h
http-addrlist.32.o: http-addrlist.c file.h language.h i18n.h transcode.h debug.h
http-support.32.o: http-support.c debug.h globals.h string.h ../config.h http-private.h http.h
http-support.32.o: http-support.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
http-support.32.o: http-support.c file.h language.h i18n.h transcode.h pwg-private.h
http-support.32.o: http-support.c ../cups/cups.h
http-support.32.o: http-support.c file.h language.h i18n.h transcode.h
ipp.32.o: ipp.c http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
ipp.32.o: ipp.c ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
ipp.32.o: ipp.c transcode.h pwg-private.h ../cups/cups.h debug.h
ipp.32.o: ipp.c transcode.h debug.h
ipp-support.32.o: ipp-support.c globals.h string.h ../config.h http-private.h http.h
ipp-support.32.o: ipp-support.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
ipp-support.32.o: ipp-support.c file.h language.h i18n.h transcode.h pwg-private.h
ipp-support.32.o: ipp-support.c ../cups/cups.h debug.h
ipp-support.32.o: ipp-support.c file.h language.h i18n.h transcode.h debug.h
langprintf.32.o: langprintf.c globals.h string.h ../config.h http-private.h http.h
langprintf.32.o: langprintf.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
langprintf.32.o: langprintf.c file.h language.h i18n.h transcode.h pwg-private.h
langprintf.32.o: langprintf.c ../cups/cups.h
langprintf.32.o: langprintf.c file.h language.h i18n.h transcode.h
language.32.o: language.c globals.h string.h ../config.h http-private.h http.h versioning.h
language.32.o: language.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
language.32.o: language.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
language.32.o: language.c i18n.h transcode.h debug.h
localize.32.o: localize.c globals.h string.h ../config.h http-private.h http.h versioning.h
localize.32.o: localize.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
localize.32.o: localize.c i18n.h transcode.h pwg-private.h ../cups/cups.h ppd-private.h
localize.32.o: localize.c debug.h
localize.32.o: localize.c i18n.h transcode.h ppd-private.h debug.h
mark.32.o: mark.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
mark.32.o: mark.c string.h ../config.h debug.h pwg-private.h ../cups/cups.h
mark.32.o: mark.c string.h ../config.h debug.h pwgmedia.h
md5.32.o: md5.c md5.h string.h ../config.h
md5passwd.32.o: md5passwd.c http-private.h ../config.h http.h versioning.h md5.h
md5passwd.32.o: md5passwd.c ipp-private.h ipp.h string.h
notify.32.o: notify.c globals.h string.h ../config.h http-private.h http.h versioning.h
notify.32.o: notify.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
notify.32.o: notify.c i18n.h transcode.h pwg-private.h ../cups/cups.h
notify.32.o: notify.c i18n.h transcode.h
options.32.o: options.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
options.32.o: options.c string.h ../config.h debug.h
page.32.o: page.c ppd.h array.h versioning.h file.h string.h ../config.h debug.h
ppd.32.o: ppd.c ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
ppd.32.o: ppd.c language.h pwg-private.h ../cups/cups.h globals.h string.h ../config.h
ppd.32.o: ppd.c http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
pwg-file.32.o: pwg-file.c pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-file.32.o: pwg-file.c http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-file.32.o: pwg-file.c cups.h ppd.h array.h file.h language.h i18n.h transcode.h debug.h
pwg-media.32.o: pwg-media.c pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-media.32.o: pwg-media.c http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-media.32.o: pwg-media.c cups.h ppd.h array.h file.h language.h i18n.h transcode.h
pwg-media.32.o: pwg-media.c debug.h
pwg-ppd.32.o: pwg-ppd.c pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-ppd.32.o: pwg-ppd.c http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-ppd.32.o: pwg-ppd.c cups.h ppd.h array.h file.h language.h i18n.h transcode.h debug.h
ppd.32.o: ppd.c language.h globals.h string.h ../config.h http-private.h md5.h
ppd.32.o: ppd.c ipp-private.h i18n.h transcode.h debug.h
pwgmedia.32.o: pwgmedia.c pwgmedia.h globals.h string.h ../config.h http-private.h http.h
pwgmedia.32.o: pwgmedia.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
pwgmedia.32.o: pwgmedia.c file.h language.h i18n.h transcode.h debug.h
request.32.o: request.c globals.h string.h ../config.h http-private.h http.h versioning.h
request.32.o: request.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
request.32.o: request.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
request.32.o: request.c i18n.h transcode.h debug.h
sidechannel.32.o: sidechannel.c sidechannel.h versioning.h string.h ../config.h debug.h
snmp.32.o: snmp.c globals.h string.h ../config.h http-private.h http.h versioning.h
snmp.32.o: snmp.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
snmp.32.o: snmp.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
snmp.32.o: snmp.c snmp-private.h
snmp.32.o: snmp.c i18n.h transcode.h debug.h snmp-private.h
snprintf.32.o: snprintf.c string.h ../config.h
string.32.o: string.c array.h versioning.h debug.h string.h ../config.h
tempfile.32.o: tempfile.c globals.h string.h ../config.h http-private.h http.h versioning.h
tempfile.32.o: tempfile.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
tempfile.32.o: tempfile.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
tempfile.32.o: tempfile.c i18n.h transcode.h debug.h
transcode.32.o: transcode.c globals.h string.h ../config.h http-private.h http.h
transcode.32.o: transcode.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
transcode.32.o: transcode.c file.h language.h i18n.h transcode.h pwg-private.h
transcode.32.o: transcode.c ../cups/cups.h debug.h
transcode.32.o: transcode.c file.h language.h i18n.h transcode.h debug.h
usersys.32.o: usersys.c http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
usersys.32.o: usersys.c ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
usersys.32.o: usersys.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
usersys.32.o: usersys.c i18n.h transcode.h debug.h
util.32.o: util.c globals.h string.h ../config.h http-private.h http.h versioning.h
util.32.o: util.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
util.32.o: util.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
util.32.o: util.c i18n.h transcode.h debug.h
testadmin.32.o: testadmin.c adminutil.h cups.h ipp.h http.h versioning.h ppd.h array.h
testadmin.32.o: testadmin.c file.h language.h string.h ../config.h
testarray.32.o: testarray.c ../cups/string.h ../config.h string.h array.h versioning.h dir.h
@@ -297,138 +259,119 @@ testoptions.32.o: testoptions.c string.h ../config.h cups.h ipp.h http.h versio
testoptions.32.o: testoptions.c array.h file.h language.h
testlang.32.o: testlang.c i18n.h transcode.h language.h array.h versioning.h string.h
testlang.32.o: testlang.c ../config.h
testppd.32.o: testppd.c ../cups/cups.h ../cups/string.h ../config.h string.h
testpwg.32.o: testpwg.c pwg-private.h ../cups/cups.h
testppd.32.o: testppd.c ../cups/string.h ../config.h string.h cups.h ipp.h http.h
testppd.32.o: testppd.c versioning.h ppd.h array.h file.h language.h pwgmedia.h
testsnmp.32.o: testsnmp.c string.h ../config.h snmp-private.h http.h versioning.h
# DO NOT DELETE
adminutil.64.o: adminutil.c adminutil.h cups.h ipp.h http.h versioning.h ppd.h array.h
adminutil.64.o: adminutil.c file.h language.h globals.h string.h ../config.h http-private.h
adminutil.64.o: adminutil.c md5.h ipp-private.h i18n.h transcode.h pwg-private.h
adminutil.64.o: adminutil.c ../cups/cups.h debug.h
adminutil.64.o: adminutil.c md5.h ipp-private.h i18n.h transcode.h debug.h
array.64.o: array.c array.h versioning.h string.h ../config.h debug.h
attr.64.o: attr.c ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
attr.64.o: attr.c language.h debug.h string.h ../config.h
auth.64.o: auth.c globals.h string.h ../config.h http-private.h http.h versioning.h
auth.64.o: auth.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
auth.64.o: auth.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
auth.64.o: auth.c i18n.h transcode.h debug.h
backchannel.64.o: backchannel.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h
backchannel.64.o: backchannel.c language.h
backend.64.o: backend.c backend.h versioning.h globals.h string.h ../config.h
backend.64.o: backend.c http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h
backend.64.o: backend.c array.h file.h language.h i18n.h transcode.h pwg-private.h
backend.64.o: backend.c ../cups/cups.h
backend.64.o: backend.c array.h file.h language.h i18n.h transcode.h
conflicts.64.o: conflicts.c ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h
conflicts.64.o: conflicts.c file.h language.h string.h ../config.h debug.h
custom.64.o: custom.c globals.h string.h ../config.h http-private.h http.h versioning.h
custom.64.o: custom.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
custom.64.o: custom.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
custom.64.o: custom.c i18n.h transcode.h debug.h
debug.64.o: debug.c globals.h string.h ../config.h http-private.h http.h versioning.h
debug.64.o: debug.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
debug.64.o: debug.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
debug.64.o: debug.c i18n.h transcode.h debug.h
dest.64.o: dest.c debug.h globals.h string.h ../config.h http-private.h http.h
dest.64.o: dest.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
dest.64.o: dest.c language.h i18n.h transcode.h pwg-private.h ../cups/cups.h
dest.64.o: dest.c language.h i18n.h transcode.h pwgmedia.h
dir.64.o: dir.c dir.h versioning.h string.h ../config.h debug.h
emit.64.o: emit.c ppd.h array.h versioning.h file.h string.h ../config.h debug.h
encode.64.o: encode.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
encode.64.o: encode.c ipp-private.h string.h ../config.h debug.h
file.64.o: file.c file-private.h http-private.h ../config.h http.h versioning.h md5.h
file.64.o: file.c ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h
file.64.o: file.c language.h i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
file.64.o: file.c language.h i18n.h transcode.h debug.h
getdevices.64.o: getdevices.c globals.h string.h ../config.h http-private.h http.h
getdevices.64.o: getdevices.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
getdevices.64.o: getdevices.c file.h language.h i18n.h transcode.h pwg-private.h
getdevices.64.o: getdevices.c ../cups/cups.h debug.h
getdevices.64.o: getdevices.c file.h language.h i18n.h transcode.h debug.h
getifaddrs.64.o: getifaddrs.c http-private.h ../config.h http.h versioning.h md5.h
getifaddrs.64.o: getifaddrs.c ipp-private.h ipp.h
getputfile.64.o: getputfile.c globals.h string.h ../config.h http-private.h http.h
getputfile.64.o: getputfile.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
getputfile.64.o: getputfile.c file.h language.h i18n.h transcode.h pwg-private.h
getputfile.64.o: getputfile.c ../cups/cups.h debug.h
getputfile.64.o: getputfile.c file.h language.h i18n.h transcode.h debug.h
globals.64.o: globals.c http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
globals.64.o: globals.c ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
globals.64.o: globals.c i18n.h transcode.h pwg-private.h ../cups/cups.h
globals.64.o: globals.c i18n.h transcode.h
http.64.o: http.c http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
http.64.o: http.c ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
http.64.o: http.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
http.64.o: http.c i18n.h transcode.h debug.h
http-addr.64.o: http-addr.c http-private.h ../config.h http.h versioning.h md5.h
http-addr.64.o: http-addr.c ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
http-addr.64.o: http-addr.c file.h language.h i18n.h transcode.h pwg-private.h
http-addr.64.o: http-addr.c ../cups/cups.h debug.h
http-addr.64.o: http-addr.c file.h language.h i18n.h transcode.h debug.h
http-addrlist.64.o: http-addrlist.c http-private.h ../config.h http.h versioning.h md5.h
http-addrlist.64.o: http-addrlist.c ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h
http-addrlist.64.o: http-addrlist.c file.h language.h i18n.h transcode.h pwg-private.h
http-addrlist.64.o: http-addrlist.c ../cups/cups.h debug.h
http-addrlist.64.o: http-addrlist.c file.h language.h i18n.h transcode.h debug.h
http-support.64.o: http-support.c debug.h globals.h string.h ../config.h http-private.h http.h
http-support.64.o: http-support.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
http-support.64.o: http-support.c file.h language.h i18n.h transcode.h pwg-private.h
http-support.64.o: http-support.c ../cups/cups.h
http-support.64.o: http-support.c file.h language.h i18n.h transcode.h
ipp.64.o: ipp.c http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
ipp.64.o: ipp.c ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
ipp.64.o: ipp.c transcode.h pwg-private.h ../cups/cups.h debug.h
ipp.64.o: ipp.c transcode.h debug.h
ipp-support.64.o: ipp-support.c globals.h string.h ../config.h http-private.h http.h
ipp-support.64.o: ipp-support.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
ipp-support.64.o: ipp-support.c file.h language.h i18n.h transcode.h pwg-private.h
ipp-support.64.o: ipp-support.c ../cups/cups.h debug.h
ipp-support.64.o: ipp-support.c file.h language.h i18n.h transcode.h debug.h
langprintf.64.o: langprintf.c globals.h string.h ../config.h http-private.h http.h
langprintf.64.o: langprintf.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
langprintf.64.o: langprintf.c file.h language.h i18n.h transcode.h pwg-private.h
langprintf.64.o: langprintf.c ../cups/cups.h
langprintf.64.o: langprintf.c file.h language.h i18n.h transcode.h
language.64.o: language.c globals.h string.h ../config.h http-private.h http.h versioning.h
language.64.o: language.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
language.64.o: language.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
language.64.o: language.c i18n.h transcode.h debug.h
localize.64.o: localize.c globals.h string.h ../config.h http-private.h http.h versioning.h
localize.64.o: localize.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
localize.64.o: localize.c i18n.h transcode.h pwg-private.h ../cups/cups.h ppd-private.h
localize.64.o: localize.c debug.h
localize.64.o: localize.c i18n.h transcode.h ppd-private.h debug.h
mark.64.o: mark.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
mark.64.o: mark.c string.h ../config.h debug.h pwg-private.h ../cups/cups.h
mark.64.o: mark.c string.h ../config.h debug.h pwgmedia.h
md5.64.o: md5.c md5.h string.h ../config.h
md5passwd.64.o: md5passwd.c http-private.h ../config.h http.h versioning.h md5.h
md5passwd.64.o: md5passwd.c ipp-private.h ipp.h string.h
notify.64.o: notify.c globals.h string.h ../config.h http-private.h http.h versioning.h
notify.64.o: notify.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
notify.64.o: notify.c i18n.h transcode.h pwg-private.h ../cups/cups.h
notify.64.o: notify.c i18n.h transcode.h
options.64.o: options.c cups.h ipp.h http.h versioning.h ppd.h array.h file.h language.h
options.64.o: options.c string.h ../config.h debug.h
page.64.o: page.c ppd.h array.h versioning.h file.h string.h ../config.h debug.h
ppd.64.o: ppd.c ppd-private.h cups.h ipp.h http.h versioning.h ppd.h array.h file.h
ppd.64.o: ppd.c language.h pwg-private.h ../cups/cups.h globals.h string.h ../config.h
ppd.64.o: ppd.c http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
pwg-file.64.o: pwg-file.c pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-file.64.o: pwg-file.c http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-file.64.o: pwg-file.c cups.h ppd.h array.h file.h language.h i18n.h transcode.h debug.h
pwg-media.64.o: pwg-media.c pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-media.64.o: pwg-media.c http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-media.64.o: pwg-media.c cups.h ppd.h array.h file.h language.h i18n.h transcode.h
pwg-media.64.o: pwg-media.c debug.h
pwg-ppd.64.o: pwg-ppd.c pwg-private.h ../cups/cups.h globals.h string.h ../config.h
pwg-ppd.64.o: pwg-ppd.c http-private.h http.h versioning.h md5.h ipp-private.h ipp.h
pwg-ppd.64.o: pwg-ppd.c cups.h ppd.h array.h file.h language.h i18n.h transcode.h debug.h
ppd.64.o: ppd.c language.h globals.h string.h ../config.h http-private.h md5.h
ppd.64.o: ppd.c ipp-private.h i18n.h transcode.h debug.h
pwgmedia.64.o: pwgmedia.c pwgmedia.h globals.h string.h ../config.h http-private.h http.h
pwgmedia.64.o: pwgmedia.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
pwgmedia.64.o: pwgmedia.c file.h language.h i18n.h transcode.h debug.h
request.64.o: request.c globals.h string.h ../config.h http-private.h http.h versioning.h
request.64.o: request.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
request.64.o: request.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
request.64.o: request.c i18n.h transcode.h debug.h
sidechannel.64.o: sidechannel.c sidechannel.h versioning.h string.h ../config.h debug.h
snmp.64.o: snmp.c globals.h string.h ../config.h http-private.h http.h versioning.h
snmp.64.o: snmp.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
snmp.64.o: snmp.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
snmp.64.o: snmp.c snmp-private.h
snmp.64.o: snmp.c i18n.h transcode.h debug.h snmp-private.h
snprintf.64.o: snprintf.c string.h ../config.h
string.64.o: string.c array.h versioning.h debug.h string.h ../config.h
tempfile.64.o: tempfile.c globals.h string.h ../config.h http-private.h http.h versioning.h
tempfile.64.o: tempfile.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
tempfile.64.o: tempfile.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
tempfile.64.o: tempfile.c i18n.h transcode.h debug.h
transcode.64.o: transcode.c globals.h string.h ../config.h http-private.h http.h
transcode.64.o: transcode.c versioning.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h
transcode.64.o: transcode.c file.h language.h i18n.h transcode.h pwg-private.h
transcode.64.o: transcode.c ../cups/cups.h debug.h
transcode.64.o: transcode.c file.h language.h i18n.h transcode.h debug.h
usersys.64.o: usersys.c http-private.h ../config.h http.h versioning.h md5.h ipp-private.h
usersys.64.o: usersys.c ipp.h globals.h string.h cups.h ppd.h array.h file.h language.h
usersys.64.o: usersys.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
usersys.64.o: usersys.c i18n.h transcode.h debug.h
util.64.o: util.c globals.h string.h ../config.h http-private.h http.h versioning.h
util.64.o: util.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
util.64.o: util.c i18n.h transcode.h pwg-private.h ../cups/cups.h debug.h
util.64.o: util.c i18n.h transcode.h debug.h
testadmin.64.o: testadmin.c adminutil.h cups.h ipp.h http.h versioning.h ppd.h array.h
testadmin.64.o: testadmin.c file.h language.h string.h ../config.h
testarray.64.o: testarray.c ../cups/string.h ../config.h string.h array.h versioning.h dir.h
@@ -448,6 +391,6 @@ testoptions.64.o: testoptions.c string.h ../config.h cups.h ipp.h http.h versio
testoptions.64.o: testoptions.c array.h file.h language.h
testlang.64.o: testlang.c i18n.h transcode.h language.h array.h versioning.h string.h
testlang.64.o: testlang.c ../config.h
testppd.64.o: testppd.c ../cups/cups.h ../cups/string.h ../config.h string.h
testpwg.64.o: testpwg.c pwg-private.h ../cups/cups.h
testppd.64.o: testppd.c ../cups/string.h ../config.h string.h cups.h ipp.h http.h
testppd.64.o: testppd.c versioning.h ppd.h array.h file.h language.h pwgmedia.h
testsnmp.64.o: testsnmp.c string.h ../config.h snmp-private.h http.h versioning.h
+29 -20
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id$"
#
# API library Makefile for CUPS.
# API library Makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 2007-2010 by Apple Inc.
# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -56,9 +56,7 @@ LIBOBJS = \
options.o \
page.o \
ppd.o \
pwg-file.o \
pwg-media.o \
pwg-ppd.o \
pwgmedia.o \
request.o \
sidechannel.o \
snmp.o \
@@ -85,8 +83,8 @@ OBJS = \
testoptions.o \
testlang.o \
testppd.o \
testpwg.o \
testsnmp.o
testsnmp.o \
php_cups_wrap.o
#
@@ -132,7 +130,6 @@ UNITTARGETS = \
testlang \
testoptions \
testppd \
testpwg \
testsnmp
TARGETS = \
@@ -378,6 +375,30 @@ libcups.a: $(LIBOBJS)
$(RANLIB) $@
#
# CUPS language bindings for various scripting languages...
#
# NOTE: Not currently used or functional - see the scripting/php directory
# for the hand-written bindings...
#
phpcups.so: $(LIBCUPS) php_cups_wrap.o
echo Linking $@...
if test `uname` = Darwin; then \
DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
else \
DSOFLAGS="$(DSOFLAGS)"; \
fi; \
$(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
php_cups_wrap.o: php_cups_wrap.c
echo Compiling $<...
$(CC) $(CFLAGS) `php-config --includes` -c $<
php_cups_wrap.c: cups.h
echo Creating $< using SWIG...
swig -php -o $@ -module cups cups.h
#
# testadmin (dependency on static CUPS library is intentional)
#
@@ -504,18 +525,6 @@ testppd: testppd.o libcups.a test.ppd test2.ppd
./testppd
#
# testpwg (dependency on static CUPS library is intentional)
#
testpwg: testpwg.o libcups.a test.ppd
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o libcups.a \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Running PWG API tests...
./testpwg test.ppd
#
# testsnmp (dependency on static CUPS library is intentional)
#
+46 -21
Ver Arquivo
@@ -4,7 +4,7 @@
* Administration utility API definitions for the Common UNIX Printing
* System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -862,6 +862,25 @@ cupsAdminGetServerSettings(
http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int *num_settings, /* O - Number of settings */
cups_option_t **settings) /* O - Settings */
{
return (_cupsAdminGetServerSettings(http, num_settings, settings));
}
/*
* '_cupsAdminGetServerSettings()' - Get settings from the server.
*
* The returned settings should be freed with cupsFreeOptions() when
* you are done with them.
*
* @since CUPS 1.2@
*/
int /* O - 1 on success, 0 on failure */
_cupsAdminGetServerSettings(
http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int *num_settings, /* O - Number of settings */
cups_option_t **settings) /* O - Settings */
{
int i; /* Looping var */
cups_file_t *cupsd; /* cupsd.conf file */
@@ -1194,6 +1213,22 @@ cupsAdminSetServerSettings(
http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int num_settings, /* I - Number of settings */
cups_option_t *settings) /* I - Settings */
{
return (_cupsAdminSetServerSettings(http, num_settings, settings));
}
/*
* '_cupsAdminSetServerSettings()' - Set settings on the server.
*
* @since CUPS 1.2@
*/
int /* O - 1 on success, 0 on failure */
_cupsAdminSetServerSettings(
http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int num_settings, /* I - Number of settings */
cups_option_t *settings) /* I - Settings */
{
int i; /* Looping var */
http_status_t status; /* GET/PUT status */
@@ -1274,8 +1309,8 @@ cupsAdminSetServerSettings(
* Get current settings...
*/
if (!cupsAdminGetServerSettings(http, &cupsd_num_settings,
&cupsd_settings))
if (!_cupsAdminGetServerSettings(http, &cupsd_num_settings,
&cupsd_settings))
return (0);
if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, cupsd_num_settings,
@@ -1296,9 +1331,6 @@ cupsAdminSetServerSettings(
else
remote_any = 0;
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_any=%d",
remote_any));
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, cupsd_num_settings,
cupsd_settings)) != NULL)
old_remote_printers = atoi(val);
@@ -1463,13 +1495,13 @@ cupsAdminSetServerSettings(
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
{
if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) &&
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
(share_printers >= 0 || remote_admin >= 0))
{
if (!wrote_port_listen)
{
wrote_port_listen = 1;
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
if (share_printers > 0 || remote_admin > 0)
{
cupsFilePuts(temp, "# Allow remote access\n");
cupsFilePrintf(temp, "Port %d\n", server_port);
@@ -1677,8 +1709,7 @@ cupsAdminSetServerSettings(
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
}
else if (in_root_location &&
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
else if (in_root_location && (remote_admin >= 0 || share_printers >= 0))
{
wrote_root_location = 1;
@@ -1689,14 +1720,12 @@ cupsAdminSetServerSettings(
cupsFilePuts(temp, " # Allow remote administration...\n");
else if (share_printers > 0)
cupsFilePuts(temp, " # Allow shared printing...\n");
else if (remote_any > 0)
cupsFilePuts(temp, " # Allow remote access...\n");
else
cupsFilePuts(temp, " # Restrict access to the server...\n");
cupsFilePuts(temp, " Order allow,deny\n");
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
if (remote_admin > 0 || share_printers > 0)
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
}
@@ -1881,10 +1910,9 @@ cupsAdminSetServerSettings(
}
}
if (!wrote_port_listen &&
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
if (!wrote_port_listen && (share_printers >= 0 || remote_admin >= 0))
{
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
if (share_printers > 0 || remote_admin > 0)
{
cupsFilePuts(temp, "# Allow remote access\n");
cupsFilePrintf(temp, "Port %d\n", ippPort());
@@ -1902,8 +1930,7 @@ cupsAdminSetServerSettings(
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
}
if (!wrote_root_location &&
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
if (!wrote_root_location && (remote_admin >= 0 || share_printers >= 0))
{
if (remote_admin > 0 && share_printers > 0)
cupsFilePuts(temp,
@@ -1912,15 +1939,13 @@ cupsAdminSetServerSettings(
cupsFilePuts(temp, "# Allow remote administration...\n");
else if (share_printers > 0)
cupsFilePuts(temp, "# Allow shared printing...\n");
else if (remote_any > 0)
cupsFilePuts(temp, "# Allow remote access...\n");
else
cupsFilePuts(temp, "# Restrict access to the server...\n");
cupsFilePuts(temp, "<Location />\n"
" Order allow,deny\n");
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
if (remote_admin > 0 || share_printers > 0)
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
cupsFilePuts(temp, "</Location>\n");
+6 -2
Ver Arquivo
@@ -1,9 +1,13 @@
/*
* "$Id$"
*
* Administration utility API definitions for CUPS.
* Administration utility API definitions for the Common UNIX Printing
* System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO
* CHANGE AT ANY TIME. USE AT YOUR OWN RISK.
*
* Copyright 2007 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
+5 -6
Ver Arquivo
@@ -1,9 +1,9 @@
<!--
"$Id: api-cups.shtml 9061 2010-03-30 22:07:33Z mike $"
"$Id: api-cups.shtml 7337 2008-02-22 04:44:04Z mike $"
CUPS API introduction for the Common UNIX Printing System (CUPS).
Copyright 2007-2010 by Apple Inc.
Copyright 2007-2008 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -82,13 +82,12 @@ instance will return the default instance for that destination.</p>
</tr>
<tr>
<td>"printer-is-accepting-jobs"</td>
<td>"true" if the destination is accepting new jobs, "false" if
not.</td>
<td>"1" if the destination is accepting new jobs, "0" if not.</td>
</tr>
<tr>
<td>"printer-is-shared"</td>
<td>"true" if the destination is being shared with other computers,
"false" if not.</td>
<td>"1" if the destination is being shared with other computers, "0" if
not.</td>
</tr>
<tr>
<td>"printer-location"</td>
+9 -9
Ver Arquivo
@@ -1,5 +1,5 @@
<!--
"$Id: api-filter.shtml 9120 2010-04-23 18:56:34Z mike $"
"$Id: api-filter.shtml 8718 2009-06-18 17:41:03Z mike $"
Filter and backend programming introduction for the Common UNIX Printing
System (CUPS).
@@ -67,7 +67,7 @@ specify an arbitrary file path to a separator page, template, or other file
used by the filter since that can lead to an unauthorized disclosure of
information. <em>Always</em> treat input as suspect and validate it!</p>
<p>If you are developing a backend that runs as root, make sure to check for
<p>If you are developing a backend that runs as root , make sure to check for
potential buffer overflows, integer under/overflow conditions, and file
accesses since these can lead to privilege escalations. When writing files,
always validate the file path and <em>never</em> allow a user to determine
@@ -88,15 +88,15 @@ Mac OS X, for example, no backend may write to a user's home directory.</p>
<h3><a name="PERMISSIONS">File Permissions</a></h3>
<p>For security reasons, CUPS will only run filters and backends that are owned
by root and do not have world or group write permissions. The recommended
permissions for filters and backends are 0555 - read and execute but no write.
Backends that must run as root should use permissions of 0500 - read and execute
by root, no access for other users. Write permissions can be enabled for the
root user only.</p>
by root and do not have world write permissions. The recommended permissions for
filters and backends are 0555 - read and execute but no write. Backends that
must run as root should use permissions of 0500 - read and execute by root, no
access for other users. Write permissions can be enabled for the root user
only.</p>
<p>To avoid a warning message, the directory containing your filter(s) must also
be owned by root and have world and group write disabled - permissions of 0755
or 0555 are strongly encouraged.</p>
be owned by root and have world write disabled - permissions of 0755 or 0555 are
strongly encouraged.</p>
<h3><a name="TEMPFILES">Temporary Files</a></h3>
+14 -15
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Authentication functions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* This file contains Kerberos support code, copyright 2006 by
@@ -98,6 +98,10 @@ cupsDoAuthentication(
DEBUG_printf(("cupsDoAuthentication(http=%p, method=\"%s\", resource=\"%s\")",
http, method, resource));
DEBUG_printf(("2cupsDoAuthentication: digest_tries=%d, userpass=\"%s\"",
http->digest_tries, http->userpass));
DEBUG_printf(("2cupsDoAuthentication: WWW-Authenticate=\"%s\"",
httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE)));
if (!http)
http = _cupsConnect();
@@ -105,11 +109,6 @@ cupsDoAuthentication(
if (!http || !method || !resource)
return (-1);
DEBUG_printf(("2cupsDoAuthentication: digest_tries=%d, userpass=\"%s\"",
http->digest_tries, http->userpass));
DEBUG_printf(("2cupsDoAuthentication: WWW-Authenticate=\"%s\"",
httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE)));
/*
* Clear the current authentication string...
*/
@@ -182,15 +181,6 @@ cupsDoAuthentication(
else if (http->status == HTTP_UNAUTHORIZED)
http->digest_tries ++;
if (http->status == HTTP_UNAUTHORIZED && http->digest_tries >= 3)
{
DEBUG_printf(("1cupsDoAuthentication: Too many authentication tries (%d)",
http->digest_tries));
http->status = HTTP_AUTHORIZATION_CANCELED;
return (-1);
}
/*
* Got a password; encode it for the server...
*/
@@ -232,6 +222,15 @@ cupsDoAuthentication(
}
# endif /* __APPLE__ */
if (http->status == HTTP_UNAUTHORIZED && http->digest_tries >= 3)
{
DEBUG_printf(("1cupsDoAuthentication: too many Negotiate tries (%d)",
http->digest_tries));
http->status = HTTP_AUTHORIZATION_CANCELED;
return (-1);
}
if (http->gssname == GSS_C_NO_NAME)
{
if ((gss_service_name = getenv("CUPS_GSSSERVICENAME")) == NULL)
-12
Ver Arquivo
@@ -26,14 +26,6 @@
# include "versioning.h"
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Constants...
*/
@@ -65,10 +57,6 @@ extern void cupsBackendReport(const char *device_scheme,
_CUPS_API_1_4;
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_BACKEND_H_ */
/*
+1 -5
Ver Arquivo
@@ -583,13 +583,9 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
* Clear all conflicts...
*/
cupsArraySave(ppd->options);
for (o = ppdFirstOption(ppd); o; o = ppdNextOption(ppd))
o->conflicted = 0;
cupsArrayRestore(ppd->options);
/*
* Test for conflicts...
*/
@@ -645,7 +641,7 @@ ppdInstallableConflict(
DEBUG_printf(("2ppdInstallableConflict(ppd=%p, option=\"%s\", choice=\"%s\")",
ppd, option, choice));
/*
/*
* Range check input...
*/
+4 -6
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* API definitions for CUPS.
* API definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -25,12 +25,10 @@
# include <sys/types.h>
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# define __CUPS_SSIZE_T_DEFINED
# include <stddef.h>
/* Windows does not support the ssize_t type, so map it to off_t... */
typedef off_t ssize_t; /* @private@ */
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
# include "file.h"
# include "ipp.h"
# include "ppd.h"
# include "language.h"
@@ -61,10 +59,10 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 1.0404
# define CUPS_VERSION 1.0402
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 4
# define CUPS_VERSION_PATCH 4
# define CUPS_VERSION_PATCH 2
# define CUPS_BC_FD 3 /* Back-channel file descriptor for select/poll */
# define CUPS_DATE_ANY (time_t)-1
+8 -15
Ver Arquivo
@@ -33,6 +33,7 @@
* server.
* appleCopyLocations() - Copy the location history array.
* appleCopyNetwork() - Get the network ID for the current location.
* appleGetDefault() - Get the default printer for this location.
* appleGetPaperSize() - Get the default paper size.
* appleGetPrinter() - Get a printer from the history array.
* appleSetDefault() - Set the default printer for this location.
@@ -53,7 +54,7 @@
#include "debug.h"
#include "globals.h"
#include "pwg-private.h"
#include "pwgmedia.h"
#include <stdlib.h>
#include <ctype.h>
#include <sys/stat.h>
@@ -138,17 +139,12 @@ cupsAddDest(const char *name, /* I - Destination name */
if (!cupsGetDest(name, instance, num_dests, *dests))
{
if (instance && !cupsGetDest(name, NULL, num_dests, *dests))
if (instance &&
(parent = cupsGetDest(name, NULL, num_dests, *dests)) == NULL)
return (num_dests);
dest = cups_add_dest(name, instance, &num_dests, dests);
/*
* Find the base dest again now the array has been realloc'd.
*/
parent = cupsGetDest(name, NULL, num_dests, *dests);
if (instance && parent && parent->num_options > 0)
{
/*
@@ -553,7 +549,7 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
if (!cups_get_sdests(http, op, name, 0, &dest))
{
if (op == CUPS_GET_DEFAULT || (name && !set_as_default))
if (op == CUPS_GET_DEFAULT)
return (NULL);
/*
@@ -1113,8 +1109,8 @@ static char * /* O - Default paper size */
appleGetPaperSize(char *name, /* I - Paper size name buffer */
int namesize) /* I - Size of buffer */
{
CFStringRef defaultPaperID; /* Default paper ID */
_pwg_media_t *pwgmedia; /* PWG media size */
CFStringRef defaultPaperID; /* Default paper ID */
_cups_pwg_media_t *pwgmedia; /* PWG media size */
defaultPaperID = CFPreferencesCopyAppValue(kDefaultPaperIDKey,
@@ -1124,7 +1120,7 @@ appleGetPaperSize(char *name, /* I - Paper size name buffer */
!CFStringGetCString(defaultPaperID, name, namesize,
kCFStringEncodingUTF8))
name[0] = '\0';
else if ((pwgmedia = _pwgMediaForLegacy(name)) != NULL)
else if ((pwgmedia = _cupsPWGMediaByLegacy(name)) != NULL)
strlcpy(name, pwgmedia->pwg, namesize);
if (defaultPaperID)
@@ -1292,9 +1288,6 @@ appleUseLastPrinter(void)
CFPropertyListRef uselast; /* Use last printer preference value */
if (getenv("CUPS_DISABLE_APPLE_DEFAULT"))
return (0);
if ((uselast = CFPreferencesCopyAppValue(kUseLastPrinterAsCurrentPrinterKey,
kPMPrintingPreferences)) != NULL)
{
-1
Ver Arquivo
@@ -772,7 +772,6 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
if (section == PPD_ORDER_JCL)
{
if (!strcasecmp(choices[i]->choice, "Custom") &&
choices[i]->code &&
(coption = ppdFindCustomOption(ppd, choices[i]->option->keyword))
!= NULL)
{
+3 -109
Ver Arquivo
@@ -8,7 +8,7 @@
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -59,8 +59,6 @@
*/
#include "file-private.h"
#include <sys/stat.h>
#include <sys/types.h>
/*
@@ -71,7 +69,6 @@
static ssize_t cups_compress(cups_file_t *fp, const char *buf, size_t bytes);
#endif /* HAVE_LIBZ */
static ssize_t cups_fill(cups_file_t *fp);
static int cups_open(const char *filename, int mode);
static ssize_t cups_read(cups_file_t *fp, char *buf, size_t bytes);
static ssize_t cups_write(cups_file_t *fp, const char *buf, size_t bytes);
@@ -830,8 +827,7 @@ cupsFileOpen(const char *filename, /* I - Name of file */
switch (*mode)
{
case 'a' : /* Append file */
fd = cups_open(filename,
O_RDWR | O_CREAT | O_APPEND | O_LARGEFILE | O_BINARY);
fd = open(filename, O_RDWR | O_CREAT | O_APPEND | O_LARGEFILE | O_BINARY, 0666);
break;
case 'r' : /* Read file */
@@ -839,21 +835,7 @@ cupsFileOpen(const char *filename, /* I - Name of file */
break;
case 'w' : /* Write file */
fd = cups_open(filename, O_WRONLY | O_LARGEFILE | O_BINARY);
if (fd < 0 && errno == ENOENT)
{
fd = cups_open(filename,
O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE | O_BINARY);
if (fd < 0 && errno == EEXIST)
fd = cups_open(filename, O_WRONLY | O_LARGEFILE | O_BINARY);
}
if (fd >= 0)
#ifdef WIN32
_chsize(fd, 0);
#else
ftruncate(fd, 0);
#endif /* WIN32 */
fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT | O_LARGEFILE | O_BINARY, 0666);
break;
case 's' : /* Read/write socket */
@@ -2226,94 +2208,6 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
}
/*
* 'cups_open()' - Safely open a file for writing.
*
* We don't allow appending to directories or files that are hard-linked or
* symlinked.
*/
static int /* O - File descriptor or -1 otherwise */
cups_open(const char *filename, /* I - Filename */
int mode) /* I - Open mode */
{
int fd; /* File descriptor */
struct stat fileinfo; /* File information */
#ifndef WIN32
struct stat linkinfo; /* Link information */
#endif /* !WIN32 */
/*
* Open the file...
*/
if ((fd = open(filename, mode, 0666)) < 0)
return (-1);
/*
* Then verify that the file descriptor doesn't point to a directory or hard-
* linked file.
*/
if (fstat(fd, &fileinfo))
{
close(fd);
return (-1);
}
if (fileinfo.st_nlink != 1)
{
close(fd);
errno = EPERM;
return (-1);
}
#ifdef WIN32
if (fileinfo.st_mode & _S_IFDIR)
#else
if (S_ISDIR(fileinfo.st_mode))
#endif /* WIN32 */
{
close(fd);
errno = EISDIR;
return (-1);
}
#ifndef WIN32
/*
* Then use lstat to determine whether the filename is a symlink...
*/
if (lstat(filename, &linkinfo))
{
close(fd);
return (-1);
}
if (S_ISLNK(linkinfo.st_mode) ||
fileinfo.st_dev != linkinfo.st_dev ||
fileinfo.st_ino != linkinfo.st_ino ||
#ifdef HAVE_ST_GEN
fileinfo.st_gen != linkinfo.st_gen ||
#endif /* HAVE_ST_GEN */
fileinfo.st_nlink != linkinfo.st_nlink ||
fileinfo.st_mode != linkinfo.st_mode)
{
/*
* Yes, don't allow!
*/
close(fd);
errno = EPERM;
return (-1);
}
#endif /* !WIN32 */
return (fd);
}
/*
* 'cups_read()' - Read from a file descriptor.
*/
-1
Ver Arquivo
@@ -27,7 +27,6 @@
*/
# include "versioning.h"
# include <stddef.h>
# include <sys/types.h>
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# define __CUPS_SSIZE_T_DEFINED
+2 -2
Ver Arquivo
@@ -3,7 +3,7 @@
*
* cupsGetDevices implementation for the Common UNIX Printing System (CUPS).
*
* Copyright 2008-2010 by Apple Inc.
* Copyright 2008-2009 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -258,7 +258,7 @@ cupsGetDevices(
httpBlocking(http, blocking);
httpFlush(http);
if (status == HTTP_ERROR)
if (status == IPP_ERROR)
_cupsSetError(IPP_ERROR, NULL, 0);
else
{
+10 -38
Ver Arquivo
@@ -38,46 +38,20 @@
static void
cups_env_init(_cups_globals_t *g) /* I - Global data */
{
#ifndef WIN32
# ifdef HAVE_GETEUID
if ((geteuid() != getuid() && getuid()) || getegid() != getgid())
# else
if (!getuid())
# endif /* HAVE_GETEUID */
{
/*
* When running setuid/setgid, don't allow environment variables to override
* the directories...
*/
if ((g->cups_datadir = getenv("CUPS_DATADIR")) == NULL)
g->cups_datadir = CUPS_DATADIR;
g->cups_datadir = CUPS_DATADIR;
g->cups_serverbin = CUPS_SERVERBIN;
if ((g->cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL)
g->cups_serverbin = CUPS_SERVERBIN;
if ((g->cups_serverroot = getenv("CUPS_SERVERROOT")) == NULL)
g->cups_serverroot = CUPS_SERVERROOT;
g->cups_statedir = CUPS_STATEDIR;
g->localedir = CUPS_LOCALEDIR;
}
else
#endif /* !WIN32 */
{
/*
* Allow directories to be overridden by environment variables.
*/
if ((g->cups_datadir = getenv("CUPS_DATADIR")) == NULL)
g->cups_datadir = CUPS_DATADIR;
if ((g->cups_statedir = getenv("CUPS_STATEDIR")) == NULL)
g->cups_statedir = CUPS_STATEDIR;
if ((g->cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL)
g->cups_serverbin = CUPS_SERVERBIN;
if ((g->cups_serverroot = getenv("CUPS_SERVERROOT")) == NULL)
g->cups_serverroot = CUPS_SERVERROOT;
if ((g->cups_statedir = getenv("CUPS_STATEDIR")) == NULL)
g->cups_statedir = CUPS_STATEDIR;
if ((g->localedir = getenv("LOCALEDIR")) == NULL)
g->localedir = CUPS_LOCALEDIR;
}
if ((g->localedir = getenv("LOCALEDIR")) == NULL)
g->localedir = CUPS_LOCALEDIR;
}
@@ -185,9 +159,7 @@ globals_destructor(void *value) /* I - Data to free */
if (cg->last_status_message)
_cupsStrFree(cg->last_status_message);
# ifndef CUPS_LITE
cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings);
# endif /* !CUPS_LITE */
for (buffer = cg->ipp_buffers; buffer; buffer = next)
{
+3 -7
Ver Arquivo
@@ -26,7 +26,6 @@
# include "http-private.h"
# include "cups.h"
# include "i18n.h"
# include "pwg-private.h"
# ifdef HAVE_PTHREAD_H
# include <pthread.h>
@@ -104,12 +103,9 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
int ppd_line; /* Current line number */
ppd_conform_t ppd_conform; /* Level of conformance required */
/* pwg-media.c */
cups_array_t *leg_size_lut, /* Lookup table for legacy names */
*ppd_size_lut, /* Lookup table for PPD names */
*pwg_size_lut; /* Lookup table for PWG names */
_pwg_media_t pwg_media; /* PWG media data for custom size */
char pwg_name[65]; /* PWG media name for custom size */
/* pwgmedia.c */
cups_array_t *pwg_size_lut, /* Lookup table for PWG names */
*leg_size_lut; /* Lookup table for legacy names */
/* snmp.c */
char snmp_community[255];
-1
Ver Arquivo
@@ -98,7 +98,6 @@ extern BIO_METHOD *_httpBIOMethods(void);
* The GNU TLS library is more of a "bare metal" SSL/TLS library...
*/
# include <gnutls/gnutls.h>
# include <gcrypt.h>
typedef struct
{
+43 -180
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* HTTP routines for CUPS.
* HTTP routines for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
@@ -25,7 +25,7 @@
* server.
* httpClearCookie() - Clear the cookie value(s).
* httpClearFields() - Clear HTTP request fields.
* httpClose() - Close an HTTP connection.
* httpClose() - Close an HTTP connection...
* httpConnect() - Connect to a HTTP server.
* httpConnectEncrypt() - Connect to a HTTP server using encryption.
* _httpCreate() - Create an unconnected HTTP connection.
@@ -62,7 +62,7 @@
* _httpReadGNUTLS() - Read function for the GNU TLS library.
* httpReconnect() - Reconnect to a HTTP server.
* httpSetAuthString() - Set the current authorization string.
* httpSetCookie() - Set the cookie value(s).
* httpSetCookie() - Set the cookie value(s)...
* httpSetExpect() - Set the Expect: header in a request.
* httpSetField() - Set the value of an HTTP header.
* httpSetLength() - Set the content-length and content-encoding.
@@ -83,12 +83,10 @@
* http_debug_hex() - Do a hex dump of a buffer.
* http_field() - Return the field index for a field name.
* http_read_ssl() - Read from a SSL/TLS connection.
* http_locking_cb() - Lock/unlock a thread's mutex.
* http_send() - Send a request with all fields and the trailing
* blank line.
* http_setup_ssl() - Set up SSL/TLS support on a connection.
* http_shutdown_ssl() - Shut down SSL/TLS on a connection.
* http_threadid_cb() - Return the current thread ID.
* http_upgrade() - Force upgrade to TLS encryption.
* http_write() - Write a buffer to a HTTP connection.
* http_write_chunk() - Write a chunked buffer.
@@ -146,19 +144,6 @@ static int http_setup_ssl(http_t *http);
static void http_shutdown_ssl(http_t *http);
static int http_upgrade(http_t *http);
static int http_write_ssl(http_t *http, const char *buf, int len);
# ifdef HAVE_GNUTLS
# ifdef HAVE_PTHREAD_H
GCRY_THREAD_OPTION_PTHREAD_IMPL;
# endif /* HAVE_PTHREAD_H */
# elif defined(HAVE_LIBSSL) && defined(HAVE_PTHREAD_H)
static pthread_mutex_t *http_locks; /* OpenSSL lock mutexes */
static void http_locking_cb(int mode, int type, const char *file,
int line);
static unsigned long http_threadid_cb(void);
# endif /* HAVE_GNUTLS */
#endif /* HAVE_SSL */
@@ -327,7 +312,7 @@ httpClearFields(http_t *http) /* I - Connection to server */
/*
* 'httpClose()' - Close an HTTP connection.
* 'httpClose()' - Close an HTTP connection...
*/
void
@@ -575,9 +560,8 @@ httpError(http_t *http) /* I - Connection to server */
void
httpFlush(http_t *http) /* I - Connection to server */
{
char buffer[8192]; /* Junk buffer */
int blocking; /* To block or not to block */
http_state_t oldstate; /* Old state */
char buffer[8192]; /* Junk buffer */
int blocking; /* To block or not to block */
DEBUG_printf(("httpFlush(http=%p), state=%s", http,
@@ -594,7 +578,6 @@ httpFlush(http_t *http) /* I - Connection to server */
* Read any data we can...
*/
oldstate = http->state;
while (httpRead2(http, buffer, sizeof(buffer)) > 0);
/*
@@ -604,7 +587,7 @@ httpFlush(http_t *http) /* I - Connection to server */
http->blocking = blocking;
if (http->state == oldstate && http->state != HTTP_WAITING && http->fd >= 0)
if (http->state != HTTP_WAITING && http->fd >= 0)
{
/*
* Didn't get the data back, so close the current connection.
@@ -738,7 +721,7 @@ httpGetField(http_t *http, /* I - Connection to server */
{
if (!http || field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
return (NULL);
else if (field == HTTP_FIELD_AUTHORIZATION &&
else if (field == HTTP_FIELD_AUTHORIZATION &&
http->field_authorization)
{
/*
@@ -1154,7 +1137,7 @@ httpGets(char *line, /* I - Line to read into */
http->activity = time(NULL);
*lineptr = '\0';
DEBUG_printf(("3httpGets: Returning \"%s\"", line));
return (line);
@@ -1188,22 +1171,21 @@ httpHead(http_t *http, /* I - Connection to server */
void
httpInitialize(void)
{
static int initialized = 0; /* Have we been called before? */
#ifdef WIN32
WSADATA winsockdata; /* WinSock data */
#endif /* WIN32 */
#ifdef HAVE_LIBSSL
int i; /* Looping var */
unsigned char data[1024]; /* Seed data */
# ifndef WIN32
struct timeval curtime; /* Current time in microseconds */
# endif /* !WIN32 */
int i; /* Looping var */
unsigned char data[1024]; /* Seed data */
#endif /* HAVE_LIBSSL */
if (initialized)
return;
#ifdef WIN32
WSAStartup(MAKEWORD(2,2), &winsockdata);
WSADATA winsockdata; /* WinSock data */
static int initialized = 0; /* Has WinSock been initialized? */
if (!initialized)
WSAStartup(MAKEWORD(1,1), &winsockdata);
#elif !defined(SO_NOSIGPIPE)
/*
* Ignore SIGPIPE signals...
@@ -1211,7 +1193,6 @@ httpInitialize(void)
# ifdef HAVE_SIGSET
sigset(SIGPIPE, SIG_IGN);
# elif defined(HAVE_SIGACTION)
struct sigaction action; /* POSIX sigaction data */
@@ -1219,63 +1200,35 @@ httpInitialize(void)
memset(&action, 0, sizeof(action));
action.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &action, NULL);
# else
signal(SIGPIPE, SIG_IGN);
# endif /* !SO_NOSIGPIPE */
#endif /* WIN32 */
#ifdef HAVE_GNUTLS
/*
* Make sure we handle threading properly...
*/
# ifdef HAVE_PTHREAD_H
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
# endif /* HAVE_PTHREAD_H */
/*
* Initialize GNU TLS...
*/
gnutls_global_init();
#endif /* HAVE_GNUTLS */
#elif defined(HAVE_LIBSSL)
/*
* Initialize OpenSSL...
*/
#ifdef HAVE_LIBSSL
SSL_load_error_strings();
SSL_library_init();
/*
* Set the threading callbacks...
*/
# ifdef HAVE_PTHREAD_H
http_locks = calloc(CRYPTO_num_locks(), sizeof(pthread_mutex_t));
for (i = 0; i < CRYPTO_num_locks(); i ++)
pthread_mutex_init(http_locks + i, NULL);
CRYPTO_set_id_callback(http_threadid_cb);
CRYPTO_set_locking_callback(http_locking_cb);
# endif /* HAVE_PTHREAD_H */
/*
* Using the current time is a dubious random seed, but on some systems
* it is the best we can do (on others, this seed isn't even used...)
*/
CUPS_SRAND(time(NULL));
# ifdef WIN32
# else
gettimeofday(&curtime, NULL);
srand(curtime.tv_sec + curtime.tv_usec);
# endif /* WIN32 */
for (i = 0; i < sizeof(data); i ++)
data[i] = CUPS_RAND();
data[i] = rand();
RAND_seed(data, sizeof(data));
#endif /* HAVE_GNUTLS */
initialized = 1;
#endif /* HAVE_LIBSSL */
}
@@ -1863,7 +1816,7 @@ httpSetAuthString(http_t *http, /* I - Connection to server */
/*
* 'httpSetCookie()' - Set the cookie value(s).
* 'httpSetCookie()' - Set the cookie value(s)...
*
* @since CUPS 1.1.19/Mac OS X 10.3@
*/
@@ -2330,7 +2283,7 @@ httpWait(http_t *http, /* I - Connection to server */
*
* @deprecated@
*/
int /* O - Number of bytes written */
httpWrite(http_t *http, /* I - Connection to server */
const char *buffer, /* I - Buffer for data */
@@ -2345,7 +2298,7 @@ httpWrite(http_t *http, /* I - Connection to server */
*
* @since CUPS 1.2/Mac OS X 10.5@
*/
ssize_t /* O - Number of bytes written */
httpWrite2(http_t *http, /* I - Connection to server */
const char *buffer, /* I - Buffer for data */
@@ -2503,7 +2456,7 @@ _httpWriteCDSA(
else
{
*dataLength = 0;
if (errno == EAGAIN)
result = errSSLWouldBlock;
else
@@ -2564,7 +2517,7 @@ http_bio_ctrl(BIO *h, /* I - BIO data */
}
else
return (0);
case BIO_CTRL_DUP :
case BIO_CTRL_FLUSH :
return (1);
@@ -2766,36 +2719,7 @@ http_read_ssl(http_t *http, /* I - Connection to server */
return (SSL_read((SSL *)(http->tls), buf, len));
# elif defined(HAVE_GNUTLS)
ssize_t result; /* Return value */
result = gnutls_record_recv(((http_tls_t *)(http->tls))->session, buf, len);
if (result < 0 && !errno)
{
/*
* Convert GNU TLS error to errno value...
*/
switch (result)
{
case GNUTLS_E_INTERRUPTED :
errno = EINTR;
break;
case GNUTLS_E_AGAIN :
errno = EAGAIN;
break;
default :
errno = EPIPE;
break;
}
result = -1;
}
return ((int)result);
return (gnutls_record_recv(((http_tls_t *)(http->tls))->session, buf, len));
# elif defined(HAVE_CDSASSL)
int result; /* Return value */
@@ -2834,25 +2758,6 @@ http_read_ssl(http_t *http, /* I - Connection to server */
#endif /* HAVE_SSL */
#if defined(HAVE_LIBSSL) && defined(HAVE_PTHREAD_H)
/*
* 'http_locking_cb()' - Lock/unlock a thread's mutex.
*/
static void
http_locking_cb(int mode, /* I - Lock mode */
int type, /* I - Lock type */
const char *file, /* I - Source file */
int line) /* I - Line number */
{
if (mode & CRYPTO_LOCK)
pthread_mutex_lock(http_locks + type);
else
pthread_mutex_unlock(http_locks + type);
}
#endif /* HAVE_LIBSSL && HAVE_PTHREAD_H */
/*
* 'http_send()' - Send a request with all fields and the trailing blank line.
*/
@@ -2952,7 +2857,7 @@ http_send(http_t *http, /* I - Connection to server */
DEBUG_printf(("9http_send: %s: %s", http_fields[i],
httpGetField(http, i)));
if (httpPrintf(http, "%s: %s\r\n", http_fields[i],
if (httpPrintf(http, "%s: %s\r\n", http_fields[i],
httpGetField(http, i)) < 1)
{
http->status = HTTP_ERROR;
@@ -2991,15 +2896,15 @@ http_send(http_t *http, /* I - Connection to server */
* The Kerberos and AuthRef authentication strings can only be used once...
*/
if (http->field_authorization && http->authstring &&
(!strncmp(http->authstring, "Negotiate", 9) ||
if (http->field_authorization && http->authstring &&
(!strncmp(http->authstring, "Negotiate", 9) ||
!strncmp(http->authstring, "AuthRef", 7)))
{
http->_authstring[0] = '\0';
if (http->authstring != http->_authstring)
free(http->authstring);
http->authstring = http->_authstring;
}
@@ -3224,19 +3129,6 @@ http_shutdown_ssl(http_t *http) /* I - Connection to server */
#endif /* HAVE_SSL */
#if defined(HAVE_LIBSSL) && defined(HAVE_PTHREAD_H)
/*
* 'http_threadid_cb()' - Return the current thread ID.
*/
static unsigned long /* O - Thread ID */
http_threadid_cb(void)
{
return ((unsigned long)pthread_self());
}
#endif /* HAVE_LIBSSL && HAVE_PTHREAD_H */
#ifdef HAVE_SSL
/*
* 'http_upgrade()' - Force upgrade to TLS encryption.
@@ -3328,7 +3220,7 @@ http_upgrade(http_t *http) /* I - Connection to server */
/*
* 'http_write()' - Write a buffer to a HTTP connection.
*/
static int /* O - Number of bytes written */
http_write(http_t *http, /* I - Connection to server */
const char *buffer, /* I - Buffer for data */
@@ -3443,36 +3335,7 @@ http_write_ssl(http_t *http, /* I - Connection to server */
return (SSL_write((SSL *)(http->tls), buf, len));
# elif defined(HAVE_GNUTLS)
ssize_t result; /* Return value */
result = gnutls_record_send(((http_tls_t *)(http->tls))->session, buf, len);
if (result < 0 && !errno)
{
/*
* Convert GNU TLS error to errno value...
*/
switch (result)
{
case GNUTLS_E_INTERRUPTED :
errno = EINTR;
break;
case GNUTLS_E_AGAIN :
errno = EAGAIN;
break;
default :
errno = EPIPE;
break;
}
result = -1;
}
return ((int)result);
return (gnutls_record_send(((http_tls_t *)(http->tls))->session, buf, len));
# elif defined(HAVE_CDSASSL)
int result; /* Return value */
OSStatus error; /* Error info */
@@ -3495,11 +3358,11 @@ http_write_ssl(http_t *http, /* I - Connection to server */
else
{
result = -1;
errno = EINTR;
errno = EINTR;
}
break;
default :
errno = EPIPE;
errno = EPIPE;
result = -1;
break;
}
+1 -1
Ver Arquivo
@@ -250,7 +250,7 @@ typedef enum http_status_e /**** HTTP status codes ****/
HTTP_GATEWAY_TIMEOUT, /* Gateway connection timed out */
HTTP_NOT_SUPPORTED, /* HTTP version not supported */
HTTP_AUTHORIZATION_CANCELED = 1000 /* User canceled authorization */
HTTP_AUTHORIZATION_CANCELED = 1000 /* User cancelled authorization */
} http_status_t;
+35 -81
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* "$Id$"
*
* Internet Printing Protocol functions for CUPS.
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -185,8 +186,6 @@ ippAddCollection(ipp_t *ipp, /* I - IPP message */
attr->value_tag = IPP_TAG_BEGIN_COLLECTION;
attr->values[0].collection = value;
value->use ++;
return (attr);
}
@@ -225,15 +224,10 @@ ippAddCollections(
attr->value_tag = IPP_TAG_BEGIN_COLLECTION;
if (values != NULL)
{
for (i = 0, value = attr->values;
i < num_values;
i ++, value ++)
{
value->collection = (ipp_t *)values[i];
value->collection->use ++;
}
}
return (attr);
}
@@ -431,8 +425,7 @@ ippAddString(ipp_t *ipp, /* I - IPP message */
value = "en";
/*
* Convert language and charset values to lowercase and change _ to - as
* needed...
* Convert language values to lowercase and change _ to - as needed...
*/
if ((type == IPP_TAG_LANGUAGE || type == IPP_TAG_CHARSET) && value)
@@ -480,8 +473,6 @@ ippAddStrings(
int i; /* Looping var */
ipp_attribute_t *attr; /* New attribute */
ipp_value_t *value; /* Current value */
char buffer[1024], /* Language/charset value buffer */
*bufptr; /* Pointer into buffer */
DEBUG_printf(("ippAddStrings(ipp=%p, group=%02x(%s), type=%02x(%s), "
@@ -515,36 +506,16 @@ ippAddStrings(
if (values != NULL)
{
if ((int)type & IPP_TAG_COPY)
value->string.text = (char *)values[i];
else if (type == IPP_TAG_LANGUAGE && !strcasecmp(values[i], "C"))
{
/*
* Force language to be English for the POSIX locale...
*/
/*
* Force language to be English for the POSIX locale...
*/
if (type == IPP_TAG_LANGUAGE && !strcasecmp(values[i], "C"))
value->string.text = ((int)type & IPP_TAG_COPY) ? "en" :
_cupsStrAlloc("en");
}
else if (type == IPP_TAG_LANGUAGE || type == IPP_TAG_CHARSET)
{
/*
* Convert language values to lowercase and change _ to - as needed...
*/
strlcpy(buffer, values[i], sizeof(buffer));
for (bufptr = buffer; *bufptr; bufptr ++)
if (*bufptr == '_')
*bufptr = '-';
else
*bufptr = tolower(*bufptr & 255);
value->string.text = _cupsStrAlloc(buffer);
}
else
value->string.text = _cupsStrAlloc(values[i]);
value->string.text = ((int)type & IPP_TAG_COPY) ? (char *)values[i] :
_cupsStrAlloc(values[i]);
}
}
@@ -805,10 +776,6 @@ ippDelete(ipp_t *ipp) /* I - IPP message */
if (!ipp)
return;
ipp->use --;
if (ipp->use > 0)
return;
for (attr = ipp->attrs; attr != NULL; attr = next)
{
next = attr->next;
@@ -983,7 +950,6 @@ ippNew(void)
temp->request.any.version[0] = 1;
temp->request.any.version[1] = 1;
temp->use = 1;
}
DEBUG_printf(("1ippNew: Returning %p", temp));
@@ -1905,12 +1871,6 @@ ippWriteIO(void *dst, /* I - Destination */
*bufptr++ = ipp->request.any.request_id >> 8;
*bufptr++ = ipp->request.any.request_id;
DEBUG_printf(("2ippWriteIO: version=%d.%d", buffer[0], buffer[1]));
DEBUG_printf(("2ippWriteIO: op_status=%04x",
ipp->request.any.op_status));
DEBUG_printf(("2ippWriteIO: request_id=%d",
ipp->request.any.request_id));
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("1ippWriteIO: Could not write IPP header...");
@@ -1928,7 +1888,11 @@ ippWriteIO(void *dst, /* I - Destination */
ipp->current = ipp->attrs;
ipp->curtag = IPP_TAG_ZERO;
DEBUG_printf(("1ippWriteIO: ipp->current=%p", ipp->current));
DEBUG_printf(("2ippWriteIO: version=%d.%d", buffer[0], buffer[1]));
DEBUG_printf(("2ippWriteIO: op_status=%04x",
ipp->request.any.op_status));
DEBUG_printf(("2ippWriteIO: request_id=%d",
ipp->request.any.request_id));
/*
* If blocking is disabled, stop here...
@@ -1949,30 +1913,23 @@ ippWriteIO(void *dst, /* I - Destination */
ipp->current = ipp->current->next;
if (!parent)
if (ipp->curtag != attr->group_tag && parent == NULL)
{
if (ipp->curtag != attr->group_tag)
{
/*
* Send a group tag byte...
*/
/*
* Send a group tag byte...
*/
ipp->curtag = attr->group_tag;
ipp->curtag = attr->group_tag;
if (attr->group_tag == IPP_TAG_ZERO)
continue;
DEBUG_printf(("2ippWriteIO: wrote group tag=%x(%s)",
attr->group_tag, ippTagString(attr->group_tag)));
*bufptr++ = attr->group_tag;
}
else if (attr->group_tag == IPP_TAG_ZERO)
if (attr->group_tag == IPP_TAG_ZERO)
continue;
}
DEBUG_printf(("1ippWriteIO: %s (%s%s)", attr->name,
attr->num_values > 1 ? "1setOf " : "",
ippTagString(attr->value_tag)));
DEBUG_printf(("2ippWriteIO: wrote group tag=%x(%s)",
attr->group_tag, ippTagString(attr->group_tag)));
*bufptr++ = attr->group_tag;
}
else if (attr->group_tag == IPP_TAG_ZERO)
continue;
/*
* Write the attribute tag and name. The current implementation
@@ -2645,19 +2602,16 @@ ippWriteIO(void *dst, /* I - Destination */
* Write the data out...
*/
if (bufptr > buffer)
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("1ippWriteIO: Could not write IPP attribute...");
ipp_buffer_release(buffer);
return (IPP_ERROR);
}
DEBUG_printf(("2ippWriteIO: wrote %d bytes",
(int)(bufptr - buffer)));
DEBUG_puts("1ippWriteIO: Could not write IPP attribute...");
ipp_buffer_release(buffer);
return (IPP_ERROR);
}
DEBUG_printf(("2ippWriteIO: wrote %d bytes",
(int)(bufptr - buffer)));
/*
* If blocking is disabled, stop here...
*/
@@ -3025,7 +2979,7 @@ ipp_read_http(http_t *http, /* I - Client connection */
int tbytes, /* Total bytes read */
bytes; /* Bytes read this pass */
char len[32]; /* Length string */
DEBUG_printf(("7ipp_read_http(http=%p, buffer=%p, length=%d)",
http, buffer, (int)length));
+13 -15
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* "$Id$"
*
* Internet Printing Protocol definitions for CUPS.
* Internet Printing Protocol definitions for the Common UNIX Printing
* System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -63,7 +64,7 @@ extern "C" {
* Types and structures...
*/
typedef enum ipp_tag_e /**** Format tags for attributes ****/
typedef enum ipp_tag_e /**** Format tags for attributes... ****/
{
IPP_TAG_ZERO = 0x00, /* Zero tag - used for separators */
IPP_TAG_OPERATION, /* Operation group */
@@ -104,13 +105,13 @@ typedef enum ipp_tag_e /**** Format tags for attributes ****/
IPP_TAG_COPY = -0x7fffffff-1 /* Bitflag for copied attribute values */
} ipp_tag_t;
typedef enum ipp_res_e /**** Resolution units ****/
typedef enum ipp_res_e /**** Resolution units... ****/
{
IPP_RES_PER_INCH = 3, /* Pixels per inch */
IPP_RES_PER_CM /* Pixels per centimeter */
} ipp_res_t;
typedef enum ipp_finish_e /**** Finishings ****/
typedef enum ipp_finish_e /**** Finishings... ****/
{
IPP_FINISHINGS_NONE = 3, /* No finishing */
IPP_FINISHINGS_STAPLE, /* Staple (any location) */
@@ -142,7 +143,7 @@ typedef enum ipp_finish_e /**** Finishings ****/
IPP_FINISHINGS_BIND_BOTTOM /* Bind on bottom */
} ipp_finish_t;
typedef enum ipp_orient_e /**** Orientation values ****/
typedef enum ipp_orient_e /**** Orientation... ****/
{
IPP_PORTRAIT = 3, /* No rotation */
IPP_LANDSCAPE, /* 90 degrees counter-clockwise */
@@ -150,14 +151,14 @@ typedef enum ipp_orient_e /**** Orientation values ****/
IPP_REVERSE_PORTRAIT /* 180 degrees */
} ipp_orient_t;
typedef enum ipp_quality_e /**** Qualities ****/
typedef enum ipp_quality_e /**** Qualities... ****/
{
IPP_QUALITY_DRAFT = 3, /* Draft quality */
IPP_QUALITY_NORMAL, /* Normal quality */
IPP_QUALITY_HIGH /* High quality */
} ipp_quality_t;
typedef enum ipp_jstate_e /**** Job states ****/
typedef enum ipp_jstate_e /**** Job States.... */
{
IPP_JOB_PENDING = 3, /* Job is waiting to be printed */
IPP_JOB_HELD, /* Job is held for printing */
@@ -169,14 +170,14 @@ typedef enum ipp_jstate_e /**** Job states ****/
} ipp_jstate_t;
#define IPP_JOB_CANCELLED IPP_JOB_CANCELED
typedef enum ipp_pstate_e /**** Printer states ****/
typedef enum ipp_pstate_e /**** Printer States.... */
{
IPP_PRINTER_IDLE = 3, /* Printer is idle */
IPP_PRINTER_PROCESSING, /* Printer is working */
IPP_PRINTER_STOPPED /* Printer is stopped */
} ipp_pstate_t;
typedef enum ipp_state_e /**** IPP states ****/
typedef enum ipp_state_e /**** IPP states... ****/
{
IPP_ERROR = -1, /* An error occurred */
IPP_IDLE, /* Nothing is happening/request completed */
@@ -185,7 +186,7 @@ typedef enum ipp_state_e /**** IPP states ****/
IPP_DATA /* IPP request data needs to be sent/received */
} ipp_state_t;
typedef enum ipp_op_e /**** IPP operations ****/
typedef enum ipp_op_e /**** IPP operations... ****/
{
IPP_PRINT_JOB = 0x0002, /* Print a single file */
IPP_PRINT_URI, /* Print a single URL @private@ */
@@ -254,7 +255,7 @@ typedef enum ipp_op_e /**** IPP operations ****/
#define CUPS_ADD_PRINTER CUPS_ADD_MODIFY_PRINTER
#define CUPS_ADD_CLASS CUPS_ADD_MODIFY_CLASS
typedef enum ipp_status_e /**** IPP status codes ****/
typedef enum ipp_status_e /**** IPP status codes... ****/
{
IPP_OK = 0x0000, /* successful-ok */
IPP_OK_SUBST, /* successful-ok-ignored-or-substituted-attributes */
@@ -404,9 +405,6 @@ struct ipp_s /**** IPP Request/Response/Notification ****/
/**** New in CUPS 1.2 ****/
ipp_attribute_t *prev; /* Previous attribute (for read) @since CUPS 1.2/Mac OS X 10.5@ */
/**** New in CUPS 1.5 ****/
int use; /* Use count */
};
+5 -19
Ver Arquivo
@@ -2,6 +2,8 @@ __cups_debug_fd
__cups_debug_printf
__cups_debug_puts
__cups_strcpy
__cupsAdminGetServerSettings
__cupsAdminSetServerSettings
__cupsAppleLanguage
__cupsCharmapFlush
__cupsCharmapFree
@@ -19,6 +21,9 @@ __cupsMD5Init
__cupsMessageFree
__cupsMessageLoad
__cupsMessageLookup
__cupsPWGMediaByName
__cupsPWGMediaByLegacy
__cupsPWGMediaBySize
__cupsSetError
__cupsSetLocale
__cupsSNMPClose
@@ -57,25 +62,6 @@ __ppdHashName
__ppdLocalizedAttr
__ppdNormalizeMakeAndModel
__ppdParseOptions
__pwgCreateWithFile
__pwgDestroy
__pwgWriteFile
__pwgGenerateSize
__pwgInitSize
__pwgMediaForLegacy
__pwgMediaForPPD
__pwgMediaForPWG
__pwgMediaForSize
__pwgCreateWithPPD
__pwgGetInputSlot
__pwgGetMediaType
__pwgGetPageSize
__pwgGetSize
__pwgGetSource
__pwgGetType
__pwgInputSlotForSource
__pwgMediaTypeForType
__pwgPageSizeForMedia
_cupsAddDest
_cupsAddOption
_cupsAdminCreateWindowsPPD
+2
Ver Arquivo
@@ -1,6 +1,8 @@
LIBRARY libcups2
VERSION 2.7
EXPORTS
_cupsAdminGetServerSettings
_cupsAdminSetServerSettings
_cupsCharmapFlush
_cupsCharmapFree
_cupsCharmapGet
+6 -24
Ver Arquivo
@@ -1,11 +1,12 @@
_cups_debug_fd
_cupsAdminGetServerSettings
_cupsAdminSetServerSettings
_cupsCharmapFlush
_cupsCharmapFree
_cupsCharmapGet
_cupsEncodingName
_cupsGetPassword
_cupsGlobals
_cupsLangPrintError
_cupsLangPrintf
_cupsLangPuts
_cupsLangString
@@ -15,6 +16,9 @@ _cupsMD5Init
_cupsMessageFree
_cupsMessageLoad
_cupsMessageLookup
_cupsPWGMediaByName
_cupsPWGMediaByLegacy
_cupsPWGMediaBySize
_cupsSetError
_cupsSetLocale
_cupsSNMPClose
@@ -46,7 +50,6 @@ _httpBIOMethods
_httpCreate
_httpEncodeURI
_httpResolveURI
_httpWait
_ippAddAttr
_ippFreeAttr
_ppdFreeLanguages
@@ -56,25 +59,4 @@ _ppdGetLanguages
_ppdHashName
_ppdLocalizedAttr
_ppdNormalizeMakeAndModel
_ppdParseOptions
_pwgCreateWithFile
_pwgDestroy
_pwgWriteFile
_pwgGenerateSize
_pwgInitSize
_pwgMediaForLegacy
_pwgMediaForPPD
_pwgMediaForPWG
_pwgMediaForSize
_pwgCreateWithPPD
_pwgGetBin
_pwgGetInputSlot
_pwgGetMediaType
_pwgGetOutputBin
_pwgGetPageSize
_pwgGetSize
_pwgGetSource
_pwgGetType
_pwgInputSlotForSource
_pwgMediaTypeForType
_pwgPageSizeForMedia
_ppdParseOptions
+196 -120
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Option marking routines for CUPS.
* Option marking routines for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -29,11 +29,13 @@
* ppdFirstOption() - Return the first option in the PPD file.
* ppdNextOption() - Return the next option in the PPD file.
* _ppdParseOptions() - Parse options from a PPD file.
* ppd_debug_marked() - Output the marked array to stdout...
* debug_marked() - Output the marked array to stdout...
* ppd_defaults() - Set the defaults for this group and all sub-groups.
* ppd_mark_choices() - Mark one or more option choices from a string.
* ppd_mark_option() - Quickly mark an option without checking for
* conflicts.
* ppd_mark_size() - Quickly mark a page size without checking for
* conflicts.
*/
/*
@@ -43,7 +45,7 @@
#include "cups.h"
#include "string.h"
#include "debug.h"
#include "pwg-private.h"
#include "pwgmedia.h"
/*
@@ -51,14 +53,15 @@
*/
#ifdef DEBUG
static void ppd_debug_marked(ppd_file_t *ppd, const char *title);
static void debug_marked(ppd_file_t *ppd, const char *title);
#else
# define ppd_debug_marked(ppd,title)
# define debug_marked(ppd,title)
#endif /* DEBUG */
static void ppd_defaults(ppd_file_t *ppd, ppd_group_t *g);
static void ppd_mark_choices(ppd_file_t *ppd, const char *s);
static void ppd_mark_option(ppd_file_t *ppd, const char *option,
const char *choice);
static void ppd_mark_size(ppd_file_t *ppd, const char *size);
/*
@@ -80,8 +83,8 @@ cupsMarkOptions(
s[255]; /* Temporary string */
const char *val, /* Pointer into value */
*media, /* media option */
*page_size, /* PageSize option */
*ppd_keyword; /* PPD keyword */
*media_col, /* media-col option */
*page_size; /* PageSize option */
cups_option_t *optptr; /* Current option */
ppd_option_t *option; /* PPD option */
ppd_attr_t *attr; /* PPD attribute */
@@ -119,24 +122,71 @@ cupsMarkOptions(
if (!ppd || num_options <= 0 || !options)
return (0);
ppd_debug_marked(ppd, "Before...");
debug_marked(ppd, "Before...");
/*
* Do special handling for media and PageSize...
* Do special handling for media, media-col, and PageSize...
*/
media = cupsGetOption("media", num_options, options);
media_col = cupsGetOption("media-col", num_options, options);
page_size = cupsGetOption("PageSize", num_options, options);
if (media_col && (!page_size || !page_size[0]))
{
/*
* Pull out the corresponding media size from the media-col value...
*/
int num_media_cols, /* Number of media-col values */
num_media_sizes;/* Number of media-size values */
cups_option_t *media_cols, /* media-col values */
*media_sizes; /* media-size values */
num_media_cols = cupsParseOptions(media_col, 0, &media_cols);
if ((val = cupsGetOption("media-key", num_media_cols, media_cols)) != NULL)
media = val;
else if ((val = cupsGetOption("media-size", num_media_cols,
media_cols)) != NULL)
{
/*
* Lookup by dimensions...
*/
double width, /* Width in points */
length; /* Length in points */
struct lconv *loc; /* Locale data */
_cups_pwg_media_t *pwgmedia; /* PWG media name */
num_media_sizes = cupsParseOptions(val, 0, &media_sizes);
loc = localeconv();
if ((val = cupsGetOption("x-dimension", num_media_sizes,
media_sizes)) != NULL)
width = _cupsStrScand(val, NULL, loc) * 2540.0 / 72.0;
else
width = 0.0;
if ((val = cupsGetOption("y-dimension", num_media_sizes,
media_sizes)) != NULL)
length = _cupsStrScand(val, NULL, loc) * 2540.0 / 72.0;
else
length = 0.0;
if ((pwgmedia = _cupsPWGMediaBySize(width, length)) != NULL)
media = pwgmedia->pwg;
cupsFreeOptions(num_media_sizes, media_sizes);
}
cupsFreeOptions(num_media_cols, media_cols);
}
if (media)
{
/*
* Load PWG mapping data as needed...
*/
if (!ppd->pwg)
ppd->pwg = _pwgCreateWithPPD(ppd);
/*
* Loop through the option string, separating it at commas and
* marking each individual option as long as the corresponding
@@ -165,21 +215,23 @@ cupsMarkOptions(
*/
if (!page_size || !page_size[0])
{
if (!strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s))
ppd_mark_option(ppd, "PageSize", s);
else if ((ppd_keyword = _pwgGetPageSize((_pwg_t *)ppd->pwg, NULL, s,
NULL)) != NULL)
ppd_mark_option(ppd, "PageSize", ppd_keyword);
}
ppd_mark_size(ppd, s);
if (!cupsGetOption("InputSlot", num_options, options) &&
(ppd_keyword = _pwgGetInputSlot((_pwg_t *)ppd->pwg, NULL, s)) != NULL)
ppd_mark_option(ppd, "InputSlot", ppd_keyword);
if (cupsGetOption("InputSlot", num_options, options) == NULL)
ppd_mark_option(ppd, "InputSlot", s);
if (!cupsGetOption("MediaType", num_options, options) &&
(ppd_keyword = _pwgGetMediaType((_pwg_t *)ppd->pwg, NULL, s)) != NULL)
ppd_mark_option(ppd, "MediaType", ppd_keyword);
if (cupsGetOption("MediaType", num_options, options) == NULL)
ppd_mark_option(ppd, "MediaType", s);
if (cupsGetOption("EFMediaType", num_options, options) == NULL)
ppd_mark_option(ppd, "EFMediaType", s); /* EFI */
if (cupsGetOption("EFMediaQualityMode", num_options, options) == NULL)
ppd_mark_option(ppd, "EFMediaQualityMode", s); /* EFI */
if (!strcasecmp(s, "manual") &&
!cupsGetOption("ManualFeed", num_options, options))
ppd_mark_option(ppd, "ManualFeed", "True");
}
}
@@ -188,7 +240,8 @@ cupsMarkOptions(
*/
for (i = num_options, optptr = options; i > 0; i --, optptr ++)
if (!strcasecmp(optptr->name, "media"))
if (!strcasecmp(optptr->name, "media") ||
!strcasecmp(optptr->name, "media-col"))
continue;
else if (!strcasecmp(optptr->name, "sides"))
{
@@ -293,10 +346,8 @@ cupsMarkOptions(
}
else if (!strcasecmp(optptr->name, "output-bin"))
{
if (!cupsGetOption("OutputBin", num_options, options) &&
(ppd_keyword = _pwgGetOutputBin((_pwg_t *)ppd->pwg,
optptr->value)) != NULL)
ppd_mark_option(ppd, "OutputBin", ppd_keyword);
if (!cupsGetOption("OutputBin", num_options, options))
ppd_mark_option(ppd, "OutputBin", optptr->value);
}
else if (!strcasecmp(optptr->name, "multiple-document-handling"))
{
@@ -350,60 +401,6 @@ cupsMarkOptions(
ppd_mark_choices(ppd, attr->value);
}
}
else if (!strcasecmp(optptr->name, "print-quality"))
{
ppd_option_t *output_mode = ppdFindOption(ppd, "OutputMode");
/* OutputMode option */
if (!strcmp(optptr->value, "3"))
{
/*
* Draft quality...
*/
if (ppdFindChoice(output_mode, "Draft"))
ppd_mark_option(ppd, "OutputMode", "Draft");
else if (ppdFindChoice(output_mode, "Fast"))
ppd_mark_option(ppd, "OutputMode", "Fast");
if ((attr = ppdFindAttr(ppd, "APPrinterPreset",
"DraftGray_with_Paper_Auto-Detect")) != NULL)
ppd_mark_choices(ppd, attr->value);
}
else if (!strcmp(optptr->value, "4"))
{
/*
* Normal quality...
*/
if (ppdFindChoice(output_mode, "Normal"))
ppd_mark_option(ppd, "OutputMode", "Normal");
else if (ppdFindChoice(output_mode, "Good"))
ppd_mark_option(ppd, "OutputMode", "Good");
if ((attr = ppdFindAttr(ppd, "APPrinterPreset",
"Color_with_Paper_Auto-Detect")) != NULL)
ppd_mark_choices(ppd, attr->value);
else if ((attr = ppdFindAttr(ppd, "APPrinterPreset",
"Gray_with_Paper_Auto-Detect")) != NULL)
ppd_mark_choices(ppd, attr->value);
}
else if (!strcmp(optptr->value, "5"))
{
/*
* High/best/photo quality...
*/
if (ppdFindChoice(output_mode, "Best"))
ppd_mark_option(ppd, "OutputMode", "Best");
else if (ppdFindChoice(output_mode, "High"))
ppd_mark_option(ppd, "OutputMode", "High");
if ((attr = ppdFindAttr(ppd, "APPrinterPreset",
"Photo_on_Photo_Paper")) != NULL)
ppd_mark_choices(ppd, attr->value);
}
}
else if (!strcasecmp(optptr->name, "APPrinterPreset"))
{
/*
@@ -424,7 +421,7 @@ cupsMarkOptions(
else
ppd_mark_option(ppd, optptr->name, optptr->value);
ppd_debug_marked(ppd, "After...");
debug_marked(ppd, "After...");
return (ppdConflicts(ppd) > 0);
}
@@ -749,11 +746,11 @@ _ppdParseOptions(
#ifdef DEBUG
/*
* 'ppd_debug_marked()' - Output the marked array to stdout...
* 'debug_marked()' - Output the marked array to stdout...
*/
static void
ppd_debug_marked(ppd_file_t *ppd, /* I - PPD file data */
debug_marked(ppd_file_t *ppd, /* I - PPD file data */
const char *title) /* I - Title for list */
{
ppd_choice_t *c; /* Current choice */
@@ -845,8 +842,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
if (!strcasecmp(option, "AP_D_InputSlot"))
{
cupsArraySave(ppd->options);
if ((o = ppdFindOption(ppd, "InputSlot")) != NULL)
{
key.option = o;
@@ -856,21 +851,13 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
cupsArrayRemove(ppd->marked, oldc);
}
}
cupsArrayRestore(ppd->options);
}
/*
* Check for custom options...
*/
cupsArraySave(ppd->options);
o = ppdFindOption(ppd, option);
cupsArrayRestore(ppd->options);
if (!o)
if ((o = ppdFindOption(ppd, option)) == NULL)
return;
loc = localeconv();
@@ -925,15 +912,15 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
if (units)
{
if (!strcasecmp(units, "cm"))
cparam->current.custom_points *= 72.0f / 2.54f;
cparam->current.custom_points *= 72.0f / 2.54f;
else if (!strcasecmp(units, "mm"))
cparam->current.custom_points *= 72.0f / 25.4f;
cparam->current.custom_points *= 72.0f / 25.4f;
else if (!strcasecmp(units, "m"))
cparam->current.custom_points *= 72.0f / 0.0254f;
cparam->current.custom_points *= 72.0f / 0.0254f;
else if (!strcasecmp(units, "in"))
cparam->current.custom_points *= 72.0f;
cparam->current.custom_points *= 72.0f;
else if (!strcasecmp(units, "ft"))
cparam->current.custom_points *= 12.0f * 72.0f;
cparam->current.custom_points *= 12.0f * 72.0f;
}
break;
@@ -1073,8 +1060,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
* appropriate...
*/
cupsArraySave(ppd->options);
if (!strcasecmp(option, "PageSize"))
{
if ((o = ppdFindOption(ppd, "PageRegion")) != NULL)
@@ -1099,8 +1084,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
}
}
}
cupsArrayRestore(ppd->options);
}
else if (!strcasecmp(option, "InputSlot"))
{
@@ -1108,8 +1091,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
* Unmark ManualFeed option...
*/
cupsArraySave(ppd->options);
if ((o = ppdFindOption(ppd, "ManualFeed")) != NULL)
{
key.option = o;
@@ -1119,8 +1100,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
cupsArrayRemove(ppd->marked, oldc);
}
}
cupsArrayRestore(ppd->options);
}
else if (!strcasecmp(option, "ManualFeed") &&
!strcasecmp(choice, "True"))
@@ -1129,8 +1108,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
* Unmark InputSlot option...
*/
cupsArraySave(ppd->options);
if ((o = ppdFindOption(ppd, "InputSlot")) != NULL)
{
key.option = o;
@@ -1140,8 +1117,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
cupsArrayRemove(ppd->marked, oldc);
}
}
cupsArrayRestore(ppd->options);
}
}
@@ -1151,6 +1126,107 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
}
/*
* 'ppd_mark_size()' - Quickly mark a page size without checking for conflicts.
*
* This function is also responsible for mapping PWG/ISO/IPP size names to the
* PPD file...
*/
static void
ppd_mark_size(ppd_file_t *ppd, /* I - PPD file */
const char *size) /* I - Size name */
{
int i; /* Looping var */
_cups_pwg_media_t *pwgmedia; /* PWG media information */
ppd_size_t *ppdsize; /* Current PPD size */
double dw, dl; /* Difference in width and height */
double width, /* Width to find */
length; /* Length to find */
char width_str[256], /* Width in size name */
length_str[256],/* Length in size name */
units[256], /* Units in size name */
custom[256]; /* Custom size */
struct lconv *loc; /* Localization data */
/*
* See if this is a PPD size...
*/
if (!strncasecmp(size, "Custom.", 7) || ppdPageSize(ppd, size))
{
ppd_mark_option(ppd, "PageSize", size);
return;
}
/*
* Nope, try looking up the PWG or legacy (IPP/ISO) size name...
*/
if ((pwgmedia = _cupsPWGMediaByName(size)) == NULL)
pwgmedia = _cupsPWGMediaByLegacy(size);
if (pwgmedia)
{
width = pwgmedia->width;
length = pwgmedia->length;
}
else if (sscanf(size, "%*[^_]_%*[^_]_%255[0-9.]x%255[0-9.]%s", width_str,
length_str, units) == 3)
{
/*
* Got a "self-describing" name that isn't in our table...
*/
loc = localeconv();
width = _cupsStrScand(width_str, NULL, loc);
length = _cupsStrScand(length_str, NULL, loc);
if (!strcmp(units, "in"))
{
width *= 72.0;
length *= 72.0;
}
else if (!strcmp(units, "mm"))
{
width *= 25.4 / 72.0;
length *= 25.4 / 72.0;
}
else
return;
}
else
return;
/*
* Search the PPD file for a matching size...
*/
for (i = ppd->num_sizes, ppdsize = ppd->sizes; i > 0; i --, ppdsize ++)
{
dw = ppdsize->width - width;
dl = ppdsize->length - length;
if (dw > -5.0 && dw < 5.0 && dl > -5.0 && dl < 5.0)
{
ppd_mark_option(ppd, "PageSize", ppdsize->name);
return;
}
}
/*
* No match found; if custom sizes are supported, set a custom size...
*/
if (ppd->variable_sizes)
{
snprintf(custom, sizeof(custom), "Custom.%dx%d", (int)width, (int)length);
ppd_mark_option(ppd, "PageSize", custom);
}
}
/*
* End of "$Id$".
*/
+30 -28
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Page size functions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -44,7 +44,7 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
{
int i; /* Looping var */
ppd_size_t *size; /* Current page size */
double w, l; /* Width and length of page */
float w, l; /* Width and length of page */
char *nameptr; /* Pointer into name */
struct lconv *loc; /* Locale data */
ppd_coption_t *coption; /* Custom option for page size */
@@ -81,54 +81,52 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
* Variable size; size name can be one of the following:
*
* Custom.WIDTHxLENGTHin - Size in inches
* Custom.WIDTHxLENGTHft - Size in feet
* Custom.WIDTHxLENGTHcm - Size in centimeters
* Custom.WIDTHxLENGTHmm - Size in millimeters
* Custom.WIDTHxLENGTHm - Size in meters
* Custom.WIDTHxLENGTH[pt] - Size in points
*/
loc = localeconv();
w = _cupsStrScand(name + 7, &nameptr, loc);
w = (float)_cupsStrScand(name + 7, &nameptr, loc);
if (!nameptr || *nameptr != 'x')
return (NULL);
l = _cupsStrScand(nameptr + 1, &nameptr, loc);
l = (float)_cupsStrScand(nameptr + 1, &nameptr, loc);
if (!nameptr)
return (NULL);
if (!strcasecmp(nameptr, "in"))
{
w *= 72.0;
l *= 72.0;
w *= 72.0f;
l *= 72.0f;
}
else if (!strcasecmp(nameptr, "ft"))
{
w *= 12.0 * 72.0;
l *= 12.0 * 72.0;
w *= 12.0f * 72.0f;
l *= 12.0f * 72.0f;
}
else if (!strcasecmp(nameptr, "mm"))
{
w *= 72.0 / 25.4;
l *= 72.0 / 25.4;
w *= 72.0f / 25.4f;
l *= 72.0f / 25.4f;
}
else if (!strcasecmp(nameptr, "cm"))
{
w *= 72.0 / 2.54;
l *= 72.0 / 2.54;
w *= 72.0f / 2.54f;
l *= 72.0f / 2.54f;
}
else if (!strcasecmp(nameptr, "m"))
{
w *= 72.0 / 0.0254;
l *= 72.0 / 0.0254;
w *= 72.0f / 0.0254f;
l *= 72.0f / 0.0254f;
}
size->width = (float)w;
size->length = (float)l;
size->width = w;
size->length = l;
size->left = ppd->custom_margins[0];
size->bottom = ppd->custom_margins[1];
size->right = (float)(w - ppd->custom_margins[2]);
size->top = (float)(l - ppd->custom_margins[3]);
size->right = w - ppd->custom_margins[2];
size->top = l - ppd->custom_margins[3];
/*
* Update the custom option records for the page size, too...
@@ -252,9 +250,6 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
* Figure out the current minimum width and length...
*/
width = ppd->custom_min[0];
length = ppd->custom_min[1];
if (qualifier2)
{
/*
@@ -282,13 +277,18 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
attr = ppdFindAttr(ppd, "cupsMinSize", spec);
}
if ((attr && attr->value &&
sscanf(attr->value, "%f%f", &width, &length) != 2) || !attr)
if (!attr ||
(attr->value && sscanf(attr->value, "%f%f", &width, &length) != 2))
{
width = ppd->custom_min[0];
length = ppd->custom_min[1];
}
}
else
{
width = ppd->custom_min[0];
length = ppd->custom_min[1];
}
minimum->width = width;
minimum->length = length;
@@ -301,9 +301,6 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
* Figure out the current maximum width and length...
*/
width = ppd->custom_max[0];
length = ppd->custom_max[1];
if (qualifier2)
{
/*
@@ -338,6 +335,11 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
length = ppd->custom_max[1];
}
}
else
{
width = ppd->custom_max[0];
length = ppd->custom_max[1];
}
maximum->width = width;
maximum->length = length;
+4 -45
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* PPD file routines for CUPS.
* PPD file routines for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -60,7 +60,6 @@
*/
#include "ppd-private.h"
#include "pwg-private.h"
#include "globals.h"
#include "debug.h"
#include <stdlib.h>
@@ -314,13 +313,6 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
cupsArrayDelete(ppd->cups_uiconstraints);
}
/*
* Free any PWG mapping data...
*/
if (ppd->pwg)
_pwgDestroy((_pwg_t *)ppd->pwg);
/*
* Free the whole record...
*/
@@ -360,13 +352,11 @@ ppdErrorString(ppd_status_t status) /* I - PPD status */
_("Illegal option keyword string"),
_("Illegal translation string"),
_("Illegal whitespace character"),
_("Bad custom parameter"),
_("Missing option keyword"),
_("Bad value string")
_("Bad custom parameter")
};
if (status < PPD_OK || status >= PPD_MAX_STATUS)
if (status < PPD_OK || status > PPD_ILLEGAL_WHITESPACE)
return (_cupsLangString(cupsLangDefault(), _("Unknown")));
else
return (_cupsLangString(cupsLangDefault(), messages[status]));
@@ -1187,37 +1177,6 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
}
else if (!strcmp(keyword, "JobPatchFile"))
{
/*
* CUPS STR #3421: Check for "*JobPatchFile: int: string"
*/
if (isdigit(*string & 255))
{
for (sptr = string + 1; isdigit(*sptr & 255); sptr ++);
if (*sptr == ':')
{
/*
* Found "*JobPatchFile: int: string"...
*/
cg->ppd_status = PPD_BAD_VALUE;
goto error;
}
}
if (!name[0])
{
/*
* Found "*JobPatchFile: string"...
*/
cg->ppd_status = PPD_MISSING_OPTION_KEYWORD;
goto error;
}
if (ppd->patches == NULL)
ppd->patches = strdup(string);
else
+8 -14
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* "$Id$"
*
* PostScript Printer Description definitions for CUPS.
* PostScript Printer Description definitions for the Common UNIX Printing
* System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -114,10 +115,7 @@ typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19/Mac OS X 10.3@
PPD_ILLEGAL_OPTION_KEYWORD, /* Illegal option keyword string */
PPD_ILLEGAL_TRANSLATION, /* Illegal translation string */
PPD_ILLEGAL_WHITESPACE, /* Illegal whitespace character */
PPD_BAD_CUSTOM_PARAM, /* Bad custom parameter */
PPD_MISSING_OPTION_KEYWORD, /* Missing option keyword */
PPD_BAD_VALUE, /* Bad value string */
PPD_MAX_STATUS /* @private@ */
PPD_BAD_CUSTOM_PARAM /* Bad custom parameter */
} ppd_status_t;
enum ppd_conform_e /**** Conformance Levels @since CUPS 1.1.19/Mac OS X 10.3@ ****/
@@ -333,9 +331,6 @@ typedef struct ppd_file_s /**** PPD File ****/
/**** New in CUPS 1.4/Mac OS X 10.6 ****/
cups_array_t *cups_uiconstraints; /* cupsUIConstraints @since CUPS 1.4/Mac OS X 10.6@ @private@ */
/**** New in CUPS 1.5 ****/
void *pwg; /* PWG to/from PPD mappings */
} ppd_file_t;
@@ -399,20 +394,19 @@ extern ppd_option_t *ppdNextOption(ppd_file_t *ppd) _CUPS_API_1_2;
extern int ppdLocalize(ppd_file_t *ppd) _CUPS_API_1_2;
extern ppd_file_t *ppdOpen2(cups_file_t *fp) _CUPS_API_1_2;
/**** New in CUPS 1.3/Mac OS X 10.5 ****/
/**** New in CUPS 1.3 ****/
extern const char *ppdLocalizeIPPReason(ppd_file_t *ppd,
const char *reason,
const char *scheme,
char *buffer,
size_t bufsize) _CUPS_API_1_3;
/**** New in CUPS 1.4/Mac OS X 10.6 ****/
/**** New in CUPS 1.4 ****/
extern int ppdInstallableConflict(ppd_file_t *ppd,
const char *option,
const char *choice)
_CUPS_API_1_4;
const char *choice);
extern ppd_attr_t *ppdLocalizeAttr(ppd_file_t *ppd, const char *keyword,
const char *spec) _CUPS_API_1_4;
const char *spec);
extern const char *ppdLocalizeMarkerName(ppd_file_t *ppd,
const char *name) _CUPS_API_1_4;
extern int ppdPageSizeLimits(ppd_file_t *ppd,
-561
Ver Arquivo
@@ -1,561 +0,0 @@
/*
* "$Id$"
*
* PWG load/save API implementation for CUPS.
*
* Copyright 2010 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* _pwgCreateWithFile() - Create PWG mapping data from a written file.
* _pwgDestroy() - Free all memory used for PWG mapping data.
* _pwgWriteFile() - Write PWG mapping data to a file.
*/
/*
* Include necessary headers...
*/
#include "globals.h"
#include "debug.h"
#include <math.h>
/*
* '_pwgCreateWithFile()' - Create PWG mapping data from a written file.
*
* Use the @link _pwgWriteFile@ function to write PWG mapping data to a file.
*/
_pwg_t * /* O - PWG mapping data */
_pwgCreateWithFile(const char *filename)/* I - File to read */
{
cups_file_t *fp; /* File */
_pwg_t *pwg; /* PWG mapping data */
_pwg_size_t *size; /* Current size */
_pwg_map_t *map; /* Current map */
int linenum, /* Current line number */
num_bins, /* Number of bins in file */
num_sizes, /* Number of sizes in file */
num_sources, /* Number of sources in file */
num_types; /* Number of types in file */
char line[512], /* Current line */
*value, /* Pointer to value in line */
pwg_keyword[128], /* PWG keyword */
ppd_keyword[PPD_MAX_NAME];
/* PPD keyword */
DEBUG_printf(("_pwgCreateWithFile(filename=\"%s\")", filename));
/*
* Range check input...
*/
if (!filename)
{
_cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
return (NULL);
}
/*
* Open the file...
*/
if ((fp = cupsFileOpen(filename, "r")) == NULL)
{
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
return (NULL);
}
/*
* Allocate the mapping data structure...
*/
if ((pwg = calloc(1, sizeof(_pwg_t))) == NULL)
{
DEBUG_puts("_pwgCreateWithFile: Unable to allocate pwg_t.");
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
goto create_error;
}
/*
* Read the file...
*/
linenum = 0;
num_bins = 0;
num_sizes = 0;
num_sources = 0;
num_types = 0;
while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
{
DEBUG_printf(("_pwgCreateWithFile: line=\"%s\", value=\"%s\", linenum=%d",
line, value, linenum));
if (!value)
{
DEBUG_printf(("_pwgCreateWithFile: Missing value on line %d.", linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
else if (!strcasecmp(line, "NumBins"))
{
if (num_bins > 0)
{
DEBUG_puts("_pwgCreateWithFile: NumBins listed multiple times.");
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if ((num_bins = atoi(value)) <= 0 || num_bins > 65536)
{
DEBUG_printf(("_pwgCreateWithFile: Bad NumBins value %d on line %d.",
num_sizes, linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if ((pwg->bins = calloc(num_bins, sizeof(_pwg_map_t))) == NULL)
{
DEBUG_printf(("_pwgCreateWithFile: Unable to allocate %d bins.",
num_sizes));
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
goto create_error;
}
}
else if (!strcasecmp(line, "Bin"))
{
if (sscanf(value, "%127s%40s", pwg_keyword, ppd_keyword) != 2)
{
DEBUG_printf(("_pwgCreateWithFile: Bad Bin on line %d.", linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if (pwg->num_bins >= num_bins)
{
DEBUG_printf(("_pwgCreateWithFile: Too many Bin's on line %d.",
linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
map = pwg->bins + pwg->num_bins;
map->pwg = _cupsStrAlloc(pwg_keyword);
map->ppd = _cupsStrAlloc(ppd_keyword);
pwg->num_bins ++;
}
else if (!strcasecmp(line, "NumSizes"))
{
if (num_sizes > 0)
{
DEBUG_puts("_pwgCreateWithFile: NumSizes listed multiple times.");
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if ((num_sizes = atoi(value)) <= 0 || num_sizes > 65536)
{
DEBUG_printf(("_pwgCreateWithFile: Bad NumSizes value %d on line %d.",
num_sizes, linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if ((pwg->sizes = calloc(num_sizes, sizeof(_pwg_size_t))) == NULL)
{
DEBUG_printf(("_pwgCreateWithFile: Unable to allocate %d sizes.",
num_sizes));
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
goto create_error;
}
}
else if (!strcasecmp(line, "Size"))
{
if (pwg->num_sizes >= num_sizes)
{
DEBUG_printf(("_pwgCreateWithFile: Too many Size's on line %d.",
linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
size = pwg->sizes + pwg->num_sizes;
if (sscanf(value, "%127s%40s%d%d%d%d%d%d", pwg_keyword, ppd_keyword,
&(size->width), &(size->length), &(size->left),
&(size->bottom), &(size->right), &(size->top)) != 8)
{
DEBUG_printf(("_pwgCreateWithFile: Bad Size on line %d.", linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
size->map.pwg = _cupsStrAlloc(pwg_keyword);
size->map.ppd = _cupsStrAlloc(ppd_keyword);
pwg->num_sizes ++;
}
else if (!strcasecmp(line, "CustomSize"))
{
if (pwg->custom_max_width > 0)
{
DEBUG_printf(("_pwgCreateWithFile: Too many CustomSize's on line %d.",
linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if (sscanf(value, "%d%d%d%d%d%d%d%d", &(pwg->custom_max_width),
&(pwg->custom_max_length), &(pwg->custom_min_width),
&(pwg->custom_min_length), &(pwg->custom_size.left),
&(pwg->custom_size.bottom), &(pwg->custom_size.right),
&(pwg->custom_size.top)) != 8)
{
DEBUG_printf(("_pwgCreateWithFile: Bad CustomSize on line %d.", linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
_pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), "custom", "max",
pwg->custom_max_width, pwg->custom_max_length);
pwg->custom_max_keyword = _cupsStrAlloc(pwg_keyword);
_pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), "custom", "min",
pwg->custom_min_width, pwg->custom_min_length);
pwg->custom_min_keyword = _cupsStrAlloc(pwg_keyword);
}
else if (!strcasecmp(line, "NumSources"))
{
if (num_sources > 0)
{
DEBUG_puts("_pwgCreateWithFile: NumSources listed multiple times.");
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if ((num_sources = atoi(value)) <= 0 || num_sources > 65536)
{
DEBUG_printf(("_pwgCreateWithFile: Bad NumSources value %d on line %d.",
num_sources, linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if ((pwg->sources = calloc(num_sources, sizeof(_pwg_map_t))) == NULL)
{
DEBUG_printf(("_pwgCreateWithFile: Unable to allocate %d sources.",
num_sources));
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
goto create_error;
}
}
else if (!strcasecmp(line, "Source"))
{
if (sscanf(value, "%127s%40s", pwg_keyword, ppd_keyword) != 2)
{
DEBUG_printf(("_pwgCreateWithFile: Bad Source on line %d.", linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if (pwg->num_sources >= num_sources)
{
DEBUG_printf(("_pwgCreateWithFile: Too many Source's on line %d.",
linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
map = pwg->sources + pwg->num_sources;
map->pwg = _cupsStrAlloc(pwg_keyword);
map->ppd = _cupsStrAlloc(ppd_keyword);
pwg->num_sources ++;
}
else if (!strcasecmp(line, "NumTypes"))
{
if (num_types > 0)
{
DEBUG_puts("_pwgCreateWithFile: NumTypes listed multiple times.");
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if ((num_types = atoi(value)) <= 0 || num_types > 65536)
{
DEBUG_printf(("_pwgCreateWithFile: Bad NumTypes value %d on line %d.",
num_types, linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if ((pwg->types = calloc(num_types, sizeof(_pwg_map_t))) == NULL)
{
DEBUG_printf(("_pwgCreateWithFile: Unable to allocate %d types.",
num_types));
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
goto create_error;
}
}
else if (!strcasecmp(line, "Type"))
{
if (sscanf(value, "%127s%40s", pwg_keyword, ppd_keyword) != 2)
{
DEBUG_printf(("_pwgCreateWithFile: Bad Type on line %d.", linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if (pwg->num_types >= num_types)
{
DEBUG_printf(("_pwgCreateWithFile: Too many Type's on line %d.",
linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
map = pwg->types + pwg->num_types;
map->pwg = _cupsStrAlloc(pwg_keyword);
map->ppd = _cupsStrAlloc(ppd_keyword);
pwg->num_types ++;
}
else
{
DEBUG_printf(("_pwgCreateWithFile: Unknown %s on line %d.", line,
linenum));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
}
if (pwg->num_sizes < num_sizes)
{
DEBUG_printf(("_pwgCreateWithFile: Not enough sizes (%d < %d).",
pwg->num_sizes, num_sizes));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if (pwg->num_sources < num_sources)
{
DEBUG_printf(("_pwgCreateWithFile: Not enough sources (%d < %d).",
pwg->num_sources, num_sources));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
if (pwg->num_types < num_types)
{
DEBUG_printf(("_pwgCreateWithFile: Not enough types (%d < %d).",
pwg->num_types, num_types));
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PWG mapping file."), 1);
goto create_error;
}
cupsFileClose(fp);
return (pwg);
/*
* If we get here the file was bad - free any data and return...
*/
create_error:
cupsFileClose(fp);
_pwgDestroy(pwg);
return (NULL);
}
/*
* '_pwgDestroy()' - Free all memory used for PWG mapping data.
*/
void
_pwgDestroy(_pwg_t *pwg) /* I - PWG mapping data */
{
int i; /* Looping var */
_pwg_map_t *map; /* Current map */
_pwg_size_t *size; /* Current size */
/*
* Range check input...
*/
if (!pwg)
return;
/*
* Free memory as needed...
*/
if (pwg->bins)
{
for (i = pwg->num_bins, map = pwg->bins; i > 0; i --, map ++)
{
_cupsStrFree(map->pwg);
_cupsStrFree(map->ppd);
}
free(pwg->bins);
}
if (pwg->sizes)
{
for (i = pwg->num_sizes, size = pwg->sizes; i > 0; i --, size ++)
{
_cupsStrFree(size->map.pwg);
_cupsStrFree(size->map.ppd);
}
free(pwg->sizes);
}
if (pwg->sources)
{
for (i = pwg->num_sources, map = pwg->sources; i > 0; i --, map ++)
{
_cupsStrFree(map->pwg);
_cupsStrFree(map->ppd);
}
free(pwg->sources);
}
if (pwg->types)
{
for (i = pwg->num_types, map = pwg->types; i > 0; i --, map ++)
{
_cupsStrFree(map->pwg);
_cupsStrFree(map->ppd);
}
free(pwg->types);
}
if (pwg->custom_max_keyword)
_cupsStrFree(pwg->custom_max_keyword);
if (pwg->custom_min_keyword)
_cupsStrFree(pwg->custom_min_keyword);
free(pwg);
}
/*
* '_pwgWriteFile()' - Write PWG mapping data to a file.
*/
int /* O - 1 on success, 0 on failure */
_pwgWriteFile(_pwg_t *pwg, /* I - PWG mapping data */
const char *filename) /* I - File to write */
{
int i; /* Looping var */
cups_file_t *fp; /* Output file */
_pwg_size_t *size; /* Current size */
_pwg_map_t *map; /* Current map */
/*
* Range check input...
*/
if (!pwg || !filename)
{
_cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
return (0);
}
/*
* Open the file and write with compression...
*/
if ((fp = cupsFileOpen(filename, "w9")) == NULL)
{
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
return (0);
}
/*
* Standard header...
*/
cupsFilePuts(fp, "#CUPS-PWGPPD\n");
/*
* Output bins...
*/
if (pwg->num_bins > 0)
{
cupsFilePrintf(fp, "NumBins %d\n", pwg->num_bins);
for (i = pwg->num_bins, map = pwg->bins; i > 0; i --, map ++)
cupsFilePrintf(fp, "Bin %s %s\n", map->pwg, map->ppd);
}
/*
* Media sizes...
*/
cupsFilePrintf(fp, "NumSizes %d\n", pwg->num_sizes);
for (i = pwg->num_sizes, size = pwg->sizes; i > 0; i --, size ++)
cupsFilePrintf(fp, "Size %s %s %d %d %d %d %d %d\n", size->map.pwg,
size->map.ppd, size->width, size->length, size->left,
size->bottom, size->right, size->top);
if (pwg->custom_max_width > 0)
cupsFilePrintf(fp, "CustomSize %d %d %d %d %d %d %d %d\n",
pwg->custom_max_width, pwg->custom_max_length,
pwg->custom_min_width, pwg->custom_min_length,
pwg->custom_size.left, pwg->custom_size.bottom,
pwg->custom_size.right, pwg->custom_size.top);
/*
* Media sources...
*/
if (pwg->num_sources > 0)
{
cupsFilePrintf(fp, "NumSources %d\n", pwg->num_sources);
for (i = pwg->num_sources, map = pwg->sources; i > 0; i --, map ++)
cupsFilePrintf(fp, "Source %s %s\n", map->pwg, map->ppd);
}
/*
* Media types...
*/
if (pwg->num_types > 0)
{
cupsFilePrintf(fp, "NumTypes %d\n", pwg->num_types);
for (i = pwg->num_types, map = pwg->types; i > 0; i --, map ++)
cupsFilePrintf(fp, "Type %s %s\n", map->pwg, map->ppd);
}
/*
* Close and return...
*/
return (!cupsFileClose(fp));
}
/*
* End of "$Id$".
*/
-686
Ver Arquivo
@@ -1,686 +0,0 @@
/*
* "$Id$"
*
* PWG media name API implementation for CUPS.
*
* Copyright 2009-2010 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* _pwgGenerateSize() - Generate a PWG size keyword.
* _pwgInitSize() - Initialize a PWG size using IPP job template
* attributes.
* _pwgMediaForLegacy() - Find a PWG media size by ISO/IPP legacy name.
* _pwgMediaForPPD() - Find a PWG media size by Adobe PPD name.
* _pwgMediaForPWG() - Find a PWG media size by 5101.1 self-describing
* name.
* _pwgMediaForSize() - Get the PWG media name for a given size.
* pwg_compare_legacy() - Compare two sizes using the legacy names.
* pwg_compare_ppd() - Compare two sizes using the PPD names.
* pwg_compare_pwg() - Compare two sizes using the PWG names.
*/
/*
* Include necessary headers...
*/
#include "globals.h"
#include "debug.h"
#include <math.h>
/*
* Local macros...
*/
#define _PWG_MEDIA_IN(p,l,a,x,y) {p, l, a, (int)(x * 2540), (int)(y * 2540)}
#define _PWG_MEDIA_MM(p,l,a,x,y) {p, l, a, (int)(x * 100), (int)(y * 100)}
/*
* Local functions...
*/
static int pwg_compare_legacy(_pwg_media_t *a, _pwg_media_t *b);
static int pwg_compare_pwg(_pwg_media_t *a, _pwg_media_t *b);
static int pwg_compare_ppd(_pwg_media_t *a, _pwg_media_t *b);
/*
* Local globals...
*/
static _pwg_media_t const cups_pwg_media[] =
{ /* Media size lookup table */
/* North American Standard Sheet Media Sizes */
_PWG_MEDIA_IN("na_index-3x5_3x5in", NULL, NULL, 3, 5),
_PWG_MEDIA_IN("na_personal_3.625x6.5in", NULL, "EnvPersonal", 3.625, 6.5),
_PWG_MEDIA_IN("na_monarch_3.875x7.5in", "monarch-envelope", "EnvMonarch", 3.875, 7.5),
_PWG_MEDIA_IN("na_number-9_3.875x8.875in", "na-number-9-envelope", "Env9", 3.875, 8.875),
_PWG_MEDIA_IN("na_index-4x6_4x6in", NULL, NULL, 4, 6),
_PWG_MEDIA_IN("na_number-10_4.125x9.5in", "na-number-10-envelope", "Env10", 4.125, 9.5),
_PWG_MEDIA_IN("na_a2_4.375x5.75in", NULL, NULL, 4.375, 5.75),
_PWG_MEDIA_IN("na_number-11_4.5x10.375in", NULL, "Env11", 4.5, 10.375),
_PWG_MEDIA_IN("na_number-12_4.75x11in", NULL, "Env12", 4.75, 11),
_PWG_MEDIA_IN("na_5x7_5x7in", NULL, NULL, 5, 7),
_PWG_MEDIA_IN("na_index-5x8_5x8in", NULL, NULL, 5, 8),
_PWG_MEDIA_IN("na_number-14_5x11.5in", NULL, "Env14", 5, 11.5),
_PWG_MEDIA_IN("na_invoice_5.5x8.5in", "invoice", "Statement", 5.5, 8.5),
_PWG_MEDIA_IN("na_index-4x6-ext_6x8in", NULL, NULL, 6, 8),
_PWG_MEDIA_IN("na_6x9_6x9in", "na-6x9-envelope", NULL, 6, 9),
_PWG_MEDIA_IN("na_c5_6.5x9.5in", NULL, NULL, 6.5, 9.5),
_PWG_MEDIA_IN("na_7x9_7x9in", "na-7x9-envelope", "7x9", 7, 9),
_PWG_MEDIA_IN("na_executive_7.25x10.5in", "executive", "Executive", 7.25, 10.5),
_PWG_MEDIA_IN("na_govt-letter_8x10in", "na-8x10", "8x10", 8, 10),
_PWG_MEDIA_IN("na_govt-legal_8x13in", NULL, NULL, 8, 13),
_PWG_MEDIA_IN("na_quarto_8.5x10.83in", "quarto", "Quarto", 8.5, 10.83),
_PWG_MEDIA_IN("na_letter_8.5x11in", "na-letter", "Letter", 8.5, 11),
_PWG_MEDIA_IN("na_fanfold-eur_8.5x12in", NULL, "FanFoldGerman", 8.5, 12),
_PWG_MEDIA_IN("na_letter-plus_8.5x12.69in", NULL, "LetterPlus", 8.5, 12.69),
_PWG_MEDIA_IN("na_foolscap_8.5x13in", NULL, "FanFoldGermanLegal", 8.5, 13),
_PWG_MEDIA_IN("na_legal_8.5x14in", "na-legal", "Legal", 8.5, 14),
_PWG_MEDIA_IN("na_super-a_8.94x14in", NULL, "SuperA", 8.94, 14),
_PWG_MEDIA_IN("na_9x11_9x11in", "na-9x11-envelope", "9x11", 9, 11),
_PWG_MEDIA_IN("na_arch-a_9x12in", "arch-a", "ARCHA", 9, 12),
_PWG_MEDIA_IN("na_letter-extra_9.5x12in", NULL, "LetterExtra", 9.5, 12),
_PWG_MEDIA_IN("na_legal-extra_9.5x15in", NULL, "LegalExtra", 9.5, 15),
_PWG_MEDIA_IN("na_10x11_10x11in", NULL, "10x11", 10, 11),
_PWG_MEDIA_IN("na_10x13_10x13in", "na-10x13-envelope", "10x13", 10, 13),
_PWG_MEDIA_IN("na_10x14_10x14in", "na-10x14-envelope", "10x14", 10, 14),
_PWG_MEDIA_IN("na_10x15_10x15in", "na-10x15-envelope", NULL, 10, 15),
_PWG_MEDIA_IN("na_11x12_11x12in", NULL, NULL, 11, 12),
_PWG_MEDIA_IN("na_edp_11x14in", NULL, NULL, 11, 14),
_PWG_MEDIA_IN("na_fanfold-us_11x14.875in", NULL, NULL, 11, 14.875),
_PWG_MEDIA_IN("na_11x15_11x15in", NULL, NULL, 11, 15),
_PWG_MEDIA_IN("na_ledger_11x17in", "tabloid", "Tabloid", 11, 17),
_PWG_MEDIA_IN("na_eur-edp_12x14in", NULL, NULL, 12, 14),
_PWG_MEDIA_IN("na_arch-b_12x18in", "arch-b", "ARCHB", 12, 18),
_PWG_MEDIA_IN("na_12x19_12x19in", NULL, NULL, 12, 19),
_PWG_MEDIA_IN("na_b-plus_12x19.17in", NULL, "SuperB", 12, 19.17),
_PWG_MEDIA_IN("na_super-b_13x19in", "super-b", NULL, 13, 19),
_PWG_MEDIA_IN("na_c_17x22in", "c", "AnsiC", 17, 22),
_PWG_MEDIA_IN("na_arch-c_18x24in", "arch-c", "ARCHC", 18, 24),
_PWG_MEDIA_IN("na_d_22x34in", "d", "AnsiD", 22, 34),
_PWG_MEDIA_IN("na_arch-d_24x36in", "arch-d", "ARCHD", 24, 36),
_PWG_MEDIA_IN("asme_f_28x40in", "f", NULL, 28, 40),
_PWG_MEDIA_IN("na_wide-format_30x42in", NULL, NULL, 30, 42),
_PWG_MEDIA_IN("na_e_34x44in", "e", "AnsiE", 34, 44),
_PWG_MEDIA_IN("na_arch-e_36x48in", "arch-e", "ARCHE", 36, 48),
_PWG_MEDIA_IN("na_f_44x68in", NULL, NULL, 44, 68),
/* Chinese Standard Sheet Media Inch Sizes */
_PWG_MEDIA_IN("roc_16k_7.75x10.75in", NULL, NULL, 7.75, 10.75),
_PWG_MEDIA_IN("roc_8k_10.75x15.5in", NULL, NULL, 10.75, 15.5),
/* ISO Standard Sheet Media Sizes */
_PWG_MEDIA_MM("iso_a10_26x37mm", "iso-a10", "A10", 26, 37),
_PWG_MEDIA_MM("iso_a9_37x52mm", "iso-a9", "A9", 37, 52),
_PWG_MEDIA_MM("iso_a8_52x74mm", "iso-a8", "A8", 52, 74),
_PWG_MEDIA_MM("iso_a7_74x105mm", "iso-a7", "A7", 74, 105),
_PWG_MEDIA_MM("iso_a6_105x148mm", "iso-a6", "A6", 105, 148),
_PWG_MEDIA_MM("iso_a5_148x210mm", "iso-a5", "A5", 148, 210),
_PWG_MEDIA_MM("iso_a5-extra_174x235mm", NULL, "A5Extra", 174, 235),
_PWG_MEDIA_MM("iso_a4_210x297mm", "iso-a4", "A4", 210, 297),
_PWG_MEDIA_MM("iso_a4-tab_225x297mm", NULL, NULL, 225, 297),
_PWG_MEDIA_MM("iso_a4-extra_235.5x322.3mm", NULL, "A4Extra", 235.5, 322.3),
_PWG_MEDIA_MM("iso_a3_297x420mm", "iso-a3", "A3", 297, 420),
_PWG_MEDIA_MM("iso_a4x3_297x630mm", "iso-a4x3", NULL, 297, 630),
_PWG_MEDIA_MM("iso_a4x4_297x841mm", "iso-a4x4", NULL, 297, 841),
_PWG_MEDIA_MM("iso_a4x5_297x1051mm", "iso-a4x5", NULL, 297, 1051),
_PWG_MEDIA_MM("iso_a4x6_297x1261mm", "iso-a4x6", NULL, 297, 1261),
_PWG_MEDIA_MM("iso_a4x7_297x1471mm", "iso-a4x7", NULL, 297, 1471),
_PWG_MEDIA_MM("iso_a4x8_297x1682mm", "iso-a4x8", NULL, 297, 1682),
_PWG_MEDIA_MM("iso_a4x9_297x1892mm", "iso-a4x9", NULL, 297, 1892),
_PWG_MEDIA_MM("iso_a3-extra_322x445mm", "iso-a3-extra", "A3Extra", 322, 445),
_PWG_MEDIA_MM("iso_a2_420x594mm", "iso-a2", "A2", 420, 594),
_PWG_MEDIA_MM("iso_a3x3_420x891mm", "iso-a3x3", NULL, 420, 891),
_PWG_MEDIA_MM("iso_a3x4_420x1189mm", "iso-a3x4", NULL, 420, 1189),
_PWG_MEDIA_MM("iso_a3x5_420x1486mm", "iso-a3x5", NULL, 420, 1486),
_PWG_MEDIA_MM("iso_a3x6_420x1783mm", "iso-a3x6", NULL, 420, 1783),
_PWG_MEDIA_MM("iso_a3x7_420x2080mm", "iso-a3x7", NULL, 420, 2080),
_PWG_MEDIA_MM("iso_a1_594x841mm", "iso-a1", "A1", 594, 841),
_PWG_MEDIA_MM("iso_a2x3_594x1261mm", "iso-a2x3", NULL, 594, 1261),
_PWG_MEDIA_MM("iso_a2x4_594x1682mm", "iso-a2x4", NULL, 594, 1682),
_PWG_MEDIA_MM("iso_a2x5_594x2102mm", "iso-a2x5", NULL, 594, 2102),
_PWG_MEDIA_MM("iso_a0_841x1189mm", "iso-a0", "A0", 841, 1189),
_PWG_MEDIA_MM("iso_a1x3_841x1783mm", "iso-a1x3", NULL, 841, 1783),
_PWG_MEDIA_MM("iso_a1x4_841x2378mm", "iso-a1x4", NULL, 841, 2378),
_PWG_MEDIA_MM("iso_2a0_1189x1682mm", NULL, NULL, 1189, 1682),
_PWG_MEDIA_MM("iso_a0x3_1189x2523mm", NULL, NULL, 1189, 2523),
_PWG_MEDIA_MM("iso_b10_31x44mm", "iso-b10", "ISOB10", 31, 44),
_PWG_MEDIA_MM("iso_b9_44x62mm", "iso-b9", "ISOB9", 44, 62),
_PWG_MEDIA_MM("iso_b8_62x88mm", "iso-b8", "ISOB8", 62, 88),
_PWG_MEDIA_MM("iso_b7_88x125mm", "iso-b7", "ISOB7", 88, 125),
_PWG_MEDIA_MM("iso_b6_125x176mm", "iso-b6", "ISOB6", 125, 176),
_PWG_MEDIA_MM("iso_b6c4_125x324mm", NULL, NULL, 125, 324),
_PWG_MEDIA_MM("iso_b5_176x250mm", "iso-b5", "ISOB5", 176, 250),
_PWG_MEDIA_MM("iso_b5-extra_201x276mm", NULL, "ISOB5Extra", 201, 276),
_PWG_MEDIA_MM("iso_b4_250x353mm", "iso-b4", "ISOB4", 250, 353),
_PWG_MEDIA_MM("iso_b3_353x500mm", "iso-b3", "ISOB3", 353, 500),
_PWG_MEDIA_MM("iso_b2_500x707mm", "iso-b2", "ISOB2", 500, 707),
_PWG_MEDIA_MM("iso_b1_707x1000mm", "iso-b1", "ISOB1", 707, 1000),
_PWG_MEDIA_MM("iso_b0_1000x1414mm", "iso-b0", "ISOB0", 1000, 1414),
_PWG_MEDIA_MM("iso_c10_28x40mm", "iso-c10", NULL, 28, 40),
_PWG_MEDIA_MM("iso_c9_40x57mm", "iso-c9", NULL, 40, 57),
_PWG_MEDIA_MM("iso_c8_57x81mm", "iso-c8", NULL, 57, 81),
_PWG_MEDIA_MM("iso_c7_81x114mm", "iso-c7", "EnvC7", 81, 114),
_PWG_MEDIA_MM("iso_c7c6_81x162mm", NULL, NULL, 81, 162),
_PWG_MEDIA_MM("iso_c6_114x162mm", "iso-c6", "EnvC6", 114, 162),
_PWG_MEDIA_MM("iso_c6c5_114x229mm", NULL, "EnvC65", 114, 229),
_PWG_MEDIA_MM("iso_c5_162x229mm", "iso-c5", "EnvC5", 162, 229),
_PWG_MEDIA_MM("iso_c4_229x324mm", "iso-c4", "EnvC4", 229, 324),
_PWG_MEDIA_MM("iso_c3_324x458mm", "iso-c3", "EnvC3", 324, 458),
_PWG_MEDIA_MM("iso_c2_458x648mm", "iso-c2", "EnvC2", 458, 648),
_PWG_MEDIA_MM("iso_c1_648x917mm", "iso-c1", "EnvC1", 648, 917),
_PWG_MEDIA_MM("iso_c0_917x1297mm", "iso-c0", "EnvC0", 917, 1297),
_PWG_MEDIA_MM("iso_dl_110x220mm", "iso-designated", "EnvDL", 110, 220),
_PWG_MEDIA_MM("iso_ra2_430x610mm", "iso-ra2", NULL, 430, 610),
_PWG_MEDIA_MM("iso_sra2_450x640mm", "iso-sra2", NULL, 450, 640),
_PWG_MEDIA_MM("iso_ra1_610x860mm", "iso-ra1", NULL, 610, 860),
_PWG_MEDIA_MM("iso_sra1_640x900mm", "iso-sra1", NULL, 640, 900),
_PWG_MEDIA_MM("iso_ra0_860x1220mm", "iso-ra0", NULL, 860, 1220),
_PWG_MEDIA_MM("iso_sra0_900x1280mm", "iso-sra0", NULL, 900, 1280),
/* Japanese Standard Sheet Media Sizes */
_PWG_MEDIA_MM("jis_b10_32x45mm", "jis-b10", "B10", 32, 45),
_PWG_MEDIA_MM("jis_b9_45x64mm", "jis-b9", "B9", 45, 64),
_PWG_MEDIA_MM("jis_b8_64x91mm", "jis-b8", "B8", 64, 91),
_PWG_MEDIA_MM("jis_b7_91x128mm", "jis-b7", "B7", 91, 128),
_PWG_MEDIA_MM("jis_b6_128x182mm", "jis-b6", "B6", 128, 182),
_PWG_MEDIA_MM("jis_b5_182x257mm", "jis-b5", "B5", 182, 257),
_PWG_MEDIA_MM("jis_b4_257x364mm", "jis-b4", "B4", 257, 364),
_PWG_MEDIA_MM("jis_b3_364x515mm", "jis-b3", "B3", 364, 515),
_PWG_MEDIA_MM("jis_b2_515x728mm", "jis-b2", "B2", 515, 728),
_PWG_MEDIA_MM("jis_b1_728x1030mm", "jis-b1", "B1", 728, 1030),
_PWG_MEDIA_MM("jis_b0_1030x1456mm", "jis-b0", "B0", 1030, 1456),
_PWG_MEDIA_MM("jis_exec_216x330mm", NULL, NULL, 216, 330),
_PWG_MEDIA_MM("jpn_chou4_90x205mm", NULL, "EnvChou4", 90, 205),
_PWG_MEDIA_MM("jpn_hagaki_100x148mm", NULL, "Postcard", 100, 148),
_PWG_MEDIA_MM("jpn_you4_105x235mm", NULL, "EnvYou4", 105, 235),
_PWG_MEDIA_MM("jpn_chou2_111.1x146mm", NULL, NULL, 111.1, 146),
_PWG_MEDIA_MM("jpn_chou3_120x235mm", NULL, "EnvChou3", 120, 235),
_PWG_MEDIA_MM("jpn_oufuku_148x200mm", NULL, "DoublePostcardRotated", 148, 200),
_PWG_MEDIA_MM("jpn_kahu_240x322.1mm", NULL, NULL, 240, 322.1),
_PWG_MEDIA_MM("jpn_kaku2_240x332mm", NULL, "EnvKaku2", 240, 332),
/* Chinese Standard Sheet Media Sizes */
_PWG_MEDIA_MM("prc_32k_97x151mm", NULL, "PRC32K", 97, 151),
_PWG_MEDIA_MM("prc_1_102x165mm", NULL, "EnvPRC1", 102, 165),
_PWG_MEDIA_MM("prc_2_102x176mm", NULL, "EnvPRC2", 102, 176),
_PWG_MEDIA_MM("prc_4_110x208mm", NULL, "EnvPRC4", 110, 208),
_PWG_MEDIA_MM("prc_5_110x220mm", NULL, "EnvPRC5", 110, 220),
_PWG_MEDIA_MM("prc_8_120x309mm", NULL, "EnvPRC8", 120, 309),
_PWG_MEDIA_MM("prc_6_120x320mm", NULL, NULL, 120, 320),
_PWG_MEDIA_MM("prc_3_125x176mm", NULL, "EnvPRC3", 125, 176),
_PWG_MEDIA_MM("prc_16k_146x215mm", NULL, "PRC16K", 146, 215),
_PWG_MEDIA_MM("prc_7_160x230mm", NULL, "EnvPRC7", 160, 230),
_PWG_MEDIA_MM("om_juuro-ku-kai_198x275mm", NULL, NULL, 198, 275),
_PWG_MEDIA_MM("om_pa-kai_267x389mm", NULL, NULL, 267, 389),
_PWG_MEDIA_MM("om_dai-pa-kai_275x395mm", NULL, NULL, 275, 395),
_PWG_MEDIA_MM("prc_10_324x458mm", NULL, "EnvPRC10", 324, 458),
/* Other Metric Standard Sheet Media Sizes */
_PWG_MEDIA_MM("om_small-photo_100x150mm", NULL, NULL, 100, 150),
_PWG_MEDIA_MM("om_italian_110x230mm", NULL, "EnvItalian", 110, 230),
_PWG_MEDIA_MM("om_postfix_114x229mm", NULL, NULL, 114, 229),
_PWG_MEDIA_MM("om_large-photo_200x300", NULL, NULL, 200, 300),
_PWG_MEDIA_MM("om_folio_210x330mm", "folio", "Folio", 210, 330),
_PWG_MEDIA_MM("om_folio-sp_215x315mm", NULL, NULL, 215, 315),
_PWG_MEDIA_MM("om_invite_220x220mm", NULL, "EnvInvite", 220, 220)
};
/*
* '_pwgGenerateSize()' - Generate a PWG size keyword.
*/
void
_pwgGenerateSize(char *keyword, /* I - Keyword buffer */
size_t keysize, /* I - Size of keyword buffer */
const char *prefix, /* I - Prefix for PWG size or NULL */
const char *name, /* I - Size name or NULL */
int width, /* I - Width of page in 2540ths */
int length) /* I - Length of page in 2540ths */
{
struct lconv *loc; /* Locale conversion data */
double uwidth, /* Width in inches or millimeters */
ulength; /* Height in inches or millimeters */
const char *units; /* Units to report */
char usize[12 + 1 + 12 + 3], /* Unit size: NNNNNNNNNNNNxNNNNNNNNNNNNuu */
*uptr; /* Pointer into unit size */
loc = localeconv();
if ((width % 635) == 0 && (length % 635) == 0)
{
/*
* Use inches since the size is a multiple of 1/4 inch.
*/
uwidth = width / 2540.0;
ulength = length / 2540.0;
units = "in";
if (!prefix)
prefix = "oe";
}
else
{
/*
* Use millimeters since the size is not a multiple of 1/4 inch.
*/
uwidth = width * 0.01;
ulength = length * 0.01;
units = "mm";
if (!prefix)
prefix = "om";
}
uptr = usize;
_cupsStrFormatd(uptr, uptr + 12, uwidth, loc);
uptr += strlen(uptr);
*uptr++ = 'x';
_cupsStrFormatd(uptr, uptr + 12, ulength, loc);
uptr += strlen(uptr);
/*
* Safe because usize can hold up to 12 + 1 + 12 + 4 bytes.
*/
strcpy(uptr, units);
if (!name)
name = usize;
/*
* Format the name...
*/
snprintf(keyword, keysize, "%s_%s_%s", prefix, name, usize);
}
/*
* '_pwgInitSize()' - Initialize a PWG size using IPP job template attributes.
*/
int /* O - 1 if size was initialize, 0 otherwise */
_pwgInitSize(_pwg_size_t *size, /* I - Size to initialize */
ipp_t *job, /* I - Job template attributes */
int *margins_set) /* O - 1 if margins were set, 0 otherwise */
{
ipp_attribute_t *media, /* media attribute */
*media_bottom_margin, /* media-bottom-margin member attribute */
*media_col, /* media-col attribute */
*media_left_margin, /* media-left-margin member attribute */
*media_right_margin, /* media-right-margin member attribute */
*media_size, /* media-size member attribute */
*media_top_margin, /* media-top-margin member attribute */
*x_dimension, /* x-dimension member attribute */
*y_dimension; /* y-dimension member attribute */
_pwg_media_t *pwg; /* PWG media value */
/*
* Range check input...
*/
if (!size || !job || !margins_set)
return (0);
/*
* Look for media-col and then media...
*/
memset(size, 0, sizeof(_pwg_size_t));
*margins_set = 0;
if ((media_col = ippFindAttribute(job, "media-col",
IPP_TAG_BEGIN_COLLECTION)) != NULL)
{
/*
* Got media-col, look for media-size member attribute...
*/
if ((media_size = ippFindAttribute(media_col->values[0].collection,
"media-size",
IPP_TAG_BEGIN_COLLECTION)) != NULL)
{
/*
* Got media-size, look for x-dimension and y-dimension member
* attributes...
*/
x_dimension = ippFindAttribute(media_size->values[0].collection,
"x-dimension", IPP_TAG_INTEGER);
y_dimension = ippFindAttribute(media_size->values[0].collection,
"y-dimension", IPP_TAG_INTEGER);
if (x_dimension && y_dimension)
{
size->width = x_dimension->values[0].integer;
size->length = y_dimension->values[0].integer;
}
else if (!x_dimension)
{
_cupsSetError(IPP_INTERNAL_ERROR,
_("Missing x-dimension in media-size."), 1);
return (0);
}
else if (!y_dimension)
{
_cupsSetError(IPP_INTERNAL_ERROR,
_("Missing y-dimension in media-size."), 1);
return (0);
}
}
else
{
_cupsSetError(IPP_INTERNAL_ERROR, _("Missing media-size in media-col."),
1);
return (0);
}
/* media-*-margin */
media_bottom_margin = ippFindAttribute(media_col->values[0].collection,
"media-bottom-margin",
IPP_TAG_INTEGER);
media_left_margin = ippFindAttribute(media_col->values[0].collection,
"media-left-margin",
IPP_TAG_INTEGER);
media_right_margin = ippFindAttribute(media_col->values[0].collection,
"media-right-margin",
IPP_TAG_INTEGER);
media_top_margin = ippFindAttribute(media_col->values[0].collection,
"media-top-margin",
IPP_TAG_INTEGER);
if (media_bottom_margin && media_left_margin && media_right_margin &&
media_top_margin)
{
*margins_set = 1;
size->bottom = media_bottom_margin->values[0].integer;
size->left = media_left_margin->values[0].integer;
size->right = media_right_margin->values[0].integer;
size->top = media_top_margin->values[0].integer;
}
}
else
{
if ((media = ippFindAttribute(job, "media", IPP_TAG_NAME)) == NULL)
media = ippFindAttribute(job, "media", IPP_TAG_KEYWORD);
if (media)
{
if ((pwg = _pwgMediaForPWG(media->values[0].string.text)) == NULL)
pwg = _pwgMediaForLegacy(media->values[0].string.text);
if (pwg)
{
size->width = pwg->width;
size->length = pwg->length;
}
else
{
_cupsSetError(IPP_INTERNAL_ERROR, _("Unsupported media value."), 1);
return (0);
}
}
else
{
_cupsSetError(IPP_INTERNAL_ERROR, _("Missing media or media-col."), 1);
return (0);
}
}
return (1);
}
/*
* '_pwgMediaForLegacy()' - Find a PWG media size by ISO/IPP legacy name.
*/
_pwg_media_t * /* O - Matching size or NULL */
_pwgMediaForLegacy(
const char *legacy) /* I - Legacy size name */
{
_pwg_media_t key; /* Search key */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
/*
* Range check input...
*/
if (!legacy)
return (NULL);
/*
* Build the lookup table for PWG names as needed...
*/
if (!cg->leg_size_lut)
{
int i; /* Looping var */
_pwg_media_t *size; /* Current size */
cg->leg_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_legacy,
NULL);
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
size = (_pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
if (size->legacy)
cupsArrayAdd(cg->leg_size_lut, size);
}
/*
* Lookup the name...
*/
key.legacy = legacy;
return ((_pwg_media_t *)cupsArrayFind(cg->leg_size_lut, &key));
}
/*
* '_pwgMediaForPPD()' - Find a PWG media size by Adobe PPD name.
*/
_pwg_media_t * /* O - Matching size or NULL */
_pwgMediaForPPD(const char *ppd) /* I - PPD size name */
{
_pwg_media_t key; /* Search key */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
/*
* Range check input...
*/
if (!ppd)
return (NULL);
/*
* Build the lookup table for PWG names as needed...
*/
if (!cg->ppd_size_lut)
{
int i; /* Looping var */
_pwg_media_t *size; /* Current size */
cg->ppd_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_ppd, NULL);
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
size = (_pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
if (size->ppd)
cupsArrayAdd(cg->ppd_size_lut, size);
}
/*
* Lookup the name...
*/
key.ppd = ppd;
return ((_pwg_media_t *)cupsArrayFind(cg->ppd_size_lut, &key));
}
/*
* '_pwgMediaForPWG()' - Find a PWG media size by 5101.1 self-describing name.
*/
_pwg_media_t * /* O - Matching size or NULL */
_pwgMediaForPWG(const char *pwg) /* I - PWG size name */
{
_pwg_media_t key; /* Search key */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
/*
* Range check input...
*/
if (!pwg)
return (NULL);
/*
* Build the lookup table for PWG names as needed...
*/
if (!cg->pwg_size_lut)
{
int i; /* Looping var */
_pwg_media_t *size; /* Current size */
cg->pwg_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_pwg, NULL);
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
size = (_pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
cupsArrayAdd(cg->pwg_size_lut, size);
}
/*
* Lookup the name...
*/
key.pwg = pwg;
return ((_pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key));
}
/*
* '_pwgMediaForSize()' - Get the PWG media name for a given size.
*/
_pwg_media_t * /* O - PWG media name */
_pwgMediaForSize(int width, /* I - Width in 2540ths */
int length) /* I - Length in 2540ths */
{
int i; /* Looping var */
_pwg_media_t *media; /* Current media */
int dw, dl; /* Difference in width and length */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
/*
* Range check input...
*/
if (width <= 0 || length <= 0)
return (NULL);
/*
* Look for a standard size...
*/
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
media = (_pwg_media_t *)cups_pwg_media;
i > 0;
i --, media ++)
{
/*
* Adobe uses a size matching algorithm with an epsilon of 5 points, which
* is just about 176/2540ths...
*/
dw = media->width - width;
dl = media->length - length;
if (dw > -176 && dw < 176 && dl > -176 && dl < 176)
return (media);
}
/*
* Not a standard size; convert it to a PWG custom name of the form:
*
* custom_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu
*/
_pwgGenerateSize(cg->pwg_name, sizeof(cg->pwg_name), "custom", NULL, width,
length);
cg->pwg_media.pwg = cg->pwg_name;
cg->pwg_media.width = width;
cg->pwg_media.length = length;
return (&(cg->pwg_media));
}
/*
* 'pwg_compare_legacy()' - Compare two sizes using the legacy names.
*/
static int /* O - Result of comparison */
pwg_compare_legacy(_pwg_media_t *a, /* I - First size */
_pwg_media_t *b) /* I - Second size */
{
return (strcmp(a->legacy, b->legacy));
}
/*
* 'pwg_compare_ppd()' - Compare two sizes using the PPD names.
*/
static int /* O - Result of comparison */
pwg_compare_ppd(_pwg_media_t *a, /* I - First size */
_pwg_media_t *b) /* I - Second size */
{
return (strcmp(a->ppd, b->ppd));
}
/*
* 'pwg_compare_pwg()' - Compare two sizes using the PWG names.
*/
static int /* O - Result of comparison */
pwg_compare_pwg(_pwg_media_t *a, /* I - First size */
_pwg_media_t *b) /* I - Second size */
{
return (strcmp(a->pwg, b->pwg));
}
/*
* End of "$Id$".
*/
-1071
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
-143
Ver Arquivo
@@ -1,143 +0,0 @@
/*
* "$Id$"
*
* Private PWG media API definitions for CUPS.
*
* Copyright 2009-2010 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_PWG_PRIVATE_H_
# define _CUPS_PWG_PRIVATE_H_
/*
* Include necessary headers...
*/
# include <cups/cups.h>
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Macros...
*/
/* Convert from points to 2540ths */
# define _PWG_FROMPTS(n) (int)((n) * 2540 / 72)
/* Convert from 2540ths to points */
# define _PWG_TOPTS(n) ((n) * 72.0 / 2540.0)
/*
* Types and structures...
*/
typedef struct _pwg_media_s /**** Common media size data ****/
{
const char *pwg, /* PWG 5101.1 "self describing" name */
*legacy, /* IPP/ISO legacy name */
*ppd; /* Standard Adobe PPD name */
int width, /* Width in 2540ths */
length; /* Length in 2540ths */
} _pwg_media_t;
typedef struct _pwg_map_s /**** Map element - PPD to/from PWG */
{
char *pwg, /* PWG media keyword */
*ppd; /* PPD option keyword */
} _pwg_map_t;
typedef struct _pwg_size_s /**** Size element - PPD to/from PWG */
{
_pwg_map_t map; /* Map element */
int width, /* Width in 2540ths */
length, /* Length in 2540ths */
left, /* Left margin in 2540ths */
bottom, /* Bottom margin in 2540ths */
right, /* Right margin in 2540ths */
top; /* Top margin in 2540ths */
} _pwg_size_t;
typedef struct _pwg_s /**** PWG-PPD conversion data ****/
{
int num_bins; /* Number of output bins */
_pwg_map_t *bins; /* Output bins */
int num_sizes; /* Number of media sizes */
_pwg_size_t *sizes; /* Media sizes */
int custom_max_width, /* Maximum custom width in 2540ths */
custom_max_length, /* Maximum custom length in 2540ths */
custom_min_width, /* Minimum custom width in 2540ths */
custom_min_length; /* Minimum custom length in 2540ths */
char *custom_max_keyword, /* Maximum custom size PWG keyword */
*custom_min_keyword, /* Minimum custom size PWG keyword */
custom_ppd_size[41]; /* Custom PPD size name */
_pwg_size_t custom_size; /* Custom size record */
int num_sources; /* Number of media sources */
_pwg_map_t *sources; /* Media sources */
int num_types; /* Number of media types */
_pwg_map_t *types; /* Media types */
} _pwg_t;
/*
* Functions...
*/
extern _pwg_t *_pwgCreateWithFile(const char *filename);
extern _pwg_t *_pwgCreateWithPPD(ppd_file_t *ppd);
extern void _pwgDestroy(_pwg_t *pwg);
extern void _pwgGenerateSize(char *keyword, size_t keysize,
const char *prefix,
const char *ppdname,
int width, int length);
extern const char *_pwgGetBin(_pwg_t *pwg, const char *output_bin);
extern const char *_pwgGetInputSlot(_pwg_t *pwg, ipp_t *job,
const char *keyword);
extern const char *_pwgGetMediaType(_pwg_t *pwg, ipp_t *job,
const char *keyword);
extern const char *_pwgGetOutputBin(_pwg_t *pwg, const char *keyword);
extern const char *_pwgGetPageSize(_pwg_t *pwg, ipp_t *job,
const char *keyword, int *exact);
extern _pwg_size_t *_pwgGetSize(_pwg_t *pwg, const char *page_size);
extern const char *_pwgGetSource(_pwg_t *pwg, const char *input_slot);
extern const char *_pwgGetType(_pwg_t *pwg, const char *media_type);
extern int _pwgInitSize(_pwg_size_t *size, ipp_t *job,
int *margins_set);
extern const char *_pwgInputSlotForSource(const char *media_source,
char *name, size_t namesize);
extern _pwg_media_t *_pwgMediaForLegacy(const char *legacy);
extern _pwg_media_t *_pwgMediaForPPD(const char *ppd);
extern _pwg_media_t *_pwgMediaForPWG(const char *pwg);
extern _pwg_media_t *_pwgMediaForSize(int width, int length);
extern const char *_pwgMediaTypeForType(const char *media_source,
char *name, size_t namesize);
extern const char *_pwgPageSizeForMedia(_pwg_media_t *media,
char *name, size_t namesize);
extern int _pwgWriteFile(_pwg_t *pwg, const char *filename);
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_PWG_PRIVATE_H_ */
/*
* End of "$Id$".
*/
+376
Ver Arquivo
@@ -0,0 +1,376 @@
/*
* "$Id$"
*
* PWG media name API implementation for the Common UNIX Printing System
* (CUPS).
*
* Copyright 2009 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* _cupsPWGMediaByLegacy() - Find a PWG media size by ISO/IPP legacy name.
* _cupsPWGMediaByName() - Find a PWG media size by 5101.1 self-describing
* name.
* _cupsPWGMediaBySize() - Find a PWG media size by size in points.
* compare_legacy() - Compare two sizes using the legacy names.
* compare_pwg() - Compare two sizes using the PWG names.
*/
/*
* Include necessary headers...
*/
#include "pwgmedia.h"
#include "globals.h"
#include "string.h"
#include "debug.h"
#include <math.h>
/*
* Local macros...
*/
#define _CUPS_SIZE_IN(p,l,x,y) {p, l, x * 72.0, y * 72.0}
#define _CUPS_SIZE_MM(p,l,x,y) {p, l, x / 25.4 * 72.0, y / 25.4 * 72.0}
/*
* Local functions...
*/
static int compare_legacy(_cups_pwg_media_t *a, _cups_pwg_media_t *b);
static int compare_pwg(_cups_pwg_media_t *a, _cups_pwg_media_t *b);
/*
* Local globals...
*/
static _cups_pwg_media_t const cups_pwg_media[] =
{ /* Media size lookup table */
/* North American Standard Sheet Media Sizes */
_CUPS_SIZE_IN("na_index-3x5_3x5in", NULL, 3, 5),
_CUPS_SIZE_IN("na_personal_3.625x6.5in", NULL, 3.625, 6.5),
_CUPS_SIZE_IN("na_monarch_3.875x7.5in", "monarch-envelope", 3.875, 7.5),
_CUPS_SIZE_IN("na_number-9_3.875x8.875in", "na-number-9-envelope", 3.875, 8.875),
_CUPS_SIZE_IN("na_index-4x6_4x6in", NULL, 4, 6),
_CUPS_SIZE_IN("na_number-10_4.125x9.5in", "na-number-10-envelope", 4.125, 9.5),
_CUPS_SIZE_IN("na_a2_4.375x5.75in", NULL, 4.375, 5.75),
_CUPS_SIZE_IN("na_number-11_4.5x10.375in", NULL, 4.5, 10.375),
_CUPS_SIZE_IN("na_number-12_4.75x11in", NULL, 4.75, 11),
_CUPS_SIZE_IN("na_5x7_5x7in", NULL, 5, 7),
_CUPS_SIZE_IN("na_index-5x8_5x8in", NULL, 5, 8),
_CUPS_SIZE_IN("na_number-14_5x11.5in", NULL, 5, 11.5),
_CUPS_SIZE_IN("na_invoice_5.5x8.5in", "invoice", 5.5, 8.5),
_CUPS_SIZE_IN("na_index-4x6-ext_6x8in", NULL, 6, 8),
_CUPS_SIZE_IN("na_6x9_6x9in", "na-6x9-envelope", 6, 9),
_CUPS_SIZE_IN("na_c5_6.5x9.5in", NULL, 6.5, 9.5),
_CUPS_SIZE_IN("na_7x9_7x9in", "na-7x9-envelope", 7, 9),
_CUPS_SIZE_IN("na_executive_7.25x10.5in", "executive", 7.25, 10.5),
_CUPS_SIZE_IN("na_govt-letter_8x10in", "na-8x10", 8, 10),
_CUPS_SIZE_IN("na_govt-legal_8x13in", NULL, 8, 13),
_CUPS_SIZE_IN("na_quarto_8.5x10.83in", "quarto", 8.5, 10.83),
_CUPS_SIZE_IN("na_letter_8.5x11in", "na-letter", 8.5, 11),
_CUPS_SIZE_IN("na_fanfold-eur_8.5x12in", NULL, 8.5, 12),
_CUPS_SIZE_IN("na_letter-plus_8.5x12.69in", NULL, 8.5, 12.69),
_CUPS_SIZE_IN("na_foolscap_8.5x13in", NULL, 8.5, 13),
_CUPS_SIZE_IN("na_legal_8.5x14in", "na-legal", 8.5, 14),
_CUPS_SIZE_IN("na_super-a_8.94x14in", NULL, 8.94, 14),
_CUPS_SIZE_IN("na_9x11_9x11in", "na-9x11-envelope", 9, 11),
_CUPS_SIZE_IN("na_arch-a_9x12in", "arch-a", 9, 12),
_CUPS_SIZE_IN("na_letter-extra_9.5x12in", NULL, 9.5, 12),
_CUPS_SIZE_IN("na_legal-extra_9.5x15in", NULL, 9.5, 15),
_CUPS_SIZE_IN("na_10x11_10x11in", NULL, 10, 11),
_CUPS_SIZE_IN("na_10x13_10x13in", "na-10x13-envelope", 10, 13),
_CUPS_SIZE_IN("na_10x14_10x14in", "na-10x14-envelope", 10, 14),
_CUPS_SIZE_IN("na_10x15_10x15in", "na-10x15-envelope", 10, 15),
_CUPS_SIZE_IN("na_11x12_11x12in", NULL, 11, 12),
_CUPS_SIZE_IN("na_edp_11x14in", NULL, 11, 14),
_CUPS_SIZE_IN("na_fanfold-us_11x14.875in", NULL, 11, 14.875),
_CUPS_SIZE_IN("na_11x15_11x15in", NULL, 11, 15),
_CUPS_SIZE_IN("na_ledger_11x17in", "tabloid", 11, 17),
_CUPS_SIZE_IN("na_eur-edp_12x14in", NULL, 12, 14),
_CUPS_SIZE_IN("na_arch-b_12x18in", "arch-b", 12, 18),
_CUPS_SIZE_IN("na_12x19_12x19in", NULL, 12, 19),
_CUPS_SIZE_IN("na_b-plus_12x19.17in", NULL, 12, 19.17),
_CUPS_SIZE_IN("na_super-b_13x19in", NULL, 13, 19),
_CUPS_SIZE_IN("na_c_17x22in", "c", 17, 22),
_CUPS_SIZE_IN("na_arch-c_18x24in", "arch-c", 18, 24),
_CUPS_SIZE_IN("na_d_22x34in", "d", 22, 34),
_CUPS_SIZE_IN("na_arch-d_24x36in", "arch-d", 24, 36),
_CUPS_SIZE_IN("asme_f_28x40in", "f", 28, 40),
_CUPS_SIZE_IN("na_wide-format_30x42in", NULL, 30, 42),
_CUPS_SIZE_IN("na_e_34x44in", "e", 34, 44),
_CUPS_SIZE_IN("na_arch-e_36x48in", "arch-e", 36, 48),
_CUPS_SIZE_IN("na_f_44x68in", NULL, 44, 68),
/* Chinese Standard Sheet Media Inch Sizes */
_CUPS_SIZE_IN("roc_16k_7.75x10.75in", NULL, 7.75, 10.75),
_CUPS_SIZE_IN("roc_8k_10.75x15.5in", NULL, 10.75, 15.5),
/* ISO Standard Sheet Media Sizes */
_CUPS_SIZE_MM("iso_a10_26x37mm", "iso-a10", 26, 37),
_CUPS_SIZE_MM("iso_a9_37x52mm", "iso-a9", 37, 52),
_CUPS_SIZE_MM("iso_a8_52x74mm", "iso-a8", 52, 74),
_CUPS_SIZE_MM("iso_a7_74x105mm", "iso-a7", 74, 105),
_CUPS_SIZE_MM("iso_a6_105x148mm", "iso-a6", 105, 148),
_CUPS_SIZE_MM("iso_a5_148x210mm", "iso-a5", 148, 210),
_CUPS_SIZE_MM("iso_a5-extra_174x235mm", NULL, 174, 235),
_CUPS_SIZE_MM("iso_a4_210x297mm", "iso-a4", 210, 297),
_CUPS_SIZE_MM("iso_a4-tab_225x297mm", NULL, 225, 297),
_CUPS_SIZE_MM("iso_a4-extra_235.5x322.3mm", NULL, 235.5, 322.3),
_CUPS_SIZE_MM("iso_a3_297x420mm", "iso-a3", 297, 420),
_CUPS_SIZE_MM("iso_a4x3_297x630mm", "iso-a4x3", 297, 630),
_CUPS_SIZE_MM("iso_a4x4_297x841mm", "iso-a4x4", 297, 841),
_CUPS_SIZE_MM("iso_a4x5_297x1051mm", "iso-a4x5", 297, 1051),
_CUPS_SIZE_MM("iso_a4x6_297x1261mm", "iso-a4x6", 297, 1261),
_CUPS_SIZE_MM("iso_a4x7_297x1471mm", "iso-a4x7", 297, 1471),
_CUPS_SIZE_MM("iso_a4x8_297x1682mm", "iso-a4x8", 297, 1682),
_CUPS_SIZE_MM("iso_a4x9_297x1892mm", "iso-a4x9", 297, 1892),
_CUPS_SIZE_MM("iso_a3-extra_322x445mm", "iso-a3-extra", 322, 445),
_CUPS_SIZE_MM("iso_a2_420x594mm", "iso-a2", 420, 594),
_CUPS_SIZE_MM("iso_a3x3_420x891mm", "iso-a3x3", 420, 891),
_CUPS_SIZE_MM("iso_a3x4_420x1189mm", "iso-a3x4", 420, 1189),
_CUPS_SIZE_MM("iso_a3x5_420x1486mm", "iso-a3x5", 420, 1486),
_CUPS_SIZE_MM("iso_a3x6_420x1783mm", "iso-a3x6", 420, 1783),
_CUPS_SIZE_MM("iso_a3x7_420x2080mm", "iso-a3x7", 420, 2080),
_CUPS_SIZE_MM("iso_a1_594x841mm", "iso-a1", 594, 841),
_CUPS_SIZE_MM("iso_a2x3_594x1261mm", "iso-a2x3", 594, 1261),
_CUPS_SIZE_MM("iso_a2x4_594x1682mm", "iso-a2x4", 594, 1682),
_CUPS_SIZE_MM("iso_a2x5_594x2102mm", "iso-a2x5", 594, 2102),
_CUPS_SIZE_MM("iso_a0_841x1189mm", "iso-a0", 841, 1189),
_CUPS_SIZE_MM("iso_a1x3_841x1783mm", "iso-a1x3", 841, 1783),
_CUPS_SIZE_MM("iso_a1x4_841x2378mm", "iso-a1x4", 841, 2378),
_CUPS_SIZE_MM("iso_2a0_1189x1682mm", NULL, 1189, 1682),
_CUPS_SIZE_MM("iso_a0x3_1189x2523mm", NULL, 1189, 2523),
_CUPS_SIZE_MM("iso_b10_31x44mm", "iso-b10", 31, 44),
_CUPS_SIZE_MM("iso_b9_44x62mm", "iso-b9", 44, 62),
_CUPS_SIZE_MM("iso_b8_62x88mm", "iso-b8", 62, 88),
_CUPS_SIZE_MM("iso_b7_88x125mm", "iso-b7", 88, 125),
_CUPS_SIZE_MM("iso_b6_125x176mm", "iso-b6", 125, 176),
_CUPS_SIZE_MM("iso_b6c4_125x324mm", NULL, 125, 324),
_CUPS_SIZE_MM("iso_b5_176x250mm", "iso-b5", 176, 250),
_CUPS_SIZE_MM("iso_b5-extra_201x276mm", NULL, 201, 276),
_CUPS_SIZE_MM("iso_b4_250x353mm", "iso-b4", 250, 353),
_CUPS_SIZE_MM("iso_b3_353x500mm", "iso-b3", 353, 500),
_CUPS_SIZE_MM("iso_b2_500x707mm", "iso-b2", 500, 707),
_CUPS_SIZE_MM("iso_b1_707x1000mm", "iso-b1", 707, 1000),
_CUPS_SIZE_MM("iso_b0_1000x1414mm", "iso-b0", 1000, 1414),
_CUPS_SIZE_MM("iso_c10_28x40mm", "iso-c10", 28, 40),
_CUPS_SIZE_MM("iso_c9_40x57mm", "iso-c9", 40, 57),
_CUPS_SIZE_MM("iso_c8_57x81mm", "iso-c8", 57, 81),
_CUPS_SIZE_MM("iso_c7_81x114mm", "iso-c7", 81, 114),
_CUPS_SIZE_MM("iso_c7c6_81x162mm", NULL, 81, 162),
_CUPS_SIZE_MM("iso_c6_114x162mm", "iso-c6", 114, 162),
_CUPS_SIZE_MM("iso_c6c5_114x229mm", NULL, 114, 229),
_CUPS_SIZE_MM("iso_c5_162x229mm", "iso-c5", 162, 229),
_CUPS_SIZE_MM("iso_c4_229x324mm", "iso-c4", 229, 324),
_CUPS_SIZE_MM("iso_c3_324x458mm", "iso-c3", 324, 458),
_CUPS_SIZE_MM("iso_c2_458x648mm", "iso-c2", 458, 648),
_CUPS_SIZE_MM("iso_c1_648x917mm", "iso-c1", 648, 917),
_CUPS_SIZE_MM("iso_c0_917x1297mm", "iso-c0", 917, 1297),
_CUPS_SIZE_MM("iso_dl_110x220mm", "iso-designated", 110, 220),
_CUPS_SIZE_MM("iso_ra2_430x610mm", "iso-ra2", 430, 610),
_CUPS_SIZE_MM("iso_sra2_450x640mm", "iso-sra2", 450, 640),
_CUPS_SIZE_MM("iso_ra1_610x860mm", "iso-ra1", 610, 860),
_CUPS_SIZE_MM("iso_sra1_640x900mm", "iso-sra1", 640, 900),
_CUPS_SIZE_MM("iso_ra0_860x1220mm", "iso-ra0", 860, 1220),
_CUPS_SIZE_MM("iso_sra0_900x1280mm", "iso-sra0", 900, 1280),
/* Japanese Standard Sheet Media Sizes */
_CUPS_SIZE_MM("jis_b10_32x45mm", "jis-b10", 32, 45),
_CUPS_SIZE_MM("jis_b9_45x64mm", "jis-b9", 45, 64),
_CUPS_SIZE_MM("jis_b8_64x91mm", "jis-b8", 64, 91),
_CUPS_SIZE_MM("jis_b7_91x128mm", "jis-b7", 91, 128),
_CUPS_SIZE_MM("jis_b6_128x182mm", "jis-b6", 128, 182),
_CUPS_SIZE_MM("jis_b5_182x257mm", "jis-b5", 182, 257),
_CUPS_SIZE_MM("jis_b4_257x364mm", "jis-b4", 257, 364),
_CUPS_SIZE_MM("jis_b3_364x515mm", "jis-b3", 364, 515),
_CUPS_SIZE_MM("jis_b2_515x728mm", "jis-b2", 515, 728),
_CUPS_SIZE_MM("jis_b1_728x1030mm", "jis-b1", 728, 1030),
_CUPS_SIZE_MM("jis_b0_1030x1456mm", "jis-b0", 1030, 1456),
_CUPS_SIZE_MM("jis_exec_216x330mm", NULL, 216, 330),
_CUPS_SIZE_MM("jpn_chou4_90x205mm", NULL, 90, 205),
_CUPS_SIZE_MM("jpn_hagaki_100x148mm", NULL, 100, 148),
_CUPS_SIZE_MM("jpn_you4_105x235mm", NULL, 105, 235),
_CUPS_SIZE_MM("jpn_chou2_111.1x146mm", NULL, 111.1, 146),
_CUPS_SIZE_MM("jpn_chou3_120x235mm", NULL, 120, 235),
_CUPS_SIZE_MM("jpn_oufuku_148x200mm", NULL, 148, 200),
_CUPS_SIZE_MM("jpn_kahu_240x322.1mm", NULL, 240, 322.1),
_CUPS_SIZE_MM("jpn_kaku2_240x332mm", NULL, 240, 332),
/* Chinese Standard Sheet Media Sizes */
_CUPS_SIZE_MM("prc_32k_97x151mm", NULL, 97, 151),
_CUPS_SIZE_MM("prc_1_102x165mm", NULL, 102, 165),
_CUPS_SIZE_MM("prc_2_102x176mm", NULL, 102, 176),
_CUPS_SIZE_MM("prc_4_110x208mm", NULL, 110, 208),
_CUPS_SIZE_MM("prc_5_110x220mm", NULL, 110, 220),
_CUPS_SIZE_MM("prc_8_120x309mm", NULL, 120, 309),
_CUPS_SIZE_MM("prc_6_120x320mm", NULL, 120, 320),
_CUPS_SIZE_MM("prc_3_125x176mm", NULL, 125, 176),
_CUPS_SIZE_MM("prc_16k_146x215mm", NULL, 146, 215),
_CUPS_SIZE_MM("prc_7_160x230mm", NULL, 160, 230),
_CUPS_SIZE_MM("om_juuro-ku-kai_198x275mm", NULL, 198, 275),
_CUPS_SIZE_MM("om_pa-kai_267x389mm", NULL, 267, 389),
_CUPS_SIZE_MM("om_dai-pa-kai_275x395mm", NULL, 275, 395),
_CUPS_SIZE_MM("prc_10_324x458mm", NULL, 324, 458),
/* Other Metric Standard Sheet Media Sizes */
_CUPS_SIZE_MM("om_small-photo_100x150mm", NULL, 100, 150),
_CUPS_SIZE_MM("om_italian_110x230mm", NULL, 110, 230),
_CUPS_SIZE_MM("om_postfix_114x229mm", NULL, 114, 229),
_CUPS_SIZE_MM("om_large-photo_200x300", NULL, 200, 300),
_CUPS_SIZE_MM("om_folio_210x330mm", "folio", 210, 330),
_CUPS_SIZE_MM("om_folio-sp_215x315mm", NULL, 215, 315),
_CUPS_SIZE_MM("om_invite_220x220mm", NULL, 220, 220)
};
/*
* '_cupsPWGMediaByLegacy()' - Find a PWG media size by ISO/IPP legacy name.
*/
_cups_pwg_media_t * /* O - Matching size or NULL */
_cupsPWGMediaByLegacy(
const char *legacy) /* I - Legacy size name */
{
_cups_pwg_media_t key; /* Search key */
_cups_globals_t *cg = _cupsGlobals();
/* Global data */
/*
* Build the lookup table for PWG names as needed...
*/
if (!cg->leg_size_lut)
{
int i; /* Looping var */
_cups_pwg_media_t *size; /* Current size */
cg->leg_size_lut = cupsArrayNew((cups_array_func_t)compare_legacy, NULL);
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
size = (_cups_pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
if (size->legacy)
cupsArrayAdd(cg->leg_size_lut, size);
}
/*
* Lookup the name...
*/
key.legacy = legacy;
return ((_cups_pwg_media_t *)cupsArrayFind(cg->leg_size_lut, &key));
}
/*
* '_cupsPWGMediaByName()' - Find a PWG media size by 5101.1 self-describing
* name.
*/
_cups_pwg_media_t * /* O - Matching size or NULL */
_cupsPWGMediaByName(const char *pwg) /* I - PWG size name */
{
_cups_pwg_media_t key; /* Search key */
_cups_globals_t *cg = _cupsGlobals();
/* Global data */
/*
* Build the lookup table for PWG names as needed...
*/
if (!cg->pwg_size_lut)
{
int i; /* Looping var */
_cups_pwg_media_t *size; /* Current size */
cg->pwg_size_lut = cupsArrayNew((cups_array_func_t)compare_pwg, NULL);
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
size = (_cups_pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
cupsArrayAdd(cg->pwg_size_lut, size);
}
/*
* Lookup the name...
*/
key.pwg = pwg;
return ((_cups_pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key));
}
/*
* '_cupsPWGMediaBySize()' - Find a PWG media size by size in points.
*/
_cups_pwg_media_t * /* O - Matching size or NULL */
_cupsPWGMediaBySize(double width, /* I - Width in points */
double length) /* I - Length in points */
{
int i; /* Looping var */
_cups_pwg_media_t *size; /* Current size */
double dw, dl; /* Difference in width and length */
for (i = (int)(sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0])),
size = (_cups_pwg_media_t *)cups_pwg_media;
i > 0;
i --, size ++)
{
/*
* Adobe uses a size matching algorithm with an epsilon of 5 points...
*/
dw = size->width - width;
dl = size->length - length;
if (dw > -5.0 && dw < 5.0 && dl > -5.0 && dl < 5.0)
return (size);
}
return (NULL);
}
/*
* 'compare_legacy()' - Compare two sizes using the legacy names.
*/
static int /* O - Result of comparison */
compare_legacy(_cups_pwg_media_t *a, /* I - First size */
_cups_pwg_media_t *b) /* I - Second size */
{
return (strcmp(a->legacy, b->legacy));
}
/*
* 'compare_pwg()' - Compare two sizes using the PWG names.
*/
static int /* O - Result of comparison */
compare_pwg(_cups_pwg_media_t *a, /* I - First size */
_cups_pwg_media_t *b) /* I - Second size */
{
return (strcmp(a->pwg, b->pwg));
}
/*
* End of "$Id$".
*/
+59
Ver Arquivo
@@ -0,0 +1,59 @@
/*
* "$Id$"
*
* PWG media name API definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 2009 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
#ifndef _CUPS_PWGMEDIA_H_
# define _CUPS_PWGMEDIA_H_
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Types and structures...
*/
typedef struct _cups_pwg_media_s /**** Common media size data ****/
{
const char *pwg, /* PWG 5101.1 "self describing" name */
*legacy; /* IPP/ISO legacy name */
double width, /* Width in points */
length; /* Length in points */
} _cups_pwg_media_t;
/*
* Functions...
*/
extern _cups_pwg_media_t *_cupsPWGMediaByLegacy(const char *legacy);
extern _cups_pwg_media_t *_cupsPWGMediaByName(const char *pwg);
extern _cups_pwg_media_t *_cupsPWGMediaBySize(double width,
double length);
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_PWGMEDIA_H_ */
/*
* End of "$Id$".
*/
+19 -30
Ver Arquivo
@@ -3,7 +3,7 @@
*
* IPP utilities for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -263,15 +263,14 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
response = cupsGetResponse(http, resource);
status = http->status;
}
else
httpFlush(http);
DEBUG_printf(("2cupsDoIORequest: status=%d", status));
if (status == HTTP_ERROR ||
(status >= HTTP_BAD_REQUEST && status != HTTP_UNAUTHORIZED &&
status != HTTP_UPGRADE_REQUIRED))
if (status >= HTTP_BAD_REQUEST &&
status != HTTP_UNAUTHORIZED &&
status != HTTP_UPGRADE_REQUIRED)
{
httpFlush(http);
_cupsSetHTTPError(status);
break;
}
@@ -679,9 +678,6 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
* Process the current HTTP status...
*/
if (status >= HTTP_BAD_REQUEST)
httpFlush(http);
switch (status)
{
case HTTP_ERROR :
@@ -690,15 +686,18 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
return (status);
case HTTP_UNAUTHORIZED :
if (cupsDoAuthentication(http, "POST", resource))
return (HTTP_AUTHORIZATION_CANCELED);
if (httpReconnect(http))
if (!cupsDoAuthentication(http, "POST", resource))
{
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
return (HTTP_SERVICE_UNAVAILABLE);
if (httpReconnect(http))
{
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
return (HTTP_SERVICE_UNAVAILABLE);
}
}
break;
else
status = HTTP_AUTHORIZATION_CANCELED;
return (status);
#ifdef HAVE_SSL
case HTTP_UPGRADE_REQUIRED :
@@ -713,12 +712,9 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
return (HTTP_SERVICE_UNAVAILABLE);
}
if (httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
{
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
return (HTTP_SERVICE_UNAVAILABLE);
}
break;
httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
return (status);
#endif /* HAVE_SSL */
case HTTP_EXPECTATION_FAILED :
@@ -805,14 +801,7 @@ cupsWriteRequestData(
*/
if (_httpWait(http, 0, 1))
{
http_status_t status; /* Status from httpUpdate */
if ((status = httpUpdate(http)) >= HTTP_BAD_REQUEST)
httpFlush(http);
return (status);
}
return (httpUpdate(http));
}
return (HTTP_CONTINUE);
+25 -18
Ver Arquivo
@@ -116,7 +116,6 @@ cupsSideChannelRead(
char buffer[16388]; /* Message buffer */
int bytes; /* Bytes read */
int templen; /* Data length from message */
int nfds; /* Number of file descriptors */
#ifdef HAVE_POLL
struct pollfd pfd; /* Poll structure for poll() */
#else /* select() */
@@ -144,30 +143,38 @@ cupsSideChannelRead(
pfd.fd = CUPS_SC_FD;
pfd.events = POLLIN;
while ((nfds = poll(&pfd, 1,
timeout < 0.0 ? -1 : (long)(timeout * 1000))) < 0 &&
(errno == EINTR || errno == EAGAIN))
;
if (timeout < 0.0)
{
if (poll(&pfd, 1, -1) < 1)
return (-1);
}
else if (poll(&pfd, 1, (long)(timeout * 1000)) < 1)
return (-1);
#else /* select() */
FD_ZERO(&input_set);
FD_SET(CUPS_SC_FD, &input_set);
stimeout.tv_sec = (int)timeout;
stimeout.tv_usec = (int)(timeout * 1000000) % 1000000;
while ((nfds = select(CUPS_SC_FD + 1, &input_set, NULL, NULL,
timeout < 0.0 ? NULL : &stimeout)) < 0 &&
(errno == EINTR || errno == EAGAIN))
;
#endif /* HAVE_POLL */
if (nfds < 1)
if (timeout < 0.0)
{
*status = nfds==0 ? CUPS_SC_STATUS_TIMEOUT : CUPS_SC_STATUS_IO_ERROR;
return (-1);
if (select(CUPS_SC_FD + 1, &input_set, NULL, NULL, NULL) < 1)
{
DEBUG_printf(("1cupsSideChannelRead: Select error: %s", strerror(errno)));
return (-1);
}
}
else
{
stimeout.tv_sec = (int)timeout;
stimeout.tv_usec = (int)(timeout * 1000000) % 1000000;
if (select(CUPS_SC_FD + 1, &input_set, NULL, NULL, &stimeout) < 1)
{
DEBUG_puts("1cupsSideChannelRead: Select timeout");
return (-1);
}
}
#endif /* HAVE_POLL */
/*
* Read a side-channel message for the format:
+7 -27
Ver Arquivo
@@ -3,7 +3,7 @@
*
* SNMP functions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -89,14 +89,14 @@ static char *asn1_get_string(unsigned char **buffer,
unsigned char *bufend,
int length, char *string,
int strsize);
static unsigned asn1_get_length(unsigned char **buffer,
static int asn1_get_length(unsigned char **buffer,
unsigned char *bufend);
static int asn1_get_type(unsigned char **buffer,
unsigned char *bufend);
static void asn1_set_integer(unsigned char **buffer,
int integer);
static void asn1_set_length(unsigned char **buffer,
unsigned length);
int length);
static void asn1_set_oid(unsigned char **buffer,
const int *oid);
static void asn1_set_packed(unsigned char **buffer,
@@ -1286,12 +1286,6 @@ asn1_get_integer(
int value; /* Integer value */
if (length > sizeof(int))
{
(*buffer) += length;
return (0);
}
for (value = (**buffer & 0x80) ? -1 : 0;
length > 0 && *buffer < bufend;
length --, (*buffer) ++)
@@ -1305,32 +1299,18 @@ asn1_get_integer(
* 'asn1_get_length()' - Get a value length.
*/
static unsigned /* O - Length */
static int /* O - Length */
asn1_get_length(unsigned char **buffer, /* IO - Pointer in buffer */
unsigned char *bufend) /* I - End of buffer */
{
unsigned length; /* Length */
int length; /* Length */
length = **buffer;
(*buffer) ++;
if (length & 128)
{
int count; /* Number of bytes for length */
if ((count = length & 127) > sizeof(unsigned))
{
(*buffer) += count;
return (0);
}
for (length = 0;
count > 0 && *buffer < bufend;
count --, (*buffer) ++)
length = (length << 8) | **buffer;
}
length = asn1_get_integer(buffer, bufend, length & 127);
return (length);
}
@@ -1549,7 +1529,7 @@ asn1_set_integer(unsigned char **buffer,/* IO - Pointer in buffer */
static void
asn1_set_length(unsigned char **buffer, /* IO - Pointer in buffer */
unsigned length) /* I - Length value */
int length) /* I - Length value */
{
if (length > 255)
{
+2 -3
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* String definitions for CUPS.
* String definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -27,7 +27,6 @@
# include <stdarg.h>
# include <ctype.h>
# include <locale.h>
# include <errno.h>
# include <config.h>
+2 -2
Ver Arquivo
@@ -118,8 +118,8 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%05x%08x", tmpdir, (unsigned)getpid(),
(unsigned)(curtime.tv_sec + curtime.tv_usec + tries));
snprintf(filename, len - 1, "%s/%08lx%05lx", tmpdir,
(unsigned long)curtime.tv_sec, (unsigned long)curtime.tv_usec);
#endif /* WIN32 */
/*
+3 -20
Ver Arquivo
@@ -2,7 +2,7 @@
*%
*% "$Id$"
*%
*% Test PPD file for CUPS.
*% Test PPD file for the Common UNIX Printing System (CUPS).
*%
*% This file is used to test the CUPS PPD API functions and cannot be
*% used with any known printers. Look on the CUPS web site for working PPD
@@ -12,7 +12,7 @@
*% to create your PPD files - not only will it save you time, it produces
*% consistently high-quality files.
*%
*% Copyright 2007-2010 by Apple Inc.
*% Copyright 2007-2009 by Apple Inc.
*% Copyright 2002-2006 by Easy Software Products.
*%
*% These coded instructions, statements, and computer programs are the
@@ -39,7 +39,7 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
*cupsFilter: "application/vnd.cups-raster 0 -"
*cupsFilter: "application/vnd.cups-raster - 0"
*RequiresPageRegion All: True
*% These constraints are used to test ppdConflicts() and cupsResolveConflicts()
@@ -65,9 +65,6 @@
*PageSize Letter/US Letter: "PageSize=Letter"
*fr.PageSize Letter/French US Letter: ""
*fr_CA.PageSize Letter/French Canadian US Letter: ""
*PageSize Letter.Fullbleed/US Letter Borderless: "PageSize=Letter.Fullbleed"
*fr.PageSize Letter.Fullbleed/French US Letter Borderless: ""
*fr_CA.PageSize Letter.Fullbleed/French Canadian US Letter Borderless: ""
*PageSize A4/A4: "PageSize=A4"
*fr.PageSize A4/French A4: ""
*fr_CA.PageSize A4/French Canadian A4: ""
@@ -81,32 +78,27 @@
*OrderDependency: 10 AnySetup *PageRegion
*DefaultPageRegion: Letter
*PageRegion Letter/US Letter: "PageRegion=Letter"
*PageRegion Letter.Fullbleed/US Letter Borderless: "PageRegion=Letter.Fullbleed"
*PageRegion A4/A4: "PageRegion=A4"
*PageRegion Env10/#10 Envelope: "PageRegion=Env10"
*CloseUI: *PageRegion
*fr.Translation PageRegion/French Page Region: ""
*fr.PageRegion Letter/French US Letter: ""
*fr.PageRegion Letter.Fullbleed/French US Letter Borderless: ""
*fr.PageRegion A4/French A4: ""
*fr.PageRegion Env10/French #10 Envelope: ""
*fr_CA.Translation PageRegion/French Canadian Page Region: ""
*fr_CA.PageRegion Letter/French Canadian US Letter: ""
*fr_CA.PageRegion Letter.Fullbleed/French Canadian US Letter Borderless: ""
*fr_CA.PageRegion A4/French Canadian A4: ""
*fr_CA.PageRegion Env10/French Canadian #10 Envelope: ""
*DefaultImageableArea: Letter
*ImageableArea Letter: "18 36 594 756"
*ImageableArea Letter.Fullbleed: "0 0 612 792"
*ImageableArea A4: "18 36 577 806"
*ImageableArea Env10: "18 36 279 648"
*DefaultPaperDimension: Letter
*PaperDimension Letter: "612 792"
*PaperDimension Letter.Fullbleed: "612 792"
*PaperDimension A4: "595 842"
*PaperDimension Env10: "297 684"
@@ -128,15 +120,6 @@
*InputSlot Envelope/Envelope Feed: "InputSlot=Envelope"
*CloseUI: *InputSlot
*OpenUI *MediaType/Media Type: PickOne
*OrderDependency: 25 AnySetup *MediaType
*DefaultMediaType: Plain
*MediaType Plain/Plain Paper: "MediaType=Plain"
*MediaType Matte/Matte Photo: "MediaType=Matte"
*MediaType Glossy/Glossy Photo: "MediaType=Glossy"
*MediaType Transparency/Transparency Film: "MediaType=Transparency"
*CloseUI: *MediaType
*OpenUI *Duplex/2-Sided Printing: PickOne
*OrderDependency: 10 DocumentSetup *Duplex
*DefaultDuplex: None
+8 -4
Ver Arquivo
@@ -375,9 +375,9 @@ random_tests(void)
fputs("cupsFileSeek(), cupsFileRead(): ", stdout);
for (num_records = (pass + 1) * 256, count = (pass + 1) * 256,
record = CUPS_RAND() % num_records;
record = rand() % num_records;
count > 0;
count --, record = (record + (CUPS_RAND() & 31) - 16 + num_records) %
count --, record = (record + (rand() & 31) - 16 + num_records) %
num_records)
{
/*
@@ -471,10 +471,14 @@ read_write_tests(int compression) /* I - Use compression? */
* Initialize the write buffer with random data...
*/
CUPS_SRAND(time(NULL));
#ifdef WIN32
srand((unsigned)time(NULL));
#else
srand(time(NULL));
#endif /* WIN32 */
for (i = 0; i < (int)sizeof(writebuf); i ++)
writebuf[i] = CUPS_RAND();
writebuf[i] = rand();
/*
* cupsFileOpen(write)
+15 -239
Ver Arquivo
@@ -3,7 +3,7 @@
*
* IPP test program for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -16,11 +16,7 @@
*
* Contents:
*
* main() - Main entry.
* hex_dump() - Produce a hex dump of a buffer.
* print_attributes() - Print the attributes in a request...
* read_cb() - Read data from a buffer.
* write_cb() - Write data into a buffer.
* main() - Main entry.
*/
/*
@@ -29,7 +25,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <cups/file.h>
#include <cups/string.h>
#include <errno.h>
#include "ipp-private.h"
@@ -85,32 +80,6 @@ ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x09, /* Name length + name */
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0a, /* Value length + value */
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
0x00, 0x00, /* Name length + name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
IPP_TAG_INTEGER, /* integer tag */
0x00, 0x00, /* No name */
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x54, 0x56,
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
IPP_TAG_INTEGER, /* integer tag */
0x00, 0x00, /* No name */
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x6d, 0x24,
IPP_TAG_END_COLLECTION, /* endCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
@@ -135,32 +104,6 @@ ipp_uchar_t collection[] = /* Collection buffer */
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0a, /* Value length + value */
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
0x00, 0x00, /* Name length + name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
IPP_TAG_INTEGER, /* integer tag */
0x00, 0x00, /* No name */
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x52, 0x08,
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
IPP_TAG_INTEGER, /* integer tag */
0x00, 0x00, /* No name */
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x74, 0x04,
IPP_TAG_END_COLLECTION, /* endCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
@@ -204,15 +147,11 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
ipp_t *cols[2], /* Collections */
*size; /* media-size collection */
ipp_t *cols[2]; /* Collections */
ipp_t *request; /* Request */
ipp_attribute_t *media_col, /* media-col attribute */
*media_size, /* media-size attribute */
*attr; /* Other attribute */
ipp_state_t state; /* State */
int length; /* Length of data */
cups_file_t *fp; /* File pointer */
int fd; /* File descriptor */
int i; /* Looping var */
int status; /* Status of tests (0 = success, 1 = fail) */
@@ -241,31 +180,14 @@ main(int argc, /* I - Number of command-line arguments */
"printer-uri", NULL, "ipp://localhost/printers/foo");
cols[0] = ippNew();
size = ippNew();
ippAddInteger(size, IPP_TAG_ZERO, IPP_TAG_INTEGER, "x-dimension", 21590);
ippAddInteger(size, IPP_TAG_ZERO, IPP_TAG_INTEGER, "y-dimension", 27940);
ippAddCollection(cols[0], IPP_TAG_JOB, "media-size", size);
ippDelete(size);
ippAddString(cols[0], IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-color", NULL,
"blue");
ippAddString(cols[0], IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-type", NULL,
"plain");
ippAddString(cols[0], IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-color", NULL, "blue");
ippAddString(cols[0], IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-type", NULL, "plain");
cols[1] = ippNew();
size = ippNew();
ippAddInteger(size, IPP_TAG_ZERO, IPP_TAG_INTEGER, "x-dimension", 21000);
ippAddInteger(size, IPP_TAG_ZERO, IPP_TAG_INTEGER, "y-dimension", 29700);
ippAddCollection(cols[1], IPP_TAG_JOB, "media-size", size);
ippDelete(size);
ippAddString(cols[1], IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-color", NULL,
"plaid");
ippAddString(cols[1], IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-type", NULL,
"glossy");
ippAddString(cols[1], IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-color", NULL, "plaid");
ippAddString(cols[1], IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-type", NULL, "glossy");
ippAddCollections(request, IPP_TAG_JOB, "media-col", 2,
(const ipp_t **)cols);
ippDelete(cols[0]);
ippDelete(cols[1]);
ippAddCollections(request, IPP_TAG_JOB, "media-col", 2, (const ipp_t **)cols);
length = ippLength(request);
if (length != sizeof(collection))
@@ -284,8 +206,7 @@ main(int argc, /* I - Number of command-line arguments */
printf("Write Sample to Memory: ");
wused = 0;
while ((state = ippWriteIO(wbuffer, write_cb, 1, NULL,
request)) != IPP_DATA)
while ((state = ippWriteIO(wbuffer, write_cb, 1, NULL, request)) != IPP_DATA)
if (state == IPP_ERROR)
break;
@@ -304,11 +225,7 @@ main(int argc, /* I - Number of command-line arguments */
}
else if (memcmp(wbuffer, collection, wused))
{
for (i = 0; i < wused; i ++)
if (wbuffer[i] != collection[i])
break;
printf("FAIL - output does not match baseline at 0x%04x!\n", i);
puts("FAIL - output does not match baseline!");
hex_dump("Bytes Written", wbuffer, wused);
hex_dump("Baseline", collection, sizeof(collection));
status = 1;
@@ -354,153 +271,13 @@ main(int argc, /* I - Number of command-line arguments */
else
puts("PASS");
fputs("ippFindAttribute(media-col): ", stdout);
if ((media_col = ippFindAttribute(request, "media-col",
IPP_TAG_BEGIN_COLLECTION)) == NULL)
{
if ((media_col = ippFindAttribute(request, "media-col",
IPP_TAG_ZERO)) == NULL)
puts("FAIL (not found)");
else
printf("FAIL (wrong type - %s)\n", ippTagString(media_col->value_tag));
status = 1;
}
else if (media_col->num_values != 2)
{
printf("FAIL (wrong count - %d)\n", media_col->num_values);
status = 1;
}
else
puts("PASS");
if (media_col)
{
fputs("ippFindAttribute(media-size 1): ", stdout);
if ((media_size = ippFindAttribute(media_col->values[0].collection,
"media-size",
IPP_TAG_BEGIN_COLLECTION)) == NULL)
{
if ((media_size = ippFindAttribute(media_col->values[0].collection,
"media-col",
IPP_TAG_ZERO)) == NULL)
puts("FAIL (not found)");
else
printf("FAIL (wrong type - %s)\n",
ippTagString(media_size->value_tag));
status = 1;
}
else
{
if ((attr = ippFindAttribute(media_size->values[0].collection,
"x-dimension", IPP_TAG_INTEGER)) == NULL)
{
if ((attr = ippFindAttribute(media_size->values[0].collection,
"x-dimension", IPP_TAG_ZERO)) == NULL)
puts("FAIL (missing x-dimension)");
else
printf("FAIL (wrong type for x-dimension - %s)\n",
ippTagString(attr->value_tag));
status = 1;
}
else if (attr->values[0].integer != 21590)
{
printf("FAIL (wrong value for x-dimension - %d)\n",
attr->values[0].integer);
status = 1;
}
else if ((attr = ippFindAttribute(media_size->values[0].collection,
"y-dimension",
IPP_TAG_INTEGER)) == NULL)
{
if ((attr = ippFindAttribute(media_size->values[0].collection,
"y-dimension", IPP_TAG_ZERO)) == NULL)
puts("FAIL (missing y-dimension)");
else
printf("FAIL (wrong type for y-dimension - %s)\n",
ippTagString(attr->value_tag));
status = 1;
}
else if (attr->values[0].integer != 27940)
{
printf("FAIL (wrong value for y-dimension - %d)\n",
attr->values[0].integer);
status = 1;
}
else
puts("PASS");
}
fputs("ippFindAttribute(media-size 2): ", stdout);
if ((media_size = ippFindAttribute(media_col->values[1].collection,
"media-size",
IPP_TAG_BEGIN_COLLECTION)) == NULL)
{
if ((media_size = ippFindAttribute(media_col->values[1].collection,
"media-col",
IPP_TAG_ZERO)) == NULL)
puts("FAIL (not found)");
else
printf("FAIL (wrong type - %s)\n",
ippTagString(media_size->value_tag));
status = 1;
}
else
{
if ((attr = ippFindAttribute(media_size->values[0].collection,
"x-dimension",
IPP_TAG_INTEGER)) == NULL)
{
if ((attr = ippFindAttribute(media_size->values[0].collection,
"x-dimension", IPP_TAG_ZERO)) == NULL)
puts("FAIL (missing x-dimension)");
else
printf("FAIL (wrong type for x-dimension - %s)\n",
ippTagString(attr->value_tag));
status = 1;
}
else if (attr->values[0].integer != 21000)
{
printf("FAIL (wrong value for x-dimension - %d)\n",
attr->values[0].integer);
status = 1;
}
else if ((attr = ippFindAttribute(media_size->values[0].collection,
"y-dimension",
IPP_TAG_INTEGER)) == NULL)
{
if ((attr = ippFindAttribute(media_size->values[0].collection,
"y-dimension", IPP_TAG_ZERO)) == NULL)
puts("FAIL (missing y-dimension)");
else
printf("FAIL (wrong type for y-dimension - %s)\n",
ippTagString(attr->value_tag));
status = 1;
}
else if (attr->values[0].integer != 29700)
{
printf("FAIL (wrong value for y-dimension - %d)\n",
attr->values[0].integer);
status = 1;
}
else
puts("PASS");
}
}
ippDelete(request);
/*
* Test _ippFindOption() private API...
*/
fputs("_ippFindOption(printer-type): ", stdout);
fputs("_ippFindOption(\"printer-type\"): ", stdout);
if (_ippFindOption("printer-type"))
puts("PASS");
else
@@ -528,7 +305,7 @@ main(int argc, /* I - Number of command-line arguments */
for (i = 1; i < argc; i ++)
{
if ((fp = cupsFileOpen(argv[i], "r")) == NULL)
if ((fd = open(argv[i], O_RDONLY)) < 0)
{
printf("Unable to open \"%s\" - %s\n", argv[i], strerror(errno));
status = 1;
@@ -536,8 +313,7 @@ main(int argc, /* I - Number of command-line arguments */
}
request = ippNew();
while ((state = ippReadIO(fp, (ipp_iocb_t)cupsFileRead, 1, NULL,
request)) == IPP_ATTRIBUTE);
while ((state = ippReadFile(fd, request)) == IPP_ATTRIBUTE);
if (state != IPP_DATA)
{
@@ -551,7 +327,7 @@ main(int argc, /* I - Number of command-line arguments */
}
ippDelete(request);
cupsFileClose(fp);
close(fd);
}
}
+13 -21
Ver Arquivo
@@ -3,7 +3,7 @@
*
* PPD test program for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -23,12 +23,13 @@
* Include necessary headers...
*/
#include <cups/cups.h>
#include <cups/string.h>
#include <stdio.h>
#include <stdlib.h>
#include <cups/string.h>
#include <sys/stat.h>
#include <errno.h>
#include "cups.h"
#include "pwgmedia.h"
#ifdef WIN32
# include <io.h>
#else
@@ -57,11 +58,6 @@ static const char *default_code =
"%%EndFeature\n"
"} stopped cleartomark\n"
"[{\n"
"%%BeginFeature: *MediaType Plain\n"
"MediaType=Plain\n"
"%%EndFeature\n"
"} stopped cleartomark\n"
"[{\n"
"%%BeginFeature: *IntOption None\n"
"%%EndFeature\n"
"} stopped cleartomark\n"
@@ -81,11 +77,6 @@ static const char *custom_code =
"%%EndFeature\n"
"} stopped cleartomark\n"
"[{\n"
"%%BeginFeature: *MediaType Plain\n"
"MediaType=Plain\n"
"%%EndFeature\n"
"} stopped cleartomark\n"
"[{\n"
"%%BeginFeature: *IntOption None\n"
"%%EndFeature\n"
"} stopped cleartomark\n"
@@ -154,6 +145,7 @@ main(int argc, /* I - Number of command-line arguments */
maxsize, /* Maximum size */
*size; /* Current size */
ppd_attr_t *attr; /* Current attribute */
_cups_pwg_media_t *pwgmedia; /* PWG media size */
status = 0;
@@ -445,15 +437,15 @@ main(int argc, /* I - Number of command-line arguments */
else
puts("PASS");
fputs("cupsMarkOptions(media=A4): ", stdout);
num_options = cupsAddOption("media", "A4", 0, &options);
cupsMarkOptions(ppd, num_options, options);
cupsFreeOptions(num_options, options);
size = ppdPageSize(ppd, NULL);
if (!size || strcmp(size->name, "A4"))
fputs("_cupsPWGMediaBySize(842, 1191): ", stdout);
if ((pwgmedia = _cupsPWGMediaBySize(842, 1191)) == NULL)
{
printf("FAIL (%s)\n", size ? size->name : "unknown");
puts("FAIL (not found)");
status ++;
}
else if (strcmp(pwgmedia->pwg, "iso_a3_297x420mm"))
{
printf("FAIL (%s)\n", pwgmedia->pwg);
status ++;
}
else
-274
Ver Arquivo
@@ -1,274 +0,0 @@
/*
* "$Id$"
*
* PWG test program for CUPS.
*
* Copyright 2009-2010 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Main entry.
* test_pwg() - Test the PWG mapping functions.
*/
/*
* Include necessary headers...
*/
#include "pwg-private.h"
/*
* Local functions...
*/
static int test_pwg(_pwg_t *pwg);
/*
* 'main()' - Main entry.
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line arguments */
{
int status; /* Status of tests (0 = success, 1 = fail) */
const char *ppdfile; /* PPD filename */
ppd_file_t *ppd; /* PPD file */
_pwg_t *pwg; /* PWG mapping data */
_pwg_media_t *pwgmedia; /* PWG media size */
status = 0;
if (argc != 2)
{
puts("Usage: ./testpwg filename.ppd");
return (1);
}
else
ppdfile = argv[1];
printf("ppdOpenFile(%s): ", ppdfile);
if ((ppd = ppdOpenFile(ppdfile)) == NULL)
{
ppd_status_t err; /* Last error in file */
int line; /* Line number in file */
err = ppdLastError(&line);
printf("FAIL (%s on line %d)\n", ppdErrorString(err), line);
return (1);
}
else
puts("PASS");
fputs("_pwgCreateWithPPD(ppd): ", stdout);
if ((pwg = _pwgCreateWithPPD(ppd)) == NULL)
{
puts("FAIL");
status ++;
}
else
{
puts("PASS");
status += test_pwg(pwg);
/*
* _pwgDestroy should never fail...
*/
fputs("_pwgDestroy(pwg): ", stdout);
_pwgDestroy(pwg);
puts("PASS");
}
fputs("_pwgMediaForSize(29700, 42000): ", stdout);
if ((pwgmedia = _pwgMediaForSize(29700, 42000)) == NULL)
{
puts("FAIL (not found)");
status ++;
}
else if (strcmp(pwgmedia->pwg, "iso_a3_297x420mm"))
{
printf("FAIL (%s)\n", pwgmedia->pwg);
status ++;
}
else
puts("PASS");
return (status);
}
/*
* 'test_pwg()' - Test the PWG mapping functions.
*/
static int /* O - 1 on failure, 0 on success */
test_pwg(_pwg_t *pwg) /* I - PWG mapping data */
{
int i, /* Looping var */
status = 0; /* Return status */
_pwg_t *pwg2; /* Loaded data */
_pwg_size_t *size, /* Size from original */
*size2; /* Size from saved */
_pwg_map_t *map, /* Map from original */
*map2; /* Map from saved */
/*
* Verify that we can write and read back the same data...
*/
fputs("_pwgWriteFile(test.pwg): ", stdout);
if (!_pwgWriteFile(pwg, "test.pwg"))
{
puts("FAIL");
status ++;
}
else
puts("PASS");
fputs("_pwgCreateWithFile(test.pwg): ", stdout);
if ((pwg2 = _pwgCreateWithFile("test.pwg")) == NULL)
{
puts("FAIL");
status ++;
}
else
{
if (pwg2->num_sizes != pwg->num_sizes)
{
if (!status)
puts("FAIL");
printf(" SAVED num_sizes=%d, ORIG num_sizes=%d\n", pwg2->num_sizes,
pwg->num_sizes);
status ++;
}
else
{
for (i = pwg->num_sizes, size = pwg->sizes, size2 = pwg2->sizes;
i > 0;
i --, size ++, size2 ++)
{
if (strcmp(size2->map.pwg, size->map.pwg) ||
strcmp(size2->map.ppd, size->map.ppd) ||
size2->width != size->width ||
size2->length != size->length ||
size2->left != size->left ||
size2->bottom != size->bottom ||
size2->right != size->right ||
size2->top != size->top)
{
if (!status)
puts("FAIL");
if (strcmp(size->map.pwg, size2->map.pwg))
printf(" SAVED size->map.pwg=\"%s\", ORIG "
"size->map.pwg=\"%s\"\n", size2->map.pwg, size->map.pwg);
if (strcmp(size2->map.ppd, size->map.ppd))
printf(" SAVED size->map.ppd=\"%s\", ORIG "
"size->map.ppd=\"%s\"\n", size2->map.ppd, size->map.ppd);
if (size2->width != size->width)
printf(" SAVED size->width=%d, ORIG size->width=%d\n",
size2->width, size->width);
if (size2->length != size->length)
printf(" SAVED size->length=%d, ORIG size->length=%d\n",
size2->length, size->length);
if (size2->left != size->left)
printf(" SAVED size->left=%d, ORIG size->left=%d\n",
size2->left, size->left);
if (size2->bottom != size->bottom)
printf(" SAVED size->bottom=%d, ORIG size->bottom=%d\n",
size2->bottom, size->bottom);
if (size2->right != size->right)
printf(" SAVED size->right=%d, ORIG size->right=%d\n",
size2->right, size->right);
if (size2->top != size->top)
printf(" SAVED size->top=%d, ORIG size->top=%d\n",
size2->top, size->top);
status ++;
break;
}
}
for (i = pwg->num_sources, map = pwg->sources, map2 = pwg2->sources;
i > 0;
i --, map ++, map2 ++)
{
if (strcmp(map2->pwg, map->pwg) ||
strcmp(map2->ppd, map->ppd))
{
if (!status)
puts("FAIL");
if (strcmp(map->pwg, map2->pwg))
printf(" SAVED source->pwg=\"%s\", ORIG source->pwg=\"%s\"\n",
map2->pwg, map->pwg);
if (strcmp(map2->ppd, map->ppd))
printf(" SAVED source->ppd=\"%s\", ORIG source->ppd=\"%s\"\n",
map2->ppd, map->ppd);
status ++;
break;
}
}
for (i = pwg->num_types, map = pwg->types, map2 = pwg2->types;
i > 0;
i --, map ++, map2 ++)
{
if (strcmp(map2->pwg, map->pwg) ||
strcmp(map2->ppd, map->ppd))
{
if (!status)
puts("FAIL");
if (strcmp(map->pwg, map2->pwg))
printf(" SAVED type->pwg=\"%s\", ORIG type->pwg=\"%s\"\n",
map2->pwg, map->pwg);
if (strcmp(map2->ppd, map->ppd))
printf(" SAVED type->ppd=\"%s\", ORIG type->ppd=\"%s\"\n",
map2->ppd, map->ppd);
status ++;
break;
}
}
}
if (!status)
puts("PASS");
}
return (status);
}
/*
* End of "$Id$".
*/
+87 -119
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* "$Id$"
*
* User, system, and password routines for CUPS.
* User, system, and password routines for the Common UNIX Printing
* System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -16,16 +17,14 @@
*
* Contents:
*
* cupsEncryption() - Get the current encryption settings.
* cupsEncryption() - Get the default encryption settings.
* cupsGetPassword() - Get a password from the user.
* cupsGetPassword2() - Get a password from the user using the advanced
* password callback.
* cupsServer() - Return the hostname/address of the current
* cupsServer() - Return the hostname/address of the default
* server.
* cupsSetEncryption() - Set the encryption preference.
* cupsSetPasswordCB() - Set the password callback for CUPS.
* cupsSetPasswordCB2() - Set the advanced password callback for CUPS.
* cupsSetServer() - Set the default server name and port.
* cupsSetServer() - Set the default server name.
* cupsSetUser() - Set the default user name.
* cupsUser() - Return the current user's name.
* _cupsGetPassword() - Get a password from the user.
@@ -43,8 +42,6 @@
#include <sys/stat.h>
#ifdef WIN32
# include <windows.h>
#else
# include <pwd.h>
#endif /* WIN32 */
#include "debug.h"
@@ -60,17 +57,12 @@ static void cups_read_client_conf(cups_file_t *fp,
/*
* 'cupsEncryption()' - Get the current encryption settings.
* 'cupsEncryption()' - Get the default encryption settings.
*
* The default encryption setting comes from the CUPS_ENCRYPTION
* environment variable, then the ~/.cups/client.conf file, and finally the
* /etc/cups/client.conf file. If not set, the default is
* @code HTTP_ENCRYPT_IF_REQUESTED@.
*
* Note: The current encryption setting is tracked separately for each thread
* in a program. Multi-threaded programs that override the setting via the
* @link cupsSetEncryption@ function need to do so in each thread for the same
* setting to be used.
*/
http_encryption_t /* O - Encryption settings */
@@ -91,11 +83,6 @@ cupsEncryption(void)
*
* Uses the current password callback function. Returns @code NULL@ if the
* user does not provide a password.
*
* Note: The current password callback function is tracked separately for each
* thread in a program. Multi-threaded programs that override the setting via
* the @link cupsSetPasswordCB@ or @link cupsSetPasswordCB2@ functions need to
* do so in each thread for the same function to be used.
*/
const char * /* O - Password */
@@ -110,16 +97,11 @@ cupsGetPassword(const char *prompt) /* I - Prompt string */
/*
* 'cupsGetPassword2()' - Get a password from the user using the advanced
* password callback.
* callback.
*
* Uses the current password callback function. Returns @code NULL@ if the
* user does not provide a password.
*
* Note: The current password callback function is tracked separately for each
* thread in a program. Multi-threaded programs that override the setting via
* the @link cupsSetPasswordCB@ or @link cupsSetPasswordCB2@ functions need to
* do so in each thread for the same function to be used.
*
* @since CUPS 1.4/Mac OS X 10.6@
*/
@@ -140,20 +122,10 @@ cupsGetPassword2(const char *prompt, /* I - Prompt string */
/*
* 'cupsServer()' - Return the hostname/address of the current server.
* 'cupsServer()' - Return the hostname/address of the default server.
*
* The default server comes from the CUPS_SERVER environment variable, then the
* ~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
* set, the default is the local system - either "localhost" or a domain socket
* path.
*
* The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
* address, or a domain socket pathname.
*
* Note: The current server is tracked separately for each thread in a program.
* Multi-threaded programs that override the server via the
* @link cupsSetServer@ function need to do so in each thread for the same
* server to be used.
* The returned value can be a fully-qualified hostname, a numeric
* IPv4 or IPv6 address, or a domain socket pathname.
*/
const char * /* O - Server name */
@@ -171,15 +143,6 @@ cupsServer(void)
/*
* 'cupsSetEncryption()' - Set the encryption preference.
*
* The default encryption setting comes from the CUPS_ENCRYPTION
* environment variable, then the ~/.cups/client.conf file, and finally the
* /etc/cups/client.conf file. If not set, the default is
* @code HTTP_ENCRYPT_IF_REQUESTED@.
*
* Note: The current encryption setting is tracked separately for each thread
* in a program. Multi-threaded programs that override the setting need to do
* so in each thread for the same setting to be used.
*/
void
@@ -198,14 +161,7 @@ cupsSetEncryption(http_encryption_t e) /* I - New encryption preference */
/*
* 'cupsSetPasswordCB()' - Set the password callback for CUPS.
*
* Pass @code NULL@ to restore the default (console) password callback, which
* reads the password from the console. Programs should call either this
* function or @link cupsSetPasswordCB2@, as only one callback can be registered
* by a program per thread.
*
* Note: The current password callback is tracked separately for each thread
* in a program. Multi-threaded programs that override the callback need to do
* so in each thread for the same callback to be used.
* Pass @code NULL@ to restore the default (console) password callback.
*/
void
@@ -226,14 +182,7 @@ cupsSetPasswordCB(cups_password_cb_t cb)/* I - Callback function */
/*
* 'cupsSetPasswordCB2()' - Set the advanced password callback for CUPS.
*
* Pass @code NULL@ to restore the default (console) password callback, which
* reads the password from the console. Programs should call either this
* function or @link cupsSetPasswordCB2@, as only one callback can be registered
* by a program per thread.
*
* Note: The current password callback is tracked separately for each thread
* in a program. Multi-threaded programs that override the callback need to do
* so in each thread for the same callback to be used.
* Pass @code NULL@ to restore the default (console) password callback.
*
* @since CUPS 1.4/Mac OS X 10.6@
*/
@@ -256,17 +205,11 @@ cupsSetPasswordCB2(
/*
* 'cupsSetServer()' - Set the default server name and port.
* 'cupsSetServer()' - Set the default server name.
*
* The "server" string can be a fully-qualified hostname, a numeric
* IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
* addresses can be optionally followed by a colon and port number to override
* the default port 631, e.g. "hostname:8631". Pass @code NULL@ to restore the
* default server name and port.
*
* Note: The current server is tracked separately for each thread in a program.
* Multi-threaded programs that override the server need to do so in each
* thread for the same server to be used.
* IPv4 or IPv6 address, or a domain socket pathname. Pass @code NULL@ to
* restore the default server name.
*/
void
@@ -311,10 +254,6 @@ cupsSetServer(const char *server) /* I - Server name */
* 'cupsSetUser()' - Set the default user name.
*
* Pass @code NULL@ to restore the default user name.
*
* Note: The current user name is tracked separately for each thread in a
* program. Multi-threaded programs that override the user name need to do so
* in each thread for the same user name to be used.
*/
void
@@ -330,13 +269,13 @@ cupsSetUser(const char *user) /* I - User name */
}
#if defined(WIN32)
/*
* WIN32 username and password stuff.
*/
/*
* 'cupsUser()' - Return the current user's name.
*
* Note: The current user name is tracked separately for each thread in a
* program. Multi-threaded programs that override the user name with the
* @link cupsSetUser@ function need to do so in each thread for the same user
* name to be used.
*/
const char * /* O - User name */
@@ -347,38 +286,16 @@ cupsUser(void)
if (!cg->user[0])
{
#ifdef WIN32
/*
* Get the current user name from the OS...
*/
DWORD size; /* Size of string */
DWORD size; /* Size of string */
size = sizeof(cg->user);
if (!GetUserName(cg->user, &size))
#else
/*
* Get the user name corresponding to the current UID...
*/
struct passwd *pwd; /* User/password entry */
setpwent();
if ((pwd = getpwuid(getuid())) != NULL)
{
/*
* Found a match!
* Use the default username...
*/
strlcpy(cg->user, pwd->pw_name, sizeof(cg->user));
}
else
#endif /* WIN32 */
{
/*
* Use the default "unknown" user name...
*/
strcpy(cg->user, "unknown");
}
}
@@ -394,21 +311,72 @@ cupsUser(void)
const char * /* O - Password */
_cupsGetPassword(const char *prompt) /* I - Prompt string */
{
#ifdef WIN32
/*
* Currently no console password support is provided on Windows.
*/
return (NULL);
#else
/*
* Use the standard getpass function to get a password from the console.
*/
return (getpass(prompt));
#endif /* WIN32 */
}
#else
/*
* UNIX username and password stuff...
*/
# include <pwd.h>
/*
* 'cupsUser()' - Return the current user's name.
*/
const char * /* O - User name */
cupsUser(void)
{
struct passwd *pwd; /* User/password entry */
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
if (!cg->user[0])
{
/*
* Rewind the password file...
*/
setpwent();
/*
* Lookup the password entry for the current user.
*/
if ((pwd = getpwuid(getuid())) == NULL)
strcpy(cg->user, "unknown"); /* Unknown user! */
else
{
/*
* Copy the username...
*/
setpwent();
strlcpy(cg->user, pwd->pw_name, sizeof(cg->user));
}
/*
* Rewind the password file again...
*/
setpwent();
}
return (cg->user);
}
/*
* '_cupsGetPassword()' - Get a password from the user.
*/
const char * /* O - Password */
_cupsGetPassword(const char *prompt) /* I - Prompt string */
{
return (getpass(prompt));
}
#endif /* WIN32 */
/*
+15 -36
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* Printing utilities for CUPS.
* Printing utilities for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -18,7 +18,7 @@
*
* cupsCancelJob() - Cancel a print job on the default server.
* cupsCancelJob2() - Cancel or purge a print job.
* cupsCreateJob() - Create an empty job for streaming.
* cupsCreateJob() - Create an empty job.
* cupsFinishDocument() - Finish sending a document.
* cupsFreeJobs() - Free memory used by job data.
* cupsGetClasses() - Get a list of printer classes from the default
@@ -570,17 +570,17 @@ cupsGetJobs2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_D
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
static const char * const attrs[] = /* Requested attributes */
{
"document-format",
"job-id",
"job-k-octets",
"job-name",
"job-originating-user-name",
"job-printer-uri",
"job-priority",
"job-k-octets",
"job-state",
"time-at-completed",
"time-at-creation",
"time-at-processing"
"time-at-processing",
"job-printer-uri",
"document-format",
"job-name",
"job-originating-user-name"
};
@@ -1456,9 +1456,6 @@ cupsPrintFiles2(
char buffer[8192]; /* Copy buffer */
ssize_t bytes; /* Bytes in buffer */
http_status_t status; /* Status of write */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
ipp_status_t cancel_status; /* Status code to preserve */
char *cancel_message; /* Error message to preserve */
DEBUG_printf(("cupsPrintFiles2(http=%p, name=\"%s\", num_files=%d, "
@@ -1510,15 +1507,15 @@ cupsPrintFiles2(
* Unable to open print file, cancel the job and return...
*/
_cupsSetError(IPP_DOCUMENT_ACCESS_ERROR, NULL, 0);
goto cancel_job;
cupsCancelJob2(http, name, job_id, 0);
return (0);
}
status = cupsStartDocument(http, name, job_id, docname, format,
i == (num_files - 1));
i == (num_files - 1));
while (status == HTTP_CONTINUE &&
(bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
(bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
status = cupsWriteRequestData(http, buffer, bytes);
cupsFileClose(fp);
@@ -1529,30 +1526,12 @@ cupsPrintFiles2(
* Unable to queue, cancel the job and return...
*/
goto cancel_job;
cupsCancelJob2(http, name, job_id, 0);
return (0);
}
}
return (job_id);
/*
* If we get here, something happened while sending the print job so we need
* to cancel the job without setting the last error (since we need to preserve
* the current error...
*/
cancel_job:
cancel_status = cg->last_error;
cancel_message = cg->last_status_message ?
_cupsStrRetain(cg->last_status_message) : NULL;
cupsCancelJob2(http, name, job_id, 0);
cg->last_error = cancel_status;
cg->last_status_message = cancel_message;
return (0);
}
+2 -6
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
*
* API versioning definitions for CUPS.
* API versioning definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -69,10 +69,6 @@
# define _CUPS_DEPRECATED
# endif /* __GNUC__ && __GNUC__ > 2 */
# ifndef __GNUC__
# define __attribute__(x)
# endif /* !__GNUC__ */
#endif /* !_CUPS_VERSIONING_H_ */
/*
+1 -5
Ver Arquivo
@@ -27,7 +27,7 @@ P.example {
font-style: italic;
margin-left: 36pt;
}
PRE.example {
background: white;
border: dotted thin #999999;
@@ -238,10 +238,6 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
color: white;
}
TH.conflict {
text-align: right;
}
H1.title {
display: none;
}
+13 -13
Ver Arquivo
@@ -16,7 +16,7 @@ SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
<TD CLASS="sel"><A HREF="/">&nbsp;&nbsp;Startseite&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/admin">&nbsp;&nbsp;Verwaltung&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/classes/">&nbsp;&nbsp;Klassen&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/help/">&nbsp;&nbsp;Online-&nbsp;Hilfe&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/help/">&nbsp;&nbsp;On-Line&nbsp;Hilfe&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/jobs/">&nbsp;&nbsp;Auftr&auml;ge&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/printers/">&nbsp;&nbsp;Drucker&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
@@ -31,7 +31,7 @@ AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
<H1>Common UNIX Printing System @CUPS_VERSION@</H1>
<P>CUPS ist das auf Standards basierte, Opensource-Drucksystem, welches von
<P>CUPS ist das auf Standards basierte, Open-Source Drucker System, welches von
<A HREF="http://www.apple.com/">Apple Inc.</A> f&uuml;r Mac OS<SUP>&reg;</SUP> X und
andere UNIX<SUP>&reg;</SUP>-&auml;hnliche Betriebssysteme entwickelt wird.</P>
@@ -46,13 +46,13 @@ HEIGHT="128" ALT="CUPS"></A></TD>
<H2>CUPS f&uuml;r Benutzer</H2>
<P><A HREF="help/overview.html">CUPS.&Uuml;bersicht</A></P>
<P><A HREF="help/overview.html">CUPS &Uuml;bersicht</A></P>
<P><A HREF="help/options.html">Kommandozeilendruck und Einstellungen</A></P>
<P><A HREF="help/whatsnew.html">Neues in CUPS 1.4</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Benutzerforum</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Benutzer Forum</A></P>
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
@@ -66,7 +66,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
<P><A HREF="help/security.html">Sicherheit des Servers</A></P>
<P><A HREF="help/kerberos.html">Verwenden der Kerberos Authentifizierung</A></P>
<P><A HREF="help/kerberos.html">Benutzen der Kerberos Authentifizierung</A></P>
<P><A HREF="help/network.html">Benutzen von Netzwerkdruckern</A></P>
@@ -78,21 +78,21 @@ HEIGHT="128" ALT="CUPS"></A></TD>
<H2>CUPS f&uuml;r Entwickler</H2>
<P><A HREF="help/api-overview.html">Einf&uuml;hrung in die CUPS-Programmierung</A></P>
<P><A HREF="help/api-overview.html">Einf&uuml;hrung in die CUPS Programmierung</A></P>
<P><A HREF="help/api-cups.html">CUPS-API</A></P>
<P><A HREF="help/api-cups.html">CUPS API</A></P>
<P><A HREF="help/api-filter.html">Filter- und Backend-Programmierung</A></P>
<P><A HREF="help/api-filter.html">Filter und Backend Programmierung</A></P>
<P><A HREF="help/api-httpipp.html">HTTP- und IPP-APIs</A></P>
<P><A HREF="help/api-httpipp.html">HTTP und IPP APIs</A></P>
<P><A HREF="help/api-ppd.html">PPD-API</A></P>
<P><A HREF="help/api-ppd.html">PPD API</A></P>
<P><A HREF="help/api-raster.html">Raster-API</A></P>
<P><A HREF="help/api-raster.html">Raster API</A></P>
<P><A HREF="help/ref-ppdcfile.html">PPD Compiler Driver Information File Reference</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Entwicklerforum</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Entwickler Forum</A></P>
</TD></TR>
</TABLE>
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS und das CUPS Logo sind
eingetragene Warenzeichen der <A HREF="http://www.apple.com">Apple Inc.</A>
CUPS ist urheberrechtlich gesch&uuml;tzt 2007-2010 von Apple Inc, alle Rechte vorbehalten.</TD></TR>
CUPS ist urheberrechtlich gesch&uuml;tzt 2007-2009 von Apple Inc, alle Rechte vorbehalten.</TD></TR>
</TABLE>
</BODY>
</HTML>
+1 -1
Ver Arquivo
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS y el logo de CUPS son
marcas registradas de <A HREF="http://www.apple.com">Apple Inc.</A> Los derechos
de copia de CUPS 2007-2010 son de Apple Inc. Todos los derechos reservados.</TD></TR>
de copia de CUPS 2007-2009 son de Apple Inc. Todos los derechos reservados.</TD></TR>
</TABLE>
</BODY>
</HTML>
+1 -1
Ver Arquivo
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS eta CUPSen logotipoa <A HREF="http://www.apple.com">Apple Inc.</A>en marka erregistratuaj dira.
CUPSen copyright-a 2007-2010 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
CUPSen copyright-a 2007-2009 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
</TABLE>
</BODY>
</HTML>
+11 -57
Ver Arquivo
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-cgi.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-cgi.html 8653 2009-05-16 23:53:28Z mike $"
CGI API header for CUPS.
@@ -377,7 +377,6 @@ div.contents ul.subcontents li {
<li><a href="#OVERVIEW">Overview</a></li>
<li><a href="#FUNCTIONS">Functions</a><ul class="code">
<li><a href="#cgiCheckVariables" title="Check for the presence of &quot;required&quot; variables.">cgiCheckVariables</a></li>
<li><a href="#cgiClearVariables" title="Clear all form variables.">cgiClearVariables</a></li>
<li><a href="#cgiCompileSearch" title="Compile a search string.">cgiCompileSearch</a></li>
<li><a href="#cgiCopyTemplateFile" title="Copy a template file and replace all the
'{variable}' strings with the variable value.">cgiCopyTemplateFile</a></li>
@@ -387,28 +386,26 @@ div.contents ul.subcontents li {
<li><a href="#cgiEndMultipart" title="End the delivery of a multipart web page.">cgiEndMultipart</a></li>
<li><a href="#cgiFormEncode" title="Encode a string as a form variable.">cgiFormEncode</a></li>
<li><a href="#cgiFreeSearch" title="Free a compiled search context.">cgiFreeSearch</a></li>
<li><a href="#cgiGetArray" title="Get an element from a form array.">cgiGetArray</a></li>
<li><a href="#cgiGetArray" title="Get an element from a form array...">cgiGetArray</a></li>
<li><a href="#cgiGetAttributes" title="Get the list of attributes that are needed
by the template file.">cgiGetAttributes</a></li>
<li><a href="#cgiGetCookie" title="Get a cookie value.">cgiGetCookie</a></li>
<li><a href="#cgiGetFile" title="Get the file (if any) that was submitted in the form.">cgiGetFile</a></li>
<li><a href="#cgiGetIPPObjects" title="Get the objects in an IPP response.">cgiGetIPPObjects</a></li>
<li><a href="#cgiGetSize" title="Get the size of a form array value.">cgiGetSize</a></li>
<li><a href="#cgiGetTemplateDir" title="Get the templates directory...">cgiGetTemplateDir</a></li>
<li><a href="#cgiGetVariable" title="Get a CGI variable from the database.">cgiGetVariable</a></li>
<li><a href="#cgiInitialize" title="Initialize the CGI variable &quot;database&quot;.">cgiInitialize</a></li>
<li><a href="#cgiGetVariable" title="Get a CGI variable from the database...">cgiGetVariable</a></li>
<li><a href="#cgiInitialize" title="Initialize the CGI variable &quot;database&quot;...">cgiInitialize</a></li>
<li><a href="#cgiIsPOST" title="Determine whether this page was POSTed.">cgiIsPOST</a></li>
<li><a href="#cgiMoveJobs" title="Move one or more jobs.">cgiMoveJobs</a></li>
<li><a href="#cgiPrintCommand" title="Print a CUPS command job.">cgiPrintCommand</a></li>
<li><a href="#cgiPrintTestPage" title="Print a test page.">cgiPrintTestPage</a></li>
<li><a href="#cgiRewriteURL" title="Rewrite a printer URI into a web browser URL...">cgiRewriteURL</a></li>
<li><a href="#cgiSetArray" title="Set array element N to the specified string.">cgiSetArray</a></li>
<li><a href="#cgiSetCookie" title="Set a cookie value.">cgiSetCookie</a></li>
<li><a href="#cgiSetIPPObjectVars" title="Set CGI variables from an IPP object.">cgiSetIPPObjectVars</a></li>
<li><a href="#cgiSetIPPVars" title="Set CGI variables from an IPP response.">cgiSetIPPVars</a></li>
<li><a href="#cgiSetServerVersion" title="Set the server name and CUPS version...">cgiSetServerVersion</a></li>
<li><a href="#cgiSetSize" title="Set the array size.">cgiSetSize</a></li>
<li><a href="#cgiSetVariable" title="Set a CGI variable in the database.">cgiSetVariable</a></li>
<li><a href="#cgiSetVariable" title="Set a CGI variable in the database...">cgiSetVariable</a></li>
<li><a href="#cgiShowIPPError" title="Show the last IPP error message.">cgiShowIPPError</a></li>
<li><a href="#cgiShowJobs" title="Show print jobs.">cgiShowJobs</a></li>
<li><a href="#cgiStartHTML" title="Start a HTML page.">cgiStartHTML</a></li>
@@ -434,7 +431,7 @@ by the template file.">cgiGetAttributes</a></li>
<li><a href="#help_word_s" title="Help word structure...">help_word_s</a></li>
</ul></li>
<!--
"$Id: api-cgi.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-cgi.html 8653 2009-05-16 23:53:28Z mike $"
CGI API introduction for CUPS.
@@ -466,10 +463,6 @@ int cgiCheckVariables (<br>
<p class="description">1 if all variables present, 0 otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Names may be separated by spaces and/or commas.</p>
<h3 class="function"><a name="cgiClearVariables">cgiClearVariables</a></h3>
<p class="description">Clear all form variables.</p>
<p class="code">
void cgiClearVariables (void);</p>
<h3 class="function"><a name="cgiCompileSearch">cgiCompileSearch</a></h3>
<p class="description">Compile a search string.</p>
<p class="code">
@@ -564,7 +557,7 @@ void cgiFreeSearch (<br>
<dd class="description">Search context</dd>
</dl>
<h3 class="function"><a name="cgiGetArray">cgiGetArray</a></h3>
<p class="description">Get an element from a form array.</p>
<p class="description">Get an element from a form array...</p>
<p class="code">
const char *cgiGetArray (<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
@@ -594,19 +587,6 @@ void cgiGetAttributes (<br>
<dt>tmpl</dt>
<dd class="description">Base filename</dd>
</dl>
<h3 class="function"><a name="cgiGetCookie">cgiGetCookie</a></h3>
<p class="description">Get a cookie value.</p>
<p class="code">
const char *cgiGetCookie (<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>name</dt>
<dd class="description">Name of cookie</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Value or NULL</p>
<h3 class="function"><a name="cgiGetFile">cgiGetFile</a></h3>
<p class="description">Get the file (if any) that was submitted in the form.</p>
<p class="code">
@@ -649,7 +629,7 @@ char *cgiGetTemplateDir (void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Template directory</p>
<h3 class="function"><a name="cgiGetVariable">cgiGetVariable</a></h3>
<p class="description">Get a CGI variable from the database.</p>
<p class="description">Get a CGI variable from the database...</p>
<p class="code">
const char *cgiGetVariable (<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
@@ -663,9 +643,9 @@ const char *cgiGetVariable (<br>
<p class="description">Value of variable</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns NULL if the variable doesn't exist. If the variable is an
array of values, returns the last element.</p>
array of values, returns the last element...</p>
<h3 class="function"><a name="cgiInitialize">cgiInitialize</a></h3>
<p class="description">Initialize the CGI variable &quot;database&quot;.</p>
<p class="description">Initialize the CGI variable &quot;database&quot;...</p>
<p class="code">
int cgiInitialize (void);</p>
<h4 class="returnvalue">Return Value</h4>
@@ -771,32 +751,6 @@ void cgiSetArray (<br>
<h4 class="discussion">Discussion</h4>
<p class="discussion">If the variable array is smaller than (element + 1), the intervening
elements are set to NULL.</p>
<h3 class="function"><a name="cgiSetCookie">cgiSetCookie</a></h3>
<p class="description">Set a cookie value.</p>
<p class="code">
void cgiSetCookie (<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *value,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *path,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *domain,<br>
&nbsp;&nbsp;&nbsp;&nbsp;time_t expires,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int secure<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>name</dt>
<dd class="description">Name</dd>
<dt>value</dt>
<dd class="description">Value</dd>
<dt>path</dt>
<dd class="description">Path (typically &quot;/&quot;)</dd>
<dt>domain</dt>
<dd class="description">Domain name</dd>
<dt>expires</dt>
<dd class="description">Expiration date (0 for session)</dd>
<dt>secure</dt>
<dd class="description">Require SSL</dd>
</dl>
<h3 class="function"><a name="cgiSetIPPObjectVars">cgiSetIPPObjectVars</a></h3>
<p class="description">Set CGI variables from an IPP object.</p>
<p class="code">
@@ -860,7 +814,7 @@ void cgiSetSize (<br>
<dd class="description">Number of elements (0 to N)</dd>
</dl>
<h3 class="function"><a name="cgiSetVariable">cgiSetVariable</a></h3>
<p class="description">Set a CGI variable in the database.</p>
<p class="description">Set a CGI variable in the database...</p>
<p class="code">
void cgiSetVariable (<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
+24 -88
Ver Arquivo
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-cups.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-cups.html 8726 2009-06-22 20:46:13Z mike $"
CUPS API header for the Common UNIX Printing System (CUPS).
@@ -398,7 +398,7 @@ div.contents ul.subcontents li {
<li><a href="#cupsCancelJob" title="Cancel a print job on the default server.">cupsCancelJob</a></li>
<li><a href="#cupsCancelJob2" title="Cancel or purge a print job.">cupsCancelJob2</a></li>
<li><a href="#cupsCreateJob" title="Create an empty job for streaming.">cupsCreateJob</a></li>
<li><a href="#cupsEncryption" title="Get the current encryption settings.">cupsEncryption</a></li>
<li><a href="#cupsEncryption" title="Get the default encryption settings.">cupsEncryption</a></li>
<li><a href="#cupsFinishDocument" title="Finish sending a document.">cupsFinishDocument</a></li>
<li><a href="#cupsFreeDests" title="Free the memory used by the list of destinations.">cupsFreeDests</a></li>
<li><a href="#cupsFreeJobs" title="Free memory used by job data.">cupsFreeJobs</a></li>
@@ -419,7 +419,7 @@ div.contents ul.subcontents li {
server if it has changed.">cupsGetPPD3</a></li>
<li><a href="#cupsGetPassword" title="Get a password from the user.">cupsGetPassword</a></li>
<li><a href="#cupsGetPassword2" title="Get a password from the user using the advanced
password callback.">cupsGetPassword2</a></li>
callback.">cupsGetPassword2</a></li>
<li><a href="#cupsGetPrinters" title="Get a list of printers from the default server.">cupsGetPrinters</a></li>
<li><a href="#cupsGetServerPPD" title="Get an available PPD file from the server.">cupsGetServerPPD</a></li>
<li><a href="#cupsLangDefault" title="Return the default language.">cupsLangDefault</a></li>
@@ -442,14 +442,14 @@ default server.">cupsPrintFiles</a></li>
specified server.">cupsPrintFiles2</a></li>
<li><a href="#cupsRemoveDest" title="Remove a destination from the destination list.">cupsRemoveDest</a></li>
<li><a href="#cupsRemoveOption" title="Remove an option from an option array.">cupsRemoveOption</a></li>
<li><a href="#cupsServer" title="Return the hostname/address of the current server.">cupsServer</a></li>
<li><a href="#cupsServer" title="Return the hostname/address of the default server.">cupsServer</a></li>
<li><a href="#cupsSetDefaultDest" title="Set the default destination.">cupsSetDefaultDest</a></li>
<li><a href="#cupsSetDests" title="Save the list of destinations for the default server.">cupsSetDests</a></li>
<li><a href="#cupsSetDests2" title="Save the list of destinations for the specified server.">cupsSetDests2</a></li>
<li><a href="#cupsSetEncryption" title="Set the encryption preference.">cupsSetEncryption</a></li>
<li><a href="#cupsSetPasswordCB" title="Set the password callback for CUPS.">cupsSetPasswordCB</a></li>
<li><a href="#cupsSetPasswordCB2" title="Set the advanced password callback for CUPS.">cupsSetPasswordCB2</a></li>
<li><a href="#cupsSetServer" title="Set the default server name and port.">cupsSetServer</a></li>
<li><a href="#cupsSetServer" title="Set the default server name.">cupsSetServer</a></li>
<li><a href="#cupsSetUser" title="Set the default user name.">cupsSetUser</a></li>
<li><a href="#cupsStartDocument" title="Add a document to a job created with cupsCreateJob().">cupsStartDocument</a></li>
<li><a href="#cupsTempFd" title="Creates a temporary file.">cupsTempFd</a></li>
@@ -475,11 +475,11 @@ specified server.">cupsPrintFiles2</a></li>
<li><a href="#cups_ptype_e" title="Printer type/capability bit constants">cups_ptype_e</a></li>
</ul></li>
<!--
"$Id: api-cups.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-cups.html 8726 2009-06-22 20:46:13Z mike $"
CUPS API introduction for the Common UNIX Printing System (CUPS).
Copyright 2007-2010 by Apple Inc.
Copyright 2007-2008 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -558,13 +558,12 @@ instance will return the default instance for that destination.</p>
</tr>
<tr>
<td>"printer-is-accepting-jobs"</td>
<td>"true" if the destination is accepting new jobs, "false" if
not.</td>
<td>"1" if the destination is accepting new jobs, "0" if not.</td>
</tr>
<tr>
<td>"printer-is-shared"</td>
<td>"true" if the destination is being shared with other computers,
"false" if not.</td>
<td>"1" if the destination is being shared with other computers, "0" if
not.</td>
</tr>
<tr>
<td>"printer-location"</td>
@@ -1158,7 +1157,7 @@ instead.
</p>
<h3 class="function"><a name="cupsEncryption">cupsEncryption</a></h3>
<p class="description">Get the current encryption settings.</p>
<p class="description">Get the default encryption settings.</p>
<p class="code">
http_encryption_t cupsEncryption (void);</p>
<h4 class="returnvalue">Return Value</h4>
@@ -1167,12 +1166,7 @@ http_encryption_t cupsEncryption (void);</p>
<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
environment variable, then the ~/.cups/client.conf file, and finally the
/etc/cups/client.conf file. If not set, the default is
<code>HTTP_ENCRYPT_IF_REQUESTED</code>.<br>
<br>
Note: The current encryption setting is tracked separately for each thread
in a program. Multi-threaded programs that override the setting via the
<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
setting to be used.</p>
<code>HTTP_ENCRYPT_IF_REQUESTED</code>.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsFinishDocument">cupsFinishDocument</a></h3>
<p class="description">Finish sending a document.</p>
<p class="code">
@@ -1583,15 +1577,10 @@ const char *cupsGetPassword (<br>
<p class="description">Password</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
user does not provide a password.<br>
<br>
Note: The current password callback function is tracked separately for each
thread in a program. Multi-threaded programs that override the setting via
the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to
do so in each thread for the same function to be used.</p>
user does not provide a password.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsGetPassword2">cupsGetPassword2</a></h3>
<p class="description">Get a password from the user using the advanced
password callback.</p>
callback.</p>
<p class="code">
const char *cupsGetPassword2 (<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *prompt,<br>
@@ -1614,12 +1603,7 @@ const char *cupsGetPassword2 (<br>
<p class="description">Password</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
user does not provide a password.<br>
<br>
Note: The current password callback function is tracked separately for each
thread in a program. Multi-threaded programs that override the setting via
the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to
do so in each thread for the same function to be used.
user does not provide a password.
</p>
<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="cupsGetPrinters">cupsGetPrinters</a></h3>
@@ -1957,24 +1941,14 @@ int cupsRemoveOption (<br>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of options</p>
<h3 class="function"><a name="cupsServer">cupsServer</a></h3>
<p class="description">Return the hostname/address of the current server.</p>
<p class="description">Return the hostname/address of the default server.</p>
<p class="code">
const char *cupsServer (void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Server name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
set, the default is the local system - either &quot;localhost&quot; or a domain socket
path.<br>
<br>
The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
address, or a domain socket pathname.<br>
<br>
Note: The current server is tracked separately for each thread in a program.
Multi-threaded programs that override the server via the
<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
server to be used.</p>
<p class="discussion">The returned value can be a fully-qualified hostname, a numeric
IPv4 or IPv6 address, or a domain socket pathname.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span><a name="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
<p class="description">Set the default destination.</p>
<p class="code">
@@ -2047,15 +2021,6 @@ void cupsSetEncryption (<br>
<dt>e</dt>
<dd class="description">New encryption preference</dd>
</dl>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
environment variable, then the ~/.cups/client.conf file, and finally the
/etc/cups/client.conf file. If not set, the default is
<code>HTTP_ENCRYPT_IF_REQUESTED</code>.<br>
<br>
Note: The current encryption setting is tracked separately for each thread
in a program. Multi-threaded programs that override the setting need to do
so in each thread for the same setting to be used.</p>
<h3 class="function"><a name="cupsSetPasswordCB">cupsSetPasswordCB</a></h3>
<p class="description">Set the password callback for CUPS.</p>
<p class="code">
@@ -2068,14 +2033,7 @@ void cupsSetPasswordCB (<br>
<dd class="description">Callback function</dd>
</dl>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
reads the password from the console. Programs should call either this
function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
by a program per thread.<br>
<br>
Note: The current password callback is tracked separately for each thread
in a program. Multi-threaded programs that override the callback need to do
so in each thread for the same callback to be used.</p>
<p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
<p class="description">Set the advanced password callback for CUPS.</p>
<p class="code">
@@ -2091,18 +2049,11 @@ void cupsSetPasswordCB2 (<br>
<dd class="description">User data pointer</dd>
</dl>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
reads the password from the console. Programs should call either this
function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
by a program per thread.<br>
<br>
Note: The current password callback is tracked separately for each thread
in a program. Multi-threaded programs that override the callback need to do
so in each thread for the same callback to be used.
<p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback.
</p>
<h3 class="function"><a name="cupsSetServer">cupsSetServer</a></h3>
<p class="description">Set the default server name and port.</p>
<p class="description">Set the default server name.</p>
<p class="code">
void cupsSetServer (<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *server<br>
@@ -2114,14 +2065,8 @@ void cupsSetServer (<br>
</dl>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
addresses can be optionally followed by a colon and port number to override
the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
default server name and port.<br>
<br>
Note: The current server is tracked separately for each thread in a program.
Multi-threaded programs that override the server need to do so in each
thread for the same server to be used.</p>
IPv4 or IPv6 address, or a domain socket pathname. Pass <code>NULL</code> to
restore the default server name.</p>
<h3 class="function"><a name="cupsSetUser">cupsSetUser</a></h3>
<p class="description">Set the default user name.</p>
<p class="code">
@@ -2134,11 +2079,7 @@ void cupsSetUser (<br>
<dd class="description">User name</dd>
</dl>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
<br>
Note: The current user name is tracked separately for each thread in a
program. Multi-threaded programs that override the user name need to do so
in each thread for the same user name to be used.</p>
<p class="discussion">Pass <code>NULL</code> to restore the default user name.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsStartDocument">cupsStartDocument</a></h3>
<p class="description">Add a document to a job created with cupsCreateJob().</p>
<p class="code">
@@ -2245,11 +2186,6 @@ The temporary file is opened for writing.
const char *cupsUser (void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">User name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Note: The current user name is tracked separately for each thread in a
program. Multi-threaded programs that override the user name with the
<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
name to be used.</p>
<h2 class="title"><a name="TYPES">Data Types</a></h2>
<h3 class="typedef"><a name="cups_dest_t">cups_dest_t</a></h3>
<p class="description">Destination</p>
+10 -10
Ver Arquivo
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-filter.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-filter.html 8718 2009-06-18 17:41:03Z mike $"
Filter and backend programming header for the Common UNIX Printing System
(CUPS).
@@ -421,7 +421,7 @@ div.contents ul.subcontents li {
<li><a href="#cups_sc_status_e" title="Response status codes">cups_sc_status_e</a></li>
</ul></li>
<!--
"$Id: api-filter.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-filter.html 8718 2009-06-18 17:41:03Z mike $"
Filter and backend programming introduction for the Common UNIX Printing
System (CUPS).
@@ -489,7 +489,7 @@ specify an arbitrary file path to a separator page, template, or other file
used by the filter since that can lead to an unauthorized disclosure of
information. <em>Always</em> treat input as suspect and validate it!</p>
<p>If you are developing a backend that runs as root, make sure to check for
<p>If you are developing a backend that runs as root , make sure to check for
potential buffer overflows, integer under/overflow conditions, and file
accesses since these can lead to privilege escalations. When writing files,
always validate the file path and <em>never</em> allow a user to determine
@@ -510,15 +510,15 @@ Mac OS X, for example, no backend may write to a user's home directory.</p>
<h3><a name="PERMISSIONS">File Permissions</a></h3>
<p>For security reasons, CUPS will only run filters and backends that are owned
by root and do not have world or group write permissions. The recommended
permissions for filters and backends are 0555 - read and execute but no write.
Backends that must run as root should use permissions of 0500 - read and execute
by root, no access for other users. Write permissions can be enabled for the
root user only.</p>
by root and do not have world write permissions. The recommended permissions for
filters and backends are 0555 - read and execute but no write. Backends that
must run as root should use permissions of 0500 - read and execute by root, no
access for other users. Write permissions can be enabled for the root user
only.</p>
<p>To avoid a warning message, the directory containing your filter(s) must also
be owned by root and have world and group write disabled - permissions of 0755
or 0555 are strongly encouraged.</p>
be owned by root and have world write disabled - permissions of 0755 or 0555 are
strongly encouraged.</p>
<h3><a name="TEMPFILES">Temporary Files</a></h3>
+46 -49
Ver Arquivo
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-httpipp.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-httpipp.html 8653 2009-05-16 23:53:28Z mike $"
HTTP and IPP API header for the Common UNIX Printing System (CUPS).
@@ -412,7 +412,7 @@ components with a formatted resource.">httpAssembleURIf</a></li>
<li><a href="#httpCheck" title="Check to see if there is a pending response from the server.">httpCheck</a></li>
<li><a href="#httpClearCookie" title="Clear the cookie value(s).">httpClearCookie</a></li>
<li><a href="#httpClearFields" title="Clear HTTP request fields.">httpClearFields</a></li>
<li><a href="#httpClose" title="Close an HTTP connection.">httpClose</a></li>
<li><a href="#httpClose" title="Close an HTTP connection...">httpClose</a></li>
<li><a href="#httpConnect" title="Connect to a HTTP server.">httpConnect</a></li>
<li><a href="#httpConnectEncrypt" title="Connect to a HTTP server using encryption.">httpConnectEncrypt</a></li>
<li><a href="#httpDecode64" title="Base64-decode a string.">httpDecode64</a></li>
@@ -465,7 +465,7 @@ components.">httpSeparate2</a></li>
<li><a href="#httpSeparateURI" title="Separate a Universal Resource Identifier into its
components.">httpSeparateURI</a></li>
<li><a href="#httpSetAuthString" title="Set the current authorization string.">httpSetAuthString</a></li>
<li><a href="#httpSetCookie" title="Set the cookie value(s).">httpSetCookie</a></li>
<li><a href="#httpSetCookie" title="Set the cookie value(s)...">httpSetCookie</a></li>
<li><a href="#httpSetExpect" title="Set the Expect: header in a request.">httpSetExpect</a></li>
<li><a href="#httpSetField" title="Set the value of an HTTP header.">httpSetField</a></li>
<li><a href="#httpSetLength" title="Set the content-length and content-encoding.">httpSetLength</a></li>
@@ -537,19 +537,19 @@ are server-oriented...">http_state_t</a></li>
<li><a href="#http_uri_status_t" title="URI separation status ">http_uri_status_t</a></li>
<li><a href="#http_version_t" title="HTTP version numbers">http_version_t</a></li>
<li><a href="#ipp_attribute_t" title="Attribute">ipp_attribute_t</a></li>
<li><a href="#ipp_finish_t" title="Finishings">ipp_finish_t</a></li>
<li><a href="#ipp_finish_t" title="Finishings...">ipp_finish_t</a></li>
<li><a href="#ipp_iocb_t" title="IPP IO Callback Function ">ipp_iocb_t</a></li>
<li><a href="#ipp_jstate_t" title="Job states">ipp_jstate_t</a></li>
<li><a href="#ipp_op_t" title="IPP operations">ipp_op_t</a></li>
<li><a href="#ipp_orient_t" title="Orientation values">ipp_orient_t</a></li>
<li><a href="#ipp_pstate_t" title="Printer states">ipp_pstate_t</a></li>
<li><a href="#ipp_quality_t" title="Qualities">ipp_quality_t</a></li>
<li><a href="#ipp_jstate_t" title="Job States....">ipp_jstate_t</a></li>
<li><a href="#ipp_op_t" title="IPP operations...">ipp_op_t</a></li>
<li><a href="#ipp_orient_t" title="Orientation...">ipp_orient_t</a></li>
<li><a href="#ipp_pstate_t" title="Printer States....">ipp_pstate_t</a></li>
<li><a href="#ipp_quality_t" title="Qualities...">ipp_quality_t</a></li>
<li><a href="#ipp_request_t" title="Request Header">ipp_request_t</a></li>
<li><a href="#ipp_res_t" title="Resolution units">ipp_res_t</a></li>
<li><a href="#ipp_state_t" title="IPP states">ipp_state_t</a></li>
<li><a href="#ipp_res_t" title="Resolution units...">ipp_res_t</a></li>
<li><a href="#ipp_state_t" title="IPP states...">ipp_state_t</a></li>
<li><a href="#ipp_t" title="Attribute Value">ipp_t</a></li>
<li><a href="#ipp_uchar_t" title="IPP status codes">ipp_uchar_t</a></li>
<li><a href="#ipp_tag_t" title="Format tags for attributes">ipp_tag_t</a></li>
<li><a href="#ipp_uchar_t" title="IPP status codes...">ipp_uchar_t</a></li>
<li><a href="#ipp_tag_t" title="Format tags for attributes...">ipp_tag_t</a></li>
<li><a href="#ipp_value_t" title="Attribute Value">ipp_value_t</a></li>
</ul></li>
<li><a href="#STRUCTURES">Structures</a><ul class="code">
@@ -576,19 +576,19 @@ are server-oriented...">http_state_e</a></li>
<li><a href="#http_uri_coding_e" title="URI en/decode flags">http_uri_coding_e</a></li>
<li><a href="#http_uri_status_e" title="URI separation status ">http_uri_status_e</a></li>
<li><a href="#http_version_e" title="HTTP version numbers">http_version_e</a></li>
<li><a href="#ipp_finish_e" title="Finishings">ipp_finish_e</a></li>
<li><a href="#ipp_jstate_e" title="Job states">ipp_jstate_e</a></li>
<li><a href="#ipp_op_e" title="IPP operations">ipp_op_e</a></li>
<li><a href="#ipp_orient_e" title="Orientation values">ipp_orient_e</a></li>
<li><a href="#ipp_pstate_e" title="Printer states">ipp_pstate_e</a></li>
<li><a href="#ipp_quality_e" title="Qualities">ipp_quality_e</a></li>
<li><a href="#ipp_res_e" title="Resolution units">ipp_res_e</a></li>
<li><a href="#ipp_state_e" title="IPP states">ipp_state_e</a></li>
<li><a href="#ipp_status_e" title="IPP status codes">ipp_status_e</a></li>
<li><a href="#ipp_tag_e" title="Format tags for attributes">ipp_tag_e</a></li>
<li><a href="#ipp_finish_e" title="Finishings...">ipp_finish_e</a></li>
<li><a href="#ipp_jstate_e" title="Job States....">ipp_jstate_e</a></li>
<li><a href="#ipp_op_e" title="IPP operations...">ipp_op_e</a></li>
<li><a href="#ipp_orient_e" title="Orientation...">ipp_orient_e</a></li>
<li><a href="#ipp_pstate_e" title="Printer States....">ipp_pstate_e</a></li>
<li><a href="#ipp_quality_e" title="Qualities...">ipp_quality_e</a></li>
<li><a href="#ipp_res_e" title="Resolution units...">ipp_res_e</a></li>
<li><a href="#ipp_state_e" title="IPP states...">ipp_state_e</a></li>
<li><a href="#ipp_status_e" title="IPP status codes...">ipp_status_e</a></li>
<li><a href="#ipp_tag_e" title="Format tags for attributes...">ipp_tag_e</a></li>
</ul></li>
<!--
"$Id: api-httpipp.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-httpipp.html 8653 2009-05-16 23:53:28Z mike $"
HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
@@ -1531,7 +1531,7 @@ void httpClearFields (<br>
<dd class="description">Connection to server</dd>
</dl>
<h3 class="function"><a name="httpClose">httpClose</a></h3>
<p class="description">Close an HTTP connection.</p>
<p class="description">Close an HTTP connection...</p>
<p class="code">
void httpClose (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
@@ -2356,7 +2356,7 @@ httpHead(), httpOptions(), httpPost, or httpPut().
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="httpSetCookie">httpSetCookie</a></h3>
<p class="description">Set the cookie value(s).</p>
<p class="description">Set the cookie value(s)...</p>
<p class="code">
void httpSetCookie (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
@@ -3324,7 +3324,7 @@ typedef enum <a href="#http_version_e">http_version_e</a> http_version_t;
typedef struct <a href="#ipp_attribute_s">ipp_attribute_s</a> ipp_attribute_t;
</p>
<h3 class="typedef"><a name="ipp_finish_t">ipp_finish_t</a></h3>
<p class="description">Finishings</p>
<p class="description">Finishings...</p>
<p class="code">
typedef enum <a href="#ipp_finish_e">ipp_finish_e</a> ipp_finish_t;
</p>
@@ -3334,27 +3334,27 @@ typedef enum <a href="#ipp_finish_e">ipp_finish_e</a> ipp_finish_t;
typedef ssize_t (*ipp_iocb_t)(void *, <a href="#ipp_uchar_t">ipp_uchar_t</a> *, size_t);
</p>
<h3 class="typedef"><a name="ipp_jstate_t">ipp_jstate_t</a></h3>
<p class="description">Job states</p>
<p class="description">Job States....</p>
<p class="code">
typedef enum <a href="#ipp_jstate_e">ipp_jstate_e</a> ipp_jstate_t;
</p>
<h3 class="typedef"><a name="ipp_op_t">ipp_op_t</a></h3>
<p class="description">IPP operations</p>
<p class="description">IPP operations...</p>
<p class="code">
typedef enum <a href="#ipp_op_e">ipp_op_e</a> ipp_op_t;
</p>
<h3 class="typedef"><a name="ipp_orient_t">ipp_orient_t</a></h3>
<p class="description">Orientation values</p>
<p class="description">Orientation...</p>
<p class="code">
typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
</p>
<h3 class="typedef"><a name="ipp_pstate_t">ipp_pstate_t</a></h3>
<p class="description">Printer states</p>
<p class="description">Printer States....</p>
<p class="code">
typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
</p>
<h3 class="typedef"><a name="ipp_quality_t">ipp_quality_t</a></h3>
<p class="description">Qualities</p>
<p class="description">Qualities...</p>
<p class="code">
typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
</p>
@@ -3364,12 +3364,12 @@ typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
typedef union <a href="#ipp_request_u">ipp_request_u</a> ipp_request_t;
</p>
<h3 class="typedef"><a name="ipp_res_t">ipp_res_t</a></h3>
<p class="description">Resolution units</p>
<p class="description">Resolution units...</p>
<p class="code">
typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
</p>
<h3 class="typedef"><a name="ipp_state_t">ipp_state_t</a></h3>
<p class="description">IPP states</p>
<p class="description">IPP states...</p>
<p class="code">
typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
</p>
@@ -3379,12 +3379,12 @@ typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
typedef struct <a href="#ipp_s">ipp_s</a> ipp_t;
</p>
<h3 class="typedef"><a name="ipp_uchar_t">ipp_uchar_t</a></h3>
<p class="description">IPP status codes</p>
<p class="description">IPP status codes...</p>
<p class="code">
typedef typedef unsigned char ipp_uchar_t;
</p>
<h3 class="typedef"><a name="ipp_tag_t">ipp_tag_t</a></h3>
<p class="description">Format tags for attributes</p>
<p class="description">Format tags for attributes...</p>
<p class="code">
typedef enum <a href="#ipp_tag_e">ipp_tag_e</a> ipp_tag_t;
</p>
@@ -3442,7 +3442,6 @@ with a hostname. </p>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *prev;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_request_t">ipp_request_t</a> request;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_state_t">ipp_state_t</a> state;<br>
&nbsp;&nbsp;&nbsp;&nbsp;int use;<br>
};</p>
<h4 class="members">Members</h4>
<dl>
@@ -3460,8 +3459,6 @@ with a hostname. </p>
<dd class="description">Request header</dd>
<dt>state </dt>
<dd class="description">State of request</dd>
<dt>use </dt>
<dd class="description">Use count</dd>
</dl>
<h2 class="title"><a name="UNIONS">Unions</a></h2>
<h3 class="union"><a name="ipp_request_u">ipp_request_u</a></h3>
@@ -3789,7 +3786,7 @@ are server-oriented...</p>
<dd class="description">HTTP/1.1</dd>
</dl>
<h3 class="enumeration"><a name="ipp_finish_e">ipp_finish_e</a></h3>
<p class="description">Finishings</p>
<p class="description">Finishings...</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>IPP_FINISHINGS_BALE </dt>
@@ -3850,7 +3847,7 @@ are server-oriented...</p>
<dd class="description">Trim (any type)</dd>
</dl>
<h3 class="enumeration"><a name="ipp_jstate_e">ipp_jstate_e</a></h3>
<p class="description">Job states</p>
<p class="description">Job States....</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>IPP_JOB_ABORTED </dt>
@@ -3869,7 +3866,7 @@ are server-oriented...</p>
<dd class="description">Job has been stopped</dd>
</dl>
<h3 class="enumeration"><a name="ipp_op_e">ipp_op_e</a></h3>
<p class="description">IPP operations</p>
<p class="description">IPP operations...</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>CUPS_ACCEPT_JOBS </dt>
@@ -3956,7 +3953,7 @@ are server-oriented...</p>
<dd class="description">Validate job options</dd>
</dl>
<h3 class="enumeration"><a name="ipp_orient_e">ipp_orient_e</a></h3>
<p class="description">Orientation values</p>
<p class="description">Orientation...</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>IPP_LANDSCAPE </dt>
@@ -3969,7 +3966,7 @@ are server-oriented...</p>
<dd class="description">180 degrees</dd>
</dl>
<h3 class="enumeration"><a name="ipp_pstate_e">ipp_pstate_e</a></h3>
<p class="description">Printer states</p>
<p class="description">Printer States....</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>IPP_PRINTER_IDLE </dt>
@@ -3980,7 +3977,7 @@ are server-oriented...</p>
<dd class="description">Printer is stopped</dd>
</dl>
<h3 class="enumeration"><a name="ipp_quality_e">ipp_quality_e</a></h3>
<p class="description">Qualities</p>
<p class="description">Qualities...</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>IPP_QUALITY_DRAFT </dt>
@@ -3991,7 +3988,7 @@ are server-oriented...</p>
<dd class="description">Normal quality</dd>
</dl>
<h3 class="enumeration"><a name="ipp_res_e">ipp_res_e</a></h3>
<p class="description">Resolution units</p>
<p class="description">Resolution units...</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>IPP_RES_PER_CM </dt>
@@ -4000,7 +3997,7 @@ are server-oriented...</p>
<dd class="description">Pixels per inch</dd>
</dl>
<h3 class="enumeration"><a name="ipp_state_e">ipp_state_e</a></h3>
<p class="description">IPP states</p>
<p class="description">IPP states...</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>IPP_ATTRIBUTE </dt>
@@ -4015,7 +4012,7 @@ are server-oriented...</p>
<dd class="description">Nothing is happening/request completed</dd>
</dl>
<h3 class="enumeration"><a name="ipp_status_e">ipp_status_e</a></h3>
<p class="description">IPP status codes</p>
<p class="description">IPP status codes...</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>CUPS_SEE_OTHER </dt>
@@ -4108,7 +4105,7 @@ are server-oriented...</p>
<dd class="description">server-error-version-not-supported</dd>
</dl>
<h3 class="enumeration"><a name="ipp_tag_e">ipp_tag_e</a></h3>
<p class="description">Format tags for attributes</p>
<p class="description">Format tags for attributes...</p>
<h4 class="constants">Constants</h4>
<dl>
<dt>IPP_TAG_ADMINDEFINE </dt>
+2 -9
Ver Arquivo
@@ -338,7 +338,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id: api-ppd.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-ppd.html 8653 2009-05-16 23:53:28Z mike $"
PPD API header for the Common UNIX Printing System (CUPS).
@@ -482,7 +482,7 @@ conflicts.">ppdMarkOption</a></li>
<li><a href="#ppd_ui_e" title="UI Types">ppd_ui_e</a></li>
</ul></li>
<!--
"$Id: api-ppd.html 9121 2010-04-23 18:57:00Z mike $"
"$Id: api-ppd.html 8653 2009-05-16 23:53:28Z mike $"
PPD API introduction for the Common UNIX Printing System (CUPS).
@@ -1805,7 +1805,6 @@ typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
&nbsp;&nbsp;&nbsp;&nbsp;char *product;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_profile_t">ppd_profile_t</a> *profiles;<br>
&nbsp;&nbsp;&nbsp;&nbsp;char *protocols;<br>
&nbsp;&nbsp;&nbsp;&nbsp;void *pwg;<br>
&nbsp;&nbsp;&nbsp;&nbsp;char *shortnickname;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_size_t">ppd_size_t</a> *sizes;<br>
&nbsp;&nbsp;&nbsp;&nbsp;int throughput;<br>
@@ -1888,8 +1887,6 @@ typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
<dd class="description">sRGB color profiles </dd>
<dt>protocols <span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span></dt>
<dd class="description">Protocols (BCP, TBCP) string </dd>
<dt>pwg </dt>
<dd class="description">PWG to/from PPD mappings</dd>
<dt>shortnickname </dt>
<dd class="description">Short version of nickname</dd>
<dt>sizes </dt>
@@ -2157,8 +2154,6 @@ typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
<dd class="description">Bad OrderDependency</dd>
<dt>PPD_BAD_UI_CONSTRAINTS </dt>
<dd class="description">Bad UIConstraints</dd>
<dt>PPD_BAD_VALUE </dt>
<dd class="description">Bad value string</dd>
<dt>PPD_FILE_OPEN_ERROR </dt>
<dd class="description">Unable to open PPD file</dd>
<dt>PPD_ILLEGAL_CHARACTER </dt>
@@ -2177,8 +2172,6 @@ typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
<dd class="description">Line longer than 255 chars</dd>
<dt>PPD_MISSING_ASTERISK </dt>
<dd class="description">Missing asterisk in column 0</dd>
<dt>PPD_MISSING_OPTION_KEYWORD </dt>
<dd class="description">Missing option keyword</dd>
<dt>PPD_MISSING_PPDADOBE4 </dt>
<dd class="description">Missing PPD-Adobe-4.x header</dd>
<dt>PPD_MISSING_VALUE </dt>
+1 -1
Ver Arquivo
@@ -103,7 +103,7 @@ for more information.</P>
<H2 CLASS="title"><A NAME="IMPLEMENT">Implementation Information</A></H2>
<P>CUPS implements Kerberos over HTTP using GSSAPI and the service name
"host". Because of limitations in the HTTP GSSAPI protocol extension, only
"ipp". Because of limitations in the HTTP GSSAPI protocol extension, only
a single domain/KDC is supported for authentication.</P>
<P>When doing printing tasks that require authentication, CUPS requests a
+21 -4
Ver Arquivo
@@ -123,8 +123,7 @@ to the access log file. The following levels are defined:</P>
Allow from nnn.nnn.nnn.nnn
Allow from nnn.nnn.nnn.nnn/mm
Allow from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
Allow from [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]
Allow from [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]/mmm
Allow from xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
Allow from @LOCAL
Allow from @IF(name)
&lt;/Location&gt;
@@ -945,6 +944,25 @@ of authentication to use for IPP operations that require a
username. The default is <CODE>Basic</CODE>.</P>
<H2 CLASS="title"><A NAME="DefaultCharset">DefaultCharset</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
DefaultCharset utf-8
DefaultCharset iso-8859-1
DefaultCharset windows-1251
</PRE>
<H3>Description</H3>
<P>The <CODE>DefaultCharset</CODE> directive sets the default
character set to use for client connections. The default
character set is <CODE>utf-8</CODE> but is overridden by the
character set for the language specified by the client or the
<CODE>DefaultLanguage</CODE> directive.</P>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultEncryption">DefaultEncryption</A></H2>
<H3>Examples</H3>
@@ -1053,8 +1071,7 @@ printers are shared (published) by default. The default is
Deny from nnn.nnn.nnn.nnn
Deny from nnn.nnn.nnn.nnn/mm
Deny from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
Deny from [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]
Deny from [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]/mmm
Deny from xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
Deny from @LOCAL
Deny from @IF(name)
&lt;/Location&gt;
+2 -2
Ver Arquivo
@@ -45,10 +45,10 @@ the page started printing. The format of this field is identical
to the <I>data-time</I> field in the <VAR>access_log</VAR>
file.</P>
<P>The <I>page-number</I> and <I>num-copies</I> fields contain the
<P>The <I>page-number</I> and <I>num-pages</I> fields contain the
page number and number of copies being printed of that page. For
printers that cannot produce copies on their own, the
<I>num-copies</I> field will always be 1.</P>
<I>num-pages</I> field will always be 1.</P>
<P>The <I>job-billing</I> field contains a copy of the
<CODE>job-billing</CODE> attribute provided with the IPP
+45 -32
Ver Arquivo
@@ -103,11 +103,13 @@ diff -urN olddirectory directory >filename.patch
in their entirety, however that may delay the adoption of your
changes.</P>
<BLOCKQUOTE>Patches and files must conform to the standards outlined in the
"<A HREF="#CODING">Coding Guidelines</A>" and "<A HREF="#MAKEFILES">Makefile
Guidelines</A>" sections in this document. In addition, since Apple Inc.
provides CUPS under multiple licenses, we require that you assign the copyright
for your changes and files to us for inclusion in CUPS.</BLOCKQUOTE>
<BLOCKQUOTE>Patches and files must conform to the standards
outlined in the "<A HREF="#CODING">Coding Guidelines</A>" and "<A
HREF="#MAKEFILES">Makefile Guidelines</A>" sections in this
document. In addition, since Apple Inc. provides CUPS
under multiple licenses, we require that you assign the copyright
for your changes and files to us for inclusion in
CUPS.</BLOCKQUOTE>
<H2 CLASS="title"><A NAME="PRACTICES">Software Development Practices</A></H2>
@@ -149,45 +151,51 @@ MAJOR.MINOR.PATCH
2.0.0
</PRE>
<P>The first production release in a MAJOR.MINOR series (MAJOR.MINOR.0) is
called a feature release. Feature releases are the only releases that may
contain new features. Subsequent production releases in a MAJOR.MINOR series may
only contain bug fixes.</P>
<P>The first production release in a MAJOR.MINOR series
(MAJOR.MINOR.0) is called a feature release. Feature releases are
the only releases that may contain new features. Subsequent
production releases in a MAJOR.MINOR series may only contain bug
fixes.</P>
<BLOCKQUOTE>We did not hold to this limitation in the CUPS 1.1 series for a
variety of reasons. Starting with CUPS 1.2, the "no new features in a patch
release" policy has been strictly enforced. The policy has also resulted in
fewer new features (and interactions!) to validate/test in the subsequence
feature releases.</BLOCKQUOTE>
<BLOCKQUOTE>We did not hold to this limitation in the CUPS 1.1
series for a variety of reasons. Starting with CUPS 1.2, the "no
new features in a patch release" policy will be strictly
enforced. This should yield more frequent minor releases with
fewer new features (and interactions!) to
validate/test.</BLOCKQUOTE>
<P>Beta-test releases are identified by appending the letter B to the major and
minor version numbers followed by the beta release number:</P>
<P>Beta-test releases are identified by appending the letter B
to the major and minor version numbers followed by the beta
release number:</P>
<PRE CLASS="command">
MAJOR.MINORbNUMBER
1.2b1
</PRE>
<P>Release candidates are identified by appending the letters RC to the major
and minor version numbers followed by the release candidate number:</P>
<P>Release candidates are identified by appending the letters RC
to the major and minor version numbers followed by the release
candidate number:</P>
<PRE CLASS="command">
MAJOR.MINORrcNUMBER
1.2rc1
</PRE>
<P>Developer snapshots are identified by appending the letters SVN-R to the
major and minor version numbers followed by the revision number:</P>
<P>Developer snapshots are identified by appending the letters
SVN-R to the major and minor version numbers followed by the
revision number:</P>
<PRE CLASS="command">
MAJOR.MINORsvn-rREV
1.2svn-r1234
</PRE>
<P>Beta-test releases, release candidates, and developer snapshots are only
created for new minor releases. Once a production release has been made
(MAJOR.MINOR.0), subsequent patch releases are issues without preliminary beta
or release testing.</P>
<P>Beta-test releases, release candidates, and developer
snapshots are only created for new minor releases. Once a
production release has been made (MAJOR.MINOR.0), subsequent
patch releases are issues without preliminary beta or release
testing.</P>
<H3>Version Control (Subversion)</H3>
@@ -204,9 +212,16 @@ applicable STRs. The following format <em>must</em> be used for
commit log messages:</P>
<PRE CLASS="command">
Summary of the change on one line followed by bug number (STR #NNNN)
Summary of the change ("fix PostScript printing bug") along
with corresponding STRs ("STR #1, STR #6")
Detailed list of changes.
foo.cxx:
- function(): Detailed list of changes
- function2(): Detailed list of changes
- Summary of design changes ("added new foo struct")
bar.h:
- More detailed changes
</PRE>
<P>Primary development occurs on the <var>trunk</var> branch,
@@ -610,7 +625,7 @@ the Subversion "&#36;Id$" tag:</P>
*
* Description of file contents.
*
* Copyright 2010 by Apple Inc.
* Copyright 2007 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -688,14 +703,12 @@ special text in the function description comment:</P>
<UL>
<LI><CODE>@deprecated@</CODE> - Marks the function as
deprecated (not recommended for new development and
scheduled for removal)</LI>
<LI><CODE>@since CUPS <I>version</I>@</CODE> - Marks the
function as new in the specified version of CUPS.</LI>
<LI><CODE>@private@</CODE> - Marks the function as private.</LI>
<LI><CODE>@deprecated@</CODE> - Marks the function as
deprecated (not recommended for new development and
scheduled for removal)</LI>
</UL>
+6 -14
Ver Arquivo
@@ -8,7 +8,7 @@
</head>
<body>
<!--
"$Id: spec-ppd.html 9143 2010-05-21 15:36:30Z mike $"
"$Id: spec-ppd.html 8673 2009-05-22 17:34:15Z mike $"
CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
@@ -161,8 +161,9 @@ based on well-known colorspaces such as sRGB and Adobe RGB.</p>
<blockquote><b>Note:</b>
<p>At this time, none of the CUPS raster filters support ICC profiles. This
will be addressed as time and resources permit.</p>
<p>At this time, none of the CUPS raster
filters support ICC profiles. This will be addressed as time
and resources permit.</p>
</blockquote>
@@ -173,7 +174,7 @@ gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"</p>
<p>This string attribute specifies an sRGB-based color profile
consisting of gamma and density controls and a 3x3 CMY color
transform matrix. <em>This attribute is not supported on Mac OS X.</em></p>
transform matrix.</p>
<p>The <i>Resolution</i> and <i>MediaType</i> values may be "-"
to act as a wildcard. Otherwise they must match one of the
@@ -276,15 +277,6 @@ data as requested by the driver. The <tt>APCustomColorMatchingProfile</tt>
and <tt>APDefaultColorMatchingProfile</tt> attributes specify alternate
color profiles (sRGB or AdobeRGB) to use for 3-color (RGB) raster data.</p>
<blockquote><b>Note:</b>
<p>Prior to Mac OS X 10.6, the default RGB color space was Apple's "GenericRGB".
The new default in Mac OS X 10.6 and later is "sRGB". For more information, see
<a href="http://support.apple.com/kb/HT3712">"Mac OS X v10.6: About gamma
2.2"</a> on Apple's support site.</p>
</blockquote>
<h4><span class='info'>Mac OS X 10.5</span><a name='APCustomColorMatchingName'>APCustomColorMatchingName</a></h4>
<p class='summary'>*APCustomColorMatchingName name/text: ""</p>
@@ -1806,7 +1798,7 @@ the application. The following preset names are currently defined:</p>
choice (*MainKeyword OptionKeyword) or a preset identifier and value
(com.apple.print.preset.foo value). Preset identifiers and their supported
values are documented in "<a
href='http://developer.apple.com/mac/library/documentation/Printing/Conceptual/PresetDraft/presets_intro/presets_intro.html'
href='http://developer.apple.com/documentation/Printing/Conceptual/PresetDraft/presets_intro/chapter_1_section_2.html'
>Creating Printing Presets for iPhoto: Printing Presets File Format</a>".</p>
<p>Presets, like options, can also be localized in multiple languages.</p>
-107
Ver Arquivo
@@ -1,107 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>Beranda - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
</HEAD>
<BODY>
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR HEIGHT="36">
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
<TD CLASS="sel"><A HREF="/">&nbsp;&nbsp;Beranda&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/admin">&nbsp;&nbsp;Administrasi&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/classes/">&nbsp;&nbsp;Kelas&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/help/">&nbsp;&nbsp;Bantuan&nbsp;Langsung&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/jobs/">&nbsp;&nbsp;Tugas&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/printers/">&nbsp;&nbsp;Pencetak&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Search Help"
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD STYLE="padding-right: 20px;">
<H1>CUPS @CUPS_VERSION@</H1>
<P>CUPS adalah sistem pencetakan berstandar dan berkode sumber terbuka, dikembangkan oleh
<A HREF="http://www.apple.com/">Apple Inc.</A> untuk Mac OS<SUP>&reg;</SUP> X dan sistem
operasi serupa UNIX<SUP>&reg;</SUP> lainnya.</P>
</TD>
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
HEIGHT="128" ALT="CUPS"></A></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
<H2>CUPS bagi Pengguna</H2>
<P><A HREF="help/overview.html">Ikhtisar CUPS</A></P>
<P><A HREF="help/options.html">Opsi dan Pencetakan dari Baris Perintah</A></P>
<P><A HREF="help/whatsnew.html">Apa yang Baru di CUPS 1.4</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum Pengguna</A></P>
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
<H2>CUPS bagi Administrator</H2>
<P><A HREF="admin">Menambah Pencetak dan Kelas</A></P>
<P><A HREF="help/policies.html">Mengatur Kebijakan Operasi</A></P>
<P><A HREF="help/accounting.html">Dasar Akunting Pencetak</A></P>
<P><A HREF="help/security.html">Keamanan Server</A></P>
<P><A HREF="help/kerberos.html">Menggunakan Otentikasi Kerberos</A></P>
<P><A HREF="help/network.html">Menggunakan Pencetak di Jaringan</A></P>
<P><A HREF="help/ref-cupsd-conf.html">Referensi cupsd.conf</A></P>
<P><A HREF="http://www.cups.org/ppd.php">Mencari Penggerak Pencetak</A></P>
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
<H2>CUPS bagi Pengembang</H2>
<P><A HREF="help/api-overview.html">Pengenalan untuk Pemrograman CUPS</A></P>
<P><A HREF="help/api-cups.html">API di CUPS</A></P>
<P><A HREF="help/api-filter.html">Penyaring dan Pemrograman Balik (<I>Backend Programming</I>)</A></P>
<P><A HREF="help/api-httpipp.html">API di HTTP dan IPP</A></P>
<P><A HREF="help/api-ppd.html">API di PPD</A></P>
<P><A HREF="help/api-raster.html">API di Raster</A></P>
<P><A HREF="help/ref-ppdcfile.html">Referensi Kompiler Berkas Penggerak PPD</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Forum Pengembang</A></P>
</TD></TR>
</TABLE>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS dan logo CUPS logo adalah merek dagang dari
<A HREF="http://www.apple.com">Apple Inc.</A> Hak cipta CUPS pada 2007-2010 Apple
Inc. Semua hak terpelihara.</TD></TR>
</TABLE>
</BODY>
</HTML>

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais