Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet a74847a90d Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.3rc2@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
1731 arquivos alterados com 170668 adições e 80279 exclusões
+1261
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+214 -338
Ver Arquivo
@@ -1,344 +1,220 @@
CHANGES.txt - 2006-03-10
CHANGES.txt - 2007-07-30
------------------------
CHANGES IN CUPS V1.2b2
CHANGES IN CUPS V1.3rc2
- Updated the CUPS design description.
- Added --enable-32bit and --enable-64bit configure
options to allow building of separate 32/64-bit
libraries on systems that support both environments
(STR #1472)
- Various compiler warning fixes.
- Fixes for Solaris 10 builds against old GNU TLS and
LDAP libraries.
- Added a cupsArrayUserData() function to retrieve the
user data pointer for an array (useful for typing
arrays)
- The ppdEmitString() function did not compute the
required buffer size properly, leading to dropped
characters on the end of the printer commands in pstops
and imagetops (STR #1470)
- Added more range checking to the pdftops filter.
- The scheduler would crash if a remote IPP queue was stopped
(STR #2460)
- The scheduler did not allow "DefaultAuthType None".
CHANGES IN CUPS V1.2b1
CHANGES IN CUPS V1.3rc1
- The serial backend now supports Equinox 8-port serial
hubs (STR #526)
- The IPP backend now supports a compression option to
compress print files as they are sent to the remote
server (STR #956)
- The CUPS browse protocol now supports passing of
default options and browse timeout values from the
server to the clients (STR #800)
- Implicit classes that timed out could cause the
scheduler to crash (STR #1439)
- Added DragonFly support in local device backends (STR
#1362)
- Added LDAP printer browsing support (STR #338)
- Added official support for printer maintenance commands
via the CUPS Command file format and hooks in the
printer-type and web interfaces (STR #932)
- The HP-GL/2 filter could get in an infinite loop trying
to convert HP-PCL files (STR #1415)
- CUPS now implements the HTTP/1.1 Expect header (STR
#1407)
- Options in PPD files are no longer automatically put in
an "Extra" group; rather, all options that are not
inside an Open/CloseGroup will be placed in the
"General" group (STR #1385)
- The scheduler now creates a job-uuid attribute that
uniquely identifies a job on a network (STR #1410)
- The init script now unsets the TMPDIR environment
variable to prevent user temporary directories from
being used by cupsd accidentally (STR #1424)
- Added support for launchd on MacOS X.
- Added support for notify_post on MacOS X.
- Added support for DBUS on Linux.
- All of the Berkeley (except for lpc) and System V
commands now support specification of user, host, and
port (STR #1028, STR #1029, STR #1087)
- The lpmove command now allows you to move all jobs for
a given queue (STR #56)
- The web interface now supports moving of a job or jobs
to another queue (STR #56)
- The web interface now provides searching, paging, and
changing of the sort/display order of classes, jobs,
and printers.
- cupsaddsmb now accepts a password on the command-line
and supports passwords with special characters (STR
#822, STR #1236)
- ppdLoad*() no longer tries to "fix" bad characters in
UI text (STR #1101)
- Printer names can now (reliably) contain Unicode
characters (STR #896)
- The lpstat command now shows the time and date of the
last printer state change instead of the hardcoded "Jan
01 00:00" (STR #659)
- The scheduler now adds a job-actual-printer-uri
attribute to job objects when printing to a class (STR
#116)
- The scheduler now logs log file open errors to the
system log (STR #1289)
- The scheduler now sets the job-originating-user-name to
the authenticated username, if available (STR #1318)
- The scheduler now only updates the permissions of SSL
keys and certificates when they are under the
ServerRoot directory (STR #1324)
- The rastertodymo driver has been renamed to
rastertolabel (a symlink is installed so that existing
queues continue to work) and now also supports Zebra's
CPCL language.
- The lpstat command could show the wrong active job for
a printer (STR #1301)
- Fixed a potential crash problem in the scheduler when
aborting a CGI program (STR #1290)
- Added a "cancel all jobs" button to the class and
printer web interfaces (STR #1140)
- The add-printer web page now shows the
set-printer-options page after the printer has been
added (STR #690)
- The classes web page now provides links to each of the
member printers (STR #307)
- CUPS now handles HTTP request/response lines up to 32k
in length; this is mainly for better cookie support
(STR #1274)
- Added support for the Apache PassEnv and SetEnv
directives to cupsd.conf (STR #853)
- Added large file (64-bit) support (STR #541)
- Fixed a performance issue with the ippReadIO()
implementation (STR #1284)
- Fixed a performance issue with the scheduler's implicit
class implementation (STR #1283)
- The pdftops filter now adds the Title and Creator
fields from the PDF file to the PostScript document
comments section (STR #539, STR #830)
- Added a new cups_array_t and cupsArray*() functions to
the CUPS API to support sorted lists of data.
- Made the CUPS API library thread-safe (STR #1276)
- Added "media" option support for EFI EFMediaType option
(STR #902)
- Added write buffering to the HTTP code to improve
performance (STR #547)
- The scheduler now uses the attributes-natural-language
attribute to localize banner pages (STR #386)
- The scheduler now returns the address that was used to
connect to it (STR #1076)
- Fixed a problem with N-up printing and OpenOffice (STR
#576)
- Added support for the GCC position independent
executable options (STR #1209)
- Added new BrowseLocalProtocols and
BrowseRemoteProtocols directives to cupsd.conf,
allowing for different browse protocols for local and
remote printers (STR #877)
- PPD files can now contain strings up to 256k in length
(STR #1215)
- The pstops filter now supports the IncludeFeature DSC
comment (STR #1212)
- The pstops filter now disables the setpagedevice
procedure when doing N-up printing (STR #1161)
- The serial backend now supports "stop=1", "stop=2",
"parity=space", and "parity=mark" options (STR #1155)
- "make install" no longer overwrites an existing PAM
configuration file (STR #1064)
- The scheduler now closes all files on startup when run
in daemon mode (STR #1009)
- Added a new RGBW colorspace to the CUPS raster format
(STR #1071)
- The pdftops filter now sets the page size based on the
media box when not scaling the output (STR #912)
- The pdftops filter now supports masked images (STR
#281)
- The pdftops filter produced large output when rendering
PDF files containing lot of repeated images (STR #327)
- The pdftops filter now minimizes print processing of
PDF files when using the page-ranges option (STR #273)
- Updated pdftops filter to Xpdf 3.01.
- Added new cupsBackchannelRead() and
cupsBackchannelWrite() functions, as well as
backchannel support to the parallel, serial, socket,
and USB backends (STR #1252)
- The parallel and USB backends now treat a "no space
available" error as an out-of-paper condition (STR
#1225)
- The "lpc" command now supports the "status all" command
(STR #1004)
- ippReadIO() did not read collections properly (STR
#1249)
- The "make test" script now creates the test files in
"/tmp/cups-$USER" instead of "/tmp/$USER" (STR #981)
- All backends now abort on error when printing a job to
a class - this allows the next printer in the class to
print the job (STR #1084)
- The scheduler now verifies that a printer supports
Letter or A4 media sizes before setting them as the
initial default (STR #1250)
- The cupstestppd program now flags bad Resolution
options (STR #1269)
- The USB backend now retries printing when the printer
is disconnected or turned off (STR #1267)
- Added new httpGetHostname() function to CUPS API, and
use it instead of gethostname() so that the web
interface will work correctly on systems whose hostname
is not the FQDN (STR #1266)
- The scheduler now stops printers if the backend for the
queue is missing on startup (STR #1265)
- The configure script now supports "--disable-library"
to disable particular image file format support
libraries, even if they are available on the build
system (STR #1248)
- The IPP backend did not always report on the total
number of pages that were printed (STR #1251)
- The lpstat program could display garbage date and time
values for locales whose date format exceeded 31
characters (STR #1263)
- The cupstestppd program would segfault when testing
certain broken PPD files (STR #1268)
- Dramatically reduced the overhead of implicit classes.
- Added new cupsDir*() functions to CUPS API.
- Printers can now be published individually for sharing.
- Fixed a bug in the scheduler's startup signalling code
which caused cupsd to send the SIGUSR1 signal to the
init process instead of the original parent process
(STR #1258)
- Added new on-line help CGI to web interface to provide
searchable help.
- Devices are now tracked dynamically, with each query
doing a new device scan. This eliminates a previous
startup delay caused by slow backends and allows new
printers to be seen without restarting the server,
however it limits the amount of device URI checking
that can be done (basically now the scheduler only
requires a URI with a method that is a listed backend)
- Added new printer auto-detection, server configuration,
and log file viewing to the administration web page.
- Added new "set allowed users" web interface to set the
list of allowed users for a printer or class.
- The scheduler, command-line, and web interfaces now
limit the list of printers and classes to those
accessible by a user.
- cupsMarkOptions() now handles more non-standard
duplexing options and choices (STR #915)
- cups-lpd now honors remote banner requests with the
"standard" banner whenever a printer does not have one
defined (STR #1220)
- The scheduler's denial-of-service checks did not work
properly with IPv6 addresses (STR #1134)
- The lp and lpr commands did not error out properly when
they were unable to write to a temporary file (STR
#1129)
- The pstops filter did not handle Adobe-specific
comments in Windows NT driver output (STR #1085)
- "lpstat -l -p" incorrectly reported the printer
interface (STR #936)
- The web interface now operates exclusively with the
UTF-8 encoding, and sends the appropriate character set
and header information to the web browser (STR #919,
STR #1007)
- Added a "set allowed users" interface to the web
interface so that you can set the list of allowed or
denied users/groups for a printer or class.
- Disallow the "#" character in printer names, since it
has special meaning in the shell, config files, and in
URIs (STR #917, STR #1202)
- Added a new application/x-csource MIME type, and
support for it to the texttops filter so that you can
pretty print plain text files without the C/C++
keywords being highlighted.
- The pdftops filter did not compile with GCC 4.0 (STR
#1226)
- The texttops filter did not highlight preprocessor
directives followed by a tab properly.
- HP PJL output now uses both JOB DISPLAY and RDYMSG
commands to show the current job on the printer's
display (STR #1218)
- Local authentication certificates are now stored in
/var/run/cups/certs by default instead of
/etc/cups/certs (STR #1211)
- Backends now use "&" to separate options in device
URIs; "+" is still recognized but is deprecated (STR
#842)
- The USB backend no longer supports the usb:/dev/foo
format on systems that support device ID queries.
- Forced classification markings did not work when the
job-sheets parameters were "none,none".
- "lpstat -l -p" incorrectly showed all users as allowed,
even if the queue was restricted to certain users (STR
#801)
- The scheduler now automatically detects SSL/TLS clients
without using the SSLPort/SSLListen directives.
- The CUPS API and scheduler no longer support SSLv2-
encrypted connections.
- Updated the cupsaddsmb utility to correctly export the
CUPS driver for Windows.
- Fixed a signal-handling bug in httpRead() which
ultimately caused the server to print multiple copies
when it was busy (STR #1184)
- The cupsFile API now uses the O_APPEND option when
opening files in append mode (STR #990)
- The md5.h header and md5_* functions are now officially
private and have been renamed to avoid conflicts with
other implementations with the same name.
- The pdftops filter incorrectly embedded some Type1
fonts (STR #1093)
- The scheduler didn't detect a closed connection in the
middle of an IPP request (STR #1153)
- The scheduler could block trying to read the job status
if there was input pending and the job was cancelled in
the same input cycle (STR #1157)
- The scheduler could crash when deleting a class due to
infinite recursion.
- Updated the Zebra ZPL label printer driver to use the
run-length encoding and support more options.
- Updated serial backend to scan for /dev/ttyC* as well
as /dev/ttyc* for Cyclades serial ports (STR #1049)
- The scheduler could hang reading the job status under
certain circumstances (STR #1068)
- The USB backend termination signal code was inverted
(STR #1046)
- Moved enable and disable commands to sbindir to be
consistent.
- Added new cupsRasterInterpretPPD() function for RIP
filters to setup the raster page header from
PostScript commands in a PPD file.
- The CUPS browsing protocol now offers a "delete" bit
to remove printers as soon as they are deleted on the
server or as soon as the server shuts down gracefully
(STR #793)
- The CUPS_SERVER and ServerName directives (client.conf
and ~/.cupsrc) may now contain names of the form
"server:port" and "/path/to/domain/socket".
- The "cancel -u user" command now works for ordinary
users (STR #751)
- Added test run support to "make test" target (STR #64)
- Added domain socket support (STR #656)
- Added BrowseLocalOptions directive to allow the
administrator to add printer URI options to the browse
URI, e.g. "encryption=required" (STR #732)
- Added BrowseRemoteOptions directive to allow the
administrator to add standard URI options to the
remote printer URI, e.g. "encryption=required" (STR
#732)
- Now put "-I.." compiler option in front of all others
to ensure that local CUPS headers are used before
installed headers (STR #437)
- New cupsLangPrintf() and cupsLangPuts() for localized
interfaces.
- Now support custom attributes and extended options in
PPD files.
- Now provide functions to save PPD files.
- New policy mechanism allows per-operation and
per-printer control over what users and groups are
allowed to do various IPP operations.
- New error policy mechanism to control how aborted
backend errors are handled by the scheduler
(abort-job, retry-job, requeue-job, stop-printer)
- Updated the printer test page with a better color
wheel and a separate grayscale ramp.
- A single backend process is now run to send all print
data for a job.
- Backends and filters can now send and receive
backchannel data over file descriptor 3.
- Updated the raster stream format to support more
user-defined attributes and to do compression of the
page data.
- Updated the German localization (STR #2443)
- cupsAdminGetServerSettings() did not handle </Foo> properly.
- When lprm and cancel are run with no job ID, they now will
cancel the first stopped job if no pending or processing
jobs are left in the queue.
- The scheduler now logs successful print jobs, filter
failures, and the job file types at the default log
level (STR #2458)
- The scheduler now logs the usernames it is using for
authorization at LogLevel debug instead of debug2 (STR #2448)
- Added Intellitech Intellibar and Zebra CPCL PPDs to the list
of installed PPDs.
- Added 6" and 8" wide label sizes for the Zebra ZPL Label
Printer driver (STR #2442)
- The cupsaddsmb program and web interface now support
exporting of 64-bit Windows drivers, when available
(STR #2439)
- Moving a job that was printing did not stop the job on the
original printer (STR #2262)
- The cups-lpd mini-daemon did not work on Mac OS X server.
- Added httpGetAuthString() and httpSetAuthString() APIs to get
and set the current (cached) authorization string to use for
HTTP requests.
- Updated the default cupsd.conf policy to list the
"administrative" operations separately from the "printer
control" operations so that it is easier to define a
group of users that are "printer operators".
- The web interface now pulls the default cupsd.conf file
from cupsd.conf.default in the CUPS config directory.
- Added a help file for using Kerberos with CUPS.
- The scheduler now strips the "@KDC" portion of Kerberos
usernames since those usernames typically do not appear in
the group membership lists used by CUPS.
- cupsMarkOptions() could (incorrectly) leave multiple option
choices marked.
- Backends could (incorrectly) run as root during discovery
(STR #2454)
- Avahi is now supported for DNS-SD (Bonjour) printer sharing
(STR #2455)
- The default cupsd.conf file had typos and old operation names
(STR #2450)
- The scheduler now erases authentication cache files using the
7-pass US DoD algorithm.
- Delegated Kerberos credentials (proxy authentication) did not
work.
- The filter makefile did not optimize the libcupsimage.2.dylib
with a sectorder file.
- The IPP backend incorrectly wrote an empty printer message
when processing the "none" state reason.
- The USB backend could deadlock on Mac OS X while performing
a side-channel command.
- The scheduler did not prevent remote queues from being
shared/published.
- The scheduler did not remove the temporary request file on
authentication errors.
- ppdLocalizeIPPReason() did not handle "scheme:" schemes or
"file" URLs.
- ppdLocalizeIPPReason() was not exported on Mac OS X.
CHANGES IN CUPS V1.3b1
- Copyright updates - CUPS is now owned by Apple Inc.
- Documentation updates (STR #1775, STR #2027, STR #2130,
STR #2131, STR #2263, STR #2356, STR #2397)
- Added new cupsfilter utility (STR #1734)
- Added new job-printer-state-message and
job-printer-state-reasons attributes to jobs (STR #2418)
- Added LDAP+SSL support (STR #1967)
- CUPS now supports authentication via peer credentials
over domain sockets (STR #2242, STR #2277)
- The CUPS sample driver PPDs are now generated by the PPD
compiler and include all of the localized languages by
default (STR #2164)
- You can now specify "AuthType Default" in the cupsd.conf
file to use the default authentication defined by the
DefaultAuthType directive.
- The SNMP backend no longer adds a default Address line
when none is specified in the snmp.conf file; this allows
the backend to be easily disabled as needed (STR #2434)
- Added a new cupsctl command for doing basic changes to
the cupsd.conf file (STR #1777)
- Added a new ppdLocalizeIPPReason() function to get the
localized text/URI for a given IPP reason keyword for a
driver.
- Removed the deskjet2.ppd driver, as it only worked with
a very small subset of HP DeskJet printers and was
confusing to users. The rastertohp driver still
supports the deskjet2.ppd options for existing queues.
- The scheduler did not add a trailing banner page if a
client did not specify the last document in a job (STR
#1711)
- The scheduler did not report Bonjour shared printers as
remote printers (STR #2384)
- Added new -R and -W options to the cupstestppd program
for greater control over the testing of PPDs.
- Added a new cupsGetServerPPD() function for getting
an available PPD from the server (STR #2334)
- Added a new cupsDoIORequest() function for reading
and writing files via IPP requests (STR #2334)
- Added a new CUPS_GET_PPD operation for getting an
available PPD file on the server (STR #2334)
- CUPS_GET_PPDS now reports multiple ppd-product values
based on the PPD ModelName and Product strings (STR
#2334, STR #2383)
- CUPS_GET_PPDS now reports the PSVersion attributes
from a PPD file in the ppd-psversion attribute
(STR #2334)
- CUPS_GET_PPDS now reports the cupsModelNumber attribute
from a PPD file in the ppd-model-number attribute (STR
#2383)
- CUPS_GET_PPDS now reports a driver type string in the
ppd-type attribute based on the cupsFax and cupsFilter
attributes in a PPD file (STR #2383)
- Added a new printer attribute called "cups-version"
which reports the version of CUPS that is running
(STR #2240)
- backendRunLoop() now aborts immediately on SIGTERM
if no data has been written yet (STR #2103)
- Due to poor IPP support from the vendors, the SNMP
backend no longer tries IPP connections; instead,
it now uses a lookup file with fallback to port 9100
(socket://address) and 515 (lpd://address) printing
(STR #2035, STR #2354)
- The scheduler now recreates the CUPS log directory as
needed (STR #2353)
- cupsLangDefault() now maps new-style Apple locale names
to the traditional ll_CC form (STR #2357)
- Add new cupsArrayNew2() API to support hashed lookups
of array elements (STR #2358)
- ppdConflicts() optimizations (STR #2358)
- The cupstestppd program now tests for existing filters,
icons, profiles, and dialog extensions (STR #2326)
- The web interface no longer lists new printers on the
main administration page. Instead, a new "List Available
Printers" button is provided that shows a separate page
with the list of printers.
- The web interface now supports setting the banner and
policy options on raw printers and classes (STR #2238)
- The socket backend now reads any pending back-channel
data before shutting down the socket (STR #2325)
- Added a new ErrorPolicy directive in the cupsd.conf
file (STR #1871)
- Printers that use JCL options are now exported to Samba
correctly (STR #1985)
- The IPP backend now relays printer-state-message values
from the server to the client (STR #2109)
- Added support for the PWG printer-alert and
printer-alert-description attributes (STR #2088)
- Added support for LPD "stream" mode (STR #2036)
- The scheduler now reports the PostScript product string
from PPD files in CUPS-Get-PPDs responses (STR #1900)
- Raw printing with queues pointing to the file pseudo-
device and multiple files and/or banners now works (STR
#1933)
- Added new public cupsAdminGetServerSettings() and
cupsAdminSetServerSettings() APIs.
- Added new "makebuttons" script in the "tools" directory
for creating web interface buttons (STR #2231)
- Added support for DNS-SD (aka "Bonjour") printer sharing
(STR #1171)
- Job operations (cancel, hold, release, etc.) from the
web interface now return back to the original page (STR
#2239)
- The classes or printers list is now shown after a
successful deletion from the web interface (STR #1999)
- The default configuration now allows browse packets from
any address (STR #2008)
- The web interface now provides an "allow printing from the
Internet" check box (STR #1897)
- The notify-events-default and
notify-lease-duration-default attributes can now be set
(STR #1671)
- Server-side default options are now sent to clients when
the "printer-defaults" attribute group is requested (STR
#1923)
- Added support for Linux "relro" linker option (STR #1614)
- CUPS now validates the number-up option value (STR #1329)
- The on-line help now provides better search capabilities
(STR #1701)
- The web interface "Add This Printer" button now allows you
to change the printer name, description, and location
(STR #1646)
- Added support for Mac OS X authorization services
(STR #2206)
- Added support for driver-specific pre-filters (STR #2108)
- Added a new side-channel API for drivers and backends
for basic device control and information queries (STR
#1898)
- The scheduler now uses poll(), epoll(), or /dev/kqueue
instead of select() when possible (STR #1261)
- Added new cupsArrayGetIndex() and cupsArrayGetInsert()
functions to get the current index and insertion
positions of an array.
- Added a new --with-max-copies configure option (STR
#2090)
- Added new cupsRemoveDest() and cupsSetDefaultDest()
functions.
- Added support for cupsPJLCharset attribute in PPD files
which specifies the character set that is used in PJL
strings (STR #1969)
- Moved the definition of the (private) _http_s structure
to http-private.h; code that directly accesses the
http_t members will no longer compile!
- Added support for setting the document-format-default
attribute on a per-printer basis.
- Added support for IntelliBar label printers.
+38 -30
Ver Arquivo
@@ -1,37 +1,45 @@
CREDITS.txt - 02/23/2006
CREDITS.txt - 2007-02-05
------------------------
Few projects are completed by one person, and CUPS is no exception. We'd
like to thank the following individuals for their contributions:
Nathaniel Barbour - Lots of testing and feedback.
N. Becker - setsid().
Jean-Eric Cuendet - GhostScript filters for CUPS.
Van Dang - HTTP and IPP policeman.
L. Peter Deutsch - MD5 code.
Dr. ZP Han - setgid()/setuid().
Guy Harris - *BSD shared libraries and lots of other fixes.
Bjoern Jacke - I18N stuff.
Wang Jian - CUPS RPM corrections.
Roderick Johnstone - Beta tester of the millenium.
Till Kamppeter - Bug fixes, beta testing, evangelism.
Kenshi Muto - Japanese localization, patches, and testing.
Kiko - Bug fixes.
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
Mark Lawrence - Microsoft interoperability testing.
Jeff Licquia - Bug fixes, beta testing, evangelism.
Jason McMullan - Original CUPS RPM distributions.
Wes Morgan - *BSD fixes.
Ulrich Oldendorf - German locale.
Giulio Orsero - Bug fixes and testing.
Kurt Pfeifle - Bug fixes, beta testing, evangelism.
Gilles QUERRET - French man pages.
Petter Reinholdtsen - HP-UX compiler stuff.
Stuart Stevens - HP JetDirect IPP information.
Andrea Suatoni - IRIX desktop integration and testing.
Tomohiro Kato - Japanese localization.
Tim Waugh - Lots of patches, testing, and Linux integration.
Yugami - LDAP browsing support.
Nathaniel Barbour - Lots of testing and feedback.
N. Becker - setsid().
Philippe Combes - French localization and buttons script.
Jean-Eric Cuendet - GhostScript filters for CUPS.
Van Dang - HTTP and IPP policeman.
L. Peter Deutsch - MD5 code.
Dr. ZP Han - setgid()/setuid().
Guy Harris - *BSD shared libraries and lots of other
fixes.
Bjoern Jacke - I18N stuff.
Wang Jian - CUPS RPM corrections.
Roderick Johnstone - Beta tester of the millenium.
Till Kamppeter - Bug fixes, beta testing, evangelism.
Kenshi Muto - Japanese localization, patches, and
testing.
Kiko - Bug fixes.
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
Marek Laane - Estonian translation.
Mark Lawrence - Microsoft interoperability testing.
Jeff Licquia - Bug fixes, beta testing, evangelism.
Jason McMullan - Original CUPS RPM distributions.
Wes Morgan - *BSD fixes.
Daniel Nylander - Swedish localization.
Giulio Orsero - Bug fixes and testing.
Michal Osowiecki - Polish localization.
Kurt Pfeifle - Bug fixes, beta testing, evangelism.
Vincenzo Reale - Italian localization.
Petter Reinholdtsen - HP-UX compiler stuff.
Juan Pablo González Riopedre - Spanish localization.
Opher Shachar - Hebrew localization.
Stuart Stevens - HP JetDirect IPP information.
Andrea Suatoni - IRIX desktop integration and testing.
Tomohiro Kato - Japanese localization.
Tim Waugh - Lots of patches, testing, and Linux
integration.
Yugami - LDAP browsing support.
If I've missed someone, please let me know by sending an email to
"mike@easysw.com".
"msweet@apple.com".
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
INSTALL - CUPS v1.2b2 - 2006-03-09
----------------------------------
INSTALL - CUPS v1.3rc2 - 2007-07-30
-----------------------------------
This file describes how to compile and install CUPS from source
code. For more information on CUPS see the file called
+65 -61
Ver Arquivo
@@ -1,12 +1,10 @@
Common UNIX Printing System License Agreement
Copyright 1997-2006 by Easy Software Products
44141 AIRPORT VIEW DR STE 204
HOLLYWOOD, MARYLAND 20636 USA
Copyright 2007 by Apple Inc.
1 Infinite Loop
Cupertino, CA 95014 USA
Voice: +1.301.373.9600
Email: cups-info@cups.org
WWW: http://www.cups.org
WWW: http://www.cups.org/
INTRODUCTION
@@ -17,12 +15,12 @@ General Public License ("LGPL"), Version 2, with exceptions for
Apple operating systems and the OpenSSL toolkit. A copy of the
exceptions and licenses follow this introduction.
The GNU LGPL applies to the CUPS API library, located in the
"cups" subdirectory of the CUPS source distribution and in the
"cups" include directory and library files in the binary
distributions. The GNU GPL applies to the remainder of the CUPS
distribution, including the "pdftops" filter which is based upon
Xpdf and the CUPS imaging library.
The GNU LGPL applies to the CUPS and CUPS Imaging libraries
located in the "cups" and "filter" subdirectories of the CUPS
source distribution and in the "cups" include directory and
library files in the binary distributions. The GNU GPL applies to
the remainder of the CUPS distribution, including the "pdftops"
filter which is based upon Xpdf.
For those not familiar with the GNU GPL, the license basically
allows you to:
@@ -32,28 +30,25 @@ allows you to:
binary form.
- Sell verbatim copies of the software for a media fee, or
sell support for the software.
- Distribute or sell printer drivers and filters that use
CUPS so long as source code is made available under the
GPL.
What this license *does not* allow you to do is make changes or
add features to CUPS and then sell a binary distribution without
source code. You must provide source for any new drivers,
changes, or additions to the software, and all code must be
provided under the GPL or LGPL as appropriate. The only
exceptions to this are the portions of the CUPS software covered
by the Apple operating system license exceptions outlined later
in this license agreement.
source code. You must provide source for any changes or additions
to the software, and all code must be provided under the GPL or
LGPL as appropriate. The only exceptions to this are the portions
of the CUPS software covered by the Apple operating system
license exceptions outlined later in this license agreement.
The GNU LGPL relaxes the "link-to" restriction, allowing you to
develop applications that use the CUPS API library under other
licenses and/or conditions as appropriate for your application.
develop applications that use the CUPS and CUPS Imaging libraries
under other licenses and/or conditions as appropriate for your
application, driver, or filter.
LICENSE EXCEPTIONS
In addition, as the copyright holder of CUPS, Easy Software
Products grants the following special exceptions:
In addition, as the copyright holder of CUPS, Apple Inc. grants
the following special exceptions:
1. Apple Operating System Development License Exception;
@@ -96,49 +91,58 @@ Products grants the following special exceptions:
2. OpenSSL Toolkit License Exception;
a. Easy Software Products explicitly allows the
compilation and distribution of the CUPS software
with the OpenSSL Toolkit.
a. Apple Inc. explicitly allows the compilation and
distribution of the CUPS software with the OpenSSL
Toolkit.
No developer is required to provide these exceptions in a
derived work.
KERBEROS SUPPORT CODE
The Kerberos support code ("KSC") is copyright 2006 by Jelmer
Vernooij and is provided 'as-is', without any express or implied
warranty. In no event will the author or Apple Inc. be held
liable for any damages arising from the use of the KSC.
Sources files containing KSC have the following text at the top
of each source file:
This file contains Kerberos support code, copyright 2006 by
Jelmer Vernooij.
The KSC copyright and license apply only to Kerberos-related
feature code in CUPS. Such code is typically conditionally
compiled based on the present of the HAVE_GSSAPI preprocessor
definition.
Permission is granted to anyone to use the KSC for any purpose,
including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of the KSC must not be misrepresented; you
must not claim that you wrote the original software. If
you use the KSC in a product, an acknowledgment in the
product documentation would be appreciated but is not
required.
2. Altered source versions must be plainly marked as such,
and must not be misrepresented as being the original
software.
3. This notice may not be removed or altered from any source
distribution.
TRADEMARKS
Easy Software Products has trademarked the Common UNIX Printing
System, CUPS, and CUPS logo. You may use these names and logos
in any direct port or binary distribution of CUPS. Please
contact Easy Software Products for written permission to use
them in derivative products. Our intention is to protect the
value of these trademarks and ensure that any derivative product
meets the same high-quality standards as the original.
BINARY DISTRIBUTION RIGHTS
Easy Software Products also sells rights to the CUPS source code
under a binary distribution license for vendors that are unable
to release source code for their drivers, additions, and
modifications to CUPS under the GNU GPL and LGPL. For
information please contact us at the address shown above.
The Common UNIX Printing System provides a "pdftops" filter that
is based on the Xpdf software. For binary distribution licensing
of this software, please contact:
Derek B. Noonburg
Email: derekn@glyphandcog.com
WWW: http://www.glyphandcog.com/
SUPPORT
Easy Software Products sells software support for CUPS as well
as a commercial printing product based on CUPS called ESP Print
Pro. You can find out more at our web site:
http://www.easysw.com/
Apple Inc. has trademarked the Common UNIX Printing System, CUPS,
and CUPS logo. You may use these names and logos in any direct port
or binary distribution of CUPS. Please contact Apple Inc. for written
permission to use them in derivative products. Our intention is to
protect the value of these trademarks and ensure that any derivative
product meets the same high-quality standards as the original.
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
+59 -29
Ver Arquivo
@@ -3,23 +3,14 @@
#
# Common makefile definitions for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2007 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 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
#
@@ -73,6 +64,14 @@ CUPS_PRIMARY_SYSTEM_GROUP = @CUPS_PRIMARY_SYSTEM_GROUP@
CUPS_CONFIG_FILE_PERM = @CUPS_CONFIG_FILE_PERM@
CUPS_LOG_FILE_PERM = @CUPS_LOG_FILE_PERM@
#
# Languages to install...
#
LANGUAGES = @LANGUAGES@
INSTALL_LANGUAGES = @INSTALL_LANGUAGES@
UNINSTALL_LANGUAGES = @UNINSTALL_LANGUAGES@
#
# Libraries...
#
@@ -85,6 +84,7 @@ LIBMALLOC = @LIBMALLOC@
LIBPAPER = @LIBPAPER@
LIBPNG = @LIBPNG@
LIBSLP = @LIBSLP@
LIBGSSAPI = @LIBGSSAPI@
LIBTIFF = @LIBTIFF@
LIBZ = @LIBZ@
@@ -97,47 +97,67 @@ INSTALLSTATIC = @INSTALLSTATIC@
#
# Program options...
#
# OPTIM defines the common compiler optimization/debugging options.
# OPTIONS defines other compile-time options (currently only -dDEBUG for
# extra debug info)
# ARCHFLAGS Defines the default architecture build options.
# ARCH32FLAGS Defines the 32-bit architecture build options, used
# when compiling separate 32/64-bit libraries.
# ARCH64FLAGS Defines the 64-bit architecture build options, used
# when compiling separate 32/64-bit libraries.
# OPTIM Defines the common compiler optimization/debugging options
# for all architectures.
# OPTIONS Defines other compile-time options (currently only -DDEBUG
# for extra debug info)
#
ALL_CFLAGS = $(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
$(OPTIONS) $(CFLAGS)
ARCHFLAGS = @ARCHFLAGS@
ARFLAGS = @ARFLAGS@
BACKLIBS = @BACKLIBS@
CFLAGS = -I.. $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CFLAGS@ \
CFLAGS = -I.. @CPPFLAGS@ @CFLAGS@ \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
COMMONLIBS = @LIBS@
CUPSDLIBS = @CUPSDLIBS@
CXXFLAGS = -I.. $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
CXXFLAGS = -I.. $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
CXXLIBS = @CXXLIBS@
DSOFLAGS = @DSOFLAGS@
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
IMGLIBS = @IMGLIBS@ -lm
LDFLAGS = -L../cups -L../filter $(RC_CFLAGS) @LDFLAGS@ $(OPTIM)
DNSSDLIBS = @DNSSDLIBS@
FONTS = @FONTS@
IMGLIBS = @IMGLIBS@
IMGFILTERS = @IMGFILTERS@
LAUNCHDLIBS = @LAUNCHDLIBS@
LDFLAGS = -L../cups -L../filter @LDARCHFLAGS@ \
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
LEGACY_BACKENDS = @LEGACY_BACKENDS@
LIBCUPSORDER = @LIBCUPSORDER@
LIBCUPSIMAGEORDER = @LIBCUPSIMAGEORDER@
LINKCUPS = @LINKCUPS@ $(SSLLIBS)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
LIBS = $(LINKCUPS) $(COMMONLIBS)
OPTIM = @OPTIM@
OPTIONS =
PAMLIBS = @PAMLIBS@
PAP = @PAP@
PDFTOPS = @PDFTOPS@
PHPDIR = @PHPDIR@
SSLFLAGS = @SSLFLAGS@
SSLLIBS = @SSLLIBS@
LAUNCHDLIBS = @LAUNCHDLIBS@
#
# Separate 32/64-bit library support...
#
C32FLAGS = @C32FLAGS@
ARCH32FLAGS = @ARCH32FLAGS@
DSO32FLAGS = @DSO32FLAGS@
INSTALL32 = @INSTALL32@
LIB32CUPS = @LIB32CUPS@
LIB32CUPSIMAGE = @LIB32CUPSIMAGE@
LIB32DIR = $(BUILDROOT)@LIB32DIR@
UNINSTALL32 = @UNINSTALL32@
C64FLAGS = @C64FLAGS@
ARCH64FLAGS = @ARCH64FLAGS@
DSO64FLAGS = @DSO64FLAGS@
INSTALL64 = @INSTALL64@
LIB64CUPS = @LIB64CUPS@
LIB64CUPSIMAGE = @LIB64CUPSIMAGE@
@@ -152,12 +172,16 @@ UNINSTALL64 = @UNINSTALL64@
# We have to define these first because autoconf uses ${prefix}
# and ${exec_prefix} for most of the other directories...
#
# The "datarootdir" variable may not get defined if you are using
# a version of autoconf prior to 2.60.
#
# This is immediately followed by definition in ALL CAPS for the
# needed directories...
#
bindir = @bindir@
datadir = @datadir@
datarootdir = @datarootdir@
exec_prefix = @exec_prefix@
includedir = @includedir@
infodir = @infodir@
@@ -180,6 +204,7 @@ BINDIR = $(BUILDROOT)@bindir@
CACHEDIR = $(BUILDROOT)@CUPS_CACHEDIR@
DATADIR = $(BUILDROOT)@CUPS_DATADIR@
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
ICONDIR = @ICONDIR@
INCLUDEDIR = $(BUILDROOT)$(includedir)
INITDIR = @INITDIR@
INITDDIR = @INITDDIR@
@@ -187,12 +212,17 @@ LIBDIR = $(BUILDROOT)$(libdir)
LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
MANDIR = $(BUILDROOT)@mandir@
MENUDIR = @MENUDIR@
PMANDIR = $(BUILDROOT)@PMANDIR@
RCLEVELS = @RCLEVELS@
RCSTART = @RCSTART@
RCSTOP = @RCSTOP@
REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
SBINDIR = $(BUILDROOT)@sbindir@
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
STATEDIR = $(BUILDROOT)@CUPS_STATEDIR@
XINETD = @XINETD@
MAN1EXT = @MAN1EXT@
MAN5EXT = @MAN5EXT@
@@ -216,19 +246,19 @@ DBUSDIR = @DBUSDIR@
.c.o:
echo Compiling $<...
$(CC) $(OPTIM) $(CFLAGS) -c $<
$(CC) $(ARCHFLAGS) $(OPTIM) $(ALL_CFLAGS) -c $<
.c.32.o:
echo Compiling 32-bit $<...
$(CC) $(C32FLAGS) $(OPTIM) $(CFLAGS) -c -o $@ $<
$(CC) $(ARCH32FLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
.c.64.o:
echo Compiling 64-bit $<...
$(CC) $(C64FLAGS) $(OPTIM) $(CFLAGS) -c -o $@ $<
$(CC) $(ARCH64FLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
.cxx.o:
echo Compiling $<...
$(CXX) $(OPTIM) $(CXXFLAGS) -c $<
$(CXX) $(ARCHFLAGS) $(OPTIM) $(CXXFLAGS) -c $<
.man.1 .man.1m .man.5 .man.7 .man.8:
echo Linking $<...
+128 -39
Ver Arquivo
@@ -3,23 +3,14 @@
#
# Top-level Makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2007 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-3142 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
include Makedefs
@@ -29,9 +20,9 @@ include Makedefs
#
DIRS = cups backend berkeley cgi-bin filter locale man monitor \
notifier pdftops scheduler systemv test \
notifier $(PDFTOPS) scheduler systemv test \
$(PHPDIR) \
conf data doc fonts ppd templates
conf data doc $(FONTS) ppd templates
#
@@ -57,6 +48,28 @@ clean:
done
#
# Remove all non-distribution files...
#
distclean: clean
$(RM) Makedefs config.h config.log config.status
$(RM) cups-config conf/cupsd.conf conf/pam.std
$(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html
$(RM) doc/index.html
$(RM) init/cups.sh init/cups-lpd
$(RM) man/client.conf.man
$(RM) man/cups-deviced.man man/cups-driverd.man
$(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
$(RM) man/cupsd.conf.man man/lpoptions.man
$(RM) packaging/cups.list
$(RM) templates/edit-config.tmpl templates/header.tmpl
-$(RM) doc/*/index.html
-$(RM) templates/*/edit-config.tmpl
-$(RM) templates/*/header.tmpl
-$(RM) -r autom4te*.cache
#
# Make dependencies
#
@@ -68,6 +81,14 @@ depend:
done
#
# Generate a ctags file...
#
ctags:
ctags -R .
#
# Install object and target files...
#
@@ -80,36 +101,73 @@ install: installhdrs
echo Installing cups-config script...
$(INSTALL_DIR) -m 755 $(BINDIR)
$(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
echo Installing startup script...
if test "x$(INITDIR)" != "x"; then \
if test "x$(INITDIR)" != x; then \
echo Installing init scripts...; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
for level in $(RCLEVELS); do \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
if test `uname` = HP-UX; then \
level=`expr $$level - 1`; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
fi; \
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
done; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc2.d; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc3.d; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc5.d; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
fi
if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
echo Installing StartupItems files...; \
$(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
$(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
echo Installing LaunchDaemons configuration files...; \
$(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
$(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
case `uname -r` in \
8.*) \
$(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
$(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \
$(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \
$(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \
;; \
esac \
else \
echo Installing RC script...; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
fi \
fi
if test "x$(DBUSDIR)" != "x"; then \
if test "x$(DBUSDIR)" != x; then \
echo Installing cups.conf in $(DBUSDIR)...;\
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR); \
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/cups.conf; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
fi
if test "x$(XINETD)" != x; then \
echo Installing xinetd configuration file for cups-lpd...; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
$(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \
fi
if test "x$(MENUDIR)" != x; then \
echo Installing desktop menu...; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \
$(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \
fi
if test "x$(ICONDIR)" != x; then \
echo Installing desktop icons...; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \
$(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \
$(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \
$(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \
$(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \
fi
@@ -138,7 +196,7 @@ uninstall:
$(RM) $(BINDIR)/cups-config
-$(RMDIR) $(BINDIR)
echo Uninstalling startup script...
if test "x$(INITDIR)" != "x"; then \
if test "x$(INITDIR)" != x; then \
$(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
$(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
$(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
@@ -150,46 +208,77 @@ uninstall:
$(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
fi
if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
$(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \
$(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
$(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
$(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
$(RM) $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
$(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
else \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
fi \
$(RMDIR) $(BUILDROOT)$(INITDDIR); \
fi
if test "x$(DBUSDIR)" != "x"; then \
if test "x$(DBUSDIR)" != x; then \
echo Uninstalling cups.conf in $(DBUSDIR)...;\
$(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
$(RMDIR) $(BUILDROOT)$(DBUSDIR); \
fi
$(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd
$(RM) $(BUILDROOT)/usr/share/applications/cups.desktop
$(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png
$(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png
$(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png
$(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png
#
# Run the test suite...
#
check test: all
test: all
echo Running CUPS test suite...
cd test; ./run-stp-tests.sh
check: all
echo Running CUPS test suite with defaults...
cd test; ./run-stp-tests.sh 1 0 n
#
# Make software distributions using EPM (http://www.easysw.com/epm/)...
#
EPMFLAGS = -v
EPMFLAGS = -v --output-dir dist $(EPMARCH)
aix bsd deb depot inst osx pkg rpm setld slackware swinstall tardist:
aix bsd deb depot inst pkg setld slackware swinstall tardist:
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
epm:
epm $(EPMFLAGS) cups packaging/cups.list
epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
osx:
epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
rpm:
epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
.PHONEY: dist
dist: all
$(RM) -r dist
$(MAKE) $(MFLAGS) epm
case `uname` in \
*BSD*) $(MAKE) $(MFLAGS) bsd;; \
Darwin*) $(MAKE) $(MFLAGS) osx;; \
IRIX*) $(MAKE) $(MFLAGS) tardist;; \
Linux*) $(MAKE) $(MFLAGS) rpm;; \
SunOS*) $(MAKE) $(MFLAGS) pkg;; \
esac
#
+16 -45
Ver Arquivo
@@ -1,5 +1,5 @@
README - CUPS v1.2b2 - 2006-03-09
---------------------------------
README - CUPS v1.3rc2 - 2007-07-30
----------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
instead...
@@ -8,10 +8,10 @@ instead...
INTRODUCTION
CUPS provides a portable printing layer for UNIX(r)-based
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.
operating systems. It was developed by Easy Software Products
and is now owned and maintained by Apple Inc. to promote a
standard printing solution for all UNIX vendors and users. CUPS
provides the System V and Berkeley command-line interfaces.
CUPS uses the Internet Printing Protocol ("IPP") as the basis
for managing print jobs and queues. The Line Printer Daemon
@@ -26,18 +26,11 @@ INTRODUCTION
of GPL Ghostscript for CUPS called ESP Ghostscript is
available separately to support printing of PostScript files
within the CUPS driver framework. Sample drivers for Dymo,
EPSON, HP, and OKIDATA printers are included that use these
filters.
Drivers for thousands of printers are provided with our ESP
Print Pro software, available at:
http://www.easysw.com/printpro/
EPSON, HP, OKIDATA, and Zebra printers are included that use
these filters.
CUPS is licensed under the GNU General Public License and GNU
Library General Public License. Please contact Easy Software
Products for commercial support and "binary distribution"
rights.
Library General Public License versions 2.
READING THE DOCUMENTATION
@@ -60,19 +53,13 @@ GETTING SUPPORT AND OTHER RESOURCES
http://www.cups.org/newsgroups.php
Commercial support (with a guaranteed response time) is
available from Easy Software Products. For more information
see:
http://www.easysw.com/cups/
See the CUPS web site at "http://www.cups.org/" for other
site links.
SETTING UP PRINTER QUEUES USING YOUR WEB BROWSER
CUPS 1.2 includes a web-based administration tool that allows
CUPS 1.3 includes a web-based administration tool that allows
you to manage printers, classes, and jobs on your server.
Open the following URL in your browser to access the printer
administration tools:
@@ -101,6 +88,7 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
Driver PPD File
----------------------------- ------------
Dymo Label Printers dymo.ppd
Intellitech Intellibar intelbar.ppd
EPSON Stylus Color Series stcolor.ppd
EPSON Stylus Photo Series stphoto.ppd
EPSON Stylus New Color Series stcolor2.ppd
@@ -111,6 +99,7 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
HP LaserJet Series laserjet.ppd
OKIDATA 9-Pin Series okidata9.ppd
OKIDATA 24-Pin Series okidat24.ppd
Zebra CPCL Label Printer zebracpl.ppd
Zebra EPL1 Label Printer zebraep1.ppd
Zebra EPL2 Label Printer zebraep2.ppd
Zebra ZPL Label Printer zebra.ppd
@@ -131,10 +120,7 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
The sample drivers provide basic printing capabilities, but
generally do not exercise the full potential of the printers
or CUPS. For fully-functional commercial printer drivers
check out our ESP Print Pro software at:
http://www.easysw.com/printpro/
or CUPS.
PRINTING FILES
@@ -168,9 +154,9 @@ PRINTING FILES
LEGAL STUFF
CUPS is Copyright 1993-2006 by Easy Software Products. CUPS,
the CUPS logo, and the Common UNIX Printing System are the
trademark property of Easy Software Products.
CUPS is Copyright 2007 by Apple Inc. CUPS, the CUPS logo, and
the Common UNIX Printing System are the trademark property of
Apple Inc.
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
@@ -187,18 +173,3 @@ LEGAL STUFF
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
"doc/help/license.html" or "LICENSE.txt" files for more
information.
For commercial licensing information, please contact:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: +1.301.373.9600
Email: cups-info@cups.org
WWW: http://www.cups.org/
Note that commercial licensors may also require a license from
Derek B. Noonburg who developed the Xpdf software used to print
PDF files.
+50 -29
Ver Arquivo
@@ -1,29 +1,50 @@
# DO NOT DELETE
betest.o: ../cups/string.h ../config.h
ipp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
ipp.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/backend.h ../cups/cups.h
ipp.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
ipp.o: ../cups/language.h ../cups/string.h
lpd.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
lpd.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
lpd.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
lpd.o: ../cups/string.h
parallel.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
parallel.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
parallel.o: ../cups/language.h ../cups/string.h ../config.h ieee1284.c
parallel.o: ../cups/debug.h
scsi.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
scsi.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
scsi.o: ../cups/language.h ../cups/string.h ../config.h
serial.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
serial.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
serial.o: ../cups/language.h ../cups/string.h ../config.h
socket.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
socket.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
socket.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
socket.o: ../cups/string.h
test1284.o: ../cups/string.h ../config.h ieee1284.c ../cups/debug.h
usb.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
usb.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
usb.o: ../cups/language.h ../cups/string.h ../config.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
betest.o: betest.c ../cups/string.h ../config.h
ipp.o: ipp.c ../cups/http-private.h ../config.h ../cups/http.h \
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/backend.h \
../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/language.h ../cups/i18n.h \
../cups/transcode.h ../cups/string.h
lpd.o: lpd.c ../cups/backend.h ../cups/http-private.h ../config.h \
../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \
../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h
pap.o: pap.c ../config.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
../cups/backend.h ../cups/sidechannel.h ../cups/i18n.h \
../cups/transcode.h
parallel.o: parallel.c backend-private.h ../cups/backend.h \
../cups/sidechannel.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
../config.h
scsi.o: scsi.c ../cups/backend.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
../config.h scsi-linux.c
serial.o: serial.c backend-private.h ../cups/backend.h \
../cups/sidechannel.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
../config.h
snmp.o: snmp.c ../cups/http-private.h ../config.h ../cups/http.h \
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h backend-private.h \
../cups/backend.h ../cups/sidechannel.h ../cups/cups.h ../cups/ppd.h \
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../cups/array.h \
../cups/file.h
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/http.h \
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h backend-private.h \
../cups/backend.h ../cups/sidechannel.h ../cups/cups.h ../cups/ppd.h \
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h
test1284.o: test1284.c ../cups/string.h ../config.h ieee1284.c \
backend-private.h ../cups/backend.h ../cups/sidechannel.h \
../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h
usb.o: usb.c ../cups/backend.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/string.h ../config.h ../cups/i18n.h \
../cups/transcode.h usb-unix.c ieee1284.c backend-private.h \
../cups/sidechannel.h ../cups/debug.h
+57 -30
Ver Arquivo
@@ -3,34 +3,26 @@
#
# Backend makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2007 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 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
# This file is subject to the Apple OS-Developed Software exception.
#
include ../Makedefs
RBACKENDS = ipp lpd
UBACKENDS = parallel scsi serial socket usb
TARGETS = betest test1284 $(RBACKENDS) $(UBACKENDS)
OBJS = betest.o ipp.o lpd.o parallel.o scsi.o \
serial.o socket.o test1284.o usb.o
RBACKENDS = lpd
UBACKENDS = ipp $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb
TARGETS = betest test1284 libbackend.a $(RBACKENDS) $(UBACKENDS)
LIBOBJS = ieee1284.o runloop.o
OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \
serial.o snmp.o socket.o test1284.o usb.o
#
@@ -45,7 +37,7 @@ all: $(TARGETS)
#
clean:
$(RM) $(OBJS) $(TARGETS) http
$(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http
#
@@ -70,6 +62,12 @@ install: all
done
$(RM) $(SERVERBIN)/backend/http
$(LN) ipp $(SERVERBIN)/backend/http
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(TARGETS); do \
cp $$file $(SYMROOT); \
done \
fi
#
@@ -104,6 +102,17 @@ test1284: test1284.o ../cups/libcups.a
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
# libbackend.a
#
libbackend.a: $(LIBOBJS)
echo Archiving $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
#
# ieee1394
#
@@ -136,13 +145,22 @@ lpd: lpd.o ../cups/$(LIBCUPS)
$(CC) $(LDFLAGS) -o lpd lpd.o $(LIBS)
#
# pap
#
pap: pap.o ../cups/$(LIBCUPS)
echo Linking $@...
$(CC) $(LDFLAGS) -o pap pap.o $(BACKLIBS) $(LIBS) -framework AppleTalk
#
# parallel
#
parallel: parallel.o ../cups/$(LIBCUPS)
parallel: parallel.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o parallel parallel.o $(LIBS)
$(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
#
@@ -160,28 +178,37 @@ scsi.o: scsi.c scsi-irix.c scsi-linux.c
# serial
#
serial: serial.o ../cups/$(LIBCUPS)
serial: serial.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o serial serial.o $(BACKLIBS) $(LIBS)
$(CC) $(LDFLAGS) -o serial serial.o libbackend.a $(BACKLIBS) $(LIBS)
#
# snmp
#
snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
#
# socket
#
socket: socket.o ../cups/$(LIBCUPS)
socket: socket.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o socket socket.o $(LIBS)
$(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
#
# usb
#
usb: usb.o ../cups/$(LIBCUPS)
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o usb usb.o $(BACKLIBS) $(LIBS)
usb.o: usb.c usb-darwin.c usb-unix.c ieee1284.c
$(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(BACKLIBS) $(LIBS)
usb.o: usb.c usb-darwin.c usb-unix.c
#
+69
Ver Arquivo
@@ -0,0 +1,69 @@
/*
* "$Id$"
*
* Backend support definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 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"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_BACKEND_PRIVATE_H_
# define _CUPS_BACKEND_PRIVATE_H_
/*
* Include necessary headers.
*/
# include <cups/backend.h>
# include <cups/sidechannel.h>
# include <cups/cups.h>
# include <cups/debug.h>
# include <cups/i18n.h>
# include <stdlib.h>
# include <errno.h>
# include <cups/string.h>
# include <signal.h>
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Prototypes...
*/
extern int backendDrainOutput(int print_fd, int device_fd);
extern int backendGetDeviceID(int fd, char *device_id, int device_id_size,
char *make_model, int make_model_size,
const char *scheme, char *uri, int uri_size);
extern int backendGetMakeModel(const char *device_id, char *make_model,
int make_model_size);
extern ssize_t backendRunLoop(int print_fd, int device_fd, int use_bc,
void (*side_cb)(int print_fd, int device_fd,
int use_bc));
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_BACKEND_PRIVATE_H_ */
/*
* End of "$Id$".
*/
+4 -13
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Backend test program for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2005 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
+293 -168
Ver Arquivo
@@ -3,37 +3,30 @@
*
* IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* get_device_id() - Get the IEEE-1284 device ID string and corresponding
* URI.
* backendGetDeviceID() - Get the IEEE-1284 device ID string and
* corresponding URI.
* backendGetMakeModel() - Get the make and model string from the device ID.
*/
/*
* Include necessary headers.
*/
#include <cups/debug.h>
#include "backend-private.h"
#ifdef __linux
# include <sys/ioctl.h>
# include <linux/lp.h>
@@ -52,12 +45,12 @@
/*
* 'get_device_id()' - Get the IEEE-1284 device ID string and
* corresponding URI.
* 'backendGetDeviceID()' - Get the IEEE-1284 device ID string and
* corresponding URI.
*/
int /* O - 0 on success, -1 on failure */
get_device_id(
backendGetDeviceID(
int fd, /* I - File descriptor */
char *device_id, /* O - 1284 device ID */
int device_id_size, /* I - Size of buffer */
@@ -70,9 +63,9 @@ get_device_id(
char *attr, /* 1284 attribute */
*delim, /* 1284 delimiter */
*uriptr, /* Pointer into URI */
*mfg, /* Manufacturer string */
*mdl, /* Model string */
manufacturer[256], /* Manufacturer string */
serial_number[1024]; /* Serial number string */
int manulen; /* Length of manufacturer string */
#ifdef __linux
int length; /* Length of device ID info */
#endif /* __linux */
@@ -80,7 +73,8 @@ get_device_id(
struct ecpp_device_id did; /* Device ID buffer */
#endif /* __sun && ECPPIOC_GETDEVID */
DEBUG_printf(("get_device_id(fd=%d, device_id=%p, device_id_size=%d, "
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
"make_model=%p, make_model_size=%d, scheme=\"%s\", "
"uri=%p, uri_size=%d)\n", fd, device_id, device_id_size,
make_model, make_model_size, scheme ? scheme : "(null)",
@@ -90,90 +84,246 @@ get_device_id(
* Range check input...
*/
if (fd < 0 ||
!device_id || device_id_size < 32 ||
!make_model || make_model_size < 32)
if (!device_id || device_id_size < 32)
{
DEBUG_puts("get_device_id: Bad args!");
DEBUG_puts("backendGetDeviceID: Bad args!");
return (-1);
}
*device_id = '\0';
*make_model = '\0';
if (make_model)
*make_model = '\0';
if (uri)
*uri = '\0';
/*
* Get the device ID string...
*/
#ifdef __linux
if (!ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
if (fd >= 0)
{
/*
* Extract the length of the device ID string from the first two
* bytes. The 1284 spec says the length is stored MSB first...
* Get the device ID string...
*/
length = (((unsigned)device_id[0] & 255) << 8) +
((unsigned)device_id[1] & 255);
*device_id = '\0';
/*
* Check to see if the length is larger than our buffer; first
* assume that the vendor incorrectly implemented the 1284 spec,
* and then limit the length to the size of our buffer...
*/
#ifdef __linux
if (!ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
{
/*
* Extract the length of the device ID string from the first two
* bytes. The 1284 spec says the length is stored MSB first...
*/
if (length > (device_id_size - 2))
length = (((unsigned)device_id[1] & 255) << 8) +
((unsigned)device_id[0] & 255);
length = (((unsigned)device_id[0] & 255) << 8) +
((unsigned)device_id[1] & 255);
if (length > (device_id_size - 2))
length = device_id_size - 2;
/*
* Check to see if the length is larger than our buffer; first
* assume that the vendor incorrectly implemented the 1284 spec,
* and then limit the length to the size of our buffer...
*/
/*
* Copy the device ID text to the beginning of the buffer and
* nul-terminate.
*/
if (length > (device_id_size - 2))
length = (((unsigned)device_id[1] & 255) << 8) +
((unsigned)device_id[0] & 255);
memmove(device_id, device_id + 2, length);
device_id[length] = '\0';
}
if (length > (device_id_size - 2))
length = device_id_size - 2;
/*
* Copy the device ID text to the beginning of the buffer and
* nul-terminate.
*/
memmove(device_id, device_id + 2, length);
device_id[length] = '\0';
}
# ifdef DEBUG
else
printf("get_device_id: ioctl failed - %s\n", strerror(errno));
else
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
# endif /* DEBUG */
#endif /* __linux */
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
did.mode = ECPP_CENTRONICS;
did.len = device_id_size - 1;
did.rlen = 0;
did.addr = device_id;
did.mode = ECPP_CENTRONICS;
did.len = device_id_size - 1;
did.rlen = 0;
did.addr = device_id;
if (!ioctl(fd, ECPPIOC_GETDEVID, &did))
{
/*
* Nul-terminate the device ID text.
*/
if (!ioctl(fd, ECPPIOC_GETDEVID, &did))
{
/*
* Nul-terminate the device ID text.
*/
if (did.rlen < (device_id_size - 1))
device_id[did.rlen] = '\0';
else
device_id[device_id_size - 1] = '\0';
}
if (did.rlen < (device_id_size - 1))
device_id[did.rlen] = '\0';
else
device_id[device_id_size - 1] = '\0';
}
# ifdef DEBUG
else
printf("get_device_id: ioctl failed - %s\n", strerror(errno));
else
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
# endif /* DEBUG */
#endif /* __sun && ECPPIOC_GETDEVID */
}
DEBUG_printf(("get_device_id: device_id=\"%s\"\n", device_id));
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
if (!*device_id)
return (-1);
/*
* Get the make and model...
*/
if (make_model)
backendGetMakeModel(device_id, make_model, make_model_size);
/*
* Then generate a device URI...
*/
if (scheme && uri && uri_size > 32)
{
/*
* Look for the serial number field...
*/
if ((attr = strstr(device_id, "SERN:")) != NULL)
attr += 5;
else if ((attr = strstr(device_id, "SERIALNUMBER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, ";SN:")) != NULL)
attr += 4;
if (attr)
{
strlcpy(serial_number, attr, sizeof(serial_number));
if ((delim = strchr(serial_number, ';')) != NULL)
*delim = '\0';
}
else
serial_number[0] = '\0';
/*
* Generate the device URI from the manufacturer, make_model, and
* serial number strings.
*/
snprintf(uri, uri_size, "%s://", scheme);
if ((attr = strstr(device_id, "MANUFACTURER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, "Manufacturer:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, "MFG:")) != NULL)
attr += 4;
if (attr)
{
strlcpy(manufacturer, attr, sizeof(manufacturer));
if ((delim = strchr(manufacturer, ';')) != NULL)
*delim = '\0';
if (!strcasecmp(manufacturer, "Hewlett-Packard"))
strcpy(manufacturer, "HP");
else if (!strcasecmp(manufacturer, "Lexmark International"))
strcpy(manufacturer, "Lexmark");
}
else
{
strlcpy(manufacturer, make_model, sizeof(manufacturer));
if ((delim = strchr(manufacturer, ' ')) != NULL)
*delim = '\0';
}
manulen = strlen(manufacturer);
for (uriptr = uri + strlen(uri), delim = manufacturer;
*delim && uriptr < (uri + uri_size - 3);
delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
*uriptr++ = '/';
if (!strncasecmp(make_model, manufacturer, manulen))
{
delim = make_model + manulen;
while (isspace(*delim & 255))
delim ++;
}
else
delim = make_model;
for (; *delim && uriptr < (uri + uri_size - 3); delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
if (serial_number[0])
{
/*
* Add the serial number to the URI...
*/
strlcpy(uriptr, "?serial=", uri_size - (uriptr - uri));
strlcat(uriptr, serial_number, uri_size - (uriptr - uri));
}
else
*uriptr = '\0';
}
return (0);
}
/*
* 'backendGetMakeModel()' - Get the make and model string from the device ID.
*/
int /* O - 0 on success, -1 on failure */
backendGetMakeModel(
const char *device_id, /* O - 1284 device ID */
char *make_model, /* O - Make/model */
int make_model_size) /* I - Size of buffer */
{
char *attr, /* 1284 attribute */
*delim, /* 1284 delimiter */
*mfg, /* Manufacturer string */
*mdl; /* Model string */
DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", "
"make_model=%p, make_model_size=%d)\n", device_id,
make_model, make_model_size));
/*
* Range check input...
*/
if (!device_id || !*device_id || !make_model || make_model_size < 32)
{
DEBUG_puts("backendGetMakeModel: Bad args!");
return (-1);
}
*make_model = '\0';
/*
* Look for the description field...
*/
@@ -224,15 +374,64 @@ get_device_id(
if ((mfg = strstr(device_id, "MANUFACTURER:")) != NULL)
mfg += 13;
else if ((mfg = strstr(device_id, "Manufacturer:")) != NULL)
mfg += 13;
else if ((mfg = strstr(device_id, "MFG:")) != NULL)
mfg += 4;
if ((mdl = strstr(device_id, "MODEL:")) != NULL)
mdl += 6;
else if ((mdl = strstr(device_id, "Model:")) != NULL)
mdl += 6;
else if ((mdl = strstr(device_id, "MDL:")) != NULL)
mdl += 4;
if (attr)
if (mdl)
{
/*
* Build a make-model string from the manufacturer and model attributes...
*/
if (mfg)
{
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
else if (!strncasecmp(mfg, "Lexmark International", 21))
strlcpy(make_model, "Lexmark", make_model_size);
else
strlcpy(make_model, mfg, make_model_size);
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (!strncasecmp(make_model, mdl, strlen(make_model)))
{
/*
* Just copy model string, since it has the manufacturer...
*/
strlcpy(make_model, mdl, make_model_size);
}
else
{
/*
* Concatenate the make and model...
*/
strlcat(make_model, " ", make_model_size);
strlcat(make_model, mdl, make_model_size);
}
}
else
{
/*
* Just copy model string, since it has the manufacturer...
*/
strlcpy(make_model, mdl, make_model_size);
}
}
else if (attr)
{
/*
* Use description...
@@ -257,38 +456,6 @@ get_device_id(
strlcpy(make_model, attr, make_model_size);
}
}
else if (mfg && mdl)
{
/*
* Build a make-model string from the manufacturer and model attributes...
*/
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
else
strlcpy(make_model, mfg, make_model_size);
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (!strncasecmp(make_model, mdl, strlen(make_model)))
{
/*
* Just copy model string, since it has the manufacturer...
*/
strlcpy(make_model, mdl, make_model_size);
}
else
{
/*
* Concatenate the make and model...
*/
strlcat(make_model, " ", make_model_size);
strlcat(make_model, mdl, make_model_size);
}
}
else
{
/*
@@ -298,73 +465,31 @@ get_device_id(
strlcpy(make_model, "Unknown", make_model_size);
}
/*
* Strip trailing data...
*/
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (scheme && uri && uri_size > 32)
{
/*
* Look for the serial number field...
*/
/*
* Strip trailing whitespace...
*/
if ((attr = strstr(device_id, "SERN:")) != NULL)
attr += 5;
else if ((attr = strstr(device_id, "SERIALNUMBER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, ";SN:")) != NULL)
attr += 4;
if (attr)
{
strlcpy(serial_number, attr, sizeof(serial_number));
if ((delim = strchr(serial_number, ';')) != NULL)
*delim = '\0';
}
for (delim = make_model + strlen(make_model) - 1; delim >= make_model; delim --)
if (isspace(*delim & 255))
*delim = '\0';
else
serial_number[0] = '\0';
break;
/*
* Generate the device URI from the make_model and serial number strings.
*/
/*
* Return...
*/
snprintf(uri, uri_size, "%s://", scheme);
for (uriptr = uri + strlen(uri), delim = make_model;
*delim && uriptr < (uri + uri_size - 1);
delim ++)
if (*delim == ' ')
{
delim ++;
*uriptr++ = '/';
break;
}
else
*uriptr++ = *delim;
for (; *delim && uriptr < (uri + uri_size - 3); delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
*uriptr = '\0';
if (serial_number[0])
{
/*
* Add the serial number to the URI...
*/
strlcat(uri, "?serial=", uri_size);
strlcat(uri, serial_number, uri_size);
}
}
return (0);
if (make_model[0])
return (0);
else
return (-1);
}
+1
Ver Arquivo
@@ -3,6 +3,7 @@
*
* Linux IEEE-1394 glue for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2002 by Easy Software Products, all rights reserved.
*
* Redistribution and use in source and binary forms, with or
+1
Ver Arquivo
@@ -3,6 +3,7 @@
*
* IEEE-1394 backend for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2002 by Easy Software Products, all rights reserved.
*
* Redistribution and use in source and binary forms, with or
+1
Ver Arquivo
@@ -3,6 +3,7 @@
*
* IEEE-1394 header for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2002 by Easy Software Products, all rights reserved.
*
* Redistribution and use in source and binary forms, with or
+272 -180
Ver Arquivo
@@ -3,23 +3,14 @@
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -50,11 +41,11 @@
#include <cups/backend.h>
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/i18n.h>
#include <cups/string.h>
#include <signal.h>
#include <sys/wait.h>
/*
* Globals...
*/
@@ -101,12 +92,14 @@ main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line arguments */
{
int i; /* Looping var */
int send_options; /* Send job options? */
int num_options; /* Number of printer options */
cups_option_t *options; /* Printer options */
char method[255], /* Method in URI */
hostname[1024], /* Hostname */
username[255], /* Username info */
resource[1024], /* Resource info (printer name) */
addrname[256], /* Address name */
*optptr, /* Pointer to URI options */
name[255], /* Name of option */
value[255], /* Value of option */
@@ -121,6 +114,10 @@ main(int argc, /* I - Number of command-line args */
ipp_t *request, /* IPP request */
*response, /* IPP response */
*supported; /* get-printer-attributes response */
time_t start_time; /* Time of first connect */
int recoverable; /* Recoverable error shown? */
int contimeout; /* Connection timeout */
int delay; /* Delay for retries... */
int compression, /* Do compression of the job data? */
waitjob, /* Wait for job complete? */
waitprinter; /* Wait for printer ready? */
@@ -132,19 +129,20 @@ main(int argc, /* I - Number of command-line args */
ipp_attribute_t *format_sup; /* document-format-supported */
ipp_attribute_t *printer_state; /* printer-state attribute */
ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs */
int copies; /* Number of copies remaining */
int copies, /* Number of copies for job */
copies_remaining; /* Number of copies remaining */
const char *content_type; /* CONTENT_TYPE environment variable */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
int version; /* IPP version */
int reasons; /* Number of printer-state-reasons */
static const char * const pattrs[] =
{ /* Printer attributes we want */
"copies-supported",
"document-format-supported",
"printer-is-accepting-jobs",
"printer-state",
"printer-state-message",
"printer-state-reasons",
};
static const char * const jattrs[] =
@@ -200,8 +198,7 @@ main(int argc, /* I - Number of command-line args */
}
else if (argc < 6)
{
fprintf(stderr,
"Usage: %s job-id user title copies options [file ... fileN]\n",
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_STOP);
}
@@ -211,7 +208,11 @@ main(int argc, /* I - Number of command-line args */
*/
if ((content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
content_type = "application/octet-stream";
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
content_type = "application/octet-stream";
if (!strncmp(content_type, "printer/", 8))
content_type = "application/vnd.cups-raw";
/*
* Extract the hostname and printer name from the URI...
@@ -222,13 +223,15 @@ main(int argc, /* I - Number of command-line args */
hostname, sizeof(hostname), &port,
resource, sizeof(resource)) < HTTP_URI_OK)
{
fputs("ERROR: Missing device URI on command-line and no DEVICE_URI "
"environment variable!\n", stderr);
fputs(_("ERROR: Missing device URI on command-line and no "
"DEVICE_URI environment variable!\n"), stderr);
return (CUPS_BACKEND_STOP);
}
if (!strcmp(method, "https"))
cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
else
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
/*
* See if there are any options...
@@ -238,6 +241,7 @@ main(int argc, /* I - Number of command-line args */
version = 1;
waitjob = 1;
waitprinter = 1;
contimeout = 7 * 24 * 60 * 60;
if ((optptr = strchr(resource, '?')) != NULL)
{
@@ -276,7 +280,7 @@ main(int argc, /* I - Number of command-line args */
*ptr++ = *optptr++;
*ptr = '\0';
if (*optptr == '+')
if (*optptr == '+' || *optptr == '&')
optptr ++;
}
else
@@ -322,8 +326,9 @@ main(int argc, /* I - Number of command-line args */
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
else
{
fprintf(stderr, "ERROR: Unknown encryption option value \"%s\"!\n",
value);
fprintf(stderr,
_("ERROR: Unknown encryption option value \"%s\"!\n"),
value);
}
}
else if (!strcasecmp(name, "version"))
@@ -334,8 +339,9 @@ main(int argc, /* I - Number of command-line args */
version = 1;
else
{
fprintf(stderr, "ERROR: Unknown version option value \"%s\"!\n",
value);
fprintf(stderr,
_("ERROR: Unknown version option value \"%s\"!\n"),
value);
}
}
#ifdef HAVE_LIBZ
@@ -347,13 +353,22 @@ main(int argc, /* I - Number of command-line args */
!strcasecmp(value, "gzip");
}
#endif /* HAVE_LIBZ */
else if (!strcasecmp(name, "contimeout"))
{
/*
* Set the connection timeout...
*/
if (atoi(value) > 0)
contimeout = atoi(value);
}
else
{
/*
* Unknown option...
*/
fprintf(stderr, "ERROR: Unknown option \"%s\" with value \"%s\"!\n",
fprintf(stderr, _("ERROR: Unknown option \"%s\" with value \"%s\"!\n"),
name, value);
}
}
@@ -409,6 +424,8 @@ main(int argc, /* I - Number of command-line args */
filename = tmpfilename;
files = &filename;
num_files = 1;
send_options = 0;
}
else
{
@@ -419,6 +436,8 @@ main(int argc, /* I - Number of command-line args */
num_files = argc - 6;
files = argv + 6;
send_options = strncasecmp(content_type, "application/vnd.cups-", 21) != 0;
#ifdef HAVE_LIBZ
if (compression)
compress_files(num_files, files);
@@ -447,74 +466,35 @@ main(int argc, /* I - Number of command-line args */
else if (!getuid())
{
/*
* Try loading authentication information from the a##### file.
* Try loading authentication information from the environment.
*/
const char *request_root; /* CUPS_REQUESTROOT env var */
char afilename[1024], /* a##### filename */
aline[1024]; /* Line from file */
FILE *fp; /* File pointer */
if ((ptr = getenv("AUTH_USERNAME")) != NULL)
cupsSetUser(ptr);
if ((request_root = getenv("CUPS_REQUESTROOT")) != NULL)
{
/*
* Try opening authentication cache file...
*/
snprintf(afilename, sizeof(afilename), "%s/a%05d", request_root,
atoi(argv[1]));
if ((fp = fopen(afilename, "r")) != NULL)
{
/*
* Read username...
*/
if (fgets(aline, sizeof(aline), fp))
{
/*
* Decode username...
*/
i = sizeof(username);
httpDecode64_2(username, &i, aline);
/*
* Read password...
*/
if (fgets(aline, sizeof(aline), fp))
{
/*
* Decode password...
*/
i = sizeof(password);
httpDecode64_2(password, &i, aline);
}
}
/*
* Close the file...
*/
fclose(fp);
}
}
password = getenv("AUTH_PASSWORD");
}
/*
* Try connecting to the remote server...
*/
delay = 5;
recoverable = 0;
start_time = time(NULL);
fputs("STATE: +connecting-to-device\n", stderr);
do
{
fprintf(stderr, "INFO: Connecting to %s on port %d...\n", hostname, port);
fprintf(stderr, _("INFO: Connecting to %s on port %d...\n"),
hostname, port);
if ((http = httpConnectEncrypt(hostname, port, cupsEncryption())) == NULL)
{
if (job_cancelled)
break;
if (getenv("CLASS") != NULL)
{
/*
@@ -524,10 +504,8 @@ main(int argc, /* I - Number of command-line args */
* available printer in the class.
*/
fprintf(stderr,
"INFO: Unable to connect to %s, queuing on next printer in "
"class...\n",
hostname);
fputs(_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"), stderr);
if (argc == 6 || strcmp(filename, argv[6]))
unlink(filename);
@@ -544,29 +522,68 @@ main(int argc, /* I - Number of command-line args */
if (errno == ECONNREFUSED || errno == EHOSTDOWN ||
errno == EHOSTUNREACH)
{
if (contimeout && (time(NULL) - start_time) > contimeout)
{
fputs(_("ERROR: Printer not responding!\n"), stderr);
return (CUPS_BACKEND_FAILED);
}
recoverable = 1;
fprintf(stderr,
"INFO: Network host \'%s\' is busy; will retry in 30 "
"seconds...\n",
hostname);
sleep(30);
_("WARNING: recoverable: Network host \'%s\' is busy; will "
"retry in %d seconds...\n"),
hostname, delay);
sleep(delay);
if (delay < 30)
delay += 5;
}
else if (h_errno)
{
fprintf(stderr, "INFO: Unable to lookup host \'%s\' - %s\n",
hostname, hstrerror(h_errno));
sleep(30);
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
hostname);
return (CUPS_BACKEND_STOP);
}
else
{
perror("ERROR: Unable to connect to IPP host");
recoverable = 1;
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
"retry in 30 seconds...\n"), stderr);
sleep(30);
}
if (job_cancelled)
break;
}
}
while (http == NULL);
if (job_cancelled)
{
if (argc == 6 || strcmp(filename, argv[6]))
unlink(filename);
return (CUPS_BACKEND_FAILED);
}
fputs("STATE: -connecting-to-device\n", stderr);
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
#ifdef AF_INET6
if (http->hostaddr->addr.sa_family == AF_INET6)
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
ntohs(http->hostaddr->ipv6.sin6_port));
else
#endif /* AF_INET6 */
if (http->hostaddr->addr.sa_family == AF_INET)
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
ntohs(http->hostaddr->ipv4.sin_port));
/*
* Build a URI for the printer and fill the standard IPP attributes for
@@ -618,9 +635,25 @@ main(int argc, /* I - Number of command-line args */
if (ipp_status == IPP_PRINTER_BUSY ||
ipp_status == IPP_SERVICE_UNAVAILABLE)
{
fputs("INFO: Printer busy; will retry in 10 seconds...\n", stderr);
if (contimeout && (time(NULL) - start_time) > contimeout)
{
fputs(_("ERROR: Printer not responding!\n"), stderr);
return (CUPS_BACKEND_FAILED);
}
recoverable = 1;
fprintf(stderr,
_("WARNING: recoverable: Network host \'%s\' is busy; will "
"retry in %d seconds...\n"),
hostname, delay);
report_printer_state(supported);
sleep(10);
sleep(delay);
if (delay < 30)
delay += 5;
}
else if ((ipp_status == IPP_BAD_REQUEST ||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
@@ -629,14 +662,14 @@ main(int argc, /* I - Number of command-line args */
* Switch to IPP/1.0...
*/
fputs("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n",
fputs(_("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n"),
stderr);
version = 0;
httpReconnect(http);
}
else if (ipp_status == IPP_NOT_FOUND)
{
fputs("ERROR: Destination printer does not exist!\n", stderr);
fputs(_("ERROR: Destination printer does not exist!\n"), stderr);
if (supported)
ippDelete(supported);
@@ -645,8 +678,8 @@ main(int argc, /* I - Number of command-line args */
}
else
{
fprintf(stderr, "ERROR: Unable to get printer status (%s)!\n",
ippErrorString(ipp_status));
fprintf(stderr, _("ERROR: Unable to get printer status (%s)!\n"),
cupsLastErrorString());
sleep(10);
}
@@ -708,10 +741,8 @@ main(int argc, /* I - Number of command-line args */
* available printer in the class.
*/
fprintf(stderr,
"INFO: Unable to queue job on %s, queuing on next printer in "
"class...\n",
hostname);
fputs(_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"), stderr);
ippDelete(supported);
httpClose(http);
@@ -729,23 +760,41 @@ main(int argc, /* I - Number of command-line args */
}
}
if (recoverable)
{
/*
* If we've shown a recoverable error make sure the printer proxies
* have a chance to see the recovered message. Not pretty but
* necessary for now...
*/
fputs("INFO: recovered: \n", stderr);
sleep(5);
}
/*
* See if the printer supports multiple copies...
*/
copies = atoi(argv[4]);
if (copies_sup || argc < 7)
copies = 1;
{
copies_remaining = 1;
if (argc < 7)
copies = 1;
}
else
copies = atoi(argv[4]);
copies_remaining = copies;
/*
* Then issue the print-job request...
*/
reasons = 0;
job_id = 0;
while (copies > 0)
while (copies_remaining > 0)
{
/*
* Build the IPP request...
@@ -772,7 +821,13 @@ main(int argc, /* I - Number of command-line args */
fprintf(stderr, "DEBUG: requesting-user-name = \"%s\"\n", argv[2]);
if (argv[3][0])
/*
* Only add a "job-name" attribute if the remote server supports
* copy generation - some IPP implementations like HP's don't seem
* to like UTF-8 job names (STR #1837)...
*/
if (argv[3][0] && copies_sup)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
argv[3]);
@@ -819,8 +874,10 @@ main(int argc, /* I - Number of command-line args */
* number of copies to 1...
*/
content_type = "application/postscript";
copies = 1;
content_type = "application/postscript";
copies = 1;
copies_remaining = 1;
send_options = 0;
}
}
#endif /* __APPLE__ */
@@ -832,24 +889,25 @@ main(int argc, /* I - Number of command-line args */
break;
if (i < format_sup->num_values)
num_options = cupsAddOption("document-format", content_type,
num_options, &options);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
"document-format", NULL, content_type);
}
if (copies_sup)
if (copies_sup && version > 0 && send_options)
{
/*
* Only send options if the destination printer supports the copies
* attribute. This is a hack for the HP JetDirect implementation of
* IPP, which does not accept extension attributes and incorrectly
* reports a client-error-bad-request error instead of the
* successful-ok-unsupported-attributes status. In short, at least
* some HP implementations of IPP are non-compliant.
* attribute and IPP/1.1. This is a hack for the HP and Lexmark
* implementations of IPP, which do not accept extension attributes
* and incorrectly report a client-error-bad-request error instead of
* the successful-ok-unsupported-attributes status. In short, at least
* some HP and Lexmark implementations of IPP are non-compliant.
*/
cupsEncodeOptions(request, num_options, options);
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies",
atoi(argv[4]));
copies);
}
cupsFreeOptions(num_options, options);
@@ -857,7 +915,7 @@ main(int argc, /* I - Number of command-line args */
/*
* If copies aren't supported, then we are likely dealing with an HP
* JetDirect. The HP IPP implementation seems to close the connection
* after every request (that is, it does *not* implement HTTP Keep-
* after every request - that is, it does *not* implement HTTP Keep-
* Alive, which is REQUIRED by HTTP/1.1...
*/
@@ -885,23 +943,35 @@ main(int argc, /* I - Number of command-line args */
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_PRINTER_BUSY)
{
fputs("INFO: Printer is busy; retrying print job...\n", stderr);
fputs(_("INFO: Printer busy; will retry in 10 seconds...\n"), stderr);
sleep(10);
}
else if ((ipp_status == IPP_BAD_REQUEST ||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
{
/*
* Switch to IPP/1.0...
*/
fputs(_("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n"),
stderr);
version = 0;
httpReconnect(http);
}
else
fprintf(stderr, "ERROR: Print file was not accepted (%s)!\n",
fprintf(stderr, _("ERROR: Print file was not accepted (%s)!\n"),
cupsLastErrorString());
}
else if ((job_id_attr = ippFindAttribute(response, "job-id",
IPP_TAG_INTEGER)) == NULL)
{
fputs("NOTICE: Print file accepted - job ID unknown.\n", stderr);
fputs(_("NOTICE: Print file accepted - job ID unknown.\n"), stderr);
job_id = 0;
}
else
{
job_id = job_id_attr->values[0].integer;
fprintf(stderr, "NOTICE: Print file accepted - job ID %d.\n", job_id);
fprintf(stderr, _("NOTICE: Print file accepted - job ID %d.\n"), job_id);
}
ippDelete(response);
@@ -939,7 +1009,7 @@ main(int argc, /* I - Number of command-line args */
{
ipp_status = cupsLastError();
fprintf(stderr, "ERROR: Unable to add file %d to job: %s\n",
fprintf(stderr, _("ERROR: Unable to add file %d to job: %s\n"),
job_id, cupsLastErrorString());
break;
}
@@ -949,13 +1019,13 @@ main(int argc, /* I - Number of command-line args */
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
{
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
copies --;
copies_remaining --;
}
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_PRINTER_BUSY)
break;
else
copies --;
copies_remaining --;
/*
* Wait for the job to complete...
@@ -964,7 +1034,7 @@ main(int argc, /* I - Number of command-line args */
if (!job_id || !waitjob)
continue;
fputs("INFO: Waiting for job to complete...\n", stderr);
fputs(_("INFO: Waiting for job to complete...\n"), stderr);
for (; !job_cancelled;)
{
@@ -1018,8 +1088,8 @@ main(int argc, /* I - Number of command-line args */
{
ippDelete(response);
fprintf(stderr, "ERROR: Unable to get job %d attributes (%s)!\n",
job_id, ippErrorString(ipp_status));
fprintf(stderr, _("ERROR: Unable to get job %d attributes (%s)!\n"),
job_id, cupsLastErrorString());
break;
}
}
@@ -1033,8 +1103,7 @@ main(int argc, /* I - Number of command-line args */
* Stop polling if the job is finished or pending-held...
*/
if (job_state->values[0].integer > IPP_JOB_PROCESSING ||
job_state->values[0].integer == IPP_JOB_HELD)
if (job_state->values[0].integer > IPP_JOB_STOPPED)
{
if ((job_sheets = ippFindAttribute(response,
"job-media-sheets-completed",
@@ -1128,7 +1197,7 @@ cancel_job(http_t *http, /* I - HTTP connection */
ipp_t *request; /* Cancel-Job request */
fputs("INFO: Cancelling print job...\n", stderr);
fputs(_("INFO: Canceling print job...\n"), stderr);
request = ippNewRequest(IPP_CANCEL_JOB);
request->request.op.version[1] = version;
@@ -1148,7 +1217,7 @@ cancel_job(http_t *http, /* I - HTTP connection */
ippDelete(cupsDoRequest(http, request, resource));
if (cupsLastError() > IPP_OK_CONFLICT)
fprintf(stderr, "ERROR: Unable to cancel job %d: %s\n", id,
fprintf(stderr, _("ERROR: Unable to cancel job %d: %s\n"), id,
cupsLastErrorString());
}
@@ -1167,6 +1236,11 @@ check_printer_state(
{
ipp_t *request, /* IPP request */
*response; /* IPP response */
static const char * const attrs[] = /* Attributes we want */
{
"printer-state-message",
"printer-state-reasons"
};
/*
@@ -1183,8 +1257,9 @@ check_printer_state(
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", NULL, "printer-state-reasons");
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes",
(int)(sizeof(attrs) / sizeof(attrs[0])), NULL, attrs);
/*
* Do the request...
@@ -1215,7 +1290,7 @@ compress_files(int num_files, /* I - Number of files */
*out; /* Output file */
struct stat outinfo; /* Output file information */
char filename[1024], /* Temporary filename */
buffer[65536]; /* Copy buffer */
buffer[32768]; /* Copy buffer */
fprintf(stderr, "DEBUG: Compressing %d job files...\n", num_files);
@@ -1223,19 +1298,24 @@ compress_files(int num_files, /* I - Number of files */
{
if ((fd = cupsTempFd(filename, sizeof(filename))) < 0)
{
perror("ERROR: Unable to create temporary compressed print file");
fprintf(stderr,
_("ERROR: Unable to create temporary compressed print file: "
"%s\n"),
strerror(errno));
exit(CUPS_BACKEND_FAILED);
}
if ((out = cupsFileOpenFd(fd, "w9")) == NULL)
{
perror("ERROR: Unable to open temporary compressed print file");
fprintf(stderr,
_("ERROR: Unable to open temporary compressed print file: %s\n"),
strerror(errno));
exit(CUPS_BACKEND_FAILED);
}
if ((in = cupsFileOpen(files[i], "r")) == NULL)
{
fprintf(stderr, "ERROR: Unable to open print file \"%s\": %s\n",
fprintf(stderr, _("ERROR: Unable to open print file \"%s\": %s\n"),
files[i], strerror(errno));
cupsFileClose(out);
exit(CUPS_BACKEND_FAILED);
@@ -1245,8 +1325,8 @@ compress_files(int num_files, /* I - Number of files */
while ((bytes = cupsFileRead(in, buffer, sizeof(buffer))) > 0)
if (cupsFileWrite(out, buffer, bytes) < bytes)
{
fprintf(stderr, "ERROR: Unable to write " CUPS_LLFMT " bytes to \"%s\": %s\n",
CUPS_LLCAST bytes, filename, strerror(errno));
fprintf(stderr, _("ERROR: Unable to write %d bytes to \"%s\": %s\n"),
(int)bytes, filename, strerror(errno));
cupsFileClose(in);
cupsFileClose(out);
exit(CUPS_BACKEND_FAILED);
@@ -1296,7 +1376,11 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
unlink(pstmpname);
#endif /* __APPLE__ */
fputs("ATTR: auth-info-required=username,password\n", stderr);
exit(CUPS_BACKEND_AUTH_REQUIRED);
return (NULL); /* Eliminate compiler warning */
}
}
@@ -1310,7 +1394,8 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
{
int i; /* Looping var */
int count; /* Count of reasons shown... */
ipp_attribute_t *reasons; /* printer-state-reasons */
ipp_attribute_t *psm, /* pritner-state-message */
*reasons; /* printer-state-reasons */
const char *reason; /* Current reason */
const char *message; /* Message to show */
char unknown[1024]; /* Unknown message string */
@@ -1318,6 +1403,10 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
char state[1024]; /* State string */
if ((psm = ippFindAttribute(ipp, "printer-state-message",
IPP_TAG_TEXT)) != NULL)
fprintf(stderr, "INFO: %s\n", psm->values[0].string.text);
if ((reasons = ippFindAttribute(ipp, "printer-state-reasons",
IPP_TAG_KEYWORD)) == NULL)
return (0);
@@ -1333,67 +1422,67 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
strlcat(state, reason, sizeof(state));
prefix = ",";
message = NULL;
message = "";
if (!strncmp(reason, "media-needed", 12))
message = "Media tray needs to be filled.";
message = _("Media tray needs to be filled.");
else if (!strncmp(reason, "media-jam", 9))
message = "Media jam!";
message = _("Media jam!");
else if (!strncmp(reason, "moving-to-paused", 16) ||
!strncmp(reason, "paused", 6) ||
!strncmp(reason, "shutdown", 8))
message = "Printer off-line.";
message = _("Printer off-line.");
else if (!strncmp(reason, "toner-low", 9))
message = "Toner low.";
message = _("Toner low.");
else if (!strncmp(reason, "toner-empty", 11))
message = "Out of toner!";
message = _("Out of toner!");
else if (!strncmp(reason, "cover-open", 10))
message = "Cover open.";
message = _("Cover open.");
else if (!strncmp(reason, "interlock-open", 14))
message = "Interlock open.";
message = _("Interlock open.");
else if (!strncmp(reason, "door-open", 9))
message = "Door open.";
message = _("Door open.");
else if (!strncmp(reason, "input-tray-missing", 18))
message = "Media tray missing!";
message = _("Media tray missing!");
else if (!strncmp(reason, "media-low", 9))
message = "Media tray almost empty.";
message = _("Media tray almost empty.");
else if (!strncmp(reason, "media-empty", 11))
message = "Media tray empty!";
message = _("Media tray empty!");
else if (!strncmp(reason, "output-tray-missing", 19))
message = "Output tray missing!";
message = _("Output tray missing!");
else if (!strncmp(reason, "output-area-almost-full", 23))
message = "Output bin almost full.";
message = _("Output bin almost full.");
else if (!strncmp(reason, "output-area-full", 16))
message = "Output bin full!";
message = _("Output bin full!");
else if (!strncmp(reason, "marker-supply-low", 17))
message = "Ink/toner almost empty.";
message = _("Ink/toner almost empty.");
else if (!strncmp(reason, "marker-supply-empty", 19))
message = "Ink/toner empty!";
message = _("Ink/toner empty!");
else if (!strncmp(reason, "marker-waste-almost-full", 24))
message = "Ink/toner waste bin almost full.";
message = _("Ink/toner waste bin almost full.");
else if (!strncmp(reason, "marker-waste-full", 17))
message = "Ink/toner waste bin full!";
message = _("Ink/toner waste bin full!");
else if (!strncmp(reason, "fuser-over-temp", 15))
message = "Fuser temperature high!";
message = _("Fuser temperature high!");
else if (!strncmp(reason, "fuser-under-temp", 16))
message = "Fuser temperature low!";
message = _("Fuser temperature low!");
else if (!strncmp(reason, "opc-near-eol", 12))
message = "OPC almost at end-of-life.";
message = _("OPC almost at end-of-life.");
else if (!strncmp(reason, "opc-life-over", 13))
message = "OPC at end-of-life!";
message = _("OPC at end-of-life!");
else if (!strncmp(reason, "developer-low", 13))
message = "Developer almost empty.";
message = _("Developer almost empty.");
else if (!strncmp(reason, "developer-empty", 15))
message = "Developer empty!";
message = _("Developer empty!");
else if (strstr(reason, "error") != NULL)
{
message = unknown;
snprintf(unknown, sizeof(unknown), "Unknown printer error (%s)!",
snprintf(unknown, sizeof(unknown), _("Unknown printer error (%s)!"),
reason);
}
if (message)
if (message[0])
{
count ++;
if (strstr(reasons->values[i].string.text, "error"))
@@ -1443,15 +1532,15 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
printer = getenv("PRINTER");
if (!printer)
{
fputs("ERROR: PRINTER environment variable not defined!\n", stderr);
fputs(_("ERROR: PRINTER environment variable not defined!\n"), stderr);
return (-1);
}
if ((ppdfile = cupsGetPPD(printer)) == NULL)
{
fprintf(stderr, "ERROR: Unable to get PPD file for printer \"%s\" - %s.\n",
printer, ippErrorString(cupsLastError()));
/*return (-1);*/
fprintf(stderr,
_("ERROR: Unable to get PPD file for printer \"%s\" - %s.\n"),
printer, cupsLastErrorString());
}
else
{
@@ -1465,7 +1554,7 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
if ((fd = cupsTempFd(pstmpname, sizeof(pstmpname))) < 0)
{
fprintf(stderr, "ERROR: Unable to create temporary file - %s.\n",
fprintf(stderr, _("ERROR: Unable to create temporary file - %s.\n"),
strerror(errno));
if (ppdfile)
unlink(ppdfile);
@@ -1522,7 +1611,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
execlp("pictwpstops", printer, argv[1], argv[2], argv[3], argv[4], argv[5],
filename, NULL);
perror("ERROR: Unable to exec pictwpstops");
fprintf(stderr, _("ERROR: Unable to exec pictwpstops: %s\n"),
strerror(errno));
return (errno);
}
@@ -1534,7 +1624,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
* Error!
*/
perror("ERROR: Unable to fork pictwpstops");
fprintf(stderr, _("ERROR: Unable to fork pictwpstops: %s\n"),
strerror(errno));
unlink(filename);
if (ppdfile)
unlink(ppdfile);
@@ -1547,7 +1638,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
if (wait(&status) < 0)
{
perror("ERROR: Unable to wait for pictwpstops");
fprintf(stderr, _("ERROR: Unable to wait for pictwpstops: %s\n"),
strerror(errno));
close(fd);
unlink(filename);
if (ppdfile)
@@ -1563,10 +1655,10 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
if (status)
{
if (status >= 256)
fprintf(stderr, "ERROR: pictwpstops exited with status %d!\n",
fprintf(stderr, _("ERROR: pictwpstops exited with status %d!\n"),
status / 256);
else
fprintf(stderr, "ERROR: pictwpstops exited on signal %d!\n",
fprintf(stderr, _("ERROR: pictwpstops exited on signal %d!\n"),
status);
unlink(filename);
+234 -159
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -41,6 +32,7 @@
#include <cups/backend.h>
#include <cups/http-private.h>
#include <cups/cups.h>
#include <cups/i18n.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -73,6 +65,14 @@ static char tmpfilename[1024] = ""; /* Temporary spool file name */
static int abort_job = 0; /* Non-zero if we get SIGTERM */
/*
* Print mode...
*/
#define MODE_STANDARD 0 /* Queue a copy */
#define MODE_STREAM 1 /* Stream a copy */
/*
* The order for control and data files in LPD requests...
*/
@@ -96,9 +96,9 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
static int lpd_command(int lpd_fd, int timeout, char *format, ...);
static int lpd_queue(const char *hostname, int port, const char *printer,
const char *filename,
const char *user, const char *title, int copies,
int banner, int format, int order, int reserve,
int print_fd, int mode, const char *user,
const char *title, int copies, int banner,
int format, int order, int reserve,
int manual_copies, int timeout, int contimeout);
static void lpd_timeout(int sig);
static int lpd_write(int lpd_fd, char *buffer, int length);
@@ -131,7 +131,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*filename, /* File to print */
title[256]; /* Title string */
int port; /* Port number */
int fd; /* Print file */
int status; /* Status of LPD job */
int mode; /* Print mode */
int banner; /* Print banner page? */
int format; /* Print format */
int order; /* Order of control/data files */
@@ -184,49 +186,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
/*
* 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...
*/
int fd; /* Temporary file */
char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
{
perror("ERROR: unable to create temporary file");
return (CUPS_BACKEND_FAILED);
}
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
if (write(fd, buffer, bytes) < bytes)
{
perror("ERROR: unable to write to temporary file");
close(fd);
unlink(tmpfilename);
return (CUPS_BACKEND_FAILED);
}
close(fd);
filename = tmpfilename;
}
else
filename = argv[6];
/*
* Extract the hostname and printer name from the URI...
*/
@@ -249,6 +213,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* See if there are any options...
*/
mode = MODE_STANDARD;
banner = 0;
format = 'l';
order = ORDER_CONTROL_DATA;
@@ -258,9 +223,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
contimeout = 7 * 24 * 60 * 60;
#ifdef __APPLE__
/* We want to pass utf-8 characters, not re-map them (3071945) */
/*
* We want to pass utf-8 characters, not re-map them (3071945)
*/
sanitize_title = 0;
/*
* Get the default timeout from a system preference...
*/
{
CFPropertyListRef pvalue; /* Preference value */
SInt32 toval; /* Timeout value */
@@ -350,7 +322,21 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (strchr("cdfglnoprtv", value[0]))
format = value[0];
else
fprintf(stderr, "ERROR: Unknown format character \"%c\"\n", value[0]);
fprintf(stderr, _("ERROR: Unknown format character \"%c\"\n"),
value[0]);
}
else if (!strcasecmp(name, "mode") && value[0])
{
/*
* Set control/data order...
*/
if (!strcasecmp(value, "standard"))
mode = MODE_STANDARD;
else if (!strcasecmp(value, "stream"))
mode = MODE_STREAM;
else
fprintf(stderr, _("ERROR: Unknown print mode \"%s\"\n"), value);
}
else if (!strcasecmp(name, "order") && value[0])
{
@@ -363,7 +349,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else if (!strcasecmp(value, "data,control"))
order = ORDER_DATA_CONTROL;
else
fprintf(stderr, "ERROR: Unknown file order \"%s\"\n", value);
fprintf(stderr, _("ERROR: Unknown file order \"%s\"\n"), value);
}
else if (!strcasecmp(name, "reserve"))
{
@@ -410,7 +396,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else if (!strcasecmp(name, "contimeout"))
{
/*
* Set the timeout...
* Set the connection timeout...
*/
if (atoi(value) > 0)
@@ -419,6 +405,64 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
}
if (mode == MODE_STREAM)
order = ORDER_CONTROL_DATA;
/*
* 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 && mode == MODE_STANDARD)
{
/*
* Copy stdin to a temporary file...
*/
char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
{
perror("ERROR: unable to create temporary file");
return (CUPS_BACKEND_FAILED);
}
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
if (write(fd, buffer, bytes) < bytes)
{
perror("ERROR: unable to write to temporary file");
close(fd);
unlink(tmpfilename);
return (CUPS_BACKEND_FAILED);
}
filename = tmpfilename;
}
else if (argc == 6)
{
/*
* Stream from stdin...
*/
filename = NULL;
fd = 0;
}
else
{
filename = argv[6];
fd = open(filename, O_RDONLY);
if (fd == -1)
{
fprintf(stderr, _("ERROR: Unable to open print file %s: %s\n"),
filename, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
}
/*
* Sanitize the document title...
*/
@@ -454,7 +498,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
copies = atoi(argv[4]);
}
status = lpd_queue(hostname, port, resource + 1, filename,
status = lpd_queue(hostname, port, resource + 1, fd, mode,
username, title, copies,
banner, format, order, reserve, manual_copies,
timeout, contimeout);
@@ -463,7 +507,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
}
else
status = lpd_queue(hostname, port, resource + 1, filename,
status = lpd_queue(hostname, port, resource + 1, fd, mode,
username, title, 1,
banner, format, order, reserve, 1,
timeout, contimeout);
@@ -475,6 +519,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (tmpfilename[0])
unlink(tmpfilename);
if (fd)
close(fd);
/*
* Return the queue status...
*/
@@ -532,14 +579,15 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
* Read back the status from the command and return it...
*/
fprintf(stderr, "DEBUG: Reading command status...\n");
fputs("DEBUG: Reading command status...\n", stderr);
alarm(timeout);
if (recv(fd, &status, 1, 0) < 1)
{
fprintf(stderr, "WARNING: Remote host did not respond with command "
"status byte after %d seconds!\n", timeout);
fprintf(stderr,
_("WARNING: Remote host did not respond with command status "
"byte after %d seconds!\n"), timeout);
status = errno;
}
@@ -559,7 +607,8 @@ static int /* O - Zero on success, non-zero on failure */
lpd_queue(const char *hostname, /* I - Host to connect to */
int port, /* I - Port to connect on */
const char *printer, /* I - Printer/queue name */
const char *filename, /* I - File to print */
int print_fd, /* I - File to print */
int mode, /* I - Print mode */
const char *user, /* I - Requesting user */
const char *title, /* I - Job title */
int copies, /* I - Number of copies */
@@ -571,7 +620,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
int timeout, /* I - Timeout... */
int contimeout) /* I - Connection timeout */
{
FILE *fp; /* Job file */
char localhost[255]; /* Local host name */
int error; /* Error number */
struct stat filestats; /* File statistics */
@@ -581,16 +629,16 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
*cptr; /* Pointer into control file string */
char status; /* Status byte from command */
char portname[255]; /* Port name */
int delay; /* Delay for retries... */
char addrname[256]; /* Address name */
http_addrlist_t *addrlist, /* Address list */
*addr; /* Socket address */
int copy; /* Copies written */
time_t start_time; /* Time of first connect */
#ifdef __APPLE__
int recoverable; /* Recoverable error shown? */
#endif /* __APPLE__ */
size_t nbytes; /* Number of bytes written */
off_t tbytes; /* Total bytes written */
char buffer[65536]; /* Output buffer */
char buffer[32768]; /* Output buffer */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -620,18 +668,15 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
{
fprintf(stderr, "ERROR: Unable to locate printer \'%s\'!\n",
hostname);
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"), hostname);
return (CUPS_BACKEND_STOP);
}
/*
* Remember when we starting trying to connect to the printer...
* Remember when we started trying to connect to the printer...
*/
#ifdef __APPLE__
recoverable = 0;
#endif /* __APPLE__ */
start_time = time(NULL);
/*
@@ -645,10 +690,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
*/
fputs("STATE: +connecting-to-device\n", stderr);
fprintf(stderr, "INFO: Attempting to connect to host %s for printer %s\n",
fprintf(stderr,
_("INFO: Attempting to connect to host %s for printer %s\n"),
hostname, printer);
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist;;
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist,
delay = 5;;
addr = addr->next)
{
/*
@@ -744,8 +791,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
* available printer in the class.
*/
fprintf(stderr, "INFO: Unable to connect to %s, queuing on next printer in class...\n",
hostname);
fputs(_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"), stderr);
httpAddrFreeList(addrlist);
@@ -763,23 +810,21 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
{
if (contimeout && (time(NULL) - start_time) > contimeout)
{
fputs("ERROR: Printer not responding!\n", stderr);
fputs(_("ERROR: Printer not responding!\n"), stderr);
return (CUPS_BACKEND_FAILED);
}
#ifdef __APPLE__
recoverable = 1;
fprintf(stderr, "WARNING: recoverable: "
"Network host \'%s\' is busy, down, or "
"unreachable; will retry in 30 seconds...\n",
hostname);
#else
fprintf(stderr, "WARNING: "
"Network host \'%s\' is busy, down, or "
"unreachable; will retry in 30 seconds...\n",
hostname);
#endif /* __APPLE__ */
sleep(30);
fprintf(stderr,
_("WARNING: recoverable: Network host \'%s\' is busy; will "
"retry in %d seconds...\n"),
hostname, delay);
sleep(delay);
if (delay < 30)
delay += 5;
}
else if (error == EADDRINUSE)
{
@@ -791,19 +836,15 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
}
else
{
#ifdef __APPLE__
recoverable = 1;
perror("ERROR: recoverable: "
"Unable to connect to printer; will retry in 30 seconds...");
#else
perror("ERROR: "
"Unable to connect to printer; will retry in 30 seconds...");
#endif /* __APPLE__ */
sleep(30);
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
"retry in 30 seconds...\n"), stderr);
sleep(30);
}
}
#ifdef __APPLE__
if (recoverable)
{
/*
@@ -815,35 +856,55 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
fputs("INFO: recovered: \n", stderr);
sleep(5);
}
#endif /* __APPLE__ */
fputs("STATE: -connecting-to-device\n", stderr);
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
lport);
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
#ifdef AF_INET6
if (addr->addr.addr.sa_family == AF_INET6)
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6) (local port %d)...\n",
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv6.sin6_port), lport);
else
#endif /* AF_INET6 */
if (addr->addr.addr.sa_family == AF_INET)
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4) (local port %d)...\n",
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv4.sin_port), lport);
/*
* Next, open the print file and figure out its size...
*/
if (stat(filename, &filestats))
if (print_fd)
{
httpAddrFreeList(addrlist);
close(fd);
/*
* Use the size from the print file...
*/
perror("ERROR: unable to stat print file");
return (CUPS_BACKEND_FAILED);
if (fstat(print_fd, &filestats))
{
httpAddrFreeList(addrlist);
close(fd);
perror("ERROR: unable to stat print file");
return (CUPS_BACKEND_FAILED);
}
filestats.st_size *= manual_copies;
}
filestats.st_size *= manual_copies;
if ((fp = fopen(filename, "rb")) == NULL)
else
{
httpAddrFreeList(addrlist);
close(fd);
/*
* Use a "very large value" for the size so that the printer will
* keep printing until we close the connection...
*/
perror("ERROR: unable to open print file for reading");
return (CUPS_BACKEND_FAILED);
#ifdef _LARGEFILE_SOURCE
filestats.st_size = (size_t)(999999999999.0);
#else
filestats.st_size = 2147483647;
#endif /* _LARGEFILE_SOURCE */
}
/*
@@ -903,7 +964,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
return (CUPS_BACKEND_FAILED);
}
fprintf(stderr, "INFO: Sending control file (%u bytes)\n",
fprintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
(unsigned)strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
@@ -917,8 +978,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
if (read(fd, &status, 1) < 1)
{
fprintf(stderr, "WARNING: Remote host did not respond with control "
"status byte after %d seconds!\n", timeout);
fprintf(stderr,
_("WARNING: Remote host did not respond with control "
"status byte after %d seconds!\n"), timeout);
status = errno;
}
@@ -926,10 +988,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
}
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
fprintf(stderr,
_("ERROR: Remote host did not accept control file (%d)\n"),
status);
else
fputs("INFO: Control file sent successfully\n", stderr);
fputs(_("INFO: Control file sent successfully\n"), stderr);
}
else
status = 0;
@@ -950,17 +1013,22 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
return (CUPS_BACKEND_FAILED);
}
fprintf(stderr, "INFO: Sending data file (" CUPS_LLFMT " bytes)\n",
fprintf(stderr,
#ifdef HAVE_LONG_LONG
_("INFO: Sending data file (%lld bytes)\n"),
#else
_("INFO: Sending data file (%ld bytes)\n"),
#endif /* HAVE_LONG_LONG */
CUPS_LLCAST filestats.st_size);
tbytes = 0;
for (copy = 0; copy < manual_copies; copy ++)
{
rewind(fp);
lseek(print_fd, 0, SEEK_SET);
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
while ((nbytes = read(print_fd, buffer, sizeof(buffer))) > 0)
{
fprintf(stderr, "INFO: Spooling LPR job, %.0f%% complete...\n",
fprintf(stderr, _("INFO: Spooling LPR job, %.0f%% complete...\n"),
100.0 * tbytes / filestats.st_size);
if (lpd_write(fd, buffer, nbytes) < nbytes)
@@ -973,39 +1041,45 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
}
}
if (tbytes < filestats.st_size)
status = errno;
else if (lpd_write(fd, "", 1) < 1)
if (mode == MODE_STANDARD)
{
perror("ERROR: Unable to send trailing nul to printer");
status = errno;
if (tbytes < filestats.st_size)
status = errno;
else if (lpd_write(fd, "", 1) < 1)
{
perror("ERROR: Unable to send trailing nul to printer");
status = errno;
}
else
{
/*
* Read the status byte from the printer; if we can't read the byte
* back now, we should set status to "errno", however at this point
* we know the printer got the whole file and we don't necessarily
* want to requeue it over and over...
*/
alarm(timeout);
if (recv(fd, &status, 1, 0) < 1)
{
fprintf(stderr,
_("WARNING: Remote host did not respond with data "
"status byte after %d seconds!\n"), timeout);
status = 0;
}
alarm(0);
}
}
else
{
/*
* Read the status byte from the printer; if we can't read the byte
* back now, we should set status to "errno", however at this point
* we know the printer got the whole file and we don't necessarily
* want to requeue it over and over...
*/
alarm(timeout);
if (recv(fd, &status, 1, 0) < 1)
{
fprintf(stderr, "WARNING: Remote host did not respond with data "
"status byte after %d seconds!\n", timeout);
status = 0;
}
alarm(0);
}
status = 0;
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept data file (%d)\n",
fprintf(stderr, _("ERROR: Remote host did not accept data file (%d)\n"),
status);
else
fputs("INFO: Data file sent successfully\n", stderr);
fputs(_("INFO: Data file sent successfully\n"), stderr);
}
if (status == 0 && order == ORDER_DATA_CONTROL)
@@ -1019,7 +1093,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
return (CUPS_BACKEND_FAILED);
}
fprintf(stderr, "INFO: Sending control file (%lu bytes)\n",
fprintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
(unsigned long)strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
@@ -1033,8 +1107,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
if (read(fd, &status, 1) < 1)
{
fprintf(stderr, "WARNING: Remote host did not respond with control "
"status byte after %d seconds!\n", timeout);
fprintf(stderr,
_("WARNING: Remote host did not respond with control "
"status byte after %d seconds!\n"), timeout);
status = errno;
}
@@ -1042,10 +1117,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
}
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
fprintf(stderr,
_("ERROR: Remote host did not accept control file (%d)\n"),
status);
else
fputs("INFO: Control file sent successfully\n", stderr);
fputs(_("INFO: Control file sent successfully\n"), stderr);
}
/*
@@ -1053,7 +1129,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
*/
close(fd);
fclose(fp);
if (status == 0)
{
+1677
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+136 -211
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Parallel port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -27,20 +18,14 @@
*
* main() - Send a file to the specified parallel port.
* list_devices() - List all parallel devices.
* side_cb() - Handle side-channel requests...
*/
/*
* Include necessary headers.
*/
#include <cups/backend.h>
#include <cups/cups.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <cups/string.h>
#include <signal.h>
#include "ieee1284.c"
#include "backend-private.h"
#ifdef __hpux
# include <sys/time.h>
@@ -73,7 +58,8 @@
* Local functions...
*/
void list_devices(void);
static void list_devices(void);
static void side_cb(int print_fd, int device_fd, int use_bc);
/*
@@ -94,25 +80,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
resource[1024], /* Resource info (device and options) */
*options; /* Pointer to options */
int port; /* Port number (not used) */
int fp; /* Print file */
int print_fd, /* Print file */
device_fd, /* Parallel device */
use_bc; /* Read back-channel data? */
int copies; /* Number of copies to print */
int fd; /* Parallel device */
int rbytes; /* Number of bytes read */
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 */
size_t tbytes; /* Total number of bytes written */
struct termios opts; /* Parallel port options */
fd_set input, /* Input set for select() */
output; /* Output set for select() */
int paperout; /* Paper out? */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
#ifdef __linux
unsigned int status; /* Port status (off-line, out-of-paper, etc.) */
#endif /* __linux */
/*
@@ -146,7 +122,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fputs("Usage: parallel job-id user title copies options [file]\n", stderr);
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
@@ -157,8 +134,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc == 6)
{
fp = 0;
copies = 1;
print_fd = 0;
copies = 1;
}
else
{
@@ -166,7 +143,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Try to open the print file...
*/
if ((fp = open(argv[6], O_RDONLY)) < 0)
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
{
perror("ERROR: unable to open print file");
return (CUPS_BACKEND_FAILED);
@@ -206,7 +183,26 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
do
{
if ((fd = open(resource, O_WRONLY | O_EXCL)) == -1)
#if defined(__linux) || defined(__FreeBSD__)
/*
* The Linux and FreeBSD parallel port drivers currently are broken WRT
* select() and bidirection I/O...
*/
device_fd = open(resource, O_WRONLY | O_EXCL);
use_bc = 0;
#else
if ((device_fd = open(resource, O_RDWR | O_EXCL)) < 0)
{
device_fd = open(resource, O_WRONLY | O_EXCL);
use_bc = 0;
}
else
use_bc = 1;
#endif /* __linux || __FreeBSD__ */
if (device_fd == -1)
{
if (getenv("CLASS") != NULL)
{
@@ -217,8 +213,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* available printer in the class.
*/
fputs("INFO: Unable to open parallel port, queuing on next printer in class...\n",
stderr);
fputs(_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"), stderr);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -231,23 +227,24 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (errno == EBUSY)
{
fputs("INFO: Parallel port busy; will retry in 30 seconds...\n", stderr);
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
sleep(30);
}
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
{
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
fputs(_("INFO: Printer not connected; will retry in 30 seconds...\n"),
stderr);
sleep(30);
}
else
{
fprintf(stderr, "ERROR: Unable to open parallel port device file \"%s\": %s\n",
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
}
}
while (fd < 0);
while (device_fd < 0);
fputs("STATE: -connecting-to-device\n", stderr);
@@ -255,189 +252,52 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Set any options provided...
*/
tcgetattr(fd, &opts);
tcgetattr(device_fd, &opts);
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
/**** No options supported yet ****/
tcsetattr(fd, TCSANOW, &opts);
/*
* Check printer status...
*/
paperout = 0;
#if defined(__linux) && defined(LP_POUTPA)
/*
* Show the printer status before we send the file...
*/
while (!ioctl(fd, LPGETSTATUS, &status))
{
fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
if (status & LP_POUTPA)
{
fputs("WARNING: Media tray empty!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
paperout = 1;
}
if (!(status & LP_PERRORP))
fputs("WARNING: Printer fault!\n", stderr);
else if (!(status & LP_PSELECD))
fputs("WARNING: Printer off-line.\n", stderr);
else
break;
sleep(5);
}
#endif /* __linux && LP_POUTPA */
/*
* Now that we are "connected" to the port, ignore SIGTERM so that we
* can finish out any page data the driver sends (e.g. to eject the
* current page... Only ignore SIGTERM if we are printing data from
* stdin (otherwise you can't cancel raw jobs...)
*/
if (argc < 7)
{
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
}
tcsetattr(device_fd, TCSANOW, &opts);
/*
* Finally, send the print file...
*/
wbytes = 0;
tbytes = 0;
while (copies > 0)
while (copies > 0 && tbytes >= 0)
{
copies --;
if (fp != 0)
if (print_fd != 0)
{
fputs("PAGE: 1 1\n", stderr);
lseek(fp, 0, SEEK_SET);
lseek(print_fd, 0, SEEK_SET);
}
tbytes = 0;
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
{
/*
* Write the print data to the printer...
*/
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
tbytes += nbytes;
bufptr = buffer;
while (nbytes > 0)
{
/*
* See if we are ready to read or write...
*/
do
{
FD_ZERO(&input);
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
while (select(fd + 1, &input, &output, NULL, NULL) < 0);
if (FD_ISSET(fd, &input))
{
/*
* Read backchannel data...
*/
if ((rbytes = read(fd, resource, sizeof(resource))) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(resource, rbytes, 1.0);
}
}
if (FD_ISSET(fd, &output))
{
/*
* Write print data...
*/
if ((wbytes = write(fd, bufptr, nbytes)) < 0)
if (errno == ENOTTY)
wbytes = write(fd, bufptr, nbytes);
if (wbytes < 0)
{
/*
* Check for retryable errors...
*/
if (errno == ENOSPC)
{
paperout = 1;
fputs("ERROR: Out of paper!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
}
else if (errno != EAGAIN && errno != EINTR)
{
perror("ERROR: Unable to send print file to printer");
break;
}
}
else
{
/*
* Update count and pointer...
*/
if (paperout)
{
fputs("STATUS: -media-tray-empty-error\n", stderr);
paperout = 0;
}
nbytes -= wbytes;
bufptr += wbytes;
}
}
}
if (wbytes < 0)
break;
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
(unsigned long)tbytes);
}
if (print_fd != 0 && tbytes >= 0)
fprintf(stderr,
#ifdef HAVE_LONG_LONG
_("INFO: Sent print file, %lld bytes...\n"),
#else
_("INFO: Sent print file, %ld bytes...\n"),
#endif /* HAVE_LONG_LONG */
CUPS_LLCAST tbytes);
}
/*
* Close the socket connection and input file and return...
*/
close(fd);
if (fp != 0)
close(fp);
close(device_fd);
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
if (print_fd != 0)
close(print_fd);
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
}
@@ -445,7 +305,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* 'list_devices()' - List all parallel devices.
*/
void
static void
list_devices(void)
{
#if defined(__hpux) || defined(__sgi) || defined(__sun)
@@ -466,8 +326,6 @@ list_devices(void)
strcpy(basedevice, "/dev/parallel/");
else if (!access("/dev/printers/", 0))
strcpy(basedevice, "/dev/printers/");
else if (!access("/dev/par0", 0))
strcpy(basedevice, "/dev/par");
else
strcpy(basedevice, "/dev/lp");
@@ -487,9 +345,9 @@ list_devices(void)
* Now grab the IEEE 1284 device ID string...
*/
if (!get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
NULL, NULL, 0))
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
NULL, NULL, 0))
printf("direct parallel:%s \"%s\" \"%s LPT #%d\" \"%s\"\n", device,
make_model, make_model, i + 1, device_id);
else
@@ -736,6 +594,73 @@ list_devices(void)
}
/*
* 'side_cb()' - Handle side-channel requests...
*/
static void
side_cb(int print_fd, /* I - Print file */
int device_fd, /* I - Device file */
int use_bc) /* I - Using back-channel? */
{
cups_sc_command_t command; /* Request command */
cups_sc_status_t status; /* Request/response status */
char data[2048]; /* Request/response data */
int datalen; /* Request/response data size */
datalen = sizeof(data);
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
{
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
return;
}
switch (command)
{
case CUPS_SC_CMD_DRAIN_OUTPUT :
if (backendDrainOutput(print_fd, device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
else if (tcdrain(device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
else
status = CUPS_SC_STATUS_OK;
datalen = 0;
break;
case CUPS_SC_CMD_GET_BIDI :
data[0] = use_bc;
datalen = 1;
break;
case CUPS_SC_CMD_GET_DEVICE_ID :
memset(data, 0, sizeof(data));
if (backendGetDeviceID(device_fd, data, sizeof(data) - 1,
NULL, 0, NULL, NULL, 0))
{
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
datalen = 0;
}
else
{
status = CUPS_SC_STATUS_OK;
datalen = strlen(data);
}
break;
default :
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
datalen = 0;
break;
}
cupsSideChannelWrite(command, status, data, datalen, 1.0);
}
/*
* End of "$Id$".
*/
+378
Ver Arquivo
@@ -0,0 +1,378 @@
/*
* "$Id$"
*
* Common run loop APIs for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2006-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"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* backendDrainOutput() - Drain pending print data to the device.
* backendRunLoop() - Read and write print and back-channel data.
*/
/*
* Include necessary headers.
*/
#include "backend-private.h"
#ifdef __hpux
# include <sys/time.h>
#else
# include <sys/select.h>
#endif /* __hpux */
/*
* 'backendDrainOutput()' - Drain pending print data to the device.
*/
int /* O - 0 on success, -1 on error */
backendDrainOutput(int print_fd, /* I - Print file descriptor */
int device_fd) /* I - Device file descriptor */
{
int nfds; /* Maximum file descriptor value + 1 */
fd_set input; /* Input set for reading */
ssize_t print_bytes, /* Print bytes read */
bytes; /* Bytes written */
char print_buffer[8192], /* Print data buffer */
*print_ptr; /* Pointer into print data buffer */
struct timeval timeout; /* Timeout for read... */
fprintf(stderr, "DEBUG: backendDrainOutput(print_fd=%d, device_fd=%d)\n",
print_fd, device_fd);
/*
* Figure out the maximum file descriptor value to use with select()...
*/
nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
/*
* Now loop until we are out of data from print_fd...
*/
for (;;)
{
/*
* Use select() to determine whether we have data to copy around...
*/
FD_ZERO(&input);
FD_SET(print_fd, &input);
timeout.tv_sec = 0;
timeout.tv_usec = 0;
if (select(nfds, &input, NULL, NULL, &timeout) < 0)
return (-1);
if (!FD_ISSET(print_fd, &input))
return (0);
if ((print_bytes = read(print_fd, print_buffer,
sizeof(print_buffer))) < 0)
{
/*
* Read error - bail if we don't see EAGAIN or EINTR...
*/
if (errno != EAGAIN || errno != EINTR)
{
perror("ERROR: Unable to read print data");
return (-1);
}
print_bytes = 0;
}
else if (print_bytes == 0)
{
/*
* End of file, return...
*/
return (0);
}
fprintf(stderr, "DEBUG: Read %d bytes of print data...\n",
(int)print_bytes);
for (print_ptr = print_buffer; print_bytes > 0;)
{
if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
{
/*
* Write error - bail if we don't see an error we can retry...
*/
if (errno != ENOSPC && errno != ENXIO && errno != EAGAIN &&
errno != EINTR && errno != ENOTTY)
{
fprintf(stderr, _("ERROR: Unable to write print data: %s\n"),
strerror(errno));
return (-1);
}
}
else
{
fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
print_bytes -= bytes;
print_ptr += bytes;
}
}
}
}
/*
* 'backendRunLoop()' - Read and write print and back-channel data.
*/
ssize_t /* O - Total bytes on success, -1 on error */
backendRunLoop(
int print_fd, /* I - Print file descriptor */
int device_fd, /* I - Device file descriptor */
int use_bc, /* I - Use back-channel? */
void (*side_cb)(int, int, int)) /* I - Side-channel callback */
{
int nfds; /* Maximum file descriptor value + 1 */
fd_set input, /* Input set for reading */
output; /* Output set for writing */
ssize_t print_bytes, /* Print bytes read */
bc_bytes, /* Backchannel bytes read */
total_bytes, /* Total bytes written */
bytes; /* Bytes written */
int paperout; /* "Paper out" status */
int offline; /* "Off-line" status */
char print_buffer[8192], /* Print data buffer */
*print_ptr, /* Pointer into print data buffer */
bc_buffer[1024]; /* Back-channel data buffer */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
fprintf(stderr,
"DEBUG: backendRunLoop(print_fd=%d, device_fd=%d, use_bc=%d, "
"side_cb=%p)\n",
print_fd, device_fd, use_bc, side_cb);
/*
* If we are printing data from a print driver on stdin, ignore SIGTERM
* so that the driver can finish out any page data, e.g. to eject the
* current page. We only do this for stdin printing as otherwise there
* is no way to cancel a raw print job...
*/
if (!print_fd)
{
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
}
/*
* Figure out the maximum file descriptor value to use with select()...
*/
nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
/*
* Now loop until we are out of data from print_fd...
*/
for (print_bytes = 0, print_ptr = print_buffer, offline = -1,
paperout = -1, total_bytes = 0;;)
{
/*
* Use select() to determine whether we have data to copy around...
*/
FD_ZERO(&input);
if (!print_bytes)
FD_SET(print_fd, &input);
if (use_bc)
FD_SET(device_fd, &input);
if (side_cb)
FD_SET(CUPS_SC_FD, &input);
FD_ZERO(&output);
if (print_bytes || !use_bc)
FD_SET(device_fd, &output);
if (use_bc || side_cb)
{
if (select(nfds, &input, &output, NULL, NULL) < 0)
{
/*
* Pause printing to clear any pending errors...
*/
if (errno == ENXIO && offline != 1)
{
fputs("STATE: +offline-error\n", stderr);
fputs(_("INFO: Printer is currently off-line.\n"), stderr);
offline = 1;
}
else if (errno == EINTR && total_bytes == 0)
{
fputs("DEBUG: Received an interrupt before any bytes were "
"written, aborting!\n", stderr);
return (0);
}
sleep(1);
continue;
}
}
/*
* Check if we have a side-channel request ready...
*/
if (side_cb && FD_ISSET(CUPS_SC_FD, &input))
(*side_cb)(print_fd, device_fd, use_bc);
/*
* Check if we have back-channel data ready...
*/
if (FD_ISSET(device_fd, &input))
{
if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
{
fprintf(stderr,
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
CUPS_LLCAST bc_bytes);
cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
}
}
/*
* Check if we have print data ready...
*/
if (FD_ISSET(print_fd, &input))
{
if ((print_bytes = read(print_fd, print_buffer,
sizeof(print_buffer))) < 0)
{
/*
* Read error - bail if we don't see EAGAIN or EINTR...
*/
if (errno != EAGAIN || errno != EINTR)
{
perror("ERROR: Unable to read print data");
return (-1);
}
print_bytes = 0;
}
else if (print_bytes == 0)
{
/*
* End of file, break out of the loop...
*/
break;
}
print_ptr = print_buffer;
fprintf(stderr, "DEBUG: Read %d bytes of print data...\n",
(int)print_bytes);
}
/*
* Check if the device is ready to receive data and we have data to
* send...
*/
if (print_bytes && FD_ISSET(device_fd, &output))
{
if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
{
/*
* Write error - bail if we don't see an error we can retry...
*/
if (errno == ENOSPC)
{
if (paperout != 1)
{
fputs("STATE: +media-empty-error\n", stderr);
fputs(_("ERROR: Out of paper!\n"), stderr);
paperout = 1;
}
}
else if (errno == ENXIO)
{
if (offline != 1)
{
fputs("STATE: +offline-error\n", stderr);
fputs(_("INFO: Printer is currently off-line.\n"), stderr);
offline = 1;
}
}
else if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
{
fprintf(stderr, _("ERROR: Unable to write print data: %s\n"),
strerror(errno));
return (-1);
}
}
else
{
if (paperout)
{
fputs("STATE: -media-empty-error\n", stderr);
paperout = 0;
}
if (offline)
{
fputs("STATE: -offline-error\n", stderr);
fputs(_("INFO: Printer is now on-line.\n"), stderr);
offline = 0;
}
fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
print_bytes -= bytes;
print_ptr += bytes;
total_bytes += bytes;
}
}
}
/*
* Return with success...
*/
return (total_bytes);
}
/*
* End of "$Id$".
*/
+10 -9
Ver Arquivo
@@ -3,6 +3,7 @@
*
* IRIX SCSI printer support for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2003-2005 by Easy Software Products, all rights reserved.
*
* Redistribution and use in source and binary forms, with or
@@ -95,7 +96,7 @@ print_device(const char *resource, /* I - SCSI device */
if (strncmp(resource, "/dev/scsi/", 10) != 0)
{
fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
fprintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"), resource);
return (CUPS_BACKEND_STOP);
}
@@ -118,8 +119,8 @@ print_device(const char *resource, /* I - SCSI device */
* available printer in the class.
*/
fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
stderr);
fputs(_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"), stderr);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -132,14 +133,13 @@ print_device(const char *resource, /* I - SCSI device */
if (errno != EAGAIN && errno != EBUSY)
{
fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
resource, strerror(errno));
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
else
{
fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
resource);
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
sleep(30);
}
}
@@ -201,7 +201,8 @@ print_device(const char *resource, /* I - SCSI device */
if (ioctl(scsi_fd, DS_ENTER, &scsi_req) < 0 ||
scsi_req.ds_status != 0)
{
fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
fprintf(stderr,
_("WARNING: SCSI command timed out (%d); retrying...\n"),
scsi_req.ds_status);
sleep(try + 1);
}
@@ -210,7 +211,7 @@ print_device(const char *resource, /* I - SCSI device */
if (try >= 10)
{
fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
fprintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
scsi_req.ds_status);
close(scsi_fd);
return (CUPS_BACKEND_FAILED);
+12 -9
Ver Arquivo
@@ -3,6 +3,7 @@
*
* Linux SCSI printer support for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2003-2005 by Easy Software Products, all rights reserved.
*
* Redistribution and use in source and binary forms, with or
@@ -55,6 +56,7 @@
*/
#include <scsi/sg.h>
#include <cups/i18n.h>
/*
@@ -108,7 +110,7 @@ print_device(const char *resource, /* I - SCSI device */
if (strncmp(resource, "/dev/sg", 7) != 0)
{
fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
fprintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"), resource);
return (CUPS_BACKEND_STOP);
}
@@ -131,8 +133,9 @@ print_device(const char *resource, /* I - SCSI device */
* available printer in the class.
*/
fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
stderr);
_cupsLangPuts(stderr,
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -145,14 +148,13 @@ print_device(const char *resource, /* I - SCSI device */
if (errno != EAGAIN && errno != EBUSY)
{
fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
resource, strerror(errno));
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
else
{
fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
resource);
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
sleep(30);
}
}
@@ -218,7 +220,8 @@ print_device(const char *resource, /* I - SCSI device */
if (ioctl(scsi_fd, SG_IO, &scsi_req) < 0 ||
scsi_req.status != 0)
{
fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
fprintf(stderr,
_("WARNING: SCSI command timed out (%d); retrying...\n"),
scsi_req.status);
sleep(try + 1);
}
@@ -227,7 +230,7 @@ print_device(const char *resource, /* I - SCSI device */
if (try >= 10)
{
fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
fprintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
scsi_req.status);
close(scsi_fd);
return (CUPS_BACKEND_FAILED);
+7 -3
Ver Arquivo
@@ -3,6 +3,7 @@
*
* SCSI printer backend for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2003-2006 by Easy Software Products, all rights reserved.
*
* Redistribution and use in source and binary forms, with or
@@ -55,10 +56,12 @@
#include <cups/backend.h>
#include <cups/cups.h>
#include <cups/i18n.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <cups/string.h>
#include <cups/i18n.h>
#include <signal.h>
#ifdef WIN32
@@ -80,7 +83,7 @@ void list_devices(void);
int print_device(const char *resource, int fd, int copies);
#ifdef __linux__
#if defined(__linux__) && defined(HAVE_SCSI_SG_H)
# include "scsi-linux.c"
#elif defined(__sgi)
# include "scsi-irix.c"
@@ -90,7 +93,7 @@ int print_device(const char *resource, int fd, int copies);
*/
void list_devices(void) {}
int print_device(const char *resource, int fd, int copies) { return (CUPS_BACKEND_FAILED); }
#endif /* __linux */
#endif /* __linux && HAVE_SCSI_SG_H */
/*
@@ -150,7 +153,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fputs("Usage: scsi:/dev/file job-id user title copies options [file]\n", stderr);
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
+318 -172
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Serial port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -27,19 +18,14 @@
*
* main() - Send a file to the printer or server.
* list_devices() - List all serial devices.
* side_cb() - Handle side-channel requests...
*/
/*
* Include necessary headers.
*/
#include <cups/backend.h>
#include <cups/cups.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <cups/string.h>
#include <signal.h>
#include "backend-private.h"
#ifdef __hpux
# include <sys/modem.h>
@@ -87,12 +73,18 @@
# include <IOKit/IOBSD.h>
#endif /* __APPLE__ */
#if defined(__linux) && defined(TIOCGSERIAL)
# include <linux/serial.h>
# include <linux/ioctl.h>
#endif /* __linux && TIOCGSERIAL */
/*
* Local functions...
*/
void list_devices(void);
static void list_devices(void);
static void side_cb(int print_fd, int device_fd, int use_bc);
/*
@@ -116,21 +108,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
value[255], /* Value of option */
*ptr; /* Pointer into name or value */
int port; /* Port number (not used) */
int fp; /* Print file */
int copies; /* Number of copies to print */
int fd; /* Parallel device */
int rbytes; /* Number of bytes read */
int wbytes; /* Number of bytes written */
size_t nbytes, /* Number of bytes read */
tbytes; /* Total number of bytes written */
int print_fd, /* Print file */
device_fd; /* Serial device */
int nfds; /* Maximum file descriptor value + 1 */
fd_set input, /* Input set for reading */
output; /* Output set for writing */
ssize_t print_bytes, /* Print bytes read */
bc_bytes, /* Backchannel bytes read */
total_bytes, /* Total bytes written */
bytes; /* Bytes written */
int dtrdsr; /* Do dtr/dsr flow control? */
int bufsize; /* Size of output buffer for writes */
char buffer[8192], /* Output buffer */
*bufptr; /* Pointer into buffer */
int print_size; /* Size of output buffer for writes */
char print_buffer[8192], /* Print data buffer */
*print_ptr, /* Pointer into print data buffer */
bc_buffer[1024]; /* Back-channel data buffer */
struct termios opts; /* Serial port options */
struct termios origopts; /* Original port options */
fd_set input, /* Input set for select() */
output; /* Output set for select() */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -167,7 +161,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fputs("Usage: serial job-id user title copies options [file]\n", stderr);
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
@@ -178,8 +173,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc == 6)
{
fp = 0;
copies = 1;
print_fd = 0;
copies = 1;
}
else
{
@@ -187,7 +182,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Try to open the print file...
*/
if ((fp = open(argv[6], O_RDONLY)) < 0)
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
{
perror("ERROR: unable to open print file");
return (CUPS_BACKEND_FAILED);
@@ -227,7 +222,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
do
{
if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL | O_NDELAY)) == -1)
if ((device_fd = open(resource, O_RDWR | O_NOCTTY | O_EXCL |
O_NDELAY)) == -1)
{
if (getenv("CLASS") != NULL)
{
@@ -238,8 +234,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* available printer in the class.
*/
fputs("INFO: Unable to open serial port, queuing on next printer in class...\n",
stderr);
fputs(_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"), stderr);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -252,18 +248,18 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (errno == EBUSY)
{
fputs("INFO: Serial port busy; will retry in 30 seconds...\n", stderr);
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
sleep(30);
}
else
{
fprintf(stderr, "ERROR: Unable to open serial port device file \"%s\": %s\n",
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
}
}
while (fd < 0);
while (device_fd < 0);
fputs("STATE: -connecting-to-device\n", stderr);
@@ -271,16 +267,18 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Set any options provided...
*/
tcgetattr(fd, &origopts);
tcgetattr(fd, &opts);
tcgetattr(device_fd, &origopts);
tcgetattr(device_fd, &opts);
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
opts.c_oflag &= ~OPOST; /* Don't post-process */
opts.c_lflag &= ~(ICANON | ECHO | ISIG);
/* Raw mode */
opts.c_oflag &= ~OPOST; /* Don't post-process */
bufsize = 96; /* 9600 baud / 10 bits/char / 10Hz */
dtrdsr = 0; /* No dtr/dsr flow control */
print_size = 96; /* 9600 baud / 10 bits/char / 10Hz */
dtrdsr = 0; /* No dtr/dsr flow control */
if (options != NULL)
if (options)
{
while (*options)
{
/*
@@ -305,7 +303,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*ptr++ = *options++;
*ptr = '\0';
if (*options == '+')
if (*options == '+' || *options == '&')
options ++;
}
else
@@ -321,7 +319,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Set the baud rate...
*/
bufsize = atoi(value) / 100;
print_size = atoi(value) / 100;
#if B19200 == 19200
cfsetispeed(&opts, atoi(value));
@@ -372,7 +370,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
break;
# endif /* B230400 */
default :
fprintf(stderr, "WARNING: Unsupported baud rate %s!\n", value);
fprintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
value);
break;
}
#endif /* B19200 == 19200 */
@@ -483,9 +482,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
}
}
}
tcsetattr(fd, TCSANOW, &opts);
fcntl(fd, F_SETFL, 0);
tcsetattr(device_fd, TCSANOW, &opts);
fcntl(device_fd, F_SETFL, 0);
/*
* Now that we are "connected" to the port, ignore SIGTERM so that we
@@ -494,7 +494,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* stdin (otherwise you can't cancel raw jobs...)
*/
if (argc < 7)
if (print_fd != 0)
{
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
@@ -510,133 +510,189 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
/*
* Finally, send the print file...
* Figure out the maximum file descriptor value to use with select()...
*/
if (bufsize > sizeof(buffer))
bufsize = sizeof(buffer);
nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
wbytes = 0;
/*
* Finally, send the print file. Ordinarily we would just use the
* backendRunLoop() function, however since we need to use smaller
* writes and may need to do DSR/DTR flow control, we duplicate much
* of the code here instead...
*/
if (print_size > sizeof(print_buffer))
print_size = sizeof(print_buffer);
total_bytes = 0;
while (copies > 0)
{
copies --;
if (fp != 0)
if (print_fd != 0)
{
fputs("PAGE: 1 1\n", stderr);
lseek(fp, 0, SEEK_SET);
lseek(print_fd, 0, SEEK_SET);
}
if (dtrdsr)
/*
* Now loop until we are out of data from print_fd...
*/
for (print_bytes = 0, print_ptr = print_buffer;;)
{
/*
* Check the port and sleep until DSR is set...
* Use select() to determine whether we have data to copy around...
*/
int status;
FD_ZERO(&input);
if (!print_bytes)
FD_SET(print_fd, &input);
FD_SET(device_fd, &input);
FD_SET(CUPS_SC_FD, &input);
FD_ZERO(&output);
if (print_bytes)
FD_SET(device_fd, &output);
if (!ioctl(fd, TIOCMGET, &status))
if (!(status & TIOCM_DSR))
{
/*
* Wait for DSR to go high...
*/
if (select(nfds, &input, &output, NULL, NULL) < 0)
continue; /* Ignore errors here */
fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
do
{
sleep(1);
if (ioctl(fd, TIOCMGET, &status))
break;
}
while (!(status & TIOCM_DSR));
fputs("DEBUG: DSR is high; writing to device...\n", stderr);
}
}
tbytes = 0;
while ((nbytes = read(fp, buffer, bufsize)) > 0)
{
/*
* Write the print data to the printer...
* Check if we have a side-channel request ready...
*/
tbytes += nbytes;
bufptr = buffer;
if (FD_ISSET(CUPS_SC_FD, &input))
side_cb(print_fd, device_fd, 1);
while (nbytes > 0)
/*
* Check if we have back-channel data ready...
*/
if (FD_ISSET(device_fd, &input))
{
/*
* See if we are ready to read or write...
*/
do
if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
{
FD_ZERO(&input);
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
while (select(fd + 1, &input, &output, NULL, NULL) < 0);
if (FD_ISSET(fd, &input))
{
/*
* Read backchannel data...
*/
if ((rbytes = read(fd, resource, sizeof(resource))) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(resource, rbytes, 1.0);
}
}
if (FD_ISSET(fd, &output))
{
/*
* Write print data...
*/
if ((wbytes = write(fd, bufptr, nbytes)) < 0)
if (errno == ENOTTY)
wbytes = write(fd, bufptr, nbytes);
if (wbytes < 0)
{
/*
* Check for retryable errors...
*/
if (errno != EAGAIN && errno != EINTR)
{
perror("ERROR: Unable to send print file to printer");
break;
}
}
else
{
/*
* Update count and pointer...
*/
nbytes -= wbytes;
bufptr += wbytes;
}
fprintf(stderr,
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
CUPS_LLCAST bc_bytes);
cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
}
}
if (wbytes < 0)
break;
/*
* Check if we have print data ready...
*/
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
(unsigned long)tbytes);
if (FD_ISSET(print_fd, &input))
{
if ((print_bytes = read(print_fd, print_buffer, print_size)) < 0)
{
/*
* Read error - bail if we don't see EAGAIN or EINTR...
*/
if (errno != EAGAIN || errno != EINTR)
{
perror("ERROR: Unable to read print data");
tcsetattr(device_fd, TCSADRAIN, &origopts);
close(device_fd);
if (print_fd != 0)
close(print_fd);
return (CUPS_BACKEND_FAILED);
}
print_bytes = 0;
}
else if (print_bytes == 0)
{
/*
* End of file, break out of the loop...
*/
break;
}
print_ptr = print_buffer;
}
/*
* Check if the device is ready to receive data and we have data to
* send...
*/
if (print_bytes && FD_ISSET(device_fd, &output))
{
if (dtrdsr)
{
/*
* Check the port and sleep until DSR is set...
*/
int status;
if (!ioctl(device_fd, TIOCMGET, &status))
if (!(status & TIOCM_DSR))
{
/*
* Wait for DSR to go high...
*/
fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
do
{
/*
* Poll every 100ms...
*/
usleep(100000);
if (ioctl(device_fd, TIOCMGET, &status))
break;
}
while (!(status & TIOCM_DSR));
fputs("DEBUG: DSR is high; writing to device...\n", stderr);
}
}
if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
{
/*
* Write error - bail if we don't see an error we can retry...
*/
if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
{
perror("ERROR: Unable to write print data");
tcsetattr(device_fd, TCSADRAIN, &origopts);
close(device_fd);
if (print_fd != 0)
close(print_fd);
return (CUPS_BACKEND_FAILED);
}
}
else
{
fprintf(stderr, "DEBUG: Wrote %d bytes...\n", (int)bytes);
print_bytes -= bytes;
print_ptr += bytes;
total_bytes += bytes;
}
}
}
}
@@ -644,13 +700,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Close the serial port and input file and return...
*/
tcsetattr(fd, TCSADRAIN, &origopts);
tcsetattr(device_fd, TCSADRAIN, &origopts);
close(fd);
if (fp != 0)
close(fp);
close(device_fd);
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
if (print_fd != 0)
close(print_fd);
return (total_bytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
}
@@ -658,26 +715,53 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* 'list_devices()' - List all serial devices.
*/
void
static void
list_devices(void)
{
#if defined(__hpux) || defined(__sgi) || defined(__sun) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static char *funky_hex = "0123456789abcdefghijklmnopqrstuvwxyz";
/* Funky hex numbering used for some devices */
/* Funky hex numbering used for some *
* devices */
#endif /* __hpux || __sgi || __sun || __FreeBSD__ || __OpenBSD__ */
#if defined(__linux) || defined(linux) || defined(__linux__)
int i, j; /* Looping vars */
int fd; /* File descriptor */
char device[255]; /* Device filename */
#ifdef __linux
int i, j; /* Looping vars */
int fd; /* File descriptor */
char device[255]; /* Device filename */
# ifdef TIOCGSERIAL
struct serial_struct serinfo; /* serial port info */
# endif /* TIOCGSERIAL */
for (i = 0; i < 100; i ++)
{
sprintf(device, "/dev/ttyS%d", i);
if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
{
# ifdef TIOCGSERIAL
/*
* See if this port exists...
*/
serinfo.reserved_char[0] = 0;
if (!ioctl(fd, TIOCGSERIAL, &serinfo))
{
if (serinfo.type == PORT_UNKNOWN)
{
/*
* Nope...
*/
close(fd);
continue;
}
}
# endif /* TIOCGSERIAL */
close(fd);
# if defined(_ARCH_PPC) || defined(powerpc) || defined(__powerpc)
printf("serial serial:%s?baud=230400 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
@@ -697,6 +781,14 @@ list_devices(void)
printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
device, i + 1);
}
sprintf(device, "/dev/ttyUSB%d", i);
if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
{
close(fd);
printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
device, i + 1);
}
}
for (i = 0; i < 64; i ++)
@@ -824,13 +916,13 @@ list_devices(void)
{
sprintf(device, "/dev/cua/%c", 'a' + i);
if (access(device, 0) == 0)
#ifdef B115200
# ifdef B115200
printf("serial serial:%s?baud=115200 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
#else
# else
printf("serial serial:%s?baud=38400 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
#endif /* B115200 */
# endif /* B115200 */
}
/*
@@ -1063,7 +1155,6 @@ list_devices(void)
CFMutableDictionaryRef classesToMatch;
io_object_t serialService;
printf("serial serial \"Unknown\" \"Serial Printer (serial)\"\n");
kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort);
if (KERN_SUCCESS != kernResult)
@@ -1117,8 +1208,8 @@ list_devices(void)
CFRelease(bsdPathAsCFString);
if (result)
printf("serial serial:%s?baud=115200 \"Unknown\" \"%s\"\n", bsdPath,
serialName);
printf("serial serial:%s?baud=115200 \"Unknown\" \"%s\"\n",
bsdPath, serialName);
}
}
}
@@ -1126,13 +1217,68 @@ list_devices(void)
IOObjectRelease(serialService);
}
IOObjectRelease(serialPortIterator); /* Release the iterator. */
/*
* Release the iterator.
*/
IOObjectRelease(serialPortIterator);
}
}
#endif
}
/*
* 'side_cb()' - Handle side-channel requests...
*/
static void
side_cb(int print_fd, /* I - Print file */
int device_fd, /* I - Device file */
int use_bc) /* I - Using back-channel? */
{
cups_sc_command_t command; /* Request command */
cups_sc_status_t status; /* Request/response status */
char data[2048]; /* Request/response data */
int datalen; /* Request/response data size */
datalen = sizeof(data);
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
{
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
return;
}
switch (command)
{
case CUPS_SC_CMD_DRAIN_OUTPUT :
if (backendDrainOutput(print_fd, device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
else if (tcdrain(device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
else
status = CUPS_SC_STATUS_OK;
datalen = 0;
break;
case CUPS_SC_CMD_GET_BIDI :
data[0] = use_bc;
datalen = 1;
break;
default :
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
datalen = 0;
break;
}
cupsSideChannelWrite(command, status, data, datalen, 1.0);
}
/*
* End of "$Id$".
*/
+2256
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+172
Ver Arquivo
@@ -0,0 +1,172 @@
snmp.txt - 2006-04-19
---------------------
This file lists the "interesting" bits from the command:
snmpwalk -v 1 -c public HOST .1
for many network print servers and internal cards. It is mainly here
for SNMP documentation and development purposes.
AXIS 5600
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM J.sp.00,JETDIRECT EX,JD28,EEPROM 6.16.5
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Hewlett-Packard hp LaserJet 3380
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Axis AXIS 5600
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: Axis AXIS 5600
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.3 = OID: SNMPv2-SMI::zeroDotZero
SNMPv2-SMI::enterprises.11.2.4.3.10.8.0 = STRING: "AXIS433AE8"
SNMPv2-SMI::enterprises.368.2.3.2.601.0 = INTEGER: 9100
SNMPv2-SMI::enterprises.368.2.3.2.602.0 = INTEGER: 9101
SNMPv2-SMI::enterprises.368.2.3.2.603.0 = INTEGER: 9102
SNMPv2-SMI::enterprises.368.2.3.10.901.0 = STRING: "AXIS433AE8"
AXIS OfficeBasic
SNMPv2-MIB::sysDescr.0 = STRING: AXIS OfficeBasic Parallel Network Print Server V6.43 Sep 4 2003
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: EPSON Stylus Photo 870
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
DLink DP-301P+
SNMPv2-MIB::sysDescr.0 = STRING: D-Link DP-301P+ Print Server
Genicom ML280
SNMPv2-MIB::sysDescr.0 = STRING: GENICOM microLaser 280
SNMPv2-MIB::sysName.0 = STRING: PRQ_004F75
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: MANUFACTURER:GENICOM;MODEL:microLaser 280;
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.3369.1.1.2.4
EPSON Type-B Network Card
SNMPv2-MIB::sysDescr.0 = STRING: EPSON Type-B 10Base-T/100Base-TX Print Server
SNMPv2-MIB::sysName.0 = STRING: StylusPro7600-BB87A8
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: EPSON Stylus Pro 7600
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.1248.1.2.1.22.69.109.117.108.97.116.101.83.116.121.108.117.115.32.80.114.111.32.55.54.48.48
SNMPv2-SMI::enterprises.11.2.3.9.1.1.7.0 = STRING: "MFG:EPSON;CMD:ESCPL2,BDC;MDL:Stylus Pro 7600;CLS:PRINTER;DES:EPSON Stylus Pro 7600;"
SNMPv2-SMI::enterprises.1248.1.2.2.1.1.1.1.1 = STRING: "MFG:EPSON;CMD:ESCPL2,BDC;MDL:Stylus Pro 7600;CLS:PRINTER;DES:EPSON Stylus Pro 7600;"
EPSON Wireless 802.11b Print Server
SNMPv2-MIB::sysDescr.0 = STRING: EPSON Wireless LAN Print Interface compatible with an HP JETDIRECT EX
SNMPv2-MIB::sysName.0 = STRING: EAI_0F550B
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING:
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HP JetDirect EX3plus
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM D.04.03,JETDIRECT EX,JD26,EEPROM D.05.22
SNMPv2-MIB::sysName.0 = STRING: NPID1EC0F
HP LJ4000
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM G.05.34,JETDIRECT,JD30,EEPROM G.08.32
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: HP LaserJet 4000 Series
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.11.2.3.9.1.2.5
HP CLJ4550
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM L.20.07,JETDIRECT,JD84,EEPROM L.21.22,CIDATE 07/06/2001
SNMPv2-MIB::sysName.0 = STRING: NPI02FDE7
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: HP Color LaserJet 4550
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Hewlett-Packard Dynamic RAM Disk
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.11.2.3.9.1.2.14
Lexmark C522
SNMPv2-MIB::sysDescr.0 = STRING: Lexmark C522 version NS.NP.N212 kernel 2.6.6 All-N-1
SNMPv2-MIB::sysName.0 = STRING: ET0004000D0CCA
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolatileMemory
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceType.4 = OID: HOST-RESOURCES-TYPES::hrDeviceSerialPort
HOST-RESOURCES-MIB::hrDeviceType.5 = OID: HOST-RESOURCES-TYPES::hrDeviceNetwork
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Lexmark C522 9421TTV LS.FA.P129
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Nonvolatile RAM
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: IBM 750 Rev CXr
HOST-RESOURCES-MIB::hrDeviceDescr.4 = STRING: USB Interface
HOST-RESOURCES-MIB::hrDeviceDescr.5 = STRING: Network Interface
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.3 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.4 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.5 = OID: SNMPv2-SMI::enterprises.641.1
SNMPv2-SMI::enterprises.641.2.1.2.1.2.1 = STRING: "Lexmark C522"
SNMPv2-SMI::enterprises.641.2.1.2.1.3.1 = STRING: "MANUFACTURER:Lexmark International;COMMAND SET:;MODEL:Lexmark C522"
Linksys EPSX3
SNMPv2-MIB::sysDescr.0 = STRING: ETHERNET MULTI-ENVIRONMENT.ROM, JETDIRECT EX, EEPROM 6016
NetGear PS113
SNMPv2-MIB::sysDescr.0 = STRING: A SNMP proxy agent.
Okidata C7200
SNMPv2-MIB::sysDescr.0 = STRING: OkiLAN 6200e
SNMPv2-MIB::sysName.0 = STRING: OKI7009715
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolat
ileMemory
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: C7200
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: FLASH0
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.2001.1.1.1.1
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
SNMPv2-SMI::mib-2.43.14.1.1.3.1.1 = STRING: "IEEE 1284"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.2 = STRING: "EtherTalk Phase 2"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.3 = STRING: "LPD"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.4 = STRING: "Netware Rprinter"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.5 = STRING: "Netware Bindery or NDS Pserver"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.6 = STRING: "Raw TCP Port 9100"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.7 = STRING: "FTP"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.8 = STRING: "DLC/LLC"
SNMPv2-SMI::enterprises.2001.1.1.1.1.1.3530.0 = STRING: "C7200"
Xerox N2025
SNMPv2-MIB::sysDescr.0 = STRING: Xerox DocuPrint N2025 Network Laser Printer - 2.12-02
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceParallelPort
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDeviceNetwork
HOST-RESOURCES-MIB::hrDeviceType.6 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceType.7 = OID: HOST-RESOURCES-TYPES::hrDeviceOther
HOST-RESOURCES-MIB::hrDeviceType.9 = OID: HOST-RESOURCES-TYPES::hrDeviceVolatileMemory
HOST-RESOURCES-MIB::hrDeviceType.10 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolatileMemory
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Xerox DocuPrint N2025 Network Laser Printer - 2.12-02
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: IEEE 1284 port
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: Ethernet port
HOST-RESOURCES-MIB::hrDeviceDescr.6 = STRING: Motorola Power PC
HOST-RESOURCES-MIB::hrDeviceDescr.7 = STRING: USB Port
HOST-RESOURCES-MIB::hrDeviceDescr.9 = STRING: RAM Memory
HOST-RESOURCES-MIB::hrDeviceDescr.10 = STRING: ROM Memory
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.253.8.62.1.3.2.17.1
+260 -235
Ver Arquivo
@@ -3,46 +3,33 @@
*
* AppSocket backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Send a file to the printer or server.
* main() - Send a file to the printer or server.
* side_cb() - Handle side-channel requests...
* wait_bc() - Wait for back-channel data...
*/
/*
* Include necessary headers.
*/
#include <cups/backend.h>
#include <cups/http-private.h>
#include <cups/cups.h>
#include <stdio.h>
#include <stdlib.h>
#include "backend-private.h"
#include <stdarg.h>
#include <cups/string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#ifdef WIN32
# include <winsock.h>
@@ -56,6 +43,14 @@
#endif /* WIN32 */
/*
* Local functions...
*/
static void side_cb(int print_fd, int device_fd, int use_bc);
static int wait_bc(int device_fd, int secs);
/*
* 'main()' - Send a file to the printer or server.
*
@@ -76,24 +71,21 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
name[255], /* Name of option */
value[255], /* Value of option */
*ptr; /* Pointer into name or value */
int fp; /* Print file */
int print_fd; /* Print file */
int copies; /* Number of copies to print */
time_t start_time; /* Time of first connect */
int recoverable; /* Recoverable error shown? */
int contimeout; /* Connection timeout */
int waiteof; /* Wait for end-of-file? */
int port; /* Port number */
char portname[255]; /* Port name */
int delay; /* Delay for retries... */
int fd; /* AppSocket */
int device_fd; /* AppSocket */
int error; /* Error code (if any) */
http_addrlist_t *addrlist; /* Address list */
int rbytes; /* Number of bytes read */
int wbytes; /* Number of bytes written */
int nbytes; /* Number of bytes read */
size_t 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() */
output; /* Output set for select() */
http_addrlist_t *addrlist, /* Address list */
*addr; /* Connected address */
char addrname[256]; /* Address name */
ssize_t tbytes; /* Total number of bytes written */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -130,7 +122,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
@@ -142,8 +134,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc == 6)
{
fp = 0;
copies = 1;
print_fd = 0;
copies = 1;
}
else
{
@@ -151,7 +143,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Try to open the print file...
*/
if ((fp = open(argv[6], O_RDONLY)) < 0)
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
{
perror("ERROR: unable to open print file");
return (CUPS_BACKEND_FAILED);
@@ -176,7 +168,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Get options, if any...
*/
waiteof = 1;
waiteof = 1;
contimeout = 7 * 24 * 60 * 60;
if ((options = strchr(resource, '?')) != NULL)
{
@@ -234,6 +227,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
waiteof = !value[0] || !strcasecmp(value, "on") ||
!strcasecmp(value, "yes") || !strcasecmp(value, "true");
}
else if (!strcasecmp(name, "contimeout"))
{
/*
* Set the connection timeout...
*/
if (atoi(value) > 0)
contimeout = atoi(value);
}
}
}
@@ -241,253 +243,276 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Then try to connect to the remote host...
*/
recoverable = 0;
start_time = time(NULL);
sprintf(portname, "%d", port);
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
{
fprintf(stderr, "ERROR: Unable to locate printer \'%s\'!\n", hostname);
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"), hostname);
return (CUPS_BACKEND_STOP);
}
fprintf(stderr, "INFO: Attempting to connect to host %s on port %d\n",
fprintf(stderr, _("INFO: Attempting to connect to host %s on port %d\n"),
hostname, port);
wbytes = 0;
fputs("STATE: +connecting-to-device\n", stderr);
while (copies > 0)
for (delay = 5;;)
{
fputs("STATE: +connecting-to-device\n", stderr);
for (delay = 5;;)
if ((addr = httpAddrConnect(addrlist, &device_fd)) == NULL)
{
if (!httpAddrConnect(addrlist, &fd))
error = errno;
device_fd = -1;
if (getenv("CLASS") != NULL)
{
error = errno;
fd = -1;
/*
* If the CLASS environment variable is set, the job was submitted
* to a class and not to a specific queue. In this case, we want
* to abort immediately so that the job can be requeued on the next
* available printer in the class.
*/
if (getenv("CLASS") != NULL)
fputs(_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"), stderr);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
*/
sleep(5);
return (CUPS_BACKEND_FAILED);
}
if (error == ECONNREFUSED || error == EHOSTDOWN ||
error == EHOSTUNREACH)
{
if (contimeout && (time(NULL) - start_time) > contimeout)
{
/*
* If the CLASS environment variable is set, the job was submitted
* to a class and not to a specific queue. In this case, we want
* to abort immediately so that the job can be requeued on the next
* available printer in the class.
*/
fprintf(stderr, "INFO: Unable to connect to \"%s\", queuing on next printer in class...\n",
hostname);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
*/
sleep(5);
return (CUPS_BACKEND_FAILED);
fputs(_("ERROR: Printer not responding!\n"), stderr);
return (CUPS_BACKEND_FAILED);
}
if (error == ECONNREFUSED || error == EHOSTDOWN ||
error == EHOSTUNREACH)
{
fprintf(stderr, "INFO: Network host \'%s\' is busy; will retry in %d seconds...\n",
hostname, delay);
sleep(delay);
recoverable = 1;
if (delay < 30)
delay += 5;
}
else
{
perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
sleep(30);
}
fprintf(stderr,
_("WARNING: recoverable: Network host \'%s\' is busy; will "
"retry in %d seconds...\n"),
hostname, delay);
sleep(delay);
if (delay < 30)
delay += 5;
}
else
break;
{
recoverable = 1;
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
"retry in 30 seconds...\n"), stderr);
sleep(30);
}
}
else
break;
}
fputs("STATE: -connecting-to-device\n", stderr);
if (recoverable)
{
/*
* Now that we are "connected" to the port, ignore SIGTERM so that we
* can finish out any page data the driver sends (e.g. to eject the
* current page... Only ignore SIGTERM if we are printing data from
* stdin (otherwise you can't cancel raw jobs...)
* If we've shown a recoverable error make sure the printer proxies
* have a chance to see the recovered message. Not pretty but
* necessary for now...
*/
if (argc < 7)
{
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
fputs("INFO: recovered: \n", stderr);
sleep(5);
}
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
}
fputs("STATE: -connecting-to-device\n", stderr);
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
/*
* Finally, send the print file...
*/
#ifdef AF_INET6
if (addr->addr.addr.sa_family == AF_INET6)
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv6.sin6_port));
else
#endif /* AF_INET6 */
if (addr->addr.addr.sa_family == AF_INET)
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv4.sin_port));
/*
* Print everything...
*/
tbytes = 0;
while (copies > 0 && tbytes >= 0)
{
copies --;
if (fp != 0)
if (print_fd != 0)
{
fputs("PAGE: 1 1\n", stderr);
lseek(fp, 0, SEEK_SET);
lseek(print_fd, 0, SEEK_SET);
}
fputs("INFO: Connected to host, sending print job...\n", stderr);
tbytes = backendRunLoop(print_fd, device_fd, 1, side_cb);
tbytes = 0;
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
{
/*
* Write the print data to the printer...
*/
if (print_fd != 0 && tbytes >= 0)
fprintf(stderr,
#ifdef HAVE_LONG_LONG
_("INFO: Sent print file, %lld bytes...\n"),
#else
_("INFO: Sent print file, %ld bytes...\n"),
#endif /* HAVE_LONG_LONG */
CUPS_LLCAST tbytes);
}
tbytes += nbytes;
bufptr = buffer;
/*
* Get any pending back-channel data...
*/
while (nbytes > 0)
{
/*
* See if we are ready to read or write...
*/
do
{
FD_ZERO(&input);
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
while (select(fd + 1, &input, &output, NULL, NULL) < 0);
if (FD_ISSET(fd, &input))
{
/*
* Read backchannel data...
*/
if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(resource, rbytes, 1.0);
}
}
if (FD_ISSET(fd, &output))
{
/*
* Write print data...
*/
if ((wbytes = send(fd, bufptr, nbytes, 0)) < 0)
{
/*
* Check for retryable errors...
*/
if (errno != EAGAIN && errno != EINTR)
{
perror("ERROR: Unable to send print file to printer");
break;
}
}
else
{
/*
* Update count and pointer...
*/
nbytes -= wbytes;
bufptr += wbytes;
}
}
}
if (wbytes < 0)
break;
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
(unsigned long)tbytes);
}
if (waiteof)
{
/*
* Shutdown the socket and wait for the other end to finish...
*/
fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
shutdown(fd, 1);
for (;;)
{
/*
* Wait a maximum of 90 seconds for backchannel data or a closed
* connection...
*/
timeout.tv_sec = 90;
timeout.tv_usec = 0;
FD_ZERO(&input);
FD_SET(fd, &input);
#ifdef __hpux
if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
#else
if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
#endif /* __hpux */
{
/*
* Grab the data coming back and spit it out to stderr...
*/
if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(resource, rbytes, 1.0);
}
else
break;
}
else
break;
}
}
while (wait_bc(device_fd, 5) > 0);
if (waiteof)
{
/*
* Close the socket connection...
* Shutdown the socket and wait for the other end to finish...
*/
close(fd);
fputs(_("INFO: Print file sent, waiting for printer to finish...\n"),
stderr);
shutdown(device_fd, 1);
while (wait_bc(device_fd, 90) > 0);
}
/*
* Close the socket connection...
*/
close(device_fd);
httpAddrFreeList(addrlist);
/*
* Close the input file and return...
*/
if (fp != 0)
close(fp);
if (print_fd != 0)
close(print_fd);
if (wbytes >= 0)
fputs("INFO: Ready to print.\n", stderr);
if (tbytes >= 0)
fputs(_("INFO: Ready to print.\n"), stderr);
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
}
/*
* 'side_cb()' - Handle side-channel requests...
*/
static void
side_cb(int print_fd, /* I - Print file */
int device_fd, /* I - Device file */
int use_bc) /* I - Using back-channel? */
{
cups_sc_command_t command; /* Request command */
cups_sc_status_t status; /* Request/response status */
char data[2048]; /* Request/response data */
int datalen; /* Request/response data size */
datalen = sizeof(data);
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
{
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
return;
}
switch (command)
{
case CUPS_SC_CMD_DRAIN_OUTPUT :
/*
* Our sockets disable the Nagle algorithm and data is sent immediately.
*/
if (backendDrainOutput(print_fd, device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
else
status = CUPS_SC_STATUS_OK;
datalen = 0;
break;
case CUPS_SC_CMD_GET_BIDI :
data[0] = use_bc;
datalen = 1;
break;
default :
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
datalen = 0;
break;
}
cupsSideChannelWrite(command, status, data, datalen, 1.0);
}
/*
* 'wait_bc()' - Wait for back-channel data...
*/
static int /* O - # bytes read or -1 on error */
wait_bc(int device_fd, /* I - Socket */
int secs) /* I - Seconds to wait */
{
struct timeval timeout; /* Timeout for select() */
fd_set input; /* Input set for select() */
ssize_t bytes; /* Number of back-channel bytes read */
char buffer[1024]; /* Back-channel buffer */
/*
* Wait up to "secs" seconds for backchannel data...
*/
timeout.tv_sec = secs;
timeout.tv_usec = 0;
FD_ZERO(&input);
FD_SET(device_fd, &input);
if (select(device_fd + 1, &input, NULL, NULL, &timeout) > 0)
{
/*
* Grab the data coming back and spit it out to stderr...
*/
if ((bytes = read(device_fd, buffer, sizeof(buffer))) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
(int)bytes);
cupsBackChannelWrite(buffer, bytes, 1.0);
}
return (bytes);
}
else
return (-1);
}
+8 -15
Ver Arquivo
@@ -4,28 +4,20 @@
* IEEE-1284 support functions test program for the Common UNIX Printing
* System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Test the device-ID functions.
*/
/*
@@ -41,6 +33,7 @@
# include <unistd.h>
# include <fcntl.h>
#endif /* WIN32 */
#define DEBUG
#include "ieee1284.c"
@@ -76,8 +69,8 @@ main(int argc, /* I - Number of command-line args */
printf("%s:\n", argv[i]);
get_device_id(fd, device_id, sizeof(device_id), make_model,
sizeof(make_model), "test", uri, sizeof(uri));
backendGetDeviceID(fd, device_id, sizeof(device_id), make_model,
sizeof(make_model), "test", uri, sizeof(uri));
printf(" device_id=\"%s\"\n", device_id);
printf(" make_model=\"%s\"\n", make_model);
+1862 -1788
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+259 -266
Ver Arquivo
@@ -5,30 +5,23 @@
*
* This file is included from "usb.c" when compiled on UNIX/Linux.
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Send a file to the specified USB port.
* print_device() - Print a file to a USB device.
* list_devices() - List all USB devices.
* open_device() - Open a USB device...
* side_cb() - Handle side-channel requests...
*/
/*
@@ -43,7 +36,8 @@
* Local functions...
*/
int open_device(const char *uri);
static int open_device(const char *uri, int *use_bc);
static void side_cb(int print_fd, int device_fd, int use_bc);
/*
@@ -55,29 +49,20 @@ print_device(const char *uri, /* I - Device URI */
const char *hostname, /* I - Hostname/manufacturer */
const char *resource, /* I - Resource/modelname */
const char *options, /* I - Device options/serial number */
int fp, /* I - File descriptor to print */
int copies) /* I - Copies to print */
int print_fd, /* I - File descriptor to print */
int copies, /* I - Copies to print */
int argc, /* I - Number of command-line arguments (6 or 7) */
char *argv[]) /* I - Command-line arguments */
{
int fd; /* USB device */
int rbytes; /* Number of bytes read */
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 */
backbuf[1024]; /* Backchannel buffer */
int use_bc; /* Use backchannel path? */
int device_fd; /* USB device */
size_t tbytes; /* Total number of bytes written */
struct termios opts; /* Parallel port options */
fd_set input, /* Input set for select() */
output; /* Output set for select() */
int paperout; /* Paper out? */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
#ifdef __linux
unsigned int status; /* Port status (off-line, out-of-paper, etc.) */
#endif /* __linux */
(void)argc;
(void)argv;
/*
* Open the USB port device...
*/
@@ -86,7 +71,30 @@ print_device(const char *uri, /* I - Device URI */
do
{
if ((fd = open_device(uri)) == -1)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
/*
* *BSD's ulpt driver currently does not support the
* back-channel, incorrectly returns data ready on a select(),
* and locks up on read()...
*/
use_bc = 0;
#else
/*
* Disable backchannel data when printing to Brother, Canon, or
* Minolta USB printers - apparently these printers will return
* the IEEE-1284 device ID over and over and over when they get
* a read request...
*/
use_bc = strcasecmp(hostname, "Brother") &&
strcasecmp(hostname, "Canon") &&
strcasecmp(hostname, "Konica Minolta") &&
strcasecmp(hostname, "Minolta");
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
if ((device_fd = open_device(uri, &use_bc)) == -1)
{
if (getenv("CLASS") != NULL)
{
@@ -97,8 +105,8 @@ print_device(const char *uri, /* I - Device URI */
* available printer in the class.
*/
fputs("INFO: Unable to open USB device, queuing on next printer in class...\n",
stderr);
fputs(_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"), stderr);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -111,23 +119,25 @@ print_device(const char *uri, /* I - Device URI */
if (errno == EBUSY)
{
fputs("INFO: USB port busy; will retry in 30 seconds...\n", stderr);
sleep(30);
fputs(_("INFO: Printer busy; will retry in 10 seconds...\n"), stderr);
sleep(10);
}
else if (errno == ENXIO || errno == EIO || errno == ENOENT || errno == ENODEV)
else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
errno == ENODEV)
{
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
fputs(_("INFO: Printer not connected; will retry in 30 seconds...\n"),
stderr);
sleep(30);
}
else
{
fprintf(stderr, "ERROR: Unable to open USB device \"%s\": %s\n",
uri, strerror(errno));
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
}
}
while (fd < 0);
while (device_fd < 0);
fputs("STATE: -connecting-to-device\n", stderr);
@@ -135,187 +145,49 @@ print_device(const char *uri, /* I - Device URI */
* Set any options provided...
*/
tcgetattr(fd, &opts);
tcgetattr(device_fd, &opts);
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
/**** No options supported yet ****/
tcsetattr(fd, TCSANOW, &opts);
/*
* Check printer status...
*/
paperout = 0;
#if defined(__linux) && defined(LP_POUTPA)
/*
* Show the printer status before we send the file...
*/
while (!ioctl(fd, LPGETSTATUS, &status))
{
fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
if (status & LP_POUTPA)
{
fputs("WARNING: Media tray empty!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
paperout = 1;
}
if (!(status & LP_PERRORP))
fputs("WARNING: Printer fault!\n", stderr);
else if (!(status & LP_PSELECD))
fputs("WARNING: Printer off-line.\n", stderr);
else
break;
sleep(5);
}
#endif /* __linux && LP_POUTPA */
/*
* Now that we are "connected" to the port, ignore SIGTERM so that we
* can finish out any page data the driver sends (e.g. to eject the
* current page... Only ignore SIGTERM if we are printing data from
* stdin (otherwise you can't cancel raw jobs...)
*/
if (!fp)
{
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
}
tcsetattr(device_fd, TCSANOW, &opts);
/*
* Finally, send the print file...
*/
wbytes = 0;
tbytes = 0;
while (copies > 0)
while (copies > 0 && tbytes >= 0)
{
copies --;
if (fp != 0)
if (print_fd != 0)
{
fputs("PAGE: 1 1\n", stderr);
lseek(fp, 0, SEEK_SET);
lseek(print_fd, 0, SEEK_SET);
}
tbytes = 0;
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
{
/*
* Write the print data to the printer...
*/
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
tbytes += nbytes;
bufptr = buffer;
while (nbytes > 0)
{
/*
* See if we are ready to read or write...
*/
do
{
FD_ZERO(&input);
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
while (select(fd + 1, &input, &output, NULL, NULL) < 0);
if (FD_ISSET(fd, &input))
{
/*
* Read backchannel data...
*/
if ((rbytes = read(fd, backbuf, sizeof(backbuf))) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(backbuf, rbytes, 1.0);
}
}
if (FD_ISSET(fd, &output))
{
/*
* Write print data...
*/
if ((wbytes = write(fd, bufptr, nbytes)) < 0)
if (errno == ENOTTY)
wbytes = write(fd, bufptr, nbytes);
if (wbytes < 0)
{
/*
* Check for retryable errors...
*/
if (errno == ENOSPC)
{
paperout = 1;
fputs("ERROR: Out of paper!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
}
else if (errno != EAGAIN && errno != EINTR)
{
perror("ERROR: Unable to send print file to printer");
break;
}
}
else
{
/*
* Update count and pointer...
*/
if (paperout)
{
fputs("STATUS: -media-tray-empty-error\n", stderr);
paperout = 0;
}
nbytes -= wbytes;
bufptr += wbytes;
}
}
}
if (wbytes < 0)
break;
if (fp)
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
(unsigned long)tbytes);
}
if (print_fd != 0 && tbytes >= 0)
fprintf(stderr,
#ifdef HAVE_LONG_LONG
_("INFO: Sent print file, %lld bytes...\n"),
#else
_("INFO: Sent print file, %ld bytes...\n"),
#endif /* HAVE_LONG_LONG */
CUPS_LLCAST tbytes);
}
/*
* Close the USB port and return...
*/
close(fd);
close(device_fd);
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
}
@@ -327,44 +199,52 @@ void
list_devices(void)
{
#ifdef __linux
int i; /* Looping var */
int fd; /* File descriptor */
char format[255], /* Format for device filename */
device[255], /* Device filename */
device_id[1024], /* Device ID string */
device_uri[1024], /* Device URI string */
make_model[1024]; /* Make and model */
int i; /* Looping var */
int fd; /* File descriptor */
char device[255], /* Device filename */
device_id[1024], /* Device ID string */
device_uri[1024], /* Device URI string */
make_model[1024]; /* Make and model */
/*
* First figure out which USB printer filename to use...
*/
if (!access("/dev/usblp0", 0))
strcpy(format, "/dev/usblp%d");
else if (!access("/dev/usb/usblp0", 0))
strcpy(format, "/dev/usb/usblp%d");
else
strcpy(format, "/dev/usb/lp%d");
/*
* Then open each USB device...
* Try to open each USB device...
*/
for (i = 0; i < 16; i ++)
{
sprintf(device, format, i);
/*
* Linux has a long history of changing the standard filenames used
* for USB printer devices. We get the honor of trying them all...
*/
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
sprintf(device, "/dev/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
{
if (!get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
make_model, make_model, i + 1, device_id);
if (errno != ENOENT)
continue;
close(fd);
sprintf(device, "/dev/usb/lp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
{
if (errno != ENOENT)
continue;
sprintf(device, "/dev/usb/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
continue;
}
}
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
make_model, make_model, i + 1, device_id);
close(fd);
}
#elif defined(__sgi)
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
@@ -384,11 +264,11 @@ list_devices(void)
{
sprintf(device, "/dev/usb/printer%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
if ((fd = open(device, O_WRONLY | O_EXCL)) >= 0)
{
if (!get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
make_model, make_model, i + 1, device_id);
@@ -420,9 +300,13 @@ list_devices(void)
* 'open_device()' - Open a USB device...
*/
int /* O - File descriptor or -1 on error */
open_device(const char *uri) /* I - Device URI */
static int /* O - File descriptor or -1 on error */
open_device(const char *uri, /* I - Device URI */
int *use_bc) /* O - Set to 0 for unidirectional */
{
int fd; /* File descriptor */
/*
* The generic implementation just treats the URI as a device filename...
* Specific operating systems may also support using the device serial
@@ -431,7 +315,14 @@ open_device(const char *uri) /* I - Device URI */
if (!strncmp(uri, "usb:/dev/", 9))
#ifdef __linux
return (-1); /* Do not allow direct devices anymore */
{
/*
* Do not allow direct devices anymore...
*/
errno = ENODEV;
return (-1);
}
else if (!strncmp(uri, "usb://", 6))
{
/*
@@ -440,40 +331,45 @@ open_device(const char *uri) /* I - Device URI */
int i; /* Looping var */
int busy; /* Are any ports busy? */
int fd; /* File descriptor */
char format[255], /* Format for device filename */
device[255], /* Device filename */
char device[255], /* Device filename */
device_id[1024], /* Device ID string */
make_model[1024], /* Make and model */
device_uri[1024]; /* Device URI string */
/*
* First figure out which USB printer filename to use...
*/
if (!access("/dev/usblp0", 0))
strcpy(format, "/dev/usblp%d");
else if (!access("/dev/usb/usblp0", 0))
strcpy(format, "/dev/usb/usblp%d");
else
strcpy(format, "/dev/usb/lp%d");
/*
* Then find the correct USB device...
* Find the correct USB device...
*/
do
{
for (busy = 0, i = 0; i < 16; i ++)
{
sprintf(device, format, i);
/*
* Linux has a long history of changing the standard filenames used
* for USB printer devices. We get the honor of trying them all...
*/
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
sprintf(device, "/dev/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
{
get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri));
sprintf(device, "/dev/usb/lp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
{
sprintf(device, "/dev/usb/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
continue;
}
}
if (fd >= 0)
{
backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri));
}
else
{
@@ -494,7 +390,8 @@ open_device(const char *uri) /* I - Device URI */
* Yes, return this file descriptor...
*/
fprintf(stderr, "DEBUG: Printer using device file \"%s\"...\n", device);
fprintf(stderr, "DEBUG: Printer using device file \"%s\"...\n",
device);
return (fd);
}
@@ -514,7 +411,7 @@ open_device(const char *uri) /* I - Device URI */
if (busy)
{
fputs("INFO: USB printer is busy; will retry in 5 seconds...\n",
fputs(_("INFO: Printer busy; will retry in 5 seconds...\n"),
stderr);
sleep(5);
}
@@ -530,7 +427,14 @@ open_device(const char *uri) /* I - Device URI */
return (-1);
}
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
return (-1); /* Do not allow direct devices anymore */
{
/*
* Do not allow direct devices anymore...
*/
errno = ENODEV;
return (-1);
}
else if (!strncmp(uri, "usb://", 6))
{
/*
@@ -539,7 +443,6 @@ open_device(const char *uri) /* I - Device URI */
int i; /* Looping var */
int busy; /* Are any ports busy? */
int fd; /* File descriptor */
char device[255], /* Device filename */
device_id[1024], /* Device ID string */
make_model[1024], /* Make and model */
@@ -556,10 +459,10 @@ open_device(const char *uri) /* I - Device URI */
{
sprintf(device, "/dev/usb/printer%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri));
if ((fd = open(device, O_WRONLY | O_EXCL)) >= 0)
backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri));
else
{
/*
@@ -574,7 +477,17 @@ open_device(const char *uri) /* I - Device URI */
}
if (!strcmp(uri, device_uri))
return (fd); /* Yes, return this file descriptor... */
{
/*
* Yes, return this file descriptor...
*/
fputs("DEBUG: Setting use_bc to 0!\n", stderr);
*use_bc = 0;
return (fd);
}
/*
* This wasn't the one...
@@ -591,7 +504,7 @@ open_device(const char *uri) /* I - Device URI */
if (busy)
{
fputs("INFO: USB printer is busy; will retry in 5 seconds...\n",
fputs(_("INFO: Printer is busy; will retry in 5 seconds...\n"),
stderr);
sleep(5);
}
@@ -607,7 +520,20 @@ open_device(const char *uri) /* I - Device URI */
return (-1);
}
#else
return (open(uri + 4, O_RDWR | O_EXCL));
{
if (use_bc)
fd = open(uri + 4, O_RDWR | O_EXCL);
else
fd = -1;
if (fd < 0)
{
fd = open(uri + 4, O_WRONLY | O_EXCL);
*use_bc = 0;
}
return (fd);
}
#endif /* __linux */
else
{
@@ -617,6 +543,73 @@ open_device(const char *uri) /* I - Device URI */
}
/*
* 'side_cb()' - Handle side-channel requests...
*/
static void
side_cb(int print_fd, /* I - Print file */
int device_fd, /* I - Device file */
int use_bc) /* I - Using back-channel? */
{
cups_sc_command_t command; /* Request command */
cups_sc_status_t status; /* Request/response status */
char data[2048]; /* Request/response data */
int datalen; /* Request/response data size */
datalen = sizeof(data);
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
{
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
return;
}
switch (command)
{
case CUPS_SC_CMD_DRAIN_OUTPUT :
if (backendDrainOutput(print_fd, device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
else if (tcdrain(device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
else
status = CUPS_SC_STATUS_OK;
datalen = 0;
break;
case CUPS_SC_CMD_GET_BIDI :
data[0] = use_bc;
datalen = 1;
break;
case CUPS_SC_CMD_GET_DEVICE_ID :
memset(data, 0, sizeof(data));
if (backendGetDeviceID(device_fd, data, sizeof(data) - 1,
NULL, 0, NULL, NULL, 0))
{
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
datalen = 0;
}
else
{
status = CUPS_SC_STATUS_OK;
datalen = strlen(data);
}
break;
default :
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
datalen = 0;
break;
}
cupsSideChannelWrite(command, status, data, datalen, 1.0);
}
/*
* End of "$Id$".
*/
+27 -28
Ver Arquivo
@@ -3,23 +3,14 @@
*
* USB port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -45,6 +36,7 @@
#include <stdlib.h>
#include <errno.h>
#include <cups/string.h>
#include <cups/i18n.h>
#include <signal.h>
#ifdef WIN32
@@ -63,7 +55,7 @@
void list_devices(void);
int print_device(const char *uri, const char *hostname,
const char *resource, const char *options,
int fp, int copies);
int print_fd, int copies, int argc, char *argv[]);
/*
@@ -108,8 +100,10 @@ print_device(const char *uri, /* I - Device URI */
const char *hostname, /* I - Hostname/manufacturer */
const char *resource, /* I - Resource/modelname */
const char *options, /* I - Device options/serial number */
int fp, /* I - File descriptor to print */
int copies) /* I - Copies to print */
int print_fd, /* I - File descriptor to print */
int copies, /* I - Copies to print */
int argc, /* I - Number of command-line arguments (6 or 7) */
char *argv[]) /* I - Command-line arguments */
{
/*
* Can't print, so just reference the arguments to eliminate compiler
@@ -122,8 +116,10 @@ print_device(const char *uri, /* I - Device URI */
(void)hostname;
(void)resource;
(void)options;
(void)fp;
(void)print_fd;
(void)copies;
(void)argc;
(void)argv;
return (CUPS_BACKEND_FAILED);
}
@@ -142,7 +138,7 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments (6 or 7) */
char *argv[]) /* I - Command-line arguments */
{
int fp; /* Print file */
int print_fd; /* Print file */
int copies; /* Number of copies to print */
int status; /* Exit status */
int port; /* Port number (not used) */
@@ -188,7 +184,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fputs("Usage: usb job-id user title copies options [file]\n", stderr);
fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
@@ -203,7 +200,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
hostname, sizeof(hostname), &port,
resource, sizeof(resource)) < HTTP_URI_OK)
{
fputs("ERROR: No device URI found in argv[0] or in DEVICE_URI environment variable!\n", stderr);
fputs(_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
"environment variable!\n"), stderr);
return (1);
}
@@ -228,8 +226,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc == 6)
{
fp = 0;
copies = 1;
print_fd = 0;
copies = 1;
}
else
{
@@ -237,9 +235,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Try to open the print file...
*/
if ((fp = open(argv[6], O_RDONLY)) < 0)
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
{
fprintf(stderr, "ERROR: unable to open print file %s - %s\n",
fprintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
argv[6], strerror(errno));
return (CUPS_BACKEND_FAILED);
}
@@ -251,14 +249,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Finally, send the print file...
*/
status = print_device(uri, hostname, resource, options, fp, copies);
status = print_device(uri, hostname, resource, options, print_fd, copies,
argc, argv);
/*
* Close the input file and return...
*/
if (fp != 0)
close(fp);
if (print_fd != 0)
close(print_fd);
return (status);
}
+13 -14
Ver Arquivo
@@ -1,14 +1,13 @@
# DO NOT DELETE
lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
lpc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
lpc.o: ../cups/i18n.h ../cups/debug.h ../cups/string.h ../config.h
lpq.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpq.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/debug.h
lpr.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpr.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
lprm.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
lprm.o: ../cups/i18n.h ../cups/string.h ../config.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
lpc.o: lpc.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h \
../cups/transcode.h ../cups/debug.h ../cups/string.h ../config.h
lpq.o: lpq.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
lpr.o: lpr.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/i18n.h ../cups/transcode.h
lprm.o: lprm.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h \
../cups/transcode.h ../cups/string.h ../config.h
+11 -14
Ver Arquivo
@@ -3,23 +3,14 @@
#
# Berkeley commands makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 2007 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
include ../Makedefs
@@ -62,6 +53,12 @@ install: all
$(INSTALL_BIN) lprm $(BINDIR)
$(INSTALL_DIR) -m 755 $(SBINDIR)
$(INSTALL_BIN) lpc $(SBINDIR)
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(TARGETS); do \
cp $$file $(SYMROOT); \
done \
fi
#
+25 -81
Ver Arquivo
@@ -3,23 +3,14 @@
*
* "lpc" command for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -65,6 +56,8 @@ main(int argc, /* I - Number of command-line arguments */
*params; /* Pointer to parameters */
_cupsSetLocale(argv);
/*
* Connect to the scheduler...
*/
@@ -235,10 +228,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
const char *dests) /* I - Destinations */
{
ipp_t *request, /* IPP Request */
*response, /* IPP Response */
*jobs; /* IPP Get Jobs response */
ipp_attribute_t *attr, /* Current attribute */
*jattr; /* Current job attribute */
*response; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
cups_lang_t *language; /* Default language */
char *printer, /* Printer name */
*device, /* Device URI */
@@ -249,14 +240,13 @@ show_status(http_t *http, /* I - HTTP connection to server */
const 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 */
static const char *requested[] = /* Requested attributes */
{
"printer-name",
"device-uri",
"printer-is-accepting-jobs",
"printer-name",
"printer-state",
"printer-is-accepting-jobs"
"queued-job-count"
};
@@ -327,21 +317,21 @@ show_status(http_t *http, /* I - HTTP connection to server */
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
{
if (!strcmp(attr->name, "printer-name") &&
attr->value_tag == IPP_TAG_NAME)
printer = attr->values[0].string.text;
if (!strcmp(attr->name, "device-uri") &&
attr->value_tag == IPP_TAG_URI)
device = attr->values[0].string.text;
if (!strcmp(attr->name, "printer-state") &&
attr->value_tag == IPP_TAG_ENUM)
pstate = (ipp_pstate_t)attr->values[0].integer;
if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
attr->value_tag == IPP_TAG_BOOLEAN)
else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
attr->value_tag == IPP_TAG_BOOLEAN)
accepting = attr->values[0].boolean;
else if (!strcmp(attr->name, "printer-name") &&
attr->value_tag == IPP_TAG_NAME)
printer = attr->values[0].string.text;
else if (!strcmp(attr->name, "printer-state") &&
attr->value_tag == IPP_TAG_ENUM)
pstate = (ipp_pstate_t)attr->values[0].integer;
else if (!strcmp(attr->name, "queued-job-count") &&
attr->value_tag == IPP_TAG_INTEGER)
jobcount = attr->values[0].integer;
attr = attr->next;
}
@@ -393,7 +383,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
*ptr != '\0' && *dptr != '\0' && *ptr == *dptr;
ptr ++, dptr ++);
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' || isspace(*dptr & 255)))
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' ||
isspace(*dptr & 255)))
{
match = 1;
break;
@@ -419,53 +410,6 @@ show_status(http_t *http, /* I - HTTP connection to server */
if (match)
{
/*
* 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);
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
"ipp", NULL, "localhost", 631, "/printers/%s",
printer);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, printer_uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", NULL, "job-id");
if ((jobs = cupsDoRequest(http, request, "/")) != NULL)
{
/*
* Grab the number of jobs for the printer.
*/
for (jattr = jobs->attrs; jattr != NULL; jattr = jattr->next)
if (jattr->name && !strcmp(jattr->name, "job-id"))
jobcount ++;
ippDelete(jobs);
}
/*
* Display it...
*/
+50 -34
Ver Arquivo
@@ -3,23 +3,14 @@
*
* "lpq" command for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -49,6 +40,7 @@
* Local functions...
*/
static http_t *connect_server(const char *, http_t *);
static int show_jobs(const char *, http_t *, const char *,
const char *, const int, const int);
static void show_printer(const char *, http_t *, const char *);
@@ -75,36 +67,23 @@ main(int argc, /* I - Number of command-line arguments */
longstatus; /* Show file details */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
cups_lang_t *language; /* Language */
#ifdef HAVE_SSL
http_encryption_t encryption; /* Encryption? */
#endif /* HAVE_SSL */
language = cupsLangDefault();
/*
* Connect to the scheduler...
*/
if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption())) == NULL)
{
_cupsLangPrintf(stderr, _("%s: Unable to contact server!\n"), argv[0]);
return (1);
}
_cupsSetLocale(argv);
/*
* Check for command-line options...
*/
http = NULL;
dest = NULL;
user = NULL;
id = 0;
interval = 0;
longstatus = 0;
all = 0;
num_dests = cupsGetDests(&dests);
num_dests = 0;
dests = NULL;
for (i = 1; i < argc; i ++)
if (argv[i][0] == '+')
@@ -115,10 +94,10 @@ main(int argc, /* I - Number of command-line arguments */
{
case 'E' : /* Encrypt */
#ifdef HAVE_SSL
encryption = HTTP_ENCRYPT_REQUIRED;
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
if (http)
httpEncryption(http, encryption);
httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
#else
_cupsLangPrintf(stderr,
_("%s: Sorry, no encryption support compiled in!\n"),
@@ -166,6 +145,11 @@ main(int argc, /* I - Number of command-line arguments */
if ((instance = strchr(dest, '/')) != NULL)
*instance++ = '\0';
http = connect_server(argv[0], http);
if (num_dests == 0)
num_dests = cupsGetDests2(http, &dests);
if (cupsGetDest(dest, instance, num_dests, dests) == NULL)
{
if (instance)
@@ -186,8 +170,11 @@ main(int argc, /* I - Number of command-line arguments */
break;
case 'h' : /* Connect to host */
if (http != NULL)
if (http)
{
httpClose(http);
http = NULL;
}
if (argv[i][2] != '\0')
cupsSetServer(argv[i] + 2);
@@ -225,8 +212,13 @@ main(int argc, /* I - Number of command-line arguments */
else
user = argv[i];
http = connect_server(argv[0], http);
if (dest == NULL && !all)
{
if (num_dests == 0)
num_dests = cupsGetDests2(http, &dests);
for (i = 0; i < num_dests; i ++)
if (dests[i].is_default)
dest = dests[i].name;
@@ -294,6 +286,30 @@ main(int argc, /* I - Number of command-line arguments */
}
/*
* 'connect_server()' - Connect to the server as necessary...
*/
static http_t * /* O - New HTTP connection */
connect_server(const char *command, /* I - Command name */
http_t *http) /* I - Current HTTP connection */
{
if (!http)
{
http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption());
if (http == NULL)
{
_cupsLangPrintf(stderr, _("%s: Unable to connect to server\n"), command);
exit(1);
}
}
return (http);
}
/*
* 'show_jobs()' - Show jobs.
*/
+9 -18
Ver Arquivo
@@ -3,23 +3,14 @@
*
* "lpr" command for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -87,13 +78,14 @@ main(int argc, /* I - Number of command-line arguments */
ssize_t bytes; /* Bytes copied */
off_t filesize; /* Size of temp file */
int temp; /* Temporary file descriptor */
cups_lang_t *language; /* Language information */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Signal action */
struct sigaction oldaction; /* Old signal action */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
_cupsSetLocale(argv);
deletefile = 0;
printer = NULL;
num_dests = 0;
@@ -102,7 +94,6 @@ main(int argc, /* I - Number of command-line arguments */
options = NULL;
num_files = 0;
title = NULL;
language = cupsLangDefault();
for (i = 1; i < argc; i ++)
if (argv[i][0] == '-')
@@ -232,7 +223,7 @@ main(int argc, /* I - Number of command-line arguments */
snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(),
httpGetHostname(NULL, buffer, sizeof(buffer)));
num_options = cupsAddOption("notify-recipient", email,
num_options = cupsAddOption("notify-recipient-uri", email,
num_options, &options);
}
break;
+29 -27
Ver Arquivo
@@ -3,23 +3,14 @@
*
* "lprm" command for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -55,12 +46,14 @@ main(int argc, /* I - Number of command-line arguments */
ipp_t *request; /* IPP request */
ipp_t *response; /* IPP response */
ipp_op_t op; /* Operation */
cups_lang_t *language; /* Language */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
cups_dest_t *dests, /* Destinations */
*defdest; /* Default destination */
http_encryption_t encryption; /* Encryption? */
_cupsSetLocale(argv);
/*
* Setup to cancel individual print jobs...
*/
@@ -71,12 +64,6 @@ main(int argc, /* I - Number of command-line arguments */
response = NULL;
http = NULL;
encryption = cupsEncryption();
language = cupsLangDefault();
num_dests = cupsGetDests(&dests);
for (i = 0; i < num_dests; i ++)
if (dests[i].is_default)
dest = dests[i].name;
/*
* Open a connection to the server...
@@ -85,10 +72,13 @@ main(int argc, /* I - Number of command-line arguments */
if ((http = httpConnectEncrypt(cupsServer(), ippPort(), encryption)) == NULL)
{
_cupsLangPuts(stderr, _("lprm: Unable to contact server!\n"));
cupsFreeDests(num_dests, dests);
return (1);
}
num_dests = cupsGetDests2(http, &dests);
defdest = cupsGetDest(NULL, NULL, num_dests, dests);
dest = defdest ? defdest->name : NULL;
/*
* Process command-line arguments...
*/
@@ -102,6 +92,7 @@ main(int argc, /* I - Number of command-line arguments */
encryption = HTTP_ENCRYPT_REQUIRED;
httpEncryption(http, encryption);
cupsSetEncryption(encryption);
#else
_cupsLangPrintf(stderr,
_("%s: Sorry, no encryption support compiled in!\n"),
@@ -152,9 +143,6 @@ main(int argc, /* I - Number of command-line arguments */
break;
case 'h' : /* Connect to host */
if (http != NULL)
httpClose(http);
if (argv[i][2] != '\0')
cupsSetServer(argv[i] + 2);
else
@@ -172,6 +160,20 @@ main(int argc, /* I - Number of command-line arguments */
else
cupsSetServer(argv[i]);
}
httpClose(http);
cupsFreeDests(num_dests, dests);
if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
encryption)) == NULL)
{
_cupsLangPuts(stderr, _("lprm: Unable to contact server!\n"));
return (1);
}
num_dests = cupsGetDests2(http, &dests);
defdest = cupsGetDest(NULL, NULL, num_dests, dests);
dest = defdest ? defdest->name : NULL;
break;
default :
@@ -262,7 +264,7 @@ main(int argc, /* I - Number of command-line arguments */
}
/*
* If nothing has been cancelled yet, cancel the current job on the specified
* If nothing has been canceled yet, cancel the current job on the specified
* (or default) printer...
*/
+56 -55
Ver Arquivo
@@ -1,55 +1,56 @@
# DO NOT DELETE
help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
help-index.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
help-index.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
help-index.o: ../cups/i18n.h ../cups/string.h ../config.h ../cups/dir.h
html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
html.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
html.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
html.o: ../cups/i18n.h ../cups/string.h ../config.h
ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
ipp-var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
ipp-var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
ipp-var.o: ../cups/i18n.h ../cups/string.h ../config.h
search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
search.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
search.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
search.o: ../cups/i18n.h ../cups/string.h ../config.h
template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
template.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
template.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
template.o: ../cups/i18n.h ../cups/string.h ../config.h
var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
var.o: ../cups/i18n.h ../cups/string.h ../config.h
admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
admin.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
admin.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
admin.o: ../cups/i18n.h ../cups/string.h ../config.h ../cups/file.h
classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
classes.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
classes.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
classes.o: ../cups/i18n.h ../cups/string.h ../config.h
help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
help.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
help.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
help.o: ../cups/i18n.h ../cups/string.h ../config.h
jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
jobs.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
jobs.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
jobs.o: ../cups/i18n.h ../cups/string.h ../config.h
printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
printers.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
printers.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
printers.o: ../cups/i18n.h ../cups/string.h ../config.h
testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
testcgi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
testcgi.o: ../cups/array.h help-index.h
testhi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
testhi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
testhi.o: ../cups/array.h help-index.h
testtemplate.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
testtemplate.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
testtemplate.o: ../cups/language.h ../cups/array.h help-index.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \
../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h \
../cups/file.h ../cups/language.h ../cups/array.h help-index.h \
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
../config.h ../cups/dir.h
html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h \
../cups/adminutil.h ../cups/cups.h ../cups/file.h
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
../cups/array.h help-index.h
testhi.o: testhi.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
../cups/array.h help-index.h
testtemplate.o: testtemplate.c cgi.h ../cups/cups.h ../cups/ipp.h \
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
../cups/language.h ../cups/array.h help-index.h
+14 -17
Ver Arquivo
@@ -3,23 +3,14 @@
#
# CGI makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 2007 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
include ../Makedefs
@@ -63,6 +54,12 @@ install: all
for file in $(CGIS); do \
$(INSTALL_BIN) $$file $(SERVERBIN)/cgi-bin; \
done
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(TARGETS); do \
cp $$file $(SYMROOT); \
done \
fi
#
@@ -139,7 +136,7 @@ printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) libcgi.a
testcgi: testcgi.o ../Makedefs libcgi.a ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testcgi.o libcgi.a ../cups/libcups.a \
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
#
@@ -149,7 +146,7 @@ testcgi: testcgi.o ../Makedefs libcgi.a ../cups/libcups.a
testhi: testhi.o ../Makedefs libcgi.a ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testhi.o libcgi.a ../cups/libcups.a \
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
#
@@ -159,7 +156,7 @@ testhi: testhi.o ../Makedefs libcgi.a ../cups/libcups.a
testtemplate: testtemplate.o ../Makedefs libcgi.a ../cups/libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testtemplate.o libcgi.a ../cups/libcups.a \
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
#
+1935 -1382
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+6 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Private CGI definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2005 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*/
/*
+5 -14
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI support library definitions.
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*/
#ifndef _CUPS_CGI_H_
+11 -20
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Class status CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -95,8 +86,7 @@ main(int argc, /* I - Number of command-line arguments */
* See who is logged in...
*/
if ((user = getenv("REMOTE_USER")) == NULL)
user = "guest";
user = getenv("REMOTE_USER");
/*
* Connect to the HTTP server...
@@ -187,7 +177,7 @@ main(int argc, /* I - Number of command-line arguments */
void
show_all_classes(http_t *http, /* I - Connection to server */
const char *user) /* I - Username */
const char *user) /* I - Username */
{
int i; /* Looping var */
ipp_t *request, /* IPP request */
@@ -221,8 +211,9 @@ show_all_classes(http_t *http, /* I - Connection to server */
request = ippNewRequest(CUPS_GET_CLASSES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
if (user)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
cgiGetAttributes(request, "classes.tmpl");
@@ -419,7 +410,7 @@ show_class(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, pclass, sizeof(uri));
snprintf(refresh, sizeof(refresh), "10;/classes/%s", uri);
snprintf(refresh, sizeof(refresh), "10;URL=/classes/%s", uri);
cgiSetVariable("refresh_page", refresh);
}
+426 -78
Ver Arquivo
@@ -3,23 +3,14 @@
*
* On-line help index routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -28,13 +19,16 @@
* helpLoadIndex() - Load a help index from disk.
* helpSaveIndex() - Save a help index to disk.
* helpSearchIndex() - Search an index.
* help_add_word() - Add a word to a node.
* help_compile_search() - Convert a search string into a regular expression.
* help_delete_node() - Free all memory used by a node.
* help_delete_word() - Free all memory used by a word.
* help_load_directory() - Load a directory of files into an index.
* help_load_file() - Load a HTML files into an index.
* help_new_node() - Create a new node and add it to an index.
* help_sort_nodes_by_name() - Sort nodes by section, filename, and anchor.
* help_sort_nodes_by_score() - Sort nodes by score and text.
* help_sort_words() - Sort words alphabetically.
*/
/*
@@ -45,11 +39,118 @@
#include <cups/dir.h>
/*
* List of common English words that should not be indexed...
*/
static char help_common_words[][6] =
{
"about",
"all",
"an",
"and",
"are",
"as",
"at",
"be",
"been",
"but",
"by",
"call",
"can",
"come",
"could",
"day",
"did",
"do",
"down",
"each",
"find",
"first",
"for",
"from",
"go",
"had",
"has",
"have",
"he",
"her",
"him",
"his",
"hot",
"how",
"if",
"in",
"is",
"it",
"know",
"like",
"long",
"look",
"make",
"many",
"may",
"more",
"most",
"my",
"no",
"now",
"of",
"on",
"one",
"or",
"other",
"out",
"over",
"said",
"see",
"she",
"side",
"so",
"some",
"sound",
"than",
"that",
"the",
"their",
"them",
"then",
"there",
"these",
"they",
"thing",
"this",
"time",
"to",
"two",
"up",
"use",
"was",
"water",
"way",
"we",
"were",
"what",
"when",
"which",
"who",
"will",
"with",
"word",
"would",
"write",
"you",
"your"
};
/*
* Local functions...
*/
static help_word_t *help_add_word(help_node_t *n, const char *text);
static void help_delete_node(help_node_t *n);
static void help_delete_word(help_word_t *w);
static int help_load_directory(help_index_t *hi,
const char *directory,
const char *relative);
@@ -63,6 +164,7 @@ static help_node_t *help_new_node(const char *filename, const char *anchor,
size_t length);
static int help_sort_by_name(help_node_t *p1, help_node_t *p2);
static int help_sort_by_score(help_node_t *p1, help_node_t *p2);
static int help_sort_words(help_word_t *w1, help_word_t *w2);
/*
@@ -84,9 +186,6 @@ helpDeleteIndex(help_index_t *hi) /* I - Help index */
node;
node = (help_node_t *)cupsArrayNext(hi->nodes))
{
cupsArrayRemove(hi->nodes, node);
cupsArrayRemove(hi->sorted, node);
if (!hi->search)
help_delete_node(node);
}
@@ -157,6 +256,7 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
size_t length; /* Length in bytes */
int update; /* Update? */
help_node_t *node; /* Current node */
help_word_t *word; /* Current word */
DEBUG_printf(("helpLoadIndex(hifile=\"%s\", directory=\"%s\")\n",
@@ -192,12 +292,14 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
cupsFileLock(fp, 1);
if (cupsFileGets(fp, line, sizeof(line)) && !strcmp(line, "HELPV1"))
if (cupsFileGets(fp, line, sizeof(line)) && !strcmp(line, "HELPV2"))
{
/*
* Got a valid header line, now read the data lines...
*/
node = NULL;
while (cupsFileGets(fp, line, sizeof(line)))
{
/*
@@ -205,41 +307,80 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
*
* filename mtime offset length "section" "text"
* filename#anchor offset length "text"
* SP count word
*/
filename = line;
if ((ptr = strchr(line, ' ')) == NULL)
break;
while (isspace(*ptr & 255))
*ptr++ = '\0';
if ((anchor = strrchr(filename, '#')) != NULL)
{
*anchor++ = '\0';
mtime = 0;
}
else
mtime = strtol(ptr, &ptr, 10);
offset = strtoll(ptr, &ptr, 10);
length = strtoll(ptr, &ptr, 10);
while (isspace(*ptr & 255))
ptr ++;
if (!anchor)
if (line[0] == ' ')
{
/*
* Get section...
* Read a word in the current node...
*/
if (!node || (ptr = strrchr(line, ' ')) == NULL)
continue;
if ((word = help_add_word(node, ptr + 1)) != NULL)
word->count = atoi(line + 1);
}
else
{
/*
* Add a node...
*/
filename = line;
if ((ptr = strchr(line, ' ')) == NULL)
break;
while (isspace(*ptr & 255))
*ptr++ = '\0';
if ((anchor = strrchr(filename, '#')) != NULL)
{
*anchor++ = '\0';
mtime = 0;
}
else
mtime = strtol(ptr, &ptr, 10);
offset = strtoll(ptr, &ptr, 10);
length = strtoll(ptr, &ptr, 10);
while (isspace(*ptr & 255))
ptr ++;
if (!anchor)
{
/*
* Get section...
*/
if (*ptr != '\"')
break;
ptr ++;
sectptr = ptr;
while (*ptr && *ptr != '\"')
ptr ++;
if (*ptr != '\"')
break;
*ptr++ = '\0';
strlcpy(section, sectptr, sizeof(section));
while (isspace(*ptr & 255))
ptr ++;
}
if (*ptr != '\"')
break;
ptr ++;
sectptr = ptr;
text = ptr;
while (*ptr && *ptr != '\"')
ptr ++;
@@ -249,33 +390,14 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
*ptr++ = '\0';
strlcpy(section, sectptr, sizeof(section));
if ((node = help_new_node(filename, anchor, section, text,
mtime, offset, length)) == NULL)
break;
while (isspace(*ptr & 255))
ptr ++;
node->score = -1;
cupsArrayAdd(hi->nodes, node);
}
if (*ptr != '\"')
break;
ptr ++;
text = ptr;
while (*ptr && *ptr != '\"')
ptr ++;
if (*ptr != '\"')
break;
*ptr++ = '\0';
if ((node = help_new_node(filename, anchor, section, text,
mtime, offset, length)) == NULL)
break;
node->score = -1;
cupsArrayAdd(hi->nodes, node);
}
}
@@ -339,6 +461,7 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
{
cups_file_t *fp; /* Index file */
help_node_t *node; /* Current node */
help_word_t *word; /* Current word */
DEBUG_printf(("helpSaveIndex(hi=%p, hifile=\"%s\")\n", hi, hifile));
@@ -356,7 +479,7 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
cupsFileLock(fp, 1);
cupsFilePuts(fp, "HELPV1\n");
cupsFilePuts(fp, "HELPV2\n");
for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
node;
@@ -382,6 +505,16 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
node->section ? node->section : "", node->text) < 0)
break;
}
/*
* Then write the words associated with the node...
*/
for (word = (help_word_t *)cupsArrayFirst(node->words);
word;
word = (help_word_t *)cupsArrayNext(node->words))
if (cupsFilePrintf(fp, " %d %s\n", word->count, word->text) < 0)
break;
}
cupsFileFlush(fp);
@@ -407,6 +540,7 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
{
help_index_t *search; /* Search index */
help_node_t *node; /* Current node */
help_word_t *word; /* Current word */
void *sc; /* Search context */
int matches; /* Number of matches */
@@ -487,16 +621,27 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
continue;
else if (filename && strcmp(node->filename, filename))
continue;
else if ((matches = cgiDoSearch(sc, node->text)) > 0)
else
{
/*
* Found a match, add the node to the search index...
*/
matches = cgiDoSearch(sc, node->text);
node->score = matches;
for (word = (help_word_t *)cupsArrayFirst(node->words);
word;
word = (help_word_t *)cupsArrayNext(node->words))
if (cgiDoSearch(sc, word->text) > 0)
matches += word->count;
cupsArrayAdd(search->nodes, node);
cupsArrayAdd(search->sorted, node);
if (matches > 0)
{
/*
* Found a match, add the node to the search index...
*/
node->score = matches;
cupsArrayAdd(search->nodes, node);
cupsArrayAdd(search->sorted, node);
}
}
/*
@@ -513,6 +658,61 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
}
/*
* 'help_add_word()' - Add a word to a node.
*/
static help_word_t * /* O - New word */
help_add_word(help_node_t *n, /* I - Node */
const char *text) /* I - Word text */
{
help_word_t *w, /* New word */
key; /* Search key */
DEBUG_printf(("help_add_word(n=%p, text=\"%s\")\n", n, text));
/*
* Create the words array as needed...
*/
if (!n->words)
n->words = cupsArrayNew((cups_array_func_t)help_sort_words, NULL);
/*
* See if the word is already added...
*/
key.text = (char *)text;
if ((w = (help_word_t *)cupsArrayFind(n->words, &key)) == NULL)
{
/*
* Create a new word...
*/
if ((w = calloc(1, sizeof(help_word_t))) == NULL)
return (NULL);
if ((w->text = strdup(text)) == NULL)
{
free(w);
return (NULL);
}
cupsArrayAdd(n->words, w);
}
/*
* Bump the counter for this word and return it...
*/
w->count ++;
return (w);
}
/*
* 'help_delete_node()' - Free all memory used by a node.
*/
@@ -520,6 +720,9 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
static void
help_delete_node(help_node_t *n) /* I - Node */
{
help_word_t *w; /* Current word */
DEBUG_printf(("help_delete_node(n=%p)\n", n));
if (!n)
@@ -537,10 +740,36 @@ help_delete_node(help_node_t *n) /* I - Node */
if (n->text)
free(n->text);
for (w = (help_word_t *)cupsArrayFirst(n->words);
w;
w = (help_word_t *)cupsArrayNext(n->words))
help_delete_word(w);
cupsArrayDelete(n->words);
free(n);
}
/*
* 'help_delete_word()' - Free all memory used by a word.
*/
static void
help_delete_word(help_word_t *w) /* I - Word */
{
DEBUG_printf(("help_delete_word(w=%p)\n", w));
if (!w)
return;
if (w->text)
free(w->text);
free(w);
}
/*
* 'help_load_directory()' - Load a directory of files into an index.
*/
@@ -661,12 +890,15 @@ help_load_file(
cups_file_t *fp; /* HTML file */
help_node_t *node; /* Current node */
char line[1024], /* Line from file */
temp[1024], /* Temporary word */
section[1024], /* Section */
*ptr, /* Pointer into line */
*anchor, /* Anchor name */
*text; /* Text for anchor */
off_t offset; /* File offset */
char quote; /* Quote character */
help_word_t *word; /* Current word */
int wordlen; /* Length of word */
DEBUG_printf(("help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", mtime=%ld)\n",
@@ -818,6 +1050,17 @@ help_load_file(
if (node->text)
free(node->text);
if (node->words)
{
for (word = (help_word_t *)cupsArrayFirst(node->words);
word;
word = (help_word_t *)cupsArrayNext(node->words))
help_delete_word(word);
cupsArrayDelete(node->words);
node->words = NULL;
}
node->section = section[0] ? strdup(section) : NULL;
node->text = strdup(text);
node->mtime = mtime;
@@ -842,7 +1085,7 @@ help_load_file(
if (isspace(*ptr & 255))
{
while (isspace(*ptr & 255))
*ptr ++;
ptr ++;
*text++ = ' ';
}
@@ -861,9 +1104,99 @@ help_load_file(
*/
cupsArrayAdd(hi->nodes, node);
if (!anchor)
node = NULL;
break;
}
if (node)
{
/*
* Scan this line for words...
*/
for (ptr = line; *ptr; ptr ++)
{
/*
* Skip HTML stuff...
*/
if (*ptr == '<')
{
if (!strncmp(ptr, "<!--", 4))
{
/*
* Skip HTML comment...
*/
if ((text = strstr(ptr + 4, "-->")) == NULL)
ptr += strlen(ptr) - 1;
else
ptr = text + 2;
}
else
{
/*
* Skip HTML element...
*/
for (ptr ++; *ptr && *ptr != '>'; ptr ++)
{
if (*ptr == '\"' || *ptr == '\'')
{
for (quote = *ptr++; *ptr && *ptr != quote; ptr ++);
if (!*ptr)
ptr --;
}
}
if (!*ptr)
ptr --;
}
continue;
}
else if (*ptr == '&')
{
/*
* Skip HTML entity...
*/
for (ptr ++; *ptr && *ptr != ';'; ptr ++);
if (!*ptr)
ptr --;
continue;
}
else if (!isalnum(*ptr & 255))
continue;
/*
* Found the start of a word, search until we find the end...
*/
for (text = ptr, ptr ++; *ptr && isalnum(*ptr & 255); ptr ++);
wordlen = ptr - text;
memcpy(temp, text, wordlen);
temp[wordlen] = '\0';
ptr --;
if (wordlen > 1 && !bsearch(temp, help_common_words,
(sizeof(help_common_words) /
sizeof(help_common_words[0])),
sizeof(help_common_words[0]),
(int (*)(const void *, const void *))
strcasecmp))
help_add_word(node, temp);
}
}
/*
* Get the offset of the next line...
*/
@@ -978,6 +1311,21 @@ help_sort_by_score(help_node_t *n1, /* I - First node */
}
/*
* 'help_sort_words()' - Sort words alphabetically.
*/
static int /* O - Difference */
help_sort_words(help_word_t *w1, /* I - Second word */
help_word_t *w2) /* I - Second word */
{
DEBUG_printf(("help_sort_words(w1=%p(\"%s\"), w2=%p(\"%s\"))\n",
w1, w1->text, w2, w2->text));
return (strcasecmp(w1->text, w2->text));
}
/*
* End of "$Id$".
*/
+15 -17
Ver Arquivo
@@ -3,23 +3,14 @@
*
* On-line help index definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*/
#ifndef _CUPS_HELP_INDEX_H_
@@ -36,19 +27,26 @@
* Data structures...
*/
typedef struct /**** Help node structure... ****/
typedef struct help_word_s /**** Help word structure... ****/
{
int count; /* Number of occurrences */
char *text; /* Word text */
} help_word_t;
typedef struct help_node_s /**** Help node structure... ****/
{
char *filename; /* Filename, relative to help dir */
char *section; /* Section name (NULL if none) */
char *anchor; /* Anchor name (NULL if none) */
char *text; /* Text in anchor */
cups_array_t *words; /* Words after this node */
time_t mtime; /* Last modification time */
off_t offset; /* Offset in file */
size_t length; /* Length in bytes */
int score; /* Search score */
} help_node_t;
typedef struct /**** Help index structure ****/
typedef struct help_index_s /**** Help index structure ****/
{
int search; /* 1 = search index, 0 = normal */
cups_array_t *nodes; /* Nodes sorted by filename */
+7 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* On-line help CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -187,7 +178,8 @@ main(int argc, /* I - Number of command-line arguments */
topic = cgiGetVariable("TOPIC");
si = helpSearchIndex(hi, query, topic, helpfile);
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n", query, topic);
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n",
query ? query : "(null)", topic ? topic : "(null)");
if (si)
{
+7 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* HTML support functions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -175,7 +166,8 @@ cgi_null_passwd(const char *prompt) /* I - Prompt string (unused) */
{
(void)prompt;
fprintf(stderr, "DEBUG: cgi_null_passwd(prompt=\"%s\") called!\n", prompt);
fprintf(stderr, "DEBUG: cgi_null_passwd(prompt=\"%s\") called!\n",
prompt ? prompt : "(null)");
return (NULL);
}
+154 -22
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -110,6 +101,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
*/
num_attrs = 0;
attrs[0] = NULL; /* Eliminate compiler warning */
while ((ch = getc(in)) != EOF)
if (ch == '\\')
@@ -482,7 +474,7 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
{
cgiRewriteURL(job_printer_uri, resource, sizeof(resource), NULL);
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
@@ -598,7 +590,7 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
@@ -774,7 +766,7 @@ cgiSetIPPObjectVars(
fprintf(stderr, "DEBUG2: cgiSetIPPObjectVars(obj=%p, prefix=\"%s\", "
"element=%d)\n",
obj, prefix, element);
obj, prefix ? prefix : "(null)", element);
/*
* Set common CGI template variables...
@@ -827,6 +819,144 @@ cgiSetIPPObjectVars(
cgiSetArray("job_printer_name", element, valptr);
}
/*
* Localize event names in "notify_events" variable...
*/
if (!strcmp(name, "notify_events"))
{
size_t remaining; /* Remaining bytes in buffer */
value[0] = '\0';
valptr = value;
for (i = 0; i < attr->num_values; i ++)
{
if (valptr >= (value + sizeof(value) - 3))
break;
if (i)
{
*valptr++ = ',';
*valptr++ = ' ';
}
remaining = sizeof(value) - (valptr - value);
if (!strcmp(attr->values[i].string.text, "printer-stopped"))
strlcpy(valptr, _("Printer Stopped"), remaining);
else if (!strcmp(attr->values[i].string.text, "printer-added"))
strlcpy(valptr, _("Printer Added"), remaining);
else if (!strcmp(attr->values[i].string.text, "printer-modified"))
strlcpy(valptr, _("Printer Modified"), remaining);
else if (!strcmp(attr->values[i].string.text, "printer-deleted"))
strlcpy(valptr, _("Printer Deleted"), remaining);
else if (!strcmp(attr->values[i].string.text, "job-created"))
strlcpy(valptr, _("Job Created"), remaining);
else if (!strcmp(attr->values[i].string.text, "job-completed"))
strlcpy(valptr, _("Job Completed"), remaining);
else if (!strcmp(attr->values[i].string.text, "job-stopped"))
strlcpy(valptr, _("Job Stopped"), remaining);
else if (!strcmp(attr->values[i].string.text, "job-config-changed"))
strlcpy(valptr, _("Job Options Changed"), remaining);
else if (!strcmp(attr->values[i].string.text, "server-restarted"))
strlcpy(valptr, _("Server Restarted"), remaining);
else if (!strcmp(attr->values[i].string.text, "server-started"))
strlcpy(valptr, _("Server Started"), remaining);
else if (!strcmp(attr->values[i].string.text, "server-stopped"))
strlcpy(valptr, _("Server Stopped"), remaining);
else if (!strcmp(attr->values[i].string.text, "server-audit"))
strlcpy(valptr, _("Server Security Auditing"), remaining);
else
strlcpy(valptr, attr->values[i].string.text, remaining);
valptr += strlen(valptr);
}
cgiSetArray("notify_events", element, value);
continue;
}
/*
* Add "notify_printer_name" variable if we have a "notify_printer_uri"
* attribute...
*/
if (!strcmp(name, "notify_printer_uri"))
{
if ((valptr = strrchr(attr->values[0].string.text, '/')) == NULL)
valptr = "unknown";
else
valptr ++;
cgiSetArray("notify_printer_name", element, valptr);
}
/*
* Add "notify_recipient_name" variable if we have a "notify_recipient_uri"
* attribute, and rewrite recipient URI...
*/
if (!strcmp(name, "notify_recipient_uri"))
{
char uri[1024], /* New URI */
scheme[32], /* Scheme portion of URI */
userpass[256], /* Username/password portion of URI */
host[1024], /* Hostname portion of URI */
resource[1024], /* Resource portion of URI */
*options; /* Options in URI */
int port; /* Port number */
httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[0].string.text,
scheme, sizeof(scheme), userpass, sizeof(userpass),
host, sizeof(host), &port, resource, sizeof(resource));
if (!strcmp(scheme, "rss"))
{
/*
* RSS notification...
*/
if ((options = strchr(resource, '?')) != NULL)
*options = '\0';
if (host[0])
{
/*
* Link to remote feed...
*/
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri), "http",
userpass, host, port, resource);
strlcpy(name, uri, sizeof(name));
}
else
{
/*
* Link to local feed...
*/
snprintf(uri, sizeof(uri), "/rss%s", resource);
strlcpy(name, resource + 1, sizeof(name));
}
}
else
{
/*
* Other...
*/
strlcpy(uri, attr->values[0].string.text, sizeof(uri));
strlcpy(name, resource, sizeof(name));
}
cgiSetArray("notify_recipient_uri", element, uri);
cgiSetArray("notify_recipient_name", element, name);
continue;
}
/*
* Add "admin_uri" variable if we have a "printer_uri_supported"
* attribute...
@@ -913,7 +1043,7 @@ cgiSetIPPObjectVars(
snprintf(valptr, sizeof(value) - (valptr - value),
"<A HREF=\"%s\">%s</A>", url,
strrchr(url, '/') + 1);
strrchr(attr->values[i].string.text, '/') + 1);
}
else
cgiRewriteURL(attr->values[i].string.text, valptr,
@@ -977,7 +1107,9 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */
fprintf(stderr, "DEBUG2: cgiSetIPPVars(response=%p, filter_name=\"%s\", "
"filter_value=\"%s\", prefix=\"%s\", parent_el=%d)\n",
response, filter_name, filter_value, prefix, parent_el);
response, filter_name ? filter_name : "(null)",
filter_value ? filter_value : "(null)",
prefix ? prefix : "(null)", parent_el);
/*
* Set common CGI template variables...
@@ -1035,9 +1167,9 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */
attr = cgiSetIPPObjectVars(attr, prefix, element);
}
fprintf(stderr, "DEBUG2: Returing %d from cgiSetIPPVars()...\n", element + 1);
fprintf(stderr, "DEBUG2: Returing %d from cgiSetIPPVars()...\n", element);
return (element + 1);
return (element);
}
+19 -14
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Job status CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -181,6 +172,20 @@ do_job_op(http_t *http, /* I - HTTP connection */
ippDelete(cupsDoRequest(http, request, "/jobs"));
if (cupsLastError() <= IPP_OK_CONFLICT && getenv("HTTP_REFERER"))
{
/*
* Redirect successful updates back to the parent page...
*/
char url[1024]; /* Encoded URL */
strcpy(url, "5;URL=");
cgiFormEncode(url + 6, getenv("HTTP_REFERER"), sizeof(url) - 6);
cgiSetVariable("refresh_page", url);
}
cgiStartHTML(cgiText(_("Jobs")));
if (cupsLastError() > IPP_OK_CONFLICT)
+13 -22
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Printer status CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -98,8 +89,7 @@ main(int argc, /* I - Number of command-line arguments */
* See who is logged in...
*/
if ((user = getenv("REMOTE_USER")) == NULL)
user = "guest";
user = getenv("REMOTE_USER");
/*
* Connect to the HTTP server...
@@ -287,7 +277,7 @@ print_command(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
@@ -331,7 +321,7 @@ show_all_printers(http_t *http, /* I - Connection to server */
fprintf(stderr, "DEBUG: show_all_printers(http=%p, user=\"%s\")\n",
http, user);
http, user ? user : "(null)");
/*
* Show the standard header...
@@ -357,8 +347,9 @@ show_all_printers(http_t *http, /* I - Connection to server */
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM,
"printer-type-mask", CUPS_PRINTER_CLASS);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
if (user)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
cgiGetAttributes(request, "printers.tmpl");
@@ -543,7 +534,7 @@ show_printer(http_t *http, /* I - Connection to server */
fprintf(stderr, "DEBUG: show_printer(http=%p, printer=\"%s\")\n",
http, printer);
http, printer ? printer : "(null)");
/*
* Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following
@@ -594,7 +585,7 @@ show_printer(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, printer, sizeof(uri));
snprintf(refresh, sizeof(refresh), "10;/printers/%s", uri);
snprintf(refresh, sizeof(refresh), "10;URL=/printers/%s", uri);
cgiSetVariable("refresh_page", refresh);
}
+8 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Search routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2005 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -225,6 +216,8 @@ cgiCompileSearch(const char *query) /* I - Query string */
*sptr++ = *qptr++;
}
*sptr = '\0';
/*
* For "word1 AND word2", add reciprocal "word2 AND word1"...
*/
+61 -36
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI template function.
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -44,6 +35,7 @@
static void cgi_copy(FILE *out, FILE *in, int element, char term,
int indent);
static void cgi_puts(const char *s, FILE *out);
static void cgi_puturi(const char *s, FILE *out);
/*
@@ -58,8 +50,8 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
FILE *in; /* Input file */
fprintf(stderr, "DEBUG: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
tmpl);
fprintf(stderr, "DEBUG2: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
tmpl ? tmpl : "(null)");
/*
* Open the template file...
@@ -68,7 +60,7 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
if ((in = fopen(tmpl, "r")) == NULL)
{
fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
tmpl, strerror(errno));
tmpl ? tmpl : "(null)", strerror(errno));
return;
}
@@ -101,7 +93,8 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
FILE *in; /* Input file */
fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n", tmpl);
fprintf(stderr, "DEBUG2: cgiCopyTemplateLang(tmpl=\"%s\")\n",
tmpl ? tmpl : "(null)");
/*
* Convert the language to a locale name...
@@ -110,7 +103,7 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
if ((lang = getenv("LANG")) != NULL)
{
for (i = 0; lang[i] && i < 15; i ++)
if (isalnum(lang[i] & 255))
if (isalnum(lang[i] & 255) || lang[i] == '_')
locale[i] = tolower(lang[i]);
else if (lang[i] == '-')
locale[i] = '_';
@@ -122,7 +115,7 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
else
locale[0] = '\0';
fprintf(stderr, "DEBUG: locale=\"%s\"...\n", locale);
fprintf(stderr, "DEBUG2: locale=\"%s\"...\n", locale);
/*
* See if we have a template file for this language...
@@ -140,7 +133,7 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
snprintf(filename, sizeof(filename), "%s/%s", directory, tmpl);
}
fprintf(stderr, "DEBUG: Template file is \"%s\"...\n", filename);
fprintf(stderr, "DEBUG2: Template file is \"%s\"...\n", filename);
/*
* Open the template file...
@@ -235,9 +228,10 @@ cgi_copy(FILE *out, /* I - Output file */
char outval[1024], /* Formatted output string */
compare[1024]; /* Comparison string */
int result; /* Result of comparison */
int uriencode; /* Encode as URI */
fprintf(stderr, "DEBUG: %*sStarting at file position %ld...\n", indent, "",
fprintf(stderr, "DEBUG2: %*sStarting at file position %ld...\n", indent, "",
ftell(in));
/*
@@ -253,9 +247,13 @@ cgi_copy(FILE *out, /* I - Output file */
* Get a variable name...
*/
uriencode = 0;
for (s = name; (ch = getc(in)) != EOF;)
if (strchr("}]<>=! \t\n", ch))
break;
else if (s == name && ch == '%')
uriencode = 1;
else if (s > name && ch == '?')
break;
else if (s < (name + sizeof(name) - 1))
@@ -265,7 +263,7 @@ cgi_copy(FILE *out, /* I - Output file */
if (s == name && isspace(ch & 255))
{
fprintf(stderr, "DEBUG: %*sLone { at %ld...\n", indent, "", ftell(in));
fprintf(stderr, "DEBUG2: %*sLone { at %ld...\n", indent, "", ftell(in));
if (out)
{
@@ -277,7 +275,7 @@ cgi_copy(FILE *out, /* I - Output file */
}
if (ch == '}')
fprintf(stderr, "DEBUG: %*s\"{%s}\" at %ld...\n", indent, "", name,
fprintf(stderr, "DEBUG2: %*s\"{%s}\" at %ld...\n", indent, "", name,
ftell(in));
/*
@@ -341,7 +339,7 @@ cgi_copy(FILE *out, /* I - Output file */
pos = ftell(in);
fprintf(stderr, "DEBUG: %*sLooping on \"%s\" at %ld, count=%d...\n",
fprintf(stderr, "DEBUG2: %*sLooping on \"%s\" at %ld, count=%d...\n",
indent, "", name + 1, pos, count);
if (count > 0)
@@ -357,7 +355,7 @@ cgi_copy(FILE *out, /* I - Output file */
else
cgi_copy(NULL, in, 0, '}', indent + 2);
fprintf(stderr, "DEBUG: %*sFinished looping on \"%s\"...\n", indent,
fprintf(stderr, "DEBUG2: %*sFinished looping on \"%s\"...\n", indent,
"", name + 1);
continue;
@@ -399,7 +397,14 @@ cgi_copy(FILE *out, /* I - Output file */
*/
if (out)
cgi_puts(outptr, out);
{
if (uriencode)
cgi_puturi(outptr, out);
else if (!strcasecmp(name, "?cupsdconf_default"))
fputs(outptr, stdout);
else
cgi_puts(outptr, out);
}
continue;
}
@@ -488,7 +493,7 @@ cgi_copy(FILE *out, /* I - Output file */
if (ch != '?')
{
fprintf(stderr,
"DEBUG: %*sBad terminator '%c' at file position %ld...\n",
"DEBUG2: %*sBad terminator '%c' at file position %ld...\n",
indent, "", ch, ftell(in));
return;
}
@@ -518,7 +523,7 @@ cgi_copy(FILE *out, /* I - Output file */
}
fprintf(stderr,
"DEBUG: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
"DEBUG2: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
indent, "", name, op, compare, ftell(in), result);
if (result)
@@ -527,10 +532,10 @@ cgi_copy(FILE *out, /* I - Output file */
* Comparison true; output first part and ignore second...
*/
fprintf(stderr, "DEBUG: %*sOutput first part...\n", indent, "");
fprintf(stderr, "DEBUG2: %*sOutput first part...\n", indent, "");
cgi_copy(out, in, element, ':', indent + 2);
fprintf(stderr, "DEBUG: %*sSkip second part...\n", indent, "");
fprintf(stderr, "DEBUG2: %*sSkip second part...\n", indent, "");
cgi_copy(NULL, in, element, '}', indent + 2);
}
else
@@ -539,14 +544,14 @@ cgi_copy(FILE *out, /* I - Output file */
* Comparison false; ignore first part and output second...
*/
fprintf(stderr, "DEBUG: %*sSkip first part...\n", indent, "");
fprintf(stderr, "DEBUG2: %*sSkip first part...\n", indent, "");
cgi_copy(NULL, in, element, ':', indent + 2);
fprintf(stderr, "DEBUG: %*sOutput second part...\n", indent, "");
fprintf(stderr, "DEBUG2: %*sOutput second part...\n", indent, "");
cgi_copy(out, in, element, '}', indent + 2);
}
fprintf(stderr, "DEBUG: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
fprintf(stderr, "DEBUG2: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
name, op, compare, out);
}
else if (ch == '\\') /* Quoted char */
@@ -560,11 +565,11 @@ cgi_copy(FILE *out, /* I - Output file */
putc(ch, out);
if (ch == EOF)
fprintf(stderr, "DEBUG: %*sReturning at file position %ld on EOF...\n",
fprintf(stderr, "DEBUG2: %*sReturning at file position %ld on EOF...\n",
indent, "", ftell(in));
else
fprintf(stderr,
"DEBUG: %*sReturning at file position %ld on character '%c'...\n",
"DEBUG2: %*sReturning at file position %ld on character '%c'...\n",
indent, "", ftell(in), ch);
if (ch == EOF && term)
@@ -637,6 +642,26 @@ cgi_puts(const char *s, /* I - String to output */
}
/*
* 'cgi_puturi()' - Put a URI string to the output file, quoting as needed...
*/
static void
cgi_puturi(const char *s, /* I - String to output */
FILE *out) /* I - Output file */
{
while (*s)
{
if (strchr("%&+ <>#=", *s) || *s & 128)
fprintf(out, "%%%02X", *s & 255);
else
putc(*s, out);
s ++;
}
}
/*
* End of "$Id$".
*/
+5 -14
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI test program for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
+12 -17
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Help index test program for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2005 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -105,11 +96,15 @@ list_nodes(const char *title, /* I - Title string */
for (i = 1, node = (help_node_t *)cupsArrayFirst(nodes);
node;
i ++, node = (help_node_t *)cupsArrayNext(nodes))
{
if (node->anchor)
printf(" %d: %s#%s \"%s\"\n", i, node->filename, node->anchor,
printf(" %d: %s#%s \"%s\"", i, node->filename, node->anchor,
node->text);
else
printf(" %d: %s \"%s\"\n", i, node->filename, node->text);
printf(" %d: %s \"%s\"", i, node->filename, node->text);
printf(" (%d words)\n", cupsArrayCount(node->words));
}
}
+3 -1
Ver Arquivo
@@ -12,13 +12,15 @@ up to 1024 bytes in length.</P>
<H1><A NAME="FIRST">This is the First Anchor</A></H1>
<P>This is some text for the first anchor.</P>
<P>This&nbsp;is some text for the <em>first</em> anchor.</P>
<H1><A NAME="2ND">This is the Second Anchor</A></H1>
<P>This is some text for the first anchor.</P>
<P>John asked Mary to the dance.</P>
<H1><A NAME="THIRD">This is the Third Anchor</A></H1>
+5 -14
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI template test program for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
+13 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI form variable and array functions.
*
* Copyright 2007 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* Contents:
*
@@ -239,6 +230,12 @@ cgiInitialize(void)
cupsSetPasswordCB(cgi_passwd);
/*
* Set the locale so that times, etc. are formatted properly...
*/
setlocale(LC_ALL, "");
#ifdef DEBUG
/*
* Disable output buffering to find bugs...
@@ -943,7 +940,8 @@ cgi_passwd(const char *prompt) /* I - Prompt (not used) */
{
(void)prompt;
fprintf(stderr, "DEBUG: cgi_passwd(prompt=\"%s\") called!\n", prompt);
fprintf(stderr, "DEBUG: cgi_passwd(prompt=\"%s\") called!\n",
prompt ? prompt : "(null)");
/*
* Send a 401 (unauthorized) status to the server, so it can notify
+7 -17
Ver Arquivo
@@ -3,23 +3,14 @@
#
# Configuration file makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 2007 by Apple Inc.
# Copyright 1993-2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
include ../Makedefs
@@ -28,7 +19,7 @@ include ../Makedefs
# Config files...
#
KEEP = cupsd.conf
KEEP = cupsd.conf snmp.conf
REPLACE = mime.convs mime.types
@@ -74,8 +65,7 @@ install: all
if test -r $(SERVERROOT)/$$file ; then \
$(MV) $(SERVERROOT)/$$file $(SERVERROOT)/$$file.O ; \
fi ; \
$(INSTALL_CONFIG) $$file $(SERVERROOT) ; \
chgrp $(CUPS_GROUP) $(SERVERROOT)/$$file || true; \
$(INSTALL_DATA) $$file $(SERVERROOT) ; \
done
-if test x$(PAMDIR) != x; then \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(PAMDIR); \
+16 -7
Ver Arquivo
@@ -12,6 +12,7 @@ LogLevel info
# Administrator user group...
SystemGroup @CUPS_SYSTEM_GROUPS@
@CUPS_SYSTEM_AUTHKEY@
# Only listen for connections from the local machine.
Listen localhost:@DEFAULT_IPP_PORT@
@@ -20,7 +21,7 @@ Listen localhost:@DEFAULT_IPP_PORT@
# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow @LOCAL
BrowseAllow all
# Default authentication type, when authentication is required...
DefaultAuthType Basic
@@ -33,13 +34,14 @@ DefaultAuthType Basic
# Restrict access to the admin pages...
<Location /admin>
@ENCRYPTION_REQUIRED@
Order allow,deny
Allow localhost
</Location>
# Restrict access to configuration files...
<Location /admin/conf>
AuthType Basic
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow localhost
@@ -47,22 +49,29 @@ DefaultAuthType Basic
# Set the default printer/job policies...
<Policy default>
# Job-related operations must be done by the owner or an adminstrator...
# Job-related operations must be done by the owner or an administrator...
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>
# All administration operations require an adminstrator to authenticate...
<Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>
AuthType Basic
# All administration operations require an administrator to authenticate...
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# All printer operations require a printer operator to authenticate...
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
AuthType Default
Require user @CUPS_DEFAULT_PRINTADMIN_AUTH@
Order deny,allow
</Limit>
# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
Require user @OWNER @SYSTEM
Require user @OWNER @CUPS_DEFAULT_PRINTADMIN_AUTH@
Order deny,allow
</Limit>
+15 -21
Ver Arquivo
@@ -1,25 +1,20 @@
#
# "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $"
# "$Id$"
#
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
# reflects your local configuration changes.
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2005 by Easy Software Products.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
########################################################################
@@ -107,13 +102,12 @@ image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
#
# Raw filter...
#
# Uncomment the following filter and the application/octet-stream type
# in mime.types to allow printing of arbitrary files without the -oraw
# option.
# Uncomment the following filter to allow printing of arbitrary files
# without the -oraw option.
#
#application/octet-stream application/vnd.cups-raw 0 -
@DEFAULT_RAW_PRINTING@application/octet-stream application/vnd.cups-raw 0 -
#
# End of "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $".
# End of "$Id$".
#
+37 -31
Ver Arquivo
@@ -1,25 +1,20 @@
#
# "$Id: mime.types 4590 2005-08-24 19:25:49Z mike $"
# "$Id: mime.types 6649 2007-07-11 21:46:42Z mike $"
#
# MIME types file for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2005 by Easy Software Products.
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
# VERSIONS OF CUPS. Instead, create a "local.types" file that
# reflects your local configuration changes.
#
# Copyright 2007 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
########################################################################
@@ -74,18 +69,20 @@
application/pdf pdf string(0,%PDF)
application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
contains(0,128,<1B>%-12345X) + \
(contains(0,1024,"LANGUAGE=POSTSCRIPT") \
contains(0,1024,"LANGUAGE = Postscript") \
contains(0,1024,"LANGUAGE = PostScript") \
contains(0,1024,"LANGUAGE = POSTSCRIPT"))
application/vnd.hp-HPGL hpgl string(0,<1B>&)\
(contains(0,4096,"LANGUAGE=POSTSCRIPT") \
contains(0,4096,"LANGUAGE = Postscript") \
contains(0,4096,"LANGUAGE = PostScript") \
contains(0,4096,"LANGUAGE = POSTSCRIPT") \
(contains(0,4096,<0a>%!) + \
!contains(0,4096,"ENTER LANGUAGE")))
application/vnd.hp-HPGL hpgl \
string(0,<1B>E<1B>%0B) \
string(0,<1B>%-1B) string(0,<201B>)\
string(0,BP;) string(0,IN;) string(0,DF;) \
string(0,BPINPS;) \
(contains(0,128,<1B>%-12345X) + \
(contains(0,1024,"LANGUAGE=HPGL") \
contains(0,1024,"LANGUAGE = HPGL")))
(contains(0,4096,"LANGUAGE=HPGL") \
contains(0,4096,"LANGUAGE = HPGL")))
########################################################################
#
@@ -99,7 +96,7 @@ image/jpeg jpeg jpg jpe string(0,<FFD8FF>) &&\
char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\
char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\
char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef))
image/tiff tiff tif string(0,MM) string(0,II)
image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
image/x-photocd pcd string(2048,PCD_IPI)
image/x-portable-anymap pnm
image/x-portable-bitmap pbm string(0,P1) string(0,P4)
@@ -138,6 +135,15 @@ text/html html htm printable(0,1024) +\
text/plain txt printable(0,1024)
text/css css
########################################################################
#
# RSS feed type...
#
application/rss+xml rss
########################################################################
#
# CUPS-specific types...
@@ -145,25 +151,25 @@ text/css css
application/vnd.cups-command string(0,'#CUPS-COMMAND')
application/vnd.cups-form string(0,"<CUPSFORM>")
application/vnd.cups-pdf
application/vnd.cups-postscript
application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
string(0,<1B>@) \
(contains(0,128,<1B>%-12345X) + \
(contains(0,1024,"LANGUAGE=PCL") \
contains(0,1024,"LANGUAGE = PCL")))
(contains(0,4096,"LANGUAGE=PCL") \
contains(0,4096,"LANGUAGE = PCL")))
########################################################################
#
# Raw print file support...
#
# Uncomment the following type and the application/octet-stream
# filter line in mime.convs to allow raw file printing without the
# -oraw option.
# Comment the following type to prevent raw file printing.
#
#application/octet-stream
application/octet-stream
#
# End of "$Id: mime.types 4590 2005-08-24 19:25:49Z mike $".
# End of "$Id: mime.types 6649 2007-07-11 21:46:42Z mike $".
#
+13
Ver Arquivo
@@ -0,0 +1,13 @@
#
# "$Id$"
#
# Sample SNMP configuration file for CUPS. See "man smnp.conf" for a
# complete description of this file.
#
@CUPS_SNMP_ADDRESS@
@CUPS_SNMP_COMMUNITY@
#
# End of "$Id$".
#
+140
Ver Arquivo
@@ -0,0 +1,140 @@
dnl
dnl "$Id$"
dnl
dnl 32/64-bit library support stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Setup support for separate 32/64-bit library generation...
AC_ARG_ENABLE(32bit, [ --enable-32bit generate 32-bit libraries on 32/64-bit systems, default=no])
INSTALL32=""
LIB32CUPS=""
LIB32CUPSIMAGE=""
LIB32DIR=""
UNINSTALL32=""
AC_SUBST(INSTALL32)
AC_SUBST(LIB32CUPS)
AC_SUBST(LIB32CUPSIMAGE)
AC_SUBST(LIB32DIR)
AC_SUBST(UNINSTALL32)
AC_ARG_ENABLE(64bit, [ --enable-64bit generate 64-bit libraries on 32/64-bit systems, default=no])
INSTALL64=""
LIB64CUPS=""
LIB64CUPSIMAGE=""
LIB64DIR=""
UNINSTALL64=""
AC_SUBST(INSTALL64)
AC_SUBST(LIB64CUPS)
AC_SUBST(LIB64CUPSIMAGE)
AC_SUBST(LIB64DIR)
AC_SUBST(UNINSTALL64)
case "$uname" in
HP-UX*)
if test "x$enable_32bit" = xyes; then
# Build 32-bit libraries, 64-bit base...
INSTALL32="install32bit"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$exec_prefix/lib"
if test -d /usr/lib/hpux32; then
LIB32DIR="${LIB32DIR}/hpux32"
fi
UNINSTALL32="uninstall32bit"
fi
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries, 32-bit base...
INSTALL64="install64bit"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$exec_prefix/lib"
if test -d /usr/lib/hpux64; then
LIB64DIR="${LIB64DIR}/hpux64"
fi
UNINSTALL64="uninstall64bit"
fi
;;
IRIX)
if test "x$enable_32bit" = xyes; then
INSTALL32="install32bit"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$prefix/lib32"
UNINSTALL32="uninstall32bit"
fi
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries, 32-bit base...
INSTALL64="install64bit"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$prefix/lib64"
UNINSTALL64="uninstall64bit"
fi
;;
Linux*)
if test "x$enable_32bit" = xyes; then
# Build 32-bit libraries, 64-bit base...
INSTALL32="install32bit"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$exec_prefix/lib"
if test -d /usr/lib32; then
LIB32DIR="${LIB32DIR}32"
fi
UNINSTALL32="uninstall32bit"
fi
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries, 32-bit base...
INSTALL64="install64bit"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$exec_prefix/lib"
if test -d /usr/lib64; then
LIB64DIR="${LIB64DIR}64"
fi
UNINSTALL64="uninstall64bit"
fi
;;
SunOS*)
if test "x$enable_32bit" = xyes; then
# Build 32-bit libraries, 64-bit base...
INSTALL32="install32bit"
LIB32CUPS="32bit/libcups.so.2"
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
LIB32DIR="$exec_prefix/lib/32"
UNINSTALL32="uninstall32bit"
fi
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries, 32-bit base...
INSTALL64="install64bit"
LIB64CUPS="64bit/libcups.so.2"
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
LIB64DIR="$exec_prefix/lib/64"
UNINSTALL64="uninstall64bit"
fi
;;
esac
dnl
dnl End of "$Id$".
dnl
+54 -32
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-common.m4 5229 2006-03-05 16:48:12Z mike $"
dnl "$Id: cups-common.m4 6749 2007-07-31 00:00:21Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl We need at least autoconf 2.50...
@@ -29,11 +20,11 @@ dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Versio number information...
CUPS_VERSION="1.2svn"
CUPS_VERSION="1.3rc2"
CUPS_REVISION=""
if test -z "$CUPS_REVISION" -a -d .svn; then
CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
fi
#if test -z "$CUPS_REVISION" -a -d .svn; then
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
#fi
AC_SUBST(CUPS_VERSION)
AC_SUBST(CUPS_REVISION)
@@ -63,7 +54,7 @@ AC_PATH_PROG(LD,ld)
AC_PATH_PROG(LN,ln)
AC_PATH_PROG(MV,mv)
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(RM,rmdir)
AC_PATH_PROG(RMDIR,rmdir)
AC_PATH_PROG(SED,sed)
AC_PATH_PROG(STRIP,strip)
@@ -79,9 +70,10 @@ fi
dnl Static library option...
INSTALLSTATIC=""
AC_ARG_ENABLE(install_static, [ --enable-static install static libraries, default=no])
AC_ARG_ENABLE(static, [ --enable-static install static libraries, default=no])
if test x$enable_install_static = xyes; then
if test x$enable_static = xyes; then
echo Installing static libraries...
INSTALLSTATIC="installstatic"
fi
@@ -131,6 +123,8 @@ AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
AC_CHECK_HEADER(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
dnl Checks for string functions.
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
@@ -163,8 +157,7 @@ esac
AC_CHECK_FUNCS(sigaction)
dnl Checks for wait functions.
AC_CHECK_FUNCS(waitpid)
AC_CHECK_FUNCS(wait3)
AC_CHECK_FUNCS(waitpid wait3)
dnl See if the tm structure has the tm_gmtoff member...
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
@@ -174,6 +167,9 @@ AC_TRY_COMPILE([#include <time.h>],[struct tm t;
AC_DEFINE(HAVE_TM_GMTOFF),
AC_MSG_RESULT(no))
dnl See if we have the removefile(3) function for securely removing files
AC_CHECK_FUNCS(removefile)
dnl Flags for "ar" command...
case $uname in
Darwin* | *BSD*)
@@ -190,13 +186,22 @@ dnl Extra platform-specific libraries...
BACKLIBS=""
CUPSDLIBS=""
DBUSDIR=""
CUPS_DEFAULT_PRINTADMIN_AUTH="@SYSTEM"
CUPS_SYSTEM_AUTHKEY=""
AC_ARG_ENABLE(dbus, [ --enable-dbus enable DBUS support, default=auto])
FONTS="fonts"
AC_SUBST(FONTS)
LEGACY_BACKENDS="parallel scsi"
AC_SUBST(LEGACY_BACKENDS)
case $uname in
Darwin*)
FONTS=""
LEGACY_BACKENDS=""
BACKLIBS="-framework IOKit"
CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
CUPSDLIBS="-sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration"
LIBS="-framework CoreFoundation $LIBS"
dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
@@ -213,13 +218,24 @@ case $uname in
AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
dnl Check for the new membership functions in MacOSX 10.4...
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
AC_CHECK_FUNCS(mbr_uid_to_uuid)
dnl Need <dlfcn.h> header...
AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H))
dnl Check for notify_post support
AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
AC_CHECK_FUNCS(notify_post)
dnl Check for Authorization Services support
AC_CHECK_HEADER(Security/Authorization.h, [
AC_DEFINE(HAVE_AUTHORIZATION_H)
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"])
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
;;
Linux*)
@@ -230,12 +246,14 @@ case $uname in
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ], dbusdir="$withval", dbusdir="/etc/dbus-1")
DBUSDIR="$dbusdir"
AC_CHECK_LIB(dbus-1,
dbus_message_iter_init_append,
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
DBUSDIR="/etc/dbus-1/system.d")
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
else
AC_MSG_RESULT(no)
fi
@@ -244,6 +262,10 @@ case $uname in
;;
esac
AC_SUBST(CUPS_DEFAULT_PRINTADMIN_AUTH)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTADMIN_AUTH, "$CUPS_DEFAULT_PRINTADMIN_AUTH")
AC_SUBST(CUPS_SYSTEM_AUTHKEY)
dnl See if we have POSIX ACL support...
SAVELIBS="$LIBS"
LIBS=""
@@ -264,5 +286,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
dnl
dnl End of "$Id: cups-common.m4 5229 2006-03-05 16:48:12Z mike $".
dnl End of "$Id: cups-common.m4 6749 2007-07-31 00:00:21Z mike $".
dnl
+296 -155
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-compiler.m4 5274 2006-03-10 20:57:09Z mike $"
dnl "$Id: cups-compiler.m4 6698 2007-07-20 14:15:44Z mike $"
dnl
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Clear the debugging and non-shared library options unless the user asks
@@ -28,53 +19,76 @@ OPTIM=""
AC_SUBST(OPTIM)
AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ])
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
[if test x$enable_debug = xyes; then
OPTIM="-g"
fi])
dnl Setup general architecture flags...
AC_ARG_WITH(archflags, [ --with-archflags="flags"
set default architecture flags ])
if test -z "$with_archflags"; then
ARCHFLAGS=""
LDARCHFLAGS=""
else
ARCHFLAGS="$with_archflags"
if test "$uname" = Darwin; then
# Only link 32-bit programs - 64-bit is for the shared
# libraries...
LDARCHFLAGS="`echo $ARCHFLAGS | sed -e '1,$s/-arch x86_64//' -e '1,$s/-arch ppc64//'`"
else
LDARCHFLAGS="$ARCHFLAGS"
fi
fi
AC_SUBST(ARCHFLAGS)
AC_SUBST(LDARCHFLAGS)
dnl Setup support for separate 32/64-bit library generation...
AC_ARG_ENABLE(32bit, [ --enable-32bit generate 32-bit libraries on 32/64-bit systems, default=no])
AC_ARG_WITH(arch32flags, [ --with-arch32flags="flags"
specifies 32-bit architecture flags])
ARCH32FLAGS=""
AC_SUBST(ARCH32FLAGS)
C32FLAGS=""
INSTALL32=""
LIB32CUPS=""
LIB32CUPSIMAGE=""
LIB32DIR=""
UNINSTALL32=""
AC_ARG_WITH(arch64flags, [ --with-arch64flags="flags"
specifies 64-bit architecture flags])
ARCH64FLAGS=""
AC_SUBST(ARCH64FLAGS)
AC_SUBST(C32FLAGS)
AC_SUBST(INSTALL32)
AC_SUBST(LIB32CUPS)
AC_SUBST(LIB32CUPSIMAGE)
AC_SUBST(LIB32DIR)
AC_SUBST(UNINSTALL32)
dnl Position-Independent Executable support on Linux...
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fPIE option, default=no])
AC_ARG_ENABLE(64bit, [ --enable-64bit generate 64-bit libraries on 32/64-bit systems, default=no])
C64FLAGS=""
INSTALL64=""
LIB64CUPS=""
LIB64CUPSIMAGE=""
LIB64DIR=""
UNINSTALL64=""
AC_SUBST(C64FLAGS)
AC_SUBST(INSTALL64)
AC_SUBST(LIB64CUPS)
AC_SUBST(LIB64CUPSIMAGE)
AC_SUBST(LIB64DIR)
AC_SUBST(UNINSTALL64)
dnl Position-Independent Executable support on Linux and *BSD...
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fpie option, default=no])
dnl Read-only data/program support on Linux...
AC_ARG_ENABLE(relro, [ --enable-relro use GCC relro option, default=no])
dnl Update compiler options...
CXXLIBS=""
AC_SUBST(CXXLIBS)
PIEFLAGS=""
AC_SUBST(PIEFLAGS)
RELROFLAGS=""
AC_SUBST(RELROFLAGS)
LIBCUPSORDER="libcups.order"
AC_ARG_WITH(libcupsorder, [ --with-libcupsorder libcups secorder file, default=libcups.order],
if test -f "$withval"; then
LIBCUPSORDER="$withval"
fi)
AC_SUBST(LIBCUPSORDER)
LIBCUPSIMAGEORDER="libcupsimage.order"
AC_ARG_WITH(libcupsimageorder, [ --with-libcupsimagesorder
libcupsimage secorder file, default=libcupsimage.order],
if test -f "$withval"; then
LIBCUPSIMAGEORDER="$withval"
fi)
AC_SUBST(LIBCUPSIMAGEORDER)
if test -n "$GCC"; then
# Add GCC-specific compiler options...
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
# Default to optimize-for-size and debug
@@ -89,20 +103,19 @@ if test -n "$GCC"; then
fi
case $uname in
Darwin*)
if test "x$with_optim" = x; then
if test "x`uname -m`" = xi386; then
# Build universal binaries for OSX on Intel...
OPTIM="-arch i386 -arch ppc $OPTIM"
DSOFLAGS="-arch i386 -arch ppc $DSOFLAGS"
fi
Linux*)
if test x$enable_pie = xyes; then
PIEFLAGS="-pie -fPIE"
fi
if test x$enable_relro = xyes; then
RELROFLAGS="-Wl,-z,relro"
fi
;;
Linux*)
*)
if test x$enable_pie = xyes; then
OPTIM="$OPTIM -fpie"
LDFLAGS="$LDFLAGS -pie"
echo "Sorry, --enable-pie is not supported on this OS!"
fi
;;
esac
@@ -115,71 +128,152 @@ if test -n "$GCC"; then
fi
case "$uname" in
IRIX)
HP-UX*)
if test "x$enable_32bit" = xyes; then
# Compiling on an IRIX system, build 32-bit
# libraries...
C32FLAGS="-n32 -mips3"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$prefix/lib32"
UNINSTALL32="uninstall32bit"
# Build 32-bit libraries, 64-bit base...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-milp32"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-mlp64"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
fi
if test "x$enable_64bit" = xyes; then
# Compiling on an IRIX system, build 64-bit
# libraries...
C64FLAGS="-64 -mips4"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64DIR="$prefix/lib64"
UNINSTALL64="uninstall64bit"
# Build 64-bit libraries, 32-bit base...
if test -z "$with_arch64flags"; then
ARCH64FLAGS="-mlp64"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-milp32"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
IRIX)
if test "x$enable_32bit" = xyes; then
# Build 32-bit libraries, 64-bit base...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-n32 -mips3"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-64 -mips4"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
fi
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries, 32-bit base...
if test -z "$with_arch64flags"; then
ARCH64FLAGS="-64 -mips4"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-n32 -mips3"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
Linux*)
if test "x$enable_32bit" = xyes; then
# Compiling on an 64-bit x86 system, build 32-bit
# libraries...
C32FLAGS="-m32"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$exec_prefix/lib"
if test -d /usr/lib32; then
LIB32DIR="${LIB32DIR}32"
# Build 32-bit libraries, 64-bit base...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-m32"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-m64"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
fi
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries, 32-bit base...
if test -z "$with_arch64flags"; then
ARCH64FLAGS="-m64"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-m32"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
UNINSTALL32="uninstall32bit"
fi
;;
SunOS*)
if test "x$enable_32bit" = xyes; then
# Compiling on a Solaris system, build 32-bit
# libraries...
C32FLAGS="-m32"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$exec_prefix/lib/32"
UNINSTALL32="uninstall32bit"
# Build 32-bit libraries, 64-bit base...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-m32"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-m64"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
fi
if test "x$enable_64bit" = xyes; then
# Compiling on a Solaris system, build 64-bit
# libraries...
C64FLAGS="-m64"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64DIR="$exec_prefix/lib/64"
UNINSTALL64="uninstall64bit"
# Build 64-bit libraries, 32-bit base...
if test -z "$with_arch64flags"; then
ARCH64FLAGS="-m64"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-m32"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
esac
else
# Add vendor-specific compiler options...
case $uname in
AIX*)
if test -z "$OPTIM"; then
@@ -200,10 +294,9 @@ else
fi
CFLAGS="-Ae $CFLAGS"
if test "x$with_optim" = x; then
OPTIM="+DAportable $OPTIM"
fi
# Warning 336 is "empty translation unit"
# Warning 829 is passing constant string as char *
CXXFLAGS="+W336,829 $CXXFLAGS"
if test $PICFLAG = 1; then
OPTIM="+z $OPTIM"
@@ -223,67 +316,102 @@ else
fi
if test "x$enable_32bit" = xyes; then
# Compiling on an IRIX system, build 32-bit
# libraries...
C32FLAGS="-n32 -mips3"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$exec_prefix/lib32"
UNINSTALL32="uninstall32bit"
# Build 32-bit libraries, 64-bit base...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-n32 -mips3"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-64 -mips4"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
fi
if test "x$enable_64bit" = xyes; then
# Compiling on an IRIX system, build 64-bit
# libraries...
C64FLAGS="-64 -mips4"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64DIR="$exec_prefix/lib64"
UNINSTALL64="uninstall64bit"
# Build 64-bit libraries, 32-bit base...
if test -z "$with_arch64flags"; then
ARCH64FLAGS="-64 -mips4"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-n32 -mips3"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O"
else
OPTIM="$with_optim"
fi
fi
;;
SunOS*)
# Solaris
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-xO4"
OPTIM="-xO2"
else
OPTIM="$with_optim $OPTIM"
fi
fi
if test "x$with_optim" = x; then
# Specify "generic" SPARC output and suppress
# all of Sun's questionable warning messages...
OPTIM="-w $OPTIM -xarch=generic"
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
if test "x$enable_32bit" = xyes; then
# Compiling on a Solaris system, build 32-bit
# libraries...
C32FLAGS="-xarch=v8"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$exec_prefix/lib/32"
UNINSTALL32="uninstall32bit"
fi
if test "x$enable_64bit" = xyes; then
# Compiling on a Solaris system, build 64-bit
# libraries...
C64FLAGS="-xarch=v9 -xcode=pic32"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64DIR="$exec_prefix/lib/64"
UNINSTALL64="uninstall64bit"
# binaries with separate 32-bit libraries...
ARCH32FLAGS="-xarch=generic"
if test "x$with_optim" = x; then
# Suppress all of Sun's questionable
# warning messages, and default to
# 64-bit compiles of everything else...
OPTIM="-w $OPTIM"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-xarch=generic64"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
else
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries...
ARCH64FLAGS="-xarch=generic64"
fi
if test "x$with_optim" = x; then
# Suppress all of Sun's questionable
# warning messages, and default to
# 32-bit compiles of everything else...
OPTIM="-w $OPTIM"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-xarch=generic"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
UNIX_SVR*)
@@ -312,16 +440,29 @@ else
esac
fi
if test $uname = HP-UX; then
# HP-UX 10.20 (at least) needs this definition to get the
# h_errno global...
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
# Add general compiler options per platform...
case $uname in
HP-UX*)
# HP-UX 10.20 (at least) needs this definition to get the
# h_errno global...
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
# HP-UX 11.00 (at least) needs this definition to get the
# u_short type used by the IP headers...
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
fi
# HP-UX 11.00 (at least) needs this definition to get the
# u_short type used by the IP headers...
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
# HP-UX 11.23 (at least) needs this definition to get the
# IPv6 header to work...
OPTIM="$OPTIM -D_HPUX_SOURCE"
;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1 need to be told
# to be POSIX-compliant...
OPTIM="$OPTIM -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_OSF_SOURCE"
;;
esac
dnl
dnl End of "$Id: cups-compiler.m4 5274 2006-03-10 20:57:09Z mike $".
dnl End of "$Id: cups-compiler.m4 6698 2007-07-20 14:15:44Z mike $".
dnl
+187 -62
Ver Arquivo
@@ -1,30 +1,32 @@
dnl
dnl "$Id$"
dnl "$Id: cups-defaults.m4 6740 2007-07-26 23:07:46Z mike $"
dnl
dnl Default cupsd configuration settings for the Common UNIX Printing System
dnl (CUPS).
dnl
dnl Copyright 2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Default languages...
LANGUAGES="`ls -1 locale/*.po | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`"
AC_ARG_WITH(languages, [ --with-languages set installed languages, default=all ],[
case "$withval" in
none | no) LANGUAGES="" ;;
all) ;;
*) LANGUAGES="$withval" ;;
esac])
AC_SUBST(LANGUAGES)
dnl Default ConfigFilePerm
AC_ARG_WITH(config_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
CUPS_CONFIG_FILE_PERM="$withval",
if test "x$uname" = xDarwin; then
CUPS_CONFIG_FILE_PERM="644"
@@ -35,7 +37,7 @@ AC_SUBST(CUPS_CONFIG_FILE_PERM)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
dnl Default LogFilePerm
AC_ARG_WITH(log_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
AC_ARG_WITH(log_file_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
CUPS_LOG_FILE_PERM="$withval",
CUPS_LOG_FILE_PERM="644")
AC_SUBST(CUPS_LOG_FILE_PERM)
@@ -53,17 +55,47 @@ fi
AC_SUBST(CUPS_BROWSING)
dnl Default BrowseLocalProtocols
AC_ARG_WITH(browse_local, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
CUPS_BROWSE_LOCAL_PROTOCOLS="$withval",
CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS")
AC_ARG_WITH(local_protocols, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
default_local_protocols="$withval",
default_local_protocols="default")
if test x$with_local_protocols != xno; then
if test "x$default_local_protocols" = "xdefault"; then
if test "x$DNSSDLIBS" != "x"; then
CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS dnssd"
else
CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS"
fi
else
CUPS_BROWSE_LOCAL_PROTOCOLS="$default_local_protocols"
fi
else
CUPS_BROWSE_LOCAL_PROTOCOLS=""
fi
AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
"$CUPS_BROWSE_LOCAL_PROTOCOLS")
dnl Default BrowseRemoteProtocols
AC_ARG_WITH(browse_remote, [ --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
CUPS_BROWSE_REMOTE_PROTOCOLS="$withval",
CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS")
AC_ARG_WITH(remote_protocols, [ --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
default_remote_protocols="$withval",
default_remote_protocols="default")
if test x$with_remote_protocols != xno; then
if test "x$default_remote_protocols" = "xdefault"; then
if test "$uname" = "Darwin" -a $uversion -ge 90; then
CUPS_BROWSE_REMOTE_PROTOCOLS=""
else
CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS"
fi
else
CUPS_BROWSE_REMOTE_PROTOCOLS="$default_remote_protocols"
fi
else
CUPS_BROWSE_REMOTE_PROTOCOLS=""
fi
AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS,
"$CUPS_BROWSE_REMOTE_PROTOCOLS")
@@ -104,22 +136,36 @@ fi
AC_SUBST(CUPS_IMPLICIT_CLASSES)
dnl Default UseNetworkDefault
AC_ARG_ENABLE(network_default, [ --enable-use-network-default
enable UseNetworkDefault by default, default=yes])
if test "x$enable_network_default" = xno; then
AC_ARG_ENABLE(use_network_default, [ --enable-use-network-default
enable UseNetworkDefault by default, default=auto])
if test "x$enable_use_network_default" != xno; then
AC_MSG_CHECKING(whether to use network default printers)
if test "x$enable_use_network_default" = xyes -o $uname != Darwin; then
CUPS_USE_NETWORK_DEFAULT="Yes"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 1)
AC_MSG_RESULT(yes)
else
CUPS_USE_NETWORK_DEFAULT="No"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 0)
AC_MSG_RESULT(no)
fi
else
CUPS_USE_NETWORK_DEFAULT="No"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 0)
else
CUPS_USE_NETWORK_DEFAULT="Yes"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 1)
fi
AC_SUBST(CUPS_USE_NETWORK_DEFAULT)
dnl Determine the correct username and group for this OS...
AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
CUPS_USER="$withval",
AC_MSG_CHECKING(for default print user)
if test -f /etc/passwd; then
if test x$uname = xDarwin; then
if test x`id -u _lp 2>/dev/null` = x; then
CUPS_USER="lp";
else
CUPS_USER="_lp";
fi
elif test -f /etc/passwd; then
CUPS_USER=""
for user in lp lpd guest daemon nobody; do
if test "`grep \^${user}: /etc/passwd`" != ""; then
@@ -138,16 +184,17 @@ AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
AC_MSG_RESULT(no password file, using "$CUPS_USER")
fi)
AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
CUPS_GROUP="$withval",
AC_MSG_CHECKING(for default print group)
if test -f /etc/group; then
if test x$uname = xDarwin; then
GROUP_LIST="nobody"
if test x$uname = xDarwin; then
if test x`id -g _lp 2>/dev/null` = x; then
CUPS_GROUP="lp";
else
GROUP_LIST="lp nobody"
CUPS_GROUP="_lp";
fi
elif test -f /etc/group; then
GROUP_LIST="_lp lp nobody"
CUPS_GROUP=""
for group in $GROUP_LIST; do
if test "`grep \^${group}: /etc/group`" != ""; then
@@ -166,38 +213,38 @@ AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
fi)
AC_ARG_WITH(system-groups, [ --with-system-groups set default system groups for CUPS],
AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
CUPS_SYSTEM_GROUPS="$withval",
if test x$uname = xDarwin; then
GROUP_LIST="admin"
CUPS_SYSTEM_GROUPS="admin"
else
GROUP_LIST="lpadmin sys system root"
fi
AC_MSG_CHECKING(for default system groups)
if test -f /etc/group; then
CUPS_SYSTEM_GROUPS=""
for group in $GROUP_LIST; do
if test "`grep \^${group}: /etc/group`" != ""; then
if test "x$CUPS_SYSTEM_GROUPS" = x; then
CUPS_SYSTEM_GROUPS="$group"
else
CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
AC_MSG_CHECKING(for default system groups)
if test -f /etc/group; then
CUPS_SYSTEM_GROUPS=""
GROUP_LIST="lpadmin sys system root"
for group in $GROUP_LIST; do
if test "`grep \^${group}: /etc/group`" != ""; then
if test "x$CUPS_SYSTEM_GROUPS" = x; then
CUPS_SYSTEM_GROUPS="$group"
else
CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
fi
fi
fi
done
done
if test "x$CUPS_SYSTEM_GROUPS" = x; then
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
if test "x$CUPS_SYSTEM_GROUPS" = x; then
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
else
AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
fi
else
AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
fi
else
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
fi)
CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
AC_SUBST(CUPS_USER)
@@ -209,7 +256,85 @@ AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_GROUPS, "$CUPS_SYSTEM_GROUPS")
dnl Default printcap file...
AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
default_printcap="$withval",
default_printcap="default")
if test x$default_printcap != xno; then
if test "x$default_printcap" = "xdefault"; then
case $uname in
Darwin*)
if test $uversion -ge 90; then
CUPS_DEFAULT_PRINTCAP=""
else
CUPS_DEFAULT_PRINTCAP="/etc/printcap"
fi
;;
SunOS*)
CUPS_DEFAULT_PRINTCAP="/etc/printers.conf"
;;
*)
CUPS_DEFAULT_PRINTCAP="/etc/printcap"
;;
esac
else
CUPS_DEFAULT_PRINTCAP="$default_printcap"
fi
else
CUPS_DEFAULT_PRINTCAP=""
fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
dnl Default MaxCopies value...
AC_ARG_WITH(max-copies, [ --with-max-copies set max copies value, default=100 ],
CUPS_MAX_COPIES="$withval",
if test "x$uname" = xDarwin; then
CUPS_MAX_COPIES="999"
else
CUPS_MAX_COPIES="100"
fi)
AC_SUBST(CUPS_MAX_COPIES)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_MAX_COPIES, $CUPS_MAX_COPIES)
dnl Default raw printing state
AC_ARG_ENABLE(raw_printing, [ --enable-raw-printing enable raw printing by default, default=auto])
if test "x$enable_raw_printing" != xno; then
AC_MSG_CHECKING(whether to enable raw printing)
if test "x$enable_raw_printing" = xyes -o $uname = Darwin; then
DEFAULT_RAW_PRINTING=""
AC_MSG_RESULT(yes)
else
DEFAULT_RAW_PRINTING="#"
AC_MSG_RESULT(no)
fi
else
DEFAULT_RAW_PRINTING="#"
fi
AC_SUBST(DEFAULT_RAW_PRINTING)
dnl Default SNMP options...
AC_ARG_WITH(snmp-address, [ --with-snmp-address set SNMP query address, default=auto ],
if test "x$withval" = x; then
CUPS_SNMP_ADDRESS=""
else
CUPS_SNMP_ADDRESS="Address $withval"
fi,
if test "x$uname" = xDarwin; then
CUPS_SNMP_ADDRESS=""
else
CUPS_SNMP_ADDRESS="Address @LOCAL"
fi)
AC_ARG_WITH(snmp-community, [ --with-snmp-community set SNMP community, default=public ],
CUPS_SNMP_COMMUNITY="Community $withval",
CUPS_SNMP_COMMUNITY="Community public")
AC_SUBST(CUPS_SNMP_ADDRESS)
AC_SUBST(CUPS_SNMP_COMMUNITY)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-defaults.m4 6740 2007-07-26 23:07:46Z mike $".
dnl
+110 -43
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-directories.m4 5269 2006-03-10 03:33:00Z mike $"
dnl "$Id: cups-directories.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Directory stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_PREFIX_DEFAULT(/)
@@ -57,6 +48,15 @@ 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
@@ -64,6 +64,8 @@ if test "$datadir" = "\${prefix}/share"; then
else
datadir="$prefix/share"
fi
elif test "$datadir" = "\${datarootdir}"; then
datadir="$datarootdir"
fi
dnl Fix "includedir" variable if it hasn't been specified...
@@ -112,27 +114,47 @@ fi
dnl Setup init.d locations...
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
INITDIR=""
INITDDIR=""
RCLEVELS="$rclevels"
RCSTART="$rcstart"
RCSTOP="$rcstop"
if test x$rcdir = x; then
case "$uname" in
FreeBSD* | OpenBSD*)
# FreeBSD and OpenBSD
INITDIR=""
INITDDIR=""
;;
NetBSD*)
# NetBSD
INITDIR=""
INITDDIR="/etc/rc.d"
AIX*)
INITDIR="/etc/rc.d"
;;
Darwin*)
# Darwin and MacOS X...
INITDIR=""
AC_CHECK_PROG(INITDDIR, launchd,
"/System/Library/LaunchDaemons",
"/System/Library/StartupItems/PrintingServices")
if test -x /sbin/launchd; then
INITDDIR="/System/Library/LaunchDaemons"
else
INITDDIR="/System/Library/StartupItems/PrintingServices"
fi
;;
FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
# FreeBSD and OpenBSD
;;
HP-UX*)
INITDIR="/sbin"
RCLEVELS="2"
RCSTART="620"
RCSTOP="380"
;;
IRIX*)
# IRIX
INITDIR="/etc"
RCSTART="60"
RCSTOP="25"
;;
Linux | GNU)
@@ -140,43 +162,66 @@ if test x$rcdir = x; then
if test -d /sbin/init.d; then
# SuSE
INITDIR="/sbin/init.d"
INITDDIR=".."
else
if test -d /etc/init.d; then
# Others
INITDIR="/etc"
INITDDIR="../init.d"
else
# RedHat
INITDIR="/etc/rc.d"
INITDDIR="../init.d"
fi
fi
RCSTART="81"
RCSTOP="36"
;;
OSF1* | HP-UX*)
NetBSD*)
# NetBSD
INITDDIR="/etc/rc.d"
;;
OSF1*)
INITDIR="/sbin"
INITDDIR="../init.d"
;;
AIX*)
INITDIR="/etc/rc.d"
INITDDIR=".."
SunOS*)
# Solaris
INITDIR="/etc"
RCSTART="81"
;;
*)
INITDIR="/etc"
INITDDIR="../init.d"
;;
esac
else
INITDIR=""
INITDDIR="$rcdir"
if test "x$rclevels" = x; then
INITDDIR="$rcdir"
else
INITDIR="$rcdir"
fi
fi
AC_SUBST(INITDIR)
AC_SUBST(INITDDIR)
AC_SUBST(RCLEVELS)
AC_SUBST(RCSTART)
AC_SUBST(RCSTOP)
dnl Xinetd support...
AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
if test "x$XINETD" = x -a ! -x /sbin/launchd; then
for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
if test -d $dir; then
XINETD="$dir"
break
fi
done
fi
AC_SUBST(XINETD)
dnl Setup default locations...
# Cache data...
@@ -184,7 +229,7 @@ AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cache
if test x$cachedir = x; then
if test "x$uname" = xDarwin; then
CUPS_CACHEDIR="$localstatedir/tmp/cups"
CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
else
CUPS_CACHEDIR="$localstatedir/cache/cups"
fi
@@ -199,6 +244,28 @@ CUPS_DATADIR="$datadir/cups"
AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
AC_SUBST(CUPS_DATADIR)
# Icon directory
AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
if test "x$icondir" = x -a -d /usr/share/icons; then
ICONDIR="/usr/share/icons"
else
ICONDIR="$icondir"
fi
AC_SUBST(ICONDIR)
# Menu directory
AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
if test "x$menudir" = x -a -d /usr/share/applications; then
MENUDIR="/usr/share/applications"
else
MENUDIR="$menudir"
fi
AC_SUBST(MENUDIR)
# Documentation files
AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
@@ -289,5 +356,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
AC_SUBST(CUPS_STATEDIR)
dnl
dnl End of "$Id: cups-directories.m4 5269 2006-03-10 03:33:00Z mike $".
dnl End of "$Id: cups-directories.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+54
Ver Arquivo
@@ -0,0 +1,54 @@
dnl
dnl "$Id$"
dnl
dnl DNS Service Discovery (aka Bonjour) stuff for the Common UNIX Printing System (CUPS).
dnl
dnl http://www.dns-sd.org
dnl http://www.multicastdns.org/
dnl http://developer.apple.com/networking/bonjour/
dnl
dnl Copyright 2007 by Apple Inc.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(dnssd, [ --enable-dnssd turn on DNS Service Discovery support, default=yes])
AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library],
LDFLAGS="-L$withval $LDFLAGS"
DSOFLAGS="-L$withval $DSOFLAGS",)
AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes],
CFLAGS="-I$withval $CFLAGS"
CXXFLAGS="-I$withval $CXXFLAGS"
CPPFLAGS="-I$withval $CPPFLAGS",)
DNSSDLIBS=""
if test x$enable_dnssd != xno; then
AC_CHECK_HEADER(dns_sd.h, [
case "$uname" in
Darwin*)
# Darwin and MacOS X...
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
AC_DEFINE(HAVE_DNSSD)
AC_DEFINE(HAVE_COREFOUNDATION)
AC_DEFINE(HAVE_SYSTEMCONFIGURATION)
;;
*)
# All others...
AC_CHECK_LIB(dns_sd,DNSServiceProcessResult,
AC_DEFINE(HAVE_DNSSD)
DNSSDLIBS="-ldns_sd")
;;
esac
])
fi
AC_SUBST(DNSSDLIBS)
dnl
dnl End of "$Id$".
dnl
+111
Ver Arquivo
@@ -0,0 +1,111 @@
dnl
dnl "$Id$"
dnl
dnl GSSAPI/Kerberos library detection.
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 2006-2007 by Easy Software Products.
dnl
dnl This file contains Kerberos support code, copyright 2006 by
dnl Jelmer Vernooij.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(gssapi, [ --enable-gssapi turn on GSSAPI support, default=yes])
LIBGSSAPI=""
if test x$enable_gssapi != xno; then
AC_PATH_PROG(KRB5CONFIG, krb5-config)
if test "x$KRB5CONFIG" != x; then
if test "x$uname" = "xDarwin"; then
# Mac OS X weak-links to the Kerberos framework...
LIBGSSAPI="-weak_framework Kerberos"
else
CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS"
CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS"
LIBGSSAPI="`$KRB5CONFIG --libs gssapi`"
fi
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
else
# Check for vendor-specific implementations...
case "$uname" in
HP-UX*)
AC_CHECK_LIB(gss, gss_display_status,
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
LIBGSSAPI="-lgss -lgssapi_krb5")
;;
SunOS*)
AC_CHECK_LIB(gss, gss_display_status,
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
LIBGSSAPI="-lgss")
;;
esac
fi
if test "x$LIBGSSAPI" != x; then
AC_CHECK_HEADER(krb5.h, AC_DEFINE(HAVE_KRB5_H))
AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H))
AC_CHECK_HEADER(gssapi/gssapi.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_H))
AC_CHECK_HEADER(gssapi/gssapi_generic.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_GENERIC_H))
AC_CHECK_HEADER(gssapi/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_KRB5_H))
SAVELIBS="$LIBS"
LIBS="$LIBS $LIBGSSAPI"
AC_CHECK_FUNC(gsskrb5_register_acceptor_identity,
AC_DEFINE(HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY))
AC_CHECK_FUNC(krb5_cc_resolve, AC_DEFINE(HAVE_KRB5_CC_RESOLVE))
AC_MSG_CHECKING(for GSS_C_NT_HOSTBASED_SERVICE)
if test $ac_cv_header_gssapi_gssapi_h = yes; then
AC_TRY_COMPILE([ #include <gssapi/gssapi.h> ],
[ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ],
AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
else
AC_TRY_COMPILE([ #include <gssapi.h> ],
[ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ],
AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
fi
LIBS="$SAVELIBS"
AC_MSG_CHECKING(for Heimdal Kerberos)
AC_TRY_COMPILE([ #include <krb5.h> ],
[ char *tmp = heimdal_version; ],
AC_DEFINE(HAVE_HEIMDAL)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
fi
fi
dnl Default GSS service name...
AC_ARG_WITH(gssservicename, [ --with-gssservicename set default gss service name],
default_gssservicename="$withval",
default_gssservicename="default")
if test x$default_gssservicename != xno; then
if test "x$default_gssservicename" = "xdefault"; then
CUPS_DEFAULT_GSSSERVICENAME="ipp"
else
CUPS_DEFAULT_GSSSERVICENAME="$default_gssservicename"
fi
else
CUPS_DEFAULT_GSSSERVICENAME=""
fi
AC_SUBST(LIBGSSAPI)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
dnl
dnl End of "$Id$".
dnl
+37 -26
Ver Arquivo
@@ -1,30 +1,33 @@
dnl
dnl "$Id: cups-image.m4 4644 2005-09-15 18:43:06Z mike $"
dnl "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Image library stuff for the Common UNIX Printing System (CUPS).
dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Save the current libraries since we don't want the image libraries
dnl included with every program...
SAVELIBS="$LIBS"
dnl See if we want the image filters included at all...
AC_ARG_ENABLE(image, [ --enable-image turn on image filters, default=auto])
IMGFILTERS=""
if test "x$enable_image" != xno; then
AC_MSG_CHECKING(whether to build image filters)
if test "x$enable_image" = xyes -o $uname != Darwin; then
IMGFILTERS="imagetops imagetoraster"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
AC_SUBST(IMGFILTERS)
dnl Check for image libraries...
AC_ARG_ENABLE(jpeg, [ --enable-jpeg turn on JPEG support, default=yes])
@@ -41,6 +44,14 @@ AC_SUBST(LIBPNG)
AC_SUBST(LIBTIFF)
AC_SUBST(LIBZ)
dnl Image libraries use math library functions...
AC_SEARCH_LIBS(pow, m)
dnl Save the current libraries since we don't want the image libraries
dnl included with every program...
SAVELIBS="$LIBS"
dnl JPEG library...
if test x$enable_jpeg != xno; then
AC_CHECK_HEADER(jpeglib.h,
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
@@ -51,24 +62,24 @@ else
AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.])
fi
dnl ZLIB library...
AC_CHECK_HEADER(zlib.h,
AC_CHECK_LIB(z, gzgets,
AC_DEFINE(HAVE_LIBZ)
LIBZ="-lz"
LIBS="$LIBS -lz"))
dnl PNG library uses math library functions...
AC_CHECK_LIB(m, pow)
dnl PNG library...
if test x$enable_png != xno; then
AC_CHECK_HEADER(png.h,
AC_CHECK_LIB(png, png_set_tRNS_to_alpha,
AC_CHECK_LIB(png, png_create_read_struct,
AC_DEFINE(HAVE_LIBPNG)
LIBPNG="-lpng -lm"))
LIBPNG="-lpng"))
else
AC_MSG_NOTICE([PNG support disabled with --disable-png.])
fi
dnl TIFF library...
if test x$enable_tiff != xno; then
AC_CHECK_HEADER(tiff.h,
AC_CHECK_LIB(tiff, TIFFReadScanline,
@@ -94,5 +105,5 @@ AC_SUBST(EXPORT_LIBZ)
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
dnl
dnl End of "$Id: cups-image.m4 4644 2005-09-15 18:43:06Z mike $".
dnl End of "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+9 -18
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-largefile.m4 4732 2005-09-30 23:23:25Z mike $"
dnl "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Large file support stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Check for largefile support...
@@ -30,11 +21,11 @@ LARGEFILE=""
if test x$enable_largefile != xno; then
LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
if test $ac_cv_sys_large_files = 1; then
if test x$ac_cv_sys_large_files = x1; then
LARGEFILE="$LARGEFILE -D_LARGE_FILES"
fi
if test $ac_cv_sys_file_offset_bits = 64; then
if test x$ac_cv_sys_file_offset_bits = x64; then
LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64"
fi
fi
@@ -57,5 +48,5 @@ fi
AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
dnl
dnl End of "$Id: cups-largefile.m4 4732 2005-09-30 23:23:25Z mike $".
dnl End of "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id$"
dnl "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl launchd stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
@@ -49,5 +40,5 @@ AC_SUBST(DEFAULT_LAUNCHD_CONF)
AC_SUBST(LAUNCHDLIBS)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+8 -17
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id$"
dnl "$Id: cups-ldap.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl LDAP configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 2003-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org/
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(ldap, [ --enable-ldap turn on LDAP support, default=yes])
@@ -36,7 +27,7 @@ LIBLDAP=""
if test x$enable_ldap != xno; then
AC_CHECK_HEADER(ldap.h,
AC_CHECK_LIB(ldap, ldap_value_free,
AC_CHECK_LIB(ldap, ldap_initialize,
AC_DEFINE(HAVE_LDAP)
AC_DEFINE(HAVE_OPENLDAP)
LIBLDAP="-lldap"))
@@ -46,5 +37,5 @@ AC_SUBST(LIBLDAP)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-ldap.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z mike $"
dnl "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Libtool stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported=LIBTOOL_PATH
@@ -45,5 +36,5 @@ if test x$LIBTOOL != x; then
fi
dnl
dnl End of "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z mike $".
dnl End of "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+14 -17
Ver Arquivo
@@ -1,28 +1,25 @@
dnl
dnl "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $"
dnl "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Manpage stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Fix "mandir" variable...
if test "$mandir" = "\${datarootdir}/man" -a "$prefix" = "/"; then
# New GNU "standards" break previous ones, so make sure we use
# the right default location for the operating system...
mandir="\${prefix}/man"
fi
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
case "$uname" in
Darwin* | Linux | GNU | *BSD* | AIX*)
@@ -103,5 +100,5 @@ AC_SUBST(MAN8EXT)
AC_SUBST(MAN8DIR)
dnl
dnl End of "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $".
dnl End of "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+17 -18
Ver Arquivo
@@ -1,35 +1,31 @@
dnl
dnl "$Id: cups-network.m4 4873 2005-12-07 01:46:54Z mike $"
dnl "$Id: cups-network.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Networking stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyaddr, nsl)
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
AC_SEARCH_LIBS(getifaddrs, nsl, AC_DEFINE(HAVE_GETIFADDRS))
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
AC_SEARCH_LIBS(hstrerror, nsl socket resolv, AC_DEFINE(HAVE_HSTRERROR))
AC_SEARCH_LIBS(rresvport_af, nsl, AC_DEFINE(HAVE_RRESVPORT_AF))
# Tru64 5.1b leaks file descriptors with these functions; disable until
# we can come up with a test for this...
if test "$uname" != "OSF1"; then
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
fi
AC_CHECK_MEMBER(struct sockaddr.sa_len,,, [#include <sys/socket.h>])
AC_CHECK_HEADER(sys/sockio.h, AC_DEFINE(HAVE_SYS_SOCKIO_H))
@@ -84,6 +80,9 @@ fi
AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
AC_CHECK_HEADERS(AppleTalk/at_proto.h,AC_DEFINE(HAVE_APPLETALK_AT_PROTO_H),,
[#include <netat/appletalk.h>])
dnl
dnl End of "$Id: cups-network.m4 4873 2005-12-07 01:46:54Z mike $".
dnl End of "$Id: cups-network.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+9 -17
Ver Arquivo
@@ -1,30 +1,22 @@
dnl
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z mike $"
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Operating system stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Get the operating system and version number...
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/*)
@@ -39,5 +31,5 @@ case "$uname" in
esac
dnl
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z mike $"
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z mike $"
dnl "$Id: cups-pam.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl PAM stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(pam, [ --enable-pam turn on PAM support, default=yes])
@@ -94,5 +85,5 @@ AC_SUBST(PAMLIBS)
AC_SUBST(PAMMOD)
dnl
dnl End of "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z mike $".
dnl End of "$Id: cups-pam.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+28
Ver Arquivo
@@ -0,0 +1,28 @@
dnl
dnl "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl PAP (AppleTalk) stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
# Currently the PAP backend is only supported on MacOS X with the AppleTalk
# SDK installed...
PAP=""
if test $uname = Darwin; then
PAP="pap"
AC_CHECK_HEADER(AppleTalk/at_proto.h)
fi
AC_SUBST(PAP)
dnl
dnl End of "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+34
Ver Arquivo
@@ -0,0 +1,34 @@
dnl
dnl "$Id: cups-pdf.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl PDF filter configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(pdftops, [ --enable-pdftops build pdftops filter, default=auto ])
PDFTOPS=""
if test "x$enable_pdftops" != xno; then
AC_MSG_CHECKING(whether to build pdftops filter)
if test "x$enable_pdftops" = xyes -o $uname != Darwin; then
PDFTOPS="pdftops"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
AC_SUBST(PDFTOPS)
dnl
dnl End of "$Id: cups-pdf.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+22
Ver Arquivo
@@ -0,0 +1,22 @@
dnl
dnl "$Id$"
dnl
dnl Select/poll stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_CHECK_FUNC(poll, AC_DEFINE(HAVE_POLL))
AC_CHECK_FUNC(epoll_create, AC_DEFINE(HAVE_EPOLL))
AC_CHECK_FUNC(kqueue, AC_DEFINE(HAVE_KQUEUE))
dnl
dnl End of "$Id$".
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z mike $"
dnl "$Id: cups-scripting.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Scripting configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Do we have Java?
@@ -100,5 +91,5 @@ if test "x$CUPS_PYTHON" != x; then
fi
dnl
dnl End of "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z mike $".
dnl End of "$Id: cups-scripting.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+80 -49
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z mike $"
dnl "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Shared library support for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
PICFLAG=1
@@ -33,31 +24,41 @@ if test x$enable_shared != xno; then
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-h,\$@ -G \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
;;
HP-UX*)
LIBCUPS="libcups.sl.2"
LIBCUPSIMAGE="libcupsimage.sl.2"
DSO="\$(LD)"
DSOFLAGS="$DSOFLAGS -b -z +h \$@"
case "$uarch" in
ia64)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`"
;;
*)
LIBCUPS="libcups.sl.2"
LIBCUPSIMAGE="libcupsimage.sl.2"
DSO="\$(LD)"
DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
;;
esac
;;
IRIX)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi2.6,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
OSF1* | Linux | GNU | *BSD*)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
Darwin*)
LIBCUPS="libcups.2.dylib"
LIBCUPSIMAGE="libcupsimage.2.dylib"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -single_module -lc"
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
;;
AIX*)
LIBCUPS="libcups_s.a"
@@ -71,7 +72,7 @@ if test x$enable_shared != xno; then
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
esac
else
@@ -81,8 +82,15 @@ else
DSO=":"
fi
# 32-bit and 64-bit libraries need variations of the standard
# DSOFLAGS...
DSO32FLAGS="$DSOFLAGS"
DSO64FLAGS="$DSOFLAGS"
AC_SUBST(DSO)
AC_SUBST(DSOFLAGS)
AC_SUBST(DSO32FLAGS)
AC_SUBST(DSO64FLAGS)
AC_SUBST(LIBCUPS)
AC_SUBST(LIBCUPSIMAGE)
@@ -110,41 +118,64 @@ if test "$DSO" != ":"; then
# rather than to the executables. This makes things smaller if you
# are using any static libraries, and it also allows us to distribute
# a single DSO rather than a bunch...
DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
IMGLIBS=""
# The *BSD, HP-UX, and Solaris run-time linkers need help when
# deciding where to find a DSO. Add linker options to tell them
# where to find the DSO (usually in /usr/lib... duh!)
# Tell the run-time linkers where to find a DSO. Some platforms
# need this option, even when the library is installed in a
# standard location...
case $uname in
HP-UX*)
# HP-UX
DSOFLAGS="+s +b $libdir $DSOFLAGS"
# HP-UX needs the path, even for /usr/lib...
case "$uarch" in
ia64)
DSOFLAGS="-Wl,+s,+b,$libdir $DSOFLAGS"
DSO32FLAGS="-Wl,+s,+b,$LIB32DIR $DSO32FLAGS"
DSO64FLAGS="-Wl,+s,+b,$LIB64DIR $DSO64FLAGS"
;;
*)
DSOFLAGS="+s +b $libdir $DSOFLAGS"
DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
;;
esac
LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
;;
;;
SunOS*)
# Solaris
DSOFLAGS="-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -R$libdir"
EXPORT_LDFLAGS="-R$libdir"
;;
# Solaris...
if test $exec_prefix != /usr; then
DSOFLAGS="-R$libdir $DSOFLAGS"
DSO32FLAGS="-R$LIB32DIR $DSO32FLAGS"
DSO64FLAGS="-R$LIB64DIR $DSO64FLAGS"
LDFLAGS="$LDFLAGS -R$libdir"
EXPORT_LDFLAGS="-R$libdir"
fi
;;
*BSD*)
# *BSD
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
EXPORT_LDFLAGS="-Wl,-R$libdir"
;;
Linux | GNU)
# Linux and HURD
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
;;
# *BSD...
if test $exec_prefix != /usr; then
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
DSO32FLAGS="-Wl,-R$LIB32DIR $DSO32FLAGS"
DSO64FLAGS="-Wl,-R$LIB64DIR $DSO64FLAGS"
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
EXPORT_LDFLAGS="-Wl,-R$libdir"
fi
;;
IRIX | Linux | GNU)
# IRIX, Linux, and HURD...
if test $exec_prefix != /usr; then
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
DSO32FLAGS="-Wl,-rpath,$LIB32DIR $DSO32FLAGS"
DSO64FLAGS="-Wl,-rpath,$LIB64DIR $DSO64FLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
fi
;;
esac
else
DSOLIBS=""
IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
fi
AC_SUBST(DSOLIBS)
@@ -152,5 +183,5 @@ AC_SUBST(IMGLIBS)
AC_SUBST(EXPORT_LDFLAGS)
dnl
dnl End of "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z mike $".
dnl End of "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z mike $"
dnl "$Id: cups-slp.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl OpenSLP configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(slp, [ --enable-slp turn on SLP support, default=yes])
@@ -44,5 +35,5 @@ AC_SUBST(LIBSLP)
dnl
dnl End of "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z mike $".
dnl End of "$Id: cups-slp.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+51 -32
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $"
dnl "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes])
@@ -36,31 +27,52 @@ AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenS
SSLFLAGS=""
SSLLIBS=""
ENCRYPTION_REQUIRED=""
if test x$enable_ssl != xno; then
dnl Look for CDSA...
if test "x${SSLLIBS}" = "x" -a "x${enable_cdsassl}" != "xno"; then
if test $uname = Darwin; then
AC_CHECK_HEADER(Security/SecureTransport.h,
[SSLLIBS="-framework CoreFoundation -framework Security"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_CDSASSL)])
AC_CHECK_HEADER(Security/SecureTransport.h, [
SSLLIBS="-framework CoreFoundation -framework Security"
# MacOS X doesn't (yet) come with pre-installed encryption
# certificates for CUPS, so don't enable encryption on
# /admin just yet...
#ENCRYPTION_REQUIRED=" Encryption Required"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_CDSASSL)
dnl Check for the various security headers...
AC_CHECK_HEADER(Security/SecPolicy.h,
AC_DEFINE(HAVE_SECPOLICY_H))
AC_CHECK_HEADER(Security/SecPolicyPriv.h,
AC_DEFINE(HAVE_SECPOLICYPRIV_H))
AC_CHECK_HEADER(Security/SecBasePriv.h,
AC_DEFINE(HAVE_SECBASEPRIV_H))
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
dnl Check for SecIdentitySearchCreateWithPolicy...
AC_MSG_CHECKING(for SecIdentitySearchCreateWithPolicy)
if test $uversion -ge 80; then
AC_DEFINE(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi])
fi
fi
dnl Then look for GNU TLS...
if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
AC_CHECK_HEADER(gnutls/gnutls.h,
dnl Save the current libraries so the crypto stuff isn't always
dnl included...
SAVELIBS="$LIBS"
AC_CHECK_LIB(gnutls, gnutls_x509_crt_set_dn_by_oid,
[SSLLIBS="-lgnutls"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)])
LIBS="$SAVELIBS")
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
if test "x$LIBGNUTLSCONFIG" != x; then
SSLLIBS=`$LIBGNUTLSCONFIG --libs`
SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
ENCRYPTION_REQUIRED=" Encryption Required"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)
fi
fi
dnl Check for the OpenSSL library last...
@@ -84,6 +96,7 @@ if test x$enable_ssl != xno; then
AC_CHECK_LIB(ssl,SSL_new,
[SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
SSLLIBS="-lssl $libcrypto"
ENCRYPTION_REQUIRED=" Encryption Required"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_LIBSSL)],,
$libcrypto)
@@ -97,13 +110,19 @@ if test x$enable_ssl != xno; then
fi
fi
if test "x$SSLLIBS" != x; then
AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
fi
AC_SUBST(SSLFLAGS)
AC_SUBST(SSLLIBS)
AC_SUBST(ENCRYPTION_REQUIRED)
EXPORT_SSLLIBS="$SSLLIBS"
AC_SUBST(EXPORT_SSLLIBS)
dnl
dnl End of "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $".
dnl End of "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+13 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id$"
dnl "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Threading stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support])
@@ -44,6 +35,12 @@ if test "x$enable_threads" != xno; then
if test $have_pthread = yes; then
PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT"
# Solaris requires -D_POSIX_PTHREAD_SEMANTICS to
# be POSIX-compliant... :(
if test $uname = SunOS; then
PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
fi
break
fi
done
@@ -53,5 +50,5 @@ fi
AC_SUBST(PTHREAD_FLAGS)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+130 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Configuration file for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*/
#ifndef _CUPS_CONFIG_H_
@@ -40,6 +31,7 @@
#define CUPS_DEFAULT_USER "lp"
#define CUPS_DEFAULT_GROUP "sys"
#define CUPS_DEFAULT_SYSTEM_GROUPS "sys root system"
#define CUPS_DEFAULT_PRINTADMIN_AUTH "@SYSTEM"
/*
@@ -70,6 +62,20 @@
#define CUPS_DEFAULT_IPP_PORT 631
/*
* Default printcap file...
*/
#define CUPS_DEFAULT_PRINTCAP "/etc/printcap"
/*
* Default MaxCopies value...
*/
#define CUPS_DEFAULT_MAX_COPIES 100
/*
* Maximum number of file descriptors to support.
*/
@@ -140,6 +146,13 @@
#undef HAVE_CRYPT_H
/*
* Do we have <scsi/sg.h>?
*/
#undef HAVE_SCSI_SG_H
/*
* Use <string.h>, <strings.h>, and/or <bstring.h>?
*/
@@ -253,6 +266,24 @@
#undef HAVE_SSL
/*
* What Security framework headers do we have?
*/
#undef HAVE_AUTHORIZATION_H
#undef HAVE_SECPOLICY_H
#undef HAVE_SECPOLICYPRIV_H
#undef HAVE_SECBASEPRIV_H
#undef HAVE_SECIDENTITYSEARCHPRIV_H
/*
* Do we have the SecIdentitySearchCreateWithPolicy function?
*/
#undef HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY
/*
* Do we have the SLP library?
*/
@@ -275,6 +306,21 @@
#undef HAVE_LIBPAPER
/*
* Do we have DNS Service Discovery (aka Bonjour)?
*/
#undef HAVE_DNSSD
/*
* Do we have Darwin's CoreFoundation and SystemConfiguration frameworks?
*/
#undef HAVE_COREFOUNDATION
#undef HAVE_SYSTEMCONFIGURATION
/*
* Do we have <sys/ioctl.h>?
*/
@@ -399,11 +445,19 @@
#undef HAVE_CFBUNDLEPRIV_H
/*
* Do we have CFLocaleCreateCanonicalLocaleIdentifierFromString()?
*/
#undef HAVE_CF_LOCALE_ID
/*
* Do we have MacOSX 10.4's mbr_XXX functions()?
*/
#undef HAVE_MEMBERSHIP_H
#undef HAVE_MEMBERSHIPPRIV_H
#undef HAVE_MBR_UID_TO_UUID
@@ -420,6 +474,67 @@
*/
#undef HAVE_DBUS
#undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND
/*
* Do we have the AppleTalk/at_proto.h header?
*/
#undef HAVE_APPLETALK_AT_PROTO_H
/*
* Do we have the GSSAPI support library (for Kerberos support)?
*/
#undef HAVE_GSSAPI
#undef HAVE_GSSAPI_H
#undef HAVE_GSSAPI_GSSAPI_H
#undef HAVE_GSSAPI_GSSAPI_GENERIC_H
#undef HAVE_GSSAPI_GSSAPI_KRB5_H
#undef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
#undef HAVE_GSS_C_NT_HOSTBASED_SERVICE
#undef HAVE_KRB5_CC_RESOLVE
#undef HAVE_KRB5_H
#undef HAVE_HEIMDAL
/*
* Default GSS service name...
*/
#define CUPS_DEFAULT_GSSSERVICENAME ""
/*
* Select/poll interfaces...
*/
#undef HAVE_POLL
#undef HAVE_EPOLL
#undef HAVE_KQUEUE
/*
* Do we have the <dlfcn.h> header?
*/
#undef HAVE_DLFCN_H
/*
* Do we have <sys/ucred.h>?
*/
#undef HAVE_SYS_UCRED_H
/*
* Do we have removefile()?
*/
#undef HAVE_REMOVEFILE
#endif /* !_CUPS_CONFIG_H_ */
+42 -27
Ver Arquivo
@@ -3,59 +3,74 @@ dnl "$Id$"
dnl
dnl Configuration script for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636 USA
dnl
dnl Voice: (301) 373-9600
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl property of Apple Inc. and are protected by Federal copyright
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_INIT(cups/cups.h)
sinclude(config-scripts/cups-opsys.m4)
sinclude(config-scripts/cups-common.m4)
sinclude(config-scripts/cups-defaults.m4)
sinclude(config-scripts/cups-directories.m4)
sinclude(config-scripts/cups-manpages.m4)
sinclude(config-scripts/cups-3264.m4)
sinclude(config-scripts/cups-sharedlibs.m4)
sinclude(config-scripts/cups-libtool.m4)
sinclude(config-scripts/cups-compiler.m4)
sinclude(config-scripts/cups-image.m4)
sinclude(config-scripts/cups-network.m4)
sinclude(config-scripts/cups-poll.m4)
sinclude(config-scripts/cups-slp.m4)
sinclude(config-scripts/cups-gssapi.m4)
sinclude(config-scripts/cups-ldap.m4)
sinclude(config-scripts/cups-ssl.m4)
sinclude(config-scripts/cups-pam.m4)
sinclude(config-scripts/cups-threads.m4)
sinclude(config-scripts/cups-largefile.m4)
sinclude(config-scripts/cups-dnssd.m4)
sinclude(config-scripts/cups-launchd.m4)
MAKEDEFS="../Makedefs"
AC_SUBST(MAKEDEFS)
sinclude(config-scripts/cups-defaults.m4)
sinclude(config-scripts/cups-pap.m4)
sinclude(config-scripts/cups-pdf.m4)
sinclude(config-scripts/cups-scripting.m4)
AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh cups-config
conf/cupsd.conf conf/pam.std doc/index.html doc/ja/index.html
doc/help/standard.html man/client.conf.man man/cups-deviced.man
man/cups-driverd.man man/cups-lpd.man man/cupsaddsmb.man
man/cupsd.man man/cupsd.conf.man man/lpoptions.man
templates/edit-config.tmpl templates/header.tmpl
templates/ja/header.tmpl)
INSTALL_LANGUAGES=""
UNINSTALL_LANGUAGES=""
LANGFILES=""
if test "x$LANGUAGES" != x; then
INSTALL_LANGUAGES="install-languages"
UNINSTALL_LANGUAGES="uninstall-languages"
for lang in $LANGUAGES; do
if test -f doc/$lang/index.html.in; then
LANGFILES="$LANGFILES doc/$lang/index.html"
fi
if test -f templates/$lang/header.tmpl.in; then
LANGFILES="$LANGFILES templates/$lang/header.tmpl"
fi
done
fi
AC_SUBST(INSTALL_LANGUAGES)
AC_SUBST(UNINSTALL_LANGUAGES)
AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
doc/index.html doc/help/ref-cupsd-conf.html doc/help/standard.html
init/org.cups.cups-lpd.plist
man/client.conf.man man/cups-deviced.man man/cups-driverd.man
man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
man/cupsd.conf.man man/lpoptions.man
templates/header.tmpl
$LANGFILES)
chmod +x cups-config
+31 -24
Ver Arquivo
@@ -4,33 +4,26 @@
#
# CUPS configuration utility.
#
# Copyright 2007 by Apple Inc.
# Copyright 2001-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
VERSION="@CUPS_VERSION@"
APIVERSION="1.2"
APIVERSION="1.3"
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
includedir=@includedir@
libdir=@libdir@
imagelibdir=@libdir@
datarootdir=@datadir@
datadir=@datadir@
sysconfdir=@sysconfdir@
cups_datadir=@CUPS_DATADIR@
@@ -41,16 +34,30 @@ INSTALLSTATIC=@INSTALLSTATIC@
# flags for C++ compiler:
CFLAGS=""
LDFLAGS="@EXPORT_LDFLAGS@"
LIBS="@EXPORT_SSLLIBS@ @LIBS@"
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@ @EXPORT_LIBZ@"
LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@"
if test $includedir != /usr/include; then
CFLAGS="$CFLAGS -I$includedir"
# Check for local invocation...
selfdir=`dirname $0`
if test -f "$selfdir/cups/cups.h"; then
CFLAGS="-I$selfdir"
LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
libdir="$selfdir/cups"
imagelibdir="$selfdir/filter"
if test ! -f "$selfdir/cups/raster.h"; then
ln -s ../filter/raster.h "$selfdir/cups"
fi
else
if test $includedir != /usr/include; then
CFLAGS="$CFLAGS -I$includedir"
fi
if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
LDFLAGS="$LDFLAGS -L$libdir"
fi
fi
if test $libdir != /usr/lib -a $libdir != /usr/lib32; then
LDFLAGS="$LDFLAGS -L$libdir"
fi
usage ()
{
@@ -100,13 +107,13 @@ while test $# -gt 0; do
if test $image = no; then
echo -lcups $LIBS
else
echo -lcupsimage $IMGLIBS -lcups $LIBS
echo -lcupsimage -lcups $IMGLIBS $LIBS
fi
else
if test $image = no; then
echo $libdir/libcups.a $LIBS
else
echo $libdir/libcupsimage.a $IMGLIBS $libdir/libcups.a $LIBS
echo $imagelibdir/libcupsimage.a $libdir/libcups.a $IMGLIBS $LIBS
fi
fi
;;
+324 -255
Ver Arquivo
@@ -1,255 +1,324 @@
# DO NOT DELETE
adminutil.o: adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
adminutil.o: language.h globals.h string.h ../config.h i18n.h normalize.h
adminutil.o: transcode.h debug.h
array.o: array.h string.h ../config.h debug.h
attr.o: ppd.h array.h file.h debug.h string.h ../config.h
auth.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
auth.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
backchannel.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
backend.o: backend.h string.h ../config.h
custom.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
custom.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
dest.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
dest.o: array.h file.h language.h i18n.h normalize.h transcode.h
dir.o: dir.h string.h ../config.h debug.h
emit.o: ppd.h array.h file.h string.h ../config.h
encode.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
encode.o: ipp-private.h string.h ../config.h debug.h
file.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h string.h
file.o: ../cups/debug.h file.h
getputfile.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.o: string.h ../config.h debug.h
globals.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
globals.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
globals.o: normalize.h transcode.h
http.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
http.o: string.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h
http.o: transcode.h debug.h
http-addr.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
http-addr.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
http-addrlist.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
http-addrlist.o: globals.h string.h cups.h ppd.h array.h file.h language.h
http-addrlist.o: i18n.h normalize.h transcode.h debug.h
http-support.o: debug.h globals.h string.h ../config.h cups.h ipp.h http.h
http-support.o: md5.h ppd.h array.h file.h language.h i18n.h normalize.h
http-support.o: transcode.h
ipp.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
ipp.o: string.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h
ipp.o: transcode.h debug.h
ipp-support.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
ipp-support.o: array.h file.h language.h i18n.h normalize.h transcode.h
ipp-support.o: debug.h
langprintf.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
langprintf.o: array.h file.h language.h i18n.h normalize.h transcode.h
language.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
language.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
localize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
localize.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
mark.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
mark.o: ../config.h debug.h
md5.o: md5.h string.h ../config.h
md5passwd.o: http.h md5.h string.h ../config.h
normalize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
normalize.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
notify.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
notify.o: array.h file.h language.h i18n.h normalize.h transcode.h
options.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
options.o: ../config.h debug.h
page.o: ppd.h array.h file.h string.h ../config.h
ppd.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h
ppd.o: file.h language.h i18n.h normalize.h transcode.h debug.h
request.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
snprintf.o: string.h ../config.h
string.o: debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.o: ppd.h array.h file.h language.h i18n.h normalize.h transcode.h
tempfile.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
transcode.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
transcode.o: array.h file.h language.h i18n.h normalize.h transcode.h
usersys.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
usersys.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
usersys.o: normalize.h transcode.h
util.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
util.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
testadmin.o: adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
testadmin.o: language.h string.h ../config.h
testarray.o: ../cups/string.h ../config.h string.h array.h dir.h debug.h
testfile.o: string.h ../config.h file.h debug.h
testhttp.o: http.h md5.h string.h ../config.h
testi18n.o: language.h array.h string.h ../config.h transcode.h normalize.h
testipp.o: ../cups/string.h ../config.h string.h ipp.h http.h md5.h
testlang.o: i18n.h language.h array.h
testppd.o: ../cups/string.h ../config.h string.h ppd.h array.h file.h
# DO NOT DELETE
adminutil.32.o: adminutil.c adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
adminutil.32.o: adminutil.c language.h globals.h string.h ../config.h i18n.h normalize.h
adminutil.32.o: adminutil.c transcode.h debug.h
array.32.o: array.c array.h string.h ../config.h debug.h
attr.32.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h
auth.32.o: auth.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
auth.32.o: auth.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
backchannel.32.o: backchannel.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
backend.32.o: backend.c backend.h string.h ../config.h
custom.32.o: custom.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
custom.32.o: custom.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
dest.32.o: dest.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
dest.32.o: dest.c array.h file.h language.h i18n.h normalize.h transcode.h
dir.32.o: dir.c dir.h string.h ../config.h debug.h
emit.32.o: emit.c ppd.h array.h file.h string.h ../config.h
encode.32.o: encode.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
encode.32.o: encode.c ipp-private.h string.h ../config.h debug.h
file.32.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h string.h
file.32.o: file.c ../cups/debug.h file.h
getputfile.32.o: getputfile.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.32.o: getputfile.c string.h ../config.h debug.h
globals.32.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
globals.32.o: globals.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
globals.32.o: globals.c normalize.h transcode.h
http.32.o: http.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
http.32.o: http.c string.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h
http.32.o: http.c transcode.h debug.h
http-addr.32.o: http-addr.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
http-addr.32.o: http-addr.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
http-addrlist.32.o: http-addrlist.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
http-addrlist.32.o: http-addrlist.c globals.h string.h cups.h ppd.h array.h file.h language.h
http-addrlist.32.o: http-addrlist.c i18n.h normalize.h transcode.h debug.h
http-support.32.o: http-support.c debug.h globals.h string.h ../config.h cups.h ipp.h http.h
http-support.32.o: http-support.c md5.h ppd.h array.h file.h language.h i18n.h normalize.h
http-support.32.o: http-support.c transcode.h
ipp.32.o: ipp.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
ipp.32.o: ipp.c string.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h
ipp.32.o: ipp.c transcode.h debug.h
ipp-support.32.o: ipp-support.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
ipp-support.32.o: ipp-support.c array.h file.h language.h i18n.h normalize.h transcode.h
ipp-support.32.o: ipp-support.c debug.h
langprintf.32.o: langprintf.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
langprintf.32.o: langprintf.c array.h file.h language.h i18n.h normalize.h transcode.h
language.32.o: language.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
language.32.o: language.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
localize.32.o: localize.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
localize.32.o: localize.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
mark.32.o: mark.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
mark.32.o: mark.c ../config.h debug.h
md5.32.o: md5.c md5.h string.h ../config.h
md5passwd.32.o: md5passwd.c http.h md5.h string.h ../config.h
normalize.32.o: normalize.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
normalize.32.o: normalize.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
notify.32.o: notify.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
notify.32.o: notify.c array.h file.h language.h i18n.h normalize.h transcode.h
options.32.o: options.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
options.32.o: options.c ../config.h debug.h
page.32.o: page.c ppd.h array.h file.h string.h ../config.h
ppd.32.o: ppd.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h
ppd.32.o: ppd.c file.h language.h i18n.h normalize.h transcode.h debug.h
request.32.o: request.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.32.o: request.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
snprintf.32.o: snprintf.c string.h ../config.h
string.32.o: string.c debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.32.o: string.c ppd.h array.h file.h language.h i18n.h normalize.h transcode.h
tempfile.32.o: tempfile.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.32.o: tempfile.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
transcode.32.o: transcode.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
transcode.32.o: transcode.c array.h file.h language.h i18n.h normalize.h transcode.h
usersys.32.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
usersys.32.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
usersys.32.o: usersys.c normalize.h transcode.h
util.32.o: util.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
util.32.o: util.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
testadmin.32.o: testadmin.c adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
testadmin.32.o: testadmin.c language.h string.h ../config.h
testarray.32.o: testarray.c ../cups/string.h ../config.h string.h array.h dir.h debug.h
testfile.32.o: testfile.c string.h ../config.h file.h debug.h
testhttp.32.o: testhttp.c http.h md5.h string.h ../config.h
testi18n.32.o: testi18n.c language.h array.h string.h ../config.h transcode.h normalize.h
testipp.32.o: testipp.c ../cups/string.h ../config.h string.h ipp.h http.h md5.h
testlang.32.o: testlang.c i18n.h language.h array.h
testppd.32.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h file.h
# DO NOT DELETE
adminutil.64.o: adminutil.c adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
adminutil.64.o: adminutil.c language.h globals.h string.h ../config.h i18n.h normalize.h
adminutil.64.o: adminutil.c transcode.h debug.h
array.64.o: array.c array.h string.h ../config.h debug.h
attr.64.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h
auth.64.o: auth.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
auth.64.o: auth.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
backchannel.64.o: backchannel.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
backend.64.o: backend.c backend.h string.h ../config.h
custom.64.o: custom.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
custom.64.o: custom.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
dest.64.o: dest.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
dest.64.o: dest.c array.h file.h language.h i18n.h normalize.h transcode.h
dir.64.o: dir.c dir.h string.h ../config.h debug.h
emit.64.o: emit.c ppd.h array.h file.h string.h ../config.h
encode.64.o: encode.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
encode.64.o: encode.c ipp-private.h string.h ../config.h debug.h
file.64.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h string.h
file.64.o: file.c ../cups/debug.h file.h
getputfile.64.o: getputfile.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
getputfile.64.o: getputfile.c string.h ../config.h debug.h
globals.64.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
globals.64.o: globals.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
globals.64.o: globals.c normalize.h transcode.h
http.64.o: http.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
http.64.o: http.c string.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h
http.64.o: http.c transcode.h debug.h
http-addr.64.o: http-addr.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
http-addr.64.o: http-addr.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
http-addrlist.64.o: http-addrlist.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
http-addrlist.64.o: http-addrlist.c globals.h string.h cups.h ppd.h array.h file.h language.h
http-addrlist.64.o: http-addrlist.c i18n.h normalize.h transcode.h debug.h
http-support.64.o: http-support.c debug.h globals.h string.h ../config.h cups.h ipp.h http.h
http-support.64.o: http-support.c md5.h ppd.h array.h file.h language.h i18n.h normalize.h
http-support.64.o: http-support.c transcode.h
ipp.64.o: ipp.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
ipp.64.o: ipp.c string.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h
ipp.64.o: ipp.c transcode.h debug.h
ipp-support.64.o: ipp-support.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
ipp-support.64.o: ipp-support.c array.h file.h language.h i18n.h normalize.h transcode.h
ipp-support.64.o: ipp-support.c debug.h
langprintf.64.o: langprintf.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
langprintf.64.o: langprintf.c array.h file.h language.h i18n.h normalize.h transcode.h
language.64.o: language.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
language.64.o: language.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
localize.64.o: localize.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
localize.64.o: localize.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
mark.64.o: mark.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
mark.64.o: mark.c ../config.h debug.h
md5.64.o: md5.c md5.h string.h ../config.h
md5passwd.64.o: md5passwd.c http.h md5.h string.h ../config.h
normalize.64.o: normalize.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
normalize.64.o: normalize.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
notify.64.o: notify.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
notify.64.o: notify.c array.h file.h language.h i18n.h normalize.h transcode.h
options.64.o: options.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
options.64.o: options.c ../config.h debug.h
page.64.o: page.c ppd.h array.h file.h string.h ../config.h
ppd.64.o: ppd.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h
ppd.64.o: ppd.c file.h language.h i18n.h normalize.h transcode.h debug.h
request.64.o: request.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.64.o: request.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
snprintf.64.o: snprintf.c string.h ../config.h
string.64.o: string.c debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.64.o: string.c ppd.h array.h file.h language.h i18n.h normalize.h transcode.h
tempfile.64.o: tempfile.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.64.o: tempfile.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
transcode.64.o: transcode.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
transcode.64.o: transcode.c array.h file.h language.h i18n.h normalize.h transcode.h
usersys.64.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
usersys.64.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
usersys.64.o: usersys.c normalize.h transcode.h
util.64.o: util.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
util.64.o: util.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
testadmin.64.o: testadmin.c adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
testadmin.64.o: testadmin.c language.h string.h ../config.h
testarray.64.o: testarray.c ../cups/string.h ../config.h string.h array.h dir.h debug.h
testfile.64.o: testfile.c string.h ../config.h file.h debug.h
testhttp.64.o: testhttp.c http.h md5.h string.h ../config.h
testi18n.64.o: testi18n.c language.h array.h string.h ../config.h transcode.h normalize.h
testipp.64.o: testipp.c ../cups/string.h ../config.h string.h ipp.h http.h md5.h
testlang.64.o: testlang.c i18n.h language.h array.h
testppd.64.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h file.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
adminutil.o: adminutil.c adminutil.h cups.h ipp.h http.h string.h \
../config.h ppd.h array.h file.h language.h globals.h string.h \
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
array.o: array.c array.h string.h ../config.h string.h debug.h
attr.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
auth.o: auth.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
backchannel.o: backchannel.c cups.h ipp.h http.h string.h ../config.h \
ppd.h array.h file.h language.h
backend.o: backend.c backend.h string.h ../config.h string.h
custom.o: custom.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
dest.o: dest.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h
dir.o: dir.c dir.h string.h ../config.h string.h debug.h
emit.o: emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
encode.o: encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
file.h language.h ipp-private.h string.h debug.h
file.o: file.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
getifaddrs.o: getifaddrs.c http-private.h ../config.h http.h string.h \
md5.h ipp-private.h ipp.h
getputfile.o: getputfile.c http-private.h ../config.h http.h string.h \
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
string.h debug.h
globals.o: globals.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
http.o: http.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
http-addr.o: http-addr.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
http-addrlist.o: http-addrlist.c http-private.h ../config.h http.h \
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
array.h file.h language.h i18n.h transcode.h debug.h
http-support.o: http-support.c debug.h globals.h string.h ../config.h \
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
array.h file.h language.h i18n.h transcode.h
ipp.o: ipp.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
ipp-support.o: ipp-support.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
langprintf.o: langprintf.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h
language.o: language.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
localize.o: localize.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
mark.o: mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
file.h language.h string.h debug.h
md5.o: md5.c md5.h string.h ../config.h string.h
md5passwd.o: md5passwd.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h string.h
notify.o: notify.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h
options.o: options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
array.h file.h language.h string.h debug.h
page.o: page.c ppd.h array.h file.h string.h ../config.h string.h
ppd.o: ppd.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
request.o: request.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
sidechannel.o: sidechannel.c sidechannel.h string.h ../config.h string.h
snprintf.o: snprintf.c string.h ../config.h string.h
string.o: string.c array.h debug.h string.h ../config.h string.h
tempfile.o: tempfile.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
transcode.o: transcode.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
usersys.o: usersys.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
util.o: util.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
testadmin.o: testadmin.c adminutil.h cups.h ipp.h http.h string.h \
../config.h ppd.h array.h file.h language.h string.h
testarray.o: testarray.c ../cups/string.h ../config.h string.h array.h \
dir.h debug.h
testcups.o: testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
array.h file.h language.h
testfile.o: testfile.c string.h ../config.h string.h file.h debug.h
testhttp.o: testhttp.c http.h string.h ../config.h string.h
testi18n.o: testi18n.c i18n.h transcode.h language.h array.h string.h \
../config.h string.h
testipp.o: testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
ipp.h http.h
testlang.o: testlang.c i18n.h transcode.h language.h array.h string.h \
../config.h string.h
testppd.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
file.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
adminutil.32.o: adminutil.c adminutil.c adminutil.h cups.h ipp.h http.h string.h \
../config.h ppd.h array.h file.h language.h globals.h string.h \
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
array.32.o: array.c array.c array.h string.h ../config.h string.h debug.h
attr.32.o: attr.c attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
auth.32.o: auth.c auth.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
backchannel.32.o: backchannel.c backchannel.c cups.h ipp.h http.h string.h ../config.h \
ppd.h array.h file.h language.h
backend.32.o: backend.c backend.c backend.h string.h ../config.h string.h
custom.32.o: custom.c custom.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
dest.32.o: dest.c dest.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h
dir.32.o: dir.c dir.c dir.h string.h ../config.h string.h debug.h
emit.32.o: emit.c emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
encode.32.o: encode.c encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
file.h language.h ipp-private.h string.h debug.h
file.32.o: file.c file.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
getifaddrs.32.o: getifaddrs.c getifaddrs.c http-private.h ../config.h http.h string.h \
md5.h ipp-private.h ipp.h
getputfile.32.o: getputfile.c getputfile.c http-private.h ../config.h http.h string.h \
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
string.h debug.h
globals.32.o: globals.c globals.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
http.32.o: http.c http.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
http-addr.32.o: http-addr.c http-addr.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
http-addrlist.32.o: http-addrlist.c http-addrlist.c http-private.h ../config.h http.h \
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
array.h file.h language.h i18n.h transcode.h debug.h
http-support.32.o: http-support.c http-support.c debug.h globals.h string.h ../config.h \
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
array.h file.h language.h i18n.h transcode.h
ipp.32.o: ipp.c ipp.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
ipp-support.32.o: ipp-support.c ipp-support.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
langprintf.32.o: langprintf.c langprintf.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h
language.32.o: language.c language.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
localize.32.o: localize.c localize.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
mark.32.o: mark.c mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
file.h language.h string.h debug.h
md5.32.o: md5.c md5.c md5.h string.h ../config.h string.h
md5passwd.32.o: md5passwd.c md5passwd.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h string.h
notify.32.o: notify.c notify.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h
options.32.o: options.c options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
array.h file.h language.h string.h debug.h
page.32.o: page.c page.c ppd.h array.h file.h string.h ../config.h string.h
ppd.32.o: ppd.c ppd.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
request.32.o: request.c request.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
sidechannel.32.o: sidechannel.c sidechannel.c sidechannel.h string.h ../config.h string.h
snprintf.32.o: snprintf.c snprintf.c string.h ../config.h string.h
string.32.o: string.c string.c array.h debug.h string.h ../config.h string.h
tempfile.32.o: tempfile.c tempfile.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
transcode.32.o: transcode.c transcode.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
usersys.32.o: usersys.c usersys.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
util.32.o: util.c util.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
testadmin.32.o: testadmin.c testadmin.c adminutil.h cups.h ipp.h http.h string.h \
../config.h ppd.h array.h file.h language.h string.h
testarray.32.o: testarray.c testarray.c ../cups/string.h ../config.h string.h array.h \
dir.h debug.h
testcups.32.o: testcups.c testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
array.h file.h language.h
testfile.32.o: testfile.c testfile.c string.h ../config.h string.h file.h debug.h
testhttp.32.o: testhttp.c testhttp.c http.h string.h ../config.h string.h
testi18n.32.o: testi18n.c testi18n.c i18n.h transcode.h language.h array.h string.h \
../config.h string.h
testipp.32.o: testipp.c testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
ipp.h http.h
testlang.32.o: testlang.c testlang.c i18n.h transcode.h language.h array.h string.h \
../config.h string.h
testppd.32.o: testppd.c testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
file.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
adminutil.64.o: adminutil.c adminutil.c adminutil.h cups.h ipp.h http.h string.h \
../config.h ppd.h array.h file.h language.h globals.h string.h \
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
array.64.o: array.c array.c array.h string.h ../config.h string.h debug.h
attr.64.o: attr.c attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
auth.64.o: auth.c auth.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
backchannel.64.o: backchannel.c backchannel.c cups.h ipp.h http.h string.h ../config.h \
ppd.h array.h file.h language.h
backend.64.o: backend.c backend.c backend.h string.h ../config.h string.h
custom.64.o: custom.c custom.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
dest.64.o: dest.c dest.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h
dir.64.o: dir.c dir.c dir.h string.h ../config.h string.h debug.h
emit.64.o: emit.c emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
encode.64.o: encode.c encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
file.h language.h ipp-private.h string.h debug.h
file.64.o: file.c file.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
getifaddrs.64.o: getifaddrs.c getifaddrs.c http-private.h ../config.h http.h string.h \
md5.h ipp-private.h ipp.h
getputfile.64.o: getputfile.c getputfile.c http-private.h ../config.h http.h string.h \
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
string.h debug.h
globals.64.o: globals.c globals.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
http.64.o: http.c http.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
http-addr.64.o: http-addr.c http-addr.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
http-addrlist.64.o: http-addrlist.c http-addrlist.c http-private.h ../config.h http.h \
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
array.h file.h language.h i18n.h transcode.h debug.h
http-support.64.o: http-support.c http-support.c debug.h globals.h string.h ../config.h \
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
array.h file.h language.h i18n.h transcode.h
ipp.64.o: ipp.c ipp.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
ipp-support.64.o: ipp-support.c ipp-support.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
langprintf.64.o: langprintf.c langprintf.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h
language.64.o: language.c language.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
localize.64.o: localize.c localize.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
mark.64.o: mark.c mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
file.h language.h string.h debug.h
md5.64.o: md5.c md5.c md5.h string.h ../config.h string.h
md5passwd.64.o: md5passwd.c md5passwd.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h string.h
notify.64.o: notify.c notify.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h
options.64.o: options.c options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
array.h file.h language.h string.h debug.h
page.64.o: page.c page.c ppd.h array.h file.h string.h ../config.h string.h
ppd.64.o: ppd.c ppd.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
request.64.o: request.c request.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
sidechannel.64.o: sidechannel.c sidechannel.c sidechannel.h string.h ../config.h string.h
snprintf.64.o: snprintf.c snprintf.c string.h ../config.h string.h
string.64.o: string.c string.c array.h debug.h string.h ../config.h string.h
tempfile.64.o: tempfile.c tempfile.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
transcode.64.o: transcode.c transcode.c globals.h string.h ../config.h string.h \
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
file.h language.h i18n.h transcode.h debug.h
usersys.64.o: usersys.c usersys.c http-private.h ../config.h http.h string.h md5.h \
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
language.h i18n.h transcode.h debug.h
util.64.o: util.c util.c globals.h string.h ../config.h string.h http-private.h \
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
i18n.h transcode.h debug.h
testadmin.64.o: testadmin.c testadmin.c adminutil.h cups.h ipp.h http.h string.h \
../config.h ppd.h array.h file.h language.h string.h
testarray.64.o: testarray.c testarray.c ../cups/string.h ../config.h string.h array.h \
dir.h debug.h
testcups.64.o: testcups.c testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
array.h file.h language.h
testfile.64.o: testfile.c testfile.c string.h ../config.h string.h file.h debug.h
testhttp.64.o: testhttp.c testhttp.c http.h string.h ../config.h string.h
testi18n.64.o: testi18n.c testi18n.c i18n.h transcode.h language.h array.h string.h \
../config.h string.h
testipp.64.o: testipp.c testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
ipp.h http.h
testlang.64.o: testlang.c testlang.c i18n.h transcode.h language.h array.h string.h \
../config.h string.h
testppd.64.o: testppd.c testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
file.h
+69 -52
Ver Arquivo
@@ -3,23 +3,14 @@
#
# API library Makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 2007 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636 USA
#
# Voice: (301) 373-9600
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
# 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/".
#
# This file is subject to the Apple OS-Developed Software exception.
#
@@ -43,6 +34,7 @@ LIBOBJS = \
emit.o \
encode.o \
file.o \
getifaddrs.o \
getputfile.o \
globals.o \
http.o \
@@ -57,12 +49,12 @@ LIBOBJS = \
mark.o \
md5.o \
md5passwd.o \
normalize.o \
notify.o \
options.o \
page.o \
ppd.o \
request.o \
sidechannel.o \
snprintf.o \
string.o \
tempfile.o \
@@ -77,6 +69,7 @@ OBJS = \
$(LIB64OBJS) \
testadmin.o \
testarray.o \
testcups.o \
testfile.o \
testhttp.o \
testi18n.o \
@@ -93,6 +86,7 @@ OBJS = \
HEADERS = \
adminutil.h \
array.h \
backend.h \
cups.h \
dir.h \
file.h \
@@ -100,9 +94,8 @@ HEADERS = \
i18n.h \
ipp.h \
language.h \
md5.h \
normalize.h \
ppd.h \
sidechannel.h \
transcode.h
@@ -117,6 +110,7 @@ TARGETS = \
libcups.a \
testadmin \
testarray \
testcups \
testfile \
testhttp \
testi18n \
@@ -138,7 +132,8 @@ all: $(TARGETS)
clean:
$(RM) $(OBJS) $(TARGETS)
$(RM) libcups.so libcups.sl libcups.dylib libcups.32.so libcups.64.so
$(RM) libcups.so libcups.sl libcups.dylib
$(RM) -r 32bit 64bit
#
@@ -171,13 +166,17 @@ install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
$(RM) $(LIBDIR)/libcups.dylib; \
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
fi
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(TARGETS); do \
cp $$file $(SYMROOT); \
done \
fi
installstatic:
$(INSTALL_DIR) -m 755 $(LIBDIR)
if test $(LIBCUPS) != "libcups.a"; then \
$(INSTALL_LIB) libcups.a $(LIBDIR); \
$(RANLIB) $(LIBDIR)/libcups.a; \
fi
$(INSTALL_LIB) libcups.a $(LIBDIR)
$(RANLIB) $(LIBDIR)/libcups.a
installhdrs:
$(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
@@ -187,13 +186,13 @@ installhdrs:
install32bit:
$(INSTALL_DIR) -m 755 $(LIB32DIR)
$(INSTALL_LIB) libcups.32.so.2 $(LIB32DIR)/libcups.so.2
$(LN) libcups.so $(LIB32DIR)/libcups.so.2
$(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
$(LN) libcups.so.2 $(LIB32DIR)/libcups.so
install64bit:
$(INSTALL_DIR) -m 755 $(LIB64DIR)
$(INSTALL_LIB) libcups.64.so.2 $(LIB64DIR)/libcups.so.2
$(LN) libcups.so $(LIB64DIR)/libcups.so.2
$(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
$(LN) libcups.so.2 $(LIB64DIR)/libcups.so
#
@@ -232,40 +231,48 @@ uninstall64bit:
libcups.so.2 libcups.sl.2: $(LIBOBJS)
echo Linking $@...
$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
#
# libcups.32.so.2
# 32bit/libcups.so.2
#
libcups.32.so.2: $(LIB32OBJS)
32bit/libcups.so.2: $(LIB32OBJS)
echo Linking 32-bit $@...
$(DSO) $(C32FLAGS) $(DSOFLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-mkdir 32bit
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 32bit/libcups.so
$(LN) libcups.so.2 32bit/libcups.so
#
# libcups.64.so.2
# 64bit/libcups.so.2
#
libcups.64.so.2: $(LIB64OBJS)
64bit/libcups.so.2: $(LIB64OBJS)
echo Linking 64-bit $@...
$(DSO) $(C64FLAGS) $(DSOFLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-mkdir 64bit
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 64bit/libcups.so
$(LN) libcups.so.2 64bit/libcups.so
#
# libcups.2.dylib
#
libcups.2.dylib: $(LIBOBJS)
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
echo Linking $@...
$(DSO) $(DSOFLAGS) -o $@ \
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 2.7.0 \
-current_version 2.8.0 \
-compatibility_version 2.0.0 \
$(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-exported_symbols_list libcups.exp \
-sectorder __TEXT __text $(LIBCUPSORDER) \
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) libcups.dylib
$(LN) $@ libcups.dylib
@@ -274,9 +281,9 @@ libcups.2.dylib: $(LIBOBJS)
# libcups_s.a
#
libcups_s.a: $(LIBOBJS)
libcups_s.a: $(LIBOBJS) libcups_s.exp
echo Creating $@...
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
$(RM) $@
$(AR) $(ARFLAGS) $@ libcups_s.o
@@ -287,8 +294,8 @@ libcups_s.a: $(LIBOBJS)
libcups.la: $(LIBOBJS)
echo Linking $@...
$(CC) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:7 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -333,7 +340,7 @@ php_cups_wrap.c: cups.h
testadmin: testadmin.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -343,7 +350,17 @@ testadmin: testadmin.o libcups.a
testarray: testarray.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
# testcups (dependency on static CUPS library is intentional)
#
testcups: testcups.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -353,7 +370,7 @@ testarray: testarray.o libcups.a
testfile: testfile.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -363,7 +380,7 @@ testfile: testfile.o libcups.a
testhttp: testhttp.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -373,7 +390,7 @@ testhttp: testhttp.o libcups.a
testipp: testipp.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -383,7 +400,7 @@ testipp: testipp.o libcups.a
testi18n: testi18n.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -393,7 +410,7 @@ testi18n: testi18n.o libcups.a
testlang: testlang.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -403,7 +420,7 @@ testlang: testlang.o libcups.a
testppd: testppd.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -417,7 +434,7 @@ apihelp:
array.h array.c >../doc/help/api-array.html
mxmldoc --section "Programming" --title "CUPS API" \
--intro api-cups.shtml \
cups.h dest.c getputfile.c language.c \
cups.h dest.c getputfile.c language.c notify.c \
options.c tempfile.c usersys.c \
util.c >../doc/help/api-cups.html
mxmldoc --section "Programming" --title "File and Directory APIs" \
@@ -425,7 +442,7 @@ apihelp:
file.h file.c dir.h dir.c >../doc/help/api-filedir.html
mxmldoc --section "Programming" --title "PPD API" \
--intro api-ppd.shtml \
ppd.h attr.c emit.c mark.c page.c \
ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ppd.c >../doc/help/api-ppd.html
mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
--intro api-httpipp.shtml \
@@ -434,7 +451,7 @@ apihelp:
request.c >../doc/help/api-httpipp.html
mxmldoc --section "Programming" --title "Filter and Backend APIs" \
--intro api-filter.shtml \
backchannel.c >../doc/help/api-filter.html
backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html
#
+558 -139
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+13 -21
Ver Arquivo
@@ -7,23 +7,14 @@
* MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO
* CHANGE AT ANY TIME. USE AT YOUR OWN RISK.
*
* Copyright 2001-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636 USA
*
* Voice: (301) 373-9600
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
* 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/".
*
* This file is subject to the Apple OS-Developed Software exception.
*/
@@ -53,6 +44,7 @@ extern "C" {
# define CUPS_SERVER_DEBUG_LOGGING "_debug_logging"
# define CUPS_SERVER_REMOTE_ADMIN "_remote_admin"
# define CUPS_SERVER_REMOTE_ANY "_remote_any"
# define CUPS_SERVER_REMOTE_PRINTERS "_remote_printers"
# define CUPS_SERVER_SHARE_PRINTERS "_share_printers"
# define CUPS_SERVER_USER_CANCEL_ANY "_user_cancel_any"
@@ -70,12 +62,12 @@ extern int cupsAdminExportSamba(const char *dest, const char *ppd,
extern char *cupsAdminCreateWindowsPPD(http_t *http, const char *dest,
char *buffer, int bufsize);
extern int _cupsAdminGetServerSettings(http_t *http,
int *num_settings,
cups_option_t **settings);
extern int _cupsAdminSetServerSettings(http_t *http,
int num_settings,
cups_option_t *settings);
extern int cupsAdminGetServerSettings(http_t *http,
int *num_settings,
cups_option_t **settings);
extern int cupsAdminSetServerSettings(http_t *http,
int num_settings,
cups_option_t *settings);
# ifdef __cplusplus
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-array.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-array.shtml 6649 2007-07-11 21:46:42Z mike $"
Array API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
Copyright 2007 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
property of Easy Software Products and are protected by Federal
copyright law. Distribution and use rights are outlined in the file
"LICENSE.txt" which should have been included with this file. If this
file is missing or damaged please contact Easy Software Products
at:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
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/".
-->
<h2 class='title'>Introduction</h2>
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-cups.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-cups.shtml 6649 2007-07-11 21:46:42Z mike $"
CUPS API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
Copyright 2007 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
property of Easy Software Products and are protected by Federal
copyright law. Distribution and use rights are outlined in the file
"LICENSE.txt" which should have been included with this file. If this
file is missing or damaged please contact Easy Software Products
at:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
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/".
-->
<h2 class='title'>Introduction</h2>
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-filedir.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-filedir.shtml 6649 2007-07-11 21:46:42Z mike $"
File and directory API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2005 by Easy Software Products.
Copyright 2007 by Apple Inc.
Copyright 1997-2005 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 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
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/".
-->
<h2 class='title'>Introduction</h2>
+179 -17
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-filter.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-filter.shtml 6649 2007-07-11 21:46:42Z mike $"
Filter and backend API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
Copyright 2007 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
property of Easy Software Products and are protected by Federal
copyright law. Distribution and use rights are outlined in the file
"LICENSE.txt" which should have been included with this file. If this
file is missing or damaged please contact Easy Software Products
at:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
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/".
-->
<h2 class='title'>Introduction</h2>
@@ -35,6 +26,9 @@ used when writing backends, filters, and port monitors.</p>
use the <tt>CUPS_BACKEND_</tt> constants and
<tt>cupsBackChannel</tt> functions, respectively.</p>
<p>The <var>&lt;cups/sidechannel.h&gt;</var> header file must be
included to use the <tt>CUPS_SC_</tt> constants and <tt>cupsSideChannel</tt> functions.</p>
<p>Programs using these functions must be linked to the CUPS
library: <var>libcups.a</var>, <var>libcups.so.2</var>,
<var>libcups.2.dylib</var>, <var>libcups_s.a</var>, or
@@ -46,6 +40,174 @@ library:</p>
<kbd>gcc -o myprogram myprogram.c -lcups</kbd>
</pre>
<h2 class='title'>Compatibility</h2>
<p>All of these functions require CUPS 1.2 or higher.</p>
<p>The <tt>cupsBackChannel</tt> functions require CUPS 1.2 or higher. The <tt>cupsSideChannel</tt> functions require CUPS 1.3 or higher.</p>
<h2 class='title'>Using the cupsBackChannel APIs</h2>
<p>The <tt>cupsBackChannel</tt> APIs allow your filters, drivers, and port monitors to read data back from a printer and your backends to send data from a printer to the filters, drivers, and port monitors associated with the current job. Back-channel data is normally sent by the printer in response to a command sent from your program to the printer via <tt>stdout</tt>.</p>
<p>The <tt>cupsBackChannelRead()</tt> function reads data from the printer via the backend. You provide a timeout in seconds along with a buffer pointer and the size of that buffer. It returns the number of bytes or -1 if there was an error. The following code example shows how to poll for back-channel data in your program:</p>
<pre class='command'>
#include &lt;cups/cups.h&gt;
char buffer[8192];
ssize_t bytes;
/* Use a timeout of 0.0 seconds to poll for back-channel data */
bytes = cupsBackChannelRead(buffer, sizeof(buffer), 0.0);
</pre>
<p>If you are writing a backend, the <tt>cupsBackChannelWrite()</tt> function sends any back-channel data you have received from the printer to upstream filters in the print filter chain. We recommend using a timeout of 1.0 seconds:</p>
<pre class='command'>
#include &lt;cups/cups.h&gt;
char buffer[8192];
ssize_t bytes;
/* Use a timeout of 1.0 seconds to give filters a chance to read */
cupsBackChannelWrite(buffer, bytes, 1.0);
</pre>
<h2 class='title'>Using the cupsSideChannel APIs</h2>
<p>The <tt>cupsSideChannel</tt> APIs allow your filters, drivers, port monitors, and backend to send and receive the following out-of-band commands:</p>
<ul>
<li><tt>CUPS_SC_CMD_SOFT_RESET</tt> - Do a soft reset</li>
<li><tt>CUPS_SC_CMD_DRAIN_OUTPUT</tt> - Drain all pending output</li>
<li><tt>CUPS_SC_CMD_GET_BIDI</tt> - Return bidirectional capabilities</li>
<li><tt>CUPS_SC_CMD_GET_DEVICE_ID</tt> - Return the IEEE-1284 device ID</li>
<li><tt>CUPS_SC_CMD_GET_STATE</tt> - Return the device state</li>
</ul>
<h3>Sending Commands from a Filter, Driver, or Port Monitor</h3>
<p>The <tt>cupsSideChannelDoRequest()</tt> function is used by filters, drivers, and port monitors to send a command to the backend and read back a response:</p>
<pre class='command'>
cups_sc_status_t cupsSideChannelDoRequest(cups_sc_command_t command,
char *data, int *datalen,
double timeout);
</pre>
<p>The <tt>CUPS_SC_CMD_SOFT_RESET</tt> and <tt>CUPS_SC_CMD_DRAIN_OUTPUT</tt> commands do not return any data values, while the others return one or more bytes. The <tt>timeout</tt> parameter allows your program to poll or wait for the command to complete - use a timeout of 30 seconds for <tt>CUPS_SC_CMD_SOFT_RESET</tt> and <tt>CUPS_SC_CMD_DRAIN_OUTPUT</tt> and a timeout of 1 second for all other commands.</p>
<p><tt>CUPS_SC_CMD_GET_BIDI</tt> returns a single <tt>char</tt> value that tells you whether the backend supports bidirectional communications:</p>
<pre class='command'>
#include &lt;cups/sidechannel.h&gt;
char data;
int datalen;
cups_sc_bidi_t bidi;
cups_sc_status_t status;
/* Tell cupsSideChannelDoRequest() how big our buffer is... */
datalen = 1;
/* Get the bidirectional capabilities, waiting for up to 1 second */
status = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_BIDI, &amp;data, &amp;datalen, 1.0);
/* Use the returned value if OK was returned and the length is still 1 */
if (status == CUPS_SC_STATUS_OK && datalen == 1)
bidi = (cups_sc_bidi_t)data;
else
bidi = CUPS_SC_BIDI_NOT_SUPPORTED;
</pre>
<p><tt>CUPS_SC_CMD_GET_DEVICE_ID</tt> returns a string of characters containing the IEEE-1284 device ID for the connected printer:</p>
<pre class='command'>
#include &lt;cups/sidechannel.h&gt;
char data[2049];
int datalen;
cups_sc_status_t status;
/* Tell cupsSideChannelDoRequest() how big our buffer is, less 1 byte for nul-termination... */
datalen = sizeof(data) - 1;
/* Get the IEEE-1284 device ID, waiting for up to 1 second */
status = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_DEVICE_ID, data, &amp;datalen, 1.0);
/* Use the returned value if OK was returned and the length is non-zero */
if (status == CUPS_SC_STATUS_OK && datalen > 0)
data[datalen] = '\0';
else
data[0] = '\0';
</pre>
<p><tt>CUPS_SC_CMD_GET_STATE</tt> returns a single <tt>char</tt> value that tells you the current device state:</p>
<pre class='command'>
#include &lt;cups/sidechannel.h&gt;
char data;
int datalen;
cups_sc_state_t state;
cups_sc_status_t status;
/* Tell cupsSideChannelDoRequest() how big our buffer is... */
datalen = 1;
/* Get the bidirectional capabilities, waiting for up to 1 second */
status = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_STATE, &amp;data, &amp;datalen, 1.0);
/* Use the returned value if OK was returned and the length is still 1 */
if (status == CUPS_SC_STATUS_OK && datalen == 1)
state = (cups_sc_state_t)data;
else
state = CUPS_SC_STATE_OFFLINE;
</pre>
<h3>Handling Commands in your Backend</h3>
<p>The <tt>cupsSideChannelRead()</tt> function is used by backends to read a command from a filter, driver, or port monitor:</p>
<pre class='command'>
int cupsSideChannelRead(cups_sc_command_t &amp;command,
cups_sc_status_t &amp;status,
char *data, int *datalen, double timeout);
</pre>
<p>Backends can either poll for commands using a <tt>timeout</tt> of 0.0, wait indefinitely for commands using a <tt>timeout</tt> of -1.0 (probably in a separate thread for that purpose), or use <tt>select()</tt> or <tt>poll()</tt> on the <tt>CUPS_SC_FD</tt> file descriptor (4) to handle input and output on several file descriptors at the same time. Backends can pass <tt>NULL</tt> for the <tt>data</tt> and <tt>datalen</tt> parameters, since none of the commands sent by upstream filters contain any data at this time.</p>
<p>Once a command is processed, the backend uses the <tt>cupsSideChannelWrite()</tt> function to send its response:</p>
<pre class='command'>
#include &lt;cups/sidechannel.h&gt;
cups_sc_command_t command;
cups_sc_status_t status;
/* Poll for a command... */
if (!cupsSideChannelRead(&amp;command, &amp;status, NULL, NULL, 0.0))
{
char data[2048];
int datalen;
switch (command)
{
... handle supported commands, file data/datalen/status with values as needed ...
default :
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
datalen = 0;
break;
}
/* Send a response... */
cupsSideChannelWrite(command, status, data, datalen, 1.0);
}
</pre>
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-httpipp.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-httpipp.shtml 6649 2007-07-11 21:46:42Z mike $"
HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
Copyright 2007 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
property of Easy Software Products and are protected by Federal
copyright law. Distribution and use rights are outlined in the file
"LICENSE.txt" which should have been included with this file. If this
file is missing or damaged please contact Easy Software Products
at:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
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/".
-->
<h2 class='title'>Introduction</h2>
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-ppd.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-ppd.shtml 6649 2007-07-11 21:46:42Z mike $"
PPD API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
Copyright 2007 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
property of Easy Software Products and are protected by Federal
copyright law. Distribution and use rights are outlined in the file
"LICENSE.txt" which should have been included with this file. If this
file is missing or damaged please contact Easy Software Products
at:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
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/".
-->
<h2 class='title'>Introduction</h2>

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