Comparar commits
4 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 1a18c85cd1 | |||
| b60086f8ae | |||
| 215ef63830 | |||
| a51f28ec99 |
@@ -0,0 +1,250 @@
|
||||
CHANGES-1.7.txt
|
||||
---------------
|
||||
|
||||
CHANGES IN CUPS V1.7.5
|
||||
|
||||
- Security: Addressed some more situations where symlinked files would
|
||||
be served by the web interface (STR #4455)
|
||||
- The LPD backend did not work with some versions of glibc (STR #4452)
|
||||
- CGI scripts did not work (STR #4454)
|
||||
- The cupsd.conf man page did not list the ErrorPolicy directive
|
||||
(STR #4457)
|
||||
- Updated the Brazilian Portuguese translation (STR #4456)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7.4
|
||||
|
||||
- Security: The web interface incorrectly served symlinked files and
|
||||
files that were not world-readable, potentially leading to a
|
||||
disclosure of information (STR #4450)
|
||||
- The CUPS headers incorrectly needed libdispatch for blocks support
|
||||
(STR #4397)
|
||||
- CUPS did not compile when Avahi or mDNSResponder was not present
|
||||
(STR #4402, STR #4424)
|
||||
- The "snmp" option did not work with the network backends (STR #4422)
|
||||
- The User directive in client.conf did not override the USER
|
||||
environment variable (STR #4426)
|
||||
- The web interface now properly shows a "Go" button for all text-based
|
||||
browsers (STR #4425)
|
||||
- The MaxJobTime directive now properly supports time values (STR #4434)
|
||||
- The RPM spec file did not work due to the new Brazilian Portuguese
|
||||
localization (STR #4436)
|
||||
- Fixed an "IPP read error" issue (STR #4440)
|
||||
- Fixed the --disable-libusb configure option (STR #4439)
|
||||
- Fixed the debug output from the DNS-SD backend when using Avahi
|
||||
(STR #4444)
|
||||
- Fixed a bug in the CUPS_SC_GET_DEVICE_ID handling by the network
|
||||
backends (STR #4447)
|
||||
- Added USB quirk rule for Lexmark E230 (STR #4448)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7.3
|
||||
|
||||
- Added Brazilian Portuguese translation (STR #4409)
|
||||
- Fixed mapping of OutputBin values such as "Tray1"
|
||||
(<rdar://problem/16685606>)
|
||||
- Several ippGet* functions incorrectly returned -1 instead of 0 on
|
||||
error.
|
||||
- The cupsGetResponse function did not work properly with
|
||||
CUPS_HTTP_DEFAULT (<rdar://problem/16762593>)
|
||||
- The IPP backend did not abort a job when the printer did not validate
|
||||
the supplied options (<rdar://problem/16836752>)
|
||||
- Fixed an authentication race condition in cupsSendRequest (STR #4403)
|
||||
- The scheduler did not add the "job-hold-until-specified" reason when
|
||||
holding a job using the lp command (STR #4405)
|
||||
- The configure script incorrectly added libgcrypt as a GNU TLS
|
||||
dependency (STR #4399)
|
||||
- cupsGetDestMediaCount did not work for CUPS_MEDIA_FLAGS DEFAULT
|
||||
(STR #4414)
|
||||
- Auto-typing of PWG Raster files did not work (STR #4417)
|
||||
- IPP queues using hardcoded credentials would ask for credentials
|
||||
(STR #4371)
|
||||
- Dates in non-UTF-8 locales did not display correctly (STR #4388)
|
||||
- The RPM spec file now looks for libusb-devel 1.0 or later.
|
||||
- Fixed the "create-printer-subscription.test" file for IPPTOOL
|
||||
(STR #4420)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7.2
|
||||
|
||||
- Security: The scheduler now blocks URLs containing embedded HTML
|
||||
(STR #4356)
|
||||
- Documentation fixes (STR #3259, STR #4346, STR #4355)
|
||||
- Fixed the Japanese localization (STR #4385)
|
||||
- Added a German localization (STR #4363)
|
||||
- The cupsfilter command incorrectly read the cupsd.conf file; it now
|
||||
reads the cups-files.conf file instead.
|
||||
- Fixed OS X builds with Xcode 5.x (<rdar://problem/15914959>)
|
||||
- Fixed SSL support on Windows (STR #4358)
|
||||
- Fixed documentation and naming of Create-Job/Printer-Subscriptions
|
||||
operations (STR #4389)
|
||||
- Phone numbers in fax jobs were not properly filtered for IPP FaxOut
|
||||
(<rdar://problem/16351701>)
|
||||
- Updated Linux "relro" support (STR #4349)
|
||||
- Fixed a memory leak in the label printer driver (STR #4393)
|
||||
- cupsEnumDests did not set the "is_default" field (STR #4332)
|
||||
- cupsDoIORequest could miss the server status, causing failed lpadmin
|
||||
and other administrative commands (STR #4386)
|
||||
- cupsEnumDests didn't always call the callback function (STR #4380)
|
||||
- "lp -i job-id -H hold" did not work (STR #nnn)
|
||||
- CUPS didn't compile on older platforms (STR #4338)
|
||||
- Several libcups files did not have the Apple license exception
|
||||
notice (STR #4361)
|
||||
- Fixed a D-BUS threading issue that caused the scheduler to crash
|
||||
(STR #4347)
|
||||
- The scheduler now automatically reconnects to Avahi as needed
|
||||
(STR #4370, STR #4373)
|
||||
- The scheduler did not handle GET requests for the log files properly
|
||||
(STR #3265)
|
||||
- The dnssd backend did not always report all discovered printers using
|
||||
Avahi (STR #4365)
|
||||
- The Zebra printer driver did not properly handle negative "label top"
|
||||
values (STR #4354)
|
||||
- The scheduler did not always update the MakeModel value in
|
||||
printers.conf after updating the driver (STR #4264)
|
||||
- The LPD mini daemon did not support print jobs larger than 2GB
|
||||
(STR #4351)
|
||||
- Fixed a bug in the status reading code when sending a compressed data
|
||||
stream to an IPP printer/server (<rdar://problem/16019623>)
|
||||
- The IPP backend might not include all job attributes in Validate-Job
|
||||
operations (<rdar://problem/16025435>)
|
||||
- Fixed some clang-reported issues (<rdar://problem/15936066>)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7.1
|
||||
|
||||
- Security: the lppasswd program incorrectly used settings from
|
||||
~/.cups/client.conf (STR #4319)
|
||||
- Auto debug logging was broken in 1.7.0 (<rdar://problem/15331639>)
|
||||
- Some gzip'd PPD files could not be used (<rdar://problem/15386424>)
|
||||
- Cleaned up some job logging in the scheduler
|
||||
(<rdar://problem/15332672>)
|
||||
- ATTR messages could cause string pool memory corruption in the
|
||||
scheduler (<rdar://problem/15382819>)
|
||||
- The RPM spec file did not list the build requirements; this was on
|
||||
purpose, but now we are listing the Red Hat package names
|
||||
(<rdar://problem/15375760>, STR #4322)
|
||||
- Printing to a raw queue could result in corrupt output due to
|
||||
opportunistic compression (<rdar://problem/15008524>)
|
||||
- The GNU TLS support code triggered many compiler warnings due to the
|
||||
use of old GNU TLS compatibility type names
|
||||
(<rdar://problem/15392966>)
|
||||
- The "make check" test suite did not work on Linux without the
|
||||
cups-filters package installed (<rdar://problem/14292998>)
|
||||
- Japanese PPDs using with the Shift-JIS encoding did not work
|
||||
(<rdar://problem/15427759>)
|
||||
- "tel:" URIs incorrectly had slashes (<rdar://problem/15418463>)
|
||||
- The libusb-based USB backend incorrectly used write timeouts
|
||||
(<rdar://problem/15564888>)
|
||||
- Shared printers could become inaccessible after a few days on OS X
|
||||
(<rdar://problem/15426838>)
|
||||
- The IPP backend did not wait for a busy printer to become available
|
||||
before attempting to print (<rdar://problem/15465667>)
|
||||
- CUPS did not support "auto-monochrome" or "process-monochrome" for the
|
||||
"print-color-mode" option (<rdar://problem/15482520>)
|
||||
- Using "@IF(name)" in an Allow or Deny rule did not work (STR #4328)
|
||||
- lpq and lpstat did not list jobs in the correct order when priorities
|
||||
were specified (STR #4326)
|
||||
- The D-BUS notifier did not remove its lockfile (STR #4314)
|
||||
- CUPS incorrectly used the USER environment variable when the name did
|
||||
not match the user ID (STR #4327)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7.0
|
||||
|
||||
- Updated the Japanese localization.
|
||||
- The lpadmin command did not send the PPD name from the "-m" option
|
||||
(<rdar://problem/15264697>)
|
||||
- Network backends now use the prtMarkerSuppliesClass property to
|
||||
determine the direction of supply level values
|
||||
(<rdar://problem/14302628>)
|
||||
- The scheduler did not remove backup PPD files when a printer was
|
||||
deleted (<rdar://problem/15065555>)
|
||||
- The scheduler incorrectly responded to HEAD requests when the web
|
||||
interface was disabled (<rdar://problem/15090332>)
|
||||
- The scheduler did not respond using the hostname specified by the
|
||||
client (<rdar://problem/14583574>)
|
||||
- Fax queues did not work when shared via Bonjour
|
||||
(<rdar://problem/14498310>)
|
||||
- Error messages from the scheduler were not localized using the
|
||||
language specified in the client's IPP request
|
||||
(<rdar://problem/14128011>)
|
||||
- Added an Italian localization (<rdar://problem/14481578>)
|
||||
- Fixed a couple memory leaks in ippfind that were reported by Clang.
|
||||
- Fixed a compile issue on 64-bit Linux with Clang - need to use the
|
||||
-pie option instead of -Wl,-pie now (<rdar://problem/14480938>)
|
||||
- The ippfind utility reported the wrong port numbers when compiled
|
||||
against Avahi (<rdar://problem/14508324>)
|
||||
- httpGetFd, httpGetFile, httpPutFd, and httpPutFile did not
|
||||
automatically reconnect if the server closed the connecion after the
|
||||
previous response.
|
||||
- Fixed a compile error in libcups (<rdar://problem/14467141>)
|
||||
- The scheduler incorrectly did not pass a FINAL_CONTENT_TYPE
|
||||
environment variable to the filters or backend
|
||||
(<rdar://problem/14355011>)
|
||||
- The cups-exec helper program could fail randomly on OS X due to
|
||||
sandbox violations when closing excess file descriptors
|
||||
(<rdar://problem/14421943>)
|
||||
- The scheduler incorrectly did not use the kqueue interface on OS X.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7rc1
|
||||
|
||||
- Printer xxx-default values were not reported by Get-Printer-Attributes
|
||||
or lpoptions (<rdar://problem/14401795>)
|
||||
- Fixed deprecation warnings for many functions on OS X so they are tied
|
||||
to the deployment version when building (<rdar://problem/14210079>)
|
||||
- Fixed a build issue on ARM-based Linux systems - unable to validate
|
||||
va_list arguments.
|
||||
- Added a new ippfind tool for finding IPP printers and other Bonjour
|
||||
services (<rdar://problem/13876199>)
|
||||
- Fixed some issues with conversion of PWG media size names to
|
||||
hundredths of millimeters (<rdar://problem/14065748>)
|
||||
- The IPP backend could crash on OS X when printing to a Kerberized
|
||||
printer (<rdar://problem/14040186>)
|
||||
- The ipptool program now automatically extends timeouts when the
|
||||
output buffer is filled (<rdar://problem/14016099>)
|
||||
- The ipptool program now supports the --help and --version options.
|
||||
- The ipptool program did not continue past include file errors by
|
||||
default (<rdar://problem/13875803>)
|
||||
- The ipptool program now supports FILE-ID and TEST-ID directives and
|
||||
includes their values in its XML output (<rdar://problem/13876038>)
|
||||
- The ipptool program now supports WITH-HOSTNAME, WITH-RESOURCE, and
|
||||
WITH-SCHEME expect predicates to compare the corresponding URI
|
||||
components (<rdar://problem/13876091>)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7b1
|
||||
|
||||
- The configure script now supports a --with-rundir option to change
|
||||
the transient run-time state directory from the default to other
|
||||
locations like /run/cups (STR #4306)
|
||||
- The scheduler now supports PPD lookups for classes (STR #4296)
|
||||
- The cupsfilter program did not set the FINAL_CONTENT_TYPE
|
||||
environment variable for filters.
|
||||
- Added a new "-x" option to the cancel command (STR #4103)
|
||||
- Made the PWG media handling APIs public (STR #4267)
|
||||
- Implemented ready media support for the cupsGetDestMediaXxx APIs
|
||||
(STR #4289)
|
||||
- Added new cupsFindDestDefault, cupsFindDestReady, and
|
||||
cupsFindDestSupported APIs (STR #4289)
|
||||
- Added new cupsGetDestMediaByIndex, cupsGetDestMediaCount, and
|
||||
cupsGetDestMediaDefault APIs (STR #4289)
|
||||
- Added new ippGet/SetOctetString APIs for getting and setting an
|
||||
octetString value (STR #4289)
|
||||
- Added new ippCreateRequestedArray API for generating a array of
|
||||
attributes from the requested-attributes attribute.
|
||||
- The ipptool utility now supports compression, conditional tests based
|
||||
on the presence of files, and new DEFINE predicates for STATUS.
|
||||
- Added new IPP APIs for checking values (STR #4167)
|
||||
- Added new IPP APis for adding and setting formatted strings.
|
||||
- Added new HTTP APIs to support basic server functionality via libcups.
|
||||
- The dnssd backend now generates a 1284 device ID as needed (STR #3702)
|
||||
- CUPS now supports compressing and decompressing streamed data
|
||||
(STR #4168)
|
||||
- CUPS now supports higher-level PIN printing, external accounting
|
||||
systems, and "print here" printing environments (STR #4169)
|
||||
- IRIX is no longer a supported operating system (STR #4092)
|
||||
- The PPD compiler now supports JCL options properly (STR #4115)
|
||||
- The web interface now checks whether the web browser has cookies
|
||||
enabled and displays a suitable error message (STR #4141)
|
||||
@@ -1,12 +1,13 @@
|
||||
CHANGES-IPPTOOL.txt - 2014-03-28
|
||||
CHANGES-IPPTOOL.txt - 2015-05-15
|
||||
--------------------------------
|
||||
|
||||
This file provides a list of changes to the ipptool binary distribution posted
|
||||
on cups.org.
|
||||
on CUPS.org.
|
||||
|
||||
2014-03-28
|
||||
2014-05-15
|
||||
|
||||
- Fixed SSL support on Windows (STR #4358)
|
||||
- Added support for simultaneous XML and test output from ipptool.
|
||||
- Added support for PAUSE directive in ipptool test files.
|
||||
|
||||
|
||||
2013-07-15
|
||||
|
||||
+58
-183
@@ -1,186 +1,61 @@
|
||||
CHANGES.txt - 1.7.2 - 2014-04-10
|
||||
CHANGES.txt - 2.0b1 - 2014-07-30
|
||||
--------------------------------
|
||||
|
||||
CHANGES IN CUPS V1.7.2
|
||||
CHANGES IN CUPS V2.0b1
|
||||
|
||||
- Security: The scheduler now blocks URLs containing embedded HTML
|
||||
(STR #4356)
|
||||
- Documentation fixes (STR #3259, STR #4346, STR #4355)
|
||||
- Fixed the Japanese localization (STR #4385)
|
||||
- Added a German localization (STR #4363)
|
||||
- The cupsfilter command incorrectly read the cupsd.conf file; it now
|
||||
reads the cups-files.conf file instead.
|
||||
- Fixed OS X builds with Xcode 5.x (<rdar://problem/15914959>)
|
||||
- Fixed SSL support on Windows (STR #4358)
|
||||
- Fixed documentation and naming of Create-Job/Printer-Subscriptions
|
||||
operations (STR #4389)
|
||||
- Phone numbers in fax jobs were not properly filtered for IPP FaxOut
|
||||
(<rdar://problem/16351701>)
|
||||
- Fixed a memory leak in the label printer driver (STR #4393)
|
||||
- Updated Linux "relro" support (STR #4349)
|
||||
- cupsEnumDests did not set the "is_default" field (STR #4332)
|
||||
- cupsDoIORequest could miss the server status, causing failed lpadmin
|
||||
and other administrative commands (STR #4386)
|
||||
- cupsEnumDests didn't always call the callback function (STR #4380)
|
||||
- "lp -i job-id -H hold" did not work (STR #nnn)
|
||||
- CUPS didn't compile on older platforms (STR #4338)
|
||||
- Several libcups files did not have the Apple license exception
|
||||
notice (STR #4361)
|
||||
- Fixed a D-BUS threading issue that caused the scheduler to crash
|
||||
(STR #4347)
|
||||
- The scheduler now automatically reconnects to Avahi as needed
|
||||
(STR #4370, STR #4373)
|
||||
- The scheduler did not handle GET requests for the log files properly
|
||||
(STR #3265)
|
||||
- The dnssd backend did not always report all discovered printers using
|
||||
Avahi (STR #4365)
|
||||
- The Zebra printer driver did not properly handle negative "label top"
|
||||
values (STR #4354)
|
||||
- The scheduler did not always update the MakeModel value in
|
||||
printers.conf after updating the driver (STR #4264)
|
||||
- The LPD mini daemon did not support print jobs larger than 2GB
|
||||
(STR #4351)
|
||||
- Fixed a bug in the status reading code when sending a compressed data
|
||||
stream to an IPP printer/server (<rdar://problem/16019623>)
|
||||
- The IPP backend might not include all job attributes in Validate-Job
|
||||
operations (<rdar://problem/16025435>)
|
||||
- Fixed some clang-reported issues (<rdar://problem/15936066>)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7.1
|
||||
|
||||
- Security: the lppasswd program incorrectly used settings from
|
||||
~/.cups/client.conf (STR #4319)
|
||||
- Auto debug logging was broken in 1.7.0 (<rdar://problem/15331639>)
|
||||
- Some gzip'd PPD files could not be used (<rdar://problem/15386424>)
|
||||
- Cleaned up some job logging in the scheduler
|
||||
(<rdar://problem/15332672>)
|
||||
- ATTR messages could cause string pool memory corruption in the
|
||||
scheduler (<rdar://problem/15382819>)
|
||||
- The RPM spec file did not list the build requirements; this was on
|
||||
purpose, but now we are listing the Red Hat package names
|
||||
(<rdar://problem/15375760>, STR #4322)
|
||||
- Printing to a raw queue could result in corrupt output due to
|
||||
opportunistic compression (<rdar://problem/15008524>)
|
||||
- The GNU TLS support code triggered many compiler warnings due to the
|
||||
use of old GNU TLS compatibility type names
|
||||
(<rdar://problem/15392966>)
|
||||
- The "make check" test suite did not work on Linux without the
|
||||
cups-filters package installed (<rdar://problem/14292998>)
|
||||
- Japanese PPDs using with the Shift-JIS encoding did not work
|
||||
(<rdar://problem/15427759>)
|
||||
- "tel:" URIs incorrectly had slashes (<rdar://problem/15418463>)
|
||||
- The libusb-based USB backend incorrectly used write timeouts
|
||||
(<rdar://problem/15564888>)
|
||||
- Shared printers could become inaccessible after a few days on OS X
|
||||
(<rdar://problem/15426838>)
|
||||
- The IPP backend did not wait for a busy printer to become available
|
||||
before attempting to print (<rdar://problem/15465667>)
|
||||
- CUPS did not support "auto-monochrome" or "process-monochrome" for the
|
||||
"print-color-mode" option (<rdar://problem/15482520>)
|
||||
- Using "@IF(name)" in an Allow or Deny rule did not work (STR #4328)
|
||||
- lpq and lpstat did not list jobs in the correct order when priorities
|
||||
were specified (STR #4326)
|
||||
- The D-BUS notifier did not remove its lockfile (STR #4314)
|
||||
- CUPS incorrectly used the USER environment variable when the name did
|
||||
not match the user ID (STR #4327)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7.0
|
||||
|
||||
- Updated Japanese localization.
|
||||
- The lpadmin command did not send the PPD name from the "-m" option
|
||||
(<rdar://problem/15264697>)
|
||||
- Network backends now use the prtMarkerSuppliesClass property to
|
||||
determine the direction of supply level values
|
||||
(<rdar://problem/14302628>)
|
||||
- The scheduler did not remove backup PPD files when a printer was
|
||||
deleted (<rdar://problem/15065555>)
|
||||
- The scheduler incorrectly responded to HEAD requests when the web
|
||||
interface was disabled (<rdar://problem/15090332>)
|
||||
- The scheduler did not respond using the hostname specified by the
|
||||
client (<rdar://problem/14583574>)
|
||||
- Fax queues did not work when shared via Bonjour
|
||||
(<rdar://problem/14498310>)
|
||||
- Error messages from the scheduler were not localized using the
|
||||
language specified in the client's IPP request
|
||||
(<rdar://problem/14128011>)
|
||||
- Added an Italian localization (<rdar://problem/14481578>)
|
||||
- Fixed a couple memory leaks in ippfind that were reported by Clang.
|
||||
- Fixed a compile issue on 64-bit Linux with Clang - need to use the
|
||||
-pie option instead of -Wl,-pie now (<rdar://problem/14480938>)
|
||||
- The ippfind utility reported the wrong port numbers when compiled
|
||||
against Avahi (<rdar://problem/14508324>)
|
||||
- httpGetFd, httpGetFile, httpPutFd, and httpPutFile did not
|
||||
automatically reconnect if the server closed the connecion after the
|
||||
previous response.
|
||||
- Fixed a compile error in libcups (<rdar://problem/14467141>)
|
||||
- The scheduler incorrectly did not pass a FINAL_CONTENT_TYPE
|
||||
environment variable to the filters or backend
|
||||
(<rdar://problem/14355011>)
|
||||
- The cups-exec helper program could fail randomly on OS X due to
|
||||
sandbox violations when closing excess file descriptors
|
||||
(<rdar://problem/14421943>)
|
||||
- The scheduler incorrectly did not use the kqueue interface on OS X.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7rc1
|
||||
|
||||
- Printer xxx-default values were not reported by Get-Printer-Attributes
|
||||
or lpoptions (<rdar://problem/14401795>)
|
||||
- Fixed deprecation warnings for many functions on OS X so they are tied
|
||||
to the deployment version when building (<rdar://problem/14210079>)
|
||||
- Fixed a build issue on ARM-based Linux systems - unable to validate
|
||||
va_list arguments.
|
||||
- Added a new ippfind tool for finding IPP printers and other Bonjour
|
||||
services (<rdar://problem/13876199>)
|
||||
- Fixed some issues with conversion of PWG media size names to
|
||||
hundredths of millimeters (<rdar://problem/14065748>)
|
||||
- The IPP backend could crash on OS X when printing to a Kerberized
|
||||
printer (<rdar://problem/14040186>)
|
||||
- The ipptool program now automatically extends timeouts when the
|
||||
output buffer is filled (<rdar://problem/14016099>)
|
||||
- The ipptool program now supports the --help and --version options.
|
||||
- The ipptool program did not continue past include file errors by
|
||||
default (<rdar://problem/13875803>)
|
||||
- The ipptool program now supports FILE-ID and TEST-ID directives and
|
||||
includes their values in its XML output (<rdar://problem/13876038>)
|
||||
- The ipptool program now supports WITH-HOSTNAME, WITH-RESOURCE, and
|
||||
WITH-SCHEME expect predicates to compare the corresponding URI
|
||||
components (<rdar://problem/13876091>)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.7b1
|
||||
|
||||
- The configure script now supports a --with-rundir option to change
|
||||
the transient run-time state directory from the default to other
|
||||
locations like /run/cups (STR #4306)
|
||||
- The scheduler now supports PPD lookups for classes (STR #4296)
|
||||
- The cupsfilter program did not set the FINAL_CONTENT_TYPE
|
||||
environment variable for filters.
|
||||
- Added a new "-x" option to the cancel command (STR #4103)
|
||||
- Made the PWG media handling APIs public (STR #4267)
|
||||
- Implemented ready media support for the cupsGetDestMediaXxx APIs
|
||||
(STR #4289)
|
||||
- Added new cupsFindDestDefault, cupsFindDestReady, and
|
||||
cupsFindDestSupported APIs (STR #4289)
|
||||
- Added new cupsGetDestMediaByIndex, cupsGetDestMediaCount, and
|
||||
cupsGetDestMediaDefault APIs (STR #4289)
|
||||
- Added new ippGet/SetOctetString APIs for getting and setting an
|
||||
octetString value (STR #4289)
|
||||
- Added new ippCreateRequestedArray API for generating a array of
|
||||
attributes from the requested-attributes attribute.
|
||||
- The ipptool utility now supports compression, conditional tests based
|
||||
on the presence of files, and new DEFINE predicates for STATUS.
|
||||
- Added new IPP APIs for checking values (STR #4167)
|
||||
- Added new IPP APis for adding and setting formatted strings.
|
||||
- Added new HTTP APIs to support basic server functionality via libcups.
|
||||
- The dnssd backend now generates a 1284 device ID as needed (STR #3702)
|
||||
- CUPS now supports compressing and decompressing streamed data
|
||||
(STR #4168)
|
||||
- CUPS now supports higher-level PIN printing, external accounting
|
||||
systems, and "print here" printing environments (STR #4169)
|
||||
- IRIX is no longer a supported operating system (STR #4092)
|
||||
- The PPD compiler now supports JCL options properly (STR #4115)
|
||||
- The web interface now checks whether the web browser has cookies
|
||||
enabled and displays a suitable error message (STR #4141)
|
||||
- Added a "--list-filters" option to the cupsfilter command (STR #4325)
|
||||
- Added systemd support (STR #3917)
|
||||
- Added support for re-sending a job as a raster file if a higher-level
|
||||
format such as PDF fails (<rdar://problem/15583721>)
|
||||
- Added support for regular expression matching in the MIME type rules
|
||||
(<rdar://problem/11131245>)
|
||||
- Added support for TLS certificate validation and policy enforcement
|
||||
(STR #1616)
|
||||
- Added support for simultaneous XML and test output from ipptool.
|
||||
- Added support for PAUSE directive in ipptool test files.
|
||||
- Added support for auto-typing of TIFF files by ipptool (STR #4418)
|
||||
- The scheduler now returns completed jobs in the correct newest-to-
|
||||
oldest order (STR #4396)
|
||||
- The configure script now supports target-specific tools for pkg-config
|
||||
and others (STR #4423)
|
||||
- The ipptool program now supports EXPECT statements for collection
|
||||
member attributes (<rdar://problem/15355218>)
|
||||
- The ipptool program now supports collection attributes with multiple
|
||||
values (<rdar://problem/15355124>)
|
||||
- The sample drivers now include all of the installed localizations by
|
||||
default (<rdar://problem/14756625>)
|
||||
- Adopted Linux man page conventions and updated all man pages
|
||||
(STR #4372, STR #4329)
|
||||
- The scheduler now supports the "first-index" operation attribute for
|
||||
the Get-Jobs operation (STR #2913)
|
||||
- Changed the default AccessLogLevel and PageLogFormat to disable the
|
||||
access_log and page_log files by default (<rdar://problem/16495000>)
|
||||
- cupsRasterInterpretPPD now supports the Orientation header in order to
|
||||
support long-edge feed raster printers (<rdar://problem/15837926>)
|
||||
- The scheduler now allows run-as-root backends to have group read and
|
||||
execute permissions (STR #2935)
|
||||
- The ippFindAttribute and ippFindNextAttribute functions now support
|
||||
hierarchical searches (STR #4395)
|
||||
- Dropped OpenSSL support in favor of GNU TLS.
|
||||
- Dropped "dark wake" support on OS X, which was preventing portables
|
||||
from going to sleep when there was a stuck job. We now use a variation
|
||||
of the CUPS 1.4 sleep support to do a cleaner sleep
|
||||
(<rdar://problem/14323704>)
|
||||
- Dropped support for AIX, HP-UX, and OSF/1 (aka Digital UNIX)
|
||||
- Dropped lppasswd and support for Digest authentication in in the
|
||||
scheduler (STR #4321)
|
||||
- The cupsGetClasses, cupsGetPrinters, and cupsTempFile functions are no
|
||||
longer supported.
|
||||
- The scheduler now caches more job history data and limits the number
|
||||
of completed jobs returned by Get-Jobs as needed in order to prevent a
|
||||
denial-of-service on busy servers (STR #2913)
|
||||
- The filter/backend sandbox on OS X now defaults to a more strict
|
||||
whitelist (<rdar://problem/15939788>)
|
||||
- Increased the default idle exit timeout to 60 seconds on OS X
|
||||
(<rdar://problem/16041820>)
|
||||
- Printer classes were not accessible on OS X
|
||||
(<rdar://problem/16385643>)
|
||||
- The scheduler now uses </DefaultPrinter> to close the default printer
|
||||
definition in printers.conf (STR #4153)
|
||||
- Canceling all jobs in the web interface now just cancels the jobs
|
||||
(STR #1914)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v1.7.2 - 2014-04-10
|
||||
INSTALL - CUPS v2.0b1 - 2014-07-30
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
IPPTOOL.txt - 2014-04-10
|
||||
IPPTOOL.txt - 2013-07-15
|
||||
------------------------
|
||||
|
||||
See the file CHANGES-IPPTOOL.txt for a list of changes to this software.
|
||||
@@ -220,7 +220,7 @@ REPORTING BUGS
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2014 by Apple Inc. CUPS and the CUPS logo are
|
||||
CUPS is Copyright 2007-2013 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
+7
-13
@@ -1,6 +1,6 @@
|
||||
CUPS License Agreement
|
||||
|
||||
Copyright 2007-2012 by Apple Inc.
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
1 Infinite Loop
|
||||
Cupertino, CA 95014 USA
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
INTRODUCTION
|
||||
|
||||
CUPS(tm) is provided under the GNU General Public License ("GPL")
|
||||
and GNU Library General Public License ("LGPL"), Version 2, with
|
||||
exceptions for Apple operating systems and the OpenSSL toolkit. A
|
||||
copy of the exceptions and licenses follow this introduction.
|
||||
and GNU Library General Public License ("LGPL"), Version 2, with an
|
||||
exception for Apple operating systems. A copy of the exception and
|
||||
licenses follow this introduction.
|
||||
|
||||
The GNU LGPL applies to the CUPS and CUPS Imaging libraries
|
||||
located in the "cups" and "filter" subdirectories of the CUPS
|
||||
@@ -45,7 +45,7 @@ application, driver, or filter.
|
||||
LICENSE EXCEPTIONS
|
||||
|
||||
In addition, as the copyright holder of CUPS, Apple Inc. grants
|
||||
the following special exceptions:
|
||||
the following special exception:
|
||||
|
||||
1. Apple Operating System Development License Exception;
|
||||
|
||||
@@ -86,14 +86,8 @@ the following special exceptions:
|
||||
This file is subject to the Apple OS-Developed
|
||||
Software exception.
|
||||
|
||||
2. OpenSSL Toolkit License Exception;
|
||||
|
||||
a. Apple Inc. explicitly allows the compilation and
|
||||
distribution of the CUPS software with the OpenSSL
|
||||
Toolkit.
|
||||
|
||||
No developer is required to provide these exceptions in a
|
||||
derived work.
|
||||
No developer is required to provide this exception in a derived
|
||||
work.
|
||||
|
||||
|
||||
KERBEROS SUPPORT CODE
|
||||
|
||||
+23
-20
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# "$Id: Makedefs.in 11154 2013-07-17 15:21:18Z msweet $"
|
||||
# "$Id: Makedefs.in 11716 2014-03-21 14:50:24Z msweet $"
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
# Common makefile definitions for CUPS.
|
||||
#
|
||||
# Copyright 2007-2013 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
#
|
||||
@@ -121,9 +121,9 @@ INSTALLXPC = @INSTALLXPC@
|
||||
#
|
||||
|
||||
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) $(SSLFLAGS) \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(ONDEMANDFLAGS) $(OPTIONS)
|
||||
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) $(SSLFLAGS) \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(ONDEMANDFLAGS) $(OPTIONS)
|
||||
ARCHFLAGS = @ARCHFLAGS@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
BACKLIBS = @BACKLIBS@
|
||||
@@ -140,13 +140,14 @@ DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
DNSSDLIBS = @DNSSDLIBS@
|
||||
IPPFIND_BIN = @IPPFIND_BIN@
|
||||
IPPFIND_MAN = @IPPFIND_MAN@
|
||||
LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(LIBZ)
|
||||
LINKCUPSIMAGE = @LINKCUPSIMAGE@
|
||||
LIBS = $(LINKCUPS) $(COMMONLIBS)
|
||||
ONDEMANDFLAGS = @ONDEMANDFLAGS@
|
||||
ONDEMANDLIBS = @ONDEMANDLIBS@
|
||||
OPTIM = @OPTIM@
|
||||
OPTIONS =
|
||||
PAMLIBS = @PAMLIBS@
|
||||
@@ -200,8 +201,6 @@ DATADIR = $(BUILDROOT)@CUPS_DATADIR@
|
||||
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
|
||||
ICONDIR = @ICONDIR@
|
||||
INCLUDEDIR = $(BUILDROOT)$(includedir)
|
||||
INITDIR = @INITDIR@
|
||||
INITDDIR = @INITDDIR@
|
||||
LIBDIR = $(BUILDROOT)$(libdir)
|
||||
LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
|
||||
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
|
||||
@@ -216,10 +215,7 @@ REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
|
||||
SBINDIR = $(BUILDROOT)@sbindir@
|
||||
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
|
||||
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
|
||||
SMFMANIFESTDIR = @SMFMANIFESTDIR@
|
||||
STATEDIR = $(BUILDROOT)@CUPS_STATEDIR@
|
||||
USBQUIRKS = @USBQUIRKS@
|
||||
XINETD = @XINETD@
|
||||
|
||||
MAN1EXT = @MAN1EXT@
|
||||
MAN5EXT = @MAN5EXT@
|
||||
@@ -230,8 +226,15 @@ MAN8DIR = @MAN8DIR@
|
||||
PAMDIR = @PAMDIR@
|
||||
PAMFILE = @PAMFILE@
|
||||
|
||||
DEFAULT_LAUNCHD_CONF = @DEFAULT_LAUNCHD_CONF@
|
||||
DBUSDIR = @DBUSDIR@
|
||||
INITDIR = @INITDIR@
|
||||
INITDDIR = @INITDDIR@
|
||||
LAUNCHD_DIR = @LAUNCHD_DIR@
|
||||
SMFMANIFESTDIR = @SMFMANIFESTDIR@
|
||||
SYSTEMD_DIR = @SYSTEMD_DIR@
|
||||
XINETD = @XINETD@
|
||||
|
||||
USBQUIRKS = @USBQUIRKS@
|
||||
|
||||
|
||||
#
|
||||
@@ -261,5 +264,5 @@ DBUSDIR = @DBUSDIR@
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makedefs.in 11154 2013-07-17 15:21:18Z msweet $"
|
||||
# End of "$Id: Makedefs.in 11716 2014-03-21 14:50:24Z msweet $"
|
||||
#
|
||||
|
||||
+19
-23
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# "$Id: Makefile 11370 2013-10-30 15:08:29Z msweet $"
|
||||
# "$Id: Makefile 12074 2014-07-31 01:10:14Z msweet $"
|
||||
#
|
||||
# Top-level Makefile for CUPS.
|
||||
# Top-level Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2013 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include Makedefs
|
||||
@@ -98,22 +98,18 @@ clean:
|
||||
|
||||
distclean: clean
|
||||
$(RM) Makedefs config.h config.log config.status
|
||||
$(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
|
||||
$(RM) cups-config
|
||||
$(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
|
||||
$(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html
|
||||
$(RM) man/client.conf.man
|
||||
$(RM) man/cups-deviced.man man/cups-driverd.man
|
||||
$(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
|
||||
$(RM) man/cupsd.conf.man man/drv.man man/lpoptions.man
|
||||
$(RM) packaging/cups.list
|
||||
$(RM) packaging/cups-desc.plist packaging/cups-info.plist
|
||||
$(RM) templates/header.tmpl
|
||||
$(RM) data/testprint
|
||||
$(RM) desktop/cups.desktop
|
||||
$(RM) scheduler/cups.sh scheduler/cups-lpd.xinetd
|
||||
$(RM) scheduler/org.cups.cups-lpd.plist scheduler/cups.xml
|
||||
$(RM) doc/index.html
|
||||
$(RM) man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsaddsmb.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man
|
||||
$(RM) packaging/cups.list
|
||||
$(RM) scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket
|
||||
$(RM) templates/header.tmpl
|
||||
-$(RM) doc/*/index.html
|
||||
-$(RM) templates/*/header.tmpl
|
||||
-$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test
|
||||
-$(RM) -r autom4te*.cache clang cups/charmaps cups/locale
|
||||
|
||||
|
||||
#
|
||||
@@ -323,7 +319,7 @@ sloc:
|
||||
|
||||
EPMFLAGS = -v --output-dir dist $(EPMARCH)
|
||||
|
||||
aix bsd deb depot inst pkg setld slackware swinstall tardist:
|
||||
bsd deb pkg slackware tardist:
|
||||
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
|
||||
|
||||
epm:
|
||||
@@ -352,5 +348,5 @@ dist: all
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 11370 2013-10-30 15:08:29Z msweet $".
|
||||
# End of "$Id: Makefile 12074 2014-07-31 01:10:14Z msweet $".
|
||||
#
|
||||
|
||||
+14
-1
@@ -1,6 +1,19 @@
|
||||
README - CUPS v1.7.2 - 2014-04-10
|
||||
README - CUPS v2.0b1 - 2014-07-30
|
||||
---------------------------------
|
||||
|
||||
********************************************************************************
|
||||
********************************************************************************
|
||||
******** ********
|
||||
******** ********
|
||||
******** THIS IS BETA-RELEASE SOFTWARE AND SHOULD NOT BE USED ON ********
|
||||
******** PRODUCTION SYSTEMS. ********
|
||||
******** ********
|
||||
******** ********
|
||||
********************************************************************************
|
||||
********************************************************************************
|
||||
|
||||
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt" instead...
|
||||
|
||||
|
||||
|
||||
+62
-55
@@ -1,70 +1,77 @@
|
||||
ipp.o: ipp.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
../cups/array-private.h
|
||||
lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/http.h \
|
||||
../cups/versioning.h ../cups/array.h ../cups/md5-private.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h backend-private.h \
|
||||
../cups/cups-private.h ../cups/string-private.h \
|
||||
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/language.h \
|
||||
../cups/array.h ../cups/versioning.h ../cups/http.h \
|
||||
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
|
||||
../cups/debug-private.h ../cups/array-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
dnssd.o: dnssd.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
snmp.o: snmp.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/http.h \
|
||||
../cups/versioning.h ../cups/array.h ../cups/md5-private.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h backend-private.h \
|
||||
../cups/cups-private.h ../cups/string-private.h \
|
||||
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/language.h \
|
||||
../cups/array.h ../cups/versioning.h ../cups/http.h \
|
||||
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
|
||||
../cups/debug-private.h ../cups/array-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \
|
||||
backend-private.h ../cups/cups-private.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
testbackend.o: testbackend.c ../cups/string-private.h ../config.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/language.h \
|
||||
../cups/http.h ../cups/array.h ../cups/language.h ../cups/pwg.h \
|
||||
../cups/sidechannel.h
|
||||
testsupplies.o: testsupplies.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
usb.o: usb.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
usb-darwin.c ../cups/file-private.h
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h usb-darwin.c \
|
||||
../cups/file-private.h
|
||||
|
||||
+23
-9
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# "$Id: Makefile 11154 2013-07-17 15:21:18Z msweet $"
|
||||
# "$Id: Makefile 11859 2014-05-08 22:42:44Z msweet $"
|
||||
#
|
||||
# Backend makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2013 by Apple Inc.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -23,8 +23,8 @@ include ../Makedefs
|
||||
|
||||
# RBACKENDS are installed mode 0700 so cupsd will run them as root...
|
||||
#
|
||||
# UBACKENDS are installed mode 0755 so cupsd will run them as an unprivileged
|
||||
# user...
|
||||
# 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...
|
||||
RBACKENDS = \
|
||||
@@ -33,7 +33,8 @@ RBACKENDS = \
|
||||
$(DNSSD_BACKEND)
|
||||
UBACKENDS = \
|
||||
snmp \
|
||||
socket \
|
||||
socket
|
||||
ULBACKENDS = \
|
||||
usb
|
||||
UNITTESTS = \
|
||||
test1284 \
|
||||
@@ -42,7 +43,8 @@ UNITTESTS = \
|
||||
TARGETS = \
|
||||
libbackend.a \
|
||||
$(RBACKENDS) \
|
||||
$(UBACKENDS)
|
||||
$(UBACKENDS) \
|
||||
$(ULBACKENDS)
|
||||
LIBOBJS = \
|
||||
ieee1284.o \
|
||||
network.o \
|
||||
@@ -71,7 +73,7 @@ all: $(TARGETS)
|
||||
# Make library targets...
|
||||
#
|
||||
|
||||
libs:
|
||||
libs: $(ULBACKENDS)
|
||||
|
||||
|
||||
#
|
||||
@@ -167,6 +169,18 @@ install-headers:
|
||||
#
|
||||
|
||||
install-libs:
|
||||
echo Installing backends in $(SERVERBIN)/backend
|
||||
$(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
|
||||
for file in $(ULBACKENDS); do \
|
||||
$(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
|
||||
done
|
||||
if test "x$(SYMROOT)" != "x"; then \
|
||||
$(INSTALL_DIR) $(SYMROOT); \
|
||||
for file in $(ULBACKENDS); do \
|
||||
cp $$file $(SYMROOT); \
|
||||
dsymutil $(SYMROOT)/$$file; \
|
||||
done \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
@@ -179,7 +193,7 @@ uninstall:
|
||||
$(RM) $(SERVERBIN)/apple/$$file; \
|
||||
done
|
||||
-$(RMDIR) $(SERVERBIN)/apple
|
||||
for file in $(RBACKENDS) $(UBACKENDS); do \
|
||||
for file in $(RBACKENDS) $(UBACKENDS) $(ULBACKENDS); do \
|
||||
$(RM) $(SERVERBIN)/backend/$$file; \
|
||||
done
|
||||
for file in $(IPPALIASES); do \
|
||||
@@ -301,5 +315,5 @@ include Dependencies
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 11154 2013-07-17 15:21:18Z msweet $".
|
||||
# End of "$Id: Makefile 11859 2014-05-08 22:42:44Z msweet $".
|
||||
#
|
||||
|
||||
+12
-12
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* "$Id: backend-private.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: backend-private.h 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Backend support definitions for CUPS.
|
||||
* Backend support definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_BACKEND_PRIVATE_H_
|
||||
@@ -313,7 +313,7 @@ extern int backendGetDeviceID(int fd, char *device_id,
|
||||
int uri_size);
|
||||
extern int backendGetMakeModel(const char *device_id,
|
||||
char *make_model,
|
||||
int make_model_size);
|
||||
size_t make_model_size);
|
||||
extern int backendNetworkSideCB(int print_fd, int device_fd,
|
||||
int snmp_fd, http_addr_t *addr,
|
||||
int use_bc);
|
||||
@@ -334,5 +334,5 @@ extern int backendWaitLoop(int snmp_fd, http_addr_t *addr,
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: backend-private.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: backend-private.h 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+47
-46
@@ -1,33 +1,17 @@
|
||||
/*
|
||||
* "$Id: dnssd.c 11623 2014-02-19 20:18:10Z msweet $"
|
||||
* "$Id: dnssd.c 11969 2014-06-30 14:27:01Z msweet $"
|
||||
*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2012 by Apple Inc.
|
||||
* Copyright 2008-2014 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Browse for printers.
|
||||
* browse_callback() - Browse devices.
|
||||
* browse_local_callback() - Browse local devices.
|
||||
* client_callback() - Avahi client callback function.
|
||||
* compare_devices() - Compare two devices.
|
||||
* exec_backend() - Execute the backend that corresponds to the
|
||||
* resolved service name.
|
||||
* device_type() - Get DNS-SD type enumeration from string.
|
||||
* get_device() - Create or update a device.
|
||||
* query_callback() - Process query data.
|
||||
* find_device() - Find a device from its name and domain.
|
||||
* sigterm_handler() - Handle termination signals.
|
||||
* unquote() - Unquote a name string.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -77,7 +61,8 @@ typedef struct
|
||||
*domain, /* Domain name */
|
||||
*fullName, /* Full name */
|
||||
*make_and_model, /* Make and model from TXT record */
|
||||
*device_id; /* 1284 device ID from TXT record */
|
||||
*device_id, /* 1284 device ID from TXT record */
|
||||
*uuid; /* UUID from TXT record */
|
||||
cups_devtype_t type; /* Device registration type */
|
||||
int priority, /* Priority associated with type */
|
||||
cups_shared, /* CUPS shared printer? */
|
||||
@@ -138,7 +123,7 @@ static void client_callback(AvahiClient *client,
|
||||
#endif /* HAVE_AVAHI */
|
||||
|
||||
static int compare_devices(cups_device_t *a, cups_device_t *b);
|
||||
static void exec_backend(char **argv);
|
||||
static void exec_backend(char **argv) __attribute__((noreturn));
|
||||
static cups_device_t *get_device(cups_array_t *devices,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
@@ -515,9 +500,15 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
unquote(uriName, best->fullName, sizeof(uriName));
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri),
|
||||
"dnssd", NULL, uriName, 0,
|
||||
best->cups_shared ? "/cups" : "/");
|
||||
if (best->uuid)
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, device_uri,
|
||||
sizeof(device_uri), "dnssd", NULL, uriName, 0,
|
||||
best->cups_shared ? "/cups?uuid=%s" : "/?uuid=%s",
|
||||
best->uuid);
|
||||
else
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri,
|
||||
sizeof(device_uri), "dnssd", NULL, uriName, 0,
|
||||
best->cups_shared ? "/cups" : "/");
|
||||
|
||||
cupsBackendReport("network", device_uri, best->make_and_model,
|
||||
best->name, best->device_id, NULL);
|
||||
@@ -548,9 +539,15 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
unquote(uriName, best->fullName, sizeof(uriName));
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri),
|
||||
"dnssd", NULL, uriName, 0,
|
||||
best->cups_shared ? "/cups" : "/");
|
||||
if (best->uuid)
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, device_uri,
|
||||
sizeof(device_uri), "dnssd", NULL, uriName, 0,
|
||||
best->cups_shared ? "/cups?uuid=%s" : "/?uuid=%s",
|
||||
best->uuid);
|
||||
else
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri,
|
||||
sizeof(device_uri), "dnssd", NULL, uriName, 0,
|
||||
best->cups_shared ? "/cups" : "/");
|
||||
|
||||
cupsBackendReport("network", device_uri, best->make_and_model,
|
||||
best->name, best->device_id, NULL);
|
||||
@@ -833,8 +830,8 @@ exec_backend(char **argv) /* I - Command-line arguments */
|
||||
* 'device_type()' - Get DNS-SD type enumeration from string.
|
||||
*/
|
||||
|
||||
static int
|
||||
device_type(const char *regtype)
|
||||
static cups_devtype_t /* O - Device type */
|
||||
device_type(const char *regtype) /* I - Service registration type */
|
||||
{
|
||||
#ifdef HAVE_AVAHI
|
||||
if (!strcmp(regtype, "_ipp._tcp"))
|
||||
@@ -924,8 +921,12 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
* Yes, add the device...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Found \"%s.%s%s\"...\n", serviceName, regtype,
|
||||
replyDomain);
|
||||
#ifdef HAVE_DNSSD
|
||||
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
|
||||
#else /* HAVE_AVAHI */
|
||||
avahi_service_name_join(fullName, kDNSServiceMaxDomainName,
|
||||
serviceName, regtype, replyDomain);
|
||||
#endif /* HAVE_DNSSD */
|
||||
|
||||
device = calloc(sizeof(cups_device_t), 1);
|
||||
device->name = strdup(serviceName);
|
||||
@@ -1111,7 +1112,7 @@ query_callback(
|
||||
datanext = data + datalen;
|
||||
|
||||
for (ptr = key; data < datanext && *data != '='; data ++)
|
||||
*ptr++ = *data;
|
||||
*ptr++ = (char)*data;
|
||||
*ptr = '\0';
|
||||
|
||||
if (data < datanext && *data == '=')
|
||||
@@ -1119,7 +1120,7 @@ query_callback(
|
||||
data ++;
|
||||
|
||||
if (data < datanext)
|
||||
memcpy(value, data, datanext - data);
|
||||
memcpy(value, data, (size_t)(datanext - data));
|
||||
value[datanext - data] = '\0';
|
||||
|
||||
fprintf(stderr, "DEBUG2: query_callback: \"%s=%s\".\n",
|
||||
@@ -1139,8 +1140,7 @@ query_callback(
|
||||
*/
|
||||
|
||||
ptr = device_id + strlen(device_id);
|
||||
snprintf(ptr, sizeof(device_id) - (ptr - device_id), "%s:%s;",
|
||||
key + 4, value);
|
||||
snprintf(ptr, sizeof(device_id) - (size_t)(ptr - device_id), "%s:%s;", key + 4, value);
|
||||
}
|
||||
|
||||
if (!_cups_strcasecmp(key, "usb_MFG") || !_cups_strcasecmp(key, "usb_MANU") ||
|
||||
@@ -1189,6 +1189,8 @@ query_callback(
|
||||
if (device->type == CUPS_DEVICE_PRINTER)
|
||||
device->sent = 1;
|
||||
}
|
||||
else if (!_cups_strcasecmp(key, "UUID"))
|
||||
device->uuid = strdup(value);
|
||||
}
|
||||
|
||||
if (device->device_id)
|
||||
@@ -1209,7 +1211,7 @@ query_callback(
|
||||
* Assume the first word is the make...
|
||||
*/
|
||||
|
||||
memcpy(make_and_model, model, ptr - model);
|
||||
memcpy(make_and_model, model, (size_t)(ptr - model));
|
||||
make_and_model[ptr - model] = '\0';
|
||||
|
||||
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s",
|
||||
@@ -1244,7 +1246,7 @@ query_callback(
|
||||
while (isalnum(*ptr & 255) || *ptr == '-' || *ptr == '.')
|
||||
{
|
||||
if (isalnum(*ptr & 255) && valptr < (value + sizeof(value) - 1))
|
||||
*valptr++ = toupper(*ptr++ & 255);
|
||||
*valptr++ = (char)toupper(*ptr++ & 255);
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -1253,8 +1255,7 @@ query_callback(
|
||||
}
|
||||
|
||||
ptr = device_id + strlen(device_id);
|
||||
snprintf(ptr, sizeof(device_id) - (ptr - device_id), "CMD:%s;",
|
||||
value + 1);
|
||||
snprintf(ptr, sizeof(device_id) - (size_t)(ptr - device_id), "CMD:%s;", value + 1);
|
||||
}
|
||||
|
||||
if (device_id[0])
|
||||
@@ -1329,5 +1330,5 @@ unquote(char *dst, /* I - Destination buffer */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dnssd.c 11623 2014-02-19 20:18:10Z msweet $".
|
||||
* End of "$Id: dnssd.c 11969 2014-06-30 14:27:01Z msweet $".
|
||||
*/
|
||||
|
||||
+18
-30
@@ -1,24 +1,18 @@
|
||||
/*
|
||||
* "$Id: ieee1284.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: ieee1284.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* IEEE-1284 support functions for CUPS.
|
||||
* IEEE-1284 support functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* backendGetDeviceID() - Get the IEEE-1284 device ID string and
|
||||
* corresponding URI.
|
||||
* backendGetMakeModel() - Get the make and model string from the device ID.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -26,7 +20,6 @@
|
||||
*/
|
||||
|
||||
#include "backend-private.h"
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -148,8 +141,7 @@ backendGetDeviceID(
|
||||
* Read the 1284 device ID...
|
||||
*/
|
||||
|
||||
if ((length = read(devparportfd, device_id,
|
||||
device_id_size - 1)) >= 2)
|
||||
if ((length = read(devparportfd, device_id, (size_t)device_id_size - 1)) >= 2)
|
||||
{
|
||||
device_id[length] = '\0';
|
||||
got_id = 1;
|
||||
@@ -178,8 +170,7 @@ backendGetDeviceID(
|
||||
* bytes. The 1284 spec says the length is stored MSB first...
|
||||
*/
|
||||
|
||||
length = (((unsigned)device_id[0] & 255) << 8) +
|
||||
((unsigned)device_id[1] & 255);
|
||||
length = (int)((((unsigned)device_id[0] & 255) << 8) + ((unsigned)device_id[1] & 255));
|
||||
|
||||
/*
|
||||
* Check to see if the length is larger than our buffer; first
|
||||
@@ -188,8 +179,7 @@ backendGetDeviceID(
|
||||
*/
|
||||
|
||||
if (length > device_id_size || length < 14)
|
||||
length = (((unsigned)device_id[1] & 255) << 8) +
|
||||
((unsigned)device_id[0] & 255);
|
||||
length = (int)((((unsigned)device_id[1] & 255) << 8) + ((unsigned)device_id[0] & 255));
|
||||
|
||||
if (length > device_id_size)
|
||||
length = device_id_size;
|
||||
@@ -221,7 +211,7 @@ backendGetDeviceID(
|
||||
|
||||
length -= 2;
|
||||
|
||||
memmove(device_id, device_id + 2, length);
|
||||
memmove(device_id, device_id + 2, (size_t)length);
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
}
|
||||
@@ -287,7 +277,7 @@ backendGetDeviceID(
|
||||
*/
|
||||
|
||||
if (make_model)
|
||||
backendGetMakeModel(device_id, make_model, make_model_size);
|
||||
backendGetMakeModel(device_id, make_model, (size_t)make_model_size);
|
||||
|
||||
/*
|
||||
* Then generate a device URI...
|
||||
@@ -372,7 +362,7 @@ int /* O - 0 on success, -1 on failure */
|
||||
backendGetMakeModel(
|
||||
const char *device_id, /* O - 1284 device ID */
|
||||
char *make_model, /* O - Make/model */
|
||||
int make_model_size) /* I - Size of buffer */
|
||||
size_t make_model_size) /* I - Size of buffer */
|
||||
{
|
||||
int num_values; /* Number of keys and values */
|
||||
cups_option_t *values; /* Keys and values */
|
||||
@@ -381,9 +371,7 @@ backendGetMakeModel(
|
||||
*des; /* Description string */
|
||||
|
||||
|
||||
DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", "
|
||||
"make_model=%p, make_model_size=%d)\n", device_id,
|
||||
make_model, make_model_size));
|
||||
DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", make_model=%p, make_model_size=" CUPS_LLFMT ")\n", device_id, make_model, CUPS_LLCAST make_model_size));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
@@ -487,5 +475,5 @@ backendGetMakeModel(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ieee1284.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: ieee1284.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+132
-78
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: ipp.c 11779 2014-03-28 20:48:44Z msweet $"
|
||||
* "$Id: ipp.c 12048 2014-07-18 14:26:14Z msweet $"
|
||||
*
|
||||
* IPP backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -79,7 +79,7 @@ typedef struct _cups_monitor_s /**** Monitoring data ****/
|
||||
static const char *auth_info_required;
|
||||
/* New auth-info-required value */
|
||||
#if defined(HAVE_GSSAPI) && defined(HAVE_XPC)
|
||||
static int child_pid = 0; /* Child process ID */
|
||||
static pid_t child_pid = 0; /* Child process ID */
|
||||
#endif /* HAVE_GSSAPI && HAVE_XPC */
|
||||
static const char * const jattrs[] = /* Job attributes we want */
|
||||
{
|
||||
@@ -91,8 +91,10 @@ static const char * const jattrs[] = /* Job attributes we want */
|
||||
"job-state",
|
||||
"job-state-reasons"
|
||||
};
|
||||
static int job_canceled = 0;
|
||||
static int job_canceled = 0,
|
||||
/* Job cancelled? */
|
||||
uri_credentials = 0;
|
||||
/* Credentials supplied in URI? */
|
||||
static char username[256] = "",
|
||||
/* Username for device URI */
|
||||
*password = NULL;
|
||||
@@ -526,8 +528,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
_cups_strcasecmp(value, "yes") ||
|
||||
_cups_strcasecmp(value, "true");
|
||||
!_cups_strcasecmp(value, "yes") ||
|
||||
!_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!_cups_strcasecmp(name, "version"))
|
||||
{
|
||||
@@ -630,6 +632,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*password++ = '\0';
|
||||
|
||||
cupsSetUser(username);
|
||||
uri_credentials = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -679,6 +682,44 @@ main(int argc, /* I - Number of command-line args */
|
||||
0, NULL);
|
||||
httpSetTimeout(http, 30.0, timeout_cb, NULL);
|
||||
|
||||
if (httpIsEncrypted(http))
|
||||
{
|
||||
/*
|
||||
* Validate TLS credentials...
|
||||
*/
|
||||
|
||||
cups_array_t *creds; /* TLS credentials */
|
||||
cups_array_t *lcreds = NULL; /* Loaded credentials */
|
||||
http_trust_t trust; /* Trust level */
|
||||
static const char *trusts[] = { NULL, "+cups-pki-invalid", "+cups-pki-changed", "+cups-pki-expired", NULL, "+cups-pki-unknown" };
|
||||
/* Trust keywords */
|
||||
|
||||
if (!httpCopyCredentials(http, &creds))
|
||||
{
|
||||
trust = httpCredentialsGetTrust(creds, hostname);
|
||||
|
||||
update_reasons(NULL, "-cups-pki-invalid,cups-pki-changed,cups-pki-expired,cups-pki-unknown");
|
||||
if (trusts[trust])
|
||||
{
|
||||
update_reasons(NULL, trusts[trust]);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
if (httpLoadCredentials(NULL, &lcreds, hostname))
|
||||
{
|
||||
/*
|
||||
* Could not load the credentials, let's save the ones we have so we
|
||||
* can detect changes...
|
||||
*/
|
||||
|
||||
httpSaveCredentials(NULL, creds, hostname);
|
||||
}
|
||||
|
||||
httpFreeCredentials(lcreds);
|
||||
httpFreeCredentials(creds);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
*/
|
||||
@@ -785,7 +826,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
}
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -831,15 +872,16 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
compression_sup = NULL;
|
||||
compression_sup = NULL;
|
||||
#endif /* HAVE_LIBZ */
|
||||
copies_sup = NULL;
|
||||
cups_version = NULL;
|
||||
format_sup = NULL;
|
||||
media_col_sup = NULL;
|
||||
supported = NULL;
|
||||
operations_sup = NULL;
|
||||
doc_handling_sup = NULL;
|
||||
copies_sup = NULL;
|
||||
cups_version = NULL;
|
||||
format_sup = NULL;
|
||||
media_col_sup = NULL;
|
||||
supported = NULL;
|
||||
operations_sup = NULL;
|
||||
doc_handling_sup = NULL;
|
||||
print_color_mode_sup = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -854,9 +896,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
|
||||
request->request.op.version[0] = version / 10;
|
||||
request->request.op.version[1] = version % 10;
|
||||
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
|
||||
@@ -905,7 +945,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
report_printer_state(supported);
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -1019,7 +1059,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
report_printer_state(supported);
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
|
||||
@@ -1308,7 +1348,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Copying print data."));
|
||||
|
||||
if ((compatsize = write(fd, buffer, bytes)) < 0)
|
||||
if ((compatsize = write(fd, buffer, (size_t)bytes)) < 0)
|
||||
{
|
||||
perror("DEBUG: Unable to write temporary file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
@@ -1410,6 +1450,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
sleep(10);
|
||||
}
|
||||
else if (ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED ||
|
||||
ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
|
||||
@@ -1506,7 +1547,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
else
|
||||
{
|
||||
fd = 0;
|
||||
http_status = cupsWriteRequestData(http, buffer, bytes);
|
||||
http_status = cupsWriteRequestData(http, buffer, (size_t)bytes);
|
||||
}
|
||||
|
||||
while (http_status == HTTP_CONTINUE &&
|
||||
@@ -1532,7 +1573,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Read %d bytes...\n", (int)bytes);
|
||||
|
||||
if ((http_status = cupsWriteRequestData(http, buffer, bytes))
|
||||
if ((http_status = cupsWriteRequestData(http, buffer, (size_t)bytes))
|
||||
!= HTTP_CONTINUE)
|
||||
break;
|
||||
}
|
||||
@@ -1668,8 +1709,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_SEND_DOCUMENT);
|
||||
request->request.op.version[0] = version / 10;
|
||||
request->request.op.version[1] = version % 10;
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
@@ -1702,7 +1742,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (num_files == 0)
|
||||
{
|
||||
fd = 0;
|
||||
http_status = cupsWriteRequestData(http, buffer, bytes);
|
||||
http_status = cupsWriteRequestData(http, buffer, (size_t)bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1721,7 +1761,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
while (!job_canceled && http_status == HTTP_CONTINUE &&
|
||||
(bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
if ((http_status = cupsWriteRequestData(http, buffer, bytes))
|
||||
if ((http_status = cupsWriteRequestData(http, buffer, (size_t)bytes))
|
||||
!= HTTP_CONTINUE)
|
||||
break;
|
||||
else
|
||||
@@ -1771,6 +1811,20 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
|
||||
copies_remaining --;
|
||||
}
|
||||
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
|
||||
argc == 6 &&
|
||||
document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf"))
|
||||
{
|
||||
/*
|
||||
* Need to reprocess the job as raster...
|
||||
*/
|
||||
|
||||
fputs("JOBSTATE: cups-retry-as-raster\n", stderr);
|
||||
if (job_id > 0)
|
||||
cancel_job(http, uri, job_id, resource, argv[2], version);
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_NOT_POSSIBLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
@@ -1854,6 +1908,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (!job_id || !waitjob || !get_job_attrs)
|
||||
continue;
|
||||
|
||||
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete."));
|
||||
|
||||
for (delay = _cupsNextDelay(0, &prev_delay); !job_canceled;)
|
||||
@@ -1878,8 +1934,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
|
||||
request->request.op.version[0] = version / 10;
|
||||
request->request.op.version[1] = version % 10;
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
@@ -2004,7 +2059,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Wait before polling again...
|
||||
*/
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -2015,8 +2070,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
if (job_canceled > 0 && job_id > 0)
|
||||
{
|
||||
cancel_job(http, uri, job_id, resource, argv[2], version);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the printer state and report it if necessary...
|
||||
*/
|
||||
@@ -2138,8 +2198,7 @@ cancel_job(http_t *http, /* I - HTTP connection */
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Canceling print job."));
|
||||
|
||||
request = ippNewRequest(IPP_CANCEL_JOB);
|
||||
request->request.op.version[0] = version / 10;
|
||||
request->request.op.version[1] = version % 10;
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
@@ -2154,9 +2213,6 @@ cancel_job(http_t *http, /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
ippDelete(cupsDoRequest(http, request, resource));
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
|
||||
}
|
||||
|
||||
|
||||
@@ -2184,8 +2240,7 @@ check_printer_state(
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
|
||||
request->request.op.version[0] = version / 10;
|
||||
request->request.op.version[1] = version % 10;
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
@@ -2288,8 +2343,7 @@ monitor_printer(
|
||||
job_op = (monitor->job_id > 0 && monitor->get_job_attrs) ?
|
||||
IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS;
|
||||
request = ippNewRequest(job_op);
|
||||
request->request.op.version[0] = monitor->version / 10;
|
||||
request->request.op.version[1] = monitor->version % 10;
|
||||
ippSetVersion(request, monitor->version / 10, monitor->version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, monitor->uri);
|
||||
@@ -2351,7 +2405,7 @@ monitor_printer(
|
||||
job_name = attr->values[0].string.text;
|
||||
else if (!strcmp(attr->name, "job-state") &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
job_state = attr->values[0].integer;
|
||||
job_state = (ipp_jstate_t)attr->values[0].integer;
|
||||
else if (!strcmp(attr->name, "job-originating-user-name") &&
|
||||
(attr->value_tag == IPP_TAG_NAME ||
|
||||
attr->value_tag == IPP_TAG_NAMELANG))
|
||||
@@ -2438,7 +2492,7 @@ monitor_printer(
|
||||
* Sleep for N seconds...
|
||||
*/
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -2448,10 +2502,17 @@ monitor_printer(
|
||||
*/
|
||||
|
||||
if (job_canceled > 0 && monitor->job_id > 0)
|
||||
{
|
||||
if (!httpReconnect(http))
|
||||
{
|
||||
cancel_job(http, monitor->uri, monitor->job_id, monitor->resource,
|
||||
monitor->user, monitor->version);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Cleanup and return...
|
||||
*/
|
||||
@@ -2505,9 +2566,8 @@ new_request(
|
||||
* Create the IPP request...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(op);
|
||||
request->request.op.version[0] = version / 10;
|
||||
request->request.op.version[1] = version % 10;
|
||||
request = ippNewRequest(op);
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
fprintf(stderr, "DEBUG: %s IPP/%d.%d\n",
|
||||
ippOpString(request->request.op.operation_id),
|
||||
@@ -2574,8 +2634,7 @@ new_request(
|
||||
(keyword = cupsGetOption("job-password", num_options,
|
||||
options)) != NULL)
|
||||
{
|
||||
ippAddOctetString(request, IPP_TAG_OPERATION, "job-password",
|
||||
keyword, strlen(keyword));
|
||||
ippAddOctetString(request, IPP_TAG_OPERATION, "job-password", keyword, (int)strlen(keyword));
|
||||
|
||||
if ((keyword = cupsGetOption("job-password-encryption", num_options,
|
||||
options)) == NULL)
|
||||
@@ -2654,8 +2713,7 @@ new_request(
|
||||
}
|
||||
break;
|
||||
case IPP_TAG_STRING :
|
||||
ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword,
|
||||
strlen(keyword));
|
||||
ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword, (int)strlen(keyword));
|
||||
break;
|
||||
default :
|
||||
if (!strcmp(mandatory, "print-color-mode") && !strcmp(keyword, "monochrome"))
|
||||
@@ -2985,20 +3043,23 @@ password_cb(const char *prompt, /* I - Prompt (not used) */
|
||||
(void)method;
|
||||
(void)resource;
|
||||
|
||||
/*
|
||||
* Remember that we need to authenticate...
|
||||
*/
|
||||
|
||||
auth_info_required = "username,password";
|
||||
|
||||
if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
|
||||
def_username))
|
||||
if (!uri_credentials)
|
||||
{
|
||||
char quoted[HTTP_MAX_VALUE * 2 + 4];
|
||||
/* Quoted string */
|
||||
/*
|
||||
* Remember that we need to authenticate...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "ATTR: auth-info-default=%s,\n",
|
||||
quote_string(def_username, quoted, sizeof(quoted)));
|
||||
auth_info_required = "username,password";
|
||||
|
||||
if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
|
||||
def_username))
|
||||
{
|
||||
char quoted[HTTP_MAX_VALUE * 2 + 4];
|
||||
/* Quoted string */
|
||||
|
||||
fprintf(stderr, "ATTR: auth-info-default=%s,\n",
|
||||
quote_string(def_username, quoted, sizeof(quoted)));
|
||||
}
|
||||
}
|
||||
|
||||
if (password && *password && *password_tries < 3)
|
||||
@@ -3098,16 +3159,14 @@ report_attr(ipp_attribute_t *attr) /* I - Attribute */
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
snprintf(valptr, sizeof(value) - (valptr - value), "%d",
|
||||
attr->values[i].integer);
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value), "%d", attr->values[i].integer);
|
||||
valptr += strlen(valptr);
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_KEYWORD :
|
||||
quote_string(attr->values[i].string.text, valptr,
|
||||
value + sizeof(value) - valptr);
|
||||
quote_string(attr->values[i].string.text, valptr, (size_t)(value + sizeof(value) - valptr));
|
||||
valptr += strlen(valptr);
|
||||
break;
|
||||
|
||||
@@ -3358,12 +3417,12 @@ run_as_user(char *argv[], /* I - Command-line arguments */
|
||||
|
||||
if (response)
|
||||
{
|
||||
child_pid = xpc_dictionary_get_int64(response, "child-pid");
|
||||
child_pid = (pid_t)xpc_dictionary_get_int64(response, "child-pid");
|
||||
|
||||
xpc_release(response);
|
||||
|
||||
if (child_pid)
|
||||
fprintf(stderr, "DEBUG: Child PID=%d.\n", child_pid);
|
||||
fprintf(stderr, "DEBUG: Child PID=%d.\n", (int)child_pid);
|
||||
else
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
@@ -3409,7 +3468,7 @@ run_as_user(char *argv[], /* I - Command-line arguments */
|
||||
|
||||
if (response)
|
||||
{
|
||||
status = xpc_dictionary_get_int64(response, "status");
|
||||
status = (int)xpc_dictionary_get_int64(response, "status");
|
||||
|
||||
if (status == SIGTERM || status == SIGKILL || status == SIGPIPE)
|
||||
{
|
||||
@@ -3608,8 +3667,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
temp = (char *)cupsArrayNext(state_reasons))
|
||||
if (!strncmp(temp, "cups-remote-", 12))
|
||||
{
|
||||
snprintf(remptr, sizeof(rem) - (remptr - rem), "%s%s", remprefix,
|
||||
temp);
|
||||
snprintf(remptr, sizeof(rem) - (size_t)(remptr - rem), "%s%s", remprefix, temp);
|
||||
remptr += strlen(remptr);
|
||||
remprefix = ",";
|
||||
|
||||
@@ -3622,8 +3680,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
|
||||
cupsArrayAdd(state_reasons, reason);
|
||||
|
||||
snprintf(addptr, sizeof(add) - (addptr - add), "%s%s", addprefix,
|
||||
reason);
|
||||
snprintf(addptr, sizeof(add) - (size_t)(addptr - add), "%s%s", addprefix, reason);
|
||||
addptr += strlen(addptr);
|
||||
addprefix = ",";
|
||||
}
|
||||
@@ -3641,8 +3698,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
{
|
||||
if (cupsArrayFind(state_reasons, reason))
|
||||
{
|
||||
snprintf(remptr, sizeof(rem) - (remptr - rem), "%s%s", remprefix,
|
||||
reason);
|
||||
snprintf(remptr, sizeof(rem) - (size_t)(remptr - rem), "%s%s", remprefix, reason);
|
||||
remptr += strlen(remptr);
|
||||
remprefix = ",";
|
||||
|
||||
@@ -3662,8 +3718,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
{
|
||||
if (strncmp(reason, "cups-", 5) && !cupsArrayFind(new_reasons, reason))
|
||||
{
|
||||
snprintf(remptr, sizeof(rem) - (remptr - rem), "%s%s", remprefix,
|
||||
reason);
|
||||
snprintf(remptr, sizeof(rem) - (size_t)(remptr - rem), "%s%s", remprefix, reason);
|
||||
remptr += strlen(remptr);
|
||||
remprefix = ",";
|
||||
|
||||
@@ -3679,8 +3734,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
{
|
||||
cupsArrayAdd(state_reasons, reason);
|
||||
|
||||
snprintf(addptr, sizeof(add) - (addptr - add), "%s%s", addprefix,
|
||||
reason);
|
||||
snprintf(addptr, sizeof(add) - (size_t)(addptr - add), "%s%s", addprefix, reason);
|
||||
addptr += strlen(addptr);
|
||||
addprefix = ",";
|
||||
}
|
||||
@@ -3702,5 +3756,5 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
}
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp.c 11779 2014-03-28 20:48:44Z msweet $".
|
||||
* End of "$Id: ipp.c 12048 2014-07-18 14:26:14Z msweet $".
|
||||
*/
|
||||
|
||||
+47
-58
@@ -1,27 +1,18 @@
|
||||
/*
|
||||
* "$Id: lpd.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $"
|
||||
*
|
||||
* Line Printer Daemon backend for CUPS.
|
||||
* Line Printer Daemon backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Send a file to the printer or server.
|
||||
* lpd_command() - Send an LPR command sequence and wait for a reply.
|
||||
* lpd_queue() - Queue a file using the Line Printer Daemon protocol.
|
||||
* lpd_write() - Write a buffer of data to an LPD server.
|
||||
* rresvport_af() - A simple implementation of rresvport_af().
|
||||
* sigterm_handler() - Handle 'terminate' signals that stop the backend.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -93,7 +84,7 @@ static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
|
||||
int copies, int banner, int format, int order,
|
||||
int reserve, int manual_copies, int timeout,
|
||||
int contimeout, const char *orighost);
|
||||
static int lpd_write(int lpd_fd, char *buffer, int length);
|
||||
static ssize_t lpd_write(int lpd_fd, char *buffer, size_t length);
|
||||
#ifndef HAVE_RRESVPORT_AF
|
||||
static int rresvport_af(int *port, int family);
|
||||
#endif /* !HAVE_RRESVPORT_AF */
|
||||
@@ -393,8 +384,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*/
|
||||
|
||||
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
_cups_strcasecmp(value, "yes") ||
|
||||
_cups_strcasecmp(value, "true");
|
||||
!_cups_strcasecmp(value, "yes") ||
|
||||
!_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!_cups_strcasecmp(name, "timeout"))
|
||||
{
|
||||
@@ -481,7 +472,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Copying print data."));
|
||||
|
||||
if (bytes > 0)
|
||||
write(fd, buffer, bytes);
|
||||
write(fd, buffer, (size_t)bytes);
|
||||
|
||||
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
|
||||
backendNetworkSideCB);
|
||||
@@ -592,7 +583,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
{
|
||||
va_list ap; /* Argument pointer */
|
||||
char buf[1024]; /* Output buffer */
|
||||
int bytes; /* Number of bytes to output */
|
||||
ssize_t bytes; /* Number of bytes to output */
|
||||
char status; /* Status from command */
|
||||
|
||||
|
||||
@@ -617,9 +608,9 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
* Send the command...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Sending command string (%d bytes)...\n", bytes);
|
||||
fprintf(stderr, "DEBUG: Sending command string (" CUPS_LLFMT " bytes)...\n", CUPS_LLCAST bytes);
|
||||
|
||||
if (lpd_write(fd, buf, bytes) < bytes)
|
||||
if (lpd_write(fd, buf, (size_t)bytes) < bytes)
|
||||
{
|
||||
perror("DEBUG: Unable to send LPD command");
|
||||
return (-1);
|
||||
@@ -634,7 +625,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "WARNING", _("The printer did not respond."));
|
||||
status = errno;
|
||||
status = (char)errno;
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: lpd_command returning %d\n", status);
|
||||
@@ -680,7 +671,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
int have_supplies; /* Printer supports supply levels? */
|
||||
int copy; /* Copies written */
|
||||
time_t start_time; /* Time of first connect */
|
||||
size_t nbytes; /* Number of bytes written */
|
||||
ssize_t nbytes; /* Number of bytes written */
|
||||
off_t tbytes; /* Total bytes written */
|
||||
char buffer[32768]; /* Output buffer */
|
||||
#ifdef WIN32
|
||||
@@ -782,7 +773,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
if (!connect(fd, &(addr->addr.addr), httpAddrLength(&(addr->addr))))
|
||||
if (!connect(fd, &(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr))))
|
||||
break;
|
||||
|
||||
error = errno;
|
||||
@@ -846,7 +837,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
break;
|
||||
}
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
if (delay < 30)
|
||||
delay += 5;
|
||||
@@ -967,7 +958,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (banner)
|
||||
{
|
||||
snprintf(cptr, sizeof(control) - (cptr - control),
|
||||
snprintf(cptr, sizeof(control) - (size_t)(cptr - control),
|
||||
"C%.31s\n" /* RFC 1179, Section 7.2 - class name <= 31 chars */
|
||||
"L%s\n",
|
||||
localhost, user);
|
||||
@@ -976,13 +967,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
snprintf(cptr, sizeof(control) - (cptr - control), "%cdfA%03d%.15s\n",
|
||||
snprintf(cptr, sizeof(control) - (size_t)(cptr - control), "%cdfA%03d%.15s\n",
|
||||
format, (int)getpid() % 1000, localhost);
|
||||
cptr += strlen(cptr);
|
||||
copies --;
|
||||
}
|
||||
|
||||
snprintf(cptr, sizeof(control) - (cptr - control),
|
||||
snprintf(cptr, sizeof(control) - (size_t)(cptr - control),
|
||||
"UdfA%03d%.15s\n"
|
||||
"N%.131s\n", /* RFC 1179, Section 7.2 - sourcefile name <= 131 chars */
|
||||
(int)getpid() % 1000, localhost, title);
|
||||
@@ -1012,9 +1003,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
fprintf(stderr, "DEBUG: Sending control file (%u bytes)\n",
|
||||
(unsigned)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
if ((size_t)lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
status = errno;
|
||||
status = (char)errno;
|
||||
perror("DEBUG: Unable to write control file");
|
||||
|
||||
}
|
||||
@@ -1024,7 +1015,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer did not respond."));
|
||||
status = errno;
|
||||
status = (char)errno;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1074,7 +1065,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
_("Spooling job, %.0f%% complete."),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
|
||||
if (lpd_write(fd, buffer, nbytes) < nbytes)
|
||||
if (lpd_write(fd, buffer, (size_t)nbytes) < nbytes)
|
||||
{
|
||||
perror("DEBUG: Unable to send print file to printer");
|
||||
break;
|
||||
@@ -1087,11 +1078,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
if (mode == MODE_STANDARD)
|
||||
{
|
||||
if (tbytes < filestats.st_size)
|
||||
status = errno;
|
||||
status = (char)errno;
|
||||
else if (lpd_write(fd, "", 1) < 1)
|
||||
{
|
||||
perror("DEBUG: Unable to send trailing nul to printer");
|
||||
status = errno;
|
||||
status = (char)errno;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1145,9 +1136,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
fprintf(stderr, "DEBUG: Sending control file (%lu bytes)\n",
|
||||
(unsigned long)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
if ((size_t)lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
status = errno;
|
||||
status = (char)errno;
|
||||
perror("DEBUG: Unable to write control file");
|
||||
}
|
||||
else
|
||||
@@ -1156,7 +1147,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer did not respond."));
|
||||
status = errno;
|
||||
status = (char)errno;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1169,6 +1160,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
_("Control file sent successfully."));
|
||||
}
|
||||
|
||||
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
|
||||
|
||||
/*
|
||||
* Collect the final supply levels as needed...
|
||||
*/
|
||||
@@ -1204,32 +1197,32 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* 'lpd_write()' - Write a buffer of data to an LPD server.
|
||||
*/
|
||||
|
||||
static int /* O - Number of bytes written or -1 on error */
|
||||
lpd_write(int lpd_fd, /* I - LPD socket */
|
||||
char *buffer, /* I - Buffer to write */
|
||||
int length) /* I - Number of bytes to write */
|
||||
static ssize_t /* O - Number of bytes written or -1 on error */
|
||||
lpd_write(int lpd_fd, /* I - LPD socket */
|
||||
char *buffer, /* I - Buffer to write */
|
||||
size_t length) /* I - Number of bytes to write */
|
||||
{
|
||||
int bytes, /* Number of bytes written */
|
||||
total; /* Total number of bytes written */
|
||||
ssize_t bytes, /* Number of bytes written */
|
||||
total; /* Total number of bytes written */
|
||||
|
||||
|
||||
if (abort_job)
|
||||
return (-1);
|
||||
|
||||
total = 0;
|
||||
while ((bytes = send(lpd_fd, buffer, length - total, 0)) >= 0)
|
||||
while ((bytes = send(lpd_fd, buffer, length - (size_t)total, 0)) >= 0)
|
||||
{
|
||||
total += bytes;
|
||||
buffer += bytes;
|
||||
|
||||
if (total == length)
|
||||
if ((size_t)total == length)
|
||||
break;
|
||||
}
|
||||
|
||||
if (bytes < 0)
|
||||
return (-1);
|
||||
else
|
||||
return (length);
|
||||
return (total);
|
||||
}
|
||||
|
||||
|
||||
@@ -1276,7 +1269,7 @@ rresvport_af(int *port, /* IO - Port number to bind to */
|
||||
* Try binding the port to the socket; return if all is OK...
|
||||
*/
|
||||
|
||||
if (!bind(fd, (struct sockaddr *)&addr, sizeof(addr)))
|
||||
if (!bind(fd, (struct sockaddr *)&addr, httpAddrLength(&addr)))
|
||||
return (fd);
|
||||
|
||||
/*
|
||||
@@ -1285,11 +1278,7 @@ rresvport_af(int *port, /* IO - Port number to bind to */
|
||||
|
||||
if (errno != EADDRINUSE)
|
||||
{
|
||||
# ifdef WIN32
|
||||
closesocket(fd);
|
||||
# else
|
||||
close(fd);
|
||||
# endif /* WIN32 */
|
||||
httpAddrClose(NULL, fd);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
@@ -1331,5 +1320,5 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpd.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $".
|
||||
*/
|
||||
|
||||
+39
-57
@@ -1,23 +1,18 @@
|
||||
/*
|
||||
* "$Id: network.c 3755 2012-03-30 05:59:14Z msweet $"
|
||||
* "$Id: network.c 11970 2014-07-01 14:35:25Z msweet $"
|
||||
*
|
||||
* Common backend network APIs for CUPS.
|
||||
* Common backend network APIs for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* backendCheckSideChannel() - Check the side-channel for pending requests.
|
||||
* backendNetworkSideCB() - Handle common network side-channel commands.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -26,11 +21,7 @@
|
||||
|
||||
#include "backend-private.h"
|
||||
#include <limits.h>
|
||||
#ifdef __hpux
|
||||
# include <sys/time.h>
|
||||
#else
|
||||
# include <sys/select.h>
|
||||
#endif /* __hpux */
|
||||
#include <sys/select.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -100,7 +91,7 @@ backendNetworkSideCB(
|
||||
|
||||
case CUPS_SC_CMD_GET_BIDI :
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
data[0] = use_bc;
|
||||
data[0] = (char)use_bc;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
@@ -139,13 +130,13 @@ backendNetworkSideCB(
|
||||
for (dataptr = data + strlen(data) + 1;
|
||||
count > 0 && dataptr < (data + sizeof(data) - 1);
|
||||
count --, dataptr += strlen(dataptr))
|
||||
strlcpy(dataptr, snmp_value, sizeof(data) - (dataptr - data));
|
||||
strlcpy(dataptr, snmp_value, sizeof(data) - (size_t)(dataptr - data));
|
||||
|
||||
fprintf(stderr, "DEBUG: Returning %s %s\n", data,
|
||||
data + strlen(data) + 1);
|
||||
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
datalen = dataptr - data;
|
||||
datalen = (int)(dataptr - data);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -168,7 +159,7 @@ backendNetworkSideCB(
|
||||
{
|
||||
if (_cupsSNMPRead(snmp_fd, &packet, 1.0))
|
||||
{
|
||||
int i; /* Looping var */
|
||||
size_t i; /* Looping var */
|
||||
|
||||
|
||||
if (!_cupsSNMPOIDToString(packet.object_name, data, sizeof(data)))
|
||||
@@ -183,26 +174,22 @@ backendNetworkSideCB(
|
||||
switch (packet.object_type)
|
||||
{
|
||||
case CUPS_ASN1_BOOLEAN :
|
||||
snprintf(dataptr, sizeof(data) - (dataptr - data), "%d",
|
||||
packet.object_value.boolean);
|
||||
datalen += (int)strlen(dataptr);
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%d", packet.object_value.boolean);
|
||||
datalen += strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_INTEGER :
|
||||
snprintf(dataptr, sizeof(data) - (dataptr - data), "%d",
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%d",
|
||||
packet.object_value.integer);
|
||||
datalen += (int)strlen(dataptr);
|
||||
datalen += strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_BIT_STRING :
|
||||
case CUPS_ASN1_OCTET_STRING :
|
||||
if (packet.object_value.string.num_bytes < 0)
|
||||
i = 0;
|
||||
else if (packet.object_value.string.num_bytes <
|
||||
(sizeof(data) - (dataptr - data)))
|
||||
if (packet.object_value.string.num_bytes < (sizeof(data) - (size_t)(dataptr - data)))
|
||||
i = packet.object_value.string.num_bytes;
|
||||
else
|
||||
i = (int)(sizeof(data) - (dataptr - data));
|
||||
i = sizeof(data) - (size_t)(dataptr - data);
|
||||
|
||||
memcpy(dataptr, packet.object_value.string.bytes, i);
|
||||
|
||||
@@ -211,8 +198,8 @@ backendNetworkSideCB(
|
||||
|
||||
case CUPS_ASN1_OID :
|
||||
_cupsSNMPOIDToString(packet.object_value.oid, dataptr,
|
||||
sizeof(data) - (dataptr - data));
|
||||
datalen += (int)strlen(dataptr);
|
||||
sizeof(data) - (size_t)(dataptr - data));
|
||||
datalen += strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_HEX_STRING :
|
||||
@@ -220,32 +207,27 @@ backendNetworkSideCB(
|
||||
i < packet.object_value.string.num_bytes &&
|
||||
dataptr < (data + sizeof(data) - 3);
|
||||
i ++, dataptr += 2)
|
||||
sprintf(dataptr, "%02X",
|
||||
packet.object_value.string.bytes[i]);
|
||||
datalen += (int)strlen(dataptr);
|
||||
sprintf(dataptr, "%02X", packet.object_value.string.bytes[i]);
|
||||
datalen += strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_COUNTER :
|
||||
snprintf(dataptr, sizeof(data) - (dataptr - data), "%d",
|
||||
packet.object_value.counter);
|
||||
datalen += (int)strlen(dataptr);
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.counter);
|
||||
datalen += strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_GAUGE :
|
||||
snprintf(dataptr, sizeof(data) - (dataptr - data), "%u",
|
||||
packet.object_value.gauge);
|
||||
datalen += (int)strlen(dataptr);
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.gauge);
|
||||
datalen += strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_TIMETICKS :
|
||||
snprintf(dataptr, sizeof(data) - (dataptr - data), "%u",
|
||||
packet.object_value.timeticks);
|
||||
datalen += (int)strlen(dataptr);
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.timeticks);
|
||||
datalen += strlen(dataptr);
|
||||
break;
|
||||
|
||||
default :
|
||||
fprintf(stderr, "DEBUG: Unknown OID value type %02X!\n",
|
||||
packet.object_type);
|
||||
fprintf(stderr, "DEBUG: Unknown OID value type %02X.\n", packet.object_type);
|
||||
|
||||
case CUPS_ASN1_NULL_VALUE :
|
||||
dataptr[0] = '\0';
|
||||
@@ -268,6 +250,12 @@ backendNetworkSideCB(
|
||||
datalen = 0;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_CONNECTED :
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
data[0] = device_fd != -1;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID :
|
||||
if (snmp_fd >= 0)
|
||||
{
|
||||
@@ -305,12 +293,6 @@ backendNetworkSideCB(
|
||||
break;
|
||||
}
|
||||
|
||||
case CUPS_SC_CMD_GET_CONNECTED :
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
data[0] = device_fd != -1;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
@@ -322,5 +304,5 @@ backendNetworkSideCB(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: network.c 3755 2012-03-30 05:59:14Z msweet $".
|
||||
* End of "$Id: network.c 11970 2014-07-01 14:35:25Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -212,3 +212,6 @@
|
||||
|
||||
# Lexmark E238 (<rdar://problem/14493054>)
|
||||
0x043d 0x00d7 no-reattach
|
||||
|
||||
# Lexmark E238 (STR #4448)
|
||||
0x043d 0x009a no-reattach
|
||||
|
||||
+15
-26
@@ -1,25 +1,18 @@
|
||||
/*
|
||||
* "$Id: runloop.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: runloop.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Common run loop APIs for CUPS backends.
|
||||
* Common run loop APIs for CUPS backends.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* backendDrainOutput() - Drain pending print data to the device.
|
||||
* backendRunLoop() - Read and write print and back-channel data.
|
||||
* backendWaitLoop() - Wait for input from stdin while handling
|
||||
* side-channel queries.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -28,11 +21,7 @@
|
||||
|
||||
#include "backend-private.h"
|
||||
#include <limits.h>
|
||||
#ifdef __hpux
|
||||
# include <sys/time.h>
|
||||
#else
|
||||
# include <sys/select.h>
|
||||
#endif /* __hpux */
|
||||
#include <sys/select.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -113,7 +102,7 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
|
||||
for (print_ptr = print_buffer; print_bytes > 0;)
|
||||
{
|
||||
if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
|
||||
if ((bytes = write(device_fd, print_ptr, (size_t)print_bytes)) < 0)
|
||||
{
|
||||
/*
|
||||
* Write error - bail if we don't see an error we can retry...
|
||||
@@ -293,7 +282,7 @@ backendRunLoop(
|
||||
fprintf(stderr,
|
||||
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data\n",
|
||||
CUPS_LLCAST bc_bytes);
|
||||
cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
|
||||
cupsBackChannelWrite(bc_buffer, (size_t)bc_bytes, 1.0);
|
||||
}
|
||||
else if (bc_bytes < 0 && errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
@@ -350,7 +339,7 @@ backendRunLoop(
|
||||
|
||||
if (print_bytes && FD_ISSET(device_fd, &output))
|
||||
{
|
||||
if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
|
||||
if ((bytes = write(device_fd, print_ptr, (size_t)print_bytes)) < 0)
|
||||
{
|
||||
/*
|
||||
* Write error - bail if we don't see an error we can retry...
|
||||
@@ -539,5 +528,5 @@ backendWaitLoop(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: runloop.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: runloop.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+23
-30
@@ -1,24 +1,17 @@
|
||||
/*
|
||||
* "$Id: snmp-supplies.c 11319 2013-09-27 16:18:26Z msweet $"
|
||||
* "$Id: snmp-supplies.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* SNMP supplies functions for CUPS.
|
||||
* SNMP supplies functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2013 by Apple Inc.
|
||||
* Copyright 2008-2014 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* backendSNMPSupplies() - Get the current supplies for a device.
|
||||
* backend_init_supplies() - Initialize the supplies list.
|
||||
* backend_walk_cb() - Interpret the supply value responses.
|
||||
* utf16_to_utf8() - Convert UTF-16 text to UTF-8.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -329,9 +322,9 @@ backendSNMPSupplies(
|
||||
|
||||
if ((supplies[i].max_capacity > 0 || (quirks & CUPS_SNMP_CAPACITY)) &&
|
||||
supplies[i].level >= 0)
|
||||
snprintf(ptr, sizeof(value) - (ptr - value), "%d", percent);
|
||||
snprintf(ptr, sizeof(value) - (size_t)(ptr - value), "%d", percent);
|
||||
else
|
||||
strlcpy(ptr, "-1", sizeof(value) - (ptr - value));
|
||||
strlcpy(ptr, "-1", sizeof(value) - (size_t)(ptr - value));
|
||||
}
|
||||
|
||||
fprintf(stderr, "ATTR: marker-levels=%s\n", value);
|
||||
@@ -585,7 +578,7 @@ backend_init_supplies(
|
||||
{
|
||||
if (!strcmp(description, value))
|
||||
cupsFileRead(cachefile, (char *)supplies,
|
||||
num_supplies * sizeof(backend_supplies_t));
|
||||
(size_t)num_supplies * sizeof(backend_supplies_t));
|
||||
else
|
||||
{
|
||||
num_supplies = -1;
|
||||
@@ -680,7 +673,7 @@ backend_init_supplies(
|
||||
|
||||
if (num_supplies > 0)
|
||||
cupsFileWrite(cachefile, (char *)supplies,
|
||||
num_supplies * sizeof(backend_supplies_t));
|
||||
(size_t)num_supplies * sizeof(backend_supplies_t));
|
||||
|
||||
cupsFileClose(cachefile);
|
||||
}
|
||||
@@ -708,7 +701,7 @@ backend_init_supplies(
|
||||
if (i)
|
||||
*ptr++ = ',';
|
||||
|
||||
strlcpy(ptr, supplies[i].color, sizeof(value) - (ptr - value));
|
||||
strlcpy(ptr, supplies[i].color, sizeof(value) - (size_t)(ptr - value));
|
||||
}
|
||||
|
||||
fprintf(stderr, "ATTR: marker-colors=%s\n", value);
|
||||
@@ -756,9 +749,9 @@ backend_init_supplies(
|
||||
type = supplies[i].type;
|
||||
|
||||
if (type < CUPS_TC_other || type > CUPS_TC_covers)
|
||||
strlcpy(ptr, "unknown", sizeof(value) - (ptr - value));
|
||||
strlcpy(ptr, "unknown", sizeof(value) - (size_t)(ptr - value));
|
||||
else
|
||||
strlcpy(ptr, types[type - CUPS_TC_other], sizeof(value) - (ptr - value));
|
||||
strlcpy(ptr, types[type - CUPS_TC_other], sizeof(value) - (size_t)(ptr - value));
|
||||
}
|
||||
|
||||
fprintf(stderr, "ATTR: marker-types=%s\n", value);
|
||||
@@ -1062,9 +1055,9 @@ utf16_to_utf8(
|
||||
for (ptr = temp; srcsize >= 2;)
|
||||
{
|
||||
if (le)
|
||||
ch = src[0] | (src[1] << 8);
|
||||
ch = (cups_utf32_t)(src[0] | (src[1] << 8));
|
||||
else
|
||||
ch = (src[0] << 8) | src[1];
|
||||
ch = (cups_utf32_t)((src[0] << 8) | src[1]);
|
||||
|
||||
src += 2;
|
||||
srcsize -= 2;
|
||||
@@ -1075,13 +1068,13 @@ utf16_to_utf8(
|
||||
* Multi-word UTF-16 char...
|
||||
*/
|
||||
|
||||
int lch; /* Lower word */
|
||||
cups_utf32_t lch; /* Lower word */
|
||||
|
||||
|
||||
if (le)
|
||||
lch = src[0] | (src[1] << 8);
|
||||
lch = (cups_utf32_t)(src[0] | (src[1] << 8));
|
||||
else
|
||||
lch = (src[0] << 8) | src[1];
|
||||
lch = (cups_utf32_t)((src[0] << 8) | src[1]);
|
||||
|
||||
if (lch >= 0xdc00 && lch <= 0xdfff)
|
||||
{
|
||||
@@ -1098,10 +1091,10 @@ utf16_to_utf8(
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
cupsUTF32ToUTF8(dst, temp, dstsize);
|
||||
cupsUTF32ToUTF8(dst, temp, (int)dstsize);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: snmp-supplies.c 11319 2013-09-27 16:18:26Z msweet $".
|
||||
* End of "$Id: snmp-supplies.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-47
@@ -1,44 +1,18 @@
|
||||
/*
|
||||
* "$Id: snmp.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: snmp.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* SNMP discovery backend for CUPS.
|
||||
* SNMP discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Discover printers via SNMP.
|
||||
* add_array() - Add a string to an array.
|
||||
* add_cache() - Add a cached device...
|
||||
* add_device_uri() - Add a device URI to the cache.
|
||||
* alarm_handler() - Handle alarm signals...
|
||||
* compare_cache() - Compare two cache entries.
|
||||
* debug_printf() - Display some debugging information.
|
||||
* fix_make_model() - Fix common problems in the make-and-model
|
||||
* string.
|
||||
* free_array() - Free an array of strings.
|
||||
* free_cache() - Free the array of cached devices.
|
||||
* get_interface_addresses() - Get the broadcast address(es) associated with
|
||||
* an interface.
|
||||
* list_device() - List a device we found...
|
||||
* password_cb() - Handle authentication requests.
|
||||
* probe_device() - Probe a device to discover whether it is a
|
||||
* printer.
|
||||
* read_snmp_conf() - Read the snmp.conf file.
|
||||
* read_snmp_response() - Read and parse a SNMP response...
|
||||
* run_time() - Return the total running time...
|
||||
* scan_devices() - Scan for devices using SNMP.
|
||||
* try_connect() - Try connecting on a port...
|
||||
* update_cache() - Update a cached device...
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -532,17 +506,16 @@ fix_make_model(
|
||||
make_model[0] = 'H';
|
||||
make_model[1] = 'P';
|
||||
make_model[2] = ' ';
|
||||
strlcpy(make_model + 3, mmptr, make_model_size - 3);
|
||||
strlcpy(make_model + 3, mmptr, (size_t)make_model_size - 3);
|
||||
}
|
||||
else if (!_cups_strncasecmp(old_make_model, "deskjet", 7))
|
||||
snprintf(make_model, make_model_size, "HP DeskJet%s", old_make_model + 7);
|
||||
snprintf(make_model, (size_t)make_model_size, "HP DeskJet%s", old_make_model + 7);
|
||||
else if (!_cups_strncasecmp(old_make_model, "officejet", 9))
|
||||
snprintf(make_model, make_model_size, "HP OfficeJet%s", old_make_model + 9);
|
||||
snprintf(make_model, (size_t)make_model_size, "HP OfficeJet%s", old_make_model + 9);
|
||||
else if (!_cups_strncasecmp(old_make_model, "stylus_pro_", 11))
|
||||
snprintf(make_model, make_model_size, "EPSON Stylus Pro %s",
|
||||
old_make_model + 11);
|
||||
snprintf(make_model, (size_t)make_model_size, "EPSON Stylus Pro %s", old_make_model + 11);
|
||||
else
|
||||
strlcpy(make_model, old_make_model, make_model_size);
|
||||
strlcpy(make_model, old_make_model, (size_t)make_model_size);
|
||||
|
||||
if ((mmptr = strstr(make_model, ", Inc.,")) != NULL)
|
||||
{
|
||||
@@ -753,7 +726,7 @@ probe_device(snmp_cache_t *device) /* I - Device */
|
||||
* Insert hostname/address...
|
||||
*/
|
||||
|
||||
strlcpy(uriptr, device->addrname, sizeof(uri) - (uriptr - uri));
|
||||
strlcpy(uriptr, device->addrname, sizeof(uri) - (size_t)(uriptr - uri));
|
||||
uriptr += strlen(uriptr);
|
||||
format += 2;
|
||||
}
|
||||
@@ -1233,7 +1206,7 @@ scan_devices(int ipv4, /* I - SNMP IPv4 socket */
|
||||
for (addr = addrs; addr; addr = addr->next)
|
||||
{
|
||||
#ifdef AF_INET6
|
||||
if (_httpAddrFamily(&(addr->addr)) == AF_INET6)
|
||||
if (httpAddrFamily(&(addr->addr)) == AF_INET6)
|
||||
fd = ipv6;
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
@@ -1335,7 +1308,7 @@ try_connect(http_addr_t *addr, /* I - Socket address */
|
||||
debug_printf("DEBUG: %.3f Trying %s://%s:%d...\n", run_time(),
|
||||
port == 515 ? "lpd" : "socket", addrname, port);
|
||||
|
||||
if ((fd = socket(_httpAddrFamily(addr), SOCK_STREAM, 0)) < 0)
|
||||
if ((fd = socket(httpAddrFamily(addr), SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to create socket: %s\n",
|
||||
strerror(errno));
|
||||
@@ -1346,7 +1319,7 @@ try_connect(http_addr_t *addr, /* I - Socket address */
|
||||
|
||||
alarm(1);
|
||||
|
||||
status = connect(fd, (void *)addr, httpAddrLength(addr));
|
||||
status = connect(fd, (void *)addr, (socklen_t)httpAddrLength(addr));
|
||||
|
||||
close(fd);
|
||||
alarm(0);
|
||||
@@ -1391,5 +1364,5 @@ update_cache(snmp_cache_t *device, /* I - Device */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: snmp.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: snmp.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-23
@@ -1,23 +1,18 @@
|
||||
/*
|
||||
* "$Id: socket.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: socket.c 11907 2014-06-09 18:35:32Z msweet $"
|
||||
*
|
||||
* AppSocket backend for CUPS.
|
||||
* AppSocket backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Send a file to the printer or server.
|
||||
* wait_bc() - Wait for back-channel data...
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -46,7 +41,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int wait_bc(int device_fd, int secs);
|
||||
static ssize_t wait_bc(int device_fd, int secs);
|
||||
|
||||
|
||||
/*
|
||||
@@ -250,8 +245,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*/
|
||||
|
||||
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
_cups_strcasecmp(value, "yes") ||
|
||||
_cups_strcasecmp(value, "true");
|
||||
!_cups_strcasecmp(value, "yes") ||
|
||||
!_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!_cups_strcasecmp(name, "contimeout"))
|
||||
{
|
||||
@@ -385,7 +380,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
}
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
if (delay < 30)
|
||||
delay += 5;
|
||||
@@ -415,7 +410,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
tbytes = 0;
|
||||
|
||||
if (bytes > 0)
|
||||
tbytes += write(device_fd, buffer, bytes);
|
||||
tbytes += write(device_fd, buffer, (size_t)bytes);
|
||||
|
||||
while (copies > 0 && tbytes >= 0)
|
||||
{
|
||||
@@ -434,6 +429,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Print file sent."));
|
||||
}
|
||||
|
||||
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
|
||||
|
||||
if (waiteof)
|
||||
{
|
||||
/*
|
||||
@@ -479,7 +476,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* 'wait_bc()' - Wait for back-channel data...
|
||||
*/
|
||||
|
||||
static int /* O - # bytes read or -1 on error */
|
||||
static ssize_t /* O - # bytes read or -1 on error */
|
||||
wait_bc(int device_fd, /* I - Socket */
|
||||
int secs) /* I - Seconds to wait */
|
||||
{
|
||||
@@ -509,7 +506,7 @@ wait_bc(int device_fd, /* I - Socket */
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data\n",
|
||||
(int)bytes);
|
||||
cupsBackChannelWrite(buffer, bytes, 1.0);
|
||||
cupsBackChannelWrite(buffer, (size_t)bytes, 1.0);
|
||||
}
|
||||
|
||||
return (bytes);
|
||||
@@ -520,5 +517,5 @@ wait_bc(int device_fd, /* I - Socket */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: socket.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: socket.c 11907 2014-06-09 18:35:32Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-24
@@ -1,25 +1,18 @@
|
||||
/*
|
||||
* "$Id: testbackend.c 4297 2013-05-10 16:04:59Z msweet $"
|
||||
* "$Id: testbackend.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* Backend test program for CUPS.
|
||||
* Backend test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Run the named backend.
|
||||
* sigterm_handler() - Flag when we get SIGTERM.
|
||||
* usage() - Show usage information.
|
||||
* walk_cb() - Show results of cupsSideChannelSNMPWalk...
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -97,7 +90,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (getcwd(libpath, sizeof(libpath)) &&
|
||||
(ptr = strrchr(libpath, '/')) != NULL && !strcmp(ptr, "/backend"))
|
||||
{
|
||||
strlcpy(ptr, "/cups", sizeof(libpath) - (ptr - libpath));
|
||||
strlcpy(ptr, "/cups", sizeof(libpath) - (size_t)(ptr - libpath));
|
||||
if (!access(libpath, 0))
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
@@ -311,7 +304,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
if ((bytes = cupsBackChannelRead(buffer, sizeof(buffer), 0)) > 0)
|
||||
write(2, buffer, bytes);
|
||||
write(2, buffer, (size_t)bytes);
|
||||
|
||||
/*
|
||||
* Throttle output to ~100hz...
|
||||
@@ -339,7 +332,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer), 5.0)) > 0)
|
||||
write(2, buffer, bytes);
|
||||
write(2, buffer, (size_t)bytes);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -414,7 +407,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer),
|
||||
timeout)) > 0)
|
||||
{
|
||||
write(2, buffer, bytes);
|
||||
write(2, buffer, (size_t)bytes);
|
||||
timeout = 5.0;
|
||||
}
|
||||
write(2, "\nDEBUG: END\n", 12);
|
||||
@@ -668,14 +661,17 @@ walk_cb(const char *oid, /* I - OID */
|
||||
void *context) /* I - Context (unused) */
|
||||
{
|
||||
char temp[80];
|
||||
if (datalen > (sizeof(temp) - 1))
|
||||
|
||||
(void)context;
|
||||
|
||||
if ((size_t)datalen > (sizeof(temp) - 1))
|
||||
{
|
||||
memcpy(temp, data, sizeof(temp) - 1);
|
||||
temp[sizeof(temp) - 1] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(temp, data, datalen);
|
||||
memcpy(temp, data, (size_t)datalen);
|
||||
temp[datalen] = '\0';
|
||||
}
|
||||
|
||||
@@ -684,5 +680,5 @@ walk_cb(const char *oid, /* I - OID */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testbackend.c 4297 2013-05-10 16:04:59Z msweet $".
|
||||
* End of "$Id: testbackend.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+56
-54
@@ -1,46 +1,46 @@
|
||||
/*
|
||||
* "$Id: usb-darwin.c 11670 2014-03-04 14:53:59Z msweet $"
|
||||
*
|
||||
* Copyright 2005-2014 Apple Inc. All rights reserved.
|
||||
*
|
||||
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
|
||||
* Inc. ("Apple") in consideration of your agreement to the following
|
||||
* terms, and your use, installation, modification or redistribution of
|
||||
* this Apple software constitutes acceptance of these terms. If you do
|
||||
* not agree with these terms, please do not use, install, modify or
|
||||
* redistribute this Apple software.
|
||||
*
|
||||
* In consideration of your agreement to abide by the following terms, and
|
||||
* subject to these terms, Apple grants you a personal, non-exclusive
|
||||
* license, under Apple's copyrights in this original Apple software (the
|
||||
* "Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
* Software, with or without modifications, in source and/or binary forms;
|
||||
* provided that if you redistribute the Apple Software in its entirety and
|
||||
* without modifications, you must retain this notice and the following
|
||||
* text and disclaimers in all such redistributions of the Apple Software.
|
||||
* Neither the name, trademarks, service marks or logos of Apple Computer,
|
||||
* Inc. may be used to endorse or promote products derived from the Apple
|
||||
* Software without specific prior written permission from Apple. Except
|
||||
* as expressly stated in this notice, no other rights or licenses, express
|
||||
* or implied, are granted by Apple herein, including but not limited to
|
||||
* any patent rights that may be infringed by your derivative works or by
|
||||
* other works in which the Apple Software may be incorporated.
|
||||
*
|
||||
* The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
* MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
* THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
* OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
*
|
||||
* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
* MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
* AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
* STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
* "$Id: usb-darwin.c 11669 2014-03-04 14:53:34Z msweet $"
|
||||
*
|
||||
* Copyright 2005-2014 Apple Inc. All rights reserved.
|
||||
*
|
||||
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
|
||||
* Inc. ("Apple") in consideration of your agreement to the following
|
||||
* terms, and your use, installation, modification or redistribution of
|
||||
* this Apple software constitutes acceptance of these terms. If you do
|
||||
* not agree with these terms, please do not use, install, modify or
|
||||
* redistribute this Apple software.
|
||||
*
|
||||
* In consideration of your agreement to abide by the following terms, and
|
||||
* subject to these terms, Apple grants you a personal, non-exclusive
|
||||
* license, under Apple's copyrights in this original Apple software (the
|
||||
* "Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
* Software, with or without modifications, in source and/or binary forms;
|
||||
* provided that if you redistribute the Apple Software in its entirety and
|
||||
* without modifications, you must retain this notice and the following
|
||||
* text and disclaimers in all such redistributions of the Apple Software.
|
||||
* Neither the name, trademarks, service marks or logos of Apple Computer,
|
||||
* Inc. may be used to endorse or promote products derived from the Apple
|
||||
* Software without specific prior written permission from Apple. Except
|
||||
* as expressly stated in this notice, no other rights or licenses, express
|
||||
* or implied, are granted by Apple herein, including but not limited to
|
||||
* any patent rights that may be infringed by your derivative works or by
|
||||
* other works in which the Apple Software may be incorporated.
|
||||
*
|
||||
* The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
* MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
* THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
* OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
*
|
||||
* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
* MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
* AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
* STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
@@ -286,10 +286,10 @@ static void log_usb_class_driver(int is_64bit);
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
static pid_t child_pid; /* Child PID */
|
||||
static void run_legacy_backend(int argc, char *argv[], int fd); /* Starts child backend process running as a ppc executable */
|
||||
static void run_legacy_backend(int argc, char *argv[], int fd) __attribute__((noreturn)); /* Starts child backend process running as a ppc executable */
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
static void sigterm_handler(int sig); /* SIGTERM handler */
|
||||
static void sigquit_handler(int sig, siginfo_t *si, void *unused);
|
||||
static void sigquit_handler(int sig, siginfo_t *si, void *unused) __attribute__((noreturn));
|
||||
|
||||
#ifdef PARSE_PS_ERRORS
|
||||
static const char *next_line (const char *buffer);
|
||||
@@ -688,7 +688,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (g.print_bytes)
|
||||
{
|
||||
bytes = g.print_bytes;
|
||||
bytes = (UInt32)g.print_bytes;
|
||||
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
|
||||
|
||||
/*
|
||||
@@ -710,7 +710,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
{
|
||||
fputs("DEBUG: Got USB pipe stalled during write\n", stderr);
|
||||
|
||||
bytes = g.print_bytes;
|
||||
bytes = (UInt32)g.print_bytes;
|
||||
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
|
||||
}
|
||||
|
||||
@@ -730,7 +730,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
sleep(5);
|
||||
#endif /* DEBUG_WRITES */
|
||||
|
||||
bytes = g.print_bytes;
|
||||
bytes = (UInt32)g.print_bytes;
|
||||
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
|
||||
}
|
||||
|
||||
@@ -769,6 +769,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Sent %lld bytes...\n", (off_t)total_bytes);
|
||||
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
|
||||
|
||||
/*
|
||||
* Signal the side channel thread to exit...
|
||||
@@ -1017,7 +1018,7 @@ sidechannel_thread(void *reference)
|
||||
fputs("DEBUG: CUPS_SC_CMD_GET_BIDI received from driver...\n",
|
||||
stderr);
|
||||
|
||||
data[0] = g.bidi_flag;
|
||||
data[0] = (char)g.bidi_flag;
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0);
|
||||
|
||||
fprintf(stderr,
|
||||
@@ -1033,7 +1034,7 @@ sidechannel_thread(void *reference)
|
||||
get_device_id(&status, data, &datalen);
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, datalen, 1.0);
|
||||
|
||||
if (datalen < sizeof(data))
|
||||
if ((size_t)datalen < sizeof(data))
|
||||
data[datalen] = '\0';
|
||||
else
|
||||
data[sizeof(data) - 1] = '\0';
|
||||
@@ -1236,7 +1237,7 @@ static Boolean find_device_cb(void *refcon,
|
||||
if (obj != 0x0)
|
||||
{
|
||||
CFStringRef idString = NULL;
|
||||
UInt32 location = -1;
|
||||
UInt32 location = ~0U;
|
||||
UInt8 interfaceNum = 0;
|
||||
|
||||
copy_devicestring(obj, &idString, &location, &interfaceNum);
|
||||
@@ -1876,7 +1877,7 @@ static void parse_options(char *options,
|
||||
else if (!_cups_strcasecmp(name, "serial"))
|
||||
strlcpy(serial, value, serial_size);
|
||||
else if (!_cups_strcasecmp(name, "location") && location)
|
||||
*location = strtol(value, NULL, 16);
|
||||
*location = (UInt32)strtoul(value, NULL, 16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1939,6 +1940,7 @@ static void run_legacy_backend(int argc,
|
||||
char *my_argv[32];
|
||||
char *usb_legacy_status;
|
||||
|
||||
|
||||
/*
|
||||
* If we're running as x86_64 or i386 and couldn't load the class driver
|
||||
* (because it's ppc or i386), then try to re-exec ourselves in ppc or i386
|
||||
@@ -2024,7 +2026,7 @@ static void run_legacy_backend(int argc,
|
||||
cups_serverbin = CUPS_SERVERBIN;
|
||||
snprintf(usbpath, sizeof(usbpath), "%s/backend/usb", cups_serverbin);
|
||||
|
||||
for (i = 0; i < argc && i < (sizeof(my_argv) / sizeof(my_argv[0])) - 1; i ++)
|
||||
for (i = 0; i < argc && i < (int)(sizeof(my_argv) / sizeof(my_argv[0])) - 1; i ++)
|
||||
my_argv[i] = argv[i];
|
||||
|
||||
my_argv[i] = NULL;
|
||||
@@ -2312,7 +2314,7 @@ static void get_device_id(cups_sc_status_t *status,
|
||||
if (deviceIDString)
|
||||
{
|
||||
CFStringGetCString(deviceIDString, data, *datalen, kCFStringEncodingUTF8);
|
||||
*datalen = strlen(data);
|
||||
*datalen = (int)strlen(data);
|
||||
CFRelease(deviceIDString);
|
||||
}
|
||||
*status = CUPS_SC_STATUS_OK;
|
||||
@@ -2346,5 +2348,5 @@ log_usb_class_driver(int is_64bit) /* I - Is the USB class driver 64-bit? */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-darwin.c 11670 2014-03-04 14:53:59Z msweet $".
|
||||
* End of "$Id: usb-darwin.c 11669 2014-03-04 14:53:34Z msweet $".
|
||||
*/
|
||||
|
||||
+15
-37
@@ -1,35 +1,15 @@
|
||||
/*
|
||||
* "$Id: usb-libusb.c 11456 2013-12-09 19:26:47Z msweet $"
|
||||
* "$Id: usb-libusb.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* LIBUSB interface code for CUPS.
|
||||
* LIBUSB interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* list_devices() - List the available printers.
|
||||
* print_device() - Print a file to a USB device.
|
||||
* close_device() - Close the connection to the USB printer.
|
||||
* compare_quirks() - Compare two quirks entries.
|
||||
* find_device() - Find or enumerate USB printers.
|
||||
* find_quirks() - Find the quirks for the given printer, if any.
|
||||
* get_device_id() - Get the IEEE-1284 device ID for the printer.
|
||||
* list_cb() - List USB printers for discovery.
|
||||
* load_quirks() - Load all quirks files in the /usr/share/cups/usb
|
||||
* directory.
|
||||
* make_device_uri() - Create a device URI for a USB printer.
|
||||
* open_device() - Open a connection to the USB printer.
|
||||
* print_cb() - Find a USB printer for printing.
|
||||
* read_thread() - Thread to read the backchannel data on.
|
||||
* sidechannel_thread() - Handle side-channel requests.
|
||||
* soft_reset() - Send a soft reset to the device.
|
||||
* soft_reset_printer() - Do the soft reset request specific to printers
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -920,8 +900,8 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
fprintf(stderr, "DEBUG: Printer does not report class 7 and/or "
|
||||
"subclass 1 but works as a printer anyway\n");
|
||||
|
||||
read_endp = -1;
|
||||
write_endp = -1;
|
||||
read_endp = 0xff;
|
||||
write_endp = 0xff;
|
||||
|
||||
for (endp = 0, endpptr = altptr->endpoint;
|
||||
endp < altptr->bNumEndpoints;
|
||||
@@ -1085,8 +1065,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
|
||||
* bytes. The 1284 spec says the length is stored MSB first...
|
||||
*/
|
||||
|
||||
length = (((unsigned)buffer[0] & 255) << 8) |
|
||||
((unsigned)buffer[1] & 255);
|
||||
length = (int)((((unsigned)buffer[0] & 255) << 8) | ((unsigned)buffer[1] & 255));
|
||||
|
||||
/*
|
||||
* Check to see if the length is larger than our buffer or less than 14 bytes
|
||||
@@ -1097,8 +1076,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
|
||||
*/
|
||||
|
||||
if (length > bufsize || length < 14)
|
||||
length = (((unsigned)buffer[1] & 255) << 8) |
|
||||
((unsigned)buffer[0] & 255);
|
||||
length = (int)((((unsigned)buffer[1] & 255) << 8) | ((unsigned)buffer[0] & 255));
|
||||
|
||||
if (length > bufsize)
|
||||
length = bufsize;
|
||||
@@ -1120,7 +1098,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
|
||||
* nul-terminate.
|
||||
*/
|
||||
|
||||
memmove(buffer, buffer + 2, length);
|
||||
memmove(buffer, buffer + 2, (size_t)length);
|
||||
buffer[length] = '\0';
|
||||
|
||||
return (0);
|
||||
@@ -1734,7 +1712,7 @@ static void *read_thread(void *reference)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Read %d bytes of back-channel data...\n",
|
||||
(int)rbytes);
|
||||
cupsBackChannelWrite((const char *)readbuffer, rbytes, 1.0);
|
||||
cupsBackChannelWrite((const char *)readbuffer, (size_t)rbytes, 1.0);
|
||||
}
|
||||
else if (readstatus == LIBUSB_ERROR_TIMEOUT)
|
||||
fputs("DEBUG: Got USB transaction timeout during read.\n", stderr);
|
||||
@@ -2021,6 +1999,6 @@ soft_reset_printer(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-libusb.c 11456 2013-12-09 19:26:47Z msweet $".
|
||||
* End of "$Id: usb-libusb.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
|
||||
+12
-21
@@ -1,27 +1,20 @@
|
||||
/*
|
||||
* "$Id: usb-unix.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: usb-unix.c 11342 2013-10-18 20:36:01Z msweet $"
|
||||
*
|
||||
* USB port backend for CUPS.
|
||||
* USB port backend for CUPS.
|
||||
*
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* print_device() - Print a file to a USB device.
|
||||
* list_devices() - List all USB devices.
|
||||
* open_device() - Open a USB device...
|
||||
* side_cb() - Handle side-channel requests...
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -285,8 +278,6 @@ list_devices(void)
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
#elif defined(__hpux)
|
||||
#elif defined(__osf)
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
|
||||
int i; /* Looping var */
|
||||
char device[255]; /* Device filename */
|
||||
@@ -612,5 +603,5 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-unix.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: usb-unix.c 11342 2013-10-18 20:36:01Z msweet $".
|
||||
*/
|
||||
|
||||
+22
-19
@@ -1,25 +1,28 @@
|
||||
lpc.o: lpc.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/ipp-private.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h
|
||||
lpq.o: lpq.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/ipp-private.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h
|
||||
lpr.o: lpr.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/ipp-private.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/http-private.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/thread-private.h
|
||||
lprm.o: lprm.c ../cups/cups-private.h ../cups/string-private.h \
|
||||
../config.h ../cups/debug-private.h ../cups/versioning.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/http-private.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/language.h \
|
||||
../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/http-private.h ../cups/language.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/pwg-private.h ../cups/cups.h ../cups/file.h ../cups/pwg.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
|
||||
|
||||
+13
-21
@@ -1,24 +1,16 @@
|
||||
/*
|
||||
* "$Id: lpc.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: lpc.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* "lpc" command for CUPS.
|
||||
* "lpc" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Parse options and commands.
|
||||
* compare_strings() - Compare two command-line strings.
|
||||
* do_command() - Do an lpc command...
|
||||
* show_help() - Show help messages.
|
||||
* show_status() - Show printers.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -32,7 +24,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int compare_strings(const char *, const char *, int);
|
||||
static int compare_strings(const char *, const char *, size_t);
|
||||
static void do_command(http_t *, const char *, const char *);
|
||||
static void show_help(const char *);
|
||||
static void show_status(http_t *, const char *);
|
||||
@@ -158,9 +150,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
static int /* O - -1 or 1 = no match, 0 = match */
|
||||
compare_strings(const char *s, /* I - Command-line string */
|
||||
const char *t, /* I - Option string */
|
||||
int tmin) /* I - Minimum number of unique chars in option */
|
||||
size_t tmin) /* I - Minimum number of unique chars in option */
|
||||
{
|
||||
int slen; /* Length of command-line string */
|
||||
size_t slen; /* Length of command-line string */
|
||||
|
||||
|
||||
slen = strlen(s);
|
||||
@@ -446,5 +438,5 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpc.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: lpc.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-49
@@ -1,27 +1,16 @@
|
||||
/*
|
||||
* "$Id: lpq.c 11101 2013-07-08 11:20:33Z msweet $"
|
||||
* "$Id: lpq.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* "lpq" command for CUPS.
|
||||
* "lpq" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Parse options and commands.
|
||||
* show_jobs() - Show jobs.
|
||||
* show_printer() - Show printer status.
|
||||
* usage() - Show program usage.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -194,7 +183,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
httpClose(http);
|
||||
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (isdigit(argv[i][0] & 255))
|
||||
@@ -262,7 +250,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i && interval)
|
||||
{
|
||||
fflush(stdout);
|
||||
sleep(interval);
|
||||
sleep((unsigned)interval);
|
||||
}
|
||||
else
|
||||
break;
|
||||
@@ -323,9 +311,6 @@ show_jobs(const char *command, /* I - Command name */
|
||||
ipp_jstate_t jobstate; /* job-state */
|
||||
int jobid, /* job-id */
|
||||
jobsize, /* job-k-octets */
|
||||
#ifdef __osf__
|
||||
jobpriority, /* job-priority */
|
||||
#endif /* __osf__ */
|
||||
jobcount, /* Number of jobs */
|
||||
jobcopies, /* Number of copies */
|
||||
rank; /* Rank of job */
|
||||
@@ -448,9 +433,6 @@ show_jobs(const char *command, /* I - Command name */
|
||||
|
||||
jobid = 0;
|
||||
jobsize = 0;
|
||||
#ifdef __osf__
|
||||
jobpriority = 50;
|
||||
#endif /* __osf__ */
|
||||
jobstate = IPP_JOB_PENDING;
|
||||
jobname = "unknown";
|
||||
jobuser = "unknown";
|
||||
@@ -467,12 +449,6 @@ show_jobs(const char *command, /* I - Command name */
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
jobsize = attr->values[0].integer;
|
||||
|
||||
#ifdef __osf__
|
||||
if (!strcmp(attr->name, "job-priority") &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
jobpriority = attr->values[0].integer;
|
||||
#endif /* __osf__ */
|
||||
|
||||
if (!strcmp(attr->name, "job-state") &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
jobstate = (ipp_jstate_t)attr->values[0].integer;
|
||||
@@ -510,16 +486,9 @@ show_jobs(const char *command, /* I - Command name */
|
||||
}
|
||||
|
||||
if (!longstatus && jobcount == 0)
|
||||
#ifdef __osf__
|
||||
_cupsLangPuts(stdout,
|
||||
/* TRANSLATORS: Pri is job priority. */
|
||||
_("Rank Owner Pri Job Files"
|
||||
" Total Size"));
|
||||
#else
|
||||
_cupsLangPuts(stdout,
|
||||
_("Rank Owner Job File(s)"
|
||||
" Total Size"));
|
||||
#endif /* __osf__ */
|
||||
|
||||
jobcount ++;
|
||||
|
||||
@@ -560,16 +529,9 @@ show_jobs(const char *command, /* I - Command name */
|
||||
namestr, 1024.0 * jobsize);
|
||||
}
|
||||
else
|
||||
#ifdef __osf__
|
||||
_cupsLangPrintf(stdout,
|
||||
_("%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes"),
|
||||
rankstr, jobuser, jobpriority, jobid, jobname,
|
||||
1024.0 * jobsize);
|
||||
#else
|
||||
_cupsLangPrintf(stdout,
|
||||
_("%-7s %-7.7s %-7d %-31.31s %.0f bytes"),
|
||||
rankstr, jobuser, jobid, jobname, 1024.0 * jobsize);
|
||||
#endif /* __osf */
|
||||
|
||||
if (attr == NULL)
|
||||
break;
|
||||
@@ -679,5 +641,5 @@ usage(void)
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpq.c 11101 2013-07-08 11:20:33Z msweet $".
|
||||
* End of "$Id: lpq.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-15
@@ -1,20 +1,16 @@
|
||||
/*
|
||||
* "$Id: lpr.c 11101 2013-07-08 11:20:33Z msweet $"
|
||||
* "$Id: lpr.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* "lpr" command for CUPS.
|
||||
* "lpr" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Parse options and send files for printing.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -406,7 +402,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
while (status == HTTP_CONTINUE &&
|
||||
(bytes = read(0, buffer, sizeof(buffer))) > 0)
|
||||
status = cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, bytes);
|
||||
status = cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, (size_t)bytes);
|
||||
|
||||
if (status != HTTP_CONTINUE)
|
||||
{
|
||||
@@ -436,5 +432,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpr.c 11101 2013-07-08 11:20:33Z msweet $".
|
||||
* End of "$Id: lpr.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+19
-20
@@ -1,73 +1,72 @@
|
||||
help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \
|
||||
../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/array.h ../cups/language.h help-index.h \
|
||||
../cups/array.h ../cups/language.h ../cups/pwg.h help-index.h \
|
||||
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h \
|
||||
../cups/dir.h
|
||||
html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h \
|
||||
../cups/md5-private.h
|
||||
admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h \
|
||||
../cups/adminutil.h ../cups/ppd.h
|
||||
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
makedocset.o: makedocset.c cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h
|
||||
makedocset.o: makedocset.c cgi-private.h cgi.h ../cups/cups.h \
|
||||
../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/array.h ../cups/language.h ../cups/pwg.h help-index.h \
|
||||
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h
|
||||
../cups/language.h ../cups/pwg.h help-index.h
|
||||
testhi.o: testhi.c cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h
|
||||
../cups/language.h ../cups/pwg.h help-index.h
|
||||
testtemplate.o: testtemplate.c cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h
|
||||
websearch.o: websearch.c cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h help-index.h
|
||||
../cups/language.h ../cups/pwg.h help-index.h
|
||||
|
||||
+16
-43
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
|
||||
# "$Id: Makefile 11777 2014-03-28 19:18:10Z msweet $"
|
||||
#
|
||||
# CGI makefile for CUPS.
|
||||
# CGI makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -32,8 +32,7 @@ OBJS = \
|
||||
printers.o \
|
||||
testcgi.o \
|
||||
testhi.o \
|
||||
testtemplate.o \
|
||||
websearch.o
|
||||
testtemplate.o
|
||||
CGIS = \
|
||||
admin.cgi \
|
||||
classes.cgi \
|
||||
@@ -42,8 +41,7 @@ CGIS = \
|
||||
printers.cgi
|
||||
LIBTARGETS = \
|
||||
libcupscgi.a \
|
||||
$(LIBCUPSCGI) \
|
||||
websearch
|
||||
$(LIBCUPSCGI)
|
||||
|
||||
UNITTARGETS = \
|
||||
testcgi \
|
||||
@@ -82,7 +80,7 @@ unittests: $(UNITTARGETS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) makedocset
|
||||
$(RM) libcupscgi.so libcupscgi.sl libcupscgi.dylib
|
||||
$(RM) libcupscgi.so libcupscgi.dylib
|
||||
|
||||
|
||||
#
|
||||
@@ -144,7 +142,7 @@ install-libs: $(INSTALLSTATIC)
|
||||
echo Installing libraries in $(LIBDIR)...
|
||||
$(INSTALL_DIR) -m 755 $(LIBDIR)
|
||||
$(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR)
|
||||
if test $(LIBCUPSCGI) = "libcupscgi.so.1" -o $(LIBCUPSCGI) = "libcupscgi.sl.1"; then \
|
||||
if test $(LIBCUPSCGI) = "libcupscgi.so.1"; then \
|
||||
$(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
|
||||
$(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
|
||||
fi
|
||||
@@ -177,9 +175,6 @@ uninstall:
|
||||
$(RM) $(LIBDIR)/libcupscgi.1.dylib
|
||||
$(RM) $(LIBDIR)/libcupscgi.a
|
||||
$(RM) $(LIBDIR)/libcupscgi.dylib
|
||||
$(RM) $(LIBDIR)/libcupscgi_s.a
|
||||
$(RM) $(LIBDIR)/libcupscgi.sl
|
||||
$(RM) $(LIBDIR)/libcupscgi.sl.1
|
||||
$(RM) $(LIBDIR)/libcupscgi.so
|
||||
$(RM) $(LIBDIR)/libcupscgi.so.1
|
||||
-$(RMDIR) $(LIBDIR)
|
||||
@@ -211,10 +206,10 @@ framedhelp:
|
||||
|
||||
|
||||
#
|
||||
# libcupscgi.so.1, libcupscgi.sl.1
|
||||
# libcupscgi.so.1
|
||||
#
|
||||
|
||||
libcupscgi.so.1 libcupscgi.sl.1: $(LIBOBJS)
|
||||
libcupscgi.so.1: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
|
||||
$(RM) `basename $@ .1`
|
||||
@@ -237,17 +232,6 @@ libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp
|
||||
$(LN) $@ libcupscgi.dylib
|
||||
|
||||
|
||||
#
|
||||
# libcupscgi_s.a
|
||||
#
|
||||
|
||||
libcupscgi_s.a: $(LIBOBJS)
|
||||
echo Creating $@...
|
||||
$(DSO) $(DSOFLAGS) -o libcupscgi_s.o $(LIBOBJS) $(LIBS)
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcupscgi_s.o
|
||||
|
||||
|
||||
#
|
||||
# libcupscgi.la
|
||||
#
|
||||
@@ -361,17 +345,6 @@ testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
$(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
|
||||
#
|
||||
# websearch
|
||||
#
|
||||
|
||||
websearch: websearch.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ websearch.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
|
||||
#
|
||||
# Dependencies...
|
||||
#
|
||||
@@ -380,5 +353,5 @@ include Dependencies
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
|
||||
# End of "$Id: Makefile 11777 2014-03-28 19:18:10Z msweet $".
|
||||
#
|
||||
|
||||
+28
-48
@@ -1,37 +1,16 @@
|
||||
/*
|
||||
* "$Id: admin.c 11345 2013-10-18 21:14:52Z msweet $"
|
||||
* "$Id: admin.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* Administration CGI for CUPS.
|
||||
* Administration CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Main entry for CGI.
|
||||
* choose_device_cb() - Add a device to the device selection page.
|
||||
* do_add_rss_subscription() - Add a RSS subscription.
|
||||
* do_am_class() - Add or modify a class.
|
||||
* do_am_printer() - Add or modify a printer.
|
||||
* do_cancel_subscription() - Cancel a subscription.
|
||||
* do_config_server() - Configure server settings.
|
||||
* do_delete_class() - Delete a class.
|
||||
* do_delete_printer() - Delete a printer.
|
||||
* do_export() - Export printers to Samba.
|
||||
* do_list_printers() - List available printers.
|
||||
* do_menu() - Show the main menu.
|
||||
* do_set_allowed_users() - Set the allowed/denied users for a queue.
|
||||
* do_set_default() - Set the server default printer/class.
|
||||
* do_set_options() - Configure the default options for a queue.
|
||||
* do_set_sharing() - Set printer-is-shared value.
|
||||
* get_option_value() - Return the value of an option.
|
||||
* get_points() - Get a value in points.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -89,8 +68,7 @@ static double get_points(double number, const char *uval);
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
main(void)
|
||||
{
|
||||
http_t *http; /* Connection to the server */
|
||||
const char *op; /* Operation name */
|
||||
@@ -1172,7 +1150,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
char filename[1024]; /* PPD filename */
|
||||
ppd_file_t *ppd; /* PPD information */
|
||||
char buffer[1024]; /* Buffer */
|
||||
int bytes; /* Number of bytes */
|
||||
ssize_t bytes; /* Number of bytes */
|
||||
http_status_t get_status; /* Status of GET */
|
||||
|
||||
|
||||
@@ -1194,7 +1172,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
else if ((fd = cupsTempFd(filename, sizeof(filename))) >= 0)
|
||||
{
|
||||
while ((bytes = httpRead2(http, buffer, sizeof(buffer))) > 0)
|
||||
write(fd, buffer, bytes);
|
||||
write(fd, buffer, (size_t)bytes);
|
||||
|
||||
close(fd);
|
||||
|
||||
@@ -1211,8 +1189,10 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
else
|
||||
{
|
||||
int linenum; /* Line number */
|
||||
|
||||
fprintf(stderr, "ERROR: Unable to open PPD file %s: %s\n",
|
||||
filename, ppdErrorString(ppdLastError(&bytes)));
|
||||
filename, ppdErrorString(ppdLastError(&linenum)));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1380,7 +1360,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
if ((uriptr = strchr(uri, '?')) == NULL)
|
||||
uriptr = uri + strlen(uri);
|
||||
|
||||
snprintf(uriptr, sizeof(uri) - (uriptr - uri),
|
||||
snprintf(uriptr, sizeof(uri) - (size_t)(uriptr - uri),
|
||||
"?baud=%s+bits=%s+parity=%s+flow=%s",
|
||||
cgiGetVariable("BAUDRATE"), cgiGetVariable("BITS"),
|
||||
cgiGetVariable("PARITY"), cgiGetVariable("FLOW"));
|
||||
@@ -1881,7 +1861,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
if ((end = strstr(start, "\n")) == NULL)
|
||||
end = start + strlen(start);
|
||||
|
||||
cupsFileWrite(temp, start, end - start);
|
||||
cupsFileWrite(temp, start, (size_t)(end - start));
|
||||
cupsFilePutChar(temp, '\n');
|
||||
|
||||
if (*end == '\r')
|
||||
@@ -2006,9 +1986,9 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
* Allocate memory and load the file into a string buffer...
|
||||
*/
|
||||
|
||||
if ((buffer = calloc(1, info.st_size + 1)) != NULL)
|
||||
if ((buffer = calloc(1, (size_t)info.st_size + 1)) != NULL)
|
||||
{
|
||||
cupsFileRead(cupsd, buffer, info.st_size);
|
||||
cupsFileRead(cupsd, buffer, (size_t)info.st_size);
|
||||
cgiSetVariable("CUPSDCONF", buffer);
|
||||
free(buffer);
|
||||
}
|
||||
@@ -2025,7 +2005,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
if (!stat(filename, &info) && info.st_size < (1024 * 1024) &&
|
||||
(cupsd = cupsFileOpen(filename, "r")) != NULL)
|
||||
{
|
||||
if ((buffer = calloc(1, 2 * info.st_size + 1)) != NULL)
|
||||
if ((buffer = calloc(1, 2 * (size_t)info.st_size + 1)) != NULL)
|
||||
{
|
||||
bufend = buffer + 2 * info.st_size - 1;
|
||||
|
||||
@@ -2035,7 +2015,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
if (ch == '\\' || ch == '\"')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = ch;
|
||||
*bufptr++ = (char)ch;
|
||||
}
|
||||
else if (ch == '\n')
|
||||
{
|
||||
@@ -2048,7 +2028,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
*bufptr++ = 't';
|
||||
}
|
||||
else if (ch >= ' ')
|
||||
*bufptr++ = ch;
|
||||
*bufptr++ = (char)ch;
|
||||
}
|
||||
|
||||
*bufptr = '\0';
|
||||
@@ -3882,7 +3862,7 @@ do_set_sharing(http_t *http) /* I - HTTP connection */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "printer-is-shared", atoi(shared));
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "printer-is-shared", (char)atoi(shared));
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
@@ -4096,7 +4076,7 @@ get_option_value(
|
||||
if ((val = cgiGetVariable(keyword)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
snprintf(bufptr, bufend - bufptr, "%s%s=", prefix, cparam->name);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr), "%s%s=", prefix, cparam->name);
|
||||
bufptr += strlen(bufptr);
|
||||
prefix = " ";
|
||||
|
||||
@@ -4110,7 +4090,7 @@ get_option_value(
|
||||
number > cparam->maximum.custom_real)
|
||||
return (NULL);
|
||||
|
||||
snprintf(bufptr, bufend - bufptr, "%g", number);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr), "%g", number);
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_INT :
|
||||
@@ -4120,7 +4100,7 @@ get_option_value(
|
||||
integer > cparam->maximum.custom_int)
|
||||
return (NULL);
|
||||
|
||||
snprintf(bufptr, bufend - bufptr, "%ld", integer);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr), "%ld", integer);
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_POINTS :
|
||||
@@ -4138,7 +4118,7 @@ get_option_value(
|
||||
number_points > cparam->maximum.custom_points)
|
||||
return (NULL);
|
||||
|
||||
snprintf(bufptr, bufend - bufptr, "%g%s", number, uval);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr), "%g%s", number, uval);
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_PASSCODE :
|
||||
@@ -4218,5 +4198,5 @@ get_points(double number, /* I - Original number */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: admin.c 11345 2013-10-18 21:14:52Z msweet $".
|
||||
* End of "$Id: admin.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+15
-23
@@ -1,23 +1,16 @@
|
||||
/*
|
||||
* "$Id: classes.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: classes.c 11928 2014-06-13 00:08:32Z msweet $"
|
||||
*
|
||||
* Class status CGI for CUPS.
|
||||
* Class status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Main entry for CGI.
|
||||
* do_class_op() - Do a class operation.
|
||||
* show_all_classes() - Show all classes...
|
||||
* show_class() - Show a single class.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -42,8 +35,7 @@ static void show_class(http_t *http, const char *printer);
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
main(void)
|
||||
{
|
||||
const char *pclass; /* Class name */
|
||||
const char *user; /* Username */
|
||||
@@ -169,8 +161,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
do_class_op(http, pclass, CUPS_ACCEPT_JOBS, cgiText(_("Accept Jobs")));
|
||||
else if (!strcmp(op, "reject-jobs"))
|
||||
do_class_op(http, pclass, CUPS_REJECT_JOBS, cgiText(_("Reject Jobs")));
|
||||
else if (!strcmp(op, "purge-jobs"))
|
||||
do_class_op(http, pclass, IPP_PURGE_JOBS, cgiText(_("Purge Jobs")));
|
||||
else if (!strcmp(op, "cancel-jobs"))
|
||||
do_class_op(http, pclass, IPP_OP_CANCEL_JOBS, cgiText(_("Cancel Jobs")));
|
||||
else if (!_cups_strcasecmp(op, "print-test-page"))
|
||||
cgiPrintTestPage(http, pclass);
|
||||
else if (!_cups_strcasecmp(op, "move-jobs"))
|
||||
@@ -286,8 +278,8 @@ do_class_op(http_t *http, /* I - HTTP connection */
|
||||
cgiCopyTemplateLang("printer-accept.tmpl");
|
||||
else if (op == CUPS_REJECT_JOBS)
|
||||
cgiCopyTemplateLang("printer-reject.tmpl");
|
||||
else if (op == IPP_PURGE_JOBS)
|
||||
cgiCopyTemplateLang("printer-purge.tmpl");
|
||||
else if (op == IPP_OP_CANCEL_JOBS)
|
||||
cgiCopyTemplateLang("printer-cancel-jobs.tmpl");
|
||||
}
|
||||
|
||||
cgiEndHTML();
|
||||
@@ -554,5 +546,5 @@ show_class(http_t *http, /* I - Connection to server */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: classes.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: classes.c 11928 2014-06-13 00:08:32Z msweet $".
|
||||
*/
|
||||
|
||||
+16
-34
@@ -1,34 +1,16 @@
|
||||
/*
|
||||
* "$Id: help-index.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: help-index.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* Online help index routines for CUPS.
|
||||
* Online help index routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* helpDeleteIndex() - Delete an index, freeing all memory used.
|
||||
* helpFindNode() - Find a node in an index.
|
||||
* helpLoadIndex() - Load a help index from disk.
|
||||
* helpSaveIndex() - Save a help index to disk.
|
||||
* helpSearchIndex() - Search an index.
|
||||
* help_add_word() - Add a word to a node.
|
||||
* help_compile_search() - Convert a search string into a regular expression.
|
||||
* help_delete_node() - Free all memory used by a node.
|
||||
* help_delete_word() - Free all memory used by a word.
|
||||
* help_load_directory() - Load a directory of files into an index.
|
||||
* help_load_file() - Load a HTML files into an index.
|
||||
* help_new_node() - Create a new node and add it to an index.
|
||||
* help_sort_nodes_by_name() - Sort nodes by section, filename, and anchor.
|
||||
* help_sort_nodes_by_score() - Sort nodes by score and text.
|
||||
* help_sort_words() - Sort words alphabetically.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -346,7 +328,7 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
mtime = strtol(ptr, &ptr, 10);
|
||||
|
||||
offset = strtoll(ptr, &ptr, 10);
|
||||
length = strtoll(ptr, &ptr, 10);
|
||||
length = (size_t)strtoll(ptr, &ptr, 10);
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
@@ -1019,14 +1001,14 @@ help_load_file(
|
||||
|
||||
*ptr++ = ' ';
|
||||
|
||||
if (!cupsFileGets(fp, ptr, sizeof(line) - (ptr - line) - 1))
|
||||
if (!cupsFileGets(fp, ptr, sizeof(line) - (size_t)(ptr - line) - 1))
|
||||
break;
|
||||
}
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
if (node)
|
||||
node->length = offset - node->offset;
|
||||
node->length = (size_t)(offset - node->offset);
|
||||
|
||||
if (!*text)
|
||||
{
|
||||
@@ -1179,9 +1161,9 @@ help_load_file(
|
||||
|
||||
for (text = ptr, ptr ++; *ptr && isalnum(*ptr & 255); ptr ++);
|
||||
|
||||
wordlen = ptr - text;
|
||||
wordlen = (int)(ptr - text);
|
||||
|
||||
memcpy(temp, text, wordlen);
|
||||
memcpy(temp, text, (size_t)wordlen);
|
||||
temp[wordlen] = '\0';
|
||||
|
||||
ptr --;
|
||||
@@ -1206,7 +1188,7 @@ help_load_file(
|
||||
cupsFileClose(fp);
|
||||
|
||||
if (node)
|
||||
node->length = offset - node->offset;
|
||||
node->length = (size_t)(offset - node->offset);
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -1324,5 +1306,5 @@ help_sort_words(help_word_t *w1, /* I - Second word */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: help-index.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: help-index.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+28
-56
@@ -1,31 +1,16 @@
|
||||
/*
|
||||
* "$Id: ipp-var.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: ipp-var.c 11889 2014-05-22 13:54:15Z msweet $"
|
||||
*
|
||||
* CGI <-> IPP variable routines for CUPS.
|
||||
* CGI <-> IPP variable routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cgiGetAttributes() - Get the list of attributes that are needed by the
|
||||
* template file.
|
||||
* cgiGetIPPObjects() - Get the objects in an IPP response.
|
||||
* cgiMoveJobs() - Move one or more jobs.
|
||||
* cgiPrintCommand() - Print a CUPS command job.
|
||||
* cgiPrintTestPage() - Print a test page.
|
||||
* cgiRewriteURL() - Rewrite a printer URI into a web browser URL...
|
||||
* cgiSetIPPObjectVars() - Set CGI variables from an IPP object.
|
||||
* cgiSetIPPVars() - Set CGI variables from an IPP response.
|
||||
* cgiShowIPPError() - Show the last IPP error message.
|
||||
* cgiShowJobs() - Show print jobs.
|
||||
* cgiText() - Return localized text.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -65,7 +50,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
|
||||
{
|
||||
for (i = 0; lang[i] && i < 15; i ++)
|
||||
if (isalnum(lang[i] & 255))
|
||||
locale[i] = tolower(lang[i]);
|
||||
locale[i] = (char)tolower(lang[i]);
|
||||
else
|
||||
locale[i] = '_';
|
||||
|
||||
@@ -107,7 +92,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
|
||||
while ((ch = getc(in)) != EOF)
|
||||
if (ch == '\\')
|
||||
getc(in);
|
||||
else if (ch == '{' && num_attrs < (sizeof(attrs) / sizeof(attrs[0])))
|
||||
else if (ch == '{' && num_attrs < (int)(sizeof(attrs) / sizeof(attrs[0])))
|
||||
{
|
||||
/*
|
||||
* Grab the name...
|
||||
@@ -123,7 +108,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
|
||||
if (ch == '_')
|
||||
*nameptr++ = '-';
|
||||
else
|
||||
*nameptr++ = ch;
|
||||
*nameptr++ = (char)ch;
|
||||
}
|
||||
|
||||
*nameptr = '\0';
|
||||
@@ -917,7 +902,7 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
|
||||
* Make URI relative to the current server...
|
||||
*/
|
||||
|
||||
strlcpy(url, resource, urlsize);
|
||||
strlcpy(url, resource, (size_t)urlsize);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -926,17 +911,13 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
|
||||
*/
|
||||
|
||||
if (userpass[0])
|
||||
snprintf(url, urlsize, "%s://%s@%s:%d%s",
|
||||
ishttps ? "https" : "http",
|
||||
userpass, hostname, port, resource);
|
||||
snprintf(url, (size_t)urlsize, "%s://%s@%s:%d%s", ishttps ? "https" : "http", userpass, hostname, port, resource);
|
||||
else
|
||||
snprintf(url, urlsize, "%s://%s:%d%s",
|
||||
ishttps ? "https" : "http",
|
||||
hostname, port, resource);
|
||||
snprintf(url, (size_t)urlsize, "%s://%s:%d%s", ishttps ? "https" : "http", hostname, port, resource);
|
||||
}
|
||||
}
|
||||
else
|
||||
strlcpy(url, uri, urlsize);
|
||||
strlcpy(url, uri, (size_t)urlsize);
|
||||
|
||||
return (url);
|
||||
}
|
||||
@@ -958,7 +939,6 @@ cgiSetIPPObjectVars(
|
||||
*nameptr, /* Pointer into name */
|
||||
value[16384], /* Value(s) */
|
||||
*valptr; /* Pointer into value */
|
||||
struct tm *date; /* Date information */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG2: cgiSetIPPObjectVars(obj=%p, prefix=\"%s\", "
|
||||
@@ -1039,7 +1019,7 @@ cgiSetIPPObjectVars(
|
||||
*valptr++ = ' ';
|
||||
}
|
||||
|
||||
remaining = sizeof(value) - (valptr - value);
|
||||
remaining = sizeof(value) - (size_t)(valptr - value);
|
||||
|
||||
if (!strcmp(attr->values[i].string.text, "printer-stopped"))
|
||||
strlcpy(valptr, _("Printer Paused"), remaining);
|
||||
@@ -1177,7 +1157,7 @@ cgiSetIPPObjectVars(
|
||||
for (i = 0; i < attr->num_values; i ++)
|
||||
{
|
||||
if (i)
|
||||
strlcat(valptr, ", ", sizeof(value) - (valptr - value));
|
||||
strlcat(valptr, ", ", sizeof(value) - (size_t)(valptr - value));
|
||||
|
||||
valptr += strlen(valptr);
|
||||
|
||||
@@ -1186,36 +1166,28 @@ cgiSetIPPObjectVars(
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
if (strncmp(name, "time_at_", 8) == 0)
|
||||
{
|
||||
time_t t; /* Temporary time value */
|
||||
|
||||
t = (time_t)attr->values[i].integer;
|
||||
date = localtime(&t);
|
||||
|
||||
strftime(valptr, sizeof(value) - (valptr - value), "%c", date);
|
||||
}
|
||||
_cupsStrDate(valptr, sizeof(value) - (size_t)(valptr - value), (time_t)ippGetInteger(attr, i));
|
||||
else
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
"%d", attr->values[i].integer);
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value), "%d", ippGetInteger(attr, i));
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
|
||||
"%d", attr->values[i].boolean);
|
||||
break;
|
||||
|
||||
case IPP_TAG_NOVALUE :
|
||||
strlcat(valptr, "novalue", sizeof(value) - (valptr - value));
|
||||
strlcat(valptr, "novalue", sizeof(value) - (size_t)(valptr - value));
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
|
||||
"%d-%d", attr->values[i].range.lower,
|
||||
attr->values[i].range.upper);
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
|
||||
"%dx%d%s", attr->values[i].resolution.xres,
|
||||
attr->values[i].resolution.yres,
|
||||
attr->values[i].resolution.units == IPP_RES_PER_INCH ?
|
||||
@@ -1238,13 +1210,13 @@ cgiSetIPPObjectVars(
|
||||
cgiRewriteURL(attr->values[i].string.text, url,
|
||||
sizeof(url), NULL);
|
||||
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
|
||||
"<A HREF=\"%s\">%s</A>", url,
|
||||
strrchr(attr->values[i].string.text, '/') + 1);
|
||||
}
|
||||
else
|
||||
cgiRewriteURL(attr->values[i].string.text, valptr,
|
||||
sizeof(value) - (valptr - value), NULL);
|
||||
(int)(sizeof(value) - (size_t)(valptr - value)), NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1256,7 +1228,7 @@ cgiSetIPPObjectVars(
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
strlcat(valptr, attr->values[i].string.text,
|
||||
sizeof(value) - (valptr - value));
|
||||
sizeof(value) - (size_t)(valptr - value));
|
||||
break;
|
||||
|
||||
case IPP_TAG_BEGIN_COLLECTION :
|
||||
@@ -1589,5 +1561,5 @@ cgiText(const char *message) /* I - Message */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp-var.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: ipp-var.c 11889 2014-05-22 13:54:15Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-17
@@ -1,21 +1,16 @@
|
||||
/*
|
||||
* "$Id: jobs.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: jobs.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Job status CGI for CUPS.
|
||||
* Job status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Main entry for CGI.
|
||||
* do_job_op() - Do a job operation.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -37,8 +32,7 @@ static void do_job_op(http_t *http, int job_id, ipp_op_t op);
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
main(void)
|
||||
{
|
||||
http_t *http; /* Connection to the server */
|
||||
const char *op; /* Operation name */
|
||||
@@ -210,5 +204,5 @@ do_job_op(http_t *http, /* I - HTTP connection */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: jobs.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: jobs.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+15
-23
@@ -1,23 +1,16 @@
|
||||
/*
|
||||
* "$Id: printers.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: printers.c 11928 2014-06-13 00:08:32Z msweet $"
|
||||
*
|
||||
* Printer status CGI for CUPS.
|
||||
* Printer status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Main entry for CGI.
|
||||
* do_printer_op() - Do a printer operation.
|
||||
* show_all_printers() - Show all printers...
|
||||
* show_printer() - Show a single printer.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -43,8 +36,7 @@ static void show_printer(http_t *http, const char *printer);
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
main(void)
|
||||
{
|
||||
const char *printer; /* Printer name */
|
||||
const char *user; /* Username */
|
||||
@@ -172,8 +164,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
do_printer_op(http, printer, CUPS_ACCEPT_JOBS, cgiText(_("Accept Jobs")));
|
||||
else if (!strcmp(op, "reject-jobs"))
|
||||
do_printer_op(http, printer, CUPS_REJECT_JOBS, cgiText(_("Reject Jobs")));
|
||||
else if (!strcmp(op, "purge-jobs"))
|
||||
do_printer_op(http, printer, IPP_PURGE_JOBS, cgiText(_("Purge Jobs")));
|
||||
else if (!strcmp(op, "cancel-jobs"))
|
||||
do_printer_op(http, printer, IPP_OP_CANCEL_JOBS, cgiText(_("Cancel Jobs")));
|
||||
else if (!_cups_strcasecmp(op, "print-self-test-page"))
|
||||
cgiPrintCommand(http, printer, "PrintSelfTestPage",
|
||||
cgiText(_("Print Self-Test Page")));
|
||||
@@ -293,8 +285,8 @@ do_printer_op(http_t *http, /* I - HTTP connection */
|
||||
cgiCopyTemplateLang("printer-accept.tmpl");
|
||||
else if (op == CUPS_REJECT_JOBS)
|
||||
cgiCopyTemplateLang("printer-reject.tmpl");
|
||||
else if (op == IPP_PURGE_JOBS)
|
||||
cgiCopyTemplateLang("printer-purge.tmpl");
|
||||
else if (op == IPP_OP_CANCEL_JOBS)
|
||||
cgiCopyTemplateLang("printer-cancel-jobs.tmpl");
|
||||
}
|
||||
|
||||
cgiEndHTML();
|
||||
@@ -574,5 +566,5 @@ show_printer(http_t *http, /* I - Connection to server */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: printers.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: printers.c 11928 2014-06-13 00:08:32Z msweet $".
|
||||
*/
|
||||
|
||||
+14
-20
@@ -1,22 +1,16 @@
|
||||
/*
|
||||
* "$Id: search.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: search.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Search routines for CUPS.
|
||||
* Search routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cgiCompileSearch() - Compile a search string.
|
||||
* cgiDoSearch() - Do a search of some text.
|
||||
* cgiFreeSearch() - Free a compiled search context.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -38,12 +32,12 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
char *s, /* Regular expression string */
|
||||
*sptr, /* Pointer into RE string */
|
||||
*sword; /* Pointer to start of word */
|
||||
int slen; /* Allocated size of RE string */
|
||||
size_t slen; /* Allocated size of RE string */
|
||||
const char *qptr, /* Pointer into query string */
|
||||
*qend; /* End of current word */
|
||||
const char *prefix; /* Prefix to add to next word */
|
||||
int quoted; /* Word is quoted */
|
||||
int wlen; /* Word length */
|
||||
size_t wlen; /* Word length */
|
||||
char *lword; /* Last word in query */
|
||||
|
||||
|
||||
@@ -139,7 +133,7 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
for (qend = qptr + 1; *qend && !isspace(*qend); qend ++);
|
||||
}
|
||||
|
||||
wlen = qend - qptr;
|
||||
wlen = (size_t)(qend - qptr);
|
||||
|
||||
/*
|
||||
* Look for logic words: AND, OR
|
||||
@@ -174,7 +168,7 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
* string + RE overhead...
|
||||
*/
|
||||
|
||||
wlen = (sptr - s) + 2 * 4 * wlen + 2 * strlen(prefix) + 11;
|
||||
wlen = (size_t)(sptr - s) + 2 * 4 * wlen + 2 * strlen(prefix) + 11;
|
||||
if (lword)
|
||||
wlen += strlen(lword);
|
||||
|
||||
@@ -377,5 +371,5 @@ cgiFreeSearch(void *search) /* I - Search context */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: search.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: search.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+19
-30
@@ -1,27 +1,16 @@
|
||||
/*
|
||||
* "$Id: template.c 11688 2014-03-05 21:11:32Z msweet $"
|
||||
* "$Id: template.c 11685 2014-03-05 20:03:29Z msweet $"
|
||||
*
|
||||
* CGI template function.
|
||||
* CGI template function.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cgiCopyTemplateFile() - Copy a template file and replace all the
|
||||
* '{variable}' strings with the variable value.
|
||||
* cgiCopyTemplateLang() - Copy a template file using a language...
|
||||
* cgiGetTemplateDir() - Get the templates directory...
|
||||
* cgiSetServerVersion() - Set the server name and CUPS version...
|
||||
* cgi_copy() - Copy the template file, substituting as needed...
|
||||
* cgi_puts() - Put a string to the output file, quoting as
|
||||
* needed...
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#include "cgi-private.h"
|
||||
@@ -266,7 +255,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
else if (s > name && ch == '?')
|
||||
break;
|
||||
else if (s < (name + sizeof(name) - 1))
|
||||
*s++ = ch;
|
||||
*s++ = (char)ch;
|
||||
|
||||
*s = '\0';
|
||||
|
||||
@@ -443,7 +432,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
* {name~refex?true:false} Regex match
|
||||
*/
|
||||
|
||||
op = ch;
|
||||
op = (char)ch;
|
||||
|
||||
if (ch == '?')
|
||||
{
|
||||
@@ -486,7 +475,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
innerptr = innername;
|
||||
while ((ch = getc(in)) != EOF && ch != '}')
|
||||
if (innerptr < (innername + sizeof(innername) - 1))
|
||||
*innerptr++ = ch;
|
||||
*innerptr++ = (char)ch;
|
||||
*innerptr = '\0';
|
||||
|
||||
if (innername[0] == '#')
|
||||
@@ -498,26 +487,26 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
if ((innerval = cgiGetArray(innername, atoi(innerptr) - 1)) == NULL)
|
||||
*s = '\0';
|
||||
else
|
||||
strlcpy(s, innerval, sizeof(compare) - (s - compare));
|
||||
strlcpy(s, innerval, sizeof(compare) - (size_t)(s - compare));
|
||||
}
|
||||
else if (innername[0] == '?')
|
||||
{
|
||||
if ((innerval = cgiGetArray(innername + 1, element)) == NULL)
|
||||
*s = '\0';
|
||||
else
|
||||
strlcpy(s, innerval, sizeof(compare) - (s - compare));
|
||||
strlcpy(s, innerval, sizeof(compare) - (size_t)(s - compare));
|
||||
}
|
||||
else if ((innerval = cgiGetArray(innername, element)) == NULL)
|
||||
snprintf(s, sizeof(compare) - (s - compare), "{%s}", innername);
|
||||
snprintf(s, sizeof(compare) - (size_t)(s - compare), "{%s}", innername);
|
||||
else
|
||||
strlcpy(s, innerval, sizeof(compare) - (s - compare));
|
||||
strlcpy(s, innerval, sizeof(compare) - (size_t)(s - compare));
|
||||
|
||||
s += strlen(s);
|
||||
}
|
||||
else if (ch == '\\')
|
||||
*s++ = getc(in);
|
||||
*s++ = (char)getc(in);
|
||||
else
|
||||
*s++ = ch;
|
||||
*s++ = (char)ch;
|
||||
|
||||
*s = '\0';
|
||||
|
||||
@@ -729,5 +718,5 @@ cgi_puturi(const char *s, /* I - String to output */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: template.c 11688 2014-03-05 21:11:32Z msweet $".
|
||||
* End of "$Id: template.c 11685 2014-03-05 20:03:29Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-17
@@ -1,21 +1,16 @@
|
||||
/*
|
||||
* "$Id: testcgi.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: testcgi.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* CGI test program for CUPS.
|
||||
* CGI test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Test the help index code.
|
||||
* list_nodes() - List nodes in an array...
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -30,8 +25,7 @@
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
main(void)
|
||||
{
|
||||
/*
|
||||
* Test file upload/multi-part submissions...
|
||||
@@ -71,5 +65,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testcgi.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: testcgi.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+41
-70
@@ -1,49 +1,20 @@
|
||||
/*
|
||||
* "$Id: var.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: var.c 12034 2014-07-16 19:37:34Z msweet $"
|
||||
*
|
||||
* CGI form variable and array functions for CUPS.
|
||||
* CGI form variable and array functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cgiCheckVariables() - Check for the presence of "required"
|
||||
* variables.
|
||||
* cgiClearVariables() - Clear all form variables.
|
||||
* cgiGetArray() - Get an element from a form array.
|
||||
* cgiGetCookie() - Get a cookie value.
|
||||
* cgiGetFile() - Get the file (if any) that was submitted in
|
||||
* the form.
|
||||
* cgiGetSize() - Get the size of a form array value.
|
||||
* cgiGetVariable() - Get a CGI variable from the database.
|
||||
* cgiInitialize() - Initialize the CGI variable "database".
|
||||
* cgiIsPOST() - Determine whether this page was POSTed.
|
||||
* cgiSetArray() - Set array element N to the specified string.
|
||||
* cgiSetCookie() - Set a cookie value.
|
||||
* cgiSetSize() - Set the array size.
|
||||
* cgiSetVariable() - Set a CGI variable in the database.
|
||||
* cgi_add_variable() - Add a form variable.
|
||||
* cgi_compare_variables() - Compare two variables.
|
||||
* cgi_find_variable() - Find a variable.
|
||||
* cgi_initialize_cookies() - Initialize cookies.
|
||||
* cgi_initialize_get() - Initialize form variables using the GET
|
||||
* method.
|
||||
* cgi_initialize_multipart() - Initialize variables and file using the POST
|
||||
* method.
|
||||
* cgi_initialize_post() - Initialize variables using the POST method.
|
||||
* cgi_initialize_string() - Initialize form variables from a string.
|
||||
* cgi_passwd() - Catch authentication requests and notify the
|
||||
* server.
|
||||
* cgi_set_sid() - Set the CUPS session ID.
|
||||
* cgi_sort_variables() - Sort all form variables for faster lookup.
|
||||
* cgi_unlink_file() - Remove the uploaded form.
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
/*#define DEBUG*/
|
||||
@@ -417,7 +388,7 @@ cgiSetArray(const char *name, /* I - Name of variable */
|
||||
const char **temp; /* Temporary pointer */
|
||||
|
||||
temp = (const char **)realloc((void *)(var->values),
|
||||
sizeof(char *) * (element + 16));
|
||||
sizeof(char *) * (size_t)(element + 16));
|
||||
if (!temp)
|
||||
return;
|
||||
|
||||
@@ -466,9 +437,9 @@ cgiSetCookie(const char *name, /* I - Name */
|
||||
printf(" expires=%s;", httpGetDateString2(expires, date, sizeof(date)));
|
||||
}
|
||||
if (secure)
|
||||
puts(" secure;");
|
||||
puts(" httponly; secure;");
|
||||
else
|
||||
putchar('\n');
|
||||
puts(" httponly;");
|
||||
}
|
||||
|
||||
|
||||
@@ -495,7 +466,7 @@ cgiSetSize(const char *name, /* I - Name of variable */
|
||||
const char **temp; /* Temporary pointer */
|
||||
|
||||
temp = (const char **)realloc((void *)(var->values),
|
||||
sizeof(char *) * (size + 16));
|
||||
sizeof(char *) * (size_t)(size + 16));
|
||||
if (!temp)
|
||||
return;
|
||||
|
||||
@@ -581,7 +552,7 @@ cgi_add_variable(const char *name, /* I - Variable name */
|
||||
if (form_alloc == 0)
|
||||
temp_vars = malloc(sizeof(_cgi_var_t) * 16);
|
||||
else
|
||||
temp_vars = realloc(form_vars, (form_alloc + 16) * sizeof(_cgi_var_t));
|
||||
temp_vars = realloc(form_vars, (size_t)(form_alloc + 16) * sizeof(_cgi_var_t));
|
||||
|
||||
if (!temp_vars)
|
||||
return;
|
||||
@@ -592,7 +563,7 @@ cgi_add_variable(const char *name, /* I - Variable name */
|
||||
|
||||
var = form_vars + form_count;
|
||||
|
||||
if ((var->values = calloc(element + 1, sizeof(char *))) == NULL)
|
||||
if ((var->values = calloc((size_t)element + 1, sizeof(char *))) == NULL)
|
||||
return;
|
||||
|
||||
var->name = _cupsStrAlloc(name);
|
||||
@@ -632,7 +603,7 @@ cgi_find_variable(const char *name) /* I - Name of variable */
|
||||
|
||||
key.name = name;
|
||||
|
||||
return ((_cgi_var_t *)bsearch(&key, form_vars, form_count, sizeof(_cgi_var_t),
|
||||
return ((_cgi_var_t *)bsearch(&key, form_vars, (size_t)form_count, sizeof(_cgi_var_t),
|
||||
(int (*)(const void *, const void *))cgi_compare_variables));
|
||||
}
|
||||
|
||||
@@ -769,8 +740,8 @@ cgi_initialize_multipart(
|
||||
*ptr, /* Pointer into name/filename */
|
||||
*end; /* End of buffer */
|
||||
int ch, /* Character from file */
|
||||
fd, /* Temporary file descriptor */
|
||||
blen; /* Length of boundary string */
|
||||
fd; /* Temporary file descriptor */
|
||||
size_t blen; /* Length of boundary string */
|
||||
|
||||
|
||||
DEBUG_printf(("cgi_initialize_multipart(boundary=\"%s\")\n", boundary));
|
||||
@@ -835,22 +806,22 @@ cgi_initialize_multipart(
|
||||
|
||||
while ((ch = getchar()) != EOF)
|
||||
{
|
||||
*ptr++ = ch;
|
||||
*ptr++ = (char)ch;
|
||||
|
||||
if ((ptr - line) >= blen && !memcmp(ptr - blen, bstring, blen))
|
||||
if ((size_t)(ptr - line) >= blen && !memcmp(ptr - blen, bstring, blen))
|
||||
{
|
||||
ptr -= blen;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((ptr - line - blen) >= 8192)
|
||||
if ((ptr - line - (int)blen) >= 8192)
|
||||
{
|
||||
/*
|
||||
* Write out the first 8k of the buffer...
|
||||
*/
|
||||
|
||||
write(fd, line, 8192);
|
||||
memmove(line, line + 8192, ptr - line - 8192);
|
||||
memmove(line, line + 8192, (size_t)(ptr - line - 8192));
|
||||
ptr -= 8192;
|
||||
}
|
||||
}
|
||||
@@ -860,7 +831,7 @@ cgi_initialize_multipart(
|
||||
*/
|
||||
|
||||
if (ptr > line)
|
||||
write(fd, line, ptr - line);
|
||||
write(fd, line, (size_t)(ptr - line));
|
||||
|
||||
close(fd);
|
||||
}
|
||||
@@ -877,9 +848,9 @@ cgi_initialize_multipart(
|
||||
while ((ch = getchar()) != EOF)
|
||||
{
|
||||
if (ptr < end)
|
||||
*ptr++ = ch;
|
||||
*ptr++ = (char)ch;
|
||||
|
||||
if ((ptr - line) >= blen && !memcmp(ptr - blen, bstring, blen))
|
||||
if ((size_t)(ptr - line) >= blen && !memcmp(ptr - blen, bstring, blen))
|
||||
{
|
||||
ptr -= blen;
|
||||
break;
|
||||
@@ -979,12 +950,12 @@ cgi_initialize_multipart(
|
||||
static int /* O - 1 if form data was read */
|
||||
cgi_initialize_post(void)
|
||||
{
|
||||
char *content_length, /* Length of input data (string) */
|
||||
*data; /* Pointer to form data string */
|
||||
int length, /* Length of input data */
|
||||
nbytes, /* Number of bytes read this read() */
|
||||
tbytes, /* Total number of bytes read */
|
||||
status; /* Return status */
|
||||
char *content_length, /* Length of input data (string) */
|
||||
*data; /* Pointer to form data string */
|
||||
size_t length, /* Length of input data */
|
||||
tbytes; /* Total number of bytes read */
|
||||
ssize_t nbytes; /* Number of bytes read this read() */
|
||||
int status; /* Return status */
|
||||
|
||||
|
||||
DEBUG_puts("cgi_initialize_post: Initializing variables using POST method...");
|
||||
@@ -1001,7 +972,7 @@ cgi_initialize_post(void)
|
||||
* Get the length of the input stream and allocate a buffer for it...
|
||||
*/
|
||||
|
||||
length = atoi(content_length);
|
||||
length = (size_t)strtol(content_length, NULL, 10);
|
||||
data = malloc(length + 1);
|
||||
|
||||
if (data == NULL)
|
||||
@@ -1011,8 +982,8 @@ cgi_initialize_post(void)
|
||||
* Read the data into the buffer...
|
||||
*/
|
||||
|
||||
for (tbytes = 0; tbytes < length; tbytes += nbytes)
|
||||
if ((nbytes = read(0, data + tbytes, length - tbytes)) < 0)
|
||||
for (tbytes = 0; tbytes < length; tbytes += (size_t)nbytes)
|
||||
if ((nbytes = read(0, data + tbytes, (size_t)(length - tbytes))) < 0)
|
||||
{
|
||||
if (errno != EAGAIN)
|
||||
{
|
||||
@@ -1126,7 +1097,7 @@ cgi_initialize_string(const char *data) /* I - Form data string */
|
||||
ch = *data - '0';
|
||||
if (ch > 9)
|
||||
ch -= 7;
|
||||
*s = ch << 4;
|
||||
*s = (char)(ch << 4);
|
||||
|
||||
data ++;
|
||||
ch = *data - '0';
|
||||
@@ -1264,7 +1235,7 @@ cgi_sort_variables(void)
|
||||
if (form_count < 2)
|
||||
return;
|
||||
|
||||
qsort(form_vars, form_count, sizeof(_cgi_var_t),
|
||||
qsort(form_vars, (size_t)form_count, sizeof(_cgi_var_t),
|
||||
(int (*)(const void *, const void *))cgi_compare_variables);
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -1307,5 +1278,5 @@ cgi_unlink_file(void)
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: var.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: var.c 12034 2014-07-16 19:37:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* "$Id: websearch.c 1531 2009-05-22 21:50:50Z msweet $"
|
||||
*
|
||||
* Web search program for www.cups.org.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* websearch directory "search string"
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Search a directory of help files.
|
||||
* list_nodes() - List matching nodes.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cgi.h"
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void list_nodes(help_index_t *hi, const char *title,
|
||||
cups_array_t *nodes);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Test the help index code.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line args */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
help_index_t *hi, /* Help index */
|
||||
*search; /* Search index */
|
||||
char indexname[1024]; /* Name of index file */
|
||||
|
||||
|
||||
if (argc != 3)
|
||||
{
|
||||
puts("Usage: websearch directory \"search terms\"");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the help index...
|
||||
*/
|
||||
|
||||
snprintf(indexname, sizeof(indexname), "%s/.index", argv[1]);
|
||||
hi = helpLoadIndex(indexname, argv[1]);
|
||||
|
||||
/*
|
||||
* Do any searches...
|
||||
*/
|
||||
|
||||
search = helpSearchIndex(hi, argv[2], NULL, NULL);
|
||||
|
||||
if (search)
|
||||
list_nodes(hi, argv[1], search->sorted);
|
||||
|
||||
/*
|
||||
* Return with no errors...
|
||||
*/
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'list_nodes()' - List nodes in an array...
|
||||
*/
|
||||
|
||||
static void
|
||||
list_nodes(help_index_t *hi, /* I - Help index */
|
||||
const char *title, /* I - Title string */
|
||||
cups_array_t *nodes) /* I - Nodes */
|
||||
{
|
||||
help_node_t *node, /* Current node */
|
||||
*file; /* File node */
|
||||
|
||||
|
||||
printf("%d\n", cupsArrayCount(nodes));
|
||||
for (node = (help_node_t *)cupsArrayFirst(nodes);
|
||||
node;
|
||||
node = (help_node_t *)cupsArrayNext(nodes))
|
||||
{
|
||||
if (node->anchor)
|
||||
{
|
||||
file = helpFindNode(hi, node->filename, NULL);
|
||||
printf("%d|%s#%s|%s|%s\n", node->score, node->filename, node->anchor,
|
||||
node->text, file ? file->text : node->filename);
|
||||
}
|
||||
else
|
||||
printf("%d|%s|%s|%s\n", node->score, node->filename, node->text,
|
||||
node->text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: websearch.c 1531 2009-05-22 21:50:50Z msweet $".
|
||||
*/
|
||||
@@ -1,7 +1,5 @@
|
||||
#
|
||||
# "$Id: cups-files.conf.in 11201 2013-07-26 21:27:27Z msweet $"
|
||||
#
|
||||
# Sample file/directory/user/group configuration file for the CUPS scheduler.
|
||||
# File/directory/user/group configuration file for the CUPS scheduler.
|
||||
# See "man cups-files.conf" for a complete description of this file.
|
||||
#
|
||||
|
||||
@@ -95,7 +93,3 @@ PageLog @CUPS_LOGDIR@/page_log
|
||||
# scheduler startup and cannot be one of the standard (public) temporary
|
||||
# directory locations for security reasons...
|
||||
#TempDir @CUPS_REQUESTS@/tmp
|
||||
|
||||
#
|
||||
# End of "$Id: cups-files.conf.in 11201 2013-07-26 21:27:27Z msweet $".
|
||||
#
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#
|
||||
# "$Id: cupsd.conf.in 11025 2013-06-07 01:00:33Z msweet $"
|
||||
#
|
||||
# Sample configuration file for the CUPS scheduler. See "man cupsd.conf" for a
|
||||
# Configuration file for the CUPS scheduler. See "man cupsd.conf" for a
|
||||
# complete description of this file.
|
||||
#
|
||||
|
||||
# Log general information in error_log - change "@CUPS_LOG_LEVEL@" to "debug"
|
||||
# for troubleshooting...
|
||||
LogLevel @CUPS_LOG_LEVEL@
|
||||
@CUPS_PAGE_LOG_FORMAT@
|
||||
|
||||
# Only listen for connections from the local machine.
|
||||
Listen localhost:@DEFAULT_IPP_PORT@
|
||||
@@ -128,7 +127,3 @@ WebInterface @CUPS_WEBIF@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
||||
|
||||
#
|
||||
# End of "$Id: cupsd.conf.in 11025 2013-06-07 01:00:33Z msweet $".
|
||||
#
|
||||
|
||||
+16
-15
@@ -1,20 +1,20 @@
|
||||
#
|
||||
# "$Id: mime.types 7670 2008-06-17 22:42:08Z mike $"
|
||||
#
|
||||
# Base MIME types file for CUPS.
|
||||
# Base MIME types file for CUPS.
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
########################################################################
|
||||
@@ -37,6 +37,7 @@
|
||||
# 100=default, 200=highest)
|
||||
# printable(offset,length) True if bytes are printable 8-bit chars
|
||||
# (CR, NL, TAB, BS, 32-126, 128-254)
|
||||
# regex(offset,"regex") True if bytes match regular expression
|
||||
# string(offset,"string") True if bytes are identical to string
|
||||
# istring(offset,"string") True if bytes are identical to
|
||||
# case-insensitive string
|
||||
@@ -70,7 +71,7 @@
|
||||
#
|
||||
|
||||
#application/msword doc string(0,<D0CF11E0A1B11AE1>)
|
||||
application/pdf pdf string(0,%PDF)
|
||||
application/pdf pdf regex(0,^[\\n\\r]*%PDF)
|
||||
application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
contains(0,128,<1B>%-12345X) + \
|
||||
(contains(0,4096,"LANGUAGE=POSTSCRIPT") \
|
||||
@@ -92,7 +93,7 @@ image/jpeg jpeg jpg jpe string(0,<FFD8FF>) +\
|
||||
char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\
|
||||
char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\
|
||||
char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef))
|
||||
image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(100)
|
||||
image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(150)
|
||||
image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
|
||||
image/x-photocd pcd string(2048,PCD_IPI)
|
||||
image/x-portable-anymap pnm
|
||||
@@ -123,7 +124,7 @@ application/x-shell sh printable(0,1024) + string(0,#!) +\
|
||||
(contains(2,80,/bash) contains(2,80,/ksh)\
|
||||
contains(2,80,/sh) contains(2,80,/zsh))
|
||||
application/x-csource c cxx cpp cc C h hpp \
|
||||
printable(0,1024) + \
|
||||
printable(0,1024) + ! css + \
|
||||
(string(0,/*) string(0,//)
|
||||
string(0,#include) contains(0,1024,<0a>#include) \
|
||||
string(0,#define) contains(0,1024,<0a>#define))
|
||||
@@ -152,7 +153,7 @@ application/vnd.cups-pdf
|
||||
application/vnd.cups-postscript
|
||||
application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
|
||||
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR") \
|
||||
string(0,"RaS2") string(0,"2SaR") \
|
||||
(string(0,"RaS2") + !string(4,PwgRaster<00>)) string(0,"2SaR") \
|
||||
string(0,"RaS3") string(0,"3SaR")
|
||||
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
string(0,<1B>@) \
|
||||
|
||||
+2
-8
@@ -1,13 +1,7 @@
|
||||
#
|
||||
# "$Id: snmp.conf.in 11025 2013-06-07 01:00:33Z msweet $"
|
||||
#
|
||||
# Sample SNMP configuration file for CUPS. See "man cups-snmp.conf" for a
|
||||
# complete description of this file.
|
||||
# SNMP configuration file for CUPS. See "man cups-snmp.conf" for a complete
|
||||
# description of this file.
|
||||
#
|
||||
|
||||
@CUPS_SNMP_ADDRESS@
|
||||
@CUPS_SNMP_COMMUNITY@
|
||||
|
||||
#
|
||||
# End of "$Id: snmp.conf.in 11025 2013-06-07 01:00:33Z msweet $".
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 8781 2009-08-28 17:34:54Z mike $"
|
||||
dnl "$Id: cups-common.m4 12073 2014-07-31 00:58:00Z msweet $"
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl
|
||||
@@ -20,7 +20,7 @@ dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION=1.7.2
|
||||
CUPS_VERSION=2.0b1
|
||||
CUPS_REVISION=
|
||||
#if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
@@ -89,7 +89,7 @@ fi
|
||||
AC_SUBST(INSTALLSTATIC)
|
||||
|
||||
dnl Check for pkg-config, which is used for some other tests later on...
|
||||
AC_PATH_PROG(PKGCONFIG, pkg-config)
|
||||
AC_PATH_TOOL(PKGCONFIG, pkg-config)
|
||||
|
||||
dnl Check for libraries...
|
||||
AC_SEARCH_LIBS(abs, m, AC_DEFINE(HAVE_ABS))
|
||||
@@ -134,11 +134,9 @@ AC_CHECK_HEADER(stdint.h,AC_DEFINE(HAVE_STDINT_H))
|
||||
AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
|
||||
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
|
||||
AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
|
||||
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
|
||||
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
|
||||
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
|
||||
AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
|
||||
AC_CHECK_HEADER(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
|
||||
|
||||
dnl Checks for iconv.h and iconv_open
|
||||
AC_CHECK_HEADER(iconv.h,
|
||||
@@ -202,6 +200,9 @@ AC_CHECK_FUNCS(sigaction)
|
||||
dnl Checks for wait functions.
|
||||
AC_CHECK_FUNCS(waitpid wait3)
|
||||
|
||||
dnl Check for posix_spawn
|
||||
AC_CHECK_FUNCS(posix_spawn)
|
||||
|
||||
dnl See if the tm structure has the tm_gmtoff member...
|
||||
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
|
||||
AC_TRY_COMPILE([#include <time.h>],[struct tm t;
|
||||
@@ -230,7 +231,7 @@ AC_SUBST(LIBUSB)
|
||||
AC_SUBST(USBQUIRKS)
|
||||
|
||||
if test "x$PKGCONFIG" != x; then
|
||||
if test x$enable_libusb = xyes -o $uname != Darwin; then
|
||||
if test x$enable_libusb != xno -a $uname != Darwin; then
|
||||
AC_MSG_CHECKING(for libusb-1.0)
|
||||
if $PKGCONFIG --exists libusb-1.0; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -240,6 +241,9 @@ if test "x$PKGCONFIG" != x; then
|
||||
USBQUIRKS="\$(DATADIR)/usb"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test x$enable_libusb = xyes; then
|
||||
AC_MSG_ERROR(libusb required for --enable-libusb.)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif test x$enable_libusb = xyes; then
|
||||
@@ -356,7 +360,6 @@ case $uname in
|
||||
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
|
||||
AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
|
||||
AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
|
||||
AC_CHECK_HEADER(IOKit/pwr_mgt/IOPMLibPrivate.h,AC_DEFINE(HAVE_IOKIT_PWR_MGT_IOPMLIBPRIVATE_H))
|
||||
|
||||
dnl Check for dynamic store function...
|
||||
AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName)
|
||||
@@ -462,5 +465,5 @@ esac
|
||||
AC_SUBST(BUILDDIRS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 8781 2009-08-28 17:34:54Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 12073 2014-07-31 00:58:00Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 7871 2008-08-27 21:12:43Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 11683 2014-03-05 20:00:54Z msweet $"
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
@@ -103,7 +103,7 @@ if test -n "$GCC"; then
|
||||
fi
|
||||
|
||||
# Generate position-independent code as needed...
|
||||
if test $PICFLAG = 1 -a $uname != AIX; then
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="-fPIC $OPTIM"
|
||||
fi
|
||||
|
||||
@@ -154,20 +154,20 @@ if test -n "$GCC"; then
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
|
||||
OPTIM="-Wall -Wno-format-y2k -Wsign-conversion -Wunused $OPTIM"
|
||||
|
||||
AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-tautological-compare"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
OPTIM="-Wshadow -Werror $OPTIM"
|
||||
else
|
||||
AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-tautological-compare"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
OPTIM="-Werror $OPTIM"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -192,40 +192,6 @@ if test -n "$GCC"; then
|
||||
else
|
||||
# Add vendor-specific compiler options...
|
||||
case $uname in
|
||||
AIX*)
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
OPTIM="-O2 -qmaxmem=6000"
|
||||
else
|
||||
OPTIM="$with_optim $OPTIM"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
HP-UX*)
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
OPTIM="+O2"
|
||||
else
|
||||
OPTIM="$with_optim $OPTIM"
|
||||
fi
|
||||
fi
|
||||
|
||||
CFLAGS="-Ae $CFLAGS"
|
||||
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="+z $OPTIM"
|
||||
fi
|
||||
;;
|
||||
OSF*)
|
||||
# Tru64 UNIX aka Digital UNIX aka OSF/1
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
OPTIM="-O"
|
||||
else
|
||||
OPTIM="$with_optim"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
SunOS*)
|
||||
# Solaris
|
||||
if test -z "$OPTIM"; then
|
||||
@@ -236,20 +202,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="-KPIC $OPTIM"
|
||||
fi
|
||||
;;
|
||||
UNIX_SVR*)
|
||||
# UnixWare
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
OPTIM="-O"
|
||||
else
|
||||
OPTIM="$with_optim $OPTIM"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="-KPIC $OPTIM"
|
||||
fi
|
||||
@@ -268,33 +220,13 @@ fi
|
||||
|
||||
# Add general compiler options per platform...
|
||||
case $uname in
|
||||
HP-UX*)
|
||||
# HP-UX 10.20 (at least) needs this definition to get the
|
||||
# h_errno global...
|
||||
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
|
||||
|
||||
# HP-UX 11.00 (at least) needs this definition to get the
|
||||
# u_short type used by the IP headers...
|
||||
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
|
||||
|
||||
# HP-UX 11.23 (at least) needs this definition to get the
|
||||
# IPv6 header to work...
|
||||
OPTIM="$OPTIM -D_HPUX_SOURCE"
|
||||
;;
|
||||
|
||||
Linux*)
|
||||
# glibc 2.8 and higher breaks peer credentials unless you
|
||||
# define _GNU_SOURCE...
|
||||
OPTIM="$OPTIM -D_GNU_SOURCE"
|
||||
;;
|
||||
|
||||
OSF*)
|
||||
# Tru64 UNIX aka Digital UNIX aka OSF/1 need to be told
|
||||
# to be POSIX-compliant...
|
||||
OPTIM="$OPTIM -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_OSF_SOURCE"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 7871 2008-08-27 21:12:43Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 11683 2014-03-05 20:00:54Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 7959 2008-09-17 19:30:58Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 11789 2014-04-02 16:52:53Z msweet $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl
|
||||
@@ -78,12 +78,21 @@ AC_SUBST(CUPS_LOG_LEVEL)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
|
||||
|
||||
dnl Default AccessLogLevel
|
||||
AC_ARG_WITH(access_log_level, [ --with-access-log-level set default AccessLogLevel value, default=actions],
|
||||
AC_ARG_WITH(access_log_level, [ --with-access-log-level set default AccessLogLevel value, default=none],
|
||||
CUPS_ACCESS_LOG_LEVEL="$withval",
|
||||
CUPS_ACCESS_LOG_LEVEL="actions")
|
||||
CUPS_ACCESS_LOG_LEVEL="none")
|
||||
AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
|
||||
|
||||
dnl Default PageLogFormat
|
||||
AC_ARG_WITH(page_logging, [ --enable-page-logging enable page_log by default])
|
||||
if test "x$enable_page_logging" = xyes; then
|
||||
CUPS_PAGE_LOG_FORMAT=""
|
||||
else
|
||||
CUPS_PAGE_LOG_FORMAT="PageLogFormat"
|
||||
fi
|
||||
AC_SUBST(CUPS_PAGE_LOG_FORMAT)
|
||||
|
||||
dnl Default Browsing
|
||||
AC_ARG_ENABLE(browsing, [ --disable-browsing disable Browsing by default])
|
||||
if test "x$enable_browsing" = xno; then
|
||||
@@ -400,5 +409,5 @@ AC_SUBST(CUPS_WEBIF)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 7959 2008-09-17 19:30:58Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 11789 2014-04-02 16:52:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $"
|
||||
dnl "$Id: cups-directories.m4 11717 2014-03-21 16:42:53Z msweet $"
|
||||
dnl
|
||||
dnl Directory stuff for CUPS.
|
||||
dnl Directory stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_PREFIX_DEFAULT(/)
|
||||
@@ -107,11 +107,6 @@ if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
fi
|
||||
;;
|
||||
HP-UX*)
|
||||
if test -d /usr/lib/hpux32; then
|
||||
libdir="$exec_prefix/lib/hpux32"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -126,119 +121,6 @@ fi
|
||||
AC_SUBST(privateinclude)
|
||||
AC_SUBST(PRIVATEINCLUDE)
|
||||
|
||||
dnl Setup init.d locations...
|
||||
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
|
||||
AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
|
||||
AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
|
||||
AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
|
||||
AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],smfmanifestdir="$withval",smfmanifestdir="")
|
||||
|
||||
INITDIR=""
|
||||
INITDDIR=""
|
||||
RCLEVELS="$rclevels"
|
||||
RCSTART="$rcstart"
|
||||
RCSTOP="$rcstop"
|
||||
SMFMANIFESTDIR=""
|
||||
|
||||
if test x$rcdir = x; then
|
||||
case "$uname" in
|
||||
AIX*)
|
||||
INITDIR="/etc/rc.d"
|
||||
;;
|
||||
|
||||
Darwin*)
|
||||
# Darwin and MacOS X...
|
||||
if test -x /sbin/launchd; then
|
||||
INITDDIR="/System/Library/LaunchDaemons"
|
||||
else
|
||||
INITDDIR="/System/Library/StartupItems/PrintingServices"
|
||||
fi
|
||||
;;
|
||||
|
||||
FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
|
||||
# FreeBSD and OpenBSD
|
||||
;;
|
||||
|
||||
HP-UX*)
|
||||
INITDIR="/sbin"
|
||||
RCLEVELS="2"
|
||||
RCSTART="380"
|
||||
RCSTOP="620"
|
||||
;;
|
||||
|
||||
Linux | GNU | GNU/k*BSD*)
|
||||
# Linux/HURD seems to choose an init.d directory at random...
|
||||
if test -d /sbin/init.d; then
|
||||
# SuSE
|
||||
INITDIR="/sbin/init.d"
|
||||
else
|
||||
if test -d /etc/init.d; then
|
||||
# Others
|
||||
INITDIR="/etc"
|
||||
else
|
||||
# RedHat
|
||||
INITDIR="/etc/rc.d"
|
||||
fi
|
||||
fi
|
||||
RCSTART="81"
|
||||
RCSTOP="36"
|
||||
;;
|
||||
|
||||
NetBSD*)
|
||||
# NetBSD
|
||||
INITDDIR="/etc/rc.d"
|
||||
;;
|
||||
|
||||
OSF1*)
|
||||
INITDIR="/sbin"
|
||||
;;
|
||||
|
||||
SunOS*)
|
||||
# Solaris
|
||||
if test "x$smfmanifestdir" != x; then
|
||||
SMFMANIFESTDIR=$smfmanifestdir
|
||||
else
|
||||
INITDIR="/etc"
|
||||
RCSTART="81"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
INITDIR="/etc"
|
||||
;;
|
||||
|
||||
esac
|
||||
elif test "x$rcdir" != xno; then
|
||||
if test "x$rclevels" = x; then
|
||||
INITDDIR="$rcdir"
|
||||
else
|
||||
INITDIR="$rcdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(INITDIR)
|
||||
AC_SUBST(INITDDIR)
|
||||
AC_SUBST(RCLEVELS)
|
||||
AC_SUBST(RCSTART)
|
||||
AC_SUBST(RCSTOP)
|
||||
AC_SUBST(SMFMANIFESTDIR)
|
||||
|
||||
dnl Xinetd support...
|
||||
AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
|
||||
|
||||
if test "x$XINETD" = x -a ! -x /sbin/launchd; then
|
||||
for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
|
||||
if test -d $dir; then
|
||||
XINETD="$dir"
|
||||
break
|
||||
fi
|
||||
done
|
||||
elif test "x$XINETD" = xno; then
|
||||
XINETD=""
|
||||
fi
|
||||
|
||||
AC_SUBST(XINETD)
|
||||
|
||||
dnl LPD sharing support...
|
||||
AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
|
||||
LPDCONFIG="$withval", LPDCONFIG="")
|
||||
@@ -355,10 +237,6 @@ if test "$localedir" = "\${datarootdir}/locale"; then
|
||||
CUPS_LOCALEDIR="$datarootdir/locale"
|
||||
;;
|
||||
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
@@ -427,5 +305,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
|
||||
AC_SUBST(CUPS_STATEDIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $".
|
||||
dnl End of "$Id: cups-directories.m4 11717 2014-03-21 16:42:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $"
|
||||
dnl "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl
|
||||
@@ -82,5 +82,5 @@ AC_SUBST(IPPFIND_BIN)
|
||||
AC_SUBST(IPPFIND_MAN)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $".
|
||||
dnl End of "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-gssapi.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl "$Id: cups-gssapi.m4 11911 2014-06-10 13:54:53Z msweet $"
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl
|
||||
@@ -22,7 +22,7 @@ LIBGSSAPI=""
|
||||
AC_SUBST(LIBGSSAPI)
|
||||
|
||||
if test x$enable_gssapi != xno; then
|
||||
AC_PATH_PROG(KRB5CONFIG, krb5-config)
|
||||
AC_PATH_TOOL(KRB5CONFIG, krb5-config)
|
||||
if test "x$KRB5CONFIG" != x; then
|
||||
case "$uname" in
|
||||
Darwin)
|
||||
@@ -129,5 +129,5 @@ AC_SUBST(CUPS_DEFAULT_GSSSERVICENAME)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-gssapi.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl End of "$Id: cups-gssapi.m4 11911 2014-06-10 13:54:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-largefile.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Large file support stuff for CUPS.
|
||||
dnl
|
||||
@@ -48,5 +48,5 @@ fi
|
||||
AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-largefile.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl
|
||||
dnl launchd stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2010 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
|
||||
AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support])
|
||||
|
||||
DEFAULT_LAUNCHD_CONF=""
|
||||
LAUNCHDLIBS=""
|
||||
|
||||
if test x$enable_launchd != xno; then
|
||||
AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD))
|
||||
AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin, MacOS X
|
||||
DEFAULT_LAUNCHD_CONF="/System/Library/LaunchDaemons/org.cups.cupsd.plist"
|
||||
# liblaunch is already part of libSystem
|
||||
;;
|
||||
*)
|
||||
# All others; this test will need to be updated
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_SUBST(DEFAULT_LAUNCHD_CONF)
|
||||
AC_SUBST(LAUNCHDLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-libtool.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Libtool stuff for CUPS.
|
||||
dnl
|
||||
@@ -35,5 +35,5 @@ if test x$LIBTOOL != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-libtool.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-manpages.m4 11342 2013-10-18 20:36:01Z msweet $"
|
||||
dnl
|
||||
dnl Manpage stuff for CUPS.
|
||||
dnl Manpage stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Fix "mandir" variable...
|
||||
@@ -22,8 +22,8 @@ fi
|
||||
|
||||
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
|
||||
case "$uname" in
|
||||
Darwin* | Linux | GNU | *BSD* | AIX*)
|
||||
# Darwin, MacOS X, Linux, GNU HURD, *BSD, and AIX
|
||||
Darwin* | Linux | GNU | *BSD*)
|
||||
# Darwin, MacOS X, Linux, GNU HURD, and *BSD
|
||||
mandir="/usr/share/man"
|
||||
AMANDIR="/usr/share/man"
|
||||
PMANDIR="/usr/share/man"
|
||||
@@ -45,8 +45,8 @@ AC_SUBST(PMANDIR)
|
||||
|
||||
dnl Setup manpage extensions...
|
||||
case "$uname" in
|
||||
SunOS* | HP-UX*)
|
||||
# Solaris and HP-UX
|
||||
SunOS*)
|
||||
# Solaris
|
||||
MAN1EXT=1
|
||||
MAN5EXT=5
|
||||
MAN7EXT=7
|
||||
@@ -78,5 +78,5 @@ AC_SUBST(MAN8EXT)
|
||||
AC_SUBST(MAN8DIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-manpages.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 7918 2008-09-08 22:03:01Z mike $"
|
||||
dnl "$Id: cups-network.m4 11719 2014-03-21 18:07:23Z msweet $"
|
||||
dnl
|
||||
dnl Networking stuff for CUPS.
|
||||
dnl Networking stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H))
|
||||
@@ -66,9 +66,6 @@ fi
|
||||
AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
|
||||
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
|
||||
|
||||
AC_CHECK_HEADERS(AppleTalk/at_proto.h,AC_DEFINE(HAVE_APPLETALK_AT_PROTO_H),,
|
||||
[#include <netat/appletalk.h>])
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-network.m4 7918 2008-09-08 22:03:01Z mike $".
|
||||
dnl End of "$Id: cups-network.m4 11719 2014-03-21 18:07:23Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Operating system stuff for CUPS.
|
||||
dnl
|
||||
@@ -35,5 +35,5 @@ case "$uname" in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pam.m4 7960 2008-09-17 19:42:02Z mike $"
|
||||
dnl "$Id: cups-pam.m4 11342 2013-10-18 20:36:01Z msweet $"
|
||||
dnl
|
||||
dnl PAM stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(pam, [ --disable-pam disable PAM support])
|
||||
AC_ARG_WITH(pam_module, [ --with-pam-module specify the PAM module to use])
|
||||
|
||||
dnl Don't use PAM with AIX...
|
||||
if test $uname = AIX; then
|
||||
enable_pam=no
|
||||
fi
|
||||
|
||||
PAMDIR=""
|
||||
PAMFILE="pam.std"
|
||||
PAMLIBS=""
|
||||
@@ -98,5 +93,5 @@ AC_SUBST(PAMMOD)
|
||||
AC_SUBST(PAMMODAUTH)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pam.m4 7960 2008-09-17 19:42:02Z mike $".
|
||||
dnl End of "$Id: cups-pam.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: cups-poll.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Select/poll stuff for CUPS.
|
||||
dnl
|
||||
@@ -18,5 +18,5 @@ AC_CHECK_FUNC(epoll_create, AC_DEFINE(HAVE_EPOLL))
|
||||
AC_CHECK_FUNC(kqueue, AC_DEFINE(HAVE_KQUEUE))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl End of "$Id: cups-poll.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-scripting.m4 7915 2008-09-07 22:18:29Z mike $"
|
||||
dnl "$Id: cups-scripting.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Scripting configuration stuff for CUPS.
|
||||
dnl
|
||||
@@ -85,5 +85,5 @@ if test "x$CUPS_PYTHON" != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-scripting.m4 7915 2008-09-07 22:18:29Z mike $".
|
||||
dnl End of "$Id: cups-scripting.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id: cups-sharedlibs.m4 7630 2008-06-09 22:31:44Z mike $"
|
||||
dnl "$Id: cups-sharedlibs.m4 11342 2013-10-18 20:36:01Z msweet $"
|
||||
dnl
|
||||
dnl Shared library support for CUPS.
|
||||
dnl Shared library support for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
PICFLAG=1
|
||||
@@ -34,51 +34,7 @@ if test x$enable_shared != xno; then
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
|
||||
;;
|
||||
UNIX_S*)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
LIBCUPSMIME="libcupsmime.so.1"
|
||||
LIBCUPSPPDC="libcupsppdc.so.1"
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
|
||||
;;
|
||||
HP-UX*)
|
||||
case "$uarch" in
|
||||
ia64)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
LIBCUPSMIME="libcupsmime.so.1"
|
||||
LIBCUPSPPDC="libcupsppdc.so.1"
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`"
|
||||
;;
|
||||
*)
|
||||
LIBCUPS="lib$cupsbase.sl.2"
|
||||
LIBCUPSCGI="libcupscgi.sl.1"
|
||||
LIBCUPSIMAGE="libcupsimage.sl.2"
|
||||
LIBCUPSMIME="libcupsmime.sl.1"
|
||||
LIBCUPSPPDC="libcupsppdc.sl.1"
|
||||
DSO="\$(LD)"
|
||||
DSOXX="\$(LD)"
|
||||
DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
IRIX)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
LIBCUPSMIME="libcupsmime.so.1"
|
||||
LIBCUPSPPDC="libcupsppdc.so.1"
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
;;
|
||||
OSF1* | Linux | GNU | *BSD*)
|
||||
Linux | GNU | *BSD*)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -98,17 +54,6 @@ if test x$enable_shared != xno; then
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
|
||||
;;
|
||||
AIX*)
|
||||
LIBCUPS="lib${cupsbase}_s.a"
|
||||
LIBCUPSBASE="${cupsbase}_s"
|
||||
LIBCUPSCGI="libcupscgi_s.a"
|
||||
LIBCUPSIMAGE="libcupsimage_s.a"
|
||||
LIBCUPSMIME="libcupsmime_s.a"
|
||||
LIBCUPSPPDC="libcupsppdc_s.a"
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)"
|
||||
;;
|
||||
*)
|
||||
echo "Warning: shared libraries may not be supported. Trying -shared"
|
||||
echo " option with compiler."
|
||||
@@ -151,19 +96,11 @@ if test x$enable_shared = xno; then
|
||||
EXTLINKCUPS="-lcups"
|
||||
EXTLINKCUPSIMAGE="-lcupsimage"
|
||||
else
|
||||
if test $uname = AIX; then
|
||||
LINKCUPS="-l${cupsbase}_s"
|
||||
LINKCUPSIMAGE="-lcupsimage_s"
|
||||
LINKCUPS="-l${cupsbase}"
|
||||
LINKCUPSIMAGE="-lcupsimage"
|
||||
|
||||
EXTLINKCUPS="-lcups_s"
|
||||
EXTLINKCUPSIMAGE="-lcupsimage_s"
|
||||
else
|
||||
LINKCUPS="-l${cupsbase}"
|
||||
LINKCUPSIMAGE="-lcupsimage"
|
||||
|
||||
EXTLINKCUPS="-lcups"
|
||||
EXTLINKCUPSIMAGE="-lcupsimage"
|
||||
fi
|
||||
EXTLINKCUPS="-lcups"
|
||||
EXTLINKCUPSIMAGE="-lcupsimage"
|
||||
fi
|
||||
|
||||
AC_SUBST(EXTLINKCUPS)
|
||||
@@ -186,19 +123,6 @@ if test "$DSO" != ":"; then
|
||||
# need this option, even when the library is installed in a
|
||||
# standard location...
|
||||
case $uname in
|
||||
HP-UX*)
|
||||
# HP-UX needs the path, even for /usr/lib...
|
||||
case "$uarch" in
|
||||
ia64)
|
||||
DSOFLAGS="-Wl,+s,+b,$libdir $DSOFLAGS"
|
||||
;;
|
||||
*)
|
||||
DSOFLAGS="+s +b $libdir $DSOFLAGS"
|
||||
;;
|
||||
esac
|
||||
LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
|
||||
EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
|
||||
;;
|
||||
SunOS*)
|
||||
# Solaris...
|
||||
if test $exec_prefix != /usr; then
|
||||
@@ -234,5 +158,5 @@ AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-sharedlibs.m4 7630 2008-06-09 22:31:44Z mike $".
|
||||
dnl End of "$Id: cups-sharedlibs.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 7241 2008-01-22 22:34:52Z mike $"
|
||||
dnl "$Id: cups-ssl.m4 11911 2014-06-10 13:54:53Z msweet $"
|
||||
dnl
|
||||
dnl OpenSSL/GNUTLS stuff for CUPS.
|
||||
dnl TLS stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(ssl, [ --disable-ssl disable SSL/TLS support])
|
||||
AC_ARG_ENABLE(cdsassl, [ --enable-cdsassl use CDSA for SSL/TLS support, default=first])
|
||||
AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support, default=second])
|
||||
AC_ARG_ENABLE(openssl, [ --enable-openssl use OpenSSL for SSL/TLS support, default=third])
|
||||
AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
|
||||
LDFLAGS="-L$withval $LDFLAGS"
|
||||
DSOFLAGS="-L$withval $DSOFLAGS",)
|
||||
AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenSSL includes],
|
||||
CFLAGS="-I$withval $CFLAGS"
|
||||
CPPFLAGS="-I$withval $CPPFLAGS",)
|
||||
|
||||
SSLFLAGS=""
|
||||
SSLLIBS=""
|
||||
@@ -59,14 +52,15 @@ if test x$enable_ssl != xno; then
|
||||
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
|
||||
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
|
||||
|
||||
AC_DEFINE(HAVE_CSSMERRORSTRING)])
|
||||
AC_DEFINE(HAVE_CSSMERRORSTRING)
|
||||
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Then look for GNU TLS...
|
||||
if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then
|
||||
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
|
||||
AC_PATH_PROG(LIBGCRYPTCONFIG,libgcrypt-config)
|
||||
AC_PATH_TOOL(LIBGNUTLSCONFIG,libgnutls-config)
|
||||
AC_PATH_TOOL(LIBGCRYPTCONFIG,libgcrypt-config)
|
||||
if $PKGCONFIG --exists gnutls; then
|
||||
have_ssl=1
|
||||
SSLLIBS=`$PKGCONFIG --libs gnutls`
|
||||
@@ -84,58 +78,8 @@ if test x$enable_ssl != xno; then
|
||||
if test $have_ssl = 1; then
|
||||
CUPS_SERVERCERT="ssl/server.crt"
|
||||
CUPS_SERVERKEY="ssl/server.key"
|
||||
|
||||
if $PKGCONFIG --exists gcrypt; then
|
||||
SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`"
|
||||
SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`"
|
||||
elif test "x$LIBGCRYPTCONFIG" != x; then
|
||||
SSLLIBS="$SSLLIBS `$LIBGCRYPTCONFIG --libs`"
|
||||
SSLFLAGS="$SSLFLAGS `$LIBGCRYPTCONFIG --cflags`"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check for the OpenSSL library last...
|
||||
if test $have_ssl = 0 -a "x$enable_openssl" != "xno"; then
|
||||
AC_CHECK_HEADER(openssl/ssl.h,[
|
||||
dnl Save the current libraries so the crypto stuff isn't always
|
||||
dnl included...
|
||||
SAVELIBS="$LIBS"
|
||||
|
||||
dnl Some ELF systems can't resolve all the symbols in libcrypto
|
||||
dnl if libcrypto was linked against RSAREF, and fail to link the
|
||||
dnl test program correctly, even though a correct installation
|
||||
dnl of OpenSSL exists. So we test the linking three times in
|
||||
dnl case the RSAREF libraries are needed.
|
||||
|
||||
for libcrypto in \
|
||||
"-lcrypto" \
|
||||
"-lcrypto -lrsaref" \
|
||||
"-lcrypto -lRSAglue -lrsaref"
|
||||
do
|
||||
AC_CHECK_LIB(ssl,SSL_new,
|
||||
[have_ssl=1
|
||||
SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
|
||||
SSLLIBS="-lssl $libcrypto"
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_LIBSSL)],,
|
||||
$libcrypto)
|
||||
|
||||
if test "x${SSLLIBS}" != "x"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test "x${SSLLIBS}" != "x"; then
|
||||
CUPS_SERVERCERT="ssl/server.crt"
|
||||
CUPS_SERVERKEY="ssl/server.key"
|
||||
|
||||
LIBS="$SAVELIBS $SSLLIBS"
|
||||
AC_CHECK_FUNCS(SSL_set_tlsext_host_name)
|
||||
fi
|
||||
|
||||
LIBS="$SAVELIBS"])
|
||||
fi
|
||||
fi
|
||||
|
||||
IPPALIASES="http"
|
||||
@@ -143,7 +87,7 @@ if test $have_ssl = 1; then
|
||||
AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
|
||||
AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
|
||||
IPPALIASES="http https ipps"
|
||||
elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes -o x$enable_openssl = xyes; then
|
||||
elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes; then
|
||||
AC_MSG_ERROR([Unable to enable SSL support.])
|
||||
fi
|
||||
|
||||
@@ -157,5 +101,5 @@ EXPORT_SSLLIBS="$SSLLIBS"
|
||||
AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ssl.m4 7241 2008-01-22 22:34:52Z mike $".
|
||||
dnl End of "$Id: cups-ssl.m4 11911 2014-06-10 13:54:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
dnl
|
||||
dnl "$Id: cups-startup.m4 11747 2014-03-27 01:15:48Z msweet $"
|
||||
dnl
|
||||
dnl Launch-on-demand/startup stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
ONDEMANDFLAGS=""
|
||||
ONDEMANDLIBS=""
|
||||
AC_SUBST(ONDEMANDFLAGS)
|
||||
AC_SUBST(ONDEMANDLIBS)
|
||||
|
||||
dnl Launchd is used on OS X/Darwin...
|
||||
AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support])
|
||||
LAUNCHD_DIR=""
|
||||
AC_SUBST(LAUNCHD_DIR)
|
||||
|
||||
if test x$enable_launchd != xno; then
|
||||
AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD))
|
||||
if test $uversion -ge 140; then
|
||||
AC_CHECK_FUNC(launch_activate_socket, [
|
||||
AC_DEFINE(HAVE_LAUNCHD)
|
||||
AC_DEFINE(HAVE_LAUNCH_ACTIVATE_SOCKET)])
|
||||
fi
|
||||
AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin, MacOS X
|
||||
LAUNCHD_DIR="/System/Library/LaunchDaemons"
|
||||
# liblaunch is already part of libSystem
|
||||
;;
|
||||
*)
|
||||
# All others; this test will need to be updated
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl Systemd is used on Linux...
|
||||
AC_ARG_ENABLE(systemd, [ --disable-systemd disable systemd support])
|
||||
AC_ARG_WITH(systemd, [ --with-systemd set directory for systemd service files],
|
||||
SYSTEMD_DIR="$withval", SYSTEMD_DIR="")
|
||||
AC_SUBST(SYSTEMD_DIR)
|
||||
|
||||
if test x$enable_systemd != xno; then
|
||||
if test "x$PKGCONFIG" = x; then
|
||||
if test x$enable_systemd = xyes; then
|
||||
AC_MSG_ERROR(Need pkg-config to enable systemd support.)
|
||||
fi
|
||||
else
|
||||
AC_MSG_CHECKING(for libsystemd-daemon)
|
||||
if $PKGCONFIG --exists libsystemd-daemon; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
AC_DEFINE(HAVE_SYSTEMD)
|
||||
if test "x$SYSTEMD_DIR" = x; then
|
||||
SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Solaris uses smf
|
||||
SMFMANIFESTDIR=""
|
||||
AC_SUBST(SMFMANIFESTDIR)
|
||||
AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],SMFMANIFESTDIR="$withval")
|
||||
|
||||
dnl Use init on other platforms...
|
||||
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
|
||||
AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
|
||||
AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="")
|
||||
AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="")
|
||||
|
||||
if test x$rcdir = x; then
|
||||
if test x$LAUNCHD_DIR = x -a x$SYSTEMD_DIR = x -a x$SMFMANIFESTDIR = x; then
|
||||
# Fall back on "init", the original service startup interface...
|
||||
if test -d /sbin/init.d; then
|
||||
# SuSE
|
||||
rcdir="/sbin/init.d"
|
||||
elif test -d /etc/init.d; then
|
||||
# Others
|
||||
rcdir="/etc"
|
||||
else
|
||||
# RedHat, NetBSD
|
||||
rcdir="/etc/rc.d"
|
||||
fi
|
||||
else
|
||||
rcdir="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$rcstart" = x; then
|
||||
case "$uname" in
|
||||
Linux | GNU | GNU/k*BSD*)
|
||||
# Linux
|
||||
rcstart="81"
|
||||
;;
|
||||
|
||||
SunOS*)
|
||||
# Solaris
|
||||
rcstart="81"
|
||||
;;
|
||||
|
||||
*)
|
||||
# Others
|
||||
rcstart="99"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$rcstop" = x; then
|
||||
case "$uname" in
|
||||
Linux | GNU | GNU/k*BSD*)
|
||||
# Linux
|
||||
rcstop="36"
|
||||
;;
|
||||
|
||||
*)
|
||||
# Others
|
||||
rcstop="00"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
INITDIR=""
|
||||
INITDDIR=""
|
||||
RCLEVELS="$rclevels"
|
||||
RCSTART="$rcstart"
|
||||
RCSTOP="$rcstop"
|
||||
AC_SUBST(INITDIR)
|
||||
AC_SUBST(INITDDIR)
|
||||
AC_SUBST(RCLEVELS)
|
||||
AC_SUBST(RCSTART)
|
||||
AC_SUBST(RCSTOP)
|
||||
|
||||
if test "x$rcdir" != xno; then
|
||||
if test "x$rclevels" = x; then
|
||||
INITDDIR="$rcdir"
|
||||
else
|
||||
INITDIR="$rcdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Xinetd support...
|
||||
AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],xinetd="$withval",xinetd="")
|
||||
XINETD=""
|
||||
AC_SUBST(XINETD)
|
||||
|
||||
if test "x$xinetd" = x; then
|
||||
if test ! -x /sbin/launchd; then
|
||||
for dir in /etc/xinetd.d /usr/local/etc/xinetd.d; do
|
||||
if test -d $dir; then
|
||||
XINETD="$dir"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
elif test "x$xinet" != xno; then
|
||||
XINETD="$xinetd"
|
||||
fi
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-startup.m4 11747 2014-03-27 01:15:48Z msweet $".
|
||||
dnl
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-threads.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl Threading stuff for CUPS.
|
||||
dnl
|
||||
@@ -50,5 +50,5 @@ fi
|
||||
AC_SUBST(PTHREAD_FLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-threads.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
+39
-32
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* "$Id: config.h.in 11642 2014-02-27 15:57:59Z msweet $"
|
||||
* "$Id: config.h.in 11717 2014-03-21 16:42:53Z msweet $"
|
||||
*
|
||||
* Configuration file for CUPS.
|
||||
* Configuration file for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CONFIG_H_
|
||||
@@ -131,6 +131,13 @@
|
||||
#define CUPS_STATEDIR "/var/run/cups"
|
||||
|
||||
|
||||
/*
|
||||
* Do we have posix_spawn?
|
||||
*/
|
||||
|
||||
#undef HAVE_POSIX_SPAWN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have ZLIB?
|
||||
*/
|
||||
@@ -290,17 +297,9 @@
|
||||
|
||||
#undef HAVE_CDSASSL
|
||||
#undef HAVE_GNUTLS
|
||||
#undef HAVE_LIBSSL
|
||||
#undef HAVE_SSL
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SSL_set_tlsext_host_name function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SSL_SET_TLSEXT_HOST_NAME
|
||||
|
||||
|
||||
/*
|
||||
* What Security framework headers do we have?
|
||||
*/
|
||||
@@ -323,6 +322,20 @@
|
||||
#undef HAVE_CSSMERRORSTRING
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SecGenerateSelfSignedCertificate function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SecKeychainOpen function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SECKEYCHAINOPEN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have libpaper?
|
||||
*/
|
||||
@@ -428,13 +441,6 @@
|
||||
#undef HAVE_STRUCT_SOCKADDR_SA_LEN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the AIX usersec.h header file?
|
||||
*/
|
||||
|
||||
#undef HAVE_USERSEC_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have pthread support?
|
||||
*/
|
||||
@@ -448,6 +454,14 @@
|
||||
|
||||
#undef HAVE_LAUNCH_H
|
||||
#undef HAVE_LAUNCHD
|
||||
#undef HAVE_LAUNCH_ACTIVATE_SOCKET
|
||||
|
||||
|
||||
/*
|
||||
* Do we have systemd support?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYSTEMD
|
||||
|
||||
|
||||
/*
|
||||
@@ -522,13 +536,6 @@
|
||||
#undef HAVE_NOTIFY_POST
|
||||
|
||||
|
||||
/*
|
||||
* Do we have Darwin's IOKit private headers?
|
||||
*/
|
||||
|
||||
#undef HAVE_IOKIT_PWR_MGT_IOPMLIBPRIVATE_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have DBUS?
|
||||
*/
|
||||
@@ -707,5 +714,5 @@ static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: config.h.in 11642 2014-02-27 15:57:59Z msweet $".
|
||||
* End of "$Id: config.h.in 11717 2014-03-21 16:42:53Z msweet $".
|
||||
*/
|
||||
|
||||
externo
+521
-530
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id: configure.in 11109 2013-07-08 21:15:13Z msweet $"
|
||||
dnl "$Id: configure.ac 11823 2014-04-21 12:22:03Z msweet $"
|
||||
dnl
|
||||
dnl Configuration script for CUPS.
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_INIT(cups/cups.h)
|
||||
@@ -32,7 +32,7 @@ sinclude(config-scripts/cups-ssl.m4)
|
||||
sinclude(config-scripts/cups-pam.m4)
|
||||
sinclude(config-scripts/cups-largefile.m4)
|
||||
sinclude(config-scripts/cups-dnssd.m4)
|
||||
sinclude(config-scripts/cups-launchd.m4)
|
||||
sinclude(config-scripts/cups-startup.m4)
|
||||
sinclude(config-scripts/cups-defaults.m4)
|
||||
sinclude(config-scripts/cups-scripting.m4)
|
||||
|
||||
@@ -68,12 +68,8 @@ AC_OUTPUT(Makedefs
|
||||
cups-config
|
||||
data/testprint
|
||||
desktop/cups.desktop
|
||||
doc/help/ref-cups-files-conf.html
|
||||
doc/help/ref-cupsd-conf.html
|
||||
doc/index.html
|
||||
man/client.conf.man
|
||||
man/cups-deviced.man
|
||||
man/cups-driverd.man
|
||||
man/cups-files.conf.man
|
||||
man/cups-lpd.man
|
||||
man/cups-snmp.man
|
||||
@@ -85,6 +81,9 @@ AC_OUTPUT(Makedefs
|
||||
scheduler/cups.sh
|
||||
scheduler/cups.xml
|
||||
scheduler/org.cups.cups-lpd.plist
|
||||
scheduler/org.cups.cupsd.path
|
||||
scheduler/org.cups.cupsd.service
|
||||
scheduler/org.cups.cupsd.socket
|
||||
templates/header.tmpl
|
||||
packaging/cups.list
|
||||
$LANGFILES)
|
||||
@@ -92,5 +91,5 @@ AC_OUTPUT(Makedefs
|
||||
chmod +x cups-config
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: configure.in 11109 2013-07-08 21:15:13Z msweet $".
|
||||
dnl End of "$Id: configure.ac 11823 2014-04-21 12:22:03Z msweet $".
|
||||
dnl
|
||||
+246
-193
@@ -1,260 +1,313 @@
|
||||
adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h adminutil.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h adminutil.h
|
||||
array.o: array.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h
|
||||
attr.o: attr.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
auth.o: auth.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h
|
||||
array.h language.h pwg.h
|
||||
backend.o: backend.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h backend.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h backend.h
|
||||
conflicts.o: conflicts.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
custom.o: custom.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
debug.o: debug.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
dest.o: dest.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
dest-job.o: dest-job.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
dest-localization.o: dest-localization.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h ipp-private.h \
|
||||
../cups/ipp.h http.h array.h http-private.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h language.h pwg-private.h \
|
||||
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
dest-options.o: dest-options.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h ipp-private.h \
|
||||
../cups/ipp.h http.h array.h http-private.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h language.h pwg-private.h \
|
||||
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
dir.o: dir.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h dir.h
|
||||
emit.o: emit.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
encode.o: encode.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
file.o: file.c file-private.h cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
getdevices.o: getdevices.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
getifaddrs.o: getifaddrs.c http-private.h ../config.h ../cups/http.h \
|
||||
versioning.h array.h md5-private.h ipp-private.h ../cups/ipp.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
getifaddrs.o: getifaddrs.c http-private.h ../config.h ../cups/language.h \
|
||||
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
|
||||
../cups/ipp.h
|
||||
getputfile.o: getputfile.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
globals.o: globals.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
http.o: http.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
http-addr.o: http-addr.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
http-addrlist.o: http-addrlist.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h ipp-private.h \
|
||||
../cups/ipp.h http.h array.h http-private.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h language.h pwg-private.h \
|
||||
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
http-support.o: http-support.c cups-private.h string-private.h \
|
||||
../config.h debug-private.h ../cups/versioning.h ipp-private.h \
|
||||
../cups/ipp.h http.h array.h http-private.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h language.h pwg-private.h \
|
||||
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
../config.h debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
ipp.o: ipp.c cups-private.h string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h ipp-private.h ../cups/ipp.h http.h array.h \
|
||||
http-private.h md5-private.h language-private.h ../cups/transcode.h \
|
||||
language.h pwg-private.h ../cups/cups.h file.h ppd-private.h \
|
||||
../cups/ppd.h thread-private.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
|
||||
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
|
||||
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
ipp-support.o: ipp-support.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
langprintf.o: langprintf.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
language.o: language.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
localize.o: localize.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
mark.o: mark.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
md5.o: md5.c md5-private.h string-private.h ../config.h
|
||||
md5passwd.o: md5passwd.c http-private.h ../config.h ../cups/http.h \
|
||||
versioning.h array.h md5-private.h ipp-private.h ../cups/ipp.h \
|
||||
string-private.h
|
||||
md5passwd.o: md5passwd.c http-private.h ../config.h ../cups/language.h \
|
||||
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
|
||||
../cups/ipp.h string-private.h
|
||||
notify.o: notify.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
options.o: options.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
page.o: page.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h ppd.h cups.h file.h ipp.h http.h array.h \
|
||||
language.h
|
||||
language.h pwg.h
|
||||
ppd.o: ppd.c cups-private.h string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h ipp-private.h ../cups/ipp.h http.h array.h \
|
||||
http-private.h md5-private.h language-private.h ../cups/transcode.h \
|
||||
language.h pwg-private.h ../cups/cups.h file.h ppd-private.h \
|
||||
../cups/ppd.h thread-private.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
|
||||
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
|
||||
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
ppd-cache.o: ppd-cache.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
pwg-media.o: pwg-media.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
request.o: request.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
sidechannel.o: sidechannel.c sidechannel.h versioning.h cups-private.h \
|
||||
string-private.h ../config.h debug-private.h ipp-private.h \
|
||||
../cups/ipp.h http.h array.h http-private.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h language.h pwg-private.h \
|
||||
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
|
||||
string-private.h ../config.h debug-private.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
|
||||
../cups/language.h md5-private.h language-private.h \
|
||||
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
snmp.o: snmp.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h snmp-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h snmp-private.h
|
||||
snprintf.o: snprintf.c string-private.h ../config.h
|
||||
string.o: string.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h thread-private.h array.h
|
||||
tempfile.o: tempfile.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
thread.o: thread.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
tls.o: tls.c cups-private.h string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
|
||||
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
|
||||
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h tls-darwin.c
|
||||
transcode.o: transcode.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
usersys.o: usersys.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
util.o: util.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testadmin.o: testadmin.c adminutil.h cups.h file.h versioning.h ipp.h \
|
||||
http.h array.h language.h string-private.h ../config.h
|
||||
http.h array.h language.h pwg.h string-private.h ../config.h
|
||||
testarray.o: testarray.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array.h dir.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h dir.h
|
||||
testconflicts.o: testconflicts.c cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h ppd.h string-private.h ../config.h
|
||||
array.h language.h pwg.h ppd.h string-private.h ../config.h
|
||||
testcups.o: testcups.c string-private.h ../config.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h ppd.h
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h ppd.h
|
||||
testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \
|
||||
language.h pwg.h
|
||||
testfile.o: testfile.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h file.h
|
||||
testhttp.o: testhttp.c string-private.h ../config.h http-private.h \
|
||||
../cups/http.h versioning.h array.h md5-private.h ipp-private.h \
|
||||
../cups/ipp.h
|
||||
testhttp.o: testhttp.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testi18n.o: testi18n.c string-private.h ../config.h language-private.h \
|
||||
../cups/transcode.h language.h array.h versioning.h
|
||||
testipp.o: testipp.c file.h versioning.h string-private.h ../config.h \
|
||||
ipp-private.h ../cups/ipp.h http.h array.h
|
||||
testoptions.o: testoptions.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testlang.o: testlang.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testppd.o: testppd.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
testpwg.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h ../cups/ppd.h pwg-private.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h pwg-private.h \
|
||||
file-private.h cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ipp-private.h http-private.h md5-private.h \
|
||||
language-private.h ../cups/transcode.h thread-private.h
|
||||
debug-private.h array-private.h ipp-private.h http-private.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h thread-private.h
|
||||
testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
|
||||
http.h array.h http-private.h md5-private.h language-private.h \
|
||||
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
|
||||
ppd-private.h ../cups/ppd.h thread-private.h snmp-private.h
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h snmp-private.h
|
||||
|
||||
+59
-33
@@ -1,18 +1,18 @@
|
||||
#
|
||||
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
|
||||
# "$Id: Makefile 12032 2014-07-15 20:37:32Z msweet $"
|
||||
#
|
||||
# API library Makefile for CUPS.
|
||||
# API library Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2013 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -76,6 +76,7 @@ LIBOBJS = \
|
||||
string.o \
|
||||
tempfile.o \
|
||||
thread.o \
|
||||
tls.o \
|
||||
transcode.o \
|
||||
usersys.o \
|
||||
util.o
|
||||
@@ -84,6 +85,7 @@ TESTOBJS = \
|
||||
testarray.o \
|
||||
testconflicts.o \
|
||||
testcups.o \
|
||||
testdest.o \
|
||||
testfile.o \
|
||||
testhttp.o \
|
||||
testi18n.o \
|
||||
@@ -147,8 +149,10 @@ LIBTARGETS = \
|
||||
UNITTARGETS = \
|
||||
testadmin \
|
||||
testarray \
|
||||
testcache \
|
||||
testconflicts \
|
||||
testcups \
|
||||
testdest \
|
||||
testfile \
|
||||
testhttp \
|
||||
testi18n \
|
||||
@@ -190,7 +194,7 @@ unittests: $(UNITTARGETS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
|
||||
$(RM) libcups.so libcups.sl libcups.dylib
|
||||
$(RM) libcups.so libcups.dylib
|
||||
|
||||
|
||||
#
|
||||
@@ -257,7 +261,7 @@ install-libs: $(INSTALLSTATIC)
|
||||
echo Installing libraries in $(LIBDIR)...
|
||||
$(INSTALL_DIR) -m 755 $(LIBDIR)
|
||||
$(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
|
||||
if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
|
||||
if test $(LIBCUPS) = "libcups.so.2"; then \
|
||||
$(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
|
||||
$(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
|
||||
fi
|
||||
@@ -286,9 +290,6 @@ uninstall:
|
||||
$(RM) $(LIBDIR)/libcups.2.dylib
|
||||
$(RM) $(LIBDIR)/$(LIBCUPSSTATIC)
|
||||
$(RM) $(LIBDIR)/libcups.dylib
|
||||
$(RM) $(LIBDIR)/libcups_s.a
|
||||
$(RM) $(LIBDIR)/libcups.sl
|
||||
$(RM) $(LIBDIR)/libcups.sl.2
|
||||
$(RM) $(LIBDIR)/libcups.so
|
||||
$(RM) $(LIBDIR)/libcups.so.2
|
||||
-$(RMDIR) $(LIBDIR)
|
||||
@@ -299,10 +300,10 @@ uninstall:
|
||||
|
||||
|
||||
#
|
||||
# libcups.so.2, libcups.sl.2
|
||||
# libcups.so.2
|
||||
#
|
||||
|
||||
libcups.so.2 libcups.sl.2: $(LIBOBJS)
|
||||
libcups.so.2: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
|
||||
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
@@ -322,7 +323,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.10.0 \
|
||||
-current_version 2.11.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
-exported_symbols_list t.exp \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
@@ -331,19 +332,6 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
$(LN) $@ libcups.dylib
|
||||
|
||||
|
||||
#
|
||||
# libcups_s.a
|
||||
#
|
||||
|
||||
libcups_s.a: $(LIBOBJS) libcups_s.exp
|
||||
echo Creating $@...
|
||||
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcups_s.o
|
||||
|
||||
|
||||
#
|
||||
# libcups.la
|
||||
#
|
||||
@@ -351,7 +339,7 @@ libcups_s.a: $(LIBOBJS) libcups_s.exp
|
||||
libcups.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:10 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
-rpath $(LIBDIR) -version-info 2:11 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -366,6 +354,23 @@ libcups.a: $(LIBOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
|
||||
#
|
||||
# libcups2.def (Windows DLL exports file...)
|
||||
#
|
||||
|
||||
libcups2.def: $(LIBOBJS) Makefile
|
||||
echo Generating $@...
|
||||
echo "LIBRARY libcups2" >libcups2.def
|
||||
echo "VERSION 2.11" >>libcups2.def
|
||||
echo "EXPORTS" >>libcups2.def
|
||||
(nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
|
||||
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
|
||||
grep -v -E \
|
||||
-e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel' \
|
||||
-e 'Block$$' | \
|
||||
sed -e '1,$$s/^_//' | sort >>libcups2.def
|
||||
|
||||
|
||||
#
|
||||
# testadmin (dependency on static CUPS library is intentional)
|
||||
#
|
||||
@@ -388,6 +393,16 @@ testarray: testarray.o $(LIBCUPSSTATIC)
|
||||
./testarray
|
||||
|
||||
|
||||
#
|
||||
# testcache (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testcache: testcache.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# testconflicts (dependency on static CUPS library is intentional)
|
||||
#
|
||||
@@ -408,6 +423,16 @@ testcups: testcups.o $(LIBCUPSSTATIC)
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# testdest (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testdest: testdest.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# testfile (dependency on static CUPS library is intentional)
|
||||
#
|
||||
@@ -636,8 +661,9 @@ sloc:
|
||||
#
|
||||
|
||||
include Dependencies
|
||||
tls.o: tls-darwin.c tls-gnutls.c tls-sspi.c
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
|
||||
# End of "$Id: Makefile 12032 2014-07-15 20:37:32Z msweet $".
|
||||
#
|
||||
|
||||
+15
-26
@@ -1,29 +1,18 @@
|
||||
/*
|
||||
* "$Id: adminutil.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: adminutil.c 11598 2014-02-18 18:58:19Z msweet $"
|
||||
*
|
||||
* Administration utility API definitions for CUPS.
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsAdminCreateWindowsPPD() - Create the Windows PPD file for a printer.
|
||||
* cupsAdminExportSamba() - Export a printer to Samba.
|
||||
* cupsAdminGetServerSettings() - Get settings from the server.
|
||||
* cupsAdminSetServerSettings() - Set settings on the server.
|
||||
* do_samba_command() - Do a SAMBA command.
|
||||
* get_cupsd_conf() - Get the current cupsd.conf file.
|
||||
* invalidate_cupsd_cache() - Invalidate the cached cupsd.conf settings.
|
||||
* write_option() - Write a CUPS option to a PPD file.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -52,7 +41,7 @@ static int do_samba_command(const char *command,
|
||||
FILE *logfile);
|
||||
static http_status_t get_cupsd_conf(http_t *http, _cups_globals_t *cg,
|
||||
time_t last_update, char *name,
|
||||
int namelen, int *remote);
|
||||
size_t namelen, int *remote);
|
||||
static void invalidate_cupsd_cache(_cups_globals_t *cg);
|
||||
static void write_option(cups_file_t *dstfp, int order,
|
||||
const char *name, const char *text,
|
||||
@@ -319,7 +308,7 @@ cupsAdminCreateWindowsPPD(
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(ptr + 1, sizeof(line) - (ptr - line + 1),
|
||||
snprintf(ptr + 1, sizeof(line) - (size_t)(ptr - line + 1),
|
||||
"%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
|
||||
|
||||
cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
|
||||
@@ -2120,7 +2109,7 @@ get_cupsd_conf(
|
||||
_cups_globals_t *cg, /* I - Global data */
|
||||
time_t last_update, /* I - Last update time for file */
|
||||
char *name, /* I - Filename buffer */
|
||||
int namesize, /* I - Size of filename buffer */
|
||||
size_t namesize, /* I - Size of filename buffer */
|
||||
int *remote) /* O - Remote file? */
|
||||
{
|
||||
int fd; /* Temporary file descriptor */
|
||||
@@ -2176,7 +2165,7 @@ get_cupsd_conf(
|
||||
* Read cupsd.conf via a HTTP GET request...
|
||||
*/
|
||||
|
||||
if ((fd = cupsTempFd(name, namesize)) < 0)
|
||||
if ((fd = cupsTempFd(name, (int)namesize)) < 0)
|
||||
{
|
||||
*name = '\0';
|
||||
|
||||
@@ -2337,5 +2326,5 @@ write_option(cups_file_t *dstfp, /* I - PPD file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: adminutil.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: adminutil.c 11598 2014-02-18 18:58:19Z msweet $".
|
||||
*/
|
||||
|
||||
+30
-62
@@ -1,56 +1,25 @@
|
||||
/*
|
||||
* "$Id: array.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: array.c 12031 2014-07-15 19:57:59Z msweet $"
|
||||
*
|
||||
* Sorted array routines for CUPS.
|
||||
* Sorted array routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsArrayAdd() - Add an element to the array.
|
||||
* _cupsArrayAddStrings() - Add zero or more comma-delimited strings to an
|
||||
* array.
|
||||
* cupsArrayClear() - Clear the array.
|
||||
* cupsArrayCount() - Get the number of elements in the array.
|
||||
* cupsArrayCurrent() - Return the current element in the array.
|
||||
* cupsArrayDelete() - Free all memory used by the array.
|
||||
* cupsArrayDup() - Duplicate the array.
|
||||
* cupsArrayFind() - Find an element in the array.
|
||||
* cupsArrayFirst() - Get the first element in the array.
|
||||
* cupsArrayGetIndex() - Get the index of the current element.
|
||||
* cupsArrayGetInsert() - Get the index of the last inserted element.
|
||||
* cupsArrayIndex() - Get the N-th element in the array.
|
||||
* cupsArrayInsert() - Insert an element in the array.
|
||||
* cupsArrayLast() - Get the last element in the array.
|
||||
* cupsArrayNew() - Create a new array.
|
||||
* cupsArrayNew2() - Create a new array with hash.
|
||||
* cupsArrayNew3() - Create a new array with hash and/or free function.
|
||||
* _cupsArrayNewStrings() - Create a new array of comma-delimited strings.
|
||||
* cupsArrayNext() - Get the next element in the array.
|
||||
* cupsArrayPrev() - Get the previous element in the array.
|
||||
* cupsArrayRemove() - Remove an element from the array.
|
||||
* cupsArrayRestore() - Reset the current element to the last @link
|
||||
* cupsArraySave@.
|
||||
* cupsArraySave() - Mark the current element for a later @link
|
||||
* cupsArrayRestore@.
|
||||
* cupsArrayUserData() - Return the user data for an array.
|
||||
* cups_array_add() - Insert or append an element to the array.
|
||||
* cups_array_find() - Find an element in the array.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include "string-private.h"
|
||||
#include "debug-private.h"
|
||||
#include "array-private.h"
|
||||
@@ -423,7 +392,7 @@ cupsArrayDup(cups_array_t *a) /* I - Array */
|
||||
* Allocate memory for the elements...
|
||||
*/
|
||||
|
||||
da->elements = malloc(a->num_elements * sizeof(void *));
|
||||
da->elements = malloc((size_t)a->num_elements * sizeof(void *));
|
||||
if (!da->elements)
|
||||
{
|
||||
free(da);
|
||||
@@ -451,7 +420,7 @@ cupsArrayDup(cups_array_t *a) /* I - Array */
|
||||
* Just copy raw pointers...
|
||||
*/
|
||||
|
||||
memcpy(da->elements, a->elements, a->num_elements * sizeof(void *));
|
||||
memcpy(da->elements, a->elements, (size_t)a->num_elements * sizeof(void *));
|
||||
}
|
||||
|
||||
da->num_elements = a->num_elements;
|
||||
@@ -794,7 +763,7 @@ cupsArrayNew3(cups_array_func_t f, /* I - Comparison function or @code NULL@ fo
|
||||
{
|
||||
a->hashfunc = h;
|
||||
a->hashsize = hsize;
|
||||
a->hash = malloc(hsize * sizeof(int));
|
||||
a->hash = malloc((size_t)hsize * sizeof(int));
|
||||
|
||||
if (!a->hash)
|
||||
{
|
||||
@@ -802,7 +771,7 @@ cupsArrayNew3(cups_array_func_t f, /* I - Comparison function or @code NULL@ fo
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
memset(a->hash, -1, hsize * sizeof(int));
|
||||
memset(a->hash, -1, (size_t)hsize * sizeof(int));
|
||||
}
|
||||
|
||||
a->copyfunc = cf;
|
||||
@@ -918,9 +887,9 @@ int /* O - 1 on success, 0 on failure */
|
||||
cupsArrayRemove(cups_array_t *a, /* I - Array */
|
||||
void *e) /* I - Element */
|
||||
{
|
||||
int i, /* Looping var */
|
||||
current, /* Current element */
|
||||
diff; /* Difference */
|
||||
ssize_t i, /* Looping var */
|
||||
current; /* Current element */
|
||||
int diff; /* Difference */
|
||||
|
||||
|
||||
/*
|
||||
@@ -952,7 +921,7 @@ cupsArrayRemove(cups_array_t *a, /* I - Array */
|
||||
|
||||
if (current < a->num_elements)
|
||||
memmove(a->elements + current, a->elements + current + 1,
|
||||
(a->num_elements - current) * sizeof(void *));
|
||||
(size_t)(a->num_elements - current) * sizeof(void *));
|
||||
|
||||
if (current <= a->current)
|
||||
a->current --;
|
||||
@@ -1053,9 +1022,9 @@ cups_array_add(cups_array_t *a, /* I - Array */
|
||||
void *e, /* I - Element to add */
|
||||
int insert) /* I - 1 = insert, 0 = append */
|
||||
{
|
||||
int i, /* Looping var */
|
||||
current, /* Current element */
|
||||
diff; /* Comparison with current element */
|
||||
int i, /* Looping var */
|
||||
current; /* Current element */
|
||||
int diff; /* Comparison with current element */
|
||||
|
||||
|
||||
DEBUG_printf(("7cups_array_add(a=%p, e=%p, insert=%d)", a, e, insert));
|
||||
@@ -1079,7 +1048,7 @@ cups_array_add(cups_array_t *a, /* I - Array */
|
||||
if (a->alloc_elements == 0)
|
||||
{
|
||||
count = 16;
|
||||
temp = malloc(count * sizeof(void *));
|
||||
temp = malloc((size_t)count * sizeof(void *));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1088,10 +1057,10 @@ cups_array_add(cups_array_t *a, /* I - Array */
|
||||
else
|
||||
count = a->alloc_elements + 1024;
|
||||
|
||||
temp = realloc(a->elements, count * sizeof(void *));
|
||||
temp = realloc(a->elements, (size_t)count * sizeof(void *));
|
||||
}
|
||||
|
||||
DEBUG_printf(("9cups_array_add: count=%d", count));
|
||||
DEBUG_printf(("9cups_array_add: count=" CUPS_LLFMT, CUPS_LLCAST count));
|
||||
|
||||
if (!temp)
|
||||
{
|
||||
@@ -1181,7 +1150,7 @@ cups_array_add(cups_array_t *a, /* I - Array */
|
||||
*/
|
||||
|
||||
memmove(a->elements + current + 1, a->elements + current,
|
||||
(a->num_elements - current) * sizeof(void *));
|
||||
(size_t)(a->num_elements - current) * sizeof(void *));
|
||||
|
||||
if (a->current >= current)
|
||||
a->current ++;
|
||||
@@ -1190,11 +1159,11 @@ cups_array_add(cups_array_t *a, /* I - Array */
|
||||
if (a->saved[i] >= current)
|
||||
a->saved[i] ++;
|
||||
|
||||
DEBUG_printf(("9cups_array_add: insert element at index %d...", current));
|
||||
DEBUG_printf(("9cups_array_add: insert element at index " CUPS_LLFMT, CUPS_LLCAST current));
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else
|
||||
DEBUG_printf(("9cups_array_add: append element at %d...", current));
|
||||
DEBUG_printf(("9cups_array_add: append element at " CUPS_LLFMT, CUPS_LLCAST current));
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (a->copyfunc)
|
||||
@@ -1213,8 +1182,7 @@ cups_array_add(cups_array_t *a, /* I - Array */
|
||||
|
||||
#ifdef DEBUG
|
||||
for (current = 0; current < a->num_elements; current ++)
|
||||
DEBUG_printf(("9cups_array_add: a->elements[%d]=%p", current,
|
||||
a->elements[current]));
|
||||
DEBUG_printf(("9cups_array_add: a->elements[" CUPS_LLFMT "]=%p", CUPS_LLCAST current, a->elements[current]));
|
||||
#endif /* DEBUG */
|
||||
|
||||
DEBUG_puts("9cups_array_add: returning 1");
|
||||
@@ -1362,5 +1330,5 @@ cups_array_find(cups_array_t *a, /* I - Array */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: array.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: array.c 12031 2014-07-15 19:57:59Z msweet $".
|
||||
*/
|
||||
|
||||
+19
-31
@@ -1,32 +1,21 @@
|
||||
/*
|
||||
* "$Id: auth.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: auth.c 11776 2014-03-28 19:16:05Z msweet $"
|
||||
*
|
||||
* Authentication functions for CUPS.
|
||||
* Authentication functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
* Jelmer Vernooij.
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
* Jelmer Vernooij.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsDoAuthentication() - Authenticate a request.
|
||||
* _cupsSetNegotiateAuthString() - Set the Kerberos authentication string.
|
||||
* cups_gss_acquire() - Kerberos credentials callback.
|
||||
* cups_gss_getname() - Get CUPS service credentials for
|
||||
* authentication.
|
||||
* cups_gss_printf() - Show debug error messages from GSSAPI.
|
||||
* cups_local_auth() - Get the local authorization certificate if
|
||||
* available/applicable.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -272,7 +261,6 @@ cupsDoAuthentication(
|
||||
char encode[33], /* MD5 buffer */
|
||||
digest[1024]; /* Digest auth data */
|
||||
|
||||
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm);
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "nonce", nonce);
|
||||
|
||||
@@ -453,21 +441,21 @@ _cupsSetNegotiateAuthString(
|
||||
* arbitrarily large credentials...
|
||||
*/
|
||||
|
||||
int authsize = 10 + /* "Negotiate " */
|
||||
output_token.length * 4 / 3 + 1 + /* Base64 */
|
||||
1; /* nul */
|
||||
int authsize = 10 + /* "Negotiate " */
|
||||
(int)output_token.length * 4 / 3 + 1 + 1;
|
||||
/* Base64 + nul */
|
||||
|
||||
httpSetAuthString(http, NULL, NULL);
|
||||
|
||||
if ((http->authstring = malloc(authsize)) == NULL)
|
||||
if ((http->authstring = malloc((size_t)authsize)) == NULL)
|
||||
{
|
||||
http->authstring = http->_authstring;
|
||||
authsize = sizeof(http->_authstring);
|
||||
}
|
||||
|
||||
strlcpy(http->authstring, "Negotiate ", authsize);
|
||||
strlcpy(http->authstring, "Negotiate ", (size_t)authsize);
|
||||
httpEncode64_2(http->authstring + 10, authsize - 10, output_token.value,
|
||||
output_token.length);
|
||||
(int)output_token.length);
|
||||
|
||||
gss_release_buffer(&minor_status, &output_token);
|
||||
}
|
||||
@@ -888,5 +876,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: auth.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: auth.c 11776 2014-03-28 19:16:05Z msweet $".
|
||||
*/
|
||||
|
||||
+12
-18
@@ -1,24 +1,18 @@
|
||||
/*
|
||||
* "$Id: backchannel.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: backchannel.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Backchannel functions for CUPS.
|
||||
* Backchannel functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsBackChannelRead() - Read data from the backchannel.
|
||||
* cupsBackChannelWrite() - Write data to the backchannel.
|
||||
* cups_setup() - Setup select()
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -169,7 +163,7 @@ cupsBackChannelWrite(
|
||||
*/
|
||||
|
||||
buffer += count;
|
||||
total += count;
|
||||
total += (size_t)count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,5 +189,5 @@ cups_setup(fd_set *set, /* I - Set for select() */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: backchannel.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: backchannel.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+14
-28
@@ -1,34 +1,20 @@
|
||||
/*
|
||||
* "$Id: conflicts.c 3933 2012-10-01 03:01:10Z msweet $"
|
||||
* "$Id: conflicts.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Option marking routines for CUPS.
|
||||
* Option marking routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsGetConflicts() - Get a list of conflicting options in a marked
|
||||
* PPD.
|
||||
* cupsResolveConflicts() - Resolve conflicts in a marked PPD.
|
||||
* ppdConflicts() - Check to see if there are any conflicts among
|
||||
* the marked option choices.
|
||||
* ppdInstallableConflict() - Test whether an option choice conflicts with an
|
||||
* installable option.
|
||||
* ppd_is_installable() - Determine whether an option is in the
|
||||
* InstallableOptions group.
|
||||
* ppd_load_constraints() - Load constraints from a PPD file.
|
||||
* ppd_test_constraints() - See if any constraints are active.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -193,7 +179,7 @@ cupsResolveConflicts(
|
||||
tries, /* Number of tries */
|
||||
num_newopts; /* Number of new options */
|
||||
cups_option_t *newopts; /* New options */
|
||||
cups_array_t *active, /* Active constraints */
|
||||
cups_array_t *active = NULL, /* Active constraints */
|
||||
*pass, /* Resolvers for this pass */
|
||||
*resolvers, /* Resolvers we have used */
|
||||
*test; /* Test array for conflicts */
|
||||
@@ -886,7 +872,7 @@ ppd_load_constraints(ppd_file_t *ppd) /* I - PPD file */
|
||||
return;
|
||||
}
|
||||
|
||||
if ((constptr = calloc(i, sizeof(_ppd_cups_uiconst_t))) == NULL)
|
||||
if ((constptr = calloc((size_t)i, sizeof(_ppd_cups_uiconst_t))) == NULL)
|
||||
{
|
||||
free(consts);
|
||||
DEBUG_puts("8ppd_load_constraints: Unable to allocate memory for "
|
||||
@@ -1210,5 +1196,5 @@ ppd_test_constraints(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: conflicts.c 3933 2012-10-01 03:01:10Z msweet $".
|
||||
* End of "$Id: conflicts.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: cups-private.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: cups-private.h 11851 2014-05-07 23:55:35Z msweet $"
|
||||
*
|
||||
* Private definitions for CUPS.
|
||||
*
|
||||
@@ -166,9 +166,9 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
void *server_cert_data;
|
||||
/* Server certificate user data */
|
||||
int server_version, /* Server IPP version */
|
||||
any_root, /* Allow any root */
|
||||
any_root, /* Allow any (e.g., self-signed) root */
|
||||
expired_certs, /* Allow expired certs */
|
||||
expired_root; /* Allow expired root */
|
||||
validate_certs; /* Validate certificates */
|
||||
|
||||
/* util.c */
|
||||
char def_printer[256];
|
||||
@@ -281,5 +281,5 @@ extern char *_cupsUserDefault(char *name, size_t namesize);
|
||||
#endif /* !_CUPS_CUPS_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: cups-private.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: cups-private.h 11851 2014-05-07 23:55:35Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: cups.h 11551 2014-01-29 16:31:35Z msweet $"
|
||||
* "$Id: cups.h 11884 2014-05-16 21:54:22Z msweet $"
|
||||
*
|
||||
* API definitions for CUPS.
|
||||
*
|
||||
@@ -30,10 +30,6 @@
|
||||
typedef off_t ssize_t; /* @private@ */
|
||||
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
|
||||
|
||||
# ifdef __BLOCKS__
|
||||
# include <dispatch/dispatch.h>
|
||||
# endif /* __BLOCKS__ */
|
||||
|
||||
# include "file.h"
|
||||
# include "ipp.h"
|
||||
# include "language.h"
|
||||
@@ -53,10 +49,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0702
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 7
|
||||
# define CUPS_VERSION_PATCH 2
|
||||
# define CUPS_VERSION 2.0000
|
||||
# define CUPS_VERSION_MAJOR 2
|
||||
# define CUPS_VERSION_MINOR 0
|
||||
# define CUPS_VERSION_PATCH 0
|
||||
|
||||
# define CUPS_BC_FD 3
|
||||
/* Back-channel file descriptor for
|
||||
@@ -619,6 +615,11 @@ extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
|
||||
extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
|
||||
extern const char *cupsUserAgent(void) _CUPS_API_1_7;
|
||||
|
||||
/* New in CUPS 2.0 */
|
||||
extern cups_dest_t *cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0;
|
||||
extern const char *cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, cups_dinfo_t *info, unsigned flags, cups_size_t *size) _CUPS_API_2_0;
|
||||
extern int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date) _CUPS_API_2_0;
|
||||
extern int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
@@ -627,5 +628,5 @@ extern const char *cupsUserAgent(void) _CUPS_API_1_7;
|
||||
#endif /* !_CUPS_CUPS_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: cups.h 11551 2014-01-29 16:31:35Z msweet $".
|
||||
* End of "$Id: cups.h 11884 2014-05-16 21:54:22Z msweet $".
|
||||
*/
|
||||
|
||||
+25
-32
@@ -1,24 +1,17 @@
|
||||
/*
|
||||
* "$Id: debug.c 4027 2012-11-16 01:00:05Z msweet $"
|
||||
* "$Id: debug.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Debugging functions for CUPS.
|
||||
* Debugging functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2012 by Apple Inc.
|
||||
* Copyright 2008-2014 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* debug_vsnprintf() - Format a string into a fixed size buffer.
|
||||
* _cups_debug_printf() - Write a formatted line to the log.
|
||||
* _cups_debug_puts() - Write a single line to the log.
|
||||
* _cups_debug_set() - Enable or disable debug logging.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -92,7 +85,7 @@ debug_thread_id(void)
|
||||
* 'debug_vsnprintf()' - Format a string into a fixed size buffer.
|
||||
*/
|
||||
|
||||
static int /* O - Number of bytes formatted */
|
||||
static ssize_t /* O - Number of bytes formatted */
|
||||
debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
size_t bufsize, /* O - Size of output buffer */
|
||||
const char *format, /* I - printf-style format string */
|
||||
@@ -108,7 +101,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
*tptr, /* Pointer into temporary format */
|
||||
temp[1024]; /* Buffer for formatted numbers */
|
||||
char *s; /* Pointer to string */
|
||||
int bytes; /* Total number of bytes needed */
|
||||
ssize_t bytes; /* Total number of bytes needed */
|
||||
|
||||
|
||||
if (!buffer || bufsize < 2 || !format)
|
||||
@@ -149,7 +142,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
format ++;
|
||||
width = va_arg(ap, int);
|
||||
|
||||
snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", width);
|
||||
snprintf(tptr, sizeof(tformat) - (size_t)(tptr - tformat), "%d", width);
|
||||
tptr += strlen(tptr);
|
||||
}
|
||||
else
|
||||
@@ -181,7 +174,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
format ++;
|
||||
prec = va_arg(ap, int);
|
||||
|
||||
snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", prec);
|
||||
snprintf(tptr, sizeof(tformat) - (size_t)(tptr - tformat), "%d", prec);
|
||||
tptr += strlen(tptr);
|
||||
}
|
||||
else
|
||||
@@ -236,7 +229,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
case 'e' :
|
||||
case 'f' :
|
||||
case 'g' :
|
||||
if ((width + 2) > sizeof(temp))
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
sprintf(temp, tformat, va_arg(ap, double));
|
||||
@@ -258,7 +251,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
case 'o' :
|
||||
case 'u' :
|
||||
case 'x' :
|
||||
if ((width + 2) > sizeof(temp))
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
# ifdef HAVE_LONG_LONG
|
||||
@@ -281,7 +274,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
break;
|
||||
|
||||
case 'p' : /* Pointer value */
|
||||
if ((width + 2) > sizeof(temp))
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
sprintf(temp, tformat, va_arg(ap, void *));
|
||||
@@ -301,7 +294,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
if (bufptr)
|
||||
{
|
||||
if (width <= 1)
|
||||
*bufptr++ = va_arg(ap, int);
|
||||
*bufptr++ = (char)va_arg(ap, int);
|
||||
else
|
||||
{
|
||||
if ((bufptr + width) > bufend)
|
||||
@@ -382,7 +375,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
break;
|
||||
|
||||
case 'n' : /* Output number of chars so far */
|
||||
*(va_arg(ap, int *)) = bytes;
|
||||
*(va_arg(ap, int *)) = (int)bytes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -418,7 +411,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
|
||||
va_list ap; /* Pointer to arguments */
|
||||
struct timeval curtime; /* Current time */
|
||||
char buffer[2048]; /* Output buffer */
|
||||
size_t bytes; /* Number of bytes in buffer */
|
||||
ssize_t bytes; /* Number of bytes in buffer */
|
||||
int level; /* Log level in message */
|
||||
|
||||
|
||||
@@ -471,7 +464,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
|
||||
bytes = debug_vsnprintf(buffer + 19, sizeof(buffer) - 20, format, ap) + 19;
|
||||
va_end(ap);
|
||||
|
||||
if (bytes >= (sizeof(buffer) - 1))
|
||||
if ((size_t)bytes >= (sizeof(buffer) - 1))
|
||||
{
|
||||
buffer[sizeof(buffer) - 2] = '\n';
|
||||
bytes = sizeof(buffer) - 1;
|
||||
@@ -487,7 +480,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
|
||||
*/
|
||||
|
||||
_cupsMutexLock(&debug_log_mutex);
|
||||
write(_cups_debug_fd, buffer, bytes);
|
||||
write(_cups_debug_fd, buffer, (size_t)bytes);
|
||||
_cupsMutexUnlock(&debug_log_mutex);
|
||||
}
|
||||
|
||||
@@ -501,7 +494,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
|
||||
{
|
||||
struct timeval curtime; /* Current time */
|
||||
char buffer[2048]; /* Output buffer */
|
||||
size_t bytes; /* Number of bytes in buffer */
|
||||
ssize_t bytes; /* Number of bytes in buffer */
|
||||
int level; /* Log level in message */
|
||||
|
||||
|
||||
@@ -551,7 +544,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
|
||||
(int)(curtime.tv_sec % 60), (int)(curtime.tv_usec / 1000),
|
||||
s);
|
||||
|
||||
if (bytes >= (sizeof(buffer) - 1))
|
||||
if ((size_t)bytes >= (sizeof(buffer) - 1))
|
||||
{
|
||||
buffer[sizeof(buffer) - 2] = '\n';
|
||||
bytes = sizeof(buffer) - 1;
|
||||
@@ -567,7 +560,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
|
||||
*/
|
||||
|
||||
_cupsMutexLock(&debug_log_mutex);
|
||||
write(_cups_debug_fd, buffer, bytes);
|
||||
write(_cups_debug_fd, buffer, (size_t)bytes);
|
||||
_cupsMutexUnlock(&debug_log_mutex);
|
||||
}
|
||||
|
||||
@@ -650,5 +643,5 @@ _cups_debug_set(const char *logfile, /* I - Log file or NULL */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: debug.c 4027 2012-11-16 01:00:05Z msweet $".
|
||||
* End of "$Id: debug.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+17
-19
@@ -1,25 +1,17 @@
|
||||
/*
|
||||
* "$Id: dest-job.c 4274 2013-04-09 20:10:23Z msweet $"
|
||||
* "$Id: dest-job.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Destination job support for CUPS.
|
||||
* Destination job support for CUPS.
|
||||
*
|
||||
* Copyright 2012-2013 by Apple Inc.
|
||||
* Copyright 2012-2014 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/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsCancelDestJob() - Cancel a job on a destination.
|
||||
* cupsCloseDestJob() - Close a job and start printing.
|
||||
* cupsCreateDestJob() - Create a job on a destination.
|
||||
* cupsFinishDestDocument() - Finish the current document.
|
||||
* cupsStartDestDocument() - Start a new document.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -45,6 +37,12 @@ cupsCancelDestJob(http_t *http, /* I - Connection to destination */
|
||||
cups_dest_t *dest, /* I - Destination */
|
||||
int job_id) /* I - Job ID */
|
||||
{
|
||||
/* TODO: Needs to be implemented! */
|
||||
/* Probably also needs to be revved to accept cups_dinfo_t... */
|
||||
(void)http;
|
||||
(void)dest;
|
||||
(void)job_id;
|
||||
|
||||
return (IPP_STATUS_ERROR_NOT_FOUND);
|
||||
}
|
||||
|
||||
@@ -344,7 +342,7 @@ cupsStartDestDocument(
|
||||
if (format)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
"document-format", NULL, format);
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", last_document);
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", (char)last_document);
|
||||
|
||||
cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION);
|
||||
cupsEncodeOptions2(request, num_options, options, IPP_TAG_DOCUMENT);
|
||||
@@ -362,5 +360,5 @@ cupsStartDestDocument(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dest-job.c 4274 2013-04-09 20:10:23Z msweet $".
|
||||
* End of "$Id: dest-job.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+175
-23
@@ -1,28 +1,17 @@
|
||||
/*
|
||||
* "$Id: dest-localization.c 4216 2013-03-11 13:57:36Z msweet $"
|
||||
* "$Id: dest-localization.c 11894 2014-05-23 03:18:00Z msweet $"
|
||||
*
|
||||
* Destination localization support for CUPS.
|
||||
* Destination localization support for CUPS.
|
||||
*
|
||||
* Copyright 2012-2013 by Apple Inc.
|
||||
* Copyright 2012-2014 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/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsLocalizeDestOption() - Get the localized string for a destination
|
||||
* option.
|
||||
* cupsLocalizeDestValue() - Get the localized string for a destination
|
||||
* option+value pair.
|
||||
* cups_create_localizations() - Create the localizations array for a
|
||||
* destination.
|
||||
* cups_read_strings() - Read a pair of strings from a .strings file.
|
||||
* cups_scan_strings() - Scan a quoted string.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -42,6 +31,170 @@ static int cups_read_strings(cups_file_t *fp, char *buffer, size_t bufsize,
|
||||
static char *cups_scan_strings(char *buffer);
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsLocalizeDestMedia()' - Get the localized string for a destination media
|
||||
* size.
|
||||
*
|
||||
* The returned string is stored in the destination information and will become
|
||||
* invalid if the destination information is deleted.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
*/
|
||||
|
||||
const char * /* O - Localized string */
|
||||
cupsLocalizeDestMedia(
|
||||
http_t *http, /* I - Connection to destination */
|
||||
cups_dest_t *dest, /* I - Destination */
|
||||
cups_dinfo_t *dinfo, /* I - Destination information */
|
||||
unsigned flags, /* I - Media flags */
|
||||
cups_size_t *size) /* I - Media size */
|
||||
{
|
||||
cups_lang_t *lang; /* Standard localizations */
|
||||
_cups_message_t key, /* Search key */
|
||||
*match; /* Matching entry */
|
||||
pwg_media_t *pwg; /* PWG media information */
|
||||
cups_array_t *db; /* Media database */
|
||||
_cups_media_db_t *mdb; /* Media database entry */
|
||||
char name[1024], /* Size name */
|
||||
temp[256]; /* Temporary string */
|
||||
const char *lsize, /* Localized media size */
|
||||
*lsource, /* Localized media source */
|
||||
*ltype; /* Localized media type */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!http || !dest || !dinfo || !size)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the localization is cached...
|
||||
*/
|
||||
|
||||
if (!dinfo->localizations)
|
||||
cups_create_localizations(http, dinfo);
|
||||
|
||||
key.id = size->media;
|
||||
if ((match = (_cups_message_t *)cupsArrayFind(dinfo->localizations, &key)) != NULL)
|
||||
return (match->str);
|
||||
|
||||
/*
|
||||
* If not, get the localized size, source, and type strings...
|
||||
*/
|
||||
|
||||
lang = cupsLangDefault();
|
||||
pwg = pwgMediaForSize(size->width, size->length);
|
||||
|
||||
if (pwg->ppd)
|
||||
lsize = _cupsLangString(lang, pwg->ppd);
|
||||
else
|
||||
lsize = NULL;
|
||||
|
||||
if (!lsize)
|
||||
{
|
||||
if ((size->width % 635) == 0 && (size->length % 635) == 0)
|
||||
{
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Use millimeters since the size is not a multiple of 1/4 inch.
|
||||
*/
|
||||
|
||||
snprintf(temp, sizeof(temp), _cupsLangString(lang, _("%d x %d mm")), (size->width + 50) / 100, (size->length + 50) / 100);
|
||||
}
|
||||
|
||||
lsize = temp;
|
||||
}
|
||||
|
||||
if (flags & CUPS_MEDIA_FLAGS_READY)
|
||||
db = dinfo->ready_db;
|
||||
else
|
||||
db = dinfo->media_db;
|
||||
|
||||
DEBUG_printf(("1cupsLocalizeDestMedia: size->media=\"%s\"", size->media));
|
||||
|
||||
for (mdb = (_cups_media_db_t *)cupsArrayFirst(db); mdb; mdb = (_cups_media_db_t *)cupsArrayNext(db))
|
||||
{
|
||||
if (mdb->key && !strcmp(mdb->key, size->media))
|
||||
break;
|
||||
else if (mdb->size_name && !strcmp(mdb->size_name, size->media))
|
||||
break;
|
||||
}
|
||||
|
||||
if (!mdb)
|
||||
{
|
||||
for (mdb = (_cups_media_db_t *)cupsArrayFirst(db); mdb; mdb = (_cups_media_db_t *)cupsArrayNext(db))
|
||||
{
|
||||
if (mdb->width == size->width && mdb->length == size->length && mdb->bottom == size->bottom && mdb->left == size->left && mdb->right == size->right && mdb->top == size->top)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (mdb)
|
||||
{
|
||||
DEBUG_printf(("1cupsLocalizeDestMedia: MATCH mdb%p [key=\"%s\" size_name=\"%s\" source=\"%s\" type=\"%s\" width=%d length=%d B%d L%d R%d T%d]", mdb, mdb->key, mdb->size_name, mdb->source, mdb->type, mdb->width, mdb->length, mdb->bottom, mdb->left, mdb->right, mdb->top));
|
||||
|
||||
lsource = cupsLocalizeDestValue(http, dest, dinfo, "media-source", mdb->source);
|
||||
ltype = cupsLocalizeDestValue(http, dest, dinfo, "media-type", mdb->type);
|
||||
}
|
||||
else
|
||||
{
|
||||
lsource = NULL;
|
||||
ltype = NULL;
|
||||
}
|
||||
|
||||
if (!lsource && !ltype)
|
||||
{
|
||||
if (size->bottom || size->left || size->right || size->top)
|
||||
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (Borderless)")), lsize);
|
||||
else
|
||||
strlcpy(name, lsize, sizeof(name));
|
||||
}
|
||||
else if (!lsource)
|
||||
{
|
||||
if (size->bottom || size->left || size->right || size->top)
|
||||
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (Borderless, %s)")), lsize, ltype);
|
||||
else
|
||||
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (%s)")), lsize, ltype);
|
||||
}
|
||||
else if (!ltype)
|
||||
{
|
||||
if (size->bottom || size->left || size->right || size->top)
|
||||
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (Borderless, %s)")), lsize, lsource);
|
||||
else
|
||||
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (%s)")), lsize, lsource);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (size->bottom || size->left || size->right || size->top)
|
||||
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (Borderless, %s, %s)")), lsize, ltype, lsource);
|
||||
else
|
||||
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (%s, %s)")), lsize, ltype, lsource);
|
||||
}
|
||||
|
||||
if ((match = (_cups_message_t *)calloc(1, sizeof(_cups_message_t))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
match->id = strdup(size->media);
|
||||
match->str = strdup(name);
|
||||
|
||||
cupsArrayAdd(dinfo->localizations, match);
|
||||
|
||||
return (match->str);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsLocalizeDestOption()' - Get the localized string for a destination
|
||||
* option.
|
||||
@@ -356,8 +509,7 @@ cups_scan_strings(char *buffer) /* I - Start of string */
|
||||
* Decode \nnn octal escape...
|
||||
*/
|
||||
|
||||
*bufptr = ((((bufptr[1] - '0') << 3) | (bufptr[2] - '0')) << 3) |
|
||||
(bufptr[3] - '0');
|
||||
*bufptr = (char)(((((bufptr[1] - '0') << 3) | (bufptr[2] - '0')) << 3) | (bufptr[3] - '0'));
|
||||
_cups_strcpy(bufptr + 1, bufptr + 4);
|
||||
}
|
||||
else
|
||||
@@ -383,5 +535,5 @@ cups_scan_strings(char *buffer) /* I - Start of string */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dest-localization.c 4216 2013-03-11 13:57:36Z msweet $".
|
||||
* End of "$Id: dest-localization.c 11894 2014-05-23 03:18:00Z msweet $".
|
||||
*/
|
||||
|
||||
+69
-69
@@ -1,55 +1,17 @@
|
||||
/*
|
||||
* "$Id: dest-options.c 11085 2013-07-03 13:53:05Z msweet $"
|
||||
* "$Id: dest-options.c 11882 2014-05-16 21:02:15Z msweet $"
|
||||
*
|
||||
* Destination option/media support for CUPS.
|
||||
* Destination option/media support for CUPS.
|
||||
*
|
||||
* Copyright 2012-2013 by Apple Inc.
|
||||
* Copyright 2012-2014 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/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsCheckDestSupported() - Check that the option and value are supported
|
||||
* by the destination.
|
||||
* cupsCopyDestConflicts() - Get conflicts and resolutions for a new
|
||||
* option/value pair.
|
||||
* cupsCopyDestInfo() - Get the supported values/capabilities for the
|
||||
* destination.
|
||||
* cupsFindDestDefault() - Find the default value(s) for the given
|
||||
* option.
|
||||
* cupsFindDestReady() - Find the default value(s) for the given
|
||||
* option.
|
||||
* cupsFindDestSupported() - Find the default value(s) for the given
|
||||
* option.
|
||||
* cupsFreeDestInfo() - Free destination information obtained using
|
||||
* @link cupsCopyDestInfo@.
|
||||
* cupsGetDestMediaByIndex() - Get a media name, dimension, and margins for a
|
||||
* specific size.
|
||||
* cupsGetDestMediaByName() - Get media names, dimensions, and margins.
|
||||
* cupsGetDestMediaBySize() - Get media names, dimensions, and margins.
|
||||
* cupsGetDestMediaCount() - Get the number of sizes supported by a
|
||||
* destination.
|
||||
* cupsGetDestMediaDefault() - Get the default size for a destination.
|
||||
* cups_add_dconstres() - Add a constraint or resolver to an array.
|
||||
* cups_compare_dconstres() - Compare to resolver entries.
|
||||
* cups_compare_media_db() - Compare two media entries.
|
||||
* cups_copy_media_db() - Copy a media entry.
|
||||
* cups_create_cached() - Create the media selection cache.
|
||||
* cups_create_constraints() - Create the constraints and resolvers arrays.
|
||||
* cups_create_defaults() - Create the -default option array.
|
||||
* cups_create_media_db() - Create the media database.
|
||||
* cups_free_media_cb() - Free a media entry.
|
||||
* cups_get_media_db() - Lookup the media entry for a given size.
|
||||
* cups_is_close_media_db() - Compare two media entries to see if they are
|
||||
* close to the same size.
|
||||
* cups_test_constraints() - Test constraints.
|
||||
* cups_update_ready() - Update xxx-ready attributes for the printer.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -328,7 +290,7 @@ cupsCopyDestConflicts(
|
||||
*myres = NULL, /* My resolved options */
|
||||
*myoption, /* My current option */
|
||||
*option; /* Current option */
|
||||
cups_array_t *active, /* Active conflicts */
|
||||
cups_array_t *active = NULL, /* Active conflicts */
|
||||
*pass = NULL, /* Resolvers for this pass */
|
||||
*resolvers = NULL, /* Resolvers we have used */
|
||||
*test; /* Test array for conflicts */
|
||||
@@ -669,7 +631,7 @@ cupsCopyDestInfo(
|
||||
version = 11;
|
||||
else if (status == IPP_STATUS_ERROR_BUSY)
|
||||
{
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -886,7 +848,8 @@ cupsGetDestMediaByIndex(
|
||||
unsigned flags, /* I - Media flags */
|
||||
cups_size_t *size) /* O - Media size information */
|
||||
{
|
||||
cups_size_t *nsize; /* Size for N */
|
||||
_cups_media_db_t *nsize; /* Size for N */
|
||||
pwg_media_t *pwg; /* PWG media name for size */
|
||||
|
||||
|
||||
/*
|
||||
@@ -916,13 +879,30 @@ cupsGetDestMediaByIndex(
|
||||
* Copy the size over and return...
|
||||
*/
|
||||
|
||||
if ((nsize = (cups_size_t *)cupsArrayIndex(dinfo->cached_db, n)) == NULL)
|
||||
if ((nsize = (_cups_media_db_t *)cupsArrayIndex(dinfo->cached_db, n)) == NULL)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (nsize->size_name)
|
||||
strlcpy(size->media, nsize->size_name, sizeof(size->media));
|
||||
else if (nsize->key)
|
||||
strlcpy(size->media, nsize->key, sizeof(size->media));
|
||||
else if ((pwg = pwgMediaForSize(nsize->width, nsize->length)) != NULL)
|
||||
strlcpy(size->media, pwg->pwg, sizeof(size->media));
|
||||
else
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
memcpy(size, nsize, sizeof(cups_size_t));
|
||||
size->width = nsize->width;
|
||||
size->length = nsize->length;
|
||||
size->bottom = nsize->bottom;
|
||||
size->left = nsize->left;
|
||||
size->right = nsize->right;
|
||||
size->top = nsize->top;
|
||||
|
||||
return (1);
|
||||
}
|
||||
@@ -1166,7 +1146,7 @@ cupsGetDestMediaDefault(
|
||||
* Fall back to the first matching media size...
|
||||
*/
|
||||
|
||||
return (cupsGetDestMediaByIndex(http, dest, dinfo, flags, 0, size));
|
||||
return (cupsGetDestMediaByIndex(http, dest, dinfo, 0, flags, size));
|
||||
}
|
||||
|
||||
|
||||
@@ -1281,6 +1261,8 @@ cups_create_cached(http_t *http, /* I - Connection to destination */
|
||||
*first; /* First entry this size */
|
||||
|
||||
|
||||
DEBUG_printf(("3cups_create_cached(http=%p, dinfo=%p, flags=%u)", http, dinfo, flags));
|
||||
|
||||
if (dinfo->cached_db)
|
||||
cupsArrayDelete(dinfo->cached_db);
|
||||
|
||||
@@ -1289,11 +1271,15 @@ cups_create_cached(http_t *http, /* I - Connection to destination */
|
||||
|
||||
if (flags & CUPS_MEDIA_FLAGS_READY)
|
||||
{
|
||||
DEBUG_puts("4cups_create_cached: ready media");
|
||||
|
||||
cups_update_ready(http, dinfo);
|
||||
db = dinfo->ready_db;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_puts("4cups_create_cached: supported media");
|
||||
|
||||
if (!dinfo->media_db)
|
||||
cups_create_media_db(dinfo, CUPS_MEDIA_FLAGS_DEFAULT);
|
||||
|
||||
@@ -1304,26 +1290,40 @@ cups_create_cached(http_t *http, /* I - Connection to destination */
|
||||
mdb;
|
||||
mdb = (_cups_media_db_t *)cupsArrayNext(db))
|
||||
{
|
||||
DEBUG_printf(("4cups_create_cached: %p key=\"%s\", type=\"%s\", %dx%d, B%d L%d R%d T%d", mdb, mdb->key, mdb->type, mdb->width, mdb->length, mdb->bottom, mdb->left, mdb->right, mdb->top));
|
||||
|
||||
if (flags & CUPS_MEDIA_FLAGS_BORDERLESS)
|
||||
{
|
||||
if (!mdb->left && !mdb->right && !mdb->top && !mdb->bottom)
|
||||
{
|
||||
DEBUG_printf(("4cups_create_cached: add %p", mdb));
|
||||
cupsArrayAdd(dinfo->cached_db, mdb);
|
||||
}
|
||||
}
|
||||
else if (flags & CUPS_MEDIA_FLAGS_DUPLEX)
|
||||
{
|
||||
if (first->width != mdb->width || first->length != mdb->length)
|
||||
{
|
||||
DEBUG_printf(("4cups_create_cached: add %p", first));
|
||||
cupsArrayAdd(dinfo->cached_db, first);
|
||||
first = mdb;
|
||||
}
|
||||
else if (mdb->left >= first->left && mdb->right >= first->right &&
|
||||
mdb->top >= first->top && mdb->bottom >= first->bottom)
|
||||
else if (mdb->left >= first->left && mdb->right >= first->right && mdb->top >= first->top && mdb->bottom >= first->bottom &&
|
||||
(mdb->left != first->left || mdb->right != first->right || mdb->top != first->top || mdb->bottom != first->bottom))
|
||||
first = mdb;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("4cups_create_cached: add %p", mdb));
|
||||
cupsArrayAdd(dinfo->cached_db, mdb);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & CUPS_MEDIA_FLAGS_DUPLEX)
|
||||
{
|
||||
DEBUG_printf(("4cups_create_cached: add %p", first));
|
||||
cupsArrayAdd(dinfo->cached_db, first);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1757,8 +1757,7 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
|
||||
* Look for the smallest margins...
|
||||
*/
|
||||
|
||||
if (best->left != 0 || best->right != 0 || best->top != 0 ||
|
||||
best->bottom != 0)
|
||||
if (best->left != 0 || best->right != 0 || best->top != 0 || best->bottom != 0)
|
||||
{
|
||||
for (mdb = (_cups_media_db_t *)cupsArrayNext(db);
|
||||
mdb && !cups_compare_media_db(mdb, &key);
|
||||
@@ -1795,7 +1794,8 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
|
||||
mdb = (_cups_media_db_t *)cupsArrayNext(db))
|
||||
{
|
||||
if (mdb->left >= best->left && mdb->right >= best->right &&
|
||||
mdb->top >= best->top && mdb->bottom >= best->bottom)
|
||||
mdb->top >= best->top && mdb->bottom >= best->bottom &&
|
||||
(mdb->bottom != best->bottom || mdb->left != best->left || mdb->right != best->right || mdb->top != best->top))
|
||||
best = mdb;
|
||||
}
|
||||
}
|
||||
@@ -1810,11 +1810,10 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
|
||||
mdb = (_cups_media_db_t *)cupsArrayNext(db))
|
||||
{
|
||||
if (((mdb->left > 0 && mdb->left <= best->left) || best->left == 0) &&
|
||||
((mdb->right > 0 && mdb->right <= best->right) ||
|
||||
best->right == 0) &&
|
||||
((mdb->right > 0 && mdb->right <= best->right) || best->right == 0) &&
|
||||
((mdb->top > 0 && mdb->top <= best->top) || best->top == 0) &&
|
||||
((mdb->bottom > 0 && mdb->bottom <= best->bottom) ||
|
||||
best->bottom == 0))
|
||||
((mdb->bottom > 0 && mdb->bottom <= best->bottom) || best->bottom == 0) &&
|
||||
(mdb->bottom != best->bottom || mdb->left != best->left || mdb->right != best->right || mdb->top != best->top))
|
||||
best = mdb;
|
||||
}
|
||||
}
|
||||
@@ -1892,7 +1891,8 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
|
||||
mdb = (_cups_media_db_t *)cupsArrayNext(db))
|
||||
{
|
||||
if (mdb->left <= best->left && mdb->right <= best->right &&
|
||||
mdb->top <= best->top && mdb->bottom <= best->bottom)
|
||||
mdb->top <= best->top && mdb->bottom <= best->bottom &&
|
||||
(mdb->bottom != best->bottom || mdb->left != best->left || mdb->right != best->right || mdb->top != best->top))
|
||||
{
|
||||
best = mdb;
|
||||
if (mdb->left == 0 && mdb->right == 0 && mdb->bottom == 0 &&
|
||||
@@ -1913,7 +1913,8 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
|
||||
mdb = (_cups_media_db_t *)cupsArrayNext(db))
|
||||
{
|
||||
if (mdb->left >= best->left && mdb->right >= best->right &&
|
||||
mdb->top >= best->top && mdb->bottom >= best->bottom)
|
||||
mdb->top >= best->top && mdb->bottom >= best->bottom &&
|
||||
(mdb->bottom != best->bottom || mdb->left != best->left || mdb->right != best->right || mdb->top != best->top))
|
||||
best = mdb;
|
||||
}
|
||||
}
|
||||
@@ -1932,7 +1933,8 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
|
||||
best->right == 0) &&
|
||||
((mdb->top > 0 && mdb->top <= best->top) || best->top == 0) &&
|
||||
((mdb->bottom > 0 && mdb->bottom <= best->bottom) ||
|
||||
best->bottom == 0))
|
||||
best->bottom == 0) &&
|
||||
(mdb->bottom != best->bottom || mdb->left != best->left || mdb->right != best->right || mdb->top != best->top))
|
||||
best = mdb;
|
||||
}
|
||||
}
|
||||
@@ -2246,9 +2248,7 @@ cups_update_ready(http_t *http, /* I - Connection to destination */
|
||||
dinfo->uri);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, cupsUser());
|
||||
ippAddStrings(request, IPP_TAG_OPERATION,
|
||||
IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "requested-attributes",
|
||||
(int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_CONST_TAG(IPP_TAG_KEYWORD), "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
|
||||
|
||||
dinfo->ready_attrs = cupsDoRequest(http, request, dinfo->resource);
|
||||
|
||||
@@ -2267,5 +2267,5 @@ cups_update_ready(http_t *http, /* I - Connection to destination */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dest-options.c 11085 2013-07-03 13:53:05Z msweet $".
|
||||
* End of "$Id: dest-options.c 11882 2014-05-16 21:02:15Z msweet $".
|
||||
*/
|
||||
|
||||
+129
-107
@@ -1,85 +1,18 @@
|
||||
/*
|
||||
* "$Id: dest.c 11688 2014-03-05 21:11:32Z msweet $"
|
||||
* "$Id: dest.c 11959 2014-06-26 18:30:19Z msweet $"
|
||||
*
|
||||
* User-defined destination (and option) support for CUPS.
|
||||
* User-defined destination (and option) support for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsAddDest() - Add a destination to the list of
|
||||
* destinations.
|
||||
* _cupsAppleCopyDefaultPaperID() - Get the default paper ID.
|
||||
* _cupsAppleCopyDefaultPrinter() - Get the default printer at this location.
|
||||
* _cupsAppleGetUseLastPrinter() - Get whether to use the last used printer.
|
||||
* _cupsAppleSetDefaultPaperID() - Set the default paper id.
|
||||
* _cupsAppleSetDefaultPrinter() - Set the default printer for this
|
||||
* location.
|
||||
* _cupsAppleSetUseLastPrinter() - Set whether to use the last used printer.
|
||||
* cupsConnectDest() - Connect to the server for a destination.
|
||||
* cupsConnectDestBlock() - Connect to the server for a destination.
|
||||
* cupsCopyDest() - Copy a destination.
|
||||
* cupsEnumDests() - Enumerate available destinations with a
|
||||
* callback function.
|
||||
* cupsEnumDestsBlock() - Enumerate available destinations with a
|
||||
* block.
|
||||
* cupsFreeDests() - Free the memory used by the list of
|
||||
* destinations.
|
||||
* cupsGetDest() - Get the named destination from the list.
|
||||
* _cupsGetDestResource() - Get the resource path and URI for a
|
||||
* destination.
|
||||
* _cupsGetDests() - Get destinations from a server.
|
||||
* cupsGetDests() - Get the list of destinations from the
|
||||
* default server.
|
||||
* cupsGetDests2() - Get the list of destinations from the
|
||||
* specified server.
|
||||
* cupsGetNamedDest() - Get options for the named destination.
|
||||
* cupsRemoveDest() - Remove a destination from the destination
|
||||
* list.
|
||||
* cupsSetDefaultDest() - Set the default destination.
|
||||
* cupsSetDests() - Save the list of destinations for the
|
||||
* default server.
|
||||
* cupsSetDests2() - Save the list of destinations for the
|
||||
* specified server.
|
||||
* _cupsUserDefault() - Get the user default printer from
|
||||
* environment variables and location
|
||||
* information.
|
||||
* appleCopyLocations() - Copy the location history array.
|
||||
* appleCopyNetwork() - Get the network ID for the current
|
||||
* location.
|
||||
* appleGetPaperSize() - Get the default paper size.
|
||||
* appleGetPrinter() - Get a printer from the history array.
|
||||
* cups_add_dest() - Add a destination to the array.
|
||||
* cups_block_cb() - Enumeration callback for block API.
|
||||
* cups_compare_dests() - Compare two destinations.
|
||||
* cups_dnssd_browse_cb() - Browse for printers.
|
||||
* cups_dnssd_browse_cb() - Browse for printers.
|
||||
* cups_dnssd_client_cb() - Avahi client callback function.
|
||||
* cups_dnssd_compare_device() - Compare two devices.
|
||||
* cups_dnssd_free_device() - Free the memory used by a device.
|
||||
* cups_dnssd_get_device() - Lookup a device and create it as needed.
|
||||
* cups_dnssd_local_cb() - Browse for local printers.
|
||||
* cups_dnssd_poll_cb() - Wait for input on the specified file
|
||||
* descriptors.
|
||||
* cups_dnssd_query_cb() - Process query data.
|
||||
* cups_dnssd_resolve() - Resolve a Bonjour printer URI.
|
||||
* cups_dnssd_resolve_cb() - See if we should continue resolving.
|
||||
* cups_dnssd_unquote() - Unquote a name string.
|
||||
* cups_find_dest() - Find a destination using a binary search.
|
||||
* cups_get_default() - Get the default destination from an
|
||||
* lpoptions file.
|
||||
* cups_get_dests() - Get destinations from a file.
|
||||
* cups_make_string() - Make a comma-separated string of values
|
||||
* from an IPP attribute.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -334,7 +267,7 @@ cupsAddDest(const char *name, /* I - Destination name */
|
||||
* Copy options from parent...
|
||||
*/
|
||||
|
||||
dest->options = calloc(sizeof(cups_option_t), parent->num_options);
|
||||
dest->options = calloc(sizeof(cups_option_t), (size_t)parent->num_options);
|
||||
|
||||
if (dest->options)
|
||||
{
|
||||
@@ -672,9 +605,9 @@ cupsConnectDest(
|
||||
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
|
||||
userpass, sizeof(userpass), hostname, sizeof(hostname),
|
||||
&port, resource, resourcesize) < HTTP_URI_STATUS_OK)
|
||||
&port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer URI."), 1);
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
|
||||
|
||||
if (cb)
|
||||
(*cb)(user_data, CUPS_DEST_FLAGS_UNCONNECTED | CUPS_DEST_FLAGS_ERROR,
|
||||
@@ -842,8 +775,7 @@ cupsCopyDest(cups_dest_t *dest,
|
||||
|
||||
if (new_dest)
|
||||
{
|
||||
if ((new_dest->options = calloc(sizeof(cups_option_t),
|
||||
dest->num_options)) == NULL)
|
||||
if ((new_dest->options = calloc(sizeof(cups_option_t), (size_t)dest->num_options)) == NULL)
|
||||
return (cupsRemoveDest(dest->name, dest->instance, num_dests, dests));
|
||||
|
||||
new_dest->num_options = dest->num_options;
|
||||
@@ -1359,9 +1291,9 @@ _cupsGetDestResource(
|
||||
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
|
||||
userpass, sizeof(userpass), hostname, sizeof(hostname),
|
||||
&port, resource, resourcesize) < HTTP_URI_STATUS_OK)
|
||||
&port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer URI."), 1);
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -1370,6 +1302,100 @@ _cupsGetDestResource(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetDestWithURI()' - Get a destination associated with a URI.
|
||||
*
|
||||
* "name" is the desired name for the printer. If @code NULL@, a name will be
|
||||
* created using the URI.
|
||||
*
|
||||
* "uri" is the "ipp" or "ipps" URI for the printer.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
*/
|
||||
|
||||
cups_dest_t * /* O - Destination or @code NULL@ */
|
||||
cupsGetDestWithURI(const char *name, /* I - Desired printer name or @code NULL@ */
|
||||
const char *uri) /* I - URI for the printer */
|
||||
{
|
||||
cups_dest_t *dest; /* New destination */
|
||||
char temp[1024], /* Temporary string */
|
||||
scheme[256], /* Scheme from URI */
|
||||
userpass[256], /* Username:password from URI */
|
||||
hostname[256], /* Hostname from URI */
|
||||
resource[1024], /* Resource path from URI */
|
||||
*ptr; /* Pointer into string */
|
||||
int port; /* Port number from URI */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!uri)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), hostname, sizeof(hostname), &port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK ||
|
||||
(strncmp(uri, "ipp://", 6) && strncmp(uri, "ipps://", 7)))
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (!name)
|
||||
{
|
||||
/*
|
||||
* Create the name from the URI...
|
||||
*/
|
||||
|
||||
if (strstr(hostname, "._tcp"))
|
||||
{
|
||||
/*
|
||||
* Use the service instance name...
|
||||
*/
|
||||
|
||||
if ((ptr = strchr(hostname, '.')) != NULL)
|
||||
*ptr = '\0';
|
||||
|
||||
name = hostname;
|
||||
}
|
||||
else if (!strncmp(resource, "/classes/", 9))
|
||||
{
|
||||
snprintf(temp, sizeof(temp), "%s @ %s", resource + 9, hostname);
|
||||
name = temp;
|
||||
}
|
||||
else if (!strncmp(resource, "/printers/", 10))
|
||||
{
|
||||
snprintf(temp, sizeof(temp), "%s @ %s", resource + 10, hostname);
|
||||
name = temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
name = hostname;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the destination...
|
||||
*/
|
||||
|
||||
if ((dest = calloc(1, sizeof(cups_dest_t))) == NULL)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
dest->name = _cupsStrAlloc(name);
|
||||
dest->num_options = cupsAddOption("printer-uri-supported", uri, dest->num_options, &(dest->options));
|
||||
dest->num_options = cupsAddOption("printer-info", name, dest->num_options, &(dest->options));
|
||||
|
||||
return (dest);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsGetDests()' - Get destinations from a server.
|
||||
*
|
||||
@@ -1486,10 +1512,8 @@ _cupsGetDests(http_t *http, /* I - Connection to server or
|
||||
}
|
||||
else if (mask)
|
||||
{
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type",
|
||||
type);
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type-mask",
|
||||
mask);
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type", (int)type);
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type-mask", (int)mask);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1734,10 +1758,10 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
if (num_dests > 0)
|
||||
{
|
||||
num_reals = num_dests;
|
||||
reals = calloc(num_reals, sizeof(cups_dest_t));
|
||||
reals = calloc((size_t)num_reals, sizeof(cups_dest_t));
|
||||
|
||||
if (reals)
|
||||
memcpy(reals, *dests, num_reals * sizeof(cups_dest_t));
|
||||
memcpy(reals, *dests, (size_t)num_reals * sizeof(cups_dest_t));
|
||||
else
|
||||
num_reals = 0;
|
||||
}
|
||||
@@ -2008,10 +2032,10 @@ cupsRemoveDest(const char *name, /* I - Destination name */
|
||||
|
||||
num_dests --;
|
||||
|
||||
i = dest - *dests;
|
||||
i = (int)(dest - *dests);
|
||||
|
||||
if (i < num_dests)
|
||||
memmove(dest, dest + 1, (num_dests - i) * sizeof(cups_dest_t));
|
||||
memmove(dest, dest + 1, (size_t)(num_dests - i) * sizeof(cups_dest_t));
|
||||
|
||||
return (num_dests);
|
||||
}
|
||||
@@ -2345,7 +2369,7 @@ _cupsUserDefault(char *name, /* I - Name buffer */
|
||||
|
||||
if ((locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
|
||||
{
|
||||
CFStringGetCString(locprinter, name, namesize, kCFStringEncodingUTF8);
|
||||
CFStringGetCString(locprinter, name, (CFIndex)namesize, kCFStringEncodingUTF8);
|
||||
CFRelease(locprinter);
|
||||
}
|
||||
else
|
||||
@@ -2553,7 +2577,7 @@ cups_add_dest(const char *name, /* I - Name of destination */
|
||||
if (*num_dests == 0)
|
||||
dest = malloc(sizeof(cups_dest_t));
|
||||
else
|
||||
dest = realloc(*dests, sizeof(cups_dest_t) * (*num_dests + 1));
|
||||
dest = realloc(*dests, sizeof(cups_dest_t) * (size_t)(*num_dests + 1));
|
||||
|
||||
if (!dest)
|
||||
return (NULL);
|
||||
@@ -2580,8 +2604,7 @@ cups_add_dest(const char *name, /* I - Name of destination */
|
||||
*/
|
||||
|
||||
if (insert < *num_dests)
|
||||
memmove(*dests + insert + 1, *dests + insert,
|
||||
(*num_dests - insert) * sizeof(cups_dest_t));
|
||||
memmove(*dests + insert + 1, *dests + insert, (size_t)(*num_dests - insert) * sizeof(cups_dest_t));
|
||||
|
||||
(*num_dests) ++;
|
||||
|
||||
@@ -3186,7 +3209,7 @@ cups_dnssd_query_cb(
|
||||
txtnext = txt + txtlen;
|
||||
|
||||
for (ptr = key; txt < txtnext && *txt != '='; txt ++)
|
||||
*ptr++ = *txt;
|
||||
*ptr++ = (char)*txt;
|
||||
*ptr = '\0';
|
||||
|
||||
if (txt < txtnext && *txt == '=')
|
||||
@@ -3194,7 +3217,7 @@ cups_dnssd_query_cb(
|
||||
txt ++;
|
||||
|
||||
if (txt < txtnext)
|
||||
memcpy(value, txt, txtnext - txt);
|
||||
memcpy(value, txt, (size_t)(txtnext - txt));
|
||||
value[txtnext - txt] = '\0';
|
||||
|
||||
DEBUG_printf(("6cups_dnssd_query_cb: %s=%s", key, value));
|
||||
@@ -3271,7 +3294,7 @@ cups_dnssd_query_cb(
|
||||
*/
|
||||
|
||||
saw_printer_type = 1;
|
||||
type = strtol(value, NULL, 0);
|
||||
type = (cups_ptype_t)strtol(value, NULL, 0);
|
||||
}
|
||||
else if (!saw_printer_type)
|
||||
{
|
||||
@@ -3419,7 +3442,7 @@ cups_dnssd_resolve(
|
||||
_HTTP_RESOLVE_FQDN, cups_dnssd_resolve_cb,
|
||||
&resolve)) == NULL)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to resolve printer URI."), 1);
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to resolve printer-uri."), 1);
|
||||
|
||||
if (cb)
|
||||
(*cb)(user_data, CUPS_DEST_FLAGS_UNCONNECTED | CUPS_DEST_FLAGS_ERROR,
|
||||
@@ -3873,22 +3896,21 @@ cups_make_string(
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
snprintf(ptr, end - ptr + 1, "%d", attr->values[i].integer);
|
||||
snprintf(ptr, (size_t)(end - ptr + 1), "%d", attr->values[i].integer);
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
if (attr->values[i].boolean)
|
||||
strlcpy(ptr, "true", end - ptr + 1);
|
||||
strlcpy(ptr, "true", (size_t)(end - ptr + 1));
|
||||
else
|
||||
strlcpy(ptr, "false", end - ptr + 1);
|
||||
strlcpy(ptr, "false", (size_t)(end - ptr + 1));
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
if (attr->values[i].range.lower == attr->values[i].range.upper)
|
||||
snprintf(ptr, end - ptr + 1, "%d", attr->values[i].range.lower);
|
||||
snprintf(ptr, (size_t)(end - ptr + 1), "%d", attr->values[i].range.lower);
|
||||
else
|
||||
snprintf(ptr, end - ptr + 1, "%d-%d", attr->values[i].range.lower,
|
||||
attr->values[i].range.upper);
|
||||
snprintf(ptr, (size_t)(end - ptr + 1), "%d-%d", attr->values[i].range.lower, attr->values[i].range.upper);
|
||||
break;
|
||||
|
||||
default :
|
||||
@@ -3920,5 +3942,5 @@ cups_make_string(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dest.c 11688 2014-03-05 21:11:32Z msweet $".
|
||||
* End of "$Id: dest.c 11959 2014-06-26 18:30:19Z msweet $".
|
||||
*/
|
||||
|
||||
+28
-51
@@ -1,37 +1,20 @@
|
||||
/*
|
||||
* "$Id: emit.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: emit.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* PPD code emission routines for CUPS.
|
||||
* PPD code emission routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
* PostScript is a trademark of Adobe Systems, Inc.
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* ppdCollect() - Collect all marked options that reside in the
|
||||
* specified section.
|
||||
* ppdCollect2() - Collect all marked options that reside in the
|
||||
* specified section and minimum order.
|
||||
* ppdEmit() - Emit code for marked options to a file.
|
||||
* ppdEmitAfterOrder() - Emit a subset of the code for marked options to a
|
||||
* file.
|
||||
* ppdEmitFd() - Emit code for marked options to a file.
|
||||
* ppdEmitJCL() - Emit code for JCL options to a file.
|
||||
* ppdEmitJCLEnd() - Emit JCLEnd code to a file.
|
||||
* ppdEmitString() - Get a string containing the code for marked
|
||||
* options.
|
||||
* ppd_compare_cparams() - Compare the order of two custom parameters.
|
||||
* ppd_handle_media() - Handle media selection...
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -121,13 +104,13 @@ ppdCollect2(ppd_file_t *ppd, /* I - PPD file data */
|
||||
|
||||
count = 0;
|
||||
if ((collect = calloc(sizeof(ppd_choice_t *),
|
||||
cupsArrayCount(ppd->marked))) == NULL)
|
||||
(size_t)cupsArrayCount(ppd->marked))) == NULL)
|
||||
{
|
||||
*choices = NULL;
|
||||
return (0);
|
||||
}
|
||||
|
||||
if ((orders = calloc(sizeof(float), cupsArrayCount(ppd->marked))) == NULL)
|
||||
if ((orders = calloc(sizeof(float), (size_t)cupsArrayCount(ppd->marked))) == NULL)
|
||||
{
|
||||
*choices = NULL;
|
||||
free(collect);
|
||||
@@ -358,7 +341,7 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
|
||||
break;
|
||||
}
|
||||
|
||||
buflength -= bytes;
|
||||
buflength -= (size_t)bytes;
|
||||
bufptr += bytes;
|
||||
}
|
||||
|
||||
@@ -831,8 +814,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_INT :
|
||||
snprintf(bufptr, bufend - bufptr, "%d",
|
||||
cparam->current.custom_int);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr), "%d", cparam->current.custom_int);
|
||||
bufptr += strlen(bufptr);
|
||||
break;
|
||||
|
||||
@@ -841,8 +823,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
case PPD_CUSTOM_STRING :
|
||||
if (cparam->current.custom_string)
|
||||
{
|
||||
strlcpy(bufptr, cparam->current.custom_string,
|
||||
bufend - bufptr);
|
||||
strlcpy(bufptr, cparam->current.custom_string, (size_t)(bufend - bufptr));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
break;
|
||||
@@ -862,7 +843,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* Otherwise just copy the option code directly...
|
||||
*/
|
||||
|
||||
strlcpy(bufptr, choices[i]->code, bufend - bufptr + 1);
|
||||
strlcpy(bufptr, choices[i]->code, (size_t)(bufend - bufptr + 1));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
}
|
||||
@@ -873,7 +854,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* options...
|
||||
*/
|
||||
|
||||
strlcpy(bufptr, "[{\n", bufend - bufptr + 1);
|
||||
strlcpy(bufptr, "[{\n", (size_t)(bufend - bufptr + 1));
|
||||
bufptr += 3;
|
||||
|
||||
/*
|
||||
@@ -898,8 +879,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
float values[5]; /* Values for custom command */
|
||||
|
||||
|
||||
strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n",
|
||||
bufend - bufptr + 1);
|
||||
strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n", (size_t)(bufend - bufptr + 1));
|
||||
bufptr += 37;
|
||||
|
||||
size = ppdPageSize(ppd, "Custom");
|
||||
@@ -994,7 +974,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* Level 2 command sequence...
|
||||
*/
|
||||
|
||||
strlcpy(bufptr, ppd_custom_code, bufend - bufptr + 1);
|
||||
strlcpy(bufptr, ppd_custom_code, (size_t)(bufend - bufptr + 1));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
}
|
||||
@@ -1017,8 +997,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
|
||||
cupsArrayAdd(params, cparam);
|
||||
|
||||
snprintf(bufptr, bufend - bufptr + 1,
|
||||
"%%%%BeginFeature: *Custom%s True\n", coption->keyword);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%%%%BeginFeature: *Custom%s True\n", coption->keyword);
|
||||
bufptr += strlen(bufptr);
|
||||
|
||||
for (cparam = (ppd_cparam_t *)cupsArrayFirst(params);
|
||||
@@ -1037,8 +1016,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_INT :
|
||||
snprintf(bufptr, bufend - bufptr + 1, "%d\n",
|
||||
cparam->current.custom_int);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d\n", cparam->current.custom_int);
|
||||
bufptr += strlen(bufptr);
|
||||
break;
|
||||
|
||||
@@ -1053,7 +1031,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
if (*s < ' ' || *s == '(' || *s == ')' || *s >= 127)
|
||||
{
|
||||
snprintf(bufptr, bufend - bufptr + 1, "\\%03o", *s & 255);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr + 1), "\\%03o", *s & 255);
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
else
|
||||
@@ -1071,15 +1049,14 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(bufptr, bufend - bufptr + 1, "%%%%BeginFeature: *%s %s\n",
|
||||
choices[i]->option->keyword, choices[i]->choice);
|
||||
snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%%%%BeginFeature: *%s %s\n", choices[i]->option->keyword, choices[i]->choice);
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
|
||||
if (choices[i]->code && choices[i]->code[0])
|
||||
{
|
||||
j = (int)strlen(choices[i]->code);
|
||||
memcpy(bufptr, choices[i]->code, j);
|
||||
memcpy(bufptr, choices[i]->code, (size_t)j);
|
||||
bufptr += j;
|
||||
|
||||
if (choices[i]->code[j - 1] != '\n')
|
||||
@@ -1087,7 +1064,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
}
|
||||
|
||||
strlcpy(bufptr, "%%EndFeature\n"
|
||||
"} stopped cleartomark\n", bufend - bufptr + 1);
|
||||
"} stopped cleartomark\n", (size_t)(bufend - bufptr + 1));
|
||||
bufptr += strlen(bufptr);
|
||||
|
||||
DEBUG_printf(("2ppdEmitString: Offset in string is %d...",
|
||||
@@ -1095,7 +1072,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy(bufptr, choices[i]->code, bufend - bufptr + 1);
|
||||
strlcpy(bufptr, choices[i]->code, (size_t)(bufend - bufptr + 1));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
|
||||
@@ -1225,5 +1202,5 @@ ppd_handle_media(ppd_file_t *ppd) /* I - PPD file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: emit.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: emit.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+18
-47
@@ -1,26 +1,18 @@
|
||||
/*
|
||||
* "$Id: encode.c 11734 2014-03-25 18:01:47Z msweet $"
|
||||
* "$Id: encode.c 11733 2014-03-25 18:01:41Z msweet $"
|
||||
*
|
||||
* Option encoding routines for CUPS.
|
||||
* Option encoding routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsEncodeOptions() - Encode printer options into IPP attributes.
|
||||
* cupsEncodeOptions2() - Encode printer options into IPP attributes for
|
||||
* a group.
|
||||
* _ippFindOption() - Find the attribute information for an option.
|
||||
* compare_ipp_options() - Compare two IPP options.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -80,17 +72,6 @@ static const ipp_op_t ipp_all_print[] =
|
||||
IPP_OP_CUPS_NONE
|
||||
};
|
||||
|
||||
static const ipp_op_t ipp_all_limit[] =
|
||||
{
|
||||
IPP_OP_GET_JOBS,
|
||||
IPP_OP_GET_PRINTER_ATTRIBUTES,
|
||||
IPP_OP_CUPS_GET_PRINTERS,
|
||||
IPP_OP_CUPS_GET_CLASSES,
|
||||
IPP_OP_CUPS_GET_DEVICES,
|
||||
IPP_OP_CUPS_GET_PPDS,
|
||||
IPP_OP_CUPS_NONE
|
||||
};
|
||||
|
||||
static const ipp_op_t ipp_set_printer[] =
|
||||
{
|
||||
IPP_OP_SET_PRINTER_ATTRIBUTES,
|
||||
@@ -99,18 +80,6 @@ static const ipp_op_t ipp_set_printer[] =
|
||||
IPP_OP_CUPS_NONE
|
||||
};
|
||||
|
||||
static const ipp_op_t cups_am_class[] =
|
||||
{
|
||||
IPP_OP_CUPS_ADD_MODIFY_CLASS,
|
||||
IPP_OP_CUPS_NONE
|
||||
};
|
||||
|
||||
static const ipp_op_t cups_am_printer[] =
|
||||
{
|
||||
IPP_OP_CUPS_ADD_MODIFY_PRINTER,
|
||||
IPP_OP_CUPS_NONE
|
||||
};
|
||||
|
||||
static const ipp_op_t cups_schemes[] =
|
||||
{
|
||||
IPP_OP_CUPS_GET_DEVICES,
|
||||
@@ -182,6 +151,8 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 0, "job-accounting-user-id", IPP_TAG_NAME, IPP_TAG_JOB },
|
||||
{ 0, "job-accounting-user-id-default", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 0, "job-authorization-uri", IPP_TAG_URI, IPP_TAG_OPERATION },
|
||||
{ 0, "job-cancel-after", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "job-cancel-after-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "job-hold-until", IPP_TAG_KEYWORD, IPP_TAG_JOB },
|
||||
{ 0, "job-id", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
|
||||
{ 0, "job-impressions", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
|
||||
@@ -678,7 +649,7 @@ cupsEncodeOptions2(
|
||||
* Integer/enumeration value...
|
||||
*/
|
||||
|
||||
attr->values[j].integer = strtol(val, &s, 10);
|
||||
attr->values[j].integer = (int)strtol(val, &s, 10);
|
||||
|
||||
DEBUG_printf(("2cupsEncodeOptions2: Added integer option value "
|
||||
"%d...", attr->values[j].integer));
|
||||
@@ -720,12 +691,12 @@ cupsEncodeOptions2(
|
||||
s = val;
|
||||
}
|
||||
else
|
||||
attr->values[j].range.lower = strtol(val, &s, 10);
|
||||
attr->values[j].range.lower = (int)strtol(val, &s, 10);
|
||||
|
||||
if (*s == '-')
|
||||
{
|
||||
if (s[1])
|
||||
attr->values[j].range.upper = strtol(s + 1, NULL, 10);
|
||||
attr->values[j].range.upper = (int)strtol(s + 1, NULL, 10);
|
||||
else
|
||||
attr->values[j].range.upper = 2147483647;
|
||||
}
|
||||
@@ -742,10 +713,10 @@ cupsEncodeOptions2(
|
||||
* Resolution...
|
||||
*/
|
||||
|
||||
attr->values[j].resolution.xres = strtol(val, &s, 10);
|
||||
attr->values[j].resolution.xres = (int)strtol(val, &s, 10);
|
||||
|
||||
if (*s == 'x')
|
||||
attr->values[j].resolution.yres = strtol(s + 1, &s, 10);
|
||||
attr->values[j].resolution.yres = (int)strtol(s + 1, &s, 10);
|
||||
else
|
||||
attr->values[j].resolution.yres = attr->values[j].resolution.xres;
|
||||
|
||||
@@ -878,5 +849,5 @@ compare_ipp_options(_ipp_option_t *a, /* I - First option */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: encode.c 11734 2014-03-25 18:01:47Z msweet $".
|
||||
* End of "$Id: encode.c 11733 2014-03-25 18:01:41Z msweet $".
|
||||
*/
|
||||
|
||||
+15
-15
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* "$Id: file-private.h 11642 2014-02-27 15:57:59Z msweet $"
|
||||
* "$Id: file-private.h 11627 2014-02-20 16:15:09Z msweet $"
|
||||
*
|
||||
* Private file definitions for CUPS.
|
||||
* Private file definitions for CUPS.
|
||||
*
|
||||
* Since stdio files max out at 256 files on many systems, we have to
|
||||
* write similar functions without this limit. At the same time, using
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* gzip'd print files, PPD files, etc.
|
||||
* Since stdio files max out at 256 files on many systems, we have to
|
||||
* write similar functions without this limit. At the same time, using
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_FILE_PRIVATE_H_
|
||||
@@ -135,5 +135,5 @@ extern void _cupsFileCheckFilter(void *context,
|
||||
#endif /* !_CUPS_FILE_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: file-private.h 11642 2014-02-27 15:57:59Z msweet $".
|
||||
* End of "$Id: file-private.h 11627 2014-02-20 16:15:09Z msweet $".
|
||||
*/
|
||||
|
||||
+61
-62
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: file.c 11642 2014-02-27 15:57:59Z msweet $"
|
||||
* "$Id: file.c 11627 2014-02-20 16:15:09Z msweet $"
|
||||
*
|
||||
* File functions for CUPS.
|
||||
*
|
||||
@@ -8,7 +8,7 @@
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -288,7 +288,6 @@ _cupsFileCheckFilter(
|
||||
|
||||
switch (result)
|
||||
{
|
||||
default :
|
||||
case _CUPS_FILE_CHECK_OK :
|
||||
prefix = "DEBUG2";
|
||||
break;
|
||||
@@ -372,7 +371,7 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
|
||||
if (fp->stream.next_out > fp->cbuf)
|
||||
{
|
||||
if (cups_write(fp, (char *)fp->cbuf,
|
||||
fp->stream.next_out - fp->cbuf) < 0)
|
||||
(size_t)(fp->stream.next_out - fp->cbuf)) < 0)
|
||||
status = -1;
|
||||
|
||||
fp->stream.next_out = fp->cbuf;
|
||||
@@ -390,14 +389,14 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
|
||||
* Write the CRC and length...
|
||||
*/
|
||||
|
||||
trailer[0] = fp->crc;
|
||||
trailer[1] = fp->crc >> 8;
|
||||
trailer[2] = fp->crc >> 16;
|
||||
trailer[3] = fp->crc >> 24;
|
||||
trailer[4] = fp->pos;
|
||||
trailer[5] = fp->pos >> 8;
|
||||
trailer[6] = fp->pos >> 16;
|
||||
trailer[7] = fp->pos >> 24;
|
||||
trailer[0] = (unsigned char)fp->crc;
|
||||
trailer[1] = (unsigned char)(fp->crc >> 8);
|
||||
trailer[2] = (unsigned char)(fp->crc >> 16);
|
||||
trailer[3] = (unsigned char)(fp->crc >> 24);
|
||||
trailer[4] = (unsigned char)fp->pos;
|
||||
trailer[5] = (unsigned char)(fp->pos >> 8);
|
||||
trailer[6] = (unsigned char)(fp->pos >> 16);
|
||||
trailer[7] = (unsigned char)(fp->pos >> 24);
|
||||
|
||||
if (cups_write(fp, (char *)trailer, 8) < 0)
|
||||
status = -1;
|
||||
@@ -430,7 +429,7 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
|
||||
|
||||
if (mode == 's')
|
||||
{
|
||||
if (closesocket(fd) < 0)
|
||||
if (httpAddrClose(NULL, fd) < 0)
|
||||
status = -1;
|
||||
}
|
||||
else if (!is_stdio)
|
||||
@@ -511,7 +510,7 @@ cupsFileFind(const char *filename, /* I - File to find */
|
||||
|
||||
if (!access(filename, 0))
|
||||
{
|
||||
strlcpy(buffer, filename, bufsize);
|
||||
strlcpy(buffer, filename, (size_t)bufsize);
|
||||
return (buffer);
|
||||
}
|
||||
else
|
||||
@@ -536,7 +535,7 @@ cupsFileFind(const char *filename, /* I - File to find */
|
||||
if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
|
||||
*bufptr++ = '/';
|
||||
|
||||
strlcpy(bufptr, filename, bufend - bufptr);
|
||||
strlcpy(bufptr, filename, (size_t)(bufend - bufptr));
|
||||
|
||||
#ifdef WIN32
|
||||
if (!access(buffer, 0))
|
||||
@@ -563,7 +562,7 @@ cupsFileFind(const char *filename, /* I - File to find */
|
||||
if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
|
||||
*bufptr++ = '/';
|
||||
|
||||
strlcpy(bufptr, filename, bufend - bufptr);
|
||||
strlcpy(bufptr, filename, (size_t)(bufend - bufptr));
|
||||
|
||||
if (!access(buffer, 0))
|
||||
{
|
||||
@@ -611,10 +610,10 @@ cupsFileFlush(cups_file_t *fp) /* I - CUPS file */
|
||||
{
|
||||
#ifdef HAVE_LIBZ
|
||||
if (fp->compressed)
|
||||
bytes = cups_compress(fp, fp->buf, bytes);
|
||||
bytes = cups_compress(fp, fp->buf, (size_t)bytes);
|
||||
else
|
||||
#endif /* HAVE_LIBZ */
|
||||
bytes = cups_write(fp, fp->buf, bytes);
|
||||
bytes = cups_write(fp, fp->buf, (size_t)bytes);
|
||||
|
||||
if (bytes < 0)
|
||||
return (-1);
|
||||
@@ -885,7 +884,7 @@ cupsFileGetLine(cups_file_t *fp, /* I - File to read from */
|
||||
|
||||
DEBUG_printf(("4cupsFileGetLine: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
|
||||
|
||||
return (ptr - buf);
|
||||
return ((size_t)(ptr - buf));
|
||||
}
|
||||
|
||||
|
||||
@@ -960,7 +959,7 @@ cupsFileGets(cups_file_t *fp, /* I - CUPS file */
|
||||
break;
|
||||
}
|
||||
else
|
||||
*ptr++ = ch;
|
||||
*ptr++ = (char)ch;
|
||||
}
|
||||
|
||||
*ptr = '\0';
|
||||
@@ -1132,7 +1131,7 @@ cupsFileOpen(const char *filename, /* I - Name of file */
|
||||
if ((fp = cupsFileOpenFd(fd, mode)) == NULL)
|
||||
{
|
||||
if (*mode == 's')
|
||||
closesocket(fd);
|
||||
httpAddrClose(NULL, fd);
|
||||
else
|
||||
close(fd);
|
||||
}
|
||||
@@ -1215,10 +1214,10 @@ cupsFileOpenFd(int fd, /* I - File descriptor */
|
||||
header[1] = 0x8b;
|
||||
header[2] = Z_DEFLATED;
|
||||
header[3] = 0;
|
||||
header[4] = curtime;
|
||||
header[5] = curtime >> 8;
|
||||
header[6] = curtime >> 16;
|
||||
header[7] = curtime >> 24;
|
||||
header[4] = (unsigned char)curtime;
|
||||
header[5] = (unsigned char)(curtime >> 8);
|
||||
header[6] = (unsigned char)(curtime >> 16);
|
||||
header[7] = (unsigned char)(curtime >> 24);
|
||||
header[8] = 0;
|
||||
header[9] = 0x03;
|
||||
|
||||
@@ -1343,11 +1342,11 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
|
||||
if (bytes > 65535)
|
||||
return (-1);
|
||||
|
||||
if ((temp = realloc(fp->printf_buffer, bytes + 1)) == NULL)
|
||||
if ((temp = realloc(fp->printf_buffer, (size_t)(bytes + 1))) == NULL)
|
||||
return (-1);
|
||||
|
||||
fp->printf_buffer = temp;
|
||||
fp->printf_size = bytes + 1;
|
||||
fp->printf_size = (size_t)(bytes + 1);
|
||||
|
||||
va_start(ap, format);
|
||||
bytes = vsnprintf(fp->printf_buffer, fp->printf_size, format, ap);
|
||||
@@ -1356,14 +1355,14 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
if (fp->mode == 's')
|
||||
{
|
||||
if (cups_write(fp, fp->printf_buffer, bytes) < 0)
|
||||
if (cups_write(fp, fp->printf_buffer, (size_t)bytes) < 0)
|
||||
return (-1);
|
||||
|
||||
fp->pos += bytes;
|
||||
|
||||
DEBUG_printf(("4cupsFilePrintf: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
|
||||
|
||||
return (bytes);
|
||||
return ((int)bytes);
|
||||
}
|
||||
|
||||
if ((fp->ptr + bytes) > fp->end)
|
||||
@@ -1374,20 +1373,20 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
DEBUG_printf(("4cupsFilePrintf: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
|
||||
|
||||
if (bytes > sizeof(fp->buf))
|
||||
if ((size_t)bytes > sizeof(fp->buf))
|
||||
{
|
||||
#ifdef HAVE_LIBZ
|
||||
if (fp->compressed)
|
||||
return (cups_compress(fp, fp->printf_buffer, bytes));
|
||||
return ((int)cups_compress(fp, fp->printf_buffer, (size_t)bytes));
|
||||
else
|
||||
#endif /* HAVE_LIBZ */
|
||||
return (cups_write(fp, fp->printf_buffer, bytes));
|
||||
return ((int)cups_write(fp, fp->printf_buffer, (size_t)bytes));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(fp->ptr, fp->printf_buffer, bytes);
|
||||
memcpy(fp->ptr, fp->printf_buffer, (size_t)bytes);
|
||||
fp->ptr += bytes;
|
||||
return (bytes);
|
||||
return ((int)bytes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1418,7 +1417,7 @@ cupsFilePutChar(cups_file_t *fp, /* I - CUPS file */
|
||||
char ch; /* Output character */
|
||||
|
||||
|
||||
ch = c;
|
||||
ch = (char)c;
|
||||
|
||||
if (send(fp->fd, &ch, 1, 0) < 1)
|
||||
return (-1);
|
||||
@@ -1433,7 +1432,7 @@ cupsFilePutChar(cups_file_t *fp, /* I - CUPS file */
|
||||
if (cupsFileFlush(fp))
|
||||
return (-1);
|
||||
|
||||
*(fp->ptr) ++ = c;
|
||||
*(fp->ptr) ++ = (char)c;
|
||||
}
|
||||
|
||||
fp->pos ++;
|
||||
@@ -1480,7 +1479,7 @@ cupsFilePutConf(cups_file_t *fp, /* I - CUPS file */
|
||||
* Need to quote the first # in the info string...
|
||||
*/
|
||||
|
||||
if ((temp = cupsFileWrite(fp, value, ptr - value)) < 0)
|
||||
if ((temp = cupsFileWrite(fp, value, (size_t)(ptr - value))) < 0)
|
||||
return (-1);
|
||||
bytes += temp;
|
||||
|
||||
@@ -1531,18 +1530,18 @@ cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
|
||||
* Write the string...
|
||||
*/
|
||||
|
||||
bytes = (int)strlen(s);
|
||||
bytes = (ssize_t)strlen(s);
|
||||
|
||||
if (fp->mode == 's')
|
||||
{
|
||||
if (cups_write(fp, s, bytes) < 0)
|
||||
if (cups_write(fp, s, (size_t)bytes) < 0)
|
||||
return (-1);
|
||||
|
||||
fp->pos += bytes;
|
||||
|
||||
DEBUG_printf(("4cupsFilePuts: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
|
||||
|
||||
return (bytes);
|
||||
return ((int)bytes);
|
||||
}
|
||||
|
||||
if ((fp->ptr + bytes) > fp->end)
|
||||
@@ -1553,20 +1552,20 @@ cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
DEBUG_printf(("4cupsFilePuts: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
|
||||
|
||||
if (bytes > sizeof(fp->buf))
|
||||
if ((size_t)bytes > sizeof(fp->buf))
|
||||
{
|
||||
#ifdef HAVE_LIBZ
|
||||
if (fp->compressed)
|
||||
return (cups_compress(fp, s, bytes));
|
||||
return ((int)cups_compress(fp, s, (size_t)bytes));
|
||||
else
|
||||
#endif /* HAVE_LIBZ */
|
||||
return (cups_write(fp, s, bytes));
|
||||
return ((int)cups_write(fp, s, (size_t)bytes));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(fp->ptr, s, bytes);
|
||||
memcpy(fp->ptr, s, (size_t)bytes);
|
||||
fp->ptr += bytes;
|
||||
return (bytes);
|
||||
return ((int)bytes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1622,7 +1621,7 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
if (count > (ssize_t)bytes)
|
||||
count = (ssize_t)bytes;
|
||||
|
||||
memcpy(buf, fp->ptr, count);
|
||||
memcpy(buf, fp->ptr,(size_t) count);
|
||||
fp->ptr += count;
|
||||
fp->pos += count;
|
||||
|
||||
@@ -1632,8 +1631,8 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
* Update the counts for the last read...
|
||||
*/
|
||||
|
||||
bytes -= count;
|
||||
total += count;
|
||||
bytes -= (size_t)count;
|
||||
total += (size_t)count;
|
||||
buf += count;
|
||||
}
|
||||
|
||||
@@ -2105,14 +2104,14 @@ cups_compress(cups_file_t *fp, /* I - CUPS file */
|
||||
* Update the CRC...
|
||||
*/
|
||||
|
||||
fp->crc = crc32(fp->crc, (const Bytef *)buf, bytes);
|
||||
fp->crc = crc32(fp->crc, (const Bytef *)buf, (uInt)bytes);
|
||||
|
||||
/*
|
||||
* Deflate the bytes...
|
||||
*/
|
||||
|
||||
fp->stream.next_in = (Bytef *)buf;
|
||||
fp->stream.avail_in = bytes;
|
||||
fp->stream.avail_in = (uInt)bytes;
|
||||
|
||||
while (fp->stream.avail_in > 0)
|
||||
{
|
||||
@@ -2123,9 +2122,9 @@ cups_compress(cups_file_t *fp, /* I - CUPS file */
|
||||
DEBUG_printf(("9cups_compress: avail_in=%d, avail_out=%d",
|
||||
fp->stream.avail_in, fp->stream.avail_out));
|
||||
|
||||
if (fp->stream.avail_out < (int)(sizeof(fp->cbuf) / 8))
|
||||
if (fp->stream.avail_out < (uInt)(sizeof(fp->cbuf) / 8))
|
||||
{
|
||||
if (cups_write(fp, (char *)fp->cbuf, fp->stream.next_out - fp->cbuf) < 0)
|
||||
if (cups_write(fp, (char *)fp->cbuf, (size_t)(fp->stream.next_out - fp->cbuf)) < 0)
|
||||
return (-1);
|
||||
|
||||
fp->stream.next_out = fp->cbuf;
|
||||
@@ -2135,7 +2134,7 @@ cups_compress(cups_file_t *fp, /* I - CUPS file */
|
||||
deflate(&(fp->stream), Z_NO_FLUSH);
|
||||
}
|
||||
|
||||
return (bytes);
|
||||
return ((ssize_t)bytes);
|
||||
}
|
||||
#endif /* HAVE_LIBZ */
|
||||
|
||||
@@ -2315,7 +2314,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
*/
|
||||
|
||||
if ((bytes = end - ptr) > 0)
|
||||
memcpy(fp->cbuf, ptr, bytes);
|
||||
memcpy(fp->cbuf, ptr, (size_t)bytes);
|
||||
|
||||
/*
|
||||
* Setup the decompressor data...
|
||||
@@ -2326,7 +2325,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
fp->stream.opaque = (voidpf)0;
|
||||
fp->stream.next_in = (Bytef *)fp->cbuf;
|
||||
fp->stream.next_out = NULL;
|
||||
fp->stream.avail_in = bytes;
|
||||
fp->stream.avail_in = (uInt)bytes;
|
||||
fp->stream.avail_out = 0;
|
||||
fp->crc = crc32(0L, Z_NULL, 0);
|
||||
|
||||
@@ -2355,7 +2354,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
return (-1);
|
||||
|
||||
fp->stream.next_in = fp->cbuf;
|
||||
fp->stream.avail_in = bytes;
|
||||
fp->stream.avail_in = (uInt)bytes;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2369,7 +2368,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
|
||||
if (fp->stream.next_out > (Bytef *)fp->buf)
|
||||
fp->crc = crc32(fp->crc, (Bytef *)fp->buf,
|
||||
fp->stream.next_out - (Bytef *)fp->buf);
|
||||
(uInt)(fp->stream.next_out - (Bytef *)fp->buf));
|
||||
|
||||
if (status == Z_STREAM_END)
|
||||
{
|
||||
@@ -2381,7 +2380,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
uLong tcrc; /* Trailer CRC */
|
||||
|
||||
|
||||
if (read(fp->fd, trailer, sizeof(trailer)) < sizeof(trailer))
|
||||
if (read(fp->fd, trailer, sizeof(trailer)) < (ssize_t)sizeof(trailer))
|
||||
{
|
||||
/*
|
||||
* Can't get it, so mark end-of-file...
|
||||
@@ -2417,7 +2416,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
}
|
||||
}
|
||||
|
||||
bytes = sizeof(fp->buf) - fp->stream.avail_out;
|
||||
bytes = (ssize_t)sizeof(fp->buf) - (ssize_t)fp->stream.avail_out;
|
||||
|
||||
/*
|
||||
* Return the decompressed data...
|
||||
@@ -2658,8 +2657,8 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
* Update the counts for the last write call...
|
||||
*/
|
||||
|
||||
bytes -= count;
|
||||
total += count;
|
||||
bytes -= (size_t)count;
|
||||
total += (size_t)count;
|
||||
buf += count;
|
||||
}
|
||||
|
||||
@@ -2672,5 +2671,5 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: file.c 11642 2014-02-27 15:57:59Z msweet $".
|
||||
* End of "$Id: file.c 11627 2014-02-20 16:15:09Z msweet $".
|
||||
*/
|
||||
|
||||
+15
-15
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* "$Id: file.h 11642 2014-02-27 15:57:59Z msweet $"
|
||||
* "$Id: file.h 11627 2014-02-20 16:15:09Z msweet $"
|
||||
*
|
||||
* Public file definitions for CUPS.
|
||||
* Public file definitions for CUPS.
|
||||
*
|
||||
* Since stdio files max out at 256 files on many systems, we have to
|
||||
* write similar functions without this limit. At the same time, using
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* gzip'd print files, PPD files, etc.
|
||||
* Since stdio files max out at 256 files on many systems, we have to
|
||||
* write similar functions without this limit. At the same time, using
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_FILE_H_
|
||||
@@ -114,5 +114,5 @@ extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf,
|
||||
#endif /* !_CUPS_FILE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: file.h 11642 2014-02-27 15:57:59Z msweet $".
|
||||
* End of "$Id: file.h 11627 2014-02-20 16:15:09Z msweet $".
|
||||
*/
|
||||
|
||||
+16
-23
@@ -1,25 +1,18 @@
|
||||
/*
|
||||
* "$Id: getputfile.c 11153 2013-07-17 14:10:21Z msweet $"
|
||||
* "$Id: getputfile.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Get/put file functions for CUPS.
|
||||
* Get/put file functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsGetFd() - Get a file from the server.
|
||||
* cupsGetFile() - Get a file from the server.
|
||||
* cupsPutFd() - Put a file on the server.
|
||||
* cupsPutFile() - Put a file on the server.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -49,7 +42,7 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
const char *resource, /* I - Resource name */
|
||||
int fd) /* I - File descriptor */
|
||||
{
|
||||
int bytes; /* Number of bytes read */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
char buffer[8192]; /* Buffer for file */
|
||||
http_status_t status; /* HTTP status from server */
|
||||
char if_modified_since[HTTP_MAX_VALUE];
|
||||
@@ -174,7 +167,7 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
*/
|
||||
|
||||
while ((bytes = httpRead2(http, buffer, sizeof(buffer))) > 0)
|
||||
write(fd, buffer, bytes);
|
||||
write(fd, buffer, (size_t)bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -273,8 +266,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
const char *resource, /* I - Resource name */
|
||||
int fd) /* I - File descriptor */
|
||||
{
|
||||
int bytes, /* Number of bytes read */
|
||||
retries; /* Number of retries */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
int retries; /* Number of retries */
|
||||
char buffer[8192]; /* Buffer for file */
|
||||
http_status_t status; /* HTTP status from server */
|
||||
|
||||
@@ -362,7 +355,7 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
break;
|
||||
}
|
||||
else
|
||||
httpWrite2(http, buffer, bytes);
|
||||
httpWrite2(http, buffer, (size_t)bytes);
|
||||
}
|
||||
|
||||
if (status == HTTP_STATUS_CONTINUE)
|
||||
@@ -518,5 +511,5 @@ cupsPutFile(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DE
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: getputfile.c 11153 2013-07-17 14:10:21Z msweet $".
|
||||
* End of "$Id: getputfile.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: globals.c 11113 2013-07-10 14:08:39Z msweet $"
|
||||
* "$Id: globals.c 11851 2014-05-07 23:55:35Z msweet $"
|
||||
*
|
||||
* Global variable access routines for CUPS.
|
||||
*
|
||||
@@ -218,7 +218,7 @@ cups_globals_alloc(void)
|
||||
cg->password_cb = (cups_password_cb2_t)_cupsGetPassword;
|
||||
cg->any_root = 1;
|
||||
cg->expired_certs = 1;
|
||||
cg->expired_root = 1;
|
||||
cg->validate_certs = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
@@ -392,5 +392,5 @@ cups_globals_init(void)
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: globals.c 11113 2013-07-10 14:08:39Z msweet $".
|
||||
* End of "$Id: globals.c 11851 2014-05-07 23:55:35Z msweet $".
|
||||
*/
|
||||
|
||||
+209
-48
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: http-addr.c 11642 2014-02-27 15:57:59Z msweet $"
|
||||
* "$Id: http-addr.c 11627 2014-02-20 16:15:09Z msweet $"
|
||||
*
|
||||
* HTTP address routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_RESOLV_H
|
||||
# include <resolv.h>
|
||||
#endif /* HAVE_RESOLV_H */
|
||||
@@ -55,6 +56,37 @@ httpAddrAny(const http_addr_t *addr) /* I - Address to check */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpAddrClose()' - Close a socket created by @link httpAddrConnect@ or
|
||||
* @link httpAddrListen@.
|
||||
*
|
||||
* Pass @code NULL@ for sockets created with @link httpAddrConnect@ and the
|
||||
* listen address for sockets created with @link httpAddrListen@. This will
|
||||
* ensure that domain sockets are removed when closed.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on failure */
|
||||
httpAddrClose(http_addr_t *addr, /* I - Listen address or @code NULL@ */
|
||||
int fd) /* I - Socket file descriptor */
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (closesocket(fd))
|
||||
#else
|
||||
if (close(fd))
|
||||
#endif /* WIN32 */
|
||||
return (-1);
|
||||
|
||||
#ifdef AF_LOCAL
|
||||
if (addr && addr->addr.sa_family == AF_LOCAL)
|
||||
return (unlink(addr->un.sun_path));
|
||||
#endif /* AF_LOCAL */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpAddrEqual()' - Compare two addresses.
|
||||
*
|
||||
@@ -107,8 +139,7 @@ httpAddrLength(const http_addr_t *addr) /* I - Address */
|
||||
#endif /* AF_INET6 */
|
||||
#ifdef AF_LOCAL
|
||||
if (addr->addr.sa_family == AF_LOCAL)
|
||||
return (offsetof(struct sockaddr_un, sun_path) +
|
||||
strlen(addr->un.sun_path) + 1);
|
||||
return ((int)(offsetof(struct sockaddr_un, sun_path) + strlen(addr->un.sun_path) + 1));
|
||||
else
|
||||
#endif /* AF_LOCAL */
|
||||
if (addr->addr.sa_family == AF_INET)
|
||||
@@ -131,16 +162,21 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
|
||||
int port) /* I - Port number to bind to */
|
||||
{
|
||||
int fd = -1, /* Socket */
|
||||
val; /* Socket value */
|
||||
val, /* Socket value */
|
||||
status; /* Bind status */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!addr || port <= 0)
|
||||
if (!addr || port < 0)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Create the socket and set options...
|
||||
*/
|
||||
|
||||
if ((fd = socket(addr->addr.sa_family, SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
_cupsSetHTTPError(HTTP_STATUS_ERROR);
|
||||
@@ -155,9 +191,50 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
|
||||
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, CUPS_SOCAST &val, sizeof(val));
|
||||
#endif /* IPV6_V6ONLY */
|
||||
|
||||
_httpAddrSetPort(addr, port);
|
||||
/*
|
||||
* Bind the socket...
|
||||
*/
|
||||
|
||||
if (bind(fd, (struct sockaddr *)addr, httpAddrLength(addr)))
|
||||
#ifdef AF_LOCAL
|
||||
if (addr->addr.sa_family == AF_LOCAL)
|
||||
{
|
||||
mode_t mask; /* Umask setting */
|
||||
|
||||
/*
|
||||
* Remove any existing domain socket file...
|
||||
*/
|
||||
|
||||
unlink(addr->un.sun_path);
|
||||
|
||||
/*
|
||||
* Save the current umask and set it to 0 so that all users can access
|
||||
* the domain socket...
|
||||
*/
|
||||
|
||||
mask = umask(0);
|
||||
|
||||
/*
|
||||
* Bind the domain socket...
|
||||
*/
|
||||
|
||||
status = bind(fd, (struct sockaddr *)addr, (socklen_t)httpAddrLength(addr));
|
||||
|
||||
/*
|
||||
* Restore the umask and fix permissions...
|
||||
*/
|
||||
|
||||
umask(mask);
|
||||
chmod(addr->un.sun_path, 0140777);
|
||||
}
|
||||
else
|
||||
#endif /* AF_LOCAL */
|
||||
{
|
||||
_httpAddrSetPort(addr, port);
|
||||
|
||||
status = bind(fd, (struct sockaddr *)addr, (socklen_t)httpAddrLength(addr));
|
||||
}
|
||||
|
||||
if (status)
|
||||
{
|
||||
_cupsSetHTTPError(HTTP_STATUS_ERROR);
|
||||
|
||||
@@ -166,6 +243,10 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Listen...
|
||||
*/
|
||||
|
||||
if (listen(fd, 5))
|
||||
{
|
||||
_cupsSetHTTPError(HTTP_STATUS_ERROR);
|
||||
@@ -175,6 +256,14 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close on exec...
|
||||
*/
|
||||
|
||||
#ifndef WIN32
|
||||
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
|
||||
#endif /* !WIN32 */
|
||||
|
||||
#ifdef SO_NOSIGPIPE
|
||||
/*
|
||||
* Disable SIGPIPE for this socket.
|
||||
@@ -254,7 +343,7 @@ httpAddrLookup(
|
||||
#ifdef AF_LOCAL
|
||||
if (addr->addr.sa_family == AF_LOCAL)
|
||||
{
|
||||
strlcpy(name, addr->un.sun_path, namelen);
|
||||
strlcpy(name, addr->un.sun_path, (size_t)namelen);
|
||||
return (name);
|
||||
}
|
||||
#endif /* AF_LOCAL */
|
||||
@@ -265,7 +354,7 @@ httpAddrLookup(
|
||||
|
||||
if (httpAddrLocalhost(addr))
|
||||
{
|
||||
strlcpy(name, "localhost", namelen);
|
||||
strlcpy(name, "localhost", (size_t)namelen);
|
||||
return (name);
|
||||
}
|
||||
|
||||
@@ -300,8 +389,7 @@ httpAddrLookup(
|
||||
* do...
|
||||
*/
|
||||
|
||||
int error = getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
|
||||
NULL, 0, 0);
|
||||
int error = getnameinfo(&addr->addr, (socklen_t)httpAddrLength(addr), name, (socklen_t)namelen, NULL, 0, 0);
|
||||
|
||||
if (error)
|
||||
{
|
||||
@@ -337,7 +425,7 @@ httpAddrLookup(
|
||||
return (httpAddrString(addr, name, namelen));
|
||||
}
|
||||
|
||||
strlcpy(name, host->h_name, namelen);
|
||||
strlcpy(name, host->h_name, (size_t)namelen);
|
||||
}
|
||||
#endif /* HAVE_GETNAMEINFO */
|
||||
|
||||
@@ -347,6 +435,20 @@ httpAddrLookup(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpAddrFamily()' - Get the address family of an address.
|
||||
*/
|
||||
|
||||
int /* O - Address family */
|
||||
httpAddrFamily(http_addr_t *addr) /* I - Address */
|
||||
{
|
||||
if (addr)
|
||||
return (addr->addr.sa_family);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpAddrPort()' - Get the port number associated with an address.
|
||||
*
|
||||
@@ -357,7 +459,7 @@ int /* O - Port number */
|
||||
httpAddrPort(http_addr_t *addr) /* I - Address */
|
||||
{
|
||||
if (!addr)
|
||||
return (ippPort());
|
||||
return (-1);
|
||||
#ifdef AF_INET6
|
||||
else if (addr->addr.sa_family == AF_INET6)
|
||||
return (ntohs(addr->ipv6.sin6_port));
|
||||
@@ -365,12 +467,9 @@ httpAddrPort(http_addr_t *addr) /* I - Address */
|
||||
else if (addr->addr.sa_family == AF_INET)
|
||||
return (ntohs(addr->ipv4.sin_port));
|
||||
else
|
||||
return (ippPort());
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* For OS X 10.8 and earlier */
|
||||
int _httpAddrPort(http_addr_t *addr) { return (httpAddrPort(addr)); }
|
||||
|
||||
|
||||
/*
|
||||
* '_httpAddrSetPort()' - Set the port number associated with an address.
|
||||
@@ -422,9 +521,9 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
if (addr->addr.sa_family == AF_LOCAL)
|
||||
{
|
||||
if (addr->un.sun_path[0] == '/')
|
||||
strlcpy(s, addr->un.sun_path, slen);
|
||||
strlcpy(s, addr->un.sun_path, (size_t)slen);
|
||||
else
|
||||
strlcpy(s, "localhost", slen);
|
||||
strlcpy(s, "localhost", (size_t)slen);
|
||||
}
|
||||
else
|
||||
#endif /* AF_LOCAL */
|
||||
@@ -432,10 +531,9 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
{
|
||||
unsigned temp; /* Temporary address */
|
||||
|
||||
|
||||
temp = ntohl(addr->ipv4.sin_addr.s_addr);
|
||||
|
||||
snprintf(s, slen, "%d.%d.%d.%d", (temp >> 24) & 255,
|
||||
snprintf(s, (size_t)slen, "%d.%d.%d.%d", (temp >> 24) & 255,
|
||||
(temp >> 16) & 255, (temp >> 8) & 255, temp & 255);
|
||||
}
|
||||
#ifdef AF_INET6
|
||||
@@ -445,8 +543,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
temps[64]; /* Temporary string for address */
|
||||
|
||||
# ifdef HAVE_GETNAMEINFO
|
||||
if (getnameinfo(&addr->addr, httpAddrLength(addr), temps, sizeof(temps),
|
||||
NULL, 0, NI_NUMERICHOST))
|
||||
if (getnameinfo(&addr->addr, (socklen_t)httpAddrLength(addr), temps, sizeof(temps), NULL, 0, NI_NUMERICHOST))
|
||||
{
|
||||
/*
|
||||
* If we get an error back, then the address type is not supported
|
||||
@@ -477,8 +574,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
{
|
||||
temp = ntohl(addr->ipv6.sin6_addr.s6_addr32[i]);
|
||||
|
||||
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
|
||||
(temp >> 16) & 0xffff);
|
||||
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s%x", prefix, (temp >> 16) & 0xffff);
|
||||
prefix = ":";
|
||||
sptr += strlen(sptr);
|
||||
|
||||
@@ -486,7 +582,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
|
||||
if (temp || i == 3 || addr->ipv6.sin6_addr.s6_addr32[i + 1])
|
||||
{
|
||||
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix, temp);
|
||||
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s%x", prefix, temp);
|
||||
sptr += strlen(sptr);
|
||||
}
|
||||
}
|
||||
@@ -498,7 +594,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
|
||||
if (i < 4)
|
||||
{
|
||||
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s:", prefix);
|
||||
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s:", prefix);
|
||||
prefix = ":";
|
||||
sptr += strlen(sptr);
|
||||
|
||||
@@ -509,13 +605,11 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
if ((temp & 0xffff0000) ||
|
||||
(i > 0 && addr->ipv6.sin6_addr.s6_addr32[i - 1]))
|
||||
{
|
||||
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
|
||||
(temp >> 16) & 0xffff);
|
||||
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s%x", prefix, (temp >> 16) & 0xffff);
|
||||
sptr += strlen(sptr);
|
||||
}
|
||||
|
||||
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
|
||||
temp & 0xffff);
|
||||
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s%x", prefix, temp & 0xffff);
|
||||
sptr += strlen(sptr);
|
||||
}
|
||||
}
|
||||
@@ -533,7 +627,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
* Empty at end...
|
||||
*/
|
||||
|
||||
strlcpy(sptr, "::", sizeof(temps) - (sptr - temps));
|
||||
strlcpy(sptr, "::", sizeof(temps) - (size_t)(sptr - temps));
|
||||
}
|
||||
}
|
||||
# endif /* HAVE_GETNAMEINFO */
|
||||
@@ -542,11 +636,11 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
* Add "[v1." and "]" around IPv6 address to convert to URI form.
|
||||
*/
|
||||
|
||||
snprintf(s, slen, "[v1.%s]", temps);
|
||||
snprintf(s, (size_t)slen, "[v1.%s]", temps);
|
||||
}
|
||||
#endif /* AF_INET6 */
|
||||
else
|
||||
strlcpy(s, "UNKNOWN", slen);
|
||||
strlcpy(s, "UNKNOWN", (size_t)slen);
|
||||
|
||||
DEBUG_printf(("1httpAddrString: returning \"%s\"...", s));
|
||||
|
||||
@@ -554,6 +648,24 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpGetAddress()' - Get the address of the connected peer of a connection.
|
||||
*
|
||||
* Returns @code NULL@ if the socket is currently unconnected.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
*/
|
||||
|
||||
http_addr_t * /* O - Connected address or @code NULL@ */
|
||||
httpGetAddress(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
if (http)
|
||||
return (http->hostaddr);
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpGetHostByName()' - Lookup a hostname or IPv4 address, and return
|
||||
* address records for the specified name.
|
||||
@@ -603,7 +715,7 @@ httpGetHostByName(const char *name) /* I - Hostname or IP address */
|
||||
cg->hostent.h_name = (char *)name;
|
||||
cg->hostent.h_aliases = NULL;
|
||||
cg->hostent.h_addrtype = AF_LOCAL;
|
||||
cg->hostent.h_length = strlen(name) + 1;
|
||||
cg->hostent.h_length = (int)strlen(name) + 1;
|
||||
cg->hostent.h_addr_list = cg->ip_ptrs;
|
||||
cg->ip_ptrs[0] = (char *)name;
|
||||
cg->ip_ptrs[1] = NULL;
|
||||
@@ -667,7 +779,8 @@ httpGetHostByName(const char *name) /* I - Hostname or IP address */
|
||||
* 'httpGetHostname()' - Get the FQDN for the connection or local system.
|
||||
*
|
||||
* When "http" points to a connected socket, return the hostname or
|
||||
* address that was used in the call to httpConnect() or httpConnectEncrypt().
|
||||
* address that was used in the call to httpConnect() or httpConnectEncrypt(),
|
||||
* or the address of the client for the connection from httpAcceptConnection().
|
||||
* Otherwise, return the FQDN for the local system using both gethostname()
|
||||
* and gethostbyname() to get the local hostname with domain.
|
||||
*
|
||||
@@ -679,15 +792,19 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
char *s, /* I - String buffer for name */
|
||||
int slen) /* I - Size of buffer */
|
||||
{
|
||||
if (!s || slen <= 1)
|
||||
return (NULL);
|
||||
|
||||
if (http)
|
||||
{
|
||||
if (http->hostname[0] == '/')
|
||||
strlcpy(s, "localhost", slen);
|
||||
if (!s || slen <= 1)
|
||||
{
|
||||
if (http->hostname[0] == '/')
|
||||
return ("localhost");
|
||||
else
|
||||
return (http->hostname);
|
||||
}
|
||||
else if (http->hostname[0] == '/')
|
||||
strlcpy(s, "localhost", (size_t)slen);
|
||||
else
|
||||
strlcpy(s, http->hostname, slen);
|
||||
strlcpy(s, http->hostname, (size_t)slen);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -695,8 +812,11 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
* Get the hostname...
|
||||
*/
|
||||
|
||||
if (gethostname(s, slen) < 0)
|
||||
strlcpy(s, "localhost", slen);
|
||||
if (!s || slen <= 1)
|
||||
return (NULL);
|
||||
|
||||
if (gethostname(s, (size_t)slen) < 0)
|
||||
strlcpy(s, "localhost", (size_t)slen);
|
||||
|
||||
if (!strchr(s, '.'))
|
||||
{
|
||||
@@ -720,7 +840,7 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
* Append ".local." to the hostname we get...
|
||||
*/
|
||||
|
||||
snprintf(s, slen, "%s.local.", localStr);
|
||||
snprintf(s, (size_t)slen, "%s.local.", localStr);
|
||||
}
|
||||
|
||||
if (local)
|
||||
@@ -741,7 +861,7 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
* Use the resolved hostname...
|
||||
*/
|
||||
|
||||
strlcpy(s, host->h_name, slen);
|
||||
strlcpy(s, host->h_name, (size_t)slen);
|
||||
}
|
||||
#endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
|
||||
}
|
||||
@@ -756,5 +876,46 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: http-addr.c 11642 2014-02-27 15:57:59Z msweet $".
|
||||
* 'httpResolveHostname()' - Resolve the hostname of the HTTP connection
|
||||
* address.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
*/
|
||||
|
||||
const char * /* O - Resolved hostname or @code NULL@ */
|
||||
httpResolveHostname(http_t *http, /* I - HTTP connection */
|
||||
char *buffer, /* I - Hostname buffer */
|
||||
size_t bufsize) /* I - Size of buffer */
|
||||
{
|
||||
if (!http)
|
||||
return (NULL);
|
||||
|
||||
if (isdigit(http->hostname[0] & 255) || http->hostname[0] == '[')
|
||||
{
|
||||
char temp[1024]; /* Temporary string */
|
||||
|
||||
if (httpAddrLookup(http->hostaddr, temp, sizeof(temp)))
|
||||
strlcpy(http->hostname, temp, sizeof(http->hostname));
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
if (http->hostname[0] == '/')
|
||||
strlcpy(buffer, "localhost", bufsize);
|
||||
else
|
||||
strlcpy(buffer, http->hostname, bufsize);
|
||||
|
||||
return (buffer);
|
||||
}
|
||||
else if (http->hostname[0] == '/')
|
||||
return ("localhost");
|
||||
else
|
||||
return (http->hostname);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: http-addr.c 11627 2014-02-20 16:15:09Z msweet $".
|
||||
*/
|
||||
|
||||
+7
-16
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: http-addrlist.c 11642 2014-02-27 15:57:59Z msweet $"
|
||||
* "$Id: http-addrlist.c 11627 2014-02-20 16:15:09Z msweet $"
|
||||
*
|
||||
* HTTP address list routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -115,7 +115,7 @@ httpAddrConnect2(
|
||||
httpAddrString(&(addrlist->addr), temp, sizeof(temp)),
|
||||
httpAddrPort(&(addrlist->addr))));
|
||||
|
||||
if ((*sock = (int)socket(_httpAddrFamily(&(addrlist->addr)), SOCK_STREAM,
|
||||
if ((*sock = (int)socket(httpAddrFamily(&(addrlist->addr)), SOCK_STREAM,
|
||||
0)) < 0)
|
||||
{
|
||||
/*
|
||||
@@ -180,8 +180,7 @@ httpAddrConnect2(
|
||||
* Then connect...
|
||||
*/
|
||||
|
||||
if (!connect(*sock, &(addrlist->addr.addr),
|
||||
httpAddrLength(&(addrlist->addr))))
|
||||
if (!connect(*sock, &(addrlist->addr.addr), (socklen_t)httpAddrLength(&(addrlist->addr))))
|
||||
{
|
||||
DEBUG_printf(("1httpAddrConnect2: Connected to %s:%d...",
|
||||
httpAddrString(&(addrlist->addr), temp, sizeof(temp)),
|
||||
@@ -218,11 +217,7 @@ httpAddrConnect2(
|
||||
|
||||
DEBUG_puts("1httpAddrConnect2: Canceled connect()");
|
||||
|
||||
# ifdef WIN32
|
||||
closesocket(*sock);
|
||||
# else
|
||||
close(*sock);
|
||||
# endif /* WIN32 */
|
||||
httpAddrClose(NULL, *sock);
|
||||
|
||||
*sock = -1;
|
||||
|
||||
@@ -290,11 +285,7 @@ httpAddrConnect2(
|
||||
* Close this socket and move to the next address...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
closesocket(*sock);
|
||||
#else
|
||||
close(*sock);
|
||||
#endif /* WIN32 */
|
||||
httpAddrClose(NULL, *sock);
|
||||
|
||||
*sock = -1;
|
||||
addrlist = addrlist->next;
|
||||
@@ -877,5 +868,5 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: http-addrlist.c 11642 2014-02-27 15:57:59Z msweet $".
|
||||
* End of "$Id: http-addrlist.c 11627 2014-02-20 16:15:09Z msweet $".
|
||||
*/
|
||||
|
||||
+61
-59
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: http-private.h 11392 2013-11-06 01:29:56Z msweet $"
|
||||
* "$Id: http-private.h 12044 2014-07-17 21:21:21Z msweet $"
|
||||
*
|
||||
* Private HTTP definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
# include <cups/language.h>
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
|
||||
@@ -39,7 +40,6 @@
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# include <sys/socket.h>
|
||||
# define closesocket(f) close(f)
|
||||
# define CUPS_SOCAST
|
||||
# endif /* WIN32 */
|
||||
|
||||
@@ -73,11 +73,7 @@ typedef int socklen_t;
|
||||
# include "md5-private.h"
|
||||
# include "ipp-private.h"
|
||||
|
||||
# if defined HAVE_LIBSSL
|
||||
# include <openssl/err.h>
|
||||
# include <openssl/rand.h>
|
||||
# include <openssl/ssl.h>
|
||||
# elif defined HAVE_GNUTLS
|
||||
# ifdef HAVE_GNUTLS
|
||||
# include <gnutls/gnutls.h>
|
||||
# include <gnutls/x509.h>
|
||||
# include <gcrypt.h>
|
||||
@@ -98,6 +94,19 @@ typedef int socklen_t;
|
||||
# include <Security/SecCertificate.h>
|
||||
# include <Security/SecIdentity.h>
|
||||
# endif /* HAVE_SECCERTIFICATE_H */
|
||||
# ifdef HAVE_SECCERTIFICATEPRIV_H
|
||||
# include <Security/SecCertificatePriv.h>
|
||||
# else
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
extern SecCertificateRef SecCertificateCreateWithBytes(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
|
||||
extern bool SecCertificateIsValid(SecCertificateRef certificate, CFAbsoluteTime verifyTime);
|
||||
extern CFAbsoluteTime SecCertificateNotValidAfter(SecCertificateRef certificate);
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
# endif /* HAVE_SECCERTIFICATEPRIV_H */
|
||||
# ifdef HAVE_SECITEMPRIV_H
|
||||
# include <Security/SecItemPriv.h>
|
||||
# endif /* HAVE_SECITEMPRIV_H */
|
||||
@@ -108,8 +117,13 @@ typedef int socklen_t;
|
||||
# include <Security/SecPolicyPriv.h>
|
||||
# endif /* HAVE_SECPOLICYPRIV_H */
|
||||
# elif defined(HAVE_SSPISSL)
|
||||
# include "sspi-private.h"
|
||||
# endif /* HAVE_LIBSSL */
|
||||
# include <wincrypt.h>
|
||||
# include <wintrust.h>
|
||||
# include <schannel.h>
|
||||
# define SECURITY_WIN32
|
||||
# include <security.h>
|
||||
# include <sspi.h>
|
||||
# endif /* HAVE_GNUTLS */
|
||||
|
||||
# ifndef WIN32
|
||||
# include <net/if.h>
|
||||
@@ -142,6 +156,7 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#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 */
|
||||
@@ -152,30 +167,13 @@ extern "C" {
|
||||
* Types and functions for SSL support...
|
||||
*/
|
||||
|
||||
# if defined HAVE_LIBSSL
|
||||
/*
|
||||
* The OpenSSL library provides its own SSL/TLS context structure for its
|
||||
* IO and protocol management. However, we need to provide our own BIO
|
||||
* (basic IO) implementation to do timeouts...
|
||||
*/
|
||||
|
||||
typedef SSL *http_tls_t;
|
||||
typedef void *http_tls_credentials_t;
|
||||
|
||||
extern BIO_METHOD *_httpBIOMethods(void);
|
||||
|
||||
# elif defined HAVE_GNUTLS
|
||||
# ifdef HAVE_GNUTLS
|
||||
/*
|
||||
* The GNU TLS library is more of a "bare metal" SSL/TLS library...
|
||||
*/
|
||||
|
||||
typedef gnutls_session_t http_tls_t;
|
||||
typedef void *http_tls_credentials_t;
|
||||
|
||||
extern ssize_t _httpReadGNUTLS(gnutls_transport_ptr_t ptr, void *data,
|
||||
size_t length);
|
||||
extern ssize_t _httpWriteGNUTLS(gnutls_transport_ptr_t ptr, const void *data,
|
||||
size_t length);
|
||||
typedef gnutls_certificate_credentials_t *http_tls_credentials_t;
|
||||
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
/*
|
||||
@@ -205,18 +203,31 @@ extern OSStatus SecPolicySetValue(SecPolicyRef policyRef,
|
||||
typedef SSLContextRef http_tls_t;
|
||||
typedef CFArrayRef http_tls_credentials_t;
|
||||
|
||||
extern OSStatus _httpReadCDSA(SSLConnectionRef connection, void *data,
|
||||
size_t *dataLength);
|
||||
extern OSStatus _httpWriteCDSA(SSLConnectionRef connection, const void *data,
|
||||
size_t *dataLength);
|
||||
|
||||
# elif defined(HAVE_SSPISSL)
|
||||
/*
|
||||
* Windows' SSPI library gets a CUPS wrapper...
|
||||
*/
|
||||
|
||||
typedef _sspi_struct_t * http_tls_t;
|
||||
typedef void *http_tls_credentials_t;
|
||||
typedef struct _http_sspi_s /**** SSPI/SSL data structure ****/
|
||||
{
|
||||
CredHandle creds; /* Credentials */
|
||||
CtxtHandle context; /* SSL context */
|
||||
BOOL contextInitialized; /* Is context init'd? */
|
||||
SecPkgContext_StreamSizes streamSizes;/* SSL data stream sizes */
|
||||
BYTE *decryptBuffer; /* Data pre-decryption*/
|
||||
size_t decryptBufferLength; /* Length of decrypt buffer */
|
||||
size_t decryptBufferUsed; /* Bytes used in buffer */
|
||||
BYTE *readBuffer; /* Data post-decryption */
|
||||
int readBufferLength; /* Length of read buffer */
|
||||
int readBufferUsed; /* Bytes used in buffer */
|
||||
BYTE *writeBuffer; /* Data pre-encryption */
|
||||
int writeBufferLength; /* Length of write buffer */
|
||||
PCCERT_CONTEXT localCert, /* Local certificate */
|
||||
remoteCert; /* Remote (peer's) certificate */
|
||||
char error[256]; /* Most recent error message */
|
||||
} _http_sspi_t;
|
||||
typedef _http_sspi_t *http_tls_t;
|
||||
typedef PCCERT_CONTEXT http_tls_credentials_t;
|
||||
|
||||
# else
|
||||
/*
|
||||
@@ -225,7 +236,7 @@ typedef void *http_tls_credentials_t;
|
||||
|
||||
typedef void *http_tls_t;
|
||||
typedef void *http_tls_credentials_t;
|
||||
# endif /* HAVE_LIBSSL */
|
||||
# endif /* HAVE_GNUTLS */
|
||||
|
||||
typedef enum _http_coding_e /**** HTTP content coding enumeration ****/
|
||||
{
|
||||
@@ -242,6 +253,7 @@ typedef enum _http_mode_e /**** HTTP mode enumeration ****/
|
||||
_HTTP_MODE_SERVER /* Server connected (accepted) from client */
|
||||
} _http_mode_t;
|
||||
|
||||
# ifndef _HTTP_NO_PRIVATE
|
||||
struct _http_s /**** HTTP connection structure ****/
|
||||
{
|
||||
int fd; /* File descriptor for this socket */
|
||||
@@ -263,7 +275,7 @@ struct _http_s /**** HTTP connection structure ****/
|
||||
int used; /* Number of bytes used in buffer */
|
||||
char buffer[HTTP_MAX_BUFFER];
|
||||
/* Buffer for incoming data */
|
||||
int auth_type; /* Authentication in use */
|
||||
int _auth_type; /* Authentication in use (deprecated) */
|
||||
_cups_md5_state_t md5_state; /* MD5 state */
|
||||
char nonce[HTTP_MAX_VALUE];
|
||||
/* Nonce value */
|
||||
@@ -329,9 +341,10 @@ struct _http_s /**** HTTP connection structure ****/
|
||||
# ifdef HAVE_LIBZ
|
||||
_http_coding_t coding; /* _HTTP_CODING_xxx */
|
||||
z_stream stream; /* (De)compression stream */
|
||||
Bytef *dbuffer; /* Decompression buffer */
|
||||
Bytef *sbuffer; /* (De)compression buffer */
|
||||
# endif /* HAVE_LIBZ */
|
||||
};
|
||||
# endif /* !_HTTP_NO_PRIVATE */
|
||||
|
||||
|
||||
/*
|
||||
@@ -341,11 +354,6 @@ struct _http_s /**** HTTP connection structure ****/
|
||||
# ifndef HAVE_HSTRERROR
|
||||
extern const char *_cups_hstrerror(int error);
|
||||
# define hstrerror _cups_hstrerror
|
||||
# elif defined(_AIX) || defined(__osf__)
|
||||
/*
|
||||
* AIX and Tru64 UNIX don't provide a prototype but do provide the function...
|
||||
*/
|
||||
extern const char *hstrerror(int error);
|
||||
# endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
@@ -395,19 +403,7 @@ extern void _cups_freeifaddrs(struct ifaddrs *addrs);
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
#define _httpAddrFamily(addrp) (addrp)->addr.sa_family
|
||||
extern int _httpAddrPort(http_addr_t *addr)
|
||||
_CUPS_INTERNAL_MSG("Use httpAddrPort instead.");
|
||||
extern void _httpAddrSetPort(http_addr_t *addr, int port);
|
||||
extern char *_httpAssembleUUID(const char *server, int port,
|
||||
const char *name, int number,
|
||||
char *buffer, size_t bufsize)
|
||||
_CUPS_INTERNAL_MSG("Use httpAssembleUUID instead.");
|
||||
extern http_t *_httpCreate(const char *host, int port,
|
||||
http_addrlist_t *addrlist,
|
||||
http_encryption_t encryption,
|
||||
int family)
|
||||
_CUPS_INTERNAL_MSG("Use httpConnect2 or httpAccept instead.");
|
||||
extern http_tls_credentials_t
|
||||
_httpCreateCredentials(cups_array_t *credentials);
|
||||
extern char *_httpDecodeURI(char *dst, const char *src,
|
||||
@@ -416,12 +412,18 @@ extern void _httpDisconnect(http_t *http);
|
||||
extern char *_httpEncodeURI(char *dst, const char *src,
|
||||
size_t dstsize);
|
||||
extern void _httpFreeCredentials(http_tls_credentials_t credentials);
|
||||
extern ssize_t _httpPeek(http_t *http, char *buffer, size_t length)
|
||||
_CUPS_INTERNAL_MSG("Use httpPeek instead.");
|
||||
extern const char *_httpResolveURI(const char *uri, char *resolved_uri,
|
||||
size_t resolved_size, int options,
|
||||
int (*cb)(void *context),
|
||||
void *context);
|
||||
extern const char *_httpStatus(cups_lang_t *lang, http_status_t status);
|
||||
extern void _httpTLSInitialize(void);
|
||||
extern size_t _httpTLSPending(http_t *http);
|
||||
extern int _httpTLSRead(http_t *http, char *buf, int len);
|
||||
extern int _httpTLSSetCredentials(http_t *http);
|
||||
extern int _httpTLSStart(http_t *http);
|
||||
extern void _httpTLSStop(http_t *http);
|
||||
extern int _httpTLSWrite(http_t *http, const char *buf, int len);
|
||||
extern int _httpUpdate(http_t *http, http_status_t *status);
|
||||
extern int _httpWait(http_t *http, int msec, int usessl);
|
||||
|
||||
@@ -437,5 +439,5 @@ extern int _httpWait(http_t *http, int msec, int usessl);
|
||||
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: http-private.h 11392 2013-11-06 01:29:56Z msweet $".
|
||||
* End of "$Id: http-private.h 12044 2014-07-17 21:21:21Z msweet $".
|
||||
*/
|
||||
|
||||
+274
-112
@@ -1,53 +1,18 @@
|
||||
/*
|
||||
* "$Id: http-support.c 11445 2013-12-05 19:57:43Z msweet $"
|
||||
* "$Id: http-support.c 11844 2014-05-02 11:58:54Z msweet $"
|
||||
*
|
||||
* HTTP support routines for CUPS.
|
||||
* HTTP support routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* httpAssembleURI() - Assemble a uniform resource identifier from its
|
||||
* components.
|
||||
* httpAssembleURIf() - Assemble a uniform resource identifier from its
|
||||
* components with a formatted resource.
|
||||
* httpAssembleUUID() - Assemble a name-based UUID URN conforming to RFC
|
||||
* 4122.
|
||||
* httpDecode64() - Base64-decode a string.
|
||||
* httpDecode64_2() - Base64-decode a string.
|
||||
* httpEncode64() - Base64-encode a string.
|
||||
* httpEncode64_2() - Base64-encode a string.
|
||||
* httpGetDateString() - Get a formatted date/time string from a time value.
|
||||
* httpGetDateString2() - Get a formatted date/time string from a time value.
|
||||
* httpGetDateTime() - Get a time value from a formatted date/time string.
|
||||
* httpSeparate() - Separate a Universal Resource Identifier into its
|
||||
* components.
|
||||
* httpSeparate2() - Separate a Universal Resource Identifier into its
|
||||
* components.
|
||||
* httpSeparateURI() - Separate a Universal Resource Identifier into its
|
||||
* components.
|
||||
* httpStatus() - Return a short string describing a HTTP status
|
||||
* code.
|
||||
* _cups_hstrerror() - hstrerror() emulation function for Solaris and
|
||||
* others.
|
||||
* _httpDecodeURI() - Percent-decode a HTTP request URI.
|
||||
* _httpEncodeURI() - Percent-encode a HTTP request URI.
|
||||
* _httpResolveURI() - Resolve a DNS-SD URI.
|
||||
* http_client_cb() - Client callback for resolving URI.
|
||||
* http_copy_decode() - Copy and decode a URI.
|
||||
* http_copy_encode() - Copy and encode a URI.
|
||||
* http_poll_cb() - Wait for input on the specified file descriptors.
|
||||
* http_resolve_cb() - Build a device URI for the given service name.
|
||||
* http_resolve_cb() - Build a device URI for the given service name.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -84,6 +49,7 @@ typedef struct _http_uribuf_s /* URI buffer */
|
||||
size_t bufsize; /* Size of buffer */
|
||||
int options; /* Options passed to _httpResolveURI */
|
||||
const char *resource; /* Resource from URI */
|
||||
const char *uuid; /* UUID from URI */
|
||||
} _http_uribuf_t;
|
||||
|
||||
|
||||
@@ -91,7 +57,7 @@ typedef struct _http_uribuf_s /* URI buffer */
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static const char * const http_days[7] =
|
||||
static const char * const http_days[7] =/* Days of the week */
|
||||
{
|
||||
"Sun",
|
||||
"Mon",
|
||||
@@ -102,7 +68,7 @@ static const char * const http_days[7] =
|
||||
"Sat"
|
||||
};
|
||||
static const char * const http_months[12] =
|
||||
{
|
||||
{ /* Months of the year */
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mar",
|
||||
@@ -116,6 +82,26 @@ static const char * const http_months[12] =
|
||||
"Nov",
|
||||
"Dec"
|
||||
};
|
||||
static const char * const http_states[] =
|
||||
{ /* HTTP state strings */
|
||||
"HTTP_STATE_ERROR",
|
||||
"HTTP_STATE_WAITING",
|
||||
"HTTP_STATE_OPTIONS",
|
||||
"HTTP_STATE_GET",
|
||||
"HTTP_STATE_GET_SEND",
|
||||
"HTTP_STATE_HEAD",
|
||||
"HTTP_STATE_POST",
|
||||
"HTTP_STATE_POST_RECV",
|
||||
"HTTP_STATE_POST_SEND",
|
||||
"HTTP_STATE_PUT",
|
||||
"HTTP_STATE_PUT_RECV",
|
||||
"HTTP_STATE_DELETE",
|
||||
"HTTP_STATE_TRACE",
|
||||
"HTTP_STATE_CONNECT",
|
||||
"HTTP_STATE_STATUS",
|
||||
"HTTP_STATE_UNKNOWN_METHOD",
|
||||
"HTTP_STATE_UNKNOWN_VERSION"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
@@ -206,10 +192,10 @@ httpAssembleURI(
|
||||
if (!ptr)
|
||||
goto assemble_overflow;
|
||||
|
||||
if (!strcmp(scheme, "mailto") || !strcmp(scheme, "tel"))
|
||||
if (!strcmp(scheme, "geo") || !strcmp(scheme, "mailto") || !strcmp(scheme, "tel"))
|
||||
{
|
||||
/*
|
||||
* mailto: and tel: only have :, no //...
|
||||
* geo:, mailto:, and tel: only have :, no //...
|
||||
*/
|
||||
|
||||
if (ptr < end)
|
||||
@@ -220,7 +206,7 @@ httpAssembleURI(
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Schemes other than mailto: and tel: all have //...
|
||||
* Schemes other than geo:, mailto:, and tel: typically have //...
|
||||
*/
|
||||
|
||||
if ((ptr + 2) < end)
|
||||
@@ -372,7 +358,7 @@ httpAssembleURI(
|
||||
|
||||
if (port > 0)
|
||||
{
|
||||
snprintf(ptr, end - ptr + 1, ":%d", port);
|
||||
snprintf(ptr, (size_t)(end - ptr + 1), ":%d", port);
|
||||
ptr += strlen(ptr);
|
||||
|
||||
if (ptr >= end)
|
||||
@@ -486,7 +472,7 @@ httpAssembleURIf(
|
||||
bytes = vsnprintf(resource, sizeof(resource), resourcef, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (bytes >= sizeof(resource))
|
||||
if ((size_t)bytes >= sizeof(resource))
|
||||
{
|
||||
*uri = '\0';
|
||||
return (HTTP_URI_STATUS_OVERFLOW);
|
||||
@@ -534,7 +520,7 @@ httpAssembleUUID(const char *server, /* I - Server name */
|
||||
(unsigned)CUPS_RAND() & 0xffff, (unsigned)CUPS_RAND() & 0xffff);
|
||||
|
||||
_cupsMD5Init(&md5state);
|
||||
_cupsMD5Append(&md5state, (unsigned char *)data, strlen(data));
|
||||
_cupsMD5Append(&md5state, (unsigned char *)data, (int)strlen(data));
|
||||
_cupsMD5Finish(&md5state, md5sum);
|
||||
|
||||
/*
|
||||
@@ -552,13 +538,6 @@ httpAssembleUUID(const char *server, /* I - Server name */
|
||||
return (buffer);
|
||||
}
|
||||
|
||||
/* For OS X 10.8 and earlier */
|
||||
char *_httpAssembleUUID(const char *server, int port, const char *name,
|
||||
int number, char *buffer, size_t bufsize)
|
||||
{
|
||||
return (httpAssembleUUID(server, port, name, number, buffer, bufsize));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpDecode64()' - Base64-decode a string.
|
||||
@@ -597,10 +576,10 @@ httpDecode64_2(char *out, /* I - String to write to */
|
||||
int *outlen, /* IO - Size of output string */
|
||||
const char *in) /* I - String to read from */
|
||||
{
|
||||
int pos, /* Bit position */
|
||||
base64; /* Value of this character */
|
||||
char *outptr, /* Output pointer */
|
||||
*outend; /* End of output buffer */
|
||||
int pos; /* Bit position */
|
||||
unsigned base64; /* Value of this character */
|
||||
char *outptr, /* Output pointer */
|
||||
*outend; /* End of output buffer */
|
||||
|
||||
|
||||
/*
|
||||
@@ -629,11 +608,11 @@ httpDecode64_2(char *out, /* I - String to write to */
|
||||
*/
|
||||
|
||||
if (*in >= 'A' && *in <= 'Z')
|
||||
base64 = *in - 'A';
|
||||
base64 = (unsigned)(*in - 'A');
|
||||
else if (*in >= 'a' && *in <= 'z')
|
||||
base64 = *in - 'a' + 26;
|
||||
base64 = (unsigned)(*in - 'a' + 26);
|
||||
else if (*in >= '0' && *in <= '9')
|
||||
base64 = *in - '0' + 52;
|
||||
base64 = (unsigned)(*in - '0' + 52);
|
||||
else if (*in == '+')
|
||||
base64 = 62;
|
||||
else if (*in == '/')
|
||||
@@ -651,21 +630,21 @@ httpDecode64_2(char *out, /* I - String to write to */
|
||||
{
|
||||
case 0 :
|
||||
if (outptr < outend)
|
||||
*outptr = base64 << 2;
|
||||
*outptr = (char)(base64 << 2);
|
||||
pos ++;
|
||||
break;
|
||||
case 1 :
|
||||
if (outptr < outend)
|
||||
*outptr++ |= (base64 >> 4) & 3;
|
||||
*outptr++ |= (char)((base64 >> 4) & 3);
|
||||
if (outptr < outend)
|
||||
*outptr = (base64 << 4) & 255;
|
||||
*outptr = (char)((base64 << 4) & 255);
|
||||
pos ++;
|
||||
break;
|
||||
case 2 :
|
||||
if (outptr < outend)
|
||||
*outptr++ |= (base64 >> 2) & 15;
|
||||
*outptr++ |= (char)((base64 >> 2) & 15);
|
||||
if (outptr < outend)
|
||||
*outptr = (base64 << 6) & 255;
|
||||
*outptr = (char)((base64 << 6) & 255);
|
||||
pos ++;
|
||||
break;
|
||||
case 3 :
|
||||
@@ -830,10 +809,7 @@ httpGetDateString2(time_t t, /* I - UNIX time */
|
||||
|
||||
tdate = gmtime(&t);
|
||||
if (tdate)
|
||||
snprintf(s, slen, "%s, %02d %s %d %02d:%02d:%02d GMT",
|
||||
http_days[tdate->tm_wday], tdate->tm_mday,
|
||||
http_months[tdate->tm_mon], tdate->tm_year + 1900,
|
||||
tdate->tm_hour, tdate->tm_min, tdate->tm_sec);
|
||||
snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate->tm_wday], tdate->tm_mday, http_months[tdate->tm_mon], tdate->tm_year + 1900, tdate->tm_hour, tdate->tm_min, tdate->tm_sec);
|
||||
else
|
||||
s[0] = '\0';
|
||||
|
||||
@@ -1028,7 +1004,7 @@ httpSeparateURI(
|
||||
* Workaround for HP IPP client bug...
|
||||
*/
|
||||
|
||||
strlcpy(scheme, "ipp", schemelen);
|
||||
strlcpy(scheme, "ipp", (size_t)schemelen);
|
||||
status = HTTP_URI_STATUS_MISSING_SCHEME;
|
||||
}
|
||||
else if (*uri == '/')
|
||||
@@ -1037,7 +1013,7 @@ httpSeparateURI(
|
||||
* Filename...
|
||||
*/
|
||||
|
||||
strlcpy(scheme, "file", schemelen);
|
||||
strlcpy(scheme, "file", (size_t)schemelen);
|
||||
status = HTTP_URI_STATUS_MISSING_SCHEME;
|
||||
}
|
||||
else
|
||||
@@ -1255,7 +1231,7 @@ httpSeparateURI(
|
||||
return (HTTP_URI_STATUS_BAD_PORT);
|
||||
}
|
||||
|
||||
*port = strtol(uri + 1, (char **)&uri, 10);
|
||||
*port = (int)strtol(uri + 1, (char **)&uri, 10);
|
||||
|
||||
if (*uri != '/' && *uri)
|
||||
{
|
||||
@@ -1322,22 +1298,34 @@ httpSeparateURI(
|
||||
|
||||
|
||||
/*
|
||||
* 'httpStatus()' - Return a short string describing a HTTP status code.
|
||||
* 'httpStateString()' - Return the string describing a HTTP state value.
|
||||
*
|
||||
* The returned string is localized to the current POSIX locale and is based
|
||||
* on the status strings defined in RFC 2616.
|
||||
* @since CUPS 2.0@
|
||||
*/
|
||||
|
||||
const char * /* O - State string */
|
||||
httpStateString(http_state_t state) /* I - HTTP state value */
|
||||
{
|
||||
if (state < HTTP_STATE_ERROR || state > HTTP_STATE_UNKNOWN_VERSION)
|
||||
return ("HTTP_STATE_???");
|
||||
else
|
||||
return (http_states[state - HTTP_STATE_ERROR]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpStatus()' - Return the localized string describing a HTTP status code.
|
||||
*
|
||||
* The returned string is localized using the passed message catalog.
|
||||
*/
|
||||
|
||||
const char * /* O - Localized status string */
|
||||
httpStatus(http_status_t status) /* I - HTTP status code */
|
||||
_httpStatus(cups_lang_t *lang, /* I - Language */
|
||||
http_status_t status) /* I - HTTP status code */
|
||||
{
|
||||
const char *s; /* Status string */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
|
||||
|
||||
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case HTTP_STATUS_ERROR :
|
||||
@@ -1419,6 +1407,90 @@ httpStatus(http_status_t status) /* I - HTTP status code */
|
||||
break;
|
||||
}
|
||||
|
||||
return (_cupsLangString(lang, s));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpStatus()' - Return a short string describing a HTTP status code.
|
||||
*
|
||||
* The returned string is localized to the current POSIX locale and is based
|
||||
* on the status strings defined in RFC 2616.
|
||||
*/
|
||||
|
||||
const char * /* O - Localized status string */
|
||||
httpStatus(http_status_t status) /* I - HTTP status code */
|
||||
{
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
|
||||
|
||||
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
return (_httpStatus(cg->lang_default, status));
|
||||
}
|
||||
|
||||
/*
|
||||
* 'httpURIStatusString()' - Return a string describing a URI status code.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
*/
|
||||
|
||||
const char * /* O - Localized status string */
|
||||
httpURIStatusString(
|
||||
http_uri_status_t status) /* I - URI status code */
|
||||
{
|
||||
const char *s; /* Status string */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
|
||||
|
||||
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case HTTP_URI_STATUS_OVERFLOW :
|
||||
s = _("URI too large");
|
||||
break;
|
||||
case HTTP_URI_STATUS_BAD_ARGUMENTS :
|
||||
s = _("Bad arguments to function");
|
||||
break;
|
||||
case HTTP_URI_STATUS_BAD_RESOURCE :
|
||||
s = _("Bad resource in URI");
|
||||
break;
|
||||
case HTTP_URI_STATUS_BAD_PORT :
|
||||
s = _("Bad port number in URI");
|
||||
break;
|
||||
case HTTP_URI_STATUS_BAD_HOSTNAME :
|
||||
s = _("Bad hostname/address in URI");
|
||||
break;
|
||||
case HTTP_URI_STATUS_BAD_USERNAME :
|
||||
s = _("Bad username in URI");
|
||||
break;
|
||||
case HTTP_URI_STATUS_BAD_SCHEME :
|
||||
s = _("Bad scheme in URI");
|
||||
break;
|
||||
case HTTP_URI_STATUS_BAD_URI :
|
||||
s = _("Bad/empty URI");
|
||||
break;
|
||||
case HTTP_URI_STATUS_OK :
|
||||
s = _("OK");
|
||||
break;
|
||||
case HTTP_URI_STATUS_MISSING_SCHEME :
|
||||
s = _("Missing scheme in URI");
|
||||
break;
|
||||
case HTTP_URI_STATUS_UNKNOWN_SCHEME :
|
||||
s = _("Unknown scheme in URI");
|
||||
break;
|
||||
case HTTP_URI_STATUS_MISSING_RESOURCE :
|
||||
s = _("Missing resource in URI");
|
||||
break;
|
||||
|
||||
default:
|
||||
s = _("Unknown");
|
||||
break;
|
||||
}
|
||||
|
||||
return (_cupsLangString(cg->lang_default, s));
|
||||
}
|
||||
|
||||
@@ -1538,7 +1610,9 @@ _httpResolveURI(
|
||||
{
|
||||
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
char *regtype, /* Pointer to type in hostname */
|
||||
*domain; /* Pointer to domain in hostname */
|
||||
*domain, /* Pointer to domain in hostname */
|
||||
*uuid, /* Pointer to UUID in URI */
|
||||
*uuidend; /* Pointer to end of UUID in URI */
|
||||
_http_uribuf_t uribuf; /* URI buffer */
|
||||
int offline = 0; /* offline-report state set? */
|
||||
# ifdef HAVE_DNSSD
|
||||
@@ -1546,9 +1620,11 @@ _httpResolveURI(
|
||||
# pragma comment(lib, "dnssd.lib")
|
||||
# endif /* WIN32 */
|
||||
DNSServiceRef ref, /* DNS-SD master service reference */
|
||||
domainref, /* DNS-SD service reference for domain */
|
||||
domainref = NULL,/* DNS-SD service reference for domain */
|
||||
ippref = NULL, /* DNS-SD service reference for network IPP */
|
||||
ippsref = NULL, /* DNS-SD service reference for network IPPS */
|
||||
localref; /* DNS-SD service reference for .local */
|
||||
int domainsent = 0; /* Send the domain resolve? */
|
||||
int extrasent = 0; /* Send the domain/IPP/IPPS resolves? */
|
||||
# ifdef HAVE_POLL
|
||||
struct pollfd polldata; /* Polling data */
|
||||
# else /* select() */
|
||||
@@ -1595,12 +1671,21 @@ _httpResolveURI(
|
||||
if (domain)
|
||||
*domain++ = '\0';
|
||||
|
||||
if ((uuid = strstr(resource, "?uuid=")) != NULL)
|
||||
{
|
||||
*uuid = '\0';
|
||||
uuid += 6;
|
||||
if ((uuidend = strchr(uuid, '&')) != NULL)
|
||||
*uuidend = '\0';
|
||||
}
|
||||
|
||||
resolved_uri[0] = '\0';
|
||||
|
||||
uribuf.buffer = resolved_uri;
|
||||
uribuf.bufsize = resolved_size;
|
||||
uribuf.options = options;
|
||||
uribuf.resource = resource;
|
||||
|
||||
resolved_uri[0] = '\0';
|
||||
uribuf.uuid = uuid;
|
||||
|
||||
DEBUG_printf(("6_httpResolveURI: Resolving hostname=\"%s\", regtype=\"%s\", "
|
||||
"domain=\"%s\"\n", hostname, regtype, domain));
|
||||
@@ -1616,7 +1701,7 @@ _httpResolveURI(
|
||||
# ifdef HAVE_DNSSD
|
||||
if (DNSServiceCreateConnection(&ref) == kDNSServiceErr_NoError)
|
||||
{
|
||||
int myinterface = kDNSServiceInterfaceIndexAny;
|
||||
uint32_t myinterface = kDNSServiceInterfaceIndexAny;
|
||||
/* Lookup on any interface */
|
||||
|
||||
if (!strcmp(scheme, "ippusb"))
|
||||
@@ -1656,7 +1741,7 @@ _httpResolveURI(
|
||||
polldata.fd = DNSServiceRefSockFD(ref);
|
||||
polldata.events = POLLIN;
|
||||
|
||||
fds = poll(&polldata, 1, 1000 * timeout);
|
||||
fds = poll(&polldata, 1, (int)(1000 * timeout));
|
||||
|
||||
# else /* select() */
|
||||
FD_ZERO(&input_set);
|
||||
@@ -1688,7 +1773,7 @@ _httpResolveURI(
|
||||
* comes in, do an additional domain resolution...
|
||||
*/
|
||||
|
||||
if (domainsent == 0 && domain && _cups_strcasecmp(domain, "local."))
|
||||
if (extrasent == 0 && domain && _cups_strcasecmp(domain, "local."))
|
||||
{
|
||||
if (options & _HTTP_RESOLVE_STDERR)
|
||||
fprintf(stderr,
|
||||
@@ -1702,7 +1787,33 @@ _httpResolveURI(
|
||||
myinterface, hostname, regtype, domain,
|
||||
http_resolve_cb,
|
||||
&uribuf) == kDNSServiceErr_NoError)
|
||||
domainsent = 1;
|
||||
extrasent = 1;
|
||||
}
|
||||
else if (extrasent == 0 && !strcmp(scheme, "ippusb"))
|
||||
{
|
||||
if (options & _HTTP_RESOLVE_STDERR)
|
||||
fprintf(stderr, "DEBUG: Resolving \"%s\", regtype=\"_ipps._tcp\", domain=\"local.\"...\n", hostname);
|
||||
|
||||
ippsref = ref;
|
||||
if (DNSServiceResolve(&ippsref,
|
||||
kDNSServiceFlagsShareConnection,
|
||||
kDNSServiceInterfaceIndexAny, hostname,
|
||||
"_ipps._tcp", domain, http_resolve_cb,
|
||||
&uribuf) == kDNSServiceErr_NoError)
|
||||
extrasent = 1;
|
||||
}
|
||||
else if (extrasent == 1 && !strcmp(scheme, "ippusb"))
|
||||
{
|
||||
if (options & _HTTP_RESOLVE_STDERR)
|
||||
fprintf(stderr, "DEBUG: Resolving \"%s\", regtype=\"_ipp._tcp\", domain=\"local.\"...\n", hostname);
|
||||
|
||||
ippref = ref;
|
||||
if (DNSServiceResolve(&ippref,
|
||||
kDNSServiceFlagsShareConnection,
|
||||
kDNSServiceInterfaceIndexAny, hostname,
|
||||
"_ipp._tcp", domain, http_resolve_cb,
|
||||
&uribuf) == kDNSServiceErr_NoError)
|
||||
extrasent = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1719,7 +1830,8 @@ _httpResolveURI(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DNSServiceProcessResult(ref) == kDNSServiceErr_NoError)
|
||||
if (DNSServiceProcessResult(ref) == kDNSServiceErr_NoError &&
|
||||
resolved_uri[0])
|
||||
{
|
||||
uri = resolved_uri;
|
||||
break;
|
||||
@@ -1727,8 +1839,15 @@ _httpResolveURI(
|
||||
}
|
||||
}
|
||||
|
||||
if (domainsent)
|
||||
DNSServiceRefDeallocate(domainref);
|
||||
if (extrasent)
|
||||
{
|
||||
if (domainref)
|
||||
DNSServiceRefDeallocate(domainref);
|
||||
if (ippref)
|
||||
DNSServiceRefDeallocate(ippref);
|
||||
if (ippsref)
|
||||
DNSServiceRefDeallocate(ippsref);
|
||||
}
|
||||
|
||||
DNSServiceRefDeallocate(localref);
|
||||
}
|
||||
@@ -1920,7 +2039,7 @@ http_copy_decode(char *dst, /* O - Destination buffer */
|
||||
else
|
||||
quoted |= *src - '0';
|
||||
|
||||
*ptr++ = quoted;
|
||||
*ptr++ = (char)quoted;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2032,6 +2151,31 @@ http_resolve_cb(
|
||||
interfaceIndex, errorCode, fullName, hostTarget, port, txtLen,
|
||||
txtRecord, context));
|
||||
|
||||
/*
|
||||
* If we have a UUID, compare it...
|
||||
*/
|
||||
|
||||
if (uribuf->uuid &&
|
||||
(value = TXTRecordGetValuePtr(txtLen, txtRecord, "UUID",
|
||||
&valueLen)) != NULL)
|
||||
{
|
||||
char uuid[256]; /* UUID value */
|
||||
|
||||
memcpy(uuid, value, valueLen);
|
||||
uuid[valueLen] = '\0';
|
||||
|
||||
if (_cups_strcasecmp(uuid, uribuf->uuid))
|
||||
{
|
||||
if (uribuf->options & _HTTP_RESOLVE_STDERR)
|
||||
fprintf(stderr, "DEBUG: Found UUID %s, looking for %s.", uuid,
|
||||
uribuf->uuid);
|
||||
|
||||
DEBUG_printf(("7http_resolve_cb: Found UUID %s, looking for %s.", uuid,
|
||||
uribuf->uuid));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Figure out the scheme from the full name...
|
||||
*/
|
||||
@@ -2123,9 +2267,7 @@ http_resolve_cb(
|
||||
{
|
||||
for (addr = addrlist; addr; addr = addr->next)
|
||||
{
|
||||
int error = getnameinfo(&(addr->addr.addr),
|
||||
httpAddrLength(&(addr->addr)),
|
||||
fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
|
||||
int error = getnameinfo(&(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr)), fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
@@ -2156,12 +2298,9 @@ http_resolve_cb(
|
||||
|
||||
if ((!strcmp(scheme, "ipp") || !strcmp(scheme, "ipps")) &&
|
||||
!strcmp(uribuf->resource, "/cups"))
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, uribuf->buffer, uribuf->bufsize,
|
||||
scheme, NULL, hostTarget, ntohs(port), "%s?snmp=false",
|
||||
resource);
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, uribuf->buffer, (int)uribuf->bufsize, scheme, NULL, hostTarget, ntohs(port), "%s?snmp=false", resource);
|
||||
else
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uribuf->buffer, uribuf->bufsize,
|
||||
scheme, NULL, hostTarget, ntohs(port), resource);
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uribuf->buffer, (int)uribuf->bufsize, scheme, NULL, hostTarget, ntohs(port), resource);
|
||||
|
||||
DEBUG_printf(("8http_resolve_cb: Resolved URI is \"%s\"...", uribuf->buffer));
|
||||
}
|
||||
@@ -2236,6 +2375,31 @@ http_resolve_cb(
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have a UUID, compare it...
|
||||
*/
|
||||
|
||||
if (uribuf->uuid && (pair = avahi_string_list_find(txt, "UUID")) != NULL)
|
||||
{
|
||||
char uuid[256]; /* UUID value */
|
||||
|
||||
avahi_string_list_get_pair(pair, NULL, &value, &valueLen);
|
||||
|
||||
memcpy(uuid, value, valueLen);
|
||||
uuid[valueLen] = '\0';
|
||||
|
||||
if (_cups_strcasecmp(uuid, uribuf->uuid))
|
||||
{
|
||||
if (uribuf->options & _HTTP_RESOLVE_STDERR)
|
||||
fprintf(stderr, "DEBUG: Found UUID %s, looking for %s.", uuid,
|
||||
uribuf->uuid);
|
||||
|
||||
DEBUG_printf(("7http_resolve_cb: Found UUID %s, looking for %s.", uuid,
|
||||
uribuf->uuid));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Figure out the scheme from the full name...
|
||||
*/
|
||||
@@ -2341,9 +2505,7 @@ http_resolve_cb(
|
||||
{
|
||||
for (addr = addrlist; addr; addr = addr->next)
|
||||
{
|
||||
int error = getnameinfo(&(addr->addr.addr),
|
||||
httpAddrLength(&(addr->addr)),
|
||||
fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
|
||||
int error = getnameinfo(&(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr)), fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
@@ -2382,5 +2544,5 @@ http_resolve_cb(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: http-support.c 11445 2013-12-05 19:57:43Z msweet $".
|
||||
* End of "$Id: http-support.c 11844 2014-05-02 11:58:54Z msweet $".
|
||||
*/
|
||||
|
||||
+500
-1584
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+47
-14
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* "$Id: http.h 11085 2013-07-03 13:53:05Z msweet $"
|
||||
* "$Id: http.h 11850 2014-05-07 23:12:48Z msweet $"
|
||||
*
|
||||
* Hyper-Text Transport Protocol definitions for CUPS.
|
||||
* Hyper-Text Transport Protocol definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_HTTP_H_
|
||||
@@ -87,8 +87,6 @@ extern "C" {
|
||||
# define s6_addr32 _S6_un._S6_u32
|
||||
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
|
||||
# define s6_addr32 __u6_addr.__u6_addr32
|
||||
# elif defined(__osf__)
|
||||
# define s6_addr32 s6_un.sa6_laddr
|
||||
# elif defined(WIN32)
|
||||
/*
|
||||
* Windows only defines byte and 16-bit word members of the union and
|
||||
@@ -344,6 +342,16 @@ typedef enum http_status_e /**** HTTP status codes ****/
|
||||
# endif /* !_CUPS_NO_DEPRECATED */
|
||||
} http_status_t;
|
||||
|
||||
typedef enum http_trust_e /**** Level of trust for credentials @since CUPS 2.0@ */
|
||||
{
|
||||
HTTP_TRUST_OK = 0, /* Credentials are OK/trusted */
|
||||
HTTP_TRUST_INVALID, /* Credentials are invalid */
|
||||
HTTP_TRUST_CHANGED, /* Credentials have changed */
|
||||
HTTP_TRUST_EXPIRED, /* Credentials are expired */
|
||||
HTTP_TRUST_RENEWED, /* Credentials have been renewed */
|
||||
HTTP_TRUST_UNKNOWN, /* Credentials are unknown/new */
|
||||
} http_trust_t;
|
||||
|
||||
typedef enum http_uri_status_e /**** URI separation status @since CUPS 1.2@ ****/
|
||||
{
|
||||
HTTP_URI_STATUS_OVERFLOW = -8, /* URI buffer for httpAssembleURI is too small */
|
||||
@@ -585,7 +593,7 @@ extern int httpReconnect2(http_t *http, int msec, int *cancel)
|
||||
_CUPS_API_1_6;
|
||||
|
||||
|
||||
/**** New in CUPS 1.7 ****/
|
||||
/**** New in CUPS 1.7/OS X 10.9 ****/
|
||||
extern http_t *httpAcceptConnection(int fd, int blocking)
|
||||
_CUPS_API_1_7;
|
||||
extern http_addrlist_t *httpAddrCopyList(http_addrlist_t *src) _CUPS_API_1_7;
|
||||
@@ -612,6 +620,31 @@ extern void httpSetDefaultField(http_t *http, http_field_t field,
|
||||
extern http_state_t httpWriteResponse(http_t *http,
|
||||
http_status_t status) _CUPS_API_1_7;
|
||||
|
||||
/* New in CUPS 2.0 */
|
||||
extern int httpAddrClose(http_addr_t *addr, int fd) _CUPS_API_2_0;
|
||||
extern int httpAddrFamily(http_addr_t *addr) _CUPS_API_2_0;
|
||||
extern int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2) _CUPS_API_2_0;
|
||||
extern int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);
|
||||
extern time_t httpCredentialsGetExpiration(cups_array_t *credentials) _CUPS_API_2_0;
|
||||
extern http_trust_t httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name) _CUPS_API_2_0;
|
||||
extern size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize) _CUPS_API_2_0;
|
||||
extern http_field_t httpFieldValue(const char *name) _CUPS_API_2_0;
|
||||
extern time_t httpGetActivity(http_t *http) _CUPS_API_2_0;
|
||||
extern http_addr_t *httpGetAddress(http_t *http) _CUPS_API_2_0;
|
||||
extern http_encryption_t httpGetEncryption(http_t *http) _CUPS_API_2_0;
|
||||
extern http_keepalive_t httpGetKeepAlive(http_t *http) _CUPS_API_2_0;
|
||||
extern size_t httpGetPending(http_t *http) _CUPS_API_2_0;
|
||||
extern size_t httpGetReady(http_t *http) _CUPS_API_2_0;
|
||||
extern size_t httpGetRemaining(http_t *http) _CUPS_API_2_0;
|
||||
extern int httpIsChunked(http_t *http) _CUPS_API_2_0;
|
||||
extern int httpIsEncrypted(http_t *http) _CUPS_API_2_0;
|
||||
extern int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name) _CUPS_API_2_0;
|
||||
extern const char *httpResolveHostname(http_t *http, char *buffer, size_t bufsize) _CUPS_API_2_0;
|
||||
extern int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name) _CUPS_API_2_0;
|
||||
extern void httpSetKeepAlive(http_t *http, http_keepalive_t keep_alive) _CUPS_API_2_0;
|
||||
extern void httpShutdown(http_t *http) _CUPS_API_2_0;
|
||||
extern const char *httpStateString(http_state_t state) _CUPS_API_2_0;
|
||||
extern const char *httpURIStatusString(http_uri_status_t status) _CUPS_API_2_0;
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
@@ -623,5 +656,5 @@ extern http_state_t httpWriteResponse(http_t *http,
|
||||
#endif /* !_CUPS_HTTP_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: http.h 11085 2013-07-03 13:53:05Z msweet $".
|
||||
* End of "$Id: http.h 11850 2014-05-07 23:12:48Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-11
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* "$Id: ipp-private.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: ipp-private.h 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* Private IPP definitions for CUPS.
|
||||
* Private IPP definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_IPP_PRIVATE_H_
|
||||
@@ -77,5 +77,5 @@ extern _ipp_option_t *_ippFindOption(const char *name);
|
||||
#endif /* !_CUPS_IPP_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp-private.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: ipp-private.h 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+105
-103
@@ -1,39 +1,18 @@
|
||||
/*
|
||||
* "$Id: ipp-support.c 11734 2014-03-25 18:01:47Z msweet $"
|
||||
* "$Id: ipp-support.c 11806 2014-04-09 16:12:27Z msweet $"
|
||||
*
|
||||
* Internet Printing Protocol support functions for CUPS.
|
||||
* Internet Printing Protocol support functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* ippAttributeString() - Convert the attribute's value to a string.
|
||||
* ippCreateRequestedArray() - Create a CUPS array of attribute names from
|
||||
* the given requested-attributes attribute.
|
||||
* ippEnumString() - Return a string corresponding to the enum
|
||||
* value.
|
||||
* ippEnumValue() - Return the value associated with a given enum
|
||||
* string.
|
||||
* ippErrorString() - Return a name for the given status code.
|
||||
* ippErrorValue() - Return a status code for the given name.
|
||||
* ippOpString() - Return a name for the given operation id.
|
||||
* ippOpValue() - Return an operation id for the given name.
|
||||
* ippPort() - Return the default IPP port number.
|
||||
* ippSetPort() - Set the default port number.
|
||||
* ippTagString() - Return the tag name corresponding to a tag
|
||||
* value.
|
||||
* ippTagValue() - Return the tag value corresponding to a tag
|
||||
* name.
|
||||
* ipp_col_string() - Convert a collection to a string.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -47,6 +26,14 @@
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static const char * const ipp_states[] =
|
||||
{
|
||||
"IPP_STATE_ERROR",
|
||||
"IPP_STATE_IDLE",
|
||||
"IPP_STATE_HEADER",
|
||||
"IPP_STATE_ATTRIBUTE",
|
||||
"IPP_STATE_DATA"
|
||||
};
|
||||
static const char * const ipp_status_oks[] = /* "OK" status codes */
|
||||
{ /* (name) = abandoned standard value */
|
||||
"successful-ok",
|
||||
@@ -87,7 +74,11 @@ static const char * const ipp_status_oks[] = /* "OK" status codes */
|
||||
"client-error-document-password-error",
|
||||
"client-error-document-permission-error",
|
||||
"client-error-document-security-error",
|
||||
"client-error-document-unprintable-error"
|
||||
"client-error-document-unprintable-error",
|
||||
"client-error-account-info-needed",
|
||||
"client-error-account-closed",
|
||||
"client-error-account-limit-reached",
|
||||
"client-error-account-authorization-failed"
|
||||
},
|
||||
* const ipp_status_480s[] = /* Vendor client errors */
|
||||
{
|
||||
@@ -334,7 +325,7 @@ static const char * const ipp_document_states[] =
|
||||
"pending",
|
||||
"4",
|
||||
"processing",
|
||||
"6",
|
||||
"processing-stopped", /* IPPSIX */
|
||||
"canceled",
|
||||
"aborted",
|
||||
"completed"
|
||||
@@ -353,8 +344,8 @@ static const char * const ipp_document_states[] =
|
||||
"bale",
|
||||
"booklet-maker",
|
||||
"jog-offset",
|
||||
"15",
|
||||
"16",
|
||||
"coat", /* Finishings 2.0 */
|
||||
"laminate", /* Finishings 2.0 */
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
@@ -370,10 +361,10 @@ static const char * const ipp_document_states[] =
|
||||
"staple-dual-top",
|
||||
"staple-dual-right",
|
||||
"staple-dual-bottom",
|
||||
"32",
|
||||
"33",
|
||||
"34",
|
||||
"35",
|
||||
"staple-triple-left", /* Finishings 2.0 */
|
||||
"staple-triple-top", /* Finishings 2.0 */
|
||||
"staple-triple-right",/* Finishings 2.0 */
|
||||
"staple-triple-bottom",/* Finishings 2.0 */
|
||||
"36",
|
||||
"37",
|
||||
"38",
|
||||
@@ -408,37 +399,37 @@ static const char * const ipp_document_states[] =
|
||||
"67",
|
||||
"68",
|
||||
"69",
|
||||
"punch-top-left",
|
||||
"punch-bottom-left",
|
||||
"punch-top-right",
|
||||
"punch-bottom-right",
|
||||
"punch-dual-left",
|
||||
"punch-dual-top",
|
||||
"punch-dual-right",
|
||||
"punch-dual-bottom",
|
||||
"punch-triple-left",
|
||||
"punch-triple-top",
|
||||
"punch-triple-right",
|
||||
"punch-triple-bottom",
|
||||
"punch-quad-left",
|
||||
"punch-quad-top",
|
||||
"punch-quad-right",
|
||||
"punch-quad-bottom",
|
||||
"punch-top-left", /* Finishings 2.0 */
|
||||
"punch-bottom-left", /* Finishings 2.0 */
|
||||
"punch-top-right", /* Finishings 2.0 */
|
||||
"punch-bottom-right", /* Finishings 2.0 */
|
||||
"punch-dual-left", /* Finishings 2.0 */
|
||||
"punch-dual-top", /* Finishings 2.0 */
|
||||
"punch-dual-right", /* Finishings 2.0 */
|
||||
"punch-dual-bottom", /* Finishings 2.0 */
|
||||
"punch-triple-left", /* Finishings 2.0 */
|
||||
"punch-triple-top", /* Finishings 2.0 */
|
||||
"punch-triple-right", /* Finishings 2.0 */
|
||||
"punch-triple-bottom",/* Finishings 2.0 */
|
||||
"punch-quad-left", /* Finishings 2.0 */
|
||||
"punch-quad-top", /* Finishings 2.0 */
|
||||
"punch-quad-right", /* Finishings 2.0 */
|
||||
"punch-quad-bottom", /* Finishings 2.0 */
|
||||
"86",
|
||||
"87",
|
||||
"88",
|
||||
"89",
|
||||
"fold-accordian",
|
||||
"fold-double-gate",
|
||||
"fold-gate",
|
||||
"fold-half",
|
||||
"fold-half-z",
|
||||
"fold-left-gate",
|
||||
"fold-letter",
|
||||
"fold-parallel",
|
||||
"fold-poster",
|
||||
"fold-right-gate",
|
||||
"fold-z"
|
||||
"fold-accordian", /* Finishings 2.0 */
|
||||
"fold-double-gate", /* Finishings 2.0 */
|
||||
"fold-gate", /* Finishings 2.0 */
|
||||
"fold-half", /* Finishings 2.0 */
|
||||
"fold-half-z", /* Finishings 2.0 */
|
||||
"fold-left-gate", /* Finishings 2.0 */
|
||||
"fold-letter", /* Finishings 2.0 */
|
||||
"fold-parallel", /* Finishings 2.0 */
|
||||
"fold-poster", /* Finishings 2.0 */
|
||||
"fold-right-gate", /* Finishings 2.0 */
|
||||
"fold-z" /* Finishings 2.0 */
|
||||
},
|
||||
* const ipp_finishings_vendor[] =
|
||||
{
|
||||
@@ -572,7 +563,8 @@ static const char * const ipp_document_states[] =
|
||||
"portrait",
|
||||
"landscape",
|
||||
"reverse-landscape",
|
||||
"reverse-portrait"
|
||||
"reverse-portrait",
|
||||
"none"
|
||||
},
|
||||
* const ipp_print_qualities[] =
|
||||
{ /* print-quality enums */
|
||||
@@ -650,53 +642,44 @@ ippAttributeString(
|
||||
ptr = ippEnumString(attr->name, val->integer);
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
strlcpy(bufptr, ptr, bufend - bufptr + 1);
|
||||
strlcpy(bufptr, ptr, (size_t)(bufend - bufptr + 1));
|
||||
|
||||
bufptr += strlen(ptr);
|
||||
break;
|
||||
|
||||
case IPP_TAG_INTEGER :
|
||||
if (buffer && bufptr < bufend)
|
||||
bufptr += snprintf(bufptr, bufend - bufptr + 1, "%d", val->integer);
|
||||
bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d", val->integer);
|
||||
else
|
||||
bufptr += snprintf(temp, sizeof(temp), "%d", val->integer);
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
if (buffer && bufptr < bufend)
|
||||
strlcpy(bufptr, val->boolean ? "true" : "false",
|
||||
bufend - bufptr + 1);
|
||||
strlcpy(bufptr, val->boolean ? "true" : "false", (size_t)(bufend - bufptr + 1));
|
||||
|
||||
bufptr += val->boolean ? 4 : 5;
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
if (buffer && bufptr < bufend)
|
||||
bufptr += snprintf(bufptr, bufend - bufptr + 1, "%d-%d",
|
||||
val->range.lower, val->range.upper);
|
||||
bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d-%d", val->range.lower, val->range.upper);
|
||||
else
|
||||
bufptr += snprintf(temp, sizeof(temp), "%d-%d", val->range.lower,
|
||||
val->range.upper);
|
||||
bufptr += snprintf(temp, sizeof(temp), "%d-%d", val->range.lower, val->range.upper);
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
if (buffer && bufptr < bufend)
|
||||
bufptr += snprintf(bufptr, bufend - bufptr + 1, "%dx%d%s",
|
||||
val->resolution.xres, val->resolution.yres,
|
||||
val->resolution.units == IPP_RES_PER_INCH ?
|
||||
"dpi" : "dpcm");
|
||||
bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
else
|
||||
bufptr += snprintf(temp, sizeof(temp), "%dx%d%s",
|
||||
val->resolution.xres, val->resolution.yres,
|
||||
val->resolution.units == IPP_RES_PER_INCH ?
|
||||
"dpi" : "dpcm");
|
||||
bufptr += snprintf(temp, sizeof(temp), "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
break;
|
||||
|
||||
case IPP_TAG_DATE :
|
||||
{
|
||||
unsigned year; /* Year */
|
||||
|
||||
year = (val->date[0] << 8) + val->date[1];
|
||||
year = ((unsigned)val->date[0] << 8) + (unsigned)val->date[1];
|
||||
|
||||
if (val->date[9] == 0 && val->date[10] == 0)
|
||||
snprintf(temp, sizeof(temp), "%04u-%02u-%02uT%02u:%02u:%02uZ",
|
||||
@@ -710,7 +693,7 @@ ippAttributeString(
|
||||
val->date[10]);
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
strlcpy(bufptr, temp, bufend - bufptr + 1);
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr + 1));
|
||||
|
||||
bufptr += strlen(temp);
|
||||
}
|
||||
@@ -754,7 +737,7 @@ ippAttributeString(
|
||||
bufptr ++;
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
strlcpy(bufptr, val->string.language, bufend - bufptr);
|
||||
strlcpy(bufptr, val->string.language, (size_t)(bufend - bufptr));
|
||||
bufptr += strlen(val->string.language);
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
@@ -765,8 +748,7 @@ ippAttributeString(
|
||||
|
||||
case IPP_TAG_BEGIN_COLLECTION :
|
||||
if (buffer && bufptr < bufend)
|
||||
bufptr += ipp_col_string(val->collection, bufptr,
|
||||
bufend - bufptr + 1);
|
||||
bufptr += ipp_col_string(val->collection, bufptr, (size_t)(bufend - bufptr + 1));
|
||||
else
|
||||
bufptr += ipp_col_string(val->collection, NULL, 0);
|
||||
break;
|
||||
@@ -788,11 +770,9 @@ ippAttributeString(
|
||||
else if (!isprint(*ptr & 255))
|
||||
{
|
||||
if (buffer && bufptr < bufend)
|
||||
bufptr += snprintf(bufptr, bufend - bufptr + 1, "\\%03o",
|
||||
*ptr & 255);
|
||||
bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "\\%03o", *ptr & 255);
|
||||
else
|
||||
bufptr += snprintf(temp, sizeof(temp), "\\%03o",
|
||||
*ptr & 255);
|
||||
bufptr += snprintf(temp, sizeof(temp), "\\%03o", *ptr & 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -806,7 +786,7 @@ ippAttributeString(
|
||||
default :
|
||||
ptr = ippTagString(attr->value_tag);
|
||||
if (buffer && bufptr < bufend)
|
||||
strlcpy(bufptr, ptr, bufend - bufptr + 1);
|
||||
strlcpy(bufptr, ptr, (size_t)(bufend - bufptr + 1));
|
||||
bufptr += strlen(ptr);
|
||||
break;
|
||||
}
|
||||
@@ -817,7 +797,7 @@ ippAttributeString(
|
||||
else if (bufend)
|
||||
*bufend = '\0';
|
||||
|
||||
return (bufptr - buffer);
|
||||
return ((size_t)(bufptr - buffer));
|
||||
}
|
||||
|
||||
|
||||
@@ -1550,11 +1530,16 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"printer-fax-modem-info", /* IPP FaxOut */
|
||||
"printer-fax-modem-name", /* IPP FaxOut */
|
||||
"printer-fax-modem-number", /* IPP FaxOut */
|
||||
"printer-firmware-name", /* PWG 5110.1 */
|
||||
"printer-firmware-patches", /* PWG 5110.1 */
|
||||
"printer-firmware-string-version", /* PWG 5110.1 */
|
||||
"printer-firmware-version", /* PWG 5110.1 */
|
||||
"printer-geo-location",
|
||||
"printer-get-attributes-supported",
|
||||
"printer-icc-profiles",
|
||||
"printer-icons",
|
||||
"printer-info",
|
||||
"printer-input-tray", /* IPP JPS3 */
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-is-shared", /* CUPS extension */
|
||||
"printer-kind", /* IPP Paid Printing */
|
||||
@@ -1570,6 +1555,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"printer-native-formats",
|
||||
"printer-organization",
|
||||
"printer-organizational-unit",
|
||||
"printer-output-tray", /* IPP JPS3 */
|
||||
"printer-settable-attributes-supported",
|
||||
"printer-state",
|
||||
"printer-state-change-date-time",
|
||||
@@ -1858,7 +1844,7 @@ ippEnumValue(const char *attrname, /* I - Attribute name */
|
||||
*/
|
||||
|
||||
if (isdigit(*enumstring & 255))
|
||||
return (strtol(enumstring, NULL, 0));
|
||||
return ((int)strtol(enumstring, NULL, 0));
|
||||
|
||||
/*
|
||||
* Otherwise look up the string...
|
||||
@@ -1953,7 +1939,7 @@ ippErrorString(ipp_status_t error) /* I - Error status */
|
||||
else if (error == IPP_STATUS_CUPS_SEE_OTHER)
|
||||
return ("cups-see-other");
|
||||
else if (error >= IPP_STATUS_ERROR_BAD_REQUEST &&
|
||||
error <= IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE)
|
||||
error <= IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED)
|
||||
return (ipp_status_400s[error - IPP_STATUS_ERROR_BAD_REQUEST]);
|
||||
else if (error >= 0x480 &&
|
||||
error <= IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
|
||||
@@ -1985,7 +1971,7 @@ ippErrorString(ipp_status_t error) /* I - Error status */
|
||||
ipp_status_t /* O - IPP status code */
|
||||
ippErrorValue(const char *name) /* I - Name */
|
||||
{
|
||||
int i;
|
||||
size_t i; /* Looping var */
|
||||
|
||||
|
||||
for (i = 0; i < (sizeof(ipp_status_oks) / sizeof(ipp_status_oks[0])); i ++)
|
||||
@@ -2062,7 +2048,7 @@ ippOpString(ipp_op_t op) /* I - Operation ID */
|
||||
ipp_op_t /* O - Operation ID */
|
||||
ippOpValue(const char *name) /* I - Textual name */
|
||||
{
|
||||
int i;
|
||||
size_t i; /* Looping var */
|
||||
|
||||
|
||||
if (!strncmp(name, "0x", 2))
|
||||
@@ -2133,6 +2119,22 @@ ippSetPort(int p) /* I - Port number to use */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ippStateString()' - Return the name corresponding to a state value.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
*/
|
||||
|
||||
const char * /* O - State name */
|
||||
ippStateString(ipp_state_t state) /* I - State value */
|
||||
{
|
||||
if (state >= IPP_STATE_ERROR && state <= IPP_STATE_DATA)
|
||||
return (ipp_states[state - IPP_STATE_ERROR]);
|
||||
else
|
||||
return ("UNKNOWN");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ippTagString()' - Return the tag name corresponding to a tag value.
|
||||
*
|
||||
@@ -2164,7 +2166,7 @@ ippTagString(ipp_tag_t tag) /* I - Tag value */
|
||||
ipp_tag_t /* O - Tag value */
|
||||
ippTagValue(const char *name) /* I - Tag name */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
size_t i; /* Looping var */
|
||||
|
||||
|
||||
for (i = 0; i < (sizeof(ipp_tag_names) / sizeof(ipp_tag_names[0])); i ++)
|
||||
@@ -2228,12 +2230,12 @@ ipp_col_string(ipp_t *col, /* I - Collection attribute */
|
||||
prefix = ' ';
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
bufptr += snprintf(bufptr, bufend - bufptr + 1, "%s=", attr->name);
|
||||
bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%s=", attr->name);
|
||||
else
|
||||
bufptr += strlen(attr->name) + 1;
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
bufptr += ippAttributeString(attr, bufptr, bufend - bufptr + 1);
|
||||
bufptr += ippAttributeString(attr, bufptr, (size_t)(bufend - bufptr + 1));
|
||||
else
|
||||
bufptr += ippAttributeString(attr, temp, sizeof(temp));
|
||||
}
|
||||
@@ -2249,10 +2251,10 @@ ipp_col_string(ipp_t *col, /* I - Collection attribute */
|
||||
*bufptr = '}';
|
||||
bufptr ++;
|
||||
|
||||
return (bufptr - buffer);
|
||||
return ((size_t)(bufptr - buffer));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp-support.c 11734 2014-03-25 18:01:47Z msweet $".
|
||||
* End of "$Id: ipp-support.c 11806 2014-04-09 16:12:27Z msweet $".
|
||||
*/
|
||||
|
||||
+260
-278
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+35
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: ipp.h 11734 2014-03-25 18:01:47Z msweet $"
|
||||
* "$Id: ipp.h 11806 2014-04-09 16:12:27Z msweet $"
|
||||
*
|
||||
* Internet Printing Protocol definitions for CUPS.
|
||||
*
|
||||
@@ -67,6 +67,13 @@ extern "C" {
|
||||
# define IPP_MAX_URISCHEME 64 /* Maximum length of uriScheme values w/nul */
|
||||
# define IPP_MAX_VALUES 8 /* Power-of-2 allocation increment */
|
||||
|
||||
/*
|
||||
* Macro to flag a text string attribute as "const" (static storage) vs.
|
||||
* allocated.
|
||||
*/
|
||||
|
||||
# define IPP_CONST_TAG(x) (ipp_tag_t)(IPP_TAG_CUPS_CONST | (x))
|
||||
|
||||
|
||||
/*
|
||||
* Types and structures...
|
||||
@@ -103,6 +110,8 @@ typedef enum ipp_finishings_e /**** Finishings ****/
|
||||
IPP_FINISHINGS_BALE, /* Bale (any type) */
|
||||
IPP_FINISHINGS_BOOKLET_MAKER, /* Fold to make booklet */
|
||||
IPP_FINISHINGS_JOG_OFFSET, /* Offset for binding (any type) */
|
||||
IPP_FINISHINGS_COAT, /* Apply protective liquid or powder coating */
|
||||
IPP_FINISHINGS_LAMINATE, /* Apply protective (solid) material */
|
||||
IPP_FINISHINGS_STAPLE_TOP_LEFT = 20, /* Staple top left corner */
|
||||
IPP_FINISHINGS_STAPLE_BOTTOM_LEFT, /* Staple bottom left corner */
|
||||
IPP_FINISHINGS_STAPLE_TOP_RIGHT, /* Staple top right corner */
|
||||
@@ -115,6 +124,10 @@ typedef enum ipp_finishings_e /**** Finishings ****/
|
||||
IPP_FINISHINGS_STAPLE_DUAL_TOP, /* Two staples on top */
|
||||
IPP_FINISHINGS_STAPLE_DUAL_RIGHT, /* Two staples on right */
|
||||
IPP_FINISHINGS_STAPLE_DUAL_BOTTOM, /* Two staples on bottom */
|
||||
IPP_FINISHINGS_STAPLE_TRIPLE_LEFT, /* Three staples on left */
|
||||
IPP_FINISHINGS_STAPLE_TRIPLE_TOP, /* Three staples on top */
|
||||
IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT, /* Three staples on right */
|
||||
IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM, /* Three staples on bottom */
|
||||
IPP_FINISHINGS_BIND_LEFT = 50, /* Bind on left */
|
||||
IPP_FINISHINGS_BIND_TOP, /* Bind on top */
|
||||
IPP_FINISHINGS_BIND_RIGHT, /* Bind on right */
|
||||
@@ -400,7 +413,8 @@ typedef enum ipp_orient_e /**** Orientation values ****/
|
||||
IPP_ORIENT_PORTRAIT = 3, /* No rotation */
|
||||
IPP_ORIENT_LANDSCAPE, /* 90 degrees counter-clockwise */
|
||||
IPP_ORIENT_REVERSE_LANDSCAPE, /* 90 degrees clockwise */
|
||||
IPP_ORIENT_REVERSE_PORTRAIT /* 180 degrees */
|
||||
IPP_ORIENT_REVERSE_PORTRAIT, /* 180 degrees */
|
||||
IPP_ORIENT_NONE /* No rotation */
|
||||
|
||||
# ifndef _CUPS_NO_DEPRECATED
|
||||
# define IPP_PORTRAIT IPP_ORIENT_PORTRAIT
|
||||
@@ -503,15 +517,21 @@ typedef enum ipp_status_e /**** IPP status codes ****/
|
||||
IPP_STATUS_ERROR_DOCUMENT_PERMISSION, /* client-error-document-permission-error */
|
||||
IPP_STATUS_ERROR_DOCUMENT_SECURITY, /* client-error-document-security-error */
|
||||
IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE,/* client-error-document-unprintable-error */
|
||||
IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED, /* client-error-account-info-needed */
|
||||
IPP_STATUS_ERROR_ACCOUNT_CLOSED, /* client-error-account-closed */
|
||||
IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED,
|
||||
/* client-error-account-limit-reached */
|
||||
IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED,
|
||||
/* client-error-account-authorization-failed */
|
||||
|
||||
/* Proposed extensions for paid printing */
|
||||
/* Legacy status codes for paid printing */
|
||||
IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED = 0x049C,
|
||||
/* cups-error-account-info-needed @since CUPS 1.7/OS X 10.9@ */
|
||||
IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED, /* cups-error-account-closed @since CUPS 1.7/OS X 10.9@ */
|
||||
/* cups-error-account-info-needed @deprecated@ */
|
||||
IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED, /* cups-error-account-closed @deprecate@ */
|
||||
IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED,
|
||||
/* cups-error-account-limit-reached @since CUPS 1.7/OS X 10.9@ */
|
||||
/* cups-error-account-limit-reached @deprecated@ */
|
||||
IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED,
|
||||
/* cups-error-account-authorization-failed @since CUPS 1.7/OS X 10.9@ */
|
||||
/* cups-error-account-authorization-failed @deprecated@ */
|
||||
|
||||
IPP_STATUS_ERROR_INTERNAL = 0x0500, /* server-error-internal-error */
|
||||
IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED,
|
||||
@@ -790,6 +810,9 @@ struct _ipp_s /**** IPP Request/Response/Notification ****/
|
||||
|
||||
/**** New in CUPS 1.4.4 ****/
|
||||
int use; /* Use count @since CUPS 1.4.4/OS X 10.6.?@ */
|
||||
/**** New in CUPS 2.0 ****/
|
||||
int atend, /* At end of list? */
|
||||
curindex; /* Current attribute index for hierarchical search */
|
||||
};
|
||||
# endif /* _IPP_PRIVATE_STRUCTURES */
|
||||
|
||||
@@ -984,6 +1007,10 @@ extern int ippValidateAttribute(ipp_attribute_t *attr)
|
||||
extern int ippValidateAttributes(ipp_t *ipp) _CUPS_API_1_7;
|
||||
|
||||
|
||||
/**** New in CUPS 2.0 ****/
|
||||
extern const char *ippStateString(ipp_state_t state) _CUPS_API_2_0;
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
@@ -994,5 +1021,5 @@ extern int ippValidateAttributes(ipp_t *ipp) _CUPS_API_1_7;
|
||||
#endif /* !_CUPS_IPP_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp.h 11734 2014-03-25 18:01:47Z msweet $".
|
||||
* End of "$Id: ipp.h 11806 2014-04-09 16:12:27Z msweet $".
|
||||
*/
|
||||
|
||||
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