Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 6317446a4b |
-1261
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+445
-317
@@ -1,329 +1,457 @@
|
||||
CHANGES.txt - 2007-09-28
|
||||
CHANGES.txt - 2006-04-07
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.3.3
|
||||
CHANGES IN CUPS V1.2
|
||||
|
||||
- The scheduler did not use the attributes-natural-language
|
||||
attribute when passing the LANG environment variable to
|
||||
cups-deviced or cups-driverd.
|
||||
- The scheduler did not use the printer-op-policy when
|
||||
modifying classes or printers (STR #2525)
|
||||
- The auth-info-required attribute was not always updated
|
||||
for remote queues that required authentication.
|
||||
- The German web interface localization contained errors
|
||||
(STR #2523)
|
||||
- The Swedish localization contained errors (STR #2522)
|
||||
- The scheduler was not always using the string pool,
|
||||
causing random crashes.
|
||||
- The lpmove and the web interface's Move Job button did
|
||||
not work with stopped jobs (STR #1534)
|
||||
- The PostScript filter did not handle the page-set
|
||||
option properly with number-up printing (STR #1543)
|
||||
- The scheduler now only warns about unsupported ACLs
|
||||
once (STR #1532)
|
||||
- The "fitplot" option did not work with output from
|
||||
Mozilla (STR #1542)
|
||||
- The imagetops filter did not work with Level 2 or 3
|
||||
printers (STR #1533)
|
||||
- The scheduler now recognizes PostScript files with PJL
|
||||
commands that do not include an ENTER LANGUAGE command.
|
||||
- Added --with-printcap configure option.
|
||||
- 64-bit SSL fixes for MacOS X.
|
||||
- The scheduler didn't send some printer state change
|
||||
events.
|
||||
- The scheduler didn't send jobs to busy remote printers.
|
||||
- Fixed some problems with the launchd support.
|
||||
- Added new USB printer backend for MacOS X.
|
||||
- The PostScript filter now handles files that start with
|
||||
an incomplete PJL header (PR #6076)
|
||||
- The web interface language selection code did not try
|
||||
the generic language localization (STR #1531)
|
||||
- The language cache, string pool, and transcoding caches
|
||||
are now process global instead of per-thread to avoid
|
||||
problems with GNOME and to allow for data sharing
|
||||
between threads (STR #1530)
|
||||
- Fixed a CUPS 1.1.x compatibility bug (STR #1528)
|
||||
- The web interface redirection after certain printer
|
||||
administration tasks was broken (STR #1516)
|
||||
- Web interface authorization could get stuck (STR #1512)
|
||||
- Localization updates (STR #1513, STR #1518, STR #1520)
|
||||
- The pstops filter didn't work with some files (STR
|
||||
#1523)
|
||||
- "./configure --enable-static" didn't work (STR #1522)
|
||||
- The scheduler was not using the configured default
|
||||
Group (STR #1521)
|
||||
- The web interface still did not show the localized time
|
||||
and date for some locales and systems (STR #1509)
|
||||
- httpAddrGetList() would crash on systems without
|
||||
getaddrinfo().
|
||||
- Socket URIs without a trailing slash would cause the
|
||||
port number to not be accepted (STR #1519)
|
||||
- Local raw and System V printers were not advertised as
|
||||
such for printer browsing (STR #1502)
|
||||
- The RPM spec file incorrectly put duplicate copies of
|
||||
the Japanese and Spanish web interface templates in the
|
||||
main cups package (STR #1517)
|
||||
- cupsSetDests() did not explicitly set the permissions
|
||||
of the /etc/cups/lpoptions file (STR #1508)
|
||||
- The lpq command crashed with the -h option (STR #1515)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.2
|
||||
CHANGES IN CUPS V1.2rc1
|
||||
|
||||
- The 1.3.1 release was incorrectly created from the
|
||||
1.4.x source tree (STR #2519)
|
||||
- Added support for 32/64-bit libraries on HP-UX
|
||||
(STR #2520)
|
||||
- The scheduler incorrectly used portrait as the default
|
||||
orientation (STR #2513)
|
||||
- The scheduler no longer writes the printcap file for
|
||||
every remote printer update (STR #2512)
|
||||
- Remote raw printing with multiple copies did not work
|
||||
(STR #2518)
|
||||
- Updated the configure script to require at least autoconf
|
||||
2.60 (STR #2515)
|
||||
- Some gzip'd PPD files were not read in their entirety
|
||||
(STR #2510)
|
||||
- Documentation updates (STR #1497, STR #1498)
|
||||
- The scheduler now redirects browsers to https: URLs
|
||||
when encryption is required.
|
||||
- The scheduler would crash when printing with a banner
|
||||
(STR #1500)
|
||||
- cups-driverd did not use the LanguageEncoding attribute
|
||||
in PPD files to convert the NickName to UTF-8 (STR
|
||||
#1503)
|
||||
- The lpadmin command could not set the
|
||||
printer-error-policy attribute (STR #1504)
|
||||
- The web interface did not show the time and date in the
|
||||
correct format for the locale (STR #1505)
|
||||
- CUPS no longer accepts print jobs if a printer does not
|
||||
support the file format (STR #1501)
|
||||
- Cleaned up the PostScript filter (pstops) so that it
|
||||
properly supports %%IncludeFeature and page scaling
|
||||
(STR #1453)
|
||||
- Fixed the cupsFileRewind() and cupsFileSeek() functions
|
||||
to work properly with uncompressed files.
|
||||
- Added cupsFileGetLine(), cupsFileStderr(),
|
||||
cupsFileStdin(), and cupsFileStdout() functions to the
|
||||
CUPS library.
|
||||
- Added a new cupstestdsc program to test the DSC
|
||||
conformance of PostScript files.
|
||||
- Added KDE/GNOME icons and a Manage Printers menu item.
|
||||
- Added --enable-image and --enable-pdftops configure
|
||||
options to control whether the image and PDF filters
|
||||
are built and installed (default = yes for all
|
||||
platforms but MacOS X)
|
||||
- Fixed a minor memory leak in the PPD API.
|
||||
- Fixed transcoding issues (STR #1493)
|
||||
- The scheduler now enforces a minimum job cost of 100
|
||||
when doing FilterLimit checks.
|
||||
- The scheduler would leak file descriptors when printing
|
||||
to raw queues (STR #1491)
|
||||
- The IPv6 support did not compile on Tru64 UNIX (STR
|
||||
#1488)
|
||||
- ppdOpen2() now converts the NickName and all UI text to
|
||||
UTF-8 (STR #1475)
|
||||
- The Set Allows Users web page did not work (STR #1486)
|
||||
- When the default policy was not set or set to a non-
|
||||
existing policy, the scheduler did not set the default
|
||||
policy name to "default" (STR #1484)
|
||||
- The Zebra CPCL driver did not use the correct righthand
|
||||
margin for the 4" wide label sizes.
|
||||
- Fixed a problem with the parsing of fractional real
|
||||
numbers in PPD files.
|
||||
- Added Spanish localization files (STR #1480)
|
||||
- Fixed localization of a few scheduler messages (STR
|
||||
#1478)
|
||||
- Fixed support for HEAD requests in the scheduler (STR
|
||||
#1481)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.1
|
||||
CHANGES IN CUPS V1.2b2
|
||||
|
||||
- Documentation updates.
|
||||
- The USB backend on Mac OS X could hang if the driver and
|
||||
printer did not match.
|
||||
- Delegated Kerberos credentials were not working.
|
||||
- "make distclean" incorrectly removed the edit-config.tmpl
|
||||
files (STR #2508)
|
||||
- Fix compile problem on HP-UX (STR #2501)
|
||||
- The cupstestppd utility now tests for resolutions greater
|
||||
than 99999 DPI to detect a missing "x" between the X and Y
|
||||
resolutions.
|
||||
- Fixed many problems in the various translations and added
|
||||
a new "checkpo" utility to validate them.
|
||||
- The cupstestppd utility now tests the custom page size code
|
||||
for CUPS raster drivers.
|
||||
- cupsLangDefault() did not attempt to return a language that
|
||||
was supported by the calling application.
|
||||
- If a remote printer stopped while a job was being sent, the
|
||||
local queue would also get stopped and the job re-queued,
|
||||
resulting in duplicate prints in some cases.
|
||||
- A few Apple-specific job options needed to be omitted when
|
||||
printing a banner page.
|
||||
- The new peer credential support did not compile on FreeBSD
|
||||
(STR #2495)
|
||||
- Direct links to help files did not set the current section
|
||||
so the table-of-contents was not shown.
|
||||
- The configure script did not support --localedir=foo (STR #2488)
|
||||
- The backends were not displaying their localized messages.
|
||||
- CUPS-Authenticate-Job did not require Kerberos authentication
|
||||
on queues protected by Kerberos.
|
||||
- The Zebra ZPL driver did not work with Brady label printers
|
||||
(STR #2487)
|
||||
- Norwegian wasn't localized on Mac OS X.
|
||||
- getnameinfo() returns an error on some systems when DNS is
|
||||
not available, leading to numerous problems (STR #2486)
|
||||
- The cupsfilter command did not work properly on Mac OS X.
|
||||
- The scheduler makefile contained a typo (STR #2483)
|
||||
- The TBCP and BCP port monitors did not handle the trailing
|
||||
CTRL-D in some PostScript output properly.
|
||||
- Fixed the localization instructions and German template for
|
||||
the "Find New Printers" button (STR #2478)
|
||||
- The web interface did not work with the Chinese localization
|
||||
(STR #2477)
|
||||
- The web interface home page did not work for languages that
|
||||
were only partially localized (STR #2472)
|
||||
- Updated the Spanish web interface localization (STR #2473)
|
||||
- ppdLocalize() did not work for country-specific localizations.
|
||||
- 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)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.0
|
||||
CHANGES IN CUPS V1.2b1
|
||||
|
||||
- The scheduler did not handle out-of-file conditions
|
||||
gracefully when accepting new connections, leading to
|
||||
heavy CPU usage.
|
||||
- The scheduler did not detect ServerBin misconfigurations
|
||||
(STR #2470)
|
||||
- "AuthType Default" did not work as expected when the
|
||||
"DefaultAuthType foo" line appeared after it in the
|
||||
cupsd.conf file.
|
||||
- The on-line help did not describe many common printing
|
||||
options (STR #1846)
|
||||
- The IPP backend did not return the "auth required" status
|
||||
when printing to a Kerberos-protected queue.
|
||||
- The scheduler was not looking in the correct directories
|
||||
for LSB PPD files (STR #2464)
|
||||
- Changed references to ESP Ghostscript to GPL Ghostscript
|
||||
(STR #2463)
|
||||
- The PostScript filter did not cleanly terminate when
|
||||
the job was canceled or stopped.
|
||||
- Fixed generation of Kerberos credentials for remote
|
||||
printing. Note that this requires a recent version of
|
||||
MIT Kerberos with a working krb5_cc_new_unique()
|
||||
function or Heimdal Kerberos.
|
||||
- Added Portuguese and updated Italian message catalogs.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3rc2
|
||||
|
||||
- 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.3rc1
|
||||
|
||||
- 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.
|
||||
- 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.
|
||||
|
||||
+6
-11
@@ -1,4 +1,4 @@
|
||||
CREDITS.txt - 2007-09-10
|
||||
CREDITS.txt - 2006-02-23
|
||||
------------------------
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
@@ -6,7 +6,6 @@ like to thank the following individuals for their contributions:
|
||||
|
||||
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.
|
||||
@@ -19,28 +18,24 @@ like to thank the following individuals for their contributions:
|
||||
Till Kamppeter - Bug fixes, beta testing, evangelism.
|
||||
Kenshi Muto - Japanese localization, patches, and
|
||||
testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
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.
|
||||
Ulrich Oldendorf - German locale.
|
||||
Giulio Orsero - Bug fixes and testing.
|
||||
Michal Osowiecki - Polish localization.
|
||||
Kurt Pfeifle - Bug fixes, beta testing, evangelism.
|
||||
Vincenzo Reale - Italian localization.
|
||||
Gilles QUERRET - French man pages.
|
||||
Petter Reinholdtsen - HP-UX compiler stuff.
|
||||
Juan Pablo González Riopedre - Spanish localization.
|
||||
Opher Shachar - Hebrew localization.
|
||||
Juan Pablo González Riopedre - Spanish localization
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
Teppo Turlianen - Finnish localization.
|
||||
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
|
||||
"msweet@apple.com".
|
||||
"mike@easysw.com".
|
||||
|
||||
+7
-15
@@ -1,15 +1,13 @@
|
||||
INSTALL - CUPS v1.3.2 - 2007-09-18
|
||||
----------------------------------
|
||||
INSTALL - CUPS v1.2rc1 - 2006-03-24
|
||||
-----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source
|
||||
code. For more information on CUPS see the file called
|
||||
"README.txt". A complete change log can be found in
|
||||
"CHANGES.txt".
|
||||
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT ****
|
||||
**** RUNNING MAC OS X, YOU WILL ALSO NEED TO INSTALL GPL ****
|
||||
**** GHOSTSCRIPT WITH THE "cups" DRIVER AFTER YOU INSTALL ****
|
||||
**** CUPS. ****
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER, YOU WILL ALSO ****
|
||||
**** NEED TO INSTALL ESP GHOSTSCRIPT AFTER YOU INSTALL CUPS ****
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
@@ -22,7 +20,7 @@ BEFORE YOU BEGIN
|
||||
The makefiles used by the project should work with all
|
||||
versions of make. We've tested them with GNU make as well as
|
||||
the make programs shipped by Compaq, HP, SGI, and Sun.
|
||||
BSD users should use GNU make (gmake).
|
||||
FreeBSD users should use GNU make (gmake).
|
||||
|
||||
Besides these tools you'll want the JPEG, PNG, TIFF, and ZLIB
|
||||
libraries for image support, the CDSA, GNU TLS, or OpenSSL
|
||||
@@ -31,16 +29,10 @@ BEFORE YOU BEGIN
|
||||
compile and run without these, however you'll miss out on
|
||||
many of the features provided by CUPS.
|
||||
|
||||
Kerberos support requires a very recent version of the MIT
|
||||
implementation with the krb5_cc_new_unique() function or the
|
||||
Heimdal implementation, along with the corresponding GSSAPI
|
||||
pieces.
|
||||
|
||||
Also, please note that CUPS no longer includes the
|
||||
Ghostscript- based pstoraster filter. You *must* download
|
||||
GPL Ghostscript separately from the CUPS web site if you want
|
||||
to print PostScript files to non-PostScript printers on
|
||||
operating systems other than Mac OS X.
|
||||
ESP Ghostscript separately from the CUPS web site if you want
|
||||
to print PostScript files to non-PostScript printers.
|
||||
|
||||
|
||||
COMPILING FROM SUBVERSION
|
||||
|
||||
+61
-65
@@ -1,10 +1,12 @@
|
||||
Common UNIX Printing System License Agreement
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
1 Infinite Loop
|
||||
Cupertino, CA 95014 USA
|
||||
Copyright 1997-2006 by Easy Software Products
|
||||
44141 AIRPORT VIEW DR STE 204
|
||||
HOLLYWOOD, MARYLAND 20636 USA
|
||||
|
||||
WWW: http://www.cups.org/
|
||||
Voice: +1.301.373.9600
|
||||
Email: cups-info@cups.org
|
||||
WWW: http://www.cups.org
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
@@ -15,12 +17,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 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.
|
||||
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.
|
||||
|
||||
For those not familiar with the GNU GPL, the license basically
|
||||
allows you to:
|
||||
@@ -30,25 +32,28 @@ 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 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 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.
|
||||
|
||||
The GNU LGPL relaxes the "link-to" restriction, allowing you to
|
||||
develop applications that use the CUPS and CUPS Imaging libraries
|
||||
under other licenses and/or conditions as appropriate for your
|
||||
application, driver, or filter.
|
||||
develop applications that use the CUPS API library under other
|
||||
licenses and/or conditions as appropriate for your application.
|
||||
|
||||
|
||||
LICENSE EXCEPTIONS
|
||||
|
||||
In addition, as the copyright holder of CUPS, Apple Inc. grants
|
||||
the following special exceptions:
|
||||
In addition, as the copyright holder of CUPS, Easy Software
|
||||
Products grants the following special exceptions:
|
||||
|
||||
1. Apple Operating System Development License Exception;
|
||||
|
||||
@@ -91,58 +96,49 @@ the following special exceptions:
|
||||
|
||||
2. OpenSSL Toolkit License Exception;
|
||||
|
||||
a. Apple Inc. explicitly allows the compilation and
|
||||
distribution of the CUPS software with the OpenSSL
|
||||
Toolkit.
|
||||
a. Easy Software Products explicitly allows the
|
||||
compilation and distribution of the CUPS software
|
||||
with the OpenSSL Toolkit.
|
||||
|
||||
No developer is required to provide these exceptions in a
|
||||
derived work.
|
||||
|
||||
|
||||
KERBEROS SUPPORT CODE
|
||||
|
||||
The Kerberos support code ("KSC") is copyright 2006 by Jelmer
|
||||
Vernooij and is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author or Apple Inc. be held
|
||||
liable for any damages arising from the use of the KSC.
|
||||
|
||||
Sources files containing KSC have the following text at the top
|
||||
of each source file:
|
||||
|
||||
This file contains Kerberos support code, copyright 2006 by
|
||||
Jelmer Vernooij.
|
||||
|
||||
The KSC copyright and license apply only to Kerberos-related
|
||||
feature code in CUPS. Such code is typically conditionally
|
||||
compiled based on the present of the HAVE_GSSAPI preprocessor
|
||||
definition.
|
||||
|
||||
Permission is granted to anyone to use the KSC for any purpose,
|
||||
including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of the KSC must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If
|
||||
you use the KSC in a product, an acknowledgment in the
|
||||
product documentation would be appreciated but is not
|
||||
required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such,
|
||||
and must not be misrepresented as being the original
|
||||
software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
|
||||
TRADEMARKS
|
||||
|
||||
Apple Inc. has trademarked the Common UNIX Printing System, CUPS,
|
||||
and CUPS logo. You may use these names and logos in any direct port
|
||||
or binary distribution of CUPS. Please contact Apple Inc. for written
|
||||
permission to use them in derivative products. Our intention is to
|
||||
protect the value of these trademarks and ensure that any derivative
|
||||
product meets the same high-quality standards as the original.
|
||||
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/
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
+25
-37
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# Common makefile definitions for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
@@ -69,8 +78,6 @@ CUPS_LOG_FILE_PERM = @CUPS_LOG_FILE_PERM@
|
||||
#
|
||||
|
||||
LANGUAGES = @LANGUAGES@
|
||||
INSTALL_LANGUAGES = @INSTALL_LANGUAGES@
|
||||
UNINSTALL_LANGUAGES = @UNINSTALL_LANGUAGES@
|
||||
|
||||
#
|
||||
# Libraries...
|
||||
@@ -84,7 +91,6 @@ LIBMALLOC = @LIBMALLOC@
|
||||
LIBPAPER = @LIBPAPER@
|
||||
LIBPNG = @LIBPNG@
|
||||
LIBSLP = @LIBSLP@
|
||||
LIBGSSAPI = @LIBGSSAPI@
|
||||
LIBTIFF = @LIBTIFF@
|
||||
LIBZ = @LIBZ@
|
||||
|
||||
@@ -97,7 +103,8 @@ INSTALLSTATIC = @INSTALLSTATIC@
|
||||
#
|
||||
# Program options...
|
||||
#
|
||||
# ARCHFLAGS Defines the default architecture build options.
|
||||
# ARCHFLAGS Defines the default architecture build options, used
|
||||
# when compiling separate 32/64-bit libraries.
|
||||
# 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
|
||||
@@ -108,12 +115,10 @@ INSTALLSTATIC = @INSTALLSTATIC@
|
||||
# for extra debug info)
|
||||
#
|
||||
|
||||
ALL_CFLAGS = $(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
|
||||
$(OPTIONS) $(CFLAGS)
|
||||
ARCHFLAGS = @ARCHFLAGS@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
BACKLIBS = @BACKLIBS@
|
||||
CFLAGS = -I.. @CPPFLAGS@ @CFLAGS@ \
|
||||
CFLAGS = -I.. $(SSLFLAGS) @CPPFLAGS@ @CFLAGS@ \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
|
||||
COMMONLIBS = @LIBS@
|
||||
CUPSDLIBS = @CUPSDLIBS@
|
||||
@@ -122,34 +127,27 @@ CXXFLAGS = -I.. $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DSOFLAGS = @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
DNSSDLIBS = @DNSSDLIBS@
|
||||
FONTS = @FONTS@
|
||||
IMGLIBS = @IMGLIBS@
|
||||
IMGLIBS = @IMGLIBS@ -lm
|
||||
IMGFILTERS = @IMGFILTERS@
|
||||
LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
LDFLAGS = -L../cups -L../filter @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LEGACY_BACKENDS = @LEGACY_BACKENDS@
|
||||
LIBCUPSORDER = @LIBCUPSORDER@
|
||||
LIBCUPSIMAGEORDER = @LIBCUPSIMAGEORDER@
|
||||
LDFLAGS = -L../cups -L../filter $(RC_CFLAGS) $(ARCHFLAGS) \
|
||||
@LDFLAGS@ $(OPTIM)
|
||||
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...
|
||||
#
|
||||
|
||||
ARCH32FLAGS = @ARCH32FLAGS@
|
||||
DSO32FLAGS = @DSO32FLAGS@
|
||||
INSTALL32 = @INSTALL32@
|
||||
LIB32CUPS = @LIB32CUPS@
|
||||
LIB32CUPSIMAGE = @LIB32CUPSIMAGE@
|
||||
@@ -157,7 +155,6 @@ LIB32DIR = $(BUILDROOT)@LIB32DIR@
|
||||
UNINSTALL32 = @UNINSTALL32@
|
||||
|
||||
ARCH64FLAGS = @ARCH64FLAGS@
|
||||
DSO64FLAGS = @DSO64FLAGS@
|
||||
INSTALL64 = @INSTALL64@
|
||||
LIB64CUPS = @LIB64CUPS@
|
||||
LIB64CUPSIMAGE = @LIB64CUPSIMAGE@
|
||||
@@ -172,16 +169,12 @@ 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@
|
||||
@@ -204,7 +197,6 @@ BINDIR = $(BUILDROOT)@bindir@
|
||||
CACHEDIR = $(BUILDROOT)@CUPS_CACHEDIR@
|
||||
DATADIR = $(BUILDROOT)@CUPS_DATADIR@
|
||||
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
|
||||
ICONDIR = @ICONDIR@
|
||||
INCLUDEDIR = $(BUILDROOT)$(includedir)
|
||||
INITDIR = @INITDIR@
|
||||
INITDDIR = @INITDDIR@
|
||||
@@ -212,11 +204,7 @@ 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@
|
||||
@@ -246,15 +234,15 @@ DBUSDIR = @DBUSDIR@
|
||||
|
||||
.c.o:
|
||||
echo Compiling $<...
|
||||
$(CC) $(ARCHFLAGS) $(OPTIM) $(ALL_CFLAGS) -c $<
|
||||
$(CC) $(ARCHFLAGS) $(OPTIM) $(CFLAGS) -c $<
|
||||
|
||||
.c.32.o:
|
||||
echo Compiling 32-bit $<...
|
||||
$(CC) $(ARCH32FLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
|
||||
$(CC) $(ARCH32FLAGS) $(OPTIM) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
.c.64.o:
|
||||
echo Compiling 64-bit $<...
|
||||
$(CC) $(ARCH64FLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
|
||||
$(CC) $(ARCH64FLAGS) $(OPTIM) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
.cxx.o:
|
||||
echo Compiling $<...
|
||||
|
||||
+43
-107
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# Top-level Makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# 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
|
||||
#
|
||||
|
||||
include Makedefs
|
||||
@@ -22,7 +31,7 @@ include Makedefs
|
||||
DIRS = cups backend berkeley cgi-bin filter locale man monitor \
|
||||
notifier $(PDFTOPS) scheduler systemv test \
|
||||
$(PHPDIR) \
|
||||
conf data doc $(FONTS) ppd templates
|
||||
conf data doc fonts ppd templates
|
||||
|
||||
|
||||
#
|
||||
@@ -48,27 +57,6 @@ 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/header.tmpl
|
||||
-$(RM) doc/*/index.html
|
||||
-$(RM) templates/*/header.tmpl
|
||||
-$(RM) -r autom4te*.cache
|
||||
|
||||
|
||||
#
|
||||
# Make dependencies
|
||||
#
|
||||
@@ -80,14 +68,6 @@ depend:
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Generate a ctags file...
|
||||
#
|
||||
|
||||
ctags:
|
||||
ctags -R .
|
||||
|
||||
|
||||
#
|
||||
# Install object and target files...
|
||||
#
|
||||
@@ -100,73 +80,54 @@ 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 \
|
||||
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; \
|
||||
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
|
||||
$(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; \
|
||||
fi
|
||||
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) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
$(INSTALL_DIR) -m 755 $(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 \
|
||||
echo Installing cups.conf in $(DBUSDIR)...;\
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
|
||||
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR); \
|
||||
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/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 \
|
||||
if test -d /usr/share/applications; 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; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/applications; \
|
||||
$(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)/usr/share/applications; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png; \
|
||||
fi
|
||||
|
||||
|
||||
@@ -214,9 +175,7 @@ uninstall:
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
|
||||
$(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
|
||||
$(RM) $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
|
||||
else \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
|
||||
fi \
|
||||
@@ -239,45 +198,22 @@ uninstall:
|
||||
# Run the test suite...
|
||||
#
|
||||
|
||||
test: all
|
||||
check 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 --output-dir dist $(EPMARCH)
|
||||
EPMFLAGS = -v
|
||||
|
||||
aix bsd deb depot inst pkg setld slackware swinstall tardist:
|
||||
aix bsd deb depot inst osx pkg rpm setld slackware swinstall tardist:
|
||||
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
|
||||
|
||||
epm:
|
||||
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
|
||||
epm $(EPMFLAGS) cups packaging/cups.list
|
||||
|
||||
|
||||
#
|
||||
|
||||
+50
-18
@@ -1,5 +1,5 @@
|
||||
README - CUPS v1.3.2 - 2007-09-18
|
||||
---------------------------------
|
||||
README - CUPS v1.2rc1 - 2006-03-24
|
||||
----------------------------------
|
||||
|
||||
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 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.
|
||||
operating systems. It has been developed by Easy Software
|
||||
Products to promote a standard printing solution for all UNIX
|
||||
vendors and users. CUPS provides the System V and Berkeley
|
||||
command-line interfaces.
|
||||
|
||||
CUPS uses the Internet Printing Protocol ("IPP") as the basis
|
||||
for managing print jobs and queues. The Line Printer Daemon
|
||||
@@ -22,14 +22,22 @@ INTRODUCTION
|
||||
to support real-world printing under UNIX.
|
||||
|
||||
CUPS includes an image file RIP that supports printing of
|
||||
image files to non-PostScript printers. GPL Ghostscript now
|
||||
includes the "cups" driver to support printing of PostScript
|
||||
files within the CUPS driver framework. Sample drivers for
|
||||
Dymo, EPSON, HP, OKIDATA, and Zebra printers are included that
|
||||
use these filters.
|
||||
image files to non-PostScript printers. A customized version
|
||||
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, OKIDATA, and Zebra 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/
|
||||
|
||||
CUPS is licensed under the GNU General Public License and GNU
|
||||
Library General Public License versions 2.
|
||||
Library General Public License. Please contact Easy Software
|
||||
Products for commercial support and "binary distribution"
|
||||
rights.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
@@ -52,13 +60,19 @@ 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.3 includes a web-based administration tool that allows
|
||||
CUPS 1.2 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:
|
||||
@@ -87,7 +101,6 @@ 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
|
||||
@@ -95,6 +108,7 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
EPSON 9-pin Series epson9.ppd
|
||||
EPSON 24-pin Series epson24.ppd
|
||||
HP DeskJet Series deskjet.ppd
|
||||
HP New DeskJet Series deskjet2.ppd
|
||||
HP LaserJet Series laserjet.ppd
|
||||
OKIDATA 9-Pin Series okidata9.ppd
|
||||
OKIDATA 24-Pin Series okidat24.ppd
|
||||
@@ -119,7 +133,10 @@ 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.
|
||||
or CUPS. For fully-functional commercial printer drivers
|
||||
check out our ESP Print Pro software at:
|
||||
|
||||
http://www.easysw.com/printpro/
|
||||
|
||||
|
||||
PRINTING FILES
|
||||
@@ -153,9 +170,9 @@ PRINTING FILES
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007 by Apple Inc. CUPS, the CUPS logo, and
|
||||
the Common UNIX Printing System are the trademark property of
|
||||
Apple Inc.
|
||||
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.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
@@ -172,3 +189,18 @@ 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.
|
||||
|
||||
+29
-50
@@ -1,50 +1,29 @@
|
||||
# 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
|
||||
# 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
|
||||
|
||||
+29
-56
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# Backend makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# 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
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
@@ -18,11 +27,10 @@
|
||||
include ../Makedefs
|
||||
|
||||
RBACKENDS = ipp lpd
|
||||
UBACKENDS = $(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
|
||||
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
|
||||
|
||||
|
||||
#
|
||||
@@ -37,7 +45,7 @@ all: $(TARGETS)
|
||||
#
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http
|
||||
$(RM) $(OBJS) $(TARGETS) http
|
||||
|
||||
|
||||
#
|
||||
@@ -62,12 +70,6 @@ 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
|
||||
|
||||
|
||||
#
|
||||
@@ -102,17 +104,6 @@ test1284: test1284.o ../cups/libcups.a
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# libbackend.a
|
||||
#
|
||||
|
||||
libbackend.a: $(LIBOBJS)
|
||||
echo Archiving $@...
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
|
||||
#
|
||||
# ieee1394
|
||||
#
|
||||
@@ -145,22 +136,13 @@ 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) libbackend.a
|
||||
parallel: parallel.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
|
||||
$(CC) $(LDFLAGS) -o parallel parallel.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -178,37 +160,28 @@ scsi.o: scsi.c scsi-irix.c scsi-linux.c
|
||||
# serial
|
||||
#
|
||||
|
||||
serial: serial.o ../cups/$(LIBCUPS) libbackend.a
|
||||
serial: serial.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(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)
|
||||
$(CC) $(LDFLAGS) -o serial serial.o $(BACKLIBS) $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# socket
|
||||
#
|
||||
|
||||
socket: socket.o ../cups/$(LIBCUPS) libbackend.a
|
||||
socket: socket.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
|
||||
$(CC) $(LDFLAGS) -o socket socket.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# usb
|
||||
#
|
||||
|
||||
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
|
||||
usb: usb.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(BACKLIBS) $(LIBS)
|
||||
usb.o: usb.c usb-darwin.c usb-unix.c
|
||||
$(CC) $(LDFLAGS) -o usb usb.o $(BACKLIBS) $(LIBS)
|
||||
usb.o: usb.c usb-darwin.c usb-unix.c ieee1284.c
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* "$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$".
|
||||
*/
|
||||
+13
-4
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
|
||||
+169
-294
@@ -3,30 +3,37 @@
|
||||
*
|
||||
* IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 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"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* backendGetDeviceID() - Get the IEEE-1284 device ID string and
|
||||
* corresponding URI.
|
||||
* backendGetMakeModel() - Get the make and model string from the device ID.
|
||||
* get_device_id() - Get the IEEE-1284 device ID string and corresponding
|
||||
* URI.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include "backend-private.h"
|
||||
|
||||
#include <cups/debug.h>
|
||||
#ifdef __linux
|
||||
# include <sys/ioctl.h>
|
||||
# include <linux/lp.h>
|
||||
@@ -45,12 +52,12 @@
|
||||
|
||||
|
||||
/*
|
||||
* 'backendGetDeviceID()' - Get the IEEE-1284 device ID string and
|
||||
* corresponding URI.
|
||||
* 'get_device_id()' - Get the IEEE-1284 device ID string and
|
||||
* corresponding URI.
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on failure */
|
||||
backendGetDeviceID(
|
||||
get_device_id(
|
||||
int fd, /* I - File descriptor */
|
||||
char *device_id, /* O - 1284 device ID */
|
||||
int device_id_size, /* I - Size of buffer */
|
||||
@@ -63,9 +70,9 @@ backendGetDeviceID(
|
||||
char *attr, /* 1284 attribute */
|
||||
*delim, /* 1284 delimiter */
|
||||
*uriptr, /* Pointer into URI */
|
||||
manufacturer[256], /* Manufacturer string */
|
||||
*mfg, /* Manufacturer string */
|
||||
*mdl, /* Model string */
|
||||
serial_number[1024]; /* Serial number string */
|
||||
int manulen; /* Length of manufacturer string */
|
||||
#ifdef __linux
|
||||
int length; /* Length of device ID info */
|
||||
#endif /* __linux */
|
||||
@@ -73,8 +80,7 @@ backendGetDeviceID(
|
||||
struct ecpp_device_id did; /* Device ID buffer */
|
||||
#endif /* __sun && ECPPIOC_GETDEVID */
|
||||
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
|
||||
DEBUG_printf(("get_device_id(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)",
|
||||
@@ -84,246 +90,90 @@ backendGetDeviceID(
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!device_id || device_id_size < 32)
|
||||
if (fd < 0 ||
|
||||
!device_id || device_id_size < 32 ||
|
||||
!make_model || make_model_size < 32)
|
||||
{
|
||||
DEBUG_puts("backendGetDeviceID: Bad args!");
|
||||
DEBUG_puts("get_device_id: Bad args!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (make_model)
|
||||
*make_model = '\0';
|
||||
*device_id = '\0';
|
||||
*make_model = '\0';
|
||||
|
||||
if (uri)
|
||||
*uri = '\0';
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
/*
|
||||
* Get the device ID string...
|
||||
*/
|
||||
|
||||
*device_id = '\0';
|
||||
/*
|
||||
* Get the device ID string...
|
||||
*/
|
||||
|
||||
#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 (!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...
|
||||
*/
|
||||
|
||||
length = (((unsigned)device_id[0] & 255) << 8) +
|
||||
((unsigned)device_id[1] & 255);
|
||||
length = (((unsigned)device_id[0] & 255) << 8) +
|
||||
((unsigned)device_id[1] & 255);
|
||||
|
||||
/*
|
||||
* 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...
|
||||
*/
|
||||
/*
|
||||
* 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...
|
||||
*/
|
||||
|
||||
if (length > (device_id_size - 2))
|
||||
length = (((unsigned)device_id[1] & 255) << 8) +
|
||||
((unsigned)device_id[0] & 255);
|
||||
if (length > (device_id_size - 2))
|
||||
length = (((unsigned)device_id[1] & 255) << 8) +
|
||||
((unsigned)device_id[0] & 255);
|
||||
|
||||
if (length > (device_id_size - 2))
|
||||
length = device_id_size - 2;
|
||||
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.
|
||||
*/
|
||||
/*
|
||||
* 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';
|
||||
}
|
||||
memmove(device_id, device_id + 2, length);
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
else
|
||||
printf("get_device_id: 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';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
if (did.rlen < (device_id_size - 1))
|
||||
device_id[did.rlen] = '\0';
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
device_id[device_id_size - 1] = '\0';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
printf("get_device_id: ioctl failed - %s\n", strerror(errno));
|
||||
# endif /* DEBUG */
|
||||
#endif /* __sun && ECPPIOC_GETDEVID */
|
||||
}
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
|
||||
DEBUG_printf(("get_device_id: 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...
|
||||
*/
|
||||
@@ -374,64 +224,15 @@ backendGetMakeModel(
|
||||
|
||||
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 (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)
|
||||
if (attr)
|
||||
{
|
||||
/*
|
||||
* Use description...
|
||||
@@ -456,6 +257,38 @@ backendGetMakeModel(
|
||||
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
|
||||
{
|
||||
/*
|
||||
@@ -465,31 +298,73 @@ backendGetMakeModel(
|
||||
strlcpy(make_model, "Unknown", make_model_size);
|
||||
}
|
||||
|
||||
/*
|
||||
* Strip trailing data...
|
||||
*/
|
||||
|
||||
if ((delim = strchr(make_model, ';')) != NULL)
|
||||
*delim = '\0';
|
||||
|
||||
/*
|
||||
* Strip trailing whitespace...
|
||||
*/
|
||||
if (scheme && uri && uri_size > 32)
|
||||
{
|
||||
/*
|
||||
* Look for the serial number field...
|
||||
*/
|
||||
|
||||
for (delim = make_model + strlen(make_model) - 1; delim >= make_model; delim --)
|
||||
if (isspace(*delim & 255))
|
||||
*delim = '\0';
|
||||
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
|
||||
break;
|
||||
serial_number[0] = '\0';
|
||||
|
||||
/*
|
||||
* Return...
|
||||
*/
|
||||
/*
|
||||
* Generate the device URI from the make_model and serial number strings.
|
||||
*/
|
||||
|
||||
if (make_model[0])
|
||||
return (0);
|
||||
else
|
||||
return (-1);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* 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
|
||||
|
||||
+232
-371
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+185
-270
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 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"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -32,7 +41,6 @@
|
||||
#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>
|
||||
@@ -65,14 +73,6 @@ 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,
|
||||
int print_fd, int mode, const char *user,
|
||||
const char *title, int copies, int banner,
|
||||
int format, int order, int reserve,
|
||||
const char *filename,
|
||||
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);
|
||||
@@ -125,15 +125,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
*options, /* Pointer to options */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep, /* Separator character */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr, /* Pointer into name or value */
|
||||
*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 */
|
||||
@@ -186,12 +184,49 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
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...
|
||||
*/
|
||||
@@ -214,7 +249,6 @@ 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;
|
||||
@@ -224,16 +258,9 @@ 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 */
|
||||
@@ -277,30 +304,29 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
name = options;
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
if (*options == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
value = options;
|
||||
options ++;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
value[0] = '\0';
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -324,22 +350,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (strchr("cdfglnoprtv", value[0]))
|
||||
format = value[0];
|
||||
else
|
||||
_cupsLangPrintf(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
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown print mode \"%s\"\n"),
|
||||
value);
|
||||
fprintf(stderr, "ERROR: Unknown format character \"%c\"\n", value[0]);
|
||||
}
|
||||
else if (!strcasecmp(name, "order") && value[0])
|
||||
{
|
||||
@@ -352,8 +363,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (!strcasecmp(value, "data,control"))
|
||||
order = ORDER_DATA_CONTROL;
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown file order \"%s\"\n"),
|
||||
value);
|
||||
fprintf(stderr, "ERROR: Unknown file order \"%s\"\n", value);
|
||||
}
|
||||
else if (!strcasecmp(name, "reserve"))
|
||||
{
|
||||
@@ -400,7 +410,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (!strcasecmp(name, "contimeout"))
|
||||
{
|
||||
/*
|
||||
* Set the connection timeout...
|
||||
* Set the timeout...
|
||||
*/
|
||||
|
||||
if (atoi(value) > 0)
|
||||
@@ -409,64 +419,6 @@ 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)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s: %s\n"),
|
||||
filename, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sanitize the document title...
|
||||
*/
|
||||
@@ -480,8 +432,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* the remote end...
|
||||
*/
|
||||
|
||||
char *ptr;
|
||||
|
||||
for (ptr = title; *ptr; ptr ++)
|
||||
if (!isalnum(*ptr & 255) && !isspace(*ptr & 255))
|
||||
*ptr = '_';
|
||||
@@ -504,7 +454,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
status = lpd_queue(hostname, port, resource + 1, fd, mode,
|
||||
status = lpd_queue(hostname, port, resource + 1, filename,
|
||||
username, title, copies,
|
||||
banner, format, order, reserve, manual_copies,
|
||||
timeout, contimeout);
|
||||
@@ -513,7 +463,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, fd, mode,
|
||||
status = lpd_queue(hostname, port, resource + 1, filename,
|
||||
username, title, 1,
|
||||
banner, format, order, reserve, 1,
|
||||
timeout, contimeout);
|
||||
@@ -525,9 +475,6 @@ 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...
|
||||
*/
|
||||
@@ -585,15 +532,14 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
* Read back the status from the command and return it...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Reading command status...\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Reading command status...\n");
|
||||
|
||||
alarm(timeout);
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
_cupsLangPrintf(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;
|
||||
}
|
||||
|
||||
@@ -613,8 +559,7 @@ 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 */
|
||||
int print_fd, /* I - File to print */
|
||||
int mode, /* I - Print mode */
|
||||
const char *filename, /* I - File to print */
|
||||
const char *user, /* I - Requesting user */
|
||||
const char *title, /* I - Job title */
|
||||
int copies, /* I - Number of copies */
|
||||
@@ -626,6 +571,7 @@ 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 */
|
||||
@@ -635,16 +581,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[32768]; /* Output buffer */
|
||||
char buffer[65536]; /* Output buffer */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@@ -674,16 +620,18 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(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 started trying to connect to the printer...
|
||||
* Remember when we starting trying to connect to the printer...
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
recoverable = 0;
|
||||
#endif /* __APPLE__ */
|
||||
start_time = time(NULL);
|
||||
|
||||
/*
|
||||
@@ -697,12 +645,10 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
*/
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s for printer %s\n"),
|
||||
hostname, printer);
|
||||
fprintf(stderr, "INFO: Attempting to connect to host %s for printer %s\n",
|
||||
hostname, printer);
|
||||
|
||||
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist,
|
||||
delay = 5;;
|
||||
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist;;
|
||||
addr = addr->next)
|
||||
{
|
||||
/*
|
||||
@@ -798,9 +744,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fprintf(stderr, "INFO: Unable to connect to %s, queuing on next printer in class...\n",
|
||||
hostname);
|
||||
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
@@ -818,20 +763,23 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
fputs("ERROR: Printer not responding!\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
recoverable = 1;
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"), hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
if (delay < 30)
|
||||
delay += 5;
|
||||
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);
|
||||
}
|
||||
else if (error == EADDRINUSE)
|
||||
{
|
||||
@@ -843,16 +791,19 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (recoverable)
|
||||
{
|
||||
/*
|
||||
@@ -864,55 +815,35 @@ 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);
|
||||
_cupsLangPrintf(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);
|
||||
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
|
||||
fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
|
||||
lport);
|
||||
|
||||
/*
|
||||
* Next, open the print file and figure out its size...
|
||||
*/
|
||||
|
||||
if (print_fd)
|
||||
if (stat(filename, &filestats))
|
||||
{
|
||||
/*
|
||||
* Use the size from the print file...
|
||||
*/
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
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;
|
||||
perror("ERROR: unable to stat print file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Use a "very large value" for the size so that the printer will
|
||||
* keep printing until we close the connection...
|
||||
*/
|
||||
|
||||
#ifdef _LARGEFILE_SOURCE
|
||||
filestats.st_size = (size_t)(999999999999.0);
|
||||
#else
|
||||
filestats.st_size = 2147483647;
|
||||
#endif /* _LARGEFILE_SOURCE */
|
||||
filestats.st_size *= manual_copies;
|
||||
|
||||
if ((fp = fopen(filename, "rb")) == NULL)
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
perror("ERROR: unable to open print file for reading");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -972,8 +903,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
|
||||
(unsigned)strlen(control));
|
||||
fprintf(stderr, "INFO: Sending control file (%u bytes)\n",
|
||||
(unsigned)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
@@ -986,9 +917,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
_cupsLangPrintf(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;
|
||||
}
|
||||
|
||||
@@ -996,11 +926,10 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
fputs("INFO: Control file sent successfully\n", stderr);
|
||||
}
|
||||
else
|
||||
status = 0;
|
||||
@@ -1021,24 +950,18 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(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);
|
||||
fprintf(stderr, "INFO: Sending data file (" CUPS_LLFMT " bytes)\n",
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
|
||||
tbytes = 0;
|
||||
for (copy = 0; copy < manual_copies; copy ++)
|
||||
{
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
rewind(fp);
|
||||
|
||||
while ((nbytes = read(print_fd, buffer, sizeof(buffer))) > 0)
|
||||
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Spooling LPR job, %.0f%% complete...\n"),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
fprintf(stderr, "INFO: Spooling LPR job, %.0f%% complete...\n",
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
|
||||
if (lpd_write(fd, buffer, nbytes) < nbytes)
|
||||
{
|
||||
@@ -1050,46 +973,39 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == MODE_STANDARD)
|
||||
if (tbytes < filestats.st_size)
|
||||
status = errno;
|
||||
else if (lpd_write(fd, "", 1) < 1)
|
||||
{
|
||||
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)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with data "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = 0;
|
||||
}
|
||||
|
||||
alarm(0);
|
||||
}
|
||||
perror("ERROR: Unable to send trailing nul to printer");
|
||||
status = errno;
|
||||
}
|
||||
else
|
||||
status = 0;
|
||||
{
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept data file (%d)\n"),
|
||||
status);
|
||||
fprintf(stderr, "ERROR: Remote host did not accept data file (%d)\n",
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Data file sent successfully\n"));
|
||||
fputs("INFO: Data file sent successfully\n", stderr);
|
||||
}
|
||||
|
||||
if (status == 0 && order == ORDER_DATA_CONTROL)
|
||||
@@ -1103,8 +1019,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
|
||||
(unsigned long)strlen(control));
|
||||
fprintf(stderr, "INFO: Sending control file (%lu bytes)\n",
|
||||
(unsigned long)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
@@ -1117,9 +1033,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
_cupsLangPrintf(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;
|
||||
}
|
||||
|
||||
@@ -1127,11 +1042,10 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
fputs("INFO: Control file sent successfully\n", stderr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1139,6 +1053,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
fclose(fp);
|
||||
|
||||
if (status == 0)
|
||||
{
|
||||
|
||||
-1688
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+212
-142
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Parallel port backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 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"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -18,14 +27,20 @@
|
||||
*
|
||||
* 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 "backend-private.h"
|
||||
#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"
|
||||
|
||||
#ifdef __hpux
|
||||
# include <sys/time.h>
|
||||
@@ -58,8 +73,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void list_devices(void);
|
||||
static void side_cb(int print_fd, int device_fd, int use_bc);
|
||||
void list_devices(void);
|
||||
|
||||
|
||||
/*
|
||||
@@ -80,15 +94,25 @@ 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 print_fd, /* Print file */
|
||||
device_fd, /* Parallel device */
|
||||
use_bc; /* Read back-channel data? */
|
||||
int fp; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
size_t tbytes; /* Total number of bytes written */
|
||||
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 */
|
||||
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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -122,9 +146,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fputs("Usage: parallel job-id user title copies options [file]\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -135,8 +157,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
print_fd = 0;
|
||||
copies = 1;
|
||||
fp = 0;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -144,7 +166,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
if ((fp = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
@@ -184,26 +206,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
do
|
||||
{
|
||||
#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 ((fd = open(resource, O_WRONLY | O_EXCL)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
@@ -214,9 +217,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open parallel port, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -229,27 +231,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
fputs("INFO: Parallel port busy; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open parallel port device file \"%s\": %s\n",
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
while (device_fd < 0);
|
||||
while (fd < 0);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
@@ -257,52 +255,189 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Set any options provided...
|
||||
*/
|
||||
|
||||
tcgetattr(device_fd, &opts);
|
||||
tcgetattr(fd, &opts);
|
||||
|
||||
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
|
||||
|
||||
/**** No options supported yet ****/
|
||||
|
||||
tcsetattr(device_fd, TCSANOW, &opts);
|
||||
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 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
tbytes = 0;
|
||||
wbytes = 0;
|
||||
|
||||
while (copies > 0 && tbytes >= 0)
|
||||
while (copies > 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (print_fd != 0)
|
||||
if (fp != 0)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
lseek(fp, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc, 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)
|
||||
_cupsLangPrintf(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;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the socket connection and input file and return...
|
||||
*/
|
||||
|
||||
close(device_fd);
|
||||
close(fd);
|
||||
if (fp != 0)
|
||||
close(fp);
|
||||
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +445,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* 'list_devices()' - List all parallel devices.
|
||||
*/
|
||||
|
||||
static void
|
||||
void
|
||||
list_devices(void)
|
||||
{
|
||||
#if defined(__hpux) || defined(__sgi) || defined(__sun)
|
||||
@@ -331,6 +466,8 @@ 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");
|
||||
|
||||
@@ -350,9 +487,9 @@ list_devices(void)
|
||||
* Now grab the IEEE 1284 device ID string...
|
||||
*/
|
||||
|
||||
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
|
||||
make_model, sizeof(make_model),
|
||||
NULL, NULL, 0))
|
||||
if (!get_device_id(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
|
||||
@@ -599,73 +736,6 @@ 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))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
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$".
|
||||
*/
|
||||
|
||||
@@ -1,378 +0,0 @@
|
||||
/*
|
||||
* "$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)
|
||||
{
|
||||
_cupsLangPrintf(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);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
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);
|
||||
_cupsLangPuts(stderr, _("ERROR: Out of paper!\n"));
|
||||
paperout = 1;
|
||||
}
|
||||
}
|
||||
else if (errno == ENXIO)
|
||||
{
|
||||
if (offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
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);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now on-line.\n"));
|
||||
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$".
|
||||
*/
|
||||
+11
-16
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* 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
|
||||
@@ -96,8 +95,7 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (strncmp(resource, "/dev/scsi/", 10) != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -120,9 +118,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -135,15 +132,14 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
|
||||
resource);
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -205,9 +201,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
if (ioctl(scsi_fd, DS_ENTER, &scsi_req) < 0 ||
|
||||
scsi_req.ds_status != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.ds_status);
|
||||
fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
|
||||
scsi_req.ds_status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
@@ -215,8 +210,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.ds_status);
|
||||
fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
|
||||
scsi_req.ds_status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
+11
-17
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* 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
|
||||
@@ -56,7 +55,6 @@
|
||||
*/
|
||||
|
||||
#include <scsi/sg.h>
|
||||
#include <cups/i18n.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -110,8 +108,7 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (strncmp(resource, "/dev/sg", 7) != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -134,9 +131,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -149,15 +145,14 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
|
||||
resource);
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -223,9 +218,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
if (ioctl(scsi_fd, SG_IO, &scsi_req) < 0 ||
|
||||
scsi_req.status != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.status);
|
||||
fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
|
||||
scsi_req.status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
@@ -233,8 +227,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.status);
|
||||
fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
|
||||
scsi_req.status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
+3
-8
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* 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
|
||||
@@ -56,12 +55,10 @@
|
||||
|
||||
#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
|
||||
@@ -83,7 +80,7 @@ void list_devices(void);
|
||||
int print_device(const char *resource, int fd, int copies);
|
||||
|
||||
|
||||
#if defined(__linux__) && defined(HAVE_SCSI_SG_H)
|
||||
#ifdef __linux__
|
||||
# include "scsi-linux.c"
|
||||
#elif defined(__sgi)
|
||||
# include "scsi-irix.c"
|
||||
@@ -93,7 +90,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 && HAVE_SCSI_SG_H */
|
||||
#endif /* __linux */
|
||||
|
||||
|
||||
/*
|
||||
@@ -153,9 +150,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fputs("Usage: scsi:/dev/file job-id user title copies options [file]\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
+175
-327
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Serial port backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 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"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -18,14 +27,19 @@
|
||||
*
|
||||
* 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 "backend-private.h"
|
||||
#include <cups/backend.h>
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <cups/string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef __hpux
|
||||
# include <sys/modem.h>
|
||||
@@ -73,18 +87,12 @@
|
||||
# include <IOKit/IOBSD.h>
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#if defined(__linux) && defined(TIOCGSERIAL)
|
||||
# include <linux/serial.h>
|
||||
# include <linux/ioctl.h>
|
||||
#endif /* __linux && TIOCGSERIAL */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void list_devices(void);
|
||||
static void side_cb(int print_fd, int device_fd, int use_bc);
|
||||
void list_devices(void);
|
||||
|
||||
|
||||
/*
|
||||
@@ -104,27 +112,25 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
*options, /* Pointer to options */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Option separator */
|
||||
name[255], /* Name of option */
|
||||
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 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 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 dtrdsr; /* Do dtr/dsr flow control? */
|
||||
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 */
|
||||
int bufsize; /* Size of output buffer for writes */
|
||||
char buffer[8192], /* Output buffer */
|
||||
*bufptr; /* Pointer into 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 */
|
||||
@@ -161,9 +167,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fputs("Usage: serial job-id user title copies options [file]\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -174,8 +178,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
print_fd = 0;
|
||||
copies = 1;
|
||||
fp = 0;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -183,7 +187,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
if ((fp = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
@@ -223,8 +227,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
do
|
||||
{
|
||||
if ((device_fd = open(resource, O_RDWR | O_NOCTTY | O_EXCL |
|
||||
O_NDELAY)) == -1)
|
||||
if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL | O_NDELAY)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
@@ -235,9 +238,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open serial port, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -250,20 +252,18 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
fputs("INFO: Serial port busy; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open serial port device file \"%s\": %s\n",
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
while (device_fd < 0);
|
||||
while (fd < 0);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
@@ -271,48 +271,45 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Set any options provided...
|
||||
*/
|
||||
|
||||
tcgetattr(device_fd, &origopts);
|
||||
tcgetattr(device_fd, &opts);
|
||||
tcgetattr(fd, &origopts);
|
||||
tcgetattr(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 */
|
||||
|
||||
print_size = 96; /* 9600 baud / 10 bits/char / 10Hz */
|
||||
dtrdsr = 0; /* No dtr/dsr flow control */
|
||||
bufsize = 96; /* 9600 baud / 10 bits/char / 10Hz */
|
||||
dtrdsr = 0; /* No dtr/dsr flow control */
|
||||
|
||||
if (options)
|
||||
{
|
||||
if (options != NULL)
|
||||
while (*options)
|
||||
{
|
||||
/*
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
name = options;
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
if (*options == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
value = options;
|
||||
options ++;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
value[0] = '\0';
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -324,7 +321,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Set the baud rate...
|
||||
*/
|
||||
|
||||
print_size = atoi(value) / 100;
|
||||
bufsize = atoi(value) / 100;
|
||||
|
||||
#if B19200 == 19200
|
||||
cfsetispeed(&opts, atoi(value));
|
||||
@@ -375,8 +372,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
# endif /* B230400 */
|
||||
default :
|
||||
_cupsLangPrintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
|
||||
value);
|
||||
fprintf(stderr, "WARNING: Unsupported baud rate %s!\n", value);
|
||||
break;
|
||||
}
|
||||
#endif /* B19200 == 19200 */
|
||||
@@ -487,10 +483,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tcsetattr(device_fd, TCSANOW, &opts);
|
||||
fcntl(device_fd, F_SETFL, 0);
|
||||
tcsetattr(fd, TCSANOW, &opts);
|
||||
fcntl(fd, F_SETFL, 0);
|
||||
|
||||
/*
|
||||
* Now that we are "connected" to the port, ignore SIGTERM so that we
|
||||
@@ -499,7 +494,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* stdin (otherwise you can't cancel raw jobs...)
|
||||
*/
|
||||
|
||||
if (print_fd != 0)
|
||||
if (argc < 7)
|
||||
{
|
||||
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
|
||||
sigset(SIGTERM, SIG_IGN);
|
||||
@@ -515,189 +510,133 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
|
||||
/*
|
||||
* Figure out the maximum file descriptor value to use with select()...
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
|
||||
if (bufsize > sizeof(buffer))
|
||||
bufsize = sizeof(buffer);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
wbytes = 0;
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (print_fd != 0)
|
||||
if (fp != 0)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
lseek(fp, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now loop until we are out of data from print_fd...
|
||||
*/
|
||||
|
||||
for (print_bytes = 0, print_ptr = print_buffer;;)
|
||||
if (dtrdsr)
|
||||
{
|
||||
/*
|
||||
* Use select() to determine whether we have data to copy around...
|
||||
* Check the port and sleep until DSR is set...
|
||||
*/
|
||||
|
||||
FD_ZERO(&input);
|
||||
if (!print_bytes)
|
||||
FD_SET(print_fd, &input);
|
||||
FD_SET(device_fd, &input);
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
int status;
|
||||
|
||||
FD_ZERO(&output);
|
||||
if (print_bytes)
|
||||
FD_SET(device_fd, &output);
|
||||
|
||||
if (select(nfds, &input, &output, NULL, NULL) < 0)
|
||||
continue; /* Ignore errors here */
|
||||
|
||||
/*
|
||||
* Check if we have a side-channel request ready...
|
||||
*/
|
||||
|
||||
if (FD_ISSET(CUPS_SC_FD, &input))
|
||||
side_cb(print_fd, device_fd, 1);
|
||||
|
||||
/*
|
||||
* 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, print_size)) < 0)
|
||||
if (!ioctl(fd, TIOCMGET, &status))
|
||||
if (!(status & TIOCM_DSR))
|
||||
{
|
||||
/*
|
||||
* Read error - bail if we don't see EAGAIN or EINTR...
|
||||
* Wait for DSR to go high...
|
||||
*/
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
|
||||
|
||||
do
|
||||
{
|
||||
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);
|
||||
sleep(1);
|
||||
if (ioctl(fd, TIOCMGET, &status))
|
||||
break;
|
||||
}
|
||||
while (!(status & TIOCM_DSR));
|
||||
|
||||
print_bytes = 0;
|
||||
}
|
||||
else if (print_bytes == 0)
|
||||
{
|
||||
/*
|
||||
* End of file, break out of the loop...
|
||||
*/
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
print_ptr = print_buffer;
|
||||
}
|
||||
fputs("DEBUG: DSR is high; writing to device...\n", stderr);
|
||||
}
|
||||
}
|
||||
|
||||
tbytes = 0;
|
||||
while ((nbytes = read(fp, buffer, bufsize)) > 0)
|
||||
{
|
||||
/*
|
||||
* Check if the device is ready to receive data and we have data to
|
||||
* send...
|
||||
* Write the print data to the printer...
|
||||
*/
|
||||
|
||||
if (print_bytes && FD_ISSET(device_fd, &output))
|
||||
tbytes += nbytes;
|
||||
bufptr = buffer;
|
||||
|
||||
while (nbytes > 0)
|
||||
{
|
||||
if (dtrdsr)
|
||||
/*
|
||||
* 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))
|
||||
{
|
||||
/*
|
||||
* Check the port and sleep until DSR is set...
|
||||
* Read backchannel data...
|
||||
*/
|
||||
|
||||
int status;
|
||||
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 (!ioctl(device_fd, TIOCMGET, &status))
|
||||
if (!(status & TIOCM_DSR))
|
||||
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)
|
||||
{
|
||||
/*
|
||||
* 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 send print file to printer");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
perror("ERROR: Unable to write print data");
|
||||
/*
|
||||
* Update count and pointer...
|
||||
*/
|
||||
|
||||
tcsetattr(device_fd, TCSADRAIN, &origopts);
|
||||
|
||||
close(device_fd);
|
||||
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
nbytes -= wbytes;
|
||||
bufptr += wbytes;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Wrote %d bytes...\n", (int)bytes);
|
||||
|
||||
print_bytes -= bytes;
|
||||
print_ptr += bytes;
|
||||
total_bytes += bytes;
|
||||
}
|
||||
}
|
||||
|
||||
if (wbytes < 0)
|
||||
break;
|
||||
|
||||
if (argc > 6)
|
||||
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
|
||||
(unsigned long)tbytes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,14 +644,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Close the serial port and input file and return...
|
||||
*/
|
||||
|
||||
tcsetattr(device_fd, TCSADRAIN, &origopts);
|
||||
tcsetattr(fd, TCSADRAIN, &origopts);
|
||||
|
||||
close(device_fd);
|
||||
close(fd);
|
||||
if (fp != 0)
|
||||
close(fp);
|
||||
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
|
||||
return (total_bytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -720,53 +658,26 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* 'list_devices()' - List all serial devices.
|
||||
*/
|
||||
|
||||
static void
|
||||
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__ */
|
||||
|
||||
#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 */
|
||||
#if defined(__linux) || defined(linux) || defined(__linux__)
|
||||
int i, j; /* Looping vars */
|
||||
int fd; /* File descriptor */
|
||||
char device[255]; /* Device filename */
|
||||
|
||||
|
||||
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);
|
||||
@@ -786,14 +697,6 @@ 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 ++)
|
||||
@@ -921,13 +824,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 */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1160,6 +1063,7 @@ 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)
|
||||
@@ -1213,8 +1117,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1222,69 +1126,13 @@ list_devices(void)
|
||||
IOObjectRelease(serialService);
|
||||
}
|
||||
|
||||
/*
|
||||
* Release the iterator.
|
||||
*/
|
||||
|
||||
IOObjectRelease(serialPortIterator);
|
||||
IOObjectRelease(serialPortIterator); /* Release the iterator. */
|
||||
}
|
||||
}
|
||||
#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))
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("WARNING: Failed to read side-channel request!\n"));
|
||||
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
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -1,172 +0,0 @@
|
||||
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
|
||||
|
||||
+253
-294
@@ -3,33 +3,46 @@
|
||||
*
|
||||
* AppSocket backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 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"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Send a file to the printer or server.
|
||||
* side_cb() - Handle side-channel requests...
|
||||
* wait_bc() - Wait for back-channel data...
|
||||
* main() - Send a file to the printer or server.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/backend.h>
|
||||
#include <cups/http-private.h>
|
||||
#include "backend-private.h"
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <cups/string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef WIN32
|
||||
# include <winsock.h>
|
||||
@@ -43,14 +56,6 @@
|
||||
#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.
|
||||
*
|
||||
@@ -68,24 +73,27 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (not used) */
|
||||
*options, /* Pointer to options */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Option separator */
|
||||
int print_fd; /* Print file */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
int fp; /* 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 device_fd; /* AppSocket */
|
||||
int fd; /* AppSocket */
|
||||
int error; /* Error code (if any) */
|
||||
http_addrlist_t *addrlist, /* Address list */
|
||||
*addr; /* Connected address */
|
||||
char addrname[256]; /* Address name */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
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() */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@@ -122,9 +130,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -135,8 +142,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
print_fd = 0;
|
||||
copies = 1;
|
||||
fp = 0;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -144,7 +151,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
if ((fp = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
@@ -169,8 +176,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get options, if any...
|
||||
*/
|
||||
|
||||
waiteof = 1;
|
||||
contimeout = 7 * 24 * 60 * 60;
|
||||
waiteof = 1;
|
||||
|
||||
if ((options = strchr(resource, '?')) != NULL)
|
||||
{
|
||||
@@ -191,30 +197,29 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
name = options;
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
if (*options == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
value = options;
|
||||
options ++;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
value[0] = '\0';
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -229,15 +234,6 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,290 +241,253 @@ 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)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
fprintf(stderr, "ERROR: Unable to locate printer \'%s\'!\n", hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s on port %d\n"),
|
||||
hostname, port);
|
||||
fprintf(stderr, "INFO: Attempting to connect to host %s on port %d\n",
|
||||
hostname, port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
wbytes = 0;
|
||||
|
||||
for (delay = 5;;)
|
||||
while (copies > 0)
|
||||
{
|
||||
if ((addr = httpAddrConnect(addrlist, &device_fd)) == NULL)
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
for (delay = 5;;)
|
||||
{
|
||||
error = errno;
|
||||
device_fd = -1;
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
if (!httpAddrConnect(addrlist, &fd))
|
||||
{
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
error = errno;
|
||||
fd = -1;
|
||||
|
||||
_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...
|
||||
*/
|
||||
|
||||
sleep(5);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
if (error == ECONNREFUSED || error == EHOSTDOWN ||
|
||||
error == EHOSTUNREACH)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
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);
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
if (delay < 30)
|
||||
delay += 5;
|
||||
if (delay < 30)
|
||||
delay += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
recoverable = 1;
|
||||
|
||||
_cupsLangPrintf(stderr, "DEBUG: Connection error: %s\n",
|
||||
strerror(errno));
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (recoverable)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* 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...
|
||||
* 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...)
|
||||
*/
|
||||
|
||||
fputs("INFO: recovered: \n", stderr);
|
||||
sleep(5);
|
||||
}
|
||||
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("STATE: -connecting-to-device\n", stderr);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_handler = SIG_IGN;
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
#else
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
#endif /* HAVE_SIGSET */
|
||||
}
|
||||
|
||||
#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));
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Print everything...
|
||||
*/
|
||||
|
||||
tbytes = 0;
|
||||
|
||||
while (copies > 0 && tbytes >= 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (print_fd != 0)
|
||||
if (fp != 0)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
lseek(fp, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, 1, side_cb);
|
||||
fputs("INFO: Connected to host, sending print job...\n", stderr);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintf(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 = 0;
|
||||
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
/*
|
||||
* Write the print data to the printer...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Get any pending back-channel data...
|
||||
*/
|
||||
tbytes += nbytes;
|
||||
bufptr = buffer;
|
||||
|
||||
while (wait_bc(device_fd, 5) > 0);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (waiteof)
|
||||
{
|
||||
/*
|
||||
* Shutdown the socket and wait for the other end to finish...
|
||||
* Close the socket connection...
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Print file sent, waiting for printer to finish...\n"));
|
||||
|
||||
shutdown(device_fd, 1);
|
||||
|
||||
while (wait_bc(device_fd, 90) > 0);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the socket connection...
|
||||
*/
|
||||
|
||||
close(device_fd);
|
||||
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
/*
|
||||
* Close the input file and return...
|
||||
*/
|
||||
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
if (fp != 0)
|
||||
close(fp);
|
||||
|
||||
if (tbytes >= 0)
|
||||
_cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
|
||||
if (wbytes >= 0)
|
||||
fputs("INFO: Ready to print.\n", stderr);
|
||||
|
||||
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 */
|
||||
const char *device_id; /* 1284DEVICEID env var */
|
||||
|
||||
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
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;
|
||||
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID :
|
||||
if ((device_id = getenv("1284DEVICEID")) != NULL)
|
||||
{
|
||||
strlcpy(data, device_id, sizeof(data));
|
||||
datalen = (int)strlen(data);
|
||||
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);
|
||||
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+15
-8
@@ -4,20 +4,28 @@
|
||||
* 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 Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Test the device-ID functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -33,7 +41,6 @@
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
#endif /* WIN32 */
|
||||
|
||||
#define DEBUG
|
||||
#include "ieee1284.c"
|
||||
|
||||
@@ -69,8 +76,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
printf("%s:\n", argv[i]);
|
||||
|
||||
backendGetDeviceID(fd, device_id, sizeof(device_id), make_model,
|
||||
sizeof(make_model), "test", uri, sizeof(uri));
|
||||
get_device_id(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);
|
||||
|
||||
+564
-1247
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+268
-261
@@ -5,23 +5,30 @@
|
||||
*
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 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"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* print_device() - Print a file to a USB device.
|
||||
* main() - Send a file to the specified USB port.
|
||||
* list_devices() - List all USB devices.
|
||||
* open_device() - Open a USB device...
|
||||
* side_cb() - Handle side-channel requests...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -36,8 +43,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int open_device(const char *uri, int *use_bc);
|
||||
static void side_cb(int print_fd, int device_fd, int use_bc);
|
||||
int open_device(const char *uri);
|
||||
|
||||
|
||||
/*
|
||||
@@ -48,17 +54,30 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
int fp, /* 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 use_bc; /* Use backchannel path? */
|
||||
int device_fd; /* USB device */
|
||||
size_t tbytes; /* Total number of bytes written */
|
||||
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 */
|
||||
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;
|
||||
@@ -71,30 +90,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
do
|
||||
{
|
||||
#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 ((fd = open_device(uri)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
@@ -105,9 +101,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open USB device, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -120,28 +115,23 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 10 seconds...\n"));
|
||||
sleep(10);
|
||||
fputs("INFO: USB port busy; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
|
||||
errno == ENODEV)
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT || errno == ENODEV)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open USB device \"%s\": %s\n",
|
||||
uri, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
while (device_fd < 0);
|
||||
while (fd < 0);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
@@ -149,49 +139,187 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* Set any options provided...
|
||||
*/
|
||||
|
||||
tcgetattr(device_fd, &opts);
|
||||
tcgetattr(fd, &opts);
|
||||
|
||||
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
|
||||
|
||||
/**** No options supported yet ****/
|
||||
|
||||
tcsetattr(device_fd, TCSANOW, &opts);
|
||||
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 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
tbytes = 0;
|
||||
wbytes = 0;
|
||||
|
||||
while (copies > 0 && tbytes >= 0)
|
||||
while (copies > 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (print_fd != 0)
|
||||
if (fp != 0)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
lseek(fp, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc, 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)
|
||||
_cupsLangPrintf(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;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the USB port and return...
|
||||
*/
|
||||
|
||||
close(device_fd);
|
||||
close(fd);
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -203,52 +331,44 @@ void
|
||||
list_devices(void)
|
||||
{
|
||||
#ifdef __linux
|
||||
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 */
|
||||
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 */
|
||||
|
||||
|
||||
/*
|
||||
* Try to open each USB device...
|
||||
* 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...
|
||||
*/
|
||||
|
||||
for (i = 0; i < 16; i ++)
|
||||
{
|
||||
/*
|
||||
* Linux has a long history of changing the standard filenames used
|
||||
* for USB printer devices. We get the honor of trying them all...
|
||||
*/
|
||||
sprintf(device, format, i);
|
||||
|
||||
sprintf(device, "/dev/usblp%d", i);
|
||||
|
||||
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
|
||||
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
|
||||
{
|
||||
if (errno != ENOENT)
|
||||
continue;
|
||||
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);
|
||||
|
||||
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;
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -268,11 +388,11 @@ list_devices(void)
|
||||
{
|
||||
sprintf(device, "/dev/usb/printer%d", i);
|
||||
|
||||
if ((fd = open(device, O_WRONLY | O_EXCL)) >= 0)
|
||||
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
|
||||
{
|
||||
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
|
||||
make_model, sizeof(make_model),
|
||||
"usb", device_uri, sizeof(device_uri)))
|
||||
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);
|
||||
|
||||
@@ -304,13 +424,9 @@ list_devices(void)
|
||||
* 'open_device()' - Open a USB device...
|
||||
*/
|
||||
|
||||
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 /* O - File descriptor or -1 on error */
|
||||
open_device(const char *uri) /* I - Device URI */
|
||||
{
|
||||
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
|
||||
@@ -319,14 +435,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (!strncmp(uri, "usb:/dev/", 9))
|
||||
#ifdef __linux
|
||||
{
|
||||
/*
|
||||
* Do not allow direct devices anymore...
|
||||
*/
|
||||
|
||||
errno = ENODEV;
|
||||
return (-1);
|
||||
}
|
||||
return (-1); /* Do not allow direct devices anymore */
|
||||
else if (!strncmp(uri, "usb://", 6))
|
||||
{
|
||||
/*
|
||||
@@ -335,45 +444,40 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
int i; /* Looping var */
|
||||
int busy; /* Are any ports busy? */
|
||||
char device[255], /* Device filename */
|
||||
int fd; /* File descriptor */
|
||||
char format[255], /* Format for device filename */
|
||||
device[255], /* Device filename */
|
||||
device_id[1024], /* Device ID string */
|
||||
make_model[1024], /* Make and model */
|
||||
device_uri[1024]; /* Device URI string */
|
||||
|
||||
|
||||
/*
|
||||
* Find the correct USB device...
|
||||
* 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...
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
for (busy = 0, i = 0; i < 16; i ++)
|
||||
{
|
||||
/*
|
||||
* Linux has a long history of changing the standard filenames used
|
||||
* for USB printer devices. We get the honor of trying them all...
|
||||
*/
|
||||
sprintf(device, format, i);
|
||||
|
||||
sprintf(device, "/dev/usblp%d", i);
|
||||
|
||||
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
|
||||
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
|
||||
{
|
||||
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));
|
||||
get_device_id(fd, device_id, sizeof(device_id),
|
||||
make_model, sizeof(make_model),
|
||||
"usb", device_uri, sizeof(device_uri));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -394,8 +498,7 @@ 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);
|
||||
}
|
||||
@@ -415,8 +518,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (busy)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 5 seconds...\n"));
|
||||
fputs("INFO: USB printer is busy; will retry in 5 seconds...\n",
|
||||
stderr);
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
@@ -431,14 +534,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
return (-1);
|
||||
}
|
||||
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
{
|
||||
/*
|
||||
* Do not allow direct devices anymore...
|
||||
*/
|
||||
|
||||
errno = ENODEV;
|
||||
return (-1);
|
||||
}
|
||||
return (-1); /* Do not allow direct devices anymore */
|
||||
else if (!strncmp(uri, "usb://", 6))
|
||||
{
|
||||
/*
|
||||
@@ -447,6 +543,7 @@ 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 */
|
||||
@@ -463,10 +560,10 @@ open_device(const char *uri, /* I - Device URI */
|
||||
{
|
||||
sprintf(device, "/dev/usb/printer%d", i);
|
||||
|
||||
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));
|
||||
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));
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -481,17 +578,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
|
||||
if (!strcmp(uri, device_uri))
|
||||
{
|
||||
/*
|
||||
* Yes, return this file descriptor...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Setting use_bc to 0!\n", stderr);
|
||||
|
||||
*use_bc = 0;
|
||||
|
||||
return (fd);
|
||||
}
|
||||
return (fd); /* Yes, return this file descriptor... */
|
||||
|
||||
/*
|
||||
* This wasn't the one...
|
||||
@@ -508,8 +595,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (busy)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer is busy; will retry in 5 seconds...\n"));
|
||||
fputs("INFO: USB printer is busy; will retry in 5 seconds...\n",
|
||||
stderr);
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
@@ -524,20 +611,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
return (-1);
|
||||
}
|
||||
#else
|
||||
{
|
||||
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);
|
||||
}
|
||||
return (open(uri + 4, O_RDWR | O_EXCL));
|
||||
#endif /* __linux */
|
||||
else
|
||||
{
|
||||
@@ -547,73 +621,6 @@ 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))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
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$".
|
||||
*/
|
||||
|
||||
+30
-27
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* USB port backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 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"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -36,7 +45,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -54,8 +62,8 @@
|
||||
|
||||
void list_devices(void);
|
||||
int print_device(const char *uri, const char *hostname,
|
||||
const char *resource, char *options,
|
||||
int print_fd, int copies, int argc, char *argv[]);
|
||||
const char *resource, const char *options,
|
||||
int fp, int copies, int argc, char *argv[]);
|
||||
|
||||
|
||||
/*
|
||||
@@ -99,8 +107,8 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
int fp, /* 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 */
|
||||
@@ -116,7 +124,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
(void)hostname;
|
||||
(void)resource;
|
||||
(void)options;
|
||||
(void)print_fd;
|
||||
(void)fp;
|
||||
(void)copies;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
@@ -138,7 +146,7 @@ int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int print_fd; /* Print file */
|
||||
int fp; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
int status; /* Exit status */
|
||||
int port; /* Port number (not used) */
|
||||
@@ -184,9 +192,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fputs("Usage: usb job-id user title copies options [file]\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -201,9 +207,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) < HTTP_URI_OK)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
|
||||
"environment variable!\n"));
|
||||
fputs("ERROR: No device URI found in argv[0] or in DEVICE_URI environment variable!\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -228,8 +232,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
print_fd = 0;
|
||||
copies = 1;
|
||||
fp = 0;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -237,10 +241,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
if ((fp = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
fprintf(stderr, "ERROR: unable to open print file %s - %s\n",
|
||||
argv[6], strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -251,15 +255,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
status = print_device(uri, hostname, resource, options, print_fd, copies,
|
||||
argc, argv);
|
||||
status = print_device(uri, hostname, resource, options, fp, copies, argc, argv);
|
||||
|
||||
/*
|
||||
* Close the input file and return...
|
||||
*/
|
||||
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
if (fp != 0)
|
||||
close(fp);
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
+14
-13
@@ -1,13 +1,14 @@
|
||||
# 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
|
||||
# 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
|
||||
|
||||
+14
-11
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# 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 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/".
|
||||
# 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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -53,12 +62,6 @@ 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
|
||||
|
||||
|
||||
#
|
||||
|
||||
+81
-25
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* "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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -56,8 +65,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
*params; /* Pointer to parameters */
|
||||
|
||||
|
||||
_cupsSetLocale(argv);
|
||||
|
||||
/*
|
||||
* Connect to the scheduler...
|
||||
*/
|
||||
@@ -228,8 +235,10 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
const char *dests) /* I - Destinations */
|
||||
{
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
*response, /* IPP Response */
|
||||
*jobs; /* IPP Get Jobs response */
|
||||
ipp_attribute_t *attr, /* Current attribute */
|
||||
*jattr; /* Current job attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char *printer, /* Printer name */
|
||||
*device, /* Device URI */
|
||||
@@ -240,13 +249,14 @@ 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 */
|
||||
{
|
||||
"device-uri",
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-name",
|
||||
"device-uri",
|
||||
"printer-state",
|
||||
"queued-job-count"
|
||||
"printer-is-accepting-jobs"
|
||||
};
|
||||
|
||||
|
||||
@@ -317,21 +327,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;
|
||||
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)
|
||||
|
||||
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;
|
||||
|
||||
if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
|
||||
attr->value_tag == IPP_TAG_BOOLEAN)
|
||||
accepting = attr->values[0].boolean;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
@@ -383,8 +393,7 @@ 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;
|
||||
@@ -410,6 +419,53 @@ 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...
|
||||
*/
|
||||
|
||||
+17
-7
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* "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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -67,9 +76,10 @@ 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 */
|
||||
|
||||
|
||||
|
||||
_cupsSetLocale(argv);
|
||||
|
||||
/*
|
||||
* Check for command-line options...
|
||||
@@ -82,8 +92,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
interval = 0;
|
||||
longstatus = 0;
|
||||
all = 0;
|
||||
language = cupsLangDefault();
|
||||
num_dests = 0;
|
||||
dests = NULL;
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
if (argv[i][0] == '+')
|
||||
|
||||
+18
-9
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* "lpr" command for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -78,14 +87,13 @@ 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;
|
||||
@@ -94,6 +102,7 @@ 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] == '-')
|
||||
@@ -223,7 +232,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-uri", email,
|
||||
num_options = cupsAddOption("notify-recipient", email,
|
||||
num_options, &options);
|
||||
}
|
||||
break;
|
||||
|
||||
+27
-29
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* "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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -46,14 +55,12 @@ 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 */
|
||||
*defdest; /* Default destination */
|
||||
cups_dest_t *dests; /* Destinations */
|
||||
http_encryption_t encryption; /* Encryption? */
|
||||
|
||||
|
||||
_cupsSetLocale(argv);
|
||||
|
||||
/*
|
||||
* Setup to cancel individual print jobs...
|
||||
*/
|
||||
@@ -64,6 +71,12 @@ 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...
|
||||
@@ -72,13 +85,10 @@ 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...
|
||||
*/
|
||||
@@ -92,7 +102,6 @@ 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"),
|
||||
@@ -143,6 +152,9 @@ 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
|
||||
@@ -160,20 +172,6 @@ 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 :
|
||||
@@ -264,7 +262,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
|
||||
/*
|
||||
* If nothing has been canceled yet, cancel the current job on the specified
|
||||
* If nothing has been cancelled yet, cancel the current job on the specified
|
||||
* (or default) printer...
|
||||
*/
|
||||
|
||||
|
||||
+55
-56
@@ -1,56 +1,55 @@
|
||||
# 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
|
||||
# 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
|
||||
|
||||
+17
-14
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# 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 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/".
|
||||
# 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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -54,12 +63,6 @@ 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
|
||||
|
||||
|
||||
#
|
||||
@@ -136,7 +139,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) $(LIBGSSAPI)
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -146,7 +149,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) $(LIBGSSAPI)
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -156,7 +159,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) $(LIBGSSAPI)
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
|
||||
+1379
-1924
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+15
-6
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Private CGI definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CGI_H_
|
||||
|
||||
+20
-11
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -86,7 +95,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* See who is logged in...
|
||||
*/
|
||||
|
||||
user = getenv("REMOTE_USER");
|
||||
if ((user = getenv("REMOTE_USER")) == NULL)
|
||||
user = "guest";
|
||||
|
||||
/*
|
||||
* Connect to the HTTP server...
|
||||
@@ -177,7 +187,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 */
|
||||
@@ -211,9 +221,8 @@ show_all_classes(http_t *http, /* I - Connection to server */
|
||||
|
||||
request = ippNewRequest(CUPS_GET_CLASSES);
|
||||
|
||||
if (user)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, user);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, user);
|
||||
|
||||
cgiGetAttributes(request, "classes.tmpl");
|
||||
|
||||
@@ -410,7 +419,7 @@ show_class(http_t *http, /* I - Connection to server */
|
||||
*/
|
||||
|
||||
cgiFormEncode(uri, pclass, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "10;URL=/classes/%s", uri);
|
||||
snprintf(refresh, sizeof(refresh), "10;/classes/%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
}
|
||||
|
||||
|
||||
+76
-424
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* On-line help index routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -19,16 +28,13 @@
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -39,118 +45,11 @@
|
||||
#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);
|
||||
@@ -164,7 +63,6 @@ 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);
|
||||
|
||||
|
||||
/*
|
||||
@@ -186,6 +84,9 @@ 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);
|
||||
}
|
||||
@@ -256,7 +157,6 @@ 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",
|
||||
@@ -292,14 +192,12 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
|
||||
cupsFileLock(fp, 1);
|
||||
|
||||
if (cupsFileGets(fp, line, sizeof(line)) && !strcmp(line, "HELPV2"))
|
||||
if (cupsFileGets(fp, line, sizeof(line)) && !strcmp(line, "HELPV1"))
|
||||
{
|
||||
/*
|
||||
* Got a valid header line, now read the data lines...
|
||||
*/
|
||||
|
||||
node = NULL;
|
||||
|
||||
while (cupsFileGets(fp, line, sizeof(line)))
|
||||
{
|
||||
/*
|
||||
@@ -307,80 +205,41 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
*
|
||||
* filename mtime offset length "section" "text"
|
||||
* filename#anchor offset length "text"
|
||||
* SP count word
|
||||
*/
|
||||
|
||||
if (line[0] == ' ')
|
||||
filename = line;
|
||||
|
||||
if ((ptr = strchr(line, ' ')) == NULL)
|
||||
break;
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
*ptr++ = '\0';
|
||||
|
||||
if ((anchor = strrchr(filename, '#')) != NULL)
|
||||
{
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
*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)
|
||||
{
|
||||
/*
|
||||
* Add a node...
|
||||
* Get section...
|
||||
*/
|
||||
|
||||
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 ++;
|
||||
text = ptr;
|
||||
sectptr = ptr;
|
||||
|
||||
while (*ptr && *ptr != '\"')
|
||||
ptr ++;
|
||||
@@ -390,14 +249,33 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
|
||||
*ptr++ = '\0';
|
||||
|
||||
if ((node = help_new_node(filename, anchor, section, text,
|
||||
mtime, offset, length)) == NULL)
|
||||
break;
|
||||
strlcpy(section, sectptr, sizeof(section));
|
||||
|
||||
node->score = -1;
|
||||
|
||||
cupsArrayAdd(hi->nodes, node);
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,7 +339,6 @@ 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));
|
||||
@@ -479,7 +356,7 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
|
||||
|
||||
cupsFileLock(fp, 1);
|
||||
|
||||
cupsFilePuts(fp, "HELPV2\n");
|
||||
cupsFilePuts(fp, "HELPV1\n");
|
||||
|
||||
for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
|
||||
node;
|
||||
@@ -505,16 +382,6 @@ 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);
|
||||
@@ -540,7 +407,6 @@ 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 */
|
||||
|
||||
@@ -621,27 +487,16 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
|
||||
continue;
|
||||
else if (filename && strcmp(node->filename, filename))
|
||||
continue;
|
||||
else
|
||||
else if ((matches = cgiDoSearch(sc, node->text)) > 0)
|
||||
{
|
||||
matches = cgiDoSearch(sc, node->text);
|
||||
/*
|
||||
* Found a match, add the node to the search index...
|
||||
*/
|
||||
|
||||
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;
|
||||
node->score = matches;
|
||||
|
||||
if (matches > 0)
|
||||
{
|
||||
/*
|
||||
* Found a match, add the node to the search index...
|
||||
*/
|
||||
|
||||
node->score = matches;
|
||||
|
||||
cupsArrayAdd(search->nodes, node);
|
||||
cupsArrayAdd(search->sorted, node);
|
||||
}
|
||||
cupsArrayAdd(search->nodes, node);
|
||||
cupsArrayAdd(search->sorted, node);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -658,61 +513,6 @@ 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.
|
||||
*/
|
||||
@@ -720,9 +520,6 @@ help_add_word(help_node_t *n, /* I - Node */
|
||||
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)
|
||||
@@ -740,36 +537,10 @@ 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.
|
||||
*/
|
||||
@@ -890,15 +661,12 @@ 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",
|
||||
@@ -1050,17 +818,6 @@ 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;
|
||||
@@ -1085,7 +842,7 @@ help_load_file(
|
||||
if (isspace(*ptr & 255))
|
||||
{
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
*ptr ++;
|
||||
|
||||
*text++ = ' ';
|
||||
}
|
||||
@@ -1104,99 +861,9 @@ 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...
|
||||
*/
|
||||
@@ -1311,21 +978,6 @@ 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$".
|
||||
*/
|
||||
|
||||
+17
-15
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* On-line help index definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_HELP_INDEX_H_
|
||||
@@ -27,26 +36,19 @@
|
||||
* Data structures...
|
||||
*/
|
||||
|
||||
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... ****/
|
||||
typedef struct /**** 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_s /**** Help index structure ****/
|
||||
typedef struct /**** Help index structure ****/
|
||||
{
|
||||
int search; /* 1 = search index, 0 = normal */
|
||||
cups_array_t *nodes; /* Nodes sorted by filename */
|
||||
|
||||
+15
-8
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -151,7 +160,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
cgiSetVariable("HELPFILE", helpfile);
|
||||
cgiSetVariable("HELPTITLE", n->text);
|
||||
cgiSetVariable("TOPIC", n->section);
|
||||
|
||||
/*
|
||||
* Send a standard page header...
|
||||
@@ -179,8 +187,7 @@ 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 ? query : "(null)", topic ? topic : "(null)");
|
||||
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n", query, topic);
|
||||
|
||||
if (si)
|
||||
{
|
||||
|
||||
+15
-7
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -166,8 +175,7 @@ cgi_null_passwd(const char *prompt) /* I - Prompt string (unused) */
|
||||
{
|
||||
(void)prompt;
|
||||
|
||||
fprintf(stderr, "DEBUG: cgi_null_passwd(prompt=\"%s\") called!\n",
|
||||
prompt ? prompt : "(null)");
|
||||
fprintf(stderr, "DEBUG: cgi_null_passwd(prompt=\"%s\") called!\n", prompt);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
+22
-154
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -101,7 +110,6 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
|
||||
*/
|
||||
|
||||
num_attrs = 0;
|
||||
attrs[0] = NULL; /* Eliminate compiler warning */
|
||||
|
||||
while ((ch = getc(in)) != EOF)
|
||||
if (ch == '\\')
|
||||
@@ -474,7 +482,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;URL=%s", uri);
|
||||
snprintf(refresh, sizeof(refresh), "2;%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
}
|
||||
|
||||
@@ -590,7 +598,7 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
|
||||
*/
|
||||
|
||||
cgiFormEncode(uri, resource, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
|
||||
snprintf(refresh, sizeof(refresh), "2;%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
}
|
||||
|
||||
@@ -766,7 +774,7 @@ cgiSetIPPObjectVars(
|
||||
|
||||
fprintf(stderr, "DEBUG2: cgiSetIPPObjectVars(obj=%p, prefix=\"%s\", "
|
||||
"element=%d)\n",
|
||||
obj, prefix ? prefix : "(null)", element);
|
||||
obj, prefix, element);
|
||||
|
||||
/*
|
||||
* Set common CGI template variables...
|
||||
@@ -819,144 +827,6 @@ 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...
|
||||
@@ -1043,7 +913,7 @@ cgiSetIPPObjectVars(
|
||||
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
"<A HREF=\"%s\">%s</A>", url,
|
||||
strrchr(attr->values[i].string.text, '/') + 1);
|
||||
strrchr(url, '/') + 1);
|
||||
}
|
||||
else
|
||||
cgiRewriteURL(attr->values[i].string.text, valptr,
|
||||
@@ -1107,9 +977,7 @@ 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_name : "(null)",
|
||||
filter_value ? filter_value : "(null)",
|
||||
prefix ? prefix : "(null)", parent_el);
|
||||
response, filter_name, filter_value, prefix, parent_el);
|
||||
|
||||
/*
|
||||
* Set common CGI template variables...
|
||||
@@ -1167,9 +1035,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);
|
||||
fprintf(stderr, "DEBUG2: Returing %d from cgiSetIPPVars()...\n", element + 1);
|
||||
|
||||
return (element);
|
||||
return (element + 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+14
-19
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -172,20 +181,6 @@ 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)
|
||||
|
||||
+22
-13
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -89,7 +98,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* See who is logged in...
|
||||
*/
|
||||
|
||||
user = getenv("REMOTE_USER");
|
||||
if ((user = getenv("REMOTE_USER")) == NULL)
|
||||
user = "guest";
|
||||
|
||||
/*
|
||||
* Connect to the HTTP server...
|
||||
@@ -277,7 +287,7 @@ print_command(http_t *http, /* I - Connection to server */
|
||||
*/
|
||||
|
||||
cgiFormEncode(uri, resource, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
|
||||
snprintf(refresh, sizeof(refresh), "2;%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
}
|
||||
|
||||
@@ -321,7 +331,7 @@ show_all_printers(http_t *http, /* I - Connection to server */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: show_all_printers(http=%p, user=\"%s\")\n",
|
||||
http, user ? user : "(null)");
|
||||
http, user);
|
||||
|
||||
/*
|
||||
* Show the standard header...
|
||||
@@ -347,9 +357,8 @@ show_all_printers(http_t *http, /* I - Connection to server */
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM,
|
||||
"printer-type-mask", CUPS_PRINTER_CLASS);
|
||||
|
||||
if (user)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, user);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, user);
|
||||
|
||||
cgiGetAttributes(request, "printers.tmpl");
|
||||
|
||||
@@ -534,7 +543,7 @@ show_printer(http_t *http, /* I - Connection to server */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: show_printer(http=%p, printer=\"%s\")\n",
|
||||
http, printer ? printer : "(null)");
|
||||
http, printer);
|
||||
|
||||
/*
|
||||
* Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following
|
||||
@@ -585,7 +594,7 @@ show_printer(http_t *http, /* I - Connection to server */
|
||||
*/
|
||||
|
||||
cgiFormEncode(uri, printer, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "10;URL=/printers/%s", uri);
|
||||
snprintf(refresh, sizeof(refresh), "10;/printers/%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
}
|
||||
|
||||
|
||||
+15
-8
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Search routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -216,8 +225,6 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
*sptr++ = *qptr++;
|
||||
}
|
||||
|
||||
*sptr = '\0';
|
||||
|
||||
/*
|
||||
* For "word1 AND word2", add reciprocal "word2 AND word1"...
|
||||
*/
|
||||
|
||||
+53
-78
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -35,7 +44,6 @@
|
||||
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);
|
||||
|
||||
|
||||
/*
|
||||
@@ -50,8 +58,8 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
|
||||
FILE *in; /* Input file */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG2: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
|
||||
tmpl ? tmpl : "(null)");
|
||||
fprintf(stderr, "DEBUG: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
|
||||
tmpl);
|
||||
|
||||
/*
|
||||
* Open the template file...
|
||||
@@ -60,7 +68,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 ? tmpl : "(null)", strerror(errno));
|
||||
tmpl, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,34 +93,36 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
|
||||
void
|
||||
cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[1024], /* Filename */
|
||||
locale[16], /* Locale name */
|
||||
*locptr; /* Pointer into locale name */
|
||||
locale[16]; /* Locale name */
|
||||
const char *directory, /* Directory for templates */
|
||||
*lang; /* Language */
|
||||
FILE *in; /* Input file */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG2: cgiCopyTemplateLang(tmpl=\"%s\")\n",
|
||||
tmpl ? tmpl : "(null)");
|
||||
fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n", tmpl);
|
||||
|
||||
/*
|
||||
* Convert the language to a locale name...
|
||||
*/
|
||||
|
||||
locale[0] = '\0';
|
||||
|
||||
if ((lang = getenv("LANG")) != NULL)
|
||||
{
|
||||
locale[0] = '/';
|
||||
strlcpy(locale + 1, lang, sizeof(locale) - 1);
|
||||
for (i = 0; lang[i] && i < 15; i ++)
|
||||
if (isalnum(lang[i] & 255) || lang[i] == '_')
|
||||
locale[i] = tolower(lang[i]);
|
||||
else if (lang[i] == '-')
|
||||
locale[i] = '_';
|
||||
else
|
||||
break;
|
||||
|
||||
if ((locptr = strchr(locale, '.')) != NULL)
|
||||
*locptr = '\0'; /* Strip charset */
|
||||
locale[i] = '\0';
|
||||
}
|
||||
else
|
||||
locale[0] = '\0';
|
||||
|
||||
fprintf(stderr, "DEBUG: lang=\"%s\", locale=\"%s\"...\n",
|
||||
lang ? lang : "(null)", locale);
|
||||
fprintf(stderr, "DEBUG: locale=\"%s\"...\n", locale);
|
||||
|
||||
/*
|
||||
* See if we have a template file for this language...
|
||||
@@ -120,26 +130,23 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
|
||||
directory = cgiGetTemplateDir();
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
{
|
||||
locale[3] = '\0';
|
||||
locale[2] = '\0';
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
snprintf(filename, sizeof(filename), "%s/%s", directory, tmpl);
|
||||
in = fopen(filename, "r");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG2: Template file is \"%s\"...\n", filename);
|
||||
fprintf(stderr, "DEBUG: Template file is \"%s\"...\n", filename);
|
||||
|
||||
/*
|
||||
* Open the template file...
|
||||
*/
|
||||
|
||||
if (!in)
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
|
||||
filename, strerror(errno));
|
||||
@@ -228,10 +235,9 @@ 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, "DEBUG2: %*sStarting at file position %ld...\n", indent, "",
|
||||
fprintf(stderr, "DEBUG: %*sStarting at file position %ld...\n", indent, "",
|
||||
ftell(in));
|
||||
|
||||
/*
|
||||
@@ -247,13 +253,9 @@ 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))
|
||||
@@ -263,7 +265,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
|
||||
if (s == name && isspace(ch & 255))
|
||||
{
|
||||
fprintf(stderr, "DEBUG2: %*sLone { at %ld...\n", indent, "", ftell(in));
|
||||
fprintf(stderr, "DEBUG: %*sLone { at %ld...\n", indent, "", ftell(in));
|
||||
|
||||
if (out)
|
||||
{
|
||||
@@ -275,7 +277,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
}
|
||||
|
||||
if (ch == '}')
|
||||
fprintf(stderr, "DEBUG2: %*s\"{%s}\" at %ld...\n", indent, "", name,
|
||||
fprintf(stderr, "DEBUG: %*s\"{%s}\" at %ld...\n", indent, "", name,
|
||||
ftell(in));
|
||||
|
||||
/*
|
||||
@@ -339,7 +341,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
|
||||
pos = ftell(in);
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sLooping on \"%s\" at %ld, count=%d...\n",
|
||||
fprintf(stderr, "DEBUG: %*sLooping on \"%s\" at %ld, count=%d...\n",
|
||||
indent, "", name + 1, pos, count);
|
||||
|
||||
if (count > 0)
|
||||
@@ -355,7 +357,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
else
|
||||
cgi_copy(NULL, in, 0, '}', indent + 2);
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sFinished looping on \"%s\"...\n", indent,
|
||||
fprintf(stderr, "DEBUG: %*sFinished looping on \"%s\"...\n", indent,
|
||||
"", name + 1);
|
||||
|
||||
continue;
|
||||
@@ -397,14 +399,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
*/
|
||||
|
||||
if (out)
|
||||
{
|
||||
if (uriencode)
|
||||
cgi_puturi(outptr, out);
|
||||
else if (!strcasecmp(name, "?cupsdconf_default"))
|
||||
fputs(outptr, stdout);
|
||||
else
|
||||
cgi_puts(outptr, out);
|
||||
}
|
||||
cgi_puts(outptr, out);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -493,7 +488,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
if (ch != '?')
|
||||
{
|
||||
fprintf(stderr,
|
||||
"DEBUG2: %*sBad terminator '%c' at file position %ld...\n",
|
||||
"DEBUG: %*sBad terminator '%c' at file position %ld...\n",
|
||||
indent, "", ch, ftell(in));
|
||||
return;
|
||||
}
|
||||
@@ -523,7 +518,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
"DEBUG2: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
|
||||
"DEBUG: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
|
||||
indent, "", name, op, compare, ftell(in), result);
|
||||
|
||||
if (result)
|
||||
@@ -532,10 +527,10 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
* Comparison true; output first part and ignore second...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sOutput first part...\n", indent, "");
|
||||
fprintf(stderr, "DEBUG: %*sOutput first part...\n", indent, "");
|
||||
cgi_copy(out, in, element, ':', indent + 2);
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sSkip second part...\n", indent, "");
|
||||
fprintf(stderr, "DEBUG: %*sSkip second part...\n", indent, "");
|
||||
cgi_copy(NULL, in, element, '}', indent + 2);
|
||||
}
|
||||
else
|
||||
@@ -544,14 +539,14 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
* Comparison false; ignore first part and output second...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sSkip first part...\n", indent, "");
|
||||
fprintf(stderr, "DEBUG: %*sSkip first part...\n", indent, "");
|
||||
cgi_copy(NULL, in, element, ':', indent + 2);
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sOutput second part...\n", indent, "");
|
||||
fprintf(stderr, "DEBUG: %*sOutput second part...\n", indent, "");
|
||||
cgi_copy(out, in, element, '}', indent + 2);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
|
||||
fprintf(stderr, "DEBUG: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
|
||||
name, op, compare, out);
|
||||
}
|
||||
else if (ch == '\\') /* Quoted char */
|
||||
@@ -565,11 +560,11 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
putc(ch, out);
|
||||
|
||||
if (ch == EOF)
|
||||
fprintf(stderr, "DEBUG2: %*sReturning at file position %ld on EOF...\n",
|
||||
fprintf(stderr, "DEBUG: %*sReturning at file position %ld on EOF...\n",
|
||||
indent, "", ftell(in));
|
||||
else
|
||||
fprintf(stderr,
|
||||
"DEBUG2: %*sReturning at file position %ld on character '%c'...\n",
|
||||
"DEBUG: %*sReturning at file position %ld on character '%c'...\n",
|
||||
indent, "", ftell(in), ch);
|
||||
|
||||
if (ch == EOF && term)
|
||||
@@ -642,26 +637,6 @@ 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$".
|
||||
*/
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+17
-12
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Help index test program for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -96,15 +105,11 @@ 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\"", i, node->filename, node->anchor,
|
||||
printf(" %d: %s#%s \"%s\"\n", i, node->filename, node->anchor,
|
||||
node->text);
|
||||
else
|
||||
printf(" %d: %s \"%s\"", i, node->filename, node->text);
|
||||
|
||||
printf(" (%d words)\n", cupsArrayCount(node->words));
|
||||
}
|
||||
printf(" %d: %s \"%s\"\n", i, node->filename, node->text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,15 +12,13 @@ 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 <em>first</em> anchor.</P>
|
||||
<P>This is some text for the first 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>
|
||||
|
||||
|
||||
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+15
-7
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* 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 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/".
|
||||
* 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
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -940,8 +949,7 @@ cgi_passwd(const char *prompt) /* I - Prompt (not used) */
|
||||
{
|
||||
(void)prompt;
|
||||
|
||||
fprintf(stderr, "DEBUG: cgi_passwd(prompt=\"%s\") called!\n",
|
||||
prompt ? prompt : "(null)");
|
||||
fprintf(stderr, "DEBUG: cgi_passwd(prompt=\"%s\") called!\n", prompt);
|
||||
|
||||
/*
|
||||
* Send a 401 (unauthorized) status to the server, so it can notify
|
||||
|
||||
+17
-7
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# 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 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/".
|
||||
# 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
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -19,7 +28,7 @@ include ../Makedefs
|
||||
# Config files...
|
||||
#
|
||||
|
||||
KEEP = cupsd.conf snmp.conf
|
||||
KEEP = cupsd.conf
|
||||
REPLACE = mime.convs mime.types
|
||||
|
||||
|
||||
@@ -65,7 +74,8 @@ install: all
|
||||
if test -r $(SERVERROOT)/$$file ; then \
|
||||
$(MV) $(SERVERROOT)/$$file $(SERVERROOT)/$$file.O ; \
|
||||
fi ; \
|
||||
$(INSTALL_DATA) $$file $(SERVERROOT) ; \
|
||||
$(INSTALL_CONFIG) $$file $(SERVERROOT) ; \
|
||||
chgrp $(CUPS_GROUP) $(SERVERROOT)/$$file || true; \
|
||||
done
|
||||
-if test x$(PAMDIR) != x; then \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(PAMDIR); \
|
||||
|
||||
+7
-16
@@ -12,7 +12,6 @@ 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@
|
||||
@@ -21,7 +20,7 @@ Listen localhost:@DEFAULT_IPP_PORT@
|
||||
# Show shared printers on the local network.
|
||||
Browsing On
|
||||
BrowseOrder allow,deny
|
||||
BrowseAllow all
|
||||
BrowseAllow @LOCAL
|
||||
|
||||
# Default authentication type, when authentication is required...
|
||||
DefaultAuthType Basic
|
||||
@@ -34,14 +33,13 @@ 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 Default
|
||||
AuthType Basic
|
||||
Require user @SYSTEM
|
||||
Order allow,deny
|
||||
Allow localhost
|
||||
@@ -49,29 +47,22 @@ DefaultAuthType Basic
|
||||
|
||||
# Set the default printer/job policies...
|
||||
<Policy default>
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
# Job-related operations must be done by the owner or an adminstrator...
|
||||
<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 administrator to authenticate...
|
||||
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
|
||||
AuthType Default
|
||||
# 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
|
||||
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 @CUPS_DEFAULT_PRINTADMIN_AUTH@
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
#
|
||||
# "$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.
|
||||
# "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $"
|
||||
#
|
||||
# MIME converts file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
# Copyright 1997-2005 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# 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
|
||||
#
|
||||
|
||||
########################################################################
|
||||
@@ -95,19 +100,20 @@ image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
|
||||
#image/x-xwindowdump application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
|
||||
|
||||
# pstoraster is part of GPL Ghostscript...
|
||||
application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
# pstoraster is now part of ESP Ghostscript...
|
||||
#application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Raw filter...
|
||||
#
|
||||
# Uncomment the following filter to allow printing of arbitrary files
|
||||
# without the -oraw option.
|
||||
# Uncomment the following filter and the application/octet-stream type
|
||||
# in mime.types to allow printing of arbitrary files without the -oraw
|
||||
# option.
|
||||
#
|
||||
|
||||
@DEFAULT_RAW_PRINTING@application/octet-stream application/vnd.cups-raw 0 -
|
||||
#application/octet-stream application/vnd.cups-raw 0 -
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $".
|
||||
#
|
||||
+33
-37
@@ -1,20 +1,25 @@
|
||||
#
|
||||
# "$Id: mime.types 6649 2007-07-11 21:46:42Z mike $"
|
||||
# "$Id: mime.types 5375 2006-04-06 20:10:55Z mike $"
|
||||
#
|
||||
# MIME types file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# 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.
|
||||
# Copyright 1997-2005 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# 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
|
||||
#
|
||||
|
||||
########################################################################
|
||||
@@ -69,20 +74,20 @@
|
||||
application/pdf pdf string(0,%PDF)
|
||||
application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
contains(0,128,<1B>%-12345X) + \
|
||||
(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 \
|
||||
(contains(0,1024,"LANGUAGE=POSTSCRIPT") \
|
||||
contains(0,1024,"LANGUAGE = Postscript") \
|
||||
contains(0,1024,"LANGUAGE = PostScript") \
|
||||
contains(0,1024,"LANGUAGE = POSTSCRIPT") \
|
||||
(contains(0,1024,<0a>%!) + \
|
||||
!contains(0,1024,"ENTER LANGUAGE")))
|
||||
application/vnd.hp-HPGL hpgl string(0,<1B>&)\
|
||||
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,4096,"LANGUAGE=HPGL") \
|
||||
contains(0,4096,"LANGUAGE = HPGL")))
|
||||
(contains(0,1024,"LANGUAGE=HPGL") \
|
||||
contains(0,1024,"LANGUAGE = HPGL")))
|
||||
|
||||
########################################################################
|
||||
#
|
||||
@@ -96,7 +101,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<002A>) string(0,II<2A00>)
|
||||
image/tiff tiff tif string(0,MM) string(0,II)
|
||||
image/x-photocd pcd string(2048,PCD_IPI)
|
||||
image/x-portable-anymap pnm
|
||||
image/x-portable-bitmap pbm string(0,P1) string(0,P4)
|
||||
@@ -135,15 +140,6 @@ 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...
|
||||
@@ -151,25 +147,25 @@ application/rss+xml rss
|
||||
|
||||
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,4096,"LANGUAGE=PCL") \
|
||||
contains(0,4096,"LANGUAGE = PCL")))
|
||||
(contains(0,1024,"LANGUAGE=PCL") \
|
||||
contains(0,1024,"LANGUAGE = PCL")))
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Raw print file support...
|
||||
#
|
||||
# Comment the following type to prevent raw file printing.
|
||||
# Uncomment the following type and the application/octet-stream
|
||||
# filter line in mime.convs to allow raw file printing without the
|
||||
# -oraw option.
|
||||
#
|
||||
|
||||
application/octet-stream
|
||||
#application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 6649 2007-07-11 21:46:42Z mike $".
|
||||
# End of "$Id: mime.types 5375 2006-04-06 20:10:55Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# "$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$".
|
||||
#
|
||||
@@ -1,140 +0,0 @@
|
||||
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
|
||||
@@ -1,30 +1,39 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 6981 2007-09-19 21:51:55Z mike $"
|
||||
dnl "$Id: cups-common.m4 5354 2006-03-29 20:55:15Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
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 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
|
||||
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
dnl We need at least autoconf 2.50...
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Versio number information...
|
||||
CUPS_VERSION="1.3.3"
|
||||
CUPS_VERSION="1.2svn"
|
||||
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)
|
||||
@@ -123,9 +132,6 @@ 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/param.h,AC_DEFINE(HAVE_SYS_PARAM_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)
|
||||
@@ -158,7 +164,8 @@ esac
|
||||
AC_CHECK_FUNCS(sigaction)
|
||||
|
||||
dnl Checks for wait functions.
|
||||
AC_CHECK_FUNCS(waitpid wait3)
|
||||
AC_CHECK_FUNCS(waitpid)
|
||||
AC_CHECK_FUNCS(wait3)
|
||||
|
||||
dnl See if the tm structure has the tm_gmtoff member...
|
||||
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
|
||||
@@ -168,9 +175,6 @@ 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*)
|
||||
@@ -187,22 +191,13 @@ 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="-sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration"
|
||||
CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
|
||||
LIBS="-framework CoreFoundation $LIBS"
|
||||
|
||||
dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
|
||||
@@ -219,24 +214,13 @@ 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...
|
||||
dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
|
||||
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*)
|
||||
@@ -247,14 +231,12 @@ 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_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")
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
@@ -263,10 +245,6 @@ 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=""
|
||||
@@ -287,5 +265,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 6981 2007-09-19 21:51:55Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 5354 2006-03-29 20:55:15Z mike $".
|
||||
dnl
|
||||
|
||||
+159
-190
@@ -1,94 +1,85 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 6976 2007-09-18 20:39:31Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 5288 2006-03-14 02:38:07Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
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 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
|
||||
|
||||
dnl Clear the debugging and non-shared library options unless the user asks
|
||||
dnl for them...
|
||||
ARCHFLAGS=""
|
||||
OPTIM=""
|
||||
AC_SUBST(ARCHFLAGS)
|
||||
AC_SUBST(OPTIM)
|
||||
|
||||
AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ])
|
||||
AC_ARG_WITH(archflags, [ --with-arch="flags" set default architecture 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_WITH(arch32flags, [ --with-arch32flags="flags"
|
||||
specifies 32-bit architecture flags])
|
||||
AC_ARG_ENABLE(32bit, [ --enable-32bit generate 32-bit libraries on 32/64-bit systems, default=no])
|
||||
AC_ARG_WITH(arch32flags, [ --with-arch32="flags" specifies 32-bit architecture flags])
|
||||
|
||||
ARCH32FLAGS=""
|
||||
INSTALL32=""
|
||||
LIB32CUPS=""
|
||||
LIB32CUPSIMAGE=""
|
||||
LIB32DIR=""
|
||||
UNINSTALL32=""
|
||||
|
||||
AC_SUBST(ARCH32FLAGS)
|
||||
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])
|
||||
AC_ARG_WITH(arch64flags, [ --with-arch64="flags" specifies 64-bit architecture flags])
|
||||
|
||||
AC_ARG_WITH(arch64flags, [ --with-arch64flags="flags"
|
||||
specifies 64-bit architecture flags])
|
||||
ARCH64FLAGS=""
|
||||
INSTALL64=""
|
||||
LIB64CUPS=""
|
||||
LIB64CUPSIMAGE=""
|
||||
LIB64DIR=""
|
||||
UNINSTALL64=""
|
||||
|
||||
AC_SUBST(ARCH64FLAGS)
|
||||
AC_SUBST(INSTALL64)
|
||||
AC_SUBST(LIB64CUPS)
|
||||
AC_SUBST(LIB64CUPSIMAGE)
|
||||
AC_SUBST(LIB64DIR)
|
||||
AC_SUBST(UNINSTALL64)
|
||||
|
||||
dnl Position-Independent Executable support on Linux...
|
||||
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 Position-Independent Executable support on Linux and *BSD...
|
||||
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fpie 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
|
||||
@@ -105,17 +96,8 @@ if test -n "$GCC"; then
|
||||
case $uname in
|
||||
Linux*)
|
||||
if test x$enable_pie = xyes; then
|
||||
PIEFLAGS="-pie -fPIE"
|
||||
fi
|
||||
|
||||
if test x$enable_relro = xyes; then
|
||||
RELROFLAGS="-Wl,-z,relro"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test x$enable_pie = xyes; then
|
||||
echo "Sorry, --enable-pie is not supported on this OS!"
|
||||
OPTIM="$OPTIM -fpie"
|
||||
LDFLAGS="$LDFLAGS -pie"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -128,39 +110,14 @@ if test -n "$GCC"; then
|
||||
fi
|
||||
|
||||
case "$uname" in
|
||||
HP-UX*)
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# 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
|
||||
# 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
|
||||
Darwin*)
|
||||
if test -z "$with_archflags"; then
|
||||
if test "x`uname -m`" = xi386; then
|
||||
# Build universal binaries for OSX on Intel...
|
||||
ARCHFLAGS="-arch i386 -arch ppc"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -172,6 +129,11 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="libcups.32.so.2"
|
||||
LIB32CUPSIMAGE="libcupsimage.32.so.2"
|
||||
LIB32DIR="$prefix/lib32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
@@ -179,6 +141,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -189,6 +153,11 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="libcups.64.so.2"
|
||||
LIB64CUPSIMAGE="libcupsimage.64.so.2"
|
||||
LIB64DIR="$prefix/lib64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -196,6 +165,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@@ -208,6 +179,14 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
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"
|
||||
fi
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
@@ -215,6 +194,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -225,6 +206,14 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="libcups.64.so.2"
|
||||
LIB64CUPSIMAGE="libcupsimage.64.so.2"
|
||||
LIB64DIR="$exec_prefix/lib"
|
||||
if test -d /usr/lib64; then
|
||||
LIB64DIR="${LIB64DIR}64"
|
||||
fi
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -232,6 +221,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@@ -244,6 +235,11 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="libcups.32.so.2"
|
||||
LIB32CUPSIMAGE="libcupsimage.32.so.2"
|
||||
LIB32DIR="$exec_prefix/lib/32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
@@ -251,6 +247,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -261,6 +259,11 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="libcups.64.so.2"
|
||||
LIB64CUPSIMAGE="libcupsimage.64.so.2"
|
||||
LIB64DIR="$exec_prefix/lib/64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -268,12 +271,13 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# Add vendor-specific compiler options...
|
||||
case $uname in
|
||||
AIX*)
|
||||
if test -z "$OPTIM"; then
|
||||
@@ -298,43 +302,13 @@ else
|
||||
# Warning 829 is passing constant string as char *
|
||||
CXXFLAGS="+W336,829 $CXXFLAGS"
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
OPTIM="+DAportable $OPTIM"
|
||||
fi
|
||||
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="+z $OPTIM"
|
||||
fi
|
||||
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCH32FLAGS="+DD32"
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCHFLAGS="+DD64"
|
||||
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="+DD64"
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCHFLAGS="+DD32"
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
IRIX)
|
||||
if test -z "$OPTIM"; then
|
||||
@@ -356,6 +330,11 @@ else
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="libcups.32.so.2"
|
||||
LIB32CUPSIMAGE="libcupsimage.32.so.2"
|
||||
LIB32DIR="$prefix/lib32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
@@ -363,6 +342,8 @@ else
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -373,6 +354,11 @@ else
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="libcups.64.so.2"
|
||||
LIB64CUPSIMAGE="libcupsimage.64.so.2"
|
||||
LIB64DIR="$prefix/lib64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -380,16 +366,8 @@ else
|
||||
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"
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@@ -397,7 +375,7 @@ else
|
||||
# Solaris
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
OPTIM="-xO2"
|
||||
OPTIM="-xO4"
|
||||
else
|
||||
OPTIM="$with_optim $OPTIM"
|
||||
fi
|
||||
@@ -411,39 +389,43 @@ else
|
||||
# Compiling on a Solaris system, build 64-bit
|
||||
# binaries with separate 32-bit libraries...
|
||||
ARCH32FLAGS="-xarch=generic"
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="libcups.32.so.2"
|
||||
LIB32CUPSIMAGE="libcupsimage.32.so.2"
|
||||
LIB32DIR="$exec_prefix/lib/32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
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
|
||||
CFLAGS="-xarch=generic64 $CFLAGS"
|
||||
fi
|
||||
else
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries...
|
||||
ARCH64FLAGS="-xarch=generic64"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="libcups.64.so.2"
|
||||
LIB64CUPSIMAGE="libcupsimage.64.so.2"
|
||||
LIB64DIR="$exec_prefix/lib/64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
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"
|
||||
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"
|
||||
CFLAGS="-xarch=generic $CFLAGS"
|
||||
fi
|
||||
else
|
||||
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"
|
||||
CFLAGS="-xarch=generic $CFLAGS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -474,29 +456,16 @@ else
|
||||
esac
|
||||
fi
|
||||
|
||||
# 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"
|
||||
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"
|
||||
|
||||
# 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
|
||||
# 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
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 6976 2007-09-18 20:39:31Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 5288 2006-03-14 02:38:07Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,32 +1,36 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 6754 2007-08-01 19:00:07Z mike $"
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for the Common UNIX Printing System
|
||||
dnl (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
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 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
|
||||
|
||||
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])
|
||||
dnl Default langugages...
|
||||
AC_ARG_WITH(languages, [ --with-languages set installed languages, default="es ja" ],
|
||||
LANGUAGES="$withval",
|
||||
LANGUAGES="es ja")
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl Default ConfigFilePerm
|
||||
AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
|
||||
AC_ARG_WITH(config_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"
|
||||
@@ -37,7 +41,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_file_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
|
||||
AC_ARG_WITH(log_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)
|
||||
@@ -55,47 +59,17 @@ fi
|
||||
AC_SUBST(CUPS_BROWSING)
|
||||
|
||||
dnl Default BrowseLocalProtocols
|
||||
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_ARG_WITH(browse_local, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
|
||||
CUPS_BROWSE_LOCAL_PROTOCOLS="$withval",
|
||||
CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS")
|
||||
AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
|
||||
"$CUPS_BROWSE_LOCAL_PROTOCOLS")
|
||||
|
||||
dnl Default BrowseRemoteProtocols
|
||||
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_ARG_WITH(browse_remote, [ --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
|
||||
CUPS_BROWSE_REMOTE_PROTOCOLS="$withval",
|
||||
CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS")
|
||||
AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS,
|
||||
"$CUPS_BROWSE_REMOTE_PROTOCOLS")
|
||||
@@ -136,11 +110,11 @@ fi
|
||||
AC_SUBST(CUPS_IMPLICIT_CLASSES)
|
||||
|
||||
dnl Default UseNetworkDefault
|
||||
AC_ARG_ENABLE(use_network_default, [ --enable-use-network-default
|
||||
AC_ARG_ENABLE(network_default, [ --enable-use-network-default
|
||||
enable UseNetworkDefault by default, default=auto])
|
||||
if test "x$enable_use_network_default" != xno; then
|
||||
if test "x$enable_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
|
||||
if test "x$enable_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)
|
||||
@@ -156,17 +130,10 @@ 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 x$uname = xDarwin; then
|
||||
if test x`id -u _lp 2>/dev/null` = x; then
|
||||
CUPS_USER="lp";
|
||||
else
|
||||
CUPS_USER="_lp";
|
||||
fi
|
||||
AC_MSG_RESULT($CUPS_USER)
|
||||
elif test -f /etc/passwd; then
|
||||
if test -f /etc/passwd; then
|
||||
CUPS_USER=""
|
||||
for user in lp lpd guest daemon nobody; do
|
||||
if test "`grep \^${user}: /etc/passwd`" != ""; then
|
||||
@@ -185,18 +152,11 @@ 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 x$uname = xDarwin; then
|
||||
if test x`id -g _lp 2>/dev/null` = x; then
|
||||
CUPS_GROUP="lp";
|
||||
else
|
||||
CUPS_GROUP="_lp";
|
||||
fi
|
||||
AC_MSG_RESULT($CUPS_GROUP)
|
||||
elif test -f /etc/group; then
|
||||
GROUP_LIST="_lp lp nobody"
|
||||
if test -f /etc/group; then
|
||||
GROUP_LIST="lp nobody"
|
||||
CUPS_GROUP=""
|
||||
for group in $GROUP_LIST; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
@@ -215,37 +175,37 @@ 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
|
||||
CUPS_SYSTEM_GROUPS="admin"
|
||||
GROUP_LIST="admin"
|
||||
else
|
||||
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
|
||||
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"
|
||||
fi
|
||||
done
|
||||
|
||||
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
|
||||
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
|
||||
AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
|
||||
fi
|
||||
fi)
|
||||
done
|
||||
|
||||
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
|
||||
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}'`"
|
||||
|
||||
@@ -259,27 +219,13 @@ 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],
|
||||
AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
|
||||
default_printcap="$withval",
|
||||
default_printcap="default")
|
||||
default_printcap="/etc/printcap")
|
||||
|
||||
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
|
||||
if test x$enable_printcap != xno -a x$default_printcap != xno; then
|
||||
if test "x$default_printcap" = "x/etc/printcap" -a "$uname" = "Darwin" -a $uversion -ge 90; then
|
||||
CUPS_DEFAULT_PRINTCAP=""
|
||||
else
|
||||
CUPS_DEFAULT_PRINTCAP="$default_printcap"
|
||||
fi
|
||||
@@ -289,54 +235,6 @@ 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: cups-defaults.m4 6754 2007-08-01 19:00:07Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-directories.m4 6976 2007-09-18 20:39:31Z mike $"
|
||||
dnl "$Id: cups-directories.m4 5314 2006-03-20 19:06:50Z mike $"
|
||||
dnl
|
||||
dnl Directory stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
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 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
|
||||
|
||||
AC_PREFIX_DEFAULT(/)
|
||||
@@ -48,15 +57,6 @@ 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,8 +64,6 @@ 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...
|
||||
@@ -99,68 +97,42 @@ if test "$sysconfdir" = "\${prefix}/etc"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Fix "libdir" variable...
|
||||
dnl Fix "libdir" variable for IRIX 6.x...
|
||||
if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
case "$uname" in
|
||||
IRIX*)
|
||||
libdir="$exec_prefix/lib32"
|
||||
;;
|
||||
Linux*)
|
||||
if test -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
fi
|
||||
;;
|
||||
HP-UX*)
|
||||
if test -d /usr/lib/hpux32; then
|
||||
libdir="$exec_prefix/lib/hpux32"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$uname" = "IRIX"; then
|
||||
libdir="$exec_prefix/lib32"
|
||||
else
|
||||
if test "$uname" = Linux -a -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
else
|
||||
libdir="$exec_prefix/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
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
|
||||
AIX*)
|
||||
INITDIR="/etc/rc.d"
|
||||
FreeBSD* | OpenBSD*)
|
||||
# FreeBSD and OpenBSD
|
||||
INITDIR=""
|
||||
INITDDIR=""
|
||||
;;
|
||||
|
||||
NetBSD*)
|
||||
# NetBSD
|
||||
INITDIR=""
|
||||
INITDDIR="/etc/rc.d"
|
||||
;;
|
||||
|
||||
Darwin*)
|
||||
# Darwin and MacOS X...
|
||||
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="380"
|
||||
RCSTOP="620"
|
||||
;;
|
||||
|
||||
IRIX*)
|
||||
# IRIX
|
||||
INITDIR="/etc"
|
||||
RCSTART="60"
|
||||
RCSTOP="25"
|
||||
INITDIR=""
|
||||
AC_CHECK_PROG(INITDDIR, launchd,
|
||||
"/System/Library/LaunchDaemons",
|
||||
"/System/Library/StartupItems/PrintingServices")
|
||||
;;
|
||||
|
||||
Linux | GNU)
|
||||
@@ -168,64 +140,52 @@ 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"
|
||||
;;
|
||||
|
||||
NetBSD*)
|
||||
# NetBSD
|
||||
INITDDIR="/etc/rc.d"
|
||||
;;
|
||||
|
||||
OSF1*)
|
||||
OSF1* | HP-UX*)
|
||||
INITDIR="/sbin"
|
||||
INITDDIR="../init.d"
|
||||
;;
|
||||
|
||||
SunOS*)
|
||||
# Solaris
|
||||
INITDIR="/etc"
|
||||
RCSTART="81"
|
||||
AIX*)
|
||||
INITDIR="/etc/rc.d"
|
||||
INITDDIR=".."
|
||||
;;
|
||||
|
||||
*)
|
||||
INITDIR="/etc"
|
||||
INITDDIR="../init.d"
|
||||
;;
|
||||
|
||||
esac
|
||||
else
|
||||
if test "x$rclevels" = x; then
|
||||
INITDDIR="$rcdir"
|
||||
else
|
||||
INITDIR="$rcdir"
|
||||
fi
|
||||
INITDIR=""
|
||||
INITDDIR="$rcdir"
|
||||
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
|
||||
XINETD=""
|
||||
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
|
||||
|
||||
AC_SUBST(XINETD)
|
||||
|
||||
@@ -235,7 +195,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/spool/cups/cache"
|
||||
CUPS_CACHEDIR="$localstatedir/tmp/cups"
|
||||
else
|
||||
CUPS_CACHEDIR="$localstatedir/cache/cups"
|
||||
fi
|
||||
@@ -250,28 +210,6 @@ 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="")
|
||||
|
||||
@@ -297,26 +235,21 @@ fi
|
||||
AC_SUBST(CUPS_FONTPATH)
|
||||
AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
|
||||
|
||||
# Locale data (initial assignment allows us not to require autoconf 2.60)
|
||||
localedir="${localedir:=}"
|
||||
if test "$localedir" = "\${datarootdir}/locale" -o "$localedir" = ""; then
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
CUPS_LOCALEDIR="$datadir/locale"
|
||||
;;
|
||||
# Locale data
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
CUPS_LOCALEDIR="$datadir/locale"
|
||||
;;
|
||||
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
CUPS_LOCALEDIR="$localedir"
|
||||
fi
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
|
||||
AC_SUBST(CUPS_LOCALEDIR)
|
||||
@@ -367,5 +300,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
|
||||
AC_SUBST(CUPS_STATEDIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-directories.m4 6976 2007-09-18 20:39:31Z mike $".
|
||||
dnl End of "$Id: cups-directories.m4 5314 2006-03-20 19:06:50Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
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
|
||||
@@ -1,111 +0,0 @@
|
||||
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_new_unique, AC_DEFINE(HAVE_KRB5_CC_NEW_UNIQUE))
|
||||
|
||||
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
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-image.m4 5311 2006-03-19 13:21:42Z mike $"
|
||||
dnl
|
||||
dnl Image library/filter 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 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
|
||||
|
||||
dnl See if we want the image filters included at all...
|
||||
@@ -29,6 +38,10 @@ fi
|
||||
|
||||
AC_SUBST(IMGFILTERS)
|
||||
|
||||
dnl Save the current libraries since we don't want the image libraries
|
||||
dnl included with every program...
|
||||
SAVELIBS="$LIBS"
|
||||
|
||||
dnl Check for image libraries...
|
||||
AC_ARG_ENABLE(jpeg, [ --enable-jpeg turn on JPEG support, default=yes])
|
||||
AC_ARG_ENABLE(png, [ --enable-png turn on PNG support, default=yes])
|
||||
@@ -44,14 +57,6 @@ 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,
|
||||
@@ -62,24 +67,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...
|
||||
dnl PNG library uses math library functions...
|
||||
AC_CHECK_LIB(m, pow)
|
||||
|
||||
if test x$enable_png != xno; then
|
||||
AC_CHECK_HEADER(png.h,
|
||||
AC_CHECK_LIB(png, png_create_read_struct,
|
||||
AC_CHECK_LIB(png, png_set_tRNS_to_alpha,
|
||||
AC_DEFINE(HAVE_LIBPNG)
|
||||
LIBPNG="-lpng"))
|
||||
LIBPNG="-lpng -lm"))
|
||||
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,
|
||||
@@ -105,5 +110,5 @@ AC_SUBST(EXPORT_LIBZ)
|
||||
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-image.m4 5311 2006-03-19 13:21:42Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-largefile.m4 4732 2005-09-30 23:23:25Z 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 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 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
|
||||
|
||||
dnl Check for largefile support...
|
||||
@@ -21,11 +30,11 @@ LARGEFILE=""
|
||||
if test x$enable_largefile != xno; then
|
||||
LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
|
||||
|
||||
if test x$ac_cv_sys_large_files = x1; then
|
||||
if test $ac_cv_sys_large_files = 1; then
|
||||
LARGEFILE="$LARGEFILE -D_LARGE_FILES"
|
||||
fi
|
||||
|
||||
if test x$ac_cv_sys_file_offset_bits = x64; then
|
||||
if test $ac_cv_sys_file_offset_bits = 64; then
|
||||
LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64"
|
||||
fi
|
||||
fi
|
||||
@@ -48,5 +57,5 @@ fi
|
||||
AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-largefile.m4 4732 2005-09-30 23:23:25Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id$"
|
||||
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 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 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
|
||||
|
||||
|
||||
@@ -40,5 +49,5 @@ AC_SUBST(DEFAULT_LAUNCHD_CONF)
|
||||
AC_SUBST(LAUNCHDLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ldap.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id$"
|
||||
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 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 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
|
||||
|
||||
AC_ARG_ENABLE(ldap, [ --enable-ldap turn on LDAP support, default=yes])
|
||||
@@ -27,7 +36,7 @@ LIBLDAP=""
|
||||
|
||||
if test x$enable_ldap != xno; then
|
||||
AC_CHECK_HEADER(ldap.h,
|
||||
AC_CHECK_LIB(ldap, ldap_initialize,
|
||||
AC_CHECK_LIB(ldap, ldap_value_free,
|
||||
AC_DEFINE(HAVE_LDAP)
|
||||
AC_DEFINE(HAVE_OPENLDAP)
|
||||
LIBLDAP="-lldap"))
|
||||
@@ -37,5 +46,5 @@ AC_SUBST(LIBLDAP)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ldap.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z 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 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 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
|
||||
|
||||
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported=LIBTOOL_PATH
|
||||
@@ -36,5 +45,5 @@ if test x$LIBTOOL != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
dnl
|
||||
dnl "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $"
|
||||
dnl
|
||||
dnl Manpage 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 Copyright 1997-2005 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 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
|
||||
|
||||
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*)
|
||||
@@ -100,5 +103,5 @@ AC_SUBST(MAN8EXT)
|
||||
AC_SUBST(MAN8DIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,31 +1,35 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-network.m4 4873 2005-12-07 01:46:54Z 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 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 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
|
||||
|
||||
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))
|
||||
|
||||
@@ -80,9 +84,6 @@ 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 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-network.m4 4873 2005-12-07 01:46:54Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,22 +1,30 @@
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z 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 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 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
|
||||
|
||||
dnl Get the operating system, version number, and architecture...
|
||||
dnl Get the operating system and version number...
|
||||
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/*)
|
||||
@@ -31,5 +39,5 @@ case "$uname" in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z mike $"
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pam.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z 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 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 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
|
||||
|
||||
AC_ARG_ENABLE(pam, [ --enable-pam turn on PAM support, default=yes])
|
||||
@@ -85,5 +94,5 @@ AC_SUBST(PAMLIBS)
|
||||
AC_SUBST(PAMMOD)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pam.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
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
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pdf.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id$"
|
||||
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 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
|
||||
|
||||
AC_ARG_ENABLE(pdftops, [ --enable-pdftops build pdftops filter, default=auto ])
|
||||
@@ -30,5 +39,5 @@ fi
|
||||
AC_SUBST(PDFTOPS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pdf.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
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
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-scripting.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z 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 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 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
|
||||
|
||||
dnl Do we have Java?
|
||||
@@ -91,5 +100,5 @@ if test "x$CUPS_PYTHON" != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-scripting.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z 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 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 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
|
||||
|
||||
PICFLAG=1
|
||||
@@ -24,41 +33,31 @@ if test x$enable_shared != xno; then
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
DSO="\$(CC)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h,\$@ -G \$(OPTIM)"
|
||||
;;
|
||||
HP-UX*)
|
||||
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
|
||||
LIBCUPS="libcups.sl.2"
|
||||
LIBCUPSIMAGE="libcupsimage.sl.2"
|
||||
DSO="\$(LD)"
|
||||
DSOFLAGS="$DSOFLAGS -b -z +h \$@"
|
||||
;;
|
||||
IRIX)
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
DSO="\$(CC)"
|
||||
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi2.6,-soname,\$@ -shared \$(OPTIM)"
|
||||
;;
|
||||
OSF1* | Linux | GNU | *BSD*)
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
DSO="\$(CC)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
|
||||
;;
|
||||
Darwin*)
|
||||
LIBCUPS="libcups.2.dylib"
|
||||
LIBCUPSIMAGE="libcupsimage.2.dylib"
|
||||
DSO="\$(CC)"
|
||||
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
|
||||
DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -single_module -lc"
|
||||
;;
|
||||
AIX*)
|
||||
LIBCUPS="libcups_s.a"
|
||||
@@ -72,7 +71,7 @@ if test x$enable_shared != xno; then
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
DSO="\$(CC)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
@@ -82,15 +81,8 @@ 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)
|
||||
|
||||
@@ -118,64 +110,41 @@ 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="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
|
||||
DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
|
||||
IMGLIBS=""
|
||||
|
||||
# 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...
|
||||
# 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!)
|
||||
case $uname in
|
||||
HP-UX*)
|
||||
# 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
|
||||
# HP-UX
|
||||
DSOFLAGS="+s +b $libdir $DSOFLAGS"
|
||||
LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
|
||||
EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
|
||||
;;
|
||||
;;
|
||||
SunOS*)
|
||||
# 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
|
||||
;;
|
||||
# Solaris
|
||||
DSOFLAGS="-R$libdir $DSOFLAGS"
|
||||
LDFLAGS="$LDFLAGS -R$libdir"
|
||||
EXPORT_LDFLAGS="-R$libdir"
|
||||
;;
|
||||
*BSD*)
|
||||
# *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
|
||||
;;
|
||||
# *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"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
DSOLIBS=""
|
||||
IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
|
||||
IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
|
||||
fi
|
||||
|
||||
AC_SUBST(DSOLIBS)
|
||||
@@ -183,5 +152,5 @@ AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-slp.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z 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 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 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
|
||||
|
||||
AC_ARG_ENABLE(slp, [ --enable-slp turn on SLP support, default=yes])
|
||||
@@ -35,5 +44,5 @@ AC_SUBST(LIBSLP)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-slp.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $"
|
||||
dnl
|
||||
dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
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 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 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
|
||||
|
||||
AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes])
|
||||
@@ -27,52 +36,31 @@ 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"
|
||||
# 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])
|
||||
AC_CHECK_HEADER(Security/SecureTransport.h,
|
||||
[SSLLIBS="-framework CoreFoundation -framework Security"
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_CDSASSL)])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Then look for GNU TLS...
|
||||
if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
|
||||
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
|
||||
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")
|
||||
fi
|
||||
|
||||
dnl Check for the OpenSSL library last...
|
||||
@@ -96,7 +84,6 @@ 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)
|
||||
@@ -110,19 +97,13 @@ 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 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id$"
|
||||
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 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 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
|
||||
|
||||
AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support])
|
||||
@@ -35,12 +44,6 @@ 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
|
||||
@@ -50,5 +53,5 @@ fi
|
||||
AC_SUBST(PTHREAD_FLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
+15
-130
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Configuration file for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CONFIG_H_
|
||||
@@ -31,7 +40,6 @@
|
||||
#define CUPS_DEFAULT_USER "lp"
|
||||
#define CUPS_DEFAULT_GROUP "sys"
|
||||
#define CUPS_DEFAULT_SYSTEM_GROUPS "sys root system"
|
||||
#define CUPS_DEFAULT_PRINTADMIN_AUTH "@SYSTEM"
|
||||
|
||||
|
||||
/*
|
||||
@@ -69,13 +77,6 @@
|
||||
#define CUPS_DEFAULT_PRINTCAP "/etc/printcap"
|
||||
|
||||
|
||||
/*
|
||||
* Default MaxCopies value...
|
||||
*/
|
||||
|
||||
#define CUPS_DEFAULT_MAX_COPIES 100
|
||||
|
||||
|
||||
/*
|
||||
* Maximum number of file descriptors to support.
|
||||
*/
|
||||
@@ -146,13 +147,6 @@
|
||||
#undef HAVE_CRYPT_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <scsi/sg.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SCSI_SG_H
|
||||
|
||||
|
||||
/*
|
||||
* Use <string.h>, <strings.h>, and/or <bstring.h>?
|
||||
*/
|
||||
@@ -266,24 +260,6 @@
|
||||
#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?
|
||||
*/
|
||||
@@ -306,21 +282,6 @@
|
||||
#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>?
|
||||
*/
|
||||
@@ -445,19 +406,11 @@
|
||||
#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
|
||||
|
||||
|
||||
@@ -474,74 +427,6 @@
|
||||
*/
|
||||
|
||||
#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_NEW_UNIQUE
|
||||
#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/param.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <sys/ucred.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYS_UCRED_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have removefile()?
|
||||
*/
|
||||
|
||||
#undef HAVE_REMOVEFILE
|
||||
|
||||
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
+21
-37
@@ -3,14 +3,23 @@ dnl "$Id$"
|
||||
dnl
|
||||
dnl Configuration script for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
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 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
|
||||
|
||||
AC_INIT(cups/cups.h)
|
||||
@@ -20,57 +29,32 @@ sinclude(config-scripts/cups-common.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)
|
||||
sinclude(config-scripts/cups-defaults.m4)
|
||||
sinclude(config-scripts/cups-pap.m4)
|
||||
sinclude(config-scripts/cups-pdf.m4)
|
||||
sinclude(config-scripts/cups-scripting.m4)
|
||||
|
||||
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
|
||||
conf/cupsd.conf conf/pam.std doc/index.html
|
||||
doc/es/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/header.tmpl
|
||||
$LANGFILES)
|
||||
templates/edit-config.tmpl templates/header.tmpl
|
||||
templates/es/header.tmpl templates/ja/header.tmpl)
|
||||
|
||||
chmod +x cups-config
|
||||
|
||||
|
||||
+24
-31
@@ -4,26 +4,33 @@
|
||||
#
|
||||
# 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 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/".
|
||||
# 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
|
||||
#
|
||||
|
||||
VERSION="@CUPS_VERSION@"
|
||||
APIVERSION="1.3"
|
||||
APIVERSION="1.2"
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
includedir=@includedir@
|
||||
libdir=@libdir@
|
||||
imagelibdir=@libdir@
|
||||
datarootdir=@datadir@
|
||||
datadir=@datadir@
|
||||
sysconfdir=@sysconfdir@
|
||||
cups_datadir=@CUPS_DATADIR@
|
||||
@@ -34,30 +41,16 @@ INSTALLSTATIC=@INSTALLSTATIC@
|
||||
# flags for C++ compiler:
|
||||
CFLAGS=""
|
||||
LDFLAGS="@EXPORT_LDFLAGS@"
|
||||
LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
|
||||
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@"
|
||||
LIBS="@EXPORT_SSLLIBS@ @LIBS@"
|
||||
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@ @EXPORT_LIBZ@"
|
||||
|
||||
# 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
|
||||
if test $includedir != /usr/include; then
|
||||
CFLAGS="$CFLAGS -I$includedir"
|
||||
fi
|
||||
|
||||
if test $libdir != /usr/lib -a $libdir != /usr/lib32; then
|
||||
LDFLAGS="$LDFLAGS -L$libdir"
|
||||
fi
|
||||
|
||||
usage ()
|
||||
{
|
||||
@@ -107,13 +100,13 @@ while test $# -gt 0; do
|
||||
if test $image = no; then
|
||||
echo -lcups $LIBS
|
||||
else
|
||||
echo -lcupsimage -lcups $IMGLIBS $LIBS
|
||||
echo -lcupsimage $IMGLIBS -lcups $LIBS
|
||||
fi
|
||||
else
|
||||
if test $image = no; then
|
||||
echo $libdir/libcups.a $LIBS
|
||||
else
|
||||
echo $imagelibdir/libcupsimage.a $libdir/libcups.a $IMGLIBS $LIBS
|
||||
echo $libdir/libcupsimage.a $IMGLIBS $libdir/libcups.a $LIBS
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
+246
-324
@@ -1,324 +1,246 @@
|
||||
# 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
|
||||
# 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 transcode.h
|
||||
adminutil.o: 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 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 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 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 globals.h
|
||||
file.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.o: debug.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: 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 transcode.h
|
||||
http.o: 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 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 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 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 transcode.h
|
||||
ipp.o: 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 transcode.h 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 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 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 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
|
||||
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 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 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 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 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 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 transcode.h debug.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: 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 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: i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testipp.o: ../cups/string.h ../config.h string.h ipp.h http.h md5.h
|
||||
testlang.o: i18n.h transcode.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 transcode.h
|
||||
adminutil.32.o: adminutil.c 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 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 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 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 globals.h
|
||||
file.32.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.32.o: file.c debug.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 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 transcode.h
|
||||
http.32.o: http.c 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 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 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 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 transcode.h
|
||||
ipp.32.o: ipp.c 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 transcode.h 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 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 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 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
|
||||
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 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 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 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 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 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 transcode.h debug.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 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 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 i18n.h transcode.h language.h array.h string.h ../config.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 transcode.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 transcode.h
|
||||
adminutil.64.o: adminutil.c 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 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 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 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 globals.h
|
||||
file.64.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.64.o: file.c debug.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 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 transcode.h
|
||||
http.64.o: http.c 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 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 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 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 transcode.h
|
||||
ipp.64.o: ipp.c 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 transcode.h 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 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 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 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
|
||||
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 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 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 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 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 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 transcode.h debug.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 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 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 i18n.h transcode.h language.h array.h string.h ../config.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 transcode.h language.h array.h
|
||||
testppd.64.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h file.h
|
||||
|
||||
+44
-65
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# 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 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/".
|
||||
# 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
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
@@ -34,7 +43,6 @@ LIBOBJS = \
|
||||
emit.o \
|
||||
encode.o \
|
||||
file.o \
|
||||
getifaddrs.o \
|
||||
getputfile.o \
|
||||
globals.o \
|
||||
http.o \
|
||||
@@ -54,7 +62,6 @@ LIBOBJS = \
|
||||
page.o \
|
||||
ppd.o \
|
||||
request.o \
|
||||
sidechannel.o \
|
||||
snprintf.o \
|
||||
string.o \
|
||||
tempfile.o \
|
||||
@@ -69,7 +76,6 @@ OBJS = \
|
||||
$(LIB64OBJS) \
|
||||
testadmin.o \
|
||||
testarray.o \
|
||||
testcups.o \
|
||||
testfile.o \
|
||||
testhttp.o \
|
||||
testi18n.o \
|
||||
@@ -86,7 +92,6 @@ OBJS = \
|
||||
HEADERS = \
|
||||
adminutil.h \
|
||||
array.h \
|
||||
backend.h \
|
||||
cups.h \
|
||||
dir.h \
|
||||
file.h \
|
||||
@@ -94,8 +99,8 @@ HEADERS = \
|
||||
i18n.h \
|
||||
ipp.h \
|
||||
language.h \
|
||||
md5.h \
|
||||
ppd.h \
|
||||
sidechannel.h \
|
||||
transcode.h
|
||||
|
||||
|
||||
@@ -110,7 +115,6 @@ TARGETS = \
|
||||
libcups.a \
|
||||
testadmin \
|
||||
testarray \
|
||||
testcups \
|
||||
testfile \
|
||||
testhttp \
|
||||
testi18n \
|
||||
@@ -132,8 +136,7 @@ all: $(TARGETS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS)
|
||||
$(RM) libcups.so libcups.sl libcups.dylib
|
||||
$(RM) -r 32bit 64bit
|
||||
$(RM) libcups.so libcups.sl libcups.dylib libcups.32.so libcups.64.so
|
||||
|
||||
|
||||
#
|
||||
@@ -166,12 +169,6 @@ 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)
|
||||
@@ -186,13 +183,13 @@ installhdrs:
|
||||
|
||||
install32bit:
|
||||
$(INSTALL_DIR) -m 755 $(LIB32DIR)
|
||||
$(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
|
||||
$(LN) libcups.so.2 $(LIB32DIR)/libcups.so
|
||||
$(INSTALL_LIB) libcups.32.so.2 $(LIB32DIR)/libcups.so.2
|
||||
$(LN) libcups.so $(LIB32DIR)/libcups.so.2
|
||||
|
||||
install64bit:
|
||||
$(INSTALL_DIR) -m 755 $(LIB64DIR)
|
||||
$(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
|
||||
$(LN) libcups.so.2 $(LIB64DIR)/libcups.so
|
||||
$(INSTALL_LIB) libcups.64.so.2 $(LIB64DIR)/libcups.so.2
|
||||
$(LN) libcups.so $(LIB64DIR)/libcups.so.2
|
||||
|
||||
|
||||
#
|
||||
@@ -231,48 +228,40 @@ uninstall64bit:
|
||||
|
||||
libcups.so.2 libcups.sl.2: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
|
||||
#
|
||||
# 32bit/libcups.so.2
|
||||
# libcups.32.so.2
|
||||
#
|
||||
|
||||
32bit/libcups.so.2: $(LIB32OBJS)
|
||||
libcups.32.so.2: $(LIB32OBJS)
|
||||
echo Linking 32-bit $@...
|
||||
-mkdir 32bit
|
||||
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) 32bit/libcups.so
|
||||
$(LN) libcups.so.2 32bit/libcups.so
|
||||
$(DSO) $(ARCH32FLAGS) $(DSOFLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# 64bit/libcups.so.2
|
||||
# libcups.64.so.2
|
||||
#
|
||||
|
||||
64bit/libcups.so.2: $(LIB64OBJS)
|
||||
libcups.64.so.2: $(LIB64OBJS)
|
||||
echo Linking 64-bit $@...
|
||||
-mkdir 64bit
|
||||
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) 64bit/libcups.so
|
||||
$(LN) libcups.so.2 64bit/libcups.so
|
||||
$(DSO) $(ARCH64FLAGS) $(DSOFLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# libcups.2.dylib
|
||||
#
|
||||
|
||||
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
libcups.2.dylib: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.8.0 \
|
||||
-current_version 2.7.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
-exported_symbols_list libcups.exp \
|
||||
-sectorder __TEXT __text $(LIBCUPSORDER) \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) libcups.dylib
|
||||
$(LN) $@ libcups.dylib
|
||||
|
||||
@@ -281,9 +270,9 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
# libcups_s.a
|
||||
#
|
||||
|
||||
libcups_s.a: $(LIBOBJS) libcups_s.exp
|
||||
libcups_s.a: $(LIBOBJS)
|
||||
echo Creating $@...
|
||||
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
|
||||
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcups_s.o
|
||||
|
||||
@@ -295,7 +284,7 @@ libcups_s.a: $(LIBOBJS) libcups_s.exp
|
||||
libcups.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
-version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
-version-info 2:7 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -340,7 +329,7 @@ php_cups_wrap.c: cups.h
|
||||
testadmin: testadmin.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -350,17 +339,7 @@ testadmin: testadmin.o libcups.a
|
||||
testarray: testarray.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
|
||||
$(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)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -370,7 +349,7 @@ testcups: testcups.o libcups.a
|
||||
testfile: testfile.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -380,7 +359,7 @@ testfile: testfile.o libcups.a
|
||||
testhttp: testhttp.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -390,7 +369,7 @@ testhttp: testhttp.o libcups.a
|
||||
testipp: testipp.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -400,7 +379,7 @@ testipp: testipp.o libcups.a
|
||||
testi18n: testi18n.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -410,7 +389,7 @@ testi18n: testi18n.o libcups.a
|
||||
testlang: testlang.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -420,7 +399,7 @@ testlang: testlang.o libcups.a
|
||||
testppd: testppd.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -434,7 +413,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 notify.c \
|
||||
cups.h dest.c getputfile.c language.c \
|
||||
options.c tempfile.c usersys.c \
|
||||
util.c >../doc/help/api-cups.html
|
||||
mxmldoc --section "Programming" --title "File and Directory APIs" \
|
||||
@@ -442,7 +421,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 custom.c emit.c localize.c mark.c page.c \
|
||||
ppd.h attr.c emit.c mark.c page.c \
|
||||
ppd.c >../doc/help/api-ppd.html
|
||||
mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
|
||||
--intro api-httpipp.shtml \
|
||||
@@ -451,7 +430,7 @@ apihelp:
|
||||
request.c >../doc/help/api-httpipp.html
|
||||
mxmldoc --section "Programming" --title "Filter and Backend APIs" \
|
||||
--intro api-filter.shtml \
|
||||
backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html
|
||||
backchannel.c >../doc/help/api-filter.html
|
||||
|
||||
|
||||
#
|
||||
|
||||
+138
-557
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+21
-13
@@ -7,14 +7,23 @@
|
||||
* MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO
|
||||
* CHANGE AT ANY TIME. USE AT YOUR OWN RISK.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
* Copyright 2001-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* 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
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -44,7 +53,6 @@ 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"
|
||||
@@ -62,12 +70,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
|
||||
|
||||
+16
-7
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-array.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-array.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
Array API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
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
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
+16
-7
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-cups.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-cups.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
CUPS API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
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
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-filedir.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-filedir.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
File and directory API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2005 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
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
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
+17
-179
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-filter.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-filter.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
Filter and backend API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
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
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
@@ -26,9 +35,6 @@ 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><cups/sidechannel.h></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
|
||||
@@ -40,174 +46,6 @@ library:</p>
|
||||
<kbd>gcc -o myprogram myprogram.c -lcups</kbd>
|
||||
</pre>
|
||||
|
||||
|
||||
<h2 class='title'>Compatibility</h2>
|
||||
|
||||
<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 <cups/cups.h>
|
||||
|
||||
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 <cups/cups.h>
|
||||
|
||||
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 <cups/sidechannel.h>
|
||||
|
||||
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, &data, &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 <cups/sidechannel.h>
|
||||
|
||||
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, &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 <cups/sidechannel.h>
|
||||
|
||||
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, &data, &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 &command,
|
||||
cups_sc_status_t &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 <cups/sidechannel.h>
|
||||
|
||||
cups_sc_command_t command;
|
||||
cups_sc_status_t status;
|
||||
|
||||
/* Poll for a command... */
|
||||
if (!cupsSideChannelRead(&command, &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>
|
||||
<p>All of these functions require CUPS 1.2 or higher.</p>
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-httpipp.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-httpipp.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
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
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
+16
-7
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-ppd.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-ppd.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
PPD API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
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
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário