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
|
||||
-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>
|
||||
+922
-286
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
-111
@@ -1,111 +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
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# Programs...
|
||||
#
|
||||
|
||||
AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CP = @CP@
|
||||
HTMLDOC = @HTMLDOC@
|
||||
LN = /bin/ln -sf
|
||||
MKDIR = @MKDIR@ -p
|
||||
NROFF = @GROFF@ -T ascii
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@ -f
|
||||
SHELL = /bin/sh
|
||||
|
||||
#
|
||||
# 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)
|
||||
IMGLIBS = @IMGLIBS@ $(LIBS) -lm
|
||||
LDFLAGS = @LDFLAGS@ $(OPTIM)
|
||||
LIBS = @LIBS@ -L../cups -lcups
|
||||
OPTIM = @OPTIM@
|
||||
OPTIONS =
|
||||
|
||||
#
|
||||
# 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)/cups
|
||||
LIBDIR = $(libdir)
|
||||
LOCALEDIR = @CUPS_LOCALEDIR@
|
||||
MANDIR = @mandir@
|
||||
SBINDIR = @sbindir@
|
||||
SERVERROOT = @CUPS_SERVERROOT@
|
||||
|
||||
#
|
||||
# Rules...
|
||||
#
|
||||
|
||||
.SUFFIXES: .a .c .h .1 .2 .3 .4 .5 .6 .7 .8 .o .z
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
.1.z .2.z .3.z .4.z .5.z .6.z .7.z .8.z:
|
||||
$(NROFF) -man $< >t
|
||||
pack -f t
|
||||
mv t.z $@
|
||||
|
||||
#
|
||||
# End of "$Id$"
|
||||
#
|
||||
-68
@@ -1,68 +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
|
||||
# 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
|
||||
#
|
||||
|
||||
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\
|
||||
(cd $$dir; make);\
|
||||
done
|
||||
|
||||
#
|
||||
# Remove object and target files...
|
||||
#
|
||||
|
||||
clean:
|
||||
for dir in $(DIRS); do\
|
||||
(cd $$dir; make clean);\
|
||||
done
|
||||
|
||||
#
|
||||
# Install object and target files...
|
||||
#
|
||||
|
||||
install:
|
||||
for dir in $(DIRS); do\
|
||||
(cd $$dir; make install);\
|
||||
done
|
||||
(cd conf; make install)
|
||||
(cd data; make install)
|
||||
(cd doc; make install)
|
||||
(cd fonts; make install)
|
||||
(cd ppd; make install)
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>README - Common UNIX Printing System</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H1>README - CUPS v1.0b3</H1>
|
||||
|
||||
<H2>Contents</H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="#intro">Introduction</A>
|
||||
<LI><A HREF="#require">Requirements</A>
|
||||
<LI><A HREF="#use">Using CUPS</A>
|
||||
<LI><A HREF="#known">Known Problems</A>
|
||||
<LI><A HREF="#report">Reporting Problems</A>
|
||||
<LI><A HREF="#resources">Other Resources</A>
|
||||
<LI><A HREF="#legal">Legal Stuff</A>
|
||||
</UL>
|
||||
|
||||
<H2><A NAME="intro">Introduction</A></H2>
|
||||
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. It has been developed by Easy Software
|
||||
Products to promote a standard printing solution for all UNIX vendors
|
||||
and users. CUPS provides the System V and Berkeley command-line
|
||||
interfaces.
|
||||
|
||||
<P>CUPS uses the Internet Printing Protocol (IETF-IPP) as the basis
|
||||
for managing print jobs and queues. The Line Printer Daemon (LPD,
|
||||
RFC1179), Server Message Block (SMB), and AppSocket protocols are also
|
||||
supported with reduced functionality.
|
||||
|
||||
<P>CUPS adds network printer browsing and PostScript Printer
|
||||
Description ("PPD")-based printing options to support real
|
||||
world applications under UNIX.
|
||||
|
||||
<P>CUPS also includes a customized version of GNU GhostScript (currently
|
||||
based off GNU GhostScript 4.03) and an image file RIP that can be used to
|
||||
support non-PostScript printers.
|
||||
|
||||
<H2><A NAME="require">Requirements</A></H2>
|
||||
|
||||
You'll need an ANSI C compiler to build CUPS on your system. As its name
|
||||
implies, CUPS is designed to run on the UNIX operating system, however
|
||||
the CUPS interface library and most of the filters and backends supplied
|
||||
with CUPS should also run under Microsoft® Windows®.
|
||||
|
||||
<P>For the image file filters you'll need the JPEG, PNG, TIFF, and ZLIB
|
||||
libraries. CUPS will build without these, but with reduced functionality.
|
||||
|
||||
<P>If you make changes to the man pages you'll need GNU groff or another
|
||||
nroff-like package.
|
||||
|
||||
<P>The documentation is formatted using the HTMLDOC software (again, not
|
||||
needed unless you make changes.)
|
||||
|
||||
<H2><A NAME="use">Using CUPS</A></H2>
|
||||
|
||||
<P>Pre-compiled binary distributions are available for CUPS from our
|
||||
web site at
|
||||
<A HREF="http://www.cups.org/software.html">http://www.cups.org/software.html</A>.
|
||||
If you'd like to build CUPS from the source, please read the Software
|
||||
Administrator's Manual.
|
||||
|
||||
<P>Once you have installed CUPS, the Software Administrator's Manual and
|
||||
Software User's Manual are excellent places to start setting things up.
|
||||
|
||||
<H2><A NAME="known">Known Problems</A></H2>
|
||||
|
||||
The following known problems are being worked on and should be resolved for
|
||||
the fourth beta release of CUPS:
|
||||
|
||||
<UL>
|
||||
|
||||
<LI>Documentation is not completed.
|
||||
|
||||
<LI>The lpc command currently only supports the help and status
|
||||
commands.
|
||||
|
||||
<LI>The class and job CGIs are currently not provided.
|
||||
|
||||
</UL>
|
||||
|
||||
CUPS has been built and tested on the following operating systems:
|
||||
|
||||
<UL>
|
||||
<LI>Digital UNIX 4.0d
|
||||
<LI>HP-UX 10.20 and 11.0
|
||||
<LI>IRIX 5.3, 6.2, 6.5.3
|
||||
<LI>Linux (RedHat 5.2)
|
||||
<LI>Solaris 2.5.1, 2.6, 2.7 (aka 7)
|
||||
</UL>
|
||||
|
||||
The client libraries and filters have been successfully compiled under
|
||||
Microsoft Windows using Visual C++ 6.0.
|
||||
|
||||
<H2><A NAME="report">Reporting Problems</A></H2>
|
||||
|
||||
If you have problems, please send an email to
|
||||
<A HREF="mailto:cups-support@cups.org">cups-support@cups.org</A>. Include
|
||||
your operating system and version, compiler and version, and any errors
|
||||
or problems you've run into.
|
||||
|
||||
<H2><A NAME="resources">Other Resources</A></H2>
|
||||
|
||||
See the CUPS web site at "http://www.cups.org" for other site links.
|
||||
|
||||
<P>You can subscribe to the CUPS mailing list by sending a message containing
|
||||
"subscribe cups" to <A HREF="mailto:majordomo@cups.org">majordomo@cups.org</A>.
|
||||
This list is provided to discuss problems, questions, and improvements to
|
||||
the CUPS software. New releases of CUPS are announced to this list as well.
|
||||
|
||||
<H2><A NAME="legal">Legal Stuff</A></H2>
|
||||
|
||||
CUPS is Copyright 1993-1999 by Easy Software Products. CUPS, the CUPS logo,
|
||||
and the Common UNIX Printing System are the trademark property of Easy Software
|
||||
Products.
|
||||
|
||||
<P>CUPS is provided under the terms of the
|
||||
<A HREF="LICENSE.html">GNU General Public License</A>
|
||||
which is located in the files "LICENSE.html" and "LICENSE.txt". For commercial
|
||||
support and "binary-only" licensing information, please contact:
|
||||
|
||||
<UL>
|
||||
Attn: CUPS Licensing Information
|
||||
<BR>Easy Software Products
|
||||
<BR>44141 Airport View Drive, Suite 204
|
||||
<BR>Hollywood, Maryland 20636-3111 USA
|
||||
|
||||
<P>Voice: +1.301.373.9603
|
||||
<BR>Email: <A HREF="mailto:cups-info@cups.org">cups-info@cups.org</A>
|
||||
<BR>WWW: <A HREF="http://www.cups.org">http://www.cups.org</A>
|
||||
</UL>
|
||||
|
||||
<P>If you're interested in a complete, commercial printing solution for UNIX,
|
||||
check out our ESP Print software at <A HREF="http://www.easysw.com/print.html">
|
||||
http://www.easysw.com/print.html</A>.
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
+25
-101
@@ -1,113 +1,37 @@
|
||||
README - CUPS v1.0b3
|
||||
README.txt - 2016-03-15
|
||||
-----------------------
|
||||
|
||||
Contents
|
||||
This directory contains an automated build and test environment for CUPS.
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Using CUPS
|
||||
* Known Problems
|
||||
* Reporting Problems
|
||||
* Other Resources
|
||||
* Legal Stuff
|
||||
|
||||
Introduction
|
||||
ENVIRONMENT
|
||||
|
||||
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.
|
||||
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 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.
|
||||
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 adds network printer browsing and PostScript Printer Description
|
||||
("PPD")-based printing options to support real world applications under
|
||||
UNIX.
|
||||
|
||||
CUPS also includes a customized version of GNU GhostScript (currently based
|
||||
off GNU GhostScript 4.03) and an image file RIP that can be used to support
|
||||
non-PostScript printers.
|
||||
SCRIPTS
|
||||
|
||||
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:
|
||||
|
||||
You'll need an ANSI C compiler to build CUPS on your system. As its name
|
||||
implies, CUPS is designed to run on the UNIX operating system, however the
|
||||
CUPS interface library and most of the filters and backends supplied with
|
||||
CUPS should also run under Microsoft® Windows®.
|
||||
0 0 * * 0 /path/to/build.sh --update --quiet clean all
|
||||
0 0 * * 1-6 /path/to/build.sh --update --quiet
|
||||
|
||||
For the image file filters you'll need the JPEG, PNG, TIFF, and ZLIB
|
||||
libraries. CUPS will build without these, but with reduced functionality.
|
||||
The "--update" option tells build.sh to do an "git pull" prior to building.
|
||||
|
||||
If you make changes to the man pages you'll need GNU groff or another
|
||||
nroff-like package.
|
||||
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.
|
||||
|
||||
The documentation is formatted using the HTMLDOC software (again, not needed
|
||||
unless you make changes.)
|
||||
|
||||
Using CUPS
|
||||
|
||||
Pre-compiled binary distributions are available for CUPS from our web site
|
||||
at http://www.cups.org/software.html. If you'd like to build CUPS from the
|
||||
source, please read the Software Administrator's Manual.
|
||||
|
||||
Once you have installed CUPS, the Software Administrator's Manual and
|
||||
Software User's Manual are excellent places to start setting things up.
|
||||
|
||||
Known Problems
|
||||
|
||||
The following known problems are being worked on and should be resolved for
|
||||
the fourth beta release of CUPS:
|
||||
|
||||
* Documentation is not completed.
|
||||
* The lpc command currently only supports the help and status commands.
|
||||
* The class and job CGIs are currently not provided.
|
||||
|
||||
CUPS has been built and tested on the following operating systems:
|
||||
|
||||
* Digital UNIX 4.0d
|
||||
* HP-UX 10.20 and 11.0
|
||||
* IRIX 5.3, 6.2, 6.5.3
|
||||
* Linux (RedHat 5.2)
|
||||
* Solaris 2.5.1, 2.6, 2.7 (aka 7)
|
||||
|
||||
The client libraries and filters have been successfully compiled under
|
||||
Microsoft Windows using Visual C++ 6.0.
|
||||
|
||||
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.
|
||||
|
||||
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". For commercial
|
||||
support and "binary-only" 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
|
||||
|
||||
If you're interested in a complete, commercial printing solution for UNIX,
|
||||
check out our ESP Print software at http://www.easysw.com/print.html.
|
||||
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,98 +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
|
||||
# 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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
TARGETS = lpd parallel serial smb socket
|
||||
OBJS = lpd.o parallel.o serial.o smb.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
|
||||
|
||||
#
|
||||
# lpd
|
||||
#
|
||||
|
||||
lpd: lpd.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o lpd lpd.o $(LIBS)
|
||||
|
||||
lpd.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# parallel
|
||||
#
|
||||
|
||||
parallel: parallel.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o parallel parallel.o $(LIBS)
|
||||
|
||||
parallel.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# serial
|
||||
#
|
||||
|
||||
serial: serial.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o serial serial.o $(LIBS)
|
||||
|
||||
serial.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# smb
|
||||
#
|
||||
|
||||
smb: smb.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o smb smb.o $(LIBS)
|
||||
|
||||
smb.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# socket
|
||||
#
|
||||
|
||||
socket: socket.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o socket socket.o $(LIBS)
|
||||
|
||||
socket.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
-394
@@ -1,394 +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
|
||||
* 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:
|
||||
*
|
||||
* 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(tmpnam(filename), "w")) == NULL)
|
||||
{
|
||||
perror("lpd: unable to create temporary file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
|
||||
if (fwrite(buffer, 1, bytes, fp) < bytes)
|
||||
{
|
||||
perror("lpd: unable to write to temporary file");
|
||||
fclose(fp);
|
||||
unlink(filename);
|
||||
return (1);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
strcpy(filename, argv[6]);
|
||||
|
||||
/*
|
||||
* Extract the hostname and printer name from the URI...
|
||||
*/
|
||||
|
||||
httpSeparate(argv[0], method, username, hostname, &port, resource);
|
||||
|
||||
/*
|
||||
* Queue the job...
|
||||
*/
|
||||
|
||||
status = lpd_queue(hostname, resource + 1, filename,
|
||||
argv[2] /* user */, atoi(argv[4]) /* copies */);
|
||||
|
||||
/*
|
||||
* 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 = vsprintf(buf, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
fprintf(stderr, "lpd: 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, "lpd: 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("lpd: unable to stat print file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
if ((fp = fopen(filename, "rb")) == NULL)
|
||||
{
|
||||
perror("lpd: 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));
|
||||
if (strchr(localhost, '.') != NULL)
|
||||
*strchr(localhost, '.') = '\0';
|
||||
|
||||
sprintf(control, "H%s\nP%s\n", localhost, user);
|
||||
cptr = control + strlen(control);
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
sprintf(cptr, "ldfA%03.3d%s\n", getpid() % 1000, localhost);
|
||||
cptr += strlen(cptr);
|
||||
copies --;
|
||||
}
|
||||
|
||||
sprintf(cptr, "UdfA%03.3d%s\nNdfA%03.3d%s\n",
|
||||
getpid() % 1000, localhost,
|
||||
getpid() % 1000, localhost);
|
||||
|
||||
fprintf(stderr, "lpd: Control file is:\n%s", control);
|
||||
|
||||
lpd_command(fd, "\002%d cfA%03.3d%s\n", strlen(control), getpid() % 1000,
|
||||
localhost);
|
||||
|
||||
fprintf(stderr, "lpd: 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("lpd: Control file sent successfully\n", stderr);
|
||||
|
||||
lpd_command(fd, "\003%d dfA%03.3d%s\n", filestats.st_size,
|
||||
getpid() % 1000, localhost);
|
||||
|
||||
fprintf(stderr, "lpd: 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("lpd: 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,179 +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
|
||||
* 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:
|
||||
*
|
||||
* 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 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;
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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...
|
||||
*/
|
||||
|
||||
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,297 +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
|
||||
* 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:
|
||||
*
|
||||
* 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 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;
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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...
|
||||
*/
|
||||
|
||||
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,66 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Server Message Block 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
|
||||
* 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:
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.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 */
|
||||
{
|
||||
if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
fputs("ERROR: Backend not implemented yet!\n", stderr);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,232 +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 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;
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
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...
|
||||
*/
|
||||
|
||||
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 and input file and return...
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
if (fp != stdin)
|
||||
fclose(fp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,91 +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
|
||||
# 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
|
||||
#
|
||||
|
||||
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) lpr lprm $(BINDIR)
|
||||
$(CP) lpc $(SBINDIR)
|
||||
|
||||
#
|
||||
# lpc
|
||||
#
|
||||
|
||||
lpc: lpc.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
|
||||
|
||||
lpc.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# lpq
|
||||
#
|
||||
|
||||
lpq: lpq.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
|
||||
|
||||
lpq.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# lpr
|
||||
#
|
||||
|
||||
lpr: lpr.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
|
||||
|
||||
lpr.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# lprm
|
||||
#
|
||||
|
||||
lprm: lprm.o ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
|
||||
|
||||
lprm.o: ../cups/cups.h ../Makedefs
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
@@ -1,452 +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("localhost", 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 (gets(line) != NULL)
|
||||
{
|
||||
/*
|
||||
* 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);
|
||||
|
||||
sprintf(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
|
||||
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,366 +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:
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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 *, char *, char *, int, 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 */
|
||||
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("localhost", ippPort());
|
||||
|
||||
/*
|
||||
* Check for command-line options...
|
||||
*/
|
||||
|
||||
dest = NULL;
|
||||
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 printers.
|
||||
*/
|
||||
|
||||
static int /* O - Number of jobs in queue */
|
||||
show_jobs(http_t *http, /* I - HTTP connection to server */
|
||||
char *dest, /* I - Destination */
|
||||
char *user, /* I - User */
|
||||
int id, /* I - Job ID */
|
||||
int longstatus) /* I - 1 if long report desired */
|
||||
{
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char *jobdest, /* Pointer into job-printer-uri */
|
||||
*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 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
|
||||
{
|
||||
sprintf(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%-33s%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(" %-5d%-7.7s%-7d%-19s%d bytes\n", jobpriority, jobuser, jobid,
|
||||
jobname, jobsize);
|
||||
}
|
||||
if (attr == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
return (jobcount);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,232 +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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cups/cups.h>
|
||||
|
||||
|
||||
/*
|
||||
* '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 */
|
||||
char *dest; /* Destination printer */
|
||||
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? */
|
||||
char tempfile[1024]; /* Temporary file for printing from stdin */
|
||||
char buffer[8192]; /* Copy buffer */
|
||||
FILE *temp; /* Temporary file pointer */
|
||||
|
||||
|
||||
silent = 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 '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 '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\'.\n", argv[i]);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
temp = fopen(tmpnam(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: stdin 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);
|
||||
|
||||
if (job_id < 1)
|
||||
{
|
||||
fprintf(stderr, "lpr: unable to print file \'%s\'.\n", argv[i]);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,198 +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
|
||||
* 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:
|
||||
*
|
||||
* 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 */
|
||||
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;
|
||||
|
||||
/*
|
||||
* Open a connection to the server...
|
||||
*/
|
||||
|
||||
if ((http = httpConnect("localhost", 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)
|
||||
{
|
||||
sprintf(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);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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)
|
||||
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,63 +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
|
||||
# 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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
#TARGETS = classes.cgi jobs.cgi printers.cgi
|
||||
TARGETS = 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
|
||||
|
||||
#
|
||||
# printers.cgi
|
||||
#
|
||||
|
||||
printers.cgi: printers.o ../Makedefs ../cups/libcups.a
|
||||
$(CC) $(LDFLAGS) -o $@ printers.o $(LIBS)
|
||||
|
||||
$(OBJS): ../Makedefs ../cups/cups.h ../cups/ipp.h ../cups/language.h
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
@@ -1,461 +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>
|
||||
|
||||
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
|
||||
setbuf(stdout, NULL);
|
||||
/*
|
||||
* 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 - Common UNIX Printing System</TITLE>\n",
|
||||
printer == NULL ? "Printers" : printer, getenv("SERVER_NAME"));
|
||||
puts("<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"/cups.css\">");
|
||||
puts("<MAP NAME=\"navbar\">");
|
||||
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,100,35\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
|
||||
puts("<AREA SHAPE=\"RECT\" COORDS=\"115,10,205,35\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
|
||||
puts("<AREA SHAPE=\"RECT\" COORDS=\"220,10,280,35\" HREF=\"/jobs\" ALT=\"Current Jobs Status\">");
|
||||
puts("<AREA SHAPE=\"RECT\" COORDS=\"295,10,470,35\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
|
||||
puts("<AREA SHAPE=\"RECT\" COORDS=\"485,10,590,35\" HREF=\"http://www.cups.org\" ALT=\"Download the Current CUPS Software\">");
|
||||
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;
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
/*
|
||||
* 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[1024]; /* 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);
|
||||
|
||||
sprintf(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, uri + 15)) != NULL)
|
||||
{
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/*
|
||||
* Display the printer entry...
|
||||
*/
|
||||
|
||||
puts("<TR>");
|
||||
|
||||
printf("<TD VALIGN=TOP><A HREF=\"/printers/%s\">%s</A></TD>\n", name, 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;
|
||||
|
||||
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);
|
||||
|
||||
attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
|
||||
"printer-uri", NULL, uri);
|
||||
|
||||
jobs = cupsDoRequest(http, request, uri + 15);
|
||||
}
|
||||
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,61 +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...
|
||||
#
|
||||
|
||||
FILES = classes.conf cupsd.conf mime.convs mime.types printers.conf
|
||||
|
||||
#
|
||||
# Make everything...
|
||||
#
|
||||
|
||||
all:
|
||||
|
||||
#
|
||||
# Clean all config and object files...
|
||||
#
|
||||
|
||||
clean:
|
||||
|
||||
#
|
||||
# Install files...
|
||||
#
|
||||
|
||||
install:
|
||||
-$(MKDIR) $(SERVERROOT)/conf
|
||||
for file in $(FILES); do \
|
||||
if test -e $(SERVERROOT)/conf/$$file ; then \
|
||||
$(CP) $$file $(SERVERROOT)/conf/$$file.N ; \
|
||||
else \
|
||||
$(CP) $$file $(SERVERROOT)/conf ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
@@ -1,72 +0,0 @@
|
||||
#
|
||||
# "$Id: classes.conf 333 1999-05-17 18:03:40Z 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
|
||||
|
||||
#
|
||||
# Printer: adds a printer to the class.
|
||||
#
|
||||
|
||||
#Printer sample
|
||||
#Printer sample@host2
|
||||
#</Class>
|
||||
|
||||
#
|
||||
# End of "$Id: classes.conf 333 1999-05-17 18:03:40Z mike $".
|
||||
#
|
||||
@@ -1,332 +0,0 @@
|
||||
#
|
||||
# "$Id: cupsd.conf 349 1999-05-21 20:53:02Z 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
|
||||
|
||||
#
|
||||
# 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 349 1999-05-21 20:53:02Z mike $".
|
||||
#
|
||||
@@ -1,62 +0,0 @@
|
||||
#
|
||||
# "$Id: mime.convs 237 1999-04-21 19:29:35Z 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 237 1999-04-21 19:29:35Z mike $".
|
||||
#
|
||||
@@ -1,123 +0,0 @@
|
||||
#
|
||||
# "$Id: mime.types 185 1999-03-24 18:38:50Z 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
|
||||
|
||||
# TODO: Add Sun Raster, Alias, SoftImage, GIMP??? files
|
||||
|
||||
image/x-sun-raster ras
|
||||
#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
|
||||
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
|
||||
application/vnd.cups-raw
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 185 1999-03-24 18:38:50Z mike $".
|
||||
#
|
||||
@@ -1,89 +0,0 @@
|
||||
#
|
||||
# "$Id: printers.conf 334 1999-05-17 18:11:26Z 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 accept new jobs.
|
||||
# Stopped - Printer is disabled but accepting new jobs.
|
||||
#
|
||||
|
||||
#State Idle
|
||||
#</Printer>
|
||||
|
||||
#
|
||||
# End of "$Id: printers.conf 334 1999-05-17 18:11:26Z 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 $".
|
||||
#
|
||||
-101
@@ -1,101 +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
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Version of software...
|
||||
*/
|
||||
|
||||
#define CUPS_SVERSION "CUPS v1.0"
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
/*
|
||||
* 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$".
|
||||
*/
|
||||
-152
@@ -1,152 +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 44145 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 Clear default debugging options and set normal optimization by
|
||||
dnl default unless the user asks for debugging specifically.
|
||||
|
||||
dnl CFLAGS="${CFLAGS:=}"
|
||||
dnl CXXFLAGS="${CXXFLAGS:=}"
|
||||
dnl OPTIM="-O"
|
||||
dnl AC_SUBST(OPTIM)
|
||||
|
||||
dnl AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
|
||||
dnl if eval "test x$enable_debug = xyes"; then
|
||||
dnl OPTIM="-g"
|
||||
dnl fi)
|
||||
|
||||
dnl Clear default debugging options and set debugging by
|
||||
dnl default unless the user asks for no debugging specifically.
|
||||
|
||||
CFLAGS="${CFLAGS:=}"
|
||||
CXXFLAGS="${CXXFLAGS:=}"
|
||||
OPTIM="-g"
|
||||
AC_SUBST(OPTIM)
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --disable-debug turn off debugging [default=no]],
|
||||
if eval "test x$disable_debug = xyes"; then
|
||||
OPTIM="-O"
|
||||
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(CP,cp)
|
||||
AC_PATH_PROG(MKDIR,mkdir)
|
||||
AC_PATH_PROG(RM,rm)
|
||||
AC_PATH_PROG(GROFF,groff)
|
||||
AC_PATH_PROG(HTMLDOC,htmldoc)
|
||||
|
||||
dnl Architecture checks...
|
||||
AC_C_BIGENDIAN
|
||||
uname=`uname`
|
||||
if test "$uname" = "IRIX64"; then
|
||||
uname=IRIX
|
||||
fi
|
||||
|
||||
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)
|
||||
AC_CHECK_LIB(socket,socket,
|
||||
if test "$uname" != "IRIX"; then
|
||||
LIBS="$LIBS -lsocket"
|
||||
else
|
||||
echo "Not using -lsocket since you are running IRIX."
|
||||
fi)
|
||||
AC_CHECK_LIB(nsl,gethostbyaddr,
|
||||
if test "$uname" != "IRIX"; then
|
||||
LIBS="$LIBS -lnsl"
|
||||
else
|
||||
echo "Not using -lnsl since you are running IRIX."
|
||||
fi)
|
||||
|
||||
IMGLIBS=""
|
||||
AC_SUBST(IMGLIBS)
|
||||
AC_CHECK_HEADER(jpeglib.h,
|
||||
AC_DEFINE(HAVE_LIBJPEG)
|
||||
IMGLIBS="$IMGLIBS -ljpeg")
|
||||
AC_CHECK_HEADER(zlib.h,
|
||||
AC_DEFINE(HAVE_LIBZ)
|
||||
IMGLIBS="$IMGLIBS -lz")
|
||||
AC_CHECK_HEADER(png.h,
|
||||
AC_DEFINE(HAVE_LIBPNG)
|
||||
IMGLIBS="$IMGLIBS -lpng")
|
||||
AC_CHECK_HEADER(tiff.h,
|
||||
AC_DEFINE(HAVE_LIBTIFF)
|
||||
IMGLIBS="$IMGLIBS -ltiff")
|
||||
|
||||
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)
|
||||
|
||||
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 Fix "prefix" variable if it hasn't been specified...
|
||||
if test "$prefix" = "NONE"; then
|
||||
prefix="/usr"
|
||||
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...
|
||||
CUPS_LOCALEDIR="$prefix/lib/locale"
|
||||
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>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
-130
@@ -1,130 +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
|
||||
# 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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
#
|
||||
# Object files...
|
||||
#
|
||||
|
||||
OBJS = emit.o filter.o http.o ipp.o language.o mark.o mime.o \
|
||||
options.o page.o ppd.o raster.o string.o type.o util.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.a testmime testppd testhttp
|
||||
|
||||
#
|
||||
# Make all targets...
|
||||
#
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
#
|
||||
# Remove object and target files...
|
||||
#
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(TARGETS)
|
||||
|
||||
#
|
||||
# Install object and target files...
|
||||
#
|
||||
|
||||
install: all
|
||||
-$(MKDIR) $(LIBDIR)
|
||||
$(CP) libcups.a $(LIBDIR)
|
||||
-$(MKDIR) $(INCLUDEDIR)/cups
|
||||
$(CP) $(HEADERS) $(INCLUDEDIR)/cups
|
||||
|
||||
#
|
||||
# libcups.a
|
||||
#
|
||||
|
||||
libcups.a: $(OBJS)
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
#
|
||||
# cups_C.h - the default POSIX locale that is compiled in.
|
||||
#
|
||||
|
||||
cups_C.h: ../locale/C/cups_C
|
||||
$(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: ppd.h ../config.h ../Makedefs
|
||||
raster.o: raster.h ../config.h ../Makedefs
|
||||
string.o: string.h ../config.h ../Makedefs
|
||||
type.o: mime.h ../config.h ../Makedefs
|
||||
util.o: cups.h http.h ipp.h ../config.h ../Makedefs
|
||||
|
||||
#
|
||||
# testhttp
|
||||
#
|
||||
|
||||
testhttp: testhttp.o libcups.a
|
||||
$(CC) $(LDFLAGS) -o $@ testhttp.o $(LIBS)
|
||||
|
||||
testhttp.o: http.h ../Makedefs
|
||||
|
||||
#
|
||||
# testmime
|
||||
#
|
||||
|
||||
testmime: testmime.o libcups.a
|
||||
$(CC) $(LDFLAGS) -o $@ testmime.o $(LIBS)
|
||||
|
||||
testmime.o: mime.h ../Makedefs
|
||||
|
||||
#
|
||||
# testppd
|
||||
#
|
||||
|
||||
testppd: testppd.o libcups.a
|
||||
$(CC) $(LDFLAGS) -o $@ testppd.o $(LIBS)
|
||||
|
||||
testppd.o: ppd.h ../Makedefs
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
-136
@@ -1,136 +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 */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* 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(char *printer, int job);
|
||||
#define cupsDoRequest(http,request,resource) cupsDoFileRequest((http),(request),(resource),NULL)
|
||||
extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
|
||||
char *resource, char *filename);
|
||||
extern int cupsGetClasses(char ***classes);
|
||||
extern char *cupsGetPPD(char *printer);
|
||||
extern char *cupsGetDefault(void);
|
||||
extern int cupsGetPrinters(char ***printers);
|
||||
extern int cupsPrintFile(char *printer, char *filename, char *title,
|
||||
int num_options, cups_option_t *options);
|
||||
|
||||
extern int cupsAddOption(char *name, char *value, int num_options,
|
||||
cups_option_t **options);
|
||||
extern void cupsFreeOptions(int num_options, cups_option_t *options);
|
||||
extern char *cupsGetOption(char *name, int num_options,
|
||||
cups_option_t *options);
|
||||
extern int cupsParseOptions(char *arg, int num_options,
|
||||
cups_option_t **options);
|
||||
extern int cupsMarkOptions(ppd_file_t *ppd, int num_options,
|
||||
cups_option_t *options);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_CUPS_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -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
|
||||
* 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
|
||||
*/
|
||||
|
||||
#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 (strcmp(((ppd_option_t *)choices[i]->option)->keyword, "PageSize") == 0 &&
|
||||
strcmp(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[7 -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$".
|
||||
*/
|
||||
-297
@@ -1,297 +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
|
||||
* 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:
|
||||
*
|
||||
* 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 */
|
||||
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;
|
||||
strcpy(temp->filter, filter);
|
||||
}
|
||||
}
|
||||
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;
|
||||
strcpy(temp->filter, filter);
|
||||
|
||||
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$".
|
||||
*/
|
||||
-1392
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
-316
@@ -1,316 +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
|
||||
* 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
|
||||
*/
|
||||
|
||||
#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 8192 /* 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, /* 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 = 0,
|
||||
HTTP_FIELD_ACCEPT_CHARSET,
|
||||
HTTP_FIELD_ACCEPT_ENCODING,
|
||||
HTTP_FIELD_ACCEPT_LANGUAGE,
|
||||
HTTP_FIELD_ACCEPT_RANGES,
|
||||
HTTP_FIELD_AGE,
|
||||
HTTP_FIELD_ALLOW,
|
||||
HTTP_FIELD_ALTERNATES,
|
||||
HTTP_FIELD_AUTHORIZATION,
|
||||
HTTP_FIELD_CACHE_CONTROL,
|
||||
HTTP_FIELD_CONNECTION,
|
||||
HTTP_FIELD_CONTENT_BASE,
|
||||
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_DERIVED_FROM,
|
||||
HTTP_FIELD_ETAG,
|
||||
HTTP_FIELD_EXPIRES,
|
||||
HTTP_FIELD_FROM,
|
||||
HTTP_FIELD_HOST,
|
||||
HTTP_FIELD_IF_MATCH,
|
||||
HTTP_FIELD_IF_MODIFIED_SINCE,
|
||||
HTTP_FIELD_IF_NONE_MATCH,
|
||||
HTTP_FIELD_IF_RANGE,
|
||||
HTTP_FIELD_IF_UNMODIFIED_SINCE,
|
||||
HTTP_FIELD_KEEP_ALIVE,
|
||||
HTTP_FIELD_LAST_MODIFIED,
|
||||
HTTP_FIELD_LINK,
|
||||
HTTP_FIELD_LOCATION,
|
||||
HTTP_FIELD_MAX_FORWARDS,
|
||||
HTTP_FIELD_MESSAGE_ID,
|
||||
HTTP_FIELD_MIME_VERSION,
|
||||
HTTP_FIELD_PRAGMA,
|
||||
HTTP_FIELD_PROXY_AUTHENTICATE,
|
||||
HTTP_FIELD_PROXY_AUTHORIZATION,
|
||||
HTTP_FIELD_PUBLIC,
|
||||
HTTP_FIELD_RANGE,
|
||||
HTTP_FIELD_REFERER,
|
||||
HTTP_FIELD_RETRY_AFTER,
|
||||
HTTP_FIELD_SERVER,
|
||||
HTTP_FIELD_TRANSFER_ENCODING,
|
||||
HTTP_FIELD_UPGRADE,
|
||||
HTTP_FIELD_URI,
|
||||
HTTP_FIELD_USER_AGENT,
|
||||
HTTP_FIELD_VARY,
|
||||
HTTP_FIELD_VIA,
|
||||
HTTP_FIELD_WARNING,
|
||||
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 */
|
||||
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)
|
||||
# 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(char *host, int port);
|
||||
extern int httpDelete(http_t *http, char *uri);
|
||||
extern void httpFlush(http_t *http);
|
||||
extern int httpGet(http_t *http, char *uri);
|
||||
extern char *httpGets(char *line, int length, http_t *http);
|
||||
extern char *httpGetDateString(time_t t);
|
||||
extern time_t httpGetDateTime(char *s);
|
||||
# define httpGetField(http,field) (http)->fields[field]
|
||||
extern int httpHead(http_t *http, char *uri);
|
||||
extern void httpInitialize(void);
|
||||
extern int httpOptions(http_t *http, char *uri);
|
||||
extern int httpPost(http_t *http, char *uri);
|
||||
extern int httpPrintf(http_t *http, const char *format, ...);
|
||||
extern int httpPut(http_t *http, char *uri);
|
||||
extern int httpRead(http_t *http, char *buffer, int length);
|
||||
extern int httpReconnect(http_t *http);
|
||||
extern void httpSeparate(char *uri, char *method, char *username,
|
||||
char *host, int *port, char *resource);
|
||||
extern void httpSetField(http_t *http, http_field_t field, char *value);
|
||||
extern char *httpStatus(http_status_t status);
|
||||
extern int httpTrace(http_t *http, char *uri);
|
||||
extern http_status_t httpUpdate(http_t *http);
|
||||
extern int httpWrite(http_t *http, char *buffer, int length);
|
||||
extern char *httpEncode64(char *out, char *in);
|
||||
extern char *httpDecode64(char *out, char *in);
|
||||
extern int httpGetLength(http_t *http);
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
#endif /* !_CUPS_HTTP_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-1458
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
-342
@@ -1,342 +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_EXTENSION,
|
||||
IPP_TAG_UNSUPPORTED = 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_TEXTLANG,
|
||||
IPP_TAG_NAMELANG,
|
||||
IPP_TAG_TEXT = 0x41,
|
||||
IPP_TAG_NAME,
|
||||
IPP_TAG_KEYWORD,
|
||||
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(ipp_uchar_t *date);
|
||||
extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group, char *name, char value);
|
||||
extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group, char *name, int num_values, char *values);
|
||||
extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group, char *name, ipp_uchar_t *value);
|
||||
extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, char *name, int value);
|
||||
extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, char *name, int num_values, int *values);
|
||||
extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group, char *name, int lower, int upper);
|
||||
extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group, char *name, int num_values, int *lower, int *upper);
|
||||
extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group, char *name, ipp_res_t units, int xres, int yres);
|
||||
extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group, char *name, int num_values, ipp_res_t units, int *xres, 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, char *name, char *charset, char *value);
|
||||
extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, char *name, int num_values, char *charset, char **values);
|
||||
extern void ippDelete(ipp_t *ipp);
|
||||
extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, 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 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,370 +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
|
||||
* 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:
|
||||
*
|
||||
* 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(char *language) /* I - Language or locale */
|
||||
{
|
||||
int i, count; /* Looping vars */
|
||||
char 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.
|
||||
*/
|
||||
|
||||
if (language == NULL || language[0] == '\0')
|
||||
language = "C";
|
||||
|
||||
if (strlen(language) < 2)
|
||||
strcpy(real, "C");
|
||||
else
|
||||
{
|
||||
real[0] = tolower(language[0]);
|
||||
real[1] = tolower(language[1]);
|
||||
|
||||
if (language[2] == '_' || language[2] == '-')
|
||||
{
|
||||
real[2] = '_';
|
||||
real[3] = toupper(language[3]);
|
||||
real[4] = toupper(language[4]);
|
||||
real[5] = '\0';
|
||||
language[5] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
language[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;
|
||||
|
||||
sprintf(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';
|
||||
sprintf(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, language) == 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, language);
|
||||
|
||||
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,188 +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
|
||||
* 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
|
||||
*/
|
||||
|
||||
#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_AUTO,
|
||||
CUPS_MSG_ON,
|
||||
CUPS_MSG_OFF,
|
||||
CUPS_MSG_SAVE,
|
||||
CUPS_MSG_DISCARD,
|
||||
CUPS_MSG_DEFAULT,
|
||||
CUPS_MSG_USER_DEFINED,
|
||||
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_ALL_RIGHTS_RESERVED,
|
||||
CUPS_MSG_GENERAL,
|
||||
CUPS_MSG_PRINTER,
|
||||
CUPS_MSG_POSTSCRIPT,
|
||||
CUPS_MSG_IMAGE,
|
||||
CUPS_MSG_TEXT,
|
||||
CUPS_MSG_HPGL,
|
||||
CUPS_MSG_ADVANCED,
|
||||
CUPS_MSG_PRINT_BANNER_PAGE,
|
||||
CUPS_MSG_VERBOSE_LOGGING,
|
||||
CUPS_MSG_PRINT_PAGES,
|
||||
CUPS_MSG_DOCUMENT,
|
||||
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_ROTATE_IMAGE,
|
||||
CUPS_MSG_BEST_FIT,
|
||||
CUPS_MSG_COLOR_SATURATION,
|
||||
CUPS_MSG_COLOR_HUE,
|
||||
CUPS_MSG_NUMBER_OF_COLUMNS,
|
||||
CUPS_MSG_MARGINS,
|
||||
CUPS_MSG_WRAP_TEXT,
|
||||
CUPS_MSG_FIT_TO_PAGE,
|
||||
CUPS_MSG_SHADING,
|
||||
CUPS_MSG_DEFAULT_PEN_WIDTH,
|
||||
CUPS_MSG_GAMMA_CORRECTION,
|
||||
CUPS_MSG_BRIGHTNESS,
|
||||
CUPS_MSG_COLOR_PROFILE,
|
||||
CUPS_MSG_ADD_PRINTER,
|
||||
CUPS_MSG_DELETE_PRINTER,
|
||||
CUPS_MSG_MODIFY_PRINTER,
|
||||
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_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...
|
||||
*/
|
||||
|
||||
# define cupsLangDefault() cupsLangGet(setlocale(LC_ALL, 0))
|
||||
extern char *cupsLangEncoding(cups_lang_t *lang);
|
||||
extern void cupsLangFlush(void);
|
||||
extern void cupsLangFree(cups_lang_t *lang);
|
||||
extern cups_lang_t *cupsLangGet(char *language);
|
||||
# define cupsLangString(lang,msg) (lang)->messages[(msg)]
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_LANGUAGE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-428
@@ -1,428 +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.
|
||||
* ppd_default() - Set the default choice for an option.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "ppd.h"
|
||||
#include "string.h"
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void ppd_defaults(ppd_group_t *g);
|
||||
static void ppd_default(ppd_option_t *o);
|
||||
|
||||
|
||||
/*
|
||||
* '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)
|
||||
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)
|
||||
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 */
|
||||
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 (strcmp(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 */
|
||||
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 */
|
||||
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 (strcmp(o->keyword, option) == 0)
|
||||
return (o);
|
||||
|
||||
for (j = g->num_subgroups, sg = g->subgroups; j > 0; j --, sg ++)
|
||||
for (k = sg->num_options, o = sg->options; k > 0; k --, o ++)
|
||||
if (strcmp(o->keyword, option) == 0)
|
||||
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 */
|
||||
char *option, /* I - Option/Keyword name */
|
||||
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(g);
|
||||
|
||||
o = ppdFindOption(ppd, "PageSize");
|
||||
|
||||
for (i = 0; i < ppd->num_sizes; i ++)
|
||||
ppd->sizes[i].marked = strcmp(ppd->sizes[i].name, o->defchoice) == 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '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 */
|
||||
char *option, /* I - Keyword */
|
||||
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 (strcmp(option, "PageSize") == 0 && strncmp(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 (strcmp(c->choice, choice) == 0)
|
||||
c->marked = 1;
|
||||
else if (o->ui != PPD_UI_PICKMANY)
|
||||
c->marked = 0;
|
||||
|
||||
if (strcmp(option, "PageSize") == 0 || strcmp(option, "PageRegion") == 0)
|
||||
{
|
||||
/*
|
||||
* Mark current page size...
|
||||
*/
|
||||
|
||||
for (i = 0; i < ppd->num_sizes; i ++)
|
||||
ppd->sizes[i].marked = strcmp(ppd->sizes[i].name, choice) == 0;
|
||||
|
||||
/*
|
||||
* Unmark the current PageSize or PageRegion setting, as appropriate...
|
||||
*/
|
||||
|
||||
if (strcmp(option, "PageSize") == 0)
|
||||
{
|
||||
o = ppdFindOption(ppd, "PageRegion");
|
||||
for (i = 0; i < o->num_choices; i ++)
|
||||
o->choices[i].marked = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
o = ppdFindOption(ppd, "PageSize");
|
||||
for (i = 0; i < o->num_choices; i ++)
|
||||
o->choices[i].marked = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (ppdConflicts(ppd));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_defaults()' - Set the defaults for this group and all sub-groups.
|
||||
*/
|
||||
|
||||
static void
|
||||
ppd_defaults(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 (strcmp(o->keyword, "PageRegion") != 0)
|
||||
ppd_default(o);
|
||||
|
||||
for (i = g->num_subgroups, sg = g->subgroups; i > 0; i --, sg ++)
|
||||
ppd_defaults(sg);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_default()' - Set the default choice for an option.
|
||||
*/
|
||||
|
||||
static void
|
||||
ppd_default(ppd_option_t *o) /* I - Option to default */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ppd_choice_t *c; /* Current choice */
|
||||
|
||||
|
||||
if (o == NULL)
|
||||
return;
|
||||
|
||||
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
|
||||
if (strcmp(c->choice, o->defchoice) == 0)
|
||||
c->marked = 1;
|
||||
else
|
||||
c->marked = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-611
@@ -1,611 +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
|
||||
* 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:
|
||||
*
|
||||
* 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.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 */
|
||||
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);
|
||||
|
||||
strcpy(filename, pathname);
|
||||
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...
|
||||
*/
|
||||
|
||||
sprintf(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...
|
||||
*/
|
||||
|
||||
sprintf(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
|
||||
* 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
|
||||
*/
|
||||
|
||||
#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, char *pathname);
|
||||
extern mime_t *mimeNew(void);
|
||||
|
||||
extern mime_type_t *mimeAddType(mime_t *mime, char *super, char *type);
|
||||
extern int mimeAddTypeRule(mime_type_t *mt, char *rule);
|
||||
extern mime_type_t *mimeFileType(mime_t *mime, char *pathname);
|
||||
extern mime_type_t *mimeType(mime_t *mime, char *super, char *type);
|
||||
|
||||
extern mime_filter_t *mimeAddFilter(mime_t *mime, mime_type_t *src, mime_type_t *dst,
|
||||
int cost, 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,330 +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(char *name, /* I - Name of option */
|
||||
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 (strcmp(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.
|
||||
*/
|
||||
|
||||
char * /* O - Option value or NULL */
|
||||
cupsGetOption(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 (strcmp(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(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 */
|
||||
|
||||
|
||||
conflict = 0;
|
||||
|
||||
for (i = num_options; i > 0; i --, options ++)
|
||||
if (strcmp(options->name, "media") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "PageSize", options->value))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "InputSlot", options->value))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "MediaType", options->value))
|
||||
conflict = 1;
|
||||
}
|
||||
else if (strcmp(options->name, "sides") == 0)
|
||||
{
|
||||
if (strcmp(options->value, "one-sided") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "Duplex", "None"))
|
||||
conflict = 1;
|
||||
}
|
||||
else if (strcmp(options->value, "two-sided-long-edge") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "Duplex", "NoTumble"))
|
||||
conflict = 1;
|
||||
}
|
||||
else if (strcmp(options->value, "two-sided-short-edge") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "Duplex", "Tumble"))
|
||||
conflict = 1;
|
||||
}
|
||||
}
|
||||
else if (strcmp(options->name, "resolution") == 0)
|
||||
{
|
||||
if (ppdMarkOption(ppd, "Resolution", options->value))
|
||||
conflict = 1;
|
||||
if (ppdMarkOption(ppd, "JCLResolution", options->value))
|
||||
conflict = 1;
|
||||
}
|
||||
else if (ppdMarkOption(ppd, options->name, options->value))
|
||||
conflict = 1;
|
||||
|
||||
return (conflict);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
-179
@@ -1,179 +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 */
|
||||
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 &&
|
||||
strcmp(ppd->sizes[0].name, "Custom") == 0)
|
||||
{
|
||||
/*
|
||||
* 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%s", &w, &l, units) < 2)
|
||||
return (NULL);
|
||||
|
||||
if (strcasecmp(units, "in") == 0)
|
||||
{
|
||||
ppd->sizes[0].width = w * 72.0;
|
||||
ppd->sizes[0].length = l * 72.0;
|
||||
ppd->sizes[0].left = ppd->custom_margins[0];
|
||||
ppd->sizes[0].bottom = ppd->custom_margins[1];
|
||||
ppd->sizes[0].right = w * 72.0 - ppd->custom_margins[2];
|
||||
ppd->sizes[0].top = l * 72.0 - ppd->custom_margins[3];
|
||||
}
|
||||
else if (strcasecmp(units, "cm") == 0)
|
||||
{
|
||||
ppd->sizes[0].width = w * 2.54 * 72.0;
|
||||
ppd->sizes[0].length = l * 2.54 * 72.0;
|
||||
ppd->sizes[0].left = ppd->custom_margins[0];
|
||||
ppd->sizes[0].bottom = ppd->custom_margins[1];
|
||||
ppd->sizes[0].right = w * 2.54 * 72.0 - ppd->custom_margins[2];
|
||||
ppd->sizes[0].top = l * 2.54 * 72.0 - ppd->custom_margins[3];
|
||||
}
|
||||
else if (strcasecmp(units, "mm") == 0)
|
||||
{
|
||||
ppd->sizes[0].width = w * 25.4 * 72.0;
|
||||
ppd->sizes[0].length = l * 25.4 * 72.0;
|
||||
ppd->sizes[0].left = ppd->custom_margins[0];
|
||||
ppd->sizes[0].bottom = ppd->custom_margins[1];
|
||||
ppd->sizes[0].right = w * 25.4 * 72.0 - ppd->custom_margins[2];
|
||||
ppd->sizes[0].top = l * 25.4 * 72.0 - ppd->custom_margins[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
ppd->sizes[0].width = w;
|
||||
ppd->sizes[0].length = l;
|
||||
ppd->sizes[0].left = ppd->custom_margins[0];
|
||||
ppd->sizes[0].bottom = ppd->custom_margins[1];
|
||||
ppd->sizes[0].right = w - ppd->custom_margins[2];
|
||||
ppd->sizes[0].top = l - ppd->custom_margins[3];
|
||||
}
|
||||
|
||||
return (ppd->sizes);
|
||||
}
|
||||
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 */
|
||||
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 */
|
||||
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$".
|
||||
*/
|
||||
-1686
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
-238
@@ -1,238 +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 */
|
||||
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, char *keyword,
|
||||
char *option);
|
||||
extern void ppdMarkDefaults(ppd_file_t *ppd);
|
||||
extern int ppdMarkOption(ppd_file_t *ppd, char *keyword,
|
||||
char *option);
|
||||
extern ppd_choice_t *ppdFindChoice(ppd_option_t *o, char *option);
|
||||
extern ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd, char *keyword);
|
||||
extern ppd_option_t *ppdFindOption(ppd_file_t *ppd, char *keyword);
|
||||
extern ppd_file_t *ppdOpen(FILE *fp);
|
||||
extern ppd_file_t *ppdOpenFd(int fd);
|
||||
extern ppd_file_t *ppdOpenFile(char *filename);
|
||||
extern float ppdPageLength(ppd_file_t *ppd, char *name);
|
||||
extern ppd_size_t *ppdPageSize(ppd_file_t *ppd, char *name);
|
||||
extern float ppdPageWidth(ppd_file_t *ppd, 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$".
|
||||
*/
|
||||
-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
|
||||
* 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:
|
||||
*
|
||||
* 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,66 +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
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_STRING_H_
|
||||
# define _CUPS_STRING_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# 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__ */
|
||||
|
||||
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
#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
|
||||
* 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:
|
||||
*
|
||||
* 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
|
||||
* 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:
|
||||
*
|
||||
* 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], "%[^/]/%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
|
||||
* 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
|
||||
*
|
||||
* 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 */
|
||||
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
|
||||
-1011
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
-949
@@ -1,949 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Printing utilities 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
|
||||
* 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:
|
||||
*
|
||||
* cupsCancelJob() - Cancel a print job.
|
||||
* cupsDoFileRequest() - Do an IPP request...
|
||||
* cupsGetClasses() - Get a list of printer classes.
|
||||
* cupsGetDefault() - Get the default printer or class.
|
||||
* cupsGetPPD() - Get the PPD file for a printer.
|
||||
* cupsGetPrinters() - Get a list of printers.
|
||||
* cupsPrintFile() - Print a file to a printer or class.
|
||||
* cups_connect() - Connect to the specified host...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include "ipp.h"
|
||||
#include "language.h"
|
||||
#include "string.h"
|
||||
#include "debug.h"
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static http_t *cups_server = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static char *cups_connect(char *name, char *printer, char *hostname);
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsCancelJob()' - Cancel a print job.
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
cupsCancelJob(char *name, /* I - Name of printer or class */
|
||||
int job) /* I - Job ID */
|
||||
{
|
||||
char printer[HTTP_MAX_URI], /* Printer name */
|
||||
hostname[HTTP_MAX_URI], /* Hostname */
|
||||
uri[HTTP_MAX_URI]; /* Printer URI */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
cups_lang_t *language; /* Language info */
|
||||
|
||||
|
||||
/*
|
||||
* See if we can connect to the server...
|
||||
*/
|
||||
|
||||
if (!cups_connect(name, printer, hostname))
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Build an IPP_CANCEL_JOB request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* printer-uri
|
||||
* job-id
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_CANCEL_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");
|
||||
|
||||
sprintf(uri, "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job);
|
||||
|
||||
/*
|
||||
* Do the request...
|
||||
*/
|
||||
|
||||
if ((response = cupsDoRequest(cups_server, request, "/jobs/")) == NULL)
|
||||
return (0);
|
||||
|
||||
ippDelete(response);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsDoFileRequest()' - Do an IPP request...
|
||||
*/
|
||||
|
||||
ipp_t * /* O - Response data */
|
||||
cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
ipp_t *request, /* I - IPP request */
|
||||
char *resource, /* I - HTTP resource for POST */
|
||||
char *filename) /* I - File to send or NULL */
|
||||
{
|
||||
ipp_t *response; /* IPP response data */
|
||||
char length[255]; /* Content-Length field */
|
||||
http_status_t status; /* Status of HTTP request */
|
||||
FILE *file; /* File to send */
|
||||
struct stat fileinfo; /* File information */
|
||||
int bytes; /* Number of bytes read/written */
|
||||
char buffer[8192]; /* Output buffer */
|
||||
#if !defined(WIN32) && !defined(__EMX__)
|
||||
char *password, /* Password string */
|
||||
plain[255], /* Plaintext username:password */
|
||||
encode[255]; /* Encoded username:password */
|
||||
char junk[8192]; /* Junk buffer for error data */
|
||||
#endif /* !WIN32 && !__EMX__ */
|
||||
static char authstring[255] = "";
|
||||
/* Authorization string */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsDoFileRequest(%08x, %08s, \'%s\', \'%s\')\n",
|
||||
http, request, resource, filename ? filename : "(null)"));
|
||||
|
||||
/*
|
||||
* See if we have a file to send...
|
||||
*/
|
||||
|
||||
if (filename != NULL)
|
||||
{
|
||||
if (stat(filename, &fileinfo))
|
||||
{
|
||||
/*
|
||||
* Can't get file information!
|
||||
*/
|
||||
|
||||
ippDelete(request);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((file = fopen(filename, "rb")) == NULL)
|
||||
{
|
||||
/*
|
||||
* Can't open file!
|
||||
*/
|
||||
|
||||
ippDelete(request);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop until we can send the request without authorization problems.
|
||||
*/
|
||||
|
||||
response = NULL;
|
||||
|
||||
while (response == NULL)
|
||||
{
|
||||
DEBUG_puts("cupsDoFileRequest: setup...");
|
||||
|
||||
/*
|
||||
* Setup the HTTP variables needed...
|
||||
*/
|
||||
|
||||
if (filename != NULL)
|
||||
sprintf(length, "%u", ippLength(request) + fileinfo.st_size);
|
||||
else
|
||||
sprintf(length, "%u", ippLength(request));
|
||||
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, length);
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, authstring);
|
||||
|
||||
/*
|
||||
* Try the request...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsDoFileRequest: post...");
|
||||
|
||||
if (httpPost(http, resource))
|
||||
if (httpPost(http, resource))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Send the IPP data and wait for the response...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsDoFileRequest: ipp write...");
|
||||
|
||||
request->state = IPP_IDLE;
|
||||
if (ippWrite(http, request) != IPP_ERROR)
|
||||
if (filename != NULL)
|
||||
{
|
||||
DEBUG_puts("cupsDoFileRequest: file write...");
|
||||
|
||||
/*
|
||||
* Send the file...
|
||||
*/
|
||||
|
||||
rewind(file);
|
||||
|
||||
while ((bytes = fread(buffer, 1, sizeof(buffer), file)) > 0)
|
||||
if (httpWrite(http, buffer, bytes) < bytes)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the server's return status...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsDoFileRequest: update...");
|
||||
|
||||
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
|
||||
|
||||
#if !defined(WIN32) && !defined(__EMX__)
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
DEBUG_puts("cupsDoFileRequest: unauthorized...");
|
||||
|
||||
/*
|
||||
* Flush any error message...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
|
||||
if ((password = getpass("Password:")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Got a password; send it to the server...
|
||||
*/
|
||||
|
||||
if (!password[0])
|
||||
break;
|
||||
sprintf(plain, "%s:%s", cuserid(NULL), password);
|
||||
httpEncode64(encode, plain);
|
||||
sprintf(authstring, "Basic %s", encode);
|
||||
|
||||
continue;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
#endif /* !WIN32 && !__EMX__ */
|
||||
|
||||
if (status != HTTP_OK)
|
||||
{
|
||||
DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
|
||||
|
||||
/*
|
||||
* Flush any error message...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Read the response...
|
||||
*/
|
||||
|
||||
DEBUG_puts("cupsDoFileRequest: response...");
|
||||
|
||||
response = ippNew();
|
||||
|
||||
if (ippRead(http, response) == IPP_ERROR)
|
||||
{
|
||||
/*
|
||||
* Delete the response...
|
||||
*/
|
||||
|
||||
ippDelete(response);
|
||||
response = NULL;
|
||||
|
||||
/*
|
||||
* Flush any remaining data...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the file if needed...
|
||||
*/
|
||||
|
||||
if (filename != NULL)
|
||||
fclose(file);
|
||||
|
||||
/*
|
||||
* Delete the original request and return the response...
|
||||
*/
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
return (response);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetClasses()' - Get a list of printer classes.
|
||||
*/
|
||||
|
||||
int /* O - Number of classes */
|
||||
cupsGetClasses(char ***classes) /* O - Classes */
|
||||
{
|
||||
int n; /* Number of classes */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
|
||||
|
||||
/*
|
||||
* Try to connect to the server...
|
||||
*/
|
||||
|
||||
if (!cups_connect("default", NULL, NULL))
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
n = 0;
|
||||
*classes = NULL;
|
||||
|
||||
if ((response = cupsDoRequest(cups_server, request, "/classes/")) != NULL)
|
||||
{
|
||||
for (attr = response->attrs; attr != NULL; attr = attr->next)
|
||||
if (strcmp(attr->name, "printer-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
{
|
||||
if (n == 0)
|
||||
*classes = malloc(sizeof(char *));
|
||||
else
|
||||
*classes = realloc(*classes, sizeof(char *) * (n + 1));
|
||||
|
||||
if (*classes == NULL)
|
||||
{
|
||||
ippDelete(response);
|
||||
return (0);
|
||||
}
|
||||
|
||||
(*classes)[n] = strdup(attr->values[0].string.text);
|
||||
n ++;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
return (n);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetDefault()' - Get the default printer or class.
|
||||
*/
|
||||
|
||||
char * /* O - Default printer or NULL */
|
||||
cupsGetDefault(void)
|
||||
{
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
static char def_printer[64];/* Default printer */
|
||||
|
||||
|
||||
/*
|
||||
* First see if the LPDEST or PRINTER environment variables are
|
||||
* set...
|
||||
*/
|
||||
|
||||
if (getenv("LPDEST") != NULL)
|
||||
return (getenv("LPDEST"));
|
||||
else if (getenv("PRINTER") != NULL)
|
||||
return (getenv("PRINTER"));
|
||||
|
||||
/*
|
||||
* Try to connect to the server...
|
||||
*/
|
||||
|
||||
if (!cups_connect("default", NULL, NULL))
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* Build a CUPS_GET_DEFAULT request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = CUPS_GET_DEFAULT;
|
||||
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);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
if ((response = cupsDoRequest(cups_server, request, "/printers/")) != NULL)
|
||||
{
|
||||
if ((attr = ippFindAttribute(response, "printer-name", IPP_TAG_NAME)) != NULL)
|
||||
{
|
||||
strcpy(def_printer, attr->values[0].string.text);
|
||||
ippDelete(response);
|
||||
return (def_printer);
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetPPD()' - Get the PPD file for a printer.
|
||||
*/
|
||||
|
||||
char * /* O - Filename for PPD file */
|
||||
cupsGetPPD(char *name) /* I - Printer name */
|
||||
{
|
||||
FILE *fp; /* PPD file */
|
||||
int bytes; /* Number of bytes read */
|
||||
char buffer[8192]; /* Buffer for file */
|
||||
char printer[HTTP_MAX_URI], /* Printer name */
|
||||
hostname[HTTP_MAX_URI], /* Hostname */
|
||||
resource[HTTP_MAX_URI]; /* Resource name */
|
||||
static char filename[HTTP_MAX_URI]; /* Local filename */
|
||||
char *tempdir; /* Temporary file directory */
|
||||
struct stat fileinfo; /* File information */
|
||||
|
||||
|
||||
/*
|
||||
* See if we can connect to the server...
|
||||
*/
|
||||
|
||||
if (!cups_connect(name, printer, hostname))
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* Then check for the cache file...
|
||||
*/
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
tempdir = "C:/WINDOWS/TEMP";
|
||||
#else
|
||||
if ((tempdir = getenv("TMPDIR")) == NULL)
|
||||
tempdir = "/tmp";
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
sprintf(filename, "%s/%s.ppd", tempdir, printer);
|
||||
if (stat(filename, &fileinfo))
|
||||
memset(&fileinfo, 0, sizeof(fileinfo));
|
||||
|
||||
/*
|
||||
* And send a request to the HTTP server using "if-modified-since"...
|
||||
*/
|
||||
|
||||
sprintf(resource, "/printers/%s.ppd", printer);
|
||||
|
||||
httpClearFields(cups_server);
|
||||
httpSetField(cups_server, HTTP_FIELD_HOST, hostname);
|
||||
httpSetField(cups_server, HTTP_FIELD_IF_MODIFIED_SINCE,
|
||||
httpGetDateString(fileinfo.st_mtime));
|
||||
httpGet(cups_server, resource);
|
||||
|
||||
switch (httpUpdate(cups_server))
|
||||
{
|
||||
case HTTP_OK : /* New file - get it! */
|
||||
break;
|
||||
case HTTP_NOT_MODIFIED : /* File hasn't been modified; use the current copy */
|
||||
return (filename);
|
||||
default :
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* OK, we need to copy the file; open the file and copy it...
|
||||
*/
|
||||
|
||||
unlink(filename);
|
||||
if ((fp = fopen(filename, "w")) == NULL)
|
||||
{
|
||||
/*
|
||||
* Can't open file; close the server connection and return NULL...
|
||||
*/
|
||||
|
||||
httpClose(cups_server);
|
||||
cups_server = NULL;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
while ((bytes = httpRead(cups_server, buffer, sizeof(buffer))) > 0)
|
||||
fwrite(buffer, bytes, 1, fp);
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return (filename);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetPrinters()' - Get a list of printers.
|
||||
*/
|
||||
|
||||
int /* O - Number of printers */
|
||||
cupsGetPrinters(char ***printers) /* O - Printers */
|
||||
{
|
||||
int n; /* Number of printers */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
|
||||
|
||||
/*
|
||||
* Try to connect to the server...
|
||||
*/
|
||||
|
||||
if (!cups_connect("default", NULL, NULL))
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* 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();
|
||||
|
||||
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...
|
||||
*/
|
||||
|
||||
n = 0;
|
||||
*printers = NULL;
|
||||
|
||||
if ((response = cupsDoRequest(cups_server, request, "/printers/")) != NULL)
|
||||
{
|
||||
for (attr = response->attrs; attr != NULL; attr = attr->next)
|
||||
if (strcmp(attr->name, "printer-name") == 0 &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
{
|
||||
if (n == 0)
|
||||
*printers = malloc(sizeof(char *));
|
||||
else
|
||||
*printers = realloc(*printers, sizeof(char *) * (n + 1));
|
||||
|
||||
if (*printers == NULL)
|
||||
{
|
||||
ippDelete(response);
|
||||
return (0);
|
||||
}
|
||||
|
||||
(*printers)[n] = strdup(attr->values[0].string.text);
|
||||
n ++;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
return (n);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsPrintFile()' - Print a file to a printer or class.
|
||||
*/
|
||||
|
||||
int /* O - Job ID */
|
||||
cupsPrintFile(char *name, /* I - Printer or class name */
|
||||
char *filename, /* I - File to print */
|
||||
char *title, /* I - Title of job */
|
||||
int num_options,/* I - Number of options */
|
||||
cups_option_t *options) /* I - Options */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int n, n2; /* Attribute values */
|
||||
char *option, /* Name of option */
|
||||
*val, /* Pointer to option value */
|
||||
*s; /* Pointer into option value */
|
||||
ipp_t *request; /* IPP request */
|
||||
ipp_t *response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP job-id attribute */
|
||||
char hostname[HTTP_MAX_URI], /* Hostname */
|
||||
printer[HTTP_MAX_URI], /* Printer or class name */
|
||||
uri[HTTP_MAX_URI]; /* Printer URI */
|
||||
cups_lang_t *language; /* Language to use */
|
||||
int jobid; /* New job ID */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsPrintFile(\'%s\', \'%s\', %d, %08x)\n",
|
||||
printer, filename, num_options, options));
|
||||
|
||||
if (name == NULL || filename == NULL)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Setup a connection and request data...
|
||||
*/
|
||||
|
||||
if ((request = ippNew()) == NULL)
|
||||
return (0);
|
||||
|
||||
if (!cups_connect(name, printer, hostname))
|
||||
{
|
||||
DEBUG_printf(("cupsPrintFile: Unable to open connection - %s.\n",
|
||||
strerror(errno)));
|
||||
ippDelete(request);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Build a standard CUPS URI for the printer and fill the standard IPP
|
||||
* attributes...
|
||||
*/
|
||||
|
||||
request->request.op.operation_id = IPP_PRINT_JOB;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
sprintf(uri, "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
|
||||
|
||||
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");
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
|
||||
/*
|
||||
* Handle raw print files...
|
||||
*/
|
||||
|
||||
if (cupsGetOption("raw", num_options, options))
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
|
||||
NULL, "application/vnd.cups-raw");
|
||||
else
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
|
||||
NULL, "application/octet-stream");
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, "WindowsUser");
|
||||
#else
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, cuserid(NULL));
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
if (title)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, title);
|
||||
|
||||
/*
|
||||
* Then add all options on the command-line...
|
||||
*/
|
||||
|
||||
for (i = 0; i < num_options; i ++)
|
||||
{
|
||||
/*
|
||||
* Skip the "raw" option - handled above...
|
||||
*/
|
||||
|
||||
if (strcmp(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 (strncmp(option, "no", 2) == 0)
|
||||
{
|
||||
option += 2;
|
||||
n = 0;
|
||||
}
|
||||
else
|
||||
n = 1;
|
||||
|
||||
s = "";
|
||||
}
|
||||
|
||||
if (*s != '\0' && *s != '-' && (*s != 'x' || s == val))
|
||||
{
|
||||
/*
|
||||
* String value(s)...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsPrintJob: Adding string option \'%s\' with value \'%s\'...\n",
|
||||
option, val));
|
||||
|
||||
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);
|
||||
|
||||
DEBUG_printf(("cupsPrintJob: Adding range option \'%s\' with value %d-%d...\n",
|
||||
option, n, n2));
|
||||
}
|
||||
else if (*s == 'x')
|
||||
{
|
||||
n2 = strtol(s + 1, &s, 0);
|
||||
|
||||
if (strcmp(s, "dpc") == 0)
|
||||
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_CM, n, n2);
|
||||
else if (strcmp(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);
|
||||
|
||||
DEBUG_printf(("cupsPrintJob: Adding resolution option \'%s\' with value %s...\n",
|
||||
option, val));
|
||||
}
|
||||
else
|
||||
{
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, option, n);
|
||||
|
||||
DEBUG_printf(("cupsPrintJob: Adding integer option \'%s\' with value %d...\n",
|
||||
option, n));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Boolean value...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsPrintJob: Adding boolean option \'%s\' with value %d...\n",
|
||||
option, n));
|
||||
ippAddBoolean(request, IPP_TAG_JOB, option, (char)n);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Try printing the file...
|
||||
*/
|
||||
|
||||
sprintf(uri, "/printers/%s", printer);
|
||||
|
||||
if ((response = cupsDoFileRequest(cups_server, request, uri, filename)) == NULL)
|
||||
jobid = 0;
|
||||
else if (response->request.status.status_code > IPP_OK_CONFLICT)
|
||||
{
|
||||
DEBUG_printf(("IPP response code was 0x%x!\n",
|
||||
response->request.status.status_code));
|
||||
jobid = 0;
|
||||
}
|
||||
else if ((attr = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) == NULL)
|
||||
{
|
||||
DEBUG_puts("No job ID!");
|
||||
jobid = 0;
|
||||
}
|
||||
else
|
||||
jobid = attr->values[0].integer;
|
||||
|
||||
if (response != NULL)
|
||||
ippDelete(response);
|
||||
|
||||
return (jobid);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_connect()' - Connect to the specified host...
|
||||
*/
|
||||
|
||||
static char * /* I - Printer name if success, NULL if fail */
|
||||
cups_connect(char *name, /* I - Destination (printer[@host]) */
|
||||
char *printer, /* O - Printer name */
|
||||
char *hostname) /* O - Hostname */
|
||||
{
|
||||
char hostbuf[HTTP_MAX_URI];
|
||||
/* Name of host */
|
||||
static char printerbuf[HTTP_MAX_URI];
|
||||
/* Name of printer or class */
|
||||
|
||||
|
||||
if (name == NULL)
|
||||
return (NULL);
|
||||
|
||||
if (sscanf(name, "%[^@]@%s", printerbuf, hostbuf) == 1)
|
||||
strcpy(hostbuf, "localhost");
|
||||
|
||||
if (hostname != NULL)
|
||||
strcpy(hostname, hostbuf);
|
||||
else
|
||||
hostname = hostbuf;
|
||||
|
||||
if (printer != NULL)
|
||||
strcpy(printer, printerbuf);
|
||||
else
|
||||
printer = printerbuf;
|
||||
|
||||
if (cups_server != NULL)
|
||||
{
|
||||
if (strcasecmp(cups_server->hostname, hostname) == 0)
|
||||
return (printer);
|
||||
|
||||
httpClose(cups_server);
|
||||
}
|
||||
|
||||
if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
|
||||
return (NULL);
|
||||
else
|
||||
return (printer);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,62 +0,0 @@
|
||||
%%BeginResource: procset hpgltops 1.0 0
|
||||
%
|
||||
% "$Id: HPGLprolog 312 1999-05-11 19:45:40Z mike $"
|
||||
%
|
||||
% HP-GL/2 filter procset for the Common UNIX Printing System (CUPS).
|
||||
%
|
||||
% This procset contains the basic drawing commands that are used to
|
||||
% reduce output size. Note the 'MP' (make newpath) definition - this
|
||||
% should be called 'NP' (newpath), but GhostScript uses the 'NP' name
|
||||
% for 'noaccess put' in some of its font files...
|
||||
%
|
||||
% Copyright 1993-1999 Easy Software Products
|
||||
%
|
||||
% These coded instructions, statements, and computer programs are the
|
||||
% property of Easy Software Products and are protected by Federal
|
||||
% copyright law. Distribution and use rights are outlined in the file
|
||||
% "LICENSE.txt" which should have been included with this file. If this
|
||||
% file is missing or damaged please contact Easy Software Products
|
||||
% at:
|
||||
%
|
||||
% Attn: CUPS Licensing Information
|
||||
% Easy Software Products
|
||||
% 44141 Airport View Drive, Suite 204
|
||||
% Hollywood, Maryland 20636-3111 USA
|
||||
%
|
||||
% Voice: (301) 373-9603
|
||||
% EMail: cups-info@cups.org
|
||||
% WWW: http://www.cups.org
|
||||
%
|
||||
/MO { moveto } bind def
|
||||
/LI { lineto } bind def
|
||||
/FI { fill } bind def
|
||||
/ST { stroke } bind def
|
||||
/CP { closepath } bind def
|
||||
/MP { newpath } bind def
|
||||
%
|
||||
% If you have more than 8 pens defined for your HP-GL/2 output you'll
|
||||
% need to add P# definitions (# = pen number) to set the appropriate color.
|
||||
% If you don't you'll get errors. The default 8 pens cover the primary
|
||||
% colors (white, black, red, green, yellow, blue, magenta, cyan). Ditto
|
||||
% for pen widths (W#).
|
||||
%
|
||||
% PC and PW commands in the input stream will define/redefine these
|
||||
% appropriately, but some packages don't generate them...
|
||||
%
|
||||
/P0 { 1.0 1.0 1.0 setrgbcolor } bind def
|
||||
/P1 { 0.0 0.0 0.0 setrgbcolor } bind def
|
||||
/P2 { 1.0 0.0 0.0 setrgbcolor } bind def
|
||||
/P3 { 0.0 1.0 0.0 setrgbcolor } bind def
|
||||
/P4 { 1.0 1.0 0.0 setrgbcolor } bind def
|
||||
/P5 { 0.0 0.0 1.0 setrgbcolor } bind def
|
||||
/P6 { 1.0 0.0 1.0 setrgbcolor } bind def
|
||||
/P7 { 0.0 1.0 1.0 setrgbcolor } bind def
|
||||
/W0 { DefaultPenWidth PenScaling mul setlinewidth } bind def
|
||||
/W1 { DefaultPenWidth PenScaling mul setlinewidth } bind def
|
||||
/W2 { DefaultPenWidth PenScaling mul setlinewidth } bind def
|
||||
/W3 { DefaultPenWidth PenScaling mul setlinewidth } bind def
|
||||
/W4 { DefaultPenWidth PenScaling mul setlinewidth } bind def
|
||||
/W5 { DefaultPenWidth PenScaling mul setlinewidth } bind def
|
||||
/W6 { DefaultPenWidth PenScaling mul setlinewidth } bind def
|
||||
/W7 { DefaultPenWidth PenScaling mul setlinewidth } bind def
|
||||
%%EndResource
|
||||
@@ -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)
|
||||
$(CP) $(FILES) $(DATADIR)
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
-1051
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
Submódulo
+1
Submodule development added at d9f356c545
-102
@@ -1,102 +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:
|
||||
htmldoc --title images/cups-large.gif --numbered -f $@ $<
|
||||
.shtml.pdf:
|
||||
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 svd.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/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
|
||||
htmldoc --duplex --compression=9 --jpeg --webpage -f $@ $<
|
||||
|
||||
sam.html: sam.shtml
|
||||
htmldoc --title images/cups-large.gif -f $@ $<
|
||||
sam.pdf: sam.shtml
|
||||
htmldoc --title images/cups-large.gif --duplex --compression=9 \
|
||||
--jpeg -f $@ $<
|
||||
|
||||
sum.html: sum.shtml
|
||||
htmldoc --title images/cups-large.gif -f $@ $<
|
||||
sum.pdf: sum.shtml
|
||||
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>IPP/1.0: Encoding and Transport </LI>
|
||||
<LI>IPP/1.0: Implementers Guide </LI>
|
||||
<LI>IPP/1.0: Model and Semantics </LI>
|
||||
<LI>RFC 1179, Line Printer Daemon Protocol </LI>
|
||||
</UL>
|
||||
<H1><A NAME=3>3 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.3 1999/05/21 20:54:04 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.3 1999/05/21 20:54:04
|
||||
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>
|
||||
-963
@@ -1,963 +0,0 @@
|
||||
%PDF-1.2
|
||||
%âãÏÓ
|
||||
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19990521210307Z)/Title(CUPS Configuration Management Plan)/Author(Easy Software Products)>>endobj
|
||||
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�}: | ||||