Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 289f19a5d3 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.0.2@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
179 arquivos alterados com 9659 adições e 8643 exclusões
+98
Ver Arquivo
@@ -0,0 +1,98 @@
CHANGES.txt - 11/04/1999
------------------------
CHANGES IN CUPS v1.0.2
- The HP-GL/2 filter didn't always scale the output
correctly.
- The HP-GL/2 filter now supports changing the page size
automatically when the "fitplot" option is not used.
- The cancel-job operation was expecting a resource name
of the form "/job/#" instead of "/jobs/#"; this
prevented the cancel and lprm commands from working.
- The backends didn't log pages when files were printed
using the "-oraw" option.
- The authorization code did not work with the Slackware
long shadow password package because its crypt() can
return NULL.
- The chunking code didn't work for reading the response
of a POST request.
- cupsGetPPD() now does authentication as needed.
- The N-up code in the PostScript filter didn't work
with some printers (grestoreall would restore the
default blank page and device settings).
- The N-up code in the PostScript filter didn't scale
the pages to fit within the imageable area of the
page.
- Wasn't doing an fchown() on the request files. This
caused problems when the default root account group
and CUPS group were not the same.
CHANGES IN CUPS v1.0.1
- Documentation updates.
- Fixed a bunch of possible buffer-overflow conditions.
- The scheduler now supports authentication using PAM.
- Updated the Italian message file.
- httpEncode64() didn't add an extra "=" if there was
only one byte in the last three-byte group.
- Now drop any trailing character set from the locale
string (e.g. "en_US.ISO_8859-1" becomes "en_US")
- Fixed "timezone" vs "tm_gmtoff" usage for BSD-based
operating systems.
- Updated IPP security so that "get" operations can be
done from any resource name; this allows the CGIs to
work with printer authentication enabled so long as
authentication isn't turned on for the whole "site".
- The IPP code didn't properly handle the "unsupported"
group; this caused problems with the HP JetDirect since
it doesn't seem to support the "copies" attribute.
- The HTTP chunking code was missing a CR LF pair at the
end of a 0-length chunk.
- The httpSeparate() function didn't handle embedded
usernames and passwords in the URI properly.
- Doing "lpadmin -p printer -E" didn't restart printing
if there were pending jobs.
- The cancel-job operation now requires either a
requesting-user-name attribute or an authenticated
username.
- The add-printer code did not report errors if the
interface script or PPD file could not be renamed.
- Request files are now created without world read
permissions.
- Added a cupsLastError() function to the CUPS API to
retrieve the IPP error code from the last request.
- Options are now case-insensitive.
- The lpq command now provides 10 characters for the
username instead of the original (Berkeley standard)
7.
- The cancel command needed a local CUPS server to work
(or the appropriate ServerName in cupsd.conf)
- The cancel and lprm commands didn't report the IPP
error if the job could not be cancelled.
- The lp and lpr commands didn't intercept SIGTERM to
remove temporary files when printing from stdin.
- The lp and lpr commands didn't report the IPP error if
the job could not be printed.
+25
Ver Arquivo
@@ -0,0 +1,25 @@
CREDITS.txt - 10/01/1999
------------------------
Few projects are completed by one person, and CUPS is no exception. We'd
like to thank the following individuals for their contributions:
Nathaniel Barbour - Lots of testing and feedback.
N. Becker - setsid().
Jean-Eric Cuendet - GhostScript filters for CUPS.
Van Dang - HTTP and IPP policeman.
Dr. ZP Han - setgid()/setuid().
Guy Harris - *BSD shared libraries and lots of other fixes.
Wang Jian - CUPS RPM corrections.
Roderick Johnstone - Beta tester of the millenium.
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
Mark Lawrence - Microsoft interoperability testing.
Jason McMullan - Original CUPS RPM distributions.
Wes Morgan - *BSD fixes.
Ulrich Oldendorf - German locale.
Petter Reinholdtsen - HP-UX compiler stuff.
Stuart Stevens - HP JetDirect IPP information.
Kiko - Bug fixes.
If I've missed someone, please let me know by sending an email to
"mike@easysw.com".
-332
Ver Arquivo
@@ -1,332 +0,0 @@
Common UNIX Printing System License Agreement
Copyright 1997-1999 by Easy Software Products
44141 AIRPORT VIEW DR STE 204
HOLLYWOOD, MARYLAND 20636-3111 USA
Voice: +1.301.373.9603
Email: cups-info@cups.org
WWW: http://www.cups.org
Introduction
The Common UNIX Printing SystemTM, or CUPSTM, is provided under the GNU
General Public License, Version 2. A copy of this license follows this
introduction.
For those not familiar with the GNU General Public License, the license
basically allows you to:
* Use the CUPS software at no charge.
* Distribute verbatim copies of the software in source or binary form.
* Sell verbatim copies of the software for a media fee, or sell support
for the software.
* Distribute or sell printer drivers and filters that use the CUPS API so
long as source code is made available under the GPL.
What this license does not allow you to do is make changes or add features
to CUPS and then sell a binary distribution without source code. You have to
provide source for any new drivers, changes, or additions to the software,
and all code must be provided under the GPL.
Also, since we have trademarked the Common UNIX Printing System, CUPS, and
CUPS logo, you may not release a derivative product using those names
without permission from Easy Software Products.
Binary Distribution Rights
Easy Software Products also sells rights to the CUPS source code under a
binary distribution license for vendors that are unable to release source
code for their drivers or additions and modifications to CUPS under the GPL.
For pricing information please contact us at the address shown above.
The Common UNIX Printing System utilizes GNU GhostScript 4.03 to convert
PostScript files into a stream of raster images. For binary distribution
licensing of this software, please contact:
Miles Jones
Director of Marketing
Artifex Software Inc.
454 Las Gallinas Ave., Suite 108
San Rafael, CA 94903 USA
Voice: +1.415.492.9861
Fax: +1.415.492.9862
EMail: info@arsoft.com
Support
Easy Software Products sells software support for distributors and resellers
of CUPS. Support for users of CUPS is available from Easy Software Products
through our ESP Print software.
Trademarks
The Common UNIX Printing System, CUPS, and the CUPS logo are the trademark
property of Easy Software Products. Any derivative of this software may not
use any of these trademarks without the expressed written consent of Easy
Software Products.
GNU General Public License
Version 2, June 1991
Copyright 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to
share and change it. By contrast, the GNU General Public License is intended
to guarantee your freedom to share and change free software--to make sure
the software is free for all its users. This General Public License applies
to most of the Free Software Foundation's software and to any other program
whose authors commit to using it. (Some other Free Software Foundation
software is covered by the GNU Library General Public License instead.) You
can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These
restrictions translate to certain responsibilities for you if you distribute
copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must give the recipients all the rights that you have. You
must make sure that they, too, receive or can get the source code. And you
must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its
recipients to know that what they have is not the original, so that any
problems introduced by others will not reflect on the original authors'
reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will
individually obtain patent licenses, in effect making the program
proprietary. To prevent this, we have made it clear that any patent must be
licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
1. This License applies to any program or other work which contains a
notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of running
the Program is not restricted, and the output from the Program is
covered only if its contents constitute a work based on the Program
(independent of having been made by running the Program). Whether that
is true depends on what the Program does.
2. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously
and appropriately publish on each copy an appropriate copyright notice
and disclaimer of warranty; keep intact all the notices that refer to
this License and to the absence of any warranty; and give any other
recipients of the Program a copy of this License along with the
Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
3. You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that
you also meet all of these conditions:
a. You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b. You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c. if the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive
use in the most ordinary way, to print or display an announcement
including an appropriate copyright notice and a notice that there
is no warranty (or else, saying that you provide a warranty) and
that users may redistribute the program under these conditions,
and telling the user how to view a copy of this License.
(Exception: if the Program itself is interactive but does not
normally print such an announcement, your work based on the
Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of a
storage or distribution medium does not bring the other work under the
scope of this License.
4. You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a. Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software
interchange; or,
b. Accompany it with a written offer, valid for at least three years,
to give any third party, for a charge no more than your cost of
physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c. Accompany it with the information you received as to the offer to
distribute corresponding source code. (This alternative is allowed
only for noncommercial distribution and only if you received the
program in object code or executable form with such an offer, in
accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to control
compilation and installation of the executable. However, as a special
exception, the source code distributed need not include anything that
is normally distributed (in either source or binary form) with the
major components (compiler, kernel, and so on) of the operating system
on which the executable runs, unless that component itself accompanies
the executable.
If distribution of executable or object code is made by offering access
to copy from a designated place, then offering equivalent access to
copy the source code from the same place counts as distribution of the
source code, even though third parties are not compelled to copy the
source along with the object code.
5. You may not copy, modify, sublicense, or distribute the Program except
as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense or distribute the Program is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such parties
remain in full compliance.
6. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute
the Program or its derivative works. These actions are prohibited by
law if you do not accept this License. Therefore, by modifying or
distributing the Program (or any work based on the Program), you
indicate your acceptance of this License to do so, and all its terms
and conditions for copying, distributing or modifying the Program or
works based on it.
7. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further restrictions
on the recipients' exercise of the rights granted herein. You are not
responsible for enforcing compliance by third parties to this License.
8. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent license
would not permit royalty-free redistribution of the Program by all
those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain
entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made generous
contributions to the wide range of software distributed through that
system in reliance on consistent application of that system; it is up
to the author/donor to decide if he or she is willing to distribute
software through any other system and a licensee cannot impose that
choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
9. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original
copyright holder who places the Program under this License may add an
explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among countries
not thus excluded. In such case, this License incorporates the
limitation as if written in the body of this License.
10. The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Program does not specify a version
number of this License, you may choose any version ever published by
the Free Software Foundation.
11. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the
author to ask for permission. For software which is copyrighted by the
Free Software Foundation, write to the Free Software Foundation; we
sometimes make exceptions for this. Our decision will be guided by the
two goals of preserving the free status of all derivatives of our free
software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
+3 -2
Ver Arquivo
@@ -37,13 +37,13 @@ DSO = @DSO@
HTMLDOC = @HTMLDOC@
LN = /bin/ln -sf
MKDIR = @MKDIR@ -p
MV = @MV@
NROFF = @NROFF@
PACK = @PACK@
RANLIB = @RANLIB@
RM = @RM@ -f
SED = @SED@
SHELL = /bin/sh
SMBCLIENT = @SMBCLIENT@
#
# Libraries...
@@ -69,7 +69,8 @@ CFLAGS = @CFLAGS@ $(OPTIM) -I.. $(OPTIONS)
DSOLIBS = @DSOLIBS@
IMGLIBS = @IMGLIBS@ -lm
LDFLAGS = @LDFLAGS@ $(OPTIM)
LIBS = -L../cups -lcups @LIBS@
LIBS = -L../cups -lcups $(NETLIBS) @LIBS@
NETLIBS = @NETLIBS@
OPTIM = @OPTIM@
OPTIONS =
-139
Ver Arquivo
@@ -1,139 +0,0 @@
<HTML>
<HEAD>
<TITLE>README - Common UNIX Printing System</TITLE>
</HEAD>
<BODY>
<H1>README - CUPS v1.0b4</H1>
<H2>Contents</H2>
<UL>
<LI><A HREF="#intro">Introduction</A>
<LI><A HREF="#require">Requirements</A>
<LI><A HREF="#use">Using CUPS</A>
<LI><A HREF="#known">Known Problems</A>
<LI><A HREF="#report">Reporting Problems</A>
<LI><A HREF="#resources">Other Resources</A>
<LI><A HREF="#legal">Legal Stuff</A>
</UL>
<H2><A NAME="intro">Introduction</A></H2>
The Common UNIX Printing System provides a portable printing layer for
UNIX&reg; operating systems. It has been developed by Easy Software
Products to promote a standard printing solution for all UNIX vendors
and users. CUPS provides the System V and Berkeley command-line
interfaces.
<P>CUPS uses the Internet Printing Protocol (IETF-IPP) as the basis
for managing print jobs and queues. The Line Printer Daemon (LPD,
RFC1179), Server Message Block (SMB), and AppSocket protocols are also
supported with reduced functionality.
<P>CUPS adds network printer browsing and PostScript Printer
Description (&quot;PPD&quot;)-based printing options to support real
world applications under UNIX.
<P>CUPS also includes a customized version of GNU GhostScript (currently
based off GNU GhostScript 4.03) and an image file RIP that can be used to
support non-PostScript printers.
<H2><A NAME="require">Requirements</A></H2>
You'll need an ANSI C compiler to build CUPS on your system. As its name
implies, CUPS is designed to run on the UNIX operating system, however
the CUPS interface library and most of the filters and backends supplied
with CUPS should also run under Microsoft&reg; Windows&reg;.
<P>For the image file filters you'll need the JPEG, PNG, TIFF, and ZLIB
libraries. CUPS will build without these, but with reduced functionality.
<P>If you make changes to the man pages you'll need GNU groff or another
nroff-like package.
<P>The documentation is formatted using the HTMLDOC software (again, not
needed unless you make changes.)
<H2><A NAME="use">Using CUPS</A></H2>
<P>Pre-compiled binary distributions are available for CUPS from our
web site at
<A HREF="http://www.cups.org/software.html">http://www.cups.org/software.html</A>.
If you'd like to build CUPS from the source, please read the Software
Administrator's Manual.
<P>Once you have installed CUPS, the Software Administrator's Manual and
Software User's Manual are excellent places to start setting things up.
<H2><A NAME="known">Known Problems</A></H2>
The following known problems are being worked on and should be resolved for
the fourth beta release of CUPS:
<UL>
<LI>Documentation is not completed.
<LI>The lpc command currently only supports the help and status
commands.
</UL>
CUPS has been built and tested on the following operating systems:
<UL>
<LI>Digital UNIX 4.0d
<LI>HP-UX 10.20 and 11.0
<LI>IRIX 5.3, 6.2, 6.5.3
<LI>Linux (RedHat 5.2)
<LI>Solaris 2.5.1, 2.6, 2.7 (aka 7)
</UL>
The client libraries and filters have been successfully compiled under
Microsoft Windows using Visual C++ 6.0.
<H2><A NAME="report">Reporting Problems</A></H2>
If you have problems, please send an email to
<A HREF="mailto:cups-support@cups.org">cups-support@cups.org</A>. Include
your operating system and version, compiler and version, and any errors
or problems you've run into.
<H2><A NAME="resources">Other Resources</A></H2>
See the CUPS web site at "http://www.cups.org" for other site links.
<P>You can subscribe to the CUPS mailing list by sending a message containing
"subscribe cups" to <A HREF="mailto:majordomo@cups.org">majordomo@cups.org</A>.
This list is provided to discuss problems, questions, and improvements to
the CUPS software. New releases of CUPS are announced to this list as well.
<H2><A NAME="legal">Legal Stuff</A></H2>
CUPS is Copyright 1993-1999 by Easy Software Products. CUPS, the CUPS logo,
and the Common UNIX Printing System are the trademark property of Easy Software
Products.
<P>CUPS is provided under the terms of the
<A HREF="LICENSE.html">GNU General Public License</A>
which is located in the files "LICENSE.html" and "LICENSE.txt". For commercial
support and "binary-only" licensing information, please contact:
<UL>
Attn: CUPS Licensing Information
<BR>Easy Software Products
<BR>44141 Airport View Drive, Suite 204
<BR>Hollywood, Maryland 20636-3111 USA
<P>Voice: +1.301.373.9603
<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>
</UL>
<P>If you're interested in a complete, commercial printing solution for UNIX,
check out our ESP Print software at <A HREF="http://www.easysw.com/print.html">
http://www.easysw.com/print.html</A>.
</BODY>
</HTML>
+158 -78
Ver Arquivo
@@ -1,120 +1,200 @@
README - CUPS v1.0b4
--------------------
CONTENTS
* Introduction
* Requirements
* Using CUPS
* Known Problems
* Reporting Problems
* Other Resources
* Legal Stuff
README - CUPS v1.0.2 - 11/04/1999
---------------------------------
INTRODUCTION
The Common UNIX Printing System provides a portable printing layer for UNIX®
operating systems. It has been developed by Easy Software Products to
promote a standard printing solution for all UNIX vendors and users. CUPS
provides the System V and Berkeley command-line interfaces.
The Common UNIX Printing System provides a portable printing layer for
UNIX® operating systems. It has been developed by Easy Software
Products to promote a standard printing solution for all UNIX vendors
and users. CUPS provides the System V and Berkeley command-line
interfaces.
CUPS uses the Internet Printing Protocol (IETF-IPP) as the basis for
managing print jobs and queues. The Line Printer Daemon (LPD, RFC1179),
Server Message Block (SMB), and AppSocket protocols are also supported with
reduced functionality.
managing print jobs and queues. The Line Printer Daemon (LPD, RFC1179)
and AppSocket protocols are also supported with reduced functionality.
CUPS adds network printer browsing and PostScript Printer Description
("PPD")-based printing options to support real world applications under
UNIX.
CUPS also includes a customized version of GNU GhostScript (currently based
off GNU GhostScript 4.03) and an image file RIP that can be used to support
non-PostScript printers.
CUPS also includes a customized version of GNU GhostScript (currently
based off GNU GhostScript 4.03) and an image file RIP that can be used
to support non-PostScript printers.
CUPS is Copyright 1993-1999 by Easy Software Products, All Rights
Reserved. CUPS is currently licensed under the terms of the GNU
General Public License. Please see the license file for details.
REQUIREMENTS
SYSTEM REQUIREMENTS
You'll need an ANSI C compiler to build CUPS on your system. As its name
implies, CUPS is designed to run on the UNIX operating system, however the
CUPS interface library and most of the filters and backends supplied with
CUPS should also run under Microsoft® Windows®.
Binary distributions require a minimum of 10MB of free disk space. We
do not recommend using CUPS on a workstation with less than 32MB of RAM
or a PC with less than 16MB of RAM.
For the image file filters you'll need the JPEG, PNG, TIFF, and ZLIB
libraries. CUPS will build without these, but with reduced functionality.
If you make changes to the man pages you'll need GNU groff or another
nroff-like package.
The documentation is formatted using the HTMLDOC software (again, not needed
unless you make changes.)
If you are installing from source you'll need an ANSI C compiler and
optionally one or more image file support libraries. Complete source
installation instructions can be found in the CUPS System
Administrator's Manual in the files "doc/sam.html" or "doc/sam.pdf".
USING CUPS
SOFTWARE REQUIREMENTS
Pre-compiled binary distributions are available for CUPS from our web site
at http://www.cups.org/software.html. If you'd like to build CUPS from the
source, please read the Software Administrator's Manual.
The following operating system software is required to install one of
the binary distributions from Easy Software Products:
Once you have installed CUPS, the Software Administrator's Manual and
Software User's Manual are excellent places to start setting things up.
- Digital UNIX (aka OSF1 aka Compaq Tru64 UNIX) 4.0 or higher
- HP-UX 10.20 or higher
- IRIX 5.3 or higher
- Linux 2.0 with glibc2 or higher
- Solaris 2.5 or higher (SPARC or Intel)
KNOWN PROBLEMS
INSTALLING CUPS
The following known problems are being worked on and should be resolved for
the fourth beta release of CUPS:
We are currently distributing CUPS binary distributions in TAR format
with installation and removal scripts generated by our ESP Package
Manager (EPM) software, which is available from:
* Documentation is not completed.
* The lpc command currently only supports the help and status commands.
http://www.easysw.com/epm
CUPS has been built and tested on the following operating systems:
WARNING: Installing CUPS will overwrite your existing printing system.
Backup files are made by the installation script and restored by the
removal script, so if you experience problems you should be able to
remove the CUPS software to restore your previous configuration.
However, Easy Software Products makes no warranty for this and will not
be liable for any lost revenues, etc.
* Digital UNIX 4.0d
* HP-UX 10.20 and 11.0
* IRIX 5.3, 6.2, 6.5.3
* Linux (RedHat 5.2)
* Solaris 2.5.1, 2.6, 2.7 (aka 7)
To install the CUPS software you will need to be logged in as root
(doing an "su" is good enough). Once you are the root user, run the
installation script with:
The client libraries and filters have been successfully compiled under
Microsoft Windows using Visual C++ 6.0.
./cups.install ENTER
After asking you a few yes/no questions the CUPS software will be
installed and the scheduler will be started automatically.
READING THE DOCUMENTATION
Once you have installed the software you can access the documentation
(and a bunch of other stuff) on-line at:
http://localhost:631
If you're having trouble getting that far, the documentation is located
in the "/usr/share/cups/doc" directory in the binary distributions, and
under the "doc" directory in the source archives.
Please read the documentation before asking questions.
SETTING UP PRINTER QUEUES
CUPS works best with PPD (PostScript Printer Description) files. In a
pinch you can also use System V style printer interface scripts.
Two sample PPD files are provided with this distribution that utilize
the PostScript and image file RIPs and the sample HP printer driver.
To add the sample DeskJet driver to the system for a printer connected
to the parallel port, use one of the following commands:
Digital UNIX:
/usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/lp0 -E
HP-UX:
/usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/c2t0d0_lp -E
IRIX:
/usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/plp -E
Linux:
/usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/par0 -E
/usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/par1 -E
/usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/par2 -E
Solaris:
/usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/bpp0 -E
/usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/ecpp0 -E
Similarly, for the sample LaserJet driver you can use "LaserJet" and
"laserjet.ppd".
For other printers and interfaces see the CUPS System Administator's
Manual included with this software.
If you're interested in a complete, commercial printing solution for
UNIX, check out our ESP Print Pro software at:
http://www.easysw.com/printpro
PRINTING FILES
CUPS provides both the System V "lp" and Berkeley "lpr" commands for
printing:
lp filename
lpr filename
Both the "lp" and "lpr" commands support printing options for the
driver:
lp -omedia=A4 -oresolution=600dpi filename
lpr -omedia=A4 -oresolution=600dpi filename
CUPS recognizes many types of images files as well as PostScript, HP-GL/2,
and text files, so you can print those files directly rather than through
an application.
If you have an application that generates output specifically for your
printer then you need to use the "-oraw" or "-l" options:
lp -oraw filename
lpr -l filename
This will prevent the filters from misinterpreting your print file.
REPORTING PROBLEMS
If you have problems, please send an email to cups-support@cups.org. Include
your operating system and version, compiler and version, and any errors or
problems you've run into.
If you have problems, please send an email to cups-support@cups.org.
Include your operating system and version, compiler and version, and
any errors or problems you've run into. If you are running a version
of Linux, be sure to provide the Linux distribution you have, too.
OTHER RESOURCES
See the CUPS web site at "http://www.cups.org" for other site links.
You can subscribe to the CUPS mailing list by sending a message containing
"subscribe cups" to majordomo@cups.org. This list is provided to discuss
problems, questions, and improvements to the CUPS software. New releases of
CUPS are announced to this list as well.
You can subscribe to the CUPS mailing list by sending a message
containing "subscribe cups" to majordomo@cups.org. This list is
provided to discuss problems, questions, and improvements to the CUPS
software. New releases of CUPS are announced to this list as well.
LEGAL STUFF
CUPS is Copyright 1993-1999 by Easy Software Products. CUPS, the CUPS logo,
and the Common UNIX Printing System are the trademark property of Easy
Software Products.
CUPS is Copyright 1993-1999 by Easy Software Products. CUPS, the CUPS
logo, and the Common UNIX Printing System are the trademark property of
Easy Software Products.
CUPS is provided under the terms of the GNU General Public License which is
located in the files "LICENSE.html" and "LICENSE.txt". For commercial
support and "binary-only" licensing information, please contact:
CUPS is provided under the terms of the GNU General Public License
which is located in the files "LICENSE.html" and "LICENSE.txt" (or the
file "cups.license" for a binary distribution.) For commercial
licensing information, please contact:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636-3111 USA
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636-3111 USA
Voice: +1.301.373.9603
Email: cups-info@cups.org
WWW: http://www.cups.org
If you're interested in a complete, commercial printing solution for UNIX,
check out our ESP Print software at http://www.easysw.com/print.html.
Voice: +1.301.373.9603
Email: cups-info@cups.org
WWW: http://www.cups.org
+12 -15
Ver Arquivo
@@ -24,8 +24,8 @@
include ../Makedefs
TARGETS = ipp lpd parallel serial smb socket
OBJS = ipp.o lpd.o parallel.o serial.o socket.o
TARGETS = betest ipp lpd parallel serial socket
OBJS = betest.o ipp.o lpd.o parallel.o serial.o socket.o
#
# Make all targets...
@@ -50,6 +50,16 @@ install:
-$(LN) ipp $(SERVERROOT)/backend/http
$(CHMOD) u+s $(SERVERROOT)/backend/lpd
#
# betest
#
betest: betest.o ../cups/$(LIBCUPS)
echo Linking $@...
$(CC) $(LDFLAGS) -o betest betest.o $(LIBS)
betest.o: ../cups/string.h ../Makedefs
#
# ipp
#
@@ -91,19 +101,6 @@ serial: serial.o ../cups/$(LIBCUPS)
serial.o: ../cups/cups.h ../Makedefs
#
# smb
#
# Note: reading through these commands is a good way to get a headache... :)
#
smb: smb.sh ../Makedefs
echo Generating $@...
$(RM) smb
sedcmd="1,\$$s/^SMBCLIENT=.\*/SMBCLIENT=`echo $(SMBCLIENT) | sed -e '1,$$s/\\//\\\\\\//g'`/" ;\
$(SED) -e "$$sedcmd" <smb.sh >smb
$(CHMOD) +x smb
#
# socket
#
+85
Ver Arquivo
@@ -0,0 +1,85 @@
/*
* "$Id$"
*
* Backend test program for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-1999 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636-3111 USA
*
* Voice: (301) 373-9603
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
* Contents:
*
* main() - Run the named backend.
*/
/*
* Include necessary headers.
*/
#include <stdio.h>
#include <stdlib.h>
#include <cups/string.h>
#include <unistd.h>
/*
* 'main()' - Run the named backend.
*
* Usage:
*
* betest device-uri job-id user title copies options [file]
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments (7 or 8) */
char *argv[]) /* I - Command-line arguments */
{
char backend[255]; /* Method in URI */
if (argc < 7 || argc > 8)
{
fputs("Usage: betest device-uri job-id user title copies options [file]\n",
stderr);
return (1);
}
/*
* Extract the method from the device-uri - that's the program we want to
* execute.
*/
if (sscanf(argv[1], "%254[^:]", backend) != 1)
{
fputs("betest: Bad device-uri - no colon!\n", stderr);
return (1);
}
/*
* Execute and return
*/
execl(backend, argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7],
NULL);
return (1);
}
/*
* End of "$Id$".
*/
+61 -23
Ver Arquivo
@@ -23,6 +23,7 @@
*
* Contents:
*
* main() - Send a file to the printer or server.
*/
/*
@@ -132,8 +133,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
request->request.op.operation_id = IPP_PRINT_JOB;
request->request.op.request_id = 1;
sprintf(uri, "%s://%s:%d%s", method, hostname, port, resource);
language = cupsLangDefault();
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
@@ -143,15 +142,21 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
"attributes-natural-language", NULL,
language != NULL ? language->language : "C");
snprintf(uri, sizeof(uri), "%s://%s:%d%s", method, hostname, port, resource);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "requesting-user-name",
fprintf(stderr, "DEBUG: printer-uri = \"%s\"\n", uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, argv[2]);
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, argv[3]);
fprintf(stderr, "DEBUG: requesting-user-name = \"%s\"\n", argv[2]);
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies", atoi(argv[4]));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
argv[3]);
fprintf(stderr, "DEBUG: job-name = \"%s\"\n", argv[3]);
/*
* Handle options on the command-line...
@@ -161,19 +166,22 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
num_options = cupsParseOptions(argv[5], 0, &options);
if (cupsGetOption("raw", num_options, options))
ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/vnd.cups-raw");
else
ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/octet-stream");
if (fp != stdin)
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies", atoi(argv[4]));
for (i = 0; i < num_options; i ++)
{
/*
* Skip the "raw" option - handled above...
*/
if (strcmp(options[i].name, "raw") == 0)
if (strcasecmp(options[i].name, "raw") == 0)
continue;
/*
@@ -217,7 +225,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else
{
if (strncmp(option, "no", 2) == 0)
if (strncasecmp(option, "no", 2) == 0)
{
option += 2;
n = 0;
@@ -248,9 +256,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
{
n2 = strtol(s + 1, &s, 0);
if (strcmp(s, "dpc") == 0)
if (strcasecmp(s, "dpc") == 0)
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_CM, n, n2);
else if (strcmp(s, "dpi") == 0)
else if (strcasecmp(s, "dpi") == 0)
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_INCH, n, n2);
else
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, option, NULL, val);
@@ -271,15 +279,20 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
httpClearFields(http);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
httpEncode64(password, username);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
if (username[0])
{
httpEncode64(password, username);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
}
if (fp != stdin)
{
sprintf(buffer, "%u", ippLength(request) + (size_t)fileinfo.st_size);
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, buffer);
}
else
httpSetField(http, HTTP_FIELD_TRANSFER_ENCODING, "chunked");
/*
* Do the request...
*/
@@ -291,12 +304,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
if (httpPost(http, resource))
if (httpPost(http, resource))
{
fputs("INFO: Unable to POST print request; retrying...\n", stderr);
sleep(10);
continue;
}
{
fputs("INFO: Unable to POST print request; retrying...\n", stderr);
sleep(10);
httpReconnect(http);
continue;
}
fputs("INFO: POST successful, sending IPP request...\n", stderr);
@@ -333,7 +346,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
}
httpWrite(http, buffer, 0);
/*
* If we are chunking the output from stdin, make sure we end up with
* a 0-length chunk at the end...
*/
if (fp == stdin)
httpWrite(http, buffer, 0);
fputs("INFO: Print file sent; checking status...\n", stderr);
@@ -349,8 +368,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
ippRead(http, response);
if (response->request.status.status_code > IPP_OK_CONFLICT)
{
ipp_attribute_t *attr;
fprintf(stderr, "ERROR: Print file was not accepted (%04x)!\n",
response->request.status.status_code);
for (attr = response->attrs; attr != NULL; attr = attr->next)
if (attr->name != NULL)
fprintf(stderr, "ERROR: attribute \"%s\"\n", attr->name);
}
else if ((job_id = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) == NULL)
fputs("INFO: Print file accepted - job ID unknown.\n", stderr);
else
@@ -360,9 +387,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else
{
response = NULL;
httpFlush(http);
fprintf(stderr, "ERROR: Print request was not accepted (%d)!\n", status);
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);
}
break;
@@ -383,7 +416,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
if (fp != stdin)
{
if (status == HTTP_OK)
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
fclose(fp);
}
/*
* Return the queue status...
+25 -10
Ver Arquivo
@@ -107,7 +107,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
int bytes; /* Number of bytes read */
if ((fp = fopen(tmpnam(filename), "w")) == NULL)
if ((fp = fopen(cupsTempFile(filename, sizeof(filename)), "w")) == NULL)
{
perror("ERROR: unable to create temporary file");
return (1);
@@ -125,7 +125,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
fclose(fp);
}
else
strcpy(filename, argv[6]);
{
strncpy(filename, argv[6], sizeof(filename) - 1);
filename[sizeof(filename) - 1] = '\0';
}
/*
* Extract the hostname and printer name from the URI...
@@ -137,8 +140,17 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Queue the job...
*/
status = lpd_queue(hostname, resource + 1, filename,
argv[2] /* user */, atoi(argv[4]) /* copies */);
if (argc > 6)
{
status = lpd_queue(hostname, resource + 1, filename,
argv[2] /* user */, atoi(argv[4]) /* copies */);
if (!status)
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
}
else
status = lpd_queue(hostname, resource + 1, filename,
argv[2] /* user */, 1);
/*
* Remove the temporary file if necessary...
@@ -175,7 +187,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
*/
va_start(ap, format);
bytes = vsprintf(buf, format, ap);
bytes = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
fprintf(stderr, "DEBUG: lpd_command %02.2x %s", buf[0], buf + 1);
@@ -308,19 +320,22 @@ lpd_queue(char *hostname, /* I - Host to connect to */
gethostname(localhost, sizeof(localhost));
localhost[31] = '\0'; /* RFC 1179, Section 7.2 - host name < 32 chars */
sprintf(control, "H%s\nP%s\n", localhost, user);
snprintf(control, sizeof(control), "H%s\nP%s\n", localhost, user);
cptr = control + strlen(control);
while (copies > 0)
{
sprintf(cptr, "ldfA%03.3d%s\n", getpid() % 1000, localhost);
snprintf(cptr, sizeof(control) - (cptr - control), "ldfA%03.3d%s\n",
getpid() % 1000, localhost);
cptr += strlen(cptr);
copies --;
}
sprintf(cptr, "UdfA%03.3d%s\nNdfA%03.3d%s\n",
getpid() % 1000, localhost,
getpid() % 1000, localhost);
snprintf(cptr, sizeof(control) - (cptr - control),
"UdfA%03.3d%s\nNdfA%03.3d%s\n",
getpid() % 1000, localhost,
getpid() % 1000, localhost);
fprintf(stderr, "DEBUG: Control file is:\n%s", control);
+30 -13
Ver Arquivo
@@ -63,6 +63,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*options; /* Pointer to options */
int port; /* Port number (not used) */
FILE *fp; /* Print file */
int copies; /* Number of copies to print */
int fd; /* Parallel device */
int error; /* Error code (if any) */
size_t nbytes, /* Number of bytes written */
@@ -83,7 +84,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
if (argc == 6)
fp = stdin;
{
fp = stdin;
copies = 1;
}
else
{
/*
@@ -95,6 +99,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
perror("ERROR: unable to open print file");
return (1);
}
copies = atoi(argv[4]);
}
/*
@@ -143,23 +149,34 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Finally, send the print file...
*/
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
while (copies > 0)
{
/*
* Write the print data to the printer...
*/
copies --;
if (write(fd, buffer, nbytes) < nbytes)
if (fp != stdin)
{
perror("ERROR: Unable to send print file to printer");
break;
fputs("PAGE: 1 1\n", stderr);
rewind(fp);
}
else
tbytes += nbytes;
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %u bytes...\n", tbytes);
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
{
/*
* Write the print data to the printer...
*/
if (write(fd, buffer, nbytes) < nbytes)
{
perror("ERROR: Unable to send print file to printer");
break;
}
else
tbytes += nbytes;
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %u bytes...\n", tbytes);
}
}
/*
+30 -13
Ver Arquivo
@@ -66,6 +66,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*ptr; /* Pointer into name or value */
int port; /* Port number (not used) */
FILE *fp; /* Print file */
int copies; /* Number of copies to print */
int fd; /* Parallel device */
int error; /* Error code (if any) */
size_t nbytes, /* Number of bytes written */
@@ -86,7 +87,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
if (argc == 6)
fp = stdin;
{
fp = stdin;
copies = 1;
}
else
{
/*
@@ -98,6 +102,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
perror("ERROR: unable to open print file");
return (1);
}
copies = atoi(argv[4]);
}
/*
@@ -261,23 +267,34 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Finally, send the print file...
*/
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
while (copies > 0)
{
/*
* Write the print data to the printer...
*/
copies --;
if (write(fd, buffer, nbytes) < nbytes)
if (fp != stdin)
{
perror("ERROR: Unable to send print file to printer");
break;
fputs("PAGE: 1 1\n", stderr);
rewind(fp);
}
else
tbytes += nbytes;
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %u bytes...\n", tbytes);
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
{
/*
* Write the print data to the printer...
*/
if (write(fd, buffer, nbytes) < nbytes)
{
perror("ERROR: Unable to send print file to printer");
break;
}
else
tbytes += nbytes;
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %u bytes...\n", tbytes);
}
}
/*
-88
Ver Arquivo
@@ -1,88 +0,0 @@
#!/bin/sh
#
# "$Id$"
#
# SMB printing script for the Common UNIX Printing System (CUPS).
#
# Copyright 1993-1999 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.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
# 44145 Airport View Drive, Suite 204
# Hollywood, Maryland 20636-3111 USA
#
# Voice: (301) 373-9603
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
#
SMBCLIENT=/usr/local/samba/bin/smbclient
#
# Usage:
#
# printer job user title copies options [filename]
#
if [ $# -lt 5 -o $# -gt 6 ]; then
# Too few or too many arguments
echo 'Usage: smb job-id user title copies options [file]' >&2
exit 1
fi
#
# If "filename" is not on the command-line, then we read the print
# data from stdin and write it to a temporary file.
#
if [ $# = 5 ]; then
# Collect all print data and put it in a temporary file...
if [ "$TMPDIR" = "" ]; then
TMPDIR=/var/tmp
fi
filename="$TMPDIR/$$.smb"
cat >$filename
else
# Use the file on the command-line...
filename="$6"
fi
#
# Take apart the URI in $0...
#
uri="$0"
host=`echo $uri | awk -F/ '{print substr($3, index($3, "@") + 1)}'`
user=`echo $uri | awk -F/ '{print substr($3, 0, index($3, "@") - 1)}'`
if [ "$user" != "" ]; then
user="-U $user"
fi
printer=`echo $uri | awk -F/ '{print $4}'`
#
# Send the file to the remote system...
#
$SMBCLIENT //$host/$printer $user -P -N <<EOF
print $filename
EOF
#
# Lastly, remove the temporary file as needed...
#
if [ $# = 5 ]; then
rm -f $filename
fi
#
# End of "$Id$".
#
+85 -63
Ver Arquivo
@@ -66,6 +66,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
username[255], /* Username info (not used) */
resource[1024]; /* Resource info (not used) */
FILE *fp; /* Print file */
int copies; /* Number of copies to print */
int port; /* Port number */
int fd; /* AppSocket */
int error; /* Error code (if any) */
@@ -93,7 +94,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
if (argc == 6)
fp = stdin;
{
fp = stdin;
copies = 1;
}
else
{
/*
@@ -105,6 +109,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
perror("ERROR: unable to open print file");
return (1);
}
copies = atoi(argv[4]);
}
/*
@@ -135,91 +141,107 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
addr.sin_family = hostaddr->h_addrtype;
addr.sin_port = htons(port);
for (;;)
while (copies > 0)
{
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
for (;;)
{
perror("ERROR: Unable to connect to printer");
return (1);
}
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
{
error = errno;
close(fd);
fd = -1;
if (error == ECONNREFUSED)
{
fprintf(stderr, "INFO: Network host \'%s\' is busy; will retry in 30 seconds...\n",
hostname);
sleep(30);
}
else
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
perror("ERROR: Unable to connect to printer");
return (1);
return (1);
}
}
else
break;
}
/*
* Finally, send the print file...
*/
fputs("INFO: Connected to host, sending print job...\n", stderr);
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
{
/*
* Write the print data to the printer...
*/
tbytes += nbytes;
bufptr = buffer;
while (nbytes > 0)
{
if ((wbytes = send(fd, bufptr, nbytes, 0)) < 0)
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
{
perror("ERROR: Unable to send print file to printer");
break;
}
error = errno;
close(fd);
fd = -1;
nbytes -= wbytes;
bufptr += wbytes;
if (error == ECONNREFUSED)
{
fprintf(stderr, "INFO: Network host \'%s\' is busy; will retry in 30 seconds...\n",
hostname);
sleep(30);
}
else
{
perror("ERROR: Unable to connect to printer");
return (1);
}
}
else
break;
}
/*
* Check for possible data coming back from the printer...
* Finally, send the print file...
*/
timeout.tv_sec = 0;
timeout.tv_usec = 0;
FD_ZERO(&input);
FD_SET(fd, &input);
if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
copies --;
if (fp != stdin)
{
fputs("PAGE: 1 1\n", stderr);
rewind(fp);
}
fputs("INFO: Connected to host, sending print job...\n", stderr);
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
{
/*
* Grab the data coming back and spit it out to stderr...
* Write the print data to the printer...
*/
if ((nbytes = recv(fd, buffer, sizeof(buffer), 0)) > 0)
fprintf(stderr, "INFO: Received %u bytes of back-channel data!\n",
nbytes);
tbytes += nbytes;
bufptr = buffer;
while (nbytes > 0)
{
if ((wbytes = send(fd, bufptr, nbytes, 0)) < 0)
{
perror("ERROR: Unable to send print file to printer");
break;
}
nbytes -= wbytes;
bufptr += wbytes;
}
/*
* Check for possible data coming back from the printer...
*/
timeout.tv_sec = 0;
timeout.tv_usec = 0;
FD_ZERO(&input);
FD_SET(fd, &input);
if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
{
/*
* 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 if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %u bytes...\n", tbytes);
}
else if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %u bytes...\n", tbytes);
/*
* Close the socket connection...
*/
close(fd);
}
/*
* Close the socket connection and input file and return...
* Close the input file and return...
*/
close(fd);
if (fp != stdin)
fclose(fp);
+10 -1
Ver Arquivo
@@ -411,7 +411,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
"attributes-natural-language", NULL,
language->language);
sprintf(printer_uri, "ipp://localhost/printers/%s", printer);
snprintf(printer_uri, sizeof(printer_uri),
"ipp://localhost/printers/%s", printer);
attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, printer_uri);
@@ -433,7 +434,15 @@ show_status(http_t *http, /* I - HTTP connection to server */
if (strncmp(device, "file:", 5) == 0)
printf("\tprinter is on device \'%s\' speed -1\n", device + 5);
else
{
/*
* Just show the method...
*/
*strchr(device, ':') = '\0';
printf("\tprinter is on device \'%s\' speed -1\n", device);
}
printf("\tqueuing is %sabled\n", accepting ? "en" : "dis");
printf("\tprinting is %sabled\n",
pstate == IPP_PRINTER_STOPPED ? "dis" : "en");
+19 -16
Ver Arquivo
@@ -23,6 +23,8 @@
*
* Contents:
*
* main() - Parse options and commands.
* show_jobs() - Show jobs.
*/
/*
@@ -45,7 +47,8 @@
* Local functions...
*/
static int show_jobs(http_t *, char *, char *, int, int);
static int show_jobs(http_t *, const char *, const char *, const int,
const int);
/*
@@ -58,7 +61,7 @@ main(int argc, /* I - Number of command-line arguments */
{
int i; /* Looping var */
http_t *http; /* Connection to server */
char *dest, /* Desired printer */
const char *dest, /* Desired printer */
*user; /* Desired user */
int id, /* Desired job ID */
interval, /* Reporting interval */
@@ -74,7 +77,7 @@ main(int argc, /* I - Number of command-line arguments */
* Check for command-line options...
*/
dest = NULL;
dest = cupsGetDefault();
user = NULL;
id = 0;
interval = 0;
@@ -136,21 +139,21 @@ main(int argc, /* I - Number of command-line arguments */
/*
* 'show_jobs()' - Show printers.
* 'show_jobs()' - Show jobs.
*/
static int /* O - Number of jobs in queue */
show_jobs(http_t *http, /* I - HTTP connection to server */
char *dest, /* I - Destination */
char *user, /* I - User */
int id, /* I - Job ID */
int longstatus) /* I - 1 if long report desired */
show_jobs(http_t *http, /* I - HTTP connection to server */
const char *dest, /* I - Destination */
const char *user, /* I - User */
const int id, /* I - Job ID */
const int longstatus)/* I - 1 if long report desired */
{
ipp_t *request, /* IPP Request */
*response; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
cups_lang_t *language; /* Default language */
char *jobdest, /* Pointer into job-printer-uri */
const char *jobdest, /* Pointer into job-printer-uri */
*jobuser, /* Pointer to job-originating-user-name */
*jobname; /* Pointer to job-name */
ipp_jstate_t jobstate; /* job-state */
@@ -160,7 +163,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
jobcount, /* Number of jobs */
rank; /* Rank of job */
char resource[1024]; /* Resource string */
static char *ranks[10] = /* Ranking strings */
static const char *ranks[10] =/* Ranking strings */
{
"th",
"st",
@@ -216,7 +219,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
}
else
{
sprintf(resource, "ipp://localhost/printers/%s", dest);
snprintf(resource, sizeof(resource), "ipp://localhost/printers/%s", dest);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
NULL, resource);
@@ -234,7 +237,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
*/
if (!longstatus)
puts("Rank\tPri Owner Job Files Total Size");
puts("Rank\tPri Owner Job Files Total Size");
jobcount = 0;
@@ -335,7 +338,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
}
printf("[job %03dlocalhost]\n", jobid);
printf("\t%-33s%d bytes\n", jobname, jobsize);
printf("\t%-32.32s %d bytes\n", jobname, jobsize);
}
else
{
@@ -347,8 +350,8 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
rank ++;
}
printf(" %-5d%-7.7s%-7d%-19s%d bytes\n", jobpriority, jobuser, jobid,
jobname, jobsize);
printf(" %-4d %-10.10s %-6d %-18.18s %d bytes\n", jobpriority, jobuser,
jobid, jobname, jobsize);
}
if (attr == NULL)
break;
+51 -7
Ver Arquivo
@@ -23,7 +23,8 @@
*
* Contents:
*
* main() - Parse options and send files for printing.
* main() - Parse options and send files for printing.
* sighandler() - Signal catcher for when we print from stdin...
*/
/*
@@ -35,6 +36,25 @@
#include <cups/cups.h>
#ifndef WIN32
# include <signal.h>
/*
* Local functions.
*/
void sighandler(void);
#endif /* !WIN32 */
/*
* Globals...
*/
char tempfile[1024]; /* Temporary file for printing from stdin */
/*
* 'main()' - Parse options and send files for printing.
*/
@@ -46,7 +66,7 @@ main(int argc, /* I - Number of command-line arguments */
int i; /* Looping var */
int job_id; /* Job ID */
const char *dest; /* Destination printer */
char *title; /* Job title */
const char *title; /* Job title */
int priority; /* Job priority (1-100) */
int num_copies; /* Number of copies per file */
int num_files; /* Number of files printed */
@@ -54,7 +74,6 @@ main(int argc, /* I - Number of command-line arguments */
cups_option_t *options; /* Options */
int silent, /* Silent or verbose output? */
deletefile; /* Delete file after print? */
char tempfile[1024]; /* Temporary file for printing from stdin */
char buffer[8192]; /* Copy buffer */
FILE *temp; /* Temporary file pointer */
@@ -190,7 +209,8 @@ main(int argc, /* I - Number of command-line arguments */
if (job_id < 1)
{
fprintf(stderr, "lpr: unable to print file \'%s\'.\n", argv[i]);
fprintf(stderr, "lpr: unable to print file \'%s\' - error code %x.\n",
argv[i], cupsLastError());
return (1);
}
else if (deletefile)
@@ -209,7 +229,11 @@ main(int argc, /* I - Number of command-line arguments */
return (1);
}
temp = fopen(tmpnam(tempfile), "w");
#ifndef WIN32
signal(SIGTERM, sighandler);
#endif /* !WIN32 */
temp = fopen(cupsTempFile(tempfile, sizeof(tempfile)), "w");
if (temp == NULL)
{
@@ -225,7 +249,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i == 0)
{
fputs("lpr: stdin is empty, so no job has been sent.\n", stderr);
fputs("lpr: standard input is empty, so no job has been sent.\n", stderr);
return (1);
}
@@ -234,9 +258,12 @@ main(int argc, /* I - Number of command-line arguments */
else
job_id = cupsPrintFile(dest, tempfile, "(stdin)", num_options, options);
unlink(tempfile);
if (job_id < 1)
{
fprintf(stderr, "lpr: unable to print file \'%s\'.\n", argv[i]);
fprintf(stderr, "lpr: unable to print standard input - error code %x.\n",
cupsLastError());
return (1);
}
}
@@ -245,6 +272,23 @@ main(int argc, /* I - Number of command-line arguments */
}
#ifndef WIN32
/*
* 'sighandler()' - Signal catcher for when we print from stdin...
*/
void
sighandler(void)
{
/*
* Remove the temporary file we're using to print from stdin...
*/
unlink(tempfile);
}
#endif /* !WIN32 */
/*
* End of "$Id$".
*/
+24 -1
Ver Arquivo
@@ -65,6 +65,7 @@ main(int argc, /* I - Number of command-line arguments */
job_id = 0;
dest = cupsGetDefault();
response = NULL;
http = NULL;
/*
* Open a connection to the server...
@@ -146,7 +147,7 @@ main(int argc, /* I - Number of command-line arguments */
if (dest)
{
sprintf(uri, "ipp://localhost/printers/%s", dest);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", dest);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
@@ -159,6 +160,9 @@ main(int argc, /* I - Number of command-line arguments */
uri);
}
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, cupsUser());
/*
* Do the request and get back a response...
*/
@@ -169,7 +173,26 @@ main(int argc, /* I - Number of command-line arguments */
response = cupsDoRequest(http, request, "/jobs/");
if (response != NULL)
{
switch (response->request.status.status_code)
{
case IPP_NOT_FOUND :
fputs("lprm: Job or printer not found!\n", stderr);
break;
case IPP_NOT_AUTHORIZED :
fputs("lprm: Not authorized to lprm job(s)!\n", stderr);
break;
case IPP_FORBIDDEN :
fprintf(stderr, "lprm: You don't own job ID %d!\n", job_id);
break;
default :
if (response->request.status.status_code > IPP_OK_CONFLICT)
fputs("lprm: Unable to lprm job(s)!\n", stderr);
break;
}
ippDelete(response);
}
else
{
fputs("lprm: Unable to cancel job(s)!\n", stderr);
+18 -7
Ver Arquivo
@@ -38,6 +38,7 @@
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/debug.h>
#include <config.h>
/*
@@ -99,15 +100,24 @@ main(int argc, /* I - Number of command-line arguments */
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10\">");
else
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">");
printf("<TITLE>%s on %s - Common UNIX Printing System</TITLE>\n",
printf("<TITLE>%s on %s - " CUPS_SVERSION "</TITLE>\n",
name == NULL ? "Classes" : name, getenv("SERVER_NAME"));
puts("<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"/cups.css\">");
puts("<MAP NAME=\"navbar\">");
#ifdef ESPPRINTPRO
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"170,10,210,30\" HREF=\"/jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"366,10,442,30\" HREF=\"http://www.easysw.com/software.html\" ALT=\"Download the Current ESP Print Pro Software\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"454,10,530,30\" HREF=\"http://www.easysw.com/support.html\" ALT=\"Get Tech Support for Current ESP Print Pro\">");
#else
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,85,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"95,10,175,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"185,10,235,30\" HREF=\"/jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"245,10,395,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"405,10,490,30\" HREF=\"http://www.cups.org\" ALT=\"Download the Current CUPS Software\">");
#endif /* ESPPRINTPRO */
puts("</MAP>");
puts("</HEAD>");
puts("<BODY>");
@@ -206,7 +216,7 @@ show_class_list(http_t *http, /* I - HTTP connection */
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/classes/")) != NULL)
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
/*
* Loop through the classes returned in the list and display
@@ -287,7 +297,7 @@ show_class_info(http_t *http,
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
sprintf(uri, "ipp://localhost/classes/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/classes/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
@@ -295,7 +305,7 @@ show_class_info(http_t *http,
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, uri + 15)) == NULL)
if ((response = cupsDoRequest(http, request, "/")) == NULL)
{
puts("<P>Unable to communicate with CUPS server!");
return;
@@ -331,7 +341,8 @@ show_class_info(http_t *http,
if ((attr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL)
{
strcpy(uri, "http:");
strcpy(uri + 5, strchr(attr->values[0].string.text, '/'));
strncpy(uri + 5, strchr(attr->values[0].string.text, '/'), sizeof(uri) - 6);
uri[sizeof(uri) - 1] = '\0';
}
/*
@@ -387,11 +398,11 @@ show_class_info(http_t *http,
"attributes-natural-language", NULL,
language->language);
sprintf(uri, "ipp://localhost/printers/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
jobs = cupsDoRequest(http, request, uri + 15);
jobs = cupsDoRequest(http, request, "/");
}
else
jobs = NULL;
+15 -8
Ver Arquivo
@@ -38,6 +38,7 @@
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/debug.h>
#include <config.h>
/*
@@ -62,8 +63,6 @@ main(int argc, /* I - Number of command-line arguments */
http_t *http; /* Connection to the server */
setbuf(stdout, NULL);
/*
* Get the request language...
*/
@@ -101,15 +100,24 @@ main(int argc, /* I - Number of command-line arguments */
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10\">");
else
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">");
printf("<TITLE>%s on %s - Common UNIX Printing System</TITLE>\n",
printf("<TITLE>%s on %s - " CUPS_SVERSION "</TITLE>\n",
job == NULL ? "Jobs" : job, getenv("SERVER_NAME"));
puts("<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"/cups.css\">");
puts("<MAP NAME=\"navbar\">");
#ifdef ESPPRINTPRO
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"170,10,210,30\" HREF=\"jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"366,10,442,30\" HREF=\"http://www.easysw.com/software.html\" ALT=\"Download the Current ESP Print Pro Software\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"454,10,530,30\" HREF=\"http://www.easysw.com/support.html\" ALT=\"Get Tech Support for Current ESP Print Pro\">");
#else
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,85,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"95,10,175,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"185,10,235,30\" HREF=\"/jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"245,10,395,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"405,10,490,30\" HREF=\"http://www.cups.org\" ALT=\"Download the Current CUPS Software\">");
#endif /* ESPPRINTPRO */
puts("</MAP>");
puts("</HEAD>");
puts("<BODY>");
@@ -209,7 +217,7 @@ show_job_list(http_t *http, /* I - HTTP connection */
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/jobs/")) != NULL)
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
/*
* Do a table for the jobs...
@@ -378,14 +386,14 @@ show_job_info(http_t *http, /* I - Server connection */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
sprintf(uri, "ipp://localhost/jobs/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, uri);
/*
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, uri + 15)) == NULL)
if ((response = cupsDoRequest(http, request, "/")) == NULL)
{
puts("<P>Unable to communicate with CUPS server!");
return;
@@ -499,8 +507,7 @@ show_job_info(http_t *http, /* I - Server connection */
for (attr = response->attrs; attr != NULL; attr = attr->next)
{
if (attr->group_tag != IPP_TAG_JOB &&
attr->group_tag != IPP_TAG_EXTENSION)
if (attr->group_tag != IPP_TAG_JOB)
continue;
if (strcmp(attr->name, "job-uri") == 0 ||
+18 -7
Ver Arquivo
@@ -38,6 +38,7 @@
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/debug.h>
#include <config.h>
/*
@@ -99,15 +100,24 @@ main(int argc, /* I - Number of command-line arguments */
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10\">");
else
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">");
printf("<TITLE>%s on %s - Common UNIX Printing System</TITLE>\n",
printf("<TITLE>%s on %s - " CUPS_SVERSION "</TITLE>\n",
printer == NULL ? "Printers" : printer, getenv("SERVER_NAME"));
puts("<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"/cups.css\">");
puts("<MAP NAME=\"navbar\">");
#ifdef ESPPRINTPRO
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"170,10,210,30\" HREF=\"/jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"366,10,442,30\" HREF=\"http://www.easysw.com/software.html\" ALT=\"Download the Current ESP Print Pro Software\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"454,10,530,30\" HREF=\"http://www.easysw.com/support.html\" ALT=\"Get Tech Support for Current ESP Print Pro\">");
#else
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,85,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"95,10,175,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"185,10,235,30\" HREF=\"/jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"245,10,395,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"405,10,490,30\" HREF=\"http://www.cups.org\" ALT=\"Download the Current CUPS Software\">");
#endif /* ESPPRINTPRO */
puts("</MAP>");
puts("</HEAD>");
puts("<BODY>");
@@ -206,7 +216,7 @@ show_printer_list(http_t *http, /* I - HTTP connection */
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/printers/")) != NULL)
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
/*
* Loop through the printers returned in the list and display
@@ -287,7 +297,7 @@ show_printer_info(http_t *http,
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
sprintf(uri, "ipp://localhost/printers/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
@@ -295,7 +305,7 @@ show_printer_info(http_t *http,
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, uri + 15)) == NULL)
if ((response = cupsDoRequest(http, request, "/")) == NULL)
{
puts("<P>Unable to communicate with CUPS server!");
return;
@@ -331,7 +341,8 @@ show_printer_info(http_t *http,
if ((attr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL)
{
strcpy(uri, "http:");
strcpy(uri + 5, strchr(attr->values[0].string.text, '/'));
strncpy(uri + 5, strchr(attr->values[0].string.text, '/'), sizeof(uri) - 6);
uri[sizeof(uri) - 1] = '\0';
}
/*
@@ -389,11 +400,11 @@ show_printer_info(http_t *http,
"attributes-natural-language", NULL,
language->language);
sprintf(uri, "ipp://localhost/printers/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
jobs = cupsDoRequest(http, request, uri + 15);
jobs = cupsDoRequest(http, request, "/");
}
else
jobs = NULL;
+9 -2
Ver Arquivo
@@ -28,7 +28,8 @@ include ../Makedefs
# Config files...
#
FILES = classes.conf cupsd.conf mime.convs mime.types printers.conf
KEEP = classes.conf cupsd.conf printers.conf
REPLACE = mime.convs mime.types
#
# Make everything...
@@ -48,13 +49,19 @@ clean:
install:
-$(MKDIR) $(SERVERROOT)/conf
for file in $(FILES); do \
for file in $(KEEP); do \
if test -e $(SERVERROOT)/conf/$$file ; then \
$(CP) $$file $(SERVERROOT)/conf/$$file.N ; \
else \
$(CP) $$file $(SERVERROOT)/conf ; \
fi ; \
done
for file in $(REPLACE); do \
if test -e $(SERVERROOT)/conf/$$file ; then \
$(MV) $(SERVERROOT)/conf/$$file $(SERVERROOT)/conf/$$file.O ; \
fi ; \
$(CP) $$file $(SERVERROOT)/conf ; \
done
#
# End of "$Id$".
+9 -2
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: classes.conf 333 1999-05-17 18:03:40Z mike $"
# "$Id: classes.conf 678 1999-09-22 18:10:55Z mike $"
#
# Sample class configuration file for the Common UNIX Printing System
# (CUPS) scheduler.
@@ -59,6 +59,13 @@
#Location Room 101 in the activities building
#
# Accepting: is the class accepting jobs?
#
#Accepting Yes
#Accepting No
#
#
# Printer: adds a printer to the class.
#
@@ -68,5 +75,5 @@
#</Class>
#
# End of "$Id: classes.conf 333 1999-05-17 18:03:40Z mike $".
# End of "$Id: classes.conf 678 1999-09-22 18:10:55Z mike $".
#
+30 -8
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cupsd.conf 510 1999-07-09 14:20:15Z mike $"
# "$Id: cupsd.conf 628 1999-08-23 15:24:48Z mike $"
#
# Sample configuration file for the Common UNIX Printing System (CUPS)
# scheduler.
@@ -70,20 +70,25 @@ Port 631
# program is run...
#
User lp
Group sys
#User lp
#Group sys
#
# SystemGroup: the group name for "System" (printer administration)
# access.
# access. The default varies depending on the operating system, but
# will be "sys", "system", or "root" (checked for in that order.)
#
SystemGroup sys
#SystemGroup sys
#
# ServerName: the hostname of your server, as advertised to the world.
# By default CUPS will use the hostname of the system.
#
# This is also the name used by clients when connecting to the local
# server, so you can use this to configure a client machine without
# a local server running.
#
#ServerName myhost.domain.com
@@ -305,6 +310,23 @@ LogLevel info
# Deny: denies access from the specified hostname, domain, IP address, or
# network.
#
# Both "Allow" and "Deny" accept the following notations for addresses:
#
# All
# None
# *.domain.com
# .domain.com
# host.domain.com
# nnn.*
# nnn.nnn.*
# nnn.nnn.nnn.*
# nnn.nnn.nnn.nnn
# nnn.nnn.nnn.nnn/mm
# nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
#
# The host and domain address require that you enable hostname lookups
# with "HostNameLookups On" above.
#
<Location />
</Location>
@@ -329,8 +351,8 @@ LogLevel info
#
# You definitely will want to limit access to the administration tools.
# The default configuration requires a local connection from a user who
# is a member of group "sys" to do any admin tasks. You can change the
# group name using the SystemGroup directive.
# is a member of the system group to do any admin tasks. You can change
# the group name using the SystemGroup directive.
#
AuthType Basic
@@ -343,5 +365,5 @@ Allow From 127.0.0.1
</Location>
#
# End of "$Id: cupsd.conf 510 1999-07-09 14:20:15Z mike $".
# End of "$Id: cupsd.conf 628 1999-08-23 15:24:48Z mike $".
#
+3 -3
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: mime.convs 530 1999-07-13 14:11:17Z mike $"
# "$Id: mime.convs 575 1999-07-30 13:57:16Z mike $"
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
@@ -42,7 +42,7 @@
#
#application/msword application/postscript 50 mswordtops
#application/pdf application/postscript 50 pdftops
application/pdf application/postscript 50 pdftops
application/postscript application/vnd.cups-postscript 50 pstops
application/vnd.hp-HPGL application/postscript 50 hpgltops
image/* application/vnd.cups-postscript 50 imagetops
@@ -58,5 +58,5 @@ image/* application/vnd.cups-raster 50 imagetoraster
application/vnd.cups-postscript application/vnd.cups-raster 50 pstoraster
#
# End of "$Id: mime.convs 530 1999-07-13 14:11:17Z mike $".
# End of "$Id: mime.convs 575 1999-07-30 13:57:16Z mike $".
#
+4 -5
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: mime.types 487 1999-06-30 21:07:52Z mike $"
# "$Id: mime.types 575 1999-07-30 13:57:16Z mike $"
#
# MIME types file for the Common UNIX Printing System (CUPS).
#
@@ -92,10 +92,9 @@ 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
# TODO: Add Sun Raster, Alias, SoftImage, GIMP??? files
image/x-sun-raster ras
# TODO: Add Alias, SoftImage, GIMP??? files
#image/x-alias pix
#image/x-softimage
#image/x-gimp-xcf xcf xcf.gz
@@ -119,5 +118,5 @@ application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
application/vnd.cups-raw
#
# End of "$Id: mime.types 487 1999-06-30 21:07:52Z mike $".
# End of "$Id: mime.types 575 1999-07-30 13:57:16Z mike $".
#
+2
Ver Arquivo
@@ -0,0 +1,2 @@
# This is a dummy printcap file that is automatically generated by the
# CUPS software for old applications that rely on it.
+10 -3
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: printers.conf 334 1999-05-17 18:11:26Z mike $"
# "$Id: printers.conf 678 1999-09-22 18:10:55Z mike $"
#
# Sample printer configuration file for the Common UNIX Printing System
# (CUPS) scheduler.
@@ -77,13 +77,20 @@
# State: sets the initial state of the printer. Can be one of the
# following:
#
# Idle - Printer is available to accept new jobs.
# Idle - Printer is available to print new jobs.
# Stopped - Printer is disabled but accepting new jobs.
#
#State Idle
#
# Accepting: is the printer accepting jobs?
#
#Accepting Yes
#Accepting No
#</Printer>
#
# End of "$Id: printers.conf 334 1999-05-17 18:11:26Z mike $".
# End of "$Id: printers.conf 678 1999-09-22 18:10:55Z mike $".
#
+8 -1
Ver Arquivo
@@ -28,7 +28,7 @@
* Version of software...
*/
#define CUPS_SVERSION "CUPS v1.0"
#define CUPS_SVERSION "CUPS v1.0.2"
/*
* Where are files stored?
@@ -82,6 +82,13 @@
#undef HAVE_STRCASECMP
#undef HAVE_STRNCASECMP
/*
* Do we have the (v)snprintf() functions?
*/
#undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF
/*
* What signal functions to use?
*/
+50 -24
Ver Arquivo
@@ -45,13 +45,8 @@ CFLAGS="${CFLAGS:=}"
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],[if eval "test x$enable_debug = xyes"; then
OPTIM="-g "
fi])
AC_ARG_ENABLE(shared, [ --disable-shared turn off shared libraries [default=no]])
if eval "test x$disable_shared = xyes"; then
PICFLAG=0
LIBCUPS="libcups.a"
LIBCUPSIMAGE="libcupsimage.a"
DSO=":"
else
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=yes]])
if test "$enable_shared" != "no"; then
case "$uname" in
SunOS* | UNIX_S*)
LIBCUPS="libcups.so.1"
@@ -63,6 +58,11 @@ else
LIBCUPSIMAGE="libcupsimage.sl.1"
DSO="ld -b -z +h \$@ -o"
;;
FreeBSD* | NetBSD* | OpenBSD*)
LIBCUPS="libcups.so.1"
LIBCUPSIMAGE="libcupsimage.so.1"
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
;;
OSF1* | Linux*)
LIBCUPS="libcups.so.1"
LIBCUPSIMAGE="libcupsimage.so.1"
@@ -81,6 +81,11 @@ else
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
;;
esac
else
PICFLAG=0
LIBCUPS="libcups.a"
LIBCUPSIMAGE="libcupsimage.a"
DSO=":"
fi
dnl Checks for programs...
@@ -91,13 +96,14 @@ AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CHMOD,chmod)
AC_PATH_PROG(CP,cp)
AC_PATH_PROG(MV,mv)
AC_PATH_PROG(NROFF,nroff)
if test "$NROFF" = ""; then
AC_PATH_PROG(NROFF,groff)
if test "$NROFF" = ""; then
AC_PATH_PROG(GROFF,groff)
if test "$GROFF" = ""; then
NROFF="echo"
else
NROFF="$NROFF -T ascii"
NROFF="$GROFF -T ascii"
fi
fi
AC_PATH_PROG(HTMLDOC,htmldoc)
@@ -119,12 +125,6 @@ fi
AC_SUBST(CAT)
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(SED,sed)
AC_PATH_PROG(SMBCLIENT,smbclient)
if test "$SMBCLIENT" = ""; then
echo "Looking for smbclient in standard locations..."
AC_PATH_PROG(SMBCLIENT,smbclient,samba_not_detected,
/usr/samba/bin:/usr/local/samba/bin:/usr/freeware/samba/bin:/opt/samba/bin)
fi
dnl Architecture checks...
AC_C_BIGENDIAN
@@ -133,15 +133,18 @@ dnl Check for libraries...
AC_CHECK_LIB(c,crypt,LIBS="$LIBS",AC_CHECK_LIB(crypt,crypt))
AC_CHECK_HEADER(crypt.h, AC_DEFINE(HAVE_CRYPT_H))
AC_CHECK_LIB(sec,getspent)
NETLIBS=""
AC_SUBST(NETLIBS)
AC_CHECK_LIB(socket,socket,
if test "$uname" != "IRIX"; then
LIBS="$LIBS -lsocket"
NETLIBS="-lsocket"
else
echo "Not using -lsocket since you are running IRIX."
fi)
AC_CHECK_LIB(nsl,gethostbyaddr,
if test "$uname" != "IRIX"; then
LIBS="$LIBS -lnsl"
NETLIBS="$NETLIBS -lnsl"
else
echo "Not using -lnsl since you are running IRIX."
fi)
@@ -156,16 +159,23 @@ AC_SUBST(LIBPNG)
AC_SUBST(LIBTIFF)
AC_SUBST(LIBZ)
AC_CHECK_HEADER(jpeglib.h,
dnl AC_CHECK_HEADER(jpeglib.h,
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
AC_DEFINE(HAVE_LIBJPEG)
LIBJPEG="-ljpeg")
AC_CHECK_HEADER(png.h,
dnl AC_CHECK_HEADER(png.h,
AC_CHECK_LIB(png, png_read_info,
AC_DEFINE(HAVE_LIBPNG)
LIBPNG="-lpng")
AC_CHECK_HEADER(tiff.h,
dnl AC_CHECK_HEADER(tiff.h,
AC_CHECK_LIB(tiff, TIFFReadScanline,
AC_DEFINE(HAVE_LIBTIFF)
LIBTIFF="-ltiff")
AC_CHECK_HEADER(zlib.h,
dnl AC_CHECK_HEADER(zlib.h,
AC_CHECK_LIB(z, deflateInit,
AC_DEFINE(HAVE_LIBZ)
LIBZ="-lz")
@@ -178,6 +188,8 @@ dnl Checks for string functions.
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(vsnprintf)
dnl Checks for signal functions.
AC_CHECK_FUNCS(sigset)
@@ -190,7 +202,7 @@ AC_CHECK_FUNCS(wait3)
dnl Update compiler options...
if test -n "$GXX"; then
if test -z "$OPTIM"; then
OPTIM="-O2"
OPTIM="-O2"
fi
if test $PICFLAG = 1; then
OPTIM="-fPIC $OPTIM"
@@ -209,6 +221,7 @@ else
if test -z "$OPTIM"; then
OPTIM="+O2"
fi
OPTIM="-Ae $OPTIM"
;;
SunOS*)
# Solaris
@@ -238,6 +251,19 @@ if test "$DSO" != ":"; then
# a single DSO rather than a bunch...
DSOLIBS="\$(LIBJPEG) \$(LIBPNG) \$(LIBTIFF) \$(LIBZ)"
IMGLIBS=""
# The HP-UX and Solaris run-time linkers are EXTREMELY stupid when
# it comes to deciding where to find a DSO. Add linker options to
# tell them where to find the DSO (usually in /usr/lib... duh!)
case $uname in
HP-UX*)
LDFLAGS="$LDFLAGS -Wl,+b,$libdir,+fb"
;;
SunOS*)
# Solaris
LDFLAGS="-R$libdir"
;;
esac
else
DSOLIBS=""
IMGLIBS="\$(LIBJPEG) \$(LIBPNG) \$(LIBTIFF) \$(LIBZ)"
@@ -255,7 +281,7 @@ if test "$prefix" = "NONE"; then
fi
dnl Fix "libdir" variable for IRIX 6.x...
if test "$uname" = "IRIX" -a $uversion -ge 62; then
if test "$uname" = "IRIX" -a $uversion -ge 65; then
libdir="/usr/lib32"
fi
+41 -69
Ver Arquivo
@@ -1,11 +1,11 @@
#
# "$Id: cups.list 529 1999-07-13 14:11:00Z mike $"
# "$Id: cups.list 775 1999-11-04 13:35:01Z mike $"
#
# ESP Package Manager (EPM) file list for the Common UNIX Printing
# System (CUPS).
#
# EPM can be found in the "epm" subdirectory of this distribution.
# Please report problems and fixes to Michael Sweet (mike@easysw.com).
# Please report problems and fixes to "epm@easysw.com".
#
# Copyright 1997-1999 by Easy Software Products, all rights reserved.
#
@@ -31,22 +31,23 @@
%vendor Easy Software Products
%license LICENSE.cups
%readme README.cups
%version 1.0b5
%version 1.0.2
%incompat printpro
%system all
# Server files
f 0555 root sys /var/cups/backend/ipp backend/ipp
f 4555 root sys /var/cups/backend/lpd backend/lpd
l 0555 root sys /var/cups/backend/http ipp
f 4550 root sys /var/cups/backend/lpd backend/lpd
f 0555 root sys /var/cups/backend/parallel backend/parallel
f 0555 root sys /var/cups/backend/serial backend/serial
f 0555 root sys /var/cups/backend/smb backend/smb
f 0555 root sys /var/cups/backend/socket backend/socket
f 0500 root sys /usr/sbin/cupsd scheduler/cupsd
f 0555 root sys /var/cups/cgi-bin/classes.cgi cgi-bin/classes.cgi
f 0555 root sys /var/cups/cgi-bin/jobs.cgi cgi-bin/jobs.cgi
f 0555 root sys /var/cups/cgi-bin/printers.cgi cgi-bin/printers.cgi
f 0555 root sys /var/cups/filter/pstoraster pstoraster/pstoraster
l 0555 root sys /var/cups/filter/pdftops pstoraster
f 0555 root sys /var/cups/filter/imagetops filter/imagetops
f 0555 root sys /var/cups/filter/pstops filter/pstops
f 0555 root sys /var/cups/filter/texttops filter/texttops
@@ -54,19 +55,26 @@ f 0555 root sys /var/cups/filter/rastertohp filter/rastertohp
f 0555 root sys /var/cups/filter/hpgltops filter/hpgltops
f 0555 root sys /var/cups/filter/imagetoraster filter/imagetoraster
# User commands
f 0555 root sys /usr/bin/lp systemv/lp
f 0555 root sys /usr/bin/lpstat systemv/lpstat
f 0555 root sys /usr/lib/lpadmin systemv/lpadmin
f 0555 root sys /usr/bin/cancel systemv/cancel
f 0555 root sys /usr/lib/accept systemv/accept
# Admin commands
l 0555 root sys /usr/bin/disable /usr/sbin/accept
l 0555 root sys /usr/bin/enable /usr/sbin/accept
l 0555 root sys /usr/lib/accept /usr/sbin/accept
l 0555 root sys /usr/lib/lpadmin /usr/sbin/lpadmin
l 0555 root sys /usr/lib/reject accept
l 0555 root sys /usr/bin/disable /usr/lib/accept
l 0555 root sys /usr/bin/enable /usr/lib/accept
f 0555 root sys /usr/sbin/accept systemv/accept
f 0555 root sys /usr/sbin/esplicense license/esplicense
f 0555 root sys /usr/sbin/lpadmin systemv/lpadmin
f 0555 root sys /usr/sbin/lpc berkeley/lpc
l 0555 root sys /usr/sbin/reject accept
# User commands
f 0555 root sys /usr/bin/cancel systemv/cancel
f 0555 root sys /usr/bin/lp systemv/lp
f 0555 root sys /usr/bin/lpq berkeley/lpq
f 0555 root sys /usr/bin/lpr berkeley/lpr
f 0555 root sys /usr/bin/lprm berkeley/lprm
f 0555 root sys /usr/bin/lpstat systemv/lpstat
f 0555 root sys /usr/bin/lpwin gui/lpwin
# DSOs
%system hpux
@@ -74,12 +82,12 @@ f 0555 root sys /usr/lib/libcups.sl.1 cups/libcups.sl.1
l 0555 root sys /usr/lib/libcups.sl libcups.sl.1
f 0555 root sys /usr/lib/libcupsimage.sl.1 filter/libcupsimage.sl.1
l 0555 root sys /usr/lib/libcupsimage.sl libcupsimage.sl.1
%system irix irix64
%system irix-6.5
f 0555 root sys /usr/lib32/libcups.so.1 cups/libcups.so.1
l 0555 root sys /usr/lib32/libcups.so libcups.so.1
f 0555 root sys /usr/lib32/libcupsimage.so.1 filter/libcupsimage.so.1
l 0555 root sys /usr/lib32/libcupsimage.so libcupsimage.so.1
%system dunix linux solaris sunos
%system !irix-6.5 !hpux
f 0555 root sys /usr/lib/libcups.so.1 cups/libcups.so.1
l 0555 root sys /usr/lib/libcups.so libcups.so.1
f 0555 root sys /usr/lib/libcupsimage.so.1 filter/libcupsimage.so.1
@@ -197,11 +205,16 @@ f 0444 root sys /usr/share/cups/model/deskjet.ppd ppd/deskjet.ppd
f 0444 root sys /usr/share/cups/model/laserjet.ppd ppd/laserjet.ppd
# Config files
c 0600 root sys /var/cups/conf/classes.conf conf/classes.conf
c 0600 root sys /var/cups/conf/cupsd.conf conf/cupsd.conf
c 0600 root sys /var/cups/conf/mime.convs conf/mime.convs
c 0600 root sys /var/cups/conf/mime.types conf/mime.types
c 0600 root sys /var/cups/conf/printers.conf conf/printers.conf
c 0644 root sys /var/cups/conf/classes.conf conf/classes.conf
c 0644 root sys /var/cups/conf/cupsd.conf conf/cupsd.conf
f 0644 root sys /var/cups/conf/mime.convs conf/mime.convs
f 0644 root sys /var/cups/conf/mime.types conf/mime.types
c 0644 root sys /var/cups/conf/printers.conf conf/printers.conf
# Dummy printcap file for Digital UNIX and Linux...
%system dunix linux
f 0644 root sys /etc/printcap conf/printcap
%system all
# Developer files
f 0444 root sys /usr/include/cups/cups.h cups/cups.h
@@ -212,10 +225,9 @@ f 0444 root sys /usr/include/cups/mime.h cups/mime.h
f 0444 root sys /usr/include/cups/ppd.h cups/ppd.h
f 0444 root sys /usr/include/cups/raster.h cups/raster.h
# This should only be done for IRIX 6.x (-n32)
%system irix irix64
%system irix-6.5
f 0444 root sys /usr/lib32/libcups.a cups/libcups.a
%system hpux solaris sunos dunix linux
%system !irix-6.5
f 0444 root sys /usr/lib/libcups.a cups/libcups.a
%system all
@@ -255,7 +267,7 @@ f 0444 root sys /usr/share/cups/doc/svd.html doc/svd.html
f 0444 root sys /usr/share/cups/doc/svd.pdf doc/svd.pdf
# Man pages
%system irix irix64
%system irix
f 0444 root sys /usr/share/catman/a_man/cat1/accept.z man/accept.z
l 0444 root sys /usr/share/catman/a_man/cat1/reject.z accept.z
f 0444 root sys /usr/share/catman/u_man/cat1/backend.z man/backend.z
@@ -275,7 +287,7 @@ l 0444 root sys /usr/share/catman/u_man/cat1/cancel.z lp.z
f 0444 root sys /usr/share/catman/u_man/cat5/mime.convs.z man/mime.convs.z
f 0444 root sys /usr/share/catman/u_man/cat5/mime.types.z man/mime.types.z
f 0444 root sys /usr/share/catman/u_man/cat5/printers.conf.z man/printers.conf.z
%system hpux linux dunix solaris sunos
%system !irix
f 0444 root sys /usr/man/man8/accept.8 man/accept.8
l 0444 root sys /usr/man/man8/reject.8 accept.8
f 0444 root sys /usr/man/man1/backend.1 man/backend.1
@@ -296,50 +308,10 @@ f 0444 root sys /usr/man/man5/mime.convs.5 man/mime.convs.5
f 0444 root sys /usr/man/man5/mime.types.5 man/mime.types.5
f 0444 root sys /usr/man/man5/printers.conf.5 man/printers.conf.5
# Startup scripts
%system hpux
%install /sbin/init.d/cups start
%remove /sbin/init.d/cups stop
%patch /sbin/init.d/cups stop
f 0555 root sys /sbin/init.d/cups cups.sh
l 0555 root sys /sbin/rc1.d/K280cups ../init.d/cups
l 0555 root sys /sbin/rc2.d/S720cups ../init.d/cups
%system irix irix64
%install /sbin/chkconfig -f cups on
%install /etc/init.d/cups start
%remove /etc/init.d/cups stop
%patch /etc/init.d/cups stop
f 0555 root sys /etc/init.d/cups cups.sh
l 0555 root sys /etc/rc0.d/K25cups ../init.d/cups
l 0555 root sys /etc/rc2.d/S60cups ../init.d/cups
%system linux
%install /etc/rc.d/init.d/cups start
%remove /etc/rc.d/init.d/cups stop
%patch /etc/rc.d/init.d/cups stop
f 0555 root sys /etc/rc.d/init.d/cups cups.sh
l 0555 root sys /etc/rc.d/rc2.d/S60cups ../init.d/cups
l 0555 root sys /etc/rc.d/rc3.d/S60cups ../init.d/cups
l 0555 root sys /etc/rc.d/rc4.d/S60cups ../init.d/cups
l 0555 root sys /etc/rc.d/rc5.d/S60cups ../init.d/cups
l 0555 root sys /etc/rc.d/rc0.d/K60cups ../init.d/cups
l 0555 root sys /etc/rc.d/rc1.d/K60cups ../init.d/cups
l 0555 root sys /etc/rc.d/rc6.d/K60cups ../init.d/cups
%system dunix
%install /sbin/init.d/cups start
%remove /sbin/init.d/cups stop
%patch /sbin/init.d/cups stop
f 0555 root sys /sbin/init.d/cups cups.sh
l 0555 root sys /sbin/rc0.d/K05cups ../init.d/cups
l 0555 root sys /sbin/rc2.d/K00cups ../init.d/cups
l 0555 root sys /sbin/rc3.d/S65cups ../init.d/cups
%system sunos solaris
%install /etc/init.d/cups start
%remove /etc/init.d/cups stop
%patch /etc/init.d/cups stop
f 0555 root sys /etc/init.d/cups cups.sh
l 0555 root sys /etc/rc0.d/K20cups ../init.d/cups
l 0555 root sys /etc/rc2.d/S80cups ../init.d/cups
# Startup script
%system all
i 0555 root sys cups cups.sh
#
# End of "$Id: cups.list 529 1999-07-13 14:11:00Z mike $".
# End of "$Id: cups.list 775 1999-11-04 13:35:01Z mike $".
#
+69 -16
Ver Arquivo
@@ -4,6 +4,12 @@
#
# Startup/shutdown script for the Common UNIX Printing System (CUPS).
#
# Linux chkconfig stuff:
#
# chkconfig: 2345 60 60
# description: Startup/shutdown script for the Common UNIX \
# Printing System (CUPS).
#
# Copyright 1997-1999 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -23,7 +29,26 @@
# WWW: http://www.cups.org
#
# See if the CUPS daemon is running, and if so stop it...
# See what program to use for configuration stuff...
case "`uname`" in
IRIX*)
IS_ON=/sbin/chkconfig
;;
*)
IS_ON=/bin/true
;;
esac
# The verbose flag controls the printing of the names of
# daemons as they are started.
if $IS_ON verbose; then
ECHO=echo
else
ECHO=:
fi
# See if the CUPS server is running...
case "`uname`" in
IRIX* | HP-UX | SunOS)
pid=`ps -e | awk '{print $1,$4}' | grep cupsd | awk '{print $1}'`
@@ -39,26 +64,54 @@ case "`uname`" in
;;
esac
# Change to the root directory first, in case we are being run from a
# CD-ROM installation script...
cd /
# Start or stop the CUPS server based upon the first argument to the script.
case $1 in
start | restart)
if test "$pid" != ""; then
echo "Restarting CUPS scheduler..."
kill -HUP $pid
else
echo "Starting CUPS scheduler..."
/usr/sbin/cupsd 2>&1 >/dev/null &
fi
;;
start | restart | reload)
if test "$pid" != ""; then
if $IS_ON cups; then
kill -HUP $pid
$ECHO "cups: scheduler restarted."
else
kill $pid
$ECHO "cups: scheduler stopped."
fi
else
if $IS_ON cups; then
/usr/sbin/cupsd 2>&1 >/dev/null &
$ECHO "cups: scheduler started."
fi
fi
;;
stop)
if test "$pid" != ""; then
echo "Stopping CUPS scheduler..."
kill $pid
sleep 1
fi
;;
if test "$pid" != ""; then
kill $pid
$ECHO "cups: scheduler stopped."
fi
;;
status)
if test "$pid" != ""; then
echo "cups: Scheduler is running."
else
echo "cups: Scheduler is not running."
fi
;;
*)
echo "Usage: cups {reload|restart|start|status|stop}"
exit 1
;;
esac
exit 0
#
# End of "$Id$".
#
+40 -213
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cups.spec 505 1999-07-08 15:00:20Z mike $"
# "$Id: cups.spec 775 1999-11-04 13:35:01Z mike $"
#
# RPM "spec" file for the Common UNIX Printing System (CUPS).
#
@@ -26,11 +26,11 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.0b5
Version: 1.0.2
Release: 0
Copyright: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/beta/cups-1.0b5-source.tar.gz
Source: ftp://ftp.easysw.com/pub/cups/1.0.2/cups-1.0.2-source.tar.gz
Url: http://www.cups.org
Packager: Michael Sweet <mike@easysw.com>
Vendor: Easy Software Products
@@ -66,28 +66,35 @@ make
# these lines just make sure the directory structure in the
# RPM_BUILD_ROOT exists
rm -rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT/etc
mkdir $RPM_BUILD_ROOT/etc/rc.d
mkdir $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir $RPM_BUILD_ROOT/usr
mkdir $RPM_BUILD_ROOT/usr/bin
mkdir $RPM_BUILD_ROOT/usr/lib
mkdir $RPM_BUILD_ROOT/usr/man
mkdir $RPM_BUILD_ROOT/usr/man/man1
mkdir $RPM_BUILD_ROOT/usr/man/man5
mkdir $RPM_BUILD_ROOT/usr/man/man8
mkdir $RPM_BUILD_ROOT/usr/share/locale
mkdir $RPM_BUILD_ROOT/var/cups
mkdir $RPM_BUILD_ROOT/var/cups/conf
mkdir $RPM_BUILD_ROOT/var/cups/logs
mkdir $RPM_BUILD_ROOT/var/logs
mkdir -p $RPM_BUILD_ROOT/etc
mkdir -p $RPM_BUILD_ROOT/etc/rc.d
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT/usr
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/lib
mkdir -p $RPM_BUILD_ROOT/usr/man
mkdir -p $RPM_BUILD_ROOT/usr/man/man1
mkdir -p $RPM_BUILD_ROOT/usr/man/man5
mkdir -p $RPM_BUILD_ROOT/usr/man/man8
mkdir -p $RPM_BUILD_ROOT/usr/share/locale
mkdir -p $RPM_BUILD_ROOT/var/cups
mkdir -p $RPM_BUILD_ROOT/var/cups/conf
mkdir -p $RPM_BUILD_ROOT/var/cups/logs
mkdir -p $RPM_BUILD_ROOT/var/log
ln -sf /var/cups/logs $RPM_BUILD_ROOT/var/logs/cups
ln -sf /var/cups/logs $RPM_BUILD_ROOT/var/log/cups
ln -sf /var/cups/conf $RPM_BUILD_ROOT/etc/cups
make prefix=$RPM_BUILD_ROOT/usr DATADIR=$RPM_BUILD_ROOT/usr/share/cups LOCALEDIR=$RPM_BUILD_ROOT/usr/share/locale SERVERROOT=$RPM_BUILD_ROOT/var/cups install
install -m 755 -o root -g root $RPM_SOURCE_DIR/cups.sh $RPM_BUILD_ROOT/etc/rc.d/init.d/cups
install -m 755 -o root -g root cups.sh $RPM_BUILD_ROOT/etc/rc.d/init.d/cups
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/bin/disable
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/bin/enable
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/lib/accept
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/lib/reject
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/sbin/reject
ln -sf /usr/sbin/lpadmin $RPM_BUILD_ROOT/usr/lib/lpadmin
%post
/sbin/chkconfig --add cups
@@ -100,208 +107,28 @@ rm -rf $RPM_BUILD_ROOT
%files
/etc/rc.d/init.d/cups
%config /var/cups/conf/classes.conf
%config /var/cups/conf/cupsd.conf
%config /var/cups/conf/mime.convs
%config /var/cups/conf/mime.types
%config /var/cups/conf/printers.conf
/usr/lib/accept
/usr/lib/lpadmin
/usr/lib/reject
/usr/bin/lpr
/usr/bin/lprm
/usr/bin/disable
/usr/bin/enable
/usr/bin/cancel
/usr/bin/lp
/usr/bin/lpstat
/usr/man/man1/backend.1
/usr/man/man1/filter.1
/usr/man/man1/lprm.1
/usr/man/man1/lpr.1
/usr/man/man1/lpstat.1
/usr/man/man1/lp.1
/usr/man/man1/cancel.1
/usr/man/man5/classes.conf.5
/usr/man/man5/cupsd.conf.5
/usr/man/man5/mime.convs.5
/usr/man/man5/mime.types.5
/usr/man/man5/printers.conf.5
/usr/man/man8/accept.8
/usr/man/man8/cupsd.8
/usr/man/man8/enable.8
/usr/man/man8/lpadmin.8
/usr/man/man8/lpc.8
/usr/man/man8/reject.8
/usr/man/man8/disable.8
/usr/sbin/lpc
/usr/sbin/cupsd
/usr/lib/libcups.so.1
/usr/lib/libcupsimage.so.1
%config /var/cups/conf/*
/usr/bin/*
/usr/lib/*
/usr/man/*
/usr/sbin/*
%dir /usr/share/cups
/usr/share/cups/8859-1
/usr/share/cups/8859-14
/usr/share/cups/8859-15
/usr/share/cups/8859-2
/usr/share/cups/8859-3
/usr/share/cups/8859-4
/usr/share/cups/8859-5
/usr/share/cups/8859-6
/usr/share/cups/8859-7
/usr/share/cups/8859-8
/usr/share/cups/8859-9
/usr/share/cups/HPGLprolog
/usr/share/cups/doc/cmp.html
/usr/share/cups/doc/cmp.pdf
/usr/share/cups/doc/cups.css
/usr/share/cups/doc/cupsdoc.css
/usr/share/cups/doc/documentation.html
/usr/share/cups/doc/idd.html
/usr/share/cups/doc/idd.pdf
/usr/share/cups/doc/images/classes.gif
/usr/share/cups/doc/images/cups-block-diagram.gif
/usr/share/cups/doc/images/cups-large.gif
/usr/share/cups/doc/images/cups-medium.gif
/usr/share/cups/doc/images/cups-small.gif
/usr/share/cups/doc/images/logo.gif
/usr/share/cups/doc/images/navbar.gif
/usr/share/cups/doc/images/printer-idle.gif
/usr/share/cups/doc/images/printer-processing.gif
/usr/share/cups/doc/images/printer-stopped.gif
/usr/share/cups/doc/index.html
/usr/share/cups/doc/overview.html
/usr/share/cups/doc/overview.pdf
/usr/share/cups/doc/sam.html
/usr/share/cups/doc/sam.pdf
/usr/share/cups/doc/sdd.html
/usr/share/cups/doc/sdd.pdf
/usr/share/cups/doc/ssr.html
/usr/share/cups/doc/ssr.pdf
/usr/share/cups/doc/stp.html
/usr/share/cups/doc/stp.pdf
/usr/share/cups/doc/sum.html
/usr/share/cups/doc/sum.pdf
/usr/share/cups/doc/svd.html
/usr/share/cups/doc/svd.pdf
/usr/share/cups/fonts/AvantGarde-Book
/usr/share/cups/fonts/AvantGarde-BookOblique
/usr/share/cups/fonts/AvantGarde-Demi
/usr/share/cups/fonts/AvantGarde-DemiOblique
/usr/share/cups/fonts/Bookman-Demi
/usr/share/cups/fonts/Bookman-DemiItalic
/usr/share/cups/fonts/Bookman-Light
/usr/share/cups/fonts/Bookman-LightItalic
/usr/share/cups/fonts/Courier
/usr/share/cups/fonts/Courier-Bold
/usr/share/cups/fonts/Courier-BoldOblique
/usr/share/cups/fonts/Courier-Oblique
/usr/share/cups/fonts/Helvetica
/usr/share/cups/fonts/Helvetica-Bold
/usr/share/cups/fonts/Helvetica-BoldOblique
/usr/share/cups/fonts/Helvetica-Narrow
/usr/share/cups/fonts/Helvetica-Narrow-Bold
/usr/share/cups/fonts/Helvetica-Narrow-BoldOblique
/usr/share/cups/fonts/Helvetica-Narrow-Oblique
/usr/share/cups/fonts/Helvetica-Oblique
/usr/share/cups/fonts/NewCenturySchlbk-Bold
/usr/share/cups/fonts/NewCenturySchlbk-BoldItalic
/usr/share/cups/fonts/NewCenturySchlbk-Italic
/usr/share/cups/fonts/NewCenturySchlbk-Roman
/usr/share/cups/fonts/Palatino-Bold
/usr/share/cups/fonts/Palatino-BoldItalic
/usr/share/cups/fonts/Palatino-Italic
/usr/share/cups/fonts/Palatino-Roman
/usr/share/cups/fonts/Symbol
/usr/share/cups/fonts/Times-Bold
/usr/share/cups/fonts/Times-BoldItalic
/usr/share/cups/fonts/Times-Italic
/usr/share/cups/fonts/Times-Roman
/usr/share/cups/fonts/Utopia-Bold
/usr/share/cups/fonts/Utopia-BoldItalic
/usr/share/cups/fonts/Utopia-Italic
/usr/share/cups/fonts/Utopia-Regular
/usr/share/cups/fonts/ZapfChancery-MediumItalic
/usr/share/cups/fonts/ZapfDingbats
/usr/share/cups/model/deskjet.ppd
/usr/share/cups/model/laserjet.ppd
/usr/share/cups/pstoraster/Fontmap
/usr/share/cups/pstoraster/gs_btokn.ps
/usr/share/cups/pstoraster/gs_ccfnt.ps
/usr/share/cups/pstoraster/gs_cidfn.ps
/usr/share/cups/pstoraster/gs_cmap.ps
/usr/share/cups/pstoraster/gs_cmdl.ps
/usr/share/cups/pstoraster/gs_dbt_e.ps
/usr/share/cups/pstoraster/gs_diskf.ps
/usr/share/cups/pstoraster/gs_dps1.ps
/usr/share/cups/pstoraster/gs_fform.ps
/usr/share/cups/pstoraster/gs_fonts.ps
/usr/share/cups/pstoraster/gs_init.ps
/usr/share/cups/pstoraster/gs_iso_e.ps
/usr/share/cups/pstoraster/gs_kanji.ps
/usr/share/cups/pstoraster/gs_ksb_e.ps
/usr/share/cups/pstoraster/gs_l2img.ps
/usr/share/cups/pstoraster/gs_lev2.ps
/usr/share/cups/pstoraster/gs_mex_e.ps
/usr/share/cups/pstoraster/gs_mro_e.ps
/usr/share/cups/pstoraster/gs_pdf.ps
/usr/share/cups/pstoraster/gs_pdf_e.ps
/usr/share/cups/pstoraster/gs_pdfwr.ps
/usr/share/cups/pstoraster/gs_pfile.ps
/usr/share/cups/pstoraster/gs_res.ps
/usr/share/cups/pstoraster/gs_setpd.ps
/usr/share/cups/pstoraster/gs_statd.ps
/usr/share/cups/pstoraster/gs_std_e.ps
/usr/share/cups/pstoraster/gs_sym_e.ps
/usr/share/cups/pstoraster/gs_ttf.ps
/usr/share/cups/pstoraster/gs_typ42.ps
/usr/share/cups/pstoraster/gs_type1.ps
/usr/share/cups/pstoraster/gs_wan_e.ps
/usr/share/cups/pstoraster/gs_wl1_e.ps
/usr/share/cups/pstoraster/gs_wl2_e.ps
/usr/share/cups/pstoraster/gs_wl5_e.ps
/usr/share/cups/pstoraster/pdf_2ps.ps
/usr/share/cups/pstoraster/pdf_base.ps
/usr/share/cups/pstoraster/pdf_draw.ps
/usr/share/cups/pstoraster/pdf_font.ps
/usr/share/cups/pstoraster/pdf_main.ps
/usr/share/cups/pstoraster/pdf_sec.ps
/usr/share/cups/pstoraster/pfbtogs.ps
/usr/share/cups/*
%dir /var/cups
/var/cups/backend/http
/var/cups/backend/ipp
/var/cups/backend/lpd
/var/cups/backend/parallel
/var/cups/backend/serial
/var/cups/backend/smb
/var/cups/backend/socket
/var/cups/cgi-bin/classes.cgi
/var/cups/cgi-bin/jobs.cgi
/var/cups/cgi-bin/printers.cgi
/var/cups/conf
/var/cups/filter/hpgltops
/var/cups/filter/imagetops
/var/cups/filter/imagetoraster
/var/cups/filter/pstops
/var/cups/filter/pstoraster
/var/cups/filter/rastertohp
/var/cups/filter/texttops
/var/cups/backend/*
/var/cups/cgi-bin/*
/var/cups/filter/*
%dir /var/cups/interfaces
%dir /var/cups/logs
%dir /var/cups/ppd
%dir /var/cups/requests
%dir /etc/cups
%dir /var/log/cups
%files devel
%dir /usr/include/cups
/usr/include/cups/cups.h
/usr/include/cups/http.h
/usr/include/cups/ipp.h
/usr/include/cups/language.h
/usr/include/cups/mime.h
/usr/include/cups/ppd.h
/usr/include/cups/raster.h
/usr/lib/libcups.so
/usr/lib/libcupsimage.so
/usr/include/cups/*
#
# End of "$Id: cups.spec 505 1999-07-08 15:00:20Z mike $".
# End of "$Id: cups.spec 775 1999-11-04 13:35:01Z mike $".
#
+15 -13
Ver Arquivo
@@ -28,9 +28,10 @@ include ../Makedefs
# Object files...
#
OBJS = emit.o filter.o http.o ipp.o language.o mark.o mime.o \
options.o page.o ppd.o raster.o string.o type.o usersys.o \
util.o
LIBOBJS = emit.o filter.o http.o ipp.o language.o mark.o mime.o \
options.o page.o ppd.o raster.o snprintf.o string.o type.o \
usersys.o util.o
OBJS = $(LIBOBJS) testhttp.o testmime.o testppd.o
#
# Header files to install...
@@ -42,7 +43,7 @@ HEADERS = cups.h http.h ipp.h language.h mime.h ppd.h raster.h
# Targets in this directory...
#
TARGETS = $(LIBCUPS) testmime testppd testhttp
TARGETS = $(LIBCUPS) testhttp testmime testppd
#
# Make all targets...
@@ -67,26 +68,26 @@ install: all
-$(MKDIR) $(LIBDIR)
$(CP) $(LIBCUPS) $(LIBDIR)
if test $(LIBCUPS) != "libcups.a"; then \
$(LN) $(LIBCUPS) `basename $(LIBCUPS) .1` \
$(LN) $(LIBCUPS) `basename $(LIBCUPS) .1`; \
fi
#
# libcups.so.1, libcups.sl.1
#
libcups.so.1 libcups.sl.1: $(OBJS) ../Makedefs
libcups.so.1 libcups.sl.1: $(LIBOBJS) ../Makedefs
echo Linking $@...
$(DSO) $@ $(OBJS)
$(LN) $@ `basename $@ .1`
$(DSO) $@ $(LIBOBJS)
-$(LN) $@ `basename $@ .1`
#
# libcups.a
#
libcups.a: $(OBJS)
libcups.a: $(LIBOBJS)
echo Archiving $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(OBJS)
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
#
@@ -109,6 +110,7 @@ options.o: cups.h ../config.h ../Makedefs
page.o: ppd.h ../config.h ../Makedefs
ppd.o: language.h ppd.h ../config.h ../Makedefs
raster.o: raster.h ../config.h ../Makedefs
snprintf.o: string.h ../config.h ../Makedefs
string.o: string.h ../config.h ../Makedefs
type.o: mime.h ../config.h ../Makedefs
usersys.o: cups.h ../config.h ../Makedefs
@@ -120,7 +122,7 @@ util.o: cups.h http.h ipp.h ../config.h ../Makedefs
testhttp: testhttp.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a $(LIBS)
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a $(NETLIBS)
testhttp.o: http.h ../Makedefs
@@ -130,7 +132,7 @@ testhttp.o: http.h ../Makedefs
testmime: testmime.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testmime.o libcups.a $(LIBS)
$(CC) $(LDFLAGS) -o $@ testmime.o libcups.a
testmime.o: mime.h ../Makedefs
@@ -140,7 +142,7 @@ testmime.o: mime.h ../Makedefs
testppd: testppd.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testppd.o libcups.a $(LIBS)
$(CC) $(LDFLAGS) -o $@ testppd.o libcups.a $(NETLIBS)
testppd.o: ppd.h ../Makedefs
+176
Ver Arquivo
@@ -0,0 +1,176 @@
# Microsoft Developer Studio Project File - Name="cups" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=cups - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "cups.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "cups.mak" CFG="cups - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "cups - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "cups - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "cups - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\visualc" /I ".." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"cups.lib"
!ELSEIF "$(CFG)" == "cups - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\visualc" /I ".." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"cupsd.lib"
!ENDIF
# Begin Target
# Name "cups - Win32 Release"
# Name "cups - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\emit.c
# End Source File
# Begin Source File
SOURCE=.\filter.c
# End Source File
# Begin Source File
SOURCE=.\http.c
# End Source File
# Begin Source File
SOURCE=.\ipp.c
# End Source File
# Begin Source File
SOURCE=.\language.c
# End Source File
# Begin Source File
SOURCE=.\mark.c
# End Source File
# Begin Source File
SOURCE=.\mime.c
# End Source File
# Begin Source File
SOURCE=.\options.c
# End Source File
# Begin Source File
SOURCE=.\page.c
# End Source File
# Begin Source File
SOURCE=.\ppd.c
# End Source File
# Begin Source File
SOURCE=.\raster.c
# End Source File
# Begin Source File
SOURCE=.\string.c
# End Source File
# Begin Source File
SOURCE=.\type.c
# End Source File
# Begin Source File
SOURCE=.\util.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\cups.h
# End Source File
# Begin Source File
SOURCE=.\http.h
# End Source File
# Begin Source File
SOURCE=.\ipp.h
# End Source File
# Begin Source File
SOURCE=.\language.h
# End Source File
# Begin Source File
SOURCE=.\mime.h
# End Source File
# Begin Source File
SOURCE=.\ppd.h
# End Source File
# Begin Source File
SOURCE=.\raster.h
# End Source File
# End Group
# End Target
# End Project
+2 -1
Ver Arquivo
@@ -114,10 +114,11 @@ extern int cupsGetClasses(char ***classes);
extern const char *cupsGetDefault(void);
extern const char *cupsGetPPD(const char *printer);
extern int cupsGetPrinters(char ***printers);
extern ipp_status_t cupsLastError(void);
extern int cupsPrintFile(const char *printer, const char *filename,
const char *title, int num_options,
cups_option_t *options);
extern char *cupsTempFile(char *filename, int len);
extern int cupsAddOption(const char *name, const char *value,
int num_options, cups_option_t **options);
extern void cupsFreeOptions(int num_options, cups_option_t *options);
+123
Ver Arquivo
@@ -0,0 +1,123 @@
"us-ascii",
"OK",
"Cancel",
"Help",
"Quit",
"Close",
"Yes",
"No",
"On",
"Off",
"Save",
"Discard",
"Default",
"Options",
"More Info",
"Black",
"Color",
"Cyan",
"Magenta",
"Yellow",
"Copyright 1993-1999 by Easy Software Products, All Rights Reserved.",
"General",
"Printer",
"Image Options",
"HP-GL/2 Options",
"Extra",
"Document",
"Other",
"Print Pages: ",
"Entire Document",
"Page Range:",
"Reverse Order: ",
"Page Format: ",
" 1-Up",
" 2-Up",
" 4-Up",
"Image Scaling: ",
"Use Natural Image Size",
"Zoom by Percent",
"Zoom by PPI",
"Mirror Image: ",
"Color Saturation: ",
"Color Hue: ",
"Fit to Page: ",
"Shading: ",
"Pen Width: ",
"Gamma Correction: ",
"Brightness: ",
"Add",
"Delete",
"Modify",
"Printer URI",
"Printer Name",
"Printer Location",
"Printer Info",
"Printer Make and Model",
"Device URI",
"Formatting Page",
"Printing Page",
"Initializing Printer",
"Printer State",
"Accepting Jobs",
"Not Accepting Jobs",
"Print Jobs",
"Class",
"Local",
"Remote",
"Duplexing",
"Stapling",
"Fast Copies",
"Collated Copies",
"Hole Punching",
"Covering",
"Binding",
"Sorting",
"Small (up to 9.5x14in)",
"Medium (9.5x14in to 13x19in)",
"Large (13x19in and larger)",
"Custom Size",
"Idle",
"Processing",
"Stopped",
"All",
"Odd",
"Even Pages",
"Darker Lighter",
"Media Size",
"Media Type",
"Media Source",
"Orientation: ",
"Portrait",
"Landscape",
"Job State",
"Job Name",
"User Name",
"Priority",
"Copies",
"File Size",
"Pending",
"Output Mode",
"Resolution",
"400 Your browser sent a request that this server could not understand.",
"This server could not verify that you are authorized to access the resource.",
"You must pay to access this server.",
"You don't have permission to access the resource on this server.",
"The requested resource was not found on this server.",
"The requested method is not allowed with the resource.",
"An appropriate representation for the resource was not found on this server.",
"You don't have permission to use this server as a proxy host.",
"The request has taken too long to complete and has been aborted.",
"The requested resource has more than one value.",
"The requested resource is gone and has not been replaced.",
"The requested method requires a valid Content-Length.",
"The precondition on the request evaluated to false.",
"The request is too large for this server to process.",
"The request URI is too large for this server to process.",
"The request format is not understood by this server.",
"500 The server has detected an unrecoverable error and cannot process your request.",
"The requested method is not implemented by this server.",
"The proxy server received an invalid response from an upstream server.",
"The requested resource is currently unavailable on this server.",
"The proxy server has taken too long to respond to this server.",
"This server does not support the HTTP version required by your browser.",
+3 -3
Ver Arquivo
@@ -86,8 +86,8 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */
return (-1);
}
if (strcmp(((ppd_option_t *)choices[i]->option)->keyword, "PageSize") == 0 &&
strcmp(choices[i]->choice, "Custom") == 0)
if (strcasecmp(((ppd_option_t *)choices[i]->option)->keyword, "PageSize") == 0 &&
strcasecmp(choices[i]->choice, "Custom") == 0)
{
/*
* Variable size; write out standard size options (this should
@@ -107,7 +107,7 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */
*/
fputs("pop pop pop\n", fp);
fputs("<</PageSize[7 -2 roll]/ImagingBBox null>>setpagedevice\n", fp);
fputs("<</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\n", fp);
}
}
+4 -2
Ver Arquivo
@@ -88,7 +88,8 @@ mimeAddFilter(mime_t *mime, /* I - MIME database */
if (temp->cost > cost)
{
temp->cost = cost;
strcpy(temp->filter, filter);
strncpy(temp->filter, filter, sizeof(temp->filter) - 1);
temp->filter[sizeof(temp->filter) - 1] = '\0';
}
}
else
@@ -116,7 +117,8 @@ mimeAddFilter(mime_t *mime, /* I - MIME database */
temp->src = src;
temp->dst = dst;
temp->cost = cost;
strcpy(temp->filter, filter);
strncpy(temp->filter, filter, sizeof(temp->filter) - 1);
temp->filter[sizeof(temp->filter) - 1] = '\0';
if (mime->num_filters > 1)
qsort(mime->filters, mime->num_filters, sizeof(mime_filter_t),
+201 -69
Ver Arquivo
@@ -25,6 +25,8 @@
*
* 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.
* httpReconnect() - Reconnect to a HTTP server...
@@ -66,6 +68,7 @@
#include <ctype.h>
#include "string.h"
#include <fcntl.h>
#include <errno.h>
#include "http.h"
#include "ipp.h"
@@ -189,6 +192,41 @@ httpInitialize(void)
}
/*
* 'httpCheck()' - Check to see if there is a pending response from the server.
*/
int /* O - 0 = no data, 1 = data available */
httpCheck(http_t *http) /* I - HTTP connection */
{
fd_set input; /* Input set for select() */
struct timeval timeout; /* Timeout */
/*
* First see if there is data in the buffer...
*/
if (http == NULL)
return (0);
if (http->used)
return (1);
/*
* Then try doing a select() to poll the socket...
*/
FD_ZERO(&input);
FD_SET(http->fd, &input);
timeout.tv_sec = 0;
timeout.tv_usec = 0;
return (select(http->fd + 1, &input, NULL, NULL, &timeout) > 0);
}
/*
* 'httpClose()' - Close an HTTP connection...
*/
@@ -246,8 +284,7 @@ httpConnect(const char *host, /* I - Host to connect to */
* Copy the hostname and port and then "reconnect"...
*/
strcpy(http->hostname, host);
memset((char *)&(http->hostaddr), 0, sizeof(http->hostaddr));
strncpy(http->hostname, host, sizeof(http->hostname) - 1);
memcpy((char *)&(http->hostaddr.sin_addr), hostaddr->h_addr, hostaddr->h_length);
http->hostaddr.sin_family = hostaddr->h_addrtype;
#ifdef WIN32
@@ -291,7 +328,11 @@ httpReconnect(http_t *http) /* I - HTTP data */
*/
if ((http->fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
http->error = errno;
http->status = HTTP_ERROR;
return (-1);
}
#ifdef FD_CLOEXEC
fcntl(http->fd, F_SETFD, FD_CLOEXEC); /* Close this socket when starting *
@@ -313,6 +354,9 @@ httpReconnect(http_t *http) /* I - HTTP data */
if (connect(http->fd, (struct sockaddr *)&(http->hostaddr),
sizeof(http->hostaddr)) < 0)
{
http->error = errno;
http->status = HTTP_ERROR;
#ifdef WIN32
closesocket(http->fd);
#else
@@ -322,6 +366,9 @@ httpReconnect(http_t *http) /* I - HTTP data */
return (-1);
}
http->error = 0;
http->status = HTTP_CONTINUE;
return (0);
}
@@ -333,11 +380,11 @@ httpReconnect(http_t *http) /* I - HTTP data */
void
httpSeparate(const char *uri, /* I - Universal Resource Identifier */
char *method, /* O - Method (http, https, etc.) */
char *username, /* O - Username */
char *host, /* O - Hostname */
char *method, /* O - Method [32] (http, https, etc.) */
char *username, /* O - Username [32] */
char *host, /* O - Hostname [32] */
int *port, /* O - Port number to use */
char *resource) /* O - Resource/filename */
char *resource) /* O - Resource/filename [1024] */
{
char *ptr; /* Pointer into string... */
@@ -367,7 +414,8 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
{
if ((ptr = strchr(host, '/')) != NULL)
{
strcpy(resource, ptr);
strncpy(resource, ptr, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
*ptr = '\0';
}
else
@@ -382,7 +430,10 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
*port = strtol(uri, (char **)&uri, 10);
if (*uri == '/')
strcpy(resource, uri);
{
strncpy(resource, uri, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
}
}
else
*port = 0;
@@ -392,7 +443,10 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
return;
}
else
strcpy(method, host);
{
strncpy(method, host, 31);
method[31] = '\0';
}
/*
* If the method starts with less than 2 slashes then it is a local resource...
@@ -400,7 +454,9 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
if (strncmp(uri, "//", 2) != 0)
{
strcpy(resource, uri);
strncpy(resource, uri, 1023);
resource[1023] = '\0';
username[0] = '\0';
host[0] = '\0';
*port = 0;
@@ -415,7 +471,7 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
uri ++;
ptr = host;
while (*uri != ':' && *uri != '@' && *uri != '/' && *uri != '\0')
while (!(*uri == ':' && isdigit(uri[1])) && *uri != '@' && *uri != '/' && *uri != '\0')
*ptr ++ = *uri ++;
*ptr = '\0';
@@ -426,9 +482,11 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
* Got a username...
*/
strcpy(username, host);
strncpy(username, host, 31);
username[31] = '\0';
ptr = host;
uri ++;
while (*uri != ':' && *uri != '/' && *uri != '\0')
*ptr ++ = *uri ++;
@@ -484,7 +542,8 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
* The remaining portion is the resource string...
*/
strcpy(resource, uri);
strncpy(resource, uri, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
}
@@ -628,12 +687,15 @@ httpRead(http_t *http, /* I - HTTP data */
return (0);
if (http->data_encoding == HTTP_ENCODE_CHUNKED &&
http->data_remaining <= 0 &&
(http->state == HTTP_GET_SEND || http->state == HTTP_POST_RECV ||
http->state == HTTP_POST_SEND || http->state == HTTP_PUT_RECV))
http->data_remaining <= 0)
{
DEBUG_puts("httpRead: Getting chunk length...");
if (httpGets(len, sizeof(len), http) == NULL)
{
DEBUG_puts("httpRead: Could not get length!");
return (0);
}
http->data_remaining = strtol(len, NULL, 16);
}
@@ -647,6 +709,9 @@ httpRead(http_t *http, /* I - HTTP data */
* data, go idle...
*/
if (http->data_encoding == HTTP_ENCODE_CHUNKED)
httpGets(len, sizeof(len), http);
if (http->state == HTTP_POST_RECV)
http->state ++;
else
@@ -681,13 +746,21 @@ httpRead(http_t *http, /* I - HTTP data */
if (bytes > 0)
http->data_remaining -= bytes;
else if (bytes < 0)
http->error = errno;
if (http->data_remaining == 0 && http->data_encoding != HTTP_ENCODE_CHUNKED)
if (http->data_remaining == 0)
{
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
if (http->data_encoding == HTTP_ENCODE_CHUNKED)
httpGets(len, sizeof(len), http);
if (http->data_encoding != HTTP_ENCODE_CHUNKED)
{
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
}
}
return (bytes);
@@ -713,28 +786,30 @@ httpWrite(http_t *http, /* I - HTTP data */
http->activity = time(NULL);
if (http->data_encoding == HTTP_ENCODE_CHUNKED &&
(http->state == HTTP_GET_SEND || http->state == HTTP_POST_RECV ||
http->state == HTTP_POST_SEND || http->state == HTTP_PUT_RECV))
if (http->data_encoding == HTTP_ENCODE_CHUNKED)
{
sprintf(len, "%x\r\n", length);
if (send(http->fd, len, strlen(len), 0) < 3)
if (httpPrintf(http, "%x\r\n", length) < 0)
return (-1);
}
if (length == 0)
{
/*
* A zero-length chunk ends a transfer; unless we are sending POST
* data, go idle...
*/
if (length == 0)
{
/*
* A zero-length chunk ends a transfer; unless we are sending POST
* data, go idle...
*/
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
DEBUG_puts("httpWrite: changing states...");
return (0);
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
if (httpPrintf(http, "\r\n") < 0)
return (-1);
return (0);
}
}
tbytes = 0;
@@ -745,6 +820,7 @@ httpWrite(http_t *http, /* I - HTTP data */
if (bytes < 0)
{
DEBUG_puts("httpWrite: error writing data...\n");
return (-1);
}
@@ -755,12 +831,18 @@ httpWrite(http_t *http, /* I - HTTP data */
http->data_remaining -= bytes;
}
if (http->data_encoding == HTTP_ENCODE_CHUNKED)
if (httpPrintf(http, "\r\n") < 0)
return (-1);
if (http->data_remaining == 0 && http->data_encoding == HTTP_ENCODE_LENGTH)
{
/*
* Finished with the transfer; unless we are sending POST data, go idle...
*/
DEBUG_puts("httpWrite: changing states...");
if (http->state == HTTP_POST_RECV)
http->state ++;
else
@@ -797,6 +879,8 @@ httpGets(char *line, /* I - Line to read into */
* Pre-scan the buffer and see if there is a newline in there...
*/
errno = 0;
do
{
bufptr = http->buffer;
@@ -814,23 +898,36 @@ httpGets(char *line, /* I - Line to read into */
* No newline; see if there is more data to be read...
*/
if ((bytes = recv(http->fd, bufend, HTTP_MAX_BUFFER - http->used, 0)) < 1)
if ((bytes = recv(http->fd, bufend, HTTP_MAX_BUFFER - http->used, 0)) < 0)
{
/*
* Nope, can't get a line this time...
*/
if (errno != http->error)
{
http->error = errno;
continue;
}
DEBUG_printf(("httpGets(): recv() error %d!\n", errno));
return (NULL);
}
else
else if (bytes == 0)
{
/*
* Yup, update the amount used and the end pointer...
*/
if (http->blocking)
http->error = EPIPE;
http->used += bytes;
bufend += bytes;
return (NULL);
}
/*
* Yup, update the amount used and the end pointer...
*/
http->used += bytes;
bufend += bytes;
}
}
while (bufptr >= bufend);
@@ -858,6 +955,7 @@ httpGets(char *line, /* I - Line to read into */
if (http->used > 0)
memcpy(http->buffer, bufptr, http->used);
DEBUG_printf(("httpGets(): Returning \"%s\"\n", line));
return (line);
}
else if (*bufptr == 0x0d)
@@ -866,6 +964,8 @@ httpGets(char *line, /* I - Line to read into */
*lineptr++ = *bufptr++;
}
DEBUG_puts("httpGets(): No new line available!");
return (NULL);
}
@@ -879,18 +979,25 @@ httpPrintf(http_t *http, /* I - HTTP data */
const char *format, /* I - printf-style format string */
...) /* I - Additional args as needed */
{
int bytes; /* Number of bytes to write */
char buf[HTTP_MAX_BUFFER]; /* Buffer for formatted string */
int bytes, /* Number of bytes to write */
nbytes, /* Number of bytes written */
tbytes; /* Number of bytes all together */
char buf[HTTP_MAX_BUFFER], /* Buffer for formatted string */
*bufptr; /* Pointer into buffer */
va_list ap; /* Variable argument pointer */
va_start(ap, format);
bytes = vsprintf(buf, format, ap);
bytes = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
DEBUG_printf(("httpPrintf: %s", buf));
return (send(http->fd, buf, bytes, 0));
for (tbytes = 0, bufptr = buf; tbytes < bytes; tbytes += nbytes, bufptr += nbytes)
if ((nbytes = send(http->fd, bufptr, bytes - tbytes, 0)) < 0)
return (-1);
return (bytes);
}
@@ -969,7 +1076,7 @@ httpGetDateTime(const char *s) /* I - Date/time string */
int hour, min, sec; /* Time */
if (sscanf(s, "%*s%d%s%d%d:%d:%d", &day, mon, &year, &hour, &min, &sec) < 6)
if (sscanf(s, "%*s%d%15s%d%d:%d:%d", &day, mon, &year, &hour, &min, &sec) < 6)
return (0);
for (i = 0; i < 12; i ++)
@@ -1089,7 +1196,20 @@ httpUpdate(http_t *http) /* I - HTTP data */
httpSetField(http, field, value);
}
else
{
http->status = HTTP_ERROR;
return (HTTP_ERROR);
}
}
/*
* See if there was an error...
*/
if (http->error)
{
http->status = HTTP_ERROR;
return (HTTP_ERROR);
}
/*
@@ -1200,7 +1320,10 @@ httpEncode64(char *out, /* I - String to write to */
in ++;
if (*in == '\0')
{
*outptr ++ = '=';
break;
}
*outptr ++ = base64[((in[0] << 2) | (in[1] >> 6)) & 63];
@@ -1230,14 +1353,18 @@ httpEncode64(char *out, /* I - String to write to */
int /* O - Content length */
httpGetLength(http_t *http) /* I - HTTP data */
{
DEBUG_printf(("httpGetLength(%08x)\n", http));
if (strcasecmp(http->fields[HTTP_FIELD_TRANSFER_ENCODING], "chunked") == 0)
{
DEBUG_puts("httpGetLength: chunked request!");
http->data_encoding = HTTP_ENCODE_CHUNKED;
http->data_remaining = 0;
}
else
{
http->data_encoding = HTTP_ENCODE_LENGTH;
http->data_encoding = HTTP_ENCODE_LENGTH;
/*
* The following is a hack for HTTP servers that don't send a
@@ -1251,6 +1378,8 @@ httpGetLength(http_t *http) /* I - HTTP data */
http->data_remaining = 2147483647;
else
http->data_remaining = atoi(http->fields[HTTP_FIELD_CONTENT_LENGTH]);
DEBUG_printf(("httpGetLength: content_length = %d\n", http->data_remaining));
}
return (http->data_remaining);
@@ -1326,6 +1455,13 @@ http_send(http_t *http, /* I - HTTP data */
*ptr = '\0';
/*
* See if we had an error the last time around; if so, reconnect...
*/
if (http->status == HTTP_ERROR || http->status >= HTTP_BAD_REQUEST)
httpReconnect(http);
/*
* Send the request header...
*/
@@ -1334,22 +1470,12 @@ http_send(http_t *http, /* I - HTTP data */
if (request == HTTP_POST || request == HTTP_PUT)
http->state ++;
if (httpPrintf(http, "%s %s HTTP/1.1\n", codes[request], buf) < 1)
http->status = HTTP_CONTINUE;
if (httpPrintf(http, "%s %s HTTP/1.1\r\n", codes[request], buf) < 1)
{
/*
* Might have lost connection; try to reconnect...
*/
if (httpReconnect(http))
return (-1);
/*
* OK, we've reconnected, send the request again...
*/
if (httpPrintf(http, "%s %s HTTP/%d.%d\n", codes[request], buf,
http->version / 100, http->version % 100) < 1)
return (-1);
http->status = HTTP_ERROR;
return (-1);
}
for (i = 0; i < HTTP_FIELD_MAX; i ++)
@@ -1357,12 +1483,18 @@ http_send(http_t *http, /* I - HTTP data */
{
DEBUG_printf(("%s: %s\n", http_fields[i], http->fields[i]));
if (httpPrintf(http, "%s: %s\n", http_fields[i], http->fields[i]) < 1)
return (-1);
if (httpPrintf(http, "%s: %s\r\n", http_fields[i], http->fields[i]) < 1)
{
http->status = HTTP_ERROR;
return (-1);
}
}
if (httpPrintf(http, "\n") < 1)
if (httpPrintf(http, "\r\n") < 1)
{
http->status = HTTP_ERROR;
return (-1);
}
httpClearFields(http);
+3
Ver Arquivo
@@ -221,6 +221,7 @@ typedef struct
{
int fd; /* File descriptor for this socket */
int blocking; /* To block or not to block */
int error; /* Last error on read */
time_t activity; /* Time since last read/write */
http_state_t state; /* State of client */
http_status_t status; /* Status of last request */
@@ -245,11 +246,13 @@ typedef struct
*/
# define httpBlocking(http,b) (http)->blocking = (b)
extern int httpCheck(http_t *http);
# define httpClearFields(http) memset((http)->fields, 0, sizeof((http)->fields)),\
httpSetField((http), HTTP_FIELD_HOST, (http)->hostname)
extern void httpClose(http_t *http);
extern http_t *httpConnect(const char *host, int port);
extern int httpDelete(http_t *http, const char *uri);
# define httpError(http) ((http)->error)
extern void httpFlush(http_t *http);
extern int httpGet(http_t *http, const char *uri);
extern char *httpGets(char *line, int length, http_t *http);
+19 -21
Ver Arquivo
@@ -65,7 +65,7 @@
*/
static ipp_attribute_t *add_attr(ipp_t *ipp, int num_values);
static int ipp_read(http_t *http, char *buffer, int length);
static int ipp_read(http_t *http, unsigned char *buffer, int length);
/*
@@ -512,8 +512,6 @@ ippDateToTime(const ipp_uchar_t *date) /* I - RFC 1903 date info */
else
t -= date[9] * 3600 + date[10] * 60;
t -= timezone;
return (t);
}
@@ -595,7 +593,7 @@ ippFindAttribute(ipp_t *ipp, /* I - IPP request */
DEBUG_printf(("ippFindAttribute: attr = %08x, name = \'%s\'\n", attr,
attr->name));
if (attr->name != NULL && strcmp(attr->name, name) == 0 &&
if (attr->name != NULL && strcasecmp(attr->name, name) == 0 &&
(attr->value_tag == type ||
(attr->value_tag == IPP_TAG_TEXTLANG && type == IPP_TAG_TEXT) ||
(attr->value_tag == IPP_TAG_NAMELANG && type == IPP_TAG_NAME)))
@@ -725,7 +723,7 @@ ippRead(http_t *http, /* I - HTTP data */
ipp_t *ipp) /* I - IPP data */
{
int n; /* Length of data */
char buffer[8192]; /* Data buffer */
unsigned char buffer[8192]; /* Data buffer */
ipp_attribute_t *attr; /* Current attribute */
ipp_tag_t tag; /* Current tag */
@@ -803,7 +801,7 @@ ippRead(http_t *http, /* I - HTTP data */
ipp->state = IPP_DATA;
break;
}
else if (tag <= IPP_TAG_UNSUPPORTED)
else if (tag < IPP_TAG_UNSUPPORTED_VALUE)
{
/*
* Group tag... Set the current group and continue...
@@ -867,7 +865,7 @@ ippRead(http_t *http, /* I - HTTP data */
attr->group_tag = ipp->curtag;
attr->value_tag = tag;
attr->name = strdup(buffer);
attr->name = strdup((char *)buffer);
attr->num_values = 0;
}
@@ -913,7 +911,7 @@ ippRead(http_t *http, /* I - HTTP data */
buffer[n] = '\0';
DEBUG_printf(("ippRead: value = \'%s\'\n", buffer));
attr->values[attr->num_values].string.text = strdup(buffer);
attr->values[attr->num_values].string.text = strdup((char *)buffer);
break;
case IPP_TAG_DATE :
if (ipp_read(http, buffer, 11) < 11)
@@ -952,7 +950,7 @@ ippRead(http_t *http, /* I - HTTP data */
buffer[n] = '\0';
attr->values[attr->num_values].string.charset = strdup(buffer);
attr->values[attr->num_values].string.charset = strdup((char *)buffer);
if (ipp_read(http, buffer, 2) < 2)
return (IPP_ERROR);
@@ -964,7 +962,7 @@ ippRead(http_t *http, /* I - HTTP data */
buffer[n] = '\0';
attr->values[attr->num_values].string.text = strdup(buffer);
attr->values[attr->num_values].string.text = strdup((char *)buffer);
break;
}
@@ -1044,7 +1042,7 @@ ippWrite(http_t *http, /* I - HTTP data */
{
int i; /* Looping var */
int n; /* Length of data */
char buffer[8192], /* Data buffer */
unsigned char buffer[8192], /* Data buffer */
*bufptr; /* Pointer into buffer */
ipp_attribute_t *attr; /* Current attribute */
@@ -1073,7 +1071,7 @@ ippWrite(http_t *http, /* I - HTTP data */
*bufptr++ = ipp->request.any.request_id >> 8;
*bufptr++ = ipp->request.any.request_id;
if (httpWrite(http, buffer, bufptr - buffer) < 0)
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP header...");
return (IPP_ERROR);
@@ -1329,7 +1327,7 @@ ippWrite(http_t *http, /* I - HTTP data */
* Write the data out...
*/
if (httpWrite(http, buffer, bufptr - buffer) < 0)
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
@@ -1352,7 +1350,7 @@ ippWrite(http_t *http, /* I - HTTP data */
*/
buffer[0] = IPP_TAG_END;
if (httpWrite(http, buffer, 1) < 0)
if (httpWrite(http, (char *)buffer, 1) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP end-tag...");
return (IPP_ERROR);
@@ -1429,13 +1427,13 @@ add_attr(ipp_t *ipp, /* I - IPP request */
* 'ipp_read()' - Semi-blocking read on a HTTP connection...
*/
static int /* O - Number of bytes read */
ipp_read(http_t *http, /* I - Client connection */
char *buffer,/* O - Buffer for data */
int length) /* I - Total length */
static int /* O - Number of bytes read */
ipp_read(http_t *http, /* I - Client connection */
unsigned char *buffer, /* O - Buffer for data */
int length) /* I - Total length */
{
int tbytes, /* Total bytes read */
bytes; /* Bytes read this pass */
int tbytes, /* Total bytes read */
bytes; /* Bytes read this pass */
/*
@@ -1443,7 +1441,7 @@ ipp_read(http_t *http, /* I - Client connection */
*/
for (tbytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
if ((bytes = httpRead(http, buffer, length - tbytes)) <= 0)
if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) <= 0)
break;
/*
+4 -3
Ver Arquivo
@@ -75,8 +75,8 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_JOB,
IPP_TAG_END,
IPP_TAG_PRINTER,
IPP_TAG_EXTENSION,
IPP_TAG_UNSUPPORTED = 0x10,
IPP_TAG_UNSUPPORTED_GROUP,
IPP_TAG_UNSUPPORTED_VALUE = 0x10,
IPP_TAG_DEFAULT,
IPP_TAG_UNKNOWN,
IPP_TAG_NOVALUE,
@@ -87,11 +87,12 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_DATE,
IPP_TAG_RESOLUTION,
IPP_TAG_RANGE,
IPP_TAG_COLLECTION,
IPP_TAG_TEXTLANG,
IPP_TAG_NAMELANG,
IPP_TAG_TEXT = 0x41,
IPP_TAG_NAME,
IPP_TAG_KEYWORD,
IPP_TAG_KEYWORD = 0x44,
IPP_TAG_URI,
IPP_TAG_URISCHEME,
IPP_TAG_CHARSET,
+22 -5
Ver Arquivo
@@ -146,13 +146,29 @@ cupsLangGet(const char *language) /* I - Language or locale */
* standard POSIX locale and is copied unchanged. Otherwise the
* language string is converted from ll-cc (language-country) to ll_CC
* to match the file naming convention used by all POSIX-compliant
* operating systems.
* operating systems. Any trailing character set specification is
* dropped.
*/
if (language == NULL || language[0] == '\0')
if (language == NULL || language[0] == '\0' ||
strcmp(language, "POSIX") == 0)
strcpy(langname, "C");
else
strcpy(langname, language);
{
/*
* Copy the locale string over safely...
*/
strncpy(langname, language, sizeof(langname) - 1);
langname[sizeof(langname) - 1] = '\0';
/*
* Strip charset from "locale.charset"...
*/
if ((text = strchr(langname, '.')) != NULL)
*text = '\0';
}
if (strlen(langname) < 2)
strcpy(real, "C");
@@ -185,7 +201,7 @@ cupsLangGet(const char *language) /* I - Language or locale */
if ((localedir = getenv("LOCALEDIR")) == NULL)
localedir = CUPS_LOCALEDIR;
sprintf(filename, "%s/%s/cups_%s", localedir, real, real);
snprintf(filename, sizeof(filename), "%s/%s/cups_%s", localedir, real, real);
if ((fp = fopen(filename, "r")) == NULL)
if (strlen(real) > 2)
@@ -195,7 +211,8 @@ cupsLangGet(const char *language) /* I - Language or locale */
*/
real[2] = '\0';
sprintf(filename, "%s/%s/cups_%s", localedir, real, real);
snprintf(filename, sizeof(filename), "%s/%s/cups_%s", localedir, real,
real);
fp = fopen(filename, "r");
}
+6 -1
Ver Arquivo
@@ -177,7 +177,12 @@ typedef struct cups_lang_str /**** Language Cache Structure ****/
* Prototypes...
*/
# define cupsLangDefault() cupsLangGet(setlocale(LC_ALL, ""))
# ifdef WIN32
# define cupsLangDefault() cupsLangGet(setlocale(LC_ALL, ""))
# else /* This fix works around bugs in the Linux and HP-UX setlocale() */
# define cupsLangDefault() cupsLangGet(getenv("LANG"))
# endif /* WIN32 */
extern char *cupsLangEncoding(cups_lang_t *lang);
extern void cupsLangFlush(void);
extern void cupsLangFree(cups_lang_t *lang);
+24 -52
Ver Arquivo
@@ -33,7 +33,6 @@
* ppdMarkDefaults() - Mark all default options in the PPD file.
* ppdMarkOption() - Mark an option in a PPD file.
* ppd_defaults() - Set the defaults for this group and all sub-groups.
* ppd_default() - Set the default choice for an option.
*/
/*
@@ -48,8 +47,7 @@
* Local functions...
*/
static void ppd_defaults(ppd_group_t *g);
static void ppd_default(ppd_option_t *o);
static void ppd_defaults(ppd_file_t *ppd, ppd_group_t *g);
/*
@@ -119,7 +117,7 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
if (c1->marked)
break;
if (j == 0)
if (j == 0 || strcasecmp(c1->choice, "None") == 0)
c1 = NULL;
}
@@ -149,7 +147,7 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
if (c2->marked)
break;
if (j == 0)
if (j == 0 || strcasecmp(c2->choice, "None") == 0)
c2 = NULL;
}
@@ -190,7 +188,7 @@ ppdFindChoice(ppd_option_t *o, /* I - Pointer to option */
return (NULL);
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
if (strcmp(c->choice, choice) == 0)
if (strcasecmp(c->choice, choice) == 0)
return (c);
return (NULL);
@@ -241,12 +239,12 @@ ppdFindOption(ppd_file_t *ppd, /* I - PPD file data */
for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++)
{
for (j = g->num_options, o = g->options; j > 0; j --, o ++)
if (strcmp(o->keyword, option) == 0)
if (strcasecmp(o->keyword, option) == 0)
return (o);
for (j = g->num_subgroups, sg = g->subgroups; j > 0; j --, sg ++)
for (k = sg->num_options, o = sg->options; k > 0; k --, o ++)
if (strcmp(o->keyword, option) == 0)
if (strcasecmp(o->keyword, option) == 0)
return (o);
}
@@ -296,12 +294,7 @@ ppdMarkDefaults(ppd_file_t *ppd)/* I - PPD file record */
return;
for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++)
ppd_defaults(g);
o = ppdFindOption(ppd, "PageSize");
for (i = 0; i < ppd->num_sizes; i ++)
ppd->sizes[i].marked = strcmp(ppd->sizes[i].name, o->defchoice) == 0;
ppd_defaults(ppd, g);
}
@@ -327,7 +320,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
if (ppd == NULL)
return (0);
if (strcmp(option, "PageSize") == 0 && strncmp(choice, "Custom.", 7) == 0)
if (strcasecmp(option, "PageSize") == 0 && strncasecmp(choice, "Custom.", 7) == 0)
{
/*
* Handle variable page sizes...
@@ -341,7 +334,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
return (0);
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
if (strcmp(c->choice, choice) == 0)
if (strcasecmp(c->choice, choice) == 0)
break;
if (i)
@@ -354,33 +347,33 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
if (o->ui != PPD_UI_PICKMANY)
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
if (strcmp(c->choice, choice) != 0)
if (strcasecmp(c->choice, choice) != 0)
c->marked = 0;
if (strcmp(option, "PageSize") == 0 || strcmp(option, "PageRegion") == 0)
if (strcasecmp(option, "PageSize") == 0 || strcasecmp(option, "PageRegion") == 0)
{
/*
* Mark current page size...
*/
for (i = 0; i < ppd->num_sizes; i ++)
ppd->sizes[i].marked = strcmp(ppd->sizes[i].name, choice) == 0;
ppd->sizes[i].marked = strcasecmp(ppd->sizes[i].name, choice) == 0;
/*
* Unmark the current PageSize or PageRegion setting, as appropriate...
*/
if (strcmp(option, "PageSize") == 0)
if (strcasecmp(option, "PageSize") == 0)
{
o = ppdFindOption(ppd, "PageRegion");
for (i = 0; i < o->num_choices; i ++)
o->choices[i].marked = 0;
if ((o = ppdFindOption(ppd, "PageRegion")) != NULL)
for (i = 0; i < o->num_choices; i ++)
o->choices[i].marked = 0;
}
else
{
o = ppdFindOption(ppd, "PageSize");
for (i = 0; i < o->num_choices; i ++)
o->choices[i].marked = 0;
if ((o = ppdFindOption(ppd, "PageSize")) != NULL)
for (i = 0; i < o->num_choices; i ++)
o->choices[i].marked = 0;
}
}
}
@@ -394,7 +387,8 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
*/
static void
ppd_defaults(ppd_group_t *g) /* I - Group to default */
ppd_defaults(ppd_file_t *ppd, /* I - PPD file */
ppd_group_t *g) /* I - Group to default */
{
int i; /* Looping var */
ppd_option_t *o; /* Current option */
@@ -405,33 +399,11 @@ ppd_defaults(ppd_group_t *g) /* I - Group to default */
return;
for (i = g->num_options, o = g->options; i > 0; i --, o ++)
if (strcmp(o->keyword, "PageRegion") != 0)
ppd_default(o);
if (strcasecmp(o->keyword, "PageRegion") != 0)
ppdMarkOption(ppd, o->keyword, o->defchoice);
for (i = g->num_subgroups, sg = g->subgroups; i > 0; i --, sg ++)
ppd_defaults(sg);
}
/*
* 'ppd_default()' - Set the default choice for an option.
*/
static void
ppd_default(ppd_option_t *o) /* I - Option to default */
{
int i; /* Looping var */
ppd_choice_t *c; /* Current choice */
if (o == NULL)
return;
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
if (strcmp(c->choice, o->defchoice) == 0)
c->marked = 1;
else
c->marked = 0;
ppd_defaults(ppd, sg);
}
+8 -3
Ver Arquivo
@@ -33,6 +33,9 @@
* Revision History:
*
* $Log: mime.c,v $
* Revision 1.15 1999/10/10 15:40:23 mike
* Scanf, strcpy, and sprintf security changes.
*
* Revision 1.14 1999/07/12 16:09:38 mike
* Fixed all constant arrays to use "const" modifier.
*
@@ -198,7 +201,9 @@ mimeMerge(mime_t *mime, /* I - MIME database to add to */
if (pathname == NULL)
return (NULL);
strcpy(filename, pathname);
strncpy(filename, pathname, sizeof(filename) - 1);
filename[sizeof(filename) - 1] = '\0';
pathsep = filename + strlen(filename);
if (pathsep == filename ||
(pathsep[-1] != '/' && pathsep[-1] != '\\'))
@@ -298,7 +303,7 @@ mimeMerge(mime_t *mime, /* I - MIME database to add to */
* Load a mime.types file...
*/
sprintf(filename, "%s/%s", pathname, dent->d_name);
snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->d_name);
load_types(mime, filename);
}
}
@@ -318,7 +323,7 @@ mimeMerge(mime_t *mime, /* I - MIME database to add to */
* Load a mime.convs file...
*/
sprintf(filename, "%s/%s", pathname, dent->d_name);
snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->d_name);
load_convs(mime, filename);
}
}
+8 -8
Ver Arquivo
@@ -62,7 +62,7 @@ cupsAddOption(const char *name, /* I - Name of option */
*/
for (i = 0, temp = *options; i < num_options; i ++, temp ++)
if (strcmp(temp->name, name) == 0)
if (strcasecmp(temp->name, name) == 0)
break;
if (i >= num_options)
@@ -140,7 +140,7 @@ cupsGetOption(const char *name, /* I - Name of option */
return (NULL);
for (i = 0; i < num_options; i ++)
if (strcmp(options[i].name, name) == 0)
if (strcasecmp(options[i].name, name) == 0)
return (options[i].value);
return (NULL);
@@ -287,7 +287,7 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
conflict = 0;
for (i = num_options; i > 0; i --, options ++)
if (strcmp(options->name, "media") == 0)
if (strcasecmp(options->name, "media") == 0)
{
/*
* Loop through the option string, separating it at commas and
@@ -324,9 +324,9 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
conflict = 1;
}
}
else if (strcmp(options->name, "sides") == 0)
else if (strcasecmp(options->name, "sides") == 0)
{
if (strcmp(options->value, "one-sided") == 0)
if (strcasecmp(options->value, "one-sided") == 0)
{
if (ppdMarkOption(ppd, "Duplex", "None"))
conflict = 1;
@@ -335,7 +335,7 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
if (ppdMarkOption(ppd, "KD03Duplex", "None")) /* Kodak */
conflict = 1;
}
else if (strcmp(options->value, "two-sided-long-edge") == 0)
else if (strcasecmp(options->value, "two-sided-long-edge") == 0)
{
if (ppdMarkOption(ppd, "Duplex", "DuplexNoTumble"))
conflict = 1;
@@ -344,7 +344,7 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
if (ppdMarkOption(ppd, "KD03Duplex", "DuplexNoTumble")) /* Kodak */
conflict = 1;
}
else if (strcmp(options->value, "two-sided-short-edge") == 0)
else if (strcasecmp(options->value, "two-sided-short-edge") == 0)
{
if (ppdMarkOption(ppd, "Duplex", "DuplexTumble"))
conflict = 1;
@@ -354,7 +354,7 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
conflict = 1;
}
}
else if (strcmp(options->name, "resolution") == 0)
else if (strcasecmp(options->name, "resolution") == 0)
{
if (ppdMarkOption(ppd, "Resolution", options->value))
conflict = 1;
+1 -1
Ver Arquivo
@@ -80,7 +80,7 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
*/
units[0] = '\0';
if (sscanf(name + 7, "%fx%f%s", &w, &l, units) < 2)
if (sscanf(name + 7, "%fx%f%254s", &w, &l, units) < 2)
return (NULL);
if (strcasecmp(units, "in") == 0)
+127 -71
Ver Arquivo
@@ -70,6 +70,8 @@
# define WRITE_BINARY "w" /* Open a binary file for writing */
#endif /* WIN32 || __EMX__ */
#define safe_free(p) if (p) free(p) /* Safe free macro */
#define PPD_KEYWORD 1 /* Line contained a keyword */
#define PPD_OPTION 2 /* Line contained an option name */
#define PPD_TEXT 4 /* Line contained human-readable text */
@@ -119,14 +121,14 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
* Free all strings at the top level...
*/
free(ppd->lang_encoding);
free(ppd->lang_version);
free(ppd->modelname);
free(ppd->ttrasterizer);
free(ppd->manufacturer);
free(ppd->product);
free(ppd->nickname);
free(ppd->shortnickname);
safe_free(ppd->lang_encoding);
safe_free(ppd->lang_version);
safe_free(ppd->modelname);
safe_free(ppd->ttrasterizer);
safe_free(ppd->manufacturer);
safe_free(ppd->product);
safe_free(ppd->nickname);
safe_free(ppd->shortnickname);
/*
* Free any emulations...
@@ -136,11 +138,11 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
{
for (i = ppd->num_emulations, emul = ppd->emulations; i > 0; i --, emul ++)
{
free(emul->start);
free(emul->stop);
safe_free(emul->start);
safe_free(emul->stop);
}
free(ppd->emulations);
safe_free(ppd->emulations);
}
/*
@@ -152,7 +154,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
ppd_free_group(group);
free(ppd->groups);
safe_free(ppd->groups);
}
/*
@@ -160,14 +162,14 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
*/
if (ppd->num_sizes > 0)
free(ppd->sizes);
safe_free(ppd->sizes);
/*
* Free any constraints...
*/
if (ppd->num_consts > 0)
free(ppd->consts);
safe_free(ppd->consts);
/*
* Free any fonts...
@@ -176,9 +178,9 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
if (ppd->num_fonts > 0)
{
for (i = ppd->num_fonts, font = ppd->fonts; i > 0; i --, font ++)
free(*font);
safe_free(*font);
free(ppd->fonts);
safe_free(ppd->fonts);
}
/*
@@ -186,13 +188,13 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
*/
if (ppd->num_profiles > 0)
free(ppd->profiles);
safe_free(ppd->profiles);
/*
* Free the whole record...
*/
free(ppd);
safe_free(ppd);
}
@@ -215,7 +217,7 @@ ppd_free_group(ppd_group_t *group) /* I - Group to free */
i --, option ++)
ppd_free_option(option);
free(group->options);
safe_free(group->options);
}
if (group->num_subgroups > 0)
@@ -225,7 +227,7 @@ ppd_free_group(ppd_group_t *group) /* I - Group to free */
i --, subgroup ++)
ppd_free_group(subgroup);
free(group->subgroups);
safe_free(group->subgroups);
}
}
@@ -246,9 +248,9 @@ ppd_free_option(ppd_option_t *option) /* I - Option to free */
for (i = option->num_choices, choice = option->choices;
i > 0;
i --, choice ++)
free(choice->code);
safe_free(choice->code);
free(option->choices);
safe_free(option->choices);
}
}
@@ -285,7 +287,7 @@ ppd_get_group(ppd_file_t *ppd, /* I - PPD file */
ppd->num_groups ++;
memset(group, 0, sizeof(ppd_group_t));
strcpy(group->text, name);
strncpy(group->text, name, sizeof(group->text) - 1);
}
return (group);
@@ -324,7 +326,7 @@ ppd_get_option(ppd_group_t *group, /* I - Group */
group->num_options ++;
memset(option, 0, sizeof(ppd_option_t));
strcpy(option->keyword, name);
strncpy(option->keyword, name, sizeof(option->keyword) - 1);
}
return (option);
@@ -356,7 +358,7 @@ ppd_add_choice(ppd_option_t *option, /* I - Option */
option->num_choices ++;
memset(choice, 0, sizeof(ppd_choice_t));
strcpy(choice->choice, name);
strncpy(choice->choice, name, sizeof(choice->choice) - 1);
return (choice);
}
@@ -386,7 +388,7 @@ ppd_add_size(ppd_file_t *ppd, /* I - PPD file */
ppd->num_sizes ++;
memset(size, 0, sizeof(ppd_size_t));
strcpy(size->name, name);
strncpy(size->name, name, sizeof(size->name) - 1);
return (size);
}
@@ -449,14 +451,14 @@ ppdOpen(FILE *fp) /* I - File to read from */
* Either this is not a PPD file, or it is not a 4.x PPD file.
*/
if (string != NULL)
free(string);
safe_free(string);
return (NULL);
}
if (string != NULL)
free(string);
DEBUG_printf(("ppdOpen: keyword = %s, string = %08x\n", keyword, string));
safe_free(string);
/*
* Allocate memory for the PPD file record...
@@ -599,9 +601,10 @@ ppdOpen(FILE *fp) /* I - File to read from */
ppd->num_profiles ++;
memset(profile, 0, sizeof(ppd_profile_t));
strcpy(profile->resolution, name);
strcpy(profile->media_type, text);
sscanf(string, "%f%f%f%f%f%f%f%f%f%f", &(profile->density),
strncpy(profile->resolution, name, sizeof(profile->resolution) - 1);
strncpy(profile->media_type, text, sizeof(profile->media_type) - 1);
sscanf(string, "%f%f%f%f%f%f%f%f%f%f%f", &(profile->density),
&(profile->gamma),
profile->matrix[0] + 0, profile->matrix[0] + 1,
profile->matrix[0] + 2, profile->matrix[1] + 0,
profile->matrix[1] + 1, profile->matrix[1] + 2,
@@ -627,7 +630,8 @@ ppdOpen(FILE *fp) /* I - File to read from */
string = NULL;
}
else if (strcmp(keyword, "VariablePaperSize") == 0 &&
strcmp(string, "True") == 0)
strcmp(string, "True") == 0 &&
!ppd->variable_sizes)
{
ppd->variable_sizes = 1;
@@ -646,25 +650,26 @@ ppdOpen(FILE *fp) /* I - File to read from */
CUPS_MSG_GENERAL))) == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
if ((option = ppd_get_option(group, "PageSize")) == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
strcpy(choice->text, cupsLangString(language, CUPS_MSG_VARIABLE));
strncpy(choice->text, cupsLangString(language, CUPS_MSG_VARIABLE),
sizeof(choice->text) - 1);
group = NULL;
option = NULL;
}
@@ -686,20 +691,62 @@ ppdOpen(FILE *fp) /* I - File to read from */
ppd->custom_margins + 1, ppd->custom_margins + 2,
ppd->custom_margins + 3);
else if (strcmp(keyword, "CustomPageSize") == 0 &&
strcmp(name, "True") == 0 &&
ppd->variable_sizes)
strcmp(name, "True") == 0)
{
if (!ppd->variable_sizes)
{
ppd->variable_sizes = 1;
/*
* Add a "Custom" page size entry...
*/
ppd_add_size(ppd, "Custom");
/*
* Add a "Custom" page size option...
*/
if ((group = ppd_get_group(ppd,
cupsLangString(language,
CUPS_MSG_GENERAL))) == NULL)
{
ppdClose(ppd);
safe_free(string);
return (NULL);
}
if ((option = ppd_get_option(group, "PageSize")) == NULL)
{
ppdClose(ppd);
safe_free(string);
return (NULL);
}
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
{
ppdClose(ppd);
safe_free(string);
return (NULL);
}
strncpy(choice->text, cupsLangString(language, CUPS_MSG_VARIABLE),
sizeof(choice->text) - 1);
group = NULL;
option = NULL;
}
if ((option = ppdFindOption(ppd, "PageSize")) == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
if ((choice = ppdFindChoice(option, "Custom")) == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -813,7 +860,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (group == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -826,7 +873,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (option == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -843,23 +890,28 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (text[0])
{
strcpy(option->text, text);
strncpy(option->text, text, sizeof(option->text) - 1);
ppd_fix(option->text);
}
else
{
if (strcmp(name, "PageSize") == 0)
strcpy(option->text, cupsLangString(language, CUPS_MSG_MEDIA_SIZE));
strncpy(option->text, cupsLangString(language, CUPS_MSG_MEDIA_SIZE),
sizeof(option->text) - 1);
else if (strcmp(name, "MediaType") == 0)
strcpy(option->text, cupsLangString(language, CUPS_MSG_MEDIA_TYPE));
strncpy(option->text, cupsLangString(language, CUPS_MSG_MEDIA_TYPE),
sizeof(option->text) - 1);
else if (strcmp(name, "InputSlot") == 0)
strcpy(option->text, cupsLangString(language, CUPS_MSG_MEDIA_SOURCE));
strncpy(option->text, cupsLangString(language, CUPS_MSG_MEDIA_SOURCE),
sizeof(option->text) - 1);
else if (strcmp(name, "ColorModel") == 0)
strcpy(option->text, cupsLangString(language, CUPS_MSG_OUTPUT_MODE));
strncpy(option->text, cupsLangString(language, CUPS_MSG_OUTPUT_MODE),
sizeof(option->text) - 1);
else if (strcmp(name, "Resolution") == 0)
strcpy(option->text, cupsLangString(language, CUPS_MSG_RESOLUTION));
strncpy(option->text, cupsLangString(language, CUPS_MSG_RESOLUTION),
sizeof(option->text) - 1);
else
strcpy(option->text, name);
strncpy(option->text, name, sizeof(option->text) - 1);
}
option->section = PPD_ORDER_ANY;
@@ -875,7 +927,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (group == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -891,7 +943,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (option == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -906,7 +958,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
else
option->ui = PPD_UI_PICKONE;
strcpy(option->text, text);
strncpy(option->text, text, sizeof(option->text) - 1);
option->section = PPD_ORDER_JCL;
group = NULL;
@@ -923,7 +975,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (group != NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -945,7 +997,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (group == NULL || subgroup != NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -958,7 +1010,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (subgroup == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -969,17 +1021,17 @@ ppdOpen(FILE *fp) /* I - File to read from */
memset(subgroup, 0, sizeof(ppd_group_t));
ppd_decode(string);
ppd_fix(string);
strcpy(subgroup->text, string);
strncpy(subgroup->text, string, sizeof(subgroup->text) - 1);
}
else if (strcmp(keyword, "CloseSubGroup") == 0)
subgroup = NULL;
else if (strcmp(keyword, "OrderDependency") == 0 ||
strcmp(keyword, "NonUIOrderDependency") == 0)
{
if (sscanf(string, "%f%s%s", &order, name, keyword) != 3)
if (sscanf(string, "%f%40s%40s", &order, name, keyword) != 3)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -1048,14 +1100,15 @@ ppdOpen(FILE *fp) /* I - File to read from */
for (i = 0; i < group->num_options; i ++)
if (strcmp(keyword, group->options[i].keyword) == 0)
{
strcpy(group->options[i].defchoice, string);
strncpy(group->options[i].defchoice, string,
sizeof(group->options[i].defchoice) - 1);
break;
}
group = NULL;
}
else
strcpy(option->defchoice, string);
strncpy(option->defchoice, string, sizeof(option->defchoice) - 1);
}
else if (strcmp(keyword, "UIConstraints") == 0 ||
strcmp(keyword, "NonUIConstraints") == 0)
@@ -1069,7 +1122,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (constraint == NULL)
{
ppdClose(ppd);
free(string);
safe_free(string);
return (NULL);
}
@@ -1077,14 +1130,14 @@ ppdOpen(FILE *fp) /* I - File to read from */
constraint += ppd->num_consts;
ppd->num_consts ++;
switch (sscanf(string, "%s%s%s%s", constraint->option1,
switch (sscanf(string, "%40s%40s%40s%40s", constraint->option1,
constraint->choice1, constraint->option2,
constraint->choice2))
{
case 0 : /* Error */
case 1 : /* Error */
ppdClose(ppd);
free(string);
safe_free(string);
break;
case 2 : /* Two options... */
@@ -1160,7 +1213,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
if (mask & PPD_TEXT)
{
strcpy(choice->text, text);
strncpy(choice->text, text, sizeof(choice->text) - 1);
ppd_fix(choice->text);
}
else if (strcmp(name, "True") == 0)
@@ -1168,7 +1221,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
else if (strcmp(name, "False") == 0)
strcpy(choice->text, "No");
else
strcpy(choice->text, name);
strncpy(choice->text, name, sizeof(choice->text) - 1);
if (strncmp(keyword, "JCL", 3) == 0)
ppd_decode(string); /* Decode quoted string */
@@ -1177,8 +1230,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
string = NULL; /* Don't free this string below */
}
if (string != NULL)
free(string);
safe_free(string);
}
#ifdef DEBUG
@@ -1266,7 +1318,7 @@ ppdOpenFd(int fd) /* I - File to read from */
ppd = ppdOpen(fp);
free(fp);
safe_free(fp);
}
else
ppd = NULL;
@@ -1354,7 +1406,11 @@ compare_strings(char *s, /* I - First string */
* Bounce out if *s and *t aren't both digits...
*/
if (!isdigit(*s) || !isdigit(*t))
if (isdigit(*s) && !isdigit(*t))
return (1);
else if (!isdigit(*s) && isdigit(*t))
return (-1);
else if (!isdigit(*s) || !isdigit(*t))
continue;
if (*s < *t)
+1
Ver Arquivo
@@ -153,6 +153,7 @@ typedef struct /**** sRGB Color Profiles ****/
char resolution[41], /* Resolution or "-" */
media_type[41]; /* Media type of "-" */
float density, /* Ink density to use */
gamma, /* Gamma correction to use */
matrix[3][3]; /* Transform matrix */
} ppd_profile_t;
+287
Ver Arquivo
@@ -0,0 +1,287 @@
/*
* "$Id$"
*
* snprintf functions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-1999 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:
*
* vsnprintf() - Format a string into a fixed size buffer.
* snprintf() - Format a string into a fixed size buffer.
*/
/*
* Include necessary headers...
*/
#include <stdio.h>
#include <ctype.h>
#include "string.h"
#ifndef HAVE_VSNPRINTF
/*
* 'vsnprintf()' - Format a string into a fixed size buffer.
*/
int /* O - Number of bytes formatted */
vsnprintf(char *buffer, /* O - Output buffer */
size_t bufsize, /* O - Size of output buffer */
const char *format, /* I - printf-style format string */
va_list ap) /* I - Pointer to additional arguments */
{
char *bufptr, /* Pointer to position in buffer */
*bufend, /* Pointer to end of buffer */
sign, /* Sign of format width */
size, /* Size character (h, l, L) */
type; /* Format type character */
const char *bufformat; /* Start of format */
int width, /* Width of field */
prec; /* Number of characters of precision */
char tformat[100], /* Temporary format string for sprintf() */
temp[1024]; /* Buffer for formatted numbers */
int *chars; /* Pointer to integer for %p */
char *s; /* Pointer to string */
int slen; /* Length of string */
/*
* Loop through the format string, formatting as needed...
*/
bufptr = buffer;
bufend = buffer + bufsize - 1;
while (*format && bufptr < bufend)
{
if (*format == '%')
{
bufformat = format;
format ++;
if (*format == '%')
{
*bufptr++ = *format++;
continue;
}
else if (strchr(" -+#\'", *format))
sign = *format++;
else
sign = 0;
width = 0;
while (isdigit(*format))
width = width * 10 + *format++ - '0';
if (*format == '.')
{
format ++;
prec = 0;
while (isdigit(*format))
prec = prec * 10 + *format++ - '0';
}
else
prec = -1;
if (*format == 'l' && format[1] == 'l')
{
size = 'L';
format += 2;
}
else if (*format == 'h' || *format == 'l' || *format == 'L')
size = *format++;
if (!*format)
break;
type = *format++;
switch (type)
{
case 'E' : /* Floating point formats */
case 'G' :
case 'e' :
case 'f' :
case 'g' :
if ((format - bufformat + 1) > sizeof(tformat) ||
(width + 2) > sizeof(temp))
break;
strncpy(tformat, bufformat, format - bufformat);
tformat[format - bufformat] = '\0';
sprintf(temp, tformat, va_arg(ap, double));
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, bufend - bufptr);
bufptr = bufend;
break;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
break;
case 'B' : /* Integer formats */
case 'X' :
case 'b' :
case 'd' :
case 'i' :
case 'o' :
case 'u' :
case 'x' :
if ((format - bufformat + 1) > sizeof(tformat) ||
(width + 2) > sizeof(temp))
break;
strncpy(tformat, bufformat, format - bufformat);
tformat[format - bufformat] = '\0';
sprintf(temp, tformat, va_arg(ap, int));
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, bufend - bufptr);
bufptr = bufend;
break;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
break;
case 'p' : /* Pointer value */
if ((chars = va_arg(ap, int *)) != NULL)
*chars = bufptr - buffer;
break;
case 'c' : /* Character or character array */
if (width <= 1)
*bufptr++ = va_arg(ap, int);
else
{
if ((bufptr + width) > bufend)
width = bufend - bufptr;
memcpy(bufptr, va_arg(ap, char *), width);
bufptr += width;
}
break;
case 's' : /* String */
if ((s = va_arg(ap, char *)) == NULL)
s = "(null)";
slen = strlen(s);
if (slen > width && prec != width)
width = slen;
if ((bufptr + width) > bufend)
width = bufend - bufptr;
if (slen > width)
slen = width;
if (sign == '-')
{
strncpy(bufptr, s, slen);
memset(bufptr + slen, ' ', width - slen);
}
else
{
memset(bufptr, ' ', width - slen);
strncpy(bufptr + width - slen, s, slen);
}
bufptr += width;
break;
case 'n' : /* Output number of chars so far */
if ((format - bufformat + 1) > sizeof(tformat) ||
(width + 2) > sizeof(temp))
break;
strncpy(tformat, bufformat, format - bufformat);
tformat[format - bufformat] = '\0';
sprintf(temp, tformat, va_arg(ap, int));
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, bufend - bufptr);
bufptr = bufend;
break;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
break;
}
}
else
*bufptr++ = *format++;
}
/*
* Nul-terminate the string and return the number of characters in it.
*/
*bufptr = '\0';
return (bufptr - buffer);
}
#endif /* !HAVE_VSNPRINT */
#ifndef HAVE_SNPRINTF
/*
* 'snprintf()' - Format a string into a fixed size buffer.
*/
int /* O - Number of bytes formatted */
snprintf(char *buffer, /* O - Output buffer */
size_t bufsize, /* O - Size of output buffer */
const char *format, /* I - printf-style format string */
...) /* I - Additional arguments as needed */
{
int bytes; /* Number of bytes formatted */
va_list ap; /* Pointer to additional arguments */
va_start(ap, format);
bytes = vsnprintf(buffer, bufsize, format, ap);
va_end(ap);
return (bytes);
}
#endif /* !HAVE_SNPRINTF */
/*
* End of "$Id$".
*/
+28
Ver Arquivo
@@ -29,6 +29,8 @@
* Include necessary headers...
*/
# include <stdio.h>
# include <stdarg.h>
# include <config.h>
# include <string.h>
@@ -43,6 +45,15 @@
# endif /* WIN32 || __EMX__ */
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Prototypes...
*/
@@ -59,6 +70,23 @@ extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, size_t n);
# endif /* !HAVE_STRNCASECMP */
# ifndef HAVE_SNPRINTF
extern int snprintf(char *, size_t, const char *, ...);
# endif /* !HAVE_SNPRINTF */
# ifndef HAVE_VSNPRINTF
extern int vsnprintf(char *, size_t, const char *, va_list);
# endif /* !HAVE_VSNPRINTF */
/*
* C++ magic...
*/
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_STRING_H_ */
/*
+1 -1
Ver Arquivo
@@ -104,7 +104,7 @@ main(int argc, /* I - Number of command-line args */
case 3 :
src = mimeFileType(mime, argv[1]);
sscanf(argv[2], "%[^/]/%s", super, type);
sscanf(argv[2], "%15[^/]/31%s", super, type);
dst = mimeType(mime, super, type);
filters = mimeFilter(mime, src, dst, &num_filters);
+12 -9
Ver Arquivo
@@ -108,8 +108,8 @@ mimeAddType(mime_t *mime, /* I - MIME database */
mime->num_types ++;
*types = temp;
strcpy(temp->super, super);
strcpy(temp->type, type);
strncpy(temp->super, super, sizeof(temp->super) - 1);
strncpy(temp->type, type, sizeof(temp->type) - 1);
if (mime->num_types > 1)
qsort(mime->types, mime->num_types, sizeof(mime_type_t *),
@@ -392,7 +392,7 @@ mimeAddTypeRule(mime_type_t *mt, /* I - Type to add to */
* This is just a filename match on the extension...
*/
sprintf(value[0], "*.%s", name);
snprintf(value[0], sizeof(value[0]), "*.%s", name);
length[0] = strlen(value[0]);
num_values = 1;
op = MIME_MAGIC_MATCH;
@@ -582,8 +582,11 @@ mimeType(mime_t *mime, /* I - MIME database */
* Lookup the type in the array...
*/
strcpy(key.super, super);
strcpy(key.type, type);
strncpy(key.super, super, sizeof(key.super) - 1);
key.super[sizeof(key.super) - 1] = '\0';
strncpy(key.type, type, sizeof(key.type) - 1);
key.type[sizeof(key.type) - 1] = '\0';
keyptr = &key;
match = (mime_type_t **)bsearch(&keyptr, mime->types, mime->num_types,
@@ -686,8 +689,8 @@ checkrules(const char *filename, /* I - Filename */
bufptr = buffer + rules->offset - bufoffset;
while (n > 0)
if ((*bufptr >= 32 && *bufptr <= 126) ||
(*bufptr >= 8 && *bufptr <= 10) ||
*bufptr == 13 || *bufptr == 26)
(*bufptr >= 8 && *bufptr <= 13) ||
*bufptr == 26 || *bufptr == 27)
{
n --;
bufptr ++;
@@ -729,8 +732,8 @@ checkrules(const char *filename, /* I - Filename */
while (n > 0)
if ((*bufptr >= 160 && *bufptr <= 254) ||
(*bufptr >= 32 && *bufptr <= 126) ||
(*bufptr >= 8 && *bufptr <= 10) ||
*bufptr == 13 || *bufptr == 26)
(*bufptr >= 8 && *bufptr <= 13) ||
*bufptr == 26 || *bufptr == 27)
{
n --;
bufptr ++;
+196 -55
Ver Arquivo
@@ -57,7 +57,9 @@
* Local globals...
*/
static http_t *cups_server = NULL;
static http_t *cups_server = NULL; /* Current server connection */
static ipp_status_t last_error = IPP_OK; /* Last IPP error */
static char authstring[255] = ""; /* Authorization string */
/*
@@ -98,6 +100,7 @@ cupsCancelJob(const char *name, /* I - Name of printer or class */
* attributes-natural-language
* printer-uri
* job-id
* [requesting-user-name]
*/
request = ippNew();
@@ -114,21 +117,31 @@ cupsCancelJob(const char *name, /* I - Name of printer or class */
"attributes-natural-language", NULL,
language != NULL ? language->language : "C");
sprintf(uri, "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
snprintf(uri, sizeof(uri), "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", job);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
/*
* Do the request...
*/
if ((response = cupsDoRequest(cups_server, request, "/jobs/")) == NULL)
{
last_error = IPP_BAD_REQUEST;
return (0);
}
else
{
last_error = response->request.status.status_code;
ippDelete(response);
ippDelete(response);
return (1);
return (1);
}
}
@@ -152,9 +165,6 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
const char *password; /* Password string */
char plain[255], /* Plaintext username:password */
encode[255]; /* Encoded username:password */
char junk[8192]; /* Junk buffer for error data */
static char authstring[255] = "";
/* Authorization string */
DEBUG_printf(("cupsDoFileRequest(%08x, %08s, \'%s\', \'%s\')\n",
@@ -218,8 +228,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
DEBUG_puts("cupsDoFileRequest: post...");
if (httpPost(http, resource))
if (httpPost(http, resource))
break;
continue;
/*
* Send the IPP data and wait for the response...
@@ -262,7 +271,10 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
httpFlush(http);
if ((password = cupsGetPassword("Password:")) != NULL)
printf("Authentication required for %s on %s...\n", cupsUser(),
http->hostname);
if ((password = cupsGetPassword("UNIX Password: ")) != NULL)
{
/*
* Got a password; send it to the server...
@@ -270,17 +282,23 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
if (!password[0])
break;
sprintf(plain, "%s:%s", cupsUser(), password);
snprintf(plain, sizeof(plain), "%s:%s", cupsUser(), password);
httpEncode64(encode, plain);
sprintf(authstring, "Basic %s", encode);
snprintf(authstring, sizeof(authstring), "Basic %s", encode);
continue;
}
else
break;
}
if (status != HTTP_OK)
else if (status == HTTP_ERROR)
{
if (http->error != ENETDOWN && http->error != ENETUNREACH)
continue;
else
break;
}
else if (status != HTTP_OK)
{
DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
@@ -388,8 +406,10 @@ cupsGetClasses(char ***classes) /* O - Classes */
if ((response = cupsDoRequest(cups_server, request, "/classes/")) != NULL)
{
last_error = response->request.status.status_code;
for (attr = response->attrs; attr != NULL; attr = attr->next)
if (strcmp(attr->name, "printer-name") == 0 &&
if (strcasecmp(attr->name, "printer-name") == 0 &&
attr->value_tag == IPP_TAG_NAME)
{
if (n == 0)
@@ -409,6 +429,8 @@ cupsGetClasses(char ***classes) /* O - Classes */
ippDelete(response);
}
else
last_error = IPP_BAD_REQUEST;
return (n);
}
@@ -470,17 +492,22 @@ cupsGetDefault(void)
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(cups_server, request, "/printers/")) != NULL)
if ((response = cupsDoRequest(cups_server, request, "/")) != NULL)
{
last_error = response->request.status.status_code;
if ((attr = ippFindAttribute(response, "printer-name", IPP_TAG_NAME)) != NULL)
{
strcpy(def_printer, attr->values[0].string.text);
strncpy(def_printer, attr->values[0].string.text, sizeof(def_printer) - 1);
def_printer[sizeof(def_printer) - 1] = '\0';
ippDelete(response);
return (def_printer);
}
ippDelete(response);
}
else
last_error = IPP_BAD_REQUEST;
return (NULL);
}
@@ -499,9 +526,12 @@ cupsGetPPD(const char *name) /* I - Printer name */
char printer[HTTP_MAX_URI], /* Printer name */
hostname[HTTP_MAX_URI], /* Hostname */
resource[HTTP_MAX_URI]; /* Resource name */
static char filename[HTTP_MAX_URI]; /* Local filename */
char *tempdir; /* Temporary file directory */
struct stat fileinfo; /* File information */
const char *password; /* Password string */
char plain[255], /* Plaintext username:password */
encode[255]; /* Encoded username:password */
http_status_t status; /* HTTP status from server */
static char filename[HTTP_MAX_URI]; /* Local filename */
/*
@@ -517,36 +547,67 @@ cupsGetPPD(const char *name) /* I - Printer name */
#if defined(WIN32) || defined(__EMX__)
tempdir = "C:/WINDOWS/TEMP";
snprintf(filename, sizeof(filename), "%s/%s.ppd", tempdir, printer);
#else
if ((tempdir = getenv("TMPDIR")) == NULL)
tempdir = "/tmp";
snprintf(filename, sizeof(filename), "%s/%d.%s.ppd", tempdir, getuid(), printer);
#endif /* WIN32 || __EMX__ */
sprintf(filename, "%s/%s.ppd", tempdir, printer);
if (stat(filename, &fileinfo))
memset(&fileinfo, 0, sizeof(fileinfo));
/*
* And send a request to the HTTP server using "if-modified-since"...
* And send a request to the HTTP server...
*/
sprintf(resource, "/printers/%s.ppd", printer);
snprintf(resource, sizeof(resource), "/printers/%s.ppd", printer);
httpClearFields(cups_server);
httpSetField(cups_server, HTTP_FIELD_HOST, hostname);
httpSetField(cups_server, HTTP_FIELD_IF_MODIFIED_SINCE,
httpGetDateString(fileinfo.st_mtime));
httpGet(cups_server, resource);
switch (httpUpdate(cups_server))
do
{
case HTTP_OK : /* New file - get it! */
httpClearFields(cups_server);
httpSetField(cups_server, HTTP_FIELD_HOST, hostname);
httpSetField(cups_server, HTTP_FIELD_AUTHORIZATION, authstring);
if (httpGet(cups_server, resource))
{
status = HTTP_UNAUTHORIZED;
continue;
}
while ((status = httpUpdate(cups_server)) == HTTP_CONTINUE);
if (status == HTTP_UNAUTHORIZED)
{
DEBUG_puts("cupsGetPPD: unauthorized...");
/*
* Flush any error message...
*/
httpFlush(cups_server);
printf("Authentication required for %s on %s...\n", cupsUser(),
cups_server->hostname);
if ((password = cupsGetPassword("UNIX Password: ")) != NULL)
{
/*
* Got a password; send it to the server...
*/
if (!password[0])
break;
snprintf(plain, sizeof(plain), "%s:%s", cupsUser(), password);
httpEncode64(encode, plain);
snprintf(authstring, sizeof(authstring), "Basic %s", encode);
continue;
}
else
break;
case HTTP_NOT_MODIFIED : /* File hasn't been modified; use the current copy */
return (filename);
default :
return (NULL);
}
}
while (status == HTTP_UNAUTHORIZED);
/*
* OK, we need to copy the file; open the file and copy it...
@@ -624,8 +685,10 @@ cupsGetPrinters(char ***printers) /* O - Printers */
if ((response = cupsDoRequest(cups_server, request, "/printers/")) != NULL)
{
last_error = response->request.status.status_code;
for (attr = response->attrs; attr != NULL; attr = attr->next)
if (strcmp(attr->name, "printer-name") == 0 &&
if (strcasecmp(attr->name, "printer-name") == 0 &&
attr->value_tag == IPP_TAG_NAME)
{
if (n == 0)
@@ -645,11 +708,24 @@ cupsGetPrinters(char ***printers) /* O - Printers */
ippDelete(response);
}
else
last_error = IPP_BAD_REQUEST;
return (n);
}
/*
* 'cupsLastError()' - Return the last IPP error that occurred.
*/
ipp_status_t /* O - IPP error code */
cupsLastError(void)
{
return (last_error);
}
/*
* 'cupsPrintFile()' - Print a file to a printer or class.
*/
@@ -705,7 +781,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
request->request.op.operation_id = IPP_PRINT_JOB;
request->request.op.request_id = 1;
sprintf(uri, "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
snprintf(uri, sizeof(uri), "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
language = cupsLangDefault();
@@ -724,17 +800,17 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
*/
if (cupsGetOption("raw", num_options, options))
ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/vnd.cups-raw");
else
ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/octet-stream");
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "requesting-user-name",
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
if (title)
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, title);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, title);
/*
* Then add all options on the command-line...
@@ -746,7 +822,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
* Skip the "raw" option - handled above...
*/
if (strcmp(options[i].name, "raw") == 0)
if (strcasecmp(options[i].name, "raw") == 0)
continue;
/*
@@ -790,7 +866,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
}
else
{
if (strncmp(option, "no", 2) == 0)
if (strncasecmp(option, "no", 2) == 0)
{
option += 2;
n = 0;
@@ -830,9 +906,9 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
{
n2 = strtol(s + 1, &s, 0);
if (strcmp(s, "dpc") == 0)
if (strcasecmp(s, "dpc") == 0)
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_CM, n, n2);
else if (strcmp(s, "dpi") == 0)
else if (strcasecmp(s, "dpi") == 0)
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_INCH, n, n2);
else
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, option, NULL, val);
@@ -864,7 +940,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
* Try printing the file...
*/
sprintf(uri, "/printers/%s", printer);
snprintf(uri, sizeof(uri), "/printers/%s", printer);
if ((response = cupsDoFileRequest(cups_server, request, uri, filename)) == NULL)
jobid = 0;
@@ -889,14 +965,64 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
}
/*
* 'cupsTempFile()' - Generate a temporary filename.
*/
char * /* O - Filename */
cupsTempFile(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
char *tmpdir; /* TMPDIR environment var */
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...
*/
if ((tmpdir = getenv("TMPDIR")) == NULL)
tmpdir = "/var/tmp";
if ((strlen(tmpdir) + 8) > len)
{
/*
* The specified directory exceeds the size of the buffer; default it...
*/
strcpy(buf, "/var/tmp/XXXXXX");
return (mktemp(buf));
}
else
{
/*
* Make the temporary name using the specified directory...
*/
sprintf(filename, "%s/XXXXXX", tmpdir);
return (mktemp(filename));
}
}
/*
* 'cups_connect()' - Connect to the specified host...
*/
static char * /* I - Printer name or NULL */
cups_connect(const char *name, /* I - Destination (printer[@host]) */
char *printer, /* O - Printer name */
char *hostname) /* O - Hostname */
char *printer, /* O - Printer name [HTTP_MAX_URI] */
char *hostname) /* O - Hostname [HTTP_MAX_URI] */
{
char hostbuf[HTTP_MAX_URI];
/* Name of host */
@@ -905,18 +1031,30 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
if (name == NULL)
{
last_error = IPP_BAD_REQUEST;
return (NULL);
}
if (sscanf(name, "%[^@]@%s", printerbuf, hostbuf) == 1)
strcpy(hostbuf, cupsServer());
if (sscanf(name, "%1023[^@]@%1023s", printerbuf, hostbuf) == 1)
{
strncpy(hostbuf, cupsServer(), sizeof(hostbuf) - 1);
hostbuf[sizeof(hostbuf) - 1] = '\0';
}
if (hostname != NULL)
strcpy(hostname, hostbuf);
{
strncpy(hostname, hostbuf, HTTP_MAX_URI - 1);
hostname[HTTP_MAX_URI - 1] = '\0';
}
else
hostname = hostbuf;
if (printer != NULL)
strcpy(printer, printerbuf);
{
strncpy(printer, printerbuf, HTTP_MAX_URI - 1);
printer[HTTP_MAX_URI - 1] = '\0';
}
else
printer = printerbuf;
@@ -929,7 +1067,10 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
}
if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (NULL);
}
else
return (printer);
}
-62
Ver Arquivo
@@ -1,62 +0,0 @@
%%BeginResource: procset hpgltops 1.0 0
%
% "$Id: HPGLprolog 312 1999-05-11 19:45:40Z mike $"
%
% HP-GL/2 filter procset for the Common UNIX Printing System (CUPS).
%
% This procset contains the basic drawing commands that are used to
% reduce output size. Note the 'MP' (make newpath) definition - this
% should be called 'NP' (newpath), but GhostScript uses the 'NP' name
% for 'noaccess put' in some of its font files...
%
% Copyright 1993-1999 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
%
/MO { moveto } bind def
/LI { lineto } bind def
/FI { fill } bind def
/ST { stroke } bind def
/CP { closepath } bind def
/MP { newpath } bind def
%
% If you have more than 8 pens defined for your HP-GL/2 output you'll
% need to add P# definitions (# = pen number) to set the appropriate color.
% If you don't you'll get errors. The default 8 pens cover the primary
% colors (white, black, red, green, yellow, blue, magenta, cyan). Ditto
% for pen widths (W#).
%
% PC and PW commands in the input stream will define/redefine these
% appropriately, but some packages don't generate them...
%
/P0 { 1.0 1.0 1.0 setrgbcolor } bind def
/P1 { 0.0 0.0 0.0 setrgbcolor } bind def
/P2 { 1.0 0.0 0.0 setrgbcolor } bind def
/P3 { 0.0 1.0 0.0 setrgbcolor } bind def
/P4 { 1.0 1.0 0.0 setrgbcolor } bind def
/P5 { 0.0 0.0 1.0 setrgbcolor } bind def
/P6 { 1.0 0.0 1.0 setrgbcolor } bind def
/P7 { 0.0 1.0 1.0 setrgbcolor } bind def
/W0 { DefaultPenWidth PenScaling mul setlinewidth } bind def
/W1 { DefaultPenWidth PenScaling mul setlinewidth } bind def
/W2 { DefaultPenWidth PenScaling mul setlinewidth } bind def
/W3 { DefaultPenWidth PenScaling mul setlinewidth } bind def
/W4 { DefaultPenWidth PenScaling mul setlinewidth } bind def
/W5 { DefaultPenWidth PenScaling mul setlinewidth } bind def
/W6 { DefaultPenWidth PenScaling mul setlinewidth } bind def
/W7 { DefaultPenWidth PenScaling mul setlinewidth } bind def
%%EndResource
+2 -2
Ver Arquivo
@@ -48,8 +48,8 @@ clean:
#
install:
-$(MKDIR) $(DATADIR)
$(CP) $(FILES) $(DATADIR)
-$(MKDIR) $(DATADIR)/data
$(CP) $(FILES) $(DATADIR)/data
#
# End of "$Id$".
-1051
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+2 -2
Ver Arquivo
@@ -42,7 +42,7 @@ include ../Makedefs
#
DOCUMENTS = cmp.shtml idd.shtml sam.shtml sdd.shtml ssr.shtml \
stp.shtml sum.shtml svd.shtml
stp.shtml sum.shtml
DOCIMAGES = images/cups-block-diagram.gif images/cups-large.gif \
images/cups-medium.gif images/cups-small.gif
WEBPAGES = cups.css cupsdoc.css index.html documentation.html
@@ -86,7 +86,7 @@ install:
overview.pdf: overview.html
echo Formatting $@...
htmldoc --duplex --compression=9 --jpeg --webpage -f $@ $<
htmldoc --duplex --compression=9 --jpeg --webpage -f overview.pdf overview.html
sam.html: sam.shtml
echo Formatting $@...
+5 -5
Ver Arquivo
@@ -152,10 +152,10 @@ sections:
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft) </LI>
<LI>IPP/1.0: Additional Optional Operations - Set 1 </LI>
<LI>IPP/1.0: Encoding and Transport </LI>
<LI>IPP/1.0: Implementers Guide </LI>
<LI>IPP/1.0: Model and Semantics </LI>
<LI>RFC 1179, Line Printer Daemon Protocol </LI>
<LI>RFC 2565, IPP/1.0: Encoding and Transport </LI>
<LI>RFC 2566, IPP/1.0: Model and Semantics </LI>
<LI>RFC 2639, IPP/1.0: Implementers Guide </LI>
</UL>
<H1><A NAME=3>3 File Management</A></H1>
<H2><A NAME=3_1>3.1 Directory Structure</A></H2>
@@ -340,7 +340,7 @@ extension of &quot;.h&quot;.
the file, the purpose or nature of the source file, the copyright and
licensing notice, and the functions contained in the file. The file
name and revision information is provided by the CVS &quot;$Id: cmp.shtml,v
1.3 1999/05/21 20:54:04 mike Exp $&quot; tag:
1.4 1999/09/22 20:06:18 mike Exp $&quot; tag:
<UL>
<PRE>
/*
@@ -376,7 +376,7 @@ name and revision information is provided by the CVS &quot;$Id: cmp.shtml,v
</PRE>
</UL>
The bottom of each source file shall contain a trailer giving the name
of the file using the CVS &quot;$Id: cmp.shtml,v 1.3 1999/05/21 20:54:04
of the file using the CVS &quot;$Id: cmp.shtml,v 1.4 1999/09/22 20:06:18
mike Exp $&quot; tag. The primary purpose of this is to mark the end of a
source file; if the trailer is missing it is possible that code has
been lost near the end of the file:
+123 -126
Ver Arquivo
@@ -1,6 +1,6 @@
%PDF-1.2
%âãÏÓ
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19990521210307Z)/Title(CUPS Configuration Management Plan)/Author(Easy Software Products)>>endobj
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19991004131140Z)/Title(CUPS Configuration Management Plan)/Author(Easy Software Products)>>endobj
2 0 obj<</Type/Encoding/BaseEncoding/WinAnsiEncoding>>endobj
3 0 obj<</Type/Font/Subtype/Type1/BaseFont/Courier/Encoding 2 0 R>>endobj
4 0 obj<</Type/Font/Subtype/Type1/BaseFont/Times-Roman/Encoding 2 0 R>>endobj
@@ -400,13 +400,10 @@ endobj
endobj
198 0 obj<</Type/Page/Parent 191 0 R/Contents 199 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F4 4 0 R/F8 7 0 R/F9 8 0 R/Fc 9 0 R>>>>>>endobj
199 0 obj<</Length 200 0 R/Filter/FlateDecode>>stream
xÚ•UMo"9½ó+J9%ÒЛB`oC¾„4™aŒöÀŸ«Á·«c»Aì¯ß²» E‹¢Hi»ªÞ{õÊ•·V
×ü“Âmº}Ek4oýñ8„tóœoú·=˜g—)Ì$•x5ÿUßÞ$ƒú¾}3Hêˆ$…q†Æ«\Iá™:¸iÚ„vúuè|­H2¹ZU6†B!ŒXaÁéPja #YÕ_–6*C~°ªøO­ æd!Ã
j*cœ0QÆó¯0ò€Ï¨i7éÔPàŽŠ‚Ñ^¾ÿ†‰åheV0Û9,./î^&³‹ÅüDë«4¹G¹ß
‹É íÝá^{g_åÇíFáöñŸÓx, $ëÅR#Ÿ51ZìÐFí!wѹé»zÈ—.p Œ=¬…;’¿D4ûŽaË<·ƒY#yPVIϦÀ¡ LÁyn¬°Ù#]EË ¡u­bƒ&#ë‚
xÚ•UMo"9½ó+J9%ÒЛB`oC¾„4™aŒöÀŸ«Á·«c»Aì¯ß²» E‹¢Hi»ªÞ{õÊ•·V
×ü“Âmº}Ek4oýñ8„tóœoú·=˜g—)Ì$•x5ÿUßÞ$ƒú¾}3Hêˆ$…q†Æ«\Iá™:¸iÚ„vúuè|­H2¹ZU6†B!ŒXaÁéPja #YÕ_–6*C~°ªøO­ æd!Ã
j*cœ0QÆó¯0ò€Ï¨i7éÔPàŽŠ‚Ñ^¾ÿ†‰åheV0Û9,./î^&³‹ÅüDë«4¹G¹ß
_ËrƇ'<Red¶AhGG®*Ã$°i[å×`‘}â¼22!´ò»“ýYæ€Û²%ûZ+dNKK[$r~&­*ýAºx ¢°‹Éäž_D›[††€â}˜•Ó\™¤ÐÀ¸:Q–ºÙ*“a=¼§³zv]êª~²rž
‹É íÝá^{g_åÇíFáöñŸÓx, $ëÅR#Ÿ51ZìÐFí!wѹé»zÈ—.p Œ=¬…;’¿D4ûŽaË<·ƒY#yPVIϦÀ¡ LÁyn¬°Ù#]EË ¡u­bƒ&#ë‚
G¸•ãf&Zû»™ÞŸÑºÚWÔ¸ã±(x²vpm.$º¤©ºïb,Ç¥ëRãšÉj<IÒìêøaþØO&쫨שz‚âØ…ø(~Ñ2J€·
+6ëHηÀ+°÷ƒ‹Ëo“û/0}¼KÓÛáâê Ìxøþ㱆‘&ùÊa³çQ¸
_ËrƇ'<Red¶AhGG®*Ã$°i[å×`‘}â¼22!´ò»“ýYæ€Û²%ûZ+dNKK[$r~&­*ýAºx ¢°‹Éäž_D›[††€â}˜•Ó\™¤ÐÀ¸:Q–ºÙ*“a=¼§³zv]êª~²rž
@@ -488,19 +485,19 @@ endobj
endobj
222 0 obj<</Type/Page/Parent 191 0 R/Contents 223 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F0 3 0 R/F4 4 0 R/F8 7 0 R/F9 8 0 R>>>>>>endobj
223 0 obj<</Length 224 0 R/Filter/FlateDecode>>stream
222 0 obj<</Type/Page/Parent 191 0 R/Contents 223 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F0 3 0 R/F4 4 0 R/F8 7 0 R/F9 8 0 R>>>>>>endobj
223 0 obj<</Length 224 0 R/Filter/FlateDecode>>stream
VMSÛ0½çWìpjgˆ'’Þ€N/”¤\Y^'flÉ•d(ÿ¾»’çchÃ!±õôöí7¿1Œè/†«1L¦ ËÁÍjðå~ñVL¯.`•~º„¥ÎÜ«0X °h?¯žò2šìðrtÃ#k?ê2A“«uÀ_@7èñ4 o-–P#pƒ8¬„qðÒ(Oé­p˜Bò1êÔ‚Ó`°2hQ9º‹PŠgmΡÌ •B%œÜÊ‹f
d9žDc¶¨í× ms~q ¶öFÌž=òä‘çÝ9£Q4ÚõrÈT­Ÿ7èÄСu­r˜â™«”ÔçY\U…*¥xy
tŽœ¿L…~
>Hê¼H›Øü¿þÄÓì{‘Ä'ü¸†ÛÇ%X%*»Ñr kTr“iH™{ƒ„¼õ Èr%ŠÖeÿÆçšè¥˜)1ÝúØKVг—3Oòš»'IQæ%Y¨t®œåz(„ $5…ÖX©©@>£—øiôÔ ÷òDLî™ÜµF%QòÆqMg¢.(LŠ~Ú¶‰l í›uXÒ4X"kgwv굉Lß3ºø{aYæíðÝ-}Š6_+Ðøæ¢3ÚƒSß#§H¥«BÁãï©9Ø=ÀÝç¸G^¦7H5!uYQʰx#DЃi×£ÿ ¢g6ø°×Ú
‘}§çÃ9ojèsŸjP_¼=¯ß!ÇŒ\¢Ô$â4 #­ŒNké¸àáã=”B°
Ô‹=ÒcWâ.zh¦Ö.ô4{ÿÊø` :ngâ.ôû¸£ÝrñÍ6™·ëe ßÂÈ¡»G÷Êvcmǭ݈Pe½ÅÍkk)ÑÚ¬.¨bÛâM»–rF×IÁd•6.‚kbÒÉ3õ×b¯FñÊÚ ÆgyñÞrŠ·¢f¸Ji•‘†’>ŠšQ~´Ó*[›fžX]Ù²§X$=¦ÑMÜ…j+Z9§öï6N.;±\à” nEI-l%í›Ø·ùö&›€E!Ô¹?.W‹!× Ü Vè™m/FRЀåêÁ¯ñ¤Ðs3?Ã2š"YZJMôÆÝYçÈtü“r1EsÂbÎÏw«ÁÏÁ_øe¼?endstream
endobj
endobj
224 0 obj
224 0 obj
845
endobj
225 0 obj<</Type/Page/Parent 191 0 R/Contents 226 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F4 4 0 R/F8 7 0 R/F9 8 0 R>>>>>>endobj
226 0 obj<</Length 227 0 R/Filter/FlateDecode>>stream
225 0 obj<</Type/Page/Parent 191 0 R/Contents 226 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F4 4 0 R/F8 7 0 R/F9 8 0 R>>>>>>endobj
xÚmP½R„0îyŠ+- ǶÞh§sz¨õ^XŽ8`6Ì,,œ¤Úý~÷+QÉS°-ã×crß$·w vi
M'»²ªÒšöz—ðJ!ÓMó)¨”Z1›¼”¥`>z²ˆƒ±gè‘áD2Ðnœ
ÔÏZs7Ã7 Xº@k8xsšƒq̈gà=a$tÞz={O6Àþý(zíAŒÕ6Í£ñ[œ¸wá*…g“wí¬I¿Fîq„j ìºpAO¢aIj]€ ™Å4úá$“7’âXšqº¶¯Û«¢’SÕKŠýÛá{g;sž=.öOh¥Ò£´‘»Y)*Ï"IeqXäuº…ìŸC?4ÉKòc„endstream
endobj
@@ -842,122 +839,122 @@ xref
0000014189 00000 n
0000014295 00000 n
0000014401 00000 n
0000014669 00000 n
0000014703 00000 n
0000015402 00000 n
0000015451 00000 n
0000015500 00000 n
0000015549 00000 n
0000015598 00000 n
0000015647 00000 n
0000015696 00000 n
0000015745 00000 n
0000015794 00000 n
0000015843 00000 n
0000015892 00000 n
0000015941 00000 n
0000015990 00000 n
0000016039 00000 n
0000016088 00000 n
0000016137 00000 n
0000016186 00000 n
0000016235 00000 n
0000016284 00000 n
0000016333 00000 n
0000016382 00000 n
0000016431 00000 n
0000016480 00000 n
0000016529 00000 n
0000016578 00000 n
0000016627 00000 n
0000016676 00000 n
0000016725 00000 n
0000016774 00000 n
0000016823 00000 n
0000016872 00000 n
0000016921 00000 n
0000016970 00000 n
0000017019 00000 n
0000017068 00000 n
0000017117 00000 n
0000017166 00000 n
0000017215 00000 n
0000017264 00000 n
0000017313 00000 n
0000017362 00000 n
0000017411 00000 n
0000017460 00000 n
0000017509 00000 n
0000017558 00000 n
0000017607 00000 n
0000017656 00000 n
0000017705 00000 n
0000017754 00000 n
0000017803 00000 n
0000017852 00000 n
0000017901 00000 n
0000017950 00000 n
0000017999 00000 n
0000018260 00000 n
0000018412 00000 n
0000024803 00000 n
0000024825 00000 n
0000024938 00000 n
0000025040 00000 n
0000025060 00000 n
0000025200 00000 n
0000026140 00000 n
0000026161 00000 n
0000026274 00000 n
0000026462 00000 n
0000026483 00000 n
0000026623 00000 n
0000027216 00000 n
0000027237 00000 n
0000027350 00000 n
0000027543 00000 n
0000027564 00000 n
0000027695 00000 n
0000028308 00000 n
0000028329 00000 n
0000028442 00000 n
0000028631 00000 n
0000028652 00000 n
0000028783 00000 n
0000029727 00000 n
0000029748 00000 n
0000029879 00000 n
0000030166 00000 n
0000030187 00000 n
0000030327 00000 n
0000031243 00000 n
0000031264 00000 n
0000031395 00000 n
0000031753 00000 n
0000031774 00000 n
0000031914 00000 n
0000032410 00000 n
0000032431 00000 n
0000032562 00000 n
0000033014 00000 n
0000033035 00000 n
0000033175 00000 n
0000034315 00000 n
0000034337 00000 n
0000034477 00000 n
0000035383 00000 n
0000035404 00000 n
0000035544 00000 n
0000036470 00000 n
0000036491 00000 n
0000036631 00000 n
0000037277 00000 n
0000037298 00000 n
0000037438 00000 n
0000038258 00000 n
0000038279 00000 n
0000014635 00000 n
0000014669 00000 n
0000014703 00000 n
0000015402 00000 n
0000015451 00000 n
0000015500 00000 n
0000015549 00000 n
0000015598 00000 n
0000015647 00000 n
0000015696 00000 n
0000015745 00000 n
0000015794 00000 n
0000015843 00000 n
0000015892 00000 n
0000015941 00000 n
0000015990 00000 n
0000016039 00000 n
0000016088 00000 n
0000016137 00000 n
0000016186 00000 n
0000016235 00000 n
0000016284 00000 n
0000016333 00000 n
0000016382 00000 n
0000016431 00000 n
0000016480 00000 n
0000016529 00000 n
0000016578 00000 n
0000016627 00000 n
0000016676 00000 n
0000016725 00000 n
0000016774 00000 n
0000016823 00000 n
0000016872 00000 n
0000016921 00000 n
0000016970 00000 n
0000017019 00000 n
0000017068 00000 n
0000017117 00000 n
0000017166 00000 n
0000017215 00000 n
0000017264 00000 n
0000017313 00000 n
0000017362 00000 n
0000017411 00000 n
0000017460 00000 n
0000017509 00000 n
0000017558 00000 n
0000017607 00000 n
0000017656 00000 n
0000017705 00000 n
0000017754 00000 n
0000017803 00000 n
0000017852 00000 n
0000017901 00000 n
0000017950 00000 n
0000017999 00000 n
0000018260 00000 n
0000018412 00000 n
0000024803 00000 n
0000024825 00000 n
0000024938 00000 n
0000025040 00000 n
0000025060 00000 n
0000025200 00000 n
0000026140 00000 n
0000026161 00000 n
0000026274 00000 n
0000026462 00000 n
0000026483 00000 n
0000026623 00000 n
0000027230 00000 n
0000027251 00000 n
0000027364 00000 n
0000027557 00000 n
0000027578 00000 n
0000027709 00000 n
0000028322 00000 n
0000028343 00000 n
0000028456 00000 n
0000028645 00000 n
0000028666 00000 n
0000028797 00000 n
0000029741 00000 n
0000029762 00000 n
0000029893 00000 n
0000030180 00000 n
0000030201 00000 n
0000030341 00000 n
0000031257 00000 n
0000031278 00000 n
0000031409 00000 n
0000031767 00000 n
0000031788 00000 n
0000031928 00000 n
0000032424 00000 n
0000032445 00000 n
0000032576 00000 n
0000033028 00000 n
0000033049 00000 n
0000033189 00000 n
0000034329 00000 n
0000034351 00000 n
0000034491 00000 n
0000035395 00000 n
0000035416 00000 n
0000035556 00000 n
0000036482 00000 n
0000036503 00000 n
0000036643 00000 n
0000037289 00000 n
0000037310 00000 n
0000037450 00000 n
0000038270 00000 n
0000038291 00000 n
0000038431 00000 n
0000039358 00000 n
0000039507 00000 n
0000039379 00000 n
0000039519 00000 n
+7 -7
Ver Arquivo
@@ -75,10 +75,10 @@ The following non-CUPS documents are referenced by this document:
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft)
<LI>IPP/1.0: Additional Optional Operations - Set 1
<LI>IPP/1.0: Encoding and Transport
<LI>IPP/1.0: Implementers Guide
<LI>IPP/1.0: Model and Semantics
<LI>RFC 1179, Line Printer Daemon Protocol
<LI>RFC 2565, IPP/1.0: Encoding and Transport
<LI>RFC 2566, IPP/1.0: Model and Semantics
<LI>RFC 2639, IPP/1.0: Implementers Guide
</UL>
<H1>File Management</H1>
@@ -334,12 +334,12 @@ extension of ".h".
The top of each source file shall contain a header giving the name of the
file, the purpose or nature of the source file, the copyright and licensing
notice, and the functions contained in the file. The file name and revision
information is provided by the CVS "$Id: cmp.shtml 351 1999-05-21 20:54:09Z mike $" tag:
information is provided by the CVS "$Id: cmp.shtml 679 1999-09-22 20:06:27Z mike $" tag:
<UL>
<PRE>
/*
* "$Id: cmp.shtml 351 1999-05-21 20:54:09Z mike $"
* "$Id: cmp.shtml 679 1999-09-22 20:06:27Z mike $"
*
* Description of file contents.
*
@@ -372,14 +372,14 @@ information is provided by the CVS "$Id: cmp.shtml 351 1999-05-21 20:54:09Z mike
</UL>
The bottom of each source file shall contain a trailer giving the name
of the file using the CVS "$Id: cmp.shtml 351 1999-05-21 20:54:09Z mike $" tag. The primary purpose of this is to
of the file using the CVS "$Id: cmp.shtml 679 1999-09-22 20:06:27Z mike $" tag. The primary purpose of this is to
mark the end of a source file; if the trailer is missing it is possible
that code has been lost near the end of the file:
<UL>
<PRE>
/*
* End of "$Id: cmp.shtml 351 1999-05-21 20:54:09Z mike $".
* End of "$Id: cmp.shtml 679 1999-09-22 20:06:27Z mike $".
*/
</PRE>
</UL>
-2
Ver Arquivo
@@ -55,8 +55,6 @@ The following documentation for CUPS is available on this server:
<A HREF="ssr.html">HTML</A> |
<A HREF="ssr.pdf">PDF</A> )
<LI>Software Test Plan (Not Yet Available)
</UL>
<HR>
+152 -97
Ver Arquivo
@@ -1,13 +1,13 @@
<HTML>
<HEAD>
<TITLE>DRAFT - CUPS Interface Design Description</TITLE>
<TITLE>CUPS Interface Design Description</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-IDD-1.0">
</HEAD>
<BODY>
<CENTER><A HREF=#contents><IMG SRC="images/cups-large.gif" BORDER=0><BR>
<H1>DRAFT - CUPS Interface Design Description</H1></A><BR>
<H1>CUPS Interface Design Description</H1></A><BR>
CUPS-IDD-1.0<BR>
Easy Software Products<BR>
Copyright 1997-1999, All Rights Reserved<BR>
@@ -53,26 +53,24 @@ Copyright 1997-1999, All Rights Reserved<BR>
<LI><A HREF=#4_3>4.3 CUPS PostScript File</A></LI>
<LI><A HREF=#4_4>4.4 CUPS Raster File</A></LI>
<LI><A HREF=#4_5>4.5 CUPS Raw Files</A></LI>
<LI><A HREF=#4_6>4.6 File Transfer Protocol</A></LI>
<LI><A HREF=#4_7>4.7 Internet Printing Protocol</A></LI>
<LI><A HREF=#4_6>4.6 Internet Printing Protocol</A></LI>
<UL>
<LI><A HREF=#4_7_1>4.7.1 Get Default Destination (CUPS_GET_DEFAULT =
<LI><A HREF=#4_6_1>4.6.1 Get Default Destination (CUPS_GET_DEFAULT =
0x4001)</A></LI>
<LI><A HREF=#4_7_2>4.7.2 Get Printers (CUPS_GET_PRINTERS = 0x4002)</A></LI>
<LI><A HREF=#4_7_3>4.7.3 Add Printer (CUPS_ADD_PRINTER = 0x4003)</A></LI>
<LI><A HREF=#4_7_4>4.7.4 Delete Printer (CUPS_DELETE_PRINTER = 0x4004)</A>
<LI><A HREF=#4_6_2>4.6.2 Get Printers (CUPS_GET_PRINTERS = 0x4002)</A></LI>
<LI><A HREF=#4_6_3>4.6.3 Add Printer (CUPS_ADD_PRINTER = 0x4003)</A></LI>
<LI><A HREF=#4_6_4>4.6.4 Delete Printer (CUPS_DELETE_PRINTER = 0x4004)</A>
</LI>
<LI><A HREF=#4_7_5>4.7.5 Get Classes (CUPS_GET_CLASSES = 0x4005)</A></LI>
<LI><A HREF=#4_7_6>4.7.6 Add Class (CUPS_ADD_CLASS = 0x4006)</A></LI>
<LI><A HREF=#4_7_7>4.7.7 Delete Class (CUPS_DELETE_CLASS = 0x4007)</A></LI>
<LI><A HREF=#4_7_8>4.7.8 Accept Jobs (CUPS_ACCEPT_JOBS = 0x4008)</A></LI>
<LI><A HREF=#4_7_9>4.7.9 Reject Jobs (CUPS_REJECT_JOBS = 0x4009)</A></LI>
<LI><A HREF=#4_7_10>4.7.10 Set Default Destination (CUPS_SET_DEFAULT =
<LI><A HREF=#4_6_5>4.6.5 Get Classes (CUPS_GET_CLASSES = 0x4005)</A></LI>
<LI><A HREF=#4_6_6>4.6.6 Add Class (CUPS_ADD_CLASS = 0x4006)</A></LI>
<LI><A HREF=#4_6_7>4.6.7 Delete Class (CUPS_DELETE_CLASS = 0x4007)</A></LI>
<LI><A HREF=#4_6_8>4.6.8 Accept Jobs (CUPS_ACCEPT_JOBS = 0x4008)</A></LI>
<LI><A HREF=#4_6_9>4.6.9 Reject Jobs (CUPS_REJECT_JOBS = 0x4009)</A></LI>
<LI><A HREF=#4_6_10>4.6.10 Set Default Destination (CUPS_SET_DEFAULT =
0x400A)</A></LI>
</UL>
<LI><A HREF=#4_8>4.8 Line Printer Daemon Protocol</A></LI>
<LI><A HREF=#4_9>4.9 Server Message Block Protocol</A></LI>
<LI><A HREF=#4_10>4.10 Trivial File Transfer Protocol</A></LI>
<LI><A HREF=#4_7>4.7 Line Printer Daemon Protocol</A></LI>
<LI><A HREF=#4_8>4.8 Server Message Block Protocol</A></LI>
</UL>
<B><A HREF=#5>5 5 - Directories</A></B>
<BR>
@@ -133,10 +131,10 @@ following sections: </P>
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft) </LI>
<LI>IPP/1.0: Additional Optional Operations - Set 1 </LI>
<LI>IPP/1.0: Encoding and Transport </LI>
<LI>IPP/1.0: Implementers Guide </LI>
<LI>IPP/1.0: Model and Semantics </LI>
<LI>RFC 1179, Line Printer Daemon Protocol </LI>
<LI>RFC 2565, IPP/1.0: Encoding and Transport </LI>
<LI>RFC 2566, IPP/1.0: Model and Semantics </LI>
<LI>RFC 2639, IPP/1.0: Implementers Guide </LI>
</UL>
<H1><A NAME=3>3 Internal Interfaces</A></H1>
<H2><A NAME=3_1>3.1 Character Set Files</A></H2>
@@ -243,17 +241,17 @@ specific model of printer. </P>
<P>This string attribute specifies a color profile of the form: </P>
<UL>
<PRE>
resolution/type density m00 m01 m02 m10 m11 m12 m20 m21 m22
resolution/type density gamma m00 m01 m02 m10 m11 m12 m20 m21 m22
</PRE>
</UL>
<P>The <I>resolution</I> and <I>type</I> values may be &quot;-&quot; to act as a
wildcard. Otherwise they must match one of the <CODE>Resolution</CODE>
or <CODE>MediaType</CODE> attributes defined in the PPD file. </P>
<P>The <I>density</I> value defines a gamma and density adjustment
function such that: </P>
<P>The <I>density</I> and <I>gamma</I> values define gamma and density
adjustment function such that: </P>
<UL>
<PRE>
f(x) = d * x<SUP>1/d</SUP>
f(x) = density * x<SUP>gamma</SUP>
</PRE>
</UL>
<P>The <I>m00</I> through <I>m22</I> values define a 3x3 transformation
@@ -285,13 +283,18 @@ understood:
<TABLE BORDER=1 WIDTH=90%>
<TR><TH WIDTH=25%>Directive</TH><TH>Description</TH></TR>
<TR><TD>&lt;Class name&gt;
<BR> &lt;/Class&gt;</TD><TD></TR>
<BR> &lt;/Class&gt;</TD><TD>Surrounds a class definition.</TD></TR>
<TR><TD>&lt;DefaultClass name&gt;
<BR> &lt;/Class&gt;</TD><TD></TR>
<TR><TD>Info</TD><TD></TR>
<TR><TD>Location</TD><TD></TR>
<TR><TD>MoreInfo</TD><TD></TR>
<TR><TD>Printer</TD><TD></TR>
<BR> &lt;/Class&gt;</TD><TD>Surrounds a class definition for the default
destination.</TD></TR>
<TR><TD>Accepting</TD><TD>Specifies whether the class is accepting new
jobs. May be the names &quot;Yes&quot; or &quot;No&quot;.</TD></TR>
<TR><TD>Info</TD><TD>A textual description of the class.</TD></TR>
<TR><TD>Location</TD><TD>A textual location of the class.</TD></TR>
<TR><TD>MoreInfo</TD><TD>A URL pointing to additional information on
the class.</TD></TR>
<TR><TD>Printer</TD><TD>Specifies a printer that is a member of the
class.</TD></TR>
</TABLE>
</CENTER>
</P>
@@ -304,43 +307,92 @@ understood:
<CENTER>
<TABLE BORDER=1 WIDTH=90%>
<TR><TH WIDTH=25%>Directive</TH><TH>Default</TH><TH>Description</TH></TR>
<TR><TD>AccessLog</TD><TD><TD>Specifies the location of the access log
file (default &quot;logs/access_log&quot;).</TD></TR>
<TR><TD>Allow</TD><TD><TD></TR>
<TR><TD>AuthClass</TD><TD><TD></TR>
<TR><TD>AuthType</TD><TD><TD></TR>
<TR><TD>BrowseAddress</TD><TD><TD></TR>
<TR><TD>BrowseInterval</TD><TD><TD></TR>
<TR><TD>BrowsePort</TD><TD><TD></TR>
<TR><TD>BrowseTimeout</TD><TD><TD></TR>
<TR><TD>Browsing</TD><TD><TD></TR>
<TR><TD>DefaultCharset</TD><TD><TD></TR>
<TR><TD>DefaultLanguage</TD><TD><TD></TR>
<TR><TD>Deny</TD><TD><TD></TR>
<TR><TD>DocumentRoot</TD><TD><TD></TR>
<TR><TD>ErrorLog</TD><TD><TD></TR>
<TR><TD>Group</TD><TD><TD></TR>
<TR><TD>HostNameLookups</TD><TD><TD></TR>
<TR><TD>ImplicitClasses</TD><TD><TD></TR>
<TR><TD>KeepAlive</TD><TD><TD></TR>
<TR><TD>KeepAliveTimeout</TD><TD><TD></TR>
<TR><TD>AccessLog</TD><TD>logs/access_log</TD><TD>Specifies the
location of the access log file.</TD></TR>
<TR><TD>Allow</TD><TD>-</TD><TD>Allows connections from the specified
host, network, or domain.</TD></TR>
<TR><TD>AuthClass</TD><TD>-</TD><TD>Specifies what level of
authentication is required; may be either &quot;User&quot;, &quot;System&quot;, or &quot;Group&quot;.</TD>
</TR>
<TR><TD>AuthType</TD><TD>None</TD><TD>Specifies the type of
authentication to perform; may be either &quot;None&quot; or &quot;Basic&quot;.</TD></TR>
<TR><TD>BrowseAddress</TD><TD>255.255.255.255</TD><TD>Specifies a
broadcast address to send CUPS browsing packets to.</TD></TR>
<TR><TD>BrowseInterval</TD><TD>30</TD><TD>Specifies the number of
seconds between browsing updates.</TD></TR>
<TR><TD>BrowsePort</TD><TD>631</TD><TD>Specifies the UDP port number to
use for browse packets.</TD></TR>
<TR><TD>BrowseTimeout</TD><TD>300</TD><TD>Specifies the number of
seconds to wait until remote destinations are removed from the local
destination list.</TD></TR>
<TR><TD>Browsing</TD><TD>On</TD><TD>Specifies whether or not printer
and class browsing is enabled; can be &quot;On&quot; or &quot;Off&quot;.</TD></TR>
<TR><TD>DefaultCharset</TD><TD>iso-8859-1</TD><TD>Specifies the default
character set.</TD></TR>
<TR><TD>DefaultLanguage</TD><TD>current locale</TD><TD>Specifies the
default language.</TD></TR>
<TR><TD>Deny</TD><TD>-</TD><TD>Refuses connections from the specified
host, network, or domain.</TD></TR>
<TR><TD>DocumentRoot</TD><TD>/usr/share/cups/doc</TD><TD>Specifies the
document data root directory.</TD></TR>
<TR><TD>ErrorLog</TD><TD>logs/error_log</TD><TD>Specifies the error log
file location.</TD></TR>
<TR><TD>Group</TD><TD>root, sys, system</TD><TD>Specifies the group
name or ID that is used when running external programs.</TD></TR>
<TR><TD>HostNameLookups</TD><TD>Off</TD><TD>Specifies whether or not to
perform reverse IP address lookups to get the actual hostname; may be
&quot;On&quot; or &quot;Off&quot;. Hostname lookups can significantly degrade the
performance of the CUPS server if one or more DNS servers is not
functioning properly.</TD></TR>
<TR><TD>ImplicitClasses</TD><TD>On</TD><TD>Specifies whether or not to
automatically create printer classes when more than one printer or
class of the same name is detected on the network; may be &quot;On&quot; or
&quot;Off&quot;.</TD></TR>
<TR><TD>KeepAlive</TD><TD>On</TD><TD>Specifies whether or not to use
the HTTP Keep-Alive feature; may be &quot;On&quot; or &quot;Off&quot;.</TD></TR>
<TR><TD>KeepAliveTimeout</TD><TD>30</TD><TD>Specifies the amount of
time to keep the HTTP connection alive before closing it.</TD></TR>
<TR><TD>&lt;Location path&gt;
<BR> &lt;/Location&gt;</TD><TD><TD></TR>
<TR><TD>LogLevel</TD><TD><TD></TR>
<TR><TD>MaxClients</TD><TD><TD></TR>
<TR><TD>MaxLogSize</TD><TD><TD></TR>
<TR><TD>MaxRequestSize</TD><TD><TD></TR>
<TR><TD>Order</TD><TD><TD></TR>
<TR><TD>PageLog</TD><TD><TD></TR>
<TR><TD>Port</TD><TD><TD></TR>
<TR><TD>RIPCache</TD><TD><TD></TR>
<TR><TD>ServerAdmin</TD><TD><TD></TR>
<TR><TD>ServerName</TD><TD><TD></TR>
<TR><TD>ServerRoot</TD><TD><TD></TR>
<TR><TD>SystemGroup</TD><TD><TD></TR>
<TR><TD>TempDir</TD><TD><TD></TR>
<TR><TD>Timeout</TD><TD><TD></TR>
<TR><TD>User</TD><TD><TD></TR>
<BR> &lt;/Location&gt;</TD><TD>-</TD><TD>Specifies a location to restrict
access to.</TD></TR>
<TR><TD>LogLevel</TD><TD>info</TD><TD>Controls the amount of
information that is logged in the error log file. Can be one of
&quot;debug&quot;, &quot;info&quot;, &quot;warn&quot;, &quot;error&quot;, or &quot;none&quot;, in decreasing order or
verbosity.</TD></TR>
<TR><TD>MaxClients</TD><TD>100</TD><TD>Specifies the maximum number of
simultaneous active clients. This value is internally limited to 1/3
of the total number of availabel file descriptors.</TD></TR>
<TR><TD>MaxLogSize</TD><TD>0</TD><TD>Specifies the maximum size of the
access, error, and page log files in bytes. If set to 0 then no
maximum size is set. Log files are rotated automatically when this
size is exceeded.</TD></TR>
<TR><TD>MaxRequestSize</TD><TD>0</TD><TD>Specifies the maximum size of
HTTP requests in bytes. If set to 0 then there is no maximum.</TD></TR>
<TR><TD>Order</TD><TD>Allow,Deny</TD><TD>Specifies the order of Allow
and Deny directive processing; can be &quot;Deny,Allow&quot; to implicitly deny
hosts unless they are allowed by an Allow line, or &quot;Allow,Deny&quot; to
implicitly allow hosts unless they are denied by a Deny line.</TD></TR>
<TR><TD>PageLog</TD><TD>logs/page_log</TD><TD>Specifies the location of
the page log file.</TD></TR>
<TR><TD>Port</TD><TD>631</TD><TD>Specifies a port number to listen to
for HTTP connections.</TD></TR>
<TR><TD>RIPCache</TD><TD>8m</TD><TD>Specifies the size of the memory
cache in bytes that is used by RIP filters.</TD></TR>
<TR><TD>ServerAdmin</TD><TD>root@ServerName</TD><TD>Specifies the
person to contact with problems.</TD></TR>
<TR><TD>ServerName</TD><TD>hostname</TD><TD>Specifies the hostname that
is supplied to HTTP clients. This is also used to determine the
default CUPS server for the CUPS IPP client applications.</TD></TR>
<TR><TD>ServerRoot</TD><TD>/var/cups</TD><TD>Specifies the root
directory for server data files.</TD></TR>
<TR><TD>SystemGroup</TD><TD>root, sys, system</TD><TD>Specifies the
group name used for System class authentication.</TD></TR>
<TR><TD>TempDir</TD><TD>/var/tmp</TD><TD>Specifies the temporary
directory to use.</TD></TR>
<TR><TD>Timeout</TD><TD>300</TD><TD>The timeout in seconds before
client connections are closed in the middle of a request.</TD></TR>
<TR><TD>User</TD><TD>lp</TD><TD>Specifies the user that is used when
running external programs.</TD></TR>
</TABLE>
</CENTER>
</P>
@@ -353,22 +405,28 @@ understood:
<CENTER>
<TABLE BORDER=1 WIDTH=90%>
<TR><TH WIDTH=25%>Directive</TH><TH>Description</TH></TR>
<TR><TD>Accepting</TD><TD>Specifies whether the printer is accepting
new jobs. May be the names &quot;Yes&quot; or &quot;No&quot;.</TD></TR>
<TR><TD>&lt;DefaultPrinter name&gt;
<BR> &lt;/Printer&gt;</TD><TD></TR>
<TR><TD>DeviceURI</TD><TD></TR>
<TR><TD>Info</TD><TD></TR>
<TR><TD>Location</TD><TD></TR>
<TR><TD>MoreInfo</TD><TD></TR>
<BR> &lt;/Printer&gt;</TD><TD>Surrounds the printer definition for a default
destination.</TD></TR>
<TR><TD>DeviceURI</TD><TD>Specifies the device-uri attribute for the
printer.</TD></TR>
<TR><TD>Info</TD><TD>A textual description of the printer.</TD></TR>
<TR><TD>Location</TD><TD>A textual location of the printer.</TD></TR>
<TR><TD>MoreInfo</TD><TD>A URL pointing to additional information on
the printer.</TD></TR>
<TR><TD>&lt;Printer name&gt;
<BR> &lt;/Printer&gt;</TD><TD></TR>
<TR><TD>State</TD><TD></TR>
<BR> &lt;/Printer&gt;</TD><TD>Surrounds the printer definition.</TD></TR>
<TR><TD>State</TD><TD>Specifies the initial state of the printer; can
be &quot;Idle&quot; or &quot;Stopped&quot;.</TD></TR>
</TABLE>
</CENTER>
</P>
<H1><A NAME=4>4 External Interfaces</A></H1>
<H2><A NAME=4_1>4.1 AppSocket Protocol</A></H2>
<P>The AppSocket protocol is an 8-bit clean TCP/IP socket connection.
The default IP service port is 9100. </P>
The default IP service port is 9100. The URI method name is &quot;socket&quot;. </P>
<H2><A NAME=4_2>4.2 CUPS Browsing Protocol</A></H2>
<P>The CUPS Browsing Protocol is a UDP/IP-based broadcast service. By
default this service operates on IP service port 631. </P>
@@ -545,10 +603,7 @@ application/vnd.cups-raster</CODE>. </P>
<P>Raw files are printer-dependent print files that are in a format
suitable to the destination printer (e.g. HP-PCL, HP-RTL, etc.) The
MIME type for CUPS Raw files is <CODE>application/vnd.cups-raw</CODE>. </P>
<H2><A NAME=4_6>4.6 File Transfer Protocol</A></H2>
<P>The File Transfer Protocol (FTP) is described by <A HREF=http://www.ietf.org/rfc/rfc959.txt>
RFC 959: File Transfer Protocol</A>. </P>
<H2><A NAME=4_7>4.7 Internet Printing Protocol</A></H2>
<H2><A NAME=4_6>4.6 Internet Printing Protocol</A></H2>
<P>The Internet Printing Protocol is described by the following RFCs: </P>
<UL>
<LI><A HREF=http://www.ietf.org/rfc/rfc2565.txt>RFC 2565: Internet
@@ -563,20 +618,21 @@ Protocol</A></LI>
<LI><A HREF=http://www.ietf.org/rfc/rfc2569.txt>RFC 2569: Mapping
between LPD and IPP Protocols</A></LI>
</UL>
<P>The URI method name for IPP is &quot;ipp&quot;. </P>
<P>CUPS defines the following extension operations to IPP. </P>
<H3><A NAME=4_7_1>4.7.1 Get Default Destination (CUPS_GET_DEFAULT =
<H3><A NAME=4_6_1>4.6.1 Get Default Destination (CUPS_GET_DEFAULT =
0x4001)</A></H3>
<P>The get default destination operation returns the printer attributes
for the system default printer or class. The only required attributes
are <CODE>attributes-charset</CODE> and <CODE>
attributes-natural-language</CODE>. </P>
<P>Get default destination will only return <CODE>ipp-ok</CODE>. </P>
<H3><A NAME=4_7_2>4.7.2 Get Printers (CUPS_GET_PRINTERS = 0x4002)</A></H3>
<H3><A NAME=4_6_2>4.6.2 Get Printers (CUPS_GET_PRINTERS = 0x4002)</A></H3>
<P>The get printers operation returns the printer attributes for all
printers known to the system. The only required attributes are <CODE>
attributes-charset</CODE> and <CODE>attributes-natural-language</CODE>. </P>
<P>Get printers will only return <CODE>ipp-ok</CODE>. </P>
<H3><A NAME=4_7_3>4.7.3 Add Printer (CUPS_ADD_PRINTER = 0x4003)</A></H3>
<H3><A NAME=4_6_3>4.6.3 Add Printer (CUPS_ADD_PRINTER = 0x4003)</A></H3>
<P>The add printer operation adds or replaces the specified printer.
The <CODE>attributes-charset</CODE>, <CODE>attributes-natural-language</CODE>
and <CODE>printer-uri</CODE> attributes are required. </P>
@@ -589,19 +645,19 @@ body. If a valid interface script or PPD file is not provided then the
printer is treated as a generic PostScript device. </P>
<P>Add printer will return <CODE>ipp-ok</CODE>, <CODE>ipp-not-authorized</CODE>
, <CODE>ipp-bad-request</CODE>, or <CODE>ipp-attributes</CODE>. </P>
<H3><A NAME=4_7_4>4.7.4 Delete Printer (CUPS_DELETE_PRINTER = 0x4004)</A>
<H3><A NAME=4_6_4>4.6.4 Delete Printer (CUPS_DELETE_PRINTER = 0x4004)</A>
</H3>
<P>The delete printer operation removes the specified printer. The only
required attributes are <CODE>attributes-charset</CODE>, <CODE>
attributes-natural-language</CODE>, and <CODE>printer-uri</CODE>. </P>
<P>Delete printer will return <CODE>ipp-ok</CODE>, <CODE>ipp-not-found</CODE>
, or <CODE>ipp-not-authorized</CODE>. </P>
<H3><A NAME=4_7_5>4.7.5 Get Classes (CUPS_GET_CLASSES = 0x4005)</A></H3>
<H3><A NAME=4_6_5>4.6.5 Get Classes (CUPS_GET_CLASSES = 0x4005)</A></H3>
<P>The get classes operation returns the printer attributes for all
classes known to the system. The only required attributes are <CODE>
attributes-charset</CODE> and <CODE>attributes-natural-language</CODE>. </P>
<P>Get classes will only return <CODE>ipp-ok</CODE>. </P>
<H3><A NAME=4_7_6>4.7.6 Add Class (CUPS_ADD_CLASS = 0x4006)</A></H3>
<H3><A NAME=4_6_6>4.6.6 Add Class (CUPS_ADD_CLASS = 0x4006)</A></H3>
<P>The add class operation adds or replaces the specified class. The <CODE>
attributes-charset</CODE>, <CODE>attributes-natural-language</CODE>,
and <CODE>printer-uri</CODE> attributes are required. </P>
@@ -611,27 +667,27 @@ required when initially adding a printer and optional when modifying a
printer. </P>
<P>Add class will return <CODE>ipp-ok</CODE>, <CODE>ipp-not-authorized</CODE>
, <CODE>ipp-bad-request</CODE>, or <CODE>ipp-attributes</CODE>. </P>
<H3><A NAME=4_7_7>4.7.7 Delete Class (CUPS_DELETE_CLASS = 0x4007)</A></H3>
<H3><A NAME=4_6_7>4.6.7 Delete Class (CUPS_DELETE_CLASS = 0x4007)</A></H3>
<P>The delete class operation removes the specified class. The only
required attributes are <CODE>attributes-charset</CODE>, <CODE>
attributes-natural-language</CODE>, and <CODE>printer-uri</CODE>. </P>
<P>Delete class will return <CODE>ipp-ok</CODE>, <CODE>ipp-not-found</CODE>
, or <CODE>ipp-not-authorized</CODE>. </P>
<H3><A NAME=4_7_8>4.7.8 Accept Jobs (CUPS_ACCEPT_JOBS = 0x4008)</A></H3>
<H3><A NAME=4_6_8>4.6.8 Accept Jobs (CUPS_ACCEPT_JOBS = 0x4008)</A></H3>
<P>The accept jobs operation allows jobs to be accepted by the
specified destination. The only required attributes are <CODE>
attributes-charset</CODE>, <CODE>attributes-natural-language</CODE>,
and <CODE>printer-uri</CODE>. </P>
<P>Accept jobs will return <CODE>ipp-ok</CODE>, <CODE>ipp-not-found</CODE>
, or <CODE>ipp-not-authorized</CODE>. </P>
<H3><A NAME=4_7_9>4.7.9 Reject Jobs (CUPS_REJECT_JOBS = 0x4009)</A></H3>
<H3><A NAME=4_6_9>4.6.9 Reject Jobs (CUPS_REJECT_JOBS = 0x4009)</A></H3>
<P>The reject jobs operation prevents jobs from being accepted by the
specified destination. The only required attributes are <CODE>
attributes-charset</CODE>, <CODE>attributes-natural-language</CODE>,
and <CODE>printer-uri</CODE>. </P>
<P>Reject jobs will return <CODE>ipp-ok</CODE>, <CODE>ipp-not-found</CODE>
, or <CODE>ipp-not-authorized</CODE>. </P>
<H3><A NAME=4_7_10>4.7.10 Set Default Destination (CUPS_SET_DEFAULT =
<H3><A NAME=4_6_10>4.6.10 Set Default Destination (CUPS_SET_DEFAULT =
0x400A)</A></H3>
<P>The set default destination operation returns the printer attributes
for the system default printer or class. The only required attributes
@@ -640,28 +696,27 @@ are <CODE>attributes-charset</CODE>, <CODE>attributes-natural-language</CODE>
<P>Set default destination will return <CODE>ipp-ok</CODE>, <CODE>
ipp-not-authorized</CODE>, <CODE>ipp-bad-request</CODE>, or <CODE>
ipp-not-found</CODE>. </P>
<H2><A NAME=4_8>4.8 Line Printer Daemon Protocol</A></H2>
<H2><A NAME=4_7>4.7 Line Printer Daemon Protocol</A></H2>
<P>The Line Printer Daemon (LPD) protocol is described by <A HREF=http://www.ietf.org/rfc/rfc1179.txt>
RFC 1179: Line Printer Daemon Protocol</A>. </P>
<H2><A NAME=4_9>4.9 Server Message Block Protocol</A></H2>
<P>The URI method name for LPD is &quot;lpd&quot;. </P>
<H2><A NAME=4_8>4.8 Server Message Block Protocol</A></H2>
<P>The Server Message Block (SMB) and related Common Internet File
System (CIFS) protocols are described at <A HREF=http://anu.samba.org/cifs>
http://anu.samba.org/cifs</A>. </P>
<H2><A NAME=4_10>4.10 Trivial File Transfer Protocol</A></H2>
<P>The Trivial File Transfer Protocol (TFTP) is described by <A HREF=http://www.ietf.org/rfc/rfc1350.txt>
RFC 1350: The TFTP Protocol (Revision 2)</A>. </P>
<P>The URI method name for SMB is &quot;smb&quot;. </P>
<H1><A NAME=5>5 5 - Directories</A></H1>
<DL>
<DT>/usr/bin </DT>
<DD>The <CODE>cancel</CODE>, <CODE>lp</CODE>, <CODE>lpq</CODE>, <CODE>
lpr</CODE>, <CODE>lprm</CODE>, and <CODE>lpstat</CODE> commands reside
here. </DD>
<DT>/usr/lib </DT>
<DD>The <CODE>accept</CODE>, <CODE>disable</CODE>, <CODE>enable</CODE>, <CODE>
lpadmin</CODE>, and <CODE>reject</CODE> commands reside here. </DD>
<DT>/usr/sbin </DT>
<DD>The <CODE>lpc</CODE> and <CODE>cupsd</CODE> commands resize here. </DD>
<DD>The <CODE>accept</CODE>, <CODE>cupsd</CODE>, <CODE>lpadmin</CODE>, <CODE>
lpc</CODE>, and <CODE>reject</CODE> commands reside here. </DD>
<DT>/usr/share/cups </DT>
<DD>This is the root directory of the CUPS static data. </DD>
<DT>/usr/share/cups/data </DT>
<DD>The character set and filter data files reside here. </DD>
<DT>/usr/share/cups/fonts </DT>
<DD>The <CODE>pstoraster</CODE> font files reside here. </DD>
+1157 -1216
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+143 -109
Ver Arquivo
@@ -3,7 +3,7 @@
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-IDD-1.0">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>DRAFT - CUPS Interface Design Description</TITLE>
<TITLE>CUPS Interface Design Description</TITLE>
</HEAD>
<BODY>
@@ -74,10 +74,10 @@ sections:
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft)
<LI>IPP/1.0: Additional Optional Operations - Set 1
<LI>IPP/1.0: Encoding and Transport
<LI>IPP/1.0: Implementers Guide
<LI>IPP/1.0: Model and Semantics
<LI>RFC 1179, Line Printer Daemon Protocol
<LI>RFC 2565, IPP/1.0: Encoding and Transport
<LI>RFC 2566, IPP/1.0: Model and Semantics
<LI>RFC 2639, IPP/1.0: Implementers Guide
</UL>
<H1>Internal Interfaces</H1>
@@ -210,18 +210,18 @@ printer.
<P>This string attribute specifies a color profile of the form:
<UL><PRE>
resolution/type density m00 m01 m02 m10 m11 m12 m20 m21 m22
resolution/type density gamma m00 m01 m02 m10 m11 m12 m20 m21 m22
</PRE></UL>
<P>The <I>resolution</I> and <I>type</I> values may be "-" to act as a
wildcard. Otherwise they must match one of the <CODE>Resolution</CODE> or
<CODE>MediaType</CODE> attributes defined in the PPD file.
<P>The <I>density</I> value defines a gamma and density adjustment function
such that:
<P>The <I>density</I> and <I>gamma</I> values define gamma and density
adjustment function such that:
<UL><PRE>
f(x) = d * x<SUP>1/d</SUP>
f(x) = density * x<SUP>gamma</SUP>
</PRE></UL>
<P>The <I>m00</I> through <I>m22</I> values define a 3x3 transformation
@@ -269,28 +269,33 @@ followed by its value. The following directives are understood:
<TR>
<TD>&lt;Class name&gt;<BR>
&lt;/Class&gt;</TD>
<TD></TD>
<TD>Surrounds a class definition.</TD>
</TR>
<TR>
<TD>&lt;DefaultClass name&gt;<BR>
&lt;/Class&gt;</TD>
<TD></TD>
<TD>Surrounds a class definition for the default destination.</TD>
</TR>
<TR>
<TD>Accepting</TD>
<TD>Specifies whether the class is accepting new jobs. May be
the names "Yes" or "No".</TD>
</TR>
<TR>
<TD>Info</TD>
<TD></TD>
<TD>A textual description of the class.</TD>
</TR>
<TR>
<TD>Location</TD>
<TD></TD>
<TD>A textual location of the class.</TD>
</TR>
<TR>
<TD>MoreInfo</TD>
<TD></TD>
<TD>A URL pointing to additional information on the class.</TD>
</TR>
<TR>
<TD>Printer</TD>
<TD></TD>
<TD>Specifies a printer that is a member of the class.</TD>
</TR>
</TABLE></CENTER>
@@ -310,180 +315,208 @@ followed by its value. The following directives are understood:
</TR>
<TR>
<TD>AccessLog</TD>
<TD></TD>
<TD>Specifies the location of the access log file (default
"logs/access_log").</TD>
<TD>logs/access_log</TD>
<TD>Specifies the location of the access log file.</TD>
</TR>
<TR>
<TD>Allow</TD>
<TD></TD>
<TD></TD>
<TD>-</TD>
<TD>Allows connections from the specified host, network, or
domain.</TD>
</TR>
<TR>
<TD>AuthClass</TD>
<TD></TD>
<TD></TD>
<TD>-</TD>
<TD>Specifies what level of authentication is required; may be either
"User", "System", or "Group".</TD>
</TR>
<TR>
<TD>AuthType</TD>
<TD></TD>
<TD></TD>
<TD>None</TD>
<TD>Specifies the type of authentication to perform; may be either
"None" or "Basic".</TD>
</TR>
<TR>
<TD>BrowseAddress</TD>
<TD></TD>
<TD></TD>
<TD>255.255.255.255</TD>
<TD>Specifies a broadcast address to send CUPS browsing packets to.</TD>
</TR>
<TR>
<TD>BrowseInterval</TD>
<TD></TD>
<TD></TD>
<TD>30</TD>
<TD>Specifies the number of seconds between browsing updates.</TD>
</TR>
<TR>
<TD>BrowsePort</TD>
<TD></TD>
<TD></TD>
<TD>631</TD>
<TD>Specifies the UDP port number to use for browse packets.</TD>
</TR>
<TR>
<TD>BrowseTimeout</TD>
<TD></TD>
<TD></TD>
<TD>300</TD>
<TD>Specifies the number of seconds to wait until remote destinations
are removed from the local destination list.</TD>
</TR>
<TR>
<TD>Browsing</TD>
<TD></TD>
<TD></TD>
<TD>On</TD>
<TD>Specifies whether or not printer and class browsing is enabled; can
be "On" or "Off".</TD>
</TR>
<TR>
<TD>DefaultCharset</TD>
<TD></TD>
<TD></TD>
<TD>iso-8859-1</TD>
<TD>Specifies the default character set.</TD>
</TR>
<TR>
<TD>DefaultLanguage</TD>
<TD></TD>
<TD></TD>
<TD>current locale</TD>
<TD>Specifies the default language.</TD>
</TR>
<TR>
<TD>Deny</TD>
<TD></TD>
<TD></TD>
<TD>-</TD>
<TD>Refuses connections from the specified host, network, or
domain.</TD>
</TR>
<TR>
<TD>DocumentRoot</TD>
<TD></TD>
<TD></TD>
<TD>/usr/share/cups/doc</TD>
<TD>Specifies the document data root directory.</TD>
</TR>
<TR>
<TD>ErrorLog</TD>
<TD></TD>
<TD></TD>
<TD>logs/error_log</TD>
<TD>Specifies the error log file location.</TD>
</TR>
<TR>
<TD>Group</TD>
<TD></TD>
<TD></TD>
<TD>root, sys, system</TD>
<TD>Specifies the group name or ID that is used when running
external programs.</TD>
</TR>
<TR>
<TD>HostNameLookups</TD>
<TD></TD>
<TD></TD>
<TD>Off</TD>
<TD>Specifies whether or not to perform reverse IP address lookups to
get the actual hostname; may be "On" or "Off". Hostname lookups can
significantly degrade the performance of the CUPS server if one or
more DNS servers is not functioning properly.</TD>
</TR>
<TR>
<TD>ImplicitClasses</TD>
<TD></TD>
<TD></TD>
<TD>On</TD>
<TD>Specifies whether or not to automatically create printer classes
when more than one printer or class of the same name is detected on
the network; may be "On" or "Off".</TD>
</TR>
<TR>
<TD>KeepAlive</TD>
<TD></TD>
<TD></TD>
<TD>On</TD>
<TD>Specifies whether or not to use the HTTP Keep-Alive feature; may
be "On" or "Off".</TD>
</TR>
<TR>
<TD>KeepAliveTimeout</TD>
<TD></TD>
<TD></TD>
<TD>30</TD>
<TD>Specifies the amount of time to keep the HTTP connection alive
before closing it.</TD>
</TR>
<TR>
<TD>&lt;Location path&gt;<BR>
&lt;/Location&gt;</TD>
<TD></TD>
<TD></TD>
<TD>-</TD>
<TD>Specifies a location to restrict access to.</TD>
</TR>
<TR>
<TD>LogLevel</TD>
<TD></TD>
<TD></TD>
<TD>info</TD>
<TD>Controls the amount of information that is logged in the
error log file. Can be one of "debug", "info", "warn", "error",
or "none", in decreasing order or verbosity.</TD>
</TR>
<TR>
<TD>MaxClients</TD>
<TD></TD>
<TD></TD>
<TD>100</TD>
<TD>Specifies the maximum number of simultaneous active clients.
This value is internally limited to 1/3 of the total number of
availabel file descriptors.</TD>
</TR>
<TR>
<TD>MaxLogSize</TD>
<TD></TD>
<TD></TD>
<TD>0</TD>
<TD>Specifies the maximum size of the access, error, and page
log files in bytes. If set to 0 then no maximum size is set.
Log files are rotated automatically when this size is
exceeded.</TD>
</TR>
<TR>
<TD>MaxRequestSize</TD>
<TD></TD>
<TD></TD>
<TD>0</TD>
<TD>Specifies the maximum size of HTTP requests in bytes. If set to 0
then there is no maximum.</TD>
</TR>
<TR>
<TD>Order</TD>
<TD></TD>
<TD></TD>
<TD>Allow,Deny</TD>
<TD>Specifies the order of Allow and Deny directive processing; can
be "Deny,Allow" to implicitly deny hosts unless they are allowed by
an Allow line, or "Allow,Deny" to implicitly allow hosts unless they
are denied by a Deny line.</TD>
</TR>
<TR>
<TD>PageLog</TD>
<TD></TD>
<TD></TD>
<TD>logs/page_log</TD>
<TD>Specifies the location of the page log file.</TD>
</TR>
<TR>
<TD>Port</TD>
<TD></TD>
<TD></TD>
<TD>631</TD>
<TD>Specifies a port number to listen to for HTTP connections.</TD>
</TR>
<TR>
<TD>RIPCache</TD>
<TD></TD>
<TD></TD>
<TD>8m</TD>
<TD>Specifies the size of the memory cache in bytes that is used by
RIP filters.</TD>
</TR>
<TR>
<TD>ServerAdmin</TD>
<TD></TD>
<TD></TD>
<TD>root@ServerName</TD>
<TD>Specifies the person to contact with problems.</TD>
</TR>
<TR>
<TD>ServerName</TD>
<TD></TD>
<TD></TD>
<TD>hostname</TD>
<TD>Specifies the hostname that is supplied to HTTP clients. This
is also used to determine the default CUPS server for the CUPS IPP
client applications.</TD>
</TR>
<TR>
<TD>ServerRoot</TD>
<TD></TD>
<TD></TD>
<TD>/var/cups</TD>
<TD>Specifies the root directory for server data files.</TD>
</TR>
<TR>
<TD>SystemGroup</TD>
<TD></TD>
<TD></TD>
<TD>root, sys, system</TD>
<TD>Specifies the group name used for System class authentication.</TD>
</TR>
<TR>
<TD>TempDir</TD>
<TD></TD>
<TD></TD>
<TD>/var/tmp</TD>
<TD>Specifies the temporary directory to use.</TD>
</TR>
<TR>
<TD>Timeout</TD>
<TD></TD>
<TD></TD>
<TD>300</TD>
<TD>The timeout in seconds before client connections are closed
in the middle of a request.</TD>
</TR>
<TR>
<TD>User</TD>
<TD></TD>
<TD></TD>
<TD>lp</TD>
<TD>Specifies the user that is used when running external programs.</TD>
</TR>
</TABLE></CENTER>
@@ -500,35 +533,41 @@ followed by its value. The following directives are understood:
<TH WIDTH="25%">Directive</TH>
<TH>Description</TH>
</TR>
<TR>
<TD>Accepting</TD>
<TD>Specifies whether the printer is accepting new jobs. May be
the names "Yes" or "No".</TD>
</TR>
<TR>
<TD>&lt;DefaultPrinter name&gt;<BR>
&lt;/Printer&gt;</TD>
<TD></TD>
<TD>Surrounds the printer definition for a default destination.</TD>
</TR>
<TR>
<TD>DeviceURI</TD>
<TD></TD>
<TD>Specifies the device-uri attribute for the printer.</TD>
</TR>
<TR>
<TD>Info</TD>
<TD></TD>
<TD>A textual description of the printer.</TD>
</TR>
<TR>
<TD>Location</TD>
<TD></TD>
<TD>A textual location of the printer.</TD>
</TR>
<TR>
<TD>MoreInfo</TD>
<TD></TD>
<TD>A URL pointing to additional information on the printer.</TD>
</TR>
<TR>
<TD>&lt;Printer name&gt;<BR>
&lt;/Printer&gt;</TD>
<TD></TD>
<TD>Surrounds the printer definition.</TD>
</TR>
<TR>
<TD>State</TD>
<TD></TD>
<TD>Specifies the initial state of the printer; can be "Idle" or
"Stopped".</TD>
</TR>
</TABLE></CENTER>
@@ -537,7 +576,7 @@ followed by its value. The following directives are understood:
<H2>AppSocket Protocol</H2>
<P>The AppSocket protocol is an 8-bit clean TCP/IP socket connection.
The default IP service port is 9100.
The default IP service port is 9100. The URI method name is "socket".
<H2>CUPS Browsing Protocol</H2>
@@ -912,12 +951,6 @@ raster data for that page.
to the destination printer (e.g. HP-PCL, HP-RTL, etc.) The MIME type for CUPS
Raw files is <CODE>application/vnd.cups-raw</CODE>.
<H2>File Transfer Protocol</H2>
<P>The File Transfer Protocol (FTP) is described by
<A HREF="http://www.ietf.org/rfc/rfc959.txt">RFC 959: File Transfer
Protocol</A>.
<H2>Internet Printing Protocol</H2>
<P>The Internet Printing Protocol is described by the following RFCs:
@@ -942,6 +975,8 @@ Protocol</A>.
</UL>
<P>The URI method name for IPP is "ipp".
<P>CUPS defines the following extension operations to IPP.
<H3>Get Default Destination (CUPS_GET_DEFAULT = 0x4001)</H3>
@@ -1062,17 +1097,15 @@ are <CODE>attributes-charset</CODE>,
<A HREF="http://www.ietf.org/rfc/rfc1179.txt">RFC 1179: Line Printer Daemon
Protocol</A>.
<P>The URI method name for LPD is "lpd".
<H2>Server Message Block Protocol</H2>
<P>The Server Message Block (SMB) and related Common Internet File
System (CIFS) protocols are described at
<A HREF="http://anu.samba.org/cifs">http://anu.samba.org/cifs</A>.
<H2>Trivial File Transfer Protocol</H2>
<P>The Trivial File Transfer Protocol (TFTP) is described by
<A HREF="http://www.ietf.org/rfc/rfc1350.txt">RFC 1350: The TFTP Protocol
(Revision 2)</A>.
<P>The URI method name for SMB is "smb".
<H1>5 - Directories</H1>
@@ -1083,14 +1116,15 @@ System (CIFS) protocols are described at
<CODE>lpr</CODE>, <CODE>lprm</CODE>, and <CODE>lpstat</CODE> commands
reside here.
<DT>/usr/lib
<DD>The <CODE>accept</CODE>, <CODE>disable</CODE>, <CODE>enable</CODE>,
<CODE>lpadmin</CODE>, and <CODE>reject</CODE> commands reside here.
<DT>/usr/sbin
<DD>The <CODE>lpc</CODE> and <CODE>cupsd</CODE> commands resize here.
<DD>The <CODE>accept</CODE>, <CODE>cupsd</CODE>,
<CODE>lpadmin</CODE>, <CODE>lpc</CODE>, and <CODE>reject</CODE>
commands reside here.
<DT>/usr/share/cups
<DD>This is the root directory of the CUPS static data.
<DT>/usr/share/cups/data
<DD>The character set and filter data files reside here.
<DT>/usr/share/cups/fonts
+16 -11
Ver Arquivo
@@ -11,7 +11,7 @@
<TD><H1 ALIGN=right>An Overview of the<BR>
Common UNIX Printing System</H1></DIV>
<P ALIGN=right>May 11, 1999<BR>
<P ALIGN=right>October 4, 1999<BR>
Michael Sweet, Easy Software Products<BR>
Copyright 1998-1999, All Rights Reserved.</P>
</TD>
@@ -163,7 +163,9 @@ Apache server configuration file and defines all of the access control
properties for the server.
<P>The printer and class definition files list the available printer
queues and classes.
queues and classes. Printer classes are collections of printers. Jobs
sent to a class are forwarded to the first available printer in the
class, round-robin fashion.
<P>The MIME type files list the supported MIME types (text/plain,
application/postscript, etc.) and "magic" rules for automatically
@@ -174,13 +176,16 @@ when a <I>Print-Job</I> request is received with a
<I>document-format</I> of <I>application/octet-stream</I>.
<P>The MIME conversion rule files list the available filters. These
files are augmented by <I>AddFilter</I> entries in the printer
definition files. The filters are used when a job is dispatched so that
an application can send a convenient file format to the printing system
files are augmented by <I>cupsFilter</I> entries in the printer PPD
files. The filters are used when a job is dispatched so that an
application can send a convenient file format to the printing system
which then converts the document into a printable format as needed.
Each filter has a relative cost associated with it, and the filtering
algorithm chooses the set of filters that will convert the file to the
needed format with the lowest total "cost".
<P>The PPD files describe the capabilities of PostScript printers. There is
one PPD file for each printer.
<P>The PPD files describe the capabilities of PostScript printers.
There is one PPD file for each printer.
<H3>CUPS Interface Library</H3>
@@ -199,8 +204,8 @@ and job options. All output is sent to the standard output.
<H3>Backends</H3>
A backend program is a special filter that writes incoming data to a
device or network connection. Backends for serial, parallel, LPD, TFTP,
FTP, IPP, SMB, and AppSocket (JetDirect) connections are provided in
device or network connection. Backends for serial, parallel, LPD,
IPP, SMB, and AppSocket (JetDirect) connections are provided in
CUPS 1.0.
<H2>Berkeley and System V Commands</H2>
@@ -224,8 +229,8 @@ interfaces to ensure compatibility with existing applications.
<H2>Licensing</H2>
CUPS is available under the terms of the Aladdin Free Public
License, which means that it is basically free except for commercial
CUPS is available under the terms of the GNU General Public License
which means that it is basically free except for binary-only
distribution. Vendors wishing to license CUPS for their printing
solution should contact Easy Software Products at:
Arquivo binário não exibido.
+41 -9
Ver Arquivo
@@ -1,14 +1,14 @@
<HTML>
<HEAD>
<TITLE>DRAFT - CUPS Software Administrators Manual</TITLE>
<TITLE>CUPS Software Administrators Manual</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.0.0">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.0.2">
</HEAD>
<BODY>
<CENTER><A HREF=#contents><IMG SRC="images/cups-large.gif" BORDER=0><BR>
<H1>DRAFT - CUPS Software Administrators Manual</H1></A><BR>
CUPS-SAM-1.0.0<BR>
<H1>CUPS Software Administrators Manual</H1></A><BR>
CUPS-SAM-1.0.2<BR>
Easy Software Products<BR>
Copyright 1997-1999, All Rights Reserved<BR>
</CENTER>
@@ -92,7 +92,7 @@ Copyright 1997-1999, All Rights Reserved<BR>
<HR>
<H1 ALIGN=RIGHT><A NAME=1>Preface</A></H1>
This software administrators manual provides printer administration
information for the Common UNIX Printing System (&quot;CUPS&quot;) Version 1.0.0.
information for the Common UNIX Printing System (&quot;CUPS&quot;) Version 1.0.2.
<H2><A NAME=1_1>System Overview</A></H2>
The Common UNIX Printing System provides a portable printing layer for
UNIX&reg; operating systems. It has been developed by Easy Software
@@ -345,8 +345,8 @@ installation of CUPS: </P>
<DT>file:/dev/filename </DT>
<DT>/dev/filename </DT>
<DD>Sends all output to the specified file. </DD>
<DT>http://hostname[:port]/resource </DT>
<DT>ipp://hostname[:port]/resource </DT>
<DT>http://[username:password@]hostname[:port]/resource </DT>
<DT>ipp://[username:password@]hostname[:port]/resource </DT>
<DD>Sends all output to the specified IPP printer or server. The <I>
port</I> parameters defaults to 631. </DD>
<DT>lpd://hostname/queue </DT>
@@ -365,6 +365,9 @@ character:
<LI><CODE>parity=<I>none</I></CODE> - Turns parity checking off. </LI>
</UL>
</DD>
<DT>smb://[username:password@]hostname/queue </DT>
<DD>Sends all output to the specified SMB (Windows) printer queue
using the SAMBA software. </DD>
<DT>socket://hostname[:port] </DT>
<DD>Sends all output to the specified printer using the AppSocket
protocol. The <I>port</I> parameter defaults to 9100. </DD>
@@ -598,7 +601,21 @@ Allow from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
</UL>
<P><CODE>Allow</CODE> directives are cummulative, so multiple <CODE>
Allow</CODE> directives can be used to allow access for multiple hosts
or networks. </P>
or networks. The <CODE>/mm</CODE> notation specifies a CIDR netmask:
<CENTER>
<TABLE BORDER=1 WIDTH=80%>
<TR><TH>mm</TH><TH>netmask</TH></TR>
<TR><TD>0</TD><TD>0.0.0.0</TD></TR>
<TR><TD>1</TD><TD>128.0.0.0</TD></TR>
<TR><TD>2</TD><TD>192.0.0.0</TD></TR>
<TR><TD>...</TD><TD>...</TD></TR>
<TR><TD>8</TD><TD>255.0.0.0</TD></TR>
<TR><TD>16</TD><TD>255.255.0.0</TD></TR>
<TR><TD>24</TD><TD>255.255.255.0</TD></TR>
<TR><TD>32</TD><TD>255.255.255.255</TD></TR>
</TABLE>
</CENTER>
</P>
<P>The <CODE>Allow</CODE> directive must appear inside a <CODE>Location</CODE>
directive. </P>
<H3><A NAME=5_4_4>Deny</A></H3>
@@ -620,7 +637,22 @@ Deny from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
</PRE>
</UL>
<P><CODE>Deny</CODE> directives are cummulative, so multiple <CODE>Deny</CODE>
directives can be used to allow access for multiple hosts or networks. </P>
directives can be used to allow access for multiple hosts or networks.
The <CODE>/mm</CODE> notation specifies a CIDR netmask:
<CENTER>
<TABLE BORDER=1 WIDTH=80%>
<TR><TH>mm</TH><TH>netmask</TH></TR>
<TR><TD>0</TD><TD>0.0.0.0</TD></TR>
<TR><TD>1</TD><TD>128.0.0.0</TD></TR>
<TR><TD>2</TD><TD>192.0.0.0</TD></TR>
<TR><TD>...</TD><TD>...</TD></TR>
<TR><TD>8</TD><TD>255.0.0.0</TD></TR>
<TR><TD>16</TD><TD>255.255.0.0</TD></TR>
<TR><TD>24</TD><TD>255.255.255.0</TD></TR>
<TR><TD>32</TD><TD>255.255.255.255</TD></TR>
</TABLE>
</CENTER>
</P>
<P>The <CODE>Deny</CODE> directive must appear inside a <CODE>Location</CODE>
directive. </P>
<H3><A NAME=5_4_5>AuthType</A></H3>
+574 -547
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+91 -7
Ver Arquivo
@@ -1,16 +1,16 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.0.0">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.0.2">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>DRAFT - CUPS Software Administrators Manual</TITLE>
<TITLE>CUPS Software Administrators Manual</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=RIGHT>Preface</H1>
This software administrators manual provides printer administration
information for the Common UNIX Printing System ("CUPS") Version 1.0.0.
information for the Common UNIX Printing System ("CUPS") Version 1.0.2.
<H2>System Overview</H2>
@@ -315,8 +315,8 @@ CUPS:
<DT>/dev/filename
<DD>Sends all output to the specified file.
<DT>http://hostname[:port]/resource
<DT>ipp://hostname[:port]/resource
<DT>http://[username:password@]hostname[:port]/resource
<DT>ipp://[username:password@]hostname[:port]/resource
<DD>Sends all output to the specified IPP printer or server.
The <I>port</I> parameters defaults to 631.
@@ -343,6 +343,10 @@ CUPS:
checking off.
</UL>
<DT>smb://[username:password@]hostname/queue
<DD>Sends all output to the specified SMB (Windows) printer queue
using the SAMBA software.
<DT>socket://hostname[:port]
<DD>Sends all output to the specified printer using the
AppSocket protocol. The <I>port</I> parameter defaults to 9100.
@@ -633,7 +637,47 @@ Allow from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
</PRE></UL>
<P><CODE>Allow</CODE> directives are cummulative, so multiple <CODE>Allow</CODE>
directives can be used to allow access for multiple hosts or networks.
directives can be used to allow access for multiple hosts or networks. The
<CODE>/mm</CODE> notation specifies a CIDR netmask:
<CENTER><TABLE WIDTH="80%" BORDER="1">
<TR>
<TH>mm</TH>
<TH>netmask</TH>
</TR>
<TR>
<TD>0</TD>
<TD>0.0.0.0</TD>
</TR>
<TR>
<TD>1</TD>
<TD>128.0.0.0</TD>
</TR>
<TR>
<TD>2</TD>
<TD>192.0.0.0</TD>
</TR>
<TR>
<TD>...</TD>
<TD>...</TD>
</TR>
<TR>
<TD>8</TD>
<TD>255.0.0.0</TD>
</TR>
<TR>
<TD>16</TD>
<TD>255.255.0.0</TD>
</TR>
<TR>
<TD>24</TD>
<TD>255.255.255.0</TD>
</TR>
<TR>
<TD>32</TD>
<TD>255.255.255.255</TD>
</TR>
</TABLE></CENTER>
<P>The <CODE>Allow</CODE> directive must appear inside a
<CODE>Location</CODE> directive.
@@ -658,7 +702,47 @@ Deny from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
</PRE></UL>
<P><CODE>Deny</CODE> directives are cummulative, so multiple <CODE>Deny</CODE>
directives can be used to allow access for multiple hosts or networks.
directives can be used to allow access for multiple hosts or networks. The
<CODE>/mm</CODE> notation specifies a CIDR netmask:
<CENTER><TABLE WIDTH="80%" BORDER="1">
<TR>
<TH>mm</TH>
<TH>netmask</TH>
</TR>
<TR>
<TD>0</TD>
<TD>0.0.0.0</TD>
</TR>
<TR>
<TD>1</TD>
<TD>128.0.0.0</TD>
</TR>
<TR>
<TD>2</TD>
<TD>192.0.0.0</TD>
</TR>
<TR>
<TD>...</TD>
<TD>...</TD>
</TR>
<TR>
<TD>8</TD>
<TD>255.0.0.0</TD>
</TR>
<TR>
<TD>16</TD>
<TD>255.255.0.0</TD>
</TR>
<TR>
<TD>24</TD>
<TD>255.255.255.0</TD>
</TR>
<TR>
<TD>32</TD>
<TD>255.255.255.255</TD>
</TR>
</TABLE></CENTER>
<P>The <CODE>Deny</CODE> directive must appear inside a
<CODE>Location</CODE> directive.
+61 -67
Ver Arquivo
@@ -1,13 +1,13 @@
<HTML>
<HEAD>
<TITLE>DRAFT - CUPS Software Design Description</TITLE>
<TITLE>CUPS Software Design Description</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SDD-1.0">
</HEAD>
<BODY>
<CENTER><A HREF=#contents><IMG SRC="images/cups-large.gif" BORDER=0><BR>
<H1>DRAFT - CUPS Software Design Description</H1></A><BR>
<H1>CUPS Software Design Description</H1></A><BR>
CUPS-SDD-1.0<BR>
Easy Software Products<BR>
Copyright 1997-1999, All Rights Reserved<BR>
@@ -34,8 +34,7 @@ Copyright 1997-1999, All Rights Reserved<BR>
<LI><A HREF=#3_1_2>3.1.2 lpd</A></LI>
<LI><A HREF=#3_1_3>3.1.3 parallel</A></LI>
<LI><A HREF=#3_1_4>3.1.4 serial</A></LI>
<LI><A HREF=#3_1_5>3.1.5 smb</A></LI>
<LI><A HREF=#3_1_6>3.1.6 socket</A></LI>
<LI><A HREF=#3_1_5>3.1.5 socket</A></LI>
</UL>
<LI><A HREF=#3_2>3.2 Berkeley Commands</A></LI>
<UL>
@@ -45,9 +44,9 @@ Copyright 1997-1999, All Rights Reserved<BR>
</UL>
<LI><A HREF=#3_3>3.3 CGI</A></LI>
<UL>
<LI><A HREF=#3_3_1>3.3.1 classes</A></LI>
<LI><A HREF=#3_3_2>3.3.2 jobs</A></LI>
<LI><A HREF=#3_3_3>3.3.3 printers</A></LI>
<LI><A HREF=#3_3_1>3.3.1 classes.cgi</A></LI>
<LI><A HREF=#3_3_2>3.3.2 jobs.cgi</A></LI>
<LI><A HREF=#3_3_3>3.3.3 printers.cgi</A></LI>
</UL>
<LI><A HREF=#3_4>3.4 CUPS Interface Library</A></LI>
<UL>
@@ -63,8 +62,11 @@ Copyright 1997-1999, All Rights Reserved<BR>
<UL>
<LI><A HREF=#3_5_1>3.5.1 hpgltops</A></LI>
<LI><A HREF=#3_5_2>3.5.2 imagetops</A></LI>
<LI><A HREF=#3_5_3>3.5.3 pstops</A></LI>
<LI><A HREF=#3_5_4>3.5.4 texttops</A></LI>
<LI><A HREF=#3_5_3>3.5.3 imagetoraster</A></LI>
<LI><A HREF=#3_5_4>3.5.4 pstops</A></LI>
<LI><A HREF=#3_5_5>3.5.5 pstoraster</A></LI>
<LI><A HREF=#3_5_6>3.5.6 rastertohp</A></LI>
<LI><A HREF=#3_5_7>3.5.7 texttops</A></LI>
</UL>
<LI><A HREF=#3_6>3.6 Scheduler</A></LI>
<UL>
@@ -75,8 +77,9 @@ Copyright 1997-1999, All Rights Reserved<BR>
<LI><A HREF=#3_6_5>3.6.5 Directory Services</A></LI>
<LI><A HREF=#3_6_6>3.6.6 IPP</A></LI>
<LI><A HREF=#3_6_7>3.6.7 Jobs</A></LI>
<LI><A HREF=#3_6_8>3.6.8 Main</A></LI>
<LI><A HREF=#3_6_9>3.6.9 Printers</A></LI>
<LI><A HREF=#3_6_8>3.6.8 Logging</A></LI>
<LI><A HREF=#3_6_9>3.6.9 Main</A></LI>
<LI><A HREF=#3_6_10>3.6.10 Printers</A></LI>
</UL>
<LI><A HREF=#3_7>3.7 System V Commands</A></LI>
<UL>
@@ -90,12 +93,10 @@ Copyright 1997-1999, All Rights Reserved<BR>
<LI><A HREF=#3_7_8>3.7.8 reject</A></LI>
</UL>
</UL>
<B><A HREF=#4>4 Detailed Design</A></B>
<BR>
<BR><B><A HREF=#5>A Glossary</A></B>
<B><A HREF=#4>A Glossary</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>A.1 Terms</A></LI>
<LI><A HREF=#4_2>A.2 Acronyms</A></LI>
</UL>
<HR>
<H1><A NAME=1>1 Scope</A></H1>
@@ -126,7 +127,6 @@ can be used to support non-PostScript printers. </P>
<LI>1 - Scope </LI>
<LI>2 - References </LI>
<LI>3 - Design Overview </LI>
<LI>4 - Detailed Design </LI>
<LI>A - Glossary </LI>
</UL>
<H1><A NAME=2>2 References</A></H1>
@@ -148,10 +148,10 @@ can be used to support non-PostScript printers. </P>
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft) </LI>
<LI>IPP/1.0: Additional Optional Operations - Set 1 </LI>
<LI>IPP/1.0: Encoding and Transport </LI>
<LI>IPP/1.0: Implementers Guide </LI>
<LI>IPP/1.0: Model and Semantics </LI>
<LI>RFC 1179, Line Printer Daemon Protocol </LI>
<LI>RFC 2565, IPP/1.0: Encoding and Transport </LI>
<LI>RFC 2566, IPP/1.0: Model and Semantics </LI>
<LI>RFC 2639, IPP/1.0: Implementers Guide </LI>
</UL>
<H1><A NAME=3>3 Design Overview</A></H1>
CUPS is composed of 7 software sub-systems that operate together to
@@ -219,17 +219,7 @@ form:
<LI><CODE>parity=<I>odd</I></CODE> - Sets odd parity checking. </LI>
<LI><CODE>parity=<I>none</I></CODE> - Turns parity checking off. </LI>
</UL>
<H3><A NAME=3_1_5>3.1.5 smb</A></H3>
The smb backend sends the specified job to a network host using the
Server Message Block protocol, which is used by most machines running
Microsoft&reg; Windows&reg;. The URI is of the form:
<UL>
<PRE>smb://hostname/queue
</PRE>
</UL>
Usernames and passwords required to access the printer are stored in
an external file.
<H3><A NAME=3_1_6>3.1.6 socket</A></H3>
<H3><A NAME=3_1_5>3.1.5 socket</A></H3>
The socket backend sends the specified job to a network host using the
AppSocket protocol commonly used by Hewlett-Packard and Tektronix
printers. The URI is of the form:
@@ -241,41 +231,32 @@ printers. The URI is of the form:
<H2><A NAME=3_2>3.2 Berkeley Commands</A></H2>
The Berkeley commands provide a simple command-line interface to CUPS
to submit and control print jobs. It is provided for compatibility with
existing software that is hard coded to use the Berkeley commands,
however since printer options cannot be specified using the Berkeley
commands their use it not encouraged.
existing software that is hard coded to use the Berkeley commands.
<H3><A NAME=3_2_1>3.2.1 lpc</A></H3>
The lpc command allows users and administrators to check the status
and control print queues. The version provided with CUPS supports the
following commands:
<UL>
<LI>abort - Stops a printer or all printers and any active print jobs. </LI>
<LI>disable - Prevents new jobs from being submitted to the specified
printer or all printers. </LI>
<LI>down - Stops a printer or all printers after completing the current
print jobs. </LI>
<LI>enable - Allows new jobs to be submitted. </LI>
<LI>start - Starts a printer or all printers. </LI>
<LI>quit - Quits the lpc command. </LI>
<LI>status - Shows the status of printers and jobs in the queue. </LI>
<LI>up - Starts a printer or all printers. </LI>
</UL>
<H3><A NAME=3_2_2>3.2.2 lpr</A></H3>
The lpr command submits a job for printing. The CUPS version of lpr
silently ignores the &quot;i&quot;, &quot;p&quot;, &quot;t&quot;, &quot;m&quot;, &quot;h&quot;, and &quot;s&quot; options.
silently ignores the &quot;i&quot;, &quot;t&quot;, &quot;m&quot;, &quot;h&quot;, and &quot;s&quot; options.
<H3><A NAME=3_2_3>3.2.3 lprm</A></H3>
The lprm removes one or more print jobs.
<H2><A NAME=3_3>3.3 CGI</A></H2>
The Common Gateway Interface (CGI) programs provide a web-based status
interface to monitor the status of printers, classes, and jobs.
<H3><A NAME=3_3_1>3.3.1 classes</A></H3>
<H3><A NAME=3_3_1>3.3.1 classes.cgi</A></H3>
The classes CGI lists the available printer classes and any pending
jobs for the class. The user can click on individual classes to limit
the display and click on jobs to see the job status.
<H3><A NAME=3_3_2>3.3.2 jobs</A></H3>
<H3><A NAME=3_3_2>3.3.2 jobs.cgi</A></H3>
The jobs CGI lists the queued print jobs in order of priority. The
list can be limited by printer or job. When the user displays the
status of an individual print job all job options are displayed.
<H3><A NAME=3_3_3>3.3.3 printers</A></H3>
<H3><A NAME=3_3_3>3.3.3 printers.cgi</A></H3>
The printers CGI lists the available printer queues and any pending
jobs for the printer. The user can click on individual printers to
limit the display and click on jobs to see the job status.
@@ -284,8 +265,9 @@ limit the display and click on jobs to see the job status.
language, MIME, PPD, and raster functions used by the CUPS software.
<H3><A NAME=3_4_1>3.4.1 Convenience Functions</A></H3>
Convenience functions are provided to submit an IPP request, send a
print file, cancel a job, get a list of available printers, and get a
list of available classes.
print file, cancel a job, get a list of available printers, get a list
of available classes, get the default printer or class, get the default
server name, get the local username, and get a password string.
<H3><A NAME=3_4_2>3.4.2 HTTP Functions</A></H3>
The HTTP functions provide functions to connect to HTTP servers, issue
requests, read data from a server, and write data to a server.
@@ -329,16 +311,24 @@ necessary conversions from one file type to another.
The hpgltops filter converts HP-GL/2 files into PostScript.
<H3><A NAME=3_5_2>3.5.2 imagetops</A></H3>
The imagetops filter converts image files into PostScript.
<H3><A NAME=3_5_3>3.5.3 pstops</A></H3>
<H3><A NAME=3_5_3>3.5.3 imagetoraster</A></H3>
The imagetoraster filter converts image files into CUPS raster data.
<H3><A NAME=3_5_4>3.5.4 pstops</A></H3>
The pstops filter inserts printer-specific commands from PPD files and
performs page filtering as requested by the user.
<H3><A NAME=3_5_4>3.5.4 texttops</A></H3>
<H3><A NAME=3_5_5>3.5.5 pstoraster</A></H3>
The pstoraster filter converts PostScript program data into CUPS
raster data.
<H3><A NAME=3_5_6>3.5.6 rastertohp</A></H3>
The rastertohp filter handles converting CUPS raster data to HP PCL
and supports both color and black-and-white printers.
<H3><A NAME=3_5_7>3.5.7 texttops</A></H3>
The texttops filter converts text files into PostScript.
<H2><A NAME=3_6>3.6 Scheduler</A></H2>
The scheduler is a fully-functional HTTP/1.1 server that manages the
printers, classes, and jobs in the system. It also handles a simple
broadcast-based directory service so that remote print queues and
classes can be accessed transparently from the local system.
The scheduler is a fully-functional HTTP/1.1 and IPP/1.0 server that
manages the printers, classes, and jobs in the system. It also handles
a simple broadcast-based directory service so that remote print queues
and classes can be accessed transparently from the local system.
<H3><A NAME=3_6_1>3.6.1 Authorization</A></H3>
The authorization module is responsible for performing access control
and authentication for all HTTP and IPP requests entering the system.
@@ -372,24 +362,28 @@ multiple addresses and ports as needed. </P>
<H3><A NAME=3_6_6>3.6.6 IPP</A></H3>
The IPP module handles IPP requests and acts accordingly. URI
validation is also performed here, as a client can post IPP data to any
URI on the server (which might sidestep the access control or
authentication of the HTTP server.)
URI on the server which might sidestep the access control or
authentication of the HTTP server.
<H3><A NAME=3_6_7>3.6.7 Jobs</A></H3>
The jobs module manages print jobs, starts filter and backend
processes for jobs to be printed, and monitors status messages from
those filters and backends.
<H3><A NAME=3_6_8>3.6.8 Main</A></H3>
<H3><A NAME=3_6_8>3.6.8 Logging</A></H3>
The logging module manages the access, error, and page log files that
are generated by the scheduler.
<H3><A NAME=3_6_9>3.6.9 Main</A></H3>
The main module is responsible for timing out and dispatching input
and output for client connections. It also watches for incoming <CODE>
SIGHUP</CODE> signals and reloads the server configuration files as
needed.
<H3><A NAME=3_6_9>3.6.9 Printers</A></H3>
SIGHUP</CODE> and <CODE>SIGCHLD</CODE> signals, reloads the server
configuration files as needed, and handles child process errors and
exits.
<H3><A NAME=3_6_10>3.6.10 Printers</A></H3>
The printers module is responsible for managing printers and PPD files
in the system. The printers module also reads and writes the printers
configuration file.
<H2><A NAME=3_7>3.7 System V Commands</A></H2>
The System V commands provide a robust command-line interface to CUPS
to submit and control print jobs.
to submit and control printers and jobs.
<H3><A NAME=3_7_1>3.7.1 accept</A></H3>
The accept command tells the scheduler to accept new jobs for specific
printers.
@@ -411,17 +405,17 @@ separate job ID for each file that is printed. Also, the Solaris &quot;f&quot;,
The lpadmin command manages printer queues and classes. The Solaris
&quot;A&quot;, &quot;F&quot;, &quot;I&quot;, &quot;M&quot;, &quot;P&quot;, &quot;Q&quot;, &quot;S&quot;, &quot;T&quot;, &quot;U&quot;, &quot;W&quot;, &quot;f&quot;, &quot;l&quot;, &quot;m&quot;, &quot;o&quot;,
&quot;s&quot;, &quot;t&quot;, and &quot;u&quot; options are not supported, and new options &quot;P&quot; (PPD
file) and &quot;F&quot; (filter) are provided to configure CUPS-specific features
such as PPD file and conversion filters.
file), &quot;F&quot; (filter), and &quot;E&quot; (enable and accept) are provided to
configure CUPS-specific features such as PPD file and conversion
filters.
<H3><A NAME=3_7_7>3.7.7 lpstat</A></H3>
The lpstat command lists printers, classes, and jobs as requested by
the user.
<H3><A NAME=3_7_8>3.7.8 reject</A></H3>
The reject command tells the scheduler not to accept new jobs for
specific printers.
<H1><A NAME=4>4 Detailed Design</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 TYPE=A VALUE=1><A NAME=4>A Glossary</A></H1>
<H2><A NAME=4_1>A.1 Terms</A></H2>
<DL>
<DT>C </DT>
<DD>A computer language. </DD>
@@ -434,7 +428,7 @@ specific printers.
<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=4_2>A.2 Acronyms</A></H2>
<DL>
<DT>ASCII </DT>
<DD>American Standard Code for Information Interchange </DD>
+793 -783
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+42 -52
Ver Arquivo
@@ -3,7 +3,7 @@
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SDD-1.0">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>DRAFT - CUPS Software Design Description</TITLE>
<TITLE>CUPS Software Design Description</TITLE>
</HEAD>
<BODY>
@@ -48,8 +48,6 @@ following sections:
<LI>3 - Design Overview
<LI>4 - Detailed Design
<LI>A - Glossary
</UL>
@@ -79,10 +77,10 @@ The following non-CUPS documents are referenced by this document:
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft)
<LI>IPP/1.0: Additional Optional Operations - Set 1
<LI>IPP/1.0: Encoding and Transport
<LI>IPP/1.0: Implementers Guide
<LI>IPP/1.0: Model and Semantics
<LI>RFC 1179, Line Printer Daemon Protocol
<LI>RFC 2565, IPP/1.0: Encoding and Transport
<LI>RFC 2566, IPP/1.0: Model and Semantics
<LI>RFC 2639, IPP/1.0: Implementers Guide
</UL>
<H1>Design Overview</H1>
@@ -185,18 +183,6 @@ The options can be any combination of the following:
</UL>
<H3>smb</H3>
The smb backend sends the specified job to a network host using the Server
Message Block protocol, which is used by most machines running Microsoft&reg;
Windows&reg;. The URI is of the form:
<UL><PRE>smb://hostname/queue
</PRE></UL>
Usernames and passwords required to access the printer are stored in an
external file.
<H3>socket</H3>
The socket backend sends the specified job to a network host using the
@@ -212,9 +198,7 @@ The default port number is 9100.
The Berkeley commands provide a simple command-line interface to CUPS
to submit and control print jobs. It is provided for compatibility with
existing software that is hard coded to use the Berkeley commands,
however since printer options cannot be specified using the Berkeley
commands their use it not encouraged.
existing software that is hard coded to use the Berkeley commands.
<H3>lpc</H3>
@@ -224,28 +208,16 @@ commands:
<UL>
<LI>abort - Stops a printer or all printers and any active print jobs.
<LI>disable - Prevents new jobs from being submitted to the specified
printer or all printers.
<LI>down - Stops a printer or all printers after completing the current
print jobs.
<LI>enable - Allows new jobs to be submitted.
<LI>start - Starts a printer or all printers.
<LI>quit - Quits the lpc command.
<LI>status - Shows the status of printers and jobs in the queue.
<LI>up - Starts a printer or all printers.
</UL>
<H3>lpr</H3>
The lpr command submits a job for printing. The CUPS version of lpr silently
ignores the "i", "p", "t", "m", "h", and "s" options.
ignores the "i", "t", "m", "h", and "s" options.
<H3>lprm</H3>
@@ -256,19 +228,19 @@ The lprm removes one or more print jobs.
The Common Gateway Interface (CGI) programs provide a web-based status interface
to monitor the status of printers, classes, and jobs.
<H3>classes</H3>
<H3>classes.cgi</H3>
The classes CGI lists the available printer classes and any pending jobs for
the class. The user can click on individual classes to limit the display and
click on jobs to see the job status.
<H3>jobs</H3>
<H3>jobs.cgi</H3>
The jobs CGI lists the queued print jobs in order of priority. The list can
be limited by printer or job. When the user displays the status of an
individual print job all job options are displayed.
<H3>printers</H3>
<H3>printers.cgi</H3>
The printers CGI lists the available printer queues and any pending jobs for
the printer. The user can click on individual printers to limit the display and
@@ -282,8 +254,9 @@ language, MIME, PPD, and raster functions used by the CUPS software.
<H3>Convenience Functions</H3>
Convenience functions are provided to submit an IPP request, send a print file,
cancel a job, get a list of available printers, and get a list of available
classes.
cancel a job, get a list of available printers, get a list of available
classes, get the default printer or class, get the default server name, get
the local username, and get a password string.
<H3>HTTP Functions</H3>
@@ -354,21 +327,34 @@ The hpgltops filter converts HP-GL/2 files into PostScript.
The imagetops filter converts image files into PostScript.
<H3>imagetoraster</H3>
The imagetoraster filter converts image files into CUPS raster data.
<H3>pstops</H3>
The pstops filter inserts printer-specific commands from PPD files and
performs page filtering as requested by the user.
<H3>pstoraster</H3>
The pstoraster filter converts PostScript program data into CUPS raster data.
<H3>rastertohp</H3>
The rastertohp filter handles converting CUPS raster data to HP PCL and
supports both color and black-and-white printers.
<H3>texttops</H3>
The texttops filter converts text files into PostScript.
<H2>Scheduler</H2>
The scheduler is a fully-functional HTTP/1.1 server that manages the printers,
classes, and jobs in the system. It also handles a simple broadcast-based
directory service so that remote print queues and classes can be accessed
transparently from the local system.
The scheduler is a fully-functional HTTP/1.1 and IPP/1.0 server that
manages the printers, classes, and jobs in the system. It also handles
a simple broadcast-based directory service so that remote print queues
and classes can be accessed transparently from the local system.
<H3>Authorization</H3>
@@ -413,8 +399,8 @@ ports as needed.
The IPP module handles IPP requests and acts accordingly. URI
validation is also performed here, as a client can post IPP data to any
URI on the server (which might sidestep the access control or
authentication of the HTTP server.)
URI on the server which might sidestep the access control or
authentication of the HTTP server.
<H3>Jobs</H3>
@@ -422,11 +408,17 @@ The jobs module manages print jobs, starts filter and backend processes
for jobs to be printed, and monitors status messages from those filters
and backends.
<H3>Logging</H3>
The logging module manages the access, error, and page log files that are
generated by the scheduler.
<H3>Main</H3>
The main module is responsible for timing out and dispatching input and output
for client connections. It also watches for incoming <CODE>SIGHUP</CODE>
signals and reloads the server configuration files as needed.
and <CODE>SIGCHLD</CODE> signals, reloads the server configuration files as
needed, and handles child process errors and exits.
<H3>Printers</H3>
@@ -437,7 +429,7 @@ configuration file.
<H2>System V Commands</H2>
The System V commands provide a robust command-line interface to CUPS
to submit and control print jobs.
to submit and control printers and jobs.
<H3>accept</H3>
@@ -471,8 +463,8 @@ and "y" options are silently ignored.
The lpadmin command manages printer queues and classes. The Solaris
"A", "F", "I", "M", "P", "Q", "S", "T", "U", "W", "f", "l", "m", "o",
"s", "t", and "u" options are not supported, and new options "P" (PPD
file) and "F" (filter) are provided to configure CUPS-specific features
such as PPD file and conversion filters.
file), "F" (filter), and "E" (enable and accept) are provided to configure
CUPS-specific features such as PPD file and conversion filters.
<H3>lpstat</H3>
@@ -484,8 +476,6 @@ user.
The reject command tells the scheduler not to accept new jobs for specific
printers.
<H1>Detailed Design</H1>
<H1 TYPE=A VALUE=1>Glossary</H1>
<H2>Terms</H2>
+24 -9
Ver Arquivo
@@ -91,10 +91,10 @@ sections:</P>
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft) </LI>
<LI>IPP/1.0: Additional Optional Operations - Set 1 </LI>
<LI>IPP/1.0: Encoding and Transport </LI>
<LI>IPP/1.0: Implementers Guide </LI>
<LI>IPP/1.0: Model and Semantics </LI>
<LI>RFC 1179, Line Printer Daemon Protocol </LI>
<LI>RFC 2565, IPP/1.0: Encoding and Transport </LI>
<LI>RFC 2566, IPP/1.0: Model and Semantics </LI>
<LI>RFC 2639, IPP/1.0: Implementers Guide </LI>
</UL>
<H1><A NAME=3>3 Local Access Risks</A></H1>
<P>Local access risks are those that can be exploited only with a local
@@ -102,17 +102,32 @@ user account. This section does not address issues related to
dissemination of the root password or other security issues associated
with the UNIX operating system. </P>
<H2><A NAME=3_1>3.1 Security Breaches</A></H2>
<P>Since the default installation creates a world-readable request
directory, it is possible for local users to read the contents of print
files before they are printed. </P>
<P>This problem can be alleviated by making the request directory
readable only by the user specified in the CUPS configuration file. </P>
<P>There are two known security vulnerabilities with local access: </P>
<OL>
<LI>Since the default installation creates a world-readable request
directory, it is possible for local users to read the contents of
print files before they are printed.
<P>This problem can be alleviated by making the request directory
readable only by the user specified in the CUPS configuration file. </P>
</LI>
<LI>Device URIs are passed to backend filters in argv[0] and in an
environment variable. Since device URIs can contain usernames and
passwords it may be possible for a local user to gain access to a
remote resource.
<P>We recommend that any password-protected accounts used for remote
printing have limited access priviledges so that the possible damages
can be minimized. </P>
<P>The device URI is &quot;sanitized&quot; (the username and password are
removed) when sent to an IPP client so that a remote user cannot
exploit this vulnerability. </P>
</LI>
</OL>
<H1><A NAME=4>4 Remote Access Risks</A></H1>
<P>Remote access risks are those that can be exploited without a local
user account and/or from a remote system. This section does not address
issues related to network or firewall security. </P>
<H2><A NAME=4_1>4.1 Denial of Service Attacks</A></H2>
<P>Like all internet services, the CUPS server is vulnerable to denial
<P>Like all Internet services, the CUPS server is vulnerable to denial
of service attacks, including: </P>
<OL>
<LI>Establishing multiple connections to the server until the server
+59 -67
Ver Arquivo
@@ -1,6 +1,6 @@
%PDF-1.2
%âãÏÓ
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19990709142834Z)/Title(DRAFT - CUPS Software Security Report)/Author(Easy Software Products)>>endobj
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19990922200511Z)/Title(DRAFT - CUPS Software Security Report)/Author(Easy Software Products)>>endobj
2 0 obj<</Type/Encoding/BaseEncoding/WinAnsiEncoding>>endobj
3 0 obj<</Type/Font/Subtype/Type1/BaseFont/Courier/Encoding 2 0 R>>endobj
4 0 obj<</Type/Font/Subtype/Type1/BaseFont/Times-Roman/Encoding 2 0 R>>endobj
@@ -194,13 +194,10 @@ endobj
xÚ+ä2T0BCc3JÎår
ár
á
äHendstream
endobj
78 0 obj
31
äHendstream
endobj
78 0 obj
80 0 obj<</Length 81 0 R/Filter/FlateDecode>>stream
31
endobj
79 0 obj<</Type/Page/Parent 72 0 R/Contents 80 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F4 4 0 R/F8 7 0 R/F9 8 0 R/Fc 9 0 R>>>>>>endobj
80 0 obj<</Length 81 0 R/Filter/FlateDecode>>stream
@@ -213,13 +210,12 @@ endobj
endobj
82 0 obj<</Type/Page/Parent 72 0 R/Contents 83 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F8 7 0 R>>>>>>endobj
83 0 obj<</Length 84 0 R/Filter/FlateDecode>>stream
ÁÉù© Q×®@.ü7 £endstream
endobj
84 0 obj
118
xÚ+ä2T0BCc3JÎår
áÒw³P04TIS041T072PIÑp rt QÐUp
VÎO+)O,JUNM.-Ê,©TJ-È/*Ñ ÉâÒiÒ…ê2‰˜˜˜é™)€ù†
ÁÉù© Q×®@.ü7 £endstream
endobj
86 0 obj<</Length 87 0 R/Filter/FlateDecode>>stream
84 0 obj
118
endobj
85 0 obj<</Type/Page/Parent 72 0 R/Contents 86 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F4 4 0 R/F8 7 0 R/F9 8 0 R/Fc 9 0 R>>>>>>endobj
@@ -232,17 +228,13 @@ endobj
536
endobj
88 0 obj<</Type/Page/Parent 72 0 R/Contents 89 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F8 7 0 R>>>>>>endobj
88 0 obj<</Type/Page/Parent 72 0 R/Contents 89 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F8 7 0 R>>>>>>endobj
89 0 obj<</Length 90 0 R/Filter/FlateDecode>>stream
xÚ-‹Í1…÷÷)Î’E™[Ͱ5˜5Óë¤n3TE¼½©È9›óó=ˆQb,êâp£FhÞ®À ‰`ÇXÚ
ržl»u+0Ø÷~ˆù}J
¯á•.ùƒNïCÊS¹’)ùS®4Îò¬Æ/Ûñ5iôY¦Ð¾­u"§endstream
endobj
90 0 obj
121
89 0 obj<</Length 90 0 R/Filter/FlateDecode>>stream
xÚ-‹Í1…÷÷)Î’E™[Ͱ5˜5Óë¤n3TE¼½©È9›óó=ˆQb,êâp£FhÞ®À ‰`ÇXÚ
ržl»u+0Ø÷~ˆù}J
¯á•.ùƒNïCÊS¹’)ùS®4Îò¬Æ/Ûñ5iôY¦Ð¾­u"§endstream
endobj
90 0 obj
92 0 obj<</Length 93 0 R/Filter/FlateDecode>>stream
121
endobj
91 0 obj<</Type/Page/Parent 72 0 R/Contents 92 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F4 4 0 R/F8 7 0 R/F9 8 0 R>>>>>>endobj
92 0 obj<</Length 93 0 R/Filter/FlateDecode>>stream
@@ -393,54 +385,54 @@ xref
0000003913 00000 n
0000004017 00000 n
0000004121 00000 n
0000004121 00000 n
0000004225 00000 n
0000004329 00000 n
0000004433 00000 n
0000004537 00000 n
0000004641 00000 n
0000004744 00000 n
0000004848 00000 n
0000004953 00000 n
0000005058 00000 n
0000005163 00000 n
0000005268 00000 n
0000005586 00000 n
0000005618 00000 n
0000005650 00000 n
0000005849 00000 n
0000005896 00000 n
0000005943 00000 n
0000005990 00000 n
0000006037 00000 n
0000006084 00000 n
0000006131 00000 n
0000006178 00000 n
0000006225 00000 n
0000006272 00000 n
0000006319 00000 n
0000006366 00000 n
0000006413 00000 n
0000006461 00000 n
0000006509 00000 n
0000006557 00000 n
0000006728 00000 n
0000006877 00000 n
0000013254 00000 n
0000013275 00000 n
0000013385 00000 n
0000013485 00000 n
0000013504 00000 n
0000013641 00000 n
0000014534 00000 n
0000014554 00000 n
0000014664 00000 n
0000014851 00000 n
0000014871 00000 n
0000015008 00000 n
0000015599 00000 n
0000004225 00000 n
0000004329 00000 n
0000004433 00000 n
0000004537 00000 n
0000004641 00000 n
0000004744 00000 n
0000004848 00000 n
0000004953 00000 n
0000005058 00000 n
0000005163 00000 n
0000005268 00000 n
0000005586 00000 n
0000005618 00000 n
0000005650 00000 n
0000005849 00000 n
0000005896 00000 n
0000005943 00000 n
0000005990 00000 n
0000006037 00000 n
0000006084 00000 n
0000006131 00000 n
0000006178 00000 n
0000006225 00000 n
0000006272 00000 n
0000006319 00000 n
0000006366 00000 n
0000006413 00000 n
0000006461 00000 n
0000006509 00000 n
0000006557 00000 n
0000006728 00000 n
0000006877 00000 n
0000013254 00000 n
0000013275 00000 n
0000013385 00000 n
0000013485 00000 n
0000013504 00000 n
0000013641 00000 n
0000014534 00000 n
0000014554 00000 n
0000014664 00000 n
0000014851 00000 n
0000014871 00000 n
0000015008 00000 n
0000015613 00000 n
0000015633 00000 n
0000015743 00000 n
0000015933 00000 n
0000015953 00000 n
0000015939 00000 n
0000016081 00000 n
0000016910 00000 n
+29 -9
Ver Arquivo
@@ -71,10 +71,10 @@ The following non-CUPS documents are referenced by this document:
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft)
<LI>IPP/1.0: Additional Optional Operations - Set 1
<LI>IPP/1.0: Encoding and Transport
<LI>IPP/1.0: Implementers Guide
<LI>IPP/1.0: Model and Semantics
<LI>RFC 1179, Line Printer Daemon Protocol
<LI>RFC 2565, IPP/1.0: Encoding and Transport
<LI>RFC 2566, IPP/1.0: Model and Semantics
<LI>RFC 2639, IPP/1.0: Implementers Guide
</UL>
<H1>Local Access Risks</H1>
@@ -86,12 +86,32 @@ system.
<H2>Security Breaches</H2>
<P>Since the default installation creates a world-readable request directory,
it is possible for local users to read the contents of print files before they
are printed.
<P>There are two known security vulnerabilities with local access:
<P>This problem can be alleviated by making the request directory readable only
by the user specified in the CUPS configuration file.
<OL>
<LI>Since the default installation creates a world-readable
request directory, it is possible for local users to read the
contents of print files before they are printed.
<P>This problem can be alleviated by making the request
directory readable only by the user specified in the CUPS
configuration file.
<LI>Device URIs are passed to backend filters in argv[0] and in
an environment variable. Since device URIs can contain
usernames and passwords it may be possible for a local user to
gain access to a remote resource.
<P>We recommend that any password-protected accounts used for
remote printing have limited access priviledges so that the
possible damages can be minimized.
<P>The device URI is "sanitized" (the username and password are
removed) when sent to an IPP client so that a remote user
cannot exploit this vulnerability.
</OL>
<H1>Remote Access Risks</H1>
@@ -101,7 +121,7 @@ related to network or firewall security.
<H2>Denial of Service Attacks</H2>
<P>Like all internet services, the CUPS server is vulnerable to denial of
<P>Like all Internet services, the CUPS server is vulnerable to denial of
service attacks, including:
<OL>
BIN
Ver Arquivo
Arquivo binário não exibido.
+31 -16
Ver Arquivo
@@ -1,14 +1,14 @@
<HTML>
<HEAD>
<TITLE>DRAFT - CUPS Software Users Manual</TITLE>
<TITLE>CUPS Software Users Manual</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.0.0b1">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.0.2">
</HEAD>
<BODY>
<CENTER><A HREF=#contents><IMG SRC="images/cups-large.gif" BORDER=0><BR>
<H1>DRAFT - CUPS Software Users Manual</H1></A><BR>
CUPS-SUM-1.0.0b1<BR>
<H1>CUPS Software Users Manual</H1></A><BR>
CUPS-SUM-1.0.2<BR>
Easy Software Products<BR>
Copyright 1997-1999, All Rights Reserved<BR>
</CENTER>
@@ -48,8 +48,9 @@ Copyright 1997-1999, All Rights Reserved<BR>
<LI><A HREF=#4_1_2>Setting the Orientation</A></LI>
<LI><A HREF=#4_1_3>Printing On Both Sides of the Paper</A></LI>
<LI><A HREF=#4_1_4>Selecting a Range of Pages</A></LI>
<LI><A HREF=#4_1_5>Setting the Brightness</A></LI>
<LI><A HREF=#4_1_6>Setting the Gamma Correction</A></LI>
<LI><A HREF=#4_1_5>N-Up Printing</A></LI>
<LI><A HREF=#4_1_6>Setting the Brightness</A></LI>
<LI><A HREF=#4_1_7>Setting the Gamma Correction</A></LI>
</UL>
<LI><A HREF=#4_2>Text Options</A></LI>
<UL>
@@ -69,7 +70,7 @@ Copyright 1997-1999, All Rights Reserved<BR>
<HR>
<H1 ALIGN=RIGHT><A NAME=1>Preface</A></H1>
This software users manual describes how to use the Common UNIX
Printing System (&quot;CUPS&quot;) Version 1.0.0.
Printing System (&quot;CUPS&quot;) Version 1.0.2.
<H2><A NAME=1_1>System Overview</A></H2>
The Common UNIX Printing System provides a portable printing layer for
UNIX&reg; operating systems. It has been developed by Easy Software
@@ -354,14 +355,15 @@ in landscape orientation: </P>
</PRE>
</UL>
<H3><A NAME=4_1_3>Printing On Both Sides of the Paper</A></H3>
<P>The &quot;-o sides=two-sided-short&quot; and &quot;-o sides=two-sided-long&quot; options
will enable duplexing on the printer (if the printer supports it.) The
&quot;two-sided-short&quot; option is suitable for landscape pages, while the
&quot;two-sided-long&quot; option is suitable for portrait pages: </P>
<P>The &quot;-o sides=two-sided-short-edge&quot; and &quot;-o
sides=two-sided-long-edge&quot; options will enable duplexing on the printer
(if the printer supports it.) The &quot;two-sided-short&quot; option is suitable
for landscape pages, while the &quot;two-sided-long&quot; option is suitable for
portrait pages: </P>
<UL>
<PRE>
% lp -o sides=two-sided-short filename ENTER
% lp -o sides=two-sided-long filename ENTER
% lp -o sides=two-sided-short-edge filename ENTER
% lp -o sides=two-sided-long-edge filename ENTER
</PRE>
</UL>
<H3><A NAME=4_1_4>Selecting a Range of Pages</A></H3>
@@ -385,7 +387,19 @@ of the order of the pages in the &quot;page-range&quot; option. </P>
% lp -o page-set=even filename ENTER
</PRE>
</UL>
<H3><A NAME=4_1_5>Setting the Brightness</A></H3>
<H3><A NAME=4_1_5>N-Up Printing</A></H3>
<P>The &quot;-o number-up=value&quot; option selects N-Up printing. N-Up
printing places multiple document pages on a single printed page. CUPS
supports 1-Up, 2-Up, and 4-Up formats: </P>
<UL>
<PRE>
% lp -o number-up=1 filename ENTER
% lp -o number-up=2 filename ENTER
% lp -o number-up=4 filename ENTER
</PRE>
</UL>
<P>The default format is 1-Up. </P>
<H3><A NAME=4_1_6>Setting the Brightness</A></H3>
<P>You can control the overall brightness of the printed output using
the &quot;-o brightness=percent&quot; option: </P>
<UL>
@@ -395,7 +409,7 @@ the &quot;-o brightness=percent&quot; option: </P>
</UL>
<P>Values greater than 100 will lighten the print, while values less
than 100 will darken it. </P>
<H3><A NAME=4_1_6>Setting the Gamma Correction</A></H3>
<H3><A NAME=4_1_7>Setting the Gamma Correction</A></H3>
<P>You can control the overall gamma correction of the printed output
using the &quot;-o gamma=value&quot; option: </P>
<UL>
@@ -404,7 +418,8 @@ using the &quot;-o gamma=value&quot; option: </P>
</PRE>
</UL>
<P>Values greater than 1000 will lighten the print, while values less
than 1000 will darken it. </P>
than 1000 will darken it. The default gamma is 2200 which matches the
sRGB specification. </P>
<H2><A NAME=4_2>Text Options</A></H2>
<P>The following options apply when printing text files. </P>
<H3><A NAME=4_2_1>Setting the Number of Characters Per Inch</A></H3>
+687 -697
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+26 -10
Ver Arquivo
@@ -2,16 +2,16 @@
<HEAD>
<META NAME="Description" CONTENT="Common UNIX Printing System Software Users Manual">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.0.0b1">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.0.2">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>DRAFT - CUPS Software Users Manual</TITLE>
<TITLE>CUPS Software Users Manual</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=RIGHT>Preface</H1>
This software users manual describes how to use the Common UNIX Printing
System ("CUPS") Version 1.0.0.
System ("CUPS") Version 1.0.2.
<H2>System Overview</H2>
@@ -359,14 +359,15 @@ landscape orientation:
<H3>Printing On Both Sides of the Paper</H3>
<P>The "-o sides=two-sided-short" and "-o sides=two-sided-long" options will
enable duplexing on the printer (if the printer supports it.) The "two-sided-short"
option is suitable for landscape pages, while the "two-sided-long" option is
suitable for portrait pages:
<P>The "-o sides=two-sided-short-edge" and "-o
sides=two-sided-long-edge" options will enable duplexing on the
printer (if the printer supports it.) The "two-sided-short"
option is suitable for landscape pages, while the
"two-sided-long" option is suitable for portrait pages:
<UL><PRE>
% lp -o sides=two-sided-short filename ENTER
% lp -o sides=two-sided-long filename ENTER
% lp -o sides=two-sided-short-edge filename ENTER
% lp -o sides=two-sided-long-edge filename ENTER
</PRE></UL>
<H3>Selecting a Range of Pages</H3>
@@ -391,6 +392,20 @@ the pages in the "page-range" option.
% lp -o page-set=even filename ENTER
</PRE></UL>
<H3>N-Up Printing</H3>
<P>The "-o number-up=value" option selects N-Up printing. N-Up
printing places multiple document pages on a single printed
page. CUPS supports 1-Up, 2-Up, and 4-Up formats:
<UL><PRE>
% lp -o number-up=1 filename ENTER
% lp -o number-up=2 filename ENTER
% lp -o number-up=4 filename ENTER
</PRE></UL>
<P>The default format is 1-Up.
<H3>Setting the Brightness</H3>
<P>You can control the overall brightness of the printed output using the
@@ -413,7 +428,8 @@ using the "-o gamma=value" option:
</PRE></UL>
<P>Values greater than 1000 will lighten the print, while values less
than 1000 will darken it.
than 1000 will darken it. The default gamma is 2200 which matches the
sRGB specification.
<H2>Text Options</H2>
-149
Ver Arquivo
@@ -1,149 +0,0 @@
<HTML>
<HEAD>
<TITLE>CUPS Software Version Description</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SVD-1.0.0">
</HEAD>
<BODY>
<CENTER><A HREF=#contents><IMG SRC="images/cups-large.gif" BORDER=0><BR>
<H1>CUPS Software Version Description</H1></A><BR>
CUPS-SVD-1.0.0<BR>
Easy Software Products<BR>
Copyright 1997-1999, All Rights Reserved<BR>
</CENTER>
<HR>
<H1 ALIGN=CENTER><A NAME=CONTENTS>Table of Contents</A></H1>
<BR>
<BR><B><A HREF=#1>1 Scope</A></B>
<UL>
<LI><A HREF=#1_1>1.1 Identification</A></LI>
<LI><A HREF=#1_2>1.2 System Overview</A></LI>
<LI><A HREF=#1_3>1.3 Document Overview</A></LI>
</UL>
<B><A HREF=#2>2 References</A></B>
<UL>
<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 Additions</A></B>
<BR>
<BR><B><A HREF=#4>4 Changes</A></B>
<BR>
<BR><B><A HREF=#5>A Glossary</A></B>
<UL>
<LI><A HREF=#5_1>A.1 Terms</A></LI>
<LI><A HREF=#5_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>
This software version description document provides release
information for the Common UNIX Printing System (&quot;CUPS&quot;) Version 1.0.
<H2><A NAME=1_2>1.2 System Overview</A></H2>
The Common UNIX Printing System provides a portable printing layer for
UNIX&reg; operating systems. It has been developed by Easy Software
Products to promote a standard printing solution for all UNIX vendors
and users. CUPS provides the System V and Berkeley command-line
interfaces.
<P>CUPS uses the Internet Printing Protocol (IETF-IPP) as the basis for
managing print jobs and queues. The Line Printer Daemon (LPD, RFC1179),
Server Message Block (SMB), and AppSocket protocols are also supported
with reduced functionality. </P>
<P>CUPS adds network printer browsing and PostScript Printer
Description (&quot;PPD&quot;)-based printing options to support real world
applications under UNIX. </P>
<P>CUPS also includes a customized version of GNU GhostScript
(currently based off GNU GhostScript 4.03) and an image file RIP that
can be used to support non-PostScript printers. </P>
<H2><A NAME=1_3>1.3 Document Overview</A></H2>
<P>This Something Something Something document is organized into the
following sections:</P>
<UL>
<LI>1 - Scope</LI>
<LI>2 - References</LI>
<LI>3 - Additions</LI>
<LI>4 - Changes</LI>
<LI>A - Glossary</LI>
</UL>
<H1><A NAME=2>2 References</A></H1>
<H2><A NAME=2_1>2.1 CUPS Documentation</A></H2>
The following CUPS documentation is referenced by this document:
<UL>
<LI>CUPS-CMP-1.0: CUPS Configuration Management Plan </LI>
<LI>CUPS-IDD-1.0: CUPS System Interface Design Description </LI>
<LI>CUPS-SAM-1.0.x: CUPS Software Administrators Manual </LI>
<LI>CUPS-SDD-1.0: CUPS Software Design Description </LI>
<LI>CUPS-SPM-1.0: CUPS Software Programming Manual </LI>
<LI>CUPS-SSR-1.0: CUPS Software Security Report </LI>
<LI>CUPS-STP-1.0: CUPS Software Test Plan </LI>
<LI>CUPS-SUM-1.0.x: CUPS Software Users Manual </LI>
<LI>CUPS-SVD-1.0.x: CUPS Software Version Description </LI>
</UL>
<H2><A NAME=2_2>2.2 Other Documents</A></H2>
The following non-CUPS documents are referenced by this document:
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft) </LI>
<LI>IPP/1.0: Additional Optional Operations - Set 1 </LI>
<LI>IPP/1.0: Encoding and Transport </LI>
<LI>IPP/1.0: Implementers Guide </LI>
<LI>IPP/1.0: Model and Semantics </LI>
<LI>RFC 1179, Line Printer Daemon Protocol </LI>
</UL>
<H1><A NAME=3>3 Additions</A></H1>
Since this is the first release of CUPS, there are no additions to
report.
<H1><A NAME=4>4 Changes</A></H1>
Since this is the first release of CUPS, there are no changes to
report.
<H1 TYPE=A VALUE=1><A NAME=5>A Glossary</A></H1>
<H2><A NAME=5_1>A.1 Terms</A></H2>
<DL>
<DT>C </DT>
<DD>A computer language. </DD>
<DT>parallel </DT>
<DD>Sending or receiving data more than 1 bit at a time. </DD>
<DT>pipe </DT>
<DD>A one-way communications channel between two programs. </DD>
<DT>serial </DT>
<DD>Sending or receiving data 1 bit at a time. </DD>
<DT>socket </DT>
<DD>A two-way network communications channel. </DD>
</DL>
<H2><A NAME=5_2>A.2 Acronyms</A></H2>
<DL>
<DT>ASCII </DT>
<DD>American Standard Code for Information Interchange </DD>
<DT>CUPS </DT>
<DD>Common UNIX Printing System </DD>
<DT>ESC/P </DT>
<DD>EPSON Standard Code for Printers </DD>
<DT>FTP </DT>
<DD>File Transfer Protocol </DD>
<DT>HP-GL </DT>
<DD>Hewlett-Packard Graphics Language </DD>
<DT>HP-PCL </DT>
<DD>Hewlett-Packard Printer Control Language </DD>
<DT>HP-PJL </DT>
<DD>Hewlett-Packard Printer Job Language </DD>
<DT>IETF </DT>
<DD>Internet Engineering Task Force </DD>
<DT>IPP </DT>
<DD>Internet Printing Protocol </DD>
<DT>ISO </DT>
<DD>International Standards Organization </DD>
<DT>LPD </DT>
<DD>Line Printer Daemon </DD>
<DT>MIME </DT>
<DD>Multimedia Internet Mail Exchange </DD>
<DT>PCL </DT>
<DD>Page Control Language </DD>
<DT>PPD </DT>
<DD>PostScript Printer Description </DD>
<DT>SMB </DT>
<DD>Server Message Block </DD>
<DT>TFTP </DT>
<DD>Trivial File Transfer Protocol </DD>
</DL>
</BODY>
</HTML>
BIN
Ver Arquivo
Arquivo binário não exibido.
-167
Ver Arquivo
@@ -1,167 +0,0 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SVD-1.0.0">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Version Description</TITLE>
</HEAD>
<BODY>
<H1>Scope</H1>
<H2>Identification</H2>
This software version description document provides release information for the
Common UNIX Printing System ("CUPS") Version 1.0.
<H2>System Overview</H2>
The Common UNIX Printing System provides a portable printing layer for
UNIX&reg; operating systems. It has been developed by Easy Software
Products to promote a standard printing solution for all UNIX vendors
and users. CUPS provides the System V and Berkeley command-line interfaces.
<P>CUPS uses the Internet Printing Protocol (IETF-IPP) as the basis
for managing print jobs and queues. The Line Printer Daemon (LPD,
RFC1179), Server Message Block (SMB), and AppSocket protocols are also
supported with reduced functionality.
<P>CUPS adds network printer browsing and PostScript Printer
Description (&quot;PPD&quot;)-based printing options to support real
world applications under UNIX.
<P>CUPS also includes a customized version of GNU GhostScript
(currently based off GNU GhostScript 4.03) and an image file RIP that
can be used to support non-PostScript printers.
<H2>Document Overview</H2>
<P>This Something Something Something document is organized into the following
sections:</P>
<UL>
<LI>1 - Scope</LI>
<LI>2 - References</LI>
<LI>3 - Additions</LI>
<LI>4 - Changes</LI>
<LI>A - Glossary</LI>
</UL>
<H1>References</H1>
<H2>CUPS Documentation</H2>
The following CUPS documentation is referenced by this document:
<UL>
<LI>CUPS-CMP-1.0: CUPS Configuration Management Plan
<LI>CUPS-IDD-1.0: CUPS System Interface Design Description
<LI>CUPS-SAM-1.0.x: CUPS Software Administrators Manual
<LI>CUPS-SDD-1.0: CUPS Software Design Description
<LI>CUPS-SPM-1.0: CUPS Software Programming Manual
<LI>CUPS-SSR-1.0: CUPS Software Security Report
<LI>CUPS-STP-1.0: CUPS Software Test Plan
<LI>CUPS-SUM-1.0.x: CUPS Software Users Manual
<LI>CUPS-SVD-1.0.x: CUPS Software Version Description
</UL>
<H2>Other Documents</H2>
The following non-CUPS documents are referenced by this document:
<UL>
<LI>IEEE 1387.4, System Administration: Printing (draft)
<LI>IPP/1.0: Additional Optional Operations - Set 1
<LI>IPP/1.0: Encoding and Transport
<LI>IPP/1.0: Implementers Guide
<LI>IPP/1.0: Model and Semantics
<LI>RFC 1179, Line Printer Daemon Protocol
</UL>
<H1>Additions</H1>
Since this is the first release of CUPS, there are no additions to report.
<H1>Changes</H1>
Since this is the first release of CUPS, there are no changes to report.
<H1 TYPE=A VALUE=1>Glossary</H1>
<H2>Terms</H2>
<DL>
<DT>C
<DD>A computer language.
<DT>parallel
<DD>Sending or receiving data more than 1 bit at a time.
<DT>pipe
<DD>A one-way communications channel between two programs.
<DT>serial
<DD>Sending or receiving data 1 bit at a time.
<DT>socket
<DD>A two-way network communications channel.
</DL>
<H2>Acronyms</H2>
<DL>
<DT>ASCII
<DD>American Standard Code for Information Interchange
<DT>CUPS
<DD>Common UNIX Printing System
<DT>ESC/P
<DD>EPSON Standard Code for Printers
<DT>FTP
<DD>File Transfer Protocol
<DT>HP-GL
<DD>Hewlett-Packard Graphics Language
<DT>HP-PCL
<DD>Hewlett-Packard Printer Control Language
<DT>HP-PJL
<DD>Hewlett-Packard Printer Job Language
<DT>IETF
<DD>Internet Engineering Task Force
<DT>IPP
<DD>Internet Printing Protocol
<DT>ISO
<DD>International Standards Organization
<DT>LPD
<DD>Line Printer Daemon
<DT>MIME
<DD>Multimedia Internet Mail Exchange
<DT>PCL
<DD>Page Control Language
<DT>PPD
<DD>PostScript Printer Description
<DT>SMB
<DD>Server Message Block
<DT>TFTP
<DD>Trivial File Transfer Protocol
</DL>
</BODY>
</HTML>
+4 -4
Ver Arquivo
@@ -57,8 +57,8 @@ install:
$(CP) $(TARGETS) $(SERVERROOT)/filter
-$(MKDIR) $(LIBDIR)
$(CP) $(LIBCUPSIMAGE) $(LIBDIR)
if test $(LIBCUPSIMAGE) != "libcupsimage.a"; then \
$(LN) $(LIBCUPSIMAGE) `basename $(LIBCUPSIMAGE) .1` \
-if test $(LIBCUPSIMAGE) != "libcupsimage.a"; then \
$(LN) $(LIBCUPSIMAGE) `basename $(LIBCUPSIMAGE) .1`; \
fi
#
@@ -76,8 +76,8 @@ $(HPGLOBJS): hpgltops.h
libcupsimage.so.1 libcupsimage.sl.1: $(IMAGEOBJS) ../Makedefs
echo Linking $@...
$(DSO) $@ $(IMAGEOBJS) $(DSOLIBS)
$(LN) $@ `basename $@ .1`
$(DSO) $@ $(IMAGEOBJS) $(DSOLIBS) -lm
-$(LN) $@ `basename $@ .1`
#
# libcupsimage.a
+9 -4
Ver Arquivo
@@ -77,6 +77,9 @@ SetCommonOptions(int num_options, /* I - Number of options */
PageBottom = pagesize->bottom;
PageLeft = pagesize->left;
PageRight = pagesize->right;
fprintf(stderr, "DEBUG: Page = %.0fx%.0f; %.0f,%.0f to %.0f,%.0f\n",
PageWidth, PageLength, PageLeft, PageBottom, PageRight, PageTop);
}
if (ppd != NULL)
@@ -234,11 +237,13 @@ SetCommonOptions(int num_options, /* I - Number of options */
}
if ((val = cupsGetOption("sides", num_options, options)) != NULL &&
strncmp(val, "two-", 4) == 0)
strncasecmp(val, "two-", 4) == 0)
Duplex = 1;
if ((val = cupsGetOption("Duplex", num_options, options)) != NULL &&
strcmp(val, "DuplexNoTumble") == 0)
else if ((val = cupsGetOption("Duplex", num_options, options)) != NULL &&
strncasecmp(val, "Duplex", 6) == 0)
Duplex = 1;
else if (ppdIsMarked(ppd, "Duplex", "DuplexNoTumble") ||
ppdIsMarked(ppd, "Duplex", "DuplexTumble"))
Duplex = 1;
return (ppd);
+75 -32
Ver Arquivo
@@ -131,17 +131,16 @@ LA_line_attributes(int num_params, /* I - Number of parameters */
if (num_params == 0)
{
Outputf("3.0 setmiterlimit\n");
Outputf("0 setlinecap\n");
Outputf("0 setlinejoin\n");
MiterLimit = 3.0f;
LineCap = 0;
LineJoin = 0;
}
else for (i = 0; i < (num_params - 1); i += 2)
switch ((int)params[i].value.number)
{
case 1 :
Outputf("%d setlinecap\n",
params[i + 1].value.number == 1 ? 0 :
params[i + 1].value.number == 4 ? 1 : 2);
LineCap = params[i + 1].value.number == 1 ? 0 :
params[i + 1].value.number == 4 ? 1 : 2;
break;
case 2 :
switch ((int)params[i + 1].value.number)
@@ -149,21 +148,27 @@ LA_line_attributes(int num_params, /* I - Number of parameters */
case 1 :
case 2 :
case 3 :
Outputf("0 setlinejoin\n");
LineJoin = 0;
break;
case 5 :
Outputf("2 setlinejoin\n");
LineJoin = 2;
break;
default :
Outputf("1 setlinejoin\n");
LineJoin = 1;
break;
}
break;
case 3 :
Outputf("%f setmiterlimit\n",
1.0 + 0.5 * (params[i + 1].value.number - 1.0));
MiterLimit = 1.0 + 0.5 * (params[i + 1].value.number - 1.0);
break;
}
if (PageDirty)
{
printf("%.1f setmiterlimit\n", MiterLimit);
printf("%d setlinecap\n", LineCap);
printf("%d setlinejoin\n", LineJoin);
}
}
@@ -197,7 +202,7 @@ NP_number_pens(int num_params, /* I - Number of parameters */
if (num_params == 0)
PenCount = 8;
else if (num_params == 1)
else if (num_params == 1 && params[0].value.number <= 1024)
PenCount = (int)params[0].value.number;
else
fprintf(stderr, "WARNING: HP-GL/2 \'NP\' command with invalid number of parameters (%d)!\n",
@@ -206,7 +211,11 @@ NP_number_pens(int num_params, /* I - Number of parameters */
PC_pen_color(0, NULL);
for (i = 0; i <= PenCount; i ++)
Outputf("/W%d { DefaultPenWidth PenScaling mul setlinewidth } bind def\n", i);
Pens[i].width = PenWidth;
if (PageDirty)
for (i = 0; i <= PenCount; i ++)
printf("/W%d { DefaultPenWidth PenScaling mul setlinewidth } bind def\n", i);
}
@@ -235,26 +244,44 @@ PC_pen_color(int num_params, /* I - Number of parameters */
{
for (i = 0; i <= PenCount; i ++)
if (i < 8)
Outputf("/P%d { %.3f %.3f %.3f setrgbcolor } bind def\n",
i, standard_colors[i][0],
standard_colors[i][1], standard_colors[i][2]);
{
Pens[i].rgb[0] = standard_colors[i][0];
Pens[i].rgb[1] = standard_colors[i][1];
Pens[i].rgb[2] = standard_colors[i][2];
}
else
Outputf("/P%d { 0.0 0.0 0.0 setrgbcolor } bind def\n", i);
{
Pens[i].rgb[0] = 0.0f;
Pens[i].rgb[1] = 0.0f;
Pens[i].rgb[2] = 0.0f;
}
if (PageDirty)
for (i = 0; i <= PenCount; i ++)
Outputf("/P%d { %.3f %.3f %.3f setrgbcolor } bind def\n",
i, Pens[i].rgb[0], Pens[i].rgb[1], Pens[i].rgb[2]);
}
else if (num_params == 1)
else if (num_params == 1 || num_params == 4)
{
i = (int)params[0].value.number;
Outputf("/P%d { %.3f %.3f %.3f setrgbcolor } bind def\n",
i, standard_colors[i & 7][0], standard_colors[i & 7][1],
standard_colors[i & 7][2]);
if (num_params == 1)
{
Pens[i].rgb[0] = standard_colors[i & 7][0];
Pens[i].rgb[1] = standard_colors[i & 7][1];
Pens[i].rgb[2] = standard_colors[i & 7][2];
}
else
{
Pens[i].rgb[0] = params[1].value.number;
Pens[i].rgb[1] = params[2].value.number;
Pens[i].rgb[2] = params[3].value.number;
}
if (PageDirty)
Outputf("/P%d { %.3f %.3f %.3f setrgbcolor } bind def\n",
i, Pens[i].rgb[0], Pens[i].rgb[1], Pens[i].rgb[2]);
}
else if (num_params == 4)
Outputf("/P%d { %.3f %.3f %.3f setrgbcolor } bind def\n",
(int)params[0].value.number,
(params[1].value.number - ColorRange[0][0]) / ColorRange[0][1],
(params[2].value.number - ColorRange[1][0]) / ColorRange[1][1],
(params[3].value.number - ColorRange[2][0]) / ColorRange[2][1]);
else
fprintf(stderr, "WARNING: HP-GL/2 \'PC\' command with invalid number of parameters (%d)!\n",
num_params);
@@ -299,8 +326,18 @@ PW_pen_width(int num_params, /* I - Number of parameters */
}
if (num_params == 2)
Outputf("/W%d { %.1f PenScaling mul setlinewidth } bind def W%d\n",
(int)params[1].value.number, w, (int)params[1].value.number);
{
pen = (int)params[1].value.number;
Pens[pen].width = w;
if (PageDirty)
{
Outputf("/W%d { %.1f PenScaling mul setlinewidth } bind def\n", pen, w);
if (pen == PenNumber)
Outputf("W%d\n", PenNumber);
}
}
else if (num_params < 2)
{
/*
@@ -308,10 +345,16 @@ PW_pen_width(int num_params, /* I - Number of parameters */
*/
for (pen = 0; pen <= PenCount; pen ++)
Outputf("/W%d { %.1f PenScaling mul setlinewidth } bind def\n",
pen, w);
Pens[pen].width = w;
Outputf("W%d\n", PenNumber);
if (PageDirty)
{
for (pen = 0; pen <= PenCount; pen ++)
Outputf("/W%d { %.1f PenScaling mul setlinewidth } bind def\n",
pen, w);
Outputf("W%d\n", PenNumber);
}
}
else
fprintf(stderr, "WARNING: HP-GL/2 \'PW\' command with invalid number of parameters (%d)!\n",
+104 -46
Ver Arquivo
@@ -60,20 +60,16 @@ AD_define_alternate(int num_params, /* I - Number of parameters */
param_t *params) /* I - Parameters */
{
int i; /* Looping var */
int typeface, /* Typeface number */
posture, /* Posture number */
weight; /* Weight number */
float height; /* Height/size of font */
/*
* Set default font attributes...
*/
typeface = 48;
posture = 0;
weight = 0;
height = 11.5;
AlternateFont.typeface = 48;
AlternateFont.posture = 0;
AlternateFont.weight = 0;
AlternateFont.height = 11.5;
/*
* Loop through parameter value pairs...
@@ -83,16 +79,16 @@ AD_define_alternate(int num_params, /* I - Number of parameters */
switch ((int)params[i].value.number)
{
case 4 :
height = params[i + 1].value.number;
AlternateFont.height = params[i + 1].value.number;
break;
case 5 :
posture = (int)params[i + 1].value.number;
AlternateFont.posture = (int)params[i + 1].value.number;
break;
case 6 :
weight = (int)params[i + 1].value.number;
AlternateFont.weight = (int)params[i + 1].value.number;
break;
case 7 :
typeface = (int)params[i + 1].value.number;
AlternateFont.typeface = (int)params[i + 1].value.number;
break;
}
@@ -100,14 +96,22 @@ AD_define_alternate(int num_params, /* I - Number of parameters */
* Define the font...
*/
Outputf("/SA { /%s%s%s%s findfont %.1f scalefont setfont } def\n",
typeface == 48 ? "Courier" : "Helvetica",
(weight != 0 || posture != 0) ? "-" : "",
weight != 0 ? "Bold" : "",
posture != 0 ? "Oblique" : "",
height);
if (PageDirty)
printf("/SA {\n"
" /%s%s%s%s findfont\n"
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
" setfont\n"
"} bind def\n",
AlternateFont.typeface == 48 ? "Courier" : "Helvetica",
(AlternateFont.weight != 0 || AlternateFont.posture != 0) ? "-" : "",
AlternateFont.weight != 0 ? "Bold" : "",
AlternateFont.posture != 0 ? "Oblique" : "",
AlternateFont.x * AlternateFont.height,
-AlternateFont.y * AlternateFont.height,
AlternateFont.y * AlternateFont.height,
AlternateFont.x * AlternateFont.height);
CharHeight[1] = height;
CharHeight[1] = AlternateFont.height;
}
@@ -171,12 +175,56 @@ void
DI_absolute_direction(int num_params, /* I - Number of parameters */
param_t *params) /* I - Parameters */
{
Outputf(CharFont == 0 ? "SS\n" : "SA\n");
if (CharFont)
{
if (num_params == 2)
{
AlternateFont.x = params[0].value.number;
AlternateFont.y = params[1].value.number;
}
if (num_params == 2)
Outputf("currentfont [ %f %f %f %f 0.0 0.0 ] makefont setfont\n",
params[0].value.number, -params[1].value.number,
params[1].value.number, params[0].value.number);
if (PageDirty)
{
printf("/SA {\n"
" /%s%s%s%s findfont\n"
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
" setfont\n"
"} bind def\n",
AlternateFont.typeface == 48 ? "Courier" : "Helvetica",
(AlternateFont.weight != 0 || AlternateFont.posture != 0) ? "-" : "",
AlternateFont.weight != 0 ? "Bold" : "",
AlternateFont.posture != 0 ? "Oblique" : "",
AlternateFont.x * AlternateFont.height,
-AlternateFont.y * AlternateFont.height,
AlternateFont.y * AlternateFont.height,
AlternateFont.x * AlternateFont.height);
}
}
else
{
if (num_params == 2)
{
StandardFont.x = params[0].value.number;
StandardFont.y = params[1].value.number;
}
if (PageDirty)
{
printf("/SS {\n"
" /%s%s%s%s findfont\n"
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
" setfont\n"
"} bind def\n",
StandardFont.typeface == 48 ? "Courier" : "Helvetica",
(StandardFont.weight != 0 || StandardFont.posture != 0) ? "-" : "",
StandardFont.weight != 0 ? "Bold" : "",
StandardFont.posture != 0 ? "Oblique" : "",
StandardFont.x * StandardFont.height,
-StandardFont.y * StandardFont.height,
StandardFont.y * StandardFont.height,
StandardFont.x * StandardFont.height);
}
}
}
@@ -249,7 +297,7 @@ LB_label(int num_params, /* I - Number of parameters */
return;
Outputf("gsave\n");
Outputf("currentmiterlimit 1.0 setmiterlimit\n");
Outputf("currentmiterlimit 1.0 \n");
Outputf("MP\n");
Outputf("%.3f %.3f MO\n", PenPosition[0], PenPosition[1]);
@@ -295,7 +343,9 @@ SA_select_alternate(int num_params, /* I - Number of parameters */
(void)num_params;
(void)params;
Outputf("SA\n");
if (PageDirty)
puts("SA");
CharFont = 1;
}
@@ -309,20 +359,18 @@ SD_define_standard(int num_params, /* I - Number of parameters */
param_t *params) /* I - Parameters */
{
int i; /* Looping var */
int typeface, /* Typeface number */
posture, /* Posture number */
weight; /* Weight number */
float height; /* Height/size of font */
/*
* Set default font attributes...
*/
typeface = 48;
posture = 0;
weight = 0;
height = 11.5;
StandardFont.typeface = 48;
StandardFont.posture = 0;
StandardFont.weight = 0;
StandardFont.height = 11.5;
StandardFont.x = 1.0;
StandardFont.y = 0.0;
/*
* Loop through parameter value pairs...
@@ -332,16 +380,16 @@ SD_define_standard(int num_params, /* I - Number of parameters */
switch ((int)params[i].value.number)
{
case 4 :
height = params[i + 1].value.number;
StandardFont.height = params[i + 1].value.number;
break;
case 5 :
posture = (int)params[i + 1].value.number;
StandardFont.posture = (int)params[i + 1].value.number;
break;
case 6 :
weight = (int)params[i + 1].value.number;
StandardFont.weight = (int)params[i + 1].value.number;
break;
case 7 :
typeface = (int)params[i + 1].value.number;
StandardFont.typeface = (int)params[i + 1].value.number;
break;
}
@@ -349,14 +397,22 @@ SD_define_standard(int num_params, /* I - Number of parameters */
* Define the font...
*/
Outputf("/SS { /%s%s%s%s findfont %.1f scalefont setfont } def\n",
typeface == 48 ? "Courier" : "Helvetica",
(weight != 0 || posture != 0) ? "-" : "",
weight != 0 ? "Bold" : "",
posture != 0 ? "Oblique" : "",
height);
if (PageDirty)
printf("/SS {\n"
" /%s%s%s%s findfont\n"
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
" setfont\n"
"} bind def\n",
StandardFont.typeface == 48 ? "Courier" : "Helvetica",
(StandardFont.weight != 0 || StandardFont.posture != 0) ? "-" : "",
StandardFont.weight != 0 ? "Bold" : "",
StandardFont.posture != 0 ? "Oblique" : "",
StandardFont.x * StandardFont.height,
-StandardFont.y * StandardFont.height,
StandardFont.y * StandardFont.height,
StandardFont.x * StandardFont.height);
CharHeight[0] = height;
CharHeight[0] = StandardFont.height;
}
@@ -410,7 +466,9 @@ SS_select_standard(int num_params, /* I - Number of parameters */
(void)num_params;
(void)params;
Outputf("SS\n");
if (PageDirty)
puts("SS");
CharFont = 0;
}
+221 -52
Ver Arquivo
@@ -51,54 +51,153 @@
void
update_transform(void)
{
float width, /* Plot width */
height; /* Plot height */
float page_width, /* Actual page width in points */
page_length; /* Actual page length in points */
float page_width, /* Actual page width */
page_height; /* Actual page height */
float scaling; /* Scaling factor */
float left, right, /* Scaling window */
bottom, top;
float width, height; /* Scaling width and height */
float iw1[2], iw2[2]; /* Clipping window */
/*
* Get the page and input window sizes...
*/
width = IW2[0] - IW1[0];
height = IW2[1] - IW1[1];
if (FitPlot)
{
page_width = PageRight - PageLeft;
page_height = PageTop - PageBottom;
}
else
{
page_width = (P2[0] - P1[0]) * 72.0f / 1016.0f;
page_height = (P2[1] - P1[1]) * 72.0f / 1016.0f;
}
fprintf(stderr, "DEBUG: page_width = %.0f, page_height = %.0f\n",
page_width, page_height);
if (page_width == 0 || page_height == 0)
return;
/*
* Set the scaling window...
*/
switch (ScalingType)
{
case -1 : /* No user scaling */
left = P1[0];
bottom = P1[1];
right = P2[0];
top = P2[1];
break;
case 0 : /* Anisotropic (non-uniform) scaling */
left = Scaling1[0];
bottom = Scaling1[1];
right = Scaling2[0];
top = Scaling2[1];
break;
case 1 : /* Isotropic (uniform) scaling */
left = Scaling1[0];
bottom = Scaling1[1];
right = Scaling2[0];
top = Scaling2[1];
width = right - left;
height = top - bottom;
if (width == 0 || height == 0)
return;
if ((width * page_height) != (height * page_width))
{
scaling = height * page_width / page_height;
if (width < scaling)
{
width = scaling;
left = 0.5f * (left + right - width);
right = left + width;
}
else
{
height = width * page_height / page_width;
bottom = 0.5f * (bottom + top - height);
top = bottom + height;
}
}
break;
case 2 :
left = Scaling1[0];
bottom = Scaling1[1];
right = left + page_width * Scaling2[0];
top = bottom + page_height * Scaling2[1];
break;
}
width = right - left;
height = top - bottom;
if (width == 0 || height == 0)
return;
/*
* Scale the plot as needed...
* Rotate the plot as needed...
*/
if (FitPlot)
if (Rotation == 0 || Rotation == 180)
{
page_width = PageRight - PageLeft;
page_length = PageTop - PageBottom;
if (Rotation == 0 || Rotation == 180)
if ((width > height && page_width < page_height) ||
(width < height && page_width > page_height))
{
scaling = page_width / width;
if (scaling > (page_length / width))
scaling = page_length / width;
}
else
{
scaling = page_width / height;
if (scaling > (page_length / height))
scaling = page_length / height;
fputs("DEBUG: Automatically rotating the page...\n", stderr);
Rotation += 90;
}
}
else
{
page_width = PlotSize[0];
page_length = PlotSize[1];
if ((width > height && page_width > page_height) ||
(width < height && page_width < page_height))
{
fputs("DEBUG: Automatically rotating the page...\n", stderr);
Rotation = (Rotation + 90) % 360;
}
}
/*
* Scale the plot as needed...
*/
if (Rotation == 0 || Rotation == 180)
scaling = page_width / width;
else
scaling = page_width / height;
if (FitPlot)
{
if (Rotation == 0 || Rotation == 180)
scaling = page_width / width;
scaling *= page_width / PlotSize[1];
else
scaling = page_width / height;
scaling *= page_width / PlotSize[0];
}
/*
* Offset for the current P1 location...
*/
if (FitPlot)
{
left = 0;
bottom = 0;
}
else
{
left = P1[0] * 72.0f / 1016.0f;
bottom = P1[1] * 72.0f / 1016.0f;
}
/*
@@ -110,47 +209,69 @@ update_transform(void)
case 0 :
Transform[0][0] = scaling;
Transform[0][1] = 0.0;
Transform[0][2] = -IW1[0] * scaling;
Transform[0][2] = -left;
Transform[1][0] = 0.0;
Transform[1][1] = scaling;
Transform[1][2] = -IW1[1] * scaling;
Transform[1][2] = -bottom;
break;
case 90 :
Transform[0][0] = 0.0;
Transform[0][1] = -scaling;
Transform[0][2] = (height - IW1[0]) * scaling;
Transform[0][2] = PageLength - left;
Transform[1][0] = scaling;
Transform[1][1] = 0.0;
Transform[1][2] = -IW1[1] * scaling;
Transform[1][2] = -bottom;
break;
case 180 :
Transform[0][0] = -scaling;
Transform[0][1] = 0.0;
Transform[0][2] = (height - IW1[0]) * scaling;
Transform[0][2] = PageLength - left;
Transform[1][0] = 0.0;
Transform[1][1] = -scaling;
Transform[1][2] = (width - IW1[1]) * scaling;
Transform[1][2] = PageWidth - bottom;
break;
case 270 :
Transform[0][0] = 0.0;
Transform[0][1] = scaling;
Transform[0][2] = -IW1[0] * scaling;
Transform[0][2] = -left;
Transform[1][0] = -scaling;
Transform[1][1] = 0.0;
Transform[1][2] = (width - IW1[1]) * scaling;
Transform[1][2] = PageWidth - bottom;
break;
}
PenScaling = Transform[0][0] + Transform[0][1];
fprintf(stderr, "DEBUG: Transform = [ %.3f %.3f\n"
"DEBUG: %.3f %.3f\n"
"DEBUG: %.3f %.3f ]\n",
Transform[0][0], Transform[1][0], Transform[0][1],
Transform[1][1], Transform[0][2], Transform[1][2]);
if (WidthUnits)
PenScaling = page_width * scaling * 0.01f;
else
PenScaling = page_width / PageWidth * 72.0f / 25.4f;
if (PenScaling < 0.0)
PenScaling = -PenScaling;
if (PageDirty)
{
printf("/PenScaling %.3f def W%d\n", PenScaling, PenNumber);
if (IW1[0] != IW2[0] && IW1[1] != IW2[1])
{
iw1[0] = IW1[0] * 72.0f / 1016.0f;
iw1[1] = IW1[1] * 72.0f / 1016.0f;
iw2[0] = IW2[0] * 72.0f / 1016.0f;
iw2[1] = IW2[1] * 72.0f / 1016.0f;
printf("initclip MP %.3f %.3f MO %.3f %.3f LI %.3f %.3f LI %.3f %.3f LI CP clip\n",
iw1[0], iw1[1], iw1[0], iw2[1], iw2[0], iw2[1], iw2[0], iw1[1]);
}
}
}
@@ -219,7 +340,8 @@ IN_initialize(int num_params, /* I - Number of parameters */
PS_plot_size(0, NULL);
WU_width_units(0, NULL);
PW_pen_width(0, NULL);
SP_select_pen(0, NULL);
PenWidth = 1;
PenPosition[0] = PenPosition[1] = 0.0;
}
@@ -235,10 +357,10 @@ IP_input_absolute(int num_params, /* I - Number of parameters */
{
if (num_params == 0)
{
P1[0] = 0.0;
P1[1] = 0.0;
P2[0] = PlotSize[0] / 72.0f * 1016.0f;
P2[1] = PlotSize[1] / 72.0f * 1016.0f;
P1[0] = PageLeft / 72.0f * 1016.0f;
P1[1] = PageBottom / 72.0f * 1016.0f;
P2[0] = PageRight / 72.0f * 1016.0f;
P2[1] = PageTop / 72.0f * 1016.0f;
}
else if (num_params == 2)
{
@@ -262,6 +384,14 @@ IP_input_absolute(int num_params, /* I - Number of parameters */
IW2[0] = P2[0];
IW2[1] = P2[1];
if (ScalingType < 0)
{
Scaling1[0] = P1[0];
Scaling1[0] = P1[1];
Scaling2[0] = P2[0];
Scaling2[1] = P2[1];
}
update_transform();
}
@@ -303,6 +433,14 @@ IR_input_relative(int num_params, /* I - Number of parameters */
IW2[0] = P2[0];
IW2[1] = P2[1];
if (ScalingType < 0)
{
Scaling1[0] = P1[0];
Scaling1[0] = P1[1];
Scaling2[0] = P2[0];
Scaling2[1] = P2[1];
}
update_transform();
}
@@ -317,19 +455,44 @@ IW_input_window(int num_params, /* I - Number of parameters */
{
if (num_params == 0)
{
IW1[0] = P1[0];
IW1[1] = P1[1];
IW2[0] = P2[0];
IW2[1] = P2[1];
IW1[0] = PageLeft / 72.0f * 1016.0f;
IW1[1] = PageBottom / 72.0f * 1016.0f;
IW2[0] = PageRight / 72.0f * 1016.0f;
IW2[1] = PageTop / 72.0f * 1016.0f;
}
else if (num_params == 4)
{
IW1[0] = params[0].value.number;
IW1[1] = params[1].value.number;
IW2[0] = params[2].value.number;
IW2[1] = params[3].value.number;
if (ScalingType < 0)
{
IW1[0] = params[0].value.number;
IW1[1] = params[1].value.number;
IW2[0] = params[2].value.number;
IW2[1] = params[3].value.number;
}
else
{
IW1[0] = (Transform[0][0] * params[0].value.number +
Transform[0][1] * params[1].value.number +
Transform[0][2]) / 72.0f * 1016.0f;
IW1[1] = (Transform[1][0] * params[0].value.number +
Transform[1][1] * params[1].value.number +
Transform[1][2]) / 72.0f * 1016.0f;
IW2[0] = (Transform[0][0] * params[2].value.number +
Transform[0][1] * params[3].value.number +
Transform[0][2]) / 72.0f * 1016.0f;
IW2[1] = (Transform[1][0] * params[2].value.number +
Transform[1][1] * params[3].value.number +
Transform[1][2]) / 72.0f * 1016.0f;
}
fprintf(stderr, "DEBUG: IW%.0f,%.0f,%.0f,%.0f = [ %.0f %.0f %.0f %.0f ]\n",
params[0].value.number, params[1].value.number,
params[2].value.number, params[3].value.number,
IW1[0], IW1[1], IW2[0], IW2[1]);
}
update_transform();
}
@@ -368,13 +531,13 @@ PS_plot_size(int num_params, /* I - Number of parameters */
case 0 :
if (Rotation == 0 || Rotation == 180)
{
PlotSize[0] = PageRight - PageLeft;
PlotSize[1] = PageTop - PageBottom;
PlotSize[0] = PageWidth;
PlotSize[1] = PageLength;
}
else
{
PlotSize[0] = PageTop - PageBottom;
PlotSize[1] = PageRight - PageLeft;
PlotSize[0] = PageLength;
PlotSize[1] = PageWidth;
}
break;
case 1 :
@@ -450,7 +613,13 @@ SC_scale(int num_params, /* I - Number of parameters */
param_t *params) /* I - Parameters */
{
if (num_params == 0)
{
ScalingType = -1;
Scaling1[0] = P1[0];
Scaling1[0] = P1[1];
Scaling2[0] = P2[0];
Scaling2[1] = P2[1];
}
else if (num_params > 3)
{
Scaling1[0] = params[0].value.number;
@@ -461,7 +630,7 @@ SC_scale(int num_params, /* I - Number of parameters */
if (num_params > 4)
ScalingType = (int)params[4].value.number;
else
ScalingType = 0;
ScalingType = 1;
}
update_transform();
+1 -1
Ver Arquivo
@@ -161,7 +161,7 @@ ParseCommand(FILE *fp, /* I - File to read from */
break;
case '\"' :
fscanf(fp, "%[^\"]\"", buf);
fscanf(fp, "%262143[^\"]\"", buf);
if (num_params < MAX_PARAMS)
{
p[num_params].type = PARAM_STRING;
+7 -7
Ver Arquivo
@@ -128,7 +128,6 @@ main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
FILE *fp; /* Input file */
ppd_file_t *ppd; /* PPD file */
int num_params; /* Number of parameters */
param_t *params; /* Command parameters */
name_t *command, /* Command */
@@ -137,7 +136,6 @@ main(int argc, /* I - Number of command-line arguments */
cups_option_t *options; /* Print options */
const char *val; /* Option value */
int shading; /* -1 = black, 0 = grey, 1 = color */
float penwidth; /* Default pen width */
if (argc < 6 || argc > 7)
@@ -173,11 +171,13 @@ main(int argc, /* I - Number of command-line arguments */
options = NULL;
num_options = cupsParseOptions(argv[5], 0, &options);
if ((ppd = SetCommonOptions(num_options, options, 1)) != NULL)
ppdClose(ppd);
PPD = SetCommonOptions(num_options, options, 1);
PlotSize[0] = PageWidth;
PlotSize[1] = PageLength;
shading = 1;
penwidth = 1.0;
PenWidth = 1.0;
if ((val = cupsGetOption("blackplot", num_options, options)) != NULL)
shading = 0;
@@ -186,13 +186,13 @@ main(int argc, /* I - Number of command-line arguments */
FitPlot = 1;
if ((val = cupsGetOption("penwidth", num_options, options)) != NULL)
penwidth = (float)atof(val);
PenWidth = (float)atof(val);
/*
* Write the PostScript prolog and initialize the plotting "engine"...
*/
OutputProlog(argv[3], argv[2], shading, penwidth);
OutputProlog(argv[3], argv[2], shading);
IP_input_absolute(0, NULL);
+192 -7
Ver Arquivo
@@ -44,8 +44,7 @@
void
OutputProlog(char *title, /* I - Job title */
char *user, /* I - Username */
int shading, /* I - Type of shading */
float penwidth) /* I - Default pen width */
int shading) /* I - Type of shading */
{
FILE *prolog; /* Prolog file */
char line[255]; /* Line from prolog file */
@@ -73,16 +72,16 @@ OutputProlog(char *title, /* I - Job title */
puts("%%Orientation: Landscape");
puts("%%EndComments");
puts("%%BeginProlog");
printf("/DefaultPenWidth %.2f def\n", penwidth * 72.0 / 25.4);
printf("/DefaultPenWidth %.2f def\n", PenWidth * 72.0 / 25.4);
puts("3.0 setmiterlimit");
if (!shading) /* Black only */
puts("/setrgbcolor { pop pop pop } bind def");
else if (!ColorDevice) /* Greyscale */
puts("/setrgbcolor { 0.08 mul exch 0.61 mul add exch 0.31 mul add setgray } bind def\n");
if ((prolog = fopen(CUPS_DATADIR "/HPGLprolog", "r")) == NULL)
if ((prolog = fopen(CUPS_DATADIR "/data/HPGLprolog", "r")) == NULL)
{
perror("ERROR: Unable to open HPGL prolog \"" CUPS_DATADIR "/HPGLprolog\" for reading");
perror("ERROR: Unable to open HPGL prolog \"" CUPS_DATADIR "/data/HPGLprolog\" for reading");
exit(1);
}
@@ -124,6 +123,13 @@ Outputf(const char *format, /* I - Printf-style string */
{
va_list ap; /* Argument pointer */
int bytes; /* Number of bytes written */
float iw1[2], iw2[2]; /* Clipping window */
int i; /* Looping var */
ppd_size_t *size; /* Page size */
ppd_option_t *option; /* Page size option */
ppd_choice_t *choice; /* Page size choice */
float width, length; /* Page dimensions */
int landscape; /* Rotate for landscape orientation? */
/*
@@ -136,11 +142,179 @@ Outputf(const char *format, /* I - Printf-style string */
PageCount ++;
printf("%%%%Page: %d %d\n", PageCount, PageCount);
if (PPD != NULL && !FitPlot)
{
/*
* Set the page size for this page...
*/
if (Rotation == 0 || Rotation == 180)
{
width = PlotSize[0];
length = PlotSize[1];
}
else
{
width = PlotSize[1];
length = PlotSize[0];
}
landscape = 0;
/*
* Lookup the closest PageSize and set it...
*/
for (i = PPD->num_sizes, size = PPD->sizes; i > 0; i --, size ++)
if ((fabs(length - size->length) < 36.0 && size->width >= width) ||
(fabs(length - size->width) < 36.0 && size->length >= width))
break;
if (i == 0 && PPD->variable_sizes)
{
for (i = PPD->num_sizes, size = PPD->sizes; i > 0; i --, size ++)
if (strcasecmp(size->name, "custom") == 0)
break;
}
if (i > 0)
{
/*
* Found a matching size...
*/
option = ppdFindOption(PPD, "PageSize");
choice = ppdFindChoice(option, size->name);
puts("%%BeginPageSetup");
printf("%%%%BeginFeature: PageSize %s\n", size->name);
if (strcasecmp(size->name, "custom") == 0)
{
PageLeft = PPD->custom_margins[0];
PageRight = width - PPD->custom_margins[2];
PageWidth = width;
PageBottom = PPD->custom_margins[1];
PageTop = length - PPD->custom_margins[3];
PageLength = length;
printf("%.0f %.0f 0 0 0\n", width, length);
if (choice->code == NULL)
{
/*
* This can happen with certain buggy PPD files that don't include
* a CustomPageSize command sequence... We just use a generic
* Level 2 command sequence...
*/
puts("pop pop pop");
puts("<</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\n");
}
else
{
/*
* Use the vendor-supplied command...
*/
printf("%s\n", choice->code);
}
}
else
{
if (choice->code)
printf("%s\n", choice->code);
if (fabs(length - size->width) < 36.0)
{
/*
* Do landscape orientation...
*/
PageLeft = size->bottom;
PageRight = size->top;
PageWidth = size->length;
PageBottom = size->left;
PageTop = size->right;
PageLength = size->width;
landscape = 1;
}
else
{
/*
* Do portrait orientation...
*/
PageLeft = size->left;
PageRight = size->right;
PageWidth = size->width;
PageBottom = size->bottom;
PageTop = size->top;
PageLength = size->length;
}
}
puts("%%EndFeature");
puts("%%EndSetup");
}
}
printf("/PenScaling %.3f def\n", PenScaling);
printf("/SA {\n"
" /%s%s%s%s findfont\n"
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
" setfont\n"
"} bind def\n",
AlternateFont.typeface == 48 ? "Courier" : "Helvetica",
(AlternateFont.weight != 0 || AlternateFont.posture != 0) ? "-" : "",
AlternateFont.weight != 0 ? "Bold" : "",
AlternateFont.posture != 0 ? "Oblique" : "",
AlternateFont.x * AlternateFont.height,
-AlternateFont.y * AlternateFont.height,
AlternateFont.y * AlternateFont.height,
AlternateFont.x * AlternateFont.height);
printf("/SS {\n"
" /%s%s%s%s findfont\n"
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
" setfont\n"
"} bind def\n",
StandardFont.typeface == 48 ? "Courier" : "Helvetica",
(StandardFont.weight != 0 || StandardFont.posture != 0) ? "-" : "",
StandardFont.weight != 0 ? "Bold" : "",
StandardFont.posture != 0 ? "Oblique" : "",
StandardFont.x * StandardFont.height,
-StandardFont.y * StandardFont.height,
StandardFont.y * StandardFont.height,
StandardFont.x * StandardFont.height);
if (CharFont)
puts("SA");
else
puts("SS");
printf("%.1f setmiterlimit\n", MiterLimit);
printf("%d setlinecap\n", LineCap);
printf("%d setlinejoin\n", LineJoin);
for (i = 0; i <= PenCount; i ++)
{
printf("/W%d { %.1f PenScaling mul setlinewidth } bind def\n", i,
Pens[i].width);
printf("/P%d { %.3f %.3f %.3f setrgbcolor } bind def\n",
i, Pens[i].rgb[0], Pens[i].rgb[1], Pens[i].rgb[2]);
}
puts("P1 W1");
puts("gsave");
if (Duplex && (PageCount & 1) == 0)
switch ((PageRotation / 90) & 3)
switch ((PageRotation / 90 + landscape) & 3)
{
case 0 :
printf("%.1f %.1f translate\n", PageWidth - PageRight, PageBottom);
@@ -157,7 +331,7 @@ Outputf(const char *format, /* I - Printf-style string */
break;
}
else
switch ((PageRotation / 90) & 3)
switch ((PageRotation / 90 + landscape) & 3)
{
case 0 :
printf("%.1f %.1f translate\n", PageLeft, PageBottom);
@@ -173,6 +347,17 @@ Outputf(const char *format, /* I - Printf-style string */
printf("%.1f %.1f translate\n", PageLength - PageTop, PageLeft);
break;
}
if (IW1[0] != IW2[0] && IW1[1] != IW2[1])
{
iw1[0] = IW1[0] * 72.0f / 1016.0f;
iw1[1] = IW1[1] * 72.0f / 1016.0f;
iw2[0] = IW2[0] * 72.0f / 1016.0f;
iw2[1] = IW2[1] * 72.0f / 1016.0f;
printf("initclip MP %.3f %.3f MO %.3f %.3f LI %.3f %.3f LI %.3f %.3f LI CP clip\n",
iw1[0], iw1[1], iw1[0], iw2[1], iw2[0], iw2[1], iw2[0], iw1[1]);
}
}
/*
-130
Ver Arquivo
@@ -1,130 +0,0 @@
# Microsoft Developer Studio Project File - Name="hpgltops" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=hpgltops - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "hpgltops.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "hpgltops.mak" CFG="hpgltops - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "hpgltops - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "hpgltops - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "hpgltops - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ../cups/cups.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"hpgltops.exe"
!ELSEIF "$(CFG)" == "hpgltops - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "hpgltops___Win32_Debug"
# PROP BASE Intermediate_Dir "hpgltops___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ../cups/cupsd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"hpgltopsd.exe" /pdbtype:sept
!ENDIF
# Begin Target
# Name "hpgltops - Win32 Release"
# Name "hpgltops - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=".\hpgl-attr.c"
# End Source File
# Begin Source File
SOURCE=".\hpgl-char.c"
# End Source File
# Begin Source File
SOURCE=".\hpgl-config.c"
# End Source File
# Begin Source File
SOURCE=".\hpgl-input.c"
# End Source File
# Begin Source File
SOURCE=".\hpgl-main.c"
# End Source File
# Begin Source File
SOURCE=".\hpgl-polygon.c"
# End Source File
# Begin Source File
SOURCE=".\hpgl-prolog.c"
# End Source File
# Begin Source File
SOURCE=".\hpgl-vector.c"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\hpgltops.h
# End Source File
# End Group
# End Target
# End Project
+38 -2
Ver Arquivo
@@ -52,6 +52,31 @@ typedef struct
#define PARAM_STRING 2
/*
* Font information...
*/
typedef struct
{
int typeface, /* Typeface number */
posture, /* Posture number */
weight; /* Weight number */
float height; /* Height/size of font */
float x, y; /* X and Y direction/scaling */
} font_t;
/*
* Pen information...
*/
typedef struct
{
float rgb[3]; /* Pen color */
float width; /* Pen width */
} pen_t;
/*
* Globals...
*/
@@ -66,6 +91,8 @@ typedef struct
# define VALUE2(x,y)
#endif /* _HPGL_MAIN_C_ */
VAR ppd_file_t *PPD VALUE(NULL); /* PPD file */
VAR float P1[2], /* Lower-lefthand physical limit */
P2[2], /* Upper-righthand physical limit */
IW1[2], /* Window lower-lefthand limit */
@@ -78,9 +105,13 @@ VAR float Transform[2][3]; /* Transform matrix */
VAR int PageRotation VALUE(0); /* Page/plot rotation */
VAR char StringTerminator VALUE('\003'); /* Terminator for labels */
VAR font_t StandardFont, /* Standard font */
AlternateFont; /* Alternate font */
VAR float PenPosition[2] VALUE2(0.0f, 0.0f),
/* Current pen position */
PenScaling VALUE(1.0f); /* Pen width scaling factor */
PenScaling VALUE(1.0f), /* Pen width scaling factor */
PenWidth VALUE(1.0f); /* Default pen width */
VAR pen_t Pens[1024]; /* State of each pen */
VAR int PenMotion VALUE(0), /* 0 = absolute, 1 = relative */
PenNumber VALUE(1), /* Current pen number */
PenCount VALUE(8), /* Number of pens */
@@ -107,6 +138,11 @@ VAR float ColorRange[3][2] /* Range of color values */
#endif /* _HPGL_MAIN_C_ */
;
VAR int LineCap VALUE(0); /* Line capping */
VAR int LineJoin VALUE(0); /* Line joining */
VAR float MiterLimit VALUE(3.0f); /* Miter limit at joints */
/*
* Prototypes...
*/
@@ -187,7 +223,7 @@ extern void UL_user_line_type(int num_params, param_t *params);
extern void WU_width_units(int num_params, param_t *params);
/* hpgl-prolog.c */
extern void OutputProlog(char *title, char *user, int shading, float penwidth);
extern void OutputProlog(char *title, char *user, int shading);
extern void OutputTrailer(void);
extern int Outputf(const char *format, ...);
+38 -37
Ver Arquivo
@@ -84,9 +84,9 @@ static void zshear(float [3][3], float, float);
*/
void
ImageWhiteToWhite(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToWhite(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -104,9 +104,9 @@ ImageWhiteToWhite(ib_t *in, /* I - Input pixels */
*/
void
ImageWhiteToRGB(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToRGB(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -133,9 +133,9 @@ ImageWhiteToRGB(ib_t *in, /* I - Input pixels */
*/
void
ImageWhiteToBlack(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToBlack(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -157,9 +157,9 @@ ImageWhiteToBlack(ib_t *in, /* I - Input pixels */
*/
void
ImageWhiteToCMY(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToCMY(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -186,9 +186,9 @@ ImageWhiteToCMY(ib_t *in, /* I - Input pixels */
*/
void
ImageWhiteToCMYK(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageWhiteToCMYK(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -216,9 +216,9 @@ ImageWhiteToCMYK(ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToBlack(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageRGBToBlack(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -242,9 +242,9 @@ ImageRGBToBlack(ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToCMY(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageRGBToCMY(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 cc, cm, cy; /* Calibrated CMY values */
@@ -316,11 +316,12 @@ ImageRGBToCMY(ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToCMYK(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
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 */
km, /* Maximum K value */
diff, /* Color differences */
divk; /* Color divisor */
int cc, cm, cy; /* Calibrated CMY values */
@@ -334,8 +335,8 @@ ImageRGBToCMYK(ib_t *in, /* I - Input pixels */
y = 255 - *in++;
k = min(c, min(m, y));
diff = 255 - (max(c, max(m, y)) - k);
k = k * diff / 255;
if ((km = max(c, max(m, y))) > k)
k = k * k / km;
if (k == 255)
c = m = y = 0;
@@ -385,7 +386,7 @@ ImageRGBToCMYK(ib_t *in, /* I - Input pixels */
else if (cy > 255)
*out++ = ImageDensity[255];
else
*out++ = cy;
*out++ = ImageDensity[cy];
*out++ = ImageDensity[k];
@@ -433,9 +434,9 @@ ImageRGBToCMYK(ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToWhite(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageRGBToWhite(const ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
{
if (ImageHaveProfile)
while (count > 0)
@@ -459,9 +460,9 @@ ImageRGBToWhite(ib_t *in, /* I - Input pixels */
*/
void
ImageRGBToRGB(ib_t *in, /* I - Input pixels */
ib_t *out, /* I - Output pixels */
int count) /* I - Number of pixels */
ImageRGBToRGB(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 cr, cg, cb; /* Calibrated RGB values */
@@ -521,9 +522,9 @@ ImageRGBToRGB(ib_t *in, /* I - Input pixels */
*/
void
ImageLut(ib_t *pixels, /* I - Input/output pixels */
int count, /* I - Number of pixels/bytes to adjust */
ib_t *lut) /* I - Lookup table */
ImageLut(ib_t *pixels, /* IO - Input/output pixels */
int count, /* I - Number of pixels/bytes to adjust */
const ib_t *lut) /* I - Lookup table */
{
while (count > 0)
{
@@ -539,7 +540,7 @@ ImageLut(ib_t *pixels, /* I - Input/output pixels */
*/
void
ImageRGBAdjust(ib_t *pixels, /* I - Input/output pixels */
ImageRGBAdjust(ib_t *pixels, /* IO - Input/output pixels */
int count, /* I - Number of pixels to adjust */
int saturation, /* I - Color saturation (%) */
int hue) /* I - Color hue (degrees) */
+14 -14
Ver Arquivo
@@ -72,14 +72,14 @@ static int gif_read_image(FILE *fp, image_t *img, gif_cmap_t cmap,
* 'ImageReadGIF()' - Read a GIF image file.
*/
int /* O - Read status */
ImageReadGIF(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation,/* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
int /* O - Read status */
ImageReadGIF(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
{
unsigned char buf[1024]; /* Input buffer */
gif_cmap_t cmap; /* Colormap */
@@ -236,13 +236,13 @@ ImageReadGIF(image_t *img, /* IO - Image */
* 'gif_read_cmap()' - Read the colormap from a GIF file...
*/
static int
gif_read_cmap(FILE *fp,
int ncolors,
gif_cmap_t cmap,
int *gray)
static int /* O - -1 on error, 0 on success */
gif_read_cmap(FILE *fp, /* I - File to read from */
int ncolors, /* I - Number of colors in file */
gif_cmap_t cmap, /* O - Colormap information */
int *gray) /* IO - Is the image grayscale? */
{
int i;
int i; /* Looping var */
/*
+7 -7
Ver Arquivo
@@ -41,13 +41,13 @@
*/
int /* O - Read status */
ImageReadJPEG(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
ImageReadJPEG(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
{
struct jpeg_decompress_struct cinfo; /* Decompressor info */
struct jpeg_error_mgr jerr; /* Error handler info */
+7 -7
Ver Arquivo
@@ -44,13 +44,13 @@
*/
int /* O - Read status */
ImageReadPhotoCD(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
ImageReadPhotoCD(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
{
int x, y; /* Looping vars */
int xdir, /* X direction */
+8 -8
Ver Arquivo
@@ -40,14 +40,14 @@
* 'ImageReadPNG()' - Read a PNG image file.
*/
int /* O - Read status */
ImageReadPNG(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation,/* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
ib_t *lut) /* I - Lookup table for gamma/brightness */
int /* O - Read status */
ImageReadPNG(image_t *img, /* IO - Image */
FILE *fp, /* I - Image file */
int primary, /* I - Primary choice for colorspace */
int secondary, /* I - Secondary choice for colorspace */
int saturation, /* I - Color saturation (%) */
int hue, /* I - Color hue (degrees) */
const ib_t *lut) /* I - Lookup table for gamma/brightness */
{
int y; /* Looping var */
png_structp pp; /* PNG read pointer */

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