Comparar commits

...

180 Commits

Autor SHA1 Mensagem Data
Michael R Sweet 1539283f98 Bump version to 2.3b6, changelog. 2018-06-05 14:46:51 -04:00
Michael R Sweet a6dd739c02 Make sure all incoming value tags are treated the same as freed values. 2018-06-05 14:46:50 -04:00
Michael R Sweet 929486aa64 Fix link to CUPS Programming Manual. 2018-06-05 14:46:50 -04:00
Michael R Sweet 579a5525e8 Update versions in README and INSTALL 2018-06-05 14:46:50 -04:00
Michael R Sweet f66b1d85f8 Update documentation and localization files for 2.3b5 release. 2018-06-05 14:46:50 -04:00
Michael R Sweet 2c4c9ada65 Changelog. 2018-06-05 14:46:50 -04:00
Michael R Sweet e1ac3f36d0 Fix a parsing bug in the pstops filter (Issue #5321) 2018-06-05 14:46:49 -04:00
Michael R Sweet c95282ef08 Changelog. 2018-06-05 14:46:49 -04:00
Michael R Sweet 9e838da3db Add a USB quirks rule for the HP LaserJet P1102 (Issue #5310) 2018-06-05 14:46:49 -04:00
Michael R Sweet 0d92ec1c6f Fix local privilege escalation to root and sandbox bypasses in scheduler
(rdar://37836779, rdar://37836995, rdar://37837252, rdar://37837581)
2018-06-05 14:46:49 -04:00
Michael R Sweet beb37da67b Validate notify-recipient-uri values. 2018-06-05 14:46:49 -04:00
Michael R Sweet fd32084d40 Block invalid group tags when parsing IPP messages. 2018-06-05 14:46:49 -04:00
Nils Van Zuijlen ac9e295f23 Correct typos for French_France 2018-06-05 14:46:48 -04:00
Michael R Sweet 778759a48f Add smb test URI. 2018-06-05 14:46:48 -04:00
Michael R Sweet ac79576a7f Add more URI validation for scheme. 2018-06-05 14:46:48 -04:00
Michael R Sweet 76d2c4481f Save work. 2018-05-18 17:10:36 -07:00
Michael R Sweet 1660d61202 Update xform_setup. 2018-05-18 14:46:34 -07:00
Michael R Sweet 3eb5ec664f Fix compile errors. 2018-05-18 12:53:46 -07:00
Michael R Sweet a17ce1d474 Save work. 2018-05-18 08:36:39 -07:00
Michael R Sweet 1e01455aeb Save initial work on private xform API. 2018-05-14 17:03:24 -07:00
Michael R Sweet 5c2c2ab6a3 Fix cupsJobPassword documentation. 2018-05-14 10:26:55 -07:00
Michael R Sweet 06a5a4d332 Mark cupsGetDevices as deprecated.
Update CUPS Programming Manual.

Update CUPS Admin API documentation.

Update CUPS PPD documentation.
2018-05-14 10:21:51 -07:00
Michael R Sweet 4cadd6202f Mirror validation changes from 2.2 branch. 2018-05-11 12:10:32 -07:00
Michael R Sweet 2de7c5f81c Update changelog, copyright... 2018-05-11 10:25:39 -07:00
Michael R Sweet 8127ebd190 Merge pull request #5312 from hansmi/mailtowait1
mailto: Wait for server opening message
2018-05-11 10:19:47 -07:00
Michael R Sweet e5fee178d9 Always use Negotiate or PeerCred for Kerberized printing. 2018-05-10 16:35:37 -04:00
Michael Hanselmann 077bd665bd mailto: Wait for server opening message
A subset of all mailserver configurations reject SMTP sessions where the
client sends anything before the server sent its opening message. This
is the case with Exim on Ubuntu Artful, for example:

  SMTP protocol synchronization error (input sent without waiting for
  greeting)

Not waiting for the opening message is a violation of the session
initiation described in RFC5321 (section 3.1). Update the mailto
notifier to wait for a non-error status code from the server before
proceeding to start the mail transaction.
2018-05-09 01:26:21 +02:00
Michael R Sweet dfe5f3b95c Changelog. 2018-05-01 08:38:41 -04:00
Michael R Sweet 616f3f56dd Merge pull request #5306 from speachy/master
Fix typo in example (cupsCommand -> cupsCommands)
2018-05-01 08:36:28 -04:00
Solomon Peachy f594a3db6d Fix typo in example (cupsCommand -> cupsCommands) 2018-04-30 19:09:41 -04:00
Michael R Sweet d3ab37abea Use -m everywhere for manual sharing. 2018-04-24 20:44:54 -04:00
Michael R Sweet 619d6d95eb Fix 360dpi typo (Issue #5300) 2018-04-24 20:34:10 -04:00
Michael R Sweet b95156db4c Update ErrorPolicy in cupsd.conf man page (Issue #5301) 2018-04-24 20:28:36 -04:00
Michael R Sweet ff82ce17bf Fix GNU TLS httpCertString changes. 2018-04-24 18:22:41 -04:00
Michael R Sweet af62b316e7 Extend GNU TLS certificate string. 2018-04-24 18:04:52 -04:00
Michael R Sweet 073b3929a1 Add issuer and signature algorithm to certificate string, show it in tlscheck output. 2018-04-24 17:46:58 -04:00
Michael R Sweet 17cc92f131 Add resource and system object/state values. 2018-04-24 16:17:21 -04:00
Michael R Sweet bd4b5b3ee1 Changelog. 2018-04-18 08:51:07 -04:00
Michael R Sweet c77dede2ed Merge pull request #5297 from FedericoYundt/patch-1
Allow cupsd daemon to exit on idle (restart=on-failure instead of always)
2018-04-18 08:48:46 -04:00
FedericoYundt 4e02be68c1 Allow cupsd daemon to exit on idle
When using socket activation cups daemon can safely exit on idle and be automatically started when it's needed. Using Restart=always prevent this behavior and causes cups daemon constantly restarting itself instead of exiting. Users reported[1] that Restart=on-failure was enough to fix issues[2] so Restart=always may be unnecessary and harmful.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861470
[2] https://github.com/apple/cups/issues/5263
2018-04-18 08:40:59 +01:00
Michael R Sweet 0873f681e4 Fix policy limits using All (Issue #5296) 2018-04-17 16:54:24 -04:00
Michael R Sweet c1de912d13 Map , to p in phone numbers. 2018-04-17 14:22:16 -04:00
Michael R Sweet fbcc927ded Add support for pause and wait characters in fax numbers (rdar://39212256) 2018-04-17 12:47:00 -04:00
Michael R Sweet 4feb1fe2e5 - Added a workaround for certain web browsers that do not support multiple
authentication schemes in a single response header (Issue #5289)
2018-04-16 17:16:31 -04:00
Michael R Sweet c944b62ba8 Fix cups_auth_find for schemes without parameters. 2018-04-11 22:03:47 -04:00
Michael R Sweet 44cb0dd233 Fix a parsing bug in the new authentication code. 2018-04-11 13:10:24 -04:00
Michael R Sweet 3581e03de5 Update lpoptions man page (Issue #5286) 2018-04-10 15:43:24 -04:00
Michael R Sweet 56f0cbeb27 Merge pull request #5286 from Kohlrabi/master
Remove mentions of non-implemented -U option from lpoptions manpage (still need to update date)
2018-04-10 15:36:58 -04:00
Michael R Sweet 656c109a1c Fix another CUPS-Create-Local-Printer crash (Issue #5290) 2018-04-09 15:31:56 -04:00
Michael R Sweet 159e027902 Changelog. 2018-04-09 09:52:07 -04:00
Michael R Sweet 7271db11d2 Use cupsGetNamedDest for legacy printing APIs (Issue #5288) 2018-04-09 09:50:50 -04:00
Michael R Sweet d07cb8d5dc The ipptool program no longer checks for duplicate attributes when running in
list or CSV mode (Issue #5278)
2018-04-05 20:12:39 -04:00
Michael R Sweet 15fe2ddc7f Fix ippfind _regtype 2018-04-05 17:25:31 -04:00
Christoph Terasa df59b110ad Remove mentions of non-implemented -U option from lpoptions manpage 2018-04-03 16:30:16 +02:00
Michael R Sweet b056061b24 Add cups_en.po file (Issue #5276) 2018-03-23 16:39:17 -04:00
Michael R Sweet 86d93a7539 Update Windows DLL exports file. 2018-03-22 21:48:44 -04:00
Michael R Sweet 4b4895dfe7 Also support /ipp/print/queuename. 2018-03-22 21:47:56 -04:00
Michael R Sweet b25f3cf080 Changelog 2018-03-22 11:43:47 -04:00
Michael R Sweet 63f8dcbd47 Next release is 2.3b4 2018-03-22 09:32:09 -04:00
Michael R Sweet 6a76f435d8 Changelog 2018-03-22 09:02:38 -04:00
Michael R Sweet d0bfbc98b6 Try another fix for Avahi crash (Issue #5268) 2018-03-21 18:00:02 -04:00
Michael R Sweet 561e0647a8 Try another fix for Avahi crash (Issue #5268) 2018-03-21 17:58:01 -04:00
Michael R Sweet 0fb02fb9ce Remove support for _IPP_PRIVATE_STRUCTURES developer cheat. 2018-03-19 23:08:59 -04:00
Michael R Sweet 187b9322c8 Fully deprecate PPD API - no more _PPD_DEPRECATED cheat. 2018-03-19 22:58:49 -04:00
Michael R Sweet 5192eac3e6 Remove redundant check of srv value. 2018-03-19 19:52:48 -04:00
Michael R Sweet 34646e298e Update localizations. 2018-03-19 18:43:43 -04:00
Michael R Sweet 3f72eb0187 Changelog. 2018-03-19 18:43:05 -04:00
Michael R Sweet ada35e599c Deprecate printer drivers (Issue #5270)
Cleanup man page updates.
2018-03-19 18:41:59 -04:00
Michael R Sweet 003c1790e9 Deprecate raw print queues. 2018-03-19 18:35:22 -04:00
Michael R Sweet 73c6236f2c Fix typo 2018-03-19 18:11:25 -04:00
Michael R Sweet 8aecb2299e Changelog. 2018-03-19 13:19:44 -04:00
Michael R Sweet 658c64bf2e Include cupsJobPassword keyword in generated PPDs (Issue #5265) 2018-03-19 13:15:56 -04:00
Michael R Sweet 84047a015c Fix _cupsCondWait again. 2018-03-14 18:06:38 -04:00
Michael R Sweet 739ad3f3ea Typo changes after review (Issue #5264) 2018-03-14 15:13:47 -04:00
Michael R Sweet afd96090b5 Merge pull request #5264 from jschwender/master
some new translations completed
2018-03-13 13:26:43 -04:00
jschwender a0fccd8044 some new translations completed 2018-03-13 16:07:08 +01:00
Michael R Sweet 95f319b9dd Fix definition of IPP_DSTATE_ enums. 2018-03-12 21:57:49 -04:00
Michael R Sweet 13ceaad273 Fix implementation of _cupsCondWait with timeout. 2018-03-12 21:56:12 -04:00
Michael R Sweet 32987439c3 Use setuid for Kerberized IPP printing (Issue #5233) 2018-03-12 21:51:15 -04:00
Michael R Sweet e6062e8e9c Fix printing to some IPP Everywhere printers (Issue #5238) 2018-03-12 21:47:00 -04:00
Michael R Sweet 0dfe699052 Fix systemd integration with cupsd (Issue #5263) 2018-03-12 13:33:03 -04:00
Michael R Sweet 367068f32a Fix DEFINE-DEFAULT support in IPP data files.
Add privacy attributes to requested-attributes support.
2018-03-10 01:06:41 -05:00
Michael R Sweet 0c7f533afd Bump shared library version. 2018-03-09 18:49:33 -05:00
Michael R Sweet 0fea18126c Fix Kerberized IPP printing (Issue #5233) 2018-03-09 15:39:25 -05:00
Michael R Sweet ca75cc1354 The scheduler could crash while adding an IPP Everywhere printer (Issue #5258) 2018-03-08 11:48:12 -05:00
Michael R Sweet c6dbbca1f5 Disable SNMP supplies for all label printers (Issue #5256) 2018-03-08 11:09:27 -05:00
Michael R Sweet ea95f7fe1a Add USB quirk rule for Lexmark Optra E310 printers (Issue #5259) 2018-03-08 11:04:21 -05:00
Michael R Sweet b0bb6caa3a Fix formatting. 2018-03-07 09:01:25 -05:00
Michael R Sweet cff3f79fb2 Update documentation. 2018-03-07 08:57:44 -05:00
Michael R Sweet f1b7e5634d Move cupsHashString to 2.2.7 and add a 2.2.7 API versioning tag. 2018-03-07 08:56:05 -05:00
Michael R Sweet 516dacf7d3 Fix requested attributes lists - missing -col versions of counters and the
notify-subscription-uuid was "subscriptions-uuid".
2018-03-01 14:00:22 -05:00
Michael R Sweet a9e8acf53d Add missing cups-lpd service file (needs to be present for Xcode project to be
complete)
2018-02-28 11:42:27 -05:00
Michael R Sweet 18dfe3cbe7 Use a writability test for TMPDIR on macOS... 2018-02-27 17:03:19 -05:00
Michael R Sweet 30df0a0309 Fix compile error. 2018-02-27 16:01:13 -05:00
Michael R Sweet 818bbe7af2 cupsGetPPD* still used the old TMPDIR code.
Also fix the check to look for /Users/... since /var/folders is OK.
2018-02-27 15:32:20 -05:00
Michael R Sweet 9b440f8a5c Simplify tempfile fix for macOS. 2018-02-26 17:14:11 -05:00
Michael R Sweet 3cd7b5e053 Fix builds without PAM (Issue #5253) 2018-02-23 13:21:56 -05:00
Michael R Sweet 449f30b03d Fix list of printer attributes. 2018-02-22 18:06:11 -05:00
Michael R Sweet c2532688fb Fix "make clean" - wasn't cleaning cups-driverd.o. 2018-02-22 15:19:49 -05:00
Michael R Sweet 08e8f007f4 Bump version number on PostScript test file. 2018-02-22 15:15:59 -05:00
Michael R Sweet ead626d781 Update Windows DLL exports file. 2018-02-22 14:22:34 -05:00
Michael R Sweet 60bb47475a Update localization files. 2018-02-22 14:21:02 -05:00
Michael R Sweet ddf2ec7348 Update API documentation. 2018-02-22 14:19:21 -05:00
Michael R Sweet 706a0485c5 Fix annotation of cupsHashString API 2018-02-22 14:18:10 -05:00
Michael R Sweet c65e1c4ffd Add public cupsEncodeOption API 2018-02-22 14:16:46 -05:00
Michael R Sweet bb54b17e78 _cupsEncodeOption should return the attribute that has been encoded. 2018-02-22 14:07:21 -05:00
Michael R Sweet c64170e5f6 Fix encoding of out-of-band values in ippserver output files. 2018-02-22 13:32:50 -05:00
Michael R Sweet 0bb02bfa09 Temp files could not be created in some sandboxed applications (rdar://37789645)
cups/tempfile.c:
- Use confstr to get the user temp dir when TMPDIR isn't set or we are not
  being run from cupsd.
2018-02-22 13:14:31 -05:00
Michael R Sweet 66d471becb Fix speling mistak. 2018-02-21 15:54:51 -05:00
Michael R Sweet fe1a430545 The IPP backend did not properly detect failed PDF prints (rdar://34055474)
Look for document-format-error and document-unprintable job state reasons
strings and log either that state or the CUPS "retry" state.
2018-02-20 21:46:59 -05:00
Michael R Sweet 53f8d64f84 Update copyrights and license text on files that were missed. 2018-02-20 21:28:13 -05:00
Michael R Sweet eb61cb5bf0 Changelog. 2018-02-20 20:22:23 -05:00
Michael R Sweet a7aabde8fe Setting the timeout should also timeout the TLS negotiation
(rdar://34938533)
2018-02-20 20:18:05 -05:00
Michael R Sweet 699fe02075 Update documentation (Issue #5252) 2018-02-20 18:12:05 -05:00
Michael R Sweet 19186c8bae Changelog and dependencies updates. 2018-02-20 10:46:05 -05:00
Michael R Sweet 7d26bf7d6c Support IPP/1.1 printers with CUPS-Create-Local-Printer operation (Issue #5241) 2018-02-20 10:44:08 -05:00
Michael R Sweet d6ddd199f4 Bump version to 2.3rc1. 2018-02-20 10:03:40 -05:00
Michael R Sweet a468069a20 Use unidirectional mode for Star Micronics printers (Issue #5251) 2018-02-20 09:58:32 -05:00
Michael R Sweet ab89234de2 Fix installation of filters (Issue #5247) 2018-02-20 09:46:07 -05:00
Michael R Sweet afad2da22d Update ippfind to support -N/--literal-name.
Update man pages.
2018-02-14 17:10:06 -05:00
Michael R Sweet 191be31cf1 Update copyright/license info on test files, and remove old SVN keywords. 2018-02-14 16:34:51 -05:00
Michael R Sweet f28728ee32 Fix missing printer-config-change-[time,date-time] attributes.
Fix old IPP Everywhere test file to use newer test files.
2018-02-14 16:27:53 -05:00
Michael R Sweet c5b7774cb8 Fix handling of "EXPECT foo/bar IN-GROUP group". 2018-02-14 16:00:21 -05:00
Michael R Sweet e22f464e37 Sync up fixes from IPP sample code repo. 2018-02-13 14:37:22 -05:00
Michael R Sweet e28345e78d Fix clean target in "cups" subdirectory. 2018-02-11 21:59:31 -05:00
Michael R Sweet f17549fbb4 Fix timezone offset code. 2018-02-06 15:29:55 -05:00
Michael R Sweet 06e1afc39b Fix dateTime value parsing. 2018-02-06 15:23:26 -05:00
Michael R Sweet a166e9337a Move file callbacks to _ipp_vars_t and add attribute filter callback. 2018-02-06 14:25:37 -05:00
Michael R Sweet 7f4d7b8a51 Fix unused store - actually use the count we saved. 2018-02-06 13:36:02 -05:00
Michael R Sweet 564cd57de8 Fix compiler warning. 2018-02-06 13:32:09 -05:00
Michael R Sweet 7c8fb0fc01 Bump version to 2.3b3. 2018-02-01 10:01:12 -05:00
Michael R Sweet 22974c5f32 The cupsCopyDestInfo function did not work with all print queues (Issue #5235)
cups/dest.c:
- Fix debug logging in _cupsGetDestResource.

cups/dest-options.c:
- Update CUPS server check in cupsCopyDestInfo.
2018-01-31 22:36:51 -05:00
Michael R Sweet 092db1e29e Additional changes for the scheduler to substitute default values for invalid
job attributes when running in "relaxed conformance" mode (Issue #5229)
2018-01-31 22:14:10 -05:00
Michael R Sweet f6e7a0c53a Update localization headers. 2018-01-31 21:14:23 -05:00
Michael R Sweet 728fd81076 Add unit test for _cupsConnect. 2018-01-31 21:04:37 -05:00
Michael R Sweet 27551f043a One more fix for _cupsGetDestResource (Issue #5211) 2018-01-31 20:21:26 -05:00
Michael R Sweet b969d5af2b Fix additional IPP/1.1 issues with cupsCopyDestInfo (Issue #5211)
Update ippserver to support maximum version option (-V max-version)

Update cupsCopyDestInfo to recognize when we are talking to the CUPS server
and when we are talking to the device (so we get the right URI for the printer)

Add "--device" option to testdest.
2018-01-31 19:29:59 -05:00
Michael R Sweet 2da2477dac Use ippValidateAttribute to validate attributes in ipptool.
Fix localization typo.
2018-01-31 14:23:05 -05:00
Michael R Sweet dd6a3fd2ba Merge pull request #5240 from zdohnal/pagelog_syslog
Respect PageLog configuration when compiled with journald
2018-01-29 14:34:34 -05:00
Zdenek Dohnal aed3d896a7 Same as Lutz Heermann, but for PageLog - respect PageLog configuration when compiled with journald 2018-01-29 12:48:29 +01:00
Michael R Sweet a492d345e8 Update ipptool to not use private IPP structures. 2018-01-25 17:09:32 -05:00
Michael R Sweet 8e2e09c1e2 Finish re-tooling of ipptool to use new parser. 2018-01-25 15:47:57 -05:00
Michael R Sweet b87ec78957 libcupsimage is now in the "cups" directory. 2018-01-25 12:54:36 -05:00
Michael R Sweet 081027767a Save work on new ipptool using IPP data file parser. 2018-01-23 23:05:55 -05:00
Michael R Sweet fd96ad89ff Add (ASCII) IPP data file parser to libcups, to be used by ippserver and
ipptool.
2018-01-22 21:23:24 -05:00
Michael R Sweet efb40dcacf Merge pull request #5232 from christoph-morrison/master
Some typo fixes in the german translation
2018-01-19 15:36:58 -05:00
Christoph Morrison ab8a07ec22 Some typo fixes in the german translation 2018-01-19 17:59:36 +01:00
Michael R Sweet 6f7bfae71c Update Xcode project. 2018-01-18 17:25:30 -05:00
Michael R Sweet 123979a9db Move libcupsimage to the "cups" subdirectory, along with its unit tests and
benchmark.
2018-01-18 17:20:18 -05:00
Michael R Sweet 342395f9d1 Attribute names in cupsFinishingTemplate should be prefixed with PostScript
comment.
2018-01-18 16:29:25 -05:00
Michael R Sweet 314e45c21a Expand ColorModel support for IPP Everywhere printers to include device color
spaces.  Simplify code.
2018-01-18 13:08:15 -05:00
Michael Sweet c283f46deb Add support for deep grayscale (ColorModel=Gray16) and 8-bit AdobeRGB
(Issue #5227)
2018-01-18 09:30:26 -05:00
Michael R Sweet 7b98191acd Fix installation permissions of "en" locale dir. 2018-01-17 15:26:04 -05:00
Michael R Sweet f61dfc0df4 Bump versions and copyrights. 2018-01-17 15:14:03 -05:00
Michael R Sweet 1055deceda Update copyright. 2018-01-17 15:01:33 -05:00
Michael R Sweet 117bf0d144 Fixed an issue with mapping finishing options (rdar://34250727)
cups/ppd-cache:
- Change _ppdCacheGetFinishingValues to take a ppd_file_t * so we can check
  marked choices.
- Update _cupsConvertOptions to send the ppd_file_t * to
  _ppdCacheGetFinishingValues.

cups/testcache.c:
- Update unit test.
2018-01-17 14:58:25 -05:00
Michael R Sweet 4ef3ee3749 The ppdLocalizeIPPReason function incorrectly returned a localized version
of "none" (rdar://36566269)
2018-01-17 14:40:02 -05:00
Michael R Sweet 7c91db71b3 The cupsRasterWritePixels function did not correctly swap bytes for some
formats (Issue #5225)

filter/raster.c:
- Add debug logging for color spaces, modes, and offsets during writes.
- Fix byte swapping of compressed data in cupsRasterReadPixels.
- Add cups_copy_swap function that copies and swaps bytes.
- Use cups_copy_swap function when copying pixel data in cupsRasterWritePixels.

filter/testraster.c:
- Add logging of first 10 incorrect raster bytes.
- Fix PASS/FAIL logging of cupsRasterReadHeader2.
2018-01-17 14:13:39 -05:00
Michael R Sweet a8b28f1844 IPP Everywhere PPDs were not localized to English (Issue #5205)
Install cups.pot as cups_en.po
2018-01-15 09:40:56 -05:00
Michael R Sweet 43bcc47b51 Add a USB quirk rule for Canon MP280 series printers (Issue #5221) 2018-01-11 12:33:50 -05:00
Michael R Sweet 3145b7e6a8 Copy the is_default value in cupsCopyDest so that cupsGetDests reports the
correct default printer (Issue #5208)
2018-01-11 12:31:16 -05:00
Michael R Sweet 6a3d63e638 Printing to old CUPS servers has been fixed (Issue #5211)
cups/dest-options.c:
- Fix IPP version check in cupsCopyDestInfo.
2018-01-11 11:32:01 -05:00
Michael R Sweet 6bfe0be46a Update copyright. 2018-01-11 11:28:45 -05:00
Michael R Sweet 378eeedf0f Update HTTP implementation to support field values larger than HTTP_MAX_VALUE
bytes (Issue #5216)

cups/http-private.h:
- Move all char * shadow variables to new fields array, rename old fields array
  to _fields (binary compatibility).

cups/http.c:
- Add new http_add_field that can handle appending values and allocating or
  clearing strings as needed.
- Update httpSetField to use http_add_field.
- Update _httpUpdate to use http_add_field instead of httpSetField.

cups/request.c:
- Fix checks for header fields.

cups/tls-*.c:
- Fix checks for Host header field.
2018-01-10 23:52:05 -05:00
Michael R Sweet a20d0ea003 Update Xcode settings (yet again...) 2018-01-10 21:39:03 -05:00
Michael Sweet c4faa907bc Fix DNS-SD host name for shared printers on macOS. 2018-01-10 10:49:48 -05:00
Michael Sweet 625bb9ded6 The cupsGetDests and cupsEnumDests functions no longer filter out local
print services like IPP USB devices (Issue #5206)
2018-01-09 22:47:46 -05:00
Michael Sweet f89686dd3f Update copyright year. 2018-01-09 22:28:27 -05:00
Michael Sweet ead6e4884a Changelog. 2018-01-09 21:18:26 -05:00
Michael Sweet e16130570f Changelog and dates. 2018-01-09 21:18:26 -05:00
Michael R Sweet 141c8f96be Merge pull request #5210 from Atalanttore/patch-2
Update cups_de.po
2018-01-09 21:17:26 -05:00
Michael R Sweet eb1573431f Merge pull request #5217 from StefanScherer/fix-compile-wihout-have-ssl
Fix compile without HAVE_SSL
2018-01-09 21:16:50 -05:00
Michael R Sweet 2fc81be235 Merge pull request #5212 from albert-astals-cid-kdab/master
Remove unused _PPD_NORMAL_CONSTRAINTS enum
2018-01-09 21:10:02 -05:00
Michael R Sweet 7917399e29 Merge pull request #5213 from albert-astals-cid-kdab/ppdInstallableConflict
Fix ppdInstallableConflict conflict reporting
2018-01-09 21:06:51 -05:00
Stefan Scherer 60da78baeb Fix compile without HAVE_SSL 2018-01-09 16:31:37 +01:00
Albert Astals Cid 4a9942a2f0 Fix ppdInstallableConflict conflict reporting
Without this patch it was taking all constraints into account, not only the ones
regarding the passed option so if you had a conflict somewhere else, every other
single option would be said to be conflicting which doesn't match what the
documentation says this function should do.
2018-01-02 16:17:07 +01:00
Albert Astals Cid 33baffa2a9 Remove unused _PPD_NORMAL_CONSTRAINTS enum 2018-01-02 15:30:43 +01:00
Ettore Atalan 9bebe8c90d Update cups_de.po
Updated existing and untranslated strings.
2017-12-30 15:28:52 +01:00
Michael R Sweet 82341b0b45 Fix copyright statements. 2017-12-20 11:33:59 -05:00
Michael R Sweet 77401306b8 Reword firewall docs - "outgoing ports" -> "port for outgoing network traffic". 2017-12-20 10:05:04 -05:00
339 arquivos alterados com 17245 adições e 21329 exclusões
+4 -5
Ver Arquivo
@@ -40,10 +40,13 @@ conf/mime.convs
conf/pam.std
conf/snmp.conf
cups/locale/
cups/rasterbench
cups/test.pwg
cups/test.raster
cups/testadmin
cups/testarray
cups/testcache
cups/testclient
cups/testconflicts
cups/testcreds
cups/testcups
@@ -57,6 +60,7 @@ cups/testlang
cups/testoptions
cups/testppd
cups/testpwg
cups/testraster
cups/testsnmp
cups/tlscheck
desktop/cups.desktop
@@ -65,14 +69,10 @@ doc/*/index.html
filter/commandtops
filter/gziptoany
filter/pstops
filter/rasterbench
filter/rastertoepson
filter/rastertohp
filter/rastertolabel
filter/rastertopwg
filter/test.raster
filter/testclient
filter/testraster
locale/checkpo
locale/po2strings
locale/strings2po
@@ -117,7 +117,6 @@ scheduler/cups.sh
scheduler/cups.xml
scheduler/cupsd
scheduler/cupsfilter
scheduler/org.cups.cups-lpd.plist
scheduler/org.cups.cups-lpdAT.service
scheduler/org.cups.cupsd.path
scheduler/org.cups.cupsd.service
+111 -1
Ver Arquivo
@@ -1,6 +1,116 @@
CHANGES - 2.3b1 - 2017-12-19
CHANGES - 2.3b6 - 2018-06-05
============================
Changes in CUPS v2.3b6
----------------------
- Fixed a memory leak for some IPP (extension) syntaxes.
Changes in CUPS v2.3b5
----------------------
- The `ipptool` program no longer checks for duplicate attributes when running
in list or CSV mode (Issue #5278)
- The `cupsCreateJob`, `cupsPrintFile2`, and `cupsPrintFiles2` APIs did not use
the supplied HTTP connection (Issue #5288)
- Fixed another crash in the scheduler when adding an IPP Everywhere printer
(Issue #5290)
- Added a workaround for certain web browsers that do not support multiple
authentication schemes in a single response header (Issue #5289)
- Fixed policy limits containing the `All` operation (Issue #5296)
- The scheduler was always restarted after idle-exit with systemd (Issue #5297)
- Added a USB quirks rule for the HP LaserJet P1102 (Issue #5310)
- The mailto notifier did not wait for the welcome message (Issue #5312)
- Fixed a parsing bug in the pstops filter (Issue #5321)
- Documentation updates (Issue #5299, Issue #5301, Issue #5306)
- Localization updates (Issue #5317)
- The scheduler allowed environment variables to be specified in the
`cupsd.conf` file (rdar://37836779, rdar://37836995, rdar://37837252,
rdar://37837581)
- Fax queues did not support pause (p) or wait-for-dialtone (w) characters
(rdar://39212256)
- The scheduler did not validate notify-recipient-uri values properly
(rdar://40068936)
- The IPP parser allowed invalid group tags (rdar://40442124)
- Fixed a parsing bug in the new authentication code.
Changes in CUPS v2.3b4
----------------------
- NOTICE: Printer drivers are now deprecated (Issue #5270)
- Kerberized printing to another CUPS server did not work correctly
(Issue #5233)
- Fixed printing to some IPP Everywhere printers (Issue #5238)
- Fixed installation of filters (Issue #5247)
- The scheduler now supports using temporary print queues for older IPP/1.1
print queues like those shared by CUPS 1.3 and earlier (Issue #5241)
- Star Micronics printers need the "unidir" USB quirk rule (Issue #5251)
- Documentation fixes (Issue #5252)
- Fixed a compile issue when PAM is not available (Issue #5253)
- Label printers supported by the rastertolabel driver don't support SNMP, so
don't delay printing to test it (Issue #5256)
- The scheduler could crash while adding an IPP Everywhere printer (Issue #5258)
- The Lexmark Optra E310 printer needs the "no-reattach" USB quirk rule
(Issue #5259)
- Systemd did not restart cupsd when configuration changes were made that
required a restart (Issue #5263)
- The IPP Everywhere PPD generator did not include the `cupsJobPassword`
keyword, when supported (Issue #5265)
- Fixed an Avahi crash bug in the scheduler (Issue #5268)
- Raw print queues are now deprecated (Issue #5269)
- Fixed an RPM packaging problem (Issue #5276)
- The IPP backend did not properly detect failed PDF prints (rdar://34055474)
- TLS connections now properly timeout (rdar://34938533)
- Temp files could not be created in some sandboxed applications
(rdar://37789645)
- The ipptool `--ippserver` option did not encode out-of-band attributes
correctly.
- Added public `cupsEncodeOption` API for encoding a single option as an IPP
attribute.
- Removed support for the `-D_PPD_DEPRECATED=""` developer cheat - the PPD API
should no longer be used.
- Removed support for `-D_IPP_PRIVATE_STRUCTURES=1` developer cheat - the IPP
accessor functions should be used instead.
Changes in CUPS v2.3b3
----------------------
- More fixes for printing to old CUPS servers (Issue #5211)
- The IPP Everywhere PPD generator did not support deep grayscale or 8-bit per
component AdobeRGB (Issue #5227)
- Additional changes for the scheduler to substitute default values for invalid
job attributes when running in "relaxed conformance" mode (Issue #5229)
- Localization changes (Issue #5232, rdar://37068158)
- The `cupsCopyDestInfo` function did not work with all print queues
(Issue #5235)
Changes in CUPS v2.3b2
----------------------
- Localization changes (Issue #5210)
- Build fixes (Issue #5217)
- IPP Everywhere PPDs were not localized to English (Issue #5205)
- The `cupsGetDests` and `cupsEnumDests` functions no longer filter out local
print services like IPP USB devices (Issue #5206)
- The `cupsCopyDest` function now correctly copies the `is_default` value
(Issue #5208)
- Printing to old CUPS servers has been fixed (Issue #5211)
- The `ppdInstallableConflict` tested too many constraints (Issue #5213)
- All HTTP field values can now be longer than `HTTP_MAX_VALUE` bytes
(Issue #5216)
- Added a USB quirk rule for Canon MP280 series printers (Issue #5221)
- The `cupsRasterWritePixels` function did not correctly swap bytes for some
formats (Issue #5225)
- Fixed an issue with mapping finishing options (rdar://34250727)
- The `ppdLocalizeIPPReason` function incorrectly returned a localized version
of "none" (rdar://36566269)
- The scheduler did not add ".local" to the default DNS-SD host name when
needed.
Changes in CUPS v2.3b1
----------------------
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v2.3b1 - 2017-12-19
INSTALL - CUPS v2.3b5 - 2018-06-05
==================================
This file describes how to compile and install CUPS from source code. For more
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
CUPS
Copyright © 2007-2017 by Apple Inc.
Copyright 1997-2007 by Easy Software Products.
Copyright © 2007-2018 by Apple Inc.
Copyright © 1997-2007 by Easy Software Products.
CUPS and the CUPS logo are trademarks of Apple Inc.
+3 -2
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v2.3b1 - 2017-12-19
README - CUPS v2.3b5 - 2018-06-05
=================================
Looking for compile instructions? Read the file `INSTALL.md` instead...
@@ -148,7 +148,8 @@ This will prevent the filters from misinterpreting your print file.
LEGAL STUFF
-----------
Copyright © 2007-2017 by Apple Inc.
Copyright © 2007-2018 by Apple Inc.
Copyright © 1997-2007 by Easy Software Products.
CUPS is provided under the terms of the Apache License, Version 2.0. A copy of
this license can be found in the file `LICENSE`. Additional legal information
+39 -40
Ver Arquivo
@@ -1,53 +1,53 @@
ipp.o: ipp.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h ../cups/ppd-private.h ../cups/ppd.h \
../cups/raster.h
lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/language.h \
../cups/array.h ../cups/versioning.h ../cups/http.h \
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
../cups/debug-private.h ../cups/array-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/pwg.h backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../cups/debug-private.h \
../cups/array-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
dnssd.o: dnssd.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h
snmp.o: snmp.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/language.h \
../cups/array.h ../cups/versioning.h ../cups/http.h \
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
../cups/debug-private.h ../cups/array-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/pwg.h backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../cups/debug-private.h \
../cups/array-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \
backend-private.h ../cups/cups-private.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h ../cups/ppd-private.h ../cups/ppd.h \
../cups/raster.h
testbackend.o: testbackend.c ../cups/string-private.h ../config.h \
../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/language.h ../cups/pwg.h \
@@ -55,18 +55,17 @@ testbackend.o: testbackend.c ../cups/string-private.h ../config.h \
testsupplies.o: testsupplies.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h
usb.o: usb.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
usb-darwin.c ../cups/file-private.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/raster.h
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h usb-darwin.c ../cups/file-private.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* Backend support definitions for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2014 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_BACKEND_PRIVATE_H_
+3 -6
Ver Arquivo
@@ -1,13 +1,10 @@
/*
* DNS-SD discovery backend for CUPS.
*
* Copyright 2008-2017 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
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* IEEE-1284 support functions for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2015 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+42 -18
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* IPP backend for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -45,6 +42,8 @@ extern void xpc_connection_set_target_uid(xpc_connection_t connection,
#define _CUPS_JSR_ACCOUNT_LIMIT_REACHED 0x08
#define _CUPS_JSR_JOB_PASSWORD_WAIT 0x10
#define _CUPS_JSR_JOB_RELEASE_WAIT 0x20
#define _CUPS_JSR_DOCUMENT_FORMAT_ERROR 0x40
#define _CUPS_JSR_DOCUMENT_UNPRINTABLE 0x80
/*
@@ -67,6 +66,7 @@ typedef struct _cups_monitor_s /**** Monitoring data ****/
http_encryption_t encryption; /* Use encryption? */
ipp_jstate_t job_state; /* Current job state */
ipp_pstate_t printer_state; /* Current printer state */
int retryable; /* Is this a job that should be retried? */
} _cups_monitor_t;
@@ -355,8 +355,7 @@ main(int argc, /* I - Number of command-line args */
* that way.
*/
if (!getuid() && (value = getenv("AUTH_UID")) != NULL &&
!getenv("AUTH_PASSWORD"))
if (!getuid() && (value = getenv("AUTH_UID")) != NULL)
{
uid_t uid = (uid_t)atoi(value);
/* User ID */
@@ -390,7 +389,7 @@ main(int argc, /* I - Number of command-line args */
# else /* No XPC, just try to run as the user ID */
if (uid > 0)
seteuid(uid);
setuid(uid);
# endif /* HAVE_XPC */
}
#endif /* HAVE_GSSAPI */
@@ -1446,6 +1445,7 @@ main(int argc, /* I - Number of command-line args */
monitor.encryption = cupsEncryption();
monitor.job_state = IPP_JOB_PENDING;
monitor.printer_state = IPP_PRINTER_IDLE;
monitor.retryable = argc == 6 && document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf");
if (create_job)
{
@@ -2566,22 +2566,24 @@ monitor_printer(
for (i = 0; i < attr->num_values; i ++)
{
if (!strcmp(attr->values[i].string.text,
"account-authorization-failed"))
if (!strcmp(attr->values[i].string.text, "account-authorization-failed"))
new_reasons |= _CUPS_JSR_ACCOUNT_AUTHORIZATION_FAILED;
else if (!strcmp(attr->values[i].string.text, "account-closed"))
new_reasons |= _CUPS_JSR_ACCOUNT_CLOSED;
else if (!strcmp(attr->values[i].string.text, "account-info-needed"))
new_reasons |= _CUPS_JSR_ACCOUNT_INFO_NEEDED;
else if (!strcmp(attr->values[i].string.text,
"account-limit-reached"))
else if (!strcmp(attr->values[i].string.text, "account-limit-reached"))
new_reasons |= _CUPS_JSR_ACCOUNT_LIMIT_REACHED;
else if (!strcmp(attr->values[i].string.text, "job-password-wait"))
new_reasons |= _CUPS_JSR_JOB_PASSWORD_WAIT;
else if (!strcmp(attr->values[i].string.text, "job-release-wait"))
new_reasons |= _CUPS_JSR_JOB_RELEASE_WAIT;
if (!job_canceled &&
(!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
else if (!strcmp(attr->values[i].string.text, "document-format-error"))
new_reasons |= _CUPS_JSR_DOCUMENT_FORMAT_ERROR;
else if (!strcmp(attr->values[i].string.text, "document-unprintable"))
new_reasons |= _CUPS_JSR_DOCUMENT_UNPRINTABLE;
if (!job_canceled && (!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
job_canceled = 1;
}
@@ -2599,6 +2601,26 @@ monitor_printer(
fputs("JOBSTATE: job-password-wait\n", stderr);
else if (new_reasons & _CUPS_JSR_JOB_RELEASE_WAIT)
fputs("JOBSTATE: job-release-wait\n", stderr);
else if (new_reasons & (_CUPS_JSR_DOCUMENT_FORMAT_ERROR | _CUPS_JSR_DOCUMENT_UNPRINTABLE))
{
if (monitor->retryable)
{
/*
* Can't print this, so retry as raster...
*/
job_canceled = 1;
fputs("JOBSTATE: cups-retry-as-raster\n", stderr);
}
else if (new_reasons & _CUPS_JSR_DOCUMENT_FORMAT_ERROR)
{
fputs("JOBSTATE: document-format-error\n", stderr);
}
else
{
fputs("JOBSTATE: document-unprintable\n", stderr);
}
}
else
fputs("JOBSTATE: job-printing\n", stderr);
@@ -2758,7 +2780,7 @@ new_request(
char phone[1024], /* Phone number string */
*ptr, /* Pointer into string */
tel_uri[1024]; /* tel: URI */
static const char * const allowed = "0123456789#*-+.()";
static const char * const allowed = "0123456789#*-+.()pw";
/* Allowed characters */
destination = ippNew();
@@ -2771,7 +2793,9 @@ new_request(
_httpDecodeURI(phone, keyword, sizeof(phone));
for (ptr = phone; *ptr;)
{
if (!strchr(allowed, *ptr))
if (*ptr == ',')
*ptr = 'p';
else if (!strchr(allowed, *ptr))
_cups_strcpy(ptr, ptr + 1);
else
ptr ++;
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* Line Printer Daemon backend for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* Common backend network APIs for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
* 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+20 -1
Ver Arquivo
@@ -8,10 +8,17 @@
# delay-close Delay close/reset of selected interface
# no-reattach Do no re-attach usblp kernel module after printing.
# soft-reset Do a soft reset after printing for cleanup.
# unidir Only supported unidirectional I/O
# unidir Only supports unidirectional I/O
# usb-init Needs vendor USB initialization string.
# vendor-class Uses vendor-specific class or subclass.
# whitelist The printer is functional with the USB backend.
#
# To get the USB vendor and product IDs for a given printer, run the "lsusb"
# command, which will show something like the following:
#
# Bus 002 Device 003: ID ab21:34dc Acme Example Printer
#
# The "ab21:34dc" is the vendor and product ID, separated by a colon.
# HP DeskJet 895C
0x03f0 0x0004 unidir
@@ -265,3 +272,15 @@
# HP LaserJet 1160 (Issue #5121)
0x03f0 0x1e17 delay-close
# Canon, Inc. MP280 series (Issue #5221)
0x04a9 0x1746 unidir
# Star Micronics printers (Issue #5251)
0x0519 unidir
# Lexmark Optra E310 (Issue #5259)
0x043d 0x000c no-reattach
# HP LaserJet P1102 (Issue #5310)
0x03F0 0x002A no-reattach
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* Common run loop APIs for CUPS backends.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2014 by Apple Inc.
* Copyright © 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+3 -6
Ver Arquivo
@@ -1,13 +1,10 @@
/*
* SNMP supplies functions for CUPS.
*
* Copyright 2008-2015 by Apple Inc.
* Copyright © 2008-2015 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"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* SNMP discovery backend for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2014 by Apple Inc.
* Copyright © 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* AppSocket backend for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* 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
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* IEEE-1284 support functions test program for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright © 2007-2010 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* Backend test program for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
* Copyright © 2007-2014 by Apple Inc.
* Copyright © 1997-2005 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+3 -6
Ver Arquivo
@@ -1,13 +1,10 @@
/*
* SNMP supplies test program for CUPS.
*
* Copyright 2008-2011 by Apple Inc.
* Copyright © 2008-2011 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"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+4 -7
Ver Arquivo
@@ -3,14 +3,11 @@
*
* This file is included from "usb.c" when compiled on UNIX/Linux.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2013 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* USB printer backend for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2012 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+15 -15
Ver Arquivo
@@ -1,25 +1,25 @@
lpc.o: lpc.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
../cups/array.h ../cups/ipp-private.h ../cups/cups.h ../cups/file.h \
../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/pwg.h \
../cups/http-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h
lpq.o: lpq.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
../cups/array.h ../cups/ipp-private.h ../cups/cups.h ../cups/file.h \
../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/pwg.h \
../cups/http-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h
lpr.o: lpr.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
../cups/array.h ../cups/ipp-private.h ../cups/cups.h ../cups/file.h \
../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/pwg.h \
../cups/http-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h
lprm.o: lprm.c ../cups/cups-private.h ../cups/string-private.h \
../config.h ../cups/debug-private.h ../cups/versioning.h \
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
../cups/ipp.h ../cups/http.h ../cups/http-private.h ../cups/language.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/cups.h ../cups/file.h ../cups/pwg.h \
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h
+3 -5
Ver Arquivo
@@ -28,16 +28,14 @@ var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h \
../cups/md5-private.h
../cups/string-private.h ../config.h ../cups/ipp-private.h
admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h \
../cups/http-private.h ../cups/md5-private.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/raster.h ../cups/pwg-private.h \
../cups/adminutil.h
../cups/http-private.h ../cups/ppd-private.h ../cups/ppd.h \
../cups/raster.h ../cups/pwg-private.h ../cups/adminutil.h
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
+4 -7
Ver Arquivo
@@ -5,14 +5,11 @@
#
# Base MIME conversions file for CUPS.
#
# Copyright 2007-2016 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
# Copyright © 2007-2016 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/".
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
########################################################################
+4 -7
Ver Arquivo
@@ -5,14 +5,11 @@
# VERSIONS OF CUPS. Instead, create a "local.types" file that
# reflects your local configuration changes.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
# 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/".
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
########################################################################
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
dnl
dnl Libtool stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 2007-2018 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
@@ -40,7 +40,7 @@ if test x$LIBTOOL != x; then
LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
LINKCUPS="../cups/\$(LIBCUPS)"
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
LINKCUPSIMAGE="../cups/\$(LIBCUPSIMAGE)"
else
LD_CC="\$(CC)"
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
dnl
dnl Shared library support for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 2007-2018 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
@@ -85,7 +85,7 @@ AC_SUBST(LIBCUPSSTATIC)
if test x$enable_shared = xno; then
LINKCUPS="../cups/lib$cupsbase.a"
LINKCUPSIMAGE="../filter/libcupsimage.a"
LINKCUPSIMAGE="../cups/libcupsimage.a"
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
externo
+121 -128
Ver Arquivo
@@ -1,11 +1,13 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for CUPS 2.3b1.
# Generated by GNU Autoconf 2.68 for CUPS 2.3b6.
#
# Report bugs to <https://github.com/apple/cups/issues>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
# Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -134,31 +136,6 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -192,8 +169,7 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
test x\$exitcode = x0 || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -238,25 +214,21 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
export CONFIG_SHELL
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
fi
if test x$as_have_required = xno; then :
@@ -359,14 +331,6 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -488,10 +452,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
@@ -526,16 +486,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
as_ln_s='cp -p'
fi
else
as_ln_s='cp -pR'
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -547,8 +507,28 @@ else
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in #(
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -580,8 +560,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='CUPS'
PACKAGE_TARNAME='cups'
PACKAGE_VERSION='2.3b1'
PACKAGE_STRING='CUPS 2.3b1'
PACKAGE_VERSION='2.3b6'
PACKAGE_STRING='CUPS 2.3b6'
PACKAGE_BUGREPORT='https://github.com/apple/cups/issues'
PACKAGE_URL='https://www.cups.org/'
@@ -1388,6 +1368,8 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
$as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1473,7 +1455,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures CUPS 2.3b1 to adapt to many kinds of systems.
\`configure' configures CUPS 2.3b6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1538,7 +1520,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of CUPS 2.3b1:";;
short | recursive ) echo "Configuration of CUPS 2.3b6:";;
esac
cat <<\_ACEOF
@@ -1715,10 +1697,10 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
CUPS configure 2.3b1
generated by GNU Autoconf 2.69
CUPS configure 2.3b6
generated by GNU Autoconf 2.68
Copyright (C) 2012 Free Software Foundation, Inc.
Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1869,7 +1851,7 @@ $as_echo "$ac_try_echo"; } >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
$as_test_x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -2179,8 +2161,8 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by CUPS $as_me 2.3b1, which was
generated by GNU Autoconf 2.69. Invocation command line was
It was created by CUPS $as_me 2.3b6, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2654,7 +2636,7 @@ fi
ac_config_headers="$ac_config_headers config.h"
CUPS_VERSION="2.3b1"
CUPS_VERSION="2.3b6"
CUPS_REVISION=""
CUPS_BUILD="cups-$CUPS_VERSION"
@@ -2700,7 +2682,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2748,7 +2730,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2792,7 +2774,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3236,7 +3218,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
struct stat;
#include <sys/types.h>
#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3486,7 +3469,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3530,7 +3513,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3732,7 +3715,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3772,7 +3755,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3825,7 +3808,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3865,7 +3848,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3905,7 +3888,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3945,7 +3928,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_LD="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3985,7 +3968,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4025,7 +4008,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4065,7 +4048,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4105,7 +4088,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4145,7 +4128,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_RMDIR="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4185,7 +4168,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4225,7 +4208,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_XDGOPEN="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4301,7 +4284,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4344,7 +4327,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4754,7 +4737,7 @@ do
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
{ test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
@@ -4820,7 +4803,7 @@ do
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_EGREP" || continue
{ test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
@@ -6631,7 +6614,7 @@ fi
if test x$enable_shared = xno; then
LINKCUPS="../cups/lib$cupsbase.a"
LINKCUPSIMAGE="../filter/libcupsimage.a"
LINKCUPSIMAGE="../cups/libcupsimage.a"
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
@@ -6732,7 +6715,7 @@ if test x$LIBTOOL != x; then
LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
LINKCUPS="../cups/\$(LIBCUPS)"
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
LINKCUPSIMAGE="../cups/\$(LIBCUPSIMAGE)"
else
LD_CC="\$(CC)"
@@ -7838,7 +7821,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_KRB5CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7881,7 +7864,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_ac_pt_KRB5CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8433,7 +8416,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_LIBGNUTLSCONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8476,7 +8459,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_ac_pt_LIBGNUTLSCONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -9047,8 +9030,6 @@ _ACEOF
esac
rm -rf conftest*
fi
fi
@@ -10494,16 +10475,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
as_ln_s='cp -p'
fi
else
as_ln_s='cp -pR'
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -10563,16 +10544,28 @@ else
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in #(
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -10593,8 +10586,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by CUPS $as_me 2.3b1, which was
generated by GNU Autoconf 2.69. Invocation command line was
This file was extended by CUPS $as_me 2.3b6, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -10656,11 +10649,11 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
CUPS config.status 2.3b1
configured by $0, generated by GNU Autoconf 2.69,
CUPS config.status 2.3b6
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
Copyright (C) 2010 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -10749,7 +10742,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
+5 -4
Ver Arquivo
@@ -1,17 +1,18 @@
dnl
dnl Configuration script for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl Copyright © 2007-2018 by Apple Inc.
dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
dnl information.
dnl
dnl We need at least autoconf 2.60...
AC_PREREQ(2.60)
dnl Package name and version...
AC_INIT([CUPS], [2.3b1], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
AC_INIT([CUPS], [2.3b6], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
sinclude(config-scripts/cups-opsys.m4)
sinclude(config-scripts/cups-common.m4)
+5 -8
Ver Arquivo
@@ -2,18 +2,15 @@
#
# CUPS configuration utility.
#
# Copyright 2007-2016 by Apple Inc.
# Copyright 2001-2006 by Easy Software Products, all rights reserved.
# Copyright © 2007-2018 by Apple Inc.
# Copyright © 2001-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
VERSION="@CUPS_VERSION@"
APIVERSION="2.2"
APIVERSION="2.3"
BUILD="@CUPS_BUILD@"
prefix=@prefix@
+191 -180
Ver Arquivo
@@ -1,254 +1,257 @@
adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd.h raster.h \
adminutil.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd.h raster.h adminutil.h
array.o: array.c ../cups/cups.h file.h versioning.h ipp.h http.h array.h \
language.h pwg.h string-private.h ../config.h debug-private.h \
array-private.h
auth.o: auth.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h
backend.o: backend.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h backend.h ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h backend.h ppd.h raster.h
debug.o: debug.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
dest.o: dest.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
dest-job.o: dest-job.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
dest-localization.o: dest-localization.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
thread-private.h
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
dest-options.o: dest-options.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
thread-private.h
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
dir.o: dir.c string-private.h ../config.h debug-private.h \
../cups/versioning.h dir.h
encode.o: encode.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
file.o: file.c file-private.h cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
getdevices.o: getdevices.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h adminutil.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h adminutil.h
getifaddrs.o: getifaddrs.c http-private.h ../config.h ../cups/language.h \
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
../cups/ipp.h
array.h versioning.h ../cups/http.h ipp-private.h ../cups/cups.h \
file.h ipp.h pwg.h
getputfile.o: getputfile.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
globals.o: globals.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
hash.o: hash.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
http.o: http.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
http-addr.o: http-addr.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
http-addrlist.o: http-addrlist.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
thread-private.h
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
http-support.o: http-support.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
thread-private.h
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
ipp.o: ipp.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
file.h pwg.h thread-private.h
../cups/cups.h file.h ipp.h http.h language.h pwg.h http-private.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
ipp-file.o: ipp-file.c ipp-private.h ../cups/cups.h file.h versioning.h \
ipp.h http.h array.h language.h pwg.h string-private.h ../config.h \
debug-private.h
ipp-vars.o: ipp-vars.c ../cups/cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h ipp-private.h string-private.h ../config.h
ipp-support.o: ipp-support.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
langprintf.o: langprintf.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
language.o: language.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
md5.o: md5.c md5-private.h string-private.h ../config.h
md5passwd.o: md5passwd.c http-private.h ../config.h ../cups/language.h \
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
../cups/ipp.h string-private.h
md5passwd.o: md5passwd.c ../cups/cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h http-private.h ../config.h ipp-private.h \
string-private.h
notify.o: notify.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
options.o: options.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
ppd.o: ppd.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
file.h pwg.h thread-private.h ppd-private.h ../cups/ppd.h raster.h
../cups/cups.h file.h ipp.h http.h language.h pwg.h http-private.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h raster.h
ppd-attr.o: ppd-attr.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
../cups/ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-cache.o: ppd-cache.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
../cups/ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-conflicts.o: ppd-conflicts.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-custom.o: ppd-custom.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
../cups/ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-emit.o: ppd-emit.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd.h raster.h
ppd-localize.o: ppd-localize.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-mark.o: ppd-mark.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
../cups/ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-page.o: ppd-page.c string-private.h ../config.h debug-private.h \
../cups/versioning.h ppd.h cups.h file.h ipp.h http.h array.h \
language.h pwg.h raster.h
ppd-util.o: ppd-util.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
../cups/ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
pwg-media.o: pwg-media.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
request.o: request.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
sidechannel.o: sidechannel.c sidechannel.h versioning.h cups-private.h \
string-private.h ../config.h debug-private.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
thread-private.h
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
snmp.o: snmp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h snmp-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h snmp-private.h
snprintf.o: snprintf.c string-private.h ../config.h
string.o: string.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
tempfile.o: tempfile.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
thread.o: thread.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
tls.o: tls.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
file.h pwg.h thread-private.h tls-darwin.c
../cups/cups.h file.h ipp.h http.h language.h pwg.h http-private.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
tls-darwin.c
transcode.o: transcode.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
usersys.o: usersys.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
util.o: util.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
error.o: error.c ../cups/raster-private.h raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/debug-private.h ../cups/string-private.h ../config.h
interpret.o: interpret.c ../cups/raster-private.h raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/debug-private.h ../cups/string-private.h ../config.h \
../cups/ppd.h
raster.o: raster.c ../cups/raster-private.h raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/debug-private.h ../cups/string-private.h ../config.h
rasterbench.o: rasterbench.c ../config.h ../cups/raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h
testadmin.o: testadmin.c adminutil.h cups.h file.h versioning.h ipp.h \
http.h array.h language.h pwg.h string-private.h ../config.h
testarray.o: testarray.c string-private.h ../config.h debug-private.h \
@@ -257,60 +260,68 @@ testcache.o: testcache.c ppd-private.h ../cups/cups.h file.h versioning.h \
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \
pwg-private.h file-private.h cups-private.h string-private.h \
../config.h debug-private.h array-private.h ipp-private.h \
http-private.h md5-private.h language-private.h ../cups/transcode.h \
thread-private.h
http-private.h language-private.h ../cups/transcode.h thread-private.h
testclient.o: testclient.c ../cups/cups.h file.h versioning.h ipp.h \
http.h array.h language.h pwg.h ../cups/raster.h \
../cups/string-private.h ../config.h ../cups/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
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
testcups.o: testcups.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/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd.h raster.h
testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \
language.h pwg.h
testfile.o: testfile.c string-private.h ../config.h debug-private.h \
../cups/versioning.h file.h
testgetdests.o: testgetdests.c cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h
testhttp.o: testhttp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
testi18n.o: testi18n.c string-private.h ../config.h language-private.h \
../cups/transcode.h language.h array.h versioning.h
testipp.o: testipp.c file.h versioning.h string-private.h ../config.h \
ipp-private.h ../cups/ipp.h http.h array.h
ipp-private.h ../cups/cups.h ipp.h http.h array.h language.h pwg.h
testoptions.o: testoptions.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
testlang.o: testlang.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
../cups/ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
testppd.o: testppd.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \
../cups/ppd.h raster.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
testpwg.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h \
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \
pwg-private.h file-private.h cups-private.h string-private.h \
../config.h debug-private.h array-private.h ipp-private.h \
http-private.h md5-private.h language-private.h ../cups/transcode.h \
thread-private.h
http-private.h language-private.h ../cups/transcode.h thread-private.h
testraster.o: testraster.c ../cups/raster-private.h raster.h cups.h \
file.h versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/debug-private.h ../cups/string-private.h ../config.h \
../cups/ppd.h
testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h snmp-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h snmp-private.h
tlscheck.o: tlscheck.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h thread-private.h
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
+153 -15
Ver Arquivo
@@ -1,22 +1,16 @@
#
# Library Makefile for CUPS.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 2007-2018 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
include ../Makedefs
#
# Options to build libcups without the use of deprecated APIs...
#
OPTIONS = -D_CUPS_NO_DEPRECATED=1 -D_PPD_DEPRECATED=""
#
# Object files...
#
@@ -45,6 +39,8 @@ LIBOBJS = \
http-addrlist.o \
http-support.o \
ipp.o \
ipp-file.o \
ipp-vars.o \
ipp-support.o \
langprintf.o \
language.o \
@@ -74,10 +70,18 @@ LIBOBJS = \
transcode.o \
usersys.o \
util.o
IMAGEOBJS = \
error.o \
interpret.o \
raster.o
XFORMOBJS = \
xform.o
TESTOBJS = \
rasterbench.o \
testadmin.o \
testarray.o \
testcache.o \
testclient.o \
testconflicts.o \
testcreds.o \
testcups.o \
@@ -91,10 +95,13 @@ TESTOBJS = \
testlang.o \
testppd.o \
testpwg.o \
testraster.o \
testsnmp.o \
tlscheck.o
OBJS = \
$(LIBOBJS) \
$(IMAGEOBJS) \
$(XFORMOBJS) \
$(TESTOBJS)
@@ -141,13 +148,18 @@ HEADERSPRIV = \
#
LIBTARGETS = \
$(LIBCUPSIMAGE) \
$(LIBCUPSSTATIC) \
$(LIBCUPS)
$(LIBCUPS) \
libcupsimage.a \
libcupsxform.a
UNITTARGETS = \
rasterbench \
testadmin \
testarray \
testcache \
testclient \
testconflicts \
testcreds \
testcups \
@@ -161,6 +173,7 @@ UNITTARGETS = \
testoptions \
testppd \
testpwg \
testraster \
testsnmp \
tlscheck
@@ -196,6 +209,7 @@ unittests: $(UNITTARGETS)
clean:
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
$(RM) libcups.so libcups.dylib
$(RM) libcupsimage.so libcupsimage.dylib
#
@@ -270,10 +284,23 @@ install-libs: $(INSTALLSTATIC)
$(RM) $(LIBDIR)/libcups.dylib; \
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
fi
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
-if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
$(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
fi
-if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
$(RM) $(LIBDIR)/libcupsimage.dylib; \
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
fi
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
$(INSTALL_DIR) $(SYMROOT); \
cp $(LIBCUPS) $(SYMROOT); \
dsymutil $(SYMROOT)/$(LIBCUPS); \
cp $(LIBCUPSIMAGE) $(SYMROOT); \
dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
fi
installstatic:
@@ -281,6 +308,9 @@ installstatic:
$(INSTALL_LIB) -m 755 $(LIBCUPSSTATIC) $(LIBDIR)
$(RANLIB) $(LIBDIR)/$(LIBCUPSSTATIC)
$(CHMOD) 555 $(LIBDIR)/$(LIBCUPSSTATIC)
$(INSTALL_LIB) -m 755 libcupsimage.a $(LIBDIR)
$(RANLIB) $(LIBDIR)/libcupsimage.a
$(CHMOD) 555 $(LIBDIR)/libcupsimage.a
#
@@ -293,6 +323,11 @@ uninstall:
$(RM) $(LIBDIR)/libcups.dylib
$(RM) $(LIBDIR)/libcups.so
$(RM) $(LIBDIR)/libcups.so.2
$(RM) $(LIBDIR)/libcupsimage.2.dylib
$(RM) $(LIBDIR)/libcupsimage.a
$(RM) $(LIBDIR)/libcupsimage.dylib
$(RM) $(LIBDIR)/libcupsimage.so
$(RM) $(LIBDIR)/libcupsimage.so.2
-$(RMDIR) $(LIBDIR)
for file in $(HEADERS); do \
$(RM) $(INCLUDEDIR)/cups/$$file; \
@@ -325,7 +360,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 2.12.0 \
-current_version 2.14.0 \
-compatibility_version 2.0.0 \
-exported_symbols_list t.exp \
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
@@ -341,7 +376,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
libcups.la: $(LIBOBJS)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
-rpath $(LIBDIR) -version-info 2:12 $(LIBGSSAPI) $(SSLLIBS) \
-rpath $(LIBDIR) -version-info 2:14 $(LIBGSSAPI) $(SSLLIBS) \
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
@@ -360,12 +395,12 @@ libcups.a: $(LIBOBJS)
# libcups2.def (Windows DLL exports file...)
#
libcups2.def: $(LIBOBJS) Makefile
libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
echo Generating $@...
echo "LIBRARY libcups2" >libcups2.def
echo "VERSION 2.12" >>libcups2.def
echo "VERSION 2.14" >>libcups2.def
echo "EXPORTS" >>libcups2.def
(nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
(nm $(LIBOBJS) $(IMAGEOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
grep -v -E \
-e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel' \
@@ -373,6 +408,75 @@ libcups2.def: $(LIBOBJS) Makefile
sed -e '1,$$s/^_//' | sort >>libcups2.def
#
# libcupsimage.so.2
#
libcupsimage.so.2: $(IMAGEOBJS) libcups.so.2
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
-L../cups $(LINKCUPS)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
#
# libcupsimage.2.dylib
#
libcupsimage.2.dylib: $(IMAGEOBJS) libcups.2.dylib
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 2.3.0 \
-compatibility_version 2.0.0 \
$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS)
$(RM) libcupsimage.dylib
$(LN) $@ libcupsimage.dylib
#
# libcupsimage.la
#
libcupsimage.la: $(IMAGEOBJS) libcups.la
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
-L../cups $(LINKCUPS) \
-rpath $(LIBDIR) -version-info 2:3
#
# libcupsimage.a
#
libcupsimage.a: $(IMAGEOBJS)
echo Archiving $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
$(RANLIB) $@
#
# libcupsxform.a
#
libcupsxform.a: $(XFORMOBJS)
echo Archiving $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(XFORMOBJS)
$(RANLIB) $@
#
# rasterbench
#
rasterbench: rasterbench.o libcupsimage.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
#
# testadmin (dependency on static CUPS library is intentional)
#
@@ -405,6 +509,17 @@ testcache: testcache.o $(LIBCUPSSTATIC)
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
# testclient (dependency on static libraries is intentional)
#
testclient: testclient.o $(LIBCUPSSTATIC) libcupsimage.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testclient.o \
libcupsimage.a $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
# testconflicts (dependency on static CUPS library is intentional)
#
@@ -563,6 +678,19 @@ testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
./testpwg test.ppd
#
# testraster
#
testraster: testraster.o $(LIBCUPSSTATIC) libcupsimage.a
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
$(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
echo Running raster API tests...
./testraster
#
# testsnmp (dependency on static CUPS library is intentional)
#
@@ -610,6 +738,14 @@ apihelp:
--header api-ppd.header --intro api-ppd.shtml \
api-ppd.xml ppd.h ppd-*.c >../doc/help/api-ppd.html
$(RM) api-ppd.xml
mxmldoc --section "Programming" --title "Raster API" \
--css ../doc/cups-printable.css \
--header api-raster.header --intro api-raster.shtml \
api-raster.xml \
../cups/raster.h interpret.c raster.c \
>../doc/help/api-raster.html
mxmldoc --tokens help/api-raster.html api-raster.xml >../doc/help/api-raster.tokens
$(RM) api-raster.xml
mxmldoc --section "Programming" \
--title "Filter and Backend Programming" \
--css ../doc/cups-printable.css \
@@ -627,6 +763,8 @@ apihelp:
sloc:
echo "libcups: \c"
sloccount $(LIBOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
echo "libcupsimage: \c"
sloccount $(IMAGEOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
#
+1 -1
Ver Arquivo
@@ -77,7 +77,7 @@ extern ipp_status_t cupsGetDevices(http_t *http, int timeout,
const char *include_schemes,
const char *exclude_schemes,
cups_device_cb_t callback,
void *user_data) _CUPS_API_1_4;
void *user_data) _CUPS_DEPRECATED;
# ifdef __cplusplus
+3 -6
Ver Arquivo
@@ -1,13 +1,10 @@
<!--
Administrative API header for CUPS.
Copyright 2016 by Apple Inc.
Copyright © 2016 by Apple Inc.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
law. Distribution and use rights are outlined in the file "LICENSE.txt"
which should have been included with this file. If this file is
file is missing or damaged, see the license at "http://www.cups.org/".
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
-->
<h1 class='title'>Administrative APIs</h1>
+3 -6
Ver Arquivo
@@ -1,13 +1,10 @@
<!--
Administrative API documentation for CUPS.
Copyright 2016 by Apple Inc.
Copyright © 2016 by Apple Inc.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
law. Distribution and use rights are outlined in the file "LICENSE.txt"
which should have been included with this file. If this file is
file is missing or damaged, see the license at "http://www.cups.org/".
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
-->
<h2 class="title"><a name="OVERVIEW">Overview</a></h2>
+3 -6
Ver Arquivo
@@ -1,13 +1,10 @@
<!--
Filter and backend programming header for CUPS.
Copyright 2008-2016 by Apple Inc.
Copyright © 2008-2016 by Apple Inc.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
law. Distribution and use rights are outlined in the file "LICENSE.txt"
which should have been included with this file. If this file is
file is missing or damaged, see the license at "http://www.cups.org/".
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
-->
<h1 class='title'>Filter and Backend Programming</h1>
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
<!--
Filter and backend programming introduction for CUPS.
Copyright 2007-2016 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
Copyright © 2007-2016 by Apple Inc.
Copyright © 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
law. Distribution and use rights are outlined in the file "LICENSE.txt"
which should have been included with this file. If this file is
file is missing or damaged, see the license at "http://www.cups.org/".
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
-->
<h2 class='title'><a name="OVERVIEW">Overview</a></h2>
-54
Ver Arquivo
@@ -1,54 +0,0 @@
<!--
Introduction to CUPS programming header for CUPS.
Copyright 2008-2016 by Apple Inc.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
law. Distribution and use rights are outlined in the file "LICENSE.txt"
which should have been included with this file. If this file is
file is missing or damaged, see the license at "http://www.cups.org/".
-->
<h1 class='title'>Introduction to CUPS Programming</h1>
<div class='summary'><table summary='General Information'>
<thead>
<tr>
<th>Headers</th>
<th>cups/cups.h<br>
cups/adminutil.h<br>
cups/array.h<br>
cups/dir.h<br>
cups/file.h<br>
cups/http.h<br>
cups/ipp.h<br>
cups/language.h<br>
cups/ppd.h<br>
cups/pwg.h<br>
cups/raster.h</th>
</tr>
</thead>
<tbody>
<tr>
<th>Libraries</th>
<td>-lcups</td>
</tr>
<tr>
<th>See Also</th>
<td>Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</a><br>
Programming: <a href='ppd-compiler.html' target='_top'>Introduction to the PPD Compiler</a><br>
Programming: <a href='api-admin.html' target='_top'>Administrative APIs</a><br>
Programming: <a href='api-array.html' target='_top'>Array API</a><br>
Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
Programming: <a href='api-filedir.html' target='_top'>File and Directory APIs</a><br>
Programming: <a href='api-httpipp.html' target='_top'>HTTP and IPP APIs</a><br>
Programming: <a href='api-ppd.html' target='_top'>PPD API (DEPRECATED)</a><br>
Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
References: <a href='ref-ppdcfile.html' target='_top'>PPD Compiler Driver Information File Reference</a><br>
Specifications: <a href='spec-ppd.html' target='_top'>CUPS PPD Extensions</a></td>
</tr>
</tbody>
</table></div>
-92
Ver Arquivo
@@ -1,92 +0,0 @@
<!--
Introduction to CUPS programming content for CUPS.
Copyright 2008-2011 by Apple Inc.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
law. Distribution and use rights are outlined in the file "LICENSE.txt"
which should have been included with this file. If this file is
file is missing or damaged, see the license at "http://www.cups.org/".
-->
<h2 class="title"><a name="OVERVIEW">Overview</a></h2>
<p>CUPS provides two libraries that interface with the different parts of the
printing system. The "cups" library provides all of the common application and
filter functions while the "cupsimage" library provides all of the imaging
functions used in raster printer drivers. The "cups" library functions are
accessed by including the <var>&lt;cups/cups.h&gt;</var> header, while
"cupsimage" functions are found in the <var>&lt;cups/raster.h&gt;</var>
header.</p>
<h2 class="title"><a name="COMPILING">Compiling Programs</a></h2>
<p>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.</p>
<p>The following simple program lists the available printers on the system:</p>
<pre class="example">
#include &lt;stdio.h&gt;
#include &lt;cups/cups.h&gt;
int main(void)
{
int i;
cups_dest_t *dests, *dest;
int num_dests = cupsGetDests(&amp;dests);
for (i = num_dests, dest = dests; i &gt; 0; i --, dest ++)
{
if (dest->instance)
printf("%s/%s\n", dest->name, dest->instance);
else
puts(dest->name);
}
return (0);
}
</pre>
<h3><a name="XCODE">Compiling with Xcode</a></h3>
<p>In Xcode, choose <var>New Project...</var> from the <var>File</var> menu,
then select the <var>Standard Tool</var> project type under <var>Command Line
Utility</var>. Click <var>Next</var> and choose a project directory. Click
<var>Next</var> to create the project.</p>
<p>In the project window, double-click on the <var>Targets</var> group and
control-click on the simple target to show the context menu. Choose
<var>Existing Framework...</var> from the <var>Add</var> submenu. When the file
chooser sheet appears, press the <kbd>/</kbd> key and enter "/usr/lib". Scroll
down the file list and select the <var>libcups.dylib</var> file. Click the
<var>Add</var> button in the file chooser and attributes sheets.</p>
<p>In the project window, double-click on the <var>main.c</var> source file.
Replace the template source code with the listing above and save it. Click the
<var>Build and Go</var> button to build the sample program and run it.</p>
<h3><a name="COMMANDLINE">Compiling with GCC</a></h3>
<p>From the command-line, create a file called <var>sample.c</var> using your
favorite editor and then run the following command to compile it with GCC and
run it:</p>
<pre class="command">
gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
./simple
</pre>
<p>The <code>cups-config</code> command provides the compiler flags
("cups-config --cflags") and libraries ("cups-config --libs") needed for the
local system.</p>
<h2 class="title"><a name="WHERETOGO">Where to Go Next</a></h2>
<p>If you are developing a print filter, driver, or backend, see the
<a href="api-filter.html" target="_top">Filter and Backend Programming</a>
guide. Raster printer driver developers should also read the
<a href="api-raster.html" target="_top">Raster API</a> reference.</p>
+3 -6
Ver Arquivo
@@ -1,13 +1,10 @@
<!--
PPD API header for CUPS.
Copyright 2008-2012 by Apple Inc.
Copyright © 2008-2012 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/".
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
-->
<h1 class='title'>PPD API (DEPRECATED)</h1>
+5 -8
Ver Arquivo
@@ -1,19 +1,16 @@
<!--
PPD API introduction for CUPS.
Copyright 2007-2012 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
Copyright © 2007-2018 by Apple Inc.
Copyright © 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
law. Distribution and use rights are outlined in the file "LICENSE.txt"
which should have been included with this file. If this file is
file is missing or damaged, see the license at "http://www.cups.org/".
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
-->
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
<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>
<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="cupspm.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
@@ -1,13 +1,10 @@
<!--
Raster API documentation for CUPS.
Copyright 2008-2010 by Apple Inc.
Copyright © 2008-2010 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/".
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
-->
<h1 class='title'>Raster API</h1>
@@ -1,14 +1,11 @@
<!--
Raster API introduction for CUPS.
Copyright 2007-2013 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
Copyright © 2007-2013 by Apple Inc.
Copyright © 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
property of Apple Inc. and are protected by Federal copyright
law. Distribution and use rights are outlined in the file "LICENSE.txt"
which should have been included with this file. If this file is
file is missing or damaged, see the license at "http://www.cups.org/".
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
-->
<h2 class='title'><a name="OVERVIEW">Overview</a></h2>
+3 -3
Ver Arquivo
@@ -212,7 +212,7 @@ cupsDoAuthentication(
if (!cg->lang_default)
cg->lang_default = cupsLangDefault();
if (cups_auth_param(scheme, "username", default_username, sizeof(default_username)))
if (cups_auth_param(schemedata, "username", default_username, sizeof(default_username)))
cupsSetUser(default_username);
snprintf(prompt, sizeof(prompt), _cupsLangString(cg->lang_default, _("Password for %s on %s? ")), cupsUser(), http->hostname[0] == '/' ? "localhost" : http->hostname);
@@ -614,7 +614,7 @@ cups_auth_find(const char *www_authenticate, /* I - Pointer into WWW-Authenticat
* See if this is "Scheme" followed by whitespace or the end of the string.
*/
if (!strncmp(www_authenticate, scheme, schemelen) && (isspace(www_authenticate[schemelen] & 255) || !www_authenticate[schemelen]))
if (!strncmp(www_authenticate, scheme, schemelen) && (isspace(www_authenticate[schemelen] & 255) || www_authenticate[schemelen] == ',' || !www_authenticate[schemelen]))
{
/*
* Yes, this is the start of the scheme-specific information...
@@ -795,7 +795,7 @@ cups_auth_scheme(const char *www_authenticate, /* I - Pointer into WWW-Authentic
* Parse the scheme name or param="value" string...
*/
for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && !isspace(*www_authenticate & 255); www_authenticate ++)
for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && *www_authenticate != ',' && !isspace(*www_authenticate & 255); www_authenticate ++)
{
if (*www_authenticate == '=')
param = 1;
+10 -16
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Private definitions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_CUPS_PRIVATE_H_
@@ -231,14 +232,10 @@ extern void _cupsBufferRelease(char *b);
extern http_t *_cupsConnect(void);
extern char *_cupsCreateDest(const char *name, const char *info, const char *device_id, const char *device_uri, char *uri, size_t urisize);
extern void _cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, _ipp_option_t *map, const char *name, const char *value);
extern int _cupsGet1284Values(const char *device_id,
cups_option_t **values);
extern const char *_cupsGetDestResource(cups_dest_t *dest, char *resource,
size_t resourcesize);
extern int _cupsGetDests(http_t *http, ipp_op_t op,
const char *name, cups_dest_t **dests,
cups_ptype_t type, cups_ptype_t mask);
extern ipp_attribute_t *_cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, _ipp_option_t *map, const char *name, const char *value);
extern int _cupsGet1284Values(const char *device_id, cups_option_t **values);
extern const char *_cupsGetDestResource(cups_dest_t *dest, unsigned flags, char *resource, size_t resourcesize);
extern int _cupsGetDests(http_t *http, ipp_op_t op, const char *name, cups_dest_t **dests, cups_ptype_t type, cups_ptype_t mask);
extern const char *_cupsGetPassword(const char *prompt);
extern void _cupsGlobalLock(void);
extern _cups_globals_t *_cupsGlobals(void);
@@ -248,13 +245,10 @@ extern const char *_cupsGSSServiceName(void);
# endif /* HAVE_GSSAPI */
extern int _cupsNextDelay(int current, int *previous);
extern void _cupsSetDefaults(void);
extern void _cupsSetError(ipp_status_t status, const char *message,
int localize);
extern void _cupsSetError(ipp_status_t status, const char *message, int localize);
extern void _cupsSetHTTPError(http_status_t status);
# ifdef HAVE_GSSAPI
extern int _cupsSetNegotiateAuthString(http_t *http,
const char *method,
const char *resource);
extern int _cupsSetNegotiateAuthString(http_t *http, const char *method, const char *resource);
# endif /* HAVE_GSSAPI */
extern char *_cupsUserDefault(char *name, size_t namesize);
+5 -2
Ver Arquivo
@@ -600,9 +600,12 @@ extern ssize_t cupsHashData(const char *algorithm, const void *data, size_t dat
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;
/* New in CUPS 2.2.7 */
extern const char *cupsHashString(const unsigned char *hash, size_t hashsize, char *buffer, size_t bufsize) _CUPS_API_2_2_7;
/* New in CUPS 2.3 */
extern int cupsAddDestMediaOptions(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, unsigned flags, cups_size_t *size, int num_options, cups_option_t **options);
extern const char *cupsHashString(const unsigned char *hash, size_t hashsize, char *buffer, size_t bufsize) _CUPS_API_2_3;
extern int cupsAddDestMediaOptions(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, unsigned flags, cups_size_t *size, int num_options, cups_option_t **options) _CUPS_API_2_3;
extern ipp_attribute_t *cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, const char *name, const char *value) _CUPS_API_2_3;
# ifdef __cplusplus
}
+2 -2
Ver Arquivo
@@ -1,8 +1,8 @@
---
title: CUPS Programming Manual
author: Michael R Sweet
copyright: Copyright © 2007-2017 by Apple Inc. All Rights Reserved.
version: 2.2.5
copyright: Copyright © 2007-2018 by Apple Inc. All Rights Reserved.
version: 2.3.0
...
> Please [file issues on Github](https://github.com/apple/cups/issues) to
+50 -21
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* Destination option/media support for CUPS.
*
* Copyright 2012-2017 by Apple Inc.
* Copyright © 2012-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -666,6 +667,7 @@ cupsCopyDestInfo(
cups_dest_t *dest) /* I - Destination */
{
cups_dinfo_t *dinfo; /* Destination information */
unsigned dflags; /* Destination flags */
ipp_t *request, /* Get-Printer-Attributes request */
*response; /* Supported attributes */
int tries, /* Number of tries so far */
@@ -675,6 +677,7 @@ cupsCopyDestInfo(
char resource[1024]; /* Resource path */
int version; /* IPP version */
ipp_status_t status; /* Status of request */
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
static const char * const requested_attrs[] =
{ /* Requested attributes */
"job-template",
@@ -683,14 +686,35 @@ cupsCopyDestInfo(
};
DEBUG_printf(("cupsCopyDestSupported(http=%p, dest=%p(%s))", (void *)http, (void *)dest, dest ? dest->name : ""));
DEBUG_printf(("cupsCopyDestInfo(http=%p, dest=%p(%s))", (void *)http, (void *)dest, dest ? dest->name : ""));
/*
* Get the default connection as needed...
*/
if (!http)
http = _cupsConnect();
{
DEBUG_puts("1cupsCopyDestInfo: Default server connection.");
http = _cupsConnect();
dflags = CUPS_DEST_FLAGS_NONE;
}
#ifdef AF_LOCAL
else if (httpAddrFamily(http->hostaddr) == AF_LOCAL)
{
DEBUG_puts("1cupsCopyDestInfo: Connection to server (domain socket).");
dflags = CUPS_DEST_FLAGS_NONE;
}
#endif /* AF_LOCAL */
else if ((strcmp(http->hostname, cg->server) && cg->server[0] != '/') || cg->ipp_port != httpAddrPort(http->hostaddr))
{
DEBUG_printf(("1cupsCopyDestInfo: Connection to device (%s).", http->hostname));
dflags = CUPS_DEST_FLAGS_DEVICE;
}
else
{
DEBUG_printf(("1cupsCopyDestInfo: Connection to server (%s).", http->hostname));
dflags = CUPS_DEST_FLAGS_NONE;
}
/*
* Range check input...
@@ -703,8 +727,11 @@ cupsCopyDestInfo(
* Get the printer URI and resource path...
*/
if ((uri = _cupsGetDestResource(dest, resource, sizeof(resource))) == NULL)
if ((uri = _cupsGetDestResource(dest, dflags, resource, sizeof(resource))) == NULL)
{
DEBUG_puts("1cupsCopyDestInfo: Unable to get resource.");
return (NULL);
}
/*
* Get the supported attributes...
@@ -722,28 +749,25 @@ cupsCopyDestInfo(
*/
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes",
(int)(sizeof(requested_attrs) / sizeof(requested_attrs[0])),
NULL, requested_attrs);
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(requested_attrs) / sizeof(requested_attrs[0])), NULL, requested_attrs);
response = cupsDoRequest(http, request, resource);
status = cupsLastError();
if (status > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
{
DEBUG_printf(("cupsCopyDestSupported: Get-Printer-Attributes for '%s' "
"returned %s (%s)", dest->name, ippErrorString(status),
cupsLastErrorString()));
DEBUG_printf(("1cupsCopyDestInfo: Get-Printer-Attributes for '%s' returned %s (%s)", dest->name, ippErrorString(status), cupsLastErrorString()));
ippDelete(response);
response = NULL;
if (status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED && version > 11)
if ((status == IPP_STATUS_ERROR_BAD_REQUEST || status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) && version > 11)
{
version = 11;
}
else if (status == IPP_STATUS_ERROR_BUSY)
{
sleep((unsigned)delay);
@@ -759,7 +783,10 @@ cupsCopyDestInfo(
while (!response && tries < 10);
if (!response)
{
DEBUG_puts("1cupsCopyDestInfo: Unable to get printer attributes.");
return (NULL);
}
/*
* Allocate a cups_dinfo_t structure and return it...
@@ -772,6 +799,8 @@ cupsCopyDestInfo(
return (NULL);
}
DEBUG_printf(("1cupsCopyDestInfo: version=%d, uri=\"%s\", resource=\"%s\".", version, uri, resource));
dinfo->version = version;
dinfo->uri = uri;
dinfo->resource = _cupsStrAlloc(resource);
@@ -1497,18 +1526,18 @@ cups_collection_string(
if (!ippGetBoolean(member, 0))
{
if (bufptr < bufend)
strlcpy(bufptr, "no", bufend - bufptr + 1);
strlcpy(bufptr, "no", (size_t)(bufend - bufptr + 1));
bufptr += 2;
}
if (bufptr < bufend)
strlcpy(bufptr, mname, bufend - bufptr + 1);
strlcpy(bufptr, mname, (size_t)(bufend - bufptr + 1));
bufptr += strlen(mname);
continue;
}
if (bufptr < bufend)
strlcpy(bufptr, mname, bufend - bufptr + 1);
strlcpy(bufptr, mname, (size_t)(bufend - bufptr + 1));
bufptr += strlen(mname);
if (bufptr < bufend)
@@ -1544,7 +1573,7 @@ cups_collection_string(
{
case IPP_TAG_INTEGER :
case IPP_TAG_ENUM :
bufptr += snprintf(bufptr, bufptr < bufend ? (bufend - bufptr + 1) : 0, "%d", ippGetInteger(member, j));
bufptr += snprintf(bufptr, bufptr < bufend ? (size_t)(bufend - bufptr + 1) : 0, "%d", ippGetInteger(member, j));
break;
case IPP_TAG_STRING :
+84 -165
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* User-defined destination (and option) support for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -73,7 +74,6 @@ typedef enum _cups_dnssd_state_e /* Enumerated device state */
_CUPS_DNSSD_QUERY,
_CUPS_DNSSD_PENDING,
_CUPS_DNSSD_ACTIVE,
_CUPS_DNSSD_LOCAL,
_CUPS_DNSSD_INCOMPATIBLE,
_CUPS_DNSSD_ERROR
} _cups_dnssd_state_t;
@@ -192,14 +192,6 @@ static _cups_dnssd_device_t *
const char *regtype,
const char *replyDomain);
# ifdef HAVE_DNSSD
static void cups_dnssd_local_cb(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *serviceName,
const char *regtype,
const char *replyDomain,
void *context);
static void cups_dnssd_query_cb(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
@@ -572,7 +564,7 @@ _cupsAppleSetUseLastPrinter(
/*
* 'cupsConnectDest()' - Open a conection to the destination.
* 'cupsConnectDest()' - Open a connection to the destination.
*
* Connect to the destination, returning a new @code http_t@ connection object
* and optionally the resource path to use for the destination. These calls
@@ -581,7 +573,7 @@ _cupsAppleSetUseLastPrinter(
* returns 0. The caller is responsible for calling @link httpClose@ on the
* returned connection.
*
* Starting with CUPS 2.2.4, the caller can pass @code CUPS_DEST_FLAGS_DEVICE@
* Starting with CUPS 2.2.4, the caller can pass @code CUPS_DEST_FLAGS_DEVICE@
* for the "flags" argument to connect directly to the device associated with
* the destination. Otherwise, the connection is made to the CUPS scheduler
* associated with the destination.
@@ -849,6 +841,8 @@ cupsCopyDest(cups_dest_t *dest, /* I - Destination to copy */
if (new_dest)
{
new_dest->is_default = dest->is_default;
if ((new_dest->options = calloc(sizeof(cups_option_t), (size_t)dest->num_options)) == NULL)
return (cupsRemoveDest(dest->name, dest->instance, num_dests, dests));
@@ -1101,20 +1095,23 @@ cupsGetDest(const char *name, /* I - Destination name or @code NULL@ for the d
* '_cupsGetDestResource()' - Get the resource path and URI for a destination.
*/
const char * /* O - Printer URI */
const char * /* O - URI */
_cupsGetDestResource(
cups_dest_t *dest, /* I - Destination */
unsigned flags, /* I - Destination flags */
char *resource, /* I - Resource buffer */
size_t resourcesize) /* I - Size of resource buffer */
{
const char *uri; /* Printer URI */
const char *uri, /* URI */
*device_uri, /* Device URI */
*printer_uri; /* Printer URI */
char scheme[32], /* URI scheme */
userpass[256], /* Username and password (unused) */
hostname[256]; /* Hostname */
int port; /* Port number */
DEBUG_printf(("_cupsGetDestResource(dest=%p(%s), resource=%p, resourcesize=%d)", (void *)dest, dest->name, (void *)resource, (int)resourcesize));
DEBUG_printf(("_cupsGetDestResource(dest=%p(%s), flags=%u, resource=%p, resourcesize=%d)", (void *)dest, dest->name, flags, (void *)resource, (int)resourcesize));
/*
* Range check input...
@@ -1130,25 +1127,46 @@ _cupsGetDestResource(
}
/*
* Grab the printer URI...
* Grab the printer and device URIs...
*/
if ((uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options)) == NULL)
{
if ((uri = cupsGetOption("device-uri", dest->num_options, dest->options)) != NULL)
{
device_uri = cupsGetOption("device-uri", dest->num_options, dest->options);
printer_uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options);
DEBUG_printf(("1_cupsGetDestResource: device-uri=\"%s\", printer-uri-supported=\"%s\".", device_uri, printer_uri));
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
if (strstr(uri, "._tcp"))
uri = cups_dnssd_resolve(dest, uri, 5000, NULL, NULL, NULL);
#endif /* HAVE_DNSSD || HAVE_AVAHI */
}
if (uri)
if (((flags & CUPS_DEST_FLAGS_DEVICE) || !printer_uri) && strstr(device_uri, "._tcp"))
{
if ((device_uri = cups_dnssd_resolve(dest, device_uri, 5000, NULL, NULL, NULL)) != NULL)
{
DEBUG_printf(("1_cupsGetDestResource: Resolved printer-uri-supported=\"%s\"", uri));
uri = _cupsCreateDest(dest->name, cupsGetOption("printer-info", dest->num_options, dest->options), NULL, uri, resource, resourcesize);
DEBUG_printf(("1_cupsGetDestResource: Resolved device-uri=\"%s\".", device_uri));
}
else
{
DEBUG_puts("1_cupsGetDestResource: Unable to resolve device.");
if (resource)
*resource = '\0';
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
return (NULL);
}
}
#endif /* HAVE_DNSSD || HAVE_AVAHI */
if (flags & CUPS_DEST_FLAGS_DEVICE)
{
uri = device_uri;
}
else if (printer_uri)
{
uri = printer_uri;
}
else
{
uri = _cupsCreateDest(dest->name, cupsGetOption("printer-info", dest->num_options, dest->options), NULL, device_uri, resource, resourcesize);
if (uri)
{
@@ -1158,30 +1176,24 @@ _cupsGetDestResource(
uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options);
}
else
{
DEBUG_puts("1_cupsGetDestResource: No printer-uri-supported found.");
if (resource)
*resource = '\0';
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
return (NULL);
}
}
else
if (!uri)
{
DEBUG_printf(("1_cupsGetDestResource: printer-uri-supported=\"%s\"", uri));
DEBUG_puts("1_cupsGetDestResource: No printer-uri-supported or device-uri found.");
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
userpass, sizeof(userpass), hostname, sizeof(hostname),
&port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
if (resource)
*resource = '\0';
return (NULL);
}
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
return (NULL);
}
else if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), hostname, sizeof(hostname), &port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad URI."), 1);
return (NULL);
}
DEBUG_printf(("1_cupsGetDestResource: resource=\"%s\"", resource));
@@ -1269,6 +1281,12 @@ cupsGetDestWithURI(const char *name, /* I - Desired printer name or @code NULL@
name = resource + 10;
info = temp;
}
else if (!strncmp(resource, "/ipp/print/", 11))
{
snprintf(temp, sizeof(temp), "%s @ %s", resource + 11, hostname);
name = resource + 11;
info = temp;
}
else
{
name = hostname;
@@ -2626,22 +2644,7 @@ cups_dnssd_browse_cb(
* This object is new on the network.
*/
if (flags & AVAHI_LOOKUP_RESULT_LOCAL)
{
/*
* This comes from the local machine so ignore it.
*/
DEBUG_printf(("cups_dnssd_browse_cb: Ignoring local service \"%s\".", name));
}
else
{
/*
* Create a device entry for it if it doesn't yet exist.
*/
cups_dnssd_get_device(data, name, type, domain);
}
cups_dnssd_get_device(data, name, type, domain);
break;
case AVAHI_BROWSER_REMOVE :
@@ -2862,66 +2865,6 @@ cups_dnssd_get_device(
}
# ifdef HAVE_DNSSD
/*
* 'cups_dnssd_local_cb()' - Browse for local printers.
*/
static void
cups_dnssd_local_cb(
DNSServiceRef sdRef, /* I - Service reference */
DNSServiceFlags flags, /* I - Option flags */
uint32_t interfaceIndex, /* I - Interface number */
DNSServiceErrorType errorCode, /* I - Error, if any */
const char *serviceName, /* I - Name of service/device */
const char *regtype, /* I - Type of service */
const char *replyDomain, /* I - Service domain */
void *context) /* I - Devices array */
{
_cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context;
/* Enumeration data */
_cups_dnssd_device_t *device; /* Device */
DEBUG_printf(("5cups_dnssd_local_cb(sdRef=%p, flags=%x, interfaceIndex=%d, errorCode=%d, serviceName=\"%s\", regtype=\"%s\", replyDomain=\"%s\", context=%p)", (void *)sdRef, flags, interfaceIndex, errorCode, serviceName, regtype, replyDomain, context));
/*
* Only process "add" data...
*/
if (errorCode != kDNSServiceErr_NoError || !(flags & kDNSServiceFlagsAdd))
return;
/*
* Get the device...
*/
device = cups_dnssd_get_device(data, serviceName, regtype, replyDomain);
/*
* Hide locally-registered devices...
*/
DEBUG_printf(("6cups_dnssd_local_cb: Hiding local printer '%s'.",
serviceName));
if (device->ref)
{
DNSServiceRefDeallocate(device->ref);
device->ref = 0;
}
if (device->state == _CUPS_DNSSD_ACTIVE)
{
DEBUG_printf(("6cups_dnssd_local_cb: Remove callback for \"%s\".", device->dest.name));
(*data->cb)(data->user_data, CUPS_DEST_FLAGS_REMOVED, &device->dest);
}
device->state = _CUPS_DNSSD_LOCAL;
}
# endif /* HAVE_DNSSD */
# ifdef HAVE_AVAHI
/*
* 'cups_dnssd_poll_cb()' - Wait for input on the specified file descriptors.
@@ -2971,9 +2914,9 @@ cups_dnssd_poll_cb(
* 'cups_dnssd_query_cb()' - Process query data.
*/
# ifdef HAVE_DNSSD
static void
cups_dnssd_query_cb(
# ifdef HAVE_DNSSD
DNSServiceRef sdRef, /* I - Service reference */
DNSServiceFlags flags, /* I - Data flags */
uint32_t interfaceIndex, /* I - Interface */
@@ -2984,11 +2927,7 @@ cups_dnssd_query_cb(
uint16_t rdlen, /* I - Length of record data */
const void *rdata, /* I - Record data */
uint32_t ttl, /* I - Time-to-live */
void *context) /* I - Enumeration data */
{
# else /* HAVE_AVAHI */
static void
cups_dnssd_query_cb(
AvahiRecordBrowser *browser, /* I - Record browser */
AvahiIfIndex interfaceIndex,
/* I - Interface index (unused) */
@@ -3000,13 +2939,13 @@ cups_dnssd_query_cb(
const void *rdata, /* I - TXT record */
size_t rdlen, /* I - Length of TXT record */
AvahiLookupResultFlags flags, /* I - Flags */
# endif /* HAVE_DNSSD */
void *context) /* I - Enumeration data */
{
# ifdef DEBUG
# if defined(DEBUG) && defined(HAVE_AVAHI)
AvahiClient *client = avahi_record_browser_get_client(browser);
/* Client information */
# endif /* DEBUG */
# endif /* HAVE_DNSSD */
# endif /* DEBUG && HAVE_AVAHI */
_cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context;
/* Enumeration data */
char serviceName[256],/* Service name */
@@ -3466,11 +3405,9 @@ cups_enum_dests(
# ifdef HAVE_DNSSD
int nfds, /* Number of files responded */
main_fd; /* File descriptor for lookups */
DNSServiceRef ipp_ref = NULL, /* IPP browser */
local_ipp_ref = NULL; /* Local IPP browser */
DNSServiceRef ipp_ref = NULL; /* IPP browser */
# ifdef HAVE_SSL
DNSServiceRef ipps_ref = NULL, /* IPPS browser */
local_ipps_ref = NULL; /* Local IPPS browser */
DNSServiceRef ipps_ref = NULL; /* IPPS browser */
# endif /* HAVE_SSL */
# ifdef HAVE_POLL
struct pollfd pfd; /* Polling data */
@@ -3532,6 +3469,8 @@ cups_enum_dests(
*data.def_instance++ = '\0';
}
DEBUG_printf(("1cups_enum_dests: def_name=\"%s\", def_instance=\"%s\"", data.def_name, data.def_instance));
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
@@ -3569,7 +3508,10 @@ cups_enum_dests(
*/
if ((dest = cupsGetDest(data.def_name, data.def_instance, num_dests, dests)) != NULL)
{
DEBUG_printf(("1cups_enum_dests: Setting is_default on \"%s/%s\".", dest->name, dest->instance));
dest->is_default = 1;
}
}
for (i = num_dests, dest = dests;
@@ -3671,17 +3613,6 @@ cups_enum_dests(
return (0);
}
local_ipp_ref = data.main_ref;
if (DNSServiceBrowse(&local_ipp_ref, kDNSServiceFlagsShareConnection, kDNSServiceInterfaceIndexLocalOnly, "_ipp._tcp", NULL, (DNSServiceBrowseReply)cups_dnssd_local_cb, &data) != kDNSServiceErr_NoError)
{
DEBUG_puts("1cups_enum_dests: Unable to create local IPP browser, returning 0.");
DNSServiceRefDeallocate(data.main_ref);
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
# ifdef HAVE_SSL
ipps_ref = data.main_ref;
if (DNSServiceBrowse(&ipps_ref, kDNSServiceFlagsShareConnection, 0, "_ipps._tcp", NULL, (DNSServiceBrowseReply)cups_dnssd_browse_cb, &data) != kDNSServiceErr_NoError)
@@ -3693,17 +3624,6 @@ cups_enum_dests(
return (0);
}
local_ipps_ref = data.main_ref;
if (DNSServiceBrowse(&local_ipps_ref, kDNSServiceFlagsShareConnection, kDNSServiceInterfaceIndexLocalOnly, "_ipps._tcp", NULL, (DNSServiceBrowseReply)cups_dnssd_local_cb, &data) != kDNSServiceErr_NoError)
{
DEBUG_puts("1cups_enum_dests: Unable to create local IPPS browser, returning 0.");
DNSServiceRefDeallocate(data.main_ref);
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
# endif /* HAVE_SSL */
# else /* HAVE_AVAHI */
@@ -3881,7 +3801,10 @@ cups_enum_dests(
}
if (!strcasecmp(dest->name, data.def_name) && !data.def_instance)
{
DEBUG_printf(("1cups_enum_dests: Setting is_default on discovered \"%s\".", dest->name));
dest->is_default = 1;
}
DEBUG_printf(("1cups_enum_dests: Add callback for \"%s\".", device->dest.name));
if (!(*cb)(user_data, CUPS_DEST_FLAGS_NONE, dest))
@@ -3923,14 +3846,10 @@ cups_enum_dests(
# ifdef HAVE_DNSSD
if (ipp_ref)
DNSServiceRefDeallocate(ipp_ref);
if (local_ipp_ref)
DNSServiceRefDeallocate(local_ipp_ref);
# ifdef HAVE_SSL
if (ipps_ref)
DNSServiceRefDeallocate(ipps_ref);
if (local_ipps_ref)
DNSServiceRefDeallocate(local_ipps_ref);
# endif /* HAVE_SSL */
if (data.main_ref)
+39 -10
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Option encoding routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -281,10 +282,17 @@ static const _ipp_option_t ipp_options[] =
{ 0, "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ 1, "printer-alert", IPP_TAG_STRING, IPP_TAG_PRINTER },
{ 1, "printer-alert-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ 1, "printer-commands", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ 1, "printer-finisher", IPP_TAG_STRING, IPP_TAG_PRINTER },
{ 1, "printer-finisher-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ 1, "printer-finisher-supplies", IPP_TAG_STRING, IPP_TAG_PRINTER },
{ 1, "printer-finisher-supplies-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ 0, "printer-geo-location", IPP_TAG_URI, IPP_TAG_PRINTER },
{ 0, "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ 1, "printer-input-tray", IPP_TAG_STRING, IPP_TAG_PRINTER },
{ 0, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ 0, "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ 0, "printer-is-temporary", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
@@ -292,11 +300,14 @@ static const _ipp_option_t ipp_options[] =
{ 0, "printer-make-and-model", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ 0, "printer-more-info", IPP_TAG_URI, IPP_TAG_PRINTER },
{ 0, "printer-op-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ 1, "printer-output-tray", IPP_TAG_STRING, IPP_TAG_PRINTER },
{ 0, "printer-resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "printer-state", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ 0, "printer-state-change-time", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 1, "printer-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 1, "printer-supply", IPP_TAG_STRING, IPP_TAG_PRINTER },
{ 1, "printer-supply-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ 0, "printer-type", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ 0, "printer-uri", IPP_TAG_URI, IPP_TAG_OPERATION },
{ 1, "printer-uri-supported", IPP_TAG_URI, IPP_TAG_PRINTER },
@@ -337,7 +348,7 @@ static int compare_ipp_options(_ipp_option_t *a, _ipp_option_t *b);
* '_cupsEncodeOption()' - Encode a single option as an IPP attribute.
*/
void
ipp_attribute_t * /* O - New attribute or @code NULL@ on error */
_cupsEncodeOption(
ipp_t *ipp, /* I - IPP request/response/collection */
ipp_tag_t group_tag, /* I - Group tag */
@@ -417,7 +428,7 @@ _cupsEncodeOption(
*/
DEBUG_puts("1_cupsEncodeOption: Ran out of memory for attributes.");
return;
return (NULL);
}
if (count > 1)
@@ -434,7 +445,7 @@ _cupsEncodeOption(
DEBUG_puts("1_cupsEncodeOption: Ran out of memory for value copy.");
ippDeleteAttribute(ipp, attr);
return;
return (NULL);
}
val = copy;
@@ -605,7 +616,7 @@ _cupsEncodeOption(
free(copy);
ippDeleteAttribute(ipp, attr);
return;
return (NULL);
}
ippSetCollection(ipp, &attr, i, collection);
@@ -621,6 +632,24 @@ _cupsEncodeOption(
if (copy)
free(copy);
return (attr);
}
/*
* 'cupsEncodeOption()' - Encode a single option into an IPP attribute.
*
* @since CUPS 2.3@
*/
ipp_attribute_t * /* O - New attribute or @code NULL@ on error */
cupsEncodeOption(ipp_t *ipp, /* I - IPP request/response */
ipp_tag_t group_tag, /* I - Attribute group */
const char *name, /* I - Option name */
const char *value) /* I - Option string value */
{
return (_cupsEncodeOption(ipp, group_tag, _ippFindOption(name), name, value));
}
@@ -633,7 +662,7 @@ _cupsEncodeOption(
*/
void
cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
cupsEncodeOptions(ipp_t *ipp, /* I - IPP request/response */
int num_options, /* I - Number of options */
cups_option_t *options) /* I - Options */
{
@@ -661,7 +690,7 @@ cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
void
cupsEncodeOptions2(
ipp_t *ipp, /* I - Request to add to */
ipp_t *ipp, /* I - IPP request/response */
int num_options, /* I - Number of options */
cups_option_t *options, /* I - Options */
ipp_tag_t group_tag) /* I - Group to encode */
@@ -688,7 +717,7 @@ cupsEncodeOptions2(
op = ippGetOperation(ipp);
if (group_tag == IPP_TAG_OPERATION && (op == IPP_OP_PRINT_JOB || op == IPP_OP_PRINT_URI || op == IPP_OP_SEND_DOCUMENT || op == IPP_OP_SEND_URI))
if (group_tag == IPP_TAG_OPERATION && (op == IPP_OP_PRINT_JOB || op == IPP_OP_PRINT_URI || op == IPP_OP_SEND_DOCUMENT || op == IPP_OP_SEND_URI))
{
/*
* Handle the document format stuff first...
Ver Arquivo
+4 -1
Ver Arquivo
@@ -23,7 +23,10 @@
* parameters provide comma-delimited lists of backends to include or omit from
* the request respectively.
*
* @since CUPS 1.4/macOS 10.6@
* This function is deprecated with the IPP printer discovery functionality
* being provided by the @link cupsEnumDests@ and @cupsGetDests@ functions.
*
* @deprecated@
*/
ipp_status_t /* O - Request status - @code IPP_OK@ on success. */
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* Network interface functions for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright © 2007-2010 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+5 -2
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* Hashing function for CUPS.
*
* Copyright 2015-2017 by Apple Inc.
* Copyright © 2015-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -274,6 +275,8 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
* 'cupsHashString()' - Format a hash value as a hexadecimal string.
*
* The passed buffer must be at least 2 * hashsize + 1 characters in length.
*
* @since CUPS 2.2.7@
*/
const char * /* O - Formatted string */
+9 -16
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Private HTTP definitions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_HTTP_PRIVATE_H_
@@ -285,8 +286,8 @@ struct _http_s /**** HTTP connection structure ****/
struct sockaddr_in _hostaddr; /* Address of connected host (deprecated) */
char hostname[HTTP_MAX_HOST],
/* Name of connected host */
fields[HTTP_FIELD_ACCEPT_ENCODING][HTTP_MAX_VALUE];
/* Field values up to Accept-Encoding */
_fields[HTTP_FIELD_ACCEPT_ENCODING][HTTP_MAX_VALUE];
/* Field values up to Accept-Encoding (deprecated) */
char *data; /* Pointer to data buffer */
http_encoding_t data_encoding; /* Chunked or not */
int _data_remaining;/* Number of bytes left (deprecated) */
@@ -322,8 +323,6 @@ struct _http_s /**** HTTP connection structure ****/
int wused; /* Write buffer bytes used */
/**** New in CUPS 1.3 ****/
char *field_authorization;
/* Authorization field */
char *authstring; /* Current Authorization field */
# ifdef HAVE_GSSAPI
gss_OID gssmech; /* Authentication mechanism */
@@ -348,14 +347,6 @@ struct _http_s /**** HTTP connection structure ****/
/**** New in CUPS 1.7 ****/
int tls_upgrade; /* Non-zero if we are doing an upgrade */
_http_mode_t mode; /* _HTTP_MODE_CLIENT or _HTTP_MODE_SERVER */
char *accept_encoding,
/* Accept-Encoding field */
*allow, /* Allow field */
*server, /* Server field */
*default_accept_encoding,
*default_server,
*default_user_agent;
/* Default field values */
# ifdef HAVE_LIBZ
_http_coding_t coding; /* _HTTP_CODING_xxx */
z_stream stream; /* (De)compression stream */
@@ -363,8 +354,10 @@ struct _http_s /**** HTTP connection structure ****/
# endif /* HAVE_LIBZ */
/**** New in CUPS 2.3 ****/
char *www_authenticate;
/* WWW-Authenticate value */
char *fields[HTTP_FIELD_MAX],
/* Allocated field values */
*default_fields[HTTP_FIELD_MAX];
/* Default field values, if any */
};
# endif /* !_HTTP_NO_PRIVATE */
+4 -3
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* HTTP support routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -1026,7 +1027,7 @@ httpSeparateURI(
*ptr = '\0';
if (*uri != ':')
if (*uri != ':' || *scheme == '.' || !*scheme)
{
*scheme = '\0';
return (HTTP_URI_STATUS_BAD_SCHEME);
+211 -269
Ver Arquivo
@@ -1,13 +1,14 @@
/*
* HTTP routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
* Jelmer Vernooij.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -33,6 +34,7 @@
* Local functions...
*/
static void http_add_field(http_t *http, http_field_t field, const char *value, int append);
#ifdef HAVE_LIBZ
static void http_content_coding_finish(http_t *http);
static void http_content_coding_start(http_t *http,
@@ -281,11 +283,22 @@ httpClearCookie(http_t *http) /* I - HTTP connection */
void
httpClearFields(http_t *http) /* I - HTTP connection */
{
http_field_t field; /* Current field */
DEBUG_printf(("httpClearFields(http=%p)", (void *)http));
if (http)
{
memset(http->fields, 0, sizeof(http->fields));
memset(http->_fields, 0, sizeof(http->fields));
for (field = HTTP_FIELD_ACCEPT_LANGUAGE; field < HTTP_FIELD_MAX; field ++)
{
if (http->fields[field] && http->fields[field] != http->_fields[field])
free(http->fields[field]);
http->fields[field] = NULL;
}
if (http->mode == _HTTP_MODE_CLIENT)
{
@@ -295,36 +308,6 @@ httpClearFields(http_t *http) /* I - HTTP connection */
httpSetField(http, HTTP_FIELD_HOST, http->hostname);
}
if (http->field_authorization)
{
free(http->field_authorization);
http->field_authorization = NULL;
}
if (http->accept_encoding)
{
_cupsStrFree(http->accept_encoding);
http->accept_encoding = NULL;
}
if (http->allow)
{
_cupsStrFree(http->allow);
http->allow = NULL;
}
if (http->server)
{
_cupsStrFree(http->server);
http->server = NULL;
}
if (http->www_authenticate)
{
free(http->www_authenticate);
http->www_authenticate = NULL;
}
http->expect = (http_status_t)0;
}
}
@@ -815,7 +798,7 @@ const char * /* O - Content-Coding value or
httpGetContentEncoding(http_t *http) /* I - HTTP connection */
{
#ifdef HAVE_LIBZ
if (http && http->accept_encoding)
if (http && http->fields[HTTP_FIELD_ACCEPT_ENCODING])
{
int i; /* Looping var */
char temp[HTTP_MAX_VALUE], /* Copy of Accepts-Encoding value */
@@ -831,7 +814,7 @@ httpGetContentEncoding(http_t *http) /* I - HTTP connection */
"x-gzip"
};
strlcpy(temp, http->accept_encoding, sizeof(temp));
strlcpy(temp, http->fields[HTTP_FIELD_ACCEPT_ENCODING], sizeof(temp));
for (start = temp; *start; start = end)
{
@@ -957,47 +940,10 @@ httpGetField(http_t *http, /* I - HTTP connection */
{
if (!http || field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
return (NULL);
switch (field)
{
case HTTP_FIELD_ACCEPT_ENCODING :
return (http->accept_encoding);
case HTTP_FIELD_ALLOW :
return (http->allow);
case HTTP_FIELD_SERVER :
return (http->server);
case HTTP_FIELD_AUTHORIZATION :
if (http->field_authorization)
{
/*
* Special case for Authorization: as its contents can be
* longer than HTTP_MAX_VALUE...
*/
return (http->field_authorization);
}
else
return (http->fields[field]);
case HTTP_FIELD_WWW_AUTHENTICATE :
if (http->www_authenticate)
{
/*
* Special case for WWW-Authenticate: as its contents can be
* longer than HTTP_MAX_VALUE...
*/
return (http->www_authenticate);
}
else
return (http->fields[field]);
default :
return (http->fields[field]);
}
else if (http->fields[field])
return (http->fields[field]);
else
return ("");
}
@@ -1063,7 +1009,7 @@ httpGetLength2(http_t *http) /* I - HTTP connection */
if (!http)
return (-1);
if (!_cups_strcasecmp(http->fields[HTTP_FIELD_TRANSFER_ENCODING], "chunked"))
if (http->fields[HTTP_FIELD_TRANSFER_ENCODING] && !_cups_strcasecmp(http->fields[HTTP_FIELD_TRANSFER_ENCODING], "chunked"))
{
DEBUG_puts("4httpGetLength2: chunked request!");
remaining = 0;
@@ -1078,7 +1024,7 @@ httpGetLength2(http_t *http) /* I - HTTP connection */
* after the transfer is complete...
*/
if (!http->fields[HTTP_FIELD_CONTENT_LENGTH][0])
if (!http->fields[HTTP_FIELD_CONTENT_LENGTH] || !http->fields[HTTP_FIELD_CONTENT_LENGTH][0])
{
/*
* Default content length is 0 for errors and certain types of operations,
@@ -2603,36 +2549,13 @@ httpSetDefaultField(http_t *http, /* I - HTTP connection */
{
DEBUG_printf(("httpSetDefaultField(http=%p, field=%d(%s), value=\"%s\")", (void *)http, field, http_fields[field], value));
if (!http)
if (!http || field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
return;
switch (field)
{
case HTTP_FIELD_ACCEPT_ENCODING :
if (http->default_accept_encoding)
_cupsStrFree(http->default_accept_encoding);
if (http->default_fields[field])
free(http->default_fields[field]);
http->default_accept_encoding = value ? _cupsStrAlloc(value) : NULL;
break;
case HTTP_FIELD_SERVER :
if (http->default_server)
_cupsStrFree(http->default_server);
http->default_server = value ? _cupsStrAlloc(value) : NULL;
break;
case HTTP_FIELD_USER_AGENT :
if (http->default_user_agent)
_cupsStrFree(http->default_user_agent);
http->default_user_agent = value ? _cupsStrAlloc(value) : NULL;
break;
default :
DEBUG_puts("1httpSetDefaultField: Ignored.");
break;
}
http->default_fields[field] = value ? strdup(value) : NULL;
}
@@ -2668,129 +2591,10 @@ httpSetField(http_t *http, /* I - HTTP connection */
{
DEBUG_printf(("httpSetField(http=%p, field=%d(%s), value=\"%s\")", (void *)http, field, http_fields[field], value));
if (http == NULL ||
field < HTTP_FIELD_ACCEPT_LANGUAGE ||
field >= HTTP_FIELD_MAX ||
value == NULL)
if (!http || field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX || !value)
return;
switch (field)
{
case HTTP_FIELD_ACCEPT_ENCODING :
if (http->accept_encoding)
_cupsStrFree(http->accept_encoding);
http->accept_encoding = _cupsStrAlloc(value);
break;
case HTTP_FIELD_ALLOW :
if (http->allow)
_cupsStrFree(http->allow);
http->allow = _cupsStrAlloc(value);
break;
case HTTP_FIELD_SERVER :
if (http->server)
_cupsStrFree(http->server);
http->server = _cupsStrAlloc(value);
break;
case HTTP_FIELD_WWW_AUTHENTICATE :
if (!http->www_authenticate)
{
/*
* First WWW-Authenticate seen, just copy it over...
*/
http->www_authenticate = strdup(value);
strlcpy(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], value, HTTP_MAX_VALUE);
}
else
{
/*
* Nth WWW-Authenticate seen, append to existing string...
*/
size_t len = strlen(http->www_authenticate) + 2 + strlen(value) + 1;
char *temp = realloc(http->www_authenticate, len);
if (!temp)
return;
http->www_authenticate = temp;
strlcat(http->www_authenticate, ", ", len);
strlcat(http->www_authenticate, value, len);
/* Probably more efficient than two more strlcat's */
strlcpy(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], http->www_authenticate, HTTP_MAX_VALUE);
}
break;
default :
strlcpy(http->fields[field], value, HTTP_MAX_VALUE);
break;
}
if (field == HTTP_FIELD_AUTHORIZATION)
{
/*
* Special case for Authorization: as its contents can be
* longer than HTTP_MAX_VALUE
*/
if (http->field_authorization)
free(http->field_authorization);
http->field_authorization = strdup(value);
}
else if (field == HTTP_FIELD_HOST)
{
/*
* Special-case for Host: as we don't want a trailing "." on the hostname and
* need to bracket IPv6 numeric addresses.
*/
char *ptr = strchr(value, ':');
if (value[0] != '[' && ptr && strchr(ptr + 1, ':'))
{
/*
* Bracket IPv6 numeric addresses...
*
* This is slightly inefficient (basically copying twice), but is an edge
* case and not worth optimizing...
*/
snprintf(http->fields[HTTP_FIELD_HOST],
sizeof(http->fields[HTTP_FIELD_HOST]), "[%s]", value);
}
else
{
/*
* Check for a trailing dot on the hostname...
*/
ptr = http->fields[HTTP_FIELD_HOST];
if (*ptr)
{
ptr += strlen(ptr) - 1;
if (*ptr == '.')
*ptr = '\0';
}
}
}
#ifdef HAVE_LIBZ
else if (field == HTTP_FIELD_CONTENT_ENCODING &&
http->data_encoding != HTTP_ENCODING_FIELDS)
{
DEBUG_puts("1httpSetField: Calling http_content_coding_start.");
http_content_coding_start(http, value);
}
#endif /* HAVE_LIBZ */
http_add_field(http, field, value, 0);
}
@@ -2827,15 +2631,17 @@ httpSetLength(http_t *http, /* I - HTTP connection */
if (!length)
{
strlcpy(http->fields[HTTP_FIELD_TRANSFER_ENCODING], "chunked",
HTTP_MAX_VALUE);
http->fields[HTTP_FIELD_CONTENT_LENGTH][0] = '\0';
httpSetField(http, HTTP_FIELD_TRANSFER_ENCODING, "chunked");
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, "");
}
else
{
http->fields[HTTP_FIELD_TRANSFER_ENCODING][0] = '\0';
snprintf(http->fields[HTTP_FIELD_CONTENT_LENGTH], HTTP_MAX_VALUE,
CUPS_LLFMT, CUPS_LLCAST length);
char len[32]; /* Length string */
snprintf(len, sizeof(len), CUPS_LLFMT, CUPS_LLCAST length);
httpSetField(http, HTTP_FIELD_TRANSFER_ENCODING, "");
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, len);
}
}
@@ -3068,7 +2874,7 @@ _httpUpdate(http_t *http, /* I - HTTP connection */
httpSetCookie(http, value);
}
else if ((field = httpFieldValue(line)) != HTTP_FIELD_UNKNOWN)
httpSetField(http, field, value);
http_add_field(http, field, value, 1);
#ifdef DEBUG
else
DEBUG_printf(("1_httpUpdate: unknown field %s seen!", line));
@@ -3528,7 +3334,7 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */
* Set the various standard fields if they aren't already...
*/
if (!http->fields[HTTP_FIELD_DATE][0])
if (!http->fields[HTTP_FIELD_DATE])
httpSetField(http, HTTP_FIELD_DATE, httpGetDateString(time(NULL)));
if (status >= HTTP_STATUS_BAD_REQUEST && http->keep_alive)
@@ -3539,7 +3345,7 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */
if (http->version == HTTP_VERSION_1_1)
{
if (!http->fields[HTTP_FIELD_CONNECTION][0])
if (!http->fields[HTTP_FIELD_CONNECTION])
{
if (http->keep_alive)
httpSetField(http, HTTP_FIELD_CONNECTION, "Keep-Alive");
@@ -3547,7 +3353,7 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */
httpSetField(http, HTTP_FIELD_CONNECTION, "close");
}
if (http->keep_alive && !http->fields[HTTP_FIELD_KEEP_ALIVE][0])
if (http->keep_alive && !http->fields[HTTP_FIELD_KEEP_ALIVE])
httpSetField(http, HTTP_FIELD_KEEP_ALIVE, "timeout=10");
}
@@ -3555,28 +3361,26 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */
if (status == HTTP_STATUS_UPGRADE_REQUIRED ||
status == HTTP_STATUS_SWITCHING_PROTOCOLS)
{
if (!http->fields[HTTP_FIELD_CONNECTION][0])
if (!http->fields[HTTP_FIELD_CONNECTION])
httpSetField(http, HTTP_FIELD_CONNECTION, "Upgrade");
if (!http->fields[HTTP_FIELD_UPGRADE][0])
if (!http->fields[HTTP_FIELD_UPGRADE])
httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.2,TLS/1.1,TLS/1.0");
if (!http->fields[HTTP_FIELD_CONTENT_LENGTH][0])
if (!http->fields[HTTP_FIELD_CONTENT_LENGTH])
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, "0");
}
#endif /* HAVE_SSL */
if (!http->server)
httpSetField(http, HTTP_FIELD_SERVER,
http->default_server ? http->default_server : CUPS_MINIMAL);
if (!http->fields[HTTP_FIELD_SERVER])
httpSetField(http, HTTP_FIELD_SERVER, http->default_fields[HTTP_FIELD_SERVER] ? http->default_fields[HTTP_FIELD_SERVER] : CUPS_MINIMAL);
/*
* Set the Accept-Encoding field if it isn't already...
*/
if (!http->accept_encoding)
httpSetField(http, HTTP_FIELD_ACCEPT_ENCODING,
http->default_accept_encoding ? http->default_accept_encoding :
if (!http->fields[HTTP_FIELD_ACCEPT_ENCODING])
httpSetField(http, HTTP_FIELD_ACCEPT_ENCODING, http->default_fields[HTTP_FIELD_ACCEPT_ENCODING] ? http->default_fields[HTTP_FIELD_ACCEPT_ENCODING] :
#ifdef HAVE_LIBZ
"gzip, deflate, identity");
#else
@@ -3591,8 +3395,7 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */
old_remaining = http->data_remaining;
http->data_encoding = HTTP_ENCODING_FIELDS;
if (httpPrintf(http, "HTTP/%d.%d %d %s\r\n", http->version / 100,
http->version % 100, (int)status, httpStatus(status)) < 0)
if (httpPrintf(http, "HTTP/%d.%d %d %s\r\n", http->version / 100, http->version % 100, (int)status, httpStatus(status)) < 0)
{
http->status = HTTP_STATUS_ERROR;
return (-1);
@@ -3722,6 +3525,141 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */
}
/*
* 'http_add_field()' - Add a value for a HTTP field, appending if needed.
*/
static void
http_add_field(http_t *http, /* I - HTTP connection */
http_field_t field, /* I - HTTP field */
const char *value, /* I - Value string */
int append) /* I - Append value? */
{
char temp[1024]; /* Temporary value string */
size_t fieldlen, /* Length of existing value */
valuelen, /* Length of value string */
total; /* Total length of string */
if (field == HTTP_FIELD_HOST)
{
/*
* Special-case for Host: as we don't want a trailing "." on the hostname and
* need to bracket IPv6 numeric addresses.
*/
char *ptr = strchr(value, ':');
if (value[0] != '[' && ptr && strchr(ptr + 1, ':'))
{
/*
* Bracket IPv6 numeric addresses...
*
* This is slightly inefficient (basically copying twice), but is an edge
* case and not worth optimizing...
*/
snprintf(temp, sizeof(temp), "[%s]", value);
value = temp;
}
else if (*value)
{
/*
* Check for a trailing dot on the hostname...
*/
strlcpy(temp, value, sizeof(temp));
value = temp;
ptr = temp + strlen(temp) - 1;
if (*ptr == '.')
*ptr = '\0';
}
}
if (append && field != HTTP_FIELD_ACCEPT_ENCODING && field != HTTP_FIELD_ACCEPT_LANGUAGE && field != HTTP_FIELD_ACCEPT_RANGES && field != HTTP_FIELD_ALLOW && field != HTTP_FIELD_LINK && field != HTTP_FIELD_TRANSFER_ENCODING && field != HTTP_FIELD_UPGRADE && field != HTTP_FIELD_WWW_AUTHENTICATE)
append = 0;
if (!append && http->fields[field])
{
if (http->fields[field] != http->_fields[field])
free(http->fields[field]);
http->fields[field] = NULL;
}
valuelen = strlen(value);
if (!valuelen)
{
http->_fields[field][0] = '\0';
return;
}
if (http->fields[field])
{
fieldlen = strlen(http->fields[field]);
total = fieldlen + 2 + valuelen;
}
else
{
fieldlen = 0;
total = valuelen;
}
if (total < HTTP_MAX_VALUE && field < HTTP_FIELD_ACCEPT_ENCODING)
{
/*
* Copy short values to legacy char arrays (maintained for binary
* compatibility with CUPS 1.2.x and earlier applications...)
*/
if (fieldlen)
{
char combined[HTTP_MAX_VALUE];
/* Combined value string */
snprintf(combined, sizeof(combined), "%s, %s", http->_fields[field], value);
value = combined;
}
strlcpy(http->_fields[field], value, sizeof(http->_fields[field]));
http->fields[field] = http->_fields[field];
}
else if (fieldlen)
{
/*
* Expand the field value...
*/
char *combined; /* New value string */
if ((combined = realloc(http->fields[field], total + 1)) != NULL)
{
http->fields[field] = combined;
strlcat(combined, ", ", total + 1);
strlcat(combined, value, total + 1);
}
}
else
{
/*
* Allocate the field value...
*/
http->fields[field] = strdup(value);
}
#ifdef HAVE_LIBZ
if (field == HTTP_FIELD_CONTENT_ENCODING && http->data_encoding != HTTP_ENCODING_FIELDS)
{
DEBUG_puts("1httpSetField: Calling http_content_coding_start.");
http_content_coding_start(http, value);
}
#endif /* HAVE_LIBZ */
}
#ifdef HAVE_LIBZ
/*
* 'http_content_coding_finish()' - Finish doing any content encoding.
@@ -4089,7 +4027,7 @@ http_read(http_t *http, /* I - HTTP connection */
DEBUG_printf(("http_read(http=%p, buffer=%p, length=" CUPS_LLFMT ")", (void *)http, (void *)buffer, CUPS_LLCAST length));
if (!http->blocking)
if (!http->blocking || http->timeout_value > 0.0)
{
while (!httpWait(http, http->wait_value))
{
@@ -4334,10 +4272,10 @@ http_send(http_t *http, /* I - HTTP connection */
* Set the User-Agent field if it isn't already...
*/
if (!http->fields[HTTP_FIELD_USER_AGENT][0])
if (!http->fields[HTTP_FIELD_USER_AGENT])
{
if (http->default_user_agent)
httpSetField(http, HTTP_FIELD_USER_AGENT, http->default_user_agent);
if (http->default_fields[HTTP_FIELD_USER_AGENT])
httpSetField(http, HTTP_FIELD_USER_AGENT, http->default_fields[HTTP_FIELD_USER_AGENT]);
else
httpSetField(http, HTTP_FIELD_USER_AGENT, cupsUserAgent());
}
@@ -4346,9 +4284,8 @@ http_send(http_t *http, /* I - HTTP connection */
* Set the Accept-Encoding field if it isn't already...
*/
if (!http->accept_encoding && http->default_accept_encoding)
httpSetField(http, HTTP_FIELD_ACCEPT_ENCODING,
http->default_accept_encoding);
if (!http->fields[HTTP_FIELD_ACCEPT_ENCODING] && http->default_fields[HTTP_FIELD_ACCEPT_ENCODING])
httpSetField(http, HTTP_FIELD_ACCEPT_ENCODING, http->default_fields[HTTP_FIELD_ACCEPT_ENCODING]);
/*
* Encode the URI as needed...
@@ -4463,7 +4400,7 @@ http_send(http_t *http, /* I - HTTP connection */
* The Kerberos and AuthRef authentication strings can only be used once...
*/
if (http->field_authorization && http->authstring &&
if (http->fields[HTTP_FIELD_AUTHORIZATION] && http->authstring &&
(!strncmp(http->authstring, "Negotiate", 9) ||
!strncmp(http->authstring, "AuthRef", 7)))
{
@@ -4503,8 +4440,7 @@ http_set_length(http_t *http) /* I - Connection */
return (remaining);
}
if (!_cups_strcasecmp(http->fields[HTTP_FIELD_TRANSFER_ENCODING],
"chunked"))
if (!_cups_strcasecmp(httpGetField(http, HTTP_FIELD_TRANSFER_ENCODING), "chunked"))
{
DEBUG_puts("1http_set_length: Setting data_encoding to "
"HTTP_ENCODING_CHUNKED.");
@@ -4609,10 +4545,15 @@ http_tls_upgrade(http_t *http) /* I - HTTP connection */
* encryption on the link...
*/
http->tls_upgrade = 1;
http->field_authorization = NULL; /* Don't free the auth string */
http->tls_upgrade = 1;
memset(http->fields, 0, sizeof(http->fields));
http->expect = (http_status_t)0;
if (http->hostname[0] == '/')
httpSetField(http, HTTP_FIELD_HOST, "localhost");
else
httpSetField(http, HTTP_FIELD_HOST, http->hostname);
httpClearFields(http);
httpSetField(http, HTTP_FIELD_CONNECTION, "upgrade");
httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.2,TLS/1.1,TLS/1.0");
@@ -4629,14 +4570,15 @@ http_tls_upgrade(http_t *http) /* I - HTTP connection */
* Restore the HTTP request data...
*/
memcpy(http->_fields, myhttp._fields, sizeof(http->_fields));
memcpy(http->fields, myhttp.fields, sizeof(http->fields));
http->data_encoding = myhttp.data_encoding;
http->data_remaining = myhttp.data_remaining;
http->_data_remaining = myhttp._data_remaining;
http->expect = myhttp.expect;
http->field_authorization = myhttp.field_authorization;
http->digest_tries = myhttp.digest_tries;
http->tls_upgrade = 0;
http->data_encoding = myhttp.data_encoding;
http->data_remaining = myhttp.data_remaining;
http->_data_remaining = myhttp._data_remaining;
http->expect = myhttp.expect;
http->digest_tries = myhttp.digest_tries;
http->tls_upgrade = 0;
/*
* See if we actually went secure...
@@ -4684,7 +4626,7 @@ http_write(http_t *http, /* I - HTTP connection */
{
DEBUG_printf(("3http_write: About to write %d bytes.", (int)length));
if (http->timeout_cb)
if (http->timeout_value > 0.0)
{
#ifdef HAVE_POLL
struct pollfd pfd; /* Polled file descriptor */
@@ -4728,7 +4670,7 @@ http_write(http_t *http, /* I - HTTP connection */
http->error = errno;
return (-1);
}
else if (nfds == 0 && !(*http->timeout_cb)(http, http->timeout_data))
else if (nfds == 0 && (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data)))
{
#ifdef WIN32
http->error = WSAEWOULDBLOCK;
+697
Ver Arquivo
@@ -0,0 +1,697 @@
/*
* IPP data file parsing functions.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
* Include necessary headers...
*/
#include "ipp-private.h"
#include "string-private.h"
#include "debug-private.h"
/*
* Local functions...
*/
static ipp_t *parse_collection(_ipp_file_t *f, _ipp_vars_t *v, void *user_data);
static int parse_value(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, ipp_t *ipp, ipp_attribute_t **attr, int element);
static void report_error(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *message, ...) __attribute((__format__ (__printf__, 4, 5)));
/*
* '_ippFileParse()' - Parse an IPP data file.
*/
ipp_t * /* O - IPP attributes or @code NULL@ on failure */
_ippFileParse(
_ipp_vars_t *v, /* I - Variables */
const char *filename, /* I - Name of file to parse */
void *user_data) /* I - User data pointer */
{
_ipp_file_t f; /* IPP data file information */
ipp_t *attrs = NULL; /* Active IPP message */
ipp_attribute_t *attr = NULL; /* Current attribute */
char token[1024]; /* Token string */
ipp_t *ignored = NULL; /* Ignored attributes */
DEBUG_printf(("_ippFileParse(v=%p, filename=\"%s\", user_data=%p)", (void *)v, filename, user_data));
/*
* Initialize file info...
*/
memset(&f, 0, sizeof(f));
f.filename = filename;
f.linenum = 1;
if ((f.fp = cupsFileOpen(filename, "r")) == NULL)
{
DEBUG_printf(("1_ippFileParse: Unable to open \"%s\": %s", filename, strerror(errno)));
return (0);
}
/*
* Do the callback with a NULL token to setup any initial state...
*/
(*v->tokencb)(&f, v, user_data, NULL);
/*
* Read data file, using the callback function as needed...
*/
while (_ippFileReadToken(&f, token, sizeof(token)))
{
if (!_cups_strcasecmp(token, "DEFINE") || !_cups_strcasecmp(token, "DEFINE-DEFAULT"))
{
char name[128], /* Variable name */
value[1024], /* Variable value */
temp[1024]; /* Temporary string */
attr = NULL;
if (_ippFileReadToken(&f, name, sizeof(name)) && _ippFileReadToken(&f, temp, sizeof(temp)))
{
if (_cups_strcasecmp(token, "DEFINE-DEFAULT") || !_ippVarsGet(v, name))
{
_ippVarsExpand(v, value, temp, sizeof(value));
_ippVarsSet(v, name, value);
}
}
else
{
report_error(&f, v, user_data, "Missing %s name and/or value on line %d of \"%s\".", token, f.linenum, f.filename);
break;
}
}
else if (f.attrs && !_cups_strcasecmp(token, "ATTR"))
{
/*
* Attribute definition...
*/
char syntax[128], /* Attribute syntax (value tag) */
name[128]; /* Attribute name */
ipp_tag_t value_tag; /* Value tag */
attr = NULL;
if (!_ippFileReadToken(&f, syntax, sizeof(syntax)))
{
report_error(&f, v, user_data, "Missing ATTR syntax on line %d of \"%s\".", f.linenum, f.filename);
break;
}
else if ((value_tag = ippTagValue(syntax)) < IPP_TAG_UNSUPPORTED_VALUE)
{
report_error(&f, v, user_data, "Bad ATTR syntax \"%s\" on line %d of \"%s\".", syntax, f.linenum, f.filename);
break;
}
if (!_ippFileReadToken(&f, name, sizeof(name)) || !name[0])
{
report_error(&f, v, user_data, "Missing ATTR name on line %d of \"%s\".", f.linenum, f.filename);
break;
}
if (!v->attrcb || (*v->attrcb)(&f, user_data, name))
{
/*
* Add this attribute...
*/
attrs = f.attrs;
}
else
{
/*
* Ignore this attribute...
*/
if (!ignored)
ignored = ippNew();
attrs = ignored;
}
if (value_tag < IPP_TAG_INTEGER)
{
/*
* Add out-of-band attribute - no value string needed...
*/
ippAddOutOfBand(attrs, f.group_tag, value_tag, name);
}
else
{
/*
* Add attribute with one or more values...
*/
attr = ippAddString(attrs, f.group_tag, value_tag, name, NULL, NULL);
if (!parse_value(&f, v, user_data, attrs, &attr, 0))
break;
}
}
else if (attr && !_cups_strcasecmp(token, ","))
{
/*
* Additional value...
*/
if (!parse_value(&f, v, user_data, attrs, &attr, ippGetCount(attr)))
break;
}
else
{
/*
* Something else...
*/
attr = NULL;
attrs = NULL;
if (!(*v->tokencb)(&f, v, user_data, token))
break;
}
}
/*
* Close the file and free ignored attributes, then return any attributes we
* kept...
*/
cupsFileClose(f.fp);
ippDelete(ignored);
return (f.attrs);
}
/*
* '_ippFileReadToken()' - Read a token from an IPP data file.
*/
int /* O - 1 on success, 0 on failure */
_ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
char *token, /* I - Token string buffer */
size_t tokensize)/* I - Size of token string buffer */
{
int ch, /* Character from file */
quote = 0; /* Quoting character */
char *tokptr = token, /* Pointer into token buffer */
*tokend = token + tokensize - 1;/* End of token buffer */
/*
* Skip whitespace and comments...
*/
while ((ch = cupsFileGetChar(f->fp)) != EOF)
{
if (_cups_isspace(ch))
{
/*
* Whitespace...
*/
if (ch == '\n')
f->linenum ++;
}
else if (ch == '#')
{
/*
* Comment...
*/
while ((ch = cupsFileGetChar(f->fp)) != EOF)
{
if (ch == '\n')
break;
}
if (ch == '\n')
f->linenum ++;
else
break;
}
else
break;
}
if (ch == EOF)
{
DEBUG_puts("1_ippFileReadToken: EOF");
return (0);
}
/*
* Read a token...
*/
while (ch != EOF)
{
if (ch == '\n')
f->linenum ++;
if (ch == quote)
{
/*
* End of quoted text...
*/
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
return (1);
}
else if (!quote && _cups_isspace(ch))
{
/*
* End of unquoted text...
*/
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
return (1);
}
else if (!quote && (ch == '\'' || ch == '\"'))
{
/*
* Start of quoted text or regular expression...
*/
quote = ch;
}
else if (!quote && ch == '#')
{
/*
* Start of comment...
*/
cupsFileSeek(f->fp, cupsFileTell(f->fp) - 1);
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
return (1);
}
else if (!quote && (ch == '{' || ch == '}' || ch == ','))
{
/*
* Delimiter...
*/
if (tokptr > token)
{
/*
* Return the preceding token first...
*/
cupsFileSeek(f->fp, cupsFileTell(f->fp) - 1);
}
else
{
/*
* Return this delimiter by itself...
*/
*tokptr++ = (char)ch;
}
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
return (1);
}
else
{
if (ch == '\\')
{
/*
* Quoted character...
*/
if ((ch = cupsFileGetChar(f->fp)) == EOF)
{
*token = '\0';
DEBUG_puts("1_ippFileReadToken: EOF");
return (0);
}
else if (ch == '\n')
f->linenum ++;
}
if (tokptr < tokend)
{
/*
* Add to current token...
*/
*tokptr++ = (char)ch;
}
else
{
/*
* Token too long...
*/
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Too long: \"%s\".", token));
return (0);
}
}
/*
* Get the next character...
*/
ch = cupsFileGetChar(f->fp);
}
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
return (tokptr > token);
}
/*
* 'parse_collection()' - Parse an IPP collection value.
*/
static ipp_t * /* O - Collection value or @code NULL@ on error */
parse_collection(
_ipp_file_t *f, /* I - IPP data file */
_ipp_vars_t *v, /* I - IPP variables */
void *user_data) /* I - User data pointer */
{
ipp_t *col = ippNew(); /* Collection value */
ipp_attribute_t *attr = NULL; /* Current member attribute */
char token[1024]; /* Token string */
/*
* Parse the collection value...
*/
while (_ippFileReadToken(f, token, sizeof(token)))
{
if (!_cups_strcasecmp(token, "}"))
{
/*
* End of collection value...
*/
break;
}
else if (!_cups_strcasecmp(token, "MEMBER"))
{
/*
* Member attribute definition...
*/
char syntax[128], /* Attribute syntax (value tag) */
name[128]; /* Attribute name */
ipp_tag_t value_tag; /* Value tag */
attr = NULL;
if (!_ippFileReadToken(f, syntax, sizeof(syntax)))
{
report_error(f, v, user_data, "Missing ATTR syntax on line %d of \"%s\".", f->linenum, f->filename);
ippDelete(col);
col = NULL;
break;
}
else if ((value_tag = ippTagValue(syntax)) < IPP_TAG_UNSUPPORTED_VALUE)
{
report_error(f, v, user_data, "Bad ATTR syntax \"%s\" on line %d of \"%s\".", syntax, f->linenum, f->filename);
ippDelete(col);
col = NULL;
break;
}
if (!_ippFileReadToken(f, name, sizeof(name)) || !name[0])
{
report_error(f, v, user_data, "Missing ATTR name on line %d of \"%s\".", f->linenum, f->filename);
ippDelete(col);
col = NULL;
break;
}
if (value_tag < IPP_TAG_INTEGER)
{
/*
* Add out-of-band attribute - no value string needed...
*/
ippAddOutOfBand(col, IPP_TAG_ZERO, value_tag, name);
}
else
{
/*
* Add attribute with one or more values...
*/
attr = ippAddString(col, IPP_TAG_ZERO, value_tag, name, NULL, NULL);
if (!parse_value(f, v, user_data, col, &attr, 0))
{
ippDelete(col);
col = NULL;
break;
}
}
}
else if (attr && !_cups_strcasecmp(token, ","))
{
/*
* Additional value...
*/
if (!parse_value(f, v, user_data, col, &attr, ippGetCount(attr)))
{
ippDelete(col);
col = NULL;
break;
}
}
else
{
/*
* Something else...
*/
report_error(f, v, user_data, "Unknown directive \"%s\" on line %d of \"%s\".", token, f->linenum, f->filename);
ippDelete(col);
col = NULL;
attr = NULL;
break;
}
}
return (col);
}
/*
* 'parse_value()' - Parse an IPP value.
*/
static int /* O - 1 on success or 0 on error */
parse_value(_ipp_file_t *f, /* I - IPP data file */
_ipp_vars_t *v, /* I - IPP variables */
void *user_data,/* I - User data pointer */
ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element) /* I - Element number */
{
char value[1024], /* Value string */
temp[1024]; /* Temporary string */
if (!_ippFileReadToken(f, temp, sizeof(temp)))
{
report_error(f, v, user_data, "Missing value on line %d of \"%s\".", f->linenum, f->filename);
return (0);
}
_ippVarsExpand(v, value, temp, sizeof(value));
switch (ippGetValueTag(*attr))
{
case IPP_TAG_BOOLEAN :
return (ippSetBoolean(ipp, attr, element, !_cups_strcasecmp(value, "true")));
break;
case IPP_TAG_ENUM :
case IPP_TAG_INTEGER :
return (ippSetInteger(ipp, attr, element, (int)strtol(value, NULL, 0)));
break;
case IPP_TAG_DATE :
{
int year, /* Year */
month, /* Month */
day, /* Day of month */
hour, /* Hour */
minute, /* Minute */
second, /* Second */
utc_offset = 0; /* Timezone offset from UTC */
ipp_uchar_t date[11]; /* dateTime value */
if (sscanf(value, "%d-%d-%dT%d:%d:%d%d", &year, &month, &day, &hour, &minute, &second, &utc_offset) < 6)
{
report_error(f, v, user_data, "Bad dateTime value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
return (0);
}
date[0] = (ipp_uchar_t)(year >> 8);
date[1] = (ipp_uchar_t)(year & 255);
date[2] = (ipp_uchar_t)month;
date[3] = (ipp_uchar_t)day;
date[4] = (ipp_uchar_t)hour;
date[5] = (ipp_uchar_t)minute;
date[6] = (ipp_uchar_t)second;
date[7] = 0;
if (utc_offset < 0)
{
utc_offset = -utc_offset;
date[8] = (ipp_uchar_t)'-';
}
else
{
date[8] = (ipp_uchar_t)'+';
}
date[9] = (ipp_uchar_t)(utc_offset / 100);
date[10] = (ipp_uchar_t)(utc_offset % 100);
return (ippSetDate(ipp, attr, element, date));
}
break;
case IPP_TAG_RESOLUTION :
{
int xres, /* X resolution */
yres; /* Y resolution */
char *ptr; /* Pointer into value */
xres = yres = (int)strtol(value, (char **)&ptr, 10);
if (ptr > value && xres > 0)
{
if (*ptr == 'x')
yres = (int)strtol(ptr + 1, (char **)&ptr, 10);
}
if (ptr <= value || xres <= 0 || yres <= 0 || !ptr || (_cups_strcasecmp(ptr, "dpi") && _cups_strcasecmp(ptr, "dpc") && _cups_strcasecmp(ptr, "dpcm") && _cups_strcasecmp(ptr, "other")))
{
report_error(f, v, user_data, "Bad resolution value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
return (0);
}
if (!_cups_strcasecmp(ptr, "dpi"))
return (ippSetResolution(ipp, attr, element, IPP_RES_PER_INCH, xres, yres));
else if (!_cups_strcasecmp(ptr, "dpc") || !_cups_strcasecmp(ptr, "dpcm"))
return (ippSetResolution(ipp, attr, element, IPP_RES_PER_CM, xres, yres));
else
return (ippSetResolution(ipp, attr, element, (ipp_res_t)0, xres, yres));
}
break;
case IPP_TAG_RANGE :
{
int lower, /* Lower value */
upper; /* Upper value */
if (sscanf(value, "%d-%d", &lower, &upper) != 2)
{
report_error(f, v, user_data, "Bad rangeOfInteger value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
return (0);
}
return (ippSetRange(ipp, attr, element, lower, upper));
}
break;
case IPP_TAG_STRING :
return (ippSetOctetString(ipp, attr, element, value, (int)strlen(value)));
break;
case IPP_TAG_TEXTLANG :
case IPP_TAG_NAMELANG :
case IPP_TAG_TEXT :
case IPP_TAG_NAME :
case IPP_TAG_KEYWORD :
case IPP_TAG_URI :
case IPP_TAG_URISCHEME :
case IPP_TAG_CHARSET :
case IPP_TAG_LANGUAGE :
case IPP_TAG_MIMETYPE :
return (ippSetString(ipp, attr, element, value));
break;
case IPP_TAG_BEGIN_COLLECTION :
{
int status; /* Add status */
ipp_t *col; /* Collection value */
if (strcmp(value, "{"))
{
report_error(f, v, user_data, "Bad ATTR collection value on line %d of \"%s\".", f->linenum, f->filename);
return (0);
}
if ((col = parse_collection(f, v, user_data)) == NULL)
return (0);
status = ippSetCollection(ipp, attr, element, col);
ippDelete(col);
return (status);
}
break;
default :
report_error(f, v, user_data, "Unsupported ATTR value on line %d of \"%s\".", f->linenum, f->filename);
return (0);
}
return (1);
}
/*
* 'report_error()' - Report an error.
*/
static void
report_error(
_ipp_file_t *f, /* I - IPP data file */
_ipp_vars_t *v, /* I - Error callback function, if any */
void *user_data, /* I - User data pointer */
const char *message, /* I - Printf-style message */
...) /* I - Additional arguments as needed */
{
char buffer[8192]; /* Formatted string */
va_list ap; /* Argument pointer */
va_start(ap, message);
vsnprintf(buffer, sizeof(buffer), message, ap);
va_end(ap);
if (v->errorcb)
(*v->errorcb)(f, user_data, buffer);
else
fprintf(stderr, "%s\n", buffer);
}
+155 -5
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Private IPP definitions for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_IPP_PRIVATE_H_
@@ -14,7 +15,7 @@
* Include necessary headers...
*/
# include <cups/ipp.h>
# include <cups/cups.h>
/*
@@ -38,7 +39,105 @@ extern "C" {
* Structures...
*/
typedef struct /**** Attribute mapping data ****/
typedef union _ipp_request_u /**** Request Header ****/
{
struct /* Any Header */
{
ipp_uchar_t version[2]; /* Protocol version number */
int op_status; /* Operation ID or status code*/
int request_id; /* Request ID */
} any;
struct /* Operation Header */
{
ipp_uchar_t version[2]; /* Protocol version number */
ipp_op_t operation_id; /* Operation ID */
int request_id; /* Request ID */
} op;
struct /* Status Header */
{
ipp_uchar_t version[2]; /* Protocol version number */
ipp_status_t status_code; /* Status code */
int request_id; /* Request ID */
} status;
/**** New in CUPS 1.1.19 ****/
struct /* Event Header @since CUPS 1.1.19/macOS 10.3@ */
{
ipp_uchar_t version[2]; /* Protocol version number */
ipp_status_t status_code; /* Status code */
int request_id; /* Request ID */
} event;
} _ipp_request_t;
typedef union _ipp_value_u /**** Attribute Value ****/
{
int integer; /* Integer/enumerated value */
char boolean; /* Boolean value */
ipp_uchar_t date[11]; /* Date/time value */
struct
{
int xres, /* Horizontal resolution */
yres; /* Vertical resolution */
ipp_res_t units; /* Resolution units */
} resolution; /* Resolution value */
struct
{
int lower, /* Lower value */
upper; /* Upper value */
} range; /* Range of integers value */
struct
{
char *language; /* Language code */
char *text; /* String */
} string; /* String with language value */
struct
{
int length; /* Length of attribute */
void *data; /* Data in attribute */
} unknown; /* Unknown attribute type */
/**** New in CUPS 1.1.19 ****/
ipp_t *collection; /* Collection value @since CUPS 1.1.19/macOS 10.3@ */
} _ipp_value_t;
struct _ipp_attribute_s /**** IPP attribute ****/
{
ipp_attribute_t *next; /* Next attribute in list */
ipp_tag_t group_tag, /* Job/Printer/Operation group tag */
value_tag; /* What type of value is it? */
char *name; /* Name of attribute */
int num_values; /* Number of values */
_ipp_value_t values[1]; /* Values */
};
struct _ipp_s /**** IPP Request/Response/Notification ****/
{
ipp_state_t state; /* State of request */
_ipp_request_t request; /* Request header */
ipp_attribute_t *attrs; /* Attributes */
ipp_attribute_t *last; /* Last attribute in list */
ipp_attribute_t *current; /* Current attribute (for read/write) */
ipp_tag_t curtag; /* Current attribute group tag */
/**** New in CUPS 1.2 ****/
ipp_attribute_t *prev; /* Previous attribute (for read) @since CUPS 1.2/macOS 10.5@ */
/**** New in CUPS 1.4.4 ****/
int use; /* Use count @since CUPS 1.4.4/macOS 10.6.?@ */
/**** New in CUPS 2.0 ****/
int atend, /* At end of list? */
curindex; /* Current attribute index for hierarchical search */
};
typedef struct _ipp_option_s /**** Attribute mapping data ****/
{
int multivalue; /* Option has multiple values? */
const char *name; /* Option/attribute name */
@@ -49,16 +148,67 @@ typedef struct /**** Attribute mapping data ****/
const ipp_op_t *operations; /* Allowed operations for this attr */
} _ipp_option_t;
typedef struct _ipp_file_s _ipp_file_t;/**** File Parser ****/
typedef struct _ipp_vars_s _ipp_vars_t;/**** Variables ****/
typedef int (*_ipp_fattr_cb_t)(_ipp_file_t *f, void *user_data, const char *attr);
/**** File Attribute (Filter) Callback ****/
typedef int (*_ipp_ferror_cb_t)(_ipp_file_t *f, void *user_data, const char *error);
/**** File Parser Error Callback ****/
typedef int (*_ipp_ftoken_cb_t)(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *token);
/**** File Parser Token Callback ****/
struct _ipp_vars_s /**** Variables ****/
{
char *uri, /* URI for printer */
scheme[64], /* Scheme from URI */
username[256], /* Username from URI */
*password, /* Password from URI (if any) */
host[256], /* Hostname from URI */
portstr[32], /* Port number string */
resource[1024]; /* Resource path from URI */
int port; /* Port number from URI */
int num_vars; /* Number of variables */
cups_option_t *vars; /* Array of variables */
int password_tries; /* Number of retries for password */
_ipp_fattr_cb_t attrcb; /* Attribute (filter) callback */
_ipp_ferror_cb_t errorcb; /* Error callback */
_ipp_ftoken_cb_t tokencb; /* Token callback */
};
struct _ipp_file_s /**** File Parser */
{
const char *filename; /* Filename */
cups_file_t *fp; /* File pointer */
int linenum; /* Current line number */
ipp_t *attrs; /* Attributes */
ipp_tag_t group_tag; /* Current group for new attributes */
};
/*
* Prototypes for private functions...
*/
/* encode.c */
#ifdef DEBUG
extern const char *_ippCheckOptions(void);
#endif /* DEBUG */
extern _ipp_option_t *_ippFindOption(const char *name);
/* ipp-file.c */
extern ipp_t *_ippFileParse(_ipp_vars_t *v, const char *filename, void *user_data);
extern int _ippFileReadToken(_ipp_file_t *f, char *token, size_t tokensize);
/* ipp-vars.c */
extern void _ippVarsDeinit(_ipp_vars_t *v);
extern void _ippVarsExpand(_ipp_vars_t *v, char *dst, const char *src, size_t dstsize) __attribute__((nonnull(1,2,3)));
extern const char *_ippVarsGet(_ipp_vars_t *v, const char *name);
extern void _ippVarsInit(_ipp_vars_t *v, _ipp_fattr_cb_t attrcb, _ipp_ferror_cb_t errorcb, _ipp_ftoken_cb_t tokencb);
extern const char *_ippVarsPasswordCB(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data);
extern int _ippVarsSet(_ipp_vars_t *v, const char *name, const char *value);
/*
* C++ magic...
*/
+63 -46
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Internet Printing Protocol support functions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -615,7 +616,21 @@ static const char * const ipp_document_states[] =
{ /* printer-state enums */
"idle",
"processing",
"stopped",
"stopped"
},
* const ipp_resource_states[] =
{ /* resource-state enums */
"pending",
"available",
"installed",
"canceled",
"aborted"
},
* const ipp_system_states[] =
{ /* system-state enums */
"idle",
"processing",
"stopped"
};
@@ -915,7 +930,9 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"force-front-side-actual",
"imposition-template-actual",
"impressions",
"impressions-col",
"impressions-completed",
"impressions-completed-col",
"impressions-completed-current-copy",
"insert-sheet-actual",
"k-octets",
@@ -926,7 +943,9 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"media-col-actual",
"media-input-tray-check-actual",
"media-sheets",
"media-sheets-col",
"media-sheets-completed",
"media-sheets-completed-col",
"more-info",
"multiple-object-handling-actual", /* IPP 3D */
"number-up-actual",
@@ -938,7 +957,9 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"page-order-received-actual",
"page-ranges-actual",
"pages",
"pages-col",
"pages-completed",
"pages-completed-col",
"pages-completed-current-copy",
"platform-temperature-actual", /* IPP 3D */
"presentation-direction-number-up-actual",
@@ -1204,13 +1225,17 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"job-hold-until-actual",
"job-id",
"job-impressions",
"job-impressions-col",
"job-impressions-completed",
"job-impressions-completed-col",
"job-k-octets",
"job-k-octets-processed",
"job-mandatory-attributes",
"job-media-progress", /* CUPS extension */
"job-media-sheets",
"job-media-sheets-col",
"job-media-sheets-completed",
"job-media-sheets-completed-col",
"job-message-from-operator",
"job-more-info",
"job-name",
@@ -1218,7 +1243,9 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"job-originating-user-name",
"job-originating-user-uri",
"job-pages",
"job-pages-col",
"job-pages-completed",
"job-pages-completed-col",
"job-pages-completed-current-copy",
"job-printer-state-message", /* CUPS extension */
"job-printer-state-reasons", /* CUPS extension */
@@ -1596,6 +1623,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"document-natural-language-default",
"document-natural-language-supported",
"document-password-supported",
"document-privacy-attributes", /* IPP Privacy Attributes */
"document-privacy-scope", /* IPP Privacy Attributes */
"generated-natural-language-supported",
"identify-actions-default",
"identify-actions-supported",
@@ -1617,6 +1646,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"job-password-encryption-supported",
"job-password-supported",
"job-presets-supported", /* IPP Presets */
"job-privacy-attributes", /* IPP Privacy Attributes */
"job-privacy-scope", /* IPP Privacy Attributes */
"job-quota-period", /* CUPS extension */
"job-resolvers-supported",
"job-settable-attributes-supported",
@@ -1657,6 +1688,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"printer-charge-info",
"printer-charge-info-uri",
"printer-commands", /* CUPS extension */
"printer-config-change-date-time",
"printer-config-change-time",
"printer-current-time",
"printer-detailed-status-messages",
"printer-device-id",
@@ -1719,6 +1752,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"requesting-user-name-denied", /* CUPS extension */
"requesting-user-uri-supported",
"subordinate-printers-supported",
"subscription-privacy-attributes", /* IPP Privacy Attributes */
"subscription-privacy-scope", /* IPP Privacy Attributes */
"urf-supported", /* CUPS extension */
"uri-authentication-supported",
"uri-security-supported",
@@ -1738,7 +1773,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"notify-subscriber-user-name",
"notify-subscriber-user-uri",
"notify-subscription-id",
"subscriptions-uuid"
"notify-subscription-uuid"
};
static const char * const subscription_template[] =
{ /* subscription-template group */
@@ -1902,59 +1937,31 @@ ippEnumString(const char *attrname, /* I - Attribute name */
* Check for standard enum values...
*/
if (!strcmp(attrname, "document-state") &&
enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_document_states) /
sizeof(ipp_document_states[0]))))
if (!strcmp(attrname, "document-state") && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_document_states) / sizeof(ipp_document_states[0]))))
return (ipp_document_states[enumvalue - 3]);
else if (!strcmp(attrname, "finishings") ||
!strcmp(attrname, "finishings-actual") ||
!strcmp(attrname, "finishings-default") ||
!strcmp(attrname, "finishings-ready") ||
!strcmp(attrname, "finishings-supported") ||
!strcmp(attrname, "job-finishings") ||
!strcmp(attrname, "job-finishings-default") ||
!strcmp(attrname, "job-finishings-supported"))
else if (!strcmp(attrname, "finishings") || !strcmp(attrname, "finishings-actual") || !strcmp(attrname, "finishings-default") || !strcmp(attrname, "finishings-ready") || !strcmp(attrname, "finishings-supported") || !strcmp(attrname, "job-finishings") || !strcmp(attrname, "job-finishings-default") || !strcmp(attrname, "job-finishings-supported"))
{
if (enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_finishings) /
sizeof(ipp_finishings[0]))))
if (enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]))))
return (ipp_finishings[enumvalue - 3]);
else if (enumvalue >= 0x40000000 &&
enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) /
sizeof(ipp_finishings_vendor[0]))))
else if (enumvalue >= 0x40000000 && enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / sizeof(ipp_finishings_vendor[0]))))
return (ipp_finishings_vendor[enumvalue - 0x40000000]);
}
else if ((!strcmp(attrname, "job-collation-type") ||
!strcmp(attrname, "job-collation-type-actual")) &&
enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) /
sizeof(ipp_job_collation_types[0]))))
else if ((!strcmp(attrname, "job-collation-type") || !strcmp(attrname, "job-collation-type-actual")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) / sizeof(ipp_job_collation_types[0]))))
return (ipp_job_collation_types[enumvalue - 3]);
else if (!strcmp(attrname, "job-state") &&
enumvalue >= IPP_JSTATE_PENDING && enumvalue <= IPP_JSTATE_COMPLETED)
else if (!strcmp(attrname, "job-state") && enumvalue >= IPP_JSTATE_PENDING && enumvalue <= IPP_JSTATE_COMPLETED)
return (ipp_job_states[enumvalue - IPP_JSTATE_PENDING]);
else if (!strcmp(attrname, "operations-supported"))
return (ippOpString((ipp_op_t)enumvalue));
else if ((!strcmp(attrname, "orientation-requested") ||
!strcmp(attrname, "orientation-requested-actual") ||
!strcmp(attrname, "orientation-requested-default") ||
!strcmp(attrname, "orientation-requested-supported")) &&
enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_orientation_requesteds) /
sizeof(ipp_orientation_requesteds[0]))))
else if ((!strcmp(attrname, "orientation-requested") || !strcmp(attrname, "orientation-requested-actual") || !strcmp(attrname, "orientation-requested-default") || !strcmp(attrname, "orientation-requested-supported")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_orientation_requesteds) / sizeof(ipp_orientation_requesteds[0]))))
return (ipp_orientation_requesteds[enumvalue - 3]);
else if ((!strcmp(attrname, "print-quality") ||
!strcmp(attrname, "print-quality-actual") ||
!strcmp(attrname, "print-quality-default") ||
!strcmp(attrname, "print-quality-supported")) &&
enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_print_qualities) /
sizeof(ipp_print_qualities[0]))))
else if ((!strcmp(attrname, "print-quality") || !strcmp(attrname, "print-quality-actual") || !strcmp(attrname, "print-quality-default") || !strcmp(attrname, "print-quality-supported")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_print_qualities) / sizeof(ipp_print_qualities[0]))))
return (ipp_print_qualities[enumvalue - 3]);
else if (!strcmp(attrname, "printer-state") &&
enumvalue >= IPP_PSTATE_IDLE && enumvalue <= IPP_PSTATE_STOPPED)
else if (!strcmp(attrname, "printer-state") && enumvalue >= IPP_PSTATE_IDLE && enumvalue <= IPP_PSTATE_STOPPED)
return (ipp_printer_states[enumvalue - IPP_PSTATE_IDLE]);
else if (!strcmp(attrname, "resource-state") && enumvalue >= IPP_RSTATE_PENDING && enumvalue <= IPP_RSTATE_ABORTED)
return (ipp_resource_states[enumvalue - IPP_RSTATE_PENDING]);
else if (!strcmp(attrname, "system-state") && enumvalue >= IPP_SSTATE_IDLE && enumvalue <= IPP_SSTATE_STOPPED)
return (ipp_system_states[enumvalue - IPP_SSTATE_IDLE]);
/*
* Not a standard enum value, just return the decimal equivalent...
@@ -2046,6 +2053,16 @@ ippEnumValue(const char *attrname, /* I - Attribute name */
num_strings = (int)(sizeof(ipp_printer_states) / sizeof(ipp_printer_states[0]));
strings = ipp_printer_states;
}
else if (!strcmp(attrname, "resource-state"))
{
num_strings = (int)(sizeof(ipp_resource_states) / sizeof(ipp_resource_states[0]));
strings = ipp_resource_states;
}
else if (!strcmp(attrname, "system-state"))
{
num_strings = (int)(sizeof(ipp_system_states) / sizeof(ipp_system_states[0]));
strings = ipp_system_states;
}
else
return (-1);
+247
Ver Arquivo
@@ -0,0 +1,247 @@
/*
* IPP data file parsing functions.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
* Include necessary headers...
*/
#include <cups/cups.h>
#include "ipp-private.h"
#include "string-private.h"
/*
* '_ippVarsDeinit()' - Free all memory associated with the IPP variables.
*/
void
_ippVarsDeinit(_ipp_vars_t *v) /* I - IPP variables */
{
if (v->uri)
{
free(v->uri);
v->uri = NULL;
}
cupsFreeOptions(v->num_vars, v->vars);
v->num_vars = 0;
v->vars = NULL;
}
/*
* '_ippVarsExpand()' - Expand variables in the source string.
*/
void
_ippVarsExpand(_ipp_vars_t *v, /* I - IPP variables */
char *dst, /* I - Destination buffer */
const char *src, /* I - Source string */
size_t dstsize) /* I - Destination buffer size */
{
char *dstptr, /* Pointer into destination */
*dstend, /* End of destination */
temp[256], /* Temporary string */
*tempptr; /* Pointer into temporary string */
const char *value; /* Value to substitute */
dstptr = dst;
dstend = dst + dstsize - 1;
while (*src && dstptr < dstend)
{
if (*src == '$')
{
/*
* Substitute a string/number...
*/
if (!strncmp(src, "$$", 2))
{
value = "$";
src += 2;
}
else if (!strncmp(src, "$ENV[", 5))
{
strlcpy(temp, src + 5, sizeof(temp));
for (tempptr = temp; *tempptr; tempptr ++)
if (*tempptr == ']')
break;
if (*tempptr)
*tempptr++ = '\0';
value = getenv(temp);
src += tempptr - temp + 5;
}
else
{
if (src[1] == '{')
{
src += 2;
strlcpy(temp, src, sizeof(temp));
if ((tempptr = strchr(temp, '}')) != NULL)
*tempptr = '\0';
else
tempptr = temp + strlen(temp);
}
else
{
strlcpy(temp, src + 1, sizeof(temp));
for (tempptr = temp; *tempptr; tempptr ++)
if (!isalnum(*tempptr & 255) && *tempptr != '-' && *tempptr != '_')
break;
if (*tempptr)
*tempptr = '\0';
}
value = _ippVarsGet(v, temp);
src += tempptr - temp + 1;
}
if (value)
{
strlcpy(dstptr, value, (size_t)(dstend - dstptr + 1));
dstptr += strlen(dstptr);
}
}
else
*dstptr++ = *src++;
}
*dstptr = '\0';
}
/*
* '_ippVarsGet()' - Get a variable string.
*/
const char * /* O - Value or @code NULL@ if not set */
_ippVarsGet(_ipp_vars_t *v, /* I - IPP variables */
const char *name) /* I - Variable name */
{
if (!strcmp(name, "uri"))
return (v->uri);
else if (!strcmp(name, "uriuser") || !strcmp(name, "username"))
return (v->username[0] ? v->username : NULL);
else if (!strcmp(name, "scheme") || !strcmp(name, "method"))
return (v->scheme);
else if (!strcmp(name, "hostname"))
return (v->host);
else if (!strcmp(name, "port"))
return (v->portstr);
else if (!strcmp(name, "resource"))
return (v->resource);
else if (!strcmp(name, "user"))
return (cupsUser());
else
return (cupsGetOption(name, v->num_vars, v->vars));
}
/*
* '_ippVarsInit()' - Initialize .
*/
void
_ippVarsInit(_ipp_vars_t *v, /* I - IPP variables */
_ipp_fattr_cb_t attrcb, /* I - Attribute (filter) callback */
_ipp_ferror_cb_t errorcb, /* I - Error callback */
_ipp_ftoken_cb_t tokencb) /* I - Token callback */
{
memset(v, 0, sizeof(_ipp_vars_t));
v->attrcb = attrcb;
v->errorcb = errorcb;
v->tokencb = tokencb;
}
/*
* '_ippVarsPasswordCB()' - Password callback using the IPP variables.
*/
const char * /* O - Password string or @code NULL@ */
_ippVarsPasswordCB(
const char *prompt, /* I - Prompt string (not used) */
http_t *http, /* I - HTTP connection (not used) */
const char *method, /* I - HTTP method (not used) */
const char *resource, /* I - Resource path (not used) */
void *user_data) /* I - IPP variables */
{
_ipp_vars_t *v = (_ipp_vars_t *)user_data;
/* I - IPP variables */
(void)prompt;
(void)http;
(void)method;
(void)resource;
if (v->username[0] && v->password && v->password_tries < 3)
{
v->password_tries ++;
cupsSetUser(v->username);
return (v->password);
}
else
{
return (NULL);
}
}
/*
* '_ippVarsSet()' - Set an IPP variable.
*/
int /* O - 1 on success, 0 on failure */
_ippVarsSet(_ipp_vars_t *v, /* I - IPP variables */
const char *name, /* I - Variable name */
const char *value) /* I - Variable value */
{
if (!strcmp(name, "uri"))
{
char uri[1024]; /* New printer URI */
http_uri_status_t uri_status; /* URI status */
if ((uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource))) < HTTP_URI_STATUS_OK)
return (0);
if (v->username[0])
{
if ((v->password = strchr(v->username, ':')) != NULL)
*(v->password)++ = '\0';
}
snprintf(v->portstr, sizeof(v->portstr), "%d", v->port);
if (v->uri)
free(v->uri);
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri), v->scheme, NULL, v->host, v->port, v->resource);
v->uri = strdup(uri);
return (v->uri != NULL);
}
else
{
v->num_vars = cupsAddOption(name, value, v->num_vars, &v->vars);
return (1);
}
}
+86 -194
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Internet Printing Protocol functions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -3083,6 +3084,13 @@ ippReadIO(void *src, /* I - Data source */
ipp->state = IPP_STATE_DATA;
break;
}
else if (tag == IPP_TAG_ZERO || (tag == IPP_TAG_OPERATION && ipp->curtag != IPP_TAG_ZERO))
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid group tag."), 1);
DEBUG_printf(("1ippReadIO: bad tag 0x%02x.", tag));
_cupsBufferRelease((char *)buffer);
return (IPP_STATE_ERROR);
}
else if (tag < IPP_TAG_UNSUPPORTED_VALUE)
{
/*
@@ -3380,7 +3388,10 @@ ippReadIO(void *src, /* I - Data source */
value->boolean = (char)buffer[0];
break;
case IPP_TAG_NOVALUE :
case IPP_TAG_UNSUPPORTED_VALUE :
case IPP_TAG_DEFAULT :
case IPP_TAG_UNKNOWN :
case IPP_TAG_NOVALUE :
case IPP_TAG_NOTSETTABLE :
case IPP_TAG_DELETEATTR :
case IPP_TAG_ADMINDEFINE :
@@ -3400,6 +3411,7 @@ ippReadIO(void *src, /* I - Data source */
case IPP_TAG_TEXT :
case IPP_TAG_NAME :
case IPP_TAG_RESERVED_STRING :
case IPP_TAG_KEYWORD :
case IPP_TAG_URI :
case IPP_TAG_URISCHEME :
@@ -4300,18 +4312,22 @@ ippSetString(ipp_t *ipp, /* I - IPP message */
{
char *temp; /* Temporary string */
_ipp_value_t *value; /* Current value */
ipp_tag_t value_tag; /* Value tag */
/*
* Range check input...
*/
if (attr && *attr)
value_tag = (*attr)->value_tag & IPP_TAG_CUPS_MASK;
else
value_tag = IPP_TAG_ZERO;
if (!ipp || !attr || !*attr ||
((*attr)->value_tag != IPP_TAG_TEXTLANG &&
(*attr)->value_tag != IPP_TAG_NAMELANG &&
((*attr)->value_tag < IPP_TAG_TEXT ||
(*attr)->value_tag > IPP_TAG_MIMETYPE)) ||
element < 0 || element > (*attr)->num_values || !strvalue)
(value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG &&
value_tag != IPP_TAG_NAMELANG) || value_tag > IPP_TAG_MIMETYPE ||
!strvalue)
return (0);
/*
@@ -4802,21 +4818,6 @@ ippValidateAttribute(
ipp_attribute_t *colattr; /* Collection attribute */
regex_t re; /* Regular expression */
ipp_uchar_t *date; /* Current date value */
static const char * const uri_status_strings[] =
{ /* URI status strings */
"URI too large",
"Bad arguments to function",
"Bad resource in URI",
"Bad port number in URI",
"Bad hostname/address in URI",
"Bad username in URI",
"Bad scheme in URI",
"Bad/empty URI",
"OK",
"Missing scheme in URI",
"Unknown scheme in URI",
"Missing resource in URI"
};
/*
@@ -4836,18 +4837,13 @@ ippValidateAttribute(
if (*ptr || ptr == attr->name)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad attribute name - invalid character "
"(RFC 8011 section 5.1.4)."), attr->name);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad attribute name - invalid character (RFC 8011 section 5.1.4)."), attr->name);
return (0);
}
if ((ptr - attr->name) > 255)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad attribute name - bad length %d "
"(RFC 8011 section 5.1.4)."), attr->name,
(int)(ptr - attr->name));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad attribute name - bad length %d (RFC 8011 section 5.1.4)."), attr->name, (int)(ptr - attr->name));
return (0);
}
@@ -4862,10 +4858,7 @@ ippValidateAttribute(
if (attr->values[i].boolean != 0 &&
attr->values[i].boolean != 1)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad boolen value %d "
"(RFC 8011 section 5.1.21)."), attr->name,
attr->values[i].boolean);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad boolean value %d (RFC 8011 section 5.1.21)."), attr->name, attr->values[i].boolean);
return (0);
}
}
@@ -4876,10 +4869,7 @@ ippValidateAttribute(
{
if (attr->values[i].integer < 1)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad enum value %d - out of range "
"(RFC 8011 section 5.1.5)."), attr->name,
attr->values[i].integer);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad enum value %d - out of range (RFC 8011 section 5.1.5)."), attr->name, attr->values[i].integer);
return (0);
}
}
@@ -4890,10 +4880,7 @@ ippValidateAttribute(
{
if (attr->values[i].unknown.length > IPP_MAX_OCTETSTRING)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad octetString value - bad length %d "
"(RFC 8011 section 5.1.20)."), attr->name,
attr->values[i].unknown.length);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad octetString value - bad length %d (RFC 8011 section 5.1.20)."), attr->name, attr->values[i].unknown.length);
return (0);
}
}
@@ -4906,73 +4893,55 @@ ippValidateAttribute(
if (date[2] < 1 || date[2] > 12)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime month %u "
"(RFC 8011 section 5.1.15)."), attr->name, date[2]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime month %u (RFC 8011 section 5.1.15)."), attr->name, date[2]);
return (0);
}
if (date[3] < 1 || date[3] > 31)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime day %u "
"(RFC 8011 section 5.1.15)."), attr->name, date[3]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime day %u (RFC 8011 section 5.1.15)."), attr->name, date[3]);
return (0);
}
if (date[4] > 23)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime hours %u "
"(RFC 8011 section 5.1.15)."), attr->name, date[4]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime hours %u (RFC 8011 section 5.1.15)."), attr->name, date[4]);
return (0);
}
if (date[5] > 59)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime minutes %u "
"(RFC 8011 section 5.1.15)."), attr->name, date[5]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime minutes %u (RFC 8011 section 5.1.15)."), attr->name, date[5]);
return (0);
}
if (date[6] > 60)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime seconds %u "
"(RFC 8011 section 5.1.15)."), attr->name, date[6]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime seconds %u (RFC 8011 section 5.1.15)."), attr->name, date[6]);
return (0);
}
if (date[7] > 9)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime deciseconds %u "
"(RFC 8011 section 5.1.15)."), attr->name, date[7]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime deciseconds %u (RFC 8011 section 5.1.15)."), attr->name, date[7]);
return (0);
}
if (date[8] != '-' && date[8] != '+')
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime UTC sign '%c' "
"(RFC 8011 section 5.1.15)."), attr->name, date[8]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime UTC sign '%c' (RFC 8011 section 5.1.15)."), attr->name, date[8]);
return (0);
}
if (date[9] > 11)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime UTC hours %u "
"(RFC 8011 section 5.1.15)."), attr->name, date[9]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime UTC hours %u (RFC 8011 section 5.1.15)."), attr->name, date[9]);
return (0);
}
if (date[10] > 59)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad dateTime UTC minutes %u "
"(RFC 8011 section 5.1.15)."), attr->name, date[10]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad dateTime UTC minutes %u (RFC 8011 section 5.1.15)."), attr->name, date[10]);
return (0);
}
}
@@ -4983,46 +4952,19 @@ ippValidateAttribute(
{
if (attr->values[i].resolution.xres <= 0)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad resolution value %dx%d%s - cross "
"feed resolution must be positive "
"(RFC 8011 section 5.1.16)."), attr->name,
attr->values[i].resolution.xres,
attr->values[i].resolution.yres,
attr->values[i].resolution.units ==
IPP_RES_PER_INCH ? "dpi" :
attr->values[i].resolution.units ==
IPP_RES_PER_CM ? "dpcm" : "unknown");
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad resolution value %dx%d%s - cross feed resolution must be positive (RFC 8011 section 5.1.16)."), attr->name, attr->values[i].resolution.xres, attr->values[i].resolution.yres, attr->values[i].resolution.units == IPP_RES_PER_INCH ? "dpi" : attr->values[i].resolution.units == IPP_RES_PER_CM ? "dpcm" : "unknown");
return (0);
}
if (attr->values[i].resolution.yres <= 0)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad resolution value %dx%d%s - feed "
"resolution must be positive "
"(RFC 8011 section 5.1.16)."), attr->name,
attr->values[i].resolution.xres,
attr->values[i].resolution.yres,
attr->values[i].resolution.units ==
IPP_RES_PER_INCH ? "dpi" :
attr->values[i].resolution.units ==
IPP_RES_PER_CM ? "dpcm" : "unknown");
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad resolution value %dx%d%s - feed resolution must be positive (RFC 8011 section 5.1.16)."), attr->name, attr->values[i].resolution.xres, attr->values[i].resolution.yres, attr->values[i].resolution.units == IPP_RES_PER_INCH ? "dpi" : attr->values[i].resolution.units == IPP_RES_PER_CM ? "dpcm" : "unknown");
return (0);
}
if (attr->values[i].resolution.units != IPP_RES_PER_INCH &&
attr->values[i].resolution.units != IPP_RES_PER_CM)
if (attr->values[i].resolution.units != IPP_RES_PER_INCH && attr->values[i].resolution.units != IPP_RES_PER_CM)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad resolution value %dx%d%s - bad "
"units value (RFC 8011 section 5.1.16)."),
attr->name, attr->values[i].resolution.xres,
attr->values[i].resolution.yres,
attr->values[i].resolution.units ==
IPP_RES_PER_INCH ? "dpi" :
attr->values[i].resolution.units ==
IPP_RES_PER_CM ? "dpcm" : "unknown");
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad resolution value %dx%d%s - bad units value (RFC 8011 section 5.1.16)."), attr->name, attr->values[i].resolution.xres, attr->values[i].resolution.yres, attr->values[i].resolution.units == IPP_RES_PER_INCH ? "dpi" : attr->values[i].resolution.units == IPP_RES_PER_CM ? "dpcm" : "unknown");
return (0);
}
}
@@ -5033,11 +4975,7 @@ ippValidateAttribute(
{
if (attr->values[i].range.lower > attr->values[i].range.upper)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad rangeOfInteger value %d-%d - lower "
"greater than upper (RFC 8011 section 5.1.14)."),
attr->name, attr->values[i].range.lower,
attr->values[i].range.upper);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad rangeOfInteger value %d-%d - lower greater than upper (RFC 8011 section 5.1.14)."), attr->name, attr->values[i].range.lower, attr->values[i].range.upper);
return (0);
}
}
@@ -5091,24 +5029,24 @@ ippValidateAttribute(
}
else if (*ptr & 0x80)
break;
else if ((*ptr < ' ' && *ptr != '\n' && *ptr != '\r' && *ptr != '\t') || *ptr == 0x7f)
break;
}
if (*ptr)
if (*ptr < ' ' || *ptr == 0x7f)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad text value \"%s\" - bad UTF-8 "
"sequence (RFC 8011 section 5.1.2)."), attr->name,
attr->values[i].string.text);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
return (0);
}
else if (*ptr)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
return (0);
}
if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad text value \"%s\" - bad length %d "
"(RFC 8011 section 5.1.2)."), attr->name,
attr->values[i].string.text,
(int)(ptr - attr->values[i].string.text));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad length %d (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text, (int)(ptr - attr->values[i].string.text));
return (0);
}
}
@@ -5149,24 +5087,24 @@ ippValidateAttribute(
}
else if (*ptr & 0x80)
break;
else if (*ptr < ' ' || *ptr == 0x7f)
break;
}
if (*ptr)
if (*ptr < ' ' || *ptr == 0x7f)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad name value \"%s\" - bad UTF-8 "
"sequence (RFC 8011 section 5.1.3)."), attr->name,
attr->values[i].string.text);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
return (0);
}
else if (*ptr)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
return (0);
}
if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad name value \"%s\" - bad length %d "
"(RFC 8011 section 5.1.3)."), attr->name,
attr->values[i].string.text,
(int)(ptr - attr->values[i].string.text));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad length %d (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text, (int)(ptr - attr->values[i].string.text));
return (0);
}
}
@@ -5176,26 +5114,21 @@ ippValidateAttribute(
for (i = 0; i < attr->num_values; i ++)
{
for (ptr = attr->values[i].string.text; *ptr; ptr ++)
{
if (!isalnum(*ptr & 255) && *ptr != '-' && *ptr != '.' &&
*ptr != '_')
break;
}
if (*ptr || ptr == attr->values[i].string.text)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad keyword value \"%s\" - invalid "
"character (RFC 8011 section 5.1.4)."),
attr->name, attr->values[i].string.text);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad keyword value \"%s\" - invalid character (RFC 8011 section 5.1.4)."), attr->name, attr->values[i].string.text);
return (0);
}
if ((ptr - attr->values[i].string.text) > (IPP_MAX_KEYWORD - 1))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad keyword value \"%s\" - bad "
"length %d (RFC 8011 section 5.1.4)."),
attr->name, attr->values[i].string.text,
(int)(ptr - attr->values[i].string.text));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad keyword value \"%s\" - bad length %d (RFC 8011 section 5.1.4)."), attr->name, attr->values[i].string.text, (int)(ptr - attr->values[i].string.text));
return (0);
}
}
@@ -5204,31 +5137,17 @@ ippValidateAttribute(
case IPP_TAG_URI :
for (i = 0; i < attr->num_values; i ++)
{
uri_status = httpSeparateURI(HTTP_URI_CODING_ALL,
attr->values[i].string.text,
scheme, sizeof(scheme),
userpass, sizeof(userpass),
hostname, sizeof(hostname),
&port, resource, sizeof(resource));
uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[i].string.text, scheme, sizeof(scheme), userpass, sizeof(userpass), hostname, sizeof(hostname), &port, resource, sizeof(resource));
if (uri_status < HTTP_URI_STATUS_OK)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad URI value \"%s\" - %s "
"(RFC 8011 section 5.1.6)."), attr->name,
attr->values[i].string.text,
uri_status_strings[uri_status -
HTTP_URI_STATUS_OVERFLOW]);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad URI value \"%s\" - %s (RFC 8011 section 5.1.6)."), attr->name, attr->values[i].string.text, httpURIStatusString(uri_status));
return (0);
}
if (strlen(attr->values[i].string.text) > (IPP_MAX_URI - 1))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad URI value \"%s\" - bad length %d "
"(RFC 8011 section 5.1.6)."), attr->name,
attr->values[i].string.text,
(int)strlen(attr->values[i].string.text));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad URI value \"%s\" - bad length %d (RFC 8011 section 5.1.6)."), attr->name, attr->values[i].string.text, (int)strlen(attr->values[i].string.text));
}
}
break;
@@ -5240,27 +5159,22 @@ ippValidateAttribute(
if (islower(*ptr & 255))
{
for (ptr ++; *ptr; ptr ++)
{
if (!islower(*ptr & 255) && !isdigit(*ptr & 255) &&
*ptr != '+' && *ptr != '-' && *ptr != '.')
break;
}
}
if (*ptr || ptr == attr->values[i].string.text)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad uriScheme value \"%s\" - bad "
"characters (RFC 8011 section 5.1.7)."),
attr->name, attr->values[i].string.text);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad uriScheme value \"%s\" - bad characters (RFC 8011 section 5.1.7)."), attr->name, attr->values[i].string.text);
return (0);
}
if ((ptr - attr->values[i].string.text) > (IPP_MAX_URISCHEME - 1))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad uriScheme value \"%s\" - bad "
"length %d (RFC 8011 section 5.1.7)."),
attr->name, attr->values[i].string.text,
(int)(ptr - attr->values[i].string.text));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad uriScheme value \"%s\" - bad length %d (RFC 8011 section 5.1.7)."), attr->name, attr->values[i].string.text, (int)(ptr - attr->values[i].string.text));
return (0);
}
}
@@ -5270,26 +5184,21 @@ ippValidateAttribute(
for (i = 0; i < attr->num_values; i ++)
{
for (ptr = attr->values[i].string.text; *ptr; ptr ++)
{
if (!isprint(*ptr & 255) || isupper(*ptr & 255) ||
isspace(*ptr & 255))
break;
}
if (*ptr || ptr == attr->values[i].string.text)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad charset value \"%s\" - bad "
"characters (RFC 8011 section 5.1.8)."),
attr->name, attr->values[i].string.text);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad charset value \"%s\" - bad characters (RFC 8011 section 5.1.8)."), attr->name, attr->values[i].string.text);
return (0);
}
if ((ptr - attr->values[i].string.text) > (IPP_MAX_CHARSET - 1))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad charset value \"%s\" - bad "
"length %d (RFC 8011 section 5.1.8)."),
attr->name, attr->values[i].string.text,
(int)(ptr - attr->values[i].string.text));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad charset value \"%s\" - bad length %d (RFC 8011 section 5.1.8)."), attr->name, attr->values[i].string.text, (int)(ptr - attr->values[i].string.text));
return (0);
}
}
@@ -5321,9 +5230,7 @@ ippValidateAttribute(
char temp[256]; /* Temporary error string */
regerror(i, &re, temp, sizeof(temp));
ipp_set_error(IPP_STATUS_ERROR_INTERNAL,
_("Unable to compile naturalLanguage regular "
"expression: %s."), temp);
ipp_set_error(IPP_STATUS_ERROR_INTERNAL, _("Unable to compile naturalLanguage regular expression: %s."), temp);
return (0);
}
@@ -5331,21 +5238,14 @@ ippValidateAttribute(
{
if (regexec(&re, attr->values[i].string.text, 0, NULL, 0))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad naturalLanguage value \"%s\" - bad "
"characters (RFC 8011 section 5.1.9)."),
attr->name, attr->values[i].string.text);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad naturalLanguage value \"%s\" - bad characters (RFC 8011 section 5.1.9)."), attr->name, attr->values[i].string.text);
regfree(&re);
return (0);
}
if (strlen(attr->values[i].string.text) > (IPP_MAX_LANGUAGE - 1))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad naturalLanguage value \"%s\" - bad "
"length %d (RFC 8011 section 5.1.9)."),
attr->name, attr->values[i].string.text,
(int)strlen(attr->values[i].string.text));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad naturalLanguage value \"%s\" - bad length %d (RFC 8011 section 5.1.9)."), attr->name, attr->values[i].string.text, (int)strlen(attr->values[i].string.text));
regfree(&re);
return (0);
}
@@ -5375,9 +5275,7 @@ ippValidateAttribute(
char temp[256]; /* Temporary error string */
regerror(i, &re, temp, sizeof(temp));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("Unable to compile mimeMediaType regular "
"expression: %s."), temp);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("Unable to compile mimeMediaType regular expression: %s."), temp);
return (0);
}
@@ -5385,21 +5283,14 @@ ippValidateAttribute(
{
if (regexec(&re, attr->values[i].string.text, 0, NULL, 0))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad mimeMediaType value \"%s\" - bad "
"characters (RFC 8011 section 5.1.10)."),
attr->name, attr->values[i].string.text);
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad mimeMediaType value \"%s\" - bad characters (RFC 8011 section 5.1.10)."), attr->name, attr->values[i].string.text);
regfree(&re);
return (0);
}
if (strlen(attr->values[i].string.text) > (IPP_MAX_MIMETYPE - 1))
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad mimeMediaType value \"%s\" - bad "
"length %d (RFC 8011 section 5.1.10)."),
attr->name, attr->values[i].string.text,
(int)strlen(attr->values[i].string.text));
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad mimeMediaType value \"%s\" - bad length %d (RFC 8011 section 5.1.10)."), attr->name, attr->values[i].string.text, (int)strlen(attr->values[i].string.text));
regfree(&re);
return (0);
}
@@ -6496,6 +6387,7 @@ ipp_free_values(ipp_attribute_t *attr, /* I - Attribute to free values from */
}
break;
case IPP_TAG_UNSUPPORTED_VALUE :
case IPP_TAG_DEFAULT :
case IPP_TAG_UNKNOWN :
case IPP_TAG_NOVALUE :
+25 -143
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Internet Printing Protocol definitions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_IPP_H_
@@ -73,11 +74,11 @@ extern "C" {
typedef enum ipp_dstate_e /**** Document states @exclude all@ ****/
{
IPP_DOCUMENT_PENDING = 3, /* Document is pending */
IPP_DOCUMENT_PROCESSING = 5, /* Document is processing */
IPP_DOCUMENT_CANCELED = 7, /* Document is canceled */
IPP_DOCUMENT_ABORTED, /* Document is aborted */
IPP_DOCUMENT_COMPLETED /* Document is completed */
IPP_DSTATE_PENDING = 3, /* Document is pending */
IPP_DSTATE_PROCESSING = 5, /* Document is processing */
IPP_DSTATE_CANCELED = 7, /* Document is canceled */
IPP_DSTATE_ABORTED, /* Document is aborted */
IPP_DSTATE_COMPLETED /* Document is completed */
# ifndef _CUPS_NO_DEPRECATED
# define IPP_DOCUMENT_PENDING IPP_DSTATE_PENDING
@@ -489,6 +490,22 @@ typedef enum ipp_res_e /**** Resolution units ****/
IPP_RES_PER_CM /* Pixels per centimeter */
} ipp_res_t;
typedef enum ipp_rstate_e /**** resource-state values ****/
{
IPP_RSTATE_PENDING = 3, /* Resource is created but has no data yet. */
IPP_RSTATE_AVAILABLE, /* Resource is available for installation. */
IPP_RSTATE_INSTALLED, /* Resource is installed. */
IPP_RSTATE_CANCELED, /* Resource has been canceled and is pending deletion. */
IPP_RSTATE_ABORTED /* Resource has been aborted and is pending deletion. */
} ipp_rstate_t;
typedef enum ipp_sstate_e /**** system-state values ****/
{
IPP_SSTATE_IDLE = 3, /* At least one printer is idle and none are processing a job. */
IPP_SSTATE_PROCESSING, /* At least one printer is processing a job. */
IPP_SSTATE_STOPPED /* All printers are stopped. */
} ipp_sstate_t;
typedef enum ipp_state_e /**** ipp_t state values ****/
{
IPP_STATE_ERROR = -1, /* An error occurred */
@@ -724,141 +741,6 @@ typedef int (*ipp_copycb_t)(void *context, ipp_t *dst, ipp_attribute_t *attr);
/**** ippCopyAttributes callback function @since CUPS 1.6/macOS 10.8 ****/
/*
* The following structures are PRIVATE starting with CUPS 1.6/macOS 10.8.
* Please use the new accessor functions available in CUPS 1.6 and later, as
* these definitions will be moved to a private header file in a future release.
*
* Define _IPP_PRIVATE_STRUCTURES to 1 to cause the private IPP structures to be
* exposed in CUPS 1.6. This happens automatically on macOS when compiling for
* a deployment target of 10.7 or earlier.
*
* Define _IPP_PRIVATE_STRUCTURES to 0 to prevent the private IPP structures
* from being exposed. This is useful when migrating existing code to the new
* accessors.
*/
# ifdef _IPP_PRIVATE_STRUCTURES
/* Somebody has overridden the value */
# elif defined(_CUPS_SOURCE) || defined(_CUPS_IPP_PRIVATE_H_)
/* Building CUPS */
# define _IPP_PRIVATE_STRUCTURES 1
# elif defined(__APPLE__)
# if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
/* Building for 10.7 and earlier */
# define _IPP_PRIVATE_STRUCTURES 1
# elif !defined(MAC_OS_X_VERSION_10_8)
/* Building for 10.7 and earlier */
# define _IPP_PRIVATE_STRUCTURES 1
# endif /* MAC_OS_X_VERSION_10_8 && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 */
# else
# define _IPP_PRIVATE_STRUCTURES 0
# endif /* _CUPS_SOURCE || _CUPS_IPP_PRIVATE_H_ */
# if _IPP_PRIVATE_STRUCTURES
typedef union _ipp_request_u /**** Request Header ****/
{
struct /* Any Header */
{
ipp_uchar_t version[2]; /* Protocol version number */
int op_status; /* Operation ID or status code*/
int request_id; /* Request ID */
} any;
struct /* Operation Header */
{
ipp_uchar_t version[2]; /* Protocol version number */
ipp_op_t operation_id; /* Operation ID */
int request_id; /* Request ID */
} op;
struct /* Status Header */
{
ipp_uchar_t version[2]; /* Protocol version number */
ipp_status_t status_code; /* Status code */
int request_id; /* Request ID */
} status;
/**** New in CUPS 1.1.19 ****/
struct /* Event Header @since CUPS 1.1.19/macOS 10.3@ */
{
ipp_uchar_t version[2]; /* Protocol version number */
ipp_status_t status_code; /* Status code */
int request_id; /* Request ID */
} event;
} _ipp_request_t;
/**** New in CUPS 1.1.19 ****/
typedef union _ipp_value_u /**** Attribute Value ****/
{
int integer; /* Integer/enumerated value */
char boolean; /* Boolean value */
ipp_uchar_t date[11]; /* Date/time value */
struct
{
int xres, /* Horizontal resolution */
yres; /* Vertical resolution */
ipp_res_t units; /* Resolution units */
} resolution; /* Resolution value */
struct
{
int lower, /* Lower value */
upper; /* Upper value */
} range; /* Range of integers value */
struct
{
char *language; /* Language code */
char *text; /* String */
} string; /* String with language value */
struct
{
int length; /* Length of attribute */
void *data; /* Data in attribute */
} unknown; /* Unknown attribute type */
/**** New in CUPS 1.1.19 ****/
ipp_t *collection; /* Collection value @since CUPS 1.1.19/macOS 10.3@ */
} _ipp_value_t;
typedef _ipp_value_t ipp_value_t; /**** Convenience typedef that will be removed @private@ ****/
struct _ipp_attribute_s /**** IPP attribute ****/
{
ipp_attribute_t *next; /* Next attribute in list */
ipp_tag_t group_tag, /* Job/Printer/Operation group tag */
value_tag; /* What type of value is it? */
char *name; /* Name of attribute */
int num_values; /* Number of values */
_ipp_value_t values[1]; /* Values */
};
struct _ipp_s /**** IPP Request/Response/Notification ****/
{
ipp_state_t state; /* State of request */
_ipp_request_t request; /* Request header */
ipp_attribute_t *attrs; /* Attributes */
ipp_attribute_t *last; /* Last attribute in list */
ipp_attribute_t *current; /* Current attribute (for read/write) */
ipp_tag_t curtag; /* Current attribute group tag */
/**** New in CUPS 1.2 ****/
ipp_attribute_t *prev; /* Previous attribute (for read) @since CUPS 1.2/macOS 10.5@ */
/**** New in CUPS 1.4.4 ****/
int use; /* Use count @since CUPS 1.4.4/macOS 10.6.?@ */
/**** New in CUPS 2.0 ****/
int atend, /* At end of list? */
curindex; /* Current attribute index for hierarchical search */
};
# endif /* _IPP_PRIVATE_STRUCTURES */
/*
* Prototypes...
*/
+32 -4
Ver Arquivo
@@ -1,5 +1,5 @@
LIBRARY libcups2
VERSION 2.12
VERSION 2.14
EXPORTS
_cupsArrayAddStrings
_cupsArrayNewStrings
@@ -12,6 +12,7 @@ _cupsCondWait
_cupsConnect
_cupsConvertOptions
_cupsCreateDest
_cupsEncodeOption
_cupsEncodingName
_cupsGet1284Values
_cupsGetDestResource
@@ -24,13 +25,11 @@ _cupsLangPrintError
_cupsLangPrintf
_cupsLangPuts
_cupsLangString
_cupsMD5Append
_cupsMD5Finish
_cupsMD5Init
_cupsMessageFree
_cupsMessageLoad
_cupsMessageLookup
_cupsMessageNew
_cupsMessageSave
_cupsMutexInit
_cupsMutexLock
_cupsMutexUnlock
@@ -39,6 +38,9 @@ _cupsRWInit
_cupsRWLockRead
_cupsRWLockWrite
_cupsRWUnlock
_cupsRasterAddError
_cupsRasterClearError
_cupsRasterExecPS
_cupsSNMPClose
_cupsSNMPCopyOID
_cupsSNMPDefaultCommunity
@@ -65,6 +67,7 @@ _cupsStrScand
_cupsStrStatistics
_cupsThreadCancel
_cupsThreadCreate
_cupsThreadDetach
_cupsThreadWait
_cupsUserDefault
_cups_safe_vsnprintf
@@ -92,7 +95,15 @@ _httpTLSWrite
_httpUpdate
_httpWait
_ippCheckOptions
_ippFileParse
_ippFileReadToken
_ippFindOption
_ippVarsDeinit
_ippVarsExpand
_ippVarsGet
_ippVarsInit
_ippVarsPasswordCB
_ippVarsSet
_ppdCacheCreateWithFile
_ppdCacheCreateWithPPD
_ppdCacheDestroy
@@ -124,6 +135,8 @@ _pwgMediaTable
_pwgMediaTypeForType
_pwgPageSizeForMedia
cupsAddDest
cupsAddDestMediaOptions
cupsAddIntegerOption
cupsAddOption
cupsAdminCreateWindowsPPD
cupsAdminExportSamba
@@ -171,6 +184,7 @@ cupsDoAuthentication
cupsDoFileRequest
cupsDoIORequest
cupsDoRequest
cupsEncodeOption
cupsEncodeOptions
cupsEncodeOptions2
cupsEncryption
@@ -227,6 +241,7 @@ cupsGetDests2
cupsGetDevices
cupsGetFd
cupsGetFile
cupsGetIntegerOption
cupsGetJobs
cupsGetJobs2
cupsGetNamedDest
@@ -240,6 +255,7 @@ cupsGetPrinters
cupsGetResponse
cupsGetServerPPD
cupsHashData
cupsHashString
cupsLangDefault
cupsLangEncoding
cupsLangFlush
@@ -261,6 +277,18 @@ cupsPrintFiles
cupsPrintFiles2
cupsPutFd
cupsPutFile
cupsRasterClose
cupsRasterErrorString
cupsRasterInitPWGHeader
cupsRasterInterpretPPD
cupsRasterOpen
cupsRasterOpenIO
cupsRasterReadHeader
cupsRasterReadHeader2
cupsRasterReadPixels
cupsRasterWriteHeader
cupsRasterWriteHeader2
cupsRasterWritePixels
cupsReadResponseData
cupsRemoveDest
cupsRemoveOption
+1 -1
Ver Arquivo
@@ -72,7 +72,7 @@ httpMD5Final(const char *nonce, /* I - Server nonce value */
snprintf(line, sizeof(line), "%s:%s", method, resource);
cupsHashData("md5", (unsigned char *)line, strlen(line), sum, sizeof(sum));
httpMD5String(sum, a2);
cupsHashString(sum, sizeof(sum), a2, sizeof(a2));
/*
* Then combine A1 (MD5 of username, realm, and password) with the nonce
+130 -48
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* PPD cache implementation for CUPS.
*
* Copyright 2010-2017 by Apple Inc.
* Copyright © 2010-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -385,7 +386,7 @@ _cupsConvertOptions(
}
else
{
num_finishings = _ppdCacheGetFinishingValues(pc, num_options, options, (int)(sizeof(finishings) / sizeof(finishings[0])), finishings);
num_finishings = _ppdCacheGetFinishingValues(ppd, pc, (int)(sizeof(finishings) / sizeof(finishings[0])), finishings);
if (num_finishings > 0)
{
ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings", num_finishings, finishings);
@@ -2150,9 +2151,8 @@ _ppdCacheGetFinishingOptions(
int /* O - Number of finishings values */
_ppdCacheGetFinishingValues(
ppd_file_t *ppd, /* I - Marked PPD file */
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
int num_options, /* I - Number of options */
cups_option_t *options, /* I - Options */
int max_values, /* I - Maximum number of finishings values */
int *values) /* O - Finishings values */
{
@@ -2160,16 +2160,16 @@ _ppdCacheGetFinishingValues(
num_values = 0; /* Number of values */
_pwg_finishings_t *f; /* Current finishings option */
cups_option_t *option; /* Current option */
const char *val; /* Value for option */
ppd_choice_t *choice; /* Marked PPD choice */
/*
* Range check input...
*/
DEBUG_printf(("_ppdCacheGetFinishingValues(pc=%p, num_options=%d, options=%p, max_values=%d, values=%p)", pc, num_options, options, max_values, values));
DEBUG_printf(("_ppdCacheGetFinishingValues(ppd=%p, pc=%p, max_values=%d, values=%p)", ppd, pc, max_values, values));
if (!pc || max_values < 1 || !values)
if (!ppd || !pc || max_values < 1 || !values)
{
DEBUG_puts("_ppdCacheGetFinishingValues: Bad arguments, returning 0.");
return (0);
@@ -2194,8 +2194,7 @@ _ppdCacheGetFinishingValues(
{
DEBUG_printf(("_ppdCacheGetFinishingValues: %s=%s?", option->name, option->value));
if ((val = cupsGetOption(option->name, num_options, options)) == NULL ||
_cups_strcasecmp(option->value, val))
if ((choice = ppdFindMarkedChoice(ppd, option->name)) == NULL || _cups_strcasecmp(option->value, choice->choice))
{
DEBUG_puts("_ppdCacheGetFinishingValues: NO");
break;
@@ -3172,6 +3171,41 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
httpClose(http);
}
/*
* Password/PIN printing...
*/
if ((attr = ippFindAttribute(response, "job-password-supported", IPP_TAG_INTEGER)) != NULL)
{
char pattern[33]; /* Password pattern */
int maxlen = ippGetInteger(attr, 0);
/* Maximum length */
const char *repertoire = ippGetString(ippFindAttribute(response, "job-password-repertoire-configured", IPP_TAG_KEYWORD), 0, NULL);
/* Type of password */
if (maxlen > (int)(sizeof(pattern) - 1))
maxlen = sizeof(pattern) - 1;
if (!repertoire || !strcmp(repertoire, "iana_us-ascii_digits"))
memset(pattern, '1', maxlen);
else if (!strcmp(repertoire, "iana_us-ascii_letters"))
memset(pattern, 'A', maxlen);
else if (!strcmp(repertoire, "iana_us-ascii_complex"))
memset(pattern, 'C', maxlen);
else if (!strcmp(repertoire, "iana_us-ascii_any"))
memset(pattern, '.', maxlen);
else if (!strcmp(repertoire, "iana_utf-8_digits"))
memset(pattern, 'N', maxlen);
else if (!strcmp(repertoire, "iana_utf-8_letters"))
memset(pattern, 'U', maxlen);
else
memset(pattern, '*', maxlen);
pattern[maxlen] = '\0';
cupsFilePrintf(fp, "*cupsPassword: \"%s\"\n", pattern);
}
/*
* Filters...
*/
@@ -3180,24 +3214,18 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
{
is_apple = ippContainsString(attr, "image/urf");
is_pdf = ippContainsString(attr, "application/pdf");
is_pwg = ippContainsString(attr, "image/pwg-raster");
is_pwg = ippContainsString(attr, "image/pwg-raster") && !is_apple;
for (i = 0, count = ippGetCount(attr); i < count; i ++)
{
const char *format = ippGetString(attr, i, NULL);
/* PDL */
/*
* Write cupsFilter2 lines for supported formats...
*/
if (!_cups_strcasecmp(format, "application/pdf"))
cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n");
else if (!_cups_strcasecmp(format, "image/jpeg") || !_cups_strcasecmp(format, "image/png"))
cupsFilePrintf(fp, "*cupsFilter2: \"%s %s 0 -\"\n", format, format);
else if (!_cups_strcasecmp(format, "image/pwg-raster") || !_cups_strcasecmp(format, "image/urf"))
cupsFilePrintf(fp, "*cupsFilter2: \"%s %s 100 -\"\n", format, format);
}
if (ippContainsString(attr, "image/jpeg"))
cupsFilePuts(fp, "*cupsFilter2: \"image/jpeg image/jpeg 0 -\"\n");
if (ippContainsString(attr, "image/png"))
cupsFilePuts(fp, "*cupsFilter2: \"image/png image/png 0 -\"\n");
if (is_pdf)
cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n");
if (is_apple)
cupsFilePuts(fp, "*cupsFilter2: \"image/urf image/urf 100 -\"\n");
if (is_pwg)
cupsFilePuts(fp, "*cupsFilter2: \"image/pwg-raster image/pwg-raster 100 -\"\n");
}
if (!is_apple && !is_pdf && !is_pwg)
@@ -3704,62 +3732,116 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if (attr)
{
int wrote_color = 0;
const char *default_color = NULL; /* Default */
for (i = 0, count = ippGetCount(attr); i < count; i ++)
{
keyword = ippGetString(attr, i, NULL);
#define PRINTF_COLORMODEL if (!wrote_color) { cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n*OrderDependency: 10 AnySetup *ColorModel\n", _cupsLangString(lang, _("Color Mode"))); wrote_color = 1; }
#define PRINTF_COLOROPTION(name,text,cspace,bpp) cupsFilePrintf(fp, "*ColorModel %s/%s: \"<</cupsColorSpace %d/cupsBitsPerColor %d/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n", name, _cupsLangString(lang, text), cspace, bpp)
if (!strcasecmp(keyword, "black_1") || !strcmp(keyword, "bi-level") || !strcmp(keyword, "process-bi-level"))
{
if (!default_color)
cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
"*OrderDependency: 10 AnySetup *ColorModel\n", _cupsLangString(lang, _("Color Mode")));
PRINTF_COLORMODEL
cupsFilePrintf(fp, "*ColorModel FastGray/%s: \"<</cupsColorSpace 3/cupsBitsPerColor 1/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n", _cupsLangString(lang, _("Fast Grayscale")));
PRINTF_COLOROPTION("FastGray", _("Fast Grayscale"), CUPS_CSPACE_K, 1);
if (!default_color)
default_color = "FastGray";
}
else if (!strcasecmp(keyword, "sgray_8") || !strcmp(keyword, "W8") || !strcmp(keyword, "monochrome") || !strcmp(keyword, "process-monochrome"))
{
if (!default_color)
cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
"*OrderDependency: 10 AnySetup *ColorModel\n", _cupsLangString(lang, _("Color Mode")));
PRINTF_COLORMODEL
cupsFilePrintf(fp, "*ColorModel Gray/%s: \"<</cupsColorSpace 18/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n", _cupsLangString(lang, _("Grayscale")));
PRINTF_COLOROPTION("Gray", _("Grayscale"), CUPS_CSPACE_SW, 8);
if (!default_color || !strcmp(default_color, "FastGray"))
default_color = "Gray";
}
else if (!strcasecmp(keyword, "srgb_8") || !strcmp(keyword, "SRGB24") || !strcmp(keyword, "color"))
else if (!strcasecmp(keyword, "sgray_16") || !strcmp(keyword, "W8-16"))
{
if (!default_color)
cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
"*OrderDependency: 10 AnySetup *ColorModel\n", _cupsLangString(lang, _("Color Mode")));
PRINTF_COLORMODEL
cupsFilePrintf(fp, "*ColorModel RGB/%s: \"<</cupsColorSpace 19/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n", _cupsLangString(lang, _("Color")));
if (!strcmp(keyword, "W8-16"))
{
PRINTF_COLOROPTION("Gray", _("Grayscale"), CUPS_CSPACE_SW, 8);
if (!default_color || !strcmp(default_color, "FastGray"))
default_color = "Gray";
}
PRINTF_COLOROPTION("Gray16", _("Deep Gray"), CUPS_CSPACE_SW, 16);
}
else if (!strcasecmp(keyword, "srgb_8") || !strncmp(keyword, "SRGB24", 7) || !strcmp(keyword, "color"))
{
PRINTF_COLORMODEL
PRINTF_COLOROPTION("RGB", _("Color"), CUPS_CSPACE_SRGB, 8);
default_color = "RGB";
}
else if (!strcasecmp(keyword, "adobe-rgb_16") || !strcmp(keyword, "ADOBERGB48"))
else if (!strcasecmp(keyword, "adobe-rgb_16") || !strcmp(keyword, "ADOBERGB48") || !strcmp(keyword, "ADOBERGB24-48"))
{
if (!default_color)
cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
"*OrderDependency: 10 AnySetup *ColorModel\n", _cupsLangString(lang, _("Color Mode")));
PRINTF_COLORMODEL
cupsFilePrintf(fp, "*ColorModel AdobeRGB/%s: \"<</cupsColorSpace 20/cupsBitsPerColor 16/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n", _cupsLangString(lang, _("Deep Color")));
PRINTF_COLOROPTION("AdobeRGB", _("Deep Color"), CUPS_CSPACE_ADOBERGB, 16);
if (!default_color)
default_color = "AdobeRGB";
}
else if ((!strcasecmp(keyword, "adobe-rgb_8") && !ippContainsString(attr, "adobe-rgb_16")) || !strcmp(keyword, "ADOBERGB24"))
{
PRINTF_COLORMODEL
PRINTF_COLOROPTION("AdobeRGB", _("Deep Color"), CUPS_CSPACE_ADOBERGB, 8);
if (!default_color)
default_color = "AdobeRGB";
}
else if ((!strcasecmp(keyword, "black_8") && !ippContainsString(attr, "black_16")) || !strcmp(keyword, "DEVW8"))
{
PRINTF_COLORMODEL
PRINTF_COLOROPTION("DeviceGray", _("Device Gray"), CUPS_CSPACE_W, 8);
}
else if (!strcasecmp(keyword, "black_16") || !strcmp(keyword, "DEVW16") || !strcmp(keyword, "DEVW8-16"))
{
PRINTF_COLORMODEL
PRINTF_COLOROPTION("DeviceGray", _("Device Gray"), CUPS_CSPACE_W, 16);
}
else if ((!strcasecmp(keyword, "cmyk_8") && !ippContainsString(attr, "cmyk_16")) || !strcmp(keyword, "DEVCMYK32"))
{
PRINTF_COLORMODEL
PRINTF_COLOROPTION("CMYK", _("Device CMYK"), CUPS_CSPACE_CMYK, 8);
}
else if (!strcasecmp(keyword, "cmyk_16") || !strcmp(keyword, "DEVCMYK32-64") || !strcmp(keyword, "DEVCMYK64"))
{
PRINTF_COLORMODEL
PRINTF_COLOROPTION("CMYK", _("Device CMYK"), CUPS_CSPACE_CMYK, 16);
}
else if ((!strcasecmp(keyword, "rgb_8") && ippContainsString(attr, "rgb_16")) || !strcmp(keyword, "DEVRGB24"))
{
PRINTF_COLORMODEL
PRINTF_COLOROPTION("DeviceRGB", _("Device RGB"), CUPS_CSPACE_RGB, 8);
}
else if (!strcasecmp(keyword, "rgb_16") || !strcmp(keyword, "DEVRGB24-48") || !strcmp(keyword, "DEVRGB48"))
{
PRINTF_COLORMODEL
PRINTF_COLOROPTION("DeviceRGB", _("Device RGB"), CUPS_CSPACE_RGB, 16);
}
}
if (default_color)
{
cupsFilePrintf(fp, "*DefaultColorModel: %s\n", default_color);
if (wrote_color)
cupsFilePuts(fp, "*CloseUI: *ColorModel\n");
}
}
/*
@@ -4065,7 +4147,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
/* Member attribute name */
if (strcmp(name, "media-size"))
cupsFilePrintf(fp, "%s\n", name);
cupsFilePrintf(fp, "%% %s\n", name);
}
}
cupsFilePuts(fp, "\"\n");
+2 -3
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Option conflict management routines for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -24,7 +24,6 @@
enum
{
_PPD_NORMAL_CONSTRAINTS,
_PPD_OPTION_CONSTRAINTS,
_PPD_INSTALLABLE_CONSTRAINTS,
_PPD_ALL_CONSTRAINTS
@@ -993,7 +992,7 @@ ppd_test_constraints(
if (!consts->installable && which == _PPD_INSTALLABLE_CONSTRAINTS)
continue; /* Skip non-installable option constraint */
if (which == _PPD_OPTION_CONSTRAINTS && option)
if ((which == _PPD_OPTION_CONSTRAINTS || which == _PPD_INSTALLABLE_CONSTRAINTS) && option)
{
/*
* Skip constraints that do not involve the current option...
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* PPD localization routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -265,7 +265,7 @@ ppdLocalizeIPPReason(
if (!locattr)
{
if (lang && (!scheme || !strcmp(scheme, "text")))
if (lang && (!scheme || !strcmp(scheme, "text")) && strcmp(reason, "none"))
{
/*
* Try to localize a standard printer-state-reason keyword...
+2 -6
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Private PPD definitions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -167,11 +167,7 @@ extern int _ppdCacheGetFinishingOptions(_ppd_cache_t *pc,
ipp_finishings_t value,
int num_options,
cups_option_t **options);
extern int _ppdCacheGetFinishingValues(_ppd_cache_t *pc,
int num_options,
cups_option_t *options,
int max_values,
int *values);
extern int _ppdCacheGetFinishingValues(ppd_file_t *ppd, _ppd_cache_t *pc, int max_values, int *values);
extern const char *_ppdCacheGetInputSlot(_ppd_cache_t *pc, ipp_t *job,
const char *keyword);
extern const char *_ppdCacheGetMediaType(_ppd_cache_t *pc, ipp_t *job,
+58 -105
Ver Arquivo
@@ -1,8 +1,8 @@
/*
* PPD utilities for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
@@ -150,18 +150,21 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
if (!name)
{
DEBUG_puts("2cupsGetPPD3: No printer name, returning NULL.");
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No printer name"), 1);
return (HTTP_STATUS_NOT_ACCEPTABLE);
}
if (!modtime)
{
DEBUG_puts("2cupsGetPPD3: No modtime, returning NULL.");
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No modification time"), 1);
return (HTTP_STATUS_NOT_ACCEPTABLE);
}
if (!buffer || bufsize <= 1)
{
DEBUG_puts("2cupsGetPPD3: No filename buffer, returning NULL.");
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad filename buffer"), 1);
return (HTTP_STATUS_NOT_ACCEPTABLE);
}
@@ -196,6 +199,8 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
if (buffer[0])
{
DEBUG_printf(("2cupsGetPPD3: Using filename \"%s\".", buffer));
unlink(buffer);
if (symlink(ppdname, buffer) && errno != EEXIST)
@@ -211,6 +216,28 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
const char *tmpdir; /* TMPDIR environment variable */
struct timeval curtime; /* Current time */
#ifdef __APPLE__
/*
* On macOS and iOS, the TMPDIR environment variable is not always the
* best location to place temporary files due to sandboxing. Instead,
* the confstr function should be called to get the proper per-user,
* per-process TMPDIR value.
*/
char tmppath[1024]; /* Temporary directory */
if ((tmpdir = getenv("TMPDIR")) != NULL && access(tmpdir, W_OK))
tmpdir = NULL;
if (!tmpdir)
{
if (confstr(_CS_DARWIN_USER_TEMP_DIR, tmppath, sizeof(tmppath)))
tmpdir = tmppath;
else
tmpdir = "/private/tmp"; /* This should never happen */
}
#else
/*
* Previously we put root temporary files in the default CUPS temporary
* directory under /var/spool/cups. However, since the scheduler cleans
@@ -219,11 +246,10 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
*/
if ((tmpdir = getenv("TMPDIR")) == NULL)
# ifdef __APPLE__
tmpdir = "/private/tmp"; /* /tmp is a symlink to /private/tmp */
# else
tmpdir = "/tmp";
# endif /* __APPLE__ */
tmpdir = "/tmp";
#endif /* __APPLE__ */
DEBUG_printf(("2cupsGetPPD3: tmpdir=\"%s\".", tmpdir));
/*
* Make the temporary name using the specified directory...
@@ -254,12 +280,16 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
if (!symlink(ppdname, buffer))
break;
DEBUG_printf(("2cupsGetPPD3: Symlink \"%s\" to \"%s\" failed: %s", ppdname, buffer, strerror(errno)));
tries ++;
}
while (tries < 1000);
if (tries >= 1000)
{
DEBUG_puts("2cupsGetPPD3: Unable to symlink after 1000 tries, returning error.");
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
return (HTTP_STATUS_SERVER_ERROR);
@@ -267,9 +297,13 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
}
if (*modtime >= ppdinfo.st_mtime)
{
DEBUG_printf(("2cupsGetPPD3: Returning not-modified, filename=\"%s\".", buffer));
return (HTTP_STATUS_NOT_MODIFIED);
}
else
{
DEBUG_printf(("2cupsGetPPD3: Returning ok, filename=\"%s\", modtime=%ld.", buffer, (long)ppdinfo.st_mtime));
*modtime = ppdinfo.st_mtime;
return (HTTP_STATUS_OK);
}
@@ -281,16 +315,24 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
* Try finding a printer URI for this printer...
*/
DEBUG_puts("2cupsGetPPD3: Unable to access local file, copying...");
if (!http)
{
if ((http = _cupsConnect()) == NULL)
{
DEBUG_puts("2cupsGetPPD3: Unable to connect to scheduler.");
return (HTTP_STATUS_SERVICE_UNAVAILABLE);
}
}
if (!cups_get_printer_uri(http, name, hostname, sizeof(hostname), &port,
resource, sizeof(resource), 0))
if (!cups_get_printer_uri(http, name, hostname, sizeof(hostname), &port, resource, sizeof(resource), 0))
{
DEBUG_puts("2cupsGetPPD3: Unable to get printer URI.");
return (HTTP_STATUS_NOT_FOUND);
}
DEBUG_printf(("2cupsGetPPD3: Printer hostname=\"%s\", port=%d", hostname,
port));
DEBUG_printf(("2cupsGetPPD3: Printer hostname=\"%s\", port=%d", hostname, port));
if (cupsServer()[0] == '/' && !_cups_strcasecmp(hostname, "localhost") && port == ippPort())
{
@@ -334,7 +376,7 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
else if ((http2 = httpConnect2(hostname, port, NULL, AF_UNSPEC,
cupsEncryption(), 1, 30000, NULL)) == NULL)
{
DEBUG_puts("1cupsGetPPD3: Unable to connect to server");
DEBUG_puts("2cupsGetPPD3: Unable to connect to server");
return (HTTP_STATUS_SERVICE_UNAVAILABLE);
}
@@ -406,7 +448,7 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
* Return the PPD file...
*/
DEBUG_printf(("1cupsGetPPD3: Returning status %d", status));
DEBUG_printf(("2cupsGetPPD3: Returning status %d", status));
return (status);
}
@@ -506,23 +548,16 @@ cups_get_printer_uri(
int depth) /* I - Depth of query */
{
int i; /* Looping var */
int http_port; /* Port number */
http_t *http2; /* Alternate HTTP connection */
ipp_t *request, /* IPP request */
*response; /* IPP response */
ipp_attribute_t *attr; /* Current attribute */
char uri[HTTP_MAX_URI], /* printer-uri attribute */
scheme[HTTP_MAX_URI], /* Scheme name */
username[HTTP_MAX_URI], /* Username:password */
classname[255], /* Temporary class name */
http_hostname[HTTP_MAX_HOST];
/* Hostname associated with connection */
username[HTTP_MAX_URI]; /* Username:password */
static const char * const requested_attrs[] =
{ /* Requested attributes */
"device-uri",
"member-uris",
"printer-uri-supported",
"printer-type"
"printer-uri-supported"
};
@@ -544,15 +579,6 @@ cups_get_printer_uri(
DEBUG_printf(("5cups_get_printer_uri: printer-uri=\"%s\"", uri));
/*
* Get the hostname and port number we are connected to...
*/
httpGetHostname(http, http_hostname, sizeof(http_hostname));
http_port = httpAddrPort(http->hostaddr);
DEBUG_printf(("5cups_get_printer_uri: http_hostname=\"%s\"", http_hostname));
/*
* Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following
* attributes:
@@ -577,31 +603,7 @@ cups_get_printer_uri(
if ((response = cupsDoRequest(http, request, resource)) != NULL)
{
const char *device_uri = NULL; /* device-uri value */
if ((attr = ippFindAttribute(response, "device-uri", IPP_TAG_URI)) != NULL)
{
device_uri = attr->values[0].string.text;
DEBUG_printf(("5cups_get_printer_uri: device-uri=\"%s\"", device_uri));
}
if (device_uri &&
(((!strncmp(device_uri, "ipp://", 6) || !strncmp(device_uri, "ipps://", 7)) &&
(strstr(device_uri, "/printers/") != NULL || strstr(device_uri, "/classes/") != NULL)) ||
((strstr(device_uri, "._ipp.") != NULL || strstr(device_uri, "._ipps.") != NULL) &&
!strcmp(device_uri + strlen(device_uri) - 5, "/cups"))))
{
/*
* Statically-configured shared printer.
*/
httpSeparateURI(HTTP_URI_CODING_ALL, _httpResolveURI(device_uri, uri, sizeof(uri), _HTTP_RESOLVE_DEFAULT, NULL, NULL), scheme, sizeof(scheme), username, sizeof(username), host, hostsize, port, resource, resourcesize);
ippDelete(response);
DEBUG_printf(("5cups_get_printer_uri: Resolved to host=\"%s\", port=%d, resource=\"%s\"", host, *port, resource));
return (1);
}
else if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL)
if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL)
{
/*
* Get the first actual printer name in the class...
@@ -626,55 +628,6 @@ cups_get_printer_uri(
return (1);
}
}
/*
* No printers in this class - try recursively looking for a printer,
* but not more than 3 levels deep...
*/
if (depth < 3)
{
for (i = 0; i < attr->num_values; i ++)
{
httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[i].string.text,
scheme, sizeof(scheme), username, sizeof(username),
host, hostsize, port, resource, resourcesize);
if (!strncmp(resource, "/classes/", 9))
{
/*
* Found a class! Connect to the right server...
*/
if (!_cups_strcasecmp(http_hostname, host) && *port == http_port)
http2 = http;
else if ((http2 = httpConnect2(host, *port, NULL, AF_UNSPEC, cupsEncryption(), 1, 30000, NULL)) == NULL)
{
DEBUG_puts("8cups_get_printer_uri: Unable to connect to server");
continue;
}
/*
* Look up printers on that server...
*/
strlcpy(classname, resource + 9, sizeof(classname));
cups_get_printer_uri(http2, classname, host, hostsize, port,
resource, resourcesize, depth + 1);
/*
* Close the connection as needed...
*/
if (http2 != http)
httpClose(http2);
if (*host)
return (1);
}
}
}
}
else if ((attr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL)
{
+74 -85
Ver Arquivo
@@ -1,12 +1,11 @@
/*
* PostScript Printer Description definitions for CUPS.
*
* THESE APIS ARE DEPRECATED. TO COMPILE WITHOUT WARNINGS ADD
* -D_PPD_DEPRECATED="" TO YOUR COMPILE OPTIONS. THIS HEADER AND THESE
* FUNCTIONS WILL BE REMOVED IN A FUTURE RELEASE OF CUPS.
* THESE APIS ARE DEPRECATED. THIS HEADER AND THESE FUNCTIONS WILL BE REMOVED
* IN A FUTURE RELEASE OF CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
@@ -37,16 +36,6 @@ extern "C" {
# endif /* __cplusplus */
/*
* Define _PPD_DEPRECATED to silence the warnings about PPD functions being
* deprecated...
*/
# ifndef _PPD_DEPRECATED
# define _PPD_DEPRECATED _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.")
# endif /* !_PPD_DEPRECATED */
/*
* PPD version...
*/
@@ -67,14 +56,14 @@ extern "C" {
* Types and structures...
*/
typedef enum ppd_ui_e /**** UI Types ****/
typedef enum ppd_ui_e /**** UI Types @deprecated@ ****/
{
PPD_UI_BOOLEAN, /* True or False option */
PPD_UI_PICKONE, /* Pick one from a list */
PPD_UI_PICKMANY /* Pick zero or more from a list */
} ppd_ui_t;
typedef enum ppd_section_e /**** Order dependency sections ****/
typedef enum ppd_section_e /**** Order dependency sections @deprecated@ ****/
{
PPD_ORDER_ANY, /* Option code can be anywhere in the file */
PPD_ORDER_DOCUMENT, /* ... must be in the DocumentSetup section */
@@ -84,7 +73,7 @@ typedef enum ppd_section_e /**** Order dependency sections ****/
PPD_ORDER_PROLOG /* ... must be in the Prolog section */
} ppd_section_t;
typedef enum ppd_cs_e /**** Colorspaces ****/
typedef enum ppd_cs_e /**** Colorspaces @deprecated@ ****/
{
PPD_CS_CMYK = -4, /* CMYK colorspace */
PPD_CS_CMY, /* CMY colorspace */
@@ -94,7 +83,7 @@ typedef enum ppd_cs_e /**** Colorspaces ****/
PPD_CS_N /* DeviceN colorspace */
} ppd_cs_t;
typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19/macOS 10.3@ ****/
typedef enum ppd_status_e /**** Status Codes @deprecated@ ****/
{
PPD_OK = 0, /* OK */
PPD_FILE_OPEN_ERROR, /* Unable to open PPD file */
@@ -123,16 +112,16 @@ typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19/macOS 10.3@ ***
PPD_MAX_STATUS /* @private@ */
} ppd_status_t;
enum ppd_conform_e /**** Conformance Levels @since CUPS 1.1.19/macOS 10.3@ ****/
enum ppd_conform_e /**** Conformance Levels @deprecated@ ****/
{
PPD_CONFORM_RELAXED, /* Relax whitespace and control char */
PPD_CONFORM_STRICT /* Require strict conformance */
};
typedef enum ppd_conform_e ppd_conform_t;
/**** Conformance Levels @since CUPS 1.1.19/macOS 10.3@ ****/
/**** Conformance Levels @deprecated@ ****/
typedef struct ppd_attr_s /**** PPD Attribute Structure @since CUPS 1.1.19/macOS 10.3@ ****/
typedef struct ppd_attr_s /**** PPD Attribute Structure @deprecated@ ****/
{
char name[PPD_MAX_NAME]; /* Name of attribute (cupsXYZ) */
char spec[PPD_MAX_NAME]; /* Specifier string, if any */
@@ -141,9 +130,9 @@ typedef struct ppd_attr_s /**** PPD Attribute Structure @since CUPS 1.1.19/macO
} ppd_attr_t;
typedef struct ppd_option_s ppd_option_t;
/**** Options ****/
/**** Options @deprecated@ ****/
typedef struct ppd_choice_s /**** Option choices ****/
typedef struct ppd_choice_s /**** Option choices @deprecated@ ****/
{
char marked; /* 0 if not selected, 1 otherwise */
char choice[PPD_MAX_NAME]; /* Computer-readable option name */
@@ -152,7 +141,7 @@ typedef struct ppd_choice_s /**** Option choices ****/
ppd_option_t *option; /* Pointer to parent option structure */
} ppd_choice_t;
struct ppd_option_s /**** Options ****/
struct ppd_option_s /**** Options @deprecated@ ****/
{
char conflicted; /* 0 if no conflicts exist, 1 otherwise */
char keyword[PPD_MAX_NAME]; /* Option keyword name ("PageSize", etc.) */
@@ -165,7 +154,7 @@ struct ppd_option_s /**** Options ****/
ppd_choice_t *choices; /* Option choices */
};
typedef struct ppd_group_s /**** Groups ****/
typedef struct ppd_group_s /**** Groups @deprecated@ ****/
{
/**** Group text strings are limited to 39 chars + nul in order to
**** preserve binary compatibility and allow applications to get
@@ -180,7 +169,7 @@ typedef struct ppd_group_s /**** Groups ****/
struct ppd_group_s *subgroups; /* Sub-groups (max depth = 1) */
} ppd_group_t;
typedef struct ppd_const_s /**** Constraints ****/
typedef struct ppd_const_s /**** Constraints @deprecated@ ****/
{
char option1[PPD_MAX_NAME]; /* First keyword */
char choice1[PPD_MAX_NAME]; /* First option/choice (blank for all) */
@@ -188,7 +177,7 @@ typedef struct ppd_const_s /**** Constraints ****/
char choice2[PPD_MAX_NAME]; /* Second option/choice (blank for all) */
} ppd_const_t;
typedef struct ppd_size_s /**** Page Sizes ****/
typedef struct ppd_size_s /**** Page Sizes @deprecated@ ****/
{
int marked; /* Page size selected? */
char name[PPD_MAX_NAME]; /* Media size option */
@@ -200,14 +189,14 @@ typedef struct ppd_size_s /**** Page Sizes ****/
float top; /* Top printable margin in points */
} ppd_size_t;
typedef struct ppd_emul_s /**** Emulators ****/
typedef struct ppd_emul_s /**** Emulators @deprecated@ ****/
{
char name[PPD_MAX_NAME]; /* Emulator name */
char *start; /* Code to switch to this emulation */
char *stop; /* Code to stop this emulation */
} ppd_emul_t;
typedef struct ppd_profile_s /**** sRGB Color Profiles ****/
typedef struct ppd_profile_s /**** sRGB Color Profiles @deprecated@ ****/
{
char resolution[PPD_MAX_NAME];
/* Resolution or "-" */
@@ -219,7 +208,7 @@ typedef struct ppd_profile_s /**** sRGB Color Profiles ****/
} ppd_profile_t;
/**** New in CUPS 1.2/macOS 10.5 ****/
typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2/macOS 10.5@ ****/
typedef enum ppd_cptype_e /**** Custom Parameter Type @deprecated@ ****/
{
PPD_CUSTOM_CURVE, /* Curve value for f(x) = x^value */
PPD_CUSTOM_INT, /* Integer number value */
@@ -231,7 +220,7 @@ typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2/macOS 10.
PPD_CUSTOM_STRING /* String of characters */
} ppd_cptype_t;
typedef union ppd_cplimit_u /**** Custom Parameter Limit @since CUPS 1.2/macOS 10.5@ ****/
typedef union ppd_cplimit_u /**** Custom Parameter Limit @deprecated@ ****/
{
float custom_curve; /* Gamma value */
int custom_int; /* Integer value */
@@ -243,7 +232,7 @@ typedef union ppd_cplimit_u /**** Custom Parameter Limit @since CUPS 1.2/macOS
int custom_string; /* String length */
} ppd_cplimit_t;
typedef union ppd_cpvalue_u /**** Custom Parameter Value @since CUPS 1.2/macOS 10.5@ ****/
typedef union ppd_cpvalue_u /**** Custom Parameter Value @deprecated@ ****/
{
float custom_curve; /* Gamma value */
int custom_int; /* Integer value */
@@ -255,7 +244,7 @@ typedef union ppd_cpvalue_u /**** Custom Parameter Value @since CUPS 1.2/macOS
char *custom_string; /* String value */
} ppd_cpvalue_t;
typedef struct ppd_cparam_s /**** Custom Parameter @since CUPS 1.2/macOS 10.5@ ****/
typedef struct ppd_cparam_s /**** Custom Parameter @deprecated@ ****/
{
char name[PPD_MAX_NAME]; /* Parameter name */
char text[PPD_MAX_TEXT]; /* Human-readable text */
@@ -266,7 +255,7 @@ typedef struct ppd_cparam_s /**** Custom Parameter @since CUPS 1.2/macOS 10.5@
ppd_cpvalue_t current; /* Current value */
} ppd_cparam_t;
typedef struct ppd_coption_s /**** Custom Option @since CUPS 1.2/macOS 10.5@ ****/
typedef struct ppd_coption_s /**** Custom Option @deprecated@ ****/
{
char keyword[PPD_MAX_NAME]; /* Name of option that is being extended... */
ppd_option_t *option; /* Option that is being extended... */
@@ -275,9 +264,9 @@ typedef struct ppd_coption_s /**** Custom Option @since CUPS 1.2/macOS 10.5@ **
} ppd_coption_t;
typedef struct _ppd_cache_s _ppd_cache_t;
/**** PPD cache and mapping data @since CUPS 1.5/macOS 10.7@ @private@ ****/
/**** PPD cache and mapping data @deprecated@ ****/
typedef struct ppd_file_s /**** PPD File ****/
typedef struct ppd_file_s /**** PPD File @deprecated@ ****/
{
int language_level; /* Language level of device */
int color_device; /* 1 = color device, 0 = grayscale */
@@ -349,115 +338,115 @@ typedef struct ppd_file_s /**** PPD File ****/
* Prototypes...
*/
extern const char *cupsGetPPD(const char *name) _PPD_DEPRECATED;
extern const char *cupsGetPPD2(http_t *http, const char *name) _PPD_DEPRECATED;
extern http_status_t cupsGetPPD3(http_t *http, const char *name, time_t *modtime, char *buffer, size_t bufsize) _PPD_DEPRECATED;
extern char *cupsGetServerPPD(http_t *http, const char *name) _PPD_DEPRECATED;
extern int cupsMarkOptions(ppd_file_t *ppd, int num_options, cups_option_t *options) _PPD_DEPRECATED;
extern const char *cupsGetPPD(const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern const char *cupsGetPPD2(http_t *http, const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern http_status_t cupsGetPPD3(http_t *http, const char *name, time_t *modtime, char *buffer, size_t bufsize) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern char *cupsGetServerPPD(http_t *http, const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int cupsMarkOptions(ppd_file_t *ppd, int num_options, cups_option_t *options) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern void ppdClose(ppd_file_t *ppd) _PPD_DEPRECATED;
extern void ppdClose(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdCollect(ppd_file_t *ppd, ppd_section_t section,
ppd_choice_t ***choices) _PPD_DEPRECATED;
extern int ppdConflicts(ppd_file_t *ppd) _PPD_DEPRECATED;
ppd_choice_t ***choices) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdConflicts(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdEmit(ppd_file_t *ppd, FILE *fp,
ppd_section_t section) _PPD_DEPRECATED;
ppd_section_t section) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdEmitFd(ppd_file_t *ppd, int fd,
ppd_section_t section) _PPD_DEPRECATED;
ppd_section_t section) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdEmitJCL(ppd_file_t *ppd, FILE *fp, int job_id,
const char *user, const char *title)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_choice_t *ppdFindChoice(ppd_option_t *o, const char *option)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd,
const char *keyword)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_option_t *ppdFindOption(ppd_file_t *ppd, const char *keyword)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdIsMarked(ppd_file_t *ppd, const char *keyword,
const char *option) _PPD_DEPRECATED;
extern void ppdMarkDefaults(ppd_file_t *ppd) _PPD_DEPRECATED;
const char *option) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern void ppdMarkDefaults(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdMarkOption(ppd_file_t *ppd, const char *keyword,
const char *option) _PPD_DEPRECATED;
extern ppd_file_t *ppdOpen(FILE *fp) _PPD_DEPRECATED;
extern ppd_file_t *ppdOpenFd(int fd) _PPD_DEPRECATED;
extern ppd_file_t *ppdOpenFile(const char *filename) _PPD_DEPRECATED;
const char *option) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_file_t *ppdOpen(FILE *fp) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_file_t *ppdOpenFd(int fd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_file_t *ppdOpenFile(const char *filename) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern float ppdPageLength(ppd_file_t *ppd, const char *name)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_size_t *ppdPageSize(ppd_file_t *ppd, const char *name)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern float ppdPageWidth(ppd_file_t *ppd, const char *name)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
/**** New in CUPS 1.1.19 ****/
extern const char *ppdErrorString(ppd_status_t status) _PPD_DEPRECATED;
extern const char *ppdErrorString(ppd_status_t status) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_attr_t *ppdFindAttr(ppd_file_t *ppd, const char *name,
const char *spec) _PPD_DEPRECATED;
const char *spec) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_attr_t *ppdFindNextAttr(ppd_file_t *ppd, const char *name,
const char *spec) _PPD_DEPRECATED;
extern ppd_status_t ppdLastError(int *line) _PPD_DEPRECATED;
const char *spec) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_status_t ppdLastError(int *line) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
/**** New in CUPS 1.1.20 ****/
extern void ppdSetConformance(ppd_conform_t c) _PPD_DEPRECATED;
extern void ppdSetConformance(ppd_conform_t c) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
/**** New in CUPS 1.2 ****/
extern int cupsRasterInterpretPPD(cups_page_header2_t *h,
ppd_file_t *ppd,
int num_options,
cups_option_t *options,
cups_interpret_cb_t func) _PPD_DEPRECATED;
cups_interpret_cb_t func) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdCollect2(ppd_file_t *ppd, ppd_section_t section,
float min_order, ppd_choice_t ***choices)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdEmitAfterOrder(ppd_file_t *ppd, FILE *fp,
ppd_section_t section, int limit,
float min_order) _PPD_DEPRECATED;
float min_order) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern char *ppdEmitString(ppd_file_t *ppd, ppd_section_t section,
float min_order) _PPD_DEPRECATED;
float min_order) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_coption_t *ppdFindCustomOption(ppd_file_t *ppd,
const char *keyword)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_cparam_t *ppdFindCustomParam(ppd_coption_t *opt,
const char *name) _PPD_DEPRECATED;
const char *name) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_cparam_t *ppdFirstCustomParam(ppd_coption_t *opt)
_PPD_DEPRECATED;
extern ppd_option_t *ppdFirstOption(ppd_file_t *ppd) _PPD_DEPRECATED;
extern ppd_cparam_t *ppdNextCustomParam(ppd_coption_t *opt) _PPD_DEPRECATED;
extern ppd_option_t *ppdNextOption(ppd_file_t *ppd) _PPD_DEPRECATED;
extern int ppdLocalize(ppd_file_t *ppd) _PPD_DEPRECATED;
extern ppd_file_t *ppdOpen2(cups_file_t *fp) _PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_option_t *ppdFirstOption(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_cparam_t *ppdNextCustomParam(ppd_coption_t *opt) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_option_t *ppdNextOption(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdLocalize(ppd_file_t *ppd) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_file_t *ppdOpen2(cups_file_t *fp) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
/**** New in CUPS 1.3/macOS 10.5 ****/
extern const char *ppdLocalizeIPPReason(ppd_file_t *ppd,
const char *reason,
const char *scheme,
char *buffer,
size_t bufsize) _PPD_DEPRECATED;
size_t bufsize) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
/**** New in CUPS 1.4/macOS 10.6 ****/
extern int cupsGetConflicts(ppd_file_t *ppd, const char *option,
const char *choice,
cups_option_t **options)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int cupsResolveConflicts(ppd_file_t *ppd,
const char *option,
const char *choice,
int *num_options,
cups_option_t **options)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdInstallableConflict(ppd_file_t *ppd,
const char *option,
const char *choice)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern ppd_attr_t *ppdLocalizeAttr(ppd_file_t *ppd, const char *keyword,
const char *spec) _PPD_DEPRECATED;
const char *spec) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern const char *ppdLocalizeMarkerName(ppd_file_t *ppd,
const char *name)
_PPD_DEPRECATED;
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
extern int ppdPageSizeLimits(ppd_file_t *ppd,
ppd_size_t *minimum,
ppd_size_t *maximum) _PPD_DEPRECATED;
ppd_size_t *maximum) _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.");
/*
+235 -40
Ver Arquivo
@@ -1,12 +1,13 @@
/*
* Raster file routines for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* This file is part of the CUPS Imaging library.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -44,11 +45,96 @@ struct _cups_raster_s /**** Raster stream data ****/
*bufend; /* End of current (read) buffer */
size_t bufsize; /* Buffer size */
#ifdef DEBUG
size_t iocount; /* Number of bytes read/written */
size_t iostart, /* Start of read/write buffer */
iocount; /* Number of bytes read/written */
#endif /* DEBUG */
unsigned apple_page_count;/* Apple raster page count */
};
typedef void (*_cups_copyfunc_t)(void *dst, const void *src, size_t bytes);
/*
* Local globals...
*/
#ifdef DEBUG
static const char * const cups_color_spaces[] =
{ /* Color spaces */
"CUPS_CSPACE_W",
"CUPS_CSPACE_RGB",
"CUPS_CSPACE_RGBA",
"CUPS_CSPACE_K",
"CUPS_CSPACE_CMY",
"CUPS_CSPACE_YMC",
"CUPS_CSPACE_CMYK",
"CUPS_CSPACE_YMCK",
"CUPS_CSPACE_KCMY",
"CUPS_CSPACE_KCMYcm",
"CUPS_CSPACE_GMCK",
"CUPS_CSPACE_GMCS",
"CUPS_CSPACE_WHITE",
"CUPS_CSPACE_GOLD",
"CUPS_CSPACE_SILVER",
"CUPS_CSPACE_CIEXYZ",
"CUPS_CSPACE_CIELab",
"CUPS_CSPACE_RGBW",
"CUPS_CSPACE_SW",
"CUPS_CSPACE_SRGB",
"CUPS_CSPACE_ADOBERGB",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
"CUPS_CSPACE_ICC1",
"CUPS_CSPACE_ICC2",
"CUPS_CSPACE_ICC3",
"CUPS_CSPACE_ICC4",
"CUPS_CSPACE_ICC5",
"CUPS_CSPACE_ICC6",
"CUPS_CSPACE_ICC7",
"CUPS_CSPACE_ICC8",
"CUPS_CSPACE_ICC9",
"CUPS_CSPACE_ICCA",
"CUPS_CSPACE_ICCB",
"CUPS_CSPACE_ICCC",
"CUPS_CSPACE_ICCD",
"CUPS_CSPACE_ICCE",
"CUPS_CSPACE_ICCF",
"47",
"CUPS_CSPACE_DEVICE1",
"CUPS_CSPACE_DEVICE2",
"CUPS_CSPACE_DEVICE3",
"CUPS_CSPACE_DEVICE4",
"CUPS_CSPACE_DEVICE5",
"CUPS_CSPACE_DEVICE6",
"CUPS_CSPACE_DEVICE7",
"CUPS_CSPACE_DEVICE8",
"CUPS_CSPACE_DEVICE9",
"CUPS_CSPACE_DEVICEA",
"CUPS_CSPACE_DEVICEB",
"CUPS_CSPACE_DEVICEC",
"CUPS_CSPACE_DEVICED",
"CUPS_CSPACE_DEVICEE",
"CUPS_CSPACE_DEVICEF"
};
static const char * const cups_modes[] =
{ /* Open modes */
"CUPS_RASTER_READ",
"CUPS_RASTER_WRITE",
"CUPS_RASTER_WRITE_COMPRESSED",
"CUPS_RASTER_WRITE_PWG",
"CUPS_RASTER_WRITE_APPLE"
};
#endif /* DEBUG */
/*
* Local functions...
@@ -56,13 +142,12 @@ struct _cups_raster_s /**** Raster stream data ****/
static ssize_t cups_raster_io(cups_raster_t *r, unsigned char *buf, size_t bytes);
static unsigned cups_raster_read_header(cups_raster_t *r);
static ssize_t cups_raster_read(cups_raster_t *r, unsigned char *buf,
size_t bytes);
static ssize_t cups_raster_read(cups_raster_t *r, unsigned char *buf, size_t bytes);
static int cups_raster_update(cups_raster_t *r);
static ssize_t cups_raster_write(cups_raster_t *r,
const unsigned char *pixels);
static ssize_t cups_raster_write(cups_raster_t *r, const unsigned char *pixels);
static ssize_t cups_read_fd(void *ctx, unsigned char *buf, size_t bytes);
static void cups_swap(unsigned char *buf, size_t bytes);
static void cups_swap_copy(unsigned char *dst, const unsigned char *src, size_t bytes);
static ssize_t cups_write_fd(void *ctx, unsigned char *buf, size_t bytes);
@@ -350,6 +435,8 @@ cupsRasterOpen(int fd, /* I - File descriptor */
@code CUPS_RASTER_WRITE_COMPRESSED@,
or @code CUPS_RASTER_WRITE_PWG@ */
{
DEBUG_printf(("cupsRasterOpen(fd=%d, mode=%s)", fd, cups_modes[mode]));
if (mode == CUPS_RASTER_READ)
return (cupsRasterOpenIO(cups_read_fd, (void *)((intptr_t)fd), mode));
else
@@ -381,12 +468,15 @@ cupsRasterOpenIO(
cups_raster_t *r; /* New stream */
DEBUG_printf(("cupsRasterOpenIO(iocb=%p, ctx=%p, mode=%s)", (void *)iocb, ctx, cups_modes[mode]));
_cupsRasterClearError();
if ((r = calloc(sizeof(cups_raster_t), 1)) == NULL)
{
_cupsRasterAddError("Unable to allocate memory for raster stream: %s\n",
strerror(errno));
DEBUG_puts("1cupsRasterOpenIO: Returning NULL.");
return (NULL);
}
@@ -406,6 +496,7 @@ cupsRasterOpenIO(
_cupsRasterAddError("Unable to read header from raster stream: %s\n",
strerror(errno));
free(r);
DEBUG_puts("1cupsRasterOpenIO: Unable to read header, returning NULL.");
return (NULL);
}
@@ -420,6 +511,7 @@ cupsRasterOpenIO(
{
_cupsRasterAddError("Unknown raster format %08x!\n", r->sync);
free(r);
DEBUG_puts("1cupsRasterOpenIO: Unknown format, returning NULL.");
return (NULL);
}
@@ -429,6 +521,8 @@ cupsRasterOpenIO(
r->sync == CUPS_RASTER_REVSYNCapple)
r->compressed = 1;
DEBUG_printf(("1cupsRasterOpenIO: sync=%08x", r->sync));
if (r->sync == CUPS_RASTER_REVSYNC ||
r->sync == CUPS_RASTER_REVSYNCv1 ||
r->sync == CUPS_RASTER_REVSYNCv2 ||
@@ -446,12 +540,14 @@ cupsRasterOpenIO(
_cupsRasterAddError("Unable to read header from raster stream: %s\n",
strerror(errno));
free(r);
DEBUG_puts("1cupsRasterOpenIO: Unable to read header, returning NULL.");
return (NULL);
}
}
DEBUG_printf(("1cupsRasterOpenIO: r->swapped=%d, r->sync=%08x\n", r->swapped, r->sync));
#ifdef DEBUG
r->iostart = r->iocount;
#endif /* DEBUG */
}
else
{
@@ -490,10 +586,13 @@ cupsRasterOpenIO(
_cupsRasterAddError("Unable to write raster stream header: %s\n",
strerror(errno));
free(r);
DEBUG_puts("1cupsRasterOpenIO: Unable to write header, returning NULL.");
return (NULL);
}
}
DEBUG_printf(("1cupsRasterOpenIO: compressed=%d, swapped=%d, returning %p", r->compressed, r->swapped, (void *)r));
return (r);
}
@@ -516,6 +615,8 @@ cupsRasterReadHeader(
cups_raster_t *r, /* I - Raster stream */
cups_page_header_t *h) /* I - Pointer to header data */
{
DEBUG_printf(("cupsRasterReadHeader(r=%p, h=%p)", (void *)r, (void *)h));
/*
* Get the raster header...
*/
@@ -523,6 +624,7 @@ cupsRasterReadHeader(
if (!cups_raster_read_header(r))
{
memset(h, 0, sizeof(cups_page_header_t));
DEBUG_puts("1cupsRasterReadHeader: Unable to read page header, returning 0.");
return (0);
}
@@ -532,6 +634,14 @@ cupsRasterReadHeader(
memcpy(h, &(r->header), sizeof(cups_page_header_t));
DEBUG_printf(("1cupsRasterReadHeader: cupsColorSpace=%s", cups_color_spaces[h->cupsColorSpace]));
DEBUG_printf(("1cupsRasterReadHeader: cupsBitsPerColor=%u", h->cupsBitsPerColor));
DEBUG_printf(("1cupsRasterReadHeader: cupsBitsPerPixel=%u", h->cupsBitsPerPixel));
DEBUG_printf(("1cupsRasterReadHeader: cupsBytesPerLine=%u", h->cupsBytesPerLine));
DEBUG_printf(("1cupsRasterReadHeader: cupsWidth=%u", h->cupsWidth));
DEBUG_printf(("1cupsRasterReadHeader: cupsHeight=%u", h->cupsHeight));
DEBUG_puts("1cupsRasterReadHeader: Returning 1.");
return (1);
}
@@ -557,6 +667,7 @@ cupsRasterReadHeader2(
if (!cups_raster_read_header(r))
{
memset(h, 0, sizeof(cups_page_header2_t));
DEBUG_puts("1cupsRasterReadHeader2: Unable to read header, returning 0.");
return (0);
}
@@ -566,6 +677,14 @@ cupsRasterReadHeader2(
memcpy(h, &(r->header), sizeof(cups_page_header2_t));
DEBUG_printf(("1cupsRasterReadHeader2: cupsColorSpace=%s", cups_color_spaces[h->cupsColorSpace]));
DEBUG_printf(("1cupsRasterReadHeader2: cupsBitsPerColor=%u", h->cupsBitsPerColor));
DEBUG_printf(("1cupsRasterReadHeader2: cupsBitsPerPixel=%u", h->cupsBitsPerPixel));
DEBUG_printf(("1cupsRasterReadHeader2: cupsBytesPerLine=%u", h->cupsBytesPerLine));
DEBUG_printf(("1cupsRasterReadHeader2: cupsWidth=%u", h->cupsWidth));
DEBUG_printf(("1cupsRasterReadHeader2: cupsHeight=%u", h->cupsHeight));
DEBUG_puts("1cupsRasterReadHeader2: Returning 1.");
return (1);
}
@@ -771,7 +890,10 @@ cupsRasterReadPixels(cups_raster_t *r, /* I - Raster stream */
r->header.cupsBitsPerPixel == 12 ||
r->header.cupsBitsPerPixel == 16) &&
r->swapped)
cups_swap(ptr, (size_t)bytes);
{
DEBUG_puts("1cupsRasterReadPixels: Swapping bytes.");
cups_swap(ptr, (size_t)cupsBytesPerLine);
}
/*
* Update pointers...
@@ -841,8 +963,20 @@ cupsRasterWriteHeader(
cups_raster_t *r, /* I - Raster stream */
cups_page_header_t *h) /* I - Raster page header */
{
DEBUG_printf(("cupsRasterWriteHeader(r=%p, h=%p)", (void *)r, (void *)h));
if (r == NULL || r->mode == CUPS_RASTER_READ)
{
DEBUG_puts("1cupsRasterWriteHeader: Returning 0.");
return (0);
}
DEBUG_printf(("1cupsRasterWriteHeader: cupsColorSpace=%s", cups_color_spaces[h->cupsColorSpace]));
DEBUG_printf(("1cupsRasterWriteHeader: cupsBitsPerColor=%u", h->cupsBitsPerColor));
DEBUG_printf(("1cupsRasterWriteHeader: cupsBitsPerPixel=%u", h->cupsBitsPerPixel));
DEBUG_printf(("1cupsRasterWriteHeader: cupsBytesPerLine=%u", h->cupsBytesPerLine));
DEBUG_printf(("1cupsRasterWriteHeader: cupsWidth=%u", h->cupsWidth));
DEBUG_printf(("1cupsRasterWriteHeader: cupsHeight=%u", h->cupsHeight));
/*
* Make a copy of the header, and compute the number of raster
@@ -853,7 +987,20 @@ cupsRasterWriteHeader(
memcpy(&(r->header), h, sizeof(cups_page_header_t));
if (!cups_raster_update(r))
{
DEBUG_puts("1cupsRasterWriteHeader: Unable to update parameters, returning 0.");
return (0);
}
if (r->mode == CUPS_RASTER_WRITE_APPLE)
{
r->rowheight = h->HWResolution[0] / h->HWResolution[1];
if (h->HWResolution[0] != (r->rowheight * h->HWResolution[1]))
return (0);
}
else
r->rowheight = 1;
/*
* Write the raster header...
@@ -1013,8 +1160,20 @@ cupsRasterWriteHeader2(
cups_raster_t *r, /* I - Raster stream */
cups_page_header2_t *h) /* I - Raster page header */
{
DEBUG_printf(("cupsRasterWriteHeader(r=%p, h=%p)", (void *)r, (void *)h));
if (r == NULL || r->mode == CUPS_RASTER_READ)
{
DEBUG_puts("1cupsRasterWriteHeader2: Returning 0.");
return (0);
}
DEBUG_printf(("1cupsRasterWriteHeader2: cupsColorSpace=%s", cups_color_spaces[h->cupsColorSpace]));
DEBUG_printf(("1cupsRasterWriteHeader2: cupsBitsPerColor=%u", h->cupsBitsPerColor));
DEBUG_printf(("1cupsRasterWriteHeader2: cupsBitsPerPixel=%u", h->cupsBitsPerPixel));
DEBUG_printf(("1cupsRasterWriteHeader2: cupsBytesPerLine=%u", h->cupsBytesPerLine));
DEBUG_printf(("1cupsRasterWriteHeader2: cupsWidth=%u", h->cupsWidth));
DEBUG_printf(("1cupsRasterWriteHeader2: cupsHeight=%u", h->cupsHeight));
/*
* Make a copy of the header, and compute the number of raster
@@ -1024,7 +1183,10 @@ cupsRasterWriteHeader2(
memcpy(&(r->header), h, sizeof(cups_page_header2_t));
if (!cups_raster_update(r))
{
DEBUG_puts("1cupsRasterWriteHeader: Unable to update parameters, returning 0.");
return (0);
}
if (r->mode == CUPS_RASTER_WRITE_APPLE)
{
@@ -1196,7 +1358,6 @@ cupsRasterWritePixels(cups_raster_t *r, /* I - Raster stream */
r->header.cupsBitsPerPixel == 16))
{
unsigned char *bufptr; /* Pointer into write buffer */
unsigned count; /* Remaining count */
/*
* Allocate a write buffer as needed...
@@ -1217,21 +1378,10 @@ cupsRasterWritePixels(cups_raster_t *r, /* I - Raster stream */
}
/*
* Byte swap the pixels...
* Byte swap the pixels and write them...
*/
for (bufptr = r->buffer, count = len; count > 1; count -= 2, bufptr += 2)
{
bufptr[1] = *p++;
bufptr[0] = *p++;
}
if (count) /* This should never happen... */
*bufptr = *p;
/*
* Write the byte-swapped buffer...
*/
cups_swap_copy(r->buffer, p, len);
bytes = cups_raster_io(r, r->buffer, len);
}
@@ -1362,7 +1512,7 @@ cups_raster_read_header(
size_t len; /* Length for read/swap */
DEBUG_printf(("3cups_raster_read_header(r=%p), r->mode=%d", (void *)r, r ? r->mode : 0));
DEBUG_printf(("3cups_raster_read_header(r=%p), r->mode=%s", (void *)r, r ? cups_modes[r->mode] : ""));
if (r == NULL || r->mode != CUPS_RASTER_READ)
return (0);
@@ -1517,10 +1667,11 @@ cups_raster_io(cups_raster_t *r, /* I - Raster stream */
DEBUG_printf(("6cups_raster_io: count=%d, total=%d", (int)count, (int)total));
if (count == 0)
{
DEBUG_puts("6cups_raster_io: Returning 0.");
return (0);
}
break;
// {
// DEBUG_puts("6cups_raster_io: Returning 0.");
// return (0);
// }
else if (count < 0)
{
DEBUG_puts("6cups_raster_io: Returning -1 on error.");
@@ -1532,6 +1683,7 @@ cups_raster_io(cups_raster_t *r, /* I - Raster stream */
#endif /* DEBUG */
}
DEBUG_printf(("6cups_raster_io: iocount=" CUPS_LLFMT, CUPS_LLCAST r->iocount));
DEBUG_printf(("6cups_raster_io: Returning " CUPS_LLFMT ".", CUPS_LLCAST total));
return (total);
@@ -1552,7 +1704,7 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
total; /* Total bytes read */
DEBUG_printf(("5cups_raster_read(r=%p, buf=%p, bytes=" CUPS_LLFMT ")", (void *)r, (void *)buf, CUPS_LLCAST bytes));
DEBUG_printf(("4cups_raster_read(r=%p, buf=%p, bytes=" CUPS_LLFMT "), offset=" CUPS_LLFMT, (void *)r, (void *)buf, CUPS_LLCAST bytes, CUPS_LLCAST (r->iostart + r->bufptr - r->buffer)));
if (!r->compressed)
return (cups_raster_io(r, buf, bytes));
@@ -1596,7 +1748,7 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
{
count = (ssize_t)bytes - total;
DEBUG_printf(("6cups_raster_read: count=" CUPS_LLFMT ", remaining=" CUPS_LLFMT ", buf=%p, bufptr=%p, bufend=%p", CUPS_LLCAST count, CUPS_LLCAST remaining, (void *)buf, (void *)r->bufptr, (void *)r->bufend));
DEBUG_printf(("5cups_raster_read: count=" CUPS_LLFMT ", remaining=" CUPS_LLFMT ", buf=%p, bufptr=%p, bufend=%p", CUPS_LLCAST count, CUPS_LLCAST remaining, (void *)buf, (void *)r->bufptr, (void *)r->bufend));
if (remaining == 0)
{
@@ -1606,6 +1758,10 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
* Read into the raster buffer and then copy...
*/
#ifdef DEBUG
r->iostart += (size_t)(r->bufend - r->buffer);
#endif /* DEBUG */
remaining = (*r->iocb)(r->ctx, r->buffer, r->bufsize);
if (remaining <= 0)
return (0);
@@ -1629,6 +1785,7 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
return (0);
#ifdef DEBUG
r->iostart += (size_t)count;
r->iocount += (size_t)count;
#endif /* DEBUG */
@@ -1681,7 +1838,7 @@ cups_raster_read(cups_raster_t *r, /* I - Raster stream */
}
}
DEBUG_printf(("6cups_raster_read: Returning %ld", (long)total));
DEBUG_printf(("5cups_raster_read: Returning %ld", (long)total));
return (total);
}
@@ -1844,11 +2001,24 @@ cups_raster_write(
unsigned char *wptr; /* Pointer into write buffer */
unsigned bpp, /* Bytes per pixel */
count; /* Count */
_cups_copyfunc_t cf; /* Copy function */
DEBUG_printf(("3cups_raster_write(r=%p, pixels=%p)", (void *)r, (void *)pixels));
/*
* Determine whether we need to swap bytes...
*/
if (r->swapped && (r->header.cupsBitsPerColor == 16 || r->header.cupsBitsPerPixel == 12 || r->header.cupsBitsPerPixel == 16))
{
DEBUG_puts("4cups_raster_write: Swapping bytes when writing.");
cf = (_cups_copyfunc_t)cups_swap_copy;
}
else
cf = (_cups_copyfunc_t)memcpy;
/*
* Allocate a write buffer as needed...
*/
@@ -1899,8 +2069,8 @@ cups_raster_write(
*/
*wptr++ = 0;
for (count = bpp; count > 0; count --)
*wptr++ = *start++;
(*cf)(wptr, start, bpp);
wptr += bpp;
}
else if (!memcmp(start, ptr, bpp))
{
@@ -1913,8 +2083,9 @@ cups_raster_write(
break;
*wptr++ = (unsigned char)(count - 1);
for (count = bpp; count > 0; count --)
*wptr++ = *ptr++;
(*cf)(wptr, ptr, bpp);
wptr += bpp;
ptr += bpp;
}
else
{
@@ -1935,7 +2106,7 @@ cups_raster_write(
*wptr++ = (unsigned char)(257 - count);
count *= bpp;
memcpy(wptr, start, count);
(*cf)(wptr, start, count);
wptr += count;
}
}
@@ -1967,11 +2138,11 @@ cups_read_fd(void *ctx, /* I - File descriptor as pointer */
#endif /* WIN32 */
if (errno != EINTR && errno != EAGAIN)
{
DEBUG_printf(("4cups_read_fd: %s", strerror(errno)));
DEBUG_printf(("8cups_read_fd: %s", strerror(errno)));
return (-1);
}
DEBUG_printf(("4cups_read_fd: Returning %d bytes.", (int)count));
DEBUG_printf(("8cups_read_fd: Returning %d bytes.", (int)count));
return (count);
}
@@ -2003,6 +2174,30 @@ cups_swap(unsigned char *buf, /* I - Buffer to swap */
}
/*
* 'cups_swap_copy()' - Copy and swap bytes in raster data...
*/
static void
cups_swap_copy(
unsigned char *dst, /* I - Destination */
const unsigned char *src, /* I - Source */
size_t bytes) /* I - Number of bytes to swap */
{
bytes /= 2;
while (bytes > 0)
{
dst[0] = src[1];
dst[1] = src[0];
dst += 2;
src += 2;
bytes --;
}
}
/*
* 'cups_write_fd()' - Write bytes to a file.
*/
@@ -2024,7 +2219,7 @@ cups_write_fd(void *ctx, /* I - File descriptor pointer */
#endif /* WIN32 */
if (errno != EINTR && errno != EAGAIN)
{
DEBUG_printf(("4cups_write_fd: %s", strerror(errno)));
DEBUG_printf(("8cups_write_fd: %s", strerror(errno)));
return (-1);
}
+3 -3
Ver Arquivo
@@ -1,8 +1,8 @@
/*
* IPP utilities for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
@@ -646,7 +646,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
* Reconnect if the last response had a "Connection: close"...
*/
if (!_cups_strcasecmp(http->fields[HTTP_FIELD_CONNECTION], "close"))
if (!_cups_strcasecmp(httpGetField(http, HTTP_FIELD_CONNECTION), "close"))
{
DEBUG_puts("2cupsSendRequest: Connection: close");
httpClearFields(http);
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* Private SNMP definitions for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2014 by Apple Inc.
* Copyright © 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_SNMP_PRIVATE_H_
+4 -7
Ver Arquivo
@@ -1,14 +1,11 @@
/*
* SNMP functions for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2014 by Apple Inc.
* Copyright © 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
+27 -8
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Temp file utilities for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -36,8 +37,10 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
int fd; /* File descriptor for temp file */
int tries; /* Number of tries */
const char *tmpdir; /* TMPDIR environment var */
#if defined(__APPLE__) || defined(WIN32)
char tmppath[1024]; /* Temporary directory */
#endif /* __APPLE__ || WIN32 */
#ifdef WIN32
char tmppath[1024]; /* Windows temporary directory */
DWORD curtime; /* Current time */
#else
struct timeval curtime; /* Current time */
@@ -54,6 +57,26 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
GetTempPath(sizeof(tmppath), tmppath);
tmpdir = tmppath;
}
#elif defined(__APPLE__)
/*
* On macOS and iOS, the TMPDIR environment variable is not always the best
* location to place temporary files due to sandboxing. Instead, the confstr
* function should be called to get the proper per-user, per-process TMPDIR
* value.
*/
if ((tmpdir = getenv("TMPDIR")) != NULL && access(tmpdir, W_OK))
tmpdir = NULL;
if (!tmpdir)
{
if (confstr(_CS_DARWIN_USER_TEMP_DIR, tmppath, sizeof(tmppath)))
tmpdir = tmppath;
else
tmpdir = "/private/tmp"; /* This should never happen */
}
#else
/*
* Previously we put root temporary files in the default CUPS temporary
@@ -63,11 +86,7 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
*/
if ((tmpdir = getenv("TMPDIR")) == NULL)
# if defined(__APPLE__) && !TARGET_OS_IOS
tmpdir = "/private/tmp"; /* /tmp is a symlink to /private/tmp */
# else
tmpdir = "/tmp";
# endif /* __APPLE__ && !TARGET_OS_IOS */
#endif /* WIN32 */
/*
+7 -15
Ver Arquivo
@@ -1,7 +1,5 @@
*PPD-Adobe: "4.3"
*%
*% "$Id: test.ppd 7819 2008-08-01 00:27:24Z mike $"
*%
*% Test PPD file for CUPS.
*%
*% This file is used to test the CUPS PPD API functions and cannot be
@@ -12,22 +10,19 @@
*% to create your PPD files - not only will it save you time, it produces
*% consistently high-quality files.
*%
*% Copyright 2007-2010 by Apple Inc.
*% Copyright 2002-2006 by Easy Software Products.
*% Copyright (c) 2007-2018 by Apple Inc.
*% Copyright (c) 2002-2006 by Easy Software Products.
*%
*% These coded instructions, statements, and computer programs are the
*% property of Apple Inc. and are protected by Federal copyright
*% law. Distribution and use rights are outlined in the file "LICENSE.txt"
*% which should have been included with this file. If this file is
*% file is missing or damaged, see the license at "http://www.cups.org/".
*% Licensed under Apache License v2.0. See the file "LICENSE" for more
*% information.
*FormatVersion: "4.3"
*FileVersion: "1.3"
*FileVersion: "2.3"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "TEST.PPD"
*Manufacturer: "ESP"
*Manufacturer: "Apple"
*Product: "(Test)"
*cupsVersion: 1.4
*cupsVersion: 2.3
*ModelName: "Test"
*ShortNickName: "Test"
*NickName: "Test for CUPS"
@@ -266,6 +261,3 @@ help:anchor='foo'%20bookID=Vendor%20Help
*Font Times-Roman: Standard "(001.007S)" Standard ROM
*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
*Font ZapfDingbats: Special "(001.004S)" Standard ROM
*%
*% End of "$Id: test.ppd 7819 2008-08-01 00:27:24Z mike $".
*%
+7 -15
Ver Arquivo
@@ -1,7 +1,5 @@
*PPD-Adobe: "4.3"
*%
*% "$Id: test2.ppd 7791 2008-07-24 00:55:30Z mike $"
*%
*% Test PPD file #2 for CUPS.
*%
*% This file is used to test the CUPS PPD API functions and cannot be
@@ -12,22 +10,19 @@
*% to create your PPD files - not only will it save you time, it produces
*% consistently high-quality files.
*%
*% Copyright 2007-2011 by Apple Inc.
*% Copyright 2002-2006 by Easy Software Products.
*% Copyright (c) 2007-2018 by Apple Inc.
*% Copyright (c) 2002-2006 by Easy Software Products.
*%
*% These coded instructions, statements, and computer programs are the
*% property of Apple Inc. and are protected by Federal copyright
*% law. Distribution and use rights are outlined in the file "LICENSE.txt"
*% which should have been included with this file. If this file is
*% file is missing or damaged, see the license at "http://www.cups.org/".
*% Licensed under Apache License v2.0. See the file "LICENSE" for more
*% information.
*FormatVersion: "4.3"
*FileVersion: "1.3"
*FileVersion: "2.3"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "TEST.PPD"
*Manufacturer: "ESP"
*Manufacturer: "Apple"
*Product: "(Test2)"
*cupsVersion: 1.4
*cupsVersion: 2.3
*ModelName: "Test2"
*ShortNickName: "Test2"
*NickName: "Test2 for CUPS"
@@ -247,6 +242,3 @@ help:anchor='foo'%20bookID=Vendor%20Help
*Font Times-Roman: Standard "(001.007S)" Standard ROM
*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
*Font ZapfDingbats: Special "(001.004S)" Standard ROM
*%
*% End of "$Id: test2.ppd 7791 2008-07-24 00:55:30Z mike $".
*%
+1 -2
Ver Arquivo
@@ -228,8 +228,7 @@ main(void)
puts("PASS");
else
{
printf("FAIL (returned %p with %d elements, expected pointer with 4 elements)\n",
dup_array, cupsArrayCount(dup_array));
printf("FAIL (returned %p with %d elements, expected pointer with 4 elements)\n", (void *)dup_array, cupsArrayCount(dup_array));
status ++;
}
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* PPD cache testing program for CUPS.
*
* Copyright 2009-2014 by Apple Inc.
* Copyright 2009-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
@@ -64,7 +64,7 @@ main(int argc, /* I - Number of command-line args */
ppdMarkDefaults(ppd);
cupsMarkOptions(ppd, num_options, options);
num_finishings = _ppdCacheGetFinishingValues(pc, num_options, options, (int)sizeof(finishings) / sizeof(finishings[0]), finishings);
num_finishings = _ppdCacheGetFinishingValues(ppd, pc, (int)sizeof(finishings) / sizeof(finishings[0]), finishings);
if (num_finishings > 0)
{
+8 -2
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* Simulated client test program for CUPS.
*
* Copyright 2017 by Apple Inc.
* Copyright © 2017-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -96,6 +97,9 @@ main(int argc, /* I - Number of command-line arguments */
* Parse command-line options...
*/
if (argc == 1)
return (0);
for (i = 1; i < argc; i ++)
{
if (argv[i][0] == '-')
@@ -617,6 +621,7 @@ make_raster_file(ipp_t *response, /* I - Printer attributes */
if ((fd = cupsTempFd(tempname, (int)tempsize)) < 0)
{
printf("Unable to create temporary print file: %s\n", strerror(errno));
free(line);
return (NULL);
}
@@ -624,6 +629,7 @@ make_raster_file(ipp_t *response, /* I - Printer attributes */
{
printf("Unable to open raster stream: %s\n", cupsRasterErrorString());
close(fd);
free(line);
return (NULL);
}
+23 -4
Ver Arquivo
@@ -1,8 +1,8 @@
/*
* CUPS API test program for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
@@ -12,8 +12,7 @@
*/
#undef _CUPS_NO_DEPRECATED
#include "string-private.h"
#include "cups.h"
#include "cups-private.h"
#include "ppd.h"
#include <stdlib.h>
@@ -35,6 +34,8 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
http_t *http, /* First HTTP connection */
*http2; /* Second HTTP connection */
int status = 0, /* Exit status */
i, /* Looping var */
num_dests; /* Number of destinations */
@@ -264,6 +265,24 @@ main(int argc, /* I - Number of command-line arguments */
return (0);
}
/*
* _cupsConnect() connection reuse...
*/
fputs("_cupsConnect: ", stdout);
http = _cupsConnect();
http2 = _cupsConnect();
if (http == http2)
{
puts("PASS");
}
else
{
puts("FAIL (different connections)");
return (1);
}
/*
* cupsGetDests()
*/
+53 -39
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* CUPS destination API test program for CUPS.
*
* Copyright 2012-2017 by Apple Inc.
* Copyright © 2012-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
@@ -37,17 +37,19 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
int i; /* Looping var */
http_t *http; /* Connection to destination */
cups_dest_t *dest = NULL; /* Destination */
cups_dinfo_t *dinfo; /* Destination info */
unsigned dflags = CUPS_DEST_FLAGS_NONE;
/* Destination flags */
if (argc < 2)
usage(NULL);
return (0);
if (!strcmp(argv[1], "--get"))
{
int i; /* Looping var */
cups_dest_t *dests; /* Destinations */
int num_dests = cupsGetDests2(CUPS_HTTP_DEFAULT, &dests);
/* Number of destinations */
@@ -60,7 +62,6 @@ main(int argc, /* I - Number of command-line arguments */
}
else if (!strcmp(argv[1], "--enum"))
{
int i; /* Looping var */
cups_ptype_t type = 0, /* Printer type filter */
mask = 0; /* Printer type mask */
@@ -110,78 +111,91 @@ main(int argc, /* I - Number of command-line arguments */
return (0);
}
else if (!strncmp(argv[1], "ipp://", 6) || !strncmp(argv[1], "ipps://", 7))
dest = cupsGetDestWithURI(NULL, argv[1]);
else if (!strcmp(argv[1], "default"))
i = 1;
if (!strcmp(argv[i], "--device"))
{
dflags = CUPS_DEST_FLAGS_DEVICE;
i ++;
}
if (!strncmp(argv[i], "ipp://", 6) || !strncmp(argv[i], "ipps://", 7))
dest = cupsGetDestWithURI(NULL, argv[i]);
else if (!strcmp(argv[i], "default"))
{
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL);
if (dest && dest->instance)
printf("default is \"%s/%s\".\n", dest->name, dest->instance);
else
else if (dest)
printf("default is \"%s\".\n", dest->name);
else
puts("no default destination.");
}
else
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, argv[1], NULL);
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, argv[i], NULL);
if (!dest)
{
printf("testdest: Unable to get destination \"%s\": %s\n", argv[1], cupsLastErrorString());
printf("testdest: Unable to get destination \"%s\": %s\n", argv[i], cupsLastErrorString());
return (1);
}
if ((http = cupsConnectDest(dest, CUPS_DEST_FLAGS_NONE, 30000, NULL, NULL, 0, NULL, NULL)) == NULL)
i ++;
if ((http = cupsConnectDest(dest, dflags, 30000, NULL, NULL, 0, NULL, NULL)) == NULL)
{
printf("testdest: Unable to connect to destination \"%s\": %s\n", argv[1], cupsLastErrorString());
printf("testdest: Unable to connect to destination \"%s\": %s\n", dest->name, cupsLastErrorString());
return (1);
}
if ((dinfo = cupsCopyDestInfo(http, dest)) == NULL)
{
printf("testdest: Unable to get information for destination \"%s\": %s\n", argv[1], cupsLastErrorString());
printf("testdest: Unable to get information for destination \"%s\": %s\n", dest->name, cupsLastErrorString());
return (1);
}
if (argc == 2 || (!strcmp(argv[2], "supported") && argc < 6))
if (i == argc || !strcmp(argv[i], "supported"))
{
if (argc > 3)
show_supported(http, dest, dinfo, argv[3], argv[4]);
i ++;
if ((i + 1) < argc)
show_supported(http, dest, dinfo, argv[i], argv[i + 1]);
else if (argc > 2)
show_supported(http, dest, dinfo, argv[3], NULL);
show_supported(http, dest, dinfo, argv[i], NULL);
else
show_supported(http, dest, dinfo, NULL, NULL);
}
else if (!strcmp(argv[2], "conflicts") && argc > 3)
else if (!strcmp(argv[i], "conflicts") && (i + 1) < argc)
{
int i, /* Looping var */
num_options = 0;/* Number of options */
int num_options = 0;/* Number of options */
cups_option_t *options = NULL;/* Options */
for (i = 3; i < argc; i ++)
for (i ++; i < argc; i ++)
num_options = cupsParseOptions(argv[i], num_options, &options);
show_conflicts(http, dest, dinfo, num_options, options);
}
else if (!strcmp(argv[2], "default") && argc == 4)
else if (!strcmp(argv[i], "default") && (i + 1) < argc)
{
show_default(http, dest, dinfo, argv[3]);
show_default(http, dest, dinfo, argv[i + 1]);
}
else if (!strcmp(argv[2], "localize") && argc < 6)
else if (!strcmp(argv[i], "localize"))
{
if (argc > 3)
localize(http, dest, dinfo, argv[3], argv[4]);
i ++;
if ((i + 1) < argc)
localize(http, dest, dinfo, argv[i], argv[i + 1]);
else if (argc > 2)
localize(http, dest, dinfo, argv[3], NULL);
localize(http, dest, dinfo, argv[i], NULL);
else
localize(http, dest, dinfo, NULL, NULL);
}
else if (!strcmp(argv[2], "media"))
else if (!strcmp(argv[i], "media"))
{
int i; /* Looping var */
const char *name = NULL; /* Media name, if any */
unsigned flags = CUPS_MEDIA_FLAGS_DEFAULT;
/* Media selection flags */
for (i = 3; i < argc; i ++)
for (i ++; i < argc; i ++)
{
if (!strcmp(argv[i], "borderless"))
flags = CUPS_MEDIA_FLAGS_BORDERLESS;
@@ -199,19 +213,19 @@ main(int argc, /* I - Number of command-line arguments */
show_media(http, dest, dinfo, flags, name);
}
else if (!strcmp(argv[2], "print") && argc > 3)
else if (!strcmp(argv[i], "print") && (i + 1) < argc)
{
int i, /* Looping var */
num_options = 0;/* Number of options */
int num_options = 0;/* Number of options */
cups_option_t *options = NULL;/* Options */
const char *filename = argv[i + 1];
for (i = 4; i < argc; i ++)
for (i += 2; i < argc; i ++)
num_options = cupsParseOptions(argv[i], num_options, &options);
print_file(http, dest, dinfo, argv[3], num_options, options);
print_file(http, dest, dinfo, filename, num_options, options);
}
else
usage(argv[2]);
usage(argv[i]);
return (0);
}
@@ -749,9 +763,9 @@ usage(const char *arg) /* I - Argument for usage message */
printf("testdest: Unknown option \"%s\".\n", arg);
puts("Usage:");
puts(" ./testdest name [operation ...]");
puts(" ./testdest ipp://... [operation ...]");
puts(" ./testdest ipps://... [operation ...]");
puts(" ./testdest [--device] name [operation ...]");
puts(" ./testdest [--device] ipp://... [operation ...]");
puts(" ./testdest [--device] ipps://... [operation ...]");
puts(" ./testdest --get");
puts(" ./testdest --enum [grayscale] [color] [duplex] [staple] [small]\n"
" [medium] [large]");
+7 -7
Ver Arquivo
@@ -115,12 +115,12 @@ main(int argc, /* I - Number of command-line arguments */
#endif /* !WIN32 */
/*
* Count lines in psglyphs, rewind, then count again.
* Count lines in test file, rewind, then count again.
*/
fputs("\ncupsFileOpen(\"../data/media.defs\", \"r\"): ", stdout);
fputs("\ncupsFileOpen(\"testfile.txt\", \"r\"): ", stdout);
if ((fp = cupsFileOpen("../data/media.defs", "r")) == NULL)
if ((fp = cupsFileOpen("testfile.txt", "r")) == NULL)
{
puts("FAIL");
status ++;
@@ -130,9 +130,9 @@ main(int argc, /* I - Number of command-line arguments */
puts("PASS");
fputs("cupsFileGets: ", stdout);
if ((count = count_lines(fp)) != 201)
if ((count = count_lines(fp)) != 477)
{
printf("FAIL (got %d lines, expected 201)\n", count);
printf("FAIL (got %d lines, expected 477)\n", count);
status ++;
}
else
@@ -150,9 +150,9 @@ main(int argc, /* I - Number of command-line arguments */
puts("PASS");
fputs("cupsFileGets: ", stdout);
if ((count = count_lines(fp)) != 201)
if ((count = count_lines(fp)) != 477)
{
printf("FAIL (got %d lines, expected 201)\n", count);
printf("FAIL (got %d lines, expected 477)\n", count);
status ++;
}
else
+477
Ver Arquivo
@@ -0,0 +1,477 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi faucibus viverra
nibh ut molestie. Sed aliquet vestibulum dignissim. Praesent dignissim mauris
arcu. Donec porta velit quis nibh rutrum sollicitudin. Aliquam vel tellus
vulputate, sollicitudin turpis in, luctus quam. Donec hendrerit enim dignissim
varius tincidunt. Phasellus mi felis, ultrices nec magna in, ultrices interdum
justo. Nulla aliquam sem ac porta tincidunt. Praesent nec fermentum mauris.
Suspendisse ullamcorper mauris orci, eu ornare dui mollis quis.
In vitae lorem id nulla pellentesque sagittis. Duis aliquet ligula nisl, sed
mollis sapien commodo nec. Etiam placerat arcu turpis, eget viverra magna
ultrices sed. Nullam dapibus urna et tristique consectetur. Curabitur iaculis
nisl lobortis condimentum accumsan. Praesent sagittis purus nunc, vitae bibendum
leo ornare a. Maecenas neque mauris, mollis a sem ut, rhoncus posuere orci.
Aliquam luctus suscipit erat ut semper. In neque augue, vulputate ornare massa
fermentum, sodales faucibus mauris. Vestibulum ante ipsum primis in faucibus
orci luctus et ultrices posuere cubilia Curae;
Pellentesque mattis ante nunc, sit amet blandit felis cursus sed. Quisque
pellentesque ipsum ac mauris fringilla, a rhoncus nunc lacinia. Vestibulum
tempor orci ut nisl cursus, at euismod sem sodales. Integer ornare tellus at
sapien tincidunt ultrices. Interdum et malesuada fames ac ante ipsum primis in
faucibus. Integer placerat eleifend magna, eget volutpat nibh vulputate eget.
Donec cursus orci nisl, eget malesuada sem porta at.
Sed maximus eleifend leo, posuere pellentesque urna viverra id. Aenean pharetra
nunc ut suscipit aliquam. Sed dolor massa, ultrices sed sollicitudin nec,
dapibus vitae tortor. Cras in scelerisque tellus. Sed eu felis vitae neque
tempor eleifend vitae ac augue. Nunc felis ex, fringilla quis sapien vel, tempor
congue nibh. Nullam placerat sit amet lacus quis facilisis.
Sed semper nisi eget auctor semper. Phasellus sodales tempus massa ut suscipit.
Integer malesuada convallis neque, sed pretium leo rhoncus ac. In hac habitasse
platea dictumst. Nullam efficitur mollis lorem. Integer convallis lobortis
dictum. Suspendisse euismod in mauris vel pharetra. Sed vitae magna ut turpis
viverra rhoncus ut sit amet mauris. Nam vel lacinia metus. Proin ut elementum
felis. Nullam massa velit, euismod vel metus eget, feugiat aliquet odio. Fusce
venenatis lorem ut lectus ultricies, vitae accumsan nibh dictum. Maecenas porta
euismod cursus. Nunc at ligula congue, lobortis quam id, volutpat felis.
Proin blandit pulvinar ligula, at dapibus dui rutrum dictum. Etiam non finibus
urna. Pellentesque semper pharetra arcu non dapibus. Vestibulum gravida dictum
libero, quis dictum odio hendrerit sit amet. Aenean a venenatis ante, tincidunt
convallis orci. Morbi tincidunt, orci vitae suscipit lacinia, nisl nunc rutrum
ex, vitae convallis nulla libero ut mauris. Donec ac pellentesque sapien.
Phasellus elementum orci a nisl feugiat tempus. Quisque id justo sed tellus
ultricies porttitor. Fusce elementum mauris nunc. Nullam vel elit ultrices,
rhoncus elit id, scelerisque erat.
Pellentesque molestie efficitur purus, at malesuada orci efficitur et. Curabitur
blandit nisi a ante viverra, vel ornare turpis molestie. Class aptent taciti
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras
scelerisque est non velit placerat, eu volutpat sem fermentum. Cras vitae
gravida nisi, non vestibulum velit. Interdum et malesuada fames ac ante ipsum
primis in faucibus. Cras sollicitudin rutrum tincidunt. Pellentesque non nisl
condimentum, commodo turpis non, fringilla ante. Nunc non ante vel est porttitor
tempor sed vitae nunc. Donec bibendum orci justo, lobortis laoreet purus
accumsan vel. Phasellus non posuere orci. In hac habitasse platea dictumst.
Praesent nec mi sit amet urna ornare pulvinar faucibus at sem. Vestibulum vel
cursus nisl, vel ultricies justo. Proin sed consequat odio, eget dignissim
dolor. Fusce mattis porttitor nulla rutrum aliquet.
Duis vehicula enim nec condimentum dignissim. Phasellus viverra ex at erat
lacinia varius. Nullam rutrum felis ac lacus dignissim elementum quis sit amet
felis. Phasellus eget sapien sit amet sapien maximus tincidunt elementum ut
ante. Mauris dictum pulvinar diam ac lobortis. Duis vitae dui metus. Donec
imperdiet risus vitae augue placerat ultrices. Integer euismod, sapien sit amet
faucibus venenatis, nisl lacus rhoncus lacus, a auctor justo ante sed turpis.
Integer facilisis est non venenatis hendrerit. Vivamus quis ante sodales, mollis
turpis in, bibendum turpis. In hac habitasse platea dictumst. Phasellus nisl
est, porta feugiat eros ut, scelerisque efficitur diam. Suspendisse sit amet
magna libero. Quisque eu arcu vel orci iaculis sagittis nec id orci. Mauris
mattis nunc id quam tristique pellentesque.
Vestibulum vehicula, mauris ac venenatis lobortis, ex risus bibendum nunc, eu
bibendum dolor metus vitae purus. Ut bibendum sed ante viverra tincidunt.
Vestibulum id semper lacus. Fusce lacinia dignissim semper. Proin diam enim,
pellentesque vel dui eu, maximus tincidunt mauris. Cras lorem lectus, malesuada
non dui ac, iaculis elementum justo. Fusce fringilla tempor arcu. Proin vel
turpis vitae purus facilisis dapibus condimentum sed ipsum. Duis mollis justo at
ante convallis ornare. Suspendisse accumsan eleifend mauris, ut aliquet eros
scelerisque eget. Proin ornare elit eu felis dapibus, sit amet posuere est
porttitor. Vivamus tincidunt metus ac nisl pharetra, vel mollis neque egestas.
Quisque turpis ligula, lacinia id suscipit eget, cursus eget mauris. Class
aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
himenaeos. Curabitur sodales, urna eget luctus congue, metus magna viverra nisl,
ut eleifend nulla urna eu arcu. Pellentesque interdum interdum erat, et
hendrerit arcu rhoncus ut. Nulla congue tortor nec egestas aliquam. Nulla
elementum augue eu est imperdiet, nec maximus sapien ornare. Donec aliquam
blandit felis, sed vulputate orci ultrices non. Vivamus rutrum dapibus ligula,
non ullamcorper ante eleifend vel. Pellentesque habitant morbi tristique
senectus et netus et malesuada fames ac turpis egestas. Aliquam sed lacus
condimentum odio commodo tristique.
Proin ultrices non tellus sit amet condimentum. Ut aliquam nulla eget viverra
aliquet. Fusce aliquet orci nec finibus tempor. Etiam luctus eleifend diam vitae
tempor. Fusce sagittis porttitor dignissim. Morbi euismod pellentesque mi vel
malesuada. Praesent cursus rutrum diam sit amet auctor. Praesent non leo
consequat, dapibus massa pellentesque, egestas nulla. Nulla efficitur luctus
purus eu aliquet. Phasellus sed enim pharetra, molestie felis eget, tempor
neque. Proin efficitur vestibulum libero ut hendrerit. Mauris vitae vestibulum
augue, in pellentesque ligula. Phasellus at libero dictum, pretium mauris vitae,
elementum ex. Pellentesque ut euismod orci. In ac elit vel nisl bibendum
fermentum eget in dui. Donec fringilla, nisl vitae tincidunt varius, tellus
sapien accumsan lectus, ac tincidunt eros ipsum nec libero.
Sed mollis purus nec magna tempus, vitae laoreet purus luctus. Morbi accumsan,
urna eget placerat volutpat, nunc magna mattis mi, vitae efficitur eros quam
quis lacus. Etiam eros ligula, tempus vel consectetur non, consectetur quis
risus. Phasellus venenatis lectus arcu, quis bibendum diam dignissim a. Donec
tristique, felis quis dignissim tempor, justo sapien faucibus odio, at venenatis
arcu purus et justo. Nunc vel ex a augue luctus pharetra ac ac turpis. Proin
auctor turpis lobortis, scelerisque mi sit amet, elementum dui. Duis blandit
arcu eros, eu dapibus enim imperdiet sed. Sed auctor urna sed lectus condimentum
rhoncus. Mauris luctus dolor rhoncus suscipit semper. Sed molestie felis ut
laoreet porta. Duis at purus viverra, faucibus elit eu, fringilla odio.
Suspendisse sit amet sodales urna. In hac habitasse platea dictumst. Integer a
sem sed augue sodales dictum. Quisque ut nisi pellentesque, lobortis lectus et,
hendrerit eros.
Phasellus posuere metus sit amet orci viverra vehicula. Nulla urna est,
pellentesque in placerat ut, congue a ligula. Maecenas non viverra arcu. Vivamus
fermentum odio tincidunt tellus tempus, ut suscipit justo hendrerit. Nunc quis
sapien eget turpis mollis porta. Curabitur ultrices est molestie lacus finibus,
vel sodales leo aliquam. Quisque ultrices semper porta. Nulla facilisi. Aenean
nunc leo, ultrices quis augue non, hendrerit semper lectus.
Nulla facilisi. In in volutpat tellus. Sed tincidunt efficitur sem, vel bibendum
ex pharetra eleifend. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. Sed nec erat at ipsum fringilla commodo
eget eu est. Donec suscipit ligula eu ipsum lobortis tristique. Nulla dignissim
nisi quis dignissim faucibus. Nunc finibus lacus eget est laoreet ultrices.
Fusce molestie mattis facilisis. Fusce dictum blandit sem ac tincidunt.
Suspendisse aliquam, dolor ac tincidunt scelerisque, lacus leo luctus quam, ac
auctor ligula neque quis dolor. Maecenas laoreet viverra lectus, eget hendrerit
urna congue ac. Donec convallis, erat ut consectetur ornare, diam diam accumsan
lacus, at consectetur mauris nisi vitae massa. Vestibulum vestibulum dictum
volutpat. Quisque et commodo velit. Praesent in odio nunc.
Vivamus consectetur leo sem, sit amet auctor arcu blandit vitae. Donec non
auctor mauris. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Proin nibh tellus, fermentum quis erat in,
vulputate faucibus nunc. Vestibulum imperdiet ipsum purus, eget efficitur mi
hendrerit vel. Aenean iaculis elementum metus nec consectetur. Suspendisse felis
turpis, maximus sit amet diam at, elementum vestibulum nulla. Quisque et lacinia
elit. Pellentesque tincidunt bibendum neque, non molestie massa ultrices eget.
Duis scelerisque magna in blandit dictum. Pellentesque lacinia augue vitae
fermentum mollis. Etiam mi velit, tempor at risus vel, luctus vestibulum odio.
Phasellus vel ipsum sit amet velit malesuada hendrerit. Donec consequat laoreet
enim. Aliquam sed justo eget ex rhoncus laoreet. Duis maximus tortor at odio
suscipit, non accumsan arcu efficitur. Nunc pharetra id neque nec dignissim. Sed
condimentum magna ut viverra porttitor. Pellentesque rutrum magna et pretium
semper. Fusce tincidunt ipsum at auctor commodo. Duis et ipsum nec turpis
pharetra pulvinar a nec risus. Praesent in enim et ligula maximus consectetur.
Aenean nec turpis turpis.
Quisque mollis dignissim elit, sit amet interdum urna venenatis sit amet.
Quisque interdum, diam eu ullamcorper suscipit, augue purus fermentum purus, nec
consequat purus nibh laoreet lectus. Ut nisi mauris, ultrices non euismod ac,
mollis id libero. Vestibulum ante ipsum primis in faucibus orci luctus et
ultrices posuere cubilia Curae; Cras vitae tristique mi. Mauris ut bibendum
dolor. Suspendisse potenti. Ut tempus ultricies erat, a molestie sapien aliquet
non. Aliquam sagittis nisi vel enim rhoncus eleifend. Proin aliquam eros ut
metus consectetur suscipit. Curabitur ornare mi eget faucibus aliquam. Praesent
ultricies libero est, eget porttitor risus ornare nec. Curabitur pharetra ex ut
eleifend lacinia. Nam nec finibus nunc. Sed hendrerit risus nisi, eu
sollicitudin tellus sollicitudin nec. Proin vel est leo.
Fusce et orci finibus, auctor purus eu, varius magna. Sed sollicitudin elit
vitae turpis tincidunt, at suscipit lacus ultricies. Mauris pretium, nisi sed
cursus ullamcorper, sem sem vulputate neque, a pellentesque lectus massa vel
metus. Sed tincidunt iaculis lectus, non facilisis elit finibus at. Nunc odio
purus, eleifend ac pretium nec, malesuada condimentum eros. Aenean interdum
dolor et malesuada auctor. Donec placerat velit ex, vel cursus metus posuere
sed. Phasellus rutrum nisl vel imperdiet egestas. Interdum et malesuada fames ac
ante ipsum primis in faucibus. Etiam volutpat quam ut risus ultricies blandit.
Mauris commodo ullamcorper pretium. Nam interdum lobortis eleifend. Fusce quam
nisl, feugiat vitae dui non, egestas eleifend erat. Mauris in ligula purus.
Morbi vel mollis diam. Praesent leo felis, luctus ac blandit sit amet, aliquam
at enim.
Duis sit amet augue enim. Donec feugiat ultricies neque, ut porttitor lectus
sagittis ut. Sed ante sem, mollis ut dui quis, finibus rutrum justo. Phasellus
ornare nibh ac scelerisque fringilla. Donec rhoncus luctus elit sed accumsan.
Maecenas fermentum quam nec eros consequat, vitae sollicitudin elit facilisis.
Phasellus urna metus, viverra at nibh ac, euismod fringilla mi. Aliquam nec odio
neque. Duis pulvinar congue aliquam. Suspendisse laoreet bibendum sapien, non
ultricies velit porta id. Vivamus dignissim rhoncus mi, sit amet mollis arcu
cursus nec. Maecenas sagittis cursus dictum. Nam fermentum tincidunt
pellentesque. Vivamus tempus tincidunt rutrum. Mauris semper orci non
scelerisque accumsan.
Nulla fermentum in lacus at aliquet. Proin ut ligula venenatis, maximus elit a,
finibus felis. Nam euismod arcu vel diam laoreet, sed hendrerit urna pharetra.
Phasellus non hendrerit tortor. Donec ut congue odio. Nunc pellentesque ipsum et
est venenatis, sed vehicula magna convallis. Quisque eget euismod orci. In ut
nulla ac augue auctor dapibus a vel arcu. Duis elementum, libero at ullamcorper
consequat, libero nulla vestibulum elit, vel congue lacus nulla quis nulla.
Nulla vel dolor vulputate, dictum nunc nec, pellentesque lacus. Nulla nibh mi,
gravida vel velit vel, tempus dapibus magna. Mauris ornare elementum feugiat.
Vestibulum non finibus lorem, a ullamcorper quam.
Duis eget velit sodales, rhoncus odio nec, laoreet lorem. Donec fermentum est eu
ornare placerat. Sed interdum metus ac metus hendrerit rhoncus. In molestie diam
sem, et faucibus purus lacinia eu. Donec quam arcu, tempus ac commodo sit amet,
porttitor sit amet urna. Suspendisse pellentesque placerat mi, at semper orci
tincidunt non. Fusce ut mattis nisi. Pellentesque vel nisi quis massa volutpat
aliquam vel nec tortor. Maecenas vitae risus quis nibh vestibulum rutrum.
Vestibulum egestas dolor ullamcorper lorem placerat tincidunt. Curabitur massa
urna, pharetra sed gravida vitae, venenatis a tellus. Duis condimentum lectus
tellus, ut sodales ipsum hendrerit ac. Nullam sed accumsan arcu, ut sollicitudin
diam. Integer eu ligula vitae purus vehicula vulputate nec et metus. Aenean
mollis tempor lectus eu elementum. Integer in dui tempus, porttitor erat sed,
malesuada magna.
Cras nec orci sed tellus porta tristique a ac dui. Nam eu faucibus mi. Praesent
condimentum laoreet augue id pellentesque. In malesuada ex sed turpis
consectetur, non sodales mi cursus. Nunc id sem luctus, mattis lorem vel, tempus
ipsum. Nunc efficitur augue et nunc hendrerit, non tincidunt magna commodo.
Aenean sodales porta mi. Sed semper accumsan turpis vitae aliquam. Phasellus
vitae ex faucibus, suscipit ante non, commodo ligula. Aliquam erat volutpat.
Etiam odio sem, fringilla in sem eu, bibendum ornare est. Pellentesque habitant
morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem
ipsum dolor sit amet, consectetur adipiscing elit.
Nulla nec fringilla magna. Morbi eu cursus sem. Fusce euismod eget turpis et
bibendum. Donec vel tincidunt neque. Suspendisse commodo euismod sodales.
Integer pretium congue tortor nec ullamcorper. Nam imperdiet, urna auctor
pretium facilisis, sem arcu malesuada turpis, sit amet sodales nisi lectus
sollicitudin tellus. Praesent consequat leo in dui congue, euismod ornare risus
malesuada. Nunc id tincidunt tortor. Vestibulum sit amet sapien urna. Donec quis
tristique elit, non facilisis neque. Donec gravida molestie tellus, sagittis
accumsan metus varius eu.
Duis nec est vitae augue laoreet rhoncus non nec mi. Phasellus pretium pharetra
magna, et congue urna posuere eget. Sed finibus arcu magna, sed luctus ante
suscipit quis. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Fusce at accumsan quam. Mauris dolor lectus,
tempus auctor ante ut, auctor maximus turpis. Proin pulvinar dolor in
consectetur aliquam. Fusce sagittis elementum fermentum.
Aliquam nec posuere ipsum. Nulla commodo est at magna fringilla lobortis. Etiam
diam orci, venenatis non erat iaculis, commodo hendrerit diam. Nam imperdiet
justo vitae massa consectetur, ornare feugiat ipsum molestie. Curabitur
dignissim vitae augue et euismod. Interdum et malesuada fames ac ante ipsum
primis in faucibus. Praesent justo nunc, pellentesque vel ante vitae, dignissim
maximus felis. Proin vel congue nisl. Quisque ac tempus libero. In at placerat
tellus. Integer lobortis ligula vel dolor ornare finibus.
Donec semper nisl mauris, eu consectetur lacus sollicitudin a. Integer sem enim,
consectetur sed tincidunt id, dignissim at mauris. In a justo non erat cursus
tincidunt et sed sapien. Aenean vulputate placerat ornare. Etiam id lectus
lacus. Donec a sodales sapien. Duis in suscipit est, ultrices mollis magna.
Etiam blandit diam vitae sollicitudin sodales. Proin vel diam nec neque
ullamcorper ullamcorper ut at sapien. Sed quis sollicitudin libero. Nulla sed
arcu consequat, egestas libero viverra, dignissim magna.
Nullam semper turpis a sem tincidunt, ut molestie ante tincidunt. Curabitur
efficitur nisl quis aliquam tristique. Proin a auctor lectus. Donec dictum
mauris a leo consequat, eu bibendum neque efficitur. Donec euismod, mi nec
faucibus ornare, elit est tincidunt ligula, at molestie neque augue non justo.
Vestibulum condimentum varius felis non pretium. Praesent maximus ex sed justo
tristique elementum. Phasellus nec feugiat dolor. Nulla sed odio quam. Nulla nec
massa sit amet tellus efficitur accumsan sed et orci. Nullam sed mollis augue,
eget dictum metus. Etiam ut velit elit. Nullam nibh eros, commodo vitae maximus
sit amet, convallis sit amet elit. Nullam faucibus arcu tortor, vitae tincidunt
augue ullamcorper in.
Praesent quis metus et purus volutpat pulvinar. Sed commodo vehicula sodales.
Phasellus fringilla vehicula placerat. Vestibulum sit amet ante in ante
condimentum laoreet. Sed id purus diam. Suspendisse in libero in risus eleifend
fringilla. Cras non sapien vel sapien condimentum tristique.
Integer non semper mi, a aliquet enim. Phasellus congue erat sed lorem molestie
consectetur. Integer iaculis nisi et nisi blandit auctor. Nullam magna diam,
hendrerit sollicitudin urna vel, gravida congue diam. Curabitur finibus ipsum
ex, ac feugiat massa posuere at. Pellentesque in molestie lorem. Fusce rhoncus
velit at magna accumsan convallis. Aliquam posuere elementum turpis, eget
eleifend quam auctor et. Mauris a diam vitae magna malesuada fermentum sit amet
ut justo. Quisque in purus et erat rhoncus accumsan. Donec feugiat, ipsum vel
pulvinar suscipit, nibh nisi volutpat felis, nec rutrum nisi turpis at diam.
Suspendisse posuere, ante ut imperdiet tempor, tortor magna maximus risus, id
fermentum urna mauris hendrerit magna. Interdum et malesuada fames ac ante ipsum
primis in faucibus.
Ut eu faucibus neque. Fusce tempus luctus dui ut ullamcorper. Suspendisse in
velit a turpis facilisis scelerisque. Nullam ultricies sodales convallis. Proin
viverra vulputate justo sit amet interdum. Donec mi neque, dapibus ac ex at,
dignissim tincidunt lacus. Praesent ultricies, erat ac sagittis tempor, justo
turpis porta tortor, eget consectetur turpis odio sed nibh. Vestibulum vitae
porta lorem, efficitur viverra enim.
Nullam sodales sagittis tristique. Duis ac velit ultrices, efficitur tortor sit
amet, varius lacus. Praesent blandit et arcu sit amet tempus. Quisque neque
lectus, congue at rutrum at, commodo eu velit. Aliquam sed mi a ante condimentum
consectetur. Morbi feugiat risus dolor, ac auctor massa ultrices in. Praesent
laoreet metus non urna rhoncus, vel lacinia ex dapibus. Class aptent taciti
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Curabitur vitae arcu vel enim feugiat rhoncus. Nullam nec neque sed nulla
hendrerit iaculis sed non erat. Pellentesque orci lacus, ullamcorper posuere
odio vel, efficitur elementum ipsum. Morbi justo risus, faucibus sit amet urna
eu, facilisis consequat ipsum. Quisque et congue ipsum, at ornare lacus.
Nunc laoreet elit nec arcu lobortis consectetur. Sed consectetur ultrices risus,
quis tincidunt lectus fermentum at. Nunc libero sem, dignissim pharetra lacinia
eu, posuere quis libero. Sed at lacus consectetur, molestie nisi quis,
scelerisque tortor. Etiam accumsan placerat nulla, vel consectetur felis aliquam
et. Cras pellentesque massa a ex commodo condimentum. Integer nec nulla sed
metus dignissim placerat. Ut vel urna augue. Donec pharetra justo ac ex pretium,
ut condimentum erat lacinia. Nunc id porta nunc, ac dapibus massa. Suspendisse
accumsan justo quis felis pharetra tempus. Donec rutrum nulla in consectetur
tincidunt.
Sed eu orci eu ligula maximus aliquet eget sed ex. Donec rhoncus fringilla
tellus, a bibendum mi placerat eu. Pellentesque luctus finibus neque blandit
pharetra. Aenean nec elit pretium, sodales lacus sed, mollis felis. Duis commodo
pellentesque risus et semper. Praesent pretium, libero pharetra fringilla
faucibus, ipsum urna porta nunc, nec euismod dolor risus eget lacus. Curabitur
malesuada dapibus tellus ut luctus. Aliquam gravida mauris tellus, ut vestibulum
massa dignissim vestibulum. Sed pulvinar, ex et consequat malesuada, erat tellus
bibendum mi, nec auctor nulla massa eu justo. Suspendisse imperdiet interdum
ligula. Donec at pretium urna. Donec quis diam leo. Aenean ac lectus non justo
aliquam consequat vitae mattis ipsum. Integer at consectetur felis, et volutpat
sapien. Suspendisse efficitur libero eu pulvinar cursus.
Suspendisse interdum enim id nibh imperdiet, et pulvinar lectus aliquet. Donec
ultricies mattis lorem eget malesuada. Sed hendrerit massa in rutrum auctor.
Suspendisse interdum mauris in sem vestibulum volutpat. Maecenas interdum
facilisis dui, posuere volutpat eros suscipit eget. Curabitur blandit odio
turpis, non dignissim magna varius sit amet. Suspendisse cursus ipsum id metus
venenatis, eu malesuada arcu congue.
Nulla vitae mi ut nibh pretium cursus in vitae turpis. In hac habitasse platea
dictumst. Phasellus consectetur, metus at tempus sollicitudin, nibh est molestie
nunc, sed imperdiet purus sapien in lorem. Etiam eget leo nec sem efficitur
luctus. Vestibulum mattis a odio ut volutpat. Duis consequat magna eget luctus
vulputate. Nam viverra posuere ultricies.
Duis sagittis nunc et sem sagittis venenatis. Sed massa lacus, vestibulum eget
convallis ac, facilisis nec turpis. Morbi ac ornare ex. Quisque non laoreet
lectus, sed tempus libero. Sed non neque risus. Sed gravida, mauris ac aliquam
porttitor, dolor massa faucibus est, eget vestibulum eros eros et risus. Morbi
sit amet tincidunt eros, ut cursus mauris. Integer a lectus pharetra, molestie
massa vel, laoreet sem. Suspendisse et enim libero. Nam molestie risus nec ex
laoreet, a faucibus massa rhoncus. Vivamus faucibus sapien eget lorem efficitur
auctor.
Curabitur sit amet leo non massa tempor bibendum. Nunc in tristique est. Donec
id mollis mauris, vel porta magna. Nulla vulputate eleifend lacus sed tincidunt.
Maecenas vitae sapien eu neque hendrerit venenatis sit amet nec nulla. Morbi
vestibulum dui lectus, id commodo dui vehicula eget. Nulla laoreet turpis vitae
lacus vehicula lacinia. Integer rhoncus tellus mi, vitae gravida metus convallis
quis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
inceptos himenaeos. Mauris et accumsan sem. Sed elementum egestas tellus eget
eleifend. Sed finibus luctus felis.
Maecenas ultrices sodales orci non dapibus. Phasellus vitae lacus at diam
ultrices mattis porta non ipsum. Aliquam erat volutpat. Vestibulum auctor diam
vehicula gravida volutpat. In rhoncus, dui sit amet consequat convallis, odio
mauris tincidunt mi, vestibulum imperdiet lacus erat sed metus. Aenean in augue
eu tortor dictum tempor a ac magna. Mauris aliquet justo eget sem sollicitudin,
congue facilisis velit mollis. Proin dignissim, nulla a efficitur fringilla,
orci nulla malesuada velit, eget cursus dolor metus vitae nisl. Phasellus non
neque ipsum. Pellentesque porta vehicula ipsum, nec posuere urna bibendum et.
Etiam nec nisl eu nulla tempus placerat. Pellentesque risus magna, accumsan
vitae sem vitae, cursus fermentum elit. Ut varius efficitur turpis, et
pellentesque libero rutrum hendrerit. Maecenas condimentum lobortis eros, a
euismod metus.
Ut risus sapien, pulvinar quis euismod id, vestibulum ac erat. Donec feugiat
tempor commodo. Donec ligula est, aliquet eu sagittis eu, posuere vel eros.
Nullam sollicitudin diam eget libero malesuada, vel tempus lectus congue.
Praesent a odio risus. Nullam maximus tellus sed ligula eleifend, sed mollis
nunc consequat. Quisque eros mi, imperdiet nec ipsum in, pretium feugiat nibh.
Pellentesque cursus justo at metus condimentum consectetur. Nulla facilisi. Ut
tincidunt sem eget diam rhoncus, vitae gravida ipsum facilisis. Integer et
condimentum purus.
Sed faucibus tempus orci, id cursus eros volutpat non. Nam pulvinar ex nec enim
egestas ultricies. Suspendisse at eros ac metus sodales varius eu in ante. Cras
sed est quis magna tempus mollis id faucibus nibh. Curabitur convallis nisi
dolor, in imperdiet ante tempor eu. Quisque placerat leo et leo cursus, nec
eleifend urna scelerisque. Duis consequat ex a sapien facilisis consectetur.
Vivamus et aliquam lacus.
Praesent consequat lacus in aliquam ultricies. Sed consectetur vehicula aliquet.
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
himenaeos. Vivamus tellus neque, eleifend sed purus quis, elementum luctus mi.
Nullam elit lacus, finibus a sollicitudin in, suscipit non nunc. Nulla vulputate
odio vitae mauris tristique, ac interdum urna interdum. Phasellus nec tortor
hendrerit, mattis ante non, pharetra tortor.
Pellentesque vitae tempor urna, ut gravida enim. Sed eget sem purus. Nunc semper
quam mi, sed mollis ligula feugiat at. Pellentesque finibus augue risus, et
ultricies lacus scelerisque vel. Proin euismod tortor quam, et cursus ipsum
dictum ac. Suspendisse laoreet velit consequat ullamcorper cursus. Nam ultricies
gravida viverra. Vivamus non sodales quam, eget rutrum quam. Suspendisse
venenatis lorem sodales lectus eleifend, ac consequat odio finibus. Morbi id
maximus metus, a molestie neque. Integer eget felis sit amet sem tempor
placerat. Suspendisse lobortis congue justo eu accumsan. Nullam accumsan laoreet
purus. Nulla quis efficitur risus.
Ut ac leo libero. Nam nec nisi iaculis, ornare nunc fringilla, sodales lectus.
Nulla laoreet mauris sodales, sagittis enim non, vestibulum orci. Fusce orci
dui, dapibus nec ligula vitae, vulputate maximus ante. Mauris vitae felis
tincidunt, ullamcorper neque quis, pulvinar nisl. Fusce ut augue ac nisl posuere
tristique ac sed leo. Nunc pellentesque pretium turpis. Integer maximus rutrum
felis, ut molestie mauris mattis non. Morbi ac risus ut mauris porta pharetra.
Fusce mollis pharetra turpis nec consequat. Aenean tincidunt felis vel nulla
porta, faucibus egestas ligula efficitur. Morbi et dictum velit.
Proin scelerisque justo in tristique congue. Maecenas consequat ante dapibus
justo vehicula pretium. Sed consequat turpis ac orci suscipit malesuada non a
risus. In id leo molestie, venenatis risus quis, dignissim nulla. Nulla aliquet
risus nulla, a convallis sem tincidunt ac. Pellentesque scelerisque, elit eu
finibus eleifend, orci lectus egestas lorem, nec bibendum libero est non leo.
Nullam nisl ante, ullamcorper in efficitur a, consectetur sit amet tellus. Ut et
pellentesque eros. Etiam mattis nulla justo, sed ultricies dui commodo vel. Ut
tristique posuere leo, ac facilisis massa lobortis nec. Quisque leo ligula,
venenatis vel facilisis vel, volutpat ac sapien. Fusce sed porttitor urna.
Phasellus tempus semper condimentum. Aliquam sit amet felis vel nulla porta
luctus id vel leo.
Ut ut odio tincidunt, ultrices enim at, pellentesque sem. Proin bibendum ligula
lacus, ut tempus mauris tincidunt id. Praesent sollicitudin interdum tellus, vel
tincidunt nisi ultrices a. Aliquam cursus faucibus elit, quis lacinia erat
elementum eu. Duis sollicitudin lectus lectus, ut ultrices elit malesuada quis.
Phasellus viverra turpis sit amet erat iaculis dapibus. Donec semper turpis sed
risus pharetra pharetra. Donec ut ante ac orci blandit interdum. Pellentesque
facilisis id purus egestas placerat. Suspendisse sit amet euismod velit, et
rutrum ipsum. Maecenas at mi pulvinar, dignissim erat quis, blandit libero.
Praesent quam tortor, tempus et laoreet nec, aliquet sed libero. Duis vestibulum
est sed risus venenatis rhoncus. Phasellus arcu libero, commodo eget tincidunt
non, aliquam in velit. Phasellus imperdiet ante a laoreet gravida. Cras faucibus
semper nulla eu facilisis.
Praesent non sem sem. Nulla tempus ullamcorper sollicitudin. Ut eget nisi eget
augue fermentum consequat. Proin congue a nisi eget ullamcorper. Pellentesque
luctus diam felis, a pharetra nunc cursus in. Vivamus a quam dolor. Curabitur
fermentum elit sit amet purus ultricies, ut placerat nisl finibus. Nunc sed
ligula diam. Ut efficitur risus tortor. Suspendisse sem elit, posuere sit amet
nisi et, placerat tristique ipsum. Ut nunc ex, fermentum sed tempor vitae,
scelerisque quis nulla.
Duis ac aliquam lectus. Curabitur consequat maximus leo sed cursus. Maecenas
cursus lectus non porttitor consectetur. Vivamus ultricies, lectus non tempor
porttitor, turpis velit auctor leo, at auctor nibh justo ut mi. Vivamus interdum
massa at fermentum cursus. Nulla suscipit purus nulla, vel condimentum eros
rhoncus eget. Nulla malesuada aliquet maximus. Nulla blandit ipsum finibus leo
rhoncus, non lobortis felis scelerisque. Duis blandit massa quis velit efficitur
cursus. Aliquam nibh arcu, dictum et feugiat eget, iaculis ac risus. Nunc
facilisis pellentesque mauris, a aliquet libero eleifend eu. Pellentesque a
turpis et justo blandit maximus. Phasellus imperdiet dui odio, eu facilisis quam
porttitor id. Morbi accumsan, mauris eget fermentum porta, mi risus sagittis
nisi, in semper odio orci a magna. Praesent maximus accumsan odio, vitae
bibendum ipsum ultrices eu. Vestibulum laoreet purus nec neque fringilla
dignissim.
Morbi interdum diam eget ornare vestibulum. Etiam egestas at ipsum eget dapibus.
Nullam feugiat mi ex, et varius odio ornare id. Sed sagittis augue quam, in
maximus orci tincidunt vel. Duis molestie felis nunc, et feugiat risus
vestibulum et. Integer efficitur augue elit, id commodo lorem volutpat sed.
Fusce quam velit, suscipit a posuere sit amet, pulvinar sed nisi. Fusce lacinia
accumsan nunc vitae lobortis. Vivamus eu fringilla velit. Cras hendrerit
efficitur faucibus. Praesent facilisis a nulla non efficitur. Etiam quis est ac
neque pharetra bibendum a vitae neque.
Phasellus dui dui, pellentesque in facilisis quis, vulputate non nibh. Integer
in lobortis velit. Curabitur efficitur imperdiet dolor, vel tempus dui fermentum
quis. Maecenas porttitor nibh at nibh cursus mattis. In dolor neque, efficitur
at ligula nec, lobortis aliquam ipsum. Phasellus quam magna, imperdiet at nunc
a, suscipit aliquam metus. Cras consequat, enim vitae feugiat venenatis, enim
urna venenatis ligula, vel cursus odio lectus id purus. Integer sit amet finibus
diam. Fusce aliquet vehicula mauris, a varius metus semper in. Cras sodales
malesuada consectetur.
+13 -3
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* HTTP test program for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -114,6 +115,9 @@ static uri_test_t uri_tests[] = /* URI test data */
{ HTTP_URI_STATUS_OK, "ipp://%22%23%2F%3A%3C%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D/",
"ipp", "", "\"#/:<>?@[\\]^`{|}", "/", 631, 0,
HTTP_URI_CODING_MOST },
{ HTTP_URI_STATUS_UNKNOWN_SCHEME, "smb://server/Some%20Printer",
"smb", "", "server", "/Some Printer", 0, 0,
HTTP_URI_CODING_ALL },
/* Missing scheme */
{ HTTP_URI_STATUS_MISSING_SCHEME, "/path/to/file/index.html",
@@ -142,6 +146,9 @@ static uri_test_t uri_tests[] = /* URI test data */
HTTP_URI_CODING_MOST },
/* Bad scheme */
{ HTTP_URI_STATUS_BAD_SCHEME, "://server/ipp",
"", "", "", "", 0, 0,
HTTP_URI_CODING_MOST },
{ HTTP_URI_STATUS_BAD_SCHEME, "bad_scheme://server/resource",
"", "", "", "", 0, 0,
HTTP_URI_CODING_MOST },
@@ -174,6 +181,9 @@ static uri_test_t uri_tests[] = /* URI test data */
HTTP_URI_CODING_MOST },
/* Bad resource */
{ HTTP_URI_STATUS_BAD_RESOURCE, "mailto:\r\nbla",
"mailto", "", "", "", 0, 0,
HTTP_URI_CODING_MOST },
{ HTTP_URI_STATUS_BAD_RESOURCE, "http://server/index.html%",
"http", "", "server", "", 80, 0,
HTTP_URI_CODING_MOST },
+70 -18
Ver Arquivo
@@ -1,8 +1,8 @@
/*
* IPP test program for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2005 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
@@ -223,6 +223,7 @@ static ipp_uchar_t mixed[] = /* Mixed value buffer */
void hex_dump(const char *title, ipp_uchar_t *buffer, size_t bytes);
void print_attributes(ipp_t *ipp, int indent);
ssize_t read_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
int token_cb(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *token);
ssize_t write_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
@@ -706,30 +707,53 @@ main(int argc, /* I - Number of command-line arguments */
for (i = 1; i < (size_t)argc; i ++)
{
if ((fp = cupsFileOpen(argv[i], "r")) == NULL)
if (strlen(argv[i]) > 5 && !strcmp(argv[i] + strlen(argv[i]) - 5, ".test"))
{
printf("Unable to open \"%s\" - %s\n", argv[i], strerror(errno));
status = 1;
continue;
}
/*
* Read an ASCII IPP message...
*/
request = ippNew();
while ((state = ippReadIO(fp, (ipp_iocb_t)cupsFileRead, 1, NULL,
request)) == IPP_STATE_ATTRIBUTE);
_ipp_vars_t v; /* IPP variables */
if (state != IPP_STATE_DATA)
{
printf("Error reading IPP message from \"%s\"!\n", argv[i]);
status = 1;
_ippVarsInit(&v, NULL, NULL, token_cb);
request = _ippFileParse(&v, argv[i], NULL);
_ippVarsDeinit(&v);
}
else
{
printf("\n%s:\n", argv[i]);
print_attributes(request, 4);
/*
* Read a raw (binary) IPP message...
*/
if ((fp = cupsFileOpen(argv[i], "r")) == NULL)
{
printf("Unable to open \"%s\" - %s\n", argv[i], strerror(errno));
status = 1;
continue;
}
request = ippNew();
while ((state = ippReadIO(fp, (ipp_iocb_t)cupsFileRead, 1, NULL,
request)) == IPP_STATE_ATTRIBUTE);
if (state != IPP_STATE_DATA)
{
printf("Error reading IPP message from \"%s\": %s\n", argv[i], cupsLastErrorString());
status = 1;
ippDelete(request);
request = NULL;
}
cupsFileClose(fp);
}
ippDelete(request);
cupsFileClose(fp);
if (request)
{
printf("\n%s:\n", argv[i]);
print_attributes(request, 4);
ippDelete(request);
}
}
}
@@ -862,6 +886,34 @@ read_cb(_ippdata_t *data, /* I - Data */
}
/*
* 'token_cb()' - Token callback for ASCII IPP data file parser.
*/
int /* O - 1 on success, 0 on failure */
token_cb(_ipp_file_t *f, /* I - IPP file data */
_ipp_vars_t *v, /* I - IPP variables */
void *user_data, /* I - User data pointer */
const char *token) /* I - Token string */
{
(void)v;
(void)user_data;
if (!token)
{
f->attrs = ippNew();
f->group_tag = IPP_TAG_PRINTER;
}
else
{
fprintf(stderr, "Unknown directive \"%s\" on line %d of \"%s\".\n", token, f->linenum, f->filename);
return (0);
}
return (1);
}
/*
* 'write_cb()' - Write data into a buffer.
*/
+70 -8
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Raster test program routines for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -506,7 +507,7 @@ do_ras_file(const char *filename) /* I - Filename */
static int /* O - Number of errors */
do_raster_tests(cups_mode_t mode) /* O - Write mode */
{
unsigned page, x, y; /* Looping vars */
unsigned page, x, y, count;/* Looping vars */
FILE *fp; /* Raster file */
cups_raster_t *r; /* Raster stream */
cups_page_header2_t header, /* Page header */
@@ -580,11 +581,15 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
header.cupsBitsPerPixel = (page & 1) ? 32 : 8;
}
printf("cupsRasterWriteHeader2(page %d): ", page + 1);
if (cupsRasterWriteHeader2(r, &header))
puts("cupsRasterWriteHeader2: PASS");
{
puts("PASS");
}
else
{
puts("cupsRasterWriteHeader2: FAIL");
puts("FAIL");
errors ++;
}
@@ -722,7 +727,7 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
expected.cupsBitsPerPixel = (page & 1) ? 32 : 8;
}
fputs("cupsRasterReadHeader2: ", stdout);
printf("cupsRasterReadHeader2(page %d): ", page + 1);
fflush(stdout);
if (!cupsRasterReadHeader2(r, &header))
@@ -731,13 +736,14 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
errors ++;
break;
}
if (memcmp(&header, &expected, sizeof(header)))
else if (memcmp(&header, &expected, sizeof(header)))
{
puts("FAIL (bad page header)");
errors ++;
print_changes(&header, &expected);
}
else
puts("PASS");
fputs("cupsRasterReadPixels: ", stdout);
fflush(stdout);
@@ -754,6 +760,20 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
if (data[0] != 0 || memcmp(data, data + 1, header.cupsBytesPerLine - 1))
{
printf("FAIL (raster line %d corrupt)\n", y);
for (x = 0, count = 0; x < header.cupsBytesPerLine && count < 10; x ++)
{
if (data[x])
{
count ++;
if (count == 10)
puts(" ...");
else
printf(" %4u %02X (expected %02X)\n", x, data[x], 0);
}
}
errors ++;
break;
}
@@ -777,6 +797,20 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
if (x < header.cupsBytesPerLine)
{
printf("FAIL (raster line %d corrupt)\n", y + 64);
for (x = 0, count = 0; x < header.cupsBytesPerLine && count < 10; x ++)
{
if (data[x] != (x & 255))
{
count ++;
if (count == 10)
puts(" ...");
else
printf(" %4u %02X (expected %02X)\n", x, data[x], x & 255);
}
}
errors ++;
break;
}
@@ -796,6 +830,20 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
if (data[0] != 255 || memcmp(data, data + 1, header.cupsBytesPerLine - 1))
{
printf("fail (raster line %d corrupt)\n", y + 128);
for (x = 0, count = 0; x < header.cupsBytesPerLine && count < 10; x ++)
{
if (data[x] != 255)
{
count ++;
if (count == 10)
puts(" ...");
else
printf(" %4u %02X (expected %02X)\n", x, data[x], 255);
}
}
errors ++;
break;
}
@@ -819,6 +867,20 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
if (x < header.cupsBytesPerLine)
{
printf("FAIL (raster line %d corrupt)\n", y + 192);
for (x = 0, count = 0; x < header.cupsBytesPerLine && count < 10; x ++)
{
if (data[x] != ((x / 4) & 255))
{
count ++;
if (count == 10)
puts(" ...");
else
printf(" %4u %02X (expected %02X)\n", x, data[x], (x / 4) & 255);
}
}
errors ++;
break;
}
+13 -4
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* Threading primitives for CUPS.
*
* Copyright 2009-2017 by Apple Inc.
* Copyright © 2009-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -50,8 +51,16 @@ _cupsCondWait(_cups_cond_t *cond, /* I - Condition */
{
struct timespec abstime; /* Timeout */
abstime.tv_sec = (long)timeout;
abstime.tv_nsec = (long)(1000000000 * (timeout - (long)timeout));
clock_gettime(CLOCK_REALTIME, &abstime);
abstime.tv_sec += (long)timeout;
abstime.tv_nsec += (long)(1000000000 * (timeout - (long)timeout));
while (abstime.tv_nsec >= 1000000000)
{
abstime.tv_nsec -= 1000000000;
abstime.tv_sec ++;
};
pthread_cond_timedwait(cond, mutex, &abstime);
}
+100 -12
Ver Arquivo
@@ -1,8 +1,8 @@
/*
* TLS support code for CUPS on macOS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
@@ -800,24 +800,85 @@ httpCredentialsString(
if ((first = (http_credential_t *)cupsArrayFirst(credentials)) != NULL &&
(secCert = http_cdsa_create_credential(first)) != NULL)
{
CFStringRef cf_name; /* CF common name string */
char name[256]; /* Common name associated with cert */
/*
* Copy certificate (string) values from the SecCertificateRef and produce
* a one-line summary. The API for accessing certificate values like the
* issuer name is, um, "interesting"...
*/
CFStringRef cf_string; /* CF string */
CFDictionaryRef cf_dict; /* Dictionary for certificate */
char commonName[256],/* Common name associated with cert */
issuer[256], /* Issuer name */
sigalg[256]; /* Signature algorithm */
time_t expiration; /* Expiration date of cert */
unsigned char md5_digest[16]; /* MD5 result */
if ((cf_name = SecCertificateCopySubjectSummary(secCert)) != NULL)
if (SecCertificateCopyCommonName(secCert, &cf_string) == noErr)
{
CFStringGetCString(cf_name, name, (CFIndex)sizeof(name), kCFStringEncodingUTF8);
CFRelease(cf_name);
CFStringGetCString(cf_string, commonName, (CFIndex)sizeof(commonName), kCFStringEncodingUTF8);
CFRelease(cf_string);
}
else
strlcpy(name, "unknown", sizeof(name));
{
strlcpy(commonName, "unknown", sizeof(commonName));
}
strlcpy(issuer, "unknown", sizeof(issuer));
strlcpy(sigalg, "UnknownSignature", sizeof(sigalg));
if ((cf_dict = SecCertificateCopyValues(secCert, NULL, NULL)) != NULL)
{
CFDictionaryRef cf_issuer = CFDictionaryGetValue(cf_dict, kSecOIDX509V1IssuerName);
CFDictionaryRef cf_sigalg = CFDictionaryGetValue(cf_dict, kSecOIDX509V1SignatureAlgorithm);
if (cf_issuer)
{
CFArrayRef cf_values = CFDictionaryGetValue(cf_issuer, kSecPropertyKeyValue);
CFIndex i, count = CFArrayGetCount(cf_values);
CFDictionaryRef cf_value;
for (i = 0; i < count; i ++)
{
cf_value = CFArrayGetValueAtIndex(cf_values, i);
if (!CFStringCompare(CFDictionaryGetValue(cf_value, kSecPropertyKeyLabel), kSecOIDOrganizationName, kCFCompareCaseInsensitive))
CFStringGetCString(CFDictionaryGetValue(cf_value, kSecPropertyKeyValue), issuer, (CFIndex)sizeof(issuer), kCFStringEncodingUTF8);
}
}
if (cf_sigalg)
{
CFArrayRef cf_values = CFDictionaryGetValue(cf_sigalg, kSecPropertyKeyValue);
CFIndex i, count = CFArrayGetCount(cf_values);
CFDictionaryRef cf_value;
for (i = 0; i < count; i ++)
{
cf_value = CFArrayGetValueAtIndex(cf_values, i);
if (!CFStringCompare(CFDictionaryGetValue(cf_value, kSecPropertyKeyLabel), CFSTR("Algorithm"), kCFCompareCaseInsensitive))
{
CFStringRef cf_algorithm = CFDictionaryGetValue(cf_value, kSecPropertyKeyValue);
if (!CFStringCompare(cf_algorithm, CFSTR("1.2.840.113549.1.1.5"), kCFCompareCaseInsensitive))
strlcpy(sigalg, "SHA1WithRSAEncryption", sizeof(sigalg));
else if (!CFStringCompare(cf_algorithm, CFSTR("1.2.840.113549.1.1.11"), kCFCompareCaseInsensitive))
strlcpy(sigalg, "SHA256WithRSAEncryption", sizeof(sigalg));
else if (!CFStringCompare(cf_algorithm, CFSTR("1.2.840.113549.1.1.4"), kCFCompareCaseInsensitive))
strlcpy(sigalg, "MD5WithRSAEncryption", sizeof(sigalg));
}
}
}
CFRelease(cf_dict);
}
expiration = (time_t)(SecCertificateNotValidAfter(secCert) + kCFAbsoluteTimeIntervalSince1970);
cupsHashData("md5", first->data, first->datalen, md5_digest, sizeof(md5_digest));
snprintf(buffer, bufsize, "%s / %s / %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", name, httpGetDateString(expiration), md5_digest[0], md5_digest[1], md5_digest[2], md5_digest[3], md5_digest[4], md5_digest[5], md5_digest[6], md5_digest[7], md5_digest[8], md5_digest[9], md5_digest[10], md5_digest[11], md5_digest[12], md5_digest[13], md5_digest[14], md5_digest[15]);
snprintf(buffer, bufsize, "%s (issued by %s) / %s / %s / %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", commonName, issuer, httpGetDateString(expiration), sigalg, md5_digest[0], md5_digest[1], md5_digest[2], md5_digest[3], md5_digest[4], md5_digest[5], md5_digest[6], md5_digest[7], md5_digest[8], md5_digest[9], md5_digest[10], md5_digest[11], md5_digest[12], md5_digest[13], md5_digest[14], md5_digest[15]);
CFRelease(secCert);
}
@@ -1424,7 +1485,7 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
* Server: find/create a certificate for TLS...
*/
if (http->fields[HTTP_FIELD_HOST][0])
if (http->fields[HTTP_FIELD_HOST])
{
/*
* Use hostname for TLS upgrade...
@@ -1532,7 +1593,28 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
if (!error)
{
int done = 0; /* Are we done yet? */
int done = 0; /* Are we done yet? */
double old_timeout; /* Old timeout value */
http_timeout_cb_t old_cb; /* Old timeout callback */
void *old_data; /* Old timeout data */
/*
* Enforce a minimum timeout of 10 seconds for the TLS handshake...
*/
old_timeout = http->timeout_value;
old_cb = http->timeout_cb;
old_data = http->timeout_data;
if (!old_cb || old_timeout < 10.0)
{
DEBUG_puts("4_httpTLSStart: Setting timeout to 10 seconds.");
httpSetTimeout(http, 10.0, NULL, NULL);
}
/*
* Do the TLS handshake...
*/
while (!error && !done)
{
@@ -1653,6 +1735,12 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
break;
}
}
/*
* Restore the previous timeout settings...
*/
httpSetTimeout(http, old_timeout, old_cb, old_data);
}
if (error)
@@ -2085,7 +2173,7 @@ http_cdsa_read(
http = (http_t *)connection;
if (!http->blocking)
if (!http->blocking || http->timeout_value > 0.0)
{
/*
* Make sure we have data before we read...
+51 -12
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* TLS support code for CUPS using GNU TLS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/**** This file is included from tls.c ****/
@@ -393,7 +394,7 @@ httpCredentialsAreValidForName(
for (i = 0; i < count; i ++)
{
rserial_size = sizeof(rserial);
if (!gnutls_x509_crl_get_crt_serial(tls_crl, (unsigned)i, rserial, &rserial_size, NULL) && cserial_size == rserial_size && !memcmp(cserial, rserial, rserial_size))
if (!gnutls_x509_crl_get_crt_serial(tls_crl, (unsigned)i, rserial, &rserial_size, NULL) && cserial_size == rserial_size && !memcmp(cserial, rserial, (int)rserial_size))
{
result = 0;
break;
@@ -639,22 +640,31 @@ httpCredentialsString(
if ((first = (http_credential_t *)cupsArrayFirst(credentials)) != NULL &&
(cert = http_gnutls_create_credential(first)) != NULL)
{
char name[256]; /* Common name associated with cert */
size_t namelen; /* Length of name */
char name[256], /* Common name associated with cert */
issuer[256]; /* Issuer associated with cert */
size_t len; /* Length of string */
time_t expiration; /* Expiration date of cert */
int sigalg; /* Signature algorithm */
unsigned char md5_digest[16]; /* MD5 result */
namelen = sizeof(name) - 1;
if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_COMMON_NAME, 0, 0, name, &namelen) >= 0)
name[namelen] = '\0';
len = sizeof(name) - 1;
if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_COMMON_NAME, 0, 0, name, &len) >= 0)
name[len] = '\0';
else
strlcpy(name, "unknown", sizeof(name));
len = sizeof(issuer) - 1;
if (gnutls_x509_crt_get_issuer_dn_by_oid(cert, GNUTLS_OID_X520_ORGANIZATION_NAME, 0, 0, issuer, &len) >= 0)
issuer[len] = '\0';
else
strlcpy(issuer, "unknown", sizeof(issuer));
expiration = gnutls_x509_crt_get_expiration_time(cert);
sigalg = gnutls_x509_crt_get_signature_algorithm(cert);
cupsHashData("md5", first->data, first->datalen, md5_digest, sizeof(md5_digest));
snprintf(buffer, bufsize, "%s / %s / %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", name, httpGetDateString(expiration), md5_digest[0], md5_digest[1], md5_digest[2], md5_digest[3], md5_digest[4], md5_digest[5], md5_digest[6], md5_digest[7], md5_digest[8], md5_digest[9], md5_digest[10], md5_digest[11], md5_digest[12], md5_digest[13], md5_digest[14], md5_digest[15]);
snprintf(buffer, bufsize, "%s (issued by %s) / %s / %s / %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", name, issuer, httpGetDateString(expiration), gnutls_sign_get_name(sigalg), md5_digest[0], md5_digest[1], md5_digest[2], md5_digest[3], md5_digest[4], md5_digest[5], md5_digest[6], md5_digest[7], md5_digest[8], md5_digest[9], md5_digest[10], md5_digest[11], md5_digest[12], md5_digest[13], md5_digest[14], md5_digest[15]);
gnutls_x509_crt_deinit(cert);
}
@@ -1087,7 +1097,7 @@ http_gnutls_read(
http = (http_t *)ptr;
if (!http->blocking)
if (!http->blocking || http->timeout_value > 0.0)
{
/*
* Make sure we have data before we read...
@@ -1245,6 +1255,9 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
char priority_string[2048];
/* Priority string */
int version; /* Current version */
double old_timeout; /* Old timeout value */
http_timeout_cb_t old_cb; /* Old timeout callback */
void *old_data; /* Old timeout data */
static const char * const versions[] =/* SSL/TLS versions */
{
"VERS-SSL3.0",
@@ -1343,7 +1356,7 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
keyfile[1024]; /* Private key file */
int have_creds = 0; /* Have credentials? */
if (http->fields[HTTP_FIELD_HOST][0])
if (http->fields[HTTP_FIELD_HOST])
{
/*
* Use hostname for TLS upgrade...
@@ -1578,6 +1591,24 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
#endif /* HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
gnutls_transport_set_push_function(http->tls, http_gnutls_write);
/*
* Enforce a minimum timeout of 10 seconds for the TLS handshake...
*/
old_timeout = http->timeout_value;
old_cb = http->timeout_cb;
old_data = http->timeout_data;
if (!old_cb || old_timeout < 10.0)
{
DEBUG_puts("4_httpTLSStart: Setting timeout to 10 seconds.");
httpSetTimeout(http, 10.0, NULL, NULL);
}
/*
* Do the TLS handshake...
*/
while ((status = gnutls_handshake(http->tls)) != GNUTLS_E_SUCCESS)
{
DEBUG_printf(("5_httpStartTLS: gnutls_handshake returned %d (%s)",
@@ -1595,10 +1626,18 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
free(credentials);
http->tls = NULL;
httpSetTimeout(http, old_timeout, old_cb, old_data);
return (-1);
}
}
/*
* Restore the previous timeout settings...
*/
httpSetTimeout(http, old_timeout, old_cb, old_data);
http->tls_credentials = credentials;
return (0);
+2 -2
Ver Arquivo
@@ -2,7 +2,7 @@
* TLS support for CUPS on Windows using the Security Support Provider
* Interface (SSPI).
*
* Copyright 2010-2017 by Apple Inc.
* Copyright 2010-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
@@ -970,7 +970,7 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
* Server: determine hostname to use...
*/
if (http->fields[HTTP_FIELD_HOST][0])
if (http->fields[HTTP_FIELD_HOST])
{
/*
* Use hostname for TLS upgrade...
+1 -1
Ver Arquivo
@@ -30,7 +30,7 @@
/*
* Local functions...
* Include platform-specific TLS code...
*/
#ifdef HAVE_SSL
+15
Ver Arquivo
@@ -37,6 +37,8 @@ main(int argc, /* I - Number of command-line arguments */
http_t *http; /* HTTP connection */
const char *server = NULL; /* Hostname from command-line */
int port = 0; /* Port number */
cups_array_t *creds; /* Server credentials */
char creds_str[2048]; /* Credentials string */
const char *cipherName = "UNKNOWN";/* Cipher suite name */
int dhBits = 0; /* Diffie-Hellman bits */
int tlsVersion = 0; /* TLS version number */
@@ -154,6 +156,16 @@ main(int argc, /* I - Number of command-line arguments */
return (1);
}
if (httpCopyCredentials(http, &creds))
{
strlcpy(creds_str, "Unable to get server X.509 credentials.", sizeof(creds_str));
}
else
{
httpCredentialsString(creds, creds_str, sizeof(creds_str));
httpFreeCredentials(creds);
}
#ifdef __APPLE__
SSLProtocol protocol;
SSLCipherSuite cipher;
@@ -691,6 +703,8 @@ main(int argc, /* I - Number of command-line arguments */
else
printf("%s: OK (TLS: %d.%d, %s)\n", server, tlsVersion / 10, tlsVersion % 10, cipherName);
printf(" %s\n", creds_str);
if (verbose)
{
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipps", NULL, host, port, resource);
@@ -714,6 +728,7 @@ main(int argc, /* I - Number of command-line arguments */
}
ippDelete(response);
puts("");
}
httpClose(http);
+2
Ver Arquivo
@@ -1160,8 +1160,10 @@ cups_init_client_conf(
memset(cc, 0, sizeof(_cups_client_conf_t));
#ifdef HAVE_SSL
cc->ssl_min_version = _HTTP_TLS_1_0;
cc->ssl_max_version = _HTTP_TLS_MAX;
#endif /* HAVE_SSL */
cc->encryption = (http_encryption_t)-1;
cc->trust_first = -1;
cc->any_root = -1;
+10 -49
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Printing utilities for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -21,19 +22,6 @@
#endif /* WIN32 || __EMX__ */
/*
* Enumeration data and callback...
*/
typedef struct _cups_createdata_s
{
const char *name; /* Destination name */
cups_dest_t *dest; /* Matching destination */
} _cups_createdata_t;
static int cups_create_cb(_cups_createdata_t *data, unsigned flags, cups_dest_t *dest);
/*
* 'cupsCancelJob()' - Cancel a print job on the default server.
*
@@ -168,7 +156,7 @@ cupsCreateJob(
{
int job_id = 0; /* job-id value */
ipp_status_t status; /* Create-Job status */
_cups_createdata_t data; /* Enumeration data */
cups_dest_t *dest; /* Destination */
cups_dinfo_t *info; /* Destination information */
@@ -188,12 +176,7 @@ cupsCreateJob(
* Lookup the destination...
*/
data.name = name;
data.dest = NULL;
cupsEnumDests(0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_create_cb, &data);
if (!data.dest)
if ((dest = cupsGetNamedDest(http, name, NULL)) == NULL)
{
DEBUG_puts("1cupsCreateJob: Destination not found.");
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
@@ -205,18 +188,18 @@ cupsCreateJob(
*/
DEBUG_puts("1cupsCreateJob: Querying destination info.");
if ((info = cupsCopyDestInfo(http, data.dest)) == NULL)
if ((info = cupsCopyDestInfo(http, dest)) == NULL)
{
DEBUG_puts("1cupsCreateJob: Query failed.");
cupsFreeDests(1, data.dest);
cupsFreeDests(1, dest);
return (0);
}
status = cupsCreateDestJob(http, data.dest, info, &job_id, title, num_options, options);
status = cupsCreateDestJob(http, dest, info, &job_id, title, num_options, options);
DEBUG_printf(("1cupsCreateJob: cupsCreateDestJob returned %04x (%s)", status, ippErrorString(status)));
cupsFreeDestInfo(info);
cupsFreeDests(1, data.dest);
cupsFreeDests(1, dest);
/*
* Return the job...
@@ -968,25 +951,3 @@ cupsStartDocument(
return (status);
}
/*
* 'cups_create_cb()' - Find the destination for printing.
*/
static int /* O - 0 on match */
cups_create_cb(
_cups_createdata_t *data, /* I - Data from cupsCreateJob call */
unsigned flags, /* I - Enumeration flags */
cups_dest_t *dest) /* I - Destination */
{
DEBUG_printf(("2cups_create_cb(data=%p(%s), flags=%08x, dest=%p(%s))", (void *)data, data->name, flags, (void *)dest, dest->name));
(void)flags;
if (dest->instance || strcasecmp(data->name, dest->name))
return (1);
cupsCopyDest(dest, 0, &data->dest);
return (0);
}
+5 -2
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* API versioning definitions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright © 2007-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_VERSIONING_H_
@@ -65,6 +66,7 @@
# define _CUPS_API_2_0 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
# define _CUPS_API_2_2 AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
# define _CUPS_API_2_2_4 AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
# define _CUPS_API_2_2_7
# define _CUPS_API_2_3
# else
# define _CUPS_API_1_1_19
@@ -79,6 +81,7 @@
# define _CUPS_API_2_0
# define _CUPS_API_2_2
# define _CUPS_API_2_2_4
# define _CUPS_API_2_2_7
# define _CUPS_API_2_3
# endif /* __APPLE__ && !_CUPS_SOURCE */

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