Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 8a06fce149 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.1.8@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
295 arquivos alterados com 148143 adições e 49444 exclusões
+248 -1
Ver Arquivo
@@ -1,6 +1,253 @@
CHANGES.txt - 02/20/2001
CHANGES.txt - 05/22/2001
------------------------
CHANGES IN CUPS V1.1.8
- Updated configure script to check for /etc/pam.d and
to only set PAMDIR if it exists.
- Updated spec file to generate separate cups-pstoraster
package for pstoraster.
- The spec file wasn't setting LOGDIR in the install.
- The scheduler might restart a stopped printer after
stopping a print job. Thanks to Florent
Guiliani for finding this bug!
- The init script showed run level 0 for the Red Hat
chkconfig program. This is incorrect because Red Hat
doesn't use run level 0 for shutdown scripts.
- The IPP backend did not handle the
client-error-not-found error when checking the status
of the job that was sent. This caused remote queues
to stop on client machines when the server had job
history disabled.
- Added httpConnectEncrypt() function to avoid
performance penalty for setting up encrypted
connections initially.
- Use httpConnectEncrypt() in all client apps and in the
CUPS API to ensure consistent usage of encryption
throughout.
- Jobs weren't queued to remote classes (fix from
Richard Begg.)
- AIX changes from Richard Begg.
- Fixed the pstops fix for GNOME output - no longer use
the page numbers in the %%Page: comment since GNOME
puts a filename instead (!?@!#?!). There is still an
issue with N-up printing since GNOME defines its fonts
in the first page instead of the document setup section
(pages must be independent according to the DSC spec)
People with GNOME printing problems should consult bug
#54489...
- The imagetops filter produced PAGE: messages when
generating PostScript for a non-PostScript printer
(only affects page-label and Classification
options.)
- The updated pdftops filter was looking for an options
file called xpdf.conf instead of pdftops.conf.
- The scheduler would not force the default job sheets
for printers to the current classification setting.
- Added a new ippFindNextAttribute() function to the
CUPS API.
- ppdEmitJCL() now strips any leading path info from
the title string. This is only an issue for non-CUPS
clients that don't do this already...
- Other pstops fixed from Helge Blischke for printing
non-conforming documents.
- The MaxJobs parameter was not reset when loading the
cupsd.conf file.
CHANGES IN CUPS V1.1.7
- Configuration script changes, including new
"--with-docdir=/dir" option to relocate CUPS
documentation and web content according to your
favorite version of the FHS.
- Documentation updates for encryption, SLP, etc.
- New Software Test Plan and automated test script to
test CUPS prior to installation.
- All scheduler configuration files are now case
insensitive to match Apache.
- Added support for Apache ListenBackLog, LogFormat,
Require, UseCanonicalName, Satisfy, <Limit>,
<LimitExcept>, LimitRequestSize, and Options
directives.
- Added support for all Apache log levels...
- Added support for "double" HostNameLookups.
- Added new "RunAsUser" directive to support non-root
configurations on the standard (priviledged) ports.
- Added support for non-root invocation of the lpd
backend (does no reserve a priviledged port, which
might not work with some LPD servers...)
- Added new PrintcapFormat directive to control the
output format of the printcap file (BSD or Solaris
formats are supported at present.)
- The CUPS directory service routines now handle
ECONNREFUSED errors gracefully rather than shutting
all browsing off.
- ippErrorString() now returns the recommended error
messages from the IPP/1.1 Model and Semantics
document.
- Fixed a minor IPP compliance issue with responses
to requests without the attributes-charset or
attributes-natural-language attributes.
- Sun fix: need httpFlush() call for chunked IPP
requests in cupsDoFileRequest().
- httpConnect() now looks up "localhost" by name and
by address (127.0.0.1) for users the go to the
trouble of removing the required localhost entry
in /etc/hosts or on their DNS server...
- Added support for Linux 2.4.x devfs parallel port
filenames (/dev/parallel/N).
- cupsDo[File]Request() and cupsGetPPD() no longer
block trying to reconnect to a crashed or inaccessable
server.
- Added new ppdEmitJCL() function to better handle
PJL commands from PPD files.
- A bug in UpdateJob() would cause the scheduler to
consume 100% CPU until another request was submitted.
- The cancel command did not support the "-" option to
cancel all jobs on all printers.
- The cancel and lprm commands did not support cancelling
the next/current job in the queue.
- The pdftops and pstoraster filters were using unsafe
temporary file functions; while this is not a problem
in normal configurations (the CUPS temporary directory
is restricted), they now use the cupsTempFd() function.
- The mime.types file was missing the recognition rule
for Sun Raster images.
- The admin CGI was passing a printer make string to
ippSetCGIVars() that was being replaced in that
function.
- "lpoptions -l" would resave the options...
- The EPSON drivers now send the "end packet mode"
command when printing to USB devices.
- The scheduler initialized certificates before loading
the cupsd.conf file.
- The scheduler used /dev/random to collect random data,
which could block if insufficient entropy information
had been collected by the kernel. Now use
/dev/urandom.
- Fixed a bug in the whitespace skipping code in
httpGetSubField().
- The LPD backend now supports a new "order" option:
"lpd://server/queue?order=control,data" (default) and
"lpd://server/queue?order=data,control".
- The scheduler enforced a 30 second timeout on all
clients regardless of the Timeout directive and if a
CGI was currently running.
- cupsParseOptions() now sets boolean options to
option=true or option=false.
- The "percent complete" calculations in the LPD backend
could overflow on large files, causing the percentage
to wrap to 0 every 40MB or so.
- Fixed a memory reallocation bug in pstoraster that
could cause it to crash.
- The LPD backend now sanitizes the job title to avoid
potential problems on remote LPD servers.
- The lp command did not send the requesting-user-name
attribute when altering a job.
- The pstops filter did not handle PostScript files with
lines longer than 8191 bytes.
- The scheduler no longer uses inet_addr() to convert IP
addresses in dot format (mmm.nnn.ooo.ppp) to the
32-bit format, since it will not work for IPv6
addresses.
- New "Classification" directive to force labeling of
the current classification on each page.
- New "page-label" attribute to add per-page labels
("For Official Use Only", "Draft", etc.)
- The scheduler now sets the HTTPS environment variable
for CGI programs when a client connects using
encryption.
- Fixed a recursion bug in the scheduler that could
cause cupsd to crash when a printer was removed.
- The LPDEST and PRINTER environment variables didn't
support instances.
- Dropped the "file" backend from the device list that
is reported, since it is only available for *testing*
and should never be used in a production environment.
The file: device can still be used, but it won't show
up in the list of devices from lpinfo or the web
interface.
- Added support for /dev/lpa# parallel ports under *BSD.
- Added META variables to the CGI header template to
prevent caching of the results.
- Fixed an unaligned memory buffer for the pstoraster
clist states; this caused bus errors for some
combinations of printers, drivers, and options.
- Re-added black reduction for colorful colors; this
helps to prevent dark colors from getting desaturated.
(only used when converting RGB to CMYK)
- Added two new directives - MaxJobsPerPrinter and
MaxJobsPerUser - to allow an administrator to set
the maximum number of pending jobs in a queue or
submitted by a user.
- The scheduler no longer stops a printer if it can't
create the status pipe or run the filters or backend.
This will allow heavily loaded servers to service
clients or start print jobs as the load allows.
- Fixed a bug in the Set-Job-Attributes code that could
crash the scheduler (patch from Martin Zielinski)
- cupsSetDests() did not quote option values with
embedded spaces.
- Added support for the Enable-Printer and
Disable-Printer extension operations (same as
CUPS-Accept-Jobs and CUPS-Reject-Jobs.)
- The AppSocket and IPP backends now wait for the print
job to be finished before exiting; this should prevent
the loss of print jobs with older JetDirect firmware
and make consecutive print jobs print faster.
- The BMP loading code did not handle resolution values
of 0. This is a problem with BMP image files produced
by the GIMP.
- The HTTP Upgrade code (upgrade to TLS encryption)
bypassed the authentication checks.
- The HTTP Upgrade code did not send a 426 status code
to the client and end the current request. This caused
a race condition between the client and server for the
upgrade to TLS.
- Fixed a bug in the EOF and Trailer detection code in
the pstops filter.
- The imagetoraster filter did not add the margins to
the custom page size in the raster header.
- The imagetops filter did not adjust the custom page
size to the size of the printed image.
- The imagetops filter did not include DSC comments
which are required by some printers.
- The imagetops filter did not insert newlines in
Base85 encoded output, causing files to contain
lines longer than 255 characters (violation of the
DSC).
- Added support for the DeskJet 900 series duplexer
and CRET color modes in the HP driver.
- Added support for PPD-defined margins in the HP
driver.
- Fixed the debugging output from pstoraster - the
font list was not terminated by a newline.
- Some versions of the HP-UX pam_unix authentication
module apparently do not pass the appdata_ptr argument
to the conversation function, preventing the scheduler
from authenticating users using PAM under HP-UX. A
workaround using a static variable has been added to
address this problem.
- Fixed a bug in the scheduler SortPrinters() function
that could cause printers to disappear or the
scheduler to crash when adding a printer.
- Changed the pstops filter to not do per-page filtering
if the file does not conform to at least version 3.0
of the document structuring conventions. This seems
to "fix" printing with broken apps.
- The image filters did not handle older TIFF files that
lacked the samples-per-pixel and bits-per-pixel tags.
- Added new cupsGetJobs() and cupsFreeJobs() functions
to manage print jobs.
- cupsEncodeOptions() would encode names of 0 length and
cupsAddOption() and cupsParseOptions() would add names
of 0 length.
- The scheduler might block waiting for status messages
after starting a new print job. Thanks to Florent
Guiliani for finding this bug!
CHANGES IN CUPS V1.1.6-3
- The configure script put the JPEG library before the
+7 -2
Ver Arquivo
@@ -1,4 +1,4 @@
ENCRYPTION - CUPS v1.1.6 - 01/23/2001
ENCRYPTION - CUPS v1.1.7 - 02/21/2001
-------------------------------------
This file describes the encryption support provided by CUPS.
@@ -69,7 +69,12 @@ These keywords are also used in the cupsd.conf file to secure
particular locations. To secure all traffic on the server, listen
on port 443 (https port) instead of port 631 and change the "ipp"
service listing (or add it if you don't have one) in /etc/services
to 443.
to 443. To provide both secure and normal methods, add a line
reading:
SSLPort 443
to /etc/cups/cupsd.conf.
BEFORE YOU BEGIN
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.1.6 - 01/23/2001
INSTALL - CUPS v1.1.7 - 05/01/2001
----------------------------------
This file describes how to compile and install CUPS from source
+2 -2
Ver Arquivo
@@ -7,11 +7,11 @@
<H2 ALIGN="CENTER">Common UNIX Printing System License Agreement</H2>
<P ALIGN="CENTER">Copyright 1997-2000 by Easy Software Products<BR>
<P ALIGN="CENTER">Copyright 1997-2001 by Easy Software Products<BR>
44141 AIRPORT VIEW DR STE 204<BR>
HOLLYWOOD, MARYLAND 20636-3111 USA<BR>
<BR>
Voice: +1.301.373.9603<BR>
Voice: +1.301.373.9600<BR>
Email: <A HREF="mailto:cups-info@cups.org">cups-info@cups.org</A><BR>
WWW: <A HREF="http://www.cups.org">http://www.cups.org</A>
+2 -5
Ver Arquivo
@@ -70,8 +70,6 @@ LIBZ = @LIBZ@
#
# Program options...
#
# GSOPTIM defines the common compiler optimization/debugging options for
# pstoraster (Ghostscript).
# OPTIM defines the common compiler optimization/debugging options.
# OPTIONS defines other compile-time options (currently only -dDEBUG for
# extra debug info)
@@ -82,7 +80,6 @@ CFLAGS = @CFLAGS@ -I.. $(OPTIONS)
CXXFLAGS = @CXXFLAGS@ -I.. $(OPTIONS)
DSOFLAGS = @DSOFLAGS@
DSOLIBS = @DSOLIBS@
GSOPTIM = @GSOPTIM@
IMGLIBS = @IMGLIBS@ -lm
LDFLAGS = @LDFLAGS@ $(OPTIM)
LINKCUPS = @LINKCUPS@
@@ -149,14 +146,14 @@ MAN8EXT = @MAN8EXT@
#
.SILENT:
.SUFFIXES: .a .c .cxx .h .man .o .0 .1 .5 .8 .z
.SUFFIXES: .a .c .cxx .h .man .o .0 .1 .1m .5 .8 .z
.c.o:
echo Compiling $<...
$(CC) $(OPTIM) $(CFLAGS) -c $<
.cxx.o:
echo Compiling $<...
$(CXX) $(OPTIM) $(CXXFLAGS) -c $<
.man.0 .man.1 .man.5 .man.8:
.man.0 .man.1 .man.1m .man.5 .man.8:
echo Formatting $<...
$(RM) $@
$(NROFF) -man $< >$@
+11
Ver Arquivo
@@ -100,11 +100,22 @@ install:
$(CHMOD) ugo+rx $(prefix)/$(INITDDIR)/cups; \
fi
#
# Run the test suite...
#
test: all
echo Running CUPS test suite...
cd test; ./run-stp-tests.sh
#
# Make software distributions using EPM (http://www.easysw.com/epm)...
#
EPMFLAGS = -v \
AMANDIR=$(AMANDIR) \
BINDIR=$(BINDIR) DATADIR=$(DATADIR) \
DOCDIR=$(DOCDIR) INCLUDEDIR=$(INCLUDEDIR) \
LIBDIR=$(LIBDIR) LOCALEDIR=$(LOCALEDIR) \
+2 -2
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.1.6 - 01/23/2001
README - CUPS v1.1.8 - 05/22/2001
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
@@ -266,7 +266,7 @@ For commercial licensing information, please contact:
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636-3111 USA
Voice: +1.301.373.9603
Voice: +1.301.373.9600
Email: cups-info@cups.org
WWW: http://www.cups.org
+211 -280
Ver Arquivo
@@ -23,7 +23,8 @@
*
* Contents:
*
* main() - Send a file to the printer or server.
* main() - Send a file to the printer or server.
* password_cb() - Disable the password prompt for cupsDoFileRequest().
*/
/*
@@ -41,6 +42,20 @@
#include <signal.h>
/*
* Local functions...
*/
const char *password_cb(const char *);
/*
* Local globals...
*/
char *password = NULL;
/*
* 'main()' - Send a file to the printer or server.
*
@@ -62,25 +77,20 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
resource[1024], /* Resource info (printer name) */
filename[1024]; /* File to print */
int port; /* Port number (not used) */
char password[255], /* Password info */
uri[HTTP_MAX_URI];/* Updated URI without user/pass */
http_status_t status; /* Status of HTTP job */
char uri[HTTP_MAX_URI];/* Updated URI without user/pass */
ipp_status_t ipp_status; /* Status of IPP request */
FILE *fp; /* File to print */
http_t *http; /* HTTP connection */
ipp_t *request, /* IPP request */
*response, /* IPP response */
*supported; /* get-printer-attributes response */
ipp_attribute_t *job_id; /* job-id attribute */
ipp_attribute_t *job_id_attr; /* job-id attribute */
int job_id; /* job-id value */
ipp_attribute_t *job_state; /* job-state attribute */
ipp_attribute_t *copies_sup; /* copies-supported attribute */
ipp_attribute_t *charset_sup; /* charset-supported attribute */
ipp_attribute_t *format_sup; /* document-format-supported attribute */
const char *charset; /* Character set to use */
cups_lang_t *language; /* Default language */
struct stat fileinfo; /* File statistics */
size_t nbytes, /* Number of bytes written */
tbytes; /* Total bytes written */
char buffer[8192]; /* Output buffer */
int copies; /* Number of copies remaining */
const char *content_type; /* CONTENT_TYPE environment variable */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
@@ -158,24 +168,26 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
filename[sizeof(filename) - 1] = '\0';
}
/*
* Open the print file...
*/
if ((fp = fopen(filename, "rb")) == NULL)
{
perror("ERROR: Unable to open print file");
return (1);
}
else
stat(filename, &fileinfo);
/*
* Extract the hostname and printer name from the URI...
*/
httpSeparate(argv[0], method, username, hostname, &port, resource);
/*
* Set the authentication info, if any...
*/
cupsSetPasswordCB(password_cb);
if (username[0])
{
if ((password = strchr(username, ':')) != NULL)
*password++ = '\0';
cupsSetUser(username);
}
/*
* Try connecting to the remote server...
*/
@@ -243,159 +255,65 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
/*
* Now fill in the HTTP request stuff...
*/
httpClearFields(http);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
if (username[0])
{
httpEncode64(password, username);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
}
sprintf(buffer, "%u", ippLength(request));
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, buffer);
/*
* Do the request...
*/
for (response = NULL, ipp_status = IPP_BAD_REQUEST;;)
if ((supported = cupsDoRequest(http, request, resource)) == NULL)
ipp_status = cupsLastError();
else
ipp_status = supported->request.status.status_code;
if (ipp_status > IPP_OK_CONFLICT)
{
/*
* POST the request, retrying as needed...
*/
if (httpPost(http, resource))
{
fputs("INFO: Unable to POST get-printer-attributes request; retrying...\n", stderr);
sleep(10);
httpReconnect(http);
continue;
}
fputs("INFO: POST successful, sending IPP request...\n", stderr);
/*
* Send the IPP request...
*/
request->state = IPP_IDLE;
if (ippWrite(http, request) == IPP_ERROR)
{
fputs("ERROR: Unable to send IPP request!\n", stderr);
status = HTTP_ERROR;
break;
}
fputs("INFO: IPP request sent, getting status...\n", stderr);
/*
* Finally, check the status from the HTTP server...
*/
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
if (supported)
ippDelete(supported);
ippDelete(supported);
if (status == HTTP_OK)
if (ipp_status == IPP_PRINTER_BUSY ||
ipp_status == IPP_SERVICE_UNAVAILABLE)
{
supported = ippNew();
ippRead(http, supported);
fputs("INFO: Printer busy; will retry in 10 seconds...\n", stderr);
sleep(10);
}
else if ((ipp_status == IPP_BAD_REQUEST ||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
{
/*
* Switch to IPP/1.0...
*/
ipp_status = supported->request.status.status_code;
if (ipp_status > IPP_OK_CONFLICT)
{
if (ipp_status == IPP_PRINTER_BUSY ||
ipp_status == IPP_SERVICE_UNAVAILABLE)
{
fputs("INFO: Printer busy; will retry in 10 seconds...\n", stderr);
sleep(10);
}
else if ((ipp_status == IPP_BAD_REQUEST ||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
{
/*
* Switch to IPP/1.0...
*/
fputs("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n", stderr);
version = 0;
}
else
{
fprintf(stderr, "ERROR: Printer will not accept print file (%x)!\n",
ipp_status);
fprintf(stderr, "ERROR: %s\n", ippErrorString(ipp_status));
status = HTTP_ERROR;
}
}
else if ((copies_sup = ippFindAttribute(supported, "copies-supported",
IPP_TAG_RANGE)) != NULL)
{
/*
* Has the "copies-supported" attribute - does it have an upper
* bound > 1?
*/
if (copies_sup->values[0].range.upper <= 1)
copies_sup = NULL; /* No */
}
charset_sup = ippFindAttribute(supported, "charset-supported",
IPP_TAG_CHARSET);
format_sup = ippFindAttribute(supported, "document-format-supported",
IPP_TAG_MIMETYPE);
if (format_sup)
{
fprintf(stderr, "DEBUG: document-format-supported (%d values)\n",
format_sup->num_values);
for (i = 0; i < format_sup->num_values; i ++)
fprintf(stderr, "DEBUG: [%d] = \"%s\"\n", i,
format_sup->values[i].string.text);
}
fputs("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n", stderr);
version = 0;
}
else
{
supported = NULL;
if (status == HTTP_ERROR)
{
fprintf(stderr, "WARNING: Did not receive the IPP supported (%d)\n",
errno);
status = HTTP_OK;
ipp_status = IPP_PRINTER_BUSY;
}
else
{
fprintf(stderr, "ERROR: Validate request was not accepted (%d)!\n",
status);
ipp_status = IPP_FORBIDDEN;
}
}
httpFlush(http);
break;
fprintf(stderr, "ERROR: Printer will not accept print file (%s)!\n",
ippErrorString(ipp_status));
}
if (status != HTTP_OK)
else if ((copies_sup = ippFindAttribute(supported, "copies-supported",
IPP_TAG_RANGE)) != NULL)
{
if (fp != stdin)
fclose(fp);
/*
* Has the "copies-supported" attribute - does it have an upper
* bound > 1?
*/
httpClose(http);
return (1);
if (copies_sup->values[0].range.upper <= 1)
copies_sup = NULL; /* No */
}
charset_sup = ippFindAttribute(supported, "charset-supported",
IPP_TAG_CHARSET);
format_sup = ippFindAttribute(supported, "document-format-supported",
IPP_TAG_MIMETYPE);
if (format_sup)
{
fprintf(stderr, "DEBUG: document-format-supported (%d values)\n",
format_sup->num_values);
for (i = 0; i < format_sup->num_values; i ++)
fprintf(stderr, "DEBUG: [%d] = \"%s\"\n", i,
format_sup->values[i].string.text);
}
else if (ipp_status > IPP_OK_CONFLICT)
httpReconnect(http);
}
while (ipp_status > IPP_OK_CONFLICT);
@@ -524,134 +442,40 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (copies_sup)
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies", atoi(argv[4]));
/*
* Now fill in the HTTP request stuff...
*/
httpClearFields(http);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
if (username[0])
{
httpEncode64(password, username);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
}
sprintf(buffer, "%u", ippLength(request) + (size_t)fileinfo.st_size);
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, buffer);
/*
* Do the request...
*/
for (;;)
if ((response = cupsDoFileRequest(http, request, resource, filename)) == NULL)
ipp_status = cupsLastError();
else
ipp_status = response->request.status.status_code;
if (ipp_status > IPP_OK_CONFLICT)
{
/*
* POST the request, retrying as needed...
*/
httpReconnect(http);
if (httpPost(http, resource))
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_PRINTER_BUSY)
{
fputs("INFO: Unable to POST print request; retrying...\n", stderr);
fputs("INFO: Printer is busy; retrying print job...\n", stderr);
sleep(10);
continue;
}
fputs("INFO: POST successful, sending IPP request...\n", stderr);
/*
* Send the IPP request...
*/
request->state = IPP_IDLE;
if (ippWrite(http, request) == IPP_ERROR)
{
fputs("ERROR: Unable to send IPP request!\n", stderr);
status = HTTP_ERROR;
break;
}
fputs("INFO: IPP request sent, sending print file...\n", stderr);
/*
* Then send the file...
*/
rewind(fp);
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
{
tbytes += nbytes;
fprintf(stderr, "INFO: Sending print file, %uk...\n", tbytes / 1024);
if (httpWrite(http, buffer, nbytes) < nbytes)
{
perror("ERROR: Unable to send print file to printer");
status = HTTP_ERROR;
break;
}
}
fputs("INFO: Print file sent; checking status...\n", stderr);
/*
* Finally, check the status from the HTTP server...
*/
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
if (status == HTTP_OK)
{
response = ippNew();
ippRead(http, response);
if ((ipp_status = response->request.status.status_code) > IPP_OK_CONFLICT)
{
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_PRINTER_BUSY)
{
fputs("INFO: Printer is busy; retrying print job...\n", stderr);
sleep(10);
}
else
{
fprintf(stderr, "ERROR: Print file was not accepted (%04x)!\n",
response->request.status.status_code);
fprintf(stderr, "ERROR: %s\n", ippErrorString(ipp_status));
}
}
else if ((job_id = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) == NULL)
fputs("INFO: Print file accepted - job ID unknown.\n", stderr);
else
fprintf(stderr, "INFO: Print file accepted - job ID %d.\n",
job_id->values[0].integer);
}
else
{
response = NULL;
ipp_status = IPP_PRINTER_BUSY;
if (status == HTTP_ERROR)
{
fprintf(stderr, "WARNING: Did not receive the IPP response (%d)\n",
errno);
status = HTTP_OK;
}
else
fprintf(stderr, "ERROR: Print request was not accepted (%d)!\n", status);
}
httpFlush(http);
break;
fprintf(stderr, "ERROR: Print file was not accepted (%s)!\n",
ippErrorString(ipp_status));
}
else if ((job_id_attr = ippFindAttribute(response, "job-id",
IPP_TAG_INTEGER)) == NULL)
{
fputs("INFO: Print file accepted - job ID unknown.\n", stderr);
job_id = 0;
}
else
{
job_id = job_id_attr->values[0].integer;
fprintf(stderr, "INFO: Print file accepted - job ID %d.\n", job_id);
}
if (request != NULL)
ippDelete(request);
if (response != NULL)
if (response)
ippDelete(response);
if (ipp_status <= IPP_OK_CONFLICT)
@@ -662,6 +486,99 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
ipp_status != IPP_PRINTER_BUSY)
break;
/*
* Wait for the job to complete...
*/
if (!job_id)
continue;
fputs("INFO: Waiting for job to complete...\n", stderr);
for (;;)
{
/*
* Build an IPP_GET_JOB_ATTRIBUTES request...
*/
request = ippNew();
request->request.op.version[1] = version;
request->request.op.operation_id = IPP_GET_JOB_ATTRIBUTES;
request->request.op.request_id = 1;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL, charset);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL,
language != NULL ? language->language : "en");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
job_id);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", NULL, "job-state");
/*
* Do the request...
*/
if ((response = cupsDoRequest(http, request, resource)) == NULL)
ipp_status = cupsLastError();
else
ipp_status = response->request.status.status_code;
if (ipp_status == IPP_NOT_FOUND)
{
/*
* Job has gone away and/or the server has no job history...
*/
ippDelete(response);
ipp_status = IPP_OK;
break;
}
if (ipp_status > IPP_OK_CONFLICT)
{
if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
ipp_status != IPP_PRINTER_BUSY)
{
if (response)
ippDelete(response);
fprintf(stderr, "ERROR: Unable to get job %d attributes (%s)!\n",
job_id, ippErrorString(ipp_status));
break;
}
}
else if ((job_state = ippFindAttribute(response, "job-state", IPP_TAG_ENUM)) != NULL)
{
/*
* Stop polling if the job is finished...
*/
if (job_state->values[0].integer > IPP_JOB_PROCESSING)
{
ippDelete(response);
break;
}
}
/*
* Wait 10 seconds before polling again...
*/
if (response)
ippDelete(response);
sleep(10);
}
}
/*
@@ -677,8 +594,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Close and remove the temporary file if necessary...
*/
fclose(fp);
if (argc < 7)
unlink(filename);
@@ -686,7 +601,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Return the queue status...
*/
return (status != HTTP_OK);
if (ipp_status <= IPP_OK_CONFLICT)
fputs("INFO: " CUPS_SVERSION " is ready to print.\n", stderr);
return (ipp_status > IPP_OK_CONFLICT);
}
/*
* 'password_cb()' - Disable the password prompt for cupsDoFileRequest().
*/
const char * /* O - Password */
password_cb(const char *prompt) /* I - Prompt (not used) */
{
(void)prompt;
return (password);
}
+160 -33
Ver Arquivo
@@ -26,6 +26,7 @@
* main() - Send a file to the printer or server.
* lpd_command() - Send an LPR command sequence and wait for a reply.
* lpd_queue() - Queue a file using the Line Printer Daemon protocol.
* lpd_write() - Write a buffer of data to an LPD server.
*/
/*
@@ -36,6 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <cups/string.h>
#include <errno.h>
#include <sys/types.h>
@@ -51,7 +53,20 @@
# include <netdb.h>
#endif /* WIN32 || __EMX__ */
extern int rresvport(int *port); /* Hello? No prototype for this... */
/*
* The order for control and data files in LPD requests...
*/
#define ORDER_CONTROL_DATA 0
#define ORDER_DATA_CONTROL 1
/*
* It appears that rresvport() is never declared on most systems...
*/
extern int rresvport(int *port);
/*
@@ -61,7 +76,8 @@ extern int rresvport(int *port); /* Hello? No prototype for this... */
static int lpd_command(int lpd_fd, char *format, ...);
static int lpd_queue(char *hostname, char *printer, char *filename,
char *user, char *title, int copies, int banner,
int format);
int format, int order);
static int lpd_write(int lpd_fd, char *buffer, int length);
/*
@@ -84,11 +100,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
name[255], /* Name of option */
value[255], /* Value of option */
*ptr, /* Pointer into name or value */
filename[1024]; /* File to print */
filename[1024], /* File to print */
title[256]; /* Title string */
int port; /* Port number (not used) */
int status; /* Status of LPD job */
int banner; /* Print banner page? */
int format; /* Print format */
int order; /* Order of control/data files */
/*
@@ -165,6 +183,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
banner = 0;
format = 'l';
order = ORDER_CONTROL_DATA;
if ((options = strchr(resource, '?')) != NULL)
{
@@ -233,9 +252,33 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else
fprintf(stderr, "ERROR: Unknown format character \"%c\"\n", value[0]);
}
else if (strcasecmp(name, "order") == 0 && value[0])
{
/*
* Set control/data order...
*/
if (strcasecmp(value, "control,data") == 0)
order = ORDER_CONTROL_DATA;
else if (strcasecmp(value, "data,control") == 0)
order = ORDER_DATA_CONTROL;
else
fprintf(stderr, "ERROR: Unknown file order \"%s\"\n", value);
}
}
}
/*
* Sanitize the document title...
*/
strncpy(title, argv[3], sizeof(title) - 1);
title[sizeof(title) - 1] = '\0';
for (ptr = title; *ptr; ptr ++)
if (!isalnum(*ptr) && !isspace(*ptr))
*ptr = '_';
/*
* Queue the job...
*/
@@ -243,16 +286,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc > 6)
{
status = lpd_queue(hostname, resource + 1, filename,
argv[2] /* user */, argv[3] /* title */,
atoi(argv[4]) /* copies */, banner, format);
argv[2] /* user */, title, atoi(argv[4]) /* copies */,
banner, format, order);
if (!status)
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
}
else
status = lpd_queue(hostname, resource + 1, filename,
argv[2] /* user */, argv[3] /* title */, 1,
banner, format);
argv[2] /* user */, title, 1, banner, format, order);
/*
* Remove the temporary file if necessary...
@@ -300,7 +342,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
fprintf(stderr, "DEBUG: Sending command string (%d bytes)...\n", bytes);
if (send(fd, buf, bytes, 0) < bytes)
if (lpd_write(fd, buf, bytes) < bytes)
return (-1);
/*
@@ -330,7 +372,8 @@ lpd_queue(char *hostname, /* I - Host to connect to */
char *title, /* I - Job title */
int copies, /* I - Number of copies */
int banner, /* I - Print LPD banner? */
int format) /* I - Format specifier */
int format, /* I - Format specifier */
int order) /* I - Order of data/control files */
{
FILE *fp; /* Job file */
char localhost[255]; /* Local host name */
@@ -372,11 +415,31 @@ lpd_queue(char *hostname, /* I - Host to connect to */
for (port = 732;;)
{
if ((fd = rresvport(&port)) < 0)
if (getuid())
{
perror("ERROR: Unable to reserve port");
sleep(30);
continue;
/*
* We're running as a normal user, so just create a regular socket...
*/
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
perror("ERROR: Unable to create socket");
return (1);
}
}
else
{
/*
* We're running as root, so comply with RFC 1179 and reserve a
* priviledged port between 721 and 732...
*/
if ((fd = rresvport(&port)) < 0)
{
perror("ERROR: Unable to reserve port");
sleep(30);
continue;
}
}
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
@@ -407,7 +470,7 @@ lpd_queue(char *hostname, /* I - Host to connect to */
break;
}
fprintf(stderr, "INFO: Connected on port %d...\n", port);
fprintf(stderr, "INFO: Connected from port %d...\n", port);
/*
* Now that we are "connected" to the port, ignore SIGTERM so that we
@@ -477,27 +540,36 @@ lpd_queue(char *hostname, /* I - Host to connect to */
fprintf(stderr, "DEBUG: Control file is:\n%s", control);
lpd_command(fd, "\002%d cfA%03.3d%s\n", strlen(control), getpid() % 1000,
localhost);
fprintf(stderr, "INFO: Sending control file (%d bytes)\n", strlen(control));
if (send(fd, control, strlen(control) + 1, 0) < (strlen(control) + 1))
if (order == ORDER_CONTROL_DATA)
{
perror("ERROR: Unable to write control file");
status = 1;
lpd_command(fd, "\002%d cfA%03.3d%s\n", strlen(control), getpid() % 1000,
localhost);
fprintf(stderr, "INFO: Sending control file (%d bytes)\n", strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
{
status = errno;
perror("ERROR: Unable to write control file");
}
else if (read(fd, &status, 1) < 1)
status = errno;
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
status);
else
fputs("INFO: Control file sent successfully\n", stderr);
}
else if (read(fd, &status, 1) < 1 || status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
status);
else
status = 0;
if (status == 0)
{
/*
* Send the print file...
*/
fputs("INFO: Control file sent successfully\n", stderr);
lpd_command(fd, "\003%u dfA%03.3d%s\n", (unsigned)filestats.st_size,
getpid() % 1000, localhost);
@@ -508,9 +580,9 @@ lpd_queue(char *hostname, /* I - Host to connect to */
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
{
fprintf(stderr, "INFO: Spooling LPR job, %u%% complete...\n",
(unsigned)(100 * tbytes / filestats.st_size));
(unsigned)(100.0f * tbytes / filestats.st_size));
if (send(fd, buffer, nbytes, 0) < nbytes)
if (lpd_write(fd, buffer, nbytes) < nbytes)
{
perror("ERROR: Unable to send print file to printer");
break;
@@ -519,17 +591,42 @@ lpd_queue(char *hostname, /* I - Host to connect to */
tbytes += nbytes;
}
send(fd, "", 1, 0);
if (tbytes < filestats.st_size)
status = 1;
else if (recv(fd, &status, 1, 0) < 1 || status != 0)
status = errno;
else if (lpd_write(fd, "", 1) < 1)
status = errno;
else if (recv(fd, &status, 1, 0) < 1)
status = errno;
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept data file (%d)\n",
status);
else
fputs("INFO: Data file sent successfully\n", stderr);
}
if (status == 0 && order == ORDER_DATA_CONTROL)
{
lpd_command(fd, "\002%d cfA%03.3d%s\n", strlen(control), getpid() % 1000,
localhost);
fprintf(stderr, "INFO: Sending control file (%d bytes)\n", strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
{
status = errno;
perror("ERROR: Unable to write control file");
}
else if (read(fd, &status, 1) < 1)
status = errno;
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
status);
else
fputs("INFO: Control file sent successfully\n", stderr);
}
/*
* Close the socket connection and input file and return...
*/
@@ -541,6 +638,36 @@ lpd_queue(char *hostname, /* I - Host to connect to */
}
/*
* 'lpd_write()' - Write a buffer of data to an LPD server.
*/
static int /* O - Number of bytes written or -1 on error */
lpd_write(int lpd_fd, /* I - LPD socket */
char *buffer, /* I - Buffer to write */
int length) /* I - Number of bytes to write */
{
int bytes, /* Number of bytes written */
total; /* Total number of bytes written */
total = 0;
while ((bytes = send(lpd_fd, buffer, length - total, 0)) >= 0)
{
total += bytes;
buffer += bytes;
if (total == length)
break;
}
if (bytes < 0)
return (-1);
else
return (length);
}
/*
* End of "$Id$".
*/
+32 -8
Ver Arquivo
@@ -288,7 +288,8 @@ list_devices(void)
int i; /* Looping var */
int fd; /* File descriptor */
char device[255], /* Device filename */
probefile[255]; /* Probe filename */
probefile[255], /* Probe filename */
basedevice[255]; /* Base device filename for ports */
FILE *probe; /* /proc/parport/n/autoprobe file */
char line[1024], /* Line from file */
*delim, /* Delimiter in file */
@@ -302,14 +303,30 @@ list_devices(void)
* First open the device to make sure the driver module is loaded...
*/
sprintf(device, "/dev/lp%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
if ((fd = open("/dev/parallel/0", O_WRONLY)) >= 0)
{
close(fd);
strcpy(basedevice, "/dev/parallel/");
}
else
{
sprintf(device, "/dev/par%d", i);
sprintf(device, "/dev/lp%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
{
close(fd);
strcpy(basedevice, "/dev/lp");
}
else
{
sprintf(device, "/dev/par%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
{
close(fd);
strcpy(basedevice, "/dev/par");
}
else
strcpy(basedevice, "/dev/unknown-parallel");
}
}
/*
@@ -363,11 +380,11 @@ list_devices(void)
fclose(probe);
if (make[0])
printf("direct parallel:/dev/lp%d \"%s %s\" \"Parallel Port #%d\"\n",
i, make, model, i + 1);
printf("direct parallel:%s%d \"%s %s\" \"Parallel Port #%d\"\n",
basedevice, i, make, model, i + 1);
else
printf("direct parallel:/dev/lp%d \"%s\" \"Parallel Port #%d\"\n",
i, model, i + 1);
printf("direct parallel:%s%d \"%s\" \"Parallel Port #%d\"\n",
basedevice, i, model, i + 1);
}
else if (fd >= 0)
{
@@ -589,6 +606,13 @@ list_devices(void)
close(fd);
printf("direct parallel:%s \"Unknown\" \"Parallel Port #%d\"\n", device, i + 1);
}
sprintf(device, "/dev/lpa%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
{
close(fd);
printf("direct parallel:%s \"Unknown\" \"Parallel Port #%d\"\n", device, i + 1);
}
}
#endif
}
+1 -1
Ver Arquivo
@@ -50,7 +50,7 @@
# include <termios.h>
# ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
# endif /* __linux */
# endif /* HAVE_SYS_IOCTL_H */
#endif /* WIN32 || __EMX__ */
#ifdef __sgi
+49 -1
Ver Arquivo
@@ -254,11 +254,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Check for possible data coming back from the printer...
*/
timeout.tv_sec = 0;
timeout.tv_sec = 0;
timeout.tv_usec = 0;
FD_ZERO(&input);
FD_SET(fd, &input);
#ifdef __hpux
if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
#else
if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
#endif /* __hpux */
{
/*
* Grab the data coming back and spit it out to stderr...
@@ -272,6 +277,47 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
fprintf(stderr, "INFO: Sending print file, %u bytes...\n", tbytes);
}
/*
* Shutdown the socket and wait for the other end to finish...
*/
fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
shutdown(fd, 1);
for (;;)
{
/*
* Wait a maximum of 90 seconds for backchannel data or a closed
* connection...
*/
timeout.tv_sec = 90;
timeout.tv_usec = 0;
FD_ZERO(&input);
FD_SET(fd, &input);
#ifdef __hpux
if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
#else
if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
#endif /* __hpux */
{
/*
* Grab the data coming back and spit it out to stderr...
*/
if ((nbytes = recv(fd, buffer, sizeof(buffer), 0)) > 0)
fprintf(stderr, "INFO: Received %u bytes of back-channel data!\n",
nbytes);
else
break;
}
else
break;
}
/*
* Close the socket connection...
*/
@@ -286,6 +332,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (fp != stdin)
fclose(fp);
fputs("INFO: " CUPS_SVERSION " is ready to print.\n", stderr);
return (0);
}
+1 -1
Ver Arquivo
@@ -69,7 +69,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the scheduler...
*/
http = httpConnect(cupsServer(), ippPort());
http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
if (argc > 1)
{
+2 -1
Ver Arquivo
@@ -79,7 +79,8 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the scheduler...
*/
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption())) == NULL)
{
fputs("lpq: Unable to contact server!\n", stderr);
return (1);
+2 -2
Ver Arquivo
@@ -82,9 +82,9 @@ main(int argc, /* I - Number of command-line arguments */
int deletefile; /* Delete file after print? */
char buffer[8192]; /* Copy buffer */
int temp; /* Temporary file descriptor */
#ifdef HAVE_SIGACTION
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Signal action */
#endif /* HAVE_SIGACTION */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
deletefile = 0;
+12 -3
Ver Arquivo
@@ -82,15 +82,13 @@ main(int argc, /* I - Number of command-line arguments */
* Open a connection to the server...
*/
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
if ((http = httpConnectEncrypt(cupsServer(), ippPort(), encryption)) == NULL)
{
fputs("lprm: Unable to contact server!\n", stderr);
cupsFreeDests(num_dests, dests);
return (1);
}
httpEncryption(http, encryption);
/*
* Process command-line arguments...
*/
@@ -150,7 +148,10 @@ main(int argc, /* I - Number of command-line arguments */
op = IPP_PURGE_JOBS;
}
else
{
dest = argv[i];
job_id = 0;
}
/*
* Build an IPP request, which requires the following
@@ -221,6 +222,14 @@ main(int argc, /* I - Number of command-line arguments */
break;
}
if (response->request.status.status_code > IPP_OK_CONFLICT)
{
ippDelete(response);
cupsFreeDests(num_dests, dests);
httpClose(http);
return (1);
}
ippDelete(response);
}
else
+4 -4
Ver Arquivo
@@ -50,10 +50,10 @@ clean:
#
install:
-$(MKDIR) $(SERVERROOT)/cgi-bin
$(CHMOD) ugo+rx $(SERVERROOT)
$(CHMOD) ugo+rx $(SERVERROOT)/cgi-bin
$(INSTALL_BIN) $(CGIS) $(SERVERROOT)/cgi-bin
-$(MKDIR) $(SERVERBIN)/cgi-bin
$(CHMOD) ugo+rx $(SERVERBIN)
$(CHMOD) ugo+rx $(SERVERBIN)/cgi-bin
$(INSTALL_BIN) $(CGIS) $(SERVERBIN)/cgi-bin
#
+6 -2
Ver Arquivo
@@ -105,7 +105,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the HTTP server...
*/
http = httpConnect("localhost", ippPort());
http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
/*
* Do the operation...
@@ -495,6 +495,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
*uriptr; /* Pointer into URI */
int maxrate; /* Maximum baud rate */
char baudrate[255]; /* Baud rate string */
char make[255]; /* Make string */
const char *name, /* Pointer to class name */
*ptr; /* Pointer to CGI variable */
static int baudrates[] = /* Baud rates */
@@ -787,7 +788,10 @@ do_am_printer(http_t *http, /* I - HTTP connection */
* Let the user choose a model...
*/
ippSetCGIVars(response, "ppd-make", var);
strncpy(make, var, sizeof(make) - 1);
make[sizeof(make) - 1] = '\0';
ippSetCGIVars(response, "ppd-make", make);
cgiCopyTemplateLang(stdout, TEMPLATES, "choose-model.tmpl",
getenv("LANG"));
}
+1 -1
Ver Arquivo
@@ -71,7 +71,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the HTTP server...
*/
http = httpConnect("localhost", ippPort());
http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
/*
* Tell the client to expect HTML...
+13 -6
Ver Arquivo
@@ -97,13 +97,15 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
resource[HTTP_MAX_URI],
uri[HTTP_MAX_URI];
int port; /* URI data */
int ishttps; /* Using encryption? */
const char *server; /* Name of server */
struct tm *date; /* Date information */
ippSetServerVersion();
server = getenv("SERVER_NAME");
server = getenv("SERVER_NAME");
ishttps = getenv("HTTPS") != NULL;
for (attr = response->attrs;
attr && attr->group_tag == IPP_TAG_OPERATION;
@@ -234,25 +236,30 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
strcmp(method, "http") == 0)
{
/*
* Map localhost access to localhost...
* Map localhost access to localhost and local port...
*/
if (strcasecmp(hostname, server) == 0 &&
(strcmp(getenv("REMOTE_HOST"), "127.0.0.1") == 0 ||
strcmp(getenv("REMOTE_HOST"), "localhost") == 0 ||
strcmp(getenv("REMOTE_HOST"), server) == 0))
{
strcpy(hostname, "localhost");
port = atoi(getenv("SERVER_PORT"));
}
/*
* Rewrite URI with HTTP address...
*/
if (username[0])
snprintf(uri, sizeof(uri), "http://%s@%s:%d%s", username,
hostname, port, resource);
snprintf(uri, sizeof(uri), "%s://%s@%s:%d%s",
ishttps ? "https" : "http",
username, hostname, port, resource);
else
snprintf(uri, sizeof(uri), "http://%s:%d%s", hostname, port,
resource);
snprintf(uri, sizeof(uri), "%s://%s:%d%s",
ishttps ? "https" : "http",
hostname, port, resource);
strncat(valptr, uri, sizeof(value) - (valptr - value) - 1);
break;
+1 -1
Ver Arquivo
@@ -64,7 +64,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the HTTP server...
*/
http = httpConnect("localhost", ippPort());
http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
/*
* Tell the client to expect HTML...
+1 -1
Ver Arquivo
@@ -71,7 +71,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the HTTP server...
*/
http = httpConnect("localhost", ippPort());
http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
/*
* Tell the client to expect HTML...
+3 -3
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: classes.conf 1152 2000-06-22 18:25:29Z mike $"
# "$Id: classes.conf 1605 2001-03-02 22:34:21Z andy $"
#
# Sample class configuration file for the Common UNIX Printing System
# (CUPS) scheduler.
#
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
# Copyright 1997-2001 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
@@ -85,5 +85,5 @@
#</Class>
#
# End of "$Id: classes.conf 1152 2000-06-22 18:25:29Z mike $".
# End of "$Id: classes.conf 1605 2001-03-02 22:34:21Z andy $".
#
+3 -3
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: client.conf 1485 2000-12-20 13:41:17Z mike $"
# "$Id: client.conf 1605 2001-03-02 22:34:21Z andy $"
#
# Sample client configuration file for the Common UNIX Printing System
# (CUPS).
#
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
# Copyright 1997-2001 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
@@ -61,5 +61,5 @@
#
# End of "$Id: client.conf 1485 2000-12-20 13:41:17Z mike $".
# End of "$Id: client.conf 1605 2001-03-02 22:34:21Z andy $".
#
+15 -4
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: cupsd.conf 1485 2000-12-20 13:41:17Z mike $"
# "$Id: cupsd.conf 1631 2001-03-14 13:45:35Z mike $"
#
# Sample configuration file for the Common UNIX Printing System (CUPS)
# scheduler.
#
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
# Copyright 1997-2001 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
@@ -71,6 +71,17 @@
#AccessLog /var/log/cups/access_log
#
# Classification: the classification level of the server. If set, this
# classification is displayed on all pages, and raw printing is disabled.
# The default is the empty string.
#Classification classified
#Classification confidential
#Classification secret
#Classification topsecret
#Classification unclassified
#
# DataDir: the root directory for the CUPS data files.
# By default /usr/share/cups.
@@ -98,7 +109,7 @@
# By default the compiled in directory.
#
#DocumentRoot /usr/share/cups/doc
#DocumentRoot /usr/share/doc/cups
#
# ErrorLog: the error log file; if this does not start with a leading /
@@ -624,5 +635,5 @@ Allow From 127.0.0.1
</Location>
#
# End of "$Id: cupsd.conf 1485 2000-12-20 13:41:17Z mike $".
# End of "$Id: cupsd.conf 1631 2001-03-14 13:45:35Z mike $".
#
+3 -3
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id: mime.convs 1340 2000-09-06 13:53:00Z mike $"
# "$Id: mime.convs 1605 2001-03-02 22:34:21Z andy $"
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2000 by Easy Software Products.
# Copyright 1997-2001 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -74,5 +74,5 @@ application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
#*/* application/vnd.cups-raw 0 -
#
# End of "$Id: mime.convs 1340 2000-09-06 13:53:00Z mike $".
# End of "$Id: mime.convs 1605 2001-03-02 22:34:21Z andy $".
#
+5 -4
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id: mime.types 1544 2001-02-02 19:38:45Z mike $"
# "$Id: mime.types 1681 2001-04-19 15:42:39Z mike $"
#
# MIME types file for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2000 by Easy Software Products.
# Copyright 1997-2001 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -74,6 +74,7 @@ application/postscript ai eps ps string(0,%!) string(0,<04>%!)
application/vnd.hp-HPGL hpgl string(0,<1B>&)\
string(0,<1B>E<1B>%0B) string(0,<201B>)\
string(0,BP;) string(0,IN;) string(0,DF;) \
string(0,BPINPS;) \
(string(0,<1B>%-12345X) + \
(contains(9,512,"LANGUAGE=HPGL") \
contains(9,512,"LANGUAGE = HPGL")))
@@ -100,7 +101,7 @@ image/x-sgi-rgb rgb sgi bw icon short(0,474)
image/x-xbitmap xbm
image/x-xpixmap xpm ascii(0,1024) + string(3,"XPM")
image/x-xwindowdump xwd
image/x-sun-raster ras
image/x-sun-raster ras string(0,<59a66a95>)
#image/fpx fpx
image/x-alias pix short(8,8) short(8,24)
@@ -150,5 +151,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
#application/octet-stream
#
# End of "$Id: mime.types 1544 2001-02-02 19:38:45Z mike $".
# End of "$Id: mime.types 1681 2001-04-19 15:42:39Z mike $".
#
+3 -3
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: printers.conf 1152 2000-06-22 18:25:29Z mike $"
# "$Id: printers.conf 1605 2001-03-02 22:34:21Z andy $"
#
# Sample printer configuration file for the Common UNIX Printing System
# (CUPS) scheduler.
#
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
# Copyright 1997-2001 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
@@ -92,5 +92,5 @@
#</Printer>
#
# End of "$Id: printers.conf 1152 2000-06-22 18:25:29Z mike $".
# End of "$Id: printers.conf 1605 2001-03-02 22:34:21Z andy $".
#
+10 -3
Ver Arquivo
@@ -5,7 +5,7 @@
*
* @configure_input@
*
* Copyright 1997-2000 by Easy Software Products.
* Copyright 1997-2001 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -19,7 +19,7 @@
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636-3111 USA
*
* Voice: (301) 373-9603
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*/
@@ -28,7 +28,7 @@
* Version of software...
*/
#define CUPS_SVERSION "CUPS v1.1.6"
#define CUPS_SVERSION "CUPS v1.1.8"
/*
* Where are files stored?
@@ -93,6 +93,13 @@
#undef HAVE_CRYPT_H
/*
* Use <string.h>, <strings.h>, or both?
*/
#undef HAVE_STRING_H
#undef HAVE_STRINGS_H
/*
* Do we have the strXXX() functions?
*/
+114 -71
Ver Arquivo
@@ -39,8 +39,6 @@ dnl for them...
OPTIM=""
AC_SUBST(OPTIM)
GSOPTIM=""
AC_SUBST(GSOPTIM)
PICFLAG=1
CFLAGS="${CFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
@@ -49,7 +47,6 @@ AC_SUBST(DSOFLAGS)
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],[if eval "test x$enable_debug = xyes"; then
OPTIM="-g"
GSOPTIM="-g"
fi])
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=yes]])
AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support [default=no]])
@@ -96,6 +93,14 @@ if test "$enable_shared" != "no"; then
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -soname \$@ -shared \$(OPTIM)"
;;
AIX*)
AC_MSG_WARN(Shared library support for AIX not available yet - defaulting to static)
enable_shared=no
PICFLAG=0
LIBCUPS="libcups.a"
LIBCUPSIMAGE="libcupsimage.a"
DSO=":"
;;
*)
echo "Warning: shared libraries may not be supported. Trying -shared"
echo " option with compiler."
@@ -126,7 +131,15 @@ fi
AC_ARG_ENABLE(pam, [ --enable-pam turn on PAM support [default=yes]])
# Don't use PAM with AIX...
if test $uname = AIX; then
enable_pam=no
fi
AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
dnl Checks for programs...
AC_PROG_AWK
@@ -162,6 +175,7 @@ if test "$ac_cv_lib_c_crypt" = "no"; then
AC_CHECK_LIB(crypt,crypt)
fi
AC_CHECK_LIB(sec,getspent)
AC_CHECK_LIB(gen,getspent)
LIBMALLOC=""
AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
@@ -179,7 +193,9 @@ if test "$enable_pam" != "no"; then
AC_CHECK_LIB(dl,dlopen)
AC_CHECK_LIB(pam,pam_start)
if test "$ac_cv_lib_pam_pam_start" != "no"; then
PAMDIR="/etc/pam.d"
if test -d /etc/pam.d; then
PAMDIR="/etc/pam.d"
fi
else
PAMDIR=""
LIBS="$OLDLIBS"
@@ -283,6 +299,9 @@ AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
AC_CHECK_HEADER(stddef.h,AC_DEFINE(HAVE_STDDEF_H))
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
dnl Checks for string functions.
@@ -328,53 +347,58 @@ AC_CHECK_FUNCS(wait3)
dnl Update compiler options...
if test -n "$GCC"; then
GXX="gcc"
CXX="$CC"
if test -z "$OPTIM"; then
OPTIM="-O2"
GSOPTIM="-O1"
fi
if test $PICFLAG = 1; then
OPTIM="-fPIC $OPTIM"
GSOPTIM="-fPIC $GSOPTIM"
fi
OPTIM="-Wall $OPTIM"
GSOPTIM="-Wall $GSOPTIM"
else
case $uname in
IRIX*)
AIX*)
if test -z "$OPTIM"; then
OPTIM="-O2"
GSOPTIM="-O1"
OPTIM="-O2 -qmaxmem=6000"
fi
if test $uversion -ge 62; then
OPTIM="$OPTIM -n32 -mips3"
GSOPTIM="$GSOPTIM -n32 -mips3"
fi
OPTIM="-fullwarn $OPTIM"
GSOPTIM="-fullwarn $GSOPTIM"
;;
HP-UX*)
if test -z "$OPTIM"; then
OPTIM="+O2"
GSOPTIM="+O1"
fi
OPTIM="-Ae +DAportable $OPTIM"
GSOPTIM="-Ae +DAportable $GSOPTIM"
CFLAGS="-Ae $CFLAGS"
OPTIM="+DAportable $OPTIM"
if test $PICFLAG = 1; then
OPTIM="+z $OPTIM"
GSOPTIM="+z $GSOPTIM"
fi
;;
IRIX*)
if test -z "$OPTIM"; then
OPTIM="-O2"
fi
if test $uversion -ge 62; then
OPTIM="$OPTIM -n32 -mips3"
fi
OPTIM="-fullwarn $OPTIM"
;;
SunOS*)
# Solaris
if test -z "$OPTIM"; then
OPTIM="-xO4"
GSOPTIM="-xO2"
fi
OPTIM="$OPTIM -xarch=generic"
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
;;
UNIX_SVR*)
# UnixWare
if test -z "$OPTIM"; then
OPTIM="-O"
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
GSOPTIM="-KPIC $GSOPTIM"
fi
;;
*)
@@ -450,11 +474,6 @@ if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
sharedstatedir="/usr/com"
fi
dnl Fix "infodir" variable if it hasn't been specified...
if test "$infodir" = "\${prefix}/info" -a "$prefix" = "/"; then
infodir="/usr/info"
fi
dnl Fix "datadir" variable if it hasn't been specified...
if test "$datadir" = "\${prefix}/share"; then
if test "$prefix" = "/"; then
@@ -495,8 +514,8 @@ fi
dnl Fix "mandir" variable...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
case "$uname" in
FreeBSD* | NetBSD* | OpenBSD*)
# *BSD
FreeBSD* | NetBSD* | OpenBSD* | AIX*)
# *BSD + AIX
mandir="/usr/share/man"
AMANDIR="/usr/share/man"
;;
@@ -511,6 +530,8 @@ if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
AMANDIR="/usr/man"
;;
esac
else
AMANDIR="$mandir"
fi
AC_SUBST(AMANDIR)
@@ -558,62 +579,78 @@ AC_SUBST(CAT8EXT)
AC_SUBST(MAN8EXT)
dnl Setup init.d locations...
case "$uname" in
FreeBSD* | OpenBSD*)
# FreeBSD and OpenBSD
INITDIR=""
INITDDIR=""
;;
if test x$rcdir = x; then
case "$uname" in
FreeBSD* | OpenBSD*)
# FreeBSD and OpenBSD
INITDIR=""
INITDDIR=""
;;
NetBSD*)
# NetBSD
INITDIR=""
INITDDIR="/etc/rc.d"
;;
NetBSD*)
# NetBSD
INITDIR=""
INITDDIR="/etc/rc.d"
;;
Linux*)
# Linux seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
# SuSE
INITDIR="/sbin/init.d"
INITDDIR=".."
else
if test -d /etc/rc.d; then
# RedHat
INITDIR="/etc/rc.d"
INITDDIR="../init.d"
Linux*)
# Linux seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
# SuSE
INITDIR="/sbin/init.d"
INITDDIR=".."
else
# Others
INITDIR="/etc"
INITDDIR="../init.d"
if test -d /etc/rc.d; then
# RedHat
INITDIR="/etc/rc.d"
INITDDIR="../init.d"
else
# Others
INITDIR="/etc"
INITDDIR="../init.d"
fi
fi
fi
;;
;;
OSF1* | HP-UX*)
INITDIR="/sbin"
INITDDIR="../init.d"
;;
OSF1* | HP-UX*)
INITDIR="/sbin"
INITDDIR="../init.d"
;;
*)
INITDIR="/etc"
INITDDIR="../init.d"
;;
AIX*)
INITDIR="/etc/rc.d"
INITDDIR=".."
;;
esac
*)
INITDIR="/etc"
INITDDIR="../init.d"
;;
esac
else
INITDIR=""
INITDDIR="$rcdir"
fi
AC_SUBST(INITDIR)
AC_SUBST(INITDDIR)
dnl Setup default locations...
CUPS_SERVERROOT='${sysconfdir}/cups'
CUPS_LOGDIR='${localstatedir}/log/cups'
CUPS_REQUESTS='${localstatedir}/spool/cups'
AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
if test x$logdir = x; then
CUPS_LOGDIR='${localstatedir}/log/cups'
AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
else
CUPS_LOGDIR="$logdir"
AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$logdir")
fi
dnl See what directory to put server executables...
case "$uname" in
FreeBSD* | NetBSD* | OpenBSD*)
@@ -643,7 +680,7 @@ case "$uname" in
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$datadir/locale")
;;
OSF1*)
OSF1* | AIX*)
CUPS_LOCALEDIR='${exec_prefix}/lib/nls/msg'
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$exec_prefix/lib/nls/msg")
;;
@@ -663,8 +700,14 @@ AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
AC_SUBST(CUPS_DATADIR)
dnl Set the CUPS_DOCROOT directory...
CUPS_DOCROOT='${datadir}/doc/cups'
AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$datadir/doc/cups")
if test x$docdir = x; then
CUPS_DOCROOT='${datadir}/doc/cups'
docdir="$datadir/doc/cups"
else
CUPS_DOCROOT="$docdir"
fi
AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
AC_SUBST(CUPS_DOCROOT)
dnl Set the CUPS_FONTPATH directory...
+33 -33
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cups.list 1533 2001-01-25 16:43:15Z mike $"
# "$Id: cups.list 1735 2001-05-21 21:39:39Z mike $"
#
# ESP Package Manager (EPM) file list for the Common UNIX Printing
# System (CUPS).
@@ -29,7 +29,7 @@
%vendor Easy Software Products
%license LICENSE.txt
%readme README.txt
%version 1.1.6
%version 1.1.8
%incompat printpro
# Server programs
@@ -217,37 +217,37 @@ f 0444 root sys $DOCDIR/images doc/images/*.gif
# Man pages
%system irix
d 0555 root sys $MANDIR/a_man -
d 0555 root sys $MANDIR/a_man/cat1 -
d 0555 root sys $MANDIR/u_man -
d 0555 root sys $MANDIR/u_man/cat1 -
d 0555 root sys $MANDIR/u_man/cat5 -
d 0555 root sys $AMANDIR -
d 0555 root sys $AMANDIR/cat1 -
d 0555 root sys $MANDIR -
d 0555 root sys $MANDIR/cat1 -
d 0555 root sys $MANDIR/cat5 -
f 0444 root sys $MANDIR/a_man/cat1/accept.z man/accept.z
l 0444 root sys $MANDIR/a_man/cat1/reject.z accept.z
f 0444 root sys $MANDIR/u_man/cat1/backend.z man/backend.z
f 0444 root sys $MANDIR/u_man/cat5/classes.conf.z man/classes.conf.z
f 0444 root sys $MANDIR/a_man/cat1/cups-lpd.z man/cups-lpd.z
f 0444 root sys $MANDIR/a_man/cat1/cups-polld.z man/cups-polld.z
f 0444 root sys $MANDIR/u_man/cat5/cupsd.conf.z man/cupsd.conf.z
f 0444 root sys $MANDIR/a_man/cat1/cupsd.z man/cupsd.z
f 0444 root sys $MANDIR/a_man/cat1/enable.z man/enable.z
l 0444 root sys $MANDIR/a_man/cat1/disable.z enable.z
f 0444 root sys $MANDIR/u_man/cat1/filter.z man/filter.z
f 0444 root sys $MANDIR/a_man/cat1/lpadmin.z man/lpadmin.z
f 0444 root sys $MANDIR/a_man/cat1/lpc.z man/lpc.z
f 0444 root sys $MANDIR/a_man/cat1/lpinfo.z man/lpinfo.z
f 0444 root sys $MANDIR/a_man/cat1/lpmove.z man/lpmove.z
f 0444 root sys $MANDIR/u_man/cat1/lpoptions.z man/lpoptions.z
f 0444 root sys $MANDIR/u_man/cat1/lpq.z man/lpq.z
f 0444 root sys $MANDIR/u_man/cat1/lprm.z man/lprm.z
f 0444 root sys $MANDIR/u_man/cat1/lpr.z man/lpr.z
f 0444 root sys $MANDIR/u_man/cat1/lpstat.z man/lpstat.z
f 0444 root sys $MANDIR/u_man/cat1/lp.z man/lp.z
l 0444 root sys $MANDIR/u_man/cat1/cancel.z lp.z
f 0444 root sys $MANDIR/u_man/cat5/mime.convs.z man/mime.convs.z
f 0444 root sys $MANDIR/u_man/cat5/mime.types.z man/mime.types.z
f 0444 root sys $MANDIR/u_man/cat5/printers.conf.z man/printers.conf.z
f 0444 root sys $AMANDIR/cat1/accept.z man/accept.z
l 0444 root sys $AMANDIR/cat1/reject.z accept.z
f 0444 root sys $MANDIR/cat1/backend.z man/backend.z
f 0444 root sys $MANDIR/cat5/classes.conf.z man/classes.conf.z
f 0444 root sys $AMANDIR/cat1/cups-lpd.z man/cups-lpd.z
f 0444 root sys $AMANDIR/cat1/cups-polld.z man/cups-polld.z
f 0444 root sys $MANDIR/cat5/cupsd.conf.z man/cupsd.conf.z
f 0444 root sys $AMANDIR/cat1/cupsd.z man/cupsd.z
f 0444 root sys $AMANDIR/cat1/enable.z man/enable.z
l 0444 root sys $AMANDIR/cat1/disable.z enable.z
f 0444 root sys $MANDIR/cat1/filter.z man/filter.z
f 0444 root sys $AMANDIR/cat1/lpadmin.z man/lpadmin.z
f 0444 root sys $AMANDIR/cat1/lpc.z man/lpc.z
f 0444 root sys $AMANDIR/cat1/lpinfo.z man/lpinfo.z
f 0444 root sys $AMANDIR/cat1/lpmove.z man/lpmove.z
f 0444 root sys $MANDIR/cat1/lpoptions.z man/lpoptions.z
f 0444 root sys $MANDIR/cat1/lpq.z man/lpq.z
f 0444 root sys $MANDIR/cat1/lprm.z man/lprm.z
f 0444 root sys $MANDIR/cat1/lpr.z man/lpr.z
f 0444 root sys $MANDIR/cat1/lpstat.z man/lpstat.z
f 0444 root sys $MANDIR/cat1/lp.z man/lp.z
l 0444 root sys $MANDIR/cat1/cancel.z lp.z
f 0444 root sys $MANDIR/cat5/mime.convs.z man/mime.convs.z
f 0444 root sys $MANDIR/cat5/mime.types.z man/mime.types.z
f 0444 root sys $MANDIR/cat5/printers.conf.z man/printers.conf.z
%system solaris hpux
d 0555 root sys $MANDIR/man1 -
@@ -316,5 +316,5 @@ f 0444 root sys $MANDIR/man5/printers.conf.5 man/printers.conf.man
i 0555 root sys cups cups.sh
#
# End of "$Id: cups.list 1533 2001-01-25 16:43:15Z mike $".
# End of "$Id: cups.list 1735 2001-05-21 21:39:39Z mike $".
#
+11 -11
Ver Arquivo
@@ -28,7 +28,7 @@
#
# Linux chkconfig stuff:
#
# chkconfig: 0235 99 00
# chkconfig: 235 99 00
# description: Startup/shutdown script for the Common UNIX \
# Printing System (CUPS).
#
@@ -76,9 +76,13 @@ fi
#
case "`uname`" in
IRIX* | HP-UX* | SunOS*)
IRIX* | HP-UX* | SunOS* | AIX* | SINIX*)
pid=`ps -e | awk '{print $1,$4}' | grep cupsd | awk '{print $1}'`
;;
UnixWare*)
pid=`ps -e | awk '{print $1,$6}' | grep cupsd | awk '{print $1}'`
. /etc/TIMEZONE
;;
OSF1*)
pid=`ps -e | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
;;
@@ -96,21 +100,17 @@ esac
case $1 in
start | restart | reload)
if test "$pid" != ""; then
if $IS_ON cups; then
if $IS_ON cups; then
if test "$pid" != ""; then
kill -HUP $pid
$ECHO "cups: scheduler restarted."
else
kill $pid
$ECHO "cups: scheduler stopped."
fi
else
if $IS_ON cups; then
prefix=@prefix@
exec_prefix=@exec_prefix@
@sbindir@/cupsd
$ECHO "cups: scheduler started."
fi
$ECHO "cups: scheduler ${1}ed."
else
$ECHO "cups: scheduler stopped."
fi
;;
+64 -23
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cups.spec 1533 2001-01-25 16:43:15Z mike $"
# "$Id: cups.spec 1735 2001-05-21 21:39:39Z mike $"
#
# RPM "spec" file for the Common UNIX Printing System (CUPS).
#
@@ -26,8 +26,8 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.1.6
Release: 0
Version: 1.1.8
Release: 1
Copyright: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.gz
@@ -36,12 +36,20 @@ Packager: Michael Sweet <mike@easysw.com>
Vendor: Easy Software Products
# use buildroot so as not to disturb the version already installed
BuildRoot: /var/tmp/%{name}-root
Conflicts: lpr
Conflicts: lpr, LPRng
Provides: libcups.so.2
Provides: libcupsimage.so.2
Provides: cupsd
%package devel
Summary: Common Unix Printing System - development environment
Group: Development/Libraries
%package pstoraster
Summary: Common Unix Printing System - PostScript RIP
Group: System Environment/Daemons
Provides: pstoraster
%description
The Common UNIX Printing System provides a portable printing layer for
UNIX® operating systems. It has been developed by Easy Software Products
@@ -53,6 +61,11 @@ The Common UNIX Printing System provides a portable printing layer for
UNIX® operating systems. This is the development package for creating
additional printer drivers, and other CUPS services.
%description devel
The Common UNIX Printing System provides a portable printing layer for
UNIX® operating systems. This is the PostScript RIP package for
supporting non-PostScript printer drivers.
%prep
%setup
@@ -63,21 +76,18 @@ additional printer drivers, and other CUPS services.
make
%install
# these lines just make sure the directory structure in the
# RPM_BUILD_ROOT exists
# Make sure the RPM_BUILD_ROOT directory exists.
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc0.d
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc3.d
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc5.d
make prefix=$RPM_BUILD_ROOT \
exec_prefix=$RPM_BUILD_ROOT/usr \
AMANDIR=$RPM_BUILD_ROOT/usr/man \
BINDIR=$RPM_BUILD_ROOT/usr/bin \
DATADIR=$RPM_BUILD_ROOT/usr/share/cups \
DOCDIR=$RPM_BUILD_ROOT/usr/share/doc/cups \
INCLUDEDIR=$RPM_BUILD_ROOT/usr/include \
LIBDIR=$RPM_BUILD_ROOT/usr/lib \
LOGDIR=$RPM_BUILD_ROOT/var/log/cups \
LOCALEDIR=$RPM_BUILD_ROOT/usr/share/locale \
MANDIR=$RPM_BUILD_ROOT/usr/man \
PAMDIR=$RPM_BUILD_ROOT/etc/pam.d \
@@ -93,15 +103,17 @@ if test -x /sbin/chkconfig; then
/sbin/chkconfig cups on
fi
if test -f /sbin/init.d/cups; then
/sbin/init.d/cups start
fi
if test -f /etc/rc.d/init.d/cups; then
/etc/rc.d/init.d/cups start
fi
if test -f /etc/init.d/cups; then
/etc/init.d/cups start
fi
# these lines automatically start cupsd after installation; commented out
# by request...
#if test -f /sbin/init.d/cups; then
# /sbin/init.d/cups start
#fi
#if test -f /etc/rc.d/init.d/cups; then
# /etc/rc.d/init.d/cups start
#fi
#if test -f /etc/init.d/cups; then
# /etc/init.d/cups start
#fi
%preun
if test -f /sbin/init.d/cups; then
@@ -124,7 +136,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir /etc/cups
%config /etc/cups/*.conf
%config(noreplace) /etc/cups/*.conf
%dir /etc/cups/certs
%dir /etc/cups/interfaces
/etc/cups/mime.types
@@ -154,11 +166,32 @@ rm -rf $RPM_BUILD_ROOT
/usr/bin/*
/usr/lib/*.so*
%dir /usr/lib/cups
/usr/lib/cups/*
%dir /usr/lib/cups/backend
/usr/lib/cups/backend/*
%dir /usr/lib/cups/cgi-bin
/usr/lib/cups/cgi-bin/*
%dir /usr/lib/cups/filter
/usr/lib/cups/filter/hpgltops
/usr/lib/cups/filter/imagetops
/usr/lib/cups/filter/imagetoraster
/usr/lib/cups/filter/pdftops
/usr/lib/cups/filter/pstops
/usr/lib/cups/filter/rastertoepson
/usr/lib/cups/filter/rastertohp
/usr/lib/cups/filter/texttops
/usr/man/*
/usr/sbin/*
%dir /usr/share/cups
/usr/share/cups/*
%dir /usr/share/cups/banners
/usr/share/cups/banners/*
%dir /usr/share/cups/charsets
/usr/share/cups/charsets/*
%dir /usr/share/cups/data
/usr/share/cups/data/*
%dir /usr/share/cups/model
/usr/share/cups/model/*
%dir /usr/share/cups/templates
/usr/share/cups/templates/*
%dir /usr/share/doc/cups
/usr/share/doc/cups/*
%dir /usr/share/locale
@@ -171,6 +204,14 @@ rm -rf $RPM_BUILD_ROOT
/usr/include/cups/*
/usr/lib/*.a
%files pstoraster
%dir /usr/lib/cups/filter
/usr/lib/cups/filter/pstoraster
%dir /usr/share/cups/fonts
/usr/share/cups/fonts/*
%dir /usr/share/cups/pstoraster
/usr/share/cups/pstoraster/*
#
# End of "$Id: cups.spec 1533 2001-01-25 16:43:15Z mike $".
# End of "$Id: cups.spec 1735 2001-05-21 21:39:39Z mike $".
#
+6 -3
Ver Arquivo
@@ -28,8 +28,9 @@ include ../Makedefs
# Object files...
#
LIBOBJS = dest.o emit.o http.o ipp.o language.o mark.o md5.o md5passwd.o \
options.o page.o ppd.o snprintf.o string.o usersys.o util.o
LIBOBJS = dest.o emit.o encode.o http.o ipp.o language.o mark.o md5.o \
md5passwd.o options.o page.o ppd.o snprintf.o string.o \
tempfile.o usersys.o util.o
OBJS = $(LIBOBJS) testhttp.o testppd.o
@@ -99,7 +100,7 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS) ../Makedefs
libcups.la: $(LIBOBJS) ../Makedefs
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:1 $(SSLLIBS)
-version-info 2:3 $(SSLLIBS)
#
@@ -124,6 +125,7 @@ cups_C.h: ../locale/C/cups_C
dest.o: cups.h http.h ipp.h language.h string.h
emit.o: ppd.h
encode.o: cups.h ipp.h string.h
http.o: http.h ipp.h md5.h string.h
ipp.o: http.h ipp.h string.h language.h
language.o: cups_C.h language.h string.h
@@ -134,6 +136,7 @@ page.o: ppd.h
ppd.o: language.h ppd.h
snprintf.o: string.h
string.o: string.h
tempfile.o: cups.h string.h
usersys.o: cups.h
util.o: cups.h http.h ipp.h
+19 -1
Ver Arquivo
@@ -94,7 +94,22 @@ typedef struct /**** Destination ****/
cups_option_t *options; /* Options */
} cups_dest_t;
typedef struct /**** Job ****/
{
int id; /* The job ID */
char *dest, /* Printer or class name */
*title, /* Title/job name */
*user, /* User the submitted the job */
*format; /* Document format */
ipp_jstate_t state; /* Job state */
int size, /* Size in kilobytes */
priority; /* Priority (1-100) */
time_t completed_time, /* Time the job was completed */
creation_time, /* Time the job was created */
processing_time; /* Time the job was processed */
} cups_job_t;
/*
* Functions...
*/
@@ -104,8 +119,11 @@ extern int cupsCancelJob(const char *printer, int job);
extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
const char *resource, const char *filename);
extern http_encryption_t cupsEncryption(void);
extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
extern int cupsGetClasses(char ***classes);
extern const char *cupsGetDefault(void);
extern int cupsGetJobs(cups_job_t **jobs, const char *dest,
int myjobs, int completed);
extern const char *cupsGetPPD(const char *printer);
extern int cupsGetPrinters(char ***printers);
extern ipp_status_t cupsLastError(void);
+28 -3
Ver Arquivo
@@ -210,6 +210,9 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
cups_dest_t *dest; /* Destination pointer */
const char *home; /* HOME environment variable */
char filename[1024]; /* Local ~/.lpoptions file */
const char *defprinter; /* Default printer */
char name[1024], /* Copy of printer name */
*instance; /* Pointer to instance name */
/*
@@ -253,8 +256,25 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
* Grab the default destination...
*/
if ((dest = cupsGetDest(cupsGetDefault(), NULL, num_dests, *dests)) != NULL)
dest->is_default = 1;
if ((defprinter = cupsGetDefault()) != NULL)
{
/*
* Grab printer and instance name...
*/
strncpy(name, defprinter, sizeof(name) - 1);
name[sizeof(name) - 1] = '\0';
if ((instance = strchr(name, '/')) != NULL)
*instance++ = '\0';
/*
* Lookup the printer and instance and make it the default...
*/
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
dest->is_default = 1;
}
/*
* Load the /etc/cups/lpoptions and ~/.lpoptions files...
@@ -345,7 +365,12 @@ cupsSetDests(int num_dests, /* I - Number of destinations */
for (j = dest->num_options, option = dest->options; j > 0; j --, option ++)
if (option->value[0])
fprintf(fp, " %s=%s", option->name, option->value);
{
if (strchr(option->value, ' ') != NULL)
fprintf(fp, " %s=\"%s\"", option->name, option->value);
else
fprintf(fp, " %s=%s", option->name, option->value);
}
else
fprintf(fp, " %s", option->name);
+89
Ver Arquivo
@@ -28,6 +28,7 @@
* ppdCollect() - Collect all marked options that reside in the specified
* ppdEmit() - Emit code for marked options to a file.
* ppdEmitFd() - Emit code for marked options to a file.
* ppdEmitJCL() - Emit code for JCL options to a file.
* ppd_sort() - Sort options by ordering numbers...
*/
@@ -314,6 +315,94 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
}
/*
* 'ppdEmitJCL()' - Emit code for JCL options to a file.
*/
int /* O - 0 on success, -1 on failure */
ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
FILE *fp, /* I - File to write to */
int job_id, /* I - Job ID */
const char *user, /* I - Username */
const char *title) /* I - Title */
{
const char *ptr; /* Pointer into JCL string */
/*
* Range check the input...
*/
if (ppd == NULL || ppd->jcl_begin == NULL || ppd->jcl_ps == NULL)
return (0);
/*
* See if the printer supports HP PJL...
*/
if (strncmp(ppd->jcl_begin, "\033%-12345X@", 10) == 0)
{
/*
* This printer uses HP PJL commands for output; filter the output
* so that we only have a single "@PJL JOB" command in the header...
*/
fputs("\033%-12345X", fp);
for (ptr = ppd->jcl_begin + 9; *ptr;)
if (strncmp(ptr, "@PJL JOB", 8) == 0)
{
/*
* Skip job command...
*/
for (;*ptr; ptr ++)
if (*ptr == '\n')
break;
if (*ptr)
ptr ++;
}
else
{
/*
* Copy line...
*/
for (;*ptr; ptr ++)
{
putc(*ptr, fp);
if (*ptr == '\n')
break;
}
if (*ptr)
ptr ++;
}
/*
* Eliminate any path info from the job title...
*/
if ((ptr = strrchr(title, '/')) != NULL)
title = ptr + 1;
/*
* Send PJL JOB command before we enter PostScript mode...
*/
fprintf(fp, "@PJL JOB NAME = \"%s\" DISPLAY = \"%d %s %s\"\n", title,
job_id, user, title);
}
else
fputs(ppd->jcl_begin, stdout);
ppdEmit(ppd, stdout, PPD_ORDER_JCL);
fputs(ppd->jcl_ps, stdout);
return (0);
}
/*
* 'ppd_sort()' - Sort options by ordering numbers...
*/
+311
Ver Arquivo
@@ -0,0 +1,311 @@
/*
* "$Id$"
*
* Option encoding routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 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-3111 USA
*
* Voice: (301) 373-9603
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
* Contents:
*
* cupsEncodeOptions() - Encode printer options into IPP attributes.
*/
/*
* Include necessary headers...
*/
#include "cups.h"
#include <stdlib.h>
#include <ctype.h>
#include "string.h"
#include "debug.h"
/*
* 'cupsEncodeOptions()' - Encode printer options into IPP attributes.
*/
void
cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
int num_options, /* I - Number of options */
cups_option_t *options) /* I - Options */
{
int i, j; /* Looping vars */
int count; /* Number of values */
int n; /* Attribute value */
char *s, /* Pointer into option value */
*val, /* Pointer to option value */
*copy, /* Copy of option value */
*sep; /* Option separator */
ipp_attribute_t *attr; /* IPP job-id attribute */
DEBUG_printf(("cupsEncodeOptions(%p, %d, %p)\n", ipp, num_options, options));
if (ipp == NULL || num_options < 1 || options == NULL)
return;
/*
* Handle the document format stuff first...
*/
if ((val = (char *)cupsGetOption("document-format", num_options, options)) != NULL)
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, val);
else if (cupsGetOption("raw", num_options, options))
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/vnd.cups-raw");
else
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/octet-stream");
/*
* Then add all other options...
*/
for (i = 0; i < num_options; i ++)
{
/*
* Skip document format options - handled above...
*/
if (strcasecmp(options[i].name, "raw") == 0 ||
strcasecmp(options[i].name, "document-format") == 0 ||
!options[i].name[0])
continue;
/*
* Count the number of values...
*/
for (count = 1, sep = options[i].value;
(sep = strchr(sep + 1, ',')) != NULL;
count ++);
DEBUG_printf(("cupsEncodeOptions: option = \'%s\', count = %d\n",
options[i].name, count));
if ((attr = _ipp_add_attr(ipp, count)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for attributes!");
return;
}
attr->group_tag = IPP_TAG_JOB;
if ((attr->name = strdup(options[i].name)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for name!");
return;
}
if (count > 1)
{
/*
* Make a copy of the value we can fiddle with...
*/
if ((copy = strdup(options[i].value)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for value copy!");
return;
}
val = copy;
}
else
{
/*
* Since we have a single value, use the value directly...
*/
val = options[i].value;
copy = NULL;
}
/*
* See what the option value is; for compatibility with older interface
* scripts, we have to support single-argument options as well as
* option=value, option=low-high, option=MxN, and option=val1,val2,...,valN.
*/
if (*val == '\0')
{
/*
* Old-style System V boolean value...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
if (strncasecmp(attr->name, "no", 2) == 0)
{
DEBUG_puts("cupsEncodeOptions: Added boolean false value...");
strcpy(attr->name, attr->name + 2);
attr->values[0].boolean = 0;
}
else
{
DEBUG_puts("cupsEncodeOptions: Added boolean true value...");
attr->values[0].boolean = 1;
}
}
else
{
/*
* Scan the value string for values...
*/
for (j = 0; *val != '\0'; val = sep, j ++)
{
/*
* Find the end of this value and mark it if needed...
*/
if ((sep = strchr(val, ',')) != NULL)
*sep++ = '\0';
else
sep = val + strlen(val);
/*
* See what kind of value it is...
*/
if (strcasecmp(val, "true") == 0 ||
strcasecmp(val, "on") == 0 ||
strcasecmp(val, "yes") == 0)
{
/*
* Boolean value - true...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
attr->values[j].boolean = 1;
DEBUG_puts("cupsEncodeOptions: Added boolean true value...");
}
else if (strcasecmp(val, "false") == 0 ||
strcasecmp(val, "off") == 0 ||
strcasecmp(val, "no") == 0)
{
/*
* Boolean value - false...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
attr->values[j].boolean = 0;
DEBUG_puts("cupsEncodeOptions: Added boolean false value...");
}
else
{
/*
* Number, range, resolution, or string...
*/
n = strtol(val, &s, 0);
if (*s != '\0' && *s != '-' && (*s != 'x' || s == val))
{
/*
* String value(s)...
*/
if ((attr->values[j].string.text = strdup(val)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for string!");
return;
}
attr->value_tag = IPP_TAG_NAME;
DEBUG_printf(("cupsEncodeOptions: Added string value \'%s\'...\n", val));
}
else if (*s == '-')
{
attr->value_tag = IPP_TAG_RANGE;
attr->values[j].range.lower = n;
attr->values[j].range.upper = strtol(s + 1, NULL, 0);
DEBUG_printf(("cupsEncodeOptions: Added range option value %d-%d...\n",
n, attr->values[j].range.upper));
}
else if (*s == 'x')
{
attr->value_tag = IPP_TAG_RESOLUTION;
attr->values[j].resolution.xres = n;
attr->values[j].resolution.yres = strtol(s + 1, &s, 0);
if (strcasecmp(s, "dpc") == 0)
attr->values[j].resolution.units = IPP_RES_PER_CM;
else if (strcasecmp(s, "dpi") == 0)
attr->values[j].resolution.units = IPP_RES_PER_INCH;
else
{
if ((attr->values[j].string.text = strdup(val)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for string!");
return;
}
attr->value_tag = IPP_TAG_NAME;
DEBUG_printf(("cupsEncodeOptions: Added string value \'%s\'...\n", val));
continue;
}
DEBUG_printf(("cupsEncodeOptions: Adding resolution option value %s...\n",
val));
}
else
{
attr->value_tag = IPP_TAG_INTEGER;
attr->values[j].integer = n;
DEBUG_printf(("cupsEncodeOptions: Adding integer option value %d...\n", n));
}
}
}
}
}
}
/*
* End of "$Id$".
*/
+77 -41
Ver Arquivo
@@ -23,41 +23,42 @@
*
* Contents:
*
* httpInitialize() - Initialize the HTTP interface library and set the
* default HTTP proxy (if any).
* httpCheck() - Check to see if there is a pending response from
* the server.
* httpClose() - Close an HTTP connection...
* httpConnect() - Connect to a HTTP server.
* httpEncryption() - Set the required encryption on the link.
* httpReconnect() - Reconnect to a HTTP server...
* httpSeparate() - Separate a Universal Resource Identifier into its
* components.
* httpSetField() - Set the value of an HTTP header.
* httpDelete() - Send a DELETE request to the server.
* httpGet() - Send a GET request to the server.
* httpHead() - Send a HEAD request to the server.
* httpOptions() - Send an OPTIONS request to the server.
* httpPost() - Send a POST request to the server.
* httpPut() - Send a PUT request to the server.
* httpTrace() - Send an TRACE request to the server.
* httpFlush() - Flush data from a HTTP connection.
* httpRead() - Read data from a HTTP connection.
* httpWrite() - Write data to a HTTP connection.
* httpGets() - Get a line of text from a HTTP connection.
* httpPrintf() - Print a formatted string to a HTTP connection.
* httpStatus() - Return a short string describing a HTTP status code.
* httpGetDateString() - Get a formatted date/time string from a time value.
* httpGetDateTime() - Get a time value from a formatted date/time string.
* httpUpdate() - Update the current HTTP state for incoming data.
* httpDecode64() - Base64-decode a string.
* httpEncode64() - Base64-encode a string.
* httpGetLength() - Get the amount of data remaining from the
* content-length or transfer-encoding fields.
* http_field() - Return the field index for a field name.
* http_send() - Send a request with all fields and the trailing
* blank line.
* http_upgrade() - Force upgrade to TLS encryption.
* httpInitialize() - Initialize the HTTP interface library and set the
* default HTTP proxy (if any).
* httpCheck() - Check to see if there is a pending response from
* the server.
* httpClose() - Close an HTTP connection...
* httpConnect() - Connect to a HTTP server.
* httpConnectEncrypt() - Connect to a HTTP server using encryption.
* httpEncryption() - Set the required encryption on the link.
* httpReconnect() - Reconnect to a HTTP server...
* httpSeparate() - Separate a Universal Resource Identifier into its
* components.
* httpSetField() - Set the value of an HTTP header.
* httpDelete() - Send a DELETE request to the server.
* httpGet() - Send a GET request to the server.
* httpHead() - Send a HEAD request to the server.
* httpOptions() - Send an OPTIONS request to the server.
* httpPost() - Send a POST request to the server.
* httpPut() - Send a PUT request to the server.
* httpTrace() - Send an TRACE request to the server.
* httpFlush() - Flush data from a HTTP connection.
* httpRead() - Read data from a HTTP connection.
* httpWrite() - Write data to a HTTP connection.
* httpGets() - Get a line of text from a HTTP connection.
* httpPrintf() - Print a formatted string to a HTTP connection.
* httpStatus() - Return a short string describing a HTTP status code.
* httpGetDateString() - Get a formatted date/time string from a time value.
* httpGetDateTime() - Get a time value from a formatted date/time string.
* httpUpdate() - Update the current HTTP state for incoming data.
* httpDecode64() - Base64-decode a string.
* httpEncode64() - Base64-encode a string.
* httpGetLength() - Get the amount of data remaining from the
* content-length or transfer-encoding fields.
* http_field() - Return the field index for a field name.
* http_send() - Send a request with all fields and the trailing
* blank line.
* http_upgrade() - Force upgrade to TLS encryption.
*/
/*
@@ -310,6 +311,32 @@ httpClose(http_t *http) /* I - Connection to close */
http_t * /* O - New HTTP connection */
httpConnect(const char *host, /* I - Host to connect to */
int port) /* I - Port number */
{
http_encryption_t encrypt;/* Type of encryption to use */
/*
* Set the default encryption status...
*/
if (port == 443)
encrypt = HTTP_ENCRYPT_ALWAYS;
else
encrypt = HTTP_ENCRYPT_IF_REQUESTED;
return (httpConnectEncrypt(host, port, encrypt));
}
/*
* 'httpConnectEncrypt()' - Connect to a HTTP server using encryption.
*/
http_t * /* O - New HTTP connection */
httpConnectEncrypt(const char *host, /* I - Host to connect to */
int port, /* I - Port number */
http_encryption_t encrypt)
/* I - Type of encryption to use */
{
http_t *http; /* New HTTP connection */
struct hostent *hostaddr; /* Host address data */
@@ -325,7 +352,17 @@ httpConnect(const char *host, /* I - Host to connect to */
*/
if ((hostaddr = gethostbyname(host)) == NULL)
return (NULL);
{
/*
* This hack to make users that don't have a localhost entry in
* their hosts file or DNS happy...
*/
if (strcasecmp(host, "localhost") != 0)
return (NULL);
else if ((hostaddr = gethostbyname("127.0.0.1")) == NULL)
return (NULL);
}
/*
* Verify that it is an IPv4 address (IPv6 support will come in CUPS 1.2...)
@@ -361,11 +398,10 @@ httpConnect(const char *host, /* I - Host to connect to */
#endif /* WIN32 */
/*
* Set the default encryption status...
* Set the encryption status...
*/
if (port == 443)
http->encryption = HTTP_ENCRYPT_ALWAYS;
http->encryption = encrypt;
/*
* Connect to the remote system...
@@ -780,7 +816,7 @@ httpGetSubField(http_t *http, /* I - HTTP data */
* Skip leading whitespace...
*/
while (isspace(*fptr));
while (isspace(*fptr))
fptr ++;
if (*fptr == ',')
@@ -815,7 +851,7 @@ httpGetSubField(http_t *http, /* I - HTTP data */
fptr ++;
while (isspace(*fptr));
while (isspace(*fptr))
fptr ++;
if (*fptr == '\"')
+2
Ver Arquivo
@@ -290,6 +290,8 @@ extern int httpCheck(http_t *http);
httpSetField((http), HTTP_FIELD_HOST, (http)->hostname)
extern void httpClose(http_t *http);
extern http_t *httpConnect(const char *host, int port);
extern http_t *httpConnectEncrypt(const char *host, int port,
http_encryption_t encrypt);
extern int httpDelete(http_t *http, const char *uri);
extern int httpEncryption(http_t *http, http_encryption_t e);
# define httpError(http) ((http)->error)
+144 -94
Ver Arquivo
@@ -24,32 +24,35 @@
*
* Contents:
*
* ippAddBoolean() - Add a boolean attribute to an IPP request.
* ippAddBooleans() - Add an array of boolean values.
* ippAddDate() - Add a date attribute to an IPP request.
* ippAddInteger() - Add a integer attribute to an IPP request.
* ippAddIntegers() - Add an array of integer values.
* ippAddString() - Add a language-encoded string to an IPP request.
* ippAddStrings() - Add language-encoded strings to an IPP request.
* ippAddRange() - Add a range of values to an IPP request.
* ippAddRanges() - Add ranges of values to an IPP request.
* ippAddResolution() - Add a resolution value to an IPP request.
* ippAddResolutions() - Add resolution values to an IPP request.
* ippAddSeparator() - Add a group separator to an IPP request.
* ippDateToTime() - Convert from RFC 1903 Date/Time format to UNIX time
* ippDelete() - Delete an IPP request.
* ippErrorString() - Return a textual message for the given error message.
* ippFindAttribute() - Find a named attribute in a request...
* ippLength() - Compute the length of an IPP request.
* ippNew() - Allocate a new IPP request.
* ippPort() - Return the default IPP port number.
* ippRead() - Read data for an IPP request.
* ippSetPort() - Set the default port number.
* ippTimeToDate() - Convert from UNIX time to RFC 1903 format.
* ippWrite() - Write data for an IPP request.
* _ipp_add_attr() - Add a new attribute to the request.
* _ipp_free_attr() - Free an attribute.
* ipp_read() - Semi-blocking read on a HTTP connection...
* ippAddBoolean() - Add a boolean attribute to an IPP request.
* ippAddBooleans() - Add an array of boolean values.
* ippAddDate() - Add a date attribute to an IPP request.
* ippAddInteger() - Add a integer attribute to an IPP request.
* ippAddIntegers() - Add an array of integer values.
* ippAddString() - Add a language-encoded string to an IPP request.
* ippAddStrings() - Add language-encoded strings to an IPP request.
* ippAddRange() - Add a range of values to an IPP request.
* ippAddRanges() - Add ranges of values to an IPP request.
* ippAddResolution() - Add a resolution value to an IPP request.
* ippAddResolutions() - Add resolution values to an IPP request.
* ippAddSeparator() - Add a group separator to an IPP request.
* ippDateToTime() - Convert from RFC 1903 Date/Time format to UNIX
* time in seconds.
* ippDelete() - Delete an IPP request.
* ippErrorString() - Return a textual message for the given error
* message.
* ippFindAttribute() - Find a named attribute in a request...
* ippFindNextAttribute() - Find the next named attribute in a request...
* ippLength() - Compute the length of an IPP request.
* ippNew() - Allocate a new IPP request.
* ippPort() - Return the default IPP port number.
* ippRead() - Read data for an IPP request.
* ippSetPort() - Set the default port number.
* ippTimeToDate() - Convert from UNIX time to RFC 1903 format.
* ippWrite() - Write data for an IPP request.
* _ipp_add_attr() - Add a new attribute to the request.
* _ipp_free_attr() - Free an attribute.
* ipp_read() - Semi-blocking read on a HTTP connection...
*/
/*
@@ -498,7 +501,7 @@ ippAddSeparator(ipp_t *ipp) /* I - IPP request */
/*
* 'ippDateToTime()' - Convert from RFC 1903 Date/Time format to UNIX time
* in seconds.
* in seconds.
*/
time_t /* O - UNIX time value */
@@ -578,75 +581,80 @@ ippDelete(ipp_t *ipp) /* I - IPP request */
const char * /* O - Text string */
ippErrorString(ipp_status_t error) /* I - Error status */
{
static cups_lang_t *language = 0; /* Language info */
static char unknown[255]; /* Unknown error statuses */
static const char *status_oks[] = /* "OK" status codes */
{
"successful-ok",
"successful-ok-ignored-or-substituted-attributes",
"successful-ok-conflicting-attributes",
"successful-ok-ignored-subscriptions",
"successful-ok-ignored-notifications",
"successful-ok-too-many-events",
"successful-ok-but-cancel-subscription"
},
*status_400s[] = /* Client errors */
{
"client-error-bad-request",
"client-error-forbidden",
"client-error-not-authenticated",
"client-error-not-authorized",
"client-error-not-possible",
"client-error-timeout",
"client-error-not-found",
"client-error-gone",
"client-error-request-entity-too-large",
"client-error-request-value-too-long",
"client-error-document-format-not-supported",
"client-error-attributes-or-values-not-supported",
"client-error-uri-scheme-not-supported",
"client-error-charset-not-supported",
"client-error-conflicting-attributes",
"client-error-compression-not-supported",
"client-error-compression-error",
"client-error-document-format-error",
"client-error-document-access-error",
"client-error-attributes-not-settable",
"client-error-ignored-all-subscriptions",
"client-error-too-many-subscriptions",
"client-error-ignored-all-notifications",
"client-error-print-support-file-not-found"
},
*status_500s[] = /* Server errors */
{
"server-error-internal-error",
"server-error-operation-not-supported",
"server-error-service-unavailable",
"server-error-version-not-supported",
"server-error-device-error",
"server-error-temporary-error",
"server-error-not-accepting-jobs",
"server-error-busy",
"server-error-job-canceled",
"server-error-multiple-document-jobs-not-supported",
"server-error-printer-is-deactivated"
};
/*
* Load the localized message file as needed...
* See if the error code is a known value...
*/
if (!language)
language = cupsLangDefault();
if (error >= IPP_OK && error <= IPP_OK_BUT_CANCEL_SUBSCRIPTION)
return (status_oks[error]);
else if (error == IPP_REDIRECTION_OTHER_SITE)
return ("redirection-other-site");
else if (error >= IPP_BAD_REQUEST && error <= IPP_PRINT_SUPPORT_FILE_NOT_FOUND)
return (status_400s[error - IPP_BAD_REQUEST]);
else if (error >= IPP_INTERNAL_ERROR && error <= IPP_PRINTER_IS_DEACTIVATED)
return (status_500s[error - IPP_INTERNAL_ERROR]);
/*
* Return the appropriate message...
* No, build an "unknown-xxxx" error string...
*/
switch (error)
{
case IPP_OK :
case IPP_OK_SUBST :
case IPP_OK_CONFLICT :
return ("OK");
case IPP_BAD_REQUEST :
return (cupsLangString(language, HTTP_BAD_REQUEST));
case IPP_FORBIDDEN :
return (cupsLangString(language, HTTP_FORBIDDEN));
case IPP_NOT_AUTHENTICATED :
case IPP_NOT_AUTHORIZED :
return (cupsLangString(language, HTTP_UNAUTHORIZED));
case IPP_NOT_POSSIBLE :
return (cupsLangString(language, HTTP_METHOD_NOT_ALLOWED));
case IPP_TIMEOUT :
return (cupsLangString(language, HTTP_REQUEST_TIMEOUT));
case IPP_NOT_FOUND :
return (cupsLangString(language, HTTP_NOT_FOUND));
case IPP_GONE :
return (cupsLangString(language, HTTP_GONE));
case IPP_DOCUMENT_FORMAT :
return (cupsLangString(language, HTTP_UNSUPPORTED_MEDIATYPE));
case IPP_CONFLICT :
return (cupsLangString(language, HTTP_CONFLICT));
case IPP_INTERNAL_ERROR :
return (cupsLangString(language, HTTP_SERVER_ERROR));
case IPP_OPERATION_NOT_SUPPORTED :
case IPP_VERSION_NOT_SUPPORTED :
return (cupsLangString(language, HTTP_NOT_SUPPORTED));
case IPP_SERVICE_UNAVAILABLE :
case IPP_DEVICE_ERROR :
case IPP_TEMPORARY_ERROR :
case IPP_PRINTER_BUSY :
return (cupsLangString(language, HTTP_SERVICE_UNAVAILABLE));
case IPP_NOT_ACCEPTING :
return (cupsLangString(language, CUPS_MSG_NOT_ACCEPTING_JOBS));
default :
return ("ERROR");
}
sprintf(unknown, "unknown-%04x", error);
return (unknown);
}
@@ -659,29 +667,68 @@ ippFindAttribute(ipp_t *ipp, /* I - IPP request */
const char *name, /* I - Name of attribute */
ipp_tag_t type) /* I - Type of attribute */
{
ipp_attribute_t *attr; /* Current atttribute */
ipp_tag_t value_tag; /* Value tag */
DEBUG_printf(("ippFindAttribute(%p, \'%s\')\n", ipp, name));
if (ipp == NULL || name == NULL)
return (NULL);
for (attr = ipp->attrs; attr != NULL; attr = attr->next)
/*
* Reset the current pointer...
*/
ipp->current = NULL;
/*
* Search for the attribute...
*/
return (ippFindNextAttribute(ipp, name, type));
}
/*
* 'ippFindNextAttribute()' - Find the next named attribute in a request...
*/
ipp_attribute_t * /* O - Matching attribute */
ippFindNextAttribute(ipp_t *ipp, /* I - IPP request */
const char *name, /* I - Name of attribute */
ipp_tag_t type) /* I - Type of attribute */
{
ipp_attribute_t *attr; /* Current atttribute */
ipp_tag_t value_tag; /* Value tag */
DEBUG_printf(("ippFindNextAttribute(%p, \'%s\')\n", ipp, name));
if (ipp == NULL || name == NULL)
return (NULL);
if (ipp->current)
attr = ipp->current->next;
else
attr = ipp->attrs;
for (; attr != NULL; attr = attr->next)
{
DEBUG_printf(("ippFindAttribute: attr = %p, name = \'%s\'\n", attr,
attr->name));
value_tag = attr->value_tag & ~IPP_TAG_COPY;
value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_MASK);
if (attr->name != NULL && strcasecmp(attr->name, name) == 0 &&
(value_tag == type || type == IPP_TAG_ZERO ||
(value_tag == IPP_TAG_TEXTLANG && type == IPP_TAG_TEXT) ||
(value_tag == IPP_TAG_NAMELANG && type == IPP_TAG_NAME)))
{
ipp->current = attr;
return (attr);
}
}
ipp->current = NULL;
return (NULL);
}
@@ -1849,7 +1896,7 @@ ipp_read(http_t *http, /* I - Client connection */
* Loop until all bytes are read...
*/
for (tbytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
for (tbytes = 0, bytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) <= 0)
break;
@@ -1857,7 +1904,10 @@ ipp_read(http_t *http, /* I - Client connection */
* Return the number of bytes read...
*/
return (tbytes);
if (tbytes == 0 && bytes < 0)
return (-1);
else
return (tbytes);
}
+81 -11
Ver Arquivo
@@ -76,13 +76,15 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_END,
IPP_TAG_PRINTER,
IPP_TAG_UNSUPPORTED_GROUP,
IPP_TAG_SUBSCRIPTION,
IPP_TAG_EVENT_NOTIFICATION,
IPP_TAG_UNSUPPORTED_VALUE = 0x10,
IPP_TAG_DEFAULT,
IPP_TAG_UNKNOWN,
IPP_TAG_NOVALUE,
IPP_TAG_NOTSETTABLE = 0x15,
IPP_TAG_DELETEATTR,
IPP_TAG_ANYVALUE,
IPP_TAG_ADMINDEFINE,
IPP_TAG_INTEGER = 0x21,
IPP_TAG_BOOLEAN,
IPP_TAG_ENUM,
@@ -90,9 +92,10 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_DATE,
IPP_TAG_RESOLUTION,
IPP_TAG_RANGE,
IPP_TAG_COLLECTION,
IPP_TAG_BEGIN_COLLECTION,
IPP_TAG_TEXTLANG,
IPP_TAG_NAMELANG,
IPP_TAG_END_COLLECTION,
IPP_TAG_TEXT = 0x41,
IPP_TAG_NAME,
IPP_TAG_KEYWORD = 0x44,
@@ -101,7 +104,9 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_CHARSET,
IPP_TAG_LANGUAGE,
IPP_TAG_MIMETYPE,
IPP_TAG_COPY = 0x80000000
IPP_TAG_MEMBERNAME,
IPP_TAG_MASK = 0x7fffffff, /* Mask for copied attribute values */
IPP_TAG_COPY = -0x7fffffff-1 /* Bitflag for copied attribute values */
} ipp_tag_t;
typedef enum /**** Resolution units... ****/
@@ -112,11 +117,34 @@ typedef enum /**** Resolution units... ****/
typedef enum /**** Finishings... ****/
{
IPP_FINISH_NONE = 3,
IPP_FINISH_STAPLE,
IPP_FINISH_PUNCH,
IPP_FINISH_COVER,
IPP_FINISH_BIND
IPP_FINISHINGS_NONE = 3,
IPP_FINISHINGS_STAPLE,
IPP_FINISHINGS_PUNCH,
IPP_FINISHINGS_COVER,
IPP_FINISHINGS_BIND,
IPP_FINISHINGS_SADDLE_STITCH,
IPP_FINISHINGS_EDGE_STITCH,
IPP_FINISHINGS_FOLD,
IPP_FINISHINGS_TRIM,
IPP_FINISHINGS_BALE,
IPP_FINISHINGS_BOOKLET_MAKER,
IPP_FINISHINGS_JOB_OFFSET,
IPP_FINISHINGS_STAPLE_TOP_LEFT = 20,
IPP_FINISHINGS_STAPLE_BOTTOM_LEFT,
IPP_FINISHINGS_STAPLE_TOP_RIGHT,
IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT,
IPP_FINISHINGS_EDGE_STITCH_LEFT,
IPP_FINISHINGS_EDGE_STITCH_TOP,
IPP_FINISHINGS_EDGE_STITCH_RIGHT,
IPP_FINISHINGS_EDGE_STITCH_BOTTOM,
IPP_FINISHINGS_STAPLE_DUAL_LEFT,
IPP_FINISHINGS_STAPLE_DUAL_TOP,
IPP_FINISHINGS_STAPLE_DUAL_RIGHT,
IPP_FINISHINGS_STAPLE_DUAL_BOTTOM,
IPP_FINISHINGS_BIND_LEFT = 50,
IPP_FINISHINGS_BIND_TOP,
IPP_FINISHINGS_BIND_RIGHT,
IPP_FINISHINGS_BIND_BOTTOM
} ipp_finish_t;
typedef enum /**** Orientation... ****/
@@ -182,6 +210,31 @@ typedef enum /**** IPP operations... ****/
IPP_SET_PRINTER_ATTRIBUTES,
IPP_SET_JOB_ATTRIBUTES,
IPP_GET_PRINTER_SUPPORTED_VALUES,
IPP_CREATE_PRINTER_SUBSCRIPTION,
IPP_CREATE_JOB_SUBSCRIPTION,
IPP_GET_SUBSCRIPTION_ATTRIBUTES,
IPP_GET_SUBSCRIPTIONS,
IPP_RENEW_SUBSCRIPTION,
IPP_CANCEL_SUBSCRIPTION,
IPP_GET_NOTIFICATIONS,
IPP_SEND_NOTIFICATIONS,
IPP_GET_PRINT_SUPPORT_FILES = 0x0021,
IPP_ENABLE_PRINTER,
IPP_DISABLE_PRINTER,
IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB,
IPP_HOLD_NEW_JOBS,
IPP_RELEASE_HELD_NEW_JOBS,
IPP_DEACTIVATE_PRINTER,
IPP_ACTIVATE_PRINTER,
IPP_RESTART_PRINTER,
IPP_SHUTDOWN_PRINTER,
IPP_STARTUP_PRINTER,
IPP_REPROCESS_JOB,
IPP_CANCEL_CURRENT_JOB,
IPP_SUSPEND_CURRENT_JOB,
IPP_RESUME_JOB,
IPP_PROMOTE_JOB,
IPP_SCHEDULE_JOB_AFTER,
IPP_PRIVATE = 0x4000,
CUPS_GET_DEFAULT,
CUPS_GET_PRINTERS,
@@ -195,7 +248,9 @@ typedef enum /**** IPP operations... ****/
CUPS_SET_DEFAULT,
CUPS_GET_DEVICES,
CUPS_GET_PPDS,
CUPS_MOVE_JOB
CUPS_MOVE_JOB,
CUPS_ADD_DEVICE,
CUPS_DELETE_DEVICE
} ipp_op_t;
typedef enum /**** IPP status codes... ****/
@@ -203,6 +258,11 @@ typedef enum /**** IPP status codes... ****/
IPP_OK = 0x0000,
IPP_OK_SUBST,
IPP_OK_CONFLICT,
IPP_OK_IGNORED_SUBSCRIPTIONS,
IPP_OK_IGNORED_NOTIFICATIONS,
IPP_OK_TOO_MANY_EVENTS,
IPP_OK_BUT_CANCEL_SUBSCRIPTION,
IPP_REDIRECTION_OTHER_SITE = 0x300,
IPP_BAD_REQUEST = 0x0400,
IPP_FORBIDDEN,
IPP_NOT_AUTHENTICATED,
@@ -222,6 +282,12 @@ typedef enum /**** IPP status codes... ****/
IPP_COMPRESSION_ERROR,
IPP_DOCUMENT_FORMAT_ERROR,
IPP_DOCUMENT_ACCESS_ERROR,
IPP_ATTRIBUTES_NOT_SETTABLE,
IPP_IGNORED_ALL_SUBSCRIPTIONS,
IPP_TOO_MANY_SUBSCRIPTIONS,
IPP_IGNORED_ALL_NOTIFICATIONS,
IPP_PRINT_SUPPORT_FILE_NOT_FOUND,
IPP_INTERNAL_ERROR = 0x0500,
IPP_OPERATION_NOT_SUPPORTED,
IPP_SERVICE_UNAVAILABLE,
@@ -231,7 +297,8 @@ typedef enum /**** IPP status codes... ****/
IPP_NOT_ACCEPTING,
IPP_PRINTER_BUSY,
IPP_ERROR_JOB_CANCELLED,
IPP_MULTIPLE_JOBS_NOT_SUPPORTED
IPP_MULTIPLE_JOBS_NOT_SUPPORTED,
IPP_PRINTER_IS_DEACTIVATED
} ipp_status_t;
typedef unsigned char ipp_uchar_t;/**** Unsigned 8-bit integer/character ****/
@@ -336,7 +403,10 @@ extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, ipp_tag_t typ
extern time_t ippDateToTime(const ipp_uchar_t *date);
extern void ippDelete(ipp_t *ipp);
extern const char *ippErrorString(ipp_status_t error);
extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name, ipp_tag_t type);
extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name,
ipp_tag_t type);
extern ipp_attribute_t *ippFindNextAttribute(ipp_t *ipp, const char *name,
ipp_tag_t type);
extern size_t ippLength(ipp_t *ipp);
extern ipp_t *ippNew(void);
extern ipp_state_t ippRead(http_t *http, ipp_t *ipp);
+21 -277
Ver Arquivo
@@ -23,12 +23,11 @@
*
* Contents:
*
* cupsAddOption() - Add an option to an option array.
* cupsEncodeOptions() - Encode printer options into IPP attributes.
* cupsFreeOptions() - Free all memory used by options.
* cupsGetOption() - Get an option value.
* cupsParseOptions() - Parse options from a command-line argument.
* cupsMarkOptions() - Mark command-line options in a PPD file.
* cupsAddOption() - Add an option to an option array.
* cupsFreeOptions() - Free all memory used by options.
* cupsGetOption() - Get an option value.
* cupsParseOptions() - Parse options from a command-line argument.
* cupsMarkOptions() - Mark command-line options in a PPD file.
*/
/*
@@ -56,8 +55,9 @@ cupsAddOption(const char *name, /* I - Name of option */
cups_option_t *temp; /* Pointer to new option */
if (name == NULL || value == NULL || options == NULL || num_options < 0)
return (0);
if (name == NULL || !name[0] || value == NULL ||
options == NULL || num_options < 0)
return (num_options);
/*
* Look for an existing option with the same name...
@@ -102,274 +102,6 @@ cupsAddOption(const char *name, /* I - Name of option */
}
/*
* 'cupsEncodeOptions()' - Encode printer options into IPP attributes.
*/
void
cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
int num_options, /* I - Number of options */
cups_option_t *options) /* I - Options */
{
int i, j; /* Looping vars */
int count; /* Number of values */
int n; /* Attribute value */
char *s, /* Pointer into option value */
*val, /* Pointer to option value */
*copy, /* Copy of option value */
*sep; /* Option separator */
ipp_attribute_t *attr; /* IPP job-id attribute */
DEBUG_printf(("cupsEncodeOptions(%p, %d, %p)\n", ipp, num_options, options));
if (ipp == NULL || num_options < 1 || options == NULL)
return;
/*
* Handle the document format stuff first...
*/
if ((val = (char *)cupsGetOption("document-format", num_options, options)) != NULL)
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, val);
else if (cupsGetOption("raw", num_options, options))
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/vnd.cups-raw");
else
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/octet-stream");
/*
* Then add all other options...
*/
for (i = 0; i < num_options; i ++)
{
/*
* Skip document format options - handled above...
*/
if (strcasecmp(options[i].name, "raw") == 0 ||
strcasecmp(options[i].name, "document-format") == 0)
continue;
/*
* Count the number of values...
*/
for (count = 1, sep = options[i].value;
(sep = strchr(sep + 1, ',')) != NULL;
count ++);
DEBUG_printf(("cupsEncodeOptions: option = \'%s\', count = %d\n",
options[i].name, count));
if ((attr = _ipp_add_attr(ipp, count)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for attributes!");
return;
}
attr->group_tag = IPP_TAG_JOB;
if ((attr->name = strdup(options[i].name)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for name!");
return;
}
if (count > 1)
{
/*
* Make a copy of the value we can fiddle with...
*/
if ((copy = strdup(options[i].value)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for value copy!");
return;
}
val = copy;
}
else
{
/*
* Since we have a single value, use the value directly...
*/
val = options[i].value;
copy = NULL;
}
/*
* See what the option value is; for compatibility with older interface
* scripts, we have to support single-argument options as well as
* option=value, option=low-high, option=MxN, and option=val1,val2,...,valN.
*/
if (*val == '\0')
{
/*
* Old-style System V boolean value...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
if (strncasecmp(attr->name, "no", 2) == 0)
{
DEBUG_puts("cupsEncodeOptions: Added boolean false value...");
strcpy(attr->name, attr->name + 2);
attr->values[0].boolean = 0;
}
else
{
DEBUG_puts("cupsEncodeOptions: Added boolean true value...");
attr->values[0].boolean = 1;
}
}
else
{
/*
* Scan the value string for values...
*/
for (j = 0; *val != '\0'; val = sep, j ++)
{
/*
* Find the end of this value and mark it if needed...
*/
if ((sep = strchr(val, ',')) != NULL)
*sep++ = '\0';
else
sep = val + strlen(val);
/*
* See what kind of value it is...
*/
if (strcasecmp(val, "true") == 0 ||
strcasecmp(val, "on") == 0 ||
strcasecmp(val, "yes") == 0)
{
/*
* Boolean value - true...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
attr->values[j].boolean = 1;
DEBUG_puts("cupsEncodeOptions: Added boolean true value...");
}
else if (strcasecmp(val, "false") == 0 ||
strcasecmp(val, "off") == 0 ||
strcasecmp(val, "no") == 0)
{
/*
* Boolean value - false...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
attr->values[j].boolean = 0;
DEBUG_puts("cupsEncodeOptions: Added boolean false value...");
}
else
{
/*
* Number, range, resolution, or string...
*/
n = strtol(val, &s, 0);
if (*s != '\0' && *s != '-' && (*s != 'x' || s == val))
{
/*
* String value(s)...
*/
if ((attr->values[j].string.text = strdup(val)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for string!");
return;
}
attr->value_tag = IPP_TAG_NAME;
DEBUG_printf(("cupsEncodeOptions: Added string value \'%s\'...\n", val));
}
else if (*s == '-')
{
attr->value_tag = IPP_TAG_RANGE;
attr->values[j].range.lower = n;
attr->values[j].range.upper = strtol(s + 1, NULL, 0);
DEBUG_printf(("cupsEncodeOptions: Added range option value %d-%d...\n",
n, attr->values[j].range.upper));
}
else if (*s == 'x')
{
attr->value_tag = IPP_TAG_RESOLUTION;
attr->values[j].resolution.xres = n;
attr->values[j].resolution.yres = strtol(s + 1, &s, 0);
if (strcasecmp(s, "dpc") == 0)
attr->values[j].resolution.units = IPP_RES_PER_CM;
else if (strcasecmp(s, "dpi") == 0)
attr->values[j].resolution.units = IPP_RES_PER_INCH;
else
{
if ((attr->values[j].string.text = strdup(val)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for string!");
return;
}
attr->value_tag = IPP_TAG_NAME;
DEBUG_printf(("cupsEncodeOptions: Added string value \'%s\'...\n", val));
continue;
}
DEBUG_printf(("cupsEncodeOptions: Adding resolution option value %s...\n",
val));
}
else
{
attr->value_tag = IPP_TAG_INTEGER;
attr->values[j].integer = n;
DEBUG_printf(("cupsEncodeOptions: Adding integer option value %d...\n", n));
}
}
}
}
}
}
/*
* 'cupsFreeOptions()' - Free all memory used by options.
*/
@@ -463,6 +195,13 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
while (!isspace(*ptr) && *ptr != '=' && *ptr != '\0')
ptr ++;
/*
* Avoid an empty name...
*/
if (ptr == name)
break;
/*
* Skip trailing spaces...
*/
@@ -476,7 +215,12 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
* Start of another option...
*/
num_options = cupsAddOption(name, "", num_options, options);
if (strncasecmp(name, "no", 2) == 0)
num_options = cupsAddOption(name + 2, "false", num_options,
options);
else
num_options = cupsAddOption(name, "true", num_options, options);
continue;
}
+1 -1
Ver Arquivo
@@ -1425,7 +1425,7 @@ ppdOpenFile(const char *filename) /* I - File to read from */
* 'compare_strings()' - Compare two strings.
*/
int /* O - Result of comparison */
static int /* O - Result of comparison */
compare_strings(char *s, /* I - First string */
char *t) /* I - Second string */
{
+2
Ver Arquivo
@@ -237,6 +237,8 @@ extern int ppdEmit(ppd_file_t *ppd, FILE *fp,
ppd_section_t section);
extern int ppdEmitFd(ppd_file_t *ppd, int fd,
ppd_section_t section);
extern int ppdEmitJCL(ppd_file_t *ppd, FILE *fp, int job_id,
const char *user, const char *title);
extern int ppdIsMarked(ppd_file_t *ppd, const char *keyword,
const char *option);
extern void ppdMarkDefaults(ppd_file_t *ppd);
+8 -1
Ver Arquivo
@@ -32,7 +32,14 @@
# include <stdio.h>
# include <stdarg.h>
# include <config.h>
# include <string.h>
# ifdef HAVE_STRING_H
# include <string.h>
# endif /* HAVE_STRING_H */
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif /* HAVE_STRINGS_H */
/*
+200
Ver Arquivo
@@ -0,0 +1,200 @@
/*
* "$Id$"
*
* Temp file utilities for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 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-3111 USA
*
* Voice: (301) 373-9603
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
* Contents:
*
* cupsTempFd() - Create a temporary file.
* cupsTempFile() - Generate a temporary filename.
*/
/*
* Include necessary headers...
*/
#include "cups.h"
#include "string.h"
#include "debug.h"
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#if defined(WIN32) || defined(__EMX__)
# include <io.h>
#else
# include <unistd.h>
#endif /* WIN32 || __EMX__ */
/*
* 'cupsTempFd()' - Create a temporary file.
*/
int /* O - New file descriptor */
cupsTempFd(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
int fd; /* File descriptor for temp file */
#ifdef WIN32
char tmpdir[1024]; /* Windows temporary directory */
DWORD curtime; /* Current time */
#else
char *tmpdir; /* TMPDIR environment var */
struct timeval curtime; /* Current time */
#endif /* WIN32 */
static char buf[1024] = ""; /* Buffer if you pass in NULL and 0 */
/*
* See if a filename was specified...
*/
if (filename == NULL)
{
filename = buf;
len = sizeof(buf);
}
/*
* See if TMPDIR is defined...
*/
#ifdef WIN32
GetTempPath(sizeof(tmpdir), tmpdir);
#else
if ((tmpdir = getenv("TMPDIR")) == NULL)
{
/*
* Put root temp files in restricted temp directory...
*/
if (getuid() == 0)
tmpdir = CUPS_REQUESTS "/tmp";
else
tmpdir = "/var/tmp";
}
#endif /* WIN32 */
/*
* Make the temporary name using the specified directory...
*/
do
{
#ifdef WIN32
/*
* Get the current time of day...
*/
curtime = GetTickCount();
/*
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%08lx", tmpdir, curtime);
#else
/*
* Get the current time of day...
*/
gettimeofday(&curtime, NULL);
/*
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%08lx%05lx", tmpdir,
curtime.tv_sec, curtime.tv_usec);
#endif /* WIN32 */
/*
* Open the file in "exclusive" mode, making sure that we don't
* stomp on an existing file or someone's symlink crack...
*/
#ifdef O_NOFOLLOW
fd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, 0600);
#else
fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600);
#endif /* O_NOFOLLOW */
if (fd < 0 && errno == EPERM)
break; /* Stop immediately if permission denied! */
}
while (fd < 0);
/*
* Return the file descriptor...
*/
return (fd);
}
/*
* 'cupsTempFile()' - Generate a temporary filename.
*/
char * /* O - Filename */
cupsTempFile(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
int fd; /* File descriptor for temp file */
static char buf[1024] = ""; /* Buffer if you pass in NULL and 0 */
/*
* See if a filename was specified...
*/
if (filename == NULL)
{
filename = buf;
len = sizeof(buf);
}
/*
* Create the temporary file...
*/
if ((fd = cupsTempFd(filename, len)) < 0)
return (NULL);
/*
* Close the temp file - it'll be reopened later as needed...
*/
close(fd);
/*
* Return the temp filename...
*/
return (filename);
}
/*
* End of "$Id$".
*/
+332 -167
Ver Arquivo
@@ -25,15 +25,15 @@
*
* cupsCancelJob() - Cancel a print job.
* cupsDoFileRequest() - Do an IPP request...
* cupsFreeJobs() - Free memory used by job data.
* cupsGetClasses() - Get a list of printer classes.
* cupsGetDefault() - Get the default printer or class.
* cupsGetJobs() - Get the jobs from the server.
* cupsGetPPD() - Get the PPD file for a printer.
* cupsGetPrinters() - Get a list of printers.
* cupsLastError() - Return the last IPP error that occurred.
* cupsPrintFile() - Print a file to a printer or class.
* cupsPrintFiles() - Print one or more files to a printer or class.
* cupsTempFd() - Create a temporary file.
* cupsTempFile() - Generate a temporary filename.
* cups_connect() - Connect to the specified host...
* cups_local_auth() - Get the local authorization certificate if
* available/applicable...
@@ -256,7 +256,15 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
DEBUG_puts("cupsDoFileRequest: post...");
if (httpPost(http, resource))
continue;
{
if (httpReconnect(http))
{
status = HTTP_ERROR;
break;
}
else
continue;
}
/*
* Send the IPP data and wait for the response...
@@ -363,6 +371,22 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
else
break;
}
#ifdef HAVE_LIBSSL
else if (status == HTTP_UPGRADE_REQUIRED)
{
/*
* Flush any error message...
*/
httpFlush(http);
/*
* Try again, this time with encryption enabled...
*/
continue;
}
#endif /* HAVE_LIBSSL */
else if (status != HTTP_OK)
{
DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
@@ -394,12 +418,6 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
response = NULL;
last_error = IPP_SERVICE_UNAVAILABLE;
/*
* Flush any remaining data...
*/
httpFlush(http);
break;
}
}
@@ -412,6 +430,12 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
if (filename != NULL)
fclose(file);
/*
* Flush any remaining data...
*/
httpFlush(http);
/*
* Delete the original request and return the response...
*/
@@ -431,6 +455,32 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
}
/*
* 'cupsFreeJobs()' - Free memory used by job data.
*/
void
cupsFreeJobs(int num_jobs,/* I - Number of jobs */
cups_job_t *jobs) /* I - Jobs */
{
int i; /* Looping var */
if (num_jobs <= 0 || jobs == NULL)
return;
for (i = 0; i < num_jobs; i ++)
{
free(jobs[i].dest);
free(jobs[i].user);
free(jobs[i].format);
free(jobs[i].title);
}
free(jobs);
}
/*
* 'cupsGetClasses()' - Get a list of printer classes.
*/
@@ -622,6 +672,260 @@ cupsGetDefault(void)
}
/*
* 'cupsGetJobs()' - Get the jobs from the server.
*/
int /* O - Number of jobs */
cupsGetJobs(cups_job_t **jobs, /* O - Job data */
const char *mydest, /* I - Only show jobs for dest? */
int myjobs, /* I - Only show my jobs? */
int completed) /* I - Only show completed jobs? */
{
int n; /* Number of jobs */
ipp_t *request, /* IPP Request */
*response; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
cups_lang_t *language; /* Default language */
cups_job_t *temp; /* Temporary pointer */
int id, /* job-id */
priority, /* job-priority */
size; /* job-k-octets */
ipp_jstate_t state; /* job-state */
time_t completed_time, /* time-at-completed */
creation_time, /* time-at-creation */
processing_time; /* time-at-processing */
const char *dest, /* job-printer-uri */
*format, /* document-format */
*title, /* job-name */
*user; /* job-originating-user-name */
char uri[HTTP_MAX_URI]; /* URI for jobs */
static const char *attrs[] = /* Requested attributes */
{
"job-id",
"job-priority",
"job-k-octets",
"job-state",
"time-at-completed",
"time-at-creation",
"time-at-processing",
"job-printer-uri",
"document-format",
"job-name",
"job-originating-user-name"
};
if (jobs == NULL)
{
last_error = IPP_INTERNAL_ERROR;
return (0);
}
/*
* Try to connect to the server...
*/
if (!cups_connect("default", NULL, NULL))
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (0);
}
/*
* Build an IPP_GET_JOBS request, which requires the following
* attributes:
*
* attributes-charset
* attributes-natural-language
* printer-uri
* requesting-user-name
* which-jobs
* my-jobs
* requested-attributes
*/
request = ippNew();
request->request.op.operation_id = IPP_GET_JOBS;
request->request.op.request_id = 1;
language = cupsLangDefault();
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL, cupsLangEncoding(language));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
if (mydest)
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", mydest);
else
strcpy(uri, "ipp://localhost/jobs");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, cupsUser());
if (myjobs)
ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1);
if (completed)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"which-jobs", NULL, "completed");
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", sizeof(attrs) / sizeof(attrs[0]),
NULL, attrs);
/*
* Do the request and get back a response...
*/
n = 0;
*jobs = NULL;
if ((response = cupsDoRequest(cups_server, request, "/")) != NULL)
{
last_error = response->request.status.status_code;
for (attr = response->attrs; attr != NULL; attr = attr->next)
{
/*
* Skip leading attributes until we hit a job...
*/
while (attr != NULL && attr->group_tag != IPP_TAG_JOB)
attr = attr->next;
if (attr == NULL)
break;
/*
* Pull the needed attributes from this job...
*/
id = 0;
size = 0;
priority = 50;
state = IPP_JOB_PENDING;
user = NULL;
dest = NULL;
format = NULL;
title = NULL;
creation_time = 0;
completed_time = 0;
processing_time = 0;
while (attr != NULL && attr->group_tag == IPP_TAG_JOB)
{
if (strcmp(attr->name, "job-id") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
id = attr->values[0].integer;
else if (strcmp(attr->name, "job-state") == 0 &&
attr->value_tag == IPP_TAG_ENUM)
state = (ipp_jstate_t)attr->values[0].integer;
else if (strcmp(attr->name, "job-priority") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
priority = attr->values[0].integer;
else if (strcmp(attr->name, "job-k-octets") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
size = attr->values[0].integer;
else if (strcmp(attr->name, "time-at-completed") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
completed_time = attr->values[0].integer;
else if (strcmp(attr->name, "time-at-creation") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
creation_time = attr->values[0].integer;
else if (strcmp(attr->name, "time-at-processing") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
processing_time = attr->values[0].integer;
else if (strcmp(attr->name, "job-printer-uri") == 0 &&
attr->value_tag == IPP_TAG_URI)
{
if ((dest = strrchr(attr->values[0].string.text, '/')) != NULL)
dest ++;
}
else if (strcmp(attr->name, "job-originating-user-name") == 0 &&
attr->value_tag == IPP_TAG_NAME)
user = attr->values[0].string.text;
else if (strcmp(attr->name, "document-format") == 0 &&
attr->value_tag == IPP_TAG_MIMETYPE)
format = attr->values[0].string.text;
else if (strcmp(attr->name, "job-name") == 0 &&
attr->value_tag == IPP_TAG_TEXT)
title = attr->values[0].string.text;
attr = attr->next;
}
/*
* See if we have everything needed...
*/
if (dest == NULL || format == NULL || title == NULL || user == NULL ||
id == 0)
{
if (attr == NULL)
break;
else
continue;
}
/*
* Allocate memory for the job...
*/
if (n == 0)
temp = malloc(sizeof(cups_job_t));
else
temp = realloc(*jobs, sizeof(cups_job_t) * (n + 1));
if (temp == NULL)
{
/*
* Ran out of memory!
*/
cupsFreeJobs(n, *jobs);
*jobs = NULL;
ippDelete(response);
return (0);
}
*jobs = temp;
temp += n;
n ++;
/*
* Copy the data over...
*/
temp->dest = strdup(dest);
temp->user = strdup(user);
temp->format = strdup(format);
temp->title = strdup(title);
temp->id = id;
temp->priority = priority;
temp->state = state;
temp->size = size;
temp->completed_time = completed_time;
temp->creation_time = creation_time;
temp->processing_time = processing_time;
}
ippDelete(response);
}
else
last_error = IPP_BAD_REQUEST;
return (n);
}
/*
* 'cupsGetPPD()' - Get the PPD file for a printer.
*/
@@ -777,7 +1081,8 @@ cupsGetPPD(const char *name) /* I - Printer name */
{
httpClose(cups_server);
if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
if ((cups_server = httpConnectEncrypt(hostname, ippPort(),
cupsEncryption())) == NULL)
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (NULL);
@@ -814,9 +1119,16 @@ cupsGetPPD(const char *name) /* I - Printer name */
if (httpGet(cups_server, resource))
{
httpReconnect(cups_server);
status = HTTP_UNAUTHORIZED;
continue;
if (httpReconnect(cups_server))
{
status = HTTP_ERROR;
break;
}
else
{
status = HTTP_UNAUTHORIZED;
continue;
}
}
while ((status = httpUpdate(cups_server)) == HTTP_CONTINUE);
@@ -885,7 +1197,7 @@ cupsGetPPD(const char *name) /* I - Printer name */
break;
}
}
while (status == HTTP_UNAUTHORIZED);
while (status == HTTP_UNAUTHORIZED || status == HTTP_UPGRADE_REQUIRED);
/*
* See if we actually got the file or an error...
@@ -1230,155 +1542,6 @@ cupsPrintFiles(const char *name, /* I - Printer or class name */
}
/*
* 'cupsTempFd()' - Create a temporary file.
*/
int /* O - New file descriptor */
cupsTempFd(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
int fd; /* File descriptor for temp file */
#ifdef WIN32
char tmpdir[1024]; /* Windows temporary directory */
DWORD curtime; /* Current time */
#else
char *tmpdir; /* TMPDIR environment var */
struct timeval curtime; /* Current time */
#endif /* WIN32 */
static char buf[1024] = ""; /* Buffer if you pass in NULL and 0 */
/*
* See if a filename was specified...
*/
if (filename == NULL)
{
filename = buf;
len = sizeof(buf);
}
/*
* See if TMPDIR is defined...
*/
#ifdef WIN32
GetTempPath(sizeof(tmpdir), tmpdir);
#else
if ((tmpdir = getenv("TMPDIR")) == NULL)
{
/*
* Put root temp files in restricted temp directory...
*/
if (getuid() == 0)
tmpdir = CUPS_REQUESTS "/tmp";
else
tmpdir = "/var/tmp";
}
#endif /* WIN32 */
/*
* Make the temporary name using the specified directory...
*/
do
{
#ifdef WIN32
/*
* Get the current time of day...
*/
curtime = GetTickCount();
/*
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%08lx", tmpdir, curtime);
#else
/*
* Get the current time of day...
*/
gettimeofday(&curtime, NULL);
/*
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%08lx%05lx", tmpdir,
curtime.tv_sec, curtime.tv_usec);
#endif /* WIN32 */
/*
* Open the file in "exclusive" mode, making sure that we don't
* stomp on an existing file or someone's symlink crack...
*/
#ifdef O_NOFOLLOW
fd = open(filename, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, 0600);
#else
fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0600);
#endif /* O_NOFOLLOW */
if (fd < 0 && errno == EPERM)
break; /* Stop immediately if permission denied! */
}
while (fd < 0);
/*
* Return the file descriptor...
*/
return (fd);
}
/*
* 'cupsTempFile()' - Generate a temporary filename.
*/
char * /* O - Filename */
cupsTempFile(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
int fd; /* File descriptor for temp file */
static char buf[1024] = ""; /* Buffer if you pass in NULL and 0 */
/*
* See if a filename was specified...
*/
if (filename == NULL)
{
filename = buf;
len = sizeof(buf);
}
/*
* Create the temporary file...
*/
if ((fd = cupsTempFd(filename, len)) < 0)
return (NULL);
/*
* Close the temp file - it'll be reopened later as needed...
*/
close(fd);
/*
* Return the temp filename...
*/
return (filename);
}
/*
* 'cups_connect()' - Connect to the specified host...
*/
@@ -1393,6 +1556,8 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
/* Name of printer or class */
DEBUG_printf(("cups_connect(\"%s\", %p, %p)\n", name, printer, hostname));
if (name == NULL)
{
last_error = IPP_BAD_REQUEST;
@@ -1429,16 +1594,16 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
httpClose(cups_server);
}
if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
DEBUG_printf(("connecting to %s on port %d...\n", hostname, ippPort()));
if ((cups_server = httpConnectEncrypt(hostname, ippPort(),
cupsEncryption())) == NULL)
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (NULL);
}
else
{
httpEncryption(cups_server, cupsEncryption());
return (printer);
}
}
+2 -2
Ver Arquivo
@@ -1,6 +1,6 @@
%%BeginResource: procset hpgltops 1.1 0
%
% "$Id: HPGLprolog 932 2000-02-26 20:01:37Z mike $"
% "$Id: HPGLprolog 1605 2001-03-02 22:34:21Z andy $"
%
% HP-GL/2 filter procset for the Common UNIX Printing System (CUPS).
%
@@ -9,7 +9,7 @@
% should be called 'NP' (newpath), but GhostScript uses the 'NP' name
% for 'noaccess put' in some of its font files...
%
% Copyright 1993-2000 Easy Software Products
% Copyright 1993-2001 Easy Software Products
%
% These coded instructions, statements, and computer programs are the
% property of Easy Software Products and are protected by Federal
+1 -1
Ver Arquivo
@@ -91,7 +91,7 @@ install:
-$(MKDIR) $(DATADIR)/data
$(CHMOD) ugo+rx $(DATADIR)/data
$(INSTALL_DATA) $(DATAFILES) $(DATADIR)/data
-if test "$(PAMDIR)" != ""; then \
-if test x$(PAMDIR) != x; then \
$(MKDIR) $(PAMDIR); \
$(CHMOD) ugo+rx $(PAMDIR); \
if test -f /lib/security/pam_unix.so; then \
+17 -7
Ver Arquivo
@@ -14,13 +14,23 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2000 Easy Software Products
% Copyright 1993-2001 Easy Software Products
%
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of 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-3111 USA
%
% Voice: (301) 373-9603
% EMail: cups-info@cups.org
% WWW: http://www.cups.org
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -262,6 +272,6 @@ gsave
grestore
showpage
%
% End of "$Id: classified 1379 2000-09-18 17:12:42Z mike $".
% End of "$Id: classified 1646 2001-03-25 12:42:57Z mike $".
%
%%EOF
+17 -7
Ver Arquivo
@@ -14,13 +14,23 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2000 Easy Software Products
% Copyright 1993-2001 Easy Software Products
%
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of 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-3111 USA
%
% Voice: (301) 373-9603
% EMail: cups-info@cups.org
% WWW: http://www.cups.org
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -262,6 +272,6 @@ gsave
grestore
showpage
%
% End of "$Id: confidential 1379 2000-09-18 17:12:42Z mike $".
% End of "$Id: confidential 1646 2001-03-25 12:42:57Z mike $".
%
%%EOF
+17 -7
Ver Arquivo
@@ -14,13 +14,23 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2000 Easy Software Products
% Copyright 1993-2001 Easy Software Products
%
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of 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-3111 USA
%
% Voice: (301) 373-9603
% EMail: cups-info@cups.org
% WWW: http://www.cups.org
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -262,6 +272,6 @@ gsave
grestore
showpage
%
% End of "$Id: secret 1379 2000-09-18 17:12:42Z mike $".
% End of "$Id: secret 1646 2001-03-25 12:42:57Z mike $".
%
%%EOF
+17 -7
Ver Arquivo
@@ -14,13 +14,23 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2000 Easy Software Products
% Copyright 1993-2001 Easy Software Products
%
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of 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-3111 USA
%
% Voice: (301) 373-9603
% EMail: cups-info@cups.org
% WWW: http://www.cups.org
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -246,6 +256,6 @@ gsave
grestore
showpage
%
% End of "$Id: standard 1379 2000-09-18 17:12:42Z mike $".
% End of "$Id: standard 1646 2001-03-25 12:42:57Z mike $".
%
%%EOF
+18 -8
Ver Arquivo
@@ -14,13 +14,23 @@
%
% PostScript test page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2000 Easy Software Products
% Copyright 1993-2001 Easy Software Products
%
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of 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-3111 USA
%
% Voice: (301) 373-9603
% EMail: cups-info@cups.org
% WWW: http://www.cups.org
%
/OCTANT { % Draw a color wheel OCTANT...
% (name) radius r g b OCTANT -
@@ -477,7 +487,7 @@ gsave
pageHeight 2 mul sub % Move down...
2 copy moveto % Position text
smallFont setfont % Font
(Copyright 1993-2000 Easy Software Products, All Rights Reserved.) CENTER
(Copyright 1993-2001 Easy Software Products, All Rights Reserved.) CENTER
pageHeight sub % Move down...
2 copy moveto % Position text
(CUPS, and the CUPS logo are the trademark property of) CENTER
@@ -507,6 +517,6 @@ gsave
grestore
showpage
%
% End of "$Id: testprint.ps 1379 2000-09-18 17:12:42Z mike $".
% End of "$Id: testprint.ps 1646 2001-03-25 12:42:57Z mike $".
%
%%EOF
+17 -7
Ver Arquivo
@@ -14,13 +14,23 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2000 Easy Software Products
% Copyright 1993-2001 Easy Software Products
%
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of 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-3111 USA
%
% Voice: (301) 373-9603
% EMail: cups-info@cups.org
% WWW: http://www.cups.org
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -262,6 +272,6 @@ gsave
grestore
showpage
%
% End of "$Id: topsecret 1379 2000-09-18 17:12:42Z mike $".
% End of "$Id: topsecret 1646 2001-03-25 12:42:57Z mike $".
%
%%EOF
+17 -7
Ver Arquivo
@@ -14,13 +14,23 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2000 Easy Software Products
% Copyright 1993-2001 Easy Software Products
%
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of 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-3111 USA
%
% Voice: (301) 373-9603
% EMail: cups-info@cups.org
% WWW: http://www.cups.org
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -262,6 +272,6 @@ gsave
grestore
showpage
%
% End of "$Id: unclassified 1379 2000-09-18 17:12:42Z mike $".
% End of "$Id: unclassified 1646 2001-03-25 12:42:57Z mike $".
%
%%EOF
+1 -1
Ver Arquivo
@@ -17,7 +17,7 @@
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636-3111 USA
#
# Voice: (301) 373-9603
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
#
+545 -613
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+3 -3
Ver Arquivo
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<META NAME="DOCNUMBER" CONTENT="CUPS-CMP-1.1">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Configuration Management Plan</TITLE>
</HEAD>
@@ -221,7 +221,7 @@ information is provided by the CVS "&#36;Id$" tag:
*
* Description of file contents.
*
* Copyright 1997-2000 by Easy Software Products, all rights
* Copyright 1997-2001 by Easy Software Products, all rights
* reserved.
*
* These coded instructions, statements, and computer programs are
@@ -236,7 +236,7 @@ information is provided by the CVS "&#36;Id$" tag:
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636-3111 USA
*
* Voice: (301) 373-9603
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
+1 -1
Ver Arquivo
@@ -74,7 +74,7 @@ The following documentation for CUPS is available on this server:
<P>The Common UNIX Printing System, CUPS, and the CUPS logo are the
trademark property of <A HREF="http://www.easysw.com">Easy Software
Products</A>. CUPS is copyright 1997-2000 by Easy Software Products,
Products</A>. CUPS is copyright 1997-2001 by Easy Software Products,
All Rights Reserved.
</BODY>
+952 -1111
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-IDD-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Interface Design Description</TITLE>
+1 -1
Ver Arquivo
@@ -29,7 +29,7 @@
<P>The Common UNIX Printing System, CUPS, and the CUPS logo are the
trademark property of <A HREF="http://www.easysw.com">Easy Software
Products</A>. CUPS is copyright 1997-2000 by Easy Software Products,
Products</A>. CUPS is copyright 1997-2001 by Easy Software Products,
All Rights Reserved.
</BODY>
+1229 -1409
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+10 -1
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001 All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-IPP-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Implementation of IPP</TITLE>
@@ -1638,6 +1638,15 @@ The default value is 6.
<P>The page-bottom attribute specifies the bottom margin in points (72 points
equals 1 inch). The default value is the device physical margin.
<H3>page-label (text(MAX))</H3>
<P><I>(CUPS 1.1.7 and higher)</I>
<P>The page-label attribute provides a text value to place in
the header and footer on each page. If a classification level is
set on the server, then this classification is printed before
the page label.
<H3>page-left (integer(0:MAX))</H3>
<P>The page-left attribute specifies the left margin in points (72 points
+2 -2
Ver Arquivo
@@ -14,7 +14,7 @@
<P ALIGN="RIGHT">July 10, 2000<BR>
Michael Sweet, Easy Software Products<BR>
Copyright 1998-2000, All Rights Reserved.</P>
Copyright 1998-2001, All Rights Reserved.</P>
</TD>
</TR>
</TABLE>
@@ -413,7 +413,7 @@ on the CUPS bazaar, available at:
</PRE></UL>
<P>Finally, our own ESP Print Pro software uses CUPS to provide drivers
for over 2300 printers and can be found at:
for thousands of printers and can be found at:
<UL><PRE>
<A HREF="http://www.easysw.com/printpro">http://www.easysw.com/printpro</A>
Arquivo binário não exibido.
+537 -275
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+359 -34
Ver Arquivo
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.6">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.8">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Administrators Manual</TITLE>
</HEAD>
@@ -11,7 +11,7 @@
<P>This software administrators manual provides printer administration
information for the Common UNIX Printing System<SUP>TM</SUP>
("CUPS<SUP>TM</SUP>"), version 1.1.6.
("CUPS<SUP>TM</SUP>"), version 1.1.8.
<EMBED SRC="system-overview.shtml">
@@ -207,6 +207,7 @@ prior to running configure:
<B>setenv CFLAGS "-I/some/directory" ENTER</B>
<B>setenv CXXFLAGS "-I/some/directory" ENTER</B>
<B>setenv LDFLAGS "-L/some/directory" ENTER</B>
<B>setenv DSOFLAGS "-L/some/directory" ENTER</B>
<B>./configure ... ENTER</B>
</PRE></UL>
@@ -216,6 +217,7 @@ prior to running configure:
<B>CFLAGS="-I/some/directory"; export CFLAGS ENTER</B>
<B>CXXFLAGS="-I/some/directory"; export CXXFLAGS ENTER</B>
<B>LDFLAGS="-L/some/directory"; export LDFLAGS ENTER</B>
<B>DSOFLAGS="-L/some/directory"; export DSOFLAGS ENTER</B>
<B>./configure ... ENTER</B>
</PRE></UL>
@@ -849,7 +851,12 @@ determine how the server operates:
<LI><A HREF="#BrowseShortNames"><CODE>BrowseShortNames</CODE></A>
<LI><A HREF="#BrowseTimeout"><CODE>BrowseTimeout</CODE></A>
<LI><A HREF="#Browsing"><CODE>Browsing</CODE></A>
<LI><A HREF="#Classification"><CODE>Classification</CODE></A>
<LI><A HREF="#DataDir"><CODE>DataDir</CODE></A>
<LI><A HREF="#DefaultCharset"><CODE>DefaultCharset</CODE></A>
<LI><A HREF="#DefaultLanguage"><CODE>DefaultLanguage</CODE></A>
<LI><A HREF="#Deny"><CODE>Deny</CODE></A>
<LI><A HREF="#DocumentRoot"><CODE>DocumentRoot</CODE></A>
</TD>
<TD VALIGN="TOP">
@@ -857,24 +864,29 @@ determine how the server operates:
</TD>
<TD VALIGN="TOP">
<LI><A HREF="#DefaultCharset"><CODE>DefaultCharset</CODE></A>
<LI><A HREF="#DefaultLanguage"><CODE>DefaultLanguage</CODE></A>
<LI><A HREF="#Deny"><CODE>Deny</CODE></A>
<LI><A HREF="#DocumentRoot"><CODE>DocumentRoot</CODE></A>
<LI><A HREF="#Encryption"><CODE>Encryption</CODE></A>
<LI><A HREF="#ErrorLog"><CODE>ErrorLog</CODE></A>
<LI><A HREF="#FilterLimit"><CODE>FilterLimit</CODE></A>
<LI><A HREF="#FontPath"><CODE>FontPath</CODE></A>
<LI><A HREF="#Group"><CODE>Group</CODE></A>
<LI><A HREF="#HostNameLookups"><CODE>HostNameLookups</CODE></A>
<LI><A HREF="#ImplicitClasses"><CODE>ImplicitClasses</CODE></A>
<LI><A HREF="#KeepAliveTimeout"><CODE>KeepAliveTimeout</CODE></A>
<LI><A HREF="#KeepAlive"><CODE>KeepAlive</CODE></A>
<LI><A HREF="#Limit"><CODE>Limit</CODE></A>
<LI><A HREF="#LimitExcept"><CODE>LimitExcept</CODE></A>
<LI><A HREF="#LimitRequestBody"><CODE>LimitRequestBody</CODE></A>
<LI><A HREF="#Listen"><CODE>Listen</CODE></A>
<LI><A HREF="#Location"><CODE>Location</CODE></A>
<LI><A HREF="#LogLevel"><CODE>LogLevel</CODE></A>
<LI><A HREF="#MaxClients"><CODE>MaxClients</CODE></A>
<LI><A HREF="#MaxJobs"><CODE>MaxJobs</CODE></A>
<LI><A HREF="#MaxJobsPerPrinter"><CODE>MaxJobsPerPrinter</CODE></A>
<LI><A HREF="#MaxJobsPerUser"><CODE>MaxJobsPerUser</CODE></A>
<LI><A HREF="#MaxLogSize"><CODE>MaxLogSize</CODE></A>
<LI><A HREF="#MaxRequestSize"><CODE>MaxRequestSize</CODE></A>
<LI><A HREF="#Order"><CODE>Order</CODE></A>
<LI><A HREF="#PageLog"><CODE>PageLog</CODE></A>
</TD>
<TD VALIGN="TOP">
@@ -882,19 +894,25 @@ determine how the server operates:
</TD>
<TD VALIGN="TOP">
<LI><A HREF="#Order"><CODE>Order</CODE></A>
<LI><A HREF="#PageLog"><CODE>PageLog</CODE></A>
<LI><A HREF="#Port"><CODE>Port</CODE></A>
<LI><A HREF="#PreserveJobFiles"><CODE>PreserveJobFiles</CODE></A>
<LI><A HREF="#PreserveJobHistory"><CODE>PreserveJobHistory</CODE></A>
<LI><A HREF="#Printcap"><CODE>Printcap</CODE></A>
<LI><A HREF="#PrintcapFormat"><CODE>PrintcapFormat</CODE></A>
<LI><A HREF="#RemoteRoot"><CODE>RemoteRoot</CODE></A>
<LI><A HREF="#RequestRoot"><CODE>RequestRoot</CODE></A>
<LI><A HREF="#Require"><CODE>Require</CODE></A>
<LI><A HREF="#RIPCache"><CODE>RIPCache</CODE></A>
<LI><A HREF="#RunAsUser"><CODE>RunAsUser</CODE></A>
<LI><A HREF="#Satisfy"><CODE>Satisfy</CODE></A>
<LI><A HREF="#ServerAdmin"><CODE>ServerAdmin</CODE></A>
<LI><A HREF="#ServerBin"><CODE>ServerBin</CODE></A>
<LI><A HREF="#ServerCertificate"><CODE>ServerCertificate</CODE></A>
<LI><A HREF="#ServerKey"><CODE>ServerKey</CODE></A>
<LI><A HREF="#ServerName"><CODE>ServerName</CODE></A>
<LI><A HREF="#ServerRoot"><CODE>ServerRoot</CODE></A>
<LI><A HREF="#SSLListen"><CODE>SSLListen</CODE></A>
<LI><A HREF="#SSLPort"><CODE>SSLPort</CODE></A>
<LI><A HREF="#SystemGroup"><CODE>SystemGroup</CODE></A>
<LI><A HREF="#TempDir"><CODE>TempDir</CODE></A>
<LI><A HREF="#Timeout"><CODE>Timeout</CODE></A>
@@ -1401,6 +1419,28 @@ browsing is enabled. The default setting is <CODE>On</CODE>.
</TR>
</TABLE></CENTER>
<!-- NEED 3in -->
<H3><A NAME="Classification">Classification</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
Classification
Classification classified
Classification confidential
Classification secret
Classification topsecret
Classification unclassified
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>Classification</CODE> directive sets the classification level
on the server. When this option is set, at least one of the banner pages
is forced to the classification level, and the classification is placed
on each page of output. The default is no classification level.
<!-- NEED 3in -->
<H3><A NAME="DataDir">DataDir</A></H3>
<HR>
@@ -1545,6 +1585,26 @@ and then directly under the <CODE>DocumentRoot</CODE> directory
(e.g. <VAR>/usr/share/doc/cups/...</VAR>), so it is possible to localize
the web content by providing subdirectories for each language needed.
<!-- NEED 3in -->
<H3><A NAME="Encryption">Encryption</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
Encryption Never
Encryption IfRequested
Encryption Required
Encryption Always
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>Encryption</CODE> directive must appear instead a
<A HREF="#Location"><CODE>Location</CODE></A>
section and specifies the encryption settings for that location.
The default setting is <CODE>IfRequested</CODE> for all locations.
<!-- NEED 3in -->
<H3><A NAME="ErrorLog">ErrorLog</A></H3>
<HR>
@@ -1597,6 +1657,23 @@ limit the scheduler to printing a single job at any time.
<P>The default limit is 0.
<!-- NEED 3in -->
<H3><A NAME="FontPath">FontPath</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
FontPath /foo/bar/fonts
FontPath /usr/share/cups/fonts:/foo/bar/fonts
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>FontPath</CODE> directive specifies the font path to use when
searching for fonts. The default font path is
<CODE>/usr/share/cups/fonts</CODE>.
<!-- NEED 3in -->
<H3><A NAME="Group">Group</A></H3>
<HR>
@@ -1625,15 +1702,23 @@ system.
<UL><PRE>
HostNameLookups On
HostNameLookups Off
HostNameLookups Double
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>HostNameLookups</CODE> directive controls whether or not
CUPS looks up the hostname for connecting clients. The default is
<CODE>Off</CODE> to avoid the potential server performance problems
with hostname lookups. Turn this option <CODE>On</CODE> only if
absolutely required.
<P>The <CODE>HostNameLookups</CODE> directive controls whether
or not CUPS looks up the hostname for connecting clients. The
<CODE>Double</CODE> setting causes CUPS to verify that the
hostname resolved from the address matches one of the addresses
returned for that hostname. <CODE>Double</CODE> lookups also
prevent clients with unregistered addresses from connecting
to your server.
The default is <CODE>Off</CODE> to avoid the potential server
performance problems with hostname lookups. Set this option to
<CODE>On</CODE> or <CODE>Double</CODE> only if absolutely
required.
<!-- NEED 3in -->
<H3><A NAME="ImplicitClasses">ImplicitClasses</A></H3>
@@ -1692,6 +1777,74 @@ KeepAliveTimeout 30
persistent HTTP connection will remain open after the last request. The
default is 60 seconds.
<!-- NEED 3in -->
<H3><A NAME="Limit">Limit</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
&lt;Limit GET POST&gt;
...
&lt;/Limit&gt;
&lt;Limit ALL&gt;
...
&lt;/Limit&gt;
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>Limit</CODE> directive groups access control directives for
specific types of HTTP requests and must appear inside a
<A HREF="#Location"><CODE>Location</CODE></A> section. Access can be limited
for individual request types (<CODE>DELETE</CODE>, <CODE>GET</CODE>,
<CODE>HEAD</CODE>, <CODE>OPTIONS</CODE>, <CODE>POST</CODE>, <CODE>PUT</CODE>,
and <CODE>TRACE</CODE>) or for all request types (<CODE>ALL</CODE>). The
request type names are case-sensitive for compatibility with Apache.
<!-- NEED 3in -->
<H3><A NAME="LimitExcept">LimitExcept</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
&lt;LimitExcept GET POST&gt;
...
&lt;/LimitExcept&gt;
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>LimitExcept</CODE> directive groups access control directives for
specific types of HTTP requests and must appear inside a
<A HREF="#Location"><CODE>Location</CODE></A> section. Unlike the
<A HREF="#Limit"><CODE>Limit</CODE></A> directive, <CODE>LimitExcept</CODE>
restricts access for all requests <I>except</I> those listed on the
<CODE>LimitExcept</CODE> line.
<!-- NEED 3in -->
<H3><A NAME="LimitRequestBody">LimitRequestBody</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
LimitRequestBody 10485760
LimitRequestBody 10m
LimitRequestBody 0
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>LimitRequestBody</CODE> directive controls the maximum size of
print files, IPP requests, and HTML form data in HTTP POST requests. The
default limit is 0 which disables the limit check.
<P>Also see the identical
<A HREF="#MaxRequestSize"><CODE>MaxRequestSize</CODE></A> directive.
<!-- NEED 3in -->
<H3><A NAME="Listen">Listen</A></H3>
<HR>
@@ -1709,8 +1862,6 @@ Listen 192.0.2.1:631
to listen for connections. Multiple <CODE>Listen</CODE> directives can be
provided to listen on multiple addresses.
<H4>Description</H4>
<P>The <CODE>Listen</CODE> directive is similar to the
<A HREF="#Port"><CODE>Port</CODE></A> directive but allows you to restrict
access to specific interfaces or networks.
@@ -1749,30 +1900,48 @@ information can be found later in this chapter in
<H4>Examples</H4>
<UL><PRE>
LogLevel debug
LogLevel error
LogLevel info
LogLevel none
LogLevel emerg
LogLevel alert
LogLevel crit
LogLevel error
LogLevel warn
LogLevel notice
LogLevel info
LogLevel debug
LogLevel debug2
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>LogLevel</CODE> directive specifies the level of logging
for the <A HREF="#ErrorLog"><CODE>ErrorLog</CODE></A> file. The
following values are recognized:
following values are recognized (each level logs everything under the
preceding levels):
<UL>
<LI><CODE>debug</CODE> - Log everything.
<LI><CODE>none</CODE> - Log nothing.
<LI><CODE>info</CODE> - Log all requests and state changes (default).
<LI><CODE>emerg</CODE> - Log emergency conditions that prevent the
server from running.
<LI><CODE>alert</CODE> - Log alerts that must be handled immediately.
<LI><CODE>crit</CODE> - Log critical errors that don't prevent
the server from running.
<LI><CODE>error</CODE> - Log general errors.
<LI><CODE>warn</CODE> - Log errors and warnings.
<LI><CODE>error</CODE> - Log only errors.
<LI><CODE>notice</CODE> - Log temporary error conditions.
<LI><CODE>none</CODE> - Log nothing.
<LI><CODE>info</CODE> - Log all requests and state changes (default).
<LI><CODE>debug</CODE> - Log basic debugging information.
<LI><CODE>debug2</CODE> - Log all debugging information.
</UL>
@@ -1826,7 +1995,49 @@ oldest completed job is automatically purged from the system to make room
for the new one. If all of the known jobs are still pending or active then
the new job will be rejected.
<P>Setting the maximum size to 0 disables this functionality. The default
<P>Setting the maximum to 0 disables this functionality. The default
setting is 0.
<!-- NEED 3in -->
<H3><A NAME="MaxJobsPerPrinter">MaxJobsPerPrinter</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
MaxJobsPerPrinter 100
MaxJobsPerPrinter 9999
MaxJobsPerPrinter 0
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>MaxJobsPerPrinter</CODE> directive controls the maximum number of active jobs
that are allowed for each printer or class. Once a printer or class reaches the limit, new jobs will be
rejected until one of the active jobs is completed, stopped, aborted, or cancelled.
<P>Setting the maximum to 0 disables this functionality. The default
setting is 0.
<!-- NEED 3in -->
<H3><A NAME="MaxJobsPerUser">MaxJobsPerUser</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
MaxJobsPerUser 100
MaxJobsPerUser 9999
MaxJobsPerUser 0
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>MaxJobsPerUser</CODE> directive controls the maximum number of active jobs
that are allowed for each user. Once a user reaches the limit, new jobs will be
rejected until one of the active jobs is completed, stopped, aborted, or cancelled.
<P>Setting the maximum to 0 disables this functionality. The default
setting is 0.
<!-- NEED 3in -->
@@ -1868,6 +2079,9 @@ MaxRequestSize 0
print files, IPP requests, and HTML form data in HTTP POST requests. The
default limit is 0 which disables the limit check.
<P>Also see the identical
<A HREF="#LimitRequestBody"><CODE>LimitRequestBody</CODE></A> directive.
<!-- NEED 3in -->
<H3><A NAME="Order">Order</A></H3>
<HR>
@@ -1940,13 +2154,6 @@ Port 80
Multiple <CODE>Port</CODE> lines can be specified to listen on multiple
ports. The default port is 631.
<H4>Description</H4>
<P>The <CODE>Port</CODE> directive will listen for connections on all
network interfaces. To limit connections to a single interface use the
<A HREF="#Listen"><CODE>Listen</CODE></A> directive with the interface
address.
<!-- NEED 3in -->
<H3><A NAME="PreserveJobHistory">PreserveJobHistory</A></H3>
<HR>
@@ -2004,6 +2211,7 @@ soon as each job is completed, cancelled, or aborted.
<UL><PRE>
Printcap
Printcap /etc/printcap
Printcap /etc/printers.conf
</PRE></UL>
<H4>Description</H4>
@@ -2019,6 +2227,23 @@ printcap file is written whenever a printer is added or removed. The
printcap file can then be used by applications that are hardcoded to
look at the printcap file for the available printers.
<!-- NEED 3in -->
<H3><A NAME="Printcap">PrintcapFormat</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
PrintcapFormat BSD
PrintcapFormat Solaris
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>PrintcapFormat</CODE> directive controls the output
format of the printcap file. The default is to generate a BSD
printcap file.
<!-- NEED 3in -->
<H3><A NAME="RemoteRoot">RemoteRoot</A></H3>
<HR>
@@ -2076,6 +2301,32 @@ cache used by Raster Image Processor ("RIP") filters such as
be suffixed with a "k" for kilobytes, "m" for megabytes, or
"g" for gigabytes. The default cache size is "8m", or 8 megabytes.
<!-- NEED 3in -->
<H3><A NAME="RunAsUser">RunAsUser</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
RunAsUser Yes
RunAsUser No
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>RunAsUser</CODE> directive controls whether the
scheduler runs as the unpriviledged user account (usually <CODE>lp</CODE>).
The default is <CODE>No</CODE> which leaves the scheduler running as
the <CODE>root</CODE> user.
<P><B>Note:</B> Running as a non-priviledged user may prevent
LPD and locally connected printers from working due to
permission problems. The <CODE>lpd</CODE> backend will
automatically use a non-priviledged mode that is not 100%
compliant with RFC 1179. The <CODE>parallel</CODE>,
<CODE>serial</CODE>, and <CODE>usb</CODE> backends will need
write access to the corresponding device files.
<!-- NEED 3in -->
<H3><A NAME="ServerAdmin">ServerAdmin</A></H3>
<HR>
@@ -2113,6 +2364,42 @@ assumed to be relative to the
default executable directory is <VAR>/usr/lib/cups</VAR> or
<VAR>/usr/lib32/cups</VAR> (IRIX 6.5).
<!-- NEED 3in -->
<H3><A NAME="ServerCertificate">ServerCertificate</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
ServerCertificate /etc/cups/ssl/server.crt
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>ServerCertificate</CODE> directive specifies the
location of the SSL certificate file used by the server when
negotiating encrypted connections. The certificate must not be
encrypted (password protected) since the scheduler normally runs
in the background and will be unable to ask for a password.
The default certificate file is <VAR>/etc/cups/ssl/server.crt</VAR>.
<!-- NEED 3in -->
<H3><A NAME="ServerKey">ServerKey</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
ServerKey /etc/cups/ssl/server.key
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>ServerKey</CODE> directive specifies the location
of the SSL private key file used by the server when negotiating
encrypted connections. The default key file is
<VAR>/etc/cups/ssl/server.crt</VAR>.
<!-- NEED 3in -->
<H3><A NAME="ServerName"></A>ServerName</H3>
<HR>
@@ -2147,6 +2434,44 @@ the server configuration and state files. It is also used to resolve
relative paths in the <VAR>cupsd.conf</VAR> file. The default server
directory is <VAR>/etc/cups</VAR>.
<!-- NEED 3in -->
<H3><A NAME="SSLListen">SSLListen</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
SSLListen 127.0.0.1:443
SSLListen 192.0.2.1:443
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>SSLListen</CODE> directive specifies a network
address and port to listen for secure connections. Multiple
<CODE>SSLListen</CODE> directives can be provided to listen on
multiple addresses.
<P>The <CODE>SSLListen</CODE> directive is similar to the
<A HREF="#SSLPort"><CODE>SSLPort</CODE></A> directive but allows
you to restrict access to specific interfaces or networks.
<!-- NEED 3in -->
<H3><A NAME="SSLPort">SSLPort</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
SSLPort 443
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>SSLPort</CODE> directive specifies a port to listen
on for secure connections. Multiple <CODE>SSLPort</CODE> lines
can be specified to listen on multiple ports.
<!-- NEED 3in -->
<H3><A NAME="SystemGroup">SystemGroup</A></H3>
<HR>
@@ -2948,7 +3273,7 @@ would look like:
Printer Description:MyPrinter@MyServer:\
:pr=|/usr/bin/lp -d MyPrinter:\
:op=daemon:\
:pd=/etc/cups/ppd/MyPrinter.ppd
:pd=/etc/cups/ppd/MyPrinter.ppd:
</PRE></UL>
<!-- NEED 2in -->
@@ -3830,9 +4155,9 @@ For more information please contact us at:
<LI>WWW: <A HREF="http://www.easysw.com">
<CODE>http://www.easysw.com</CODE></A>
<LI>EMail: <A HREF="mailto:support@easysw.com">support@easysw.com</A>
<LI>EMail: <A HREF="mailto:info@easysw.com">info@easysw.com</A>
<LI>Telephone (M-F, 9-5 EST): +1.301.373.9603
<LI>Telephone (M-F, 9-5 EST): +1.301.373.9600
</UL>
+507 -617
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SDD-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Design Description</TITLE>
+180 -166
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+46 -7
Ver Arquivo
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SPM-1.1.6">
<META NAME="DOCNUMBER" CONTENT="CUPS-SPM-1.1.8">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Programmers Manual</TITLE>
</HEAD>
@@ -9,8 +9,9 @@
<H1 ALIGN="RIGHT">Preface</H1>
<P>This software programmers manual provides software programming
information for the Common UNIX Printing System ("CUPS") Version 1.1.6.
<P>This software programmers manual provides software
programming information for the Common UNIX Printing System
("CUPS") Version 1.1.8.
<EMBED SRC="system-overview.shtml">
@@ -7141,6 +7142,7 @@ ippDelete(ipp);
<H3>Usage</H3>
<PRE>
ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name, ipp_tag_t tag);
</PRE>
<H3>Arguments</H3>
@@ -7151,28 +7153,56 @@ ippDelete(ipp);
<TH>Description</TH>
</TR>
<TR>
<TD></TD>
<TD></TD>
<TD>ipp</TD>
<TD>The IPP request or response</TD>
</TR>
<TR>
<TD>name</TD>
<TD>The name of the attribute</TD>
</TR>
<TR>
<TD>tag</TD>
<TD>The required value tag for the attribute or
<CODE>IPP_TAG_ZERO</CODE> for any type of value.</TD>
</TR>
</TABLE></CENTER>
<H3>Returns</H3>
<P>A pointer to the first occurrence of the requested attribute, or
<CODE>NULL</CODE> if it was not found.
<H3>Description</H3>
<P><CODE>ippFindAttribute()</CODE> finds the first occurrence of the named
attribute. The <CODE>tag</CODE> parameter restricts the search to a specific
value type - use <CODE>IPP_TAG_ZERO</CODE> to find any value with the name.
<P>The value tags <CODE>IPP_TAG_NAME</CODE> and <CODE>IPP_TAG_TEXT</CODE>
match the name/text values with or without the language code.
<H3>Example</H3>
<PRE>
ipp_attribute_t *attr;
attr = ippFindAttribute(response, "printer-state-message", IPP_TAG_TEXT);
</PRE>
<H3>See Also</H3>
<A HREF="#cupsDoFileRequest"><CODE>cupsDoFileRequest()</CODE></A>,
<A HREF="#cupsDoRequest"><CODE>cupsDoRequest()</CODE></A>,
<A HREF="#ippDelete"><CODE>ippDelete()</CODE></A>,
<A HREF="#ippNew"><CODE>ippNew()</CODE></A>
<!-- NEW PAGE --><H2><A NAME="ippLength">ippLength()</A></H2>
<H3>Usage</H3>
<PRE>
int ippLength(ipp_t *ipp);
</PRE>
<H3>Arguments</H3>
@@ -7183,22 +7213,31 @@ ippDelete(ipp);
<TH>Description</TH>
</TR>
<TR>
<TD></TD>
<TD></TD>
<TD>ipp</TD>
<TD>The IPP request or response</TD>
</TR>
</TABLE></CENTER>
<H3>Returns</H3>
<P>The total encoded length of the IPP request or response in bytes.
<H3>Description</H3>
<P><CODE>ippLength()</CODE> returns the length of the IPP request or
response in bytes.
<H3>Example</H3>
<PRE>
printf("The length of the response is %d bytes.\n", ippLength(response));
</PRE>
<H3>See Also</H3>
<A HREF="#ippDelete"><CODE>ippDelete()</CODE></A>,
<A HREF="#ippNew"><CODE>ippNew()</CODE></A>
<!-- NEW PAGE --><H2><A NAME="ippNew">ippNew()</A></H2>
+6 -6
Ver Arquivo
@@ -2,11 +2,11 @@
<HTML>
<HEAD>
<TITLE> CUPS Software Performance Specification</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SPS-1.1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<STYLE>
<META NAME="author" CONTENT="Easy Software Products">
<META NAME="copyright" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="docnumber" CONTENT="CUPS-SPS-1.1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif; font-size: 11.0pt }
H1 { font-family: sans-serif; font-size: 20.0pt }
H2 { font-family: sans-serif; font-size: 17.0pt }
@@ -17,7 +17,7 @@ H6 { font-family: sans-serif; font-size: 8.0pt }
SUB { font-size: 8.0pt }
SUP { font-size: 8.0pt }
PRE { font-size: 9.0pt }
</STYLE>
--></STYLE>
</HEAD>
<BODY>
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="100%"><BR>
BIN
Ver Arquivo
Arquivo binário não exibido.
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SPS-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Performance Specification</TITLE>
+6 -6
Ver Arquivo
@@ -2,11 +2,11 @@
<HTML>
<HEAD>
<TITLE> CUPS Software Security Report</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SSR-1.1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<STYLE>
<META NAME="author" CONTENT="Easy Software Products">
<META NAME="copyright" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="docnumber" CONTENT="CUPS-SSR-1.1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif; font-size: 11.0pt }
H1 { font-family: sans-serif; font-size: 20.0pt }
H2 { font-family: sans-serif; font-size: 17.0pt }
@@ -17,7 +17,7 @@ H6 { font-family: sans-serif; font-size: 8.0pt }
SUB { font-size: 8.0pt }
SUP { font-size: 8.0pt }
PRE { font-size: 9.0pt }
</STYLE>
--></STYLE>
</HEAD>
<BODY>
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="100%"><BR>
BIN
Ver Arquivo
Arquivo binário não exibido.
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SSR-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Security Report</TITLE>
+111 -23
Ver Arquivo
@@ -1,12 +1,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE> DRAFT - CUPS Software Test Plan</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-STP-1.1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<STYLE>
<TITLE> CUPS Software Test Plan</TITLE>
<META NAME="author" CONTENT="Easy Software Products">
<META NAME="copyright" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="docnumber" CONTENT="CUPS-STP-1.1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif; font-size: 11.0pt }
H1 { font-family: sans-serif; font-size: 20.0pt }
H2 { font-family: sans-serif; font-size: 17.0pt }
@@ -17,11 +17,11 @@ H6 { font-family: sans-serif; font-size: 8.0pt }
SUB { font-size: 8.0pt }
SUP { font-size: 8.0pt }
PRE { font-size: 9.0pt }
</STYLE>
--></STYLE>
</HEAD>
<BODY>
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="100%"><BR>
<H1> DRAFT - CUPS Software Test Plan</H1></A><BR>
<H1> CUPS Software Test Plan</H1></A><BR>
CUPS-STP-1.1<BR>
Easy Software Products<BR>
Copyright 1997-2001, All Rights Reserved<BR>
@@ -40,21 +40,37 @@ Copyright 1997-2001, All Rights Reserved<BR>
<LI><A HREF="#2_1">2.1 CUPS Documentation</A></LI>
<LI><A HREF="#2_2">2.2 Other Documents</A></LI>
</UL>
<B><A HREF="#3">3 Local Tests</A></B>
<B><A HREF="#3">3 Test Procedure</A></B>
<BR>
<BR><B><A HREF="#4">4 Remote Tests</A></B>
<BR>
<BR><B><A HREF="#5">A Glossary</A></B>
<BR><B><A HREF="#4">4 IPP Compliance Tests</A></B>
<UL>
<LI><A HREF="#5_1">A.1 Terms</A></LI>
<LI><A HREF="#5_2">A.2 Acronyms</A></LI>
<LI><A HREF="#4_1">4.1 Request Tests</A></LI>
<LI><A HREF="#4_2">4.2 CUPS Printer Operation Tests</A></LI>
<LI><A HREF="#4_3">4.3 Job Operation Tests</A></LI>
</UL>
<B><A HREF="#5">5 Command Tests</A></B>
<UL>
<LI><A HREF="#5_1">5.1 lpadmin</A></LI>
<LI><A HREF="#5_2">5.2 lpc</A></LI>
<LI><A HREF="#5_3">5.3 lpq</A></LI>
<LI><A HREF="#5_4">5.4 lpstat</A></LI>
<LI><A HREF="#5_5">5.5 lp</A></LI>
<LI><A HREF="#5_6">5.6 lpr</A></LI>
<LI><A HREF="#5_7">5.7 lprm</A></LI>
<LI><A HREF="#5_8">5.8 cancel</A></LI>
<LI><A HREF="#5_9">5.9 lpinfo</A></LI>
</UL>
<B><A HREF="#6">A Glossary</A></B>
<UL>
<LI><A HREF="#6_1">A.1 Terms</A></LI>
<LI><A HREF="#6_2">A.2 Acronyms</A></LI>
</UL>
<HR>
<H1><A NAME="1">1 Scope</A></H1>
<H2><A NAME="1_1">1.1 Identification</A></H2>
<P>This software test plan provides detailed tests that are used to
evaluate the stability of the Common UNIX Printing System (&quot;CUPS&quot;)
Version 1.1. </P>
evaluate the stability and compliance of the Common UNIX Printing
System (&quot;CUPS&quot;) Version 1.1. </P>
<H2><A NAME="1_2">1.2 System Overview</A></H2>
<P>CUPS provides a portable printing layer for UNIX&reg;-based operating
systems. It has been developed by <A HREF="http://www.easysw.com">Easy
@@ -76,8 +92,9 @@ EPSON printers are included that use these filters. </P>
<UL>
<LI>1 - Scope</LI>
<LI>2 - References</LI>
<LI>3 - Local Tests</LI>
<LI>4 - Remote Tests</LI>
<LI>3 - Test Procedure</LI>
<LI>4 - IPP Compliance Tests</LI>
<LI>5 - Command Tests</LI>
<LI>A - Glossary</LI>
</UL>
<H1><A NAME="2">2 References</A></H1>
@@ -121,10 +138,81 @@ Transfer Protocol -- HTTP/1.1</A></LI>
<LI><A HREF="http://www.ietf.org/rfc/rfc2617.txt">RFC 2617, HTTP
Authentication: Basic and Digest Access</A> Authentication </LI>
</UL>
<H1><A NAME="3">3 Local Tests</A></H1>
<H1><A NAME="4">4 Remote Tests</A></H1>
<H1 TYPE="A" VALUE="1"><A NAME="5">A Glossary</A></H1>
<H2><A NAME="5_1">A.1 Terms</A></H2>
<H1><A NAME="3">3 Test Procedure</A></H1>
<P>The test software and data files are located in the <VAR>test</VAR>
subdirectory of the source distribution. A script is provided to
compile the <CODE>ipptest</CODE> program and run all of the tests that
follow, producing a success/fail report. </P>
<P>The <CODE>test</CODE> target of the top-level makefile can be used
to run this script: </P>
<UL>
<PRE>
make test
</PRE>
</UL>
<P>or you can run the test script directly: </P>
<UL>
<PRE>
cd test
./run-stp-tests
</PRE>
</UL>
<P>A Software Test Report is stored in HTML and PDF files that are
generated using the <A HREF="http://www.easysw.com/htmldoc">HTMLDOC</A>
software. </P>
<H1><A NAME="4">4 IPP Compliance Tests</A></H1>
<P>This section describes the tests used to validate the IPP standards
compliance of the CUPS server. </P>
<H2><A NAME="4_1">4.1 Request Tests</A></H2>
<P>These tests verify that the CUPS scheduler only accepts valid IPP
requests that start with the <CODE>attributes-charset</CODE> and <CODE>
attributes-natural-language</CODE> attributes and also contain a <CODE>
printer-uri</CODE> or <CODE>job-uri</CODE> attribute. </P>
<P>It also verifies that the CUPS scheduler always responds with <CODE>
attributes-charset</CODE> and <CODE>attributes-natural-language</CODE>
attributes, using default values if they are not provided by the
client. </P>
<H2><A NAME="4_2">4.2 CUPS Printer Operation Tests</A></H2>
<P>These tests verify that the CUPS printer operations are supported
and function properly. Two printers called <CODE>Test1</CODE> and <CODE>
Test2</CODE> are created, one as a PostScript printer and one as a
raster printer. </P>
<H2><A NAME="4_3">4.3 Job Operation Tests</A></H2>
<P>These test verify that the CUPS scheduler accepts print jobs for all
supported file formats and that the <CODE>cancel-job</CODE>, <CODE>
hold-job</CODE>, and <CODE>resume-job</CODE> operations work. </P>
<H1><A NAME="5">5 Command Tests</A></H1>
<P>This section describes the tests used to validate the Berkeley and
System V commands included with CUPS. </P>
<H2><A NAME="5_1">5.1 lpadmin</A></H2>
<P>This test verifies that printers can be added, modified, and
defaulted using the <CODE>lpadmin</CODE> command. </P>
<H2><A NAME="5_2">5.2 lpc</A></H2>
<P>This test verifies that the <CODE>lpc</CODE> command can show the
current status of all print queues. </P>
<H2><A NAME="5_3">5.3 lpq</A></H2>
<P>This test verifies that the <CODE>lpq</CODE> command lists any jobs
in the queue. </P>
<H2><A NAME="5_4">5.4 lpstat</A></H2>
<P>This test verifies that the <CODE>lpstat</CODE> command works with
all reports using the &quot;<CODE>-t</CODE>&quot; option. </P>
<H2><A NAME="5_5">5.5 lp</A></H2>
<P>This test verifies that the <CODE>lp</CODE> command works with both
the default destination and a specific destination. </P>
<H2><A NAME="5_6">5.6 lpr</A></H2>
<P>This test verifies that the <CODE>lpr</CODE> command works with both
the default destination and a specific destination. </P>
<H2><A NAME="5_7">5.7 lprm</A></H2>
<P>This test verifies that the <CODE>lprm</CODE> command can properly
cancel a job. </P>
<H2><A NAME="5_8">5.8 cancel</A></H2>
<P>This test verifies that the <CODE>cancel</CODE> command can properly
cancel a job or all jobs. </P>
<H2><A NAME="5_9">5.9 lpinfo</A></H2>
<P>This test verifies that the <CODE>lpinfo</CODE> command returns a
list of available printer drivers and devices. </P>
<H1 TYPE="A" VALUE="1"><A NAME="6">A Glossary</A></H1>
<H2><A NAME="6_1">A.1 Terms</A></H2>
<DL>
<DT>C </DT>
<DD>A computer language. </DD>
@@ -137,7 +225,7 @@ Authentication: Basic and Digest Access</A> Authentication </LI>
<DT>socket </DT>
<DD>A two-way network communications channel. </DD>
</DL>
<H2><A NAME="5_2">A.2 Acronyms</A></H2>
<H2><A NAME="6_2">A.2 Acronyms</A></H2>
<DL>
<DT>ASCII </DT>
<DD>American Standard Code for Information Interchange </DD>
BIN
Ver Arquivo
Arquivo binário não exibido.
+105 -8
Ver Arquivo
@@ -1,10 +1,10 @@
<HTML>
<HEAD>
<META NAME="Description" CONTENT="Common UNIX Printing System Software Test Plan">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-STP-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>DRAFT - CUPS Software Test Plan</TITLE>
<TITLE>CUPS Software Test Plan</TITLE>
</HEAD>
<BODY>
@@ -12,8 +12,9 @@
<H2>Identification</H2>
<P>This software test plan provides detailed tests that are used to evaluate
the stability of the Common UNIX Printing System ("CUPS") Version 1.1.
<P>This software test plan provides detailed tests that are used
to evaluate the stability and compliance of the Common UNIX
Printing System ("CUPS") Version 1.1.
<EMBED SRC="system-overview.shtml">
@@ -24,22 +25,118 @@ the stability of the Common UNIX Printing System ("CUPS") Version 1.1.
<UL>
<LI>1 - Scope</LI>
<LI>2 - References</LI>
<LI>3 - Local Tests</LI>
<LI>4 - Remote Tests</LI>
<LI>3 - Test Procedure</LI>
<LI>4 - IPP Compliance Tests</LI>
<LI>5 - Command Tests</LI>
<LI>A - Glossary</LI>
</UL>
<EMBED SRC="references.shtml">
<H1>Local Tests</H1>
<H1>Test Procedure</H1>
<P>The test software and data files are located in the <VAR>test</VAR>
subdirectory of the source distribution. A script is provided to compile
the <CODE>ipptest</CODE> program and run all of the tests that follow,
producing a success/fail report.
<P>The <CODE>test</CODE> target of the top-level makefile can be used to
run this script:
<UL><PRE>
make test
</PRE></UL>
<H1>Remote Tests</H1>
<P>or you can run the test script directly:
<UL><PRE>
cd test
./run-stp-tests
</PRE></UL>
<P>A Software Test Report is stored in HTML and PDF files that
are generated using the
<A HREF="http://www.easysw.com/htmldoc">HTMLDOC</A> software.
<H1>IPP Compliance Tests</H1>
<P>This section describes the tests used to validate the IPP
standards compliance of the CUPS server.
<H2>Request Tests</H2>
<P>These tests verify that the CUPS scheduler only accepts valid
IPP requests that start with the <CODE>attributes-charset</CODE>
and <CODE>attributes-natural-language</CODE> attributes and also
contain a <CODE>printer-uri</CODE> or <CODE>job-uri</CODE> attribute.
<P>It also verifies that the CUPS scheduler always responds with
<CODE>attributes-charset</CODE> and
<CODE>attributes-natural-language</CODE> attributes, using
default values if they are not provided by the client.
<H2>CUPS Printer Operation Tests</H2>
<P>These tests verify that the CUPS printer operations are supported
and function properly. Two printers called <CODE>Test1</CODE> and
<CODE>Test2</CODE> are created, one as a PostScript printer and one
as a raster printer.
<H2>Job Operation Tests</H2>
<P>These test verify that the CUPS scheduler accepts print jobs for
all supported file formats and that the <CODE>cancel-job</CODE>,
<CODE>hold-job</CODE>, and <CODE>resume-job</CODE> operations work.
<H1>Command Tests</H1>
<P>This section describes the tests used to validate the
Berkeley and System V commands included with CUPS.
<H2>lpadmin</H2>
<P>This test verifies that printers can be added, modified, and
defaulted using the <CODE>lpadmin</CODE> command.
<H2>lpc</H2>
<P>This test verifies that the <CODE>lpc</CODE> command can show
the current status of all print queues.
<H2>lpq</H2>
<P>This test verifies that the <CODE>lpq</CODE> command lists
any jobs in the queue.
<H2>lpstat</H2>
<P>This test verifies that the <CODE>lpstat</CODE> command works
with all reports using the "<CODE>-t</CODE>" option.
<H2>lp</H2>
<P>This test verifies that the <CODE>lp</CODE> command works
with both the default destination and a specific destination.
<H2>lpr</H2>
<P>This test verifies that the <CODE>lpr</CODE> command works
with both the default destination and a specific destination.
<H2>lprm</H2>
<P>This test verifies that the <CODE>lprm</CODE> command can
properly cancel a job.
<H2>cancel</H2>
<P>This test verifies that the <CODE>cancel</CODE> command can
properly cancel a job or all jobs.
<H2>lpinfo</H2>
<P>This test verifies that the <CODE>lpinfo</CODE> command
returns a list of available printer drivers and devices.
<EMBED SRC="glossary.shtml">
+47 -56
Ver Arquivo
@@ -1,35 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE> CUPS Software Users Manual</TITLE>
<TITLE>CUPS Software Users Manual</TITLE>
<META NAME="author" CONTENT="Easy Software Products">
<META NAME="copyright" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="docnumber" CONTENT="CUPS-SUM-1.1.6">
<META NAME="docnumber" CONTENT="CUPS-SUM-1.1.8">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<STYLE><!--
BODY { font-family: serif; font-size: 11.0pt }
H1 { font-family: sans-serif; font-size: 20.0pt }
H2 { font-family: sans-serif; font-size: 17.0pt }
H3 { font-family: sans-serif; font-size: 14.0pt }
H4 { font-family: sans-serif; font-size: 11.0pt }
H5 { font-family: sans-serif; font-size: 9.0pt }
H6 { font-family: sans-serif; font-size: 8.0pt }
SUB { font-size: 8.0pt }
SUP { font-size: 8.0pt }
PRE { font-size: 9.0pt }
<STYLE TYPE="text/css"><!--
BODY { font-family: serif }
H1 { font-family: sans-serif }
H2 { font-family: sans-serif }
H3 { font-family: sans-serif }
H4 { font-family: sans-serif }
H5 { font-family: sans-serif }
H6 { font-family: sans-serif }
SUB { font-size: smaller }
SUP { font-size: smaller }
PRE { font-family: monospace }
--></STYLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="100%"><BR>
<H1> CUPS Software Users Manual</H1></A><BR>
CUPS-SUM-1.1.6<BR>
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="431" HEIGHT="511"><BR>
<H1>CUPS Software Users Manual</H1></A><BR>
CUPS-SUM-1.1.8<BR>
Easy Software Products<BR>
Copyright 1997-2001, All Rights Reserved<BR>
</CENTER>
<HR>
<H1 ALIGN="CENTER"><A NAME="CONTENTS">Table of Contents</A></H1>
<BR></BR>
<BR></BR><B><A HREF="#1">Preface</A></B>
<BR>
<BR><B><A HREF="#1">Preface</A></B>
<UL>
<LI><A HREF="#1_1">System Overview</A></LI>
<LI><A HREF="#1_2">Document Overview</A></LI>
@@ -125,7 +125,7 @@ Copyright 1997-2001, All Rights Reserved<BR>
<HR>
<H1 ALIGN="RIGHT"><A NAME="1">Preface</A></H1>
<P>This software users manual describes how to use the Common UNIX
Printing System<SUP>TM</SUP> (&quot;CUPS<SUP>TM</SUP>&quot;) Version 1.1.6. </P>
Printing System<SUP>TM</SUP> (&quot;CUPS<SUP>TM</SUP>&quot;) Version 1.1.8. </P>
<H2><A NAME="1_1">System Overview</A></H2>
<P>CUPS provides a portable printing layer for UNIX&reg;-based operating
systems. It has been developed by <A HREF="http://www.easysw.com">Easy
@@ -144,7 +144,6 @@ are used to support non-PostScript printers. Sample drivers for HP and
EPSON printers are included that use these filters. </P>
<!-- NEED 2in -->
</!-->
<H2><A NAME="1_2">Document Overview</A></H2>
<P>This software users manual is organized into the following sections:</P>
<UL>
@@ -163,12 +162,12 @@ and their meanings and uses are explained below:
<TR><TH>Example</TH><TD>&nbsp;&nbsp;&nbsp;</TD><TH>Description</TH></TR>
<TR><TD>&nbsp;</TD></TR>
<TR VALIGN="TOP"><TD><CODE>lpstat</CODE>
<BR></BR><CODE> lpstat(1)</CODE></TD><TD>&nbsp;&nbsp;&nbsp;</TD><TD>The names of
commands; the first mention of a command or function in a chapter is
followed by a manual page section number.</TD></TR>
<BR><CODE> lpstat(1)</CODE></TD><TD>&nbsp;&nbsp;&nbsp;</TD><TD>The names of commands;
the first mention of a command or function in a chapter is followed by
a manual page section number.</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR VALIGN="TOP"><TD><VAR>/var</VAR>
<BR></BR><VAR> /usr/share/cups/data/testprint.ps</VAR></TD><TD>&nbsp;&nbsp;&nbsp;</TD><TD>
<BR><VAR> /usr/share/cups/data/testprint.ps</VAR></TD><TD>&nbsp;&nbsp;&nbsp;</TD><TD>
File and directory names.</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR VALIGN="TOP"><TD NOWRAP><TT>Request ID is Printer-123</TT></TD><TD>
@@ -184,20 +183,20 @@ written using the period (.) to indicate the decimal point.</TD></TR>
</CENTER>
<!-- NEED 3in -->
</!--></P>
</P>
<H2><A NAME="1_4">Abbreviations</A></H2>
The following abbreviations are used throughout this manual:
<UL>
<DL>
<DT>kb </DT>
<DD>Kilobytes, or 1024 bytes
<BR></BR>&nbsp; </DD>
<BR>&nbsp; </DD>
<DT>Mb </DT>
<DD>Megabytes, or 1048576 bytes
<BR></BR>&nbsp; </DD>
<BR>&nbsp; </DD>
<DT>Gb </DT>
<DD>Gigabytes, or 1073741824 bytes
<BR></BR>&nbsp; </DD>
<BR>&nbsp; </DD>
</DL>
</UL>
<H2><A NAME="1_5">Other References</A></H2>
@@ -205,11 +204,11 @@ written using the period (.) to indicate the decimal point.</TD></TR>
<DL>
<DT>CUPS Software Administrators Manual </DT>
<DD>An administration guide for the CUPS software.
<BR></BR>&nbsp; </DD>
<BR>&nbsp; </DD>
<DT>CUPS Software Programmers Manual </DT>
<DD>A programmer guide for interfacing with and/or extending the CUPS
software.
<BR></BR>&nbsp; </DD>
<BR>&nbsp; </DD>
</DL>
</UL>
<H1 ALIGN="RIGHT"><A NAME="OVERVIEW">1 - Printing System Overview</A></H1>
@@ -394,7 +393,6 @@ Collate=True</CODE> option to get collated copies : </P>
</UL>
<!-- NEED 3in -->
</!-->
<H2><A NAME="3_5">Checking the Printer Status from the Command-Line</A></H2>
<P>The <CODE>lpstat</CODE> command can be used to check for jobs that
you have submitted for printing: </P>
@@ -416,7 +414,6 @@ printer DeskJet now printing DeskJet-1.
</UL>
<!-- NEED 2in -->
</!-->
<P>Use the <CODE>-o</CODE> and <CODE>-p</CODE> options together to show
the jobs and the printers: </P>
<UL>
@@ -468,7 +465,6 @@ to print in landscape orientation: </P>
</UL>
<!-- NEED 2in -->
</!-->
<H3><A NAME="4_1_2">Selecting the Media Size, Type, and Source</A></H3>
<P>The <CODE>-o media=xyz</CODE> option sets the media size, type,
and/or source: </P>
@@ -482,7 +478,6 @@ and/or source: </P>
</UL>
<!-- NEED 3in -->
</!-->
<P>The available media sizes, types, and sources depend on the printer,
but most support the following options (case is not significant): </P>
<UL>
@@ -730,7 +725,6 @@ printed image, much like the tint control on your television: </P>
</UL>
<!-- NEED 3in -->
</!-->
<P>The <CODE>value</CODE> argument is a number from -360 to 360 and
represents the color hue rotation. The following table summarizes the
change you'll see with different colors:
@@ -761,7 +755,7 @@ from 0 to 200. A color saturation of 0 produces a black-and-white
print, while a value of 200 will make the colors extremely intense. </P>
<P>The default saturation is 100.
<!-- NEED 4in -->
</!--></P>
</P>
<H2><A NAME="4_6">HP-GL/2 Options</A></H2>
<P>The following options apply to HP-GL/2 files. </P>
<H3><A NAME="4_6_1">Printing in Black</A></H3>
@@ -924,13 +918,13 @@ deleted with the <CODE>lpadmin(8)</CODE> command by the administrator. </P>
<H1 ALIGN="RIGHT"><A NAME="LICENSE">A - Software License Agreement</A></H1>
<H2 ALIGN="CENTER"><A NAME="6_1">Common UNIX Printing System License
Agreement</A></H2>
<P ALIGN="CENTER">Copyright 1997-2000 by Easy Software Products
<BR></BR> 44141 AIRPORT VIEW DR STE 204
<BR></BR> HOLLYWOOD, MARYLAND 20636-3111 USA
<BR></BR>
<BR></BR> Voice: +1.301.373.9603
<BR></BR> Email: <A HREF="mailto:cups-info@cups.org">cups-info@cups.org</A>
<BR></BR> WWW: <A HREF="http://www.cups.org">http://www.cups.org</A></P>
<P ALIGN="CENTER">Copyright 1997-2001 by Easy Software Products
<BR> 44141 AIRPORT VIEW DR STE 204
<BR> HOLLYWOOD, MARYLAND 20636-3111 USA
<BR>
<BR> Voice: +1.301.373.9600
<BR> Email: <A HREF="mailto:cups-info@cups.org">cups-info@cups.org</A>
<BR> WWW: <A HREF="http://www.cups.org">http://www.cups.org</A></P>
<H3><A NAME="6_1_1">Introduction</A></H3>
<P>The Common UNIX Printing System<SUP>TM</SUP>, (&quot;CUPS<SUP>TM</SUP>&quot;),
is provided under the GNU General Public License (&quot;GPL&quot;) and GNU
@@ -980,19 +974,19 @@ the address shown above. </P>
utilizes the GNU GhostScript 5.50 core to convert PostScript files into
a stream of raster images. For binary distribution licensing of this
software, please contact: <BLOCKQUOTE> Miles Jones
<BR></BR> Director of Marketing
<BR></BR> Artifex Software Inc.
<BR></BR> 454 Las Gallinas Ave., Suite 108
<BR></BR> San Rafael, CA 94903 USA
<BR></BR> Voice: +1.415.492.9861
<BR></BR> Fax: +1.415.492.9862
<BR></BR> EMail: <A HREF="mailto:info@arsoft.com">info@arsoft.com</A></BLOCKQUOTE>
<BR> Director of Marketing
<BR> Artifex Software Inc.
<BR> 454 Las Gallinas Ave., Suite 108
<BR> San Rafael, CA 94903 USA
<BR> Voice: +1.415.492.9861
<BR> Fax: +1.415.492.9862
<BR> EMail: <A HREF="mailto:info@arsoft.com">info@arsoft.com</A></BLOCKQUOTE>
</P>
<P>The &quot;pdftops&quot; filter is based on the Xpdf 0.90 software. For binary
distribution licensing of this software, please contact: <BLOCKQUOTE>
Derek B. Noonburg
<BR></BR> Email: <A HREF="mailto:derekn@foolabs.com">derekn@foolabs.com</A>
<BR></BR> WWW: <A HREF="http://www.foolabs.com/xpdf/">
<BR> Email: <A HREF="mailto:derekn@foolabs.com">derekn@foolabs.com</A>
<BR> WWW: <A HREF="http://www.foolabs.com/xpdf/">
http://www.foolabs.com/xpdf/</A></BLOCKQUOTE></P>
<H3><A NAME="6_1_4">Support</A></H3>
<P>Easy Software Products sells software support for CUPS as well as a
@@ -1005,7 +999,6 @@ find out more at our web site: </P>
</UL>
<!-- NEW PAGE -->
</!-->
<H2><A NAME="6_2">GNU GENERAL PUBLIC LICENSE</A></H2>
<P>Version 2, June 1991 </P>
<PRE>
@@ -1060,8 +1053,7 @@ patent must be licensed for everyone's free use or not licensed at all. </P>
<P>The precise terms and conditions for copying, distribution and
modification follow. </P>
<H4>GNU GENERAL PUBLIC LICENSE
<BR></BR> TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
MODIFICATION</H4>
<BR> TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</H4>
<OL START="0">
<LI>This License applies to any program or other work which contains a
notice placed by the copyright holder saying it may be distributed
@@ -1264,7 +1256,6 @@ DAMAGES. </LI>
<H4>END OF TERMS AND CONDITIONS</H4>
<!-- NEW PAGE -->
</!-->
<H2><A NAME="6_3">GNU LIBRARY GENERAL PUBLIC LICENSE</A></H2>
<P>Version 2, June 1991 </P>
<PRE>
BIN
Ver Arquivo
Arquivo binário não exibido.
+2 -2
Ver Arquivo
@@ -2,7 +2,7 @@
<HEAD>
<META NAME="Description" CONTENT="Common UNIX Printing System Software Users Manual">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.1.6">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.1.8">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Users Manual</TITLE>
</HEAD>
@@ -11,7 +11,7 @@
<H1 ALIGN="RIGHT">Preface</H1>
<P>This software users manual describes how to use the Common UNIX Printing
System<SUP>TM</SUP> ("CUPS<SUP>TM</SUP>") Version 1.1.6.
System<SUP>TM</SUP> ("CUPS<SUP>TM</SUP>") Version 1.1.8.
<EMBED SRC="system-overview.shtml">
+6 -6
Ver Arquivo
@@ -2,11 +2,11 @@
<HTML>
<HEAD>
<TITLE> CUPS Software Version Description</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SVD-1.1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<STYLE>
<META NAME="author" CONTENT="Easy Software Products">
<META NAME="copyright" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="docnumber" CONTENT="CUPS-SVD-1.1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif; font-size: 11.0pt }
H1 { font-family: sans-serif; font-size: 20.0pt }
H2 { font-family: sans-serif; font-size: 17.0pt }
@@ -17,7 +17,7 @@ H6 { font-family: sans-serif; font-size: 8.0pt }
SUB { font-size: 8.0pt }
SUP { font-size: 8.0pt }
PRE { font-size: 9.0pt }
</STYLE>
--></STYLE>
</HEAD>
<BODY>
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="100%"><BR>
BIN
Ver Arquivo
Arquivo binário não exibido.
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SVD-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Version Description</TITLE>
+153 -53
Ver Arquivo
@@ -23,7 +23,12 @@
*
* Contents:
*
* SetCommonOptions() - Set common filter options for media size, etc.
* SetCommonOptions() - Set common filter options for media size,
* etc.
* UpdatePageVars() - Update the page variables for the
* orientation.
* WriteClassificationProlog() - Write the prolog with the classification
* and page label.
*/
/*
@@ -58,7 +63,6 @@ SetCommonOptions(int num_options, /* I - Number of options */
cups_option_t *options, /* I - Options */
int change_size) /* I - Change page size? */
{
float temp; /* Swapping variable */
ppd_file_t *ppd; /* PPD file */
ppd_size_t *pagesize; /* Current page size */
const char *val; /* Option value */
@@ -184,57 +188,7 @@ SetCommonOptions(int num_options, /* I - Number of options */
}
if (change_size)
switch (Orientation)
{
case 0 : /* Portait */
break;
case 1 : /* Landscape */
temp = PageLeft;
PageLeft = PageBottom;
PageBottom = temp;
temp = PageRight;
PageRight = PageTop;
PageTop = temp;
temp = PageWidth;
PageWidth = PageLength;
PageLength = temp;
break;
case 2 : /* Reverse Portrait */
temp = PageWidth - PageLeft;
PageLeft = PageWidth - PageRight;
PageRight = temp;
temp = PageLength - PageBottom;
PageBottom = PageLength - PageTop;
PageTop = temp;
break;
case 3 : /* Reverse Landscape */
temp = PageWidth - PageLeft;
PageLeft = PageWidth - PageRight;
PageRight = temp;
temp = PageLength - PageBottom;
PageBottom = PageLength - PageTop;
PageTop = temp;
temp = PageLeft;
PageLeft = PageBottom;
PageBottom = temp;
temp = PageRight;
PageRight = PageTop;
PageTop = temp;
temp = PageWidth;
PageWidth = PageLength;
PageLength = temp;
break;
}
UpdatePageVars();
if ((val = cupsGetOption("sides", num_options, options)) != NULL &&
strncasecmp(val, "two-", 4) == 0)
@@ -250,6 +204,152 @@ SetCommonOptions(int num_options, /* I - Number of options */
}
/*
* 'UpdatePageVars()' - Update the page variables for the orientation.
*/
void
UpdatePageVars(void)
{
float temp; /* Swapping variable */
switch (Orientation)
{
case 0 : /* Portait */
break;
case 1 : /* Landscape */
temp = PageLeft;
PageLeft = PageBottom;
PageBottom = temp;
temp = PageRight;
PageRight = PageTop;
PageTop = temp;
temp = PageWidth;
PageWidth = PageLength;
PageLength = temp;
break;
case 2 : /* Reverse Portrait */
temp = PageWidth - PageLeft;
PageLeft = PageWidth - PageRight;
PageRight = temp;
temp = PageLength - PageBottom;
PageBottom = PageLength - PageTop;
PageTop = temp;
break;
case 3 : /* Reverse Landscape */
temp = PageWidth - PageLeft;
PageLeft = PageWidth - PageRight;
PageRight = temp;
temp = PageLength - PageBottom;
PageBottom = PageLength - PageTop;
PageTop = temp;
temp = PageLeft;
PageLeft = PageBottom;
PageBottom = temp;
temp = PageRight;
PageRight = PageTop;
PageTop = temp;
temp = PageWidth;
PageWidth = PageLength;
PageLength = temp;
break;
}
}
/*
* 'WriteClassificationProlog()' - Write the prolog with the classification
* and page label.
*/
void
WriteLabelProlog(const char *label) /* I - Page label */
{
const char *classification; /* CLASSIFICATION environment variable */
/*
* First get the current classification...
*/
if ((classification = getenv("CLASSIFICATION")) == NULL)
classification = "";
if (strcmp(classification, "none") == 0)
classification = "";
/*
* If there is nothing to show, bind an empty 'write labels' procedure
* and return...
*/
if (!classification[0] && (label == NULL || !label[0]))
{
puts("/espWL{}bind def");
return;
}
/*
* Set the classification + page label string...
*/
if (strcmp(classification, "confidential") == 0)
printf("/espPL(CONFIDENTIAL");
else if (strcmp(classification, "classified") == 0)
printf("/espPL(CLASSIFIED");
else if (strcmp(classification, "secret") == 0)
printf("/espPL(SECRET");
else if (strcmp(classification, "topsecret") == 0)
printf("/espPL(TOP SECRET");
else if (strcmp(classification, "unclassified") == 0)
printf("/espPL(UNCLASSIFIED");
else
printf("/espPL(");
if (classification[0] && label)
printf(" - %s)def\n", label);
else if (label)
printf("%s)def\n", label);
else
puts(")def");
/*
* Then get a 14 point Helvetica-Bold font...
*/
puts("/espPF /Helvetica-Bold findfont 14 scalefont def");
/*
* Finally, the procedure to write the labels on the page...
*/
puts("/espWL{");
puts(" espPF setfont");
printf(" espPL stringwidth pop dup 12 add exch -0.5 mul %.0f add\n",
PageWidth * 0.5f);
puts(" 1 setgray");
printf(" dup 6 sub %.0f 3 index 20 rectfill\n", PageBottom - 2.0);
printf(" dup 6 sub %.0f 3 index 20 rectfill\n", PageTop - 18.0);
puts(" 0 setgray");
printf(" dup 6 sub %.0f 3 index 20 rectstroke\n", PageBottom - 2.0);
printf(" dup 6 sub %.0f 3 index 20 rectstroke\n", PageTop - 18.0);
printf(" dup %.0f moveto espPL show\n", PageBottom + 2.0);
printf(" %.0f moveto espPL show\n", PageTop - 14.0);
puts("pop");
puts("}bind def");
}
/*
* End of "$Id$".
*/
+3
Ver Arquivo
@@ -60,6 +60,9 @@ extern float PageLeft, /* Left margin */
extern ppd_file_t *SetCommonOptions(int num_options, cups_option_t *options,
int change_size);
extern void UpdatePageVars(void);
extern void WriteLabelProlog(const char *label);
#define WriteLabels() puts("espWL");
/*
+11
Ver Arquivo
@@ -90,6 +90,8 @@ ImageReadBMP(image_t *img, /* IO - Image */
ib_t colormap[256][4]; /* Colormap */
(void)secondary;
/*
* Get the header...
*/
@@ -119,6 +121,15 @@ ImageReadBMP(image_t *img, /* IO - Image */
colors_used = read_dword(fp);
colors_important = read_dword(fp);
/*
* Make sure the resolution info is valid...
*/
if (img->xppi == 0)
img->xppi = 128;
if (img->yppi == 0)
img->yppi = 128;
fprintf(stderr, "info_size = %d, xsize = %d, ysize = %d, planes = %d, depth = %d\n",
info_size, img->xsize, img->ysize, planes, depth);
fprintf(stderr, "compression = %d, image_size = %d, xppi = %d, yppi = %d\n",
+8 -1
Ver Arquivo
@@ -320,7 +320,8 @@ ImageRGBToCMYK(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count)/* I - Number of pixels */
{
int c, m, y, k; /* CMYK values */
int c, m, y, k, /* CMYK values */
km; /* Maximum K value */
int cc, cm, cy; /* Calibrated CMY values */
@@ -332,6 +333,9 @@ ImageRGBToCMYK(const ib_t *in, /* I - Input pixels */
y = 255 - *in++;
k = min(c, min(m, y));
if ((km = max(c, max(m, y))) > k)
k = k * k * k / (km * km);
c -= k;
m -= k;
y -= k;
@@ -379,6 +383,9 @@ ImageRGBToCMYK(const ib_t *in, /* I - Input pixels */
y = 255 - *in++;
k = min(c, min(m, y));
if ((km = max(c, max(m, y))) > k)
k = k * k * k / (km * km);
c -= k;
m -= k;
y -= k;
+33 -6
Ver Arquivo
@@ -96,22 +96,49 @@ ImageReadTIFF(image_t *img, /* IO - Image */
if ((tif = TIFFFdOpen(fileno(fp), "", "r")) == NULL)
{
fputs("ERROR: TIFFFdOpen() failed!\n", stderr);
fclose(fp);
return (-1);
}
if (!TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width) ||
!TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height) ||
!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric) ||
!TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression) ||
!TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samples) ||
!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bits))
if (!TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width))
{
fputs("ERROR: No image width tag in the file!\n", stderr);
TIFFClose(tif);
fclose(fp);
return (-1);
}
if (!TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height))
{
fputs("ERROR: No image height tag in the file!\n", stderr);
TIFFClose(tif);
fclose(fp);
return (-1);
}
if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric))
{
fputs("ERROR: No photometric tag in the file!\n", stderr);
TIFFClose(tif);
fclose(fp);
return (-1);
}
if (!TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression))
{
fputs("ERROR: No compression tag in the file!\n", stderr);
TIFFClose(tif);
fclose(fp);
return (-1);
}
if (!TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samples))
samples = 1;
if (!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bits))
bits = 1;
/*
* Get the image orientation...
*/

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