Comparar commits
40 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| a215cf8413 | |||
| 4ef75dec45 | |||
| 86243a7551 | |||
| b93671244e | |||
| 5d2cc5d32d | |||
| 1a18c85cd1 | |||
| b60086f8ae | |||
| 215ef63830 | |||
| a51f28ec99 | |||
| 71f63681cb | |||
| 61515785f7 | |||
| 75efa1051d | |||
| f9d9f12690 | |||
| 7416dfe99a | |||
| dd0eea8e71 | |||
| 0c229544f4 | |||
| b3533f112d | |||
| 3b2526b366 | |||
| ba38d7d9dc | |||
| 4bdbabf76b | |||
| 64e918f26a | |||
| 111ff13a26 | |||
| f4515965b3 | |||
| c7233aabe5 | |||
| 8eabd901fe | |||
| 1d708564b3 | |||
| e5d9b5e191 | |||
| 00c4573088 | |||
| 27efcd61e0 | |||
| 06cefec35c | |||
| c2def0ced7 | |||
| e9152ac713 | |||
| 3d3f64a982 | |||
| 4ecc320364 | |||
| 60c3ee0499 | |||
| 305331a392 | |||
| 40e88e9009 | |||
| 5f19ab52fe | |||
| 4a842d5397 | |||
| 75ff7c7fea |
@@ -1,3 +0,0 @@
|
||||
.git* export-ignore
|
||||
.mailmap export-ignore
|
||||
tools export-ignore
|
||||
-149
@@ -1,149 +0,0 @@
|
||||
*.a
|
||||
*.bck
|
||||
*.cgi
|
||||
*.dylib
|
||||
*.gz
|
||||
*.o
|
||||
*.so
|
||||
*.so.*
|
||||
*.tokens
|
||||
.buildrev
|
||||
autom4te.cache
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
cups-config
|
||||
Makedefs
|
||||
backend/dnssd
|
||||
backend/http
|
||||
backend/ipp
|
||||
backend/lpd
|
||||
backend/mdns
|
||||
backend/snmp
|
||||
backend/socket
|
||||
backend/test1284
|
||||
backend/testbackend
|
||||
backend/testsupplies
|
||||
backend/usb
|
||||
berkeley/lpc
|
||||
berkeley/lpq
|
||||
berkeley/lpr
|
||||
berkeley/lprm
|
||||
cgi-bin/testcgi
|
||||
cgi-bin/testhi
|
||||
cgi-bin/testhi.index
|
||||
cgi-bin/testtemplate
|
||||
conf/cups-files.conf
|
||||
conf/cupsd.conf
|
||||
conf/mime.convs
|
||||
conf/pam.std
|
||||
conf/snmp.conf
|
||||
cups/locale/
|
||||
cups/test.pwg
|
||||
cups/testadmin
|
||||
cups/testarray
|
||||
cups/testcache
|
||||
cups/testconflicts
|
||||
cups/testcups
|
||||
cups/testdest
|
||||
cups/testfile
|
||||
cups/testhttp
|
||||
cups/testi18n
|
||||
cups/testipp
|
||||
cups/testlang
|
||||
cups/testoptions
|
||||
cups/testppd
|
||||
cups/testpwg
|
||||
cups/testsnmp
|
||||
cups/tlscheck
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
filter/commandtops
|
||||
filter/gziptoany
|
||||
filter/pstops
|
||||
filter/rasterbench
|
||||
filter/rastertoepson
|
||||
filter/rastertohp
|
||||
filter/rastertolabel
|
||||
filter/rastertopwg
|
||||
filter/test.raster
|
||||
filter/testraster
|
||||
locale/checkpo
|
||||
locale/po2strings
|
||||
locale/strings2po
|
||||
man/client.conf.man
|
||||
man/cups-files.conf.man
|
||||
man/cups-lpd.man
|
||||
man/cups-snmp.man
|
||||
man/cupsaddsmb.man
|
||||
man/cupsd.conf.man
|
||||
man/cupsd.man
|
||||
man/lpoptions.man
|
||||
man/mantohtml
|
||||
monitor/bcp
|
||||
monitor/tbcp
|
||||
notifier/mailto
|
||||
notifier/rss
|
||||
notifier/testnotify
|
||||
packaging/cups.list
|
||||
patches
|
||||
ppdc/genstrings
|
||||
ppdc/ppd/
|
||||
ppdc/ppd2/
|
||||
ppdc/ppdc
|
||||
ppdc/ppdc-static
|
||||
ppdc/ppdhtml
|
||||
ppdc/ppdi
|
||||
ppdc/ppdi-static
|
||||
ppdc/ppdmerge
|
||||
ppdc/ppdpo
|
||||
ppdc/sample-import.drv
|
||||
ppdc/sample.c
|
||||
ppdc/testcatalog
|
||||
scheduler/convert
|
||||
scheduler/cups-deviced
|
||||
scheduler/cups-driverd
|
||||
scheduler/cups-exec
|
||||
scheduler/cups-lpd
|
||||
scheduler/cups-lpd.xinetd
|
||||
scheduler/cups.sh
|
||||
scheduler/cups.xml
|
||||
scheduler/cupsd
|
||||
scheduler/cupsfilter
|
||||
scheduler/org.cups.cups-lpd.plist
|
||||
scheduler/org.cups.cups-lpdAT.service
|
||||
scheduler/org.cups.cupsd.path
|
||||
scheduler/org.cups.cupsd.service
|
||||
scheduler/org.cups.cupsd.socket
|
||||
scheduler/testlpd
|
||||
scheduler/testmime
|
||||
scheduler/testspeed
|
||||
scheduler/testsub
|
||||
systemv/accept
|
||||
systemv/cancel
|
||||
systemv/cupsaccept
|
||||
systemv/cupsaddsmb
|
||||
systemv/cupsctl
|
||||
systemv/cupsdisable
|
||||
systemv/cupsenable
|
||||
systemv/cupsreject
|
||||
systemv/cupstestdsc
|
||||
systemv/cupstestppd
|
||||
systemv/lp
|
||||
systemv/lpadmin
|
||||
systemv/lpinfo
|
||||
systemv/lpmove
|
||||
systemv/lpoptions
|
||||
systemv/lpstat
|
||||
systemv/reject
|
||||
templates/header.tmpl
|
||||
test/cups-str-*.html
|
||||
test/error_log-*
|
||||
test/ippfind
|
||||
test/ippfind-static
|
||||
test/ippserver
|
||||
test/ipptool
|
||||
test/ipptool-static
|
||||
xcode/CUPS.xcodeproj/project.xcworkspace/
|
||||
xcode/CUPS.xcodeproj/xcuserdata/
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
# Prevent git from showing duplicate names with commands like "git shortlog"
|
||||
# See the manpage of git-shortlog for details.
|
||||
# The syntax is:
|
||||
# Name that should be used <email that should be used> Bad name <bad email>
|
||||
#
|
||||
# You can skip Bad name if it is the same as the one that should be used, and is unique.
|
||||
#
|
||||
# This file is up-to-date if the command git log --format="%aN <%aE>" | sort -u
|
||||
# gives no duplicates.
|
||||
Michael R Sweet <michaelrsweet@gmail.com> msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
|
||||
Michael R Sweet <michaelrsweet@gmail.com> Michael Sweet <msweet@msweet-imac.local>
|
||||
@@ -1,215 +0,0 @@
|
||||
CHANGES-2.0.txt
|
||||
---------------
|
||||
|
||||
CHANGES IN CUPS V2.0.4
|
||||
|
||||
- Fixed a bug in cupsRasterWritePixels (STR #4650)
|
||||
- Fixed redirection in the web interface (STR #4538)
|
||||
- The IPP backend did not respond to side-channel requests (STR #4645)
|
||||
- The scheduler did not start all pending jobs at once (STR #4646)
|
||||
- The web search incorrectly searched time-at-xxx values (STR #4652)
|
||||
- Fixed an RPM spec file issue (STR #4657)
|
||||
- The scheduler incorrectly started jobs while canceling multiple jobs
|
||||
(STR #4648)
|
||||
- Fixed processing of server overrides without port numbers (STR #4675)
|
||||
- Documentation changes (STR #4651, STR #4674)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.3
|
||||
|
||||
- Security: Fixed CERT VU #810572 exploiting the dynamic linker
|
||||
(STR #4609)
|
||||
- Security: The scheduler could hang with malformed gzip data
|
||||
(STR #4602)
|
||||
- Restored missing generic printer icon file (STR #4587)
|
||||
- Fixed logging of configuration errors to show up as errors (STR #4582)
|
||||
- Fixed potential buffer overflows in raster code and filters
|
||||
(STR #4598, STR #4599, STR #4600, STR #4601)
|
||||
- Fixed a gzip processing bug (#4602)
|
||||
- Fixed <Limit> inside <Location> (STR #4575)
|
||||
- Fixed lpadmin when both -m and -o are used (STR #4578)
|
||||
- The web interface always showed support for 2-sided printing
|
||||
(STR #4595)
|
||||
- cupsRasterReadHeader did not fully validate the raster header
|
||||
(STR #4596)
|
||||
- The rastertopwg filter did not check for truncated input (STR #4597)
|
||||
- The cups-lpd mini-daemon did not check for request parameters
|
||||
(STR #4603)
|
||||
- The scheduler could get caught in a busy loop (STR #4605)
|
||||
- The sample Epson driver could crash (STR #4616)
|
||||
- The IPP backend now correctly monitors jobs
|
||||
(<rdar://problem/20495955>)
|
||||
- The ppdhtml and ppdpo utilities crashed when the -D option was used
|
||||
before a driver information file (STR #4627)
|
||||
- ippfind incorrectly substituted "=port" for service_port.
|
||||
- The IPP/1.1 test file did not handle the initial print job
|
||||
completing early (STR #4576)
|
||||
- Fixed a memory leak in cupsConnectDest (STR #4634)
|
||||
- PWG Raster Format output contained invalid ImageBox values
|
||||
(<rdar://problem/21144309>)
|
||||
- Added Russian translation (STR #4577)
|
||||
- Added German translation (STR #4635)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.2
|
||||
|
||||
- Security: cupsRasterReadPixels buffer overflow with invalid page
|
||||
header and compressed raster data (STR #4551)
|
||||
- Command-line programs were not localized on Mac OS X
|
||||
(<rdar://problem/14546232>)
|
||||
- The scheduler incorrectly cleared the MakeModel string in the
|
||||
printers.conf file after a restart (<rdar://problem/16827518>)
|
||||
- CUPS did not compile with older versions of GNU TLS (STR #4527)
|
||||
- CUPS did not compile without Avahi or mDNSResponder (STR #4523)
|
||||
- ippLength() did not return the correct length for IPP_TAG_CONST
|
||||
string values.
|
||||
- The scheduler incorrectly aborted jobs after a job was restarted
|
||||
(<rdar://problem/19129387>)
|
||||
- The cups-files.conf file contained the old ServerCertificate/Key
|
||||
directives instead of ServerKeychain.
|
||||
- Fixed builds when no SSL/TLS library is available, or when explicitly
|
||||
disabled (STR #4531)
|
||||
- Fixed an OpenBSD charset transcoding issue.
|
||||
- Fixed USB printing on OpenBSD (STR #4525)
|
||||
- The --without-xinetd configure option did not work (STR #4542)
|
||||
- Backends needing to load OS X kernel extensions did not work
|
||||
(<rdar://problem/19015679>)
|
||||
- Mapping of PPD keywords to IPP keywords did not work if the PPD
|
||||
keyword was already an IPP keyword (<rdar://problem/19121005>)
|
||||
- cupsGetPPD* sent bad requests (STR #4567)
|
||||
- ippserver used the wrong temporary directory on Windows (STR #4547)
|
||||
- ippserver did not handle Bonjour registrations properly (STR #4548)
|
||||
- The scheduler could crash during shutdown if Avahi was shutdown
|
||||
first (STR #4550)
|
||||
- Added a USB quirk rule for Intermec printers (STR #4553)
|
||||
- The scheduler did not always log which configuration file had the
|
||||
error (STR #4559)
|
||||
- The ippfind and ipptool programs now correctly match hostnames with
|
||||
trailing dots (STR #4563)
|
||||
- The ipptool timeout option did not work (STR #4515)
|
||||
- Fixed several issues with client.conf, CUPS_SERVER, and the "-h"
|
||||
option of most commands (STR #4528)
|
||||
- Another change for OpenBSD (STR #4526)
|
||||
- Added Japanese localization (STR #4524)
|
||||
- Documentation changes (STR #4569)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.1
|
||||
|
||||
- Security: SSLv3 is now disabled by default to protect against the
|
||||
POODLE attack (STR #4476)
|
||||
- Printer sharing did not work when systemd was being used (STR #4497)
|
||||
- cupsGetPPD* would return a symlink to the PPD in /etc/cups/ppd even if
|
||||
it was not readable by the user (STR #4500)
|
||||
- The web interface now protects against frame "click-jacking" attacks
|
||||
(STR #4492)
|
||||
- Fixed a crash in ippAttributeString (<rdar://problem/17903871>)
|
||||
- Fixed a crash in the scheduler on Linux/*BSD if colord was not running
|
||||
(STR #4496)
|
||||
- Fixed a random crash in the scheduler when not using systemd
|
||||
(STR #4484)
|
||||
- Added systemd support for cups-lpd (STR #4493)
|
||||
- The scheduler did not honor the FatalErrors directive for mis-
|
||||
configured Group and SystemGroup values (STR #4495)
|
||||
- The network backends no longer report waste-receptacle conditions when
|
||||
using SNMP (STR #4499)
|
||||
- The IPP backend did not work with some configurations of Windows
|
||||
(STR #4503)
|
||||
- RPMs did not build (STR #4490)
|
||||
- Added a USB quirk rule for the Brother HL-1250 (STR #4519)
|
||||
- Fixed compiles on unsupported platforms (STR #4510)
|
||||
- "cancel -a" did not cancel all jobs on all destinations (STR #4513)
|
||||
- The web interface did not work on OpenBSD (STR #4496)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.0
|
||||
|
||||
- The scheduler did not preserve listener sockets from launchd or
|
||||
systemd after a restart (<rdar://problem/18112848>)
|
||||
- Added some USB quirk rules for the libusb-based USB backend
|
||||
(STR #4482)
|
||||
- Spanish localization update (STR #4487)
|
||||
- Updated documentation for 2.0.0 release.
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0rc1
|
||||
|
||||
- Documentation updates (STR #4464)
|
||||
- The scheduler now monitors the AC power status on OS X, allowing for
|
||||
"sleep printing" when sharing printers (<rdar://problem/17325852>)
|
||||
- The scheduler incorrectly called launch_activate_socket multiple times
|
||||
on OS X (<rdar://problem/17523218>)
|
||||
- The ippserver test program now passes the IPP Everywhere self-
|
||||
certification tests (STR #4101)
|
||||
- Relaxed the new OS X filter sandbox slightly (STR #4471,
|
||||
<rdar://problem/17483959>)
|
||||
- Dropped the old Epson Stylus Color/Photo sample drivers since they
|
||||
don't work with any current printers and there are free alternatives
|
||||
that produce much better output (<rdar://problem/18036889>)
|
||||
- Log and configuration files that are not world-readable are again
|
||||
accessible via the web interface (STR #4461)
|
||||
- PPD files are now created using the permissions specified by the
|
||||
ConfigFilePerm directive.
|
||||
- Fixed RPM build issues (STR #4459)
|
||||
- Fixed the spinner image and restart page when reconfiguring the
|
||||
scheduler through the web interface (STR #4475)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0b1
|
||||
|
||||
- Added a "--list-filters" option to the cupsfilter command (STR #4325)
|
||||
- Added systemd support (STR #3917)
|
||||
- Added support for re-sending a job as a raster file if a higher-level
|
||||
format such as PDF fails (<rdar://problem/15583721>)
|
||||
- Added support for regular expression matching in the MIME type rules
|
||||
(<rdar://problem/11131245>)
|
||||
- Added support for TLS certificate validation and policy enforcement
|
||||
(STR #1616)
|
||||
- Added support for simultaneous XML and test output from ipptool.
|
||||
- Added support for PAUSE directive in ipptool test files.
|
||||
- Added support for auto-typing of TIFF files by ipptool (STR #4418)
|
||||
- The scheduler now returns completed jobs in the correct newest-to-
|
||||
oldest order (STR #4396)
|
||||
- The configure script now supports target-specific tools for pkg-config
|
||||
and others (STR #4423)
|
||||
- The ipptool program now supports EXPECT statements for collection
|
||||
member attributes (<rdar://problem/15355218>)
|
||||
- The ipptool program now supports collection attributes with multiple
|
||||
values (<rdar://problem/15355124>)
|
||||
- The sample drivers now include all of the installed localizations by
|
||||
default (<rdar://problem/14756625>)
|
||||
- Adopted Linux man page conventions and updated all man pages
|
||||
(STR #4372, STR #4329)
|
||||
- The scheduler now supports the "first-index" operation attribute for
|
||||
the Get-Jobs operation (STR #2913)
|
||||
- Changed the default AccessLogLevel and PageLogFormat to disable the
|
||||
access_log and page_log files by default (<rdar://problem/16495000>)
|
||||
- cupsRasterInterpretPPD now supports the Orientation header in order to
|
||||
support long-edge feed raster printers (<rdar://problem/15837926>)
|
||||
- The scheduler now allows run-as-root backends to have group read and
|
||||
execute permissions (STR #2935)
|
||||
- The ippFindAttribute and ippFindNextAttribute functions now support
|
||||
hierarchical searches (STR #4395)
|
||||
- Dropped OpenSSL support in favor of GNU TLS.
|
||||
- Dropped "dark wake" support on OS X, which was preventing portables
|
||||
from going to sleep when there was a stuck job. We now use a variation
|
||||
of the CUPS 1.4 sleep support to do a cleaner sleep
|
||||
(<rdar://problem/14323704>)
|
||||
- Dropped support for AIX, HP-UX, and OSF/1 (aka Digital UNIX)
|
||||
- Dropped lppasswd and support for Digest authentication in in the
|
||||
scheduler (STR #4321)
|
||||
- The cupsGetClasses, cupsGetPrinters, and cupsTempFile functions are no
|
||||
longer supported.
|
||||
- The scheduler now caches more job history data and limits the number
|
||||
of completed jobs returned by Get-Jobs as needed in order to prevent a
|
||||
denial-of-service on busy servers (STR #2913)
|
||||
- The filter/backend sandbox on OS X now defaults to a more strict
|
||||
whitelist (<rdar://problem/15939788>)
|
||||
- Increased the default idle exit timeout to 60 seconds on OS X
|
||||
(<rdar://problem/16041820>)
|
||||
- Printer classes were not accessible on OS X
|
||||
(<rdar://problem/16385643>)
|
||||
- The scheduler now uses </DefaultPrinter> to close the default printer
|
||||
definition in printers.conf (STR #4153)
|
||||
- Canceling all jobs in the web interface now just cancels the jobs
|
||||
(STR #1914)
|
||||
@@ -1,150 +0,0 @@
|
||||
CHANGES-2.1.txt
|
||||
---------------
|
||||
|
||||
CHANGES IN CUPS V2.1.4
|
||||
|
||||
- Fixed reporting of 1284 Device IDs (Issue #3835, PR #3836)
|
||||
- Fixed printing of multiple files to raw queues (Issue #4782)
|
||||
- The scheduler did not implement the Hold-New-Jobs opertion correctly
|
||||
(Issue #4767)
|
||||
- The ipptool program truncated values at 8k (Issue #4786)
|
||||
- The ipptool program did not correctly report uriScheme values in plist
|
||||
output (Issue #4785)
|
||||
- The cups-lpd mini-daemon incorrectly included the document-name
|
||||
attribute when creating a job. It should only be included when
|
||||
sending a job (Issue #4790)
|
||||
- USB quirk updates (Issue #4778, Issue #4789)
|
||||
- Documentation update (Issue #4772)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1.3
|
||||
|
||||
- The default password function did not work on some platforms
|
||||
(Issue #4750)
|
||||
- The scheduler should not exit under memory pressure
|
||||
(<rdar://problem/23255001>)
|
||||
- The EPL2 and ZPL sample drivers did not properly support the CutMedia
|
||||
option.
|
||||
- Pending subscriptions would prevent the scheduler from idle exiting
|
||||
(Issue #4754)
|
||||
- Fixed some issues in ipptool for skipped tests
|
||||
(<rdar://problem/24137160>)
|
||||
- The "lp -H resume" command did not reset the "job-state-reasons"
|
||||
attribute value (Issue #4752)
|
||||
- cupsEncodeOptions2 incorrectly handled escaped values
|
||||
(<rdar://problem/19736672>)
|
||||
- The scheduler did not allow access to resource files (icons, etc.)
|
||||
when the web interface was disabled (Issue #4755)
|
||||
- Localization fix (Issue #4756)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1.2
|
||||
|
||||
- Re-release of CUPS 2.1.1 as CUPS 2.1.2 due to error in tagging of the
|
||||
2.1.1 release (pulled content from the 2.2.x tree instead)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1.1
|
||||
|
||||
- Security hardening fixes (<rdar://problem/23131948>,
|
||||
<rdar://problem/23132108>, <rdar://problem/23132353>,
|
||||
<rdar://problem/23132803>, <rdar://problem/23133230>,
|
||||
<rdar://problem/23133393>, <rdar://problem/23133466>,
|
||||
<rdar://problem/23133833>, <rdar://problem/23133998>,
|
||||
<rdar://problem/23134228>, <rdar://problem/23134299>,
|
||||
<rdar://problem/23134356>, <rdar://problem/23134415>,
|
||||
<rdar://problem/23134506>, <rdar://problem/23135066>,
|
||||
<rdar://problem/23135122>, <rdar://problem/23135207>,
|
||||
<rdar://problem/23144290>, <rdar://problem/23144358>,
|
||||
<rdar://problem/23144461>)
|
||||
- The cupsGetPPD* functions did not work with IPP printers (Issue #4725)
|
||||
- Some older HP LaserJet printers need a delayed close when printing
|
||||
using the libusb-based USB backend (Issue #4549)
|
||||
- The libusb-based USB backend did not unload the kernel usblp module
|
||||
if it was preventing the backend from accessing the printer
|
||||
(Issue #4707)
|
||||
- Current Primera printers were incorrectly reported as Fargo printers
|
||||
(Issue #4708)
|
||||
- The IPP backend did not always handle jobs getting canceled at the
|
||||
printer (<rdar://problem/22716820>)
|
||||
- Scheduler logging change (Issue #4728)
|
||||
- Added USB quirk for Canon MP530 (Issue #4730)
|
||||
- The scheduler did not deliver job notifications for jobs submitted to
|
||||
classes (Issue #4733)
|
||||
- Changing the printer-is-shared value for a remote queue did not
|
||||
produce an error (Issue #4738)
|
||||
- The IPP backend incorrectly included the job-password attribute in
|
||||
Validate-Job requests (<rdar://problem/23531939>)
|
||||
- Updated localizations (Issue #4709)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1.0
|
||||
|
||||
- Fixed more scheduler crash bugs in the new logging code (Issue #4687,
|
||||
Issue #4690)
|
||||
- The scheduler did not use the ConfigFilePerm setting when copying PPD
|
||||
files or interface scripts attached to a request (Issue #4703)
|
||||
- Now support new Chinese locale IDs and their correct fallback locales
|
||||
(<rdar://problem/22086642>, <rdar://problem/22130168>)
|
||||
- "make check" incorrectly reported an expectation of 18 warning
|
||||
messages when 8 were expected (Issue #4684)
|
||||
- The new PDF file type rule did not work (Issue #4692)
|
||||
- The scheduler did not update the jobs.cache file when job files were
|
||||
expired (Issue #4706)
|
||||
- Fixed some configure script issues (Issue #4694, Issue #4695, Issue #4698)
|
||||
- Documentation updates (Issue #4691, Issue #4693)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1rc1
|
||||
|
||||
- Added support for 3D printers (basic types only, no built-in filters)
|
||||
based on PWG white paper.
|
||||
- Fixed bugs in the new journald support (Issue #4655, Issue #4658,
|
||||
Issue #4661)
|
||||
- Fixed domain socket support on Linux (Issue #4679)
|
||||
- Fixed signal handlers in the dnssd and usb backends (Issue #4671)
|
||||
- <Limit All> in <Policy> sections now applies to all operations when
|
||||
used by itself (Issue #4659)
|
||||
- Configure script changes for systemd support (Issue #4669)
|
||||
- Updated autoconf sources to use newer form of AC_INIT (Issue #4664)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1b1
|
||||
|
||||
- Improved speed of ppdMarkDefaults for complex/large PPDs
|
||||
(<rdar://problem/15146999>)
|
||||
- The IPP backend now stops sending print data if the printer indicates
|
||||
the job has been aborted or canceled (<rdar://problem/17837631>)
|
||||
- The IPP backend now sends the job-pages-per-set attribute when
|
||||
printing multiple copy jobs with finishings
|
||||
(<rdar://problem/16792757>)
|
||||
- The IPP backend now updates the cupsMandatory values when the printer
|
||||
configuration changes (<rdar://problem/18126570>)
|
||||
- No longer install banner files since third-party banner filters now
|
||||
supply their own (Issue #4518)
|
||||
- Added support for EXPECT-ALL directive in ipptool test files
|
||||
(Issue #4469)
|
||||
- Added support for WITH-VALUE-FROM predicate in ipptool test files
|
||||
(Issue #4470)
|
||||
- The scheduler no longer listens on the loopback interface unless the
|
||||
web interface or printer sharing are enabled
|
||||
(<rdar://problem/9136448>)
|
||||
- Added a PPD generator for IPP Everywhere printers (Issue #4258)
|
||||
- Now install "default" versions of more configuration files
|
||||
(<rdar://problem/19024491>)
|
||||
- The cupstestppd program did not handle "maxsize(nnn)" entries in
|
||||
cupsFilter/cupsFilter2 values (<rdar://problem/18974858>)
|
||||
- The scheduler now checks the return value of rename() calls
|
||||
(Issue #4589)
|
||||
- The scheduler now validates ErrorPolicy values in config files
|
||||
(Issue #4591)
|
||||
- Long cookies caused the web interface to stop working (Issue #4619)
|
||||
- Added SSLOptions values to allow Diffie-Hellman key exchange and
|
||||
disable TLS/1.0 support.
|
||||
- Updated the scheduler to support more IPP Everywhere attributes
|
||||
(Issue #4630)
|
||||
- The scheduler now supports advanced ASL and journald logging when
|
||||
"syslog" output is configured (Issue #4474)
|
||||
- The scheduler now supports logging to stderr when running in the
|
||||
foreground (Issue #4505)
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
CHANGES-IPPTOOL.txt - 2015-05-15
|
||||
--------------------------------
|
||||
|
||||
This file provides a list of changes to the ipptool binary distribution posted
|
||||
on CUPS.org.
|
||||
|
||||
2014-05-15
|
||||
|
||||
- Added support for simultaneous XML and test output from ipptool.
|
||||
- Added support for PAUSE directive in ipptool test files.
|
||||
|
||||
|
||||
2013-07-15
|
||||
|
||||
- New ippfind tool now included with ipptool.
|
||||
- Added support for automatically extending the timeout when all of the
|
||||
request data has not yet been written (all platforms but Windows
|
||||
which does not support it...)
|
||||
- Fixed several ipptool test files that used old STATUS names.
|
||||
|
||||
|
||||
2013-04-18
|
||||
|
||||
- Fixed some HTTP issues with authentication and compression.
|
||||
- The IPP/1.1 test file did not allow for sufficient retries when
|
||||
printing.
|
||||
- The IPP/1.1 test file did not allow for empty printer-name values.
|
||||
- The IPP Everywhere test file contained numerous errors.
|
||||
- The color.jpg test file used a progressive mode instead of the
|
||||
baseline JPEG mode.
|
||||
- The IPP/1.1 test file referenced "color.jpeg" instead of "color.jpg".
|
||||
|
||||
|
||||
2013-01-31
|
||||
|
||||
- Added support for DEFINE-MATCH and DEFINE-NO-MATCH as STATUS
|
||||
predicates.
|
||||
- Added support for WITH-VALUE and resolution values.
|
||||
- Added support for SKIP-IF-MISSING (skip test if file is missing)
|
||||
- Added support for octetString values.
|
||||
- Added support for document compression in Print-Job and Send-Document
|
||||
requests.
|
||||
- Fixed REPEAT-MATCH for STATUS and EXPECT - was incorrectly erroring
|
||||
out.
|
||||
- Fixed a bug where bad IPP responses would cause ipptool to crash.
|
||||
|
||||
|
||||
2012-02-28
|
||||
|
||||
- Changed behavior of WITH-VALUES "/regex/" to not require all values to
|
||||
match.
|
||||
- Added WITH-ALL-VALUES directive for EXPECT predicates that require all
|
||||
values to match.
|
||||
- Updated test files to use WITH-ALL-VALUES where necessary.
|
||||
- Updated test files to use new ABNF for media names from PWG Media
|
||||
Names 2.0.
|
||||
|
||||
|
||||
2012-02-06
|
||||
|
||||
- Fixed the packaging of ipptool on Windows (removed unnecessary DLLs)
|
||||
- Fixed an crash in ipptool when mixing DISPLAY with -I and a failed
|
||||
request.
|
||||
- Added a Print-Job test file.
|
||||
- Added a "setdebug" batch file for Windows
|
||||
- Added support for a CUPS_DISABLE_ASYNC_CONNECT environment variable.
|
||||
|
||||
|
||||
2012-01-10
|
||||
|
||||
- Fixed an issue with the IPP/1.1 test file where the "waiting for job
|
||||
completion" test did not work.
|
||||
- The attribute groups out of order error was not shown for the
|
||||
operation-attributes-tag group.
|
||||
|
||||
|
||||
2011-12-02
|
||||
|
||||
- Fixed a truncated XML output bug that would happen for certain errors.
|
||||
- Fixed the order-of-groups tests.
|
||||
- Fixed "WITH-VALUE >N" for rangeOfInteger attributes.
|
||||
- The Windows installer was missing the get-printer-attributes.test
|
||||
file.
|
||||
- The Linux binaries are now compiled for all LSB 4.x-compliant Linux
|
||||
distributions.
|
||||
- The Linux binaries no longer support SSL or TLS.
|
||||
|
||||
|
||||
2011-10-05
|
||||
|
||||
- Fixed a crasher bug that showed up on Windows.
|
||||
- The IPP/1.1 test would hang if the initial Print-Job test failed.
|
||||
- Fixed a typo in the IPP/2.0 test.
|
||||
|
||||
|
||||
2011-10-03
|
||||
|
||||
- Using OF-TYPE with the "no-value" or "unknown" out-of-band value tags
|
||||
now works without special WITH-VALUE strings.
|
||||
- ipptool now shows an error when an attribute appears more than once
|
||||
within the same attribute group.
|
||||
- ipptool did not display attributes as specified by the DISPLAY
|
||||
directive when a test error failed.
|
||||
- Fixed one spot where DEFINE-VALUE was still treated as an error when
|
||||
the EXPECT test failed.
|
||||
- uriScheme values were not displayed properly.
|
||||
- Updated the IPP/1.1 tests to properly validate support for
|
||||
job-hold-until-default and job-hold-until-supported when the Hold-Job
|
||||
operation is supported.
|
||||
- Updated the IPP/1.1 tests to properly check for the various standard
|
||||
media sizes for the printing tests.
|
||||
- Updated the IPP/1.1 tests to accept "no-value" for media-default an
|
||||
orientation-requested-default.
|
||||
- Updated the IPP/1.1 tests to accept "unknown" for job-state.
|
||||
- Updated the IPP/1.1 tests to not perform the bogus URI printing tests
|
||||
unless the "document-uri" variable is defined.
|
||||
- Updated the IPP/2.0 tests to properly validate media-col
|
||||
"media-xxx-supported" attributes.
|
||||
- Updated the IPP/2.2 tests to properly validate media-ready and
|
||||
media-col-ready.
|
||||
|
||||
|
||||
2011-09-28
|
||||
|
||||
- Test output now includes a summary and overall score at the end.
|
||||
- The MATCH-VALUE predicate now correctly deals with a failed EXPECT
|
||||
condition.
|
||||
- The IPP/1.1 test suite now looks for legacy media names and uses them
|
||||
if the corresponding PWG standard names are not present.
|
||||
- The IPP/1.1 test suite now tests the Print-Job+Release-Job when the
|
||||
printer supports the job-hold-until attribute, Hold-Job operation, and
|
||||
Release-Job operation.
|
||||
|
||||
|
||||
2011-09-21
|
||||
|
||||
- Fixes for HTTP chunking, timeout, and encryption issues reported by
|
||||
various users.
|
||||
- Greatly improved IPP tests with added IPP/2.2 tests.
|
||||
- New test documents - 1-page and 4-page mixed A4/Letter PDF/PS and a
|
||||
couple JPEGs.
|
||||
- New REPEAT directives to programmatically repeat tests as needed.
|
||||
|
||||
|
||||
2011-08-16
|
||||
|
||||
- The Windows version no longer requires Visual Studio to be installed.
|
||||
- The Windows version now supports SSL.
|
||||
- Added "ipps" URI support.
|
||||
- Added a new "-T" option.
|
||||
- Added support for fractional seconds for the -i option and DELAY
|
||||
directive.
|
||||
- Added support for authentication.
|
||||
- Added DEFINE-MATCH, DEFINE-NO-MATCH, DEFINE-VALUE, IF-NOT-DEFINED,
|
||||
IGNORE-ERRORS, SKIP-IF-DEFINED, SKIP-IF-NOT-DEFINED,
|
||||
SKIP-PREVIOUS-ERROR directives.
|
||||
- WITH-VALUE now supports variable expansion.
|
||||
- Updated the IPP/1.1 conformance test to skip the "my-jobs different
|
||||
user" test if the printer URI contains a username.
|
||||
- Updated the IPP conformance tests to validate media, media-default,
|
||||
and media-supported values.
|
||||
- No longer error out if a Printer returns a different version number in
|
||||
the response when the request contains the version 0.0.
|
||||
|
||||
|
||||
2010-10-16
|
||||
|
||||
- Initial release of standalone binary.
|
||||
+195
-45
@@ -1,51 +1,201 @@
|
||||
CHANGES.txt - 2.2b2 - 2016-06-24
|
||||
CHANGES.txt - 2.0.3 - 2015-06-08
|
||||
--------------------------------
|
||||
|
||||
CHANGES IN CUPS V2.2b2
|
||||
CHANGES IN CUPS V2.0.3
|
||||
|
||||
- Added Upstart support (PR #4825)
|
||||
- CUPS now supports Let's Encrypt certificates on Linux.
|
||||
- Security: Fixed CERT VU #810572 exploiting the dynamic linker
|
||||
(STR #4609)
|
||||
- Security: The scheduler could hang with malformed gzip data
|
||||
(STR #4602)
|
||||
- Restored missing generic printer icon file (STR #4587)
|
||||
- Fixed logging of configuration errors to show up as errors (STR #4582)
|
||||
- Fixed potential buffer overflows in raster code and filters
|
||||
(STR #4598, STR #4599, STR #4600, STR #4601)
|
||||
- Fixed a gzip processing bug (#4602)
|
||||
- Fixed <Limit> inside <Location> (STR #4575)
|
||||
- Fixed lpadmin when both -m and -o are used (STR #4578)
|
||||
- The web interface always showed support for 2-sided printing
|
||||
(STR #4595)
|
||||
- cupsRasterReadHeader did not fully validate the raster header
|
||||
(STR #4596)
|
||||
- The rastertopwg filter did not check for truncated input (STR #4597)
|
||||
- The cups-lpd mini-daemon did not check for request parameters
|
||||
(STR #4603)
|
||||
- The scheduler could get caught in a busy loop (STR #4605)
|
||||
- The sample Epson driver could crash (STR #4616)
|
||||
- The IPP backend now correctly monitors jobs
|
||||
(<rdar://problem/20495955>)
|
||||
- The ppdhtml and ppdpo utilities crashed when the -D option was used
|
||||
before a driver information file (STR #4627)
|
||||
- ippfind incorrectly substituted "=port" for service_port.
|
||||
- The IPP/1.1 test file did not handle the initial print job
|
||||
completing early (STR #4576)
|
||||
- Fixed a memory leak in cupsConnectDest (STR #4634)
|
||||
- PWG Raster Format output contained invalid ImageBox values
|
||||
(<rdar://problem/21144309>)
|
||||
- Added Russian translation (STR #4577)
|
||||
- Added German translation (STR #4635)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2b1
|
||||
CHANGES IN CUPS V2.0.2
|
||||
|
||||
- All CUPS commands now support POSIX options (Issue #4813)
|
||||
- The scheduler now restarts faster (Issue #4760)
|
||||
- Improved performance of web interface with large numbers of jobs
|
||||
(Issue #3819)
|
||||
- Encrypted printing can now be limited to only trusted printers and
|
||||
servers (<rdar://problem/25711658>)
|
||||
- The scheduler now advertises PWG Raster attributes for IPP Everywhere
|
||||
clients (Issue #4428)
|
||||
- The scheduler now logs informational messages for jobs at LogLevel
|
||||
"info" (Issue #4815)
|
||||
- The scheduler now uses the getgrouplist function when available
|
||||
(Issue #4611)
|
||||
- The IPP backend no longer enables compression by default except for
|
||||
certain raster formats that generally benefit from it
|
||||
(<rdar://problem/25166952>)
|
||||
- The scheduler did not handle out-of-disk situations gracefully
|
||||
(Issue #4742)
|
||||
- The LPD mini-daemon now detects invalid UTF-8 sequences in job,
|
||||
document, and user names (Issue #4748)
|
||||
- The IPP backend now continues on to the next job when the remote
|
||||
server/printer puts the job on hold (<rdar://problem/24858548>)
|
||||
- The scheduler did not cancel multi-document jobs immediately
|
||||
(<rdar://problem/24854834>)
|
||||
- The scheduler did not return non-shared printers to local clients
|
||||
unless they connected to the domain socket (<rdar://problem/24566996>)
|
||||
- The scheduler now reads the spool directory if one or more job cache
|
||||
entries point to deleted jobs (<rdar://problem/24048846>)
|
||||
- Added support for disc media sizes (<rdar://problem/20219536>)
|
||||
- The httpAddrConnect and httpConnect* APIs now try connecting to
|
||||
multiple addresses in parallel (<rdar://problem/20643153>)
|
||||
- The cupsd domain socket is no longer world-accessible on macOS
|
||||
(<rdar://problem/7542560>)
|
||||
- Interface scripts are no longer supported for security reasons
|
||||
(<rdar://problem/23135640>)
|
||||
- Added a new cupsHashData API and support for hashed job passwords
|
||||
(<rdar://problem/20221502>)
|
||||
- Localization fixes (<rdar://problem/25292403>,
|
||||
<rdar://problem/25461517>, Issue #4041, Issue #4796)
|
||||
- Documentation changes (Issue #4624, Issue #4781)
|
||||
- Packaging fixes (PR #4832)
|
||||
- Security: cupsRasterReadPixels buffer overflow with invalid page
|
||||
header and compressed raster data (STR #4551)
|
||||
- Command-line programs were not localized on Mac OS X
|
||||
(<rdar://problem/14546232>)
|
||||
- The scheduler incorrectly cleared the MakeModel string in the
|
||||
printers.conf file after a restart (<rdar://problem/16827518>)
|
||||
- CUPS did not compile with older versions of GNU TLS (STR #4527)
|
||||
- CUPS did not compile without Avahi or mDNSResponder (STR #4523)
|
||||
- ippLength() did not return the correct length for IPP_TAG_CONST
|
||||
string values.
|
||||
- The scheduler incorrectly aborted jobs after a job was restarted
|
||||
(<rdar://problem/19129387>)
|
||||
- The cups-files.conf file contained the old ServerCertificate/Key
|
||||
directives instead of ServerKeychain.
|
||||
- Fixed builds when no SSL/TLS library is available, or when explicitly
|
||||
disabled (STR #4531)
|
||||
- Fixed an OpenBSD charset transcoding issue.
|
||||
- Fixed USB printing on OpenBSD (STR #4525)
|
||||
- The --without-xinetd configure option did not work (STR #4542)
|
||||
- Backends needing to load OS X kernel extensions did not work
|
||||
(<rdar://problem/19015679>)
|
||||
- Mapping of PPD keywords to IPP keywords did not work if the PPD
|
||||
keyword was already an IPP keyword (<rdar://problem/19121005>)
|
||||
- cupsGetPPD* sent bad requests (STR #4567)
|
||||
- ippserver used the wrong temporary directory on Windows (STR #4547)
|
||||
- ippserver did not handle Bonjour registrations properly (STR #4548)
|
||||
- The scheduler could crash during shutdown if Avahi was shutdown
|
||||
first (STR #4550)
|
||||
- Added a USB quirk rule for Intermec printers (STR #4553)
|
||||
- The scheduler did not always log which configuration file had the
|
||||
error (STR #4559)
|
||||
- The ippfind and ipptool programs now correctly match hostnames with
|
||||
trailing dots (STR #4563)
|
||||
- The ipptool timeout option did not work (STR #4515)
|
||||
- Fixed several issues with client.conf, CUPS_SERVER, and the "-h"
|
||||
option of most commands (STR #4528)
|
||||
- Another change for OpenBSD (STR #4526)
|
||||
- Added Japanese localization (STR #4524)
|
||||
- Documentation changes (STR #4569)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.1
|
||||
|
||||
- Security: SSLv3 is now disabled by default to protect against the
|
||||
POODLE attack (STR #4476)
|
||||
- Printer sharing did not work when systemd was being used (STR #4497)
|
||||
- cupsGetPPD* would return a symlink to the PPD in /etc/cups/ppd even if
|
||||
it was not readable by the user (STR #4500)
|
||||
- The web interface now protects against frame "click-jacking" attacks
|
||||
(STR #4492)
|
||||
- Fixed a crash in ippAttributeString (<rdar://problem/17903871>)
|
||||
- Fixed a crash in the scheduler on Linux/*BSD if colord was not running
|
||||
(STR #4496)
|
||||
- Fixed a random crash in the scheduler when not using systemd
|
||||
(STR #4484)
|
||||
- Added systemd support for cups-lpd (STR #4493)
|
||||
- The scheduler did not honor the FatalErrors directive for mis-
|
||||
configured Group and SystemGroup values (STR #4495)
|
||||
- The network backends no longer report waste-receptacle conditions when
|
||||
using SNMP (STR #4499)
|
||||
- The IPP backend did not work with some configurations of Windows
|
||||
(STR #4503)
|
||||
- RPMs did not build (STR #4490)
|
||||
- Added a USB quirk rule for the Brother HL-1250 (STR #4519)
|
||||
- Fixed compiles on unsupported platforms (STR #4510)
|
||||
- "cancel -a" did not cancel all jobs on all destinations (STR #4513)
|
||||
- The web interface did not work on OpenBSD (STR #4496)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.0
|
||||
|
||||
- The scheduler did not preserve listener sockets from launchd or
|
||||
systemd after a restart (<rdar://problem/18112848>)
|
||||
- Added some USB quirk rules for the libusb-based USB backend
|
||||
(STR #4482)
|
||||
- Spanish localization update (STR #4487)
|
||||
- Updated documentation for 2.0.0 release.
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0rc1
|
||||
|
||||
- Documentation updates (STR #4464)
|
||||
- The scheduler now monitors the AC power status on OS X, allowing for
|
||||
"sleep printing" when sharing printers (<rdar://problem/17325852>)
|
||||
- The scheduler incorrectly called launch_activate_socket multiple times
|
||||
on OS X (<rdar://problem/17523218>)
|
||||
- The ippserver test program now passes the IPP Everywhere self-
|
||||
certification tests (STR #4101)
|
||||
- Relaxed the new OS X filter sandbox slightly (STR #4471,
|
||||
<rdar://problem/17483959>)
|
||||
- Dropped the old Epson Stylus Color/Photo sample drivers since they
|
||||
don't work with any current printers and there are free alternatives
|
||||
that produce much better output (<rdar://problem/18036889>)
|
||||
- Log and configuration files that are not world-readable are again
|
||||
accessible via the web interface (STR #4461)
|
||||
- PPD files are now created using the permissions specified by the
|
||||
ConfigFilePerm directive.
|
||||
- Fixed RPM build issues (STR #4459)
|
||||
- Fixed the spinner image and restart page when reconfiguring the
|
||||
scheduler through the web interface (STR #4475)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0b1
|
||||
|
||||
- Added a "--list-filters" option to the cupsfilter command (STR #4325)
|
||||
- Added systemd support (STR #3917)
|
||||
- Added support for re-sending a job as a raster file if a higher-level
|
||||
format such as PDF fails (<rdar://problem/15583721>)
|
||||
- Added support for regular expression matching in the MIME type rules
|
||||
(<rdar://problem/11131245>)
|
||||
- Added support for TLS certificate validation and policy enforcement
|
||||
(STR #1616)
|
||||
- Added support for simultaneous XML and test output from ipptool.
|
||||
- Added support for PAUSE directive in ipptool test files.
|
||||
- Added support for auto-typing of TIFF files by ipptool (STR #4418)
|
||||
- The scheduler now returns completed jobs in the correct newest-to-
|
||||
oldest order (STR #4396)
|
||||
- The configure script now supports target-specific tools for pkg-config
|
||||
and others (STR #4423)
|
||||
- The ipptool program now supports EXPECT statements for collection
|
||||
member attributes (<rdar://problem/15355218>)
|
||||
- The ipptool program now supports collection attributes with multiple
|
||||
values (<rdar://problem/15355124>)
|
||||
- The sample drivers now include all of the installed localizations by
|
||||
default (<rdar://problem/14756625>)
|
||||
- Adopted Linux man page conventions and updated all man pages
|
||||
(STR #4372, STR #4329)
|
||||
- The scheduler now supports the "first-index" operation attribute for
|
||||
the Get-Jobs operation (STR #2913)
|
||||
- Changed the default AccessLogLevel and PageLogFormat to disable the
|
||||
access_log and page_log files by default (<rdar://problem/16495000>)
|
||||
- cupsRasterInterpretPPD now supports the Orientation header in order to
|
||||
support long-edge feed raster printers (<rdar://problem/15837926>)
|
||||
- The scheduler now allows run-as-root backends to have group read and
|
||||
execute permissions (STR #2935)
|
||||
- The ippFindAttribute and ippFindNextAttribute functions now support
|
||||
hierarchical searches (STR #4395)
|
||||
- Dropped OpenSSL support in favor of GNU TLS.
|
||||
- Dropped "dark wake" support on OS X, which was preventing portables
|
||||
from going to sleep when there was a stuck job. We now use a variation
|
||||
of the CUPS 1.4 sleep support to do a cleaner sleep
|
||||
(<rdar://problem/14323704>)
|
||||
- Dropped support for AIX, HP-UX, and OSF/1 (aka Digital UNIX)
|
||||
- Dropped lppasswd and support for Digest authentication in in the
|
||||
scheduler (STR #4321)
|
||||
- The cupsGetClasses, cupsGetPrinters, and cupsTempFile functions are no
|
||||
longer supported.
|
||||
- The scheduler now caches more job history data and limits the number
|
||||
of completed jobs returned by Get-Jobs as needed in order to prevent a
|
||||
denial-of-service on busy servers (STR #2913)
|
||||
- The filter/backend sandbox on OS X now defaults to a more strict
|
||||
whitelist (<rdar://problem/15939788>)
|
||||
- Increased the default idle exit timeout to 60 seconds on OS X
|
||||
(<rdar://problem/16041820>)
|
||||
- Printer classes were not accessible on OS X
|
||||
(<rdar://problem/16385643>)
|
||||
- The scheduler now uses </DefaultPrinter> to close the default printer
|
||||
definition in printers.conf (STR #4153)
|
||||
- Canceling all jobs in the web interface now just cancels the jobs
|
||||
(STR #1914)
|
||||
|
||||
@@ -1,635 +0,0 @@
|
||||
# Contributing to CUPS
|
||||
|
||||
CUPS is developed by Apple Inc. and distributed as open source software under a
|
||||
combination of GNU GPL2 and GNU LGPL2 licenses with exceptions to allow
|
||||
developers on Apple's operating systems to develop CUPS-based software under
|
||||
alternate license terms. Significant contributions to CUPS must be licensed to
|
||||
Apple using the Apple Contributor Agreement:
|
||||
|
||||
https://www.cups.org/AppleContributorAgreement_2011-03-10.pdf
|
||||
|
||||
Contributions should be submitted as attachments to bug reports on the CUPS web
|
||||
site. Changes to existing source files should be submitted as unified diffs
|
||||
(both Subversion and Git produce this format by default) while new source files
|
||||
should be provided as-is or in an archive. Github pull requests can also be
|
||||
used to submit changes.
|
||||
|
||||
|
||||
## HOW TO CONTACT THE DEVELOPERS
|
||||
|
||||
The CUPS mailing lists are the primary means of asking questions and informally
|
||||
discussing issues and feature requests with the CUPS developers and other
|
||||
experienced CUPS users and developers. The "cups" mailing list is intended for
|
||||
CUPS usage questions and new software announcements while the "cups-devel"
|
||||
mailing list provides a forum for CUPS developers and monitoring new bugs.
|
||||
|
||||
|
||||
## INTERFACES
|
||||
|
||||
CUPS interfaces, including the C APIs and command-line arguments, environment
|
||||
variables, configuration files, and output format, are stable across patch
|
||||
versions and are generally backwards-compatible with interfaces used in prior
|
||||
major and minor versions. However, program interfaces such as those used by
|
||||
the scheduler to run filter, port monitor, and backend processes for job
|
||||
processing should only be considered stable from the point of view of a
|
||||
filter, port monitor, or backend. Software that simulates the scheduler in
|
||||
order to run those programs outside of CUPS must necessarily be updated when
|
||||
the corresponding interface is changed in a subsequent CUPS release, otherwise
|
||||
undefined behavior can occur.
|
||||
|
||||
CUPS C APIs starting with an underscore (_) are considered to be private to
|
||||
CUPS and are not subject to the normal guarantees of stability between CUPS
|
||||
releases and must never be used in non-CUPS source code. Similarly,
|
||||
configuration and state files written by CUPS are considered private if a
|
||||
corresponding man page is not provided with the CUPS release. Never rely on
|
||||
undocumented files or formats when developing software for CUPS. Always use a
|
||||
published C API to access data stored in a file to avoid compatibility problems
|
||||
in the future.
|
||||
|
||||
|
||||
## BUILD SYSTEM
|
||||
|
||||
The CUPS build system uses GNU autoconf to tailor the library to the local
|
||||
operating system. Project files for the current release of Microsoft Visual
|
||||
Studio are also provided for Microsoft Windows®. To improve portability,
|
||||
makefiles must not make use of features unique to GNU make. See the MAKEFILE
|
||||
GUIDELINES section for a description of the allowed make features and makefile
|
||||
guidelines.
|
||||
|
||||
Additional GNU build programs such as GNU automake and GNU libtool must not be
|
||||
used. GNU automake produces non-portable makefiles which depend on GNU-
|
||||
specific extensions, and GNU libtool is not portable or reliable enough for
|
||||
CUPS.
|
||||
|
||||
|
||||
## VERSION NUMBERING
|
||||
|
||||
CUPS uses a three-part version number separated by periods to represent the
|
||||
major, minor, and patch release numbers. Major release numbers indicate large
|
||||
design changes or backwards-incompatible changes to the CUPS API or CUPS
|
||||
Imaging API. Minor release numbers indicate new features and other smaller
|
||||
changes which are backwards-compatible with previous CUPS releases. Patch
|
||||
numbers indicate bug fixes to the previous feature or patch release.
|
||||
|
||||
> Note:
|
||||
>
|
||||
> When we talk about compatibility, we are talking about binary compatibility
|
||||
> for public APIs and output format compatibility for program interfaces.
|
||||
> Changes to configuration file formats or the default behavior of programs
|
||||
> are not generally considered incompatible as the upgrade process can
|
||||
> normally address such changes gracefully.
|
||||
|
||||
Production releases use the plain version numbers:
|
||||
|
||||
MAJOR.MINOR.PATCH
|
||||
1.0.0
|
||||
...
|
||||
1.1.0
|
||||
...
|
||||
1.1.23
|
||||
...
|
||||
2.0.0
|
||||
...
|
||||
2.1.0
|
||||
2.1.1
|
||||
2.1.2
|
||||
2.1.3
|
||||
|
||||
The first production release in a MAJOR.MINOR series (MAJOR.MINOR.0) is called
|
||||
a feature release. Feature releases are the only releases that may contain new
|
||||
features. Subsequent production releases in a MAJOR.MINOR series may only
|
||||
contain bug fixes.
|
||||
|
||||
Beta-test releases are identified by appending the letter B to the major and
|
||||
minor version numbers followed by the beta release number:
|
||||
|
||||
MAJOR.MINORbNUMBER
|
||||
2.2b1
|
||||
|
||||
Release candidates are identified by appending the letters RC to the major and
|
||||
minor version numbers followed by the release candidate number:
|
||||
|
||||
MAJOR.MINORrcNUMBER
|
||||
2.2rc1
|
||||
|
||||
|
||||
## CODING GUIDELINES
|
||||
|
||||
Contributed source code must follow the guidelines below. While the examples
|
||||
are for C and C++ source files, source code for other languages should conform
|
||||
to the same guidelines as allowed by the language.
|
||||
|
||||
|
||||
### SOURCE FILES
|
||||
|
||||
All source files names must be 16 characters or less in length to ensure
|
||||
compatibility with older UNIX filesystems. Source files containing functions
|
||||
have an extension of ".c" for C and ".cxx" for C++ source files. All other
|
||||
"include" files have an extension of ".h". Tabs are set to 8 characters or
|
||||
columns.
|
||||
|
||||
> Note:
|
||||
>
|
||||
> The ".cxx" extension is used because it is the only common C++ extension
|
||||
> between Linux, macOS, UNIX, and Windows.
|
||||
|
||||
The top of each source file contains a header giving the purpose or nature of
|
||||
the source file and the copyright and licensing notice:
|
||||
|
||||
/*
|
||||
* Description of file contents.
|
||||
*
|
||||
* Copyright 2016 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
For source files that are subject to the Apple OS-Developed Software exception,
|
||||
the following additional comment appears after the contact information:
|
||||
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
|
||||
|
||||
### HEADER FILES
|
||||
|
||||
All public header files must include the "versioning.h" header file, or a header
|
||||
that does so. Function declarations are then "decorated" with the correct
|
||||
_CUPS_API_major_minor macro to define its availability based on the build
|
||||
environment, for example:
|
||||
|
||||
extern int cupsDoThis(int foo, int bar) _CUPS_API_2_2;
|
||||
|
||||
Private API header files must be named with the suffix "-private", for example
|
||||
the "cups.h" header file defines all of the public CUPS APIs while the
|
||||
"cups-private.h" header file defines all of the private CUPS APIs as well.
|
||||
Typically a private API header file will include the corresponding public API
|
||||
header file.
|
||||
|
||||
|
||||
### COMMENTS
|
||||
|
||||
All source code utilizes block comments within functions to describe the
|
||||
operations being performed by a group of statements; avoid putting a comment
|
||||
per line unless absolutely necessary, and then consider refactoring the code
|
||||
so that it is not necessary. C source files use the block comment format
|
||||
("/* comment */") since many vendor C compilers still do not support C99/C++
|
||||
comments ("// comment"):
|
||||
|
||||
/*
|
||||
* Clear the state array before we begin...
|
||||
*/
|
||||
|
||||
for (i = 0; i < (sizeof(array) / sizeof(sizeof(array[0])); i ++)
|
||||
array[i] = CUPS_STATE_IDLE;
|
||||
|
||||
/*
|
||||
* Wait for state changes on another thread...
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
for (i = 0; i < (sizeof(array) / sizeof(sizeof(array[0])); i ++)
|
||||
if (array[i] != CUPS_STATE_IDLE)
|
||||
break;
|
||||
|
||||
if (i == (sizeof(array) / sizeof(array[0])))
|
||||
sleep(1);
|
||||
} while (i == (sizeof(array) / sizeof(array[0])));
|
||||
|
||||
|
||||
### INDENTATION
|
||||
|
||||
All code blocks enclosed by brackets begin with the opening brace on a new
|
||||
line. The code then follows starting on a new line after the brace and is
|
||||
indented 2 spaces. The closing brace is then placed on a new line following
|
||||
the code at the original indentation:
|
||||
|
||||
{
|
||||
int i; /* Looping var */
|
||||
|
||||
/*
|
||||
* Process foobar values from 0 to 999...
|
||||
*/
|
||||
|
||||
for (i = 0; i < 1000; i ++)
|
||||
{
|
||||
do_this(i);
|
||||
do_that(i);
|
||||
}
|
||||
}
|
||||
|
||||
Single-line statements following "do", "else", "for", "if", and "while" are
|
||||
indented 2 spaces as well. Blocks of code in a "switch" block are indented 4
|
||||
spaces after each "case" and "default" case:
|
||||
|
||||
switch (array[i])
|
||||
{
|
||||
case CUPS_STATE_IDLE :
|
||||
do_this(i);
|
||||
do_that(i);
|
||||
break;
|
||||
|
||||
default :
|
||||
do_nothing(i);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
### SPACING
|
||||
|
||||
A space follows each reserved word such as "if", "while", etc. Spaces are not
|
||||
inserted between a function name and the arguments in parenthesis.
|
||||
|
||||
|
||||
### RETURN VALUES
|
||||
|
||||
Parenthesis surround values returned from a function:
|
||||
|
||||
return (CUPS_STATE_IDLE);
|
||||
|
||||
|
||||
### FUNCTIONS
|
||||
|
||||
Functions with a global scope have a lowercase prefix followed by capitalized
|
||||
words, e.g., "cupsDoThis", "cupsDoThat", "cupsDoSomethingElse", etc. Private
|
||||
global functions begin with a leading underscore, e.g., "\_cupsDoThis",
|
||||
"\_cupsDoThat", etc.
|
||||
|
||||
Functions with a local scope are declared "static" with lowercase names and
|
||||
underscores between words, e.g., "do\_this", "do\_that", "do\_something\_else", etc.
|
||||
|
||||
Each function begins with a comment header describing what the function does,
|
||||
the possible input limits (if any), the possible output values (if any), and
|
||||
any special information needed:
|
||||
|
||||
/*
|
||||
* 'do_this()' - Compute y = this(x).
|
||||
*
|
||||
* Notes: none.
|
||||
*/
|
||||
|
||||
static float /* O - Inverse power value, 0.0 <= y <= 1.1 */
|
||||
do_this(float x) /* I - Power value (0.0 <= x <= 1.1) */
|
||||
{
|
||||
...
|
||||
return (y);
|
||||
}
|
||||
|
||||
Return/output values are indicated using an "O" prefix, input values are
|
||||
indicated using the "I" prefix, and values that are both input and output use
|
||||
the "IO" prefix for the corresponding in-line comment.
|
||||
|
||||
The Mini-XML documentation generator also understands the following special
|
||||
text in the function description comment:
|
||||
|
||||
@deprecated@ - Marks the function as deprecated (not recommended
|
||||
for new development and scheduled for removal)
|
||||
@since CUPS version@ - Marks the function as new in the specified version
|
||||
of CUPS.
|
||||
@private@ - Marks the function as private (same as starting the
|
||||
function name with an underscore)
|
||||
|
||||
|
||||
### VARIABLES
|
||||
|
||||
Variables with a global scope are capitalized, e.g., "ThisVariable",
|
||||
"ThatVariable", "ThisStateVariable", etc. Globals in CUPS libraries are either
|
||||
part of the per-thread global values managed by the "\_cupsGlobals()" function
|
||||
or are suitably protected for concurrent access. Global variables should be
|
||||
replaced by function arguments whenever possible.
|
||||
|
||||
Variables with a local scope are lowercase with underscores between words,
|
||||
e.g., "this\_variable", "that\_variable", etc. Any "local global" variables
|
||||
shared by functions within a source file are declared "static". As for global
|
||||
variables, local static variables are suitably protected for concurrent access.
|
||||
|
||||
Each variable is declared on a separate line and is immediately followed by a
|
||||
comment block describing the variable:
|
||||
|
||||
int ThisVariable; /* The current state of this */
|
||||
static int that_variable; /* The current state of that */
|
||||
|
||||
|
||||
### TYPES
|
||||
|
||||
All type names are lowercase with underscores between words and "\_t" appended
|
||||
to the end of the name, e.g., "cups\_this\_type\_t", "cups\_that\_type\_t", etc.
|
||||
Type names start with a prefix, typically "cups" or the name of the program,
|
||||
to avoid conflicts with system types. Private type names start with an
|
||||
underscore, e.g., "\_cups\_this\_t", "\_cups\_that\_t", etc.
|
||||
|
||||
Each type has a comment block immediately after the typedef:
|
||||
|
||||
typedef int cups_this_type_t; /* This type is for CUPS foobar options. */
|
||||
|
||||
|
||||
### STRUCTURES
|
||||
|
||||
All structure names are lowercase with underscores between words and "\_s"
|
||||
appended to the end of the name, e.g., "cups\_this\_s", "cups\_that\_s", etc.
|
||||
Structure names start with a prefix, typically "cups" or the name of the
|
||||
program, to avoid conflicts with system types. Private structure names start
|
||||
with an underscore, e.g., "\_cups\_this\_s", "\_cups\_that\_s", etc.
|
||||
|
||||
Each structure has a comment block immediately after the struct and each member
|
||||
is documented similar to the variable naming policy above:
|
||||
|
||||
struct cups_this_struct_s /* This structure is for CUPS foobar options. */
|
||||
{
|
||||
int this_member; /* Current state for this */
|
||||
int that_member; /* Current state for that */
|
||||
};
|
||||
|
||||
|
||||
### CONSTANTS
|
||||
|
||||
All constant names are uppercase with underscores between words, e.g.,
|
||||
"CUPS\_THIS\_CONSTANT", "CUPS\_THAT\_CONSTANT", etc. Constants begin with an
|
||||
uppercase prefix, typically "CUPS" or the program name. Private constants
|
||||
start with an underscore, e.g., "\_CUPS\_THIS\_CONSTANT", "\_CUPS\_THAT\_CONSTANT",
|
||||
etc.
|
||||
|
||||
Typed enumerations should be used whenever possible to allow for type checking
|
||||
by the compiler.
|
||||
|
||||
Comment blocks immediately follow each constant:
|
||||
|
||||
typedef enum cups_tray_e /* Tray enumerations */
|
||||
{
|
||||
CUPS_TRAY_THIS, /* This tray */
|
||||
CUPS_TRAY_THAT /* That tray */
|
||||
} cups_tray_t;
|
||||
|
||||
|
||||
## MAKEFILE GUIDELINES
|
||||
|
||||
The following is a guide to the makefile-based build system used by CUPS.
|
||||
These standards have been developed over the years to allow CUPS to be built on
|
||||
as many systems and environments as possible.
|
||||
|
||||
|
||||
### GENERAL ORGANIZATION
|
||||
|
||||
The CUPS source code is organized functionally into a top-level makefile,
|
||||
include file, and subdirectories each with their own makefile and dependencies
|
||||
files. The ".in" files are template files for the autoconf software and are
|
||||
used to generate a static version of the corresponding file.
|
||||
|
||||
|
||||
### MAKEFILE DOCUMENTATION
|
||||
|
||||
Each makefile starts with the standard CUPS header containing the description
|
||||
of the file, and CUPS copyright and license notice:
|
||||
|
||||
#
|
||||
# Makefile for ...
|
||||
#
|
||||
# Copyright 2016 by Apple Inc.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
|
||||
### PORTABLE MAKEFILE CONSTRUCTION
|
||||
|
||||
CUPS uses a common subset of make program syntax to ensure that the software
|
||||
can be compiled "out of the box" on as many systems as possible. The following
|
||||
is a list of assumptions we follow when constructing makefiles:
|
||||
|
||||
- Targets; we assume that the make program supports the notion of simple
|
||||
targets of the form "name:" that perform tab-indented commands that follow
|
||||
the target, e.g.:
|
||||
|
||||
target:
|
||||
TAB target commands
|
||||
|
||||
- Dependencies; we assume that the make program supports recursive dependencies
|
||||
on targets, e.g.:
|
||||
|
||||
target: foo bar
|
||||
TAB target commands
|
||||
|
||||
foo: bla
|
||||
TAB foo commands
|
||||
|
||||
bar:
|
||||
TAB bar commands
|
||||
|
||||
bla:
|
||||
TAB bla commands
|
||||
|
||||
- Variable Definition; we assume that the make program supports variable
|
||||
definition on the command-line or in the makefile using the following form:
|
||||
|
||||
name=value
|
||||
|
||||
- Variable Substitution; we assume that the make program supports variable
|
||||
substitution using the following forms:
|
||||
|
||||
- $(name); substitutes the value of "name",
|
||||
- $(name:.old=.new); substitutes the value of "name" with the filename
|
||||
extension ".old" changed to ".new",
|
||||
- $(MAKEFLAGS); substitutes the command-line options passed to the
|
||||
program without the leading hyphen (-),
|
||||
- $$; substitutes a single $ character,
|
||||
- $<; substitutes the current source file or dependency, and
|
||||
- $@; substitutes the current target name.
|
||||
|
||||
- Suffixes; we assume that the make program supports filename suffixes with
|
||||
assumed dependencies, e.g.:
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
.c.o:
|
||||
TAB $(CC) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
- Include Files; we assume that the make program supports the include
|
||||
directive, e.g.:
|
||||
|
||||
include ../Makedefs
|
||||
include Dependencies
|
||||
|
||||
- Comments; we assume that comments begin with a # character and proceed to the
|
||||
end of the current line.
|
||||
|
||||
- Line Length; we assume that there is no practical limit to the length of
|
||||
lines.
|
||||
|
||||
- Continuation of long lines; we assume that the \ character may be placed at
|
||||
the end of a line to concatenate two or more lines in a makefile to form a
|
||||
single long line.
|
||||
|
||||
- Shell; we assume a POSIX-compatible shell is present on the build system.
|
||||
|
||||
|
||||
### STANDARD VARIABLES
|
||||
|
||||
The following variables are defined in the "Makedefs" file generated by the
|
||||
autoconf software:
|
||||
|
||||
- ALL_CFLAGS; the combined C compiler options,
|
||||
- ALL_CXXFLAGS; the combined C++ compiler options,
|
||||
- AMANDIR; the administrative man page installation directory (section 8/1m
|
||||
depending on the platform),
|
||||
- AR; the library archiver command,
|
||||
- ARFLAGS; options for the library archiver command,
|
||||
- AWK; the local awk command,
|
||||
- BINDIR; the binary installation directory,
|
||||
- BUILDROOT; optional installation prefix (defaults to DSTROOT),
|
||||
- CC; the C compiler command,
|
||||
- CFLAGS; options for the C compiler command,
|
||||
- CHMOD; the chmod command,
|
||||
- CXX; the C++ compiler command,
|
||||
- CXXFLAGS; options for the C++ compiler command,
|
||||
- DATADIR; the data file installation directory,
|
||||
- DSO; the C shared library building command,
|
||||
- DSOXX; the C++ shared library building command,
|
||||
- DSOFLAGS; options for the shared library building command,
|
||||
- INCLUDEDIR; the public header file installation directory,
|
||||
- INSTALL; the install command,
|
||||
- INSTALL_BIN; the program installation command,
|
||||
- INSTALL_COMPDATA; the compressed data file installation command,
|
||||
- INSTALL_CONFIG; the configuration file installation command,
|
||||
- INSTALL_DATA; the data file installation command,
|
||||
- INSTALL_DIR; the directory installation command,
|
||||
- INSTALL_LIB; the library installation command,
|
||||
- INSTALL_MAN; the documentation installation command,
|
||||
- INSTALL_SCRIPT; the shell script installation command,
|
||||
- LD; the linker command,
|
||||
- LDFLAGS; options for the linker,
|
||||
- LIBDIR; the library installation directory,
|
||||
- LIBS; libraries for all programs,
|
||||
- LN; the ln command,
|
||||
- MAN1EXT; extension for man pages in section 1,
|
||||
- MAN3EXT; extension for man pages in section 3,
|
||||
- MAN5EXT; extension for man pages in section 5,
|
||||
- MAN7EXT; extension for man pages in section 7,
|
||||
- MAN8DIR; subdirectory for man pages in section 8,
|
||||
- MAN8EXT; extension for man pages in section 8,
|
||||
- MANDIR; the man page installation directory,
|
||||
- OPTIM; common compiler optimization options,
|
||||
- PRIVATEINCLUDE; the private header file installation directory,
|
||||
- RM; the rm command,
|
||||
- SHELL; the sh (POSIX shell) command,
|
||||
- STRIP; the strip command,
|
||||
- srcdir; the source directory.
|
||||
|
||||
|
||||
### STANDARD TARGETS
|
||||
|
||||
The following standard targets are defined in each makefile:
|
||||
|
||||
- all; creates all target programs, libraries, and documentation files,
|
||||
- clean; removes all target programs libraries, documentation files, and object
|
||||
files,
|
||||
- depend; generates automatic dependencies for any C or C++ source files (also
|
||||
see "DEPENDENCIES"),
|
||||
- distclean; removes autoconf-generated files in addition to those removed by
|
||||
the "clean" target,
|
||||
- install; installs all distribution files in their corresponding locations
|
||||
(also see "INSTALL/UNINSTALL SUPPORT"),
|
||||
- install-data; installs all data files in their corresponding locations (also
|
||||
see "INSTALL/UNINSTALL SUPPORT"),
|
||||
- install-exec; installs all executable files in their corresponding locations
|
||||
(also see "INSTALL/UNINSTALL SUPPORT"),
|
||||
- install-headers; installs all include files in their corresponding locations
|
||||
(also see "INSTALL/UNINSTALL SUPPORT"),
|
||||
- install-libs; installs all library files in their corresponding locations
|
||||
(also see "INSTALL/UNINSTALL SUPPORT"), and
|
||||
- uninstall; removes all distribution files from their corresponding locations
|
||||
(also see "INSTALL/UNINSTALL SUPPORT").
|
||||
|
||||
|
||||
### OBJECT FILES
|
||||
|
||||
Object files (the result of compiling a C or C++ source file) have the
|
||||
extension ".o".
|
||||
|
||||
|
||||
### PROGRAMS
|
||||
|
||||
Program files are the result of linking object files and libraries together to
|
||||
form an executable file. A typical program target looks like:
|
||||
|
||||
program: $(OBJS)
|
||||
TAB echo Linking $@...
|
||||
TAB $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
||||
|
||||
### STATIC LIBRARIES
|
||||
|
||||
Static libraries have a prefix of "lib" and the extension ".a". A typical
|
||||
static library target looks like:
|
||||
|
||||
libname.a: $(OBJECTS)
|
||||
TAB echo Creating $@...
|
||||
TAB $(RM) $@
|
||||
TAB $(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
TAB $(RANLIB) $@
|
||||
|
||||
### SHARED LIBRARIES
|
||||
|
||||
Shared libraries have a prefix of "lib" and the extension ".dylib" or ".so"
|
||||
depending on the operating system. A typical shared library is composed of
|
||||
several targets that look like:
|
||||
|
||||
libname.so: $(OBJECTS)
|
||||
TAB echo $(DSOCOMMAND) libname.so.$(DSOVERSION) ...
|
||||
TAB $(DSOCOMMAND) libname.so.$(DSOVERSION) $(OBJECTS)
|
||||
TAB $(RM) libname.so libname.so.$(DSOMAJOR)
|
||||
TAB $(LN) libname.so.$(DSOVERSION) libname.so.$(DSOMAJOR)
|
||||
TAB $(LN) libname.so.$(DSOVERSION) libname.so
|
||||
|
||||
libname.dylib: $(OBJECTS)
|
||||
TAB echo $(DSOCOMMAND) libname.$(DSOVERSION).dylib ...
|
||||
TAB $(DSOCOMMAND) libname.$(DSOVERSION).dylib \
|
||||
TAB TAB -install_name $(libdir)/libname.$(DSOMAJOR).dylib \
|
||||
TAB TAB -current_version libname.$(DSOVERSION).dylib \
|
||||
TAB TAB -compatibility_version $(DSOMAJOR).0 \
|
||||
TAB TAB $(OBJECTS) $(LIBS)
|
||||
TAB $(RM) libname.dylib
|
||||
TAB $(RM) libname.$(DSOMAJOR).dylib
|
||||
TAB $(LN) libname.$(DSOVERSION).dylib libname.$(DSOMAJOR).dylib
|
||||
TAB $(LN) libname.$(DSOVERSION).dylib libname.dylib
|
||||
|
||||
### DEPENDENCIES
|
||||
|
||||
Static dependencies are expressed in each makefile following the target, for
|
||||
example:
|
||||
|
||||
foo: bar
|
||||
|
||||
Static dependencies are only used when it is not possible to automatically
|
||||
generate them. Automatic dependencies are stored in a file named
|
||||
"Dependencies" and included at the end of the makefile. The following "depend"
|
||||
target rule is used to create the automatic dependencies:
|
||||
|
||||
depend:
|
||||
TAB $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
|
||||
|
||||
We regenerate the automatic dependencies on an macOS system and express any
|
||||
non-macOS dependencies statically in the makefile.
|
||||
|
||||
|
||||
### INSTALL/UNINSTALL SUPPORT
|
||||
|
||||
All makefiles contains install and uninstall rules which install or remove the
|
||||
corresponding software. These rules must use the $(BUILDROOT) variable as a
|
||||
prefix to any installation directory so that CUPS can be installed in a
|
||||
temporary location for packaging by programs like rpmbuild.
|
||||
|
||||
The $(INSTALL\_BIN), $(INSTALL\_COMPDATA), $(INSTALL\_CONFIG), $(INSTALL\_DATA),
|
||||
$(INSTALL\_DIR), $(INSTALL\_LIB), $(INSTALL\_MAN), and $(INSTALL\_SCRIPT) variables
|
||||
must be used when installing files so that the proper ownership and permissions
|
||||
are set on the installed files.
|
||||
|
||||
The $(RANLIB) command must be run on any static libraries after installation
|
||||
since the symbol table is invalidated when the library is copied on some
|
||||
platforms.
|
||||
|
||||
+5
-6
@@ -1,10 +1,9 @@
|
||||
CREDITS.txt - 2016-06-21
|
||||
CREDITS.txt - 2013-07-23
|
||||
------------------------
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
like to thank the following individuals for their contributions:
|
||||
|
||||
Niklas 'Nille' Åkerström - Swedish localization.
|
||||
Nathaniel Barbour - Lots of testing and feedback.
|
||||
N. Becker - setsid().
|
||||
Philippe Combes - French localization and buttons script.
|
||||
@@ -18,20 +17,20 @@ like to thank the following individuals for their contributions:
|
||||
Wang Jian - CUPS RPM corrections.
|
||||
Roderick Johnstone - Beta tester of the millenium.
|
||||
Till Kamppeter - Bug fixes, beta testing, evangelism.
|
||||
Iñaki Larrañaga - Basque localization.
|
||||
Kenshi Muto - Japanese localization, patches, and
|
||||
testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
Kiko - Bug fixes.
|
||||
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
|
||||
Marek Laane - Estonian translation.
|
||||
Iñaki Larrañaga - Basque localization.
|
||||
Mark Lawrence - Microsoft interoperability testing.
|
||||
Jeff Licquia - Bug fixes, beta testing, evangelism.
|
||||
Jason McMullan - Original CUPS RPM distributions.
|
||||
Àngel Mompó - Catalan localization.
|
||||
Wes Morgan - *BSD fixes.
|
||||
Kenshi Muto - Japanese localization, patches, and
|
||||
testing.
|
||||
Brian Norris - Upstart support.
|
||||
Daniel Nylander - Swedish localization.
|
||||
Niklas 'Nille' Åkerström - Swedish localization.
|
||||
Naruiko Ogasawara - Japanese localization.
|
||||
Giulio Orsero - Bug fixes and testing.
|
||||
Michal Osowiecki - Polish localization.
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v2.2b2 - 2016-06-24
|
||||
INSTALL - CUPS v2.0.3 - 2015-06-08
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
@@ -38,7 +38,7 @@ BEFORE YOU BEGIN
|
||||
Also, please note that CUPS does not include print filters to support PDF
|
||||
or raster printing. You *must* download GPL Ghostscript and/or the Open
|
||||
Printing CUPS filters package separately to print on operating systems
|
||||
other than macOS.
|
||||
other than OS X.
|
||||
|
||||
|
||||
COMPILING THE SUBVERSION REPOSITORY CODE
|
||||
@@ -98,7 +98,7 @@ CONFIGURATION
|
||||
and diagnose a variety of common problems - use the "--enable-unit-tests"
|
||||
configure option to run them at build time.
|
||||
|
||||
On macOS, use the "--with-archflags" option to build with the correct set of
|
||||
On OS X, use the "--with-archflags" option to build with the correct set of
|
||||
architectures:
|
||||
|
||||
./configure --with-archflags="-arch i386 -arch x86_64" ...
|
||||
|
||||
+232
@@ -0,0 +1,232 @@
|
||||
IPPTOOL.txt - 2013-07-15
|
||||
------------------------
|
||||
|
||||
See the file CHANGES-IPPTOOL.txt for a list of changes to this software.
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
CUPS includes two user programs for IPP printers. The first is called
|
||||
ipptool and can be used to send arbitrary IPP requests to a CUPS server or
|
||||
IPP printer. This tool started life as part of the CUPS automated test
|
||||
suite and has grown to support complex conformance tests and a simple way
|
||||
to query printer, job, and subscription attributes.
|
||||
|
||||
The second program called ippfind that can be used to find IPP printers
|
||||
that have registered themselves using Bonjour (DNS-SD, mDNS, and Zeroconf)
|
||||
and run commands such as ipptool.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
|
||||
Full documentation on the ipptool command can be found in the
|
||||
"man-ipptool.html" and "man-ipptoolfile.html" files; the latter describes
|
||||
the test file format supported by ipptool.
|
||||
|
||||
Full documentation on the ippfind command can be found in the
|
||||
"man-ippfind.html" file.
|
||||
|
||||
|
||||
IPPFIND BASIC USAGE
|
||||
|
||||
The ippfind command can be used to discover IPP printers on your network.
|
||||
For example, the following command prints the printer URI of registered IPP
|
||||
printers:
|
||||
|
||||
ippfind
|
||||
|
||||
To find all color IPP printers, run:
|
||||
|
||||
ippfind --txt-color T
|
||||
|
||||
And to run the IPP Everywhere conformance test file on every registered IPP
|
||||
printer, run the following command:
|
||||
|
||||
ippfind _ipp._tcp,_print --exec ipptool -t '{}' ipp-everywhere.test \;
|
||||
|
||||
|
||||
IPPTOOL BASIC USAGE
|
||||
|
||||
The ipptool command requires a printer URI and one or more "test" files that
|
||||
describe the operations, attributes to display, and expected status and
|
||||
attribute values. Several standard files are included with CUPS, for example
|
||||
to show a list of pending print jobs on a CUPS printer called "myprinter"
|
||||
you'd run:
|
||||
|
||||
ipptool ipp://localhost/printers/myprinter get-jobs.test
|
||||
|
||||
which would produce something like this:
|
||||
|
||||
job-id job-state job-name job-originating-user-name
|
||||
------ ------------ ------------ -------------------------
|
||||
72 pending testfile.pdf msweet
|
||||
73 pending testfile.ps msweet
|
||||
74 pending-held testfile.jpg msweet
|
||||
75 pending-held testfile.txt msweet
|
||||
|
||||
To get output suitable for import into a spreadsheet, use the "-c" (CSV)
|
||||
option:
|
||||
|
||||
ipptool -c ipp://localhost/printers/myprinter get-jobs.test
|
||||
|
||||
which will produce something like this:
|
||||
|
||||
job-id,job-state,job-name,job-originating-user-name
|
||||
72,pending,testfile.pdf,msweet
|
||||
73,pending,testfile.ps,msweet
|
||||
74,pending-held,testfile.jpg,msweet
|
||||
75,pending-held,testfile.txt,msweet
|
||||
|
||||
|
||||
STANDARD TEST FILES
|
||||
|
||||
The following standard test files are included with ipptool:
|
||||
|
||||
create-printer-subscription.test Creates a printer subscription for
|
||||
state change notifications
|
||||
get-completed-jobs.test Shows a list of completed jobs
|
||||
get-jobs.test Shows a list of pending jobs
|
||||
get-notifications.test Shows events for an ippget
|
||||
subscription.
|
||||
get-printer-attributes.test Shows printer attributes
|
||||
get-subscriptions.test Shows a list of subscriptions
|
||||
ipp-1.1.test IPP/1.1 conformance test suite
|
||||
ipp-2.0.test IPP/2.0 conformance test suite
|
||||
ipp-2.1.test IPP/2.1 conformance test suite
|
||||
ipp-2.2.test IPP/2.2 conformance test suite
|
||||
ipp-everywhere.test IPP Everywhere conformance test
|
||||
suite
|
||||
print-job.test Prints a file
|
||||
print-job-deflate.test Prints a file, compressing with
|
||||
deflate.
|
||||
print-job-gzip.test Prints a file, compressing with gzip
|
||||
validate-job.test Validates attributes for a job
|
||||
submission.
|
||||
|
||||
|
||||
CONFORMANCE TESTS
|
||||
|
||||
We provide basic IPP conformance tests for IPP/1.1, IPP/2.0, IPP/2.1,
|
||||
IPP/2.2, and IPP Everywhere. For a given printer URI, the following
|
||||
commands perform tests at each level:
|
||||
|
||||
ipptool -tf filename [options] -I printer-uri ipp-1.1.test
|
||||
ipptool -tf filename [options] -I -V 2.0 printer-uri ipp-2.0.test
|
||||
ipptool -tf filename [options] -I -V 2.1 printer-uri ipp-2.1.test
|
||||
ipptool -tf filename [options] -I -V 2.2 printer-uri ipp-2.2.test
|
||||
|
||||
The filename must use a format supported by the printer; ipptool will guess
|
||||
the MIME media type using the extension, otherwise application/octet stream
|
||||
will be used. The following standard test files are included:
|
||||
|
||||
color.jpg
|
||||
document-a4.pdf
|
||||
document-a4.ps
|
||||
document-letter.pdf
|
||||
document-letter.ps
|
||||
gray.jpg
|
||||
onepage-a4.pdf
|
||||
onepage-a4.ps
|
||||
onepage-letter.pdf
|
||||
onepage-letter.ps
|
||||
testfile.jpg
|
||||
testfile.pcl
|
||||
testfile.pdf
|
||||
testfile.ps
|
||||
testfile.txt
|
||||
|
||||
Useful options include the following:
|
||||
|
||||
-4 Connect using IPv4
|
||||
-6 Connect using IPv6
|
||||
-C Send chunked requests (default)
|
||||
-d name=val Define a variable
|
||||
-E Test IPP with HTTP Upgrade to TLS
|
||||
-L Send requests using the Content-Length header (HTTP/1.0)
|
||||
-S Test IPP over HTTPS (default for ipps: URIs)
|
||||
-T seconds Set a timeout for responses in seconds
|
||||
-v Be verbose, showing all attributes sent and received
|
||||
-X Produce XML (Apple plist) output
|
||||
|
||||
The printer-uri must be a URI supported by the printer using the "ipp" or
|
||||
"ipps" scheme, for example:
|
||||
|
||||
ipp://192.168.0.1/ipp
|
||||
ipps://192.168.0.1/ipp/print
|
||||
|
||||
Print-by-reference (URL) printing can be tested by defining the document-uri
|
||||
variable as a URL, for example:
|
||||
|
||||
ipptool -tf filename -d document-uri=url -I printer-uri ipp-1.1.test
|
||||
|
||||
The standard test files are available on cups.org under the "test"
|
||||
directory, for example:
|
||||
|
||||
ipptool -tf document-a4.pdf \
|
||||
-d document-uri=http://www.cups.org/test/document-a4.pdf \
|
||||
ipp://192.168.0.1/ipp -I -V 2.0 ipp-2.0.test
|
||||
|
||||
The "document" test files contain 4 pages each. Doing the IPP conformance
|
||||
tests will will produce up to 90 pages on various media, depending on the
|
||||
printer.
|
||||
|
||||
|
||||
IPP EVERYWHERE TESTING
|
||||
|
||||
The IPP Everywhere tests use sample PWG raster files available from:
|
||||
|
||||
ftp://ftp.pwg.org/pub/pwg/ipp/examples
|
||||
|
||||
Extract the corresponding ZIP archives into the current directory before
|
||||
running the ipp-everywhere.test file. The test file will attempt to print
|
||||
each PWG Raster file that is supported by the printer being tested - up to
|
||||
372 pages including the 90 pages produced by the regular IPP test suite.
|
||||
|
||||
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide
|
||||
discussion forums which are available at:
|
||||
|
||||
http://www.cups.org/
|
||||
|
||||
|
||||
REPORTING BUGS
|
||||
|
||||
If you believe you have discovered a bug in ippfind or ipptool, please fill
|
||||
out the bug form at:
|
||||
|
||||
http://www.cups.org/str.php
|
||||
|
||||
Be sure to identify the version of CUPS and ippfind/ipptool (if you
|
||||
downloaded the standalone version) you are using, the printer (if any) and
|
||||
firmware version, and include any files that apply.
|
||||
|
||||
If you downloaded the standalone version of ippfind/ipptool, please also
|
||||
re-run the command with debug logging enabled. Run the following commands
|
||||
on Windows to enable debug logging:
|
||||
|
||||
setdebug.bat
|
||||
|
||||
For Linux and Mac OS X use:
|
||||
|
||||
CUPS_DEBUG_LOG=ipptool.log; export CUPS_DEBUG_LOG
|
||||
CUPS_DEBUG_LEVEL=6; export CUPS_DEBUG_LEVEL
|
||||
|
||||
Then when you run the ippfind or ipptool command a new "ipptool.log" file
|
||||
will be created with detailed information - attach this file to the bug you
|
||||
file as well.
|
||||
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2013 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
CUPS is provided under the terms of version 2 of the GNU General Public
|
||||
License and GNU Library General Public License. This program is distributed
|
||||
in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the "doc/help/license.html" or "LICENSE.txt" files for more information.
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
CUPS License Agreement
|
||||
|
||||
Copyright 2007-2016 by Apple Inc.
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
1 Infinite Loop
|
||||
Cupertino, CA 95014 USA
|
||||
|
||||
@@ -70,8 +70,8 @@ the following special exception:
|
||||
b. An Apple Operating System means any operating system
|
||||
software developed and/or marketed by Apple Inc.,
|
||||
including but not limited to all existing releases and
|
||||
versions of Apple's Darwin, iOS, macOS, macOS Server, and
|
||||
tvOS products and all follow-on releases and future
|
||||
versions of Apple's Darwin, OS X, and OS X Server
|
||||
products and all follow-on releases and future
|
||||
versions thereof.
|
||||
|
||||
c. This exception is only available for Apple
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#
|
||||
# "$Id: Makedefs.in 11716 2014-03-21 14:50:24Z msweet $"
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
#
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
@@ -259,3 +261,8 @@ USBQUIRKS = @USBQUIRKS@
|
||||
echo -n Compressing $<...
|
||||
$(RM) $@
|
||||
gzip -v9 <$< >$@
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makedefs.in 11716 2014-03-21 14:50:24Z msweet $"
|
||||
#
|
||||
|
||||
+23
-6
@@ -1,7 +1,9 @@
|
||||
#
|
||||
# "$Id: Makefile 12415 2015-01-21 00:03:08Z msweet $"
|
||||
#
|
||||
# Top-level Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -128,9 +130,6 @@ depend:
|
||||
#
|
||||
# At least checker-231 is required.
|
||||
#
|
||||
# Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
|
||||
# output instead of HTML...)
|
||||
#
|
||||
|
||||
.PHONY: clang clang-changes
|
||||
clang:
|
||||
@@ -266,11 +265,17 @@ debugcheck: all unittests
|
||||
#
|
||||
|
||||
apihelp:
|
||||
for dir in cups filter; do\
|
||||
for dir in cgi-bin cups filter ppdc scheduler; do\
|
||||
echo Generating API help in $$dir... ;\
|
||||
(cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
|
||||
done
|
||||
|
||||
framedhelp:
|
||||
for dir in cgi-bin cups filter ppdc scheduler; do\
|
||||
echo Generating framed API help in $$dir... ;\
|
||||
(cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
|
||||
@@ -314,15 +319,22 @@ sloc:
|
||||
|
||||
EPMFLAGS = -v --output-dir dist $(EPMARCH)
|
||||
|
||||
bsd deb epm pkg rpm slackware:
|
||||
bsd deb pkg slackware:
|
||||
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
|
||||
|
||||
epm:
|
||||
epm $(EPMFLAGS) -s packaging/installer.gif 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;; \
|
||||
Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
|
||||
SunOS*) $(MAKE) $(MFLAGS) pkg;; \
|
||||
esac
|
||||
@@ -333,3 +345,8 @@ dist: all
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 12415 2015-01-21 00:03:08Z msweet $".
|
||||
#
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
README - CUPS v2.2b2 - 2016-06-24
|
||||
README - CUPS v2.0.3 - 2015-06-08
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt" instead...
|
||||
@@ -7,7 +7,7 @@ Looking for compile instructions? Read the file "INSTALL.txt" instead...
|
||||
INTRODUCTION
|
||||
|
||||
CUPS is a standards-based, open source printing system developed by Apple
|
||||
Inc. for macOS® and other UNIX®-like operating systems. CUPS uses the
|
||||
Inc. for OS® X and other UNIX®-like operating systems. CUPS uses the
|
||||
Internet Printing Protocol ("IPP") and provides System V and Berkeley
|
||||
command-line interfaces, a web interface, and a C API to manage printers and
|
||||
print jobs. It supports printing to both local (parallel, serial, USB) and
|
||||
@@ -140,7 +140,7 @@ PRINTING FILES
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2016 by Apple Inc. CUPS and the CUPS logo are
|
||||
CUPS is Copyright 2007-2015 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
+25
-20
@@ -4,50 +4,54 @@ ipp.o: ipp.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/language.h \
|
||||
../cups/array.h ../cups/versioning.h ../cups/http.h \
|
||||
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
|
||||
../cups/debug-private.h ../cups/array-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
dnssd.o: dnssd.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
snmp.o: snmp.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/language.h \
|
||||
../cups/array.h ../cups/versioning.h ../cups/http.h \
|
||||
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
|
||||
../cups/debug-private.h ../cups/array-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \
|
||||
backend-private.h ../cups/cups-private.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
testbackend.o: testbackend.c ../cups/string-private.h ../config.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/language.h ../cups/pwg.h \
|
||||
@@ -58,15 +62,16 @@ testsupplies.o: testsupplies.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
usb.o: usb.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
usb-darwin.c ../cups/file-private.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/raster.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h usb-darwin.c \
|
||||
../cups/file-private.h
|
||||
|
||||
+17
-16
@@ -1,16 +1,18 @@
|
||||
#
|
||||
# Backend makefile for CUPS.
|
||||
# "$Id: Makefile 11859 2014-05-08 22:42:44Z msweet $"
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Backend makefile for CUPS.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -86,7 +88,7 @@ unittests: $(UNITTESTS)
|
||||
#
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http https ipps mdns socket-static
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http https ipps mdns
|
||||
|
||||
|
||||
#
|
||||
@@ -293,12 +295,6 @@ socket: socket.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
|
||||
|
||||
socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# usb
|
||||
@@ -316,3 +312,8 @@ usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
|
||||
#
|
||||
|
||||
include Dependencies
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 11859 2014-05-08 22:42:44Z msweet $".
|
||||
#
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: backend-private.h 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Backend support definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -329,3 +331,8 @@ extern int backendWaitLoop(int snmp_fd, http_addr_t *addr,
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
#endif /* !_CUPS_BACKEND_PRIVATE_H_ */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: backend-private.h 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+26
-7
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: dnssd.c 12660 2015-05-22 19:09:57Z msweet $"
|
||||
*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2015 by Apple Inc.
|
||||
@@ -919,6 +921,13 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
* Yes, add the device...
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DNSSD
|
||||
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
|
||||
#else /* HAVE_AVAHI */
|
||||
avahi_service_name_join(fullName, kDNSServiceMaxDomainName,
|
||||
serviceName, regtype, replyDomain);
|
||||
#endif /* HAVE_DNSSD */
|
||||
|
||||
device = calloc(sizeof(cups_device_t), 1);
|
||||
device->name = strdup(serviceName);
|
||||
device->domain = strdup(replyDomain);
|
||||
@@ -934,7 +943,8 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
#ifdef HAVE_DNSSD
|
||||
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
|
||||
#else /* HAVE_AVAHI */
|
||||
avahi_service_name_join(fullName, kDNSServiceMaxDomainName, serviceName, regtype, replyDomain);
|
||||
avahi_service_name_join(fullName, kDNSServiceMaxDomainName,
|
||||
serviceName, regtype, replyDomain);
|
||||
#endif /* HAVE_DNSSD */
|
||||
|
||||
device->fullName = strdup(fullName);
|
||||
@@ -1040,7 +1050,9 @@ query_callback(
|
||||
"interfaceIndex=%d, errorCode=%d, fullName=\"%s\", "
|
||||
"rrtype=%u, rrclass=%u, rdlen=%u, rdata=%p, ttl=%u, "
|
||||
"context=%p)\n",
|
||||
sdRef, flags, interfaceIndex, errorCode, fullName, rrtype, rrclass, rdlen, rdata, ttl, context);
|
||||
sdRef, flags, interfaceIndex, errorCode,
|
||||
fullName ? fullName : "(null)", rrtype, rrclass, rdlen, rdata, ttl,
|
||||
context);
|
||||
|
||||
/*
|
||||
* Only process "add" data...
|
||||
@@ -1053,7 +1065,9 @@ query_callback(
|
||||
fprintf(stderr, "DEBUG2: query_callback(browser=%p, interfaceIndex=%d, "
|
||||
"protocol=%d, event=%d, fullName=\"%s\", rrclass=%u, "
|
||||
"rrtype=%u, rdata=%p, rdlen=%u, flags=%x, context=%p)\n",
|
||||
browser, interfaceIndex, protocol, event, fullName, rrclass, rrtype, rdata, (unsigned)rdlen, flags, context);
|
||||
browser, interfaceIndex, protocol, event,
|
||||
fullName ? fullName : "(null)", rrclass, rrtype, rdata,
|
||||
(unsigned)rdlen, flags, context);
|
||||
|
||||
/*
|
||||
* Only process "add" data...
|
||||
@@ -1188,9 +1202,9 @@ query_callback(
|
||||
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
|
||||
make_and_model, model);
|
||||
else if (!_cups_strncasecmp(model, "designjet ", 10))
|
||||
snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;", model + 10);
|
||||
snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s", model + 10);
|
||||
else if (!_cups_strncasecmp(model, "stylus ", 7))
|
||||
snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;", model + 7);
|
||||
snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s", model + 7);
|
||||
else if ((ptr = strchr(model, ' ')) != NULL)
|
||||
{
|
||||
/*
|
||||
@@ -1200,7 +1214,7 @@ query_callback(
|
||||
memcpy(make_and_model, model, (size_t)(ptr - model));
|
||||
make_and_model[ptr - model] = '\0';
|
||||
|
||||
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
|
||||
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s",
|
||||
make_and_model, ptr + 1);
|
||||
}
|
||||
}
|
||||
@@ -1275,7 +1289,7 @@ sigterm_handler(int sig) /* I - Signal number (unused) */
|
||||
(void)sig;
|
||||
|
||||
if (job_canceled)
|
||||
_exit(CUPS_BACKEND_OK);
|
||||
exit(CUPS_BACKEND_OK);
|
||||
else
|
||||
job_canceled = 1;
|
||||
}
|
||||
@@ -1313,3 +1327,8 @@ unquote(char *dst, /* I - Destination buffer */
|
||||
|
||||
*dst = '\0';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dnssd.c 12660 2015-05-22 19:09:57Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: ieee1284.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* IEEE-1284 support functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -18,7 +20,6 @@
|
||||
*/
|
||||
|
||||
#include "backend-private.h"
|
||||
#include <cups/ppd-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -471,3 +472,8 @@ backendGetMakeModel(
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ieee1284.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+359
-115
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: ipp.c 12624 2015-05-06 23:50:20Z msweet $"
|
||||
*
|
||||
* IPP backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -18,7 +20,6 @@
|
||||
*/
|
||||
|
||||
#include "backend-private.h"
|
||||
#include <cups/ppd-private.h>
|
||||
#include <cups/array-private.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -107,7 +108,6 @@ static const char * const pattrs[] = /* Printer attributes we want */
|
||||
"copies-supported",
|
||||
"cups-version",
|
||||
"document-format-supported",
|
||||
"job-password-encryption-supported",
|
||||
"marker-colors",
|
||||
"marker-high-levels",
|
||||
"marker-levels",
|
||||
@@ -122,7 +122,6 @@ static const char * const pattrs[] = /* Printer attributes we want */
|
||||
"printer-alert",
|
||||
"printer-alert-description",
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-mandatory-job-attributes",
|
||||
"printer-state",
|
||||
"printer-state-message",
|
||||
"printer-state-reasons"
|
||||
@@ -146,8 +145,6 @@ static cups_option_t *attr_cache = NULL;
|
||||
static cups_array_t *state_reasons; /* Array of printe-state-reasons keywords */
|
||||
static char tmpfilename[1024] = "";
|
||||
/* Temporary spool file name */
|
||||
static char mandatory_attrs[1024] = "";
|
||||
/* cupsMandatory value */
|
||||
|
||||
|
||||
/*
|
||||
@@ -236,10 +233,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
int delay, /* Delay for retries */
|
||||
prev_delay; /* Previous delay */
|
||||
const char *compression; /* Compression mode */
|
||||
int waitjob, /* Wait for job complete? */
|
||||
int waitjob, /* Wait for job complete? */
|
||||
waitjob_tries = 0, /* Number of times we've waited */
|
||||
waitprinter; /* Wait for printer ready? */
|
||||
time_t waittime; /* Wait time for held jobs */
|
||||
_cups_monitor_t monitor; /* Monitoring data */
|
||||
ipp_attribute_t *job_id_attr; /* job-id attribute */
|
||||
int job_id; /* job-id value */
|
||||
@@ -250,7 +246,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
#endif /* HAVE_LIBZ */
|
||||
ipp_attribute_t *copies_sup; /* copies-supported */
|
||||
ipp_attribute_t *cups_version; /* cups-version */
|
||||
ipp_attribute_t *encryption_sup; /* job-password-encryption-supported */
|
||||
ipp_attribute_t *format_sup; /* document-format-supported */
|
||||
ipp_attribute_t *job_auth; /* job-authorization-uri */
|
||||
ipp_attribute_t *media_col_sup; /* media-col-supported */
|
||||
@@ -882,7 +877,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
#endif /* HAVE_LIBZ */
|
||||
copies_sup = NULL;
|
||||
cups_version = NULL;
|
||||
encryption_sup = NULL;
|
||||
format_sup = NULL;
|
||||
media_col_sup = NULL;
|
||||
supported = NULL;
|
||||
@@ -1096,7 +1090,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
"compression value \"%s\".\n", compression);
|
||||
compression = NULL;
|
||||
}
|
||||
else if (!compression && (!strcmp(final_content_type, "image/pwg-raster") || !strcmp(final_content_type, "image/urf")))
|
||||
else if (!compression)
|
||||
{
|
||||
if (ippContainsString(compression_sup, "gzip"))
|
||||
compression = "gzip";
|
||||
@@ -1128,8 +1122,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
cups_version = ippFindAttribute(supported, "cups-version", IPP_TAG_TEXT);
|
||||
|
||||
encryption_sup = ippFindAttribute(supported, "job-password-encryption-supported", IPP_TAG_KEYWORD);
|
||||
|
||||
if ((format_sup = ippFindAttribute(supported, "document-format-supported",
|
||||
IPP_TAG_MIMETYPE)) != NULL)
|
||||
{
|
||||
@@ -1303,51 +1295,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Load the PPD file and generate PWG attribute mapping information...
|
||||
*/
|
||||
|
||||
ppd_attr_t *mandatory; /* cupsMandatory value */
|
||||
|
||||
ppd = ppdOpenFile(getenv("PPD"));
|
||||
pc = _ppdCacheCreateWithPPD(ppd);
|
||||
|
||||
ppdMarkDefaults(ppd);
|
||||
cupsMarkOptions(ppd, num_options, options);
|
||||
|
||||
if ((mandatory = ppdFindAttr(ppd, "cupsMandatory", NULL)) != NULL)
|
||||
strlcpy(mandatory_attrs, mandatory->value, sizeof(mandatory_attrs));
|
||||
}
|
||||
|
||||
/*
|
||||
* Validate job-password/-encryption...
|
||||
*/
|
||||
|
||||
if (cupsGetOption("job-password", num_options, options))
|
||||
{
|
||||
const char *keyword; /* job-password-encryption value */
|
||||
static const char * const hashes[] =
|
||||
{ /* List of supported hash algorithms, in order of preference */
|
||||
"sha-512",
|
||||
"sha-384",
|
||||
"sha-512_256",
|
||||
"sha-512-224",
|
||||
"sha-256",
|
||||
"sha-224",
|
||||
"sha",
|
||||
"none"
|
||||
};
|
||||
|
||||
if ((keyword = cupsGetOption("job-password-encryption", num_options, options)) == NULL || !ippContainsString(encryption_sup, keyword))
|
||||
{
|
||||
/*
|
||||
* Either no job-password-encryption or the value isn't supported by
|
||||
* the printer...
|
||||
*/
|
||||
|
||||
for (i = 0; i < (int)(sizeof(hashes) / sizeof(hashes[0])); i ++)
|
||||
if (ippContainsString(encryption_sup, hashes[i]))
|
||||
break;
|
||||
|
||||
if (i < (int)(sizeof(hashes) / sizeof(hashes[0])))
|
||||
num_options = cupsAddOption("job-password-encryption", hashes[i], num_options, &options);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1357,10 +1309,24 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
if (format_sup != NULL)
|
||||
{
|
||||
if (ippContainsString(format_sup, final_content_type))
|
||||
document_format = final_content_type;
|
||||
else if (ippContainsString(format_sup, "application/octet-stream"))
|
||||
document_format = "application/octet-stream";
|
||||
for (i = 0; i < format_sup->num_values; i ++)
|
||||
if (!_cups_strcasecmp(final_content_type,
|
||||
format_sup->values[i].string.text))
|
||||
{
|
||||
document_format = final_content_type;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!document_format)
|
||||
{
|
||||
for (i = 0; i < format_sup->num_values; i ++)
|
||||
if (!_cups_strcasecmp("application/octet-stream",
|
||||
format_sup->values[i].string.text))
|
||||
{
|
||||
document_format = "application/octet-stream";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: final_content_type=\"%s\", document_format=\"%s\"\n",
|
||||
@@ -1493,7 +1459,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
|
||||
goto cleanup;
|
||||
else if (ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
|
||||
ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED)
|
||||
{
|
||||
const char *www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
|
||||
@@ -1597,7 +1562,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
FD_ZERO(&input);
|
||||
FD_SET(fd, &input);
|
||||
FD_SET(snmp_fd, &input);
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
|
||||
while (select(fd > snmp_fd ? fd + 1 : snmp_fd + 1, &input, NULL, NULL,
|
||||
NULL) <= 0 && !job_canceled);
|
||||
@@ -1826,7 +1790,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n",
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled)
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
{
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
@@ -1844,9 +1808,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
}
|
||||
|
||||
if (job_canceled)
|
||||
break;
|
||||
|
||||
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
|
||||
{
|
||||
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
|
||||
@@ -1953,7 +1914,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete."));
|
||||
|
||||
for (delay = _cupsNextDelay(0, &prev_delay), waittime = time(NULL) + 30; !job_canceled;)
|
||||
for (delay = _cupsNextDelay(0, &prev_delay); !job_canceled;)
|
||||
{
|
||||
/*
|
||||
* Check for side-channel requests...
|
||||
@@ -2056,19 +2017,22 @@ main(int argc, /* I - Number of command-line args */
|
||||
remote_job_states[job_state->values[0].integer -
|
||||
IPP_JOB_PENDING]);
|
||||
|
||||
if ((job_sheets = ippFindAttribute(response, "job-impressions-completed", IPP_TAG_INTEGER)) == NULL)
|
||||
job_sheets = ippFindAttribute(response, "job-media-sheets-completed", IPP_TAG_INTEGER);
|
||||
if ((job_sheets = ippFindAttribute(response,
|
||||
"job-media-sheets-completed",
|
||||
IPP_TAG_INTEGER)) == NULL)
|
||||
job_sheets = ippFindAttribute(response,
|
||||
"job-impressions-completed",
|
||||
IPP_TAG_INTEGER);
|
||||
|
||||
if (job_sheets)
|
||||
fprintf(stderr, "PAGE: total %d\n",
|
||||
job_sheets->values[0].integer);
|
||||
|
||||
/*
|
||||
* Stop polling if the job is finished or pending-held for 30 seconds...
|
||||
* Stop polling if the job is finished or pending-held...
|
||||
*/
|
||||
|
||||
if (job_state->values[0].integer > IPP_JSTATE_STOPPED ||
|
||||
(job_state->values[0].integer == IPP_JSTATE_HELD && time(NULL) > waittime))
|
||||
if (job_state->values[0].integer > IPP_JOB_STOPPED)
|
||||
{
|
||||
ippDelete(response);
|
||||
break;
|
||||
@@ -2474,17 +2438,6 @@ monitor_printer(
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
|
||||
ippEnumString("job-state", monitor->job_state));
|
||||
|
||||
if (!job_canceled &&
|
||||
(monitor->job_state == IPP_JOB_CANCELED ||
|
||||
monitor->job_state == IPP_JOB_ABORTED))
|
||||
{
|
||||
job_canceled = -1;
|
||||
fprintf(stderr, "DEBUG: (monitor) job_canceled = -1\n");
|
||||
}
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-state-reasons",
|
||||
IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
@@ -2506,9 +2459,6 @@ monitor_printer(
|
||||
new_reasons |= _CUPS_JSR_JOB_PASSWORD_WAIT;
|
||||
else if (!strcmp(attr->values[i].string.text, "job-release-wait"))
|
||||
new_reasons |= _CUPS_JSR_JOB_RELEASE_WAIT;
|
||||
if (!job_canceled &&
|
||||
(!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
|
||||
job_canceled = 1;
|
||||
}
|
||||
|
||||
if (new_reasons != monitor->job_reasons)
|
||||
@@ -2534,7 +2484,7 @@ monitor_printer(
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state=%s\n",
|
||||
ippEnumString("job-state", monitor->job_state));
|
||||
|
||||
if (!job_canceled &&
|
||||
@@ -2572,10 +2522,7 @@ monitor_printer(
|
||||
monitor->user, monitor->version);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: (monitor) cancel_job() = %s\n", cupsLastErrorString());
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2612,10 +2559,19 @@ new_request(
|
||||
ipp_attribute_t *print_color_mode_sup)
|
||||
/* I - Printer supports print-color-mode */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ipp_t *request; /* Request data */
|
||||
const char *keyword; /* PWG keyword */
|
||||
_pwg_size_t *size; /* PWG media size */
|
||||
ipp_t *media_col, /* media-col value */
|
||||
*media_size; /* media-size value */
|
||||
const char *media_source, /* media-source value */
|
||||
*media_type, /* media-type value */
|
||||
*collate_str, /* multiple-document-handling value */
|
||||
*mandatory; /* Mandatory attributes */
|
||||
ipp_tag_t group; /* Current group */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
const char *color_attr_name; /* Supported color attribute */
|
||||
char buffer[1024]; /* Value buffer */
|
||||
|
||||
|
||||
@@ -2635,31 +2591,36 @@ new_request(
|
||||
* Add standard attributes...
|
||||
*/
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
fprintf(stderr, "DEBUG: printer-uri=\"%s\"\n", uri);
|
||||
|
||||
if (user && *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);
|
||||
fprintf(stderr, "DEBUG: requesting-user-name=\"%s\"\n", user);
|
||||
}
|
||||
|
||||
if (title && *title)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, title);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
|
||||
title);
|
||||
fprintf(stderr, "DEBUG: job-name=\"%s\"\n", title);
|
||||
}
|
||||
|
||||
if (format && op != IPP_CREATE_JOB)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", NULL, format);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
"document-format", NULL, format);
|
||||
fprintf(stderr, "DEBUG: document-format=\"%s\"\n", format);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (compression && op != IPP_OP_CREATE_JOB && op != IPP_OP_VALIDATE_JOB)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "compression", NULL, compression);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"compression", NULL, compression);
|
||||
fprintf(stderr, "DEBUG: compression=\"%s\"\n", compression);
|
||||
}
|
||||
#endif /* HAVE_LIBZ */
|
||||
@@ -2672,13 +2633,313 @@ new_request(
|
||||
{
|
||||
if (pc)
|
||||
{
|
||||
int num_finishings = 0, /* Number of finishing values */
|
||||
finishings[10]; /* Finishing enum values */
|
||||
ppd_choice_t *choice; /* Marked choice */
|
||||
|
||||
/*
|
||||
* Send standard IPP attributes...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Adding standard IPP operation/job attributes.\n", stderr);
|
||||
|
||||
copies = _cupsConvertOptions(request, ppd, pc, media_col_sup, doc_handling_sup, print_color_mode_sup, user, format, copies, num_options, options);
|
||||
if (pc->password &&
|
||||
(keyword = cupsGetOption("job-password", num_options,
|
||||
options)) != NULL)
|
||||
{
|
||||
ippAddOctetString(request, IPP_TAG_OPERATION, "job-password", keyword, (int)strlen(keyword));
|
||||
|
||||
if ((keyword = cupsGetOption("job-password-encryption", num_options,
|
||||
options)) == NULL)
|
||||
keyword = "none";
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"job-password-encryption", NULL, keyword);
|
||||
}
|
||||
|
||||
if (pc->account_id)
|
||||
{
|
||||
if ((keyword = cupsGetOption("job-account-id", num_options,
|
||||
options)) == NULL)
|
||||
keyword = cupsGetOption("job-billing", num_options, options);
|
||||
|
||||
if (keyword)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id",
|
||||
NULL, keyword);
|
||||
}
|
||||
|
||||
if (pc->accounting_user_id)
|
||||
{
|
||||
if ((keyword = cupsGetOption("job-accounting-user-id", num_options,
|
||||
options)) == NULL)
|
||||
keyword = user;
|
||||
|
||||
if (keyword)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME,
|
||||
"job-accounting-user-id", NULL, keyword);
|
||||
}
|
||||
|
||||
for (mandatory = (char *)cupsArrayFirst(pc->mandatory);
|
||||
mandatory;
|
||||
mandatory = (char *)cupsArrayNext(pc->mandatory))
|
||||
{
|
||||
if (strcmp(mandatory, "copies") &&
|
||||
strcmp(mandatory, "destination-uris") &&
|
||||
strcmp(mandatory, "finishings") &&
|
||||
strcmp(mandatory, "job-account-id") &&
|
||||
strcmp(mandatory, "job-accounting-user-id") &&
|
||||
strcmp(mandatory, "job-password") &&
|
||||
strcmp(mandatory, "job-password-encryption") &&
|
||||
strcmp(mandatory, "media") &&
|
||||
strncmp(mandatory, "media-col", 9) &&
|
||||
strcmp(mandatory, "multiple-document-handling") &&
|
||||
strcmp(mandatory, "output-bin") &&
|
||||
strcmp(mandatory, "print-color-mode") &&
|
||||
strcmp(mandatory, "print-quality") &&
|
||||
strcmp(mandatory, "sides") &&
|
||||
(keyword = cupsGetOption(mandatory, num_options, options)) != NULL)
|
||||
{
|
||||
_ipp_option_t *opt = _ippFindOption(mandatory);
|
||||
/* Option type */
|
||||
ipp_tag_t value_tag = opt ? opt->value_tag : IPP_TAG_NAME;
|
||||
/* Value type */
|
||||
|
||||
switch (value_tag)
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
ippAddInteger(request, IPP_TAG_JOB, value_tag, mandatory,
|
||||
atoi(keyword));
|
||||
break;
|
||||
case IPP_TAG_BOOLEAN :
|
||||
ippAddBoolean(request, IPP_TAG_JOB, mandatory,
|
||||
!_cups_strcasecmp(keyword, "true"));
|
||||
break;
|
||||
case IPP_TAG_RANGE :
|
||||
{
|
||||
int lower, upper; /* Range */
|
||||
|
||||
if (sscanf(keyword, "%d-%d", &lower, &upper) != 2)
|
||||
lower = upper = atoi(keyword);
|
||||
|
||||
ippAddRange(request, IPP_TAG_JOB, mandatory, lower, upper);
|
||||
}
|
||||
break;
|
||||
case IPP_TAG_STRING :
|
||||
ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword, (int)strlen(keyword));
|
||||
break;
|
||||
default :
|
||||
if (!strcmp(mandatory, "print-color-mode") && !strcmp(keyword, "monochrome"))
|
||||
{
|
||||
if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
|
||||
keyword = "auto-monochrome";
|
||||
else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
|
||||
keyword = "process-monochrome";
|
||||
}
|
||||
|
||||
ippAddString(request, IPP_TAG_JOB, value_tag, mandatory,
|
||||
NULL, keyword);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("PageSize", num_options, options)) == NULL)
|
||||
keyword = cupsGetOption("media", num_options, options);
|
||||
|
||||
if ((size = _ppdCacheGetSize(pc, keyword)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Add a media-col value...
|
||||
*/
|
||||
|
||||
media_size = ippNew();
|
||||
ippAddInteger(media_size, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"x-dimension", size->width);
|
||||
ippAddInteger(media_size, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"y-dimension", size->length);
|
||||
|
||||
media_col = ippNew();
|
||||
ippAddCollection(media_col, IPP_TAG_ZERO, "media-size", media_size);
|
||||
|
||||
media_source = _ppdCacheGetSource(pc, cupsGetOption("InputSlot",
|
||||
num_options,
|
||||
options));
|
||||
media_type = _ppdCacheGetType(pc, cupsGetOption("MediaType",
|
||||
num_options,
|
||||
options));
|
||||
|
||||
for (i = 0; i < media_col_sup->num_values; i ++)
|
||||
{
|
||||
if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-left-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-left-margin", size->left);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-bottom-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-bottom-margin", size->bottom);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-right-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-right-margin", size->right);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-top-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-top-margin", size->top);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-source") && media_source)
|
||||
ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD,
|
||||
"media-source", NULL, media_source);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-type") && media_type)
|
||||
ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD,
|
||||
"media-type", NULL, media_type);
|
||||
}
|
||||
|
||||
ippAddCollection(request, IPP_TAG_JOB, "media-col", media_col);
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("output-bin", num_options,
|
||||
options)) == NULL)
|
||||
{
|
||||
if ((choice = ppdFindMarkedChoice(ppd, "OutputBin")) != NULL)
|
||||
keyword = _ppdCacheGetBin(pc, choice->choice);
|
||||
}
|
||||
|
||||
if (keyword)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-bin",
|
||||
NULL, keyword);
|
||||
|
||||
color_attr_name = print_color_mode_sup ? "print-color-mode" : "output-mode";
|
||||
|
||||
if ((keyword = cupsGetOption("print-color-mode", num_options,
|
||||
options)) == NULL)
|
||||
{
|
||||
if ((choice = ppdFindMarkedChoice(ppd, "ColorModel")) != NULL)
|
||||
{
|
||||
if (!_cups_strcasecmp(choice->choice, "Gray"))
|
||||
keyword = "monochrome";
|
||||
else
|
||||
keyword = "color";
|
||||
}
|
||||
}
|
||||
|
||||
if (keyword && !strcmp(keyword, "monochrome"))
|
||||
{
|
||||
if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
|
||||
keyword = "auto-monochrome";
|
||||
else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
|
||||
keyword = "process-monochrome";
|
||||
}
|
||||
|
||||
if (keyword)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, color_attr_name,
|
||||
NULL, keyword);
|
||||
|
||||
if ((keyword = cupsGetOption("print-quality", num_options,
|
||||
options)) != NULL)
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
|
||||
atoi(keyword));
|
||||
else if ((choice = ppdFindMarkedChoice(ppd, "cupsPrintQuality")) != NULL)
|
||||
{
|
||||
if (!_cups_strcasecmp(choice->choice, "draft"))
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
|
||||
IPP_QUALITY_DRAFT);
|
||||
else if (!_cups_strcasecmp(choice->choice, "normal"))
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
|
||||
IPP_QUALITY_NORMAL);
|
||||
else if (!_cups_strcasecmp(choice->choice, "high"))
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
|
||||
IPP_QUALITY_HIGH);
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("sides", num_options, options)) != NULL)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
|
||||
NULL, keyword);
|
||||
else if (pc->sides_option &&
|
||||
(choice = ppdFindMarkedChoice(ppd, pc->sides_option)) != NULL)
|
||||
{
|
||||
if (!_cups_strcasecmp(choice->choice, pc->sides_1sided))
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
|
||||
NULL, "one-sided");
|
||||
else if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_long))
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
|
||||
NULL, "two-sided-long-edge");
|
||||
if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_short))
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
|
||||
NULL, "two-sided-short-edge");
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("multiple-document-handling",
|
||||
num_options, options)) != NULL)
|
||||
{
|
||||
if (strstr(keyword, "uncollated"))
|
||||
keyword = "false";
|
||||
else
|
||||
keyword = "true";
|
||||
}
|
||||
else if ((keyword = cupsGetOption("collate", num_options,
|
||||
options)) == NULL)
|
||||
keyword = "true";
|
||||
|
||||
if (format)
|
||||
{
|
||||
if (!_cups_strcasecmp(format, "image/gif") ||
|
||||
!_cups_strcasecmp(format, "image/jp2") ||
|
||||
!_cups_strcasecmp(format, "image/jpeg") ||
|
||||
!_cups_strcasecmp(format, "image/png") ||
|
||||
!_cups_strcasecmp(format, "image/tiff") ||
|
||||
!_cups_strncasecmp(format, "image/x-", 8))
|
||||
{
|
||||
/*
|
||||
* Collation makes no sense for single page image formats...
|
||||
*/
|
||||
|
||||
keyword = "false";
|
||||
}
|
||||
else if (!_cups_strncasecmp(format, "image/", 6) ||
|
||||
!_cups_strcasecmp(format, "application/vnd.cups-raster"))
|
||||
{
|
||||
/*
|
||||
* Multi-page image formats will have copies applied by the upstream
|
||||
* filters...
|
||||
*/
|
||||
|
||||
copies = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (doc_handling_sup)
|
||||
{
|
||||
if (!_cups_strcasecmp(keyword, "true"))
|
||||
collate_str = "separate-documents-collated-copies";
|
||||
else
|
||||
collate_str = "separate-documents-uncollated-copies";
|
||||
|
||||
for (i = 0; i < doc_handling_sup->num_values; i ++)
|
||||
if (!strcmp(doc_handling_sup->values[i].string.text, collate_str))
|
||||
{
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD,
|
||||
"multiple-document-handling", NULL, collate_str);
|
||||
break;
|
||||
}
|
||||
|
||||
if (i >= doc_handling_sup->num_values)
|
||||
copies = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map finishing options...
|
||||
*/
|
||||
|
||||
num_finishings = _ppdCacheGetFinishingValues(pc, num_options, options,
|
||||
(int)(sizeof(finishings) /
|
||||
sizeof(finishings[0])),
|
||||
finishings);
|
||||
if (num_finishings > 0)
|
||||
ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings",
|
||||
num_finishings, finishings);
|
||||
|
||||
/*
|
||||
* Map FaxOut options...
|
||||
@@ -2960,7 +3221,6 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
{
|
||||
ipp_attribute_t *pa, /* printer-alert */
|
||||
*pam, /* printer-alert-message */
|
||||
*pmja, /* printer-mandatory-job-attributes */
|
||||
*psm, /* printer-state-message */
|
||||
*reasons, /* printer-state-reasons */
|
||||
*marker; /* marker-* attributes */
|
||||
@@ -2981,26 +3241,6 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
IPP_TAG_TEXT)) != NULL)
|
||||
report_attr(pam);
|
||||
|
||||
if ((pmja = ippFindAttribute(ipp, "printer-mandatory-job-attributes", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
int i, /* Looping var */
|
||||
count = ippGetCount(pmja); /* Number of values */
|
||||
|
||||
for (i = 0, valptr = value; i < count; i ++, valptr += strlen(valptr))
|
||||
{
|
||||
if (i)
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value), " %s", ippGetString(pmja, i, NULL));
|
||||
else
|
||||
strlcpy(value, ippGetString(pmja, i, NULL), sizeof(value));
|
||||
}
|
||||
|
||||
if (strcmp(value, mandatory_attrs))
|
||||
{
|
||||
strlcpy(mandatory_attrs, value, sizeof(mandatory_attrs));
|
||||
fprintf(stderr, "PPD: cupsMandatory=\"%s\"\n", value);
|
||||
}
|
||||
}
|
||||
|
||||
if ((psm = ippFindAttribute(ipp, "printer-state-message",
|
||||
IPP_TAG_TEXT)) != NULL)
|
||||
{
|
||||
@@ -3303,7 +3543,7 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
* Flag that the job should be canceled...
|
||||
*/
|
||||
|
||||
write(2, "DEBUG: sigterm_handler: job_canceled = 1.\n", 25);
|
||||
write(2, "DEBUG: job_canceled = 1.\n", 25);
|
||||
|
||||
job_canceled = 1;
|
||||
return;
|
||||
@@ -3527,3 +3767,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
else if (rem[0])
|
||||
fprintf(stderr, "%s\n", rem);
|
||||
}
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp.c 12624 2015-05-06 23:50:20Z msweet $".
|
||||
*/
|
||||
|
||||
+92
-81
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $"
|
||||
*
|
||||
* Line Printer Daemon backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -75,7 +77,6 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int cups_rresvport(int *port, int family);
|
||||
static int lpd_command(int lpd_fd, char *format, ...);
|
||||
static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
|
||||
const char *printer, int print_fd, int snmp_fd,
|
||||
@@ -84,6 +85,9 @@ static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
|
||||
int reserve, int manual_copies, int timeout,
|
||||
int contimeout, const char *orighost);
|
||||
static ssize_t lpd_write(int lpd_fd, char *buffer, size_t length);
|
||||
#ifndef HAVE_RRESVPORT_AF
|
||||
static int rresvport_af(int *port, int family);
|
||||
#endif /* !HAVE_RRESVPORT_AF */
|
||||
static void sigterm_handler(int sig);
|
||||
|
||||
|
||||
@@ -568,84 +572,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_rresvport()' - A simple implementation of rresvport_af().
|
||||
*/
|
||||
|
||||
static int /* O - Socket or -1 on error */
|
||||
cups_rresvport(int *port, /* IO - Port number to bind to */
|
||||
int family) /* I - Address family */
|
||||
{
|
||||
http_addr_t addr; /* Socket address */
|
||||
int fd; /* Socket file descriptor */
|
||||
|
||||
|
||||
/*
|
||||
* Try to create an IPv4 socket...
|
||||
*/
|
||||
|
||||
if ((fd = socket(family, SOCK_STREAM, 0)) < 0)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Initialize the address buffer...
|
||||
*/
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.addr.sa_family = (sa_family_t)family;
|
||||
|
||||
/*
|
||||
* Try to bind the socket to a reserved port...
|
||||
*/
|
||||
|
||||
while (*port > 511)
|
||||
{
|
||||
/*
|
||||
* Set the port number...
|
||||
*/
|
||||
|
||||
_httpAddrSetPort(&addr, *port);
|
||||
|
||||
/*
|
||||
* Try binding the port to the socket; return if all is OK...
|
||||
*/
|
||||
|
||||
if (!bind(fd, (struct sockaddr *)&addr, (socklen_t)httpAddrLength(&addr)))
|
||||
return (fd);
|
||||
|
||||
/*
|
||||
* Stop if we have any error other than "address already in use"...
|
||||
*/
|
||||
|
||||
if (errno != EADDRINUSE)
|
||||
{
|
||||
httpAddrClose(NULL, fd);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Try the next port...
|
||||
*/
|
||||
|
||||
(*port)--;
|
||||
}
|
||||
|
||||
/*
|
||||
* Wasn't able to bind to a reserved port, so close the socket and return
|
||||
* -1...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
closesocket(fd);
|
||||
#else
|
||||
close(fd);
|
||||
#endif /* WIN32 */
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'lpd_command()' - Send an LPR command sequence and wait for a reply.
|
||||
*/
|
||||
@@ -827,7 +753,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* priviledged lport between 721 and 731...
|
||||
*/
|
||||
|
||||
if ((fd = cups_rresvport(&lport, addr->addr.addr.sa_family)) < 0)
|
||||
if ((fd = rresvport_af(&lport, addr->addr.addr.sa_family)) < 0)
|
||||
{
|
||||
perror("DEBUG: Unable to reserve port");
|
||||
sleep(1);
|
||||
@@ -1300,6 +1226,86 @@ lpd_write(int lpd_fd, /* I - LPD socket */
|
||||
}
|
||||
|
||||
|
||||
#ifndef HAVE_RRESVPORT_AF
|
||||
/*
|
||||
* 'rresvport_af()' - A simple implementation of rresvport_af().
|
||||
*/
|
||||
|
||||
static int /* O - Socket or -1 on error */
|
||||
rresvport_af(int *port, /* IO - Port number to bind to */
|
||||
int family) /* I - Address family */
|
||||
{
|
||||
http_addr_t addr; /* Socket address */
|
||||
int fd; /* Socket file descriptor */
|
||||
|
||||
|
||||
/*
|
||||
* Try to create an IPv4 socket...
|
||||
*/
|
||||
|
||||
if ((fd = socket(family, SOCK_STREAM, 0)) < 0)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Initialize the address buffer...
|
||||
*/
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.addr.sa_family = family;
|
||||
|
||||
/*
|
||||
* Try to bind the socket to a reserved port...
|
||||
*/
|
||||
|
||||
while (*port > 511)
|
||||
{
|
||||
/*
|
||||
* Set the port number...
|
||||
*/
|
||||
|
||||
_httpAddrSetPort(&addr, *port);
|
||||
|
||||
/*
|
||||
* Try binding the port to the socket; return if all is OK...
|
||||
*/
|
||||
|
||||
if (!bind(fd, (struct sockaddr *)&addr, httpAddrLength(&addr)))
|
||||
return (fd);
|
||||
|
||||
/*
|
||||
* Stop if we have any error other than "address already in use"...
|
||||
*/
|
||||
|
||||
if (errno != EADDRINUSE)
|
||||
{
|
||||
httpAddrClose(NULL, fd);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Try the next port...
|
||||
*/
|
||||
|
||||
(*port)--;
|
||||
}
|
||||
|
||||
/*
|
||||
* Wasn't able to bind to a reserved port, so close the socket and return
|
||||
* -1...
|
||||
*/
|
||||
|
||||
# ifdef WIN32
|
||||
closesocket(fd);
|
||||
# else
|
||||
close(fd);
|
||||
# endif /* WIN32 */
|
||||
|
||||
return (-1);
|
||||
}
|
||||
#endif /* !HAVE_RRESVPORT_AF */
|
||||
|
||||
|
||||
/*
|
||||
* 'sigterm_handler()' - Handle 'terminate' signals that stop the backend.
|
||||
*/
|
||||
@@ -1311,3 +1317,8 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
|
||||
abort_job = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: network.c 12124 2014-08-28 15:37:22Z msweet $"
|
||||
*
|
||||
* Common backend network APIs for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -299,3 +301,8 @@ backendNetworkSideCB(
|
||||
|
||||
return (cupsSideChannelWrite(command, status, data, datalen, 1.0));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: network.c 12124 2014-08-28 15:37:22Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
# product ID (omit for all vendor products), and a list of known issues:
|
||||
#
|
||||
# blacklist The printer is not functional with the USB backend.
|
||||
# delay-close Delay close/reset of selected interface
|
||||
# no-reattach Do no re-attach usblp kernel module after printing.
|
||||
# soft-reset Do a soft reset after printing for cleanup.
|
||||
# unidir Only supported unidirectional I/O
|
||||
@@ -52,67 +51,67 @@
|
||||
# NEC Picty800 (HP OEM)
|
||||
0x0409 0xf1be unidir
|
||||
|
||||
# Lexmark International, Inc. (e250d) (https://bugs.launchpad.net/bugs/1084164)
|
||||
# Lexmark International, Inc. (e250d), https://bugs.launchpad.net/bugs/1084164
|
||||
0x043d 0x00f3 no-reattach
|
||||
|
||||
# Kyocera Mita FS 820, by zut <kernel@zut.de>
|
||||
0x0482 0x0010 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP6000D Printer (https://bugs.launchpad.net/bugs/1160638)
|
||||
# Canon, Inc. PIXMA iP6000D Printer, https://bugs.launchpad.net/bugs/1160638
|
||||
0x04a9 0x1095 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP4200 Printer (Issue #4155)
|
||||
# Canon, Inc. PIXMA iP4200 Printer, http://www.cups.org/str.php?L4155
|
||||
0x04a9 0x10a2 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP4300 Printer (https://bugs.launchpad.net/bugs/1032385)
|
||||
# Canon, Inc. PIXMA iP4300 Printer, https://bugs.launchpad.net/bugs/1032385
|
||||
0x04a9 0x10b6 unidir
|
||||
|
||||
# Canon, Inc. MP210 (https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53)
|
||||
# Canon, Inc. MP210 https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53
|
||||
0x04a9 0x1721 unidir
|
||||
|
||||
# Canon, Inc. MP500 Printer (https://bugs.launchpad.net/bugs/1032456)
|
||||
# Canon, Inc. MP500 Printer, https://bugs.launchpad.net/bugs/1032456
|
||||
0x04a9 0x170c unidir
|
||||
|
||||
# Canon, Inc. MP510 Printer (https://bugs.launchpad.net/bugs/1050009)
|
||||
# Canon, Inc. MP510 Printer, https://bugs.launchpad.net/bugs/1050009
|
||||
0x04a9 0x1717 unidir
|
||||
|
||||
# Canon, Inc. MP550 Printer (Issue #4155)
|
||||
# Canon, Inc. MP550 Printer, http://www.cups.org/str.php?L4155
|
||||
0x04a9 0x173d unidir
|
||||
|
||||
# Canon, Inc. MP560 Printer (Issue #4155)
|
||||
# Canon, Inc. MP560 Printer, http://www.cups.org/str.php?L4155
|
||||
0x04a9 0x173e unidir
|
||||
|
||||
# Canon, Inc. MF4150 Printer (https://bugs.launchpad.net/bugs/1160638)
|
||||
# Canon, Inc. MF4150 Printer, https://bugs.launchpad.net/bugs/1160638
|
||||
0x04a9 0x26a3 no-reattach
|
||||
|
||||
# Brother Industries, Ltd HL-1250 Laser Printer (https://bugs.debian.org/712512)
|
||||
# Brother Industries, Ltd HL-1250 Laser Printer, https://bugs.debian.org/712512
|
||||
0x04f9 0x0007 no-reattach
|
||||
|
||||
# Brother Industries, Ltd HL-1430 Laser Printer (https://bugs.launchpad.net/bugs/1038695)
|
||||
# Brother Industries, Ltd HL-1430 Laser Printer, https://bugs.launchpad.net/bugs/1038695
|
||||
0x04f9 0x001a no-reattach
|
||||
|
||||
# Brother Industries, Ltd HL-1440 Laser Printer (https://bugs.launchpad.net/bugs/1000253)
|
||||
# Brother Industries, Ltd HL-1440 Laser Printer, https://bugs.launchpad.net/bugs/1000253
|
||||
0x04f9 0x000d no-reattach unidir
|
||||
|
||||
# Brother Industries, Ltd HL-1450 Laser Printer (https://bugs.launchpad.net/bugs/1000253)
|
||||
# Brother Industries, Ltd HL-1450 Laser Printer, https://bugs.launchpad.net/bugs/1000253
|
||||
0x04f9 0x000e no-reattach unidir
|
||||
|
||||
# Oki Data Corp. Okipage 14ex Printer (https://bugs.launchpad.net/bugs/872483)
|
||||
# Oki Data Corp. Okipage 14ex Printer, https://bugs.launchpad.net/bugs/872483
|
||||
0x06bc 0x000b no-reattach
|
||||
|
||||
# Oki Data Corp. B410d (https://bugs.launchpad.net/bugs/872483)
|
||||
# Oki Data Corp. B410d, https://bugs.launchpad.net/bugs/872483
|
||||
0x06bc 0x01c7 no-reattach
|
||||
|
||||
# Seiko Epson Corp. Stylus Color 740 / Photo 750 (http://bugs.debian.org/697970)
|
||||
# Seiko Epson Corp. Stylus Color 740 / Photo 750, http://bugs.debian.org/697970
|
||||
0x04b8 0x0001 no-reattach unidir
|
||||
|
||||
# Seiko Epson Corp. Stylus Color 670 (https://bugs.launchpad.net/bugs/872483)
|
||||
# Seiko Epson Corp. Stylus Color 670, https://bugs.launchpad.net/bugs/872483
|
||||
0x04b8 0x0005 no-reattach
|
||||
|
||||
# Seiko Epson Receipt Printer M129C
|
||||
0x04b8 0x0202 vendor-class
|
||||
|
||||
# Prolific Technology, Inc. PL2305 Parallel Port (USB -> Parallel adapter) (https://bugs.launchpad.net/bugs/987485)
|
||||
# Prolific Technology, Inc. PL2305 Parallel Port (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485
|
||||
0x067b 0x2305 no-reattach soft-reset unidir
|
||||
|
||||
# Xerox Phaser 3124 https://bugzilla.redhat.com/show_bug.cgi?id=867392
|
||||
@@ -121,13 +120,13 @@
|
||||
# Xerox WorkCentre 3210 https://bugs.launchpad.net/bugs/1102470
|
||||
0x0924 0x4293 no-reattach
|
||||
|
||||
# QinHeng Electronics CH340S (USB -> Parallel adapter) (https://bugs.launchpad.net/bugs/1000253)
|
||||
# QinHeng Electronics CH340S (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/1000253
|
||||
0x1a86 0x7584 no-reattach
|
||||
|
||||
# All Samsung devices (https://bugs.launchpad.net/bugs/1032456)
|
||||
# All Samsung devices, https://bugs.launchpad.net/bugs/1032456
|
||||
0x04e8 soft-reset
|
||||
|
||||
# All Zebra devices (https://bugs.launchpad.net/bugs/1001028)
|
||||
# All Zebra devices, https://bugs.launchpad.net/bugs/1001028
|
||||
0x0a5f unidir
|
||||
|
||||
# Canon CP-10
|
||||
@@ -217,33 +216,14 @@
|
||||
# Lexmark E238 (<rdar://problem/14493054>)
|
||||
0x043d 0x00d7 no-reattach
|
||||
|
||||
# Lexmark E238 (Issue #4448)
|
||||
# Lexmark E238 (STR #4448)
|
||||
0x043d 0x009a no-reattach
|
||||
|
||||
# Canon MX310 (Issue #4482)
|
||||
# Canon MX310 (STR #4482)
|
||||
0x04a9 0x1728 unidir
|
||||
|
||||
# Canon MX320 (Issue #4482)
|
||||
# Canon MX320 (STR #4482)
|
||||
0x04A9 0x1736 unidir
|
||||
|
||||
# All Intermec devices (Issue #4553)
|
||||
# All Intermec devices (STR #4553)
|
||||
0x067e no-reattach
|
||||
|
||||
# HP LaserJet 1150 (Issue #4549)
|
||||
0x03f0 0x0f17 delay-close
|
||||
|
||||
# HP LaserJet 1300 (Issue #4549)
|
||||
0x03f0 0x1017 delay-close
|
||||
0x03f0 0x1117 delay-close
|
||||
|
||||
# HP LaserJet 1320 (Issue #4549)
|
||||
0x03f0 0x1d17 delay-close
|
||||
|
||||
# Canon, Inc. MP530 Printer
|
||||
0x04a9 0x1712 unidir
|
||||
|
||||
# Xerox WorkCentre 3220 (https://bugs.launchpad.net/bugs/1406203, Issue #4789)
|
||||
0x0924 0x4294 no-reattach
|
||||
|
||||
# Lexmark C540n (Issue #4778)
|
||||
0x043d 0x0139 no-reattach
|
||||
|
||||
+14
-8
@@ -1,16 +1,18 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Psuedo-backend for CUPS testing purposes.
|
||||
# "$Id$"
|
||||
#
|
||||
# Copyright 2011 by Apple Inc.
|
||||
# Psuedo-backend for CUPS testing purposes.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# Copyright 2011 by Apple Inc.
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
|
||||
if test $# = 0; then
|
||||
@@ -22,3 +24,7 @@ fi
|
||||
cat $6 >/dev/null
|
||||
sleep 5
|
||||
exit 0
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: runloop.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Common run loop APIs for CUPS backends.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -523,3 +525,8 @@ backendWaitLoop(
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: runloop.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: snmp-supplies.c 12228 2014-10-21 13:42:05Z msweet $"
|
||||
*
|
||||
* SNMP supplies functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2015 by Apple Inc.
|
||||
* Copyright 2008-2014 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -17,7 +19,6 @@
|
||||
*/
|
||||
|
||||
#include "backend-private.h"
|
||||
#include <cups/ppd-private.h>
|
||||
#include <cups/array.h>
|
||||
|
||||
|
||||
@@ -1094,3 +1095,8 @@ utf16_to_utf8(
|
||||
|
||||
cupsUTF32ToUTF8(dst, temp, (int)dstsize);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: snmp-supplies.c 12228 2014-10-21 13:42:05Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: snmp.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* SNMP discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -1359,3 +1361,8 @@ update_cache(snmp_cache_t *device, /* I - Device */
|
||||
|
||||
list_device(device);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: snmp.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: socket.c 11907 2014-06-09 18:35:32Z msweet $"
|
||||
*
|
||||
* AppSocket backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -512,3 +514,8 @@ wait_bc(int device_fd, /* I - Socket */
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: socket.c 11907 2014-06-09 18:35:32Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-9
@@ -1,16 +1,22 @@
|
||||
/*
|
||||
* IEEE-1284 support functions test program for CUPS.
|
||||
* "$Id: test1284.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
* IEEE-1284 support functions test program for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Test the device-ID functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -71,3 +77,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: test1284.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: testbackend.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* Backend test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -675,3 +677,8 @@ walk_cb(const char *oid, /* I - OID */
|
||||
|
||||
printf("CUPS_SC_CMD_SNMP_WALK %s, %d bytes (%s)\n", oid, datalen, temp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testbackend.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
/*
|
||||
* SNMP supplies test program for CUPS.
|
||||
* "$Id: testsupplies.c 3247 2011-05-12 06:22:31Z msweet $"
|
||||
*
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
* SNMP supplies test program for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Show the supplies state of a printer.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -70,3 +76,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testsupplies.c 3247 2011-05-12 06:22:31Z msweet $".
|
||||
*/
|
||||
|
||||
+284
-286
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
* Copyright 2005-2016 Apple Inc. All rights reserved.
|
||||
* "$Id: usb-darwin.c 12529 2015-02-23 18:57:57Z msweet $"
|
||||
*
|
||||
* Copyright 2005-2014 Apple Inc. All rights reserved.
|
||||
*
|
||||
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
|
||||
* Inc. ("Apple") in consideration of your agreement to the following
|
||||
@@ -61,7 +63,6 @@
|
||||
#include <cups/file-private.h>
|
||||
#include <cups/sidechannel.h>
|
||||
#include <cups/language-private.h>
|
||||
#include <cups/ppd-private.h>
|
||||
#include "backend-private.h"
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
@@ -94,7 +95,7 @@ extern char **environ;
|
||||
#define WAIT_SIDE_DELAY 3
|
||||
#define DEFAULT_TIMEOUT 5000L
|
||||
|
||||
#define USB_INTERFACE_KIND CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID245)
|
||||
#define USB_INTERFACE_KIND CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID190)
|
||||
#define kUSBLanguageEnglish 0x409
|
||||
|
||||
#define PRINTER_POLLING_INTERVAL 5 /* seconds */
|
||||
@@ -139,7 +140,7 @@ struct crashreporter_annotations_t gCRAnnotations
|
||||
#define kUSBPrintingProtocolBidirectional 2
|
||||
#define kUSBPrintingProtocolIPP 4
|
||||
|
||||
typedef IOUSBInterfaceInterface245 **printer_interface_t;
|
||||
typedef IOUSBInterfaceInterface190 **printer_interface_t;
|
||||
|
||||
typedef struct iodevice_request_s /**** Device request ****/
|
||||
{
|
||||
@@ -202,7 +203,7 @@ typedef struct classdriver_s /**** g.classdriver context ****/
|
||||
|
||||
} classdriver_t;
|
||||
|
||||
typedef Boolean (*iterator_callback_t)(io_service_t obj, printer_interface_t printerIntf, void *refcon);
|
||||
typedef Boolean (*iterator_callback_t)(void *refcon, io_service_t obj, CFStringRef deviceIDString, UInt32 deviceLocation, UInt8 interfaceNum, UInt8 alternateSetting);
|
||||
|
||||
typedef struct iterator_reference_s /**** Iterator reference data */
|
||||
{
|
||||
@@ -231,7 +232,6 @@ typedef struct globals_s
|
||||
UInt32 location;
|
||||
UInt8 interfaceNum;
|
||||
UInt8 alternateSetting;
|
||||
UInt8 interfaceProtocol;
|
||||
|
||||
CFRunLoopTimerRef status_timer;
|
||||
|
||||
@@ -241,7 +241,6 @@ typedef struct globals_s
|
||||
ssize_t debug_bytes; /* Current bytes to read */
|
||||
#endif /* DEBUG_WRITES */
|
||||
|
||||
Boolean use_generic_class_driver;
|
||||
Boolean wait_eof;
|
||||
int drain_output; /* Drain all pending output */
|
||||
int bidi_flag; /* 0=unidirectional, 1=bidirectional */
|
||||
@@ -265,8 +264,8 @@ int Iterating = 0; /* Are we iterating the bus? */
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static Boolean list_device_cb(io_service_t obj, printer_interface_t printerIntf, void *refcon);
|
||||
static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf, void *refcon);
|
||||
static Boolean find_device_cb(void *refcon, io_service_t obj, CFStringRef deviceIDString, UInt32 deviceLocation, UInt8 interfaceNum, UInt8 alternateSetting);
|
||||
static Boolean list_device_cb(void *refcon, io_service_t obj, CFStringRef deviceIDString, UInt32 deviceLocation, UInt8 interfaceNum, UInt8 alternateSetting);
|
||||
|
||||
static CFStringRef cfstr_create_trim(const char *cstr);
|
||||
static CFStringRef copy_value_for_key(CFStringRef deviceID, CFStringRef *keys);
|
||||
@@ -301,10 +300,10 @@ static const char *next_line (const char *buffer);
|
||||
static void parse_pserror (char *sockBuffer, int len);
|
||||
#endif /* PARSE_PS_ERRORS */
|
||||
|
||||
static printer_interface_t usb_printer_interface_interface(io_service_t usbClass);
|
||||
|
||||
static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer, UInt8 alternateSetting);
|
||||
static CFStringRef copy_printer_interface_indexed_description(printer_interface_t printer, UInt8 index, UInt16 language);
|
||||
static IOUSBInterfaceInterface220 **usb_interface220_for_service(io_service_t usbClass);
|
||||
static IOUSBDeviceInterface **usb_device_interface_for_device(io_service_t usbDevice);
|
||||
static CFStringRef printer_interface_deviceid(IOUSBInterfaceInterface220 **printer, UInt8 alternateSetting);
|
||||
static CFStringRef printer_interface_indexed_description(IOUSBInterfaceInterface220 ** printer, UInt8 index, UInt16 language);
|
||||
static CFStringRef deviceIDCopyManufacturer(CFStringRef deviceID);
|
||||
static CFStringRef deviceIDCopyModel(CFStringRef deviceID);
|
||||
static CFStringRef deviceIDCopySerialNumber(CFStringRef deviceID);
|
||||
@@ -419,17 +418,10 @@ print_device(const char *uri, /* I - Device URI */
|
||||
g.printer_obj = 0x0;
|
||||
g.classdriver = 0x0;
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Looking for '%s %s'\n", hostname, resource);
|
||||
|
||||
do
|
||||
{
|
||||
iterate_printers(find_device_cb, NULL);
|
||||
if (g.printer_obj != 0x0)
|
||||
break;
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for printer to become available."));
|
||||
sleep(5);
|
||||
} while (true);
|
||||
iterate_printers(find_device_cb, NULL);
|
||||
|
||||
fputs("DEBUG: Opening connection\n", stderr);
|
||||
|
||||
@@ -965,27 +957,6 @@ static void *read_thread(void *reference)
|
||||
|
||||
} while (g.wait_eof || !g.read_thread_stop); /* Abort from main thread tests error here */
|
||||
|
||||
/* Workaround for usb race condition. <rdar://problem/21882551> */
|
||||
if (!g.wait_eof && g.use_generic_class_driver)
|
||||
{
|
||||
const char *pdl = getenv("FINAL_CONTENT_TYPE");
|
||||
if (pdl && strcmp(pdl, "application/vnd.cups-postscript") == 0)
|
||||
{
|
||||
while (readstatus == kIOReturnSuccess && ((rbytes > 0 && readbuffer[rbytes-1] != 0x4) || rbytes == 0))
|
||||
{
|
||||
start = mach_absolute_time();
|
||||
|
||||
rbytes = sizeof(readbuffer);
|
||||
readstatus = (*g.classdriver)->ReadPipe(g.classdriver, readbuffer, &rbytes);
|
||||
if (readstatus == kIOReturnSuccess && rbytes > 0 && readbuffer[rbytes-1] == 0x4)
|
||||
break;
|
||||
|
||||
/* Make sure this loop executes no more than once every 250 miliseconds... */
|
||||
mach_wait_until(start + delay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Let the main thread know that we have completed the read thread...
|
||||
*/
|
||||
@@ -1124,240 +1095,256 @@ sidechannel_thread(void *reference)
|
||||
/*
|
||||
* 'iterate_printers()' - Iterate over all the printers.
|
||||
*/
|
||||
|
||||
static void iterate_printers(iterator_callback_t callBack, void *userdata)
|
||||
{
|
||||
Iterating = 1;
|
||||
|
||||
iterator_reference_t reference = { callBack, userdata, true };
|
||||
|
||||
IONotificationPortRef addNotification = IONotificationPortCreate(kIOMasterPortDefault);
|
||||
|
||||
int printingClass = kUSBPrintingClass;
|
||||
int printingSubclass = kUSBPrintingSubclass;
|
||||
|
||||
CFNumberRef interfaceClass = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &printingClass);
|
||||
CFNumberRef interfaceSubClass = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &printingSubclass);
|
||||
|
||||
CFMutableDictionaryRef usbPrinterMatchDictionary = IOServiceMatching(kIOUSBInterfaceClassName);
|
||||
CFDictionaryAddValue(usbPrinterMatchDictionary, CFSTR("bInterfaceClass"), interfaceClass);
|
||||
CFDictionaryAddValue(usbPrinterMatchDictionary, CFSTR("bInterfaceSubClass"), interfaceSubClass);
|
||||
|
||||
CFRelease(interfaceClass);
|
||||
CFRelease(interfaceSubClass);
|
||||
|
||||
io_iterator_t add_iterator = IO_OBJECT_NULL;
|
||||
IOServiceAddMatchingNotification(addNotification, kIOMatchedNotification,
|
||||
usbPrinterMatchDictionary, &device_added, &reference, &add_iterator);
|
||||
if (add_iterator != IO_OBJECT_NULL)
|
||||
{
|
||||
device_added (&reference, add_iterator);
|
||||
if (reference.keepRunning)
|
||||
Iterating = 1;
|
||||
|
||||
mach_port_t masterPort = 0x0;
|
||||
kern_return_t kr = IOMasterPort (bootstrap_port, &masterPort);
|
||||
|
||||
if (kr == kIOReturnSuccess && masterPort != 0x0)
|
||||
{
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(addNotification), kCFRunLoopDefaultMode);
|
||||
CFRunLoopRun();
|
||||
iterator_reference_t reference = { callBack, userdata, true };
|
||||
|
||||
IONotificationPortRef addNotification = IONotificationPortCreate(masterPort);
|
||||
io_iterator_t addIterator = IO_OBJECT_NULL;
|
||||
|
||||
kr = IOServiceAddMatchingNotification(addNotification, kIOFirstMatchNotification, IOServiceMatching(kIOUSBDeviceClassName),
|
||||
&device_added, &reference, &addIterator);
|
||||
if (kr == kIOReturnSuccess && addIterator != IO_OBJECT_NULL)
|
||||
{
|
||||
device_added(&reference, addIterator);
|
||||
if (reference.keepRunning)
|
||||
{
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(addNotification), kCFRunLoopDefaultMode);
|
||||
CFRunLoopRun();
|
||||
}
|
||||
IOObjectRelease(addIterator);
|
||||
}
|
||||
mach_port_deallocate(mach_task_self(), masterPort);
|
||||
}
|
||||
IOObjectRelease(add_iterator);
|
||||
}
|
||||
Iterating = 0;
|
||||
|
||||
Iterating = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'device_added()' - Device added notifier.
|
||||
*/
|
||||
#define IsPrintingInterface(c,s,p) ((c) == kUSBPrintingInterfaceClass && (s) == kUSBPrintingSubclass && (p) != kUSBPrintingProtocolIPP)
|
||||
|
||||
static void device_added(void *userdata, io_iterator_t iterator)
|
||||
{
|
||||
iterator_reference_t *reference = userdata;
|
||||
io_service_t intf;
|
||||
|
||||
while (reference->keepRunning && (intf = IOIteratorNext(iterator)) != 0x0)
|
||||
{
|
||||
printer_interface_t printerIntf = usb_printer_interface_interface(intf);
|
||||
if (printerIntf != NULL)
|
||||
iterator_reference_t *reference = userdata;
|
||||
io_service_t device;
|
||||
|
||||
while (reference->keepRunning && (device = IOIteratorNext(iterator)) != 0x0)
|
||||
{
|
||||
UInt8 intfClass = 0, intfSubClass = 0;
|
||||
UInt32 locationID = 0;
|
||||
IOUSBDeviceInterface **devIntf = NULL;
|
||||
io_iterator_t intfIterator = IO_OBJECT_NULL;
|
||||
io_object_t intf = IO_OBJECT_NULL;
|
||||
|
||||
(*printerIntf)->GetInterfaceClass(printerIntf, &intfClass);
|
||||
(*printerIntf)->GetInterfaceSubClass(printerIntf, &intfSubClass);
|
||||
if (intfClass == kUSBPrintingInterfaceClass && intfSubClass == kUSBPrintingSubclass)
|
||||
reference->keepRunning = reference->callback(intf, printerIntf, userdata);
|
||||
(*printerIntf)->Release(printerIntf);
|
||||
}
|
||||
IOObjectRelease(intf);
|
||||
devIntf = usb_device_interface_for_device(device);
|
||||
if (devIntf == NULL)
|
||||
goto device_added_done;
|
||||
|
||||
UInt16 vendorUniqueID;
|
||||
if ((*devIntf)->GetDeviceVendor(devIntf, &vendorUniqueID) != kIOReturnSuccess || vendorUniqueID == kAppleVendorID || vendorUniqueID == 0x0A5C)
|
||||
goto device_added_done;
|
||||
|
||||
if ((*devIntf)->GetLocationID(devIntf, &locationID) != kIOReturnSuccess)
|
||||
goto device_added_done;
|
||||
|
||||
IOUSBFindInterfaceRequest req = { kIOUSBFindInterfaceDontCare, kIOUSBFindInterfaceDontCare, kIOUSBFindInterfaceDontCare, kIOUSBFindInterfaceDontCare };
|
||||
if ((*devIntf)->CreateInterfaceIterator(devIntf, &req, &intfIterator) != kIOReturnSuccess)
|
||||
goto device_added_done;
|
||||
|
||||
while (reference->keepRunning && (intf = IOIteratorNext(intfIterator)))
|
||||
{
|
||||
IOUSBInterfaceInterface220 **intf220 = usb_interface220_for_service(intf);
|
||||
if (intf220 != NULL)
|
||||
{
|
||||
UInt8 intfClass = 0, intfSubclass = 0, intfProtocol = 0, intfNumber = 0;
|
||||
|
||||
(*intf220)->GetInterfaceClass(intf220, &intfClass);
|
||||
(*intf220)->GetInterfaceSubClass(intf220, &intfSubclass);
|
||||
(*intf220)->GetInterfaceProtocol(intf220, &intfProtocol);
|
||||
(*intf220)->GetInterfaceNumber(intf220, &intfNumber);
|
||||
|
||||
if (IsPrintingInterface(intfClass, intfSubclass, intfProtocol))
|
||||
{
|
||||
CFStringRef deviceIDString = printer_interface_deviceid(intf220, 0);
|
||||
if (deviceIDString != NULL)
|
||||
{
|
||||
reference->keepRunning = reference->callback(userdata, intf, deviceIDString, locationID, intfNumber, 0);
|
||||
CFRelease(deviceIDString);
|
||||
}
|
||||
}
|
||||
|
||||
IOUSBInterfaceDescriptor *intfDesc = nil;
|
||||
while (reference->keepRunning && (intfDesc = (IOUSBInterfaceDescriptor *)(*intf220)->FindNextAssociatedDescriptor(intf220, intfDesc, kUSBInterfaceDesc)))
|
||||
{
|
||||
intfClass = intfDesc->bInterfaceClass;
|
||||
intfSubclass = intfDesc->bInterfaceSubClass;
|
||||
intfProtocol = intfDesc->bInterfaceProtocol;
|
||||
|
||||
if ((IsPrintingInterface(intfClass, intfSubclass, intfProtocol)))
|
||||
{
|
||||
CFStringRef deviceIDString = printer_interface_deviceid(intf220, intfDesc->bAlternateSetting);
|
||||
if (deviceIDString != NULL)
|
||||
{
|
||||
reference->keepRunning = reference->callback(userdata, intf, deviceIDString, locationID, intfNumber, intfDesc->bAlternateSetting);
|
||||
CFRelease(deviceIDString);
|
||||
}
|
||||
}
|
||||
}
|
||||
(*intf220)->Release(intf220);
|
||||
}
|
||||
}
|
||||
|
||||
device_added_done:
|
||||
if (devIntf != NULL) (*devIntf)->Release(devIntf);
|
||||
if (intfIterator != IO_OBJECT_NULL) IOObjectRelease(intfIterator);
|
||||
|
||||
IOObjectRelease(device);
|
||||
}
|
||||
|
||||
|
||||
/* One last call to the call back now that we are not longer have printers left to iterate...
|
||||
*/
|
||||
if (reference->keepRunning && reference->callback)
|
||||
reference->keepRunning = reference->callback(IO_OBJECT_NULL, NULL, reference->userdata);
|
||||
|
||||
reference->keepRunning = reference->callback(reference->userdata, IO_OBJECT_NULL, NULL, 0, 0, 0);
|
||||
|
||||
if (!reference->keepRunning)
|
||||
CFRunLoopStop(CFRunLoopGetCurrent());
|
||||
CFRunLoopStop(CFRunLoopGetCurrent());
|
||||
}
|
||||
|
||||
/*
|
||||
* 'list_device_cb()' - list_device iterator callback.
|
||||
*/
|
||||
static Boolean list_device_cb(io_service_t obj, printer_interface_t printerIntf, void *refcon)
|
||||
|
||||
static Boolean list_device_cb(void *refcon, io_service_t obj, CFStringRef deviceIDString, UInt32 deviceLocation, UInt8 interfaceNum, UInt8 alternateSetting)
|
||||
{
|
||||
(void)refcon;
|
||||
(void)interfaceNum;
|
||||
(void)alternateSetting;
|
||||
|
||||
if (obj != IO_OBJECT_NULL)
|
||||
{
|
||||
CFStringRef deviceIDString = NULL;
|
||||
CFStringRef make = NULL;
|
||||
CFStringRef model = NULL;
|
||||
CFStringRef serial = NULL;
|
||||
UInt32 intfLocation;
|
||||
|
||||
deviceIDString = copy_printer_interface_deviceid(printerIntf, 0);
|
||||
if (deviceIDString == NULL)
|
||||
goto list_device_done;
|
||||
|
||||
make = deviceIDCopyManufacturer(deviceIDString);
|
||||
model = deviceIDCopyModel(deviceIDString);
|
||||
serial = deviceIDCopySerialNumber(deviceIDString);
|
||||
|
||||
char uristr[1024], makestr[1024], modelstr[1024], serialstr[1024];
|
||||
char optionsstr[1024], idstr[1024], make_modelstr[1024];
|
||||
|
||||
CFStringGetCString(deviceIDString, idstr, sizeof(idstr), kCFStringEncodingUTF8);
|
||||
backendGetMakeModel(idstr, make_modelstr, sizeof(make_modelstr));
|
||||
|
||||
modelstr[0] = '/';
|
||||
|
||||
if (make == NULL || !CFStringGetCString(make, makestr, sizeof(makestr), kCFStringEncodingUTF8))
|
||||
strlcpy(makestr, "Unknown", sizeof(makestr));
|
||||
|
||||
if (model == NULL || !CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1, kCFStringEncodingUTF8))
|
||||
strlcpy(modelstr + 1, "Printer", sizeof(modelstr) - 1);
|
||||
|
||||
optionsstr[0] = '\0';
|
||||
if (serial != NULL && CFStringGetCString(serial, serialstr, sizeof(serialstr), kCFStringEncodingUTF8))
|
||||
snprintf(optionsstr, sizeof(optionsstr), "?serial=%s", serialstr);
|
||||
else if ((*printerIntf)->GetLocationID(printerIntf, &intfLocation) == kIOReturnSuccess)
|
||||
snprintf(optionsstr, sizeof(optionsstr), "?location=%x", (unsigned)intfLocation);
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uristr, sizeof(uristr), "usb", NULL, makestr, 0, modelstr);
|
||||
strlcat(uristr, optionsstr, sizeof(uristr));
|
||||
|
||||
cupsBackendReport("direct", uristr, make_modelstr, make_modelstr, idstr,
|
||||
if (obj != IO_OBJECT_NULL)
|
||||
{
|
||||
CFStringRef make = NULL;
|
||||
CFStringRef model = NULL;
|
||||
CFStringRef serial = NULL;
|
||||
|
||||
char uristr[1024], makestr[1024], modelstr[1024], serialstr[1024];
|
||||
char optionsstr[1024], idstr[1024], make_modelstr[1024];
|
||||
|
||||
CFStringGetCString(deviceIDString, idstr, sizeof(idstr), kCFStringEncodingUTF8);
|
||||
backendGetMakeModel(idstr, make_modelstr, sizeof(make_modelstr));
|
||||
|
||||
modelstr[0] = '/';
|
||||
|
||||
if (make == NULL || !CFStringGetCString(make, makestr, sizeof(makestr), kCFStringEncodingUTF8))
|
||||
strlcpy(makestr, "Unknown", sizeof(makestr));
|
||||
|
||||
if (model == NULL || !CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1, kCFStringEncodingUTF8))
|
||||
strlcpy(modelstr + 1, "Printer", sizeof(modelstr) - 1);
|
||||
|
||||
optionsstr[0] = '\0';
|
||||
if (serial != NULL && CFStringGetCString(serial, serialstr, sizeof(serialstr), kCFStringEncodingUTF8))
|
||||
snprintf(optionsstr, sizeof(optionsstr), "?serial=%s", serialstr);
|
||||
else if (deviceLocation != 0)
|
||||
snprintf(optionsstr, sizeof(optionsstr), "?location=%x", (unsigned)deviceLocation);
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uristr, sizeof(uristr), "usb", NULL, makestr, 0, modelstr);
|
||||
strlcat(uristr, optionsstr, sizeof(uristr));
|
||||
|
||||
cupsBackendReport("direct", uristr, make_modelstr, make_modelstr, idstr,
|
||||
NULL);
|
||||
list_device_done:
|
||||
|
||||
if (make != NULL) CFRelease(make);
|
||||
if (model != NULL) CFRelease(model);
|
||||
if (serial != NULL) CFRelease(serial);
|
||||
}
|
||||
return obj != IO_OBJECT_NULL;
|
||||
}
|
||||
|
||||
return obj != IO_OBJECT_NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* 'find_device_cb()' - print_device iterator callback.
|
||||
*/
|
||||
static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf, void *refcon)
|
||||
static Boolean find_device_cb(void *refcon, io_service_t obj, CFStringRef deviceIDString, UInt32 deviceLocation, UInt8 interfaceNum, UInt8 alternateSetting)
|
||||
{
|
||||
(void)refcon;
|
||||
|
||||
Boolean keepLooking = true;
|
||||
|
||||
if (obj != IO_OBJECT_NULL)
|
||||
{
|
||||
CFStringRef deviceIDString = NULL;
|
||||
CFStringRef make = NULL;
|
||||
CFStringRef model = NULL;
|
||||
CFStringRef serial = NULL;
|
||||
|
||||
deviceIDString = copy_printer_interface_deviceid(printerIntf, 0);
|
||||
if (deviceIDString == NULL)
|
||||
goto find_device_done;
|
||||
|
||||
make = deviceIDCopyManufacturer(deviceIDString);
|
||||
model = deviceIDCopyModel(deviceIDString);
|
||||
serial = deviceIDCopySerialNumber(deviceIDString);
|
||||
|
||||
if (make && CFStringCompare(make, g.make, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
Boolean keepLooking = true;
|
||||
|
||||
if (obj != IO_OBJECT_NULL)
|
||||
{
|
||||
if (model && CFStringCompare(model, g.model, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
{
|
||||
UInt8 intfAltSetting = 0, intfNumber = 0, intfProtocol = 0;
|
||||
UInt32 intfLocation = 0;
|
||||
|
||||
(*printerIntf)->GetInterfaceProtocol(printerIntf, &intfProtocol);
|
||||
(*printerIntf)->GetAlternateSetting(printerIntf, &intfAltSetting);
|
||||
(*printerIntf)->GetInterfaceNumber(printerIntf, &intfNumber);
|
||||
(*printerIntf)->GetLocationID(printerIntf, &intfLocation);
|
||||
|
||||
if (g.serial != NULL && CFStringGetLength(g.serial) > 0)
|
||||
CFStringRef make = deviceIDCopyManufacturer(deviceIDString);
|
||||
CFStringRef model = deviceIDCopyModel(deviceIDString);
|
||||
CFStringRef serial = deviceIDCopySerialNumber(deviceIDString);
|
||||
|
||||
if (make && CFStringCompare(make, g.make, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
{
|
||||
if (serial != NULL && CFStringCompare(serial, g.serial, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
{
|
||||
g.interfaceProtocol = intfProtocol;
|
||||
g.location = intfLocation;
|
||||
g.alternateSetting = intfAltSetting;
|
||||
if (intfProtocol != kUSBPrintingProtocolIPP)
|
||||
if (model && CFStringCompare(model, g.model, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
{
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
if (g.serial != NULL && CFStringGetLength(g.serial) > 0)
|
||||
{
|
||||
if (serial != NULL && CFStringCompare(serial, g.serial, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
{
|
||||
IOObjectRetain(obj);
|
||||
g.printer_obj = obj;
|
||||
g.alternateSetting = alternateSetting;
|
||||
keepLooking = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g.printer_obj != 0)
|
||||
IOObjectRelease(g.printer_obj);
|
||||
|
||||
g.alternateSetting = alternateSetting;
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
|
||||
if (g.location == 0 || g.location == deviceLocation)
|
||||
keepLooking = false;
|
||||
}
|
||||
|
||||
if ( !keepLooking )
|
||||
g.interfaceNum = interfaceNum;
|
||||
}
|
||||
keepLooking = (intfProtocol == kUSBPrintingProtocolIPP);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g.printer_obj != 0)
|
||||
IOObjectRelease(g.printer_obj);
|
||||
|
||||
g.location = intfLocation;
|
||||
g.alternateSetting = intfAltSetting;
|
||||
g.interfaceProtocol = intfProtocol;
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
|
||||
if (g.location == 0 || g.location == intfLocation)
|
||||
keepLooking = false;
|
||||
}
|
||||
|
||||
if (!keepLooking)
|
||||
g.interfaceNum = intfNumber;
|
||||
}
|
||||
|
||||
if (make) CFRelease(make);
|
||||
if (model) CFRelease(model);
|
||||
if (serial) CFRelease(serial);
|
||||
}
|
||||
|
||||
find_device_done:
|
||||
if (deviceIDString != NULL) CFRelease(deviceIDString);
|
||||
if (make != NULL) CFRelease(make);
|
||||
if (model != NULL) CFRelease(model);
|
||||
if (serial != NULL) CFRelease(serial);
|
||||
}
|
||||
else
|
||||
{
|
||||
keepLooking = (g.printer_obj == 0 && g.interfaceProtocol != kUSBPrintingProtocolIPP);
|
||||
if (obj == IO_OBJECT_NULL && keepLooking)
|
||||
else
|
||||
{
|
||||
CFRunLoopTimerContext context = { 0, refcon, NULL, NULL, NULL };
|
||||
CFRunLoopTimerRef timer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + 1.0, 10, 0x0, 0x0, status_timer_cb, &context);
|
||||
if (timer != NULL)
|
||||
{
|
||||
CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopDefaultMode);
|
||||
g.status_timer = timer;
|
||||
}
|
||||
keepLooking = (g.printer_obj == 0);
|
||||
if (obj == IO_OBJECT_NULL && keepLooking)
|
||||
{
|
||||
CFRunLoopTimerContext context = { 0, refcon, NULL, NULL, NULL };
|
||||
CFRunLoopTimerRef timer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + 1.0, 10, 0x0, 0x0, status_timer_cb, &context);
|
||||
if (timer != NULL)
|
||||
{
|
||||
CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopDefaultMode);
|
||||
g.status_timer = timer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!keepLooking && g.status_timer != NULL)
|
||||
{
|
||||
fputs("STATE: -offline-report\n", stderr);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("The printer is now online."));
|
||||
CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), g.status_timer, kCFRunLoopDefaultMode);
|
||||
CFRelease(g.status_timer);
|
||||
g.status_timer = NULL;
|
||||
}
|
||||
|
||||
return keepLooking;
|
||||
|
||||
if (!keepLooking && g.status_timer != NULL)
|
||||
{
|
||||
fputs("STATE: -offline-report\n", stderr);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("The printer is now online."));
|
||||
CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), g.status_timer, kCFRunLoopDefaultMode);
|
||||
CFRelease(g.status_timer);
|
||||
g.status_timer = NULL;
|
||||
}
|
||||
|
||||
return keepLooking;
|
||||
}
|
||||
|
||||
static CFStringRef deviceIDCopySerialNumber(CFStringRef deviceID)
|
||||
{
|
||||
CFStringRef serialKeys[] = { CFSTR("SN:"), CFSTR("SERN:"), NULL };
|
||||
|
||||
|
||||
return copy_value_for_key(deviceID, serialKeys);
|
||||
}
|
||||
|
||||
@@ -1525,7 +1512,6 @@ static kern_return_t load_printerdriver(CFStringRef *driverBundlePath)
|
||||
{
|
||||
*driverBundlePath = IORegistryEntryCreateCFProperty(g.printer_obj, kUSBClassDriverProperty, NULL, kNilOptions);
|
||||
|
||||
g.use_generic_class_driver = (*driverBundlePath == NULL || (CFStringCompare(*driverBundlePath, kUSBGenericTOPrinterClassDriver, 0x0) == kCFCompareEqualTo));
|
||||
kr = load_classdriver(*driverBundlePath, interface, &g.classdriver);
|
||||
|
||||
if (kr != kIOReturnSuccess)
|
||||
@@ -1536,22 +1522,39 @@ static kern_return_t load_printerdriver(CFStringRef *driverBundlePath)
|
||||
return kr;
|
||||
}
|
||||
|
||||
static printer_interface_t usb_printer_interface_interface(io_service_t usbClass)
|
||||
static IOUSBInterfaceInterface220 **usb_interface220_for_service(io_service_t usbClass)
|
||||
{
|
||||
printer_interface_t intf = NULL;
|
||||
IOUSBInterfaceInterface220 ** intf = NULL;
|
||||
IOCFPlugInInterface **plugin = NULL;
|
||||
SInt32 score;
|
||||
int kr = IOCreatePlugInInterfaceForService(usbClass, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &plugin, &score);
|
||||
if (kr == kIOReturnSuccess)
|
||||
{
|
||||
(*plugin)->QueryInterface(plugin, USB_INTERFACE_KIND, (LPVOID *)&intf);
|
||||
(*plugin)->QueryInterface(plugin, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID220), (LPVOID *)&intf);
|
||||
IODestroyPlugInInterface(plugin);
|
||||
}
|
||||
|
||||
return intf;
|
||||
}
|
||||
|
||||
static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer, UInt8 alternateSetting)
|
||||
static IOUSBDeviceInterface **usb_device_interface_for_device(io_service_t usbDevice)
|
||||
{
|
||||
IOUSBDeviceInterface ** intf = NULL;
|
||||
IOCFPlugInInterface **plugin = NULL;
|
||||
SInt32 score;
|
||||
|
||||
int kr = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugin, &score);
|
||||
if (kr == kIOReturnSuccess)
|
||||
{
|
||||
(*plugin)->QueryInterface(plugin, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID *)&intf);
|
||||
IODestroyPlugInInterface(plugin);
|
||||
}
|
||||
|
||||
return intf;
|
||||
}
|
||||
|
||||
|
||||
static CFStringRef printer_interface_deviceid(IOUSBInterfaceInterface220 **printer, UInt8 alternateSetting)
|
||||
{
|
||||
// I have tried to make this function as neat as I can, but the possibility of needing to resend
|
||||
// a request to get the entire string makes it hideous...
|
||||
@@ -1565,8 +1568,8 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
|
||||
#define kDefaultNoDataTimeout 5000L
|
||||
#define pack_device_id_wIndex(intf, alt) ((UInt16)((((UInt16)(intf)) << 8) | ((UInt8)(alt))))
|
||||
|
||||
if (printer == NULL)
|
||||
return NULL;
|
||||
if (printer == nil)
|
||||
return nil;
|
||||
|
||||
|
||||
IOReturn err = kIOReturnError;
|
||||
@@ -1588,15 +1591,15 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
|
||||
request.pData = NULL;
|
||||
}
|
||||
|
||||
IOReturn berr = kIOReturnError;
|
||||
IOReturn err = kIOReturnError;
|
||||
char *buffer = malloc(size);
|
||||
if (buffer == NULL)
|
||||
return kIOReturnNoMemory;
|
||||
|
||||
request.wLength = HostToUSBWord(size);
|
||||
request.pData = buffer;
|
||||
berr = (*printer)->ControlRequestTO(printer, (UInt8)0, &request);
|
||||
return berr;
|
||||
err = (*printer)->ControlRequestTO(printer, (UInt8)0, &request);
|
||||
return err;
|
||||
};
|
||||
|
||||
/* This request takes the 0 based configuration index. IOKit returns a 1 based configuration index */
|
||||
@@ -1621,7 +1624,7 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
|
||||
{
|
||||
ret = CFStringCreateWithBytes(NULL, (const UInt8 *) &request.pData[2], actualLength - 2, kCFStringEncodingUTF8, false);
|
||||
}
|
||||
else if (actualLength > 2) {
|
||||
else {
|
||||
err = sendRequest(actualLength);
|
||||
if (err == kIOReturnSuccess && request.wLenDone > 0)
|
||||
{
|
||||
@@ -1636,7 +1639,7 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
|
||||
}
|
||||
|
||||
CFStringRef manufacturer = deviceIDCopyManufacturer(ret);
|
||||
CFStringRef model = deviceIDCopyModel(ret);
|
||||
CFStringRef model = deviceIDCopyManufacturer(ret);
|
||||
CFStringRef serial = deviceIDCopySerialNumber(ret);
|
||||
|
||||
if (manufacturer == NULL || serial == NULL || model == NULL)
|
||||
@@ -1661,22 +1664,22 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
|
||||
CFMutableStringRef extras = CFStringCreateMutable(NULL, 0);
|
||||
if (manufacturer == NULL)
|
||||
{
|
||||
manufacturer = copy_printer_interface_indexed_description(printer, desc.iManufacturer, kUSBLanguageEnglish);
|
||||
if (manufacturer && CFStringGetLength(manufacturer) > 0)
|
||||
manufacturer = printer_interface_indexed_description(printer, desc.iManufacturer, kUSBLanguageEnglish);
|
||||
if (CFStringGetLength(manufacturer) > 0)
|
||||
CFStringAppendFormat(extras, NULL, CFSTR("MFG:%@;"), manufacturer);
|
||||
}
|
||||
|
||||
if (model == NULL)
|
||||
{
|
||||
model = copy_printer_interface_indexed_description(printer, desc.iProduct, kUSBLanguageEnglish);
|
||||
if (model && CFStringGetLength(model) > 0)
|
||||
CFStringAppendFormat(extras, NULL, CFSTR("MDL:%@;"), model);
|
||||
model = printer_interface_indexed_description(printer, desc.iProduct, kUSBLanguageEnglish);
|
||||
if (CFStringGetLength(model) > 0)
|
||||
CFStringAppendFormat(extras, NULL, CFSTR("MDL:%@;"), manufacturer);
|
||||
}
|
||||
|
||||
if (serial == NULL && desc.iSerialNumber != 0)
|
||||
{
|
||||
serial = copy_printer_interface_indexed_description(printer, desc.iSerialNumber, kUSBLanguageEnglish);
|
||||
if (serial && CFStringGetLength(serial) > 0)
|
||||
serial = printer_interface_indexed_description(printer, desc.iSerialNumber, kUSBLanguageEnglish);
|
||||
if (CFStringGetLength(serial) > 0)
|
||||
CFStringAppendFormat(extras, NULL, CFSTR("SERN:%@;"), serial);
|
||||
}
|
||||
|
||||
@@ -1694,8 +1697,14 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
|
||||
}
|
||||
}
|
||||
|
||||
if (ret != NULL)
|
||||
{
|
||||
if (manufacturer != NULL)
|
||||
CFRelease(manufacturer);
|
||||
if (model != NULL)
|
||||
CFRelease(model);
|
||||
if (serial != NULL)
|
||||
CFRelease(serial);
|
||||
|
||||
|
||||
/* Remove special characters from the serial number */
|
||||
CFRange range = (serial != NULL ? CFStringFind(serial, CFSTR("+"), 0) : CFRangeMake(0, 0));
|
||||
if (range.length == 1)
|
||||
@@ -1708,27 +1717,11 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
|
||||
ret = deviceIDString;
|
||||
CFStringFindAndReplace(deviceIDString, CFSTR("+"), CFSTR(""), range, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (manufacturer != NULL)
|
||||
CFRelease(manufacturer);
|
||||
|
||||
if (model != NULL)
|
||||
CFRelease(model);
|
||||
|
||||
if (serial != NULL)
|
||||
CFRelease(serial);
|
||||
|
||||
if (ret != NULL && CFStringGetLength(ret) == 0)
|
||||
{
|
||||
CFRelease(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return (CFStringGetLength(ret) > 0 ? ret : nil);
|
||||
}
|
||||
|
||||
static CFStringRef copy_printer_interface_indexed_description(printer_interface_t printer, UInt8 index, UInt16 language)
|
||||
static CFStringRef printer_interface_indexed_description(IOUSBInterfaceInterface220 ** printer, UInt8 index, UInt16 language)
|
||||
{
|
||||
IOReturn err;
|
||||
UInt8 description[256]; // Max possible descriptor length
|
||||
@@ -1766,7 +1759,7 @@ static CFStringRef copy_printer_interface_indexed_description(printer_interface_
|
||||
|
||||
err = (*printer)->ControlRequestTO(printer, 0, &request);
|
||||
if (err != kIOReturnSuccess && err != kIOReturnUnderrun)
|
||||
return NULL;
|
||||
return nil;
|
||||
}
|
||||
|
||||
unsigned int length = description[0];
|
||||
@@ -1782,17 +1775,17 @@ static CFStringRef copy_printer_interface_indexed_description(printer_interface_
|
||||
request.wIndex = language;
|
||||
|
||||
bzero(description, length);
|
||||
request.wLength = (UInt16)length;
|
||||
request.wLength = length;
|
||||
request.pData = &description;
|
||||
request.completionTimeout = 0;
|
||||
request.noDataTimeout = 60L;
|
||||
|
||||
err = (*printer)->ControlRequestTO(printer, 0, &request);
|
||||
if (err != kIOReturnSuccess)
|
||||
return NULL;
|
||||
return nil;
|
||||
|
||||
if (description[1] != kUSBStringDesc)
|
||||
return NULL;
|
||||
return nil;
|
||||
|
||||
if ((description[0] & 1) != 0)
|
||||
description[0] &= 0xfe;
|
||||
@@ -1806,7 +1799,7 @@ static CFStringRef copy_printer_interface_indexed_description(printer_interface_
|
||||
if (length > maxLength - 1)
|
||||
length = maxLength -1;
|
||||
|
||||
for (unsigned i = 0; i < length; i++)
|
||||
for (int i = 0; i < length; i++)
|
||||
buffer[i] = (char) description[2*i+2];
|
||||
|
||||
buffer[length] = 0;
|
||||
@@ -2252,13 +2245,13 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
while (waitpid(child_pid, &status, 0) < 0 && errno == EINTR);
|
||||
|
||||
if (WIFEXITED(status))
|
||||
_exit(WEXITSTATUS(status));
|
||||
exit(WEXITSTATUS(status));
|
||||
else if (status == SIGTERM || status == SIGKILL)
|
||||
_exit(0);
|
||||
exit(0);
|
||||
else
|
||||
{
|
||||
write(2, "DEBUG: Child crashed.\n", 22);
|
||||
_exit(CUPS_BACKEND_STOP);
|
||||
fprintf(stderr, "DEBUG: Child crashed on signal %d\n", status);
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
@@ -2450,11 +2443,11 @@ static void get_device_id(cups_sc_status_t *status,
|
||||
|
||||
if (g.printer_obj != IO_OBJECT_NULL)
|
||||
{
|
||||
printer_interface_t printerIntf = usb_printer_interface_interface(g.printer_obj);
|
||||
if (printerIntf)
|
||||
IOUSBInterfaceInterface220 **intf220 = usb_interface220_for_service(g.printer_obj);
|
||||
if (intf220)
|
||||
{
|
||||
deviceIDString = copy_printer_interface_deviceid(printerIntf, g.alternateSetting);
|
||||
(*printerIntf)->Release(printerIntf);
|
||||
deviceIDString = printer_interface_deviceid(intf220, g.alternateSetting);
|
||||
(*intf220)->Release(intf220);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2465,7 +2458,7 @@ static void get_device_id(cups_sc_status_t *status,
|
||||
*datalen = (int)strlen(data);
|
||||
else
|
||||
*datalen = 0;
|
||||
|
||||
|
||||
CFRelease(deviceIDString);
|
||||
}
|
||||
else
|
||||
@@ -2501,3 +2494,8 @@ log_usb_class_driver(int is_64bit) /* I - Is the USB class driver 64-bit? */
|
||||
asl_free(aslm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-darwin.c 12529 2015-02-23 18:57:57Z msweet $".
|
||||
*/
|
||||
|
||||
+9
-19
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: usb-libusb.c 12349 2014-12-09 22:10:52Z msweet $"
|
||||
*
|
||||
* LIBUSB interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -16,7 +18,6 @@
|
||||
|
||||
#include <libusb.h>
|
||||
#include <cups/cups-private.h>
|
||||
#include <cups/ppd-private.h>
|
||||
#include <cups/dir.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/select.h>
|
||||
@@ -102,7 +103,6 @@ typedef struct usb_globals_s /* Global USB printer information */
|
||||
#define USB_QUIRK_USB_INIT 0x0010 /* Needs vendor USB init string */
|
||||
#define USB_QUIRK_VENDOR_CLASS 0x0020 /* Descriptor uses vendor-specific
|
||||
Class or SubClass */
|
||||
#define USB_QUIRK_DELAY_CLOSE 0x0040 /* Delay close */
|
||||
#define USB_QUIRK_WHITELIST 0x0000 /* no quirks */
|
||||
|
||||
|
||||
@@ -641,9 +641,6 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* Close the connection and input file and general clean up...
|
||||
*/
|
||||
|
||||
if (g.printer->quirks & USB_QUIRK_DELAY_CLOSE)
|
||||
sleep(1);
|
||||
|
||||
close_device(g.printer);
|
||||
|
||||
/*
|
||||
@@ -1214,9 +1211,6 @@ load_quirks(void)
|
||||
if (strstr(line, " blacklist"))
|
||||
quirk->quirks |= USB_QUIRK_BLACKLIST;
|
||||
|
||||
if (strstr(line, " delay-close"))
|
||||
quirk->quirks |= USB_QUIRK_DELAY_CLOSE;
|
||||
|
||||
if (strstr(line, " no-reattach"))
|
||||
quirk->quirks |= USB_QUIRK_NO_REATTACH;
|
||||
|
||||
@@ -1528,16 +1522,6 @@ open_device(usb_printer_t *printer, /* I - Printer */
|
||||
|
||||
goto error;
|
||||
}
|
||||
else if ((errcode = libusb_detach_kernel_driver(printer->handle, printer->iface)) < 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"DEBUG: Failed to detach \"usblp\" module from %04x:%04x\n",
|
||||
devdesc.idVendor, devdesc.idProduct);
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
sleep (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2017,3 +2001,9 @@ soft_reset_printer(
|
||||
|
||||
return (errcode);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-libusb.c 12349 2014-12-09 22:10:52Z msweet $".
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: usb-unix.c 12124 2014-08-28 15:37:22Z msweet $"
|
||||
*
|
||||
* USB port backend for CUPS.
|
||||
*
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
@@ -598,3 +600,8 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
return (cupsSideChannelWrite(command, status, data, datalen, 1.0));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-unix.c 12124 2014-08-28 15:37:22Z msweet $".
|
||||
*/
|
||||
|
||||
+22
-9
@@ -1,16 +1,24 @@
|
||||
/*
|
||||
* USB printer backend for CUPS.
|
||||
* "$Id: usb.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* USB port backend for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* list_devices() - List all available USB devices to stdout.
|
||||
* print_device() - Print a file to a USB device.
|
||||
* main() - Send a file to the specified USB port.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -249,3 +257,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -3,23 +3,26 @@ lpc.o: lpc.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h
|
||||
lpq.o: lpq.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h
|
||||
lpr.o: lpr.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h
|
||||
lprm.o: lprm.c ../cups/cups-private.h ../cups/string-private.h \
|
||||
../config.h ../cups/debug-private.h ../cups/versioning.h \
|
||||
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/http-private.h ../cups/language.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/pwg-private.h ../cups/cups.h ../cups/file.h ../cups/pwg.h \
|
||||
../cups/thread-private.h
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
|
||||
|
||||
+15
-8
@@ -1,14 +1,16 @@
|
||||
#
|
||||
# Berkeley commands makefile for CUPS.
|
||||
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
|
||||
#
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
# Berkeley commands makefile for CUPS.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -159,3 +161,8 @@ lprm: lprm.o ../cups/$(LIBCUPS)
|
||||
#
|
||||
|
||||
include Dependencies
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
|
||||
#
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: lpc.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* "lpc" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -433,3 +435,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
ippDelete(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpc.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+101
-105
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: lpq.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* "lpq" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -39,8 +41,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
http_t *http; /* Connection to server */
|
||||
const char *opt, /* Option pointer */
|
||||
*dest, /* Desired printer */
|
||||
const char *dest, /* Desired printer */
|
||||
*user, /* Desired user */
|
||||
*val; /* Environment variable name */
|
||||
char *instance; /* Printer instance */
|
||||
@@ -66,138 +67,128 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
all = 0;
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (argv[i][0] == '+')
|
||||
{
|
||||
interval = atoi(argv[i] + 1);
|
||||
}
|
||||
else if (argv[i][0] == '-')
|
||||
{
|
||||
for (opt = argv[i] + 1; *opt; opt ++)
|
||||
switch (argv[i][1])
|
||||
{
|
||||
switch (*opt)
|
||||
{
|
||||
case 'E' : /* Encrypt */
|
||||
case 'E' : /* Encrypt */
|
||||
#ifdef HAVE_SSL
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
|
||||
if (http)
|
||||
httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
|
||||
if (http)
|
||||
httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
|
||||
#else
|
||||
_cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."), argv[0]);
|
||||
_cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."),
|
||||
argv[0]);
|
||||
#endif /* HAVE_SSL */
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'U' : /* Username */
|
||||
if (opt[1] != '\0')
|
||||
case 'U' : /* Username */
|
||||
if (argv[i][2] != '\0')
|
||||
cupsSetUser(argv[i] + 2);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
cupsSetUser(opt + 1);
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected username after \"-U\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
cupsSetUser(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'P' : /* Printer */
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
dest = opt + 1;
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
|
||||
if (i >= argc)
|
||||
{
|
||||
httpClose(http);
|
||||
|
||||
usage();
|
||||
}
|
||||
|
||||
dest = argv[i];
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected username after "
|
||||
"\"-U\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if ((instance = strchr(dest, '/')) != NULL)
|
||||
*instance++ = '\0';
|
||||
cupsSetUser(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
http = connect_server(argv[0], http);
|
||||
case 'P' : /* Printer */
|
||||
if (argv[i][2])
|
||||
dest = argv[i] + 2;
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
|
||||
if ((named_dest = cupsGetNamedDest(http, dest, instance)) == NULL)
|
||||
{
|
||||
if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
|
||||
_cupsLangPrintf(stderr, _("%s: Error - add '/version=1.1' to server name."), argv[0]);
|
||||
else if (instance)
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unknown destination \"%s/%s\"."), argv[0], dest, instance);
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("%s: Unknown destination \"%s\"."), argv[0], dest);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
cupsFreeDests(1, named_dest);
|
||||
break;
|
||||
|
||||
case 'a' : /* All printers */
|
||||
all = 1;
|
||||
break;
|
||||
|
||||
case 'h' : /* Connect to host */
|
||||
if (http)
|
||||
if (i >= argc)
|
||||
{
|
||||
httpClose(http);
|
||||
http = NULL;
|
||||
|
||||
usage();
|
||||
}
|
||||
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
cupsSetServer(opt + 1);
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
dest = argv[i];
|
||||
}
|
||||
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected hostname after \"-h\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
cupsSetServer(argv[i]);
|
||||
}
|
||||
break;
|
||||
if ((instance = strchr(dest, '/')) != NULL)
|
||||
*instance++ = '\0';
|
||||
|
||||
case 'l' : /* Long status */
|
||||
longstatus = 1;
|
||||
break;
|
||||
http = connect_server(argv[0], http);
|
||||
|
||||
default :
|
||||
if ((named_dest = cupsGetNamedDest(http, dest, instance)) == NULL)
|
||||
{
|
||||
if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - add '/version=1.1' to server "
|
||||
"name."), argv[0]);
|
||||
else if (instance)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown destination \"%s/%s\"."),
|
||||
argv[0], dest, instance);
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("%s: Unknown destination \"%s\"."),
|
||||
argv[0], dest);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
cupsFreeDests(1, named_dest);
|
||||
break;
|
||||
|
||||
case 'a' : /* All printers */
|
||||
all = 1;
|
||||
break;
|
||||
|
||||
case 'h' : /* Connect to host */
|
||||
if (http)
|
||||
{
|
||||
httpClose(http);
|
||||
http = NULL;
|
||||
}
|
||||
|
||||
usage();
|
||||
}
|
||||
if (argv[i][2] != '\0')
|
||||
cupsSetServer(argv[i] + 2);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected hostname after "
|
||||
"\"-h\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
cupsSetServer(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l' : /* Long status */
|
||||
longstatus = 1;
|
||||
break;
|
||||
|
||||
default :
|
||||
httpClose(http);
|
||||
|
||||
usage();
|
||||
}
|
||||
}
|
||||
else if (isdigit(argv[i][0] & 255))
|
||||
{
|
||||
id = atoi(argv[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
user = argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
http = connect_server(argv[0], http);
|
||||
|
||||
@@ -647,3 +638,8 @@ usage(void)
|
||||
"[-l] [+interval]"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpq.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+210
-212
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: lpr.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* "lpr" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -30,8 +32,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
int job_id; /* Job ID */
|
||||
char ch; /* Option character */
|
||||
char *printer, /* Destination printer or class */
|
||||
*instance, /* Instance */
|
||||
*opt; /* Option pointer */
|
||||
*instance; /* Instance */
|
||||
const char *title, /* Job title */
|
||||
*val; /* Environment variable name */
|
||||
int num_copies; /* Number of copies per file */
|
||||
@@ -55,235 +56,229 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
title = NULL;
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (argv[i][0] == '-')
|
||||
{
|
||||
for (opt = argv[i] + 1; *opt; opt ++)
|
||||
switch (ch = argv[i][1])
|
||||
{
|
||||
switch (ch = *opt)
|
||||
{
|
||||
case 'E' : /* Encrypt */
|
||||
case 'E' : /* Encrypt */
|
||||
#ifdef HAVE_SSL
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
#else
|
||||
_cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."), argv[0]);
|
||||
_cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."),
|
||||
argv[0]);
|
||||
#endif /* HAVE_SSL */
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'U' : /* Username */
|
||||
if (opt[1] != '\0')
|
||||
case 'U' : /* Username */
|
||||
if (argv[i][2] != '\0')
|
||||
cupsSetUser(argv[i] + 2);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
cupsSetUser(opt + 1);
|
||||
opt += strlen(opt) - 1;
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected username after "
|
||||
"\"-U\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
cupsSetUser(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'H' : /* Connect to host */
|
||||
if (argv[i][2] != '\0')
|
||||
cupsSetServer(argv[i] + 2);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected hostname after "
|
||||
"\"-H\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
cupsSetServer(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case '1' : /* TROFF font set 1 */
|
||||
case '2' : /* TROFF font set 2 */
|
||||
case '3' : /* TROFF font set 3 */
|
||||
case '4' : /* TROFF font set 4 */
|
||||
case 'i' : /* indent */
|
||||
case 'w' : /* width */
|
||||
if (argv[i][2] == '\0')
|
||||
{
|
||||
i ++;
|
||||
|
||||
if (i >= argc)
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected username after \"-U\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
cupsSetUser(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'H' : /* Connect to host */
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
cupsSetServer(opt + 1);
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected hostname after \"-H\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
cupsSetServer(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case '1' : /* TROFF font set 1 */
|
||||
case '2' : /* TROFF font set 2 */
|
||||
case '3' : /* TROFF font set 3 */
|
||||
case '4' : /* TROFF font set 4 */
|
||||
case 'i' : /* indent */
|
||||
case 'w' : /* width */
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected value after \"-%c\" "
|
||||
"option."), argv[0], ch);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
case 'c' : /* CIFPLOT */
|
||||
case 'd' : /* DVI */
|
||||
case 'f' : /* FORTRAN */
|
||||
case 'g' : /* plot */
|
||||
case 'n' : /* Ditroff */
|
||||
case 't' : /* Troff */
|
||||
case 'v' : /* Raster image */
|
||||
_cupsLangPrintf(stderr, _("%s: Warning - \"%c\" format modifier not supported - output may not be correct."), argv[0], ch);
|
||||
break;
|
||||
|
||||
case 'o' : /* Option */
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
num_options = cupsParseOptions(opt + 1, num_options, &options);
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected option=value after \"-o\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
num_options = cupsParseOptions(argv[i], num_options, &options);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l' : /* Literal/raw */
|
||||
num_options = cupsAddOption("raw", "true", num_options, &options);
|
||||
break;
|
||||
|
||||
case 'p' : /* Prettyprint */
|
||||
num_options = cupsAddOption("prettyprint", "true", num_options, &options);
|
||||
break;
|
||||
|
||||
case 'h' : /* Suppress burst page */
|
||||
num_options = cupsAddOption("job-sheets", "none", num_options, &options);
|
||||
break;
|
||||
|
||||
case 's' : /* Don't use symlinks */
|
||||
break;
|
||||
|
||||
case 'm' : /* Mail on completion */
|
||||
{
|
||||
char email[1024]; /* EMail address */
|
||||
|
||||
snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(), httpGetHostname(NULL, buffer, sizeof(buffer)));
|
||||
num_options = cupsAddOption("notify-recipient-uri", email, num_options, &options);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'q' : /* Queue file but don't print */
|
||||
num_options = cupsAddOption("job-hold-until", "indefinite", num_options, &options);
|
||||
break;
|
||||
|
||||
case 'r' : /* Remove file after printing */
|
||||
deletefile = 1;
|
||||
break;
|
||||
|
||||
case 'P' : /* Destination printer or class */
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
printer = opt + 1;
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected destination after \"-P\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
printer = argv[i];
|
||||
}
|
||||
|
||||
if ((instance = strrchr(printer, '/')) != NULL)
|
||||
*instance++ = '\0';
|
||||
|
||||
if ((dest = cupsGetNamedDest(NULL, printer, instance)) != NULL)
|
||||
{
|
||||
for (j = 0; j < dest->num_options; j ++)
|
||||
if (cupsGetOption(dest->options[j].name, num_options,
|
||||
options) == NULL)
|
||||
num_options = cupsAddOption(dest->options[j].name,
|
||||
dest->options[j].value,
|
||||
num_options, &options);
|
||||
}
|
||||
else if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - add '/version=1.1' to server name."), argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected value after \"-%c\" "
|
||||
"option."), argv[0], ch);
|
||||
return (1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case '#' : /* Number of copies */
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
num_copies = atoi(opt + 1);
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected copies after \"-#\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
case 'c' : /* CIFPLOT */
|
||||
case 'd' : /* DVI */
|
||||
case 'f' : /* FORTRAN */
|
||||
case 'g' : /* plot */
|
||||
case 'n' : /* Ditroff */
|
||||
case 't' : /* Troff */
|
||||
case 'v' : /* Raster image */
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Warning - \"%c\" format modifier not "
|
||||
"supported - output may not be correct."),
|
||||
argv[0], ch);
|
||||
break;
|
||||
|
||||
num_copies = atoi(argv[i]);
|
||||
}
|
||||
|
||||
if (num_copies < 1)
|
||||
case 'o' : /* Option */
|
||||
if (argv[i][2] != '\0')
|
||||
num_options = cupsParseOptions(argv[i] + 2, num_options, &options);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - copies must be 1 or more."), argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected option=value after "
|
||||
"\"-o\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
sprintf(buffer, "%d", num_copies);
|
||||
num_options = cupsAddOption("copies", buffer, num_options, &options);
|
||||
break;
|
||||
num_options = cupsParseOptions(argv[i], num_options, &options);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'C' : /* Class */
|
||||
case 'J' : /* Job name */
|
||||
case 'T' : /* Title */
|
||||
if (opt[1] != '\0')
|
||||
case 'l' : /* Literal/raw */
|
||||
num_options = cupsAddOption("raw", "true", num_options, &options);
|
||||
break;
|
||||
|
||||
case 'p' : /* Prettyprint */
|
||||
num_options = cupsAddOption("prettyprint", "true", num_options,
|
||||
&options);
|
||||
break;
|
||||
|
||||
case 'h' : /* Suppress burst page */
|
||||
num_options = cupsAddOption("job-sheets", "none", num_options,
|
||||
&options);
|
||||
break;
|
||||
|
||||
case 's' : /* Don't use symlinks */
|
||||
break;
|
||||
|
||||
case 'm' : /* Mail on completion */
|
||||
{
|
||||
char email[1024]; /* EMail address */
|
||||
|
||||
|
||||
snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(),
|
||||
httpGetHostname(NULL, buffer, sizeof(buffer)));
|
||||
num_options = cupsAddOption("notify-recipient-uri", email,
|
||||
num_options, &options);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'q' : /* Queue file but don't print */
|
||||
num_options = cupsAddOption("job-hold-until", "indefinite",
|
||||
num_options, &options);
|
||||
break;
|
||||
|
||||
case 'r' : /* Remove file after printing */
|
||||
deletefile = 1;
|
||||
break;
|
||||
|
||||
case 'P' : /* Destination printer or class */
|
||||
if (argv[i][2] != '\0')
|
||||
printer = argv[i] + 2;
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
title = opt + 1;
|
||||
opt += strlen(opt) - 1;
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected destination after "
|
||||
"\"-P\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected name after \"-%c\" option."), argv[0], ch);
|
||||
return (1);
|
||||
}
|
||||
|
||||
title = argv[i];
|
||||
}
|
||||
break;
|
||||
printer = argv[i];
|
||||
}
|
||||
|
||||
default :
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unknown option \"%c\"."), argv[0], *opt);
|
||||
if ((instance = strrchr(printer, '/')) != NULL)
|
||||
*instance++ = '\0';
|
||||
|
||||
if ((dest = cupsGetNamedDest(NULL, printer, instance)) != NULL)
|
||||
{
|
||||
for (j = 0; j < dest->num_options; j ++)
|
||||
if (cupsGetOption(dest->options[j].name, num_options,
|
||||
options) == NULL)
|
||||
num_options = cupsAddOption(dest->options[j].name,
|
||||
dest->options[j].value,
|
||||
num_options, &options);
|
||||
}
|
||||
else if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - add '/version=1.1' to server "
|
||||
"name."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case '#' : /* Number of copies */
|
||||
if (argv[i][2] != '\0')
|
||||
num_copies = atoi(argv[i] + 2);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected copies after "
|
||||
"\"-#\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
num_copies = atoi(argv[i]);
|
||||
}
|
||||
|
||||
sprintf(buffer, "%d", num_copies);
|
||||
num_options = cupsAddOption("copies", buffer, num_options, &options);
|
||||
break;
|
||||
|
||||
case 'C' : /* Class */
|
||||
case 'J' : /* Job name */
|
||||
case 'T' : /* Title */
|
||||
if (argv[i][2] != '\0')
|
||||
title = argv[i] + 2;
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected name after \"-%c\" "
|
||||
"option."), argv[0], ch);
|
||||
return (1);
|
||||
}
|
||||
|
||||
title = argv[i];
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown option \"%c\"."), argv[0],
|
||||
argv[i][1]);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else if (num_files < 1000)
|
||||
@@ -312,11 +307,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - too many files - \"%s\"."), argv[0], argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - too many files - \"%s\"."), argv[0],
|
||||
argv[i]);
|
||||
/*
|
||||
* See if we have any files to print; if not, print from stdin...
|
||||
*/
|
||||
@@ -436,3 +429,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpr.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+87
-84
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* "lprm" command for CUPS.
|
||||
* "$Id: lprm.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* "lprm" command for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Parse options and cancel jobs.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -29,8 +35,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
int i; /* Looping var */
|
||||
int job_id; /* Job ID */
|
||||
const char *name; /* Destination printer */
|
||||
char *instance, /* Pointer to instance name */
|
||||
*opt; /* Option pointer */
|
||||
char *instance; /* Pointer to instance name */
|
||||
cups_dest_t *dest, /* Destination */
|
||||
*defdest; /* Default destination */
|
||||
int did_cancel; /* Did we cancel something? */
|
||||
@@ -51,96 +56,90 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
*/
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (argv[i][0] == '-' && argv[i][1] != '\0')
|
||||
{
|
||||
for (opt = argv[i] + 1; *opt; opt ++)
|
||||
switch (argv[i][1])
|
||||
{
|
||||
switch (*opt)
|
||||
{
|
||||
case 'E' : /* Encrypt */
|
||||
case 'E' : /* Encrypt */
|
||||
#ifdef HAVE_SSL
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
#else
|
||||
_cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."), argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Sorry, no encryption support."), argv[0]);
|
||||
#endif /* HAVE_SSL */
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'P' : /* Cancel jobs on a printer */
|
||||
if (opt[1] != '\0')
|
||||
case 'P' : /* Cancel jobs on a printer */
|
||||
if (argv[i][2])
|
||||
name = argv[i] + 2;
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
name = argv[i];
|
||||
}
|
||||
|
||||
if ((instance = strchr(name, '/')) != NULL)
|
||||
*instance = '\0';
|
||||
|
||||
if ((dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, name,
|
||||
NULL)) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown destination \"%s\"."),
|
||||
argv[0], name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
cupsFreeDests(1, dest);
|
||||
break;
|
||||
|
||||
case 'U' : /* Username */
|
||||
if (argv[i][2] != '\0')
|
||||
cupsSetUser(argv[i] + 2);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
name = opt + 1;
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
name = argv[i];
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected username after "
|
||||
"\"-U\" option."), argv[0]);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((instance = strchr(name, '/')) != NULL)
|
||||
*instance = '\0';
|
||||
cupsSetUser(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'h' : /* Connect to host */
|
||||
if (argv[i][2] != '\0')
|
||||
cupsSetServer(argv[i] + 2);
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
|
||||
if ((dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, name, NULL)) == NULL)
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unknown destination \"%s\"."), argv[0], name);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected hostname after "
|
||||
"\"-h\" option."), argv[0]);
|
||||
goto error;
|
||||
}
|
||||
|
||||
cupsFreeDests(1, dest);
|
||||
break;
|
||||
|
||||
case 'U' : /* Username */
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
cupsSetUser(opt + 1);
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected username after \"-U\" option."), argv[0]);
|
||||
goto error;
|
||||
}
|
||||
cupsSetServer(argv[i]);
|
||||
}
|
||||
|
||||
cupsSetUser(argv[i]);
|
||||
}
|
||||
break;
|
||||
if (defdest)
|
||||
cupsFreeDests(1, defdest);
|
||||
|
||||
case 'h' : /* Connect to host */
|
||||
if (opt[1] != '\0')
|
||||
{
|
||||
cupsSetServer(opt + 1);
|
||||
opt += strlen(opt) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i ++;
|
||||
defdest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL);
|
||||
name = defdest ? defdest->name : NULL;
|
||||
break;
|
||||
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected hostname after \"-h\" option."), argv[0]);
|
||||
goto error;
|
||||
}
|
||||
else
|
||||
cupsSetServer(argv[i]);
|
||||
}
|
||||
|
||||
if (defdest)
|
||||
cupsFreeDests(1, defdest);
|
||||
|
||||
defdest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL);
|
||||
name = defdest ? defdest->name : NULL;
|
||||
break;
|
||||
|
||||
default :
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unknown option \"%c\"."), argv[0], *opt);
|
||||
goto error;
|
||||
}
|
||||
default :
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unknown option \"%c\"."),
|
||||
argv[0], argv[i][1]);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -183,7 +182,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
did_cancel = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If nothing has been canceled yet, cancel the current job on the specified
|
||||
@@ -212,3 +210,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lprm.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -35,9 +35,7 @@ admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h \
|
||||
../cups/http-private.h ../cups/md5-private.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/raster.h ../cups/pwg-private.h \
|
||||
../cups/adminutil.h
|
||||
../cups/adminutil.h ../cups/ppd.h
|
||||
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
|
||||
+37
-13
@@ -1,7 +1,9 @@
|
||||
#
|
||||
# "$Id: Makefile 11777 2014-03-28 19:18:10Z msweet $"
|
||||
#
|
||||
# CGI makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -126,13 +128,10 @@ install-exec:
|
||||
#
|
||||
|
||||
install-headers:
|
||||
if test "x$(privateinclude)" != x; then \
|
||||
echo Installing private header files into $(PRIVATEINCLUDE)...; \
|
||||
$(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
|
||||
for file in cgi.h help-index.h; do \
|
||||
$(INSTALL_DATA) $$file $(PRIVATEINCLUDE); \
|
||||
done; \
|
||||
fi
|
||||
echo Installing header files in $(INCLUDEDIR)/cups...
|
||||
$(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
|
||||
$(INSTALL_DATA) cgi.h $(INCLUDEDIR)/cups
|
||||
$(INSTALL_DATA) help-index.h $(INCLUDEDIR)/cups
|
||||
|
||||
|
||||
#
|
||||
@@ -179,11 +178,31 @@ uninstall:
|
||||
$(RM) $(LIBDIR)/libcupscgi.so
|
||||
$(RM) $(LIBDIR)/libcupscgi.so.1
|
||||
-$(RMDIR) $(LIBDIR)
|
||||
-if test "x$(privateinclude)" != x; then \
|
||||
$(RM) $(PRIVATEINCLUDE)/cgi.h; \
|
||||
$(RM) $(PRIVATEINCLUDE)/help-index.h; \
|
||||
$(RMDIR) $(PRIVATEINCLUDE); \
|
||||
fi
|
||||
$(RM) $(INCLUDEDIR)/cups/cgi.h
|
||||
$(RM) $(INCLUDEDIR)/cups/help-index.h
|
||||
-$(RMDIR) $(INCLUDEDIR)/cups
|
||||
|
||||
|
||||
#
|
||||
# Automatic API help files...
|
||||
#
|
||||
|
||||
apihelp:
|
||||
mxmldoc --section "Programming" \
|
||||
--title "CGI API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-cgi.header --intro api-cgi.shtml \
|
||||
cgi.h help-index.h $(LIBOBJS:.o=.c) >../doc/help/api-cgi.html
|
||||
mxmldoc --tokens help/api-cgi.html api-cgi.xml >../doc/help/api-cgi.tokens
|
||||
$(RM) api-cgi.xml
|
||||
|
||||
framedhelp:
|
||||
mxmldoc --framed api-cgi \
|
||||
--section "Programming" \
|
||||
--title "CGI API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-cgi.header --intro api-cgi.shtml \
|
||||
cgi.h help-index.h $(LIBOBJS:.o=.c)
|
||||
|
||||
|
||||
#
|
||||
@@ -331,3 +350,8 @@ testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
#
|
||||
|
||||
include Dependencies
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 11777 2014-03-28 19:18:10Z msweet $".
|
||||
#
|
||||
|
||||
+12
-84
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: admin.c 12123 2014-08-28 14:24:45Z msweet $"
|
||||
*
|
||||
* Administration CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -16,8 +18,6 @@
|
||||
*/
|
||||
|
||||
#include "cgi-private.h"
|
||||
#include <cups/http-private.h>
|
||||
#include <cups/ppd-private.h>
|
||||
#include <cups/adminutil.h>
|
||||
#include <cups/ppd.h>
|
||||
#include <errno.h>
|
||||
@@ -38,7 +38,12 @@ static int current_device = 0; /* Current device shown */
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void choose_device_cb(const char *device_class, const char *device_id, const char *device_info, const char *device_make_and_model, const char *device_uri, const char *device_location, const char *title);
|
||||
static void choose_device_cb(const char *device_class,
|
||||
const char *device_id, const char *device_info,
|
||||
const char *device_make_and_model,
|
||||
const char *device_uri,
|
||||
const char *device_location,
|
||||
const char *title);
|
||||
static void do_add_rss_subscription(http_t *http);
|
||||
static void do_am_class(http_t *http, int modify);
|
||||
static void do_am_printer(http_t *http, int modify);
|
||||
@@ -56,7 +61,6 @@ static void do_set_sharing(http_t *http);
|
||||
static char *get_option_value(ppd_file_t *ppd, const char *name,
|
||||
char *buffer, size_t bufsize);
|
||||
static double get_points(double number, const char *uval);
|
||||
static char *get_printer_ppd(const char *uri, char *buffer, size_t bufsize);
|
||||
|
||||
|
||||
/*
|
||||
@@ -828,8 +832,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
const cgi_file_t *file; /* Uploaded file, if any */
|
||||
const char *var; /* CGI variable */
|
||||
char uri[HTTP_MAX_URI], /* Device or printer URI */
|
||||
*uriptr, /* Pointer into URI */
|
||||
evefile[1024] = ""; /* IPP Everywhere PPD file */
|
||||
*uriptr; /* Pointer into URI */
|
||||
int maxrate; /* Maximum baud rate */
|
||||
char baudrate[255]; /* Baud rate string */
|
||||
const char *name, /* Pointer to class name */
|
||||
@@ -1328,9 +1331,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
if (!file)
|
||||
{
|
||||
var = cgiGetVariable("PPD_NAME");
|
||||
if (!strcmp(var, "everywhere"))
|
||||
get_printer_ppd(cgiGetVariable("DEVICE_URI"), evefile, sizeof(evefile));
|
||||
else if (strcmp(var, "__no_change__"))
|
||||
if (strcmp(var, "__no_change__"))
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, var);
|
||||
}
|
||||
@@ -1383,11 +1384,6 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (file)
|
||||
ippDelete(cupsDoFileRequest(http, request, "/admin/", file->tempfile));
|
||||
else if (evefile[0])
|
||||
{
|
||||
ippDelete(cupsDoFileRequest(http, request, "/admin/", evefile));
|
||||
unlink(evefile);
|
||||
}
|
||||
else
|
||||
ippDelete(cupsDoRequest(http, request, "/admin/"));
|
||||
|
||||
@@ -4202,73 +4198,5 @@ get_points(double number, /* I - Original number */
|
||||
|
||||
|
||||
/*
|
||||
* 'get_printer_ppd()' - Get an IPP Everywhere PPD file for the given URI.
|
||||
* End of "$Id: admin.c 12123 2014-08-28 14:24:45Z msweet $".
|
||||
*/
|
||||
|
||||
static char * /* O - Filename or NULL */
|
||||
get_printer_ppd(const char *uri, /* I - Printer URI */
|
||||
char *buffer, /* I - Filename buffer */
|
||||
size_t bufsize) /* I - Size of filename buffer */
|
||||
{
|
||||
http_t *http; /* Connection to printer */
|
||||
ipp_t *request, /* Get-Printer-Attributes request */
|
||||
*response; /* Get-Printer-Attributes response */
|
||||
char resolved[1024], /* Resolved URI */
|
||||
scheme[32], /* URI scheme */
|
||||
userpass[256], /* Username:password */
|
||||
host[256], /* Hostname */
|
||||
resource[256]; /* Resource path */
|
||||
int port; /* Port number */
|
||||
|
||||
|
||||
/*
|
||||
* Connect to the printer...
|
||||
*/
|
||||
|
||||
if (strstr(uri, "._tcp"))
|
||||
{
|
||||
/*
|
||||
* Resolve URI...
|
||||
*/
|
||||
|
||||
if (!_httpResolveURI(uri, resolved, sizeof(resolved), _HTTP_RESOLVE_DEFAULT, NULL, NULL))
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to resolve \"%s\".\n", uri);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
uri = resolved;
|
||||
}
|
||||
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Bad printer URI \"%s\".\n", uri);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
http = httpConnect2(host, port, NULL, AF_UNSPEC, !strcmp(scheme, "ipps") ? HTTP_ENCRYPTION_ALWAYS : HTTP_ENCRYPTION_IF_REQUESTED, 1, 30000, NULL);
|
||||
if (!http)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to connect to \"%s:%d\": %s\n", host, port, cupsLastErrorString());
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Send a Get-Printer-Attributes request...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
|
||||
if (!_ppdCreateFromIPP(buffer, bufsize, response))
|
||||
fprintf(stderr, "ERROR: Unable to create PPD file: %s\n", strerror(errno));
|
||||
|
||||
ippDelete(response);
|
||||
httpClose(http);
|
||||
|
||||
if (buffer[0])
|
||||
return (buffer);
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<!--
|
||||
Administrative API header for CUPS.
|
||||
"$Id: api-array.header 8087 2008-10-27 21:37:05Z mike $"
|
||||
|
||||
Copyright 2016 by Apple Inc.
|
||||
CGI API header for CUPS.
|
||||
|
||||
Copyright 2009 by Apple Inc.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -10,25 +12,23 @@
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>Administrative APIs</h1>
|
||||
<h1 class='title'>CGI API</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Header</th>
|
||||
<th>cups/adminutil.h</th>
|
||||
<th>cups/cgi.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
<td>-lcupscgi</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br>
|
||||
Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
|
||||
Programming: <a href='api-httpipp.html' target='_top'>HTTP and IPP APIs</a></td>
|
||||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!--
|
||||
"$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
|
||||
|
||||
CGI API introduction for CUPS.
|
||||
|
||||
Copyright 2009 by Apple Inc.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<p>The CGI API provides Common Gateway Interface functions for CUPS.</p>
|
||||
+15
-8
@@ -1,14 +1,16 @@
|
||||
/*
|
||||
* Private CGI definitions for CUPS.
|
||||
* "$Id: cgi-private.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Private CGI definitions for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,3 +29,8 @@
|
||||
*/
|
||||
|
||||
#define CUPS_PAGE_MAX 100 /* Maximum items per page */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: cgi-private.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+14
-8
@@ -1,14 +1,16 @@
|
||||
/*
|
||||
* CGI support library definitions for CUPS.
|
||||
* "$Id: cgi.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* CGI support library definitions for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CGI_H_
|
||||
@@ -111,3 +113,7 @@ extern const char *cgiText(const char *message);
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_CGI_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: cgi.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+29
-12
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: classes.c 11928 2014-06-13 00:08:32Z msweet $"
|
||||
*
|
||||
* Class status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -297,7 +299,8 @@ show_all_classes(http_t *http, /* I - Connection to server */
|
||||
*response; /* IPP response */
|
||||
cups_array_t *classes; /* Array of class objects */
|
||||
ipp_attribute_t *pclass; /* Class object */
|
||||
int first, /* First class to show */
|
||||
int ascending, /* Order of classes (0 = descending) */
|
||||
first, /* First class to show */
|
||||
count; /* Number of classes */
|
||||
const char *var; /* Form variable */
|
||||
void *search; /* Search data */
|
||||
@@ -369,10 +372,25 @@ show_all_classes(http_t *http, /* I - Connection to server */
|
||||
sprintf(val, "%d", count);
|
||||
cgiSetVariable("TOTAL", val);
|
||||
|
||||
for (i = 0, pclass = (ipp_attribute_t *)cupsArrayIndex(classes, first);
|
||||
i < CUPS_PAGE_MAX && pclass;
|
||||
i ++, pclass = (ipp_attribute_t *)cupsArrayNext(classes))
|
||||
cgiSetIPPObjectVars(pclass, NULL, i);
|
||||
if ((var = cgiGetVariable("ORDER")) != NULL && *var)
|
||||
ascending = !_cups_strcasecmp(var, "asc");
|
||||
else
|
||||
ascending = 1;
|
||||
|
||||
if (ascending)
|
||||
{
|
||||
for (i = 0, pclass = (ipp_attribute_t *)cupsArrayIndex(classes, first);
|
||||
i < CUPS_PAGE_MAX && pclass;
|
||||
i ++, pclass = (ipp_attribute_t *)cupsArrayNext(classes))
|
||||
cgiSetIPPObjectVars(pclass, NULL, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0, pclass = (ipp_attribute_t *)cupsArrayIndex(classes, count - first - 1);
|
||||
i < CUPS_PAGE_MAX && pclass;
|
||||
i ++, pclass = (ipp_attribute_t *)cupsArrayPrev(classes))
|
||||
cgiSetIPPObjectVars(pclass, NULL, i);
|
||||
}
|
||||
|
||||
/*
|
||||
* Save navigation URLs...
|
||||
@@ -392,12 +410,6 @@ show_all_classes(http_t *http, /* I - Connection to server */
|
||||
cgiSetVariable("NEXT", val);
|
||||
}
|
||||
|
||||
if (count > CUPS_PAGE_MAX)
|
||||
{
|
||||
snprintf(val, sizeof(val), "%d", CUPS_PAGE_MAX * (count / CUPS_PAGE_MAX));
|
||||
cgiSetVariable("LAST", val);
|
||||
}
|
||||
|
||||
/*
|
||||
* Then show everything...
|
||||
*/
|
||||
@@ -531,3 +543,8 @@ show_class(http_t *http, /* I - Connection to server */
|
||||
|
||||
cgiEndHTML();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: classes.c 11928 2014-06-13 00:08:32Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: help-index.c 12344 2014-12-09 21:36:11Z msweet $"
|
||||
*
|
||||
* Online help index routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -1218,7 +1220,7 @@ help_new_node(const char *filename, /* I - Filename */
|
||||
|
||||
n->filename = strdup(filename);
|
||||
n->anchor = anchor ? strdup(anchor) : NULL;
|
||||
n->section = *section ? strdup(section) : NULL;
|
||||
n->section = (section && *section) ? strdup(section) : NULL;
|
||||
n->text = strdup(text);
|
||||
n->mtime = mtime;
|
||||
n->offset = offset;
|
||||
@@ -1301,3 +1303,8 @@ help_sort_words(help_word_t *w1, /* I - Second word */
|
||||
|
||||
return (_cups_strcasecmp(w1->text, w2->text));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: help-index.c 12344 2014-12-09 21:36:11Z msweet $".
|
||||
*/
|
||||
|
||||
+14
-8
@@ -1,14 +1,16 @@
|
||||
/*
|
||||
* Online help index definitions for CUPS.
|
||||
* "$Id: help-index.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Online help index definitions for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_HELP_INDEX_H_
|
||||
@@ -79,3 +81,7 @@ extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query,
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_HELP_INDEX_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: help-index.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+19
-8
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* Online help CGI for CUPS.
|
||||
* "$Id: help.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Online help CGI for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Main entry for CGI.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -384,3 +390,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: help.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+25
-8
@@ -1,14 +1,26 @@
|
||||
/*
|
||||
* HTML support functions for CUPS.
|
||||
* "$Id: html.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* HTML support functions for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cgiEndHTML() - End a HTML page.
|
||||
* cgiEndMultipart() - End the delivery of a multipart web page.
|
||||
* cgiFormEncode() - Encode a string as a form variable.
|
||||
* cgiStartHTML() - Start a HTML page.
|
||||
* cgiStartMultipart() - Start a multipart delivery of a web page.
|
||||
* cgiSupportsMultipart() - Does the browser support multi-part documents?
|
||||
* cgi_null_passwd() - Return a NULL password for authentication.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -220,3 +232,8 @@ cgi_null_passwd(const char *prompt) /* I - Prompt string (unused) */
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: html.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+47
-28
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: ipp-var.c 12701 2015-06-08 18:33:44Z msweet $"
|
||||
*
|
||||
* CGI <-> IPP variable routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -220,9 +222,6 @@ cgiGetIPPObjects(ipp_t *response, /* I - IPP response */
|
||||
break;
|
||||
|
||||
case IPP_TAG_INTEGER :
|
||||
if (!strncmp(ippGetName(attr), "time-at-", 8))
|
||||
break; /* Ignore time-at-xxx */
|
||||
|
||||
for (i = 0; !add && i < attr->num_values; i ++)
|
||||
{
|
||||
char buf[255]; /* Number buffer */
|
||||
@@ -1323,7 +1322,7 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */
|
||||
attr = cgiSetIPPObjectVars(attr, prefix, element);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG2: Returning %d from cgiSetIPPVars()...\n", element);
|
||||
fprintf(stderr, "DEBUG2: Returing %d from cgiSetIPPVars()...\n", element);
|
||||
|
||||
return (element);
|
||||
}
|
||||
@@ -1358,7 +1357,8 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
*response; /* IPP response */
|
||||
cups_array_t *jobs; /* Array of job objects */
|
||||
ipp_attribute_t *job; /* Job object */
|
||||
int first, /* First job to show */
|
||||
int ascending, /* Order of jobs (0 = descending) */
|
||||
first, /* First job to show */
|
||||
count; /* Number of jobs */
|
||||
const char *var, /* Form variable */
|
||||
*query, /* Query string */
|
||||
@@ -1394,17 +1394,6 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs",
|
||||
NULL, which_jobs);
|
||||
|
||||
if ((var = cgiGetVariable("FIRST")) != NULL)
|
||||
{
|
||||
if ((first = atoi(var)) < 0)
|
||||
first = 0;
|
||||
}
|
||||
else
|
||||
first = 0;
|
||||
|
||||
if (first > 0)
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "first-index", first + 1);
|
||||
|
||||
cgiGetAttributes(request, "jobs.tmpl");
|
||||
|
||||
/*
|
||||
@@ -1427,7 +1416,7 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
}
|
||||
|
||||
jobs = cgiGetIPPObjects(response, search);
|
||||
count = cupsArrayCount(jobs) + first;
|
||||
count = cupsArrayCount(jobs);
|
||||
|
||||
if (search)
|
||||
cgiFreeSearch(search);
|
||||
@@ -1436,6 +1425,25 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
* Figure out which jobs to display...
|
||||
*/
|
||||
|
||||
if ((var = cgiGetVariable("FIRST")) != NULL)
|
||||
first = atoi(var);
|
||||
else
|
||||
first = 0;
|
||||
|
||||
if (first >= count)
|
||||
first = count - CUPS_PAGE_MAX;
|
||||
|
||||
first = (first / CUPS_PAGE_MAX) * CUPS_PAGE_MAX;
|
||||
|
||||
if (first < 0)
|
||||
first = 0;
|
||||
|
||||
if ((var = cgiGetVariable("ORDER")) != NULL && *var)
|
||||
ascending = !_cups_strcasecmp(var, "asc");
|
||||
else
|
||||
ascending = !which_jobs || !*which_jobs ||
|
||||
!_cups_strcasecmp(which_jobs, "not-completed");
|
||||
|
||||
section = cgiGetVariable("SECTION");
|
||||
|
||||
cgiClearVariables();
|
||||
@@ -1443,6 +1451,8 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
if (query)
|
||||
cgiSetVariable("QUERY", query);
|
||||
|
||||
cgiSetVariable("ORDER", ascending ? "asc" : "dec");
|
||||
|
||||
cgiSetVariable("SECTION", section);
|
||||
|
||||
sprintf(val, "%d", count);
|
||||
@@ -1451,10 +1461,20 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
if (which_jobs)
|
||||
cgiSetVariable("WHICH_JOBS", which_jobs);
|
||||
|
||||
for (i = 0, job = (ipp_attribute_t *)cupsArrayFirst(jobs);
|
||||
i < CUPS_PAGE_MAX && job;
|
||||
i ++, job = (ipp_attribute_t *)cupsArrayNext(jobs))
|
||||
cgiSetIPPObjectVars(job, NULL, i);
|
||||
if (ascending)
|
||||
{
|
||||
for (i = 0, job = (ipp_attribute_t *)cupsArrayIndex(jobs, first);
|
||||
i < CUPS_PAGE_MAX && job;
|
||||
i ++, job = (ipp_attribute_t *)cupsArrayNext(jobs))
|
||||
cgiSetIPPObjectVars(job, NULL, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0, job = (ipp_attribute_t *)cupsArrayIndex(jobs, count - first - 1);
|
||||
i < CUPS_PAGE_MAX && job;
|
||||
i ++, job = (ipp_attribute_t *)cupsArrayPrev(jobs))
|
||||
cgiSetIPPObjectVars(job, NULL, i);
|
||||
}
|
||||
|
||||
/*
|
||||
* Save navigation URLs...
|
||||
@@ -1483,12 +1503,6 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
cgiSetVariable("NEXT", val);
|
||||
}
|
||||
|
||||
if (count > CUPS_PAGE_MAX)
|
||||
{
|
||||
snprintf(val, sizeof(val), "%d", CUPS_PAGE_MAX * (count / CUPS_PAGE_MAX));
|
||||
cgiSetVariable("LAST", val);
|
||||
}
|
||||
|
||||
/*
|
||||
* Then show everything...
|
||||
*/
|
||||
@@ -1530,3 +1544,8 @@ cgiText(const char *message) /* I - Message */
|
||||
|
||||
return (_cupsLangString(language, message));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp-var.c 12701 2015-06-08 18:33:44Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: jobs.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Job status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -199,3 +201,8 @@ do_job_op(http_t *http, /* I - HTTP connection */
|
||||
|
||||
cgiEndHTML();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: jobs.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+25
-8
@@ -1,18 +1,30 @@
|
||||
/*
|
||||
* Xcode documentation set generator.
|
||||
* "$Id: makedocset.c 3833 2012-05-23 22:51:18Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Xcode documentation set generator.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* makedocset directory *.tokens
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Test the help index code.
|
||||
* compare_html() - Compare the titles of two HTML files.
|
||||
* compare_sections() - Compare the names of two help sections.
|
||||
* compare_sections_files() - Compare the number of files and section names.
|
||||
* write_index() - Write an index file for the CUPS help.
|
||||
* write_info() - Write the Info.plist file.
|
||||
* write_nodes() - Write the Nodes.xml file.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -467,3 +479,8 @@ write_nodes(const char *path, /* I - File to write */
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: makedocset.c 3833 2012-05-23 22:51:18Z msweet $".
|
||||
*/
|
||||
|
||||
+29
-12
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: printers.c 11928 2014-06-13 00:08:32Z msweet $"
|
||||
*
|
||||
* Printer status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -304,7 +306,8 @@ show_all_printers(http_t *http, /* I - Connection to server */
|
||||
*response; /* IPP response */
|
||||
cups_array_t *printers; /* Array of printer objects */
|
||||
ipp_attribute_t *printer; /* Printer object */
|
||||
int first, /* First printer to show */
|
||||
int ascending, /* Order of printers (0 = descending) */
|
||||
first, /* First printer to show */
|
||||
count; /* Number of printers */
|
||||
const char *var; /* Form variable */
|
||||
void *search; /* Search data */
|
||||
@@ -386,10 +389,25 @@ show_all_printers(http_t *http, /* I - Connection to server */
|
||||
sprintf(val, "%d", count);
|
||||
cgiSetVariable("TOTAL", val);
|
||||
|
||||
for (i = 0, printer = (ipp_attribute_t *)cupsArrayIndex(printers, first);
|
||||
i < CUPS_PAGE_MAX && printer;
|
||||
i ++, printer = (ipp_attribute_t *)cupsArrayNext(printers))
|
||||
cgiSetIPPObjectVars(printer, NULL, i);
|
||||
if ((var = cgiGetVariable("ORDER")) != NULL && *var)
|
||||
ascending = !_cups_strcasecmp(var, "asc");
|
||||
else
|
||||
ascending = 1;
|
||||
|
||||
if (ascending)
|
||||
{
|
||||
for (i = 0, printer = (ipp_attribute_t *)cupsArrayIndex(printers, first);
|
||||
i < CUPS_PAGE_MAX && printer;
|
||||
i ++, printer = (ipp_attribute_t *)cupsArrayNext(printers))
|
||||
cgiSetIPPObjectVars(printer, NULL, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0, printer = (ipp_attribute_t *)cupsArrayIndex(printers, count - first - 1);
|
||||
i < CUPS_PAGE_MAX && printer;
|
||||
i ++, printer = (ipp_attribute_t *)cupsArrayPrev(printers))
|
||||
cgiSetIPPObjectVars(printer, NULL, i);
|
||||
}
|
||||
|
||||
/*
|
||||
* Save navigation URLs...
|
||||
@@ -409,12 +427,6 @@ show_all_printers(http_t *http, /* I - Connection to server */
|
||||
cgiSetVariable("NEXT", val);
|
||||
}
|
||||
|
||||
if (count > CUPS_PAGE_MAX)
|
||||
{
|
||||
snprintf(val, sizeof(val), "%d", CUPS_PAGE_MAX * (count / CUPS_PAGE_MAX));
|
||||
cgiSetVariable("LAST", val);
|
||||
}
|
||||
|
||||
/*
|
||||
* Then show everything...
|
||||
*/
|
||||
@@ -551,3 +563,8 @@ show_printer(http_t *http, /* I - Connection to server */
|
||||
|
||||
cgiEndHTML();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: printers.c 11928 2014-06-13 00:08:32Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: search.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Search routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -366,3 +368,8 @@ cgiFreeSearch(void *search) /* I - Search context */
|
||||
{
|
||||
regfree((regex_t *)search);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: search.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: template.c 12701 2015-06-08 18:33:44Z msweet $"
|
||||
*
|
||||
* CGI template function.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
@@ -681,3 +683,8 @@ cgi_puturi(const char *s, /* I - String to output */
|
||||
s ++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: template.c 12701 2015-06-08 18:33:44Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* "$Id: testcgi.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* CGI test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
@@ -60,3 +62,8 @@ main(void)
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testcgi.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-8
@@ -1,14 +1,21 @@
|
||||
/*
|
||||
* Help index test program for CUPS.
|
||||
* "$Id: testhi.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Help index test program for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Test the help index code.
|
||||
* list_nodes() - List nodes in an array...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -99,3 +106,8 @@ list_nodes(const char *title, /* I - Title string */
|
||||
printf(" (%d words)\n", cupsArrayCount(node->words));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testhi.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* CGI template test program for CUPS.
|
||||
* "$Id: testtemplate.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
* CGI template test program for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Test the template code.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -90,3 +96,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testtemplate.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+13
-25
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: var.c 12034 2014-07-16 19:37:34Z msweet $"
|
||||
*
|
||||
* CGI form variable and array functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -624,8 +626,6 @@ cgi_initialize_cookies(void)
|
||||
|
||||
while (*cookie)
|
||||
{
|
||||
int skip = 0; /* Skip this cookie? */
|
||||
|
||||
/*
|
||||
* Skip leading whitespace...
|
||||
*/
|
||||
@@ -641,14 +641,9 @@ cgi_initialize_cookies(void)
|
||||
|
||||
for (ptr = name; *cookie && *cookie != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
{
|
||||
*ptr++ = *cookie++;
|
||||
}
|
||||
else
|
||||
{
|
||||
skip = 1;
|
||||
cookie ++;
|
||||
}
|
||||
break;
|
||||
|
||||
if (*cookie != '=')
|
||||
break;
|
||||
@@ -664,38 +659,26 @@ cgi_initialize_cookies(void)
|
||||
{
|
||||
for (cookie ++, ptr = value; *cookie && *cookie != '\"';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
{
|
||||
*ptr++ = *cookie++;
|
||||
}
|
||||
else
|
||||
{
|
||||
skip = 1;
|
||||
cookie ++;
|
||||
}
|
||||
break;
|
||||
|
||||
if (*cookie == '\"')
|
||||
cookie ++;
|
||||
else
|
||||
skip = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (ptr = value; *cookie && *cookie != ';';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
{
|
||||
*ptr++ = *cookie++;
|
||||
}
|
||||
else
|
||||
{
|
||||
skip = 1;
|
||||
cookie ++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (*cookie == ';')
|
||||
cookie ++;
|
||||
else if (*cookie)
|
||||
skip = 1;
|
||||
break;
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
@@ -704,7 +687,7 @@ cgi_initialize_cookies(void)
|
||||
* "$"...
|
||||
*/
|
||||
|
||||
if (name[0] != '$' && !skip)
|
||||
if (name[0] != '$')
|
||||
num_cookies = cupsAddOption(name, value, num_cookies, &cookies);
|
||||
}
|
||||
}
|
||||
@@ -1292,3 +1275,8 @@ cgi_unlink_file(void)
|
||||
form_file = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: var.c 12034 2014-07-16 19:37:34Z msweet $".
|
||||
*/
|
||||
|
||||
+16
-9
@@ -1,14 +1,16 @@
|
||||
#
|
||||
# Configuration file makefile for CUPS.
|
||||
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
|
||||
#
|
||||
# Copyright 2007-2015 by Apple Inc.
|
||||
# Copyright 1993-2006 by Easy Software Products.
|
||||
# Configuration file makefile for CUPS.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 1993-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -74,8 +76,8 @@ install-data:
|
||||
else \
|
||||
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \
|
||||
fi ; \
|
||||
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.default; \
|
||||
done
|
||||
$(INSTALL_CONFIG) -g $(CUPS_GROUP) cupsd.conf $(SERVERROOT)/cupsd.conf.default
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/mime
|
||||
for file in $(REPLACE); do \
|
||||
if test -r $(DATADIR)/mime/$$file ; then \
|
||||
@@ -134,3 +136,8 @@ uninstall:
|
||||
$(RM) $(BUILDROOT)$(PAMDIR)/cups; \
|
||||
$(RMDIR) $(BUILDROOT)$(PAMDIR); \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
|
||||
#
|
||||
|
||||
@@ -39,13 +39,6 @@ WebInterface @CUPS_WEBIF@
|
||||
Order allow,deny
|
||||
</Location>
|
||||
|
||||
# Restrict access to log files...
|
||||
<Location /admin/log>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order allow,deny
|
||||
</Location>
|
||||
|
||||
# Set the default printer/job policies...
|
||||
<Policy default>
|
||||
# Job/subscription privacy...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: mime.convs.in 11025 2013-06-07 01:00:33Z msweet $"
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
@@ -59,5 +59,5 @@ application/vnd.cups-raster image/pwg-raster 100 rastertopwg
|
||||
@DEFAULT_RAW_PRINTING@application/octet-stream application/vnd.cups-raw 0 -
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: mime.convs.in 11025 2013-06-07 01:00:33Z msweet $".
|
||||
#
|
||||
|
||||
+2
-9
@@ -7,7 +7,7 @@
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Copyright 2007-2015 by Apple Inc.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -71,7 +71,7 @@
|
||||
#
|
||||
|
||||
#application/msword doc string(0,<D0CF11E0A1B11AE1>)
|
||||
application/pdf pdf regex(0,^[\n\r]*%PDF)
|
||||
application/pdf pdf regex(0,^[\\n\\r]*%PDF)
|
||||
application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
contains(0,128,<1B>%-12345X) + \
|
||||
(contains(0,4096,"LANGUAGE=POSTSCRIPT") \
|
||||
@@ -81,13 +81,6 @@ application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
(contains(0,4096,<0a>%!) + \
|
||||
!contains(0,4096,"ENTER LANGUAGE")))
|
||||
|
||||
application/g-code gcode
|
||||
application/sla stl string(0,"solid ") + contains(0,4096,"facet") + contains(0,4096,"vertex")
|
||||
application/vnd.makerbot-s3g x3g
|
||||
model/amf amf
|
||||
model/vnd.collada+xml dae
|
||||
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Image files...
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 12336 2014-12-09 21:19:52Z msweet $"
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -11,12 +13,18 @@ dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="AC_PACKAGE_VERSION"
|
||||
CUPS_REVISION=""
|
||||
CUPS_VERSION=2.0.3
|
||||
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
|
||||
CUPS_BUILD="cups-$CUPS_VERSION"
|
||||
|
||||
AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" string ],
|
||||
@@ -25,8 +33,8 @@ AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" str
|
||||
AC_SUBST(CUPS_VERSION)
|
||||
AC_SUBST(CUPS_REVISION)
|
||||
AC_SUBST(CUPS_BUILD)
|
||||
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "AC_PACKAGE_NAME v$CUPS_VERSION$CUPS_REVISION")
|
||||
AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "AC_PACKAGE_NAME/$CUPS_VERSION$CUPS_REVISION")
|
||||
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
|
||||
AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
|
||||
|
||||
dnl Default compiler flags...
|
||||
CFLAGS="${CFLAGS:=}"
|
||||
@@ -129,7 +137,6 @@ AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
|
||||
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
|
||||
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
|
||||
AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
|
||||
AC_CHECK_HEADER(asl.h,AC_DEFINE(HAVE_ASL_H))
|
||||
|
||||
dnl Checks for iconv.h and iconv_open
|
||||
AC_CHECK_HEADER(iconv.h,
|
||||
@@ -199,9 +206,6 @@ AC_CHECK_FUNCS(waitpid wait3)
|
||||
dnl Check for posix_spawn
|
||||
AC_CHECK_FUNCS(posix_spawn)
|
||||
|
||||
dnl Check for getgrouplist
|
||||
AC_CHECK_FUNCS(getgrouplist)
|
||||
|
||||
dnl See if the tm structure has the tm_gmtoff member...
|
||||
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
|
||||
AC_TRY_COMPILE([#include <time.h>],[struct tm t;
|
||||
@@ -314,7 +318,7 @@ DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$uname" != xDarwin; then
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -459,3 +463,7 @@ case "$COMPONENTS" in
|
||||
esac
|
||||
|
||||
AC_SUBST(BUILDDIRS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 12336 2014-12-09 21:19:52Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 12122 2014-08-28 12:55:52Z msweet $"
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
@@ -154,15 +156,6 @@ if test -n "$GCC"; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wno-unused-result)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-unused-result"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-unused-result"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wsign-conversion)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wsign-conversion"
|
||||
@@ -242,3 +235,7 @@ case $uname in
|
||||
OPTIM="$OPTIM -D_GNU_SOURCE"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 12122 2014-08-28 12:55:52Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl "$Id: cups-defaults.m4 11789 2014-04-02 16:52:53Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Default languages...
|
||||
@@ -22,8 +24,8 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau
|
||||
esac])
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl macOS bundle-based localization support
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set macOS localization bundle directory ],
|
||||
dnl OS X bundle-based localization support
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set OS X localization bundle directory ],
|
||||
CUPS_BUNDLEDIR="$withval",
|
||||
if test "x$uname" = xDarwin -a $uversion -ge 100; then
|
||||
CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
|
||||
@@ -83,7 +85,7 @@ AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
|
||||
|
||||
dnl Default PageLogFormat
|
||||
AC_ARG_ENABLE(page_logging, [ --enable-page-logging enable page_log by default])
|
||||
AC_ARG_WITH(page_logging, [ --enable-page-logging enable page_log by default])
|
||||
if test "x$enable_page_logging" = xyes; then
|
||||
CUPS_PAGE_LOG_FORMAT=""
|
||||
else
|
||||
@@ -382,7 +384,7 @@ AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl Web interface...
|
||||
AC_ARG_ENABLE(webif, [ --enable-webif enable the web interface by default, default=no for macOS])
|
||||
AC_ARG_ENABLE(webif, [ --enable-webif enable the web interface by default, default=no for OS X])
|
||||
case "x$enable_webif" in
|
||||
xno)
|
||||
CUPS_WEBIF=No
|
||||
@@ -405,3 +407,7 @@ esac
|
||||
|
||||
AC_SUBST(CUPS_WEBIF)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 11789 2014-04-02 16:52:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-directories.m4 11717 2014-03-21 16:42:53Z msweet $"
|
||||
dnl
|
||||
dnl Directory stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -267,7 +269,7 @@ AC_SUBST(CUPS_REQUESTS)
|
||||
# Server executables...
|
||||
case "$uname" in
|
||||
*BSD* | Darwin*)
|
||||
# *BSD and Darwin (macOS)
|
||||
# *BSD and Darwin (MacOS X)
|
||||
INSTALL_SYSV=""
|
||||
CUPS_SERVERBIN="$exec_prefix/libexec/cups"
|
||||
;;
|
||||
@@ -291,7 +293,7 @@ AC_SUBST(CUPS_SERVERROOT)
|
||||
AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin (macOS)
|
||||
# Darwin (OS X)
|
||||
CUPS_STATEDIR="$CUPS_SERVERROOT"
|
||||
;;
|
||||
*)
|
||||
@@ -301,3 +303,7 @@ AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state dire
|
||||
esac])
|
||||
AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
|
||||
AC_SUBST(CUPS_STATEDIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-directories.m4 11717 2014-03-21 16:42:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi])
|
||||
@@ -24,7 +26,7 @@ DNSSD_BACKEND=""
|
||||
IPPFIND_BIN=""
|
||||
IPPFIND_MAN=""
|
||||
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$uname != xDarwin; then
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
|
||||
AC_MSG_CHECKING(for Avahi)
|
||||
if $PKGCONFIG --exists avahi-client; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -43,7 +45,7 @@ if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
|
||||
AC_CHECK_HEADER(dns_sd.h, [
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin and macOS...
|
||||
# Darwin and MacOS X...
|
||||
AC_DEFINE(HAVE_DNSSD)
|
||||
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
@@ -78,3 +80,7 @@ AC_SUBST(DNSSDLIBS)
|
||||
AC_SUBST(DNSSD_BACKEND)
|
||||
AC_SUBST(IPPFIND_BIN)
|
||||
AC_SUBST(IPPFIND_MAN)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl "$Id: cups-gssapi.m4 11911 2014-06-10 13:54:53Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products.
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl
|
||||
dnl This file contains Kerberos support code, copyright 2006 by
|
||||
dnl Jelmer Vernooij.
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl This file contains Kerberos support code, copyright 2006 by
|
||||
dnl Jelmer Vernooij.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(gssapi, [ --disable-gssapi disable GSSAPI support])
|
||||
@@ -24,7 +26,7 @@ if test x$enable_gssapi != xno; then
|
||||
if test "x$KRB5CONFIG" != x; then
|
||||
case "$uname" in
|
||||
Darwin)
|
||||
# macOS weak-links to the Kerberos framework...
|
||||
# OS X weak-links to the Kerberos framework...
|
||||
LIBGSSAPI="-weak_framework Kerberos"
|
||||
AC_MSG_CHECKING(for GSS framework)
|
||||
if test -d /System/Library/Frameworks/GSS.framework; then
|
||||
@@ -125,3 +127,7 @@ fi
|
||||
|
||||
AC_SUBST(CUPS_DEFAULT_GSSSERVICENAME)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-gssapi.m4 11911 2014-06-10 13:54:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
dnl
|
||||
dnl Large file support stuff for CUPS.
|
||||
dnl "$Id: cups-largefile.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl Large file support stuff for CUPS.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Check for largefile support...
|
||||
@@ -44,3 +46,7 @@ if test $ac_cv_c_long_long = yes; then
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-largefile.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
dnl
|
||||
dnl Libtool stuff for CUPS.
|
||||
dnl "$Id: cups-libtool.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl Libtool stuff for CUPS.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported
|
||||
@@ -31,3 +33,7 @@ if test x$LIBTOOL != x; then
|
||||
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
|
||||
DSO="\$(CC)"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-libtool.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-manpages.m4 11342 2013-10-18 20:36:01Z msweet $"
|
||||
dnl
|
||||
dnl Manpage stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -21,7 +23,7 @@ fi
|
||||
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
|
||||
case "$uname" in
|
||||
Darwin* | Linux | GNU | *BSD*)
|
||||
# Darwin, macOS, Linux, GNU HURD, and *BSD
|
||||
# Darwin, MacOS X, Linux, GNU HURD, and *BSD
|
||||
mandir="/usr/share/man"
|
||||
AMANDIR="/usr/share/man"
|
||||
PMANDIR="/usr/share/man"
|
||||
@@ -52,7 +54,7 @@ case "$uname" in
|
||||
MAN8DIR=1m
|
||||
;;
|
||||
Linux* | GNU* | Darwin*)
|
||||
# Linux, GNU Hurd, and macOS
|
||||
# Linux, GNU Hurd, and OS X
|
||||
MAN1EXT=1.gz
|
||||
MAN5EXT=5.gz
|
||||
MAN7EXT=7.gz
|
||||
@@ -74,3 +76,7 @@ AC_SUBST(MAN5EXT)
|
||||
AC_SUBST(MAN7EXT)
|
||||
AC_SUBST(MAN8EXT)
|
||||
AC_SUBST(MAN8DIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-manpages.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 12325 2014-12-09 20:28:51Z msweet $"
|
||||
dnl
|
||||
dnl Networking stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -47,7 +49,7 @@ if test x$enable_domainsocket != xno -a x$default_domainsocket != xno; then
|
||||
if test "x$default_domainsocket" = x; then
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin and macOS do their own thing...
|
||||
# Darwin and MaxOS X do their own thing...
|
||||
CUPS_DEFAULT_DOMAINSOCKET="$localstatedir/run/cupsd"
|
||||
;;
|
||||
*)
|
||||
@@ -68,3 +70,7 @@ fi
|
||||
|
||||
AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
|
||||
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-network.m4 12325 2014-12-09 20:28:51Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
dnl
|
||||
dnl Operating system stuff for CUPS.
|
||||
dnl "$Id: cups-opsys.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl Operating system stuff for CUPS.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Get the operating system, version number, and architecture...
|
||||
@@ -20,7 +22,7 @@ case "$uname" in
|
||||
Darwin*)
|
||||
uname="Darwin"
|
||||
if test $uversion -lt 120; then
|
||||
AC_MSG_ERROR([Sorry, this version of CUPS requires macOS 10.8 or higher.])
|
||||
AC_MSG_ERROR([Sorry, this version of CUPS requires OS X 10.8 or higher.])
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -31,3 +33,7 @@ case "$uname" in
|
||||
uname="Linux"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
dnl
|
||||
dnl PAM stuff for CUPS.
|
||||
dnl "$Id: cups-pam.m4 11342 2013-10-18 20:36:01Z msweet $"
|
||||
dnl
|
||||
dnl PAM stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
@@ -54,7 +56,7 @@ if test x$enable_pam != xno; then
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin/macOS
|
||||
# Darwin/OS X
|
||||
if test "x$with_pam_module" != x; then
|
||||
PAMFILE="pam.$with_pam_module"
|
||||
elif test -f /usr/lib/pam/pam_opendirectory.so.2; then
|
||||
@@ -89,3 +91,7 @@ AC_SUBST(PAMFILE)
|
||||
AC_SUBST(PAMLIBS)
|
||||
AC_SUBST(PAMMOD)
|
||||
AC_SUBST(PAMMODAUTH)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pam.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
dnl
|
||||
dnl Select/poll stuff for CUPS.
|
||||
dnl "$Id: cups-poll.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
dnl Select/poll stuff for CUPS.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_CHECK_FUNC(poll, AC_DEFINE(HAVE_POLL))
|
||||
AC_CHECK_FUNC(epoll_create, AC_DEFINE(HAVE_EPOLL))
|
||||
AC_CHECK_FUNC(kqueue, AC_DEFINE(HAVE_KQUEUE))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-poll.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
dnl
|
||||
dnl Scripting configuration stuff for CUPS.
|
||||
dnl "$Id: cups-scripting.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2010 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl Scripting configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl Copyright 2007-2010 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Do we have Java?
|
||||
@@ -81,3 +83,7 @@ AC_DEFINE_UNQUOTED(CUPS_PYTHON, "$CUPS_PYTHON")
|
||||
if test "x$CUPS_PYTHON" != x; then
|
||||
AC_DEFINE(HAVE_PYTHON)
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-scripting.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
dnl
|
||||
dnl "$Id: cups-sharedlibs.m4 11342 2013-10-18 20:36:01Z msweet $"
|
||||
dnl
|
||||
dnl Shared library support for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
@@ -154,3 +156,7 @@ fi
|
||||
AC_SUBST(DSOLIBS)
|
||||
AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-sharedlibs.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 12290 2014-12-05 17:25:55Z msweet $"
|
||||
dnl
|
||||
dnl TLS stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -51,10 +53,6 @@ if test x$enable_ssl != xno; then
|
||||
|
||||
AC_DEFINE(HAVE_CSSMERRORSTRING)
|
||||
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])
|
||||
|
||||
if test $uversion -ge 150; then
|
||||
AC_DEFINE(HAVE_SSLSETENABLEDCIPHERS)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -104,3 +102,7 @@ AC_SUBST(SSLLIBS)
|
||||
|
||||
EXPORT_SSLLIBS="$SSLLIBS"
|
||||
AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ssl.m4 12290 2014-12-05 17:25:55Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-startup.m4 12351 2014-12-09 22:18:45Z msweet $"
|
||||
dnl
|
||||
dnl Launch-on-demand/startup stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -16,20 +18,23 @@ ONDEMANDLIBS=""
|
||||
AC_SUBST(ONDEMANDFLAGS)
|
||||
AC_SUBST(ONDEMANDLIBS)
|
||||
|
||||
dnl Launchd is used on macOS/Darwin...
|
||||
dnl Launchd is used on OS X/Darwin...
|
||||
AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support])
|
||||
LAUNCHD_DIR=""
|
||||
AC_SUBST(LAUNCHD_DIR)
|
||||
|
||||
if test x$enable_launchd != xno; then
|
||||
AC_CHECK_FUNC(launch_activate_socket, [
|
||||
AC_DEFINE(HAVE_LAUNCHD)
|
||||
AC_DEFINE(HAVE_ONDEMAND)])
|
||||
AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD))
|
||||
if test $uversion -ge 140; then
|
||||
AC_CHECK_FUNC(launch_activate_socket, [
|
||||
AC_DEFINE(HAVE_LAUNCHD)
|
||||
AC_DEFINE(HAVE_LAUNCH_ACTIVATE_SOCKET)])
|
||||
fi
|
||||
AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin, macOS
|
||||
# Darwin, MacOS X
|
||||
LAUNCHD_DIR="/System/Library/LaunchDaemons"
|
||||
# liblaunch is already part of libSystem
|
||||
;;
|
||||
@@ -51,48 +56,21 @@ if test x$enable_systemd != xno; then
|
||||
AC_MSG_ERROR(Need pkg-config to enable systemd support.)
|
||||
fi
|
||||
else
|
||||
have_systemd=no
|
||||
AC_MSG_CHECKING(for libsystemd)
|
||||
if $PKGCONFIG --exists libsystemd; then
|
||||
AC_MSG_CHECKING(for libsystemd-daemon)
|
||||
if $PKGCONFIG --exists libsystemd-daemon; then
|
||||
AC_MSG_RESULT(yes)
|
||||
have_systemd=yes
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd`
|
||||
elif $PKGCONFIG --exists libsystemd-daemon; then
|
||||
AC_MSG_RESULT(yes - legacy)
|
||||
have_systemd=yes
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
|
||||
if $PKGCONFIG --exists libsystemd-journal; then
|
||||
ONDEMANDFLAGS="$ONDEMANDFLAGS `$PKGCONFIG --cflags libsystemd-journal`"
|
||||
ONDEMANDLIBS="$ONDEMANDLIBS `$PKGCONFIG --libs libsystemd-journal`"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
if test $have_systemd = yes; then
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
AC_DEFINE(HAVE_SYSTEMD)
|
||||
AC_DEFINE(HAVE_ONDEMAND)
|
||||
AC_CHECK_HEADER(systemd/sd-journal.h,AC_DEFINE(HAVE_SYSTEMD_SD_JOURNAL_H))
|
||||
if test "x$SYSTEMD_DIR" = x; then
|
||||
SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Upstart is also used on Linux (e.g., Chrome OS)
|
||||
AC_ARG_ENABLE(upstart, [ --enable-upstart enable upstart support])
|
||||
if test "x$enable_upstart" = "xyes"; then
|
||||
if test "x$have_systemd" = "xyes"; then
|
||||
AC_MSG_ERROR(Cannot support both systemd and upstart.)
|
||||
fi
|
||||
AC_DEFINE(HAVE_UPSTART)
|
||||
AC_DEFINE(HAVE_ONDEMAND)
|
||||
fi
|
||||
|
||||
dnl Solaris uses smf
|
||||
SMFMANIFESTDIR=""
|
||||
AC_SUBST(SMFMANIFESTDIR)
|
||||
@@ -191,3 +169,8 @@ if test "x$xinetd" = x; then
|
||||
elif test "x$xinetd" != xno; then
|
||||
XINETD="$xinetd"
|
||||
fi
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-startup.m4 12351 2014-12-09 22:18:45Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
dnl
|
||||
dnl Threading stuff for CUPS.
|
||||
dnl "$Id: cups-threads.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl Threading stuff for CUPS.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(threads, [ --disable-threads disable multi-threading support])
|
||||
@@ -46,3 +48,7 @@ if test "x$enable_threads" != xno; then
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_FLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-threads.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
+28
-45
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: config.h.in 12329 2014-12-09 20:50:51Z msweet $"
|
||||
*
|
||||
* Configuration file for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -240,20 +242,6 @@
|
||||
#undef HAVE_VSYSLOG
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the ASL functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_ASL_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the systemd journal functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYSTEMD_SD_JOURNAL_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the (v)snprintf() functions?
|
||||
*/
|
||||
@@ -360,13 +348,6 @@
|
||||
#undef HAVE_SECKEYCHAINOPEN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have (a working) SSLSetEnabledCiphers function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SSLSETENABLEDCIPHERS
|
||||
|
||||
|
||||
/*
|
||||
* Do we have libpaper?
|
||||
*/
|
||||
@@ -479,19 +460,13 @@
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have on-demand support (launchd/systemd/upstart)?
|
||||
*/
|
||||
|
||||
#undef HAVE_ONDEMAND
|
||||
|
||||
|
||||
/*
|
||||
* Do we have launchd support?
|
||||
*/
|
||||
|
||||
#undef HAVE_LAUNCH_H
|
||||
#undef HAVE_LAUNCHD
|
||||
#undef HAVE_LAUNCH_ACTIVATE_SOCKET
|
||||
|
||||
|
||||
/*
|
||||
@@ -501,13 +476,6 @@
|
||||
#undef HAVE_SYSTEMD
|
||||
|
||||
|
||||
/*
|
||||
* Do we have upstart support?
|
||||
*/
|
||||
|
||||
#undef HAVE_UPSTART
|
||||
|
||||
|
||||
/*
|
||||
* Various scripting languages...
|
||||
*/
|
||||
@@ -522,6 +490,24 @@
|
||||
#define CUPS_PYTHON "/usr/bin/python"
|
||||
|
||||
|
||||
/*
|
||||
* Location of the poppler/Xpdf pdftops program...
|
||||
*/
|
||||
|
||||
#undef HAVE_PDFTOPS
|
||||
#undef HAVE_PDFTOPS_WITH_ORIGPAGESIZES
|
||||
#define CUPS_PDFTOPS "/usr/bin/pdftops"
|
||||
|
||||
|
||||
/*
|
||||
* Location of the Ghostscript gs program...
|
||||
*/
|
||||
|
||||
#undef HAVE_GHOSTSCRIPT
|
||||
#undef HAVE_GHOSTSCRIPT_PS2WRITE
|
||||
#define CUPS_GHOSTSCRIPT "/usr/bin/gs"
|
||||
|
||||
|
||||
/*
|
||||
* Do we have CoreFoundation public and private headers?
|
||||
*/
|
||||
@@ -546,14 +532,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the getgrouplist() function?
|
||||
*/
|
||||
|
||||
#undef HAVE_GETGROUPLIST
|
||||
|
||||
|
||||
/*
|
||||
* Do we have macOS 10.4's mbr_XXX functions?
|
||||
* Do we have OS X 10.4's mbr_XXX functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_MEMBERSHIP_H
|
||||
@@ -699,7 +678,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Location of macOS localization bundle, if any.
|
||||
* Location of OS X localization bundle, if any.
|
||||
*/
|
||||
|
||||
#undef CUPS_BUNDLEDIR
|
||||
@@ -738,3 +717,7 @@ static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
|
||||
#endif /* !HAVE_ABS && !abs */
|
||||
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: config.h.in 12329 2014-12-09 20:50:51Z msweet $".
|
||||
*/
|
||||
|
||||
externo
+205
-279
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+9
-6
@@ -1,7 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: configure.ac 12222 2014-10-21 11:55:01Z msweet $"
|
||||
dnl
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -11,11 +13,7 @@ dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Package name and version...
|
||||
AC_INIT([CUPS], [2.2b2], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
AC_INIT(cups/cups.h)
|
||||
|
||||
sinclude(config-scripts/cups-opsys.m4)
|
||||
sinclude(config-scripts/cups-common.m4)
|
||||
@@ -68,6 +66,7 @@ AC_OUTPUT(Makedefs
|
||||
conf/pam.std
|
||||
conf/snmp.conf
|
||||
cups-config
|
||||
data/testprint
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
man/client.conf.man
|
||||
@@ -91,3 +90,7 @@ AC_OUTPUT(Makedefs
|
||||
$LANGFILES)
|
||||
|
||||
chmod +x cups-config
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: configure.ac 12222 2014-10-21 11:55:01Z msweet $".
|
||||
dnl
|
||||
|
||||
+16
-10
@@ -1,19 +1,21 @@
|
||||
#!/bin/sh
|
||||
#! /bin/sh
|
||||
#
|
||||
# CUPS configuration utility.
|
||||
# "$Id: cups-config.in 10996 2013-05-29 11:51:34Z msweet $"
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2001-2006 by Easy Software Products, all rights reserved.
|
||||
# CUPS configuration utility.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 2001-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
VERSION="@CUPS_VERSION@"
|
||||
APIVERSION="2.2"
|
||||
APIVERSION="1.6"
|
||||
BUILD="@CUPS_BUILD@"
|
||||
|
||||
prefix=@prefix@
|
||||
@@ -138,3 +140,7 @@ while test $# -gt 0; do
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
#
|
||||
# End of "$Id: cups-config.in 10996 2013-05-29 11:51:34Z msweet $".
|
||||
#
|
||||
|
||||
+119
-112
@@ -2,67 +2,99 @@ adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd.h raster.h \
|
||||
adminutil.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h adminutil.h
|
||||
array.o: array.c ../cups/cups.h file.h versioning.h ipp.h http.h array.h \
|
||||
language.h pwg.h string-private.h ../config.h debug-private.h \
|
||||
array-private.h
|
||||
attr.o: attr.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
auth.o: auth.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h pwg.h
|
||||
backend.o: backend.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h backend.h ppd.h raster.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h backend.h
|
||||
conflicts.o: conflicts.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
custom.o: custom.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
debug.o: debug.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
dest.o: dest.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
dest-job.o: dest-job.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
dest-localization.o: dest-localization.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
thread-private.h
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
dest-options.o: dest-options.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
thread-private.h
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
dir.o: dir.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h dir.h
|
||||
emit.o: emit.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
encode.o: encode.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
file.o: file.c file-private.h cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
getdevices.o: getdevices.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h adminutil.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
getifaddrs.o: getifaddrs.c http-private.h ../config.h ../cups/language.h \
|
||||
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
|
||||
../cups/ipp.h
|
||||
@@ -70,59 +102,73 @@ getputfile.o: getputfile.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
globals.o: globals.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
hash.o: hash.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
http.o: http.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
http-addr.o: http-addr.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
http-addrlist.o: http-addrlist.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
thread-private.h
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
http-support.o: http-support.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
thread-private.h
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
ipp.o: ipp.c cups-private.h string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
|
||||
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
|
||||
file.h pwg.h thread-private.h
|
||||
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
ipp-support.o: ipp-support.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
langprintf.o: langprintf.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
language.o: language.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
localize.o: localize.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
mark.o: mark.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
md5.o: md5.c md5-private.h string-private.h ../config.h
|
||||
md5passwd.o: md5passwd.c http-private.h ../config.h ../cups/language.h \
|
||||
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
|
||||
@@ -131,138 +177,102 @@ notify.o: notify.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
options.o: options.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
page.o: page.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h ppd.h cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h
|
||||
ppd.o: ppd.c cups-private.h string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
|
||||
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
|
||||
file.h pwg.h thread-private.h ppd-private.h ../cups/ppd.h raster.h
|
||||
ppd-attr.o: ppd-attr.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
ppd-cache.o: ppd-cache.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
ppd-conflicts.o: ppd-conflicts.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
thread-private.h ppd-private.h ../cups/ppd.h raster.h
|
||||
ppd-custom.o: ppd-custom.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
ppd-emit.o: ppd-emit.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd.h raster.h
|
||||
ppd-localize.o: ppd-localize.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
thread-private.h ppd-private.h ../cups/ppd.h raster.h
|
||||
ppd-mark.o: ppd-mark.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
ppd-page.o: ppd-page.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h ppd.h cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h raster.h
|
||||
ppd-util.o: ppd-util.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
pwg-media.o: pwg-media.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
request.o: request.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
sidechannel.o: sidechannel.c sidechannel.h versioning.h cups-private.h \
|
||||
string-private.h ../config.h debug-private.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
thread-private.h
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
snmp.o: snmp.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h snmp-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h snmp-private.h
|
||||
snprintf.o: snprintf.c string-private.h ../config.h
|
||||
string.o: string.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
tempfile.o: tempfile.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
thread.o: thread.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
tls.o: tls.c cups-private.h string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
|
||||
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
|
||||
file.h pwg.h thread-private.h tls-darwin.c
|
||||
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h tls-darwin.c
|
||||
transcode.o: transcode.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
usersys.o: usersys.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
util.o: util.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testadmin.o: testadmin.c adminutil.h cups.h file.h versioning.h ipp.h \
|
||||
http.h array.h language.h pwg.h string-private.h ../config.h
|
||||
testarray.o: testarray.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h dir.h
|
||||
testcache.o: testcache.c ppd-private.h ../cups/cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \
|
||||
pwg-private.h file-private.h cups-private.h string-private.h \
|
||||
../config.h debug-private.h array-private.h ipp-private.h \
|
||||
http-private.h md5-private.h language-private.h ../cups/transcode.h \
|
||||
thread-private.h
|
||||
testconflicts.o: testconflicts.c cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h pwg.h ppd.h raster.h string-private.h ../config.h
|
||||
array.h language.h pwg.h ppd.h string-private.h ../config.h
|
||||
testcups.o: testcups.c string-private.h ../config.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h ppd.h raster.h
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h ppd.h
|
||||
testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \
|
||||
language.h pwg.h
|
||||
testfile.o: testfile.c string-private.h ../config.h debug-private.h \
|
||||
@@ -271,7 +281,8 @@ testhttp.o: testhttp.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testi18n.o: testi18n.c string-private.h ../config.h language-private.h \
|
||||
../cups/transcode.h language.h array.h versioning.h
|
||||
testipp.o: testipp.c file.h versioning.h string-private.h ../config.h \
|
||||
@@ -280,32 +291,28 @@ testoptions.o: testoptions.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testlang.o: testlang.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testppd.o: testppd.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
testpwg.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \
|
||||
pwg-private.h file-private.h cups-private.h string-private.h \
|
||||
../config.h debug-private.h array-private.h ipp-private.h \
|
||||
http-private.h md5-private.h language-private.h ../cups/transcode.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testpwg.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h pwg-private.h \
|
||||
file-private.h cups-private.h string-private.h ../config.h \
|
||||
debug-private.h array-private.h ipp-private.h http-private.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h thread-private.h
|
||||
testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h snmp-private.h
|
||||
tlscheck.o: tlscheck.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h snmp-private.h
|
||||
|
||||
+68
-38
@@ -1,7 +1,9 @@
|
||||
#
|
||||
# "$Id: Makefile 12032 2014-07-15 20:37:32Z msweet $"
|
||||
#
|
||||
# API library Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -30,22 +32,25 @@ OPTIONS = -D_CUPS_NO_DEPRECATED=1 -D_PPD_DEPRECATED=""
|
||||
LIBOBJS = \
|
||||
adminutil.o \
|
||||
array.o \
|
||||
attr.o \
|
||||
auth.o \
|
||||
backchannel.o \
|
||||
backend.o \
|
||||
conflicts.o \
|
||||
custom.o \
|
||||
debug.o \
|
||||
dest.o \
|
||||
dest-job.o \
|
||||
dest-localization.o \
|
||||
dest-options.o \
|
||||
dir.o \
|
||||
emit.o \
|
||||
encode.o \
|
||||
file.o \
|
||||
getdevices.o \
|
||||
getifaddrs.o \
|
||||
getputfile.o \
|
||||
globals.o \
|
||||
hash.o \
|
||||
http.o \
|
||||
http-addr.o \
|
||||
http-addrlist.o \
|
||||
@@ -54,20 +59,15 @@ LIBOBJS = \
|
||||
ipp-support.o \
|
||||
langprintf.o \
|
||||
language.o \
|
||||
localize.o \
|
||||
mark.o \
|
||||
md5.o \
|
||||
md5passwd.o \
|
||||
notify.o \
|
||||
options.o \
|
||||
page.o \
|
||||
ppd.o \
|
||||
ppd-attr.o \
|
||||
ppd-cache.o \
|
||||
ppd-conflicts.o \
|
||||
ppd-custom.o \
|
||||
ppd-emit.o \
|
||||
ppd-localize.o \
|
||||
ppd-mark.o \
|
||||
ppd-page.o \
|
||||
ppd-util.o \
|
||||
pwg-media.o \
|
||||
request.o \
|
||||
sidechannel.o \
|
||||
@@ -83,7 +83,6 @@ LIBOBJS = \
|
||||
TESTOBJS = \
|
||||
testadmin.o \
|
||||
testarray.o \
|
||||
testcache.o \
|
||||
testconflicts.o \
|
||||
testcups.o \
|
||||
testdest.o \
|
||||
@@ -95,8 +94,7 @@ TESTOBJS = \
|
||||
testlang.o \
|
||||
testppd.o \
|
||||
testpwg.o \
|
||||
testsnmp.o \
|
||||
tlscheck.o
|
||||
testsnmp.o
|
||||
OBJS = \
|
||||
$(LIBOBJS) \
|
||||
$(TESTOBJS)
|
||||
@@ -163,8 +161,7 @@ UNITTARGETS = \
|
||||
testoptions \
|
||||
testppd \
|
||||
testpwg \
|
||||
testsnmp \
|
||||
tlscheck
|
||||
testsnmp
|
||||
|
||||
TARGETS = \
|
||||
$(LIBTARGETS)
|
||||
@@ -320,14 +317,13 @@ libcups.so.2: $(LIBOBJS)
|
||||
|
||||
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
echo Creating export list for $@...
|
||||
nm -gm $(LIBOBJS) 2>/dev/null | grep "__text" | grep -v weak | \
|
||||
awk '{print $$NF}' | \
|
||||
grep -v -E -e '^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault)$$' | \
|
||||
nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}' | \
|
||||
grep -v -e '^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
|
||||
sort >t.exp
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.12.0 \
|
||||
-current_version 2.11.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
-exported_symbols_list t.exp \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
@@ -343,7 +339,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
libcups.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:12 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
-rpath $(LIBDIR) -version-info 2:11 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -543,16 +539,6 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# tlscheck (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
tlscheck: tlscheck.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# Automatic API help files...
|
||||
#
|
||||
@@ -564,13 +550,6 @@ apihelp:
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-overview.header --intro api-overview.shtml \
|
||||
>../doc/help/api-overview.html
|
||||
mxmldoc --section "Programming" --title "Administration APIs" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-admin.header --intro api-admin.shtml \
|
||||
api-admin.xml \
|
||||
adminutil.c adminutil.h getdevices.c >../doc/help/api-admin.html
|
||||
mxmldoc --tokens help/api-admin.html api-admin.xml >../doc/help/api-admin.tokens
|
||||
$(RM) api-admin.xml
|
||||
mxmldoc --section "Programming" --title "Array API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-array.header --intro api-array.shtml \
|
||||
@@ -597,7 +576,9 @@ apihelp:
|
||||
mxmldoc --section "Programming" --title "PPD API (DEPRECATED)" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-ppd.header --intro api-ppd.shtml \
|
||||
api-ppd.xml ppd.h ppd-*.c >../doc/help/api-ppd.html
|
||||
api-ppd.xml \
|
||||
ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
|
||||
ppd.c >../doc/help/api-ppd.html
|
||||
mxmldoc --tokens help/api-ppd.html api-ppd.xml >../doc/help/api-ppd.tokens
|
||||
$(RM) api-ppd.xml
|
||||
mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
|
||||
@@ -619,6 +600,50 @@ apihelp:
|
||||
mxmldoc --tokens help/api-filter.html api-filter.xml >../doc/help/api-filter.tokens
|
||||
$(RM) api-filter.xml
|
||||
|
||||
framedhelp:
|
||||
echo Generating CUPS API help files...
|
||||
mxmldoc --framed api-overview \
|
||||
--section "Programming" \
|
||||
--title "Introduction to CUPS Programming" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-overview.header --intro api-overview.shtml
|
||||
mxmldoc --framed api-array \
|
||||
--section "Programming" --title "Array API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-array.header --intro api-array.shtml \
|
||||
array.h array.c
|
||||
mxmldoc --framed api-cups \
|
||||
--section "Programming" --title "CUPS API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-cups.header --intro api-cups.shtml \
|
||||
cups.h adminutil.c dest*.c language.c notify.c \
|
||||
options.c tempfile.c usersys.c \
|
||||
util.c
|
||||
mxmldoc --framed api-filedir \
|
||||
--section "Programming" --title "File and Directory APIs" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-filedir.header --intro api-filedir.shtml \
|
||||
file.h file.c dir.h dir.c
|
||||
mxmldoc --framed api-ppd \
|
||||
--section "Programming" --title "PPD API (DEPRECATED)" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-ppd.header --intro api-ppd.shtml \
|
||||
ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
|
||||
page.c ppd.c
|
||||
mxmldoc --framed api-httpipp \
|
||||
--section "Programming" --title "HTTP and IPP APIs" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-httpipp.header --intro api-httpipp.shtml \
|
||||
http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
|
||||
http.c http-addr.c http-support.c ipp.c ipp-support.c \
|
||||
md5passwd.c request.c
|
||||
mxmldoc --framed api-filter \
|
||||
--section "Programming" \
|
||||
--title "Filter and Backend Programming" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-filter.header --intro api-filter.shtml \
|
||||
backchannel.c backend.h backend.c sidechannel.c sidechannel.h
|
||||
|
||||
|
||||
#
|
||||
# Lines of code computation...
|
||||
@@ -637,3 +662,8 @@ sloc:
|
||||
|
||||
include Dependencies
|
||||
tls.o: tls-darwin.c tls-gnutls.c tls-sspi.c
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 12032 2014-07-15 20:37:32Z msweet $".
|
||||
#
|
||||
|
||||
+11
-48
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* "$Id: adminutil.c 11598 2014-02-18 18:58:19Z msweet $"
|
||||
*
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -18,7 +20,6 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "ppd.h"
|
||||
#include "adminutil.h"
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -831,7 +832,7 @@ cupsAdminExportSamba(
|
||||
* The returned settings should be freed with cupsFreeOptions() when
|
||||
* you are done with them.
|
||||
*
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -1147,7 +1148,7 @@ cupsAdminGetServerSettings(
|
||||
/*
|
||||
* 'cupsAdminSetServerSettings()' - Set settings on the server.
|
||||
*
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -1174,7 +1175,6 @@ cupsAdminSetServerSettings(
|
||||
in_cancel_job, /* In a cancel-job section? */
|
||||
in_admin_location, /* In the /admin location? */
|
||||
in_conf_location, /* In the /admin/conf location? */
|
||||
in_log_location, /* In the /admin/log location? */
|
||||
in_root_location; /* In the / location? */
|
||||
const char *val; /* Setting value */
|
||||
int share_printers, /* Share local printers */
|
||||
@@ -1188,7 +1188,6 @@ cupsAdminSetServerSettings(
|
||||
wrote_loglevel, /* Wrote the LogLevel line? */
|
||||
wrote_admin_location, /* Wrote the /admin location? */
|
||||
wrote_conf_location, /* Wrote the /admin/conf location? */
|
||||
wrote_log_location, /* Wrote the /admin/log location? */
|
||||
wrote_root_location; /* Wrote the / location? */
|
||||
int indent; /* Indentation */
|
||||
int cupsd_num_settings; /* New number of settings */
|
||||
@@ -1402,14 +1401,12 @@ cupsAdminSetServerSettings(
|
||||
in_conf_location = 0;
|
||||
in_default_policy = 0;
|
||||
in_location = 0;
|
||||
in_log_location = 0;
|
||||
in_policy = 0;
|
||||
in_root_location = 0;
|
||||
linenum = 0;
|
||||
wrote_admin_location = 0;
|
||||
wrote_browsing = 0;
|
||||
wrote_conf_location = 0;
|
||||
wrote_log_location = 0;
|
||||
wrote_loglevel = 0;
|
||||
wrote_policy = 0;
|
||||
wrote_port_listen = 0;
|
||||
@@ -1553,10 +1550,8 @@ cupsAdminSetServerSettings(
|
||||
indent += 2;
|
||||
if (!strcmp(value, "/admin"))
|
||||
in_admin_location = 1;
|
||||
else if (!strcmp(value, "/admin/conf"))
|
||||
if (!strcmp(value, "/admin/conf"))
|
||||
in_conf_location = 1;
|
||||
else if (!strcmp(value, "/admin/log"))
|
||||
in_log_location = 1;
|
||||
else if (!strcmp(value, "/"))
|
||||
in_root_location = 1;
|
||||
|
||||
@@ -1598,23 +1593,6 @@ cupsAdminSetServerSettings(
|
||||
cupsFilePrintf(temp, " Allow %s\n",
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
}
|
||||
else if (in_log_location && remote_admin >= 0)
|
||||
{
|
||||
wrote_log_location = 1;
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePuts(temp, " # Allow remote access to the log "
|
||||
"files...\n");
|
||||
else
|
||||
cupsFilePuts(temp, " # Restrict access to the log "
|
||||
"files...\n");
|
||||
|
||||
cupsFilePuts(temp, " Order allow,deny\n");
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePrintf(temp, " Allow %s\n",
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
}
|
||||
else if (in_root_location &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
{
|
||||
@@ -1641,7 +1619,6 @@ cupsAdminSetServerSettings(
|
||||
|
||||
in_admin_location = 0;
|
||||
in_conf_location = 0;
|
||||
in_log_location = 0;
|
||||
in_root_location = 0;
|
||||
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
@@ -1890,25 +1867,6 @@ cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
|
||||
if (!wrote_log_location && remote_admin >= 0)
|
||||
{
|
||||
if (remote_admin)
|
||||
cupsFilePuts(temp,
|
||||
"# Allow remote access to the log files...\n");
|
||||
else
|
||||
cupsFilePuts(temp, "# Restrict access to the log files...\n");
|
||||
|
||||
cupsFilePuts(temp, "<Location /admin/log>\n"
|
||||
" AuthType Default\n"
|
||||
" Require user @SYSTEM\n"
|
||||
" Order allow,deny\n");
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
|
||||
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
|
||||
if (!wrote_policy && user_cancel_any >= 0)
|
||||
{
|
||||
cupsFilePuts(temp, "<Policy default>\n"
|
||||
@@ -2365,3 +2323,8 @@ write_option(cups_file_t *dstfp, /* I - PPD file */
|
||||
|
||||
cupsFilePrintf(dstfp, "*JCLCloseUI: *%s\n\n", name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: adminutil.c 11598 2014-02-18 18:58:19Z msweet $".
|
||||
*/
|
||||
|
||||
+16
-28
@@ -1,16 +1,18 @@
|
||||
/*
|
||||
* Administration utility API definitions for CUPS.
|
||||
* "$Id: adminutil.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_ADMINUTIL_H_
|
||||
@@ -40,23 +42,11 @@ extern "C" {
|
||||
# define CUPS_SERVER_DEBUG_LOGGING "_debug_logging"
|
||||
# define CUPS_SERVER_REMOTE_ADMIN "_remote_admin"
|
||||
# define CUPS_SERVER_REMOTE_ANY "_remote_any"
|
||||
/*# define CUPS_SERVER_REMOTE_PRINTERS "_remote_printers"*/
|
||||
# define CUPS_SERVER_SHARE_PRINTERS "_share_printers"
|
||||
# define CUPS_SERVER_USER_CANCEL_ANY "_user_cancel_any"
|
||||
|
||||
|
||||
/*
|
||||
* Types and structures...
|
||||
*/
|
||||
|
||||
typedef void (*cups_device_cb_t)(const char *device_class,
|
||||
const char *device_id, const char *device_info,
|
||||
const char *device_make_and_model,
|
||||
const char *device_uri,
|
||||
const char *device_location, void *user_data);
|
||||
/* Device callback
|
||||
* @since CUPS 1.4/macOS 10.6@ */
|
||||
|
||||
|
||||
/*
|
||||
* Functions...
|
||||
*/
|
||||
@@ -79,15 +69,13 @@ extern int cupsAdminSetServerSettings(http_t *http,
|
||||
cups_option_t *settings)
|
||||
_CUPS_API_1_3;
|
||||
|
||||
extern ipp_status_t cupsGetDevices(http_t *http, int timeout,
|
||||
const char *include_schemes,
|
||||
const char *exclude_schemes,
|
||||
cups_device_cb_t callback,
|
||||
void *user_data) _CUPS_API_1_4;
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_ADMINUTIL_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: adminutil.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
<!--
|
||||
Administrative API documentation for CUPS.
|
||||
|
||||
Copyright 2016 by Apple Inc.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h2 class="title"><a name="OVERVIEW">Overview</a></h2>
|
||||
|
||||
<p>The administrative APIs provide convenience functions to perform certain administrative functions with the CUPS scheduler.</p>
|
||||
|
||||
<blockquote><b>Note:<b>
|
||||
<p>Administrative functions normally require administrative privileges to execute and must not be used in ordinary user applications!</p>
|
||||
</blockquote>
|
||||
|
||||
<h3><a name="SETTINGS">Scheduler Settings</a></h3>
|
||||
|
||||
<p>The <a href="#cupsAdminGetServerSettings"><code>cupsAdminGetServerSettings</code></a> and <a href="#cupsAdminSetServerSettings"><code>cupsAdminSetServerSettings</code></a> functions allow you to get and set simple directives and their values, respectively, in the <var>cupsd.conf</var> file for the CUPS scheduler. Settings are stored in CUPS option arrays which provide a simple list of string name/value pairs. While any simple <var>cupsd.conf</var> directive name can be specified, the following convenience names are also defined to control common complex directives:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>CUPS_SERVER_DEBUG_LOGGING</code></li>: For <code>cupsAdminGetServerSettings</code>, a value of "1" means that the <code>LogLevel</code> directive is set to <code>debug</code> or <code>debug2</code> while a value of "0" means it is set to any other value. For <code>cupsAdminSetServerSettings</code> a value of "1" sets the <code>LogLeveL</code> to <code>debug</code> while a value of "0" sets it to <code>warn</code>.</li>
|
||||
<li><code>CUPS_SERVER_REMOTE_ADMIN</code></li>: A value of "1" specifies that administrative requests are accepted from remote addresses while "0" specifies that requests are only accepted from local addresses (loopback interface and domain sockets).</li>
|
||||
<li><code>CUPS_SERVER_REMOTE_ANY</code></li>: A value of "1" specifies that requests are accepts from any address while "0" specifies that requests are only accepted from the local subnet (when sharing is enabled) or local addresses (loopback interface and domain sockets).</li>
|
||||
<li><code>CUPS_SERVER_SHARE_PRINTERS</code></li>: A value of "1" specifies that printer sharing is enabled for selected printers and remote requests are accepted while a value of "0" specifies that printer sharing is disables and remote requests are not accepted.</li>
|
||||
<li><code>CUPS_SERVER_USER_CANCEL_ANY</code></li>: A value of "1" specifies that the default security policy allows any user to cancel any print job, regardless of the owner. A value of "0" specifies that only administrative users can cancel other user's jobs.</li>
|
||||
</ul>
|
||||
|
||||
<blockquote><b>Note:</b>
|
||||
<p>Changing settings will restart the CUPS scheduler.</p>
|
||||
<p>When printer sharing or the web interface are enabled, the scheduler's launch-on-demand functionality is effectively disabled. This can affect power usage, system performance, and the security profile of a system.</p>
|
||||
</blockquote>
|
||||
|
||||
<p>The recommended way to make changes to the <var>cupsd.conf</var> is to first call <a href="#cupsAdminGetServerSettings"><code>cupsAdminGetServerSettings</code></a>, make any changes to the returned option array, and then call <a href="#cupsAdminSetServerSettings"><code>cupsAdminSetServerSettings</code></a> to save those settings. For example, to enable the web interface:</p>
|
||||
|
||||
<pre class="example">
|
||||
#include <cups/cups.h>
|
||||
#include <cups/adminutil.h>
|
||||
|
||||
void
|
||||
enable_web_interface(void)
|
||||
{
|
||||
int num_settings = 0; /* Number of settings */
|
||||
cups_option_t *settings = NULL; /* Settings */
|
||||
|
||||
|
||||
if (!<a href="#cupsAdminGetServerSettings">cupsAdminGetServerSettings</a>(CUPS_HTTP_DEFAULT, &num_settings, &settings))
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to get server settings: %s\n", cupsLastErrorString());
|
||||
return;
|
||||
}
|
||||
|
||||
num_settings = <a href="api-cups.html#cupsAddOption">cupsAddOption</a>("WebInterface", "Yes", num_settings, &settings);
|
||||
|
||||
if (!<a href="#cupsAdminSetServerSettings">cupsAdminSetServerSettings</a>(CUPS_HTTP_DEFAULT, num_settings, settings))
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to set server settings: %s\n", cupsLastErrorString());
|
||||
}
|
||||
|
||||
<a href="api-cups.html#cupsFreeOptions">cupsFreeOptions</a>(num_settings, settings);
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3><a name="DEVICES">Devices</a></h3>
|
||||
|
||||
<p>Printers can be discovered through the CUPS scheduler using the <a href="#cupsGetDevices"><code>cupsGetDevices</code></a> API. Typically this API is used to locate printers to add the the system. Each device that is found will cause a supplied callback function to be executed. For example, to list the available printer devices that can be found within 30 seconds:</p>
|
||||
|
||||
<pre class="example">
|
||||
#include <cups/cups.h>
|
||||
#include <cups/adminutil.h>
|
||||
|
||||
|
||||
void
|
||||
get_devices_cb(
|
||||
const char *device_class, /* I - Class */
|
||||
const char *device_id, /* I - 1284 device ID */
|
||||
const char *device_info, /* I - Description */
|
||||
const char *device_make_and_model, /* I - Make and model */
|
||||
const char *device_uri, /* I - Device URI */
|
||||
const char *device_location, /* I - Location */
|
||||
void *user_data) /* I - User data */
|
||||
{
|
||||
puts(device_uri);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
show_devices(void)
|
||||
{
|
||||
<a href="#cupsGetDevices">cupsGetDevices</a>(CUPS_HTTP_DEFAULT, 30, NULL, NULL, get_devices_cb, NULL);
|
||||
}
|
||||
</pre>
|
||||
@@ -1,4 +1,6 @@
|
||||
<!--
|
||||
"$Id: api-array.header 7266 2008-01-29 02:15:29Z mike $"
|
||||
|
||||
Array API header for CUPS.
|
||||
|
||||
Copyright 2008-2011 by Apple Inc.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<!--
|
||||
"$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
|
||||
|
||||
Array API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2011 by Apple Inc.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<!--
|
||||
"$Id: api-cups.header 7279 2008-01-31 01:50:44Z mike $"
|
||||
|
||||
CUPS API header for CUPS.
|
||||
|
||||
Copyright 2008-2011 by Apple Inc.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<!--
|
||||
"$Id: api-cups.shtml 7337 2008-02-22 04:44:04Z mike $"
|
||||
|
||||
API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<!--
|
||||
"$Id: api-filedir.header 7279 2008-01-31 01:50:44Z mike $"
|
||||
|
||||
File and Directory API header for CUPS.
|
||||
|
||||
Copyright 2008-2011 by Apple Inc.
|
||||
|
||||
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