Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 6317446a4b |
+3
-634
@@ -1,638 +1,7 @@
|
||||
CHANGES.txt - 2007-02-06
|
||||
CHANGES.txt - 2006-04-07
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.2.8
|
||||
|
||||
- Documentation fixes (STR #2141, STR #2157)
|
||||
- The HTTP upgrade redirection used by the scheduler did
|
||||
not work with Internet Explorer (STR #2235)
|
||||
- Members of a class with Unicode names did not appear
|
||||
correctly in the web interface (STR #2154)
|
||||
- Changing the "Save debugging information" setting in
|
||||
the web interface no longer affects the other server
|
||||
settings (STR #1993)
|
||||
- The scheduler did not choose SSL certificates correctly
|
||||
on Mac OS X (STR #2225)
|
||||
- The scheduler could get in an infinite loop when
|
||||
printing to a remote class (STR #2228)
|
||||
- The jobs web page did not have separating space after
|
||||
the number of pages column (STR #2230)
|
||||
- Added French localization (STR #2221)
|
||||
- Updated Spanish localization (STR #2223)
|
||||
- Updated Japanese localization (STR #2216)
|
||||
- cupsBorderlessScalingFacter was limited to a range of
|
||||
0.9 to 1.1, but some printers need larger values (STR
|
||||
#2222)
|
||||
- Landscape printing of PDF files did not always work
|
||||
(STR #2149)
|
||||
- Fixed slow USB printing on Minolta printers (STR #2104,
|
||||
STR #2219)
|
||||
- The ZPL label printer driver could produce stretched
|
||||
output (PR #6448)
|
||||
- The IPP backend now clears the printer-state-message
|
||||
when there are no outstanding errors or warnings (STR
|
||||
#2126)
|
||||
- The CUPS Java scripting support did not work with
|
||||
recent versions of Java due to the use of Sun's private
|
||||
Base64 class (STR #2152)
|
||||
- The scheduler did not pass HTTP GET form variables to
|
||||
custom CGI programs (STR #2173)
|
||||
- The lpoptions command now displays the reason why a PPD
|
||||
file cannot be found (STR #2184)
|
||||
- The scheduler did not accept "none" as a browse
|
||||
protocol name (STR #2200)
|
||||
- The scheduler still loaded the remote printer cache,
|
||||
even when browsing was disabled (STR #2198)
|
||||
- The SNMP backend now shows OfficeJet printers with the
|
||||
"HP" manufacturer prefix (STR #2151)
|
||||
- Web interface HTML cleanup (STR #2153)
|
||||
- The parallel backend consumed 100% CPU on FreeBSD due
|
||||
to an apparently common parallel port driver bug (STR
|
||||
#2161)
|
||||
- ippReadIO() incorrectly returned IPP_IDLE when the
|
||||
initial IPP message header could not be read (STR
|
||||
#2179)
|
||||
- cupsRasterInterpretPPD() did not support custom options
|
||||
(STR #1960)
|
||||
- Collated output produced by the PostScript filter could
|
||||
lose some options (STR #2137)
|
||||
- job-hold-until with time values for the next day would
|
||||
be held for 60 days (STR #2144)
|
||||
- Some types of Sun raster files did not print correctly
|
||||
(STR #2107)
|
||||
- Raw PBM files did not print correctly (STR #2106)
|
||||
- The SNMP backend no longer uses IPP with HP printers,
|
||||
as some recent firmware versions appear to not work
|
||||
(STR #2055)
|
||||
- cupsMarkOptions() did not handle the
|
||||
multiple-document-handling option (STR #2135)
|
||||
- lpstat did not show the local job ID of active printers
|
||||
(STR #2125)
|
||||
- The backends incorrectly used STATUS:
|
||||
media-tray-empty-error messages for out-of-paper
|
||||
conditions (STR #2123, STR #2124)
|
||||
- cupsGetPPD2() returned the wrong error when the PPD
|
||||
file did not exist (STR #2122)
|
||||
- cupsDoAuthentication() did not translate the password
|
||||
prompt (STR #2121)
|
||||
- httpGetLength2() did not handle error messages without
|
||||
content correctly (STR #2133)
|
||||
- Added support for 32/64-bit libraries on HP-UX Itanium
|
||||
systems (STR #2115)
|
||||
- Fixed a configure script problem with the 32/64-bit
|
||||
library support (STR #2114)
|
||||
- The PostScript filter did not properly output document
|
||||
setup commands for reversed output (STR #2111)
|
||||
- The scheduler did not parse IPv6 netmasks properly (STR
|
||||
#2117)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.7
|
||||
|
||||
- Documentation updates (STR #2089)
|
||||
- Added an Italian translation (STR #2105)
|
||||
- The PostScript filter now rotates the bounding box
|
||||
values as needed (STR #2079)
|
||||
- The scheduler no longer loads the remote printer cache
|
||||
when browsing is disabled (STR #2084)
|
||||
- The scheduler no longer writes a new launchd
|
||||
configuration file if it doesn't have to (STR #2083)
|
||||
- Updated the USB and PAP backends for Mac OS X (STR
|
||||
#2086)
|
||||
- The scheduler now picks up on changes to IPv6 and DNS
|
||||
configuration on Mac OS X (STR #2085)
|
||||
- The lpstat program could still hang (STR #2098)
|
||||
- Fixed an inefficiency in the SNMP IPP detection code
|
||||
(STR #2100)
|
||||
- The SSL negotiation code did not implement short
|
||||
timeouts (STR #2091)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.6
|
||||
|
||||
- The web interface was not localized on Mac OS X (STR
|
||||
#2075)
|
||||
- "lpc status" did not show the number of queued jobs for
|
||||
disabled queues (STR #2069)
|
||||
- The lpstat program could hang (STR #2073)
|
||||
- The serial backend did not support the new USB serial
|
||||
filenames on Linux (STR #2061)
|
||||
- The parallel backend did not support bidirectional I/O
|
||||
properly (STR #2056)
|
||||
- The network backends now log the numeric address that
|
||||
is being used (STR #2046)
|
||||
- Fixed a compile error when using libpaper.
|
||||
- Fixed a compile error when compiling on Solaris with
|
||||
threading enabled (STR #2049, STR #2050)
|
||||
- Missing printer-state-changed event for
|
||||
printer-state-message updates (STR #2047)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.5
|
||||
|
||||
- Documentation updates (STR #2038)
|
||||
- The SNMP backend no longer uses IPP for Epson printers
|
||||
(STR #2028)
|
||||
- Updated the configure script for Tru64 UNIX 5.1 (STR
|
||||
#2033)
|
||||
- Tru64 5.1B's getaddrinfo() and getnameinfo() functions
|
||||
leak file descriptors (STR #2034)
|
||||
- cupsAddDest() didn't add the parent destination's
|
||||
options and attributes.
|
||||
- ppdConflicts() did not handle custom option
|
||||
constraints.
|
||||
- Raw printing of gzip'd files did not work (STR #2009)
|
||||
- The scheduler no longer preserves default option
|
||||
choices when the new PPD no longer provides the old
|
||||
default choice (STR #1929)
|
||||
- The Linux SCSI backend is now only built if the SCSI
|
||||
development headers are installed.
|
||||
- USB printing to Minolta printers did not work (STR
|
||||
#2019)
|
||||
- Windows clients could not monitor the queue status (STR
|
||||
#2006)
|
||||
- The scheduler didn't log the operation name in the
|
||||
access_log file for Create-Job and Print-Job requests.
|
||||
- The PostScript filter now separates collated copies
|
||||
with any required JCL commands so that JCL-based
|
||||
finishing options act on the individual copies and not
|
||||
all of the copies as a single document.
|
||||
- The PostScript filter now disables duplex printing when
|
||||
printing a 1-page document.
|
||||
- cups-lpd didn't pass the correct
|
||||
job-originating-host-name value (STR #2023)
|
||||
- Fixed some speling errors in the German message catalog
|
||||
(STR #2012)
|
||||
- cupstestppd did not catch PPD files with bad
|
||||
UIConstraints values (STR #2016)
|
||||
- The USB backend did not work with the current udev-
|
||||
created printers if the first printer was disconnected
|
||||
(STR #2017)
|
||||
- Mirrored and rotated printing did not work with some
|
||||
documents (STR #2004)
|
||||
- 2-sided printing with banners did not work properly on
|
||||
some printers (STR #2018)
|
||||
- Updated the raw type rule to handle PJL within the
|
||||
first 4k of a print job (STR #1969)
|
||||
- Added an Estonian translation (STR #1957)
|
||||
- Clarified the documentation for the cupsd.conf @LOCAL
|
||||
and @IF(name) allow/deny functionality (STR #1992)
|
||||
- The PostScript filters did not escape the Title and For
|
||||
comments in the print job header (STR #1988)
|
||||
- The scheduler would use 100% CPU if browsing was
|
||||
disabled and the cupsd.conf file contained BrowsePoll
|
||||
lines (STR #1994)
|
||||
- The cupsDirRead() function did not work properly on
|
||||
non-POSIX-compliant systems (STR #2001)
|
||||
- The cupsFile functions didn't handle read/write errors
|
||||
properly (STR #1996)
|
||||
- The DBUS support now works with older versions of the
|
||||
DBUS library.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.4
|
||||
|
||||
- The --with-printcap configure option did not work (STR
|
||||
#1984)
|
||||
- The character set reported by cupsLangGet() did not
|
||||
always reflect the default character set of a given
|
||||
locale (STR #1983)
|
||||
- Older Lexmark and Tektronix printers did not work with
|
||||
IPP (STR #1980)
|
||||
- Failsafe printing did not work (PR #6328)
|
||||
- Some web interface redirects did not work (STR #1978)
|
||||
- The web interface change settings button could
|
||||
introduce a "Port 0" line in cupsd.conf if there was no
|
||||
loopback connection available (STR #1979)
|
||||
- The web interface change settings and edit
|
||||
configuration file buttons would truncate the
|
||||
cupsd.conf file (STR #1976)
|
||||
- The German web interface used the wrong printer icon
|
||||
images (STR #1973)
|
||||
- The "All Documents" link in the on-line help was
|
||||
missing a trailing slash (STR #1971)
|
||||
- The Polish web interface translation used the wrong
|
||||
URLs for the job history (STR #1963)
|
||||
- The "reprint job" button did not work (STR #1956)
|
||||
- The scheduler did not always report printer or job
|
||||
events properly (STR #1955)
|
||||
- The scheduler always stopped the queue on error,
|
||||
regardless of the exit code, if the error policy was
|
||||
set to "stop-printer" (STR #1959)
|
||||
- ppdEmitJCL() included UTF-8 characters in the JCL job
|
||||
name, which caused problems on some printers (STR
|
||||
#1959)
|
||||
- Fixed a buffering problem that cause high CPU usage
|
||||
(STR #1968)
|
||||
- The command-line applications did not convert
|
||||
command-line strings to UTF-8 as needed (STR #1958)
|
||||
- cupsDirRead() incorrectly aborted when reading a
|
||||
symbolic link that pointed to a file/directory that did
|
||||
not exist (STR #1953)
|
||||
- The cupsInterpretRasterPPD() function did not handle
|
||||
custom page sizes properly.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.3
|
||||
|
||||
- The scheduler did not send job-state or
|
||||
job-config-changed events when a job was held,
|
||||
released, or changed (STR #1947)
|
||||
- The scheduler now aborts if the configuration file and
|
||||
directory checks fail (STR #1941)
|
||||
- Fixed a problem with ippPort() not using the port
|
||||
number that was set via the client.conf file or
|
||||
CUPS_SERVER environment variable (STR #1945)
|
||||
- HTTP headers were not buffered (STR #1899)
|
||||
- Some IPP printers (HP) did not like UTF-8 job names
|
||||
(STR #1837)
|
||||
- The CUPS desktop icon is now localized for Polish (STR
|
||||
#1920)
|
||||
- Printer options were not always honored when printing
|
||||
from Windows clients (STR #1839)
|
||||
- The openssl command would lock up the scheduler when
|
||||
generating an encryption certificate on some platforms
|
||||
due to a lack of entropy for the random number
|
||||
generator (STR #1876)
|
||||
- The web admin page did not recognize that "Listen 631"
|
||||
enabled remote access (STR #1908)
|
||||
- The web admin page did not check whether changes were
|
||||
made to the Basic Server Settings check boxes (STR
|
||||
#1908)
|
||||
- The IPP backend could generate N*N copies in certain
|
||||
edge cases.
|
||||
- The scheduler did not restore remote printers properly
|
||||
when BrowseShortNames was enabled (STR #1893)
|
||||
- Polling did not handle changes to the network
|
||||
environment on Mac OS X (STR #1896)
|
||||
- The "make test" subscription tests used invalid
|
||||
notify-recipient-uri values (STR #1910)
|
||||
- Printers could be left in an undefined state on system
|
||||
sleep (STR #1905)
|
||||
- The Berkeley and System V commands did not always use
|
||||
the expected character set (STR #1915)
|
||||
- Remote printing fixes (STR #1881)
|
||||
- The cupstestppd utility did not validate translation
|
||||
strings for custom options properly.
|
||||
- Multi-language PPD files were not properly localized in
|
||||
the web interface (STR #1913)
|
||||
- The admin page's simple settings options did not check
|
||||
for local domain socket or IPv6 addresses and did not
|
||||
use "localhost" as the listen address.
|
||||
- An empty BrowseProtocols, BrowseLocalProtocols, or
|
||||
BrowseRemoteProtocols line would crash the scheduler
|
||||
instead of disabling the corresponding browsing options.
|
||||
- The scheduler now logs IPP operation status as debug
|
||||
messages instead of info or error.
|
||||
- cupsFileRewind() didn't clear the end-of-file state.
|
||||
- cupstestppd didn't report the actual misspelling of the
|
||||
1284DeviceID attribute (STR #1849)
|
||||
- BrowseRelay didn't work on Debian (STR #1887)
|
||||
- configure --without-languages didn't work (STR #1879)
|
||||
- Manually added remote printers did not work (STR #1881)
|
||||
- The <cups/backend.h> header was not installed.
|
||||
- Updated the build files for Autoconf 2.60 (STR #1853)
|
||||
- The scheduler incorrectly terminated the polling
|
||||
processes after receiving a partial log line.
|
||||
- The cups-lpd mini-daemon reported "No printer-state
|
||||
attribute found" errors when reporting the queue status
|
||||
(PR #6250, STR #1821)
|
||||
- SNMP backend improvements (STR #1737, STR #1742, STR
|
||||
#1790, STR #1835, STR #1880)
|
||||
- The scheduler erroneously reported an error with the
|
||||
CGI pipe (STR #1860)
|
||||
- Fixed HP-UX compile problems (STR #1858, STR #1859)
|
||||
- cupstestppd crashed with some PPD files (STR #1864)
|
||||
- The <cups/dir.h> and <cups/file.h> header files did not
|
||||
work with C++.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.2
|
||||
|
||||
- Documentation updates (STR #1765, STR #1780)
|
||||
- CUPS didn't know about alternate character set names
|
||||
for Asian text (STR #1819)
|
||||
- The lpoptions -o and -r options did not work unless you
|
||||
specified a printer.
|
||||
- The lpoptions command incorrectly allowed users to set
|
||||
printer attributes like printer-type (STR #1791)
|
||||
- httpWait() did not flush the write buffer, causing "bad
|
||||
request" errors when communicating with CUPS 1.1.x
|
||||
servers (STR #1717)
|
||||
- Polling did not sanitize the printer description,
|
||||
location, or make and model strings like broadcasts
|
||||
did.
|
||||
- Polled printers did not show the server's default
|
||||
job-sheets option value.
|
||||
- The Samba password prompt was not properly localized
|
||||
(STR #1814)
|
||||
- Added a German translation (STR #1842)
|
||||
- The scheduler now creates self-signed SSL certficates
|
||||
automatically when using OpenSSL and CDSA for
|
||||
encryption, just as for GNU TLS.
|
||||
- The SNMP backend sporatically reported some printers as
|
||||
"unknown" (STR #1774)
|
||||
- The scheduler now forces BrowseTimeout to be at least
|
||||
twice the BrowseInterval value and non-zero to avoid
|
||||
common configuration errors.
|
||||
- The scheduler incorrectly returned printer URIs of the
|
||||
form "ipp://server/printers/classname" for classes (STR
|
||||
#1813)
|
||||
- Updated Japanese localization (STR #1805)
|
||||
- The scheduler's SSL certificate/key directory was not
|
||||
created on installation (STR #1788)
|
||||
- Added a mailto.conf man page and help page (STR #1754)
|
||||
- The parallel and USB backends no longer wait for the
|
||||
printer to go on-line - this caused problems with
|
||||
certain printers that don't follow with the IEEE-1284
|
||||
standard (STR #1738)
|
||||
- The scheduler could crash on a reload when implicit
|
||||
classes were present (STR #1828)
|
||||
- The IPP backend incorrectly used the CUPS_ENCRYPTION
|
||||
environment variable to determine the default
|
||||
encryption mode when printing (STR #1820)
|
||||
- USB printing did not work on Solaris (STR #1756)
|
||||
- The scheduler sorted job priorities in the wrong order
|
||||
(STR #1811)
|
||||
- The scheduler did not automatically restart notifiers
|
||||
that exited or crashed (STR #1793)
|
||||
- IPv6 support did not work on NetBSD (STR #1834)
|
||||
- The EPM packaging file did not work (STR #1804)
|
||||
- The scheduler used up the CPU if BrowseRemoteProtocols
|
||||
was empty (STR #1792)
|
||||
- Custom page sizes did not work (STR #1787)
|
||||
- The SNMP backend could crash on some systems when SNMP
|
||||
logging was enabled (STR #1789)
|
||||
- Browsing could produce some funny printer names when
|
||||
ServerName was set to an IP address (STR #1799)
|
||||
- Fixed the log message for BrowseRelay (STR #1798)
|
||||
- Fixes to allow CUPS to compile on MirBSD (STR #1796)
|
||||
- The scheduler incorrectly set the FINAL_CONTENT_TYPE
|
||||
environment variable (STR #1795)
|
||||
- The pdftops filter incorrectly embedded a "produced by"
|
||||
comment, causing PDF printing not to work on some
|
||||
operating systems (STR #1801)
|
||||
- Sending raw jobs from a client system could cause the
|
||||
client's scheduler to eventually crash (STR #1786)
|
||||
- The scheduler now checks that the notifier exists prior
|
||||
to accepting a new subscription request.
|
||||
- The scheduler now reports the supported
|
||||
notify-recipient schemes based on the contents of the
|
||||
ServerBin/notifier directory.
|
||||
- Event notifications did not include the
|
||||
notify-sequence-number or other required attributes
|
||||
(STR #1747)
|
||||
- Allow/Deny addresses of the form "11.22.33.*" did not
|
||||
work on Linux (STR #1769)
|
||||
- cupsGetPPD() did not work if the scheduler was only
|
||||
listening on a domain socket (STR #1766)
|
||||
- The scheduler could crash advertising a class (STR
|
||||
#1768)
|
||||
- The scheduler could crash if the default printer was
|
||||
deleted (STR #1776)
|
||||
- Added a new default CUPS raster format (v3) which does
|
||||
not compress the raster stream in order to provide the
|
||||
same cupsRasterReadPixels() and cupsRasterWritePixels()
|
||||
performance as CUPS 1.1.x.
|
||||
- The cupsaddsmb man page listed the wrong files for the
|
||||
CUPS driver.
|
||||
- Some configure --with options did not work (STR #1746)
|
||||
- "Allow @IF(name)" didn't work if "name" wasn't the
|
||||
first network interface (STR #1758)
|
||||
- The lpstat command did not use the correct character
|
||||
set when reporting the date and time (STR #1751)
|
||||
- The cupsaddsmb command and web interface did not update
|
||||
the Windows PPD files properly, resulting in corrupt
|
||||
PPD files for the Windows client to use (STR #1750)
|
||||
- The cupsd.conf man page didn't describe the Listen
|
||||
domain socket syntax (STR #1753)
|
||||
- The scheduler no longer tries to support more than
|
||||
FD_SETSIZE file descriptors.
|
||||
- CDSA (encryption) support fixes for MacOS X.
|
||||
- The lppasswd program needs to be setuid to root to
|
||||
create and update the /etc/cups/passwd.md5 file (STR
|
||||
#1735)
|
||||
- 32/64-bit library installation was broken (STR #1741)
|
||||
- The USB backend now reports a "no such device" error
|
||||
when using the old filename-based USB URIs instead of
|
||||
the "success" error.
|
||||
- Increased the HTTP and IPP read timeouts to 10 seconds,
|
||||
as 1 second was too short on congested networks (STR
|
||||
#1719)
|
||||
- The SNMP backend now uses the device description over
|
||||
the printer-make-and-model attribute when the attribute
|
||||
contains a generic name (STR #1728)
|
||||
- Fixed another file descriptor leak when printing raw
|
||||
files (STR #1736)
|
||||
- Raw queues were not shared via LDAP (STR #1739)
|
||||
- The pstops filter didn't always embed PageSetup
|
||||
commands from the PPD file (STR #1740)
|
||||
- "make install" didn't work if you disabled all of the
|
||||
localizations.
|
||||
- The scheduler didn't always choose the least costly
|
||||
filter.
|
||||
- Fixed parsing of IPv6 addresses in Allow, Deny,
|
||||
BrowseAllow, BrowseDeny, and BrowseRelay directives
|
||||
(STR #1713)
|
||||
- Printers that were shared via LDAP did not get added to
|
||||
the LDAP server properly (STR #1733)
|
||||
- LDAP browsing would crash the scheduler if a required
|
||||
value was missing (STR #1731)
|
||||
- Special cases for the "localhost" hostname did not
|
||||
work, causing printing to not work when the /etc/hosts
|
||||
file did not contain a localhost entry (STR #1723)
|
||||
- Updated the Spanish translation (STR #1720, STR #1770)
|
||||
- Reverse-order page output was broken when N-up or
|
||||
landscape orientations were used (STR #1725)
|
||||
- The parallel, serial, socket, and USB backends needed
|
||||
print data before they would report back-channel data,
|
||||
causing problems with several new drivers (STR #1724)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.1
|
||||
|
||||
- "lprm -h hostname" did not work (STR #1800)
|
||||
- The web interface did not handle reloads properly for
|
||||
MSIE (STR #1716)
|
||||
- The configure script no longer adds linker rpath
|
||||
options when they are unnecessary.
|
||||
- The scheduler could crash printing a debug message on
|
||||
Solaris (STR #1714)
|
||||
- The --enable-32bit and --enable-64bit configure options
|
||||
did not always work.
|
||||
- The password prompt showed the domain socket address
|
||||
instead of "localhost" for local authentication (STR
|
||||
#1706)
|
||||
- The web interface filtered the list of printers even if
|
||||
the user wasn't logged in (STR #1700)
|
||||
- The IPP backend did not work reliably with some Xerox
|
||||
printers (STR #1704)
|
||||
- Trailing banners were not added when printing a single
|
||||
file (STR #1698)
|
||||
- The web interface support programs crashed on Solaris
|
||||
(STR #1699)
|
||||
- cupstestppd incorrectly reported problems with
|
||||
*1284DeviceID attributes (STR #1710)
|
||||
- Browsing could get disabled after a restart (STR #1670)
|
||||
- Custom page sizes were not parsed properly (STR #1709)
|
||||
- The -U option wasn't supported by lpadmin (STR #1702)
|
||||
- The -u option didn't work with lpadmin (STR #1703)
|
||||
- The scheduler did not create non-blocking back-channel
|
||||
pipes, which caused problems when the printer driver
|
||||
did not read the back-channel data (STR #1705)
|
||||
- The scheduler no longer uses chunking in responses to
|
||||
clients - this caused problems with older versions of
|
||||
CUPS like 1.1.17 (PR #6143)
|
||||
- Automatic raw printing was broken (STR #1667)
|
||||
- 6-up printing was broken (STR #1697)
|
||||
- The pstops filter did not disable CTRL-D processing on
|
||||
the printer/RIP.
|
||||
- ppdOpen*() did not load custom options properly (STR
|
||||
#1680)
|
||||
- "Set Printer Options" in the web interface did not
|
||||
update the DefaultImageableArea or
|
||||
DefaultPaperDimension attributes in the PPD file (STR
|
||||
#1689)
|
||||
- Fixed compile errors (STR #1682, STR #1684, STR #1685,
|
||||
STR #1690)
|
||||
- The lpstat command displayed the wrong error message
|
||||
for a missing destination (STR #1683)
|
||||
- Revised and completed the Polish translation (STR
|
||||
#1669)
|
||||
- Stopped jobs did not show up in the list of active jobs
|
||||
(STR #1676)
|
||||
- The configure script did not use the GNU TLS
|
||||
"libgnutls-config" script to find the proper compiler
|
||||
and linker options.
|
||||
- The imagetoraster filter did not correctly generate
|
||||
several 1, 2, and 4-bit color modes.
|
||||
- cupsRasterWritePixels() could lose track of the current
|
||||
output row.
|
||||
- cupsRasterReadPixels() did not automatically swap
|
||||
12/16-bit chunked pixel data.
|
||||
- Moved the private _cups_raster_s structure out of the
|
||||
public header.
|
||||
- Updated the CUPS raster format specification to include
|
||||
encoding rules and colorspace definitions.
|
||||
- The Zebra PPD files had the wrong PostScript code for
|
||||
the "default" option choices.
|
||||
- The imagetoraster filter did not generate correct CIE
|
||||
XYZ or Lab color data.
|
||||
- The cups-config script did not work when invoked from a
|
||||
source directory (STR #1673)
|
||||
- The SNMP backend did not compile on systems that used
|
||||
the getifaddrs emulation functions (STR #1668)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.0
|
||||
|
||||
- Documentation updates (STR #1618, STR #1620, STR #1622,
|
||||
STR #1637)
|
||||
- Static file copy buffers reduced from 64k to 32k to
|
||||
work around bogus MallocDebug library assumptions (STR
|
||||
#1660)
|
||||
- The scheduler did not decode the backend exit code
|
||||
properly (STR #1648)
|
||||
- The MacOS X USB backend did not report the 1284 device ID,
|
||||
nor did it fix device IDs returned by HP printers.
|
||||
- The scheduler started more slowly than 1.1.x with large
|
||||
numbers of printers (STR #1653)
|
||||
- cupsRasterInterpretPPD() didn't support the
|
||||
cupsPreferredBitsPerColor attribute, and imagetoraster
|
||||
didn't use the new API.
|
||||
- The "make test" script did not create all of the necessary
|
||||
subdirectories for testing (STR #1638)
|
||||
- The scheduler did not prevent rotation of logs
|
||||
redirected to /dev/null (STR #1651)
|
||||
- "make test" did not include the SNMP backend in the
|
||||
test environment (STR #1625)
|
||||
- The EPM packaging files did not work (STR #1621)
|
||||
- "Use Default Configuration" inserted a broken
|
||||
configuration file (STR #1624)
|
||||
- Redirects in the web interface did not always preserve
|
||||
the encrypted status of a connection (STR #1603)
|
||||
- Added the Apple "pap" backend.
|
||||
- Added CUPS library to CUPS Image shared library
|
||||
linkage to support Linux --as-needed linker option
|
||||
(STR #1606)
|
||||
- Fixed support for --enable-pie (STR #1609)
|
||||
- The pdftops filter did not validate the length of the
|
||||
encryption key (STR #1608)
|
||||
- Updated the Polish localization.
|
||||
- "Encryption Required" in the cupsd.conf file now only
|
||||
requires encryption when the connection is not over the
|
||||
loopback interface or domain socket.
|
||||
- Printer names containing "+" were not quoted properly in
|
||||
the web interface (STR #1600)
|
||||
- The SNMP backend now reports the make and model in the
|
||||
information string so that the auto-generated printer
|
||||
name is more useful than just an IP address.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2rc3
|
||||
|
||||
- The cups-lpd program always did reverse lookups on the
|
||||
client address, which could be a performance problem.
|
||||
Added a "-n" option to disable lookups.
|
||||
- When configured with SSL support, require encryption by
|
||||
default when displaying the /admin location (STR #1592)
|
||||
- The next job ID was not computed correctly if the job
|
||||
cache file got out of sync with the spool directory
|
||||
(STR #1582)
|
||||
- The PNG image handling code used deprecated functions
|
||||
from libpng (STR #1587)
|
||||
- Added a Polish translation (STR #1584, STR #1586)
|
||||
- More changes to the scheduler to improve battery life
|
||||
on portable devices (STR #1583)
|
||||
- Changed the default log level for status messages back
|
||||
to "DEBUG" to be consistent with CUPS 1.1.x (STR #1579)
|
||||
- The error string was not set properly when
|
||||
cupsDoFileRequest() was given the name of a directory
|
||||
(STR #1578)
|
||||
- Fixed handling of job-hold-until (STR #1581)
|
||||
- Added explicit notes to the cupsaddsmb man page
|
||||
explaining that the driver filenames are case-sensitive
|
||||
under UNIX and that they must be all lowercase (Windows
|
||||
2000) or all UPPERCASE (Windows 95/98/Me) to work (STR
|
||||
#1568)
|
||||
- The USB backend incorrectly split the manufacturer name
|
||||
if it contained spaces (STR #1566)
|
||||
- The scheduler would hang when listing PPD files for a
|
||||
manufacturer whose name contained spaces (STR #1567)
|
||||
- Added the SNMP backend for network printer discovery
|
||||
(STR #1555)
|
||||
- cupstestppd now fails PPD files with 1284DeviceId
|
||||
instead of 1284DeviceID, and cups-driverd uses a
|
||||
case-insensitive comparison when looking for it (STR
|
||||
#1573)
|
||||
- cupsDoFileRequest() and cupsDoRequest() now work
|
||||
properly with non-blocking HTTP connections.
|
||||
- Added Swedish translation (STR #1569)
|
||||
- "make install" now installs the MIME files with world
|
||||
read permissions (STR #1565)
|
||||
- More CDSA encryption support fixes (STR #1563)
|
||||
- Updated the default mime.types file to support printing
|
||||
of files that do not have a locally-recognized MIME
|
||||
media type to raw or System V queues.
|
||||
- Updated the serial port detection code on Linux (STR
|
||||
#1562)
|
||||
- Added some more error checking to httpGetHostname()
|
||||
(STR #1561)
|
||||
- The title of some administration pages was not
|
||||
localized (STR #1548)
|
||||
- The edit-config.tmpl file was not generated or
|
||||
installed for the Spanish or Japanese localizations
|
||||
(STR #1547)
|
||||
- The mimeDelete() function freed the types before the
|
||||
filters, but the filters needed the type data (STR #1558)
|
||||
- The scheduler didn't keep track of the status pipes
|
||||
properly, leading to a bad select() for multi-file jobs
|
||||
(STR #1559)
|
||||
- The cupstestdsc program didn't validate the ordinal
|
||||
page number value for %%Page: comments.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2rc2
|
||||
CHANGES IN CUPS V1.2
|
||||
|
||||
- The scheduler was not always using the string pool,
|
||||
causing random crashes.
|
||||
@@ -730,7 +99,7 @@ CHANGES IN CUPS V1.2rc1
|
||||
#1488)
|
||||
- ppdOpen2() now converts the NickName and all UI text to
|
||||
UTF-8 (STR #1475)
|
||||
- The Set Allowed Users web page did not work (STR #1486)
|
||||
- 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)
|
||||
|
||||
+4
-7
@@ -1,4 +1,4 @@
|
||||
CREDITS.txt - 2007-02-05
|
||||
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.
|
||||
Jean-Eric Cuendet - GhostScript filters for CUPS.
|
||||
Van Dang - HTTP and IPP policeman.
|
||||
L. Peter Deutsch - MD5 code.
|
||||
@@ -21,18 +20,16 @@ like to thank the following individuals for their contributions:
|
||||
testing.
|
||||
Kiko - Bug fixes.
|
||||
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
|
||||
Marek Laane - Estonian translation.
|
||||
Mark Lawrence - Microsoft interoperability testing.
|
||||
Jeff Licquia - Bug fixes, beta testing, evangelism.
|
||||
Jason McMullan - Original CUPS RPM distributions.
|
||||
Wes Morgan - *BSD fixes.
|
||||
Daniel Nylander - Swedish localization.
|
||||
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.
|
||||
Juan Pablo González Riopedre - Spanish localization
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
INSTALL - CUPS v1.2.8 - 2007-02-14
|
||||
----------------------------------
|
||||
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
|
||||
|
||||
+21
-18
@@ -1,6 +1,6 @@
|
||||
Common UNIX Printing System License Agreement
|
||||
|
||||
Copyright 1997-2007 by Easy Software Products
|
||||
Copyright 1997-2006 by Easy Software Products
|
||||
44141 AIRPORT VIEW DR STE 204
|
||||
HOLLYWOOD, MARYLAND 20636 USA
|
||||
|
||||
@@ -17,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:
|
||||
@@ -32,19 +32,22 @@ 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
|
||||
@@ -116,9 +119,9 @@ 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 additions and modifications to
|
||||
CUPS under the GNU GPL and LGPL. For information please contact
|
||||
us at the address shown above.
|
||||
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
|
||||
|
||||
+3
-12
@@ -78,8 +78,6 @@ CUPS_LOG_FILE_PERM = @CUPS_LOG_FILE_PERM@
|
||||
#
|
||||
|
||||
LANGUAGES = @LANGUAGES@
|
||||
INSTALL_LANGUAGES = @INSTALL_LANGUAGES@
|
||||
UNINSTALL_LANGUAGES = @UNINSTALL_LANGUAGES@
|
||||
|
||||
#
|
||||
# Libraries...
|
||||
@@ -129,17 +127,16 @@ CXXFLAGS = -I.. $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DSOFLAGS = @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
IMGLIBS = @IMGLIBS@
|
||||
IMGLIBS = @IMGLIBS@ -lm
|
||||
IMGFILTERS = @IMGFILTERS@
|
||||
LDFLAGS = -L../cups -L../filter $(ARCHFLAGS) \
|
||||
@LDFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
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@
|
||||
@@ -151,7 +148,6 @@ LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
#
|
||||
|
||||
ARCH32FLAGS = @ARCH32FLAGS@
|
||||
DSO32FLAGS = @DSO32FLAGS@
|
||||
INSTALL32 = @INSTALL32@
|
||||
LIB32CUPS = @LIB32CUPS@
|
||||
LIB32CUPSIMAGE = @LIB32CUPSIMAGE@
|
||||
@@ -159,7 +155,6 @@ LIB32DIR = $(BUILDROOT)@LIB32DIR@
|
||||
UNINSTALL32 = @UNINSTALL32@
|
||||
|
||||
ARCH64FLAGS = @ARCH64FLAGS@
|
||||
DSO64FLAGS = @DSO64FLAGS@
|
||||
INSTALL64 = @INSTALL64@
|
||||
LIB64CUPS = @LIB64CUPS@
|
||||
LIB64CUPSIMAGE = @LIB64CUPSIMAGE@
|
||||
@@ -174,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@
|
||||
|
||||
+5
-51
@@ -57,25 +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/standard.html doc/index.html
|
||||
$(RM) init/cups.sh init/cups-lpd
|
||||
$(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 templates/edit-config.tmpl templates/header.tmpl
|
||||
-$(RM) doc/*/index.html
|
||||
-$(RM) templates/*/edit-config.tmpl
|
||||
-$(RM) templates/*/header.tmpl
|
||||
-$(RM) -r autom4te*.cache
|
||||
|
||||
|
||||
#
|
||||
# Make dependencies
|
||||
#
|
||||
@@ -99,8 +80,8 @@ 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; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
|
||||
@@ -115,17 +96,13 @@ install: installhdrs
|
||||
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
|
||||
if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
|
||||
echo Installing StartupItems files...; \
|
||||
$(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
|
||||
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
$(INSTALL_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; \
|
||||
else \
|
||||
echo Installing RC script...; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
|
||||
fi \
|
||||
fi
|
||||
@@ -221,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
|
||||
|
||||
|
||||
#
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
README - CUPS v1.2.8 - 2007-02-14
|
||||
---------------------------------
|
||||
README - CUPS v1.2rc1 - 2006-03-24
|
||||
----------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
instead...
|
||||
@@ -170,7 +170,7 @@ PRINTING FILES
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 1993-2007 by Easy Software Products. CUPS,
|
||||
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.
|
||||
|
||||
|
||||
+12
-22
@@ -9,31 +9,21 @@ 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
|
||||
pap.o: ../cups/http.h ../cups/md5.h
|
||||
parallel.o: backend-private.h ../cups/backend.h ../cups/cups.h ../cups/ipp.h
|
||||
parallel.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
|
||||
parallel.o: ../cups/file.h ../cups/language.h ../cups/debug.h
|
||||
parallel.o: ../cups/string.h ../config.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: backend-private.h ../cups/backend.h ../cups/cups.h ../cups/ipp.h
|
||||
serial.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
|
||||
serial.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
|
||||
serial.o: ../config.h
|
||||
snmp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
|
||||
snmp.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
|
||||
snmp.o: ../cups/backend.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
|
||||
snmp.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
|
||||
snmp.o: ../cups/array.h ../cups/file.h
|
||||
socket.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
|
||||
socket.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
|
||||
socket.o: ../cups/backend.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
|
||||
socket.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
|
||||
test1284.o: ../cups/string.h ../config.h ieee1284.c backend-private.h
|
||||
test1284.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
test1284.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
test1284.o: ../cups/language.h ../cups/debug.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
|
||||
|
||||
+14
-44
@@ -27,11 +27,10 @@
|
||||
include ../Makedefs
|
||||
|
||||
RBACKENDS = ipp lpd
|
||||
UBACKENDS = $(PAP) parallel scsi 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
|
||||
|
||||
|
||||
#
|
||||
@@ -46,7 +45,7 @@ all: $(TARGETS)
|
||||
#
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http
|
||||
$(RM) $(OBJS) $(TARGETS) http
|
||||
|
||||
|
||||
#
|
||||
@@ -105,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
|
||||
#
|
||||
@@ -148,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)
|
||||
|
||||
|
||||
#
|
||||
@@ -181,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,73 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Backend support definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" 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.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_BACKEND_PRIVATE_H_
|
||||
# define _CUPS_BACKEND_PRIVATE_H_
|
||||
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
# include <cups/backend.h>
|
||||
# include <cups/cups.h>
|
||||
# include <cups/debug.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 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);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
#endif /* !_CUPS_BACKEND_PRIVATE_H_ */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -0,0 +1,71 @@
|
||||
Preliminary Design for CUPS Firewire Printer Backend - 03/19/2002
|
||||
-----------------------------------------------------------------
|
||||
|
||||
OVERVIEW
|
||||
|
||||
Easy Software Products will develop an IEEE-1394, a.k.a.
|
||||
Firewire, printing interface for its Common UNIX Printing
|
||||
System ("CUPS") for initial use under the Linux operating
|
||||
system. A follow-on implementation for MacOS X is
|
||||
anticipated as well.
|
||||
|
||||
The operating system interfaces for IEEE-1394 ports vary
|
||||
widely; the CUPS printing interface will abstract the OS
|
||||
layer to a simpler interface geared towards discovering,
|
||||
opening, reading from, writing to, and closing IEEE-1394
|
||||
printers.
|
||||
|
||||
The initial development of the CUPS backend will be targeted
|
||||
at the EPSON Stylus Pro 10000 large format printer, which
|
||||
requires the bandwidth provided by Firewire in order to
|
||||
print at full speed. This printer supports printing via
|
||||
Serial Bus Protocol 2 (SBP-2) using the SCSI and PWG command
|
||||
sets. The CUPS backend will implement the PWG command set on
|
||||
LUN 0 only.
|
||||
|
||||
|
||||
OS ABSTRACTION LAYER
|
||||
|
||||
The OS abstraction layer will be a thin client library that
|
||||
implements the following functions:
|
||||
|
||||
ieee1394_list
|
||||
ieee1394_open
|
||||
ieee1394_close
|
||||
ieee1394_read
|
||||
ieee1394_write
|
||||
ieee1394_error
|
||||
|
||||
The "ieee1394_list" function will list all of the available
|
||||
printer devices on the bus. The device information will
|
||||
consist of the device URI (ieee1394:/something) used to
|
||||
access the device and the make and model information, if
|
||||
available, for the device ("EPSON Stylus Printer").
|
||||
|
||||
The "ieee1394_open" and "ieee1394_close" functions will open
|
||||
and close a connection to the printer, respectively.
|
||||
|
||||
The "ieee1394_read" and "ieee1394_write" functions will read
|
||||
and write data to and from the printer, respectively. The
|
||||
read function will be non-blocking, returning data only if
|
||||
there is data coming back from the printer.
|
||||
|
||||
The "ieee1394_error" function will return a string
|
||||
describing the last error or NULL if no error occurred.
|
||||
|
||||
The library will be responsible for creating any background
|
||||
threads that are needed to monitor the connection to the
|
||||
printer.
|
||||
|
||||
|
||||
CUPS BACKEND
|
||||
|
||||
The CUPS backend will use the OS abstraction layer to list
|
||||
and access the Firewire printers. The "main" function will
|
||||
read and write printer data, while the "list_devices"
|
||||
function will be called as necessary to identify the
|
||||
available devices.
|
||||
|
||||
The CUPS 1.1 backend will record any status information in
|
||||
the error log file, while the 1.2 backend will supply it to
|
||||
the printer driver process.
|
||||
@@ -0,0 +1,35 @@
|
||||
Easy Software Products
|
||||
44141 Airport View Drive
|
||||
Suite 204
|
||||
Hollywood, Maryland 20636
|
||||
+1.301.373.9600
|
||||
March 8, 2002
|
||||
|
||||
|
||||
Subject: EPSON Firewire Printer Driver for Linux
|
||||
|
||||
Currently, no Firewire printer support exists for Linux. Since
|
||||
the latest EPSON printer products depend on the Firewire
|
||||
interface to print at full speed, a solution is needed to
|
||||
support customers using Linux as their server platform.
|
||||
|
||||
The Linux Firewire subsystem provides a user-mode driver
|
||||
interface that allows driver programs to access Firewire
|
||||
devices. Easy Software Products will utilize this interface to
|
||||
develop a "backend" program for the Common UNIX Printing System
|
||||
that will allow users to print to EPSON printers using the
|
||||
Firewire interface.
|
||||
|
||||
After examining the Linux interface, we estimate that it will
|
||||
require approximately 30 hours of development time to write,
|
||||
test, and document the Firewire backend, for a total cost of
|
||||
$3,000. The new backend will become a standard part of the CUPS
|
||||
software distribution and will be included with at least the
|
||||
following Linux distributions:
|
||||
|
||||
- Caldera Linux
|
||||
- Mandrake Linux
|
||||
- Red Hat Linux
|
||||
- SuSE Linux
|
||||
|
||||
ESP will provide EPSON with binaries for Red Hat Linux 7.2.
|
||||
+106
-236
@@ -25,17 +25,15 @@
|
||||
*
|
||||
* 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>
|
||||
@@ -54,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 */
|
||||
@@ -72,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 */
|
||||
@@ -82,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)",
|
||||
@@ -97,7 +94,7 @@ backendGetDeviceID(
|
||||
!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);
|
||||
}
|
||||
|
||||
@@ -145,7 +142,7 @@ backendGetDeviceID(
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
printf("get_device_id: ioctl failed - %s\n", strerror(errno));
|
||||
# endif /* DEBUG */
|
||||
#endif /* __linux */
|
||||
|
||||
@@ -168,167 +165,15 @@ backendGetDeviceID(
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
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...
|
||||
*/
|
||||
|
||||
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...
|
||||
*/
|
||||
@@ -379,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...
|
||||
@@ -461,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
|
||||
{
|
||||
/*
|
||||
@@ -470,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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,877 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Linux IEEE-1394 glue for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2002 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* get_device_id() - Get the IEEE-1284 device ID for a node...
|
||||
* get_unit_type() - Get the unit type for a node...
|
||||
* show_data() - Show a data node...
|
||||
* show_dir() - Show a directory list...
|
||||
* ieee1394_list() - List the available printer devices.
|
||||
* ieee1394_open() - Open a printer device.
|
||||
* ieee1394_close() - Close a printer device.
|
||||
* ieee1394_read() - Read from a printer device.
|
||||
* ieee1394_write() - Write data to a printer device.
|
||||
* ieee1394_error() - Return the last error.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include "ieee1394.h"
|
||||
#include <cups/debug.h>
|
||||
#include <libraw1394/raw1394.h>
|
||||
#include <libraw1394/csr.h>
|
||||
|
||||
|
||||
/*
|
||||
* Limits...
|
||||
*/
|
||||
|
||||
#define MAX_NODES 100
|
||||
|
||||
|
||||
/*
|
||||
* Structures...
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char uri[HTTP_MAX_URI],/* URI for this node... */
|
||||
description[128],/* Description of port */
|
||||
make_model[128];/* Make and model */
|
||||
int port, /* Port where this node is found */
|
||||
node; /* Node number */
|
||||
unsigned long long addr; /* Management address */
|
||||
} linux1394_node_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
raw1394handle_t handle; /* Handle for printer device */
|
||||
int node; /* Node number for printer device */
|
||||
unsigned long long addr; /* Management address */
|
||||
} linux1394_dev_t;
|
||||
|
||||
|
||||
/*
|
||||
* ORB messages for communication with the device...
|
||||
*/
|
||||
|
||||
typedef struct /**** Login ORB Message */
|
||||
{
|
||||
unsigned char passwd_addr[8]; /* Password address */
|
||||
unsigned char resp_addr[8]; /* Login response address */
|
||||
unsigned char notify_excl; /* Notify and exclusive bits */
|
||||
unsigned char recon_func; /* Reconnect time and function */
|
||||
unsigned char lun[2]; /* Logical unit number */
|
||||
unsigned char passwd_len[2]; /* Length of password */
|
||||
unsigned char resp_len[2]; /* Length of login response */
|
||||
unsigned char fifo_addr[8]; /* Local status FIFO address */
|
||||
} login_orb_t;
|
||||
|
||||
typedef struct /**** Login Response Message ****/
|
||||
{
|
||||
unsigned char length[2]; /* Length of response */
|
||||
unsigned char login_id[2]; /* Login ID */
|
||||
unsigned char cmd_addr[8]; /* Command block agent address */
|
||||
unsigned char reserved[2]; /* Reserved (0) */
|
||||
unsigned char recon_hold[2]; /* Number of seconds to hold login */
|
||||
} login_resp_t;
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static char error_string[1024] = "";
|
||||
static int num_nodes;
|
||||
static linux1394_node_t nodes[MAX_NODES];
|
||||
|
||||
|
||||
/*
|
||||
* 'get_device_id()' - Get the IEEE-1284 device ID for a node...
|
||||
*/
|
||||
|
||||
static char * /* O - Device ID */
|
||||
get_device_id(raw1394handle_t handle,/* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset,/* I - Offset to directory */
|
||||
char *id, /* O - ID string */
|
||||
int idlen) /* I - Size of ID string */
|
||||
{
|
||||
unsigned char data[1024], /* Data from ROM */
|
||||
*dataptr; /* Pointer into data */
|
||||
int length; /* Length of directory */
|
||||
int datalen; /* Length of data */
|
||||
unsigned long long dataoff; /* Offset of data */
|
||||
|
||||
|
||||
DEBUG_printf(("get_device_id(handle = %p, node = %d, offset = %llx, id = %p, idlen = %d)\n",
|
||||
handle, node, offset, id, idlen));
|
||||
|
||||
*id = '\0';
|
||||
|
||||
/*
|
||||
* Read the directory length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (NULL);
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
DEBUG_printf((" length = %d\n", length));
|
||||
|
||||
/*
|
||||
* Then read the directory, looking for unit directory or device tags...
|
||||
*/
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (NULL);
|
||||
|
||||
DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
|
||||
data[2], data[3]));
|
||||
|
||||
if (data[0] == 0xd1)
|
||||
{
|
||||
/*
|
||||
* Found the unit directory...
|
||||
*/
|
||||
|
||||
offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
|
||||
|
||||
return (get_device_id(handle, node, offset, id, idlen));
|
||||
}
|
||||
else if (data[0] == 0x81)
|
||||
{
|
||||
/*
|
||||
* Found potential IEEE-1284 device ID...
|
||||
*/
|
||||
|
||||
dataoff = offset + (((((data[1] << 8) | data[2]) << 8) | data[3]) << 2);
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, dataoff, 4, (quadlet_t *)data) < 0)
|
||||
return (NULL);
|
||||
|
||||
dataoff += 4;
|
||||
|
||||
/*
|
||||
* Read the leaf value...
|
||||
*/
|
||||
|
||||
datalen = (data[0] << 8) | data[1];
|
||||
|
||||
if (datalen > (sizeof(data) / 4))
|
||||
datalen = sizeof(data) / 4;
|
||||
|
||||
for (dataptr = data; datalen > 0; datalen --, dataptr += 4, dataoff += 4)
|
||||
if (raw1394_read(handle, 0xffc0 | node, dataoff, 4,
|
||||
(quadlet_t *)dataptr) < 0)
|
||||
return (NULL);
|
||||
|
||||
if (data[0] == 0 && memcmp(data + 8, "MFG:", 4) == 0)
|
||||
{
|
||||
/*
|
||||
* Found the device ID...
|
||||
*/
|
||||
|
||||
datalen = dataptr - data - 8;
|
||||
if (datalen >= idlen)
|
||||
datalen --;
|
||||
|
||||
memcpy(id, data + 8, datalen);
|
||||
id[datalen] = '\0';
|
||||
|
||||
return (id);
|
||||
}
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'get_man_addr()' - Get the management address for a node...
|
||||
*/
|
||||
|
||||
static int /* O - Unit type */
|
||||
get_man_addr(raw1394handle_t handle, /* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset) /* I - Offset to directory */
|
||||
{
|
||||
unsigned char data[4]; /* Data from ROM */
|
||||
int length; /* Length of directory */
|
||||
|
||||
|
||||
DEBUG_printf(("get_man_addr(handle = %p, node = %d, offset = %llx)\n",
|
||||
handle, node, offset));
|
||||
|
||||
/*
|
||||
* Read the directory length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (-1);
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
DEBUG_printf((" length = %d\n", length));
|
||||
|
||||
/*
|
||||
* Then read the directory, looking for unit directory or type tags...
|
||||
*/
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (-1);
|
||||
|
||||
DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
|
||||
data[2], data[3]));
|
||||
|
||||
if (data[0] == 0xd1)
|
||||
{
|
||||
/*
|
||||
* Found the unit directory...
|
||||
*/
|
||||
|
||||
offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
|
||||
|
||||
return (get_man_addr(handle, node, offset));
|
||||
}
|
||||
else if (data[0] == 0x54)
|
||||
{
|
||||
/*
|
||||
* Found the management address...
|
||||
*/
|
||||
|
||||
return (((((data[1] << 8) | data[2]) << 8) | data[3]) << 2);
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'get_unit_type()' - Get the unit type for a node...
|
||||
*/
|
||||
|
||||
static int /* O - Unit type */
|
||||
get_unit_type(raw1394handle_t handle,/* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset)/* I - Offset to directory */
|
||||
{
|
||||
unsigned char data[4]; /* Data from ROM */
|
||||
int length; /* Length of directory */
|
||||
|
||||
|
||||
DEBUG_printf(("get_unit_type(handle = %p, node = %d, offset = %llx)\n",
|
||||
handle, node, offset));
|
||||
|
||||
/*
|
||||
* Read the directory length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (-1);
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
DEBUG_printf((" length = %d\n", length));
|
||||
|
||||
/*
|
||||
* Then read the directory, looking for unit directory or type tags...
|
||||
*/
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (-1);
|
||||
|
||||
DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
|
||||
data[2], data[3]));
|
||||
|
||||
if (data[0] == 0xd1)
|
||||
{
|
||||
/*
|
||||
* Found the unit directory...
|
||||
*/
|
||||
|
||||
offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
|
||||
|
||||
return (get_unit_type(handle, node, offset));
|
||||
}
|
||||
else if (data[0] == 0x14)
|
||||
{
|
||||
/*
|
||||
* Found the unit type...
|
||||
*/
|
||||
|
||||
return (data[1] & 0x1f);
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* 'show_data()' - Show a data node...
|
||||
*/
|
||||
|
||||
static void
|
||||
show_data(raw1394handle_t handle, /* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset, /* I - Offset to directory */
|
||||
int indent) /* Amount to indent */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
unsigned char data[4]; /* Data from ROM */
|
||||
int length; /* Length of data */
|
||||
|
||||
|
||||
/*
|
||||
* Read the data length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return;
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
/*
|
||||
* Then read the data...
|
||||
*/
|
||||
|
||||
for (i = 0; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("LEAF (%d quadlets)\n", length);
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("%02X %02X %02X %02X '%c%c%c%c'\n",
|
||||
data[0], data[1], data[2], data[3],
|
||||
(data[0] < ' ' || data[0] >= 0x7f) ? '.' : data[0],
|
||||
(data[1] < ' ' || data[1] >= 0x7f) ? '.' : data[1],
|
||||
(data[2] < ' ' || data[2] >= 0x7f) ? '.' : data[2],
|
||||
(data[3] < ' ' || data[3] >= 0x7f) ? '.' : data[3]);
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_dir()' - Show a directory list...
|
||||
*/
|
||||
|
||||
static void
|
||||
show_dir(raw1394handle_t handle, /* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset, /* I - Offset to directory */
|
||||
int indent) /* Amount to indent */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
unsigned char data[4]; /* Data from ROM */
|
||||
int length; /* Length of directory */
|
||||
int value; /* Value in directory */
|
||||
|
||||
|
||||
/*
|
||||
* Read the directory length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return;
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
/*
|
||||
* Then read the directory...
|
||||
*/
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("%02X %02X %02X %02X\n", data[0], data[1], data[2], data[3]);
|
||||
|
||||
value = (((data[1] << 8) | data[2]) << 8) | data[3];
|
||||
|
||||
switch (data[0] & 0xc0)
|
||||
{
|
||||
case 0x00 :
|
||||
for (i = -4; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("IMMEDIATE %d\n", value);
|
||||
break;
|
||||
|
||||
case 0x40 :
|
||||
for (i = -4; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("CSR OFFSET +%06X\n", value);
|
||||
break;
|
||||
|
||||
case 0x80 :
|
||||
show_data(handle, node, offset + value * 4, indent + 4);
|
||||
break;
|
||||
|
||||
case 0xc0 :
|
||||
show_dir(handle, node, offset + value * 4, indent + 4);
|
||||
break;
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_list()' - List the available printer devices.
|
||||
*/
|
||||
|
||||
ieee1394_info_t * /* O - Printer information */
|
||||
ieee1394_list(int *num_devices) /* O - Number of printers */
|
||||
{
|
||||
int i, j; /* Looping vars */
|
||||
raw1394handle_t handle; /* 1394 handle */
|
||||
int num_ports; /* Number of ports */
|
||||
struct raw1394_portinfo ports[100]; /* Port data... */
|
||||
unsigned char guid[8]; /* Global unique ID */
|
||||
int vendor; /* Vendor portion of GUID */
|
||||
int unit_type; /* Unit type */
|
||||
int addr; /* Management address offset */
|
||||
char id[1024], /* Device ID string */
|
||||
*idptr, /* Pointer into ID string */
|
||||
*idsep; /* Pointer to separator */
|
||||
ieee1394_info_t *devices; /* Device list */
|
||||
|
||||
|
||||
/*
|
||||
* Connect to the user-mode driver interface...
|
||||
*/
|
||||
|
||||
handle = raw1394_new_handle();
|
||||
num_ports = raw1394_get_port_info(handle, ports,
|
||||
sizeof(ports) / sizeof(ports[0]));
|
||||
|
||||
DEBUG_printf(("num_ports = %d\n", num_ports));
|
||||
|
||||
/*
|
||||
* Loop through the ports to discover what nodes are available.
|
||||
*/
|
||||
|
||||
num_nodes = 0;
|
||||
|
||||
for (i = 0; i < num_ports; i ++)
|
||||
{
|
||||
DEBUG_printf(("ports[%d] = { nodes = %d, name = \"%s\" }\n", i,
|
||||
ports[i].nodes, ports[i].name));
|
||||
|
||||
raw1394_set_port(handle, i);
|
||||
|
||||
for (j = 0; j < ports[i].nodes; j ++)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | j,
|
||||
CSR_REGISTER_BASE + CSR_CONFIG_ROM + 12, 4,
|
||||
(quadlet_t *)guid) < 0)
|
||||
{
|
||||
DEBUG_printf((" Node #%d: Unable to contact (%s)!\n", j,
|
||||
strerror(errno)));
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
raw1394_read(handle, 0xffc0 | j,
|
||||
CSR_REGISTER_BASE + CSR_CONFIG_ROM + 16, 4,
|
||||
(quadlet_t *)(guid + 4));
|
||||
|
||||
DEBUG_printf((" Node #%d: GUID = %02X%02X%02X%02X%02X%02X%02X%02X\n",
|
||||
j, guid[0], guid[1], guid[2], guid[3], guid[4],
|
||||
guid[5], guid[6], guid[7]));
|
||||
|
||||
vendor = (((guid[0] << 8) | guid[1]) << 8) | guid[2];
|
||||
unit_type = get_unit_type(handle, j,
|
||||
CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20);
|
||||
|
||||
DEBUG_printf(("vendor = %x, unit_type = %d\n", vendor, unit_type));
|
||||
|
||||
if (unit_type == 2 && num_nodes < MAX_NODES)
|
||||
{
|
||||
/*
|
||||
* Found a printer device; add it to the nodes list...
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
show_dir(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20, 0);
|
||||
#endif /* DEBUG */
|
||||
|
||||
memset(nodes + num_nodes, 0, sizeof(linux1394_node_t));
|
||||
|
||||
sprintf(nodes[num_nodes].uri, "ieee1394://%02X%02X%02X%02X%02X%02X%02X%02X",
|
||||
guid[0], guid[1], guid[2], guid[3], guid[4],
|
||||
guid[5], guid[6], guid[7]);
|
||||
|
||||
nodes[num_nodes].port = i;
|
||||
nodes[num_nodes].node = j;
|
||||
|
||||
addr = get_man_addr(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20);
|
||||
|
||||
if (addr < 0)
|
||||
continue;
|
||||
|
||||
nodes[num_nodes].addr = CSR_REGISTER_BASE + addr;
|
||||
|
||||
DEBUG_printf(("Node address = %llx\n", nodes[num_nodes].addr));
|
||||
|
||||
get_device_id(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20,
|
||||
id, sizeof(id));
|
||||
|
||||
if (id[0])
|
||||
{
|
||||
/*
|
||||
* Grab the manufacturer and model name from the device ID
|
||||
* string...
|
||||
*/
|
||||
|
||||
idptr = id + 4;
|
||||
idsep = strchr(id, ';');
|
||||
if (idsep)
|
||||
*idsep++ = '\0';
|
||||
else
|
||||
idsep = idptr;
|
||||
|
||||
snprintf(nodes[num_nodes].description,
|
||||
sizeof(nodes[num_nodes].description),
|
||||
"%s Firewire Printer", idptr);
|
||||
|
||||
if ((idptr = strstr(idsep, "DES:")) == NULL)
|
||||
idptr = strstr(idsep, "MDL:");
|
||||
|
||||
if (idptr == NULL)
|
||||
strcpy(nodes[num_nodes].make_model, "Unknown");
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Grab the DES or MDL code...
|
||||
*/
|
||||
|
||||
idptr += 4;
|
||||
idsep = strchr(idptr, ';');
|
||||
if (idsep)
|
||||
*idsep = '\0';
|
||||
|
||||
if (strncmp(id + 4, idptr, strlen(id + 4)) == 0)
|
||||
{
|
||||
/*
|
||||
* Use the description directly...
|
||||
*/
|
||||
|
||||
strlcpy(nodes[num_nodes].make_model, idptr,
|
||||
sizeof(nodes[num_nodes].make_model));
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Add the manufacturer to the front of the name...
|
||||
*/
|
||||
|
||||
snprintf(nodes[num_nodes].make_model,
|
||||
sizeof(nodes[num_nodes].make_model),
|
||||
"%s %s", id + 4, idptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Flag it as an unknown printer...
|
||||
*/
|
||||
|
||||
sprintf(nodes[num_nodes].description,
|
||||
"Unknown%06X Firewire Printer", vendor);
|
||||
strcpy(nodes[num_nodes].make_model, "Unknown");
|
||||
}
|
||||
|
||||
num_nodes ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Done querying the Firewire bus...
|
||||
*/
|
||||
|
||||
raw1394_destroy_handle(handle);
|
||||
|
||||
/*
|
||||
* Build an array of device info structures as needed...
|
||||
*/
|
||||
|
||||
if (num_devices == NULL)
|
||||
return (NULL);
|
||||
|
||||
*num_devices = num_nodes;
|
||||
|
||||
if (num_nodes)
|
||||
{
|
||||
if ((devices = calloc(sizeof(ieee1394_info_t), num_nodes)) != NULL)
|
||||
{
|
||||
for (i = 0; i < num_nodes; i ++)
|
||||
{
|
||||
strcpy(devices[i].uri, nodes[i].uri);
|
||||
strcpy(devices[i].description, nodes[i].description);
|
||||
strcpy(devices[i].make_model, nodes[i].make_model);
|
||||
}
|
||||
}
|
||||
|
||||
return (devices);
|
||||
}
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_open()' - Open a printer device.
|
||||
*/
|
||||
|
||||
ieee1394_dev_t /* O - Printer device or NULL */
|
||||
ieee1394_open(const char *uri) /* I - Device URI */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
linux1394_dev_t *ldev; /* Linux device */
|
||||
|
||||
|
||||
/*
|
||||
* Return early if we can't see any printers...
|
||||
*/
|
||||
|
||||
if (num_nodes == 0)
|
||||
ieee1394_list(NULL);
|
||||
|
||||
if (num_nodes == 0)
|
||||
{
|
||||
strcpy(error_string, "No IEEE-1394 printers found!");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for the URI...
|
||||
*/
|
||||
|
||||
for (i = 0; i < num_nodes; i ++)
|
||||
if (strcmp(nodes[i].uri, uri) == 0)
|
||||
break;
|
||||
|
||||
if (i >= num_nodes)
|
||||
{
|
||||
snprintf(error_string, sizeof(error_string), "Device %s not found!", uri);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now create a new device structure...
|
||||
*/
|
||||
|
||||
if ((ldev = calloc(sizeof(linux1394_dev_t), 1)) == NULL)
|
||||
{
|
||||
strcpy(error_string, "Out of memory!");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ldev->handle = raw1394_new_handle();
|
||||
ldev->node = nodes[i].node;
|
||||
ldev->addr = nodes[i].addr;
|
||||
|
||||
raw1394_set_port(ldev->handle, nodes[i].port);
|
||||
|
||||
error_string[0] = '\0';
|
||||
|
||||
return ((ieee1394_dev_t)ldev);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_close()' - Close a printer device.
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on failure */
|
||||
ieee1394_close(ieee1394_dev_t dev) /* I - Printer device */
|
||||
{
|
||||
linux1394_dev_t *ldev; /* Linux device */
|
||||
|
||||
|
||||
ldev = (linux1394_dev_t *)dev;
|
||||
|
||||
raw1394_destroy_handle(ldev->handle);
|
||||
|
||||
free(ldev);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_read()' - Read from a printer device.
|
||||
*/
|
||||
|
||||
int /* O - Number of bytes read or -1 */
|
||||
ieee1394_read(ieee1394_dev_t dev, /* I - Printer device */
|
||||
char *buffer, /* I - Read buffer */
|
||||
int len) /* I - Max bytes to read */
|
||||
{
|
||||
linux1394_dev_t *ldev; /* Linux device */
|
||||
|
||||
|
||||
ldev = (linux1394_dev_t *)dev;
|
||||
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_write()' - Write data to a printer device.
|
||||
*/
|
||||
|
||||
int /* O - Number of bytes written or -1 */
|
||||
ieee1394_write(ieee1394_dev_t dev, /* I - Printer device */
|
||||
char *buffer, /* I - Buffer to write */
|
||||
int len) /* I - Number of bytes to write */
|
||||
{
|
||||
linux1394_dev_t *ldev; /* Linux device */
|
||||
|
||||
|
||||
ldev = (linux1394_dev_t *)dev;
|
||||
|
||||
|
||||
/* if (raw1394_write(handle, 0xffc0 | j, 0, ,
|
||||
(quadlet_t *)guid) < 0)*/
|
||||
|
||||
return (len);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_error()' - Return the last error.
|
||||
*/
|
||||
|
||||
const char * /* O - Error string or NULL */
|
||||
ieee1394_error(void)
|
||||
{
|
||||
if (error_string[0])
|
||||
return (error_string);
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -0,0 +1,267 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* IEEE-1394 backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2002 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Send a file to the printer.
|
||||
* list_devices() - List all known printer devices...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include "ieee1394.h"
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
void list_devices(void);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the printer.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* printer-uri job-id user title copies options [file]
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
ieee1394_dev_t dev; /* Printer device */
|
||||
int fp; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
int rbytes; /* Number of bytes read from device */
|
||||
size_t nbytes, /* Number of bytes read from file */
|
||||
tbytes; /* Total number of bytes written */
|
||||
char buffer[8192]; /* Input/output buffer */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
|
||||
/*
|
||||
* Make sure status messages are not buffered...
|
||||
*/
|
||||
|
||||
setbuf(stderr, NULL);
|
||||
|
||||
/*
|
||||
* Check command-line...
|
||||
*/
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
list_devices();
|
||||
|
||||
return (0);
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, send stdin instead...
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
fp = 0;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to open the printer device...
|
||||
*/
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
do
|
||||
{
|
||||
if ((dev = ieee1394_open(argv[0])) == NULL)
|
||||
{
|
||||
fputs("INFO: Firewire printer busy; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
while (dev == NULL);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* 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...
|
||||
*/
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (fp != 0)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
lseek(fp, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = 0;
|
||||
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
/*
|
||||
* Write the print data to the printer...
|
||||
*/
|
||||
|
||||
tbytes += nbytes;
|
||||
|
||||
if (ieee1394_write(dev, buffer, nbytes) < 0)
|
||||
{
|
||||
perror("ERROR: Unable to send print file to printer");
|
||||
break;
|
||||
}
|
||||
|
||||
if ((rbytes = ieee1394_read(dev, buffer, sizeof(buffer))) > 0)
|
||||
fprintf(stderr, "INFO: Read %d bytes from printer...\n", rbytes);
|
||||
|
||||
if (argc > 6)
|
||||
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
|
||||
(unsigned long)tbytes);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the printer device and input file and return...
|
||||
*/
|
||||
|
||||
ieee1394_close(dev);
|
||||
|
||||
if (fp != 0)
|
||||
close(fp);
|
||||
|
||||
fputs("INFO: Ready to print.\n", stderr);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'list_devices()' - List all known devices...
|
||||
*/
|
||||
|
||||
void
|
||||
list_devices(void)
|
||||
{
|
||||
int i, /* Looping var */
|
||||
num_info; /* Number of devices */
|
||||
ieee1394_info_t *info; /* Devices... */
|
||||
|
||||
|
||||
/*
|
||||
* Get the available devices...
|
||||
*/
|
||||
|
||||
info = ieee1394_list(&num_info);
|
||||
|
||||
/*
|
||||
* List them as needed...
|
||||
*/
|
||||
|
||||
if (num_info > 0)
|
||||
{
|
||||
for (i = 0; i < num_info; i ++)
|
||||
printf("direct %s \"%s\" \"%s\"\n", info[i].uri,
|
||||
info[i].make_model, info[i].description);
|
||||
|
||||
free(info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* IEEE-1394 header for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2002 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <cups/string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef WIN32
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Device information structure...
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char uri[HTTP_MAX_URI], /* Device URI */
|
||||
description[128], /* Description of port */
|
||||
make_model[128]; /* Make and model */
|
||||
} ieee1394_info_t;
|
||||
|
||||
|
||||
/*
|
||||
* Private device connection information...
|
||||
*/
|
||||
|
||||
typedef void *ieee1394_dev_t;
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes for standard IEEE-1394 interface...
|
||||
*/
|
||||
|
||||
extern ieee1394_info_t *ieee1394_list(int *num_devices);
|
||||
extern ieee1394_dev_t ieee1394_open(const char *uri);
|
||||
extern int ieee1394_close(ieee1394_dev_t dev);
|
||||
extern int ieee1394_read(ieee1394_dev_t dev, char *buffer, int len);
|
||||
extern int ieee1394_write(ieee1394_dev_t dev, char *buffer, int len);
|
||||
extern const char *ieee1394_error(void);
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
+23
-70
@@ -107,7 +107,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
addrname[256], /* Address name */
|
||||
*optptr, /* Pointer to URI options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
@@ -133,13 +132,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
ipp_attribute_t *format_sup; /* document-format-supported */
|
||||
ipp_attribute_t *printer_state; /* printer-state attribute */
|
||||
ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs */
|
||||
int copies, /* Number of copies for job */
|
||||
copies_remaining; /* Number of copies remaining */
|
||||
int copies; /* Number of copies remaining */
|
||||
const char *content_type; /* CONTENT_TYPE environment variable */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
int version; /* IPP version */
|
||||
int reasons; /* Number of printer-state-reasons */
|
||||
static const char * const pattrs[] =
|
||||
{ /* Printer attributes we want */
|
||||
"copies-supported",
|
||||
@@ -212,11 +211,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
if ((content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
|
||||
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
|
||||
content_type = "application/octet-stream";
|
||||
|
||||
if (!strncmp(content_type, "printer/", 8))
|
||||
content_type = "application/vnd.cups-raw";
|
||||
content_type = "application/octet-stream";
|
||||
|
||||
/*
|
||||
* Extract the hostname and printer name from the URI...
|
||||
@@ -234,8 +229,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
if (!strcmp(method, "https"))
|
||||
cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
|
||||
else
|
||||
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
|
||||
|
||||
/*
|
||||
* See if there are any options...
|
||||
@@ -283,7 +276,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*ptr++ = *optptr++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*optptr == '+' || *optptr == '&')
|
||||
if (*optptr == '+')
|
||||
optptr ++;
|
||||
}
|
||||
else
|
||||
@@ -575,18 +568,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (http->hostaddr->addr.sa_family == AF_INET6)
|
||||
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
|
||||
httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
|
||||
ntohs(http->hostaddr->ipv6.sin6_port));
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
if (http->hostaddr->addr.sa_family == AF_INET)
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
|
||||
httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
|
||||
ntohs(http->hostaddr->ipv4.sin_port));
|
||||
|
||||
/*
|
||||
* Build a URI for the printer and fill the standard IPP attributes for
|
||||
* an IPP_PRINT_FILE request. We can't use the URI in argv[0] because it
|
||||
@@ -752,25 +733,19 @@ main(int argc, /* I - Number of command-line args */
|
||||
* See if the printer supports multiple copies...
|
||||
*/
|
||||
|
||||
copies = atoi(argv[4]);
|
||||
|
||||
if (copies_sup || argc < 7)
|
||||
{
|
||||
copies_remaining = 1;
|
||||
|
||||
if (argc < 7)
|
||||
copies = 1;
|
||||
}
|
||||
copies = 1;
|
||||
else
|
||||
copies_remaining = copies;
|
||||
copies = atoi(argv[4]);
|
||||
|
||||
/*
|
||||
* Then issue the print-job request...
|
||||
*/
|
||||
|
||||
reasons = 0;
|
||||
job_id = 0;
|
||||
|
||||
while (copies_remaining > 0)
|
||||
while (copies > 0)
|
||||
{
|
||||
/*
|
||||
* Build the IPP request...
|
||||
@@ -797,13 +772,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
fprintf(stderr, "DEBUG: requesting-user-name = \"%s\"\n", argv[2]);
|
||||
|
||||
/*
|
||||
* Only add a "job-name" attribute if the remote server supports
|
||||
* copy generation - some IPP implementations like HP's don't seem
|
||||
* to like UTF-8 job names (STR #1837)...
|
||||
*/
|
||||
|
||||
if (argv[3][0] && copies_sup)
|
||||
if (argv[3][0])
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
|
||||
argv[3]);
|
||||
|
||||
@@ -850,9 +819,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
* number of copies to 1...
|
||||
*/
|
||||
|
||||
content_type = "application/postscript";
|
||||
copies = 1;
|
||||
copies_remaining = 1;
|
||||
content_type = "application/postscript";
|
||||
copies = 1;
|
||||
}
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
@@ -868,21 +836,20 @@ main(int argc, /* I - Number of command-line args */
|
||||
num_options, &options);
|
||||
}
|
||||
|
||||
if (copies_sup && version > 0)
|
||||
if (copies_sup)
|
||||
{
|
||||
/*
|
||||
* Only send options if the destination printer supports the copies
|
||||
* attribute and IPP/1.1. This is a hack for the HP and Lexmark
|
||||
* implementations of IPP, which do not accept extension attributes
|
||||
* and incorrectly report a client-error-bad-request error instead of
|
||||
* the successful-ok-unsupported-attributes status. In short, at least
|
||||
* some HP and Lexmark implementations of IPP are non-compliant.
|
||||
* attribute. This is a hack for the HP JetDirect implementation of
|
||||
* IPP, which does not accept extension attributes and incorrectly
|
||||
* reports a client-error-bad-request error instead of the
|
||||
* successful-ok-unsupported-attributes status. In short, at least
|
||||
* some HP implementations of IPP are non-compliant.
|
||||
*/
|
||||
|
||||
cupsEncodeOptions(request, num_options, options);
|
||||
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies",
|
||||
copies);
|
||||
atoi(argv[4]));
|
||||
}
|
||||
|
||||
cupsFreeOptions(num_options, options);
|
||||
@@ -890,7 +857,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
/*
|
||||
* If copies aren't supported, then we are likely dealing with an HP
|
||||
* JetDirect. The HP IPP implementation seems to close the connection
|
||||
* after every request - that is, it does *not* implement HTTP Keep-
|
||||
* after every request (that is, it does *not* implement HTTP Keep-
|
||||
* Alive, which is REQUIRED by HTTP/1.1...
|
||||
*/
|
||||
|
||||
@@ -921,18 +888,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
fputs("INFO: Printer is busy; retrying print job...\n", stderr);
|
||||
sleep(10);
|
||||
}
|
||||
else if ((ipp_status == IPP_BAD_REQUEST ||
|
||||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
|
||||
{
|
||||
/*
|
||||
* Switch to IPP/1.0...
|
||||
*/
|
||||
|
||||
fputs("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n",
|
||||
stderr);
|
||||
version = 0;
|
||||
httpReconnect(http);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "ERROR: Print file was not accepted (%s)!\n",
|
||||
cupsLastErrorString());
|
||||
@@ -994,13 +949,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
|
||||
{
|
||||
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
|
||||
copies_remaining --;
|
||||
copies --;
|
||||
}
|
||||
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
break;
|
||||
else
|
||||
copies_remaining --;
|
||||
copies --;
|
||||
|
||||
/*
|
||||
* Wait for the job to complete...
|
||||
@@ -1260,7 +1215,7 @@ compress_files(int num_files, /* I - Number of files */
|
||||
*out; /* Output file */
|
||||
struct stat outinfo; /* Output file information */
|
||||
char filename[1024], /* Temporary filename */
|
||||
buffer[32768]; /* Copy buffer */
|
||||
buffer[65536]; /* Copy buffer */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: Compressing %d job files...\n", num_files);
|
||||
@@ -1342,8 +1297,6 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
exit(CUPS_BACKEND_AUTH_REQUIRED);
|
||||
|
||||
return (NULL); /* Eliminate compiler warning */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1380,7 +1333,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
strlcat(state, reason, sizeof(state));
|
||||
|
||||
prefix = ",";
|
||||
message = "";
|
||||
message = NULL;
|
||||
|
||||
if (!strncmp(reason, "media-needed", 12))
|
||||
message = "Media tray needs to be filled.";
|
||||
|
||||
+3
-15
@@ -261,7 +261,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
/* 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 */
|
||||
@@ -582,7 +581,6 @@ 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 */
|
||||
char addrname[256]; /* Address name */
|
||||
http_addrlist_t *addrlist, /* Address list */
|
||||
*addr; /* Socket address */
|
||||
int copy; /* Copies written */
|
||||
@@ -592,7 +590,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
#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 */
|
||||
@@ -821,18 +819,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6) (local port %d)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv6.sin6_port), lport);
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
if (addr->addr.addr.sa_family == AF_INET)
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4) (local port %d)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv4.sin_port), lport);
|
||||
fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
|
||||
lport);
|
||||
|
||||
/*
|
||||
* Next, open the print file and figure out its size...
|
||||
|
||||
-1598
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+194
-55
@@ -33,7 +33,14 @@
|
||||
* 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>
|
||||
@@ -87,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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -140,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
|
||||
{
|
||||
@@ -149,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);
|
||||
@@ -189,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)
|
||||
{
|
||||
@@ -219,8 +217,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs("INFO: Unable to open parallel port, queuing on next printer "
|
||||
"in class...\n", stderr);
|
||||
fputs("INFO: Unable to open parallel port, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -233,26 +231,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
fputs("INFO: Parallel port busy; will retry in 30 seconds...\n",
|
||||
stderr);
|
||||
fputs("INFO: Parallel port busy; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
|
||||
{
|
||||
fputs("INFO: Printer not connected; will retry in 30 seconds...\n",
|
||||
stderr);
|
||||
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr,
|
||||
"ERROR: Unable to open parallel port device file \"%s\": %s\n",
|
||||
fprintf(stderr, "ERROR: Unable to open 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);
|
||||
|
||||
@@ -260,47 +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);
|
||||
tbytes = 0;
|
||||
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
/*
|
||||
* Write the print data to the printer...
|
||||
*/
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -329,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");
|
||||
|
||||
@@ -348,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
|
||||
|
||||
@@ -1,262 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Common run loop API for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" 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.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* 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 */
|
||||
|
||||
|
||||
/*
|
||||
* '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? */
|
||||
{
|
||||
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)\n",
|
||||
print_fd, device_fd, use_bc);
|
||||
|
||||
/*
|
||||
* 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 = 0, paperout = 0, 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);
|
||||
|
||||
FD_ZERO(&output);
|
||||
if (print_bytes || !use_bc)
|
||||
FD_SET(device_fd, &output);
|
||||
|
||||
if (use_bc)
|
||||
{
|
||||
if (select(nfds, &input, &output, NULL, NULL) < 0)
|
||||
{
|
||||
/*
|
||||
* Pause printing to clear any pending errors...
|
||||
*/
|
||||
|
||||
if (errno == ENXIO && !offline)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs("INFO: Printer is currently off-line.\n", stderr);
|
||||
offline = 1;
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
fputs("ERROR: Out of paper!\n", stderr);
|
||||
fputs("STATE: +media-empty-error\n", stderr);
|
||||
paperout = 1;
|
||||
}
|
||||
}
|
||||
else if (errno == ENXIO)
|
||||
{
|
||||
if (!offline)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs("INFO: Printer is currently off-line.\n", stderr);
|
||||
offline = 1;
|
||||
}
|
||||
}
|
||||
else if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
|
||||
{
|
||||
perror("ERROR: Unable to write print data");
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (paperout)
|
||||
{
|
||||
fputs("STATE: -media-empty-error\n", stderr);
|
||||
paperout = 0;
|
||||
}
|
||||
|
||||
if (offline)
|
||||
{
|
||||
fputs("STATE: -offline-error\n", stderr);
|
||||
fputs("INFO: Printer is now on-line.\n", stderr);
|
||||
offline = 0;
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
|
||||
|
||||
print_bytes -= bytes;
|
||||
print_ptr += bytes;
|
||||
total_bytes += bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Return with success...
|
||||
*/
|
||||
|
||||
return (total_bytes);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
+2
-2
@@ -80,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"
|
||||
@@ -90,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 */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+137
-229
@@ -33,7 +33,13 @@
|
||||
* 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>
|
||||
@@ -81,11 +87,6 @@
|
||||
# include <IOKit/IOBSD.h>
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#if defined(__linux) && defined(TIOCGSERIAL)
|
||||
# include <linux/serial.h>
|
||||
# include <linux/ioctl.h>
|
||||
#endif /* __linux && TIOCGSERIAL */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -115,23 +116,21 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
int port; /* Port number (not used) */
|
||||
int fp; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
int 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 */
|
||||
@@ -179,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
|
||||
{
|
||||
@@ -188,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);
|
||||
@@ -228,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)
|
||||
{
|
||||
@@ -265,7 +263,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
}
|
||||
}
|
||||
while (device_fd < 0);
|
||||
while (fd < 0);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
@@ -273,18 +271,16 @@ 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)
|
||||
{
|
||||
/*
|
||||
@@ -309,7 +305,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
if (*options == '+')
|
||||
options ++;
|
||||
}
|
||||
else
|
||||
@@ -325,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));
|
||||
@@ -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,181 +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);
|
||||
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 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -717,48 +663,21 @@ 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);
|
||||
@@ -778,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 ++)
|
||||
@@ -913,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 */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1152,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)
|
||||
@@ -1205,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1214,11 +1126,7 @@ list_devices(void)
|
||||
IOObjectRelease(serialService);
|
||||
}
|
||||
|
||||
/*
|
||||
* Release the iterator.
|
||||
*/
|
||||
|
||||
IOObjectRelease(serialPortIterator);
|
||||
IOObjectRelease(serialPortIterator); /* Release the iterator. */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
-2463
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
|
||||
|
||||
+234
-140
@@ -32,11 +32,17 @@
|
||||
* 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>
|
||||
@@ -70,21 +76,24 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
int print_fd; /* Print file */
|
||||
int fp; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
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() */
|
||||
ssize_t bc_bytes; /* Number of back-channel bytes read */
|
||||
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 */
|
||||
@@ -133,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
|
||||
{
|
||||
@@ -142,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);
|
||||
@@ -243,157 +252,242 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (delay < 30)
|
||||
delay += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv6.sin6_port));
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
if (addr->addr.addr.sa_family == AF_INET)
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv4.sin_port));
|
||||
|
||||
/*
|
||||
* Print everything...
|
||||
*/
|
||||
|
||||
tbytes = 0;
|
||||
|
||||
while (copies > 0 && tbytes >= 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (print_fd != 0)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, 1);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
|
||||
CUPS_LLCAST 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(device_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(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 ((bc_bytes = read(device_fd, resource, sizeof(resource))) > 0)
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
|
||||
(int)bc_bytes);
|
||||
cupsBackChannelWrite(resource, bc_bytes, 1.0);
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (delay < 30)
|
||||
delay += 5;
|
||||
}
|
||||
else
|
||||
break;
|
||||
{
|
||||
perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* 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...
|
||||
*/
|
||||
|
||||
copies --;
|
||||
|
||||
if (fp != 0)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
lseek(fp, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
fputs("INFO: Connected to host, sending print job...\n", stderr);
|
||||
|
||||
tbytes = 0;
|
||||
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
/*
|
||||
* Write the print data to the printer...
|
||||
*/
|
||||
|
||||
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 = 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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the socket connection...
|
||||
*/
|
||||
|
||||
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)
|
||||
if (wbytes >= 0)
|
||||
fputs("INFO: Ready to print.\n", stderr);
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
#endif /* WIN32 */
|
||||
|
||||
#define DEBUG
|
||||
#include "ieee1284.c"
|
||||
|
||||
@@ -77,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);
|
||||
|
||||
+17
-75
@@ -198,13 +198,12 @@ static void copy_deviceinfo(CFStringRef deviceIDString, CFStringRef *make, CFStr
|
||||
static void release_deviceinfo(CFStringRef *make, CFStringRef *model, CFStringRef *serial);
|
||||
static kern_return_t load_classdriver(CFStringRef driverPath, printer_interface_t intf, classdriver_context_t ***driver);
|
||||
static kern_return_t unload_classdriver(classdriver_context_t ***classDriver);
|
||||
static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *driverBundlePath);
|
||||
static kern_return_t registry_open(printer_data_t *printer, CFStringRef *driverBundlePath);
|
||||
static kern_return_t load_printerdriver(printer_data_t *printer);
|
||||
static kern_return_t registry_open(printer_data_t *printer);
|
||||
static kern_return_t registry_close(printer_data_t *printer);
|
||||
static OSStatus copy_deviceid(classdriver_context_t **printer, CFStringRef *deviceID);
|
||||
static void copy_devicestring(io_service_t usbInterface, CFStringRef *deviceID, UInt32 *deviceLocation);
|
||||
static CFStringRef copy_value_for_key(CFStringRef deviceID, CFStringRef *keys);
|
||||
static CFStringRef cfstr_create_and_trim(const char *cstr);
|
||||
static void parse_options(const char *options, char *serial, UInt32 *location, Boolean *waitEOF);
|
||||
static void setup_cfLanguage(void);
|
||||
static void *read_thread(void *reference);
|
||||
@@ -229,6 +228,7 @@ static void parse_pserror (char *sockBuffer, int len);
|
||||
|
||||
void list_devices()
|
||||
{
|
||||
puts("direct usb \"Unknown\" \"USB Printer (usb)\"");
|
||||
iterate_printers(list_device_callback, NULL);
|
||||
}
|
||||
|
||||
@@ -256,7 +256,6 @@ print_device(const char *uri, /* I - Device URI */
|
||||
int countdown = INITIAL_LOG_INTERVAL; /* Logging interval */
|
||||
pthread_cond_t *readCompleteConditionPtr = NULL; /* Read complete condition */
|
||||
pthread_mutex_t *readMutexPtr = NULL; /* Read mutex */
|
||||
CFStringRef driverBundlePath; /* Class driver path */
|
||||
|
||||
setup_cfLanguage();
|
||||
parse_options(options, serial, &printer_data.location, &printer_data.waitEOF);
|
||||
@@ -265,10 +264,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
resource++;
|
||||
|
||||
printer_data.uri = uri;
|
||||
|
||||
printer_data.make = cfstr_create_and_trim(hostname);
|
||||
printer_data.model = cfstr_create_and_trim(resource);
|
||||
printer_data.serial = cfstr_create_and_trim(serial);
|
||||
printer_data.make = CFStringCreateWithCString(NULL, hostname, kCFStringEncodingUTF8);
|
||||
printer_data.model = CFStringCreateWithCString(NULL, resource, kCFStringEncodingUTF8);
|
||||
printer_data.serial = CFStringCreateWithCString(NULL, serial, kCFStringEncodingUTF8);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
@@ -284,9 +282,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
iterate_printers(find_device_callback, &printer_data);
|
||||
|
||||
fprintf(stderr, "INFO: Opening Connection\n");
|
||||
|
||||
driverBundlePath = NULL;
|
||||
status = registry_open(&printer_data, &driverBundlePath);
|
||||
status = registry_open(&printer_data);
|
||||
#if defined(__i386__)
|
||||
/*
|
||||
* If we were unable to load the class drivers for this printer it's probably because they're ppc-only.
|
||||
@@ -297,26 +293,6 @@ print_device(const char *uri, /* I - Device URI */
|
||||
/* Never returns here */
|
||||
}
|
||||
#endif /* __i386__ */
|
||||
if (status == -2) {
|
||||
/*
|
||||
* If we still were unable to load the class drivers for this printer log
|
||||
* the error and stop the queue...
|
||||
*/
|
||||
|
||||
if (driverBundlePath == NULL || !CFStringGetCString(driverBundlePath, buffer, sizeof(buffer), kCFStringEncodingUTF8))
|
||||
strlcpy(buffer, "USB class driver", sizeof(buffer));
|
||||
|
||||
fprintf(stderr, "STATE: +apple-missing-usbclassdriver-error\n" \
|
||||
"FATAL: Could not load %s\n", buffer);
|
||||
|
||||
if (driverBundlePath)
|
||||
CFRelease(driverBundlePath);
|
||||
|
||||
return CUPS_BACKEND_STOP;
|
||||
}
|
||||
|
||||
if (driverBundlePath)
|
||||
CFRelease(driverBundlePath);
|
||||
|
||||
if (status != noErr) {
|
||||
sleep( PRINTER_POLLING_INTERVAL );
|
||||
@@ -466,26 +442,14 @@ static Boolean list_device_callback(void *refcon, io_service_t obj)
|
||||
if (deviceIDString != NULL) {
|
||||
CFStringRef make = NULL, model = NULL, serial = NULL;
|
||||
char uristr[1024], makestr[1024], modelstr[1024], serialstr[1024], optionsstr[1024];
|
||||
char idstr[1024];
|
||||
|
||||
copy_deviceinfo(deviceIDString, &make, &model, &serial);
|
||||
|
||||
modelstr[0] = '/';
|
||||
|
||||
CFStringGetCString(deviceIDString, idstr, sizeof(idstr), kCFStringEncodingUTF8);
|
||||
CFStringGetCString(make, makestr, sizeof(makestr), kCFStringEncodingUTF8);
|
||||
CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1, kCFStringEncodingUTF8);
|
||||
|
||||
/*
|
||||
* Fix common HP 1284 bug...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(makestr, "Hewlett-Packard"))
|
||||
strcpy(makestr, "HP");
|
||||
|
||||
if (!strncasecmp(modelstr + 1, "hp ", 3))
|
||||
_cups_strcpy(modelstr + 1, modelstr + 4);
|
||||
|
||||
optionsstr[0] = '\0';
|
||||
if (serial != NULL)
|
||||
{
|
||||
@@ -500,8 +464,7 @@ static Boolean list_device_callback(void *refcon, io_service_t obj)
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uristr, sizeof(uristr), "usb", NULL, makestr, 0, modelstr);
|
||||
strncat(uristr, optionsstr, sizeof(uristr));
|
||||
|
||||
printf("direct %s \"%s %s\" \"%s %s USB\" \"%s\"\n", uristr, makestr,
|
||||
&modelstr[1], makestr, &modelstr[1], idstr);
|
||||
printf("direct %s \"%s %s\" \"%s\"\n", uristr, makestr, &modelstr[1], &modelstr[1]);
|
||||
|
||||
release_deviceinfo(&make, &model, &serial);
|
||||
CFRelease(deviceIDString);
|
||||
@@ -533,7 +496,7 @@ static Boolean find_device_callback(void *refcon, io_service_t obj)
|
||||
if (CFStringCompare(make, userData->make, kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
|
||||
if (CFStringCompare(model, userData->model, kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
|
||||
if (userData->serial != NULL) {
|
||||
if (serial != NULL && CFStringCompare(serial, userData->serial, kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
|
||||
if (serial != NULL && CFStringCompare(model, userData->model, kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
|
||||
IOObjectRetain(obj);
|
||||
userData->printerObj = obj;
|
||||
keepLooking = false;
|
||||
@@ -753,11 +716,9 @@ static kern_return_t unload_classdriver(classdriver_context_t ***classDriver)
|
||||
|
||||
/*
|
||||
* 'load_printerdriver()' - Load a vendor's (or generic) classdriver.
|
||||
*
|
||||
* If driverBundlePath is not NULL on return it is the callers responsbility to release it!
|
||||
*/
|
||||
|
||||
static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *driverBundlePath)
|
||||
static kern_return_t load_printerdriver(printer_data_t *printer)
|
||||
{
|
||||
IOCFPlugInInterface **iodev = NULL;
|
||||
SInt32 score;
|
||||
@@ -771,10 +732,11 @@ static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *dr
|
||||
|
||||
kr = IORegistryEntryCreateCFProperties(printer->printerObj, &properties, NULL, kNilOptions);
|
||||
if (kr == kIOReturnSuccess) {
|
||||
CFStringRef driverBundlePath = NULL;
|
||||
if (properties != NULL) {
|
||||
*driverBundlePath = (CFStringRef) CFDictionaryGetValue(properties, kUSBClassDriverProperty);
|
||||
driverBundlePath = (CFStringRef) CFDictionaryGetValue(properties, kUSBClassDriverProperty);
|
||||
}
|
||||
kr = load_classdriver(*driverBundlePath, intf, &printer->printerDriver);
|
||||
kr = load_classdriver(driverBundlePath, intf, &printer->printerDriver);
|
||||
}
|
||||
|
||||
if (kr != kIOReturnSuccess)
|
||||
@@ -790,9 +752,9 @@ static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *dr
|
||||
* 'registry_open()' - Open a connection to the printer.
|
||||
*/
|
||||
|
||||
static kern_return_t registry_open(printer_data_t *printer, CFStringRef *driverBundlePath)
|
||||
static kern_return_t registry_open(printer_data_t *printer)
|
||||
{
|
||||
kern_return_t kr = load_printerdriver(printer, driverBundlePath);
|
||||
kern_return_t kr = load_printerdriver(printer);
|
||||
if (kr != kIOReturnSuccess) {
|
||||
kr = -2;
|
||||
}
|
||||
@@ -1001,27 +963,6 @@ static CFStringRef copy_value_for_key(CFStringRef deviceID, CFStringRef *keys)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cfstr_create_and_trim()' - Create a CFString from a c-string and
|
||||
* trim it's whitespace characters.
|
||||
*/
|
||||
|
||||
CFStringRef cfstr_create_and_trim(const char *cstr)
|
||||
{
|
||||
CFStringRef cfstr;
|
||||
CFMutableStringRef cfmutablestr = NULL;
|
||||
|
||||
if ((cfstr = CFStringCreateWithCString(NULL, cstr, kCFStringEncodingUTF8)) != NULL)
|
||||
{
|
||||
if ((cfmutablestr = CFStringCreateMutableCopy(NULL, 1024, cfstr)) != NULL)
|
||||
CFStringTrimWhitespace(cfmutablestr);
|
||||
|
||||
CFRelease(cfstr);
|
||||
}
|
||||
return (CFStringRef) cfmutablestr;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
/*
|
||||
* 'parse_options()' - Parse uri options.
|
||||
@@ -1357,7 +1298,7 @@ static void *read_thread(void *reference)
|
||||
*/
|
||||
start = mach_absolute_time();
|
||||
|
||||
rbytes = sizeof(readbuffer);
|
||||
rbytes = sizeof(readbuffer) - 1;
|
||||
readstatus = (*classdriver)->ReadPipe( classdriver, readbuffer, &rbytes );
|
||||
if ( kIOReturnSuccess == readstatus && rbytes > 0 ) {
|
||||
|
||||
@@ -1391,6 +1332,7 @@ static void *read_thread(void *reference)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+240
-144
@@ -27,9 +27,8 @@
|
||||
*
|
||||
* 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...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -44,7 +43,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
int open_device(const char *uri, int *use_bc);
|
||||
int open_device(const char *uri);
|
||||
|
||||
|
||||
/*
|
||||
@@ -56,16 +55,29 @@ print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
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;
|
||||
@@ -78,17 +90,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
do
|
||||
{
|
||||
/*
|
||||
* Disable backchannel data when printing to 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, "Canon") &&
|
||||
strcasecmp(hostname, "Konica Minolta") &&
|
||||
strcasecmp(hostname, "Minolta");
|
||||
|
||||
if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
if ((fd = open_device(uri)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
@@ -116,8 +118,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
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)
|
||||
{
|
||||
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
@@ -130,7 +131,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
}
|
||||
}
|
||||
while (device_fd < 0);
|
||||
while (fd < 0);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
@@ -138,44 +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);
|
||||
tbytes = 0;
|
||||
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
/*
|
||||
* Write the print data to the printer...
|
||||
*/
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,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)
|
||||
@@ -252,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);
|
||||
|
||||
@@ -289,12 +425,8 @@ list_devices(void)
|
||||
*/
|
||||
|
||||
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 */
|
||||
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
|
||||
@@ -303,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))
|
||||
{
|
||||
/*
|
||||
@@ -319,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
|
||||
{
|
||||
@@ -414,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))
|
||||
{
|
||||
/*
|
||||
@@ -430,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 */
|
||||
@@ -446,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
|
||||
{
|
||||
/*
|
||||
@@ -464,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...
|
||||
@@ -507,15 +611,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
return (-1);
|
||||
}
|
||||
#else
|
||||
{
|
||||
if ((fd = open(uri + 4, O_RDWR | O_EXCL)) < 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
|
||||
{
|
||||
|
||||
+10
-11
@@ -63,7 +63,7 @@
|
||||
void list_devices(void);
|
||||
int print_device(const char *uri, const char *hostname,
|
||||
const char *resource, const char *options,
|
||||
int print_fd, int copies, int argc, char *argv[]);
|
||||
int fp, int copies, int argc, char *argv[]);
|
||||
|
||||
|
||||
/*
|
||||
@@ -108,7 +108,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
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 */
|
||||
@@ -124,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;
|
||||
@@ -146,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) */
|
||||
@@ -232,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
|
||||
{
|
||||
@@ -241,7 +241,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)
|
||||
{
|
||||
fprintf(stderr, "ERROR: unable to open print file %s - %s\n",
|
||||
argv[6], strerror(errno));
|
||||
@@ -255,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);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,13 @@
|
||||
|
||||
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/transcode.h ../cups/debug.h ../cups/string.h
|
||||
lpc.o: ../config.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/transcode.h
|
||||
lpq.o: ../cups/debug.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 ../cups/transcode.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/transcode.h ../cups/string.h ../config.h
|
||||
lprm.o: ../cups/i18n.h ../cups/string.h ../config.h
|
||||
|
||||
+67
-20
@@ -65,8 +65,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
*params; /* Pointer to parameters */
|
||||
|
||||
|
||||
_cupsSetLocale(argv);
|
||||
|
||||
/*
|
||||
* Connect to the scheduler...
|
||||
*/
|
||||
@@ -237,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 */
|
||||
@@ -249,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"
|
||||
};
|
||||
|
||||
|
||||
@@ -326,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;
|
||||
}
|
||||
@@ -392,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;
|
||||
@@ -419,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...
|
||||
*/
|
||||
|
||||
+3
-2
@@ -76,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...
|
||||
@@ -91,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] == '+')
|
||||
|
||||
+2
-2
@@ -87,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;
|
||||
@@ -103,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] == '-')
|
||||
|
||||
+13
-24
@@ -55,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...
|
||||
*/
|
||||
@@ -73,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...
|
||||
@@ -81,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...
|
||||
*/
|
||||
@@ -101,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"),
|
||||
@@ -152,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
|
||||
@@ -169,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 :
|
||||
@@ -273,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...
|
||||
*/
|
||||
|
||||
|
||||
+11
-13
@@ -3,49 +3,47 @@
|
||||
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/transcode.h ../cups/string.h ../config.h
|
||||
help-index.o: ../cups/dir.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/transcode.h ../cups/string.h ../config.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/transcode.h ../cups/string.h ../config.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/transcode.h ../cups/string.h ../config.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/transcode.h ../cups/string.h ../config.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/transcode.h ../cups/string.h ../config.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/transcode.h ../cups/string.h ../config.h
|
||||
admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/file.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/transcode.h ../cups/string.h ../config.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/transcode.h ../cups/string.h ../config.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/transcode.h ../cups/string.h ../config.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/transcode.h ../cups/string.h ../config.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
|
||||
|
||||
+54
-138
@@ -93,8 +93,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (!http)
|
||||
{
|
||||
perror("ERROR: Unable to connect to cupsd");
|
||||
fprintf(stderr, "DEBUG: cupsServer()=\"%s\"\n",
|
||||
cupsServer() ? cupsServer() : "(null)");
|
||||
fprintf(stderr, "DEBUG: cupsServer()=\"%s\"\n", cupsServer());
|
||||
fprintf(stderr, "DEBUG: ippPort()=%d\n", ippPort());
|
||||
fprintf(stderr, "DEBUG: cupsEncryption()=%d\n", cupsEncryption());
|
||||
exit(1);
|
||||
@@ -482,7 +481,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
|
||||
char refresh[1024]; /* Refresh URL */
|
||||
|
||||
cgiFormEncode(uri, name, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "5;URL=/admin/?OP=redirect&URL=/classes/%s",
|
||||
snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=/classes/%s",
|
||||
uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
|
||||
@@ -507,7 +506,9 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
int modify) /* I - Modify the printer? */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
int element; /* Element number */
|
||||
ipp_attribute_t *attr, /* Current attribute */
|
||||
*last; /* Last attribute */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response, /* IPP response */
|
||||
*oldinfo; /* Old printer information */
|
||||
@@ -535,9 +536,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
};
|
||||
|
||||
|
||||
ptr = cgiGetVariable("DEVICE_URI");
|
||||
fprintf(stderr, "DEBUG: do_am_printer: DEVICE_URI=\"%s\"\n",
|
||||
ptr ? ptr : "(null)");
|
||||
cgiGetVariable("DEVICE_URI"));
|
||||
|
||||
title = cgiText(modify ? _("Modify Printer") : _("Add Printer"));
|
||||
|
||||
@@ -855,31 +855,27 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
* Got the list of PPDs, see if the user has selected a make...
|
||||
*/
|
||||
|
||||
if (cgiSetIPPVars(response, NULL, NULL, NULL, 0) == 0)
|
||||
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
|
||||
|
||||
if (var == NULL)
|
||||
{
|
||||
/*
|
||||
* No PPD files with this make, try again with all makes...
|
||||
* Let the user choose a make...
|
||||
*/
|
||||
|
||||
ippDelete(response);
|
||||
for (element = 0, attr = response->attrs, last = NULL;
|
||||
attr != NULL;
|
||||
attr = attr->next)
|
||||
if (attr->name && strcmp(attr->name, "ppd-make") == 0)
|
||||
if (last == NULL ||
|
||||
strcasecmp(last->values[0].string.text,
|
||||
attr->values[0].string.text) != 0)
|
||||
{
|
||||
cgiSetArray("PPD_MAKE", element, attr->values[0].string.text);
|
||||
element ++;
|
||||
last = attr;
|
||||
}
|
||||
|
||||
request = ippNewRequest(CUPS_GET_PPDS);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, "ipp://localhost/printers/");
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", NULL, "ppd-make");
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
|
||||
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("choose-make.tmpl");
|
||||
cgiEndHTML();
|
||||
}
|
||||
else if (!var)
|
||||
{
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("choose-make.tmpl");
|
||||
cgiEndHTML();
|
||||
@@ -935,6 +931,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
cgiEndHTML();
|
||||
}
|
||||
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
else
|
||||
@@ -1043,7 +1040,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
"5;/admin/?OP=redirect&URL=/printers/%s", uri);
|
||||
else
|
||||
snprintf(refresh, sizeof(refresh),
|
||||
"5;URL=/admin/?OP=set-printer-options&PRINTER_NAME=%s", uri);
|
||||
"5;/admin/?OP=set-printer-options&PRINTER_NAME=%s", uri);
|
||||
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
|
||||
@@ -1185,7 +1182,7 @@ do_config_printer(http_t *http) /* I - HTTP connection */
|
||||
|
||||
ppdLocalize(ppd);
|
||||
|
||||
cgiStartHTML(cgiText(_("Set Printer Options")));
|
||||
cgiStartHTML("Set Printer Options");
|
||||
cgiCopyTemplateLang("set-printer-options-header.tmpl");
|
||||
|
||||
if (ppdConflicts(ppd))
|
||||
@@ -1454,7 +1451,7 @@ do_config_printer(http_t *http) /* I - HTTP connection */
|
||||
if (!in || !out)
|
||||
{
|
||||
cgiSetVariable("ERROR", strerror(errno));
|
||||
cgiStartHTML(cgiText(_("Set Printer Options")));
|
||||
cgiStartHTML("Set Printer Options");
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
|
||||
@@ -1491,9 +1488,7 @@ do_config_printer(http_t *http) /* I - HTTP connection */
|
||||
|
||||
*keyptr = '\0';
|
||||
|
||||
if (!strcmp(keyword, "PageRegion") ||
|
||||
!strcmp(keyword, "PaperDimension") ||
|
||||
!strcmp(keyword, "ImageableArea"))
|
||||
if (!strcmp(keyword, "PageRegion"))
|
||||
var = cgiGetVariable("PageSize");
|
||||
else
|
||||
var = cgiGetVariable(keyword);
|
||||
@@ -1565,7 +1560,7 @@ do_config_printer(http_t *http) /* I - HTTP connection */
|
||||
|
||||
cgiFormEncode(uri, printer, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh),
|
||||
"5;URL=/admin/?OP=redirect&URL=/printers/%s", uri);
|
||||
"5;/admin/?OP=redirect&URL=/printers/%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
|
||||
cgiStartHTML(title);
|
||||
@@ -1597,97 +1592,39 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
|
||||
int num_settings; /* Number of server settings */
|
||||
cups_option_t *settings; /* Server settings */
|
||||
const char *debug_logging, /* DEBUG_LOGGING value */
|
||||
*remote_admin, /* REMOTE_ADMIN value */
|
||||
*remote_printers,
|
||||
/* REMOTE_PRINTERS value */
|
||||
*share_printers,/* SHARE_PRINTERS value */
|
||||
*user_cancel_any;
|
||||
/* USER_CANCEL_ANY value */
|
||||
|
||||
|
||||
/*
|
||||
* Get the checkbox values from the form...
|
||||
*/
|
||||
num_settings = 0;
|
||||
num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
|
||||
cgiGetVariable("DEBUG_LOGGING") ? "1" : "0",
|
||||
num_settings, &settings);
|
||||
num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
|
||||
cgiGetVariable("REMOTE_ADMIN") ? "1" : "0",
|
||||
num_settings, &settings);
|
||||
num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
|
||||
cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0",
|
||||
num_settings, &settings);
|
||||
num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
|
||||
cgiGetVariable("SHARE_PRINTERS") ? "1" : "0",
|
||||
num_settings, &settings);
|
||||
num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
|
||||
cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0",
|
||||
num_settings, &settings);
|
||||
|
||||
debug_logging = cgiGetVariable("DEBUG_LOGGING") ? "1" : "0";
|
||||
remote_admin = cgiGetVariable("REMOTE_ADMIN") ? "1" : "0";
|
||||
remote_printers = cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0";
|
||||
share_printers = cgiGetVariable("SHARE_PRINTERS") ? "1" : "0";
|
||||
user_cancel_any = cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0";
|
||||
|
||||
/*
|
||||
* Get the current server settings...
|
||||
*/
|
||||
|
||||
if (!_cupsAdminGetServerSettings(http, &num_settings, &settings))
|
||||
if (!_cupsAdminSetServerSettings(http, num_settings, settings))
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Change Settings")));
|
||||
cgiSetVariable("MESSAGE",
|
||||
cgiText(_("Unable to change server settings:")));
|
||||
cgiSetVariable("ERROR", cupsLastErrorString());
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the settings have changed...
|
||||
*/
|
||||
|
||||
if (strcmp(debug_logging, cupsGetOption(CUPS_SERVER_DEBUG_LOGGING,
|
||||
num_settings, settings)) ||
|
||||
strcmp(remote_admin, cupsGetOption(CUPS_SERVER_REMOTE_ADMIN,
|
||||
num_settings, settings)) ||
|
||||
strcmp(remote_printers, cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS,
|
||||
num_settings, settings)) ||
|
||||
strcmp(share_printers, cupsGetOption(CUPS_SERVER_SHARE_PRINTERS,
|
||||
num_settings, settings)) ||
|
||||
strcmp(user_cancel_any, cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY,
|
||||
num_settings, settings)))
|
||||
{
|
||||
/*
|
||||
* Settings *have* changed, so save the changes...
|
||||
*/
|
||||
|
||||
cupsFreeOptions(num_settings, settings);
|
||||
|
||||
num_settings = 0;
|
||||
num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
|
||||
debug_logging, num_settings, &settings);
|
||||
num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
|
||||
remote_admin, num_settings, &settings);
|
||||
num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
|
||||
remote_printers, num_settings, &settings);
|
||||
num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
|
||||
share_printers, num_settings, &settings);
|
||||
num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
|
||||
user_cancel_any, num_settings, &settings);
|
||||
|
||||
if (!_cupsAdminSetServerSettings(http, num_settings, settings))
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Change Settings")));
|
||||
cgiSetVariable("MESSAGE",
|
||||
cgiText(_("Unable to change server settings:")));
|
||||
cgiSetVariable("ERROR", cupsLastErrorString());
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
}
|
||||
else
|
||||
{
|
||||
cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
|
||||
cgiStartHTML(cgiText(_("Change Settings")));
|
||||
cgiCopyTemplateLang("restart.tmpl");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* No changes...
|
||||
*/
|
||||
|
||||
cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
|
||||
cgiSetVariable("refresh_page", "5;/admin/?OP=redirect");
|
||||
cgiStartHTML(cgiText(_("Change Settings")));
|
||||
cgiCopyTemplateLang("norestart.tmpl");
|
||||
cgiCopyTemplateLang("restart.tmpl");
|
||||
}
|
||||
|
||||
cupsFreeOptions(num_settings, settings);
|
||||
@@ -1779,7 +1716,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
}
|
||||
else
|
||||
{
|
||||
cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
|
||||
cgiSetVariable("refresh_page", "5;/admin/?OP=redirect");
|
||||
|
||||
cgiStartHTML(cgiText(_("Edit Configuration File")));
|
||||
cgiCopyTemplateLang("restart.tmpl");
|
||||
@@ -1877,7 +1814,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
* Show the current config file...
|
||||
*/
|
||||
|
||||
cgiStartHTML(cgiText(_("Edit Configuration File")));
|
||||
cgiStartHTML("Edit Configuration File");
|
||||
|
||||
printf("<!-- \"%s\" -->\n", filename);
|
||||
|
||||
@@ -1900,13 +1837,10 @@ do_delete_class(http_t *http) /* I - HTTP connection */
|
||||
const char *pclass; /* Printer class name */
|
||||
|
||||
|
||||
/*
|
||||
* Get form variables...
|
||||
*/
|
||||
cgiStartHTML(cgiText(_("Delete Class")));
|
||||
|
||||
if (cgiGetVariable("CONFIRM") == NULL)
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Delete Class")));
|
||||
cgiCopyTemplateLang("class-confirm.tmpl");
|
||||
cgiEndHTML();
|
||||
return;
|
||||
@@ -1917,7 +1851,6 @@ do_delete_class(http_t *http) /* I - HTTP connection */
|
||||
"localhost", 0, "/classes/%s", pclass);
|
||||
else
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Delete Class")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
@@ -1944,12 +1877,6 @@ do_delete_class(http_t *http) /* I - HTTP connection */
|
||||
|
||||
ippDelete(cupsDoRequest(http, request, "/admin/"));
|
||||
|
||||
/*
|
||||
* Show the results...
|
||||
*/
|
||||
|
||||
cgiStartHTML(cgiText(_("Delete Class")));
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
cgiShowIPPError(_("Unable to delete class:"));
|
||||
else
|
||||
@@ -1971,13 +1898,10 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
|
||||
const char *printer; /* Printer printer name */
|
||||
|
||||
|
||||
/*
|
||||
* Get form variables...
|
||||
*/
|
||||
cgiStartHTML(cgiText(_("Delete Printer")));
|
||||
|
||||
if (cgiGetVariable("CONFIRM") == NULL)
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Delete Printer")));
|
||||
cgiCopyTemplateLang("printer-confirm.tmpl");
|
||||
cgiEndHTML();
|
||||
return;
|
||||
@@ -1988,7 +1912,6 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
|
||||
"localhost", 0, "/printers/%s", printer);
|
||||
else
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Delete Printer")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
@@ -2015,12 +1938,6 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
|
||||
|
||||
ippDelete(cupsDoRequest(http, request, "/admin/"));
|
||||
|
||||
/*
|
||||
* Show the results...
|
||||
*/
|
||||
|
||||
cgiStartHTML(cgiText(_("Delete Printer")));
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
cgiShowIPPError(_("Unable to delete printer:"));
|
||||
else
|
||||
@@ -2540,7 +2457,7 @@ do_printer_op(http_t *http, /* I - HTTP connection */
|
||||
|
||||
cgiRewriteURL(uri, url, sizeof(url), NULL);
|
||||
cgiFormEncode(uri, url, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "5;URL=/admin/?OP=redirect&URL=%s", uri);
|
||||
snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
|
||||
cgiStartHTML(title);
|
||||
@@ -2798,8 +2715,7 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */
|
||||
|
||||
cgiRewriteURL(uri, url, sizeof(url), NULL);
|
||||
cgiFormEncode(uri, url, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "5;URL=/admin/?OP=redirect&URL=%s",
|
||||
uri);
|
||||
snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
|
||||
cgiStartHTML(cgiText(_("Set Allowed Users")));
|
||||
@@ -2889,7 +2805,7 @@ do_set_sharing(http_t *http) /* I - HTTP connection */
|
||||
|
||||
cgiRewriteURL(uri, url, sizeof(url), NULL);
|
||||
cgiFormEncode(uri, url, sizeof(uri));
|
||||
snprintf(refresh, sizeof(refresh), "5;URL=/admin/?OP=redirect&URL=%s", uri);
|
||||
snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri);
|
||||
cgiSetVariable("refresh_page", refresh);
|
||||
|
||||
cgiStartHTML(cgiText(_("Set Publishing")));
|
||||
|
||||
+6
-6
@@ -95,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...
|
||||
@@ -186,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 */
|
||||
@@ -220,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");
|
||||
|
||||
@@ -419,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -842,7 +842,7 @@ help_load_file(
|
||||
if (isspace(*ptr & 255))
|
||||
{
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
*ptr ++;
|
||||
|
||||
*text++ = ' ';
|
||||
}
|
||||
|
||||
+1
-2
@@ -187,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)
|
||||
{
|
||||
|
||||
+1
-2
@@ -175,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);
|
||||
}
|
||||
|
||||
+7
-10
@@ -110,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 == '\\')
|
||||
@@ -483,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);
|
||||
}
|
||||
|
||||
@@ -599,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);
|
||||
}
|
||||
|
||||
@@ -775,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...
|
||||
@@ -914,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,
|
||||
@@ -978,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...
|
||||
@@ -1038,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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -98,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...
|
||||
@@ -286,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);
|
||||
}
|
||||
|
||||
@@ -330,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...
|
||||
@@ -356,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");
|
||||
|
||||
@@ -543,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
|
||||
@@ -594,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);
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Search routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -225,8 +225,6 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
*sptr++ = *qptr++;
|
||||
}
|
||||
|
||||
*sptr = '\0';
|
||||
|
||||
/*
|
||||
* For "word1 AND word2", add reciprocal "word2 AND word1"...
|
||||
*/
|
||||
|
||||
+4
-36
@@ -44,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);
|
||||
|
||||
|
||||
/*
|
||||
@@ -60,7 +59,7 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
|
||||
tmpl ? tmpl : "(null)");
|
||||
tmpl);
|
||||
|
||||
/*
|
||||
* Open the template file...
|
||||
@@ -69,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;
|
||||
}
|
||||
|
||||
@@ -102,8 +101,7 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
FILE *in; /* Input file */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n",
|
||||
tmpl ? tmpl : "(null)");
|
||||
fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n", tmpl);
|
||||
|
||||
/*
|
||||
* Convert the language to a locale name...
|
||||
@@ -237,7 +235,6 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
char outval[1024], /* Formatted output string */
|
||||
compare[1024]; /* Comparison string */
|
||||
int result; /* Result of comparison */
|
||||
int uriencode; /* Encode as URI */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: %*sStarting at file position %ld...\n", indent, "",
|
||||
@@ -256,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))
|
||||
@@ -406,12 +399,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
*/
|
||||
|
||||
if (out)
|
||||
{
|
||||
if (uriencode)
|
||||
cgi_puturi(outptr, out);
|
||||
else
|
||||
cgi_puts(outptr, out);
|
||||
}
|
||||
cgi_puts(outptr, out);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -649,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$".
|
||||
*/
|
||||
|
||||
+1
-2
@@ -949,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
|
||||
|
||||
+2
-1
@@ -74,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); \
|
||||
|
||||
@@ -33,7 +33,6 @@ DefaultAuthType Basic
|
||||
|
||||
# Restrict access to the admin pages...
|
||||
<Location /admin>
|
||||
@ENCRYPTION_REQUIRED@
|
||||
Order allow,deny
|
||||
Allow localhost
|
||||
</Location>
|
||||
|
||||
+5
-4
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: mime.convs 5402 2006-04-14 19:21:03Z mike $"
|
||||
# "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $"
|
||||
#
|
||||
# MIME converts file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
@@ -107,12 +107,13 @@ image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#application/octet-stream application/vnd.cups-raw 0 -
|
||||
|
||||
#
|
||||
# End of "$Id: mime.convs 5402 2006-04-14 19:21:03Z mike $".
|
||||
# End of "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $".
|
||||
#
|
||||
|
||||
+8
-8
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: mime.types 6003 2006-10-02 16:26:04Z mike $"
|
||||
# "$Id: mime.types 5375 2006-04-06 20:10:55Z mike $"
|
||||
#
|
||||
# MIME types file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
@@ -147,25 +147,25 @@ text/css css
|
||||
|
||||
application/vnd.cups-command string(0,'#CUPS-COMMAND')
|
||||
application/vnd.cups-form string(0,"<CUPSFORM>")
|
||||
application/vnd.cups-pdf
|
||||
application/vnd.cups-postscript
|
||||
application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
|
||||
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
|
||||
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
string(0,<1B>@) \
|
||||
(contains(0,128,<1B>%-12345X) + \
|
||||
(contains(0,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 6003 2006-10-02 16:26:04Z mike $".
|
||||
# End of "$Id: mime.types 5375 2006-04-06 20:10:55Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl 32/64-bit library support stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
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,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 6145 2006-12-06 20:10:16Z 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
|
||||
@@ -28,9 +28,12 @@ AC_PREREQ(2.50)
|
||||
dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.2.8"
|
||||
dnl Versio number information...
|
||||
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
|
||||
|
||||
AC_SUBST(CUPS_VERSION)
|
||||
AC_SUBST(CUPS_REVISION)
|
||||
@@ -129,7 +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(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
|
||||
|
||||
dnl Checks for string functions.
|
||||
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
|
||||
@@ -229,13 +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`"
|
||||
DBUSDIR="/etc/dbus-1/system.d"
|
||||
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
|
||||
@@ -264,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 6145 2006-12-06 20:10:16Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 5354 2006-03-29 20:55:15Z mike $".
|
||||
dnl
|
||||
|
||||
+145
-113
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 6145 2006-12-06 20:10:16Z 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
|
||||
@@ -24,50 +24,62 @@ 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=""
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
|
||||
AC_SUBST(ARCHFLAGS)
|
||||
|
||||
dnl Setup support for separate 32/64-bit library generation...
|
||||
AC_ARG_WITH(arch32flags, [ --with-arch32flags="flags"
|
||||
specifies 32-bit architecture flags])
|
||||
ARCH32FLAGS=""
|
||||
AC_SUBST(ARCH32FLAGS)
|
||||
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 and *BSD...
|
||||
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fPIE option, default=no])
|
||||
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fpie option, default=no])
|
||||
|
||||
dnl Update compiler options...
|
||||
CXXLIBS=""
|
||||
AC_SUBST(CXXLIBS)
|
||||
|
||||
PIEFLAGS=""
|
||||
AC_SUBST(PIEFLAGS)
|
||||
|
||||
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
|
||||
@@ -84,13 +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_pie = xyes; then
|
||||
echo "Sorry, --enable-pie is not supported on this OS!"
|
||||
OPTIM="$OPTIM -fpie"
|
||||
LDFLAGS="$LDFLAGS -pie"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -103,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
|
||||
;;
|
||||
|
||||
@@ -147,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
|
||||
@@ -154,6 +141,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -164,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
|
||||
@@ -171,6 +165,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@@ -183,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
|
||||
@@ -190,6 +194,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -200,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
|
||||
@@ -207,6 +221,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@@ -219,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
|
||||
@@ -226,6 +247,8 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -236,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
|
||||
@@ -243,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
|
||||
@@ -273,6 +302,10 @@ 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
|
||||
@@ -297,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
|
||||
@@ -304,6 +342,8 @@ else
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -314,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
|
||||
@@ -321,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
|
||||
;;
|
||||
@@ -338,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
|
||||
@@ -352,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
|
||||
@@ -415,25 +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"
|
||||
;;
|
||||
|
||||
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 6145 2006-12-06 20:10:16Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 5288 2006-03-14 02:38:07Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 6234 2007-02-05 20:25:50Z mike $"
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for the Common UNIX Printing System
|
||||
dnl (CUPS).
|
||||
dnl
|
||||
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 Easy Software Products and are protected by Federal
|
||||
@@ -24,15 +24,13 @@ dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl Default langugages...
|
||||
AC_ARG_WITH(languages, [ --with-languages set installed languages, default="de es et fr it ja pl sv" ],
|
||||
if test "x$withval" != xno; then
|
||||
LANGUAGES="$withval"
|
||||
fi,
|
||||
LANGUAGES="de es et fr it ja pl sv")
|
||||
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"
|
||||
@@ -43,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)
|
||||
@@ -61,7 +59,7 @@ fi
|
||||
AC_SUBST(CUPS_BROWSING)
|
||||
|
||||
dnl Default BrowseLocalProtocols
|
||||
AC_ARG_WITH(local_protocols, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
|
||||
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)
|
||||
@@ -69,7 +67,7 @@ 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"],
|
||||
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)
|
||||
@@ -132,7 +130,7 @@ fi
|
||||
AC_SUBST(CUPS_USE_NETWORK_DEFAULT)
|
||||
|
||||
dnl Determine the correct username and group for this OS...
|
||||
AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
|
||||
CUPS_USER="$withval",
|
||||
AC_MSG_CHECKING(for default print user)
|
||||
if test -f /etc/passwd; then
|
||||
@@ -154,7 +152,7 @@ AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
AC_MSG_RESULT(no password file, using "$CUPS_USER")
|
||||
fi)
|
||||
|
||||
AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
|
||||
CUPS_GROUP="$withval",
|
||||
AC_MSG_CHECKING(for default print group)
|
||||
if test -f /etc/group; then
|
||||
@@ -177,7 +175,7 @@ AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
|
||||
fi)
|
||||
|
||||
AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
|
||||
AC_ARG_WITH(system-groups, [ --with-system-groups set default system groups for CUPS],
|
||||
CUPS_SYSTEM_GROUPS="$withval",
|
||||
if test x$uname = xDarwin; then
|
||||
GROUP_LIST="admin"
|
||||
@@ -221,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
|
||||
@@ -252,5 +236,5 @@ fi
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 6234 2007-02-05 20:25:50Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z 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
|
||||
@@ -57,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
|
||||
@@ -73,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...
|
||||
@@ -126,7 +115,7 @@ AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$w
|
||||
|
||||
if test x$rcdir = x; then
|
||||
case "$uname" in
|
||||
FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
|
||||
FreeBSD* | OpenBSD*)
|
||||
# FreeBSD and OpenBSD
|
||||
INITDIR=""
|
||||
INITDDIR=""
|
||||
@@ -141,11 +130,9 @@ if test x$rcdir = x; then
|
||||
Darwin*)
|
||||
# Darwin and MacOS X...
|
||||
INITDIR=""
|
||||
if test -x /sbin/launchd; then
|
||||
INITDDIR="/System/Library/LaunchDaemons"
|
||||
else
|
||||
INITDDIR="/System/Library/StartupItems/PrintingServices"
|
||||
fi
|
||||
AC_CHECK_PROG(INITDDIR, launchd,
|
||||
"/System/Library/LaunchDaemons",
|
||||
"/System/Library/StartupItems/PrintingServices")
|
||||
;;
|
||||
|
||||
Linux | GNU)
|
||||
@@ -193,15 +180,12 @@ AC_SUBST(INITDDIR)
|
||||
|
||||
dnl Xinetd support...
|
||||
XINETD=""
|
||||
|
||||
if test ! -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
|
||||
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)
|
||||
|
||||
@@ -211,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
|
||||
@@ -316,5 +300,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
|
||||
AC_SUBST(CUPS_STATEDIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $".
|
||||
dnl End of "$Id: cups-directories.m4 5314 2006-03-20 19:06:50Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-image.m4 5580 2006-05-23 19:30:23Z 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
|
||||
@@ -38,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])
|
||||
@@ -53,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,
|
||||
@@ -71,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,
|
||||
@@ -114,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 5580 2006-05-23 19:30:23Z mike $".
|
||||
dnl End of "$Id: cups-image.m4 5311 2006-03-19 13:21:42Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-launchd.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl launchd stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -49,5 +49,5 @@ AC_SUBST(DEFAULT_LAUNCHD_CONF)
|
||||
AC_SUBST(LAUNCHDLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-launchd.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ldap.m4 5564 2006-05-22 00:59:11Z mike $"
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl LDAP configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -36,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"))
|
||||
@@ -46,5 +46,5 @@ AC_SUBST(LIBLDAP)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ldap.m4 5564 2006-05-22 00:59:11Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-libtool.m4 5466 2006-04-26 19:52:27Z 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
|
||||
@@ -45,5 +45,5 @@ if test x$LIBTOOL != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-libtool.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl End of "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-manpages.m4 5799 2006-08-03 00:54:38Z 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 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 Easy Software Products and are protected by Federal
|
||||
@@ -23,12 +23,6 @@ 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*)
|
||||
@@ -109,5 +103,5 @@ AC_SUBST(MAN8EXT)
|
||||
AC_SUBST(MAN8DIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-manpages.m4 5799 2006-08-03 00:54:38Z mike $".
|
||||
dnl End of "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 6049 2006-10-20 15:07:21Z 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
|
||||
@@ -24,17 +24,12 @@ 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))
|
||||
|
||||
@@ -51,7 +46,7 @@ else
|
||||
maxfiles=4096
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler (deprecated) ],
|
||||
AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler ],
|
||||
maxfiles=$withval)
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_MAX_FDS, $maxfiles)
|
||||
@@ -90,5 +85,5 @@ AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
|
||||
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-network.m4 6049 2006-10-20 15:07:21Z mike $".
|
||||
dnl End of "$Id: cups-network.m4 4873 2005-12-07 01:46:54Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6145 2006-12-06 20:10:16Z 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
|
||||
@@ -22,10 +22,9 @@ 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/*)
|
||||
@@ -40,5 +39,5 @@ case "$uname" in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6145 2006-12-06 20:10:16Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z mike $"
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z 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
|
||||
@@ -94,5 +94,5 @@ AC_SUBST(PAMLIBS)
|
||||
AC_SUBST(PAMMOD)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl End of "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,37 +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 2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
# 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,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pdf.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl PDF filter configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -39,5 +39,5 @@ fi
|
||||
AC_SUBST(PDFTOPS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pdf.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-scripting.m4 5466 2006-04-26 19:52:27Z 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
|
||||
@@ -100,5 +100,5 @@ if test "x$CUPS_PYTHON" != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-scripting.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl End of "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-sharedlibs.m4 6145 2006-12-06 20:10:16Z 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
|
||||
@@ -33,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"
|
||||
@@ -81,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
|
||||
@@ -91,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)
|
||||
|
||||
@@ -127,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)
|
||||
@@ -192,5 +152,5 @@ AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-sharedlibs.m4 6145 2006-12-06 20:10:16Z mike $".
|
||||
dnl End of "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-slp.m4 5466 2006-04-26 19:52:27Z 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
|
||||
@@ -44,5 +44,5 @@ AC_SUBST(LIBSLP)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-slp.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl End of "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 6238 2007-02-06 16:04:25Z 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 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 Easy Software Products and are protected by Federal
|
||||
@@ -36,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...
|
||||
@@ -105,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)
|
||||
@@ -119,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 6238 2007-02-06 16:04:25Z mike $".
|
||||
dnl End of "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-threads.m4 6061 2006-10-23 00:26:52Z mike $"
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl Threading stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -44,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
|
||||
@@ -59,5 +53,5 @@ fi
|
||||
AC_SUBST(PTHREAD_FLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-threads.m4 6061 2006-10-23 00:26:52Z mike $".
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
|
||||
+1
-40
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Configuration file for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -147,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>?
|
||||
*/
|
||||
@@ -267,23 +260,6 @@
|
||||
#undef HAVE_SSL
|
||||
|
||||
|
||||
/*
|
||||
* What Security framework headers do we have?
|
||||
*/
|
||||
|
||||
#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?
|
||||
*/
|
||||
@@ -430,13 +406,6 @@
|
||||
#undef HAVE_CFBUNDLEPRIV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have CFLocaleCreateCanonicalLocaleIdentifierFromString()?
|
||||
*/
|
||||
|
||||
#undef HAVE_CF_LOCALE_ID
|
||||
|
||||
|
||||
/*
|
||||
* Do we have MacOSX 10.4's mbr_XXX functions()?
|
||||
*/
|
||||
@@ -458,14 +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
|
||||
|
||||
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
+2
-27
@@ -29,7 +29,6 @@ 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)
|
||||
@@ -44,42 +43,18 @@ sinclude(config-scripts/cups-threads.m4)
|
||||
sinclude(config-scripts/cups-largefile.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/edit-config.tmpl.in; then
|
||||
LANGFILES="$LANGFILES templates/$lang/edit-config.tmpl"
|
||||
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/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/edit-config.tmpl templates/header.tmpl
|
||||
$LANGFILES)
|
||||
templates/es/header.tmpl templates/ja/header.tmpl)
|
||||
|
||||
chmod +x cups-config
|
||||
|
||||
|
||||
+9
-25
@@ -31,8 +31,6 @@ exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
includedir=@includedir@
|
||||
libdir=@libdir@
|
||||
imagelibdir=@libdir@
|
||||
datarootdir=@datadir@
|
||||
datadir=@datadir@
|
||||
sysconfdir=@sysconfdir@
|
||||
cups_datadir=@CUPS_DATADIR@
|
||||
@@ -43,30 +41,16 @@ INSTALLSTATIC=@INSTALLSTATIC@
|
||||
# flags for C++ compiler:
|
||||
CFLAGS=""
|
||||
LDFLAGS="@EXPORT_LDFLAGS@"
|
||||
LIBS="@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 ()
|
||||
{
|
||||
@@ -116,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
|
||||
;;
|
||||
|
||||
+114
-162
@@ -1,294 +1,246 @@
|
||||
# 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 http-private.h
|
||||
adminutil.o: ipp-private.h i18n.h transcode.h debug.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 http-private.h http.h md5.h
|
||||
auth.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.o: transcode.h debug.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 http-private.h http.h md5.h
|
||||
custom.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.o: transcode.h debug.h
|
||||
dest.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.o: transcode.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 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
|
||||
getifaddrs.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.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 debug.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 http-private.h http.h md5.h
|
||||
http-addr.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
http-addr.o: i18n.h transcode.h debug.h
|
||||
http-addr.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
|
||||
http-addr.o: array.h file.h language.h i18n.h 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 http-private.h http.h
|
||||
http-support.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.o: language.h i18n.h transcode.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 http-private.h http.h md5.h
|
||||
ipp-support.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.o: i18n.h transcode.h debug.h
|
||||
langprintf.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.o: i18n.h transcode.h
|
||||
language.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.o: transcode.h debug.h
|
||||
localize.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.o: transcode.h debug.h
|
||||
ipp-support.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
|
||||
ipp-support.o: array.h file.h language.h i18n.h 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 http-private.h http.h md5.h
|
||||
notify.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.o: transcode.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 http-private.h http.h md5.h
|
||||
ppd.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.o: transcode.h debug.h
|
||||
request.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.o: transcode.h debug.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: array.h debug.h string.h ../config.h
|
||||
tempfile.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.o: transcode.h debug.h
|
||||
transcode.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.o: i18n.h transcode.h debug.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 debug.h
|
||||
util.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.o: transcode.h debug.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-private.h ipp.h http.h
|
||||
testipp.o: md5.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 http-private.h
|
||||
adminutil.32.o: adminutil.c ipp-private.h i18n.h transcode.h debug.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 http-private.h http.h md5.h
|
||||
auth.32.o: auth.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.32.o: auth.c transcode.h debug.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 http-private.h http.h md5.h
|
||||
custom.32.o: custom.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.32.o: custom.c transcode.h debug.h
|
||||
dest.32.o: dest.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.32.o: dest.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.32.o: dest.c transcode.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 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
|
||||
getifaddrs.32.o: getifaddrs.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.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 debug.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 http-private.h http.h md5.h
|
||||
http-addr.32.o: http-addr.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
http-addr.32.o: http-addr.c i18n.h transcode.h debug.h
|
||||
http-addr.32.o: http-addr.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
|
||||
http-addr.32.o: http-addr.c array.h file.h language.h i18n.h 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 http-private.h http.h
|
||||
http-support.32.o: http-support.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.32.o: http-support.c language.h i18n.h transcode.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 http-private.h http.h md5.h
|
||||
ipp-support.32.o: ipp-support.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.32.o: ipp-support.c i18n.h transcode.h debug.h
|
||||
langprintf.32.o: langprintf.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.32.o: langprintf.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.32.o: langprintf.c i18n.h transcode.h
|
||||
language.32.o: language.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.32.o: language.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.32.o: language.c transcode.h debug.h
|
||||
localize.32.o: localize.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.32.o: localize.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.32.o: localize.c transcode.h debug.h
|
||||
ipp-support.32.o: ipp-support.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
|
||||
ipp-support.32.o: ipp-support.c array.h file.h language.h i18n.h 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 http-private.h http.h md5.h
|
||||
notify.32.o: notify.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.32.o: notify.c transcode.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 http-private.h http.h md5.h
|
||||
ppd.32.o: ppd.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.32.o: ppd.c transcode.h debug.h
|
||||
request.32.o: request.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.32.o: request.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.32.o: request.c transcode.h debug.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 array.h debug.h string.h ../config.h
|
||||
tempfile.32.o: tempfile.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.32.o: tempfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.32.o: tempfile.c transcode.h debug.h
|
||||
transcode.32.o: transcode.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.32.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.32.o: transcode.c i18n.h transcode.h debug.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 debug.h
|
||||
util.32.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.32.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.32.o: util.c transcode.h debug.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-private.h ipp.h http.h
|
||||
testipp.32.o: testipp.c md5.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 http-private.h
|
||||
adminutil.64.o: adminutil.c ipp-private.h i18n.h transcode.h debug.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 http-private.h http.h md5.h
|
||||
auth.64.o: auth.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.64.o: auth.c transcode.h debug.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 http-private.h http.h md5.h
|
||||
custom.64.o: custom.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.64.o: custom.c transcode.h debug.h
|
||||
dest.64.o: dest.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.64.o: dest.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.64.o: dest.c transcode.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 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
|
||||
getifaddrs.64.o: getifaddrs.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.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 debug.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 http-private.h http.h md5.h
|
||||
http-addr.64.o: http-addr.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
http-addr.64.o: http-addr.c i18n.h transcode.h debug.h
|
||||
http-addr.64.o: http-addr.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
|
||||
http-addr.64.o: http-addr.c array.h file.h language.h i18n.h 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 http-private.h http.h
|
||||
http-support.64.o: http-support.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.64.o: http-support.c language.h i18n.h transcode.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 http-private.h http.h md5.h
|
||||
ipp-support.64.o: ipp-support.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.64.o: ipp-support.c i18n.h transcode.h debug.h
|
||||
langprintf.64.o: langprintf.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.64.o: langprintf.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.64.o: langprintf.c i18n.h transcode.h
|
||||
language.64.o: language.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.64.o: language.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.64.o: language.c transcode.h debug.h
|
||||
localize.64.o: localize.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.64.o: localize.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.64.o: localize.c transcode.h debug.h
|
||||
ipp-support.64.o: ipp-support.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
|
||||
ipp-support.64.o: ipp-support.c array.h file.h language.h i18n.h 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 http-private.h http.h md5.h
|
||||
notify.64.o: notify.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.64.o: notify.c transcode.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 http-private.h http.h md5.h
|
||||
ppd.64.o: ppd.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.64.o: ppd.c transcode.h debug.h
|
||||
request.64.o: request.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.64.o: request.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.64.o: request.c transcode.h debug.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 array.h debug.h string.h ../config.h
|
||||
tempfile.64.o: tempfile.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.64.o: tempfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.64.o: tempfile.c transcode.h debug.h
|
||||
transcode.64.o: transcode.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.64.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.64.o: transcode.c i18n.h transcode.h debug.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 debug.h
|
||||
util.64.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.64.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.64.o: util.c transcode.h debug.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-private.h ipp.h http.h
|
||||
testipp.64.o: testipp.c md5.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
|
||||
|
||||
+13
-22
@@ -43,7 +43,6 @@ LIBOBJS = \
|
||||
emit.o \
|
||||
encode.o \
|
||||
file.o \
|
||||
getifaddrs.o \
|
||||
getputfile.o \
|
||||
globals.o \
|
||||
http.o \
|
||||
@@ -93,7 +92,6 @@ OBJS = \
|
||||
HEADERS = \
|
||||
adminutil.h \
|
||||
array.h \
|
||||
backend.h \
|
||||
cups.h \
|
||||
dir.h \
|
||||
file.h \
|
||||
@@ -138,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
|
||||
|
||||
|
||||
#
|
||||
@@ -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
|
||||
|
||||
|
||||
#
|
||||
@@ -237,27 +234,21 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS)
|
||||
|
||||
|
||||
#
|
||||
# 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) $(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) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) 64bit/libcups.so
|
||||
$(LN) libcups.so.2 64bit/libcups.so
|
||||
$(DSO) $(ARCH64FLAGS) $(DSOFLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -279,7 +270,7 @@ libcups.2.dylib: $(LIBOBJS)
|
||||
# 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) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
|
||||
$(RM) $@
|
||||
@@ -430,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 \
|
||||
|
||||
+89
-290
@@ -7,7 +7,7 @@
|
||||
* MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO
|
||||
* CHANGE AT ANY TIME. USE AT YOUR OWN RISK.
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -48,12 +48,9 @@
|
||||
#include "debug.h"
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef WIN32
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <sys/wait.h>
|
||||
#endif /* WIN32 */
|
||||
#include <sys/wait.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -106,7 +103,7 @@ cupsAdminCreateWindowsPPD(
|
||||
linenum; /* Current line number */
|
||||
time_t curtime; /* Current time */
|
||||
struct tm *curdate; /* Current date */
|
||||
static const char * const pattrs[] = /* Printer attributes we want */
|
||||
static const char *pattrs[] = /* Printer attributes we want */
|
||||
{
|
||||
"job-hold-until-supported",
|
||||
"job-hold-until-default",
|
||||
@@ -225,18 +222,18 @@ cupsAdminCreateWindowsPPD(
|
||||
*/
|
||||
|
||||
cupsFilePrintf(dstfp, "*%% Commented out for CUPS Windows Driver...\n"
|
||||
"*%%%s\n", line + 1);
|
||||
"*%%%s", line + 1);
|
||||
continue;
|
||||
}
|
||||
else if (!strncmp(line, "*JCLOpenUI", 10))
|
||||
{
|
||||
jcloption = 1;
|
||||
cupsFilePrintf(dstfp, "%s\n", line);
|
||||
cupsFilePuts(dstfp, line);
|
||||
}
|
||||
else if (!strncmp(line, "*JCLCloseUI", 11))
|
||||
{
|
||||
jcloption = 0;
|
||||
cupsFilePrintf(dstfp, "%s\n", line);
|
||||
cupsFilePuts(dstfp, line);
|
||||
}
|
||||
else if (jcloption &&
|
||||
strncmp(line, "*End", 4) &&
|
||||
@@ -246,7 +243,7 @@ cupsAdminCreateWindowsPPD(
|
||||
if ((ptr = strchr(line, ':')) == NULL)
|
||||
{
|
||||
snprintf(line, sizeof(line),
|
||||
_cupsLangString(language, _("Missing value on line %d!")),
|
||||
_cupsLangString(language, _("Missing value on line %d!\n")),
|
||||
linenum);
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line);
|
||||
|
||||
@@ -265,7 +262,7 @@ cupsAdminCreateWindowsPPD(
|
||||
{
|
||||
snprintf(line, sizeof(line),
|
||||
_cupsLangString(language,
|
||||
_("Missing double quote on line %d!")),
|
||||
_("Missing double quote on line %d!\n")),
|
||||
linenum);
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line);
|
||||
|
||||
@@ -284,7 +281,7 @@ cupsAdminCreateWindowsPPD(
|
||||
{
|
||||
snprintf(line, sizeof(line),
|
||||
_cupsLangString(language,
|
||||
_("Bad option + choice on line %d!")),
|
||||
_("Bad option + choice on line %d!\n")),
|
||||
linenum);
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line);
|
||||
|
||||
@@ -315,33 +312,17 @@ cupsAdminCreateWindowsPPD(
|
||||
}
|
||||
|
||||
snprintf(ptr + 1, sizeof(line) - (ptr - line + 1),
|
||||
"%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
|
||||
"%%cupsJobTicket: %s=%s\n\"\n*End\n", option, choice);
|
||||
|
||||
cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
|
||||
line);
|
||||
cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s", line);
|
||||
}
|
||||
else
|
||||
cupsFilePrintf(dstfp, "%s\n", line);
|
||||
cupsFilePuts(dstfp, line);
|
||||
}
|
||||
|
||||
cupsFileClose(srcfp);
|
||||
unlink(src);
|
||||
|
||||
if (linenum == 0)
|
||||
{
|
||||
snprintf(line, sizeof(line),
|
||||
_cupsLangString(language, _("Empty PPD file!")),
|
||||
linenum);
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line);
|
||||
|
||||
cupsFileClose(dstfp);
|
||||
unlink(buffer);
|
||||
|
||||
*buffer = '\0';
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now add the CUPS-specific attributes and options...
|
||||
*/
|
||||
@@ -674,7 +655,7 @@ cupsAdminExportSamba(
|
||||
{
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to set Windows printer driver (%d)!")),
|
||||
_("Unable to set Windows printer driver (%d)!\n")),
|
||||
status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message);
|
||||
@@ -790,31 +771,19 @@ _cupsAdminGetServerSettings(
|
||||
if (!value)
|
||||
continue;
|
||||
|
||||
if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen"))
|
||||
if (!strcasecmp(line, "Port"))
|
||||
{
|
||||
remote_access = 1;
|
||||
}
|
||||
else if (!strcasecmp(line, "Listen"))
|
||||
{
|
||||
char *port; /* Pointer to port number, if any */
|
||||
|
||||
|
||||
if ((port = strrchr(value, ':')) != NULL)
|
||||
*port = '\0';
|
||||
else if (isdigit(*value & 255))
|
||||
{
|
||||
/*
|
||||
* Listen on a port number implies remote access...
|
||||
*/
|
||||
|
||||
remote_access = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1")
|
||||
#ifdef AF_LOCAL
|
||||
&& *value != '/'
|
||||
#endif /* AF_LOCAL */
|
||||
#ifdef AF_INET6
|
||||
&& strcmp(value, "::1")
|
||||
#endif /* AF_INET6 */
|
||||
)
|
||||
if (strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1"))
|
||||
remote_access = 1;
|
||||
}
|
||||
else if (!strcasecmp(line, "Browsing"))
|
||||
@@ -890,14 +859,7 @@ _cupsAdminGetServerSettings(
|
||||
in_location = 0;
|
||||
}
|
||||
else if (!strcasecmp(line, "Allow") && in_admin_location &&
|
||||
strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1")
|
||||
#ifdef AF_LOCAL
|
||||
&& *value != '/'
|
||||
#endif /* AF_LOCAL */
|
||||
#ifdef AF_INET6
|
||||
&& strcmp(value, "::1")
|
||||
#endif /* AF_INET6 */
|
||||
)
|
||||
strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1"))
|
||||
{
|
||||
remote_admin = 1;
|
||||
}
|
||||
@@ -971,8 +933,6 @@ _cupsAdminSetServerSettings(
|
||||
{
|
||||
int i; /* Looping var */
|
||||
http_status_t status; /* GET/PUT status */
|
||||
const char *server_port_env; /* SERVER_PORT env var */
|
||||
int server_port; /* IPP port for server */
|
||||
cups_file_t *cupsd; /* cupsd.conf file */
|
||||
char cupsdconf[1024]; /* cupsd.conf filename */
|
||||
int remote; /* Remote cupsd.conf file? */
|
||||
@@ -1003,11 +963,6 @@ _cupsAdminSetServerSettings(
|
||||
wrote_root_location; /* Wrote the / location? */
|
||||
int indent; /* Indentation */
|
||||
int cupsd_num_settings; /* New number of settings */
|
||||
int old_remote_printers, /* Show remote printers */
|
||||
old_share_printers, /* Share local printers */
|
||||
old_remote_admin, /* Remote administration allowed? */
|
||||
old_user_cancel_any, /* Cancel-job policy set? */
|
||||
old_debug_logging; /* LogLevel debug set? */
|
||||
cups_option_t *cupsd_settings, /* New settings */
|
||||
*setting; /* Current setting */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
|
||||
@@ -1040,134 +995,39 @@ _cupsAdminSetServerSettings(
|
||||
else
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Get current settings...
|
||||
*/
|
||||
|
||||
if (!_cupsAdminGetServerSettings(http, &cupsd_num_settings,
|
||||
&cupsd_settings))
|
||||
return (0);
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
old_debug_logging = atoi(val);
|
||||
else
|
||||
old_debug_logging = 0;
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
old_remote_admin = atoi(val);
|
||||
else
|
||||
old_remote_admin = 0;
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
old_remote_printers = atoi(val);
|
||||
else
|
||||
old_remote_printers = 1;
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
old_share_printers = atoi(val);
|
||||
else
|
||||
old_share_printers = 0;
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
old_user_cancel_any = atoi(val);
|
||||
else
|
||||
old_user_cancel_any = 0;
|
||||
|
||||
cupsFreeOptions(cupsd_num_settings, cupsd_settings);
|
||||
|
||||
/*
|
||||
* Get basic settings...
|
||||
*/
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
debug_logging = atoi(val);
|
||||
|
||||
if (debug_logging == old_debug_logging)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
*/
|
||||
|
||||
debug_logging = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
debug_logging = -1;
|
||||
debug_logging = 0;
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
remote_admin = atoi(val);
|
||||
|
||||
if (remote_admin == old_remote_admin)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
*/
|
||||
|
||||
remote_admin = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
remote_admin = -1;
|
||||
remote_admin = 0;
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
remote_printers = atoi(val);
|
||||
|
||||
if (remote_printers == old_remote_printers)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
*/
|
||||
|
||||
remote_printers = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
remote_printers = -1;
|
||||
remote_printers = 1;
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
share_printers = atoi(val);
|
||||
|
||||
if (share_printers == old_share_printers)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
*/
|
||||
|
||||
share_printers = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
share_printers = -1;
|
||||
share_printers = 0;
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
user_cancel_any = atoi(val);
|
||||
|
||||
if (user_cancel_any == old_user_cancel_any)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
*/
|
||||
|
||||
user_cancel_any = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
user_cancel_any = -1;
|
||||
user_cancel_any = 0;
|
||||
|
||||
/*
|
||||
* Create a temporary file for the new cupsd.conf file...
|
||||
@@ -1206,68 +1066,48 @@ _cupsAdminSetServerSettings(
|
||||
wrote_root_location = 0;
|
||||
indent = 0;
|
||||
|
||||
if ((server_port_env = getenv("SERVER_PORT")) != NULL)
|
||||
{
|
||||
if ((server_port = atoi(server_port_env)) <= 0)
|
||||
server_port = ippPort();
|
||||
}
|
||||
else
|
||||
server_port = ippPort();
|
||||
|
||||
if (server_port <= 0)
|
||||
server_port = IPP_PORT;
|
||||
|
||||
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) &&
|
||||
(share_printers >= 0 || remote_admin >= 0))
|
||||
if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen"))
|
||||
{
|
||||
if (!wrote_port_listen)
|
||||
{
|
||||
wrote_port_listen = 1;
|
||||
|
||||
if (share_printers > 0 || remote_admin > 0)
|
||||
if (share_printers || remote_admin)
|
||||
{
|
||||
cupsFilePuts(temp, "# Allow remote access\n");
|
||||
cupsFilePrintf(temp, "Port %d\n", server_port);
|
||||
cupsFilePrintf(temp, "Port %d\n", ippPort());
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsFilePuts(temp, "# Only listen for connections from the local "
|
||||
"machine.\n");
|
||||
cupsFilePrintf(temp, "Listen localhost:%d\n", server_port);
|
||||
cupsFilePrintf(temp, "Listen 127.0.0.1:%d\n", ippPort());
|
||||
}
|
||||
|
||||
#ifdef CUPS_DEFAULT_DOMAINSOCKET
|
||||
if ((!value || strcmp(CUPS_DEFAULT_DOMAINSOCKET, value)) &&
|
||||
!access(CUPS_DEFAULT_DOMAINSOCKET, 0))
|
||||
if (!access(CUPS_DEFAULT_DOMAINSOCKET, 0))
|
||||
cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n");
|
||||
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
}
|
||||
else if (value && value[0] == '/'
|
||||
#ifdef CUPS_DEFAULT_DOMAINSOCKET
|
||||
&& strcmp(CUPS_DEFAULT_DOMAINSOCKET, value)
|
||||
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
)
|
||||
cupsFilePrintf(temp, "Listen %s\n", value);
|
||||
}
|
||||
else if ((!strcasecmp(line, "Browsing") ||
|
||||
!strcasecmp(line, "BrowseAddress") ||
|
||||
!strcasecmp(line, "BrowseAllow") ||
|
||||
!strcasecmp(line, "BrowseDeny") ||
|
||||
!strcasecmp(line, "BrowseOrder")) &&
|
||||
(remote_printers >= 0 || share_printers >= 0))
|
||||
else if (!strcasecmp(line, "Browsing") ||
|
||||
!strcasecmp(line, "BrowseAddress") ||
|
||||
!strcasecmp(line, "BrowseAllow") ||
|
||||
!strcasecmp(line, "BrowseDeny") ||
|
||||
!strcasecmp(line, "BrowseOrder"))
|
||||
{
|
||||
if (!wrote_browsing)
|
||||
{
|
||||
wrote_browsing = 1;
|
||||
|
||||
if (remote_printers > 0 || share_printers > 0)
|
||||
if (remote_printers || share_printers)
|
||||
{
|
||||
if (remote_printers > 0 && share_printers > 0)
|
||||
if (remote_printers && share_printers)
|
||||
cupsFilePuts(temp,
|
||||
"# Enable printer sharing and shared printers.\n");
|
||||
else if (remote_printers > 0)
|
||||
else if (remote_printers)
|
||||
cupsFilePuts(temp,
|
||||
"# Show shared printers on the local network.\n");
|
||||
else
|
||||
@@ -1277,10 +1117,10 @@ _cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "Browsing On\n");
|
||||
cupsFilePuts(temp, "BrowseOrder allow,deny\n");
|
||||
|
||||
if (remote_printers > 0)
|
||||
if (remote_printers)
|
||||
cupsFilePuts(temp, "BrowseAllow @LOCAL\n");
|
||||
|
||||
if (share_printers > 0)
|
||||
if (share_printers)
|
||||
cupsFilePuts(temp, "BrowseAddress @LOCAL\n");
|
||||
}
|
||||
else
|
||||
@@ -1291,7 +1131,7 @@ _cupsAdminSetServerSettings(
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(line, "LogLevel") && debug_logging >= 0)
|
||||
else if (!strcasecmp(line, "LogLevel"))
|
||||
{
|
||||
wrote_loglevel = 1;
|
||||
|
||||
@@ -1354,13 +1194,13 @@ _cupsAdminSetServerSettings(
|
||||
{
|
||||
in_location = 0;
|
||||
indent -= 2;
|
||||
if (in_admin_location && remote_admin >= 0)
|
||||
if (in_admin_location)
|
||||
{
|
||||
wrote_admin_location = 1;
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePuts(temp, " # Allow remote administration...\n");
|
||||
else if (remote_admin == 0)
|
||||
else
|
||||
cupsFilePuts(temp, " # Restrict access to the admin pages...\n");
|
||||
|
||||
cupsFilePuts(temp, " Order allow,deny\n");
|
||||
@@ -1370,7 +1210,7 @@ _cupsAdminSetServerSettings(
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
}
|
||||
else if (in_conf_location && remote_admin >= 0)
|
||||
else if (in_conf_location)
|
||||
{
|
||||
wrote_conf_location = 1;
|
||||
|
||||
@@ -1388,23 +1228,23 @@ _cupsAdminSetServerSettings(
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
}
|
||||
else if (in_root_location && (remote_admin >= 0 || share_printers >= 0))
|
||||
else if (in_root_location)
|
||||
{
|
||||
wrote_root_location = 1;
|
||||
|
||||
if (remote_admin > 0 && share_printers > 0)
|
||||
if (remote_admin && share_printers)
|
||||
cupsFilePuts(temp, " # Allow shared printing and remote "
|
||||
"administration...\n");
|
||||
else if (remote_admin > 0)
|
||||
else if (remote_admin)
|
||||
cupsFilePuts(temp, " # Allow remote administration...\n");
|
||||
else if (share_printers > 0)
|
||||
else if (share_printers)
|
||||
cupsFilePuts(temp, " # Allow shared printing...\n");
|
||||
else
|
||||
cupsFilePuts(temp, " # Restrict access to the server...\n");
|
||||
|
||||
cupsFilePuts(temp, " Order allow,deny\n");
|
||||
|
||||
if (remote_admin > 0 || share_printers > 0)
|
||||
if (remote_admin || share_printers)
|
||||
cupsFilePuts(temp, " Allow @LOCAL\n");
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
@@ -1427,7 +1267,7 @@ _cupsAdminSetServerSettings(
|
||||
|
||||
indent += 2;
|
||||
|
||||
if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
|
||||
if (!strcasecmp(value, "cancel-job"))
|
||||
{
|
||||
/*
|
||||
* Don't write anything for this limit section...
|
||||
@@ -1446,7 +1286,7 @@ _cupsAdminSetServerSettings(
|
||||
if (*valptr)
|
||||
*valptr++ = '\0';
|
||||
|
||||
if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
|
||||
if (!strcasecmp(value, "cancel-job"))
|
||||
{
|
||||
/*
|
||||
* Write everything except for this definition...
|
||||
@@ -1482,9 +1322,7 @@ _cupsAdminSetServerSettings(
|
||||
|
||||
in_cancel_job = 0;
|
||||
}
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location) &&
|
||||
remote_admin >= 0) ||
|
||||
(in_root_location && share_printers >= 0)) &&
|
||||
else if ((in_admin_location || in_conf_location || in_root_location) &&
|
||||
(!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") ||
|
||||
!strcasecmp(line, "Order")))
|
||||
continue;
|
||||
@@ -1549,13 +1387,13 @@ _cupsAdminSetServerSettings(
|
||||
* Write any missing info...
|
||||
*/
|
||||
|
||||
if (!wrote_browsing && (remote_printers >= 0 || share_printers >= 0))
|
||||
if (!wrote_browsing)
|
||||
{
|
||||
if (remote_printers > 0 || share_printers > 0)
|
||||
if (remote_printers || share_printers)
|
||||
{
|
||||
if (remote_printers > 0 && share_printers > 0)
|
||||
if (remote_printers && share_printers)
|
||||
cupsFilePuts(temp, "# Enable printer sharing and shared printers.\n");
|
||||
else if (remote_printers > 0)
|
||||
else if (remote_printers)
|
||||
cupsFilePuts(temp, "# Show shared printers on the local network.\n");
|
||||
else
|
||||
cupsFilePuts(temp, "# Share local printers on the local network.\n");
|
||||
@@ -1563,10 +1401,10 @@ _cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "Browsing On\n");
|
||||
cupsFilePuts(temp, "BrowseOrder allow,deny\n");
|
||||
|
||||
if (remote_printers > 0)
|
||||
if (remote_printers)
|
||||
cupsFilePuts(temp, "BrowseAllow @LOCAL\n");
|
||||
|
||||
if (share_printers > 0)
|
||||
if (share_printers)
|
||||
cupsFilePuts(temp, "BrowseAddress @LOCAL\n");
|
||||
}
|
||||
else
|
||||
@@ -1576,7 +1414,7 @@ _cupsAdminSetServerSettings(
|
||||
}
|
||||
}
|
||||
|
||||
if (!wrote_loglevel && debug_logging >= 0)
|
||||
if (!wrote_loglevel)
|
||||
{
|
||||
if (debug_logging)
|
||||
{
|
||||
@@ -1590,9 +1428,9 @@ _cupsAdminSetServerSettings(
|
||||
}
|
||||
}
|
||||
|
||||
if (!wrote_port_listen && (share_printers >= 0 || remote_admin >= 0))
|
||||
if (!wrote_port_listen)
|
||||
{
|
||||
if (share_printers > 0 || remote_admin > 0)
|
||||
if (share_printers || remote_admin)
|
||||
{
|
||||
cupsFilePuts(temp, "# Allow remote access\n");
|
||||
cupsFilePrintf(temp, "Port %d\n", ippPort());
|
||||
@@ -1601,7 +1439,7 @@ _cupsAdminSetServerSettings(
|
||||
{
|
||||
cupsFilePuts(temp,
|
||||
"# Only listen for connections from the local machine.\n");
|
||||
cupsFilePrintf(temp, "Listen localhost:%d\n", ippPort());
|
||||
cupsFilePrintf(temp, "Listen 127.0.0.1:%d\n", ippPort());
|
||||
}
|
||||
|
||||
#ifdef CUPS_DEFAULT_DOMAINSOCKET
|
||||
@@ -1610,14 +1448,14 @@ _cupsAdminSetServerSettings(
|
||||
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
}
|
||||
|
||||
if (!wrote_root_location && (remote_admin >= 0 || share_printers >= 0))
|
||||
if (!wrote_root_location)
|
||||
{
|
||||
if (remote_admin > 0 && share_printers > 0)
|
||||
if (remote_admin && share_printers)
|
||||
cupsFilePuts(temp,
|
||||
"# Allow shared printing and remote administration...\n");
|
||||
else if (remote_admin > 0)
|
||||
else if (remote_admin)
|
||||
cupsFilePuts(temp, "# Allow remote administration...\n");
|
||||
else if (share_printers > 0)
|
||||
else if (share_printers)
|
||||
cupsFilePuts(temp, "# Allow shared printing...\n");
|
||||
else
|
||||
cupsFilePuts(temp, "# Restrict access to the server...\n");
|
||||
@@ -1625,7 +1463,7 @@ _cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "<Location />\n"
|
||||
" Order allow,deny\n");
|
||||
|
||||
if (remote_admin > 0 || share_printers > 0)
|
||||
if (remote_admin || share_printers)
|
||||
cupsFilePuts(temp, " Allow @LOCAL\n");
|
||||
else
|
||||
cupsFilePuts(temp, " Allow localhost\n");
|
||||
@@ -1633,7 +1471,7 @@ _cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
|
||||
if (!wrote_admin_location && remote_admin >= 0)
|
||||
if (!wrote_admin_location)
|
||||
{
|
||||
if (remote_admin)
|
||||
cupsFilePuts(temp, "# Allow remote administration...\n");
|
||||
@@ -1651,7 +1489,7 @@ _cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
|
||||
if (!wrote_conf_location && remote_admin >= 0)
|
||||
if (!wrote_conf_location)
|
||||
{
|
||||
if (remote_admin)
|
||||
cupsFilePuts(temp,
|
||||
@@ -1672,7 +1510,7 @@ _cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
|
||||
if (!wrote_policy && user_cancel_any >= 0)
|
||||
if (!wrote_policy)
|
||||
{
|
||||
cupsFilePuts(temp, "<Policy default>\n"
|
||||
" # Job-related operations must be done by the owner "
|
||||
@@ -1751,50 +1589,21 @@ _cupsAdminSetServerSettings(
|
||||
* Updated OK, add the basic settings...
|
||||
*/
|
||||
|
||||
if (debug_logging >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
|
||||
debug_logging ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
else
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
|
||||
old_debug_logging ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
if (remote_admin >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
|
||||
remote_admin ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
else
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
|
||||
old_remote_admin ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
if (remote_printers >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
|
||||
remote_printers ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
else
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
|
||||
old_remote_printers ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
if (share_printers >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
|
||||
share_printers ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
else
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
|
||||
old_share_printers ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
if (user_cancel_any >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
|
||||
user_cancel_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
else
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
|
||||
old_user_cancel_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
|
||||
debug_logging ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
|
||||
remote_admin ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
|
||||
remote_printers ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
|
||||
share_printers ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
|
||||
user_cancel_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
/*
|
||||
* Save the new values...
|
||||
@@ -1835,10 +1644,6 @@ do_samba_command(const char *command, /* I - Command to run */
|
||||
const char *authfile, /* I - Samba authentication file */
|
||||
FILE *logfile) /* I - Optional log file */
|
||||
{
|
||||
#ifdef WIN32
|
||||
return (1); /* Always fail on Windows... */
|
||||
|
||||
#else
|
||||
int status; /* Status of command */
|
||||
int pid; /* Process ID of child */
|
||||
|
||||
@@ -1875,9 +1680,8 @@ do_samba_command(const char *command, /* I - Command to run */
|
||||
{
|
||||
status = -1;
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, _("Unable to run \"%s\": %s\n"),
|
||||
command, strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("cupsaddsmb: Unable to run \"%s\": %s\n"),
|
||||
command, strerror(errno));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1897,7 +1701,6 @@ do_samba_command(const char *command, /* I - Command to run */
|
||||
return (WEXITSTATUS(status));
|
||||
else
|
||||
return (-WTERMSIG(status));
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -1915,9 +1718,7 @@ get_cupsd_conf(
|
||||
int *remote) /* O - Remote file? */
|
||||
{
|
||||
int fd; /* Temporary file descriptor */
|
||||
#ifndef WIN32
|
||||
struct stat info; /* cupsd.conf file information */
|
||||
#endif /* WIN32 */
|
||||
http_status_t status; /* Status of getting cupsd.conf */
|
||||
char host[HTTP_MAX_HOST]; /* Hostname for connection */
|
||||
|
||||
@@ -1934,7 +1735,6 @@ get_cupsd_conf(
|
||||
snprintf(name, namesize, "%s/cupsd.conf", cg->cups_serverroot);
|
||||
*remote = 0;
|
||||
|
||||
#ifndef WIN32
|
||||
if (!strcasecmp(host, "localhost") && !access(name, R_OK))
|
||||
{
|
||||
/*
|
||||
@@ -1961,13 +1761,12 @@ get_cupsd_conf(
|
||||
status = HTTP_OK;
|
||||
}
|
||||
else
|
||||
#endif /* !WIN32 */
|
||||
{
|
||||
/*
|
||||
* Read cupsd.conf via a HTTP GET request...
|
||||
*/
|
||||
|
||||
if ((fd = cupsTempFd(name, namesize)) < 0)
|
||||
if ((fd = cupsTempFd(name, sizeof(name))) < 0)
|
||||
{
|
||||
*name = '\0';
|
||||
|
||||
|
||||
+1
-4
@@ -939,14 +939,11 @@ cups_array_find(cups_array_t *a, /* I - Array */
|
||||
|
||||
DEBUG_puts("cups_array_find: linear search");
|
||||
|
||||
diff = 1;
|
||||
diff = 0;
|
||||
|
||||
for (current = 0; current < a->num_elements; current ++)
|
||||
if (a->elements[current] == e)
|
||||
{
|
||||
diff = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+6
-40
@@ -44,19 +44,14 @@
|
||||
* @since CUPS 1.1.19@
|
||||
*/
|
||||
|
||||
ppd_attr_t * /* O - Attribute or NULL if not found */
|
||||
ppdFindAttr(ppd_file_t *ppd, /* I - PPD file data */
|
||||
const char *name, /* I - Attribute name */
|
||||
const char *spec) /* I - Specifier string or NULL */
|
||||
ppd_attr_t * /* O - Attribute or NULL if not found */
|
||||
ppdFindAttr(ppd_file_t *ppd, /* I - PPD file data */
|
||||
const char *name, /* I - Attribute name */
|
||||
const char *spec) /* I - Specifier string or NULL */
|
||||
{
|
||||
ppd_attr_t key, /* Search key */
|
||||
*attr; /* Current attribute */
|
||||
int diff; /* Current difference */
|
||||
ppd_attr_t key; /* Search key */
|
||||
|
||||
|
||||
DEBUG_printf(("ppdFindAttr(ppd=%p, name=\"%s\", spec=\"%s\")\n", ppd,
|
||||
name ? name : "(null)", spec ? spec : "(null)"));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -77,36 +72,7 @@ ppdFindAttr(ppd_file_t *ppd, /* I - PPD file data */
|
||||
* Return the first matching attribute, if any...
|
||||
*/
|
||||
|
||||
if ((attr = (ppd_attr_t *)cupsArrayFind(ppd->sorted_attrs, &key)) != NULL)
|
||||
return (attr);
|
||||
else if (spec)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
* No match found, loop through the sorted attributes to see if we can
|
||||
* find a "wildcard" match for the attribute...
|
||||
*/
|
||||
|
||||
for (attr = (ppd_attr_t *)cupsArrayFirst(ppd->sorted_attrs);
|
||||
attr;
|
||||
attr = (ppd_attr_t *)cupsArrayNext(ppd->sorted_attrs))
|
||||
{
|
||||
if ((diff = strcasecmp(attr->name, name)) == 0)
|
||||
break;
|
||||
|
||||
if (diff > 0)
|
||||
{
|
||||
/*
|
||||
* All remaining attributes are > than the one we are trying to find...
|
||||
*/
|
||||
|
||||
cupsArrayIndex(ppd->sorted_attrs, cupsArrayCount(ppd->sorted_attrs));
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return (attr);
|
||||
return ((ppd_attr_t *)cupsArrayFind(ppd->sorted_attrs, &key));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-14
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Authentication functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -75,15 +75,12 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
realm[HTTP_MAX_VALUE], /* realm="xyz" string */
|
||||
nonce[HTTP_MAX_VALUE], /* nonce="xyz" string */
|
||||
encode[512]; /* Encoded username:password */
|
||||
_cups_globals_t *cg; /* Global data */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsDoAuthentication(http=%p, method=\"%s\", resource=\"%s\")\n",
|
||||
http, method, resource));
|
||||
DEBUG_printf(("cupsDoAuthentication: digest_tries=%d, userpass=\"%s\"\n",
|
||||
http->digest_tries, http->userpass));
|
||||
DEBUG_printf(("cupsDoAuthentication: WWW-Authenticate=\"%s\"\n",
|
||||
httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE)));
|
||||
|
||||
/*
|
||||
* Clear the current authentication string...
|
||||
@@ -115,15 +112,8 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
* Nope - get a new password from the user...
|
||||
*/
|
||||
|
||||
cg = _cupsGlobals();
|
||||
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
snprintf(prompt, sizeof(prompt),
|
||||
_cupsLangString(cg->lang_default, _("Password for %s on %s? ")),
|
||||
cupsUser(),
|
||||
http->hostname[0] == '/' ? "localhost" : http->hostname);
|
||||
snprintf(prompt, sizeof(prompt), "Password for %s on %s? ", cupsUser(),
|
||||
http->hostname);
|
||||
|
||||
http->digest_tries = strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE],
|
||||
"Digest", 5) != 0;
|
||||
@@ -152,7 +142,7 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
*/
|
||||
|
||||
httpEncode64_2(encode, sizeof(encode), http->userpass,
|
||||
(int)strlen(http->userpass));
|
||||
strlen(http->userpass));
|
||||
snprintf(http->authstring, sizeof(http->authstring), "Basic %s", encode);
|
||||
}
|
||||
else
|
||||
|
||||
+3
-11
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Backchannel functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -95,11 +95,7 @@ cupsBackChannelRead(char *buffer, /* I - Buffer to read */
|
||||
* Read bytes from the pipe...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
return ((ssize_t)read(3, buffer, (unsigned)bytes));
|
||||
#else
|
||||
return (read(3, buffer, bytes));
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -157,11 +153,7 @@ cupsBackChannelWrite(
|
||||
* Write bytes to the pipe...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
count = (ssize_t)write(3, buffer, (unsigned)(bytes - total));
|
||||
#else
|
||||
count = write(3, buffer, bytes - total);
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (count < 0)
|
||||
{
|
||||
@@ -169,7 +161,7 @@ cupsBackChannelWrite(
|
||||
* Write error - abort on fatal errors...
|
||||
*/
|
||||
|
||||
if (errno != EINTR)
|
||||
if (errno != EINTR && errno != EAGAIN)
|
||||
return (-1);
|
||||
}
|
||||
else
|
||||
@@ -183,7 +175,7 @@ cupsBackChannelWrite(
|
||||
}
|
||||
}
|
||||
|
||||
return ((ssize_t)bytes);
|
||||
return (bytes);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-10
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* API definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -31,13 +31,6 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <sys/types.h>
|
||||
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
|
||||
# define __CUPS_SSIZE_T_DEFINED
|
||||
/* Windows does not support the ssize_t type, so map it to off_t... */
|
||||
typedef off_t ssize_t; /* @private@ */
|
||||
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
|
||||
|
||||
# include "ipp.h"
|
||||
# include "ppd.h"
|
||||
# include "language.h"
|
||||
@@ -68,10 +61,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0208
|
||||
# define CUPS_VERSION 1.0200
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 2
|
||||
# define CUPS_VERSION_PATCH 8
|
||||
# define CUPS_VERSION_PATCH 0
|
||||
# define CUPS_DATE_ANY -1
|
||||
|
||||
|
||||
|
||||
@@ -34,10 +34,6 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* ppdFindCustomOption() - Find a custom option.
|
||||
* ppdFindCustomParam() - Find a parameter for a custom option.
|
||||
* ppdFirstCustomParam() - Return the first parameter for a custom option.
|
||||
* ppdNextCustomParam() - Return the next parameter for a custom option.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -50,8 +46,6 @@
|
||||
|
||||
/*
|
||||
* 'ppdFindCustomOption()' - Find a custom option.
|
||||
*
|
||||
* @since CUPS 1.2@
|
||||
*/
|
||||
|
||||
ppd_coption_t * /* O - Custom option or NULL */
|
||||
@@ -71,8 +65,6 @@ ppdFindCustomOption(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
/*
|
||||
* 'ppdFindCustomParam()' - Find a parameter for a custom option.
|
||||
*
|
||||
* @since CUPS 1.2@
|
||||
*/
|
||||
|
||||
ppd_cparam_t * /* O - Custom parameter or NULL */
|
||||
@@ -92,8 +84,6 @@ ppdFindCustomParam(ppd_coption_t *opt, /* I - Custom option */
|
||||
|
||||
/*
|
||||
* 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
|
||||
*
|
||||
* @since CUPS 1.2@
|
||||
*/
|
||||
|
||||
ppd_cparam_t * /* O - Custom parameter or NULL */
|
||||
@@ -108,8 +98,6 @@ ppdFirstCustomParam(ppd_coption_t *opt) /* I - Custom option */
|
||||
|
||||
/*
|
||||
* 'ppdNextCustomParam()' - Return the next parameter for a custom option.
|
||||
*
|
||||
* @since CUPS 1.2@
|
||||
*/
|
||||
|
||||
ppd_cparam_t * /* O - Custom parameter or NULL */
|
||||
|
||||
+23
-100
@@ -4,7 +4,7 @@
|
||||
* User-defined destination (and option) support for the Common UNIX
|
||||
* Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -64,31 +64,21 @@ static int cups_get_sdests(http_t *http, ipp_op_t op, int num_dests,
|
||||
/*
|
||||
* 'cupsAddDest()' - Add a destination to the list of destinations.
|
||||
*
|
||||
* This function cannot be used to add a new class or printer queue,
|
||||
* it only adds a new container of saved options for the named
|
||||
* destination or instance.
|
||||
*
|
||||
* If the named destination already exists, the destination list is
|
||||
* returned unchanged. Adding a new instance of a destination creates
|
||||
* a copy of that destination's options.
|
||||
*
|
||||
* Use the cupsSaveDests() function to save the updated list of
|
||||
* destinations to the user's lpoptions file.
|
||||
* Use the cupsSaveDests() function to save the updated list of destinations
|
||||
* to the user's lpoptions file.
|
||||
*/
|
||||
|
||||
int /* O - New number of destinations */
|
||||
cupsAddDest(const char *name, /* I - Destination name */
|
||||
const char *instance, /* I - Instance name or NULL for none/primary */
|
||||
cupsAddDest(const char *name, /* I - Name of destination */
|
||||
const char *instance, /* I - Instance of destination or NULL for none/primary */
|
||||
int num_dests, /* I - Number of destinations */
|
||||
cups_dest_t **dests) /* IO - Destinations */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
cups_dest_t *dest; /* Destination pointer */
|
||||
cups_dest_t *parent; /* Parent destination */
|
||||
cups_option_t *option; /* Current option */
|
||||
|
||||
|
||||
if (!name || !dests)
|
||||
if (name == NULL || dests == NULL)
|
||||
return (0);
|
||||
|
||||
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
|
||||
@@ -108,53 +98,27 @@ cupsAddDest(const char *name, /* I - Destination name */
|
||||
|
||||
*dests = dest;
|
||||
|
||||
/*
|
||||
* Find where to insert the destination...
|
||||
*/
|
||||
|
||||
for (i = num_dests; i > 0; i --, dest ++)
|
||||
if (strcasecmp(name, dest->name) < 0)
|
||||
break;
|
||||
else if (!instance && dest->instance)
|
||||
break;
|
||||
else if (!strcasecmp(name, dest->name) &&
|
||||
instance && dest->instance &&
|
||||
instance != NULL && dest->instance != NULL &&
|
||||
strcasecmp(instance, dest->instance) < 0)
|
||||
break;
|
||||
|
||||
if (i > 0)
|
||||
memmove(dest + 1, dest, i * sizeof(cups_dest_t));
|
||||
|
||||
/*
|
||||
* Initialize the destination...
|
||||
*/
|
||||
|
||||
dest->name = strdup(name);
|
||||
dest->is_default = 0;
|
||||
dest->num_options = 0;
|
||||
dest->options = (cups_option_t *)0;
|
||||
|
||||
if (!instance)
|
||||
if (instance == NULL)
|
||||
dest->instance = NULL;
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Copy options from the primary instance...
|
||||
*/
|
||||
|
||||
dest->instance = strdup(instance);
|
||||
|
||||
if ((parent = cupsGetDest(name, NULL, num_dests + 1, *dests)) != NULL)
|
||||
{
|
||||
for (i = parent->num_options, option = parent->options;
|
||||
i > 0;
|
||||
i --, option ++)
|
||||
dest->num_options = cupsAddOption(option->name, option->value,
|
||||
dest->num_options,
|
||||
&(dest->options));
|
||||
}
|
||||
}
|
||||
|
||||
return (num_dests + 1);
|
||||
}
|
||||
|
||||
@@ -196,18 +160,18 @@ cupsFreeDests(int num_dests, /* I - Number of destinations */
|
||||
*/
|
||||
|
||||
cups_dest_t * /* O - Destination pointer or NULL */
|
||||
cupsGetDest(const char *name, /* I - Destination name or NULL for the default destination */
|
||||
const char *instance, /* I - Instance name or NULL */
|
||||
cupsGetDest(const char *name, /* I - Name of destination */
|
||||
const char *instance, /* I - Instance of destination */
|
||||
int num_dests, /* I - Number of destinations */
|
||||
cups_dest_t *dests) /* I - Destinations */
|
||||
{
|
||||
int comp; /* Result of comparison */
|
||||
|
||||
|
||||
if (num_dests <= 0 || !dests)
|
||||
if (num_dests == 0 || dests == NULL)
|
||||
return (NULL);
|
||||
|
||||
if (!name)
|
||||
if (name == NULL)
|
||||
{
|
||||
/*
|
||||
* NULL name for default printer.
|
||||
@@ -234,9 +198,9 @@ cupsGetDest(const char *name, /* I - Destination name or NULL for the default
|
||||
return (NULL);
|
||||
else if (comp == 0)
|
||||
{
|
||||
if ((!instance && !dests->instance) ||
|
||||
if ((instance == NULL && dests->instance == NULL) ||
|
||||
(instance != NULL && dests->instance != NULL &&
|
||||
!strcasecmp(instance, dests->instance)))
|
||||
strcasecmp(instance, dests->instance) == 0))
|
||||
return (dests);
|
||||
}
|
||||
|
||||
@@ -256,9 +220,6 @@ cupsGetDest(const char *name, /* I - Destination name or NULL for the default
|
||||
* printer-info, printer-is-accepting-jobs, printer-is-shared,
|
||||
* printer-make-and-model, printer-state, printer-state-change-time,
|
||||
* printer-state-reasons, and printer-type attributes as options.
|
||||
*
|
||||
* Use the cupsFreeDests() function to free the destination list and
|
||||
* the cupsGetDest() function to find a particular destination.
|
||||
*/
|
||||
|
||||
int /* O - Number of destinations */
|
||||
@@ -291,9 +252,6 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
|
||||
* printer-make-and-model, printer-state, printer-state-change-time,
|
||||
* printer-state-reasons, and printer-type attributes as options.
|
||||
*
|
||||
* Use the cupsFreeDests() function to free the destination list and
|
||||
* the cupsGetDest() function to find a particular destination.
|
||||
*
|
||||
* @since CUPS 1.1.21@
|
||||
*/
|
||||
|
||||
@@ -498,11 +456,8 @@ cupsSetDests2(http_t *http, /* I - HTTP connection */
|
||||
int wrote; /* Wrote definition? */
|
||||
cups_dest_t *dest; /* Current destination */
|
||||
cups_option_t *option; /* Current option */
|
||||
_ipp_option_t *match; /* Matching attribute for option */
|
||||
FILE *fp; /* File pointer */
|
||||
#ifndef WIN32
|
||||
const char *home; /* HOME environment variable */
|
||||
#endif /* WIN32 */
|
||||
char filename[1024]; /* lpoptions file */
|
||||
int num_temps; /* Number of temporary destinations */
|
||||
cups_dest_t *temps, /* Temporary destinations */
|
||||
@@ -612,24 +567,17 @@ cupsSetDests2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
for (j = dest->num_options, option = dest->options; j > 0; j --, option ++)
|
||||
{
|
||||
/*
|
||||
* See if this option is a printer attribute; if so, skip it...
|
||||
*/
|
||||
|
||||
if ((match = _ippFindOption(option->name)) != NULL &&
|
||||
match->group_tag == IPP_TAG_PRINTER)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* See if the server/global options match these; if so, don't
|
||||
* write 'em.
|
||||
*/
|
||||
|
||||
if (temp &&
|
||||
(val = cupsGetOption(option->name, temp->num_options,
|
||||
temp->options)) != NULL &&
|
||||
!strcasecmp(val, option->value))
|
||||
continue;
|
||||
if (temp && (val = cupsGetOption(option->name, temp->num_options,
|
||||
temp->options)) != NULL)
|
||||
{
|
||||
if (!strcasecmp(val, option->value))
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Options don't match, write to the file...
|
||||
@@ -645,35 +593,10 @@ cupsSetDests2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (option->value[0])
|
||||
{
|
||||
if (strchr(option->value, ' ') ||
|
||||
strchr(option->value, '\\') ||
|
||||
strchr(option->value, '\"') ||
|
||||
strchr(option->value, '\''))
|
||||
{
|
||||
/*
|
||||
* Quote the value...
|
||||
*/
|
||||
|
||||
fprintf(fp, " %s=\"", option->name);
|
||||
|
||||
for (val = option->value; *val; val ++)
|
||||
{
|
||||
if (strchr("\"\'\\", *val))
|
||||
putc('\\', fp);
|
||||
|
||||
putc(*val, fp);
|
||||
}
|
||||
|
||||
putc('\"', fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Store the literal value...
|
||||
*/
|
||||
|
||||
if (strchr(option->value, ' ') != NULL)
|
||||
fprintf(fp, " %s=\"%s\"", option->name, option->value);
|
||||
else
|
||||
fprintf(fp, " %s=%s", option->name, option->value);
|
||||
}
|
||||
}
|
||||
else
|
||||
fprintf(fp, " %s", option->name);
|
||||
|
||||
+24
-53
@@ -347,12 +347,10 @@ cupsDirOpen(const char *directory) /* I - Directory name */
|
||||
cups_dentry_t * /* O - Directory entry */
|
||||
cupsDirRead(cups_dir_t *dp) /* I - Directory */
|
||||
{
|
||||
struct dirent *entry; /* Pointer to entry */
|
||||
char filename[1024]; /* Full filename */
|
||||
# ifdef HAVE_PTHREAD_H
|
||||
char buffer[sizeof(struct dirent) + 1024];
|
||||
/* Directory entry buffer */
|
||||
# endif /* HAVE_PTHREAD_H */
|
||||
struct dirent *entry; /* Pointer to entry */
|
||||
char filename[1024]; /* Full filename */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsDirRead(dp=%p)\n", dp));
|
||||
@@ -368,13 +366,8 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory */
|
||||
* Try reading an entry that is not "." or ".."...
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
do
|
||||
{
|
||||
# ifdef HAVE_PTHREAD_H
|
||||
/*
|
||||
* Read the next entry using the reentrant version of readdir...
|
||||
*/
|
||||
|
||||
if (readdir_r(dp->dir, (struct dirent *)buffer, &entry))
|
||||
{
|
||||
DEBUG_printf((" readdir_r() failed - %s\n", strerror(errno)));
|
||||
@@ -388,50 +381,28 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory */
|
||||
}
|
||||
|
||||
DEBUG_printf((" readdir_r() returned \"%s\"...\n", entry->d_name));
|
||||
|
||||
# else
|
||||
/*
|
||||
* Read the next entry using the original version of readdir...
|
||||
*/
|
||||
|
||||
if ((entry = readdir(dp->dir)) == NULL)
|
||||
{
|
||||
DEBUG_puts(" readdir() returned a NULL pointer!");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
DEBUG_printf((" readdir() returned \"%s\"...\n", entry->d_name));
|
||||
|
||||
# endif /* HAVE_PTHREAD_H */
|
||||
|
||||
/*
|
||||
* Skip "." and ".."...
|
||||
*/
|
||||
|
||||
if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Copy the name over and get the file information...
|
||||
*/
|
||||
|
||||
strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename));
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name);
|
||||
|
||||
if (stat(filename, &(dp->entry.fileinfo)))
|
||||
{
|
||||
DEBUG_printf((" stat() failed for \"%s\" - %s...\n", filename,
|
||||
strerror(errno)));
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the entry...
|
||||
*/
|
||||
|
||||
return (&(dp->entry));
|
||||
}
|
||||
while (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."));
|
||||
|
||||
/*
|
||||
* Copy the name over and get the file information...
|
||||
*/
|
||||
|
||||
strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename));
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name);
|
||||
if (stat(filename, &(dp->entry.fileinfo)))
|
||||
{
|
||||
DEBUG_printf((" stat() failed for \"%s\" - %s...\n", filename,
|
||||
strerror(errno)));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the entry...
|
||||
*/
|
||||
|
||||
return (&(dp->entry));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-5
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* This set of APIs abstracts enumeration of directory entries.
|
||||
*
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -39,9 +39,9 @@
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
# ifdef _cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
# endif /* _cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
@@ -67,9 +67,9 @@ extern cups_dentry_t *cupsDirRead(cups_dir_t *dp);
|
||||
extern void cupsDirRewind(cups_dir_t *dp);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
# ifdef _cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
# endif /* _cplusplus */
|
||||
#endif /* !_CUPS_DIR_H_ */
|
||||
|
||||
/*
|
||||
|
||||
+5
-34
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* PPD code emission routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -50,7 +50,6 @@
|
||||
#include <stdlib.h>
|
||||
#include "string.h"
|
||||
#include <errno.h>
|
||||
#include "debug.h"
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
@@ -112,9 +111,6 @@ ppdCollect2(ppd_file_t *ppd, /* I - PPD file data */
|
||||
ppd_choice_t **collect; /* Collected choices */
|
||||
|
||||
|
||||
DEBUG_printf(("ppdCollect2(ppd=%p, section=%d, min_order=%f, choices=%p)\n",
|
||||
ppd, section, min_order, choices));
|
||||
|
||||
if (ppd == NULL)
|
||||
return (0);
|
||||
|
||||
@@ -136,8 +132,6 @@ ppdCollect2(ppd_file_t *ppd, /* I - PPD file data */
|
||||
for (k = o->num_choices, c = o->choices; k > 0; k --, c ++)
|
||||
if (c->marked && count < 1000)
|
||||
{
|
||||
DEBUG_printf(("ppdCollect2: %s=%s marked...\n", o->keyword,
|
||||
c->choice));
|
||||
collect[count] = c;
|
||||
count ++;
|
||||
}
|
||||
@@ -148,8 +142,6 @@ ppdCollect2(ppd_file_t *ppd, /* I - PPD file data */
|
||||
for (m = o->num_choices, c = o->choices; m > 0; m --, c ++)
|
||||
if (c->marked && count < 1000)
|
||||
{
|
||||
DEBUG_printf(("ppdCollect2: %s=%s marked...\n", o->keyword,
|
||||
c->choice));
|
||||
collect[count] = c;
|
||||
count ++;
|
||||
}
|
||||
@@ -163,8 +155,6 @@ ppdCollect2(ppd_file_t *ppd, /* I - PPD file data */
|
||||
qsort(collect, count, sizeof(ppd_choice_t *),
|
||||
(int (*)(const void *, const void *))ppd_sort);
|
||||
|
||||
DEBUG_printf(("ppdCollect2: %d marked choices...\n", count));
|
||||
|
||||
/*
|
||||
* Return the array and number of choices; if 0, free the array since
|
||||
* it isn't needed.
|
||||
@@ -291,11 +281,7 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
|
||||
|
||||
while (buflength > 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if ((bytes = (ssize_t)write(fd, bufptr, (unsigned)buflength)) < 0)
|
||||
#else
|
||||
if ((bytes = write(fd, bufptr, buflength)) < 0)
|
||||
#endif /* WIN32 */
|
||||
{
|
||||
if (errno == EAGAIN || errno == EINTR)
|
||||
continue;
|
||||
@@ -395,8 +381,8 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
|
||||
title = ptr + 1;
|
||||
|
||||
/*
|
||||
* Replace double quotes with single quotes and 8-bit characters with
|
||||
* question marks so that the title does not cause a PJL syntax error.
|
||||
* Replace double quotes with single quotes so that the title
|
||||
* does not cause a PJL syntax error.
|
||||
*/
|
||||
|
||||
strlcpy(temp, title, sizeof(temp));
|
||||
@@ -404,8 +390,6 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
|
||||
for (ptr = temp; *ptr; ptr ++)
|
||||
if (*ptr == '\"')
|
||||
*ptr = '\'';
|
||||
else if (*ptr & 128)
|
||||
*ptr = '?';
|
||||
|
||||
/*
|
||||
* Send PJL JOB and PJL RDYMSG commands before we enter PostScript mode...
|
||||
@@ -508,9 +492,6 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
struct lconv *loc; /* Locale data */
|
||||
|
||||
|
||||
DEBUG_printf(("ppdEmitString(ppd=%p, section=%d, min_order=%f)\n",
|
||||
ppd, section, min_order));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -546,8 +527,6 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
!strcasecmp(choices[i]->option->keyword, "PageRegion")) &&
|
||||
!strcasecmp(choices[i]->choice, "Custom"))
|
||||
{
|
||||
DEBUG_puts("ppdEmitString: Custom size set!");
|
||||
|
||||
bufsize += 37; /* %%BeginFeature: *CustomPageSize True\n */
|
||||
bufsize += 50; /* Five 9-digit numbers + newline */
|
||||
}
|
||||
@@ -601,8 +580,6 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* Allocate memory...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("ppdEmitString: Allocating %d bytes for string...\n", bufsize));
|
||||
|
||||
if ((buffer = calloc(1, bufsize)) == NULL)
|
||||
{
|
||||
free(choices);
|
||||
@@ -631,9 +608,6 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* Send DSC comments with option...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("Adding code for %s=%s...\n", choices[i]->option->keyword,
|
||||
choices[i]->choice));
|
||||
|
||||
if ((!strcasecmp(choices[i]->option->keyword, "PageSize") ||
|
||||
!strcasecmp(choices[i]->option->keyword, "PageRegion")) &&
|
||||
!strcasecmp(choices[i]->choice, "Custom"))
|
||||
@@ -729,7 +703,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
else
|
||||
pos = 4;
|
||||
|
||||
values[pos] = (float)orientation;
|
||||
values[pos] = orientation;
|
||||
|
||||
for (pos = 0; pos < 5; pos ++)
|
||||
{
|
||||
@@ -815,7 +789,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
|
||||
if (choices[i]->code && choices[i]->code[0])
|
||||
{
|
||||
j = (int)strlen(choices[i]->code);
|
||||
j = strlen(choices[i]->code);
|
||||
memcpy(bufptr, choices[i]->code, j);
|
||||
bufptr += j;
|
||||
|
||||
@@ -826,9 +800,6 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
strlcpy(bufptr, "%%EndFeature\n"
|
||||
"} stopped cleartomark\n", bufend - bufptr + 1);
|
||||
bufptr += strlen(bufptr);
|
||||
|
||||
DEBUG_printf(("ppdEmitString: Offset in string is %d...\n",
|
||||
bufptr - buffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+25
-35
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Option encoding routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -28,7 +28,6 @@
|
||||
* cupsEncodeOptions() - Encode printer options into IPP attributes.
|
||||
* cupsEncodeOptions2() - Encode printer options into IPP attributes for
|
||||
* a group.
|
||||
* _ippFindOption() - Find the attribute information for an option.
|
||||
* compare_ipp_options() - Compare two IPP options.
|
||||
*/
|
||||
|
||||
@@ -50,6 +49,13 @@
|
||||
* **** THIS LIST MUST BE SORTED ****
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
ipp_tag_t value_tag;
|
||||
ipp_tag_t group_tag;
|
||||
} _ipp_option_t;
|
||||
|
||||
static const _ipp_option_t ipp_options[] =
|
||||
{
|
||||
{ "blackplot", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
@@ -82,7 +88,7 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ "natural-scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "notify-charset", IPP_TAG_CHARSET, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-events", IPP_TAG_KEYWORD, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-lease-duration", IPP_TAG_INTEGER, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-lease-time", IPP_TAG_INTEGER, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-natural-language", IPP_TAG_LANGUAGE, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-pull-method", IPP_TAG_KEYWORD, IPP_TAG_SUBSCRIPTION },
|
||||
{ "notify-recipient", IPP_TAG_URI, IPP_TAG_SUBSCRIPTION },
|
||||
@@ -108,8 +114,6 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ "prettyprint-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB },
|
||||
{ "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ "printer-is-accepting-jobs",IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
@@ -123,10 +127,10 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ "printer-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ "printer-type", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ "printer-uri", IPP_TAG_URI, IPP_TAG_OPERATION },
|
||||
{ "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB },
|
||||
{ "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ "queued-job-count", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ "raw", IPP_TAG_MIMETYPE, IPP_TAG_OPERATION },
|
||||
{ "requesting-user-name-allowed", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ "requesting-user-name-denied", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ "resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB },
|
||||
{ "resolution-default", IPP_TAG_RESOLUTION, IPP_TAG_PRINTER },
|
||||
{ "saturation", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
@@ -237,7 +241,8 @@ cupsEncodeOptions2(
|
||||
|
||||
for (i = num_options, option = options; i > 0; i --, option ++)
|
||||
{
|
||||
_ipp_option_t *match; /* Matching attribute */
|
||||
_ipp_option_t key, /* Search key */
|
||||
*match; /* Matching attribute */
|
||||
|
||||
|
||||
/*
|
||||
@@ -253,7 +258,16 @@ cupsEncodeOptions2(
|
||||
* Figure out the proper value and group tags for this option...
|
||||
*/
|
||||
|
||||
if ((match = _ippFindOption(option->name)) != NULL)
|
||||
key.name = option->name;
|
||||
match = (_ipp_option_t *)bsearch(&key, ipp_options,
|
||||
sizeof(ipp_options) /
|
||||
sizeof(ipp_options[0]),
|
||||
sizeof(ipp_options[0]),
|
||||
(int (*)(const void *,
|
||||
const void *))
|
||||
compare_ipp_options);
|
||||
|
||||
if (match)
|
||||
{
|
||||
if (match->group_tag != group_tag)
|
||||
continue;
|
||||
@@ -265,7 +279,7 @@ cupsEncodeOptions2(
|
||||
int namelen; /* Length of name */
|
||||
|
||||
|
||||
namelen = (int)strlen(option->name);
|
||||
namelen = strlen(option->name);
|
||||
|
||||
if (namelen < 9 || strcmp(option->name + namelen - 8, "-default"))
|
||||
{
|
||||
@@ -500,7 +514,7 @@ cupsEncodeOptions2(
|
||||
* octet-string
|
||||
*/
|
||||
|
||||
attr->values[j].unknown.length = (int)strlen(val);
|
||||
attr->values[j].unknown.length = strlen(val);
|
||||
attr->values[j].unknown.data = _cupsStrAlloc(val);
|
||||
|
||||
DEBUG_printf(("cupsEncodeOptions2: Added octet-string value \"%s\"...\n",
|
||||
@@ -530,30 +544,6 @@ cupsEncodeOptions2(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_ippFindOption()' - Find the attribute information for an option.
|
||||
*/
|
||||
|
||||
_ipp_option_t * /* O - Attribute information */
|
||||
_ippFindOption(const char *name) /* I - Option/attribute name */
|
||||
{
|
||||
_ipp_option_t key; /* Search key */
|
||||
|
||||
|
||||
/*
|
||||
* Lookup the proper value and group tags for this option...
|
||||
*/
|
||||
|
||||
key.name = name;
|
||||
|
||||
return ((_ipp_option_t *)bsearch(&key, ipp_options,
|
||||
sizeof(ipp_options) / sizeof(ipp_options[0]),
|
||||
sizeof(ipp_options[0]),
|
||||
(int (*)(const void *, const void *))
|
||||
compare_ipp_options));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'compare_ipp_options()' - Compare two IPP options.
|
||||
*/
|
||||
|
||||
+26
-72
@@ -8,7 +8,7 @@
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -94,16 +94,6 @@
|
||||
#endif /* !O_LARGEFILE */
|
||||
|
||||
|
||||
/*
|
||||
* Some operating systems don't define O_BINARY, which is used by Microsoft
|
||||
* and IBM to flag binary files...
|
||||
*/
|
||||
|
||||
#ifndef O_BINARY
|
||||
# define O_BINARY 0
|
||||
#endif /* !O_BINARY */
|
||||
|
||||
|
||||
/*
|
||||
* Types and structures...
|
||||
*/
|
||||
@@ -342,11 +332,7 @@ cupsFileFind(const char *filename, /* I - File to find */
|
||||
|
||||
while (*path)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (*path == ';' || (*path == ':' && ((bufptr - buffer) > 1 || !isalpha(buffer[0] & 255))))
|
||||
#else
|
||||
if (*path == ';' || *path == ':')
|
||||
#endif /* WIN32 */
|
||||
{
|
||||
if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
|
||||
*bufptr++ = '/';
|
||||
@@ -358,10 +344,7 @@ cupsFileFind(const char *filename, /* I - File to find */
|
||||
#else
|
||||
if (!access(buffer, executable ? X_OK : 0))
|
||||
#endif /* WIN32 */
|
||||
{
|
||||
DEBUG_printf(("cupsFileFind: Returning \"%s\"\n", buffer));
|
||||
return (buffer);
|
||||
}
|
||||
|
||||
bufptr = buffer;
|
||||
}
|
||||
@@ -381,15 +364,9 @@ cupsFileFind(const char *filename, /* I - File to find */
|
||||
strlcpy(bufptr, filename, bufend - bufptr);
|
||||
|
||||
if (!access(buffer, 0))
|
||||
{
|
||||
DEBUG_printf(("cupsFileFind: Returning \"%s\"\n", buffer));
|
||||
return (buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_puts("cupsFileFind: Returning NULL");
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -400,7 +377,7 @@ cupsFileFind(const char *filename, /* I - File to find */
|
||||
int /* O - 0 on success, -1 on error */
|
||||
cupsFileFlush(cups_file_t *fp) /* I - CUPS file */
|
||||
{
|
||||
ssize_t bytes; /* Bytes to write */
|
||||
size_t bytes; /* Bytes to write */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsFileFlush(fp=%p)\n", fp));
|
||||
@@ -415,7 +392,7 @@ cupsFileFlush(cups_file_t *fp) /* I - CUPS file */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
bytes = (ssize_t)(fp->ptr - fp->buf);
|
||||
bytes = fp->ptr - fp->buf;
|
||||
|
||||
DEBUG_printf((" Flushing %ld bytes...\n", (long)bytes));
|
||||
|
||||
@@ -450,10 +427,7 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
|
||||
*/
|
||||
|
||||
if (!fp || (fp->mode != 'r' && fp->mode != 's'))
|
||||
{
|
||||
DEBUG_puts("cupsFileGetChar: Bad arguments!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the input buffer is empty, try to read more data...
|
||||
@@ -461,17 +435,12 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
|
||||
|
||||
if (fp->ptr >= fp->end)
|
||||
if (cups_fill(fp) < 0)
|
||||
{
|
||||
DEBUG_puts("cupsFileGetChar: Unable to fill buffer!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the next character in the buffer...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cupsFileGetChar: Returning %d...\n", *(fp->ptr) & 255));
|
||||
|
||||
return (*(fp->ptr)++ & 255);
|
||||
}
|
||||
|
||||
@@ -811,15 +780,15 @@ cupsFileOpen(const char *filename, /* I - Name of file */
|
||||
switch (*mode)
|
||||
{
|
||||
case 'a' : /* Append file */
|
||||
fd = open(filename, O_RDWR | O_CREAT | O_APPEND | O_LARGEFILE | O_BINARY, 0666);
|
||||
fd = open(filename, O_RDWR | O_CREAT | O_APPEND | O_LARGEFILE, 0666);
|
||||
break;
|
||||
|
||||
case 'r' : /* Read file */
|
||||
fd = open(filename, O_RDONLY | O_LARGEFILE | O_BINARY, 0);
|
||||
fd = open(filename, O_RDONLY | O_LARGEFILE, 0);
|
||||
break;
|
||||
|
||||
case 'w' : /* Write file */
|
||||
fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT | O_LARGEFILE | O_BINARY, 0666);
|
||||
fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT | O_LARGEFILE, 0666);
|
||||
break;
|
||||
|
||||
case 's' : /* Read/write socket */
|
||||
@@ -1022,7 +991,7 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
|
||||
...) /* I - Additional args as necessary */
|
||||
{
|
||||
va_list ap; /* Argument list */
|
||||
ssize_t bytes; /* Formatted size */
|
||||
size_t bytes; /* Formatted size */
|
||||
char buf[8192]; /* Formatted text */
|
||||
|
||||
|
||||
@@ -1121,7 +1090,7 @@ int /* O - Number of bytes written or -1 */
|
||||
cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
|
||||
const char *s) /* I - String to write */
|
||||
{
|
||||
ssize_t bytes; /* Bytes to write */
|
||||
size_t bytes; /* Bytes to write */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1135,7 +1104,7 @@ cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
|
||||
* Write the string...
|
||||
*/
|
||||
|
||||
bytes = (int)strlen(s);
|
||||
bytes = strlen(s);
|
||||
|
||||
if (fp->mode == 's')
|
||||
{
|
||||
@@ -1180,8 +1149,8 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
char *buf, /* O - Buffer */
|
||||
size_t bytes) /* I - Number of bytes to read */
|
||||
{
|
||||
size_t total; /* Total bytes read */
|
||||
ssize_t count; /* Bytes read */
|
||||
size_t total, /* Total bytes read */
|
||||
count; /* Bytes read */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsFileRead(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
|
||||
@@ -1210,14 +1179,14 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
DEBUG_printf((" cups_fill() returned -1, total=%d\n", total));
|
||||
|
||||
if (total > 0)
|
||||
return ((ssize_t)total);
|
||||
return (total);
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
|
||||
count = (ssize_t)(fp->end - fp->ptr);
|
||||
if (count > (ssize_t)bytes)
|
||||
count = (ssize_t)bytes;
|
||||
count = fp->end - fp->ptr;
|
||||
if (count > bytes)
|
||||
count = bytes;
|
||||
|
||||
memcpy(buf, fp->ptr, count);
|
||||
fp->ptr += count;
|
||||
@@ -1237,7 +1206,7 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
DEBUG_printf((" total=%d\n", total));
|
||||
|
||||
return ((ssize_t)total);
|
||||
return (total);
|
||||
}
|
||||
|
||||
|
||||
@@ -1291,7 +1260,6 @@ cupsFileRewind(cups_file_t *fp) /* I - CUPS file */
|
||||
fp->pos = 0;
|
||||
fp->ptr = NULL;
|
||||
fp->end = NULL;
|
||||
fp->eof = 0;
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -1305,7 +1273,7 @@ off_t /* O - New file position or -1 */
|
||||
cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
|
||||
off_t pos) /* I - Position in file */
|
||||
{
|
||||
ssize_t bytes; /* Number bytes in buffer */
|
||||
size_t bytes; /* Number bytes in buffer */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsFileSeek(fp=%p, pos=" CUPS_LLFMT ")\n", fp, pos));
|
||||
@@ -1359,7 +1327,7 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
|
||||
*/
|
||||
|
||||
if (fp->ptr)
|
||||
bytes = (ssize_t)(fp->end - fp->buf);
|
||||
bytes = fp->end - fp->buf;
|
||||
else
|
||||
bytes = 0;
|
||||
|
||||
@@ -1613,16 +1581,16 @@ cupsFileWrite(cups_file_t *fp, /* I - CUPS file */
|
||||
if (cups_write(fp, buf, bytes) < 0)
|
||||
return (-1);
|
||||
|
||||
fp->pos += (off_t)bytes;
|
||||
fp->pos += bytes;
|
||||
|
||||
return ((ssize_t)bytes);
|
||||
return (bytes);
|
||||
}
|
||||
|
||||
if ((fp->ptr + bytes) > fp->end)
|
||||
if (cupsFileFlush(fp))
|
||||
return (-1);
|
||||
|
||||
fp->pos += (off_t)bytes;
|
||||
fp->pos += bytes;
|
||||
|
||||
if (bytes > sizeof(fp->buf))
|
||||
{
|
||||
@@ -1637,7 +1605,7 @@ cupsFileWrite(cups_file_t *fp, /* I - CUPS file */
|
||||
{
|
||||
memcpy(fp->ptr, buf, bytes);
|
||||
fp->ptr += bytes;
|
||||
return ((ssize_t)bytes);
|
||||
return (bytes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1718,7 +1686,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
*/
|
||||
|
||||
if (fp->ptr && fp->end)
|
||||
fp->pos += (off_t)(fp->end - fp->buf);
|
||||
fp->pos += fp->end - fp->buf;
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
DEBUG_printf((" fp->compressed=%d\n", fp->compressed));
|
||||
@@ -2026,17 +1994,10 @@ cups_read(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (fp->mode == 's')
|
||||
total = (ssize_t)recv(fp->fd, buf, (unsigned)bytes, 0);
|
||||
else
|
||||
total = (ssize_t)read(fp->fd, buf, (unsigned)bytes);
|
||||
#else
|
||||
if (fp->mode == 's')
|
||||
total = recv(fp->fd, buf, bytes, 0);
|
||||
else
|
||||
total = read(fp->fd, buf, bytes);
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (total >= 0)
|
||||
break;
|
||||
@@ -2068,8 +2029,8 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
const char *buf, /* I - Buffer */
|
||||
size_t bytes) /* I - Number bytes */
|
||||
{
|
||||
size_t total; /* Total bytes written */
|
||||
ssize_t count; /* Count this time */
|
||||
size_t total, /* Total bytes written */
|
||||
count; /* Count this time */
|
||||
|
||||
|
||||
DEBUG_printf(("cups_write(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
|
||||
@@ -2082,17 +2043,10 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
total = 0;
|
||||
while (bytes > 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (fp->mode == 's')
|
||||
count = (ssize_t)send(fp->fd, buf, (unsigned)bytes, 0);
|
||||
else
|
||||
count = (ssize_t)write(fp->fd, buf, (unsigned)bytes);
|
||||
#else
|
||||
if (fp->mode == 's')
|
||||
count = send(fp->fd, buf, bytes, 0);
|
||||
else
|
||||
count = write(fp->fd, buf, bytes);
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (count < 0)
|
||||
{
|
||||
@@ -2121,7 +2075,7 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
* Return the total number of bytes written...
|
||||
*/
|
||||
|
||||
return ((ssize_t)total);
|
||||
return (total);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+8
-8
@@ -8,7 +8,7 @@
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -36,20 +36,20 @@
|
||||
*/
|
||||
|
||||
# include <sys/types.h>
|
||||
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
|
||||
# define __CUPS_SSIZE_T_DEFINED
|
||||
|
||||
# ifdef WIN32
|
||||
/* Windows does not support the ssize_t type, so map it to off_t... */
|
||||
typedef off_t ssize_t; /* @private@ */
|
||||
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
|
||||
# endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
# ifdef _cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
# endif /* _cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
@@ -103,9 +103,9 @@ extern int cupsFileUnlock(cups_file_t *fp);
|
||||
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
# ifdef _cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
# endif /* _cplusplus */
|
||||
#endif /* !_CUPS_FILE_H_ */
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,276 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Network interface functions for the Common UNIX Printing System
|
||||
* (CUPS) scheduler.
|
||||
*
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" 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:
|
||||
*
|
||||
* _cups_getifaddrs() - Get a list of network interfaces on the system.
|
||||
* _cups_freeifaddrs() - Free an interface list...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include "http-private.h"
|
||||
|
||||
|
||||
#ifndef HAVE_GETIFADDRS
|
||||
/*
|
||||
* '_cups_getifaddrs()' - Get a list of network interfaces on the system.
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
_cups_getifaddrs(struct ifaddrs **addrs)/* O - List of interfaces */
|
||||
{
|
||||
int sock; /* Socket */
|
||||
char buffer[65536], /* Buffer for address info */
|
||||
*bufptr, /* Pointer into buffer */
|
||||
*bufend; /* End of buffer */
|
||||
struct ifconf conf; /* Interface configurations */
|
||||
struct sockaddr addr; /* Address data */
|
||||
struct ifreq *ifp; /* Interface data */
|
||||
int ifpsize; /* Size of interface data */
|
||||
struct ifaddrs *temp; /* Pointer to current interface */
|
||||
struct ifreq request; /* Interface request */
|
||||
|
||||
|
||||
/*
|
||||
* Start with an empty list...
|
||||
*/
|
||||
|
||||
if (addrs == NULL)
|
||||
return (-1);
|
||||
|
||||
*addrs = NULL;
|
||||
|
||||
/*
|
||||
* Create a UDP socket to get the interface data...
|
||||
*/
|
||||
|
||||
memset (&addr, 0, sizeof(addr));
|
||||
if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Try to get the list of interfaces...
|
||||
*/
|
||||
|
||||
conf.ifc_len = sizeof(buffer);
|
||||
conf.ifc_buf = buffer;
|
||||
|
||||
if (ioctl(sock, SIOCGIFCONF, &conf) < 0)
|
||||
{
|
||||
/*
|
||||
* Couldn't get the list of interfaces...
|
||||
*/
|
||||
|
||||
close(sock);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* OK, got the list of interfaces, now lets step through the
|
||||
* buffer to pull them out...
|
||||
*/
|
||||
|
||||
# ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
|
||||
# define sockaddr_len(a) ((a)->sa_len)
|
||||
# else
|
||||
# define sockaddr_len(a) (sizeof(struct sockaddr))
|
||||
# endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
|
||||
|
||||
for (bufptr = buffer, bufend = buffer + conf.ifc_len;
|
||||
bufptr < bufend;
|
||||
bufptr += ifpsize)
|
||||
{
|
||||
/*
|
||||
* Get the current interface information...
|
||||
*/
|
||||
|
||||
ifp = (struct ifreq *)bufptr;
|
||||
ifpsize = sizeof(ifp->ifr_name) + sockaddr_len(&(ifp->ifr_addr));
|
||||
|
||||
if (ifpsize < sizeof(struct ifreq))
|
||||
ifpsize = sizeof(struct ifreq);
|
||||
|
||||
memset(&request, 0, sizeof(request));
|
||||
memcpy(request.ifr_name, ifp->ifr_name, sizeof(ifp->ifr_name));
|
||||
|
||||
/*
|
||||
* Check the status of the interface...
|
||||
*/
|
||||
|
||||
if (ioctl(sock, SIOCGIFFLAGS, &request) < 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Allocate memory for a single interface record...
|
||||
*/
|
||||
|
||||
if ((temp = calloc(1, sizeof(struct ifaddrs))) == NULL)
|
||||
{
|
||||
/*
|
||||
* Unable to allocate memory...
|
||||
*/
|
||||
|
||||
close(sock);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add this record to the front of the list and copy the name, flags,
|
||||
* and network address...
|
||||
*/
|
||||
|
||||
temp->ifa_next = *addrs;
|
||||
*addrs = temp;
|
||||
temp->ifa_name = strdup(ifp->ifr_name);
|
||||
temp->ifa_flags = request.ifr_flags;
|
||||
if ((temp->ifa_addr = calloc(1, sockaddr_len(&(ifp->ifr_addr)))) != NULL)
|
||||
memcpy(temp->ifa_addr, &(ifp->ifr_addr), sockaddr_len(&(ifp->ifr_addr)));
|
||||
|
||||
/*
|
||||
* Try to get the netmask for the interface...
|
||||
*/
|
||||
|
||||
if (!ioctl(sock, SIOCGIFNETMASK, &request))
|
||||
{
|
||||
/*
|
||||
* Got it, make a copy...
|
||||
*/
|
||||
|
||||
if ((temp->ifa_netmask = calloc(1, sizeof(request.ifr_netmask))) != NULL)
|
||||
memcpy(temp->ifa_netmask, &(request.ifr_netmask),
|
||||
sizeof(request.ifr_netmask));
|
||||
}
|
||||
|
||||
/*
|
||||
* Then get the broadcast or point-to-point (destination) address,
|
||||
* if applicable...
|
||||
*/
|
||||
|
||||
if (temp->ifa_flags & IFF_BROADCAST)
|
||||
{
|
||||
/*
|
||||
* Have a broadcast address, so get it!
|
||||
*/
|
||||
|
||||
if (!ioctl(sock, SIOCGIFBRDADDR, &request))
|
||||
{
|
||||
/*
|
||||
* Got it, make a copy...
|
||||
*/
|
||||
|
||||
if ((temp->ifa_broadaddr =
|
||||
calloc(1, sizeof(request.ifr_broadaddr))) != NULL)
|
||||
memcpy(temp->ifa_broadaddr, &(request.ifr_broadaddr),
|
||||
sizeof(request.ifr_broadaddr));
|
||||
}
|
||||
}
|
||||
else if (temp->ifa_flags & IFF_POINTOPOINT)
|
||||
{
|
||||
/*
|
||||
* Point-to-point interface; grab the remote address...
|
||||
*/
|
||||
|
||||
if (!ioctl(sock, SIOCGIFDSTADDR, &request))
|
||||
{
|
||||
temp->ifa_dstaddr = malloc(sizeof(request.ifr_dstaddr));
|
||||
memcpy(temp->ifa_dstaddr, &(request.ifr_dstaddr),
|
||||
sizeof(request.ifr_dstaddr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* OK, we're done with the socket, close it and return 0...
|
||||
*/
|
||||
|
||||
close(sock);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cups_freeifaddrs()' - Free an interface list...
|
||||
*/
|
||||
|
||||
void
|
||||
_cups_freeifaddrs(struct ifaddrs *addrs)/* I - Interface list to free */
|
||||
{
|
||||
struct ifaddrs *next; /* Next interface in list */
|
||||
|
||||
|
||||
while (addrs != NULL)
|
||||
{
|
||||
/*
|
||||
* Make a copy of the next interface pointer...
|
||||
*/
|
||||
|
||||
next = addrs->ifa_next;
|
||||
|
||||
/*
|
||||
* Free data values as needed...
|
||||
*/
|
||||
|
||||
if (addrs->ifa_name)
|
||||
{
|
||||
free(addrs->ifa_name);
|
||||
addrs->ifa_name = NULL;
|
||||
}
|
||||
|
||||
if (addrs->ifa_addr)
|
||||
{
|
||||
free(addrs->ifa_addr);
|
||||
addrs->ifa_addr = NULL;
|
||||
}
|
||||
|
||||
if (addrs->ifa_netmask)
|
||||
{
|
||||
free(addrs->ifa_netmask);
|
||||
addrs->ifa_netmask = NULL;
|
||||
}
|
||||
|
||||
if (addrs->ifa_dstaddr)
|
||||
{
|
||||
free(addrs->ifa_dstaddr);
|
||||
addrs->ifa_dstaddr = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free this node and continue to the next...
|
||||
*/
|
||||
|
||||
free(addrs);
|
||||
|
||||
addrs = next;
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_GETIFADDRS */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
+4
-1
@@ -32,7 +32,6 @@
|
||||
*/
|
||||
|
||||
# include "string.h"
|
||||
# include "http-private.h"
|
||||
# include "cups.h"
|
||||
# include "i18n.h"
|
||||
|
||||
@@ -98,7 +97,11 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
/* language.c */
|
||||
cups_lang_t *lang_default; /* Default language */
|
||||
# ifdef __APPLE__
|
||||
# ifdef HAVE_CF_LOCALE_ID
|
||||
char language[32]; /* Cached language */
|
||||
# else
|
||||
const char *language; /* Cached language */
|
||||
# endif /* HAVE_CF_LOCALE_ID */
|
||||
# endif /* __APPLE__ */
|
||||
|
||||
/* ppd.c */
|
||||
|
||||
+2
-21
@@ -52,9 +52,6 @@
|
||||
int /* O - 1 if "any", 0 otherwise */
|
||||
httpAddrAny(const http_addr_t *addr) /* I - Address to check */
|
||||
{
|
||||
if (!addr)
|
||||
return (0);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.sa_family == AF_INET6 &&
|
||||
IN6_IS_ADDR_UNSPECIFIED(&(addr->ipv6.sin6_addr)))
|
||||
@@ -79,12 +76,6 @@ int /* O - 1 if equal, 0 if not */
|
||||
httpAddrEqual(const http_addr_t *addr1, /* I - First address */
|
||||
const http_addr_t *addr2) /* I - Second address */
|
||||
{
|
||||
if (!addr1 && !addr2)
|
||||
return (1);
|
||||
|
||||
if (!addr1 || !addr2)
|
||||
return (0);
|
||||
|
||||
if (addr1->addr.sa_family != addr2->addr.sa_family)
|
||||
return (0);
|
||||
|
||||
@@ -111,9 +102,6 @@ httpAddrEqual(const http_addr_t *addr1, /* I - First address */
|
||||
int /* O - Length in bytes */
|
||||
httpAddrLength(const http_addr_t *addr) /* I - Address */
|
||||
{
|
||||
if (!addr)
|
||||
return (0);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.sa_family == AF_INET6)
|
||||
return (sizeof(addr->ipv6));
|
||||
@@ -143,9 +131,6 @@ int /* O - 1 if local host, 0 otherwise */
|
||||
httpAddrLocalhost(
|
||||
const http_addr_t *addr) /* I - Address to check */
|
||||
{
|
||||
if (!addr)
|
||||
return (1);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.sa_family == AF_INET6 &&
|
||||
IN6_IS_ADDR_LOOPBACK(&(addr->ipv6.sin6_addr)))
|
||||
@@ -523,9 +508,6 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
struct hostent *host; /* Host entry to get FQDN */
|
||||
|
||||
|
||||
if (!s || slen <= 1)
|
||||
return (NULL);
|
||||
|
||||
if (http)
|
||||
{
|
||||
if (http->hostname[0] == '/')
|
||||
@@ -539,8 +521,7 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
* Get the hostname...
|
||||
*/
|
||||
|
||||
if (gethostname(s, slen) < 0)
|
||||
strlcpy(s, "localhost", slen);
|
||||
gethostname(s, slen);
|
||||
|
||||
if (!strchr(s, '.'))
|
||||
{
|
||||
@@ -548,7 +529,7 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
* The hostname is not a FQDN, so look it up...
|
||||
*/
|
||||
|
||||
if ((host = gethostbyname(s)) != NULL && host->h_name)
|
||||
if ((host = gethostbyname(s)) != NULL)
|
||||
strlcpy(s, host->h_name, slen);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-18
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* HTTP address list routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -62,7 +62,7 @@ httpAddrConnect(
|
||||
* Create the socket...
|
||||
*/
|
||||
|
||||
if ((*sock = (int)socket(addrlist->addr.addr.sa_family, SOCK_STREAM, 0)) < 0)
|
||||
if ((*sock = socket(addrlist->addr.addr.sa_family, SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
/*
|
||||
* Don't abort yet, as this could just be an issue with the local
|
||||
@@ -248,7 +248,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
*/
|
||||
|
||||
strlcpy(ipv6, hostname + 4, sizeof(ipv6));
|
||||
if ((ipv6len = (int)strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
|
||||
if ((ipv6len = strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
|
||||
{
|
||||
ipv6[ipv6len] = '\0';
|
||||
hostname = ipv6;
|
||||
@@ -268,7 +268,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
*/
|
||||
|
||||
strlcpy(ipv6, hostname + 1, sizeof(ipv6));
|
||||
if ((ipv6len = (int)strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
|
||||
if ((ipv6len = strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
|
||||
{
|
||||
ipv6[ipv6len] = '\0';
|
||||
hostname = ipv6;
|
||||
@@ -412,7 +412,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
if (host->h_addrtype == AF_INET6)
|
||||
{
|
||||
temp->addr.ipv6.sin6_family = AF_INET6;
|
||||
memcpy(&(temp->addr.ipv6.sin6_addr), host->h_addr_list[i],
|
||||
memcpy(&(temp->addr.ipv6), host->h_addr_list[i],
|
||||
sizeof(temp->addr.ipv6));
|
||||
temp->addr.ipv6.sin6_port = htons(portnum);
|
||||
}
|
||||
@@ -420,7 +420,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
# endif /* AF_INET6 */
|
||||
{
|
||||
temp->addr.ipv4.sin_family = AF_INET;
|
||||
memcpy(&(temp->addr.ipv4.sin_addr), host->h_addr_list[i],
|
||||
memcpy(&(temp->addr.ipv4), host->h_addr_list[i],
|
||||
sizeof(temp->addr.ipv4));
|
||||
temp->addr.ipv4.sin_port = htons(portnum);
|
||||
}
|
||||
@@ -506,9 +506,6 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
temp->addr.ipv6.sin6_addr.s6_addr32[3] = htonl(1);
|
||||
# endif /* WIN32 */
|
||||
|
||||
if (!first)
|
||||
first = temp;
|
||||
|
||||
addr = temp;
|
||||
}
|
||||
|
||||
@@ -530,9 +527,6 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
temp->addr.ipv4.sin_port = htons(portnum);
|
||||
temp->addr.ipv4.sin_addr.s_addr = htonl(0x7f000001);
|
||||
|
||||
if (!first)
|
||||
first = temp;
|
||||
|
||||
if (addr)
|
||||
addr->next = temp;
|
||||
else
|
||||
@@ -562,9 +556,6 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
temp->addr.ipv6.sin6_family = AF_INET6;
|
||||
temp->addr.ipv6.sin6_port = htons(portnum);
|
||||
|
||||
if (!first)
|
||||
first = temp;
|
||||
|
||||
addr = temp;
|
||||
}
|
||||
|
||||
@@ -585,9 +576,6 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
temp->addr.ipv4.sin_family = AF_INET;
|
||||
temp->addr.ipv4.sin_port = htons(portnum);
|
||||
|
||||
if (!first)
|
||||
first = temp;
|
||||
|
||||
if (addr)
|
||||
addr->next = temp;
|
||||
else
|
||||
|
||||
+12
-68
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Private HTTP definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -31,8 +31,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <config.h>
|
||||
# include "config.h"
|
||||
|
||||
# ifdef __sun
|
||||
/*
|
||||
@@ -70,8 +69,7 @@ typedef int socklen_t;
|
||||
# if defined HAVE_LIBSSL
|
||||
/*
|
||||
* The OpenSSL library provides its own SSL/TLS context structure for its
|
||||
* IO and protocol management. However, we need to provide our own BIO
|
||||
* (basic IO) implementation to do timeouts...
|
||||
* IO and protocol management...
|
||||
*/
|
||||
|
||||
# include <openssl/err.h>
|
||||
@@ -80,8 +78,6 @@ typedef int socklen_t;
|
||||
|
||||
typedef SSL http_tls_t;
|
||||
|
||||
extern BIO_METHOD *_httpBIOMethods(void);
|
||||
|
||||
# elif defined HAVE_GNUTLS
|
||||
/*
|
||||
* The GNU TLS library is more of a "bare metal" SSL/TLS library...
|
||||
@@ -94,11 +90,6 @@ typedef struct
|
||||
void *credentials; /* GNU TLS credentials object */
|
||||
} http_tls_t;
|
||||
|
||||
extern ssize_t _httpReadGNUTLS(gnutls_transport_ptr ptr, void *data,
|
||||
size_t length);
|
||||
extern ssize_t _httpWriteGNUTLS(gnutls_transport_ptr ptr, const void *data,
|
||||
size_t length);
|
||||
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
/*
|
||||
* Darwin's Security framework provides its own SSL/TLS context structure
|
||||
@@ -107,11 +98,16 @@ extern ssize_t _httpWriteGNUTLS(gnutls_transport_ptr ptr, const void *data,
|
||||
|
||||
# include <Security/SecureTransport.h>
|
||||
|
||||
typedef struct /**** CDSA connection information ****/
|
||||
typedef SSLConnectionRef http_tls_t;
|
||||
|
||||
typedef union _cdsa_conn_ref_u /**** CDSA Connection reference union
|
||||
**** used to resolve 64-bit casting
|
||||
**** warnings.
|
||||
****/
|
||||
{
|
||||
SSLContextRef session; /* CDSA session object */
|
||||
CFArrayRef certsArray; /* Certificates array */
|
||||
} http_tls_t;
|
||||
SSLConnectionRef connection; /* SSL connection pointer */
|
||||
int sock; /* Socket */
|
||||
} cdsa_conn_ref_t;
|
||||
|
||||
extern OSStatus _httpReadCDSA(SSLConnectionRef connection, void *data,
|
||||
size_t *dataLength);
|
||||
@@ -133,58 +129,6 @@ extern const char *_cups_hstrerror(int error);
|
||||
extern const char *hstrerror(int error);
|
||||
# endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
/*
|
||||
* Some OS's don't have getifaddrs() and freeifaddrs()...
|
||||
*/
|
||||
|
||||
# ifndef WIN32
|
||||
# include <net/if.h>
|
||||
# ifdef HAVE_GETIFADDRS
|
||||
# include <ifaddrs.h>
|
||||
# else
|
||||
# include <sys/ioctl.h>
|
||||
# ifdef HAVE_SYS_SOCKIO_H
|
||||
# include <sys/sockio.h>
|
||||
# endif /* HAVE_SYS_SOCKIO_H */
|
||||
|
||||
# ifdef ifa_dstaddr
|
||||
# undef ifa_dstaddr
|
||||
# endif /* ifa_dstaddr */
|
||||
# ifndef ifr_netmask
|
||||
# define ifr_netmask ifr_addr
|
||||
# endif /* !ifr_netmask */
|
||||
|
||||
struct ifaddrs /**** Interface Structure ****/
|
||||
{
|
||||
struct ifaddrs *ifa_next; /* Next interface in list */
|
||||
char *ifa_name; /* Name of interface */
|
||||
unsigned int ifa_flags; /* Flags (up, point-to-point, etc.) */
|
||||
struct sockaddr *ifa_addr, /* Network address */
|
||||
*ifa_netmask; /* Address mask */
|
||||
union
|
||||
{
|
||||
struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
|
||||
struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
|
||||
} ifa_ifu;
|
||||
|
||||
void *ifa_data; /* Interface statistics */
|
||||
};
|
||||
|
||||
# ifndef ifa_broadaddr
|
||||
# define ifa_broadaddr ifa_ifu.ifu_broadaddr
|
||||
# endif /* !ifa_broadaddr */
|
||||
# ifndef ifa_dstaddr
|
||||
# define ifa_dstaddr ifa_ifu.ifu_dstaddr
|
||||
# endif /* !ifa_dstaddr */
|
||||
|
||||
extern int _cups_getifaddrs(struct ifaddrs **addrs);
|
||||
# define getifaddrs _cups_getifaddrs
|
||||
extern void _cups_freeifaddrs(struct ifaddrs *addrs);
|
||||
# define freeifaddrs _cups_freeifaddrs
|
||||
# endif /* HAVE_GETIFADDRS */
|
||||
# endif /* !WIN32 */
|
||||
|
||||
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
|
||||
+5
-16
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* HTTP support routines for the Common UNIX Printing System (CUPS) scheduler.
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -549,7 +549,7 @@ char * /* O - Encoded string */
|
||||
httpEncode64(char *out, /* I - String to write to */
|
||||
const char *in) /* I - String to read from */
|
||||
{
|
||||
return (httpEncode64_2(out, 512, in, (int)strlen(in)));
|
||||
return (httpEncode64_2(out, 512, in, strlen(in)));
|
||||
}
|
||||
|
||||
|
||||
@@ -595,14 +595,8 @@ httpEncode64_2(char *out, /* I - String to write to */
|
||||
|
||||
if (outptr < outend)
|
||||
*outptr ++ = base64[(in[0] & 255) >> 2];
|
||||
|
||||
if (outptr < outend)
|
||||
{
|
||||
if (inlen > 1)
|
||||
*outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
|
||||
else
|
||||
*outptr ++ = base64[((in[0] & 255) << 4) & 63];
|
||||
}
|
||||
*outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
|
||||
|
||||
in ++;
|
||||
inlen --;
|
||||
@@ -616,12 +610,7 @@ httpEncode64_2(char *out, /* I - String to write to */
|
||||
}
|
||||
|
||||
if (outptr < outend)
|
||||
{
|
||||
if (inlen > 1)
|
||||
*outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
|
||||
else
|
||||
*outptr ++ = base64[((in[0] & 255) << 2) & 63];
|
||||
}
|
||||
*outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
|
||||
|
||||
in ++;
|
||||
inlen --;
|
||||
@@ -1112,7 +1101,7 @@ httpSeparateURI(
|
||||
|
||||
char *resptr = resource + strlen(resource);
|
||||
|
||||
uri = http_copy_decode(resptr, uri, resourcelen - (int)(resptr - resource),
|
||||
uri = http_copy_decode(resptr, uri, resourcelen - (resptr - resource),
|
||||
NULL, decoding & HTTP_URI_CODING_QUERY);
|
||||
}
|
||||
}
|
||||
|
||||
+126
-451
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* HTTP routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -25,7 +25,6 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* _httpBIOMethods() - Get the OpenSSL BIO methods for HTTP connections.
|
||||
* httpBlocking() - Set blocking/non-blocking behavior on a connection.
|
||||
* httpCheck() - Check to see if there is a pending response from
|
||||
* the server.
|
||||
@@ -61,8 +60,7 @@
|
||||
* httpPut() - Send a PUT request to the server.
|
||||
* httpRead() - Read data from a HTTP connection.
|
||||
* httpRead2() - Read data from a HTTP connection.
|
||||
* _httpReadCDSA() - Read function for the CDSA library.
|
||||
* _httpReadGNUTLS() - Read function for the GNU TLS library.
|
||||
* _httpReadCDSA() - Read function for CDSA decryption code.
|
||||
* httpReconnect() - Reconnect to a HTTP server...
|
||||
* httpSetCookie() - Set the cookie value(s)...
|
||||
* httpSetExpect() - Set the Expect: header in a request.
|
||||
@@ -73,14 +71,7 @@
|
||||
* httpWait() - Wait for data available on a connection.
|
||||
* httpWrite() - Write data to a HTTP connection.
|
||||
* httpWrite2() - Write data to a HTTP connection.
|
||||
* _httpWriteCDSA() - Write function for the CDSA library.
|
||||
* _httpWriteGNUTLS() - Write function for the GNU TLS library.
|
||||
* http_bio_ctrl() - Control the HTTP connection.
|
||||
* http_bio_free() - Free OpenSSL data.
|
||||
* http_bio_new() - Initialize an OpenSSL BIO structure.
|
||||
* http_bio_puts() - Send a string for OpenSSL.
|
||||
* http_bio_read() - Read data for OpenSSL.
|
||||
* http_bio_write() - Write data for OpenSSL.
|
||||
* _httpWriteCDSA() - Write function for CDSA encryption code.
|
||||
* http_field() - Return the field index for a field name.
|
||||
* http_read_ssl() - Read from a SSL/TLS connection.
|
||||
* http_send() - Send a request with all fields and the trailing
|
||||
@@ -127,7 +118,7 @@
|
||||
static http_field_t http_field(const char *name);
|
||||
static int http_send(http_t *http, http_state_t request,
|
||||
const char *uri);
|
||||
static int http_wait(http_t *http, int msec, int usessl);
|
||||
static int http_wait(http_t *http, int msec);
|
||||
static int http_write(http_t *http, const char *buffer,
|
||||
int length);
|
||||
static int http_write_chunk(http_t *http, const char *buffer,
|
||||
@@ -177,45 +168,6 @@ static const char * const http_fields[] =
|
||||
};
|
||||
|
||||
|
||||
#if defined(HAVE_SSL) && defined(HAVE_LIBSSL)
|
||||
/*
|
||||
* BIO methods for OpenSSL...
|
||||
*/
|
||||
|
||||
static int http_bio_write(BIO *h, const char *buf, int num);
|
||||
static int http_bio_read(BIO *h, char *buf, int size);
|
||||
static int http_bio_puts(BIO *h, const char *str);
|
||||
static long http_bio_ctrl(BIO *h, int cmd, long arg1, void *arg2);
|
||||
static int http_bio_new(BIO *h);
|
||||
static int http_bio_free(BIO *data);
|
||||
|
||||
static BIO_METHOD http_bio_methods =
|
||||
{
|
||||
BIO_TYPE_SOCKET,
|
||||
"http",
|
||||
http_bio_write,
|
||||
http_bio_read,
|
||||
http_bio_puts,
|
||||
NULL, /* http_bio_gets, */
|
||||
http_bio_ctrl,
|
||||
http_bio_new,
|
||||
http_bio_free,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* '_httpBIOMethods()' - Get the OpenSSL BIO methods for HTTP connections.
|
||||
*/
|
||||
|
||||
BIO_METHOD * /* O - BIO methods for OpenSSL */
|
||||
_httpBIOMethods(void)
|
||||
{
|
||||
return (&http_bio_methods);
|
||||
}
|
||||
#endif /* HAVE_SSL && HAVE_LIBSSL */
|
||||
|
||||
|
||||
/*
|
||||
* 'httpBlocking()' - Set blocking/non-blocking behavior on a connection.
|
||||
*/
|
||||
@@ -270,10 +222,7 @@ httpClearFields(http_t *http) /* I - HTTP connection */
|
||||
if (http)
|
||||
{
|
||||
memset(http->fields, 0, sizeof(http->fields));
|
||||
if (http->hostname[0] == '/')
|
||||
httpSetField(http, HTTP_FIELD_HOST, "localhost");
|
||||
else
|
||||
httpSetField(http, HTTP_FIELD_HOST, http->hostname);
|
||||
httpSetField(http, HTTP_FIELD_HOST, http->hostname);
|
||||
|
||||
http->expect = (http_status_t)0;
|
||||
}
|
||||
@@ -694,18 +643,8 @@ httpGetLength2(http_t *http) /* I - HTTP connection */
|
||||
* after the transfer is complete...
|
||||
*/
|
||||
|
||||
if (!http->fields[HTTP_FIELD_CONTENT_LENGTH][0])
|
||||
{
|
||||
/*
|
||||
* Default content length is 0 for errors and 2^31-1 for other
|
||||
* successful requests...
|
||||
*/
|
||||
|
||||
if (http->status >= HTTP_MULTIPLE_CHOICES)
|
||||
http->data_remaining = 0;
|
||||
else
|
||||
http->data_remaining = 2147483647;
|
||||
}
|
||||
if (http->fields[HTTP_FIELD_CONTENT_LENGTH][0] == '\0')
|
||||
http->data_remaining = 2147483647;
|
||||
else
|
||||
http->data_remaining = strtoll(http->fields[HTTP_FIELD_CONTENT_LENGTH],
|
||||
NULL, 10);
|
||||
@@ -927,16 +866,8 @@ httpGets(char *line, /* I - Line to read into */
|
||||
* No newline; see if there is more data to be read...
|
||||
*/
|
||||
|
||||
if (!http->blocking && !http_wait(http, 10000, 1))
|
||||
{
|
||||
DEBUG_puts("httpGets: Timed out!");
|
||||
#ifdef WIN32
|
||||
http->error = WSAETIMEDOUT;
|
||||
#else
|
||||
http->error = ETIMEDOUT;
|
||||
#endif /* WIN32 */
|
||||
if (!http->blocking && !http_wait(http, 1000))
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (http->tls)
|
||||
@@ -1010,7 +941,7 @@ httpGets(char *line, /* I - Line to read into */
|
||||
*lineptr++ = *bufptr++;
|
||||
}
|
||||
|
||||
http->used -= (int)(bufptr - http->buffer);
|
||||
http->used -= bufptr - http->buffer;
|
||||
if (http->used > 0)
|
||||
memmove(http->buffer, bufptr, http->used);
|
||||
|
||||
@@ -1165,20 +1096,15 @@ httpPrintf(http_t *http, /* I - HTTP connection */
|
||||
|
||||
DEBUG_printf(("httpPrintf: %s", buf));
|
||||
|
||||
if (http->data_encoding == HTTP_ENCODE_FIELDS)
|
||||
return (httpWrite2(http, buf, bytes));
|
||||
else
|
||||
if (http->wused)
|
||||
{
|
||||
if (http->wused)
|
||||
{
|
||||
DEBUG_puts(" flushing existing data...");
|
||||
DEBUG_puts(" flushing existing data...");
|
||||
|
||||
if (httpFlushWrite(http) < 0)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
return (http_write(http, buf, bytes));
|
||||
if (httpFlushWrite(http) < 0)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
return (http_write(http, buf, bytes));
|
||||
}
|
||||
|
||||
|
||||
@@ -1283,8 +1209,8 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
return (0);
|
||||
}
|
||||
else if (length > (size_t)http->data_remaining)
|
||||
length = (size_t)http->data_remaining;
|
||||
else if (length > http->data_remaining)
|
||||
length = http->data_remaining;
|
||||
|
||||
if (http->used == 0 && length <= 256)
|
||||
{
|
||||
@@ -1292,7 +1218,7 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
* Buffer small reads for better performance...
|
||||
*/
|
||||
|
||||
if (!http->blocking && !httpWait(http, 10000))
|
||||
if (!http->blocking && !httpWait(http, 1000))
|
||||
return (0);
|
||||
|
||||
if (http->data_remaining > sizeof(http->buffer))
|
||||
@@ -1339,15 +1265,15 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (http->used > 0)
|
||||
{
|
||||
if (length > (size_t)http->used)
|
||||
length = (size_t)http->used;
|
||||
if (length > http->used)
|
||||
length = http->used;
|
||||
|
||||
bytes = (ssize_t)length;
|
||||
bytes = length;
|
||||
|
||||
DEBUG_printf(("httpRead2: grabbing %d bytes from input buffer...\n", bytes));
|
||||
|
||||
memcpy(buffer, http->buffer, length);
|
||||
http->used -= (int)length;
|
||||
http->used -= length;
|
||||
|
||||
if (http->used > 0)
|
||||
memmove(http->buffer, http->buffer + length, http->used);
|
||||
@@ -1355,26 +1281,22 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
#ifdef HAVE_SSL
|
||||
else if (http->tls)
|
||||
{
|
||||
if (!http->blocking && !httpWait(http, 10000))
|
||||
if (!http->blocking && !httpWait(http, 1000))
|
||||
return (0);
|
||||
|
||||
bytes = (ssize_t)http_read_ssl(http, buffer, (int)length);
|
||||
bytes = http_read_ssl(http, buffer, length);
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
else
|
||||
{
|
||||
if (!http->blocking && !httpWait(http, 10000))
|
||||
if (!http->blocking && !httpWait(http, 1000))
|
||||
return (0);
|
||||
|
||||
DEBUG_printf(("httpRead2: reading %d bytes from socket...\n", length));
|
||||
|
||||
#ifdef WIN32
|
||||
bytes = (ssize_t)recv(http->fd, buffer, (int)length, 0);
|
||||
#else
|
||||
while ((bytes = recv(http->fd, buffer, length, 0)) < 0)
|
||||
if (errno != EINTR)
|
||||
break;
|
||||
#endif /* WIN32 */
|
||||
|
||||
DEBUG_printf(("httpRead2: read %d bytes from socket...\n", bytes));
|
||||
}
|
||||
@@ -1457,7 +1379,7 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
#if defined(HAVE_SSL) && defined(HAVE_CDSASSL)
|
||||
/*
|
||||
* '_httpReadCDSA()' - Read function for the CDSA library.
|
||||
* '_httpReadCDSA()' - Read function for CDSA decryption code.
|
||||
*/
|
||||
|
||||
OSStatus /* O - -1 on error, 0 on success */
|
||||
@@ -1466,36 +1388,19 @@ _httpReadCDSA(
|
||||
void *data, /* I - Data buffer */
|
||||
size_t *dataLength) /* IO - Number of bytes */
|
||||
{
|
||||
OSStatus result; /* Return value */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
http_t *http; /* HTTP connection */
|
||||
OSStatus result; /* Return value */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
cdsa_conn_ref_t u; /* Connection reference union */
|
||||
|
||||
|
||||
http = (http_t *)connection;
|
||||
|
||||
if (!http->blocking)
|
||||
{
|
||||
/*
|
||||
* Make sure we have data before we read...
|
||||
*/
|
||||
|
||||
if (!http_wait(http, 10000, 0))
|
||||
{
|
||||
http->error = ETIMEDOUT;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
u.connection = connection;
|
||||
|
||||
do
|
||||
{
|
||||
bytes = recv(http->fd, data, *dataLength, 0);
|
||||
}
|
||||
bytes = recv(u.sock, data, *dataLength, 0);
|
||||
while (bytes == -1 && errno == EINTR);
|
||||
|
||||
if (bytes == *dataLength)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else if (bytes > 0)
|
||||
{
|
||||
*dataLength = bytes;
|
||||
@@ -1506,52 +1411,20 @@ _httpReadCDSA(
|
||||
*dataLength = 0;
|
||||
|
||||
if (bytes == 0)
|
||||
result = errSSLClosedGraceful;
|
||||
result = errSSLClosedAbort;
|
||||
else if (errno == EAGAIN)
|
||||
result = errSSLWouldBlock;
|
||||
else
|
||||
else if (errno == EPIPE)
|
||||
result = errSSLClosedAbort;
|
||||
else
|
||||
result = errSSLInternal;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
#endif /* HAVE_SSL && HAVE_CDSASSL */
|
||||
|
||||
|
||||
#if defined(HAVE_SSL) && defined(HAVE_GNUTLS)
|
||||
/*
|
||||
* '_httpReadGNUTLS()' - Read function for the GNU TLS library.
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes read or -1 on error */
|
||||
_httpReadGNUTLS(
|
||||
gnutls_transport_ptr ptr, /* I - HTTP connection */
|
||||
void *data, /* I - Buffer */
|
||||
size_t length) /* I - Number of bytes to read */
|
||||
{
|
||||
http_t *http; /* HTTP connection */
|
||||
|
||||
|
||||
http = (http_t *)ptr;
|
||||
|
||||
if (!http->blocking)
|
||||
{
|
||||
/*
|
||||
* Make sure we have data before we read...
|
||||
*/
|
||||
|
||||
if (!http_wait(http, 10000, 0))
|
||||
{
|
||||
http->error = ETIMEDOUT;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
return (recv(http->fd, data, length, 0));
|
||||
}
|
||||
#endif /* HAVE_SSL && HAVE_GNUTLS */
|
||||
|
||||
|
||||
/*
|
||||
* 'httpReconnect()' - Reconnect to a HTTP server.
|
||||
*/
|
||||
@@ -1933,21 +1806,11 @@ httpWait(http_t *http, /* I - HTTP connection */
|
||||
if (http->used)
|
||||
return (1);
|
||||
|
||||
/*
|
||||
* Flush pending data, if any...
|
||||
*/
|
||||
|
||||
if (http->wused)
|
||||
{
|
||||
if (httpFlushWrite(http) < 0)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* If not, check the SSL/TLS buffers and do a select() on the connection...
|
||||
*/
|
||||
|
||||
return (http_wait(http, msec, 1));
|
||||
return (http_wait(http, msec));
|
||||
}
|
||||
|
||||
|
||||
@@ -2022,8 +1885,8 @@ httpWrite2(http_t *http, /* I - HTTP connection */
|
||||
DEBUG_printf((" copying %d bytes to wbuffer...\n", length));
|
||||
|
||||
memcpy(http->wbuffer + http->wused, buffer, length);
|
||||
http->wused += (int)length;
|
||||
bytes = (ssize_t)length;
|
||||
http->wused += length;
|
||||
bytes = length;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2034,9 +1897,9 @@ httpWrite2(http_t *http, /* I - HTTP connection */
|
||||
DEBUG_printf((" writing %d bytes to socket...\n", length));
|
||||
|
||||
if (http->data_encoding == HTTP_ENCODE_CHUNKED)
|
||||
bytes = (ssize_t)http_write_chunk(http, buffer, (int)length);
|
||||
bytes = http_write_chunk(http, buffer, length);
|
||||
else
|
||||
bytes = (ssize_t)http_write(http, buffer, (int)length);
|
||||
bytes = http_write(http, buffer, length);
|
||||
|
||||
DEBUG_printf((" wrote %d bytes...\n", bytes));
|
||||
}
|
||||
@@ -2094,7 +1957,7 @@ httpWrite2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
#if defined(HAVE_SSL) && defined(HAVE_CDSASSL)
|
||||
/*
|
||||
* '_httpWriteCDSA()' - Write function for the CDSA library.
|
||||
* '_httpWriteCDSA()' - Write function for CDSA encryption code.
|
||||
*/
|
||||
|
||||
OSStatus /* O - -1 on error, 0 on success */
|
||||
@@ -2103,23 +1966,19 @@ _httpWriteCDSA(
|
||||
const void *data, /* I - Data buffer */
|
||||
size_t *dataLength) /* IO - Number of bytes */
|
||||
{
|
||||
OSStatus result; /* Return value */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
http_t *http; /* HTTP connection */
|
||||
OSStatus result; /* Return value */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
cdsa_conn_ref_t u; /* Connection reference union */
|
||||
|
||||
|
||||
http = (http_t *)connection;
|
||||
u.connection = connection;
|
||||
|
||||
do
|
||||
{
|
||||
bytes = write(http->fd, data, *dataLength);
|
||||
}
|
||||
bytes = write(u.sock, data, *dataLength);
|
||||
while (bytes == -1 && errno == EINTR);
|
||||
|
||||
if (bytes == *dataLength)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else if (bytes >= 0)
|
||||
{
|
||||
*dataLength = bytes;
|
||||
@@ -2131,177 +1990,17 @@ _httpWriteCDSA(
|
||||
|
||||
if (errno == EAGAIN)
|
||||
result = errSSLWouldBlock;
|
||||
else
|
||||
else if (errno == EPIPE)
|
||||
result = errSSLClosedAbort;
|
||||
else
|
||||
result = errSSLInternal;
|
||||
}
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
#endif /* HAVE_SSL && HAVE_CDSASSL */
|
||||
|
||||
|
||||
#if defined(HAVE_SSL) && defined(HAVE_GNUTLS)
|
||||
/*
|
||||
* '_httpWriteGNUTLS()' - Write function for the GNU TLS library.
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes written or -1 on error */
|
||||
_httpWriteGNUTLS(
|
||||
gnutls_transport_ptr ptr, /* I - HTTP connection */
|
||||
const void *data, /* I - Data buffer */
|
||||
size_t length) /* I - Number of bytes to write */
|
||||
{
|
||||
return (send(((http_t *)ptr)->fd, data, length, 0));
|
||||
}
|
||||
#endif /* HAVE_SSL && HAVE_GNUTLS */
|
||||
|
||||
|
||||
#if defined(HAVE_SSL) && defined(HAVE_LIBSSL)
|
||||
/*
|
||||
* 'http_bio_ctrl()' - Control the HTTP connection.
|
||||
*/
|
||||
|
||||
static long /* O - Result/data */
|
||||
http_bio_ctrl(BIO *h, /* I - BIO data */
|
||||
int cmd, /* I - Control command */
|
||||
long arg1, /* I - First argument */
|
||||
void *arg2) /* I - Second argument */
|
||||
{
|
||||
switch (cmd)
|
||||
{
|
||||
default :
|
||||
return (0);
|
||||
|
||||
case BIO_CTRL_RESET :
|
||||
h->ptr = NULL;
|
||||
return (0);
|
||||
|
||||
case BIO_C_SET_FILE_PTR :
|
||||
h->ptr = arg2;
|
||||
h->init = 1;
|
||||
return (1);
|
||||
|
||||
case BIO_C_GET_FILE_PTR :
|
||||
if (arg2)
|
||||
{
|
||||
*((void **)arg2) = h->ptr;
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
return (0);
|
||||
|
||||
case BIO_CTRL_DUP :
|
||||
case BIO_CTRL_FLUSH :
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'http_bio_free()' - Free OpenSSL data.
|
||||
*/
|
||||
|
||||
static int /* O - 1 on success, 0 on failure */
|
||||
http_bio_free(BIO *h) /* I - BIO data */
|
||||
{
|
||||
if (!h)
|
||||
return (0);
|
||||
|
||||
if (h->shutdown)
|
||||
{
|
||||
h->init = 0;
|
||||
h->flags = 0;
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'http_bio_new()' - Initialize an OpenSSL BIO structure.
|
||||
*/
|
||||
|
||||
static int /* O - 1 on success, 0 on failure */
|
||||
http_bio_new(BIO *h) /* I - BIO data */
|
||||
{
|
||||
if (!h)
|
||||
return (0);
|
||||
|
||||
h->init = 0;
|
||||
h->num = 0;
|
||||
h->ptr = NULL;
|
||||
h->flags = 0;
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'http_bio_puts()' - Send a string for OpenSSL.
|
||||
*/
|
||||
|
||||
static int /* O - Bytes written */
|
||||
http_bio_puts(BIO *h, /* I - BIO data */
|
||||
const char *str) /* I - String to write */
|
||||
{
|
||||
#ifdef WIN32
|
||||
return (send(((http_t *)h->ptr)->fd, str, (int)strlen(str), 0));
|
||||
#else
|
||||
return (send(((http_t *)h->ptr)->fd, str, strlen(str), 0));
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'http_bio_read()' - Read data for OpenSSL.
|
||||
*/
|
||||
|
||||
static int /* O - Bytes read */
|
||||
http_bio_read(BIO *h, /* I - BIO data */
|
||||
char *buf, /* I - Buffer */
|
||||
int size) /* I - Number of bytes to read */
|
||||
{
|
||||
http_t *http; /* HTTP connection */
|
||||
|
||||
|
||||
http = (http_t *)h->ptr;
|
||||
|
||||
if (!http->blocking)
|
||||
{
|
||||
/*
|
||||
* Make sure we have data before we read...
|
||||
*/
|
||||
|
||||
if (!http_wait(http, 10000, 0))
|
||||
{
|
||||
#ifdef WIN32
|
||||
http->error = WSAETIMEDOUT;
|
||||
#else
|
||||
http->error = ETIMEDOUT;
|
||||
#endif /* WIN32 */
|
||||
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
return (recv(http->fd, buf, size, 0));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'http_bio_write()' - Write data for OpenSSL.
|
||||
*/
|
||||
|
||||
static int /* O - Bytes written */
|
||||
http_bio_write(BIO *h, /* I - BIO data */
|
||||
const char *buf, /* I - Buffer to write */
|
||||
int num) /* I - Number of bytes to write */
|
||||
{
|
||||
return (send(((http_t *)h->ptr)->fd, buf, num, 0));
|
||||
}
|
||||
#endif /* HAVE_SSL && HAVE_LIBSSL */
|
||||
|
||||
|
||||
/*
|
||||
* 'http_field()' - Return the field index for a field name.
|
||||
*/
|
||||
@@ -2342,7 +2041,7 @@ http_read_ssl(http_t *http, /* I - HTTP connection */
|
||||
size_t processed; /* Number of bytes processed */
|
||||
|
||||
|
||||
error = SSLRead(((http_tls_t *)http->tls)->session, buf, len, &processed);
|
||||
error = SSLRead((SSLContextRef)http->tls, buf, len, &processed);
|
||||
|
||||
switch (error)
|
||||
{
|
||||
@@ -2445,20 +2144,11 @@ http_send(http_t *http, /* I - HTTP connection */
|
||||
if (httpReconnect(http))
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Flush any written data that is pending...
|
||||
*/
|
||||
|
||||
if (http->wused)
|
||||
httpFlushWrite(http);
|
||||
|
||||
/*
|
||||
* Send the request header...
|
||||
*/
|
||||
|
||||
http->state = request;
|
||||
http->data_encoding = HTTP_ENCODE_FIELDS;
|
||||
|
||||
http->state = request;
|
||||
if (request == HTTP_POST || request == HTTP_PUT)
|
||||
http->state ++;
|
||||
|
||||
@@ -2511,7 +2201,6 @@ http_send(http_t *http, /* I - HTTP connection */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
httpFlushWrite(http);
|
||||
httpGetLength2(http);
|
||||
httpClearFields(http);
|
||||
|
||||
@@ -2528,16 +2217,15 @@ static int /* O - Status of connection */
|
||||
http_setup_ssl(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
# ifdef HAVE_LIBSSL
|
||||
SSL_CTX *context; /* Context for encryption */
|
||||
SSL *conn; /* Connection for encryption */
|
||||
BIO *bio; /* BIO data */
|
||||
SSL_CTX *context; /* Context for encryption */
|
||||
SSL *conn; /* Connection for encryption */
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
http_tls_t *conn; /* TLS session object */
|
||||
http_tls_t *conn; /* TLS session object */
|
||||
gnutls_certificate_client_credentials *credentials;
|
||||
/* TLS credentials */
|
||||
/* TLS credentials */
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
OSStatus error; /* Error code */
|
||||
http_tls_t *conn; /* CDSA connection information */
|
||||
SSLContextRef conn; /* Context for encryption */
|
||||
OSStatus error; /* Error info */
|
||||
# endif /* HAVE_LIBSSL */
|
||||
|
||||
|
||||
@@ -2548,12 +2236,9 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
|
||||
|
||||
SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */
|
||||
|
||||
bio = BIO_new(_httpBIOMethods());
|
||||
BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)http);
|
||||
|
||||
conn = SSL_new(context);
|
||||
SSL_set_bio(conn, bio, bio);
|
||||
|
||||
SSL_set_fd(conn, http->fd);
|
||||
if (SSL_connect(conn) != 1)
|
||||
{
|
||||
# ifdef DEBUG
|
||||
@@ -2577,7 +2262,9 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
|
||||
}
|
||||
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
if ((conn = (http_tls_t *)malloc(sizeof(http_tls_t))) == NULL)
|
||||
conn = (http_tls_t *)malloc(sizeof(http_tls_t));
|
||||
|
||||
if (conn == NULL)
|
||||
{
|
||||
http->error = errno;
|
||||
http->status = HTTP_ERROR;
|
||||
@@ -2602,9 +2289,8 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
|
||||
gnutls_init(&(conn->session), GNUTLS_CLIENT);
|
||||
gnutls_set_default_priority(conn->session);
|
||||
gnutls_credentials_set(conn->session, GNUTLS_CRD_CERTIFICATE, *credentials);
|
||||
gnutls_transport_set_ptr(conn->session, (gnutls_transport_ptr)http);
|
||||
gnutls_transport_set_pull_function(conn->session, _httpReadGNUTLS);
|
||||
gnutls_transport_set_push_function(conn->session, _httpWriteGNUTLS);
|
||||
gnutls_transport_set_ptr(conn->session,
|
||||
(gnutls_transport_ptr)((long)http->fd));
|
||||
|
||||
if ((gnutls_handshake(conn->session)) != GNUTLS_E_SUCCESS)
|
||||
{
|
||||
@@ -2617,52 +2303,45 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
|
||||
conn->credentials = credentials;
|
||||
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
conn = (http_tls_t *)calloc(1, sizeof(http_tls_t));
|
||||
cdsa_conn_ref_t u; /* Connection reference union */
|
||||
|
||||
if (conn == NULL)
|
||||
return (-1);
|
||||
|
||||
if ((error = SSLNewContext(false, &conn->session)))
|
||||
error = SSLNewContext(false, &conn);
|
||||
|
||||
if (!error)
|
||||
error = SSLSetIOFuncs(conn, _httpReadCDSA, _httpWriteCDSA);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
http->error = error;
|
||||
http->status = HTTP_ERROR;
|
||||
/*
|
||||
* Use a union to resolve warnings about int/pointer size mismatches...
|
||||
*/
|
||||
|
||||
free(conn);
|
||||
return (-1);
|
||||
u.connection = NULL;
|
||||
u.sock = http->fd;
|
||||
error = SSLSetConnection(conn, u.connection);
|
||||
}
|
||||
|
||||
/*
|
||||
* Use a union to resolve warnings about int/pointer size mismatches...
|
||||
*/
|
||||
|
||||
error = SSLSetConnection(conn->session, http);
|
||||
if (!error)
|
||||
error = SSLSetAllowsExpiredCerts(conn, true);
|
||||
|
||||
if (!error)
|
||||
error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA);
|
||||
|
||||
if (!error)
|
||||
error = SSLSetAllowsExpiredCerts(conn->session, true);
|
||||
|
||||
if (!error)
|
||||
error = SSLSetAllowsAnyRoot(conn->session, true);
|
||||
|
||||
if (!error)
|
||||
error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false);
|
||||
error = SSLSetAllowsAnyRoot(conn, true);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
while ((error = SSLHandshake(conn->session)) == errSSLWouldBlock)
|
||||
while ((error = SSLHandshake(conn)) == errSSLWouldBlock)
|
||||
usleep(1000);
|
||||
}
|
||||
|
||||
if (error)
|
||||
if (error != 0)
|
||||
{
|
||||
http->error = error;
|
||||
http->status = HTTP_ERROR;
|
||||
|
||||
SSLDisposeContext(conn->session);
|
||||
SSLDisposeContext(conn);
|
||||
|
||||
free(conn);
|
||||
close(http->fd);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
@@ -2680,11 +2359,11 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
static void
|
||||
http_shutdown_ssl(http_t *http) /* I - HTTP connection */
|
||||
http_shutdown_ssl(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
# ifdef HAVE_LIBSSL
|
||||
SSL_CTX *context; /* Context for encryption */
|
||||
SSL *conn; /* Connection for encryption */
|
||||
SSL_CTX *context; /* Context for encryption */
|
||||
SSL *conn; /* Connection for encryption */
|
||||
|
||||
|
||||
conn = (SSL *)(http->tls);
|
||||
@@ -2695,9 +2374,9 @@ http_shutdown_ssl(http_t *http) /* I - HTTP connection */
|
||||
SSL_free(conn);
|
||||
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
http_tls_t *conn; /* Encryption session */
|
||||
http_tls_t *conn; /* Encryption session */
|
||||
gnutls_certificate_client_credentials *credentials;
|
||||
/* TLS credentials */
|
||||
/* TLS credentials */
|
||||
|
||||
|
||||
conn = (http_tls_t *)(http->tls);
|
||||
@@ -2710,20 +2389,10 @@ http_shutdown_ssl(http_t *http) /* I - HTTP connection */
|
||||
free(conn);
|
||||
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
http_tls_t *conn; /* CDSA connection information */
|
||||
|
||||
|
||||
conn = (http_tls_t *)(http->tls);
|
||||
|
||||
while (SSLClose(conn->session) == errSSLWouldBlock)
|
||||
while (SSLClose((SSLContextRef)http->tls) == errSSLWouldBlock)
|
||||
usleep(1000);
|
||||
|
||||
SSLDisposeContext(conn->session);
|
||||
|
||||
if (conn->certsArray)
|
||||
CFRelease(conn->certsArray);
|
||||
|
||||
free(conn);
|
||||
SSLDisposeContext((SSLContextRef)http->tls);
|
||||
# endif /* HAVE_LIBSSL */
|
||||
|
||||
http->tls = NULL;
|
||||
@@ -2736,11 +2405,11 @@ http_shutdown_ssl(http_t *http) /* I - HTTP connection */
|
||||
* 'http_upgrade()' - Force upgrade to TLS encryption.
|
||||
*/
|
||||
|
||||
static int /* O - Status of connection */
|
||||
http_upgrade(http_t *http) /* I - HTTP connection */
|
||||
static int /* O - Status of connection */
|
||||
http_upgrade(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
int ret; /* Return value */
|
||||
http_t myhttp; /* Local copy of HTTP data */
|
||||
int ret; /* Return value */
|
||||
http_t myhttp; /* Local copy of HTTP data */
|
||||
|
||||
|
||||
DEBUG_printf(("http_upgrade(%p)\n", http));
|
||||
@@ -2757,30 +2426,43 @@ http_upgrade(http_t *http) /* I - HTTP connection */
|
||||
* encryption on the link...
|
||||
*/
|
||||
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_CONNECTION, "upgrade");
|
||||
httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.0, SSL/2.0, SSL/3.0");
|
||||
httpClearFields(&myhttp);
|
||||
httpSetField(&myhttp, HTTP_FIELD_CONNECTION, "upgrade");
|
||||
httpSetField(&myhttp, HTTP_FIELD_UPGRADE, "TLS/1.0, SSL/2.0, SSL/3.0");
|
||||
|
||||
if ((ret = httpOptions(http, "*")) == 0)
|
||||
if ((ret = httpOptions(&myhttp, "*")) == 0)
|
||||
{
|
||||
/*
|
||||
* Wait for the secure connection...
|
||||
*/
|
||||
|
||||
while (httpUpdate(http) == HTTP_CONTINUE);
|
||||
while (httpUpdate(&myhttp) == HTTP_CONTINUE);
|
||||
}
|
||||
|
||||
httpFlush(http);
|
||||
httpFlush(&myhttp);
|
||||
|
||||
/*
|
||||
* Restore the HTTP request data...
|
||||
* Copy the HTTP data back over, if any...
|
||||
*/
|
||||
|
||||
memcpy(http->fields, myhttp.fields, sizeof(http->fields));
|
||||
http->data_encoding = myhttp.data_encoding;
|
||||
http->data_remaining = myhttp.data_remaining;
|
||||
http->_data_remaining = myhttp._data_remaining;
|
||||
http->expect = myhttp.expect;
|
||||
http->fd = myhttp.fd;
|
||||
http->error = myhttp.error;
|
||||
http->activity = myhttp.activity;
|
||||
http->status = myhttp.status;
|
||||
http->version = myhttp.version;
|
||||
http->keep_alive = myhttp.keep_alive;
|
||||
http->used = myhttp.used;
|
||||
|
||||
if (http->used)
|
||||
memcpy(http->buffer, myhttp.buffer, http->used);
|
||||
|
||||
http->auth_type = myhttp.auth_type;
|
||||
http->nonce_count = myhttp.nonce_count;
|
||||
|
||||
memcpy(http->nonce, myhttp.nonce, sizeof(http->nonce));
|
||||
|
||||
http->tls = myhttp.tls;
|
||||
http->encryption = myhttp.encryption;
|
||||
|
||||
/*
|
||||
* See if we actually went secure...
|
||||
@@ -2816,8 +2498,7 @@ http_upgrade(http_t *http) /* I - HTTP connection */
|
||||
|
||||
static int /* O - 1 if data is available, 0 otherwise */
|
||||
http_wait(http_t *http, /* I - HTTP connection */
|
||||
int msec, /* I - Milliseconds to wait */
|
||||
int usessl) /* I - Use SSL context? */
|
||||
int msec) /* I - Milliseconds to wait */
|
||||
{
|
||||
#ifndef WIN32
|
||||
struct rlimit limit; /* Runtime limit */
|
||||
@@ -2837,7 +2518,7 @@ http_wait(http_t *http, /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (http->tls && usessl)
|
||||
if (http->tls)
|
||||
{
|
||||
# ifdef HAVE_LIBSSL
|
||||
if (SSL_pending((SSL *)(http->tls)))
|
||||
@@ -2848,7 +2529,7 @@ http_wait(http_t *http, /* I - HTTP connection */
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
size_t bytes; /* Bytes that are available */
|
||||
|
||||
if (!SSLGetBufferedReadSize(((http_tls_t *)http->tls)->session, &bytes) && bytes > 0)
|
||||
if (!SSLGetBufferedReadSize((SSLContextRef)http->tls, &bytes) && bytes > 0)
|
||||
return (1);
|
||||
# endif /* HAVE_LIBSSL */
|
||||
}
|
||||
@@ -2891,8 +2572,6 @@ http_wait(http_t *http, /* I - HTTP connection */
|
||||
{
|
||||
FD_SET(http->fd, http->input_set);
|
||||
|
||||
DEBUG_printf(("http_wait: msec=%d, http->fd=%d\n", msec, http->fd));
|
||||
|
||||
if (msec >= 0)
|
||||
{
|
||||
timeout.tv_sec = msec / 1000;
|
||||
@@ -2902,8 +2581,6 @@ http_wait(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
else
|
||||
nfds = select(http->fd + 1, http->input_set, NULL, NULL, NULL);
|
||||
|
||||
DEBUG_printf(("http_wait: select() returned %d...\n", nfds));
|
||||
}
|
||||
#ifdef WIN32
|
||||
while (nfds < 0 && WSAGetLastError() == WSAEINTR);
|
||||
@@ -2913,8 +2590,6 @@ http_wait(http_t *http, /* I - HTTP connection */
|
||||
|
||||
FD_CLR(http->fd, http->input_set);
|
||||
|
||||
DEBUG_printf(("http_wait: returning with nfds=%d...\n", nfds));
|
||||
|
||||
return (nfds > 0);
|
||||
}
|
||||
|
||||
@@ -3027,7 +2702,7 @@ http_write_chunk(http_t *http, /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
sprintf(header, "%x\r\n", length);
|
||||
if (http_write(http, header, (int)strlen(header)) < 0)
|
||||
if (http_write(http, header, strlen(header)) < 0)
|
||||
{
|
||||
DEBUG_puts(" http_write of length failed!");
|
||||
return (-1);
|
||||
@@ -3070,7 +2745,7 @@ http_write_ssl(http_t *http, /* I - HTTP connection */
|
||||
size_t processed; /* Number of bytes processed */
|
||||
|
||||
|
||||
error = SSLWrite(((http_tls_t *)http->tls)->session, buf, len, &processed);
|
||||
error = SSLWrite((SSLContextRef)http->tls, buf, len, &processed);
|
||||
|
||||
switch (error)
|
||||
{
|
||||
|
||||
+5
-22
@@ -4,7 +4,7 @@
|
||||
* Hyper-Text Transport Protocol definitions for the Common UNIX Printing
|
||||
* System (CUPS).
|
||||
*
|
||||
* 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 Easy Software Products and are protected by Federal
|
||||
@@ -36,16 +36,11 @@
|
||||
# include <time.h>
|
||||
# include <sys/types.h>
|
||||
# ifdef WIN32
|
||||
# ifndef __CUPS_SSIZE_T_DEFINED
|
||||
# define __CUPS_SSIZE_T_DEFINED
|
||||
/* Windows does not support the ssize_t type, so map it to off_t... */
|
||||
typedef off_t ssize_t; /* @private@ */
|
||||
# endif /* !__CUPS_SSIZE_T_DEFINED */
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
# else
|
||||
# ifdef __sgi
|
||||
# define INET6 /* IRIX IPv6 support... */
|
||||
# ifdef __sgi /* IRIX needs this for IPv6 support!?! */
|
||||
# define INET6
|
||||
# endif /* __sgi */
|
||||
# include <unistd.h>
|
||||
# include <sys/time.h>
|
||||
@@ -58,9 +53,6 @@ typedef off_t ssize_t; /* @private@ */
|
||||
# if !defined(__APPLE__) || !defined(TCP_NODELAY)
|
||||
# include <netinet/tcp.h>
|
||||
# endif /* !__APPLE__ || !TCP_NODELAY */
|
||||
# if defined(AF_UNIX) && !defined(AF_LOCAL)
|
||||
# define AF_LOCAL AF_UNIX /* Older UNIX's have old names... */
|
||||
# endif /* AF_UNIX && !AF_LOCAL */
|
||||
# ifdef AF_LOCAL
|
||||
# include <sys/un.h>
|
||||
# endif /* AF_LOCAL */
|
||||
@@ -106,7 +98,7 @@ extern "C" {
|
||||
#if defined(AF_INET6) && !defined(s6_addr32)
|
||||
# if defined(__sun)
|
||||
# define s6_addr32 _S6_un._S6_u32
|
||||
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
|
||||
# elif defined(__FreeBSD__) || defined(__APPLE__)
|
||||
# define s6_addr32 __u6_addr.__u6_addr32
|
||||
# elif defined(__osf__)
|
||||
# define s6_addr32 s6_un.sa6_laddr
|
||||
@@ -147,8 +139,7 @@ typedef enum http_auth_e /**** HTTP authentication types ****/
|
||||
typedef enum http_encoding_e /**** HTTP transfer encoding values ****/
|
||||
{
|
||||
HTTP_ENCODE_LENGTH, /* Data is sent with Content-Length */
|
||||
HTTP_ENCODE_CHUNKED, /* Data is chunked */
|
||||
HTTP_ENCODE_FIELDS /* Sending HTTP fields */
|
||||
HTTP_ENCODE_CHUNKED /* Data is chunked */
|
||||
} http_encoding_t;
|
||||
|
||||
typedef enum http_encryption_e /**** HTTP encryption values ****/
|
||||
@@ -331,14 +322,6 @@ typedef struct http_addrlist_s /**** Socket address list, which is
|
||||
|
||||
typedef struct _http_s /**** HTTP connection structure. ****/
|
||||
{
|
||||
/*
|
||||
* DO NOT ACCESS MEMBERS OF THIS STRUCTURE DIRECTLY; INSTEAD, USE THE
|
||||
* PROVIDED APIS FOR ACCESSING THE VALUES INSTEAD.
|
||||
*
|
||||
* This structure definition will be removed from the public headers in
|
||||
* CUPS 1.3.
|
||||
*/
|
||||
|
||||
int fd; /* File descriptor for this socket */
|
||||
int blocking; /* To block or not to block */
|
||||
int error; /* Last error on read */
|
||||
|
||||
@@ -105,7 +105,6 @@ extern const char *_cupsLangString(cups_lang_t *lang, const char *message);
|
||||
extern void _cupsMessageFree(cups_array_t *a);
|
||||
extern cups_array_t *_cupsMessageLoad(const char *filename);
|
||||
extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
|
||||
extern void _cupsSetLocale(char *argv[]);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -43,24 +43,11 @@ extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* Structures...
|
||||
*/
|
||||
|
||||
typedef struct /**** Attribute mapping data ****/
|
||||
{
|
||||
const char *name; /* Option/attribute name */
|
||||
ipp_tag_t value_tag; /* Value tag for this attribute */
|
||||
ipp_tag_t group_tag; /* Group tag for this attribute */
|
||||
} _ipp_option_t;
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes for private functions...
|
||||
*/
|
||||
|
||||
extern ipp_attribute_t *_ippAddAttr(ipp_t *, int);
|
||||
extern _ipp_option_t *_ippFindOption(const char *name);
|
||||
extern void _ippFreeAttr(ipp_attribute_t *);
|
||||
|
||||
|
||||
|
||||
@@ -304,48 +304,19 @@ ippPort(void)
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
|
||||
DEBUG_puts("ippPort()");
|
||||
|
||||
if (!cg->ipp_port)
|
||||
{
|
||||
/*
|
||||
* See if the server definition includes the port number...
|
||||
*/
|
||||
|
||||
DEBUG_puts("ippPort: Not initialized...");
|
||||
|
||||
cupsServer();
|
||||
|
||||
#ifdef DEBUG
|
||||
if (cg->ipp_port)
|
||||
puts("ippPort: Set via cupsServer()...");
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
if (!cg->ipp_port)
|
||||
{
|
||||
if ((ipp_port = getenv("IPP_PORT")) != NULL)
|
||||
{
|
||||
DEBUG_puts("ippPort: Set via IPP_PORT...");
|
||||
portnum = atoi(ipp_port);
|
||||
}
|
||||
else if ((port = getservbyname("ipp", NULL)) == NULL)
|
||||
{
|
||||
DEBUG_puts("ippPort: Set via CUPS_DEFAULT_IPP_PORT...");
|
||||
portnum = CUPS_DEFAULT_IPP_PORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_puts("ippPort: Set via ipp service entry...");
|
||||
portnum = ntohs(port->s_port);
|
||||
}
|
||||
|
||||
if (portnum > 0)
|
||||
cg->ipp_port = portnum;
|
||||
}
|
||||
|
||||
DEBUG_printf(("ippPort: Returning %d...\n", cg->ipp_port));
|
||||
|
||||
return (cg->ipp_port);
|
||||
}
|
||||
|
||||
@@ -357,8 +328,6 @@ ippPort(void)
|
||||
void
|
||||
ippSetPort(int p) /* I - Port number to use */
|
||||
{
|
||||
DEBUG_printf(("ippSetPort(p=%d)\n", p));
|
||||
|
||||
_cupsGlobals()->ipp_port = p;
|
||||
}
|
||||
|
||||
|
||||
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