Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 68e8fcc5a2 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.2.1@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
446 arquivos alterados com 39095 adições e 14342 exclusões
+185 -3
Ver Arquivo
@@ -1,7 +1,189 @@
CHANGES.txt - 2006-04-07
CHANGES.txt - 2006-05-22
------------------------
CHANGES IN CUPS V1.2
CHANGES IN CUPS V1.2.1
- The web interface did not handle reloads properly for
MSIE (STR #1716)
- The configure script no longer adds linker rpath
options when they are unnecessary.
- The scheduler could crash printing a debug message on
Solaris (STR #1714)
- The --enable-32bit and --enable-64bit configure options
did not always work.
- The password prompt showed the domain socket address
instead of "localhost" for local authentication (STR
#1706)
- The web interface filtered the list of printers even if
the user wasn't logged in (STR #1700)
- The IPP backend did not work reliably with some Xerox
printers (STR #1704)
- Trailing banners were not added when printing a single
file (STR #1698)
- The web interface support programs crashed on Solaris
(STR #1699)
- cupstestppd incorrectly reported problems with
*1284DeviceID attributes (STR #1710)
- Browsing could get disabled after a restart (STR #1670)
- Custom page sizes were not parsed properly (STR #1709)
- The -U option wasn't supported by lpadmin (STR #1702)
- The -u option didn't work with lpadmin (STR #1703)
- The scheduler did not create non-blocking back-channel
pipes, which caused problems when the printer driver
did not read the back-channel data (STR #1705)
- The scheduler no longer uses chunking in responses to
clients - this caused problems with older versions of
CUPS like 1.1.17 (PR #6143)
- Automatic raw printing was broken (STR #1667)
- 6-up printing was broken (STR #1697)
- The pstops filter did not disable CTRL-D processing on
the printer/RIP.
- ppdOpen*() did not load custom options properly (STR
#1680)
- "Set Printer Options" in the web interface did not
update the DefaultImageableArea or
DefaultPaperDimension attributes in the PPD file (STR
#1689)
- Fixed compile errors (STR #1682, STR #1684, STR #1685,
STR #1690)
- The lpstat command displayed the wrong error message
for a missing destination (STR #1683)
- Revised and completed the Polish translation (STR
#1669)
- Stopped jobs did not show up in the list of active jobs
(STR #1676)
- The configure script did not use the GNU TLS
"libgnutls-config" script to find the proper compiler
and linker options.
- The imagetoraster filter did not correctly generate
several 1, 2, and 4-bit color modes.
- cupsRasterWritePixels() could lose track of the current
output row.
- cupsRasterReadPixels() did not automatically swap
12/16-bit chunked pixel data.
- Moved the private _cups_raster_s structure out of the
public header.
- Updated the CUPS raster format specification to include
encoding rules and colorspace definitions.
- The Zebra PPD files had the wrong PostScript code for
the "default" option choices.
- The imagetoraster filter did not generate correct CIE
XYZ or Lab color data.
- The cups-config script did not work when invoked from a
source directory (STR #1673)
- The SNMP backend did not compile on systems that used
the getifaddrs emulation functions (STR #1668)
CHANGES IN CUPS V1.2.0
- Documentation updates (STR #1618, STR #1620, STR #1622,
STR #1637)
- Static file copy buffers reduced from 64k to 32k to
work around bogus MallocDebug library assumptions (STR
#1660)
- The scheduler did not decode the backend exit code
properly (STR #1648)
- The MacOS X USB backend did not report the 1284 device ID,
nor did it fix device IDs returned by HP printers.
- The scheduler started more slowly than 1.1.x with large
numbers of printers (STR #1653)
- cupsRasterInterpretPPD() didn't support the
cupsPreferredBitsPerColor attribute, and imagetoraster
didn't use the new API.
- The "make test" script did not create all of the necessary
subdirectories for testing (STR #1638)
- The scheduler did not prevent rotation of logs
redirected to /dev/null (STR #1651)
- "make test" did not include the SNMP backend in the
test environment (STR #1625)
- The EPM packaging files did not work (STR #1621)
- "Use Default Configuration" inserted a broken
configuration file (STR #1624)
- Redirects in the web interface did not always preserve
the encrypted status of a connection (STR #1603)
- Added the Apple "pap" backend.
- Added CUPS library to CUPS Image shared library
linkage to support Linux --as-needed linker option
(STR #1606)
- Fixed support for --enable-pie (STR #1609)
- The pdftops filter did not validate the length of the
encryption key (STR #1608)
- Updated the Polish localization.
- "Encryption Required" in the cupsd.conf file now only
requires encryption when the connection is not over the
loopback interface or domain socket.
- Printer names containing "+" were not quoted properly in
the web interface (STR #1600)
- The SNMP backend now reports the make and model in the
information string so that the auto-generated printer
name is more useful than just an IP address.
CHANGES IN CUPS V1.2rc3
- The cups-lpd program always did reverse lookups on the
client address, which could be a performance problem.
Added a "-n" option to disable lookups.
- When configured with SSL support, require encryption by
default when displaying the /admin location (STR #1592)
- The next job ID was not computed correctly if the job
cache file got out of sync with the spool directory
(STR #1582)
- The PNG image handling code used deprecated functions
from libpng (STR #1587)
- Added a Polish translation (STR #1584, STR #1586)
- More changes to the scheduler to improve battery life
on portable devices (STR #1583)
- Changed the default log level for status messages back
to "DEBUG" to be consistent with CUPS 1.1.x (STR #1579)
- The error string was not set properly when
cupsDoFileRequest() was given the name of a directory
(STR #1578)
- Fixed handling of job-hold-until (STR #1581)
- Added explicit notes to the cupsaddsmb man page
explaining that the driver filenames are case-sensitive
under UNIX and that they must be all lowercase (Windows
2000) or all UPPERCASE (Windows 95/98/Me) to work (STR
#1568)
- The USB backend incorrectly split the manufacturer name
if it contained spaces (STR #1566)
- The scheduler would hang when listing PPD files for a
manufacturer whose name contained spaces (STR #1567)
- Added the SNMP backend for network printer discovery
(STR #1555)
- cupstestppd now fails PPD files with 1284DeviceId
instead of 1284DeviceID, and cups-driverd uses a
case-insensitive comparison when looking for it (STR
#1573)
- cupsDoFileRequest() and cupsDoRequest() now work
properly with non-blocking HTTP connections.
- Added Swedish translation (STR #1569)
- "make install" now installs the MIME files with world
read permissions (STR #1565)
- More CDSA encryption support fixes (STR #1563)
- Updated the default mime.types file to support printing
of files that do not have a locally-recognized MIME
media type to raw or System V queues.
- Updated the serial port detection code on Linux (STR
#1562)
- Added some more error checking to httpGetHostname()
(STR #1561)
- The title of some administration pages was not
localized (STR #1548)
- The edit-config.tmpl file was not generated or
installed for the Spanish or Japanese localizations
(STR #1547)
- The mimeDelete() function freed the types before the
filters, but the filters needed the type data (STR #1558)
- The scheduler didn't keep track of the status pipes
properly, leading to a bad select() for multi-file jobs
(STR #1559)
- The cupstestdsc program didn't validate the ordinal
page number value for %%Page: comments.
CHANGES IN CUPS V1.2rc2
- The scheduler was not always using the string pool,
causing random crashes.
@@ -99,7 +281,7 @@ CHANGES IN CUPS V1.2rc1
#1488)
- ppdOpen2() now converts the NickName and all UI text to
UTF-8 (STR #1475)
- The Set Allows Users web page did not work (STR #1486)
- The Set Allowed Users web page did not work (STR #1486)
- When the default policy was not set or set to a non-
existing policy, the scheduler did not set the default
policy name to "default" (STR #1484)
+3 -3
Ver Arquivo
@@ -1,4 +1,4 @@
CREDITS.txt - 2006-02-23
CREDITS.txt - 2006-04-17
------------------------
Few projects are completed by one person, and CUPS is no exception. We'd
@@ -24,10 +24,10 @@ like to thank the following individuals for their contributions:
Jeff Licquia - Bug fixes, beta testing, evangelism.
Jason McMullan - Original CUPS RPM distributions.
Wes Morgan - *BSD fixes.
Ulrich Oldendorf - German locale.
Daniel Nylander - Swedish localization.
Giulio Orsero - Bug fixes and testing.
Michal Osowiecki - Polish localization.
Kurt Pfeifle - Bug fixes, beta testing, evangelism.
Gilles QUERRET - French man pages.
Petter Reinholdtsen - HP-UX compiler stuff.
Juan Pablo González Riopedre - Spanish localization
Stuart Stevens - HP JetDirect IPP information.
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
INSTALL - CUPS v1.2rc1 - 2006-03-24
-----------------------------------
INSTALL - CUPS v1.2.0 - 2006-05-08
----------------------------------
This file describes how to compile and install CUPS from source
code. For more information on CUPS see the file called
+4 -1
Ver Arquivo
@@ -130,13 +130,14 @@ DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
IMGLIBS = @IMGLIBS@ -lm
IMGFILTERS = @IMGFILTERS@
LDFLAGS = -L../cups -L../filter $(RC_CFLAGS) $(ARCHFLAGS) \
@LDFLAGS@ $(OPTIM)
@LDFLAGS@ @PIEFLAGS@ $(OPTIM)
LINKCUPS = @LINKCUPS@ $(SSLLIBS)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
LIBS = $(LINKCUPS) $(COMMONLIBS)
OPTIM = @OPTIM@
OPTIONS =
PAMLIBS = @PAMLIBS@
PAP = @PAP@
PDFTOPS = @PDFTOPS@
PHPDIR = @PHPDIR@
SSLFLAGS = @SSLFLAGS@
@@ -148,6 +149,7 @@ LAUNCHDLIBS = @LAUNCHDLIBS@
#
ARCH32FLAGS = @ARCH32FLAGS@
DSO32FLAGS = @DSO32FLAGS@
INSTALL32 = @INSTALL32@
LIB32CUPS = @LIB32CUPS@
LIB32CUPSIMAGE = @LIB32CUPSIMAGE@
@@ -155,6 +157,7 @@ LIB32DIR = $(BUILDROOT)@LIB32DIR@
UNINSTALL32 = @UNINSTALL32@
ARCH64FLAGS = @ARCH64FLAGS@
DSO64FLAGS = @DSO64FLAGS@
INSTALL64 = @INSTALL64@
LIB64CUPS = @LIB64CUPS@
LIB64CUPSIMAGE = @LIB64CUPSIMAGE@
+23 -1
Ver Arquivo
@@ -57,6 +57,25 @@ clean:
done
#
# Remove all non-distribution files...
#
distclean: clean
$(RM) Makedefs config.h config.log config.status
$(RM) cups-config conf/cupsd.conf conf/pam.std
$(RM) doc/help/standard.html doc/index.html
$(RM) init/cups.sh init/cups-lpd
$(RM) man/cups-deviced.man man/cups-driverd.man
$(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
$(RM) man/cupsd.conf.man man/lpoptions.man
$(RM) packaging/cups templates/edit-config.tmpl templates/header.tmpl
-$(RM) doc/*/index.html
-$(RM) templates/*/edit-config.tmpl
-$(RM) templates/*/header.tmpl
-$(RM) -r autom4te*.cache
#
# Make dependencies
#
@@ -80,8 +99,8 @@ install: installhdrs
echo Installing cups-config script...
$(INSTALL_DIR) -m 755 $(BINDIR)
$(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
echo Installing startup script...
if test "x$(INITDIR)" != x; then \
echo Installing init scripts...; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
@@ -96,13 +115,16 @@ install: installhdrs
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
echo Installing StartupItems files...; \
$(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
$(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
echo Installing LaunchDaemons configuration file...; \
$(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
else \
echo Installing RC script...; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
fi \
fi
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
README - CUPS v1.2rc1 - 2006-03-24
----------------------------------
README - CUPS v1.2.0 - 2006-05-08
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
instead...
+5
Ver Arquivo
@@ -19,6 +19,11 @@ scsi.o: ../cups/language.h ../cups/string.h ../config.h
serial.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
serial.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
serial.o: ../cups/language.h ../cups/string.h ../config.h
snmp.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
snmp.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
snmp.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
snmp.o: ../cups/string.h ../cups/array.h ../cups/file.h ieee1284.c
snmp.o: ../cups/debug.h
socket.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
socket.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
socket.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
+21 -3
Ver Arquivo
@@ -27,10 +27,10 @@
include ../Makedefs
RBACKENDS = ipp lpd
UBACKENDS = parallel scsi serial socket usb
UBACKENDS = $(PAP) parallel scsi serial snmp socket usb
TARGETS = betest test1284 $(RBACKENDS) $(UBACKENDS)
OBJS = betest.o ipp.o lpd.o parallel.o scsi.o \
serial.o socket.o test1284.o usb.o
OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \
serial.o snmp.o socket.o test1284.o usb.o
#
@@ -136,6 +136,15 @@ lpd: lpd.o ../cups/$(LIBCUPS)
$(CC) $(LDFLAGS) -o lpd lpd.o $(LIBS)
#
# pap
#
pap: pap.o ../cups/$(LIBCUPS)
echo Linking $@...
$(CC) $(LDFLAGS) -o pap pap.o $(BACKLIBS) $(LIBS) -framework AppleTalk
#
# parallel
#
@@ -165,6 +174,15 @@ serial: serial.o ../cups/$(LIBCUPS)
$(CC) $(LDFLAGS) -o serial serial.o $(BACKLIBS) $(LIBS)
#
# snmp
#
snmp: snmp.o ../cups/$(LIBCUPS)
echo Linking $@...
$(CC) $(LDFLAGS) -o snmp snmp.o $(LIBS)
#
# socket
#
+248 -111
Ver Arquivo
@@ -25,8 +25,9 @@
*
* Contents:
*
* get_device_id() - Get the IEEE-1284 device ID string and corresponding
* URI.
* get_device_id() - Get the IEEE-1284 device ID string and corresponding
* URI.
* get_make_model() - Get the make and model string from the device ID.
*/
/*
@@ -34,21 +35,14 @@
*/
#include <cups/debug.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)
#endif /* __linux */
#ifdef __sun
# ifdef __sparc
# include <sys/ecppio.h>
# else
# include <sys/ioccom.h>
# include <sys/ecppsys.h>
# endif /* __sparc */
#endif /* __sun */
/*
* Prototypes...
*/
static int get_make_model(const char *device_id, char *make_model,
int make_model_size);
/*
@@ -56,6 +50,24 @@
* corresponding URI.
*/
#ifndef SNMP_BACKEND
# 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)
# endif /* __linux */
# ifdef __sun
# ifdef __sparc
# include <sys/ecppio.h>
# else
# include <sys/ioccom.h>
# include <sys/ecppsys.h>
# endif /* __sparc */
# endif /* __sun */
int /* O - 0 on success, -1 on failure */
get_device_id(
int fd, /* I - File descriptor */
@@ -70,9 +82,9 @@ get_device_id(
char *attr, /* 1284 attribute */
*delim, /* 1284 delimiter */
*uriptr, /* Pointer into URI */
*mfg, /* Manufacturer string */
*mdl, /* Model string */
manufacturer[256], /* Manufacturer string */
serial_number[1024]; /* Serial number string */
int manulen; /* Length of manufacturer string */
#ifdef __linux
int length; /* Length of device ID info */
#endif /* __linux */
@@ -80,6 +92,7 @@ get_device_id(
struct ecpp_device_id did; /* Device ID buffer */
#endif /* __sun && ECPPIOC_GETDEVID */
DEBUG_printf(("get_device_id(fd=%d, device_id=%p, device_id_size=%d, "
"make_model=%p, make_model_size=%d, scheme=\"%s\", "
"uri=%p, uri_size=%d)\n", fd, device_id, device_id_size,
@@ -174,6 +187,157 @@ get_device_id(
if (!*device_id)
return (-1);
/*
* Get the make and model...
*/
get_make_model(device_id, make_model, make_model_size);
/*
* Then generate a device URI...
*/
if (scheme && uri && uri_size > 32)
{
/*
* Look for the serial number field...
*/
if ((attr = strstr(device_id, "SERN:")) != NULL)
attr += 5;
else if ((attr = strstr(device_id, "SERIALNUMBER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, ";SN:")) != NULL)
attr += 4;
if (attr)
{
strlcpy(serial_number, attr, sizeof(serial_number));
if ((delim = strchr(serial_number, ';')) != NULL)
*delim = '\0';
}
else
serial_number[0] = '\0';
/*
* Generate the device URI from the manufacturer, make_model, and
* serial number strings.
*/
snprintf(uri, uri_size, "%s://", scheme);
if ((attr = strstr(device_id, "MANUFACTURER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, "Manufacturer:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, "MFG:")) != NULL)
attr += 4;
if (attr)
{
strlcpy(manufacturer, attr, sizeof(manufacturer));
if ((delim = strchr(manufacturer, ';')) != NULL)
*delim = '\0';
if (!strcasecmp(manufacturer, "Hewlett-Packard"))
strcpy(manufacturer, "HP");
}
else
{
strlcpy(manufacturer, make_model, sizeof(manufacturer));
if ((delim = strchr(manufacturer, ' ')) != NULL)
*delim = '\0';
}
manulen = strlen(manufacturer);
for (uriptr = uri + strlen(uri), delim = manufacturer;
*delim && uriptr < (uri + uri_size - 3);
delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
*uriptr++ = '/';
if (!strncasecmp(make_model, manufacturer, manulen))
{
delim = make_model + manulen;
while (isspace(*delim & 255))
delim ++;
}
else
delim = make_model;
for (; *delim && uriptr < (uri + uri_size - 3); delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
if (serial_number[0])
{
/*
* Add the serial number to the URI...
*/
strlcpy(uriptr, "?serial=", uri_size - (uriptr - uri));
strlcat(uriptr, serial_number, uri_size - (uriptr - uri));
}
else
*uriptr = '\0';
}
return (0);
}
#endif /* !SNMP_BACKEND */
/*
* 'get_make_model()' - Get the make and model string from the device ID.
*/
int /* O - 0 on success, -1 on failure */
get_make_model(
const char *device_id, /* O - 1284 device ID */
char *make_model, /* O - Make/model */
int make_model_size) /* I - Size of buffer */
{
char *attr, /* 1284 attribute */
*delim, /* 1284 delimiter */
*mfg, /* Manufacturer string */
*mdl; /* Model string */
DEBUG_printf(("get_make_model(device_id=\"%s\", "
"make_model=%p, make_model_size=%d)\n", device_id,
make_model, make_model_size));
/*
* Range check input...
*/
if (!device_id || !*device_id || !make_model || make_model_size < 32)
{
DEBUG_puts("get_make_model: Bad args!");
return (-1);
}
*make_model = '\0';
/*
* Look for the description field...
*/
@@ -224,15 +388,62 @@ get_device_id(
if ((mfg = strstr(device_id, "MANUFACTURER:")) != NULL)
mfg += 13;
else if ((mfg = strstr(device_id, "Manufacturer:")) != NULL)
mfg += 13;
else if ((mfg = strstr(device_id, "MFG:")) != NULL)
mfg += 4;
if ((mdl = strstr(device_id, "MODEL:")) != NULL)
mdl += 6;
else if ((mdl = strstr(device_id, "Model:")) != NULL)
mdl += 6;
else if ((mdl = strstr(device_id, "MDL:")) != NULL)
mdl += 4;
if (attr)
if (mdl)
{
/*
* Build a make-model string from the manufacturer and model attributes...
*/
if (mfg)
{
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
else
strlcpy(make_model, mfg, make_model_size);
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (!strncasecmp(make_model, mdl, strlen(make_model)))
{
/*
* Just copy model string, since it has the manufacturer...
*/
strlcpy(make_model, mdl, make_model_size);
}
else
{
/*
* Concatenate the make and model...
*/
strlcat(make_model, " ", make_model_size);
strlcat(make_model, mdl, make_model_size);
}
}
else
{
/*
* Just copy model string, since it has the manufacturer...
*/
strlcpy(make_model, mdl, make_model_size);
}
}
else if (attr)
{
/*
* Use description...
@@ -257,38 +468,6 @@ get_device_id(
strlcpy(make_model, attr, make_model_size);
}
}
else if (mfg && mdl)
{
/*
* Build a make-model string from the manufacturer and model attributes...
*/
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
else
strlcpy(make_model, mfg, make_model_size);
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (!strncasecmp(make_model, mdl, strlen(make_model)))
{
/*
* Just copy model string, since it has the manufacturer...
*/
strlcpy(make_model, mdl, make_model_size);
}
else
{
/*
* Concatenate the make and model...
*/
strlcat(make_model, " ", make_model_size);
strlcat(make_model, mdl, make_model_size);
}
}
else
{
/*
@@ -298,73 +477,31 @@ get_device_id(
strlcpy(make_model, "Unknown", make_model_size);
}
/*
* Strip trailing data...
*/
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (scheme && uri && uri_size > 32)
{
/*
* Look for the serial number field...
*/
/*
* Strip trailing whitespace...
*/
if ((attr = strstr(device_id, "SERN:")) != NULL)
attr += 5;
else if ((attr = strstr(device_id, "SERIALNUMBER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, ";SN:")) != NULL)
attr += 4;
if (attr)
{
strlcpy(serial_number, attr, sizeof(serial_number));
if ((delim = strchr(serial_number, ';')) != NULL)
*delim = '\0';
}
for (delim = make_model + strlen(make_model) - 1; delim >= make_model; delim --)
if (isspace(*delim & 255))
*delim = '\0';
else
serial_number[0] = '\0';
break;
/*
* Generate the device URI from the make_model and serial number strings.
*/
/*
* Return...
*/
snprintf(uri, uri_size, "%s://", scheme);
for (uriptr = uri + strlen(uri), delim = make_model;
*delim && uriptr < (uri + uri_size - 1);
delim ++)
if (*delim == ' ')
{
delim ++;
*uriptr++ = '/';
break;
}
else
*uriptr++ = *delim;
for (; *delim && uriptr < (uri + uri_size - 3); delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
*uriptr = '\0';
if (serial_number[0])
{
/*
* Add the serial number to the URI...
*/
strlcat(uri, "?serial=", uri_size);
strlcat(uri, serial_number, uri_size);
}
}
return (0);
if (make_model[0])
return (0);
else
return (-1);
}
+2 -2
Ver Arquivo
@@ -276,7 +276,7 @@ main(int argc, /* I - Number of command-line args */
*ptr++ = *optptr++;
*ptr = '\0';
if (*optptr == '+')
if (*optptr == '+' || *optptr == '&')
optptr ++;
}
else
@@ -1215,7 +1215,7 @@ compress_files(int num_files, /* I - Number of files */
*out; /* Output file */
struct stat outinfo; /* Output file information */
char filename[1024], /* Temporary filename */
buffer[65536]; /* Copy buffer */
buffer[32768]; /* Copy buffer */
fprintf(stderr, "DEBUG: Compressing %d job files...\n", num_files);
+1 -1
Ver Arquivo
@@ -590,7 +590,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
#endif /* __APPLE__ */
size_t nbytes; /* Number of bytes written */
off_t tbytes; /* Total bytes written */
char buffer[65536]; /* Output buffer */
char buffer[32768]; /* Output buffer */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+1568
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
-2
Ver Arquivo
@@ -466,8 +466,6 @@ list_devices(void)
strcpy(basedevice, "/dev/parallel/");
else if (!access("/dev/printers/", 0))
strcpy(basedevice, "/dev/printers/");
else if (!access("/dev/par0", 0))
strcpy(basedevice, "/dev/par");
else
strcpy(basedevice, "/dev/lp");
+48 -13
Ver Arquivo
@@ -87,6 +87,11 @@
# include <IOKit/IOBSD.h>
#endif /* __APPLE__ */
#if defined(__linux) && defined(TIOCGSERIAL)
# include <linux/serial.h>
# include <linux/ioctl.h>
#endif /* __linux && TIOCGSERIAL */
/*
* Local functions...
@@ -305,7 +310,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*ptr++ = *options++;
*ptr = '\0';
if (*options == '+')
if (*options == '+' || *options == '&')
options ++;
}
else
@@ -663,21 +668,48 @@ list_devices(void)
{
#if defined(__hpux) || defined(__sgi) || defined(__sun) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static char *funky_hex = "0123456789abcdefghijklmnopqrstuvwxyz";
/* Funky hex numbering used for some devices */
/* Funky hex numbering used for some *
* devices */
#endif /* __hpux || __sgi || __sun || __FreeBSD__ || __OpenBSD__ */
#if defined(__linux) || defined(linux) || defined(__linux__)
int i, j; /* Looping vars */
int fd; /* File descriptor */
char device[255]; /* Device filename */
#ifdef __linux
int i, j; /* Looping vars */
int fd; /* File descriptor */
char device[255]; /* Device filename */
# ifdef TIOCGSERIAL
struct serial_struct serinfo; /* serial port info */
# endif /* TIOCGSERIAL */
for (i = 0; i < 100; i ++)
{
sprintf(device, "/dev/ttyS%d", i);
if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
{
# ifdef TIOCGSERIAL
/*
* See if this port exists...
*/
serinfo.reserved_char[0] = 0;
if (!ioctl(fd, TIOCGSERIAL, &serinfo))
{
if (serinfo.type == PORT_UNKNOWN)
{
/*
* Nope...
*/
close(fd);
continue;
}
}
# endif /* TIOCGSERIAL */
close(fd);
# if defined(_ARCH_PPC) || defined(powerpc) || defined(__powerpc)
printf("serial serial:%s?baud=230400 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
@@ -824,13 +856,13 @@ list_devices(void)
{
sprintf(device, "/dev/cua/%c", 'a' + i);
if (access(device, 0) == 0)
#ifdef B115200
# ifdef B115200
printf("serial serial:%s?baud=115200 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
#else
# else
printf("serial serial:%s?baud=38400 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
#endif /* B115200 */
# endif /* B115200 */
}
/*
@@ -1063,7 +1095,6 @@ list_devices(void)
CFMutableDictionaryRef classesToMatch;
io_object_t serialService;
printf("serial serial \"Unknown\" \"Serial Printer (serial)\"\n");
kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort);
if (KERN_SUCCESS != kernResult)
@@ -1117,8 +1148,8 @@ list_devices(void)
CFRelease(bsdPathAsCFString);
if (result)
printf("serial serial:%s?baud=115200 \"Unknown\" \"%s\"\n", bsdPath,
serialName);
printf("serial serial:%s?baud=115200 \"Unknown\" \"%s\"\n",
bsdPath, serialName);
}
}
}
@@ -1126,7 +1157,11 @@ list_devices(void)
IOObjectRelease(serialService);
}
IOObjectRelease(serialPortIterator); /* Release the iterator. */
/*
* Release the iterator.
*/
IOObjectRelease(serialPortIterator);
}
}
#endif
+2216
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+172
Ver Arquivo
@@ -0,0 +1,172 @@
snmp.txt - 2006-04-19
---------------------
This file lists the "interesting" bits from the command:
snmpwalk -v 1 -c public HOST .1
for many network print servers and internal cards. It is mainly here
for SNMP documentation and development purposes.
AXIS 5600
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM J.sp.00,JETDIRECT EX,JD28,EEPROM 6.16.5
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Hewlett-Packard hp LaserJet 3380
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Axis AXIS 5600
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: Axis AXIS 5600
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.3 = OID: SNMPv2-SMI::zeroDotZero
SNMPv2-SMI::enterprises.11.2.4.3.10.8.0 = STRING: "AXIS433AE8"
SNMPv2-SMI::enterprises.368.2.3.2.601.0 = INTEGER: 9100
SNMPv2-SMI::enterprises.368.2.3.2.602.0 = INTEGER: 9101
SNMPv2-SMI::enterprises.368.2.3.2.603.0 = INTEGER: 9102
SNMPv2-SMI::enterprises.368.2.3.10.901.0 = STRING: "AXIS433AE8"
AXIS OfficeBasic
SNMPv2-MIB::sysDescr.0 = STRING: AXIS OfficeBasic Parallel Network Print Server V6.43 Sep 4 2003
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: EPSON Stylus Photo 870
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
DLink DP-301P+
SNMPv2-MIB::sysDescr.0 = STRING: D-Link DP-301P+ Print Server
Genicom ML280
SNMPv2-MIB::sysDescr.0 = STRING: GENICOM microLaser 280
SNMPv2-MIB::sysName.0 = STRING: PRQ_004F75
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: MANUFACTURER:GENICOM;MODEL:microLaser 280;
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.3369.1.1.2.4
EPSON Type-B Network Card
SNMPv2-MIB::sysDescr.0 = STRING: EPSON Type-B 10Base-T/100Base-TX Print Server
SNMPv2-MIB::sysName.0 = STRING: StylusPro7600-BB87A8
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: EPSON Stylus Pro 7600
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.1248.1.2.1.22.69.109.117.108.97.116.101.83.116.121.108.117.115.32.80.114.111.32.55.54.48.48
SNMPv2-SMI::enterprises.11.2.3.9.1.1.7.0 = STRING: "MFG:EPSON;CMD:ESCPL2,BDC;MDL:Stylus Pro 7600;CLS:PRINTER;DES:EPSON Stylus Pro 7600;"
SNMPv2-SMI::enterprises.1248.1.2.2.1.1.1.1.1 = STRING: "MFG:EPSON;CMD:ESCPL2,BDC;MDL:Stylus Pro 7600;CLS:PRINTER;DES:EPSON Stylus Pro 7600;"
EPSON Wireless 802.11b Print Server
SNMPv2-MIB::sysDescr.0 = STRING: EPSON Wireless LAN Print Interface compatible with an HP JETDIRECT EX
SNMPv2-MIB::sysName.0 = STRING: EAI_0F550B
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING:
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HP JetDirect EX3plus
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM D.04.03,JETDIRECT EX,JD26,EEPROM D.05.22
SNMPv2-MIB::sysName.0 = STRING: NPID1EC0F
HP LJ4000
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM G.05.34,JETDIRECT,JD30,EEPROM G.08.32
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: HP LaserJet 4000 Series
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.11.2.3.9.1.2.5
HP CLJ4550
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM L.20.07,JETDIRECT,JD84,EEPROM L.21.22,CIDATE 07/06/2001
SNMPv2-MIB::sysName.0 = STRING: NPI02FDE7
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: HP Color LaserJet 4550
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Hewlett-Packard Dynamic RAM Disk
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.11.2.3.9.1.2.14
Lexmark C522
SNMPv2-MIB::sysDescr.0 = STRING: Lexmark C522 version NS.NP.N212 kernel 2.6.6 All-N-1
SNMPv2-MIB::sysName.0 = STRING: ET0004000D0CCA
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolatileMemory
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceType.4 = OID: HOST-RESOURCES-TYPES::hrDeviceSerialPort
HOST-RESOURCES-MIB::hrDeviceType.5 = OID: HOST-RESOURCES-TYPES::hrDeviceNetwork
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Lexmark C522 9421TTV LS.FA.P129
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Nonvolatile RAM
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: IBM 750 Rev CXr
HOST-RESOURCES-MIB::hrDeviceDescr.4 = STRING: USB Interface
HOST-RESOURCES-MIB::hrDeviceDescr.5 = STRING: Network Interface
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.3 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.4 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.5 = OID: SNMPv2-SMI::enterprises.641.1
SNMPv2-SMI::enterprises.641.2.1.2.1.2.1 = STRING: "Lexmark C522"
SNMPv2-SMI::enterprises.641.2.1.2.1.3.1 = STRING: "MANUFACTURER:Lexmark International;COMMAND SET:;MODEL:Lexmark C522"
Linksys EPSX3
SNMPv2-MIB::sysDescr.0 = STRING: ETHERNET MULTI-ENVIRONMENT.ROM, JETDIRECT EX, EEPROM 6016
NetGear PS113
SNMPv2-MIB::sysDescr.0 = STRING: A SNMP proxy agent.
Okidata C7200
SNMPv2-MIB::sysDescr.0 = STRING: OkiLAN 6200e
SNMPv2-MIB::sysName.0 = STRING: OKI7009715
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolat
ileMemory
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: C7200
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: FLASH0
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.2001.1.1.1.1
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
SNMPv2-SMI::mib-2.43.14.1.1.3.1.1 = STRING: "IEEE 1284"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.2 = STRING: "EtherTalk Phase 2"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.3 = STRING: "LPD"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.4 = STRING: "Netware Rprinter"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.5 = STRING: "Netware Bindery or NDS Pserver"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.6 = STRING: "Raw TCP Port 9100"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.7 = STRING: "FTP"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.8 = STRING: "DLC/LLC"
SNMPv2-SMI::enterprises.2001.1.1.1.1.1.3530.0 = STRING: "C7200"
Xerox N2025
SNMPv2-MIB::sysDescr.0 = STRING: Xerox DocuPrint N2025 Network Laser Printer - 2.12-02
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceParallelPort
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDeviceNetwork
HOST-RESOURCES-MIB::hrDeviceType.6 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceType.7 = OID: HOST-RESOURCES-TYPES::hrDeviceOther
HOST-RESOURCES-MIB::hrDeviceType.9 = OID: HOST-RESOURCES-TYPES::hrDeviceVolatileMemory
HOST-RESOURCES-MIB::hrDeviceType.10 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolatileMemory
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Xerox DocuPrint N2025 Network Laser Printer - 2.12-02
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: IEEE 1284 port
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: Ethernet port
HOST-RESOURCES-MIB::hrDeviceDescr.6 = STRING: Motorola Power PC
HOST-RESOURCES-MIB::hrDeviceDescr.7 = STRING: USB Port
HOST-RESOURCES-MIB::hrDeviceDescr.9 = STRING: RAM Memory
HOST-RESOURCES-MIB::hrDeviceDescr.10 = STRING: ROM Memory
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.253.8.62.1.3.2.17.1
+14 -2
Ver Arquivo
@@ -228,7 +228,6 @@ static void parse_pserror (char *sockBuffer, int len);
void list_devices()
{
puts("direct usb \"Unknown\" \"USB Printer (usb)\"");
iterate_printers(list_device_callback, NULL);
}
@@ -442,14 +441,26 @@ static Boolean list_device_callback(void *refcon, io_service_t obj)
if (deviceIDString != NULL) {
CFStringRef make = NULL, model = NULL, serial = NULL;
char uristr[1024], makestr[1024], modelstr[1024], serialstr[1024], optionsstr[1024];
char idstr[1024];
copy_deviceinfo(deviceIDString, &make, &model, &serial);
modelstr[0] = '/';
CFStringGetCString(deviceIDString, idstr, sizeof(idstr), kCFStringEncodingUTF8);
CFStringGetCString(make, makestr, sizeof(makestr), kCFStringEncodingUTF8);
CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1, kCFStringEncodingUTF8);
/*
* Fix common HP 1284 bug...
*/
if (!strcasecmp(makestr, "Hewlett-Packard"))
strcpy(makestr, "HP");
if (!strncasecmp(modelstr + 1, "hp ", 3))
_cups_strcpy(modelstr + 1, modelstr + 4);
optionsstr[0] = '\0';
if (serial != NULL)
{
@@ -464,7 +475,8 @@ static Boolean list_device_callback(void *refcon, io_service_t obj)
httpAssembleURI(HTTP_URI_CODING_ALL, uristr, sizeof(uristr), "usb", NULL, makestr, 0, modelstr);
strncat(uristr, optionsstr, sizeof(uristr));
printf("direct %s \"%s %s\" \"%s\"\n", uristr, makestr, &modelstr[1], &modelstr[1]);
printf("direct %s \"%s %s\" \"%s %s USB\" \"%s\"\n", uristr, makestr,
&modelstr[1], makestr, &modelstr[1], idstr);
release_deviceinfo(&make, &model, &serial);
CFRelease(deviceIDString);
+12 -1
Ver Arquivo
@@ -60,6 +60,7 @@ print_device(const char *uri, /* I - Device URI */
int argc, /* I - Number of command-line arguments (6 or 7) */
char *argv[]) /* I - Command-line arguments */
{
int usebc; /* Use backchannel path? */
int fd; /* USB device */
int rbytes; /* Number of bytes read */
int wbytes; /* Number of bytes written */
@@ -82,6 +83,14 @@ print_device(const char *uri, /* I - Device URI */
(void)argc;
(void)argv;
/*
* Disable backchannel data when printing to Canon USB printers - apparently
* Canon printers will return the IEEE-1284 device ID over and over and over
* when they get a read request...
*/
usebc = strcasecmp(hostname, "Canon") != 0;
/*
* Open the USB port device...
*/
@@ -238,7 +247,9 @@ print_device(const char *uri, /* I - Device URI */
do
{
FD_ZERO(&input);
FD_SET(fd, &input);
if (usebc)
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
+62 -36
Ver Arquivo
@@ -93,7 +93,8 @@ main(int argc, /* I - Number of command-line arguments */
if (!http)
{
perror("ERROR: Unable to connect to cupsd");
fprintf(stderr, "DEBUG: cupsServer()=\"%s\"\n", cupsServer());
fprintf(stderr, "DEBUG: cupsServer()=\"%s\"\n",
cupsServer() ? cupsServer() : "(null)");
fprintf(stderr, "DEBUG: ippPort()=%d\n", ippPort());
fprintf(stderr, "DEBUG: cupsEncryption()=%d\n", cupsEncryption());
exit(1);
@@ -481,7 +482,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
char refresh[1024]; /* Refresh URL */
cgiFormEncode(uri, name, sizeof(uri));
snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=/classes/%s",
snprintf(refresh, sizeof(refresh), "5;URL=/admin/?OP=redirect&URL=/classes/%s",
uri);
cgiSetVariable("refresh_page", refresh);
@@ -506,9 +507,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
int modify) /* I - Modify the printer? */
{
int i; /* Looping var */
int element; /* Element number */
ipp_attribute_t *attr, /* Current attribute */
*last; /* Last attribute */
ipp_attribute_t *attr; /* Current attribute */
ipp_t *request, /* IPP request */
*response, /* IPP response */
*oldinfo; /* Old printer information */
@@ -536,8 +535,9 @@ do_am_printer(http_t *http, /* I - HTTP connection */
};
ptr = cgiGetVariable("DEVICE_URI");
fprintf(stderr, "DEBUG: do_am_printer: DEVICE_URI=\"%s\"\n",
cgiGetVariable("DEVICE_URI"));
ptr ? ptr : "(null)");
title = cgiText(modify ? _("Modify Printer") : _("Add Printer"));
@@ -855,27 +855,31 @@ do_am_printer(http_t *http, /* I - HTTP connection */
* Got the list of PPDs, see if the user has selected a make...
*/
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
if (var == NULL)
if (cgiSetIPPVars(response, NULL, NULL, NULL, 0) == 0)
{
/*
* Let the user choose a make...
* No PPD files with this make, try again with all makes...
*/
for (element = 0, attr = response->attrs, last = NULL;
attr != NULL;
attr = attr->next)
if (attr->name && strcmp(attr->name, "ppd-make") == 0)
if (last == NULL ||
strcasecmp(last->values[0].string.text,
attr->values[0].string.text) != 0)
{
cgiSetArray("PPD_MAKE", element, attr->values[0].string.text);
element ++;
last = attr;
}
ippDelete(response);
request = ippNewRequest(CUPS_GET_PPDS);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, "ipp://localhost/printers/");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", NULL, "ppd-make");
if ((response = cupsDoRequest(http, request, "/")) != NULL)
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
cgiStartHTML(title);
cgiCopyTemplateLang("choose-make.tmpl");
cgiEndHTML();
}
else if (!var)
{
cgiStartHTML(title);
cgiCopyTemplateLang("choose-make.tmpl");
cgiEndHTML();
@@ -931,7 +935,6 @@ do_am_printer(http_t *http, /* I - HTTP connection */
cgiEndHTML();
}
ippDelete(response);
}
else
@@ -1040,7 +1043,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
"5;/admin/?OP=redirect&URL=/printers/%s", uri);
else
snprintf(refresh, sizeof(refresh),
"5;/admin/?OP=set-printer-options&PRINTER_NAME=%s", uri);
"5;URL=/admin/?OP=set-printer-options&PRINTER_NAME=%s", uri);
cgiSetVariable("refresh_page", refresh);
@@ -1182,7 +1185,7 @@ do_config_printer(http_t *http) /* I - HTTP connection */
ppdLocalize(ppd);
cgiStartHTML("Set Printer Options");
cgiStartHTML(cgiText(_("Set Printer Options")));
cgiCopyTemplateLang("set-printer-options-header.tmpl");
if (ppdConflicts(ppd))
@@ -1451,7 +1454,7 @@ do_config_printer(http_t *http) /* I - HTTP connection */
if (!in || !out)
{
cgiSetVariable("ERROR", strerror(errno));
cgiStartHTML("Set Printer Options");
cgiStartHTML(cgiText(_("Set Printer Options")));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -1488,7 +1491,9 @@ do_config_printer(http_t *http) /* I - HTTP connection */
*keyptr = '\0';
if (!strcmp(keyword, "PageRegion"))
if (!strcmp(keyword, "PageRegion") ||
!strcmp(keyword, "PaperDimension") ||
!strcmp(keyword, "ImageableArea"))
var = cgiGetVariable("PageSize");
else
var = cgiGetVariable(keyword);
@@ -1560,7 +1565,7 @@ do_config_printer(http_t *http) /* I - HTTP connection */
cgiFormEncode(uri, printer, sizeof(uri));
snprintf(refresh, sizeof(refresh),
"5;/admin/?OP=redirect&URL=/printers/%s", uri);
"5;URL=/admin/?OP=redirect&URL=/printers/%s", uri);
cgiSetVariable("refresh_page", refresh);
cgiStartHTML(title);
@@ -1622,7 +1627,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
}
else
{
cgiSetVariable("refresh_page", "5;/admin/?OP=redirect");
cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
cgiStartHTML(cgiText(_("Change Settings")));
cgiCopyTemplateLang("restart.tmpl");
}
@@ -1716,7 +1721,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
}
else
{
cgiSetVariable("refresh_page", "5;/admin/?OP=redirect");
cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
cgiStartHTML(cgiText(_("Edit Configuration File")));
cgiCopyTemplateLang("restart.tmpl");
@@ -1814,7 +1819,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
* Show the current config file...
*/
cgiStartHTML("Edit Configuration File");
cgiStartHTML(cgiText(_("Edit Configuration File")));
printf("<!-- \"%s\" -->\n", filename);
@@ -1837,10 +1842,13 @@ do_delete_class(http_t *http) /* I - HTTP connection */
const char *pclass; /* Printer class name */
cgiStartHTML(cgiText(_("Delete Class")));
/*
* Get form variables...
*/
if (cgiGetVariable("CONFIRM") == NULL)
{
cgiStartHTML(cgiText(_("Delete Class")));
cgiCopyTemplateLang("class-confirm.tmpl");
cgiEndHTML();
return;
@@ -1851,6 +1859,7 @@ do_delete_class(http_t *http) /* I - HTTP connection */
"localhost", 0, "/classes/%s", pclass);
else
{
cgiStartHTML(cgiText(_("Delete Class")));
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -1877,6 +1886,12 @@ do_delete_class(http_t *http) /* I - HTTP connection */
ippDelete(cupsDoRequest(http, request, "/admin/"));
/*
* Show the results...
*/
cgiStartHTML(cgiText(_("Delete Class")));
if (cupsLastError() > IPP_OK_CONFLICT)
cgiShowIPPError(_("Unable to delete class:"));
else
@@ -1898,10 +1913,13 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
const char *printer; /* Printer printer name */
cgiStartHTML(cgiText(_("Delete Printer")));
/*
* Get form variables...
*/
if (cgiGetVariable("CONFIRM") == NULL)
{
cgiStartHTML(cgiText(_("Delete Printer")));
cgiCopyTemplateLang("printer-confirm.tmpl");
cgiEndHTML();
return;
@@ -1912,6 +1930,7 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
"localhost", 0, "/printers/%s", printer);
else
{
cgiStartHTML(cgiText(_("Delete Printer")));
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -1938,6 +1957,12 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
ippDelete(cupsDoRequest(http, request, "/admin/"));
/*
* Show the results...
*/
cgiStartHTML(cgiText(_("Delete Printer")));
if (cupsLastError() > IPP_OK_CONFLICT)
cgiShowIPPError(_("Unable to delete printer:"));
else
@@ -2457,7 +2482,7 @@ do_printer_op(http_t *http, /* I - HTTP connection */
cgiRewriteURL(uri, url, sizeof(url), NULL);
cgiFormEncode(uri, url, sizeof(uri));
snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri);
snprintf(refresh, sizeof(refresh), "5;URL=/admin/?OP=redirect&URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
cgiStartHTML(title);
@@ -2715,7 +2740,8 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */
cgiRewriteURL(uri, url, sizeof(url), NULL);
cgiFormEncode(uri, url, sizeof(uri));
snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri);
snprintf(refresh, sizeof(refresh), "5;URL=/admin/?OP=redirect&URL=%s",
uri);
cgiSetVariable("refresh_page", refresh);
cgiStartHTML(cgiText(_("Set Allowed Users")));
@@ -2805,7 +2831,7 @@ do_set_sharing(http_t *http) /* I - HTTP connection */
cgiRewriteURL(uri, url, sizeof(url), NULL);
cgiFormEncode(uri, url, sizeof(uri));
snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri);
snprintf(refresh, sizeof(refresh), "5;URL=/admin/?OP=redirect&URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
cgiStartHTML(cgiText(_("Set Publishing")));
+6 -6
Ver Arquivo
@@ -95,8 +95,7 @@ main(int argc, /* I - Number of command-line arguments */
* See who is logged in...
*/
if ((user = getenv("REMOTE_USER")) == NULL)
user = "guest";
user = getenv("REMOTE_USER");
/*
* Connect to the HTTP server...
@@ -187,7 +186,7 @@ main(int argc, /* I - Number of command-line arguments */
void
show_all_classes(http_t *http, /* I - Connection to server */
const char *user) /* I - Username */
const char *user) /* I - Username */
{
int i; /* Looping var */
ipp_t *request, /* IPP request */
@@ -221,8 +220,9 @@ show_all_classes(http_t *http, /* I - Connection to server */
request = ippNewRequest(CUPS_GET_CLASSES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
if (user)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
cgiGetAttributes(request, "classes.tmpl");
@@ -419,7 +419,7 @@ show_class(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, pclass, sizeof(uri));
snprintf(refresh, sizeof(refresh), "10;/classes/%s", uri);
snprintf(refresh, sizeof(refresh), "10;URL=/classes/%s", uri);
cgiSetVariable("refresh_page", refresh);
}
+2 -1
Ver Arquivo
@@ -187,7 +187,8 @@ main(int argc, /* I - Number of command-line arguments */
topic = cgiGetVariable("TOPIC");
si = helpSearchIndex(hi, query, topic, helpfile);
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n", query, topic);
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n",
query ? query : "(null)", topic ? topic : "(null)");
if (si)
{
+2 -1
Ver Arquivo
@@ -175,7 +175,8 @@ cgi_null_passwd(const char *prompt) /* I - Prompt string (unused) */
{
(void)prompt;
fprintf(stderr, "DEBUG: cgi_null_passwd(prompt=\"%s\") called!\n", prompt);
fprintf(stderr, "DEBUG: cgi_null_passwd(prompt=\"%s\") called!\n",
prompt ? prompt : "(null)");
return (NULL);
}
+8 -6
Ver Arquivo
@@ -482,7 +482,7 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
{
cgiRewriteURL(job_printer_uri, resource, sizeof(resource), NULL);
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
@@ -598,7 +598,7 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
@@ -774,7 +774,7 @@ cgiSetIPPObjectVars(
fprintf(stderr, "DEBUG2: cgiSetIPPObjectVars(obj=%p, prefix=\"%s\", "
"element=%d)\n",
obj, prefix, element);
obj, prefix ? prefix : "(null)", element);
/*
* Set common CGI template variables...
@@ -977,7 +977,9 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */
fprintf(stderr, "DEBUG2: cgiSetIPPVars(response=%p, filter_name=\"%s\", "
"filter_value=\"%s\", prefix=\"%s\", parent_el=%d)\n",
response, filter_name, filter_value, prefix, parent_el);
response, filter_name ? filter_name : "(null)",
filter_value ? filter_value : "(null)",
prefix ? prefix : "(null)", parent_el);
/*
* Set common CGI template variables...
@@ -1035,9 +1037,9 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */
attr = cgiSetIPPObjectVars(attr, prefix, element);
}
fprintf(stderr, "DEBUG2: Returing %d from cgiSetIPPVars()...\n", element + 1);
fprintf(stderr, "DEBUG2: Returing %d from cgiSetIPPVars()...\n", element);
return (element + 1);
return (element);
}
+8 -8
Ver Arquivo
@@ -98,8 +98,7 @@ main(int argc, /* I - Number of command-line arguments */
* See who is logged in...
*/
if ((user = getenv("REMOTE_USER")) == NULL)
user = "guest";
user = getenv("REMOTE_USER");
/*
* Connect to the HTTP server...
@@ -287,7 +286,7 @@ print_command(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
@@ -331,7 +330,7 @@ show_all_printers(http_t *http, /* I - Connection to server */
fprintf(stderr, "DEBUG: show_all_printers(http=%p, user=\"%s\")\n",
http, user);
http, user ? user : "(null)");
/*
* Show the standard header...
@@ -357,8 +356,9 @@ show_all_printers(http_t *http, /* I - Connection to server */
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM,
"printer-type-mask", CUPS_PRINTER_CLASS);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
if (user)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
cgiGetAttributes(request, "printers.tmpl");
@@ -543,7 +543,7 @@ show_printer(http_t *http, /* I - Connection to server */
fprintf(stderr, "DEBUG: show_printer(http=%p, printer=\"%s\")\n",
http, printer);
http, printer ? printer : "(null)");
/*
* Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following
@@ -594,7 +594,7 @@ show_printer(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, printer, sizeof(uri));
snprintf(refresh, sizeof(refresh), "10;/printers/%s", uri);
snprintf(refresh, sizeof(refresh), "10;URL=/printers/%s", uri);
cgiSetVariable("refresh_page", refresh);
}
+36 -4
Ver Arquivo
@@ -44,6 +44,7 @@
static void cgi_copy(FILE *out, FILE *in, int element, char term,
int indent);
static void cgi_puts(const char *s, FILE *out);
static void cgi_puturi(const char *s, FILE *out);
/*
@@ -59,7 +60,7 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
fprintf(stderr, "DEBUG: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
tmpl);
tmpl ? tmpl : "(null)");
/*
* Open the template file...
@@ -68,7 +69,7 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
if ((in = fopen(tmpl, "r")) == NULL)
{
fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
tmpl, strerror(errno));
tmpl ? tmpl : "(null)", strerror(errno));
return;
}
@@ -101,7 +102,8 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
FILE *in; /* Input file */
fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n", tmpl);
fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n",
tmpl ? tmpl : "(null)");
/*
* Convert the language to a locale name...
@@ -235,6 +237,7 @@ cgi_copy(FILE *out, /* I - Output file */
char outval[1024], /* Formatted output string */
compare[1024]; /* Comparison string */
int result; /* Result of comparison */
int uriencode; /* Encode as URI */
fprintf(stderr, "DEBUG: %*sStarting at file position %ld...\n", indent, "",
@@ -253,9 +256,13 @@ cgi_copy(FILE *out, /* I - Output file */
* Get a variable name...
*/
uriencode = 0;
for (s = name; (ch = getc(in)) != EOF;)
if (strchr("}]<>=! \t\n", ch))
break;
else if (s == name && ch == '%')
uriencode = 1;
else if (s > name && ch == '?')
break;
else if (s < (name + sizeof(name) - 1))
@@ -399,7 +406,12 @@ cgi_copy(FILE *out, /* I - Output file */
*/
if (out)
cgi_puts(outptr, out);
{
if (uriencode)
cgi_puturi(outptr, out);
else
cgi_puts(outptr, out);
}
continue;
}
@@ -637,6 +649,26 @@ cgi_puts(const char *s, /* I - String to output */
}
/*
* 'cgi_puturi()' - Put a URI string to the output file, quoting as needed...
*/
static void
cgi_puturi(const char *s, /* I - String to output */
FILE *out) /* I - Output file */
{
while (*s)
{
if (strchr("%&+ <>#=", *s) || *s & 128)
fprintf(out, "%%%02X", *s & 255);
else
putc(*s, out);
s ++;
}
}
/*
* End of "$Id$".
*/
+2 -1
Ver Arquivo
@@ -949,7 +949,8 @@ cgi_passwd(const char *prompt) /* I - Prompt (not used) */
{
(void)prompt;
fprintf(stderr, "DEBUG: cgi_passwd(prompt=\"%s\") called!\n", prompt);
fprintf(stderr, "DEBUG: cgi_passwd(prompt=\"%s\") called!\n",
prompt ? prompt : "(null)");
/*
* Send a 401 (unauthorized) status to the server, so it can notify
+1 -2
Ver Arquivo
@@ -74,8 +74,7 @@ install: all
if test -r $(SERVERROOT)/$$file ; then \
$(MV) $(SERVERROOT)/$$file $(SERVERROOT)/$$file.O ; \
fi ; \
$(INSTALL_CONFIG) $$file $(SERVERROOT) ; \
chgrp $(CUPS_GROUP) $(SERVERROOT)/$$file || true; \
$(INSTALL_DATA) $$file $(SERVERROOT) ; \
done
-if test x$(PAMDIR) != x; then \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(PAMDIR); \
+1
Ver Arquivo
@@ -33,6 +33,7 @@ DefaultAuthType Basic
# Restrict access to the admin pages...
<Location /admin>
@ENCRYPTION_REQUIRED@
Order allow,deny
Allow localhost
</Location>
+4 -5
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $"
# "$Id: mime.convs 5402 2006-04-14 19:21:03Z mike $"
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
@@ -107,13 +107,12 @@ image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
#
# Raw filter...
#
# Uncomment the following filter and the application/octet-stream type
# in mime.types to allow printing of arbitrary files without the -oraw
# option.
# Uncomment the following filter to allow printing of arbitrary files
# without the -oraw option.
#
#application/octet-stream application/vnd.cups-raw 0 -
#
# End of "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $".
# End of "$Id: mime.convs 5402 2006-04-14 19:21:03Z mike $".
#
+6 -6
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: mime.types 5375 2006-04-06 20:10:55Z mike $"
# "$Id: mime.types 5402 2006-04-14 19:21:03Z mike $"
#
# MIME types file for the Common UNIX Printing System (CUPS).
#
@@ -147,7 +147,9 @@ text/css css
application/vnd.cups-command string(0,'#CUPS-COMMAND')
application/vnd.cups-form string(0,"<CUPSFORM>")
application/vnd.cups-pdf
application/vnd.cups-postscript
application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
string(0,<1B>@) \
@@ -159,13 +161,11 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
#
# Raw print file support...
#
# Uncomment the following type and the application/octet-stream
# filter line in mime.convs to allow raw file printing without the
# -oraw option.
# Comment the following type to prevent raw file printing.
#
#application/octet-stream
application/octet-stream
#
# End of "$Id: mime.types 5375 2006-04-06 20:10:55Z mike $".
# End of "$Id: mime.types 5402 2006-04-14 19:21:03Z mike $".
#
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-common.m4 5354 2006-03-29 20:55:15Z mike $"
dnl "$Id: cups-common.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -265,5 +265,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
dnl
dnl End of "$Id: cups-common.m4 5354 2006-03-29 20:55:15Z mike $".
dnl End of "$Id: cups-common.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+62 -41
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-compiler.m4 5288 2006-03-14 02:38:07Z mike $"
dnl "$Id: cups-compiler.m4 5566 2006-05-22 01:10:11Z mike $"
dnl
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -73,12 +73,15 @@ AC_SUBST(LIB64DIR)
AC_SUBST(UNINSTALL64)
dnl Position-Independent Executable support on Linux and *BSD...
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fpie option, default=no])
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fPIE option, default=no])
dnl Update compiler options...
CXXLIBS=""
AC_SUBST(CXXLIBS)
PIEFLAGS=""
AC_SUBST(PIEFLAGS)
if test -n "$GCC"; then
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
@@ -96,8 +99,13 @@ if test -n "$GCC"; then
case $uname in
Linux*)
if test x$enable_pie = xyes; then
OPTIM="$OPTIM -fpie"
LDFLAGS="$LDFLAGS -pie"
PIEFLAGS="-pie -fPIE"
fi
;;
*)
if test x$enable_pie = xyes; then
echo "Sorry, --enable-pie is not supported on this OS!"
fi
;;
esac
@@ -130,8 +138,8 @@ if test -n "$GCC"; then
ARCH32FLAGS="$with_arch32flags"
fi
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$prefix/lib32"
UNINSTALL32="uninstall32bit"
@@ -154,8 +162,8 @@ if test -n "$GCC"; then
ARCH64FLAGS="$with_arch64flags"
fi
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$prefix/lib64"
UNINSTALL64="uninstall64bit"
@@ -180,8 +188,8 @@ if test -n "$GCC"; then
ARCH32FLAGS="$with_arch32flags"
fi
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$exec_prefix/lib"
if test -d /usr/lib32; then
LIB32DIR="${LIB32DIR}32"
@@ -207,8 +215,8 @@ if test -n "$GCC"; then
ARCH64FLAGS="$with_arch64flags"
fi
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$exec_prefix/lib"
if test -d /usr/lib64; then
LIB64DIR="${LIB64DIR}64"
@@ -236,8 +244,8 @@ if test -n "$GCC"; then
ARCH32FLAGS="$with_arch32flags"
fi
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$exec_prefix/lib/32"
UNINSTALL32="uninstall32bit"
@@ -260,8 +268,8 @@ if test -n "$GCC"; then
ARCH64FLAGS="$with_arch64flags"
fi
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$exec_prefix/lib/64"
UNINSTALL64="uninstall64bit"
@@ -302,8 +310,11 @@ else
# Warning 829 is passing constant string as char *
CXXFLAGS="+W336,829 $CXXFLAGS"
if test "x$with_optim" = x; then
OPTIM="+DAportable $OPTIM"
if test -z "$with_archflags"; then
# Build portable binaries for all HP systems...
ARCHFLAGS="+DAportable"
else
ARCHFLAGS="$with_archflags"
fi
if test $PICFLAG = 1; then
@@ -331,8 +342,8 @@ else
ARCH32FLAGS="$with_arch32flags"
fi
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$prefix/lib32"
UNINSTALL32="uninstall32bit"
@@ -355,8 +366,8 @@ else
ARCH64FLAGS="$with_arch64flags"
fi
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$prefix/lib64"
UNINSTALL64="uninstall64bit"
@@ -390,8 +401,8 @@ else
# binaries with separate 32-bit libraries...
ARCH32FLAGS="-xarch=generic"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$exec_prefix/lib/32"
UNINSTALL32="uninstall32bit"
@@ -400,33 +411,43 @@ else
# warning messages, and default to
# 64-bit compiles of everything else...
OPTIM="-w $OPTIM"
CFLAGS="-xarch=generic64 $CFLAGS"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-xarch=generic64"
else
ARCHFLAGS="$with_arch64flags"
fi
else
ARCHFLAGS="$with_archflags"
fi
else
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries...
ARCH64FLAGS="-xarch=generic64"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$exec_prefix/lib/64"
UNINSTALL64="uninstall64bit"
fi
if test "x$with_optim" = x; then
# Suppress all of Sun's questionable
# warning messages, and default to
# 32-bit compiles of everything else...
OPTIM="-w $OPTIM"
CFLAGS="-xarch=generic $CFLAGS"
if test "x$with_optim" = x; then
# Suppress all of Sun's questionable
# warning messages, and default to
# 32-bit compiles of everything else...
OPTIM="-w $OPTIM"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-xarch=generic"
else
ARCHFLAGS="$with_arch32flags"
fi
else
if test "x$with_optim" = x; then
# Suppress all of Sun's questionable
# warning messages, and default to
# 32-bit compiles of everything else...
OPTIM="-w $OPTIM"
CFLAGS="-xarch=generic $CFLAGS"
fi
ARCHFLAGS="$with_archflags"
fi
fi
;;
@@ -467,5 +488,5 @@ if test $uname = HP-UX; then
fi
dnl
dnl End of "$Id: cups-compiler.m4 5288 2006-03-14 02:38:07Z mike $".
dnl End of "$Id: cups-compiler.m4 5566 2006-05-22 01:10:11Z mike $".
dnl
+4 -4
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id$"
dnl "$Id: cups-defaults.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Default cupsd configuration settings for the Common UNIX Printing System
dnl (CUPS).
@@ -26,7 +26,7 @@ dnl
dnl Default langugages...
AC_ARG_WITH(languages, [ --with-languages set installed languages, default="es ja" ],
LANGUAGES="$withval",
LANGUAGES="es ja")
LANGUAGES="es ja pl sv")
AC_SUBST(LANGUAGES)
dnl Default ConfigFilePerm
@@ -219,7 +219,7 @@ AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_GROUPS, "$CUPS_SYSTEM_GROUPS")
dnl Default printcap file...
AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
default_printcap="$withval",
default_printcap="/etc/printcap")
@@ -236,5 +236,5 @@ fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-defaults.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+7 -5
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-directories.m4 5314 2006-03-20 19:06:50Z mike $"
dnl "$Id: cups-directories.m4 5547 2006-05-19 12:44:29Z mike $"
dnl
dnl Directory stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -130,9 +130,11 @@ if test x$rcdir = x; then
Darwin*)
# Darwin and MacOS X...
INITDIR=""
AC_CHECK_PROG(INITDDIR, launchd,
"/System/Library/LaunchDaemons",
"/System/Library/StartupItems/PrintingServices")
if test -x /sbin/launchd; then
INITDDIR="/System/Library/LaunchDaemons"
else
INITDDIR="/System/Library/StartupItems/PrintingServices"
fi
;;
Linux | GNU)
@@ -300,5 +302,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
AC_SUBST(CUPS_STATEDIR)
dnl
dnl End of "$Id: cups-directories.m4 5314 2006-03-20 19:06:50Z mike $".
dnl End of "$Id: cups-directories.m4 5547 2006-05-19 12:44:29Z mike $".
dnl
+3 -3
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-image.m4 5311 2006-03-19 13:21:42Z mike $"
dnl "$Id: cups-image.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -78,7 +78,7 @@ AC_CHECK_LIB(m, pow)
if test x$enable_png != xno; then
AC_CHECK_HEADER(png.h,
AC_CHECK_LIB(png, png_set_tRNS_to_alpha,
AC_CHECK_LIB(png, png_create_read_struct,
AC_DEFINE(HAVE_LIBPNG)
LIBPNG="-lpng -lm"))
else
@@ -110,5 +110,5 @@ AC_SUBST(EXPORT_LIBZ)
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
dnl
dnl End of "$Id: cups-image.m4 5311 2006-03-19 13:21:42Z mike $".
dnl End of "$Id: cups-image.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id$"
dnl "$Id: cups-launchd.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl launchd stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -49,5 +49,5 @@ AC_SUBST(DEFAULT_LAUNCHD_CONF)
AC_SUBST(LAUNCHDLIBS)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-launchd.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+3 -3
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id$"
dnl "$Id: cups-ldap.m4 5564 2006-05-22 00:59:11Z mike $"
dnl
dnl LDAP configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -36,7 +36,7 @@ LIBLDAP=""
if test x$enable_ldap != xno; then
AC_CHECK_HEADER(ldap.h,
AC_CHECK_LIB(ldap, ldap_value_free,
AC_CHECK_LIB(ldap, ldap_initialize,
AC_DEFINE(HAVE_LDAP)
AC_DEFINE(HAVE_OPENLDAP)
LIBLDAP="-lldap"))
@@ -46,5 +46,5 @@ AC_SUBST(LIBLDAP)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-ldap.m4 5564 2006-05-22 00:59:11Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z mike $"
dnl "$Id: cups-libtool.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Libtool stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -45,5 +45,5 @@ if test x$LIBTOOL != x; then
fi
dnl
dnl End of "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z mike $".
dnl End of "$Id: cups-libtool.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $"
dnl "$Id: cups-manpages.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Manpage stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -103,5 +103,5 @@ AC_SUBST(MAN8EXT)
AC_SUBST(MAN8DIR)
dnl
dnl End of "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $".
dnl End of "$Id: cups-manpages.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-network.m4 4873 2005-12-07 01:46:54Z mike $"
dnl "$Id: cups-network.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Networking stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -85,5 +85,5 @@ AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
dnl
dnl End of "$Id: cups-network.m4 4873 2005-12-07 01:46:54Z mike $".
dnl End of "$Id: cups-network.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z mike $"
dnl "$Id: cups-opsys.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Operating system stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -39,5 +39,5 @@ case "$uname" in
esac
dnl
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z mike $"
dnl "$Id: cups-opsys.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z mike $"
dnl "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl PAM stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -94,5 +94,5 @@ AC_SUBST(PAMLIBS)
AC_SUBST(PAMMOD)
dnl
dnl End of "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z mike $".
dnl End of "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+37
Ver Arquivo
@@ -0,0 +1,37 @@
dnl
dnl "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl PAP (AppleTalk) stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl
# Currently the PAP backend is only supported on MacOS X with the AppleTalk
# SDK installed...
PAP=""
if test $uname = Darwin; then
PAP="pap"
AC_CHECK_HEADER(AppleTalk/at_proto.h)
fi
AC_SUBST(PAP)
dnl
dnl End of "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id$"
dnl "$Id: cups-pdf.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl PDF filter configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -39,5 +39,5 @@ fi
AC_SUBST(PDFTOPS)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-pdf.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z mike $"
dnl "$Id: cups-scripting.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Scripting configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -100,5 +100,5 @@ if test "x$CUPS_PYTHON" != x; then
fi
dnl
dnl End of "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z mike $".
dnl End of "$Id: cups-scripting.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+53 -32
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z mike $"
dnl "$Id: cups-sharedlibs.m4 5568 2006-05-22 15:34:01Z mike $"
dnl
dnl Shared library support for the Common UNIX Printing System (CUPS).
dnl
@@ -33,31 +33,31 @@ if test x$enable_shared != xno; then
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-h,\$@ -G \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
;;
HP-UX*)
LIBCUPS="libcups.sl.2"
LIBCUPSIMAGE="libcupsimage.sl.2"
DSO="\$(LD)"
DSOFLAGS="$DSOFLAGS -b -z +h \$@"
DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
;;
IRIX)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi2.6,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
OSF1* | Linux | GNU | *BSD*)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
Darwin*)
LIBCUPS="libcups.2.dylib"
LIBCUPSIMAGE="libcupsimage.2.dylib"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -single_module -lc"
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
;;
AIX*)
LIBCUPS="libcups_s.a"
@@ -71,7 +71,7 @@ if test x$enable_shared != xno; then
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
esac
else
@@ -81,8 +81,15 @@ else
DSO=":"
fi
# 32-bit and 64-bit libraries need variations of the standard
# DSOFLAGS...
DSO32FLAGS="$DSOFLAGS"
DSO64FLAGS="$DSOFLAGS"
AC_SUBST(DSO)
AC_SUBST(DSOFLAGS)
AC_SUBST(DSO32FLAGS)
AC_SUBST(DSO64FLAGS)
AC_SUBST(LIBCUPS)
AC_SUBST(LIBCUPSIMAGE)
@@ -113,34 +120,48 @@ if test "$DSO" != ":"; then
DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
IMGLIBS=""
# The *BSD, HP-UX, and Solaris run-time linkers need help when
# deciding where to find a DSO. Add linker options to tell them
# where to find the DSO (usually in /usr/lib... duh!)
# Tell the run-time linkers where to find a DSO. Some platforms
# need this option, even when the library is installed in a
# standard location...
case $uname in
HP-UX*)
# HP-UX
DSOFLAGS="+s +b $libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
;;
# HP-UX needs the path, even for /usr/lib...
DSOFLAGS="+s +b \$(libdir) $DSOFLAGS"
DSO32FLAGS="+s +b \$(LIB32DIR) $DSO32FLAGS"
DSO64FLAGS="+s +b \$(LIB64DIR) $DSO64FLAGS"
LDFLAGS="$LDFLAGS -Wl,+s,+b,\$(libdir)"
EXPORT_LDFLAGS="-Wl,+s,+b,\$(libdir)"
;;
SunOS*)
# Solaris
DSOFLAGS="-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -R$libdir"
EXPORT_LDFLAGS="-R$libdir"
;;
# Solaris...
if test $exec_prefix != /usr; then
DSOFLAGS="-R\$(libdir) $DSOFLAGS"
DSO32FLAGS="-R\$(LIB32DIR) $DSO32FLAGS"
DSO64FLAGS="-R\$(LIB64DIR) $DSO64FLAGS"
LDFLAGS="$LDFLAGS -R\$(libdir)"
EXPORT_LDFLAGS="-R\$(libdir)"
fi
;;
*BSD*)
# *BSD
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
EXPORT_LDFLAGS="-Wl,-R$libdir"
;;
Linux | GNU)
# Linux and HURD
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
;;
# *BSD...
if test $exec_prefix != /usr; then
DSOFLAGS="-Wl,-R\$(libdir) $DSOFLAGS"
DSO32FLAGS="-Wl,-R\$(LIB32DIR) $DSO32FLAGS"
DSO64FLAGS="-Wl,-R\$(LIB64DIR) $DSO64FLAGS"
LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)"
EXPORT_LDFLAGS="-Wl,-R\$(libdir)"
fi
;;
IRIX | Linux | GNU)
# IRIX, Linux, and HURD...
if test $exec_prefix != /usr; then
DSOFLAGS="-Wl,-rpath,\$(libdir) $DSOFLAGS"
DSO32FLAGS="-Wl,-rpath,\$(LIB32DIR) $DSO32FLAGS"
DSO64FLAGS="-Wl,-rpath,\$(LIB64DIR) $DSO64FLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)"
EXPORT_LDFLAGS="-Wl,-rpath,\$(libdir)"
fi
;;
esac
else
DSOLIBS=""
@@ -152,5 +173,5 @@ AC_SUBST(IMGLIBS)
AC_SUBST(EXPORT_LDFLAGS)
dnl
dnl End of "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z mike $".
dnl End of "$Id: cups-sharedlibs.m4 5568 2006-05-22 15:34:01Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z mike $"
dnl "$Id: cups-slp.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl OpenSLP configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -44,5 +44,5 @@ AC_SUBST(LIBSLP)
dnl
dnl End of "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z mike $".
dnl End of "$Id: cups-slp.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+23 -14
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $"
dnl "$Id: cups-ssl.m4 5525 2006-05-15 13:52:16Z mike $"
dnl
dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
@@ -36,6 +36,7 @@ AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenS
SSLFLAGS=""
SSLLIBS=""
ENCRYPTION_REQUIRED=""
if test x$enable_ssl != xno; then
dnl Look for CDSA...
@@ -43,6 +44,10 @@ if test x$enable_ssl != xno; then
if test $uname = Darwin; then
AC_CHECK_HEADER(Security/SecureTransport.h,
[SSLLIBS="-framework CoreFoundation -framework Security"
# MacOS X doesn't (yet) come with pre-installed encryption
# certificates for CUPS, so don't enable encryption on
# /admin just yet...
#ENCRYPTION_REQUIRED=" Encryption Required"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_CDSASSL)])
fi
@@ -50,17 +55,14 @@ if test x$enable_ssl != xno; then
dnl Then look for GNU TLS...
if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
AC_CHECK_HEADER(gnutls/gnutls.h,
dnl Save the current libraries so the crypto stuff isn't always
dnl included...
SAVELIBS="$LIBS"
AC_CHECK_LIB(gnutls, gnutls_x509_crt_set_dn_by_oid,
[SSLLIBS="-lgnutls"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)])
LIBS="$SAVELIBS")
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
if test "x$LIBGNUTLSCONFIG" != x; then
SSLLIBS=`$LIBGNUTLSCONFIG --libs`
SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
ENCRYPTION_REQUIRED=" Encryption Required"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)
fi
fi
dnl Check for the OpenSSL library last...
@@ -84,6 +86,7 @@ if test x$enable_ssl != xno; then
AC_CHECK_LIB(ssl,SSL_new,
[SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
SSLLIBS="-lssl $libcrypto"
ENCRYPTION_REQUIRED=" Encryption Required"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_LIBSSL)],,
$libcrypto)
@@ -97,13 +100,19 @@ if test x$enable_ssl != xno; then
fi
fi
if test "x$SSLLIBS" != x; then
AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
fi
AC_SUBST(SSLFLAGS)
AC_SUBST(SSLLIBS)
AC_SUBST(ENCRYPTION_REQUIRED)
EXPORT_SSLLIBS="$SSLLIBS"
AC_SUBST(EXPORT_SSLLIBS)
dnl
dnl End of "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $".
dnl End of "$Id: cups-ssl.m4 5525 2006-05-15 13:52:16Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id$"
dnl "$Id: cups-threads.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Threading stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -53,5 +53,5 @@ fi
AC_SUBST(PTHREAD_FLAGS)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-threads.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+7
Ver Arquivo
@@ -429,6 +429,13 @@
#undef HAVE_DBUS
/*
* Do we have the AppleTalk/at_proto.h header?
*/
#undef HAVE_APPLETALK_AT_PROTO_H
#endif /* !_CUPS_CONFIG_H_ */
/*
+11 -2
Ver Arquivo
@@ -43,18 +43,27 @@ sinclude(config-scripts/cups-threads.m4)
sinclude(config-scripts/cups-largefile.m4)
sinclude(config-scripts/cups-launchd.m4)
sinclude(config-scripts/cups-defaults.m4)
sinclude(config-scripts/cups-pap.m4)
sinclude(config-scripts/cups-pdf.m4)
sinclude(config-scripts/cups-scripting.m4)
LANGFILES=""
if test "x$LANGUAGES" != x; then
for lang in $LANGUAGES; do
LANGFILES="$LANGFILES doc/$lang/index.html"
LANGFILES="$LANGFILES templates/$lang/edit-config.tmpl"
LANGFILES="$LANGFILES templates/$lang/header.tmpl"
done
fi
AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
conf/cupsd.conf conf/pam.std doc/index.html
doc/es/index.html doc/ja/index.html
doc/help/standard.html man/client.conf.man
man/cups-deviced.man man/cups-driverd.man
man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
man/cupsd.conf.man man/lpoptions.man
templates/edit-config.tmpl templates/header.tmpl
templates/es/header.tmpl templates/ja/header.tmpl)
$LANGFILES)
chmod +x cups-config
+21 -6
Ver Arquivo
@@ -31,6 +31,7 @@ exec_prefix=@exec_prefix@
bindir=@bindir@
includedir=@includedir@
libdir=@libdir@
imagelibdir=@libdir@
datadir=@datadir@
sysconfdir=@sysconfdir@
cups_datadir=@CUPS_DATADIR@
@@ -44,13 +45,27 @@ LDFLAGS="@EXPORT_LDFLAGS@"
LIBS="@EXPORT_SSLLIBS@ @LIBS@"
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@ @EXPORT_LIBZ@"
if test $includedir != /usr/include; then
CFLAGS="$CFLAGS -I$includedir"
# Check for local invocation...
selfdir=`dirname $0`
if test -f "$selfdir/cups/cups.h"; then
CFLAGS="-I$selfdir"
LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
libdir="$selfdir/cups"
imagelibdir="$selfdir/filter"
if test ! -e "$selfdir/cups/raster.h"; then
ln -s ../filter/raster.h "$selfdir/cups"
fi
else
if test $includedir != /usr/include; then
CFLAGS="$CFLAGS -I$includedir"
fi
if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
LDFLAGS="$LDFLAGS -L$libdir"
fi
fi
if test $libdir != /usr/lib -a $libdir != /usr/lib32; then
LDFLAGS="$LDFLAGS -L$libdir"
fi
usage ()
{
@@ -106,7 +121,7 @@ while test $# -gt 0; do
if test $image = no; then
echo $libdir/libcups.a $LIBS
else
echo $libdir/libcupsimage.a $IMGLIBS $libdir/libcups.a $LIBS
echo $imagelibdir/libcupsimage.a $IMGLIBS $libdir/libcups.a $LIBS
fi
fi
;;
+9 -9
Ver Arquivo
@@ -20,11 +20,12 @@ encode.o: ipp-private.h string.h ../config.h debug.h
file.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
file.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
file.o: debug.h
getifaddrs.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
getputfile.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.o: string.h ../config.h debug.h
globals.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
globals.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
globals.o: transcode.h
globals.o: transcode.h debug.h
http.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
http.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
http.o: debug.h
@@ -60,8 +61,7 @@ ppd.o: file.h language.h i18n.h transcode.h debug.h
request.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.o: array.h file.h language.h i18n.h transcode.h debug.h
snprintf.o: string.h ../config.h
string.o: debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.o: ppd.h array.h file.h language.h i18n.h transcode.h
string.o: array.h debug.h string.h ../config.h
tempfile.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.o: array.h file.h language.h i18n.h transcode.h debug.h
transcode.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
@@ -102,11 +102,12 @@ encode.32.o: encode.c ipp-private.h string.h ../config.h debug.h
file.32.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
file.32.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
file.32.o: file.c debug.h
getifaddrs.32.o: getifaddrs.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
getputfile.32.o: getputfile.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.32.o: getputfile.c string.h ../config.h debug.h
globals.32.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
globals.32.o: globals.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
globals.32.o: globals.c transcode.h
globals.32.o: globals.c transcode.h debug.h
http.32.o: http.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
http.32.o: http.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
http.32.o: http.c debug.h
@@ -142,8 +143,7 @@ ppd.32.o: ppd.c file.h language.h i18n.h transcode.h debug.h
request.32.o: request.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.32.o: request.c array.h file.h language.h i18n.h transcode.h debug.h
snprintf.32.o: snprintf.c string.h ../config.h
string.32.o: string.c debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.32.o: string.c ppd.h array.h file.h language.h i18n.h transcode.h
string.32.o: string.c array.h debug.h string.h ../config.h
tempfile.32.o: tempfile.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.32.o: tempfile.c array.h file.h language.h i18n.h transcode.h debug.h
transcode.32.o: transcode.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
@@ -184,11 +184,12 @@ encode.64.o: encode.c ipp-private.h string.h ../config.h debug.h
file.64.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
file.64.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
file.64.o: file.c debug.h
getifaddrs.64.o: getifaddrs.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
getputfile.64.o: getputfile.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.64.o: getputfile.c string.h ../config.h debug.h
globals.64.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
globals.64.o: globals.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
globals.64.o: globals.c transcode.h
globals.64.o: globals.c transcode.h debug.h
http.64.o: http.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
http.64.o: http.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
http.64.o: http.c debug.h
@@ -224,8 +225,7 @@ ppd.64.o: ppd.c file.h language.h i18n.h transcode.h debug.h
request.64.o: request.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.64.o: request.c array.h file.h language.h i18n.h transcode.h debug.h
snprintf.64.o: snprintf.c string.h ../config.h
string.64.o: string.c debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.64.o: string.c ppd.h array.h file.h language.h i18n.h transcode.h
string.64.o: string.c array.h debug.h string.h ../config.h
tempfile.64.o: tempfile.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.64.o: tempfile.c array.h file.h language.h i18n.h transcode.h debug.h
transcode.64.o: transcode.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
+19 -11
Ver Arquivo
@@ -43,6 +43,7 @@ LIBOBJS = \
emit.o \
encode.o \
file.o \
getifaddrs.o \
getputfile.o \
globals.o \
http.o \
@@ -136,7 +137,8 @@ all: $(TARGETS)
clean:
$(RM) $(OBJS) $(TARGETS)
$(RM) libcups.so libcups.sl libcups.dylib libcups.32.so libcups.64.so
$(RM) libcups.so libcups.sl libcups.dylib
$(RM) -r 32bit 64it
#
@@ -183,12 +185,12 @@ installhdrs:
install32bit:
$(INSTALL_DIR) -m 755 $(LIB32DIR)
$(INSTALL_LIB) libcups.32.so.2 $(LIB32DIR)/libcups.so.2
$(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
$(LN) libcups.so $(LIB32DIR)/libcups.so.2
install64bit:
$(INSTALL_DIR) -m 755 $(LIB64DIR)
$(INSTALL_LIB) libcups.64.so.2 $(LIB64DIR)/libcups.so.2
$(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
$(LN) libcups.so $(LIB64DIR)/libcups.so.2
@@ -234,21 +236,27 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS)
#
# libcups.32.so.2
# 32bit/libcups.so.2
#
libcups.32.so.2: $(LIB32OBJS)
32bit/libcups.so.2: $(LIB32OBJS)
echo Linking 32-bit $@...
$(DSO) $(ARCH32FLAGS) $(DSOFLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-mkdir 32bit
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 32bit/libcups.so
$(LN) libcups.so.2 32bit/libcups.so
#
# libcups.64.so.2
# 64bit/libcups.so.2
#
libcups.64.so.2: $(LIB64OBJS)
64bit/libcups.so.2: $(LIB64OBJS)
echo Linking 64-bit $@...
$(DSO) $(ARCH64FLAGS) $(DSOFLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-mkdir 64bit
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 64bit/libcups.so
$(LN) libcups.so.2 64bit/libcups.so
#
@@ -270,7 +278,7 @@ libcups.2.dylib: $(LIBOBJS)
# libcups_s.a
#
libcups_s.a: $(LIBOBJS)
libcups_s.a: $(LIBOBJS) libcups_s.exp
echo Creating $@...
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
$(RM) $@
@@ -421,7 +429,7 @@ apihelp:
file.h file.c dir.h dir.c >../doc/help/api-filedir.html
mxmldoc --section "Programming" --title "PPD API" \
--intro api-ppd.shtml \
ppd.h attr.c emit.c mark.c page.c \
ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ppd.c >../doc/help/api-ppd.html
mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
--intro api-httpipp.shtml \
+4 -1
Ver Arquivo
@@ -939,11 +939,14 @@ cups_array_find(cups_array_t *a, /* I - Array */
DEBUG_puts("cups_array_find: linear search");
diff = 0;
diff = 1;
for (current = 0; current < a->num_elements; current ++)
if (a->elements[current] == e)
{
diff = 0;
break;
}
}
/*
+2 -2
Ver Arquivo
@@ -112,8 +112,8 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
* Nope - get a new password from the user...
*/
snprintf(prompt, sizeof(prompt), "Password for %s on %s? ", cupsUser(),
http->hostname);
snprintf(prompt, sizeof(prompt), _("Password for %s on %s? "), cupsUser(),
http->hostname[0] == '/' ? "localhost" : http->hostname);
http->digest_tries = strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE],
"Digest", 5) != 0;
+1 -1
Ver Arquivo
@@ -161,7 +161,7 @@ cupsBackChannelWrite(
* Write error - abort on fatal errors...
*/
if (errno != EINTR && errno != EAGAIN)
if (errno != EINTR)
return (-1);
}
else
+12
Ver Arquivo
@@ -34,6 +34,10 @@
*
* Contents:
*
* ppdFindCustomOption() - Find a custom option.
* ppdFindCustomParam() - Find a parameter for a custom option.
* ppdFirstCustomParam() - Return the first parameter for a custom option.
* ppdNextCustomParam() - Return the next parameter for a custom option.
*/
/*
@@ -46,6 +50,8 @@
/*
* 'ppdFindCustomOption()' - Find a custom option.
*
* @since CUPS 1.2@
*/
ppd_coption_t * /* O - Custom option or NULL */
@@ -65,6 +71,8 @@ ppdFindCustomOption(ppd_file_t *ppd, /* I - PPD file */
/*
* 'ppdFindCustomParam()' - Find a parameter for a custom option.
*
* @since CUPS 1.2@
*/
ppd_cparam_t * /* O - Custom parameter or NULL */
@@ -84,6 +92,8 @@ ppdFindCustomParam(ppd_coption_t *opt, /* I - Custom option */
/*
* 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
*
* @since CUPS 1.2@
*/
ppd_cparam_t * /* O - Custom parameter or NULL */
@@ -98,6 +108,8 @@ ppdFirstCustomParam(ppd_coption_t *opt) /* I - Custom option */
/*
* 'ppdNextCustomParam()' - Return the next parameter for a custom option.
*
* @since CUPS 1.2@
*/
ppd_cparam_t * /* O - Custom parameter or NULL */
+2
Ver Arquivo
@@ -133,6 +133,8 @@ static const _ipp_option_t ipp_options[] =
{ "raw", IPP_TAG_MIMETYPE, IPP_TAG_OPERATION },
{ "resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB },
{ "resolution-default", IPP_TAG_RESOLUTION, IPP_TAG_PRINTER },
{ "requesting-user-name-allowed", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ "requesting-user-name-denied", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ "saturation", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ "saturation-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ "scaling", IPP_TAG_INTEGER, IPP_TAG_JOB },
+276
Ver Arquivo
@@ -0,0 +1,276 @@
/*
* "$Id$"
*
* Network interface functions for the Common UNIX Printing System
* (CUPS) scheduler.
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
* Contents:
*
* _cups_getifaddrs() - Get a list of network interfaces on the system.
* _cups_freeifaddrs() - Free an interface list...
*/
/*
* Include necessary headers.
*/
#include "http-private.h"
#ifndef HAVE_GETIFADDRS
/*
* '_cups_getifaddrs()' - Get a list of network interfaces on the system.
*/
int /* O - 0 on success, -1 on error */
_cups_getifaddrs(struct ifaddrs **addrs)/* O - List of interfaces */
{
int sock; /* Socket */
char buffer[65536], /* Buffer for address info */
*bufptr, /* Pointer into buffer */
*bufend; /* End of buffer */
struct ifconf conf; /* Interface configurations */
struct sockaddr addr; /* Address data */
struct ifreq *ifp; /* Interface data */
int ifpsize; /* Size of interface data */
struct ifaddrs *temp; /* Pointer to current interface */
struct ifreq request; /* Interface request */
/*
* Start with an empty list...
*/
if (addrs == NULL)
return (-1);
*addrs = NULL;
/*
* Create a UDP socket to get the interface data...
*/
memset (&addr, 0, sizeof(addr));
if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
return (-1);
/*
* Try to get the list of interfaces...
*/
conf.ifc_len = sizeof(buffer);
conf.ifc_buf = buffer;
if (ioctl(sock, SIOCGIFCONF, &conf) < 0)
{
/*
* Couldn't get the list of interfaces...
*/
close(sock);
return (-1);
}
/*
* OK, got the list of interfaces, now lets step through the
* buffer to pull them out...
*/
# ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
# define sockaddr_len(a) ((a)->sa_len)
# else
# define sockaddr_len(a) (sizeof(struct sockaddr))
# endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
for (bufptr = buffer, bufend = buffer + conf.ifc_len;
bufptr < bufend;
bufptr += ifpsize)
{
/*
* Get the current interface information...
*/
ifp = (struct ifreq *)bufptr;
ifpsize = sizeof(ifp->ifr_name) + sockaddr_len(&(ifp->ifr_addr));
if (ifpsize < sizeof(struct ifreq))
ifpsize = sizeof(struct ifreq);
memset(&request, 0, sizeof(request));
memcpy(request.ifr_name, ifp->ifr_name, sizeof(ifp->ifr_name));
/*
* Check the status of the interface...
*/
if (ioctl(sock, SIOCGIFFLAGS, &request) < 0)
continue;
/*
* Allocate memory for a single interface record...
*/
if ((temp = calloc(1, sizeof(struct ifaddrs))) == NULL)
{
/*
* Unable to allocate memory...
*/
close(sock);
return (-1);
}
/*
* Add this record to the front of the list and copy the name, flags,
* and network address...
*/
temp->ifa_next = *addrs;
*addrs = temp;
temp->ifa_name = strdup(ifp->ifr_name);
temp->ifa_flags = request.ifr_flags;
if ((temp->ifa_addr = calloc(1, sockaddr_len(&(ifp->ifr_addr)))) != NULL)
memcpy(temp->ifa_addr, &(ifp->ifr_addr), sockaddr_len(&(ifp->ifr_addr)));
/*
* Try to get the netmask for the interface...
*/
if (!ioctl(sock, SIOCGIFNETMASK, &request))
{
/*
* Got it, make a copy...
*/
if ((temp->ifa_netmask = calloc(1, sizeof(request.ifr_netmask))) != NULL)
memcpy(temp->ifa_netmask, &(request.ifr_netmask),
sizeof(request.ifr_netmask));
}
/*
* Then get the broadcast or point-to-point (destination) address,
* if applicable...
*/
if (temp->ifa_flags & IFF_BROADCAST)
{
/*
* Have a broadcast address, so get it!
*/
if (!ioctl(sock, SIOCGIFBRDADDR, &request))
{
/*
* Got it, make a copy...
*/
if ((temp->ifa_broadaddr =
calloc(1, sizeof(request.ifr_broadaddr))) != NULL)
memcpy(temp->ifa_broadaddr, &(request.ifr_broadaddr),
sizeof(request.ifr_broadaddr));
}
}
else if (temp->ifa_flags & IFF_POINTOPOINT)
{
/*
* Point-to-point interface; grab the remote address...
*/
if (!ioctl(sock, SIOCGIFDSTADDR, &request))
{
temp->ifa_dstaddr = malloc(sizeof(request.ifr_dstaddr));
memcpy(temp->ifa_dstaddr, &(request.ifr_dstaddr),
sizeof(request.ifr_dstaddr));
}
}
}
/*
* OK, we're done with the socket, close it and return 0...
*/
close(sock);
return (0);
}
/*
* '_cups_freeifaddrs()' - Free an interface list...
*/
void
_cups_freeifaddrs(struct ifaddrs *addrs)/* I - Interface list to free */
{
struct ifaddrs *next; /* Next interface in list */
while (addrs != NULL)
{
/*
* Make a copy of the next interface pointer...
*/
next = addrs->ifa_next;
/*
* Free data values as needed...
*/
if (addrs->ifa_name)
{
free(addrs->ifa_name);
addrs->ifa_name = NULL;
}
if (addrs->ifa_addr)
{
free(addrs->ifa_addr);
addrs->ifa_addr = NULL;
}
if (addrs->ifa_netmask)
{
free(addrs->ifa_netmask);
addrs->ifa_netmask = NULL;
}
if (addrs->ifa_dstaddr)
{
free(addrs->ifa_dstaddr);
addrs->ifa_dstaddr = NULL;
}
/*
* Free this node and continue to the next...
*/
free(addrs);
addrs = next;
}
}
#endif /* !HAVE_GETIFADDRS */
/*
* End of "$Id$".
*/
+21 -2
Ver Arquivo
@@ -52,6 +52,9 @@
int /* O - 1 if "any", 0 otherwise */
httpAddrAny(const http_addr_t *addr) /* I - Address to check */
{
if (!addr)
return (0);
#ifdef AF_INET6
if (addr->addr.sa_family == AF_INET6 &&
IN6_IS_ADDR_UNSPECIFIED(&(addr->ipv6.sin6_addr)))
@@ -76,6 +79,12 @@ int /* O - 1 if equal, 0 if not */
httpAddrEqual(const http_addr_t *addr1, /* I - First address */
const http_addr_t *addr2) /* I - Second address */
{
if (!addr1 && !addr2)
return (1);
if (!addr1 || !addr2)
return (0);
if (addr1->addr.sa_family != addr2->addr.sa_family)
return (0);
@@ -102,6 +111,9 @@ httpAddrEqual(const http_addr_t *addr1, /* I - First address */
int /* O - Length in bytes */
httpAddrLength(const http_addr_t *addr) /* I - Address */
{
if (!addr)
return (0);
#ifdef AF_INET6
if (addr->addr.sa_family == AF_INET6)
return (sizeof(addr->ipv6));
@@ -131,6 +143,9 @@ int /* O - 1 if local host, 0 otherwise */
httpAddrLocalhost(
const http_addr_t *addr) /* I - Address to check */
{
if (!addr)
return (1);
#ifdef AF_INET6
if (addr->addr.sa_family == AF_INET6 &&
IN6_IS_ADDR_LOOPBACK(&(addr->ipv6.sin6_addr)))
@@ -508,6 +523,9 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
struct hostent *host; /* Host entry to get FQDN */
if (!s || slen <= 1)
return (NULL);
if (http)
{
if (http->hostname[0] == '/')
@@ -521,7 +539,8 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
* Get the hostname...
*/
gethostname(s, slen);
if (gethostname(s, slen) < 0)
strlcpy(s, "localhost", slen);
if (!strchr(s, '.'))
{
@@ -529,7 +548,7 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
* The hostname is not a FQDN, so look it up...
*/
if ((host = gethostbyname(s)) != NULL)
if ((host = gethostbyname(s)) != NULL && host->h_name)
strlcpy(s, host->h_name, slen);
}
}
+57 -2
Ver Arquivo
@@ -31,7 +31,8 @@
* Include necessary headers...
*/
# include "config.h"
# include <stdlib.h>
# include <config.h>
# ifdef __sun
/*
@@ -98,7 +99,11 @@ typedef struct
# include <Security/SecureTransport.h>
typedef SSLConnectionRef http_tls_t;
typedef struct /**** CDSA connection information ****/
{
SSLContextRef session; /* CDSA session object */
CFArrayRef certsArray; /* Certificates array */
} http_tls_t;
typedef union _cdsa_conn_ref_u /**** CDSA Connection reference union
**** used to resolve 64-bit casting
@@ -129,6 +134,56 @@ extern const char *_cups_hstrerror(int error);
extern const char *hstrerror(int error);
# endif /* !HAVE_HSTRERROR */
/*
* Some OS's don't have getifaddrs() and freeifaddrs()...
*/
# include <net/if.h>
# ifdef HAVE_GETIFADDRS
# include <ifaddrs.h>
# else
# include <sys/ioctl.h>
# ifdef HAVE_SYS_SOCKIO_H
# include <sys/sockio.h>
# endif /* HAVE_SYS_SOCKIO_H */
# ifdef ifa_dstaddr
# undef ifa_dstaddr
# endif /* ifa_dstaddr */
# ifndef ifr_netmask
# define ifr_netmask ifr_addr
# endif /* !ifr_netmask */
struct ifaddrs /**** Interface Structure ****/
{
struct ifaddrs *ifa_next; /* Next interface in list */
char *ifa_name; /* Name of interface */
unsigned int ifa_flags; /* Flags (up, point-to-point, etc.) */
struct sockaddr *ifa_addr, /* Network address */
*ifa_netmask; /* Address mask */
union
{
struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
} ifa_ifu;
void *ifa_data; /* Interface statistics */
};
# ifndef ifa_broadaddr
# define ifa_broadaddr ifa_ifu.ifu_broadaddr
# endif /* !ifa_broadaddr */
# ifndef ifa_dstaddr
# define ifa_dstaddr ifa_ifu.ifu_dstaddr
# endif /* !ifa_dstaddr */
extern int _cups_getifaddrs(struct ifaddrs **addrs);
# define getifaddrs _cups_getifaddrs
extern void _cups_freeifaddrs(struct ifaddrs *addrs);
# define freeifaddrs _cups_freeifaddrs
# endif /* HAVE_GETIFADDRS */
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
/*
+80 -55
Ver Arquivo
@@ -867,7 +867,11 @@ httpGets(char *line, /* I - Line to read into */
*/
if (!http->blocking && !http_wait(http, 1000))
{
DEBUG_puts("httpGets: Timed out!");
http->error = ETIMEDOUT;
return (NULL);
}
#ifdef HAVE_SSL
if (http->tls)
@@ -2041,7 +2045,7 @@ http_read_ssl(http_t *http, /* I - HTTP connection */
size_t processed; /* Number of bytes processed */
error = SSLRead((SSLContextRef)http->tls, buf, len, &processed);
error = SSLRead(((http_tls_t *)http->tls)->session, buf, len, &processed);
switch (error)
{
@@ -2217,15 +2221,16 @@ static int /* O - Status of connection */
http_setup_ssl(http_t *http) /* I - HTTP connection */
{
# ifdef HAVE_LIBSSL
SSL_CTX *context; /* Context for encryption */
SSL *conn; /* Connection for encryption */
SSL_CTX *context; /* Context for encryption */
SSL *conn; /* Connection for encryption */
# elif defined(HAVE_GNUTLS)
http_tls_t *conn; /* TLS session object */
http_tls_t *conn; /* TLS session object */
gnutls_certificate_client_credentials *credentials;
/* TLS credentials */
/* TLS credentials */
# elif defined(HAVE_CDSASSL)
SSLContextRef conn; /* Context for encryption */
OSStatus error; /* Error info */
OSStatus error; /* Error code */
http_tls_t *conn; /* CDSA connection information */
cdsa_conn_ref_t u; /* Connection reference union */
# endif /* HAVE_LIBSSL */
@@ -2262,9 +2267,7 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
}
# elif defined(HAVE_GNUTLS)
conn = (http_tls_t *)malloc(sizeof(http_tls_t));
if (conn == NULL)
if ((conn = (http_tls_t *)malloc(sizeof(http_tls_t))) == NULL)
{
http->error = errno;
http->status = HTTP_ERROR;
@@ -2303,45 +2306,51 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
conn->credentials = credentials;
# elif defined(HAVE_CDSASSL)
cdsa_conn_ref_t u; /* Connection reference union */
conn = (http_tls_t *)calloc(1, sizeof(http_tls_t));
if (conn == NULL)
return (-1);
error = SSLNewContext(false, &conn);
if (!error)
error = SSLSetIOFuncs(conn, _httpReadCDSA, _httpWriteCDSA);
if (!error)
{
/*
* Use a union to resolve warnings about int/pointer size mismatches...
*/
u.connection = NULL;
u.sock = http->fd;
error = SSLSetConnection(conn, u.connection);
}
if (!error)
error = SSLSetAllowsExpiredCerts(conn, true);
if (!error)
error = SSLSetAllowsAnyRoot(conn, true);
if (!error)
{
while ((error = SSLHandshake(conn)) == errSSLWouldBlock)
usleep(1000);
}
if (error != 0)
if ((error = SSLNewContext(false, &conn->session)))
{
http->error = error;
http->status = HTTP_ERROR;
SSLDisposeContext(conn);
free(conn);
return (-1);
}
close(http->fd);
/*
* Use a union to resolve warnings about int/pointer size mismatches...
*/
u.connection = NULL;
u.sock = http->fd;
error = SSLSetConnection(conn->session, u.connection);
if (!error)
error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA);
if (!error)
error = SSLSetAllowsExpiredCerts(conn->session, true);
if (!error)
error = SSLSetAllowsAnyRoot(conn->session, true);
if (!error)
{
while ((error = SSLHandshake(conn->session)) == errSSLWouldBlock)
usleep(1000);
}
if (error)
{
http->error = error;
http->status = HTTP_ERROR;
SSLDisposeContext(conn->session);
free(conn);
return (-1);
}
@@ -2359,11 +2368,11 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
*/
static void
http_shutdown_ssl(http_t *http) /* I - HTTP connection */
http_shutdown_ssl(http_t *http) /* I - HTTP connection */
{
# ifdef HAVE_LIBSSL
SSL_CTX *context; /* Context for encryption */
SSL *conn; /* Connection for encryption */
SSL_CTX *context; /* Context for encryption */
SSL *conn; /* Connection for encryption */
conn = (SSL *)(http->tls);
@@ -2374,9 +2383,9 @@ http_shutdown_ssl(http_t *http) /* I - HTTP connection */
SSL_free(conn);
# elif defined(HAVE_GNUTLS)
http_tls_t *conn; /* Encryption session */
http_tls_t *conn; /* Encryption session */
gnutls_certificate_client_credentials *credentials;
/* TLS credentials */
/* TLS credentials */
conn = (http_tls_t *)(http->tls);
@@ -2389,10 +2398,20 @@ http_shutdown_ssl(http_t *http) /* I - HTTP connection */
free(conn);
# elif defined(HAVE_CDSASSL)
while (SSLClose((SSLContextRef)http->tls) == errSSLWouldBlock)
http_tls_t *conn; /* CDSA connection information */
conn = (http_tls_t *)(http->tls);
while (SSLClose(conn->session) == errSSLWouldBlock)
usleep(1000);
SSLDisposeContext((SSLContextRef)http->tls);
SSLDisposeContext(conn->session);
if (conn->certsArray)
CFRelease(conn->certsArray);
free(conn);
# endif /* HAVE_LIBSSL */
http->tls = NULL;
@@ -2405,11 +2424,11 @@ http_shutdown_ssl(http_t *http) /* I - HTTP connection */
* 'http_upgrade()' - Force upgrade to TLS encryption.
*/
static int /* O - Status of connection */
http_upgrade(http_t *http) /* I - HTTP connection */
static int /* O - Status of connection */
http_upgrade(http_t *http) /* I - HTTP connection */
{
int ret; /* Return value */
http_t myhttp; /* Local copy of HTTP data */
int ret; /* Return value */
http_t myhttp; /* Local copy of HTTP data */
DEBUG_printf(("http_upgrade(%p)\n", http));
@@ -2529,7 +2548,7 @@ http_wait(http_t *http, /* I - HTTP connection */
# elif defined(HAVE_CDSASSL)
size_t bytes; /* Bytes that are available */
if (!SSLGetBufferedReadSize((SSLContextRef)http->tls, &bytes) && bytes > 0)
if (!SSLGetBufferedReadSize(((http_tls_t *)http->tls)->session, &bytes) && bytes > 0)
return (1);
# endif /* HAVE_LIBSSL */
}
@@ -2572,6 +2591,8 @@ http_wait(http_t *http, /* I - HTTP connection */
{
FD_SET(http->fd, http->input_set);
DEBUG_printf(("http_wait: msec=%d, http->fd=%d\n", msec, http->fd));
if (msec >= 0)
{
timeout.tv_sec = msec / 1000;
@@ -2581,6 +2602,8 @@ http_wait(http_t *http, /* I - HTTP connection */
}
else
nfds = select(http->fd + 1, http->input_set, NULL, NULL, NULL);
DEBUG_printf(("http_wait: select() returned %d...\n", nfds));
}
#ifdef WIN32
while (nfds < 0 && WSAGetLastError() == WSAEINTR);
@@ -2590,6 +2613,8 @@ http_wait(http_t *http, /* I - HTTP connection */
FD_CLR(http->fd, http->input_set);
DEBUG_printf(("http_wait: returning with nfds=%d...\n", nfds));
return (nfds > 0);
}
@@ -2745,7 +2770,7 @@ http_write_ssl(http_t *http, /* I - HTTP connection */
size_t processed; /* Number of bytes processed */
error = SSLWrite((SSLContextRef)http->tls, buf, len, &processed);
error = SSLWrite(((http_tls_t *)http->tls)->session, buf, len, &processed);
switch (error)
{
+36 -33
Ver Arquivo
@@ -1034,6 +1034,7 @@ ippReadIO(void *src, /* I - Data source */
DEBUG_printf(("ippReadIO(%p, %p, %d, %p, %p)\n", src, cb, blocking,
parent, ipp));
DEBUG_printf(("ippReadIO: ipp->state=%d\n", ipp->state));
if (src == NULL || ipp == NULL)
return (IPP_ERROR);
@@ -1527,6 +1528,8 @@ ippReadIO(void *src, /* I - Data source */
break; /* anti-compiler-warning-code */
}
DEBUG_printf(("ippReadIO: returning ipp->state=%d!\n", ipp->state));
return (ipp->state);
}
@@ -1672,7 +1675,7 @@ ippWriteIO(void *dst, /* I - Destination */
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP header...");
DEBUG_puts("ippWriteIO: Could not write IPP header...");
return (IPP_ERROR);
}
}
@@ -1686,9 +1689,9 @@ ippWriteIO(void *dst, /* I - Destination */
ipp->current = ipp->attrs;
ipp->curtag = IPP_TAG_ZERO;
DEBUG_printf(("ippWrite: version=%d.%d\n", buffer[0], buffer[1]));
DEBUG_printf(("ippWrite: op_status=%04x\n", ipp->request.any.op_status));
DEBUG_printf(("ippWrite: request_id=%d\n", ipp->request.any.request_id));
DEBUG_printf(("ippWriteIO: version=%d.%d\n", buffer[0], buffer[1]));
DEBUG_printf(("ippWriteIO: op_status=%04x\n", ipp->request.any.op_status));
DEBUG_printf(("ippWriteIO: request_id=%d\n", ipp->request.any.request_id));
/*
* If blocking is disabled, stop here...
@@ -1720,7 +1723,7 @@ ippWriteIO(void *dst, /* I - Destination */
if (attr->group_tag == IPP_TAG_ZERO)
continue;
DEBUG_printf(("ippWrite: wrote group tag = %x\n", attr->group_tag));
DEBUG_printf(("ippWriteIO: wrote group tag = %x\n", attr->group_tag));
*bufptr++ = attr->group_tag;
}
else if (attr->group_tag == IPP_TAG_ZERO)
@@ -1751,8 +1754,8 @@ ippWriteIO(void *dst, /* I - Destination */
* Write the value tag, name length, and name string...
*/
DEBUG_printf(("ippWrite: writing value tag = %x\n", attr->value_tag));
DEBUG_printf(("ippWrite: writing name = %d, \'%s\'\n", n, attr->name));
DEBUG_printf(("ippWriteIO: writing value tag = %x\n", attr->value_tag));
DEBUG_printf(("ippWriteIO: writing name = %d, \'%s\'\n", n, attr->name));
*bufptr++ = attr->value_tag;
*bufptr++ = n >> 8;
@@ -1775,11 +1778,11 @@ ippWriteIO(void *dst, /* I - Destination */
* and empty name for the collection member attribute...
*/
DEBUG_printf(("ippWrite: writing value tag = %x\n",
DEBUG_printf(("ippWriteIO: writing value tag = %x\n",
IPP_TAG_MEMBERNAME));
DEBUG_printf(("ippWrite: writing name = %d, \'%s\'\n", n, attr->name));
DEBUG_printf(("ippWrite: writing value tag = %x\n", attr->value_tag));
DEBUG_puts("ippWrite: writing name = 0, \'\'\n");
DEBUG_printf(("ippWriteIO: writing name = %d, \'%s\'\n", n, attr->name));
DEBUG_printf(("ippWriteIO: writing value tag = %x\n", attr->value_tag));
DEBUG_puts("ippWriteIO: writing name = 0, \'\'\n");
*bufptr++ = IPP_TAG_MEMBERNAME;
*bufptr++ = 0;
@@ -1810,7 +1813,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -1854,7 +1857,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -1905,15 +1908,15 @@ ippWriteIO(void *dst, /* I - Destination */
* values with a zero-length name...
*/
DEBUG_printf(("ippWrite: writing value tag = %x\n",
DEBUG_printf(("ippWriteIO: writing value tag = %x\n",
attr->value_tag));
DEBUG_printf(("ippWrite: writing name = 0, \'\'\n"));
DEBUG_printf(("ippWriteIO: writing name = 0, \'\'\n"));
if ((sizeof(buffer) - (bufptr - buffer)) < 3)
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -1933,14 +1936,14 @@ ippWriteIO(void *dst, /* I - Destination */
if (n > (sizeof(buffer) - 2))
return (IPP_ERROR);
DEBUG_printf(("ippWrite: writing string = %d, \'%s\'\n", n,
DEBUG_printf(("ippWriteIO: writing string = %d, \'%s\'\n", n,
value->string.text));
if ((int)(sizeof(buffer) - (bufptr - buffer)) < (n + 2))
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -1977,7 +1980,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2020,7 +2023,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2071,7 +2074,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2128,7 +2131,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2165,7 +2168,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2226,7 +2229,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2254,7 +2257,7 @@ ippWriteIO(void *dst, /* I - Destination */
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2287,7 +2290,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2315,7 +2318,7 @@ ippWriteIO(void *dst, /* I - Destination */
{
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
@@ -2342,11 +2345,11 @@ ippWriteIO(void *dst, /* I - Destination */
if ((*cb)(dst, buffer, (int)(bufptr - buffer)) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
DEBUG_puts("ippWriteIO: Could not write IPP attribute...");
return (IPP_ERROR);
}
DEBUG_printf(("ippWrite: wrote %d bytes\n", bufptr - buffer));
DEBUG_printf(("ippWriteIO: wrote %d bytes\n", bufptr - buffer));
/*
* If blocking is disabled, stop here...
@@ -2380,7 +2383,7 @@ ippWriteIO(void *dst, /* I - Destination */
if ((*cb)(dst, buffer, n) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP end-tag...");
DEBUG_puts("ippWriteIO: Could not write IPP end-tag...");
return (IPP_ERROR);
}
@@ -2806,14 +2809,14 @@ ipp_write_file(int *fd, /* I - File descriptor */
*/
ipp_attribute_t * /* O - New attribute */
_ipp_add(ipp_t *ipp, /* I - IPP message */
int num_values) /* I - Number of values */
_ipp_add_attr(ipp_t *ipp, /* I - IPP message */
int num_values) /* I - Number of values */
{
return (_ippAddAttr(ipp, num_values));
}
void
_ipp_free(ipp_attribute_t *attr) /* I - Attribute to free */
_ipp_free_attr(ipp_attribute_t *attr) /* I - Attribute to free */
{
_ippFreeAttr(attr);
}
+2 -1
Ver Arquivo
@@ -6,7 +6,6 @@ _cupsCharmapGet
_cupsEncodingName
_cupsGetPassword
_cupsGlobals
_cupsLangFlush
_cupsLangPrintf
_cupsLangPuts
_cupsLangString
@@ -23,6 +22,8 @@ _cupsStrFormatd
_cupsStrFree
_cupsStrScand
_cupsStrStatistics
_cups_getifaddrs
_cups_freeifaddrs
_cups_strcpy
_cups_strlcat
_cups_strlcpy
+2
Ver Arquivo
@@ -56,6 +56,8 @@ static const char *ppd_text(ppd_file_t *ppd, const char *keyword,
/*
* 'ppdLocalize()' - Localize the PPD file to the current locale.
*
* @since CUPS 1.2@
*/
int /* O - 0 on success, -1 on error */
+31 -8
Ver Arquivo
@@ -241,9 +241,6 @@ ppd_option_t * /* O - Pointer to option or NULL */
ppdFindOption(ppd_file_t *ppd, /* I - PPD file data */
const char *option) /* I - Option/Keyword name */
{
ppd_option_t key; /* Option search key */
/*
* Range check input...
*/
@@ -251,13 +248,39 @@ ppdFindOption(ppd_file_t *ppd, /* I - PPD file data */
if (!ppd || !option)
return (NULL);
/*
* Search...
*/
if (ppd->options)
{
/*
* Search in the array...
*/
strlcpy(key.keyword, option, sizeof(key.keyword));
ppd_option_t key; /* Option search key */
return ((ppd_option_t *)cupsArrayFind(ppd->options, &key));
strlcpy(key.keyword, option, sizeof(key.keyword));
return ((ppd_option_t *)cupsArrayFind(ppd->options, &key));
}
else
{
/*
* Search in each group...
*/
int i, j; /* Looping vars */
ppd_group_t *group; /* Current group */
ppd_option_t *optptr; /* Current option */
for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
for (j = group->num_options, optptr = group->options;
j > 0;
j --, optptr ++)
if (!strcasecmp(optptr->keyword, option))
return (optptr);
return (NULL);
}
}
+1 -1
Ver Arquivo
@@ -87,7 +87,7 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
if (!nameptr || *nameptr != 'x')
return (NULL);
l = _cupsStrScand(nameptr, &nameptr, loc);
l = _cupsStrScand(nameptr + 1, &nameptr, loc);
if (!nameptr)
return (NULL);
+32 -16
Ver Arquivo
@@ -69,7 +69,8 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
FILE *file; /* File to send */
struct stat fileinfo; /* File information */
int bytes; /* Number of bytes read/written */
char buffer[65536]; /* Output buffer */
char buffer[32768]; /* Output buffer */
http_status_t expect; /* Expect: header to use */
DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', \'%s\')\n",
@@ -118,7 +119,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
ippDelete(request);
_cupsSetError(IPP_NOT_POSSIBLE, NULL);
_cupsSetError(IPP_NOT_POSSIBLE, strerror(EISDIR));
return (NULL);
}
@@ -146,6 +147,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
response = NULL;
status = HTTP_ERROR;
expect = HTTP_CONTINUE;
while (response == NULL)
{
@@ -163,7 +165,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
httpSetLength(http, length);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
httpSetExpect(http, HTTP_CONTINUE);
httpSetExpect(http, expect);
DEBUG_printf(("cupsDoFileRequest: authstring=\"%s\"\n", http->authstring));
@@ -278,10 +280,15 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
}
else if (status == HTTP_ERROR)
{
DEBUG_printf(("cupsDoFileRequest: http->error=%d (%s)\n", http->error,
strerror(http->error)));
#ifdef WIN32
if (http->error != WSAENETDOWN && http->error != WSAENETUNREACH)
if (http->error != WSAENETDOWN && http->error != WSAENETUNREACH &&
http->error != ETIMEDOUT)
#else
if (http->error != ENETDOWN && http->error != ENETUNREACH)
if (http->error != ENETDOWN && http->error != ENETUNREACH &&
http->error != ETIMEDOUT)
#endif /* WIN32 */
continue;
else
@@ -307,6 +314,14 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
continue;
}
#endif /* HAVE_SSL */
else if (status == HTTP_EXPECTATION_FAILED)
{
/*
* Don't try using the Expect: header the next time around...
*/
expect = (http_status_t)0;
}
else if (status != HTTP_OK)
{
DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
@@ -328,20 +343,21 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
response = ippNew();
if (ippRead(http, response) == IPP_ERROR)
{
/*
* Delete the response...
*/
while ((state = ippRead(http, response)) != IPP_DATA)
if (state == IPP_ERROR)
{
/*
* Delete the response...
*/
DEBUG_puts("IPP read error!");
ippDelete(response);
response = NULL;
DEBUG_puts("IPP read error!");
ippDelete(response);
response = NULL;
_cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
_cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
break;
}
break;
}
}
}
+8 -2
Ver Arquivo
@@ -96,7 +96,10 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
if (*format == '*')
{
// Get width from argument...
/*
* Get width from argument...
*/
format ++;
width = va_arg(ap, int);
@@ -125,7 +128,10 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
if (*format == '*')
{
// Get precision from argument...
/*
* Get precision from argument...
*/
format ++;
prec = va_arg(ap, int);
+3 -2
Ver Arquivo
@@ -31,13 +31,14 @@
* Include necessary headers...
*/
# include <config.h>
# include <stdio.h>
# include <stdlib.h>
# include <stdarg.h>
# include <ctype.h>
# include <locale.h>
# include <config.h>
# ifdef HAVE_STRING_H
# include <string.h>
# endif /* HAVE_STRING_H */
+19 -35
Ver Arquivo
@@ -23,9 +23,8 @@
*
* Contents:
*
* main() - Main entry for internationalization test module.
* print_utf8() - Print UTF-8 string with (optional) message.
* print_utf32() - Print UTF-32 string with (optional) message.
* main() - Main entry for internationalization test module.
* print_utf8() - Print UTF-8 string with (optional) message.
*/
/*
@@ -36,6 +35,7 @@
#include <stdlib.h>
#include <errno.h>
#include <time.h>
#include <unistd.h>
#include "i18n.h"
#include "string.h"
@@ -46,7 +46,6 @@
*/
static void print_utf8(const char *msg, const cups_utf8_t *src);
static void print_utf32(const char *msg, const cups_utf32_t *src);
/*
@@ -81,18 +80,21 @@ main(int argc, /* I - Argument Count */
cups_utf8_t utf8taiwan[] = /* UTF-8 Chinese source */
{ 0x41, 0x20, 0x21, 0x3D, 0x20, 0xE4, 0xB9, 0x82, 0x2E, 0x00 };
/* "A != <CJK U+4E42>." - use Windows 950 (Big5) or EUC-TW */
cups_utf8_t utf8good[] = /* UTF-8 good 16-bit source */
{ 0x41, 0x20, 0xE2, 0x89, 0xA2, 0x20, 0xC3, 0x84, 0x2E, 0x00 };
/* "A <NOT IDENTICAL TO> <A WITH DIAERESIS>." */
cups_utf8_t utf8bad[] = /* UTF-8 bad 16-bit source */
{ 0x41, 0x20, 0xE2, 0x89, 0xA2, 0x20, 0xF8, 0x84, 0x2E, 0x00 };
/* "A <NOT IDENTICAL TO> <...bad stuff...>." */
cups_utf8_t utf8dest[1024]; /* UTF-8 destination string */
cups_utf32_t utf32src[1024]; /* UTF-32 source string */
cups_utf32_t utf32dest[1024]; /* UTF-32 destination string */
_cups_vmap_t *vmap; /* VBCS charmap pointer */
/*
* Make sure we have a symbolic link from the data directory to a
* "charmaps" directory, and then point the library at it...
*/
if (access("charmaps", 0))
symlink("../data", "charmaps");
putenv("CUPS_DATADIR=.");
/*
* Start with some conversion tests from a UTF-8 test file.
*/
@@ -238,7 +240,7 @@ main(int argc, /* I - Argument Count */
len = cupsCharsetToUTF8(utf8dest, legsrc, 1024, CUPS_ISO8859_1);
if (len != strlen((char *)utf8latin))
{
printf("FAIL (len=%d, expected %d)\n", len, strlen((char *)utf8latin));
printf("FAIL (len=%d, expected %d)\n", len, (int)strlen((char *)utf8latin));
print_utf8(" utf8latin", utf8latin);
print_utf8(" utf8dest", utf8dest);
errors ++;
@@ -289,7 +291,7 @@ main(int argc, /* I - Argument Count */
len = cupsCharsetToUTF8(utf8dest, legsrc, 1024, CUPS_ISO8859_7);
if (len != strlen((char *)utf8greek))
{
printf("FAIL (len=%d, expected %d)\n", len, strlen((char *)utf8greek));
printf("FAIL (len=%d, expected %d)\n", len, (int)strlen((char *)utf8greek));
print_utf8(" utf8greek", utf8greek);
print_utf8(" utf8dest", utf8dest);
errors ++;
@@ -335,7 +337,7 @@ main(int argc, /* I - Argument Count */
len = cupsCharsetToUTF8(utf8dest, legsrc, 1024, CUPS_WINDOWS_932);
if (len != strlen((char *)utf8japan))
{
printf("FAIL (len=%d, expected %d)\n", len, strlen((char *)utf8japan));
printf("FAIL (len=%d, expected %d)\n", len, (int)strlen((char *)utf8japan));
print_utf8(" utf8japan", utf8japan);
print_utf8(" utf8dest", utf8dest);
errors ++;
@@ -381,7 +383,7 @@ main(int argc, /* I - Argument Count */
len = cupsCharsetToUTF8(utf8dest, legsrc, 1024, CUPS_EUC_JP);
if (len != strlen((char *)utf8japan))
{
printf("FAIL (len=%d, expected %d)\n", len, strlen((char *)utf8japan));
printf("FAIL (len=%d, expected %d)\n", len, (int)strlen((char *)utf8japan));
print_utf8(" utf8japan", utf8japan);
print_utf8(" utf8dest", utf8dest);
errors ++;
@@ -427,7 +429,7 @@ main(int argc, /* I - Argument Count */
len = cupsCharsetToUTF8(utf8dest, legsrc, 1024, CUPS_WINDOWS_950);
if (len != strlen((char *)utf8taiwan))
{
printf("FAIL (len=%d, expected %d)\n", len, strlen((char *)utf8taiwan));
printf("FAIL (len=%d, expected %d)\n", len, (int)strlen((char *)utf8taiwan));
print_utf8(" utf8taiwan", utf8taiwan);
print_utf8(" utf8dest", utf8dest);
errors ++;
@@ -473,7 +475,7 @@ main(int argc, /* I - Argument Count */
len = cupsCharsetToUTF8(utf8dest, legsrc, 1024, CUPS_EUC_TW);
if (len != strlen((char *)utf8taiwan))
{
printf("FAIL (len=%d, expected %d)\n", len, strlen((char *)utf8taiwan));
printf("FAIL (len=%d, expected %d)\n", len, (int)strlen((char *)utf8taiwan));
print_utf8(" utf8taiwan", utf8taiwan);
print_utf8(" utf8dest", utf8dest);
errors ++;
@@ -553,24 +555,6 @@ print_utf8(const char *msg, /* I - Message String */
}
/*
* 'print_utf32()' - Print UTF-32 string with (optional) message.
*/
static void
print_utf32(const char *msg, /* I - Message String */
const cups_utf32_t *src) /* I - UTF-32 Source String */
{
if (msg)
printf("%s:", msg);
for (; *src; src ++)
printf(" %04x", (int) *src);
putchar('\n');
}
/*
* End of "$Id$"
*/
+76 -32
Ver Arquivo
@@ -78,50 +78,94 @@ main(int argc, /* I - Number of command-line arguments */
status = 0;
fputs("ppdOpenFile: ", stdout);
if ((ppd = ppdOpenFile("test.ppd")) != NULL)
puts("PASS");
else
if (argc == 1)
{
ppd_status_t err; /* Last error in file */
int line; /* Line number in file */
fputs("ppdOpenFile: ", stdout);
if ((ppd = ppdOpenFile("test.ppd")) != NULL)
puts("PASS");
else
{
ppd_status_t err; /* Last error in file */
int line; /* Line number in file */
status ++;
err = ppdLastError(&line);
status ++;
err = ppdLastError(&line);
printf("FAIL (%s on line %d)\n", ppdErrorString(err), line);
}
printf("FAIL (%s on line %d)\n", ppdErrorString(err), line);
}
fputs("ppdMarkDefaults: ", stdout);
ppdMarkDefaults(ppd);
fputs("ppdMarkDefaults: ", stdout);
ppdMarkDefaults(ppd);
if ((conflicts = ppdConflicts(ppd)) == 0)
puts("PASS");
else
{
status ++;
printf("FAIL (%d conflicts)\n", conflicts);
}
if ((conflicts = ppdConflicts(ppd)) == 0)
puts("PASS");
else
{
status ++;
printf("FAIL (%d conflicts)\n", conflicts);
}
fputs("ppdEmitString: ", stdout);
if ((s = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL &&
!strcmp(s, default_code))
puts("PASS");
else
{
printf("FAIL (%d bytes instead of %d)\n", s ? (int)strlen(s) : 0,
(int)strlen(default_code));
fputs("ppdEmitString: ", stdout);
if ((s = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL &&
!strcmp(s, default_code))
puts("PASS");
else
{
printf("FAIL (%d bytes instead of %d)\n", s ? (int)strlen(s) : 0,
(int)strlen(default_code));
if (s)
puts(s);
}
if (s)
puts(s);
free(s);
ppdClose(ppd);
}
else
{
if ((ppd = ppdOpenFile(argv[1])) == NULL)
{
ppd_status_t err; /* Last error in file */
int line; /* Line number in file */
if (s)
free(s);
ppdClose(ppd);
status ++;
err = ppdLastError(&line);
printf("%s: %s on line %d\n", argv[1], ppdErrorString(err), line);
}
else
{
int i, j, k; /* Looping vars */
ppd_group_t *group; /* Option group */
ppd_option_t *option; /* Option */
ppdLocalize(ppd);
for (i = ppd->num_groups, group = ppd->groups;
i > 0;
i --, group ++)
{
printf("%s (%s):\n", group->name, group->text);
for (j = group->num_options, option = group->options;
j > 0;
j --, option ++)
{
printf(" %s (%s):\n", option->keyword, option->text);
for (k = 0; k < option->num_choices; k ++)
printf(" - %s (%s)\n", option->choices[k].choice,
option->choices[k].text);
}
}
}
}
return (status);
}
+1 -1
Ver Arquivo
@@ -160,13 +160,13 @@ HELPFILES = \
help/ref-error_log.html \
help/ref-page_log.html \
help/ref-printers-conf.html \
help/ref-snmp-conf.html \
help/ref-subscriptions-conf.html \
help/security.html \
help/spec-cmp.html \
help/spec-command.html \
help/spec-design.html \
help/spec-ipp.html \
help/spec-postscript.html \
help/spec-ppd.html \
help/spec-raster.html \
help/spec-stp.html \
+109
Ver Arquivo
@@ -189,14 +189,19 @@ library:</p>
<li><a href='#ppdErrorString'><tt>ppdErrorString()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
<li><a href='#ppdFindAttr'><tt>ppdFindAttr()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
<li><a href='#ppdFindChoice'><tt>ppdFindChoice()</tt></a> </li>
<li><a href='#ppdFindCustomOption'><tt>ppdFindCustomOption()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdFindCustomParam'><tt>ppdFindCustomParam()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdFindMarkedChoice'><tt>ppdFindMarkedChoice()</tt></a> </li>
<li><a href='#ppdFindNextAttr'><tt>ppdFindNextAttr()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
<li><a href='#ppdFindOption'><tt>ppdFindOption()</tt></a> </li>
<li><a href='#ppdFirstCustomParam'><tt>ppdFirstCustomParam()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdFirstOption'><tt>ppdFirstOption()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdIsMarked'><tt>ppdIsMarked()</tt></a> </li>
<li><a href='#ppdLastError'><tt>ppdLastError()</tt></a> <span class='info'>&nbsp;CUPS 1.1.19&nbsp;</span></li>
<li><a href='#ppdLocalize'><tt>ppdLocalize()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdMarkDefaults'><tt>ppdMarkDefaults()</tt></a> </li>
<li><a href='#ppdMarkOption'><tt>ppdMarkOption()</tt></a> </li>
<li><a href='#ppdNextCustomParam'><tt>ppdNextCustomParam()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdNextOption'><tt>ppdNextOption()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
<li><a href='#ppdOpen'><tt>ppdOpen()</tt></a> </li>
<li><a href='#ppdOpen2'><tt>ppdOpen2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
@@ -515,6 +520,50 @@ ppdFindChoice(
<h4>Returns</h4>
<p>Choice pointer or NULL</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdFindCustomOption'>ppdFindCustomOption()</a></h3>
<h4>Description</h4>
<p>Find a custom option.
</p>
<h4>Syntax</h4>
<pre>
<a href='#ppd_coption_t'>ppd_coption_t</a> *
ppdFindCustomOption(
<a href='#ppd_file_t'>ppd_file_t</a> * ppd,
const char * keyword);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
<tr><td><tt>keyword</tt></td><td>Custom option name</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Custom option or NULL</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdFindCustomParam'>ppdFindCustomParam()</a></h3>
<h4>Description</h4>
<p>Find a parameter for a custom option.
</p>
<h4>Syntax</h4>
<pre>
<a href='#ppd_cparam_t'>ppd_cparam_t</a> *
ppdFindCustomParam(
<a href='#ppd_coption_t'>ppd_coption_t</a> * opt,
const char * name);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>opt</tt></td><td>Custom option</td></tr>
<tr><td><tt>name</tt></td><td>Parameter name</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Custom parameter or NULL</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='ppdFindMarkedChoice'>ppdFindMarkedChoice()</a></h3>
<h4>Description</h4>
<p>Return the marked choice for the specified option.</p>
@@ -579,6 +628,26 @@ ppdFindOption(
<h4>Returns</h4>
<p>Pointer to option or NULL</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdFirstCustomParam'>ppdFirstCustomParam()</a></h3>
<h4>Description</h4>
<p>Return the first parameter for a custom option.
</p>
<h4>Syntax</h4>
<pre>
<a href='#ppd_cparam_t'>ppd_cparam_t</a> *
ppdFirstCustomParam(
<a href='#ppd_coption_t'>ppd_coption_t</a> * opt);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>opt</tt></td><td>Custom option</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Custom parameter or NULL</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdFirstOption'>ppdFirstOption()</a></h3>
<h4>Description</h4>
<p>Return the first option in the PPD file.
@@ -643,6 +712,26 @@ ppdLastError(
<h4>Returns</h4>
<p>Status code</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdLocalize'>ppdLocalize()</a></h3>
<h4>Description</h4>
<p>Localize the PPD file to the current locale.
</p>
<h4>Syntax</h4>
<pre>
int
ppdLocalize(
<a href='#ppd_file_t'>ppd_file_t</a> * ppd);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>0 on success, -1 on error</p>
<!-- NEW PAGE -->
<h3 class='title'><a name='ppdMarkDefaults'>ppdMarkDefaults()</a></h3>
<h4>Description</h4>
<p>Mark all default options in the PPD file.</p>
@@ -688,6 +777,26 @@ ppdMarkOption(
<h4>Returns</h4>
<p>Number of conflicts</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdNextCustomParam'>ppdNextCustomParam()</a></h3>
<h4>Description</h4>
<p>Return the next parameter for a custom option.
</p>
<h4>Syntax</h4>
<pre>
<a href='#ppd_cparam_t'>ppd_cparam_t</a> *
ppdNextCustomParam(
<a href='#ppd_coption_t'>ppd_coption_t</a> * opt);
</pre>
<h4>Arguments</h4>
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>opt</tt></td><td>Custom option</td></tr>
</tbody></table></div>
<h4>Returns</h4>
<p>Custom parameter or NULL</p>
<!-- NEW PAGE -->
<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='ppdNextOption'>ppdNextOption()</a></h3>
<h4>Description</h4>
<p>Return the next option in the PPD file.
+25 -34
Ver Arquivo
@@ -5,58 +5,49 @@
</HEAD>
<BODY>
<P>The <VAR>/etc/cups/client.conf</VAR> file contains many
directives that determine how the client behaves:</P>
<P>The <VAR>/etc/cups/client.conf</VAR> and
<VAR>~/.cups/client.conf</VAR> files contain up to two directives
that determine how the client behaves. Each directive is listed
on a line by itself followed by its value. Comments are
introduced using the number sign ("#") character at the beginning
of a line.</P>
<P ALIGN="CENTER">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD VALIGN="TOP">
<H2 CLASS="title"><A NAME="Encryption">Encryption</A></H2>
<LI><A HREF="#Encryption"><CODE>Encryption</CODE></A>
<LI><A HREF="#ServerName"><CODE>ServerName</CODE></A>
<H3>Examples</H3>
</TD>
</TR>
</TABLE>
</P>
<!-- HALF PAGE -->
<H3><A NAME="Encryption">Encryption</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
<PRE CLASS="command">
Encryption Never
Encryption IfRequested
Encryption Required
Encryption Always
</PRE></UL>
</PRE>
<H4>Description</H4>
<H3>Description</H3>
<P>The <CODE>Encryption</CODE> directive specifies the default encryption settings for the client.
The default setting is <VAR>IfRequested</VAR>.
<P>The <CODE>Encryption</CODE> directive specifies the default
encryption settings for the client.</P>
<P>The default setting is <VAR>IfRequested</VAR>.</P>
<!-- HALF PAGE -->
<H3><A NAME="ServerName">ServerName</A></H3>
<HR>
<H2 CLASS="title"><A NAME="ServerName">ServerName</A></H2>
<H4>Examples</H4>
<H3>Examples</H3>
<UL><PRE>
<PRE CLASS="command">
ServerName foo.bar.com
ServerName 11.22.33.44
</PRE></UL>
</PRE>
<H4>Description</H4>
<H3>Description</H3>
<P>The <CODE>ServerName</CODE> directive specifies sets the remote server that is to be used
for all client operations. That is, it redirects all client requests to the remote server.
<P>The <CODE>ServerName</CODE> directive specifies sets the
remote server that is to be used for all client operations. That
is, it redirects all client requests to the remote server.</P>
The default is to use the local server ("<VAR>localhost</VAR>").
<P>The default is to use the local server
("<VAR>localhost</VAR>") or domain socket, if so configured.</P>
</BODY>
</HTML>
+38
Ver Arquivo
@@ -929,6 +929,22 @@ policy to use for IPP operation. The default is
<CODE>default</CODE>.</P>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultShared">DefaultShared</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
DefaultShared yes
DefaultShared no
</PRE>
<H3>Description</H3>
<P>The <CODE>DefaultShared</CODE> directive specifies whether
printers are shared (published) by default. The default is
<CODE>yes</CODE>.</P>
<H2 CLASS="title"><A NAME="Deny">Deny</A></H2>
<H3>Examples</H3>
@@ -2667,6 +2683,28 @@ to wait before an active HTTP or IPP request times out. The
default timeout is 300 seconds.</P>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="UseNetworkDefault">UseNetworkDefault</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
UseNetworkDefault yes
UseNetworkDefault no
</PRE>
<H3>Description</H3>
<P>The <CODE>UseNetworkDefault</CODE> directive controls whether
the client will use a network/remote printer as a default
printer. If enabled, the default printer of a server is used as
the default printer on a client. When multiple servers are
advertising a default printer, the client's default printer is
set to the first discovered printer, or to the implicit class for
the same printer available from multiple servers.</P>
<P>The default is <CODE>yes</CODE>.</P>
<H2 CLASS="title"><A NAME="User">User</A></H2>
<H3>Examples</H3>
+100
Ver Arquivo
@@ -0,0 +1,100 @@
<HTML>
<!-- SECTION: References -->
<HEAD>
<TITLE>snmp.conf</TITLE>
</HEAD>
<BODY>
<P>The <VAR>/etc/cups/snmp.conf</VAR> file contains several
directives that determine how the SNMP printer discovery backend
behaves. Each directive is listed on a line by itself followed
by its value. Comments are introduced using the number sign ("#")
character at the beginning of a line.</P>
<P>The SNMP backend uses the SNMPv1 protocol to discover network
printers, collecting information from the Host MIB along with
intelligent port probes to determine the correct device URI and
make and model for each printer. Future versions of CUPS will
likely support the new Port Monitor MIB as well.</P>
<H2 CLASS="title"><A NAME="Address">Address</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
Address @LOCAL
Address @IF(name)
Address 255.255.255.255
Address 192.168.2.255
</PRE>
<H3>Description</H3>
<P>The <CODE>Address</CODE> directive specifies a broadcast
address to use when discovering printers. Multiple
<CODE>Address</CODE> lines can be provided to scan different
subnets.</P>
<P>The default address is <VAR>@LOCAL</VAR>, which broadcasts to
all LANs.</P>
<H2 CLASS="title"><A NAME="Community">Community</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
Community public
Community easysw
Community BigCorp
</PRE>
<H3>Description</H3>
<P>The <CODE>Community</CODE> directive specifies a community
name to use when discovering printers. Multiple
<CODE>Community</CODE> lines can be provided to scan different
SNMP communities.</P>
<P>The default community is "public".</P>
<H2 CLASS="title"><A NAME="DebugLevel">DebugLevel</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
DebugLevel 0
DebugLevel 1
DebugLevel 2
DebugLevel 3
</PRE>
<H3>Description</H3>
<P>The <CODE>DebugLevel</CODE> directive specifies the debugging
level to use when searching for network printers. Level 0
produces no debugging information. Level 1 produces basic
debugging information. Level 2 adds printing of the SNMP
messages. Level 3 adds a hex dump of the network data.</P>
<P>The default setting is <VAR>0</VAR>.</P>
<H2 CLASS="title"><A NAME="HostNameLookups">HostNameLookups</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
HostNameLookups on
HostNameLookups off
</PRE>
<H3>Description</H3>
<P>The <CODE>HostNameLookups</CODE> directive specifies whether printer
addresses are converted to hostnames or left as numeric IP addresses.</P>
<P>The default setting is <VAR>off</VAR>.</P>
</BODY>
</HTML>
-120
Ver Arquivo
@@ -1,120 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- SECTION: Specifications -->
<head>
<title>Generating PostScript for CUPS</title>
<meta name='keywords' content='Programming, PostScript, Document Structuring Conventions'>
<link rel='stylesheet' type='text/css' href='../cups.css'>
</head>
<body>
<!--
"$Id$"
CUPS PostScript file specification for the Common UNIX Printing System (CUPS).
Copyright 2006 by Easy Software Products.
These coded instructions, statements, and computer programs are the
property of Easy Software Products 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 missing or damaged please contact Easy Software Products
at:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
-->
<h2 class='title'><a name='INTRODUCTION'>Introduction</a></h2>
<p>This document describes how to generate PostScript output for
CUPS and is largely based on the <a
href="http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf">
Adobe TechNote #5001: PostScript Language Document Structuring
Conventions Specification Version 3.0</a>. While CUPS can
generally print any PostScript file, following the rules in the
Adobe TechNote and this document will ensure that your PostScript
output will work reliably.</p>
<blockquote><b>Note:</b> While PostScript is currently the
defacto-standard print job file format/language for UNIX-based
applications, it is slowly being phased out in favor of Adobe's
Portable Document Format ("PDF") which offers many advantages
over PostScript. MacOS X uses PDF as the primary print job file
format, and we expect Linux to soon follow. Both PostScript and
PDF are complex formats, and we highly recommend using high-level
toolkits whenever possible.</blockquote>
<h3>Anatomy of a PostScript File</h3>
<p>PostScript files are ASCII text files starting with a header
line (<tt>%!PS-Adobe-3.0</tt>) followed by a combination of
comment lines starting with two percent signs (<tt>%%</tt>) and
PostScript code lines. The lines themselves should not exceed 255
characters to conform to the DSC. The following short PostScript
file produces a box with a smiley face in it:</p>
<pre class="command">
%!PS-Adobe-3.0
%%BoundingBox: 36 36 576 756
%%Pages: 1
%%LanguageLevel: 2
%%EndComments
%%Page: (1) 1
% Draw a black box around the page
0 setgray
1 setlinewidth
36 36 540 720 rectstroke
% Draw a two inch blue circle in the middle of the page
0 0 1 setrgbcolor
306 396 144 0 360 arc closepath fill
% Draw two half inch yellow circles for eyes
1 1 0 setrgbcolor
252 432 36 0 360 arc closepath fill
360 432 36 0 360 arc closepath fill
% Draw the smile
1 setlinecap
18 setlinewidth
306 396 99 200 340 arc stroke
% Print it!
showpage
%%EOF
</pre>
<div class="figure"><table summary="Sample PostScript File Output">
<caption>Figure 1: <a name="FIGURE_1">Sample PostScript File Output</a></caption>
<tr><td align="center"><img src="../images/smiley.jpg"
width="445" height="570" alt="Sample PostScript File Output"></td></tr>
</table></div>
<h2>Embedding Printer Options</h2>
<h2>Embedding Fonts and Text</h2>
<h2>Embedding Images</h2>
<blockquote><b>Note:</b> While some printers support arbitrary
binary data in PostScript files, we do not recommend this
practice because it does not work with all printers or
interfaces. In most cases, the Base-85 encoding and compression
filters can be used to embed images with very little, if any,
increase in data size.</blockquote>
</body>
</html>
+7 -10
Ver Arquivo
@@ -8,7 +8,7 @@
</head>
<body>
<!--
"$Id: spec-ppd.html 5217 2006-03-02 21:24:01Z mike $"
"$Id: spec-ppd.html 5496 2006-05-05 19:26:23Z mike $"
CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
@@ -473,23 +473,20 @@ is not absolute, it is loaded relative to the
<h4>Customizing the Profile Selection Keywords</h4>
<p>The <tt>ColorModel</tt>, <tt>MediaType</tt>, and
<tt>Resolution</tt> keywords can be reassigned to different main
keywords, allowing drivers to do color profile selection based
on different parameters. The <tt>cupsICCQualifier1</tt>,
<tt>cupsICCQualifier2</tt>, and <tt>cupsICCQualifier3</tt>
<p>The <tt>MediaType</tt> and <tt>Resolution</tt> keywords can be
reassigned to different main keywords, allowing drivers to do
color profile selection based on different parameters. The
<tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt>
attributes define the mapping from selector to main keyword:</p>
<pre class='command'>
*cupsICCQualifier1: MainKeyword
*cupsICCQualifier2: MainKeyword
*cupsICCQualifier3: MainKeyword
*cupsICCQualifier2: MainKeyword2
*cupsICCQualifier3: MainKeyword3
</pre>
<p>The default mapping is as follows:</p>
<pre class='command'>
*cupsICCQualifier1: ColorModel
*cupsICCQualifier2: MediaType
*cupsICCQualifier3: Resolution
</pre>
+227 -21
Ver Arquivo
@@ -2,6 +2,7 @@
<!-- SECTION: Specifications -->
<HEAD>
<TITLE>CUPS Raster Format</TITLE>
<LINK REL="STYLESHEET" TYPE="test/css" HREF="../cups.css">
</HEAD>
<BODY>
@@ -37,13 +38,16 @@ is followed immediately by the (uncompressed, raw) raster data
for that page.</P>
<DIV CLASS="table"><TABLE SUMMARY="CUPS Version 1 Raster Page Device Dictionary">
<CAPTION>Table 1: CUPS Version 1 Raster Page Device Dictionary</CAPTION>
<CAPTION><A NAME="TABLE1">Table 1: CUPS Version 1 Raster Page Device Dictionary</A></CAPTION>
<THEAD>
<TR>
<TH>Bytes</TH>
<TH>Type</TH>
<TH>Description</TH>
<TH>Values</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>0-63</TD>
<TD>C String</TD>
@@ -284,9 +288,9 @@ for that page.</P>
<TD>400-403</TD>
<TD>Unsigned Integer</TD>
<TD>cupsColorSpace</TD>
<TD>0 = white<BR>
1 = RGB<BR>
2 = RGBA<BR>
<TD>0 = white (sRGB)<BR>
1 = RGB (sRGB)<BR>
2 = RGBA (sRGB)<BR>
3 = black<BR>
4 = CMY<BR>
5 = YMC<BR>
@@ -301,22 +305,22 @@ for that page.</P>
14 = SILVER<BR>
15 = CIE XYZ<BR>
16 = CIE Lab<BR>
17 = RGBW<BR>
32 = ICC1<BR>
33 = ICC2<BR>
34 = ICC3<BR>
35 = ICC4<BR>
36 = ICC5<BR>
37 = ICC6<BR>
38 = ICC7<BR>
39 = ICC8<BR>
40 = ICC9<BR>
41 = ICCA (10)<BR>
42 = ICCB (11)<BR>
43 = ICCC (12)<BR>
44 = ICCD (13)<BR>
45 = ICCE (14)<BR>
46 = ICCF (15)<BR>
17 = RGBW (sRGB)<BR>
32 = ICC1 (CIE Lab with hint for 1 color)<BR>
33 = ICC2 (CIE Lab with hint for 2 colors)<BR>
34 = ICC3 (CIE Lab with hint for 3 colors)<BR>
35 = ICC4 (CIE Lab with hint for 4 colors)<BR>
36 = ICC5 (CIE Lab with hint for 5 colors)<BR>
37 = ICC6 (CIE Lab with hint for 6 colors)<BR>
38 = ICC7 (CIE Lab with hint for 7 colors)<BR>
39 = ICC8 (CIE Lab with hint for 8 colors)<BR>
40 = ICC9 (CIE Lab with hint for 9 colors)<BR>
41 = ICCA (CIE Lab with hint for 10 colors)<BR>
42 = ICCB (CIE Lab with hint for 11 colors)<BR>
43 = ICCC (CIE Lab with hint for 12 colors)<BR>
44 = ICCD (CIE Lab with hint for 13 colors)<BR>
45 = ICCE (CIE Lab with hint for 14 colors)<BR>
46 = ICCF (CIE Lab with hint for 15 colors)<BR>
</TD>
</TR>
<TR>
@@ -343,6 +347,7 @@ for that page.</P>
<TD>cupsRowStep</TD>
<TD>Driver-specific 0 to 2<SUP>32</SUP> - 1</TD>
</TR>
</TBODY>
</TABLE></DIV>
@@ -362,13 +367,16 @@ header and is followed immediately by the compressed raster data
for that page.</P>
<DIV CLASS="table"><TABLE SUMMARY="CUPS Version 2 Raster Page Device Dictionary">
<CAPTION>Table 2: CUPS Version 2 Raster Page Device Dictionary</CAPTION>
<CAPTION><A NAME="TABLE2">Table 2: CUPS Version 2 Raster Page Device Dictionary</A></CAPTION>
<THEAD>
<TR>
<TH>Bytes</TH>
<TH>Type</TH>
<TH>Description</TH>
<TH>Values</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>0-419</TD>
<TD>Version 1 header data</TD>
@@ -436,6 +444,7 @@ for that page.</P>
<TD>cupsPageSizeName</TD>
<TD>Page size name/keyword string from PPD</TD>
</TR>
</TBODY>
</TABLE></DIV>
<H3><A NAME="COMPRESSION">Compressed Raster Data Format</A></H3>
@@ -446,6 +455,7 @@ color values based upon the <CODE>cupsColorOrder</CODE>
setting:</P>
<DIV CLASS="table"><TABLE SUMMARY="Color Value Sizes">
<CAPTION><A NAME="TABLE3">Table 3: Color Value Sizes</A></CAPTION>
<TR>
<TH>cupsColorOrder</TH>
<TH>Bytes per color value</TH>
@@ -475,9 +485,205 @@ colors are encoded using an initial byte of "257 - count"
followed by the color value bytes.</P>
<H2 CLASS="title"><A NAME="ENCODING">Pixel Value Coding</A></H2>
<P>The following sections describe the encoding and decoding of
the color values in a CUPS raster file. In general, colors are
packed into the minimum number of bytes, with special
consideration provided for efficiency of encoding and access.
Multi-byte values are stored in the native byte order and
automatically swapped as needed when reading them using the CUPS
imaging API.</P>
<H3>CUPS_ORDER_CHUNKED</H3>
<P>The chunked order provides the pixel value packed in a single
place. Pixel values with 8 or more bits per color are stored as
an array of colors in order, e.g. for
<CODE>CUPS_CSPACE_RGB</CODE> you will see 8/16-bits of red, then
blue, then green, then red, green, blue, etc. Pixel values with
less than 8 bits per color are packed together as shown in Table
4. <I>Multi-byte pixel values are stored in the native word
order, just as for 16-bit color values.</I></P>
<DIV CLASS="table"><TABLE SUMMARY="Chunked Color Values">
<CAPTION><A NAME="TABLE4">Table 4: Chunked Color Values</A></CAPTION>
<THEAD>
<TR>
<TH>Bits</TH>
<TH>1-color</TH>
<TH>3-color</TH>
<TH>4-color</TH>
<TH>6-color</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>1</TD>
<TD>W/W/W/W/W/W/W/W</TD>
<TD>0RGB/0RGB</TD>
<TD>CMYK/CMYK</TD>
<TD>00KCMYcm</TD>
</TR>
<TR>
<TD>2</TD>
<TD>WW/WW/WW/WW</TD>
<TD>00RRGGBB</TD>
<TD>CCMMYYKK</TD>
<TD>N/A</TD>
</TR>
<TR>
<TD>4</TD>
<TD>WWWW/WWWW</TD>
<TD>0000RRRRGGGGBBBB<BR>
<I>(multi-byte)</I></TD>
<TD>CCCCMMMMYYYYKKKK<BR>
<I>(multi-byte)</I></TD>
<TD>N/A</TD>
</TR>
</TBODY>
</TABLE></DIV>
<H3>CUPS_ORDER_BANDED</H3>
<P>The banded order provides each color as a separate line of
data. Each color plane for a line is written in sequence, e.g.
for the <CODE>CUPS_CSPACE_CMYK</CODE> colorspace you would see
all of the cyan pixels for a line followed by the magenta,
yellow, and black pixels for that line. This is repeated for all
of the lines on the page. Color values are packed starting with
the most-significant bit (MSB) first.</P>
<H3>CUPS_ORDER_PLANAR</H3>
<P>The planar order provides each color as a separate page of
data using a shared page header. Each color plane for a page is
written in sequence, e.g. for the <CODE>CUPS_CSPACE_CMYK</CODE>
colorspace you would see all of the cyan pixels for a page
followed by the magenta, yellow, and black pixels for that page.
Color values are packed starting with the most-significant bit
(MSB) first. Each line starts on an 8-bit boundary.</P>
<H3>CUPS_CSPACE_W, CUPS_CSPACE_RGB, CUPS_CSPACE_RGBA, and
CUPS_CSPACE_RGBW</H3>
<P>These colorspaces use the sRGB colorspace definition and
whitepoint.</P>
<H3>CUPS_CSPACE_KCMYcm</H3>
<P>When <CODE>cupsBitsPerColor</CODE> is 1, 6 color planes are
provided - black, cyan, magenta, yellow, light cyan, and light
magenta. When <CODE>cupsBitsPerColor</CODE> is greater than 1, 4
color planes are provided using the <CODE>CUPS_CSPACE_KCMY</CODE>
colorspace instead.</P>
<P>When <CODE>cupsColorOrder</CODE> is
<CODE>CUPS_ORDER_CHUNKED</CODE>, bit 5 corresponds to black and
bit 0 corresponds to light magenta. For
<CODE>CUPS_ORDER_BANDED</CODE> and
<CODE>CUPS_ORDER_PLANAR</CODE>, each color plane is encoded
separately.</P>
<H3>CUPS_CSPACE_CIELab and CUPS_CSPACE_ICCn</H3>
<P>These colorspaces map a CIE Lab color value with a D65
whitepoint to either a 8- or 16-bit per color chunked
(<CODE>CUPS_ORDER_CHUNKED</CODE>) format; the banded
(<CODE>CUPS_ORDER_BANDED</CODE>) and planar
(<CODE>CUPS_ORDER_PLANAR</CODE>) color orders are not
supported.</P>
<P>The values are encoded and decoded using the following
formulas:</P>
<UL>
<LI>8-bit Encoding:<BR>
<I>L8 = 2.55 * L + 0.5<BR>
a8 = a + 128.5<BR>
b8 = b + 128.5<BR>
&nbsp;</I></LI>
<LI>8-bit Decoding:<BR>
<I>L = L8 / 2.55<BR>
a = a8 - 128<BR>
b = b8 - 128<BR>
&nbsp;</I></LI>
<LI>16-bit Encoding:<BR>
<I>L16 = 655.35 * L + 0.5<BR>
a16 = 256 * (a + 128) + 0.5<BR>
b16 = 256 * (b + 128) + 0.5<BR>
&nbsp;</I></LI>
<LI>16-bit Decoding:<BR>
<I>L = L16 / 655.35<BR>
a = a16 / 256 - 128<BR>
b = b16 / 256 - 128<BR>
&nbsp;</I></LI>
</UL>
<H3>CUPS_CSPACE_CIEXYZ</H3>
<P>These colorspaces map a CIE XYZ color value with a D65
whitepoint to either a 8- or 16-bit per color chunked
(<CODE>CUPS_ORDER_CHUNKED</CODE>) format; the banded
(<CODE>CUPS_ORDER_BANDED</CODE>) and planar
(<CODE>CUPS_ORDER_PLANAR</CODE>) color orders are not
supported.</P>
<P>The values are encoded and decoded using the following
formulas:</P>
<UL>
<LI>8-bit Encoding:<BR>
<I>X8 = 231.8181 * X + 0.5<BR>
Y8 = 231.8181 * Y + 0.5<BR>
Z8 = 231.8181 * Z + 0.5<BR>
&nbsp;</I></LI>
<LI>8-bit Decoding:<BR>
<I>X = X8 / 231.8181<BR>
Y = Y8 / 231.8181<BR>
Z = Z8 / 231.8181<BR>
&nbsp;</I></LI>
<LI>16-bit Encoding:<BR>
<I>X16 = 59577.2727 * X + 0.5<BR>
Y16 = 59577.2727 * Y + 0.5<BR>
Z16 = 59577.2727 * Z + 0.5<BR>
&nbsp;</I></LI>
<LI>16-bit Decoding:<BR>
<I>X = X16 / 59577.2727<BR>
Y = Y16 / 59577.2727<BR>
Z = Z16 / 59577.2727<BR>
&nbsp;</I></LI>
</UL>
<P>The scaling factor for XYZ values is 1/1.1, or 231.8181 for
8-bit values and 59577.2727 for 16-bit values. This allows for a
slight overflow of XYZ values when converting from RGB, improving
accuracy.</P>
<H2 CLASS="title"><A NAME="HISTORY">Change History</A></H2>
<H3>Changes in CUPS 1.2.1</H3>
<ul>
<li>Added new sections on coding pixel values.</li>
<li>Clarified definitions of color spaces.</li>
</ul>
<H3>Changes in CUPS 1.2</H3>
<ul>
+13 -10
Ver Arquivo
@@ -31,11 +31,14 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
SSL-encrypted, and TLS-encrypted connections over
a single port</LI>
<LI><EM>Network Printer Discovery;</EM> CUPS can
now find printers on the LAN using SNMP</LI>
</OL></DD>
<DT>Browsing</DT>
<DD><OL START="4">
<DD><OL START="5">
<LI><EM>LDAP Support;</EM> CUPS now supports
printer sharing via the Lightweight Directory
@@ -76,7 +79,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<DT>Web Interface</DT>
<DD><OL START="11">
<DD><OL START="12">
<LI><EM>Improved Look and Feel;</EM> The web
interface has improved readability and a more
@@ -169,7 +172,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<DT>IPP Support</DT>
<DD><OL START="30"></EM></LI>
<DD><OL START="31"></EM></LI>
<LI><EM>IPP Notifications;</EM> CUPS now supports
the complete IPP notification specification to
@@ -269,7 +272,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<DT>Scheduler</DT>
<DD><OL START="48">
<DD><OL START="49">
<LI><EM>Remote Printer Caching;</EM> The scheduler
now maintains a remote printer cache so that
@@ -376,7 +379,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<DT>LPD Client Support</DT>
<DD><OL START="68">
<DD><OL START="69">
<LI><EM>Performance Improvements;</EM> CUPS no
longer loads every available printer before
@@ -393,7 +396,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<DT>Localization and Internationalization</DT>
<DD><OL START="71">
<DD><OL START="72">
<LI><EM>Command-Line Programs;</EM> All
command-line programs are now fully
@@ -411,7 +414,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<DT>Printer Drivers</DT>
<DD><OL START="74">
<DD><OL START="75">
<LI><EM>New Drivers;</EM> CUPS 1.2 adds Zebra
CPCL and EPL label printer drivers</LI>
@@ -446,7 +449,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<DT>CUPS API</DT>
<DD><OL START="81">
<DD><OL START="82">
<LI><EM>Thread Safety;</EM> All of the CUPS API
is now thread-safe on systems that support POSIX
@@ -503,7 +506,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<DT>CUPS Imaging API</DT>
<DD><OL START="91">
<DD><OL START="92">
<LI><EM>Image API;</EM> The new image API
provides access to image files of arbitrary size
@@ -519,7 +522,7 @@ HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
</OL></DD>
<DT>Scripting Support</DT>
<DD><OL START="93">
<DD><OL START="94">
<LI><EM>PHP Bindings;</EM> The PHP language
bindings have been revamped to be more consistent
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 627 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 536 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 571 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 608 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 797 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 531 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 580 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 878 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 469 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 339 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 463 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 513 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 673 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 657 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 363 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 649 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 605 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 697 B

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