Comparar commits
149 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 58c3683023 | |||
| 303be29243 | |||
| 275af5ac7b | |||
| d821d89415 | |||
| 6579c998c4 | |||
| 1377fb858c | |||
| f9ee3b81e1 | |||
| 7e50a735a8 | |||
| 56b62a3b54 | |||
| 02773ede84 | |||
| ec9996719f | |||
| affaf0737f | |||
| 49fa4983f2 | |||
| 34be0e8038 | |||
| ce0d9679a4 | |||
| fad821594f | |||
| f8913c6d2c | |||
| a75c0e5961 | |||
| 5ee613bbc6 | |||
| 02c88e673e | |||
| 46a7b416ee | |||
| c61b78bd84 | |||
| 0ae5b012b2 | |||
| 15bba96c30 | |||
| bea3713442 | |||
| 5639a7b41c | |||
| 360e815a88 | |||
| c00282bb43 | |||
| 3a16bd9c9d | |||
| a7cdcd19b8 | |||
| 79424d8b9a | |||
| 5889fea75a | |||
| 16389be3ba | |||
| f97678f279 | |||
| 979804902c | |||
| b889560c05 | |||
| c9e9d0e810 | |||
| a5dd746bd0 | |||
| 6b33281c3e | |||
| 9554d4e748 | |||
| c0a47c1101 | |||
| 4cf66fef48 | |||
| b17b635a37 | |||
| 5d8b7d2665 | |||
| e4e371946b | |||
| 46d22fe908 | |||
| 9d4ae311cb | |||
| 2cf3a36a4e | |||
| fd2f0a7af7 | |||
| aa2a77dec8 | |||
| f0f4e0366c | |||
| 4279822fe4 | |||
| c6990c1ed5 | |||
| c31737b031 | |||
| 2d947886ad | |||
| 116c301f23 | |||
| b908d72cac | |||
| 2cb1fda9fe | |||
| 0728c89bcf | |||
| 123cfe0202 | |||
| d2123aee55 | |||
| ea4dcf9ff4 | |||
| b39dd420c6 | |||
| 5614f45d77 | |||
| 5229ea1a41 | |||
| b72c5bf2ed | |||
| befbadcef6 | |||
| 7b0a28e38f | |||
| e78c14f7ea | |||
| e146105294 | |||
| e37405ea8e | |||
| 5535551fd9 | |||
| 7f14a29798 | |||
| 4b16c717e5 | |||
| 240a27f93b | |||
| 75e1a17cad | |||
| 40cc612af4 | |||
| 9449dd948a | |||
| 2793a478d0 | |||
| 5b6caf71b8 | |||
| b10aebb1d3 | |||
| 9964a31a77 | |||
| 7c7347a346 | |||
| b337f966e8 | |||
| e9b2d701da | |||
| 91d748b919 | |||
| fa76bc3dc0 | |||
| 4f272af7bb | |||
| b770b18d0f | |||
| b0a1b229b3 | |||
| 997db40489 | |||
| 07911378c0 | |||
| 345e10ca71 | |||
| 41c0a57318 | |||
| 10f9350b7e | |||
| 03bc3ef4c2 | |||
| 7e7a13a32e | |||
| 60716f946c | |||
| e34d348250 | |||
| ada3421240 | |||
| a2a13afb48 | |||
| 259b03bc46 | |||
| a375587b8c | |||
| 0bc1a539f4 | |||
| 86390cbf57 | |||
| ced9dda826 | |||
| e9faaeef18 | |||
| c9dbe83d17 | |||
| e3b9d1f520 | |||
| 9f573d7be9 | |||
| 5cc8588e8c | |||
| f198f7e1e7 | |||
| 5e59cd062f | |||
| bee711586d | |||
| e7729c5a14 | |||
| 9eb416ee89 | |||
| b74b285e47 | |||
| 48dfd9a9a2 | |||
| 4174429905 | |||
| 13be9452da | |||
| a9357c9da4 | |||
| 44b3f16133 | |||
| c536b6c583 | |||
| 03d3907a33 | |||
| 76ae98d657 | |||
| 6d086e08e4 | |||
| 49f495c32e | |||
| f8a5ad9bde | |||
| 07cb72471a | |||
| b94f7488e8 | |||
| d2d605ff77 | |||
| 6eda776e8a | |||
| a621d151e7 | |||
| 3a1e6b10c5 | |||
| 7a0e5acde2 | |||
| c5755caf42 | |||
| e44bdfe7e3 | |||
| b2f85109da | |||
| fb963b8dd1 | |||
| fdc80a913f | |||
| 1a9743f9d7 | |||
| 534dfe8e94 | |||
| f1175a5a9d | |||
| db5424ea51 | |||
| cac6b6562c | |||
| b67c2dd202 | |||
| b3f6f8d202 | |||
| 4fac83763d | |||
| 2650d637dc |
@@ -49,6 +49,7 @@ cups/testcreds
|
||||
cups/testcups
|
||||
cups/testdest
|
||||
cups/testfile
|
||||
cups/testgetdests
|
||||
cups/testhttp
|
||||
cups/testi18n
|
||||
cups/testipp
|
||||
@@ -70,6 +71,7 @@ filter/rastertohp
|
||||
filter/rastertolabel
|
||||
filter/rastertopwg
|
||||
filter/test.raster
|
||||
filter/testclient
|
||||
filter/testraster
|
||||
locale/checkpo
|
||||
locale/po2strings
|
||||
|
||||
+91
-9
@@ -1,7 +1,89 @@
|
||||
CHANGES - 2.2.4 - 2017-06-30
|
||||
CHANGES - 2.2.6 - 2017-11-01
|
||||
============================
|
||||
|
||||
CHANGES IN CUPS V2.2.4
|
||||
|
||||
Changes in CUPS v2.2.6
|
||||
----------------------
|
||||
|
||||
- DBUS notifications could crash the scheduler (Issue #5143)
|
||||
- Added USB quirks rules for Canon MP540 and Samsung ML-2160 (Issue #5148)
|
||||
- Fixed TLS cipher suite selection with GNU TLS (Issue #5145, Issue #5150)
|
||||
- Localization updates (Issue #5152)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.5
|
||||
----------------------
|
||||
|
||||
- The scheduler's `-t` option did not force all errors to the standard error
|
||||
file, making debugging of configuration problems hard (Issue #5041)
|
||||
- Fixed a typo in the CUPS Programming Manual (Issue #5042)
|
||||
- Fixed RPM packaging issue (Issue #5043, Issue #5044)
|
||||
- The `cupsGetDests` function incorrectly returned an empty list of printers if
|
||||
there was no default printer (Issue #5046)
|
||||
- The `cupsGetDests` function waited too long for network printers (Issue #5049)
|
||||
- Libtool support was completely broken with current libtool versions that use
|
||||
an incompatible command-line syntax (Issue #5050)
|
||||
- Fixed a build issue with `--enable-mallinfo` (Issue #5051)
|
||||
- The ippserver test program contained a deadlock issue (Issue #5054)
|
||||
- The `cupsLocalizeDest*` functions did not provide base localizations for
|
||||
all registered IPP attributes and values (Issue #5056)
|
||||
- The --enable-libtool configure option requires a path to the libtool program,
|
||||
but doesn't document or check for it (Issue #5062)
|
||||
- Fixed the `SSLOptions DenyCBC` option when using GNU TLS (Issue #5065)
|
||||
- Fixed the `ServerTokens None` option (Issue #5065)
|
||||
- Fixed the default `ServerAlias` value from `ServerName` (Issue #5072)
|
||||
- Fixed the adminurl field in the TXT record for fully-qualified `ServerName`
|
||||
values (Issue #5074)
|
||||
- The scheduler now creates a PID file when not running on demand with a modern
|
||||
service launcher (Issue #5080)
|
||||
- The web interface did not support newer language identifiers used by Microsoft
|
||||
web browsers (Issue #5803)
|
||||
- Updated the cups-files.conf and cupsd.conf file documentation for missing
|
||||
directives (Issue #5084)
|
||||
- Fixed an Avahi-related crash bug in the scheduler (Issue #5085, Issue #5086)
|
||||
- Fixed the interactions between the "print-quality" and "cupsPrintQuality"
|
||||
options (Issue #5090)
|
||||
- The IPP Everywhere PPD generator now sorts the supported resolutions before
|
||||
choosing them for draft, normal, and best quality modes (Issue #5091)
|
||||
- Fixed the localization unit test on Linux (Issue #5097)
|
||||
- The CUPS library did not reuse domain sockets (Issue #5098)
|
||||
- Fixed the "make check" target for some environments (Issue #5099)
|
||||
- The scheduler woke up once per second to remove old temporary queues
|
||||
(Issue #5100)
|
||||
- Added USB quirk rule for Kyocera printer (Issue #5102, Issue #5103)
|
||||
- Re-documented the limits of `file:///...` device URIs and moved the FileDevice
|
||||
directive in `cups-files.conf` to the list of deprecated configuration
|
||||
directives (Issue #5117)
|
||||
- Added USB quirk rule for HP LaserJet 1160 printer (Issue #5121)
|
||||
- Fixed the script interpreter detection in the configure script (Issue #5122)
|
||||
- The network backends now retry on more error conditions (Issue #5123)
|
||||
- Added a French translation of the web interface (Issue #5134)
|
||||
- `cupsGetDests2` was not using the supplied HTTP connection (Issue #5135)
|
||||
- `httpAddrConnect` leaked sockets in certain circumstances, causing some
|
||||
printers to hang (rdar://31965686)
|
||||
- Fixed an issue with Chinese localizations on macOS (rdar://32419311)
|
||||
- The IPP backend now always sends the "finishings" attribute for printers that
|
||||
support it because otherwise the client cannot override printer defaults
|
||||
(rdar://33169732)
|
||||
- The `cupsGetNamedDest` function did not use the local default printer
|
||||
(rdar://33228500)
|
||||
- The IPP backend incorrectly sent the "job-pages-per-set" attribute to PDF
|
||||
printers (rdar://33250434)
|
||||
- Fixed the `cups.strings` file that is used on macOS (rdar://33287650)
|
||||
- CUPS now sends the `Date` HTTP header in IPP requests (rdar://33302034)
|
||||
- The `ippCopyAttribute` function did not copy out-of-band values correctly
|
||||
(rdar://33688003)
|
||||
- Fixed the localization fallback code on macOS (rdar://33583699)
|
||||
- The scheduler did not run with a high enough priority, causing problems on
|
||||
busy systems (rdar://33789342)
|
||||
- Added support for Japanese Kaku 1 envelope size (rdar://34774110)
|
||||
- The `ipptool` program's `-P` option did not work correctly.
|
||||
- The `ipptool` program did not compare URI scheme or hostname components
|
||||
correctly for the WITH-ALL-HOSTNAMES, WITH-ALL-SCHEMES, WITH-HOSTNAME, or
|
||||
WITH-SCHEME predicates.
|
||||
|
||||
|
||||
Changes in CUPS v2.2.4
|
||||
----------------------
|
||||
|
||||
- The scheduler did not remove old job files (Issue #4987)
|
||||
@@ -39,7 +121,7 @@ CHANGES IN CUPS V2.2.4
|
||||
`DenyCBC` and `DenyTLS1.0` options (Issue #5037)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2.3
|
||||
Changes in CUPS v2.2.3
|
||||
----------------------
|
||||
|
||||
- The IPP backend could get into an infinite loop for certain errors, causing a
|
||||
@@ -67,7 +149,7 @@ CHANGES IN CUPS V2.2.3
|
||||
- Fixed some localization issues on macOS (<rdar://problem/27245567>)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2.2
|
||||
Changes in CUPS v2.2.2
|
||||
----------------------
|
||||
|
||||
- Fixed some issues with the Zebra ZPL printer driver (Issue #4898)
|
||||
@@ -97,7 +179,7 @@ CHANGES IN CUPS V2.2.2
|
||||
- Updated packaging files (Issue #4940)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2.1
|
||||
Changes in CUPS v2.2.1
|
||||
----------------------
|
||||
|
||||
- Added "CreateSelfSignedCerts" directive for cups-files.conf to control whether
|
||||
@@ -111,7 +193,7 @@ CHANGES IN CUPS V2.2.1
|
||||
- Updated localizations (PR #4877, PR #4886)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2.0
|
||||
Changes in CUPS v2.2.0
|
||||
----------------------
|
||||
|
||||
- Normalized the TLS certificate validation code and added additional error
|
||||
@@ -122,7 +204,7 @@ CHANGES IN CUPS V2.2.0
|
||||
- http*Connect did not return early when all addresses failed (Issue #4870)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2rc1
|
||||
Changes in CUPS v2.2rc1
|
||||
-----------------------
|
||||
|
||||
- Updated the list of supported IPP Everywhere media types.
|
||||
@@ -135,14 +217,14 @@ CHANGES IN CUPS V2.2rc1
|
||||
- Updated localizations (Issue #4846, PR #4858)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2b2
|
||||
Changes in CUPS v2.2b2
|
||||
----------------------
|
||||
|
||||
- Added Upstart support (PR #4825)
|
||||
- CUPS now supports Let's Encrypt certificates on Linux.
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.2b1
|
||||
Changes in CUPS v2.2b1
|
||||
----------------------
|
||||
|
||||
- All CUPS commands now support POSIX options (Issue #4813)
|
||||
|
||||
+34
-22
@@ -1,14 +1,28 @@
|
||||
INSTALL - CUPS v2.2.4 - 2017-06-30
|
||||
INSTALL - CUPS v2.2.6 - 2017-11-01
|
||||
==================================
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
information on CUPS see the file called "README.txt". A complete change log can
|
||||
be found in "CHANGES.txt".
|
||||
information on CUPS see the file called "README.md". A complete change log can
|
||||
be found in "CHANGES.md".
|
||||
|
||||
> USING CUPS REQUIRES ADDITIONAL THIRD-PARTY SUPPORT SOFTWARE AND PRINTER
|
||||
> DRIVERS. THESE ARE TYPICALLY INCLUDED WITH YOUR OPERATING SYSTEM
|
||||
> DISTRIBUTION. APPLE DOES NOT ENDORSE OR SUPPORT THIRD-PARTY SUPPORT SOFTWARE
|
||||
> FOR CUPS.
|
||||
Using CUPS requires additional third-party support software and printer drivers.
|
||||
These are typically included with your operating system distribution. Apple
|
||||
does not endorse or support third-party support software for CUPS.
|
||||
|
||||
> Note: Current versions of macOS DO NOT allow installation to /usr with the
|
||||
> default System Integrity Protection (SIP) settings. In addition, we do not
|
||||
> recommend replacing the CUPS supplied with macOS because:
|
||||
>
|
||||
> a. not all versions of CUPS are compatible with every macOS release,
|
||||
>
|
||||
> b. code signing prevents replacement of system libraries and access to the
|
||||
> system keychain (needed for encrypted printer sharing), and
|
||||
>
|
||||
> c. software updates will often replace parts of your local installation,
|
||||
> potentially rendering your system unusable.
|
||||
>
|
||||
> Apple only supports using the Clang supplied with Xcode to build CUPS on
|
||||
> macOS.
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
@@ -52,12 +66,15 @@ main CUPS source directory. To configure CUPS for your system, type:
|
||||
|
||||
The default installation will put the CUPS software in the "/etc", "/usr", and
|
||||
"/var" directories on your system, which will overwrite any existing printing
|
||||
commands on your system. Use the "--prefix" option to install the CUPS software
|
||||
commands on your system. Use the `--prefix` option to install the CUPS software
|
||||
in another location:
|
||||
|
||||
./configure --prefix=/some/directory
|
||||
|
||||
To see a complete list of configuration options, use the --help option:
|
||||
> Note: Current versions of macOS DO NOT allow installation to /usr with the
|
||||
> default System Integrity Protection (SIP) settings.
|
||||
|
||||
To see a complete list of configuration options, use the `--help` option:
|
||||
|
||||
./configure --help
|
||||
|
||||
@@ -82,26 +99,20 @@ or:
|
||||
LDFLAGS="-L/some/directory" \
|
||||
./configure ...
|
||||
|
||||
The "--enable-debug" option compiles CUPS with debugging information enabled.
|
||||
The `--enable-debug` option compiles CUPS with debugging information enabled.
|
||||
Additional debug logging support can be enabled using the
|
||||
"--enable-debug-printfs" option - these debug messages are enabled using the
|
||||
CUPS_DEBUG_LOG environment variable at run-time.
|
||||
`--enable-debug-printfs` option - these debug messages are enabled using the
|
||||
`CUPS_DEBUG_xxx` environment variables at run-time.
|
||||
|
||||
CUPS also includes an extensive set of unit tests that can be used to find and
|
||||
diagnose a variety of common problems - use the "--enable-unit-tests" configure
|
||||
option to run them at build time.
|
||||
|
||||
On macOS, use the "--with-archflags" option to build with the correct set of
|
||||
On macOS, use the `--with-archflags` option to build with the correct set of
|
||||
architectures:
|
||||
|
||||
./configure --with-archflags="-arch i386 -arch x86_64" ...
|
||||
|
||||
> Note: Current versions of macOS DO NOT allow installation to /usr with the
|
||||
> default system integrity settings. In addition, we do not recommend replacing
|
||||
> the CUPS supplied with macOS because not all versions of CUPS are compatible
|
||||
> with every macOS release, and because software updates will replace parts
|
||||
> of your local installation potentially rendering your system unusable.
|
||||
|
||||
Once you have configured things, just type:
|
||||
|
||||
make ENTER
|
||||
@@ -184,7 +195,7 @@ for FreeBSD, NetBSD, and OpenBSD. The <format> target is one of the following:
|
||||
GETTING DEBUG LOGGING FROM CUPS
|
||||
-------------------------------
|
||||
|
||||
When configured with the "--enable-debug-printfs" option, CUPS compiles in
|
||||
When configured with the `--enable-debug-printfs` option, CUPS compiles in
|
||||
additional debug logging support in the scheduler, CUPS API, and CUPS Imaging
|
||||
API. The following environment variables are used to enable and control debug
|
||||
logging:
|
||||
@@ -195,13 +206,14 @@ logging:
|
||||
the logging. The default level is 1.
|
||||
- `CUPS_DEBUG_LOG`: Specifies a log file to use. Specify the name "-" to send
|
||||
the messages to stderr. Prefix a filename with "+" to append to an existing
|
||||
file.
|
||||
file. You can include a single "%d" in the filename to embed the current
|
||||
process ID.
|
||||
|
||||
|
||||
REPORTING PROBLEMS
|
||||
------------------
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! If the documentation does
|
||||
If you have problems, *read the documentation first*! If the documentation does
|
||||
not solve your problems, please post a message on the users forum at:
|
||||
|
||||
https://www.cups.org/
|
||||
|
||||
+14
-4
@@ -11,22 +11,32 @@
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
#
|
||||
# CUPS version...
|
||||
#
|
||||
|
||||
CUPS_VERSION = @CUPS_VERSION@
|
||||
|
||||
|
||||
#
|
||||
# Programs...
|
||||
#
|
||||
|
||||
AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @LIBTOOL@ @CC@
|
||||
CC = @LIBTOOL_CC@ @CC@
|
||||
CHMOD = @CHMOD@
|
||||
CXX = @LIBTOOL@ @CXX@
|
||||
CXX = @LIBTOOL_CXX@ @CXX@
|
||||
DSO = @DSO@
|
||||
DSOXX = @DSOXX@
|
||||
GZIP = @GZIP@
|
||||
INSTALL = @INSTALL@
|
||||
LD = @LD@
|
||||
LD_CC = @LD_CC@
|
||||
LD_CXX = @LD_CXX@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN = @LN@ -sf
|
||||
MKDIR = @MKDIR@ -p
|
||||
MV = @MV@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@ -f
|
||||
@@ -38,12 +48,12 @@ SHELL = /bin/sh
|
||||
# Installation programs...
|
||||
#
|
||||
|
||||
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
|
||||
INSTALL_BIN = @LIBTOOL_INSTALL@ $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
|
||||
INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
|
||||
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
|
||||
INSTALL_DATA = $(INSTALL) -c -m 444
|
||||
INSTALL_DIR = $(INSTALL) -d
|
||||
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
|
||||
INSTALL_LIB = @LIBTOOL_INSTALL@ $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
|
||||
INSTALL_MAN = $(INSTALL) -c -m 444
|
||||
INSTALL_SCRIPT = $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@
|
||||
|
||||
|
||||
+32
-32
@@ -1,7 +1,7 @@
|
||||
README - CUPS v2.2.4 - 2017-06-30
|
||||
README - CUPS v2.2.6 - 2017-11-01
|
||||
=================================
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.md" instead...
|
||||
Looking for compile instructions? Read the file `INSTALL.md` instead...
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
@@ -30,12 +30,10 @@ READING THE DOCUMENTATION
|
||||
-------------------------
|
||||
|
||||
Once you have installed the software you can access the documentation (and a
|
||||
bunch of other stuff) online at:
|
||||
|
||||
http://localhost:631/
|
||||
bunch of other stuff) online at <http://localhost:631/>.
|
||||
|
||||
If you're having trouble getting that far, the documentation is located under
|
||||
the "doc/help" directory.
|
||||
the `doc/help` and `man` directories.
|
||||
|
||||
Please read the documentation before asking questions.
|
||||
|
||||
@@ -43,10 +41,8 @@ Please read the documentation before asking questions.
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
-----------------------------------
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide two mailing
|
||||
lists which are available at:
|
||||
|
||||
https://lists.cups.org/mailman/listinfo
|
||||
If you have problems, *read the documentation first!* We also provide two
|
||||
mailing lists which are available at <https://lists.cups.org/mailman/listinfo>.
|
||||
|
||||
See the CUPS web site at <https://www.cups.org/> for other resources.
|
||||
|
||||
@@ -55,14 +51,12 @@ SETTING UP PRINTER QUEUES USING YOUR WEB BROWSER
|
||||
------------------------------------------------
|
||||
|
||||
CUPS includes a web-based administration tool that allows you to manage
|
||||
printers, classes, and jobs on your server. Open the following URL in your
|
||||
browser to access the printer administration tools:
|
||||
|
||||
http://localhost:631/admin/
|
||||
printers, classes, and jobs on your server. Open <http://localhost:631/admin/>
|
||||
in your browser to access the printer administration tools:
|
||||
|
||||
*Do not* use the hostname for your machine - it will not work with the default
|
||||
CUPS configuration. To enable administration access on other addresses, check
|
||||
the "Allow Remote Administration" box and click on the "Change Settings" button.
|
||||
the `Allow Remote Administration` box and click on the `Change Settings button.
|
||||
|
||||
You will be asked for the administration password (root or any other user in the
|
||||
sys/system/root/admin/lpadmin group on your system) when performing any
|
||||
@@ -72,10 +66,15 @@ administrative function.
|
||||
SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
-----------------------------------------------
|
||||
|
||||
CUPS works best with PPD (PostScript Printer Description) files. In a pinch you
|
||||
can also use System V style printer interface scripts.
|
||||
CUPS currently uses PPD (PostScript Printer Description) files that describe
|
||||
printer capabilities and driver programs needed for each printer. The
|
||||
`everywhere` PPD is used for nearly all modern networks printers sold since
|
||||
about 2009. For example, the following command creates a print queue for a
|
||||
printer at address 11.22.33.44:
|
||||
|
||||
CUPS includes several sample PPD files you can use:
|
||||
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
|
||||
|
||||
CUPS also includes several sample PPD files you can use for "legacy" printers:
|
||||
|
||||
Driver PPD Name
|
||||
----------------------------- ------------------------------
|
||||
@@ -94,41 +93,42 @@ CUPS includes several sample PPD files you can use:
|
||||
Zebra EPL2 Label Printer drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer drv:///sample.drv/zebra.ppd
|
||||
|
||||
Run the "lpinfo -m" command to list the available drivers:
|
||||
You can run the `lpinfo -m` command to list all of the available drivers:
|
||||
|
||||
lpinfo -m
|
||||
|
||||
Run the "lpinfo -v" command to list the available printers:
|
||||
Run the `lpinfo -v` command to list the available printers:
|
||||
|
||||
lpinfo -v
|
||||
|
||||
Then use the correct URI to add the printer using the "lpadmin" command:
|
||||
Then use the correct URI to add the printer using the `lpadmin` command:
|
||||
|
||||
lpadmin -p printername -E -v device-uri -m ppd-name
|
||||
|
||||
Network printers typically use "socket" or "lpd" URIs:
|
||||
Current network printers typically use `ipp` or `ipps` URIS:
|
||||
|
||||
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
|
||||
lpadmin -p printername -E -v ipps://11.22.33.44/ipp/print -m everywhere
|
||||
|
||||
Older network printers typically use `socket` or `lpd` URIs:
|
||||
|
||||
lpadmin -p printername -E -v socket://11.22.33.44 -m ppd-name
|
||||
lpadmin -p printername -E -v lpd://11.22.33.44/ -m ppd-name
|
||||
|
||||
The sample drivers provide basic printing capabilities, but generally do not
|
||||
exercise the full potential of the printers or CUPS.
|
||||
|
||||
CUPS also supports IPP Everywhere printers using the "everywhere" model, for
|
||||
example:
|
||||
|
||||
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
|
||||
exercise the full potential of the printers or CUPS. Other drivers provide
|
||||
greater printing capabilities.
|
||||
|
||||
|
||||
PRINTING FILES
|
||||
--------------
|
||||
|
||||
CUPS provides both the System V "lp" and Berkeley "lpr" commands for printing:
|
||||
CUPS provides both the System V `lp` and Berkeley `lpr` commands for printing:
|
||||
|
||||
lp filename
|
||||
lpr filename
|
||||
|
||||
Both the "lp" and "lpr" commands support printing options for the driver:
|
||||
Both the `lp` and `lpr` commands support printing options for the driver:
|
||||
|
||||
lp -o media=A4 -o resolution=600dpi filename
|
||||
lpr -o media=A4 -o resolution=600dpi filename
|
||||
@@ -137,7 +137,7 @@ CUPS recognizes many types of images files as well as PDF, PostScript, and text
|
||||
files, so you can print those files directly rather than through an application.
|
||||
|
||||
If you have an application that generates output specifically for your printer
|
||||
then you need to use the "-oraw" or "-l" options:
|
||||
then you need to use the `-oraw` or `-l` options:
|
||||
|
||||
lp -o raw filename
|
||||
lpr -l filename
|
||||
@@ -157,4 +157,4 @@ CUPS is provided under the terms of version 2 of the GNU General Public License
|
||||
and GNU Library General Public License. This program is distributed in the hope
|
||||
that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
"doc/help/license.html" or "LICENSE.txt" files for more information.
|
||||
`doc/help/license.html` or `LICENSE.txt` files for more information.
|
||||
|
||||
+12
-12
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Backend makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -24,7 +24,7 @@ include ../Makedefs
|
||||
# UBACKENDS and ULBACKENDS are installed mode 0755 so cupsd will run them as
|
||||
# an unprivileged user...
|
||||
#
|
||||
# See http://www.cups.org/documentation.php/api-filter.html for more info...
|
||||
# See http://www.cups.org/doc/api-filter.html for more info...
|
||||
RBACKENDS = \
|
||||
ipp \
|
||||
lpd \
|
||||
@@ -207,7 +207,7 @@ uninstall:
|
||||
|
||||
test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
|
||||
$(LD_CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
|
||||
@@ -249,7 +249,7 @@ libbackend.a: $(LIBOBJS)
|
||||
|
||||
dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
|
||||
if test `uname` = Darwin; then \
|
||||
$(RM) mdns; \
|
||||
$(LN) dnssd mdns; \
|
||||
@@ -262,7 +262,7 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
|
||||
$(RM) http
|
||||
$(LN) ipp http
|
||||
|
||||
@@ -273,7 +273,7 @@ ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -282,7 +282,7 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -291,11 +291,11 @@ snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
socket: socket.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
|
||||
|
||||
socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
|
||||
$(LD_CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
|
||||
@@ -306,7 +306,7 @@ socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
|
||||
|
||||
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
|
||||
$(BACKLIBS) $(LIBS)
|
||||
usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
|
||||
|
||||
|
||||
+2
-3
@@ -743,8 +743,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
|
||||
if (errno == ECONNREFUSED || errno == EHOSTDOWN ||
|
||||
errno == EHOSTUNREACH)
|
||||
if (errno == ECONNREFUSED || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == ETIMEDOUT || errno == ENOTCONN)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
@@ -763,13 +762,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
|
||||
case EHOSTUNREACH :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is unreachable at this "
|
||||
"time."));
|
||||
break;
|
||||
|
||||
case ECONNREFUSED :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is in use."));
|
||||
break;
|
||||
|
||||
+2
-3
@@ -867,8 +867,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(error));
|
||||
|
||||
if (error == ECONNREFUSED || error == EHOSTDOWN ||
|
||||
error == EHOSTUNREACH)
|
||||
if (errno == ECONNREFUSED || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == ETIMEDOUT || errno == ENOTCONN)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
@@ -886,13 +885,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
break;
|
||||
|
||||
case EHOSTUNREACH :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is unreachable at "
|
||||
"this time."));
|
||||
break;
|
||||
|
||||
case ECONNREFUSED :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is in use."));
|
||||
break;
|
||||
|
||||
@@ -76,6 +76,9 @@
|
||||
# Canon, Inc. MP510 Printer (https://bugs.launchpad.net/bugs/1050009)
|
||||
0x04a9 0x1717 unidir
|
||||
|
||||
# Canon, Inc. MP540 Printer, https://bugzilla.redhat.com/967873
|
||||
0x04a9 0x1730 unidir
|
||||
|
||||
# Canon, Inc. MP550 Printer (Issue #4155)
|
||||
0x04a9 0x173d unidir
|
||||
|
||||
@@ -127,6 +130,9 @@
|
||||
# All Samsung devices (https://bugs.launchpad.net/bugs/1032456)
|
||||
0x04e8 soft-reset
|
||||
|
||||
# Samsung ML-2160 Series (https://bugzilla.redhat.com/show_bug.cgi?id=873123)
|
||||
0x04e8 0x330f unidir
|
||||
|
||||
# All Zebra devices (https://bugs.launchpad.net/bugs/1001028)
|
||||
0x0a5f unidir
|
||||
|
||||
@@ -251,5 +257,11 @@
|
||||
# Kyocera Ecosys P6026cdn (Issue #4900)
|
||||
0x0482 0x063f no-reattach
|
||||
|
||||
# Kyocera Ecosys P6130cdn (Issue #5102)
|
||||
0x0482 0x0677 no-reattach
|
||||
|
||||
# Lexmark E260dn (Issue #4994)
|
||||
0x043d 0x0123 no-reattach
|
||||
|
||||
# HP LaserJet 1160 (Issue #5121)
|
||||
0x03f0 0x1e17 delay-close
|
||||
|
||||
+2
-3
@@ -330,8 +330,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(error));
|
||||
|
||||
if (error == ECONNREFUSED || error == EHOSTDOWN ||
|
||||
error == EHOSTUNREACH)
|
||||
if (errno == ECONNREFUSED || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == ETIMEDOUT || errno == ENOTCONN)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
@@ -349,13 +348,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
|
||||
case EHOSTUNREACH :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is unreachable at this "
|
||||
"time."));
|
||||
break;
|
||||
|
||||
case ECONNREFUSED :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is in use."));
|
||||
break;
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Berkeley commands makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -124,7 +124,7 @@ uninstall:
|
||||
|
||||
lpc: lpc.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -133,7 +133,7 @@ lpc: lpc.o ../cups/$(LIBCUPS)
|
||||
|
||||
lpq: lpq.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -142,7 +142,7 @@ lpq: lpq.o ../cups/$(LIBCUPS)
|
||||
|
||||
lpr: lpr.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -151,7 +151,7 @@ lpr: lpr.o ../cups/$(LIBCUPS)
|
||||
|
||||
lprm: lprm.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
|
||||
+11
-11
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# CGI makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -219,7 +219,7 @@ libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp
|
||||
|
||||
libcupscgi.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
-version-info 1:0 $(LIBS)
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ libcupscgi.a: $(LIBOBJS)
|
||||
|
||||
admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ admin.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ admin.o -lcupscgi $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -249,7 +249,7 @@ admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
|
||||
classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ classes.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ classes.o -lcupscgi $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -258,7 +258,7 @@ classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
|
||||
help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ help.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ help.o -lcupscgi $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -267,7 +267,7 @@ help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
|
||||
jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ jobs.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ jobs.o -lcupscgi $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -276,7 +276,7 @@ jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
|
||||
makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ makedocset.o libcupscgi.a \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ makedocset.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
@@ -287,7 +287,7 @@ makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -296,7 +296,7 @@ printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
|
||||
testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
echo Testing CGI API...
|
||||
@@ -309,7 +309,7 @@ testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
echo Testing help index API...
|
||||
@@ -322,7 +322,7 @@ testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
|
||||
$(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ AC_PATH_PROG(CHMOD,chmod)
|
||||
AC_PATH_PROG(GZIP,gzip)
|
||||
AC_PATH_PROG(LD,ld)
|
||||
AC_PATH_PROG(LN,ln)
|
||||
AC_PATH_PROG(MKDIR,mkdir)
|
||||
AC_PATH_PROG(MV,mv)
|
||||
AC_PATH_PROG(RM,rm)
|
||||
AC_PATH_PROG(RMDIR,rmdir)
|
||||
@@ -305,7 +306,7 @@ fi
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
dnl Check for DBUS support
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
|
||||
DBUSDIR="$withval")
|
||||
|
||||
@@ -388,20 +389,15 @@ case $host_os_name in
|
||||
if test "x$default_adminkey" != xdefault; then
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="$default_adminkey"
|
||||
elif grep -q system.print.operator /etc/authorization; then
|
||||
else
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.print.admin"
|
||||
else
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.preferences"
|
||||
fi
|
||||
|
||||
if test "x$default_operkey" != xdefault; then
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY($default_operkey) @admin @lpadmin"
|
||||
elif grep -q system.print.operator /etc/authorization; then
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
|
||||
else
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
|
||||
fi])
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
|
||||
|
||||
@@ -185,6 +185,15 @@ if test -n "$GCC"; then
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wno-format-truncation)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-format-truncation"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-format-truncation"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
OPTIM="-Werror $OPTIM"
|
||||
|
||||
@@ -38,7 +38,7 @@ if test "x$CUPS_BUNDLEDIR" != x; then
|
||||
fi
|
||||
|
||||
dnl Default executable file permissions
|
||||
AC_ARG_WITH(exe_file_perm, [ --with-exe-file-perm set default exectuable permissions value, default=0555],
|
||||
AC_ARG_WITH(exe_file_perm, [ --with-exe-file-perm set default executable permissions value, default=0555],
|
||||
CUPS_EXE_FILE_PERM="$withval",
|
||||
[case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl Libtool stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -11,9 +11,12 @@ dnl which should have been included with this file. If this file is
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported
|
||||
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported=/path/to/libtool
|
||||
build with libtool (UNSUPPORTED!)],
|
||||
[if test x$enable_libtool_unsupported != xno; then
|
||||
if test x$enable_libtool_unsupported == xyes; then
|
||||
AC_MSG_ERROR([Use --enable-libtool-unsupported=/path/to/libtool.])
|
||||
fi
|
||||
LIBTOOL="$enable_libtool_unsupported"
|
||||
enable_shared=no
|
||||
echo "WARNING: libtool is not supported or endorsed by Apple Inc."
|
||||
@@ -22,12 +25,40 @@ AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported
|
||||
LIBTOOL=""
|
||||
fi])
|
||||
|
||||
AC_SUBST(LIBTOOL)
|
||||
|
||||
if test x$LIBTOOL != x; then
|
||||
DSO="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
|
||||
DSOXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
|
||||
|
||||
LD_CC="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
|
||||
LD_CXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
|
||||
|
||||
LIBCUPS="libcups.la"
|
||||
LIBCUPSSTATIC="libcups.la"
|
||||
LIBCUPSCGI="libcupscgi.la"
|
||||
LIBCUPSIMAGE="libcupsimage.la"
|
||||
LIBCUPSMIME="libcupsmime.la"
|
||||
LIBCUPSPPDC="libcupsppdc.la"
|
||||
|
||||
LIBTOOL_CC="\$(LIBTOOL) --mode=compile --tag=CC"
|
||||
LIBTOOL_CXX="\$(LIBTOOL) --mode=compile --tag=CXX"
|
||||
LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
|
||||
|
||||
LINKCUPS="../cups/\$(LIBCUPS)"
|
||||
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
|
||||
DSO="\$(CC)"
|
||||
|
||||
else
|
||||
LD_CC="\$(CC)"
|
||||
LD_CXX="\$(CXX)"
|
||||
|
||||
LIBTOOL_CC=""
|
||||
LIBTOOL_CXX=""
|
||||
LIBTOOL_INSTALL=""
|
||||
fi
|
||||
|
||||
AC_SUBST(LD_CC)
|
||||
AC_SUBST(LD_CXX)
|
||||
|
||||
AC_SUBST(LIBTOOL)
|
||||
AC_SUBST(LIBTOOL_CC)
|
||||
AC_SUBST(LIBTOOL_CXX)
|
||||
AC_SUBST(LIBTOOL_INSTALL)
|
||||
|
||||
@@ -12,7 +12,7 @@ dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(pam, [ --disable-pam disable PAM support])
|
||||
AC_ARG_WITH(pam_module, [ --with-pam-module specify the PAM module to use])
|
||||
AC_ARG_WITH(pam_module, [ --with-pam-module set the PAM module to use])
|
||||
|
||||
PAMDIR=""
|
||||
PAMFILE="pam.std"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl Scripting configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2010 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -14,11 +14,13 @@ dnl
|
||||
dnl Do we have Java?
|
||||
AC_ARG_WITH(java, [ --with-java set Java interpreter for web interfaces ],
|
||||
CUPS_JAVA="$withval",
|
||||
CUPS_JAVA="")
|
||||
CUPS_JAVA="auto")
|
||||
|
||||
if test "x$CUPS_JAVA" = x; then
|
||||
if test "x$CUPS_JAVA" = xauto; then
|
||||
AC_PATH_PROG(JAVA,java)
|
||||
CUPS_JAVA="$JAVA"
|
||||
elif test "x$CUPS_JAVA" = xno; then
|
||||
CUPS_JAVA=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_JAVA, "$CUPS_JAVA")
|
||||
@@ -30,11 +32,13 @@ fi
|
||||
dnl Do we have Perl?
|
||||
AC_ARG_WITH(perl, [ --with-perl set Perl interpreter for web interfaces ],
|
||||
CUPS_PERL="$withval",
|
||||
CUPS_PERL="")
|
||||
CUPS_PERL="auto")
|
||||
|
||||
if test "x$CUPS_PERL" = x; then
|
||||
if test "x$CUPS_PERL" = xauto; then
|
||||
AC_PATH_PROG(PERL,perl)
|
||||
CUPS_PERL="$PERL"
|
||||
elif test "x$CUPS_PERL" = xno; then
|
||||
CUPS_PERL=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PERL, "$CUPS_PERL")
|
||||
@@ -46,9 +50,9 @@ fi
|
||||
dnl Do we have PHP?
|
||||
AC_ARG_WITH(php, [ --with-php set PHP interpreter for web interfaces ],
|
||||
CUPS_PHP="$withval",
|
||||
CUPS_PHP="")
|
||||
CUPS_PHP="auto")
|
||||
|
||||
if test "x$CUPS_PHP" = x; then
|
||||
if test "x$CUPS_PHP" = xauto; then
|
||||
AC_PATH_PROG(PHPCGI,php-cgi)
|
||||
if test "x$PHPCGI" = x; then
|
||||
AC_PATH_PROG(PHP,php)
|
||||
@@ -56,6 +60,8 @@ if test "x$CUPS_PHP" = x; then
|
||||
else
|
||||
CUPS_PHP="$PHPCGI"
|
||||
fi
|
||||
elif test "x$CUPS_PHP" = xno; then
|
||||
CUPS_PHP=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PHP, "$CUPS_PHP")
|
||||
@@ -69,11 +75,13 @@ fi
|
||||
dnl Do we have Python?
|
||||
AC_ARG_WITH(python, [ --with-python set Python interpreter for web interfaces ],
|
||||
CUPS_PYTHON="$withval",
|
||||
CUPS_PYTHON="")
|
||||
CUPS_PYTHON="auto")
|
||||
|
||||
if test "x$CUPS_PYTHON" = x; then
|
||||
if test "x$CUPS_PYTHON" = xauto; then
|
||||
AC_PATH_PROG(PYTHON,python)
|
||||
CUPS_PYTHON="$PYTHON"
|
||||
elif test "x$CUPS_PYTHON" = xno; then
|
||||
CUPS_PYTHON=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PYTHON, "$CUPS_PYTHON")
|
||||
|
||||
@@ -61,7 +61,6 @@ if test x$enable_ssl != xno; then
|
||||
dnl Then look for GNU TLS...
|
||||
if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then
|
||||
AC_PATH_TOOL(LIBGNUTLSCONFIG,libgnutls-config)
|
||||
AC_PATH_TOOL(LIBGCRYPTCONFIG,libgcrypt-config)
|
||||
if $PKGCONFIG --exists gnutls; then
|
||||
have_ssl=1
|
||||
SSLLIBS=`$PKGCONFIG --libs gnutls`
|
||||
|
||||
@@ -78,7 +78,7 @@ if test x$enable_systemd != xno; then
|
||||
fi
|
||||
|
||||
dnl Upstart is also used on Linux (e.g., Chrome OS)
|
||||
AC_ARG_ENABLE(upstart, [ --enable-upstart enable upstart support])
|
||||
AC_ARG_ENABLE(upstart, [ --enable-upstart enable upstart support])
|
||||
if test "x$enable_upstart" = "xyes"; then
|
||||
if test "x$have_systemd" = "xyes"; then
|
||||
AC_MSG_ERROR(Cannot support both systemd and upstart.)
|
||||
|
||||
externo
+259
-245
@@ -1,13 +1,11 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.68 for CUPS 2.2.4.
|
||||
# Generated by GNU Autoconf 2.69 for CUPS 2.2.6.
|
||||
#
|
||||
# Report bugs to <https://github.com/apple/cups/issues>.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||
#
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
@@ -136,6 +134,31 @@ 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
|
||||
@@ -169,7 +192,8 @@ 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\$exitcode = x0 || exit 1
|
||||
test -x / || 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'\" &&
|
||||
@@ -214,21 +238,25 @@ IFS=$as_save_IFS
|
||||
|
||||
|
||||
if test "x$CONFIG_SHELL" != x; then :
|
||||
# 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+"$@"}
|
||||
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
|
||||
fi
|
||||
|
||||
if test x$as_have_required = xno; then :
|
||||
@@ -331,6 +359,14 @@ $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
|
||||
@@ -452,6 +488,10 @@ 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).
|
||||
@@ -486,16 +526,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 -p'.
|
||||
# In both cases, we have to default to `cp -pR'.
|
||||
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
|
||||
as_ln_s='cp -p'
|
||||
as_ln_s='cp -pR'
|
||||
elif ln conf$$.file conf$$ 2>/dev/null; then
|
||||
as_ln_s=ln
|
||||
else
|
||||
as_ln_s='cp -p'
|
||||
as_ln_s='cp -pR'
|
||||
fi
|
||||
else
|
||||
as_ln_s='cp -p'
|
||||
as_ln_s='cp -pR'
|
||||
fi
|
||||
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
|
||||
rmdir conf$$.dir 2>/dev/null
|
||||
@@ -507,28 +547,8 @@ else
|
||||
as_mkdir_p=false
|
||||
fi
|
||||
|
||||
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
|
||||
as_test_x='test -x'
|
||||
as_executable_p=as_fn_executable_p
|
||||
|
||||
# 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'"
|
||||
@@ -560,8 +580,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='CUPS'
|
||||
PACKAGE_TARNAME='cups'
|
||||
PACKAGE_VERSION='2.2.4'
|
||||
PACKAGE_STRING='CUPS 2.2.4'
|
||||
PACKAGE_VERSION='2.2.6'
|
||||
PACKAGE_STRING='CUPS 2.2.6'
|
||||
PACKAGE_BUGREPORT='https://github.com/apple/cups/issues'
|
||||
PACKAGE_URL='https://www.cups.org/'
|
||||
|
||||
@@ -663,7 +683,6 @@ SSLLIBS
|
||||
SSLFLAGS
|
||||
IPPALIASES
|
||||
CUPS_SERVERKEYCHAIN
|
||||
LIBGCRYPTCONFIG
|
||||
LIBGNUTLSCONFIG
|
||||
PTHREAD_FLAGS
|
||||
CUPS_DEFAULT_GSSSERVICENAME
|
||||
@@ -679,7 +698,12 @@ ARCHFLAGS
|
||||
UNITTESTS
|
||||
OPTIM
|
||||
INSTALL_STRIP
|
||||
LIBTOOL_INSTALL
|
||||
LIBTOOL_CXX
|
||||
LIBTOOL_CC
|
||||
LIBTOOL
|
||||
LD_CXX
|
||||
LD_CC
|
||||
EXPORT_LDFLAGS
|
||||
IMGLIBS
|
||||
DSOLIBS
|
||||
@@ -748,6 +772,7 @@ SED
|
||||
RMDIR
|
||||
RM
|
||||
MV
|
||||
MKDIR
|
||||
LN
|
||||
LD
|
||||
GZIP
|
||||
@@ -1372,8 +1397,6 @@ 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
|
||||
@@ -1459,7 +1482,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.2.4 to adapt to many kinds of systems.
|
||||
\`configure' configures CUPS 2.2.6 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1524,7 +1547,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of CUPS 2.2.4:";;
|
||||
short | recursive ) echo "Configuration of CUPS 2.2.6:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1538,9 +1561,9 @@ Optional Features:
|
||||
--enable-libusb use libusb for USB printing
|
||||
--enable-tcp-wrappers use libwrap for TCP wrappers support
|
||||
--enable-acl build with POSIX ACL support
|
||||
--disable-dbus build without DBUS support
|
||||
--disable-dbus build without DBUS support
|
||||
--disable-shared do not create shared libraries
|
||||
--enable-libtool-unsupported
|
||||
--enable-libtool-unsupported=/path/to/libtool
|
||||
build with libtool (UNSUPPORTED!)
|
||||
--enable-debug build with debugging symbols
|
||||
--enable-debug-guards build with memory allocation guards
|
||||
@@ -1558,7 +1581,7 @@ Optional Features:
|
||||
--disable-dnssd disable DNS Service Discovery support using mDNSResponder
|
||||
--disable-launchd disable launchd support
|
||||
--disable-systemd disable systemd support
|
||||
--enable-upstart enable upstart support
|
||||
--enable-upstart enable upstart support
|
||||
--enable-page-logging enable page_log by default
|
||||
--disable-browsing disable Browsing by default
|
||||
--disable-default-shared
|
||||
@@ -1591,7 +1614,7 @@ Optional Packages:
|
||||
--with-ldarchflags set program architecture flags
|
||||
--with-domainsocket set unix domain socket name
|
||||
--with-gssservicename set default gss service name
|
||||
--with-pam-module specify the PAM module to use
|
||||
--with-pam-module set the PAM module to use
|
||||
--with-dnssd-libs set directory for DNS Service Discovery library
|
||||
--with-dnssd-includes set directory for DNS Service Discovery includes
|
||||
--with-systemd set directory for systemd service files
|
||||
@@ -1603,7 +1626,7 @@ Optional Packages:
|
||||
--with-xinetd set path for xinetd config files
|
||||
--with-languages set installed languages, default=all
|
||||
--with-bundledir set macOS localization bundle directory
|
||||
--with-exe-file-perm set default exectuable permissions value, default=0555
|
||||
--with-exe-file-perm set default executable permissions value, default=0555
|
||||
--with-config-file-perm set default ConfigFilePerm value, default=0640
|
||||
--with-cupsd-file-perm set default cupsd permissions, default=0500
|
||||
--with-log-file-perm set default LogFilePerm value, default=0644
|
||||
@@ -1705,10 +1728,10 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
CUPS configure 2.2.4
|
||||
generated by GNU Autoconf 2.68
|
||||
CUPS configure 2.2.6
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
This configure script is free software; the Free Software Foundation
|
||||
gives unlimited permission to copy, distribute and modify it.
|
||||
_ACEOF
|
||||
@@ -1859,7 +1882,7 @@ $as_echo "$ac_try_echo"; } >&5
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext && {
|
||||
test "$cross_compiling" = yes ||
|
||||
$as_test_x conftest$ac_exeext
|
||||
test -x conftest$ac_exeext
|
||||
}; then :
|
||||
ac_retval=0
|
||||
else
|
||||
@@ -2169,8 +2192,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.2.4, which was
|
||||
generated by GNU Autoconf 2.68. Invocation command line was
|
||||
It was created by CUPS $as_me 2.2.6, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
|
||||
@@ -2644,7 +2667,7 @@ fi
|
||||
ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
CUPS_VERSION="2.2.4"
|
||||
CUPS_VERSION="2.2.6"
|
||||
CUPS_REVISION=""
|
||||
CUPS_BUILD="cups-$CUPS_VERSION"
|
||||
|
||||
@@ -2690,7 +2713,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -2738,7 +2761,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -2782,7 +2805,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3226,8 +3249,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
struct stat;
|
||||
/* 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);
|
||||
@@ -3477,7 +3499,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3521,7 +3543,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3723,7 +3745,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3763,7 +3785,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3816,7 +3838,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3856,7 +3878,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3896,7 +3918,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3936,7 +3958,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3976,7 +3998,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -3998,6 +4020,46 @@ $as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
# Extract the first word of "mkdir", so it can be a program name with args.
|
||||
set dummy mkdir; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_MKDIR+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $MKDIR in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
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
|
||||
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
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
MKDIR=$ac_cv_path_MKDIR
|
||||
if test -n "$MKDIR"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5
|
||||
$as_echo "$MKDIR" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
# Extract the first word of "mv", so it can be a program name with args.
|
||||
set dummy mv; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -4016,7 +4078,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -4056,7 +4118,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -4096,7 +4158,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -4136,7 +4198,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -4176,7 +4238,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -4252,7 +4314,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -4295,7 +4357,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -4705,7 +4767,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"
|
||||
{ test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
|
||||
as_fn_executable_p "$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
|
||||
@@ -4771,7 +4833,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"
|
||||
{ test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
|
||||
as_fn_executable_p "$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
|
||||
@@ -5940,20 +6002,15 @@ if test "x$ac_cv_header_Security_Authorization_h" = xyes; then :
|
||||
if test "x$default_adminkey" != xdefault; then
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="$default_adminkey"
|
||||
elif grep -q system.print.operator /etc/authorization; then
|
||||
else
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.print.admin"
|
||||
else
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.preferences"
|
||||
fi
|
||||
|
||||
if test "x$default_operkey" != xdefault; then
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY($default_operkey) @admin @lpadmin"
|
||||
elif grep -q system.print.operator /etc/authorization; then
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
|
||||
else
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -6656,6 +6713,9 @@ fi
|
||||
# Check whether --enable-libtool_unsupported was given.
|
||||
if test "${enable_libtool_unsupported+set}" = set; then :
|
||||
enableval=$enable_libtool_unsupported; if test x$enable_libtool_unsupported != xno; then
|
||||
if test x$enable_libtool_unsupported == xyes; then
|
||||
as_fn_error $? "Use --enable-libtool-unsupported=/path/to/libtool." "$LINENO" 5
|
||||
fi
|
||||
LIBTOOL="$enable_libtool_unsupported"
|
||||
enable_shared=no
|
||||
echo "WARNING: libtool is not supported or endorsed by Apple Inc."
|
||||
@@ -6666,17 +6726,45 @@ if test "${enable_libtool_unsupported+set}" = set; then :
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
if test x$LIBTOOL != x; then
|
||||
DSO="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
|
||||
DSOXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
|
||||
|
||||
LD_CC="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
|
||||
LD_CXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
|
||||
|
||||
LIBCUPS="libcups.la"
|
||||
LIBCUPSSTATIC="libcups.la"
|
||||
LIBCUPSCGI="libcupscgi.la"
|
||||
LIBCUPSIMAGE="libcupsimage.la"
|
||||
LIBCUPSMIME="libcupsmime.la"
|
||||
LIBCUPSPPDC="libcupsppdc.la"
|
||||
|
||||
LIBTOOL_CC="\$(LIBTOOL) --mode=compile --tag=CC"
|
||||
LIBTOOL_CXX="\$(LIBTOOL) --mode=compile --tag=CXX"
|
||||
LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
|
||||
|
||||
LINKCUPS="../cups/\$(LIBCUPS)"
|
||||
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
|
||||
DSO="\$(CC)"
|
||||
|
||||
else
|
||||
LD_CC="\$(CC)"
|
||||
LD_CXX="\$(CXX)"
|
||||
|
||||
LIBTOOL_CC=""
|
||||
LIBTOOL_CXX=""
|
||||
LIBTOOL_INSTALL=""
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSTALL_STRIP=""
|
||||
OPTIM=""
|
||||
|
||||
@@ -6980,6 +7068,32 @@ fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-format-truncation" >&5
|
||||
$as_echo_n "checking whether compiler supports -Wno-format-truncation... " >&6; }
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-format-truncation"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
OPTIM="$OPTIM -Wno-format-truncation"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
OPTIM="-Werror $OPTIM"
|
||||
@@ -7737,7 +7851,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -7780,7 +7894,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -8332,7 +8446,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -8375,7 +8489,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$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
|
||||
@@ -8411,104 +8525,6 @@ else
|
||||
LIBGNUTLSCONFIG="$ac_cv_path_LIBGNUTLSCONFIG"
|
||||
fi
|
||||
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}libgcrypt-config", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}libgcrypt-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_LIBGCRYPTCONFIG+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $LIBGCRYPTCONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_LIBGCRYPTCONFIG="$LIBGCRYPTCONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
ac_cv_path_LIBGCRYPTCONFIG="$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
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
LIBGCRYPTCONFIG=$ac_cv_path_LIBGCRYPTCONFIG
|
||||
if test -n "$LIBGCRYPTCONFIG"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPTCONFIG" >&5
|
||||
$as_echo "$LIBGCRYPTCONFIG" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
if test -z "$ac_cv_path_LIBGCRYPTCONFIG"; then
|
||||
ac_pt_LIBGCRYPTCONFIG=$LIBGCRYPTCONFIG
|
||||
# Extract the first word of "libgcrypt-config", so it can be a program name with args.
|
||||
set dummy libgcrypt-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_ac_pt_LIBGCRYPTCONFIG+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $ac_pt_LIBGCRYPTCONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_ac_pt_LIBGCRYPTCONFIG="$ac_pt_LIBGCRYPTCONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
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_LIBGCRYPTCONFIG="$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
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ac_pt_LIBGCRYPTCONFIG=$ac_cv_path_ac_pt_LIBGCRYPTCONFIG
|
||||
if test -n "$ac_pt_LIBGCRYPTCONFIG"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LIBGCRYPTCONFIG" >&5
|
||||
$as_echo "$ac_pt_LIBGCRYPTCONFIG" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$ac_pt_LIBGCRYPTCONFIG" = x; then
|
||||
LIBGCRYPTCONFIG=""
|
||||
else
|
||||
case $cross_compiling:$ac_tool_warned in
|
||||
yes:)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
ac_tool_warned=yes ;;
|
||||
esac
|
||||
LIBGCRYPTCONFIG=$ac_pt_LIBGCRYPTCONFIG
|
||||
fi
|
||||
else
|
||||
LIBGCRYPTCONFIG="$ac_cv_path_LIBGCRYPTCONFIG"
|
||||
fi
|
||||
|
||||
if $PKGCONFIG --exists gnutls; then
|
||||
have_ssl=1
|
||||
SSLLIBS=`$PKGCONFIG --libs gnutls`
|
||||
@@ -9032,6 +9048,8 @@ _ACEOF
|
||||
esac
|
||||
rm -rf conftest*
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@@ -10050,11 +10068,11 @@ _ACEOF
|
||||
if test "${with_java+set}" = set; then :
|
||||
withval=$with_java; CUPS_JAVA="$withval"
|
||||
else
|
||||
CUPS_JAVA=""
|
||||
CUPS_JAVA="auto"
|
||||
fi
|
||||
|
||||
|
||||
if test "x$CUPS_JAVA" = x; then
|
||||
if test "x$CUPS_JAVA" = xauto; then
|
||||
# Extract the first word of "java", so it can be a program name with args.
|
||||
set dummy java; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -10073,7 +10091,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_JAVA="$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
|
||||
@@ -10096,6 +10114,8 @@ fi
|
||||
|
||||
|
||||
CUPS_JAVA="$JAVA"
|
||||
elif test "x$CUPS_JAVA" = xno; then
|
||||
CUPS_JAVA=""
|
||||
fi
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -10113,11 +10133,11 @@ fi
|
||||
if test "${with_perl+set}" = set; then :
|
||||
withval=$with_perl; CUPS_PERL="$withval"
|
||||
else
|
||||
CUPS_PERL=""
|
||||
CUPS_PERL="auto"
|
||||
fi
|
||||
|
||||
|
||||
if test "x$CUPS_PERL" = x; then
|
||||
if test "x$CUPS_PERL" = xauto; then
|
||||
# Extract the first word of "perl", so it can be a program name with args.
|
||||
set dummy perl; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -10136,7 +10156,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PERL="$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
|
||||
@@ -10159,6 +10179,8 @@ fi
|
||||
|
||||
|
||||
CUPS_PERL="$PERL"
|
||||
elif test "x$CUPS_PERL" = xno; then
|
||||
CUPS_PERL=""
|
||||
fi
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -10176,11 +10198,11 @@ fi
|
||||
if test "${with_php+set}" = set; then :
|
||||
withval=$with_php; CUPS_PHP="$withval"
|
||||
else
|
||||
CUPS_PHP=""
|
||||
CUPS_PHP="auto"
|
||||
fi
|
||||
|
||||
|
||||
if test "x$CUPS_PHP" = x; then
|
||||
if test "x$CUPS_PHP" = xauto; then
|
||||
# Extract the first word of "php-cgi", so it can be a program name with args.
|
||||
set dummy php-cgi; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -10199,7 +10221,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PHPCGI="$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
|
||||
@@ -10240,7 +10262,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PHP="$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
|
||||
@@ -10266,6 +10288,8 @@ fi
|
||||
else
|
||||
CUPS_PHP="$PHPCGI"
|
||||
fi
|
||||
elif test "x$CUPS_PHP" = xno; then
|
||||
CUPS_PHP=""
|
||||
fi
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -10285,11 +10309,11 @@ fi
|
||||
if test "${with_python+set}" = set; then :
|
||||
withval=$with_python; CUPS_PYTHON="$withval"
|
||||
else
|
||||
CUPS_PYTHON=""
|
||||
CUPS_PYTHON="auto"
|
||||
fi
|
||||
|
||||
|
||||
if test "x$CUPS_PYTHON" = x; then
|
||||
if test "x$CUPS_PYTHON" = xauto; then
|
||||
# Extract the first word of "python", so it can be a program name with args.
|
||||
set dummy python; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -10308,7 +10332,7 @@ do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PYTHON="$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
|
||||
@@ -10331,6 +10355,8 @@ fi
|
||||
|
||||
|
||||
CUPS_PYTHON="$PYTHON"
|
||||
elif test "x$CUPS_PYTHON" = xno; then
|
||||
CUPS_PYTHON=""
|
||||
fi
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -10776,16 +10802,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 -p'.
|
||||
# In both cases, we have to default to `cp -pR'.
|
||||
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
|
||||
as_ln_s='cp -p'
|
||||
as_ln_s='cp -pR'
|
||||
elif ln conf$$.file conf$$ 2>/dev/null; then
|
||||
as_ln_s=ln
|
||||
else
|
||||
as_ln_s='cp -p'
|
||||
as_ln_s='cp -pR'
|
||||
fi
|
||||
else
|
||||
as_ln_s='cp -p'
|
||||
as_ln_s='cp -pR'
|
||||
fi
|
||||
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
|
||||
rmdir conf$$.dir 2>/dev/null
|
||||
@@ -10845,28 +10871,16 @@ else
|
||||
as_mkdir_p=false
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# 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'"
|
||||
@@ -10887,8 +10901,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.2.4, which was
|
||||
generated by GNU Autoconf 2.68. Invocation command line was
|
||||
This file was extended by CUPS $as_me 2.2.6, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
CONFIG_HEADERS = $CONFIG_HEADERS
|
||||
@@ -10950,11 +10964,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.2.4
|
||||
configured by $0, generated by GNU Autoconf 2.68,
|
||||
CUPS config.status 2.2.6
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
This config.status script is free software; the Free Software Foundation
|
||||
gives unlimited permission to copy, distribute and modify it."
|
||||
|
||||
@@ -11043,7 +11057,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'
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Package name and version...
|
||||
AC_INIT([CUPS], [2.2.4], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
AC_INIT([CUPS], [2.2.6], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
|
||||
sinclude(config-scripts/cups-opsys.m4)
|
||||
sinclude(config-scripts/cups-common.m4)
|
||||
|
||||
+45
-21
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# API library Makefile for CUPS.
|
||||
# Library Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -89,6 +89,7 @@ TESTOBJS = \
|
||||
testcups.o \
|
||||
testdest.o \
|
||||
testfile.o \
|
||||
testgetdests.o \
|
||||
testhttp.o \
|
||||
testi18n.o \
|
||||
testipp.o \
|
||||
@@ -158,6 +159,7 @@ UNITTARGETS = \
|
||||
testcups \
|
||||
testdest \
|
||||
testfile \
|
||||
testgetdests \
|
||||
testhttp \
|
||||
testi18n \
|
||||
testipp \
|
||||
@@ -344,7 +346,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
|
||||
libcups.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:12 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
@@ -383,7 +385,7 @@ libcups2.def: $(LIBOBJS) Makefile
|
||||
|
||||
testadmin: testadmin.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -393,7 +395,7 @@ testadmin: testadmin.o $(LIBCUPSSTATIC)
|
||||
|
||||
testarray: testarray.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running array API tests...
|
||||
./testarray
|
||||
@@ -405,7 +407,7 @@ testarray: testarray.o $(LIBCUPSSTATIC)
|
||||
|
||||
testcache: testcache.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -415,7 +417,7 @@ testcache: testcache.o $(LIBCUPSSTATIC)
|
||||
|
||||
testconflicts: testconflicts.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -425,7 +427,7 @@ testconflicts: testconflicts.o $(LIBCUPSSTATIC)
|
||||
|
||||
testcreds: testcreds.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcreds.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcreds.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -435,7 +437,7 @@ testcreds: testcreds.o $(LIBCUPSSTATIC)
|
||||
|
||||
testcups: testcups.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -445,7 +447,7 @@ testcups: testcups.o $(LIBCUPSSTATIC)
|
||||
|
||||
testdest: testdest.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -455,19 +457,29 @@ testdest: testdest.o $(LIBCUPSSTATIC)
|
||||
|
||||
testfile: testfile.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running file API tests...
|
||||
./testfile
|
||||
|
||||
|
||||
#
|
||||
# testgetdests (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testgetdests: testgetdests.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testgetdests.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# testhttp (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testhttp: testhttp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running HTTP API tests...
|
||||
./testhttp
|
||||
@@ -479,7 +491,7 @@ testhttp: testhttp.o $(LIBCUPSSTATIC)
|
||||
|
||||
testipp: testipp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running IPP API tests...
|
||||
./testipp
|
||||
@@ -491,7 +503,7 @@ testipp: testipp.o $(LIBCUPSSTATIC)
|
||||
|
||||
testi18n: testi18n.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running internationalization API tests...
|
||||
./testi18n
|
||||
@@ -503,10 +515,22 @@ testi18n: testi18n.o $(LIBCUPSSTATIC)
|
||||
|
||||
testlang: testlang.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Creating locale directory structure...
|
||||
$(RM) -r locale
|
||||
$(MKDIR) locale/en
|
||||
echo 'msgid "No"' > locale/en/cups_en.po
|
||||
echo 'msgstr "No"' >> locale/en/cups_en.po
|
||||
echo 'msgid "Yes"' >> locale/en/cups_en.po
|
||||
echo 'msgstr "Yes"' >> locale/en/cups_en.po
|
||||
for po in ../locale/cups_*.po; do \
|
||||
lang=`basename $$po .po | sed -e '1,$$s/^cups_//'`; \
|
||||
$(MKDIR) locale/$$lang; \
|
||||
$(LN) ../../$$po locale/$$lang; \
|
||||
done
|
||||
echo Running language API tests...
|
||||
./testlang
|
||||
LOCALEDIR=locale ./testlang
|
||||
|
||||
|
||||
#
|
||||
@@ -515,7 +539,7 @@ testlang: testlang.o $(LIBCUPSSTATIC)
|
||||
|
||||
testoptions: testoptions.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running option API tests...
|
||||
./testoptions
|
||||
@@ -527,7 +551,7 @@ testoptions: testoptions.o $(LIBCUPSSTATIC)
|
||||
|
||||
testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running PPD API tests...
|
||||
./testppd
|
||||
@@ -539,7 +563,7 @@ testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
|
||||
|
||||
testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running PWG API tests...
|
||||
./testpwg test.ppd
|
||||
@@ -551,7 +575,7 @@ testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
|
||||
|
||||
testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -561,7 +585,7 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
|
||||
tlscheck: tlscheck.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<!--
|
||||
Array API header 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/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>Array API</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Header</th>
|
||||
<th>cups/array.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,194 +0,0 @@
|
||||
<!--
|
||||
Array API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2011 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/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<p>The CUPS array API provides a high-performance generic array container.
|
||||
The contents of the array container can be sorted and the container itself is
|
||||
designed for optimal speed and memory usage under a wide variety of conditions.
|
||||
Sorted arrays use a binary search algorithm from the last found or inserted
|
||||
element to quickly find matching elements in the array. Arrays created with the
|
||||
optional hash function can often find elements with a single lookup. The
|
||||
<a href='#cups_array_t'><code>cups_array_t</code></a> type is used when
|
||||
referring to a CUPS array.</p>
|
||||
|
||||
<p>The CUPS scheduler (<tt>cupsd</tt>) and many of the CUPS API
|
||||
functions use the array API to efficiently manage large lists of
|
||||
data.</p>
|
||||
|
||||
<h3><a name='MANAGING_ARRAYS'>Managing Arrays</a></h3>
|
||||
|
||||
<p>Arrays are created using either the
|
||||
<a href='#cupsArrayNew'><code>cupsArrayNew</code></a>,
|
||||
<a href='#cupsArrayNew2'><code>cupsArrayNew2</code></a>, or
|
||||
<a href='#cupsArrayNew2'><code>cupsArrayNew3</code></a> functions. The
|
||||
first function creates a new array with the specified callback function
|
||||
and user data pointer:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
static int compare_func(void *first, void *second, void *user_data);
|
||||
|
||||
void *user_data;
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew'>cupsArrayNew</a>(compare_func, user_data);
|
||||
</pre>
|
||||
|
||||
<p>The comparison function (type
|
||||
<a href="#cups_arrayfunc_t"><code>cups_arrayfunc_t</code></a>) is called
|
||||
whenever an element is added to the array and can be <code>NULL</code> to
|
||||
create an unsorted array. The function returns -1 if the first element should
|
||||
come before the second, 0 if the first and second elements should have the same
|
||||
ordering, and 1 if the first element should come after the second.</p>
|
||||
|
||||
<p>The "user_data" pointer is passed to your comparison function. Pass
|
||||
<code>NULL</code> if you do not need to associate the elements in your array
|
||||
with additional information.</p>
|
||||
|
||||
<p>The <a href='#cupsArrayNew2'><code>cupsArrayNew2</code></a> function adds
|
||||
two more arguments to support hashed lookups, which can potentially provide
|
||||
instantaneous ("O(1)") lookups in your array:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
#define HASH_SIZE 512 /* Size of hash table */
|
||||
|
||||
static int compare_func(void *first, void *second, void *user_data);
|
||||
static int hash_func(void *element, void *user_data);
|
||||
|
||||
void *user_data;
|
||||
<a href='#cups_array_t'>cups_array_t</a> *hash_array = <a href='#cupsArrayNew2'>cupsArrayNew2</a>(compare_func, user_data, hash_func, HASH_SIZE);
|
||||
</pre>
|
||||
|
||||
<p>The hash function (type
|
||||
<a href="#cups_ahash_func_t"><code>cups_ahash_func_t</code></a>) should return a
|
||||
number from 0 to (hash_size-1) that (hopefully) uniquely identifies the
|
||||
element and is called whenever you look up an element in the array with
|
||||
<a href='#cupsArrayFind'><code>cupsArrayFind</code></a>. The hash size is
|
||||
only limited by available memory, but generally should not be larger than
|
||||
16384 to realize any performance improvement.</p>
|
||||
|
||||
<p>The <a href='#cupsArrayNew3'><code>cupsArrayNew3</code></a> function adds
|
||||
copy and free callbacks to support basic memory management of elements:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
#define HASH_SIZE 512 /* Size of hash table */
|
||||
|
||||
static int compare_func(void *first, void *second, void *user_data);
|
||||
static void *copy_func(void *element, void *user_data);
|
||||
static void free_func(void *element, void *user_data);
|
||||
static int hash_func(void *element, void *user_data);
|
||||
|
||||
void *user_data;
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew3'>cupsArrayNew3</a>(compare_func, user_data, NULL, 0, copy_func, free_func);
|
||||
|
||||
<a href='#cups_array_t'>cups_array_t</a> *hash_array = <a href='#cupsArrayNew3'>cupsArrayNew3</a>(compare_func, user_data, hash_func, HASH_SIZE, copy_func, free_func);
|
||||
</pre>
|
||||
|
||||
<p>Once you have created the array, you add elements using the
|
||||
<a href='#cupsArrayAdd'><code>cupsArrayAdd</code></a>
|
||||
<a href='#cupsArrayInsert'><code>cupsArrayInsert</code></a> functions.
|
||||
The first function adds an element to the array, adding the new element
|
||||
after any elements that have the same order, while the second inserts the
|
||||
element before others with the same order. For unsorted arrays,
|
||||
<a href='#cupsArrayAdd'><code>cupsArrayAdd</code></a> appends the element to
|
||||
the end of the array while
|
||||
<a href='#cupsArrayInsert'><code>cupsArrayInsert</code></a> inserts the
|
||||
element at the beginning of the array. For example, the following code
|
||||
creates a sorted array of character strings:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
/* Use strcmp() to compare strings - it will ignore the user_data pointer */
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew'>cupsArrayNew</a>((<a href='#cups_array_func_t'>cups_array_func_t</a>)strcmp, NULL);
|
||||
|
||||
/* Add four strings to the array */
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "One Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Two Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Red Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Blue Fish");
|
||||
</pre>
|
||||
|
||||
<p>Elements are removed using the
|
||||
<a href='#cupsArrayRemove'><code>cupsArrayRemove</code></a> function, for
|
||||
example:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
/* Use strcmp() to compare strings - it will ignore the user_data pointer */
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew'>cupsArrayNew</a>((<a href='#cups_array_func_t'>cups_array_func_t</a>)strcmp, NULL);
|
||||
|
||||
/* Add four strings to the array */
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "One Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Two Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Red Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Blue Fish");
|
||||
|
||||
/* Remove "Red Fish" */
|
||||
<a href='#cupsArrayRemove'>cupsArrayRemove</a>(array, "Red Fish");
|
||||
</pre>
|
||||
|
||||
<p>Finally, you free the memory used by the array using the
|
||||
<a href='#cupsArrayDelete'><code>cupsArrayDelete</code></a> function. All
|
||||
of the memory for the array and hash table (if any) is freed, however <em>CUPS
|
||||
does not free the elements unless you provide copy and free functions</em>.</p>
|
||||
|
||||
<h3><a name='FINDING_AND_ENUMERATING'>Finding and Enumerating Elements</a></h3>
|
||||
|
||||
<p>CUPS provides several functions to find and enumerate elements in an
|
||||
array. Each one sets or updates a "current index" into the array, such that
|
||||
future lookups will start where the last one left off:</p>
|
||||
|
||||
<dl>
|
||||
<dt><a href='#cupsArrayFind'><code>cupsArrayFind</code></a></dt>
|
||||
<dd>Returns the first matching element.</dd>
|
||||
<dt><a href='#cupsArrayFirst'><code>cupsArrayFirst</code></a></dt>
|
||||
<dd>Returns the first element in the array.</dd>
|
||||
<dt><a href='#cupsArrayIndex'><code>cupsArrayIndex</code></a></dt>
|
||||
<dd>Returns the Nth element in the array, starting at 0.</dd>
|
||||
<dt><a href='#cupsArrayLast'><code>cupsArrayLast</code></a></dt>
|
||||
<dd>Returns the last element in the array.</dd>
|
||||
<dt><a href='#cupsArrayNext'><code>cupsArrayNext</code></a></dt>
|
||||
<dd>Returns the next element in the array.</dd>
|
||||
<dt><a href='#cupsArrayPrev'><code>cupsArrayPrev</code></a></dt>
|
||||
<dd>Returns the previous element in the array.</dd>
|
||||
</dl>
|
||||
|
||||
<p>Each of these functions returns <code>NULL</code> when there is no
|
||||
corresponding element. For example, a simple <code>for</code> loop using the
|
||||
<a href='#cupsArrayFirst'><code>cupsArrayFirst</code></a> and
|
||||
<a href='#cupsArrayNext'><code>cupsArrayNext</code></a> functions will
|
||||
enumerate all of the strings in our previous example:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
/* Use strcmp() to compare strings - it will ignore the user_data pointer */
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew'>cupsArrayNew</a>((<a href='#cups_array_func_t'>cups_array_func_t</a>)strcmp, NULL);
|
||||
|
||||
/* Add four strings to the array */
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "One Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Two Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Red Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Blue Fish");
|
||||
|
||||
/* Show all of the strings in the array */
|
||||
char *s;
|
||||
for (s = (char *)<a href='#cupsArrayFirst'>cupsArrayFirst</a>(array); s != NULL; s = (char *)<a href='#cupsArrayNext'>cupsArrayNext</a>(array))
|
||||
puts(s);
|
||||
</pre>
|
||||
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
CUPS API header 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/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>CUPS API</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Header</th>
|
||||
<th>cups/cups.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br>
|
||||
Programming: <a href='api-array.html' target='_top'>Array API</a><br>
|
||||
Programming: <a href='api-filedir.html' target='_top'>File and Directory APIs</a><br>
|
||||
Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</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</a><br>
|
||||
Programming: <a href='api-raster.html' target='_top'>Raster API</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,441 +0,0 @@
|
||||
<!--
|
||||
API introduction for CUPS.
|
||||
|
||||
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/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<p>The CUPS API provides the convenience functions needed to support
|
||||
applications, filters, printer drivers, and backends that need to interface
|
||||
with the CUPS scheduler.</p>
|
||||
|
||||
<h3><a name='CLIENTS_AND_SERVERS'>Clients and Servers</a></h3>
|
||||
|
||||
<p>CUPS is based on the Internet Printing Protocol ("IPP"), which allows
|
||||
clients (applications) to communicate with a server (the scheduler) to get a
|
||||
list of printers, send print jobs, and so forth. You identify which server
|
||||
you want to communicate with using a pointer to the opaque structure
|
||||
<code>http_t</code>. All of the examples in this document use the
|
||||
<code>CUPS_HTTP_DEFAULT</code> constant, referring to the default connection
|
||||
to the scheduler. The <a href='api-httpipp.html' target='_top'>HTTP and IPP
|
||||
APIs</a> document provides more information on server connections.</p>
|
||||
|
||||
<h3><a name='PRINTERS_AND_CLASSES'>Printers and Classes</a></h3>
|
||||
|
||||
<p>Printers and classes (collections of printers) are accessed through
|
||||
the <a href="#cups_dest_t"><code>cups_dest_t</code></a> structure which
|
||||
includes the name (<code>name</code>), instance (<code>instance</code> -
|
||||
a way of selecting certain saved options/settings), and the options and
|
||||
attributes associated with that destination (<code>num_options</code> and
|
||||
<code>options</code>). Destinations are created using the
|
||||
<a href="#cupsGetDests"><code>cupsGetDests</code></a> function and freed
|
||||
using the <a href='#cupsFreeDests'><code>cupsFreeDests</code></a> function.
|
||||
The <a href='#cupsGetDest'><code>cupsGetDest</code></a> function finds a
|
||||
specific destination for printing:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dests;
|
||||
int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests);
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest = <a href='#cupsGetDest'>cupsGetDest</a>("name", NULL, num_dests, dests);
|
||||
|
||||
/* do something with dest */
|
||||
|
||||
<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
|
||||
</pre>
|
||||
|
||||
<p>Passing <code>NULL</code> to
|
||||
<a href='#cupsGetDest'><code>cupsGetDest</code></a> for the destination name
|
||||
will return the default destination. Similarly, passing a <code>NULL</code>
|
||||
instance will return the default instance for that destination.</p>
|
||||
|
||||
<div class='table'><table summary='Table 1: Printer Attributes' width='80%'>
|
||||
<caption>Table 1: <a name='TABLE1'>Printer Attributes</a></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Attribute Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>"auth-info-required"</td>
|
||||
<td>The type of authentication required for printing to this
|
||||
destination: "none", "username,password", "domain,username,password",
|
||||
or "negotiate" (Kerberos)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-info"</td>
|
||||
<td>The human-readable description of the destination such as "My
|
||||
Laser Printer".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-is-accepting-jobs"</td>
|
||||
<td>"true" if the destination is accepting new jobs, "false" if
|
||||
not.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-is-shared"</td>
|
||||
<td>"true" if the destination is being shared with other computers,
|
||||
"false" if not.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-location"</td>
|
||||
<td>The human-readable location of the destination such as "Lab 4".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-make-and-model"</td>
|
||||
<td>The human-readable make and model of the destination such as "HP
|
||||
LaserJet 4000 Series".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-state"</td>
|
||||
<td>"3" if the destination is idle, "4" if the destination is printing
|
||||
a job, and "5" if the destination is stopped.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-state-change-time"</td>
|
||||
<td>The UNIX time when the destination entered the current state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-state-reasons"</td>
|
||||
<td>Additional comma-delimited state keywords for the destination
|
||||
such as "media-tray-empty-error" and "toner-low-warning".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-type"</td>
|
||||
<td>The <a href='#cups_printer_t'><code>cups_printer_t</code></a>
|
||||
value associated with the destination.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
|
||||
<h3><a name='OPTIONS'>Options</a></h3>
|
||||
|
||||
<p>Options are stored in arrays of
|
||||
<a href='#cups_option_t'><code>cups_option_t</code></a> structures. Each
|
||||
option has a name (<code>name</code>) and value (<code>value</code>)
|
||||
associated with it. The <a href='#cups_dest_t'><code>cups_dest_t</code></a>
|
||||
<code>num_options</code> and <code>options</code> members contain the
|
||||
default options for a particular destination, along with several informational
|
||||
attributes about the destination as shown in <a href='#TABLE1'>Table 1</a>.
|
||||
The <a href='#cupsGetOption'><code>cupsGetOption</code></a> function gets
|
||||
the value for the named option. For example, the following code lists the
|
||||
available destinations and their human-readable descriptions:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dests;
|
||||
int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests);
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int i;
|
||||
const char *value;
|
||||
|
||||
for (i = num_dests, dest = dests; i > 0; i --, dest ++)
|
||||
if (dest->instance == NULL)
|
||||
{
|
||||
value = <a href='#cupsGetOption'>cupsGetOption</a>("printer-info", dest->num_options, dest->options);
|
||||
printf("%s (%s)\n", dest->name, value ? value : "no description");
|
||||
}
|
||||
|
||||
<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
|
||||
</pre>
|
||||
|
||||
<p>You can create your own option arrays using the
|
||||
<a href='#cupsAddOption'><code>cupsAddOption</code></a> function, which
|
||||
adds a single named option to an array:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
int num_options = 0;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
|
||||
|
||||
/* The returned num_options value is updated as needed */
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "value", num_options, &options);
|
||||
|
||||
/* This adds a second option value */
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>("second", "value", num_options, &options);
|
||||
|
||||
/* This replaces the first option we added */
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "new value", num_options, &options);
|
||||
</pre>
|
||||
|
||||
<p>Use a <code>for</code> loop to copy the options from a destination:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
int i;
|
||||
int num_options = 0;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
|
||||
for (i = 0; i < dest->num_options; i ++)
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>(dest->options[i].name, dest->options[i].value,
|
||||
num_options, &options);
|
||||
</pre>
|
||||
|
||||
<p>Use the <a href='#cupsFreeOptions'><code>cupsFreeOptions</code></a>
|
||||
function to free the options array when you are done using it:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#cupsFreeOptions'>cupsFreeOptions</a>(num_options, options);
|
||||
</pre>
|
||||
|
||||
<h3><a name='PRINT_JOBS'>Print Jobs</a></h3>
|
||||
|
||||
<p>Print jobs are identified by a locally-unique job ID number from 1 to
|
||||
2<sup>31</sup>-1 and have options and one or more files for printing to a
|
||||
single destination. The <a href='#cupsPrintFile'><code>cupsPrintFile</code></a>
|
||||
function creates a new job with one file. The following code prints the CUPS
|
||||
test page file:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int num_options;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options;
|
||||
int job_id;
|
||||
|
||||
/* Print a single file */
|
||||
job_id = <a href='#cupsPrintFile'>cupsPrintFile</a>(dest->name, "/usr/share/cups/data/testprint.ps",
|
||||
"Test Print", num_options, options);
|
||||
</pre>
|
||||
|
||||
<p>The <a href='#cupsPrintFiles'><code>cupsPrintFiles</code></a> function
|
||||
creates a job with multiple files. The files are provided in a
|
||||
<code>char *</code> array:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int num_options;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options;
|
||||
int job_id;
|
||||
char *files[3] = { "file1.pdf", "file2.pdf", "file3.pdf" };
|
||||
|
||||
/* Print three files */
|
||||
job_id = <a href='#cupsPrintFiles'>cupsPrintFiles</a>(dest->name, 3, files, "Test Print", num_options, options);
|
||||
</pre>
|
||||
|
||||
<p>Finally, the <a href='#cupsCreateJob'><code>cupsCreateJob</code></a>
|
||||
function creates a new job with no files in it. Files are added using the
|
||||
<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
|
||||
<a href='api-httpipp.html#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>,
|
||||
and <a href='#cupsFinishDocument'><code>cupsFinishDocument</code></a> functions.
|
||||
The following example creates a job with 10 text files for printing:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int num_options;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options;
|
||||
int job_id;
|
||||
int i;
|
||||
char buffer[1024];
|
||||
|
||||
/* Create the job */
|
||||
job_id = <a href='#cupsCreateJob'>cupsCreateJob</a>(CUPS_HTTP_DEFAULT, dest->name, "10 Text Files",
|
||||
num_options, options);
|
||||
|
||||
/* If the job is created, add 10 files */
|
||||
if (job_id > 0)
|
||||
{
|
||||
for (i = 1; i <= 10; i ++)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "file%d.txt", i);
|
||||
|
||||
<a href='#cupsStartDocument'>cupsStartDocument</a>(CUPS_HTTP_DEFAULT, dest->name, job_id, buffer,
|
||||
CUPS_FORMAT_TEXT, i == 10);
|
||||
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
"File %d\n"
|
||||
"\n"
|
||||
"One fish,\n"
|
||||
"Two fish,\n
|
||||
"Red fish,\n
|
||||
"Blue fish\n", i);
|
||||
|
||||
/* cupsWriteRequestData can be called as many times as needed */
|
||||
<a href='#cupsWriteRequestData'>cupsWriteRequestData</a>(CUPS_HTTP_DEFAULT, buffer, strlen(buffer));
|
||||
|
||||
<a href='#cupsFinishDocument'>cupsFinishDocument</a>(CUPS_HTTP_DEFAULT, dest->name);
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>Once you have created a job, you can monitor its status using the
|
||||
<a href='#cupsGetJobs'><code>cupsGetJobs</code></a> function, which returns
|
||||
an array of <a href='#cups_job_t'><code>cups_job_t</code></a> structures.
|
||||
Each contains the job ID (<code>id</code>), destination name
|
||||
(<code>dest</code>), title (<code>title</code>), and other information
|
||||
associated with the job. The job array is freed using the
|
||||
<a href='#cupsFreeJobs'><code>cupsFreeJobs</code></a> function. The following
|
||||
example monitors a specific job ID, showing the current job state once every
|
||||
5 seconds until the job is completed:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int job_id;
|
||||
int num_jobs;
|
||||
<a href='#cups_job_t'>cups_job_t</a> *jobs;
|
||||
int i;
|
||||
ipp_jstate_t job_state = IPP_JOB_PENDING;
|
||||
|
||||
while (job_state < IPP_JOB_STOPPED)
|
||||
{
|
||||
/* Get my jobs (1) with any state (-1) */
|
||||
num_jobs = <a href='#cupsGetJobs'>cupsGetJobs</a>(&jobs, dest->name, 1, -1);
|
||||
|
||||
/* Loop to find my job */
|
||||
job_state = IPP_JOB_COMPLETED;
|
||||
|
||||
for (i = 0; i < num_jobs; i ++)
|
||||
if (jobs[i].id == job_id)
|
||||
{
|
||||
job_state = jobs[i].state;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Free the job array */
|
||||
<a href='#cupsFreeJobs'>cupsFreeJobs</a>(num_jobs, jobs);
|
||||
|
||||
/* Show the current state */
|
||||
switch (job_state)
|
||||
{
|
||||
case IPP_JOB_PENDING :
|
||||
printf("Job %d is pending.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_HELD :
|
||||
printf("Job %d is held.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_PROCESSING :
|
||||
printf("Job %d is processing.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_STOPPED :
|
||||
printf("Job %d is stopped.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_CANCELED :
|
||||
printf("Job %d is canceled.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_ABORTED :
|
||||
printf("Job %d is aborted.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_COMPLETED :
|
||||
printf("Job %d is completed.\n", job_id);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Sleep if the job is not finished */
|
||||
if (job_state < IPP_JOB_STOPPED)
|
||||
sleep(5);
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>To cancel a job, use the
|
||||
<a href='#cupsCancelJob'><code>cupsCancelJob</code></a> function with the
|
||||
job ID:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int job_id;
|
||||
|
||||
<a href='#cupsCancelJob'>cupsCancelJob</a>(dest->name, job_id);
|
||||
</pre>
|
||||
|
||||
<h3><a name='ERROR_HANDLING'>Error Handling</a></h3>
|
||||
|
||||
<p>If any of the CUPS API printing functions returns an error, the reason for
|
||||
that error can be found by calling the
|
||||
<a href='#cupsLastError'><code>cupsLastError</code></a> and
|
||||
<a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> functions.
|
||||
<a href='#cupsLastError'><code>cupsLastError</code></a> returns the last IPP
|
||||
error code
|
||||
(<a href='api-httpipp.html#ipp_status_t'><code>ipp_status_t</code></a>)
|
||||
that was encountered, while
|
||||
<a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> returns
|
||||
a (localized) human-readable string that can be shown to the user. For example,
|
||||
if any of the job creation functions returns a job ID of 0, you can use
|
||||
<a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> to show
|
||||
the reason why the job could not be created:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
int job_id;
|
||||
|
||||
if (job_id == 0)
|
||||
puts(cupsLastErrorString());
|
||||
</pre>
|
||||
|
||||
<h3><a name='PASSWORDS_AND_AUTHENTICATION'>Passwords and Authentication</a></h3>
|
||||
|
||||
<p>CUPS supports authentication of any request, including submission of print
|
||||
jobs. The default mechanism for getting the username and password is to use the
|
||||
login user and a password from the console.</p>
|
||||
|
||||
<p>To support other types of applications, in particular Graphical User
|
||||
Interfaces ("GUIs"), the CUPS API provides functions to set the default
|
||||
username and to register a callback function that returns a password string.</p>
|
||||
|
||||
<p>The <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a>
|
||||
function is used to set a password callback in your program. Only one
|
||||
function can be used at any time.</p>
|
||||
|
||||
<p>The <a href="#cupsSetUser"><code>cupsSetUser</code></a> function sets the
|
||||
current username for authentication. This function can be called by your
|
||||
password callback function to change the current username as needed.</p>
|
||||
|
||||
<p>The following example shows a simple password callback that gets a
|
||||
username and password from the user:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
const char *
|
||||
my_password_cb(const char *prompt)
|
||||
{
|
||||
char user[65];
|
||||
|
||||
|
||||
puts(prompt);
|
||||
|
||||
/* Get a username from the user */
|
||||
printf("Username: ");
|
||||
if (fgets(user, sizeof(user), stdin) == NULL)
|
||||
return (NULL);
|
||||
|
||||
/* Strip the newline from the string and set the user */
|
||||
user[strlen(user) - 1] = '\0';
|
||||
|
||||
<a href='#cupsSetUser'>cupsSetUser</a>(user);
|
||||
|
||||
/* Use getpass() to ask for the password... */
|
||||
return (getpass("Password: "));
|
||||
}
|
||||
|
||||
<a href='#cupsSetPasswordCB'>cupsSetPasswordCB</a>(my_password_cb);
|
||||
</pre>
|
||||
|
||||
<p>Similarly, a GUI could display the prompt string in a window with input
|
||||
fields for the username and password. The username should default to the
|
||||
string returned by the <a href="#cupsUser"><code>cupsUser</code></a>
|
||||
function.</p>
|
||||
@@ -1,34 +0,0 @@
|
||||
<!--
|
||||
File and Directory API header 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/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>File and Directory APIs</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Headers</th>
|
||||
<th>cups/file.h<br>
|
||||
cups/dir.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br>
|
||||
Programming: <a href='api-cups.html' target='_top'>CUPS API</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,29 +0,0 @@
|
||||
<!--
|
||||
File and directory API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2011 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"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name="OVERVIEW">Overview</a></h2>
|
||||
|
||||
<p>The CUPS file and directory APIs provide portable interfaces
|
||||
for manipulating files and listing files and directories. Unlike
|
||||
stdio <code>FILE</code> streams, the <code>cupsFile</code> functions
|
||||
allow you to open more than 256 files at any given time. They
|
||||
also manage the platform-specific details of locking, large file
|
||||
support, line endings (CR, LF, or CR LF), and reading and writing
|
||||
files using Flate ("gzip") compression. Finally, you can also
|
||||
connect, read from, and write to network connections using the
|
||||
<code>cupsFile</code> functions.</p>
|
||||
|
||||
<p>The <code>cupsDir</code> functions manage the platform-specific
|
||||
details of directory access/listing and provide a convenient way
|
||||
to get both a list of files and the information (permissions,
|
||||
size, timestamp, etc.) for each of those files.</p>
|
||||
@@ -1,37 +0,0 @@
|
||||
<!--
|
||||
HTTP and IPP API header for CUPS.
|
||||
|
||||
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/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>HTTP and IPP APIs</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Headers</th>
|
||||
<th>cups/cups.h<br>
|
||||
cups/http.h<br>
|
||||
cups/ipp.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html'>Introduction to CUPS Programming</a><br>
|
||||
Programming: <a href='api-cups.html'>CUPS API</a><br>
|
||||
References: <a href='spec-ipp.html'>CUPS Implementation of IPP</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,315 +0,0 @@
|
||||
<!--
|
||||
HTTP and IPP API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2012 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<p>The CUPS HTTP and IPP APIs provide low-level access to the HTTP and IPP
|
||||
protocols and CUPS scheduler. They are typically used by monitoring and
|
||||
administration programs to perform specific functions not supported by the
|
||||
high-level CUPS API functions.</p>
|
||||
|
||||
<p>The HTTP APIs use an opaque structure called
|
||||
<a href='#http_t'><code>http_t</code></a> to manage connections to
|
||||
a particular HTTP or IPP server. The
|
||||
<a href='#httpConnectEncrypt'><code>httpConnectEncrypt</code></a> function is
|
||||
used to create an instance of this structure for a particular server.
|
||||
The constant <code>CUPS_HTTP_DEFAULT</code> can be used with all of the
|
||||
<code>cups</code> functions to refer to the default CUPS server - the functions
|
||||
create a per-thread <a href='#http_t'><code>http_t</code></a> as needed.</p>
|
||||
|
||||
<p>The IPP APIs use two opaque structures for requests (messages sent to the CUPS scheduler) and responses (messages sent back to your application from the scheduler). The <a href='#ipp_t'><code>ipp_t</code></a> type holds a complete request or response and is allocated using the <a href='#ippNew'><code>ippNew</code></a> or <a href='#ippNewRequest'><code>ippNewRequest</code></a> functions and freed using the <a href='#ippDelete'><code>ippDelete</code></a> function.</p>
|
||||
|
||||
<p>The second opaque structure is called <a href='#ipp_attribute_t'><code>ipp_attribute_t</code></a> and holds a single IPP attribute which consists of a group tag (<a href='#ippGetGroupTag'><code>ippGetGroupTag</code></a>), a value type tag (<a href='#ippGetValueTag'><code>ippGetValueTag</code></a>), the attribute name (<a href='#ippGetName'><code>ippGetName</code></a>), and 1 or more values (<a href='#ippGetCount'><code>ippGetCount</code></a>, <a href='#ippGetBoolean'><code>ippGetBoolean</code></a>, <a href='#ippGetCollection'><code>ippGetCollection</code></a>, <a href='#ippGetDate'><code>ippGetDate</code></a>, <a href='#ippGetInteger'><code>ippGetInteger</code></a>, <a href='#ippGetRange'><code>ippGetRange</code></a>, <a href='#ippGetResolution'><code>ippGetResolution</code></a>, and <a href='#ippGetString'><code>ippGetString</code></a>). Attributes are added to an <a href='#ipp_t'><code>ipp_t</code></a> pointer using one of the <code>ippAdd</code> functions. For example, use <a href='#ippAddString'><code>ippAddString</code></a> to add the "printer-uri" and "requesting-user-name" string attributes to a request:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, "ipp://localhost/printers/");
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, cupsUser());
|
||||
</pre>
|
||||
|
||||
<p>Once you have created an IPP request, use the <code>cups</code> functions to send the request to and read the response from the server. For example, the <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function can be used for simple query operations that do not involve files:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
|
||||
<a href='#ipp_t'>ipp_t</a> *<a name='get_jobs'>get_jobs</a>(void)
|
||||
{
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, "ipp://localhost/printers/");
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, cupsUser());
|
||||
|
||||
return (<a href='#cupsDoRequest'>cupsDoRequest</a>(CUPS_HTTP_DEFAULT, request, "/"));
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>The <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function frees the request and returns an IPP response or <code>NULL</code> pointer if the request could not be sent to the server. Once you have a response from the server, you can either use the <a href='#ippFindAttribute'><code>ippFindAttribute</code></a> and <a href='#ippFindNextAttribute'><code>ippFindNextAttribute</code></a> functions to find specific attributes, for example:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
|
||||
|
||||
attr = <a href='#ippFindAttribute'>ippFindAttribute</a>(response, "printer-state", IPP_TAG_ENUM);
|
||||
</pre>
|
||||
|
||||
<p>You can also walk the list of attributes with a simple <code>for</code> loop like this:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
|
||||
|
||||
for (attr = <a href='#ippFirstAttribute'>ippFirstAttribute</a>(response); attr != NULL; attr = <a href='#ippNextAttribute'>ippNextAttribute</a>(response))
|
||||
if (ippGetName(attr) == NULL)
|
||||
puts("--SEPARATOR--");
|
||||
else
|
||||
puts(ippGetName(attr));
|
||||
</pre>
|
||||
|
||||
<p>The <code>for</code> loop approach is normally used when collecting attributes for multiple objects (jobs, printers, etc.) in a response. Attributes with <code>NULL</code> names indicate a separator between the attributes of each object. For example, the following code will list the jobs returned from our previous <a href='#get_jobs'><code>get_jobs</code></a> example code:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#ipp_t'>ipp_t</a> *response = <a href='#get_jobs'>get_jobs</a>();
|
||||
|
||||
if (response != NULL)
|
||||
{
|
||||
<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
|
||||
const char *attrname;
|
||||
int job_id = 0;
|
||||
const char *job_name = NULL;
|
||||
const char *job_originating_user_name = NULL;
|
||||
|
||||
puts("Job ID Owner Title");
|
||||
puts("------ ---------------- ---------------------------------");
|
||||
|
||||
for (attr = <a href='#ippFirstAttribute'>ippFirstAttribute</a>(response); attr != NULL; attr = <a href='#ippNextAttribute'>ippNextAttribute</a>(response))
|
||||
{
|
||||
/* Attributes without names are separators between jobs */
|
||||
attrname = ippGetName(attr);
|
||||
if (attrname == NULL)
|
||||
{
|
||||
if (job_id > 0)
|
||||
{
|
||||
if (job_name == NULL)
|
||||
job_name = "(withheld)";
|
||||
|
||||
if (job_originating_user_name == NULL)
|
||||
job_originating_user_name = "(withheld)";
|
||||
|
||||
printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
|
||||
}
|
||||
|
||||
job_id = 0;
|
||||
job_name = NULL;
|
||||
job_originating_user_name = NULL;
|
||||
continue;
|
||||
}
|
||||
else if (!strcmp(attrname, "job-id") && ippGetValueTag(attr) == IPP_TAG_INTEGER)
|
||||
job_id = ippGetInteger(attr, 0);
|
||||
else if (!strcmp(attrname, "job-name") && ippGetValueTag(attr) == IPP_TAG_NAME)
|
||||
job_name = ippGetString(attr, 0, NULL);
|
||||
else if (!strcmp(attrname, "job-originating-user-name") &&
|
||||
ippGetValueTag(attr) == IPP_TAG_NAME)
|
||||
job_originating_user_name = ippGetString(attr, 0, NULL);
|
||||
}
|
||||
|
||||
if (job_id > 0)
|
||||
{
|
||||
if (job_name == NULL)
|
||||
job_name = "(withheld)";
|
||||
|
||||
if (job_originating_user_name == NULL)
|
||||
job_originating_user_name = "(withheld)";
|
||||
|
||||
printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3><a name='CREATING_URI_STRINGS'>Creating URI Strings</a></h3>
|
||||
|
||||
<p>To ensure proper encoding, the
|
||||
<a href='#httpAssembleURIf'><code>httpAssembleURIf</code></a> function must be
|
||||
used to format a "printer-uri" string for all printer-based requests:</p>
|
||||
|
||||
<pre class='example'>
|
||||
const char *name = "Foo";
|
||||
char uri[1024];
|
||||
<a href='#ipp_t'>ipp_t</a> *request;
|
||||
|
||||
<a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
|
||||
ippPort(), "/printers/%s", name);
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
</pre>
|
||||
|
||||
<h3><a name='SENDING_REQUESTS_WITH_FILES'>Sending Requests with Files</a></h3>
|
||||
|
||||
<p>The <a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> and
|
||||
<a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> functions are
|
||||
used for requests involving files. The
|
||||
<a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> function
|
||||
attaches the named file to a request and is typically used when sending a print
|
||||
file or changing a printer's PPD file:</p>
|
||||
|
||||
<pre class='example'>
|
||||
const char *filename = "/usr/share/cups/data/testprint.ps";
|
||||
const char *name = "Foo";
|
||||
char uri[1024];
|
||||
char resource[1024];
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_PRINT_JOB);
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
|
||||
/* Use httpAssembleURIf for the printer-uri string */
|
||||
<a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
|
||||
ippPort(), "/printers/%s", name);
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, cupsUser());
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
|
||||
NULL, "testprint.ps");
|
||||
|
||||
/* Use snprintf for the resource path */
|
||||
snprintf(resource, sizeof(resource), "/printers/%s", name);
|
||||
|
||||
response = <a href='#cupsDoFileRequest'>cupsDoFileRequest</a>(CUPS_HTTP_DEFAULT, request, resource, filename);
|
||||
</pre>
|
||||
|
||||
<p>The <a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> function
|
||||
optionally attaches a file to the request and optionally saves a file in the
|
||||
response from the server. It is used when using a pipe for the request
|
||||
attachment or when using a request that returns a file, currently only
|
||||
<code>CUPS_GET_DOCUMENT</code> and <code>CUPS_GET_PPD</code>. For example,
|
||||
the following code will download the PPD file for the sample HP LaserJet
|
||||
printer driver:</p>
|
||||
|
||||
<pre class='example'>
|
||||
char tempfile[1024];
|
||||
int tempfd;
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, "laserjet.ppd");
|
||||
|
||||
tempfd = cupsTempFd(tempfile, sizeof(tempfile));
|
||||
|
||||
response = <a href='#cupsDoIORequest'>cupsDoIORequest</a>(CUPS_HTTP_DEFAULT, request, "/", -1, tempfd);
|
||||
</pre>
|
||||
|
||||
<p>The example passes <code>-1</code> for the input file descriptor to specify
|
||||
that no file is to be attached to the request. The PPD file attached to the
|
||||
response is written to the temporary file descriptor we created using the
|
||||
<code>cupsTempFd</code> function.</p>
|
||||
|
||||
<h3><a name='ASYNCHRONOUS_REQUEST_PROCESSING'>Asynchronous Request Processing</a></h3>
|
||||
|
||||
<p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> and
|
||||
<a href='#cupsGetResponse'><code>cupsGetResponse</code></a> support
|
||||
asynchronous communications with the server. Unlike the other request
|
||||
functions, the IPP request is not automatically freed, so remember to
|
||||
free your request with the <a href='#ippDelete'><code>ippDelete</code></a>
|
||||
function.</p>
|
||||
|
||||
<p>File data is attached to the request using the
|
||||
<a href='#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>
|
||||
function, while file data returned from the server is read using the
|
||||
<a href='#cupsReadResponseData'><code>cupsReadResponseData</code></a>
|
||||
function. We can rewrite the previous <code>CUPS_GET_PPD</code> example
|
||||
to use the asynchronous functions quite easily:</p>
|
||||
|
||||
<pre class='example'>
|
||||
char tempfile[1024];
|
||||
int tempfd;
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, "laserjet.ppd");
|
||||
|
||||
tempfd = cupsTempFd(tempfile, sizeof(tempfile));
|
||||
|
||||
if (<a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/") == HTTP_CONTINUE)
|
||||
{
|
||||
response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
|
||||
|
||||
if (response != NULL)
|
||||
{
|
||||
ssize_t bytes;
|
||||
char buffer[8192];
|
||||
|
||||
while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
|
||||
write(tempfd, buffer, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
/* Free the request! */
|
||||
<a href='#ippDelete'>ippDelete</a>(request);
|
||||
</pre>
|
||||
|
||||
<p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> function
|
||||
returns the initial HTTP request status, typically either
|
||||
<code>HTTP_CONTINUE</code> or <code>HTTP_UNAUTHORIZED</code>. The latter status
|
||||
is returned when the request requires authentication of some sort. The
|
||||
<a href='#cupsDoAuthentication'><code>cupsDoAuthentication</code></a> function
|
||||
must be called when your see <code>HTTP_UNAUTHORIZED</code> and the request
|
||||
re-sent. We can add authentication support to our example code by using a
|
||||
<code>do ... while</code> loop:</p>
|
||||
|
||||
<pre class='example'>
|
||||
char tempfile[1024];
|
||||
int tempfd;
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
http_status_t status;
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, "laserjet.ppd");
|
||||
|
||||
tempfd = cupsTempFd(tempfile, sizeof(tempfile));
|
||||
|
||||
/* Loop for authentication */
|
||||
do
|
||||
{
|
||||
status = <a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/");
|
||||
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
/* Try to authenticate, break out of the loop if that fails */
|
||||
if (<a href='#cupsDoAuthentication'>cupsDoAuthentication</a>(CUPS_HTTP_DEFAULT, "POST", "/"))
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (status != HTTP_CONTINUE && status != HTTP_UNAUTHORIZED);
|
||||
|
||||
if (status == HTTP_CONTINUE)
|
||||
{
|
||||
response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
|
||||
|
||||
if (response != NULL)
|
||||
{
|
||||
ssize_t bytes;
|
||||
char buffer[8192];
|
||||
|
||||
while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
|
||||
write(tempfd, buffer, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
/* Free the request! */
|
||||
<a href='#ippDelete'>ippDelete</a>(request);
|
||||
</pre>
|
||||
+2
-2
@@ -47,10 +47,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 2.0204
|
||||
# define CUPS_VERSION 2.0206
|
||||
# define CUPS_VERSION_MAJOR 2
|
||||
# define CUPS_VERSION_MINOR 2
|
||||
# define CUPS_VERSION_PATCH 4
|
||||
# define CUPS_VERSION_PATCH 6
|
||||
|
||||
# define CUPS_BC_FD 3
|
||||
/* Back-channel file descriptor for
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
title: CUPS Programming Manual
|
||||
author: Michael R Sweet
|
||||
copyright: Copyright © 2007-2017 by Apple Inc. All Rights Reserved.
|
||||
version: 2.2.4
|
||||
version: 2.2.5
|
||||
...
|
||||
|
||||
> Please [file issues on Github](https://github.com/apple/cups/issues) to
|
||||
@@ -925,7 +925,7 @@ their values:
|
||||
IPP_TAG_ENUM)) != NULL)
|
||||
{
|
||||
printf("printer-state=%s\n",
|
||||
ippTagString("printer-state", ippGetInteger(attr, 0)));
|
||||
ippEnumString("printer-state", ippGetInteger(attr, 0)));
|
||||
}
|
||||
else
|
||||
puts("printer-state=unknown");
|
||||
@@ -952,7 +952,7 @@ The `ippGetCount` function returns the number of values in an attribute.
|
||||
The `ippGetInteger` and `ippGetString` functions return a single integer or
|
||||
string value from an attribute.
|
||||
|
||||
The `ippTagString` function converts a enum value to its keyword (string)
|
||||
The `ippEnumString` function converts a enum value to its keyword (string)
|
||||
equivalent.
|
||||
|
||||
Once you are done using the IPP response message, free it using the `ippDelete`
|
||||
|
||||
@@ -60,12 +60,15 @@ cupsLocalizeDestMedia(
|
||||
*ltype; /* Localized media type */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsLocalizeDestMedia(http=%p, dest=%p, dinfo=%p, flags=%x, size=%p(\"%s\"))", (void *)http, (void *)dest, (void *)dinfo, flags, (void *)size, size ? size->media : "(null)"));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!http || !dest || !dinfo || !size)
|
||||
{
|
||||
DEBUG_puts("1cupsLocalizeDestMedia: Returning NULL.");
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
|
||||
return (NULL);
|
||||
}
|
||||
@@ -79,13 +82,24 @@ cupsLocalizeDestMedia(
|
||||
|
||||
key.id = size->media;
|
||||
if ((match = (_cups_message_t *)cupsArrayFind(dinfo->localizations, &key)) != NULL)
|
||||
{
|
||||
DEBUG_printf(("1cupsLocalizeDestMedia: Returning \"%s\".", match->str));
|
||||
return (match->str);
|
||||
}
|
||||
|
||||
/*
|
||||
* If not, get the localized size, source, and type strings...
|
||||
*/
|
||||
|
||||
lang = cupsLangDefault();
|
||||
|
||||
snprintf(temp, sizeof(temp), "media.%s", size->media);
|
||||
if ((lsize = _cupsLangString(lang, temp)) != NULL && strcmp(lsize, temp))
|
||||
{
|
||||
DEBUG_printf(("1cupsLocalizeDestMedia: Returning standard localization \"%s\".", lsize));
|
||||
return (lsize);
|
||||
}
|
||||
|
||||
pwg = pwgMediaForSize(size->width, size->length);
|
||||
|
||||
if (pwg->ppd)
|
||||
@@ -101,7 +115,7 @@ cupsLocalizeDestMedia(
|
||||
* Use inches since the size is a multiple of 1/4 inch.
|
||||
*/
|
||||
|
||||
snprintf(temp, sizeof(temp), _cupsLangString(lang, _("%g x %g")), size->width / 2540.0, size->length / 2540.0);
|
||||
snprintf(temp, sizeof(temp), _cupsLangString(lang, _("%g x %g \"")), size->width / 2540.0, size->length / 2540.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -189,6 +203,8 @@ cupsLocalizeDestMedia(
|
||||
|
||||
cupsArrayAdd(dinfo->localizations, match);
|
||||
|
||||
DEBUG_printf(("1cupsLocalizeDestMedia: Returning \"%s\".", match->str));
|
||||
|
||||
return (match->str);
|
||||
}
|
||||
|
||||
@@ -212,21 +228,23 @@ cupsLocalizeDestOption(
|
||||
{
|
||||
_cups_message_t key, /* Search key */
|
||||
*match; /* Matching entry */
|
||||
const char *localized; /* Localized string */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsLocalizeDestOption(http=%p, dest=%p, dinfo=%p, option=\"%s\")", (void *)http, (void *)dest, (void *)dinfo, option));
|
||||
|
||||
if (!http || !dest || !dinfo)
|
||||
return (option);
|
||||
|
||||
if (!dinfo->localizations)
|
||||
cups_create_localizations(http, dinfo);
|
||||
|
||||
if (cupsArrayCount(dinfo->localizations) == 0)
|
||||
return (option);
|
||||
|
||||
key.id = (char *)option;
|
||||
if ((match = (_cups_message_t *)cupsArrayFind(dinfo->localizations,
|
||||
&key)) != NULL)
|
||||
return (match->str);
|
||||
else if ((localized = _cupsLangString(cupsLangDefault(), option)) != NULL)
|
||||
return (localized);
|
||||
else
|
||||
return (option);
|
||||
}
|
||||
@@ -253,22 +271,40 @@ cupsLocalizeDestValue(
|
||||
_cups_message_t key, /* Search key */
|
||||
*match; /* Matching entry */
|
||||
char pair[256]; /* option.value pair */
|
||||
const char *localized; /* Localized string */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsLocalizeDestValue(http=%p, dest=%p, dinfo=%p, option=\"%s\", value=\"%s\")", (void *)http, (void *)dest, (void *)dinfo, option, value));
|
||||
|
||||
if (!http || !dest || !dinfo)
|
||||
return (value);
|
||||
|
||||
if (!strcmp(option, "media"))
|
||||
{
|
||||
pwg_media_t *media = pwgMediaForPWG(value);
|
||||
cups_size_t size;
|
||||
|
||||
strlcpy(size.media, value, sizeof(size.media));
|
||||
size.width = media ? media->width : 0;
|
||||
size.length = media ? media->length : 0;
|
||||
size.left = 0;
|
||||
size.right = 0;
|
||||
size.bottom = 0;
|
||||
size.top = 0;
|
||||
|
||||
return (cupsLocalizeDestMedia(http, dest, dinfo, CUPS_MEDIA_FLAGS_DEFAULT, &size));
|
||||
}
|
||||
|
||||
if (!dinfo->localizations)
|
||||
cups_create_localizations(http, dinfo);
|
||||
|
||||
if (cupsArrayCount(dinfo->localizations) == 0)
|
||||
return (value);
|
||||
|
||||
snprintf(pair, sizeof(pair), "%s.%s", option, value);
|
||||
key.id = pair;
|
||||
if ((match = (_cups_message_t *)cupsArrayFind(dinfo->localizations,
|
||||
&key)) != NULL)
|
||||
return (match->str);
|
||||
else if ((localized = _cupsLangString(cupsLangDefault(), pair)) != NULL && strcmp(localized, pair))
|
||||
return (localized);
|
||||
else
|
||||
return (value);
|
||||
}
|
||||
|
||||
+496
-419
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -2477,6 +2477,8 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* file header...
|
||||
*/
|
||||
|
||||
inflateEnd(&fp->stream);
|
||||
|
||||
fp->compressed = 0;
|
||||
}
|
||||
else if (status < Z_OK)
|
||||
|
||||
+16
-1
@@ -65,7 +65,7 @@ httpAddrConnect2(
|
||||
int flags; /* Socket flags */
|
||||
#endif /* !WIN32 */
|
||||
int remaining; /* Remaining timeout */
|
||||
int i, /* Looping var */
|
||||
int i, j, /* Looping vars */
|
||||
nfds, /* Number of file descriptors */
|
||||
fds[100], /* Socket file descriptors */
|
||||
result; /* Result from select() or poll() */
|
||||
@@ -323,6 +323,8 @@ httpAddrConnect2(
|
||||
if (!getpeername(fds[i], (struct sockaddr *)&peer, &len))
|
||||
DEBUG_printf(("1httpAddrConnect2: Connected to %s:%d...", httpAddrString(&peer, temp, sizeof(temp)), httpAddrPort(&peer)));
|
||||
# endif /* DEBUG */
|
||||
|
||||
break;
|
||||
}
|
||||
# ifdef HAVE_POLL
|
||||
else if (pfds[i].revents & (POLLERR | POLLHUP))
|
||||
@@ -346,7 +348,20 @@ httpAddrConnect2(
|
||||
}
|
||||
|
||||
if (connaddr)
|
||||
{
|
||||
/*
|
||||
* Connected on one address, close all of the other sockets we have so
|
||||
* far and return...
|
||||
*/
|
||||
|
||||
for (j = 0; j < i; j ++)
|
||||
httpAddrClose(NULL, fds[j]);
|
||||
|
||||
for (j ++; j < nfds; j ++)
|
||||
httpAddrClose(NULL, fds[j]);
|
||||
|
||||
return (connaddr);
|
||||
}
|
||||
}
|
||||
#endif /* O_NONBLOCK */
|
||||
|
||||
|
||||
+13
-12
@@ -172,19 +172,20 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define _HTTP_MAX_SBUFFER 65536 /* Size of (de)compression buffer */
|
||||
# define _HTTP_RESOLVE_DEFAULT 0 /* Just resolve with default options */
|
||||
# define _HTTP_RESOLVE_STDERR 1 /* Log resolve progress to stderr */
|
||||
# define _HTTP_RESOLVE_FQDN 2 /* Resolve to a FQDN */
|
||||
# define _HTTP_RESOLVE_FAXOUT 4 /* Resolve FaxOut service? */
|
||||
|
||||
#define _HTTP_MAX_SBUFFER 65536 /* Size of (de)compression buffer */
|
||||
#define _HTTP_RESOLVE_DEFAULT 0 /* Just resolve with default options */
|
||||
#define _HTTP_RESOLVE_STDERR 1 /* Log resolve progress to stderr */
|
||||
#define _HTTP_RESOLVE_FQDN 2 /* Resolve to a FQDN */
|
||||
#define _HTTP_RESOLVE_FAXOUT 4 /* Resolve FaxOut service? */
|
||||
|
||||
#define _HTTP_TLS_NONE 0 /* No TLS options */
|
||||
#define _HTTP_TLS_ALLOW_RC4 1 /* Allow RC4 cipher suites */
|
||||
#define _HTTP_TLS_ALLOW_SSL3 2 /* Allow SSL 3.0 */
|
||||
#define _HTTP_TLS_ALLOW_DH 4 /* Allow DH/DHE key negotiation */
|
||||
#define _HTTP_TLS_DENY_TLS10 16 /* Deny TLS 1.0 */
|
||||
#define _HTTP_TLS_DENY_CBC 32 /* Deny CBC cipher suites */
|
||||
# define _HTTP_TLS_NONE 0 /* No TLS options */
|
||||
# define _HTTP_TLS_ALLOW_RC4 1 /* Allow RC4 cipher suites */
|
||||
# define _HTTP_TLS_ALLOW_SSL3 2 /* Allow SSL 3.0 */
|
||||
# define _HTTP_TLS_ALLOW_DH 4 /* Allow DH/DHE key negotiation */
|
||||
# define _HTTP_TLS_DENY_TLS10 16 /* Deny TLS 1.0 */
|
||||
# define _HTTP_TLS_DENY_CBC 32 /* Deny CBC cipher suites */
|
||||
# define _HTTP_TLS_ONLY_TLS10 64 /* Only use TLS 1.0 */
|
||||
# define _HTTP_TLS_SET_DEFAULT 128 /* Setting the default TLS options */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1509,6 +1509,16 @@ ippCopyAttribute(
|
||||
dstattr = ippAddSeparator(dst);
|
||||
break;
|
||||
|
||||
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 :
|
||||
dstattr = ippAddOutOfBand(dst, srcattr->group_tag, srcattr->value_tag & ~IPP_TAG_CUPS_CONST, srcattr->name);
|
||||
break;
|
||||
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
dstattr = ippAddIntegers(dst, srcattr->group_tag, srcattr->value_tag,
|
||||
@@ -1828,12 +1838,19 @@ ippDelete(ipp_t *ipp) /* I - IPP message */
|
||||
|
||||
ipp->use --;
|
||||
if (ipp->use > 0)
|
||||
{
|
||||
DEBUG_printf(("4debug_retain: %p IPP message (use=%d)", (void *)ipp, ipp->use));
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_printf(("4debug_free: %p IPP message", (void *)ipp));
|
||||
|
||||
for (attr = ipp->attrs; attr != NULL; attr = next)
|
||||
{
|
||||
next = attr->next;
|
||||
|
||||
DEBUG_printf(("4debug_free: %p %s %s%s (%d values)", (void *)attr, attr->name, attr->num_values > 1 ? "1setOf " : "", ippTagString(attr->value_tag), attr->num_values));
|
||||
|
||||
ipp_free_values(attr, 0, attr->num_values);
|
||||
|
||||
if (attr->name)
|
||||
@@ -1870,6 +1887,8 @@ ippDeleteAttribute(
|
||||
if (!attr)
|
||||
return;
|
||||
|
||||
DEBUG_printf(("4debug_free: %p %s %s%s (%d values)", (void *)attr, attr->name, attr->num_values > 1 ? "1setOf " : "", ippTagString(attr->value_tag), attr->num_values));
|
||||
|
||||
/*
|
||||
* Find the attribute in the list...
|
||||
*/
|
||||
@@ -2705,6 +2724,8 @@ ippNew(void)
|
||||
* Set default version - usually 2.0...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("4debug_alloc: %p IPP message", (void *)temp));
|
||||
|
||||
if (cg->server_version == 0)
|
||||
_cupsSetDefaults();
|
||||
|
||||
@@ -6402,6 +6423,8 @@ ipp_add_attr(ipp_t *ipp, /* I - IPP message */
|
||||
* Initialize attribute...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("4debug_alloc: %p %s %s%s (%d values)", (void *)attr, name, num_values > 1 ? "1setOf " : "", ippTagString(value_tag), num_values));
|
||||
|
||||
if (name)
|
||||
attr->name = _cupsStrAlloc(name);
|
||||
|
||||
@@ -6958,6 +6981,9 @@ ipp_set_value(ipp_t *ipp, /* IO - IPP message */
|
||||
* Reset pointers in the list...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("4debug_free: %p %s", (void *)*attr, temp->name));
|
||||
DEBUG_printf(("4debug_alloc: %p %s %s%s (%d)", (void *)temp, temp->name, temp->num_values > 1 ? "1setOf " : "", ippTagString(temp->value_tag), temp->num_values));
|
||||
|
||||
if (ipp->current == *attr && ipp->prev)
|
||||
{
|
||||
/*
|
||||
|
||||
+65
-7
@@ -123,7 +123,9 @@ static const _apple_language_locale_t apple_language_locale[] =
|
||||
{ "nb", "no" },
|
||||
{ "nb_NO", "no" },
|
||||
{ "zh-Hans", "zh_CN" },
|
||||
{ "zh_HANS", "zh_CN" },
|
||||
{ "zh-Hant", "zh_TW" },
|
||||
{ "zh_HANT", "zh_TW" },
|
||||
{ "zh-Hant_CN", "zh_TW" }
|
||||
};
|
||||
#endif /* __APPLE__ */
|
||||
@@ -254,8 +256,16 @@ _cupsAppleLocale(CFStringRef languageName, /* I - Apple language ID */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
CFStringRef localeName; /* Locale as a CF string */
|
||||
#ifdef DEBUG
|
||||
char temp[1024]; /* Temporary string */
|
||||
|
||||
|
||||
if (!CFStringGetCString(languageName, temp, (CFIndex)sizeof(temp), kCFStringEncodingASCII))
|
||||
temp[0] = '\0';
|
||||
|
||||
DEBUG_printf(("_cupsAppleLocale(languageName=%p(%s), locale=%p, localsize=%d)", (void *)languageName, temp, (void *)locale, (int)localesize));
|
||||
#endif /* DEBUG */
|
||||
|
||||
localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(kCFAllocatorDefault, languageName);
|
||||
|
||||
if (localeName)
|
||||
@@ -267,6 +277,8 @@ _cupsAppleLocale(CFStringRef languageName, /* I - Apple language ID */
|
||||
if (!CFStringGetCString(localeName, locale, (CFIndex)localesize, kCFStringEncodingASCII))
|
||||
*locale = '\0';
|
||||
|
||||
DEBUG_printf(("_cupsAppleLocale: locale=\"%s\"", locale));
|
||||
|
||||
CFRelease(localeName);
|
||||
|
||||
/*
|
||||
@@ -278,8 +290,12 @@ _cupsAppleLocale(CFStringRef languageName, /* I - Apple language ID */
|
||||
sizeof(apple_language_locale[0]));
|
||||
i ++)
|
||||
{
|
||||
if (!strcmp(locale, apple_language_locale[i].language))
|
||||
size_t len = strlen(apple_language_locale[i].language);
|
||||
|
||||
if (!strcmp(locale, apple_language_locale[i].language) ||
|
||||
(!strncmp(locale, apple_language_locale[i].language, len) && (locale[len] == '_' || locale[len] == '-')))
|
||||
{
|
||||
DEBUG_printf(("_cupsAppleLocale: Updating locale to \"%s\".", apple_language_locale[i].locale));
|
||||
strlcpy(locale, apple_language_locale[i].locale, localesize);
|
||||
break;
|
||||
}
|
||||
@@ -296,7 +312,10 @@ _cupsAppleLocale(CFStringRef languageName, /* I - Apple language ID */
|
||||
}
|
||||
|
||||
if (!*locale)
|
||||
{
|
||||
DEBUG_puts("_cupsAppleLocale: Returning NULL.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert language subtag into region subtag...
|
||||
@@ -304,10 +323,14 @@ _cupsAppleLocale(CFStringRef languageName, /* I - Apple language ID */
|
||||
|
||||
if (locale[2] == '-')
|
||||
locale[2] = '_';
|
||||
else if (locale[3] == '-')
|
||||
locale[3] = '_';
|
||||
|
||||
if (!strchr(locale, '.'))
|
||||
strlcat(locale, ".UTF-8", localesize);
|
||||
|
||||
DEBUG_printf(("_cupsAppleLocale: Returning \"%s\".", locale));
|
||||
|
||||
return (locale);
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
@@ -669,6 +692,15 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
*ptr++ = (char)toupper(*language & 255);
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
/*
|
||||
* Map Chinese region codes to legacy country codes.
|
||||
*/
|
||||
|
||||
if (!strcmp(language, "zh") && !strcmp(country, "HANS"))
|
||||
strlcpy(country, "CN", sizeof(country));
|
||||
if (!strcmp(language, "zh") && !strcmp(country, "HANT"))
|
||||
strlcpy(country, "TW", sizeof(country));
|
||||
}
|
||||
|
||||
if (*language == '.' && !charset[0])
|
||||
@@ -688,7 +720,7 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
* Force a POSIX locale for an invalid language name...
|
||||
*/
|
||||
|
||||
if (strlen(langname) != 2)
|
||||
if (strlen(langname) != 2 && strlen(langname) != 3)
|
||||
{
|
||||
strlcpy(langname, "C", sizeof(langname));
|
||||
country[0] = '\0';
|
||||
@@ -828,6 +860,9 @@ _cupsLangString(cups_lang_t *lang, /* I - Language */
|
||||
{
|
||||
const char *s; /* Localized message */
|
||||
|
||||
|
||||
DEBUG_printf(("_cupsLangString(lang=%p, message=\"%s\")", (void *)lang, message));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -1126,6 +1161,8 @@ _cupsMessageLookup(cups_array_t *a, /* I - Message array */
|
||||
*match; /* Matching message */
|
||||
|
||||
|
||||
DEBUG_printf(("_cupsMessageLookup(a=%p, m=\"%s\")", (void *)a, m));
|
||||
|
||||
/*
|
||||
* Lookup the message string; if it doesn't exist in the catalog,
|
||||
* then return the message that was passed to us...
|
||||
@@ -1336,11 +1373,13 @@ appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
{
|
||||
char filename[1024], /* Path to cups.strings file */
|
||||
applelang[256], /* Apple language ID */
|
||||
baselang[3]; /* Base language */
|
||||
baselang[4]; /* Base language */
|
||||
CFURLRef url; /* URL to cups.strings file */
|
||||
CFReadStreamRef stream = NULL; /* File stream */
|
||||
CFPropertyListRef plist = NULL; /* Localization file */
|
||||
#ifdef DEBUG
|
||||
const char *cups_strings = getenv("CUPS_STRINGS");
|
||||
/* Test strings file */
|
||||
CFErrorRef error = NULL; /* Error when opening file */
|
||||
#endif /* DEBUG */
|
||||
|
||||
@@ -1351,6 +1390,15 @@ appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
* Load the cups.strings file...
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
if (cups_strings)
|
||||
{
|
||||
DEBUG_puts("1appleMessageLoad: Using debug CUPS_STRINGS file.");
|
||||
strlcpy(filename, cups_strings, sizeof(filename));
|
||||
}
|
||||
else
|
||||
#endif /* DEBUG */
|
||||
|
||||
snprintf(filename, sizeof(filename),
|
||||
CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings",
|
||||
_cupsAppleLanguage(locale, applelang, sizeof(applelang)));
|
||||
@@ -1363,6 +1411,7 @@ appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
* Try with original locale string...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("1appleMessageLoad: \"%s\": %s", filename, strerror(errno)));
|
||||
snprintf(filename, sizeof(filename), CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", locale);
|
||||
}
|
||||
|
||||
@@ -1374,18 +1423,23 @@ appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
* Try with just the language code...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("1appleMessageLoad: \"%s\": %s", filename, strerror(errno)));
|
||||
|
||||
strlcpy(baselang, locale, sizeof(baselang));
|
||||
if (baselang[3] == '-' || baselang[3] == '_')
|
||||
baselang[3] = '\0';
|
||||
|
||||
snprintf(filename, sizeof(filename), CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", baselang);
|
||||
}
|
||||
|
||||
DEBUG_printf(("1appleMessageLoad: filename=\"%s\"", filename));
|
||||
|
||||
if (access(filename, 0))
|
||||
{
|
||||
/*
|
||||
* Try alternate lproj directory names...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("1appleMessageLoad: \"%s\": %s", filename, strerror(errno)));
|
||||
|
||||
if (!strncmp(locale, "en", 2))
|
||||
locale = "English";
|
||||
else if (!strncmp(locale, "nb", 2))
|
||||
@@ -1402,7 +1456,7 @@ appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
locale = "Japanese";
|
||||
else if (!strncmp(locale, "es", 2))
|
||||
locale = "Spanish";
|
||||
else if (!strcmp(locale, "zh_HK") || !strncmp(locale, "zh-Hant", 7))
|
||||
else if (!strcmp(locale, "zh_HK") || !strncasecmp(locale, "zh-Hant", 7) || !strncasecmp(locale, "zh_Hant", 7))
|
||||
{
|
||||
/*
|
||||
* <rdar://problem/22130168>
|
||||
@@ -1423,14 +1477,18 @@ appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
*/
|
||||
|
||||
strlcpy(baselang, locale, sizeof(baselang));
|
||||
if (baselang[2] == '-' || baselang[2] == '_')
|
||||
baselang[2] = '\0';
|
||||
|
||||
locale = baselang;
|
||||
}
|
||||
|
||||
snprintf(filename, sizeof(filename),
|
||||
CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", locale);
|
||||
DEBUG_printf(("1appleMessageLoad: alternate filename=\"%s\"", filename));
|
||||
}
|
||||
|
||||
DEBUG_printf(("1appleMessageLoad: filename=\"%s\"", filename));
|
||||
|
||||
url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
|
||||
(UInt8 *)filename,
|
||||
(CFIndex)strlen(filename), false);
|
||||
|
||||
@@ -80,6 +80,11 @@ cupsAddOption(const char *name, /* I - Name of option */
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
if (!_cups_strcasecmp(name, "cupsPrintQuality"))
|
||||
num_options = cupsRemoveOption("print-quality", num_options, options);
|
||||
else if (!_cups_strcasecmp(name, "print-quality"))
|
||||
num_options = cupsRemoveOption("cupsPrintQuality", num_options, options);
|
||||
|
||||
/*
|
||||
* Look for an existing option with the same name...
|
||||
*/
|
||||
|
||||
+127
-72
@@ -78,6 +78,8 @@ _cupsConvertOptions(
|
||||
int num_finishings = 0, /* Number of finishing values */
|
||||
finishings[10]; /* Finishing enum values */
|
||||
ppd_choice_t *choice; /* Marked choice */
|
||||
int finishings_copies = copies;
|
||||
/* Number of copies for finishings */
|
||||
|
||||
|
||||
/*
|
||||
@@ -366,13 +368,13 @@ _cupsConvertOptions(
|
||||
{
|
||||
ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings", num_finishings, finishings);
|
||||
|
||||
if (copies > 1 && (keyword = cupsGetOption("job-impressions", num_options, options)) != NULL)
|
||||
if (copies != finishings_copies && (keyword = cupsGetOption("job-impressions", num_options, options)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Send job-pages-per-set attribute to apply finishings correctly...
|
||||
*/
|
||||
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-pages-per-set", atoi(keyword) / copies);
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-pages-per-set", atoi(keyword) / finishings_copies);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2084,11 +2086,16 @@ _ppdCacheGetFinishingValues(
|
||||
|
||||
DEBUG_printf(("_ppdCacheGetFinishingValues(pc=%p, num_options=%d, options=%p, max_values=%d, values=%p)", pc, num_options, options, max_values, values));
|
||||
|
||||
if (!pc || !pc->finishings || num_options < 1 || max_values < 1 || !values)
|
||||
if (!pc || max_values < 1 || !values)
|
||||
{
|
||||
DEBUG_puts("_ppdCacheGetFinishingValues: Bad arguments, returning 0.");
|
||||
return (0);
|
||||
}
|
||||
else if (!pc->finishings)
|
||||
{
|
||||
DEBUG_puts("_ppdCacheGetFinishingValues: No finishings support, returning 0.");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Go through the finishings options and see what is set...
|
||||
@@ -2114,7 +2121,7 @@ _ppdCacheGetFinishingValues(
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
DEBUG_printf(("_ppdCacheGetFinishingValues: Adding %d.", f->value));
|
||||
DEBUG_printf(("_ppdCacheGetFinishingValues: Adding %d (%s)", f->value, ippEnumString("finishings", f->value)));
|
||||
|
||||
values[num_values ++] = f->value;
|
||||
|
||||
@@ -2123,6 +2130,17 @@ _ppdCacheGetFinishingValues(
|
||||
}
|
||||
}
|
||||
|
||||
if (num_values == 0)
|
||||
{
|
||||
/*
|
||||
* Always have at least "finishings" = 'none'...
|
||||
*/
|
||||
|
||||
DEBUG_puts("_ppdCacheGetFinishingValues: Adding 3 (none).");
|
||||
values[0] = IPP_FINISHINGS_NONE;
|
||||
num_values ++;
|
||||
}
|
||||
|
||||
DEBUG_printf(("_ppdCacheGetFinishingValues: Returning %d.", num_values));
|
||||
|
||||
return (num_values);
|
||||
@@ -2949,6 +2967,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
is_pwg = 0; /* Does the printer support PWG Raster? */
|
||||
pwg_media_t *pwg; /* PWG media size */
|
||||
int xres, yres; /* Resolution values */
|
||||
int resolutions[1000];
|
||||
/* Array of resolution indices */
|
||||
cups_lang_t *lang = cupsLangDefault();
|
||||
/* Localization info */
|
||||
struct lconv *loc = localeconv();
|
||||
@@ -3581,8 +3601,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
* ColorModel...
|
||||
*/
|
||||
|
||||
if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) == NULL)
|
||||
if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) == NULL)
|
||||
if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) == NULL)
|
||||
if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) == NULL)
|
||||
if ((attr = ippFindAttribute(response, "print-color-mode-supported", IPP_TAG_KEYWORD)) == NULL)
|
||||
attr = ippFindAttribute(response, "output-mode-supported", IPP_TAG_KEYWORD);
|
||||
|
||||
@@ -3661,7 +3681,36 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
"*Duplex DuplexTumble/%s: \"<</Duplex true/Tumble true>>setpagedevice\"\n"
|
||||
"*CloseUI: *Duplex\n", _cupsLangString(lang, _("2-Sided Printing")), _cupsLangString(lang, _("Off (1-Sided)")), _cupsLangString(lang, _("Long-Edge (Portrait)")), _cupsLangString(lang, _("Short-Edge (Landscape)")));
|
||||
|
||||
if ((attr = ippFindAttribute(response, "pwg-raster-document-sheet-back", IPP_TAG_KEYWORD)) != NULL)
|
||||
if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
for (i = 0, count = ippGetCount(attr); i < count; i ++)
|
||||
{
|
||||
const char *dm = ippGetString(attr, i, NULL);
|
||||
/* DM value */
|
||||
|
||||
if (!_cups_strcasecmp(dm, "DM1"))
|
||||
{
|
||||
cupsFilePuts(fp, "*cupsBackSide: Normal\n");
|
||||
break;
|
||||
}
|
||||
else if (!_cups_strcasecmp(dm, "DM2"))
|
||||
{
|
||||
cupsFilePuts(fp, "*cupsBackSide: Flipped\n");
|
||||
break;
|
||||
}
|
||||
else if (!_cups_strcasecmp(dm, "DM3"))
|
||||
{
|
||||
cupsFilePuts(fp, "*cupsBackSide: Rotated\n");
|
||||
break;
|
||||
}
|
||||
else if (!_cups_strcasecmp(dm, "DM4"))
|
||||
{
|
||||
cupsFilePuts(fp, "*cupsBackSide: ManualTumble\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((attr = ippFindAttribute(response, "pwg-raster-document-sheet-back", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
const char *keyword = ippGetString(attr, 0, NULL);
|
||||
/* Keyword value */
|
||||
@@ -3675,35 +3724,6 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
else
|
||||
cupsFilePuts(fp, "*cupsBackSide: Rotated\n");
|
||||
}
|
||||
else if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
for (i = 0, count = ippGetCount(attr); i < count; i ++)
|
||||
{
|
||||
const char *dm = ippGetString(attr, i, NULL);
|
||||
/* DM value */
|
||||
|
||||
if (!_cups_strcasecmp(dm, "DM1"))
|
||||
{
|
||||
cupsFilePuts(fp, "*cupsBackSide: Normal\n");
|
||||
break;
|
||||
}
|
||||
else if (!_cups_strcasecmp(dm, "DM2"))
|
||||
{
|
||||
cupsFilePuts(fp, "*cupsBackSide: Flipped\n");
|
||||
break;
|
||||
}
|
||||
else if (!_cups_strcasecmp(dm, "DM3"))
|
||||
{
|
||||
cupsFilePuts(fp, "*cupsBackSide: Rotated\n");
|
||||
break;
|
||||
}
|
||||
else if (!_cups_strcasecmp(dm, "DM4"))
|
||||
{
|
||||
cupsFilePuts(fp, "*cupsBackSide: ManualTumble\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3962,42 +3982,14 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
|
||||
quality = ippFindAttribute(response, "print-quality-supported", IPP_TAG_ENUM);
|
||||
|
||||
if ((attr = ippFindAttribute(response, "pwg-raster-document-resolution-supported", IPP_TAG_RESOLUTION)) != NULL)
|
||||
if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
count = ippGetCount(attr);
|
||||
|
||||
pwg_ppdize_resolution(attr, count / 2, &xres, &yres, ppdname, sizeof(ppdname));
|
||||
cupsFilePrintf(fp, "*DefaultResolution: %s\n", ppdname);
|
||||
|
||||
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality/%s: PickOne\n"
|
||||
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
|
||||
"*DefaultcupsPrintQuality: Normal\n", _cupsLangString(lang, _("Print Quality")));
|
||||
if (count > 2 || ippContainsInteger(quality, IPP_QUALITY_DRAFT))
|
||||
{
|
||||
pwg_ppdize_resolution(attr, 0, &xres, &yres, NULL, 0);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), xres, yres);
|
||||
}
|
||||
pwg_ppdize_resolution(attr, count / 2, &xres, &yres, NULL, 0);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Normal/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Normal")), xres, yres);
|
||||
if (count > 1 || ippContainsInteger(quality, IPP_QUALITY_HIGH))
|
||||
{
|
||||
if (count > 1)
|
||||
pwg_ppdize_resolution(attr, count - 1, &xres, &yres, NULL, 0);
|
||||
else
|
||||
pwg_ppdize_resolution(attr, 0, &xres, &yres, NULL, 0);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality High/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("High")), xres, yres);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *cupsPrintQuality\n");
|
||||
}
|
||||
else if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
int lowdpi = 0, hidpi = 0; /* Lower and higher resolution */
|
||||
int lowdpi = 0, hidpi = 0; /* Lower and higher resolution */
|
||||
|
||||
for (i = 0, count = ippGetCount(attr); i < count; i ++)
|
||||
{
|
||||
const char *rs = ippGetString(attr, i, NULL);
|
||||
/* RS value */
|
||||
/* RS value */
|
||||
|
||||
if (_cups_strncasecmp(rs, "RS", 2))
|
||||
continue;
|
||||
@@ -4027,18 +4019,81 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
cupsFilePrintf(fp, "*DefaultResolution: %ddpi\n", lowdpi);
|
||||
|
||||
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality/%s: PickOne\n"
|
||||
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
|
||||
"*DefaultcupsPrintQuality: Normal\n", _cupsLangString(lang, _("Print Quality")));
|
||||
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
|
||||
"*DefaultcupsPrintQuality: Normal\n", _cupsLangString(lang, _("Print Quality")));
|
||||
if ((lowdpi & 1) == 0)
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), lowdpi, lowdpi / 2);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), lowdpi, lowdpi / 2);
|
||||
else if (ippContainsInteger(quality, IPP_QUALITY_DRAFT))
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), lowdpi, lowdpi);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), lowdpi, lowdpi);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Normal/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Normal")), lowdpi, lowdpi);
|
||||
if (hidpi > lowdpi || ippContainsInteger(quality, IPP_QUALITY_HIGH))
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality High/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("High")), hidpi, hidpi);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality High/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("High")), hidpi, hidpi);
|
||||
cupsFilePuts(fp, "*CloseUI: *cupsPrintQuality\n");
|
||||
}
|
||||
}
|
||||
else if ((attr = ippFindAttribute(response, "pwg-raster-document-resolution-supported", IPP_TAG_RESOLUTION)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Make a sorted list of resolutions.
|
||||
*/
|
||||
|
||||
count = ippGetCount(attr);
|
||||
if (count > (int)(sizeof(resolutions) / sizeof(resolutions[0])))
|
||||
count = (int)(sizeof(resolutions) / sizeof(resolutions[0]));
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
resolutions[i] = i;
|
||||
|
||||
for (i = 0; i < (count - 1); i ++)
|
||||
{
|
||||
for (j = i + 1; j < count; j ++)
|
||||
{
|
||||
int ix, iy, /* First X and Y resolution */
|
||||
jx, jy, /* Second X and Y resolution */
|
||||
temp; /* Swap variable */
|
||||
ipp_res_t units; /* Resolution units */
|
||||
|
||||
ix = ippGetResolution(attr, resolutions[i], &iy, &units);
|
||||
jx = ippGetResolution(attr, resolutions[j], &jy, &units);
|
||||
|
||||
if (ix > jx || (ix == jx && iy > jy))
|
||||
{
|
||||
/*
|
||||
* Swap these two resolutions...
|
||||
*/
|
||||
|
||||
temp = resolutions[i];
|
||||
resolutions[i] = resolutions[j];
|
||||
resolutions[j] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate print quality options...
|
||||
*/
|
||||
|
||||
pwg_ppdize_resolution(attr, resolutions[count / 2], &xres, &yres, ppdname, sizeof(ppdname));
|
||||
cupsFilePrintf(fp, "*DefaultResolution: %s\n", ppdname);
|
||||
|
||||
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality/%s: PickOne\n"
|
||||
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
|
||||
"*DefaultcupsPrintQuality: Normal\n", _cupsLangString(lang, _("Print Quality")));
|
||||
if (count > 2 || ippContainsInteger(quality, IPP_QUALITY_DRAFT))
|
||||
{
|
||||
pwg_ppdize_resolution(attr, resolutions[0], &xres, &yres, NULL, 0);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), xres, yres);
|
||||
}
|
||||
pwg_ppdize_resolution(attr, resolutions[count / 2], &xres, &yres, NULL, 0);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality Normal/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Normal")), xres, yres);
|
||||
if (count > 1 || ippContainsInteger(quality, IPP_QUALITY_HIGH))
|
||||
{
|
||||
pwg_ppdize_resolution(attr, resolutions[count - 1], &xres, &yres, NULL, 0);
|
||||
cupsFilePrintf(fp, "*cupsPrintQuality High/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("High")), xres, yres);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *cupsPrintQuality\n");
|
||||
}
|
||||
else if (is_apple || is_pwg)
|
||||
goto bad_ppd;
|
||||
else
|
||||
|
||||
+15
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Option marking routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -253,6 +253,7 @@ cupsMarkOptions(
|
||||
*/
|
||||
|
||||
for (i = num_options, optptr = options; i > 0; i --, optptr ++)
|
||||
{
|
||||
if (!_cups_strcasecmp(optptr->name, "media") ||
|
||||
!_cups_strcasecmp(optptr->name, "output-bin") ||
|
||||
!_cups_strcasecmp(optptr->name, "output-mode") ||
|
||||
@@ -341,6 +342,19 @@ cupsMarkOptions(
|
||||
ppd_mark_option(ppd, "MirrorPrint", optptr->value);
|
||||
else
|
||||
ppd_mark_option(ppd, optptr->name, optptr->value);
|
||||
}
|
||||
|
||||
if (print_quality)
|
||||
{
|
||||
int pq = atoi(print_quality); /* print-quaity value */
|
||||
|
||||
if (pq == IPP_QUALITY_DRAFT)
|
||||
ppd_mark_option(ppd, "cupsPrintQuality", "Draft");
|
||||
else if (pq == IPP_QUALITY_HIGH)
|
||||
ppd_mark_option(ppd, "cupsPrintQuality", "High");
|
||||
else
|
||||
ppd_mark_option(ppd, "cupsPrintQuality", "Normal");
|
||||
}
|
||||
|
||||
ppd_debug_marked(ppd, "After...");
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ static pwg_media_t const cups_pwg_media[] =
|
||||
_PWG_MEDIA_MM("jis_b1_728x1030mm", "jis-b1", "B1", 728, 1030),
|
||||
_PWG_MEDIA_MM("jis_b0_1030x1456mm", "jis-b0", "B0", 1030, 1456),
|
||||
_PWG_MEDIA_MM("jis_exec_216x330mm", NULL, "216x330mm", 216, 330),
|
||||
_PWG_MEDIA_MM("jpn_kaku1_270x382mm", NULL, "EnvKaku1", 270, 382),
|
||||
_PWG_MEDIA_MM("jpn_kaku2_240x332mm", NULL, "EnvKaku2", 240, 332),
|
||||
_PWG_MEDIA_MM("jpn_kaku3_216x277mm", NULL, "EnvKaku3", 216, 277),
|
||||
_PWG_MEDIA_MM("jpn_kaku4_197x267mm", NULL, "EnvKaku4", 197, 267),
|
||||
|
||||
+17
-17
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* IPP utilities for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -131,13 +131,12 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
if ((http = _cupsConnect()) == NULL)
|
||||
{
|
||||
ippDelete(request);
|
||||
if (!http && (http = _cupsConnect()) == NULL)
|
||||
{
|
||||
ippDelete(request);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* See if we have a file to send...
|
||||
@@ -151,9 +150,7 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
* Can't get file information!
|
||||
*/
|
||||
|
||||
_cupsSetError(errno == EBADF ? IPP_STATUS_ERROR_NOT_FOUND : IPP_STATUS_ERROR_NOT_AUTHORIZED,
|
||||
NULL, 0);
|
||||
|
||||
_cupsSetError(errno == EBADF ? IPP_STATUS_ERROR_NOT_FOUND : IPP_STATUS_ERROR_NOT_AUTHORIZED, NULL, 0);
|
||||
ippDelete(request);
|
||||
|
||||
return (NULL);
|
||||
@@ -169,9 +166,8 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
* Can't send a directory...
|
||||
*/
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
_cupsSetError(IPP_STATUS_ERROR_NOT_POSSIBLE, strerror(EISDIR), 0);
|
||||
ippDelete(request);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -186,8 +182,7 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
else
|
||||
length = ippLength(request);
|
||||
|
||||
DEBUG_printf(("2cupsDoIORequest: Request length=%ld, total length=%ld",
|
||||
(long)ippLength(request), (long)length));
|
||||
DEBUG_printf(("2cupsDoIORequest: Request length=%ld, total length=%ld", (long)ippLength(request), (long)length));
|
||||
|
||||
/*
|
||||
* Clear any "Local" authentication data since it is probably stale...
|
||||
@@ -596,6 +591,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
int got_status; /* Did we get the status? */
|
||||
ipp_state_t state; /* State of IPP processing */
|
||||
http_status_t expect; /* Expect: header to use */
|
||||
char date[256]; /* Date: header value */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsSendRequest(http=%p, request=%p(%s), resource=\"%s\", length=" CUPS_LLFMT ")", (void *)http, (void *)request, request ? ippOpString(request->request.op.operation_id) : "?", resource, CUPS_LLCAST length));
|
||||
@@ -615,9 +611,8 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
if ((http = _cupsConnect()) == NULL)
|
||||
return (HTTP_STATUS_SERVICE_UNAVAILABLE);
|
||||
if (!http && (http = _cupsConnect()) == NULL)
|
||||
return (HTTP_STATUS_SERVICE_UNAVAILABLE);
|
||||
|
||||
/*
|
||||
* If the prior request was not flushed out, do so now...
|
||||
@@ -685,6 +680,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
httpClearFields(http);
|
||||
httpSetExpect(http, expect);
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
|
||||
httpSetField(http, HTTP_FIELD_DATE, httpGetDateString2(time(NULL), date, (int)sizeof(date)));
|
||||
httpSetLength(http, length);
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
@@ -996,7 +992,11 @@ _cupsConnect(void)
|
||||
*/
|
||||
|
||||
if (strcmp(cg->http->hostname, cg->server) ||
|
||||
#ifdef AF_LOCAL
|
||||
(httpAddrFamily(cg->http->hostaddr) != AF_LOCAL && cg->ipp_port != httpAddrPort(cg->http->hostaddr)) ||
|
||||
#else
|
||||
cg->ipp_port != httpAddrPort(cg->http->hostaddr) ||
|
||||
#endif /* AF_LOCAL */
|
||||
(cg->http->encryption != cg->encryption &&
|
||||
cg->http->encryption == HTTP_ENCRYPTION_NEVER))
|
||||
{
|
||||
|
||||
+31
-16
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* CUPS API test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -47,7 +47,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
cups_dest_t *dests, /* Destinations */
|
||||
*dest, /* Current destination */
|
||||
*named_dest; /* Current named destination */
|
||||
const char *ppdfile; /* PPD file */
|
||||
const char *dest_name, /* Destination name */
|
||||
*dval, /* Destination value */
|
||||
*ppdfile; /* PPD file */
|
||||
ppd_file_t *ppd; /* PPD file data */
|
||||
int num_jobs; /* Number of jobs for queue */
|
||||
cups_job_t *jobs; /* Jobs for queue */
|
||||
@@ -360,11 +362,19 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* cupsGetDest(printer)
|
||||
*/
|
||||
|
||||
printf("cupsGetDest(\"%s\"): ", dests[num_dests / 2].name);
|
||||
for (i = 0, dest_name = NULL; i < num_dests; i ++)
|
||||
{
|
||||
if ((dval = cupsGetOption("printer-is-temporary", dests[i].num_options, dest[i].options)) != NULL && !strcmp(dval, "false"))
|
||||
{
|
||||
dest_name = dests[i].name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
printf("cupsGetDest(\"%s\"): ", dest_name ? dest_name : "(null)");
|
||||
fflush(stdout);
|
||||
|
||||
if ((dest = cupsGetDest(dests[num_dests / 2].name, NULL, num_dests,
|
||||
dests)) == NULL)
|
||||
if ((dest = cupsGetDest(dest_name, NULL, num_dests, dests)) == NULL)
|
||||
{
|
||||
puts("FAIL");
|
||||
return (1);
|
||||
@@ -380,8 +390,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
dest->instance ? dest->instance : "(null)");
|
||||
fflush(stdout);
|
||||
|
||||
if ((named_dest = cupsGetNamedDest(NULL, dest->name,
|
||||
dest->instance)) == NULL ||
|
||||
if ((named_dest = cupsGetNamedDest(NULL, dest->name, dest->instance)) == NULL ||
|
||||
!dests_equal(dest, named_dest))
|
||||
{
|
||||
if (named_dest)
|
||||
@@ -408,7 +417,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
fputs("cupsPrintFile: ", stdout);
|
||||
fflush(stdout);
|
||||
|
||||
if (cupsPrintFile(dest->name, "../data/testprint", "Test Page",
|
||||
if (cupsPrintFile(dest->name, "../test/testfile.pdf", "Test Page",
|
||||
dest->num_options, dest->options) <= 0)
|
||||
{
|
||||
printf("FAIL (%s)\n", cupsLastErrorString());
|
||||
@@ -421,7 +430,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* cupsGetPPD(printer)
|
||||
*/
|
||||
|
||||
fputs("cupsGetPPD(): ", stdout);
|
||||
fputs("cupsGetPPD: ", stdout);
|
||||
fflush(stdout);
|
||||
|
||||
if ((ppdfile = cupsGetPPD(dest->name)) == NULL)
|
||||
@@ -436,7 +445,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* ppdOpenFile()
|
||||
*/
|
||||
|
||||
fputs("ppdOpenFile(): ", stdout);
|
||||
fputs("ppdOpenFile: ", stdout);
|
||||
fflush(stdout);
|
||||
|
||||
if ((ppd = ppdOpenFile(ppdfile)) == NULL)
|
||||
@@ -550,33 +559,39 @@ show_diffs(cups_dest_t *a, /* I - First destination */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
cups_option_t *aoption; /* Current option */
|
||||
cups_option_t *boption; /* Current option */
|
||||
const char *bval; /* Option value */
|
||||
|
||||
|
||||
if (!a || !b)
|
||||
return;
|
||||
|
||||
puts(" Item cupsGetDest cupsGetNamedDest");
|
||||
puts(" -------------------- -------------------- --------------------");
|
||||
puts(" Item cupsGetDest cupsGetNamedDest");
|
||||
puts(" -------------------- ------------------------ ------------------------");
|
||||
|
||||
if (_cups_strcasecmp(a->name, b->name))
|
||||
printf(" name %-20.20s %-20.20s\n", a->name, b->name);
|
||||
printf(" name %-24.24s %-24.24s\n", a->name, b->name);
|
||||
|
||||
if ((a->instance && !b->instance) ||
|
||||
(!a->instance && b->instance) ||
|
||||
(a->instance && _cups_strcasecmp(a->instance, b->instance)))
|
||||
printf(" instance %-20.20s %-20.20s\n",
|
||||
printf(" instance %-24.24s %-24.24s\n",
|
||||
a->instance ? a->instance : "(null)",
|
||||
b->instance ? b->instance : "(null)");
|
||||
|
||||
if (a->num_options != b->num_options)
|
||||
printf(" num_options %-20d %-20d\n", a->num_options,
|
||||
printf(" num_options %-24d %-24d\n", a->num_options,
|
||||
b->num_options);
|
||||
|
||||
for (i = a->num_options, aoption = a->options; i > 0; i --, aoption ++)
|
||||
if ((bval = cupsGetOption(aoption->name, b->num_options,
|
||||
b->options)) == NULL ||
|
||||
strcmp(aoption->value, bval))
|
||||
printf(" %-20.20s %-20.20s %-20.20s\n", aoption->name,
|
||||
printf(" %-20.20s %-24.24s %-24.24s\n", aoption->name,
|
||||
aoption->value, bval ? bval : "(null)");
|
||||
|
||||
for (i = b->num_options, boption = b->options; i > 0; i --, boption ++)
|
||||
if (!cupsGetOption(boption->name, a->num_options, a->options))
|
||||
printf(" %-20.20s %-24.24s %-24.24s\n", boption->name,
|
||||
boption->value, "(null)");
|
||||
}
|
||||
|
||||
+53
-8
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* CUPS destination API test program for CUPS.
|
||||
*
|
||||
* Copyright 2012-2016 by Apple Inc.
|
||||
* Copyright 2012-2017 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -105,6 +105,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
else if (!strncmp(argv[1], "ipp://", 6) || !strncmp(argv[1], "ipps://", 7))
|
||||
dest = cupsGetDestWithURI(NULL, argv[1]);
|
||||
else if (!strcmp(argv[1], "default"))
|
||||
{
|
||||
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL);
|
||||
if (dest && dest->instance)
|
||||
printf("default is \"%s/%s\".\n", dest->name, dest->instance);
|
||||
else
|
||||
printf("default is \"%s\".\n", dest->name);
|
||||
}
|
||||
else
|
||||
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, argv[1], NULL);
|
||||
|
||||
@@ -463,10 +471,37 @@ show_default(http_t *http, /* I - Connection to destination */
|
||||
cups_dinfo_t *dinfo, /* I - Destination information */
|
||||
const char *option) /* I - Option */
|
||||
{
|
||||
(void)http;
|
||||
(void)dest;
|
||||
(void)dinfo;
|
||||
(void)option;
|
||||
if (!strcmp(option, "media"))
|
||||
{
|
||||
/*
|
||||
* Show default media option...
|
||||
*/
|
||||
|
||||
cups_size_t size; /* Media size information */
|
||||
|
||||
if (cupsGetDestMediaDefault(http, dest, dinfo, CUPS_MEDIA_FLAGS_DEFAULT, &size))
|
||||
printf("%s (%.2fx%.2fmm, margins=[%.2f %.2f %.2f %.2f])\n", size.media, size.width * 0.01, size.length * 0.01, size.left * 0.01, size.bottom * 0.01, size.right * 0.01, size.top * 0.01);
|
||||
else
|
||||
puts("FAILED");
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Show default other option...
|
||||
*/
|
||||
|
||||
ipp_attribute_t *defattr; /* Default attribute */
|
||||
|
||||
if ((defattr = cupsFindDestDefault(http, dest, dinfo, option)) != NULL)
|
||||
{
|
||||
char value[1024]; /* Value of default attribute */
|
||||
|
||||
ippAttributeString(defattr, value, sizeof(value));
|
||||
puts(value);
|
||||
}
|
||||
else
|
||||
puts("FAILED");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -594,7 +629,7 @@ show_supported(http_t *http, /* I - Connection to destination */
|
||||
}
|
||||
else if (!value)
|
||||
{
|
||||
printf("%s (%s)\n", option, cupsCheckDestSupported(http, dest, dinfo, option, NULL) ? "supported" : "not-supported");
|
||||
printf("%s (%s - %s)\n", option, cupsLocalizeDestOption(http, dest, dinfo, option), cupsCheckDestSupported(http, dest, dinfo, option, NULL) ? "supported" : "not-supported");
|
||||
|
||||
if ((attr = cupsFindDestSupported(http, dest, dinfo, option)) != NULL)
|
||||
{
|
||||
@@ -609,7 +644,13 @@ show_supported(http_t *http, /* I - Connection to destination */
|
||||
|
||||
case IPP_TAG_ENUM :
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %s\n", ippEnumString(option, ippGetInteger(attr, i)));
|
||||
{
|
||||
int val = ippGetInteger(attr, i);
|
||||
char valstr[256];
|
||||
|
||||
snprintf(valstr, sizeof(valstr), "%d", val);
|
||||
printf(" %s (%s)\n", ippEnumString(option, ippGetInteger(attr, i)), cupsLocalizeDestValue(http, dest, dinfo, option, valstr));
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
@@ -635,11 +676,15 @@ show_supported(http_t *http, /* I - Connection to destination */
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_KEYWORD :
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %s (%s)\n", ippGetString(attr, i, NULL), cupsLocalizeDestValue(http, dest, dinfo, option, ippGetString(attr, i, NULL)));
|
||||
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 :
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* CUPS cupsGetDests API test program for CUPS.
|
||||
*
|
||||
* Copyright 2017 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "cups.h"
|
||||
#include <sys/time.h>
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Loop calling cupsGetDests.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(void)
|
||||
{
|
||||
int num_dests; /* Number of destinations */
|
||||
cups_dest_t *dests; /* Destinations */
|
||||
struct timeval start, end; /* Start and stop time */
|
||||
double secs; /* Total seconds to run cupsGetDests */
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
gettimeofday(&start, NULL);
|
||||
num_dests = cupsGetDests(&dests);
|
||||
gettimeofday(&end, NULL);
|
||||
secs = end.tv_sec - start.tv_sec + 0.000001 * (end.tv_usec - start.tv_usec);
|
||||
|
||||
printf("Found %d printers in %.3f seconds...\n", num_dests, secs);
|
||||
|
||||
cupsFreeDests(num_dests, dests);
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
+5
-155
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* IPP test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -810,88 +810,9 @@ void
|
||||
print_attributes(ipp_t *ipp, /* I - IPP request */
|
||||
int indent) /* I - Indentation */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ipp_tag_t group; /* Current group */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
_ipp_value_t *val; /* Current value */
|
||||
static const char * const tags[] = /* Value/group tag strings */
|
||||
{
|
||||
"reserved-00",
|
||||
"operation-attributes-tag",
|
||||
"job-attributes-tag",
|
||||
"end-of-attributes-tag",
|
||||
"printer-attributes-tag",
|
||||
"unsupported-attributes-tag",
|
||||
"subscription-attributes-tag",
|
||||
"event-attributes-tag",
|
||||
"reserved-08",
|
||||
"reserved-09",
|
||||
"reserved-0A",
|
||||
"reserved-0B",
|
||||
"reserved-0C",
|
||||
"reserved-0D",
|
||||
"reserved-0E",
|
||||
"reserved-0F",
|
||||
"unsupported",
|
||||
"default",
|
||||
"unknown",
|
||||
"no-value",
|
||||
"reserved-14",
|
||||
"not-settable",
|
||||
"delete-attr",
|
||||
"admin-define",
|
||||
"reserved-18",
|
||||
"reserved-19",
|
||||
"reserved-1A",
|
||||
"reserved-1B",
|
||||
"reserved-1C",
|
||||
"reserved-1D",
|
||||
"reserved-1E",
|
||||
"reserved-1F",
|
||||
"reserved-20",
|
||||
"integer",
|
||||
"boolean",
|
||||
"enum",
|
||||
"reserved-24",
|
||||
"reserved-25",
|
||||
"reserved-26",
|
||||
"reserved-27",
|
||||
"reserved-28",
|
||||
"reserved-29",
|
||||
"reserved-2a",
|
||||
"reserved-2b",
|
||||
"reserved-2c",
|
||||
"reserved-2d",
|
||||
"reserved-2e",
|
||||
"reserved-2f",
|
||||
"octetString",
|
||||
"dateTime",
|
||||
"resolution",
|
||||
"rangeOfInteger",
|
||||
"begCollection",
|
||||
"textWithLanguage",
|
||||
"nameWithLanguage",
|
||||
"endCollection",
|
||||
"reserved-38",
|
||||
"reserved-39",
|
||||
"reserved-3a",
|
||||
"reserved-3b",
|
||||
"reserved-3c",
|
||||
"reserved-3d",
|
||||
"reserved-3e",
|
||||
"reserved-3f",
|
||||
"reserved-40",
|
||||
"textWithoutLanguage",
|
||||
"nameWithoutLanguage",
|
||||
"reserved-43",
|
||||
"keyword",
|
||||
"uri",
|
||||
"uriScheme",
|
||||
"charset",
|
||||
"naturalLanguage",
|
||||
"mimeMediaType",
|
||||
"memberName"
|
||||
};
|
||||
char buffer[2048]; /* Value string */
|
||||
|
||||
|
||||
for (group = IPP_TAG_ZERO, attr = ipp->attrs; attr; attr = attr->next)
|
||||
@@ -907,83 +828,12 @@ print_attributes(ipp_t *ipp, /* I - IPP request */
|
||||
{
|
||||
group = attr->group_tag;
|
||||
|
||||
printf("\n%*s%s:\n\n", indent - 4, "", tags[group]);
|
||||
printf("\n%*s%s:\n\n", indent - 4, "", ippTagString(group));
|
||||
}
|
||||
|
||||
printf("%*s%s (", indent, "", attr->name ? attr->name : "(null)");
|
||||
if (attr->num_values > 1)
|
||||
printf("1setOf ");
|
||||
printf("%s):", tags[attr->value_tag]);
|
||||
ippAttributeString(attr, buffer, sizeof(buffer));
|
||||
|
||||
switch (attr->value_tag)
|
||||
{
|
||||
case IPP_TAG_ENUM :
|
||||
case IPP_TAG_INTEGER :
|
||||
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
|
||||
printf(" %d", val->integer);
|
||||
putchar('\n');
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
|
||||
printf(" %s", val->boolean ? "true" : "false");
|
||||
putchar('\n');
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
|
||||
printf(" %d-%d", val->range.lower, val->range.upper);
|
||||
putchar('\n');
|
||||
break;
|
||||
|
||||
case IPP_TAG_DATE :
|
||||
{
|
||||
char vstring[256]; /* Formatted time */
|
||||
|
||||
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
|
||||
printf(" (%s)", _cupsStrDate(vstring, sizeof(vstring), ippDateToTime(val->date)));
|
||||
}
|
||||
putchar('\n');
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
|
||||
printf(" %dx%d%s", val->resolution.xres, val->resolution.yres,
|
||||
val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
putchar('\n');
|
||||
break;
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
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 :
|
||||
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
|
||||
printf(" \"%s\"", val->string.text);
|
||||
putchar('\n');
|
||||
break;
|
||||
|
||||
case IPP_TAG_BEGIN_COLLECTION :
|
||||
putchar('\n');
|
||||
|
||||
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
|
||||
{
|
||||
if (i)
|
||||
putchar('\n');
|
||||
print_attributes(val->collection, indent + 4);
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
printf("UNKNOWN (%d values)\n", attr->num_values);
|
||||
break;
|
||||
}
|
||||
printf("%*s%s (%s%s): %s\n", indent, "", attr->name ? attr->name : "(null)", attr->num_values > 1 ? "1setOf " : "", ippTagString(attr->value_tag), buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+146
-3
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Localization test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -19,6 +19,16 @@
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "ppd-private.h"
|
||||
#ifdef __APPLE__
|
||||
# include <CoreFoundation/CoreFoundation.h>
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int test_string(cups_lang_t *language, const char *msgid);
|
||||
|
||||
|
||||
/*
|
||||
@@ -71,8 +81,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
printf("Language = \"%s\"\n", language->language);
|
||||
printf("Encoding = \"%s\"\n", _cupsEncodingName(language->encoding));
|
||||
printf("No = \"%s\"\n", _cupsLangString(language, "No"));
|
||||
printf("Yes = \"%s\"\n", _cupsLangString(language, "Yes"));
|
||||
|
||||
errors += test_string(language, "No");
|
||||
errors += test_string(language, "Yes");
|
||||
|
||||
if (language != language2)
|
||||
{
|
||||
@@ -138,9 +149,141 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
}
|
||||
|
||||
printf("media-empty: %s\n", ppdLocalizeIPPReason(ppd, "media-empty", NULL, buffer, sizeof(buffer)));
|
||||
|
||||
ppdClose(ppd);
|
||||
}
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Test all possible language IDs for compatibility with _cupsAppleLocale...
|
||||
*/
|
||||
|
||||
CFIndex j, /* Looping var */
|
||||
num_locales; /* Number of locales */
|
||||
CFArrayRef locales; /* Locales */
|
||||
CFStringRef locale_id, /* Current locale ID */
|
||||
language_id; /* Current language ID */
|
||||
char locale_str[256], /* Locale ID C string */
|
||||
language_str[256], /* Language ID C string */
|
||||
*bufptr; /* Pointer to ".UTF-8" in POSIX locale */
|
||||
size_t buflen; /* Length of POSIX locale */
|
||||
# if TEST_COUNTRY_CODES
|
||||
CFIndex k, /* Looping var */
|
||||
num_country_codes; /* Number of country codes */
|
||||
CFArrayRef country_codes; /* Country codes */
|
||||
CFStringRef country_code, /* Current country code */
|
||||
temp_id; /* Temporary language ID */
|
||||
char country_str[256]; /* Country code C string */
|
||||
# endif /* TEST_COUNTRY_CODES */
|
||||
|
||||
locales = CFLocaleCopyAvailableLocaleIdentifiers();
|
||||
num_locales = CFArrayGetCount(locales);
|
||||
|
||||
# if TEST_COUNTRY_CODES
|
||||
country_codes = CFLocaleCopyISOCountryCodes();
|
||||
num_country_codes = CFArrayGetCount(country_codes);
|
||||
# endif /* TEST_COUNTRY_CODES */
|
||||
|
||||
printf("%d locales are available:\n", (int)num_locales);
|
||||
|
||||
for (j = 0; j < num_locales; j ++)
|
||||
{
|
||||
locale_id = CFArrayGetValueAtIndex(locales, j);
|
||||
language_id = CFLocaleCreateCanonicalLanguageIdentifierFromString(kCFAllocatorDefault, locale_id);
|
||||
|
||||
if (!locale_id || !CFStringGetCString(locale_id, locale_str, (CFIndex)sizeof(locale_str), kCFStringEncodingASCII))
|
||||
{
|
||||
printf("%d: FAIL (unable to get locale ID string)\n", (int)j + 1);
|
||||
errors ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!language_id || !CFStringGetCString(language_id, language_str, (CFIndex)sizeof(language_str), kCFStringEncodingASCII))
|
||||
{
|
||||
printf("%d %s: FAIL (unable to get language ID string)\n", (int)j + 1, locale_str);
|
||||
errors ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_cupsAppleLocale(language_id, buffer, sizeof(buffer)))
|
||||
{
|
||||
printf("%d %s(%s): FAIL (unable to convert language ID string to POSIX locale)\n", (int)j + 1, locale_str, language_str);
|
||||
errors ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((bufptr = strstr(buffer, ".UTF-8")) != NULL)
|
||||
buflen = (size_t)(bufptr - buffer);
|
||||
else
|
||||
buflen = strlen(buffer);
|
||||
|
||||
if ((language = cupsLangGet(buffer)) == NULL)
|
||||
{
|
||||
printf("%d %s(%s): FAIL (unable to load POSIX locale \"%s\")\n", (int)j + 1, locale_str, language_str, buffer);
|
||||
errors ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strncasecmp(language->language, buffer, buflen))
|
||||
{
|
||||
printf("%d %s(%s): FAIL (unable to load POSIX locale \"%s\", got \"%s\")\n", (int)j + 1, locale_str, language_str, buffer, language->language);
|
||||
errors ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("%d %s(%s): PASS (POSIX locale is \"%s\")\n", (int)j + 1, locale_str, language_str, buffer);
|
||||
}
|
||||
|
||||
CFRelease(locales);
|
||||
|
||||
# if TEST_COUNTRY_CODES
|
||||
CFRelease(country_codes);
|
||||
# endif /* TEST_COUNTRY_CODES */
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
if (errors == 0)
|
||||
puts("ALL TESTS PASSED");
|
||||
|
||||
return (errors > 0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'test_string()' - Test the localization of a string.
|
||||
*/
|
||||
|
||||
static int /* O - 1 on failure, 0 on success */
|
||||
test_string(cups_lang_t *language, /* I - Language */
|
||||
const char *msgid) /* I - Message */
|
||||
{
|
||||
const char *msgstr; /* Localized string */
|
||||
|
||||
|
||||
/*
|
||||
* Get the localized string and then see if we got what we expected.
|
||||
*
|
||||
* For the POSIX locale, the string pointers should be the same.
|
||||
* For any other locale, the string pointers should be different.
|
||||
*/
|
||||
|
||||
msgstr = _cupsLangString(language, msgid);
|
||||
if (strcmp(language->language, "C") && msgid == msgstr)
|
||||
{
|
||||
printf("%-8s = \"%s\" (FAIL - no message catalog loaded)\n", msgid, msgstr);
|
||||
return (1);
|
||||
}
|
||||
else if (!strcmp(language->language, "C") && msgid != msgstr)
|
||||
{
|
||||
printf("%-8s = \"%s\" (FAIL - POSIX locale is localized)\n", msgid, msgstr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
printf("%-8s = \"%s\" (PASS)\n", msgid, msgstr);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Private threading definitions for CUPS.
|
||||
*
|
||||
* Copyright 2009-2016 by Apple Inc.
|
||||
* Copyright 2009-2017 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -99,6 +99,7 @@ extern void _cupsRWLockWrite(_cups_rwlock_t *rwlock);
|
||||
extern void _cupsRWUnlock(_cups_rwlock_t *rwlock);
|
||||
extern void _cupsThreadCancel(_cups_thread_t thread);
|
||||
extern _cups_thread_t _cupsThreadCreate(_cups_thread_func_t func, void *arg);
|
||||
extern void _cupsThreadDetach(_cups_thread_t thread);
|
||||
extern void *_cupsThreadWait(_cups_thread_t thread);
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
||||
+24
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Threading primitives for CUPS.
|
||||
*
|
||||
* Copyright 2009-2016 by Apple Inc.
|
||||
* Copyright 2009-2017 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -172,6 +172,17 @@ _cupsThreadCreate(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsThreadDetach()' - Tell the OS that the thread is running independently.
|
||||
*/
|
||||
|
||||
void
|
||||
_cupsThreadDetach(_cups_thread_t thread)/* I - Thread ID */
|
||||
{
|
||||
pthread_detach(thread);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsThreadWait()' - Wait for a thread to exit.
|
||||
*/
|
||||
@@ -343,6 +354,18 @@ _cupsThreadCreate(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsThreadDetach()' - Tell the OS that the thread is running independently.
|
||||
*/
|
||||
|
||||
void
|
||||
_cupsThreadDetach(_cups_thread_t thread)/* I - Thread ID */
|
||||
{
|
||||
// TODO: Implement me
|
||||
(void)thread;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsThreadWait()' - Wait for a thread to exit.
|
||||
*/
|
||||
|
||||
+12
-2
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* TLS support code for CUPS on macOS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -1141,7 +1141,8 @@ _httpTLSRead(http_t *http, /* I - HTTP connection */
|
||||
void
|
||||
_httpTLSSetOptions(int options) /* I - Options */
|
||||
{
|
||||
tls_options = options;
|
||||
if (!(options & _HTTP_TLS_SET_DEFAULT) || tls_options < 0)
|
||||
tls_options = options;
|
||||
}
|
||||
|
||||
|
||||
@@ -1227,6 +1228,12 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
|
||||
error = SSLSetProtocolVersionMin(http->tls, minProtocol);
|
||||
DEBUG_printf(("4_httpTLSStart: SSLSetProtocolVersionMin(%d), error=%d", minProtocol, (int)error));
|
||||
|
||||
if (!error && (tls_options & _HTTP_TLS_ONLY_TLS10))
|
||||
{
|
||||
error = SSLSetProtocolVersionMax(http->tls, kTLSProtocol1);
|
||||
DEBUG_printf(("4_httpTLSStart: SSLSetProtocolVersionMax(kTLSProtocol1), error=%d", (int)error));
|
||||
}
|
||||
}
|
||||
|
||||
# if HAVE_SSLSETENABLEDCIPHERS
|
||||
@@ -1369,6 +1376,9 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 :
|
||||
case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 :
|
||||
case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 :
|
||||
case TLS_RSA_WITH_3DES_EDE_CBC_SHA :
|
||||
case TLS_RSA_WITH_AES_128_CBC_SHA :
|
||||
case TLS_RSA_WITH_AES_256_CBC_SHA :
|
||||
if (tls_options & _HTTP_TLS_DENY_CBC)
|
||||
{
|
||||
DEBUG_printf(("4_httpTLSStart: Excluding CBC cipher suite %d", supported[i]));
|
||||
|
||||
+13
-9
@@ -1226,7 +1226,8 @@ _httpTLSSetCredentials(http_t *http) /* I - Connection to server */
|
||||
void
|
||||
_httpTLSSetOptions(int options) /* I - Options */
|
||||
{
|
||||
tls_options = options;
|
||||
if (!(options & _HTTP_TLS_SET_DEFAULT) || tls_options < 0)
|
||||
tls_options = options;
|
||||
}
|
||||
|
||||
|
||||
@@ -1242,7 +1243,7 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
|
||||
int status; /* Status of handshake */
|
||||
gnutls_certificate_credentials_t *credentials;
|
||||
/* TLS credentials */
|
||||
char priority_string[1024];
|
||||
char priority_string[2048];
|
||||
/* Priority string */
|
||||
|
||||
|
||||
@@ -1508,18 +1509,21 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
|
||||
if (tls_options & _HTTP_TLS_DENY_TLS10)
|
||||
strlcat(priority_string, ":+VERS-TLS-ALL:-VERS-TLS1.0:-VERS-SSL3.0", sizeof(priority_string));
|
||||
else if (tls_options & _HTTP_TLS_ALLOW_SSL3)
|
||||
strlcat(priority_string, ":+VERS-TLS-ALL", sizeof(priority_string));
|
||||
strlcat(priority_string, ":+VERS-TLS-ALL:+VERS-SSL3.0", sizeof(priority_string));
|
||||
else if (tls_options & _HTTP_TLS_ONLY_TLS10)
|
||||
strlcat(priority_string, ":-VERS-TLS-ALL:-VERS-SSL3.0:+VERS-TLS1.0", sizeof(priority_string));
|
||||
else
|
||||
strlcat(priority_string, ":+VERS-TLS-ALL:-VERS-SSL3.0", sizeof(priority_string));
|
||||
|
||||
if (!(tls_options & _HTTP_TLS_ALLOW_RC4))
|
||||
strlcat(priority_string, ":-ARCFOUR-128", sizeof(priority_string));
|
||||
if (tls_options & _HTTP_TLS_ALLOW_RC4)
|
||||
strlcat(priority_string, ":+ARCFOUR-128", sizeof(priority_string));
|
||||
else
|
||||
strlcat(priority_string, ":!ARCFOUR-128", sizeof(priority_string));
|
||||
|
||||
if (!(tls_options & _HTTP_TLS_ALLOW_DH))
|
||||
strlcat(priority_string, ":!ANON-DH", sizeof(priority_string));
|
||||
strlcat(priority_string, ":!ANON-DH", sizeof(priority_string));
|
||||
|
||||
if (!(tls_options & _HTTP_TLS_DENY_CBC))
|
||||
strlcat(priority_string, ":!CBC", sizeof(priority_string));
|
||||
if (tls_options & _HTTP_TLS_DENY_CBC)
|
||||
strlcat(priority_string, ":!AES-128-CBC:!AES-256-CBC:!CAMELLIA-128-CBC:!CAMELLIA-256-CBC:!3DES-CBC", sizeof(priority_string));
|
||||
|
||||
#ifdef HAVE_GNUTLS_PRIORITY_SET_DIRECT
|
||||
gnutls_priority_set_direct(http->tls, priority_string, NULL);
|
||||
|
||||
+3
-2
@@ -2,7 +2,7 @@
|
||||
* TLS support for CUPS on Windows using the Security Support Provider
|
||||
* Interface (SSPI).
|
||||
*
|
||||
* Copyright 2010-2015 by Apple Inc.
|
||||
* Copyright 2010-2017 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -913,7 +913,8 @@ _httpTLSRead(http_t *http, /* I - HTTP connection */
|
||||
void
|
||||
_httpTLSSetOptions(int options) /* I - Options */
|
||||
{
|
||||
tls_options = options;
|
||||
if (!(options & _HTTP_TLS_SET_DEFAULT) || tls_options < 0)
|
||||
tls_options = options;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+11
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* TLS check program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -82,10 +82,18 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
tls_options |= _HTTP_TLS_ALLOW_DH;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--no-cbc"))
|
||||
{
|
||||
tls_options |= _HTTP_TLS_DENY_CBC;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--no-tls10"))
|
||||
{
|
||||
tls_options |= _HTTP_TLS_DENY_TLS10;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--tls10"))
|
||||
{
|
||||
tls_options |= _HTTP_TLS_ONLY_TLS10;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--rc4"))
|
||||
{
|
||||
tls_options |= _HTTP_TLS_ALLOW_RC4;
|
||||
@@ -729,8 +737,10 @@ usage(void)
|
||||
puts("");
|
||||
puts("Options:");
|
||||
puts(" --dh Allow DH/DHE key exchange");
|
||||
puts(" --no-cbc Disable CBC cipher suites");
|
||||
puts(" --no-tls10 Disable TLS/1.0");
|
||||
puts(" --rc4 Allow RC4 encryption");
|
||||
puts(" --tls10 Only use TLS/1.0");
|
||||
puts(" --verbose Be verbose");
|
||||
puts(" -4 Connect using IPv4 addresses only");
|
||||
puts(" -6 Connect using IPv6 addresses only");
|
||||
|
||||
+3
-3
@@ -957,7 +957,7 @@ _cupsSetDefaults(void)
|
||||
cg->validate_certs = cc.validate_certs;
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
_httpTLSSetOptions(cc.ssl_options);
|
||||
_httpTLSSetOptions(cc.ssl_options | _HTTP_TLS_SET_DEFAULT);
|
||||
#endif /* HAVE_SSL */
|
||||
}
|
||||
|
||||
@@ -1175,7 +1175,7 @@ cups_init_client_conf(
|
||||
* everything...)
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) && defined(HAVE_SSL)
|
||||
char sval[1024]; /* String value */
|
||||
int bval; /* Boolean value */
|
||||
|
||||
@@ -1196,7 +1196,7 @@ cups_init_client_conf(
|
||||
|
||||
if (cups_apple_get_boolean(kValidateCertsKey, &bval))
|
||||
cc->validate_certs = bval;
|
||||
#endif /* __APPLE__ */
|
||||
#endif /* __APPLE__ && HAVE_SSL */
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -140,9 +140,9 @@
|
||||
#media "EnvYou4/Envelope You4" 298 666
|
||||
#media "EnvYou4Rotated/Envelope You4 Long Edge" 666 298
|
||||
#media "Executive/Executive" 522 756
|
||||
#media "FanFoldGerman/FanFold German" 612 864
|
||||
#media "FanFoldGermanLegal/FanFold Legal German" 612 936
|
||||
#media "FanFoldUS/Fanfold US" 1071 792
|
||||
#media "FanFoldGerman/European Fanfold" 612 864
|
||||
#media "FanFoldGermanLegal/European Fanfold Legal" 612 936
|
||||
#media "FanFoldUS/US Fanfold" 1071 792
|
||||
#media "Folio/Folio" 595 935
|
||||
#media "ISOB0/B0" 2835 4008
|
||||
#media "ISOB1/B1" 2004 2835
|
||||
|
||||
Arquivo binário não exibido.
@@ -8,7 +8,7 @@
|
||||
<meta name="creator" content="Mini-XML v2.11">
|
||||
<meta name="author" content="Michael R Sweet">
|
||||
<meta name="copyright" content="Copyright © 2007-2017 by Apple Inc. All Rights Reserved.">
|
||||
<meta name="version" content="2.2.4">
|
||||
<meta name="version" content="2.2.5">
|
||||
<style type="text/css"><!--
|
||||
body, p, h1, h2, h3, h4 {
|
||||
font-family: sans-serif;
|
||||
@@ -1098,7 +1098,7 @@ if ((attr = ippFindAttribute(response, "printer-state",
|
||||
IPP_TAG_ENUM)) != NULL)
|
||||
{
|
||||
printf("printer-state=%s\n",
|
||||
ippTagString("printer-state", ippGetInteger(attr, 0)));
|
||||
ippEnumString("printer-state", ippGetInteger(attr, 0)));
|
||||
}
|
||||
else
|
||||
puts("printer-state=unknown");
|
||||
@@ -1122,7 +1122,7 @@ if ((attr = ippFindAttribute(response, "printer-state-reasons",
|
||||
</code></pre>
|
||||
<p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p>
|
||||
<p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p>
|
||||
<p>The <code>ippTagString</code> function converts a enum value to its keyword (string) equivalent.</p>
|
||||
<p>The <code>ippEnumString</code> function converts a enum value to its keyword (string) equivalent.</p>
|
||||
<p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p>
|
||||
<pre><code>ippDelete(response);
|
||||
</code></pre>
|
||||
|
||||
@@ -40,13 +40,14 @@ CUPS adds the remote hostname ("name@server.example.com") for you. The default n
|
||||
<b>Note: This directive is not supported on macOS 10.7 or later.</b>
|
||||
<dt><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]<b>/version=1.1</b>
|
||||
<dd style="margin-left: 5.0em">Specifies the address and optionally the port to use when connecting to a server running CUPS 1.3.12 and earlier.
|
||||
<dt><b>SSLOptions </b>[<i>AllowDH</i>] [<i>AllowRC4</i>] [<i>AllowSSL3</i>] [<i>DenyTLS1.0</i>]
|
||||
<dt><b>SSLOptions </b>[<i>AllowDH</i>] [<i>AllowRC4</i>] [<i>AllowSSL3</i>] [<i>DenyCBC</i>] [<i>DenyTLS1.0</i>]
|
||||
<dd style="margin-left: 5.0em"><dt><b>SSLOptions None</b>
|
||||
<dd style="margin-left: 5.0em">Sets encryption options (only in /etc/cups/client.conf).
|
||||
By default, CUPS only supports encryption using TLS v1.0 or higher using known secure cipher suites.
|
||||
The <i>AllowDH</i> option enables cipher suites using plain Diffie-Hellman key negotiation.
|
||||
The <i>AllowRC4</i> option enables the 128-bit RC4 cipher suites, which are required for some older clients that do not implement newer ones.
|
||||
The <i>AllowSSL3</i> option enables SSL v3.0, which is required for some older clients that do not support TLS v1.0.
|
||||
The <i>DenyCBC</i> option disables all CBC cipher suites.
|
||||
The <i>DenyTLS1.0</i> option disables TLS v1.0 support - this sets the minimum protocol version to TLS v1.1.
|
||||
<dt><b>TrustOnFirstUse Yes</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>TrustOnFirstUse No</b>
|
||||
|
||||
@@ -36,6 +36,9 @@ The server name may be included in filenames using the string "%s", for example:
|
||||
|
||||
</pre>
|
||||
The default is "/var/log/cups/access_log".
|
||||
<dt><a name="CacheDir"></a><b>CacheDir </b><i>directory</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the directory to use for long-lived temporary (cache) files.
|
||||
The default is "/var/spool/cups/cache" or "/var/cache/cups" depending on the platform.
|
||||
<dt><a name="ConfigFilePerm"></a><b>ConfigFilePerm </b><i>mode</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the permissions for all configuration files that the scheduler writes.
|
||||
The default is "0644" on macOS and "0640" on all other operating systems.
|
||||
@@ -137,6 +140,9 @@ macOS uses its keychain database to store certificates and keys while other plat
|
||||
<dt><a name="ServerRoot"></a><b>ServerRoot </b><i>directory</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the directory containing the server configuration files.
|
||||
The default is "/etc/cups".
|
||||
<dt><a name="StateDir"></a><b>StateDir </b><i>directory</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the directory to use for PID and local certificate files.
|
||||
The default is "/var/run/cups" or "/etc/cups" depending on the platform.
|
||||
<dt><a name="SyncOnClose"></a><b>SyncOnClose Yes</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>SyncOnClose No</b>
|
||||
<dd style="margin-left: 5.0em">Specifies whether the scheduler calls
|
||||
@@ -147,12 +153,35 @@ The default is "No".
|
||||
<dd style="margin-left: 5.0em">Specifies the group(s) to use for <i>@SYSTEM</i> group authentication.
|
||||
The default contains "admin", "lpadmin", "root", "sys", and/or "system".
|
||||
<dt><a name="TempDir"></a><b>TempDir </b><i>directory</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the directory where temporary files are stored.
|
||||
<dd style="margin-left: 5.0em">Specifies the directory where short-term temporary files are stored.
|
||||
The default is "/var/spool/cups/tmp".
|
||||
<dt><a name="User"></a><b>User </b><i>username</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the user name or ID that is used when running external programs.
|
||||
The default is "lp".
|
||||
</dl>
|
||||
<h3><a name="DEPRECATED_DIRECTIVES">Deprecated Directives</a></h3>
|
||||
The following directives are deprecated and will be removed from a future version of CUPS:
|
||||
<dl class="man">
|
||||
<dt><a name="FontPath"></a><b>FontPath </b><i>directory[:...:directoryN]</i>
|
||||
<dd style="margin-left: 5.0em">Specifies a colon separated list of directories where fonts can be found.
|
||||
On Linux the
|
||||
<b>font-config</b>(1)
|
||||
mechanism is used instead.
|
||||
On macOS the Font Book application manages system-installed fonts.
|
||||
<dt><a name="LPDConfigFile"></a><b> LPDConfigFile </b><i>filename</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the LPD service configuration file to update.
|
||||
<dt><a name="Printcap"></a><b>Printcap </b><i>filename</i>
|
||||
<dd style="margin-left: 5.0em">Specifies a file that is filled with a list of local print queues.
|
||||
<dt><a name="PrintcapFormat"></a><b>PrintcapFormat bsd</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>PrintcapFormat plist</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>PrintcapFormat solaris</b>
|
||||
<dd style="margin-left: 5.0em">Specifies the format to use for the Printcap file.
|
||||
"bsd" is the historical LPD printcap file format.
|
||||
"plist" is the Apple plist file format.
|
||||
"solaris" is the historical Solaris LPD printcap file format.
|
||||
<dt><a name="SMBConfigFile"></a><b>SMBConfigFile </b><i>filename</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the SMB service configuration file to update.
|
||||
</dl>
|
||||
<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
|
||||
<a href="man-classes.conf.html?TOPIC=Man+Pages"><b>classes.conf</b>(5),</a>
|
||||
<a href="man-cups.html?TOPIC=Man+Pages"><b>cups</b>(1),</a>
|
||||
|
||||
@@ -56,16 +56,6 @@ The default is "No".
|
||||
<dd style="margin-left: 5.0em"><br>
|
||||
Specifies whether shared printers are advertised.
|
||||
The default is "No".
|
||||
<dt><a name="Classification"></a><b>Classification </b><i>banner</i>
|
||||
<dd style="margin-left: 5.0em"><br>
|
||||
Specifies the security classification of the server.
|
||||
Any valid banner name can be used, including "classified", "confidential", "secret", "topsecret", and "unclassified", or the banner can be omitted to disable secure printing functions.
|
||||
The default is no classification banner.
|
||||
<dt><a name="ClassifyOverride"></a><b>ClassifyOverride Yes</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>ClassifyOverride No</b>
|
||||
<dd style="margin-left: 5.0em"><br>
|
||||
Specifies whether users may override the classification (cover page) of individual print jobs using the "job-sheets" option.
|
||||
The default is "No".
|
||||
<dt><a name="DefaultAuthType"></a><b>DefaultAuthType Basic</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>DefaultAuthType Negotiate</b>
|
||||
<dd style="margin-left: 5.0em"><br>
|
||||
@@ -230,24 +220,6 @@ The default is "1048576" (1MB).
|
||||
<dt><a name="MultipleOperationTimeout"></a><b>MultipleOperationTimeout </b><i>seconds</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the maximum amount of time to allow between files in a multiple file print job.
|
||||
The default is "300" (5 minutes).
|
||||
<dt><a name="PageLogFormat"></a><b>PageLogFormat </b><i>format-string</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the format of PageLog lines.
|
||||
Sequences beginning with percent (%) characters are replaced with the corresponding information, while all other characters are copied literally.
|
||||
The following percent sequences are recognized:
|
||||
<pre class="man">
|
||||
|
||||
"%%" inserts a single percent character.
|
||||
"%{name}" inserts the value of the specified IPP attribute.
|
||||
"%C" inserts the number of copies for the current page.
|
||||
"%P" inserts the current page number.
|
||||
"%T" inserts the current date and time in common log format.
|
||||
"%j" inserts the job ID.
|
||||
"%p" inserts the printer name.
|
||||
"%u" inserts the username.
|
||||
|
||||
</pre>
|
||||
The default is the empty string, which disables page logging.
|
||||
The string "%p %u %j %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}" creates a page log with the standard items.
|
||||
<dt><a name="PassEnv"></a><b>PassEnv </b><i>variable </i>[ ... <i>variable </i>]
|
||||
<dd style="margin-left: 5.0em">Passes the specified environment variable(s) to child processes.
|
||||
<dt><a name="Policy"></a><b><Policy </b><i>name</i><b>> </b>... <b></Policy></b>
|
||||
@@ -270,9 +242,6 @@ The default is "Yes".
|
||||
<dt><a name="ReloadTimeout"></a><b>ReloadTimeout </b><i>seconds</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the amount of time to wait for job completion before restarting the scheduler.
|
||||
The default is "30".
|
||||
<dt><a name="RIPCache"></a><b>RIPCache </b><i>size</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the maximum amount of memory to use when converting documents into bitmaps for a printer.
|
||||
The default is "128m".
|
||||
<dt><a name="ServerAdmin"></a><b>ServerAdmin </b><i>email-address</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the email address of the server administrator.
|
||||
The default value is "root@ServerName".
|
||||
@@ -310,12 +279,15 @@ The default is "Minimal".
|
||||
<dd style="margin-left: 5.0em"><dt><b>SSLListen [</b><i>ipv6-address</i><b>]:</b><i>port</i>
|
||||
<dd style="margin-left: 5.0em"><dt><b>SSLListen *:</b><i>port</i>
|
||||
<dd style="margin-left: 5.0em">Listens on the specified address and port for encrypted connections.
|
||||
<dt><a name="SSLOptions"></a><b>SSLOptions </b>[<i>AllowRC4</i>] [<i>AllowSSL3</i>]
|
||||
<dt><a name="SSLOptions"></a><b>SSLOptions </b>[<i>AllowDH</i>] [<i>AllowRC4</i>] [<i>AllowSSL3</i>] [<i>DenyCBC</i>] [<i>DenyTLS1.0</i>]
|
||||
<dd style="margin-left: 5.0em"><dt><b>SSLOptions None</b>
|
||||
<dd style="margin-left: 5.0em">Sets encryption options.
|
||||
By default, CUPS only supports encryption using TLS v1.0 or higher using known secure cipher suites.
|
||||
The <i>AllowDH</i> option enables cipher suites using plain Diffie-Hellman key negotiation.
|
||||
The <i>AllowRC4</i> option enables the 128-bit RC4 cipher suites, which are required for some older clients that do not implement newer ones.
|
||||
The <i>AllowSSL3</i> option enables SSL v3.0, which is required for some older clients that do not support TLS v1.0.
|
||||
The <i>DenyCBC</i> option disables all CBC cipher suites.
|
||||
The <i>DenyTLS1.0</i> option disables TLS v1.0 support - this sets the minimum protocol version to TLS v1.1.
|
||||
<dt><a name="SSLPort"></a><b>SSLPort </b><i>port</i>
|
||||
<dd style="margin-left: 5.0em">Listens on the specified port for encrypted connections.
|
||||
<dt><a name="StrictConformance"></a><b>StrictConformance Yes</b>
|
||||
@@ -564,6 +536,41 @@ file.
|
||||
<dd style="margin-left: 5.0em">Specifies the list of subscription values to make private.
|
||||
The "default" values are "notify-events", "notify-pull-method", "notify-recipient-uri", "notify-subscriber-user-name", and "notify-user-data".
|
||||
</dl>
|
||||
<h3><a name="DEPRECATED_DIRECTIVES">Deprecated Directives</a></h3>
|
||||
The following directives are deprecated and will be removed in a future release of CUPS:
|
||||
<dl class="man">
|
||||
<dt><a name="Classification"></a><b>Classification </b><i>banner</i>
|
||||
<dd style="margin-left: 5.0em"><br>
|
||||
Specifies the security classification of the server.
|
||||
Any valid banner name can be used, including "classified", "confidential", "secret", "topsecret", and "unclassified", or the banner can be omitted to disable secure printing functions.
|
||||
The default is no classification banner.
|
||||
<dt><a name="ClassifyOverride"></a><b>ClassifyOverride Yes</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>ClassifyOverride No</b>
|
||||
<dd style="margin-left: 5.0em"><br>
|
||||
Specifies whether users may override the classification (cover page) of individual print jobs using the "job-sheets" option.
|
||||
The default is "No".
|
||||
<dt><a name="PageLogFormat"></a><b>PageLogFormat </b><i>format-string</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the format of PageLog lines.
|
||||
Sequences beginning with percent (%) characters are replaced with the corresponding information, while all other characters are copied literally.
|
||||
The following percent sequences are recognized:
|
||||
<pre class="man">
|
||||
|
||||
"%%" inserts a single percent character.
|
||||
"%{name}" inserts the value of the specified IPP attribute.
|
||||
"%C" inserts the number of copies for the current page.
|
||||
"%P" inserts the current page number.
|
||||
"%T" inserts the current date and time in common log format.
|
||||
"%j" inserts the job ID.
|
||||
"%p" inserts the printer name.
|
||||
"%u" inserts the username.
|
||||
|
||||
</pre>
|
||||
The default is the empty string, which disables page logging.
|
||||
The string "%p %u %j %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}" creates a page log with the standard items.
|
||||
<dt><a name="RIPCache"></a><b>RIPCache </b><i>size</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the maximum amount of memory to use when converting documents into bitmaps for a printer.
|
||||
The default is "128m".
|
||||
</dl>
|
||||
<h2 class="title"><a name="CONFORMING_TO">Conforming To</a></h2>
|
||||
The <b>cupsd.conf</b> file format is based on the Apache HTTP Server configuration file format.
|
||||
<h2 class="title"><a name="EXAMPLES">Examples</a></h2>
|
||||
|
||||
@@ -51,6 +51,8 @@ ipptool - perform internet printing protocol requests
|
||||
<b>-f</b>
|
||||
<i>filename</i>
|
||||
] [
|
||||
<b>-h</b>
|
||||
] [
|
||||
<b>-i</b>
|
||||
<i>seconds</i>
|
||||
] [
|
||||
@@ -134,6 +136,8 @@ This option is incompatible with the <b>-i</b> (interval) and <b>-n</b> (repeat-
|
||||
<dd style="margin-left: 5.0em">Defines the named variable.
|
||||
<dt><b>-f</b><i> filename</i>
|
||||
<dd style="margin-left: 5.0em">Defines the default request filename for tests.
|
||||
<dt><b>-h</b>
|
||||
<dd style="margin-left: 5.0em">Validate HTTP response headers.
|
||||
<dt><b>-i</b><i> seconds</i>
|
||||
<dd style="margin-left: 5.0em">Specifies that the (last)
|
||||
<i>testfile</i>
|
||||
|
||||
@@ -139,9 +139,11 @@ command-line. Support for content length requests is required for conformance wi
|
||||
<h3><a name="TEST_DIRECTIVES">Test Directives</a></h3>
|
||||
The following directives are understood within a <i>test</i>:
|
||||
<dl class="man">
|
||||
<dt><b>ATTR </b><i>tag attribute-name value(s)</i>
|
||||
<dt><b>ATTR </b><i>out-of-band-tag attribute-name</i>
|
||||
<dd style="margin-left: 5.0em"><dt><b>ATTR </b><i>tag attribute-name value(s)</i>
|
||||
<dd style="margin-left: 5.0em">Adds an attribute to the test request.
|
||||
Values are separated by the comma (",") character - escape commas using the "" character.
|
||||
Out-of-band tags (admin-define, delete-attribute, no-value, not-settable, unknown, unsupported) have no value.
|
||||
Values for other tags are separated by the comma (",") character - escape commas using the "" character.
|
||||
Common attributes and values are listed in the IANA IPP registry - see references below.
|
||||
<dt><b>ATTR collection </b><i>attribute-name </i><b>{ MEMBER </b><i>tag member-name value(s) ... </i><b>}</b> [ <i>... </i><b>,{ </b><i>... </i><b>} </b>]
|
||||
<dd style="margin-left: 5.0em">Adds a collection attribute to the test request.
|
||||
@@ -303,7 +305,7 @@ Specifies the maximum number of times to repeat. The default value is 1000.
|
||||
<dd style="margin-left: 5.0em">Specifies that the current test should be repeated when the response status-code matches or does not match the value specified by the STATUS directive.
|
||||
</dl>
|
||||
<h3><a name="OPERATION_CODES">Operation Codes</a></h3>
|
||||
Operation codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC 2911 and other IPP extension specifications. Here is a complete list of names supported by
|
||||
Operation codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC 8011 and other IPP extension specifications. Here is a complete list of names supported by
|
||||
<a href="man-ipptool.html?TOPIC=Man+Pages"><b>ipptool</b>(8):</a>
|
||||
<pre class="man">
|
||||
|
||||
@@ -376,7 +378,7 @@ Operation codes correspond to the hexadecimal numbers (0xHHHH) and names from RF
|
||||
Validate-Job
|
||||
</pre>
|
||||
<h3><a name="STATUS_CODES">Status Codes</a></h3>
|
||||
Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC 2911 and other IPP extension specifications. Here is a complete list of the names supported by
|
||||
Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC 8011 and other IPP extension specifications. Here is a complete list of the names supported by
|
||||
<a href="man-ipptool.html?TOPIC=Man+Pages"><b>ipptool</b>(8):</a>
|
||||
<pre class="man">
|
||||
|
||||
@@ -439,7 +441,7 @@ Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC 2
|
||||
successful-ok-too-many-events
|
||||
</pre>
|
||||
<h3><a name="TAGS">Tags</a></h3>
|
||||
Value and group tags correspond to the names from RFC 2911 and other IPP extension specifications. Here are the group tags:
|
||||
Value and group tags correspond to the names from RFC 8011 and other IPP extension specifications. Here are the group tags:
|
||||
<pre class="man">
|
||||
|
||||
document-attributes-tag
|
||||
|
||||
+24
-12
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Filter makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -29,6 +29,7 @@ LIBTARGETS = \
|
||||
libcupsimage.a
|
||||
UNITTARGETS = \
|
||||
rasterbench \
|
||||
testclient \
|
||||
testraster
|
||||
TARGETS = \
|
||||
$(LIBTARGETS) \
|
||||
@@ -38,7 +39,7 @@ IMAGEOBJS = error.o interpret.o raster.o
|
||||
OBJS = $(IMAGEOBJS) \
|
||||
commandtops.o gziptoany.o common.o pstops.o \
|
||||
rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
|
||||
rastertopwg.o testraster.o
|
||||
rastertopwg.o testclient.o testraster.o
|
||||
|
||||
|
||||
#
|
||||
@@ -216,7 +217,7 @@ apihelp:
|
||||
|
||||
commandtops: commandtops.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -225,7 +226,7 @@ commandtops: commandtops.o ../cups/$(LIBCUPS)
|
||||
|
||||
gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -295,7 +296,7 @@ libcupsimage.a: $(IMAGEOBJS)
|
||||
|
||||
pstops: pstops.o common.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -304,7 +305,7 @@ pstops: pstops.o common.o ../cups/$(LIBCUPS)
|
||||
|
||||
rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -313,7 +314,7 @@ rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
|
||||
|
||||
rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -322,7 +323,7 @@ rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
|
||||
|
||||
rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -331,22 +332,33 @@ rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
|
||||
|
||||
rastertopwg: rastertopwg.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ rastertopwg.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ rastertopwg.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
|
||||
|
||||
rastertopwg-static: rastertopwg.o ../cups/$(LIBCUPSSTATIC) libcupsimage.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ rastertopwg.o libcupsimage.a \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ rastertopwg.o libcupsimage.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
|
||||
$(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
|
||||
|
||||
|
||||
#
|
||||
# testclient (dependency on static libraries is intentional)
|
||||
#
|
||||
|
||||
testclient: testclient.o ../cups/$(LIBCUPSSTATIC) libcupsimage.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testclient.o \
|
||||
libcupsimage.a ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# testraster
|
||||
#
|
||||
|
||||
testraster: testraster.o ../cups/$(LIBCUPSSTATIC) libcupsimage.a
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
|
||||
$(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
|
||||
echo Running raster API tests...
|
||||
@@ -359,7 +371,7 @@ testraster: testraster.o ../cups/$(LIBCUPSSTATIC) libcupsimage.a
|
||||
|
||||
rasterbench: rasterbench.o libcupsimage.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -0,0 +1,960 @@
|
||||
/*
|
||||
* Simulated client test program for CUPS.
|
||||
*
|
||||
* Copyright 2017 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/raster.h>
|
||||
#include <cups/string-private.h>
|
||||
#include <cups/thread-private.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local types...
|
||||
*/
|
||||
|
||||
typedef struct _client_monitor_s
|
||||
{
|
||||
const char *uri, /* Printer URI */
|
||||
*hostname, /* Hostname */
|
||||
*user, /* Username */
|
||||
*resource; /* Resource path */
|
||||
int port; /* Port number */
|
||||
http_encryption_t encryption; /* Use encryption? */
|
||||
ipp_pstate_t printer_state; /* Current printer state */
|
||||
char printer_state_reasons[1024];
|
||||
/* Current printer-state-reasons */
|
||||
int job_id; /* Job ID for submitted job */
|
||||
ipp_jstate_t job_state; /* Current job state */
|
||||
char job_state_reasons[1024];
|
||||
/* Current job-state-reasons */
|
||||
} _client_monitor_t;
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static const char *make_raster_file(ipp_t *response, int grayscale, char *tempname, size_t tempsize, const char **format);
|
||||
static void *monitor_printer(_client_monitor_t *monitor);
|
||||
static void show_attributes(const char *title, int request, ipp_t *ipp);
|
||||
static void show_capabilities(ipp_t *response);
|
||||
static void usage(void);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
const char *opt, /* Current option */
|
||||
*uri = NULL, /* Printer URI */
|
||||
*printfile = NULL,
|
||||
/* Print file */
|
||||
*printformat = NULL;
|
||||
/* Print format */
|
||||
int keepfile = 0, /* Keep temp file? */
|
||||
grayscale = 0, /* Force grayscale? */
|
||||
verbosity = 0; /* Verbosity */
|
||||
char tempfile[1024] = "",
|
||||
/* Temporary file (if any) */
|
||||
scheme[32], /* URI scheme */
|
||||
userpass[256], /* Username:password */
|
||||
hostname[256], /* Hostname */
|
||||
resource[256]; /* Resource path */
|
||||
int port; /* Port number */
|
||||
http_encryption_t encryption; /* Encryption mode */
|
||||
_client_monitor_t monitor; /* Monitoring data */
|
||||
http_t *http; /* HTTP connection */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
static const char * const pattrs[] = /* Printer attributes we are interested in */
|
||||
{
|
||||
"job-template",
|
||||
"printer-defaults",
|
||||
"printer-description",
|
||||
"media-col-database",
|
||||
"media-col-ready"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Parse command-line options...
|
||||
*/
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (argv[i][0] == '-')
|
||||
{
|
||||
for (opt = argv[i] + 1; *opt; opt ++)
|
||||
{
|
||||
switch (*opt)
|
||||
{
|
||||
case 'd' : /* -d document-format */
|
||||
if (printformat)
|
||||
{
|
||||
puts("Document format can only be specified once.");
|
||||
usage();
|
||||
return (1);
|
||||
}
|
||||
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
puts("Expected document format after '-d'.");
|
||||
usage();
|
||||
return (1);
|
||||
}
|
||||
|
||||
printformat = argv[i];
|
||||
break;
|
||||
|
||||
case 'f' : /* -f print-file */
|
||||
if (printfile)
|
||||
{
|
||||
puts("Print file can only be specified once.");
|
||||
usage();
|
||||
return (1);
|
||||
}
|
||||
|
||||
i ++;
|
||||
if (i >= argc)
|
||||
{
|
||||
puts("Expected print file after '-f'.");
|
||||
usage();
|
||||
return (1);
|
||||
}
|
||||
|
||||
printfile = argv[i];
|
||||
break;
|
||||
|
||||
case 'g' :
|
||||
grayscale = 1;
|
||||
break;
|
||||
|
||||
case 'k' :
|
||||
keepfile = 1;
|
||||
break;
|
||||
|
||||
case 'v' :
|
||||
verbosity ++;
|
||||
break;
|
||||
|
||||
default :
|
||||
printf("Unknown option '-%c'.\n", *opt);
|
||||
usage();
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (uri || (strncmp(argv[i], "ipp://", 6) && strncmp(argv[i], "ipps://", 7)))
|
||||
{
|
||||
printf("Unknown command-line argument '%s'.\n", argv[i]);
|
||||
usage();
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
uri = argv[i];
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure we have everything we need.
|
||||
*/
|
||||
|
||||
if (!uri)
|
||||
{
|
||||
puts("Expected printer URI.");
|
||||
usage();
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Connect to the printer...
|
||||
*/
|
||||
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), hostname, sizeof(hostname), &port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK)
|
||||
{
|
||||
printf("Bad printer URI '%s'.\n", uri);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (!port)
|
||||
port = IPP_PORT;
|
||||
|
||||
if (!strcmp(scheme, "https") || !strcmp(scheme, "ipps"))
|
||||
encryption = HTTP_ENCRYPTION_ALWAYS;
|
||||
else
|
||||
encryption = HTTP_ENCRYPTION_IF_REQUESTED;
|
||||
|
||||
if ((http = httpConnect2(hostname, port, NULL, AF_UNSPEC, encryption, 1, 0, NULL)) == NULL)
|
||||
{
|
||||
printf("Unable to connect to '%s' on port %d: %s\n", hostname, port, cupsLastErrorString());
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Query printer status and capabilities...
|
||||
*/
|
||||
|
||||
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(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
|
||||
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
|
||||
if (verbosity)
|
||||
show_capabilities(response);
|
||||
|
||||
/*
|
||||
* Now figure out what we will be printing...
|
||||
*/
|
||||
|
||||
if (printfile)
|
||||
{
|
||||
/*
|
||||
* User specified a print file, figure out the format...
|
||||
*/
|
||||
|
||||
if ((opt = strrchr(printfile, '.')) != NULL)
|
||||
{
|
||||
/*
|
||||
* Guess the format from the extension...
|
||||
*/
|
||||
|
||||
if (!strcmp(opt, ".jpg"))
|
||||
printformat = "image/jpeg";
|
||||
else if (!strcmp(opt, ".pdf"))
|
||||
printformat = "application/pdf";
|
||||
else if (!strcmp(opt, ".ps"))
|
||||
printformat = "application/postscript";
|
||||
else if (!strcmp(opt, ".pwg"))
|
||||
printformat = "image/pwg-raster";
|
||||
else if (!strcmp(opt, ".urf"))
|
||||
printformat = "image/urf";
|
||||
else
|
||||
printformat = "application/octet-stream";
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Tell the printer to auto-detect...
|
||||
*/
|
||||
|
||||
printformat = "application/octet-stream";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* No file specified, make something to test with...
|
||||
*/
|
||||
|
||||
if ((printfile = make_raster_file(response, grayscale, tempfile, sizeof(tempfile), &printformat)) == NULL)
|
||||
return (1);
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
/*
|
||||
* Start monitoring the printer in the background...
|
||||
*/
|
||||
|
||||
memset(&monitor, 0, sizeof(monitor));
|
||||
|
||||
monitor.uri = uri;
|
||||
monitor.hostname = hostname;
|
||||
monitor.resource = resource;
|
||||
monitor.port = port;
|
||||
monitor.encryption = encryption;
|
||||
|
||||
_cupsThreadCreate((_cups_thread_func_t)monitor_printer, &monitor);
|
||||
|
||||
/*
|
||||
* Create the job and wait for completion...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_OP_CREATE_JOB);
|
||||
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());
|
||||
|
||||
if ((opt = strrchr(printfile, '/')) != NULL)
|
||||
opt ++;
|
||||
else
|
||||
opt = printfile;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, opt);
|
||||
|
||||
if (verbosity)
|
||||
show_attributes("Create-Job request", 1, request);
|
||||
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
|
||||
if (verbosity)
|
||||
show_attributes("Create-Job response", 0, response);
|
||||
|
||||
if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
|
||||
{
|
||||
printf("Unable to create print job: %s\n", cupsLastErrorString());
|
||||
|
||||
monitor.job_state = IPP_JSTATE_ABORTED;
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) == NULL)
|
||||
{
|
||||
puts("No job-id returned in Create-Job request.");
|
||||
|
||||
monitor.job_state = IPP_JSTATE_ABORTED;
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
monitor.job_id = ippGetInteger(attr, 0);
|
||||
|
||||
printf("CREATED JOB %d, sending %s of type %s\n", monitor.job_id, printfile, printformat);
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
request = ippNewRequest(IPP_OP_SEND_DOCUMENT);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", monitor.job_id);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", NULL, printformat);
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
|
||||
|
||||
if (verbosity)
|
||||
show_attributes("Send-Document request", 1, request);
|
||||
|
||||
response = cupsDoFileRequest(http, request, resource, printfile);
|
||||
|
||||
if (verbosity)
|
||||
show_attributes("Send-Document response", 0, response);
|
||||
|
||||
if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
|
||||
{
|
||||
printf("Unable to print file: %s\n", cupsLastErrorString());
|
||||
|
||||
monitor.job_state = IPP_JSTATE_ABORTED;
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
puts("WAITING FOR JOB TO COMPLETE");
|
||||
|
||||
while (monitor.job_state < IPP_JSTATE_CANCELED)
|
||||
sleep(1);
|
||||
|
||||
/*
|
||||
* Cleanup after ourselves...
|
||||
*/
|
||||
|
||||
cleanup:
|
||||
|
||||
httpClose(http);
|
||||
|
||||
if (tempfile[0] && !keepfile)
|
||||
unlink(tempfile);
|
||||
|
||||
return (monitor.job_state == IPP_JSTATE_COMPLETED);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'make_raster_file()' - Create a temporary raster file.
|
||||
*/
|
||||
|
||||
static const char * /* O - Print filename */
|
||||
make_raster_file(ipp_t *response, /* I - Printer attributes */
|
||||
int grayscale, /* I - Force grayscale? */
|
||||
char *tempname, /* I - Temporary filename buffer */
|
||||
size_t tempsize, /* I - Size of temp file buffer */
|
||||
const char **format) /* O - Print format */
|
||||
{
|
||||
int i, /* Looping var */
|
||||
count; /* Number of values */
|
||||
ipp_attribute_t *attr; /* Printer attribute */
|
||||
const char *type = NULL; /* Raster type (colorspace + bits) */
|
||||
pwg_media_t *media = NULL; /* Media size */
|
||||
int xdpi = 0, /* Horizontal resolution */
|
||||
ydpi = 0; /* Vertical resolution */
|
||||
int fd; /* Temporary file */
|
||||
cups_mode_t mode; /* Raster mode */
|
||||
cups_raster_t *ras; /* Raster stream */
|
||||
cups_page_header2_t header; /* Page header */
|
||||
unsigned char *line, /* Line of raster data */
|
||||
*lineptr; /* Pointer into line */
|
||||
unsigned y, /* Current position on page */
|
||||
xcount, ycount, /* Current count for X and Y */
|
||||
xrep, yrep, /* Repeat count for X and Y */
|
||||
xoff, yoff, /* Offsets for X and Y */
|
||||
yend; /* End Y value */
|
||||
int temprow, /* Row in template */
|
||||
tempcolor; /* Template color */
|
||||
const char *template; /* Pointer into template */
|
||||
const unsigned char *color; /* Current color */
|
||||
static const unsigned char colors[][3] =
|
||||
{ /* Colors for test */
|
||||
{ 191, 191, 191 },
|
||||
{ 127, 127, 127 },
|
||||
{ 63, 63, 63 },
|
||||
{ 0, 0, 0 },
|
||||
{ 255, 0, 0 },
|
||||
{ 255, 127, 0 },
|
||||
{ 255, 255, 0 },
|
||||
{ 127, 255, 0 },
|
||||
{ 0, 255, 0 },
|
||||
{ 0, 255, 127 },
|
||||
{ 0, 255, 255 },
|
||||
{ 0, 127, 255 },
|
||||
{ 0, 0, 255 },
|
||||
{ 127, 0, 255 },
|
||||
{ 255, 0, 255 }
|
||||
};
|
||||
static const char * const templates[] =
|
||||
{ /* Raster template */
|
||||
" CCC U U PPPP SSS TTTTT EEEEE SSS TTTTT 000 1 222 333 4 55555 66 77777 888 999 ",
|
||||
"C C U U P P S S T E S S T 0 0 11 2 2 3 3 4 4 5 6 7 8 8 9 9 ",
|
||||
"C U U P P S T E S T 0 0 1 2 3 4 4 5 6 7 8 8 9 9 ",
|
||||
"C U U PPPP SSS ----- T EEEE SSS T 0 0 0 1 22 333 44444 555 6666 7 888 9999 ",
|
||||
"C U U P S T E S T 0 0 1 2 3 4 5 6 6 7 8 8 9 ",
|
||||
"C C U U P S S T E S S T 0 0 1 2 3 3 4 5 5 6 6 7 8 8 9 ",
|
||||
" CCC UUU P SSS T EEEEE SSS T 000 111 22222 333 4 555 666 7 888 99 ",
|
||||
" "
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Figure out the output format...
|
||||
*/
|
||||
|
||||
if ((attr = ippFindAttribute(response, "document-format-supported", IPP_TAG_MIMETYPE)) == NULL)
|
||||
{
|
||||
puts("No supported document formats, aborting.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (*format)
|
||||
{
|
||||
if (!ippContainsString(attr, *format))
|
||||
{
|
||||
printf("Printer does not support document-format '%s'.\n", *format);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (!strcmp(*format, "image/urf"))
|
||||
mode = CUPS_RASTER_WRITE_APPLE;
|
||||
else if (!strcmp(*format, "image/pwg-raster"))
|
||||
mode = CUPS_RASTER_WRITE_PWG;
|
||||
else
|
||||
{
|
||||
printf("Unable to generate document-format '%s'.\n", *format);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
else if (ippContainsString(attr, "image/urf"))
|
||||
{
|
||||
/*
|
||||
* Apple Raster format...
|
||||
*/
|
||||
|
||||
*format = "image/urf";
|
||||
mode = CUPS_RASTER_WRITE_APPLE;
|
||||
}
|
||||
else if (ippContainsString(attr, "image/pwg-raster"))
|
||||
{
|
||||
/*
|
||||
* PWG Raster format...
|
||||
*/
|
||||
|
||||
*format = "image/pwg-raster";
|
||||
mode = CUPS_RASTER_WRITE_PWG;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* No supported raster format...
|
||||
*/
|
||||
|
||||
puts("Printer does not support Apple or PWG raster files, aborting.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Figure out the the media, resolution, and color mode...
|
||||
*/
|
||||
|
||||
if ((attr = ippFindAttribute(response, "media-default", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Use default media...
|
||||
*/
|
||||
|
||||
media = pwgMediaForPWG(ippGetString(attr, 0, NULL));
|
||||
}
|
||||
else if ((attr = ippFindAttribute(response, "media-ready", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Use ready media...
|
||||
*/
|
||||
|
||||
if (ippContainsString(attr, "na_letter_8.5x11in"))
|
||||
media = pwgMediaForPWG("na_letter_8.5x11in");
|
||||
else if (ippContainsString(attr, "iso_a4_210x297mm"))
|
||||
media = pwgMediaForPWG("iso_a4_210x297mm");
|
||||
else
|
||||
media = pwgMediaForPWG(ippGetString(attr, 0, NULL));
|
||||
}
|
||||
else
|
||||
{
|
||||
puts("No default or ready media reported by printer, aborting.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (mode == CUPS_RASTER_WRITE_APPLE && (attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
for (i = 0, count = ippGetCount(attr); i < count; i ++)
|
||||
{
|
||||
const char *val = ippGetString(attr, i, NULL);
|
||||
|
||||
if (!strncmp(val, "RS", 2))
|
||||
xdpi = ydpi = atoi(val + 2);
|
||||
else if (!strncmp(val, "W8", 2) && !type)
|
||||
type = "sgray_8";
|
||||
else if (!strncmp(val, "SRGB24", 6) && !grayscale)
|
||||
type = "srgb_8";
|
||||
}
|
||||
}
|
||||
else if (mode == CUPS_RASTER_WRITE_PWG && (attr = ippFindAttribute(response, "pwg-raster-document-resolution-supported", IPP_TAG_RESOLUTION)) != NULL)
|
||||
{
|
||||
for (i = 0, count = ippGetCount(attr); i < count; i ++)
|
||||
{
|
||||
int tempxdpi, tempydpi;
|
||||
ipp_res_t tempunits;
|
||||
|
||||
tempxdpi = ippGetResolution(attr, 0, &tempydpi, &tempunits);
|
||||
|
||||
if (i == 0 || tempxdpi < xdpi || tempydpi < ydpi)
|
||||
{
|
||||
xdpi = tempxdpi;
|
||||
ydpi = tempydpi;
|
||||
}
|
||||
}
|
||||
|
||||
if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
if (!grayscale && ippContainsString(attr, "srgb_8"))
|
||||
type = "srgb_8";
|
||||
else if (ippContainsString(attr, "sgray_8"))
|
||||
type = "sgray_8";
|
||||
}
|
||||
}
|
||||
|
||||
if (xdpi < 72 || ydpi < 72)
|
||||
{
|
||||
puts("No supported raster resolutions, aborting.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (!type)
|
||||
{
|
||||
puts("No supported color spaces or bit depths, aborting.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make the raster context and details...
|
||||
*/
|
||||
|
||||
if (!cupsRasterInitPWGHeader(&header, media, type, xdpi, ydpi, "one-sided", NULL))
|
||||
{
|
||||
printf("Unable to initialize raster context: %s\n", cupsRasterErrorString());
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
header.cupsInteger[CUPS_RASTER_PWG_TotalPageCount] = 1;
|
||||
|
||||
if (header.cupsWidth > (4 * header.HWResolution[0]))
|
||||
{
|
||||
xoff = header.HWResolution[0] / 2;
|
||||
yoff = header.HWResolution[1] / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
xoff = 0;
|
||||
yoff = 0;
|
||||
}
|
||||
|
||||
xrep = (header.cupsWidth - 2 * xoff) / 140;
|
||||
yrep = xrep * header.HWResolution[1] / header.HWResolution[0];
|
||||
yend = header.cupsHeight - yoff;
|
||||
|
||||
/*
|
||||
* Prepare the raster file...
|
||||
*/
|
||||
|
||||
if ((line = malloc(header.cupsBytesPerLine)) == NULL)
|
||||
{
|
||||
printf("Unable to allocate %u bytes for raster output: %s\n", header.cupsBytesPerLine, strerror(errno));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((fd = cupsTempFd(tempname, (int)tempsize)) < 0)
|
||||
{
|
||||
printf("Unable to create temporary print file: %s\n", strerror(errno));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((ras = cupsRasterOpen(fd, mode)) == NULL)
|
||||
{
|
||||
printf("Unable to open raster stream: %s\n", cupsRasterErrorString());
|
||||
close(fd);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a single page consisting of the template dots repeated over the page.
|
||||
*/
|
||||
|
||||
cupsRasterWriteHeader2(ras, &header);
|
||||
|
||||
memset(line, 0xff, header.cupsBytesPerLine);
|
||||
|
||||
for (y = 0; y < yoff; y ++)
|
||||
cupsRasterWritePixels(ras, line, header.cupsBytesPerLine);
|
||||
|
||||
for (temprow = 0, tempcolor = 0; y < yend;)
|
||||
{
|
||||
template = templates[temprow];
|
||||
color = colors[tempcolor];
|
||||
|
||||
temprow ++;
|
||||
if (temprow >= (int)(sizeof(templates) / sizeof(templates[0])))
|
||||
{
|
||||
temprow = 0;
|
||||
tempcolor ++;
|
||||
if (tempcolor >= (int)(sizeof(colors) / sizeof(colors[0])))
|
||||
tempcolor = 0;
|
||||
else if (tempcolor > 3 && header.cupsColorSpace == CUPS_CSPACE_SW)
|
||||
tempcolor = 0;
|
||||
}
|
||||
|
||||
memset(line, 0xff, header.cupsBytesPerLine);
|
||||
|
||||
if (header.cupsColorSpace == CUPS_CSPACE_SW)
|
||||
{
|
||||
/*
|
||||
* Do grayscale output...
|
||||
*/
|
||||
|
||||
for (lineptr = line + xoff; *template; template ++)
|
||||
{
|
||||
if (*template != ' ')
|
||||
{
|
||||
for (xcount = xrep; xcount > 0; xcount --)
|
||||
*lineptr++ = *color;
|
||||
}
|
||||
else
|
||||
{
|
||||
lineptr += xrep;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Do color output...
|
||||
*/
|
||||
|
||||
for (lineptr = line + 3 * xoff; *template; template ++)
|
||||
{
|
||||
if (*template != ' ')
|
||||
{
|
||||
for (xcount = xrep; xcount > 0; xcount --, lineptr += 3)
|
||||
memcpy(lineptr, color, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
lineptr += 3 * xrep;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (ycount = yrep; ycount > 0 && y < yend; ycount --, y ++)
|
||||
cupsRasterWritePixels(ras, line, header.cupsBytesPerLine);
|
||||
}
|
||||
|
||||
memset(line, 0xff, header.cupsBytesPerLine);
|
||||
|
||||
for (y = 0; y < header.cupsHeight; y ++)
|
||||
cupsRasterWritePixels(ras, line, header.cupsBytesPerLine);
|
||||
|
||||
cupsRasterClose(ras);
|
||||
|
||||
close(fd);
|
||||
|
||||
printf("PRINT FILE: %s\n", tempname);
|
||||
|
||||
return (tempname);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'monitor_printer()' - Monitor the job and printer states.
|
||||
*/
|
||||
|
||||
static void * /* O - Thread exit code */
|
||||
monitor_printer(
|
||||
_client_monitor_t *monitor) /* I - Monitoring data */
|
||||
{
|
||||
http_t *http; /* Connection to printer */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* Attribute in response */
|
||||
ipp_pstate_t printer_state; /* Printer state */
|
||||
char printer_state_reasons[1024];
|
||||
/* Printer state reasons */
|
||||
ipp_jstate_t job_state; /* Job state */
|
||||
char job_state_reasons[1024];/* Printer state reasons */
|
||||
static const char * const jattrs[] = /* Job attributes we want */
|
||||
{
|
||||
"job-state",
|
||||
"job-state-reasons"
|
||||
};
|
||||
static const char * const pattrs[] = /* Printer attributes we want */
|
||||
{
|
||||
"printer-state",
|
||||
"printer-state-reasons"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Open a connection to the printer...
|
||||
*/
|
||||
|
||||
http = httpConnect2(monitor->hostname, monitor->port, NULL, AF_UNSPEC, monitor->encryption, 1, 0, NULL);
|
||||
|
||||
/*
|
||||
* Loop until the job is canceled, aborted, or completed.
|
||||
*/
|
||||
|
||||
printer_state = (ipp_pstate_t)0;
|
||||
printer_state_reasons[0] = '\0';
|
||||
|
||||
job_state = (ipp_jstate_t)0;
|
||||
job_state_reasons[0] = '\0';
|
||||
|
||||
while (monitor->job_state < IPP_JSTATE_CANCELED)
|
||||
{
|
||||
/*
|
||||
* Reconnect to the printer as needed...
|
||||
*/
|
||||
|
||||
if (httpGetFd(http) < 0)
|
||||
httpReconnect2(http, 30000, NULL);
|
||||
|
||||
if (httpGetFd(http) >= 0)
|
||||
{
|
||||
/*
|
||||
* Connected, so check on the printer state...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, monitor->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(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
|
||||
|
||||
response = cupsDoRequest(http, request, monitor->resource);
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM)) != NULL)
|
||||
printer_state = (ipp_pstate_t)ippGetInteger(attr, 0);
|
||||
|
||||
if ((attr = ippFindAttribute(response, "printer-state-reasons", IPP_TAG_KEYWORD)) != NULL)
|
||||
ippAttributeString(attr, printer_state_reasons, sizeof(printer_state_reasons));
|
||||
|
||||
if (printer_state != monitor->printer_state || strcmp(printer_state_reasons, monitor->printer_state_reasons))
|
||||
{
|
||||
printf("PRINTER: %s (%s)\n", ippEnumString("printer-state", printer_state), printer_state_reasons);
|
||||
|
||||
monitor->printer_state = printer_state;
|
||||
strlcpy(monitor->printer_state_reasons, printer_state_reasons, sizeof(monitor->printer_state_reasons));
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
if (monitor->job_id > 0)
|
||||
{
|
||||
/*
|
||||
* Check the status of the job itself...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_OP_GET_JOB_ATTRIBUTES);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, monitor->uri);
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", monitor->job_id);
|
||||
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(jattrs) / sizeof(jattrs[0])), NULL, jattrs);
|
||||
|
||||
response = cupsDoRequest(http, request, monitor->resource);
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-state", IPP_TAG_ENUM)) != NULL)
|
||||
job_state = (ipp_jstate_t)ippGetInteger(attr, 0);
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-state-reasons", IPP_TAG_KEYWORD)) != NULL)
|
||||
ippAttributeString(attr, job_state_reasons, sizeof(job_state_reasons));
|
||||
|
||||
if (job_state != monitor->job_state || strcmp(job_state_reasons, monitor->job_state_reasons))
|
||||
{
|
||||
printf("JOB %d: %s (%s)\n", monitor->job_id, ippEnumString("job-state", job_state), job_state_reasons);
|
||||
|
||||
monitor->job_state = job_state;
|
||||
strlcpy(monitor->job_state_reasons, job_state_reasons, sizeof(monitor->job_state_reasons));
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
}
|
||||
|
||||
if (monitor->job_state < IPP_JSTATE_CANCELED)
|
||||
{
|
||||
/*
|
||||
* Sleep for 5 seconds...
|
||||
*/
|
||||
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Cleanup and return...
|
||||
*/
|
||||
|
||||
httpClose(http);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_attributes()' - Show attributes in a request or response.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_attributes(const char *title, /* I - Title */
|
||||
int request, /* I - 1 for request, 0 for response */
|
||||
ipp_t *ipp) /* I - IPP request/response */
|
||||
{
|
||||
int minor, major = ippGetVersion(ipp, &minor);
|
||||
/* IPP version number */
|
||||
ipp_tag_t group = IPP_TAG_ZERO;
|
||||
/* Current group tag */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
const char *name; /* Attribute name */
|
||||
char buffer[1024]; /* Value */
|
||||
|
||||
|
||||
printf("%s:\n", title);
|
||||
printf(" version=%d.%d\n", major, minor);
|
||||
printf(" request-id=%d\n", ippGetRequestId(ipp));
|
||||
if (!request)
|
||||
printf(" status-code=%s\n", ippErrorString(ippGetStatusCode(ipp)));
|
||||
|
||||
for (attr = ippFirstAttribute(ipp); attr; attr = ippNextAttribute(ipp))
|
||||
{
|
||||
if (group != ippGetGroupTag(attr))
|
||||
{
|
||||
group = ippGetGroupTag(attr);
|
||||
if (group)
|
||||
printf(" %s:\n", ippTagString(group));
|
||||
}
|
||||
|
||||
if ((name = ippGetName(attr)) != NULL)
|
||||
{
|
||||
ippAttributeString(attr, buffer, sizeof(buffer));
|
||||
printf(" %s(%s%s)=%s\n", name, ippGetCount(attr) > 1 ? "1setOf " : "", ippTagString(ippGetValueTag(attr)), buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_capabilities()' - Show printer capabilities.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_capabilities(ipp_t *response) /* I - Printer attributes */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ipp_attribute_t *attr; /* Attribute */
|
||||
char buffer[1024]; /* Attribute value buffer */
|
||||
static const char * const pattrs[] = /* Attributes we want to show */
|
||||
{
|
||||
"copies-default",
|
||||
"copies-supported",
|
||||
"finishings-default",
|
||||
"finishings-ready",
|
||||
"finishings-supported",
|
||||
"media-default",
|
||||
"media-ready",
|
||||
"media-supported",
|
||||
"output-bin-default",
|
||||
"output-bin-supported",
|
||||
"print-color-mode-default",
|
||||
"print-color-mode-supported",
|
||||
"sides-default",
|
||||
"sides-supported",
|
||||
"document-format-default",
|
||||
"document-format-supported",
|
||||
"pwg-raster-document-resolution-supported",
|
||||
"pwg-raster-document-type-supported",
|
||||
"urf-supported"
|
||||
};
|
||||
|
||||
|
||||
puts("CAPABILITIES:");
|
||||
for (i = 0; i < (int)(sizeof(pattrs) / sizeof(pattrs[0])); i ++)
|
||||
{
|
||||
if ((attr = ippFindAttribute(response, pattrs[i], IPP_TAG_ZERO)) != NULL)
|
||||
{
|
||||
ippAttributeString(attr, buffer, sizeof(buffer));
|
||||
printf(" %s=%s\n", pattrs[i], buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'usage()' - Show program usage...
|
||||
*/
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
puts("Usage: ./testclient printer-uri [options]");
|
||||
puts("Options:");
|
||||
puts(" -d document-format Generate the specified format");
|
||||
puts(" -f print-file Print the named file");
|
||||
puts(" -g Force grayscale printing");
|
||||
puts(" -k Keep temporary files");
|
||||
puts(" -v Be more verbose");
|
||||
}
|
||||
+7
-9
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Locale file makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1993-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -131,8 +131,8 @@ pot: checkpo po2strings
|
||||
cd ..; xgettext -o locale/cups.pot -cTRANSLATORS -s \
|
||||
--keyword=_ --no-wrap \
|
||||
--copyright-holder="Apple Inc." \
|
||||
--package-name="CUPS" --package-version="1.6" \
|
||||
--msgid-bugs-address="http://www.cups.org/str.php" \
|
||||
--package-name="CUPS" --package-version="$(CUPS_VERSION)" \
|
||||
--msgid-bugs-address="https://github.com/apple/cups/issues" \
|
||||
*/*.c */*.cxx
|
||||
(cat cups.header; tail +6 cups.pot; cat cups.footer) > cups.pot.N
|
||||
mv cups.pot.N cups.pot
|
||||
@@ -158,14 +158,12 @@ pot: checkpo po2strings
|
||||
|
||||
checkpo: checkpo.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o checkpo checkpo.o \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o checkpo checkpo.o \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
|
||||
checkall: checkpo
|
||||
for file in *.po; do \
|
||||
./checkpo $$file; \
|
||||
done
|
||||
./checkpo *.po *.strings
|
||||
|
||||
|
||||
#
|
||||
@@ -177,7 +175,7 @@ checkall: checkpo
|
||||
|
||||
po2strings: po2strings.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o po2strings po2strings.o \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o po2strings po2strings.o \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
|
||||
@@ -191,7 +189,7 @@ po2strings: po2strings.o ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
strings2po: strings2po.o
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o strings2po strings2po.o
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o strings2po strings2po.o
|
||||
|
||||
|
||||
#
|
||||
|
||||
+160
-6
@@ -2,7 +2,7 @@
|
||||
* Verify that translations in the .po file have the same number and type of
|
||||
* printf-style format strings.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* checkpo filename.po [... filenameN.po]
|
||||
* checkpo filename.{po,strings} [... filenameN.{po,strings}]
|
||||
*
|
||||
* Compile with:
|
||||
*
|
||||
@@ -29,11 +29,14 @@
|
||||
|
||||
static char *abbreviate(const char *s, char *buf, int bufsize);
|
||||
static cups_array_t *collect_formats(const char *id);
|
||||
static cups_array_t *cups_load_strings(const char *filename);
|
||||
static int cups_read_strings(cups_file_t *fp, char *buffer, size_t bufsize, char **id, char **str);
|
||||
static char *cups_scan_strings(char *buffer);
|
||||
static void free_formats(cups_array_t *fmts);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Validate .po files.
|
||||
* 'main()' - Validate .po and .strings files.
|
||||
*/
|
||||
|
||||
int /* O - Exit code */
|
||||
@@ -57,12 +60,12 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
puts("Usage: checkpo filename.po [... filenameN.po]");
|
||||
puts("Usage: checkpo filename.{po,strings} [... filenameN.{po,strings}]");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check every .po file on the command-line...
|
||||
* Check every .po or .strings file on the command-line...
|
||||
*/
|
||||
|
||||
for (i = 1, status = 0; i < argc; i ++)
|
||||
@@ -71,7 +74,12 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Use the CUPS .po loader to get the message strings...
|
||||
*/
|
||||
|
||||
if ((po = _cupsMessageLoad(argv[i], 1)) == NULL)
|
||||
if (strstr(argv[i], ".strings"))
|
||||
po = cups_load_strings(argv[i]);
|
||||
else
|
||||
po = _cupsMessageLoad(argv[i], 1);
|
||||
|
||||
if (!po)
|
||||
{
|
||||
perror(argv[i]);
|
||||
return (1);
|
||||
@@ -382,6 +390,152 @@ collect_formats(const char *id) /* I - msgid string */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_load_strings()' - Load a .strings file into a _cups_msg_t array.
|
||||
*/
|
||||
|
||||
static cups_array_t * /* O - CUPS array of _cups_msg_t values */
|
||||
cups_load_strings(const char *filename) /* I - File to load */
|
||||
{
|
||||
cups_file_t *fp; /* .strings file */
|
||||
cups_array_t *po; /* Localization array */
|
||||
_cups_message_t *m; /* Localization message */
|
||||
char buffer[8192], /* Message buffer */
|
||||
*id, /* ID string */
|
||||
*str; /* Translated message */
|
||||
|
||||
|
||||
if ((fp = cupsFileOpen(filename, "r")) == NULL)
|
||||
return (NULL);
|
||||
|
||||
po = _cupsMessageNew(NULL);
|
||||
|
||||
while (cups_read_strings(fp, buffer, sizeof(buffer), &id, &str))
|
||||
{
|
||||
if ((m = malloc(sizeof(_cups_message_t))) == NULL)
|
||||
break;
|
||||
|
||||
m->id = strdup(id);
|
||||
m->str = strdup(str);
|
||||
|
||||
if (m->id && m->str)
|
||||
cupsArrayAdd(po, m);
|
||||
else
|
||||
{
|
||||
if (m->id)
|
||||
free(m->id);
|
||||
|
||||
if (m->str)
|
||||
free(m->str);
|
||||
|
||||
free(m);
|
||||
|
||||
cupsArrayDelete(po);
|
||||
po = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cupsFileClose(fp);
|
||||
|
||||
return (po);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_read_strings()' - Read a pair of strings from a .strings file.
|
||||
*/
|
||||
|
||||
static int /* O - 1 on success, 0 on failure */
|
||||
cups_read_strings(cups_file_t *strings, /* I - .strings file */
|
||||
char *buffer, /* I - Line buffer */
|
||||
size_t bufsize, /* I - Size of line buffer */
|
||||
char **id, /* O - Pointer to ID string */
|
||||
char **str) /* O - Pointer to translation string */
|
||||
{
|
||||
char *bufptr; /* Pointer into buffer */
|
||||
|
||||
|
||||
while (cupsFileGets(strings, buffer, bufsize))
|
||||
{
|
||||
if (buffer[0] != '\"')
|
||||
continue;
|
||||
|
||||
*id = buffer + 1;
|
||||
bufptr = cups_scan_strings(buffer);
|
||||
|
||||
if (*bufptr != '\"')
|
||||
continue;
|
||||
|
||||
*bufptr++ = '\0';
|
||||
|
||||
while (*bufptr && *bufptr != '\"')
|
||||
bufptr ++;
|
||||
|
||||
if (!*bufptr)
|
||||
continue;
|
||||
|
||||
*str = bufptr + 1;
|
||||
bufptr = cups_scan_strings(bufptr);
|
||||
|
||||
if (*bufptr != '\"')
|
||||
continue;
|
||||
|
||||
*bufptr = '\0';
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_scan_strings()' - Scan a quoted string.
|
||||
*/
|
||||
|
||||
static char * /* O - End of string */
|
||||
cups_scan_strings(char *buffer) /* I - Start of string */
|
||||
{
|
||||
char *bufptr; /* Pointer into string */
|
||||
|
||||
|
||||
for (bufptr = buffer + 1; *bufptr && *bufptr != '\"'; bufptr ++)
|
||||
{
|
||||
if (*bufptr == '\\')
|
||||
{
|
||||
if (bufptr[1] >= '0' && bufptr[1] <= '3' &&
|
||||
bufptr[2] >= '0' && bufptr[2] <= '7' &&
|
||||
bufptr[3] >= '0' && bufptr[3] <= '7')
|
||||
{
|
||||
/*
|
||||
* Decode \nnn octal escape...
|
||||
*/
|
||||
|
||||
*bufptr = (char)(((((bufptr[1] - '0') << 3) | (bufptr[2] - '0')) << 3) | (bufptr[3] - '0'));
|
||||
_cups_strcpy(bufptr + 1, bufptr + 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Decode \C escape...
|
||||
*/
|
||||
|
||||
_cups_strcpy(bufptr, bufptr + 1);
|
||||
if (*bufptr == 'n')
|
||||
*bufptr = '\n';
|
||||
else if (*bufptr == 'r')
|
||||
*bufptr = '\r';
|
||||
else if (*bufptr == 't')
|
||||
*bufptr = '\t';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (bufptr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'free_formats()' - Free all of the format strings.
|
||||
*/
|
||||
|
||||
+4264
-5
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Message catalog template for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 2005-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
|
||||
+4922
-654
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+2162
-28
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6946
-12
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6937
-12
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6944
-16
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6950
-13
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+7279
-289
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6946
-12
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6950
-13
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6950
-13
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6941
-13
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+6950
-13
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -385,8 +385,6 @@ normalize_string(const char *idstr, /* I - msgid string */
|
||||
*bufptr++ = (char)0x98;
|
||||
quote = 1;
|
||||
}
|
||||
|
||||
idstr ++;
|
||||
}
|
||||
else
|
||||
*bufptr++ = *idstr;
|
||||
|
||||
+1
-1
@@ -227,6 +227,6 @@ html: $(MAN1) $(MAN5) $(MAN7) $(MAN8) mantohtml
|
||||
done
|
||||
|
||||
mantohtml: mantohtml.o ../cups/$(LIBCUPSSTATIC)
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ mantohtml.o \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ mantohtml.o \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
.\" 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/".
|
||||
.\"
|
||||
.TH client.conf 5 "CUPS" "26 June 2017" "Apple Inc."
|
||||
.TH client.conf 5 "CUPS" "19 October 2017" "Apple Inc."
|
||||
.SH NAME
|
||||
client.conf \- client configuration file for cups
|
||||
.SH DESCRIPTION
|
||||
@@ -61,8 +61,10 @@ Specifies the address and optionally the port to use when connecting to a server
|
||||
\fBSSLOptions None\fR
|
||||
Sets encryption options (only in /etc/cups/client.conf).
|
||||
By default, CUPS only supports encryption using TLS v1.0 or higher using known secure cipher suites.
|
||||
The \fIAllowDH\fR option enables cipher suites using plain Diffie-Hellman key negotiation.
|
||||
The \fIAllowRC4\fR option enables the 128-bit RC4 cipher suites, which are required for some older clients that do not implement newer ones.
|
||||
Security is reduced when \fIAllow\fR options are used.
|
||||
Security is enhanced when \fIDeny\fR options are used.
|
||||
The \fIAllowDH\fR option enables cipher suites using plain Diffie-Hellman key negotiation (not supported on systems using GNU TLS).
|
||||
The \fIAllowRC4\fR option enables the 128-bit RC4 cipher suites, which are required for some older clients.
|
||||
The \fIAllowSSL3\fR option enables SSL v3.0, which is required for some older clients that do not support TLS v1.0.
|
||||
The \fIDenyCBC\fR option disables all CBC cipher suites.
|
||||
The \fIDenyTLS1.0\fR option disables TLS v1.0 support - this sets the minimum protocol version to TLS v1.1.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" cups-files.conf man page for CUPS.
|
||||
.\"
|
||||
.\" Copyright 2007-2016 by Apple Inc.
|
||||
.\" Copyright 2007-2017 by Apple Inc.
|
||||
.\" Copyright 1997-2006 by Easy Software Products.
|
||||
.\"
|
||||
.\" These coded instructions, statements, and computer programs are the
|
||||
@@ -10,7 +10,7 @@
|
||||
.\" 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/".
|
||||
.\"
|
||||
.TH cups-files.conf 5 "CUPS" "19 September 2016" "Apple Inc."
|
||||
.TH cups-files.conf 5 "CUPS" "21 September 2017" "Apple Inc."
|
||||
.SH NAME
|
||||
cups\-files.conf \- file and directory configuration file for cups
|
||||
.SH DESCRIPTION
|
||||
@@ -45,6 +45,11 @@ The server name may be included in filenames using the string "%s", for example:
|
||||
|
||||
.fi
|
||||
The default is "/var/log/cups/access_log".
|
||||
.\"#CacheDir
|
||||
.TP 5
|
||||
\fBCacheDir \fIdirectory\fR
|
||||
Specifies the directory to use for long-lived temporary (cache) files.
|
||||
The default is "/var/spool/cups/cache" or "/var/cache/cups" depending on the platform.
|
||||
.\"#ConfigFilePerm
|
||||
.TP 5
|
||||
\fBConfigFilePerm \fImode\fR
|
||||
@@ -124,13 +129,6 @@ Log file creation or write errors are fatal.
|
||||
.B permissions
|
||||
Bad startup file permissions are fatal, for example shared TLS certificate and key files with world-read permissions.
|
||||
.RE
|
||||
.\"#FileDevice
|
||||
.TP 5
|
||||
\fBFileDevice Yes\fR
|
||||
.TP 5
|
||||
\fBFileDevice No\fR
|
||||
Specifies whether the file pseudo-device can be used for new printer queues.
|
||||
The URI "file:///dev/null" is always allowed.
|
||||
.\"#Group
|
||||
.TP 5
|
||||
\fBGroup \fIgroup-name-or-number\fR
|
||||
@@ -193,6 +191,11 @@ macOS uses its keychain database to store certificates and keys while other plat
|
||||
\fBServerRoot \fIdirectory\fR
|
||||
Specifies the directory containing the server configuration files.
|
||||
The default is "/etc/cups".
|
||||
.\"#StateDir
|
||||
.TP 5
|
||||
\fBStateDir \fIdirectory\fR
|
||||
Specifies the directory to use for PID and local certificate files.
|
||||
The default is "/var/run/cups" or "/etc/cups" depending on the platform.
|
||||
.\"#SyncOnClose
|
||||
.TP 5
|
||||
\fBSyncOnClose Yes\fR
|
||||
@@ -210,13 +213,56 @@ The default contains "admin", "lpadmin", "root", "sys", and/or "system".
|
||||
.\"#TempDir
|
||||
.TP 5
|
||||
\fBTempDir \fIdirectory\fR
|
||||
Specifies the directory where temporary files are stored.
|
||||
Specifies the directory where short-term temporary files are stored.
|
||||
The default is "/var/spool/cups/tmp".
|
||||
.\"#User
|
||||
.TP 5
|
||||
\fBUser \fIusername\fR
|
||||
Specifies the user name or ID that is used when running external programs.
|
||||
The default is "lp".
|
||||
.SS DEPRECATED DIRECTIVES
|
||||
The following directives are deprecated and will be removed from a future version of CUPS:
|
||||
.\"#FileDevice
|
||||
.TP 5
|
||||
\fBFileDevice Yes\fR
|
||||
.TP 5
|
||||
\fBFileDevice No\fR
|
||||
Specifies whether the file pseudo-device can be used for new printer queues.
|
||||
The URI "file:///dev/null" is always allowed.
|
||||
File devices cannot be used with "raw" print queues - a PPD file is required.
|
||||
The specified file is overwritten for every print job.
|
||||
Writing to directories is not supported.
|
||||
.\"#FontPath
|
||||
.TP 5
|
||||
\fBFontPath \fIdirectory[:...:directoryN]\fR
|
||||
Specifies a colon separated list of directories where fonts can be found.
|
||||
On Linux the
|
||||
.BR font-config (1)
|
||||
mechanism is used instead.
|
||||
On macOS the Font Book application manages system-installed fonts.
|
||||
.\"#LPDConfigFile
|
||||
.TP 5
|
||||
\fB LPDConfigFile \fIfilename\fR
|
||||
Specifies the LPD service configuration file to update.
|
||||
.\"#Printcap
|
||||
.TP 5
|
||||
\fBPrintcap \fIfilename\fR
|
||||
Specifies a file that is filled with a list of local print queues.
|
||||
.\"#PrintcapFormat
|
||||
.TP 5
|
||||
\fBPrintcapFormat bsd\fR
|
||||
.TP 5
|
||||
\fBPrintcapFormat plist\fR
|
||||
.TP 5
|
||||
\fBPrintcapFormat solaris\fR
|
||||
Specifies the format to use for the Printcap file.
|
||||
"bsd" is the historical LPD printcap file format.
|
||||
"plist" is the Apple plist file format.
|
||||
"solaris" is the historical Solaris LPD printcap file format.
|
||||
.\"#SMBConfigFile
|
||||
.TP 5
|
||||
\fBSMBConfigFile \fIfilename\fR
|
||||
Specifies the SMB service configuration file to update.
|
||||
.SH SEE ALSO
|
||||
.BR classes.conf (5),
|
||||
.BR cups (1),
|
||||
|
||||
+47
-43
@@ -10,7 +10,7 @@
|
||||
.\" 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/".
|
||||
.\"
|
||||
.TH cupsd.conf 5 "CUPS" "26 June 2017" "Apple Inc."
|
||||
.TH cupsd.conf 5 "CUPS" "19 October 2017" "Apple Inc."
|
||||
.SH NAME
|
||||
cupsd.conf \- server configuration file for cups
|
||||
.SH DESCRIPTION
|
||||
@@ -77,21 +77,6 @@ The default is "No".
|
||||
.br
|
||||
Specifies whether shared printers are advertised.
|
||||
The default is "No".
|
||||
.\"#Classification
|
||||
.TP 5
|
||||
\fBClassification \fIbanner\fR
|
||||
.br
|
||||
Specifies the security classification of the server.
|
||||
Any valid banner name can be used, including "classified", "confidential", "secret", "topsecret", and "unclassified", or the banner can be omitted to disable secure printing functions.
|
||||
The default is no classification banner.
|
||||
.\"#ClassifyOverride
|
||||
.TP 5
|
||||
\fBClassifyOverride Yes\fR
|
||||
.TP 5
|
||||
\fBClassifyOverride No\fR
|
||||
.br
|
||||
Specifies whether users may override the classification (cover page) of individual print jobs using the "job-sheets" option.
|
||||
The default is "No".
|
||||
.\"#DefaultAuthType
|
||||
.TP 5
|
||||
\fBDefaultAuthType Basic\fR
|
||||
@@ -357,26 +342,6 @@ The default is "1048576" (1MB).
|
||||
\fBMultipleOperationTimeout \fIseconds\fR
|
||||
Specifies the maximum amount of time to allow between files in a multiple file print job.
|
||||
The default is "300" (5 minutes).
|
||||
.\"#PageLogFormat
|
||||
.TP 5
|
||||
\fBPageLogFormat \fIformat-string\fR
|
||||
Specifies the format of PageLog lines.
|
||||
Sequences beginning with percent (%) characters are replaced with the corresponding information, while all other characters are copied literally.
|
||||
The following percent sequences are recognized:
|
||||
.nf
|
||||
|
||||
"%%" inserts a single percent character.
|
||||
"%{name}" inserts the value of the specified IPP attribute.
|
||||
"%C" inserts the number of copies for the current page.
|
||||
"%P" inserts the current page number.
|
||||
"%T" inserts the current date and time in common log format.
|
||||
"%j" inserts the job ID.
|
||||
"%p" inserts the printer name.
|
||||
"%u" inserts the username.
|
||||
|
||||
.fi
|
||||
The default is the empty string, which disables page logging.
|
||||
The string "%p %u %j %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}" creates a page log with the standard items.
|
||||
.\"#PassEnv
|
||||
.TP 5
|
||||
\fBPassEnv \fIvariable \fR[ ... \fIvariable \fR]
|
||||
@@ -415,11 +380,6 @@ The default is "Yes".
|
||||
\fBReloadTimeout \fIseconds\fR
|
||||
Specifies the amount of time to wait for job completion before restarting the scheduler.
|
||||
The default is "30".
|
||||
.\"#RIPCache
|
||||
.TP 5
|
||||
\fBRIPCache \fIsize\fR
|
||||
Specifies the maximum amount of memory to use when converting documents into bitmaps for a printer.
|
||||
The default is "128m".
|
||||
.\"#ServerAdmin
|
||||
.TP 5
|
||||
\fBServerAdmin \fIemail-address\fR
|
||||
@@ -485,8 +445,10 @@ Listens on the specified address and port for encrypted connections.
|
||||
\fBSSLOptions None\fR
|
||||
Sets encryption options.
|
||||
By default, CUPS only supports encryption using TLS v1.0 or higher using known secure cipher suites.
|
||||
The \fIAllowDH\fR option enables cipher suites using plain Diffie-Hellman key negotiation.
|
||||
The \fIAllowRC4\fR option enables the 128-bit RC4 cipher suites, which are required for some older clients that do not implement newer ones.
|
||||
Security is reduced when \fIAllow\fR options are used.
|
||||
Security is enhanced when \fIDeny\fR options are used.
|
||||
The \fIAllowDH\fR option enables cipher suites using plain Diffie-Hellman key negotiation (not supported on systems using GNU TLS).
|
||||
The \fIAllowRC4\fR option enables the 128-bit RC4 cipher suites, which are required for some older clients.
|
||||
The \fIAllowSSL3\fR option enables SSL v3.0, which is required for some older clients that do not support TLS v1.0.
|
||||
The \fIDenyCBC\fR option disables all CBC cipher suites.
|
||||
The \fIDenyTLS1.0\fR option disables TLS v1.0 support - this sets the minimum protocol version to TLS v1.1.
|
||||
@@ -848,6 +810,48 @@ file.
|
||||
\fBSubscriptionPrivateValues \fIattribute-name \fR[ ... \fIattribute-name \fR]
|
||||
Specifies the list of subscription values to make private.
|
||||
The "default" values are "notify-events", "notify-pull-method", "notify-recipient-uri", "notify-subscriber-user-name", and "notify-user-data".
|
||||
.SS DEPRECATED DIRECTIVES
|
||||
The following directives are deprecated and will be removed in a future release of CUPS:
|
||||
.\"#Classification
|
||||
.TP 5
|
||||
\fBClassification \fIbanner\fR
|
||||
.br
|
||||
Specifies the security classification of the server.
|
||||
Any valid banner name can be used, including "classified", "confidential", "secret", "topsecret", and "unclassified", or the banner can be omitted to disable secure printing functions.
|
||||
The default is no classification banner.
|
||||
.\"#ClassifyOverride
|
||||
.TP 5
|
||||
\fBClassifyOverride Yes\fR
|
||||
.TP 5
|
||||
\fBClassifyOverride No\fR
|
||||
.br
|
||||
Specifies whether users may override the classification (cover page) of individual print jobs using the "job-sheets" option.
|
||||
The default is "No".
|
||||
.\"#PageLogFormat
|
||||
.TP 5
|
||||
\fBPageLogFormat \fIformat-string\fR
|
||||
Specifies the format of PageLog lines.
|
||||
Sequences beginning with percent (%) characters are replaced with the corresponding information, while all other characters are copied literally.
|
||||
The following percent sequences are recognized:
|
||||
.nf
|
||||
|
||||
"%%" inserts a single percent character.
|
||||
"%{name}" inserts the value of the specified IPP attribute.
|
||||
"%C" inserts the number of copies for the current page.
|
||||
"%P" inserts the current page number.
|
||||
"%T" inserts the current date and time in common log format.
|
||||
"%j" inserts the job ID.
|
||||
"%p" inserts the printer name.
|
||||
"%u" inserts the username.
|
||||
|
||||
.fi
|
||||
The default is the empty string, which disables page logging.
|
||||
The string "%p %u %j %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}" creates a page log with the standard items.
|
||||
.\"#RIPCache
|
||||
.TP 5
|
||||
\fBRIPCache \fIsize\fR
|
||||
Specifies the maximum amount of memory to use when converting documents into bitmaps for a printer.
|
||||
The default is "128m".
|
||||
.SH CONFORMING TO
|
||||
The \fBcupsd.conf\fR file format is based on the Apache HTTP Server configuration file format.
|
||||
.SH EXAMPLES
|
||||
|
||||
+6
-1
@@ -9,7 +9,7 @@
|
||||
.\" 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/".
|
||||
.\"
|
||||
.TH ipptool 1 "CUPS" "13 June 2017" "Apple Inc."
|
||||
.TH ipptool 1 "CUPS" "4 August 2017" "Apple Inc."
|
||||
.SH NAME
|
||||
ipptool \- perform internet printing protocol requests
|
||||
.SH SYNOPSIS
|
||||
@@ -54,6 +54,8 @@ ipptool \- perform internet printing protocol requests
|
||||
.B \-f
|
||||
.I filename
|
||||
] [
|
||||
.B \-h
|
||||
] [
|
||||
.B \-i
|
||||
.I seconds
|
||||
] [
|
||||
@@ -154,6 +156,9 @@ Defines the named variable.
|
||||
.BI \-f \ filename
|
||||
Defines the default request filename for tests.
|
||||
.TP 5
|
||||
.B \-h
|
||||
Validate HTTP response headers.
|
||||
.TP 5
|
||||
.BI \-i \ seconds
|
||||
Specifies that the (last)
|
||||
.I testfile
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Port monitor makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -121,7 +121,7 @@ uninstall:
|
||||
|
||||
bcp: bcp.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ bcp.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ bcp.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -130,7 +130,7 @@ bcp: bcp.o ../cups/$(LIBCUPS)
|
||||
|
||||
tbcp: tbcp.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ tbcp.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ tbcp.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Notifier makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -123,7 +123,7 @@ depend:
|
||||
|
||||
dbus: dbus.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o dbus dbus.o $(DBUS_NOTIFIERLIBS) $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o dbus dbus.o $(DBUS_NOTIFIERLIBS) $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -132,7 +132,7 @@ dbus: dbus.o ../cups/$(LIBCUPS)
|
||||
|
||||
mailto: mailto.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o mailto mailto.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o mailto mailto.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -141,7 +141,7 @@ mailto: mailto.o ../cups/$(LIBCUPS)
|
||||
|
||||
rss: rss.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o rss rss.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o rss rss.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -150,7 +150,7 @@ rss: rss.o ../cups/$(LIBCUPS)
|
||||
|
||||
testnotify: testnotify.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testnotify testnotify.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o testnotify testnotify.o $(LIBS)
|
||||
|
||||
|
||||
$(OBJS): ../Makedefs
|
||||
|
||||
+13
-10
@@ -476,11 +476,11 @@ d 0755 root sys $DATADIR/templates -
|
||||
f 0444 root sys $DATADIR/templates templates/*.tmpl
|
||||
|
||||
## Template files
|
||||
#d 0755 root sys $DATADIR/templates/de
|
||||
#f 0444 root sys $DATADIR/templates/de templates/de/*.tmpl
|
||||
d 0755 root sys $DATADIR/templates/de
|
||||
f 0444 root sys $DATADIR/templates/de templates/de/*.tmpl
|
||||
|
||||
#d 0755 root sys $DATADIR/templates/es
|
||||
#f 0444 root sys $DATADIR/templates/es templates/es/*.tmpl
|
||||
d 0755 root sys $DATADIR/templates/es
|
||||
f 0444 root sys $DATADIR/templates/es templates/es/*.tmpl
|
||||
|
||||
#d 0755 root sys $DATADIR/templates/et
|
||||
#f 0444 root sys $DATADIR/templates/et templates/et/*.tmpl
|
||||
@@ -488,8 +488,8 @@ f 0444 root sys $DATADIR/templates templates/*.tmpl
|
||||
#d 0755 root sys $DATADIR/templates/eu
|
||||
#f 0444 root sys $DATADIR/templates/eu templates/eu/*.tmpl
|
||||
|
||||
#d 0755 root sys $DATADIR/templates/fr
|
||||
#f 0444 root sys $DATADIR/templates/fr templates/fr/*.tmpl
|
||||
d 0755 root sys $DATADIR/templates/fr
|
||||
f 0444 root sys $DATADIR/templates/fr templates/fr/*.tmpl
|
||||
|
||||
#d 0755 root sys $DATADIR/templates/he
|
||||
#f 0444 root sys $DATADIR/templates/he templates/he/*.tmpl
|
||||
@@ -500,14 +500,17 @@ f 0444 root sys $DATADIR/templates templates/*.tmpl
|
||||
#d 0755 root sys $DATADIR/templates/it
|
||||
#f 0444 root sys $DATADIR/templates/it templates/it/*.tmpl
|
||||
|
||||
#d 0755 root sys $DATADIR/templates/ja
|
||||
#f 0444 root sys $DATADIR/templates/ja templates/ja/*.tmpl
|
||||
d 0755 root sys $DATADIR/templates/ja
|
||||
f 0444 root sys $DATADIR/templates/ja templates/ja/*.tmpl
|
||||
|
||||
#d 0755 root sys $DATADIR/templates/pl
|
||||
#f 0444 root sys $DATADIR/templates/pl templates/pl/*.tmpl
|
||||
|
||||
#d 0755 root sys $DATADIR/templates/ru
|
||||
#f 0444 root sys $DATADIR/templates/ru templates/ru/*.tmpl
|
||||
d 0755 root sys $DATADIR/templates/pt_BR
|
||||
f 0444 root sys $DATADIR/templates/pt_BR templates/pt_BR/*.tmpl
|
||||
|
||||
d 0755 root sys $DATADIR/templates/ru
|
||||
f 0444 root sys $DATADIR/templates/ru templates/ru/*.tmpl
|
||||
|
||||
#d 0755 root sys $DATADIR/templates/sv
|
||||
#f 0444 root sys $DATADIR/templates/sv templates/sv/*.tmpl
|
||||
|
||||
@@ -326,6 +326,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/locale/pt_BR/cups_pt_BR.po
|
||||
%dir /usr/share/locale/ru
|
||||
/usr/share/locale/ru/cups_ru.po
|
||||
%dir /usr/share/locale/zh_CN
|
||||
/usr/share/locale/zh_CN/cups_zh_CN.po
|
||||
|
||||
%dir /usr/share/man/man1
|
||||
/usr/share/man/man1/cancel.1.gz
|
||||
|
||||
+10
-10
@@ -225,7 +225,7 @@ local: genstrings
|
||||
genstrings: genstrings.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC) \
|
||||
sample.drv ../data/media.defs
|
||||
echo Linking $@...
|
||||
$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
|
||||
$(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
|
||||
libcupsppdc.a ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Generating localization strings...
|
||||
@@ -238,12 +238,12 @@ genstrings: genstrings.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC) \
|
||||
|
||||
ppdc: ppdc.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CXX) $(LDFLAGS) -o $@ ppdc.o -L. -lcupsppdc $(LIBS)
|
||||
$(LD_CXX) $(LDFLAGS) -o $@ ppdc.o -L. -lcupsppdc $(LIBS)
|
||||
|
||||
|
||||
ppdc-static: ppdc.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC) foo.drv foo-fr.po
|
||||
echo Linking $@...
|
||||
$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \
|
||||
$(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
echo Testing PPD compiler...
|
||||
@@ -257,7 +257,7 @@ ppdc-static: ppdc.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC) foo.drv foo-fr.po
|
||||
|
||||
ppdhtml: ppdhtml.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CXX) $(LDFLAGS) -o $@ ppdhtml.o -L. -lcupsppdc $(LIBS)
|
||||
$(LD_CXX) $(LDFLAGS) -o $@ ppdhtml.o -L. -lcupsppdc $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -266,12 +266,12 @@ ppdhtml: ppdhtml.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
|
||||
|
||||
ppdi: ppdi.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CXX) $(LDFLAGS) -o $@ ppdi.o -L. -lcupsppdc $(LIBS)
|
||||
$(LD_CXX) $(LDFLAGS) -o $@ ppdi.o -L. -lcupsppdc $(LIBS)
|
||||
|
||||
|
||||
ppdi-static: ppdc-static ppdi.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdi-static ppdi.o libcupsppdc.a \
|
||||
$(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdi-static ppdi.o libcupsppdc.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
echo Testing PPD importer...
|
||||
@@ -293,7 +293,7 @@ ppdi-static: ppdc-static ppdi.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
ppdmerge: ppdmerge.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CXX) $(LDFLAGS) -o $@ ppdmerge.o $(LIBS)
|
||||
$(LD_CXX) $(LDFLAGS) -o $@ ppdmerge.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -302,7 +302,7 @@ ppdmerge: ppdmerge.o ../cups/$(LIBCUPS)
|
||||
|
||||
ppdpo: ppdpo.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CXX) $(LDFLAGS) -o $@ ppdpo.o -L. -lcupsppdc $(LIBS)
|
||||
$(LD_CXX) $(LDFLAGS) -o $@ ppdpo.o -L. -lcupsppdc $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -311,7 +311,7 @@ ppdpo: ppdpo.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
|
||||
|
||||
testcatalog: testcatalog.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CXX) $(LDFLAGS) -o $@ testcatalog.o libcupsppdc.a \
|
||||
$(LD_CXX) $(LDFLAGS) -o $@ testcatalog.o libcupsppdc.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
|
||||
@@ -351,7 +351,7 @@ libcupsppdc.1.dylib: $(LIBOBJS) ../cups/$(LIBCUPS)
|
||||
|
||||
libcupsppdc.la: $(LIBOBJS) ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
-version-info 1:0 $(LINKCUPS)
|
||||
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ ppdcDriver::write_ppd_file(
|
||||
// If we don't have a message catalog, use an empty (English) one...
|
||||
if (!catalog)
|
||||
{
|
||||
catalog = new ppdcCatalog("en");
|
||||
catalog = new ppdcCatalog(NULL);
|
||||
delete_cat = true;
|
||||
}
|
||||
else
|
||||
|
||||
+16
-16
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Scheduler Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -59,7 +59,7 @@ CXXOBJS = \
|
||||
cups-driverd.o
|
||||
OBJS = \
|
||||
$(COBJS) \
|
||||
$(CXXOBJS)
|
||||
$(LD_CXXOBJS)
|
||||
LIBTARGETS = \
|
||||
$(LIBCUPSMIME) \
|
||||
libcupsmime.a
|
||||
@@ -120,7 +120,7 @@ clean:
|
||||
|
||||
depend:
|
||||
$(CC) -MM $(ALL_CFLAGS) $(COBJS:.o=.c) >Dependencies
|
||||
$(CXX) -MM $(ALL_CXXFLAGS) $(CXXOBJS:.o=.cxx) >>Dependencies
|
||||
$(CXX) -MM $(ALL_CXXFLAGS) $(LD_CXXOBJS:.o=.cxx) >>Dependencies
|
||||
|
||||
|
||||
#
|
||||
@@ -356,14 +356,14 @@ uninstall:
|
||||
|
||||
cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
|
||||
$(LD_CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
$(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(ONDEMANDLIBS) \
|
||||
$(DNSSDLIBS) $(LIBS) $(LIBGSSAPI) $(LIBWRAP)
|
||||
|
||||
cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o cupsd-static $(CUPSDOBJS) libcupsmime.a \
|
||||
$(LD_CC) $(LDFLAGS) -o cupsd-static $(CUPSDOBJS) libcupsmime.a \
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
|
||||
$(LIBMALLOC) $(SERVERLIBS) $(ONDEMANDLIBS) $(DNSSDLIBS) \
|
||||
@@ -376,13 +376,13 @@ cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
cupsfilter: cupsfilter.o $(LIBCUPSMIME) ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o cupsfilter cupsfilter.o -L. -lcupsmime $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o cupsfilter cupsfilter.o -L. -lcupsmime $(LIBS)
|
||||
$(RM) convert
|
||||
$(LN) cupsfilter convert
|
||||
|
||||
cupsfilter-static: cupsfilter.o libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o cupsfilter-static cupsfilter.o libcupsmime.a \
|
||||
$(LD_CC) $(LDFLAGS) -o cupsfilter-static cupsfilter.o libcupsmime.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(LIBGSSAPI)
|
||||
|
||||
@@ -393,7 +393,7 @@ cupsfilter-static: cupsfilter.o libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
cups-deviced: cups-deviced.o util.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o cups-deviced cups-deviced.o util.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o cups-deviced cups-deviced.o util.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -402,7 +402,7 @@ cups-deviced: cups-deviced.o util.o ../cups/$(LIBCUPS)
|
||||
|
||||
cups-driverd: cups-driverd.o util.o ../cups/$(LIBCUPS) ../ppdc/$(LIBCUPSPPDC)
|
||||
echo Linking $@...
|
||||
$(CXX) $(LDFLAGS) -o cups-driverd cups-driverd.o util.o \
|
||||
$(LD_CXX) $(LDFLAGS) -o cups-driverd cups-driverd.o util.o \
|
||||
-L../ppdc -lcupsppdc $(LIBS)
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ cups-driverd: cups-driverd.o util.o ../cups/$(LIBCUPS) ../ppdc/$(LIBCUPSPPDC)
|
||||
|
||||
cups-exec: cups-exec.o
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o cups-exec cups-exec.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o cups-exec cups-exec.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -421,7 +421,7 @@ cups-exec: cups-exec.o
|
||||
|
||||
cups-lpd: cups-lpd.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o cups-lpd cups-lpd.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o cups-lpd cups-lpd.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -457,7 +457,7 @@ libcupsmime.1.dylib: $(LIBOBJS) libcupsmime.exp
|
||||
|
||||
libcupsmime.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
-version-info 1:0 $(LIBS)
|
||||
|
||||
|
||||
@@ -478,7 +478,7 @@ libcupsmime.a: $(LIBOBJS)
|
||||
|
||||
testlpd: testlpd.o ../cups/$(LIBCUPSSTATIC) cups-lpd
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testlpd testlpd.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o testlpd testlpd.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(COMMONLIBS) $(LIBZ) $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
|
||||
|
||||
|
||||
@@ -488,7 +488,7 @@ testlpd: testlpd.o ../cups/$(LIBCUPSSTATIC) cups-lpd
|
||||
|
||||
testmime: testmime.o libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testmime.o libcupsmime.a \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testmime.o libcupsmime.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(LIBGSSAPI)
|
||||
echo Running MIME tests...
|
||||
@@ -501,7 +501,7 @@ testmime: testmime.o libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testspeed: testspeed.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testspeed testspeed.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o testspeed testspeed.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
|
||||
@@ -511,7 +511,7 @@ testspeed: testspeed.o ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testsub: testsub.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testsub testsub.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o testsub testsub.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
|
||||
|
||||
+10
-38
@@ -85,6 +85,8 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
|
||||
if (cupsArrayCount(Clients) == MaxClients)
|
||||
return;
|
||||
|
||||
cupsdSetBusyState(1);
|
||||
|
||||
/*
|
||||
* Get a pointer to the next available client...
|
||||
*/
|
||||
@@ -439,7 +441,7 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */
|
||||
if (httpGetFd(con->http) >= 0)
|
||||
{
|
||||
cupsArrayRemove(ActiveClients, con);
|
||||
cupsdSetBusyState();
|
||||
cupsdSetBusyState(0);
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
/*
|
||||
@@ -760,7 +762,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
if (!cupsArrayFind(ActiveClients, con))
|
||||
{
|
||||
cupsArrayAdd(ActiveClients, con);
|
||||
cupsdSetBusyState();
|
||||
cupsdSetBusyState(0);
|
||||
}
|
||||
|
||||
case HTTP_STATE_OPTIONS :
|
||||
@@ -2082,7 +2084,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
else
|
||||
{
|
||||
cupsArrayRemove(ActiveClients, con);
|
||||
cupsdSetBusyState();
|
||||
cupsdSetBusyState(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2807,7 +2809,7 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */
|
||||
else
|
||||
{
|
||||
cupsArrayRemove(ActiveClients, con);
|
||||
cupsdSetBusyState();
|
||||
cupsdSetBusyState(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3627,42 +3629,12 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
|
||||
else
|
||||
auth_type[0] = '\0';
|
||||
|
||||
if (con->request &&
|
||||
(attr = ippFindAttribute(con->request, "attributes-natural-language",
|
||||
IPP_TAG_LANGUAGE)) != NULL)
|
||||
if (con->request && (attr = ippFindAttribute(con->request, "attributes-natural-language", IPP_TAG_LANGUAGE)) != NULL)
|
||||
{
|
||||
switch (strlen(attr->values[0].string.text))
|
||||
{
|
||||
default :
|
||||
/*
|
||||
* This is an unknown or badly formatted language code; use
|
||||
* the POSIX locale...
|
||||
*/
|
||||
cups_lang_t *language = cupsLangGet(ippGetString(attr, 0, NULL));
|
||||
|
||||
strlcpy(lang, "LANG=C", sizeof(lang));
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
/*
|
||||
* Just the language code (ll)...
|
||||
*/
|
||||
|
||||
snprintf(lang, sizeof(lang), "LANG=%s.UTF8",
|
||||
attr->values[0].string.text);
|
||||
break;
|
||||
|
||||
case 5 :
|
||||
/*
|
||||
* Language and country code (ll-cc)...
|
||||
*/
|
||||
|
||||
snprintf(lang, sizeof(lang), "LANG=%c%c_%c%c.UTF8",
|
||||
attr->values[0].string.text[0],
|
||||
attr->values[0].string.text[1],
|
||||
toupper(attr->values[0].string.text[3] & 255),
|
||||
toupper(attr->values[0].string.text[4] & 255));
|
||||
break;
|
||||
}
|
||||
snprintf(lang, sizeof(lang), "LANG=%s.UTF8", language->language);
|
||||
cupsLangFree(language);
|
||||
}
|
||||
else if (con->language)
|
||||
snprintf(lang, sizeof(lang), "LANG=%s.UTF8", con->language->language);
|
||||
|
||||
+14
-8
@@ -190,7 +190,7 @@ static void mime_error_cb(void *ctx, const char *message);
|
||||
static int parse_aaa(cupsd_location_t *loc, char *line,
|
||||
char *value, int linenum);
|
||||
static int parse_fatal_errors(const char *s);
|
||||
static int parse_groups(const char *s);
|
||||
static int parse_groups(const char *s, int linenum);
|
||||
static int parse_protocols(const char *s);
|
||||
static int parse_variable(const char *filename, int linenum,
|
||||
const char *line, const char *value,
|
||||
@@ -878,6 +878,7 @@ cupsdReadConfiguration(void)
|
||||
if (!ServerAlias)
|
||||
ServerAlias = cupsArrayNew(NULL, NULL);
|
||||
|
||||
cupsdAddAlias(ServerAlias, ServerName);
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "Added auto ServerAlias %s", ServerName);
|
||||
}
|
||||
else
|
||||
@@ -953,7 +954,7 @@ cupsdReadConfiguration(void)
|
||||
|
||||
if (NumSystemGroups == 0)
|
||||
{
|
||||
if (!parse_groups(CUPS_DEFAULT_SYSTEM_GROUPS))
|
||||
if (!parse_groups(CUPS_DEFAULT_SYSTEM_GROUPS, 0))
|
||||
{
|
||||
/*
|
||||
* Find the group associated with GID 0...
|
||||
@@ -2494,7 +2495,8 @@ parse_fatal_errors(const char *s) /* I - FatalErrors string */
|
||||
*/
|
||||
|
||||
static int /* O - 1 on success, 0 on failure */
|
||||
parse_groups(const char *s) /* I - Space-delimited groups */
|
||||
parse_groups(const char *s, /* I - Space-delimited groups */
|
||||
int linenum) /* I - Line number in cups-files.conf */
|
||||
{
|
||||
int status; /* Return status */
|
||||
char value[1024], /* Value string */
|
||||
@@ -2550,7 +2552,14 @@ parse_groups(const char *s) /* I - Space-delimited groups */
|
||||
NumSystemGroups ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (linenum)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown SystemGroup \"%s\" on line %d of %s.", valstart, linenum, CupsFilesFile);
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown default SystemGroup \"%s\".", valstart);
|
||||
|
||||
status = 0;
|
||||
}
|
||||
|
||||
endgrent();
|
||||
|
||||
@@ -3322,7 +3331,7 @@ read_cupsd_conf(cups_file_t *fp) /* I - File to read from */
|
||||
cupsdSetStringf(&ServerHeader, CUPS_MINIMAL " (%s %s; %s) IPP/2.1",
|
||||
plat.sysname, plat.release, plat.machine);
|
||||
else if (!_cups_strcasecmp(value, "None"))
|
||||
cupsdClearString(&ServerHeader);
|
||||
cupsdSetString(&ServerHeader, "");
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_WARN, "Unknown ServerTokens %s on line %d of %s.",
|
||||
value, linenum, ConfigurationFile);
|
||||
@@ -3547,11 +3556,8 @@ read_cups_files_conf(cups_file_t *fp) /* I - File to read from */
|
||||
* SystemGroup (admin) group(s)...
|
||||
*/
|
||||
|
||||
if (!parse_groups(value))
|
||||
if (!parse_groups(value, linenum))
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Unknown SystemGroup \"%s\" on line %d of %s.", value,
|
||||
linenum, CupsFilesFile);
|
||||
if (FatalErrors & CUPSD_FATAL_CONFIG)
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
xpc_transaction_begin();
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
/*
|
||||
* Don't buffer the output...
|
||||
*/
|
||||
|
||||
+50
-18
@@ -346,14 +346,17 @@ dnssdBuildTxtRecord(
|
||||
{
|
||||
int i, /* Looping var */
|
||||
count; /* Count of key/value pairs */
|
||||
char admin_hostname[256], /* .local hostname for admin page */
|
||||
char admin_hostname[256], /* Hostname for admin page */
|
||||
adminurl_str[256], /* URL for the admin page */
|
||||
type_str[32], /* Type to string buffer */
|
||||
state_str[32], /* State to string buffer */
|
||||
rp_str[1024], /* Queue name string buffer */
|
||||
air_str[1024], /* auth-info-required string buffer */
|
||||
*keyvalue[32][2]; /* Table of key/value pairs */
|
||||
*keyvalue[32][2], /* Table of key/value pairs */
|
||||
*ptr; /* Pointer in string */
|
||||
cupsd_txt_t txt; /* TXT record */
|
||||
cupsd_listener_t *lis; /* Current listener */
|
||||
const char *admin_scheme = "http"; /* Admin page URL scheme */
|
||||
|
||||
|
||||
/*
|
||||
@@ -382,20 +385,46 @@ dnssdBuildTxtRecord(
|
||||
keyvalue[count ][0] = "ty";
|
||||
keyvalue[count++][1] = p->make_model ? p->make_model : "Unknown";
|
||||
|
||||
if (strstr(DNSSDHostName, ".local"))
|
||||
strlcpy(admin_hostname, DNSSDHostName, sizeof(admin_hostname));
|
||||
/*
|
||||
* Get the hostname for the admin page...
|
||||
*/
|
||||
|
||||
if (strchr(DNSSDHostName, '.'))
|
||||
{
|
||||
/*
|
||||
* Use the provided hostname, but make sure it ends with a period...
|
||||
*/
|
||||
|
||||
if ((ptr = DNSSDHostName + strlen(DNSSDHostName) - 1) >= DNSSDHostName && *ptr == '.')
|
||||
strlcpy(admin_hostname, DNSSDHostName, sizeof(admin_hostname));
|
||||
else
|
||||
snprintf(admin_hostname, sizeof(admin_hostname), "%s.", DNSSDHostName);
|
||||
}
|
||||
else
|
||||
snprintf(admin_hostname, sizeof(admin_hostname), "%s.local.",
|
||||
DNSSDHostName);
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, adminurl_str, sizeof(adminurl_str),
|
||||
{
|
||||
/*
|
||||
* Unqualified hostname gets ".local." added to it...
|
||||
*/
|
||||
|
||||
snprintf(admin_hostname, sizeof(admin_hostname), "%s.local.", DNSSDHostName);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the URL scheme for the admin page...
|
||||
*/
|
||||
|
||||
# ifdef HAVE_SSL
|
||||
"https",
|
||||
# else
|
||||
"http",
|
||||
for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners); lis; lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
{
|
||||
if (lis->encryption != HTTP_ENCRYPTION_NEVER)
|
||||
{
|
||||
admin_scheme = "https";
|
||||
break;
|
||||
}
|
||||
}
|
||||
# endif /* HAVE_SSL */
|
||||
NULL, admin_hostname, DNSSDPort, "/%s/%s",
|
||||
(p->type & CUPS_PRINTER_CLASS) ? "classes" : "printers",
|
||||
p->name);
|
||||
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, adminurl_str, sizeof(adminurl_str), admin_scheme, NULL, admin_hostname, DNSSDPort, "/%s/%s", (p->type & CUPS_PRINTER_CLASS) ? "classes" : "printers", p->name);
|
||||
keyvalue[count ][0] = "adminurl";
|
||||
keyvalue[count++][1] = adminurl_str;
|
||||
|
||||
@@ -670,13 +699,16 @@ dnssdDeregisterInstance(
|
||||
DNSServiceRefDeallocate(*srv);
|
||||
|
||||
# else /* HAVE_AVAHI */
|
||||
if (!from_callback)
|
||||
avahi_threaded_poll_lock(DNSSDMaster);
|
||||
if (*srv)
|
||||
{
|
||||
if (!from_callback)
|
||||
avahi_threaded_poll_lock(DNSSDMaster);
|
||||
|
||||
avahi_entry_group_free(*srv);
|
||||
avahi_entry_group_free(*srv);
|
||||
|
||||
if (!from_callback)
|
||||
avahi_threaded_poll_unlock(DNSSDMaster);
|
||||
if (!from_callback)
|
||||
avahi_threaded_poll_unlock(DNSSDMaster);
|
||||
}
|
||||
# endif /* HAVE_DNSSD */
|
||||
|
||||
*srv = NULL;
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário