Comparar commits
279 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 070e33a4c9 | |||
| 1da024d1a7 | |||
| 6ad44eebc7 | |||
| 89c924d590 | |||
| e38ab40b22 | |||
| f2e8714723 | |||
| 8d7d268f61 | |||
| ca9e55c9b5 | |||
| b0fb2d75d3 | |||
| c9a0ff6208 | |||
| 296cd66b68 | |||
| 90c67342b6 | |||
| 956bb1274c | |||
| ae7225e576 | |||
| c838ec5a3b | |||
| 6df8f83339 | |||
| 76b7b95c9e | |||
| 058582b4b5 | |||
| 5c476bf970 | |||
| ef338d0c83 | |||
| 12b798a070 | |||
| 49b6c6af76 | |||
| de4966cb9b | |||
| 7f500d8988 | |||
| f34c1c99cd | |||
| 64447b5696 | |||
| 4466c8ca87 | |||
| 134d057955 | |||
| 827bf9ce2d | |||
| 3a6962171c | |||
| d4a895f856 | |||
| 75105fbdfb | |||
| d2f1a784c4 | |||
| 62825d3445 | |||
| a537431a13 | |||
| 35fc224370 | |||
| 2a75f21b6a | |||
| ac032efa3e | |||
| 08566de251 | |||
| f1dd3a3976 | |||
| 96a5df6235 | |||
| 65bebeac76 | |||
| 5cb94b289a | |||
| 98d88c8d47 | |||
| 0668b48c10 | |||
| 718ee2fff3 | |||
| 500fca270a | |||
| e1ba078bdc | |||
| 78ac829c63 | |||
| ceea93e3d8 | |||
| c907de064d | |||
| 30afb232cd | |||
| 0ebee56929 | |||
| 9a4e273486 | |||
| 163a773e5b | |||
| 7c4b136b4f | |||
| bb719eb39a | |||
| 53af7f2160 | |||
| f50db552c5 | |||
| 4cfbd5f897 | |||
| fe4e5d67c5 | |||
| 82c719981b | |||
| 4a36625117 | |||
| 9022d60bbd | |||
| f8d0ab6d14 | |||
| 4b17d76f2a | |||
| e1bb4a6e98 | |||
| 167e0655b7 | |||
| 42deee7eaf | |||
| b497414286 | |||
| 7536de1a4a | |||
| d2817c9f02 | |||
| 143286bced | |||
| 95633d6282 | |||
| 2a20b51245 | |||
| 0d7cb94a77 | |||
| 9c44e2cb72 | |||
| e1c797efc7 | |||
| 869c206051 | |||
| 798d6e2934 | |||
| ac3015ba1a | |||
| 105922ec6d | |||
| 442e03eff1 | |||
| efa72f6100 | |||
| 3fae3b337d | |||
| 657c5b5f91 | |||
| a2187a6342 | |||
| 57543d87b6 | |||
| abacc52be4 | |||
| 17acb46909 | |||
| cceb9291b0 | |||
| 1f3f503a2b | |||
| 875ef65a9e | |||
| 845913bd5d | |||
| 87f340512c | |||
| dc8364753b | |||
| 0b1399a2c1 | |||
| afd25c346a | |||
| 1636510491 | |||
| 5423798c61 | |||
| a740a8491b | |||
| 16b0b41131 | |||
| 4886d6747e | |||
| 42dc144c44 | |||
| a946858f0c | |||
| 3ae6282d0e | |||
| 3b6c3c8e9d | |||
| 40c808603a | |||
| 84e3828d7d | |||
| 30be6424f0 | |||
| 1fbd0cabfb | |||
| 9c0c89124b | |||
| 4888dff95c | |||
| b393bc25e2 | |||
| 45eb1e5efc | |||
| 8a984948f3 | |||
| 87e9bb5508 | |||
| 68d5f6b8a4 | |||
| 83bf1f7b59 | |||
| 887fbb5445 | |||
| c245abfeb8 | |||
| e8a1fa03d0 | |||
| 14fdcd7a14 | |||
| 454708a4b9 | |||
| 905010801a | |||
| fc1fb7e4eb | |||
| 2b7e87a33c | |||
| feb7c00ab5 | |||
| f02c7d66b6 | |||
| 37a8aac243 | |||
| 3f7aa00618 | |||
| f9b1f57c71 | |||
| 316c332fa0 | |||
| ed6f435e1c | |||
| 1cd31069e2 | |||
| a401c2733a | |||
| 2e69b2483e | |||
| bd5a2f28fc | |||
| 2fb75ad2a7 | |||
| 57b7b66b58 | |||
| da18a4b093 | |||
| de19d5ceeb | |||
| 3c39fd6db8 | |||
| a2f30a72f7 | |||
| 3942a9c815 | |||
| 884b7ed153 | |||
| 149eecf6ef | |||
| b9121a022d | |||
| 97374a7259 | |||
| 1999164de0 | |||
| afa80cb2b4 | |||
| 7852449fe2 | |||
| 3980a9c100 | |||
| 10887d272a | |||
| 07428f6a64 | |||
| 1add233756 | |||
| 7fad1ee92c | |||
| 073e58a9fb | |||
| 49c5929363 | |||
| 61b7ebde7c | |||
| 5dcbe84df8 | |||
| 27a5af3ec8 | |||
| 98f204f442 | |||
| 3be8e02692 | |||
| bd31658d04 | |||
| 5048d3ba8d | |||
| cd3a03682f | |||
| f5cffc18d1 | |||
| 0fa88e19c4 | |||
| d4259b45a4 | |||
| 22ae2896dd | |||
| a268a6c985 | |||
| fa857b2058 | |||
| 29500e14c7 | |||
| 47eb8d30ac | |||
| 23862bc625 | |||
| 670172eae1 | |||
| 64683d9769 | |||
| 05fa7028da | |||
| dffb0ea882 | |||
| 2a8afc201c | |||
| 437b31cabe | |||
| ba361bcd36 | |||
| 8b3724f85f | |||
| 26fc28a21a | |||
| c7505715ca | |||
| 3af27fc59e | |||
| 250bb8a9d6 | |||
| c6a9dc36b7 | |||
| b0a1368dc2 | |||
| ed7af823cb | |||
| 95e00ac365 | |||
| f261df73b5 | |||
| a7b8e4cab4 | |||
| a6580b70a3 | |||
| 9e754f4bad | |||
| a624133944 | |||
| 5babee86cb | |||
| 880facb6d7 | |||
| a3ed22ee48 | |||
| 7a1e526688 | |||
| 2c56466851 | |||
| cd3cce09ff | |||
| b7c2fb9237 | |||
| d5badecd7f | |||
| 83afb9612c | |||
| b2e0131860 | |||
| 08ddb22c64 | |||
| 29723fffa5 | |||
| adffc54541 | |||
| 79c4c4add6 | |||
| 21d8d62bdb | |||
| d9b21b6336 | |||
| 1515fed2bf | |||
| 012c38428b | |||
| fdc3c81a67 | |||
| f093225bc4 | |||
| 04964cdd4d | |||
| 7b98e44eef | |||
| 22867df4e7 | |||
| 0ca77b3e89 | |||
| 523f6bd9ad | |||
| 4454992303 | |||
| 7a455fccaa | |||
| 6ccb19f35d | |||
| bb6ea21b41 | |||
| 0ebe8e7c41 | |||
| efed05629f | |||
| a54ac5353d | |||
| 7de5b8df7c | |||
| e8916f41d8 | |||
| f8e196812c | |||
| 4daf7e97e6 | |||
| 59e9781df8 | |||
| fe33927d75 | |||
| 6720d4f40f | |||
| 4c3f8a9b89 | |||
| a34680b295 | |||
| 7aeb36153a | |||
| e5aa186c43 | |||
| c1bd5ac440 | |||
| e06e4eb5f3 | |||
| 3ebcafd1ec | |||
| 6e1bb6ef2e | |||
| 26598dbacc | |||
| aa747d186f | |||
| 21aa3f379f | |||
| 488449f04c | |||
| d84348da11 | |||
| 3db0754003 | |||
| 4a971b9142 | |||
| 5c7cfc77cd | |||
| 0de71d3615 | |||
| 5ff02b0da2 | |||
| 26b2bef2a8 | |||
| f0b589f768 | |||
| 837dc15e51 | |||
| bfbcda7ec1 | |||
| 5004c05666 | |||
| c3355394bf | |||
| 0cb0ff0535 | |||
| 9880f818cf | |||
| 0f2f21af96 | |||
| 45b043725a | |||
| 8e03cb2b01 | |||
| 08d027c3b6 | |||
| f689a8a955 | |||
| 34e36d9102 | |||
| 0b64fc4599 | |||
| 1166bf5866 | |||
| 6ee5217845 | |||
| d48749331d | |||
| b2e6c32580 | |||
| 8072030b3c | |||
| 9e5e2ceff5 | |||
| c4412c12a7 | |||
| 441de8b2e0 | |||
| 26c14fa6e1 | |||
| c187d9abe7 |
+8
-1
@@ -29,6 +29,7 @@ berkeley/lpc
|
||||
berkeley/lpq
|
||||
berkeley/lpr
|
||||
berkeley/lprm
|
||||
cgi-bin/makedocset
|
||||
cgi-bin/testcgi
|
||||
cgi-bin/testhi
|
||||
cgi-bin/testhi.index
|
||||
@@ -44,6 +45,7 @@ cups/testadmin
|
||||
cups/testarray
|
||||
cups/testcache
|
||||
cups/testconflicts
|
||||
cups/testcreds
|
||||
cups/testcups
|
||||
cups/testdest
|
||||
cups/testfile
|
||||
@@ -58,6 +60,7 @@ cups/testsnmp
|
||||
cups/tlscheck
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
doc/*/index.html
|
||||
filter/commandtops
|
||||
filter/gziptoany
|
||||
filter/pstops
|
||||
@@ -82,10 +85,12 @@ man/lpoptions.man
|
||||
man/mantohtml
|
||||
monitor/bcp
|
||||
monitor/tbcp
|
||||
notifier/dbus
|
||||
notifier/mailto
|
||||
notifier/rss
|
||||
notifier/testnotify
|
||||
packaging/cups.list
|
||||
org.cups.docset*
|
||||
patches
|
||||
ppdc/genstrings
|
||||
ppdc/ppd/
|
||||
@@ -137,11 +142,13 @@ systemv/lpoptions
|
||||
systemv/lpstat
|
||||
systemv/reject
|
||||
templates/header.tmpl
|
||||
templates/*/header.tmpl
|
||||
test/cups-str-*.html
|
||||
test/error_log-*
|
||||
test/*_log-*
|
||||
test/ippfind
|
||||
test/ippfind-static
|
||||
test/ippserver
|
||||
test/ippserver-shared
|
||||
test/ipptool
|
||||
test/ipptool-static
|
||||
xcode/CUPS.xcodeproj/project.xcworkspace/
|
||||
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
CHANGES - 2.2.4 - 2017-06-30
|
||||
============================
|
||||
|
||||
CHANGES IN CUPS V2.2.4
|
||||
----------------------
|
||||
|
||||
- The scheduler did not remove old job files (Issue #4987)
|
||||
- cupsEnumDests did not return early when all printers had been discovered
|
||||
(Issue #4989)
|
||||
- The CUPS build system now supports cross-compilation (Issue #4897)
|
||||
- Added a new CUPS Programming Manual to replace the aging API documentation.
|
||||
- Added the `cupsAddIntegerOption` and `cupsGetIntegerOption` functions
|
||||
(Issue #4992)
|
||||
- The `cupsGetDests` and `cupsCreateJob` functions now support Bonjour printers
|
||||
(Issue #4993)
|
||||
- Added a USB quirk rule for Lexmark E260dn printers (Issue #4994)
|
||||
- Fixed a potential buffer overflow in the `cupstestppd` utility (Issue #4996)
|
||||
- IPP Everywhere improvements (Issue #4998)
|
||||
- Fixed the "cancel all jobs" function in the web interface for several
|
||||
languages (Issue #4999)
|
||||
- Fixed issues with local queues (Issue #5003, Issue #5008, Issue #5009)
|
||||
- The `lpstat` command now supports a `-e` option to enumerate local printers
|
||||
(either previously added or on the network) that can be accessed
|
||||
(Issue #5005)
|
||||
- The `lp` and `lpr` commands now support printing to network printers that
|
||||
haven't yet been added (Issue #5006)
|
||||
- Fixed a typo in the mime.types file.
|
||||
- Fixed a bug in the Spanish web interface template (Issue #5016)
|
||||
- The `cupsEnumDests*` and `cupsGetDest*` functions now report the value of the
|
||||
"printer-is-temporary" Printer Status attribute (Issue #5028)
|
||||
- Added Chinese localization (Issue #5029)
|
||||
- The `cupsCheckDestSupported` function did not support `NULL` values
|
||||
(Issue #5031)
|
||||
- Fixed some issues in the RPM spec file (Issue #5032)
|
||||
- The `cupsConnectDest` function now supports the `CUPS_DEST_FLAGS_DEVICE` flag
|
||||
for explicitly connecting to the device (printer) associated with the
|
||||
destination.
|
||||
- The `SSLOptions` directive in "client.conf" and "cupsd.conf" now supports
|
||||
`DenyCBC` and `DenyTLS1.0` options (Issue #5037)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2.3
|
||||
----------------------
|
||||
|
||||
- The IPP backend could get into an infinite loop for certain errors, causing a
|
||||
hung queue (<rdar://problem/28008717>)
|
||||
- The scheduler could pause responding to client requests in order to save state
|
||||
changes to disk (<rdar://problem/28690656>)
|
||||
- Added support for PPD finishing keywords (Issue #4960, Issue #4961,
|
||||
Issue #4962)
|
||||
- The IPP backend did not send a media-col attribute for just the source or type
|
||||
(Issue #4963)
|
||||
- IPP Everywhere print queues did not always support all print qualities
|
||||
supported by the printer (Issue #4953)
|
||||
- IPP Everywhere print queues did not always support all media types supported
|
||||
by the printer (Issue #4953)
|
||||
- The IPP Everywhere PPD generator did not return useful error messages
|
||||
(Issue #4954)
|
||||
- The IPP Everywhere finishings support did not work correctly with common UI or
|
||||
command-line options (Issue #4976)
|
||||
- Fixed an error handling issue for the network backends (Issue #4979)
|
||||
- The default cupsd.conf file did not work on systems compiled without Kerberos
|
||||
support (Issue #4947)
|
||||
- The "reprint job" option was not available for some canceled jobs
|
||||
(Issue #4915)
|
||||
- Updated the job listing in the web interface (Issue #4978)
|
||||
- Fixed some localization issues on macOS (<rdar://problem/27245567>)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2.2
|
||||
----------------------
|
||||
|
||||
- Fixed some issues with the Zebra ZPL printer driver (Issue #4898)
|
||||
- Fixed some issues with IPP Everywhere printer support (Issue #4893,
|
||||
Issue #4909, Issue #4916, Issue #4921, Issue #4923, Issue #4932, Issue #4933,
|
||||
Issue #4938)
|
||||
- The rastertopwg filter could crash with certain input (Issue #4942)
|
||||
- Optimized connection usage in the IPP backend (<rdar://problem/29547323>)
|
||||
- The scheduler did not detect when an encrypted connection was closed by the
|
||||
client on Linux (Issue #4901)
|
||||
- The cups-lpd program did not catch all legacy usage of ISO-8859-1
|
||||
(Issue #4899)
|
||||
- Fixed builds on systems without a working poll() implementation (Issue #4905)
|
||||
- Added a USB quirk rule for the Kyocera Ecosys P6026cdn (Issue #4900)
|
||||
- The scheduler no longer creates log files on startup
|
||||
(<rdar://problem/28332470>)
|
||||
- The ippContainsString function now uses case-insensitive comparisons for
|
||||
mimeMediaType, name, and text values in conformance with RFC 2911.
|
||||
- The network backends now log the addresses that were found for a printer
|
||||
(<rdar://problem/29268474>)
|
||||
- Let's Encrypt certificates did not work when the hostname contained uppercase
|
||||
letters (Issue #4919)
|
||||
- Fixed reporting of printed pages in the web interface (Issue #4924)
|
||||
- Updated systemd config files (Issue #4935)
|
||||
- Updated documentation (PR #4896)
|
||||
- Updated localizations (PR #4894, PR #4895, PR #4904, PR #4908, Issue #4946)
|
||||
- Updated packaging files (Issue #4940)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2.1
|
||||
----------------------
|
||||
|
||||
- Added "CreateSelfSignedCerts" directive for cups-files.conf to control whether
|
||||
the scheduler automatically creates its own self-signed X.509 certificates for
|
||||
TLS connections (Issue #4876)
|
||||
- http*Connect did not handle partial failures (Issue #4870)
|
||||
- Addressed some build warnings on Linux (Issue #4881)
|
||||
- cupsHashData did not use the correct hashing algorithm
|
||||
(<rdar://problem/28209220>)
|
||||
- Updated man pages (PR #4885)
|
||||
- Updated localizations (PR #4877, PR #4886)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2.0
|
||||
----------------------
|
||||
|
||||
- Normalized the TLS certificate validation code and added additional error
|
||||
messages to aid troubleshooting.
|
||||
- The httpConnect functions did not work on Linux when cupsd was not running
|
||||
(Issue #4870)
|
||||
- The --no-remote-any option of cupsctl had no effect (Issue #4866)
|
||||
- http*Connect did not return early when all addresses failed (Issue #4870)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2rc1
|
||||
-----------------------
|
||||
|
||||
- Updated the list of supported IPP Everywhere media types.
|
||||
- The IPP backend did not validate TLS credentials properly.
|
||||
- The printer-state-message attribute was not cleared after a print job with no
|
||||
errors (Issue #4851)
|
||||
- The CUPS-Add-Modify-Class and CUPS-Add-Modify-Printer operations did not
|
||||
always return an error for failed adds (Issue #4854)
|
||||
- PPD files with names longer than 127 bytes did not work (Issue #4860)
|
||||
- Updated localizations (Issue #4846, PR #4858)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2b2
|
||||
----------------------
|
||||
|
||||
- Added Upstart support (PR #4825)
|
||||
- CUPS now supports Let's Encrypt certificates on Linux.
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2b1
|
||||
----------------------
|
||||
|
||||
- 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)
|
||||
@@ -1,45 +0,0 @@
|
||||
CHANGES.txt - 2.2b1 - 2016-06-02
|
||||
--------------------------------
|
||||
|
||||
CHANGES IN CUPS V2.2b1
|
||||
|
||||
- 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 OS X
|
||||
(<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)
|
||||
+3
-3
@@ -131,7 +131,7 @@ columns.
|
||||
> Note:
|
||||
>
|
||||
> The ".cxx" extension is used because it is the only common C++ extension
|
||||
> between Linux, OS X, UNIX, and Windows.
|
||||
> 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:
|
||||
@@ -613,8 +613,8 @@ 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 OS X system and express any
|
||||
non-OS X dependencies statically in the makefile.
|
||||
We regenerate the automatic dependencies on an macOS system and express any
|
||||
non-macOS dependencies statically in the makefile.
|
||||
|
||||
|
||||
### INSTALL/UNINSTALL SUPPORT
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
CREDITS.txt - 2013-07-23
|
||||
------------------------
|
||||
CREDITS - 2017-05-01
|
||||
====================
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
like to thank the following individuals for their contributions:
|
||||
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.
|
||||
@@ -17,20 +18,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.
|
||||
@@ -40,6 +41,7 @@ like to thank the following individuals for their contributions:
|
||||
Petter Reinholdtsen - HP-UX compiler stuff.
|
||||
Juan Pablo González Riopedre - Spanish localization.
|
||||
Giovanni Scafora - Italian localization.
|
||||
Joachim Schwender - German localization.
|
||||
Opher Shachar - Hebrew localization.
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
INSTALL - CUPS v2.2.4 - 2017-06-30
|
||||
==================================
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
information on CUPS see the file called "README.txt". A complete change log can
|
||||
be found in "CHANGES.txt".
|
||||
|
||||
> USING CUPS REQUIRES ADDITIONAL THIRD-PARTY SUPPORT SOFTWARE AND PRINTER
|
||||
> DRIVERS. THESE ARE TYPICALLY INCLUDED WITH YOUR OPERATING SYSTEM
|
||||
> DISTRIBUTION. APPLE DOES NOT ENDORSE OR SUPPORT THIRD-PARTY SUPPORT SOFTWARE
|
||||
> FOR CUPS.
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
----------------
|
||||
|
||||
You'll need ANSI-compliant C and C++ compilers, plus a make program and POSIX-
|
||||
compliant shell (/bin/sh). The GNU compiler tools and Bash work well and we
|
||||
have tested the current CUPS code against several versions of GCC with excellent
|
||||
results.
|
||||
|
||||
The makefiles used by the project should work with most versions of make. We've
|
||||
tested them with GNU make as well as the make programs shipped by Compaq, HP,
|
||||
SGI, and Sun. BSD users should use GNU make (gmake) since BSD make does not
|
||||
support "include".
|
||||
|
||||
Besides these tools you'll want ZLIB library for compression support, the GNU
|
||||
TLS library for encryption support on platforms other than iOS, macOS, or
|
||||
Windows, and either MIT (1.6.3 or higher) or Heimdal Kerberos for Kerberos
|
||||
support. CUPS will compile and run without these, however you'll miss out on
|
||||
many of the features provided by CUPS.
|
||||
|
||||
On a stock Ubuntu install, the following command will install the required
|
||||
prerequisites:
|
||||
|
||||
sudo apt-get install autoconf build-essential libavahi-client-dev \
|
||||
libgnutls28-dev libkrb5-dev libnss-mdns libpam-dev \
|
||||
libsystemd-dev libusb-1.0-0-dev zlib1g-dev
|
||||
|
||||
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.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
CUPS uses GNU autoconf, so you should find the usual "configure" script in the
|
||||
main CUPS source directory. To configure CUPS for your system, type:
|
||||
|
||||
./configure
|
||||
|
||||
The default installation will put the CUPS software in the "/etc", "/usr", and
|
||||
"/var" directories on your system, which will overwrite any existing printing
|
||||
commands on your system. Use the "--prefix" option to install the CUPS software
|
||||
in another location:
|
||||
|
||||
./configure --prefix=/some/directory
|
||||
|
||||
To see a complete list of configuration options, use the --help option:
|
||||
|
||||
./configure --help
|
||||
|
||||
If any of the dependent libraries are not installed in a system default location
|
||||
(typically "/usr/include" and "/usr/lib") you'll need to set the CFLAGS,
|
||||
CPPFLAGS, CXXFLAGS, DSOFLAGS, and LDFLAGS environment variables prior to running
|
||||
configure:
|
||||
|
||||
setenv CFLAGS "-I/some/directory"
|
||||
setenv CPPFLAGS "-I/some/directory"
|
||||
setenv CXXFLAGS "-I/some/directory"
|
||||
setenv DSOFLAGS "-L/some/directory"
|
||||
setenv LDFLAGS "-L/some/directory"
|
||||
./configure ...
|
||||
|
||||
or:
|
||||
|
||||
CFLAGS="-I/some/directory" \
|
||||
CPPFLAGS="-I/some/directory" \
|
||||
CXXFLAGS="-I/some/directory" \
|
||||
DSOFLAGS="-L/some/directory" \
|
||||
LDFLAGS="-L/some/directory" \
|
||||
./configure ...
|
||||
|
||||
The "--enable-debug" option compiles CUPS with debugging information enabled.
|
||||
Additional debug logging support can be enabled using the
|
||||
"--enable-debug-printfs" option - these debug messages are enabled using the
|
||||
CUPS_DEBUG_LOG environment variable at run-time.
|
||||
|
||||
CUPS also includes an extensive set of unit tests that can be used to find 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
|
||||
architectures:
|
||||
|
||||
./configure --with-archflags="-arch i386 -arch x86_64" ...
|
||||
|
||||
> Note: Current versions of macOS DO NOT allow installation to /usr with the
|
||||
> default system integrity settings. In addition, we do not recommend replacing
|
||||
> the CUPS supplied with macOS because not all versions of CUPS are compatible
|
||||
> with every macOS release, and because software updates will replace parts
|
||||
> of your local installation potentially rendering your system unusable.
|
||||
|
||||
Once you have configured things, just type:
|
||||
|
||||
make ENTER
|
||||
|
||||
or if you have FreeBSD, NetBSD, or OpenBSD type:
|
||||
|
||||
gmake ENTER
|
||||
|
||||
to build the software.
|
||||
|
||||
|
||||
TESTING THE SOFTWARE
|
||||
--------------------
|
||||
|
||||
Aside from the built-in unit tests, CUPS includes an automated test framework
|
||||
for testing the entire printing system. To run the tests, just type:
|
||||
|
||||
make check ENTER
|
||||
|
||||
or if you have FreeBSD, NetBSD, or OpenBSD type:
|
||||
|
||||
gmake check ENTER
|
||||
|
||||
The test framework runs a copy of the CUPS scheduler (cupsd) on port 8631 in
|
||||
/tmp/cups-$USER and produces a nice HTML report of the results.
|
||||
|
||||
|
||||
INSTALLING THE SOFTWARE
|
||||
-----------------------
|
||||
|
||||
Once you have built the software you need to install it. The "install" target
|
||||
provides a quick way to install the software on your local system:
|
||||
|
||||
make install ENTER
|
||||
|
||||
or for FreeBSD, NetBSD, or OpenBSD:
|
||||
|
||||
gmake install ENTER
|
||||
|
||||
Use the BUILDROOT variable to install to an alternate root directory:
|
||||
|
||||
make BUILDROOT=/some/other/root/directory install ENTER
|
||||
|
||||
You can also build binary packages that can be installed on other machines using
|
||||
the RPM spec file ("packaging/cups.spec") or EPM list file
|
||||
("packaging/cups.list"). The latter also supports building of binary RPMs, so
|
||||
it may be more convenient to use.
|
||||
|
||||
You can find the RPM software at:
|
||||
|
||||
http://www.rpm.org/
|
||||
|
||||
The EPM software is available at:
|
||||
|
||||
https://michaelrsweet.github.io/epm
|
||||
|
||||
|
||||
CREATING BINARY DISTRIBUTIONS WITH EPM
|
||||
--------------------------------------
|
||||
|
||||
The top level makefile supports generation of many types of binary distributions
|
||||
using EPM. To build a binary distribution type:
|
||||
|
||||
make <format> ENTER
|
||||
|
||||
or
|
||||
|
||||
gmake <format> ENTER
|
||||
|
||||
for FreeBSD, NetBSD, and OpenBSD. The <format> target is one of the following:
|
||||
|
||||
- "epm": Builds a script + tarfile package
|
||||
- "bsd": Builds a *BSD package
|
||||
- "deb": Builds a Debian package
|
||||
- "pkg": Builds a Solaris package
|
||||
- "rpm": Builds a RPM package
|
||||
- "slackware": Build a Slackware package
|
||||
|
||||
|
||||
GETTING DEBUG LOGGING FROM CUPS
|
||||
-------------------------------
|
||||
|
||||
When configured with the "--enable-debug-printfs" option, CUPS compiles in
|
||||
additional debug logging support in the scheduler, CUPS API, and CUPS Imaging
|
||||
API. The following environment variables are used to enable and control debug
|
||||
logging:
|
||||
|
||||
- `CUPS_DEBUG_FILTER`: Specifies a POSIX regular expression to control which
|
||||
messages are logged.
|
||||
- `CUPS_DEBUG_LEVEL`: Specifies a number from 0 to 9 to control the verbosity of
|
||||
the logging. The default level is 1.
|
||||
- `CUPS_DEBUG_LOG`: Specifies a log file to use. Specify the name "-" to send
|
||||
the messages to stderr. Prefix a filename with "+" to append to an existing
|
||||
file.
|
||||
|
||||
|
||||
REPORTING PROBLEMS
|
||||
------------------
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! If the documentation does
|
||||
not solve your problems, please post a message on the users forum at:
|
||||
|
||||
https://www.cups.org/
|
||||
|
||||
Include your operating system and version, compiler and version, and any errors
|
||||
or problems you've run into. The "config.log" file and the output from the
|
||||
configure script and make should also be sent, as it often helps to determine
|
||||
the cause of your problem.
|
||||
|
||||
If you are running a version of Linux, be sure to provide the Linux distribution
|
||||
you have, too.
|
||||
-213
@@ -1,213 +0,0 @@
|
||||
INSTALL - CUPS v2.2b1 - 2016-05-31
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
information on CUPS see the file called "README.txt". A complete change log can
|
||||
be found in "CHANGES.txt".
|
||||
|
||||
*******************************************************************************
|
||||
*******************************************************************************
|
||||
**** ****
|
||||
**** USING CUPS REQUIRES ADDITIONAL THIRD-PARTY SUPPORT SOFTWARE AND ****
|
||||
**** PRINTER DRIVERS. THESE ARE TYPICALLY INCLUDED WITH YOUR OPERATING ****
|
||||
**** SYSTEM DISTRIBUTION. APPLE DOES NOT ENDORSE OR SUPPORT THIRD-PARTY ****
|
||||
**** SUPPORT SOFTWARE FOR CUPS. ****
|
||||
**** ****
|
||||
*******************************************************************************
|
||||
*******************************************************************************
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
|
||||
You'll need ANSI-compliant C and C++ compilers, plus a make program and
|
||||
POSIX-compliant shell (/bin/sh). The GNU compiler tools and Bash work well
|
||||
and we have tested the current CUPS code against several versions of GCC
|
||||
with excellent results.
|
||||
|
||||
The makefiles used by the project should work with most versions of make.
|
||||
We've tested them with GNU make as well as the make programs shipped by
|
||||
Compaq, HP, SGI, and Sun. BSD users should use GNU make (gmake) since BSD
|
||||
make does not support "include".
|
||||
|
||||
Besides these tools you'll want ZLIB library for compression support, the
|
||||
CDSA, GNU TLS, or OpenSSL libraries for encryption support, and either MIT
|
||||
(1.6.3 or higher) or Heimdal Kerberos for Kerberos support. CUPS will
|
||||
compile and run without these, however you'll miss out on many of the
|
||||
features provided by CUPS.
|
||||
|
||||
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 OS X.
|
||||
|
||||
|
||||
COMPILING THE SUBVERSION REPOSITORY CODE
|
||||
|
||||
The CUPS Subversion repository doesn't hold a copy of the pre-built
|
||||
configure script. You'll need to run the GNU autoconf software (2.60 or
|
||||
higher) to create it:
|
||||
|
||||
autoconf
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
|
||||
CUPS uses GNU autoconf, so you should find the usual "configure" script in
|
||||
the main CUPS source directory. To configure CUPS for your system, type:
|
||||
|
||||
./configure
|
||||
|
||||
The default installation will put the CUPS software in the "/etc", "/usr",
|
||||
and "/var" directories on your system, which will overwrite any existing
|
||||
printing commands on your system. Use the "--prefix" option to install the
|
||||
CUPS software in another location:
|
||||
|
||||
./configure --prefix=/some/directory
|
||||
|
||||
To see a complete list of configuration options, use the --help option:
|
||||
|
||||
./configure --help
|
||||
|
||||
If any of the dependent libraries are not installed in a system default
|
||||
location (typically "/usr/include" and "/usr/lib") you'll need to set the
|
||||
CFLAGS, CPPFLAGS, CXXFLAGS, DSOFLAGS, and LDFLAGS environment variables
|
||||
prior to running configure:
|
||||
|
||||
setenv CFLAGS "-I/some/directory"
|
||||
setenv CPPFLAGS "-I/some/directory"
|
||||
setenv CXXFLAGS "-I/some/directory"
|
||||
setenv DSOFLAGS "-L/some/directory"
|
||||
setenv LDFLAGS "-L/some/directory"
|
||||
./configure ...
|
||||
|
||||
or:
|
||||
|
||||
CFLAGS="-I/some/directory" \
|
||||
CPPFLAGS="-I/some/directory" \
|
||||
CXXFLAGS="-I/some/directory" \
|
||||
DSOFLAGS="-L/some/directory" \
|
||||
LDFLAGS="-L/some/directory" \
|
||||
./configure ...
|
||||
|
||||
The "--enable-debug" option compiles CUPS with debugging information
|
||||
enabled. Additional debug logging support can be enabled using the
|
||||
"--enable-debug-printfs" option - these debug messages are enabled using the
|
||||
CUPS_DEBUG_LOG environment variable at run-time.
|
||||
|
||||
CUPS also includes an extensive set of unit tests that can be used to find
|
||||
and diagnose a variety of common problems - use the "--enable-unit-tests"
|
||||
configure option to run them at build time.
|
||||
|
||||
On OS X, use the "--with-archflags" option to build with the correct set of
|
||||
architectures:
|
||||
|
||||
./configure --with-archflags="-arch i386 -arch x86_64" ...
|
||||
|
||||
Once you have configured things, just type:
|
||||
|
||||
make ENTER
|
||||
|
||||
or if you have FreeBSD, NetBSD, or OpenBSD type:
|
||||
|
||||
gmake ENTER
|
||||
|
||||
to build the software.
|
||||
|
||||
|
||||
TESTING THE SOFTWARE
|
||||
|
||||
Aside from the built-in unit tests, CUPS includes an automated test
|
||||
framework for testing the entire printing system. To run the tests, just
|
||||
type:
|
||||
|
||||
make check ENTER
|
||||
|
||||
or if you have FreeBSD, NetBSD, or OpenBSD type:
|
||||
|
||||
gmake check ENTER
|
||||
|
||||
The test framework runs a copy of the CUPS scheduler (cupsd) on port 8631
|
||||
in /tmp/cups-$USER and produces a nice HTML report of the results.
|
||||
|
||||
|
||||
INSTALLING THE SOFTWARE
|
||||
|
||||
Once you have built the software you need to install it. The "install"
|
||||
target provides a quick way to install the software on your local system:
|
||||
|
||||
make install ENTER
|
||||
|
||||
or for FreeBSD, NetBSD, or OpenBSD:
|
||||
|
||||
gmake install ENTER
|
||||
|
||||
Use the BUILDROOT variable to install to an alternate root directory:
|
||||
|
||||
make BUILDROOT=/some/other/root/directory install ENTER
|
||||
|
||||
You can also build binary packages that can be installed on other machines
|
||||
using the RPM spec file ("packaging/cups.spec") or EPM list file
|
||||
("packaging/cups.list"). The latter also supports building of binary RPMs,
|
||||
so it may be more convenient to use.
|
||||
|
||||
You can find the RPM software at:
|
||||
|
||||
http://www.rpm.org/
|
||||
|
||||
The EPM software is available at:
|
||||
|
||||
http://www.msweet.org/
|
||||
|
||||
|
||||
CREATING BINARY DISTRIBUTIONS WITH EPM
|
||||
|
||||
The top level makefile supports generation of many types of binary
|
||||
distributions using EPM. To build a binary distribution type:
|
||||
|
||||
make <format> ENTER
|
||||
|
||||
or
|
||||
|
||||
gmake <format> ENTER
|
||||
|
||||
for FreeBSD, NetBSD, and OpenBSD. The <format> target is one of the
|
||||
following:
|
||||
|
||||
epm - Builds a script + tarfile package
|
||||
bsd - Builds a *BSD package
|
||||
deb - Builds a Debian package
|
||||
pkg - Builds a Solaris package
|
||||
rpm - Builds a RPM package
|
||||
slackware - Build a Slackware package
|
||||
|
||||
|
||||
GETTING DEBUG LOGGING FROM CUPS
|
||||
|
||||
When configured with the "--enable-debug-printfs" option, CUPS compiles in
|
||||
additional debug logging support in the scheduler, CUPS API, and CUPS
|
||||
Imaging API. The following environment variables are used to enable and
|
||||
control debug logging:
|
||||
|
||||
CUPS_DEBUG_FILTER Specifies a POSIX regular expression to control
|
||||
which messages are logged.
|
||||
CUPS_DEBUG_LEVEL Specifies a number from 0 to 9 to control the
|
||||
verbosity of the logging. The default level is 1.
|
||||
CUPS_DEBUG_LOG Specifies a log file to use. Specify the name "-"
|
||||
to send the messages to stderr. Prefix a filename
|
||||
with "+" to append to an existing file.
|
||||
|
||||
|
||||
REPORTING PROBLEMS
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! If the documentation
|
||||
does not solve your problems, please post a message on the users forum at:
|
||||
|
||||
http://www.cups.org/
|
||||
|
||||
Include your operating system and version, compiler and version, and any
|
||||
errors or problems you've run into. The "config.log" file and the output
|
||||
from the configure script and make should also be sent, as it often helps to
|
||||
determine the cause of your problem.
|
||||
|
||||
If you are running a version of Linux, be sure to provide the Linux
|
||||
distribution you have, too.
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
CUPS License Agreement
|
||||
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
Copyright 2007-2016 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, OS X, and OS X Server
|
||||
products and all follow-on releases and future
|
||||
versions of Apple's Darwin, iOS, macOS, macOS Server, and
|
||||
tvOS products and all follow-on releases and future
|
||||
versions thereof.
|
||||
|
||||
c. This exception is only available for Apple
|
||||
|
||||
+14
-6
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
#
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
#
|
||||
@@ -38,14 +38,14 @@ SHELL = /bin/sh
|
||||
# Installation programs...
|
||||
#
|
||||
|
||||
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
|
||||
INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
|
||||
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
|
||||
INSTALL_DATA = $(INSTALL) -c -m 444
|
||||
INSTALL_DIR = $(INSTALL) -d
|
||||
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
|
||||
INSTALL_MAN = $(INSTALL) -c -m 444
|
||||
INSTALL_SCRIPT = $(INSTALL) -c -m 555
|
||||
INSTALL_SCRIPT = $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@
|
||||
|
||||
#
|
||||
# Default user, group, and system groups for the scheduler...
|
||||
@@ -72,6 +72,14 @@ LANGUAGES = @LANGUAGES@
|
||||
INSTALL_LANGUAGES = @INSTALL_LANGUAGES@
|
||||
UNINSTALL_LANGUAGES = @UNINSTALL_LANGUAGES@
|
||||
|
||||
#
|
||||
# Cross-compilation support: "local" target is used for any tools that are
|
||||
# built and run locally.
|
||||
#
|
||||
|
||||
LOCALTARGET = @LOCALTARGET@
|
||||
|
||||
|
||||
#
|
||||
# Libraries...
|
||||
#
|
||||
@@ -141,7 +149,7 @@ IPPFIND_MAN = @IPPFIND_MAN@
|
||||
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(LIBZ)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ)
|
||||
LINKCUPSIMAGE = @LINKCUPSIMAGE@
|
||||
LIBS = $(LINKCUPS) $(COMMONLIBS)
|
||||
ONDEMANDFLAGS = @ONDEMANDFLAGS@
|
||||
|
||||
+3
-10
@@ -8,7 +8,7 @@
|
||||
# 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/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include Makedefs
|
||||
@@ -314,22 +314,15 @@ sloc:
|
||||
|
||||
EPMFLAGS = -v --output-dir dist $(EPMARCH)
|
||||
|
||||
bsd deb pkg slackware:
|
||||
bsd deb epm pkg rpm 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
|
||||
.PHONY: 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
|
||||
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
README - CUPS v2.2.4 - 2017-06-30
|
||||
=================================
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.md" 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 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 networked printers,
|
||||
and printers can be shared from one computer to another, even over the Internet!
|
||||
|
||||
Internally, CUPS uses PostScript Printer Description ("PPD") files to describe
|
||||
printer capabilities and features and a wide variety of generic and device-
|
||||
specific programs to convert and print many types of files. Sample drivers are
|
||||
included with CUPS to support many Dymo, EPSON, HP, Intellitech, OKIDATA, and
|
||||
Zebra printers. Many more drivers are available online and (in some cases) on
|
||||
the driver CD-ROM that came with your printer.
|
||||
|
||||
CUPS is licensed under the GNU General Public License and GNU Library General
|
||||
Public License versions 2. See the file "LICENSE.txt" for more information.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
-------------------------
|
||||
|
||||
Once you have installed the software you can access the documentation (and a
|
||||
bunch of other stuff) online at:
|
||||
|
||||
http://localhost:631/
|
||||
|
||||
If you're having trouble getting that far, the documentation is located under
|
||||
the "doc/help" directory.
|
||||
|
||||
Please read the documentation before asking questions.
|
||||
|
||||
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
-----------------------------------
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide two mailing
|
||||
lists which are available at:
|
||||
|
||||
https://lists.cups.org/mailman/listinfo
|
||||
|
||||
See the CUPS web site at <https://www.cups.org/> for other resources.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES USING YOUR WEB BROWSER
|
||||
------------------------------------------------
|
||||
|
||||
CUPS includes a web-based administration tool that allows you to manage
|
||||
printers, classes, and jobs on your server. Open the following URL in your
|
||||
browser to access the printer administration tools:
|
||||
|
||||
http://localhost:631/admin/
|
||||
|
||||
*Do not* use the hostname for your machine - it will not work with the default
|
||||
CUPS configuration. To enable administration access on other addresses, check
|
||||
the "Allow Remote Administration" box and click on the "Change Settings" button.
|
||||
|
||||
You will be asked for the administration password (root or any other user in the
|
||||
sys/system/root/admin/lpadmin group on your system) when performing any
|
||||
administrative function.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
-----------------------------------------------
|
||||
|
||||
CUPS works best with PPD (PostScript Printer Description) files. In a pinch you
|
||||
can also use System V style printer interface scripts.
|
||||
|
||||
CUPS includes several sample PPD files you can use:
|
||||
|
||||
Driver PPD Name
|
||||
----------------------------- ------------------------------
|
||||
Dymo Label Printers drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
|
||||
EPSON 9-pin Series drv:///sample.drv/epson9.ppd
|
||||
EPSON 24-pin Series drv:///sample.drv/epson24.ppd
|
||||
Generic PCL Laser Printer drv:///sample.drv/generpcl.ppd
|
||||
Generic PostScript Printer drv:///sample.drv/generic.ppd
|
||||
HP DeskJet Series drv:///sample.drv/deskjet.ppd
|
||||
HP LaserJet Series drv:///sample.drv/laserjet.ppd
|
||||
OKIDATA 9-Pin Series drv:///sample.drv/okidata9.ppd
|
||||
OKIDATA 24-Pin Series drv:///sample.drv/okidat24.ppd
|
||||
Zebra CPCL Label Printer drv:///sample.drv/zebracpl.ppd
|
||||
Zebra EPL1 Label Printer drv:///sample.drv/zebraep1.ppd
|
||||
Zebra EPL2 Label Printer drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer drv:///sample.drv/zebra.ppd
|
||||
|
||||
Run the "lpinfo -m" command to list the available drivers:
|
||||
|
||||
lpinfo -m
|
||||
|
||||
Run the "lpinfo -v" command to list the available printers:
|
||||
|
||||
lpinfo -v
|
||||
|
||||
Then use the correct URI to add the printer using the "lpadmin" command:
|
||||
|
||||
lpadmin -p printername -E -v device-uri -m ppd-name
|
||||
|
||||
Network printers typically use "socket" or "lpd" URIs:
|
||||
|
||||
lpadmin -p printername -E -v socket://11.22.33.44 -m ppd-name
|
||||
lpadmin -p printername -E -v lpd://11.22.33.44/ -m ppd-name
|
||||
|
||||
The sample drivers provide basic printing capabilities, but generally do not
|
||||
exercise the full potential of the printers or CUPS.
|
||||
|
||||
CUPS also supports IPP Everywhere printers using the "everywhere" model, for
|
||||
example:
|
||||
|
||||
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
|
||||
|
||||
|
||||
PRINTING FILES
|
||||
--------------
|
||||
|
||||
CUPS provides both the System V "lp" and Berkeley "lpr" commands for printing:
|
||||
|
||||
lp filename
|
||||
lpr filename
|
||||
|
||||
Both the "lp" and "lpr" commands support printing options for the driver:
|
||||
|
||||
lp -o media=A4 -o resolution=600dpi filename
|
||||
lpr -o media=A4 -o resolution=600dpi filename
|
||||
|
||||
CUPS recognizes many types of images files as well as PDF, PostScript, and text
|
||||
files, so you can print those files directly rather than through an application.
|
||||
|
||||
If you have an application that generates output specifically for your printer
|
||||
then you need to use the "-oraw" or "-l" options:
|
||||
|
||||
lp -o raw filename
|
||||
lpr -l filename
|
||||
|
||||
This will prevent the filters from misinterpreting your print file.
|
||||
|
||||
|
||||
LEGAL STUFF
|
||||
-----------
|
||||
|
||||
CUPS is copyright © 2007-2017 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.
|
||||
-152
@@ -1,152 +0,0 @@
|
||||
README - CUPS v2.2b1 - 2016-05-31
|
||||
---------------------------------
|
||||
|
||||
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 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
|
||||
networked printers, and printers can be shared from one computer to another,
|
||||
even over the Internet!
|
||||
|
||||
Internally, CUPS uses PostScript Printer Description ("PPD") files to
|
||||
describe printer capabilities and features and a wide variety of generic
|
||||
and device-specific programs to convert and print many types of files.
|
||||
Sample drivers are included with CUPS to support many Dymo, EPSON, HP,
|
||||
Intellitech, OKIDATA, and Zebra printers. Many more drivers are available
|
||||
online and (in some cases) on the driver CD-ROM that came with your printer.
|
||||
|
||||
CUPS is licensed under the GNU General Public License and GNU Library
|
||||
General Public License versions 2. See the file "LICENSE.txt" for more
|
||||
information.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
|
||||
Once you have installed the software you can access the documentation (and
|
||||
a bunch of other stuff) online at:
|
||||
|
||||
http://localhost:631/
|
||||
|
||||
If you're having trouble getting that far, the documentation is located
|
||||
under the "doc/help" directory.
|
||||
|
||||
Please read the documentation before asking questions.
|
||||
|
||||
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide two
|
||||
mailing lists which are available at:
|
||||
|
||||
http://www.cups.org/lists.php
|
||||
|
||||
See the CUPS web site at "http://www.cups.org/" for other resources.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES USING YOUR WEB BROWSER
|
||||
|
||||
CUPS includes a web-based administration tool that allows you to manage
|
||||
printers, classes, and jobs on your server. Open the following URL in your
|
||||
browser to access the printer administration tools:
|
||||
|
||||
http://localhost:631/admin/
|
||||
|
||||
DO NOT use the hostname for your machine - it will not work with the default
|
||||
CUPS configuration. To enable administration access on other addresses,
|
||||
check the "Allow Remote Administration" box and click on the "Change
|
||||
Settings" button.
|
||||
|
||||
You will be asked for the administration password (root or any other user in
|
||||
the sys/system/root/admin/lpadmin group on your system) when performing any
|
||||
administrative function.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
|
||||
CUPS works best with PPD (PostScript Printer Description) files. In a pinch
|
||||
you can also use System V style printer interface scripts.
|
||||
|
||||
CUPS includes several sample PPD files you can use:
|
||||
|
||||
Driver PPD Name
|
||||
----------------------------- ------------------------------
|
||||
Dymo Label Printers drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
|
||||
EPSON 9-pin Series drv:///sample.drv/epson9.ppd
|
||||
EPSON 24-pin Series drv:///sample.drv/epson24.ppd
|
||||
Generic PCL Laser Printer drv:///sample.drv/generpcl.ppd
|
||||
Generic PostScript Printer drv:///sample.drv/generic.ppd
|
||||
HP DeskJet Series drv:///sample.drv/deskjet.ppd
|
||||
HP LaserJet Series drv:///sample.drv/laserjet.ppd
|
||||
OKIDATA 9-Pin Series drv:///sample.drv/okidata9.ppd
|
||||
OKIDATA 24-Pin Series drv:///sample.drv/okidat24.ppd
|
||||
Zebra CPCL Label Printer drv:///sample.drv/zebracpl.ppd
|
||||
Zebra EPL1 Label Printer drv:///sample.drv/zebraep1.ppd
|
||||
Zebra EPL2 Label Printer drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer drv:///sample.drv/zebra.ppd
|
||||
|
||||
Run the "lpinfo -m" command to list the available drivers:
|
||||
|
||||
lpinfo -m
|
||||
|
||||
Run the "lpinfo -v" command to list the available printers:
|
||||
|
||||
lpinfo -v
|
||||
|
||||
Then use the correct URI to add the printer using the "lpadmin" command:
|
||||
|
||||
lpadmin -p printername -E -v device-uri -m ppd-name
|
||||
|
||||
Network printers typically use "socket" or "lpd" URIs:
|
||||
|
||||
lpadmin -p printername -E -v socket://11.22.33.44 -m ppd-name
|
||||
lpadmin -p printername -E -v lpd://11.22.33.44/ -m ppd-name
|
||||
|
||||
The sample drivers provide basic printing capabilities, but generally do not
|
||||
exercise the full potential of the printers or CUPS.
|
||||
|
||||
|
||||
PRINTING FILES
|
||||
|
||||
CUPS provides both the System V "lp" and Berkeley "lpr" commands for
|
||||
printing:
|
||||
|
||||
lp filename
|
||||
lpr filename
|
||||
|
||||
Both the "lp" and "lpr" commands support printing options for the driver:
|
||||
|
||||
lp -o media=A4 -o resolution=600dpi filename
|
||||
lpr -o media=A4 -o resolution=600dpi filename
|
||||
|
||||
CUPS recognizes many types of images files as well as PDF, PostScript,
|
||||
and text files, so you can print those files directly rather than through
|
||||
an application.
|
||||
|
||||
If you have an application that generates output specifically for your
|
||||
printer then you need to use the "-oraw" or "-l" options:
|
||||
|
||||
lp -o raw filename
|
||||
lpr -l filename
|
||||
|
||||
This will prevent the filters from misinterpreting your print file.
|
||||
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2016 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.
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
# 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/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
|
||||
@@ -312,6 +312,7 @@ extern int backendGetDeviceID(int fd, char *device_id,
|
||||
extern int backendGetMakeModel(const char *device_id,
|
||||
char *make_model,
|
||||
size_t make_model_size);
|
||||
extern http_addrlist_t *backendLookup(const char *hostname, int port, int *cancel);
|
||||
extern int backendNetworkSideCB(int print_fd, int device_fd,
|
||||
int snmp_fd, http_addr_t *addr,
|
||||
int use_bc);
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2015 by Apple Inc.
|
||||
* Copyright 2008-2017 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -949,7 +949,7 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
*
|
||||
* Note: This function is needed because avahi_simple_poll_iterate is broken
|
||||
* and always uses a timeout of 0 (!) milliseconds.
|
||||
* (Avahi Ticket #364)
|
||||
* (https://github.com/lathiat/avahi/issues/127)
|
||||
*/
|
||||
|
||||
static int /* O - Number of file descriptors matching */
|
||||
|
||||
@@ -88,7 +88,7 @@ backendGetDeviceID(
|
||||
*device_id = '\0';
|
||||
|
||||
# ifdef __linux
|
||||
if (ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
|
||||
if (ioctl(fd, LPIOC_GET_DEVICE_ID((unsigned)device_id_size), device_id))
|
||||
{
|
||||
/*
|
||||
* Linux has to implement things differently for every device it seems.
|
||||
|
||||
+154
-108
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* IPP backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -160,6 +160,7 @@ static void cancel_job(http_t *http, const char *uri, int id,
|
||||
static ipp_pstate_t check_printer_state(http_t *http, const char *uri,
|
||||
const char *resource,
|
||||
const char *user, int version);
|
||||
static void debug_attributes(ipp_t *ipp);
|
||||
static void *monitor_printer(_cups_monitor_t *monitor);
|
||||
static ipp_t *new_request(ipp_op_t op, int version, const char *uri,
|
||||
const char *user, const char *title,
|
||||
@@ -222,7 +223,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
*compatfile = NULL; /* Compatibility filename */
|
||||
off_t compatsize = 0; /* Size of compatibility file */
|
||||
int port; /* Port number (not used) */
|
||||
char portname[255]; /* Port name */
|
||||
char uri[HTTP_MAX_URI]; /* Updated URI without user/pass */
|
||||
char print_job_name[1024]; /* Update job-name for Print-Job */
|
||||
http_status_t http_status; /* Status of HTTP request */
|
||||
@@ -663,69 +663,12 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
start_time = time(NULL);
|
||||
|
||||
sprintf(portname, "%d", port);
|
||||
|
||||
update_reasons(NULL, "+connecting-to-device");
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
update_reasons(NULL, "-connecting-to-device");
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
if (job_canceled)
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
addrlist = backendLookup(hostname, port, &job_canceled);
|
||||
|
||||
http = httpConnect2(hostname, port, addrlist, AF_UNSPEC, cupsEncryption(), 1,
|
||||
0, NULL);
|
||||
httpSetTimeout(http, 30.0, timeout_cb, NULL);
|
||||
|
||||
if (httpIsEncrypted(http))
|
||||
{
|
||||
/*
|
||||
* Validate TLS credentials...
|
||||
*/
|
||||
|
||||
cups_array_t *creds; /* TLS credentials */
|
||||
cups_array_t *lcreds = NULL; /* Loaded credentials */
|
||||
http_trust_t trust; /* Trust level */
|
||||
static const char *trusts[] = { NULL, "+cups-pki-invalid", "+cups-pki-changed", "+cups-pki-expired", NULL, "+cups-pki-unknown" };
|
||||
/* Trust keywords */
|
||||
|
||||
if (!httpCopyCredentials(http, &creds))
|
||||
{
|
||||
trust = httpCredentialsGetTrust(creds, hostname);
|
||||
|
||||
update_reasons(NULL, "-cups-pki-invalid,cups-pki-changed,cups-pki-expired,cups-pki-unknown");
|
||||
if (trusts[trust])
|
||||
{
|
||||
update_reasons(NULL, trusts[trust]);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
if (httpLoadCredentials(NULL, &lcreds, hostname))
|
||||
{
|
||||
/*
|
||||
* Could not load the credentials, let's save the ones we have so we
|
||||
* can detect changes...
|
||||
*/
|
||||
|
||||
httpSaveCredentials(NULL, creds, hostname);
|
||||
}
|
||||
|
||||
httpFreeCredentials(lcreds);
|
||||
httpFreeCredentials(creds);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
*/
|
||||
@@ -856,6 +799,76 @@ main(int argc, /* I - Number of command-line args */
|
||||
else if (!http)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
|
||||
if (httpIsEncrypted(http))
|
||||
{
|
||||
/*
|
||||
* Validate TLS credentials...
|
||||
*/
|
||||
|
||||
cups_array_t *creds; /* TLS credentials */
|
||||
cups_array_t *lcreds = NULL; /* Loaded credentials */
|
||||
http_trust_t trust; /* Trust level */
|
||||
char credinfo[1024], /* Information on credentials */
|
||||
lcredinfo[1024];/* Information on saved credentials */
|
||||
static const char * const trusts[] = { NULL, "+cups-pki-invalid", "+cups-pki-changed", "+cups-pki-expired", NULL, "+cups-pki-unknown" };
|
||||
/* Trust keywords */
|
||||
static const char * const trust_msgs[] =
|
||||
{
|
||||
"Credentials are OK/trusted",
|
||||
"Credentials are invalid",
|
||||
"Credentials have changed",
|
||||
"Credentials are expired",
|
||||
"Credentials have been renewed",
|
||||
"Credentials are unknown/new"
|
||||
};
|
||||
|
||||
fputs("DEBUG: Connection is encrypted.\n", stderr);
|
||||
|
||||
if (!httpCopyCredentials(http, &creds))
|
||||
{
|
||||
trust = httpCredentialsGetTrust(creds, hostname);
|
||||
httpCredentialsString(creds, credinfo, sizeof(credinfo));
|
||||
|
||||
fprintf(stderr, "DEBUG: %s (%s)\n", trust_msgs[trust], cupsLastErrorString());
|
||||
fprintf(stderr, "DEBUG: Printer credentials: %s\n", credinfo);
|
||||
|
||||
if (!httpLoadCredentials(NULL, &lcreds, hostname))
|
||||
{
|
||||
httpCredentialsString(lcreds, lcredinfo, sizeof(lcredinfo));
|
||||
fprintf(stderr, "DEBUG: Stored credentials: %s\n", lcredinfo);
|
||||
}
|
||||
else
|
||||
fputs("DEBUG: No stored credentials.\n", stderr);
|
||||
|
||||
update_reasons(NULL, "-cups-pki-invalid,cups-pki-changed,cups-pki-expired,cups-pki-unknown");
|
||||
if (trusts[trust])
|
||||
{
|
||||
update_reasons(NULL, trusts[trust]);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
if (!lcreds)
|
||||
{
|
||||
/*
|
||||
* Could not load the credentials, let's save the ones we have so we
|
||||
* can detect changes...
|
||||
*/
|
||||
|
||||
httpSaveCredentials(NULL, creds, hostname);
|
||||
}
|
||||
|
||||
httpFreeCredentials(lcreds);
|
||||
httpFreeCredentials(creds);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs("DEBUG: No printer credentials.\n", stderr);
|
||||
|
||||
update_reasons(NULL, "cups-pki-unknown");
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
|
||||
update_reasons(NULL, "-connecting-to-device");
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Connected to printer."));
|
||||
|
||||
@@ -1456,7 +1469,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
while (!job_canceled && validate_job)
|
||||
{
|
||||
request = new_request(IPP_VALIDATE_JOB, version, uri, argv[2],
|
||||
request = new_request(IPP_OP_VALIDATE_JOB, version, uri, argv[2],
|
||||
monitor.job_name, num_options, options, compression,
|
||||
copies_sup ? copies : 1, document_format, pc, ppd,
|
||||
media_col_sup, doc_handling_sup, print_color_mode_sup);
|
||||
@@ -1467,6 +1480,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
fprintf(stderr, "DEBUG: Validate-Job: %s (%s)\n",
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
|
||||
if ((job_auth = ippFindAttribute(response, "job-authorization-uri",
|
||||
IPP_TAG_URI)) != NULL)
|
||||
@@ -1519,6 +1533,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
else if (ipp_status < IPP_REDIRECTION_OTHER_SITE ||
|
||||
ipp_status == IPP_BAD_REQUEST)
|
||||
break;
|
||||
else if (job_auth == NULL && ipp_status > IPP_BAD_REQUEST)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1637,6 +1653,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: %s: %s (%s)\n",
|
||||
(num_files > 1 || create_job) ? "Create-Job" : "Print-Job",
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
|
||||
if (ipp_status > IPP_OK_CONFLICT)
|
||||
{
|
||||
@@ -1771,6 +1788,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
"compression", NULL, compression);
|
||||
|
||||
fprintf(stderr, "DEBUG: Sending file %d using chunking...\n", i + 1);
|
||||
fprintf(stderr, "DEBUG: IPP/%d.%d %s #%d\n", version / 10, version % 10, ippOpString(ippGetOperation(request)), ippGetRequestId(request));
|
||||
debug_attributes(request);
|
||||
|
||||
http_status = cupsSendRequest(http, request, resource, 0);
|
||||
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
|
||||
{
|
||||
@@ -1820,11 +1840,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: Error writing document data for "
|
||||
"Send-Document: %s\n", strerror(httpError(http)));
|
||||
|
||||
ippDelete(cupsGetResponse(http, resource));
|
||||
response = cupsGetResponse(http, resource);
|
||||
ippDelete(request);
|
||||
|
||||
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n",
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
ippDelete(response);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled)
|
||||
{
|
||||
@@ -1991,6 +2013,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
"requested-attributes", sizeof(jattrs) / sizeof(jattrs[0]),
|
||||
NULL, jattrs);
|
||||
|
||||
fprintf(stderr, "DEBUG: IPP/%d.%d %s #%d\n", version / 10, version % 10, ippOpString(ippGetOperation(request)), ippGetRequestId(request));
|
||||
debug_attributes(request);
|
||||
|
||||
/*
|
||||
* Do the request...
|
||||
*/
|
||||
@@ -2015,6 +2040,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
fprintf(stderr, "DEBUG: Get-Job-Attributes: %s (%s)\n",
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
|
||||
if (ipp_status <= IPP_OK_CONFLICT)
|
||||
password_tries = 0;
|
||||
@@ -2192,7 +2218,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
return (CUPS_BACKEND_HOLD);
|
||||
else if (ipp_status == IPP_INTERNAL_ERROR)
|
||||
return (CUPS_BACKEND_STOP);
|
||||
else if (ipp_status == IPP_CONFLICT)
|
||||
else if (ipp_status == IPP_CONFLICT || ipp_status == IPP_STATUS_ERROR_REQUEST_ENTITY || ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
else if (ipp_status == IPP_REQUEST_VALUE ||
|
||||
ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||
|
||||
@@ -2291,6 +2317,9 @@ check_printer_state(
|
||||
"requested-attributes",
|
||||
(int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
|
||||
|
||||
fprintf(stderr, "DEBUG: IPP/%d.%d %s #%d\n", version / 10, version % 10, ippOpString(ippGetOperation(request)), ippGetRequestId(request));
|
||||
debug_attributes(request);
|
||||
|
||||
if ((response = cupsDoRequest(http, request, resource)) != NULL)
|
||||
{
|
||||
report_printer_state(response);
|
||||
@@ -2298,12 +2327,12 @@ check_printer_state(
|
||||
if ((attr = ippFindAttribute(response, "printer-state",
|
||||
IPP_TAG_ENUM)) != NULL)
|
||||
printer_state = (ipp_pstate_t)attr->values[0].integer;
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Get-Printer-Attributes: %s (%s)\n",
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
ippDelete(response);
|
||||
|
||||
/*
|
||||
* Return the printer-state value...
|
||||
@@ -2313,6 +2342,51 @@ check_printer_state(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'debug_attributes()' - Print out the request or response attributes as DEBUG
|
||||
* messages...
|
||||
*/
|
||||
|
||||
static void
|
||||
debug_attributes(ipp_t *ipp) /* I - Request or response message */
|
||||
{
|
||||
ipp_tag_t group; /* Current group */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
char buffer[1024]; /* Value buffer */
|
||||
|
||||
|
||||
for (group = IPP_TAG_ZERO, attr = ippFirstAttribute(ipp);
|
||||
attr;
|
||||
attr = ippNextAttribute(ipp))
|
||||
{
|
||||
const char *name = ippGetName(attr);
|
||||
|
||||
if (!name)
|
||||
{
|
||||
group = IPP_TAG_ZERO;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (group != ippGetGroupTag(attr))
|
||||
{
|
||||
group = ippGetGroupTag(attr);
|
||||
fprintf(stderr, "DEBUG: ---- %s ----\n", ippTagString(group));
|
||||
}
|
||||
|
||||
if (!strcmp(name, "job-password"))
|
||||
strlcpy(buffer, "---", sizeof(buffer));
|
||||
else
|
||||
ippAttributeString(attr, buffer, sizeof(buffer));
|
||||
|
||||
fprintf(stderr, "DEBUG: %s %s%s %s\n", name,
|
||||
ippGetCount(attr) > 1 ? "1setOf " : "",
|
||||
ippTagString(ippGetValueTag(attr)), buffer);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: ---- %s ----\n", ippTagString(IPP_TAG_END));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'monitor_printer()' - Monitor the printer state.
|
||||
*/
|
||||
@@ -2358,10 +2432,13 @@ monitor_printer(
|
||||
while (monitor->job_state < IPP_JOB_CANCELED && !job_canceled)
|
||||
{
|
||||
/*
|
||||
* Reconnect to the printer...
|
||||
* Reconnect to the printer as needed...
|
||||
*/
|
||||
|
||||
if (!httpReconnect(http))
|
||||
if (httpGetFd(http) < 0)
|
||||
httpReconnect(http);
|
||||
|
||||
if (httpGetFd(http) >= 0)
|
||||
{
|
||||
/*
|
||||
* Connected, so check on the printer state...
|
||||
@@ -2380,7 +2457,7 @@ monitor_printer(
|
||||
* No job-id yet, so continue...
|
||||
*/
|
||||
|
||||
goto monitor_disconnect;
|
||||
goto monitor_sleep;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2541,20 +2618,14 @@ monitor_printer(
|
||||
(monitor->job_state == IPP_JOB_CANCELED ||
|
||||
monitor->job_state == IPP_JOB_ABORTED))
|
||||
job_canceled = -1;
|
||||
|
||||
/*
|
||||
* Disconnect from the printer - we'll reconnect on the next poll...
|
||||
*/
|
||||
|
||||
monitor_disconnect:
|
||||
|
||||
_httpDisconnect(http);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sleep for N seconds...
|
||||
*/
|
||||
|
||||
monitor_sleep:
|
||||
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
@@ -2566,7 +2637,10 @@ monitor_printer(
|
||||
|
||||
if (job_canceled > 0 && monitor->job_id > 0)
|
||||
{
|
||||
if (!httpReconnect(http))
|
||||
if (httpGetFd(http) < 0)
|
||||
httpReconnect(http);
|
||||
|
||||
if (httpGetFd(http) >= 0)
|
||||
{
|
||||
cancel_job(http, monitor->uri, monitor->job_id, monitor->resource,
|
||||
monitor->user, monitor->version);
|
||||
@@ -2614,9 +2688,6 @@ new_request(
|
||||
{
|
||||
ipp_t *request; /* Request data */
|
||||
const char *keyword; /* PWG keyword */
|
||||
ipp_tag_t group; /* Current group */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
char buffer[1024]; /* Value buffer */
|
||||
|
||||
|
||||
/*
|
||||
@@ -2740,33 +2811,8 @@ new_request(
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies", copies);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: IPP/%d.%d %s #%d\n", version / 10, version % 10,
|
||||
ippOpString(ippGetOperation(request)), ippGetRequestId(request));
|
||||
for (group = IPP_TAG_ZERO, attr = ippFirstAttribute(request);
|
||||
attr;
|
||||
attr = ippNextAttribute(request))
|
||||
{
|
||||
const char *name = ippGetName(attr);
|
||||
|
||||
if (!name)
|
||||
{
|
||||
group = IPP_TAG_ZERO;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (group != ippGetGroupTag(attr))
|
||||
{
|
||||
group = ippGetGroupTag(attr);
|
||||
fprintf(stderr, "DEBUG: ---- %s ----\n", ippTagString(group));
|
||||
}
|
||||
|
||||
ippAttributeString(attr, buffer, sizeof(buffer));
|
||||
fprintf(stderr, "DEBUG: %s %s%s %s\n", name,
|
||||
ippGetCount(attr) > 1 ? "1setOf " : "",
|
||||
ippTagString(ippGetValueTag(attr)), buffer);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: ---- %s ----\n", ippTagString(IPP_TAG_END));
|
||||
fprintf(stderr, "DEBUG: IPP/%d.%d %s #%d\n", version / 10, version % 10, ippOpString(ippGetOperation(request)), ippGetRequestId(request));
|
||||
debug_attributes(request);
|
||||
|
||||
return (request);
|
||||
}
|
||||
@@ -3317,7 +3363,7 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
if (tmpfilename[0])
|
||||
unlink(tmpfilename);
|
||||
|
||||
exit(1);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-17
@@ -111,7 +111,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*filename, /* File to print */
|
||||
title[256]; /* Title string */
|
||||
int port; /* Port number */
|
||||
char portname[256]; /* Port name (string) */
|
||||
http_addrlist_t *addrlist; /* List of addresses for printer */
|
||||
int snmp_enabled = 1; /* Is SNMP enabled? */
|
||||
int snmp_fd; /* SNMP socket */
|
||||
@@ -411,23 +410,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Find the printer...
|
||||
*/
|
||||
|
||||
snprintf(portname, sizeof(portname), "%d", port);
|
||||
addrlist = backendLookup(hostname, port, NULL);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
*/
|
||||
|
||||
if (snmp_enabled)
|
||||
snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
|
||||
|
||||
+60
-2
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Common backend network APIs for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -26,7 +26,6 @@
|
||||
* 'backendCheckSideChannel()' - Check the side-channel for pending requests.
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
backendCheckSideChannel(
|
||||
int snmp_fd, /* I - SNMP socket */
|
||||
@@ -46,6 +45,65 @@ backendCheckSideChannel(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'backendLookup()' - Lookup the given host and log addresses.
|
||||
*/
|
||||
|
||||
http_addrlist_t * /* O - List of addresses or NULL */
|
||||
backendLookup(const char *hostname, /* I - Hostname */
|
||||
int port, /* I - Port number */
|
||||
int *cancel) /* I - Variable to watch for job cancel */
|
||||
{
|
||||
char portname[32], /* Port number as string */
|
||||
addrname[256]; /* Address as string */
|
||||
http_addrlist_t *addrlist, /* List of addresses */
|
||||
*current; /* Current address */
|
||||
|
||||
|
||||
/*
|
||||
* Lookup the address for the named host...
|
||||
*/
|
||||
|
||||
snprintf(portname, sizeof(portname), "%d", port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
if (cancel && *cancel)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
exit(CUPS_BACKEND_OK);
|
||||
}
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* Log the addresses we got...
|
||||
*/
|
||||
|
||||
for (current = addrlist; current; current = current->next)
|
||||
fprintf(stderr, "DEBUG: %s=%s\n", hostname, httpAddrString(¤t->addr, addrname, sizeof(addrname)));
|
||||
|
||||
/*
|
||||
* Return...
|
||||
*/
|
||||
|
||||
return (addrlist);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'backendNetworkSideCB()' - Handle common network side-channel commands.
|
||||
*/
|
||||
|
||||
@@ -247,3 +247,9 @@
|
||||
|
||||
# Lexmark C540n (Issue #4778)
|
||||
0x043d 0x0139 no-reattach
|
||||
|
||||
# Kyocera Ecosys P6026cdn (Issue #4900)
|
||||
0x0482 0x063f no-reattach
|
||||
|
||||
# Lexmark E260dn (Issue #4994)
|
||||
0x043d 0x0123 no-reattach
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
* Read error - bail if we don't see EAGAIN or EINTR...
|
||||
*/
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Read failed: %s\n", strerror(errno));
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to read print data."));
|
||||
@@ -305,7 +305,7 @@ backendRunLoop(
|
||||
* Read error - bail if we don't see EAGAIN or EINTR...
|
||||
*/
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Read failed: %s\n", strerror(errno));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
|
||||
+2
-19
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AppSocket backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -69,7 +69,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
int contimeout; /* Connection timeout */
|
||||
int waiteof; /* Wait for end-of-file? */
|
||||
int port; /* Port number */
|
||||
char portname[255]; /* Port name */
|
||||
int delay; /* Delay for retries... */
|
||||
int device_fd; /* AppSocket */
|
||||
int error; /* Error code (if any) */
|
||||
@@ -264,23 +263,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
start_time = time(NULL);
|
||||
|
||||
sprintf(portname, "%d", port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
addrlist = backendLookup(hostname, port, NULL);
|
||||
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
|
||||
@@ -285,7 +285,6 @@ static void parse_options(char *options, char *serial, int serial_size, UInt32 *
|
||||
static void setup_cfLanguage(void);
|
||||
static void soft_reset(void);
|
||||
static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
|
||||
static void log_usb_class_driver(int is_64bit);
|
||||
#define IS_64BIT 1
|
||||
#define IS_NOT_64BIT 0
|
||||
|
||||
@@ -471,11 +470,6 @@ print_device(const char *uri, /* I - Device URI */
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
if (status == noErr && driverBundlePath != NULL && CFStringCompare(driverBundlePath, kUSBGenericTOPrinterClassDriver, 0) != kCFCompareEqualTo)
|
||||
log_usb_class_driver(IS_64BIT);
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
if (driverBundlePath)
|
||||
CFRelease(driverBundlePath);
|
||||
|
||||
@@ -2097,8 +2091,6 @@ static void run_legacy_backend(int argc,
|
||||
|
||||
if (!usb_legacy_status)
|
||||
{
|
||||
log_usb_class_driver(IS_NOT_64BIT);
|
||||
|
||||
/*
|
||||
* Setup a SIGTERM handler then block it before forking...
|
||||
*/
|
||||
@@ -2475,29 +2467,3 @@ static void get_device_id(cups_sc_status_t *status,
|
||||
|
||||
*status = CUPS_SC_STATUS_OK;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
log_usb_class_driver(int is_64bit) /* I - Is the USB class driver 64-bit? */
|
||||
{
|
||||
/*
|
||||
* Report the usage of legacy USB class drivers to Apple if the user opts into providing
|
||||
* feedback to Apple...
|
||||
*/
|
||||
|
||||
aslmsg aslm = asl_new(ASL_TYPE_MSG);
|
||||
if (aslm)
|
||||
{
|
||||
ppd_file_t *ppd = ppdOpenFile(getenv("PPD"));
|
||||
const char *make_model = ppd ? ppd->nickname : NULL;
|
||||
ppd_attr_t *version = ppdFindAttr(ppd, "FileVersion", "");
|
||||
|
||||
asl_set(aslm, "com.apple.message.domain", "com.apple.printing.usb.64bit");
|
||||
asl_set(aslm, "com.apple.message.result", is_64bit ? "yes" : "no");
|
||||
asl_set(aslm, "com.apple.message.signature", make_model ? make_model : "Unknown");
|
||||
asl_set(aslm, "com.apple.message.signature2", version ? version->value : "?.?");
|
||||
asl_set(aslm, "com.apple.message.summarize", "YES");
|
||||
asl_log(NULL, aslm, ASL_LEVEL_NOTICE, "");
|
||||
asl_free(aslm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
# 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/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
# 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/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CGI_H_
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_HELP_INDEX_H_
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -271,7 +271,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
section = n->section;
|
||||
}
|
||||
|
||||
if (!topic || strcmp(n->section, topic))
|
||||
if (!topic || !n->section || strcmp(n->section, topic))
|
||||
continue;
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -91,7 +91,7 @@ cgiFormEncode(char *dst, /* I - Destination string */
|
||||
for (dstptr = dst; *src && dstptr < dstend;)
|
||||
{
|
||||
switch (*src)
|
||||
{
|
||||
{
|
||||
case ' ' :
|
||||
/*
|
||||
* Encode spaces with a "+"...
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#include "cgi-private.h"
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
# 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/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
@@ -134,3 +134,49 @@ WebInterface @CUPS_WEBIF@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
||||
|
||||
# Set the kerberized printer/job policies...
|
||||
<Policy kerberos>
|
||||
# Job/subscription privacy...
|
||||
JobPrivateAccess default
|
||||
JobPrivateValues default
|
||||
SubscriptionPrivateAccess default
|
||||
SubscriptionPrivateValues default
|
||||
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
<Limit Create-Job Print-Job Print-URI Validate-Job>
|
||||
AuthType Negotiate
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
AuthType Negotiate
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All administration operations require an administrator to authenticate...
|
||||
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All printer operations require a printer operator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
AuthType Default
|
||||
Require user @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# Only the owner or an administrator can cancel or authenticate a job...
|
||||
<Limit Cancel-Job CUPS-Authenticate-Job>
|
||||
AuthType Negotiate
|
||||
Require user @OWNER @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit All>
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
||||
|
||||
+12
-17
@@ -1,20 +1,18 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
# reflects your local configuration changes.
|
||||
# Base MIME conversions file for CUPS.
|
||||
#
|
||||
# Base MIME conversions file for CUPS.
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# 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/".
|
||||
# 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/".
|
||||
#
|
||||
|
||||
########################################################################
|
||||
@@ -47,6 +45,7 @@ application/postscript application/vnd.cups-postscript 66 pstops
|
||||
|
||||
# PWG Raster filter for IPP Everywhere...
|
||||
application/vnd.cups-raster image/pwg-raster 100 rastertopwg
|
||||
application/vnd.cups-raster image/urf 100 rastertopwg
|
||||
|
||||
########################################################################
|
||||
#
|
||||
@@ -57,7 +56,3 @@ application/vnd.cups-raster image/pwg-raster 100 rastertopwg
|
||||
#
|
||||
|
||||
@DEFAULT_RAW_PRINTING@application/octet-stream application/vnd.cups-raw 0 -
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
||||
+3
-14
@@ -1,13 +1,11 @@
|
||||
#
|
||||
# "$Id: mime.types 7670 2008-06-17 22:42:08Z mike $"
|
||||
#
|
||||
# Base MIME types file for CUPS.
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Copyright 2007-2015 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -81,12 +79,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
|
||||
|
||||
|
||||
########################################################################
|
||||
#
|
||||
@@ -114,6 +106,7 @@ image/x-xpixmap xpm ascii(0,1024) + string(3,"XPM")
|
||||
image/x-sun-raster ras string(0,<59a66a95>)
|
||||
|
||||
#image/fpx fpx
|
||||
image/urf urf string(0,UNIRAST<00>)
|
||||
image/x-alias pix short(8,8) short(8,24)
|
||||
image/x-bitmap bmp string(0,BM) + !printable(2,14)
|
||||
image/x-icon ico
|
||||
@@ -132,7 +125,7 @@ application/x-shell sh printable(0,1024) + string(0,#!) +\
|
||||
contains(2,80,/sh) contains(2,80,/zsh))
|
||||
application/x-csource c cxx cpp cc C h hpp \
|
||||
printable(0,1024) + ! css + \
|
||||
(string(0,/*) string(0,//)
|
||||
(string(0,/*) string(0,//) \
|
||||
string(0,#include) contains(0,1024,<0a>#include) \
|
||||
string(0,#define) contains(0,1024,<0a>#define))
|
||||
text/html html htm printable(0,1024) +\
|
||||
@@ -176,7 +169,3 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
#
|
||||
|
||||
application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 7670 2008-06-17 22:42:08Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
@@ -129,7 +129,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,
|
||||
@@ -162,7 +161,7 @@ AC_CHECK_FUNCS(statfs statvfs)
|
||||
|
||||
dnl Checks for string functions.
|
||||
AC_CHECK_FUNCS(strdup strlcat strlcpy)
|
||||
if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
|
||||
if test "$host_os_name" = "hp-ux" -a "$host_os_version" = "1020"; then
|
||||
echo Forcing snprintf emulation for HP-UX.
|
||||
else
|
||||
AC_CHECK_FUNCS(snprintf vsnprintf)
|
||||
@@ -181,8 +180,8 @@ dnl Check for vsyslog function.
|
||||
AC_CHECK_FUNCS(vsyslog)
|
||||
|
||||
dnl Checks for signal functions.
|
||||
case "$uname" in
|
||||
Linux | GNU)
|
||||
case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
# Do not use sigset on Linux or GNU HURD
|
||||
;;
|
||||
*)
|
||||
@@ -230,7 +229,7 @@ AC_SUBST(LIBUSB)
|
||||
AC_SUBST(USBQUIRKS)
|
||||
|
||||
if test "x$PKGCONFIG" != x; then
|
||||
if test x$enable_libusb != xno -a $uname != Darwin; then
|
||||
if test x$enable_libusb != xno -a $host_os_name != darwin; then
|
||||
AC_MSG_CHECKING(for libusb-1.0)
|
||||
if $PKGCONFIG --exists libusb-1.0; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -278,8 +277,8 @@ AC_SUBST(INSTALL_GZIP)
|
||||
AC_SUBST(LIBZ)
|
||||
|
||||
dnl Flags for "ar" command...
|
||||
case $uname in
|
||||
Darwin* | *BSD*)
|
||||
case $host_os_name in
|
||||
darwin* | *bsd*)
|
||||
ARFLAGS="-rcv"
|
||||
;;
|
||||
*)
|
||||
@@ -314,7 +313,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 -a "x$host_os_name" != xdarwin; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -348,8 +347,8 @@ CUPS_DEFAULT_SYSTEM_AUTHKEY=""
|
||||
CUPS_SYSTEM_AUTHKEY=""
|
||||
INSTALLXPC=""
|
||||
|
||||
case $uname in
|
||||
Darwin*)
|
||||
case $host_os_name in
|
||||
darwin*)
|
||||
BACKLIBS="$BACKLIBS -framework IOKit"
|
||||
SERVERLIBS="$SERVERLIBS -framework IOKit -weak_framework ApplicationServices"
|
||||
LIBS="-framework SystemConfiguration -framework CoreFoundation -framework Security $LIBS"
|
||||
@@ -407,10 +406,10 @@ case $uname in
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
|
||||
dnl Check for sandbox/Seatbelt support
|
||||
if test $uversion -ge 100; then
|
||||
if test $host_os_version -ge 100; then
|
||||
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
|
||||
fi
|
||||
if test $uversion -ge 110 -a $uversion -lt 120; then
|
||||
if test $host_os_version -ge 110 -a $host_os_version -lt 120; then
|
||||
# Broken public headers in 10.7.x...
|
||||
AC_MSG_CHECKING(for sandbox/private.h presence)
|
||||
if test -f /usr/local/include/sandbox/private.h; then
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Clear the debugging and non-shared library options unless the user asks
|
||||
@@ -46,6 +46,10 @@ fi
|
||||
|
||||
dnl Unit tests take up time during a compile...
|
||||
if test x$enable_unit_tests = xyes; then
|
||||
if test "$build" != "$host"; then
|
||||
AC_MSG_ERROR([Sorry, cannot build unit tests when cross-compiling.])
|
||||
fi
|
||||
|
||||
UNITTESTS="unittests"
|
||||
else
|
||||
UNITTESTS=""
|
||||
@@ -63,7 +67,7 @@ else
|
||||
fi
|
||||
|
||||
if test -z "$with_ldarchflags"; then
|
||||
if test "$uname" = Darwin; then
|
||||
if test "$host_os_name" = darwin; then
|
||||
# Only create Intel programs by default
|
||||
LDARCHFLAGS="`echo $ARCHFLAGS | sed -e '1,$s/-arch ppc64//'`"
|
||||
else
|
||||
@@ -130,8 +134,8 @@ if test -n "$GCC"; then
|
||||
# Not available to LSB binaries...
|
||||
AC_MSG_CHECKING(whether compiler supports -fPIE)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
CFLAGS="$CFLAGS -fPIE -Wl,-pie"
|
||||
AC_TRY_COMPILE(,,[
|
||||
PIEFLAGS="-fPIE -Wl,-pie"
|
||||
@@ -187,8 +191,8 @@ if test -n "$GCC"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# -D_FORTIFY_SOURCE=2 adds additional object size
|
||||
# checking, basically wrapping all string functions
|
||||
# with buffer-limited ones. Not strictly needed for
|
||||
@@ -197,7 +201,7 @@ if test -n "$GCC"; then
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
;;
|
||||
|
||||
Linux*)
|
||||
linux*)
|
||||
# The -z relro option is provided by the Linux linker command to
|
||||
# make relocatable data read-only.
|
||||
if test x$enable_relro = xyes; then
|
||||
@@ -207,8 +211,8 @@ if test -n "$GCC"; then
|
||||
esac
|
||||
else
|
||||
# Add vendor-specific compiler options...
|
||||
case $uname in
|
||||
SunOS*)
|
||||
case $host_os_name in
|
||||
sunos*)
|
||||
# Solaris
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
@@ -235,8 +239,8 @@ else
|
||||
fi
|
||||
|
||||
# Add general compiler options per platform...
|
||||
case $uname in
|
||||
Linux*)
|
||||
case $host_os_name in
|
||||
linux*)
|
||||
# glibc 2.8 and higher breaks peer credentials unless you
|
||||
# define _GNU_SOURCE...
|
||||
OPTIM="$OPTIM -D_GNU_SOURCE"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2017 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Default languages...
|
||||
@@ -22,10 +22,10 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau
|
||||
esac])
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl OS X bundle-based localization support
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set OS X localization bundle directory ],
|
||||
dnl macOS bundle-based localization support
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set macOS localization bundle directory ],
|
||||
CUPS_BUNDLEDIR="$withval",
|
||||
if test "x$uname" = xDarwin -a $uversion -ge 100; then
|
||||
if test "x$host_os_name" = xdarwin -a $host_os_version -ge 100; then
|
||||
CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
|
||||
LANGUAGES=""
|
||||
else
|
||||
@@ -37,21 +37,41 @@ if test "x$CUPS_BUNDLEDIR" != x; then
|
||||
AC_DEFINE_UNQUOTED(CUPS_BUNDLEDIR, "$CUPS_BUNDLEDIR")
|
||||
fi
|
||||
|
||||
dnl Default executable file permissions
|
||||
AC_ARG_WITH(exe_file_perm, [ --with-exe-file-perm set default exectuable permissions value, default=0555],
|
||||
CUPS_EXE_FILE_PERM="$withval",
|
||||
[case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
CUPS_EXE_FILE_PERM="755"
|
||||
;;
|
||||
*)
|
||||
CUPS_EXE_FILE_PERM="555"
|
||||
;;
|
||||
esac])
|
||||
AC_SUBST(CUPS_EXE_FILE_PERM)
|
||||
|
||||
dnl Default ConfigFilePerm
|
||||
AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
|
||||
CUPS_CONFIG_FILE_PERM="$withval",
|
||||
if test "x$uname" = xDarwin; then
|
||||
[if test "x$host_os_name" = xdarwin; then
|
||||
CUPS_CONFIG_FILE_PERM="644"
|
||||
else
|
||||
CUPS_CONFIG_FILE_PERM="640"
|
||||
fi)
|
||||
fi])
|
||||
AC_SUBST(CUPS_CONFIG_FILE_PERM)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
|
||||
|
||||
dnl Default permissions for cupsd
|
||||
AC_ARG_WITH(cupsd_file_perm, [ --with-cupsd-file-perm set default cupsd permissions, default=0500],
|
||||
CUPS_CUPSD_FILE_PERM="$withval",
|
||||
CUPS_CUPSD_FILE_PERM="500")
|
||||
[case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
CUPS_CUPSD_FILE_PERM="700"
|
||||
;;
|
||||
*)
|
||||
CUPS_CUPSD_FILE_PERM="500"
|
||||
;;
|
||||
esac])
|
||||
AC_SUBST(CUPS_CUPSD_FILE_PERM)
|
||||
|
||||
dnl Default LogFilePerm
|
||||
@@ -141,7 +161,7 @@ dnl Determine the correct username and group for this OS...
|
||||
AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
CUPS_USER="$withval",
|
||||
AC_MSG_CHECKING(for default print user)
|
||||
if test x$uname = xDarwin; then
|
||||
if test x$host_os_name = xdarwin; then
|
||||
if test x`id -u _lp 2>/dev/null` = x; then
|
||||
CUPS_USER="lp";
|
||||
else
|
||||
@@ -174,7 +194,7 @@ fi
|
||||
AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
CUPS_GROUP="$withval",
|
||||
AC_MSG_CHECKING(for default print group)
|
||||
if test x$uname = xDarwin; then
|
||||
if test x$host_os_name = xdarwin; then
|
||||
if test x`id -g _lp 2>/dev/null` = x; then
|
||||
CUPS_GROUP="lp";
|
||||
else
|
||||
@@ -207,7 +227,7 @@ fi
|
||||
|
||||
AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
|
||||
CUPS_SYSTEM_GROUPS="$withval",
|
||||
if test x$uname = xDarwin; then
|
||||
if test x$host_os_name = xdarwin; then
|
||||
CUPS_SYSTEM_GROUPS="admin"
|
||||
else
|
||||
AC_MSG_CHECKING(for default system groups)
|
||||
@@ -260,15 +280,15 @@ AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
|
||||
|
||||
if test x$default_printcap != xno; then
|
||||
if test "x$default_printcap" = "xdefault"; then
|
||||
case $uname in
|
||||
Darwin*)
|
||||
if test $uversion -ge 90; then
|
||||
case $host_os_name in
|
||||
darwin*)
|
||||
if test $host_os_version -ge 90; then
|
||||
CUPS_DEFAULT_PRINTCAP="/Library/Preferences/org.cups.printers.plist"
|
||||
else
|
||||
CUPS_DEFAULT_PRINTCAP="/etc/printcap"
|
||||
fi
|
||||
;;
|
||||
SunOS*)
|
||||
sunos*)
|
||||
CUPS_DEFAULT_PRINTCAP="/etc/printers.conf"
|
||||
;;
|
||||
*)
|
||||
@@ -292,8 +312,8 @@ AC_ARG_WITH(lpdconfigfile, [ --with-lpdconfigfile set default LPDConfigFile
|
||||
|
||||
if test x$default_lpdconfigfile != xno; then
|
||||
if test "x$default_lpdconfigfile" = "xdefault"; then
|
||||
case $uname in
|
||||
Darwin*)
|
||||
case $host_os_name in
|
||||
darwin*)
|
||||
CUPS_DEFAULT_LPD_CONFIG_FILE="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
|
||||
;;
|
||||
*)
|
||||
@@ -360,7 +380,7 @@ AC_ARG_WITH(snmp-address, [ --with-snmp-address set SNMP query address, def
|
||||
else
|
||||
CUPS_SNMP_ADDRESS="Address $withval"
|
||||
fi,
|
||||
if test "x$uname" = xDarwin; then
|
||||
if test "x$host_os_name" = xdarwin; then
|
||||
CUPS_SNMP_ADDRESS=""
|
||||
else
|
||||
CUPS_SNMP_ADDRESS="Address @LOCAL"
|
||||
@@ -382,7 +402,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 OS X])
|
||||
AC_ARG_ENABLE(webif, [ --enable-webif enable the web interface by default, default=no for macOS])
|
||||
case "x$enable_webif" in
|
||||
xno)
|
||||
CUPS_WEBIF=No
|
||||
@@ -393,7 +413,7 @@ case "x$enable_webif" in
|
||||
CUPS_DEFAULT_WEBIF=1
|
||||
;;
|
||||
*)
|
||||
if test $uname = Darwin; then
|
||||
if test $host_os_name = darwin; then
|
||||
CUPS_WEBIF=No
|
||||
CUPS_DEFAULT_WEBIF=0
|
||||
else
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Directory stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_PREFIX_DEFAULT(/)
|
||||
@@ -74,7 +74,7 @@ fi
|
||||
dnl Fix "localstatedir" variable if it hasn't been specified...
|
||||
if test "$localstatedir" = "\${prefix}/var"; then
|
||||
if test "$prefix" = "/"; then
|
||||
if test "$uname" = Darwin; then
|
||||
if test "$host_os_name" = darwin; then
|
||||
localstatedir="/private/var"
|
||||
else
|
||||
localstatedir="/var"
|
||||
@@ -87,7 +87,7 @@ fi
|
||||
dnl Fix "sysconfdir" variable if it hasn't been specified...
|
||||
if test "$sysconfdir" = "\${prefix}/etc"; then
|
||||
if test "$prefix" = "/"; then
|
||||
if test "$uname" = Darwin; then
|
||||
if test "$host_os_name" = darwin; then
|
||||
sysconfdir="/private/etc"
|
||||
else
|
||||
sysconfdir="/etc"
|
||||
@@ -99,8 +99,8 @@ fi
|
||||
|
||||
dnl Fix "libdir" variable...
|
||||
if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
case "$uname" in
|
||||
Linux*)
|
||||
case "$host_os_name" in
|
||||
linux*)
|
||||
if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
fi
|
||||
@@ -165,7 +165,7 @@ dnl Setup default locations...
|
||||
AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
|
||||
|
||||
if test x$cachedir = x; then
|
||||
if test "x$uname" = xDarwin; then
|
||||
if test "x$host_os_name" = xdarwin; then
|
||||
CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
|
||||
else
|
||||
CUPS_CACHEDIR="$localstatedir/cache/cups"
|
||||
@@ -230,8 +230,8 @@ AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
|
||||
|
||||
# Locale data
|
||||
if test "$localedir" = "\${datarootdir}/locale"; then
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
case "$host_os_name" in
|
||||
linux* | gnu* | *bsd* | darwin*)
|
||||
CUPS_LOCALEDIR="$datarootdir/locale"
|
||||
;;
|
||||
|
||||
@@ -265,9 +265,9 @@ AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
|
||||
AC_SUBST(CUPS_REQUESTS)
|
||||
|
||||
# Server executables...
|
||||
case "$uname" in
|
||||
*BSD* | Darwin*)
|
||||
# *BSD and Darwin (MacOS X)
|
||||
case "$host_os_name" in
|
||||
*bsd* | darwin*)
|
||||
# *BSD and Darwin (macOS)
|
||||
INSTALL_SYSV=""
|
||||
CUPS_SERVERBIN="$exec_prefix/libexec/cups"
|
||||
;;
|
||||
@@ -289,9 +289,9 @@ AC_SUBST(CUPS_SERVERROOT)
|
||||
|
||||
# Transient run-time state
|
||||
AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin (OS X)
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# Darwin (macOS)
|
||||
CUPS_STATEDIR="$CUPS_SERVERROOT"
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2017 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 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 +24,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 -a x$host_os_name != xdarwin; then
|
||||
AC_MSG_CHECKING(for Avahi)
|
||||
if $PKGCONFIG --exists avahi-client; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -41,9 +41,9 @@ fi
|
||||
|
||||
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 X...
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# Darwin and macOS...
|
||||
AC_DEFINE(HAVE_DNSSD)
|
||||
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products.
|
||||
dnl
|
||||
dnl This file contains Kerberos support code, copyright 2006 by
|
||||
@@ -11,7 +11,7 @@ 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(gssapi, [ --disable-gssapi disable GSSAPI support])
|
||||
@@ -22,9 +22,9 @@ AC_SUBST(LIBGSSAPI)
|
||||
if test x$enable_gssapi != xno; then
|
||||
AC_PATH_TOOL(KRB5CONFIG, krb5-config)
|
||||
if test "x$KRB5CONFIG" != x; then
|
||||
case "$uname" in
|
||||
Darwin)
|
||||
# OS X weak-links to the Kerberos framework...
|
||||
case "$host_os_name" in
|
||||
darwin)
|
||||
# macOS 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
|
||||
@@ -34,7 +34,7 @@ if test x$enable_gssapi != xno; then
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
;;
|
||||
SunOS*)
|
||||
sunos*)
|
||||
# Solaris has a non-standard krb5-config, don't use it!
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
@@ -52,13 +52,13 @@ if test x$enable_gssapi != xno; then
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
else
|
||||
# Check for vendor-specific implementations...
|
||||
case "$uname" in
|
||||
HP-UX*)
|
||||
case "$host_os_name" in
|
||||
hp-ux*)
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
LIBGSSAPI="-lgss -lgssapi_krb5")
|
||||
;;
|
||||
SunOS*)
|
||||
sunos*)
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
LIBGSSAPI="-lgss")
|
||||
|
||||
@@ -8,7 +8,7 @@ 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Check for largefile support...
|
||||
|
||||
@@ -8,7 +8,7 @@ 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Manpage stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2007-2017 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Fix "mandir" variable...
|
||||
@@ -19,9 +19,9 @@ if test "$mandir" = "\${datarootdir}/man" -a "$prefix" = "/"; then
|
||||
fi
|
||||
|
||||
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
|
||||
case "$uname" in
|
||||
Darwin* | Linux | GNU | *BSD*)
|
||||
# Darwin, MacOS X, Linux, GNU HURD, and *BSD
|
||||
case "$host_os_name" in
|
||||
darwin* | linux* | gnu* | *bsd*)
|
||||
# Darwin, macOS, Linux, GNU HURD, and *BSD
|
||||
mandir="/usr/share/man"
|
||||
AMANDIR="/usr/share/man"
|
||||
PMANDIR="/usr/share/man"
|
||||
@@ -42,8 +42,8 @@ AC_SUBST(AMANDIR)
|
||||
AC_SUBST(PMANDIR)
|
||||
|
||||
dnl Setup manpage extensions...
|
||||
case "$uname" in
|
||||
SunOS*)
|
||||
case "$host_os_name" in
|
||||
sunos*)
|
||||
# Solaris
|
||||
MAN1EXT=1
|
||||
MAN5EXT=5
|
||||
@@ -51,8 +51,8 @@ case "$uname" in
|
||||
MAN8EXT=1m
|
||||
MAN8DIR=1m
|
||||
;;
|
||||
Linux* | GNU* | Darwin*)
|
||||
# Linux, GNU Hurd, and OS X
|
||||
linux* | gnu* | darwin*)
|
||||
# Linux, GNU Hurd, and macOS
|
||||
MAN1EXT=1.gz
|
||||
MAN5EXT=5.gz
|
||||
MAN7EXT=7.gz
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Networking stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2016 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H),,[
|
||||
@@ -28,7 +28,7 @@ AC_SEARCH_LIBS(__res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT),
|
||||
|
||||
# Tru64 5.1b leaks file descriptors with these functions; disable until
|
||||
# we can come up with a test for this...
|
||||
if test "$uname" != "OSF1"; then
|
||||
if test "$host_os_name" != "osf1"; then
|
||||
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
|
||||
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
|
||||
fi
|
||||
@@ -45,9 +45,9 @@ AC_ARG_WITH(domainsocket, [ --with-domainsocket set unix domain socket name
|
||||
|
||||
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 MaxOS X do their own thing...
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# Darwin and macOS do their own thing...
|
||||
CUPS_DEFAULT_DOMAINSOCKET="$localstatedir/run/cupsd"
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -1,33 +1,37 @@
|
||||
dnl
|
||||
dnl Operating system stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 2007-2017 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Get the operating system, version number, and architecture...
|
||||
uname=`uname`
|
||||
uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'`
|
||||
uarch=`uname -m`
|
||||
dnl Get the build and host platforms and split the host_os value
|
||||
AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
uname="Darwin"
|
||||
if test $uversion -lt 120; then
|
||||
AC_MSG_ERROR([Sorry, this version of CUPS requires OS X 10.8 or higher.])
|
||||
fi
|
||||
;;
|
||||
[host_os_name=`echo $host_os | sed -e '1,$s/[0-9.]*$//g'`]
|
||||
[host_os_version=`echo $host_os | sed -e '1,$s/^[^0-9.]*//g' | awk -F. '{print $1 $2}'`]
|
||||
# Linux often does not yield an OS version we can use...
|
||||
if test "x$host_os_version" = x; then
|
||||
host_os_version="0"
|
||||
fi
|
||||
|
||||
GNU* | GNU/*)
|
||||
uname="GNU"
|
||||
;;
|
||||
Linux*)
|
||||
uname="Linux"
|
||||
;;
|
||||
esac
|
||||
if test "$host_os_name" = darwin -a $host_os_version -lt 120; then
|
||||
AC_MSG_ERROR([Sorry, this version of CUPS requires macOS 10.8 or higher.])
|
||||
fi
|
||||
|
||||
dnl Determine whether we are cross-compiling...
|
||||
if test "$build" = "$host"; then
|
||||
# No, build local targets
|
||||
LOCALTARGET="local"
|
||||
else
|
||||
# Yes, don't build local targets
|
||||
LOCALTARGET=""
|
||||
fi
|
||||
AC_SUBST(LOCALTARGET)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl PAM stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2007-2017 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(pam, [ --disable-pam disable PAM support])
|
||||
@@ -52,9 +52,9 @@ if test x$enable_pam != xno; then
|
||||
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin/OS X
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# Darwin/macOS
|
||||
if test "x$with_pam_module" != x; then
|
||||
PAMFILE="pam.$with_pam_module"
|
||||
elif test -f /usr/lib/pam/pam_opendirectory.so.2; then
|
||||
|
||||
@@ -8,7 +8,7 @@ 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_CHECK_FUNC(poll, AC_DEFINE(HAVE_POLL))
|
||||
|
||||
@@ -8,7 +8,7 @@ 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Do we have Java?
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Shared library support for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2007-2017 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
PICFLAG=1
|
||||
@@ -21,8 +21,8 @@ LIBCUPSBASE="lib$cupsbase"
|
||||
LIBCUPSSTATIC="lib$cupsbase.a"
|
||||
|
||||
if test x$enable_shared != xno; then
|
||||
case "$uname" in
|
||||
SunOS*)
|
||||
case "$host_os_name" in
|
||||
sunos*)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -32,7 +32,7 @@ if test x$enable_shared != xno; then
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
|
||||
;;
|
||||
Linux | GNU | *BSD*)
|
||||
linux* | gnu* | *bsd*)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -42,7 +42,7 @@ if test x$enable_shared != xno; then
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
;;
|
||||
Darwin*)
|
||||
darwin*)
|
||||
LIBCUPS="lib$cupsbase.2.dylib"
|
||||
LIBCUPSCGI="libcupscgi.1.dylib"
|
||||
LIBCUPSIMAGE="libcupsimage.2.dylib"
|
||||
@@ -120,8 +120,8 @@ if test "$DSO" != ":"; then
|
||||
# Tell the run-time linkers where to find a DSO. Some platforms
|
||||
# need this option, even when the library is installed in a
|
||||
# standard location...
|
||||
case $uname in
|
||||
SunOS*)
|
||||
case $host_os_name in
|
||||
sunos*)
|
||||
# Solaris...
|
||||
if test $exec_prefix != /usr; then
|
||||
DSOFLAGS="-R$libdir $DSOFLAGS"
|
||||
@@ -129,7 +129,7 @@ if test "$DSO" != ":"; then
|
||||
EXPORT_LDFLAGS="-R$libdir"
|
||||
fi
|
||||
;;
|
||||
*BSD*)
|
||||
*bsd*)
|
||||
# *BSD...
|
||||
if test $exec_prefix != /usr; then
|
||||
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
|
||||
@@ -137,7 +137,7 @@ if test "$DSO" != ":"; then
|
||||
EXPORT_LDFLAGS="-Wl,-R$libdir"
|
||||
fi
|
||||
;;
|
||||
Linux | GNU)
|
||||
linux* | gnu*)
|
||||
# Linux, and HURD...
|
||||
if test $exec_prefix != /usr; then
|
||||
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl TLS stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(ssl, [ --disable-ssl disable SSL/TLS support])
|
||||
@@ -23,7 +23,7 @@ CUPS_SERVERKEYCHAIN=""
|
||||
if test x$enable_ssl != xno; then
|
||||
dnl Look for CDSA...
|
||||
if test $have_ssl = 0 -a "x$enable_cdsassl" != "xno"; then
|
||||
if test $uname = Darwin; then
|
||||
if test $host_os_name = darwin; then
|
||||
AC_CHECK_HEADER(Security/SecureTransport.h, [
|
||||
have_ssl=1
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
@@ -52,7 +52,7 @@ if test x$enable_ssl != xno; then
|
||||
AC_DEFINE(HAVE_CSSMERRORSTRING)
|
||||
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])
|
||||
|
||||
if test $uversion -ge 150; then
|
||||
if test $host_os_version -ge 150; then
|
||||
AC_DEFINE(HAVE_SSLSETENABLEDCIPHERS)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Launch-on-demand/startup stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2017 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
ONDEMANDFLAGS=""
|
||||
@@ -16,30 +16,21 @@ ONDEMANDLIBS=""
|
||||
AC_SUBST(ONDEMANDFLAGS)
|
||||
AC_SUBST(ONDEMANDLIBS)
|
||||
|
||||
dnl Launchd is used on OS X/Darwin...
|
||||
dnl Launchd is used on macOS/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_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_FUNC(launch_activate_socket, [
|
||||
AC_DEFINE(HAVE_LAUNCHD)
|
||||
AC_DEFINE(HAVE_ONDEMAND)])
|
||||
AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin, MacOS X
|
||||
LAUNCHD_DIR="/System/Library/LaunchDaemons"
|
||||
# liblaunch is already part of libSystem
|
||||
;;
|
||||
*)
|
||||
# All others; this test will need to be updated
|
||||
;;
|
||||
esac
|
||||
if test "$host_os_name" = darwin; then
|
||||
LAUNCHD_DIR="/System/Library/LaunchDaemons"
|
||||
# liblaunch is already part of libSystem
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Systemd is used on Linux...
|
||||
@@ -77,6 +68,7 @@ if test x$enable_systemd != xno; then
|
||||
|
||||
if test $have_systemd = yes; then
|
||||
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`"
|
||||
@@ -85,6 +77,16 @@ if test x$enable_systemd != xno; then
|
||||
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)
|
||||
@@ -115,13 +117,13 @@ if test x$rcdir = x; then
|
||||
fi
|
||||
|
||||
if test "x$rcstart" = x; then
|
||||
case "$uname" in
|
||||
Linux | GNU | GNU/k*BSD*)
|
||||
case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
# Linux
|
||||
rcstart="81"
|
||||
;;
|
||||
|
||||
SunOS*)
|
||||
sunos*)
|
||||
# Solaris
|
||||
rcstart="81"
|
||||
;;
|
||||
@@ -134,8 +136,8 @@ if test "x$rcstart" = x; then
|
||||
fi
|
||||
|
||||
if test "x$rcstop" = x; then
|
||||
case "$uname" in
|
||||
Linux | GNU | GNU/k*BSD*)
|
||||
case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
# Linux
|
||||
rcstop="36"
|
||||
;;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Threading stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2007-2017 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 missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(threads, [ --disable-threads disable multi-threading support])
|
||||
@@ -36,7 +36,7 @@ if test "x$enable_threads" != xno; then
|
||||
|
||||
# Solaris requires -D_POSIX_PTHREAD_SEMANTICS to
|
||||
# be POSIX-compliant... :(
|
||||
if test $uname = SunOS; then
|
||||
if test $host_os_name = sunos; then
|
||||
PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
|
||||
fi
|
||||
break
|
||||
|
||||
+1568
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+19
-13
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Configuration file for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2017 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CONFIG_H_
|
||||
@@ -240,13 +240,6 @@
|
||||
#undef HAVE_VSYSLOG
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the ASL functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_ASL_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the systemd journal functions?
|
||||
*/
|
||||
@@ -479,13 +472,19 @@
|
||||
#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
|
||||
|
||||
|
||||
/*
|
||||
@@ -495,6 +494,13 @@
|
||||
#undef HAVE_SYSTEMD
|
||||
|
||||
|
||||
/*
|
||||
* Do we have upstart support?
|
||||
*/
|
||||
|
||||
#undef HAVE_UPSTART
|
||||
|
||||
|
||||
/*
|
||||
* Various scripting languages...
|
||||
*/
|
||||
@@ -537,10 +543,10 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_GETGROUPLIST
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Do we have OS X 10.4's mbr_XXX functions?
|
||||
* Do we have macOS 10.4's mbr_XXX functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_MEMBERSHIP_H
|
||||
@@ -686,7 +692,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Location of OS X localization bundle, if any.
|
||||
* Location of macOS localization bundle, if any.
|
||||
*/
|
||||
|
||||
#undef CUPS_BUNDLEDIR
|
||||
|
||||
+1793
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
externo
+403
-267
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3
-3
@@ -1,21 +1,21 @@
|
||||
dnl
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of 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 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.2b1], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
AC_INIT([CUPS], [2.2.4], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
|
||||
sinclude(config-scripts/cups-opsys.m4)
|
||||
sinclude(config-scripts/cups-common.m4)
|
||||
|
||||
@@ -261,6 +261,11 @@ testcache.o: testcache.c ppd-private.h ../cups/cups.h file.h versioning.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
|
||||
testcreds.o: testcreds.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
|
||||
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
|
||||
testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \
|
||||
|
||||
+24
-44
@@ -8,7 +8,7 @@
|
||||
# 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/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
@@ -85,6 +85,7 @@ TESTOBJS = \
|
||||
testarray.o \
|
||||
testcache.o \
|
||||
testconflicts.o \
|
||||
testcreds.o \
|
||||
testcups.o \
|
||||
testdest.o \
|
||||
testfile.o \
|
||||
@@ -153,6 +154,7 @@ UNITTARGETS = \
|
||||
testarray \
|
||||
testcache \
|
||||
testconflicts \
|
||||
testcreds \
|
||||
testcups \
|
||||
testdest \
|
||||
testfile \
|
||||
@@ -365,7 +367,7 @@ libcups.a: $(LIBOBJS)
|
||||
libcups2.def: $(LIBOBJS) Makefile
|
||||
echo Generating $@...
|
||||
echo "LIBRARY libcups2" >libcups2.def
|
||||
echo "VERSION 2.11" >>libcups2.def
|
||||
echo "VERSION 2.12" >>libcups2.def
|
||||
echo "EXPORTS" >>libcups2.def
|
||||
(nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
|
||||
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
|
||||
@@ -417,6 +419,16 @@ testconflicts: testconflicts.o $(LIBCUPSSTATIC)
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# testcreds (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testcreds: testcreds.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcreds.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# testcups (dependency on static CUPS library is intentional)
|
||||
#
|
||||
@@ -559,56 +571,27 @@ tlscheck: tlscheck.o $(LIBCUPSSTATIC)
|
||||
|
||||
apihelp:
|
||||
echo Generating CUPS API help files...
|
||||
mxmldoc --section "Programming" \
|
||||
--title "Introduction to CUPS Programming" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-overview.header --intro api-overview.shtml \
|
||||
>../doc/help/api-overview.html
|
||||
$(RM) cupspm.xml
|
||||
mxmldoc --section "Programming" --body cupspm.md \
|
||||
cupspm.xml \
|
||||
auth.c cups.h dest*.c encode.c http.h http*.c ipp.h ipp*.c \
|
||||
options.c tls-darwin.c usersys.c util.c \
|
||||
--coverimage cupspm.png \
|
||||
--epub ../doc/help/cupspm.epub
|
||||
mxmldoc --section "Programming" --body cupspm.md \
|
||||
cupspm.xml > ../doc/help/cupspm.html
|
||||
$(RM) cupspm.xml
|
||||
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 \
|
||||
api-array.xml \
|
||||
array.h array.c >../doc/help/api-array.html
|
||||
mxmldoc --tokens help/api-array.html api-array.xml >../doc/help/api-array.tokens
|
||||
$(RM) api-array.xml
|
||||
mxmldoc --section "Programming" --title "CUPS API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-cups.header --intro api-cups.shtml \
|
||||
api-cups.xml \
|
||||
cups.h pwg.h adminutil.c dest*.c language.c notify.c \
|
||||
options.c pwg-media.c tempfile.c usersys.c \
|
||||
util.c >../doc/help/api-cups.html
|
||||
mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
|
||||
$(RM) api-cups.xml
|
||||
mxmldoc --section "Programming" --title "File and Directory APIs" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-filedir.header --intro api-filedir.shtml \
|
||||
api-filedir.xml \
|
||||
file.h file.c dir.h dir.c >../doc/help/api-filedir.html
|
||||
mxmldoc --tokens api-filedir.xml >../doc/help/api-filedir.tokens
|
||||
$(RM) api-filedir.xml
|
||||
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
|
||||
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" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-httpipp.header --intro api-httpipp.shtml \
|
||||
api-httpipp.xml \
|
||||
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 >../doc/help/api-httpipp.html
|
||||
mxmldoc --tokens help/api-httpipp.html api-httpipp.xml >../doc/help/api-httpipp.tokens
|
||||
$(RM) api-httpipp.xml
|
||||
mxmldoc --section "Programming" \
|
||||
--title "Filter and Backend Programming" \
|
||||
--css ../doc/cups-printable.css \
|
||||
@@ -616,7 +599,6 @@ apihelp:
|
||||
api-filter.xml \
|
||||
backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
|
||||
>../doc/help/api-filter.html
|
||||
mxmldoc --tokens help/api-filter.html api-filter.xml >../doc/help/api-filter.tokens
|
||||
$(RM) api-filter.xml
|
||||
|
||||
|
||||
@@ -625,8 +607,6 @@ apihelp:
|
||||
#
|
||||
|
||||
sloc:
|
||||
echo "libcupslite: \c"
|
||||
sloccount $(LITEOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
|
||||
echo "libcups: \c"
|
||||
sloccount $(LIBOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
|
||||
|
||||
|
||||
+36
-19
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2001-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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -831,7 +831,7 @@ cupsAdminExportSamba(
|
||||
* The returned settings should be freed with cupsFreeOptions() when
|
||||
* you are done with them.
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -1147,7 +1147,7 @@ cupsAdminGetServerSettings(
|
||||
/*
|
||||
* 'cupsAdminSetServerSettings()' - Set settings on the server.
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -1194,6 +1194,7 @@ cupsAdminSetServerSettings(
|
||||
int cupsd_num_settings; /* New number of settings */
|
||||
int old_share_printers, /* Share local printers */
|
||||
old_remote_admin, /* Remote administration allowed? */
|
||||
old_remote_any, /* Remote access from anywhere? */
|
||||
old_user_cancel_any, /* Cancel-job policy set? */
|
||||
old_debug_logging; /* LogLevel debug set? */
|
||||
cups_option_t *cupsd_settings, /* New settings */
|
||||
@@ -1259,12 +1260,12 @@ cupsAdminSetServerSettings(
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
remote_any = atoi(val);
|
||||
old_remote_any = atoi(val);
|
||||
else
|
||||
remote_any = 0;
|
||||
old_remote_any = 0;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_any=%d",
|
||||
remote_any));
|
||||
old_remote_any));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
@@ -1310,12 +1311,23 @@ cupsAdminSetServerSettings(
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: debug_logging=%d",
|
||||
debug_logging));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings,
|
||||
settings)) != NULL)
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings, settings)) != NULL)
|
||||
{
|
||||
remote_any = atoi(val);
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: remote_any=%d",
|
||||
remote_any));
|
||||
if (remote_any == old_remote_any)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
*/
|
||||
|
||||
remote_any = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
remote_any = -1;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: remote_any=%d", remote_any));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
|
||||
settings)) != NULL)
|
||||
@@ -1430,7 +1442,7 @@ cupsAdminSetServerSettings(
|
||||
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")) &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
{
|
||||
if (!wrote_port_listen)
|
||||
{
|
||||
@@ -1616,7 +1628,7 @@ cupsAdminSetServerSettings(
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
}
|
||||
else if (in_root_location &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
{
|
||||
wrote_root_location = 1;
|
||||
|
||||
@@ -1719,7 +1731,7 @@ cupsAdminSetServerSettings(
|
||||
in_cancel_job = 0;
|
||||
}
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location) &&
|
||||
(remote_admin >= 0 || remote_any > 0)) ||
|
||||
(remote_admin >= 0 || remote_any >= 0)) ||
|
||||
(in_root_location && share_printers >= 0)) &&
|
||||
(!_cups_strcasecmp(line, "Allow") || !_cups_strcasecmp(line, "Deny") ||
|
||||
!_cups_strcasecmp(line, "Order")))
|
||||
@@ -1811,7 +1823,7 @@ cupsAdminSetServerSettings(
|
||||
}
|
||||
|
||||
if (!wrote_port_listen &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
{
|
||||
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
|
||||
{
|
||||
@@ -1832,7 +1844,7 @@ cupsAdminSetServerSettings(
|
||||
}
|
||||
|
||||
if (!wrote_root_location &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
{
|
||||
if (remote_admin > 0 && share_printers > 0)
|
||||
cupsFilePuts(temp,
|
||||
@@ -2009,9 +2021,14 @@ cupsAdminSetServerSettings(
|
||||
old_remote_admin ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
|
||||
remote_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
if (remote_any >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
|
||||
remote_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
else
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
|
||||
old_remote_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
if (share_printers >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -54,7 +54,7 @@ typedef void (*cups_device_cb_t)(const char *device_class,
|
||||
const char *device_uri,
|
||||
const char *device_location, void *user_data);
|
||||
/* Device callback
|
||||
* @since CUPS 1.4/OS X 10.6@ */
|
||||
* @since CUPS 1.4/macOS 10.6@ */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -79,7 +79,7 @@ directory to write to.</p>
|
||||
|
||||
<p>In addition, some operating systems provide additional security mechanisms
|
||||
that further limit file system access, even for backends running as root. On
|
||||
OS X, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on OS X</a> section for more information.</p>
|
||||
macOS, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on macOS</a> section for more information.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3><a name="SIGNALS">Canceled Jobs and Signal Handling</a></h3>
|
||||
@@ -94,7 +94,7 @@ being printed.</p>
|
||||
<p>Filters and backends may also receive <code>SIGPIPE</code> when an upstream or downstream filter/backend exits with a non-zero status. Developers should generally ignore <code>SIGPIPE</code> at the beginning of <code>main()</code> with the following function call:</p>
|
||||
|
||||
<pre class="example">
|
||||
#include <signal.h>>
|
||||
#include <signal.h>
|
||||
|
||||
...
|
||||
|
||||
@@ -151,7 +151,7 @@ when running print filters and backends:</p>
|
||||
|
||||
<dt>APPLE_LANGUAGE</dt>
|
||||
<dd>The Apple language identifier associated with the job
|
||||
(OS X only).</dd>
|
||||
(macOS only).</dd>
|
||||
|
||||
<dt>CHARSET</dt>
|
||||
<dd>The job character set, typically "utf-8".</dd>
|
||||
@@ -561,7 +561,7 @@ sub-state and not an issue that applies when a job is not printing.</p>
|
||||
<blockquote><b>Note:</b>
|
||||
|
||||
<p>"STATE:" messages often provide visible alerts to the user. For example,
|
||||
on OS X setting a printer-state-reason value with an "-error" or
|
||||
on macOS setting a printer-state-reason value with an "-error" or
|
||||
"-warning" suffix will cause the printer's dock item to bounce if the
|
||||
corresponding reason is localized with a cupsIPPReason keyword in the
|
||||
printer's PPD file.</p>
|
||||
@@ -851,9 +851,9 @@ void *my_data;
|
||||
<a href="#cupsSideChannelSNMPWalk">cupsSNMPSideChannelWalk</a>(".1.3.6.1.2.1.43", 5.0, my_callback, my_data);
|
||||
</pre>
|
||||
|
||||
<h2><a name="SANDBOXING">Sandboxing on OS X</a></h2>
|
||||
<h2><a name="SANDBOXING">Sandboxing on macOS</a></h2>
|
||||
|
||||
<p>Starting with OS X 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
|
||||
<p>Starting with macOS 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
|
||||
|
||||
<ol>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<h1 class='title'>PPD API (DEPRECATED)</h1>
|
||||
|
||||
<blockquote>The PPD API is deprecated starting in CUPS 1.6/OS X 10.8. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
|
||||
<blockquote>The PPD API is deprecated starting in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<blockquote>The PPD API is deprecated starting in CUPS 1.6/OS X 10.8. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
|
||||
<blockquote>The PPD API is deprecated starting in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
|
||||
|
||||
<p>The CUPS PPD API provides read-only access the data in PostScript Printer
|
||||
Description ("PPD") files which are used for all printers with a driver. With
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
+24
-24
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -77,7 +77,7 @@ static int cups_array_find(cups_array_t *a, void *e, int prev, int *rdiff);
|
||||
* appended at the end of the run of identical elements. For unsorted arrays,
|
||||
* the element is appended to the end of the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -207,7 +207,7 @@ _cupsArrayAddStrings(cups_array_t *a, /* I - Array */
|
||||
* The caller is responsible for freeing the memory used by the
|
||||
* elements themselves.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -249,7 +249,7 @@ cupsArrayClear(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayCount()' - Get the number of elements in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - Number of elements */
|
||||
@@ -276,7 +276,7 @@ cupsArrayCount(cups_array_t *a) /* I - Array */
|
||||
* The current element is undefined until you call @link cupsArrayFind@,
|
||||
* @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Element */
|
||||
@@ -306,7 +306,7 @@ cupsArrayCurrent(cups_array_t *a) /* I - Array */
|
||||
* The caller is responsible for freeing the memory used by the
|
||||
* elements themselves.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -350,7 +350,7 @@ cupsArrayDelete(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayDup()' - Duplicate the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
cups_array_t * /* O - Duplicate array */
|
||||
@@ -435,7 +435,7 @@ cupsArrayDup(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayFind()' - Find an element in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Element found or @code NULL@ */
|
||||
@@ -530,7 +530,7 @@ cupsArrayFind(cups_array_t *a, /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayFirst()' - Get the first element in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - First element or @code NULL@ if the array is empty */
|
||||
@@ -559,7 +559,7 @@ cupsArrayFirst(cups_array_t *a) /* I - Array */
|
||||
* The current element is undefined until you call @link cupsArrayFind@,
|
||||
* @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@.
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - Index of the current element, starting at 0 */
|
||||
@@ -575,7 +575,7 @@ cupsArrayGetIndex(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayGetInsert()' - Get the index of the last inserted element.
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - Index of the last inserted element, starting at 0 */
|
||||
@@ -591,7 +591,7 @@ cupsArrayGetInsert(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayIndex()' - Get the N-th element in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - N-th element or @code NULL@ */
|
||||
@@ -614,7 +614,7 @@ cupsArrayIndex(cups_array_t *a, /* I - Array */
|
||||
* inserted at the beginning of the run of identical elements. For unsorted
|
||||
* arrays, the element is inserted at the beginning of the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 0 on failure, 1 on success */
|
||||
@@ -644,7 +644,7 @@ cupsArrayInsert(cups_array_t *a, /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayLast()' - Get the last element in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Last element or @code NULL@ if the array is empty */
|
||||
@@ -675,7 +675,7 @@ cupsArrayLast(cups_array_t *a) /* I - Array */
|
||||
* data pointer argument can safely be omitted when not required so functions
|
||||
* like @code strcmp@ can be used for sorted string arrays.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
cups_array_t * /* O - Array */
|
||||
@@ -697,7 +697,7 @@ cupsArrayNew(cups_array_func_t f, /* I - Comparison function or @code NULL@ for
|
||||
* The hash function ("h") is used to implement cached lookups with the
|
||||
* specified hash size ("hsize").
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
cups_array_t * /* O - Array */
|
||||
@@ -727,7 +727,7 @@ cupsArrayNew2(cups_array_func_t f, /* I - Comparison function or @code NULL@ fo
|
||||
* The free function ("cf") is used to automatically free/release elements when
|
||||
* removed or the array is deleted.
|
||||
*
|
||||
* @since CUPS 1.5/OS X 10.7@
|
||||
* @since CUPS 1.5/macOS 10.7@
|
||||
*/
|
||||
|
||||
cups_array_t * /* O - Array */
|
||||
@@ -811,7 +811,7 @@ _cupsArrayNewStrings(const char *s, /* I - Delimited strings or NULL */
|
||||
* @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@
|
||||
* to set the current element.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Next element or @code NULL@ */
|
||||
@@ -844,7 +844,7 @@ cupsArrayNext(cups_array_t *a) /* I - Array */
|
||||
* @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@
|
||||
* to set the current element.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Previous element or @code NULL@ */
|
||||
@@ -877,7 +877,7 @@ cupsArrayPrev(cups_array_t *a) /* I - Array */
|
||||
* The caller is responsible for freeing the memory used by the
|
||||
* removed element.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -942,7 +942,7 @@ cupsArrayRemove(cups_array_t *a, /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayRestore()' - Reset the current element to the last @link cupsArraySave@.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - New current element */
|
||||
@@ -973,7 +973,7 @@ cupsArrayRestore(cups_array_t *a) /* I - Array */
|
||||
*
|
||||
* The save/restore stack is guaranteed to be at least 32 elements deep.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -995,7 +995,7 @@ cupsArraySave(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayUserData()' - Return the user data for an array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - User data */
|
||||
@@ -1011,7 +1011,7 @@ cupsArrayUserData(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cups_array_add()' - Insert or append an element to the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
static int /* O - 1 on success, 0 on failure */
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
+5
-8
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Authentication functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
@@ -11,7 +11,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -54,7 +54,7 @@ extern const char *cssmErrorString(int error);
|
||||
# else
|
||||
# define GSS_AUTH_IDENTITY_TYPE_1 1
|
||||
# define gss_acquire_cred_ex_f __ApplePrivate_gss_acquire_cred_ex_f
|
||||
typedef struct gss_auth_identity
|
||||
typedef struct gss_auth_identity /* @private@ */
|
||||
{
|
||||
uint32_t type;
|
||||
uint32_t flags;
|
||||
@@ -102,7 +102,7 @@ static int cups_local_auth(http_t *http);
|
||||
* This function should be called in response to a @code HTTP_STATUS_UNAUTHORIZED@
|
||||
* status, prior to resubmitting your request.
|
||||
*
|
||||
* @since CUPS 1.1.20/OS X 10.4@
|
||||
* @since CUPS 1.1.20/macOS 10.4@
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
@@ -386,10 +386,7 @@ _cupsSetNegotiateAuthString(
|
||||
|
||||
if (data.sem)
|
||||
{
|
||||
major_status = gss_acquire_cred_ex_f(NULL, GSS_C_NO_NAME, 0,
|
||||
GSS_C_INDEFINITE, GSS_KRB5_MECHANISM,
|
||||
GSS_C_INITIATE, &identity, &data,
|
||||
cups_gss_acquire);
|
||||
major_status = gss_acquire_cred_ex_f(NULL, GSS_C_NO_NAME, 0, GSS_C_INDEFINITE, GSS_KRB5_MECHANISM, GSS_C_INITIATE, (gss_auth_identity_t)&identity, &data, cups_gss_acquire);
|
||||
|
||||
if (major_status == GSS_S_COMPLETE)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ static void cups_setup(fd_set *set, struct timeval *tval,
|
||||
* parameter controls how many seconds to wait for the data - use 0.0 to
|
||||
* return immediately if there is no data, -1.0 to wait for data indefinitely.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
ssize_t /* O - Bytes read or -1 on error */
|
||||
@@ -93,7 +93,7 @@ cupsBackChannelRead(char *buffer, /* I - Buffer to read into */
|
||||
* 0.0 to return immediately if the data cannot be written, -1.0 to wait
|
||||
* indefinitely.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
ssize_t /* O - Bytes written or -1 on error */
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ static void quote_string(const char *s);
|
||||
* variable or the device URI passed in argv[0], whichever is found
|
||||
* first.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
const char * /* O - Device URI or @code NULL@ */
|
||||
@@ -85,7 +85,7 @@ cupsBackendDeviceURI(char **argv) /* I - Command-line arguments */
|
||||
* It handles quoting of special characters in the device-make-and-model,
|
||||
* device-info, device-id, and device-location strings.
|
||||
*
|
||||
* @since CUPS 1.4/OS X 10.6@
|
||||
* @since CUPS 1.4/macOS 10.6@
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Private definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -105,7 +105,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
int need_res_init; /* Need to reinitialize resolver? */
|
||||
|
||||
/* ipp.c */
|
||||
ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */
|
||||
ipp_uchar_t ipp_date[11]; /* RFC-2579 date/time data */
|
||||
_cups_buffer_t *cups_buffers; /* Buffer list */
|
||||
|
||||
/* ipp-support.c */
|
||||
@@ -124,7 +124,8 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
*ppd_size_lut, /* Lookup table for PPD names */
|
||||
*pwg_size_lut; /* Lookup table for PWG names */
|
||||
pwg_media_t pwg_media; /* PWG media data for custom size */
|
||||
char pwg_name[65]; /* PWG media name for custom size */
|
||||
char pwg_name[65], /* PWG media name for custom size */
|
||||
ppd_name[41]; /* PPD media name for custom size */
|
||||
|
||||
/* request.c */
|
||||
http_t *http; /* Current server connection */
|
||||
|
||||
+47
-42
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2017 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -24,8 +24,8 @@
|
||||
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
|
||||
# define __CUPS_SSIZE_T_DEFINED
|
||||
# include <stddef.h>
|
||||
/* Windows does not support the ssize_t type, so map it to off_t... */
|
||||
typedef off_t ssize_t; /* @private@ */
|
||||
/* Windows does not support the ssize_t type, so map it to long... */
|
||||
typedef long ssize_t; /* @private@ */
|
||||
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
|
||||
|
||||
# include "file.h"
|
||||
@@ -47,10 +47,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 2.0200
|
||||
# define CUPS_VERSION 2.0204
|
||||
# define CUPS_VERSION_MAJOR 2
|
||||
# define CUPS_VERSION_MINOR 2
|
||||
# define CUPS_VERSION_PATCH 0
|
||||
# define CUPS_VERSION_PATCH 4
|
||||
|
||||
# define CUPS_BC_FD 3
|
||||
/* Back-channel file descriptor for
|
||||
@@ -78,7 +78,7 @@ extern "C" {
|
||||
# define CUPS_DEST_FLAGS_NONE 0x00
|
||||
/* No flags are set */
|
||||
# define CUPS_DEST_FLAGS_UNCONNECTED 0x01
|
||||
/* There is not connection */
|
||||
/* There is no connection */
|
||||
# define CUPS_DEST_FLAGS_MORE 0x02
|
||||
/* There are more destinations */
|
||||
# define CUPS_DEST_FLAGS_REMOVED 0x04
|
||||
@@ -92,6 +92,8 @@ extern "C" {
|
||||
/* A connection is being established */
|
||||
# define CUPS_DEST_FLAGS_CANCELED 0x40
|
||||
/* Operation was canceled */
|
||||
# define CUPS_DEST_FLAGS_DEVICE 0x80
|
||||
/* For @link cupsConnectDest@: Connect to device */
|
||||
|
||||
/* Flags for cupsGetDestMediaByName/Size */
|
||||
# define CUPS_MEDIA_FLAGS_DEFAULT 0x00
|
||||
@@ -207,39 +209,37 @@ enum cups_ptype_e /* Printer type/capability bit
|
||||
CUPS_PRINTER_REMOTE = 0x0002, /* Remote printer or class */
|
||||
CUPS_PRINTER_BW = 0x0004, /* Can do B&W printing */
|
||||
CUPS_PRINTER_COLOR = 0x0008, /* Can do color printing */
|
||||
CUPS_PRINTER_DUPLEX = 0x0010, /* Can do duplexing */
|
||||
CUPS_PRINTER_DUPLEX = 0x0010, /* Can do two-sided printing */
|
||||
CUPS_PRINTER_STAPLE = 0x0020, /* Can staple output */
|
||||
CUPS_PRINTER_COPIES = 0x0040, /* Can do copies */
|
||||
CUPS_PRINTER_COLLATE = 0x0080, /* Can collage copies */
|
||||
CUPS_PRINTER_COPIES = 0x0040, /* Can do copies in hardware */
|
||||
CUPS_PRINTER_COLLATE = 0x0080, /* Can quickly collate copies */
|
||||
CUPS_PRINTER_PUNCH = 0x0100, /* Can punch output */
|
||||
CUPS_PRINTER_COVER = 0x0200, /* Can cover output */
|
||||
CUPS_PRINTER_BIND = 0x0400, /* Can bind output */
|
||||
CUPS_PRINTER_SORT = 0x0800, /* Can sort output */
|
||||
CUPS_PRINTER_SMALL = 0x1000, /* Can do Letter/Legal/A4 */
|
||||
CUPS_PRINTER_MEDIUM = 0x2000, /* Can do Tabloid/B/C/A3/A2 */
|
||||
CUPS_PRINTER_LARGE = 0x4000, /* Can do D/E/A1/A0 */
|
||||
CUPS_PRINTER_VARIABLE = 0x8000, /* Can do variable sizes */
|
||||
CUPS_PRINTER_SMALL = 0x1000, /* Can print on Letter/Legal/A4-size media */
|
||||
CUPS_PRINTER_MEDIUM = 0x2000, /* Can print on Tabloid/B/C/A3/A2-size media */
|
||||
CUPS_PRINTER_LARGE = 0x4000, /* Can print on D/E/A1/A0-size media */
|
||||
CUPS_PRINTER_VARIABLE = 0x8000, /* Can print on rolls and custom-size media */
|
||||
CUPS_PRINTER_IMPLICIT = 0x10000, /* Implicit class @private@
|
||||
* @since Deprecated@ */
|
||||
CUPS_PRINTER_DEFAULT = 0x20000, /* Default printer on network */
|
||||
CUPS_PRINTER_FAX = 0x40000, /* Fax queue */
|
||||
CUPS_PRINTER_REJECTING = 0x80000, /* Printer is rejecting jobs */
|
||||
CUPS_PRINTER_DELETE = 0x100000, /* Delete printer
|
||||
* @since CUPS 1.2/OS X 10.5@ */
|
||||
* @deprecated@ @exclude all@ */
|
||||
CUPS_PRINTER_NOT_SHARED = 0x200000, /* Printer is not shared
|
||||
* @since CUPS 1.2/OS X 10.5@ */
|
||||
* @since CUPS 1.2/macOS 10.5@ */
|
||||
CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication
|
||||
* @since CUPS 1.2/OS X 10.5@ */
|
||||
* @since CUPS 1.2/macOS 10.5@ */
|
||||
CUPS_PRINTER_COMMANDS = 0x800000, /* Printer supports maintenance commands
|
||||
* @since CUPS 1.2/OS X 10.5@ */
|
||||
CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was automatically discovered
|
||||
* and added @private@
|
||||
* @since Deprecated@ */
|
||||
* @since CUPS 1.2/macOS 10.5@ */
|
||||
CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was discovered @since CUPS 1.2/macOS 10.5@ */
|
||||
CUPS_PRINTER_SCANNER = 0x2000000, /* Scanner-only device
|
||||
* @since CUPS 1.4/OS X 10.6@ */
|
||||
* @since CUPS 1.4/macOS 10.6@ @private@ */
|
||||
CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities
|
||||
* @since CUPS 1.4/OS X 10.6@ */
|
||||
CUPS_PRINTER_3D = 0x8000000, /* Printer with 3D capabilities @since CUPS 2.1@ */
|
||||
* @since CUPS 1.4/macOS 10.6@ @private@ */
|
||||
CUPS_PRINTER_3D = 0x8000000, /* Printer with 3D capabilities @exclude all@ @private@ */
|
||||
CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT |
|
||||
* DEFAULT | FAX | REJECTING | DELETE |
|
||||
* NOT_SHARED | AUTHENTICATED |
|
||||
@@ -263,14 +263,14 @@ typedef struct cups_dest_s /**** Destination ****/
|
||||
|
||||
typedef struct _cups_dinfo_s cups_dinfo_t;
|
||||
/* Destination capability and status
|
||||
* information @since CUPS 1.6/OS X 10.8@ */
|
||||
* information @since CUPS 1.6/macOS 10.8@ */
|
||||
|
||||
typedef struct cups_job_s /**** Job ****/
|
||||
{
|
||||
int id; /* The job ID */
|
||||
char *dest; /* Printer or class name */
|
||||
char *title; /* Title/job name */
|
||||
char *user; /* User the submitted the job */
|
||||
char *user; /* User that submitted the job */
|
||||
char *format; /* Document format */
|
||||
ipp_jstate_t state; /* Job state */
|
||||
int size; /* Size in kilobytes */
|
||||
@@ -280,7 +280,7 @@ typedef struct cups_job_s /**** Job ****/
|
||||
time_t processing_time; /* Time the job was processed */
|
||||
} cups_job_t;
|
||||
|
||||
typedef struct cups_size_s /**** Media Size @since CUPS 1.6/OS X 10.8@ ****/
|
||||
typedef struct cups_size_s /**** Media Size @since CUPS 1.6/macOS 10.8@ ****/
|
||||
{
|
||||
char media[128]; /* Media name to use */
|
||||
int width, /* Width in hundredths of millimeters */
|
||||
@@ -300,33 +300,34 @@ typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls,
|
||||
cups_array_t *distinguished_names,
|
||||
void *user_data);
|
||||
/* Client credentials callback
|
||||
* @since CUPS 1.5/OS X 10.7@ */
|
||||
* @since CUPS 1.5/macOS 10.7@ */
|
||||
|
||||
typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags,
|
||||
cups_dest_t *dest);
|
||||
/* Destination enumeration callback
|
||||
* @since CUPS 1.6/OS X 10.8@ */
|
||||
* @since CUPS 1.6/macOS 10.8@ */
|
||||
|
||||
# ifdef __BLOCKS__
|
||||
typedef int (^cups_dest_block_t)(unsigned flags, cups_dest_t *dest);
|
||||
/* Destination enumeration block
|
||||
* @since CUPS 1.6/OS X 10.8@ */
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
* @exclude all@ */
|
||||
# endif /* __BLOCKS__ */
|
||||
|
||||
typedef const char *(*cups_password_cb_t)(const char *prompt);
|
||||
/* Password callback */
|
||||
/* Password callback @exclude all@ */
|
||||
|
||||
typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http,
|
||||
const char *method,
|
||||
const char *resource,
|
||||
void *user_data);
|
||||
/* New password callback
|
||||
* @since CUPS 1.4/OS X 10.6@ */
|
||||
* @since CUPS 1.4/macOS 10.6@ */
|
||||
|
||||
typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
|
||||
cups_array_t *certs, void *user_data);
|
||||
/* Server credentials callback
|
||||
* @since CUPS 1.5/OS X 10.7@ */
|
||||
* @since CUPS 1.5/macOS 10.7@ */
|
||||
|
||||
|
||||
/*
|
||||
@@ -341,11 +342,11 @@ extern ipp_t *cupsDoRequest(http_t *http, ipp_t *request,
|
||||
const char *resource);
|
||||
extern http_encryption_t cupsEncryption(void);
|
||||
extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
|
||||
extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
|
||||
extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
|
||||
extern const char *cupsGetDefault(void);
|
||||
extern int cupsGetJobs(cups_job_t **jobs, const char *name,
|
||||
int myjobs, int whichjobs);
|
||||
extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
|
||||
extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
|
||||
extern ipp_status_t cupsLastError(void);
|
||||
extern int cupsPrintFile(const char *name, const char *filename,
|
||||
const char *title, int num_options,
|
||||
@@ -414,7 +415,7 @@ extern int cupsPrintFiles2(http_t *http, const char *name,
|
||||
extern int cupsSetDests2(http_t *http, int num_dests,
|
||||
cups_dest_t *dests) _CUPS_API_1_1_21;
|
||||
|
||||
/**** New in CUPS 1.2/OS X 10.5 ****/
|
||||
/**** New in CUPS 1.2/macOS 10.5 ****/
|
||||
extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
|
||||
double timeout) _CUPS_API_1_2;
|
||||
extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
|
||||
@@ -431,7 +432,7 @@ extern int cupsRemoveOption(const char *name, int num_options,
|
||||
cups_option_t **options) _CUPS_API_1_2;
|
||||
extern cups_file_t *cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
|
||||
|
||||
/**** New in CUPS 1.3/OS X 10.5 ****/
|
||||
/**** New in CUPS 1.3/macOS 10.5 ****/
|
||||
extern ipp_t *cupsDoIORequest(http_t *http, ipp_t *request,
|
||||
const char *resource, int infile,
|
||||
int outfile) _CUPS_API_1_3;
|
||||
@@ -444,7 +445,7 @@ extern void cupsSetDefaultDest(const char *name,
|
||||
int num_dests,
|
||||
cups_dest_t *dests) _CUPS_API_1_3;
|
||||
|
||||
/**** New in CUPS 1.4/OS X 10.6 ****/
|
||||
/**** New in CUPS 1.4/macOS 10.6 ****/
|
||||
extern ipp_status_t cupsCancelJob2(http_t *http, const char *name,
|
||||
int job_id, int purge) _CUPS_API_1_4;
|
||||
extern int cupsCreateJob(http_t *http, const char *name,
|
||||
@@ -473,14 +474,14 @@ extern http_status_t cupsStartDocument(http_t *http, const char *name,
|
||||
extern http_status_t cupsWriteRequestData(http_t *http, const char *buffer,
|
||||
size_t length) _CUPS_API_1_4;
|
||||
|
||||
/**** New in CUPS 1.5/OS X 10.7 ****/
|
||||
/**** New in CUPS 1.5/macOS 10.7 ****/
|
||||
extern void cupsSetClientCertCB(cups_client_cert_cb_t cb,
|
||||
void *user_data) _CUPS_API_1_5;
|
||||
extern int cupsSetCredentials(cups_array_t *certs) _CUPS_API_1_5;
|
||||
extern void cupsSetServerCertCB(cups_server_cert_cb_t cb,
|
||||
void *user_data) _CUPS_API_1_5;
|
||||
|
||||
/**** New in CUPS 1.6/OS X 10.8 ****/
|
||||
/**** New in CUPS 1.6/macOS 10.8 ****/
|
||||
extern ipp_status_t cupsCancelDestJob(http_t *http, cups_dest_t *dest,
|
||||
int job_id) _CUPS_API_1_6;
|
||||
extern int cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
|
||||
@@ -592,15 +593,19 @@ extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
|
||||
extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
|
||||
extern const char *cupsUserAgent(void) _CUPS_API_1_7;
|
||||
|
||||
/* New in CUPS 2.0/OS X 10.10 */
|
||||
/* New in CUPS 2.0/macOS 10.10 */
|
||||
extern cups_dest_t *cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0;
|
||||
extern const char *cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, cups_dinfo_t *info, unsigned flags, cups_size_t *size) _CUPS_API_2_0;
|
||||
extern int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date) _CUPS_API_2_0;
|
||||
extern int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0;
|
||||
|
||||
/* New in CUPS 2.2 */
|
||||
/* New in CUPS 2.2/macOS 10.12 */
|
||||
extern ssize_t cupsHashData(const char *algorithm, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_API_2_2;
|
||||
|
||||
/* New in CUPS 2.2.4 */
|
||||
extern int cupsAddIntegerOption(const char *name, int value, int num_options, cups_option_t **options) _CUPS_API_2_2_4;
|
||||
extern int cupsGetIntegerOption(const char *name, int num_options, cups_option_t *options) _CUPS_API_2_2_4;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
Arquivo binário não exibido.
|
Depois Largura: | Altura: | Tamanho: 15 KiB |
@@ -0,0 +1,994 @@
|
||||
---
|
||||
title: CUPS Programming Manual
|
||||
author: Michael R Sweet
|
||||
copyright: Copyright © 2007-2017 by Apple Inc. All Rights Reserved.
|
||||
version: 2.2.4
|
||||
...
|
||||
|
||||
> Please [file issues on Github](https://github.com/apple/cups/issues) to
|
||||
> provide feedback on this document.
|
||||
|
||||
|
||||
# Introduction
|
||||
|
||||
CUPS provides the "cups" library to talk to the different parts of CUPS and with
|
||||
Internet Printing Protocol (IPP) printers. The "cups" library functions are
|
||||
accessed by including the `<cups/cups.h>` header.
|
||||
|
||||
CUPS is based on the Internet Printing Protocol ("IPP"), which allows clients
|
||||
(applications) to communicate with a server (the scheduler, printers, etc.) to
|
||||
get a list of destinations, send print jobs, and so forth. You identify which
|
||||
server you want to communicate with using a pointer to the opaque structure
|
||||
`http_t`. The `CUPS_HTTP_DEFAULT` constant can be used when you want to talk to
|
||||
the CUPS scheduler.
|
||||
|
||||
|
||||
## Guidelines
|
||||
|
||||
When writing software that uses the "cups" library:
|
||||
|
||||
- Do not use undocumented or deprecated APIs,
|
||||
- Do not rely on pre-configured printers,
|
||||
- Do not assume that printers support specific features or formats, and
|
||||
- Do not rely on implementation details (PPDs, etc.)
|
||||
|
||||
CUPS is designed to insulate users and developers from the implementation
|
||||
details of printers and file formats. The goal is to allow an application to
|
||||
supply a print file in a standard format with the user intent ("print four
|
||||
copies, two-sided on A4 media, and staple each copy") and have the printing
|
||||
system manage the printer communication and format conversion needed.
|
||||
|
||||
Similarly, printer and job management applications can use standard query
|
||||
operations to obtain the status information in a common, generic form and use
|
||||
standard management operations to control the state of those printers and jobs.
|
||||
|
||||
|
||||
## Terms Used in This Document
|
||||
|
||||
A *Destination* is a printer or print queue that accepts print jobs. A
|
||||
*Print Job* is one or more documents that are processed by a destination
|
||||
using options supplied when creating the job. A *Document* is a file (JPEG
|
||||
image, PDF file, etc.) suitable for printing. An *Option* controls some aspect
|
||||
of printing, such as the media used. *Media* is the sheets or roll that is
|
||||
printed on. An *Attribute* is an option encoded for an Internet Printing
|
||||
Protocol (IPP) request.
|
||||
|
||||
|
||||
## Compiling Programs That Use the CUPS API
|
||||
|
||||
The CUPS libraries can be used from any C, C++, or Objective C program.
|
||||
The method of compiling against the libraries varies depending on the
|
||||
operating system and installation of CUPS. The following sections show how
|
||||
to compile a simple program (shown below) in two common environments.
|
||||
|
||||
The following simple program lists the available destinations:
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cups/cups.h>
|
||||
|
||||
int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
|
||||
{
|
||||
if (dest->instance)
|
||||
printf("%s/%s\n", dest->name, dest->instance);
|
||||
else
|
||||
puts(dest->name);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
### Compiling with Xcode
|
||||
|
||||
In Xcode, choose *New Project...* from the *File* menu (or press SHIFT+CMD+N),
|
||||
then select the *Command Line Tool* under the macOS Application project type.
|
||||
Click *Next* and enter a name for the project, for example "firstcups". Click
|
||||
*Next* and choose a project directory. The click *Next* to create the project.
|
||||
|
||||
In the project window, click on the *Build Phases* group and expand the
|
||||
*Link Binary with Libraries* section. Click *+*, type "libcups" to show the
|
||||
library, and then double-click on `libcups.tbd`.
|
||||
|
||||
Finally, click on the `main.c` file in the sidebar and copy the example program
|
||||
to the file. Build and run (CMD+R) to see the list of destinations.
|
||||
|
||||
|
||||
### Compiling with GCC
|
||||
|
||||
From the command-line, create a file called `sample.c` using your favorite
|
||||
editor, copy the example to this file, and save. Then run the following command
|
||||
to compile it with GCC and run it:
|
||||
|
||||
gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
|
||||
./simple
|
||||
|
||||
The `cups-config` command provides the compiler flags (`cups-config --cflags`)
|
||||
and libraries (`cups-config --libs`) needed for the local system.
|
||||
|
||||
|
||||
# Working with Destinations
|
||||
|
||||
Destinations, which in CUPS represent individual printers or classes
|
||||
(collections or pools) of printers, are represented by the `cups_dest_t`
|
||||
structure which includes the name \(`name`), instance \(`instance`, saved
|
||||
options/settings), whether the destination is the default for the user
|
||||
\(`is_default`), and the options and basic information associated with that
|
||||
destination \(`num_options` and `options`).
|
||||
|
||||
Historically destinations have been manually maintained by the administrator of
|
||||
a system or network, but CUPS also supports dynamic discovery of destinations on
|
||||
the current network.
|
||||
|
||||
|
||||
## Finding Available Destinations
|
||||
|
||||
The `cupsEnumDests` function finds all of the available destinations:
|
||||
|
||||
int
|
||||
cupsEnumDests(unsigned flags, int msec, int *cancel,
|
||||
cups_ptype_t type, cups_ptype_t mask,
|
||||
cups_dest_cb_t cb, void *user_data)
|
||||
|
||||
The `flags` argument specifies enumeration options, which at present must be
|
||||
`CUPS_DEST_FLAGS_NONE`.
|
||||
|
||||
The `msec` argument specifies the maximum amount of time that should be used for
|
||||
enumeration in milliseconds - interactive applications should keep this value to
|
||||
5000 or less when run on the main thread.
|
||||
|
||||
The `cancel` argument points to an integer variable that, when set to a non-zero
|
||||
value, will cause enumeration to stop as soon as possible. It can be `NULL` if
|
||||
not needed.
|
||||
|
||||
The `type` and `mask` arguments are bitfields that allow the caller to filter
|
||||
the destinations based on categories and/or capabilities. The destination's
|
||||
"printer-type" value is masked by the `mask` value and compared to the `type`
|
||||
value when filtering. For example, to only enumerate destinations that are
|
||||
hosted on the local system, pass `CUPS_PRINTER_LOCAL` for the `type` argument
|
||||
and `CUPS_PRINTER_DISCOVERED` for the `mask` argument. The following constants
|
||||
can be used for filtering:
|
||||
|
||||
- `CUPS_PRINTER_CLASS`: A collection of destinations.
|
||||
- `CUPS_PRINTER_FAX`: A facsimile device.
|
||||
- `CUPS_PRINTER_LOCAL`: A local printer or class. This constant has the value 0
|
||||
(no bits set) and is only used for the `type` argument and is paired with the
|
||||
`CUPS_PRINTER_REMOTE` or `CUPS_PRINTER_DISCOVERED` constant passed in the
|
||||
`mask` argument.
|
||||
- `CUPS_PRINTER_REMOTE`: A remote (shared) printer or class.
|
||||
- `CUPS_PRINTER_DISCOVERED`: An available network printer or class.
|
||||
- `CUPS_PRINTER_BW`: Can do B&W printing.
|
||||
- `CUPS_PRINTER_COLOR`: Can do color printing.
|
||||
- `CUPS_PRINTER_DUPLEX`: Can do two-sided printing.
|
||||
- `CUPS_PRINTER_STAPLE`: Can staple output.
|
||||
- `CUPS_PRINTER_COLLATE`: Can quickly collate copies.
|
||||
- `CUPS_PRINTER_PUNCH`: Can punch output.
|
||||
- `CUPS_PRINTER_COVER`: Can cover output.
|
||||
- `CUPS_PRINTER_BIND`: Can bind output.
|
||||
- `CUPS_PRINTER_SORT`: Can sort output (mailboxes, etc.)
|
||||
- `CUPS_PRINTER_SMALL`: Can print on Letter/Legal/A4-size media.
|
||||
- `CUPS_PRINTER_MEDIUM`: Can print on Tabloid/B/C/A3/A2-size media.
|
||||
- `CUPS_PRINTER_LARGE`: Can print on D/E/A1/A0-size media.
|
||||
- `CUPS_PRINTER_VARIABLE`: Can print on rolls and custom-size media.
|
||||
|
||||
The `cb` argument specifies a function to call for every destination that is
|
||||
found:
|
||||
|
||||
typedef int (*cups_dest_cb_t)(void *user_data,
|
||||
unsigned flags,
|
||||
cups_dest_t *dest);
|
||||
|
||||
The callback function receives a copy of the `user_data` argument along with a
|
||||
bitfield \(`flags`) and the destination that was found. The `flags` argument
|
||||
can have any of the following constant (bit) values set:
|
||||
|
||||
- `CUPS_DEST_FLAGS_MORE`: There are more destinations coming.
|
||||
- `CUPS_DEST_FLAGS_REMOVED`: The destination has gone away and should be removed
|
||||
from the list of destinations a user can select.
|
||||
- `CUPS_DEST_FLAGS_ERROR`: An error occurred. The reason for the error can be
|
||||
found by calling the `cupsLastError` and/or `cupsLastErrorString` functions.
|
||||
|
||||
The callback function returns 0 to stop enumeration or 1 to continue.
|
||||
|
||||
> Note that the callback function will likely be called multiple times for the
|
||||
> same destination, so it is up to the caller to suppress any duplicate
|
||||
> destinations.
|
||||
|
||||
The following example shows how to use `cupsEnumDests` to get a filtered array
|
||||
of destinations:
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int num_dests;
|
||||
cups_dest_t *dests;
|
||||
} my_user_data_t;
|
||||
|
||||
int
|
||||
my_dest_cb(my_user_data_t *user_data, unsigned flags,
|
||||
cups_dest_t *dest)
|
||||
{
|
||||
if (flags & CUPS_DEST_FLAGS_REMOVED)
|
||||
{
|
||||
/*
|
||||
* Remove destination from array...
|
||||
*/
|
||||
|
||||
user_data->num_dests =
|
||||
cupsRemoveDest(dest->name, dest->instance,
|
||||
user_data->num_dests,
|
||||
&(user_data->dests));
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Add destination to array...
|
||||
*/
|
||||
|
||||
user_data->num_dests =
|
||||
cupsCopyDest(dest, user_data->num_dests,
|
||||
&(user_data->dests));
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
int
|
||||
my_get_dests(cups_ptype_t type, cups_ptype_t mask,
|
||||
cups_dest_t **dests)
|
||||
{
|
||||
my_user_data_t user_data = { 0, NULL };
|
||||
|
||||
if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
|
||||
mask, (cups_dest_cb_t)my_dest_cb,
|
||||
&user_data))
|
||||
{
|
||||
/*
|
||||
* An error occurred, free all of the destinations and
|
||||
* return...
|
||||
*/
|
||||
|
||||
cupsFreeDests(user_data.num_dests, user_dasta.dests);
|
||||
|
||||
*dests = NULL;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the destination array...
|
||||
*/
|
||||
|
||||
*dests = user_data.dests;
|
||||
|
||||
return (user_data.num_dests);
|
||||
}
|
||||
|
||||
|
||||
## Basic Destination Information
|
||||
|
||||
The `num_options` and `options` members of the `cups_dest_t` structure provide
|
||||
basic attributes about the destination in addition to the user default options
|
||||
and values for that destination. The following names are predefined for various
|
||||
destination attributes:
|
||||
|
||||
- "auth-info-required": The type of authentication required for printing to this
|
||||
destination: "none", "username,password", "domain,username,password", or
|
||||
"negotiate" (Kerberos).
|
||||
- "printer-info": The human-readable description of the destination such as "My
|
||||
Laser Printer".
|
||||
- "printer-is-accepting-jobs": "true" if the destination is accepting new jobs,
|
||||
"false" otherwise.
|
||||
- "printer-is-shared": "true" if the destination is being shared with other
|
||||
computers, "false" otherwise.
|
||||
- "printer-location": The human-readable location of the destination such as
|
||||
"Lab 4".
|
||||
- "printer-make-and-model": The human-readable make and model of the destination
|
||||
such as "ExampleCorp LaserPrinter 4000 Series".
|
||||
- "printer-state": "3" if the destination is idle, "4" if the destination is
|
||||
printing a job, and "5" if the destination is stopped.
|
||||
- "printer-state-change-time": The UNIX time when the destination entered the
|
||||
current state.
|
||||
- "printer-state-reasons": Additional comma-delimited state keywords for the
|
||||
destination such as "media-tray-empty-error" and "toner-low-warning".
|
||||
- "printer-type": The `cups_ptype_t` value associated with the destination.
|
||||
- "printer-uri-supported": The URI associated with the destination; if not set,
|
||||
this destination was discovered but is not yet setup as a local printer.
|
||||
|
||||
Use the `cupsGetOption` function to retrieve the value. For example, the
|
||||
following code gets the make and model of a destination:
|
||||
|
||||
const char *model = cupsGetOption("printer-make-and-model",
|
||||
dest->num_options,
|
||||
dest->options);
|
||||
|
||||
|
||||
## Detailed Destination Information
|
||||
|
||||
Once a destination has been chosen, the `cupsCopyDestInfo` function can be used
|
||||
to gather detailed information about the destination:
|
||||
|
||||
cups_dinfo_t *
|
||||
cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
|
||||
|
||||
The `http` argument specifies a connection to the CUPS scheduler and is
|
||||
typically the constant `CUPS_HTTP_DEFAULT`. The `dest` argument specifies the
|
||||
destination to query.
|
||||
|
||||
The `cups_dinfo_t` structure that is returned contains a snapshot of the
|
||||
supported options and their supported, ready, and default values. It also can
|
||||
report constraints between different options and values, and recommend changes
|
||||
to resolve those constraints.
|
||||
|
||||
|
||||
### Getting Supported Options and Values
|
||||
|
||||
The `cupsCheckDestSupported` function can be used to test whether a particular
|
||||
option or option and value is supported:
|
||||
|
||||
int
|
||||
cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *info,
|
||||
const char *option,
|
||||
const char *value);
|
||||
|
||||
The `option` argument specifies the name of the option to check. The following
|
||||
constants can be used to check the various standard options:
|
||||
|
||||
- `CUPS_COPIES`: Controls the number of copies that are produced.
|
||||
- `CUPS_FINISHINGS`: A comma-delimited list of integer constants that control
|
||||
the finishing processes that are applied to the job, including stapling,
|
||||
punching, and folding.
|
||||
- `CUPS_MEDIA`: Controls the media size that is used, typically one of the
|
||||
following: `CUPS_MEDIA_3X5`, `CUPS_MEDIA_4X6`, `CUPS_MEDIA_5X7`,
|
||||
`CUPS_MEDIA_8X10`, `CUPS_MEDIA_A3`, `CUPS_MEDIA_A4`, `CUPS_MEDIA_A5`,
|
||||
`CUPS_MEDIA_A6`, `CUPS_MEDIA_ENV10`, `CUPS_MEDIA_ENVDL`, `CUPS_MEDIA_LEGAL`,
|
||||
`CUPS_MEDIA_LETTER`, `CUPS_MEDIA_PHOTO_L`, `CUPS_MEDIA_SUPERBA3`, or
|
||||
`CUPS_MEDIA_TABLOID`.
|
||||
- `CUPS_MEDIA_SOURCE`: Controls where the media is pulled from, typically either
|
||||
`CUPS_MEDIA_SOURCE_AUTO` or `CUPS_MEDIA_SOURCE_MANUAL`.
|
||||
- `CUPS_MEDIA_TYPE`: Controls the type of media that is used, typically one of
|
||||
the following: `CUPS_MEDIA_TYPE_AUTO`, `CUPS_MEDIA_TYPE_ENVELOPE`,
|
||||
`CUPS_MEDIA_TYPE_LABELS`, `CUPS_MEDIA_TYPE_LETTERHEAD`,
|
||||
`CUPS_MEDIA_TYPE_PHOTO`, `CUPS_MEDIA_TYPE_PHOTO_GLOSSY`,
|
||||
`CUPS_MEDIA_TYPE_PHOTO_MATTE`, `CUPS_MEDIA_TYPE_PLAIN`, or
|
||||
`CUPS_MEDIA_TYPE_TRANSPARENCY`.
|
||||
- `CUPS_NUMBER_UP`: Controls the number of document pages that are placed on
|
||||
each media side.
|
||||
- `CUPS_ORIENTATION`: Controls the orientation of document pages placed on the
|
||||
media: `CUPS_ORIENTATION_PORTRAIT` or `CUPS_ORIENTATION_LANDSCAPE`.
|
||||
- `CUPS_PRINT_COLOR_MODE`: Controls whether the output is in color
|
||||
\(`CUPS_PRINT_COLOR_MODE_COLOR`), grayscale
|
||||
\(`CUPS_PRINT_COLOR_MODE_MONOCHROME`), or either
|
||||
\(`CUPS_PRINT_COLOR_MODE_AUTO`).
|
||||
- `CUPS_PRINT_QUALITY`: Controls the generate quality of the output:
|
||||
`CUPS_PRINT_QUALITY_DRAFT`, `CUPS_PRINT_QUALITY_NORMAL`, or
|
||||
`CUPS_PRINT_QUALITY_HIGH`.
|
||||
- `CUPS_SIDES`: Controls whether prints are placed on one or both sides of the
|
||||
media: `CUPS_SIDES_ONE_SIDED`, `CUPS_SIDES_TWO_SIDED_PORTRAIT`, or
|
||||
`CUPS_SIDES_TWO_SIDED_LANDSCAPE`.
|
||||
|
||||
If the `value` argument is `NULL`, the `cupsCheckDestSupported` function returns
|
||||
whether the option is supported by the destination. Otherwise, the function
|
||||
returns whether the specified value of the option is supported.
|
||||
|
||||
The `cupsFindDestSupported` function returns the IPP attribute containing the
|
||||
supported values for a given option:
|
||||
|
||||
ipp_attribute_t *
|
||||
cupsFindDestSupported(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *dinfo,
|
||||
const char *option);
|
||||
|
||||
For example, the following code prints the supported finishing processes for a
|
||||
destination, if any, to the standard output:
|
||||
|
||||
cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
|
||||
dest);
|
||||
|
||||
if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
|
||||
CUPS_FINISHINGS, NULL))
|
||||
{
|
||||
ipp_attribute_t *finishings =
|
||||
cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
|
||||
CUPS_FINISHINGS);
|
||||
int i, count = ippGetCount(finishings);
|
||||
|
||||
puts("finishings supported:");
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %d\n", ippGetInteger(finishings, i));
|
||||
}
|
||||
else
|
||||
puts("finishings not supported.");
|
||||
|
||||
The "job-creation-attributes" option can be queried to get a list of supported
|
||||
options. For example, the following code prints the list of supported options
|
||||
to the standard output:
|
||||
|
||||
ipp_attribute_t *attrs =
|
||||
cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
|
||||
"job-creation-attributes");
|
||||
int i, count = ippGetCount(attrs);
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
puts(ippGetString(attrs, i, NULL));
|
||||
|
||||
|
||||
### Getting Default Values
|
||||
|
||||
There are two sets of default values - user defaults that are available via the
|
||||
`num_options` and `options` members of the `cups_dest_t` structure, and
|
||||
destination defaults that available via the `cups_dinfo_t` structure and the
|
||||
`cupsFindDestDefault` function which returns the IPP attribute containing the
|
||||
default value(s) for a given option:
|
||||
|
||||
ipp_attribute_t *
|
||||
cupsFindDestDefault(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *dinfo,
|
||||
const char *option);
|
||||
|
||||
The user defaults from `cupsGetOption` should always take preference over the
|
||||
destination defaults. For example, the following code prints the default
|
||||
finishings value(s) to the standard output:
|
||||
|
||||
const char *def_value =
|
||||
cupsGetOption(CUPS_FINISHINGS, dest->num_options,
|
||||
dest->options);
|
||||
ipp_attribute_t *def_attr =
|
||||
cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
|
||||
CUPS_FINISHINGS);
|
||||
|
||||
if (def_value != NULL)
|
||||
{
|
||||
printf("Default finishings: %s\n", def_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
int i, count = ippGetCount(def_attr);
|
||||
|
||||
printf("Default finishings: %d",
|
||||
ippGetInteger(def_attr, 0));
|
||||
for (i = 1; i < count; i ++)
|
||||
printf(",%d", ippGetInteger(def_attr, i));
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
|
||||
### Getting Ready (Loaded) Values
|
||||
|
||||
The finishings and media options also support queries for the ready, or loaded,
|
||||
values. For example, a printer may have punch and staple finishers installed
|
||||
but be out of staples - the supported values will list both punch and staple
|
||||
finishing processes but the ready values will only list the punch processes.
|
||||
Similarly, a printer may support hundreds of different sizes of media but only
|
||||
have a single size loaded at any given time - the ready values are limited to
|
||||
the media that is actually in the printer.
|
||||
|
||||
The `cupsFindDestReady` function finds the IPP attribute containing the ready
|
||||
values for a given option:
|
||||
|
||||
ipp_attribute_t *
|
||||
cupsFindDestReady(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *dinfo, const char *option);
|
||||
|
||||
For example, the following code lists the ready finishing processes:
|
||||
|
||||
ipp_attribute_t *ready_finishings =
|
||||
cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
|
||||
CUPS_FINISHINGS);
|
||||
|
||||
if (ready_finishings != NULL)
|
||||
{
|
||||
int i, count = ippGetCount(ready_finishings);
|
||||
|
||||
puts("finishings ready:");
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %d\n", ippGetInteger(ready_finishings, i));
|
||||
}
|
||||
else
|
||||
puts("no finishings are ready.");
|
||||
|
||||
|
||||
### Media Size Options
|
||||
|
||||
CUPS provides functions for querying the dimensions and margins for each of the
|
||||
supported media size options. The `cups_size_t` structure is used to describe a
|
||||
media size:
|
||||
|
||||
typedef struct cups_size_s
|
||||
{
|
||||
char media[128];
|
||||
int width, length;
|
||||
int bottom, left, right, top;
|
||||
} cups_size_t;
|
||||
|
||||
The `width` and `length` members specify the dimensions of the media in
|
||||
hundredths of millimeters (1/2540th of an inch). The `bottom`, `left`, `right`,
|
||||
and `top` members specify the margins of the printable area, also in hundredths
|
||||
of millimeters.
|
||||
|
||||
The `cupsGetDestMediaByName` and `cupsGetDestMediaBySize` functions lookup the
|
||||
media size information using a standard media size name or dimensions in
|
||||
hundredths of millimeters:
|
||||
|
||||
int
|
||||
cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *dinfo,
|
||||
const char *media,
|
||||
unsigned flags, cups_size_t *size);
|
||||
|
||||
int
|
||||
cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *dinfo,
|
||||
int width, int length,
|
||||
unsigned flags, cups_size_t *size);
|
||||
|
||||
The `media`, `width`, and `length` arguments specify the size to lookup. The
|
||||
`flags` argument specifies a bitfield controlling various lookup options:
|
||||
|
||||
- `CUPS_MEDIA_FLAGS_DEFAULT`: Find the closest size supported by the printer.
|
||||
- `CUPS_MEDIA_FLAGS_BORDERLESS`: Find a borderless size.
|
||||
- `CUPS_MEDIA_FLAGS_DUPLEX`: Find a size compatible with two-sided printing.
|
||||
- `CUPS_MEDIA_FLAGS_EXACT`: Find an exact match for the size.
|
||||
- `CUPS_MEDIA_FLAGS_READY`: If the printer supports media sensing or
|
||||
configuration of the media in each tray/source, find the size amongst the
|
||||
"ready" media.
|
||||
|
||||
If a matching size is found for the destination, the size information is stored
|
||||
in the structure pointed to by the `size` argument and 1 is returned. Otherwise
|
||||
0 is returned.
|
||||
|
||||
For example, the following code prints the margins for two-sided printing on US
|
||||
Letter media:
|
||||
|
||||
cups_size_t size;
|
||||
|
||||
if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
|
||||
CUPS_MEDIA_LETTER,
|
||||
CUPS_MEDIA_FLAGS_DUPLEX, &size))
|
||||
{
|
||||
puts("Margins for duplex US Letter:");
|
||||
printf(" Bottom: %.2fin\n", size.bottom / 2540.0);
|
||||
printf(" Left: %.2fin\n", size.left / 2540.0);
|
||||
printf(" Right: %.2fin\n", size.right / 2540.0);
|
||||
printf(" Top: %.2fin\n", size.top / 2540.0);
|
||||
}
|
||||
else
|
||||
puts("Margins for duplex US Letter are not available.");
|
||||
|
||||
You can also enumerate all of the sizes that match a given `flags` value using
|
||||
the `cupsGetDestMediaByIndex` and `cupsGetDestMediaCount` functions:
|
||||
|
||||
int
|
||||
cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *dinfo, int n,
|
||||
unsigned flags, cups_size_t *size);
|
||||
|
||||
int
|
||||
cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *dinfo, unsigned flags);
|
||||
|
||||
For example, the following code prints the list of ready media and corresponding
|
||||
margins:
|
||||
|
||||
cups_size_t size;
|
||||
int i;
|
||||
int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
|
||||
dest, info,
|
||||
CUPS_MEDIA_FLAGS_READY);
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
|
||||
i, CUPS_MEDIA_FLAGS_READY,
|
||||
&size))
|
||||
{
|
||||
printf("%s:\n", size.name);
|
||||
printf(" Width: %.2fin\n", size.width / 2540.0);
|
||||
printf(" Length: %.2fin\n", size.length / 2540.0);
|
||||
printf(" Bottom: %.2fin\n", size.bottom / 2540.0);
|
||||
printf(" Left: %.2fin\n", size.left / 2540.0);
|
||||
printf(" Right: %.2fin\n", size.right / 2540.0);
|
||||
printf(" Top: %.2fin\n", size.top / 2540.0);
|
||||
}
|
||||
}
|
||||
|
||||
Finally, the `cupsGetDestMediaDefault` function returns the default media size:
|
||||
|
||||
int
|
||||
cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *dinfo, unsigned flags,
|
||||
cups_size_t *size);
|
||||
|
||||
|
||||
### Localizing Options and Values
|
||||
|
||||
CUPS provides three functions to get localized, human-readable strings in the
|
||||
user's current locale for options and values: `cupsLocalizeDestMedia`,
|
||||
`cupsLocalizeDestOption`, and `cupsLocalizeDestValue`:
|
||||
|
||||
const char *
|
||||
cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *info, unsigned flags,
|
||||
cups_size_t *size);
|
||||
|
||||
const char *
|
||||
cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *info,
|
||||
const char *option);
|
||||
|
||||
const char *
|
||||
cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *info,
|
||||
const char *option, const char *value);
|
||||
|
||||
|
||||
## Submitting a Print Job
|
||||
|
||||
Once you are ready to submit a print job, you create a job using the
|
||||
`cupsCreateDestJob` function:
|
||||
|
||||
ipp_status_t
|
||||
cupsCreateDestJob(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *info, int *job_id,
|
||||
const char *title, int num_options,
|
||||
cups_option_t *options);
|
||||
|
||||
The `title` argument specifies a name for the print job such as "My Document".
|
||||
The `num_options` and `options` arguments specify the options for the print
|
||||
job which are allocated using the `cupsAddOption` function.
|
||||
|
||||
When successful, the job's numeric identifier is stored in the integer pointed
|
||||
to by the `job_id` argument and `IPP_STATUS_OK` is returned. Otherwise, an IPP
|
||||
error status is returned.
|
||||
|
||||
For example, the following code creates a new job that will print 42 copies of a
|
||||
two-sided US Letter document:
|
||||
|
||||
int job_id = 0;
|
||||
int num_options = 0;
|
||||
cups_option_t *options = NULL;
|
||||
|
||||
num_options = cupsAddOption(CUPS_COPIES, "42",
|
||||
num_options, &options);
|
||||
num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
|
||||
num_options, &options);
|
||||
num_options = cupsAddOption(CUPS_SIDES,
|
||||
CUPS_SIDES_TWO_SIDED_PORTRAIT,
|
||||
num_options, &options);
|
||||
|
||||
if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
|
||||
&job_id, "My Document", num_options,
|
||||
options) == IPP_STATUS_OK)
|
||||
printf("Created job: %d\n", job_id);
|
||||
else
|
||||
printf("Unable to create job: %s\n",
|
||||
cupsLastErrorString());
|
||||
|
||||
Once the job is created, you submit documents for the job using the
|
||||
`cupsStartDestDocument`, `cupsWriteRequestData`, and `cupsFinishDestDocument`
|
||||
functions:
|
||||
|
||||
http_status_t
|
||||
cupsStartDestDocument(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *info, int job_id,
|
||||
const char *docname,
|
||||
const char *format,
|
||||
int num_options,
|
||||
cups_option_t *options,
|
||||
int last_document);
|
||||
|
||||
http_status_t
|
||||
cupsWriteRequestData(http_t *http, const char *buffer,
|
||||
size_t length);
|
||||
|
||||
ipp_status_t
|
||||
cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
|
||||
cups_dinfo_t *info);
|
||||
|
||||
The `docname` argument specifies the name of the document, typically the
|
||||
original filename. The `format` argument specifies the MIME media type of the
|
||||
document, including the following constants:
|
||||
|
||||
- `CUPS_FORMAT_JPEG`: "image/jpeg"
|
||||
- `CUPS_FORMAT_PDF`: "application/pdf"
|
||||
- `CUPS_FORMAT_POSTSCRIPT`: "application/postscript"
|
||||
- `CUPS_FORMAT_TEXT`: "text/plain"
|
||||
|
||||
The `num_options` and `options` arguments specify per-document print options,
|
||||
which at present must be 0 and `NULL`. The `last_document` argument specifies
|
||||
whether this is the last document in the job.
|
||||
|
||||
For example, the following code submits a PDF file to the job that was just
|
||||
created:
|
||||
|
||||
FILE *fp = fopen("filename.pdf", "rb");
|
||||
size_t bytes;
|
||||
char buffer[65536];
|
||||
|
||||
if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
|
||||
job_id, "filename.pdf", 0, NULL,
|
||||
1) == HTTP_STATUS_CONTINUE)
|
||||
{
|
||||
while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
|
||||
if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
|
||||
bytes) != HTTP_STATUS_CONTINUE)
|
||||
break;
|
||||
|
||||
if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
|
||||
info) == IPP_STATUS_OK)
|
||||
puts("Document send succeeded.");
|
||||
else
|
||||
printf("Document send failed: %s\n",
|
||||
cupsLastErrorString());
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
|
||||
# Sending IPP Requests
|
||||
|
||||
CUPS provides a rich API for sending IPP requests to the scheduler or printers,
|
||||
typically from management or utility applications whose primary purpose is not
|
||||
to send print jobs.
|
||||
|
||||
|
||||
## Connecting to the Scheduler or Printer
|
||||
|
||||
The connection to the scheduler or printer is represented by the HTTP connection
|
||||
type `http_t`. The `cupsConnectDest` function connects to the scheduler or
|
||||
printer associated with the destination:
|
||||
|
||||
http_t *
|
||||
cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec,
|
||||
int *cancel, char *resource,
|
||||
size_t resourcesize, cups_dest_cb_t cb,
|
||||
void *user_data);
|
||||
|
||||
The `dest` argument specifies the destination to connect to.
|
||||
|
||||
The `flags` argument specifies whether you want to connect to the scheduler
|
||||
(`CUPS_DEST_FLAGS_NONE`) or device/printer (`CUPS_DEST_FLAGS_DEVICE`) associated
|
||||
with the destination.
|
||||
|
||||
The `msec` argument specifies how long you are willing to wait for the
|
||||
connection to be established in milliseconds. Specify a value of `-1` to wait
|
||||
indefinitely.
|
||||
|
||||
The `cancel` argument specifies the address of an integer variable that can be
|
||||
set to a non-zero value to cancel the connection. Specify a value of `NULL`
|
||||
to not provide a cancel variable.
|
||||
|
||||
The `resource` and `resourcesize` arguments specify the address and size of a
|
||||
character string array to hold the path to use when sending an IPP request.
|
||||
|
||||
The `cb` and `user_data` arguments specify a destination callback function that
|
||||
returns 1 to continue connecting or 0 to stop. The destination callback work
|
||||
the same way as the one used for the `cupsEnumDests` function.
|
||||
|
||||
On success, a HTTP connection is returned that can be used to send IPP requests
|
||||
and get IPP responses.
|
||||
|
||||
For example, the following code connects to the printer associated with a
|
||||
destination with a 30 second timeout:
|
||||
|
||||
char resource[256];
|
||||
http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE,
|
||||
30000, NULL, resource,
|
||||
sizeof(resource), NULL, NULL);
|
||||
|
||||
|
||||
## Creating an IPP Request
|
||||
|
||||
IPP requests are represented by the IPP message type `ipp_t` and each IPP
|
||||
attribute in the request is representing using the type `ipp_attribute_t`. Each
|
||||
IPP request includes an operation code (`IPP_OP_CREATE_JOB`,
|
||||
`IPP_OP_GET_PRINTER_ATTRIBUTES`, etc.) and a 32-bit integer identifier.
|
||||
|
||||
The `ippNewRequest` function creates a new IPP request:
|
||||
|
||||
ipp_t *
|
||||
ippNewRequest(ipp_op_t op);
|
||||
|
||||
The `op` argument specifies the IPP operation code for the request. For
|
||||
example, the following code creates an IPP Get-Printer-Attributes request:
|
||||
|
||||
ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
|
||||
The request identifier is automatically set to a unique value for the current
|
||||
process.
|
||||
|
||||
Each IPP request starts with two IPP attributes, "attributes-charset" and
|
||||
"attributes-natural-language", followed by IPP attribute(s) that specify the
|
||||
target of the operation. The `ippNewRequest` automatically adds the correct
|
||||
"attributes-charset" and "attributes-natural-language" attributes, but you must
|
||||
add the target attribute(s). For example, the following code adds the
|
||||
"printer-uri" attribute to the IPP Get-Printer-Attributes request to specify
|
||||
which printer is being queried:
|
||||
|
||||
const char *printer_uri = cupsGetOption("device-uri",
|
||||
dest->num_options,
|
||||
dest->options);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
|
||||
"printer-uri", NULL, printer_uri);
|
||||
|
||||
> Note: If we wanted to query the scheduler instead of the device, we would look
|
||||
> up the "printer-uri-supported" option instead of the "device-uri" value.
|
||||
|
||||
The `ippAddString` function adds the "printer-uri" attribute the the IPP
|
||||
request. The `IPP_TAG_OPERATION` argument specifies that the attribute is part
|
||||
of the operation. The `IPP_TAG_URI` argument specifies that the value is a
|
||||
Universal Resource Identifier (URI) string. The `NULL` argument specifies there
|
||||
is no language (English, French, Japanese, etc.) associated with the string, and
|
||||
the `printer_uri` argument specifies the string value.
|
||||
|
||||
The IPP Get-Printer-Attributes request also supports an IPP attribute called
|
||||
"requested-attributes" that lists the attributes and values you are interested
|
||||
in. For example, the following code requests the printer state attributes:
|
||||
|
||||
static const char * const requested_attributes[] =
|
||||
{
|
||||
"printer-state",
|
||||
"printer-state-message",
|
||||
"printer-state-reasons"
|
||||
};
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", 3, NULL,
|
||||
requested_attributes);
|
||||
|
||||
The `ippAddStrings` function adds an attribute with one or more strings, in this
|
||||
case three. The `IPP_TAG_KEYWORD` argument specifies that the strings are
|
||||
keyword values, which are used for attribute names. All strings use the same
|
||||
language (`NULL`), and the attribute will contain the three strings in the
|
||||
array `requested_attributes`.
|
||||
|
||||
CUPS provides many functions to adding attributes of different types:
|
||||
|
||||
- `ippAddBoolean` adds a boolean (`IPP_TAG_BOOLEAN`) attribute with one value.
|
||||
- `ippAddInteger` adds an enum (`IPP_TAG_ENUM`) or integer (`IPP_TAG_INTEGER`)
|
||||
attribute with one value.
|
||||
- `ippAddIntegers` adds an enum or integer attribute with one or more values.
|
||||
- `ippAddOctetString` adds an octetString attribute with one value.
|
||||
- `ippAddOutOfBand` adds a admin-defined (`IPP_TAG_ADMINDEFINE`), default
|
||||
(`IPP_TAG_DEFAULT`), delete-attribute (`IPP_TAG_DELETEATTR`), no-value
|
||||
(`IPP_TAG_NOVALUE`), not-settable (`IPP_TAG_NOTSETTABLE`), unknown
|
||||
(`IPP_TAG_UNKNOWN`), or unsupported (`IPP_TAG_UNSUPPORTED_VALUE`) out-of-band
|
||||
attribute.
|
||||
- `ippAddRange` adds a rangeOfInteger attribute with one range.
|
||||
- `ippAddRanges` adds a rangeOfInteger attribute with one or more ranges.
|
||||
- `ippAddResolution` adds a resolution attribute with one resolution.
|
||||
- `ippAddResolutions` adds a resolution attribute with one or more resolutions.
|
||||
- `ippAddString` adds a charset (`IPP_TAG_CHARSET`), keyword (`IPP_TAG_KEYWORD`),
|
||||
mimeMediaType (`IPP_TAG_MIMETYPE`), name (`IPP_TAG_NAME` and
|
||||
`IPP_TAG_NAMELANG`), naturalLanguage (`IPP_TAG_NATURAL_LANGUAGE`), text
|
||||
(`IPP_TAG_TEXT` and `IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), or uriScheme
|
||||
(`IPP_TAG_URISCHEME`) attribute with one value.
|
||||
- `ippAddStrings` adds a charset, keyword, mimeMediaType, name, naturalLanguage,
|
||||
text, uri, or uriScheme attribute with one or more values.
|
||||
|
||||
|
||||
## Sending the IPP Request
|
||||
|
||||
Once you have created the IPP request, you can send it using the
|
||||
`cupsDoRequest` function. For example, the following code sends the IPP
|
||||
Get-Printer-Attributes request to the destination and saves the response:
|
||||
|
||||
ipp_t *response = cupsDoRequest(http, request, resource);
|
||||
|
||||
For requests like Send-Document that include a file, the `cupsDoFileRequest`
|
||||
function should be used:
|
||||
|
||||
ipp_t *response = cupsDoFileRequest(http, request, resource,
|
||||
filename);
|
||||
|
||||
Both `cupsDoRequest` and `cupsDoFileRequest` free the IPP request. If a valid
|
||||
IPP response is received, it is stored in a new IPP message (`ipp_t`) and
|
||||
returned to the caller. Otherwise `NULL` is returned.
|
||||
|
||||
The status from the most recent request can be queried using the `cupsLastError`
|
||||
function, for example:
|
||||
|
||||
if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST)
|
||||
{
|
||||
/* request failed */
|
||||
}
|
||||
|
||||
A human-readable error message is also available using the `cupsLastErrorString`
|
||||
function:
|
||||
|
||||
if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST)
|
||||
{
|
||||
/* request failed */
|
||||
printf("Request failed: %s\n", cupsLastErrorString());
|
||||
}
|
||||
|
||||
|
||||
## Processing the IPP Response
|
||||
|
||||
Each response to an IPP request is also an IPP message (`ipp_t`) with its own
|
||||
IPP attributes (`ipp_attribute_t`) that includes a status code (`IPP_STATUS_OK`,
|
||||
`IPP_STATUS_ERROR_BAD_REQUEST`, etc.) and the corresponding 32-bit integer
|
||||
identifier from the request.
|
||||
|
||||
For example, the following code finds the printer state attributes and prints
|
||||
their values:
|
||||
|
||||
ipp_attribute_t *attr;
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state",
|
||||
IPP_TAG_ENUM)) != NULL)
|
||||
{
|
||||
printf("printer-state=%s\n",
|
||||
ippTagString("printer-state", ippGetInteger(attr, 0)));
|
||||
}
|
||||
else
|
||||
puts("printer-state=unknown");
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state-message",
|
||||
IPP_TAG_TEXT)) != NULL)
|
||||
{
|
||||
printf("printer-state-message=\"%s\"\n",
|
||||
ippGetString(attr, 0, NULL)));
|
||||
}
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state-reasons",
|
||||
IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
int i, count = ippGetCount(attr);
|
||||
|
||||
puts("printer-state-reasons=");
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %s\n", ippGetString(attr, i, NULL)));
|
||||
}
|
||||
|
||||
The `ippGetCount` function returns the number of values in an attribute.
|
||||
|
||||
The `ippGetInteger` and `ippGetString` functions return a single integer or
|
||||
string value from an attribute.
|
||||
|
||||
The `ippTagString` function converts a enum value to its keyword (string)
|
||||
equivalent.
|
||||
|
||||
Once you are done using the IPP response message, free it using the `ippDelete`
|
||||
function:
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
|
||||
## Authentication
|
||||
|
||||
CUPS normally handles authentication through the console. GUI applications
|
||||
should set a password callback using the `cupsSetPasswordCB2` function:
|
||||
|
||||
void
|
||||
cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
|
||||
|
||||
The password callback will be called when needed and is responsible for setting
|
||||
the current user name using `cupsSetUser` and returning a string:
|
||||
|
||||
const char *
|
||||
cups_password_cb2(const char *prompt, http_t *http,
|
||||
const char *method, const char *resource,
|
||||
void *user_data);
|
||||
|
||||
The `prompt` argument is a string from CUPS that should be displayed to the
|
||||
user.
|
||||
|
||||
The `http` argument is the connection hosting the request that is being
|
||||
authenticated. The password callback can call the `httpGetField` and
|
||||
`httpGetSubField` functions to look for additional details concerning the
|
||||
authentication challenge.
|
||||
|
||||
The `method` argument specifies the HTTP method used for the request and is
|
||||
typically "POST".
|
||||
|
||||
The `resource` argument specifies the path used for the request.
|
||||
|
||||
The `user_data` argument provides the user data pointer from the
|
||||
`cupsSetPasswordCB2` call.
|
||||
Arquivo binário não exibido.
Arquivo binário não exibido.
|
Depois Largura: | Altura: | Tamanho: 166 KiB |
@@ -8,7 +8,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
+37
-9
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* Destination job support for CUPS.
|
||||
*
|
||||
* Copyright 2012-2016 by Apple Inc.
|
||||
* Copyright 2012-2017 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -25,13 +25,13 @@
|
||||
* The "job_id" is the number returned by cupsCreateDestJob.
|
||||
*
|
||||
* Returns @code IPP_STATUS_OK@ on success and
|
||||
* @code IPP_STATUS_ERRPR_NOT_AUTHORIZED@ or
|
||||
* @code IPP_STATUS_ERROR_NOT_AUTHORIZED@ or
|
||||
* @code IPP_STATUS_ERROR_FORBIDDEN@ on failure.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
ipp_status_t
|
||||
ipp_status_t /* O - Status of cancel operation */
|
||||
cupsCancelDestJob(http_t *http, /* I - Connection to destination */
|
||||
cups_dest_t *dest, /* I - Destination */
|
||||
int job_id) /* I - Job ID */
|
||||
@@ -66,7 +66,7 @@ cupsCancelDestJob(http_t *http, /* I - Connection to destination */
|
||||
* "job_id" is the job ID returned by cupsCreateDestJob. Returns @code IPP_STATUS_OK@
|
||||
* on success.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
ipp_status_t /* O - IPP status code */
|
||||
@@ -83,6 +83,13 @@ cupsCloseDestJob(
|
||||
|
||||
DEBUG_printf(("cupsCloseDestJob(http=%p, dest=%p(%s/%s), info=%p, job_id=%d)", (void *)http, (void *)dest, dest ? dest->name : NULL, dest ? dest->instance : NULL, (void *)info, job_id));
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -150,7 +157,7 @@ cupsCloseDestJob(
|
||||
* Returns @code IPP_STATUS_OK@ or @code IPP_STATUS_OK_SUBST@ on success, saving the job ID
|
||||
* in the variable pointed to by "job_id".
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
ipp_status_t /* O - IPP status code */
|
||||
@@ -171,6 +178,13 @@ cupsCreateDestJob(
|
||||
DEBUG_printf(("cupsCreateDestJob(http=%p, dest=%p(%s/%s), info=%p, "
|
||||
"job_id=%p, title=\"%s\", num_options=%d, options=%p)", (void *)http, (void *)dest, dest ? dest->name : NULL, dest ? dest->instance : NULL, (void *)info, (void *)job_id, title, num_options, (void *)options));
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -240,7 +254,7 @@ cupsCreateDestJob(
|
||||
*
|
||||
* Returns @code IPP_STATUS_OK@ or @code IPP_STATUS_OK_SUBST@ on success.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
ipp_status_t /* O - Status of document submission */
|
||||
@@ -251,6 +265,13 @@ cupsFinishDestDocument(
|
||||
{
|
||||
DEBUG_printf(("cupsFinishDestDocument(http=%p, dest=%p(%s/%s), info=%p)", (void *)http, (void *)dest, dest ? dest->name : NULL, dest ? dest->instance : NULL, (void *)info));
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -285,7 +306,7 @@ cupsFinishDestDocument(
|
||||
* if this is the last document to be submitted in the job. Returns
|
||||
* @code HTTP_CONTINUE@ on success.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
http_status_t /* O - Status of document creation */
|
||||
@@ -306,6 +327,13 @@ cupsStartDestDocument(
|
||||
|
||||
DEBUG_printf(("cupsStartDestDocument(http=%p, dest=%p(%s/%s), info=%p, job_id=%d, docname=\"%s\", format=\"%s\", num_options=%d, options=%p, last_document=%d)", (void *)http, (void *)dest, dest ? dest->name : NULL, dest ? dest->instance : NULL, (void *)info, job_id, docname, format, num_options, (void *)options, last_document));
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ static char *cups_scan_strings(char *buffer);
|
||||
* The returned string is stored in the destination information and will become
|
||||
* invalid if the destination information is deleted.
|
||||
*
|
||||
* @since CUPS 2.0/OS X 10.10@
|
||||
* @since CUPS 2.0/macOS 10.10@
|
||||
*/
|
||||
|
||||
const char * /* O - Localized string */
|
||||
@@ -200,7 +200,7 @@ cupsLocalizeDestMedia(
|
||||
* The returned string is stored in the destination information and will become
|
||||
* invalid if the destination information is deleted.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
const char * /* O - Localized string */
|
||||
@@ -239,7 +239,7 @@ cupsLocalizeDestOption(
|
||||
* The returned string is stored in the destination information and will become
|
||||
* invalid if the destination information is deleted.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
const char * /* O - Localized string */
|
||||
|
||||
+98
-16
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* Destination option/media support for CUPS.
|
||||
*
|
||||
* Copyright 2012-2016 by Apple Inc.
|
||||
* Copyright 2012-2017 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/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -64,7 +64,7 @@ static void cups_update_ready(http_t *http, cups_dinfo_t *dinfo);
|
||||
*
|
||||
* Returns 1 if supported, 0 otherwise.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
int /* O - 1 if supported, 0 otherwise */
|
||||
@@ -73,7 +73,7 @@ cupsCheckDestSupported(
|
||||
cups_dest_t *dest, /* I - Destination */
|
||||
cups_dinfo_t *dinfo, /* I - Destination information */
|
||||
const char *option, /* I - Option */
|
||||
const char *value) /* I - Value */
|
||||
const char *value) /* I - Value or @code NULL@ */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char temp[1024]; /* Temporary string */
|
||||
@@ -85,11 +85,18 @@ cupsCheckDestSupported(
|
||||
_ipp_value_t *attrval; /* Current attribute value */
|
||||
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!http || !dest || !dinfo || !option || !value)
|
||||
if (!http || !dest || !dinfo || !option)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -107,7 +114,10 @@ cupsCheckDestSupported(
|
||||
if (!attr)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
if (!value)
|
||||
return (1);
|
||||
|
||||
/*
|
||||
* Compare values...
|
||||
*/
|
||||
|
||||
@@ -261,7 +271,7 @@ cupsCheckDestSupported(
|
||||
* If cupsCopyDestConflicts returns 1 but "num_resolved" and "resolved" are set
|
||||
* to 0 and @code NULL@, respectively, then the conflict cannot be resolved.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
int /* O - 1 if there is a conflict, 0 if none, -1 on error */
|
||||
@@ -315,6 +325,13 @@ cupsCopyDestConflicts(
|
||||
if (resolved)
|
||||
*resolved = NULL;
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -546,7 +563,7 @@ cupsCopyDestConflicts(
|
||||
* The caller is responsible for calling @link cupsFreeDestInfo@ on the return
|
||||
* value. @code NULL@ is returned on error.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
cups_dinfo_t * /* O - Destination information */
|
||||
@@ -574,6 +591,13 @@ cupsCopyDestInfo(
|
||||
|
||||
DEBUG_printf(("cupsCopyDestSupported(http=%p, dest=%p(%s))", (void *)http, (void *)dest, dest ? dest->name : ""));
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -672,7 +696,7 @@ cupsCopyDestInfo(
|
||||
* @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
|
||||
* functions to inspect the default value(s) as needed.
|
||||
*
|
||||
* @since CUPS 1.7/OS X 10.9@
|
||||
* @since CUPS 1.7/macOS 10.9@
|
||||
*/
|
||||
|
||||
ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
|
||||
@@ -685,6 +709,13 @@ cupsFindDestDefault(
|
||||
char name[IPP_MAX_NAME]; /* Attribute name */
|
||||
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -713,7 +744,7 @@ cupsFindDestDefault(
|
||||
* @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
|
||||
* functions to inspect the default value(s) as needed.
|
||||
*
|
||||
* @since CUPS 1.7/OS X 10.9@
|
||||
* @since CUPS 1.7/macOS 10.9@
|
||||
*/
|
||||
|
||||
ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
|
||||
@@ -726,6 +757,13 @@ cupsFindDestReady(
|
||||
char name[IPP_MAX_NAME]; /* Attribute name */
|
||||
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -756,7 +794,7 @@ cupsFindDestReady(
|
||||
* @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
|
||||
* functions to inspect the default value(s) as needed.
|
||||
*
|
||||
* @since CUPS 1.7/OS X 10.9@
|
||||
* @since CUPS 1.7/macOS 10.9@
|
||||
*/
|
||||
|
||||
ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
|
||||
@@ -769,6 +807,13 @@ cupsFindDestSupported(
|
||||
char name[IPP_MAX_NAME]; /* Attribute name */
|
||||
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -791,6 +836,8 @@ cupsFindDestSupported(
|
||||
/*
|
||||
* 'cupsFreeDestInfo()' - Free destination information obtained using
|
||||
* @link cupsCopyDestInfo@.
|
||||
*
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -835,7 +882,7 @@ cupsFreeDestInfo(cups_dinfo_t *dinfo) /* I - Destination information */
|
||||
* example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will get the Nth
|
||||
* borderless size supported by the printer.
|
||||
*
|
||||
* @since CUPS 1.7/OS X 10.9@
|
||||
* @since CUPS 1.7/macOS 10.9@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -851,6 +898,13 @@ cupsGetDestMediaByIndex(
|
||||
pwg_media_t *pwg; /* PWG media name for size */
|
||||
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -924,7 +978,7 @@ cupsGetDestMediaByIndex(
|
||||
*
|
||||
* Returns 1 when there is a match and 0 if there is not a match.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
int /* O - 1 on match, 0 on failure */
|
||||
@@ -939,6 +993,13 @@ cupsGetDestMediaByName(
|
||||
pwg_media_t *pwg; /* PWG media info */
|
||||
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -989,7 +1050,7 @@ cupsGetDestMediaByName(
|
||||
*
|
||||
* Returns 1 when there is a match and 0 if there is not a match.
|
||||
*
|
||||
* @since CUPS 1.6/OS X 10.8@
|
||||
* @since CUPS 1.6/macOS 10.8@
|
||||
*/
|
||||
|
||||
int /* O - 1 on match, 0 on failure */
|
||||
@@ -1007,6 +1068,13 @@ cupsGetDestMediaBySize(
|
||||
pwg_media_t *pwg; /* PWG media info */
|
||||
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -1048,7 +1116,7 @@ cupsGetDestMediaBySize(
|
||||
* counted. For example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will return
|
||||
* the number of borderless sizes.
|
||||
*
|
||||
* @since CUPS 1.7/OS X 10.9@
|
||||
* @since CUPS 1.7/macOS 10.9@
|
||||
*/
|
||||
|
||||
int /* O - Number of sizes */
|
||||
@@ -1058,6 +1126,13 @@ cupsGetDestMediaCount(
|
||||
cups_dinfo_t *dinfo, /* I - Destination information */
|
||||
unsigned flags) /* I - Media flags */
|
||||
{
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -1089,7 +1164,7 @@ cupsGetDestMediaCount(
|
||||
* example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will return the default
|
||||
* borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
|
||||
*
|
||||
* @since CUPS 1.7/OS X 10.9@
|
||||
* @since CUPS 1.7/macOS 10.9@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -1103,6 +1178,13 @@ cupsGetDestMediaDefault(
|
||||
const char *media; /* Default media size */
|
||||
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
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