Comparar commits
10 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| d996e1ac50 | |||
| ce6379738a | |||
| 6f2911b5b2 | |||
| 443cd51633 | |||
| b4dea4d7c6 | |||
| 608728d8a4 | |||
| 3dd728977a | |||
| 5b8f8fee67 | |||
| a6d5d8328d | |||
| 89c7a9d178 |
@@ -0,0 +1,10 @@
|
||||
*.o
|
||||
.buildrev
|
||||
buildtest.env
|
||||
build.log
|
||||
temp
|
||||
tools/.buildrev
|
||||
tools/Makefile
|
||||
tools/config.log
|
||||
tools/config.status
|
||||
tools/sendbuildlog
|
||||
@@ -0,0 +1,7 @@
|
||||
[submodule "stable"]
|
||||
path = stable
|
||||
url = https://github.com/apple/cups.git
|
||||
branch = branch-2.1
|
||||
[submodule "development"]
|
||||
path = development
|
||||
url = https://github.com/apple/cups.git
|
||||
@@ -1,98 +0,0 @@
|
||||
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.
|
||||
@@ -1,25 +0,0 @@
|
||||
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".
|
||||
-386
@@ -1,386 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Software License Agreement - Common UNIX Printing System</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR=#ffffff>
|
||||
|
||||
<H2 ALIGN="CENTER">Common UNIX Printing System License Agreement</H2>
|
||||
|
||||
<P ALIGN="CENTER">Copyright 1997-1999 by Easy Software Products<BR>
|
||||
44141 AIRPORT VIEW DR STE 204<BR>
|
||||
HOLLYWOOD, MARYLAND 20636-3111 USA<BR>
|
||||
<BR>
|
||||
Voice: +1.301.373.9603<BR>
|
||||
Email: cups-info@cups.org<BR>
|
||||
WWW: http://www.cups.org
|
||||
|
||||
<H3>Introduction</H3>
|
||||
|
||||
<P>The Common UNIX Printing System<SUP>TM</SUP>, or CUPS<SUP>TM</SUP>,
|
||||
is provided under the GNU General Public License, Version 2. A copy of
|
||||
this license follows this introduction.
|
||||
|
||||
<P>For those not familiar with the GNU General Public License, the license
|
||||
basically allows you to:
|
||||
|
||||
<UL>
|
||||
|
||||
<LI>Use the CUPS software at no charge.
|
||||
|
||||
<LI>Distribute verbatim copies of the software in source or
|
||||
binary form.
|
||||
|
||||
<LI>Sell verbatim copies of the software for a media fee, or
|
||||
sell support for the software.
|
||||
|
||||
<LI>Distribute or sell printer drivers and filters that use the
|
||||
CUPS API so long as source code is made available under the GPL.
|
||||
|
||||
</UL>
|
||||
|
||||
<P>What this license <B>does not</B> 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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<H3>Binary Distribution Rights</H3>
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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:
|
||||
|
||||
<BLOCKQUOTE>Miles Jones<BR>
|
||||
Director of Marketing<BR>
|
||||
Artifex Software Inc.<BR>
|
||||
454 Las Gallinas Ave., Suite 108<BR>
|
||||
San Rafael, CA 94903 USA<BR>
|
||||
Voice: +1.415.492.9861<BR>
|
||||
Fax: +1.415.492.9862<BR>
|
||||
EMail: info@arsoft.com
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3>Support</H3>
|
||||
|
||||
<P>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.
|
||||
|
||||
<H3>Trademarks</H3>
|
||||
|
||||
<P>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.
|
||||
|
||||
<H2 ALIGN="CENTER">GNU General Public License</H2>
|
||||
|
||||
<P ALIGN="CENTER">Version 2, June 1991<BR>
|
||||
<BR>
|
||||
Copyright 1989, 1991 Free Software Foundation, Inc.<BR>
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
<P ALIGN="CENTER">Everyone is permitted to copy and distribute verbatim
|
||||
copies of this license document, but changing it is not allowed.
|
||||
|
||||
<H3>Preamble</H3>
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
<H3>GNU GENERAL PUBLIC LICENSE<BR>
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</H3>
|
||||
|
||||
<OL START="0">
|
||||
|
||||
<LI>This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
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".
|
||||
|
||||
<P>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.
|
||||
|
||||
<LI>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<LI>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:
|
||||
|
||||
<OL TYPE="a">
|
||||
|
||||
<LI>You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
<LI>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.
|
||||
|
||||
<LI>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.)
|
||||
|
||||
</OL>
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<LI>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:
|
||||
|
||||
<OL TYPE="a">
|
||||
|
||||
<LI>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,
|
||||
|
||||
<LI>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,
|
||||
|
||||
<LI>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.)
|
||||
|
||||
</OL>
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<LI>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.
|
||||
|
||||
<LI>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.
|
||||
|
||||
<LI>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.
|
||||
|
||||
<LI>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<P>This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
<LI>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.
|
||||
|
||||
<LI>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.
|
||||
|
||||
<P>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.
|
||||
|
||||
<LI>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.
|
||||
|
||||
</OL>
|
||||
|
||||
<H3>NO WARRANTY</H3>
|
||||
|
||||
<OL START="11">
|
||||
|
||||
<LI>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.
|
||||
|
||||
<LI>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.
|
||||
|
||||
</OL>
|
||||
|
||||
<H3>END OF TERMS AND CONDITIONS</H3>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
+968
@@ -0,0 +1,968 @@
|
||||
Common UNIX Printing System License Agreement
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
1 Infinite Loop
|
||||
Cupertino, CA 95014 USA
|
||||
|
||||
WWW: http://www.cups.org/
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
The Common UNIX Printing System(tm), ("CUPS(tm)"), is provided
|
||||
under the GNU General Public License ("GPL") and GNU Library
|
||||
General Public License ("LGPL"), Version 2, with exceptions for
|
||||
Apple operating systems and the OpenSSL toolkit. A copy of the
|
||||
exceptions and licenses follow this introduction.
|
||||
|
||||
The GNU LGPL applies to the CUPS and CUPS Imaging libraries
|
||||
located in the "cups" and "filter" subdirectories of the CUPS
|
||||
source distribution and in the "cups" include directory and
|
||||
library files in the binary distributions. The GNU GPL applies to
|
||||
the remainder of the CUPS distribution, including the "pdftops"
|
||||
filter which is based upon Xpdf.
|
||||
|
||||
For those not familiar with the GNU GPL, 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.
|
||||
|
||||
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 must provide source for any changes or additions
|
||||
to the software, and all code must be provided under the GPL or
|
||||
LGPL as appropriate. The only exceptions to this are the portions
|
||||
of the CUPS software covered by the Apple operating system
|
||||
license exceptions outlined later in this license agreement.
|
||||
|
||||
The GNU LGPL relaxes the "link-to" restriction, allowing you to
|
||||
develop applications that use the CUPS and CUPS Imaging libraries
|
||||
under other licenses and/or conditions as appropriate for your
|
||||
application, driver, or filter.
|
||||
|
||||
|
||||
LICENSE EXCEPTIONS
|
||||
|
||||
In addition, as the copyright holder of CUPS, Apple Inc. grants
|
||||
the following special exceptions:
|
||||
|
||||
1. Apple Operating System Development License Exception;
|
||||
|
||||
a. Software that is developed by any person or entity
|
||||
for an Apple Operating System ("Apple OS-Developed
|
||||
Software"), including but not limited to Apple and
|
||||
third party printer drivers, filters, and backends
|
||||
for an Apple Operating System, that is linked to the
|
||||
CUPS imaging library or based on any sample filters
|
||||
or backends provided with CUPS shall not be
|
||||
considered to be a derivative work or collective work
|
||||
based on the CUPS program and is exempt from the
|
||||
mandatory source code release clauses of the GNU GPL.
|
||||
You may therefore distribute linked combinations of
|
||||
the CUPS imaging library with Apple OS-Developed
|
||||
Software without releasing the source code of the
|
||||
Apple OS-Developed Software. You may also use sample
|
||||
filters and backends provided with CUPS to develop
|
||||
Apple OS-Developed Software without releasing the
|
||||
source code of the Apple OS-Developed Software.
|
||||
|
||||
b. An Apple Operating System means any operating system
|
||||
software developed and/or marketed by Apple Computer,
|
||||
Inc., including but not limited to all existing
|
||||
releases and versions of Apple's Darwin, Mac OS X,
|
||||
and Mac OS X Server products and all follow-on
|
||||
releases and future versions thereof.
|
||||
|
||||
c. This exception is only available for Apple
|
||||
OS-Developed Software and does not apply to software
|
||||
that is distributed for use on other operating
|
||||
systems.
|
||||
|
||||
d. All CUPS software that falls under this license
|
||||
exception have the following text at the top of each
|
||||
source file:
|
||||
|
||||
This file is subject to the Apple OS-Developed
|
||||
Software exception.
|
||||
|
||||
2. OpenSSL Toolkit License Exception;
|
||||
|
||||
a. Apple Inc. explicitly allows the compilation and
|
||||
distribution of the CUPS software with the OpenSSL
|
||||
Toolkit.
|
||||
|
||||
No developer is required to provide these exceptions in a
|
||||
derived work.
|
||||
|
||||
|
||||
KERBEROS SUPPORT CODE
|
||||
|
||||
The Kerberos support code ("KSC") is copyright 2006 by Jelmer
|
||||
Vernooij and is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author or Apple Inc. be held
|
||||
liable for any damages arising from the use of the KSC.
|
||||
|
||||
Sources files containing KSC have the following text at the top
|
||||
of each source file:
|
||||
|
||||
This file contains Kerberos support code, copyright 2006 by
|
||||
Jelmer Vernooij.
|
||||
|
||||
The KSC copyright and license apply only to Kerberos-related
|
||||
feature code in CUPS. Such code is typically conditionally
|
||||
compiled based on the present of the HAVE_GSSAPI preprocessor
|
||||
definition.
|
||||
|
||||
Permission is granted to anyone to use the KSC for any purpose,
|
||||
including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of the KSC must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If
|
||||
you use the KSC in a product, an acknowledgment in the
|
||||
product documentation would be appreciated but is not
|
||||
required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such,
|
||||
and must not be misrepresented as being the original
|
||||
software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
|
||||
TRADEMARKS
|
||||
|
||||
Apple Inc. has trademarked the Common UNIX Printing System, CUPS,
|
||||
and CUPS logo. You may use these names and logos in any direct port
|
||||
or binary distribution of CUPS. Please contact Apple Inc. for written
|
||||
permission to use them in derivative products. Our intention is to
|
||||
protect the value of these trademarks and ensure that any derivative
|
||||
product meets the same high-quality standards as the original.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 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
|
||||
|
||||
0. 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.
|
||||
|
||||
1. 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.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. 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.
|
||||
|
||||
4. 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.
|
||||
|
||||
5. 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.
|
||||
|
||||
6. 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.
|
||||
|
||||
7. 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.
|
||||
|
||||
8. 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.
|
||||
|
||||
9. 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.
|
||||
|
||||
10. 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
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 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.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, 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 library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, 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 companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, 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 library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete 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 distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
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.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
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 Library, 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 Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you 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.
|
||||
|
||||
If distribution of 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 satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. 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.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library 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.
|
||||
|
||||
9. 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 Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
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.
|
||||
|
||||
11. 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 Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library 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 Library.
|
||||
|
||||
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.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library 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.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library 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 Library
|
||||
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 Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
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
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "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
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. 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 LIBRARY 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
|
||||
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
-138
@@ -1,138 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Common makefile definitions for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# @configure_input@
|
||||
#
|
||||
# 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.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
|
||||
#
|
||||
|
||||
#
|
||||
# Programs...
|
||||
#
|
||||
|
||||
AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CHMOD = @CHMOD@
|
||||
CP = @CP@
|
||||
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
|
||||
|
||||
#
|
||||
# Libraries...
|
||||
#
|
||||
|
||||
LIBCUPS = @LIBCUPS@
|
||||
LIBCUPSIMAGE = @LIBCUPSIMAGE@
|
||||
LIBJPEG = @LIBJPEG@
|
||||
LIBPNG = @LIBPNG@
|
||||
LIBTIFF = @LIBTIFF@
|
||||
LIBZ = @LIBZ@
|
||||
|
||||
#
|
||||
# Program options...
|
||||
#
|
||||
# OPTIM defines the common compiler optimization/debugging options.
|
||||
# OPTIONS defines other compile-time options (currently only -dDEBUG for
|
||||
# extra debug info)
|
||||
#
|
||||
|
||||
ARFLAGS = crvs
|
||||
CFLAGS = @CFLAGS@ $(OPTIM) -I.. $(OPTIONS)
|
||||
DSOLIBS = @DSOLIBS@
|
||||
IMGLIBS = @IMGLIBS@ -lm
|
||||
LDFLAGS = @LDFLAGS@ $(OPTIM)
|
||||
LIBS = -L../cups -lcups $(NETLIBS) @LIBS@
|
||||
NETLIBS = @NETLIBS@
|
||||
OPTIM = @OPTIM@
|
||||
OPTIONS =
|
||||
|
||||
#
|
||||
# Formatted man page extension...
|
||||
#
|
||||
|
||||
CAT = @CAT@
|
||||
|
||||
#
|
||||
# Directories...
|
||||
#
|
||||
# The first section uses the GNU names (which are *extremely*
|
||||
# difficult to find in a makefile because they are lowercase...)
|
||||
# We have to define these first because autoconf uses ${prefix}
|
||||
# and ${exec_prefix} for most of the other directories...
|
||||
#
|
||||
# This is immediately followed by definition in ALL CAPS for the
|
||||
# needed directories...
|
||||
#
|
||||
|
||||
bindir = @bindir@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
BINDIR = @bindir@
|
||||
DATADIR = @CUPS_DATADIR@
|
||||
INCLUDEDIR = $(includedir)
|
||||
LIBDIR = $(libdir)
|
||||
LOCALEDIR = @CUPS_LOCALEDIR@
|
||||
MANDIR = @mandir@
|
||||
SBINDIR = @sbindir@
|
||||
SERVERROOT = @CUPS_SERVERROOT@
|
||||
|
||||
#
|
||||
# Rules...
|
||||
#
|
||||
|
||||
.SILENT:
|
||||
.SUFFIXES: .a .c .gz .h .o .z .1 .5 .8
|
||||
.c.o:
|
||||
echo Compiling $<...
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
.1.z .5.z .8.z .1.gz .5.gz .8.gz:
|
||||
echo Formatting $<...
|
||||
$(NROFF) -man $< >t
|
||||
$(PACK) t
|
||||
-mv t.$(CAT) $@
|
||||
|
||||
#
|
||||
# End of "$Id$"
|
||||
#
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Top-level Makefile 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.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
|
||||
#
|
||||
|
||||
include Makedefs
|
||||
|
||||
#
|
||||
# Directories to make...
|
||||
#
|
||||
|
||||
DIRS = cups backend berkeley cgi-bin filter man pstoraster \
|
||||
scheduler systemv
|
||||
|
||||
#
|
||||
# Make all targets...
|
||||
#
|
||||
|
||||
all:
|
||||
for dir in $(DIRS); do\
|
||||
echo Making all in $$dir... ;\
|
||||
(cd $$dir; make);\
|
||||
done
|
||||
|
||||
#
|
||||
# Remove object and target files...
|
||||
#
|
||||
|
||||
clean:
|
||||
for dir in $(DIRS); do\
|
||||
echo Cleaning in $$dir... ;\
|
||||
(cd $$dir; make clean);\
|
||||
done
|
||||
|
||||
#
|
||||
# Install object and target files...
|
||||
#
|
||||
|
||||
install:
|
||||
for dir in $(DIRS); do\
|
||||
echo Installing in $$dir... ;\
|
||||
(cd $$dir; make install);\
|
||||
done
|
||||
echo Installing in conf...
|
||||
(cd conf; make install)
|
||||
echo Installing in data...
|
||||
(cd data; make install)
|
||||
echo Installing in doc...
|
||||
(cd doc; make install)
|
||||
echo Installing in fonts...
|
||||
(cd fonts; make install)
|
||||
echo Installing in ppd...
|
||||
(cd ppd; make install)
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
+25
-188
@@ -1,200 +1,37 @@
|
||||
README - CUPS v1.0.2 - 11/04/1999
|
||||
---------------------------------
|
||||
README.txt - 2016-03-15
|
||||
-----------------------
|
||||
|
||||
INTRODUCTION
|
||||
This directory contains an automated build and test environment for CUPS.
|
||||
|
||||
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)
|
||||
and AppSocket protocols are also supported with reduced functionality.
|
||||
ENVIRONMENT
|
||||
|
||||
CUPS adds network printer browsing and PostScript Printer Description
|
||||
("PPD")-based printing options to support real world applications under
|
||||
UNIX.
|
||||
If present, the buildtest.env file sets additional shell variables for the
|
||||
build and test scripts described below. The following variables are
|
||||
currently supported:
|
||||
|
||||
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.
|
||||
BUILDOPTIONS - Configure options that are passed to each target
|
||||
BUILDNOTIFY - An email address or URL that specifies where the
|
||||
build log should be sent.
|
||||
BUILDSUBJECT - A string to include in the subject (default is empty
|
||||
string)
|
||||
|
||||
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.
|
||||
|
||||
SCRIPTS
|
||||
|
||||
SYSTEM REQUIREMENTS
|
||||
The build.sh script builds the current stable branch of CUPS along with
|
||||
master ("latest"), running "make check" in each. Normally you will run the
|
||||
script via a cron job:
|
||||
|
||||
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.
|
||||
0 0 * * 0 /path/to/build.sh --update --quiet clean all
|
||||
0 0 * * 1-6 /path/to/build.sh --update --quiet
|
||||
|
||||
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".
|
||||
The "--update" option tells build.sh to do an "git pull" prior to building.
|
||||
|
||||
The "--quiet" option tells build.sh to work quietly and optionally send the
|
||||
build log via email or HTTP POST for recording, automated processing, etc.
|
||||
|
||||
SOFTWARE REQUIREMENTS
|
||||
|
||||
The following operating system software is required to install one of
|
||||
the binary distributions from Easy Software Products:
|
||||
|
||||
- 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)
|
||||
|
||||
|
||||
INSTALLING 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:
|
||||
|
||||
http://www.easysw.com/epm
|
||||
|
||||
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.
|
||||
|
||||
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:
|
||||
|
||||
./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 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.
|
||||
|
||||
|
||||
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 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
|
||||
|
||||
Voice: +1.301.373.9603
|
||||
Email: cups-info@cups.org
|
||||
WWW: http://www.cups.org
|
||||
The "clean" and "all" options specify build targets; the default target is
|
||||
"all". In the example above, the first line tells cron to run the script at
|
||||
midnight each day; Sunday (day 0) also does a clean build, while every other
|
||||
day only builds files that have changed.
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Backend makefile 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.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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
TARGETS = betest ipp lpd parallel serial socket
|
||||
OBJS = betest.o ipp.o lpd.o parallel.o serial.o socket.o
|
||||
|
||||
#
|
||||
# Make all targets...
|
||||
#
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
#
|
||||
# Clean all object files...
|
||||
#
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(TARGETS)
|
||||
|
||||
#
|
||||
# Install all targets...
|
||||
#
|
||||
|
||||
install:
|
||||
-$(MKDIR) $(SERVERROOT)/backend
|
||||
$(CP) $(TARGETS) $(SERVERROOT)/backend
|
||||
-$(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
|
||||
#
|
||||
|
||||
ipp: ipp.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o ipp ipp.o $(LIBS)
|
||||
-$(LN) ipp http
|
||||
|
||||
ipp.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# lpd
|
||||
#
|
||||
|
||||
lpd: lpd.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpd lpd.o $(LIBS)
|
||||
|
||||
lpd.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# parallel
|
||||
#
|
||||
|
||||
parallel: parallel.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o parallel parallel.o $(LIBS)
|
||||
|
||||
parallel.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# serial
|
||||
#
|
||||
|
||||
serial: serial.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o serial serial.o $(LIBS)
|
||||
|
||||
serial.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# socket
|
||||
#
|
||||
|
||||
socket: socket.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o socket socket.o $(LIBS)
|
||||
|
||||
socket.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* "$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$".
|
||||
*/
|
||||
-436
@@ -1,436 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* IPP backend 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() - Send a file to the printer or server.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
#include <cups/string.h>
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the printer or server.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* printer-uri job-id user title copies options [file]
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int n, n2; /* Attribute values */
|
||||
char *option, /* Name of option */
|
||||
*val, /* Pointer to option value */
|
||||
*s; /* Pointer into option value */
|
||||
int num_options; /* Number of printer options */
|
||||
cups_option_t *options; /* Printer options */
|
||||
char method[255], /* Method in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
filename[1024]; /* File to print */
|
||||
int port; /* Port number (not used) */
|
||||
char password[255], /* Password info */
|
||||
uri[HTTP_MAX_URI];/* Updated URI without user/pass */
|
||||
http_status_t status; /* Status of HTTP job */
|
||||
FILE *fp; /* File to print */
|
||||
http_t *http; /* HTTP connection */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *job_id; /* job-id attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
struct stat fileinfo; /* File statistics */
|
||||
size_t nbytes, /* Number of bytes written */
|
||||
tbytes; /* Total bytes written */
|
||||
char buffer[8192]; /* Output buffer */
|
||||
|
||||
|
||||
if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, print stdin...
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
fp = stdin;
|
||||
else if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
perror("ERROR: Unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
stat(argv[6], &fileinfo);
|
||||
|
||||
/*
|
||||
* Extract the hostname and printer name from the URI...
|
||||
*/
|
||||
|
||||
httpSeparate(argv[0], method, username, hostname, &port, resource);
|
||||
|
||||
/*
|
||||
* Try connecting to the remote server...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "INFO: Connecting to %s...\n", hostname);
|
||||
|
||||
if ((http = httpConnect(hostname, port)) == NULL)
|
||||
{
|
||||
perror("ERROR: Unable to connect to IPP host");
|
||||
|
||||
if (fp != stdin)
|
||||
fclose(fp);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Build a URI for the printer and fill the standard IPP attributes for
|
||||
* an IPP_PRINT_FILE request. We can't use the URI in argv[0] because it
|
||||
* might contain username:password information...
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
request->request.op.operation_id = IPP_PRINT_JOB;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL,
|
||||
language != 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);
|
||||
|
||||
fprintf(stderr, "DEBUG: printer-uri = \"%s\"\n", uri);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, argv[2]);
|
||||
|
||||
fprintf(stderr, "DEBUG: requesting-user-name = \"%s\"\n", argv[2]);
|
||||
|
||||
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...
|
||||
*/
|
||||
|
||||
options = NULL;
|
||||
num_options = cupsParseOptions(argv[5], 0, &options);
|
||||
|
||||
if (cupsGetOption("raw", num_options, options))
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
|
||||
NULL, "application/vnd.cups-raw");
|
||||
else
|
||||
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 (strcasecmp(options[i].name, "raw") == 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* See what the option value is; for compatibility with older interface
|
||||
* scripts, we have to support single-argument options as well as
|
||||
* option=value, option=low-high, and option=MxN.
|
||||
*/
|
||||
|
||||
option = options[i].name;
|
||||
val = options[i].value;
|
||||
|
||||
if (*val == '\0')
|
||||
val = NULL;
|
||||
|
||||
if (val != NULL)
|
||||
{
|
||||
if (strcasecmp(val, "true") == 0 ||
|
||||
strcasecmp(val, "on") == 0 ||
|
||||
strcasecmp(val, "yes") == 0)
|
||||
{
|
||||
/*
|
||||
* Boolean value - true...
|
||||
*/
|
||||
|
||||
n = 1;
|
||||
val = "";
|
||||
}
|
||||
else if (strcasecmp(val, "false") == 0 ||
|
||||
strcasecmp(val, "off") == 0 ||
|
||||
strcasecmp(val, "no") == 0)
|
||||
{
|
||||
/*
|
||||
* Boolean value - false...
|
||||
*/
|
||||
|
||||
n = 0;
|
||||
val = "";
|
||||
}
|
||||
|
||||
n = strtol(val, &s, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strncasecmp(option, "no", 2) == 0)
|
||||
{
|
||||
option += 2;
|
||||
n = 0;
|
||||
}
|
||||
else
|
||||
n = 1;
|
||||
|
||||
s = "";
|
||||
}
|
||||
|
||||
if (*s != '\0' && *s != '-' && (*s != 'x' || s == val))
|
||||
/*
|
||||
* String value(s)...
|
||||
*/
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, option, NULL, val);
|
||||
else if (val != NULL)
|
||||
{
|
||||
/*
|
||||
* Numeric value, range, or resolution...
|
||||
*/
|
||||
|
||||
if (*s == '-')
|
||||
{
|
||||
n2 = strtol(s + 1, NULL, 0);
|
||||
ippAddRange(request, IPP_TAG_JOB, option, n, n2);
|
||||
}
|
||||
else if (*s == 'x')
|
||||
{
|
||||
n2 = strtol(s + 1, &s, 0);
|
||||
|
||||
if (strcasecmp(s, "dpc") == 0)
|
||||
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_CM, n, n2);
|
||||
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);
|
||||
}
|
||||
else
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, option, n);
|
||||
}
|
||||
else
|
||||
/*
|
||||
* Boolean value...
|
||||
*/
|
||||
ippAddBoolean(request, IPP_TAG_JOB, option, (char)n);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now fill in the HTTP request stuff...
|
||||
*/
|
||||
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
|
||||
if (username[0])
|
||||
{
|
||||
httpEncode64(password, username);
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
|
||||
}
|
||||
|
||||
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...
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/*
|
||||
* POST the request, retrying as needed...
|
||||
*/
|
||||
|
||||
if (httpPost(http, resource))
|
||||
{
|
||||
fputs("INFO: Unable to POST print request; retrying...\n", stderr);
|
||||
sleep(10);
|
||||
httpReconnect(http);
|
||||
continue;
|
||||
}
|
||||
|
||||
fputs("INFO: POST successful, sending IPP request...\n", stderr);
|
||||
|
||||
/*
|
||||
* Send the IPP request...
|
||||
*/
|
||||
|
||||
request->state = IPP_IDLE;
|
||||
|
||||
if (ippWrite(http, request) == IPP_ERROR)
|
||||
{
|
||||
fputs("ERROR: Unable to send IPP request!\n", stderr);
|
||||
status = HTTP_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
fputs("INFO: IPP request sent, sending print file...\n", stderr);
|
||||
|
||||
/*
|
||||
* Then send the file...
|
||||
*/
|
||||
|
||||
tbytes = 0;
|
||||
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
|
||||
{
|
||||
tbytes += nbytes;
|
||||
fprintf(stderr, "INFO: Sending print file, %uk...\n", tbytes / 1024);
|
||||
|
||||
if (httpWrite(http, buffer, nbytes) < nbytes)
|
||||
{
|
||||
perror("ERROR: Unable to send print file to printer");
|
||||
status = HTTP_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
/*
|
||||
* Finally, check the status from the HTTP server...
|
||||
*/
|
||||
|
||||
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
|
||||
|
||||
if (status == HTTP_OK)
|
||||
{
|
||||
response = ippNew();
|
||||
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
|
||||
fprintf(stderr, "INFO: Print file accepted - job ID %d.\n",
|
||||
job_id->values[0].integer);
|
||||
}
|
||||
else
|
||||
{
|
||||
response = NULL;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free memory...
|
||||
*/
|
||||
|
||||
httpClose(http);
|
||||
if (request != NULL)
|
||||
ippDelete(request);
|
||||
if (response != NULL)
|
||||
ippDelete(response);
|
||||
|
||||
/*
|
||||
* Close the print file as needed...
|
||||
*/
|
||||
|
||||
if (fp != stdin)
|
||||
{
|
||||
if (status == HTTP_OK)
|
||||
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the queue status...
|
||||
*/
|
||||
|
||||
return (status != HTTP_OK);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-408
@@ -1,408 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Line Printer Daemon backend 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() - Send a file to the printer or server.
|
||||
* lpd_command() - Send an LPR command sequence and wait for a reply.
|
||||
* lpd_queue() - Queue a file using the Line Printer Daemon protocol.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <cups/string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <winsock.h>
|
||||
#else
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <netdb.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
extern int rresvport(int *port); /* Hello? No prototype for this... */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int lpd_command(int lpd_fd, char *format, ...);
|
||||
static int lpd_queue(char *hostname, char *printer, char *filename,
|
||||
char *user, int copies);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the printer or server.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* printer-uri job-id user title copies options [file]
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
char method[255], /* Method in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
filename[1024]; /* File to print */
|
||||
int port; /* Port number (not used) */
|
||||
int status; /* Status of LPD job */
|
||||
|
||||
|
||||
if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, copy stdin to a temporary file and print the temporary
|
||||
* file.
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
/*
|
||||
* Copy stdin to a temporary file...
|
||||
*/
|
||||
|
||||
FILE *fp; /* Temporary file */
|
||||
char buffer[8192]; /* Buffer for copying */
|
||||
int bytes; /* Number of bytes read */
|
||||
|
||||
|
||||
if ((fp = fopen(cupsTempFile(filename, sizeof(filename)), "w")) == NULL)
|
||||
{
|
||||
perror("ERROR: unable to create temporary file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
|
||||
if (fwrite(buffer, 1, bytes, fp) < bytes)
|
||||
{
|
||||
perror("ERROR: unable to write to temporary file");
|
||||
fclose(fp);
|
||||
unlink(filename);
|
||||
return (1);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(filename, argv[6], sizeof(filename) - 1);
|
||||
filename[sizeof(filename) - 1] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the hostname and printer name from the URI...
|
||||
*/
|
||||
|
||||
httpSeparate(argv[0], method, username, hostname, &port, resource);
|
||||
|
||||
/*
|
||||
* Queue the job...
|
||||
*/
|
||||
|
||||
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...
|
||||
*/
|
||||
|
||||
if (argc < 7)
|
||||
unlink(filename);
|
||||
|
||||
/*
|
||||
* Return the queue status...
|
||||
*/
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'lpd_command()' - Send an LPR command sequence and wait for a reply.
|
||||
*/
|
||||
|
||||
static int /* O - Status of command */
|
||||
lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
char *format, /* I - printf()-style format string */
|
||||
...) /* I - Additional args as necessary */
|
||||
{
|
||||
va_list ap; /* Argument pointer */
|
||||
char buf[1024]; /* Output buffer */
|
||||
int bytes; /* Number of bytes to output */
|
||||
char status; /* Status from command */
|
||||
|
||||
|
||||
/*
|
||||
* Format the string...
|
||||
*/
|
||||
|
||||
va_start(ap, format);
|
||||
bytes = vsnprintf(buf, sizeof(buf), format, ap);
|
||||
va_end(ap);
|
||||
|
||||
fprintf(stderr, "DEBUG: lpd_command %02.2x %s", buf[0], buf + 1);
|
||||
|
||||
/*
|
||||
* Send the command...
|
||||
*/
|
||||
|
||||
if (send(fd, buf, bytes, 0) < bytes)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Read back the status from the command and return it...
|
||||
*/
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
return (-1);
|
||||
|
||||
fprintf(stderr, "DEBUG: lpd_command returning %d\n", status);
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'lpd_queue()' - Queue a file using the Line Printer Daemon protocol.
|
||||
*/
|
||||
|
||||
static int /* O - Zero on success, non-zero on failure */
|
||||
lpd_queue(char *hostname, /* I - Host to connect to */
|
||||
char *printer, /* I - Printer/queue name */
|
||||
char *filename, /* I - File to print */
|
||||
char *user, /* I - Requesting user */
|
||||
int copies) /* I - Number of copies */
|
||||
{
|
||||
FILE *fp; /* Job file */
|
||||
char localhost[255]; /* Local host name */
|
||||
int error; /* Error number */
|
||||
struct stat filestats; /* File statistics */
|
||||
int port; /* LPD connection port */
|
||||
int fd; /* LPD socket */
|
||||
char control[10240], /* LPD control 'file' */
|
||||
*cptr; /* Pointer into control file string */
|
||||
char status; /* Status byte from command */
|
||||
struct sockaddr_in addr; /* Socket address */
|
||||
struct hostent *hostaddr; /* Host address */
|
||||
size_t nbytes, /* Number of bytes written */
|
||||
tbytes; /* Total bytes written */
|
||||
char buffer[8192]; /* Output buffer */
|
||||
|
||||
|
||||
/*
|
||||
* First try to reserve a port for this connection...
|
||||
*/
|
||||
|
||||
if ((hostaddr = gethostbyname(hostname)) == NULL)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to locate printer \'%s\' - %s",
|
||||
hostname, strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
|
||||
fprintf(stderr, "INFO: Attempting to connect to host %s for printer %s\n",
|
||||
hostname, printer);
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
memcpy(&(addr.sin_addr), hostaddr->h_addr, hostaddr->h_length);
|
||||
addr.sin_family = hostaddr->h_addrtype;
|
||||
addr.sin_port = htons(515); /* LPD/printer service */
|
||||
|
||||
for (port = 732;;)
|
||||
{
|
||||
if ((fd = rresvport(&port)) < 0)
|
||||
{
|
||||
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...",
|
||||
hostname);
|
||||
sleep(30);
|
||||
}
|
||||
else if (error == EADDRINUSE)
|
||||
{
|
||||
port --;
|
||||
if (port < 721)
|
||||
port = 732;
|
||||
}
|
||||
else
|
||||
{
|
||||
perror("ERROR: Unable to connect to printer");
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Next, open the print file and figure out its size...
|
||||
*/
|
||||
|
||||
if (stat(filename, &filestats))
|
||||
{
|
||||
perror("ERROR: unable to stat print file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
if ((fp = fopen(filename, "rb")) == NULL)
|
||||
{
|
||||
perror("ERROR: unable to open print file for reading");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Send a job header to the printer, specifying no banner page and
|
||||
* literal output...
|
||||
*/
|
||||
|
||||
lpd_command(fd, "\002%s\n", printer); /* Receive print job(s) */
|
||||
|
||||
gethostname(localhost, sizeof(localhost));
|
||||
localhost[31] = '\0'; /* RFC 1179, Section 7.2 - host name < 32 chars */
|
||||
|
||||
snprintf(control, sizeof(control), "H%s\nP%s\n", localhost, user);
|
||||
cptr = control + strlen(control);
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
|
||||
snprintf(cptr, sizeof(control) - (cptr - control), "ldfA%03.3d%s\n",
|
||||
getpid() % 1000, localhost);
|
||||
cptr += strlen(cptr);
|
||||
copies --;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
lpd_command(fd, "\002%d cfA%03.3d%s\n", strlen(control), getpid() % 1000,
|
||||
localhost);
|
||||
|
||||
fprintf(stderr, "INFO: Sending control file (%d bytes)\n", strlen(control));
|
||||
|
||||
if (send(fd, control, strlen(control) + 1, 0) < (strlen(control) + 1))
|
||||
{
|
||||
perror("ERROR: Unable to write control file");
|
||||
status = 1;
|
||||
}
|
||||
else if (read(fd, &status, 1) < 1 || status != 0)
|
||||
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
|
||||
status);
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Send the print file...
|
||||
*/
|
||||
|
||||
fputs("INFO: Control file sent successfully\n", stderr);
|
||||
|
||||
lpd_command(fd, "\003%u dfA%03.3d%s\n", (unsigned)filestats.st_size,
|
||||
getpid() % 1000, localhost);
|
||||
|
||||
fprintf(stderr, "INFO: Sending data file (%u bytes)\n",
|
||||
(unsigned)filestats.st_size);
|
||||
|
||||
tbytes = 0;
|
||||
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
|
||||
{
|
||||
fprintf(stderr, "INFO: Spooling LPR job, %u%% complete...\n",
|
||||
(unsigned)(100 * tbytes / filestats.st_size));
|
||||
|
||||
if (send(fd, buffer, nbytes, 0) < nbytes)
|
||||
{
|
||||
perror("ERROR: Unable to send print file to printer");
|
||||
break;
|
||||
}
|
||||
else
|
||||
tbytes += nbytes;
|
||||
}
|
||||
|
||||
send(fd, "", 1, 0);
|
||||
|
||||
if (tbytes < filestats.st_size)
|
||||
status = 1;
|
||||
else if (recv(fd, &status, 1, 0) < 1 || status != 0)
|
||||
fprintf(stderr, "ERROR: Remote host did not accept data file (%d)\n",
|
||||
status);
|
||||
else
|
||||
fputs("INFO: Data file sent successfully\n", stderr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the socket connection and input file and return...
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
fclose(fp);
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Parallel port backend 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() - Send a file to the specified parallel port.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cups/string.h>
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# include <termios.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the specified parallel port.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* printer-uri job-id user title copies options [file]
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
char method[255], /* Method in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
*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 */
|
||||
tbytes; /* Total number of bytes written */
|
||||
char buffer[8192]; /* Output buffer */
|
||||
struct termios opts; /* Parallel port options */
|
||||
|
||||
|
||||
if (argc < 6 || argc > 7)
|
||||
{
|
||||
fputs("Usage: parallel job-id user title copies options [file]\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, send stdin instead...
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
fp = stdin;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the device name and options from the URI...
|
||||
*/
|
||||
|
||||
httpSeparate(argv[0], method, username, hostname, &port, resource);
|
||||
|
||||
/*
|
||||
* See if there are any options...
|
||||
*/
|
||||
|
||||
if ((options = strchr(resource, '?')) != NULL)
|
||||
{
|
||||
/*
|
||||
* Yup, terminate the device name string and move to the first
|
||||
* character of the options...
|
||||
*/
|
||||
|
||||
*options++ = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the parallel port device...
|
||||
*/
|
||||
|
||||
if ((fd = open(resource, O_WRONLY)) == -1)
|
||||
{
|
||||
perror("ERROR: Unable to open parallel port device file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set any options provided...
|
||||
*/
|
||||
|
||||
tcgetattr(fd, &opts);
|
||||
|
||||
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
|
||||
|
||||
/**** No options supported yet ****/
|
||||
|
||||
tcsetattr(fd, TCSANOW, &opts);
|
||||
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (fp != stdin)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
rewind(fp);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the socket connection and input file and return...
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
if (fp != stdin)
|
||||
fclose(fp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,314 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Serial port backend 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() - Send a file to the printer or server.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cups/string.h>
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# include <termios.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the printer or server.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* printer-uri job-id user title copies options [file]
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
char method[255], /* Method in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
*options, /* Pointer to options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*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 */
|
||||
tbytes; /* Total number of bytes written */
|
||||
char buffer[8192]; /* Output buffer */
|
||||
struct termios opts; /* Parallel port options */
|
||||
|
||||
|
||||
if (argc < 6 || argc > 7)
|
||||
{
|
||||
fputs("Usage: serial job-id user title copies options [file]\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, send stdin instead...
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
fp = stdin;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the device name and options from the URI...
|
||||
*/
|
||||
|
||||
httpSeparate(argv[0], method, username, hostname, &port, resource);
|
||||
|
||||
/*
|
||||
* See if there are any options...
|
||||
*/
|
||||
|
||||
if ((options = strchr(resource, '?')) != NULL)
|
||||
{
|
||||
/*
|
||||
* Yup, terminate the device name string and move to the first
|
||||
* character of the options...
|
||||
*/
|
||||
|
||||
*options++ = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the parallel port device...
|
||||
*/
|
||||
|
||||
if ((fd = open(resource, O_WRONLY)) == -1)
|
||||
{
|
||||
perror("ERROR: Unable to open serial port device file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set any options provided...
|
||||
*/
|
||||
|
||||
tcgetattr(fd, &opts);
|
||||
|
||||
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
|
||||
|
||||
if (options != NULL)
|
||||
while (*options)
|
||||
{
|
||||
/*
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
|
||||
for (ptr = value; *options && *options != '+';)
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+')
|
||||
options ++;
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
*/
|
||||
|
||||
if (strcasecmp(name, "baud") == 0)
|
||||
{
|
||||
/*
|
||||
* Set the baud rate...
|
||||
*/
|
||||
|
||||
#if B19200 == 19200
|
||||
cfsetispeed(&opts, atoi(value));
|
||||
cfsetospeed(&opts, atoi(value));
|
||||
#else
|
||||
switch (atoi(value))
|
||||
{
|
||||
case 1200 :
|
||||
cfsetispeed(&opts, B1200);
|
||||
cfsetospeed(&opts, B1200);
|
||||
break;
|
||||
case 2400 :
|
||||
cfsetispeed(&opts, B2400);
|
||||
cfsetospeed(&opts, B2400);
|
||||
break;
|
||||
case 4800 :
|
||||
cfsetispeed(&opts, B4800);
|
||||
cfsetospeed(&opts, B4800);
|
||||
break;
|
||||
case 9600 :
|
||||
cfsetispeed(&opts, B9600);
|
||||
cfsetospeed(&opts, B9600);
|
||||
break;
|
||||
case 19200 :
|
||||
cfsetispeed(&opts, B19200);
|
||||
cfsetospeed(&opts, B19200);
|
||||
break;
|
||||
case 38400 :
|
||||
cfsetispeed(&opts, B38400);
|
||||
cfsetospeed(&opts, B38400);
|
||||
break;
|
||||
default :
|
||||
fprintf(stderr, "WARNING: Unsupported baud rate %s!\n", value);
|
||||
break;
|
||||
}
|
||||
#endif /* B19200 == 19200 */
|
||||
}
|
||||
else if (strcasecmp(name, "bits") == 0)
|
||||
{
|
||||
/*
|
||||
* Set number of data bits...
|
||||
*/
|
||||
|
||||
switch (atoi(value))
|
||||
{
|
||||
case 7 :
|
||||
opts.c_cflag &= ~CSIZE;
|
||||
opts.c_cflag |= CS7;
|
||||
opts.c_cflag |= PARENB;
|
||||
opts.c_cflag &= ~PARODD;
|
||||
break;
|
||||
case 8 :
|
||||
opts.c_cflag &= ~CSIZE;
|
||||
opts.c_cflag |= CS8;
|
||||
opts.c_cflag &= ~PARENB;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(name, "parity") == 0)
|
||||
{
|
||||
/*
|
||||
* Set parity checking...
|
||||
*/
|
||||
|
||||
if (strcasecmp(value, "even") == 0)
|
||||
{
|
||||
opts.c_cflag |= PARENB;
|
||||
opts.c_cflag &= ~PARODD;
|
||||
}
|
||||
else if (strcasecmp(value, "odd") == 0)
|
||||
{
|
||||
opts.c_cflag |= PARENB;
|
||||
opts.c_cflag |= PARODD;
|
||||
}
|
||||
else if (strcasecmp(value, "none") == 0)
|
||||
opts.c_cflag &= ~PARENB;
|
||||
}
|
||||
}
|
||||
|
||||
tcsetattr(fd, TCSANOW, &opts);
|
||||
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (fp != stdin)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
rewind(fp);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the socket connection and input file and return...
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
if (fp != stdin)
|
||||
fclose(fp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,254 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* AppSocket backend 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() - Send a file to the printer or server.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <cups/string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <winsock.h>
|
||||
#else
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <netdb.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the printer or server.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* printer-uri job-id user title copies options [file]
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
char method[255], /* Method in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
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) */
|
||||
struct sockaddr_in addr; /* Socket address */
|
||||
struct hostent *hostaddr; /* Host address */
|
||||
int wbytes; /* Number of bytes written */
|
||||
size_t nbytes, /* Number of bytes read */
|
||||
tbytes; /* Total number of bytes written */
|
||||
char buffer[8192], /* Output buffer */
|
||||
*bufptr; /* Pointer into buffer */
|
||||
struct timeval timeout; /* Timeout for select() */
|
||||
fd_set input; /* Input set for select() */
|
||||
|
||||
|
||||
if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, send stdin instead...
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
fp = stdin;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the hostname and port number from the URI...
|
||||
*/
|
||||
|
||||
httpSeparate(argv[0], method, username, hostname, &port, resource);
|
||||
|
||||
if (port == 0)
|
||||
port = 9100; /* Default to HP JetDirect/Tektronix PhaserShare */
|
||||
|
||||
/*
|
||||
* Then try to connect to the remote host...
|
||||
*/
|
||||
|
||||
if ((hostaddr = gethostbyname(hostname)) == NULL)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to locate printer \'%s\' - %s",
|
||||
hostname, strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
|
||||
fprintf(stderr, "INFO: Attempting to connect to host %s on port %d\n",
|
||||
hostname, port);
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
memcpy(&(addr.sin_addr), hostaddr->h_addr, hostaddr->h_length);
|
||||
addr.sin_family = hostaddr->h_addrtype;
|
||||
addr.sin_port = htons(port);
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
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
|
||||
{
|
||||
perror("ERROR: Unable to connect to printer");
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
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)
|
||||
{
|
||||
/*
|
||||
* Write the print data to the printer...
|
||||
*/
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the socket connection...
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the input file and return...
|
||||
*/
|
||||
|
||||
if (fp != stdin)
|
||||
fclose(fp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,95 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Berkeley commands makefile 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.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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
TARGETS = lpc lpq lpr lprm
|
||||
OBJS = lpc.o lpq.o lpr.o lprm.o
|
||||
|
||||
#
|
||||
# Make all targets...
|
||||
#
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
#
|
||||
# Clean all object files...
|
||||
#
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(TARGETS)
|
||||
|
||||
#
|
||||
# Install all targets...
|
||||
#
|
||||
|
||||
install:
|
||||
-$(MKDIR) $(BINDIR)
|
||||
-$(MKDIR) $(SBINDIR)
|
||||
$(CP) lpq lpr lprm $(BINDIR)
|
||||
$(CP) lpc $(SBINDIR)
|
||||
|
||||
#
|
||||
# lpc
|
||||
#
|
||||
|
||||
lpc: lpc.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
|
||||
|
||||
lpc.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# lpq
|
||||
#
|
||||
|
||||
lpq: lpq.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
|
||||
|
||||
lpq.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# lpr
|
||||
#
|
||||
|
||||
lpr: lpr.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
|
||||
|
||||
lpr.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# lprm
|
||||
#
|
||||
|
||||
lprm: lprm.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
|
||||
|
||||
lprm.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
@@ -1,467 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* "lpc" command 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:
|
||||
*
|
||||
* main() - Parse options and commands.
|
||||
* compare_strings() - Compare two command-line strings.
|
||||
* do_command() - Do an lpc command...
|
||||
* show_help() - Show help messages.
|
||||
* show_status() - Show printers.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
#include <cups/debug.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int compare_strings(char *, char *, int);
|
||||
static void do_command(http_t *, char *, char *);
|
||||
static void show_help(char *);
|
||||
static void show_status(http_t *, char *);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Parse options and commands.
|
||||
*/
|
||||
|
||||
int
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
http_t *http; /* Connection to server */
|
||||
char line[1024], /* Input line from user */
|
||||
*params; /* Pointer to parameters */
|
||||
|
||||
|
||||
/*
|
||||
* Connect to the scheduler...
|
||||
*/
|
||||
|
||||
http = httpConnect(cupsServer(), ippPort());
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
/*
|
||||
* Process a single command on the command-line...
|
||||
*/
|
||||
|
||||
do_command(http, argv[1], argv[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Do the command prompt thing...
|
||||
*/
|
||||
|
||||
printf("lpc> ");
|
||||
while (fgets(line, sizeof(line), stdin) != NULL)
|
||||
{
|
||||
/*
|
||||
* Strip the trailing newline...
|
||||
*/
|
||||
|
||||
line[strlen(line) - 1] = '\0';
|
||||
|
||||
/*
|
||||
* Find any options in the string...
|
||||
*/
|
||||
|
||||
while (isspace(line[0]))
|
||||
strcpy(line, line + 1);
|
||||
|
||||
for (params = line; *params != '\0'; params ++)
|
||||
if (isspace(*params))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Remove whitespace between the command and parameters...
|
||||
*/
|
||||
|
||||
while (isspace(*params))
|
||||
*params++ = '\0';
|
||||
|
||||
/*
|
||||
* The "quit" and "exit" commands exit; otherwise, process as needed...
|
||||
*/
|
||||
|
||||
if (compare_strings(line, "quit", 1) == 0 ||
|
||||
compare_strings(line, "exit", 2) == 0)
|
||||
break;
|
||||
|
||||
if (*params == '\0')
|
||||
do_command(http, line, NULL);
|
||||
else
|
||||
do_command(http, line, params);
|
||||
|
||||
/*
|
||||
* Put another prompt out to the user...
|
||||
*/
|
||||
|
||||
printf("lpc> ");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the connection to the server and return...
|
||||
*/
|
||||
|
||||
httpClose(http);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'compare_strings()' - Compare two command-line strings.
|
||||
*/
|
||||
|
||||
static int /* O - -1 or 1 = no match, 0 = match */
|
||||
compare_strings(char *s, /* I - Command-line string */
|
||||
char *t, /* I - Option string */
|
||||
int tmin) /* I - Minimum number of unique chars in option */
|
||||
{
|
||||
int slen; /* Length of command-line string */
|
||||
|
||||
|
||||
slen = strlen(s);
|
||||
if (slen < tmin)
|
||||
return (-1);
|
||||
else
|
||||
return (strncmp(s, t, slen));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'do_command()' - Do an lpc command...
|
||||
*/
|
||||
|
||||
static void
|
||||
do_command(http_t *http, /* I - HTTP connection to server */
|
||||
char *command, /* I - Command string */
|
||||
char *params) /* I - Parameters for command */
|
||||
{
|
||||
if (compare_strings(command, "status", 4) == 0)
|
||||
show_status(http, params);
|
||||
else if (compare_strings(command, "help", 1) == 0 ||
|
||||
strcmp(command, "?") == 0)
|
||||
show_help(params);
|
||||
else
|
||||
puts("?Invalid command");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_help()' - Show help messages.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_help(char *command) /* I - Command to describe or NULL */
|
||||
{
|
||||
if (command == NULL)
|
||||
{
|
||||
puts("Commands may be abbreviated. Commands are:");
|
||||
puts("");
|
||||
puts("exit help quit status ?");
|
||||
}
|
||||
else if (compare_strings(command, "help", 1) == 0 ||
|
||||
strcmp(command, "?") == 0)
|
||||
puts("help\t\tget help on commands");
|
||||
else if (compare_strings(command, "status", 4) == 0)
|
||||
puts("status\t\tshow status of daemon and queue");
|
||||
else
|
||||
puts("?Invalid help command unknown");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_status()' - Show printers.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_status(http_t *http, /* I - HTTP connection to server */
|
||||
char *dests) /* I - Destinations */
|
||||
{
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response, /* IPP Response */
|
||||
*jobs; /* IPP Get Jobs response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char *printer, /* Printer name */
|
||||
*device; /* Device URI */
|
||||
ipp_pstate_t pstate; /* Printer state */
|
||||
int accepting; /* Is printer accepting jobs? */
|
||||
int jobcount; /* Count of current jobs */
|
||||
char *dptr, /* Pointer into destination list */
|
||||
*ptr; /* Pointer into printer name */
|
||||
int match; /* Non-zero if this job matches */
|
||||
char printer_uri[HTTP_MAX_URI];
|
||||
/* Printer URI */
|
||||
|
||||
|
||||
DEBUG_printf(("show_status(%08x, %08x)\n", http, dests));
|
||||
|
||||
if (http == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Build a CUPS_GET_PRINTERS request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = CUPS_GET_PRINTERS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/printers/")) != NULL)
|
||||
{
|
||||
DEBUG_puts("show_status: request succeeded...");
|
||||
|
||||
/*
|
||||
* Loop through the printers returned in the list and display
|
||||
* their status...
|
||||
*/
|
||||
|
||||
for (attr = response->attrs; attr != NULL; attr = attr->next)
|
||||
{
|
||||
/*
|
||||
* Skip leading attributes until we hit a job...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
|
||||
attr = attr->next;
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Pull the needed attributes from this job...
|
||||
*/
|
||||
|
||||
printer = NULL;
|
||||
device = "file:/dev/null";
|
||||
pstate = IPP_PRINTER_IDLE;
|
||||
jobcount = 0;
|
||||
accepting = 1;
|
||||
|
||||
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
|
||||
{
|
||||
if (strcmp(attr->name, "printer-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
printer = attr->values[0].string.text;
|
||||
|
||||
if (strcmp(attr->name, "device-uri") == 0 &&
|
||||
attr->value_tag == IPP_TAG_URI)
|
||||
device = attr->values[0].string.text;
|
||||
|
||||
if (strcmp(attr->name, "printer-state") == 0 &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
pstate = (ipp_pstate_t)attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "printer-is-accepting-jobs") == 0 &&
|
||||
attr->value_tag == IPP_TAG_BOOLEAN)
|
||||
accepting = attr->values[0].boolean;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
/*
|
||||
* See if we have everything needed...
|
||||
*/
|
||||
|
||||
if (printer == NULL)
|
||||
{
|
||||
if (attr == NULL)
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* See if this is a printer we're interested in...
|
||||
*/
|
||||
|
||||
match = dests == NULL;
|
||||
|
||||
if (dests != NULL)
|
||||
{
|
||||
for (dptr = dests; *dptr != '\0';)
|
||||
{
|
||||
/*
|
||||
* Skip leading whitespace and commas...
|
||||
*/
|
||||
|
||||
while (isspace(*dptr) || *dptr == ',')
|
||||
dptr ++;
|
||||
|
||||
if (*dptr == '\0')
|
||||
break;
|
||||
|
||||
/*
|
||||
* Compare names...
|
||||
*/
|
||||
|
||||
for (ptr = printer;
|
||||
*ptr != '\0' && *dptr != '\0' && *ptr == *dptr;
|
||||
ptr ++, dptr ++);
|
||||
|
||||
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' || isspace(*dptr)))
|
||||
{
|
||||
match = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Skip trailing junk...
|
||||
*/
|
||||
|
||||
while (!isspace(*dptr) && *dptr != '\0')
|
||||
dptr ++;
|
||||
while (isspace(*dptr) || *dptr == ',')
|
||||
dptr ++;
|
||||
|
||||
if (*dptr == '\0')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the printer entry if needed...
|
||||
*/
|
||||
|
||||
if (match)
|
||||
{
|
||||
/*
|
||||
* If the printer state is "IPP_PRINTER_PROCESSING", then grab the
|
||||
* current job for the printer.
|
||||
*/
|
||||
|
||||
if (pstate == IPP_PRINTER_PROCESSING)
|
||||
{
|
||||
/*
|
||||
* Build an IPP_GET_JOBS request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* printer-uri
|
||||
* limit
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_JOBS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL,
|
||||
cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL,
|
||||
language->language);
|
||||
|
||||
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);
|
||||
|
||||
if ((jobs = cupsDoRequest(http, request, "/jobs/")) != NULL)
|
||||
{
|
||||
for (attr = jobs->attrs; attr != NULL; attr = attr->next)
|
||||
if (strcmp(attr->name, "job-id") == 0)
|
||||
jobcount ++;
|
||||
|
||||
ippDelete(jobs);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Display it...
|
||||
*/
|
||||
|
||||
printf("%s:\n", printer);
|
||||
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");
|
||||
if (jobcount == 0)
|
||||
puts("\tno entries");
|
||||
else
|
||||
printf("\t%d entries\n", jobcount);
|
||||
puts("\tdaemon present");
|
||||
}
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,369 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* "lpq" command 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:
|
||||
*
|
||||
* main() - Parse options and commands.
|
||||
* show_jobs() - Show jobs.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
#include <cups/debug.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int show_jobs(http_t *, const char *, const char *, const int,
|
||||
const int);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Parse options and commands.
|
||||
*/
|
||||
|
||||
int
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
http_t *http; /* Connection to server */
|
||||
const char *dest, /* Desired printer */
|
||||
*user; /* Desired user */
|
||||
int id, /* Desired job ID */
|
||||
interval, /* Reporting interval */
|
||||
longstatus; /* Show file details */
|
||||
|
||||
/*
|
||||
* Connect to the scheduler...
|
||||
*/
|
||||
|
||||
http = httpConnect(cupsServer(), ippPort());
|
||||
|
||||
/*
|
||||
* Check for command-line options...
|
||||
*/
|
||||
|
||||
dest = cupsGetDefault();
|
||||
user = NULL;
|
||||
id = 0;
|
||||
interval = 0;
|
||||
longstatus = 0;
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
if (argv[i][0] == '+')
|
||||
interval = atoi(argv[i] + 1);
|
||||
else if (argv[i][0] == '-')
|
||||
{
|
||||
switch (argv[i][1])
|
||||
{
|
||||
case 'P' : /* Printer */
|
||||
if (argv[i][2])
|
||||
dest = argv[i] + 2;
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
dest = argv[i];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l' : /* Long status */
|
||||
longstatus = 1;
|
||||
break;
|
||||
|
||||
default :
|
||||
fputs("Usage: lpq [-P dest] [-l] [+interval]\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else if (isdigit(argv[i][0]))
|
||||
id = atoi(argv[i]);
|
||||
else
|
||||
user = argv[i];
|
||||
|
||||
/*
|
||||
* Show the status in a loop...
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
{
|
||||
i = show_jobs(http, dest, user, id, longstatus);
|
||||
|
||||
if (i && interval)
|
||||
sleep(interval);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the connection to the server and return...
|
||||
*/
|
||||
|
||||
httpClose(http);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_jobs()' - Show jobs.
|
||||
*/
|
||||
|
||||
static int /* O - Number of jobs in queue */
|
||||
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 */
|
||||
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 */
|
||||
int jobid, /* job-id */
|
||||
jobsize, /* job-k-octets */
|
||||
jobpriority, /* job-priority */
|
||||
jobcount, /* Number of jobs */
|
||||
rank; /* Rank of job */
|
||||
char resource[1024]; /* Resource string */
|
||||
static const char *ranks[10] =/* Ranking strings */
|
||||
{
|
||||
"th",
|
||||
"st",
|
||||
"nd",
|
||||
"rd",
|
||||
"th",
|
||||
"th",
|
||||
"th",
|
||||
"th",
|
||||
"th",
|
||||
"th"
|
||||
};
|
||||
|
||||
|
||||
DEBUG_printf(("show_jobs(%08x, %08x, %08x, %d, %d)\n", http, dest, user, id,
|
||||
longstatus));
|
||||
|
||||
if (http == NULL)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Build an IPP_GET_JOBS or IPP_GET_JOB_ATTRIBUTES request, which requires
|
||||
* the following attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* job-uri or printer-uri
|
||||
* [
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
if (dest == NULL)
|
||||
{
|
||||
if (id)
|
||||
sprintf(resource, "ipp://localhost/jobs/%d", id);
|
||||
else
|
||||
strcpy(resource, "ipp://localhost/jobs");
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
|
||||
NULL, resource);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(resource, sizeof(resource), "ipp://localhost/printers/%s", dest);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
|
||||
NULL, resource);
|
||||
}
|
||||
|
||||
if (user)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, user);
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if (!longstatus)
|
||||
puts("Rank\tPri Owner Job Files Total Size");
|
||||
|
||||
jobcount = 0;
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/jobs/")) != NULL)
|
||||
{
|
||||
rank = 1;
|
||||
|
||||
/*
|
||||
* Loop through the job list and display them...
|
||||
*/
|
||||
|
||||
for (attr = response->attrs; attr != NULL; attr = attr->next)
|
||||
{
|
||||
/*
|
||||
* Skip leading attributes until we hit a job...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag != IPP_TAG_JOB)
|
||||
attr = attr->next;
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Pull the needed attributes from this job...
|
||||
*/
|
||||
|
||||
jobid = 0;
|
||||
jobsize = 0;
|
||||
jobpriority = 50;
|
||||
jobstate = IPP_JOB_PENDING;
|
||||
jobname = "untitled";
|
||||
jobuser = NULL;
|
||||
jobdest = NULL;
|
||||
|
||||
while (attr != NULL && attr->group_tag == IPP_TAG_JOB)
|
||||
{
|
||||
if (strcmp(attr->name, "job-id") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
jobid = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-k-octets") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
jobsize = attr->values[0].integer * 1024;
|
||||
|
||||
if (strcmp(attr->name, "job-priority") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
jobpriority = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-state") == 0 &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
jobstate = (ipp_jstate_t)attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-printer-uri") == 0 &&
|
||||
attr->value_tag == IPP_TAG_URI)
|
||||
if ((jobdest = strrchr(attr->values[0].string.text, '/')) != NULL)
|
||||
jobdest ++;
|
||||
|
||||
if (strcmp(attr->name, "job-originating-user-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
jobuser = attr->values[0].string.text;
|
||||
|
||||
if (strcmp(attr->name, "job-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
jobname = attr->values[0].string.text;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
/*
|
||||
* See if we have everything needed...
|
||||
*/
|
||||
|
||||
if (jobdest == NULL || jobid == 0)
|
||||
{
|
||||
if (attr == NULL)
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
jobcount ++;
|
||||
|
||||
/*
|
||||
* Display the job...
|
||||
*/
|
||||
|
||||
if (longstatus)
|
||||
{
|
||||
puts("");
|
||||
|
||||
if (jobstate == IPP_JOB_PROCESSING)
|
||||
printf("%s: active\t\t\t\t ", jobuser);
|
||||
else
|
||||
{
|
||||
printf("%s: %d%s\t\t\t\t ", jobuser, rank, ranks[rank % 10]);
|
||||
rank ++;
|
||||
}
|
||||
|
||||
printf("[job %03dlocalhost]\n", jobid);
|
||||
printf("\t%-32.32s %d bytes\n", jobname, jobsize);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (jobstate == IPP_JOB_PROCESSING)
|
||||
printf("active\t");
|
||||
else
|
||||
{
|
||||
printf("%d%s\t", rank, ranks[rank % 10]);
|
||||
rank ++;
|
||||
}
|
||||
|
||||
printf(" %-4d %-10.10s %-6d %-18.18s %d bytes\n", jobpriority, jobuser,
|
||||
jobid, jobname, jobsize);
|
||||
}
|
||||
if (attr == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
return (jobcount);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,294 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* "lpr" command 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:
|
||||
*
|
||||
* main() - Parse options and send files for printing.
|
||||
* sighandler() - Signal catcher for when we print from stdin...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#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.
|
||||
*/
|
||||
|
||||
int
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int job_id; /* Job ID */
|
||||
const char *dest; /* Destination printer */
|
||||
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 */
|
||||
int num_options; /* Number of options */
|
||||
cups_option_t *options; /* Options */
|
||||
int silent, /* Silent or verbose output? */
|
||||
deletefile; /* Delete file after print? */
|
||||
char buffer[8192]; /* Copy buffer */
|
||||
FILE *temp; /* Temporary file pointer */
|
||||
|
||||
|
||||
silent = 0;
|
||||
deletefile = 0;
|
||||
dest = cupsGetDefault();
|
||||
num_options = 0;
|
||||
options = NULL;
|
||||
num_files = 0;
|
||||
title = NULL;
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
if (argv[i][0] == '-')
|
||||
switch (argv[i][1])
|
||||
{
|
||||
case 'i' : /* indent */
|
||||
case 'w' : /* width */
|
||||
if (argv[i][2] == '\0')
|
||||
i ++;
|
||||
case 'c' : /* CIFPLOT */
|
||||
case 'd' : /* DVI */
|
||||
case 'f' : /* FORTRAN */
|
||||
case 'g' : /* plot */
|
||||
case 'n' : /* Ditroff */
|
||||
case 't' : /* Troff */
|
||||
case 'v' : /* Raster image */
|
||||
fprintf(stderr, "Warning: \'%c\' format modifier not supported - output may not be correct!\n",
|
||||
argv[i][1]);
|
||||
break;
|
||||
|
||||
case 'o' : /* Option */
|
||||
if (argv[i][2] != '\0')
|
||||
num_options = cupsParseOptions(argv[i] + 2, num_options, &options);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
num_options = cupsParseOptions(argv[i], num_options, &options);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l' : /* Literal/raw */
|
||||
num_options = cupsParseOptions("raw", num_options, &options);
|
||||
break;
|
||||
|
||||
case 'p' : /* Prettyprint */
|
||||
num_options = cupsParseOptions("prettyprint", num_options, &options);
|
||||
break;
|
||||
|
||||
case 'h' : /* Suppress burst page */
|
||||
case 's' : /* Don't use symlinks */
|
||||
break;
|
||||
|
||||
case 'm' : /* Mail on completion */
|
||||
fputs("Warning: email notification is not supported!\n", stderr);
|
||||
break;
|
||||
|
||||
case 'r' : /* Remove file after printing */
|
||||
deletefile = 1;
|
||||
break;
|
||||
|
||||
case 'P' : /* Destination printer or class */
|
||||
if (argv[i][2] != '\0')
|
||||
dest = argv[i] + 2;
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
dest = argv[i];
|
||||
}
|
||||
break;
|
||||
|
||||
case '#' : /* Number of copies */
|
||||
if (argv[i][2] != '\0')
|
||||
num_copies = atoi(argv[i] + 2);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
num_copies = atoi(argv[i]);
|
||||
}
|
||||
|
||||
if (num_copies < 1 || num_copies > 100)
|
||||
{
|
||||
fputs("lpr: Number copies must be between 1 and 100.\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
sprintf(buffer, "%d", num_copies);
|
||||
num_options = cupsAddOption("copies", buffer, num_options, &options);
|
||||
break;
|
||||
|
||||
case 'C' : /* Class */
|
||||
case 'J' : /* Job name */
|
||||
case 'T' : /* Title */
|
||||
if (argv[i][2] != '\0')
|
||||
title = argv[i] + 2;
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
title = argv[i];
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
fprintf(stderr, "lpr: Unknown option \'%c\'!\n", argv[i][1]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Print a file...
|
||||
*/
|
||||
|
||||
if (dest == NULL)
|
||||
{
|
||||
fputs("lpr: error - no default destination available.\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
num_files ++;
|
||||
if (title)
|
||||
job_id = cupsPrintFile(dest, argv[i], title, num_options, options);
|
||||
else
|
||||
{
|
||||
char *filename;
|
||||
|
||||
if ((filename = strrchr(argv[i], '/')) != NULL)
|
||||
filename ++;
|
||||
else
|
||||
filename = argv[i];
|
||||
|
||||
job_id = cupsPrintFile(dest, argv[i], filename, num_options, options);
|
||||
}
|
||||
|
||||
if (job_id < 1)
|
||||
{
|
||||
fprintf(stderr, "lpr: unable to print file \'%s\' - error code %x.\n",
|
||||
argv[i], cupsLastError());
|
||||
return (1);
|
||||
}
|
||||
else if (deletefile)
|
||||
unlink(argv[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
* See if we printed anything; if not, print from stdin...
|
||||
*/
|
||||
|
||||
if (num_files == 0)
|
||||
{
|
||||
if (dest == NULL)
|
||||
{
|
||||
fputs("lpr: error - no default destination available.\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
signal(SIGTERM, sighandler);
|
||||
#endif /* !WIN32 */
|
||||
|
||||
temp = fopen(cupsTempFile(tempfile, sizeof(tempfile)), "w");
|
||||
|
||||
if (temp == NULL)
|
||||
{
|
||||
fputs("lpr: unable to create temporary file.\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
while ((i = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
|
||||
fwrite(buffer, 1, i, temp);
|
||||
|
||||
i = ftell(temp);
|
||||
fclose(temp);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
fputs("lpr: standard input is empty, so no job has been sent.\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (title)
|
||||
job_id = cupsPrintFile(dest, tempfile, title, num_options, options);
|
||||
else
|
||||
job_id = cupsPrintFile(dest, tempfile, "(stdin)", num_options, options);
|
||||
|
||||
unlink(tempfile);
|
||||
|
||||
if (job_id < 1)
|
||||
{
|
||||
fprintf(stderr, "lpr: unable to print standard input - error code %x.\n",
|
||||
cupsLastError());
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
#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$".
|
||||
*/
|
||||
@@ -1,221 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* "lprm" command 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:
|
||||
*
|
||||
* main() - Parse options and cancel jobs.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Parse options and cancel jobs.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
http_t *http; /* HTTP connection to server */
|
||||
int i; /* Looping var */
|
||||
int job_id; /* Job ID */
|
||||
const char *dest; /* Destination printer */
|
||||
char uri[1024]; /* Printer or job URI */
|
||||
ipp_t *request; /* IPP request */
|
||||
ipp_t *response; /* IPP response */
|
||||
ipp_op_t op; /* Operation */
|
||||
cups_lang_t *language; /* Language */
|
||||
|
||||
|
||||
/*
|
||||
* Setup to cancel individual print jobs...
|
||||
*/
|
||||
|
||||
op = IPP_CANCEL_JOB;
|
||||
job_id = 0;
|
||||
dest = cupsGetDefault();
|
||||
response = NULL;
|
||||
http = NULL;
|
||||
|
||||
/*
|
||||
* Open a connection to the server...
|
||||
*/
|
||||
|
||||
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
|
||||
{
|
||||
fputs("lprm: Unable to contact server!\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Process command-line arguments...
|
||||
*/
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
if (argv[i][0] == '-' && argv[i][1] != '\0')
|
||||
switch (argv[i][1])
|
||||
{
|
||||
case 'P' : /* Cancel jobs on a printer */
|
||||
if (argv[i][2])
|
||||
dest = argv[i] + 2;
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
dest = argv[i];
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
fprintf(stderr, "lprm: Unknown option \'%c\'!\n", argv[i][1]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Cancel a job or printer...
|
||||
*/
|
||||
|
||||
if (isdigit(argv[i][0]))
|
||||
{
|
||||
dest = NULL;
|
||||
op = IPP_CANCEL_JOB;
|
||||
job_id = atoi(argv[i]);
|
||||
}
|
||||
else if (strcmp(argv[i], "-") == 0)
|
||||
{
|
||||
/*
|
||||
* Cancel all jobs
|
||||
*/
|
||||
|
||||
op = IPP_PURGE_JOBS;
|
||||
}
|
||||
else
|
||||
job_id = 0;
|
||||
|
||||
/*
|
||||
* Build an IPP request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* printer-uri + job-id *or* job-uri
|
||||
* [requesting-user-name]
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = op;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
if (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",
|
||||
job_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(uri, "ipp://localhost/jobs/%d", job_id);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL,
|
||||
uri);
|
||||
}
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, cupsUser());
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if (op == IPP_PURGE_JOBS)
|
||||
response = cupsDoRequest(http, request, "/admin/");
|
||||
else
|
||||
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);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If nothing has been cancelled yet, cancel the current job on the specified
|
||||
* (or default) printer...
|
||||
*/
|
||||
|
||||
if (response == NULL)
|
||||
if (!cupsCancelJob(dest, 0))
|
||||
{
|
||||
fputs("lprm: Unable to cancel job(s)!\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
#
|
||||
# Makefile for CUPS build and test repository.
|
||||
#
|
||||
# This makefile MUST be used from the build.sh script, otherwise the
|
||||
# environment will not be configured properly...
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
|
||||
# Subdirectories to be built...
|
||||
DIRS = \
|
||||
stable/.all \
|
||||
development/.all \
|
||||
|
||||
|
||||
# Make everything...
|
||||
all: tools/.all $(DIRS)
|
||||
|
||||
|
||||
# Clean everything...
|
||||
clean: tools/.clean $(DIRS:.all=.clean)
|
||||
@echo Removing \"temp\" directory...
|
||||
rm -rf temp
|
||||
@echo Removing old failed test reports...
|
||||
find . -name 'cups-str*.html' -mtime +7 -print -exec rm -f '{}' \;
|
||||
find . -name 'error_log-*' -mtime +7 -print -exec rm -f '{}' \;
|
||||
|
||||
|
||||
# Make CUPS stable
|
||||
stable/.all: stable/Makedefs
|
||||
@echo Making all in CUPS stable...
|
||||
cd stable && $(MAKE) all check
|
||||
|
||||
stable/.clean:
|
||||
@cd stable; if test -f Makedefs; then \
|
||||
echo Cleaning CUPS stable...; \
|
||||
$(MAKE) distclean || exit 1; \
|
||||
fi
|
||||
|
||||
stable/Makedefs: stable/Makedefs.in stable/configure \
|
||||
stable/packaging/cups.list.in \
|
||||
stable/config.h.in
|
||||
@cd stable; if test -f Makedefs; then \
|
||||
echo Cleaning CUPS stable...; \
|
||||
$(MAKE) distclean || exit 1; \
|
||||
fi
|
||||
@echo Configuring CUPS stable...
|
||||
cd stable && ./configure $(BUILDOPTIONS) \
|
||||
--enable-static \
|
||||
--enable-unit-tests --enable-debug-printfs
|
||||
|
||||
stable/configure: stable/configure.ac \
|
||||
stable/config-scripts/cups-common.m4 \
|
||||
stable/config-scripts/cups-compiler.m4 \
|
||||
stable/config-scripts/cups-defaults.m4 \
|
||||
stable/config-scripts/cups-directories.m4 \
|
||||
stable/config-scripts/cups-dnssd.m4 \
|
||||
stable/config-scripts/cups-gssapi.m4 \
|
||||
stable/config-scripts/cups-largefile.m4 \
|
||||
stable/config-scripts/cups-libtool.m4 \
|
||||
stable/config-scripts/cups-manpages.m4 \
|
||||
stable/config-scripts/cups-network.m4 \
|
||||
stable/config-scripts/cups-opsys.m4 \
|
||||
stable/config-scripts/cups-pam.m4 \
|
||||
stable/config-scripts/cups-poll.m4 \
|
||||
stable/config-scripts/cups-scripting.m4 \
|
||||
stable/config-scripts/cups-sharedlibs.m4 \
|
||||
stable/config-scripts/cups-ssl.m4 \
|
||||
stable/config-scripts/cups-startup.m4 \
|
||||
stable/config-scripts/cups-threads.m4
|
||||
@echo Updating CUPS stable configure script...
|
||||
cd stable; rm -rf autom4te.cache configure; autoconf
|
||||
|
||||
|
||||
# Make CUPS master (bleeding edge development)
|
||||
development/.all: development/Makedefs
|
||||
@echo Making all in CUPS development...
|
||||
cd development && $(MAKE) all check
|
||||
|
||||
development/.clean:
|
||||
@cd development; if test -f Makedefs; then \
|
||||
echo Cleaning CUPS development...; \
|
||||
$(MAKE) distclean || exit 1; \
|
||||
fi
|
||||
|
||||
development/Makedefs: development/Makedefs.in development/configure \
|
||||
development/packaging/cups.list.in \
|
||||
development/config.h.in
|
||||
@cd development; if test -f Makedefs; then \
|
||||
echo Cleaning CUPS development...; \
|
||||
$(MAKE) distclean || exit 1; \
|
||||
fi
|
||||
@echo Configuring CUPS development...
|
||||
cd development && ./configure $(BUILDOPTIONS) \
|
||||
--enable-static \
|
||||
--enable-unit-tests --enable-debug-printfs
|
||||
|
||||
development/configure: development/configure.ac \
|
||||
development/config-scripts/cups-common.m4 \
|
||||
development/config-scripts/cups-compiler.m4 \
|
||||
development/config-scripts/cups-defaults.m4 \
|
||||
development/config-scripts/cups-directories.m4 \
|
||||
development/config-scripts/cups-dnssd.m4 \
|
||||
development/config-scripts/cups-gssapi.m4 \
|
||||
development/config-scripts/cups-largefile.m4 \
|
||||
development/config-scripts/cups-libtool.m4 \
|
||||
development/config-scripts/cups-manpages.m4 \
|
||||
development/config-scripts/cups-network.m4 \
|
||||
development/config-scripts/cups-opsys.m4 \
|
||||
development/config-scripts/cups-pam.m4 \
|
||||
development/config-scripts/cups-poll.m4 \
|
||||
development/config-scripts/cups-scripting.m4 \
|
||||
development/config-scripts/cups-sharedlibs.m4 \
|
||||
development/config-scripts/cups-ssl.m4 \
|
||||
development/config-scripts/cups-startup.m4 \
|
||||
development/config-scripts/cups-threads.m4
|
||||
@echo Updating CUPS development configure script...
|
||||
cd development; rm -rf autom4te.cache configure; autoconf
|
||||
|
||||
# Make the build tools
|
||||
tools/.all: tools/Makefile
|
||||
@echo Making all in tools...
|
||||
cd tools && $(MAKE) install
|
||||
|
||||
tools/.clean:
|
||||
@cd tools; if test -f Makefile; then \
|
||||
echo Cleaning tools...; \
|
||||
$(MAKE) distclean || exit 1; \
|
||||
fi
|
||||
|
||||
tools/Makefile: tools/Makefile.in tools/configure
|
||||
@cd tools; if test -f Makefile; then \
|
||||
echo Cleaning tools...; \
|
||||
$(MAKE) distclean || exit 1; \
|
||||
fi
|
||||
@echo Configuring Tools...
|
||||
cd tools && ./configure $(BUILDOPTIONS) --prefix=$(BASEDIR)/temp
|
||||
Arquivo executável
+233
@@ -0,0 +1,233 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Common script for building the current stable and development (master)
|
||||
# branches of CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# build.sh [--if-changed] [--quiet] [--update] [target(s)]
|
||||
#
|
||||
|
||||
# Copy any build/test environment variables...
|
||||
BUILDOPTIONS=""
|
||||
BUILDNOTIFY=""
|
||||
BUILDSUBJECT="[`hostname`]"
|
||||
if test -f buildtest.env; then
|
||||
. ./buildtest.env
|
||||
fi
|
||||
|
||||
# Get the path to this script...
|
||||
BASEDIR=`dirname $0`
|
||||
if test $BASEDIR = .; then
|
||||
BASEDIR=`pwd`
|
||||
fi
|
||||
|
||||
# Make sure the temporary directory is there...
|
||||
if test ! -d $BASEDIR/temp; then
|
||||
mkdir -p $BASEDIR/temp
|
||||
fi
|
||||
|
||||
# Setup common path stuff...
|
||||
PATH=""
|
||||
for dir in /usr/xpg4/bin /usr/ccs/bin /opt/SUNWspro/bin /opt/sfw/bin \
|
||||
/usr/sfw/bin /usr/bsd /usr/freeware/bin /opt/aCC/bin /usr/contrib/bin \
|
||||
/usr/local/bin $HOME/oss/bin; do
|
||||
if test -d $dir; then
|
||||
PATH="$PATH:$dir"
|
||||
fi
|
||||
done
|
||||
|
||||
if test "x$PATH" = x; then
|
||||
PATH="$BASEDIR/temp/bin:/usr/bin:/bin"
|
||||
else
|
||||
PATH="$BASEDIR/temp/bin$PATH:/usr/bin:/bin"
|
||||
fi
|
||||
|
||||
export PATH
|
||||
|
||||
if test -x /usr/xpg4/bin/grep; then
|
||||
grep=/usr/xpg4/bin/grep
|
||||
else
|
||||
grep=grep
|
||||
fi
|
||||
|
||||
if test -x /usr/local/bin/gmake; then
|
||||
make=/usr/local/bin/gmake
|
||||
else
|
||||
make=make
|
||||
fi
|
||||
|
||||
# Parse command-line arguments:
|
||||
ifchanged=no
|
||||
quiet=no
|
||||
update=no
|
||||
targets=""
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--ifchanged | --if-changed) ifchanged=yes;;
|
||||
--quiet) quiet=yes;;
|
||||
--update | update) update=yes;;
|
||||
*) targets="$targets $1";;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
# Start the build...
|
||||
if test $quiet = yes; then
|
||||
if test $update = yes; then
|
||||
exec >/dev/null 2>&1
|
||||
else
|
||||
if test -f build.log; then
|
||||
mv build.log build.log.O
|
||||
fi
|
||||
|
||||
exec >build.log 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$targets" = x; then
|
||||
targets="all"
|
||||
fi
|
||||
|
||||
echo "Starting build of '$targets' on `date`"
|
||||
|
||||
if test -f git.log; then
|
||||
# Show Subversion updates...
|
||||
echo git pull --recurse-submodules; git submodule update --recursive
|
||||
cat git.log
|
||||
git status | $grep modified: >git.log
|
||||
if test -s git.log; then
|
||||
echo ""
|
||||
echo ERROR: Local files have modifications:
|
||||
echo ""
|
||||
cat git.log
|
||||
echo ""
|
||||
fi
|
||||
rm -f git.log
|
||||
fi
|
||||
|
||||
# Update and then build safely...
|
||||
if test $update = yes; then
|
||||
cd $BASEDIR
|
||||
(git pull --recurse-submodules; git submodule update --recursive) 2>&1 >git.log
|
||||
|
||||
# Need to exec since this script might change...
|
||||
options=""
|
||||
if test $quiet = yes; then
|
||||
options="--quiet $options"
|
||||
fi
|
||||
if test $ifchanged = yes; then
|
||||
options="--ifchanged $options"
|
||||
fi
|
||||
|
||||
exec ./build.sh $options $targets
|
||||
fi
|
||||
|
||||
# Make sure submodules are initialized...
|
||||
if test ! -f stable/Makedefs.in; then
|
||||
echo Initializing submodules...
|
||||
git submodule init
|
||||
git submodule update
|
||||
fi
|
||||
|
||||
# Look for changes to the dependent projects
|
||||
changed=0
|
||||
|
||||
for dir in . tools stable development; do
|
||||
rev=`git rev-parse HEAD $dir`
|
||||
if test -f $dir/.buildrev; then
|
||||
oldrev=`cat $dir/.buildrev`
|
||||
else
|
||||
oldrev=""
|
||||
fi
|
||||
|
||||
if test "x$rev" != "x$oldrev"; then
|
||||
changed=1
|
||||
fi
|
||||
|
||||
echo $rev >$dir/.buildrev
|
||||
done
|
||||
|
||||
if test $ifchanged = yes -a $changed = 0; then
|
||||
echo No changes to build.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Setup the compiler flags to point to all of the dependent libraries...
|
||||
#CFLAGS="-I$BASEDIR/temp/include"
|
||||
#CPPFLAGS="-I$BASEDIR/temp/include"
|
||||
#CXXFLAGS="-I$BASEDIR/temp/include"
|
||||
#DSOFLAGS="-L$BASEDIR/temp/lib"
|
||||
#LDFLAGS="-L$BASEDIR/temp/lib"
|
||||
|
||||
CFLAGS="${CFLAGS:=}"
|
||||
CPPFLAGS="${CPPFLAGS:=}"
|
||||
CXXFLAGS="${CXXFLAGS:=}"
|
||||
DSOFLAGS="${DSOFLAGS:=}"
|
||||
LDFLAGS="${LDFLAGS:=}"
|
||||
|
||||
export CFLAGS
|
||||
export CPPFLAGS
|
||||
export CXXFLAGS
|
||||
export DSOFLAGS
|
||||
export LDFLAGS
|
||||
|
||||
case `uname` in
|
||||
Linux*)
|
||||
if test "`uname -m`" = x86_64; then
|
||||
# 64-bit Linux needs this, at least for now...
|
||||
X_LIBS="-L/usr/X11R6/lib64"
|
||||
export X_LIBS
|
||||
fi
|
||||
;;
|
||||
*BSD*)
|
||||
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
|
||||
DSOFLAGS="$DSOFLAGS -L/usr/local/lib"
|
||||
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Show the environment...
|
||||
echo Environment:
|
||||
env
|
||||
|
||||
# Do the build using the top-level makefile...
|
||||
echo $make -f build.mak BASEDIR=$BASEDIR BUILDOPTIONS="$BUILDOPTIONS" $targets
|
||||
$make -f build.mak BASEDIR=$BASEDIR BUILDOPTIONS="$BUILDOPTIONS" $targets </dev/null
|
||||
status=$?
|
||||
|
||||
if test $status = 0; then
|
||||
echo Build succeeded on `date`
|
||||
else
|
||||
echo Build failed on `date`
|
||||
fi
|
||||
|
||||
# If configured, send the build log to a central server for processing...
|
||||
if test "x$BUILDNOTIFY" != x -a -x temp/bin/sendbuildlog -a $quiet = yes; then
|
||||
attachments=""
|
||||
|
||||
date=`date "+%Y-%m-%d"`
|
||||
|
||||
if test -f stable/test/cups-str-2.1-$date-$USER.html; then
|
||||
attachments="$attachments -a stable/test/cups-str-2.1-$date-$USER.html"
|
||||
fi
|
||||
|
||||
if test -f developent/test/cups-str-2.2-$date-$USER.html; then
|
||||
attachments="$attachments -a developent/test/cups-str-2.2-$date-$USER.html"
|
||||
fi
|
||||
|
||||
temp/bin/sendbuildlog -b $status -s "$BUILDSUBJECT r$rev" $attachments "$BUILDNOTIFY" build.log
|
||||
fi
|
||||
@@ -1,83 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# CGI makefile 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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
TARGETS = classes.cgi jobs.cgi printers.cgi
|
||||
OBJS = classes.o jobs.o printers.o
|
||||
|
||||
#
|
||||
# Make all targets...
|
||||
#
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
#
|
||||
# Clean all object files...
|
||||
#
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(TARGETS)
|
||||
|
||||
#
|
||||
# Install all targets...
|
||||
#
|
||||
|
||||
install:
|
||||
-$(MKDIR) $(SERVERROOT)/cgi-bin
|
||||
$(CP) $(TARGETS) $(SERVERROOT)/cgi-bin
|
||||
|
||||
#
|
||||
# classes.cgi
|
||||
#
|
||||
|
||||
classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ classes.o $(LIBS)
|
||||
|
||||
$(OBJS): ../Makedefs ../cups/cups.h ../cups/ipp.h ../cups/language.h
|
||||
|
||||
#
|
||||
# jobs.cgi
|
||||
#
|
||||
|
||||
jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ jobs.o $(LIBS)
|
||||
|
||||
$(OBJS): ../Makedefs ../cups/cups.h ../cups/ipp.h ../cups/language.h
|
||||
|
||||
#
|
||||
# printers.cgi
|
||||
#
|
||||
|
||||
printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ printers.o $(LIBS)
|
||||
|
||||
$(OBJS): ../Makedefs ../cups/cups.h ../cups/ipp.h ../cups/language.h
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
@@ -1,486 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Class status CGI 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:
|
||||
*
|
||||
* main() - Main entry for CGI.
|
||||
* show_class_list() - Show a list of classes...
|
||||
* show_class_info() - Show class information.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
#include <cups/debug.h>
|
||||
#include <config.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void show_class_list(http_t *http, cups_lang_t *language);
|
||||
static void show_class_info(http_t *http, cups_lang_t *language,
|
||||
char *name);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry for CGI.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
cups_lang_t *language; /* Language information */
|
||||
char *name; /* Class name */
|
||||
http_t *http; /* Connection to the server */
|
||||
|
||||
|
||||
/*
|
||||
* Get the request language...
|
||||
*/
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
/*
|
||||
* Connect to the HTTP server...
|
||||
*/
|
||||
|
||||
http = httpConnect("localhost", ippPort());
|
||||
|
||||
/*
|
||||
* Tell the client to expect HTML...
|
||||
*/
|
||||
|
||||
printf("Content-Type: text/html;charset=%s\n\n", cupsLangEncoding(language));
|
||||
|
||||
/*
|
||||
* See if we need to show a list of classes or the status of a
|
||||
* single class...
|
||||
*/
|
||||
|
||||
name = argv[0];
|
||||
if (strcmp(name, "/") == 0 || strcmp(name, "classes.cgi") == 0)
|
||||
name = NULL;
|
||||
|
||||
/*
|
||||
* Print the standard header...
|
||||
*/
|
||||
|
||||
puts("<HTML>");
|
||||
puts("<HEAD>");
|
||||
if (name)
|
||||
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10\">");
|
||||
else
|
||||
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">");
|
||||
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>");
|
||||
puts("<P ALIGN=CENTER>");
|
||||
puts("<A HREF=\"http://www.easysw.com\" ALT=\"Easy Software Products Home Page\">");
|
||||
puts("<IMG SRC=\"/images/logo.gif\" WIDTH=\"71\" HEIGHT=\"40\" BORDER=0 ALT=\"Easy Software Products Home Page\"></A>");
|
||||
puts("<IMG SRC=\"/images/navbar.gif\" WIDTH=\"540\" HEIGHT=\"40\" USEMAP=\"#navbar\" BORDER=0>");
|
||||
|
||||
printf("<H1>%s on %s</H1>\n", name == NULL ? "Classes" : name,
|
||||
getenv("SERVER_NAME"));
|
||||
fflush(stdout);
|
||||
|
||||
puts("<CENTER>");
|
||||
puts("<TABLE WIDTH=\"90%\" BORDER=\"1\">");
|
||||
puts("<TR>");
|
||||
puts("<TH>Name</TH>");
|
||||
puts("<TH WIDTH=\"50%\">Status</TH>");
|
||||
puts("<TH WIDTH=\"25%\">Jobs</TH>");
|
||||
puts("</TR>");
|
||||
|
||||
/*
|
||||
* Show the information...
|
||||
*/
|
||||
|
||||
if (name == NULL)
|
||||
show_class_list(http, language);
|
||||
else
|
||||
show_class_info(http, language, name);
|
||||
|
||||
/*
|
||||
* Write a standard trailer...
|
||||
*/
|
||||
|
||||
puts("</TABLE>");
|
||||
puts("</CENTER>");
|
||||
|
||||
puts("<HR>");
|
||||
|
||||
puts("<P>The Common UNIX Printing System, CUPS, and the CUPS logo are the");
|
||||
puts("trademark property of <A HREF=\"http://www.easysw.com\">Easy Software");
|
||||
puts("Products</A>. CUPS is copyright 1997-1999 by Easy Software Products,");
|
||||
puts("All Rights Reserved.");
|
||||
|
||||
puts("</BODY>");
|
||||
puts("</HTML>");
|
||||
|
||||
/*
|
||||
* Close the HTTP server connection...
|
||||
*/
|
||||
|
||||
httpClose(http);
|
||||
cupsLangFree(language);
|
||||
|
||||
/*
|
||||
* Return with no errors...
|
||||
*/
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_class_list()' - Show a list of classes...
|
||||
*/
|
||||
|
||||
static void
|
||||
show_class_list(http_t *http, /* I - HTTP connection */
|
||||
cups_lang_t *language)/* I - Client's language */
|
||||
{
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
|
||||
|
||||
/*
|
||||
* Build a CUPS_GET_CLASSES request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = CUPS_GET_CLASSES;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Loop through the classes returned in the list and display
|
||||
* their devices...
|
||||
*/
|
||||
|
||||
for (attr = response->attrs; attr != NULL; attr = attr->next)
|
||||
{
|
||||
/*
|
||||
* Skip leading attributes until we hit a job...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
|
||||
attr = attr->next;
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Show the class status for each class...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
|
||||
{
|
||||
if (strcmp(attr->name, "printer-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
show_class_info(http, language, attr->values[0].string.text);
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_class_info()' - Show class information.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_class_info(http_t *http,
|
||||
cups_lang_t *language,
|
||||
char *name)
|
||||
{
|
||||
ipp_t *request, /* IPP request */
|
||||
*response, /* IPP response */
|
||||
*jobs; /* IPP Get Jobs response */
|
||||
int jobcount; /* Number of jobs */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
char *message; /* Printer state message */
|
||||
int accepting; /* Accepting requests? */
|
||||
ipp_pstate_t pstate; /* Printer state */
|
||||
char uri[HTTP_MAX_URI];/* Printer URI */
|
||||
|
||||
|
||||
/*
|
||||
* Build a IPP_GET_PRINTER_ATTRIBUTES request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* printer-uri
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
snprintf(uri, sizeof(uri), "ipp://localhost/classes/%s", name);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) == NULL)
|
||||
{
|
||||
puts("<P>Unable to communicate with CUPS server!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (response->request.status.status_code == IPP_NOT_FOUND)
|
||||
{
|
||||
puts("<P>Class does not exist.");
|
||||
ippDelete(response);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Grab the needed class attributes...
|
||||
*/
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM)) != NULL)
|
||||
pstate = (ipp_pstate_t)attr->values[0].integer;
|
||||
else
|
||||
pstate = IPP_PRINTER_IDLE;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state-message", IPP_TAG_TEXT)) != NULL)
|
||||
message = attr->values[0].string.text;
|
||||
else
|
||||
message = NULL;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-is-accepting-jobs",
|
||||
IPP_TAG_BOOLEAN)) != NULL)
|
||||
accepting = attr->values[0].boolean;
|
||||
else
|
||||
accepting = 1;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL)
|
||||
{
|
||||
strcpy(uri, "http:");
|
||||
strncpy(uri + 5, strchr(attr->values[0].string.text, '/'), sizeof(uri) - 6);
|
||||
uri[sizeof(uri) - 1] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the class entry...
|
||||
*/
|
||||
|
||||
puts("<TR>");
|
||||
|
||||
printf("<TD VALIGN=TOP><A HREF=\"%s\">%s</A></TD>\n", uri, name);
|
||||
|
||||
puts("<TD VALIGN=TOP><IMG SRC=\"/images/classes.gif\" ALIGN=\"LEFT\">");
|
||||
|
||||
printf("%s: %s, %s<BR>\n",
|
||||
cupsLangString(language, CUPS_MSG_PRINTER_STATE),
|
||||
cupsLangString(language, pstate == IPP_PRINTER_IDLE ? CUPS_MSG_IDLE :
|
||||
pstate == IPP_PRINTER_PROCESSING ?
|
||||
CUPS_MSG_PROCESSING : CUPS_MSG_STOPPED),
|
||||
cupsLangString(language, accepting ? CUPS_MSG_ACCEPTING_JOBS :
|
||||
CUPS_MSG_NOT_ACCEPTING_JOBS));
|
||||
|
||||
if (message)
|
||||
printf("<BR CLEAR=ALL><I>\"%s\"</I>\n", message);
|
||||
else if (!accepting || pstate == IPP_PRINTER_STOPPED)
|
||||
puts("<BR CLEAR=ALL><I>\"Reason Unknown\"</I>");
|
||||
|
||||
puts("</TD>");
|
||||
|
||||
/*
|
||||
* Show a list of jobs as needed...
|
||||
*/
|
||||
|
||||
if (pstate != IPP_PRINTER_IDLE)
|
||||
{
|
||||
/*
|
||||
* Build an IPP_GET_JOBS request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* printer-uri
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_JOBS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL,
|
||||
cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL,
|
||||
language->language);
|
||||
|
||||
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, "/");
|
||||
}
|
||||
else
|
||||
jobs = NULL;
|
||||
|
||||
puts("<TD VALIGN=\"TOP\">");
|
||||
jobcount = 0;
|
||||
|
||||
if (jobs != NULL)
|
||||
{
|
||||
char *username; /* Pointer to job-originating-user-name */
|
||||
int jobid, /* job-id */
|
||||
size; /* job-k-octets */
|
||||
|
||||
|
||||
for (attr = jobs->attrs; attr != NULL; attr = attr->next)
|
||||
{
|
||||
/*
|
||||
* Skip leading attributes until we hit a job...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag != IPP_TAG_JOB)
|
||||
attr = attr->next;
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Pull the needed attributes from this job...
|
||||
*/
|
||||
|
||||
jobid = 0;
|
||||
size = 0;
|
||||
username = NULL;
|
||||
|
||||
while (attr != NULL && attr->group_tag == IPP_TAG_JOB)
|
||||
{
|
||||
if (strcmp(attr->name, "job-id") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
jobid = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-k-octets") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
size = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-originating-user-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
username = attr->values[0].string.text;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the job if it matches the current class...
|
||||
*/
|
||||
|
||||
if (username != NULL)
|
||||
{
|
||||
jobcount ++;
|
||||
printf("<A HREF=\"/jobs/%d\">%s-%d %s %dk</A><BR>\n", jobid, name,
|
||||
jobid, username, size);
|
||||
}
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(jobs);
|
||||
}
|
||||
|
||||
if (jobcount == 0)
|
||||
puts("None");
|
||||
puts("</TD>");
|
||||
puts("</TR>");
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,584 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Job status CGI 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:
|
||||
*
|
||||
* main() - Main entry for CGI.
|
||||
* show_job_list() - Show a list of jobs...
|
||||
* show_job_info() - Show job information.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
#include <cups/debug.h>
|
||||
#include <config.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void show_job_list(http_t *http, cups_lang_t *language);
|
||||
static void show_job_info(http_t *http, cups_lang_t *language,
|
||||
char *name);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry for CGI.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
cups_lang_t *language; /* Language information */
|
||||
char *job; /* Job name */
|
||||
http_t *http; /* Connection to the server */
|
||||
|
||||
|
||||
/*
|
||||
* Get the request language...
|
||||
*/
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
/*
|
||||
* Connect to the HTTP server...
|
||||
*/
|
||||
|
||||
http = httpConnect("localhost", ippPort());
|
||||
|
||||
/*
|
||||
* Tell the client to expect HTML...
|
||||
*/
|
||||
|
||||
printf("Content-Type: text/html;charset=%s\n\n", cupsLangEncoding(language));
|
||||
|
||||
/*
|
||||
* See if we need to show a list of jobs or the status of a
|
||||
* single job...
|
||||
*/
|
||||
|
||||
job = argv[0];
|
||||
if (strcmp(job, "/") == 0 || strcmp(job, "jobs.cgi") == 0)
|
||||
job = NULL;
|
||||
|
||||
/*
|
||||
* Print the standard header...
|
||||
*/
|
||||
|
||||
puts("<HTML>");
|
||||
puts("<HEAD>");
|
||||
if (job)
|
||||
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10\">");
|
||||
else
|
||||
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">");
|
||||
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>");
|
||||
puts("<P ALIGN=CENTER>");
|
||||
puts("<A HREF=\"http://www.easysw.com\" ALT=\"Easy Software Products Home Page\">");
|
||||
puts("<IMG SRC=\"/images/logo.gif\" WIDTH=\"71\" HEIGHT=\"40\" BORDER=0 ALT=\"Easy Software Products Home Page\"></A>");
|
||||
puts("<IMG SRC=\"/images/navbar.gif\" WIDTH=\"540\" HEIGHT=\"40\" USEMAP=\"#navbar\" BORDER=0>");
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
/*
|
||||
* Show the information...
|
||||
*/
|
||||
|
||||
if (job == NULL)
|
||||
show_job_list(http, language);
|
||||
else
|
||||
show_job_info(http, language, job);
|
||||
|
||||
/*
|
||||
* Write a standard trailer...
|
||||
*/
|
||||
|
||||
puts("<HR>");
|
||||
|
||||
puts("<P>The Common UNIX Printing System, CUPS, and the CUPS logo are the");
|
||||
puts("trademark property of <A HREF=\"http://www.easysw.com\">Easy Software");
|
||||
puts("Products</A>. CUPS is copyright 1997-1999 by Easy Software Products,");
|
||||
puts("All Rights Reserved.");
|
||||
|
||||
puts("</BODY>");
|
||||
puts("</HTML>");
|
||||
|
||||
/*
|
||||
* Close the HTTP server connection...
|
||||
*/
|
||||
|
||||
httpClose(http);
|
||||
cupsLangFree(language);
|
||||
|
||||
/*
|
||||
* Return with no errors...
|
||||
*/
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_job_list()' - Show a list of jobs...
|
||||
*/
|
||||
|
||||
static void
|
||||
show_job_list(http_t *http, /* I - HTTP connection */
|
||||
cups_lang_t *language) /* I - Client's language */
|
||||
{
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
char *job_uri, /* job-uri */
|
||||
*printer_uri, /* job-printer-uri */
|
||||
*job_name, /* job-name */
|
||||
*job_user; /* job-originating-user-name */
|
||||
int job_id, /* job-id */
|
||||
job_priority, /* job-priority */
|
||||
job_k_octets, /* job-k-octets */
|
||||
copies; /* copies */
|
||||
ipp_jstate_t job_state; /* job-state */
|
||||
|
||||
|
||||
printf("<H1>Jobs on %s</H1>\n", getenv("SERVER_NAME"));
|
||||
|
||||
/*
|
||||
* Build an IPP_GET_JOBS request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* job-uri
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_JOBS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
|
||||
NULL, "ipp://localhost/jobs/");
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Do a table for the jobs...
|
||||
*/
|
||||
|
||||
puts("<CENTER>");
|
||||
puts("<TABLE WIDTH=\"90%\" BORDER=\"1\">");
|
||||
puts("<TR>");
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_PRINT_JOBS));
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_JOB_STATE));
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_JOB_NAME));
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_USER_NAME));
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_PRIORITY));
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_COPIES));
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_FILE_SIZE));
|
||||
puts("</TR>");
|
||||
|
||||
/*
|
||||
* Loop through the jobs returned in the list and display
|
||||
* their devices...
|
||||
*/
|
||||
|
||||
for (attr = response->attrs; attr != NULL; attr = attr->next)
|
||||
{
|
||||
/*
|
||||
* Skip leading attributes until we hit a job...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag != IPP_TAG_JOB)
|
||||
attr = attr->next;
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Show the job status for each job...
|
||||
*/
|
||||
|
||||
job_uri = NULL;
|
||||
printer_uri = NULL;
|
||||
job_name = "unknown";
|
||||
job_user = "unknown";
|
||||
job_id = 0;
|
||||
job_priority = 50;
|
||||
job_k_octets = 0;
|
||||
copies = 1;
|
||||
job_state = IPP_JOB_PENDING;
|
||||
|
||||
while (attr != NULL && attr->group_tag == IPP_TAG_JOB)
|
||||
{
|
||||
if (strcmp(attr->name, "job-uri") == 0 &&
|
||||
attr->value_tag == IPP_TAG_URI)
|
||||
job_uri = attr->values[0].string.text;
|
||||
|
||||
if (strcmp(attr->name, "job-printer-uri") == 0 &&
|
||||
attr->value_tag == IPP_TAG_URI)
|
||||
printer_uri = attr->values[0].string.text;
|
||||
|
||||
if (strcmp(attr->name, "job-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
job_name = attr->values[0].string.text;
|
||||
|
||||
if (strcmp(attr->name, "job-originating-user-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
job_user = attr->values[0].string.text;
|
||||
|
||||
if (strcmp(attr->name, "job-id") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
job_id = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-priority") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
job_priority = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-k-octets") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
job_k_octets = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "copies") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
copies = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-state") == 0 &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
job_state = (ipp_jstate_t)attr->values[0].integer;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
/*
|
||||
* See if we have everything needed...
|
||||
*/
|
||||
|
||||
if (job_id && job_uri != NULL && printer_uri != NULL)
|
||||
{
|
||||
puts("<TR>");
|
||||
printf("<TD><A HREF=\"http://%s:%s/jobs/%d\">%s-%d</A></TD>\n",
|
||||
getenv("SERVER_NAME"), getenv("SERVER_PORT"), job_id,
|
||||
strrchr(printer_uri, '/') + 1, job_id);
|
||||
printf("<TD>%s</TD>\n", job_state == IPP_JOB_PROCESSING ?
|
||||
cupsLangString(language, CUPS_MSG_PROCESSING) :
|
||||
cupsLangString(language, CUPS_MSG_PENDING));
|
||||
printf("<TD>%s</TD>\n", job_name);
|
||||
printf("<TD>%s</TD>\n", job_user);
|
||||
printf("<TD>%d</TD>\n", job_priority);
|
||||
printf("<TD>%d</TD>\n", copies);
|
||||
printf("<TD>%dk</TD>\n", job_k_octets);
|
||||
puts("</TR>");
|
||||
}
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
puts("</TABLE>");
|
||||
puts("</CENTER>");
|
||||
}
|
||||
else
|
||||
puts("<P>No jobs found.");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_job_info()' - Show job information.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_job_info(http_t *http, /* I - Server connection */
|
||||
cups_lang_t *language, /* I - Language */
|
||||
char *name) /* I - Job "name" */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
char uri[HTTP_MAX_URI];/* Real URI */
|
||||
char *job_uri, /* job-uri */
|
||||
*printer_uri, /* job-printer-uri */
|
||||
*job_name, /* job-name */
|
||||
*job_user; /* job-originating-user-name */
|
||||
int job_id, /* job-id */
|
||||
job_priority, /* job-priority */
|
||||
job_k_octets; /* job-k-octets */
|
||||
ipp_jstate_t job_state; /* job-state */
|
||||
|
||||
|
||||
/*
|
||||
* Build an IPP_GET_JOB_ATTRIBUTES request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* job-uri
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_JOB_ATTRIBUTES;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
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, "/")) == NULL)
|
||||
{
|
||||
puts("<P>Unable to communicate with CUPS server!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (response->request.status.status_code == IPP_NOT_FOUND)
|
||||
{
|
||||
puts("<P>Job does not exist or has completed.");
|
||||
ippDelete(response);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the job status for this job...
|
||||
*/
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-uri", IPP_TAG_URI)) != NULL)
|
||||
job_uri = attr->values[0].string.text;
|
||||
else
|
||||
{
|
||||
puts("<P>Missing job-uri attribute!");
|
||||
ippDelete(request);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-printer-uri", IPP_TAG_URI)) != NULL)
|
||||
printer_uri = attr->values[0].string.text;
|
||||
else
|
||||
{
|
||||
puts("<P>Missing job-printer-uri attribute!");
|
||||
ippDelete(request);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-name", IPP_TAG_NAME)) != NULL)
|
||||
job_name = attr->values[0].string.text;
|
||||
else
|
||||
job_name = "unknown";
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-originating-user-name",
|
||||
IPP_TAG_NAME)) != NULL)
|
||||
job_user = attr->values[0].string.text;
|
||||
else
|
||||
job_user = "unknown";
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) != NULL)
|
||||
job_id = attr->values[0].integer;
|
||||
else
|
||||
{
|
||||
puts("<P>Missing job-id attribute!");
|
||||
ippDelete(request);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-priority", IPP_TAG_INTEGER)) != NULL)
|
||||
job_priority = attr->values[0].integer;
|
||||
else
|
||||
job_priority = 50;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-k-octets", IPP_TAG_INTEGER)) != NULL)
|
||||
job_k_octets = attr->values[0].integer;
|
||||
else
|
||||
job_k_octets = 0;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-state", IPP_TAG_ENUM)) != NULL)
|
||||
job_state = (ipp_jstate_t)attr->values[0].integer;
|
||||
else
|
||||
job_state = IPP_JOB_PENDING;
|
||||
|
||||
/*
|
||||
* Do a table for the job...
|
||||
*/
|
||||
|
||||
printf("<H1><A HREF=\"http://%s:%s/printers/%s\">%s-%d</A></H1>\n",
|
||||
getenv("SERVER_NAME"), getenv("SERVER_PORT"),
|
||||
strrchr(printer_uri, '/') + 1, strrchr(printer_uri, '/') + 1, job_id);
|
||||
|
||||
puts("<CENTER>");
|
||||
puts("<TABLE WIDTH=\"90%\" BORDER=\"1\">");
|
||||
|
||||
puts("<TR>");
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_JOB_STATE));
|
||||
printf("<TD>%s</TD>\n", job_state == IPP_JOB_PROCESSING ?
|
||||
cupsLangString(language, CUPS_MSG_PROCESSING) :
|
||||
cupsLangString(language, CUPS_MSG_PENDING));
|
||||
puts("</TR>");
|
||||
|
||||
puts("<TR>");
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_JOB_NAME));
|
||||
printf("<TD>%s</TD>\n", job_name);
|
||||
puts("</TR>");
|
||||
|
||||
puts("<TR>");
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_USER_NAME));
|
||||
printf("<TD>%s</TD>\n", job_user);
|
||||
puts("</TR>");
|
||||
|
||||
puts("<TR>");
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_PRIORITY));
|
||||
printf("<TD>%d</TD>\n", job_priority);
|
||||
puts("</TR>");
|
||||
|
||||
puts("<TR>");
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_FILE_SIZE));
|
||||
printf("<TD>%dk</TD>\n", job_k_octets);
|
||||
puts("</TR>");
|
||||
|
||||
puts("<TR VALIGN=\"TOP\">");
|
||||
printf("<TH>%s</TH>\n", cupsLangString(language, CUPS_MSG_OPTIONS));
|
||||
puts("<TD>");
|
||||
|
||||
for (attr = response->attrs; attr != NULL; attr = attr->next)
|
||||
{
|
||||
if (attr->group_tag != IPP_TAG_JOB)
|
||||
continue;
|
||||
|
||||
if (strcmp(attr->name, "job-uri") == 0 ||
|
||||
strcmp(attr->name, "job-printer-uri") == 0 ||
|
||||
strcmp(attr->name, "job-name") == 0 ||
|
||||
strcmp(attr->name, "job-originating-user-name") == 0 ||
|
||||
strcmp(attr->name, "job-id") == 0 ||
|
||||
strcmp(attr->name, "job-priority") == 0 ||
|
||||
strcmp(attr->name, "job-k-octets") == 0 ||
|
||||
strcmp(attr->name, "job-state") == 0)
|
||||
continue;
|
||||
|
||||
if (attr->value_tag != IPP_TAG_BOOLEAN)
|
||||
printf("%s=", attr->name);
|
||||
|
||||
for (i = 0; i < attr->num_values; i ++)
|
||||
{
|
||||
if (i)
|
||||
putchar(',');
|
||||
|
||||
switch (attr->value_tag)
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
printf("%d", attr->values[i].integer);
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
if (!attr->values[i].boolean)
|
||||
printf("no");
|
||||
|
||||
case IPP_TAG_NOVALUE :
|
||||
fputs(attr->name, stdout);
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
printf("%d-%d", attr->values[i].range.lower,
|
||||
attr->values[i].range.upper);
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
printf("%dx%d%s", attr->values[i].resolution.xres,
|
||||
attr->values[i].resolution.yres,
|
||||
attr->values[i].resolution.units == IPP_RES_PER_INCH ?
|
||||
"dpi" : "dpc");
|
||||
break;
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
case IPP_TAG_URI :
|
||||
printf("\"%s\"", attr->values[i].string.text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
puts("<BR>");
|
||||
}
|
||||
|
||||
puts("</TD>");
|
||||
puts("</TR>");
|
||||
puts("</TABLE></CENTER>");
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,488 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Printer status CGI 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:
|
||||
*
|
||||
* main() - Main entry for CGI.
|
||||
* show_printer_list() - Show a list of printers...
|
||||
* show_printer_info() - Show printer information.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
#include <cups/debug.h>
|
||||
#include <config.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void show_printer_list(http_t *http, cups_lang_t *language);
|
||||
static void show_printer_info(http_t *http, cups_lang_t *language,
|
||||
char *name);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry for CGI.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
cups_lang_t *language; /* Language information */
|
||||
char *printer; /* Printer name */
|
||||
http_t *http; /* Connection to the server */
|
||||
|
||||
|
||||
/*
|
||||
* Get the request language...
|
||||
*/
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
/*
|
||||
* Connect to the HTTP server...
|
||||
*/
|
||||
|
||||
http = httpConnect("localhost", ippPort());
|
||||
|
||||
/*
|
||||
* Tell the client to expect HTML...
|
||||
*/
|
||||
|
||||
printf("Content-Type: text/html;charset=%s\n\n", cupsLangEncoding(language));
|
||||
|
||||
/*
|
||||
* See if we need to show a list of printers or the status of a
|
||||
* single printer...
|
||||
*/
|
||||
|
||||
printer = argv[0];
|
||||
if (strcmp(printer, "/") == 0 || strcmp(printer, "printers.cgi") == 0)
|
||||
printer = NULL;
|
||||
|
||||
/*
|
||||
* Print the standard header...
|
||||
*/
|
||||
|
||||
puts("<HTML>");
|
||||
puts("<HEAD>");
|
||||
if (printer)
|
||||
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10\">");
|
||||
else
|
||||
puts("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"30\">");
|
||||
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>");
|
||||
puts("<P ALIGN=CENTER>");
|
||||
puts("<A HREF=\"http://www.easysw.com\" ALT=\"Easy Software Products Home Page\">");
|
||||
puts("<IMG SRC=\"/images/logo.gif\" WIDTH=\"71\" HEIGHT=\"40\" BORDER=0 ALT=\"Easy Software Products Home Page\"></A>");
|
||||
puts("<IMG SRC=\"/images/navbar.gif\" WIDTH=\"540\" HEIGHT=\"40\" USEMAP=\"#navbar\" BORDER=0>");
|
||||
|
||||
printf("<H1>%s on %s</H1>\n", printer == NULL ? "Printers" : printer,
|
||||
getenv("SERVER_NAME"));
|
||||
fflush(stdout);
|
||||
|
||||
puts("<CENTER>");
|
||||
puts("<TABLE WIDTH=\"90%\" BORDER=\"1\">");
|
||||
puts("<TR>");
|
||||
puts("<TH>Name</TH>");
|
||||
puts("<TH WIDTH=\"50%\">Status</TH>");
|
||||
puts("<TH WIDTH=\"25%\">Jobs</TH>");
|
||||
puts("</TR>");
|
||||
|
||||
/*
|
||||
* Show the information...
|
||||
*/
|
||||
|
||||
if (printer == NULL)
|
||||
show_printer_list(http, language);
|
||||
else
|
||||
show_printer_info(http, language, printer);
|
||||
|
||||
/*
|
||||
* Write a standard trailer...
|
||||
*/
|
||||
|
||||
puts("</TABLE>");
|
||||
puts("</CENTER>");
|
||||
|
||||
puts("<HR>");
|
||||
|
||||
puts("<P>The Common UNIX Printing System, CUPS, and the CUPS logo are the");
|
||||
puts("trademark property of <A HREF=\"http://www.easysw.com\">Easy Software");
|
||||
puts("Products</A>. CUPS is copyright 1997-1999 by Easy Software Products,");
|
||||
puts("All Rights Reserved.");
|
||||
|
||||
puts("</BODY>");
|
||||
puts("</HTML>");
|
||||
|
||||
/*
|
||||
* Close the HTTP server connection...
|
||||
*/
|
||||
|
||||
httpClose(http);
|
||||
cupsLangFree(language);
|
||||
|
||||
/*
|
||||
* Return with no errors...
|
||||
*/
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_printer_list()' - Show a list of printers...
|
||||
*/
|
||||
|
||||
static void
|
||||
show_printer_list(http_t *http, /* I - HTTP connection */
|
||||
cups_lang_t *language)/* I - Client's language */
|
||||
{
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
|
||||
|
||||
/*
|
||||
* Build a CUPS_GET_PRINTERS request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = CUPS_GET_PRINTERS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Loop through the printers returned in the list and display
|
||||
* their devices...
|
||||
*/
|
||||
|
||||
for (attr = response->attrs; attr != NULL; attr = attr->next)
|
||||
{
|
||||
/*
|
||||
* Skip leading attributes until we hit a job...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
|
||||
attr = attr->next;
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Show the printer status for each printer...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
|
||||
{
|
||||
if (strcmp(attr->name, "printer-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
show_printer_info(http, language, attr->values[0].string.text);
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_printer_info()' - Show printer information.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_printer_info(http_t *http,
|
||||
cups_lang_t *language,
|
||||
char *name)
|
||||
{
|
||||
ipp_t *request, /* IPP request */
|
||||
*response, /* IPP response */
|
||||
*jobs; /* IPP Get Jobs response */
|
||||
int jobcount; /* Number of jobs */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
char *message; /* Printer state message */
|
||||
int accepting; /* Accepting requests? */
|
||||
ipp_pstate_t pstate; /* Printer state */
|
||||
char uri[HTTP_MAX_URI];/* Printer URI */
|
||||
|
||||
|
||||
/*
|
||||
* Build a IPP_GET_PRINTER_ATTRIBUTES request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* printer-uri
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL, cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", name);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) == NULL)
|
||||
{
|
||||
puts("<P>Unable to communicate with CUPS server!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (response->request.status.status_code == IPP_NOT_FOUND)
|
||||
{
|
||||
puts("<P>Printer does not exist.");
|
||||
ippDelete(response);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Grab the needed printer attributes...
|
||||
*/
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM)) != NULL)
|
||||
pstate = (ipp_pstate_t)attr->values[0].integer;
|
||||
else
|
||||
pstate = IPP_PRINTER_IDLE;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state-message", IPP_TAG_TEXT)) != NULL)
|
||||
message = attr->values[0].string.text;
|
||||
else
|
||||
message = NULL;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-is-accepting-jobs",
|
||||
IPP_TAG_BOOLEAN)) != NULL)
|
||||
accepting = attr->values[0].boolean;
|
||||
else
|
||||
accepting = 1;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL)
|
||||
{
|
||||
strcpy(uri, "http:");
|
||||
strncpy(uri + 5, strchr(attr->values[0].string.text, '/'), sizeof(uri) - 6);
|
||||
uri[sizeof(uri) - 1] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the printer entry...
|
||||
*/
|
||||
|
||||
puts("<TR>");
|
||||
|
||||
printf("<TD VALIGN=TOP><A HREF=\"%s\">%s</A></TD>\n", uri, name);
|
||||
|
||||
printf("<TD VALIGN=TOP><IMG SRC=\"/images/printer-%s.gif\" ALIGN=\"LEFT\">\n",
|
||||
pstate == IPP_PRINTER_IDLE ? "idle" :
|
||||
pstate == IPP_PRINTER_PROCESSING ? "processing" : "stopped");
|
||||
|
||||
printf("%s: %s, %s<BR>\n",
|
||||
cupsLangString(language, CUPS_MSG_PRINTER_STATE),
|
||||
cupsLangString(language, pstate == IPP_PRINTER_IDLE ? CUPS_MSG_IDLE :
|
||||
pstate == IPP_PRINTER_PROCESSING ?
|
||||
CUPS_MSG_PROCESSING : CUPS_MSG_STOPPED),
|
||||
cupsLangString(language, accepting ? CUPS_MSG_ACCEPTING_JOBS :
|
||||
CUPS_MSG_NOT_ACCEPTING_JOBS));
|
||||
|
||||
if (message)
|
||||
printf("<BR CLEAR=ALL><I>\"%s\"</I>\n", message);
|
||||
else if (!accepting || pstate == IPP_PRINTER_STOPPED)
|
||||
puts("<BR CLEAR=ALL><I>\"Reason Unknown\"</I>");
|
||||
|
||||
puts("</TD>");
|
||||
|
||||
/*
|
||||
* Show a list of jobs as needed...
|
||||
*/
|
||||
|
||||
if (pstate != IPP_PRINTER_IDLE)
|
||||
{
|
||||
/*
|
||||
* Build an IPP_GET_JOBS request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* printer-uri
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_JOBS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL,
|
||||
cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL,
|
||||
language->language);
|
||||
|
||||
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, "/");
|
||||
}
|
||||
else
|
||||
jobs = NULL;
|
||||
|
||||
puts("<TD VALIGN=\"TOP\">");
|
||||
jobcount = 0;
|
||||
|
||||
if (jobs != NULL)
|
||||
{
|
||||
char *username; /* Pointer to job-originating-user-name */
|
||||
int jobid, /* job-id */
|
||||
size; /* job-k-octets */
|
||||
|
||||
|
||||
for (attr = jobs->attrs; attr != NULL; attr = attr->next)
|
||||
{
|
||||
/*
|
||||
* Skip leading attributes until we hit a job...
|
||||
*/
|
||||
|
||||
while (attr != NULL && attr->group_tag != IPP_TAG_JOB)
|
||||
attr = attr->next;
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Pull the needed attributes from this job...
|
||||
*/
|
||||
|
||||
jobid = 0;
|
||||
size = 0;
|
||||
username = NULL;
|
||||
|
||||
while (attr != NULL && attr->group_tag == IPP_TAG_JOB)
|
||||
{
|
||||
if (strcmp(attr->name, "job-id") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
jobid = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-k-octets") == 0 &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
size = attr->values[0].integer;
|
||||
|
||||
if (strcmp(attr->name, "job-originating-user-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
username = attr->values[0].string.text;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the job if it matches the current printer...
|
||||
*/
|
||||
|
||||
if (username != NULL)
|
||||
{
|
||||
jobcount ++;
|
||||
printf("<A HREF=\"/jobs/%d\">%s-%d %s %dk</A><BR>\n", jobid, name,
|
||||
jobid, username, size);
|
||||
}
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(jobs);
|
||||
}
|
||||
|
||||
if (jobcount == 0)
|
||||
puts("None");
|
||||
puts("</TD>");
|
||||
puts("</TR>");
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,68 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Configuration file makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 1993-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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
#
|
||||
# Config files...
|
||||
#
|
||||
|
||||
KEEP = classes.conf cupsd.conf printers.conf
|
||||
REPLACE = mime.convs mime.types
|
||||
|
||||
#
|
||||
# Make everything...
|
||||
#
|
||||
|
||||
all:
|
||||
|
||||
#
|
||||
# Clean all config and object files...
|
||||
#
|
||||
|
||||
clean:
|
||||
|
||||
#
|
||||
# Install files...
|
||||
#
|
||||
|
||||
install:
|
||||
-$(MKDIR) $(SERVERROOT)/conf
|
||||
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$".
|
||||
#
|
||||
@@ -1,79 +0,0 @@
|
||||
#
|
||||
# "$Id: classes.conf 678 1999-09-22 18:10:55Z mike $"
|
||||
#
|
||||
# Sample class configuration file for the Common UNIX Printing System
|
||||
# (CUPS) scheduler.
|
||||
#
|
||||
# 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.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
|
||||
#
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
# This is a sample class configuration file. This file is included #
|
||||
# from the main configuration file (cups.conf) and lists all of the #
|
||||
# printer classes known to the system. #
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
#
|
||||
# Each class starts with a <Class name> definition. Class names
|
||||
# can be up to 128 characters in length and are *not* case sensitive.
|
||||
#
|
||||
# One <DefaultClass name> entry can appear in this file; if you don't
|
||||
# define a default destination, the first printer or class becomes
|
||||
# the default.
|
||||
#
|
||||
|
||||
#<Class sample>
|
||||
#
|
||||
# Info: the description for the class.
|
||||
#
|
||||
|
||||
#Info Acme LaserPrint 1000 Printers
|
||||
|
||||
#
|
||||
# MoreInfo: a URL for more information on the printer.
|
||||
#
|
||||
|
||||
#MoreInfo http://www.acme.com/lp1000.html
|
||||
|
||||
#
|
||||
# Location: the location of the printer.
|
||||
#
|
||||
|
||||
#Location Room 101 in the activities building
|
||||
|
||||
#
|
||||
# Accepting: is the class accepting jobs?
|
||||
#
|
||||
#Accepting Yes
|
||||
#Accepting No
|
||||
#
|
||||
|
||||
#
|
||||
# Printer: adds a printer to the class.
|
||||
#
|
||||
|
||||
#Printer sample
|
||||
#Printer sample@host2
|
||||
#</Class>
|
||||
|
||||
#
|
||||
# End of "$Id: classes.conf 678 1999-09-22 18:10:55Z mike $".
|
||||
#
|
||||
@@ -1,369 +0,0 @@
|
||||
#
|
||||
# "$Id: cupsd.conf 628 1999-08-23 15:24:48Z mike $"
|
||||
#
|
||||
# Sample configuration file for the Common UNIX Printing System (CUPS)
|
||||
# scheduler.
|
||||
#
|
||||
# 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.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
|
||||
#
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
# This is the CUPS configuration file. If you are familiar with #
|
||||
# Apache or any of the other popular web servers, we've followed the #
|
||||
# same format. Any configuration variable used here has the same #
|
||||
# semantics as the corresponding variable in Apache. If we need #
|
||||
# different functionality then a different name is used to avoid #
|
||||
# confusion... #
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
#
|
||||
# Ports/addresses that we listen to. The default port 631 is reserved
|
||||
# for the Internet Printing Protocol (IPP) and is what we use here.
|
||||
#
|
||||
# You can have multiple Port/Listen lines to listen to more than one
|
||||
# port or address, or to restrict access:
|
||||
#
|
||||
# Port 80
|
||||
# Port 631
|
||||
# Listen hostname
|
||||
# Listen hostname:80
|
||||
# Listen hostname:631
|
||||
# Listen 1.2.3.4
|
||||
# Listen 1.2.3.4:631
|
||||
#
|
||||
|
||||
#Port 80
|
||||
Port 631
|
||||
|
||||
#
|
||||
# MaxClients: controls the maximum number of simultaneous clients that
|
||||
# will be handled. Defaults to 100.
|
||||
#
|
||||
|
||||
#MaxClients 100
|
||||
|
||||
#
|
||||
# User/Group: the user and group the server runs under. Normally this
|
||||
# must be lp and sys, however you can configure things for another user
|
||||
# or group as needed.
|
||||
#
|
||||
# Note: the server must be run initially as root to support the
|
||||
# default IPP port of 631. It changes users whenever an external
|
||||
# program is run...
|
||||
#
|
||||
|
||||
#User lp
|
||||
#Group sys
|
||||
|
||||
#
|
||||
# SystemGroup: the group name for "System" (printer administration)
|
||||
# access. The default varies depending on the operating system, but
|
||||
# will be "sys", "system", or "root" (checked for in that order.)
|
||||
#
|
||||
|
||||
#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
|
||||
|
||||
#
|
||||
# ServerAdmin: the email address to send all complaints/problems to.
|
||||
# By default CUPS will use "root@hostname".
|
||||
#
|
||||
|
||||
#ServerAdmin root@your.domain.com
|
||||
|
||||
#
|
||||
# ServerRoot: the root directory for the scheduler.
|
||||
# By default the compiled-in value.
|
||||
#
|
||||
|
||||
#ServerRoot /var/cups
|
||||
|
||||
#
|
||||
# AccessLog: the access log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/access_log"
|
||||
#
|
||||
|
||||
#AccessLog logs/access_log
|
||||
|
||||
#
|
||||
# ErrorLog: the error log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/error_log"
|
||||
#
|
||||
|
||||
#ErrorLog logs/error_log
|
||||
|
||||
#
|
||||
# PageLog: the page log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/page_log"
|
||||
#
|
||||
|
||||
#PageLog logs/page_log
|
||||
|
||||
#
|
||||
# LogLevel: controls the number of messages logged to the ErrorLog
|
||||
# file and can be one of the following:
|
||||
#
|
||||
# debug Log everything.
|
||||
# info Log all requests and state changes.
|
||||
# warn Log errors and warnings.
|
||||
# error Log only errors.
|
||||
# none Log nothing.
|
||||
#
|
||||
|
||||
LogLevel info
|
||||
|
||||
#
|
||||
# MaxLogSize: controls the maximum size of each log file before they are
|
||||
# rotated. Defaults to 1048576 (1MB). Set to 0 to disable log rotating.
|
||||
#
|
||||
|
||||
#MaxLogSize 0
|
||||
|
||||
#
|
||||
# MaxRequestSize: controls the maximum size of print files. Set to 0 to
|
||||
# disable this feature (defaults to 0.)
|
||||
#
|
||||
|
||||
#MaxRequestSize 0
|
||||
|
||||
#
|
||||
# HostNameLookups: whether or not to do lookups on IP addresses to get a
|
||||
# fully-qualified hostname. This defaults to Off for performance reasons...
|
||||
#
|
||||
|
||||
#HostNameLookups On
|
||||
|
||||
#
|
||||
# Timeout: the timeout before requests time out. Default is 300 seconds.
|
||||
#
|
||||
|
||||
#Timeout 300
|
||||
|
||||
#
|
||||
# KeepAlive: whether or not to support the Keep-Alive connection
|
||||
# option. Default is on.
|
||||
#
|
||||
|
||||
#KeepAlive On
|
||||
|
||||
#
|
||||
# KeepAliveTimeout: the timeout before Keep-Alive connections are
|
||||
# automatically closed. Default is 60 seconds.
|
||||
#
|
||||
|
||||
#KeepAliveTimeout 60
|
||||
|
||||
#
|
||||
# ImplicitClasses: whether or not to use implicit classes.
|
||||
#
|
||||
# Printer classes can be specified explicitly in the classes.conf
|
||||
# file, implicitly based upon the printers available on the LAN, or
|
||||
# both.
|
||||
#
|
||||
# When ImplicitClasses is On, printers on the LAN with the same name
|
||||
# (e.g. Acme-LaserPrint-1000) will be put into a class with the same
|
||||
# name. This allows you to setup multiple redundant queues on a LAN
|
||||
# without a lot of administrative difficulties. If a user sends a
|
||||
# job to Acme-LaserPrint-1000, the job will go to the first available
|
||||
# queue.
|
||||
#
|
||||
# Enabled by default.
|
||||
#
|
||||
|
||||
#ImplicitClasses On
|
||||
|
||||
#
|
||||
# Browsing: whether or not to broadcast printer information to
|
||||
# other CUPS servers. Enabled by default.
|
||||
#
|
||||
|
||||
#Browsing On
|
||||
|
||||
#
|
||||
# BrowseInterval: the time between browsing updates in seconds. Default
|
||||
# is 30 seconds.
|
||||
#
|
||||
# Note that browsing information is sent whenever a printer's state changes
|
||||
# as well, so this represents the maximum time between updates.
|
||||
#
|
||||
|
||||
#BrowseInterval 30
|
||||
|
||||
#
|
||||
# BrowseTimeout: the timeout for network printers - if we don't
|
||||
# get an update within this time the printer will be removed
|
||||
# from the printer list. This number definitely should not be
|
||||
# less the BrowseInterval value for obvious reasons. Defaults
|
||||
# to 300 seconds.
|
||||
#
|
||||
|
||||
#BrowseTimeout 300
|
||||
|
||||
#
|
||||
# BrowsePort: the port used for UDP broadcasts. By default this is
|
||||
# the IPP port; if you change this you need to do it on all servers.
|
||||
# Only one BrowsePort is recognized.
|
||||
#
|
||||
|
||||
#BrowsePort 631
|
||||
|
||||
#
|
||||
# BrowseAddress: specifies a broadcast address to be used. By
|
||||
# default browsing information is broadcast to all active interfaces.
|
||||
#
|
||||
# Note: HP-UX 10.20 and earlier do not properly handle broadcast unless
|
||||
# you have a Class A, B, C, or D netmask (i.e. no CIDR support).
|
||||
#
|
||||
|
||||
#BrowseAddress x.y.z.255
|
||||
#BrowseAddress x.y.255.255
|
||||
#BrowseAddress x.255.255.255
|
||||
|
||||
#
|
||||
# DocumentRoot: the root directory for HTTP documents that are served.
|
||||
# By default the compiled in directory.
|
||||
#
|
||||
|
||||
#DocumentRoot /usr/share/cups/doc
|
||||
|
||||
#
|
||||
# DefaultLanguage: the default language if not specified by the browser.
|
||||
# If not specified, the current locale is used.
|
||||
#
|
||||
|
||||
#DefaultLanguage en
|
||||
|
||||
#
|
||||
# DefaultCharset: the default character set to use. If not specified,
|
||||
# defaults to iso-8859-1. Note that this can also be overridden in
|
||||
# HTML documents...
|
||||
#
|
||||
|
||||
#DefaultCharset iso-8859-1
|
||||
|
||||
#
|
||||
# RIPCache: the amount of memory that each RIP should use to cache
|
||||
# bitmaps. The value can be any real number followed by "k" for
|
||||
# kilobytes, "m" for megabytes, "g" for gigabytes, or "t" for tiles
|
||||
# (1 tile = 256x256 pixels.) Defaults to "8m" (8 megabytes).
|
||||
#
|
||||
|
||||
#RIPCache 8m
|
||||
|
||||
#
|
||||
# TempDir: the directory to put temporary files in. This directory must be
|
||||
# writable by the user defined above! Defaults to "/var/tmp" or the value
|
||||
# of the TMPDIR environment variable.
|
||||
#
|
||||
|
||||
#TempDir /var/tmp
|
||||
|
||||
#
|
||||
# Access permissions for each directory served by the scheduler.
|
||||
# Locations are relative to DocumentRoot...
|
||||
#
|
||||
# AuthType: the authorization to use; currently only "Basic" authorization is
|
||||
# supported.
|
||||
#
|
||||
# AuthClass: the authorization class; currently only "Anonymous", "User",
|
||||
# "System" (valid user belonging to group SystemGroup), and "Group"
|
||||
# (valid user belonging to the specified group) are supported.
|
||||
#
|
||||
# AuthGroupName: the group name for "Group" authorization.
|
||||
#
|
||||
# Order: the order of Allow/Deny processing.
|
||||
#
|
||||
# Allow: allows access from the specified hostname, domain, IP address, or
|
||||
# network.
|
||||
#
|
||||
# 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>
|
||||
|
||||
<Location /printers>
|
||||
#
|
||||
# You may wish to limit access to printers and classes, either with Allow
|
||||
# and Deny lines, or by requiring a username and password.
|
||||
#
|
||||
|
||||
## Require a username and password
|
||||
#AuthType Basic
|
||||
#AuthClass User
|
||||
|
||||
## Restrict access to local domain
|
||||
#Order Deny,Allow
|
||||
#Deny From All
|
||||
#Allow From .mydomain.com
|
||||
</Location>
|
||||
|
||||
<Location /admin>
|
||||
#
|
||||
# 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 the system group to do any admin tasks. You can change
|
||||
# the group name using the SystemGroup directive.
|
||||
#
|
||||
|
||||
AuthType Basic
|
||||
AuthClass System
|
||||
|
||||
## Restrict access to local domain
|
||||
Order Deny,Allow
|
||||
Deny From All
|
||||
Allow From 127.0.0.1
|
||||
</Location>
|
||||
|
||||
#
|
||||
# End of "$Id: cupsd.conf 628 1999-08-23 15:24:48Z mike $".
|
||||
#
|
||||
@@ -1,250 +0,0 @@
|
||||
#
|
||||
# "$Id: cupsd.conf-personal 407 1999-06-17 20:02:43Z mike $"
|
||||
#
|
||||
# Scheduler configuration file for ESP Print Personal.
|
||||
#
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
# This is the CUPS configuration file. If you are familiar with #
|
||||
# Apache or any of the other popular web servers, we've followed the #
|
||||
# same format. Any configuration variable used here has the same #
|
||||
# semantics as the corresponding variable in Apache. If we need #
|
||||
# different functionality then a different name is used to avoid #
|
||||
# confusion... #
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
#
|
||||
# Ports/addresses that we listen to. The default port 631 is reserved
|
||||
# for the Internet Printing Protocol (IPP) and is what we use here.
|
||||
#
|
||||
# You can have multiple Listen lines to listen to more than one
|
||||
# port:
|
||||
#
|
||||
# Listen 127.0.0.1:80
|
||||
# Listen 127.0.0.1:631
|
||||
#
|
||||
# For ESP Print Personal, we can only listen on the local host...
|
||||
#
|
||||
|
||||
#Listen 127.0.0.1:80
|
||||
Listen 127.0.0.1:631
|
||||
|
||||
#
|
||||
# User/Group: the user and group the server runs under. Normally this
|
||||
# must be lp and sys, however you can configure things for another user
|
||||
# or group as needed.
|
||||
#
|
||||
# Note: the server must be run initially as root to support the
|
||||
# default IPP port of 631. It changes users whenever an external
|
||||
# program is run...
|
||||
#
|
||||
|
||||
User lp
|
||||
Group sys
|
||||
|
||||
#
|
||||
# SystemGroup: the group name for "System" (printer administration)
|
||||
# access.
|
||||
#
|
||||
|
||||
SystemGroup sys
|
||||
|
||||
#
|
||||
# ServerName: the hostname of your server, as advertised to the world.
|
||||
# By default CUPS will use the hostname of the system.
|
||||
#
|
||||
|
||||
#ServerName myhost.domain.com
|
||||
|
||||
#
|
||||
# ServerAdmin: the email address to send all complaints/problems to.
|
||||
# By default CUPS will use "root@hostname".
|
||||
#
|
||||
|
||||
#ServerAdmin root@your.domain.com
|
||||
|
||||
#
|
||||
# ServerRoot: the root directory for the scheduler.
|
||||
# By default the compiled-in value.
|
||||
#
|
||||
|
||||
#ServerRoot /var/cups
|
||||
|
||||
#
|
||||
# AccessLog: the access log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/access_log"
|
||||
#
|
||||
|
||||
#AccessLog logs/access_log
|
||||
|
||||
#
|
||||
# ErrorLog: the error log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/error_log"
|
||||
#
|
||||
|
||||
#ErrorLog logs/error_log
|
||||
|
||||
#
|
||||
# PageLog: the page log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/page_log"
|
||||
#
|
||||
|
||||
#PageLog logs/page_log
|
||||
|
||||
#
|
||||
# LogLevel: controls the number of messages logged to the ErrorLog
|
||||
# file and can be one of the following:
|
||||
#
|
||||
# debug Log everything.
|
||||
# info Log all requests and state changes.
|
||||
# warn Log errors and warnings.
|
||||
# error Log only errors.
|
||||
# none Log nothing.
|
||||
#
|
||||
|
||||
LogLevel info
|
||||
|
||||
#
|
||||
# MaxLogSize: controls the maximum size of each log file before they are
|
||||
# rotated. Defaults to 1048576 (1MB). Set to 0 to disable log rotating.
|
||||
#
|
||||
|
||||
#MaxLogSize 0
|
||||
|
||||
#
|
||||
# MaxRequestSize: controls the maximum size of print files. Set to 0 to
|
||||
# disable this feature (defaults to 0.)
|
||||
#
|
||||
|
||||
#MaxRequestSize 0
|
||||
|
||||
#
|
||||
# HostNameLookups: whether or not to do lookups on IP addresses to get a
|
||||
# fully-qualified hostname. This defaults to Off for performance reasons...
|
||||
#
|
||||
|
||||
#HostNameLookups On
|
||||
|
||||
#
|
||||
# Timeout: the timeout before requests time out. Default is 300 seconds.
|
||||
#
|
||||
|
||||
#Timeout 300
|
||||
|
||||
#
|
||||
# KeepAlive: whether or not to support the Keep-Alive connection
|
||||
# option. Default is on.
|
||||
#
|
||||
|
||||
#KeepAlive On
|
||||
|
||||
#
|
||||
# KeepAliveTimeout: the timeout before Keep-Alive connections are
|
||||
# automatically closed. Default is 60 seconds.
|
||||
#
|
||||
|
||||
#KeepAliveTimeout 60
|
||||
|
||||
#
|
||||
# Browsing: not available in ESP Print Personal.
|
||||
#
|
||||
|
||||
Browsing Off
|
||||
|
||||
#
|
||||
# DocumentRoot: the root directory for HTTP documents that are served.
|
||||
# By default the compiled in directory.
|
||||
#
|
||||
|
||||
#DocumentRoot /usr/share/cups/doc
|
||||
|
||||
#
|
||||
# DefaultLanguage: the default language if not specified by the browser.
|
||||
# If not specified, the current locale is used.
|
||||
#
|
||||
|
||||
#DefaultLanguage en
|
||||
|
||||
#
|
||||
# DefaultCharset: the default character set to use. If not specified,
|
||||
# defaults to iso-8859-1. Note that this can also be overridden in
|
||||
# HTML documents...
|
||||
#
|
||||
|
||||
#DefaultCharset iso-8859-1
|
||||
|
||||
#
|
||||
# RIPCache: the amount of memory that each RIP should use to cache
|
||||
# bitmaps. The value can be any real number followed by "k" for
|
||||
# kilobytes, "m" for megabytes, "g" for gigabytes, or "t" for tiles
|
||||
# (1 tile = 256x256 pixels.) Defaults to "32m" (32 megabytes).
|
||||
#
|
||||
|
||||
#RIPCache: 32m
|
||||
|
||||
#
|
||||
# Access permissions for each directory served by the scheduler.
|
||||
# Locations are relative to DocumentRoot...
|
||||
#
|
||||
# AuthType: the authorization to use; currently only "Basic" authorization is
|
||||
# supported.
|
||||
#
|
||||
# AuthClass: the authorization class; currently only "Anonymous", "User",
|
||||
# "System" (valid user belonging to group SystemGroup), and "Group"
|
||||
# (valid user belonging to the specified group) are supported.
|
||||
#
|
||||
# AuthGroupName: the group name for "Group" authorization.
|
||||
#
|
||||
# Order: the order of Allow/Deny processing.
|
||||
#
|
||||
# Allow: allows access from the specified hostname, domain, IP address, or
|
||||
# network.
|
||||
#
|
||||
# Deny: denies access from the specified hostname, domain, IP address, or
|
||||
# network.
|
||||
#
|
||||
|
||||
<Location />
|
||||
</Location>
|
||||
|
||||
<Location /printers>
|
||||
#
|
||||
# You may wish to limit access to printers and classes, either with Allow
|
||||
# and Deny lines, or by requiring a username and password.
|
||||
#
|
||||
|
||||
## Require a username and password
|
||||
#AuthType Basic
|
||||
#AuthClass User
|
||||
|
||||
## Restrict access to local domain
|
||||
#Order Deny,Allow
|
||||
#Deny From All
|
||||
#Allow From .mydomain.com
|
||||
</Location>
|
||||
|
||||
<Location /admin>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
AuthType Basic
|
||||
AuthClass System
|
||||
|
||||
## Restrict access to local domain
|
||||
Order Deny,Allow
|
||||
Deny From All
|
||||
Allow From 127.0.0.1
|
||||
</Location>
|
||||
|
||||
#
|
||||
# End of "$Id: cupsd.conf-personal 407 1999-06-17 20:02:43Z mike $".
|
||||
#
|
||||
@@ -1,313 +0,0 @@
|
||||
#
|
||||
# "$Id: cupsd.conf-professional 407 1999-06-17 20:02:43Z mike $"
|
||||
#
|
||||
# Scheduler configuration file for ESP Print Professional.
|
||||
#
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
# This is the CUPS configuration file. If you are familiar with #
|
||||
# Apache or any of the other popular web servers, we've followed the #
|
||||
# same format. Any configuration variable used here has the same #
|
||||
# semantics as the corresponding variable in Apache. If we need #
|
||||
# different functionality then a different name is used to avoid #
|
||||
# confusion... #
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
#
|
||||
# Ports/addresses that we listen to. The default port 631 is reserved
|
||||
# for the Internet Printing Protocol (IPP) and is what we use here.
|
||||
#
|
||||
# You can have multiple Port/Listen lines to listen to more than one
|
||||
# port or address, or to restrict access:
|
||||
#
|
||||
# Port 80
|
||||
# Port 631
|
||||
# Listen hostname
|
||||
# Listen hostname:80
|
||||
# Listen hostname:631
|
||||
# Listen 1.2.3.4
|
||||
# Listen 1.2.3.4:631
|
||||
#
|
||||
|
||||
#Port 80
|
||||
Port 631
|
||||
|
||||
#
|
||||
# User/Group: the user and group the server runs under. Normally this
|
||||
# must be lp and sys, however you can configure things for another user
|
||||
# or group as needed.
|
||||
#
|
||||
# Note: the server must be run initially as root to support the
|
||||
# default IPP port of 631. It changes users whenever an external
|
||||
# program is run...
|
||||
#
|
||||
|
||||
User lp
|
||||
Group sys
|
||||
|
||||
#
|
||||
# SystemGroup: the group name for "System" (printer administration)
|
||||
# access.
|
||||
#
|
||||
|
||||
SystemGroup sys
|
||||
|
||||
#
|
||||
# ServerName: the hostname of your server, as advertised to the world.
|
||||
# By default CUPS will use the hostname of the system.
|
||||
#
|
||||
|
||||
#ServerName myhost.domain.com
|
||||
|
||||
#
|
||||
# ServerAdmin: the email address to send all complaints/problems to.
|
||||
# By default CUPS will use "root@hostname".
|
||||
#
|
||||
|
||||
#ServerAdmin root@your.domain.com
|
||||
|
||||
#
|
||||
# ServerRoot: the root directory for the scheduler.
|
||||
# By default the compiled-in value.
|
||||
#
|
||||
|
||||
#ServerRoot /var/cups
|
||||
|
||||
#
|
||||
# AccessLog: the access log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/access_log"
|
||||
#
|
||||
|
||||
#AccessLog logs/access_log
|
||||
|
||||
#
|
||||
# ErrorLog: the error log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/error_log"
|
||||
#
|
||||
|
||||
#ErrorLog logs/error_log
|
||||
|
||||
#
|
||||
# PageLog: the page log file; if this does not start with a leading /
|
||||
# then it is assumed to be relative to ServerRoot. By default set to
|
||||
# "logs/page_log"
|
||||
#
|
||||
|
||||
#PageLog logs/page_log
|
||||
|
||||
#
|
||||
# LogLevel: controls the number of messages logged to the ErrorLog
|
||||
# file and can be one of the following:
|
||||
#
|
||||
# debug Log everything.
|
||||
# info Log all requests and state changes.
|
||||
# warn Log errors and warnings.
|
||||
# error Log only errors.
|
||||
# none Log nothing.
|
||||
#
|
||||
|
||||
LogLevel info
|
||||
|
||||
#
|
||||
# MaxLogSize: controls the maximum size of each log file before they are
|
||||
# rotated. Defaults to 1048576 (1MB). Set to 0 to disable log rotating.
|
||||
#
|
||||
|
||||
#MaxLogSize 0
|
||||
|
||||
#
|
||||
# MaxRequestSize: controls the maximum size of print files. Set to 0 to
|
||||
# disable this feature (defaults to 0.)
|
||||
#
|
||||
|
||||
#MaxRequestSize 0
|
||||
|
||||
#
|
||||
# HostNameLookups: whether or not to do lookups on IP addresses to get a
|
||||
# fully-qualified hostname. This defaults to Off for performance reasons...
|
||||
#
|
||||
|
||||
#HostNameLookups On
|
||||
|
||||
#
|
||||
# Timeout: the timeout before requests time out. Default is 300 seconds.
|
||||
#
|
||||
|
||||
#Timeout 300
|
||||
|
||||
#
|
||||
# KeepAlive: whether or not to support the Keep-Alive connection
|
||||
# option. Default is on.
|
||||
#
|
||||
|
||||
#KeepAlive On
|
||||
|
||||
#
|
||||
# KeepAliveTimeout: the timeout before Keep-Alive connections are
|
||||
# automatically closed. Default is 60 seconds.
|
||||
#
|
||||
|
||||
#KeepAliveTimeout 60
|
||||
|
||||
#
|
||||
# ImplicitClasses: whether or not to use implicit classes.
|
||||
#
|
||||
# Printer classes can be specified explicitly in the classes.conf
|
||||
# file, implicitly based upon the printers available on the LAN, or
|
||||
# both.
|
||||
#
|
||||
# When ImplicitClasses is On, printers on the LAN with the same name
|
||||
# (e.g. Acme-LaserPrint-1000) will be put into a class with the same
|
||||
# name. This allows you to setup multiple redundant queues on a LAN
|
||||
# without a lot of administrative difficulties. If a user sends a
|
||||
# job to Acme-LaserPrint-1000, the job will go to the first available
|
||||
# queue.
|
||||
#
|
||||
# Enabled by default.
|
||||
#
|
||||
|
||||
#ImplicitClasses On
|
||||
|
||||
#
|
||||
# Browsing: whether or not to broadcast printer information to
|
||||
# other CUPS servers. Enabled by default.
|
||||
#
|
||||
|
||||
#Browsing On
|
||||
|
||||
#
|
||||
# BrowseInterval: the time between browsing updates in seconds. Default
|
||||
# is 30 seconds.
|
||||
#
|
||||
# Note that browsing information is sent whenever a printer's state changes
|
||||
# as well, so this represents the maximum time between updates.
|
||||
#
|
||||
|
||||
#BrowseInterval 30
|
||||
|
||||
#
|
||||
# BrowseTimeout: the timeout for network printers - if we don't
|
||||
# get an update within this time the printer will be removed
|
||||
# from the printer list. This number definitely should not be
|
||||
# less the BrowseInterval value for obvious reasons. Defaults
|
||||
# to 300 seconds.
|
||||
#
|
||||
|
||||
#BrowseTimeout 300
|
||||
|
||||
#
|
||||
# BrowsePort: the port used for UDP broadcasts. By default this is
|
||||
# the IPP port; if you change this you need to do it on all servers.
|
||||
# Only one BrowsePort is recognized.
|
||||
#
|
||||
|
||||
#BrowsePort 631
|
||||
|
||||
#
|
||||
# BrowseAddress: specifies a broadcast address to be used. By
|
||||
# default browsing information is broadcast to all active interfaces.
|
||||
#
|
||||
# Note: HP-UX 10.20 and earlier do not properly handle broadcast unless
|
||||
# you have a Class A, B, C, or D netmask (i.e. no CIDR support).
|
||||
#
|
||||
|
||||
#BrowseAddress x.y.z.255
|
||||
#BrowseAddress x.y.255.255
|
||||
#BrowseAddress x.255.255.255
|
||||
|
||||
#
|
||||
# DocumentRoot: the root directory for HTTP documents that are served.
|
||||
# By default the compiled in directory.
|
||||
#
|
||||
|
||||
#DocumentRoot /usr/share/cups/doc
|
||||
|
||||
#
|
||||
# DefaultLanguage: the default language if not specified by the browser.
|
||||
# If not specified, the current locale is used.
|
||||
#
|
||||
|
||||
#DefaultLanguage en
|
||||
|
||||
#
|
||||
# DefaultCharset: the default character set to use. If not specified,
|
||||
# defaults to iso-8859-1. Note that this can also be overridden in
|
||||
# HTML documents...
|
||||
#
|
||||
|
||||
#DefaultCharset iso-8859-1
|
||||
|
||||
#
|
||||
# RIPCache: the amount of memory that each RIP should use to cache
|
||||
# bitmaps. The value can be any real number followed by "k" for
|
||||
# kilobytes, "m" for megabytes, "g" for gigabytes, or "t" for tiles
|
||||
# (1 tile = 256x256 pixels.) Defaults to "32m" (32 megabytes).
|
||||
#
|
||||
|
||||
#RIPCache: 32m
|
||||
|
||||
#
|
||||
# Access permissions for each directory served by the scheduler.
|
||||
# Locations are relative to DocumentRoot...
|
||||
#
|
||||
# AuthType: the authorization to use; currently only "Basic" authorization is
|
||||
# supported.
|
||||
#
|
||||
# AuthClass: the authorization class; currently only "Anonymous", "User",
|
||||
# "System" (valid user belonging to group SystemGroup), and "Group"
|
||||
# (valid user belonging to the specified group) are supported.
|
||||
#
|
||||
# AuthGroupName: the group name for "Group" authorization.
|
||||
#
|
||||
# Order: the order of Allow/Deny processing.
|
||||
#
|
||||
# Allow: allows access from the specified hostname, domain, IP address, or
|
||||
# network.
|
||||
#
|
||||
# Deny: denies access from the specified hostname, domain, IP address, or
|
||||
# network.
|
||||
#
|
||||
|
||||
<Location />
|
||||
</Location>
|
||||
|
||||
<Location /printers>
|
||||
#
|
||||
# You may wish to limit access to printers and classes, either with Allow
|
||||
# and Deny lines, or by requiring a username and password.
|
||||
#
|
||||
|
||||
## Require a username and password
|
||||
#AuthType Basic
|
||||
#AuthClass User
|
||||
|
||||
## Restrict access to local domain
|
||||
#Order Deny,Allow
|
||||
#Deny From All
|
||||
#Allow From .mydomain.com
|
||||
</Location>
|
||||
|
||||
<Location /admin>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
AuthType Basic
|
||||
AuthClass System
|
||||
|
||||
## Restrict access to local domain
|
||||
Order Deny,Allow
|
||||
Deny From All
|
||||
Allow From 127.0.0.1
|
||||
</Location>
|
||||
|
||||
#
|
||||
# End of "$Id: cupsd.conf-professional 407 1999-06-17 20:02:43Z mike $".
|
||||
#
|
||||
@@ -1,62 +0,0 @@
|
||||
#
|
||||
# "$Id: mime.convs 575 1999-07-30 13:57:16Z mike $"
|
||||
#
|
||||
# MIME converts file 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
|
||||
#
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Format of Lines:
|
||||
#
|
||||
# source/type destination/type cost filter
|
||||
#
|
||||
# General Notes:
|
||||
#
|
||||
# Currently the "cost" field is not used (all filters are assumed to
|
||||
# be equally costly in terms of speed/memory). Also, a filter program
|
||||
# *must* accept the standard command-line arguments (job-id, user, title,
|
||||
# copies,options,[filename or stdin]) or this won't work.
|
||||
#
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# PostScript filters
|
||||
#
|
||||
|
||||
#application/msword application/postscript 50 mswordtops
|
||||
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
|
||||
#text/html application/postscript 50 htmltops
|
||||
text/plain application/postscript 50 texttops
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Raster filters...
|
||||
#
|
||||
|
||||
image/* application/vnd.cups-raster 50 imagetoraster
|
||||
application/vnd.cups-postscript application/vnd.cups-raster 50 pstoraster
|
||||
|
||||
#
|
||||
# End of "$Id: mime.convs 575 1999-07-30 13:57:16Z mike $".
|
||||
#
|
||||
@@ -1,122 +0,0 @@
|
||||
#
|
||||
# "$Id: mime.types 575 1999-07-30 13:57:16Z mike $"
|
||||
#
|
||||
# MIME types file 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
|
||||
#
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Format of Lines:
|
||||
#
|
||||
# super/type rules
|
||||
#
|
||||
# "rules" can be any combination of:
|
||||
#
|
||||
# ( expr ) Parenthesis for expression grouping
|
||||
# + Logical AND
|
||||
# , or whitespace Logical OR
|
||||
# ! Logical NOT
|
||||
# match("pattern") Pattern match on filename
|
||||
# extension Pattern match on "*.extension"
|
||||
# ascii(offset,length) True if bytes are valid printable ASCII
|
||||
# (CR, NL, TAB, BS, 32-126)
|
||||
# printable(offset,length) True if bytes are printable 8-bit chars
|
||||
# (CR, NL, TAB, BS, 32-126, 160-254)
|
||||
# string(offset,"string") True if bytes are identical to string
|
||||
# char(offset,value) True if byte is identical
|
||||
# short(offset,value) True if 16-bit integer is identical
|
||||
# int(offset,value) True if 32-bit integer is identical
|
||||
# locale("string") True if current locale matches string
|
||||
#
|
||||
# General Notes:
|
||||
#
|
||||
# MIME type names are case-insensitive. Internally they are converted
|
||||
# to lowercase. Multiple occurrences of a type will cause the provided
|
||||
# rules to be appended to the existing definition. Type names are sorted
|
||||
# in ascending order, so if two types use the same rules to resolve a type
|
||||
# (e.g. doc extension for two types), the returned type will be the first
|
||||
# type in the sorted list.
|
||||
#
|
||||
# The "printable" rule differs from the "ascii" rule in that it also
|
||||
# accepts 8-bit characters in the range 160-254.
|
||||
#
|
||||
# String constants must be surrounded by "" if they contain whitespace.
|
||||
# To instead binary data into a string, use the <hex> notation.
|
||||
#
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Application-generated files...
|
||||
#
|
||||
|
||||
application/msword doc string(0,<D0CF11E0A1B11AE1>)
|
||||
application/pdf pdf string(0,%PDF)
|
||||
application/postscript ai eps ps string(0,%!) string(0,<04>%!)
|
||||
application/vnd.hp-HPGL hpgl string(0,<1b>%) string(0,<1b>&)\
|
||||
string(0,<1b>E) string(0,<201b>)\
|
||||
string(0,BP;) string(0,IN;) string(0,DF;)
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Image files...
|
||||
#
|
||||
|
||||
image/gif gif string(0,GIF87a) string(0,GIF89a)
|
||||
image/png png string(0,<89>PNG)
|
||||
image/jpeg jpeg jpg jpe string(6,JFIF)
|
||||
image/tiff tiff tif string(0,MM) string(0,II)
|
||||
image/x-photocd pcd string(2048,PCD_IPI)
|
||||
image/x-portable-anymap pnm
|
||||
image/x-portable-bitmap pbm string(0,P1) string(0,P4)
|
||||
image/x-portable-graymap pgm string(0,P2) string(0,P5)
|
||||
image/x-portable-pixmap ppm string(0,P3) string(0,P6)
|
||||
image/x-sgi-rgb rgb sgi bw icon short(0,474)
|
||||
image/x-xbitmap xbm
|
||||
image/x-xpixmap xpm ascii(0,1024) + string(3,"XPM")
|
||||
image/x-xwindowdump xwd
|
||||
image/x-sun-raster ras
|
||||
|
||||
# TODO: Add Alias, SoftImage, GIMP??? files
|
||||
#image/x-alias pix
|
||||
#image/x-softimage
|
||||
#image/x-gimp-xcf xcf xcf.gz
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Text files...
|
||||
#
|
||||
|
||||
text/html html htm printable(0,1024) +\
|
||||
(string(0,"<HTML>") string(0,"<!DOCTYPE"))
|
||||
text/plain txt printable(0,1024)
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# CUPS-specific types...
|
||||
#
|
||||
|
||||
application/vnd.cups-postscript string(0,<1B>%-12345X)
|
||||
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
|
||||
application/vnd.cups-raw
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 575 1999-07-30 13:57:16Z mike $".
|
||||
#
|
||||
@@ -1,2 +0,0 @@
|
||||
# This is a dummy printcap file that is automatically generated by the
|
||||
# CUPS software for old applications that rely on it.
|
||||
@@ -1,96 +0,0 @@
|
||||
#
|
||||
# "$Id: printers.conf 678 1999-09-22 18:10:55Z mike $"
|
||||
#
|
||||
# Sample printer configuration file for the Common UNIX Printing System
|
||||
# (CUPS) scheduler.
|
||||
#
|
||||
# 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.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
|
||||
#
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
# This is a sample printer configuration file. This file is included #
|
||||
# from the main configuration file (cups.conf) and lists all of the #
|
||||
# printers known to the system. #
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
#
|
||||
# Each printer starts with a <Printer name> definition. Printer names
|
||||
# can be up to 128 characters in length and are *not* case sensitive.
|
||||
#
|
||||
# One <DefaultPrinter name> entry can appear in this file; if you don't
|
||||
# define a default destination, the first printer or class becomes the
|
||||
# default.
|
||||
#
|
||||
|
||||
#<Printer sample>
|
||||
#
|
||||
# Info: the description for the printer.
|
||||
#
|
||||
|
||||
#Info Acme LaserPrint 1000
|
||||
|
||||
#
|
||||
# MoreInfo: a URL for more information on the printer.
|
||||
#
|
||||
|
||||
#MoreInfo http://www.acme.com/lp1000.html
|
||||
|
||||
#
|
||||
# Location: the location of the printer.
|
||||
#
|
||||
|
||||
#Location Room 101 in the activities building
|
||||
|
||||
#
|
||||
# DeviceURI: the device URI for this printer.
|
||||
#
|
||||
|
||||
#DeviceURI parallel:/dev/plp
|
||||
#DeviceURI serial:/dev/ttyd1?baud=38400+size=8+parity=none+flow=soft
|
||||
#DeviceURI scsi:/dev/scsi/sc1d6l0
|
||||
#DeviceURI socket://hostname:port
|
||||
#DeviceURI tftp://hostname/path
|
||||
#DeviceURI ftp://hostname/path
|
||||
#DeviceURI http://hostname[:port]/path
|
||||
#DeviceURI ipp://hostname/path
|
||||
#DeviceURI smb://hostname/printer
|
||||
|
||||
#
|
||||
# State: sets the initial state of the printer. Can be one of the
|
||||
# following:
|
||||
#
|
||||
# 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 678 1999-09-22 18:10:55Z mike $".
|
||||
#
|
||||
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# "$Id: compiler.m4 142 2006-08-17 14:50:46Z mike $"
|
||||
#
|
||||
# Common compiler stuff for autoconf...
|
||||
#
|
||||
|
||||
CFLAGS="${CFLAGS:=}"
|
||||
LDFLAGS="${LDFLAGS:=}"
|
||||
LIBS="${LIBS:=}"
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
|
||||
[if test x$enable_debug = xyes; then
|
||||
CFLAGS="-g $CFLAGS"
|
||||
LDFLAGS="-g $LDFLAGS"
|
||||
fi])
|
||||
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PATH_PROG(RM,rm)
|
||||
|
||||
dnl Support large files.
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl Add -Wall for GCC...
|
||||
if test -n "$GCC"; then
|
||||
dnl Extended warnings...
|
||||
CFLAGS="-Wshadow -Winline $CFLAGS"
|
||||
dnl Standard warnings...
|
||||
CFLAGS="-Wall -Wunused -Wno-char-subscripts -Wno-format-y2k $CFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: compiler.m4 142 2006-08-17 14:50:46Z mike $".
|
||||
#
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Common C++ compiler stuff for autoconf...
|
||||
#
|
||||
|
||||
CXXFLAGS="${CXXFLAGS:=}"
|
||||
|
||||
if test x$enable_debug = xyes; then
|
||||
CXXFLAGS="-g $CXXFLAGS"
|
||||
fi
|
||||
|
||||
AC_PROG_CXX
|
||||
|
||||
dnl Add -Wall for GCC...
|
||||
if test -n "$GCC"; then
|
||||
dnl Extended warnings...
|
||||
CXXFLAGS="-Wshadow -Wconversion -Winline $CXXFLAGS"
|
||||
dnl Standard warnings...
|
||||
CXXFLAGS="-Wall -Wunused -Wno-char-subscripts -Wno-format-y2k $CXXFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
@@ -0,0 +1,119 @@
|
||||
#
|
||||
# "$Id: library.m4 44 2006-05-08 19:33:22Z mike $"
|
||||
#
|
||||
# Common directory stuff for autoconf...
|
||||
#
|
||||
|
||||
dnl Get the operating system, version number, and architecture...
|
||||
uname=`uname`
|
||||
uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'`
|
||||
uarch=`uname -m`
|
||||
|
||||
case "$uname" in
|
||||
GNU* | GNU/*)
|
||||
uname="GNU"
|
||||
;;
|
||||
IRIX*)
|
||||
uname="IRIX"
|
||||
;;
|
||||
Linux*)
|
||||
uname="Linux"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Fix "prefix" variable if it hasn't been specified...
|
||||
if test "$prefix" = "NONE"; then
|
||||
prefix="/"
|
||||
fi
|
||||
|
||||
dnl Fix "exec_prefix" variable if it hasn't been specified...
|
||||
if test "$exec_prefix" = "NONE"; then
|
||||
if test "$prefix" = "/"; then
|
||||
exec_prefix="/usr"
|
||||
else
|
||||
exec_prefix="$prefix"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Fix "bindir" variable...
|
||||
if test "$bindir" = "\${exec_prefix}/bin"; then
|
||||
bindir="$exec_prefix/bin"
|
||||
fi
|
||||
|
||||
dnl Fix "sbindir" variable...
|
||||
if test "$sbindir" = "\${exec_prefix}/sbin"; then
|
||||
sbindir="$exec_prefix/sbin"
|
||||
fi
|
||||
|
||||
dnl Fix "sharedstatedir" variable if it hasn't been specified...
|
||||
if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
|
||||
sharedstatedir="/usr/com"
|
||||
fi
|
||||
|
||||
dnl Fix "datarootdir" variable if it hasn't been specified...
|
||||
if test "$datarootdir" = "\${prefix}/share"; then
|
||||
if test "$prefix" = "/"; then
|
||||
datarootdir="/usr/share"
|
||||
else
|
||||
datarootdir="$prefix/share"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Fix "datadir" variable if it hasn't been specified...
|
||||
if test "$datadir" = "\${prefix}/share"; then
|
||||
if test "$prefix" = "/"; then
|
||||
datadir="/usr/share"
|
||||
else
|
||||
datadir="$prefix/share"
|
||||
fi
|
||||
elif test "$datadir" = "\${datarootdir}"; then
|
||||
datadir="$datarootdir"
|
||||
fi
|
||||
|
||||
dnl Fix "includedir" variable if it hasn't been specified...
|
||||
if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
|
||||
includedir="/usr/include"
|
||||
fi
|
||||
|
||||
dnl Fix "localstatedir" variable if it hasn't been specified...
|
||||
if test "$localstatedir" = "\${prefix}/var"; then
|
||||
if test "$prefix" = "/"; then
|
||||
if test "$uname" = Darwin; then
|
||||
localstatedir="/private/var"
|
||||
else
|
||||
localstatedir="/var"
|
||||
fi
|
||||
else
|
||||
localstatedir="$prefix/var"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Fix "sysconfdir" variable if it hasn't been specified...
|
||||
if test "$sysconfdir" = "\${prefix}/etc"; then
|
||||
if test "$prefix" = "/"; then
|
||||
if test "$uname" = Darwin; then
|
||||
sysconfdir="/private/etc"
|
||||
else
|
||||
sysconfdir="/etc"
|
||||
fi
|
||||
else
|
||||
sysconfdir="$prefix/etc"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Fix "libdir" variable for IRIX 6.x...
|
||||
if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
if test "$uname" = "IRIX"; then
|
||||
libdir="$exec_prefix/lib32"
|
||||
else
|
||||
if test "$uname" = Linux -a -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
else
|
||||
libdir="$exec_prefix/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# End of "$Id: library.m4 44 2006-05-08 19:33:22Z mike $".
|
||||
#
|
||||
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# "$Id: library.m4 44 2006-05-08 19:33:22Z mike $"
|
||||
#
|
||||
# Common library stuff for autoconf...
|
||||
#
|
||||
|
||||
dnl Library commands and flags...
|
||||
AC_PROG_RANLIB
|
||||
AC_PATH_PROG(AR,ar)
|
||||
|
||||
case "$uname" in
|
||||
Darwin* | *BSD*)
|
||||
ARFLAGS="-rcv"
|
||||
;;
|
||||
*)
|
||||
ARFLAGS="crvs"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(ARFLAGS)
|
||||
|
||||
dnl PIC support...
|
||||
if test -n "$GCC"; then
|
||||
CFLAGS="-fPIC $CFLAGS"
|
||||
else
|
||||
case `uname` in
|
||||
HP-UX*)
|
||||
# HP-UX
|
||||
CFLAGS="+z $CFLAGS"
|
||||
;;
|
||||
|
||||
SunOS*)
|
||||
# Solaris
|
||||
CFLAGS="-KPIC $CFLAGS"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: library.m4 44 2006-05-08 19:33:22Z mike $".
|
||||
#
|
||||
-108
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Configuration file for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* @configure_input@
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Version of software...
|
||||
*/
|
||||
|
||||
#define CUPS_SVERSION "CUPS v1.0.2"
|
||||
|
||||
/*
|
||||
* Where are files stored?
|
||||
*/
|
||||
|
||||
#define CUPS_LOCALEDIR "/usr/lib/locale"
|
||||
#define CUPS_SERVERROOT "/var/cups"
|
||||
#define CUPS_DATADIR "/usr/share/cups"
|
||||
|
||||
/*
|
||||
* Do we have various image libraries?
|
||||
*/
|
||||
|
||||
#undef HAVE_LIBPNG
|
||||
#undef HAVE_LIBZ
|
||||
#undef HAVE_LIBJPEG
|
||||
#undef HAVE_LIBTIFF
|
||||
|
||||
/*
|
||||
* Does this machine store words in big-endian (MSB-first) order?
|
||||
*/
|
||||
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/*
|
||||
* Which directory functions and headers do we use?
|
||||
*/
|
||||
|
||||
#undef HAVE_DIRENT_H
|
||||
#undef HAVE_SYS_DIR_H
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/*
|
||||
* Do we have <shadow.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SHADOW_H
|
||||
|
||||
/*
|
||||
* Do we have <crypt.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_CRYPT_H
|
||||
|
||||
/*
|
||||
* Do we have the strXXX() functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_STRDUP
|
||||
#undef HAVE_STRCASECMP
|
||||
#undef HAVE_STRNCASECMP
|
||||
|
||||
/*
|
||||
* Do we have the (v)snprintf() functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_SNPRINTF
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/*
|
||||
* What signal functions to use?
|
||||
*/
|
||||
|
||||
#undef HAVE_SIGSET
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/*
|
||||
* What wait functions to use?
|
||||
*/
|
||||
|
||||
#undef HAVE_WAITPID
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-325
@@ -1,325 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl Configuration script for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 1997-1999 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636-3111 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9603
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_INIT(cups/cups.h)
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AC_PREFIX_DEFAULT(/usr)
|
||||
|
||||
dnl Get the operating system and version number...
|
||||
|
||||
uname=`uname`
|
||||
uversion=`uname -r | sed -e '1,$s/\.//g'`
|
||||
if test "$uname" = "IRIX64"; then
|
||||
uname="IRIX"
|
||||
fi
|
||||
|
||||
dnl Clear the debugging and non-shared library options unless the user asks
|
||||
dnl for them...
|
||||
|
||||
OPTIM=""
|
||||
AC_SUBST(OPTIM)
|
||||
PICFLAG=1
|
||||
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, [ --enable-shared turn on shared libraries [default=yes]])
|
||||
if test "$enable_shared" != "no"; then
|
||||
case "$uname" in
|
||||
SunOS* | UNIX_S*)
|
||||
LIBCUPS="libcups.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.1"
|
||||
DSO="\$(CC) -Wl,-h,\$@ -G \$(OPTIM) -o"
|
||||
;;
|
||||
HP-UX*)
|
||||
LIBCUPS="libcups.sl.1"
|
||||
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"
|
||||
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
|
||||
;;
|
||||
IRIX*)
|
||||
LIBCUPS="libcups.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.1"
|
||||
DSO="\$(CC) -soname \$@ -shared \$(OPTIM) -o"
|
||||
;;
|
||||
*)
|
||||
echo "Warning: shared libraries may not be supported. Trying -shared"
|
||||
echo " option with compiler."
|
||||
LIBCUPS="libcups.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.1"
|
||||
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
PICFLAG=0
|
||||
LIBCUPS="libcups.a"
|
||||
LIBCUPSIMAGE="libcupsimage.a"
|
||||
DSO=":"
|
||||
fi
|
||||
|
||||
dnl Checks for programs...
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
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(GROFF,groff)
|
||||
if test "$GROFF" = ""; then
|
||||
NROFF="echo"
|
||||
else
|
||||
NROFF="$GROFF -T ascii"
|
||||
fi
|
||||
fi
|
||||
AC_PATH_PROG(HTMLDOC,htmldoc)
|
||||
AC_PATH_PROG(MKDIR,mkdir)
|
||||
AC_PATH_PROG(PACK,pack)
|
||||
if test "$PACK" = ""; then
|
||||
AC_PATH_PROG(PACK,gzip)
|
||||
if test "$PACK" = ""; then
|
||||
PACK="echo"
|
||||
CAT="dummy"
|
||||
else
|
||||
PACK="$PACK -fv9"
|
||||
CAT="gz"
|
||||
fi
|
||||
else
|
||||
PACK="$PACK -f"
|
||||
CAT="z"
|
||||
fi
|
||||
AC_SUBST(CAT)
|
||||
AC_PATH_PROG(RM,rm)
|
||||
AC_PATH_PROG(SED,sed)
|
||||
|
||||
dnl Architecture checks...
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
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
|
||||
NETLIBS="-lsocket"
|
||||
else
|
||||
echo "Not using -lsocket since you are running IRIX."
|
||||
fi)
|
||||
AC_CHECK_LIB(nsl,gethostbyaddr,
|
||||
if test "$uname" != "IRIX"; then
|
||||
NETLIBS="$NETLIBS -lnsl"
|
||||
else
|
||||
echo "Not using -lnsl since you are running IRIX."
|
||||
fi)
|
||||
|
||||
LIBJPEG=""
|
||||
LIBPNG=""
|
||||
LIBTIFF=""
|
||||
LIBZ=""
|
||||
|
||||
AC_SUBST(LIBJPEG)
|
||||
AC_SUBST(LIBPNG)
|
||||
AC_SUBST(LIBTIFF)
|
||||
AC_SUBST(LIBZ)
|
||||
|
||||
dnl AC_CHECK_HEADER(jpeglib.h,
|
||||
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
|
||||
AC_DEFINE(HAVE_LIBJPEG)
|
||||
LIBJPEG="-ljpeg")
|
||||
|
||||
dnl AC_CHECK_HEADER(png.h,
|
||||
AC_CHECK_LIB(png, png_read_info,
|
||||
AC_DEFINE(HAVE_LIBPNG)
|
||||
LIBPNG="-lpng")
|
||||
|
||||
dnl AC_CHECK_HEADER(tiff.h,
|
||||
AC_CHECK_LIB(tiff, TIFFReadScanline,
|
||||
AC_DEFINE(HAVE_LIBTIFF)
|
||||
LIBTIFF="-ltiff")
|
||||
|
||||
dnl AC_CHECK_HEADER(zlib.h,
|
||||
AC_CHECK_LIB(z, deflateInit,
|
||||
AC_DEFINE(HAVE_LIBZ)
|
||||
LIBZ="-lz")
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_DIRENT
|
||||
AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
|
||||
|
||||
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)
|
||||
AC_CHECK_FUNCS(sigaction)
|
||||
|
||||
dnl Checks for wait functions.
|
||||
AC_CHECK_FUNCS(waitpid)
|
||||
AC_CHECK_FUNCS(wait3)
|
||||
|
||||
dnl Update compiler options...
|
||||
if test -n "$GXX"; then
|
||||
if test -z "$OPTIM"; then
|
||||
OPTIM="-O2"
|
||||
fi
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="-fPIC $OPTIM"
|
||||
fi
|
||||
else
|
||||
case $uname in
|
||||
IRIX*)
|
||||
if test -z "$OPTIM"; then
|
||||
OPTIM="-O2"
|
||||
fi
|
||||
if test $uversion -ge 62; then
|
||||
OPTIM="$OPTIM -n32 -mips3"
|
||||
fi
|
||||
;;
|
||||
HP-UX*)
|
||||
if test -z "$OPTIM"; then
|
||||
OPTIM="+O2"
|
||||
fi
|
||||
OPTIM="-Ae $OPTIM"
|
||||
;;
|
||||
SunOS*)
|
||||
# Solaris
|
||||
if test -z "$OPTIM"; then
|
||||
OPTIM="-O"
|
||||
fi
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="-KPIC $OPTIM"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Running some other operating system; inform the user they
|
||||
# should contribute the necessary options to
|
||||
# cups-support@cups.org...
|
||||
echo "Building CUPS with default compiler optimizations; contact"
|
||||
echo "cups-support@cups.org with uname and compiler options needed"
|
||||
echo "for your platform, or set the CFLAGS environment variable"
|
||||
echo "before running configure."
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "$DSO" != ":"; then
|
||||
# When using DSOs the image libraries are linked to libcupsimage.so
|
||||
# rather than to the executables. This makes things smaller if you
|
||||
# are using any static libraries, and it also allows us to distribute
|
||||
# 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)"
|
||||
fi
|
||||
|
||||
AC_SUBST(DSO)
|
||||
AC_SUBST(DSOLIBS)
|
||||
AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(LIBCUPS)
|
||||
AC_SUBST(LIBCUPSIMAGE)
|
||||
|
||||
dnl Fix "prefix" variable if it hasn't been specified...
|
||||
if test "$prefix" = "NONE"; then
|
||||
prefix="/usr"
|
||||
fi
|
||||
|
||||
dnl Fix "libdir" variable for IRIX 6.x...
|
||||
if test "$uname" = "IRIX" -a $uversion -ge 65; then
|
||||
libdir="/usr/lib32"
|
||||
fi
|
||||
|
||||
dnl CUPS_SERVERROOT needs special attention for the default location...
|
||||
if test "$prefix" = "/usr"; then
|
||||
CUPS_SERVERROOT="/var/cups"
|
||||
else
|
||||
CUPS_SERVERROOT="$prefix/var/cups"
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$CUPS_SERVERROOT")
|
||||
AC_SUBST(CUPS_SERVERROOT)
|
||||
|
||||
dnl Set the CUPS_LOCALE directory...
|
||||
case "$uname" in
|
||||
Linux)
|
||||
CUPS_LOCALEDIR="$prefix/share/locale"
|
||||
;;
|
||||
|
||||
OSF1)
|
||||
CUPS_LOCALEDIR="$prefix/lib/nls/msg"
|
||||
;;
|
||||
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
|
||||
AC_SUBST(CUPS_LOCALEDIR)
|
||||
|
||||
dnl Set the CUPS_DATAFILE directory...
|
||||
CUPS_DATADIR="$prefix/share/cups"
|
||||
AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$CUPS_DATADIR")
|
||||
AC_SUBST(CUPS_DATADIR)
|
||||
|
||||
AC_OUTPUT(Makedefs)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
-113
@@ -1,113 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "cups"=.\cups\cups.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "hpgltops"=.\filter\hpgltops.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name cups
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "image"=.\filter\image.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "pstops"=.\filter\pstops.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "testmime"=.\cups\testmime.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name cups
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "testppd"=.\cups\testppd.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name cups
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "texttops"=.\filter\texttops.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name cups
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
-317
@@ -1,317 +0,0 @@
|
||||
#
|
||||
# "$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 "epm@easysw.com".
|
||||
#
|
||||
# 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.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
|
||||
#
|
||||
|
||||
%product Common UNIX Printing System
|
||||
%copyright 1993-1999 by Easy Software Products, All Rights Reserved.
|
||||
%vendor Easy Software Products
|
||||
%license LICENSE.cups
|
||||
%readme README.cups
|
||||
%version 1.0.2
|
||||
%incompat printpro
|
||||
|
||||
%system all
|
||||
# Server files
|
||||
f 0555 root sys /var/cups/backend/ipp backend/ipp
|
||||
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/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
|
||||
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
|
||||
|
||||
# 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
|
||||
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
|
||||
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-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 !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
|
||||
l 0555 root sys /usr/lib/libcupsimage.so libcupsimage.so.1
|
||||
%system all
|
||||
|
||||
# Directories
|
||||
d 0755 root sys /var/cups/interfaces
|
||||
d 0755 root sys /var/cups/logs
|
||||
d 0755 root sys /var/cups/ppd
|
||||
d 0755 root sys /var/cups/requests
|
||||
|
||||
# Data files
|
||||
f 0444 root sys /usr/lib/locale/C/cups_C locale/C/cups_C
|
||||
f 0444 root sys /usr/lib/locale/de/cups_de locale/de/cups_de
|
||||
f 0444 root sys /usr/lib/locale/en/cups_en locale/en/cups_en
|
||||
f 0444 root sys /usr/lib/locale/es/cups_es locale/es/cups_es
|
||||
f 0444 root sys /usr/lib/locale/fr/cups_fr locale/fr/cups_fr
|
||||
f 0444 root sys /usr/lib/locale/it/cups_it locale/it/cups_it
|
||||
f 0444 root sys /usr/share/cups/data/8859-1 data/8859-1
|
||||
f 0444 root sys /usr/share/cups/data/8859-14 data/8859-14
|
||||
f 0444 root sys /usr/share/cups/data/8859-15 data/8859-15
|
||||
f 0444 root sys /usr/share/cups/data/8859-2 data/8859-2
|
||||
f 0444 root sys /usr/share/cups/data/8859-3 data/8859-3
|
||||
f 0444 root sys /usr/share/cups/data/8859-4 data/8859-4
|
||||
f 0444 root sys /usr/share/cups/data/8859-5 data/8859-5
|
||||
f 0444 root sys /usr/share/cups/data/8859-6 data/8859-6
|
||||
f 0444 root sys /usr/share/cups/data/8859-7 data/8859-7
|
||||
f 0444 root sys /usr/share/cups/data/8859-8 data/8859-8
|
||||
f 0444 root sys /usr/share/cups/data/8859-9 data/8859-9
|
||||
f 0444 root sys /usr/share/cups/data/HPGLprolog data/HPGLprolog
|
||||
f 0444 root sys /usr/share/cups/data/psglyphs data/psglyphs
|
||||
f 0444 root sys /usr/share/cups/fonts/AvantGarde-Book fonts/AvantGarde-Book
|
||||
f 0444 root sys /usr/share/cups/fonts/AvantGarde-BookOblique fonts/AvantGarde-BookOblique
|
||||
f 0444 root sys /usr/share/cups/fonts/AvantGarde-Demi fonts/AvantGarde-Demi
|
||||
f 0444 root sys /usr/share/cups/fonts/AvantGarde-DemiOblique fonts/AvantGarde-DemiOblique
|
||||
f 0444 root sys /usr/share/cups/fonts/Bookman-Demi fonts/Bookman-Demi
|
||||
f 0444 root sys /usr/share/cups/fonts/Bookman-DemiItalic fonts/Bookman-DemiItalic
|
||||
f 0444 root sys /usr/share/cups/fonts/Bookman-Light fonts/Bookman-Light
|
||||
f 0444 root sys /usr/share/cups/fonts/Bookman-LightItalic fonts/Bookman-LightItalic
|
||||
f 0444 root sys /usr/share/cups/fonts/Courier fonts/Courier
|
||||
f 0444 root sys /usr/share/cups/fonts/Courier-Bold fonts/Courier-Bold
|
||||
f 0444 root sys /usr/share/cups/fonts/Courier-BoldOblique fonts/Courier-BoldOblique
|
||||
f 0444 root sys /usr/share/cups/fonts/Courier-Oblique fonts/Courier-Oblique
|
||||
f 0444 root sys /usr/share/cups/fonts/Helvetica fonts/Helvetica
|
||||
f 0444 root sys /usr/share/cups/fonts/Helvetica-Bold fonts/Helvetica-Bold
|
||||
f 0444 root sys /usr/share/cups/fonts/Helvetica-BoldOblique fonts/Helvetica-BoldOblique
|
||||
f 0444 root sys /usr/share/cups/fonts/Helvetica-Narrow fonts/Helvetica-Narrow
|
||||
f 0444 root sys /usr/share/cups/fonts/Helvetica-Narrow-Bold fonts/Helvetica-Narrow-Bold
|
||||
f 0444 root sys /usr/share/cups/fonts/Helvetica-Narrow-BoldOblique fonts/Helvetica-Narrow-BoldOblique
|
||||
f 0444 root sys /usr/share/cups/fonts/Helvetica-Narrow-Oblique fonts/Helvetica-Narrow-Oblique
|
||||
f 0444 root sys /usr/share/cups/fonts/Helvetica-Oblique fonts/Helvetica-Oblique
|
||||
f 0444 root sys /usr/share/cups/fonts/NewCenturySchlbk-Bold fonts/NewCenturySchlbk-Bold
|
||||
f 0444 root sys /usr/share/cups/fonts/NewCenturySchlbk-BoldItalic fonts/NewCenturySchlbk-BoldItalic
|
||||
f 0444 root sys /usr/share/cups/fonts/NewCenturySchlbk-Italic fonts/NewCenturySchlbk-Italic
|
||||
f 0444 root sys /usr/share/cups/fonts/NewCenturySchlbk-Roman fonts/NewCenturySchlbk-Roman
|
||||
f 0444 root sys /usr/share/cups/fonts/Palatino-Bold fonts/Palatino-Bold
|
||||
f 0444 root sys /usr/share/cups/fonts/Palatino-BoldItalic fonts/Palatino-BoldItalic
|
||||
f 0444 root sys /usr/share/cups/fonts/Palatino-Italic fonts/Palatino-Italic
|
||||
f 0444 root sys /usr/share/cups/fonts/Palatino-Roman fonts/Palatino-Roman
|
||||
f 0444 root sys /usr/share/cups/fonts/Symbol fonts/Symbol
|
||||
f 0444 root sys /usr/share/cups/fonts/Times-Bold fonts/Times-Bold
|
||||
f 0444 root sys /usr/share/cups/fonts/Times-BoldItalic fonts/Times-BoldItalic
|
||||
f 0444 root sys /usr/share/cups/fonts/Times-Italic fonts/Times-Italic
|
||||
f 0444 root sys /usr/share/cups/fonts/Times-Roman fonts/Times-Roman
|
||||
f 0444 root sys /usr/share/cups/fonts/Utopia-Bold fonts/Utopia-Bold
|
||||
f 0444 root sys /usr/share/cups/fonts/Utopia-BoldItalic fonts/Utopia-BoldItalic
|
||||
f 0444 root sys /usr/share/cups/fonts/Utopia-Italic fonts/Utopia-Italic
|
||||
f 0444 root sys /usr/share/cups/fonts/Utopia-Regular fonts/Utopia-Regular
|
||||
f 0444 root sys /usr/share/cups/fonts/ZapfChancery-MediumItalic fonts/ZapfChancery-MediumItalic
|
||||
f 0444 root sys /usr/share/cups/fonts/ZapfDingbats fonts/ZapfDingbats
|
||||
f 0444 root sys /usr/share/cups/pstoraster/Fontmap pstoraster/Fontmap
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_l2img.ps pstoraster/gs_l2img.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_pfile.ps pstoraster/gs_pfile.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/pfbtogs.ps pstoraster/pfbtogs.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_wl1_e.ps pstoraster/gs_wl1_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_wl2_e.ps pstoraster/gs_wl2_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_wl5_e.ps pstoraster/gs_wl5_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_wan_e.ps pstoraster/gs_wan_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_pdf_e.ps pstoraster/gs_pdf_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_sym_e.ps pstoraster/gs_sym_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_std_e.ps pstoraster/gs_std_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_dbt_e.ps pstoraster/gs_dbt_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_mex_e.ps pstoraster/gs_mex_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_mro_e.ps pstoraster/gs_mro_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_iso_e.ps pstoraster/gs_iso_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_ksb_e.ps pstoraster/gs_ksb_e.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_ttf.ps pstoraster/gs_ttf.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_pdf.ps pstoraster/gs_pdf.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_ccfnt.ps pstoraster/gs_ccfnt.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/pdf_sec.ps pstoraster/pdf_sec.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_res.ps pstoraster/gs_res.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/pdf_base.ps pstoraster/pdf_base.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_btokn.ps pstoraster/gs_btokn.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_diskf.ps pstoraster/gs_diskf.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/pdf_2ps.ps pstoraster/pdf_2ps.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_init.ps pstoraster/gs_init.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_kanji.ps pstoraster/gs_kanji.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/pdf_draw.ps pstoraster/pdf_draw.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/pdf_font.ps pstoraster/pdf_font.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_type1.ps pstoraster/gs_type1.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_fonts.ps pstoraster/gs_fonts.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_statd.ps pstoraster/gs_statd.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_lev2.ps pstoraster/gs_lev2.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_typ42.ps pstoraster/gs_typ42.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_pdfwr.ps pstoraster/gs_pdfwr.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_cidfn.ps pstoraster/gs_cidfn.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_cmdl.ps pstoraster/gs_cmdl.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_dps1.ps pstoraster/gs_dps1.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_setpd.ps pstoraster/gs_setpd.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_cmap.ps pstoraster/gs_cmap.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/gs_fform.ps pstoraster/gs_fform.ps
|
||||
f 0444 root sys /usr/share/cups/pstoraster/pdf_main.ps pstoraster/pdf_main.ps
|
||||
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 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
|
||||
f 0444 root sys /usr/include/cups/http.h cups/http.h
|
||||
f 0444 root sys /usr/include/cups/ipp.h cups/ipp.h
|
||||
f 0444 root sys /usr/include/cups/language.h cups/language.h
|
||||
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
|
||||
|
||||
%system irix-6.5
|
||||
f 0444 root sys /usr/lib32/libcups.a cups/libcups.a
|
||||
%system !irix-6.5
|
||||
f 0444 root sys /usr/lib/libcups.a cups/libcups.a
|
||||
%system all
|
||||
|
||||
# Documentation files
|
||||
f 0444 root sys /usr/share/cups/doc/cmp.html doc/cmp.html
|
||||
f 0444 root sys /usr/share/cups/doc/cmp.pdf doc/cmp.pdf
|
||||
f 0444 root sys /usr/share/cups/doc/cupsdoc.css doc/cupsdoc.css
|
||||
f 0444 root sys /usr/share/cups/doc/cups.css doc/cups.css
|
||||
f 0444 root sys /usr/share/cups/doc/documentation.html doc/documentation.html
|
||||
f 0444 root sys /usr/share/cups/doc/idd.html doc/idd.html
|
||||
f 0444 root sys /usr/share/cups/doc/idd.pdf doc/idd.pdf
|
||||
f 0444 root sys /usr/share/cups/doc/images/classes.gif doc/images/classes.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/cups-bar.gif doc/images/cups-bar.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/cups-block-diagram.gif doc/images/cups-block-diagram.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/cups-large.gif doc/images/cups-large.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/cups-medium.gif doc/images/cups-medium.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/cups-small.gif doc/images/cups-small.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/logo.gif doc/images/logo.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/navbar.gif doc/images/navbar.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/printer-idle.gif doc/images/printer-idle.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/printer-processing.gif doc/images/printer-processing.gif
|
||||
f 0444 root sys /usr/share/cups/doc/images/printer-stopped.gif doc/images/printer-stopped.gif
|
||||
f 0444 root sys /usr/share/cups/doc/index.html doc/index.html
|
||||
f 0444 root sys /usr/share/cups/doc/overview.html doc/overview.html
|
||||
f 0444 root sys /usr/share/cups/doc/overview.pdf doc/overview.pdf
|
||||
f 0444 root sys /usr/share/cups/doc/sam.html doc/sam.html
|
||||
f 0444 root sys /usr/share/cups/doc/sam.pdf doc/sam.pdf
|
||||
f 0444 root sys /usr/share/cups/doc/sdd.html doc/sdd.html
|
||||
f 0444 root sys /usr/share/cups/doc/sdd.pdf doc/sdd.pdf
|
||||
f 0444 root sys /usr/share/cups/doc/ssr.html doc/ssr.html
|
||||
f 0444 root sys /usr/share/cups/doc/ssr.pdf doc/ssr.pdf
|
||||
f 0444 root sys /usr/share/cups/doc/stp.html doc/stp.html
|
||||
f 0444 root sys /usr/share/cups/doc/stp.pdf doc/stp.pdf
|
||||
f 0444 root sys /usr/share/cups/doc/sum.html doc/sum.html
|
||||
f 0444 root sys /usr/share/cups/doc/sum.pdf doc/sum.pdf
|
||||
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
|
||||
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
|
||||
f 0444 root sys /usr/share/catman/u_man/cat5/classes.conf.z man/classes.conf.z
|
||||
f 0444 root sys /usr/share/catman/u_man/cat5/cupsd.conf.z man/cupsd.conf.z
|
||||
f 0444 root sys /usr/share/catman/a_man/cat1/cupsd.z man/cupsd.z
|
||||
f 0444 root sys /usr/share/catman/a_man/cat1/enable.z man/enable.z
|
||||
l 0444 root sys /usr/share/catman/a_man/cat1/disable.z enable.z
|
||||
f 0444 root sys /usr/share/catman/u_man/cat1/filter.z man/filter.z
|
||||
f 0444 root sys /usr/share/catman/a_man/cat1/lpadmin.z man/lpadmin.z
|
||||
f 0444 root sys /usr/share/catman/a_man/cat1/lpc.z man/lpc.z
|
||||
f 0444 root sys /usr/share/catman/u_man/cat1/lprm.z man/lprm.z
|
||||
f 0444 root sys /usr/share/catman/u_man/cat1/lpr.z man/lpr.z
|
||||
f 0444 root sys /usr/share/catman/u_man/cat1/lpstat.z man/lpstat.z
|
||||
f 0444 root sys /usr/share/catman/u_man/cat1/lp.z man/lp.z
|
||||
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 !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
|
||||
f 0444 root sys /usr/man/man1/classes.conf.5 man/classes.conf.5
|
||||
f 0444 root sys /usr/man/man8/cupsd.8 man/cupsd.8
|
||||
f 0444 root sys /usr/man/man5/cupsd.conf.5 man/cupsd.conf.5
|
||||
f 0444 root sys /usr/man/man8/enable.8 man/enable.8
|
||||
l 0444 root sys /usr/man/man8/disable.8 enable.8
|
||||
f 0444 root sys /usr/man/man1/filter.1 man/filter.1
|
||||
f 0444 root sys /usr/man/man8/lpadmin.8 man/lpadmin.8
|
||||
f 0444 root sys /usr/man/man8/lpc.8 man/lpc.8
|
||||
f 0444 root sys /usr/man/man1/lprm.1 man/lprm.1
|
||||
f 0444 root sys /usr/man/man1/lpr.1 man/lpr.1
|
||||
f 0444 root sys /usr/man/man1/lpstat.1 man/lpstat.1
|
||||
f 0444 root sys /usr/man/man1/lp.1 man/lp.1
|
||||
l 0444 root sys /usr/man/man1/cancel.1 lp.1
|
||||
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 script
|
||||
%system all
|
||||
i 0555 root sys cups cups.sh
|
||||
|
||||
#
|
||||
# End of "$Id: cups.list 775 1999-11-04 13:35:01Z mike $".
|
||||
#
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# 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
|
||||
# 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
|
||||
#
|
||||
|
||||
# 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}'`
|
||||
;;
|
||||
OSF1)
|
||||
pid=`ps -e | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
|
||||
;;
|
||||
Linux)
|
||||
pid=`ps ax | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
|
||||
;;
|
||||
*)
|
||||
pid=""
|
||||
;;
|
||||
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 | 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
|
||||
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$".
|
||||
#
|
||||
-134
@@ -1,134 +0,0 @@
|
||||
#
|
||||
# "$Id: cups.spec 775 1999-11-04 13:35:01Z mike $"
|
||||
#
|
||||
# RPM "spec" file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Original version by Jason McMullan <jmcc@ontv.com>.
|
||||
#
|
||||
# Copyright 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
|
||||
# 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
|
||||
#
|
||||
|
||||
Summary: Common Unix Printing System
|
||||
Name: cups
|
||||
Version: 1.0.2
|
||||
Release: 0
|
||||
Copyright: GPL
|
||||
Group: System Environment/Daemons
|
||||
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
|
||||
# use buildroot so as not to disturb the version already installed
|
||||
BuildRoot: /tmp/rpmbuild
|
||||
Conflicts: lpr
|
||||
|
||||
%package devel
|
||||
Summary: Common Unix Printing System - development environment
|
||||
Group: Development/Libraries
|
||||
|
||||
%description
|
||||
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.
|
||||
|
||||
%description devel
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This is the development package for creating
|
||||
additional printer drivers, and other CUPS services.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure
|
||||
|
||||
# If we got this far, all prerequisite libraries must be here.
|
||||
make
|
||||
|
||||
%install
|
||||
# these lines just make sure the directory structure in the
|
||||
# RPM_BUILD_ROOT exists
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
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/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 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
|
||||
|
||||
%preun
|
||||
/sbin/chkconfig --del cups
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
/etc/rc.d/init.d/cups
|
||||
%config /var/cups/conf/*
|
||||
/usr/bin/*
|
||||
/usr/lib/*
|
||||
/usr/man/*
|
||||
/usr/sbin/*
|
||||
%dir /usr/share/cups
|
||||
/usr/share/cups/*
|
||||
%dir /var/cups
|
||||
/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/*
|
||||
|
||||
#
|
||||
# End of "$Id: cups.spec 775 1999-11-04 13:35:01Z mike $".
|
||||
#
|
||||
-151
@@ -1,151 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Support library Makefile 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.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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
#
|
||||
# Object files...
|
||||
#
|
||||
|
||||
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...
|
||||
#
|
||||
|
||||
HEADERS = cups.h http.h ipp.h language.h mime.h ppd.h raster.h
|
||||
|
||||
#
|
||||
# Targets in this directory...
|
||||
#
|
||||
|
||||
TARGETS = $(LIBCUPS) testhttp testmime testppd
|
||||
|
||||
#
|
||||
# Make all targets...
|
||||
#
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
#
|
||||
# Remove object and target files...
|
||||
#
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(TARGETS)
|
||||
|
||||
#
|
||||
# Install object and target files...
|
||||
#
|
||||
|
||||
install: all
|
||||
-$(MKDIR) $(INCLUDEDIR)/cups
|
||||
$(CP) $(HEADERS) $(INCLUDEDIR)/cups
|
||||
-$(MKDIR) $(LIBDIR)
|
||||
$(CP) $(LIBCUPS) $(LIBDIR)
|
||||
if test $(LIBCUPS) != "libcups.a"; then \
|
||||
$(LN) $(LIBCUPS) `basename $(LIBCUPS) .1`; \
|
||||
fi
|
||||
|
||||
#
|
||||
# libcups.so.1, libcups.sl.1
|
||||
#
|
||||
|
||||
libcups.so.1 libcups.sl.1: $(LIBOBJS) ../Makedefs
|
||||
echo Linking $@...
|
||||
$(DSO) $@ $(LIBOBJS)
|
||||
-$(LN) $@ `basename $@ .1`
|
||||
|
||||
#
|
||||
# libcups.a
|
||||
#
|
||||
|
||||
libcups.a: $(LIBOBJS)
|
||||
echo Archiving $@...
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
#
|
||||
# cups_C.h - the default POSIX locale that is compiled in.
|
||||
#
|
||||
|
||||
cups_C.h: ../locale/C/cups_C
|
||||
echo Generating $@...
|
||||
$(RM) cups_C.h
|
||||
$(AWK) '{print "\"" $$0 "\","}' < ../locale/C/cups_C > cups_C.h
|
||||
|
||||
emit.o: ppd.h ../config.h ../Makedefs
|
||||
filter.o: mime.h ../config.h ../Makedefs
|
||||
http.o: http.h ipp.h string.h ../config.h ../Makedefs
|
||||
ipp.o: http.h ipp.h ../config.h ../Makedefs
|
||||
language.o: cups_C.h language.h string.h ../config.h ../Makedefs
|
||||
mark.o: ppd.h ../config.h ../Makedefs
|
||||
mime.o: mime.h ../config.h ../Makedefs
|
||||
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
|
||||
util.o: cups.h http.h ipp.h ../config.h ../Makedefs
|
||||
|
||||
#
|
||||
# testhttp (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testhttp: testhttp.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a $(NETLIBS)
|
||||
|
||||
testhttp.o: http.h ../Makedefs
|
||||
|
||||
#
|
||||
# testmime (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testmime: testmime.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testmime.o libcups.a
|
||||
|
||||
testmime.o: mime.h ../Makedefs
|
||||
|
||||
#
|
||||
# testppd (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testppd: testppd.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testppd.o libcups.a $(NETLIBS)
|
||||
|
||||
testppd.o: ppd.h ../Makedefs
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
-176
@@ -1,176 +0,0 @@
|
||||
# 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
|
||||
-144
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* API definitions 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CUPS_H_
|
||||
# define _CUPS_CUPS_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <cups/ipp.h>
|
||||
# include <cups/mime.h>
|
||||
# include <cups/ppd.h>
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0
|
||||
# define CUPS_DATE_ANY -1
|
||||
|
||||
|
||||
/*
|
||||
* Types and structures...
|
||||
*/
|
||||
|
||||
typedef unsigned cups_ptype_t; /**** Printer Type/Capability Bits ****/
|
||||
enum /* Not a typedef'd enum so we can OR */
|
||||
{
|
||||
CUPS_PRINTER_LOCAL = 0x0000, /* Local printer or class */
|
||||
CUPS_PRINTER_CLASS = 0x0001, /* Printer class */
|
||||
CUPS_PRINTER_REMOTE = 0x0002, /* Remote printer or class */
|
||||
CUPS_PRINTER_BW = 0x0004, /* Can do B&W printing */
|
||||
CUPS_PRINTER_COLOR = 0x0008, /* Can do color printing */
|
||||
CUPS_PRINTER_DUPLEX = 0x0010, /* Can do duplexing */
|
||||
CUPS_PRINTER_STAPLE = 0x0020, /* Can staple output */
|
||||
CUPS_PRINTER_COPIES = 0x0040, /* Can do copies */
|
||||
CUPS_PRINTER_COLLATE = 0x0080, /* Can collage copies */
|
||||
CUPS_PRINTER_PUNCH = 0x0100, /* Can punch output */
|
||||
CUPS_PRINTER_COVER = 0x0200, /* Can cover output */
|
||||
CUPS_PRINTER_BIND = 0x0400, /* Can bind output */
|
||||
CUPS_PRINTER_SORT = 0x0800, /* Can sort output */
|
||||
CUPS_PRINTER_SMALL = 0x1000, /* Can do Letter/Legal/A4 */
|
||||
CUPS_PRINTER_MEDIUM = 0x2000, /* Can do Tabloid/B/C/A3/A2 */
|
||||
CUPS_PRINTER_LARGE = 0x4000, /* Can do D/E/A1/A0 */
|
||||
CUPS_PRINTER_VARIABLE = 0x8000, /* Can do variable sizes */
|
||||
CUPS_PRINTER_IMPLICIT = 0x10000, /* Implicit class */
|
||||
CUPS_PRINTER_OPTIONS = 0xfffc /* ~(CLASS | REMOTE | IMPLICIT) */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Types & structures...
|
||||
*/
|
||||
|
||||
typedef struct /**** Printer Information ****/
|
||||
{
|
||||
char name[IPP_MAX_NAME], /* Printer or class name */
|
||||
uri[HTTP_MAX_URI]; /* Universal resource identifier */
|
||||
unsigned char info[IPP_MAX_NAME], /* Printer or class info/description */
|
||||
location[IPP_MAX_NAME]; /* Location text */
|
||||
ipp_pstate_t state; /* Printer state */
|
||||
unsigned char message[IPP_MAX_NAME]; /* State text */
|
||||
cups_ptype_t type; /* Printer type/capability codes */
|
||||
} cups_browse_t;
|
||||
|
||||
typedef struct /**** Printer Options ****/
|
||||
{
|
||||
char *name; /* Name of option */
|
||||
char *value; /* Value of option */
|
||||
} cups_option_t;
|
||||
|
||||
|
||||
/*
|
||||
* Functions...
|
||||
*/
|
||||
|
||||
extern int cupsCancelJob(const char *printer, int job);
|
||||
#define cupsDoRequest(http,request,resource) cupsDoFileRequest((http),(request),(resource),NULL)
|
||||
extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
|
||||
const char *resource, const char *filename);
|
||||
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);
|
||||
extern const char *cupsGetOption(const char *name, int num_options,
|
||||
cups_option_t *options);
|
||||
extern int cupsParseOptions(const char *arg, int num_options,
|
||||
cups_option_t **options);
|
||||
extern int cupsMarkOptions(ppd_file_t *ppd, int num_options,
|
||||
cups_option_t *options);
|
||||
|
||||
extern const char *cupsGetPassword(const char *prompt);
|
||||
extern const char *cupsServer(void);
|
||||
extern const char *cupsUser(void);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_CUPS_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-123
@@ -1,123 +0,0 @@
|
||||
"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.",
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Debugging macros 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_DEBUG_H_
|
||||
# define _CUPS_DEBUG_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
/*
|
||||
* The debug macros are used if you compile with DEBUG defined.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* DEBUG_puts("string")
|
||||
* DEBUG_printf(("format string", arg, arg, ...));
|
||||
*
|
||||
* Note the extra parenthesis around the DEBUG_printf macro...
|
||||
*/
|
||||
|
||||
# ifdef DEBUG
|
||||
# define DEBUG_puts(x) puts(x)
|
||||
# define DEBUG_printf(x) printf x
|
||||
# else
|
||||
# define DEBUG_puts(x)
|
||||
# define DEBUG_printf(x)
|
||||
# endif /* DEBUG */
|
||||
|
||||
#endif /* !_CUPS_DEBUG_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-301
@@ -1,301 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* PPD code emission routines 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.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
|
||||
*
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* ppdEmit() - Emit code for marked options to a file.
|
||||
* ppdEmitFd() - Emit code for marked options to a file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "ppd.h"
|
||||
#include <stdlib.h>
|
||||
#include "string.h"
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int ppd_sort(ppd_choice_t **c1, ppd_choice_t **c2);
|
||||
static int ppd_collect(ppd_file_t *ppd, ppd_section_t section,
|
||||
ppd_choice_t ***choices);
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdEmit()' - Emit code for marked options to a file.
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on failure */
|
||||
ppdEmit(ppd_file_t *ppd, /* I - PPD file record */
|
||||
FILE *fp, /* I - File to write to */
|
||||
ppd_section_t section) /* I - Section to write */
|
||||
{
|
||||
int i, /* Looping var */
|
||||
count; /* Number of choices */
|
||||
ppd_choice_t **choices; /* Choices */
|
||||
ppd_size_t *size; /* Custom page size */
|
||||
|
||||
|
||||
if ((count = ppd_collect(ppd, section, &choices)) == 0)
|
||||
return (0);
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
if (section != PPD_ORDER_EXIT && section != PPD_ORDER_JCL)
|
||||
{
|
||||
/*
|
||||
* Send DSC comments with option...
|
||||
*/
|
||||
|
||||
if (fprintf(fp, "%%%%BeginFeature: %s %s\n",
|
||||
((ppd_option_t *)choices[i]->option)->keyword,
|
||||
choices[i]->choice) < 0)
|
||||
{
|
||||
free(choices);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
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
|
||||
* eventually be changed to use the parameter positions defined
|
||||
* in the PPD file...)
|
||||
*/
|
||||
|
||||
size = ppdPageSize(ppd, "Custom");
|
||||
fprintf(fp, "%.0f %.0f 0 0 0\n", size->width, size->length);
|
||||
|
||||
if (choices[i]->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...
|
||||
*/
|
||||
|
||||
fputs("pop pop pop\n", fp);
|
||||
fputs("<</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\n", fp);
|
||||
}
|
||||
}
|
||||
|
||||
if (choices[i]->code != NULL && choices[i]->code[0] != '\0')
|
||||
{
|
||||
if (fputs(choices[i]->code, fp) < 0)
|
||||
{
|
||||
free(choices);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (choices[i]->code[strlen(choices[i]->code) - 1] != '\n')
|
||||
putc('\n', fp);
|
||||
}
|
||||
|
||||
if (fputs("%%EndFeature\n", fp) < 0)
|
||||
{
|
||||
free(choices);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else if (fputs(choices[i]->code, fp) < 0)
|
||||
{
|
||||
free(choices);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
free(choices);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdEmitFd()' - Emit code for marked options to a file.
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on failure */
|
||||
ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
|
||||
int fd, /* I - File to write to */
|
||||
ppd_section_t section) /* I - Section to write */
|
||||
{
|
||||
int i, /* Looping var */
|
||||
count; /* Number of choices */
|
||||
ppd_choice_t **choices; /* Choices */
|
||||
char buf[1024]; /* Output buffer for feature */
|
||||
|
||||
|
||||
if ((count = ppd_collect(ppd, section, &choices)) == 0)
|
||||
return (0);
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
if (section != PPD_ORDER_EXIT && section != PPD_ORDER_JCL)
|
||||
{
|
||||
/*
|
||||
* Send DSC comments with option...
|
||||
*/
|
||||
|
||||
sprintf(buf, "%%%%BeginFeature: %s %s\n",
|
||||
((ppd_option_t *)choices[i]->option)->keyword, choices[i]->choice);
|
||||
|
||||
if (write(fd, buf, strlen(buf)) < 1)
|
||||
{
|
||||
free(choices);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (write(fd, choices[i]->code, strlen(choices[i]->code)) < 1)
|
||||
{
|
||||
free(choices);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (write(fd, "%%EndFeature\n", 13) < 1)
|
||||
{
|
||||
free(choices);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else if (write(fd, choices[i]->code, strlen(choices[i]->code)) < 1)
|
||||
{
|
||||
free(choices);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
free(choices);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_sort()' - Sort options by ordering numbers...
|
||||
*/
|
||||
|
||||
static int /* O - -1 if c1 < c2, 0 if equal, 1 otherwise */
|
||||
ppd_sort(ppd_choice_t **c1, /* I - First choice */
|
||||
ppd_choice_t **c2) /* I - Second choice */
|
||||
{
|
||||
if (((ppd_option_t *)(*c1)->option)->order < ((ppd_option_t *)(*c2)->option)->order)
|
||||
return (-1);
|
||||
else if (((ppd_option_t *)(*c1)->option)->order > ((ppd_option_t *)(*c2)->option)->order)
|
||||
return (1);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_collect()' - Collect all marked options that reside in the specified
|
||||
* section.
|
||||
*/
|
||||
|
||||
static int /* O - Number of options marked */
|
||||
ppd_collect(ppd_file_t *ppd, /* I - PPD file data */
|
||||
ppd_section_t section, /* I - Section to collect */
|
||||
ppd_choice_t ***choices) /* O - Pointers to choices */
|
||||
{
|
||||
int i, j, k, m; /* Looping vars */
|
||||
ppd_group_t *g, /* Current group */
|
||||
*sg; /* Current sub-group */
|
||||
ppd_option_t *o; /* Current option */
|
||||
ppd_choice_t *c; /* Current choice */
|
||||
int count; /* Number of choices collected */
|
||||
ppd_choice_t **collect; /* Collected choices */
|
||||
|
||||
|
||||
if (ppd == NULL)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Allocate memory for up to 1000 selected choices...
|
||||
*/
|
||||
|
||||
count = 0;
|
||||
collect = calloc(sizeof(ppd_choice_t *), 1000);
|
||||
|
||||
/*
|
||||
* Loop through all options and add choices as needed...
|
||||
*/
|
||||
|
||||
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 (o->section == section)
|
||||
for (k = o->num_choices, c = o->choices; k > 0; k --, c ++)
|
||||
if (c->marked && count < 1000)
|
||||
{
|
||||
collect[count] = c;
|
||||
count ++;
|
||||
}
|
||||
|
||||
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 (o->section == section)
|
||||
for (m = o->num_choices, c = o->choices; m > 0; m --, c ++)
|
||||
if (c->marked && count < 1000)
|
||||
{
|
||||
collect[count] = c;
|
||||
count ++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have more than 1 marked choice, sort them...
|
||||
*/
|
||||
|
||||
if (count > 1)
|
||||
qsort(collect, count, sizeof(ppd_choice_t *),
|
||||
(int (*)(const void *, const void *))ppd_sort);
|
||||
|
||||
/*
|
||||
* Return the array and number of choices; if 0, free the array since
|
||||
* it isn't needed.
|
||||
*/
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
*choices = collect;
|
||||
return (count);
|
||||
}
|
||||
else
|
||||
{
|
||||
*choices = NULL;
|
||||
free(collect);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-299
@@ -1,299 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* File type conversion routines 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.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:
|
||||
*
|
||||
* mimeAddFilter() - Add a filter to the current MIME database.
|
||||
* mimeFilter() - Find the fastest way to convert from one type to another.
|
||||
* compare() - Compare two filter types...
|
||||
* lookup() - Lookup a filter...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "string.h"
|
||||
#include "mime.h"
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int compare(mime_filter_t *, mime_filter_t *);
|
||||
static mime_filter_t *lookup(mime_t *, mime_type_t *, mime_type_t *);
|
||||
|
||||
|
||||
/*
|
||||
* 'mimeAddFilter()' - Add a filter to the current MIME database.
|
||||
*/
|
||||
|
||||
mime_filter_t * /* O - New filter */
|
||||
mimeAddFilter(mime_t *mime, /* I - MIME database */
|
||||
mime_type_t *src, /* I - Source type */
|
||||
mime_type_t *dst, /* I - Destination type */
|
||||
int cost, /* I - Relative time/resource cost */
|
||||
const char *filter) /* I - Filter program to run */
|
||||
{
|
||||
mime_filter_t *temp; /* New filter */
|
||||
|
||||
|
||||
/*
|
||||
* Range-check the input...
|
||||
*/
|
||||
|
||||
if (mime == NULL || src == NULL || dst == NULL || filter == NULL)
|
||||
return (NULL);
|
||||
|
||||
if (strlen(filter) > (MIME_MAX_FILTER - 1))
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* See if we already have an existing filter for the given source and
|
||||
* destination...
|
||||
*/
|
||||
|
||||
if ((temp = lookup(mime, src, dst)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Yup, does the existing filter have a higher cost? If so, copy the
|
||||
* filter and cost to the existing filter entry and return it...
|
||||
*/
|
||||
|
||||
if (temp->cost > cost)
|
||||
{
|
||||
temp->cost = cost;
|
||||
strncpy(temp->filter, filter, sizeof(temp->filter) - 1);
|
||||
temp->filter[sizeof(temp->filter) - 1] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Nope, add a new one...
|
||||
*/
|
||||
|
||||
if (mime->num_filters == 0)
|
||||
temp = malloc(sizeof(mime_filter_t));
|
||||
else
|
||||
temp = realloc(mime->filters, sizeof(mime_filter_t) * (mime->num_filters + 1));
|
||||
|
||||
if (temp == NULL)
|
||||
return (NULL);
|
||||
|
||||
mime->filters = temp;
|
||||
temp += mime->num_filters;
|
||||
mime->num_filters ++;
|
||||
|
||||
/*
|
||||
* Copy the information over and sort if necessary...
|
||||
*/
|
||||
|
||||
temp->src = src;
|
||||
temp->dst = dst;
|
||||
temp->cost = cost;
|
||||
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),
|
||||
(int (*)(const void *, const void *))compare);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the new/updated filter...
|
||||
*/
|
||||
|
||||
return (temp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'mimeFilter()' - Find the fastest way to convert from one type to another.
|
||||
*/
|
||||
|
||||
mime_filter_t * /* O - Array of filters to run */
|
||||
mimeFilter(mime_t *mime, /* I - MIME database */
|
||||
mime_type_t *src, /* I - Source file type */
|
||||
mime_type_t *dst, /* I - Destination file type */
|
||||
int *num_filters) /* O - Number of filters to run */
|
||||
{
|
||||
int i, j, /* Looping vars */
|
||||
num_temp, /* Number of temporary filters */
|
||||
num_mintemp, /* Number of filters in the minimum */
|
||||
cost, /* Current cost */
|
||||
mincost; /* Current minimum */
|
||||
mime_filter_t *temp, /* Temporary filter */
|
||||
*mintemp, /* Current minimum */
|
||||
*mincurrent, /* Current filter for minimum */
|
||||
*current, /* Current filter */
|
||||
*filters; /* Filters to use */
|
||||
|
||||
|
||||
/*
|
||||
* Range-check the input...
|
||||
*/
|
||||
|
||||
if (mime == NULL || src == NULL || dst == NULL || num_filters == NULL)
|
||||
return (NULL);
|
||||
|
||||
*num_filters = 0;
|
||||
|
||||
/*
|
||||
* See if there is a filter that can convert the files directly...
|
||||
*/
|
||||
|
||||
if ((temp = lookup(mime, src, dst)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Got a direct filter!
|
||||
*/
|
||||
|
||||
if ((filters = (mime_filter_t *)malloc(sizeof(mime_filter_t))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
memcpy(filters, temp, sizeof(mime_filter_t));
|
||||
*num_filters = 1;
|
||||
return (filters);
|
||||
}
|
||||
|
||||
/*
|
||||
* OK, now look for filters from the source type to any other type...
|
||||
*/
|
||||
|
||||
mincost = 9999999;
|
||||
mintemp = NULL;
|
||||
|
||||
for (i = mime->num_filters, current = mime->filters; i > 0; i --, current ++)
|
||||
if (current->src == src)
|
||||
{
|
||||
/*
|
||||
* See if we have any filters that can convert from the destination type
|
||||
* of this filter to the final type...
|
||||
*/
|
||||
|
||||
if ((temp = mimeFilter(mime, current->dst, dst, &num_temp)) == NULL)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Found a match; see if this one is less costly than the last (if
|
||||
* any...)
|
||||
*/
|
||||
|
||||
for (j = 0, cost = 0; j < num_temp; j ++)
|
||||
cost += temp->cost;
|
||||
|
||||
if (cost < mincost)
|
||||
{
|
||||
if (mintemp != NULL)
|
||||
free(mintemp);
|
||||
|
||||
mincost = cost;
|
||||
mintemp = temp;
|
||||
num_mintemp = num_temp;
|
||||
mincurrent = current;
|
||||
}
|
||||
else
|
||||
free(temp);
|
||||
}
|
||||
|
||||
if (mintemp != NULL)
|
||||
{
|
||||
/*
|
||||
* Hey, we got a match! Add the current filter to the beginning of the
|
||||
* filter list...
|
||||
*/
|
||||
|
||||
filters = (mime_filter_t *)realloc(mintemp, sizeof(mime_filter_t) *
|
||||
(num_mintemp + 1));
|
||||
|
||||
if (filters == NULL)
|
||||
{
|
||||
*num_filters = 0;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
memmove(filters + 1, filters, num_mintemp * sizeof(mime_filter_t));
|
||||
memcpy(filters, mincurrent, sizeof(mime_filter_t));
|
||||
|
||||
*num_filters = num_mintemp + 1;
|
||||
|
||||
return (filters);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'compare()' - Compare two filter types...
|
||||
*/
|
||||
|
||||
static int /* O - Comparison result */
|
||||
compare(mime_filter_t *f0, /* I - First filter */
|
||||
mime_filter_t *f1) /* I - Second filter */
|
||||
{
|
||||
int i; /* Result of comparison */
|
||||
|
||||
|
||||
if ((i = strcmp(f0->src->super, f1->src->super)) == 0)
|
||||
if ((i = strcmp(f0->src->type, f1->src->type)) == 0)
|
||||
if ((i = strcmp(f0->dst->super, f1->dst->super)) == 0)
|
||||
i = strcmp(f0->dst->type, f1->dst->type);
|
||||
|
||||
return (i);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'lookup()' - Lookup a filter...
|
||||
*/
|
||||
|
||||
static mime_filter_t * /* O - Filter for src->dst */
|
||||
lookup(mime_t *mime, /* I - MIME database */
|
||||
mime_type_t *src, /* I - Source type */
|
||||
mime_type_t *dst) /* I - Destination type */
|
||||
{
|
||||
mime_filter_t key; /* Key record for filter search */
|
||||
|
||||
|
||||
if (mime->num_filters == 0)
|
||||
return (NULL);
|
||||
|
||||
key.src = src;
|
||||
key.dst = dst;
|
||||
|
||||
return ((mime_filter_t *)bsearch(&key, mime->filters, mime->num_filters,
|
||||
sizeof(mime_filter_t),
|
||||
(int (*)(const void *, const void *))compare));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-1507
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
-293
@@ -1,293 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Hyper-Text Transport Protocol definitions 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.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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_HTTP_H_
|
||||
# define _CUPS_HTTP_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <string.h>
|
||||
# include <time.h>
|
||||
# if defined(WIN32) || defined(__EMX__)
|
||||
# include <winsock.h>
|
||||
# else
|
||||
# include <unistd.h>
|
||||
# include <sys/time.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/socket.h>
|
||||
# include <netdb.h>
|
||||
# include <netinet/in.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <netinet/in_systm.h>
|
||||
# include <netinet/ip.h>
|
||||
# include <netinet/tcp.h>
|
||||
# endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* Limits...
|
||||
*/
|
||||
|
||||
# define HTTP_MAX_URI 1024 /* Max length of URI string */
|
||||
# define HTTP_MAX_HOST 256 /* Max length of hostname string */
|
||||
# define HTTP_MAX_BUFFER 2048 /* Max length of data buffer */
|
||||
# define HTTP_MAX_VALUE 256 /* Max header field value length */
|
||||
|
||||
|
||||
/*
|
||||
* HTTP state values...
|
||||
*/
|
||||
|
||||
typedef enum /* States are server-oriented */
|
||||
{
|
||||
HTTP_WAITING, /* Waiting for command */
|
||||
HTTP_OPTIONS, /* OPTIONS command, waiting for blank line */
|
||||
HTTP_GET, /* GET command, waiting for blank line */
|
||||
HTTP_GET_SEND, /* GET command, sending data */
|
||||
HTTP_HEAD, /* HEAD command, waiting for blank line */
|
||||
HTTP_POST, /* POST command, waiting for blank line */
|
||||
HTTP_POST_RECV, /* POST command, receiving data */
|
||||
HTTP_POST_SEND, /* POST command, sending data */
|
||||
HTTP_PUT, /* PUT command, waiting for blank line */
|
||||
HTTP_PUT_RECV, /* PUT command, receiving data */
|
||||
HTTP_DELETE, /* DELETE command, waiting for blank line */
|
||||
HTTP_TRACE, /* TRACE command, waiting for blank line */
|
||||
HTTP_CLOSE, /* CLOSE command, waiting for blank line */
|
||||
HTTP_STATUS /* Command complete, sending status */
|
||||
} http_state_t;
|
||||
|
||||
|
||||
/*
|
||||
* HTTP version numbers...
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HTTP_0_9 = 9, /* HTTP/0.9 */
|
||||
HTTP_1_0 = 100, /* HTTP/1.0 */
|
||||
HTTP_1_1 = 101 /* HTTP/1.1 */
|
||||
} http_version_t;
|
||||
|
||||
|
||||
/*
|
||||
* HTTP keep-alive values...
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HTTP_KEEPALIVE_OFF = 0,
|
||||
HTTP_KEEPALIVE_ON
|
||||
} http_keepalive_t;
|
||||
|
||||
|
||||
/*
|
||||
* HTTP transfer encoding values...
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HTTP_ENCODE_LENGTH, /* Data is sent with Content-Length */
|
||||
HTTP_ENCODE_CHUNKED /* Data is chunked */
|
||||
} http_encoding_t;
|
||||
|
||||
|
||||
/*
|
||||
* HTTP status codes...
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HTTP_ERROR = -1, /* An error response from httpXxxx() */
|
||||
|
||||
HTTP_CONTINUE = 100, /* Everything OK, keep going... */
|
||||
|
||||
HTTP_OK = 200, /* OPTIONS/GET/HEAD/POST/TRACE command was successful */
|
||||
HTTP_CREATED, /* PUT command was successful */
|
||||
HTTP_ACCEPTED, /* DELETE command was successful */
|
||||
HTTP_NOT_AUTHORITATIVE, /* Information isn't authoritative */
|
||||
HTTP_NO_CONTENT, /* Successful command, no new data */
|
||||
HTTP_RESET_CONTENT, /* Content was reset/recreated */
|
||||
HTTP_PARTIAL_CONTENT, /* Only a partial file was recieved/sent */
|
||||
|
||||
HTTP_MULTIPLE_CHOICES = 300, /* Multiple files match request */
|
||||
HTTP_MOVED_PERMANENTLY, /* Document has moved permanently */
|
||||
HTTP_MOVED_TEMPORARILY, /* Document has moved temporarily */
|
||||
HTTP_SEE_OTHER, /* See this other link... */
|
||||
HTTP_NOT_MODIFIED, /* File not modified */
|
||||
HTTP_USE_PROXY, /* Must use a proxy to access this URI */
|
||||
|
||||
HTTP_BAD_REQUEST = 400, /* Bad request */
|
||||
HTTP_UNAUTHORIZED, /* Unauthorized to access host */
|
||||
HTTP_PAYMENT_REQUIRED, /* Payment required */
|
||||
HTTP_FORBIDDEN, /* Forbidden to access this URI */
|
||||
HTTP_NOT_FOUND, /* URI was not found */
|
||||
HTTP_METHOD_NOT_ALLOWED, /* Method is not allowed */
|
||||
HTTP_NOT_ACCEPTABLE, /* Not Acceptable */
|
||||
HTTP_PROXY_AUTHENTICATION, /* Proxy Authentication is Required */
|
||||
HTTP_REQUEST_TIMEOUT, /* Request timed out */
|
||||
HTTP_CONFLICT, /* Request is self-conflicting */
|
||||
HTTP_GONE, /* Server has gone away */
|
||||
HTTP_LENGTH_REQUIRED, /* A content length or encoding is required */
|
||||
HTTP_PRECONDITION, /* Precondition failed */
|
||||
HTTP_REQUEST_TOO_LARGE, /* Request entity too large */
|
||||
HTTP_URI_TOO_LONG, /* URI too long */
|
||||
HTTP_UNSUPPORTED_MEDIATYPE, /* The requested media type is unsupported */
|
||||
|
||||
HTTP_SERVER_ERROR = 500, /* Internal server error */
|
||||
HTTP_NOT_IMPLEMENTED, /* Feature not implemented */
|
||||
HTTP_BAD_GATEWAY, /* Bad gateway */
|
||||
HTTP_SERVICE_UNAVAILABLE, /* Service is unavailable */
|
||||
HTTP_GATEWAY_TIMEOUT, /* Gateway connection timed out */
|
||||
HTTP_NOT_SUPPORTED /* HTTP version not supported */
|
||||
} http_status_t;
|
||||
|
||||
|
||||
/*
|
||||
* HTTP field names...
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HTTP_FIELD_UNKNOWN = -1,
|
||||
HTTP_FIELD_ACCEPT_LANGUAGE,
|
||||
HTTP_FIELD_ACCEPT_RANGES,
|
||||
HTTP_FIELD_AUTHORIZATION,
|
||||
HTTP_FIELD_CONNECTION,
|
||||
HTTP_FIELD_CONTENT_ENCODING,
|
||||
HTTP_FIELD_CONTENT_LANGUAGE,
|
||||
HTTP_FIELD_CONTENT_LENGTH,
|
||||
HTTP_FIELD_CONTENT_LOCATION,
|
||||
HTTP_FIELD_CONTENT_MD5,
|
||||
HTTP_FIELD_CONTENT_RANGE,
|
||||
HTTP_FIELD_CONTENT_TYPE,
|
||||
HTTP_FIELD_CONTENT_VERSION,
|
||||
HTTP_FIELD_DATE,
|
||||
HTTP_FIELD_HOST,
|
||||
HTTP_FIELD_IF_MODIFIED_SINCE,
|
||||
HTTP_FIELD_IF_UNMODIFIED_SINCE,
|
||||
HTTP_FIELD_KEEP_ALIVE,
|
||||
HTTP_FIELD_LAST_MODIFIED,
|
||||
HTTP_FIELD_LINK,
|
||||
HTTP_FIELD_LOCATION,
|
||||
HTTP_FIELD_RANGE,
|
||||
HTTP_FIELD_REFERER,
|
||||
HTTP_FIELD_RETRY_AFTER,
|
||||
HTTP_FIELD_TRANSFER_ENCODING,
|
||||
HTTP_FIELD_UPGRADE,
|
||||
HTTP_FIELD_USER_AGENT,
|
||||
HTTP_FIELD_WWW_AUTHENTICATE,
|
||||
HTTP_FIELD_MAX
|
||||
} http_field_t;
|
||||
|
||||
|
||||
/*
|
||||
* HTTP connection structure...
|
||||
*/
|
||||
|
||||
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 */
|
||||
http_version_t version; /* Protocol version */
|
||||
http_keepalive_t keep_alive; /* Keep-alive supported? */
|
||||
struct sockaddr_in hostaddr; /* Address of connected host */
|
||||
char hostname[HTTP_MAX_HOST],
|
||||
/* Name of connected host */
|
||||
fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE];
|
||||
/* Field values */
|
||||
char *data; /* Pointer to data buffer */
|
||||
http_encoding_t data_encoding; /* Chunked or not */
|
||||
int data_remaining; /* Number of bytes left */
|
||||
int used; /* Number of bytes used in buffer */
|
||||
char buffer[HTTP_MAX_BUFFER];
|
||||
/* Buffer for messages */
|
||||
} http_t;
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
# 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);
|
||||
extern const char *httpGetDateString(time_t t);
|
||||
extern time_t httpGetDateTime(const char *s);
|
||||
# define httpGetField(http,field) (http)->fields[field]
|
||||
extern int httpHead(http_t *http, const char *uri);
|
||||
extern void httpInitialize(void);
|
||||
extern int httpOptions(http_t *http, const char *uri);
|
||||
extern int httpPost(http_t *http, const char *uri);
|
||||
extern int httpPrintf(http_t *http, const char *format, ...);
|
||||
extern int httpPut(http_t *http, const char *uri);
|
||||
extern int httpRead(http_t *http, char *buffer, int length);
|
||||
extern int httpReconnect(http_t *http);
|
||||
extern void httpSeparate(const char *uri, char *method, char *username,
|
||||
char *host, int *port, char *resource);
|
||||
extern void httpSetField(http_t *http, http_field_t field, const char *value);
|
||||
extern const char *httpStatus(http_status_t status);
|
||||
extern int httpTrace(http_t *http, const char *uri);
|
||||
extern http_status_t httpUpdate(http_t *http);
|
||||
extern int httpWrite(http_t *http, const char *buffer, int length);
|
||||
extern char *httpEncode64(char *out, const char *in);
|
||||
extern char *httpDecode64(char *out, const char *in);
|
||||
extern int httpGetLength(http_t *http);
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
#endif /* !_CUPS_HTTP_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-1457
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
-343
@@ -1,343 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Internet Printing Protocol definitions 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_IPP_H_
|
||||
# define _CUPS_IPP_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <cups/http.h>
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* IPP version string...
|
||||
*/
|
||||
|
||||
# define IPP_VERSION "\001\000"
|
||||
|
||||
/*
|
||||
* IPP registered port number... This is the default value - applications
|
||||
* should use the ippPort() function so that you can customize things in
|
||||
* /etc/services if needed!
|
||||
*/
|
||||
|
||||
# define IPP_PORT 631
|
||||
|
||||
/*
|
||||
* Common limits...
|
||||
*/
|
||||
|
||||
# define IPP_MAX_NAME 256
|
||||
# define IPP_MAX_VALUES 100
|
||||
|
||||
|
||||
/*
|
||||
* Types and structures...
|
||||
*/
|
||||
|
||||
typedef enum /**** Format tags for attribute formats... ****/
|
||||
{
|
||||
IPP_TAG_ZERO = 0x00,
|
||||
IPP_TAG_OPERATION,
|
||||
IPP_TAG_JOB,
|
||||
IPP_TAG_END,
|
||||
IPP_TAG_PRINTER,
|
||||
IPP_TAG_UNSUPPORTED_GROUP,
|
||||
IPP_TAG_UNSUPPORTED_VALUE = 0x10,
|
||||
IPP_TAG_DEFAULT,
|
||||
IPP_TAG_UNKNOWN,
|
||||
IPP_TAG_NOVALUE,
|
||||
IPP_TAG_INTEGER = 0x21,
|
||||
IPP_TAG_BOOLEAN,
|
||||
IPP_TAG_ENUM,
|
||||
IPP_TAG_STRING = 0x30,
|
||||
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 = 0x44,
|
||||
IPP_TAG_URI,
|
||||
IPP_TAG_URISCHEME,
|
||||
IPP_TAG_CHARSET,
|
||||
IPP_TAG_LANGUAGE,
|
||||
IPP_TAG_MIMETYPE
|
||||
} ipp_tag_t;
|
||||
|
||||
typedef enum /**** Resolution units... ****/
|
||||
{
|
||||
IPP_RES_PER_INCH = 3,
|
||||
IPP_RES_PER_CM
|
||||
} ipp_res_t;
|
||||
|
||||
typedef enum /**** Multiple Document Handling ****/
|
||||
{
|
||||
IPP_DOC_SINGLE,
|
||||
IPP_DOC_UNCOLLATED,
|
||||
IPP_DOC_COLLATED,
|
||||
IPP_DOC_SEPARATE
|
||||
} ipp_doc_t;
|
||||
|
||||
typedef enum /**** Finishings... ****/
|
||||
{
|
||||
IPP_FINISH_NONE = 3,
|
||||
IPP_FINISH_STAPLE,
|
||||
IPP_FINISH_PUNCH,
|
||||
IPP_FINISH_COVER,
|
||||
IPP_FINISH_BIND
|
||||
} ipp_finish_t;
|
||||
|
||||
typedef enum /**** Orientation... ****/
|
||||
{
|
||||
IPP_PORTRAIT = 3, /* No rotation */
|
||||
IPP_LANDSCAPE, /* 90 degrees counter-clockwise */
|
||||
IPP_REVERSE_LANDSCAPE, /* 90 degrees clockwise */
|
||||
IPP_REVERSE_PORTRAIT /* 180 degrees */
|
||||
} ipp_orient_t;
|
||||
|
||||
typedef enum /**** Qualities... ****/
|
||||
{
|
||||
IPP_QUALITY_DRAFT = 3,
|
||||
IPP_QUALITY_NORMAL,
|
||||
IPP_QUALITY_HIGH
|
||||
} ipp_quality_t;
|
||||
|
||||
typedef enum /**** Job States.... */
|
||||
{
|
||||
IPP_JOB_PENDING = 3,
|
||||
IPP_JOB_HELD,
|
||||
IPP_JOB_PROCESSING,
|
||||
IPP_JOB_STOPPED,
|
||||
IPP_JOB_CANCELED,
|
||||
IPP_JOB_ABORTED,
|
||||
IPP_JOB_COMPLETED
|
||||
} ipp_jstate_t;
|
||||
|
||||
typedef enum /**** Printer States.... */
|
||||
{
|
||||
IPP_PRINTER_IDLE = 3,
|
||||
IPP_PRINTER_PROCESSING,
|
||||
IPP_PRINTER_STOPPED
|
||||
} ipp_pstate_t;
|
||||
|
||||
typedef enum /**** IPP states... ****/
|
||||
{
|
||||
IPP_ERROR = -1, /* An error occurred */
|
||||
IPP_IDLE, /* Nothing is happening/request completed */
|
||||
IPP_HEADER, /* The request header needs to be sent/received */
|
||||
IPP_ATTRIBUTE, /* One or more attributes need to be sent/received */
|
||||
IPP_DATA /* IPP request data needs to be sent/received */
|
||||
} ipp_state_t;
|
||||
|
||||
typedef enum /**** IPP operations... ****/
|
||||
{
|
||||
IPP_PRINT_JOB = 0x0002,
|
||||
IPP_PRINT_URI,
|
||||
IPP_VALIDATE_JOB,
|
||||
IPP_CREATE_JOB,
|
||||
IPP_SEND_DOCUMENT,
|
||||
IPP_SEND_URI,
|
||||
IPP_CANCEL_JOB,
|
||||
IPP_GET_JOB_ATTRIBUTES,
|
||||
IPP_GET_JOBS,
|
||||
IPP_GET_PRINTER_ATTRIBUTES,
|
||||
IPP_HOLD_JOB = 0x000c,
|
||||
IPP_RELEASE_JOB,
|
||||
IPP_RESTART_JOB,
|
||||
IPP_PAUSE_PRINTER = 0x0010,
|
||||
IPP_RESUME_PRINTER,
|
||||
IPP_PURGE_JOBS,
|
||||
IPP_PRIVATE = 0x4000,
|
||||
CUPS_GET_DEFAULT,
|
||||
CUPS_GET_PRINTERS,
|
||||
CUPS_ADD_PRINTER,
|
||||
CUPS_DELETE_PRINTER,
|
||||
CUPS_GET_CLASSES,
|
||||
CUPS_ADD_CLASS,
|
||||
CUPS_DELETE_CLASS,
|
||||
CUPS_ACCEPT_JOBS,
|
||||
CUPS_REJECT_JOBS,
|
||||
CUPS_SET_DEFAULT
|
||||
} ipp_op_t;
|
||||
|
||||
typedef enum /**** IPP status codes... ****/
|
||||
{
|
||||
IPP_OK = 0x0000,
|
||||
IPP_OK_SUBST,
|
||||
IPP_OK_CONFLICT,
|
||||
IPP_BAD_REQUEST = 0x0400,
|
||||
IPP_FORBIDDEN,
|
||||
IPP_NOT_AUTHENTICATED,
|
||||
IPP_NOT_AUTHORIZED,
|
||||
IPP_NOT_POSSIBLE,
|
||||
IPP_TIMEOUT,
|
||||
IPP_NOT_FOUND,
|
||||
IPP_GONE,
|
||||
IPP_REQUEST_ENTITY,
|
||||
IPP_REQUEST_VALUE,
|
||||
IPP_DOCUMENT_FORMAT,
|
||||
IPP_ATTRIBUTES,
|
||||
IPP_URI_SCHEME,
|
||||
IPP_CHARSET,
|
||||
IPP_CONFLICT,
|
||||
IPP_INTERNAL_ERROR = 0x0500,
|
||||
IPP_OPERATION_NOT_SUPPORTED,
|
||||
IPP_SERVICE_UNAVAILABLE,
|
||||
IPP_VERSION_NOT_SUPPORTED,
|
||||
IPP_DEVICE_UNAVAILABLE,
|
||||
IPP_TEMPORARY_ERROR,
|
||||
IPP_NOT_ACCEPTING,
|
||||
IPP_PRINTER_BUSY
|
||||
} ipp_status_t;
|
||||
|
||||
typedef unsigned char ipp_uchar_t;/**** Unsigned 8-bit integer/character ****/
|
||||
|
||||
typedef union /**** Request Header ****/
|
||||
{
|
||||
struct /* Any Header */
|
||||
{
|
||||
ipp_uchar_t version[2]; /* Protocol version number */
|
||||
int op_status; /* Operation ID or status code*/
|
||||
int request_id; /* Request ID */
|
||||
} any;
|
||||
|
||||
struct /* Operation Header */
|
||||
{
|
||||
ipp_uchar_t version[2]; /* Protocol version number */
|
||||
ipp_op_t operation_id; /* Operation ID */
|
||||
int request_id; /* Request ID */
|
||||
} op;
|
||||
|
||||
struct /* Status Header */
|
||||
{
|
||||
ipp_uchar_t version[2]; /* Protocol version number */
|
||||
ipp_status_t status_code; /* Status code */
|
||||
int request_id; /* Request ID */
|
||||
} status;
|
||||
} ipp_request_t;
|
||||
|
||||
|
||||
typedef union /**** Attribute Value ****/
|
||||
{
|
||||
int integer; /* Integer/enumerated value */
|
||||
|
||||
char boolean; /* Boolean value */
|
||||
|
||||
ipp_uchar_t date[11]; /* Date/time value */
|
||||
|
||||
struct
|
||||
{
|
||||
int xres, /* Horizontal resolution */
|
||||
yres; /* Vertical resolution */
|
||||
ipp_res_t units; /* Resolution units */
|
||||
} resolution; /* Resolution value */
|
||||
|
||||
struct
|
||||
{
|
||||
int lower, /* Lower value */
|
||||
upper; /* Upper value */
|
||||
} range; /* Range of integers value */
|
||||
|
||||
struct
|
||||
{
|
||||
char *charset; /* Character set */
|
||||
char *text; /* String */
|
||||
} string; /* String with language value */
|
||||
} ipp_value_t;
|
||||
|
||||
typedef struct ipp_attribute_s /**** Attribute ****/
|
||||
{
|
||||
struct ipp_attribute_s *next;
|
||||
/* Next atrtribute in list */
|
||||
ipp_tag_t group_tag, /* Job/Printer/Operation group tag */
|
||||
value_tag; /* What type of value is it? */
|
||||
char *name; /* Name of attribute */
|
||||
int num_values; /* Number of values */
|
||||
ipp_value_t values[1]; /* Values */
|
||||
} ipp_attribute_t;
|
||||
|
||||
typedef struct /**** Request State ****/
|
||||
{
|
||||
ipp_state_t state; /* State of request */
|
||||
ipp_request_t request; /* Request header */
|
||||
ipp_attribute_t *attrs, /* Attributes */
|
||||
*last, /* Last attribute in list */
|
||||
*current; /* Current attribute (for read/write) */
|
||||
ipp_tag_t curtag; /* Current attribute group tag */
|
||||
} ipp_t;
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern time_t ippDateToTime(const ipp_uchar_t *date);
|
||||
extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group, const char *name, char value);
|
||||
extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, const char *values);
|
||||
extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group, const char *name, const ipp_uchar_t *value);
|
||||
extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int value);
|
||||
extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int num_values, const int *values);
|
||||
extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group, const char *name, int lower, int upper);
|
||||
extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, const int *lower, const int *upper);
|
||||
extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group, const char *name, ipp_res_t units, int xres, int yres);
|
||||
extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, ipp_res_t units, const int *xres, const int *yres);
|
||||
extern ipp_attribute_t *ippAddSeparator(ipp_t *ipp);
|
||||
extern ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, const char *charset, const char *value);
|
||||
extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int num_values, const char *charset, const char **values);
|
||||
extern void ippDelete(ipp_t *ipp);
|
||||
extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name, ipp_tag_t type);
|
||||
extern size_t ippLength(ipp_t *ipp);
|
||||
extern ipp_t *ippNew(void);
|
||||
extern ipp_state_t ippRead(http_t *http, ipp_t *ipp);
|
||||
extern const ipp_uchar_t *ippTimeToDate(time_t t);
|
||||
extern ipp_state_t ippWrite(http_t *http, ipp_t *ipp);
|
||||
extern int ippPort(void);
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
#endif /* !_CUPS_IPP_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,390 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* I18N/language support 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:
|
||||
*
|
||||
* cupsLangEncoding() - Return the character encoding (us-ascii, etc.)
|
||||
* for the given language.
|
||||
* cupsLangFlush() - Flush all language data out of the cache.
|
||||
* cupsLangFree() - Free language data.
|
||||
* cupsLangGet() - Get a language.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include "string.h"
|
||||
#include "language.h"
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static cups_lang_t *lang_cache = NULL; /* Language string cache */
|
||||
static char *lang_blank = ""; /* Blank constant string */
|
||||
static char *lang_encodings[] = /* Encoding strings */
|
||||
{
|
||||
"us-ascii",
|
||||
"iso8859-1",
|
||||
"iso8859-2",
|
||||
"iso8859-3",
|
||||
"iso8859-4",
|
||||
"iso8859-5",
|
||||
"iso8859-6",
|
||||
"iso8859-7",
|
||||
"iso8859-8",
|
||||
"iso8859-9",
|
||||
"iso8859-10",
|
||||
"utf8"
|
||||
};
|
||||
static char *lang_default[] = /* Default POSIX locale */
|
||||
{
|
||||
#include "cups_C.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsLangEncoding()' - Return the character encoding (us-ascii, etc.)
|
||||
* for the given language.
|
||||
*/
|
||||
|
||||
char * /* O - Character encoding */
|
||||
cupsLangEncoding(cups_lang_t *lang) /* I - Language data */
|
||||
{
|
||||
if (lang == NULL)
|
||||
return (lang_encodings[0]);
|
||||
else
|
||||
return (lang_encodings[lang->encoding]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsLangFlush()' - Flush all language data out of the cache.
|
||||
*/
|
||||
|
||||
void
|
||||
cupsLangFlush(void)
|
||||
{
|
||||
int i; /* Looping var */
|
||||
cups_lang_t *lang, /* Current language */
|
||||
*next; /* Next language */
|
||||
|
||||
|
||||
for (lang = lang_cache; lang != NULL; lang = next)
|
||||
{
|
||||
for (i = 0; i < CUPS_MSG_MAX; i ++)
|
||||
if (lang->messages[i] != NULL && lang->messages[i] != lang_blank)
|
||||
free(lang->messages[i]);
|
||||
|
||||
next = lang->next;
|
||||
free(lang);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsLangFree()' - Free language data.
|
||||
*
|
||||
* This does not actually free anything; use cupsLangFlush() for that.
|
||||
*/
|
||||
|
||||
void
|
||||
cupsLangFree(cups_lang_t *lang) /* I - Language to free */
|
||||
{
|
||||
if (lang != NULL && lang->used > 0)
|
||||
lang->used --;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsLangGet()' - Get a language.
|
||||
*/
|
||||
|
||||
cups_lang_t * /* O - Language data */
|
||||
cupsLangGet(const char *language) /* I - Language or locale */
|
||||
{
|
||||
int i, count; /* Looping vars */
|
||||
char langname[16], /* Requested language name */
|
||||
real[16], /* Real language name */
|
||||
filename[1024], /* Filename for language locale file */
|
||||
*localedir; /* Directory for locale files */
|
||||
FILE *fp; /* Language locale file pointer */
|
||||
char line[1024]; /* Line from file */
|
||||
cups_msg_t msg; /* Message number */
|
||||
char *text; /* Message text */
|
||||
cups_lang_t *lang; /* Current language... */
|
||||
|
||||
|
||||
/*
|
||||
* Convert the language string passed in to a locale string. "C" is the
|
||||
* 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. Any trailing character set specification is
|
||||
* dropped.
|
||||
*/
|
||||
|
||||
if (language == NULL || language[0] == '\0' ||
|
||||
strcmp(language, "POSIX") == 0)
|
||||
strcpy(langname, "C");
|
||||
else
|
||||
{
|
||||
/*
|
||||
* 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");
|
||||
else
|
||||
{
|
||||
real[0] = tolower(langname[0]);
|
||||
real[1] = tolower(langname[1]);
|
||||
|
||||
if (langname[2] == '_' || langname[2] == '-')
|
||||
{
|
||||
real[2] = '_';
|
||||
real[3] = toupper(langname[3]);
|
||||
real[4] = toupper(langname[4]);
|
||||
real[5] = '\0';
|
||||
langname[5] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
langname[2] = '\0';
|
||||
real[2] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Next try to open a locale file; we will try the country-localized file
|
||||
* first, and then look for generic language file. If all else fails we
|
||||
* will use the POSIX locale.
|
||||
*/
|
||||
|
||||
if ((localedir = getenv("LOCALEDIR")) == NULL)
|
||||
localedir = CUPS_LOCALEDIR;
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s/cups_%s", localedir, real, real);
|
||||
|
||||
if ((fp = fopen(filename, "r")) == NULL)
|
||||
if (strlen(real) > 2)
|
||||
{
|
||||
/*
|
||||
* Nope, see if we can open a generic language file...
|
||||
*/
|
||||
|
||||
real[2] = '\0';
|
||||
snprintf(filename, sizeof(filename), "%s/%s/cups_%s", localedir, real,
|
||||
real);
|
||||
fp = fopen(filename, "r");
|
||||
}
|
||||
|
||||
/*
|
||||
* Then see if we already have this language loaded...
|
||||
*/
|
||||
|
||||
for (lang = lang_cache; lang != NULL; lang = lang->next)
|
||||
if (strcmp(lang->language, langname) == 0)
|
||||
{
|
||||
lang->used ++;
|
||||
|
||||
if (fp != NULL)
|
||||
fclose(fp);
|
||||
|
||||
return (lang);
|
||||
}
|
||||
|
||||
/*
|
||||
* OK, we have an open messages file; the first line will contain the
|
||||
* language encoding (us-ascii, iso-8859-1, etc.), and the rest will
|
||||
* be messages consisting of:
|
||||
*
|
||||
* #### SP message text
|
||||
*
|
||||
* or:
|
||||
*
|
||||
* message text
|
||||
*
|
||||
* If the line starts with a number, then message processing picks up
|
||||
* where the number indicates. Otherwise the last message number is
|
||||
* incremented.
|
||||
*
|
||||
* All leading whitespace is deleted.
|
||||
*/
|
||||
|
||||
if (fp == NULL)
|
||||
strcpy(line, lang_default[0]);
|
||||
else if (fgets(line, sizeof(line), fp) == NULL)
|
||||
{
|
||||
/*
|
||||
* Can't read encoding!
|
||||
*/
|
||||
|
||||
fclose(fp);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
i = strlen(line) - 1;
|
||||
if (line[i] == '\n')
|
||||
line[i] = '\0'; /* Strip LF */
|
||||
|
||||
/*
|
||||
* See if there is a free language available; if so, use that
|
||||
* record...
|
||||
*/
|
||||
|
||||
for (lang = lang_cache; lang != NULL; lang = lang->next)
|
||||
if (lang->used == 0)
|
||||
break;
|
||||
|
||||
if (lang == NULL)
|
||||
{
|
||||
/*
|
||||
* Allocate memory for the language and add it to the cache.
|
||||
*/
|
||||
|
||||
if ((lang = calloc(sizeof(cups_lang_t), 1)) == NULL)
|
||||
{
|
||||
fclose(fp);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
lang->next = lang_cache;
|
||||
lang_cache = lang;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Free all old strings as needed...
|
||||
*/
|
||||
|
||||
for (i = 0; i < CUPS_MSG_MAX; i ++)
|
||||
{
|
||||
if (lang->messages[i] != NULL && lang->messages[i] != lang_blank)
|
||||
free(lang->messages[i]);
|
||||
|
||||
lang->messages[i] = lang_blank;
|
||||
}
|
||||
|
||||
/*
|
||||
* Then assign the language and encoding fields...
|
||||
*/
|
||||
|
||||
lang->used ++;
|
||||
strcpy(lang->language, langname);
|
||||
|
||||
for (i = 0; i < (sizeof(lang_encodings) / sizeof(lang_encodings[0])); i ++)
|
||||
if (strcmp(lang_encodings[i], line) == 0)
|
||||
{
|
||||
lang->encoding = (cups_encoding_t)i;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the strings from the file...
|
||||
*/
|
||||
|
||||
msg = (cups_msg_t)-1;
|
||||
count = 1;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/*
|
||||
* Read a line from memory or from a file...
|
||||
*/
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
if (lang_default[count] == NULL)
|
||||
break;
|
||||
|
||||
strcpy(line, lang_default[count]);
|
||||
}
|
||||
else if (fgets(line, sizeof(line), fp) == NULL)
|
||||
break;
|
||||
|
||||
count ++;
|
||||
|
||||
/*
|
||||
* Ignore blank lines...
|
||||
*/
|
||||
|
||||
i = strlen(line) - 1;
|
||||
if (line[i] == '\n')
|
||||
line[i] = '\0'; /* Strip LF */
|
||||
|
||||
if (line[0] == '\0')
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Grab the message number and text...
|
||||
*/
|
||||
|
||||
if (isdigit(line[0]))
|
||||
msg = (cups_msg_t)atoi(line);
|
||||
else
|
||||
msg ++;
|
||||
|
||||
if (msg < 0 || msg >= CUPS_MSG_MAX)
|
||||
continue;
|
||||
|
||||
text = line;
|
||||
while (isdigit(*text))
|
||||
text ++;
|
||||
while (isspace(*text))
|
||||
text ++;
|
||||
|
||||
lang->messages[msg] = strdup(text);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the file and return...
|
||||
*/
|
||||
|
||||
if (fp != NULL)
|
||||
fclose(fp);
|
||||
|
||||
return (lang);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,200 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Multi-language support 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_LANGUAGE_H_
|
||||
# define _CUPS_LANGUAGE_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <locale.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Messages...
|
||||
*/
|
||||
|
||||
typedef enum /**** Message Indices ****/
|
||||
{
|
||||
CUPS_MSG_OK,
|
||||
CUPS_MSG_CANCEL,
|
||||
CUPS_MSG_HELP,
|
||||
CUPS_MSG_QUIT,
|
||||
CUPS_MSG_CLOSE,
|
||||
CUPS_MSG_YES,
|
||||
CUPS_MSG_NO,
|
||||
CUPS_MSG_ON,
|
||||
CUPS_MSG_OFF,
|
||||
CUPS_MSG_SAVE,
|
||||
CUPS_MSG_DISCARD,
|
||||
CUPS_MSG_DEFAULT,
|
||||
CUPS_MSG_OPTIONS,
|
||||
CUPS_MSG_MORE_INFO,
|
||||
CUPS_MSG_BLACK,
|
||||
CUPS_MSG_COLOR,
|
||||
CUPS_MSG_CYAN,
|
||||
CUPS_MSG_MAGENTA,
|
||||
CUPS_MSG_YELLOW,
|
||||
CUPS_MSG_COPYRIGHT,
|
||||
CUPS_MSG_GENERAL,
|
||||
CUPS_MSG_PRINTER,
|
||||
CUPS_MSG_IMAGE,
|
||||
CUPS_MSG_HPGL2,
|
||||
CUPS_MSG_EXTRA,
|
||||
CUPS_MSG_DOCUMENT,
|
||||
CUPS_MSG_OTHER,
|
||||
CUPS_MSG_PRINT_PAGES,
|
||||
CUPS_MSG_ENTIRE_DOCUMENT,
|
||||
CUPS_MSG_PAGE_RANGE,
|
||||
CUPS_MSG_REVERSE_ORDER,
|
||||
CUPS_MSG_PAGE_FORMAT,
|
||||
CUPS_MSG_1_UP,
|
||||
CUPS_MSG_2_UP,
|
||||
CUPS_MSG_4_UP,
|
||||
CUPS_MSG_IMAGE_SCALING,
|
||||
CUPS_MSG_USE_NATURAL_IMAGE_SIZE,
|
||||
CUPS_MSG_ZOOM_BY_PERCENT,
|
||||
CUPS_MSG_ZOOM_BY_PPI,
|
||||
CUPS_MSG_MIRROR_IMAGE,
|
||||
CUPS_MSG_COLOR_SATURATION,
|
||||
CUPS_MSG_COLOR_HUE,
|
||||
CUPS_MSG_FIT_TO_PAGE,
|
||||
CUPS_MSG_SHADING,
|
||||
CUPS_MSG_DEFAULT_PEN_WIDTH,
|
||||
CUPS_MSG_GAMMA_CORRECTION,
|
||||
CUPS_MSG_BRIGHTNESS,
|
||||
CUPS_MSG_ADD,
|
||||
CUPS_MSG_DELETE,
|
||||
CUPS_MSG_MODIFY,
|
||||
CUPS_MSG_PRINTER_URI,
|
||||
CUPS_MSG_PRINTER_NAME,
|
||||
CUPS_MSG_PRINTER_LOCATION,
|
||||
CUPS_MSG_PRINTER_INFO,
|
||||
CUPS_MSG_PRINTER_MAKE_AND_MODEL,
|
||||
CUPS_MSG_DEVICE_URI,
|
||||
CUPS_MSG_FORMATTING_PAGE,
|
||||
CUPS_MSG_PRINTING_PAGE,
|
||||
CUPS_MSG_INITIALIZING_PRINTER,
|
||||
CUPS_MSG_PRINTER_STATE,
|
||||
CUPS_MSG_ACCEPTING_JOBS,
|
||||
CUPS_MSG_NOT_ACCEPTING_JOBS,
|
||||
CUPS_MSG_PRINT_JOBS,
|
||||
CUPS_MSG_CLASS,
|
||||
CUPS_MSG_LOCAL,
|
||||
CUPS_MSG_REMOTE,
|
||||
CUPS_MSG_DUPLEXING,
|
||||
CUPS_MSG_STAPLING,
|
||||
CUPS_MSG_FAST_COPIES,
|
||||
CUPS_MSG_COLLATED_COPIES,
|
||||
CUPS_MSG_PUNCHING,
|
||||
CUPS_MSG_COVERING,
|
||||
CUPS_MSG_BINDING,
|
||||
CUPS_MSG_SORTING,
|
||||
CUPS_MSG_SMALL,
|
||||
CUPS_MSG_MEDIUM,
|
||||
CUPS_MSG_LARGE,
|
||||
CUPS_MSG_VARIABLE,
|
||||
CUPS_MSG_IDLE,
|
||||
CUPS_MSG_PROCESSING,
|
||||
CUPS_MSG_STOPPED,
|
||||
CUPS_MSG_ALL,
|
||||
CUPS_MSG_ODD,
|
||||
CUPS_MSG_EVEN_PAGES,
|
||||
CUPS_MSG_DARKER_LIGHTER,
|
||||
CUPS_MSG_MEDIA_SIZE,
|
||||
CUPS_MSG_MEDIA_TYPE,
|
||||
CUPS_MSG_MEDIA_SOURCE,
|
||||
CUPS_MSG_ORIENTATION,
|
||||
CUPS_MSG_PORTRAIT,
|
||||
CUPS_MSG_LANDSCAPE,
|
||||
CUPS_MSG_JOB_STATE,
|
||||
CUPS_MSG_JOB_NAME,
|
||||
CUPS_MSG_USER_NAME,
|
||||
CUPS_MSG_PRIORITY,
|
||||
CUPS_MSG_COPIES,
|
||||
CUPS_MSG_FILE_SIZE,
|
||||
CUPS_MSG_PENDING,
|
||||
CUPS_MSG_OUTPUT_MODE,
|
||||
CUPS_MSG_RESOLUTION,
|
||||
CUPS_MSG_HTTP_BASE = 200,
|
||||
CUPS_MSG_HTTP_END = 505,
|
||||
CUPS_MSG_MAX
|
||||
} cups_msg_t;
|
||||
|
||||
typedef enum /**** Language Encodings ****/
|
||||
{
|
||||
CUPS_US_ASCII,
|
||||
CUPS_ISO8859_1,
|
||||
CUPS_ISO8859_2,
|
||||
CUPS_ISO8859_3,
|
||||
CUPS_ISO8859_4,
|
||||
CUPS_ISO8859_5,
|
||||
CUPS_ISO8859_6,
|
||||
CUPS_ISO8859_7,
|
||||
CUPS_ISO8859_8,
|
||||
CUPS_ISO8859_9,
|
||||
CUPS_ISO8859_10,
|
||||
CUPS_UTF8
|
||||
} cups_encoding_t;
|
||||
|
||||
typedef struct cups_lang_str /**** Language Cache Structure ****/
|
||||
{
|
||||
struct cups_lang_str *next; /* Next language in cache */
|
||||
int used; /* Number of times this entry has been used. */
|
||||
cups_encoding_t encoding; /* Text encoding */
|
||||
char language[16]; /* Language/locale name */
|
||||
char *messages[CUPS_MSG_MAX];
|
||||
/* Message array */
|
||||
} cups_lang_t;
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
# 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);
|
||||
extern cups_lang_t *cupsLangGet(const char *language);
|
||||
# define cupsLangString(lang,msg) (lang)->messages[(msg)]
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_LANGUAGE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-412
@@ -1,412 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Option marking routines 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.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
|
||||
*
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* ppdConflicts() - Check to see if there are any conflicts.
|
||||
* ppdFindChoice() - Return a pointer to an option choice.
|
||||
* ppdFindMarkedChoice() - Return the marked choice for the specified option.
|
||||
* ppdFindOption() - Return a pointer to the specified option.
|
||||
* ppdIsMarked() - Check to see if an option is marked...
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "ppd.h"
|
||||
#include "string.h"
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void ppd_defaults(ppd_file_t *ppd, ppd_group_t *g);
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdConflicts()' - Check to see if there are any conflicts.
|
||||
*/
|
||||
|
||||
int /* O - Number of conflicts found */
|
||||
ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
|
||||
{
|
||||
int i, j, k, /* Looping variables */
|
||||
conflicts; /* Number of conflicts */
|
||||
ppd_const_t *c; /* Current constraint */
|
||||
ppd_group_t *g, *sg; /* Groups */
|
||||
ppd_option_t *o1, *o2; /* Options */
|
||||
ppd_choice_t *c1, *c2; /* Choices */
|
||||
|
||||
|
||||
if (ppd == NULL)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Clear all conflicts...
|
||||
*/
|
||||
|
||||
conflicts = 0;
|
||||
|
||||
for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++)
|
||||
{
|
||||
for (j = g->num_options, o1 = g->options; j > 0; j --, o1 ++)
|
||||
o1->conflicted = 0;
|
||||
|
||||
for (j = g->num_subgroups, sg = g->subgroups; j > 0; j --, sg ++)
|
||||
for (k = sg->num_options, o1 = sg->options; k > 0; k --, o1 ++)
|
||||
o1->conflicted = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop through all of the UI constraints and flag any options
|
||||
* that conflict...
|
||||
*/
|
||||
|
||||
for (i = ppd->num_consts, c = ppd->consts; i > 0; i --, c ++)
|
||||
{
|
||||
/*
|
||||
* Grab pointers to the first option...
|
||||
*/
|
||||
|
||||
o1 = ppdFindOption(ppd, c->option1);
|
||||
|
||||
if (o1 == NULL)
|
||||
continue;
|
||||
else if (c->choice1[0] != '\0')
|
||||
{
|
||||
/*
|
||||
* This constraint maps to a specific choice.
|
||||
*/
|
||||
|
||||
c1 = ppdFindChoice(o1, c->choice1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* This constraint applies to any choice for this option.
|
||||
*/
|
||||
|
||||
for (j = o1->num_choices, c1 = o1->choices; j > 0; j --, c1 ++)
|
||||
if (c1->marked)
|
||||
break;
|
||||
|
||||
if (j == 0 || strcasecmp(c1->choice, "None") == 0)
|
||||
c1 = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Grab pointers to the second option...
|
||||
*/
|
||||
|
||||
o2 = ppdFindOption(ppd, c->option2);
|
||||
|
||||
if (o2 == NULL)
|
||||
continue;
|
||||
else if (c->choice2[0] != '\0')
|
||||
{
|
||||
/*
|
||||
* This constraint maps to a specific choice.
|
||||
*/
|
||||
|
||||
c2 = ppdFindChoice(o2, c->choice2);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* This constraint applies to any choice for this option.
|
||||
*/
|
||||
|
||||
for (j = o2->num_choices, c2 = o2->choices; j > 0; j --, c2 ++)
|
||||
if (c2->marked)
|
||||
break;
|
||||
|
||||
if (j == 0 || strcasecmp(c2->choice, "None") == 0)
|
||||
c2 = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* If both options are marked then there is a conflict...
|
||||
*/
|
||||
|
||||
if (c1 != NULL && c1->marked &&
|
||||
c2 != NULL && c2->marked)
|
||||
{
|
||||
conflicts ++;
|
||||
o1->conflicted = 1;
|
||||
o2->conflicted = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the number of conflicts found...
|
||||
*/
|
||||
|
||||
return (conflicts);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdFindChoice()' - Return a pointer to an option choice.
|
||||
*/
|
||||
|
||||
ppd_choice_t * /* O - Choice pointer or NULL */
|
||||
ppdFindChoice(ppd_option_t *o, /* I - Pointer to option */
|
||||
const char *choice) /* I - Name of choice */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ppd_choice_t *c; /* Current choice */
|
||||
|
||||
|
||||
if (o == NULL || choice == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
|
||||
if (strcasecmp(c->choice, choice) == 0)
|
||||
return (c);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdFindMarkedChoice()' - Return the marked choice for the specified option.
|
||||
*/
|
||||
|
||||
ppd_choice_t * /* O - Pointer to choice or NULL */
|
||||
ppdFindMarkedChoice(ppd_file_t *ppd, /* I - PPD file */
|
||||
const char *option) /* I - Keyword/option name */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ppd_option_t *o; /* Pointer to option */
|
||||
ppd_choice_t *c; /* Pointer to choice */
|
||||
|
||||
|
||||
if ((o = ppdFindOption(ppd, option)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
|
||||
if (c->marked)
|
||||
return (c);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdFindOption()' - Return a pointer to the specified option.
|
||||
*/
|
||||
|
||||
ppd_option_t * /* O - Pointer to option or NULL */
|
||||
ppdFindOption(ppd_file_t *ppd, /* I - PPD file data */
|
||||
const char *option) /* I - Option/Keyword name */
|
||||
{
|
||||
int i, j, k; /* Looping vars */
|
||||
ppd_option_t *o; /* Pointer to option */
|
||||
ppd_group_t *g, /* Pointer to group */
|
||||
*sg; /* Pointer to subgroup */
|
||||
|
||||
|
||||
if (ppd == NULL || option == NULL)
|
||||
return (NULL);
|
||||
|
||||
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 (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 (strcasecmp(o->keyword, option) == 0)
|
||||
return (o);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdIsMarked()' - Check to see if an option is marked...
|
||||
*/
|
||||
|
||||
int /* O - Non-zero if option is marked */
|
||||
ppdIsMarked(ppd_file_t *ppd, /* I - PPD file data */
|
||||
const char *option, /* I - Option/Keyword name */
|
||||
const char *choice) /* I - Choice name */
|
||||
{
|
||||
ppd_option_t *o; /* Option pointer */
|
||||
ppd_choice_t *c; /* Choice pointer */
|
||||
|
||||
|
||||
if (ppd == NULL)
|
||||
return (0);
|
||||
|
||||
if ((o = ppdFindOption(ppd, option)) == NULL)
|
||||
return (0);
|
||||
|
||||
if ((c = ppdFindChoice(o, choice)) == NULL)
|
||||
return (0);
|
||||
|
||||
return (c->marked);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdMarkDefaults()' - Mark all default options in the PPD file.
|
||||
*/
|
||||
|
||||
void
|
||||
ppdMarkDefaults(ppd_file_t *ppd)/* I - PPD file record */
|
||||
{
|
||||
int i; /* Looping variables */
|
||||
ppd_group_t *g; /* Current group */
|
||||
ppd_option_t *o; /* PageSize option */
|
||||
|
||||
|
||||
if (ppd == NULL)
|
||||
return;
|
||||
|
||||
for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++)
|
||||
ppd_defaults(ppd, g);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdMarkOption()' - Mark an option in a PPD file.
|
||||
*
|
||||
* Notes:
|
||||
*
|
||||
* -1 is returned if the given option would conflict with any currently
|
||||
* selected option.
|
||||
*/
|
||||
|
||||
int /* O - Number of conflicts */
|
||||
ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
|
||||
const char *option, /* I - Keyword */
|
||||
const char *choice) /* I - Option name */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ppd_option_t *o; /* Option pointer */
|
||||
ppd_choice_t *c; /* Choice pointer */
|
||||
|
||||
|
||||
if (ppd == NULL)
|
||||
return (0);
|
||||
|
||||
if (strcasecmp(option, "PageSize") == 0 && strncasecmp(choice, "Custom.", 7) == 0)
|
||||
{
|
||||
/*
|
||||
* Handle variable page sizes...
|
||||
*/
|
||||
|
||||
ppdPageSize(ppd, choice);
|
||||
choice = "Custom";
|
||||
}
|
||||
|
||||
if ((o = ppdFindOption(ppd, option)) == NULL)
|
||||
return (0);
|
||||
|
||||
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
|
||||
if (strcasecmp(c->choice, choice) == 0)
|
||||
break;
|
||||
|
||||
if (i)
|
||||
{
|
||||
/*
|
||||
* Option found; mark it and then handle unmarking any other options.
|
||||
*/
|
||||
|
||||
c->marked = 1;
|
||||
|
||||
if (o->ui != PPD_UI_PICKMANY)
|
||||
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
|
||||
if (strcasecmp(c->choice, choice) != 0)
|
||||
c->marked = 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 = strcasecmp(ppd->sizes[i].name, choice) == 0;
|
||||
|
||||
/*
|
||||
* Unmark the current PageSize or PageRegion setting, as appropriate...
|
||||
*/
|
||||
|
||||
if (strcasecmp(option, "PageSize") == 0)
|
||||
{
|
||||
if ((o = ppdFindOption(ppd, "PageRegion")) != NULL)
|
||||
for (i = 0; i < o->num_choices; i ++)
|
||||
o->choices[i].marked = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((o = ppdFindOption(ppd, "PageSize")) != NULL)
|
||||
for (i = 0; i < o->num_choices; i ++)
|
||||
o->choices[i].marked = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (ppdConflicts(ppd));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_defaults()' - Set the defaults for this group and all sub-groups.
|
||||
*/
|
||||
|
||||
static void
|
||||
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 */
|
||||
ppd_group_t *sg; /* Current sub-group */
|
||||
|
||||
|
||||
if (g == NULL)
|
||||
return;
|
||||
|
||||
for (i = g->num_options, o = g->options; i > 0; i --, 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(ppd, sg);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-622
@@ -1,622 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* MIME database file routines 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.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:
|
||||
*
|
||||
* mimeDelete() - Delete (free) a MIME database.
|
||||
* mimeMerge() - Merge a MIME database from disk with the current one.
|
||||
* mimeNew() - Create a new, empty MIME database.
|
||||
* load_types() - Load a xyz.types file...
|
||||
* delete_rules() - Free all memory for the given rule tree.
|
||||
* load_convs() - Load a xyz.convs file...
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Revision 1.13 1999/06/18 18:36:10 mike
|
||||
* Fixed address to 44141 Airport View Drive...
|
||||
*
|
||||
* Revision 1.12 1999/04/21 21:19:33 mike
|
||||
* Changes for HP-UX.
|
||||
*
|
||||
* Revision 1.11 1999/04/21 19:31:29 mike
|
||||
* Changed the directory header stuff to use the autoconf-recommended
|
||||
* sequence of #ifdef's.
|
||||
*
|
||||
* Changed the language routines to look for the LOCALEDIR environment
|
||||
* variable, and if it is not defined to use the LOCALEDIR string defined
|
||||
* in config.h.
|
||||
*
|
||||
* Revision 1.10 1999/03/01 20:51:53 mike
|
||||
* Code cleanup - removed extraneous semi-colons...
|
||||
*
|
||||
* Revision 1.9 1999/02/26 22:00:51 mike
|
||||
* Added more debug statements.
|
||||
*
|
||||
* Fixed bugs in cupsPrintFile() - wasn't setting the IPP_TAG_MIMETYPE
|
||||
* value tag for the file type.
|
||||
*
|
||||
* Updated conversion filter code to handle wildcards for super-type.
|
||||
*
|
||||
* Revision 1.8 1999/02/20 16:04:38 mike
|
||||
* Updated mime.c to scan directories under WIN32.
|
||||
*
|
||||
* Fixed some compiler warnings under WIN32.
|
||||
*
|
||||
* Updated VC++ project files.
|
||||
*
|
||||
* Updated mime.types and mime.convs files for actual registered
|
||||
* MIME type names.
|
||||
*
|
||||
* Revision 1.7 1999/02/05 17:40:53 mike
|
||||
* Added IPP client read/write code.
|
||||
*
|
||||
* Added string functions missing from some UNIXs.
|
||||
*
|
||||
* Added option parsing functions.
|
||||
*
|
||||
* Added IPP convenience functions (not implemented yet).
|
||||
*
|
||||
* Updated source files to use local string.h as needed (for
|
||||
* missing string functions)
|
||||
*
|
||||
* Revision 1.6 1999/02/01 22:08:39 mike
|
||||
* Restored original directory-scanning functionality of mimeLoad().
|
||||
*
|
||||
* Revision 1.4 1999/01/27 18:31:56 mike
|
||||
* Updated PPD routines to handle emulations and patch files.
|
||||
*
|
||||
* Added DSC comments to emit output as appropriate.
|
||||
*
|
||||
* Revision 1.3 1999/01/24 14:18:43 mike
|
||||
* Check-in prior to CVS use.
|
||||
*
|
||||
* Revision 1.2 1998/08/06 14:38:38 mike
|
||||
* Finished coding and testing for CUPS 1.0.
|
||||
*
|
||||
* Revision 1.1 1998/06/11 20:50:53 mike
|
||||
* Initial revision
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "string.h"
|
||||
#include "mime.h"
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <windows.h>
|
||||
#elif HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
typedef struct dirent DIRENT;
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
#else
|
||||
# if HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# if HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# if HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
typedef struct direct DIRENT;
|
||||
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void load_types(mime_t *mime, char *filename);
|
||||
static void load_convs(mime_t *mime, char *filename);
|
||||
static void delete_rules(mime_magic_t *rules);
|
||||
|
||||
|
||||
/*
|
||||
* 'mimeDelete()' - Delete (free) a MIME database.
|
||||
*/
|
||||
|
||||
void
|
||||
mimeDelete(mime_t *mime) /* I - MIME database */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
|
||||
|
||||
if (mime == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Loop through the file types and delete any rules...
|
||||
*/
|
||||
|
||||
for (i = 0; i < mime->num_types; i ++)
|
||||
{
|
||||
delete_rules(mime->types[i]->rules);
|
||||
free(mime->types[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free the types and filters arrays, and then the MIME database structure.
|
||||
*/
|
||||
|
||||
free(mime->types);
|
||||
free(mime->filters);
|
||||
free(mime);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'mimeMerge()' - Merge a MIME database from disk with the current one.
|
||||
*/
|
||||
|
||||
mime_t * /* O - Updated MIME database */
|
||||
mimeMerge(mime_t *mime, /* I - MIME database to add to */
|
||||
const char *pathname) /* I - Directory to load */
|
||||
{
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
HANDLE dir; /* Directory handle */
|
||||
WIN32_FIND_DATA dent; /* Directory entry */
|
||||
char filename[1024], /* Full filename of types/converts file */
|
||||
*pathsep; /* Last character in path */
|
||||
|
||||
|
||||
/*
|
||||
* First open the directory specified by pathname... Return NULL if nothing
|
||||
* was read or if the pathname is NULL...
|
||||
*/
|
||||
|
||||
if (pathname == NULL)
|
||||
return (NULL);
|
||||
|
||||
strncpy(filename, pathname, sizeof(filename) - 1);
|
||||
filename[sizeof(filename) - 1] = '\0';
|
||||
|
||||
pathsep = filename + strlen(filename);
|
||||
if (pathsep == filename ||
|
||||
(pathsep[-1] != '/' && pathsep[-1] != '\\'))
|
||||
{
|
||||
strcpy(pathsep, "/");
|
||||
pathsep ++;
|
||||
}
|
||||
|
||||
strcpy(pathsep, "*.types");
|
||||
|
||||
if ((dir = FindFirstFile(filename, &dent)) == 0)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* If "mime" is NULL, make a new, blank database...
|
||||
*/
|
||||
|
||||
if (mime == NULL)
|
||||
if ((mime = mimeNew()) == NULL)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* Read all the .types files...
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
/*
|
||||
* Load a mime.types file...
|
||||
*/
|
||||
|
||||
strcpy(pathsep, dent.cFileName);
|
||||
load_types(mime, filename);
|
||||
}
|
||||
while (FindNextFile(dir, &dent));
|
||||
|
||||
FindClose(dir);
|
||||
|
||||
/*
|
||||
* Read all the .convs files...
|
||||
*/
|
||||
|
||||
strcpy(pathsep, "*.convs");
|
||||
|
||||
if ((dir = FindFirstFile(filename, &dent)) == 0)
|
||||
return (mime);
|
||||
|
||||
do
|
||||
{
|
||||
/*
|
||||
* Load a mime.convs file...
|
||||
*/
|
||||
|
||||
strcpy(pathsep, dent.cFileName);
|
||||
load_convs(mime, filename);
|
||||
}
|
||||
while (FindNextFile(dir, &dent));
|
||||
|
||||
FindClose(dir);
|
||||
|
||||
return (mime);
|
||||
#else
|
||||
DIR *dir; /* Directory */
|
||||
DIRENT *dent; /* Directory entry */
|
||||
char filename[1024]; /* Full filename of types/converts file */
|
||||
|
||||
|
||||
/*
|
||||
* First open the directory specified by pathname... Return NULL if nothing
|
||||
* was read or if the pathname is NULL...
|
||||
*/
|
||||
|
||||
if (pathname == NULL)
|
||||
return (NULL);
|
||||
|
||||
if ((dir = opendir(pathname)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* If "mime" is NULL, make a new, blank database...
|
||||
*/
|
||||
|
||||
if (mime == NULL)
|
||||
if ((mime = mimeNew()) == NULL)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* Read all the .types files...
|
||||
*/
|
||||
|
||||
while ((dent = readdir(dir)) != NULL)
|
||||
{
|
||||
if (NAMLEN(dent) > 6 &&
|
||||
strcmp(dent->d_name + NAMLEN(dent) - 6, ".types") == 0)
|
||||
{
|
||||
/*
|
||||
* Load a mime.types file...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->d_name);
|
||||
load_types(mime, filename);
|
||||
}
|
||||
}
|
||||
|
||||
rewinddir(dir);
|
||||
|
||||
/*
|
||||
* Read all the .convs files...
|
||||
*/
|
||||
|
||||
while ((dent = readdir(dir)) != NULL)
|
||||
{
|
||||
if (NAMLEN(dent) > 6 &&
|
||||
strcmp(dent->d_name + NAMLEN(dent) - 6, ".convs") == 0)
|
||||
{
|
||||
/*
|
||||
* Load a mime.convs file...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->d_name);
|
||||
load_convs(mime, filename);
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
|
||||
return (mime);
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'mimeNew()' - Create a new, empty MIME database.
|
||||
*/
|
||||
|
||||
mime_t * /* O - MIME database */
|
||||
mimeNew(void)
|
||||
{
|
||||
return ((mime_t *)calloc(1, sizeof(mime_t)));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'load_types()' - Load a xyz.types file...
|
||||
*/
|
||||
|
||||
static void
|
||||
load_types(mime_t *mime, /* I - MIME database */
|
||||
char *filename) /* I - Types file to load */
|
||||
{
|
||||
FILE *fp; /* Types file */
|
||||
int linelen; /* Length of line */
|
||||
char line[65536], /* Input line from file */
|
||||
*lineptr, /* Current position in line */
|
||||
super[MIME_MAX_SUPER], /* Super-type name */
|
||||
type[MIME_MAX_TYPE], /* Type name */
|
||||
*temp; /* Temporary pointer */
|
||||
mime_type_t *typeptr; /* New MIME type */
|
||||
|
||||
|
||||
/*
|
||||
* First try to open the file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(filename, "r")) == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Then read each line from the file, skipping any comments in the file...
|
||||
*/
|
||||
|
||||
while (fgets(line, sizeof(line), fp) != NULL)
|
||||
{
|
||||
linelen = strlen(line);
|
||||
|
||||
/*
|
||||
* While the last character in the line is a backslash, continue on to the
|
||||
* next line (and the next, etc.)
|
||||
*/
|
||||
|
||||
if (line[linelen - 1] == '\n')
|
||||
{
|
||||
line[linelen - 1] = '\0';
|
||||
linelen --;
|
||||
}
|
||||
|
||||
while (line[linelen - 1] == '\\')
|
||||
{
|
||||
linelen --;
|
||||
|
||||
if (fgets(line + linelen, sizeof(line) - linelen, fp) == NULL)
|
||||
line[linelen] = '\0';
|
||||
else
|
||||
{
|
||||
linelen += strlen(line + linelen);
|
||||
if (line[linelen - 1] == '\n')
|
||||
{
|
||||
line[linelen - 1] = '\0';
|
||||
linelen --;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Skip blank lines and lines starting with a #...
|
||||
*/
|
||||
|
||||
if (line[0] == '\n' || line[0] == '#')
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Extract the super-type and type names from the beginning of the line.
|
||||
*/
|
||||
|
||||
lineptr = line;
|
||||
temp = super;
|
||||
|
||||
while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' &&
|
||||
(temp - super + 1) < MIME_MAX_SUPER)
|
||||
*temp++ = tolower(*lineptr++);
|
||||
|
||||
*temp = '\0';
|
||||
|
||||
if (*lineptr != '/')
|
||||
continue;
|
||||
|
||||
lineptr ++;
|
||||
temp = type;
|
||||
|
||||
while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' &&
|
||||
*lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE)
|
||||
*temp++ = tolower(*lineptr++);
|
||||
|
||||
*temp = '\0';
|
||||
|
||||
/*
|
||||
* Add the type and rules to the MIME database...
|
||||
*/
|
||||
|
||||
typeptr = mimeAddType(mime, super, type);
|
||||
mimeAddTypeRule(typeptr, lineptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'load_convs()' - Load a xyz.convs file...
|
||||
*/
|
||||
|
||||
static void
|
||||
load_convs(mime_t *mime, /* I - MIME database */
|
||||
char *filename) /* I - Convs file to load */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
FILE *fp; /* Convs file */
|
||||
char line[1024], /* Input line from file */
|
||||
*lineptr, /* Current position in line */
|
||||
super[MIME_MAX_SUPER], /* Super-type name */
|
||||
type[MIME_MAX_TYPE], /* Type name */
|
||||
*temp, /* Temporary pointer */
|
||||
*filter; /* Filter program */
|
||||
mime_type_t **temptype, /* MIME type looping var */
|
||||
*dsttype; /* Destination MIME type */
|
||||
int cost; /* Cost of filter */
|
||||
|
||||
|
||||
/*
|
||||
* First try to open the file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(filename, "r")) == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Then read each line from the file, skipping any comments in the file...
|
||||
*/
|
||||
|
||||
while (fgets(line, sizeof(line), fp) != NULL)
|
||||
{
|
||||
/*
|
||||
* Skip blank lines and lines starting with a #...
|
||||
*/
|
||||
|
||||
if (line[0] == '\n' || line[0] == '#')
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Extract the destination super-type and type names from the middle of
|
||||
* the line.
|
||||
*/
|
||||
|
||||
lineptr = line;
|
||||
while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\0')
|
||||
lineptr ++;
|
||||
|
||||
while (*lineptr == ' ' || *lineptr == '\t')
|
||||
lineptr ++;
|
||||
|
||||
temp = super;
|
||||
|
||||
while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' &&
|
||||
(temp - super + 1) < MIME_MAX_SUPER)
|
||||
*temp++ = tolower(*lineptr++);
|
||||
|
||||
*temp = '\0';
|
||||
|
||||
if (*lineptr != '/')
|
||||
continue;
|
||||
|
||||
lineptr ++;
|
||||
temp = type;
|
||||
|
||||
while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' &&
|
||||
*lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE)
|
||||
*temp++ = tolower(*lineptr++);
|
||||
|
||||
*temp = '\0';
|
||||
|
||||
if (*lineptr == '\0' || *lineptr == '\n')
|
||||
continue;
|
||||
|
||||
if ((dsttype = mimeType(mime, super, type)) == NULL)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Then get the cost and filter program...
|
||||
*/
|
||||
|
||||
while (*lineptr == ' ' || *lineptr == '\t')
|
||||
lineptr ++;
|
||||
|
||||
if (*lineptr < '0' || *lineptr > '9')
|
||||
continue;
|
||||
|
||||
cost = atoi(lineptr);
|
||||
|
||||
while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\0')
|
||||
lineptr ++;
|
||||
while (*lineptr == ' ' || *lineptr == '\t')
|
||||
lineptr ++;
|
||||
|
||||
if (*lineptr == '\0' || *lineptr == '\n')
|
||||
continue;
|
||||
|
||||
filter = lineptr;
|
||||
if (filter[strlen(filter) - 1] == '\n')
|
||||
filter[strlen(filter) - 1] = '\0';
|
||||
|
||||
/*
|
||||
* Finally, get the source super-type and type names from the beginning of
|
||||
* the line. We do it here so we can support wildcards...
|
||||
*/
|
||||
|
||||
lineptr = line;
|
||||
temp = super;
|
||||
|
||||
while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' &&
|
||||
(temp - super + 1) < MIME_MAX_SUPER)
|
||||
*temp++ = tolower(*lineptr++);
|
||||
|
||||
*temp = '\0';
|
||||
|
||||
if (*lineptr != '/')
|
||||
continue;
|
||||
|
||||
lineptr ++;
|
||||
temp = type;
|
||||
|
||||
while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' &&
|
||||
*lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE)
|
||||
*temp++ = tolower(*lineptr++);
|
||||
|
||||
*temp = '\0';
|
||||
|
||||
/*
|
||||
* Add the filter to the MIME database, supporting wildcards as needed...
|
||||
*/
|
||||
|
||||
for (temptype = mime->types, i = 0; i < mime->num_types; i ++, temptype ++)
|
||||
if ((super[0] == '*' || strcmp((*temptype)->super, super) == 0) &&
|
||||
(type[0] == '*' || strcmp((*temptype)->type, type) == 0))
|
||||
mimeAddFilter(mime, *temptype, dsttype, cost, filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'delete_rules()' - Free all memory for the given rule tree.
|
||||
*/
|
||||
|
||||
static void
|
||||
delete_rules(mime_magic_t *rules) /* I - Rules to free */
|
||||
{
|
||||
mime_magic_t *next; /* Next rule to free */
|
||||
|
||||
|
||||
/*
|
||||
* Free the rules list, descending recursively to free any child rules.
|
||||
*/
|
||||
|
||||
while (rules != NULL)
|
||||
{
|
||||
next = rules->next;
|
||||
|
||||
if (rules->child != NULL)
|
||||
delete_rules(rules->child);
|
||||
|
||||
free(rules);
|
||||
rules = next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-137
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* MIME type/conversion database definitions 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.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
|
||||
*/
|
||||
|
||||
#ifndef _MIME_H_
|
||||
# define _MIME_H_
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef _cplusplus
|
||||
extern "C" {
|
||||
# endif /* _cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define MIME_MAX_SUPER 16 /* Maximum size of supertype name */
|
||||
# define MIME_MAX_TYPE 32 /* Maximum size of type name */
|
||||
# define MIME_MAX_FILTER 256 /* Maximum size of filter pathname */
|
||||
# define MIME_MAX_BUFFER 8192 /* Maximum size of file buffer */
|
||||
|
||||
|
||||
/*
|
||||
* Types/structures...
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MIME_MAGIC_NOP, /* No operation */
|
||||
MIME_MAGIC_AND, /* Logical AND of all children */
|
||||
MIME_MAGIC_OR, /* Logical OR of all children */
|
||||
MIME_MAGIC_MATCH, /* Filename match */
|
||||
MIME_MAGIC_ASCII, /* ASCII characters in range */
|
||||
MIME_MAGIC_PRINTABLE, /* Printable characters (32-255) in range */
|
||||
MIME_MAGIC_STRING, /* String matches */
|
||||
MIME_MAGIC_CHAR, /* Character/byte matches */
|
||||
MIME_MAGIC_SHORT, /* Short/16-bit word matches */
|
||||
MIME_MAGIC_INT, /* Integer/32-bit word matches */
|
||||
MIME_MAGIC_LOCALE /* Current locale matches string */
|
||||
} mime_op_t;
|
||||
|
||||
typedef struct mime_magic_str /**** MIME Magic Data ****/
|
||||
{
|
||||
struct mime_magic_str *prev, /* Previous rule */
|
||||
*next, /* Next rule */
|
||||
*parent, /* Parent rules */
|
||||
*child; /* Child rules */
|
||||
short op, /* Operation code (see above) */
|
||||
invert; /* Invert the result */
|
||||
int offset, /* Offset in file */
|
||||
length; /* Length of data */
|
||||
union
|
||||
{
|
||||
char matchv[64]; /* Match value */
|
||||
char localev[64]; /* Locale value */
|
||||
char stringv[64]; /* String value */
|
||||
char charv; /* Byte value */
|
||||
short shortv; /* Short value */
|
||||
int intv; /* Integer value */
|
||||
} value;
|
||||
} mime_magic_t;
|
||||
|
||||
typedef struct /**** MIME Type Data ****/
|
||||
{
|
||||
char super[MIME_MAX_SUPER], /* Super-type name ("image", "application", etc.) */
|
||||
type[MIME_MAX_TYPE]; /* Type name ("png", "postscript", etc.) */
|
||||
mime_magic_t *rules; /* Rules used to detect this type */
|
||||
} mime_type_t;
|
||||
|
||||
typedef struct /**** MIME Conversion Filter Data ****/
|
||||
{
|
||||
mime_type_t *src, /* Source type */
|
||||
*dst; /* Destination type */
|
||||
int cost; /* Relative cost */
|
||||
char filter[MIME_MAX_FILTER];/* Filter program to use */
|
||||
} mime_filter_t;
|
||||
|
||||
typedef struct /**** MIME Database ****/
|
||||
{
|
||||
int num_types; /* Number of file types */
|
||||
mime_type_t **types; /* File types */
|
||||
int num_filters; /* Number of type conversion filters */
|
||||
mime_filter_t *filters; /* Type conversion filters */
|
||||
} mime_t;
|
||||
|
||||
|
||||
/*
|
||||
* Functions...
|
||||
*/
|
||||
|
||||
extern void mimeDelete(mime_t *mime);
|
||||
#define mimeLoad(pathname) mimeMerge((mime_t *)0, (pathname));
|
||||
extern mime_t *mimeMerge(mime_t *mime, const char *pathname);
|
||||
extern mime_t *mimeNew(void);
|
||||
|
||||
extern mime_type_t *mimeAddType(mime_t *mime, const char *super, const char *type);
|
||||
extern int mimeAddTypeRule(mime_type_t *mt, const char *rule);
|
||||
extern mime_type_t *mimeFileType(mime_t *mime, const char *pathname);
|
||||
extern mime_type_t *mimeType(mime_t *mime, const char *super, const char *type);
|
||||
|
||||
extern mime_filter_t *mimeAddFilter(mime_t *mime, mime_type_t *src, mime_type_t *dst,
|
||||
int cost, const char *filter);
|
||||
extern mime_filter_t *mimeFilter(mime_t *mime, mime_type_t *src, mime_type_t *dst,
|
||||
int *num_filters);
|
||||
|
||||
# ifdef _cplusplus
|
||||
}
|
||||
# endif /* _cplusplus */
|
||||
#endif /* !_MIME_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,378 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Option routines 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:
|
||||
*
|
||||
* cupsAddOption() - Add an option to an option array.
|
||||
* cupsFreeOptions() - Free all memory used by options.
|
||||
* cupsGetOption() - Get an option value.
|
||||
* cupsParseOptions() - Parse options from a command-line argument.
|
||||
* cupsMarkOptions() - Mark command-line options in a PPD file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include "string.h"
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsAddOption()' - Add an option to an option array.
|
||||
*/
|
||||
|
||||
int /* O - Number of options */
|
||||
cupsAddOption(const char *name, /* I - Name of option */
|
||||
const char *value, /* I - Value of option */
|
||||
int num_options, /* I - Number of options */
|
||||
cups_option_t **options) /* IO - Pointer to options */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
cups_option_t *temp; /* Pointer to new option */
|
||||
|
||||
|
||||
if (name == NULL || value == NULL || options == NULL)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Look for an existing option with the same name...
|
||||
*/
|
||||
|
||||
for (i = 0, temp = *options; i < num_options; i ++, temp ++)
|
||||
if (strcasecmp(temp->name, name) == 0)
|
||||
break;
|
||||
|
||||
if (i >= num_options)
|
||||
{
|
||||
/*
|
||||
* No matching option name...
|
||||
*/
|
||||
|
||||
if (num_options == 0)
|
||||
temp = (cups_option_t *)malloc(sizeof(cups_option_t));
|
||||
else
|
||||
temp = (cups_option_t *)realloc(*options, sizeof(cups_option_t) *
|
||||
(num_options + 1));
|
||||
|
||||
if (temp == NULL)
|
||||
return (0);
|
||||
|
||||
*options = temp;
|
||||
temp += num_options;
|
||||
temp->name = strdup(name);
|
||||
num_options ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Match found; free the old value...
|
||||
*/
|
||||
|
||||
free(temp->value);
|
||||
}
|
||||
|
||||
temp->value = strdup(value);
|
||||
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsFreeOptions()' - Free all memory used by options.
|
||||
*/
|
||||
|
||||
void
|
||||
cupsFreeOptions(int num_options, /* I - Number of options */
|
||||
cups_option_t *options) /* I - Pointer to options */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
|
||||
|
||||
if (num_options == 0 || options == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < num_options; i ++)
|
||||
{
|
||||
free(options[i].name);
|
||||
free(options[i].value);
|
||||
}
|
||||
|
||||
free(options);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetOption()' - Get an option value.
|
||||
*/
|
||||
|
||||
const char * /* O - Option value or NULL */
|
||||
cupsGetOption(const char *name, /* I - Name of option */
|
||||
int num_options,/* I - Number of options */
|
||||
cups_option_t *options) /* I - Options */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
|
||||
|
||||
if (name == NULL || num_options == 0 || options == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (i = 0; i < num_options; i ++)
|
||||
if (strcasecmp(options[i].name, name) == 0)
|
||||
return (options[i].value);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsParseOptions()' - Parse options from a command-line argument.
|
||||
*/
|
||||
|
||||
int /* O - Number of options found */
|
||||
cupsParseOptions(const char *arg, /* I - Argument to parse */
|
||||
int num_options, /* I - Number of options */
|
||||
cups_option_t **options) /* O - Options found */
|
||||
{
|
||||
char *copyarg, /* Copy of input string */
|
||||
*ptr, /* Pointer into string */
|
||||
*name, /* Pointer to name */
|
||||
*value; /* Pointer to value */
|
||||
|
||||
|
||||
if (arg == NULL || options == NULL)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Make a copy of the argument string and then divide it up...
|
||||
*/
|
||||
|
||||
copyarg = strdup(arg);
|
||||
ptr = copyarg;
|
||||
|
||||
while (*ptr != '\0')
|
||||
{
|
||||
/*
|
||||
* Get the name up to a SPACE, =, or end-of-string...
|
||||
*/
|
||||
|
||||
name = ptr;
|
||||
while (!isspace(*ptr) && *ptr != '=' && *ptr != '\0')
|
||||
ptr ++;
|
||||
|
||||
/*
|
||||
* Skip trailing spaces...
|
||||
*/
|
||||
|
||||
while (isspace(*ptr))
|
||||
*ptr++ = '\0';
|
||||
|
||||
if (*ptr != '=')
|
||||
{
|
||||
/*
|
||||
* Start of another option...
|
||||
*/
|
||||
|
||||
num_options = cupsAddOption(name, "", num_options, options);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove = and parse the value...
|
||||
*/
|
||||
|
||||
*ptr++ = '\0';
|
||||
|
||||
if (*ptr == '\'')
|
||||
{
|
||||
/*
|
||||
* Quoted string constant...
|
||||
*/
|
||||
|
||||
ptr ++;
|
||||
value = ptr;
|
||||
|
||||
while (*ptr != '\'' && *ptr != '\0')
|
||||
ptr ++;
|
||||
|
||||
if (*ptr != '\0')
|
||||
*ptr++ = '\0';
|
||||
}
|
||||
else if (*ptr == '\"')
|
||||
{
|
||||
/*
|
||||
* Double-quoted string constant...
|
||||
*/
|
||||
|
||||
ptr ++;
|
||||
value = ptr;
|
||||
|
||||
while (*ptr != '\"' && *ptr != '\0')
|
||||
ptr ++;
|
||||
|
||||
if (*ptr != '\0')
|
||||
*ptr++ = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Normal space-delimited string...
|
||||
*/
|
||||
|
||||
value = ptr;
|
||||
|
||||
while (!isspace(*ptr) && *ptr != '\0')
|
||||
ptr ++;
|
||||
|
||||
while (isspace(*ptr))
|
||||
*ptr++ = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the string value...
|
||||
*/
|
||||
|
||||
num_options = cupsAddOption(name, value, num_options, options);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free the copy of the argument we made and return the number of options
|
||||
* found.
|
||||
*/
|
||||
|
||||
free(copyarg);
|
||||
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsMarkOptions()' - Mark command-line options in a PPD file.
|
||||
*/
|
||||
|
||||
int /* O - 1 if conflicting */
|
||||
cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
|
||||
int num_options, /* I - Number of options */
|
||||
cups_option_t *options) /* I - Options */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int conflict; /* Option conflicts */
|
||||
char *val, /* Pointer into value */
|
||||
*ptr, /* Pointer into string */
|
||||
s[255]; /* Temporary string */
|
||||
|
||||
|
||||
conflict = 0;
|
||||
|
||||
for (i = num_options; i > 0; i --, options ++)
|
||||
if (strcasecmp(options->name, "media") == 0)
|
||||
{
|
||||
/*
|
||||
* Loop through the option string, separating it at commas and
|
||||
* marking each individual option.
|
||||
*/
|
||||
|
||||
for (val = options->value; *val;)
|
||||
{
|
||||
/*
|
||||
* Extract the sub-option from the string...
|
||||
*/
|
||||
|
||||
for (ptr = s; *val && *val != ',' && (ptr - s) < (sizeof(s) - 1);)
|
||||
*ptr++ = *val++;
|
||||
*ptr++ = '\0';
|
||||
|
||||
if (*val == ',')
|
||||
val ++;
|
||||
|
||||
/*
|
||||
* Mark it...
|
||||
*/
|
||||
|
||||
if (ppdMarkOption(ppd, "PageSize", s))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "InputSlot", s))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "MediaType", s))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "EFMediaQualityMode", s)) /* EFI */
|
||||
conflict = 1;
|
||||
if (strcasecmp(s, "manual") == 0)
|
||||
if (ppdMarkOption(ppd, "ManualFeed", "True"))
|
||||
conflict = 1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(options->name, "sides") == 0)
|
||||
{
|
||||
if (strcasecmp(options->value, "one-sided") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "Duplex", "None"))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "EFDuplex", "None")) /* EFI */
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "KD03Duplex", "None")) /* Kodak */
|
||||
conflict = 1;
|
||||
}
|
||||
else if (strcasecmp(options->value, "two-sided-long-edge") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "Duplex", "DuplexNoTumble"))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "EFDuplex", "DuplexNoTumble")) /* EFI */
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "KD03Duplex", "DuplexNoTumble")) /* Kodak */
|
||||
conflict = 1;
|
||||
}
|
||||
else if (strcasecmp(options->value, "two-sided-short-edge") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "Duplex", "DuplexTumble"))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "EFDuplex", "DuplexTumble")) /* EFI */
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "KD03Duplex", "DuplexTumble")) /* Kodak */
|
||||
conflict = 1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(options->name, "resolution") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "Resolution", options->value))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "SetResolution", options->value))
|
||||
/* Calcomp, Linotype, QMS, Summagraphics, Tektronix, Varityper */
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "JCLResolution", options->value)) /* HP */
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "CNRes_PGP", options->value)) /* Canon */
|
||||
conflict = 1;
|
||||
}
|
||||
else if (ppdMarkOption(ppd, options->name, options->value))
|
||||
conflict = 1;
|
||||
|
||||
return (conflict);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-189
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Page size functions 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.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
|
||||
*
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* ppdPageSize() - Get the page size record for the given size.
|
||||
* ppdPageWidth() - Get the page width for the given size.
|
||||
* ppdPageLength() - Get the page length for the given size.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "ppd.h"
|
||||
#include "string.h"
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdPageSize()' - Get the page size record for the given size.
|
||||
*/
|
||||
|
||||
ppd_size_t * /* O - Size record for page or NULL */
|
||||
ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
|
||||
const char *name) /* I - Size name */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
float w, l; /* Width and length of page */
|
||||
char units[255]; /* Page size units... */
|
||||
|
||||
|
||||
if (ppd == NULL)
|
||||
return (NULL);
|
||||
|
||||
if (name != NULL)
|
||||
{
|
||||
if (strncmp(name, "Custom.", 7) == 0 && ppd->variable_sizes)
|
||||
{
|
||||
/*
|
||||
* Find the custom page size...
|
||||
*/
|
||||
|
||||
for (i = 0; i < ppd->num_sizes; i ++)
|
||||
if (strcmp("Custom", ppd->sizes[i].name) == 0)
|
||||
break;
|
||||
|
||||
if (i == ppd->num_sizes)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* Variable size; size name can be one of the following:
|
||||
*
|
||||
* Custom.WIDTHxLENGTHin - Size in inches
|
||||
* Custom.WIDTHxLENGTHcm - Size in centimeters
|
||||
* Custom.WIDTHxLENGTHmm - Size in millimeters
|
||||
* Custom.WIDTHxLENGTH[pt] - Size in points
|
||||
*/
|
||||
|
||||
units[0] = '\0';
|
||||
if (sscanf(name + 7, "%fx%f%254s", &w, &l, units) < 2)
|
||||
return (NULL);
|
||||
|
||||
if (strcasecmp(units, "in") == 0)
|
||||
{
|
||||
ppd->sizes[i].width = w * 72.0;
|
||||
ppd->sizes[i].length = l * 72.0;
|
||||
ppd->sizes[i].left = ppd->custom_margins[0];
|
||||
ppd->sizes[i].bottom = ppd->custom_margins[1];
|
||||
ppd->sizes[i].right = w * 72.0 - ppd->custom_margins[2];
|
||||
ppd->sizes[i].top = l * 72.0 - ppd->custom_margins[3];
|
||||
}
|
||||
else if (strcasecmp(units, "cm") == 0)
|
||||
{
|
||||
ppd->sizes[i].width = w * 2.54 * 72.0;
|
||||
ppd->sizes[i].length = l * 2.54 * 72.0;
|
||||
ppd->sizes[i].left = ppd->custom_margins[0];
|
||||
ppd->sizes[i].bottom = ppd->custom_margins[1];
|
||||
ppd->sizes[i].right = w * 2.54 * 72.0 - ppd->custom_margins[2];
|
||||
ppd->sizes[i].top = l * 2.54 * 72.0 - ppd->custom_margins[3];
|
||||
}
|
||||
else if (strcasecmp(units, "mm") == 0)
|
||||
{
|
||||
ppd->sizes[i].width = w * 25.4 * 72.0;
|
||||
ppd->sizes[i].length = l * 25.4 * 72.0;
|
||||
ppd->sizes[i].left = ppd->custom_margins[0];
|
||||
ppd->sizes[i].bottom = ppd->custom_margins[1];
|
||||
ppd->sizes[i].right = w * 25.4 * 72.0 - ppd->custom_margins[2];
|
||||
ppd->sizes[i].top = l * 25.4 * 72.0 - ppd->custom_margins[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
ppd->sizes[i].width = w;
|
||||
ppd->sizes[i].length = l;
|
||||
ppd->sizes[i].left = ppd->custom_margins[0];
|
||||
ppd->sizes[i].bottom = ppd->custom_margins[1];
|
||||
ppd->sizes[i].right = w - ppd->custom_margins[2];
|
||||
ppd->sizes[i].top = l - ppd->custom_margins[3];
|
||||
}
|
||||
|
||||
return (ppd->sizes + i);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Lookup by name...
|
||||
*/
|
||||
|
||||
for (i = 0; i < ppd->num_sizes; i ++)
|
||||
if (strcmp(name, ppd->sizes[i].name) == 0)
|
||||
return (ppd->sizes + i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Find default...
|
||||
*/
|
||||
|
||||
for (i = 0; i < ppd->num_sizes; i ++)
|
||||
if (ppd->sizes[i].marked)
|
||||
return (ppd->sizes + i);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdPageWidth()' - Get the page width for the given size.
|
||||
*/
|
||||
|
||||
float /* O - Width of page in points or 0.0 */
|
||||
ppdPageWidth(ppd_file_t *ppd, /* I - PPD file record */
|
||||
const char *name) /* I - Size name */
|
||||
{
|
||||
ppd_size_t *size; /* Page size */
|
||||
|
||||
|
||||
if ((size = ppdPageSize(ppd, name)) == NULL)
|
||||
return (0.0);
|
||||
else
|
||||
return (size->width);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdPageLength()' - Get the page length for the given size.
|
||||
*/
|
||||
|
||||
float /* O - Length of page in points or 0.0 */
|
||||
ppdPageLength(ppd_file_t *ppd, /* I - PPD file */
|
||||
const char *name) /* I - Size name */
|
||||
{
|
||||
ppd_size_t *size; /* Page size */
|
||||
|
||||
|
||||
if ((size = ppdPageSize(ppd, name)) == NULL)
|
||||
return (0.0);
|
||||
else
|
||||
return (size->length);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-1814
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
-239
@@ -1,239 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* PostScript Printer Description definitions 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.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
|
||||
*
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
*
|
||||
* This code and any derivative of it may be used and distributed
|
||||
* freely under the terms of the GNU General Public License when
|
||||
* used with GNU Ghostscript or its derivatives. Use of the code
|
||||
* (or any derivative of it) with software other than GNU
|
||||
* GhostScript (or its derivatives) is governed by the CUPS license
|
||||
* agreement.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_PPD_H_
|
||||
# define _CUPS_PPD_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* PPD version...
|
||||
*/
|
||||
|
||||
# define PPD_VERSION 4.3 /* Kept in sync with Adobe version number */
|
||||
|
||||
|
||||
/*
|
||||
* Types and structures...
|
||||
*/
|
||||
|
||||
typedef enum /**** UI types ****/
|
||||
{
|
||||
PPD_UI_BOOLEAN, /* True or False option */
|
||||
PPD_UI_PICKONE, /* Pick one from a list */
|
||||
PPD_UI_PICKMANY /* Pick zero or more from a list */
|
||||
} ppd_ui_t;
|
||||
|
||||
typedef enum /**** Order dependency sections ****/
|
||||
{
|
||||
PPD_ORDER_ANY, /* Option code can be anywhere in the file */
|
||||
PPD_ORDER_DOCUMENT, /* ... must be in the DocumentSetup section */
|
||||
PPD_ORDER_EXIT, /* ... must be sent prior to the document */
|
||||
PPD_ORDER_JCL, /* ... must be sent as a JCL command */
|
||||
PPD_ORDER_PAGE, /* ... must be in the PageSetup section */
|
||||
PPD_ORDER_PROLOG /* ... must be in the Prolog section */
|
||||
} ppd_section_t;
|
||||
|
||||
typedef enum /**** Colorspaces ****/
|
||||
{
|
||||
PPD_CS_CMYK = -4, /* CMYK colorspace */
|
||||
PPD_CS_CMY, /* CMY colorspace */
|
||||
PPD_CS_GRAY = 1, /* Grayscale colorspace */
|
||||
PPD_CS_RGB = 3, /* RGB colorspace */
|
||||
PPD_CS_RGBK, /* RGBK (K = gray) colorspace */
|
||||
PPD_CS_N /* DeviceN colorspace */
|
||||
} ppd_cs_t;
|
||||
|
||||
typedef struct /**** Option choices ****/
|
||||
{
|
||||
char marked, /* 0 if not selected, 1 otherwise */
|
||||
choice[41], /* Computer-readable option name */
|
||||
text[81], /* Human-readable option name */
|
||||
*code; /* Code to send for this option */
|
||||
void *option; /* Pointer to parent option structure */
|
||||
} ppd_choice_t;
|
||||
|
||||
typedef struct /**** Options ****/
|
||||
{
|
||||
char conflicted, /* 0 if no conflicts exist, 1 otherwise */
|
||||
keyword[41], /* Option keyword name ("PageSize", etc.) */
|
||||
defchoice[41], /* Default option choice */
|
||||
text[81]; /* Human-readable text */
|
||||
ppd_ui_t ui; /* Type of UI option */
|
||||
ppd_section_t section; /* Section for command */
|
||||
float order; /* Order number */
|
||||
int num_choices; /* Number of option choices */
|
||||
ppd_choice_t *choices; /* Option choices */
|
||||
} ppd_option_t;
|
||||
|
||||
typedef struct ppd_group_str /**** Groups ****/
|
||||
{
|
||||
char text[81]; /* Human-readable group name */
|
||||
int num_options; /* Number of options */
|
||||
ppd_option_t *options; /* Options */
|
||||
int num_subgroups; /* Number of sub-groups */
|
||||
struct ppd_group_str *subgroups;
|
||||
/* Sub-groups (max depth = 1) */
|
||||
} ppd_group_t;
|
||||
|
||||
typedef struct /**** Constraints ****/
|
||||
{
|
||||
char option1[41], /* First keyword */
|
||||
choice1[41], /* First option/choice (blank for all) */
|
||||
option2[41], /* Second keyword */
|
||||
choice2[41]; /* Second option/choice (blank for all) */
|
||||
} ppd_const_t;
|
||||
|
||||
typedef struct /**** Page Sizes ****/
|
||||
{
|
||||
int marked; /* Page size selected? */
|
||||
char name[41]; /* Media size option */
|
||||
float width, /* Width of media in points */
|
||||
length, /* Length of media in points */
|
||||
left, /* Left printable margin in points */
|
||||
bottom, /* Bottom printable margin in points */
|
||||
right, /* Right printable margin in points */
|
||||
top; /* Top printable margin in points */
|
||||
} ppd_size_t;
|
||||
|
||||
typedef struct /**** Emulators ****/
|
||||
{
|
||||
char name[41], /* Emulator name */
|
||||
*start, /* Code to switch to this emulation */
|
||||
*stop; /* Code to stop this emulation */
|
||||
} ppd_emul_t;
|
||||
|
||||
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;
|
||||
|
||||
typedef struct /**** Files ****/
|
||||
{
|
||||
int language_level, /* Language level of device */
|
||||
color_device, /* 1 = color device, 0 = grayscale */
|
||||
variable_sizes, /* 1 = supports variable sizes, 0 = doesn't */
|
||||
accurate_screens,/* 1 = supports accurate screens, 0 = not */
|
||||
contone_only, /* 1 = continuous tone only, 0 = not */
|
||||
landscape, /* -90 or 90 */
|
||||
model_number, /* Device-specific model number */
|
||||
manual_copies; /* 1 = Copies done manually, 0 = hardware */
|
||||
ppd_cs_t colorspace; /* Default colorspace */
|
||||
char *patches; /* Patch commands to be sent to printer */
|
||||
int num_emulations; /* Number of emulations supported */
|
||||
ppd_emul_t *emulations; /* Emulations and the code to invoke them */
|
||||
char *jcl_begin, /* Start JCL commands */
|
||||
*jcl_ps, /* Enter PostScript interpreter */
|
||||
*jcl_end, /* End JCL commands */
|
||||
*lang_encoding, /* Language encoding */
|
||||
*lang_version, /* Language version (English, Spanish, etc.) */
|
||||
*modelname, /* Model name (general) */
|
||||
*ttrasterizer, /* Truetype rasterizer */
|
||||
*manufacturer, /* Manufacturer name */
|
||||
*product, /* Product name (from PS RIP/interpreter) */
|
||||
*nickname, /* Nickname (specific) */
|
||||
*shortnickname; /* Short version of nickname */
|
||||
int num_groups; /* Number of UI groups */
|
||||
ppd_group_t *groups; /* UI groups */
|
||||
int num_sizes; /* Number of page sizes */
|
||||
ppd_size_t *sizes; /* Page sizes */
|
||||
float custom_min[2], /* Minimum variable page size */
|
||||
custom_max[2], /* Maximum variable page size */
|
||||
custom_margins[4];/* Margins around page */
|
||||
int num_consts; /* Number of UI/Non-UI constraints */
|
||||
ppd_const_t *consts; /* UI/Non-UI constraints */
|
||||
int num_fonts; /* Number of pre-loaded fonts */
|
||||
char **fonts; /* Pre-loaded fonts */
|
||||
int num_profiles; /* Number of sRGB color profiles */
|
||||
ppd_profile_t *profiles; /* sRGB color profiles */
|
||||
int num_filters; /* Number of filters */
|
||||
char **filters; /* Filter strings... */
|
||||
} ppd_file_t;
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern void ppdClose(ppd_file_t *ppd);
|
||||
extern int ppdConflicts(ppd_file_t *ppd);
|
||||
extern int ppdEmit(ppd_file_t *ppd, FILE *fp,
|
||||
ppd_section_t section);
|
||||
extern int ppdEmitFd(ppd_file_t *ppd, int fd,
|
||||
ppd_section_t section);
|
||||
extern int ppdIsMarked(ppd_file_t *ppd, const char *keyword,
|
||||
const char *option);
|
||||
extern void ppdMarkDefaults(ppd_file_t *ppd);
|
||||
extern int ppdMarkOption(ppd_file_t *ppd, const char *keyword,
|
||||
const char *option);
|
||||
extern ppd_choice_t *ppdFindChoice(ppd_option_t *o, const char *option);
|
||||
extern ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd, const char *keyword);
|
||||
extern ppd_option_t *ppdFindOption(ppd_file_t *ppd, const char *keyword);
|
||||
extern ppd_file_t *ppdOpen(FILE *fp);
|
||||
extern ppd_file_t *ppdOpenFd(int fd);
|
||||
extern ppd_file_t *ppdOpenFile(const char *filename);
|
||||
extern float ppdPageLength(ppd_file_t *ppd, const char *name);
|
||||
extern ppd_size_t *ppdPageSize(ppd_file_t *ppd, const char *name);
|
||||
extern float ppdPageWidth(ppd_file_t *ppd, const char *name);
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
#endif /* !_CUPS_PPD_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-252
@@ -1,252 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Raster file routines 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 for the CUPS Raster source
|
||||
* files are outlined in the GNU Library General Public License, located
|
||||
* in the "pstoraster" directory. 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
|
||||
*
|
||||
* This code and any derivative of it may be used and distributed
|
||||
* freely under the terms of the GNU General Public License when
|
||||
* used with GNU Ghostscript or its derivatives. Use of the code
|
||||
* (or any derivative of it) with software other than GNU
|
||||
* GhostScript (or its derivatives) is governed by the CUPS license
|
||||
* agreement.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsRasterClose() - Close a raster stream.
|
||||
* cupsRasterOpen() - Open a raster stream.
|
||||
* cupsRasterReadHeader() - Read a raster page header.
|
||||
* cupsRasterReadPixels() - Read raster pixels.
|
||||
* cupsRasterWriteHeader() - Write a raster page header.
|
||||
* cupsRasterWritePixels() - Write raster pixels.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "raster.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsRasterClose()' - Close a raster stream.
|
||||
*/
|
||||
|
||||
void
|
||||
cupsRasterClose(cups_raster_t *r) /* I - Stream to close */
|
||||
{
|
||||
if (r != NULL)
|
||||
free(r);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsRasterOpen()' - Open a raster stream.
|
||||
*/
|
||||
|
||||
cups_raster_t * /* O - New stream */
|
||||
cupsRasterOpen(int fd, /* I - File descriptor */
|
||||
cups_mode_t mode) /* I - Mode */
|
||||
{
|
||||
cups_raster_t *r; /* New stream */
|
||||
|
||||
|
||||
if ((r = calloc(sizeof(cups_raster_t), 1)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
r->fd = fd;
|
||||
r->mode = mode;
|
||||
|
||||
if (mode == CUPS_RASTER_READ)
|
||||
{
|
||||
/*
|
||||
* Open for read - get sync word...
|
||||
*/
|
||||
|
||||
if (read(fd, &(r->sync), sizeof(r->sync)) < sizeof(r->sync))
|
||||
{
|
||||
free(r);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (r->sync != CUPS_RASTER_SYNC &&
|
||||
r->sync != CUPS_RASTER_REVSYNC)
|
||||
{
|
||||
free(r);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Open for write - put sync word...
|
||||
*/
|
||||
|
||||
r->sync = CUPS_RASTER_SYNC;
|
||||
if (write(fd, &(r->sync), sizeof(r->sync)) < sizeof(r->sync))
|
||||
{
|
||||
free(r);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsRasterReadHeader()' - Read a raster page header.
|
||||
*/
|
||||
|
||||
unsigned /* O - 1 on success, 0 on fail */
|
||||
cupsRasterReadHeader(cups_raster_t *r, /* I - Raster stream */
|
||||
cups_page_header_t *h) /* I - Pointer to header data */
|
||||
{
|
||||
int len; /* Number of words to swap */
|
||||
union swap_s /* Swapping structure */
|
||||
{
|
||||
unsigned char b[4];
|
||||
unsigned v;
|
||||
} *s;
|
||||
|
||||
|
||||
if (r == NULL || r->mode != CUPS_RASTER_READ)
|
||||
return (0);
|
||||
|
||||
if (cupsRasterReadPixels(r, (unsigned char *)h, sizeof(cups_page_header_t)) <
|
||||
sizeof(cups_page_header_t))
|
||||
return (0);
|
||||
|
||||
if (r->sync == CUPS_RASTER_REVSYNC)
|
||||
for (len = (sizeof(cups_page_header_t) - 256) / 4,
|
||||
s = (union swap_s *)&(h->AdvanceDistance);
|
||||
len > 0;
|
||||
len --, s ++)
|
||||
s->v = (((((s->b[3] << 8) | s->b[2]) << 8) | s->b[1]) << 8) | s->b[0];
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsRasterReadPixels()' - Read raster pixels.
|
||||
*/
|
||||
|
||||
unsigned /* O - Number of bytes read */
|
||||
cupsRasterReadPixels(cups_raster_t *r, /* I - Raster stream */
|
||||
unsigned char *p, /* I - Pointer to pixel buffer */
|
||||
unsigned len) /* I - Number of bytes to read */
|
||||
{
|
||||
int bytes; /* Bytes read */
|
||||
unsigned remaining; /* Bytes remaining */
|
||||
|
||||
|
||||
if (r == NULL || r->mode != CUPS_RASTER_READ)
|
||||
return (0);
|
||||
|
||||
remaining = len;
|
||||
|
||||
while (remaining > 0)
|
||||
{
|
||||
bytes = read(r->fd, p, remaining);
|
||||
|
||||
if (bytes <= 0)
|
||||
{
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
return (0);
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
remaining -= bytes;
|
||||
p += bytes;
|
||||
}
|
||||
|
||||
return (len);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsRasterWriteHeader()' - Write a raster page header.
|
||||
*/
|
||||
|
||||
unsigned
|
||||
cupsRasterWriteHeader(cups_raster_t *r,
|
||||
cups_page_header_t *h)
|
||||
{
|
||||
if (r == NULL || r->mode != CUPS_RASTER_WRITE)
|
||||
return (0);
|
||||
|
||||
return (cupsRasterWritePixels(r, (unsigned char *)h,
|
||||
sizeof(cups_page_header_t)) ==
|
||||
sizeof(cups_page_header_t));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsRasterWritePixels()' - Write raster pixels.
|
||||
*/
|
||||
|
||||
unsigned /* O - Number of bytes written */
|
||||
cupsRasterWritePixels(cups_raster_t *r, /* I - Raster stream */
|
||||
unsigned char *p, /* I - Bytes to write */
|
||||
unsigned len)/* I - Number of bytes to write */
|
||||
{
|
||||
int bytes; /* Bytes read */
|
||||
unsigned remaining; /* Bytes remaining */
|
||||
|
||||
|
||||
if (r == NULL || r->mode != CUPS_RASTER_WRITE)
|
||||
return (0);
|
||||
|
||||
remaining = len;
|
||||
|
||||
while (remaining > 0)
|
||||
{
|
||||
bytes = write(r->fd, p, remaining);
|
||||
|
||||
if (bytes <= 0)
|
||||
{
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
return (0);
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
remaining -= bytes;
|
||||
p += bytes;
|
||||
}
|
||||
|
||||
return (len);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-233
@@ -1,233 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Raster file definitions 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 for the CUPS Raster source
|
||||
* files are outlined in the GNU Library General Public License, located
|
||||
* in the "pstoraster" directory. 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
|
||||
*
|
||||
* This code and any derivative of it may be used and distributed
|
||||
* freely under the terms of the GNU General Public License when
|
||||
* used with GNU Ghostscript or its derivatives. Use of the code
|
||||
* (or any derivative of it) with software other than GNU
|
||||
* GhostScript (or its derivatives) is governed by the CUPS license
|
||||
* agreement.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_RASTER_H_
|
||||
# define _CUPS_RASTER_H_
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Every non-PostScript printer driver that supports raster images should
|
||||
* use the application/vnd.cups-raster image file format. Since both the
|
||||
* PostScript RIP (pstoraster, based on GNU Ghostscript 4.03) and Image RIP
|
||||
* (imagetoraster, located in the filter directory) use it, using this format
|
||||
* saves you a lot of work. Also, the PostScript RIP passes any printer
|
||||
* options that are in a PS file to your driver this way as well...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_RASTER_SYNC 0x52615374 /* RaSt */
|
||||
# define CUPS_RASTER_REVSYNC 0x74536152 /* tSaR */
|
||||
|
||||
|
||||
/*
|
||||
* Types...
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_RASTER_READ, /* Open stream for reading */
|
||||
CUPS_RASTER_WRITE /* Open stream for writing */
|
||||
} cups_mode_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_FALSE, /* Logical false */
|
||||
CUPS_TRUE /* Logical true */
|
||||
} cups_bool_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_JOG_NONE, /* Never move pages */
|
||||
CUPS_JOG_FILE, /* Move pages after this file */
|
||||
CUPS_JOG_JOB, /* Move pages after this job */
|
||||
CUPS_JOG_SET /* Move pages after this set */
|
||||
} cups_jog_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_ORIENT_0, /* Don't rotate the page */
|
||||
CUPS_ORIENT_90, /* Rotate the page counter-clockwise */
|
||||
CUPS_ORIENT_180, /* Turn the page upside down */
|
||||
CUPS_ORIENT_270 /* Rotate the page clockwise */
|
||||
} cups_orient_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_CUT_NONE, /* Never cut the roll */
|
||||
CUPS_CUT_FILE, /* Cut the roll after this file */
|
||||
CUPS_CUT_JOB, /* Cut the roll after this job */
|
||||
CUPS_CUT_SET, /* Cut the roll after this set */
|
||||
CUPS_CUT_PAGE /* Cut the roll after this page */
|
||||
} cups_cut_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_ADVANCE_NONE, /* Never advance the roll */
|
||||
CUPS_ADVANCE_FILE, /* Advance the roll after this file */
|
||||
CUPS_ADVANCE_JOB, /* Advance the roll after this job */
|
||||
CUPS_ADVANCE_SET, /* Advance the roll after this set */
|
||||
CUPS_ADVANCE_PAGE /* Advance the roll after this page */
|
||||
} cups_adv_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_EDGE_TOP, /* Leading edge is the top of the page */
|
||||
CUPS_EDGE_RIGHT, /* Leading edge is the right of the page */
|
||||
CUPS_EDGE_BOTTOM, /* Leading edge is the bottom of the page */
|
||||
CUPS_EDGE_LEFT /* Leading edge is the left of the page */
|
||||
} cups_edge_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_ORDER_CHUNKED, /* CMYK CMYK CMYK ... */
|
||||
CUPS_ORDER_BANDED, /* CCC MMM YYY KKK ... */
|
||||
CUPS_ORDER_PLANAR /* CCC ... MMM ... YYY ... KKK ... */
|
||||
} cups_order_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CUPS_CSPACE_W, /* Luminance */
|
||||
CUPS_CSPACE_RGB, /* Red, green, blue */
|
||||
CUPS_CSPACE_RGBA, /* Red, green, blue, alpha */
|
||||
CUPS_CSPACE_K, /* Black */
|
||||
CUPS_CSPACE_CMY, /* Cyan, magenta, yellow */
|
||||
CUPS_CSPACE_YMC, /* Yellow, magenta, cyan */
|
||||
CUPS_CSPACE_CMYK, /* Cyan, magenta, yellow, black */
|
||||
CUPS_CSPACE_YMCK, /* Yellow, magenta, cyan, black */
|
||||
CUPS_CSPACE_KCMY, /* Black, cyan, magenta, yellow */
|
||||
CUPS_CSPACE_KCMYcm, /* Black, cyan, magenta, yellow, *
|
||||
* light-cyan, light-magenta */
|
||||
CUPS_CSPACE_GMCK, /* Gold, magenta, yellow, black */
|
||||
CUPS_CSPACE_GMCS, /* Gold, magenta, yellow, silver */
|
||||
CUPS_CSPACE_WHITE, /* White ink (as black) */
|
||||
CUPS_CSPACE_GOLD, /* Gold foil */
|
||||
CUPS_CSPACE_SILVER /* Silver foil */
|
||||
} cups_cspace_t;
|
||||
|
||||
|
||||
/*
|
||||
* The page header structure contains the standard PostScript page device
|
||||
* dictionary, along with some CUPS-specific parameters that are provided
|
||||
* by the RIPs...
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/**** Standard Page Device Dictionary String Values ****/
|
||||
char MediaClass[64]; /* MediaClass string */
|
||||
char MediaColor[64]; /* MediaColor string */
|
||||
char MediaType[64]; /* MediaType string */
|
||||
char OutputType[64]; /* OutputType string */
|
||||
|
||||
/**** Standard Page Device Dictionary Integer Values ****/
|
||||
unsigned AdvanceDistance; /* AdvanceDistance value in points */
|
||||
cups_adv_t AdvanceMedia; /* AdvanceMedia value (see above) */
|
||||
cups_bool_t Collate; /* Collated copies value */
|
||||
cups_cut_t CutMedia; /* CutMedia value (see above) */
|
||||
cups_bool_t Duplex; /* Duplexed (double-sided) value */
|
||||
unsigned HWResolution[2]; /* Resolution in dots-per-inch */
|
||||
unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points) */
|
||||
cups_bool_t InsertSheet; /* InsertSheet value */
|
||||
cups_jog_t Jog; /* Jog value (see above) */
|
||||
cups_edge_t LeadingEdge; /* LeadingEdge value (see above) */
|
||||
unsigned Margins[2]; /* Lower-lefthand margins in points */
|
||||
cups_bool_t ManualFeed; /* ManualFeed value */
|
||||
unsigned MediaPosition; /* MediaPosition value */
|
||||
unsigned MediaWeight; /* MediaWeight value in grams/m^2 */
|
||||
cups_bool_t MirrorPrint; /* MirrorPrint value */
|
||||
cups_bool_t NegativePrint; /* NegativePrint value */
|
||||
unsigned NumCopies; /* Number of copies to produce */
|
||||
cups_orient_t Orientation; /* Orientation value (see above) */
|
||||
cups_bool_t OutputFaceUp; /* OutputFaceUp value */
|
||||
unsigned PageSize[2]; /* Width and length of page in points */
|
||||
cups_bool_t Separations; /* Separations value */
|
||||
cups_bool_t TraySwitch; /* TraySwitch value */
|
||||
cups_bool_t Tumble; /* Tumble value */
|
||||
|
||||
/**** CUPS Page Device Dictionary Values ****/
|
||||
unsigned cupsWidth; /* Width of page image in pixels */
|
||||
unsigned cupsHeight; /* Height of page image in pixels */
|
||||
unsigned cupsMediaType; /* Media type code */
|
||||
unsigned cupsBitsPerColor; /* Number of bits for each color */
|
||||
unsigned cupsBitsPerPixel; /* Number of bits for each pixel */
|
||||
unsigned cupsBytesPerLine; /* Number of bytes per line */
|
||||
cups_order_t cupsColorOrder; /* Order of colors */
|
||||
cups_cspace_t cupsColorSpace; /* True colorspace */
|
||||
unsigned cupsCompression; /* Device compression to use */
|
||||
unsigned cupsRowCount; /* Rows per band */
|
||||
unsigned cupsRowFeed; /* Feed between bands */
|
||||
unsigned cupsRowStep; /* Spacing between lines */
|
||||
} cups_page_header_t;
|
||||
|
||||
|
||||
/*
|
||||
* The raster structure maintains information about a raster data
|
||||
* stream...
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned sync; /* Sync word from start of stream */
|
||||
int fd; /* File descriptor */
|
||||
cups_mode_t mode; /* Read/write mode */
|
||||
} cups_raster_t;
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern void cupsRasterClose(cups_raster_t *r);
|
||||
extern cups_raster_t *cupsRasterOpen(int fd, cups_mode_t mode);
|
||||
extern unsigned cupsRasterReadHeader(cups_raster_t *r,
|
||||
cups_page_header_t *h);
|
||||
extern unsigned cupsRasterReadPixels(cups_raster_t *r,
|
||||
unsigned char *p, unsigned len);
|
||||
extern unsigned cupsRasterWriteHeader(cups_raster_t *r,
|
||||
cups_page_header_t *h);
|
||||
extern unsigned cupsRasterWritePixels(cups_raster_t *r,
|
||||
unsigned char *p, unsigned len);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_RASTER_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,287 +0,0 @@
|
||||
/*
|
||||
* "$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$".
|
||||
*/
|
||||
|
||||
-125
@@ -1,125 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* String 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:
|
||||
*
|
||||
* strdup() - Duplicate a string.
|
||||
* strcasecmp() - Do a case-insensitive comparison.
|
||||
* strncasecmp() - Do a case-insensitive comparison on up to N chars.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "string.h"
|
||||
|
||||
|
||||
/*
|
||||
* 'strdup()' - Duplicate a string.
|
||||
*/
|
||||
|
||||
# ifndef HAVE_STRDUP
|
||||
char * /* O - New string pointer */
|
||||
strdup(const char *s) /* I - String to duplicate */
|
||||
{
|
||||
char *t; /* New string pointer */
|
||||
|
||||
|
||||
if (s == NULL)
|
||||
return (NULL);
|
||||
|
||||
if ((t = malloc(strlen(s) + 1)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
return (strcpy(t, s));
|
||||
}
|
||||
# endif /* !HAVE_STRDUP */
|
||||
|
||||
|
||||
/*
|
||||
* 'strcasecmp()' - Do a case-insensitive comparison.
|
||||
*/
|
||||
|
||||
# ifndef HAVE_STRCASECMP
|
||||
int /* O - Result of comparison (-1, 0, or 1) */
|
||||
strcasecmp(const char *s, /* I - First string */
|
||||
const char *t) /* I - Second string */
|
||||
{
|
||||
while (*s != '\0' && *t != '\0')
|
||||
{
|
||||
if (tolower(*s) < tolower(*t))
|
||||
return (-1);
|
||||
else if (tolower(*s) > tolower(*t))
|
||||
return (1);
|
||||
|
||||
s ++;
|
||||
t ++;
|
||||
}
|
||||
|
||||
if (*s == '\0' && *t == '\0')
|
||||
return (0);
|
||||
else if (*s != '\0')
|
||||
return (1);
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
# endif /* !HAVE_STRCASECMP */
|
||||
|
||||
/*
|
||||
* 'strncasecmp()' - Do a case-insensitive comparison on up to N chars.
|
||||
*/
|
||||
|
||||
# ifndef HAVE_STRNCASECMP
|
||||
int /* O - Result of comparison (-1, 0, or 1) */
|
||||
strncasecmp(const char *s, /* I - First string */
|
||||
const char *t, /* I - Second string */
|
||||
size_t n) /* I - Maximum number of characters to compare */
|
||||
{
|
||||
while (*s != '\0' && *t != '\0' && n > 0)
|
||||
{
|
||||
if (tolower(*s) < tolower(*t))
|
||||
return (-1);
|
||||
else if (tolower(*s) > tolower(*t))
|
||||
return (1);
|
||||
|
||||
s ++;
|
||||
t ++;
|
||||
n --;
|
||||
}
|
||||
|
||||
if (n == 0)
|
||||
return (0);
|
||||
else if (*s == '\0' && *t == '\0')
|
||||
return (0);
|
||||
else if (*s != '\0')
|
||||
return (1);
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
# endif /* !HAVE_STRNCASECMP */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* String definitions 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_STRING_H_
|
||||
# define _CUPS_STRING_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdarg.h>
|
||||
# include <config.h>
|
||||
# include <string.h>
|
||||
|
||||
|
||||
/*
|
||||
* Stuff for WIN32 and OS/2...
|
||||
*/
|
||||
|
||||
# if defined(WIN32) || defined(__EMX__)
|
||||
# define strcasecmp stricmp
|
||||
# define strncasecmp strnicmp
|
||||
# endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
# ifndef HAVE_STRDUP
|
||||
extern char *strdup(const char *);
|
||||
# endif /* !HAVE_STRDUP */
|
||||
|
||||
# ifndef HAVE_STRCASECMP
|
||||
extern int strcasecmp(const char *, const char *);
|
||||
# endif /* !HAVE_STRCASECMP */
|
||||
|
||||
# ifndef HAVE_STRNCASECMP
|
||||
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_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,109 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* HTTP test program 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:
|
||||
*
|
||||
* main() - Main entry.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "http.h"
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
http_t *http; /* HTTP connection */
|
||||
http_status_t status; /* Status of GET command */
|
||||
char buffer[1024]; /* Input buffer */
|
||||
int bytes; /* Number of bytes read */
|
||||
FILE *out; /* Output file */
|
||||
|
||||
#define HOST "dns.easysw.com"
|
||||
#define PORT 80
|
||||
|
||||
puts("Connecting to " HOST "...");
|
||||
|
||||
httpInitialize();
|
||||
http = httpConnect(HOST, PORT);
|
||||
if (http == NULL)
|
||||
{
|
||||
puts("Unable to connect to " HOST "!");
|
||||
return (1);
|
||||
}
|
||||
|
||||
puts("Connected to " HOST "...");
|
||||
|
||||
out = stdout;
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (strcmp(argv[i], "-o") == 0)
|
||||
{
|
||||
i ++;
|
||||
out = fopen(argv[i], "wb");
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("Requesting file \"%s\"...\n", argv[i]);
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en");
|
||||
httpGet(http, argv[i]);
|
||||
status = httpUpdate(http);
|
||||
|
||||
if (status == HTTP_OK)
|
||||
puts("GET OK:");
|
||||
else
|
||||
printf("GET failed with status %d...\n", status);
|
||||
|
||||
while ((bytes = httpRead(http, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
fwrite(buffer, bytes, 1, out);
|
||||
if (out != stdout)
|
||||
printf("Read %d bytes, %d total...\n", bytes, ftell(out));
|
||||
}
|
||||
}
|
||||
|
||||
puts("Closing connection to server...");
|
||||
httpClose(http);
|
||||
|
||||
if (out != stdout)
|
||||
fclose(out);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,199 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* MIME 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.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:
|
||||
*
|
||||
* main() - Main entry for the test program.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mime.h"
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void print_rules(mime_magic_t *rules);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry for the test program.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line args */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char super[MIME_MAX_SUPER], /* Super-type name */
|
||||
type[MIME_MAX_TYPE]; /* Type name */
|
||||
mime_t *mime; /* MIME database */
|
||||
mime_type_t *src, /* Source type */
|
||||
*dst, /* Destination type */
|
||||
**types; /* File type array pointer */
|
||||
mime_filter_t *filters; /* Filters for the file */
|
||||
int num_filters; /* Number of filters for the file */
|
||||
|
||||
|
||||
mime = mimeLoad("../conf");
|
||||
|
||||
puts("MIME database types:");
|
||||
for (i = 0, types = mime->types; i < mime->num_types; i ++, types ++)
|
||||
{
|
||||
printf("\t%s/%s: ", (*types)->super, (*types)->type);
|
||||
print_rules((*types)->rules);
|
||||
puts("");
|
||||
}
|
||||
|
||||
puts("");
|
||||
|
||||
puts("MIME database filters:");
|
||||
for (i = 0, filters = mime->filters; i < mime->num_filters; i ++, filters ++)
|
||||
printf("\t%s/%s to %s/%s: %s (%d)\n",
|
||||
filters->src->super, filters->src->type,
|
||||
filters->dst->super, filters->dst->type,
|
||||
filters->filter, filters->cost);
|
||||
|
||||
puts("");
|
||||
|
||||
switch (argc)
|
||||
{
|
||||
default :
|
||||
fputs("Usage: testmime source-file [destination-type]\n", stderr);
|
||||
return (1);
|
||||
|
||||
case 2 :
|
||||
src = mimeFileType(mime, argv[1]);
|
||||
|
||||
if (src != NULL)
|
||||
{
|
||||
printf("%s: %s/%s\n", argv[1], src->super, src->type);
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%s: unknown\n", argv[1]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
case 3 :
|
||||
src = mimeFileType(mime, argv[1]);
|
||||
|
||||
sscanf(argv[2], "%15[^/]/31%s", super, type);
|
||||
dst = mimeType(mime, super, type);
|
||||
|
||||
filters = mimeFilter(mime, src, dst, &num_filters);
|
||||
|
||||
if (filters == NULL)
|
||||
{
|
||||
printf("No filters to convert from %s to %s.\n", argv[1], argv[2]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < num_filters; i ++)
|
||||
if (i < (num_filters - 1))
|
||||
printf("%s | ", filters[i].filter);
|
||||
else
|
||||
puts(filters[i].filter);
|
||||
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'print_rules()' - Print the rules for a file type...
|
||||
*/
|
||||
|
||||
static void
|
||||
print_rules(mime_magic_t *rules) /* I - Rules to print */
|
||||
{
|
||||
char logic; /* Logic separator */
|
||||
|
||||
|
||||
if (rules == NULL)
|
||||
return;
|
||||
|
||||
if (rules->parent == NULL ||
|
||||
rules->parent->op == MIME_MAGIC_OR)
|
||||
logic = ',';
|
||||
else
|
||||
logic = '+';
|
||||
|
||||
while (rules != NULL)
|
||||
{
|
||||
if (rules->prev != NULL)
|
||||
putchar(logic);
|
||||
|
||||
switch (rules->op)
|
||||
{
|
||||
case MIME_MAGIC_MATCH :
|
||||
printf("match(%s)", rules->value.matchv);
|
||||
break;
|
||||
case MIME_MAGIC_LOCALE :
|
||||
printf("locale(%s)", rules->value.localev);
|
||||
break;
|
||||
case MIME_MAGIC_ASCII :
|
||||
printf("ascii(%d,%d)", rules->offset, rules->length);
|
||||
break;
|
||||
case MIME_MAGIC_PRINTABLE :
|
||||
printf("printable(%d,%d)", rules->offset, rules->length);
|
||||
break;
|
||||
case MIME_MAGIC_STRING :
|
||||
printf("string(%d,%s)", rules->offset, rules->value.stringv);
|
||||
break;
|
||||
case MIME_MAGIC_CHAR :
|
||||
printf("char(%d,%d)", rules->offset, rules->value.charv);
|
||||
break;
|
||||
case MIME_MAGIC_SHORT :
|
||||
printf("short(%d,%d)", rules->offset, rules->value.shortv);
|
||||
break;
|
||||
case MIME_MAGIC_INT :
|
||||
printf("int(%d,%d)", rules->offset, rules->value.intv);
|
||||
break;
|
||||
default :
|
||||
if (rules->child != NULL)
|
||||
{
|
||||
putchar('(');
|
||||
print_rules(rules->child);
|
||||
putchar(')');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
rules = rules->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,102 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="testmime" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=testmime - 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 "testmime.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 "testmime.mak" CFG="testmime - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "testmime - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "testmime - 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)" == "testmime - 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.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:"testmime.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "testmime - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "testmime___Win32_Debug"
|
||||
# PROP BASE Intermediate_Dir "testmime___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 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:"testmimed.exe" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "testmime - Win32 Release"
|
||||
# Name "testmime - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\testmime.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mime.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,183 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* PPD 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.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
|
||||
*
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Main entry for test program.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include "string.h"
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry for test program.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i, j, k, m, n; /* Looping vars */
|
||||
const char *filename; /* File to load */
|
||||
ppd_file_t *ppd; /* PPD file record */
|
||||
ppd_size_t *size; /* Size record */
|
||||
ppd_group_t *group; /* UI group */
|
||||
ppd_option_t *option; /* Standard UI option */
|
||||
ppd_choice_t *choice; /* Standard UI option choice */
|
||||
static char *uis[] = { "BOOLEAN", "PICKONE", "PICKMANY" };
|
||||
static char *sections[] = { "ANY", "DOCUMENT", "EXIT",
|
||||
"JCL", "PAGE", "PROLOG" };
|
||||
|
||||
|
||||
/*
|
||||
* Display PPD files for each file listed on the command-line...
|
||||
*/
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
fputs("Usage: ppdtest filename1.ppd [... filenameN.ppd]\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (strstr(argv[i], ".ppd"))
|
||||
filename = argv[i];
|
||||
else
|
||||
filename = cupsGetPPD(argv[i]);
|
||||
|
||||
if ((ppd = ppdOpenFile(filename)) == NULL)
|
||||
{
|
||||
fprintf(stderr, "Unable to open \'%s\' as a PPD file!\n", filename);
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("FILE: %s\n", filename);
|
||||
printf(" language_level = %d\n", ppd->language_level);
|
||||
printf(" color_device = %s\n", ppd->color_device ? "TRUE" : "FALSE");
|
||||
printf(" variable_sizes = %s\n", ppd->variable_sizes ? "TRUE" : "FALSE");
|
||||
printf(" landscape = %d\n", ppd->landscape);
|
||||
|
||||
switch (ppd->colorspace)
|
||||
{
|
||||
case PPD_CS_CMYK :
|
||||
puts(" colorspace = PPD_CS_CMYK");
|
||||
break;
|
||||
case PPD_CS_CMY :
|
||||
puts(" colorspace = PPD_CS_CMY");
|
||||
break;
|
||||
case PPD_CS_GRAY :
|
||||
puts(" colorspace = PPD_CS_GRAY");
|
||||
break;
|
||||
case PPD_CS_RGB :
|
||||
puts(" colorspace = PPD_CS_RGB");
|
||||
break;
|
||||
default :
|
||||
puts(" colorspace = <unknown>");
|
||||
break;
|
||||
}
|
||||
|
||||
printf(" num_emulations = %d\n", ppd->num_emulations);
|
||||
for (j = 0; j < ppd->num_emulations; j ++)
|
||||
printf(" emulations[%d] = %s\n", j, ppd->emulations[j].name);
|
||||
|
||||
printf(" lang_encoding = %s\n", ppd->lang_encoding);
|
||||
printf(" lang_version = %s\n", ppd->lang_version);
|
||||
printf(" modelname = %s\n", ppd->modelname);
|
||||
printf(" ttrasterizer = %s\n",
|
||||
ppd->ttrasterizer == NULL ? "None" : ppd->ttrasterizer);
|
||||
printf(" manufacturer = %s\n", ppd->manufacturer);
|
||||
printf(" product = %s\n", ppd->product);
|
||||
printf(" nickname = %s\n", ppd->nickname);
|
||||
printf(" shortnickname = %s\n", ppd->shortnickname);
|
||||
printf(" patches = %d bytes\n",
|
||||
ppd->patches == NULL ? 0 : strlen(ppd->patches));
|
||||
|
||||
printf(" num_groups = %d\n", ppd->num_groups);
|
||||
for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++)
|
||||
{
|
||||
printf(" group[%d] = %s\n", j, group->text);
|
||||
|
||||
for (k = 0, option = group->options; k < group->num_options; k ++, option ++)
|
||||
{
|
||||
printf(" options[%d] = %s (%s) %s %s %.0f\n", k,
|
||||
option->keyword, option->text, uis[option->ui],
|
||||
sections[option->section], option->order);
|
||||
|
||||
if (strcmp(option->keyword, "PageSize") == 0 ||
|
||||
strcmp(option->keyword, "PageRegion") == 0)
|
||||
{
|
||||
for (m = option->num_choices, choice = option->choices;
|
||||
m > 0;
|
||||
m --, choice ++)
|
||||
{
|
||||
size = ppdPageSize(ppd, choice->choice);
|
||||
|
||||
if (size == NULL)
|
||||
printf(" %s (%s) = ERROR", choice->choice, choice->text);
|
||||
else
|
||||
printf(" %s (%s) = %.2fx%.2fin (%.1f,%.1f,%.1f,%.1f)", choice->choice,
|
||||
choice->text, size->width / 72.0, size->length / 72.0,
|
||||
size->left / 72.0, size->bottom / 72.0,
|
||||
size->right / 72.0, size->top / 72.0);
|
||||
|
||||
if (strcmp(option->defchoice, choice->choice) == 0)
|
||||
puts(" *");
|
||||
else
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (m = option->num_choices, choice = option->choices;
|
||||
m > 0;
|
||||
m --, choice ++)
|
||||
{
|
||||
printf(" %s (%s)", choice->choice, choice->text);
|
||||
|
||||
if (strcmp(option->defchoice, choice->choice) == 0)
|
||||
puts(" *");
|
||||
else
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ppdClose(ppd);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,102 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="testppd" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=testppd - 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 "testppd.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 "testppd.mak" CFG="testppd - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "testppd - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "testppd - 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)" == "testppd - 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.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:"testppd.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "testppd - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "testppd___Win32_Debug"
|
||||
# PROP BASE Intermediate_Dir "testppd___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 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:"testppdd.exe" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "testppd - Win32 Release"
|
||||
# Name "testppd - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\testppd.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ppd.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
-1014
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -1,175 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* User, system, and password routines 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:
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
/*
|
||||
* WIN32 and OS/2 username and password stuff...
|
||||
*/
|
||||
|
||||
/*
|
||||
* 'cupsUser()' - Return the current user's name.
|
||||
*/
|
||||
|
||||
const char * /* O - User name */
|
||||
cupsUser(void)
|
||||
{
|
||||
return ("WindowsUser");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetPassword()' - Get a password from the user...
|
||||
*/
|
||||
|
||||
const char * /* O - Password */
|
||||
cupsGetPassword(const char *prompt) /* I - Prompt string */
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* UNIX username and password stuff...
|
||||
*/
|
||||
|
||||
# include <pwd.h>
|
||||
|
||||
/*
|
||||
* 'cupsUser()' - Return the current user's name.
|
||||
*/
|
||||
|
||||
const char * /* O - User name */
|
||||
cupsUser(void)
|
||||
{
|
||||
struct passwd *pwd; /* User/password entry */
|
||||
|
||||
|
||||
/*
|
||||
* Rewind the password file...
|
||||
*/
|
||||
|
||||
setpwent();
|
||||
|
||||
/*
|
||||
* Lookup the password entry for the current user.
|
||||
*/
|
||||
|
||||
if ((pwd = getpwuid(getuid())) == NULL)
|
||||
return ("unknown"); /* Unknown user! */
|
||||
|
||||
/*
|
||||
* Rewind the password file again and return the username...
|
||||
*/
|
||||
|
||||
setpwent();
|
||||
|
||||
return (pwd->pw_name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetPassword()' - Get a password from the user...
|
||||
*/
|
||||
|
||||
const char * /* O - Password */
|
||||
cupsGetPassword(const char *prompt) /* I - Prompt string */
|
||||
{
|
||||
return (getpass(prompt));
|
||||
}
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsServer()' - Return the hostname of the default server...
|
||||
*/
|
||||
|
||||
const char * /* O - Server name */
|
||||
cupsServer(void)
|
||||
{
|
||||
FILE *fp; /* cupsd.conf file */
|
||||
char *server; /* Pointer to server name */
|
||||
static char line[1024]; /* Line from file */
|
||||
|
||||
|
||||
/*
|
||||
* First see if the CUPS_SERVER environment variable is set...
|
||||
*/
|
||||
|
||||
if ((server = getenv("CUPS_SERVER")) != NULL)
|
||||
return (server);
|
||||
|
||||
/*
|
||||
* Next check to see if we have a cupsd.conf file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(CUPS_SERVERROOT "/conf/cupsd.conf", "r")) == NULL)
|
||||
return ("localhost");
|
||||
|
||||
/*
|
||||
* Read the cupsd.conf file and look for a ServerName line...
|
||||
*/
|
||||
|
||||
while (fgets(line, sizeof(line), fp) != NULL)
|
||||
if (strncmp(line, "ServerName ", 11) == 0)
|
||||
{
|
||||
/*
|
||||
* Got it! Drop any trailing newline and find the name...
|
||||
*/
|
||||
|
||||
server = line + strlen(line) - 1;
|
||||
if (*server == '\n')
|
||||
*server = '\0';
|
||||
|
||||
for (server = line + 11; isspace(*server); server ++);
|
||||
|
||||
if (*server)
|
||||
return (server);
|
||||
}
|
||||
|
||||
/*
|
||||
* Didn't see a ServerName line, so return "localhost"...
|
||||
*/
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return ("localhost");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-1081
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Datafile makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 1993-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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
#
|
||||
# Data files...
|
||||
#
|
||||
|
||||
FILES = 8859-1 8859-14 8859-15 8859-2 8859-3 8859-4 8859-5 \
|
||||
8859-6 8859-7 8859-8 8859-9 HPGLprolog
|
||||
|
||||
#
|
||||
# Make everything...
|
||||
#
|
||||
|
||||
all:
|
||||
|
||||
#
|
||||
# Clean all config and object files...
|
||||
#
|
||||
|
||||
clean:
|
||||
|
||||
#
|
||||
# Install files...
|
||||
#
|
||||
|
||||
install:
|
||||
-$(MKDIR) $(DATADIR)/data
|
||||
$(CP) $(FILES) $(DATADIR)/data
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
Submódulo
+1
Submodule development added at d9f356c545
-109
@@ -1,109 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Documentation makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 1993-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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
#
|
||||
# HTMLDOC generation rules...
|
||||
#
|
||||
|
||||
.SUFFIXES: .html .pdf .shtml
|
||||
.shtml.html:
|
||||
echo Formatting $@...
|
||||
htmldoc --title images/cups-large.gif --numbered -f $@ $<
|
||||
.shtml.pdf:
|
||||
echo Formatting $@...
|
||||
htmldoc --title images/cups-large.gif --duplex --compression=9 \
|
||||
--numbered --jpeg -f $@ $<
|
||||
|
||||
#
|
||||
# Document files...
|
||||
#
|
||||
|
||||
DOCUMENTS = cmp.shtml idd.shtml sam.shtml sdd.shtml ssr.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
|
||||
WEBIMAGES = images/classes.gif images/logo.gif images/navbar.gif \
|
||||
images/printer-idle.gif images/printer-processing.gif \
|
||||
images/printer-stopped.gif
|
||||
|
||||
#
|
||||
#
|
||||
# Make all documents...
|
||||
#
|
||||
|
||||
all: $(DOCUMENTS:.shtml=.pdf) $(DOCUMENTS:.shtml=.html) overview.pdf
|
||||
|
||||
#
|
||||
# Remove all generated files...
|
||||
#
|
||||
|
||||
clean:
|
||||
$(RM) $(DOCUMENTS:.shtml=.pdf)
|
||||
$(RM) $(DOCUMENTS:.shtml=.html)
|
||||
$(RM) overview.pdf
|
||||
|
||||
#
|
||||
# Install all documentation files...
|
||||
#
|
||||
|
||||
install:
|
||||
-$(MKDIR) $(DATADIR)/doc
|
||||
$(CP) $(WEBPAGES) $(DATADIR)/doc
|
||||
$(CP) overview.html overview.pdf $(DATADIR)/doc
|
||||
$(CP) $(DOCUMENTS:.shtml=.html) $(DATADIR)/doc
|
||||
$(CP) $(DOCUMENTS:.shtml=.pdf) $(DATADIR)/doc
|
||||
-$(MKDIR) $(DATADIR)/doc/images
|
||||
$(CP) $(WEBIMAGES) $(DATADIR)/doc/images
|
||||
$(CP) $(DOCIMAGES) $(DATADIR)/doc/images
|
||||
|
||||
#
|
||||
# The overview, admin guide, and user's guide get special attention...
|
||||
#
|
||||
|
||||
overview.pdf: overview.html
|
||||
echo Formatting $@...
|
||||
htmldoc --duplex --compression=9 --jpeg --webpage -f overview.pdf overview.html
|
||||
|
||||
sam.html: sam.shtml
|
||||
echo Formatting $@...
|
||||
htmldoc --title images/cups-large.gif -f $@ $<
|
||||
sam.pdf: sam.shtml
|
||||
echo Formatting $@...
|
||||
htmldoc --title images/cups-large.gif --duplex --compression=9 \
|
||||
--jpeg -f $@ $<
|
||||
|
||||
sum.html: sum.shtml
|
||||
echo Formatting $@...
|
||||
htmldoc --title images/cups-large.gif -f $@ $<
|
||||
sum.pdf: sum.shtml
|
||||
echo Formatting $@...
|
||||
htmldoc --title images/cups-large.gif --duplex --compression=9 \
|
||||
--jpeg -f $@ $<
|
||||
|
||||
#
|
||||
# End of Makefile.
|
||||
#
|
||||
-651
@@ -1,651 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>CUPS Configuration Management Plan</TITLE>
|
||||
<META NAME="AUTHOR" CONTENT="Easy Software Products">
|
||||
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
|
||||
<META NAME="DOCNUMBER" CONTENT="CUPS-CMP-1.0">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<CENTER><A HREF=#contents><IMG SRC="images/cups-large.gif" BORDER=0><BR>
|
||||
<H1>CUPS Configuration Management Plan</H1></A><BR>
|
||||
CUPS-CMP-1.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 File Management</A></B>
|
||||
<UL>
|
||||
<LI><A HREF=#3_1>3.1 Directory Structure</A></LI>
|
||||
<LI><A HREF=#3_2>3.2 Source Files</A></LI>
|
||||
<LI><A HREF=#3_3>3.3 Configuration Management</A></LI>
|
||||
</UL>
|
||||
<B><A HREF=#4>4 Trouble Report Processing</A></B>
|
||||
<UL>
|
||||
<LI><A HREF=#4_1>4.1 Classification</A></LI>
|
||||
<LI><A HREF=#4_2>4.2 Identification</A></LI>
|
||||
<LI><A HREF=#4_3>4.3 Correction</A></LI>
|
||||
<LI><A HREF=#4_4>4.4 Notification</A></LI>
|
||||
</UL>
|
||||
<B><A HREF=#5>5 Software Releases</A></B>
|
||||
<UL>
|
||||
<LI><A HREF=#5_1>5.1 Version Numbering</A></LI>
|
||||
<LI><A HREF=#5_2>5.2 Generation</A></LI>
|
||||
<LI><A HREF=#5_3>5.3 Testing</A></LI>
|
||||
<LI><A HREF=#5_4>5.4 Release</A></LI>
|
||||
</UL>
|
||||
<B><A HREF=#6>A Glossary</A></B>
|
||||
<UL>
|
||||
<LI><A HREF=#6_1>A.1 Terms</A></LI>
|
||||
<LI><A HREF=#6_2>A.2 Acronyms</A></LI>
|
||||
</UL>
|
||||
<B><A HREF=#7>B Coding Requirements</A></B>
|
||||
<UL>
|
||||
<LI><A HREF=#7_1>B.1 Source Files</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_1_1>B.1.1 Naming</A></LI>
|
||||
<LI><A HREF=#7_1_2>B.1.2 Documentation</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF=#7_2>B.2 Functions</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_2_1>B.2.1 Naming</A></LI>
|
||||
<LI><A HREF=#7_2_2>B.2.2 Documentation</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF=#7_3>B.3 Methods</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_3_1>B.3.1 Naming</A></LI>
|
||||
<LI><A HREF=#7_3_2>B.3.2 Documentation</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF=#7_4>B.4 Variables</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_4_1>B.4.1 Naming</A></LI>
|
||||
<LI><A HREF=#7_4_2>B.4.2 Documentation</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF=#7_5>B.5 Types</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_5_1>B.5.1 Naming</A></LI>
|
||||
<LI><A HREF=#7_5_2>B.5.2 Documentation</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF=#7_6>B.6 Structures</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_6_1>B.6.1 Naming</A></LI>
|
||||
<LI><A HREF=#7_6_2>B.6.2 Documentation</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF=#7_7>B.7 Classes</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_7_1>B.7.1 Naming</A></LI>
|
||||
<LI><A HREF=#7_7_2>B.7.2 Documentation</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF=#7_8>B.8 Constants</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_8_1>B.8.1 Naming</A></LI>
|
||||
<LI><A HREF=#7_8_2>B.8.2 Documentation</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF=#7_9>B.9 Code</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF=#7_9_1>B.9.1 Documentation</A></LI>
|
||||
<LI><A HREF=#7_9_2>B.9.2 Style</A></LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<B><A HREF=#8>C Software Trouble Report Form</A></B><HR>
|
||||
<H1><A NAME=1>1 Scope</A></H1>
|
||||
<H2><A NAME=1_1>1.1 Identification</A></H2>
|
||||
This configuration management plan document provides the guidelines
|
||||
for development and maintainance of the Common UNIX Printing System
|
||||
("CUPS") Version 1.0 software.
|
||||
<H2><A NAME=1_2>1.2 System Overview</A></H2>
|
||||
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.
|
||||
<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 ("PPD")-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>
|
||||
This configuration management document is organized into the following
|
||||
sections:
|
||||
<UL>
|
||||
<LI>1 - Scope</LI>
|
||||
<LI>2 - References</LI>
|
||||
<LI>3 - File Management</LI>
|
||||
<LI>4 - Trouble Report Processing</LI>
|
||||
<LI>5 - Software Releases</LI>
|
||||
<LI>A - Glossary</LI>
|
||||
<LI>B - Coding Requirements</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>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>
|
||||
Each source file shall be placed a sub-directory corresponding to the
|
||||
software sub-system it belongs to ("scheduler", "libcups", etc.) To
|
||||
remain compatible with older UNIX filesystems, directory names shall
|
||||
not exceed 16 characters in length.
|
||||
<H2><A NAME=3_2>3.2 Source Files</A></H2>
|
||||
Source files shall be documented and formatted as described in
|
||||
Appendix B, Coding Requirements.
|
||||
<H2><A NAME=3_3>3.3 Configuration Management</A></H2>
|
||||
Source files shall be placed under the control of the Concurrent
|
||||
Versions System ("CVS") software. Source files shall be "checked in"
|
||||
with each change so that modifications can be tracked.
|
||||
<P>Documentation on the CVS software is included with the whitepaper,
|
||||
"CVS II: Parallelizing Software Development". </P>
|
||||
<H1><A NAME=4>4 Trouble Report Processing</A></H1>
|
||||
A Software Trouble Report ("STR") shall be submitted every time a user
|
||||
or vendor experiences a problem with the CUPS software. Trouble reports
|
||||
are maintained in a database with one of the following states:
|
||||
<OL>
|
||||
<LI>STR is closed with complete resolution</LI>
|
||||
<LI>STR is closed without resolution</LI>
|
||||
<LI>STR is active</LI>
|
||||
<LI>STR is pending (new STR or additional information available)</LI>
|
||||
</OL>
|
||||
Trouble reports shall be processed using the following steps.
|
||||
<H2><A NAME=4_1>4.1 Classification</A></H2>
|
||||
When a trouble report is received it must be classified at one of the
|
||||
following levels:
|
||||
<OL>
|
||||
<LI>Request for enhancement</LI>
|
||||
<LI>Documentation error</LI>
|
||||
<LI>Unable to print a file</LI>
|
||||
<LI>Unable to print to a printer</LI>
|
||||
<LI>Unable to print at all</LI>
|
||||
</OL>
|
||||
The scope of the problem should also be determined as:
|
||||
<OL>
|
||||
<LI>Specific to a machine</LI>
|
||||
<LI>Specific to an operating system</LI>
|
||||
<LI>Applies to all machines and operating systems</LI>
|
||||
</OL>
|
||||
<H2><A NAME=4_2>4.2 Identification</A></H2>
|
||||
Once the level and scope of the trouble report is determined the
|
||||
software sub-system(s) involved with the problem are determined. This
|
||||
may involve additional communication with the user or vendor to isolate
|
||||
the problem to a specific cause.
|
||||
<P>When the sub-system(s) involved have been identified, an engineer
|
||||
will then determine the change(s) needed and estimate the time required
|
||||
for the change(s). </P>
|
||||
<H2><A NAME=4_3>4.3 Correction</A></H2>
|
||||
Corrections are scheduled based upon the severity and complexity of
|
||||
the problem. Once all changes have been made, documented, and tested
|
||||
successfully a new software release snapshot is generated. Additional
|
||||
tests are added as necessary for proper testing of the changes.
|
||||
<H2><A NAME=4_4>4.4 Notification</A></H2>
|
||||
The user or vendor is notified when the fix is available or if the
|
||||
problem was caused by user error.
|
||||
<H1><A NAME=5>5 Software Releases</A></H1>
|
||||
<H2><A NAME=5_1>5.1 Version Numbering</A></H2>
|
||||
CUPS uses a three-part version number separated by periods to
|
||||
represent the major, minor, and patch release numbers:
|
||||
<UL>
|
||||
<PRE>
|
||||
major.minor.patch
|
||||
1.0.0
|
||||
</PRE>
|
||||
</UL>
|
||||
Beta-test releases are indentified by appending the letter B followed
|
||||
by the build number:
|
||||
<UL>
|
||||
<PRE>
|
||||
major.minor.patchbbuild
|
||||
1.0.0b1
|
||||
</PRE>
|
||||
</UL>
|
||||
A CVS snapshot is generated for every beta and final release and uses
|
||||
the version number preceded by the letter "v" and with the decimal
|
||||
points replaced by underscores:
|
||||
<UL>
|
||||
<PRE>
|
||||
v1_0_0b1
|
||||
v1_0_0
|
||||
</PRE>
|
||||
</UL>
|
||||
Each change that corrects a fault in a software sub-system increments
|
||||
the patch release number. If a change affects the software design of
|
||||
CUPS then the minor release number will be incremented and the patch
|
||||
release number reset to 0. If CUPS is completely redesigned the major
|
||||
release number will be incremented and the minor and patch release
|
||||
numbers reset to 0:
|
||||
<UL>
|
||||
<PRE>
|
||||
1.0.0b1 First beta release
|
||||
1.0.0b2 Second beta release
|
||||
1.0.0 First production release
|
||||
1.0.1b1 First beta of 1.0.1
|
||||
1.0.1 Production release of 1.0.1
|
||||
1.1.0b1 First beta of 1.1.0
|
||||
1.1.0 Production release of 1.1.0
|
||||
2.0.0b1 First beta of 2.0.0
|
||||
2.0.0 Production release of 2.0.0
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=5_2>5.2 Generation</A></H2>
|
||||
Software releases shall be generated for each successfully completed
|
||||
software trouble report. All object and executable files shall be
|
||||
deleted prior to performing a full build to ensure that source files
|
||||
are recompiled.
|
||||
<H2><A NAME=5_3>5.3 Testing</A></H2>
|
||||
Software testing shall be conducted according to the CUPS Software
|
||||
Test Plan, CUPS-STP-1.0. Failed tests cause STRs to be generated to
|
||||
correct the problems found.
|
||||
<H2><A NAME=5_4>5.4 Release</A></H2>
|
||||
When testing has been completed successfully a new distribution image
|
||||
is created from the current CVS code "snapshot". No production release
|
||||
shall contain software that has not passed the appropriate software
|
||||
tests.
|
||||
<H1 TYPE=A VALUE=1><A NAME=6>A Glossary</A></H1>
|
||||
<H2><A NAME=6_1>A.1 Terms</A></H2>
|
||||
<DL>
|
||||
<DT>C </DT>
|
||||
<DD>A computer language. </DD>
|
||||
<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=6_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>
|
||||
<H1><A NAME=7>B Coding Requirements</A></H1>
|
||||
These coding requirements provide detailed information on source file
|
||||
formatting and documentation content. These guidelines shall be applied
|
||||
to all C and C++ source files provided with CUPS.
|
||||
<H2><A NAME=7_1>B.1 Source Files</A></H2>
|
||||
<H3><A NAME=7_1_1>B.1.1 Naming</A></H3>
|
||||
All source files names shall be 16 characters or less in length to
|
||||
ensure compatibility with older UNIX filesystems. Source files
|
||||
containing functions shall have an extension of ".c" for ANSI C and
|
||||
".cpp" for C++ source files. All other "include" files shall have an
|
||||
extension of ".h".
|
||||
<H3><A NAME=7_1_2>B.1.2 Documentation</A></H3>
|
||||
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,v
|
||||
1.4 1999/09/22 20:06:18 mike Exp $" tag:
|
||||
<UL>
|
||||
<PRE>
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Description of file contents.
|
||||
*
|
||||
* 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.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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* function1() - Description 1.
|
||||
* function2() - Description 2.
|
||||
* function3() - Description 3.
|
||||
*/
|
||||
</PRE>
|
||||
</UL>
|
||||
The bottom of each source file shall contain a trailer giving the name
|
||||
of the file using the CVS "$Id: cmp.shtml,v 1.4 1999/09/22 20:06:18
|
||||
mike Exp $" 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$".
|
||||
*/
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=7_2>B.2 Functions</A></H2>
|
||||
<H3><A NAME=7_2_1>B.2.1 Naming</A></H3>
|
||||
Functions with a global scope shall be capitalized ("DoThis",
|
||||
"DoThat", "DoSomethingElse", etc.) The only exception to this rule
|
||||
shall be the CUPS interface library functions which may begin with a
|
||||
prefix word in lowercase ("cupsDoThis", "cupsDoThat", etc.)
|
||||
<P>Functions with a local scope shall be declared "static" and be
|
||||
lowercase with underscores between words ("do_this", "do_that",
|
||||
"do_something_else", etc.) </P>
|
||||
<H3><A NAME=7_2_2>B.2.2 Documentation</A></H3>
|
||||
Each function shall begin with a comment header describing what the
|
||||
function does, the possible input limits (if any), and the possible
|
||||
output values (if any), and any special information needed:
|
||||
<UL>
|
||||
<PRE>
|
||||
/*
|
||||
* 'do_this()' - Compute y = this(x).
|
||||
*
|
||||
* Notes: none.
|
||||
*/
|
||||
|
||||
static float /* O - Inverse power value, 0.0 <= y <= 1.0 */
|
||||
do_this(float x) /* I - Power value (0.0 <= x <= 1.0) */
|
||||
{
|
||||
...
|
||||
return (y);
|
||||
}
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=7_3>B.3 Methods</A></H2>
|
||||
<H3><A NAME=7_3_1>B.3.1 Naming</A></H3>
|
||||
Methods shall be in lowercase with underscores between words
|
||||
("do_this", "do_that", "do_something_else", etc.)
|
||||
<H3><A NAME=7_3_2>B.3.2 Documentation</A></H3>
|
||||
Each method shall begin with a comment header describing what the
|
||||
method does, the possible input limits (if any), and the possible
|
||||
output values (if any), and any special information needed:
|
||||
<UL>
|
||||
<PRE>
|
||||
/*
|
||||
* 'class::do_this()' - Compute y = this(x).
|
||||
*
|
||||
* Notes: none.
|
||||
*/
|
||||
|
||||
float /* O - Inverse power value, 0.0 <= y <= 1.0 */
|
||||
class::do_this(float x) /* I - Power value (0.0 <= x <= 1.0) */
|
||||
{
|
||||
...
|
||||
return (y);
|
||||
}
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=7_4>B.4 Variables</A></H2>
|
||||
<H3><A NAME=7_4_1>B.4.1 Naming</A></H3>
|
||||
Variables with a global scope shall be capitalized ("ThisVariable",
|
||||
"ThatVariable", "ThisStateVariable", etc.) The only exception to this
|
||||
rule shall be the CUPS interface library global variables which must
|
||||
begin with the prefix "cups" ("cupsThisVariable", "cupsThatVariable",
|
||||
etc.) Global variables shall be replaced by function arguments whenever
|
||||
possible.
|
||||
<P>Variables with a local scope shall be lowercase with underscores
|
||||
between words ("this_variable", "that_variable", etc.) Any local
|
||||
variables shared by functions within a source file shall be declared
|
||||
"static". </P>
|
||||
<H3><A NAME=7_4_2>B.4.2 Documentation</A></H3>
|
||||
Each variable shall be declared on a separate line and shall be
|
||||
immediately followed by a comment block describing the variable:
|
||||
<UL>
|
||||
<PRE>
|
||||
int this_variable; /* The current state of this */
|
||||
int that_variable; /* The current state of that */
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=7_5>B.5 Types</A></H2>
|
||||
<H3><A NAME=7_5_1>B.5.1 Naming</A></H3>
|
||||
All type names shall be lowercase with underscores between words and
|
||||
"_t" appended to the end of the name ("this_type_t", "that_type_t",
|
||||
etc.)
|
||||
<H3><A NAME=7_5_2>B.5.2 Documentation</A></H3>
|
||||
Each type shall have a comment block immediately before the typedef:
|
||||
<UL>
|
||||
<PRE>
|
||||
/*
|
||||
* This type is for CUPS foobar options.
|
||||
*/
|
||||
typedef int cups_this_type_t;
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=7_6>B.6 Structures</A></H2>
|
||||
<H3><A NAME=7_6_1>B.6.1 Naming</A></H3>
|
||||
All structure names shall be lowercase with underscores between words
|
||||
and "_str" appended to the end of the name ("this_struct_str",
|
||||
"that_struct_str", etc.)
|
||||
<H3><A NAME=7_6_2>B.6.2 Documentation</A></H3>
|
||||
Each structure shall have a comment block immediately before the
|
||||
struct and each member shall be documented in accordance with the
|
||||
variable naming policy above:
|
||||
<UL>
|
||||
<PRE>
|
||||
/*
|
||||
* This structure is for CUPS foobar options.
|
||||
*/
|
||||
struct cups_this_struct_str
|
||||
{
|
||||
int this_member; /* Current state for this */
|
||||
int that_member; /* Current state for that */
|
||||
};
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=7_7>B.7 Classes</A></H2>
|
||||
<H3><A NAME=7_7_1>B.7.1 Naming</A></H3>
|
||||
All class names shall be lowercase with underscores between words
|
||||
("this_class", "that_class", etc.)
|
||||
<H3><A NAME=7_7_2>B.7.2 Documentation</A></H3>
|
||||
Each class shall have a comment block immediately before the class and
|
||||
each member shall be documented in accordance with the variable naming
|
||||
policy above:
|
||||
<UL>
|
||||
<PRE>
|
||||
/*
|
||||
* This class is for CUPS foobar options.
|
||||
*/
|
||||
class cups_this_class
|
||||
{
|
||||
int this_member; /* Current state for this */
|
||||
int that_member; /* Current state for that */
|
||||
};
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=7_8>B.8 Constants</A></H2>
|
||||
<H3><A NAME=7_8_1>B.8.1 Naming</A></H3>
|
||||
All constant names shall be uppercase with underscored between words
|
||||
("THIS_CONSTANT", "THAT_CONSTANT", etc.) Constants defined for the CUPS
|
||||
interface library must begin with an uppercase prefix
|
||||
("CUPS_THIS_CONSTANT", "CUPS_THAT_CONSTANT", etc.)
|
||||
<P>Typed enumerations shall be used whenever possible to allow for type
|
||||
checking by the compiler. </P>
|
||||
<H3><A NAME=7_8_2>B.8.2 Documentation</A></H3>
|
||||
Comment blocks shall immediately follow each constant:
|
||||
<UL>
|
||||
<PRE>
|
||||
enum
|
||||
{
|
||||
CUPS_THIS_TRAY, /* This tray */
|
||||
CUPS_THAT_TRAY /* That tray */
|
||||
};
|
||||
</PRE>
|
||||
</UL>
|
||||
<H2><A NAME=7_9>B.9 Code</A></H2>
|
||||
<H3><A NAME=7_9_1>B.9.1 Documentation</A></H3>
|
||||
All source code shall utilize block comments within functions to
|
||||
describe the operations being performed by a group of statements:
|
||||
<UL>
|
||||
<PRE>
|
||||
/*
|
||||
* Clear the state array before we begin...
|
||||
*/
|
||||
|
||||
for (i = 0; i < (sizeof(array) / sizeof(sizeof(array[0])); i ++)
|
||||
array[i] = STATE_IDLE;
|
||||
|
||||
/*
|
||||
* Wait for state changes...
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
for (i = 0; i < (sizeof(array) / sizeof(sizeof(array[0])); i ++)
|
||||
if (array[i] != STATE_IDLE)
|
||||
break;
|
||||
|
||||
if (i == (sizeof(array) / sizeof(array[0])))
|
||||
sleep(1);
|
||||
} while (i == (sizeof(array) / sizeof(array[0])));
|
||||
</PRE>
|
||||
</UL>
|
||||
<H3><A NAME=7_9_2>B.9.2 Style</A></H3>
|
||||
<H4 TYPE=a>B.9.2.a Indentation</H4>
|
||||
All code blocks enclosed by brackets shall begin with the opening
|
||||
brace on a new line. The code then follows starting on a new line after
|
||||
the brace and is indented 2 spaces. The closing brace is then placed on
|
||||
a new line following the code at the original indentation:
|
||||
<UL>
|
||||
<PRE>
|
||||
{
|
||||
int i; /* Looping var */
|
||||
|
||||
/*
|
||||
* Process foobar values from 0 to 999...
|
||||
*/
|
||||
|
||||
for (i = 0; i < 1000; i ++)
|
||||
{
|
||||
do_this(i);
|
||||
do_that(i);
|
||||
}
|
||||
}
|
||||
</PRE>
|
||||
</UL>
|
||||
Single-line statements following "do", "else", "for", "if", and
|
||||
"while" shall be indented 2 spaces as well. Blocks of code in a
|
||||
"switch" block shall be indented 4 spaces after each "case" and
|
||||
"default" case:
|
||||
<UL>
|
||||
<PRE>
|
||||
switch (array[i])
|
||||
{
|
||||
case STATE_IDLE :
|
||||
do_this(i);
|
||||
do_that(i);
|
||||
break;
|
||||
default :
|
||||
do_nothing(i);
|
||||
break;
|
||||
}
|
||||
</PRE>
|
||||
</UL>
|
||||
<H4>B.9.2.b Spacing</H4>
|
||||
A space shall follow each reserved word ("if", "while", etc.) Spaces
|
||||
shall not be inserted between a function name and the arguments in
|
||||
parenthesis.
|
||||
<H4>B.9.2.c Return Values</H4>
|
||||
Parenthesis shall surround values returned from a function using
|
||||
"return":
|
||||
<UL>
|
||||
<PRE>
|
||||
return (STATE_IDLE);
|
||||
</PRE>
|
||||
</UL>
|
||||
<H4>B.9.2.d Loops</H4>
|
||||
Whenever convenient loops should count downward to zero to improve
|
||||
program performance:
|
||||
<UL>
|
||||
<PRE>
|
||||
for (i = sizeof(array) / sizeof(array[0]) - 1; i >= 0; i --)
|
||||
array[i] = STATE_IDLE;
|
||||
</PRE>
|
||||
</UL>
|
||||
<H1 ALIGN=RIGHT><A NAME=8>C Software Trouble Report Form</A></H1>
|
||||
<CENTER>
|
||||
<TABLE WIDTH=80%>
|
||||
<TR><TH ALIGN=RIGHT>Summary of Problem:</TH><TD ALIGN=LEFT>
|
||||
________________________________________</TD></TR>
|
||||
<TR><TH ALIGN=RIGHT>Problem Severity:</TH><TD ALIGN=LEFT>__1=RFE
|
||||
<BR>__2=Documentation-Error
|
||||
<BR>__3=Unable-to-Print-a-File
|
||||
<BR>__4=Unable-to-Print-to-a-Printer
|
||||
<BR>__5=Unable-to-Print-at-All</TD></TR>
|
||||
<TR><TH ALIGN=RIGHT>Problem Scope:</TH><TD ALIGN=LEFT>__1=Machine
|
||||
__2=Operating-System __3=All</TD></TR>
|
||||
<TR><TH ALIGN=RIGHT VALIGN=TOP>Detailed Description of Problem:</TH><TD ALIGN=LEFT>
|
||||
________________________________________
|
||||
<BR>________________________________________
|
||||
<BR>________________________________________
|
||||
<BR>________________________________________
|
||||
<BR>________________________________________
|
||||
<BR>________________________________________</TD></TR>
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
</BODY>
|
||||
</HTML>
|
||||
-960
@@ -1,960 +0,0 @@
|
||||
%PDF-1.2
|
||||
%âãÏÓ
|
||||
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
|
||||
5 0 obj<</Type/Font/Subtype/Type1/BaseFont/Times-Bold/Encoding 2 0 R>>endobj
|
||||
6 0 obj<</Type/Font/Subtype/Type1/BaseFont/Times-Italic/Encoding 2 0 R>>endobj
|
||||
7 0 obj<</Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding 2 0 R>>endobj
|
||||
8 0 obj<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Bold/Encoding 2 0 R>>endobj
|
||||
9 0 obj<</Type/Font/Subtype/Type1/BaseFont/Symbol>>endobj
|
||||
10 0 obj<</Subtype/Link/Rect[72.0 673.2 80.2 686.2]/Border[0 0 0]/Dest[198 0 R/XYZ null 818 0]>>endobj
|
||||
11 0 obj<</Subtype/Link/Rect[80.2 673.2 107.8 686.2]/Border[0 0 0]/Dest[198 0 R/XYZ null 818 0]>>endobj
|
||||
12 0 obj<</Subtype/Link/Rect[108.0 660.0 124.5 673.0]/Border[0 0 0]/Dest[198 0 R/XYZ null 737 0]>>endobj
|
||||
13 0 obj<</Subtype/Link/Rect[124.5 660.0 183.8 673.0]/Border[0 0 0]/Dest[198 0 R/XYZ null 737 0]>>endobj
|
||||
14 0 obj<</Subtype/Link/Rect[108.0 646.8 124.5 659.8]/Border[0 0 0]/Dest[198 0 R/XYZ null 658 0]>>endobj
|
||||
15 0 obj<</Subtype/Link/Rect[124.5 646.8 159.6 659.8]/Border[0 0 0]/Dest[198 0 R/XYZ null 658 0]>>endobj
|
||||
16 0 obj<</Subtype/Link/Rect[159.6 646.8 203.0 659.8]/Border[0 0 0]/Dest[198 0 R/XYZ null 658 0]>>endobj
|
||||
17 0 obj<</Subtype/Link/Rect[108.0 633.6 124.5 646.6]/Border[0 0 0]/Dest[198 0 R/XYZ null 434 0]>>endobj
|
||||
18 0 obj<</Subtype/Link/Rect[124.5 633.6 173.1 646.6]/Border[0 0 0]/Dest[198 0 R/XYZ null 434 0]>>endobj
|
||||
19 0 obj<</Subtype/Link/Rect[173.1 633.6 216.4 646.6]/Border[0 0 0]/Dest[198 0 R/XYZ null 434 0]>>endobj
|
||||
20 0 obj<</Subtype/Link/Rect[72.0 607.2 80.2 620.2]/Border[0 0 0]/Dest[204 0 R/XYZ null 818 0]>>endobj
|
||||
21 0 obj<</Subtype/Link/Rect[80.2 607.2 131.6 620.2]/Border[0 0 0]/Dest[204 0 R/XYZ null 818 0]>>endobj
|
||||
22 0 obj<</Subtype/Link/Rect[108.0 594.0 124.5 607.0]/Border[0 0 0]/Dest[204 0 R/XYZ null 737 0]>>endobj
|
||||
23 0 obj<</Subtype/Link/Rect[124.5 594.0 154.8 607.0]/Border[0 0 0]/Dest[204 0 R/XYZ null 737 0]>>endobj
|
||||
24 0 obj<</Subtype/Link/Rect[154.8 594.0 222.6 607.0]/Border[0 0 0]/Dest[204 0 R/XYZ null 737 0]>>endobj
|
||||
25 0 obj<</Subtype/Link/Rect[108.0 580.8 124.5 593.8]/Border[0 0 0]/Dest[204 0 R/XYZ null 540 0]>>endobj
|
||||
26 0 obj<</Subtype/Link/Rect[124.5 580.8 152.3 593.8]/Border[0 0 0]/Dest[204 0 R/XYZ null 540 0]>>endobj
|
||||
27 0 obj<</Subtype/Link/Rect[152.3 580.8 202.4 593.8]/Border[0 0 0]/Dest[204 0 R/XYZ null 540 0]>>endobj
|
||||
28 0 obj<</Subtype/Link/Rect[72.0 554.4 80.2 567.4]/Border[0 0 0]/Dest[210 0 R/XYZ null 818 0]>>endobj
|
||||
29 0 obj<</Subtype/Link/Rect[80.2 554.4 100.7 567.4]/Border[0 0 0]/Dest[210 0 R/XYZ null 818 0]>>endobj
|
||||
30 0 obj<</Subtype/Link/Rect[100.7 554.4 162.4 567.4]/Border[0 0 0]/Dest[210 0 R/XYZ null 818 0]>>endobj
|
||||
31 0 obj<</Subtype/Link/Rect[108.0 541.2 124.5 554.2]/Border[0 0 0]/Dest[210 0 R/XYZ null 737 0]>>endobj
|
||||
32 0 obj<</Subtype/Link/Rect[124.5 541.2 169.4 554.2]/Border[0 0 0]/Dest[210 0 R/XYZ null 737 0]>>endobj
|
||||
33 0 obj<</Subtype/Link/Rect[169.4 541.2 209.7 554.2]/Border[0 0 0]/Dest[210 0 R/XYZ null 737 0]>>endobj
|
||||
34 0 obj<</Subtype/Link/Rect[108.0 528.0 124.5 541.0]/Border[0 0 0]/Dest[210 0 R/XYZ null 645 0]>>endobj
|
||||
35 0 obj<</Subtype/Link/Rect[124.5 528.0 157.8 541.0]/Border[0 0 0]/Dest[210 0 R/XYZ null 645 0]>>endobj
|
||||
36 0 obj<</Subtype/Link/Rect[157.8 528.0 179.2 541.0]/Border[0 0 0]/Dest[210 0 R/XYZ null 645 0]>>endobj
|
||||
37 0 obj<</Subtype/Link/Rect[108.0 514.8 124.5 527.8]/Border[0 0 0]/Dest[210 0 R/XYZ null 579 0]>>endobj
|
||||
38 0 obj<</Subtype/Link/Rect[124.5 514.8 189.0 527.8]/Border[0 0 0]/Dest[210 0 R/XYZ null 579 0]>>endobj
|
||||
39 0 obj<</Subtype/Link/Rect[189.0 514.8 246.4 527.8]/Border[0 0 0]/Dest[210 0 R/XYZ null 579 0]>>endobj
|
||||
40 0 obj<</Subtype/Link/Rect[72.0 488.4 80.2 501.4]/Border[0 0 0]/Dest[216 0 R/XYZ null 818 0]>>endobj
|
||||
41 0 obj<</Subtype/Link/Rect[80.2 488.4 120.9 501.4]/Border[0 0 0]/Dest[216 0 R/XYZ null 818 0]>>endobj
|
||||
42 0 obj<</Subtype/Link/Rect[120.9 488.4 156.6 501.4]/Border[0 0 0]/Dest[216 0 R/XYZ null 818 0]>>endobj
|
||||
43 0 obj<</Subtype/Link/Rect[156.6 488.4 206.7 501.4]/Border[0 0 0]/Dest[216 0 R/XYZ null 818 0]>>endobj
|
||||
44 0 obj<</Subtype/Link/Rect[108.0 475.2 124.5 488.2]/Border[0 0 0]/Dest[216 0 R/XYZ null 624 0]>>endobj
|
||||
45 0 obj<</Subtype/Link/Rect[124.5 475.2 185.0 488.2]/Border[0 0 0]/Dest[216 0 R/XYZ null 624 0]>>endobj
|
||||
46 0 obj<</Subtype/Link/Rect[108.0 462.0 124.5 475.0]/Border[0 0 0]/Dest[216 0 R/XYZ null 400 0]>>endobj
|
||||
47 0 obj<</Subtype/Link/Rect[124.5 462.0 183.8 475.0]/Border[0 0 0]/Dest[216 0 R/XYZ null 400 0]>>endobj
|
||||
48 0 obj<</Subtype/Link/Rect[108.0 448.8 124.5 461.8]/Border[0 0 0]/Dest[216 0 R/XYZ null 268 0]>>endobj
|
||||
49 0 obj<</Subtype/Link/Rect[124.5 448.8 171.5 461.8]/Border[0 0 0]/Dest[216 0 R/XYZ null 268 0]>>endobj
|
||||
50 0 obj<</Subtype/Link/Rect[108.0 435.6 124.5 448.6]/Border[0 0 0]/Dest[219 0 R/XYZ null 800 0]>>endobj
|
||||
51 0 obj<</Subtype/Link/Rect[124.5 435.6 177.7 448.6]/Border[0 0 0]/Dest[219 0 R/XYZ null 800 0]>>endobj
|
||||
52 0 obj<</Subtype/Link/Rect[72.0 409.2 80.2 422.2]/Border[0 0 0]/Dest[222 0 R/XYZ null 818 0]>>endobj
|
||||
53 0 obj<</Subtype/Link/Rect[80.2 409.2 125.2 422.2]/Border[0 0 0]/Dest[222 0 R/XYZ null 818 0]>>endobj
|
||||
54 0 obj<</Subtype/Link/Rect[125.2 409.2 164.9 422.2]/Border[0 0 0]/Dest[222 0 R/XYZ null 818 0]>>endobj
|
||||
55 0 obj<</Subtype/Link/Rect[108.0 396.0 124.5 409.0]/Border[0 0 0]/Dest[222 0 R/XYZ null 737 0]>>endobj
|
||||
56 0 obj<</Subtype/Link/Rect[124.5 396.0 162.1 409.0]/Border[0 0 0]/Dest[222 0 R/XYZ null 737 0]>>endobj
|
||||
57 0 obj<</Subtype/Link/Rect[162.1 396.0 212.2 409.0]/Border[0 0 0]/Dest[222 0 R/XYZ null 737 0]>>endobj
|
||||
58 0 obj<</Subtype/Link/Rect[108.0 382.8 124.5 395.8]/Border[0 0 0]/Dest[222 0 R/XYZ null 309 0]>>endobj
|
||||
59 0 obj<</Subtype/Link/Rect[124.5 382.8 173.4 395.8]/Border[0 0 0]/Dest[222 0 R/XYZ null 309 0]>>endobj
|
||||
60 0 obj<</Subtype/Link/Rect[108.0 369.6 124.5 382.6]/Border[0 0 0]/Dest[222 0 R/XYZ null 230 0]>>endobj
|
||||
61 0 obj<</Subtype/Link/Rect[124.5 369.6 157.5 382.6]/Border[0 0 0]/Dest[222 0 R/XYZ null 230 0]>>endobj
|
||||
62 0 obj<</Subtype/Link/Rect[108.0 356.4 124.5 369.4]/Border[0 0 0]/Dest[225 0 R/XYZ null 800 0]>>endobj
|
||||
63 0 obj<</Subtype/Link/Rect[124.5 356.4 158.7 369.4]/Border[0 0 0]/Dest[225 0 R/XYZ null 800 0]>>endobj
|
||||
64 0 obj<</Subtype/Link/Rect[72.0 330.0 82.7 343.0]/Border[0 0 0]/Dest[228 0 R/XYZ null 818 0]>>endobj
|
||||
65 0 obj<</Subtype/Link/Rect[82.7 330.0 124.2 343.0]/Border[0 0 0]/Dest[228 0 R/XYZ null 818 0]>>endobj
|
||||
66 0 obj<</Subtype/Link/Rect[108.0 316.8 126.9 329.8]/Border[0 0 0]/Dest[228 0 R/XYZ null 737 0]>>endobj
|
||||
67 0 obj<</Subtype/Link/Rect[126.9 316.8 155.0 329.8]/Border[0 0 0]/Dest[228 0 R/XYZ null 737 0]>>endobj
|
||||
68 0 obj<</Subtype/Link/Rect[108.0 303.6 126.9 316.6]/Border[0 0 0]/Dest[228 0 R/XYZ null 434 0]>>endobj
|
||||
69 0 obj<</Subtype/Link/Rect[126.9 303.6 172.8 316.6]/Border[0 0 0]/Dest[228 0 R/XYZ null 434 0]>>endobj
|
||||
70 0 obj<</Subtype/Link/Rect[72.0 277.2 82.1 290.2]/Border[0 0 0]/Dest[234 0 R/XYZ null 818 0]>>endobj
|
||||
71 0 obj<</Subtype/Link/Rect[82.1 277.2 119.1 290.2]/Border[0 0 0]/Dest[234 0 R/XYZ null 818 0]>>endobj
|
||||
72 0 obj<</Subtype/Link/Rect[119.1 277.2 185.1 290.2]/Border[0 0 0]/Dest[234 0 R/XYZ null 818 0]>>endobj
|
||||
73 0 obj<</Subtype/Link/Rect[108.0 264.0 126.3 277.0]/Border[0 0 0]/Dest[234 0 R/XYZ null 717 0]>>endobj
|
||||
74 0 obj<</Subtype/Link/Rect[126.3 264.0 159.6 277.0]/Border[0 0 0]/Dest[234 0 R/XYZ null 717 0]>>endobj
|
||||
75 0 obj<</Subtype/Link/Rect[159.6 264.0 181.0 277.0]/Border[0 0 0]/Dest[234 0 R/XYZ null 717 0]>>endobj
|
||||
76 0 obj<</Subtype/Link/Rect[144.0 250.8 170.6 263.8]/Border[0 0 0]/Dest[234 0 R/XYZ null 647 0]>>endobj
|
||||
77 0 obj<</Subtype/Link/Rect[170.6 250.8 206.0 263.8]/Border[0 0 0]/Dest[234 0 R/XYZ null 647 0]>>endobj
|
||||
78 0 obj<</Subtype/Link/Rect[144.0 237.6 170.6 250.6]/Border[0 0 0]/Dest[234 0 R/XYZ null 561 0]>>endobj
|
||||
79 0 obj<</Subtype/Link/Rect[170.6 237.6 238.4 250.6]/Border[0 0 0]/Dest[234 0 R/XYZ null 561 0]>>endobj
|
||||
80 0 obj<</Subtype/Link/Rect[108.0 224.4 126.3 237.4]/Border[0 0 0]/Dest[237 0 R/XYZ null 721 0]>>endobj
|
||||
81 0 obj<</Subtype/Link/Rect[126.3 224.4 169.7 237.4]/Border[0 0 0]/Dest[237 0 R/XYZ null 721 0]>>endobj
|
||||
82 0 obj<</Subtype/Link/Rect[144.0 211.2 170.6 224.2]/Border[0 0 0]/Dest[237 0 R/XYZ null 651 0]>>endobj
|
||||
83 0 obj<</Subtype/Link/Rect[170.6 211.2 206.0 224.2]/Border[0 0 0]/Dest[237 0 R/XYZ null 651 0]>>endobj
|
||||
84 0 obj<</Subtype/Link/Rect[144.0 198.0 170.6 211.0]/Border[0 0 0]/Dest[237 0 R/XYZ null 526 0]>>endobj
|
||||
85 0 obj<</Subtype/Link/Rect[170.6 198.0 238.4 211.0]/Border[0 0 0]/Dest[237 0 R/XYZ null 526 0]>>endobj
|
||||
86 0 obj<</Subtype/Link/Rect[108.0 184.8 126.3 197.8]/Border[0 0 0]/Dest[237 0 R/XYZ null 323 0]>>endobj
|
||||
87 0 obj<</Subtype/Link/Rect[126.3 184.8 164.8 197.8]/Border[0 0 0]/Dest[237 0 R/XYZ null 323 0]>>endobj
|
||||
88 0 obj<</Subtype/Link/Rect[144.0 171.6 170.6 184.6]/Border[0 0 0]/Dest[237 0 R/XYZ null 253 0]>>endobj
|
||||
89 0 obj<</Subtype/Link/Rect[170.6 171.6 206.0 184.6]/Border[0 0 0]/Dest[237 0 R/XYZ null 253 0]>>endobj
|
||||
90 0 obj<</Subtype/Link/Rect[144.0 158.4 170.6 171.4]/Border[0 0 0]/Dest[237 0 R/XYZ null 181 0]>>endobj
|
||||
91 0 obj<</Subtype/Link/Rect[170.6 158.4 238.4 171.4]/Border[0 0 0]/Dest[237 0 R/XYZ null 181 0]>>endobj
|
||||
92 0 obj<</Subtype/Link/Rect[108.0 145.2 126.3 158.2]/Border[0 0 0]/Dest[240 0 R/XYZ null 648 0]>>endobj
|
||||
93 0 obj<</Subtype/Link/Rect[126.3 145.2 168.5 158.2]/Border[0 0 0]/Dest[240 0 R/XYZ null 648 0]>>endobj
|
||||
94 0 obj<</Subtype/Link/Rect[144.0 132.0 170.6 145.0]/Border[0 0 0]/Dest[240 0 R/XYZ null 578 0]>>endobj
|
||||
95 0 obj<</Subtype/Link/Rect[170.6 132.0 206.0 145.0]/Border[0 0 0]/Dest[240 0 R/XYZ null 578 0]>>endobj
|
||||
96 0 obj<</Subtype/Link/Rect[144.0 118.8 170.6 131.8]/Border[0 0 0]/Dest[240 0 R/XYZ null 440 0]>>endobj
|
||||
97 0 obj<</Subtype/Link/Rect[170.6 118.8 238.4 131.8]/Border[0 0 0]/Dest[240 0 R/XYZ null 440 0]>>endobj
|
||||
98 0 obj<</Subtype/Link/Rect[108.0 105.6 126.3 118.6]/Border[0 0 0]/Dest[240 0 R/XYZ null 348 0]>>endobj
|
||||
99 0 obj<</Subtype/Link/Rect[126.3 105.6 153.2 118.6]/Border[0 0 0]/Dest[240 0 R/XYZ null 348 0]>>endobj
|
||||
100 0 obj<</Subtype/Link/Rect[144.0 92.4 170.6 105.4]/Border[0 0 0]/Dest[240 0 R/XYZ null 277 0]>>endobj
|
||||
101 0 obj<</Subtype/Link/Rect[170.6 92.4 206.0 105.4]/Border[0 0 0]/Dest[240 0 R/XYZ null 277 0]>>endobj
|
||||
102 0 obj<</Subtype/Link/Rect[144.0 79.2 170.6 92.2]/Border[0 0 0]/Dest[240 0 R/XYZ null 205 0]>>endobj
|
||||
103 0 obj<</Subtype/Link/Rect[170.6 79.2 238.4 92.2]/Border[0 0 0]/Dest[240 0 R/XYZ null 205 0]>>endobj
|
||||
104 0 obj<</Subtype/Link/Rect[108.0 66.0 126.3 79.0]/Border[0 0 0]/Dest[243 0 R/XYZ null 769 0]>>endobj
|
||||
105 0 obj<</Subtype/Link/Rect[126.3 66.0 170.9 79.0]/Border[0 0 0]/Dest[243 0 R/XYZ null 769 0]>>endobj
|
||||
106 0 obj[10 0 R
|
||||
11 0 R
|
||||
12 0 R
|
||||
13 0 R
|
||||
14 0 R
|
||||
15 0 R
|
||||
16 0 R
|
||||
17 0 R
|
||||
18 0 R
|
||||
19 0 R
|
||||
20 0 R
|
||||
21 0 R
|
||||
22 0 R
|
||||
23 0 R
|
||||
24 0 R
|
||||
25 0 R
|
||||
26 0 R
|
||||
27 0 R
|
||||
28 0 R
|
||||
29 0 R
|
||||
30 0 R
|
||||
31 0 R
|
||||
32 0 R
|
||||
33 0 R
|
||||
34 0 R
|
||||
35 0 R
|
||||
36 0 R
|
||||
37 0 R
|
||||
38 0 R
|
||||
39 0 R
|
||||
40 0 R
|
||||
41 0 R
|
||||
42 0 R
|
||||
43 0 R
|
||||
44 0 R
|
||||
45 0 R
|
||||
46 0 R
|
||||
47 0 R
|
||||
48 0 R
|
||||
49 0 R
|
||||
50 0 R
|
||||
51 0 R
|
||||
52 0 R
|
||||
53 0 R
|
||||
54 0 R
|
||||
55 0 R
|
||||
56 0 R
|
||||
57 0 R
|
||||
58 0 R
|
||||
59 0 R
|
||||
60 0 R
|
||||
61 0 R
|
||||
62 0 R
|
||||
63 0 R
|
||||
64 0 R
|
||||
65 0 R
|
||||
66 0 R
|
||||
67 0 R
|
||||
68 0 R
|
||||
69 0 R
|
||||
70 0 R
|
||||
71 0 R
|
||||
72 0 R
|
||||
73 0 R
|
||||
74 0 R
|
||||
75 0 R
|
||||
76 0 R
|
||||
77 0 R
|
||||
78 0 R
|
||||
79 0 R
|
||||
80 0 R
|
||||
81 0 R
|
||||
82 0 R
|
||||
83 0 R
|
||||
84 0 R
|
||||
85 0 R
|
||||
86 0 R
|
||||
87 0 R
|
||||
88 0 R
|
||||
89 0 R
|
||||
90 0 R
|
||||
91 0 R
|
||||
92 0 R
|
||||
93 0 R
|
||||
94 0 R
|
||||
95 0 R
|
||||
96 0 R
|
||||
97 0 R
|
||||
98 0 R
|
||||
99 0 R
|
||||
100 0 R
|
||||
101 0 R
|
||||
102 0 R
|
||||
103 0 R
|
||||
104 0 R
|
||||
105 0 R
|
||||
]endobj
|
||||
107 0 obj<</Subtype/Link/Rect[108.0 673.2 134.6 686.2]/Border[0 0 0]/Dest[243 0 R/XYZ null 699 0]>>endobj
|
||||
108 0 obj<</Subtype/Link/Rect[134.6 673.2 170.0 686.2]/Border[0 0 0]/Dest[243 0 R/XYZ null 699 0]>>endobj
|
||||
109 0 obj<</Subtype/Link/Rect[108.0 660.0 134.6 673.0]/Border[0 0 0]/Dest[243 0 R/XYZ null 627 0]>>endobj
|
||||
110 0 obj<</Subtype/Link/Rect[134.6 660.0 202.4 673.0]/Border[0 0 0]/Dest[243 0 R/XYZ null 627 0]>>endobj
|
||||
111 0 obj<</Subtype/Link/Rect[72.0 646.8 90.3 659.8]/Border[0 0 0]/Dest[243 0 R/XYZ null 469 0]>>endobj
|
||||
112 0 obj<</Subtype/Link/Rect[90.3 646.8 123.3 659.8]/Border[0 0 0]/Dest[243 0 R/XYZ null 469 0]>>endobj
|
||||
113 0 obj<</Subtype/Link/Rect[108.0 633.6 134.6 646.6]/Border[0 0 0]/Dest[243 0 R/XYZ null 398 0]>>endobj
|
||||
114 0 obj<</Subtype/Link/Rect[134.6 633.6 170.0 646.6]/Border[0 0 0]/Dest[243 0 R/XYZ null 398 0]>>endobj
|
||||
115 0 obj<</Subtype/Link/Rect[108.0 620.4 134.6 633.4]/Border[0 0 0]/Dest[243 0 R/XYZ null 339 0]>>endobj
|
||||
116 0 obj<</Subtype/Link/Rect[134.6 620.4 202.4 633.4]/Border[0 0 0]/Dest[243 0 R/XYZ null 339 0]>>endobj
|
||||
117 0 obj<</Subtype/Link/Rect[72.0 607.2 90.3 620.2]/Border[0 0 0]/Dest[246 0 R/XYZ null 800 0]>>endobj
|
||||
118 0 obj<</Subtype/Link/Rect[90.3 607.2 133.7 620.2]/Border[0 0 0]/Dest[246 0 R/XYZ null 800 0]>>endobj
|
||||
119 0 obj<</Subtype/Link/Rect[108.0 594.0 134.6 607.0]/Border[0 0 0]/Dest[246 0 R/XYZ null 729 0]>>endobj
|
||||
120 0 obj<</Subtype/Link/Rect[134.6 594.0 170.0 607.0]/Border[0 0 0]/Dest[246 0 R/XYZ null 729 0]>>endobj
|
||||
121 0 obj<</Subtype/Link/Rect[108.0 580.8 134.6 593.8]/Border[0 0 0]/Dest[246 0 R/XYZ null 618 0]>>endobj
|
||||
122 0 obj<</Subtype/Link/Rect[134.6 580.8 202.4 593.8]/Border[0 0 0]/Dest[246 0 R/XYZ null 618 0]>>endobj
|
||||
123 0 obj<</Subtype/Link/Rect[72.0 567.6 90.3 580.6]/Border[0 0 0]/Dest[246 0 R/XYZ null 505 0]>>endobj
|
||||
124 0 obj<</Subtype/Link/Rect[90.3 567.6 113.6 580.6]/Border[0 0 0]/Dest[246 0 R/XYZ null 505 0]>>endobj
|
||||
125 0 obj<</Subtype/Link/Rect[108.0 554.4 134.6 567.4]/Border[0 0 0]/Dest[246 0 R/XYZ null 435 0]>>endobj
|
||||
126 0 obj<</Subtype/Link/Rect[134.6 554.4 202.4 567.4]/Border[0 0 0]/Dest[246 0 R/XYZ null 435 0]>>endobj
|
||||
127 0 obj<</Subtype/Link/Rect[108.0 541.2 134.6 554.2]/Border[0 0 0]/Dest[249 0 R/XYZ null 782 0]>>endobj
|
||||
128 0 obj<</Subtype/Link/Rect[134.6 541.2 157.2 554.2]/Border[0 0 0]/Dest[249 0 R/XYZ null 782 0]>>endobj
|
||||
129 0 obj<</Subtype/Link/Rect[36.0 514.8 46.7 527.8]/Border[0 0 0]/Dest[252 0 R/XYZ null 818 0]>>endobj
|
||||
130 0 obj<</Subtype/Link/Rect[46.7 514.8 91.6 527.8]/Border[0 0 0]/Dest[252 0 R/XYZ null 818 0]>>endobj
|
||||
131 0 obj<</Subtype/Link/Rect[91.6 514.8 132.2 527.8]/Border[0 0 0]/Dest[252 0 R/XYZ null 818 0]>>endobj
|
||||
132 0 obj<</Subtype/Link/Rect[132.2 514.8 168.0 527.8]/Border[0 0 0]/Dest[252 0 R/XYZ null 818 0]>>endobj
|
||||
133 0 obj<</Subtype/Link/Rect[168.0 514.8 194.2 527.8]/Border[0 0 0]/Dest[252 0 R/XYZ null 818 0]>>endobj
|
||||
134 0 obj[107 0 R
|
||||
108 0 R
|
||||
109 0 R
|
||||
110 0 R
|
||||
111 0 R
|
||||
112 0 R
|
||||
113 0 R
|
||||
114 0 R
|
||||
115 0 R
|
||||
116 0 R
|
||||
117 0 R
|
||||
118 0 R
|
||||
119 0 R
|
||||
120 0 R
|
||||
121 0 R
|
||||
122 0 R
|
||||
123 0 R
|
||||
124 0 R
|
||||
125 0 R
|
||||
126 0 R
|
||||
127 0 R
|
||||
128 0 R
|
||||
129 0 R
|
||||
130 0 R
|
||||
131 0 R
|
||||
132 0 R
|
||||
133 0 R
|
||||
]endobj
|
||||
135 0 obj<</Dests 136 0 R>>endobj
|
||||
136 0 obj<</Kids[137 0 R]>>endobj
|
||||
137 0 obj<</Limits[(1)(8)]/Names[(1)138 0 R(1_1)139 0 R(1_2)140 0 R(1_3)141 0 R(2)142 0 R(2_1)143 0 R(2_2)144 0 R(3)145 0 R(3_1)146 0 R(3_2)147 0 R(3_3)148 0 R(4)149 0 R(4_1)150 0 R(4_2)151 0 R(4_3)152 0 R(4_4)153 0 R(5)154 0 R(5_1)155 0 R(5_2)156 0 R(5_3)157 0 R(5_4)158 0 R(6)159 0 R(6_1)160 0 R(6_2)161 0 R(7)162 0 R(7_1)163 0 R(7_1_1)164 0 R(7_1_2)165 0 R(7_2)166 0 R(7_2_1)167 0 R(7_2_2)168 0 R(7_3)169 0 R(7_3_1)170 0 R(7_3_2)171 0 R(7_4)172 0 R(7_4_1)173 0 R(7_4_2)174 0 R(7_5)175 0 R(7_5_1)176 0 R(7_5_2)177 0 R(7_6)178 0 R(7_6_1)179 0 R(7_6_2)180 0 R(7_7)181 0 R(7_7_1)182 0 R(7_7_2)183 0 R(7_8)184 0 R(7_8_1)185 0 R(7_8_2)186 0 R(7_9)187 0 R(7_9_1)188 0 R(7_9_2)189 0 R(8)190 0 R]>>endobj
|
||||
138 0 obj<</D[198 0 R/XYZ null 818 null]>>endobj
|
||||
139 0 obj<</D[198 0 R/XYZ null 737 null]>>endobj
|
||||
140 0 obj<</D[198 0 R/XYZ null 658 null]>>endobj
|
||||
141 0 obj<</D[198 0 R/XYZ null 434 null]>>endobj
|
||||
142 0 obj<</D[204 0 R/XYZ null 818 null]>>endobj
|
||||
143 0 obj<</D[204 0 R/XYZ null 737 null]>>endobj
|
||||
144 0 obj<</D[204 0 R/XYZ null 540 null]>>endobj
|
||||
145 0 obj<</D[210 0 R/XYZ null 818 null]>>endobj
|
||||
146 0 obj<</D[210 0 R/XYZ null 737 null]>>endobj
|
||||
147 0 obj<</D[210 0 R/XYZ null 645 null]>>endobj
|
||||
148 0 obj<</D[210 0 R/XYZ null 579 null]>>endobj
|
||||
149 0 obj<</D[216 0 R/XYZ null 818 null]>>endobj
|
||||
150 0 obj<</D[216 0 R/XYZ null 624 null]>>endobj
|
||||
151 0 obj<</D[216 0 R/XYZ null 400 null]>>endobj
|
||||
152 0 obj<</D[216 0 R/XYZ null 268 null]>>endobj
|
||||
153 0 obj<</D[219 0 R/XYZ null 800 null]>>endobj
|
||||
154 0 obj<</D[222 0 R/XYZ null 818 null]>>endobj
|
||||
155 0 obj<</D[222 0 R/XYZ null 737 null]>>endobj
|
||||
156 0 obj<</D[222 0 R/XYZ null 309 null]>>endobj
|
||||
157 0 obj<</D[222 0 R/XYZ null 230 null]>>endobj
|
||||
158 0 obj<</D[225 0 R/XYZ null 800 null]>>endobj
|
||||
159 0 obj<</D[228 0 R/XYZ null 818 null]>>endobj
|
||||
160 0 obj<</D[228 0 R/XYZ null 737 null]>>endobj
|
||||
161 0 obj<</D[228 0 R/XYZ null 434 null]>>endobj
|
||||
162 0 obj<</D[234 0 R/XYZ null 818 null]>>endobj
|
||||
163 0 obj<</D[234 0 R/XYZ null 717 null]>>endobj
|
||||
164 0 obj<</D[234 0 R/XYZ null 647 null]>>endobj
|
||||
165 0 obj<</D[234 0 R/XYZ null 561 null]>>endobj
|
||||
166 0 obj<</D[237 0 R/XYZ null 721 null]>>endobj
|
||||
167 0 obj<</D[237 0 R/XYZ null 651 null]>>endobj
|
||||
168 0 obj<</D[237 0 R/XYZ null 526 null]>>endobj
|
||||
169 0 obj<</D[237 0 R/XYZ null 323 null]>>endobj
|
||||
170 0 obj<</D[237 0 R/XYZ null 253 null]>>endobj
|
||||
171 0 obj<</D[237 0 R/XYZ null 181 null]>>endobj
|
||||
172 0 obj<</D[240 0 R/XYZ null 648 null]>>endobj
|
||||
173 0 obj<</D[240 0 R/XYZ null 578 null]>>endobj
|
||||
174 0 obj<</D[240 0 R/XYZ null 440 null]>>endobj
|
||||
175 0 obj<</D[240 0 R/XYZ null 348 null]>>endobj
|
||||
176 0 obj<</D[240 0 R/XYZ null 277 null]>>endobj
|
||||
177 0 obj<</D[240 0 R/XYZ null 205 null]>>endobj
|
||||
178 0 obj<</D[243 0 R/XYZ null 769 null]>>endobj
|
||||
179 0 obj<</D[243 0 R/XYZ null 699 null]>>endobj
|
||||
180 0 obj<</D[243 0 R/XYZ null 627 null]>>endobj
|
||||
181 0 obj<</D[243 0 R/XYZ null 469 null]>>endobj
|
||||
182 0 obj<</D[243 0 R/XYZ null 398 null]>>endobj
|
||||
183 0 obj<</D[243 0 R/XYZ null 339 null]>>endobj
|
||||
184 0 obj<</D[246 0 R/XYZ null 800 null]>>endobj
|
||||
185 0 obj<</D[246 0 R/XYZ null 729 null]>>endobj
|
||||
186 0 obj<</D[246 0 R/XYZ null 618 null]>>endobj
|
||||
187 0 obj<</D[246 0 R/XYZ null 505 null]>>endobj
|
||||
188 0 obj<</D[246 0 R/XYZ null 435 null]>>endobj
|
||||
189 0 obj<</D[249 0 R/XYZ null 782 null]>>endobj
|
||||
190 0 obj<</D[252 0 R/XYZ null 818 null]>>endobj
|
||||
191 0 obj<</Type/Pages/MediaBox[0 0 595 792]/Count 24/Kids[192 0 R
|
||||
195 0 R
|
||||
258 0 R
|
||||
261 0 R
|
||||
198 0 R
|
||||
201 0 R
|
||||
204 0 R
|
||||
207 0 R
|
||||
210 0 R
|
||||
213 0 R
|
||||
216 0 R
|
||||
219 0 R
|
||||
222 0 R
|
||||
225 0 R
|
||||
228 0 R
|
||||
231 0 R
|
||||
234 0 R
|
||||
237 0 R
|
||||
240 0 R
|
||||
243 0 R
|
||||
246 0 R
|
||||
249 0 R
|
||||
252 0 R
|
||||
255 0 R
|
||||
]>>endobj
|
||||
192 0 obj<</Type/Page/Parent 191 0 R/Contents 193 0 R/Resources<</ProcSet[/PDF/Text/ImageB/ImageC/ImageI]/Font<</F4 4 0 R/F8 7 0 R/F9 8 0 R>>>>>>endobj
|
||||
193 0 obj<</Length 194 0 R/Filter/FlateDecode>>stream
|
||||
xÚí�ßoÜ8’Ç¥nõKždOú�n§�;àâ´wfŠmí](IîápÁNfn³3·™Ìö¿¿þåný ¥ª"%Q^s€Aâ�n~Äâ·ŠdQý××bµùïZ|{#Þ¾þË‹;ù"–/þ*Þ®¾»úv÷�oß½»Z‰ïÞ_݈››ë«Û]�oî³ÿ|óñMúowbý¯«]y»+ïvåý®ÜïÊwåÿõæ£øúå÷ÏoþCܾ½~óïb}}ýæîÅøøð"šž¹ÌŠ|¸Y,gÛ²ùÃâöaì\ò~qzªrv~ù0N.ys¡F*À-nGÆ%oÚ˜Ëùe<.<Ôív\÷¹ø‹Øq®»Ðã•óµÃ\7\*›æÎŒ•Ý1³Ìu/<óòMìWváY)þ¥S\7žµ2Y;Ã%…g³\:Âe¬v‡Ì—¼ð¬ÿÕà\YèuQ¾˜ëÎë¨Lâ!¹®½ÎŠ¿ŒË²Z·±6åÕ \2ô<ÁÀI!,——½sõ‚Ń`qÀ`X0pZ2øâãÀò¼eO\�û-3Íæêk÷Áµòz/“¸>x”iç\©7HyÙ1WÃEEp_áYÚc�B†vÀH4ƒ:Åè\™7hYwÅË…œb0‡Ìñb0ÏE{"—Ëó;àpy�u®Ôs¢¬-sÉÐ
|
||||
®‰e®•çH™[åJ=gJl‘Ë+D91Wä9TÖÖ¸2—°Z¥Æ'¨¨F(˜¨FiàµË•¸†Õ2`0>�G
|
||||
ŒPã1ÎÇ%]ÄjŒëaŒ�˜a0>—ŒšaÐßp��/¯¶ån{ñ¡Ûƒ^†Ë?UŸäÛ{�
|
||||
t?\~CÒ¿¼¿èfÀ ëá:o]*Ý -
|
||||
¸VÝUqÔÖÃzèp¸éÇ’›¼fs±C
|
||||
Zº8“lÊåâ†ôôÜŒµdˆ™\Ìáb¥Ss†,`r±yn6$cÈ|WÒ�¶[²%‹+ìË�Þ,´"õ`WÃ$í�“l°fp‰Þ¦?ó* se`‘Á|:Yä};W$…±r4s
|
||||
„E›R¹’Œ�cŠ1‘K…E›Ó¸2+’¹0°·ðz™[-©‘!‚µHÞ2éö՜•XgŒÊÊàÃÁ’jø±}.Bb<—4ÒLKÆ7D=:¹öåÛÁÊ
|
||||
e’wT×Á†Ìv2¹h“aŽåІrÈ<Qž`¹f8Í;,‚gˆ`n†ÝY!E—8®•VHèI€ãr@iÒ᣸Ò�=2CÁÖ.¼yç'a3Wè†hP´~‚àJù�Ùp·sE®ˆeÀ–í\¡#OêOÐÊ•º5\È›´rEŽ
|
||||
Ò‡Åm\¡cÃ…|Òó®Ì—LëRЕ87\¸(qÒÂ%›]h)‹¹¤ƒÃ…›óËF®ÔÁáÂm#�\H•÷{ÅBYѤ‘+t(2$*GVå{ÆBM�uR僾¹r’
|
||||
Wå×½s!qÚÀåÀÞÛ'z®ÔE‘GZ¬åE퀖Z.á¨jàLi¦ã’®ªnêOu\)-4,{²Óß*Æþøs8<Ó¤¤Ê)ÖϯðV5Gq͵\²ôp£¦„V¢k�5\‚k4rMµ\‡�)êÆqHüÎô
|
||||
p\žž
|
||||
ê•áÃM�¶$àL¯%’k©åÊ
|
||||
ϰfˆ™%�šˆÎ«™+Ðrímor„‰%¥Ÿ¨¹Ñy5sMô\'�”Uú™#8\b¹�KÁuÒöo†¥�U\5†jášk¹N"QöJìCúÚ+ÀsMõ\Ñã#
|
||||
)‹ï+ˆ@^k—Bù.OÏ•~WF1CÄD T\!Ñ[¹–Z®ýgÍö?ÂoÙµ
|
||||
ÛTÁ%©fØÊè¹V{ Q?C5Únó\)Õ[¹|=×þÈ˃)ˆ@öÊ1–kz¬äÚÇuç!Õ+Or,×,|”'%WA¤(«T�³' ÊÆÏ=>5WÂZ¥¶†ˆ³WF6Ãf®´„S㒬͒§k@”�IŽç’�f¡æ:ši³$Ãõˆkå€Àµëx çJX{v8¡¢l,)\pø
|
||||
—díÙµö²ÆÅH_læÊ¢ á:t‘¸g¡º4Ù˜ä®ü ô:.à8%(“šlÌh\¥×qEœñJQžh²±¤q”^Çræ—D={ࢸJ¯áJyg!F²�mLˆ\¥×pE¼Íþ¶ç?-sIÆôjåÚ+½†+äÎD˜‡$ÙXR¹öJ¯æÊ˜§ Æ1io#§rí•^Íz30‹¤Ê\czµsí”^Í%˜™;ã˜�Et®�uGúuå‚aˆm·.q±•˱•‚k×{¡âÚÛ½d„ÑM DQ±úÑÅEñË\§NT¹Ä^“ÝWˆ€XYe®eñÑT¹@Ãõ8P„Óì6̬ȅس™jLb^TÔI…+Óp%žŒnˆ B€ ‡s�ILë©îÖ¹V�}Z‰ö´%.Á‘�ÒѰ,ø¢W¤ä’ǬȆ(v„èPkA`YåJ•\ɱrB�}: | ||||